freefem++-3.61-1/000755 000767 000024 00000000000 13321644114 013577 5ustar00hechtstaff000000 000000 freefem++-3.61-1/INNOVATION000644 000767 000024 00000233704 13321622623 015220 0ustar00hechtstaff000000 000000 add plugin to save matriox in Harwell-Boeing format (see Harwell-Boeing format) correct bug in trunc (2d) in case of very fine mesh (eps too small ) version 3.61 june 20 2018 correct launchff.exe under windows 64 to choose a filescrip if no parameter add name parameetre kerneln=, kernelt=, kerneldim for disection solve add option in method toClose function in fquatree to get the nearst point (for intersect meshes) add missing file curvature.edp correct the label definition in case of intalledges in 2d add imax,jmax,imin,jmin to get index of row or column of the min ,or max coef. we have: A(A.imin,A.jmin) = A.min Pass to petsc/slepc version 3.8.4/3.8.3 Add cosmetics in macro (macro name, macro line , ...) correct in mpi_comm with mulmps (very rare) version 3.60 NOW the main distribution is a github (28 march 2018 F. Hecht) https://github.com/FreeFem/FreeFem-sources Add new finite Element RT13d (thank of Axel Fourmont) see LaplaceRT13d.edp in examples++-load version 3.59 ( 21 /02 /2018) correct problem with the MeshIndependent() virtual function in all of case (thank to Svetoslav Nakov ) the symptoms is => Sorry error in Optimization ... add: int2d(Th,optimize=0)(...) Add Finite Element P3 Lagrange in 3d (see LaplaceP3-3d.edp ) in examples++-load Add tool to use freefem++ in C, C++ through mmap and semaphore Add new P2pnc 2d finite element a P2 discontinus finite element (like a P2 with continuity of the mode 0 and 1 on edge (i.e.: $\int_E jump(v) p) = 0$ for p polynome degree <= 1 )) see testFE-P2pnc.edp LaplaceP2pnc.edp Add new RT2 RT2ortho finite element Add new discontinus finite element on edge (31/01/2018) P0edgedc, P1edgedc,.., P5edgedc in plugin Element_PkEdge for FreeVol Build version 3.58 for Mac and windows add new finite element P2bulle3 Thank to P-H Tournier and Jet Hoe Tang add new standard function + Global.Add("copysign","(",new OneOperator2(copysign));// Add jan 2018 FH + Global.Add("sign","(",new OneOperator1(sign));// Add jan 2018 FH + Global.Add("sign","(",new OneOperator1(sign));// Add jan 2018 FH + Global.Add("signbit","(",new OneOperator1(signbit));// Add jan 2018 FH + Global.Add("signbit","(",new OneOperator1(signbit));// Add jan 2018 FH unset x,y,z at initialisation to remove bug like Vh u ..; real a=u; // hard to find version 3.58 (Warning add global ff_tgv) set global value of tgv through tgv variable (defaut = 1e30) Add code of initialise Vh whit add of dof in real or complex case real[int] b(Vh.ndof); varf va(u,v) =int2d(Th)(v); Vh u=b; Vh u1= A*b; Vh u2= va(0,Vh,tgv=1); Vh u1= A^-1*b; .. version 3.57-1 - add new function : for FreeVol diffpos(a,b) = max(0,b-a) invdiffpos(a,b) = a *quadtree, overflow in array kbord, change size and add test thank to Yann Guyot version 3.55-3 6 july 2017 ( 4176:3c8b1dd2d3d7) - correct url of slepc - add tool in shell plugin dirbase, basename, cpfile version 3.55-2 - correct internal normal in cas of sens of the normal change from region1 to region2 - correct hsv2rgb fonction in case to take k mod 1. to get pretty color - change mesure -> measure in all example and add the correction in code. version 3.55-1 26 June 2017 (rev: 4164:) - correction in cube (missing initialization) - correction of bug of normal N in 3d in internal boundary, the orientation before are random, now the orientation are given by the face numbering, let a face A,B,C, the normal will be ABxAC/||ABxAC||, for external boundary we do not use the orientation of the face, we use the ext. normal of the tet. Thank to Svetoslav Nakov version 3.55, 21 June 2017 - change the cube construct and correct une cube.edp example to build mesh with 5 tet / hex. - add way to compile in freefem++ PETSc and SLEPc (real and complex) 1) do configure ./configure --enable-download --prefix PREFIX # need MPI and git cd dowload/ff-petsc # petsc and slepc will be install PREFIX/ff-petsc # so you need access to this director make WHERE-all cd ../.. ./reconfigure make make check - correct SLEPc on MacOS due a problem of global variable in dynamics lib => SLEPc and PETSc must be in same plugin on MacOS to day. version 3.54 may, 17th 2017 ? - add complex version of PETSc and SLEPc remarque to day SLEPc must be configure by hand edit file examples++-load/WHERE_LIBRARY like: MBP-FH3:ff-OSX11 hecht$ cat examples++-load/WHERE_LIBRARY slepc LD -L/Users/hecht/work/soft/slepc-3.7.3/arch-ff++/lib -lslepc slepc INCLUDE -I/Users/hecht/work/soft/slepc-3.7.3/arch-ff++/include -I/Users/hecht/work/soft/slepc-3.7.3/include -I/usr/local/ff++/openmpi-2.1/petsc/include -I/usr/local/ff++/openmpi-2.1/petsc/include -I/usr/local/ff++/openmpi-2.1/petsc/include -I/opt/X11/include version 3.53-1 correct problem in adaptmesh mesh with periodic boundary condition (Thank to P. Ventura version 3.53 - add SLEPc interface thank to P. Jolivet - correct problem on incompatibility between send/recv mode the mode isend / recv couple do not work under mpi/win64 => remove version 3.52 (10 april 2017) - first mpi version for window 64 (bug in send/recv mesh) version 3.51-4 ( 28/mars 2017) - do launch ffglut if no ffglut program by default add exec flag -ng (no graphic) -wg with graphic in any cas - correct in ffglut plot with viso given the value of iso was not used before. - add a first version of search basin of attraction (wrong but not to bad see examples++-load/findalllocalmin.edp) - correct pb of mumps_seq compilation PB of missing mpi.h version 3.51-3 (hg version 4013:12749584a75b) - add flags of force the usage of download-package (--enable-download_mumps_seq) - correct compilation process of ipopt package in cas of install mumps-seq version 3.51-2 - correct INNOVATION - correct PB in adaptmesh lost sens of normal in some case => pb with period boundary condition - correct BLASLIBS in case of download openblas in configure. - add 3 fonctions projection(a,b,x) projection on segment [a,b] = min(max(a,x),b) if a< b dist(a,b) = sqrt(a*ä+b*b) and dist(a,b,c) = sqrt(a*a+b*b+c*c); - correct hpddm v 603 ( 25996228 janv. 30 17:18 freefem++-3.51.tar.gz version hg: 3969:310d576bf867 ) - version 3.51 (version 3953:16b99c52b1fc) Wed Jan 25 10:15:53 2017 - correct of Freefem++.app to run undr 10.11 MacOs version - add example of usage of IFmacro in examples++-tutorial/Stokes-macro2d-3d.edp to launch the 2d version do FreeFem++ examples++-tutorial/Stokes-macro2d-3d.edp -Ddim=2 to launch the 3d version FreeFem++ examples++-tutorial/Stokes-macro2d-3d.edp -Ddim=3 - correct a big bug on IFmacro c++ function (infinity loop in some architecture, Thanks to P. Jolivet) - change myrand to randon (better result ???) - add argument like -Dmacroname=macrodef to def macro - add IFMACRO(macroname) codes ENDIFMACRO compile codes if macro variable is def - add IFMACRO(!macroname) codes ENDIFMACRO compile codes if macro variable is undef - add IFMACRO(macroname,val) codes ENDIFMACRO compile codes if macro variable is def and equal to val val is a string - correct bug in colon operator : real[int,int] r(100,3); r(59,:)=1; => Exec error : Out of bound - version 3.50-2 (version 3917:2affb5616fe3) - correct pb in configure for hdf5 c++ if missing file H5Cpp.h - update hpddm to 082f06f633d912e879c93258df53234f9c94e492 - put myrand() function to have the almost same mesh under mac and unix - version 3.50-1 - correct fini element P2BR - correct md5 code for blas.tgz file - correct bug in distance plugin add test examples++-load/testdist.edp to see ans correct the bug. - correct bug in color when mixing line and iso. (Thank to Jon Sauer) - correct bug in examples++-load/ttestio.edp in case of the no existence of file "spherewithahole.mesh" (after clean) - pass to version 5.0.2 of MUMPS - add new function stuff in arpack interface see examples++-eigen/LapEigenValueFuncV2.edp - pass to version 3.50 WARNING ffglut interface - add send, recv, broadcast of real[ini,int] , ... array - add plot of multi curve (array of array int 2d, 3d , with color see testplot.edp version 3.49-1 - add new function in examples++-tutorial/movemeshsmooth.idp to do movemesh with some Laplacien Smoothing (see file for doc. ) - change HeapSort.hpp (put c index rather to shift array) - correct problem of size of the arrowhead when zooming - add tools to extract border of 3d surface int[int] bb(1); int nc= getborder(Th3s,bb); nc nb of border (curve) the list vertex number curve i is bb(k) for k in bb(i) to bb(i+1)-1; see bottle.edp mesh examples in 3d examples directory. version 3.49 - add tool to compute integral with mapping on test or unknown function (in test just in 2d to day and only on varf definition int1d(Th,mapu=[x+1,y],mapt=[x-1,y]) ( ...) int2d(Th,mapu=[x+1,y],mapt=[x-1,y]) ( ...) - add distance plugin to computation the signed distance to a curve defined by a iso isovalue of P1 finite element function (see distance*.epd examples ) - change fixeborder in fixedborder in buildmesh version 3.48 (7 sep 2016) - add doc for time depend Stokes problem with matrix (O. Pironneau) - add doc for time depend Heat problem with matrix (O. Pironneau) - correct a very old bug (F. hecht) the return, exit, break and continue instruction in freefem++ is code with exception so this imply before the foget of delete some variable or delete to much variable this problem is coorect but I have make all of change in the kernel of freefem++ example of wrong code before ofstream f("out.txt"); f << " bla bla \n"; exit(0); // the file is empty because never close due the no destruction of variable f. - add spline interface of gsl library in gsl plugin see gsl.edp examples. version 3.47 (1/june/2016) - tools to build new FiniteElement2d and FiniteElement3d from quadrature formula FiniteElement2d EFQF(qf23pT); fespace Zh(Th2d,EFQF); FiniteElement3d EFQF3(qfVp14); fespace Zh(Th3d,EFQF3); - add solveurs FETI and BDD in HPDDM - add savegmsh in gmsh plug in to write file for gmsh (thank to Lo Sala salalo80@gmail.com) see ttestio.edp for the examples version 3.46 version 3.45-1 - add new finite element to store value a quadrature point. in plugin Element_QF (see exemples++load/Element_QF.edp) in 2d FEQF1,FEQF2,FEQF5,FEQF7,FEQF9 corresponding resp. to quadrature qf1pT,qf2pT,qf5pT,qf7pT,qf9pT in 3d FEQF13d,FEQF23d,FEQF53d corresponding resp. to quadrature qfV1 ,qfV2 , qfV5 and FEQF and FEQF3d for the default quadrature. - ajout gluemesh of 3d mesh - ajout operator b= A* c; // where is real matrix avec b and c complexe vector. version 3.45 (10 march 2016) - correct very old bug in ffglut, some time we miss wait due to asynchronous stuff and we can have memory error for the same reason . - try use lot of preinstall software (hard job for ubuntu and debian) - pass to tetgen version 1.5.1-beta (the last one) - add Th.hmin and Th.hmax methode to Mesh type version 3.44-1 - add new hpddm example for Stokes problems (Thank to P. Jolivet ) - put the new convect 3d as the default, (newconvect do nothing now). 25/02/16 - try to add new version do 3d convect ( add newconvect=1;) in test ... version 3.44 (22 feb. 2016) - add tools to extract border after movemesh in Curvature plugin) see curvature.edp, can be useful to remesh after movemesh. - restruct the hpddm and petsc plugin ( thanks to P. Jolivet) add lots hpddm and petsc examples in examples++-hpddm version 3.43-33 - remove some spurious print when verbosity = 0 - add initialization of array which string parameter like in string[string] b= ["-1",1,"13","qsdqdq"]; int[string] a=["2",1,"12",4]; - add setw iomap stuff like in: cout << setw(10) << 1 << " " << 3; version 3.34-2 - correct examples++-load/ff-get-dep.awk in case of choose of lib in syntaxe of library depends in WHERE-LIBRARY stuff like in : //ff-c++-LIBRARY-dep: cxx11 [petsc|mumps parmetis ptscotch scotch] scalapack blas [mkl] mpifc fc mpi pthread version 3.43-1 - correct PB with hpddm (pass to git version d2a99d89ee37777d2423da218b29e2080950da1e Jan 20 22:03:12 2016) - correct PB of FLIBS - pass to version 3.43-1 3 feb 2015 version 3.43 (version 3.43 (3626:8e3d8953975d), 2 feb 2016 16;00 CET)) - change RT03d finite element interpolation (put 1 point integration by face) - add renum=false in all trunc fonction of DDM examples - warning change the defaut no renumbering to be sure trunc commute the two mesh must be the same truc(trunc(Th,I),J) == truc(trunc(Th,J),I) remove this version (version 3.43 (3623:882bfbae1bf6, feb 2016 15:30 CET)) - change the trunc function in 2d to keep the ordre of old vertices to remove signe probleme in some restriction operator of RT finite element for example - correct of the formal operator trace (bug was: compute a00 + trace(A), thank to O. Pironneau ) - put hppdm source include in the distribution to have more safe compile process. - update a little the documentation (add new finite element) - add new finite element just for interpolate partition of unity in DDM / HPDDM method Edge23ds0, Edge13ds0,Edge03d in plugin Element_Mixte3d - add new finite element P1bl, P1bl3d in plugin Element_P1bl - add new finite element Edge23d, P1bl,in plugin Element_Mixte3d - change EPSD in eigenv because some trouble occur in very rare case (see G. Vergez) - correct problem for vectorial solution on implicit declaration of product of simple EF like P1b - add tools to compute curvature of border in Cuvature plugin - all implicit loop for lot of array : real[ini], real[int,int], real[string] ,matrix , string[string] the syntaxe is if B is like a Array : for [i,bi: A] bi=f(i); if A is like a matrix : for [i,j,aij: A] aij=g(i,j); see forall.edp example file for more exemple - change the Chinese documentation (thank to Helin GONG) version 3.42 - correct some Makefile - correct optimisation of convect in case on windows bug) - add tool do build quadrature formule when we split triangle in 3 triangle for HCT element. - add new quadrature formula 3d exact form degree 6 to 14 in qf11to25.cpp the name of qfV quadrature are qfVp1 .. qfVp14 - correct optimisation in convect for Navier-Stokes problem.. for this kind of expression + int2d(Th) ( -alpha*convect([up1,up2],-dt,up1)*v1 -alpha*convect([up1,up2],-dt,up2)*v2 ) in this case now only on characteristics is computed - correct trouble in configure this /usr/bin/machine - map&key to know if a key exist in a map int[string], .... version 3.41 - add tools to get mesh of fespace Vh in 2d and 3d mesh th2= Vh2d.Th ; mesh3 th3= Vh3d.Th ; not the type of the mesh is a const pointeur => lot of cosmetic change version 3.40-2 - try to resolve problem with petsc metis and freefem++ metis now freefem++ use petsc lib if petsc is find for parmetis, metis,ptscotch,scotch,fftw3_mpi, mumps,scalapack - correct hpddm examples - rename plugin schwarz in hpddm - correct problem on compilation do scotch version 3.40-1 - move of all hpddm code un examples examples++-hpddm ( Own by P. Jolivet and F. Hecht) version 3.40 (14 sep. 2015) - add new C1 Finite element HCT see examples++-load/bilabHCT.edp - change permission in install example++ for read and write under windows - try to build a windows 64 version under msys64 system ... - Add use ArrowSize= of size version 3.39 - remove compile flags -fPIC under windows - pas to version MUMPS-5.0.1 - correct some problem of memory leak, now the decrement method in RefCount call delete and all decrement are change in Add2StackOfPtr2FreeRC(stack,m); (more safe). so the previous plugin become incompatible. version 3.38-2 - add hppdm explain in the doc. - add function cube to simplify the construction of mesh of cube like square in 2d see cube.edp example. - add function ClosePoint in ClosePoint plugin - add += example of varf - correct mortar example: replace P0Egde in P0 => better result - correct map func if dfft plugin - add splitComm for hpddm version 3.38-1 - add finite element Edge13d (Finite Element of degrees 1) Thanks to marcella@bonazzoli.it and exemples of wave guide in waveguide.edp - correct renumbering function in case of rhs - correct new type of optimisation in integral, (version 3.38 25june 2015) optimized=2 => do optimisation without check can be useful in case of random problem. - correct convect operator in 3d (remove random part, to remove problem of optimisation in varf. 28/7/2015 (ALH) - fixed behavior of "verbosity" to use value from command line ("-v" option) - synchronized lg.ypp with lg.tab.cpp version 3.38 - add parameter in renumbering function. version 3.37-1 (22 mai 2015) - clean examples-mpi, remove of all usage to RemoveDOF, bb2d bb3d, findDiff (see version 3.36) - update schwarz.cpp for new hpddm version - add read of real[int,int], int[int,int], complex[int,int] .. version 30 april 2015 (3319:8657e0526391) - correct freefem++ launch in windows (remove wait when launch vai freefem++) add wait in case of launch through 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 cleaning 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 bb2d bb3d -> boundingbox fast -> ltab=lround(dtab) Unique to get all unique value of a array (findDiff) - after version 3.33 the some compilation flags a lose, correct configure.ac Please do not use version from [3.33 .. 3.35] included. - add disable-gmm configure flags version 3.35 dist (12/3/15) (rev 3246:664a6473d705) (warning slow version) - optional lib seach [toto|tyty] in WHERE-LIBRARY seach lib - change the metis to scotch-metis interface in hips and parms .. - change the current version of scotch metis mumps parmetis - remark: .dll , .so, .dylib are incompatible with previous version. - ff-run.in under windows (use src/bin-win32/FreeFem++-mpi and not src/mpi/FreeFem++-mpi for dll problem). - correction init plugin missing static in int DoLoadInit() ; version 3.34-2 (20/2/2015) (warning slow version) - do correction do compilation for mpi version under window big change in ffapi.cpp rules ( use now call back) end init in mymain. schwarz plugin run under windows without petsc lob. - add some function to gsl interface airy ...) version 3.34-1 - correct lot of mistake for simple compilation of hpddm interface .. - add no mandatory lib for petsc write the WHERE-LIBRARY search lib in awk (more simple ) version 3.34 (warning slow version) - configure : 6/02/ 2015 correct mpi for sgi uv computer find gsl lib add find petsc (in progress) add missing file in distribution - correct for compilation with g++-4.9.1 -std=c++11 ( without download) BUG in configure => slow version after until version 3.36 , 25 mars 2015 ... (dur Dur) no optimisation flags in compilation - add hd5 interface (13/01/2015) Thank to Mathieu Cloirec CINES - http://www.cines.fr voir example iohd5-beam-2d.edp iohd5-beam-3d.edp - add find of libgsl in configure script - correct pb of memory leak in case matrix A = ...; in loop ( this occur in lot of case, tanks to P. Jolivet ) correct small memory leak in use of routine due to debugstack. - correct bug in periodic condition in case common dof with periodic. - correct big bug in memory management of sparse matrix 4/3/2015 (ALH) - Edited for compatibility with Emscripten - Added calls for Javascript graphical output along with postscript output 15/10/2014 (ALH) - Enabled monothreaded downloads in download/getall for platforms that do not support threads (eg Mingw) - Corrected --disable-pdf configuration option (useful for FFCS build) - Removed obsolete cvs history directives - [[file:download/getall]] now checks downloaded packages against known MD5 values version 3.32 - correct of problem of plugin and mpi, build all dynamics lib with and without mpi, the mpi version is install dir lib/mpi - correct of plugin MUMPS.cpp for complex value. - add vectorial operator a/v and v/a where a is scalar and v vector like real[int], ... version 3.31-3 (rev 3053:4e164226411d 12 Aug 2014) - correct the problem of size of arrow in 2d plot version 3.31-2 (rev 3052, 11 July 2014) - correct stop test function in LinearGC (for zuqi.tang@inria.fr) build tar.gz distribution (rev 3050) build version MacOs 3.31-1 - correct bug put in DG formulation (rev 3044) jump, mean , was wrong from Sun Jun 29 22:39:20 2014 +0200 rev 3028 version 3.31-1 (rev 3042, 10 july 2014) - function to put your stop test in LinearGC and NLGC the prototype is func bool stop(int iter,real[int] u,real[int] g) ; { return g.linfty < 1e-5 || iter > 15;} LinearCG(DJ,u,eps=1.e-15,nbiter=20,precon=matId,verbosity=50,stop=stop); - add functionnal interface to arpack (Eigen Value) func real[int] FA(real[int] & u) { real[int] Au=A^-1*u;return Au;} func real[int] FB(real[int] & u) { real[int] Au=B*u;return Au;} int k=EigenValue(n,FA,FB,sym=true,sigma=sigma,value=ev,vector=eV,tol=1e-10,maxit=0,ncv=0); see examples++-eigen/LapEigenValueFunc.edp for a true example version 3.31 (rev 3037, 1 july 2014) - re-add tan function for complex number - correct a big mistake in LinearGMRES , the result are completely wrong, correct also the algo.edp - add sqr function of O. Pironneau - correct update of mercurial depot (rev 3034, 1 july 2014) - correct mistake in examples++-3d/MeshSurface.idp about computation metric in function build surface Sphere mesh and add a function to build Ellipsoid surface mesh func mesh3 Ellipsoide (real RX,real RY, real RZ,real h,int L,int orientation) - correct a bug the DG with periodic boundary condition with only one layer of element. - add pluging "bfstream" to write and read in binary file (long, double, complex and array) see bfstream.edp for an example. version 3.30-1 may/2014 ( hg rev: 3017) - add levelset integral on 3d case ( on levelset and under level set) - correct problem with Ipopt / lapack configure ... - add BEC plugin of Bose-Enstein Optimisation - standardisation movemesh3 -> movemesh ( same parameter of 2d version ) - correct jump in basic integral to be compatible with varf definition jump is not zero on boundary, it is - boundary value .. fespace Ph(Th,P0);u= 1;int1d(Th)( jump(u) ) = - length border . 30/6/14 (ALH) - [[file:download/getall]] - now checks downloaded packages against known MD5 values - new -h inline help option version 3.30. ( for windows hg rev : 3013) - add binary ios:mode constant, to open file in binary mode under window to solve pb of seekg under windows - add multi border April 23 2014 , (hg rev : 3004) syntaxe example: // i is the index of the the multi index // the number of sub border is given by the size if the array to set the number of seg on the border .. // so for multi border the number of seg of the border , must be in int[int] array 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]; border bb(t=0,1;i) { // cout << " i = " << i << endl; 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]; plot(bb(nn),cc(NC),wait=1); mesh th= buildmesh(bb(nn)+cc(NC)) ; plot(th,wait=1); - add ltime() (rev 2982) function returns the value of time in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, (int) - add new macro tool like in C (rev 2980) FILE,LINE,Stringification() to get line number and edp filename, add quote to a parameter after macro generation … Like in cout << "in " << FILE << " line " << LINE << " -- '" << Stringification( "zzz" aa () {} + /* */ bb cc) << "'" << endl; add new int2d on levelset in 3d (int test) add basic func mesh3 Cube(int nx,int ny,int nz) in cube.idp file. version 3.29 (hg rev 2973) - add int storagetotal(); and int storageused(); function to get static of malloc ( memory storage usage) - correct problem of region evaluation in jump and mean function version 3.28 ( merge with freefem++-cs tool) - add download/getall perl script to download all related soft - add int1d on isoline for matrix ... version 3.27 - correct bug in display of P1b finite element in 3d error in SplitMesh function (Thank to O. Pironneau) - add AddLayers(Th,suppi[],sizeoverlaps,unssd[]); - add tool to trunc to get element numbering for Thn to Tho int[int] In2o(1),Io2n(1); Tho = trunc(Tho, x<0, new2old=In2o, old2new=Io2n); - add restrict function for get dof numbering old to new fespace Vnh(Thn,Pk), Voh(Tho,Pk); int[int] n2o=restrict(Vnh,Voh,n2ok); - correct mistake in gsl interface random number (9/1/14) missing all random distribution .. - add interface with gsl random number generation in test .. - correct pb of compilation under window (mingw32/msys) 6/2/14 (ALH) - Creating documentation hyperlinks (in emacs orgtime and in Doxygen format) - New script build/orgindex and file index.org list all hyperlinks in the FF source in Emacs org-mode format - Set all hyperlinks to relative paths to make sure that they work from any location - Separate download script for all third-party software [[file:download/getall]] (request from FH) - created common makefile goals in [[file:download/common.mak]] for all downloaded packages (request from FH) - changed [[file:download/arpack/Makefile.am]] to make use of [[file:download/common.mak]] - done for [[file:download/blas/Makefile.am]] as well - added option --enable-mkl-mlt in [[file:configure.ac::enable_mkl_mlt]] to allow FF to be linked with the multithreaded MKL when an external library requires it (request from Atsushi Suzuki) - cleaned up old comments from the documentation to enable automatic conversion into other formats (eg wiki format) - many small corrections for Windows compilation - added "NbColors" in plot() parameters version 3.26-3 09/12/2013 correct problem with openblas need pthread lib 01/12/13 install dowload lib update lapack interface in examples. add WHERE_LIBRARY-file in install change the order of seach lib with WHERE_LIBRARY-download WHERE_LIBRARY-config WHERE_LIBRARY remove all relative in WHERE_LIBRARY-config correct of superlu compile problem 13/11/203 Pass to version 3.26 ... - correct pb of ambiguity with new complex lib 31/10/2013 compilation on MacOS 10.9 with compile of xcode 5.0.1 - correct the pipe.cpp to compile with clang-500.2.79 - remove of warning message generate by clang++ -std=c++11 (version clang-500.2.79) - correct also compilation problem - correct error in case of block matrix with block of 0 row or 0 column. 21/10/2013 (ALH) - umfpack configuration cleanup (request from Fred) - blas configuration cleanup (request from Cico) - configuration option --enable-generic-blas has no effect anymore, removed - Atlas compilation directives have no effect anymore, removed - Moved OpenBLAS compilation from FFCS source tree to FF source tree - Added configure option --disable-system-fftw to skip any default FFTW library installed on the system - Changed location of lapack WHERE-library setup in [[file:configure.ac::WHERE_lapack]] to insure that it is always defined (request from Fred) - changed FFCS Fortran MPI configuration for MPICH2 - split DOC makefiles into Makefile.am and figs.mak to suppress automake warnings about portability - moved build/download script from FFCS to FF before reorganizing FF downloads (request from FH) 10/9/2013 (ALH) - Corrected pastix compilation for FFCS on MacOS 10.6 - Removed dependency from lg.ypp to lg.tab.?pp in [[file:src/lglib/Makefile.am::lg.tab.?pp]] to avoid automatically generated conflicts 05/09/2013 put version .tar.gz on the web - correct makefile wget in pastis and superludist - correct compile of load example : paradiso, gsl automaticaly - add AutoGeneratedFile.tar.gz a file contening all file build by autoreconf in case of non automake tools (1.13) - add missing file in dist or in mercurial distribution - correct download of scotch un curl - correct problem in a*[b,c, ... ]' in case of complex value 5/9/2013 (ALH) - force Umfpack build to run sequentially (parallel make crashes with "pipe from processes is a directory"?) - pARMS download URL changed to http://www-users.cs.umn.edu/~saad/software/pARMS/pARMS_2.2.php (thanks Fred) - corrected download/mumps parallel compilation (WHERE was not built properly) - Removed all Mercurial-tracked files from .hgignore - added options --with-[package]-include= and --with-[package]-ldflags= to avoid downloading existing packages - Parallelized MUMPS compilation in download/mumps (and mumps-seq) - Applied a patch from Fred for compiling SuiteSparse on Slackware64-14.0 - Added configuration option --enable-hypre (disabled by default, contrary to other tools) - Deactivate FFTW download when a local version is found (request from Helmut Jarausch) 10/7/2013 (version 3.25) - remove of Makefile.in configure for the hg distrubion use : autoreconf -i # too build Makefile.in before to configure need automake version 1.13 ... - merge FFCS (ALH) version and ff++ version (FH) of freefem++ programs - remove all automake file form the hg data base - add new parameter to ffglut for demo of freefem++ ffglut [-nv|-v|-vv|-vvv] [-wait 0.5] [-g 512x300+10+10] [-t title] [file] all number can be change the wait is in second 0 is default value nowait between plot -g 512x300+10+10 is the geometry of the graphic window -t the title of the windows 26/6/2013 (ALH) - created a build/ subdirectory for build tools - enabled parallel make ("make -j") - created a separate file (acmpi.m4) for complex MPI configuration options - added configuration option --enable-ffcs to make the FF source compatible with FFCS - backported all current FreeFem++ patches for FreeFem++-cs into the FreeFem++ - started main doxygen page mainpage.dox 9/06/2013 - correct extract function of mesh Lo Sala - correct int2d on levelset see example intlevelset.edp - correct automake TESTING part (in progress) - correct typo on the doc with .*= ./= operator - correct bug in RT0 3d , code in the construction of the DOF. the bug is all dof on border face of same element have same dof number. thank to Laurent Bernard version 3.23 - do cleanning in version remove x11, glx, std : freefem++ clean compile option for clang and clang++ compiler - add flags to remove internal boundary in 2d,3d in function change rmInternalEdges=1 - correct glumesh in case of no mesh in 2d version 3.22 - add multi windows graphics ; WindowIndex=0 in plot function add new event in graphic windows * to set/unset default graphics stat to previous plot - add getenv, setenv , unsetenv function in shell plugins for gestion of environnemnt variable for openmp. - correct pb un trunc for 3d mesh with too flat element (sliver) , and cleaning code . - correct bug in gestion of outside flag is 3d in case of brute force (searchMethod>0) version 3.21-1 - correct bug a=b' ; of full matrix - bug in assert on 3d mesh of huge dimension with periodic condition. - correct build Delaunay 3d mesh of set of point. see examples++-load/convexehull3d.edp version 3.21 Feb. 2013 - n, resize in array of finite element function ... see edp array.edp file - correct pb of compilation of Ipopt with clang++ -std=c++11 - correct une NSCahouetChabart.epd examples , and correct un doc. this is a complete rewriting. FH. 12/02/2013. - correct in change function the "flabel=" parameter in 2d and 3d version 3.20-3 - add master= in solver of MUMPS interface to set the master mpirank <0 => distributed matrix. - correct problem in label generation in freeyams (18/01/2013) all label border was set on 1 before. version 3.20-2 - add MUMPS parallel version (in test) - add paradiso seq solver .. version 3.20 - correct isoline plug in case of saddle point - change the compilation tools under windows gcc 4/7 + freeglut / ...) - change the compile tools on mac pass to clang++ - compile ok of c++11 compiler - add formal tools on array [] or matrix [[],[],] for elastic problem. let A a formal array if A is matrix 2x2 or 3x3 : trace(A) , det(A) , Cofactor(A) ; A:A = sum_ij A_ij * A_ij 2*A, A*2 // multiplication by a scalar -add integration on levelset line (in test) version 3.19-2 - correct pb of C in/output in pluging (in test) - correct bugs mshmet pluging in case of double Eigen value - correct typo problem (string size) when a change the default window size in postscript in version 3.19-1 to have more precise postscript plot version 3.19-1 - add tool to create Quadrature formulas 1d,2d,3d with plugind: load "qf11to25" real[int,int] tab1(np,2),tab2(np,3),tab3(np,4); QF1 qfe1(norder,tab1);// 1d QF2 qfe1(norder,tab2);// 2D QF3 qfe1(norder,tab3);// 3D where tab(0,i) = weigth , tab(j,i) = j coord, and norder the order of the quadrature see examples++-load/LaplaceP4.edp for example - correct download auto compile of mmg3d, mshmet, scotch, ... version 3.19 (20 april 2012) - scotch partitionner interface see scotch.edp in examples++-load - add isNaN(x), isInf(x), IsNormal(x) function to check floating point of real value x, see ISO C99. - add function : NaN() and NaN("") to build NaN real number (double in C) . - correct error in macro with operator ./= and .*= - add Ipopt doc (thanks to Sylvain Auliac) - add Ipopt interface (thanks to Sylvain Auliac) - correct 3d trunc bug in case of internal boundary thank to Yoshihiro Tomita . - add new type of array , array of array see taboftab:edp in examples++-tutorial real[int] a; real[int,int][int] m(10); real[int][int] v(10); not well tested. version 3.18-2 - add plugins with sequential mumps without mpi - add conversion of re and im part of complex sparse matrix A = C.im; A = C.re; version 3.18-1 - correct Typo error in example - add generation of error in case of periodic boundary condition non scalar problem. - add tools for adaptation of P2 and P3 finite elements with metrics see APk-AdaptEpsDeltaPk.edp APk-FreeFemQA.edp APk-MetricPk.edp APk-ExplicitPkTest.edp APk-LaplaceDirac.edp - New example in in Chapter 3 Navier Stokes Newton NSNewton.edp - add cod to build matrix and vector form varf in 3d in case of different meshes (in test ) - correct NSprojection.edp chap3 example (PB in out flow BC.) - correct compile of mmg3d v4 plugins (small change in the distribution archive) v 3.18 (11/01/2012) - rewrite the isoline-P1 plugins (new name isoline.{dll,so,dylib} ) see example Leman-mesh.edp and isoline.edp in examples++-load directory - correct bug in cas of resize of array with 2 index (full matrix) - correct assert in MPI in gather and scatter - correct bug in case of return in loop for or while. - correct a=int2d(Th,l)(1) in case simple expression when l is a array. - build a pkg under MacOs for distribution . v 3.17 (17/11/2011) - correct PB of pugins: MUMPS, parmetis, metis, mmg34, mshmet - the new load interface (for more safe IO) - build mpi for windows with msmpi ( begin) memory error after end .. - remove add by default $LIB_MPI in ff-c++ - change the way add thing in freefem++ in case of dynamics load to be compatible plugin with freefem++cs ( solve pb with cin,cout, cerr in dll may be..). LOADINIT(Init); // where init is a class or do addingInitFunct FFinit(100,ffinit,"MUMPS_FreeFem"); // where ffinit the init function ... v 3.16-1 - cmaes interface in scalar and MPI case (thank to S. Auliac) see doc and examples : cmaes-mpi-VarIneq.edp , cmaes--VarIneq.edp - add NLopt interface (thank to S. Auliac) v 3.16 technical stuff: - correct auto load of mumps - add tool to do automatic load or static load (for testing) see MUMPS_*cpp example v 3.15 - correct all examples++ load and 3d rebuild the all.edp and test this examples. - correct version old bug when full matrix (array) A=A;' is now correct (set and initialization ) and add A+=A'; A-=A'; - reput metis 4.0 form netlib ... (pb of compatibility with other // soft hips) v 3.14-1 - change interface with metis 5.0.1 - Complete writing of mmg3d interface with version 4 of mmg3d le plugin is "mmg3d-v4.0", the parameter are the same have command line mmg3d , except the file name are not given. - remove old bug 3D in interpolation P1 operator correct bug 29/08/2011 (thanks to rychet@fzu.cz) remove wrong bulid of KHat (memory out of bound) v 3.14 - correct in configure remove the default -O2 -g autoconf value and add -g in case of --enable-debug - a very old error in the on() functional the bug is with a vectorial finite element like RT0, .. the name of vectorial must be in lexicographic order so u1,u2 is ok but v,u is wrong is correct in version 3.14 the 24/08/2011 - correct trap in check convect-apt.edp example - add the existance of patch in configure v 3.13-3 ( 30 june 2011 Seville) - correct the Hips interface (not to bad , in test) load "hips_FreeFem" int[int] iparm(1);real[int] dparm(1); HipsDefaults(iparm,dparm);) // set def option ( limit to 100 Hips active linear system ). - add interface with MUMPS_4.10.0 version (with automatic download ) - add P1dc3d finite element in pluging "Element_P1dc1" - correct bug in gibbs renumbering in 1 case very sample mesh) - correct bug in interpolation operator with periodic BC mesh Th1=square(2,1), Th2=square(2,2); fespace Vh2(Th2, P1),Ph2(Th&,P1,periodic=[[1,x],[3,x]]);// une couche matrix Jh=interpolate(Vh2,Ph2,op=0,inside=0); Ph2 w=1.;Vh2 wi; wi[]= Jh*w; // wi must be 1, now this ok. v 3.13-1 - correct compilation problem on fedora 13 WITH MPI v 3.13 (25 may 2011) - update the finite element list in documentation - add (load "Element-Mixte") NEW FINITE ELEMENT 2D TDNSS1 sym matrix 2x2 conforme in $\{H(div div) / div(div s)) \in H^{-1} \}$ RT1 and BDM1 conforme in H(div) : Raviart Thomas of Degree 1 and Bezzi, Douglas, Marini RT1 and BDM1ortho conforme in H(curl) : Nedelec Finite Element v 3.12-3 - new finite element in 2d for elasticity in test. TD-NSS0 (see these of Astrid Sabine Sinwel) A New Family of Mixed Finite Elements for Elasticity - add matrice matrix multiply in lapack interface - add tool to change the region and label number change(Th,fregion= integer function to set the region number ) - nuTriangle now given the tet number in 3D. - add mpireduce of matrix to build parallel matrix v 3.12-1 april/2011 see remove examples++-mpi/chaleur3D-superludist.edp - correct the precond of gmres algo in A^-1 : (29 mars 2011) to build a correct Navier-Stokes - add cast TypeOfSolver on int to parametrize the choice of linear solver. - correct intersection of given metrix in adaptmesh (bug introduce in 07/10 version 3.9 in case of convect-apt example v 3.12-1 10 10 fevr 2011 - add VTK write for paraview, examples++-load/VTK_writer.cpp examples++-load/VTK_writer_3d.cpp (see source for moe details) - put comment in the documentation about negative tgv - correct pb blacs mkl (under with mumps) - correct mpiReduce for complex and real data. - add mpiAllReduce(umax,dmaxg,comm,mpiMAX); where for real umax,dmaxg; - add tag verson 3.12-win32 - add inferface for mpi in win32 architecture (form 32 version) v 3.12 17 jan 2011 - correct probleme of comm world on SuperLuDist (complex version) - correct medit Makefile.am in case of no compilation of medit .. - correct a lot of MPI parallel solver example a bug pastix interface ??? MUMPS, superludist, hypre , hips works - correct link problem in hips and hypre under linux - Add thresholdings.cpp thresholdings.edp in examples++-load to remove to small coef in a matrix . - Add lots of DDM Schwarz GMRES preconditioned with a coarse grid solver por overlapping : DDM-Schwarz-Lame-2d.edp DDM-Schwarz-Lap-2dd.edp DDM-Schwarz-Stokes-2d.edp DDM-funcs-v2.idp DDM-Schwarz-Lame-3d.edp DDM-Schwarz-Lap-3d.edp DDM-Schwarz-macro.idp I will add the explanation in the doc in the future; - Add a true exemple to build mesh form a image (lg.pgm) , Leman-mesh.edp - Add New syntaxe in macro generation NewMacro a(i) EndMacro with // comment and macro definition, first trick - Add interface with special function of gls http://www.gnu.org/software/gsl/ the full list is in the example examples++-loal/gsl.edp v 3.11-1 25 dec 2010 - Add coarse preconditioner in MPIGMRES[23]d.edp (to be optimal) now the number of iteration is close to 10. - Show ff++ line number in case of assertion in RNM class. - add Coarse Preconditionner for MPIGMRES[23]d.edp (Good) - solve bug For MPIGMRES2D.edp due to interpolation bug in rare case by Add brute force for seach of point in 2d like in 3d in the search in find ouside set global variable : searchMethod=1; // more safe search algo (can be expensive in case of lot of outside point) - add hack of ILU precond, if tgv is < 0 then we remove all the line and put 1 on the diag term .. v 3.11 9 dec 2010 - update the documentation of 3d adaption process and / correct freeyams,mshmet, mmg3d interface and associated example - configure is compatible with MKL lib (on gnome) - add quoting argument in macro argument with { } for mpi plot .. v 3.10-2 - try to compile with MKL libs. - correct MPIGMRES[23]d.edp example add doc on this example. v 3.10-2 - add operator to inverse permutation to set or initial int[int] array I=J^-1; if J is a permutation of 0:n-1 then we have : I[j[i]]=i - correct comment problem of periodic boundary condition in 3D see examples++-3d/periodic-3d.edp - correct configure to scotch compilation (phtread) v 3.10-1 - at convection function form formal array to int,real,complex array (resp. toZarray, toRarray, toCarray) - correct ffrandom.cpp to read /dev/random to get a true random seed srandomdev - add ff-mpirun script to simplify the launch of FreeFem++-mpi version - correct MPI for MPI icc on gnome - correct pb of computation of area, lenbord in mesh type in some case . - correct WHERE_LIBRARY-config for blas find in configure - correct atof v 3.10 - add true Domain Decomposition example in 2d and 3d. see MPIGMRES2D.edp MPIGMRES3D.edp in MPI examples - add mpi Isend/Irevd for complex struct like matrix, meshes for send/recv Huge objet - add named parameter verbosity= in add GMRES and GC function for show algo evolution . - add MPIGC dynamic LIB for // GC and GMRES , add fully // scharwz RAS in MPIGMRES2d.edp - correct problem of a=A^-1*b when a, or b is not consecutive array ie. expression like M(2,:) - correct problem of Makefile in download clean,install,WHERE target v 3.10 ( 5 oct 2010) - add install of missing MPI dynamics lib. add argument "-cd" to FreeFem++ command to change current directory to edp script directory - clean configure.ac - do correction for g++-4.6 compiler (lambda expressions , and trap ..) - add MPICG for Parallel Conjugate Gradient for full split matrix see MPICG - correct Makefiles in download ( add WHERE interface) - remove wait option in medit because the code is wrong , always waiting now - correct bug renumbering of matrix : B= A(I,J), the last term N,M was force to zero =+ -> += (line 1885 of file lgmat.cpp) where N= I.max, M=J.max v 3.9-3 - correct compilation of gmm, mumps on linux - add parameter -ne in FreeFem++ commands to remove edp script print - correct mistake in --enable-m64 or --enable-m32 (suppress the configure warning) - correct of ff-c++ script if whith space in path (for windows) - add compilation of gmm library v 3.9-2 - correct compilation of mshmet dynamic library - correct pb of compile of superludist ( add CNOFLAGS no optimize CFLAGS) - correction of lib on win32 for freeyams and mmg3d - correction download/Makefile.am to be sure than bin is a directory. - add fftw of win32 v 3.9-1 - correction mmg3d interface (J Morice) - correct of mmg3d and freeyams under wind32 (ld problem) v 3.9-1 August 2009 (For FreeFem++ days ) - correct configure (find lapack lib change $ll_lapack_libs in $ll_lapack_lib) - correct mistake in mpi add: gatherv, allgatherv, scatterv, alltoallv and complex data type in: allgather, gather, scatter, alltoall, .. correction bug : gather, scatter correct essai.edp mpi example - correct problem of compatibility of dynamic lib with and without MPI change ff-cc++ to add all MPI libs if MPI version exist. - correct default region number in square build mesh function now 0 , (2 between v3.8 -- 3.9) - change in all example reffacexx= in labelxx= ..., etc to be correct with v 3.8 change. - correct a mistake of type region= parameter in tetgen all functions. - correct the mpi configure search tool miss when no full path are given ( only change in configure.ac) v 3.9 July 2009. - add lots of automatic compilation of download software, tetgen superlu fftw metis yams mshmet blacs parmetis scalapack scotch superludist MUMPS pastix hypre hips For the link with mmg3d software put the tar.gz archive in .../dowload/pgk directory. add interface with freeyams, mmg3d, mshmet (3d mesh adaptation) software, add automatique compilation of // solver with flags -auto in ff-c++ commands v 3.8-2 - add cast operator from SubString to String - correct the SubString tools v 3.8 - add in change mesh2 tool to make a renumbering of vertex for periodic 3d mesh. Th= change(Th,renumv=old2new); - correct ' operator do alway in complex case the conj and trans (Hermitian stuff) in formal array with [ ]' in linear comb of complex matrix now A + (-1)*A' is zero is A is hermitian . in varf term (a*dx(u)*dy(v) )' <=> a' dx(u)*dy(v) now you can [a*dx(v),dy(v)] ' *[a*dx(u),dy(u)] in complex case.. - plot of complex field and 3d vector .. - upgrade the documentation in 3d mesh example - change configure.ac for mpifc, mpif77, mpicc, ... - correct include seach path - uniformize named parameter in change, movemesh, in load "msh" , glumesh, ... add synonyme: refface= -> label= reftet= -> region= in buildlayer: labebup= labebdown= labelmib= - writing schwarz-nm-3d.edp examples - add array of 3d mesh - add word volume to get the volume of the current tet element - correct metis.cpp in 3d case - correct in fflapack.cpp (example++-load, computation of eigenvalue of complex matrix) -llapack search in configure.ac and unify fflapack.cpp lapack.cpp are the same file. - add seekp, tellp method on ostream type seekg, teeg method on istream type see examples++-tutorial/readmesh.edp examples v 3.7-1 13 jan 2010.. - EqPoisson.edp (Solve Poison equation in 3d fish) - add possibility to put array (int[int] ) to set a set of label/region in in integral (int1d,int2d,int3d) or "on" key word example : int[int] l=[1,2,3] , ... on(l,u=1); - add tool to compile under mingw/msys under windows 32 (freefem++-nw works, - add bug (random trap) in bamg in sub domain computation in case of internal edge in same region (fist time in 15 years). - add bug in varf interpretation in complex case (miss some conversion) - add build interpolation matrix in 3d (see examples++-3d/mat_interpole.edp) - correct CFLAGS (add -fFIP) in superlu , umfpack under 64 architecture. v 3.7 8 december 2009 add 3d beam examples examples++-3d/beam.edp correct install problem due to metis directory add dynamic load interface with newuoa fortran optimizer without derivative see ffnewuoa.edp example ins examples++-load correct problem of free of mesh in case of gluing meshes Th= Tha+Thb; // now just the ref counter on Th is decrease // and before Th is delete add .im, .real method on complex [int,int] matrix array add missing matrix[int] type in grammar. correct mistake in generation of file WHERE_LIBRARY-config add initialization of scalar variable at zero add warning in case of use of variable with hide freefem++ name add missing file in download version v 3.6.1 correct font problem in documentation lot of mistake in examples++-load add tool to compile all examples add PICHON stuff for brute force search point add umpack long interface to by pass the 32bit limits see UMFPACK64.cpp and LapUmfpack64.edp in examples++-load. add some interface with lapack (inverse of full matrix, eigenvalue of full matrix) correct ::Draw undef ref. ubuntu 10. (gcc 4.4) correct typo error image tools see UMPACK64 (code and example in examples++-load) v 3.6 (4 nov 2009) change the version of tetgen to 1.4.3 download correct in ffglut max value of arrow add examples of function with stack parameter in examples++-load/funcTemplate.cpp load facility and examples++-load/funcTemplate.edp add tools to read .pcm files for optic-flow computation (pcm2rnm.cpp) see http://www.cs.otago.ac.nz/research/vision/Research/OpticalFlow/pcm.html correct bug in GMRES without preconditionner assert error. correct a rare and ramdomly bug in the interpolation 2d process when the the element 0 touch the boundary correct on versy old bug in bamg in case of internal boundary edge with two extremity in true boundary (symptoms FillHoleInMesh trap). correct operator subscript a:b:c operator (in some case the last value was miss) correct the ?: operator in case of constant array - add -enable-m32 flag to build 32bits freefem++ on 64 architecture computer - correct eigenvalue.cpp in case of complex finite element v 3.5-2 (28 sept. 2009) - correct install problem under windows (metis.dll do not compile) - correct MacOS install missing /usr/local/lib/ff++/3.xx-yy link v 3.5-1 (24 sept. 2009) not to bad ... - add interface to metis - correct display of 3d mesh (with light today) - add trap in case of mesh with negative volume - correct bug in case 3d finite element with constant number of df / node example fespace Vh(Th2,[P1,P1]); or fespace Wh(Th3,[P0,P0,P0 ]) - correct problem with tetgen under windows and ubuntu (remove optimization during compilation of the library) - correct setting array of vectorial finite element Wh Wh[int] [u,v](10); // array of 10 value u[1] or v[1] 2 component function for indice 1. [u[2],v[2]] = [1,2]; // set the function for indices 2. - correct in matrix size of matrix B=A(I,J) to I.n x I.m where I, J are array of int - add resize of complex sparse matrix - Add inferface with metis in examples++-load (metis.cpp, metis.edp) v 3.5 (27 aug. 2009) Complet writing to MPI interface, tested with Open MPI 1.2.3 and mpich 2.1 see chapter 10, page 229, of the freefem++doc.pdf and see example++-mpi/essai.edp. correct operator a(:)= 1:4; // before change a copy of a and so do nothing string[string] s; s[i]; // before trap (two delete) v 3.4-2 add boundary mesh inquire in 2d and 3d Th.nbe ; // return the number of boundary element Th.be(k); // return the boundary element k $\in \{0,...,Th.nbe-1\}$ Th.be(k)[l]; // return the vertices l $\in \{0,1\}$ of boundary elmt k Th.be(k).Element ; // return the triangle containing the boundary elmt k Th.be(k).whoinElement ; // return the edge/face number of element containing the boundary elmt k Th[k].adj(e) ; // return adjacent element to k by edge/face e, and change // the value of e to the corresponding edge in the adjacent element Th[k] == Th[k].adj(e) // non adjacent element Th[k] != Th[k].adj(e) // true adjacent element do small change in msh3.cpp file v 3.4-1 rewrite of the mpi interface in vue of use group and communicator now we only use mpi.h and not mpi++.h add plot of array of mesh and array of finite element functions add new command in ffglut graphic interface n,N,i,I to change the number of iso-value and to set the min,max value to the graphic add left button motion to zoom , and + alt to translate V 3.4 add in parallel version mpi send, receive and broadcast of 3d mesh and matrix ( sparse matrix). build a 3d mpi schwarz example (see example++-mpi/schwarz-3.edp) make a wrapper (launchff++.exe) to launch freefem++ under windows/OS in the edp file directory. correct in interpolation matrix ( unset variable in case of same mesh => missing some term in the matrix) V 3.3-3 add missing file in distribution examples++-load/DxWriter.cpp V 3.3-2 8 June 2009 add 2 new finite element: Edge03d : the Nedelec 3d Edge finite elements. RT03d : the Raviart-Thomas 3d finite elements correct the size of anytype for 64 bits architecture. install the new .idp file (include of edp file) in directory idp V 3.3-1 1 June 2009 to correct the problem of the destruction of parameter in case: func real[int] a2(real[int] a) {a[0]=2; return a;} so now the parameter cast to KN_ so the array is not duplicate like in C++, and the value of the parameter is change. - simplify the internal (C++) definition of array now of 2 type KN<> * of variable (left expression) and KN_<> of right expression - correct UnRef where B ~ A* v 3.3 29 may 2009 - correct some problem in return in function : the following function prototype now work without memory fault. func real[int] a1(int n) {real[int] a(n);return a;} func real[int] a2(real[int] &a) { return a;} real[int] G=[7,8,9]; func real[int] a3(real[int] &a) { return G;} func mesh carre(int n) { mesh th=square(n,n); return th;} (lot of change, warning: now KN is not a freefem++ internal type). warning : - in int3d flag qfV= a 3d quadrature formula the 3d quadrature formula are qfV1 , qfV1lump, qfV2 , qfV5 (where the number is the order of the quadrature) - correct sign of the normal in 3d (now the normal is exterior) ------------------------------------------------------------- - correct in adapted mesh the flag splitin2= (no tested) - correct the convect operator in 3d - add EigenValue tool for 3d case May 15, 2009. v 3.2 - add tools to set array like in matlab/scilab real[int] a(1:2:10), def a to 1,3,.. 10. int[int] I(0:n-1) , set array of size n to 0, .., n-1 real[int] b(0.1:0.5:9.99) , set 0.1, 0.6, 1.1,..., 9.6 add : b.n == (9.99-0.1)/0.5 +1 - sort(a,p); // sort a is and array and p in parallel where is a integer array same size of a. - add interface with MUMPS parallel solver (in progress) http://graal.ens-lyon.fr/MUMPS/ - rename movemesh2D3Dsurf in movemesh23 and change named parameter normal= in orientation= - add periodic boundary in condition like in 2d example for a cube with label face numbering 1 : ( x == xmin) 2 : ( x == xmax) 3 : ( y == ymin) 4 : ( y == ymax) 5 : ( z == zmin) 6 : ( z == zmax) fespace Vh(Th,P2,periodic=[[1,y,z],[2,y,z],[3,x,z],[4,x,z],[5,x,y],[6,x,y]]); - automatic: Finite element name conversion between 2d and 3d old : fespace(Th3,P13d); new : fespace(Th3,P1); - add complete rewrite of the way to set parameter of the sparse solver for parallel solver ( no progress) - add --enable-m64 for 64 bit compilation flags - correct f2c of take the -m64 flags - build the universal f2c library with 4 architecture ppc i386 ppc64 x86_64 v 3.1-1 - add resize of sparse matrix ( only morse matrix) - add new 3d finite element P1b3d (P1 bulle 3d) - add new option in int1d function in case for build matrix with different meshes mortar=1 ( do not remove integration point if the point is outside of the domain) to make no to bad integration on same curve with different meshes. v 3.1 -correct compile order missing libMesh - add lighting in ffglut (key l) for 3d isovalue v 3.0-6 - correct int2d in 3d. bug in Face -> tet mapping (PBord method) March 5 2009 change the postscript plot dimension to be in A4 paper. nuTriangle given the tet number in 3d case (5 march 2009) area given the area of the triangle on 3d border integral. - add tool to required edge in adaptmesh with label of edges. - correct dy(uh) (always 0) for P13d finite element (27 jan 2009) op==op_dy => op==op_dy line 97 P012_3D.cpp v 3.0-5 (20 jan 2009) - correct array 3D FE function + missing function in 3D (not finish) - correct the install on under windows / cygwin add src/Graphics/ff-win32.cpp missing file in tar.gz under windows correct ff-c++ under cygwin compile (fist test) - automatic compilation of BLAS, suppress the automatic compilation of BLAS atlas (to long) - ffglut improvement - now save 10 graphic states and use "p" key to show previous graphic - do automatic z rescale on Z direction the 3d plot v 3.0-4 (05 jan 2009) - correct int2d in 3d case: all this integral was multiply by 2. - add 3d viewing in plot (in test) v 3.0-3 (27 dec 2008) - build a not to bad version - remove so crazy print - change the ffglut io with freefem++ ( to be more universal independent of the architecture an more universal) - correct ffglut in case of plot of array and when the plot is empty. remark ffglut is not compatible with previous version (sorry) the filename create with option w is ffglut_xxxx.ppm (window dump) correct int2d on 3d mesh3d for Neumann Boundary condition v 3.0-2 ( 9 dec 2008) - ff-c++ to dynamic load program (add ff++.hpp file with all include, may be) - correct the Makefiles et load-link, - correct ffmedit (binary read /win32) - cosmetic change in ffglut + stabilization v 3.0-1 (4 dec 2008) - complete change of the graphic (freefem++ is now the old freefem++-nw ) - add medit (a viewing software by P. Frey) inside freefem++ with a name ffmedit - suppress the ide version see page: http://www.ann.jussieu.fr/~lehyaric/ffcs - We put a client-server architecture (freefem++,freefem++-nw) <-> ffglut - freefem++-nw and freefem++ is now the same file - ffglut is the viewing software in glut library (run on linux, mac, win32) how to use now: freefem++ file.dp # by default load ffglut (so ffglut must be in the PATH). freefem++ -glut ffglut-path file.edp # change ffglut command freefem++ -fglut saveglutfile file.edp # save data plot ffglut saveglutfile # plot a data file freefem++ -nw file.edp # freefem++ with graphics ffmedit # used medit in freefem - now glumesh2D dynamics tool is in freefem++ add operator + between meshes with glu examples++-tutorial/glumesh.edp - add 3 meshing tools in msh3.{so,dll,dylib} operator + between mesh3 add freefem++ function: movemesh2D3Dsurf movemesh3D buildlayers see: examples++-load/buildlayermesh.edp examples++-load/glumesh3D.edp examples++-load/refinesphere.edp examples++-load/tetgenholeregion.edp - add interface with tetgen 3d mesh generator (tetgen.{so,dll,dylib}) add freefem++ function: tetgconvexhull tetgtransfo tetg tetgreconstruction see: examples++-load/buildlayermesh.edp examples++-load/refinesphere.edp examples++-load/tetgencube.edp examples++-load/tetgenholeregion.edp - add interface with medit (medit is now in freefem++ this call ffmedit in medit.{so,dll,dylib} add freefem++ function medit savesol (2d , 3d medit plot) - correct ?: operator with array and real. - correct memory error with valgrind tool (19 oct 2008) In ~ConstructDataFElement() change counter after free nosym eigen call to neupp missing +1 in size of array - correct gestion of the counter of ConstructDataFElement class (09/2008) in Valladolid spain. - add 3D FINITE ELEMENT P0,P1,P2 mesh3 Th("toto.mesh") int3d(Th) , int2d(Th) see examples++-3d/first.edp example v 2.25 - add tool to change lab in mesh see glumesh.edp examples++-load v 2.24-4 - add missing code in case of DG (jump or average) of test function in linear form - add tools to glu meshes (not well test) see glumesh.edp in load examples. - change definition pour interpolation point for P1dc and P2dc (P-G)*c+G now all interpolation point are fully inside the triangle v 2.24-3 - add option resid= in eigenvalue function (see arpack doc) - add formal operator ./ .* between two [ a , b , c ] array v 2.24-2 - correct convect explain in documentation. - correct configure.ac build FLIBS and add check of FLIBS, X11_LIBS value - correct buildmesh trap when degenerate border is create by error. v 2.24-1 - correct periodic condition in case of one edge - correct doc file v 2.24 - bug with border and func this kind of code now works func abc= a(6) + b(4) + c(4) ; func def = d(4) + e(4) + f(6); func bbb= abc + def; plot(bbb); mesh Th=buildmesh(bbb); whare : a,c,b,c,d,e,d are border. - correct bug in periodic Boundary Condition( find by Alexandre Masserey ) mistake in abscise choose. sometime assert fail (loop). add option to the buildmesh that the boundary is fixe (fixeborder=true) see : examples++-tutorial/periodic4bis.edp - and R1.hpp, R2.hpp, R3.hpp files for the 3d version. v 2.23-2 - correct trap in adapdmesh (in mortar-DN-4.edp) in very rare case du to initialized adj of edges on geometry (very old bug) in case of multi points. with verbosity=10; you get this message: -- Begin of insertion process bug 2 Bug double points in .... Fatal error in the meshgenerator 5 .... v 2.23-1 - correct assert fail in check in case of no UMFPACK v 2.23 - add new edge finite element (P1 to P5) in examples++-load/Element_PkEdge.cpp examples++-load/testFE-PkEdge.edp - preconditionned mortar example Neuman -> Dirichet in scalar and parallele see examples++-mpi/mortar-DN-4-mpi.edp examples++-tutorial/mortar-DN-4.edp - add vectorial operator d= a ? b : c where d,a is a array, and b,c can be array or scalar usefull for boundary condition - correct problem in mpi receive message - correct load dynamic on MacOs (bug in fortran find library) in configure.ac v 2.22-2 - small change in configure.ac of find libumfpack on debian system - correct checking code in problem to same the mesh must be unique in problem of solve definition. v 2.22-1 - make change in Makefile to build universal binary on MacOS - change the README file for compilation on ubuntu Linux. v 2.22 (december, 18, 2007) - correct problem of string argument in function - correct all elasticity problem (missing sqrt(2) ) - correct save of log file under Windows XP, .. v 2.21 (november, 18, 2007) - correct documentation for new edition - correct configure for no X11 and UMFPACK in sparsesuite v 2.20-1 (october, 24, 2007) - correct compilation problem without umfpack - add formal operator for vectorial operator in variational form +, - on [ ] array trace operator matrix like [ [ ... ], .., [... ] ] take element of an array [ ...][2] v 2.20 (october, 2, 2007) - add in download automatic generation of f2c and fort77 to get a free fortran compiler just go in (download/f2d;make install) - add automatic find of libf2c in case of F77=fort77 (driver of f2c) in configure - add tools to change the sparse linear solver with load dynamic, see doc and SuperLu example in examples++-load v 2.19 (august, 19 2007) - correct buildmesh from geometry file and add nbvx= named parameter to infore the maximal number of vertex in a mesh. - add Th[k].area to get the area of the k-th triangle of Th. - add Th[k].region to get the region number (label) of the k-th triangle of Th. - correct string delete in plot of border (mesh.edp) - correct mean and jump in interpolation operator. v 2.18-1 (august, 2007) - correct old bug under Windows: the std input stream now works (cin) v 2.18 (july, 19, 2007) - add sort of real array or int array, syntax: a.sort, and we have : a[i-1] <= a[i] for i =0 to a.n-1 - add v=a.quantile(p) ; statistical function and commute v such than #{ i / a[i] < v } = r*a.n <=> v = a[r*n] when the array is sorted. - correct P4nc, P4 finite element v 2.17-2 (19 june 2007) - correct double $(BLASLIB) in configure.ac (one more) - correct old bug in bamg, in case of bogus boundary (auto crossing)and add code to handle this error correctly with exception (see "test to catch bogus boundary" of example++-tutorial/mesh.edp). v 2.17-1 - add the command line parameter [-v nn] in all freefem++ program to set the level of verbosity to nn before all, and if nn == 0 then theoretically no more spurious output. - correct automatique choose of color in plot of arrow. v 2.17 - add bessel function j0, j1, jn, y0, y1, yn -- Bessel functions of first and second kind - add erf, erfc -- error function operators - add tgamma, lgamma -- gamma and log of gamma - add tool set and get line,column and value of a sparse matrix [I,J,C]=A; // resizing array I,J,C A=[I,J,C] ; where int[int] I(k),J(k); real[int] C(k); - add in tools to get eigen vector of None FE problem like: int nev=5; // number of computed eigen value close to sigma real[int] ev(nev); // to store nev eigein value real[int,int] eV(AA.n,nev); // to store nev eigen vector int k=EigenValue(AA,BB,sym=true,11value=ev,rawvector=eV); - correct the quadrature formula automatic choose with the qforder= field by default the order is correct until order 10 (so exact for P9 polynomials) to add new Quadrature formalur up two order 26 add dynamic load qf11to25 v 2.16-2 correct configure.ac for windows ide compile correct meshsplit, trunc function v 2.16 april 17 2007 Change umfpack download version to the last one add string input from file or cin add Compressible Neo-Hookean Materials exemple v 2.15-1 Correct mistake in cas of splitmesh with internal boundary (assert) Add dump of the mesh regularly (personal work, FH) v 2.15 (27 mars 2007) The blas.tgz file change on http://www.netlib.org/blas/blas.tgz correct the makefile (remove BLAS dir) v 2.14-3 (24 mars 2007) Correct bug in vectorial operation of type (b - 3.14*d) (Thanks to F. Dortu) v 2.14-2 (22 mars 2007) correct integration problem on none classical mesh (mesh of curve of mortar technique) the mesh::Find method is bogus of the kind on meshes, i make an optimization to remove this call in case build matrix with varf int1d(Th)( u*v) , in case of Th, u or v is def. on same meshes. v 2.14-1 (0 mars 2007) correct missing spelling in configure.ac mpi++.h -> mpi++.h for mpich.1.2 add computing linear form of 2 meshes (ex. v on mesh Th1, and compute int2d(Th1)(v) ) v 2.14 (7 mars 2007) make correction for solaris build add P3,P4 and new quadrature formula on triangle up degree 25 with dynamics load. See examples++-load/*P[43]*.edp correct mistake when we build matrix from varf with 3 meshes (FH). v 2.13 Add formal operator * and ' (to day just transpose) on vector [ .. ] and matrix [ [],..., []] so we can write macro grad(u) [ dx(u),dy(u)] // EOM int2d(Th)( grad(u)'*grad(v) ) add scalar term in block matrix as 1x1 matrix. v 2.12-2 correct problem in splitmesh and trunc trunc build always a part of a subdivision mesh splitmesh given more pretty mesh, before if we split 2 adjacent triangle resp in 3 and 4, before we put 2+3 points on the common edge now the put 3 points. v 2.12-1 (jan 15,2007) correct early delete of return pointer in freefem++ function (trap in string.edp under windows ) v 2.12 ( jan 10,2007) correct mistake in none square block matrix v 2.11-2 (nov 29,2006) correct integration problem on none classical mesh (mesh of curve of mortar technique) the mesh::Find method is bogus of the kind on meshes, i make an optimization to remove this call in case build matrix with varf int..(Th)( u*v) , in case of Th, u or v is def. on same meshes. v 2.11-1 (nov 28,2006) Correct bug in interpolation, we building fespace Wf(Th,[RT0,P0]); v 2.11 (nov 10,2006) Correction of the problem in arpack (eigenvalue computation) under i383 processor. After 2 week of hard work, a found the bug. In new version of LAPACK second is a real function and in ARPACK second is a subroutine (Thank the fortran). So I change the Makefile to change the name of function second into secnd2. How to find the bug, in this case the stack of the floating register (info float under gdb) are growing. So after any real function can return a NaN (one time) due to stack float register overflow. A big Thank to D. Bernardi of the help (Merci au fortran et Merci au i383). v 2.10 (oct 26, 2006) correct problem with Eigen value on window and some linux distribution (Fedora) add a patch of two functions in lapack see arpack/arpack-patch-lapack.tar.gz v 2.9 (sept 19, 2006 FH) change Send and Recv in mpi to Isend and Irecv to make async communication so now freefem++-mpi work with openmpi. V 2.8-3 correct freefem++-cs trap under windows (install the static version) add tools to format ostream ( file or cout) V 2.8-2 (july) use f2c as a fortran compiler on MacIntel architecture, correct mistake in mpi. (june 2006) add nint, and correct mistake in ceil function add configure flag to remove cadna --without-cadna V2.8 Correct mistake in OtherMacOsLib.tgz store file and not link (after 1 june) * Correct bug in vectorial problem with same approximation, some time we do a renumbering of the previous approximation space (a pointer mistake). V2.7-1 * change size of data in 64 bits architecture (in file AnyType.hpp) V2.7 * correct mpi Makefile * correct bug in construction of recursive composite finite element (see HISTORY) remark: the finite element struct, so all dynamic library must be recompile. V2.6-1 * add the examples-bamg directory in freefem++ and correct bamg graphic V2.6 * Huge work (more than a full week) to improve the windows version change all the .dll construction remove lots of trap. All example run without graphics V2.5.1 * change nbve= to nev= in EigenValue function (to be compatible with the doc) * newtow to newton (to correct misspelling) * change in AnyType to remove da random bug on windows. * vim color syntax from Richard MICHEL (vim_highlighting_for_FF++.tar.gz) V2.5-0 * add C++ string operator : int i; string s = "...."; i=s.length ; i=s.size; i=s.find("qsdqs");i=s.rfind("sqs"); i=s.find("qsq",2); s(3:4)="sdfffsf"; // replace from char 3 to 4 by // s[3] not alloued to day (char type is not well type in freefem++). getline(cin,s); * Correct bug when passing parameter string in function * add freefem++ mode for mi editor on MacOS http://www.mimikaki.net/en/ store in mode-mi-edp.zip archive (unzip and put in the Folder opened with the mi "Option->Open Mode Folder" menu and set "mi" is the Default application for all the .edp file). V2.4-2 * add lot missing vectorial operation with sub array * if u is a complex array (i.e. complex[int u] ..;) then u.re (resp u.im) are the real array of the real (resp. imag ) part of the vector u * in block matrix add utilization of array to build the block matrix see new Laplace-lagrange-mult.edp file to have an example V2.3-3 * add outer product to set matrix or full real or complex 2D array A = 2*a*b'; // where A is a "real[int,int]", b and c a "real[int]". A += 2*a*b'; or A = 2*a*b'; add matrix and array renumbering (see sec. 4.8 of freefem++.doc for all details) V2.3-0 * add three key word for future use try,catch throw a exception handling (no memory management.) try { code ; } catch (...) { code ; } * use tolpivot= to set the pivottol in LU, crout, cholesky factorization V2.2-1 * Add init file to set verbosity, includepath , loadpath and add preload (dynamic link file) the file are under unix and MacOs /etc/freefem++.pref /Users/hecht/.freefem++.pref freefem++.pref under windows freefem++.pref and the syntaxe of the files is verbosity= 5 loadpath += "/Library/FreeFem++/lib" loadpath += "/Users/hecht/Library/FreeFem++/lib" includepath += "/Library/FreeFem++/edp" includepath += "/Users/hecht/Library/FreeFem++/edp" # comment load += "funcTemplate" load += "myfunction" * Add search directory for include, and load under Unix and Windows Just on the shell sh set environment variable export FF_VERBOSITY=50 export FF_INCLUDEPATH="dir;;dir2" export FF_LOADPATH="dir;;dir3"" remark the separator of directory is ";" and not ":" because ":" is use under Windows. * Examples of Add new Finite element with dynamic link/load, Morley and Bernardi Raugel see examples++-load V2.1-2 * add more example of dynamic load example (thank to F. Dortu) * correct mistake in simple integral computation (not in variational form) before we alway use a quadrature formula of order 3, now we can change the quadrature formula and the default is of order 5. V2.0-4 * change in mshptg the size of the small possible edge from 1/32000 to 1/1 000 000 000, this mesher is use in trunc, splitmesh, and triangulate functions. V2.0-3 * correct operator x =/, it does nothing before. (v2.0-3) see end examples++-tutorial/array.edp for all array operator = + - * / .* ./ += -= /= *= : .l1 .l2 .linfty .sum .max .min ' * correct bug when solving complex linear system with UMFPACK before we solve the system when the conjugate matrix Major Change previous version ----------------------------- * add ternary C expression Symbol Example Explanation ?: a?b:c ternary operation * add sparse matrix computation, block matrix construction interpolation construction see examples++-tutorial/sparse-cmatrix.edp examples++-tutorial/sparse-matrix.edp examples++-tutorial/mat_interpol.edp not so well tested, but could be worse. * add example to solve variational inequation. VI.edp * add possibility to build matrix where the 3 meshes the integral mesh, unknown FE mesh, test FE function can be different. You must use varf to build the matrix is not a standard problem. * Improvement of dynamic loading facility under the 3 systems add a fast Fourier transform with dynamic loading see examples++-load/dfft.edp freefem++-3.61-1/README_MAC.md000644 000767 000024 00000013465 13312446271 015553 0ustar00hechtstaff000000 000000 # How to compile FreeFem++ on MacOSX _october 2015_ The version 3.41 is compiled Under Yosemite (10.10.5), xcode 7.0.1 + previous install of latex and with other brew install Add installer Intel ifort compiler (ifort version 15.0.2 with mkl), build mpich, libgsl, hdf5 The configure option used for all softwares are: ```bash mpich-3.1.4: ./configure 'FC=ifort' 'F77=ifort' '-prefix=/usr/local/ff++/mpich' gsl-1.16 ./configure 'CC=clang' '--prefix=/usr/local/ff++/mpich/' hdf5-1.8.14 ./configure '--enable-cxx' 'CC=clang' 'CXX=clang++' '--prefix=/usr/local/ff++/mpich' PETSc ./configure '--CFLAGS=-O2' '--COPTFLAGS=-O3' '--CXXFLAGS=-O2 -std=c++11' \ '--CXXOPTFLAGS=-O3' '--FFLAGS=-O2' '--FOPTFLAGS=-O3' '--download-fftw' \ '--download-hypre' '--download-metis' '--download-ml' '--download-mumps' \ '--download-parmetis' '--download-ptscotch' '--download-scalapack' \ '--download-suitesparse' '--download-superlu' '--prefix=/usr/local/ff++/mpich/petsc' \ '--with-blas-lapack-lib=-L/opt/intel/mkl/lib -lmkl_intel_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_sequential -lm -lpthread' '--with-mpi-dir=/usr/local/ff++/mpich' 'PETSC_ARCH=arch-ff++' FreeFem++: ./configure '--prefix=/usr/local/ff++/mpich/3.41' '--enable-download' '--enable-optim' '--enable-m64' \ 'F77=ifort' 'FC=ifort' '--enable-maintainer-mode' '--with-mkl=/opt/intel/mkl/lib' \ '--with-petsc=/usr/local/ff++/mpich/petsc/lib/petsc/conf/petscvariables' '-with-hdf5=/usr/local/ff++/mpich/bin/h5cc' \ '--with-gsl-prefix=/usr/local/ff++/mpich/' '--disable-pastix' ``` Please read INNOVATION file to see recent changes and news Plus all previous install with brew install ```bash 499 brew install wget 500 brew install autoconf 501 brew install automake 504 brew install cmake 505 brew install gfortran 506 brew install gcc 540 brew install m4 585 brew install pkg-config 588 brew install gobject-introspection ``` LateX is install form [https://tug.org/mactex/mactex-download.html](https://tug.org/mactex/mactex-download.html). ## To compile a full version of FreeFem++ under MacOS Under Yosemite (10.10.2, xcode 6.2 form scratch) * install Xcode, do clang to install command line * With brew install ```bash 499 brew install wget 500 brew install autoconf 501 brew install automake 504 brew install cmake 505 brew install gfortran 506 brew install gcc 540 brew install m4 585 brew install pkg-config 588 brew install gobject-introspection ``` * Install brew Under Mavericks (10.9, xcode 5.0.2 form scratch) * Install Xcode 5.0.2, and the xcode command line tools, install Auxiliary Tools for Xcode (for PackageMaker) * Install Xcode command line ```bash xcode-select --install ``` * Install gcc-4.9 form [http://hpc.sourceforge.net](http://hpc.sourceforge.net) ```bash curl -O http://prdownloads.sourceforge.net/hpc/gfortran-4.9-bin.tar.gz?download sudo tar zxvf gfortran-4.9-bin.tar.gz -C / ``` * Install autoconf and automake (not in Xcode) I use the macport distribution form [http://www.macports.org](http://www.macports.org) ```bash sudo port install autoconf sudo port install automake ``` Or with brew tool 4) Install TeX from [ctan](http://mirrors.ctan.org/systems/mac/mactex/MacTeX.pkg) 5) Install openmpi form the [source](http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2) ```bash ./configure 'CC=clang' 'CXX=clang++' 'FC=gfortran' 'F77=gfortran' --enable-ltdl-convenience make sudo make install ``` 6) Install gsl ```bash curl -O http://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz tar zxvf gsl-1.15.tar.gz cd gsl-1.15. ./configure CC=clang make sudo make install ``` 7) Install git from the web [https://sourceforge.net/projects/git-osx-installer/](https://sourceforge.net/projects/git-osx-installer/) 8) Download the sources ```bash git clone git@github.com:FreeFem/FreeFem-sources.git ``` 9) Compile FreeFem++ ```bash cd FreeFem-sources ./configure '-with-suffix=macos-10.9' '-without-fltk' '--enable-download' '--enable-optim' 'MPIRUN=/usr/local/bin/mpirun' '--enable-m64' '--without-x' 'CC=clang' 'CXXFLAGS=-std=c++11' 'CXX=clang++' 'F77=/usr/local/bin/gfortran' 'FC=/usr/local/bin/gfortran' 'MPICXX=/usr/local/bin/mpic++' 'MPICC=/usr/local/bin/mpicc' 'MPIFC=/usr/local/bin/mpif90' 'MPIF77=/usr/local/bin/mpif90' '--enable-maintainer-mode' make sudo make install ``` freefem++-3.61-1/freefem++.spec000644 000767 000024 00000004563 13256636774 016246 0ustar00hechtstaff000000 000000 Summary: FreeFem++ Name: freefem++ Version: 2.8 Release: 0 Source: %{name}-%{version}.tar.gz Patch: %{name}-config.patch Patch1: %{name}-gcc4.patch %if %{?_with_cadna:1}%{!?_with_cadna:0} Source2: CadnaC_gcc-3.2_Linux_i386.tar.gz Patch2: cadna-gcc4.patch %endif License: GPL Group: Applications/Engineering URL: http://www.freefem.org/ff++/ Packager: Christophe Trophime Prereq: /sbin/install-info Buildroot: %{_tmppath}/%{name}-buildroot Requires: arpack, ufsparse BuildRequires: arpack-devel, ufsparse-devel BuildRequires: fltk >= 1.1 BuildRequires: fltk >= 1.1 BuildRequires: gsl >= 1.2 BuildRequires: rpm >= 4.1 %if %{?_with_mpi:1}%{!?_with_mpi:0} BuildRequires: lam %endif %{!?_without_freedesktop:BuildRequires: desktop-file-utils} Requires: mesa-libGL >= 6.7.0-9 Requires: mesa-libGLU >= 6.7.0-9 Requires: gsl >= 1.2 Requires: fltk >= 1.1 Prefix: /usr %description FreeFem++ is an implementation of a language dedicated to the finite element method. It enables you to solve Partial Differential Equations (PDE) easily. Problems involving PDE from several branches of physics such as fluid-structure interactions require interpolations of data on several meshes and their manipulation within one program. FreeFem++ includes a fast quadtree-based interpolation algorithm and a language for the manipulation of data on multiple meshes (generated with bamg). %prep %setup -q -n %{name}-%{version} %patch -p1 -b .umfpack %patch1 -p1 -b .gcc4 %if %{?_with_cadna:1}%{!?_with_cadna:0} mkdir -p cadna mkdir -p download/cadna tar zxvf %{SOURCE2} -C cadna mv cadna/include/cadnafree.h download/cadna mv cadna/lib/libcadnafreeC.a download/cadna pushd download/cadna/ ln -sf libcadnafreeC.a libcadnafree.a popd %patch2 -p1 -b .cadna-gcc4.patch %endif autoreconf -f -i %build %if %{?_with_mpi:1}%{!?_with_mpi:0} %configure --with-mpi=lam %else %configure --without-mpi --with-blas="-L/usr/lib/atlas -lf77blas -lcblas" %endif make %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/FreeFem++ %{_bindir}/FreeFem++-cs %{_bindir}/FreeFem++-nw %{_bindir}/FreeFem++-glx %{_bindir}/FreeFem++-ide %{_bindir}/FreeFem++-server %{_bindir}/FreeFem++-client %{_bindir}/bamg %{_bindir}/cvmsh2 %{_bindir}/drawbdmesh %if %{?_with_mpi:1}%{!?_with_mpi:0} %{_bindir}/FreeFem++-mpi %endif freefem++-3.61-1/examples-bamg/000755 000767 000024 00000000000 13321644107 016323 5ustar00hechtstaff000000 000000 freefem++-3.61-1/logo.ico000644 000767 000024 00000006066 13256636774 015267 0ustar00hechtstaff000000 000000 BM6 6(  %%ѰӺƣm>%W ˱i*ٻÖSvm_q޿ȭxy: t &͑lYw2 ]̾p] lpnfs ?ݪ^ef 2 |a ` B_w X 1I&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$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 "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # 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: $dstarg: 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 case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac 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"; } && # Now 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. { if test -f "$dst"; then $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 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || 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: freefem++-3.61-1/configure.ac000644 000767 000024 00000217214 13321622623 016075 0ustar00hechtstaff000000 000000 # ------------------------------------------------------------ # Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 13/5/04 # $Id: configure.ac,v 1.338 2010/05/10 21:35:07 hecht Exp $ # Version numbering: x.xx-pp where "pp" is the package version (when # the same FreeFem++ version is packaged several times). For # coherency, this should have the same value as the top-most package # number in debian/changelog. AC_INIT(FreeFem++,3.61-1,frederic.hecht@sorbonne-universite.fr,freefem++) dnl : ${CFLAGS=""} dnl : ${CXXFLAGS=""} dnl : ${FCFLAGS=""} dnl : ${FFLAGS=""} # progg test exec for windows ff_TEST_FFPP="../src/nw/FreeFem++" ff_TEST_FFPP_MPI="../src/mpi/FreeFem++-mpi" AC_PREREQ(2.69) dnl for AC_LANG_CASE and check stuff dnl AC_CONFIG_SRCDIR(src/FreeFem++-CoCoa) # Automake 1.11 is too old for check ... # ALH - 10/9/13 - FFCS needs to skip this automake version requirement when compiling on older platforms (eg cygwin or # last Ubuntu LTS). So we fix a low hardcoded requirement and test for higher versions when not in FFCS. AM_INIT_AUTOMAKE(1.11 dist-zip) if test "$enable_ffcs" != yes then if test `echo $am__api_version|awk '{if($1>1.13)print "ok";}'` != ok then AC_MSG_ERROR([Automake version needs to be 1.13 or later to enable "make check"]) fi fi AC_CONFIG_HEADERS(config.h) AC_PROG_MAKE_SET dnl AM_COLOR_TESTS=always AC_PROG_RANLIB inc_usr_include="" ff_where_lib_conf=examples++-load/WHERE_LIBRARY-config dnl search of associad software m4_define([AC_FF_ADDWHERELIB], [ if test -z "$ff_where_lib_conf_$1" ; then echo "$1 LD $2" >>$ff_where_lib_conf test -n "$3" && echo "$1 INCLUDE $3 " >>$ff_where_lib_conf ff_where_lib_conf_$1=1 ff_where_lib_$1="$2" ff_where_inc_$1="$3" AC_MSG_NOTICE([ ++ add $1 : $2 $3 in $ff_where_lib_conf "]) else AC_MSG_NOTICE([ -- do not add $1 : $2 $3 in $ff_where_lib_conf "]) fi ]) dnl m4_define([AC_FF_WHERELIB], [ if test -z "$ff_where_lib_conf_$1" -a "$enable_download_$1" != "yes" ; then AC_MSG_CHECKING(check $1) ff_save_libs=$LIBS LIBS="$LIBS $2 $4" AC_LINK_IFELSE([AC_LANG_PROGRAM([m4_if($3,,,[#include <$3>])],[])], [ff_WHERE=yes],[ff_WHERE=no]) if test "$ff_WHERE" = "yes" ; then echo "$1 LD $2" >>$ff_where_lib_conf ff_WHERE_INC=`AS_DIRNAME(["$3"])` case "$ff_WHERE_INC" in /*) echo "$1 INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_$1=1 fi AC_MSG_RESULT($ff_WHERE) ff_$1_ok=$ff_WHERE; LIBS=$ff_save_libs fi ])dnl end m4_define AC_FF_WHERELIB define([AC_FF_PETSC_AWK],[awk -F'=' '"$1 "==[$]1 {print [$]2}' $2]) m4_define([AC_FF_PETSC_WHERELIB], [ ff_$2=`AC_FF_PETSC_AWK($2,$4)` ff_$3=`AC_FF_PETSC_AWK($3,$4)` if test -n "[$]ff_$2"; then ff_$1_ok=yes; AC_FF_ADDWHERELIB($1,[$]ff_$2,[$]ff_$3) AC_SUBST([TOOL_COMPILE_$1],"") fi ] )dnl end m4_defineAC_FF_PETSC_WHERELIB # ALH - this is required by FFCS that needs to deactivate some tools that do not work on all platforms. Some FF users # may also find interesting to specify a local version of a tool instead of downloading it. # m4 macro parameters: $1 = tool name, $2 = dynamic library name, $3 = download directory name if different from $1 m4_define([TOOL_PARAMETERS], [ AC_ARG_WITH($1_include,AC_HELP_STRING([--with-$1-include=],[Include directives for $1 instead of automatic download])) AC_ARG_WITH($1_ldflags,AC_HELP_STRING([--with-$1-ldflags=],[Link-time directives for $1 instead of automatic download])) AC_ARG_ENABLE(download-$1,AC_HELP_STRING([--enable-download_$1],[force the download of $1])) if test "$with_$1_include" != "" || test "$with_$1_ldflags" != "" then # some directives have been specified, use them instead of downloading AC_FF_ADDWHERELIB($1,$with_$1_ldflags,$with_$1_include) AC_SUBST([TOOL_COMPILE_$1],"") enable_$1_download=no fi ]) m4_define([TOOL_DISABLE], [AC_ARG_ENABLE($1,AC_HELP_STRING([--disable-$1],[Do not use $1])) if test "$enable_$1" = "no" then AC_SUBST([TOOL_COMPILE_$1],"") AC_SUBST([TOOL_DYLIB_$1],"") elif test "$ff_$1_ok" = "yes" ; then AC_SUBST([TOOL_DYLIB_$1],$2) enable_$1_download=no else AC_SUBST([TOOL_COMPILE_$1],ifelse($3,,$1,$3)) AC_SUBST([TOOL_DYLIB_$1],$2) enable_$1_download=yes fi # Also allow to disable the download of one tool if it is already locally installed TOOL_PARAMETERS($1,$2,$3) ]) ff_HOSTARCH_pastix= echo "# Build with freefem++ with ./configure " `date` >$ff_where_lib_conf # To allow anonymous CVS version to contain a "./configure" and # Makefiles AM_MAINTAINER_MODE echo >config_LIB_INFO # Necessary compilers AC_PROG_CC AC_PROG_CXX AC_LANG(C++) if test `uname` != Darwin; then ff_ldeg="-Wl,--end-group" ff_ldbg="-Wl,--start-group" fi # suffix of dynamic lib .. # --------------------------- ff_uname=`uname` # flag to build window 32 version ff_mingw = yes # bof bof F. Hecht case $ff_uname in CYGWIN*|MINGW*|MSYS_NT*) ff_suffix_dylib="dll" ff_suffix_dylib_a="dll.a";; Darwin) ff_suffix_dylib="dylib" ff_suffix_dylib_a="dylib";; *) ff_suffix_dylib="so"; ff_suffix_dylib_a="so"; esac # end suffix ... AC_CHECK_PROG(ff_m4,m4,yes,no) AC_CHECK_PROG(ff_bison,bison,yes,no) AC_CHECK_PROG(ff_flex,flex,yes,no) dnl AC_CHECK_PROG(ff_cmake,cmake,yes,no) AC_CHECK_PROG(ff_patch,patch,yes,no) case "$ff_m4 $ff_bison $ff_patch $ff_flex" in *no*) AC_MSG_NOTICE([ to install missing package under debian or ubuntu, try ]) test "$ff_m4" = no && AC_MSG_NOTICE([ sudo apt-get install m4]) test "$ff_bison" = no && AC_MSG_NOTICE([ sudo apt-get install bison]) test "$ff_flex" = no && AC_MSG_NOTICE([ sudo apt-get install flex]) test "$ff_patch" = no && AC_MSG_NOTICE([ sudo apt-get install patch]) AC_MSG_ERROR([ Sorry missing m4,bison,flex,patch command !]);; esac if test -z "$CXX"; then AC_MSG_NOTICE( [ fatal error : c++ compiler ! ] ); AC_MSG_ERROR([ Sorry no c++ compiler !]) fi AC_COMPUTE_INT(ff_size_long,[sizeof(long)]) AC_COMPUTE_INT(ff_size_int,[sizeof(int)]) AC_COMPUTE_INT(ff_size_ptr,[sizeof(int*)]) AC_SUBST(SIZEOF_LONG,$ff_size_long) AC_SUBST(SIZEOF_INT,$ff_size_int) AC_SUBST(SIZEOF_PTR,$ff_size_ptr) if test "0$ff_size_ptr" -eq 4 ;then AC_SUBST(SIZEOF_PTRINBIT,32) ff_ptrbit=32 elif test "0$ff_size_ptr" -eq 8 ;then AC_SUBST(SIZEOF_PTRINBIT,64) ff_ptrbit=64 else AC_MSG_NOTICE( [ fatal error : sizeof pointer $ff_size_ptr ! or no c++ compiler: $CXX] ); AC_MSG_ERROR([ Sorry sizeof c++ pointer $ff_size_ptr are not 4 or 8 ]) fi # FFCS - build the code for FreeFem++-cs AC_ARG_ENABLE(ffcs,AC_HELP_STRING([--enable-ffcs],[build FreeFem++ for use by FreeFem++-cs])) if test "$enable_ffcs" = yes then AC_DEFINE_UNQUOTED(ENABLE_FFCS,$enable_ffcs,[build FreeFem++ for use by FreeFem++-cs]) else enable_ffcs=no fi AC_SUBST(ENABLE_FFCS,"$enable_ffcs") AM_CONDITIONAL([ENABLE_FFCS],[test $enable_ffcs = yes]) # dur dur car sous MacOsX le fortran n'est pas standard. ff_AR="ar" ff_ARFLAGS="rv" ff_RANLIB="ranlib" AC_ARG_ENABLE(fortran,AC_HELP_STRING([--disable-fortran],[No Fortran compiler available ( ARPACK need it)])) ff_g2c_lib=""; if test "$enable_fortran" != no then # ALH-FFCS-2/3/10: add gfortran-mp-4.4 for MacPorts on MacOS 10.6 # FH add iforr AC_PROG_FC(gfortran f90 xlf90 g95 ifort gfortran-mp-4.4) AC_PROG_F77(gfortran f90 xlf xlf90 g95 f77 fort77 "$FC" ifort gfortran-mp-4.4) # if test -n "$F77" # then ff_flibs="" # modif FH AC_F77_LIBRARY_LDFLAGS dnl AC_F77_WRAPPERS # correct pb of double def under macos case $F77 in *fort77) if test -z "$FLIBS" ; then # FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print $(NF-2),$(NF-1)}'` # FH to remove " " FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print "echo",$(NF-2),$(NF-1)}'|sh` AC_MSG_WARN([ fort77 FLIBS : $FLIBS ]) fi ;; *g77) for i in $FLIBS; do case $i in # save last directory of the list -L*) d=`expr $i : '-L\(.*\)'`; echo " try $d " if test -e "$d/libg2c.so" ; then ff_flibs="$d/libg2c.so" elif test -e "$d/libg2c.dylib" ; then ff_flibs="$d/libg2c.dylib" elif test -e "$d/libg2c.a" ; then ff_flibs="$d/libg2c.a" elif test -e $d/libg2c.so -o -e $d/libg2c.a ; then ff_flibs="$i" fi;; esac done if test -e "$ff_flibs" ;then FLIBS="$ff_flibs" else FLIBS="$ff_flibs -lg2c" fi AC_MSG_WARN([ get dir of -lg2c FLIBS : $FLIBS ]) ;; # add FH sep 2006 / modif 2009 *gfortran) ff_okkk=0 for i in $FLIBS; do case $i in -L*) d=`expr $i : '-L\(.*\)'`; if test -e "$d/libgfortran.$ff_suffix_dylib_a" -a -e "$d/libquadmath.$ff_suffix_dylib_a" ; then ff_flibs="$d/libgfortran.$ff_suffix_dylib_a $d/libquadmath.$ff_suffix_dylib_a" ff_okkk=1 elif test -e "$d/libgfortran.a" -a -e "$d/libquadmath.a" ; then ff_flibs="$d/libgfortran.a $d/libquadmath.a" ff_okkk=1 elif test -e "$d/libgfortran.$ff_suffix_dylib_a" ; then ff_flibs="$d/libgfortran.$ff_suffix_dylib_a" ff_okkk=2 elif test -e "$d/libgfortran.a" ; then ff_flibs="$d/libgfortran.a" ff_okkk=2 fi;; esac done if test "$ff_okkk" -ge 1 ;then FLIBS="$ff_flibs" else FLIBS="$ff_flibs -lgfortran" fi AC_MSG_WARN([ get dir of -lgfortran FLIBS : $FLIBS ]) ;; esac AC_ARG_WITH(flib,[ --with-flib= the fortran library ]) # correct FH sep 2006 -o -> -a if test "$with_flib" != no -a -n "$with_flib" then ff_g2c_lib="$with_flib" FLIBS="$with_flib" fi # add FH oct 2007 for download f2c if test -z "$F77" ; then ff_f77=`pwd`/download/bin/fort77 ff_flibs=`pwd`/download/lib/libf2c.a if test -x $ff_f77 -a -f $ff_flibs ; then AC_MSG_WARN([ no fortran, but find download f2c/fort]); F77=$ff_f77 FLIBS=$ff_flibs else AC_MSG_NOTICE( [ fatal error : no fortran ] ); AC_MSG_NOTICE( [add --disable-fortran ] ); AC_MSG_NOTICE( [or try to compile f2c in directory download/f2c ] ); AC_MSG_NOTICE( [ just do: make install ] ); AC_MSG_ERROR([ Fatal error No Fortran compiler . ],1); fi fi # check if the FLIBS is correct ff_libs="$LIBS" LIBS="$ff_libs $FLIBS" AC_TRY_LINK_FUNC(exit,ff_err=,ff_err=ok); if test "$ff_err" = "ok" ; then AC_MSG_ERROR([ Fatal FLIBS: $FLIBS is incorrect. ],1); fi LIBS="$ff_libs" echo "F77 LD $ff_libs" >config_LIB_INFO AC_MSG_CHECKING([ Size of fortran 77 integer ]) ## AC_LANG(fortran); AC_LANG_PUSH([Fortran 77]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ program test integer p,i p=1024*1024 i= p*p open(7,file="conftest.out") if (i>0) then write(7,*) 8 else write(7,*) 4 endif close(7) end ]])] ,ff_f77intsize=`cat conftest.out`,ff_f77intsize=4,ff_f77intsize=4) ## AC_LANG(C++) AC_LANG_POP([Fortran 77]) AC_MSG_RESULT($ff_f77intsize) AC_F77_WRAPPERS ff_cfagsf77="" case $ac_cv_f77_mangling in # "lower case, no underscore, no extra underscore") # "lower case, no underscore, extra underscore") # ;; "lower case, underscore, no extra underscore") ff_cfagsf77="-DAdd_";; "lower case, underscore, extra underscore") ff_cfagsf77="-DAdd__ -Df77IsF2C";; "upper case, no underscore, no extra underscore") ff_cfagsf77="-DUPPER";; "upper case, no underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";; "upper case, underscore, no extra underscore") ff_cfagsf77="-DUPPER -DAdd_";; "upper case, underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";; *) ;; esac AC_SUBST(CFLAGSF77,$ff_cfagsf77) if test $ff_f77intsize -ne 4 then AC_MSG_ERROR([ Fatal Error: Your fortran 77 compiler have by not 4 bytes integer ( $ff_f77intsize bytes) ],1); fi test -f /mingw/bin/libpthread-2.dll && ff_pthread_dll=/mingw/bin/libpthread-2.dll ; \ AC_FF_ADDWHERELIB(f77,$FLIBS,$ff_cfagsf77 $ff_pthread_dll) AC_FF_ADDWHERELIB(fc,$FLIBS,$ff_cfagsf77 $ff_pthread_dll) fi # fin test FORTRAN .......... # ---------------------------- AC_ARG_ENABLE(c,AC_HELP_STRING([--disable-c],[No C compiler available (C BLAS need it)])) if test "$enable_c" != no then AC_PROG_CC AM_PROG_CC_C_O else # We need to define this otherwise ./configure crashes with # the message "configure: error: conditional "am__fastdepCC" # was never defined". am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' fi AM_PROG_LEX AC_PROG_YACC AC_LANG(C++) # Some useful libraries AC_CHECK_LIB(pthread,pthread_create,ff_pthread="-lpthread",ff_pthread="") AC_CHECK_LIB(iomp5,omp_get_wtime,ff_iomp5="-liomp5",ff_iomp5="") AC_CHECK_LIB([rt],[clock_gettime]) if test -n "$ff_pthread" ; then AC_FF_ADDWHERELIB(pthread,$ff_pthread,) fi # Necessary absolute pathname for local directory when some libraries # are used from several different locations (for instance locally in # configure.ac and in a subdir). curdir=`pwd` # Configure options # ----------------- echo $ac_configure_args > configure.param echo "$PATH" > config.path eval for i in $ac_configure_args\; do echo \$i\; done | sed -e "s/$/'/" -e "s/^/'/" > config.param # by default the suffix of the .so lib file is .so # it is .dll under windows # it is .dylib under macos X # suffix of dynamic lib # Checking wether we can produce a MacIntosh-specific version # ----------------------------------------------------------- AC_MSG_CHECKING(wether we are on a MacIntosh) ff_mac=no if test `uname` = Darwin; then ff_HOSTARCH_pastix=i686_mac ff_suffix_dylib="dylib" ff_suffix_dylib_a="dylib" ff_mac=yes AC_DEFINE_UNQUOTED(FF_PREFIX_DIR_APPLE,"/Applications/FreeFem++.app/Contents/",FreeFem prefix dir) fi AC_MSG_RESULT($ff_mac) AC_MSG_CHECKING(wether we are on SunOS) ff_sunos=no if test `uname -s` = SunOS; then ff_sunos=yes fi AC_MSG_RESULT($ff_sunos) # glut ------------ # ---------------- ff_glut="" ff_glut_ok="" AC_ARG_WITH(glut,[ --with-glut glutlib and include ]) if test "$with_glut" != no -a -n "$with_glut" ; then ff_libs_save="$LIBS" LIBS="$LIBS" dnl not works .... so no check .... FH ff_glut="$with_glut";ff_glut_ok=yes dnl AC_SEARCH_LIBS(abort,[$with_glut],[ff_glut="$with_glut";ff_glut_ok=yes],[ff_glut="";ff_glut_ok="no"]) LIBS="$ff_libs_save" dnl AC_MSG_ERROR([ Sorry bad --with-glut : $with_glut !]) elif test "$with_glut" = no ; then ff_glut_ok="no" fi # Checking wether we can produce a Microsoft Windows-specific version # ------------------------------------------------------------------- AC_ARG_ENABLE(cygwindll,[ --enable-cygwindll Forces the use of the Cygwin DLL (not recommended)]) AC_ARG_ENABLE(mingw64,[ --enable-mingw64 Uses mingw64 compilers on Cygwin]) AC_MSG_CHECKING(wether we are on Microsoft Windows) ff_uname=`uname` # flag to build window 32 version ff_mingw = yes ff_mingw=no ff_fpic=yes case $ff_uname in CYGWIN*) ff_fpic=no # ff_nocygwin=-mno-cygwin AC_SUBST(GCCNOCYGWIN,$ff_nocygwin);; MINGW*|MSYS_NT*) enable_cygwindll=no;; esac case $ff_uname in CYGWIN*|MINGW*) ff_fpic=no ff_suffix_dylib="dll"; ff_suffix_dylib_a="dll.a"; ff_win32=yes; # FFCS - 8/3/12 - remove -D_MSC_VER under MinGW64 because it forces system calls to be compiled into any object # (which creates thousands of duplicate definitions for sytem calls like time()). # We need Mingw to avoid Cygwin's extra DLLs if test "$enable_cygwindll" != yes then # CHECK_COMPILE_FLAG(C++,-mwindows,CXXFLAGS) # FFCS: on Windows, FF crashes when compiling GL/glut.h and the option "--disable-opengl" is not # operational because ff_glut_ok is forced to yes here. if test $enable_ffcs = yes then ff_glut_ok=no ff_glut="" enable_opengl=no fi ff_mingw=yes enable_cygwindll=no; ff_pthread="-mthreads" # FFCS does not use the Cygwin MinGW compilers any more if test $enable_ffcs = no then CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw" FFLAGS="$FFLAGS $ff_nocygwin" CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw" AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a;])],[], [ff_nocygwin=""; AC_MSG_NOTICE([Sorry $ff_nocygwin optio is wrong try whitout , but try with gcc-3.3]) ]) CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw" FFLAGS="$FFLAGS $ff_nocygwin" CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw" CNOFLAGS="$CNOFLAGS $ff_nocygwin -I/usr/include/mingw" fi LIBS="$LIBS $ff_nocygwin -mthreads -lws2_32 -lcomdlg32" LIBSNOCONSOLE="-mwindows" # FFCS uses a specific compiler, so we specify its libraries explicitely if test $enable_ffcs = no then test -z "$MPIRUN" && MPIRUN=`which mpiexe.exe` if test "$enable_fortran" != no -o "$with_flib" != no ; then case "$F77" in *gfortran) FLIBS="$ff_nocygwin -lgfortran -lquadmath";; *g77) FLIBS="$ff_nocygwin -lg2c";; *) AC_MSG_ERROR([ Sorry no known FLIBS with this $F77 !]) ;; esac fi fi if test -z "$ff_glut" -a "$ff_glut_ok" != "no" ; then ff_glutname="glut32" # check abort a existing function just to find in glut32.dll exist in the path # because glutInit is not the real symbol on win32 dur dur FH !!!!!!!!! AC_CHECK_LIB(glut32,abort,ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32",ff_glut="") if test -z "$ff_glut" ; then ff_glutname="freeglut" if test -x /usr/bin/pkg-config.exe ; then ff_glut="-lglu32 "`/usr/bin/pkg-config.exe --libs freeglut` else ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32" fi AC_CHECK_LIB(freeglut,abort,ff_glut_ok=yes,ff_glut="") fi fi # Resources for FreeFem++-cs in Microsoft Windows format AC_SUBST(FFGLUTNAME,$ff_glutname) AC_SUBST(WINDRESOBJ,windres.o) AC_SUBST(LIBSNOCONSOLE,$LIBSNOCONSOLE) AC_SUBST(WIN32DLLTARGET,win32-dll-target) ff_TEST_FFPP="../src/bin-win32/FreeFem++.exe" ff_TEST_FFPP_MPI="../src/bin-win32/FreeFem++-mpi.exe" AC_DEFINE(PURE_WIN32,1,A pure windows applications no cygwin dll) ff_dynload=yes fi ;; *) ff_win32=no;; esac AC_MSG_RESULT($ff_win32) if test "$ff_win32" = no then enable_cygwindll=no fi # FreeFem++-specific version information # -------------------------------------- # Version numbering, converted to a floating point value ff_numver="`echo $VERSION|sed 's/-\(.*\)/+\1.0*0.000001/'`" AC_DEFINE_UNQUOTED(VersionFreeFempp,$ff_numver,FreeFem++ version as a float) # Since src/fflib/strversionnumber.cpp is recreated at each build, this # date is only useful for config-version.h test "$prefix" = NONE && prefix="$ac_default_prefix" ff_prefix_dir="${prefix}/lib/ff++/$VERSION" AC_MSG_CHECKING(prefix dir freefem++ ) AC_MSG_RESULT($ff_prefix_dir) FF_DATE=`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) ff_prefix_dir_lib="$ff_prefix_dir/lib" ff_prefix_dir_data="$datadir/$PACKAGE_NAME" ff_prefix_dir_include="$ff_prefix_dir/include" ff_prefix_dir_etc="$ff_prefix_dir/etc" ff_prefix_dir_lib_mpi="$ff_prefix_dir/lib/mpi" ff_prefix_dir_example="$ff_prefix_dir_data/$PACKAGE_VERSION" AC_SUBST(ff_prefix_dir_lib,$ff_prefix_dir_lib) AC_SUBST(ff_prefix_dir_include,$ff_prefix_dir_include) AC_SUBST(ff_prefix_dir_etc,$ff_prefix_dir_etc) AC_SUBST(ff_prefix_dir_lib_mpi,$ff_prefix_dir_lib_mpi) AC_SUBST(ff_prefix_dir_example,$ff_prefix_dir_example) # Separate configuration header file for version information, included # in config-macos9.h cat << EOF > config-version.h /* FreeFem++ version information for MacOS 9 configuration */ /* File generated by configure.ac */ /* Define to the full name and version of this package. */ #define PACKAGE_STRING "$PACKAGE_STRING" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "$PACKAGE_TARNAME" /* Define to the version of this package. */ #define PACKAGE_VERSION "$PACKAGE_VERSION" /* Version number of package */ #define VERSION "$VERSION" /* FreeFem++ build date */ #define VersionFreeFemDate "$FF_DATE" /* FreeFem++ version as a float */ #define VersionFreeFempp ($ff_numver) EOF # Checking wether to produce a debug version # ------------------------------------------ # Generic or hardware-dependant optimization m4_include(acmacros.m4) m4_include(acoptim.m4) # [[file:ax_lib_hdf5.m4]] m4_include(ax_lib_hdf5.m4) # [[file:ax_lib_gsl.m4]] m4_include(ax_lib_gsl.m4) # Checking c++11 for schwarz/hpddm interface of P. Jolivet ... # F.Hecht: # do not compile all with c++11 version to much # probleme to day (frev 2015) with g++ 4.8.1 ff_cxx_save=$CXXFLAGS CHECK_COMPILE_FLAG(C++,[-std=c++11],CXXFLAGS,ff_cxx11) dnl CXXFLAGS="$CXX11FLAGS $CXXFLAGS" dnl ff_cxx11="no" dnl if test -n "$CXX11FLAGS" ; then ff_cxx11="yes" ; fi if test "$ff_cxx11" = yes ; then CXX11FLAGS="-std=c++11"; AC_FF_ADDWHERELIB(cxx11,$CXX11FLAGS,$CXX11FLAGS) fi CXXFLAGS="$ff_cxx_save" AC_SUBST(WITH_CXX11,$ff_cxx11) AC_SUBST(CXX11FLAGS,$CXX11FLAGS) #end Checking c++11 # ------------------------------ # compilation flags of FreeFem++ # ------------------------------ # -DDRAWING bamg active some drawing facility in bamg (inquire mesh) # -DBAMG_LONG_LONG active the use of long long in bamg # -DDEBUG active the checking in bamg # -DNCHECKPTR remove check pointer facility # -DCHECK_KN active subscripting of some array # -DWITHCHECK of the dynamic type ckecking of the langague (very slow) # -DEIGENVALUE to compile the eigen value part # ------------------------------------------------ # FreeFrem++-specific optimizations -fpascal-strings if test "$enable_debug" = yes; then CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DCHECK_KN" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS -fno-inline -fexceptions" fi else CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DNCHECKPTR" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS " fi fi #whether or not to add a suffix to the package name #-------------------------------------------------- AC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix to package name)]) AC_MSG_CHECKING(suffix to add to package name) ff_suffix= if test "$with_suffix" = yes -o "$with_suffix" = no -o "$with_suffix" = "" then AC_MSG_RESULT(none) else ff_suffix="-$with_suffix" AC_MSG_RESULT($ff_suffix) fi AC_SUBST(ADD_PACKAGE_NAME,$ff_suffix) # Checking that OpenGL is accessible # ---------------------------------- ff_gl_ok=no ff_glx_ok=no ff_libs="$LIBS" AC_ARG_WITH(flib,[ --with-flib= the fortran library ]) AC_ARG_ENABLE([opengl],AS_HELP_STRING([--enable-opengl], [Enable/disable support for OpenGL])) # echo " .... LIBS = $LIBS .... " if test x$enable_opengl != xno; then # GL libraries seem to depend on some dlopen capabilities if test "$enable_static" != yes -a "$ff_glut_ok" != yes then # If we cannot find gl.h, no OpenGL version can be produced AC_CHECK_HEADERS(OpenGL/gl.h, ff_gl_ok=yes , ff_gl_ok=no ) if test "$ff_gl_ok" = no then AC_CHECK_HEADERS(GL/gl.h, ff_gl_ok=yes , ff_gl_ok=no ) fi AC_CHECK_HEADERS(GLUT/glut.h, ff_glut_ok=yes, ff_glut_ok=no) if test "$ff_glut_ok" = no then AC_CHECK_HEADERS(GL/glut.h, ff_glut_ok=yes, ff_glut_ok=no) fi # GLUT ..... if test "$ff_glut_ok" = yes then for glut in \ "-framework GLUT -framework OpenGL -framework Cocoa" \ "-lglut -lGLU -lGL" do ff_glut="$glut" ff_libs1="$LIBS" LIBS="$LIBS $ff_glut" AC_TRY_LINK_FUNC(glutInit, ff_glut_ok=yes LIBS="$ff_libs1" break, ff_glut_ok=next); LIBS="$ff_libs1" done fi fi fi AC_SUBST(LIBSPTHREAD,$ff_pthread) # ALH - 16/9/13 - at the moment the requirements for medit (glut) are not compatible with FFCS so medit is # only compiled with FF. if test $enable_ffcs = no then if test "$ff_glut_ok" = yes then AC_SUBST(LIBSGLUT,$ff_glut) if test -n "$ff_pthread" ; then ff_ffglutprog="ffglut${EXEEXT}" AC_DEFINE_UNQUOTED(PROG_FFGLUT,"$ff_ffglutprog", the ffglut application for the new graphics ) fi ff_meditprog="ffmedit${EXEEXT}" fi fi AC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix package name)]) if test "$with_suffix" = yes then with_suffix="" elif test "$with_suffix" = no -o -z "$with_suffix" then with_suffix="" else with_suffix="-$with_suffix" fi AC_MSG_CHECKING(add suffix $with_suffix ) AC_SUBST(ADD_PACKAGE_NAME,$with_suffix) AC_MSG_RESULT(yes) # Checking wether we can produce a parallel version # ------------------------------------------------- if test $enable_ffcs = no then # FF case m4_include(acmpi.m4) else # FFCS - use the same MPI configuration choices as FFCS if test -z "$MPICXX" then ff_mpi=no else ff_mpi=yes AC_SUBST(MPICXX,$MPICXX) AC_SUBST(MPICC,$MPICC) AC_SUBST(MPIF77,$MPIF77) AC_SUBST(MPIFC,$MPIFC) AC_SUBST(MPIPROG,"FreeFem++-mpi${EXEEXT}") AC_SUBST(MPI_INCLUDE,"-I $MPI_INC_DIR") AC_SUBST(MPI_INC_DIR,$MPI_INC_DIR) AC_SUBST(MPI_LIB_DIRS,"") AC_SUBST(MPI_LIB,$MPI_LIB) AC_SUBST(MPI_LIBC,"") AC_SUBST(MPI_LIBFC,"") # Extra MPI-dependant configuration options that are set by FF # during MPI configuration. FFCS - 25/2/13 - Fred noticed that if # PASTIX_HOSTARCH stays blank, pastix compilation breaks. At least # i686_pc_linux and i686_mac are required by pastix on the # corresponding platforms. if test"$ff_HOSTARCH_pastix" = "" then ff_HOSTARCH_pastix=i686_pc_linux fi AC_SUBST(PASTIX_HOSTARCH,$ff_HOSTARCH_pastix) # these values should not be empty otherwise # examples++-load/ff-get-dep will think that they are not # defined AC_FF_ADDWHERELIB(mpi,-DDUMMY,-I$MPI_INC_DIR) # mpifc and mpif77 libraries should always be specified # because FF never calls the Fortran MPI compiler. It always # uses mpicxx in [[file:examples++-load/ff-c++]]. The # resulting Fortran libraries (eg Mumps) would compile even # without the proper Fortran libs, but they would not load # properly. # under Win32, libmpi_f77.a is not the right name and FFCS # mingw/mpicxx adds the right libraries by itself # With mpich2 Debian wheezy 32 bits, libmpi_f77.a is not available (request from Cico, 14/10/13) if test -f /usr/lib/openmpi/lib/libmpi_f77.a then AC_FF_ADDWHERELIB(mpifc,-lmpi_f77,) AC_FF_ADDWHERELIB(mpif77,-lmpi_f77,) else AC_FF_ADDWHERELIB(mpifc,-DDUMMY,) AC_FF_ADDWHERELIB(mpif77,-DDUMMY,) fi # FFCS - MPI_DOUBLE_COMPLEX kept from original FF configure script AC_MSG_CHECKING( MPI_DOUBLE_COMPLEX) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX; ])], ff_mpi_double_complex=yes, ff_mpi_double_complex=no) AC_MSG_RESULT($ff_mpi_double_complex) if test "$ff_mpi_double_complex" = yes ; then AC_DEFINE(HAVE_MPI_DOUBLE_COMPLEX,1, mpi_double_complex) fi fi fi # FFCS needs to change some of the FF makefiles to compile without MPI AM_CONDITIONAL([FFCS_MPIOK],[test $ff_mpi = yes]) # Looking for useful configuration utilities # ------------------------------------------ AC_ARG_ENABLE(download,AC_HELP_STRING([--enable-download],[Download missing libraries (BLAS,ARPACK,UMFPACK,...)])) ## PETSc AC_ARG_WITH(petsc,[ --with-petsc=/usr/local/petsc/conf/petscvariables --without-petsc ]) # /usr/local/petsc/conf/petscvariables #/usr/local/ff++/petsc/lib/petsc/conf/petscvariables ff_petsc_ok=no ## echo --$with_petsc-- if test "$with_petsc" != no -a $ff_mpi = yes; then for d in "$with_petsc" "${prefix}/ff-petsc/real/lib" /usr/local/ff++/petsc/lib /usr /usr/local /opt/usr /opt/local ;do for dd in "" "/petsc/conf/petscvariables" "/lib/petsc-conf/petscvariables" ; do ffconfpetsc="$d$dd" echo " petsc ... $ffconfpetsc" if test -f "$ffconfpetsc" ; then if test "$ff_petsc_ok" = no ; then PETSC_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetsc"` PETSC_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetsc"` AC_MSG_NOTICE([ find real ( $PETSC_SCALAR ) petsc in $ffconfpetsc]); test "$PETSC_SCALAR" = "real" && test "$PETSC_MPIRUN" = "$MPIRUN" || cmp -s `which "$PETSC_MPIRUN"` `which "$MPIRUN"` if test "$?" -eq 0 ; then AC_FF_PETSC_WHERELIB(petsc,PETSC_WITH_EXTERNAL_LIB,PETSC_CC_INCLUDES,$ffconfpetsc) AC_FF_PETSC_WHERELIB(parmetis,PARMETIS_LIB,PARMETIS_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(metis,METIS_LIB,METIS_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(ptscotch,PTSCOTCH_LIB,PTSCOTCH_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(scotch,SCOTCH_LIB,SCOTCH_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(fftw3_mpi,FFTW_LIB,FFTW_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(mumps,MUMPS_LIB,MUMPS_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(scalapack,SCALAPACK_LIB,SCALAPACK_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(suitesparse,SUITESPARSE_LIB,SUITESPARSE_INCLUDE,$ffconfpetsc) AC_FF_PETSC_WHERELIB(blaslapack,BLASLAPACK_LIB,BLASLAPACK_INCLUDE,$ffconfpetsc) else AC_MSG_NOTICE([" Warning PETSC MPI and FF++ MPI not the same: $PETSC_MPIRUN != $MPIRUN or $PETSC_SCALAR != real ." ]); fi fi else # test "$ff_petsc_ok" = no && echo " *** try $ffconfpetsc" ffconfpetsc=""; fi done done fi if test "$ff_petsc_ok" != no ; then AC_MSG_NOTICE([ with petsc $ff_petsc_ok]) else AC_MSG_NOTICE([ without petsc ***** ]) fi ## PETSc complex AC_ARG_WITH(petsc_complex,[ --with-petsc_complex=/usr/local/petsc/conf/petscvariables --without-petsc_complex ]) ff_petsccomplex_ok=no if test "$with_petsc_complex" != no -a $ff_mpi = yes; then for d in "$with_petsc_complex" "${prefix}/ff-petsc/complex/lib" /usr/local/ff++/petsc-complex/lib ;do for dd in "" "/petsc/conf/petscvariables" "/lib/petsc-conf/petscvariables" ; do ffconfpetscc="$d$dd" if test -f "$ffconfpetscc" -a "$ff_petsccomplex_ok" = no ; then PETSC_COMPLEX_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetscc"` PETSC_COMPLEX_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetscc"` AC_MSG_NOTICE([ find complex ($PETSC_COMPLEX_SCALAR) petsc in $ffconfpetsc]); test "$PETSC_COMPLEX_SCALAR" = "complex" && test "$PETSC_COMPLEX_MPIRUN" = "$MPIRUN" || cmp -s `which "$PETSC_COMPLEX_MPIRUN"` `which "$MPIRUN"` if test "$?" -eq 0 ; then AC_FF_PETSC_WHERELIB(petsccomplex,PETSC_WITH_EXTERNAL_LIB,PETSC_CC_INCLUDES,$ffconfpetscc) else AC_MSG_NOTICE([" Warning PETSC complex MPI and FF++ MPI not the same: $PETSC_COMPLEX_MPIRUN != $MPIRUN or $PETSC_COMPLEX_SCALAR != complex ." ]); fi fi done done fi if test "$ff_petsccomplex_ok" != no ; then AC_MSG_NOTICE([ with petsc complex $ff_petsccomplex_ok]) else AC_MSG_NOTICE([ without petsc complex ***** ]) fi ## slepc ### end petsc .... if test "$ff_where_lib_conf_fftw3_mpi" = 1 ; then ff_where_fftw3=`echo $ff_where_lib_fftw3_mpi| sed -e 's/-lfftw3_mpi//g'` AC_FF_ADDWHERELIB(fftw3,$ff_where_fftw3,$ff_where_inc_fftw3_mpi) AC_MSG_NOTICE([ fftw3 from petsc ***** ]) fi #replacing wget with another command ff_wget_command="wget --no-check-certificate" ff_wget=no AC_ARG_WITH(wget, [ --with-wget=command Replace "wget" with another command. Implies --enable-download], enable_download=yes ff_wget=yes ff_wget_command="${withval}") ff_MKL_libpath=yes AC_ARG_WITH(mkl, [ --with-mkl= the MKL LIBPATH : (ie. /opt/intel/mkl/RR.r.y.xxx/lib/)], ff_mkl_libpath="${withval}") # if enabling downloads find wget or curl to do download # ------------------------------------------------------ if test "$ff_wget" = no then ff_wget="" AC_CHECK_PROG(ff_wget,wget --no-check-certificate,yes,no) fi if test "$ff_wget" = no then ff_wget_command="curl --fail -O " ff_curl="" AC_CHECK_PROG(ff_curl,curl -O,yes,no) ff_wget="$ff_curl" fi # for automatique compilation of # lib in download if test "$ff_wget" != yes -a "$enable_download" = "yes" ; then enable_download=no AC_MSG_ERROR([ enable-download and no wget or curl. ],1); fi if test "$enable_download" = "yes" ; then DOWNLOADCOMPILE="compile-pkg install-other" else DOWNLOADCOMPILE= fi AC_SUBST(WGET,$ff_wget_command) AC_SUBST(DOWNLOADCOMPILE,$DOWNLOADCOMPILE) # modif FH ----- # -- looking for cadna # the round-off error propagation # the web site http://www-anp.lip6.fr/cadna/ # -------------------- AC_ARG_WITH(cadna,[ --with-cadna= cadna library --without-cadna ]) if test "$with_cadna" != no -o -n "$with_cadna" then ff_cadna="$with_cadna" fi ff_cadna_ok=no if test "$with_cadna" != no then ff_libs_old="$LIBS" ff_ldflags_old="$LDFLAGS" ff_cadna_dir="${curdir}/download/cadna" LDFLAGS="$LDFLAGS -L$ff_cadna_dir" AC_CHECK_LIB(cadnafree,arit_zero, ff_cadna_ok=yes) AC_CHECK_HEADERS(${ff_cadna_dir}/cadnafree.h, ff_cadna_h=yes, ff_cadna_h=no) LIBS="$ff_libs_old" LDFLAGS="$ff_ldflags_old" if test "$ff_cadna_ok" = yes -a "$ff_cadna_h" = yes then AC_DEFINE(HAVE_CADNA,1, freecadna is use to evalute the round-off error propagation ) CPPFLAGS="$CPPFLAGS -I$ff_cadna_dir" LIBS=" -L$ff_cadna_dir -lcadnafree $ff_libs_old" else AC_MSG_NOTICE([ without cadna ***** ]) fi else AC_MSG_NOTICE([ without cadna ***** ]) fi # Looking for FFTW # ---------------- # ALH - 18/9/13 - deactivates FFTW detection for testing purposes AC_ARG_ENABLE(system_fftw,AC_HELP_STRING([--disable-system-fftw],[Disable the automatic detection of FFTW])) if test "$enable_system_fftw" != no then # ALH - 4/9/13 - avoid recompiling FFTW if a copy was found on the system (request from Helmut Jarausch, 1/8/13) AC_CHECK_LIB(fftw3,fftw_execute,ff_fftw_ok=yes) AC_CHECK_HEADERS(fftw3.h,ff_fftw_h=yes, ff_fftw_h=no) fi if test "$ff_fftw_ok" = yes -a "$ff_fftw_h" = yes then AC_FF_ADDWHERELIB(fftw3,-lfftw3,) fftw_download= else if test "$enable_download" = yes then ff_DOWNLOAD_FFTW=fftw fi fi # used in [[file:download/fftw/Makefile.am::DOWNLOAD_FFTW]] AC_SUBST(DOWNLOAD_FFTW,$ff_DOWNLOAD_FFTW) dnl --------------------------- dnl Looking for the tetgen dnl -------------------------- dnl AC_CHECK_LIB(tet,tetrahedralize,ff_fftet_ok=yes) dnl AC_CHECK_HEADERS(tetgen.h,ff_tet_h=yes, ff_tet_h=no) dnl if test "$ff_tet_ok" = yes -a "$ff_tet_h" = yes dnl then dnl AC_SUBST([TOOL_COMPILE_tetgen],"") dnl AC_FF_ADDWHERELIB(tetgen,-ltet,) dnl AC_DEFINE(HAVE_TETGEN,1, tetgen is compute tetrahedralize volume of an enclosed surface) dnl fi # Looking for the BLAS # -------------------- ff_blas_ok=no ff_blas_inc="" # ALH - 18/9/13 - give the option to deactivate system blas for testing purposes AC_ARG_ENABLE(system-blas,AC_HELP_STRING([--disable-system-blas],[Disable the search for a system-wide BLAS library])) if test "$ff_where_lib_conf_blaslapack" = 1 ; then echo " use BLAS/Lapack of petsc " # echo " lib: $ff_where_lib_blaslapack inc: $ff_where_inc_blaslapack" ff_blas_ok=yes ff_lapack_ok=yes ff_blas_libs="$ff_where_lib_blaslapack" ff_lapack_lib= ff_blas_inc="$ff_where_inc_blaslapack" AC_FF_ADDWHERELIB(lapack,$ff_mkl_lapack,$ff_blas_inc) AC_FF_ADDWHERELIB(blas,$ff_blas_libs,$ff_blas_inc) AC_MSG_NOTICE([ BLAS and LAPACK from petsc ***** ]) if echo "$ff_where_lib_blaslapack"| grep -q " -lmkl" ; then AC_MSG_NOTICE([ MKL from petsc ***** ]) AC_FF_ADDWHERELIB(mkl,$ff_blas_libs,$ff_blas_inc) AC_DEFINE(HAVE_MKL,1, the MKL intel lib is present for BLAS and LAPACK ) AC_DEFINE(HAVE_BLAS,1, the MKL intel lib is present for BLAS and LAPACK ) fi fi if test "$enable_system_blas" != no -a "$ff_blas_ok" = no then # User-specified location # add MKL seach dec 2010 FH .... ff_mkl_flags="" if test "$ff_mkl_libpath" != "not" ; then ff_CFLAGS="$CFLAGS" CHECK_COMPILE_FLAG(C,-mkl,CFLAGS) if test "$ff_CFLAGS" != "$CFLAGS" ; then ff_ff_mkl_flags="-mkl" fi CFLAGS="$ff_CFLAGS" fi AC_MSG_CHECKING(for MKL) ff_mkl_root="" if test "$ff_mkl_libpath" != "not" -a -z "$ff_mkl_flags" ; then if test "$ff_mkl_libpath" = "yes" ; then ff_IFS="$IFS" IFS=":" for i in $LD_LIBRARY_PATH:$LIBRARY_PATH ; do case $i in */mkl/*) ff_mkl_libpath=$i;; esac ; done; IFS="$ff_IFS" # else # ff_mkl_libpath=no fi if test "$ff_mkl_libpath" != "no" -a -d "$ff_mkl_libpath" ; then ff_mkl_root=`expr "//$ff_mkl_libpath" : '//\(.*\)/lib.*'` ff_mkl_arch=`expr "//$ff_mkl_libpath" : '//.*/lib/\(.*\)'` ff_mkl_lp=_lp64 case "$ff_mkl_arch" in *64*) ff_mkl_lp=_lp64 esac case $F77 in *ifort*) ff_mkl_cc=intel;; *) ff_mkl_cc=gf;; esac # bof bof .... case "$MPIRUN" in */sgi/*) ff_mkl_mpi=_sgimpt;; */intel/*) ff_mkl_mpi=_intelmpi;; *) ff_mkl_mpi=_openmpi;; esac # echo ................ ff_mkl_root = $ff_mkl_root .. $ff_mkl_arch if test ! -d "$ff_mkl_libpath" ; then ff_mkl_libpath="$ff_mkl_root/lib/$ff_mkl_arch" fi if test -f "$ff_mkl_libpath/libmkl_rt.$ff_suffix_dylib" ; then mkl_blas=rt mkl_lapack=rt ff_mkl_mlt="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_rt -lmkl_intel_thread -lmkl_core $ff_iomp5 $ff_pthread" ff_mkl_blas="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_rt -lmkl_sequential -lmkl_core $ff_iomp5 $ff_pthread" ff_mkl_lapack="$ff_mkl_blas" elif test -f "$ff_mkl_libpath/libmkl_lapack.$ff_suffix_dylib" ; then ff_mkl_mlt="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lguide -lm -lpthread" ff_mkl_blas="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lguide -lm -lpthread" ff_mkl_lapack="-Wl,-rpath,$ff_mkl_root/lib/$ff_mkl_arch -L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_lapack" else ff_mkl_mlt="$ff_ldbg -Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lmkl_intel_thread $ff_iomp5 $ff_ldeg -lm $ff_pthread" ff_mkl_blas="$ff_ldbg -Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lmkl_sequential $ff_ldeg -lm $ff_pthread" ff_mkl_lapack="$ff_mkl_blas" fi if test -f "-L$ff_mkl_libpathmkl_scalapack${ff_mkl_lp}" ; then ff_mkl_scalapack="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp} " ff_mkl_blacs="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp}" fi ff_blas_ok=yes ff_lapack_ok=yes # <> ALH - 6/11/13 - request from Atsushi Suzuki - the default MKL library must be able to # handle threads when FF is connected to AS' solver. So we need an option to configure FF with the # multithreaded MKL by default. AC_ARG_ENABLE(mkl_mlt,AC_HELP_STRING([--enable-mkl-mlt],[Link with the multithreaded instead of the monothreaded version of the MKL])) if test "$enable_mkl_mlt" = yes then ff_blas_libs="$ff_mkl_mlt" else ff_blas_libs="$ff_mkl_blas" fi ff_blas_inc="-I$ff_mkl_root/include" dnl scalapack, and blacs do not not work with mlk and sgi if test "$ff_mkl_mpi" = "_intelmpi" ; then AC_FF_ADDWHERELIB(scalapack,$ff_mkl_scalapack,$ff_blas_inc) AC_FF_ADDWHERELIB(blacs,$ff_mkl_blacs,$ff_blas_inc) else ff_warm=" (We do not use MKL scalapack and blacs with sgi MPI), " fi AC_FF_ADDWHERELIB(lapack,$ff_mkl_lapack,$ff_blas_inc) AC_FF_ADDWHERELIB(mkl,$ff_mkl_mlt,$ff_blas_inc) AC_DEFINE(HAVE_MKL,1, the MKL intel lib is present for BLAS and LAPACK ) AC_DEFINE(HAVE_BLAS,1, the MKL intel lib is present for BLAS and LAPACK ) else ff_mkl_libpath=no # FH - pardiso is there as soon as mkl is enable_pardiso=no fi fi AC_MSG_RESULT( [ $ff_warm root: $ff_mkl_root , arch: $ff_mkl_arch , $ff_mkl_lp ... ]) AC_ARG_WITH(blas, AC_HELP_STRING([--with-blas=library],[Use a specific version of the Blas]), ff_blas_ok=yes ff_blas_libs="${withval}") # Specific BLAS library location for FreeBSD ff_freebsd_blas="-lf2c -lf77blas -latlas -lgslcblas" ff_dll_blas=`which libopenblas.dll` if [ -z "$ff_dll_blas" ] ; then ff_dll_blas="no"; fi # zmach is in lapack # Trying blas library # echo "LIBS = $LIBS blas --- $ff_blas_ok" for iblas in "$ff_dll_blas" \ "-framework Accelerate" "$ff_mkl_blas" "-lblas" "-L/usr/lib/atlas -lblas" \ $ff_freebsd_blas do if test "$ff_blas_ok" = no -a "$iblas" != "no" then AC_MSG_CHECKING(for daxpy_ in $iblas) ff_save_libs="$LIBS" LIBS="$LIBS $iblas" AC_LINK_IFELSE( [AC_LANG_CALL(,daxpy_)], ff_blas_ok=yes ff_blas_libs="$iblas",) LIBS="$ff_save_libs" AC_MSG_RESULT($ff_blas_ok) fi done #cblas_zdotu_sub #echo "LIBS = " $LIBS ff_cblas_libs=no if test "$ff_blas_ok" = yes then AC_MSG_CHECKING(for blas_zdotu_sub in $ff_blas_libs) ff_save_libs="$LIBS" LIBS="$LIBS $ff_blas_libs $FLIBS" AC_LINK_IFELSE( [AC_LANG_CALL(,cblas_zdotu_sub)], ff_cblas_libs=yes) AC_MSG_RESULT($ff_cblas_libs) LIBS="$ff_save_libs" fi fi # <> ALH - 18/9/13 - option to compile the OpenBLAS moved from the FFCS tree to FF tree AC_ARG_ENABLE(openblas,AC_HELP_STRING([--disable-openblas],[Disable the automatic download of OpenBLAS])) if test "$ff_blas_ok" = no && test "$enable_openblas" != no && test "$enable_download" = yes then AC_CHECK_PROG(ff_git,git,yes,no) AC_MSG_CHECKING([Activating the OpenBLAS (deactivate with --disable-openblas)]) if test $ff_git = no then AC_MSG_RESULT([git not found]) else ff_download_blas=openblas # it is necessary to split the library path into -L and -l otherwise ff/upstream/examples+++-load/ff-c++ will place -lgfortran in # LIBS, .../libgoto___.lib in OTHER, and call the compiler with $LIBS before $OTHER, which will fail. But libopenblas.a is placed in # the standard directory download/lib so the -L option is not required anymore. ff_blas_libs="-L${curdir}/download/lib -lopenblas $LIBS $ff_pthread" ff_blas_inc="-I${curdir}/download/include" # skip generic blas compilation and activate OpenBLAS (see [[file:download/blas/Makefile.am::OpenBLAS]]) AC_SUBST(DOWNLOADED_BLAS,"") AC_SUBST(COMPILE_OPENBLAS,openblas) ff_blas_ok=yes ff_cblas_h=yes ff_cblas_libs=yes AC_MSG_RESULT([ok]) fi fi # If all else fails, download a generic version if test "$ff_blas_ok" = no -a "$enable_download" = yes -a "$enable_fortran" != no -a "$enable_c" != no then AC_CHECK_PROG(ff_unzip,unzip,yes,no) AC_MSG_CHECKING(for BLAS version to download) # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make # the following tests fail. # When compiling a generic version, we do not need an optimized version of the BLAS. ff_download_blas=generic ff_blas_libs="-L${curdir}/download/blas -lcblas -lf77blas" ff_blas_inc="-I${curdir}/download/blas/CBLAS/src" AC_SUBST(DOWNLOADED_BLAS,"libf77blas.a libcblas.a") AC_SUBST(DOWNLOADED_BLAS_BUILT_SOURCES,'BLAS CBLAS $(F77BLAS_SOURCES) $(CBLAS_SOURCES)') AC_MSG_RESULT($ff_download_blas) ff_blas_ok=yes ff_cblas_h=yes ff_cblas_libs=yes fi AC_SUBST(BLASLIBS,$ff_blas_libs) AC_SUBST(BLASINC,$ff_blas_inc) #looking for cblas.h FH if test "$ff_blas_ok" = yes -a "$ff_cblas_libs" = yes -a -z "$ff_download_blas" ; then AC_CHECK_HEADERS(cblas.h, ff_cblas_h=yes, ff_cblas_h=no) AC_CHECK_HEADERS(Accelerate/cblas.h, ff_cblas_h=yes ff_cblas_h=no) AC_CHECK_HEADERS(atlas/cblas.h, ff_cblas_h=yes ff_cblas_h=no) fi # ALH - 18/9/13 - [[file:download/blas/Makefile.am]] does not update the WHERE mechanism so it always needs to be set up # here even in the case of a downloaded blas library. AC_FF_ADDWHERELIB(blas,$ff_blas_libs,) # end of BLAS ------------------- # Looking for ARPACK # ------------------ # We need the following g77 libraries to connect to the Fortran 77 # Arpack. if test "$ff_blas_ok" = yes; then ff_g2c_lib="$FLIBS" if test -n "$ff_g2c_lib" then LIBS="$LIBS $ff_g2c_lib" else ff_g2c_ok=no AC_CHECK_LIB(g2c,G77_second_0, LIBS="$LIBS -lg2c" ff_g2c_lib="-lg2c" ff_g2c_ok=yes) if test "$ff_g2c_ok" = no; then AC_MSG_CHECKING(for G77_second_0 in /sw/lib/libg2c.a) ff_save_libs="$LIBS" LIBS="$LIBS -L/sw/lib -lg2c" AC_LINK_IFELSE( [AC_LANG_CALL(,G77_second_0)], ff_g2c_lib="-L/sw/lib -lg2c" ff_g2c_ok=yes, LIBS="$ff_save_libs") AC_MSG_RESULT($ff_g2c_ok) fi fi fi # Copy the result of g2c investigations into a separate variable # because BLAS compilation will need it. AC_SUBST(G2CLIB,$ff_g2c_lib) #looking of lapack if no compile the arpack lapack # warning $$ because the make eat one ff_lapack_ok=no; ff_lapack_lib= AC_MSG_CHECKING([for lapack in $LIBS, $ff_blas_libs and -llapack] ) if test "$ff_blas_ok" = yes ; then AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], ff_lapack_ok=yes) if test "$ff_lapack_ok" = no ; then ff_save_libs=$LIBS LIBS="$ff_save_libs $ff_blas_libs" AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], [ff_lapack_ok=yes;ff_lapack_lib="$ff_blas_libs"]) if test "$ff_lapack_ok" = no ; then LIBS="$ff_save_libs -llapack $ff_blas_libs" AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], [ff_lapack_ok=yes ff_lapack_lib="-llapack"] ) fi LIBS="$ff_save_libs" fi fi AC_MSG_RESULT($ff_lapack_ok) if test "$ff_lapack_ok" != no ; then AC_SUBST(LAPACKLIBS,$ff_lapack_lib) fi if test "$ff_lapack_ok" = no; then AC_ARG_WITH(lapack, AC_HELP_STRING([--with-lapack=library],[Use a specific version of Lapack]), ff_lapack_ok=yes ff_lapack_lib="${withval}" LIBS="$ff_lapack_lib $LIBS") fi # Lapack configuration for Arpack ff_lapackdir='$$(LAPACKdir)' if test "$ff_lapack_ok" = yes then # no compilation of lapack in arpack ff_lapackdir= else ff_lapack_lib="-L${curdir}/download/lib -llapack" fi # Arpack itself ff_arpack_ok=no ff_save_libs="$LIBS" ff_arpack_libs= if test "$ff_blas_ok" = yes; then # User-specified location AC_ARG_WITH(arpack, [ --with-arpack=library Use a specific version of Arpack], ff_arpack_ok=yes ff_arpack_libs="${withval}") # Default locations if test "$ff_arpack_ok" = no; then AC_CHECK_LIB(arpack,dsaupd_, ff_arpack_libs="-larpack -llapack" ff_arpack_ok=yes,, -llapack) fi # Trying to "locate" Arpack if test "$ff_arpack_ok" = no -a "$enable_download" != yes ; then AC_MSG_CHECKING(for libarpack with locate) ff_lib_arpack=`locate libarpack|grep 'libarpack.*.a$'|head -1` LIBS="$ff_lib_arpack $LIBS" AC_LINK_IFELSE( [AC_LANG_CALL(,dsaupd_)], ff_arpack_ok=yes ff_arpack_libs="$ff_lib_arpack") AC_MSG_RESULT($ff_arpack_ok) fi if test "$ff_arpack_ok" = yes then AC_FF_ADDWHERELIB(arpack,$ff_arpack_libs,) echo arpack LD "'$ff_arpack_libs'" >>$ff_where_lib_conf fi # If all else fails, download! if test "$ff_arpack_ok" = no -a "$enable_download" = yes \ -a "$enable_fortran" != no then ff_arpack_download=yes AC_MSG_NOTICE(using downloaded Arpack) # ALH - 6/11/13 - this install goal is the standard goal for all downloaded packages in # [[file:download/common.mak::install]] AC_SUBST(DOWNLOAD_ARPACK,install) AC_SUBST(FF_LAPACKdir,$ff_lapackdir) AC_SUBST(ARPACKLIB,${curdir}/download/lib/libarpack.a) AC_SUBST(LAPACK_arpack_LIB,${curdir}/download/lib/liblapack.a) # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this # could make the following tests fail. # ALH - 30/9/13 - do not use the "-L ${curdir}/download/lib" directive because it would allow other # following -l directives (eg -lumfpack) to pick an old locally compiled library instead of the system # ones. ff_arpack_libs="${curdir}/download/lib/libarpack.a $ff_lapack_lib" ff_arpack_ok=yes fi fi if test "$ff_arpack_ok" != yes then AC_MSG_NOTICE([-- NO ARPACK -- enable_download : $enable_download , wget: $ff_wget ]) fi # Do not insert ARPACK libs in $LIBS yet, because they may not exist # yet, and this could make the following tests fail. LIBS="$ff_save_libs" if test "$ff_arpack_ok" = yes; then AC_SUBST(ARPACKLIBS,$ff_arpack_libs) EIGENOBJ='eigenvalue.$(OBJEXT)' AC_DEFINE(HAVE_LIBARPACK,1,Arpack is used for eigenvalue computation) # Determines whether to run the eigenvalue tests else # all eigen test fails AC_SUBST([SKIP_TESTS_EIGEN],[yes]) fi AC_SUBST([EIGENOBJ]) # ALH - 25/9/13 - <> always run the WHERE LD statement for lapack because some libraries in # examples++-load require it (eg [[file:examples++-load/Element_Mixte.cpp::lapack]]). Request from Fred. AC_FF_ADDWHERELIB(lapack,$ff_lapack_lib,) # Looking for UMFPACK # ------------------- ff_umfpack_incs="" ff_amd_ok=no ff_umfpack_ok=no # echo @@@@@@@@@ ff_where_lib_conf_suitesparse == $ff_where_lib_conf_suitesparse @@@@ if test "$ff_where_lib_conf_suitesparse" = "1" ; then echo "amd/umfpack/suitesparse of petsc" echo " lib: $ff_where_lib_suitesparse inc: $ff_where_inc_suitesparse" ff_amd_ok=yes ff_umfpack_ok=yes enable_system_umfpack=no ff_umfpack_libs="$ff_where_lib_suitesparse" ff_umfpack_incs="$ff_where_inc_suitesparse" AC_DEFINE(HAVE_LIBUMFPACK,1,Umfpack is used for sparse matrices computations) AC_DEFINE(HAVE_LIBCHOLMOD,1,Cholmod is used for sparse matrices computations) AC_SUBST([UMFPACK_CPPFLAGS],[$ff_where_inc_suitesparse]) AC_DEFINE(HAVE_UMFPACK_H,1,If umfpack.h is located in UMFPACK subdir) fi ff_save_libs="$LIBS" AC_ARG_ENABLE(system_umfpack,AC_HELP_STRING([--disable-system-umfpack],[Disable the automatic detection of umfpack, colmod, amd, ....])) if test "$ff_umfpack_ok" = no -a "$enable_system_umfpack" != no -a "$ff_blas_ok" = yes; then # User-specified location AC_ARG_WITH(amd, AC_HELP_STRING([--with-amd=library],[Use a specific version of AMD]), ff_amd_ok=yes ff_umfpack_libs="${withval}") AC_ARG_WITH(umfpack, AC_HELP_STRING([--with-umfpack=library],[Use a specific version of Umfpack]), ff_umfpack_ok=yes ff_umfpack_libs="${withval} $ff_umfpack_libs") if test "${with_umfpack_include+set}" = set; then CPPFLAGS="$CPPFLAGS $with_umfpack_include" fi AC_CHECK_HEADERS(umfpack.h umfpack/umfpack.h ufsparse/umfpack.h suitesparse/umfpack.h, [ff_umfpack_header=yes ff_umfpack_dir=`dirname $ac_header` break]) # Somes systems like FreeBSD hide umfpack.h in a directory called UMFPACK (all capitals). This breaks the # standard #define produced by autoconf in config.h.in. LIBS="$ff_blas_libs $LIBS" if test "$ff_umfpack_header" != yes; then AC_CHECK_HEADER(UMFPACK/umfpack.h, ff_umfpack_header=yes ff_umfpack_dir=UMFPACK AC_DEFINE(HAVE_BIG_UMFPACK_UMFPACK_H,1,If umfpack.h is located in UMFPACK subdir)) fi if test "$ff_amd_ok" = no; then AC_CHECK_LIB(amd,amd_info, ff_umfpack_libs="$ff_umfpack_libs -lamd" ff_amd_ok=yes) fi if test "$ff_umfpack_ok" = no -a "$ff_amd_ok" = yes; then # ALH - 30/9/13 - other libraries required by Umfpack AC_CHECK_LIB(cholmod,cholmod_add,ff_umfpack_libs="$ff_umfpack_libs -lcholmod") AC_CHECK_LIB(colamd,colamd_set_defaults,ff_umfpack_libs="$ff_umfpack_libs -lcolamd") AC_CHECK_LIB(umfpack,umf_i_malloc, ff_umfpack_libs="-lumfpack $ff_umfpack_libs" ff_umfpack_ok=yes,,$ff_umfpack_libs) fi if test "$ff_umfpack_header" != yes -o "$ff_umfpack_ok" != yes; then ff_umfpack_ok=no AC_MSG_WARN([Sorry, we could not find the UMFPACK lib or the UMFPACK headers]) fi if test "$ff_umfpack_ok" = yes -a "$ff_amd_ok" = yes; then AC_DEFINE(HAVE_LIBUMFPACK,1,Umfpack is used for sparse matrices computations) fi fi LIBS="$ff_save_libs" # If all else fails, download! # attention no /usr/include in WHERE if test "$ff_umfpack_ok" = yes -a -n "$ff_umfpack_dir" -a -z "$ff_umfpack_incs" then ff_umfpack_incs="-I/usr/include/$ff_umfpack_dir" fi if test "$ff_umfpack_ok" = no -a "$enable_download" = yes then AC_MSG_NOTICE(using downloaded UMFPACK) AC_SUBST(DOWNLOAD_UMFPACK,"umfpack") ff_umfpack_download=yes # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make # the following tests fail. ff_umfpack_libs="-L${curdir}/download/lib -lumfpack -lcholmod -lcolamd -lamd -lsuitesparseconfig" ff_umfpack_incs="-I${curdir}/download/include" AC_DEFINE(HAVE_LIBUMFPACK,1,UMFPACK) if test "$ff_win32" = yes; then AC_SUBST(FF_UMFPACK_CONFIG,-DCBLAS) fi ff_umfpack_ok=yes fi # ALH - 17/9/13 - moved UMFPACK configuration settings in wherelib to _after_ configuring the download version because # [[file:download/umfpack/Makefile.am]] does not set the WHERE mechanism. Also removed -I/usr/include/$ff_umfpack_dir # from include options for FFCS because it breaks the MingW64 compilation process. if test "$ff_umfpack_ok" = yes then if test $enable_ffcs = no then AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,$ff_umfpack_incs) AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,$ff_umfpack_incs) else AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,) AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,) fi else AC_MSG_NOTICE([ -- NO UMFPACK (ff_wget = $ff_wget)]) fi AC_SUBST(UMFPACKLIBS,$ff_umfpack_libs) # If times() and sysconf() are not here, UMFPACK should know if test "$ff_umfpack_ok" = yes then AC_CHECK_FUNCS(times sysconf, ff_umfpack_posix_ok=yes, ff_umfpack_posix_ok=no) if test "$ff_umfpack_posix_ok" = no then AC_SUBST(FF_UMFPACK_CONFIG,"-DCBLAS -DNPOSIX") fi fi # Checking for some functions that may not appear everywhere # ---------------------------------------------------------- AC_CHECK_HEADERS(cstddef) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(semaphore.h,ff_sem=1,ff_sem=0) AC_CHECK_HEADERS(sys/mman.h,ff_mmap=1,ff_mmap=0) if test "$ff_sem" -eq 1 -a "$ff_mmap" -eq 1 ; then BIN_ffmaster=ffmaster else enable_MMAP=no BIN_ffmaster= fi AC_CHECK_HEADERS(regex.h,ff_regex_h=1, ff_regex_h=0) AC_SUBST(FF_HAVE_REGEX_H,$ff_regex_h) AC_CHECK_HEADERS([unistd.h]) # asinh acosh atanh are not in Mingw yet gettimeofday ff_malloc_h="" AC_HEADER_TIME AC_CHECK_HEADERS(malloc.h,ff_malloc_h=1) AC_SUBST(FF_MALLOC_H,$ff_malloc_h) AC_CHECK_FUNCS(asinh acosh atanh getenv jn erfc tgamma gettimeofday mallinfo mstats) AC_CHECK_FUNCS(srandomdev) AC_CHECK_FUNCS(second_,ff_second="",ff_second=second.o) AC_SUBST(FF_SECOND,"$ff_second") # Enable static linking (no shared libraries) # ------------------------------------------- AC_CHECK_PROG(ff_libtool,libtool,yes,no) if test "$ff_mac" = "yes" -a "$ff_libtool" = yes ; then ff_AR="libtool" ff_ARFLAGS="-static -o" ff_RANLIB="echo" fi AC_ARG_ENABLE(static, [ --enable-static Build binaries with no shared library dependencies]) if test "$enable_static" = yes then AC_CHECK_PROG(ff_libtool,libtool,yes,no) if test "$ff_libtool" = yes then LDFLAGS="$LDFLAGS -all-static" AC_SUBST(STATICTOOL,libtool) else AC_MSG_ERROR(libtool not found) fi fi # for compiation of arpack use libtool to bluid universal library on MacOs. AC_SUBST(AR,$ff_AR) AC_SUBST(ARFLAGS,$ff_ARFLAGS) AC_SUBST(RANLIN,$ff_RANLIB) # Dynamic loading of compiled functions # ------------------------------------- # Not if we don't want shared libraries (non FH modif FH juin 2005) ff_dynload=no if test "$enable_static" != yes then # Availability of dlopen(). Use AC_COMPILE rather than # AC_CHECK_HEADERS because the latter has problems seeing it (in # Cygwin) when it does not compile (in Mingw). AC_MSG_CHECKING(for dlfcn.h) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include ]])], ff_dynload=yes, ff_dynload=no) AC_MSG_RESULT($ff_dynload) fi # FFCS - -lm missing for ffmedit link stage on Debian Testing AC_CHECK_LIB(m,sin) # Checks that we also have the corresponding library if test "$ff_dynload" = yes then AC_CHECK_LIB(dl,dlinfo) # Checks that everythings works ok AC_MSG_CHECKING(whether dlopen links ok) AC_LINK_IFELSE( [AC_LANG_SOURCE([[#include int main(int argc,char **argv){ dlopen("",RTLD_LAZY); return 0; }]])], ff_dynload=yes, ff_dynload=no) AC_MSG_RESULT($ff_dynload) fi # the -rdynamic don't exist on macos and sunOS if test "$ff_dynload" = yes then AC_DEFINE(HAVE_DLFCN_H,1,Dynamic loading - not mandatory) # Activate dynamic loading tests (see examples++-load/Makefile.am) AC_SUBST(LOAD_TESTS,../regtests.sh) AC_SUBST(LOAD_COMPILE,load_compile) # gcc on MacOS does not produce an error with "-rdynamic" but # still complains about it. if test "$ff_mac" = "no" -a "$ff_win32" = "no" -a "$ff_sunos" = "no" ; then CHECK_COMPILE_FLAG(C++,-rdynamic,LDFLAGS) dnl CHECK_COMPILE_FLAG(C,-rdynamic,CNOFLAGS) dnl CHECK_COMPILE_FLAG(C,-rdynamic,CFLAGS) fi if test "$ff_fpic" != "no" ; then CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS) CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS) CHECK_COMPILE_FLAG(C,-fPIC,CNOFLAGS) fi if test "$enable_fortran" != no ; then if test "$ff_fpic" != "no" ; then CHECK_COMPILE_FLAG(Fortran,-fPIC,FFLAGS) CHECK_COMPILE_FLAG(Fortran,-fPIC,FNOFLAGS) CHECK_COMPILE_FLAG(Fortran,-fPIC,FCFLAGS) CHECK_COMPILE_FLAG(Fortran,-fPIC,FCNOFLAGS) fi dnl CHECK_COMPILE_FLAG(Fortran,-rdynamic,FNOFLAGS) dnl CHECK_COMPILE_FLAG(Fortran,-rdynamic,FFLAGS) fi fi AC_SUBST(DYLIB_SUFFIX,$ff_suffix_dylib) # the doc is now in https://github.com/FreeFem/FreeFem-doc-pdf/blob/master/freefem%2B%2Bdoc.pdf # Checking wether we can generate some documentation # -------------------------------------------------- dnl dnl AC_CHECK_PROG(ff_latex,latex,yes,no) dnl AC_CHECK_PROG(ff_makeindex,makeindex,yes,no) dnl AC_CHECK_PROG(ff_dvips,dvips,yes,no) dnl # to translate the figure dnl AC_CHECK_PROG(ff_pdf2ps,pdf2ps,yes,no) dnl AC_CHECK_PROGS(EPSTOPDF,[epstopdf pstopdf],[false]) dnl AC_CHECK_PROG(ff_convert,convert,yes,no) dnl if test "$ff_latex" = yes -a "$ff_makeindex" = yes -a "$ff_dvips" = yes -a $ff_pdf2ps = yes -a $ff_convert = yes; dnl then dnl AC_SUBST(DOCPS,"freefem++doc.ps") dnl dnl AC_CHECK_PROG(ff_gzip,gzip,yes,no) dnl if test "$ff_gzip" = yes; dnl then dnl AC_SUBST(DOCPSGZ,"freefem++doc.ps.gz") dnl fi dnl fi # PDF documentation building sometimes poses problems because of pdfsync.sty. So we need to be able to disable it. # FFCS - 9/4/14 - need to disable PDF also during FFCS build (which does not use the resulting PDF). dnl AC_ARG_ENABLE(pdf,[ --disable-pdf Disable PDF documentation building]) dnl if test "$enable_pdf" != no dnl then dnl AC_CHECK_PROG(ff_pdflatex,pdflatex,yes,no) dnl if test "$ff_pdflatex" = yes -a $EPSTOPDF != false -a $ff_convert = yes; dnl then dnl AC_SUBST(DOCPDF,"freefem++doc.pdf") dnl fi dnl fi # Choosing compilation options for the standard version (in src/std) # ------------------------------------------------------------------ # The "standard" configured version can use win32 (mingw) if test "$ff_mingw" = yes then # FFCS does not use FreeFem++-std, and Pcrgraph.cpp does not compile under mingwin64 if test $enable_ffcs = no then ff_stdprog="FreeFem++-std${EXEEXT}" ff_std_graph_obj=Pcrgraph.$OBJEXT fi # ALH - FFCS - 30/11/8 - I need to get the output from FF for FFCS regression tests if test $enable_ffcs = yes then ff_std_ldflags="-mconsole -mwindows" else ff_std_ldflags=-mwindows fi ff_std_libs= fi AC_SUBST(STD_GRAPH_OBJ,$ff_std_graph_obj) AC_SUBST(STD_LDFLAGS,$ff_std_ldflags) AC_SUBST(STD_LIBS,$ff_std_libs) # Allow some downloaded tools not to be compiled # ---------------------------------------------- ## try to see pakage is hon computer if the FH ZZZZ ## FH to find gsl ... AX_PATH_GSL(1.15, ff_with_gsl=yes, ff_with_gsl=no) if test "$ff_with_gsl" = "yes"; then AC_FF_ADDWHERELIB(gsl,$GSL_LIBS,$GSL_CFLAGS) fi ## m4_map([AC_FF_WHERELIB],[ [[mumps],[-ldmumps -lzmumps -lmumps_common -lpord],[dmumps_c.h],[]], [[mumps_seq],[-ldmumps_seq -lzmumps_seq -lmumps_common_seq -lpord_seq -lmpiseq_seq],[dmumps_c.h],[]], [[libseq],[-lmpiseq_seq],[${inc_usr_include}mumps_seq/mpi.h]], [[mumps_ptscotch],[-lpord_ptscotch -lmumps_common_ptscotch -ldmumps_ptscotch -lzmumps_ptscotch -lpord_ptscotch],[dmumps_c.h]], [[mumps_scotch],[-lpord_scotch -lmumps_common_scotch -ldmumps_scotch -lzmumps_scotch -lpord_scotch],[dmumps_c.h]], [[hypre],[-lHYPRE]], [[fftw3],[-lfftw3],[${inc_usr_include}fftw3.h],[]], [[superlu_dist],[-lsuperlu-dist],[${inc_usr_include}superlu-dist/superlu_defs.h],[]], [[superlu],[-lsuperlu],[${inc_usr_include}superlu/superlu_enum_consts.h],[]], [[superlu4],[-lsuperlu4],[${inc_usr_include}superlu4/superlu_enum_consts.h],[]], [[blacs],[ -lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi],[]], [[scalapack],[-lscalapack$ff_with_mpi],[]], [[scotch],[-lscotch -lscotcherr],[scotch.h]], [[ptscotch],[-lptscotch -lptscotcherr],[ptscotch.h]], [[metis],[-lmetis],[${inc_usr_include}metis/metis.h],[]], [[metis],[-lmetis],[metis.h],[]], [[parmetis],[-lparmetis -lmetis],[],[]], [[freeyams],[-lfreeyams],[freeyamslib.h],[]], [[mmg3d],[-lmmg3d],[libmmg3d.h],[]], [[mshmet],[-lmshmet],[],[]], dnl [[gsl],[-lgsl -lgslcblas -lm],[gsl/gsl_sf.h],[]], [[parms],[-lparms -litsol -llapack -lblas -lm],[],[]], [[tetgen],[-ltet],[tetgen.h],[]], [[ipopt],[ -lipopt],[${inc_usr_include}coin/IpTNLP.hpp],[]], [[nlopt],[ -lnlopt],[nlopt.hpp],[]] ] ) ## before try TOOL_DISABLE(tetgen,tetgen.$DYLIB_SUFFIX) TOOL_DISABLE(hips,hips_FreeFem.$DYLIB_SUFFIX) TOOL_DISABLE(ipopt,ff-Ipopt.$DYLIB_SUFFIX) TOOL_DISABLE(lapack,"lapack.$DYLIB_SUFFIX fflapack.$DYLIB_SUFFIX") TOOL_DISABLE(parmetis,metis.$DYLIB_SUFFIX) TOOL_DISABLE(mmg3d,mmg3d-v4.0.$DYLIB_SUFFIX) TOOL_DISABLE(mshmet,"mshmet.$DYLIB_SUFFIX aniso.$DYLIB_SUFFIX") TOOL_DISABLE(gmm,ilut.$DYLIB_SUFFIX) TOOL_DISABLE(mumps,"MUMPS_FreeFem.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX") TOOL_DISABLE(mumps_seq,"MUMPS_seq.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX",mumps-seq) TOOL_DISABLE(nlopt,ff-NLopt.$DYLIB_SUFFIX) dnl TOOL_DISABLE(parmetis) TOOL_DISABLE(parms,parms_FreeFem.$DYLIB_SUFFIX) TOOL_DISABLE(pastix,"interfacepastix.$DYLIB_SUFFIX complex_pastix_FreeFem.$DYLIB_SUFFIX real_pastix_FreeFem.$DYLIB_SUFFIX") TOOL_DISABLE(pipe,pipe.$DYLIB_SUFFIX) TOOL_DISABLE(scotch,scotch.$DYLIB_SUFFIX) TOOL_DISABLE(superlu4,SuperLu.$DYLIB_SUFFIX,superlu) TOOL_DISABLE(superludist,"complex_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX real_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX dSuperLU_DIST.$DYLIB_SUFFIX") TOOL_DISABLE(umfpack,UMFPACK64.$DYLIB_SUFFIX) TOOL_DISABLE(yams,freeyams.$DYLIB_SUFFIX) TOOL_DISABLE(pipe,pipe.$DYLIB_SUFFIX) AC_SUBST([BIN_ffmaster],"$BIN_ffmaster") TOOL_DISABLE(MMAP,ff-mmap-semaphore.$DYLIB_SUFFIX) # FFCS - MUMPS_seq has a different Win32 compiler setup from FFCS, so we need to add some extra parameters if test "$OS" = Windows_NT then CFLAGS="$CFLAGS -DWITHOUT_PTHREAD -DAdd_" # we also need to satisfy ff-c++ that the pthread are not a blocking point if test -n "$ff_pthread" ; then AC_FF_ADDWHERELIB(pthread,"",) fi fi # ALH - pARMS needs "-fno-range-check" on Windows, but this options fails on MacOS 10.8. Add no-range-check for Windows # for hexadecimal parameter constants like: # # [[file:c:/cygwin/home/alh/ffcs/rel/mingw/mpif.h::PARAMETER MPI_SHORT_INT z 8c000003]] # # Such constants are rejected without [[file:download/parms/makefile-parms.in::NO_RANGE_CHECK]] if test "$OS" = Windows_NT then AC_SUBST(NO_RANGE_CHECK,-fno-range-check) fi # ALH - 4/9/13 - request from Helmut Jarausch - allow to change Scotch include path if test "$with_scotch_include" = "" then with_scotch_include=$ac_pwd/download/include/scotch fi AC_SUBST(SCOTCH_INCLUDE,$with_scotch_include) # Find out kernel and libc versions # --------------------------------- if test "$ff_win32" != yes -a "$ff_mac" != yes then AC_MSG_CHECKING(kernel version) ff_kernel_version=`cat /proc/version|perl -e '=~/(\d+\.\d+\.\d+)/;print $1;'` AC_MSG_RESULT($ff_kernel_version) AC_SUBST(KERNEL_VERSION,$ff_kernel_version) AC_MSG_CHECKING(libc version) ff_libc_version=`ldd /bin/sh | awk '/libc/{print $3}' | xargs readlink | sed -e 's/\.so$//'` AC_MSG_RESULT($ff_libc_version) AC_SUBST(LIBC_VERSION,$ff_libc_version) fi # def variable pour les makefiles # creating all makefiles # ---------------------- ff_bamgprog="bamg${EXEEXT} cvmsh2${EXEEXT}" AC_SUBST(CNOFLAGS,$CNOFLAGS) dnl for superludist CFLAGS without optim ... AC_SUBST(FNOFLAGS,$FNOFLAGS) dnl for blacs CFLAGS without optim ... # The final list of executable programs AC_SUBST(MEDITPROG,$ff_meditprog) AC_SUBST(FFGLUTPROG,$ff_ffglutprog) AC_SUBST(BAMGPROG,$ff_bamgprog) AC_SUBST(STDPROG,$ff_stdprog) ff_progs="FreeFem++-nw $ff_bamgprog $ff_mpiprog $ff_meditprog $ff_ffglutprog" AC_SUBST(TEST_FFPP,$ff_TEST_FFPP) AC_SUBST(TEST_FFPP_MPI,$ff_TEST_FFPP_MPI) AC_SUBST(TEST_FFPPMPI,"../src/mpi/ff-mpirun") ff_with_mpi=-openmpi; ff_blacs="-lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi" ff_scalapack=-lscalapack # change MKL interface ... test -n "$ff_mkl_blacs" && ff_blacs="$ff_mkl_blacs" test -n "$ff_mkl_scalapack" && ff_scalapack="$ff_mkl_scalapack" test -n "$ff_mkl_root" && ff_winc="$ff_mkl_root/include/mkl_blas.h" # FFCS - 27/10/11 - Some extra conditionals for things that do not work on certain systems (eg MPI libraries under # Windows) ## search of HDF5 .... AX_LIB_HDF5() if test "$with_hdf5" = "yes"; then ff_save_cppflags="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS" AC_CHECK_HEADER([H5Cpp.h],[],[with_hdf=no]) CPPFLAGS="$ff_save_cppflags" if test "$with_hdf5" = "yes"; then AC_FF_ADDWHERELIB(hdf5,$HDF5_LDFLAGS $HDF5_LIBS,$HDF5_CPPFLAGS) LIBS="$LIBS $HDF5_LDFLAGS $HDF5_LIBS" fi else enable_iohdf5=no fi TOOL_DISABLE(iohdf5,iohdf5.$DYLIB_SUFFIX) AM_CONDITIONAL([FFCS_WINDOWS],[test "$OS" = Windows_NT]) # remove gsl if not find ... FH # correction FH .. 18/12/2013. # ALH - 7/1/14 - not able to compile gsl or pardiso with FFCS on Windows if test "$enable_ffcs" != yes then if test "$ff_where_lib_conf_gsl" = 1 -a "$enable_gsl" != "no" ; then enable_gsl=yes; fi; if test "$ff_where_lib_conf_mkl" = 1 -a "$enable_mkl" != "no" ; then enable_pardiso=yes; fi; fi TOOL_DISABLE(gsl,"gsl.$DYLIB_SUFFIX") TOOL_DISABLE(NewSolver,"NewSolver.$DYLIB_SUFFIX") TOOL_DISABLE(pardiso,"PARDISO.$DYLIB_SUFFIX") echo "debug cxxx11: $ff_cxx11 mpi: $ff_mpi petsc: $ff_petsc_ok " test "$enable_hpddm" != no && enable_hpddm=yes test "$ff_cxx11" != yes -o "$ff_mpi" != yes -o \( "$ff_umfpack_ok" != "yes" -a "$ff_mumps_ok" != "yes" \) && enable_hpddm=no FF_PETSC_DYLIB="" if test "$ff_petsc_ok" != no ; then FF_PETSC_DYLIB="PETSc.$DYLIB_SUFFIX" fi if test "$ff_petsccomplex_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB PETSc-complex.$DYLIB_SUFFIX" fi if test "$ff_slepccomplex_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc-complex.$DYLIB_SUFFIX" fi if test "$ff_slepc_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc.$DYLIB_SUFFIX" fi ##echo @@@@@@@@@@@@ $ff_petsc_ok @@ "hpddm.$DYLIB_SUFFIX $FF_PETCS_DYLIB" TOOL_DISABLE(hpddm,["hpddm.$DYLIB_SUFFIX hpddm_substructuring.$DYLIB_SUFFIX $FF_PETSC_DYLIB"]) # All makefiles AC_OUTPUT(Makefile download/Makefile download/blas/Makefile download/arpack/Makefile download/umfpack/Makefile download/fftw/Makefile src/Makefile src/bamglib/Makefile src/Graphics/Makefile src/femlib/Makefile src/Algo/Makefile src/lglib/Makefile src/fflib/Makefile src/nw/Makefile src/mpi/Makefile src/bamg/Makefile src/libMesh/Makefile src/medit/Makefile src/bin-win32/Makefile examples++-load/Makefile examples++-tutorial/Makefile examples++/Makefile examples++-mpi/Makefile examples++-hpddm/Makefile examples++-eigen/Makefile examples++-chapt3/Makefile examples++-bug/Makefile examples++-other/Makefile examples++-3d/Makefile) AC_MSG_NOTICE([ freefem++ used download : $enable_download ]) AC_MSG_NOTICE([ -- Dynamic load facility: $ff_dynload ]) AC_MSG_NOTICE([ -- ARPACK (eigen value): $ff_arpack_ok ]) AC_MSG_NOTICE([ -- UMFPACK (sparse solver) $ff_umfpack_ok ]) AC_MSG_NOTICE([ -- BLAS $ff_blas_ok ]) AC_MSG_NOTICE([ -- with MPI $ff_mpi]) AC_MSG_NOTICE([ -- with PETSC $ff_petsc_ok / PETSC complex $ff_petsccomplex_ok ]); AC_MSG_NOTICE([ -- with hpddm $enable_hpddm (need MPI & c++11 : $ff_cxx11 ) ]); AC_MSG_NOTICE([ progs: $ff_progs ]) if test "$ff_umfpack_download" = yes -a -n "$TOOL_COMPILE_umfpack" ;then AC_MSG_NOTICE([ use of download UMFPACK see download/umfpack/SuiteSparse/UMFPACK/README.txt for the License]) fi if test "$ff_arpack_download" = yes -a -n "$TOOL_COMPILE_arpack" ; then AC_MSG_NOTICE([ use of download ARPACK see download/arpack/ARPACK/README no License ]) fi if test "$enable_download" = yes ;then if test -n "$TOOL_COMPILE_fftw3" ; then AC_MSG_NOTICE([ use of download fftw see download/fftw/fftw-3.2/COPYRIGHT ]) fi if test -n "$TOOL_COMPILE_tetgen" ; then AC_MSG_NOTICE([ use of download tetgen see download/tetgen/tetgen1.5.1-beta/LICENSE ]) fi if test -n "$TOOL_COMPILE_yams" ; then AC_MSG_NOTICE([ use of download freeyams see download/yams/freeyams.2011.02.22 (suface mesh adaptation) ]) fi if test -n "$TOOL_COMPILE_mmg3d" ; then AC_MSG_NOTICE([ use of download mmg3d (v4) see download/mmg3d/mmg3d4/LICENCE.txt ]) fi if test -n "$TOOL_COMPILE_parmets" ; then AC_MSG_NOTICE([ use of download parmetis]) fi # ALH - some tools may be activated but not downloaded if a local version is specified (see # [[TOOL_PARAMETERS]]) if test "$enable_superlu_download" = yes then AC_MSG_NOTICE([ use of download superlu]) fi if test -n "$MPICC" ; then AC_MSG_NOTICE([ try to download: blacs parmetis scalapack scotch superludist pastix hypre hips library]) fi if test "$ff_download_blas" = "generic" ; then AC_MSG_NOTICE([ use of download generic blas and cblas freefem may be slow ]) AC_MSG_NOTICE([ you can try to use the Kazushige Goto s BLAS at http://www.cs.utexas.edu/users/flame/goto/ ]) AC_MSG_NOTICE([ or at http://www.tacc.utexas.edu/~kgoto/ for the best BLAS .]) AC_MSG_NOTICE([ or try to download/compile the altas blas .]) fi # ALH - 30/10/13 - (request from FH) all downloads are now part of a separate script ([[file:download/getall]]) # which needs to be run before make for the user to specify whether he is ok with each of the package licences. AC_MSG_NOTICE([ Please run "download/getall" to download all necessary packages before running make]) fi # FFCS does not use glut, so remove this message because it could make the user think that something is broken if test $enable_ffcs = no then if test "$ff_glut_ok" != yes ; then AC_MSG_NOTICE([ *********************************************** ]) AC_MSG_NOTICE([ WARNING: you do not have the new grachics tools ]) AC_MSG_NOTICE([ because the configure do not find OpenGL, GLUT or pthread developer stuff ]) AC_MSG_NOTICE([ read the README to find missing package ]) AC_MSG_NOTICE([ F. Hecht ]) AC_MSG_NOTICE([ to install missing package under debian or ubuntu, try: sudo apt-get install freeglut3-dev ]) AC_MSG_NOTICE([ *********************************************** ]) fi fi # Local Variables: # mode:shell-script # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/INSTALL000644 000767 000024 00000022030 13256636774 014651 0ustar00hechtstaff000000 000000 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. 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 only 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 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=c89 CFLAGS=-O2 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 must use a version of `make' that supports the `VPATH' variable, such as 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 `..'. If you have to use a `make' that does not support the `VPATH' variable, you have 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' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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 `--target=TYPE' option 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 will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `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. freefem++-3.61-1/CheckAll000755 000767 000024 00000001504 13256636773 015216 0ustar00hechtstaff000000 000000 test -x ./src/nw/FreeFem++-nw && ff=../src/nw/FreeFem++ || ff=`which FreeFem++` test -x ./src/mpi/ff-mpirun && ffmpi=../src/mpi/ff-mpirun || ffmpi=`which ff-mpirun` if [ -x ./src/bin/FreeFem++-nw.exe ] ; then ff=../src/bin/FreeFem++-nw.exe; fi if [ -x ./src/bin-win32/FreeFem++-nw.exe ] ; then ff=../src/bin-win32/FreeFem++-nw.exe; fi if [ -x ./src/mpi/ff-mpirun ] ; then ffmpi=../src/mpi/ff-mpirun; fi rm CheckAll-out for i in examples++*/.; do cd $i; case $i in *mpi/.|*hpddm/.) ;; *) echo ---- $i --- ../CheckAllEdp "$ff -nw" *.edp | tee -a ../CheckAll-out ;; esac; cd ..; done if [ -n "$ffmpi" ] ; then for i in examples++*/.; do cd $i; case $i in *mpi/.|*hpddm/.) echo MPI ---- $i --- ../CheckAllEdp "$ffmpi -np 4" *.edp | tee -a ../CheckAll-out;; esac; cd ..; done fifreefem++-3.61-1/FreeFem++.mcp000755 000767 000024 00000474631 13256636774 016005 0ustar00hechtstaff000000 000000 cool(ikCodeWarrior Project$Gm) M t   4W} 0Z}8` !"#$8%J&t'()*+7,c-./01203G4b5|6789:; <"=;>T?i@}ABCDEF G 1H HI aJ wK L M N O P Q R 5S KT fU V W X Y Z [ !\ =] W^ q_ ` a b c d e f 4g Jh di }j k l m n o p *q Ar [s wt u v w x yz){H|]}y~5Ts/Xv?^|9Tw 'Ef*Pl3Qp-So1Sq4Rn /  0%&' !"#()*+,-.29;6<=:375>?@ABCDEFGH\]XIYJKLZ[MNO8P14QRSTUVW_fchig`dbjkmnopqrstuvlwxyz{|}~e^a$ '`&*yrPp] <Ka(:bc+Ode0oqNm1~2})349vwu_L5^,Q-Y;l.zM {ft/6=>?@ABCDE7X 8ghij[\F !"#$WnGsHI %STUVkJZ|xRE6  !"#$%&'()*+,-./012345789:;<=>@?ABCDFGH_j    5(*+,-./01234678:;<=>BCDEFGHIJKLMNOPQTUVWXZ[\]^`abcdeghij p _h: main :`H_iF_gJavaClasses.jarZIP MWZP /work/freefem++/src  !"#$ %o&CC@CCXAAhdskn '(CPCJavaClasses.jar0ZIP MWZP@`C ( @  \] !"#$ %o&KLMNOPQTUVWXZ[\]^`abcdegh   MacOS PPC LinkerFreeFem-g:config_freefem_v3_g.hppconfig_freefem_v3_g.hpp__startstartstart:w'o`xbQ)*+,-./012345789:;<=>@?ABCDMSIEhttp://java.sun.com/products/jdk/1.1/docs/api/    5(*+,-./01234678:;<=>BCDEFGHIJKLMNOPQRTUVWYZ[\]_`abcdfg#1:K`jl  *8EUet !"#$%& '"(-)9*D+R,_-g.p/z0123456789: ;<"=+>5?B@OA]BhCuDEFGHIJKLMNOP)Q5R=SLTTU_VkWwXYZ[\]^_`a bc d'e3f<gKh]iejpkzlmnopqrstuv w2xFyMz\{f|}~+:Mbs  6I^r  # > R ` q }   ' < S q  4 H ] q E6  !"#$%&'()*+,-./012345789:;<=>@?ABCDFG (cFILEdFILEeFILEFILE[FILEaFILE7FILE FILE]FILE6FILEQFILE^FILEDFILEgFILE FILE8FILEBFILEFILE FILE\FILE4FILEXFILEbFILE>FILECPPC Projec.8 8`|h`(  ,  X0,(0@`8pp@ H 8  @@ 8 pp  ,@ JavaClasses.jarZIP MWZP    5(*+,-./01234678:;<=>BCDEFGHIJKLMNOPQRTUVWYZ[\]_`abcdfghino connections avaiableeH:O,/K`$o\,oX Gv6YO//l/N(/Ho/NAPX&HHP/ B'p@rƒ/N;II/Ho/Npg 0Rgpƀpg/*g*J*fpƀ g/*pg0/jgpƀpgUO/ HjHxNDfpƀ@ :MSL:@:MacOS Support:startLib Import PPCMPLFLib Import PPCMWCDTEXT.ccMW C/C++ PPCC/C++TEXT.cpMW C/C++ PPCC/C++TEXT.expTEXT.pchMW C/C++ PPCC/C++TEXT.pch++MW C/C++ PPCC/C+MacHeaders.cMacOS_Carbon_C++_Macros.hTEconfig_freefem_v3.hppconfig_freefem_v3.hpp@  a.out????APPLX????r( @ __start|@}@~    (*+,-./0123456P78:;<=>BCDEFGHIJKLMNOPQTUVs@WXZ@[\]^`abcdeghq@ ijP'CODE' 'DATA' 'PICT'CC@CCXAAhdskn '(CPCJavaClasses.jar0ZIP MWZP@`C __start 1starta.out????MBND@ ROOT GRUPAlgo FILEEFILEFFILEGFILEHFILEIFILEPFILEJFILEKFILELFILEMFILENFILEOFILEVFILEhGRUPbamg FILE*FILE+FILE,FILE-FILE.FILE/FILE0FILE1FILE2FILE3GRUP eigenFILETFILEZGRUPfemFILE(FILEFILEUFILE5FILEFILEFILEFILEFILEFILEWFILE:FILE;FILEFILEC-./0123456P78:;<=>BCDEFGHIJKLMNOPQRTUsVWY@Z[\]_`abcdfgq@ Carbon Std C++ Console:Remote DebugCarbon Std C++ Console:Auto-targetCarbon Std C++ Console:Packager PanelCarbon Std C++ Console:Source TreesCarbon Std C++ Console:Access PathsCarbon Std C++ Console:Debugger RuntimeCarbon Std C++ Console:Target SettingsCarbon Std C++ Console:File MappingsCarbon Std C++ Console:Build ExtrasCarbon Std C++ Console:Debugger TargetCarbon Std C++ Console:Custom KeywordsCarbon Std C++ Console:68K CodeGenCarbon Std C++ Console:68K DisassemblerCarbon Std C++ Console:68K Global OptimizerCarbon Std C++ Console:68K LinkerCarbon Std C++ Console:68K ProjectCarbon Std C++ Console:C/C++ CompilerCarbon Std C++ Console:C/C++ WarningsCarbon Std C++ Console:CFM68KCarbon Std C++ Console:FTP PanelCarbon Std C++ Console:Java Command LineCarbon Std C++ Console:Java LanguageCarbon Std C++ Console:Java MRJAppBuilderCarbon Std C++ Console:Java OutputCarbon Std C++ Console:Java ProjectCarbon Std C++ Console:JavaDoc ProjectCarbon Std C++ Console:MacOS Merge PanelCarbon Std C++ Console:Output FlagsCarbon Std C++ Console:PPC CodeGenCarbon Std C++ Console:PPC DisassemblerCarbon Std C++ Console:PPC Global OptimizerCarbon Std C++ Console:PPC LinkerCarbon Std C++ Console:PPC PEFCarbon Std C++ Console:PPC ProjectCarbon Std C++ Console:PPCAsm PanelCarbon Std C++ Console:Rez CompilerProject File ListCarbon Std C++ Console:PPC CodeGen Mach-OCarbon Std C++ Console:PPC Mach-O LinkerCarbon Std C++ Console:PPC Mach-O TargetCarbon Std C++ Console:WinRC CompilerCarbon Std C++ Console:x86 CodeGenCarbon Std C++ Console:x86 DisassemblerCarbon Std C++ Console:x86 Exceptions PanelCarbon Std C++ Console:x86 Global OptimizerCarbon Std C++ Console:x86 LinkerCarbon Std C++ Console:x86 ProjectCarbon Std C++ Console:Bison PanelCarbon Std C++ Console:Flex PanelFreeFem++:Source TreesFreeFem++:Access PathsFreeFem++:Debugger RuntimeFreeFem++:Target SettingsFreeFem++:File MappingsFreeFem++:Build ExtrasFreeFem++:Debugger TargetFreeFem++:Remote DebugFreeFem++:Auto-targetFreeFem++:Custom KeywordsFreeFem++:Bison PanelFreeFem++:C/C++ CompilerFreeFem++:C/C++ WarningsFreeFem++:Flex PanelFreeFem++:FTP PanelFreeFem++:Java Command LineFreeFem++:Java LanguageFreeFem++:Java MRJAppBuilderFreeFem++:Java OutputFreeFem++:Java ProjectFreeFem++:JavaDoc ProjectFreeFem++:MacOS Merge PanelFreeFem++:Output FlagsFreeFem++:Packager PanelFreeFem++:PPC CodeGenFreeFem++:PPC DisassemblerFreeFem++:PPC Global OptimizerFreeFem++:PPC LinkerFreeFem++:PPC PEFFreeFem++:PPC ProjectFreeFem++:PPCAsm PanelFreeFem++:Rez CompilerFreeFem++:WinRC CompilerFreeFem++:x86 CodeGenFreeFem++:x86 DisassemblerFreeFem++:x86 Exceptions PanelFreeFem++:x86 Global OptimizerFreeFem++:x86 LinkerFreeFem++:x86 ProjectFreeFem++:PJavaDebuggingFreeFem++:PPC CodeGen Mach-OFreeFem++:PPC Mach-O LinkerFreeFem++:PPC Mach-O TargetFreeFem++:Pascal CompilerFreeFem++:Pascal WarningsFreeFem-g:Source TreesFreeFem-g:Access PathsFreeFem-g:Debugger RuntimeFreeFem-g:Target SettingsFreeFem-g:File MappingsFreeFem-g:Build ExtrasFreeFem-g:Debugger TargetFreeFem-g:Remote DebugFreeFem-g:Auto-targetFreeFem-g:Custom KeywordsFreeFem-g:C/C++ CompilerFreeFem-g:C/C++ WarningsFreeFem-g:FTP PanelFreeFem-g:Java Command LineFreeFem-g:PJavaDebuggingFreeFem-g:Java LanguageFreeFem-g:Java MRJAppBuilderFreeFem-g:Java OutputFreeFem-g:Java ProjectFreeFem-g:JavaDoc ProjectFreeFem-g:MacOS Merge PanelFreeFem-g:Output FlagsFreeFem-g:Packager PanelFreeFem-g:Pascal CompilerFreeFem-g:Pascal WarningsFreeFem-g:PPC CodeGenFreeFem-g:PPC CodeGen Mach-OFreeFem-g:PPC DisassemblerFreeFem-g:PPC Global OptimizerFreeFem-g:PPC LinkerFreeFem-g:PPC Mach-O LinkerFreeFem-g:PPC Mach-O TargetFreeFem-g:PPC PEFFreeFem-g:PPC ProjectFreeFem-g:PPCAsm PanelFreeFem-g:Rez CompilerFreeFem-g:WinRC CompilerFreeFem-g:x86 CodeGenFreeFem-g:x86 DisassemblerFreeFem-g:x86 Exceptions PanelFreeFem-g:x86 Global OptimizerFreeFem-g:x86 LinkerFreeFem-g:x86 ProjectFreeFem++:Java Manifest-JAD Setting InfoFreeFem++:PPC Mac OS X LinkerFreeFem++:PPC Mac OS X ProjectFreeFem++:Property ListFreeFem++:x86 COFFFreeFem-g:Java Manifest-JAD Setting InfoFreeFem-g:PPC Mac OS X LinkerFreeFem-g:PPC Mac OS X ProjectFreeFem-g:Property ListFreeFem-g:x86 COFFFreeFem++.Carbon:Source TreesFreeFem++.Carbon:Access PathsFreeFem++.Carbon:Debugger RuntimeFreeFem++.Carbon:Target SettingsFreeFem++.Carbon:File MappingsFreeFem++.Carbon:Build ExtrasFreeFem++.Carbon:Debugger TargetFreeFem++.Carbon:Remote DebugFreeFem++.Carbon:Auto-targetFreeFem++.Carbon:Custom KeywordsFreeFem++.Carbon:C/C++ CompilerFreeFem++.Carbon:C/C++ WarningsFreeFem++.Carbon:FTP PanelFreeFem++.Carbon:Java Command LineFreeFem++.Carbon:PJavaDebuggingFreeFem++.Carbon:Java LanguageFreeFem++.Carbon:Java Manifest-JAD Setting InfoFreeFem++.Carbon:Java MRJAppBuilderFreeFem++.Carbon:Java OutputFreeFem++.Carbon:Java ProjectFreeFem++.Carbon:JavaDoc ProjectFreeFem++.Carbon:MacOS Merge PanelFreeFem++.Carbon:Output FlagsFreeFem++.Carbon:Packager PanelFreeFem++.Carbon:PPC CodeGenFreeFem++.Carbon:PPC CodeGen Mach-OFreeFem++.Carbon:PPC DisassemblerFreeFem++.Carbon:PPC Global OptimizerFreeFem++.Carbon:PPC LinkerFreeFem++.Carbon:PPC Mac OS X LinkerFreeFem++.Carbon:PPC Mac OS X ProjectFreeFem++.Carbon:PPC Mach-O LinkerFreeFem++.Carbon:PPC Mach-O TargetFreeFem++.Carbon:PPC PEFFreeFem++.Carbon:PPC ProjectFreeFem++.Carbon:PPCAsm PanelFreeFem++.Carbon:Property ListFreeFem++.Carbon:Rez CompilerFreeFem++.Carbon:WinRC CompilerFreeFem++.Carbon:x86 CodeGenFreeFem++.Carbon:x86 COFFFreeFem++.Carbon:x86 DisassemblerFreeFem++.Carbon:x86 Exceptions PanelFreeFem++.Carbon:x86 Global OptimizerFreeFem++.Carbon:x86 LinkerFreeFem++.Carbon:x86 ProjectFreeFem++:GNU Code GenerationFreeFem++:GNU WarningsFreeFem++:GNU OptimizationsFreeFem++:GNU Pascal LanguageFreeFem++:GNU Pascal MacrosFreeFem++:GNU Pascal MoreFreeFem++:GNU Pascal Read & WriteFreeFem++:GNU Pascal WarningsFreeFem++:GNU PowerPC ProcessorFreeFem++:LD Mach-O ExtrasFreeFem++:LD Mach-O OptionsFreeFem++:LD Mach-O TargetFreeFem-g:GNU Code GenerationFreeFem-g:GNU WarningsFreeFem-g:GNU OptimizationsFreeFem-g:GNU Pascal LanguageFreeFem-g:GNU Pascal MacrosFreeFem-g:GNU Pascal MoreFreeFem-g:GNU Pascal Read & WriteFreeFem-g:GNU Pascal WarningsFreeFem-g:GNU PowerPC ProcessorFreeFem-g:LD Mach-O ExtrasFreeFem-g:LD Mach-O OptionsFreeFem-g:LD Mach-O Target@ :srcbamg../LinearSolver/UMFPACKv4.1/UMFPACK/Include../LinearSolver/UMFPACKv4.1../LinearSolver/UMFPACKv4.1/AMD/Include../../ARPACK/arpack-f2c@ :MSL:@:MacOS Support:@arpack/arpack++/include@/System/Library/Frameworks/vecLib.framework/Versions/A/Headers@  MacOS PPC Linker"APPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.arrTEXT.bhBalloon HelpTEXT.cMW C/C++ PPCC/C++TEXT.c++MW C/C++ PPCC/C++TEXT.ccMW C/C++ PPCC/C++TEXT.cpMW C/C++ PPCC/C++TEXT.cppLݱPc4 MW C/C++ PPCC/C++%. p$Sp(TEXT.expTEXT.pchMW C/C++ PPCC/C++TEXT.pch++MW C/C++ PPCC/C++TEXT.rRezRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.c++L)\n@ MW C/C++ PPCC/C++t p$O p(.cppL)\n@ MW C/C++ PPCC/C++t p$O p(.cppMW C/C++ PPC.cppMW C/C++ PPC.docP.hppMW C/C++ PPC.hppMW C/C++ PPC.oXCOFF Import PPC.ppob`.rsrc`.yL)\+xE` $O @p$O:`ӧh p$O p(NoneMMPr@Java Linker RSRCTEXT.htmlJavaTEXT.javaMW JavaJavaTEXT.mfJavarsrc.auJAR Importer@.classMW Java.gifJAR Importer@.jarMW Java.zipMW JavaMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.oMPW Import 68K.ppob`.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.rRezRezappe`rsrc`shlbMach-O PPC LinkerAPPL`Appl`MLIBLib Import Mach-OMMLBLib Import Mach-OMPLFLib Import Mach-OMWCD`RSRC`TEXT.cMW C/C++ MachPPCC/C++TEXT.c++MW C/C++ MachPPCC/C++TEXT.ccMW C/C++ MachPPCC/C++TEXT.cpMW C/C++ MachPPCC/C++TEXT.cppMW C/C++ MachPPCC/C++TEXT.expTEXT.hMW C/C++ MachPPCC/C++TEXT.pchMW C/C++ MachPPCC/C++TEXT.pch++MW C/C++ MachPPCC/C++TEXT.rRezRezdocu`rsrc`.docPWin32 x86 LinkerTEXT.cMW C/C++ x86C/C++TEXT.c++MW C/C++ x86C/C++TEXT.ccMW C/C++ x86C/C++TEXT.cpMW C/C++ x86C/C++TEXT.cppMW C/C++ x86C/C++TEXT.defTEXT.hMW C/C++ x86C/C++TEXT.h++MW C/C++ x86C/C++TEXT.hppMW C/C++ x86C/C++TEXT.ordTEXT.pchMW C/C++ x86C/C++TEXT.pch++MW C/C++ x86C/C++TEXT.rcMW WinRCiLIBLib Import x86iOBJObj Import x86.aLib Import x86.docP.libLib Import x86.oObj Import x86.objObj Import x86.resWinRes ImportMacOS X PPC Linker0APPL`Appl`MDYLMachO ImporterC/C++MLIBMachO ImporterC/C++MMLBMachO ImporterC/C++MPLFMachO ImporterC/C++MWCD`RSRC`TEXT.arrTEXT.axpTEXT.cMW C/C++ PPC Mac OS XC/C++TEXT.c++MW C/C++ PPC Mac OS XC/C++TEXT.ccMW C/C++ PPC Mac OS XC/C++TEXT.cpMW C/C++ PPC Mac OS XC/C++TEXT.cppMW C/C++ PPC Mac OS XC/C++TEXT.expTEXT.hMW C/C++ PPC Mac OS XC/C++TEXT.h++MW C/C++ PPC Mac OS XC/C++TEXT.hppMW C/C++ PPC Mac OS XC/C++TEXT.lcfTEXT.mMW C/C++ PPC Mac OS XC/C++TEXT.mmMW C/C++ PPC Mac OS XC/C++TEXT.pchMW C/C++ PPC Mac OS XC/C++TEXT.pch++MW C/C++ PPC Mac OS XC/C++TEXT.pchmMW C/C++ PPC Mac OS XC/C++TEXT.pchmmMW C/C++ PPC Mac OS XC/C++TEXT.plcProperty List CompilerProperty ListTEXT.plocProperty List CompilerProperty ListTEXT.rRezRezTEXT.wkedocu`rsrc`.aMachO ImporterC/C++.docP.dylibMachO ImporterC/C++.gifCopy To PackageP.icnsCopy To PackageP.jpgCopy To PackageP.libMachO ImporterC/C++.nibCopy To PackageP.plPerl ToolPerl.plistCopy To Package.ppob`.pshShell Tool.rsrc`.shShell Tool.stringsCopy To Package.tiffCopy To PackagePLD Mach-O Linker*MDYL.dylibLD Mach-O ImporterDisassemblyMLIB.aLD Mach-O ImporterDisassemblyMLIB.oLD Mach-O ImporterDisassemblyMPLF.aLD Mach-O ImporterDisassemblyMPLF.oLD Mach-O ImporterDisassemblyRSRCNone`TEXT.cGNU Pascal Mach-O CompilerC/C++TEXT.dprGNU Pascal Mach-O CompilerPascalTEXT.dumpNoneTEXT.hGNU Pascal Mach-O CompilerC/C++TEXT.incGNU Pascal Mach-O CompilerPascalTEXT.pGNU Pascal Mach-O CompilerPascalTEXT.pasGNU Pascal Mach-O CompilerPascalTEXT.ppGNU Pascal Mach-O CompilerPascalTEXT.symtabNonersrcNone`.aLD Mach-O ImporterDisassembly.cGNU Pascal Mach-O CompilerC/C++.dprGNU Pascal Mach-O CompilerPascal.dylibLD Mach-O ImporterDisassembly.hGNU Pascal Mach-O CompilerC/C++.htmNone`.htmlNone`.icnsNone`.incGNU Pascal Mach-O CompilerPascal.jpegNone`.jpgNone`.nibNone`.oLD Mach-O ImporterDisassembly.pGNU Pascal Mach-O CompilerPascal.paletteNone`.pasGNU Pascal Mach-O CompilerPascal.pictNone`.plPerl ToolPerl.plistXML`.pngNone`.ppGNU Pascal Mach-O CompilerPascal.pshShell Tool.rsrcNone`.rtfNone`.shShell Tool.stringsNone`MRJApplicationWARZmacosxmacosx Merge Out????APPLa.rsrc????APPLa.rsrc::DLGXckidProjWSPC????APPLqqq+ e!L#CshPf0 AddPinRaPoiMIte tRes' MenuI tConk Cont oseCillCShowHideMove$GetCGetCRjzeColiteGetCtCTitlVainCt%Ctl Elue gl SeTestragTrac Dra!"nded5#istT$r%&'()  **+B,d$`-}./shP001 Add2PinR3aPoi64MIteX5tRest6Menu7tCon8Cont9oseC:illC;Show#GetC}?etCR@zeCoABGetCCtCTiDtlVa8EinCtTFCtl qGlue Hl SeITestJDragKTrac L Dra "M ;N ^O P Q R S T U 1V OW mXKeys Y ZImpo [PW I \KBa ]lpM "^a.exe????MEXE@a.rsrc:./a.exea.rsrc FreeFem++-g(Carbon)????APPL@X:????FreeFem++-g(Carbon)@ noname.exeMain-ClassAuto-GeneratedstrictFileNamesMWJava_Language_strictFileHierarchyNoNativeHeadersJNINativeHeadersSunVMNativeHeadersMWJava_Language_emitHeadersMWJava_Language_packageFilterMWJava_Language_genCommentsMWJava_Language_genHeadersMWJava_Language_headerTypeMWJava_Language_1_1_CompatibleMWJava_Language_enableAssertsMWJava_Language_targetVM1.11.21.31.4Java LanguageBXXXXXXXXXXQQQQQQQQQQQ Executable????APPL@Executable.rsrc:./A FreeFem++-gQQQQQQQQQQQQQQQQQQQQQQQQQQqqqqqqqqqqqqqqqqqqqqqqqqqqInfo.plist  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijkqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNO:RSTUVWXYZ{|}~C\TCCCC `C@PBXXXXXXXXXXQQQplstQQQQQQQQQQQQQQQQQQQQqqqqqqqqqqqqqqqqqqqqqqqqqq @ :srcbamgarpack/arpack++/include arpack/arpack-f2c ../LinearSolver/UMFPACKv4.1@../../ARPACK/arpack-f2c@ :MSL:@:MacOS Support:@arpack/arpack++/include   MacOS PPC LinkerFreeFem++: MacOS PPC Linker!APPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.arrTEXT.bhBalloon HelpTEXT.cMW C/C++ PPCC/C++TEXT.c++MW C/C++ PPCC/C++TEXT.ccMW C/C++ PPCC/C++TEXT.cpMW C/C++ PPCC/C++TEXT.expTEXT.pchMW C/C++ PPCC/C++TEXT.pch++MW C/C++ PPCC/C++TEXT.rRezRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.c++L)\n@ MW C/C++ PPCC/C++t p$O p(.cppL)\n@ MW C/C++ PPCC/C++t p$O p(.cppMW C/C++ PPC.cppMW C/C++ PPC.docP.hppMW C/C++ PPC.hppMW C/C++ PPC.oXCOFF Import PPC.ppob`.rsrc`.yL)\+xE` $O @p$O:`ӧh p$O p(NoneMMPr@Java Linker RSRCTEXT.htmlJavaTEXT.javaMW JavaJavaTEXT.mfJavarsrc.auJAR Importer@.classMW Java.gifJAR Importer@.jarMW Java.zipMW JavaMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.oMPW Import 68K.ppob`.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.rRezRezappe`rsrc`shlbMach-O PPC LinkerAPPL`Appl`MLIBLib Import Mach-OMMLBLib Import Mach-OMPLFLib Import Mach-OMWCD`RSRC`TEXT.cMW C/C++ MachPPCC/C++TEXT.c++MW C/C++ MachPPCC/C++TEXT.ccMW C/C++ MachPPCC/C++TEXT.cpMW C/C++ MachPPCC/C++TEXT.cppMW C/C++ MachPPCC/C++TEXT.expTEXT.hMW C/C++ MachPPCC/C++TEXT.pchMW C/C++ MachPPCC/C++TEXT.pch++MW C/C++ MachPPCC/C++TEXT.rRezRezdocu`rsrc`.docPWin32 x86 LinkerTEXT.cMW C/C++ x86C/C++TEXT.c++MW C/C++ x86C/C++TEXT.ccMW C/C++ x86C/C++TEXT.cpMW C/C++ x86C/C++TEXT.cppMW C/C++ x86C/C++TEXT.defTEXT.hMW C/C++ x86C/C++TEXT.h++MW C/C++ x86C/C++TEXT.hppMW C/C++ x86C/C++TEXT.ordTEXT.pchMW C/C++ x86C/C++TEXT.pch++MW C/C++ x86C/C++TEXT.rcMW WinRCiLIBLib Import x86iOBJObj Import x86.aLib Import x86.docP.libLib Import x86.oObj Import x86.objObj Import x86.resWinRes ImportMacOS X PPC Linker0APPL`Appl`MDYLMachO ImporterC/C++MLIBMachO ImporterC/C++MMLBMachO ImporterC/C++MPLFMachO ImporterC/C++MWCD`RSRC`TEXT.arrTEXT.axpTEXT.cMW C/C++ PPC Mac OS XC/C++TEXT.c++MW C/C++ PPC Mac OS XC/C++TEXT.ccMW C/C++ PPC Mac OS XC/C++TEXT.cpMW C/C++ PPC Mac OS XC/C++TEXT.cppMW C/C++ PPC Mac OS XC/C++TEXT.expTEXT.hMW C/C++ PPC Mac OS XC/C++TEXT.h++MW C/C++ PPC Mac OS XC/C++TEXT.hppMW C/C++ PPC Mac OS XC/C++TEXT.lcfTEXT.mMW C/C++ PPC Mac OS XC/C++TEXT.mmMW C/C++ PPC Mac OS XC/C++TEXT.pchMW C/C++ PPC Mac OS XC/C++TEXT.pch++MW C/C++ PPC Mac OS XC/C++TEXT.pchmMW C/C++ PPC Mac OS XC/C++TEXT.pchmmMW C/C++ PPC Mac OS XC/C++TEXT.plcProperty List CompilerProperty ListTEXT.plocProperty List CompilerProperty ListTEXT.rRezRezTEXT.wkedocu`rsrc`.aMachO ImporterC/C++.docP.dylibMachO ImporterC/C++.gifCopy To PackageP.icnsCopy To PackageP.jpgCopy To PackageP.libMachO ImporterC/C++.nibCopy To PackageP.plPerl ToolPerl.plistCopy To Package.ppob`.pshShell Tool.rsrc`.shShell Tool.stringsCopy To Package.tiffCopy To PackagePLD Mach-O Linker*MDYL.dylibLD Mach-O ImporterDisassemblyMLIB.aLD Mach-O ImporterDisassemblyMLIB.oLD Mach-O ImporterDisassemblyMPLF.aLD Mach-O ImporterDisassemblyMPLF.oLD Mach-O ImporterDisassemblyRSRCNone`TEXT.cGNU Pascal Mach-O CompilerC/C++TEXT.dprGNU Pascal Mach-O CompilerPascalTEXT.dumpNoneTEXT.hGNU Pascal Mach-O CompilerC/C++TEXT.incGNU Pascal Mach-O CompilerPascalTEXT.pGNU Pascal Mach-O CompilerPascalTEXT.pasGNU Pascal Mach-O CompilerPascalTEXT.ppGNU Pascal Mach-O CompilerPascalTEXT.symtabNonersrcNone`.aLD Mach-O ImporterDisassembly.cGNU Pascal Mach-O CompilerC/C++.dprGNU Pascal Mach-O CompilerPascal.dylibLD Mach-O ImporterDisassembly.hGNU Pascal Mach-O CompilerC/C++.htmNone`.htmlNone`.icnsNone`.incGNU Pascal Mach-O CompilerPascal.jpegNone`.jpgNone`.nibNone`.oLD Mach-O ImporterDisassembly.pGNU Pascal Mach-O CompilerPascal.paletteNone`.pasGNU Pascal Mach-O CompilerPascal.pictNone`.plPerl ToolPerl.plistXML`.pngNone`.ppGNU Pascal Mach-O CompilerPascal.pshShell Tool.rsrcNone`.rtfNone`.shShell Tool.stringsNone`Lib Import PPCMPLFLib Import PPCMWCDTEXT.ccMW C/C++ PPCC/C++TEXT.cpMW C/C++ PPCC/C++TEXT.expTEXT.pchMW C/C++ PPCC/C++TEXT.pch++MW C/C++ PPCC/C+MacHeaders.cMacOS_Carbon_C++_Macros.hTEmainno connections availableeH:O,/K`$o\,oX Gv6YO//l/N(/Ho/NAPX&HHP/ B'p@rƒ/N;II/Ho/Npg 0Rgpƀpg/*g*J*fpƀ g/*pg0/jgpƀpgUO/ HjHxNDfpƀ@Main-ClassAuto-GeneratedTEXT.expdocu`rsrc`@!5{END 5{5{7EXT5{4 @MRJApplicationWARZmacosxmacosxMSIEhttp://java.sun.com/products/jdk/1.1/docs/api/ Merge Out????APPLa.rsrc????APPLa.rsrc::DLGXckidProjWSPCstart.6@6ߠ6@66ހ6 66`66ܠ6@6606ڠ66066P66װ6`66֐66p6P'CODE' 'DATA' 'PICT'3{Compiler}MacOS X Support/GNU Pascal/GPCPInterfaces[APPL????9#1:K`jl  *8EUet !"#$%& '"(-)9*D+R,_-g.p/z0123456789: ;<"=+>5?B@OA]BhCuDEFGHIJKLMNOP)Q5R=SLTTU_VkWwXYZ[\]^_`a bc d'e3f<gKh]iejpkzlmnopqrstuv w2xFyMz\{f|}~+:Mbs  6I^r  # > R ` q }   ' < S q  4 H ] q ????APPLqqq+ e!L#CshPf0 AddPinRaPoiMIte tRes' MenuI tConk Cont oseCillCShowHideMove$GetCGetCRjzeColiteGetCtCTitlVainCt%Ctl Elue gl SeTestragTrac Dra!"nded5#istT$r%&'()  **+B,d$`-}./shP001 Add2PinR3aPoi64MIteX5tRest6Menu7tCon8Cont9oseC:illC;Show#GetC}?etCR@zeCoABGetCCtCTiDtlVa8EinCtTFCtl qGlue Hl SeITestJDragKTrac L Dra "M ;N ^O P Q R S T U 1V OW mXKeys Y ZImpo [PW I \KBa ]lpM "^ Executable????APPL@Executable.rsrc:./A FreeFem++a.exe????MEXE@a.rsrc:./a.exea.rsrc FreeFem++(Carbon)????APPLu0@X:????FreeFem++(Carbon)  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Info.plist  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~/21486/ /CCCC `C334444H:BXXXXXXXXXXQQQQQQQQQQQQQQQQQQQQQQQQQQqqqqqqqqqqqqqqqqqqqqqqqqqq plst !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@ noname.exe3{Compiler}MacOS X Support/GNU Pascal/GPCPInterfaces r9APPL????9tMSL C++.PPC.LibMSL RuntimePPC.LibHelloWorld.cpCarbon.rMSL C.Carbon.LibMSL SIOUX.Carbon.LibCarbonLibxCarbon Std C++ Console:a.outLib Import PPCBalloon HelpMW C/C++ PPCRezPPCAsmXCOFF Import PPCPEF Import PPCMacOS PPC LinkerSource TreesAccess PathsDebugger RuntimeTarget SettingsFile MappingsBuild ExtrasDebugger TargetCustom KeywordsC/C++ CompilerC/C++ WarningsOutput FlagsPackager PanelPPC CodeGenPPC DisassemblerPPC Global OptimizerPPC LinkerPPC PEFPPC ProjectPPCAsm PanelRez Compiler:Std C++ Console Carbon:FreeFem++Bison PanelFlex PanelAFunction.cppCheckPtr.cpplex.cpplg.tab.clgfem.cppmacrgraf.cppDrawing.cppfem.cppFESpace.cppFormuleIntegration.cppFQuadTree.cppgibbs.cppMatriceCreuse_tpl.hmshptg.cppmyassert.hFreeFem++Bison Preprocessorlg.ybamg.cppMesh2.cppMeshDraw.cppMeshGeom.cppMeshgibbs.cppMeshio.cppMeshQuad.cppMeshRead.cppMeshWrite.cppMetric.cpppcrgraph.cpppsgraph.cppQuadTree.cppR2.cppSetOfE4.cppBamgFreeFem.cppGeomIntersection.cpplgmesh.cppElement_RT.cppconfig_freefem_v3.hppAnyType.hpplex.hppVidergraph.cppRNM.hppRNM_op.hppRNM_opc.hppRNM_tpl.hppproblem.cppMSL_All_Carbon.Liblg.tab.cppstrversionnumber.cppPascal CompilerPascal WarningsArrayOfFunc.cppInitFunct.cppFreeFem-g:FreeFem++-gBFGS.hppBrentLS.hppCG.hppCubicLS.hppdefs.hppLineSearch.hppNewtonRaphson.hppNRJ.hppOptima.hppParam.hppRosenBrock.hpplgalgo.cpperror.hppProperty Listeigenvalue.cpparpackLibCarbonElement_P2h.cppamdumfpackLibCarbonQuadratureFormular.cppload.cppFreeFem++.CarbonFreeFem++(Carbon)FreeFem++-g(Carbon)vecLibAFunction2.cpplgmat.cppLibraries/Runtime/Libs/MSL_All_Carbon.LibUniversal/Libraries/StubLibraries/CarbonLibfflib/AFunction.cppfemlib/CheckPtr.cppfflib/lex.cppfflib/lgfem.cppGraphics/macrgraf.cppfemlib/Drawing.cppfemlib/fem.cppfemlib/FESpace.cppfemlib/FQuadTree.cppfemlib/gibbs.cppfemlib/mshptg.cpplglib/lg.yfemlib/BamgFreeFem.cppbamglib/Mesh2.cppbamglib/MeshDraw.cppbamglib/MeshGeom.cppbamglib/Meshio.cppbamglib/MeshQuad.cppbamglib/MeshRead.cppbamglib/MeshWrite.cppbamglib/Metric.cppbamglib/QuadTree.cppbamglib/SetOfE4.cppfflib/lgmesh.cppfemlib/Element_RT.cppfflib/AnyType.hppfflib/lex.hppfemlib/RNM.hppfemlib/RNM_op.hppfemlib/RNM_opc.hppfemlib/RNM_tpl.hppfflib/problem.cpplglib/lg.tab.cppfflib/strversionnumber.cppfflib/InitFunct.cppAlgo/BFGS.hppAlgo/BrentLS.hppAlgo/CG.hppAlgo/CubicLS.hppAlgo/defs.hppAlgo/LineSearch.hppAlgo/NewtonRaphson.hppAlgo/NRJ.hppAlgo/Optima.hppAlgo/Param.hppAlgo/RosenBrock.hppAlgo/lgalgo.cppfflib/error.hppEigen/eigenvalue.cppfemlib/Element_P2h.cppfemlib/QuadratureFormular.cppfflib/load.cppUniversal/Libraries/StubLibraries/vecLibfflib/AFunction2.cppfflib/lgmat.cppfflib/CodeAlloc.cppfflib/global.cppGraphics/SetColor.cppGraphics/DefColor.cppfflib/AFunction3.cppfflib/mt19937ar.cppfflib/AFunction3.hppfflib/array_tlp.hppfflib/array_real.cppfflib/array_complex.cppfflib/array_long.cpplglib/environment.cppfflib/environment.cppfflib/string_def.cpplglib/mymain.cpp|@}@~    (*+,-./0123456P78:;<=>BCDEFGHIJKLMNOPQRTUsVWY@Z[\]_`abcdfgq@ hiPmstr( mstl mstnL9mstr7 mstl(mstnPprefؚ Q pref Q prefQprefxZprefUrb=prefdmtpl|mtps$mtpi4 mtlob mtsl,4mtgl(moti~xPLstD%C,mpsiT(msti(msti\Mmallmapl\UprefH>&}v^prefHi'}prefI(*pref{< pref ?[8pref]\! pref,Z^ mtsl\9mtplBY|mtps6mtpiH mtloprefk_Ppref`prefa#pref$bTVprefXcQ%"prefd pref8eJcprefIfpref9tgprefh)@prefiprefjrprefk\kpreflprefmKprefnpref;oV6prefp$ pref*q1prefr.L&pref} spreft3rprefua8prefc4v> pref*w"pref;x"prefX1y prefz pref{*prefn|+lprefU}9prefr~4pref`Atpref`Fpref x} prefR"pref_pref1,-preftK,Epreft pref7#prefHDpref=~Lpref(D,_\pref(tPpref(ûXpref'7G2pref(7prefL12^pref3qprefD4vpref?5|(V0pref6X"pref7z prefי8ݚpref29"pref:,pref;YG@pref=0pref>pref@8pref&|AHpref\YzprefiB@prefmHprefCH!6prefhD$ prefE prefF&pref{G{prefH$hprefIHW"prefJHy"prefZ} prefZOK7 prefwL|upref0MPs\pref;*~preflpref[2jpref,\Npref ?N:VprefhOfprefU@PA&preft prefAQH"prefRHprefSZ2prefPpref#TZprefU7 prefVpref}WG6pref=X\.pref'uaspref(5v6pref(.<apref'H pref'Mpref'ïZpref'apref'xapref'}?4pref'U8kpref'R*@pref'bpref'#pref'\Dpref'MLKpref'zK pref'(K&Mpref'UKspref'Kpref'uKpref'dK4pref'Kpref( K@pref($freefem++-3.61-1/configure000755 000767 000024 00002364420 13321623126 015521 0ustar00hechtstaff000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for FreeFem++ 3.61-1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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 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 # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (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 # 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. as_myself= 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 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="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_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: frederic.hecht@sorbonne-universite.fr about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { 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_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi 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'` # 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_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # 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; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/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= # Identity of this package. PACKAGE_NAME='FreeFem++' PACKAGE_TARNAME='freefem++' PACKAGE_VERSION='3.61-1' PACKAGE_STRING='FreeFem++ 3.61-1' PACKAGE_BUGREPORT='frederic.hecht@sorbonne-universite.fr' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS TOOL_DYLIB_hpddm TOOL_COMPILE_hpddm TOOL_DYLIB_pardiso TOOL_COMPILE_pardiso TOOL_DYLIB_NewSolver TOOL_COMPILE_NewSolver TOOL_DYLIB_gsl TOOL_COMPILE_gsl FFCS_WINDOWS_FALSE FFCS_WINDOWS_TRUE TOOL_DYLIB_iohdf5 TOOL_COMPILE_iohdf5 HDF5_FLIBS HDF5_FFLAGS HDF5_FC HDF5_LIBS HDF5_LDFLAGS HDF5_CPPFLAGS HDF5_CFLAGS HDF5_CC HDF5_VERSION H5FC H5CC SED TEST_FFPPMPI TEST_FFPP_MPI TEST_FFPP STDPROG BAMGPROG FFGLUTPROG MEDITPROG FNOFLAGS CNOFLAGS LIBC_VERSION KERNEL_VERSION SCOTCH_INCLUDE NO_RANGE_CHECK TOOL_DYLIB_MMAP TOOL_COMPILE_MMAP BIN_ffmaster TOOL_DYLIB_yams TOOL_COMPILE_yams TOOL_DYLIB_umfpack TOOL_COMPILE_umfpack TOOL_DYLIB_superludist TOOL_COMPILE_superludist TOOL_DYLIB_superlu4 TOOL_COMPILE_superlu4 TOOL_DYLIB_scotch TOOL_DYLIB_pipe TOOL_COMPILE_pipe TOOL_DYLIB_pastix TOOL_COMPILE_pastix TOOL_DYLIB_parms TOOL_COMPILE_parms TOOL_DYLIB_nlopt TOOL_COMPILE_nlopt TOOL_DYLIB_mumps_seq TOOL_COMPILE_mumps_seq TOOL_DYLIB_mumps TOOL_DYLIB_gmm TOOL_COMPILE_gmm TOOL_DYLIB_mshmet TOOL_COMPILE_mshmet TOOL_DYLIB_mmg3d TOOL_COMPILE_mmg3d TOOL_DYLIB_parmetis TOOL_DYLIB_lapack TOOL_COMPILE_lapack TOOL_DYLIB_ipopt TOOL_COMPILE_ipopt TOOL_DYLIB_hips TOOL_COMPILE_hips TOOL_DYLIB_tetgen TOOL_COMPILE_tetgen GSL_LIBS GSL_CFLAGS GSL_CONFIG STD_LIBS STD_LDFLAGS STD_GRAPH_OBJ DYLIB_SUFFIX LOAD_COMPILE LOAD_TESTS RANLIN ARFLAGS AR STATICTOOL ff_libtool FF_SECOND FF_MALLOC_H FF_HAVE_REGEX_H UMFPACKLIBS FF_UMFPACK_CONFIG DOWNLOAD_UMFPACK UMFPACK_CPPFLAGS EIGENOBJ SKIP_TESTS_EIGEN ARPACKLIBS LAPACK_arpack_LIB ARPACKLIB FF_LAPACKdir DOWNLOAD_ARPACK LAPACKLIBS G2CLIB BLASINC BLASLIBS DOWNLOADED_BLAS_BUILT_SOURCES ff_unzip COMPILE_OPENBLAS DOWNLOADED_BLAS ff_git DOWNLOAD_FFTW DOWNLOADCOMPILE WGET ff_curl ff_wget TOOL_COMPILE_petsccomplex TOOL_COMPILE_blaslapack TOOL_COMPILE_suitesparse TOOL_COMPILE_scalapack TOOL_COMPILE_mumps TOOL_COMPILE_fftw3_mpi TOOL_COMPILE_scotch TOOL_COMPILE_ptscotch TOOL_COMPILE_metis TOOL_COMPILE_parmetis TOOL_COMPILE_petsc FFCS_MPIOK_FALSE FFCS_MPIOK_TRUE SKIP_TESTS_MPI MPI_LIBFC MPI_LIBC MPI_LIB MPI_LIB_DIRS MPI_INCLUDE MPI_INC_DIR PASTIX_HOSTARCH MPICC MPIFC MPIF77 MPISCRIPT MPIPROG MPICXX MPIRUN LIBSGLUT LIBSPTHREAD EGREP GREP CXXCPP ADD_PACKAGE_NAME CXX11FLAGS WITH_CXX11 OPTIM_TYPE ff_prefix_dir_example ff_prefix_dir_lib_mpi ff_prefix_dir_etc ff_prefix_dir_include ff_prefix_dir_lib ff_prefix_dir WIN32DLLTARGET LIBSNOCONSOLE WINDRESOBJ FFGLUTNAME GCCNOCYGWIN YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX CFLAGSF77 FLIBS host_os host_vendor host_cpu host build_os build_vendor build_cpu build ac_ct_F77 FFLAGS F77 ac_ct_FC FCFLAGS FC ENABLE_FFCS_FALSE ENABLE_FFCS_TRUE ENABLE_FFCS SIZEOF_PTRINBIT SIZEOF_PTR SIZEOF_INT SIZEOF_LONG ff_patch ff_flex ff_bison ff_m4 am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep 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 RANLIB AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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_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_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_ffcs enable_fortran with_flib enable_c with_glut enable_cygwindll enable_mingw64 enable_profiling enable_m64 enable_m32 enable_debug enable_optim enable_generic with_suffix enable_opengl with_mpipath with_mpilibs with_mpilibsc with_mpiinc with_mpi enable_download with_petsc with_petsc_complex with_wget with_mkl with_cadna enable_system_fftw enable_system_blas enable_mkl_mlt with_blas enable_openblas with_lapack with_arpack enable_system_umfpack with_amd with_umfpack enable_static with_gsl_prefix with_gsl_exec_prefix enable_gsltest enable_tetgen with_tetgen_include with_tetgen_ldflags enable_download_tetgen enable_hips with_hips_include with_hips_ldflags enable_download_hips enable_ipopt with_ipopt_include with_ipopt_ldflags enable_download_ipopt enable_lapack with_lapack_include with_lapack_ldflags enable_download_lapack enable_parmetis with_parmetis_include with_parmetis_ldflags enable_download_parmetis enable_mmg3d with_mmg3d_include with_mmg3d_ldflags enable_download_mmg3d enable_mshmet with_mshmet_include with_mshmet_ldflags enable_download_mshmet enable_gmm with_gmm_include with_gmm_ldflags enable_download_gmm enable_mumps with_mumps_include with_mumps_ldflags enable_download_mumps enable_mumps_seq with_mumps_seq_include with_mumps_seq_ldflags enable_download_mumps_seq enable_nlopt with_nlopt_include with_nlopt_ldflags enable_download_nlopt enable_parms with_parms_include with_parms_ldflags enable_download_parms enable_pastix with_pastix_include with_pastix_ldflags enable_download_pastix enable_pipe with_pipe_include with_pipe_ldflags enable_download_pipe enable_scotch with_scotch_include with_scotch_ldflags enable_download_scotch enable_superlu4 with_superlu4_include with_superlu4_ldflags enable_download_superlu4 enable_superludist with_superludist_include with_superludist_ldflags enable_download_superludist enable_umfpack with_umfpack_include with_umfpack_ldflags enable_download_umfpack enable_yams with_yams_include with_yams_ldflags enable_download_yams enable_MMAP with_MMAP_include with_MMAP_ldflags enable_download_MMAP with_hdf5 enable_iohdf5 with_iohdf5_include with_iohdf5_ldflags enable_download_iohdf5 enable_gsl with_gsl_include with_gsl_ldflags enable_download_gsl enable_NewSolver with_NewSolver_include with_NewSolver_ldflags enable_download_NewSolver enable_pardiso with_pardiso_include with_pardiso_ldflags enable_download_pardiso enable_hpddm with_hpddm_include with_hpddm_ldflags enable_download_hpddm ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC FC FCFLAGS F77 FFLAGS YACC YFLAGS CXXCPP MPIRUN MPICXX MPIF77 MPIFC MPICC' # 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= ;; *) 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_fn_error $? "invalid feature name: $ac_useropt" 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_fn_error $? "invalid feature name: $ac_useropt" 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_fn_error $? "invalid package name: $ac_useropt" 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_fn_error $? "invalid package name: $ac_useropt" 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_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac 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_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $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_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 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 FreeFem++ 3.61-1 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/freefem++] --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] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of FreeFem++ 3.61-1:";; 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-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-ffcs build FreeFem++ for use by FreeFem++-cs --disable-fortran No Fortran compiler available ( ARPACK need it) --disable-c No C compiler available (C BLAS need it) --enable-cygwindll Forces the use of the Cygwin DLL (not recommended) --enable-mingw64 Uses mingw64 compilers on Cygwin --enable-profiling Turn on profiling --enable-m64 Turn on 64 bits architecture --enable-m32 Turn on 32 bits architecture --enable-debug Turn on debug versions of FreeFem++ --enable-optim Turn on compiler optimization --enable-generic Turn off hardware-dependant optimization options --enable-opengl Enable/disable support for OpenGL --enable-download Download missing libraries (BLAS,ARPACK,UMFPACK,...) --disable-system-fftw Disable the automatic detection of FFTW --disable-system-blas Disable the search for a system-wide BLAS library --enable-mkl-mlt Link with the multithreaded instead of the monothreaded version of the MKL --disable-openblas Disable the automatic download of OpenBLAS --disable-system-umfpack Disable the automatic detection of umfpack, colmod, amd, .... --enable-static Build binaries with no shared library dependencies --disable-gsltest Do not try to compile and run a test GSL program --disable-tetgen Do not use tetgen --enable-download_tetgen force the download of tetgen --disable-hips Do not use hips --enable-download_hips force the download of hips --disable-ipopt Do not use ipopt --enable-download_ipopt force the download of ipopt --disable-lapack Do not use lapack --enable-download_lapack force the download of lapack --disable-parmetis Do not use parmetis --enable-download_parmetis force the download of parmetis --disable-mmg3d Do not use mmg3d --enable-download_mmg3d force the download of mmg3d --disable-mshmet Do not use mshmet --enable-download_mshmet force the download of mshmet --disable-gmm Do not use gmm --enable-download_gmm force the download of gmm --disable-mumps Do not use mumps --enable-download_mumps force the download of mumps --disable-mumps_seq Do not use mumps_seq --enable-download_mumps_seq force the download of mumps_seq --disable-nlopt Do not use nlopt --enable-download_nlopt force the download of nlopt --disable-parms Do not use parms --enable-download_parms force the download of parms --disable-pastix Do not use pastix --enable-download_pastix force the download of pastix --disable-pipe Do not use pipe --enable-download_pipe force the download of pipe --disable-scotch Do not use scotch --enable-download_scotch force the download of scotch --disable-superlu4 Do not use superlu4 --enable-download_superlu4 force the download of superlu4 --disable-superludist Do not use superludist --enable-download_superludist force the download of superludist --disable-umfpack Do not use umfpack --enable-download_umfpack force the download of umfpack --disable-yams Do not use yams --enable-download_yams force the download of yams --disable-MMAP Do not use MMAP --enable-download_MMAP force the download of MMAP --disable-iohdf5 Do not use iohdf5 --enable-download_iohdf5 force the download of iohdf5 --disable-gsl Do not use gsl --enable-download_gsl force the download of gsl --disable-NewSolver Do not use NewSolver --enable-download_NewSolver force the download of NewSolver --disable-pardiso Do not use pardiso --enable-download_pardiso force the download of pardiso --disable-hpddm Do not use hpddm --enable-download_hpddm force the download of hpddm Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-flib= the fortran library --with-glut glutlib and include --with-suffix=G3/G4/G4,P4,.. or --without-suffix (default no suffix to package name) --with-suffix=G3/G4/G4,P4,.. or --without-suffix (default no suffix package name) --with-mpipath= the path of mpich under windows (no command mpic++, ... ) --with-mpilibs= the libs to add to c++,fc, ... (to link with c++ - ex: -L/usr/local/lib -lmpi_f90 -lmpi_cxx -lmpi -lopen-rte -lopen-pal -lutil) --with-mpilibsc= the libs to add to c ... (to link with cc (for pastix lib) ex: -L/usr/local/lib -lmpi -lopen-rte -lopen-pal -lutil) --with-mpiinc= the include directory directive and preprocess directive (no mpicc++, just use the compiler)) --with-mpi=yes|no|mpic++|lam|mpich|openmpi|/usr/local/bin/mpic++|... or --without-mpi Choose MPI implementation (default is mpic++) --with-petsc=/usr/local/petsc/conf/petscvariables --without-petsc --with-petsc_complex=/usr/local/petsc/conf/petscvariables --without-petsc_complex --with-wget=command Replace "wget" with another command. Implies --enable-download --with-mkl= the MKL LIBPATH : (ie. /opt/intel/mkl/RR.r.y.xxx/lib/) --with-cadna= cadna library --without-cadna --with-blas=library Use a specific version of the Blas --with-lapack=library Use a specific version of Lapack --with-arpack=library Use a specific version of Arpack --with-amd=library Use a specific version of AMD --with-umfpack=library Use a specific version of Umfpack --with-gsl-prefix=PFX Prefix where GSL is installed (optional) --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional) --with-tetgen-include= Include directives for tetgen instead of automatic download --with-tetgen-ldflags= Link-time directives for tetgen instead of automatic download --with-hips-include= Include directives for hips instead of automatic download --with-hips-ldflags= Link-time directives for hips instead of automatic download --with-ipopt-include= Include directives for ipopt instead of automatic download --with-ipopt-ldflags= Link-time directives for ipopt instead of automatic download --with-lapack-include= Include directives for lapack instead of automatic download --with-lapack-ldflags= Link-time directives for lapack instead of automatic download --with-parmetis-include= Include directives for parmetis instead of automatic download --with-parmetis-ldflags= Link-time directives for parmetis instead of automatic download --with-mmg3d-include= Include directives for mmg3d instead of automatic download --with-mmg3d-ldflags= Link-time directives for mmg3d instead of automatic download --with-mshmet-include= Include directives for mshmet instead of automatic download --with-mshmet-ldflags= Link-time directives for mshmet instead of automatic download --with-gmm-include= Include directives for gmm instead of automatic download --with-gmm-ldflags= Link-time directives for gmm instead of automatic download --with-mumps-include= Include directives for mumps instead of automatic download --with-mumps-ldflags= Link-time directives for mumps instead of automatic download --with-mumps_seq-include= Include directives for mumps_seq instead of automatic download --with-mumps_seq-ldflags= Link-time directives for mumps_seq instead of automatic download --with-nlopt-include= Include directives for nlopt instead of automatic download --with-nlopt-ldflags= Link-time directives for nlopt instead of automatic download --with-parms-include= Include directives for parms instead of automatic download --with-parms-ldflags= Link-time directives for parms instead of automatic download --with-pastix-include= Include directives for pastix instead of automatic download --with-pastix-ldflags= Link-time directives for pastix instead of automatic download --with-pipe-include= Include directives for pipe instead of automatic download --with-pipe-ldflags= Link-time directives for pipe instead of automatic download --with-scotch-include= Include directives for scotch instead of automatic download --with-scotch-ldflags= Link-time directives for scotch instead of automatic download --with-superlu4-include= Include directives for superlu4 instead of automatic download --with-superlu4-ldflags= Link-time directives for superlu4 instead of automatic download --with-superludist-include= Include directives for superludist instead of automatic download --with-superludist-ldflags= Link-time directives for superludist instead of automatic download --with-umfpack-include= Include directives for umfpack instead of automatic download --with-umfpack-ldflags= Link-time directives for umfpack instead of automatic download --with-yams-include= Include directives for yams instead of automatic download --with-yams-ldflags= Link-time directives for yams instead of automatic download --with-MMAP-include= Include directives for MMAP instead of automatic download --with-MMAP-ldflags= Link-time directives for MMAP instead of automatic download --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration --with-iohdf5-include= Include directives for iohdf5 instead of automatic download --with-iohdf5-ldflags= Link-time directives for iohdf5 instead of automatic download --with-gsl-include= Include directives for gsl instead of automatic download --with-gsl-ldflags= Link-time directives for gsl instead of automatic download --with-NewSolver-include= Include directives for NewSolver instead of automatic download --with-NewSolver-ldflags= Link-time directives for NewSolver instead of automatic download --with-pardiso-include= Include directives for pardiso instead of automatic download --with-pardiso-ldflags= Link-time directives for pardiso instead of automatic download --with-hpddm-include= Include directives for hpddm instead of automatic download --with-hpddm-ldflags= Link-time directives for hpddm instead of automatic download Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags FC Fortran compiler command FCFLAGS Fortran compiler flags F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXXCPP C++ preprocessor MPIRUN MPI run command MPICXX MPI C++ compiler command MPIF77 MPI Fortran 77 compiler command MPIFC MPI Fortran 90 compiler command MPICC MPI C compiler command in $ff_mpi_path 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 . _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 FreeFem++ configure 3.61-1 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 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 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES # ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_cxx_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else 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 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) 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 if ac_fn_cxx_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_fc_try_compile # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_compile # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_f77_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_f77_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 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 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_run # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_link # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$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_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------- ## ## Report this to frederic.hecht@sorbonne-universite.fr ## ## ---------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_fc_try_link LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_fc_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_fc_try_link 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.61-1, which was generated by GNU Autoconf 2.69. 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) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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 $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" 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:${as_lineno-$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= ;; #( *) { eval $ac_var=; 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" 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 $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" 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 $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" 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'; as_fn_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 $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _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 # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac 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 /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$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" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$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_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 # progg test exec for windows ff_TEST_FFPP="../src/nw/FreeFem++" ff_TEST_FFPP_MPI="../src/mpi/FreeFem++-mpi" # Automake 1.11 is too old for check ... # ALH - 10/9/13 - FFCS needs to skip this automake version requirement when compiling on older platforms (eg cygwin or # last Ubuntu LTS). So we fix a low hardcoded requirement and test for higher versions when not in FFCS. am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 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. # 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:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file 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` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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" { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_path_mkdir+:} false; 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 as_fn_executable_p "$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 test -d ./--version && rmdir ./--version 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 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='freefem++' VERSION='3.61-1' 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi if test "$enable_ffcs" != yes then if test `echo $am__api_version|awk '{if($1>1.13)print "ok";}'` != ok then as_fn_error $? "Automake version needs to be 1.13 or later to enable \"make check\"" "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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 inc_usr_include="" ff_where_lib_conf=examples++-load/WHERE_LIBRARY-config # ALH - this is required by FFCS that needs to deactivate some tools that do not work on all platforms. Some FF users # may also find interesting to specify a local version of a tool instead of downloading it. # m4 macro parameters: $1 = tool name, $2 = dynamic library name, $3 = download directory name if different from $1 ff_HOSTARCH_pastix= echo "# Build with freefem++ with ./configure " `date` >$ff_where_lib_conf # To allow anonymous CVS version to contain a "./configure" and # Makefiles { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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 echo >config_LIB_INFO # Necessary compilers 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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=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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$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 # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$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='\' am__nodep='_no' 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:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; 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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$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 CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes 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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= 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 depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; 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". rm -rf conftest.dir 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_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test `uname` != Darwin; then ff_ldeg="-Wl,--end-group" ff_ldbg="-Wl,--start-group" fi # suffix of dynamic lib .. # --------------------------- ff_uname=`uname` # flag to build window 32 version ff_mingw = yes # bof bof F. Hecht case $ff_uname in CYGWIN*|MINGW*|MSYS_NT*) ff_suffix_dylib="dll" ff_suffix_dylib_a="dll.a";; Darwin) ff_suffix_dylib="dylib" ff_suffix_dylib_a="dylib";; *) ff_suffix_dylib="so"; ff_suffix_dylib_a="so"; esac # end suffix ... # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_m4+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_m4"; then ac_cv_prog_ff_m4="$ff_m4" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_m4="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_m4" && ac_cv_prog_ff_m4="no" fi fi ff_m4=$ac_cv_prog_ff_m4 if test -n "$ff_m4"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_m4" >&5 $as_echo "$ff_m4" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_bison+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_bison"; then ac_cv_prog_ff_bison="$ff_bison" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_bison="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_bison" && ac_cv_prog_ff_bison="no" fi fi ff_bison=$ac_cv_prog_ff_bison if test -n "$ff_bison"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_bison" >&5 $as_echo "$ff_bison" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_flex+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_flex"; then ac_cv_prog_ff_flex="$ff_flex" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_flex="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_flex" && ac_cv_prog_ff_flex="no" fi fi ff_flex=$ac_cv_prog_ff_flex if test -n "$ff_flex"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_flex" >&5 $as_echo "$ff_flex" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_patch+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_patch"; then ac_cv_prog_ff_patch="$ff_patch" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_patch="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_patch" && ac_cv_prog_ff_patch="no" fi fi ff_patch=$ac_cv_prog_ff_patch if test -n "$ff_patch"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_patch" >&5 $as_echo "$ff_patch" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case "$ff_m4 $ff_bison $ff_patch $ff_flex" in *no*) { $as_echo "$as_me:${as_lineno-$LINENO}: to install missing package under debian or ubuntu, try " >&5 $as_echo "$as_me: to install missing package under debian or ubuntu, try " >&6;} test "$ff_m4" = no && { $as_echo "$as_me:${as_lineno-$LINENO}: sudo apt-get install m4" >&5 $as_echo "$as_me: sudo apt-get install m4" >&6;} test "$ff_bison" = no && { $as_echo "$as_me:${as_lineno-$LINENO}: sudo apt-get install bison" >&5 $as_echo "$as_me: sudo apt-get install bison" >&6;} test "$ff_flex" = no && { $as_echo "$as_me:${as_lineno-$LINENO}: sudo apt-get install flex" >&5 $as_echo "$as_me: sudo apt-get install flex" >&6;} test "$ff_patch" = no && { $as_echo "$as_me:${as_lineno-$LINENO}: sudo apt-get install patch" >&5 $as_echo "$as_me: sudo apt-get install patch" >&6;} as_fn_error $? " Sorry missing m4,bison,flex,patch command !" "$LINENO" 5;; esac if test -z "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: fatal error : c++ compiler ! " >&5 $as_echo "$as_me: fatal error : c++ compiler ! " >&6;}; as_fn_error $? " Sorry no c++ compiler !" "$LINENO" 5 fi if ac_fn_cxx_compute_int "$LINENO" "sizeof(long)" "ff_size_long" ""; then : fi if ac_fn_cxx_compute_int "$LINENO" "sizeof(int)" "ff_size_int" ""; then : fi if ac_fn_cxx_compute_int "$LINENO" "sizeof(int*)" "ff_size_ptr" ""; then : fi SIZEOF_LONG=$ff_size_long SIZEOF_INT=$ff_size_int SIZEOF_PTR=$ff_size_ptr if test "0$ff_size_ptr" -eq 4 ;then SIZEOF_PTRINBIT=32 ff_ptrbit=32 elif test "0$ff_size_ptr" -eq 8 ;then SIZEOF_PTRINBIT=64 ff_ptrbit=64 else { $as_echo "$as_me:${as_lineno-$LINENO}: fatal error : sizeof pointer $ff_size_ptr ! or no c++ compiler: $CXX " >&5 $as_echo "$as_me: fatal error : sizeof pointer $ff_size_ptr ! or no c++ compiler: $CXX " >&6;}; as_fn_error $? " Sorry sizeof c++ pointer $ff_size_ptr are not 4 or 8 " "$LINENO" 5 fi # FFCS - build the code for FreeFem++-cs # Check whether --enable-ffcs was given. if test "${enable_ffcs+set}" = set; then : enableval=$enable_ffcs; fi if test "$enable_ffcs" = yes then cat >>confdefs.h <<_ACEOF #define ENABLE_FFCS $enable_ffcs _ACEOF else enable_ffcs=no fi ENABLE_FFCS="$enable_ffcs" if test $enable_ffcs = yes; then ENABLE_FFCS_TRUE= ENABLE_FFCS_FALSE='#' else ENABLE_FFCS_TRUE='#' ENABLE_FFCS_FALSE= fi # dur dur car sous MacOsX le fortran n'est pas standard. ff_AR="ar" ff_ARFLAGS="rv" ff_RANLIB="ranlib" # Check whether --enable-fortran was given. if test "${enable_fortran+set}" = set; then : enableval=$enable_fortran; fi ff_g2c_lib=""; if test "$enable_fortran" != no then # ALH-FFCS-2/3/10: add gfortran-mp-4.4 for MacPorts on MacOS 10.6 # FH add iforr 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 f90 xlf90 g95 ifort gfortran-mp-4.4 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_FC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $FC" >&5 $as_echo "$FC" >&6; } else { $as_echo "$as_me:${as_lineno-$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 f90 xlf90 g95 ifort gfortran-mp-4.4 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_FC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FC="$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 $as_echo "$ac_ct_FC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done 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:${as_lineno-$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 ${ac_cv_fc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 $as_echo "$ac_cv_fc_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FCFLAGS=${FCFLAGS+set} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 $as_echo_n "checking whether $FC accepts -g... " >&6; } if ${ac_cv_prog_fc_g+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_cv_prog_fc_g=yes else ac_cv_prog_fc_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 $as_echo "$ac_cv_prog_fc_g" >&6; } if test "$ac_test_FCFLAGS" = set; then FCFLAGS=$ac_save_FCFLAGS 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 if test $ac_compiler_gnu = yes; then GFC=yes else GFC= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_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 if test -n "$ac_tool_prefix"; then for ac_prog in gfortran f90 xlf xlf90 g95 f77 fort77 "$FC" ifort gfortran-mp-4.4 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_F77+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$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 gfortran f90 xlf xlf90 g95 f77 fort77 "$FC" ifort gfortran-mp-4.4 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_F77+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done 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:${as_lineno-$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 ${ac_cv_f77_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if ${ac_cv_prog_f77_g+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$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=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # if test -n "$F77" # then ff_flibs="" # modif FH # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 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:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 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 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:${as_lineno-$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 ${ac_cv_prog_f77_v+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; 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:${as_lineno-$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 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $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 # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # 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 fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 $as_echo "$ac_cv_prog_f77_v" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 $as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } if ${ac_cv_f77_libs+:} false; 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:${as_lineno-$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 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $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 # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # 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 fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # 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 | -little \ |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) case $host_os in *cygwin*) ;; *) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; esac ;; -[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:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 $as_echo "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_libs" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # correct pb of double def under macos case $F77 in *fort77) if test -z "$FLIBS" ; then # FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print $(NF-2),$(NF-1)}'` # FH to remove " " FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print "echo",$(NF-2),$(NF-1)}'|sh` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fort77 FLIBS : $FLIBS " >&5 $as_echo "$as_me: WARNING: fort77 FLIBS : $FLIBS " >&2;} fi ;; *g77) for i in $FLIBS; do case $i in # save last directory of the list -L*) d=`expr $i : '-L\(.*\)'`; echo " try $d " if test -e "$d/libg2c.so" ; then ff_flibs="$d/libg2c.so" elif test -e "$d/libg2c.dylib" ; then ff_flibs="$d/libg2c.dylib" elif test -e "$d/libg2c.a" ; then ff_flibs="$d/libg2c.a" elif test -e $d/libg2c.so -o -e $d/libg2c.a ; then ff_flibs="$i" fi;; esac done if test -e "$ff_flibs" ;then FLIBS="$ff_flibs" else FLIBS="$ff_flibs -lg2c" fi { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: get dir of -lg2c FLIBS : $FLIBS " >&5 $as_echo "$as_me: WARNING: get dir of -lg2c FLIBS : $FLIBS " >&2;} ;; # add FH sep 2006 / modif 2009 *gfortran) ff_okkk=0 for i in $FLIBS; do case $i in -L*) d=`expr $i : '-L\(.*\)'`; if test -e "$d/libgfortran.$ff_suffix_dylib_a" -a -e "$d/libquadmath.$ff_suffix_dylib_a" ; then ff_flibs="$d/libgfortran.$ff_suffix_dylib_a $d/libquadmath.$ff_suffix_dylib_a" ff_okkk=1 elif test -e "$d/libgfortran.a" -a -e "$d/libquadmath.a" ; then ff_flibs="$d/libgfortran.a $d/libquadmath.a" ff_okkk=1 elif test -e "$d/libgfortran.$ff_suffix_dylib_a" ; then ff_flibs="$d/libgfortran.$ff_suffix_dylib_a" ff_okkk=2 elif test -e "$d/libgfortran.a" ; then ff_flibs="$d/libgfortran.a" ff_okkk=2 fi;; esac done if test "$ff_okkk" -ge 1 ;then FLIBS="$ff_flibs" else FLIBS="$ff_flibs -lgfortran" fi { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: get dir of -lgfortran FLIBS : $FLIBS " >&5 $as_echo "$as_me: WARNING: get dir of -lgfortran FLIBS : $FLIBS " >&2;} ;; esac # Check whether --with-flib was given. if test "${with_flib+set}" = set; then : withval=$with_flib; fi # correct FH sep 2006 -o -> -a if test "$with_flib" != no -a -n "$with_flib" then ff_g2c_lib="$with_flib" FLIBS="$with_flib" fi # add FH oct 2007 for download f2c if test -z "$F77" ; then ff_f77=`pwd`/download/bin/fort77 ff_flibs=`pwd`/download/lib/libf2c.a if test -x $ff_f77 -a -f $ff_flibs ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no fortran, but find download f2c/fort" >&5 $as_echo "$as_me: WARNING: no fortran, but find download f2c/fort" >&2;}; F77=$ff_f77 FLIBS=$ff_flibs else { $as_echo "$as_me:${as_lineno-$LINENO}: fatal error : no fortran " >&5 $as_echo "$as_me: fatal error : no fortran " >&6;}; { $as_echo "$as_me:${as_lineno-$LINENO}: add --disable-fortran " >&5 $as_echo "$as_me: add --disable-fortran " >&6;}; { $as_echo "$as_me:${as_lineno-$LINENO}: or try to compile f2c in directory download/f2c " >&5 $as_echo "$as_me: or try to compile f2c in directory download/f2c " >&6;}; { $as_echo "$as_me:${as_lineno-$LINENO}: just do: make install " >&5 $as_echo "$as_me: just do: make install " >&6;}; as_fn_error 1 " Fatal error No Fortran compiler . " "$LINENO" 5; fi fi # check if the FLIBS is correct ff_libs="$LIBS" LIBS="$ff_libs $FLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 exit (); int main () { return exit (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_err= else ff_err=ok fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; if test "$ff_err" = "ok" ; then as_fn_error 1 " Fatal FLIBS: $FLIBS is incorrect. " "$LINENO" 5; fi LIBS="$ff_libs" echo "F77 LD $ff_libs" >config_LIB_INFO { $as_echo "$as_me:${as_lineno-$LINENO}: checking Size of fortran 77 integer " >&5 $as_echo_n "checking Size of fortran 77 integer ... " >&6; } ## AC_LANG(fortran); 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 "$cross_compiling" = yes; then : ff_f77intsize=4 else cat > conftest.$ac_ext <<_ACEOF program test integer p,i p=1024*1024 i= p*p open(7,file="conftest.out") if (i>0) then write(7,*) 8 else write(7,*) 4 endif close(7) end _ACEOF if ac_fn_f77_try_run "$LINENO"; then : ff_f77intsize=`cat conftest.out` else ff_f77intsize=4 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi ## AC_LANG(C++) ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_f77intsize" >&5 $as_echo "$ff_f77intsize" >&6; } 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:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5 $as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; } if ${ac_cv_f77_dummy_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" ac_fortran_dm_var=F77_DUMMY_MAIN 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 # First, try linking without a dummy main: cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=none else ac_cv_fortran_dummy_main=unknown fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define $ac_fortran_dm_var $ac_func #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=$ac_func; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done 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 ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main rm -rf conftest* LIBS=$ac_f77_dm_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5 $as_echo "$ac_cv_f77_dummy_main" >&6; } F77_DUMMY_MAIN=$ac_cv_f77_dummy_main if test "$F77_DUMMY_MAIN" != unknown; then : if test $F77_DUMMY_MAIN != none; then cat >>confdefs.h <<_ACEOF #define F77_DUMMY_MAIN $F77_DUMMY_MAIN _ACEOF if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then $as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "linking to Fortran libraries from C fails See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5 $as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; } if ${ac_cv_f77_mangling+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" 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_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success=yes; break 2 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done done 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 "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; 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 ac_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success_extra=yes; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done 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 "$ac_success_extra" = "yes"; then ac_cv_f77_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" fi else ac_cv_f77_mangling="unknown" fi else ac_cv_f77_mangling="unknown" fi LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compile a simple Fortran program See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5 $as_echo "$ac_cv_f77_mangling" >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_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 case $ac_cv_f77_mangling in "lower case, no underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 $as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ff_cfagsf77="" case $ac_cv_f77_mangling in # "lower case, no underscore, no extra underscore") # "lower case, no underscore, extra underscore") # ;; "lower case, underscore, no extra underscore") ff_cfagsf77="-DAdd_";; "lower case, underscore, extra underscore") ff_cfagsf77="-DAdd__ -Df77IsF2C";; "upper case, no underscore, no extra underscore") ff_cfagsf77="-DUPPER";; "upper case, no underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";; "upper case, underscore, no extra underscore") ff_cfagsf77="-DUPPER -DAdd_";; "upper case, underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";; *) ;; esac CFLAGSF77=$ff_cfagsf77 if test $ff_f77intsize -ne 4 then as_fn_error 1 " Fatal Error: Your fortran 77 compiler have by not 4 bytes integer ( $ff_f77intsize bytes) " "$LINENO" 5; fi test -f /mingw/bin/libpthread-2.dll && ff_pthread_dll=/mingw/bin/libpthread-2.dll ; \ if test -z "$ff_where_lib_conf_f77" ; then echo "f77 LD $FLIBS" >>$ff_where_lib_conf test -n "$ff_cfagsf77 $ff_pthread_dll" && echo "f77 INCLUDE $ff_cfagsf77 $ff_pthread_dll " >>$ff_where_lib_conf ff_where_lib_conf_f77=1 ff_where_lib_f77="$FLIBS" ff_where_inc_f77="$ff_cfagsf77 $ff_pthread_dll" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add f77 : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add f77 : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add f77 : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add f77 : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_fc" ; then echo "fc LD $FLIBS" >>$ff_where_lib_conf test -n "$ff_cfagsf77 $ff_pthread_dll" && echo "fc INCLUDE $ff_cfagsf77 $ff_pthread_dll " >>$ff_where_lib_conf ff_where_lib_conf_fc=1 ff_where_lib_fc="$FLIBS" ff_where_inc_fc="$ff_cfagsf77 $ff_pthread_dll" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add fc : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add fc : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add fc : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add fc : $FLIBS $ff_cfagsf77 $ff_pthread_dll in $ff_where_lib_conf \"" >&6;} fi fi # fin test FORTRAN .......... # ---------------------------- # Check whether --enable-c was given. if test "${enable_c+set}" = set; then : enableval=$enable_c; fi if test "$enable_c" != no then 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; 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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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 else # We need to define this otherwise ./configure crashes with # the message "configure: error: conditional "am__fastdepCC" # was never defined". am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' fi for ac_prog in flex lex 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Some useful libraries { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 pthread_create (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : ff_pthread="-lpthread" else ff_pthread="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for omp_get_wtime in -liomp5" >&5 $as_echo_n "checking for omp_get_wtime in -liomp5... " >&6; } if ${ac_cv_lib_iomp5_omp_get_wtime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liomp5 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 omp_get_wtime (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return omp_get_wtime (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_iomp5_omp_get_wtime=yes else ac_cv_lib_iomp5_omp_get_wtime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iomp5_omp_get_wtime" >&5 $as_echo "$ac_cv_lib_iomp5_omp_get_wtime" >&6; } if test "x$ac_cv_lib_iomp5_omp_get_wtime" = xyes; then : ff_iomp5="-liomp5" else ff_iomp5="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 clock_gettime (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi if test -n "$ff_pthread" ; then if test -z "$ff_where_lib_conf_pthread" ; then echo "pthread LD $ff_pthread" >>$ff_where_lib_conf test -n "" && echo "pthread INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_pthread=1 ff_where_lib_pthread="$ff_pthread" ff_where_inc_pthread="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pthread : $ff_pthread in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pthread : $ff_pthread in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pthread : $ff_pthread in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pthread : $ff_pthread in $ff_where_lib_conf \"" >&6;} fi fi # Necessary absolute pathname for local directory when some libraries # are used from several different locations (for instance locally in # configure.ac and in a subdir). curdir=`pwd` # Configure options # ----------------- echo $ac_configure_args > configure.param echo "$PATH" > config.path eval for i in $ac_configure_args\; do echo \$i\; done | sed -e "s/$/'/" -e "s/^/'/" > config.param # by default the suffix of the .so lib file is .so # it is .dll under windows # it is .dylib under macos X # suffix of dynamic lib # Checking wether we can produce a MacIntosh-specific version # ----------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we are on a MacIntosh" >&5 $as_echo_n "checking wether we are on a MacIntosh... " >&6; } ff_mac=no if test `uname` = Darwin; then ff_HOSTARCH_pastix=i686_mac ff_suffix_dylib="dylib" ff_suffix_dylib_a="dylib" ff_mac=yes cat >>confdefs.h <<_ACEOF #define FF_PREFIX_DIR_APPLE "/Applications/FreeFem++.app/Contents/" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_mac" >&5 $as_echo "$ff_mac" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we are on SunOS" >&5 $as_echo_n "checking wether we are on SunOS... " >&6; } ff_sunos=no if test `uname -s` = SunOS; then ff_sunos=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_sunos" >&5 $as_echo "$ff_sunos" >&6; } # glut ------------ # ---------------- ff_glut="" ff_glut_ok="" # Check whether --with-glut was given. if test "${with_glut+set}" = set; then : withval=$with_glut; fi if test "$with_glut" != no -a -n "$with_glut" ; then ff_libs_save="$LIBS" LIBS="$LIBS" ff_glut="$with_glut";ff_glut_ok=yes LIBS="$ff_libs_save" elif test "$with_glut" = no ; then ff_glut_ok="no" fi # Checking wether we can produce a Microsoft Windows-specific version # ------------------------------------------------------------------- # Check whether --enable-cygwindll was given. if test "${enable_cygwindll+set}" = set; then : enableval=$enable_cygwindll; fi # Check whether --enable-mingw64 was given. if test "${enable_mingw64+set}" = set; then : enableval=$enable_mingw64; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we are on Microsoft Windows" >&5 $as_echo_n "checking wether we are on Microsoft Windows... " >&6; } ff_uname=`uname` # flag to build window 32 version ff_mingw = yes ff_mingw=no ff_fpic=yes case $ff_uname in CYGWIN*) ff_fpic=no # ff_nocygwin=-mno-cygwin GCCNOCYGWIN=$ff_nocygwin ;; MINGW*|MSYS_NT*) enable_cygwindll=no;; esac case $ff_uname in CYGWIN*|MINGW*) ff_fpic=no ff_suffix_dylib="dll"; ff_suffix_dylib_a="dll.a"; ff_win32=yes; # FFCS - 8/3/12 - remove -D_MSC_VER under MinGW64 because it forces system calls to be compiled into any object # (which creates thousands of duplicate definitions for sytem calls like time()). # We need Mingw to avoid Cygwin's extra DLLs if test "$enable_cygwindll" != yes then # CHECK_COMPILE_FLAG(C++,-mwindows,CXXFLAGS) # FFCS: on Windows, FF crashes when compiling GL/glut.h and the option "--disable-opengl" is not # operational because ff_glut_ok is forced to yes here. if test $enable_ffcs = yes then ff_glut_ok=no ff_glut="" enable_opengl=no fi ff_mingw=yes enable_cygwindll=no; ff_pthread="-mthreads" # FFCS does not use the Cygwin MinGW compilers any more if test $enable_ffcs = no then CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw" FFLAGS="$FFLAGS $ff_nocygwin" CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int a; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ff_nocygwin=""; { $as_echo "$as_me:${as_lineno-$LINENO}: Sorry $ff_nocygwin optio is wrong try whitout , but try with gcc-3.3" >&5 $as_echo "$as_me: Sorry $ff_nocygwin optio is wrong try whitout , but try with gcc-3.3" >&6;} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw" FFLAGS="$FFLAGS $ff_nocygwin" CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw" CNOFLAGS="$CNOFLAGS $ff_nocygwin -I/usr/include/mingw" fi LIBS="$LIBS $ff_nocygwin -mthreads -lws2_32 -lcomdlg32" LIBSNOCONSOLE="-mwindows" # FFCS uses a specific compiler, so we specify its libraries explicitely if test $enable_ffcs = no then test -z "$MPIRUN" && MPIRUN=`which mpiexe.exe` if test "$enable_fortran" != no -o "$with_flib" != no ; then case "$F77" in *gfortran) FLIBS="$ff_nocygwin -lgfortran -lquadmath";; *g77) FLIBS="$ff_nocygwin -lg2c";; *) as_fn_error $? " Sorry no known FLIBS with this $F77 !" "$LINENO" 5 ;; esac fi fi if test -z "$ff_glut" -a "$ff_glut_ok" != "no" ; then ff_glutname="glut32" # check abort a existing function just to find in glut32.dll exist in the path # because glutInit is not the real symbol on win32 dur dur FH !!!!!!!!! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for abort in -lglut32" >&5 $as_echo_n "checking for abort in -lglut32... " >&6; } if ${ac_cv_lib_glut32_abort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lglut32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 abort (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return abort (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_glut32_abort=yes else ac_cv_lib_glut32_abort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_glut32_abort" >&5 $as_echo "$ac_cv_lib_glut32_abort" >&6; } if test "x$ac_cv_lib_glut32_abort" = xyes; then : ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32" else ff_glut="" fi if test -z "$ff_glut" ; then ff_glutname="freeglut" if test -x /usr/bin/pkg-config.exe ; then ff_glut="-lglu32 "`/usr/bin/pkg-config.exe --libs freeglut` else ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for abort in -lfreeglut" >&5 $as_echo_n "checking for abort in -lfreeglut... " >&6; } if ${ac_cv_lib_freeglut_abort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfreeglut $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 abort (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return abort (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_freeglut_abort=yes else ac_cv_lib_freeglut_abort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeglut_abort" >&5 $as_echo "$ac_cv_lib_freeglut_abort" >&6; } if test "x$ac_cv_lib_freeglut_abort" = xyes; then : ff_glut_ok=yes else ff_glut="" fi fi fi # Resources for FreeFem++-cs in Microsoft Windows format FFGLUTNAME=$ff_glutname WINDRESOBJ=windres.o LIBSNOCONSOLE=$LIBSNOCONSOLE WIN32DLLTARGET=win32-dll-target ff_TEST_FFPP="../src/bin-win32/FreeFem++.exe" ff_TEST_FFPP_MPI="../src/bin-win32/FreeFem++-mpi.exe" $as_echo "#define PURE_WIN32 1" >>confdefs.h ff_dynload=yes fi ;; *) ff_win32=no;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_win32" >&5 $as_echo "$ff_win32" >&6; } if test "$ff_win32" = no then enable_cygwindll=no fi # FreeFem++-specific version information # -------------------------------------- # Version numbering, converted to a floating point value ff_numver="`echo $VERSION|sed 's/-\(.*\)/+\1.0*0.000001/'`" cat >>confdefs.h <<_ACEOF #define VersionFreeFempp $ff_numver _ACEOF # Since src/fflib/strversionnumber.cpp is recreated at each build, this # date is only useful for config-version.h test "$prefix" = NONE && prefix="$ac_default_prefix" ff_prefix_dir="${prefix}/lib/ff++/$VERSION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking prefix dir freefem++ " >&5 $as_echo_n "checking prefix dir freefem++ ... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_prefix_dir" >&5 $as_echo "$ff_prefix_dir" >&6; } FF_DATE=`date` cat >>confdefs.h <<_ACEOF #define VersionFreeFemDate "$FF_DATE" _ACEOF cat >>confdefs.h <<_ACEOF #define FF_PREFIX_DIR "${ff_prefix_dir}" _ACEOF ff_prefix_dir=$ff_prefix_dir ff_prefix_dir_lib="$ff_prefix_dir/lib" ff_prefix_dir_data="$datadir/$PACKAGE_NAME" ff_prefix_dir_include="$ff_prefix_dir/include" ff_prefix_dir_etc="$ff_prefix_dir/etc" ff_prefix_dir_lib_mpi="$ff_prefix_dir/lib/mpi" ff_prefix_dir_example="$ff_prefix_dir_data/$PACKAGE_VERSION" ff_prefix_dir_lib=$ff_prefix_dir_lib ff_prefix_dir_include=$ff_prefix_dir_include ff_prefix_dir_etc=$ff_prefix_dir_etc ff_prefix_dir_lib_mpi=$ff_prefix_dir_lib_mpi ff_prefix_dir_example=$ff_prefix_dir_example # Separate configuration header file for version information, included # in config-macos9.h cat << EOF > config-version.h /* FreeFem++ version information for MacOS 9 configuration */ /* File generated by configure.ac */ /* Define to the full name and version of this package. */ #define PACKAGE_STRING "$PACKAGE_STRING" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "$PACKAGE_TARNAME" /* Define to the version of this package. */ #define PACKAGE_VERSION "$PACKAGE_VERSION" /* Version number of package */ #define VERSION "$VERSION" /* FreeFem++ build date */ #define VersionFreeFemDate "$FF_DATE" /* FreeFem++ version as a float */ #define VersionFreeFempp ($ff_numver) EOF # Checking wether to produce a debug version # ------------------------------------------ # Generic or hardware-dependant optimization # Checks whether a compiler accepts a given flag # ---------------------------------------------- # $1 = compiler name # $2 = flag # $3 = make macro containing flags for that compiler # $4 = exec is true .. # Note: changes AC_LANG() # Choosing debugging and/or optimization flags for compilation # ------------------------------------------------------------ # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then : enableval=$enable_profiling; fi if test "$enable_profiling" = yes then CXXFLAGS="$CXXFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi if test "$enable_m64" = yes -a "$enable_m32" then as_fn_error 1 " Choose 32 or 64 architecture not the both " "$LINENO" 5; fi # Check whether --enable-m64 was given. if test "${enable_m64+set}" = set; then : enableval=$enable_m64; fi if test "$enable_m64" = yes then ff_m64=-m64 ff_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $ff_m64" >&5 $as_echo_n "checking whether the C compiler accepts $ff_m64... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS $ff_m64" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "ff_ok" ; then ff_ok="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$ff_ok" = yes ;then CNOFLAGS="$CFLAGS $ff_m64";fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts $ff_m64" >&5 $as_echo_n "checking whether the C++ compiler accepts $ff_m64... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS $ff_m64" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts $ff_m64" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts $ff_m64... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS $ff_m64" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # add -fPIC on on 64 architecture if test "$ff_ok" = yes -a "$ff_fpic" != "no" ;then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -fPIC" >&5 $as_echo_n "checking whether the C compiler accepts -fPIC... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "ff_ok" ; then ff_ok="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -fPIC" >&5 $as_echo_n "checking whether the C++ compiler accepts -fPIC... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -fPIC" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -fPIC... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi # Check whether --enable-m32 was given. if test "${enable_m32+set}" = set; then : enableval=$enable_m32; fi if test "$enable_m32" = yes then ff_m32=-m32 ff_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $ff_m32" >&5 $as_echo_n "checking whether the C compiler accepts $ff_m32... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS $ff_m32" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "ff_ok" ; then ff_ok="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$ff_ok" = yes ;then CNOFLAGS="$CFLAGS $ff_m32";fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $ff_m32" >&5 $as_echo_n "checking whether the C compiler accepts $ff_m32... " >&6; } check_save_flags="$CNOFLAGS" 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 CNOFLAGS="$CNOFLAGS $ff_m32" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CNOFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts $ff_m32" >&5 $as_echo_n "checking whether the C++ compiler accepts $ff_m32... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS $ff_m32" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts $ff_m32" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts $ff_m32... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS $ff_m32" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # add -fPIC on on 64 architecture # CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS) # CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS) # CHECK_COMPILE_FLAG(Fortran 77,-fPIC,FFLAGS) fi # Debug mode (no optimisation) # ---------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to generate debugging information" >&5 $as_echo_n "checking whether to generate debugging information... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi # Check whether --enable-optim was given. if test "${enable_optim+set}" = set; then : enableval=$enable_optim; fi if test "$enable_debug" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="`echo $CFLAGS | sed 's/-O2//g'`" FFLAGS="`echo $FFLAGS | sed 's/-O2//g'`" CXXFLAGS="`echo $CXXFLAGS | sed 's/-O2//g'`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -g" >&5 $as_echo_n "checking whether the C compiler accepts -g... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -g" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -g" >&5 $as_echo_n "checking whether the C++ compiler accepts -g... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -g" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -g" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -g... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -g" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } # No debugging information in optimized code CFLAGS="$CFLAGS -DNDEBUG" FFLAGS="$FFLAGS -DNDEBUG" CXXFLAGS="$CXXFLAGS -DNDEBUG" fi # Hardware-independant optimization # --------------------------------- if test "$enable_debug" != yes -a "$enable_optim" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -O3" >&5 $as_echo_n "checking whether the C compiler accepts -O3... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -O3" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -O3" >&5 $as_echo_n "checking whether the C++ compiler accepts -O3... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -O3" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -O3" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -O3... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -O3" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi # Check whether --enable-generic was given. if test "${enable_generic+set}" = set; then : enableval=$enable_generic; fi # FFCS: remove "-mcpu=common" to allow other hardware-dependant values of cpu for PowerPC - thank you Fred (20/02/11) if test $enable_ffcs = yes then # Generic code if test "$enable_debug" != yes \ -a "$enable_optim" != no \ -a "$enable_generic" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -mcpu=common" >&5 $as_echo_n "checking whether the C compiler accepts -mcpu=common... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -mcpu=common" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -mcpu=common" >&5 $as_echo_n "checking whether the C++ compiler accepts -mcpu=common... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -mcpu=common" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -mcpu=common" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -mcpu=common... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -mcpu=common" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi # Hardware-dependant optimization # ------------------------------- if test "$enable_debug" != yes \ -a "$enable_optim" != no \ -a "$enable_generic" != yes then # Autoconf always chooses -O2. -O2 in gcc makes some functions # disappear. This is not ideal for debugging. And when we optimize, we # do not use -O2 anyway. CFLAGS="`echo $CFLAGS | sed 's/-O2//g'`" FFLAGS="`echo $FFLAGS | sed 's/-O2//g'`" CXXFLAGS="`echo $CXXFLAGS | sed 's/-O2//g'`" # MacOS X Darwin if test -x /usr/bin/hostinfo then # If we are on MacOS X to choise the optimisaztion { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCC version" >&5 $as_echo_n "checking GCC version... " >&6; } ff_gcc4=`$CC --version |awk ' NR==1 {print $3}'|sed -e 's/\..*$//'` ff_clang=`$CC --version |awk '/clang/ {print $4}'` if test -n "$ff_clang" ; then ff_gcc4="llvm"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_gcc4" >&5 $as_echo "$ff_gcc4" >&6; } # At the moment, we do not know how to produce correct # optimizated code on G5. { $as_echo "$as_me:${as_lineno-$LINENO}: checking PowerPC architecture" >&5 $as_echo_n "checking PowerPC architecture... " >&6; } ff_machine=`(test -x /usr/bin/machine && /usr/bin/machine) || echo unknow` ff_fast="-O3" if test -n "$ff_clang" ; then ff_fast='-O3' elif test `uname` = Darwin then # Optimization flags: -fast option do not work because the # -malign-natural flags create wrong IO code if test "$ff_gcc4" -eq 4 then ff_fast='-fast' else ff_fast='-O3 -funroll-loops -fstrict-aliasing -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math -mpowerpc-gpopt -force_cpusubtype_ALL -fstrict-aliasing -mpowerpc64 ' fi fi # CPU detection case $ff_machine in ppc7450) # G4 ff_fast="$ff_fast -mtune=G4 -mcpu=G4";; ppc970) # G5 # remove -fstrict-aliasing on G5 to much optim the # code cash in GC ff_fast="`echo $ff_fast -mtune=G5 -mcpu=G5| sed 's/-fstrict-aliasing //g'`";; ppc*) # G3 ???? ff_fast="-O3";; i486) ff_fast="-O3 $ff_fast";; x86_64*) ff_fast="-O3 $ff_fast";; *) as_fn_error $? "cannot determine apple cpu type " "$LINENO" 5 ff_fast="-O3";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_fast" >&5 $as_echo "$ff_fast" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $ff_fast" >&5 $as_echo_n "checking whether the C compiler accepts $ff_fast... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS $ff_fast" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts $ff_fast" >&5 $as_echo_n "checking whether the C++ compiler accepts $ff_fast... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS $ff_fast" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts $ff_fast" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts $ff_fast... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS $ff_fast" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Linux elif test -f /proc/cpuinfo then # Specific processors proc_type=unknown ff_optim_type= if test `grep 'Pentium III (Coppermine)' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium3 ff_optim_type=-P3 elif test `grep 'Intel(R) Pentium(R) III ' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium3 ff_optim_type=-P3 elif test `grep 'Intel(R) Pentium(R) 4 ' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium4 ff_optim_type=-P4 elif test `grep 'Intel(R) Xeon(TM) CPU' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium4 ff_optim_type=-P4 elif test `grep 'AMD Athlon(tm) Processor' /proc/cpuinfo|wc -l` -gt 0 then proc_type=athlon ff_optim_type=-Athlon elif test `grep 'AMD Athlon(tm) XP' /proc/cpuinfo|wc -l` -gt 0 then proc_type=athlon-xp ff_optim_type=-AthlonXP fi if test "$proc_type" != unknown then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -march=$proc_type" >&5 $as_echo_n "checking whether the C compiler accepts -march=$proc_type... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -march=$proc_type" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -march=$proc_type" >&5 $as_echo_n "checking whether the C++ compiler accepts -march=$proc_type... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -march=$proc_type" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -march=$proc_type" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -march=$proc_type... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -march=$proc_type" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi # If we did not find a processor type (this happens with # cygwin), try and select separate capabilities instead. if test "$proc_type" = unknown then if test `grep -e '^flags.*mmx' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -mmmx" >&5 $as_echo_n "checking whether the C compiler accepts -mmmx... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -mmmx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -mmmx" >&5 $as_echo_n "checking whether the C++ compiler accepts -mmmx... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -mmmx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -mmmx" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -mmmx... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -mmmx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test `grep -e '^flags.*avx' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -mavx" >&5 $as_echo_n "checking whether the C compiler accepts -mavx... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -mavx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -mavx" >&5 $as_echo_n "checking whether the C++ compiler accepts -mavx... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -mavx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -mavx" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -mavx... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -mavx" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else if test `grep -e '^flags.*sse4_2' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -msse4.2" >&5 $as_echo_n "checking whether the C compiler accepts -msse4.2... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -msse4.2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -msse4.2" >&5 $as_echo_n "checking whether the C++ compiler accepts -msse4.2... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -msse4.2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -msse4.2" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -msse4.2... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -msse4.2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else if test `grep -e '^flags.*sse2' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -msse2" >&5 $as_echo_n "checking whether the C compiler accepts -msse2... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -msse2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -msse2" >&5 $as_echo_n "checking whether the C++ compiler accepts -msse2... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -msse2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -msse2" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -msse2... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -msse2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else if test `grep -e '^flags.*sse ' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -msse" >&5 $as_echo_n "checking whether the C compiler accepts -msse... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -msse" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -msse" >&5 $as_echo_n "checking whether the C++ compiler accepts -msse... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -msse" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -msse" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -msse... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -msse" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test `grep -e '^flags.*3dnow' /proc/cpuinfo|wc -l` -gt 0 then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -m3dnow" >&5 $as_echo_n "checking whether the C compiler accepts -m3dnow... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -m3dnow" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -m3dnow" >&5 $as_echo_n "checking whether the C++ compiler accepts -m3dnow... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -m3dnow" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 77 compiler accepts -m3dnow" >&5 $as_echo_n "checking whether the Fortran 77 compiler accepts -m3dnow... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -m3dnow" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program x end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi fi fi fi fi fi # Defines a variable containing the optimization type, to be used in # binary archive names. It may be empty if only generic optimization # is used. OPTIM_TYPE=$ff_optim_type # [[file:ax_lib_hdf5.m4]] # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html # =========================================================================== # # SYNOPSIS # # AX_LIB_HDF5([serial/parallel]) # # DESCRIPTION # # This macro provides tests of the availability of HDF5 library. # # The optional macro argument should be either 'serial' or 'parallel'. The # former only looks for serial HDF5 installations via h5cc. The latter # only looks for parallel HDF5 installations via h5pcc. If the optional # argument is omitted, serial installations will be preferred over # parallel ones. # # The macro adds a --with-hdf5 option accepting one of three values: # # no - do not check for the HDF5 library. # yes - do check for HDF5 library in standard locations. # path - complete path to the HDF5 helper script h5cc or h5pcc. # # If HDF5 is successfully found, this macro calls # # AC_SUBST(HDF5_VERSION) # AC_SUBST(HDF5_CC) # AC_SUBST(HDF5_CFLAGS) # AC_SUBST(HDF5_CPPFLAGS) # AC_SUBST(HDF5_LDFLAGS) # AC_SUBST(HDF5_LIBS) # AC_SUBST(HDF5_FC) # AC_SUBST(HDF5_FFLAGS) # AC_SUBST(HDF5_FLIBS) # AC_DEFINE(HAVE_HDF5) # # and sets with_hdf5="yes". Additionally, the macro sets # with_hdf5_fortran="yes" if a matching Fortran wrapper script is found. # Note that Autconf's Fortran support is not used to perform this check. # H5CC and H5FC will contain the appropriate serial or parallel HDF5 # wrapper script locations. # # If HDF5 is disabled or not found, this macros sets with_hdf5="no" and # with_hdf5_fortran="no". # # Your configuration script can test $with_hdf to take any further # actions. HDF5_{C,CPP,LD}FLAGS may be used when building with C or C++. # HDF5_F{FLAGS,LIBS} should be used when building Fortran applications. # # To use the macro, one would code one of the following in "configure.ac" # before AC_OUTPUT: # # 1) dnl Check for HDF5 support # AX_LIB_HDF5() # # 2) dnl Check for serial HDF5 support # AX_LIB_HDF5([serial]) # # 3) dnl Check for parallel HDF5 support # AX_LIB_HDF5([parallel]) # # One could test $with_hdf5 for the outcome or display it as follows # # echo "HDF5 support: $with_hdf5" # # You could also for example, override the default CC in "configure.ac" to # enforce compilation with the compiler that HDF5 uses: # # AX_LIB_HDF5([parallel]) # if test "$with_hdf5" = "yes"; then # CC="$HDF5_CC" # else # AC_MSG_ERROR([Unable to find HDF5, we need parallel HDF5.]) # fi # # LICENSE # # Copyright (c) 2009 Timothy Brown # Copyright (c) 2010 Rhys Ulerich # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 11 # [[file:ax_lib_gsl.m4]] # Configure path for the GNU Scientific Library # Christopher R. Gabriel , April 2000 # This is what autoupdate's m4 run will expand. It fires # the warning (with _au_warn_XXX), outputs it into the # updated configure.ac (with AC_DIAGNOSE), and then outputs # the replacement expansion. # This is an auxiliary macro that is also run when # autoupdate runs m4. It simply calls m4_warning, but # we need a wrapper so that each warning is emitted only # once. We break the quoting in m4_warning's argument in # order to expand this macro's arguments, not AU_DEFUN's. # Finally, this is the expansion that is picked up by # autoconf. It tells the user to run autoupdate, and # then outputs the replacement expansion. We do not care # about autoupdate's warning because that contains # information on what to do *after* running autoupdate. # Checking c++11 for schwarz/hpddm interface of P. Jolivet ... # F.Hecht: # do not compile all with c++11 version to much # probleme to day (frev 2015) with g++ 4.8.1 ff_cxx_save=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -std=c++11" >&5 $as_echo_n "checking whether the C++ compiler accepts -std=c++11... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -std=c++11" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "ff_cxx11" ; then ff_cxx11="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$ff_cxx11" = yes ; then CXX11FLAGS="-std=c++11"; if test -z "$ff_where_lib_conf_cxx11" ; then echo "cxx11 LD $CXX11FLAGS" >>$ff_where_lib_conf test -n "$CXX11FLAGS" && echo "cxx11 INCLUDE $CXX11FLAGS " >>$ff_where_lib_conf ff_where_lib_conf_cxx11=1 ff_where_lib_cxx11="$CXX11FLAGS" ff_where_inc_cxx11="$CXX11FLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add cxx11 : $CXX11FLAGS $CXX11FLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add cxx11 : $CXX11FLAGS $CXX11FLAGS in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add cxx11 : $CXX11FLAGS $CXX11FLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add cxx11 : $CXX11FLAGS $CXX11FLAGS in $ff_where_lib_conf \"" >&6;} fi fi CXXFLAGS="$ff_cxx_save" WITH_CXX11=$ff_cxx11 CXX11FLAGS=$CXX11FLAGS #end Checking c++11 # ------------------------------ # compilation flags of FreeFem++ # ------------------------------ # -DDRAWING bamg active some drawing facility in bamg (inquire mesh) # -DBAMG_LONG_LONG active the use of long long in bamg # -DDEBUG active the checking in bamg # -DNCHECKPTR remove check pointer facility # -DCHECK_KN active subscripting of some array # -DWITHCHECK of the dynamic type ckecking of the langague (very slow) # -DEIGENVALUE to compile the eigen value part # ------------------------------------------------ # FreeFrem++-specific optimizations -fpascal-strings if test "$enable_debug" = yes; then CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DCHECK_KN" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS -fno-inline -fexceptions" fi else CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DNCHECKPTR" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS " fi fi #whether or not to add a suffix to the package name #-------------------------------------------------- # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then : withval=$with_suffix; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking suffix to add to package name" >&5 $as_echo_n "checking suffix to add to package name... " >&6; } ff_suffix= if test "$with_suffix" = yes -o "$with_suffix" = no -o "$with_suffix" = "" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } else ff_suffix="-$with_suffix" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_suffix" >&5 $as_echo "$ff_suffix" >&6; } fi ADD_PACKAGE_NAME=$ff_suffix # Checking that OpenGL is accessible # ---------------------------------- ff_gl_ok=no ff_glx_ok=no ff_libs="$LIBS" # Check whether --with-flib was given. if test "${with_flib+set}" = set; then : withval=$with_flib; fi # Check whether --enable-opengl was given. if test "${enable_opengl+set}" = set; then : enableval=$enable_opengl; fi # echo " .... LIBS = $LIBS .... " if test x$enable_opengl != xno; then # GL libraries seem to depend on some dlopen capabilities if test "$enable_static" != yes -a "$ff_glut_ok" != yes then # If we cannot find gl.h, no OpenGL version can be produced ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_path_GREP+:} false; 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" as_fn_executable_p "$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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; 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" as_fn_executable_p "$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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #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 if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in OpenGL/gl.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "OpenGL/gl.h" "ac_cv_header_OpenGL_gl_h" "$ac_includes_default" if test "x$ac_cv_header_OpenGL_gl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENGL_GL_H 1 _ACEOF ff_gl_ok=yes else ff_gl_ok=no fi done if test "$ff_gl_ok" = no then for ac_header in GL/gl.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" if test "x$ac_cv_header_GL_gl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GL_GL_H 1 _ACEOF ff_gl_ok=yes else ff_gl_ok=no fi done fi for ac_header in GLUT/glut.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "GLUT/glut.h" "ac_cv_header_GLUT_glut_h" "$ac_includes_default" if test "x$ac_cv_header_GLUT_glut_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GLUT_GLUT_H 1 _ACEOF ff_glut_ok=yes else ff_glut_ok=no fi done if test "$ff_glut_ok" = no then for ac_header in GL/glut.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" if test "x$ac_cv_header_GL_glut_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GL_GLUT_H 1 _ACEOF ff_glut_ok=yes else ff_glut_ok=no fi done fi # GLUT ..... if test "$ff_glut_ok" = yes then for glut in \ "-framework GLUT -framework OpenGL -framework Cocoa" \ "-lglut -lGLU -lGL" do ff_glut="$glut" ff_libs1="$LIBS" LIBS="$LIBS $ff_glut" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 glutInit (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return glutInit (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_glut_ok=yes LIBS="$ff_libs1" break else ff_glut_ok=next fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; LIBS="$ff_libs1" done fi fi fi LIBSPTHREAD=$ff_pthread # ALH - 16/9/13 - at the moment the requirements for medit (glut) are not compatible with FFCS so medit is # only compiled with FF. if test $enable_ffcs = no then if test "$ff_glut_ok" = yes then LIBSGLUT=$ff_glut if test -n "$ff_pthread" ; then ff_ffglutprog="ffglut${EXEEXT}" cat >>confdefs.h <<_ACEOF #define PROG_FFGLUT "$ff_ffglutprog" _ACEOF fi ff_meditprog="ffmedit${EXEEXT}" fi fi # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then : withval=$with_suffix; fi if test "$with_suffix" = yes then with_suffix="" elif test "$with_suffix" = no -o -z "$with_suffix" then with_suffix="" else with_suffix="-$with_suffix" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking add suffix $with_suffix " >&5 $as_echo_n "checking add suffix $with_suffix ... " >&6; } ADD_PACKAGE_NAME=$with_suffix { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # Checking wether we can produce a parallel version # ------------------------------------------------- if test $enable_ffcs = no then # FF case # Checking wether we can produce a parallel version # ------------------------------------------------- ff_save_path="$PATH" # We need to choose between mpich, openmpi and lam for the Debian package # Check whether --with-mpipath was given. if test "${with_mpipath+set}" = set; then : withval=$with_mpipath; fi # Check whether --with-mpilibs was given. if test "${with_mpilibs+set}" = set; then : withval=$with_mpilibs; fi # Check whether --with-mpilibsc was given. if test "${with_mpilibsc+set}" = set; then : withval=$with_mpilibsc; fi # Check whether --with-mpiinc was given. if test "${with_mpiinc+set}" = set; then : withval=$with_mpiinc; fi # Check whether --with-mpi was given. if test "${with_mpi+set}" = set; then : withval=$with_mpi; fi if test "$with_mpi" != no ; then #if test "$with_mpi" != no ; then #AX_MPI(with_mpi=yes, with_mpi=no) #fi # Default is mpic++ ff_mpi_suffix=""; if test "$with_mpi" = yes -o -z "$with_mpi" then ff_mpicxx=mpic++ else case "$with_mpi" in lam|mpich|openmpi) ff_mpi_suffix=.$with_mpi;ff_mpicxx=mpic++.$with_mpi;; *) ff_mpicxx="$with_mpi" ;; esac fi if test -n "$with_mpiinc" -a "$with_mpiinc" != no ; then if test "$with_mpi" = 'no' ; then with_mpi='yes'; fi ff_MPI_INCLUDE="$with_mpiinc" fi if test -n "$with_mpilibs" -a "$with_mpilibs" != no ; then ff_MPI_LIB="$with_mpilibs" ff_MPI_LIBC="$with_mpilibs" ff_MPI_LIBFC="$with_mpilibs" MPICXX="$CXX $ff_MPI_INCLUDE" MPIF77="$F77 $ff_MPI_INCLUDE" MPIFC="$FC $ff_MPI_INCLUDE" MPICC="$CC $ff_MPI_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: --- set all MPI compile to compiler: $MPICC , $MPIF77, $MPIFC, $MPICC " >&5 $as_echo "$as_me: --- set all MPI compile to compiler: $MPICC , $MPIF77, $MPIFC, $MPICC " >&6;} fi if test -n "$with_mpilibsc" -a "$with_mpilibsc" != no ; then ff_MPI_LIBC="$with_mpilibsc" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPIRUN" >&5 $as_echo_n "checking for MPIRUN... " >&6; } if test -z "$MPIRUN" ; then for ac_prog in mpirun mpiexec mpiexec.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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MPIRUN+:} false; then : $as_echo_n "(cached) " >&6 else case $MPIRUN in [\\/]* | ?:[\\/]*) ac_cv_path_MPIRUN="$MPIRUN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MPIRUN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MPIRUN=$ac_cv_path_MPIRUN if test -n "$MPIRUN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPIRUN" >&5 $as_echo "$MPIRUN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MPIRUN" && break done test -n "$MPIRUN" || MPIRUN="no" if test "$MPIRUN" = no then ff_mpi=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPIRUN" >&5 $as_echo "$MPIRUN" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpipath " >&5 $as_echo_n "checking for mpipath ... " >&6; } if test "$with_mpi" != no -a ! -d "$with_mpipath" -a "$MPIRUN" != no ; then # if "$MPIRUN" != no ; tehn with_mpipath=`$as_dirname -- "$MPIRUN" || $as_expr X"$MPIRUN" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$MPIRUN" : 'X\(//\)[^/]' \| \ X"$MPIRUN" : 'X\(//\)$' \| \ X"$MPIRUN" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$MPIRUN" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` with_mpipath=`$as_dirname -- "$with_mpipath" || $as_expr X"$with_mpipath" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$with_mpipath" : 'X\(//\)[^/]' \| \ X"$with_mpipath" : 'X\(//\)$' \| \ X"$with_mpipath" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$with_mpipath" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` # echo " ***** with_mpipath $with_mpipath \n" # else # for i in '/c/Program Files (x86)/MPICH2' '/c/Program Files/MPICH2' 'c:\Program Files (x86)\MPICH2' 'c:\Program Files\MPICH2' ; do # test -d "$i" && with_mpipath="$i" && break # done # fi fi #echo "**** with_mpipath '$with_mpipath' $MPIRUN *****" case "$MPIRUN" in */sgi/mpt/*) ff_MPI_INCLUDE_DIR= ff_MPI_LIB_DIR= test -f "$with_mpipath/include/mpif.h" && ff_MPI_INCLUDE_DIR="$with_mpipath/include" test -f "$with_mpipath/lib/libmpi.so" && ff_MPI_LIB_DIR="$with_mpipath/lib" if test -n "$ff_MPI_INCLUDE_DIR" -a -n "$ff_MPI_LIB_DIR" ; then ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' " with_mpiinc="$ff_MPI_INCLUDE" ff_MPI_LIBC="-L'$ff_MPI_LIB_DIR' -lmpi" ff_MPI_LIB="-L'$ff_MPI_LIB_DIR' -lmpi++ -lmpi" ff_MPI_LIBFC="-L'$ff_MPI_LIB_DIR' -lmpi" ff_mpitype=sgi test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" # echo " *** MPI sgi ..... " fi ;; esac echo " #### --$MSMPI_INC--$MSMPI_BIN--$ff_win32" if test -n "$MSMPI_INC" -a -n "$MSMPI_BIN" -a "$ff_win32" = yes ; then echo " #### check MSMPI" # MSMPI_LIB64 MSMPI_LIB32 $ff_ptrbit is 32 or 64 mkdir -p download/include/msmpi mkdir -p download/lib/msmpi cp "$MSMPI_INC"/*.h download/include/msmpi grep -v INT_PTR_KIND "$MSMPI_INC"/mpif.h >download/include/msmpi/mpif.h test "$ff_ptrbit" -eq 64 && cp "$MSMPI_INC"/x64/*.h download/include/msmpi test "$ff_ptrbit" -eq 32 && cp "$MSMPI_INC"/x86/*.h download/include/msmpi ff_MPI_INCLUDE_DIR=`pwd`/download/include/msmpi ff_msmpi_lib="$MSMPI_LIB64" test "$ff_ptrbit" -eq 32 && ff_msmpi_lib="$MSMPI_LIB32" cp "$ff_msmpi_lib/msmpifec.lib" "$ff_msmpi_lib/msmpi.lib" download/lib/msmpi ff_msmpi_lib=`pwd`/download/lib/msmpi # MSMPI if with_mpilibs=`where msmpi.dll` then # Remove for scotch and parmetis ff_MPI_INCLUDE="-I$ff_MPI_INCLUDE_DIR '-D__int64=long long'" with_mpiinc="$ff_MPI_INCLUDE" test -z "$MPIRUN" && MPIRUN="where mpiexe.exe" ff_MPI_LIBC="'$ff_msmpi_lib/msmpi.lib'" ff_MPI_LIB="'$ff_msmpi_lib/msmpi.lib'" ff_MPI_LIBFC="'$ff_msmpi_lib/msmpifec.lib' '$ff_msmpi_lib/msmpi.lib'" test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" else echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_LOG_FD echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_FD with_mpipath=no with_mpi=no fi elif test -d "$with_mpipath" -a "$ff_win32" = yes ; then # sed -e "s?@MPIDIR@?$with_mpipath?" -e "s?@F77@?$F77?" -e "s?@CC@?$CC?" -e "s?@CXX@?$CXX?" -e "s?@FC@?$FC?" mpic++ # chmod a+rx mpic++ # for i in mpicc mpif90 mpifc mpif77 ; do cp mpic++ $i; done # ff_pwd=`pwd` # with_mpi="$ff_pwd"/mpic++ # MPICXX="$ff_pwd/mpic++" # MPIF77="$ff_pwd/mpif77" # MPIFC="$ff_pwd/mpif90" # MPICC="$ff_pwd/mpicc" zzzzzzzzzzz if with_mpilibs=`which msmpi.dll` then case "$ff_size_ptr" in 4) with_mpipathlib="$with_mpipath/Lib/i386";; 8) with_mpipathlib="$with_mpipath/Lib/amd64";; *) with_mpipath=no;; esac test -d "$with_mpipath/Inc" && ff_MPI_INCLUDE_DIR="$with_mpipath/Inc" test -d "$with_mpipath/Include" && ff_MPI_INCLUDE_DIR="$with_mpipath/Include" # Remove for scotch and parmetis # ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' '-D_MSC_VER' '-D__int64=long long'" ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' '-D__int64=long long'" with_mpiinc="$ff_MPI_INCLUDE" test -z "$MPIRUN" && MPIRUN="$with_mpipath/bin/mpiexe.exe" ff_MPI_LIBC="$with_mpilibs" ff_MPI_LIB="$with_mpilibs" ff_MPI_LIBFC="$with_mpilibs" test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" else echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_LOG_FD echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_FD with_mpipath=no with_mpi=no fi else with_mpipath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_mpi_path" >&5 $as_echo "$ff_mpi_path" >&6; } ff_save_cxx="$CXX" ff_save_libs="$LIBS" if test "$with_mpi" != no then ff_mpi_path=`$as_dirname -- "$MPIRUN" || $as_expr X"$MPIRUN" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$MPIRUN" : 'X\(//\)[^/]' \| \ X"$MPIRUN" : 'X\(//\)$' \| \ X"$MPIRUN" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$MPIRUN" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_mpi_path" in .|"") ff_mpi_path="$PATH";ff_defmpicxx="$ff_mpicxx";; *) ff_mpi_path="$ff_mpi_path";ff_defmpicxx=`expr "//$ff_mpicxx" : '.*/\(.*\)'`;; esac if test -z "$MPICXX" ; then for ac_prog in $ff_defmpicxx mpic++$ff_mpi_suffix mpicxx$ff_mpi_suffix mpiCC$ff_mpi_suffix mpCC hcp mpxlC mpxlC_r cmpic++ 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MPICXX+:} false; then : $as_echo_n "(cached) " >&6 else case $MPICXX in [\\/]* | ?:[\\/]*) ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ff_mpi_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MPICXX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MPICXX=$ac_cv_path_MPICXX if test -n "$MPICXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPICXX" >&5 $as_echo "$MPICXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MPICXX" && break done test -n "$MPICXX" || MPICXX="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPICXX" >&5 $as_echo_n "checking for MPICXX... " >&6; } fi ff_mpicxx="eval $MPICXX" CXX=$ff_mpicxx LIBS="$LIBS $ff_MPI_LIB" test -z "$ff_mpi" && ff_mpi=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc,char **argv){ char name[BUFSIZ]; int length; MPI_Init(&argc, &argv); MPI_Get_processor_name(name, &length); printf("%s: hello world\n", name); MPI_Finalize(); return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_mpi=yes else ff_mpi=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_mpi" >&5 $as_echo "$ff_mpi" >&6; } # Also check that mpirun is there. If it isn't, then MPI is # not fully installed. if test "$ff_mpi" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking MPI_DOUBLE_COMPLEX" >&5 $as_echo_n "checking MPI_DOUBLE_COMPLEX... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ff_mpi_double_complex=yes else ff_mpi_double_complex=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_mpi_double_complex" >&5 $as_echo "$ff_mpi_double_complex" >&6; } if test "$ff_mpi_double_complex" = yes ; then $as_echo "#define HAVE_MPI_DOUBLE_COMPLEX 1" >>confdefs.h fi echo "MPI CC $ff_mpi" >config_LIB_INFO # We do not AC_DEFINE any special flag for parallel # computation here, because it must only be set when the # parallel program is compiled (see src/mpi/Makfile.am) ff_mpiprog="FreeFem++-mpi${EXEEXT}" MPIPROG="$ff_mpiprog" MPISCRIPT="ff-mpirun" MPIRUN=$MPIRUN MPICXX=$MPICXX else MPICXX=$ff_save_cxx fi if test "$ff_mpi" = yes; then if test "$enable_fortran" != no then if test -z "$MPIF77" ; then for ac_prog in mpif90$ff_mpi_suffix mpif77$ff_mpi_suffix hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r cmpifc cmpif90c 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MPIF77+:} false; then : $as_echo_n "(cached) " >&6 else case $MPIF77 in [\\/]* | ?:[\\/]*) ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ff_mpi_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MPIF77="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MPIF77=$ac_cv_path_MPIF77 if test -n "$MPIF77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPIF77" >&5 $as_echo "$MPIF77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MPIF77" && break done test -n "$MPIF77" || MPIF77="""" fi if test -z "$MPIFC" ; then for ac_prog in mpif90$ff_mpi_suffix mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MPIFC+:} false; then : $as_echo_n "(cached) " >&6 else case $MPIFC in [\\/]* | ?:[\\/]*) ac_cv_path_MPIFC="$MPIFC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ff_mpi_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MPIFC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MPIFC=$ac_cv_path_MPIFC if test -n "$MPIFC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPIFC" >&5 $as_echo "$MPIFC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MPIFC" && break done test -n "$MPIFC" || MPIFC="""" fi fi echo " ********************ffmpi= '$ff_mpi' ************* " ff_MPI_INCLUDE="$with_mpiinc" if test -z "$ff_mpitype" ; then ff_mpishow=`$MPICXX -show` 2>/dev/null ff_mpicshow=`$MPICC -show` 2>/dev/null 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 '^[-/][^WLlOgp]|^-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' ' '` ff_MPI_LIBFC=`echo $ff_mpifcshow|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|grep -v 'commons,use_dylibs' |tr '\n' ' '` ff_mpi_idir=`echo $ff_mpishow|tr ' ' '\n'| grep -E '^-I'|sed s/^-I//|tr '\n' ' '`' /usr/include' fi ff_mpi_idir=`echo $ff_MPI_INCLUDE|tr ' ' '\n'| grep -E '^-I'|sed s/^-I//|tr '\n' ' '`' /usr/include' ff_mpi_ldir=`echo $ff_MPI_LIB|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|sed -e 's/^-[Llp]//' -e 's/^-Wl,//' |tr '\n' ' '`' /usr/lib'] if test -z "$ff_MPI_INCLUDE_DIR" ; then for i in $ff_mpi_idir; do if test -f "$i/mpi.h" -a -z "$ff_MPI_INCLUDE_DIR" ;then ff_MPI_INCLUDE_DIR=$i fi done fi for i in $ff_mpi_ldir; do ff_tmp=`ls $i/libmpi.*|head -1` if test -f "$ff_tmp" -a -z "$ff_MPI_LIB_DIRS" ;then ff_MPI_LIB_DIRS=$i fi done fi MPICXX=$MPICXX if test -z "$MPICC" ; then for ac_prog in mpicc$ff_mpi_suffix hcc mpcc mpcc_r mpxlc cmpicc 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MPICC+:} false; then : $as_echo_n "(cached) " >&6 else case $MPICC in [\\/]* | ?:[\\/]*) ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ff_mpi_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MPICC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MPICC=$ac_cv_path_MPICC if test -n "$MPICC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPICC" >&5 $as_echo "$MPICC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MPICC" && break done test -n "$MPICC" || MPICC="""" fi MPICC=$MPICC PASTIX_HOSTARCH=$ff_HOSTARCH_pastix if test ! -f "$ff_MPI_INCLUDE_DIR/mpif.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: MPI without fortran no file \"$ff_MPI_INCLUDE_DIR/mpif.h\" " >&5 $as_echo "$as_me: MPI without fortran no file \"$ff_MPI_INCLUDE_DIR/mpif.h\" " >&6;} else if test -n "$MPIFC" ; then if test -z "$ff_where_lib_conf_mpifc" ; then echo "mpifc LD $ff_MPI_LIBFC" >>$ff_where_lib_conf test -n "$ff_MPI_INCLUDE" && echo "mpifc INCLUDE $ff_MPI_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpifc=1 ff_where_lib_mpifc="$ff_MPI_LIBFC" ff_where_inc_mpifc="$ff_MPI_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpifc : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpifc : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpifc : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpifc : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_mpif77" ; then echo "mpif77 LD $ff_MPI_LIBFC" >>$ff_where_lib_conf test -n "$ff_MPI_INCLUDE" && echo "mpif77 INCLUDE $ff_MPI_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpif77=1 ff_where_lib_mpif77="$ff_MPI_LIBFC" ff_where_inc_mpif77="$ff_MPI_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpif77 : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpif77 : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpif77 : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpif77 : $ff_MPI_LIBFC $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} fi fi fi if test -n "$MPICXX" ; then if test -z "$ff_where_lib_conf_mpi" ; then echo "mpi LD $ff_MPI_LIB" >>$ff_where_lib_conf test -n "$ff_MPI_INCLUDE" && echo "mpi INCLUDE $ff_MPI_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpi=1 ff_where_lib_mpi="$ff_MPI_LIB" ff_where_inc_mpi="$ff_MPI_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpi : $ff_MPI_LIB $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpi : $ff_MPI_LIB $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpi : $ff_MPI_LIB $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpi : $ff_MPI_LIB $ff_MPI_INCLUDE in $ff_where_lib_conf \"" >&6;} fi fi MPI_INC_DIR=$ff_MPI_INCLUDE_DIR MPI_INCLUDE=$ff_MPI_INCLUDE MPI_LIB_DIRS=$ff_MPI_LIB_DIRS MPI_LIB=$ff_MPI_LIB MPI_LIBC=$ff_MPI_LIBC MPI_LIBFC=$ff_MPI_LIBFC SKIP_TESTS_MPI="no" fi CXX="$ff_save_cxx" LIBS="$ff_save_libs" fi fi ## clean on MPI variable if not MPI ... if test "$ff_mpi" != yes ; then MPIRUN="" MPICC="" MPICXX="" MPIF77="" MPIFC="" MPI_INCLUDE="" MPI_LIB_DIRS="" MPI_LIB="" MPI_LIBC="" MPI_LIBFC="" SKIP_TESTS_MPI="yes" ff_mpi=no fi # Local Variables: # mode:shell-script # ispell-local-dictionary:"british" # coding:utf-8 # End: else # FFCS - use the same MPI configuration choices as FFCS if test -z "$MPICXX" then ff_mpi=no else ff_mpi=yes MPICXX=$MPICXX MPICC=$MPICC MPIF77=$MPIF77 MPIFC=$MPIFC MPIPROG="FreeFem++-mpi${EXEEXT}" MPI_INCLUDE="-I $MPI_INC_DIR" MPI_INC_DIR=$MPI_INC_DIR MPI_LIB_DIRS="" MPI_LIB=$MPI_LIB MPI_LIBC="" MPI_LIBFC="" # Extra MPI-dependant configuration options that are set by FF # during MPI configuration. FFCS - 25/2/13 - Fred noticed that if # PASTIX_HOSTARCH stays blank, pastix compilation breaks. At least # i686_pc_linux and i686_mac are required by pastix on the # corresponding platforms. if test"$ff_HOSTARCH_pastix" = "" then ff_HOSTARCH_pastix=i686_pc_linux fi PASTIX_HOSTARCH=$ff_HOSTARCH_pastix # these values should not be empty otherwise # examples++-load/ff-get-dep will think that they are not # defined if test -z "$ff_where_lib_conf_mpi" ; then echo "mpi LD -DDUMMY" >>$ff_where_lib_conf test -n "-I$MPI_INC_DIR" && echo "mpi INCLUDE -I$MPI_INC_DIR " >>$ff_where_lib_conf ff_where_lib_conf_mpi=1 ff_where_lib_mpi="-DDUMMY" ff_where_inc_mpi="-I$MPI_INC_DIR" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpi : -DDUMMY -I$MPI_INC_DIR in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpi : -DDUMMY -I$MPI_INC_DIR in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpi : -DDUMMY -I$MPI_INC_DIR in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpi : -DDUMMY -I$MPI_INC_DIR in $ff_where_lib_conf \"" >&6;} fi # mpifc and mpif77 libraries should always be specified # because FF never calls the Fortran MPI compiler. It always # uses mpicxx in [[file:examples++-load/ff-c++]]. The # resulting Fortran libraries (eg Mumps) would compile even # without the proper Fortran libs, but they would not load # properly. # under Win32, libmpi_f77.a is not the right name and FFCS # mingw/mpicxx adds the right libraries by itself # With mpich2 Debian wheezy 32 bits, libmpi_f77.a is not available (request from Cico, 14/10/13) if test -f /usr/lib/openmpi/lib/libmpi_f77.a then if test -z "$ff_where_lib_conf_mpifc" ; then echo "mpifc LD -lmpi_f77" >>$ff_where_lib_conf test -n "" && echo "mpifc INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpifc=1 ff_where_lib_mpifc="-lmpi_f77" ff_where_inc_mpifc="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpifc : -lmpi_f77 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpifc : -lmpi_f77 in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpifc : -lmpi_f77 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpifc : -lmpi_f77 in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_mpif77" ; then echo "mpif77 LD -lmpi_f77" >>$ff_where_lib_conf test -n "" && echo "mpif77 INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpif77=1 ff_where_lib_mpif77="-lmpi_f77" ff_where_inc_mpif77="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpif77 : -lmpi_f77 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpif77 : -lmpi_f77 in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpif77 : -lmpi_f77 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpif77 : -lmpi_f77 in $ff_where_lib_conf \"" >&6;} fi else if test -z "$ff_where_lib_conf_mpifc" ; then echo "mpifc LD -DDUMMY" >>$ff_where_lib_conf test -n "" && echo "mpifc INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpifc=1 ff_where_lib_mpifc="-DDUMMY" ff_where_inc_mpifc="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpifc : -DDUMMY in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpifc : -DDUMMY in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpifc : -DDUMMY in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpifc : -DDUMMY in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_mpif77" ; then echo "mpif77 LD -DDUMMY" >>$ff_where_lib_conf test -n "" && echo "mpif77 INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mpif77=1 ff_where_lib_mpif77="-DDUMMY" ff_where_inc_mpif77="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mpif77 : -DDUMMY in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mpif77 : -DDUMMY in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mpif77 : -DDUMMY in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mpif77 : -DDUMMY in $ff_where_lib_conf \"" >&6;} fi fi # FFCS - MPI_DOUBLE_COMPLEX kept from original FF configure script { $as_echo "$as_me:${as_lineno-$LINENO}: checking MPI_DOUBLE_COMPLEX" >&5 $as_echo_n "checking MPI_DOUBLE_COMPLEX... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ff_mpi_double_complex=yes else ff_mpi_double_complex=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_mpi_double_complex" >&5 $as_echo "$ff_mpi_double_complex" >&6; } if test "$ff_mpi_double_complex" = yes ; then $as_echo "#define HAVE_MPI_DOUBLE_COMPLEX 1" >>confdefs.h fi fi fi # FFCS needs to change some of the FF makefiles to compile without MPI if test $ff_mpi = yes; then FFCS_MPIOK_TRUE= FFCS_MPIOK_FALSE='#' else FFCS_MPIOK_TRUE='#' FFCS_MPIOK_FALSE= fi # Looking for useful configuration utilities # ------------------------------------------ # Check whether --enable-download was given. if test "${enable_download+set}" = set; then : enableval=$enable_download; fi ## PETSc # Check whether --with-petsc was given. if test "${with_petsc+set}" = set; then : withval=$with_petsc; fi # /usr/local/petsc/conf/petscvariables #/usr/local/ff++/petsc/lib/petsc/conf/petscvariables ff_petsc_ok=no ## echo --$with_petsc-- if test "$with_petsc" != no -a $ff_mpi = yes; then for d in "$with_petsc" "${prefix}/ff-petsc/real/lib" /usr/local/ff++/petsc/lib /usr /usr/local /opt/usr /opt/local ;do for dd in "" "/petsc/conf/petscvariables" "/lib/petsc-conf/petscvariables" ; do ffconfpetsc="$d$dd" echo " petsc ... $ffconfpetsc" if test -f "$ffconfpetsc" ; then if test "$ff_petsc_ok" = no ; then PETSC_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetsc"` PETSC_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetsc"` { $as_echo "$as_me:${as_lineno-$LINENO}: find real ( $PETSC_SCALAR ) petsc in $ffconfpetsc" >&5 $as_echo "$as_me: find real ( $PETSC_SCALAR ) petsc in $ffconfpetsc" >&6;}; test "$PETSC_SCALAR" = "real" && test "$PETSC_MPIRUN" = "$MPIRUN" || cmp -s `which "$PETSC_MPIRUN"` `which "$MPIRUN"` if test "$?" -eq 0 ; then ff_PETSC_WITH_EXTERNAL_LIB=`awk -F'=' '"PETSC_WITH_EXTERNAL_LIB "==$1 {print $2}' $ffconfpetsc` ff_PETSC_CC_INCLUDES=`awk -F'=' '"PETSC_CC_INCLUDES "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_PETSC_WITH_EXTERNAL_LIB"; then ff_petsc_ok=yes; if test -z "$ff_where_lib_conf_petsc" ; then echo "petsc LD $ff_PETSC_WITH_EXTERNAL_LIB" >>$ff_where_lib_conf test -n "$ff_PETSC_CC_INCLUDES" && echo "petsc INCLUDE $ff_PETSC_CC_INCLUDES " >>$ff_where_lib_conf ff_where_lib_conf_petsc=1 ff_where_lib_petsc="$ff_PETSC_WITH_EXTERNAL_LIB" ff_where_inc_petsc="$ff_PETSC_CC_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add petsc : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add petsc : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add petsc : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add petsc : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_petsc="" fi ff_PARMETIS_LIB=`awk -F'=' '"PARMETIS_LIB "==$1 {print $2}' $ffconfpetsc` ff_PARMETIS_INCLUDE=`awk -F'=' '"PARMETIS_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_PARMETIS_LIB"; then ff_parmetis_ok=yes; if test -z "$ff_where_lib_conf_parmetis" ; then echo "parmetis LD $ff_PARMETIS_LIB" >>$ff_where_lib_conf test -n "$ff_PARMETIS_INCLUDE" && echo "parmetis INCLUDE $ff_PARMETIS_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_parmetis=1 ff_where_lib_parmetis="$ff_PARMETIS_LIB" ff_where_inc_parmetis="$ff_PARMETIS_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add parmetis : $ff_PARMETIS_LIB $ff_PARMETIS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add parmetis : $ff_PARMETIS_LIB $ff_PARMETIS_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add parmetis : $ff_PARMETIS_LIB $ff_PARMETIS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add parmetis : $ff_PARMETIS_LIB $ff_PARMETIS_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_parmetis="" fi ff_METIS_LIB=`awk -F'=' '"METIS_LIB "==$1 {print $2}' $ffconfpetsc` ff_METIS_INCLUDE=`awk -F'=' '"METIS_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_METIS_LIB"; then ff_metis_ok=yes; if test -z "$ff_where_lib_conf_metis" ; then echo "metis LD $ff_METIS_LIB" >>$ff_where_lib_conf test -n "$ff_METIS_INCLUDE" && echo "metis INCLUDE $ff_METIS_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_metis=1 ff_where_lib_metis="$ff_METIS_LIB" ff_where_inc_metis="$ff_METIS_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add metis : $ff_METIS_LIB $ff_METIS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add metis : $ff_METIS_LIB $ff_METIS_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add metis : $ff_METIS_LIB $ff_METIS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add metis : $ff_METIS_LIB $ff_METIS_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_metis="" fi ff_PTSCOTCH_LIB=`awk -F'=' '"PTSCOTCH_LIB "==$1 {print $2}' $ffconfpetsc` ff_PTSCOTCH_INCLUDE=`awk -F'=' '"PTSCOTCH_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_PTSCOTCH_LIB"; then ff_ptscotch_ok=yes; if test -z "$ff_where_lib_conf_ptscotch" ; then echo "ptscotch LD $ff_PTSCOTCH_LIB" >>$ff_where_lib_conf test -n "$ff_PTSCOTCH_INCLUDE" && echo "ptscotch INCLUDE $ff_PTSCOTCH_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_ptscotch=1 ff_where_lib_ptscotch="$ff_PTSCOTCH_LIB" ff_where_inc_ptscotch="$ff_PTSCOTCH_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add ptscotch : $ff_PTSCOTCH_LIB $ff_PTSCOTCH_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add ptscotch : $ff_PTSCOTCH_LIB $ff_PTSCOTCH_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add ptscotch : $ff_PTSCOTCH_LIB $ff_PTSCOTCH_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add ptscotch : $ff_PTSCOTCH_LIB $ff_PTSCOTCH_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_ptscotch="" fi ff_SCOTCH_LIB=`awk -F'=' '"SCOTCH_LIB "==$1 {print $2}' $ffconfpetsc` ff_SCOTCH_INCLUDE=`awk -F'=' '"SCOTCH_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_SCOTCH_LIB"; then ff_scotch_ok=yes; if test -z "$ff_where_lib_conf_scotch" ; then echo "scotch LD $ff_SCOTCH_LIB" >>$ff_where_lib_conf test -n "$ff_SCOTCH_INCLUDE" && echo "scotch INCLUDE $ff_SCOTCH_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_scotch=1 ff_where_lib_scotch="$ff_SCOTCH_LIB" ff_where_inc_scotch="$ff_SCOTCH_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add scotch : $ff_SCOTCH_LIB $ff_SCOTCH_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add scotch : $ff_SCOTCH_LIB $ff_SCOTCH_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add scotch : $ff_SCOTCH_LIB $ff_SCOTCH_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add scotch : $ff_SCOTCH_LIB $ff_SCOTCH_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_scotch="" fi ff_FFTW_LIB=`awk -F'=' '"FFTW_LIB "==$1 {print $2}' $ffconfpetsc` ff_FFTW_INCLUDE=`awk -F'=' '"FFTW_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_FFTW_LIB"; then ff_fftw3_mpi_ok=yes; if test -z "$ff_where_lib_conf_fftw3_mpi" ; then echo "fftw3_mpi LD $ff_FFTW_LIB" >>$ff_where_lib_conf test -n "$ff_FFTW_INCLUDE" && echo "fftw3_mpi INCLUDE $ff_FFTW_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_fftw3_mpi=1 ff_where_lib_fftw3_mpi="$ff_FFTW_LIB" ff_where_inc_fftw3_mpi="$ff_FFTW_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add fftw3_mpi : $ff_FFTW_LIB $ff_FFTW_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add fftw3_mpi : $ff_FFTW_LIB $ff_FFTW_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add fftw3_mpi : $ff_FFTW_LIB $ff_FFTW_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add fftw3_mpi : $ff_FFTW_LIB $ff_FFTW_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_fftw3_mpi="" fi ff_MUMPS_LIB=`awk -F'=' '"MUMPS_LIB "==$1 {print $2}' $ffconfpetsc` ff_MUMPS_INCLUDE=`awk -F'=' '"MUMPS_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_MUMPS_LIB"; then ff_mumps_ok=yes; if test -z "$ff_where_lib_conf_mumps" ; then echo "mumps LD $ff_MUMPS_LIB" >>$ff_where_lib_conf test -n "$ff_MUMPS_INCLUDE" && echo "mumps INCLUDE $ff_MUMPS_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_mumps=1 ff_where_lib_mumps="$ff_MUMPS_LIB" ff_where_inc_mumps="$ff_MUMPS_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mumps : $ff_MUMPS_LIB $ff_MUMPS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mumps : $ff_MUMPS_LIB $ff_MUMPS_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mumps : $ff_MUMPS_LIB $ff_MUMPS_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mumps : $ff_MUMPS_LIB $ff_MUMPS_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_mumps="" fi ff_SCALAPACK_LIB=`awk -F'=' '"SCALAPACK_LIB "==$1 {print $2}' $ffconfpetsc` ff_SCALAPACK_INCLUDE=`awk -F'=' '"SCALAPACK_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_SCALAPACK_LIB"; then ff_scalapack_ok=yes; if test -z "$ff_where_lib_conf_scalapack" ; then echo "scalapack LD $ff_SCALAPACK_LIB" >>$ff_where_lib_conf test -n "$ff_SCALAPACK_INCLUDE" && echo "scalapack INCLUDE $ff_SCALAPACK_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_scalapack=1 ff_where_lib_scalapack="$ff_SCALAPACK_LIB" ff_where_inc_scalapack="$ff_SCALAPACK_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add scalapack : $ff_SCALAPACK_LIB $ff_SCALAPACK_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add scalapack : $ff_SCALAPACK_LIB $ff_SCALAPACK_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add scalapack : $ff_SCALAPACK_LIB $ff_SCALAPACK_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add scalapack : $ff_SCALAPACK_LIB $ff_SCALAPACK_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_scalapack="" fi ff_SUITESPARSE_LIB=`awk -F'=' '"SUITESPARSE_LIB "==$1 {print $2}' $ffconfpetsc` ff_SUITESPARSE_INCLUDE=`awk -F'=' '"SUITESPARSE_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_SUITESPARSE_LIB"; then ff_suitesparse_ok=yes; if test -z "$ff_where_lib_conf_suitesparse" ; then echo "suitesparse LD $ff_SUITESPARSE_LIB" >>$ff_where_lib_conf test -n "$ff_SUITESPARSE_INCLUDE" && echo "suitesparse INCLUDE $ff_SUITESPARSE_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_suitesparse=1 ff_where_lib_suitesparse="$ff_SUITESPARSE_LIB" ff_where_inc_suitesparse="$ff_SUITESPARSE_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add suitesparse : $ff_SUITESPARSE_LIB $ff_SUITESPARSE_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add suitesparse : $ff_SUITESPARSE_LIB $ff_SUITESPARSE_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add suitesparse : $ff_SUITESPARSE_LIB $ff_SUITESPARSE_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add suitesparse : $ff_SUITESPARSE_LIB $ff_SUITESPARSE_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_suitesparse="" fi ff_BLASLAPACK_LIB=`awk -F'=' '"BLASLAPACK_LIB "==$1 {print $2}' $ffconfpetsc` ff_BLASLAPACK_INCLUDE=`awk -F'=' '"BLASLAPACK_INCLUDE "==$1 {print $2}' $ffconfpetsc` if test -n "$ff_BLASLAPACK_LIB"; then ff_blaslapack_ok=yes; if test -z "$ff_where_lib_conf_blaslapack" ; then echo "blaslapack LD $ff_BLASLAPACK_LIB" >>$ff_where_lib_conf test -n "$ff_BLASLAPACK_INCLUDE" && echo "blaslapack INCLUDE $ff_BLASLAPACK_INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_blaslapack=1 ff_where_lib_blaslapack="$ff_BLASLAPACK_LIB" ff_where_inc_blaslapack="$ff_BLASLAPACK_INCLUDE" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add blaslapack : $ff_BLASLAPACK_LIB $ff_BLASLAPACK_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add blaslapack : $ff_BLASLAPACK_LIB $ff_BLASLAPACK_INCLUDE in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add blaslapack : $ff_BLASLAPACK_LIB $ff_BLASLAPACK_INCLUDE in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add blaslapack : $ff_BLASLAPACK_LIB $ff_BLASLAPACK_INCLUDE in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_blaslapack="" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: \" Warning PETSC MPI and FF++ MPI not the same: $PETSC_MPIRUN != $MPIRUN or $PETSC_SCALAR != real .\" " >&5 $as_echo "$as_me: \" Warning PETSC MPI and FF++ MPI not the same: $PETSC_MPIRUN != $MPIRUN or $PETSC_SCALAR != real .\" " >&6;}; fi fi else # test "$ff_petsc_ok" = no && echo " *** try $ffconfpetsc" ffconfpetsc=""; fi done done fi if test "$ff_petsc_ok" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: with petsc $ff_petsc_ok" >&5 $as_echo "$as_me: with petsc $ff_petsc_ok" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: without petsc ***** " >&5 $as_echo "$as_me: without petsc ***** " >&6;} fi ## PETSc complex # Check whether --with-petsc_complex was given. if test "${with_petsc_complex+set}" = set; then : withval=$with_petsc_complex; fi ff_petsccomplex_ok=no if test "$with_petsc_complex" != no -a $ff_mpi = yes; then for d in "$with_petsc_complex" "${prefix}/ff-petsc/complex/lib" /usr/local/ff++/petsc-complex/lib ;do for dd in "" "/petsc/conf/petscvariables" "/lib/petsc-conf/petscvariables" ; do ffconfpetscc="$d$dd" if test -f "$ffconfpetscc" -a "$ff_petsccomplex_ok" = no ; then PETSC_COMPLEX_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetscc"` PETSC_COMPLEX_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetscc"` { $as_echo "$as_me:${as_lineno-$LINENO}: find complex ($PETSC_COMPLEX_SCALAR) petsc in $ffconfpetsc" >&5 $as_echo "$as_me: find complex ($PETSC_COMPLEX_SCALAR) petsc in $ffconfpetsc" >&6;}; test "$PETSC_COMPLEX_SCALAR" = "complex" && test "$PETSC_COMPLEX_MPIRUN" = "$MPIRUN" || cmp -s `which "$PETSC_COMPLEX_MPIRUN"` `which "$MPIRUN"` if test "$?" -eq 0 ; then ff_PETSC_WITH_EXTERNAL_LIB=`awk -F'=' '"PETSC_WITH_EXTERNAL_LIB "==$1 {print $2}' $ffconfpetscc` ff_PETSC_CC_INCLUDES=`awk -F'=' '"PETSC_CC_INCLUDES "==$1 {print $2}' $ffconfpetscc` if test -n "$ff_PETSC_WITH_EXTERNAL_LIB"; then ff_petsccomplex_ok=yes; if test -z "$ff_where_lib_conf_petsccomplex" ; then echo "petsccomplex LD $ff_PETSC_WITH_EXTERNAL_LIB" >>$ff_where_lib_conf test -n "$ff_PETSC_CC_INCLUDES" && echo "petsccomplex INCLUDE $ff_PETSC_CC_INCLUDES " >>$ff_where_lib_conf ff_where_lib_conf_petsccomplex=1 ff_where_lib_petsccomplex="$ff_PETSC_WITH_EXTERNAL_LIB" ff_where_inc_petsccomplex="$ff_PETSC_CC_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add petsccomplex : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add petsccomplex : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add petsccomplex : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add petsccomplex : $ff_PETSC_WITH_EXTERNAL_LIB $ff_PETSC_CC_INCLUDES in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_petsccomplex="" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: \" Warning PETSC complex MPI and FF++ MPI not the same: $PETSC_COMPLEX_MPIRUN != $MPIRUN or $PETSC_COMPLEX_SCALAR != complex .\" " >&5 $as_echo "$as_me: \" Warning PETSC complex MPI and FF++ MPI not the same: $PETSC_COMPLEX_MPIRUN != $MPIRUN or $PETSC_COMPLEX_SCALAR != complex .\" " >&6;}; fi fi done done fi if test "$ff_petsccomplex_ok" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: with petsc complex $ff_petsccomplex_ok" >&5 $as_echo "$as_me: with petsc complex $ff_petsccomplex_ok" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: without petsc complex ***** " >&5 $as_echo "$as_me: without petsc complex ***** " >&6;} fi ## slepc ### end petsc .... if test "$ff_where_lib_conf_fftw3_mpi" = 1 ; then ff_where_fftw3=`echo $ff_where_lib_fftw3_mpi| sed -e 's/-lfftw3_mpi//g'` if test -z "$ff_where_lib_conf_fftw3" ; then echo "fftw3 LD $ff_where_fftw3" >>$ff_where_lib_conf test -n "$ff_where_inc_fftw3_mpi" && echo "fftw3 INCLUDE $ff_where_inc_fftw3_mpi " >>$ff_where_lib_conf ff_where_lib_conf_fftw3=1 ff_where_lib_fftw3="$ff_where_fftw3" ff_where_inc_fftw3="$ff_where_inc_fftw3_mpi" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add fftw3 : $ff_where_fftw3 $ff_where_inc_fftw3_mpi in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add fftw3 : $ff_where_fftw3 $ff_where_inc_fftw3_mpi in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add fftw3 : $ff_where_fftw3 $ff_where_inc_fftw3_mpi in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add fftw3 : $ff_where_fftw3 $ff_where_inc_fftw3_mpi in $ff_where_lib_conf \"" >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: fftw3 from petsc ***** " >&5 $as_echo "$as_me: fftw3 from petsc ***** " >&6;} fi #replacing wget with another command ff_wget_command="wget --no-check-certificate" ff_wget=no # Check whether --with-wget was given. if test "${with_wget+set}" = set; then : withval=$with_wget; enable_download=yes ff_wget=yes ff_wget_command="${withval}" fi ff_MKL_libpath=yes # Check whether --with-mkl was given. if test "${with_mkl+set}" = set; then : withval=$with_mkl; ff_mkl_libpath="${withval}" fi # if enabling downloads find wget or curl to do download # ------------------------------------------------------ if test "$ff_wget" = no then ff_wget="" # Extract the first word of "wget --no-check-certificate", so it can be a program name with args. set dummy wget --no-check-certificate; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_wget+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_wget"; then ac_cv_prog_ff_wget="$ff_wget" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_wget="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_wget" && ac_cv_prog_ff_wget="no" fi fi ff_wget=$ac_cv_prog_ff_wget if test -n "$ff_wget"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_wget" >&5 $as_echo "$ff_wget" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "$ff_wget" = no then ff_wget_command="curl --fail -O " ff_curl="" # Extract the first word of "curl -O", so it can be a program name with args. set dummy curl -O; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_curl+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_curl"; then ac_cv_prog_ff_curl="$ff_curl" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_curl="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_curl" && ac_cv_prog_ff_curl="no" fi fi ff_curl=$ac_cv_prog_ff_curl if test -n "$ff_curl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_curl" >&5 $as_echo "$ff_curl" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ff_wget="$ff_curl" fi # for automatique compilation of # lib in download if test "$ff_wget" != yes -a "$enable_download" = "yes" ; then enable_download=no as_fn_error 1 " enable-download and no wget or curl. " "$LINENO" 5; fi if test "$enable_download" = "yes" ; then DOWNLOADCOMPILE="compile-pkg install-other" else DOWNLOADCOMPILE= fi WGET=$ff_wget_command DOWNLOADCOMPILE=$DOWNLOADCOMPILE # modif FH ----- # -- looking for cadna # the round-off error propagation # the web site http://www-anp.lip6.fr/cadna/ # -------------------- # Check whether --with-cadna was given. if test "${with_cadna+set}" = set; then : withval=$with_cadna; fi if test "$with_cadna" != no -o -n "$with_cadna" then ff_cadna="$with_cadna" fi ff_cadna_ok=no if test "$with_cadna" != no then ff_libs_old="$LIBS" ff_ldflags_old="$LDFLAGS" ff_cadna_dir="${curdir}/download/cadna" LDFLAGS="$LDFLAGS -L$ff_cadna_dir" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arit_zero in -lcadnafree" >&5 $as_echo_n "checking for arit_zero in -lcadnafree... " >&6; } if ${ac_cv_lib_cadnafree_arit_zero+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcadnafree $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 arit_zero (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return arit_zero (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_cadnafree_arit_zero=yes else ac_cv_lib_cadnafree_arit_zero=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cadnafree_arit_zero" >&5 $as_echo "$ac_cv_lib_cadnafree_arit_zero" >&6; } if test "x$ac_cv_lib_cadnafree_arit_zero" = xyes; then : ff_cadna_ok=yes fi for ac_header in ${ff_cadna_dir}/cadnafree.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF ff_cadna_h=yes else ff_cadna_h=no fi done LIBS="$ff_libs_old" LDFLAGS="$ff_ldflags_old" if test "$ff_cadna_ok" = yes -a "$ff_cadna_h" = yes then $as_echo "#define HAVE_CADNA 1" >>confdefs.h CPPFLAGS="$CPPFLAGS -I$ff_cadna_dir" LIBS=" -L$ff_cadna_dir -lcadnafree $ff_libs_old" else { $as_echo "$as_me:${as_lineno-$LINENO}: without cadna ***** " >&5 $as_echo "$as_me: without cadna ***** " >&6;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: without cadna ***** " >&5 $as_echo "$as_me: without cadna ***** " >&6;} fi # Looking for FFTW # ---------------- # ALH - 18/9/13 - deactivates FFTW detection for testing purposes # Check whether --enable-system_fftw was given. if test "${enable_system_fftw+set}" = set; then : enableval=$enable_system_fftw; fi if test "$enable_system_fftw" != no then # ALH - 4/9/13 - avoid recompiling FFTW if a copy was found on the system (request from Helmut Jarausch, 1/8/13) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5 $as_echo_n "checking for fftw_execute in -lfftw3... " >&6; } if ${ac_cv_lib_fftw3_fftw_execute+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw3 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 fftw_execute (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return fftw_execute (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_fftw3_fftw_execute=yes else ac_cv_lib_fftw3_fftw_execute=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5 $as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; } if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes; then : ff_fftw_ok=yes fi for ac_header in fftw3.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" if test "x$ac_cv_header_fftw3_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FFTW3_H 1 _ACEOF ff_fftw_h=yes else ff_fftw_h=no fi done fi if test "$ff_fftw_ok" = yes -a "$ff_fftw_h" = yes then if test -z "$ff_where_lib_conf_fftw3" ; then echo "fftw3 LD -lfftw3" >>$ff_where_lib_conf test -n "" && echo "fftw3 INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_fftw3=1 ff_where_lib_fftw3="-lfftw3" ff_where_inc_fftw3="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add fftw3 : -lfftw3 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add fftw3 : -lfftw3 in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add fftw3 : -lfftw3 in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add fftw3 : -lfftw3 in $ff_where_lib_conf \"" >&6;} fi fftw_download= else if test "$enable_download" = yes then ff_DOWNLOAD_FFTW=fftw fi fi # used in [[file:download/fftw/Makefile.am::DOWNLOAD_FFTW]] DOWNLOAD_FFTW=$ff_DOWNLOAD_FFTW # Looking for the BLAS # -------------------- ff_blas_ok=no ff_blas_inc="" # ALH - 18/9/13 - give the option to deactivate system blas for testing purposes # Check whether --enable-system-blas was given. if test "${enable_system_blas+set}" = set; then : enableval=$enable_system_blas; fi if test "$ff_where_lib_conf_blaslapack" = 1 ; then echo " use BLAS/Lapack of petsc " # echo " lib: $ff_where_lib_blaslapack inc: $ff_where_inc_blaslapack" ff_blas_ok=yes ff_lapack_ok=yes ff_blas_libs="$ff_where_lib_blaslapack" ff_lapack_lib= ff_blas_inc="$ff_where_inc_blaslapack" if test -z "$ff_where_lib_conf_lapack" ; then echo "lapack LD $ff_mkl_lapack" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "lapack INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_lapack=1 ff_where_lib_lapack="$ff_mkl_lapack" ff_where_inc_lapack="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_blas" ; then echo "blas LD $ff_blas_libs" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "blas INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_blas=1 ff_where_lib_blas="$ff_blas_libs" ff_where_inc_blas="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add blas : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add blas : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add blas : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add blas : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: BLAS and LAPACK from petsc ***** " >&5 $as_echo "$as_me: BLAS and LAPACK from petsc ***** " >&6;} if echo "$ff_where_lib_blaslapack"| grep -q " -lmkl" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: MKL from petsc ***** " >&5 $as_echo "$as_me: MKL from petsc ***** " >&6;} if test -z "$ff_where_lib_conf_mkl" ; then echo "mkl LD $ff_blas_libs" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "mkl INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_mkl=1 ff_where_lib_mkl="$ff_blas_libs" ff_where_inc_mkl="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mkl : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mkl : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mkl : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mkl : $ff_blas_libs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi $as_echo "#define HAVE_MKL 1" >>confdefs.h $as_echo "#define HAVE_BLAS 1" >>confdefs.h fi fi if test "$enable_system_blas" != no -a "$ff_blas_ok" = no then # User-specified location # add MKL seach dec 2010 FH .... ff_mkl_flags="" if test "$ff_mkl_libpath" != "not" ; then ff_CFLAGS="$CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -mkl" >&5 $as_echo_n "checking whether the C compiler accepts -mkl... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -mkl" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$ff_CFLAGS" != "$CFLAGS" ; then ff_ff_mkl_flags="-mkl" fi CFLAGS="$ff_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MKL" >&5 $as_echo_n "checking for MKL... " >&6; } ff_mkl_root="" if test "$ff_mkl_libpath" != "not" -a -z "$ff_mkl_flags" ; then if test "$ff_mkl_libpath" = "yes" ; then ff_IFS="$IFS" IFS=":" for i in $LD_LIBRARY_PATH:$LIBRARY_PATH ; do case $i in */mkl/*) ff_mkl_libpath=$i;; esac ; done; IFS="$ff_IFS" # else # ff_mkl_libpath=no fi if test "$ff_mkl_libpath" != "no" -a -d "$ff_mkl_libpath" ; then ff_mkl_root=`expr "//$ff_mkl_libpath" : '//\(.*\)/lib.*'` ff_mkl_arch=`expr "//$ff_mkl_libpath" : '//.*/lib/\(.*\)'` ff_mkl_lp=_lp64 case "$ff_mkl_arch" in *64*) ff_mkl_lp=_lp64 esac case $F77 in *ifort*) ff_mkl_cc=intel;; *) ff_mkl_cc=gf;; esac # bof bof .... case "$MPIRUN" in */sgi/*) ff_mkl_mpi=_sgimpt;; */intel/*) ff_mkl_mpi=_intelmpi;; *) ff_mkl_mpi=_openmpi;; esac # echo ................ ff_mkl_root = $ff_mkl_root .. $ff_mkl_arch if test ! -d "$ff_mkl_libpath" ; then ff_mkl_libpath="$ff_mkl_root/lib/$ff_mkl_arch" fi if test -f "$ff_mkl_libpath/libmkl_rt.$ff_suffix_dylib" ; then mkl_blas=rt mkl_lapack=rt ff_mkl_mlt="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_rt -lmkl_intel_thread -lmkl_core $ff_iomp5 $ff_pthread" ff_mkl_blas="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_rt -lmkl_sequential -lmkl_core $ff_iomp5 $ff_pthread" ff_mkl_lapack="$ff_mkl_blas" elif test -f "$ff_mkl_libpath/libmkl_lapack.$ff_suffix_dylib" ; then ff_mkl_mlt="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lguide -lm -lpthread" ff_mkl_blas="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lguide -lm -lpthread" ff_mkl_lapack="-Wl,-rpath,$ff_mkl_root/lib/$ff_mkl_arch -L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_lapack" else ff_mkl_mlt="$ff_ldbg -Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lmkl_intel_thread $ff_iomp5 $ff_ldeg -lm $ff_pthread" ff_mkl_blas="$ff_ldbg -Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lmkl_sequential $ff_ldeg -lm $ff_pthread" ff_mkl_lapack="$ff_mkl_blas" fi if test -f "-L$ff_mkl_libpathmkl_scalapack${ff_mkl_lp}" ; then ff_mkl_scalapack="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp} " ff_mkl_blacs="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp}" fi ff_blas_ok=yes ff_lapack_ok=yes # <> ALH - 6/11/13 - request from Atsushi Suzuki - the default MKL library must be able to # handle threads when FF is connected to AS' solver. So we need an option to configure FF with the # multithreaded MKL by default. # Check whether --enable-mkl_mlt was given. if test "${enable_mkl_mlt+set}" = set; then : enableval=$enable_mkl_mlt; fi if test "$enable_mkl_mlt" = yes then ff_blas_libs="$ff_mkl_mlt" else ff_blas_libs="$ff_mkl_blas" fi ff_blas_inc="-I$ff_mkl_root/include" if test "$ff_mkl_mpi" = "_intelmpi" ; then if test -z "$ff_where_lib_conf_scalapack" ; then echo "scalapack LD $ff_mkl_scalapack" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "scalapack INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_scalapack=1 ff_where_lib_scalapack="$ff_mkl_scalapack" ff_where_inc_scalapack="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add scalapack : $ff_mkl_scalapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add scalapack : $ff_mkl_scalapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add scalapack : $ff_mkl_scalapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add scalapack : $ff_mkl_scalapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_blacs" ; then echo "blacs LD $ff_mkl_blacs" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "blacs INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_blacs=1 ff_where_lib_blacs="$ff_mkl_blacs" ff_where_inc_blacs="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add blacs : $ff_mkl_blacs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add blacs : $ff_mkl_blacs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add blacs : $ff_mkl_blacs $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add blacs : $ff_mkl_blacs $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi else ff_warm=" (We do not use MKL scalapack and blacs with sgi MPI), " fi if test -z "$ff_where_lib_conf_lapack" ; then echo "lapack LD $ff_mkl_lapack" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "lapack INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_lapack=1 ff_where_lib_lapack="$ff_mkl_lapack" ff_where_inc_lapack="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add lapack : $ff_mkl_lapack $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_mkl" ; then echo "mkl LD $ff_mkl_mlt" >>$ff_where_lib_conf test -n "$ff_blas_inc" && echo "mkl INCLUDE $ff_blas_inc " >>$ff_where_lib_conf ff_where_lib_conf_mkl=1 ff_where_lib_mkl="$ff_mkl_mlt" ff_where_inc_mkl="$ff_blas_inc" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mkl : $ff_mkl_mlt $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mkl : $ff_mkl_mlt $ff_blas_inc in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mkl : $ff_mkl_mlt $ff_blas_inc in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mkl : $ff_mkl_mlt $ff_blas_inc in $ff_where_lib_conf \"" >&6;} fi $as_echo "#define HAVE_MKL 1" >>confdefs.h $as_echo "#define HAVE_BLAS 1" >>confdefs.h else ff_mkl_libpath=no # FH - pardiso is there as soon as mkl is enable_pardiso=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_warm root: $ff_mkl_root , arch: $ff_mkl_arch , $ff_mkl_lp ... " >&5 $as_echo " $ff_warm root: $ff_mkl_root , arch: $ff_mkl_arch , $ff_mkl_lp ... " >&6; } # Check whether --with-blas was given. if test "${with_blas+set}" = set; then : withval=$with_blas; ff_blas_ok=yes ff_blas_libs="${withval}" fi # Specific BLAS library location for FreeBSD ff_freebsd_blas="-lf2c -lf77blas -latlas -lgslcblas" ff_dll_blas=`which libopenblas.dll` if -z "$ff_dll_blas" ; then ff_dll_blas="no"; fi # zmach is in lapack # Trying blas library # echo "LIBS = $LIBS blas --- $ff_blas_ok" for iblas in "$ff_dll_blas" \ "-framework Accelerate" "$ff_mkl_blas" "-lblas" "-L/usr/lib/atlas -lblas" \ $ff_freebsd_blas do if test "$ff_blas_ok" = no -a "$iblas" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daxpy_ in $iblas" >&5 $as_echo_n "checking for daxpy_ in $iblas... " >&6; } ff_save_libs="$LIBS" LIBS="$LIBS $iblas" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 daxpy_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return daxpy_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_blas_ok=yes ff_blas_libs="$iblas" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ff_save_libs" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_blas_ok" >&5 $as_echo "$ff_blas_ok" >&6; } fi done #cblas_zdotu_sub #echo "LIBS = " $LIBS ff_cblas_libs=no if test "$ff_blas_ok" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blas_zdotu_sub in $ff_blas_libs" >&5 $as_echo_n "checking for blas_zdotu_sub in $ff_blas_libs... " >&6; } ff_save_libs="$LIBS" LIBS="$LIBS $ff_blas_libs $FLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 cblas_zdotu_sub (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return cblas_zdotu_sub (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_cblas_libs=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_cblas_libs" >&5 $as_echo "$ff_cblas_libs" >&6; } LIBS="$ff_save_libs" fi fi # <> ALH - 18/9/13 - option to compile the OpenBLAS moved from the FFCS tree to FF tree # Check whether --enable-openblas was given. if test "${enable_openblas+set}" = set; then : enableval=$enable_openblas; fi if test "$ff_blas_ok" = no && test "$enable_openblas" != no && test "$enable_download" = yes then # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_git+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_git"; then ac_cv_prog_ff_git="$ff_git" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_git="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_git" && ac_cv_prog_ff_git="no" fi fi ff_git=$ac_cv_prog_ff_git if test -n "$ff_git"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_git" >&5 $as_echo "$ff_git" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Activating the OpenBLAS (deactivate with --disable-openblas)" >&5 $as_echo_n "checking Activating the OpenBLAS (deactivate with --disable-openblas)... " >&6; } if test $ff_git = no then { $as_echo "$as_me:${as_lineno-$LINENO}: result: git not found" >&5 $as_echo "git not found" >&6; } else ff_download_blas=openblas # it is necessary to split the library path into -L and -l otherwise ff/upstream/examples+++-load/ff-c++ will place -lgfortran in # LIBS, .../libgoto___.lib in OTHER, and call the compiler with $LIBS before $OTHER, which will fail. But libopenblas.a is placed in # the standard directory download/lib so the -L option is not required anymore. ff_blas_libs="-L${curdir}/download/lib -lopenblas $LIBS $ff_pthread" ff_blas_inc="-I${curdir}/download/include" # skip generic blas compilation and activate OpenBLAS (see [[file:download/blas/Makefile.am::OpenBLAS]]) DOWNLOADED_BLAS="" COMPILE_OPENBLAS=openblas ff_blas_ok=yes ff_cblas_h=yes ff_cblas_libs=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi fi # If all else fails, download a generic version if test "$ff_blas_ok" = no -a "$enable_download" = yes -a "$enable_fortran" != no -a "$enable_c" != no then # Extract the first word of "unzip", so it can be a program name with args. set dummy unzip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_unzip+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_unzip"; then ac_cv_prog_ff_unzip="$ff_unzip" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_unzip="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_unzip" && ac_cv_prog_ff_unzip="no" fi fi ff_unzip=$ac_cv_prog_ff_unzip if test -n "$ff_unzip"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_unzip" >&5 $as_echo "$ff_unzip" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLAS version to download" >&5 $as_echo_n "checking for BLAS version to download... " >&6; } # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make # the following tests fail. # When compiling a generic version, we do not need an optimized version of the BLAS. ff_download_blas=generic ff_blas_libs="-L${curdir}/download/blas -lcblas -lf77blas" ff_blas_inc="-I${curdir}/download/blas/CBLAS/src" DOWNLOADED_BLAS="libf77blas.a libcblas.a" DOWNLOADED_BLAS_BUILT_SOURCES='BLAS CBLAS $(F77BLAS_SOURCES) $(CBLAS_SOURCES)' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_download_blas" >&5 $as_echo "$ff_download_blas" >&6; } ff_blas_ok=yes ff_cblas_h=yes ff_cblas_libs=yes fi BLASLIBS=$ff_blas_libs BLASINC=$ff_blas_inc #looking for cblas.h FH if test "$ff_blas_ok" = yes -a "$ff_cblas_libs" = yes -a -z "$ff_download_blas" ; then for ac_header in cblas.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "cblas.h" "ac_cv_header_cblas_h" "$ac_includes_default" if test "x$ac_cv_header_cblas_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CBLAS_H 1 _ACEOF ff_cblas_h=yes else ff_cblas_h=no fi done for ac_header in Accelerate/cblas.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "Accelerate/cblas.h" "ac_cv_header_Accelerate_cblas_h" "$ac_includes_default" if test "x$ac_cv_header_Accelerate_cblas_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ACCELERATE_CBLAS_H 1 _ACEOF ff_cblas_h=yes ff_cblas_h=no fi done for ac_header in atlas/cblas.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "atlas/cblas.h" "ac_cv_header_atlas_cblas_h" "$ac_includes_default" if test "x$ac_cv_header_atlas_cblas_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ATLAS_CBLAS_H 1 _ACEOF ff_cblas_h=yes ff_cblas_h=no fi done fi # ALH - 18/9/13 - [[file:download/blas/Makefile.am]] does not update the WHERE mechanism so it always needs to be set up # here even in the case of a downloaded blas library. if test -z "$ff_where_lib_conf_blas" ; then echo "blas LD $ff_blas_libs" >>$ff_where_lib_conf test -n "" && echo "blas INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_blas=1 ff_where_lib_blas="$ff_blas_libs" ff_where_inc_blas="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add blas : $ff_blas_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add blas : $ff_blas_libs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add blas : $ff_blas_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add blas : $ff_blas_libs in $ff_where_lib_conf \"" >&6;} fi # end of BLAS ------------------- # Looking for ARPACK # ------------------ # We need the following g77 libraries to connect to the Fortran 77 # Arpack. if test "$ff_blas_ok" = yes; then ff_g2c_lib="$FLIBS" if test -n "$ff_g2c_lib" then LIBS="$LIBS $ff_g2c_lib" else ff_g2c_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G77_second_0 in -lg2c" >&5 $as_echo_n "checking for G77_second_0 in -lg2c... " >&6; } if ${ac_cv_lib_g2c_G77_second_0+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lg2c $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 G77_second_0 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return G77_second_0 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_g2c_G77_second_0=yes else ac_cv_lib_g2c_G77_second_0=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_g2c_G77_second_0" >&5 $as_echo "$ac_cv_lib_g2c_G77_second_0" >&6; } if test "x$ac_cv_lib_g2c_G77_second_0" = xyes; then : LIBS="$LIBS -lg2c" ff_g2c_lib="-lg2c" ff_g2c_ok=yes fi if test "$ff_g2c_ok" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for G77_second_0 in /sw/lib/libg2c.a" >&5 $as_echo_n "checking for G77_second_0 in /sw/lib/libg2c.a... " >&6; } ff_save_libs="$LIBS" LIBS="$LIBS -L/sw/lib -lg2c" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 G77_second_0 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return G77_second_0 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_g2c_lib="-L/sw/lib -lg2c" ff_g2c_ok=yes else LIBS="$ff_save_libs" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_g2c_ok" >&5 $as_echo "$ff_g2c_ok" >&6; } fi fi fi # Copy the result of g2c investigations into a separate variable # because BLAS compilation will need it. G2CLIB=$ff_g2c_lib #looking of lapack if no compile the arpack lapack # warning $$ because the make eat one ff_lapack_ok=no; ff_lapack_lib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lapack in $LIBS, $ff_blas_libs and -llapack " >&5 $as_echo_n "checking for lapack in $LIBS, $ff_blas_libs and -llapack ... " >&6; } if test "$ff_blas_ok" = yes ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dgeqr2_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dgeqr2_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_lapack_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_lapack_ok" = no ; then ff_save_libs=$LIBS LIBS="$ff_save_libs $ff_blas_libs" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dgeqr2_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dgeqr2_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_lapack_ok=yes;ff_lapack_lib="$ff_blas_libs" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_lapack_ok" = no ; then LIBS="$ff_save_libs -llapack $ff_blas_libs" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dgeqr2_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dgeqr2_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_lapack_ok=yes ff_lapack_lib="-llapack" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi LIBS="$ff_save_libs" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_lapack_ok" >&5 $as_echo "$ff_lapack_ok" >&6; } if test "$ff_lapack_ok" != no ; then LAPACKLIBS=$ff_lapack_lib fi if test "$ff_lapack_ok" = no; then # Check whether --with-lapack was given. if test "${with_lapack+set}" = set; then : withval=$with_lapack; ff_lapack_ok=yes ff_lapack_lib="${withval}" LIBS="$ff_lapack_lib $LIBS" fi fi # Lapack configuration for Arpack ff_lapackdir='$$(LAPACKdir)' if test "$ff_lapack_ok" = yes then # no compilation of lapack in arpack ff_lapackdir= else ff_lapack_lib="-L${curdir}/download/lib -llapack" fi # Arpack itself ff_arpack_ok=no ff_save_libs="$LIBS" ff_arpack_libs= if test "$ff_blas_ok" = yes; then # User-specified location # Check whether --with-arpack was given. if test "${with_arpack+set}" = set; then : withval=$with_arpack; ff_arpack_ok=yes ff_arpack_libs="${withval}" fi # Default locations if test "$ff_arpack_ok" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dsaupd_ in -larpack" >&5 $as_echo_n "checking for dsaupd_ in -larpack... " >&6; } if ${ac_cv_lib_arpack_dsaupd_+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-larpack -llapack $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dsaupd_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dsaupd_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_arpack_dsaupd_=yes else ac_cv_lib_arpack_dsaupd_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_arpack_dsaupd_" >&5 $as_echo "$ac_cv_lib_arpack_dsaupd_" >&6; } if test "x$ac_cv_lib_arpack_dsaupd_" = xyes; then : ff_arpack_libs="-larpack -llapack" ff_arpack_ok=yes fi fi # Trying to "locate" Arpack if test "$ff_arpack_ok" = no -a "$enable_download" != yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libarpack with locate" >&5 $as_echo_n "checking for libarpack with locate... " >&6; } ff_lib_arpack=`locate libarpack|grep 'libarpack.*.a$'|head -1` LIBS="$ff_lib_arpack $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dsaupd_ (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dsaupd_ (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_arpack_ok=yes ff_arpack_libs="$ff_lib_arpack" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_arpack_ok" >&5 $as_echo "$ff_arpack_ok" >&6; } fi if test "$ff_arpack_ok" = yes then if test -z "$ff_where_lib_conf_arpack" ; then echo "arpack LD $ff_arpack_libs" >>$ff_where_lib_conf test -n "" && echo "arpack INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_arpack=1 ff_where_lib_arpack="$ff_arpack_libs" ff_where_inc_arpack="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add arpack : $ff_arpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add arpack : $ff_arpack_libs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add arpack : $ff_arpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add arpack : $ff_arpack_libs in $ff_where_lib_conf \"" >&6;} fi echo arpack LD "'$ff_arpack_libs'" >>$ff_where_lib_conf fi # If all else fails, download! if test "$ff_arpack_ok" = no -a "$enable_download" = yes \ -a "$enable_fortran" != no then ff_arpack_download=yes { $as_echo "$as_me:${as_lineno-$LINENO}: using downloaded Arpack" >&5 $as_echo "$as_me: using downloaded Arpack" >&6;} # ALH - 6/11/13 - this install goal is the standard goal for all downloaded packages in # [[file:download/common.mak::install]] DOWNLOAD_ARPACK=install FF_LAPACKdir=$ff_lapackdir ARPACKLIB=${curdir}/download/lib/libarpack.a LAPACK_arpack_LIB=${curdir}/download/lib/liblapack.a # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this # could make the following tests fail. # ALH - 30/9/13 - do not use the "-L ${curdir}/download/lib" directive because it would allow other # following -l directives (eg -lumfpack) to pick an old locally compiled library instead of the system # ones. ff_arpack_libs="${curdir}/download/lib/libarpack.a $ff_lapack_lib" ff_arpack_ok=yes fi fi if test "$ff_arpack_ok" != yes then { $as_echo "$as_me:${as_lineno-$LINENO}: -- NO ARPACK -- enable_download : $enable_download , wget: $ff_wget " >&5 $as_echo "$as_me: -- NO ARPACK -- enable_download : $enable_download , wget: $ff_wget " >&6;} fi # Do not insert ARPACK libs in $LIBS yet, because they may not exist # yet, and this could make the following tests fail. LIBS="$ff_save_libs" if test "$ff_arpack_ok" = yes; then ARPACKLIBS=$ff_arpack_libs EIGENOBJ='eigenvalue.$(OBJEXT)' $as_echo "#define HAVE_LIBARPACK 1" >>confdefs.h # Determines whether to run the eigenvalue tests else # all eigen test fails SKIP_TESTS_EIGEN=yes fi # ALH - 25/9/13 - <> always run the WHERE LD statement for lapack because some libraries in # examples++-load require it (eg [[file:examples++-load/Element_Mixte.cpp::lapack]]). Request from Fred. if test -z "$ff_where_lib_conf_lapack" ; then echo "lapack LD $ff_lapack_lib" >>$ff_where_lib_conf test -n "" && echo "lapack INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_lapack=1 ff_where_lib_lapack="$ff_lapack_lib" ff_where_inc_lapack="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add lapack : $ff_lapack_lib in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add lapack : $ff_lapack_lib in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add lapack : $ff_lapack_lib in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add lapack : $ff_lapack_lib in $ff_where_lib_conf \"" >&6;} fi # Looking for UMFPACK # ------------------- ff_umfpack_incs="" ff_amd_ok=no ff_umfpack_ok=no # echo @@@@@@@@@ ff_where_lib_conf_suitesparse == $ff_where_lib_conf_suitesparse @@@@ if test "$ff_where_lib_conf_suitesparse" = "1" ; then echo "amd/umfpack/suitesparse of petsc" echo " lib: $ff_where_lib_suitesparse inc: $ff_where_inc_suitesparse" ff_amd_ok=yes ff_umfpack_ok=yes enable_system_umfpack=no ff_umfpack_libs="$ff_where_lib_suitesparse" ff_umfpack_incs="$ff_where_inc_suitesparse" $as_echo "#define HAVE_LIBUMFPACK 1" >>confdefs.h $as_echo "#define HAVE_LIBCHOLMOD 1" >>confdefs.h UMFPACK_CPPFLAGS=$ff_where_inc_suitesparse $as_echo "#define HAVE_UMFPACK_H 1" >>confdefs.h fi ff_save_libs="$LIBS" # Check whether --enable-system_umfpack was given. if test "${enable_system_umfpack+set}" = set; then : enableval=$enable_system_umfpack; fi if test "$ff_umfpack_ok" = no -a "$enable_system_umfpack" != no -a "$ff_blas_ok" = yes; then # User-specified location # Check whether --with-amd was given. if test "${with_amd+set}" = set; then : withval=$with_amd; ff_amd_ok=yes ff_umfpack_libs="${withval}" fi # Check whether --with-umfpack was given. if test "${with_umfpack+set}" = set; then : withval=$with_umfpack; ff_umfpack_ok=yes ff_umfpack_libs="${withval} $ff_umfpack_libs" fi if test "${with_umfpack_include+set}" = set; then CPPFLAGS="$CPPFLAGS $with_umfpack_include" fi for ac_header in umfpack.h umfpack/umfpack.h ufsparse/umfpack.h suitesparse/umfpack.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF ff_umfpack_header=yes ff_umfpack_dir=`dirname $ac_header` break fi done # Somes systems like FreeBSD hide umfpack.h in a directory called UMFPACK (all capitals). This breaks the # standard #define produced by autoconf in config.h.in. LIBS="$ff_blas_libs $LIBS" if test "$ff_umfpack_header" != yes; then ac_fn_cxx_check_header_mongrel "$LINENO" "UMFPACK/umfpack.h" "ac_cv_header_UMFPACK_umfpack_h" "$ac_includes_default" if test "x$ac_cv_header_UMFPACK_umfpack_h" = xyes; then : ff_umfpack_header=yes ff_umfpack_dir=UMFPACK $as_echo "#define HAVE_BIG_UMFPACK_UMFPACK_H 1" >>confdefs.h fi fi if test "$ff_amd_ok" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for amd_info in -lamd" >&5 $as_echo_n "checking for amd_info in -lamd... " >&6; } if ${ac_cv_lib_amd_amd_info+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lamd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 amd_info (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return amd_info (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_amd_amd_info=yes else ac_cv_lib_amd_amd_info=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_amd_amd_info" >&5 $as_echo "$ac_cv_lib_amd_amd_info" >&6; } if test "x$ac_cv_lib_amd_amd_info" = xyes; then : ff_umfpack_libs="$ff_umfpack_libs -lamd" ff_amd_ok=yes fi fi if test "$ff_umfpack_ok" = no -a "$ff_amd_ok" = yes; then # ALH - 30/9/13 - other libraries required by Umfpack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cholmod_add in -lcholmod" >&5 $as_echo_n "checking for cholmod_add in -lcholmod... " >&6; } if ${ac_cv_lib_cholmod_cholmod_add+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcholmod $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 cholmod_add (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return cholmod_add (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_cholmod_cholmod_add=yes else ac_cv_lib_cholmod_cholmod_add=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cholmod_cholmod_add" >&5 $as_echo "$ac_cv_lib_cholmod_cholmod_add" >&6; } if test "x$ac_cv_lib_cholmod_cholmod_add" = xyes; then : ff_umfpack_libs="$ff_umfpack_libs -lcholmod" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for colamd_set_defaults in -lcolamd" >&5 $as_echo_n "checking for colamd_set_defaults in -lcolamd... " >&6; } if ${ac_cv_lib_colamd_colamd_set_defaults+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcolamd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 colamd_set_defaults (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return colamd_set_defaults (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_colamd_colamd_set_defaults=yes else ac_cv_lib_colamd_colamd_set_defaults=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_colamd_colamd_set_defaults" >&5 $as_echo "$ac_cv_lib_colamd_colamd_set_defaults" >&6; } if test "x$ac_cv_lib_colamd_colamd_set_defaults" = xyes; then : ff_umfpack_libs="$ff_umfpack_libs -lcolamd" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for umf_i_malloc in -lumfpack" >&5 $as_echo_n "checking for umf_i_malloc in -lumfpack... " >&6; } if ${ac_cv_lib_umfpack_umf_i_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lumfpack $ff_umfpack_libs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 umf_i_malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return umf_i_malloc (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_umfpack_umf_i_malloc=yes else ac_cv_lib_umfpack_umf_i_malloc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_umfpack_umf_i_malloc" >&5 $as_echo "$ac_cv_lib_umfpack_umf_i_malloc" >&6; } if test "x$ac_cv_lib_umfpack_umf_i_malloc" = xyes; then : ff_umfpack_libs="-lumfpack $ff_umfpack_libs" ff_umfpack_ok=yes fi fi if test "$ff_umfpack_header" != yes -o "$ff_umfpack_ok" != yes; then ff_umfpack_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sorry, we could not find the UMFPACK lib or the UMFPACK headers" >&5 $as_echo "$as_me: WARNING: Sorry, we could not find the UMFPACK lib or the UMFPACK headers" >&2;} fi if test "$ff_umfpack_ok" = yes -a "$ff_amd_ok" = yes; then $as_echo "#define HAVE_LIBUMFPACK 1" >>confdefs.h fi fi LIBS="$ff_save_libs" # If all else fails, download! # attention no /usr/include in WHERE if test "$ff_umfpack_ok" = yes -a -n "$ff_umfpack_dir" -a -z "$ff_umfpack_incs" then ff_umfpack_incs="-I/usr/include/$ff_umfpack_dir" fi if test "$ff_umfpack_ok" = no -a "$enable_download" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: using downloaded UMFPACK" >&5 $as_echo "$as_me: using downloaded UMFPACK" >&6;} DOWNLOAD_UMFPACK="umfpack" ff_umfpack_download=yes # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make # the following tests fail. ff_umfpack_libs="-L${curdir}/download/lib -lumfpack -lcholmod -lcolamd -lamd -lsuitesparseconfig" ff_umfpack_incs="-I${curdir}/download/include" $as_echo "#define HAVE_LIBUMFPACK 1" >>confdefs.h if test "$ff_win32" = yes; then FF_UMFPACK_CONFIG=-DCBLAS fi ff_umfpack_ok=yes fi # ALH - 17/9/13 - moved UMFPACK configuration settings in wherelib to _after_ configuring the download version because # [[file:download/umfpack/Makefile.am]] does not set the WHERE mechanism. Also removed -I/usr/include/$ff_umfpack_dir # from include options for FFCS because it breaks the MingW64 compilation process. if test "$ff_umfpack_ok" = yes then if test $enable_ffcs = no then if test -z "$ff_where_lib_conf_amd" ; then echo "amd LD $ff_umfpack_libs" >>$ff_where_lib_conf test -n "$ff_umfpack_incs" && echo "amd INCLUDE $ff_umfpack_incs " >>$ff_where_lib_conf ff_where_lib_conf_amd=1 ff_where_lib_amd="$ff_umfpack_libs" ff_where_inc_amd="$ff_umfpack_incs" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add amd : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add amd : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add amd : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add amd : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_umfpack" ; then echo "umfpack LD $ff_umfpack_libs" >>$ff_where_lib_conf test -n "$ff_umfpack_incs" && echo "umfpack INCLUDE $ff_umfpack_incs " >>$ff_where_lib_conf ff_where_lib_conf_umfpack=1 ff_where_lib_umfpack="$ff_umfpack_libs" ff_where_inc_umfpack="$ff_umfpack_incs" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add umfpack : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add umfpack : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add umfpack : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add umfpack : $ff_umfpack_libs $ff_umfpack_incs in $ff_where_lib_conf \"" >&6;} fi else if test -z "$ff_where_lib_conf_amd" ; then echo "amd LD $ff_umfpack_libs" >>$ff_where_lib_conf test -n "" && echo "amd INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_amd=1 ff_where_lib_amd="$ff_umfpack_libs" ff_where_inc_amd="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add amd : $ff_umfpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add amd : $ff_umfpack_libs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add amd : $ff_umfpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add amd : $ff_umfpack_libs in $ff_where_lib_conf \"" >&6;} fi if test -z "$ff_where_lib_conf_umfpack" ; then echo "umfpack LD $ff_umfpack_libs" >>$ff_where_lib_conf test -n "" && echo "umfpack INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_umfpack=1 ff_where_lib_umfpack="$ff_umfpack_libs" ff_where_inc_umfpack="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add umfpack : $ff_umfpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add umfpack : $ff_umfpack_libs in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add umfpack : $ff_umfpack_libs in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add umfpack : $ff_umfpack_libs in $ff_where_lib_conf \"" >&6;} fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: -- NO UMFPACK (ff_wget = $ff_wget)" >&5 $as_echo "$as_me: -- NO UMFPACK (ff_wget = $ff_wget)" >&6;} fi UMFPACKLIBS=$ff_umfpack_libs # If times() and sysconf() are not here, UMFPACK should know if test "$ff_umfpack_ok" = yes then for ac_func in times sysconf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ff_umfpack_posix_ok=yes else ff_umfpack_posix_ok=no fi done if test "$ff_umfpack_posix_ok" = no then FF_UMFPACK_CONFIG="-DCBLAS -DNPOSIX" fi fi # Checking for some functions that may not appear everywhere # ---------------------------------------------------------- for ac_header in cstddef do : ac_fn_cxx_check_header_mongrel "$LINENO" "cstddef" "ac_cv_header_cstddef" "$ac_includes_default" if test "x$ac_cv_header_cstddef" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CSTDDEF 1 _ACEOF fi done for ac_header in stddef.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" if test "x$ac_cv_header_stddef_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDDEF_H 1 _ACEOF fi done for ac_header in semaphore.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" if test "x$ac_cv_header_semaphore_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SEMAPHORE_H 1 _ACEOF ff_sem=1 else ff_sem=0 fi done for ac_header in sys/mman.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mman_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_MMAN_H 1 _ACEOF ff_mmap=1 else ff_mmap=0 fi done if test "$ff_sem" -eq 1 -a "$ff_mmap" -eq 1 ; then BIN_ffmaster=ffmaster else enable_MMAP=no BIN_ffmaster= fi for ac_header in regex.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGEX_H 1 _ACEOF ff_regex_h=1 else ff_regex_h=0 fi done FF_HAVE_REGEX_H=$ff_regex_h for ac_header in unistd.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done # asinh acosh atanh are not in Mingw yet gettimeofday ff_malloc_h="" { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in malloc.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" if test "x$ac_cv_header_malloc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC_H 1 _ACEOF ff_malloc_h=1 fi done FF_MALLOC_H=$ff_malloc_h for ac_func in asinh acosh atanh getenv jn erfc tgamma gettimeofday mallinfo mstats do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in srandomdev do : ac_fn_cxx_check_func "$LINENO" "srandomdev" "ac_cv_func_srandomdev" if test "x$ac_cv_func_srandomdev" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SRANDOMDEV 1 _ACEOF fi done for ac_func in second_ do : ac_fn_cxx_check_func "$LINENO" "second_" "ac_cv_func_second_" if test "x$ac_cv_func_second_" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SECOND_ 1 _ACEOF ff_second="" else ff_second=second.o fi done FF_SECOND="$ff_second" # Enable static linking (no shared libraries) # ------------------------------------------- # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_libtool+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_libtool"; then ac_cv_prog_ff_libtool="$ff_libtool" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_libtool="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_libtool" && ac_cv_prog_ff_libtool="no" fi fi ff_libtool=$ac_cv_prog_ff_libtool if test -n "$ff_libtool"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_libtool" >&5 $as_echo "$ff_libtool" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$ff_mac" = "yes" -a "$ff_libtool" = yes ; then ff_AR="libtool" ff_ARFLAGS="-static -o" ff_RANLIB="echo" fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; fi if test "$enable_static" = yes then # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ff_libtool+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ff_libtool"; then ac_cv_prog_ff_libtool="$ff_libtool" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ff_libtool="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ff_libtool" && ac_cv_prog_ff_libtool="no" fi fi ff_libtool=$ac_cv_prog_ff_libtool if test -n "$ff_libtool"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_libtool" >&5 $as_echo "$ff_libtool" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$ff_libtool" = yes then LDFLAGS="$LDFLAGS -all-static" STATICTOOL=libtool else as_fn_error $? "libtool not found" "$LINENO" 5 fi fi # for compiation of arpack use libtool to bluid universal library on MacOs. AR=$ff_AR ARFLAGS=$ff_ARFLAGS RANLIN=$ff_RANLIB # Dynamic loading of compiled functions # ------------------------------------- # Not if we don't want shared libraries (non FH modif FH juin 2005) ff_dynload=no if test "$enable_static" != yes then # Availability of dlopen(). Use AC_COMPILE rather than # AC_CHECK_HEADERS because the latter has problems seeing it (in # Cygwin) when it does not compile (in Mingw). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlfcn.h" >&5 $as_echo_n "checking for dlfcn.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ff_dynload=yes else ff_dynload=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_dynload" >&5 $as_echo "$ff_dynload" >&6; } fi # FFCS - -lm missing for ffmedit link stage on Debian Testing { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if ${ac_cv_lib_m_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 sin (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return sin (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # Checks that we also have the corresponding library if test "$ff_dynload" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlinfo in -ldl" >&5 $as_echo_n "checking for dlinfo in -ldl... " >&6; } if ${ac_cv_lib_dl_dlinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dlinfo (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return dlinfo (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dlinfo=yes else ac_cv_lib_dl_dlinfo=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlinfo" >&5 $as_echo "$ac_cv_lib_dl_dlinfo" >&6; } if test "x$ac_cv_lib_dl_dlinfo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi # Checks that everythings works ok { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dlopen links ok" >&5 $as_echo_n "checking whether dlopen links ok... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int argc,char **argv){ dlopen("",RTLD_LAZY); return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_dynload=yes else ff_dynload=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_dynload" >&5 $as_echo "$ff_dynload" >&6; } fi # the -rdynamic don't exist on macos and sunOS if test "$ff_dynload" = yes then $as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h # Activate dynamic loading tests (see examples++-load/Makefile.am) LOAD_TESTS=../regtests.sh LOAD_COMPILE=load_compile # gcc on MacOS does not produce an error with "-rdynamic" but # still complains about it. if test "$ff_mac" = "no" -a "$ff_win32" = "no" -a "$ff_sunos" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -rdynamic" >&5 $as_echo_n "checking whether the C++ compiler accepts -rdynamic... " >&6; } check_save_flags="$LDFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu LDFLAGS="$LDFLAGS -rdynamic" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then LDFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test "$ff_fpic" != "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler accepts -fPIC" >&5 $as_echo_n "checking whether the C++ compiler accepts -fPIC... " >&6; } check_save_flags="$CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS="$CXXFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CXXFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -fPIC" >&5 $as_echo_n "checking whether the C compiler accepts -fPIC... " >&6; } check_save_flags="$CFLAGS" 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 CFLAGS="$CFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts -fPIC" >&5 $as_echo_n "checking whether the C compiler accepts -fPIC... " >&6; } check_save_flags="$CNOFLAGS" 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 CNOFLAGS="$CNOFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then CNOFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test "$enable_fortran" != no ; then if test "$ff_fpic" != "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts -fPIC" >&5 $as_echo_n "checking whether the Fortran compiler accepts -fPIC... " >&6; } check_save_flags="$FFLAGS" 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 FFLAGS="$FFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts -fPIC" >&5 $as_echo_n "checking whether the Fortran compiler accepts -fPIC... " >&6; } check_save_flags="$FNOFLAGS" 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 FNOFLAGS="$FNOFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FNOFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts -fPIC" >&5 $as_echo_n "checking whether the Fortran compiler accepts -fPIC... " >&6; } check_save_flags="$FCFLAGS" 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 FCFLAGS="$FCFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FCFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts -fPIC" >&5 $as_echo_n "checking whether the Fortran compiler accepts -fPIC... " >&6; } check_save_flags="$FCNOFLAGS" 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 FCNOFLAGS="$FCNOFLAGS -fPIC" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : check_flag_ok=yes else check_flag_ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_flag_ok" >&5 $as_echo "$check_flag_ok" >&6; } if test "$check_flag_ok" = no; then FCNOFLAGS="$check_save_flags" fi if test -n "" ; then ="$check_flag_ok" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi fi DYLIB_SUFFIX=$ff_suffix_dylib # the doc is now in https://github.com/FreeFem/FreeFem-doc-pdf/blob/master/freefem%2B%2Bdoc.pdf # Checking wether we can generate some documentation # -------------------------------------------------- # PDF documentation building sometimes poses problems because of pdfsync.sty. So we need to be able to disable it. # FFCS - 9/4/14 - need to disable PDF also during FFCS build (which does not use the resulting PDF). # Choosing compilation options for the standard version (in src/std) # ------------------------------------------------------------------ # The "standard" configured version can use win32 (mingw) if test "$ff_mingw" = yes then # FFCS does not use FreeFem++-std, and Pcrgraph.cpp does not compile under mingwin64 if test $enable_ffcs = no then ff_stdprog="FreeFem++-std${EXEEXT}" ff_std_graph_obj=Pcrgraph.$OBJEXT fi # ALH - FFCS - 30/11/8 - I need to get the output from FF for FFCS regression tests if test $enable_ffcs = yes then ff_std_ldflags="-mconsole -mwindows" else ff_std_ldflags=-mwindows fi ff_std_libs= fi STD_GRAPH_OBJ=$ff_std_graph_obj STD_LDFLAGS=$ff_std_ldflags STD_LIBS=$ff_std_libs # Allow some downloaded tools not to be compiled # ---------------------------------------------- ## try to see pakage is hon computer if the FH ZZZZ ## FH to find gsl ... # Check whether --with-gsl-prefix was given. if test "${with_gsl_prefix+set}" = set; then : withval=$with_gsl_prefix; gsl_prefix="$withval" else gsl_prefix="" fi # Check whether --with-gsl-exec-prefix was given. if test "${with_gsl_exec_prefix+set}" = set; then : withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval" else gsl_exec_prefix="" fi # Check whether --enable-gsltest was given. if test "${enable_gsltest+set}" = set; then : enableval=$enable_gsltest; else enable_gsltest=yes fi if test "x${GSL_CONFIG+set}" != xset ; then if test "x$gsl_prefix" != x ; then GSL_CONFIG="$gsl_prefix/bin/gsl-config" fi if test "x$gsl_exec_prefix" != x ; then GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config" fi fi # Extract the first word of "gsl-config", so it can be a program name with args. set dummy gsl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GSL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GSL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GSL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no" ;; esac fi GSL_CONFIG=$ac_cv_path_GSL_CONFIG if test -n "$GSL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5 $as_echo "$GSL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_gsl_version=1.15 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5 $as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; } no_gsl="" if test "$GSL_CONFIG" = "no" ; then no_gsl=yes else GSL_CFLAGS=`$GSL_CONFIG --cflags` GSL_LIBS=`$GSL_CONFIG --libs` gsl_major_version=`$GSL_CONFIG --version | \ sed 's/^\([0-9]*\).*/\1/'` if test "x${gsl_major_version}" = "x" ; then gsl_major_version=0 fi gsl_minor_version=`$GSL_CONFIG --version | \ sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\2/'` if test "x${gsl_minor_version}" = "x" ; then gsl_minor_version=0 fi gsl_micro_version=`$GSL_CONFIG --version | \ sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\3/'` if test "x${gsl_micro_version}" = "x" ; then gsl_micro_version=0 fi if test "x$enable_gsltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GSL_CFLAGS" LIBS="$LIBS $GSL_LIBS" rm -f conf.gsltest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include char* my_strdup (const char *str); char* my_strdup (const char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (void) { int major = 0, minor = 0, micro = 0; int n; char *tmp_version; system ("touch conf.gsltest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_gsl_version"); n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) ; if (n != 2 && n != 3) { printf("%s, bad version string\n", "$min_gsl_version"); exit(1); } if (($gsl_major_version > major) || (($gsl_major_version == major) && ($gsl_minor_version > minor)) || (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro))) { exit(0); } else { exit(1); } } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else no_gsl=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gsl" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ff_with_gsl=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$GSL_CONFIG" = "no" ; then echo "*** The gsl-config script installed by GSL could not be found" echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GSL_CONFIG environment variable to the" echo "*** full path to gsl-config." else if test -f conf.gsltest ; then : else echo "*** Could not run GSL test program, checking why..." CFLAGS="$CFLAGS $GSL_CFLAGS" LIBS="$LIBS $GSL_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GSL or finding the wrong" echo "*** version of GSL. If it is not finding GSL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GSL was incorrectly installed" echo "*** or that you have moved GSL since it was installed. In the latter case, you" echo "*** may want to edit the gsl-config script: $GSL_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi # GSL_CFLAGS="" # GSL_LIBS="" ff_with_gsl=no fi rm -f conf.gsltest if test "$ff_with_gsl" = "yes"; then if test -z "$ff_where_lib_conf_gsl" ; then echo "gsl LD $GSL_LIBS" >>$ff_where_lib_conf test -n "$GSL_CFLAGS" && echo "gsl INCLUDE $GSL_CFLAGS " >>$ff_where_lib_conf ff_where_lib_conf_gsl=1 ff_where_lib_gsl="$GSL_LIBS" ff_where_inc_gsl="$GSL_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add gsl : $GSL_LIBS $GSL_CFLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add gsl : $GSL_LIBS $GSL_CFLAGS in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add gsl : $GSL_LIBS $GSL_CFLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add gsl : $GSL_LIBS $GSL_CFLAGS in $ff_where_lib_conf \"" >&6;} fi fi ## if test -z "$ff_where_lib_conf_mumps" -a "$enable_download_mumps" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mumps" >&5 $as_echo_n "checking check mumps... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -ldmumps -lzmumps -lmumps_common -lpord " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mumps LD -ldmumps -lzmumps -lmumps_common -lpord" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "dmumps_c.h" || $as_expr X"dmumps_c.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"dmumps_c.h" : 'X\(//\)[^/]' \| \ X"dmumps_c.h" : 'X\(//\)$' \| \ X"dmumps_c.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"dmumps_c.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mumps INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mumps=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mumps_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_mumps_seq" -a "$enable_download_mumps_seq" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mumps_seq" >&5 $as_echo_n "checking check mumps_seq... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -ldmumps_seq -lzmumps_seq -lmumps_common_seq -lpord_seq -lmpiseq_seq " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mumps_seq LD -ldmumps_seq -lzmumps_seq -lmumps_common_seq -lpord_seq -lmpiseq_seq" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "dmumps_c.h" || $as_expr X"dmumps_c.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"dmumps_c.h" : 'X\(//\)[^/]' \| \ X"dmumps_c.h" : 'X\(//\)$' \| \ X"dmumps_c.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"dmumps_c.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mumps_seq INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mumps_seq=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mumps_seq_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_libseq" -a "$enable_download_libseq" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check libseq" >&5 $as_echo_n "checking check libseq... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lmpiseq_seq " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}mumps_seq/mpi.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "libseq LD -lmpiseq_seq" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}mumps_seq/mpi.h" || $as_expr X"${inc_usr_include}mumps_seq/mpi.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}mumps_seq/mpi.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}mumps_seq/mpi.h" : 'X\(//\)$' \| \ X"${inc_usr_include}mumps_seq/mpi.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}mumps_seq/mpi.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "libseq INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_libseq=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_libseq_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_mumps_ptscotch" -a "$enable_download_mumps_ptscotch" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mumps_ptscotch" >&5 $as_echo_n "checking check mumps_ptscotch... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lpord_ptscotch -lmumps_common_ptscotch -ldmumps_ptscotch -lzmumps_ptscotch -lpord_ptscotch " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mumps_ptscotch LD -lpord_ptscotch -lmumps_common_ptscotch -ldmumps_ptscotch -lzmumps_ptscotch -lpord_ptscotch" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "dmumps_c.h" || $as_expr X"dmumps_c.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"dmumps_c.h" : 'X\(//\)[^/]' \| \ X"dmumps_c.h" : 'X\(//\)$' \| \ X"dmumps_c.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"dmumps_c.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mumps_ptscotch INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mumps_ptscotch=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mumps_ptscotch_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_mumps_scotch" -a "$enable_download_mumps_scotch" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mumps_scotch" >&5 $as_echo_n "checking check mumps_scotch... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lpord_scotch -lmumps_common_scotch -ldmumps_scotch -lzmumps_scotch -lpord_scotch " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mumps_scotch LD -lpord_scotch -lmumps_common_scotch -ldmumps_scotch -lzmumps_scotch -lpord_scotch" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "dmumps_c.h" || $as_expr X"dmumps_c.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"dmumps_c.h" : 'X\(//\)[^/]' \| \ X"dmumps_c.h" : 'X\(//\)$' \| \ X"dmumps_c.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"dmumps_c.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mumps_scotch INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mumps_scotch=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mumps_scotch_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_hypre" -a "$enable_download_hypre" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check hypre" >&5 $as_echo_n "checking check hypre... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lHYPRE " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "hypre LD -lHYPRE" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "hypre INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_hypre=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_hypre_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_fftw3" -a "$enable_download_fftw3" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check fftw3" >&5 $as_echo_n "checking check fftw3... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lfftw3 " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}fftw3.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "fftw3 LD -lfftw3" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}fftw3.h" || $as_expr X"${inc_usr_include}fftw3.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}fftw3.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}fftw3.h" : 'X\(//\)$' \| \ X"${inc_usr_include}fftw3.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}fftw3.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "fftw3 INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_fftw3=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_fftw3_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_superlu_dist" -a "$enable_download_superlu_dist" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check superlu_dist" >&5 $as_echo_n "checking check superlu_dist... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lsuperlu-dist " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}superlu-dist/superlu_defs.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "superlu_dist LD -lsuperlu-dist" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}superlu-dist/superlu_defs.h" || $as_expr X"${inc_usr_include}superlu-dist/superlu_defs.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}superlu-dist/superlu_defs.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}superlu-dist/superlu_defs.h" : 'X\(//\)$' \| \ X"${inc_usr_include}superlu-dist/superlu_defs.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}superlu-dist/superlu_defs.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "superlu_dist INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_superlu_dist=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_superlu_dist_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_superlu" -a "$enable_download_superlu" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check superlu" >&5 $as_echo_n "checking check superlu... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lsuperlu " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}superlu/superlu_enum_consts.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "superlu LD -lsuperlu" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}superlu/superlu_enum_consts.h" || $as_expr X"${inc_usr_include}superlu/superlu_enum_consts.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}superlu/superlu_enum_consts.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}superlu/superlu_enum_consts.h" : 'X\(//\)$' \| \ X"${inc_usr_include}superlu/superlu_enum_consts.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}superlu/superlu_enum_consts.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "superlu INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_superlu=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_superlu_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_superlu4" -a "$enable_download_superlu4" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check superlu4" >&5 $as_echo_n "checking check superlu4... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lsuperlu4 " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}superlu4/superlu_enum_consts.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "superlu4 LD -lsuperlu4" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}superlu4/superlu_enum_consts.h" || $as_expr X"${inc_usr_include}superlu4/superlu_enum_consts.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}superlu4/superlu_enum_consts.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}superlu4/superlu_enum_consts.h" : 'X\(//\)$' \| \ X"${inc_usr_include}superlu4/superlu_enum_consts.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}superlu4/superlu_enum_consts.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "superlu4 INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_superlu4=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_superlu4_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_blacs" -a "$enable_download_blacs" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check blacs" >&5 $as_echo_n "checking check blacs... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "blacs LD -lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "blacs INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_blacs=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_blacs_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_scalapack" -a "$enable_download_scalapack" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check scalapack" >&5 $as_echo_n "checking check scalapack... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lscalapack$ff_with_mpi " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "scalapack LD -lscalapack$ff_with_mpi" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "scalapack INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_scalapack=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_scalapack_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_scotch" -a "$enable_download_scotch" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check scotch" >&5 $as_echo_n "checking check scotch... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lscotch -lscotcherr " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "scotch LD -lscotch -lscotcherr" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "scotch.h" || $as_expr X"scotch.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"scotch.h" : 'X\(//\)[^/]' \| \ X"scotch.h" : 'X\(//\)$' \| \ X"scotch.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"scotch.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "scotch INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_scotch=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_scotch_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_ptscotch" -a "$enable_download_ptscotch" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check ptscotch" >&5 $as_echo_n "checking check ptscotch... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lptscotch -lptscotcherr " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "ptscotch LD -lptscotch -lptscotcherr" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "ptscotch.h" || $as_expr X"ptscotch.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"ptscotch.h" : 'X\(//\)[^/]' \| \ X"ptscotch.h" : 'X\(//\)$' \| \ X"ptscotch.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"ptscotch.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "ptscotch INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_ptscotch=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_ptscotch_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_metis" -a "$enable_download_metis" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check metis" >&5 $as_echo_n "checking check metis... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lmetis " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}metis/metis.h> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "metis LD -lmetis" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}metis/metis.h" || $as_expr X"${inc_usr_include}metis/metis.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}metis/metis.h" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}metis/metis.h" : 'X\(//\)$' \| \ X"${inc_usr_include}metis/metis.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}metis/metis.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "metis INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_metis=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_metis_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_metis" -a "$enable_download_metis" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check metis" >&5 $as_echo_n "checking check metis... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lmetis " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "metis LD -lmetis" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "metis.h" || $as_expr X"metis.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"metis.h" : 'X\(//\)[^/]' \| \ X"metis.h" : 'X\(//\)$' \| \ X"metis.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"metis.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "metis INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_metis=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_metis_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_parmetis" -a "$enable_download_parmetis" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check parmetis" >&5 $as_echo_n "checking check parmetis... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lparmetis -lmetis " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "parmetis LD -lparmetis -lmetis" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "parmetis INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_parmetis=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_parmetis_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_freeyams" -a "$enable_download_freeyams" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check freeyams" >&5 $as_echo_n "checking check freeyams... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lfreeyams " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "freeyams LD -lfreeyams" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "freeyamslib.h" || $as_expr X"freeyamslib.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"freeyamslib.h" : 'X\(//\)[^/]' \| \ X"freeyamslib.h" : 'X\(//\)$' \| \ X"freeyamslib.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"freeyamslib.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "freeyams INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_freeyams=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_freeyams_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_mmg3d" -a "$enable_download_mmg3d" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mmg3d" >&5 $as_echo_n "checking check mmg3d... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lmmg3d " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mmg3d LD -lmmg3d" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "libmmg3d.h" || $as_expr X"libmmg3d.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"libmmg3d.h" : 'X\(//\)[^/]' \| \ X"libmmg3d.h" : 'X\(//\)$' \| \ X"libmmg3d.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"libmmg3d.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mmg3d INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mmg3d=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mmg3d_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_mshmet" -a "$enable_download_mshmet" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check mshmet" >&5 $as_echo_n "checking check mshmet... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lmshmet " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "mshmet LD -lmshmet" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "mshmet INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_mshmet=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_mshmet_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_parms" -a "$enable_download_parms" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check parms" >&5 $as_echo_n "checking check parms... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lparms -litsol -llapack -lblas -lm " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "parms LD -lparms -litsol -llapack -lblas -lm" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "" || $as_expr X"" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"" : 'X\(//\)[^/]' \| \ X"" : 'X\(//\)$' \| \ X"" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "parms INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_parms=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_parms_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_tetgen" -a "$enable_download_tetgen" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check tetgen" >&5 $as_echo_n "checking check tetgen... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -ltet " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "tetgen LD -ltet" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "tetgen.h" || $as_expr X"tetgen.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"tetgen.h" : 'X\(//\)[^/]' \| \ X"tetgen.h" : 'X\(//\)$' \| \ X"tetgen.h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"tetgen.h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "tetgen INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_tetgen=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_tetgen_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_ipopt" -a "$enable_download_ipopt" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check ipopt" >&5 $as_echo_n "checking check ipopt... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lipopt " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${inc_usr_include}coin/IpTNLP.hpp> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "ipopt LD -lipopt" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "${inc_usr_include}coin/IpTNLP.hpp" || $as_expr X"${inc_usr_include}coin/IpTNLP.hpp" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"${inc_usr_include}coin/IpTNLP.hpp" : 'X\(//\)[^/]' \| \ X"${inc_usr_include}coin/IpTNLP.hpp" : 'X\(//\)$' \| \ X"${inc_usr_include}coin/IpTNLP.hpp" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"${inc_usr_include}coin/IpTNLP.hpp" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "ipopt INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_ipopt=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_ipopt_ok=$ff_WHERE; LIBS=$ff_save_libs fi if test -z "$ff_where_lib_conf_nlopt" -a "$enable_download_nlopt" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check nlopt" >&5 $as_echo_n "checking check nlopt... " >&6; } ff_save_libs=$LIBS LIBS="$LIBS -lnlopt " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ff_WHERE=yes else ff_WHERE=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ff_WHERE" = "yes" ; then echo "nlopt LD -lnlopt" >>$ff_where_lib_conf ff_WHERE_INC=`$as_dirname -- "nlopt.hpp" || $as_expr X"nlopt.hpp" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"nlopt.hpp" : 'X\(//\)[^/]' \| \ X"nlopt.hpp" : 'X\(//\)$' \| \ X"nlopt.hpp" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"nlopt.hpp" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` case "$ff_WHERE_INC" in /*) echo "nlopt INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;; esac ff_where_lib_conf_nlopt=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_WHERE" >&5 $as_echo "$ff_WHERE" >&6; } ff_nlopt_ok=$ff_WHERE; LIBS=$ff_save_libs fi ## before try # Check whether --enable-tetgen was given. if test "${enable_tetgen+set}" = set; then : enableval=$enable_tetgen; fi if test "$enable_tetgen" = "no" then TOOL_COMPILE_tetgen="" TOOL_DYLIB_tetgen="" elif test "$ff_tetgen_ok" = "yes" ; then TOOL_DYLIB_tetgen=tetgen.$DYLIB_SUFFIX enable_tetgen_download=no else TOOL_COMPILE_tetgen=tetgen TOOL_DYLIB_tetgen=tetgen.$DYLIB_SUFFIX enable_tetgen_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-tetgen_include was given. if test "${with_tetgen_include+set}" = set; then : withval=$with_tetgen_include; fi # Check whether --with-tetgen_ldflags was given. if test "${with_tetgen_ldflags+set}" = set; then : withval=$with_tetgen_ldflags; fi # Check whether --enable-download-tetgen was given. if test "${enable_download_tetgen+set}" = set; then : enableval=$enable_download_tetgen; fi if test "$with_tetgen_include" != "" || test "$with_tetgen_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_tetgen" ; then echo "tetgen LD $with_tetgen_ldflags" >>$ff_where_lib_conf test -n "$with_tetgen_include" && echo "tetgen INCLUDE $with_tetgen_include " >>$ff_where_lib_conf ff_where_lib_conf_tetgen=1 ff_where_lib_tetgen="$with_tetgen_ldflags" ff_where_inc_tetgen="$with_tetgen_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add tetgen : $with_tetgen_ldflags $with_tetgen_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add tetgen : $with_tetgen_ldflags $with_tetgen_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add tetgen : $with_tetgen_ldflags $with_tetgen_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add tetgen : $with_tetgen_ldflags $with_tetgen_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_tetgen="" enable_tetgen_download=no fi # Check whether --enable-hips was given. if test "${enable_hips+set}" = set; then : enableval=$enable_hips; fi if test "$enable_hips" = "no" then TOOL_COMPILE_hips="" TOOL_DYLIB_hips="" elif test "$ff_hips_ok" = "yes" ; then TOOL_DYLIB_hips=hips_FreeFem.$DYLIB_SUFFIX enable_hips_download=no else TOOL_COMPILE_hips=hips TOOL_DYLIB_hips=hips_FreeFem.$DYLIB_SUFFIX enable_hips_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-hips_include was given. if test "${with_hips_include+set}" = set; then : withval=$with_hips_include; fi # Check whether --with-hips_ldflags was given. if test "${with_hips_ldflags+set}" = set; then : withval=$with_hips_ldflags; fi # Check whether --enable-download-hips was given. if test "${enable_download_hips+set}" = set; then : enableval=$enable_download_hips; fi if test "$with_hips_include" != "" || test "$with_hips_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_hips" ; then echo "hips LD $with_hips_ldflags" >>$ff_where_lib_conf test -n "$with_hips_include" && echo "hips INCLUDE $with_hips_include " >>$ff_where_lib_conf ff_where_lib_conf_hips=1 ff_where_lib_hips="$with_hips_ldflags" ff_where_inc_hips="$with_hips_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add hips : $with_hips_ldflags $with_hips_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add hips : $with_hips_ldflags $with_hips_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add hips : $with_hips_ldflags $with_hips_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add hips : $with_hips_ldflags $with_hips_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_hips="" enable_hips_download=no fi # Check whether --enable-ipopt was given. if test "${enable_ipopt+set}" = set; then : enableval=$enable_ipopt; fi if test "$enable_ipopt" = "no" then TOOL_COMPILE_ipopt="" TOOL_DYLIB_ipopt="" elif test "$ff_ipopt_ok" = "yes" ; then TOOL_DYLIB_ipopt=ff-Ipopt.$DYLIB_SUFFIX enable_ipopt_download=no else TOOL_COMPILE_ipopt=ipopt TOOL_DYLIB_ipopt=ff-Ipopt.$DYLIB_SUFFIX enable_ipopt_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-ipopt_include was given. if test "${with_ipopt_include+set}" = set; then : withval=$with_ipopt_include; fi # Check whether --with-ipopt_ldflags was given. if test "${with_ipopt_ldflags+set}" = set; then : withval=$with_ipopt_ldflags; fi # Check whether --enable-download-ipopt was given. if test "${enable_download_ipopt+set}" = set; then : enableval=$enable_download_ipopt; fi if test "$with_ipopt_include" != "" || test "$with_ipopt_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_ipopt" ; then echo "ipopt LD $with_ipopt_ldflags" >>$ff_where_lib_conf test -n "$with_ipopt_include" && echo "ipopt INCLUDE $with_ipopt_include " >>$ff_where_lib_conf ff_where_lib_conf_ipopt=1 ff_where_lib_ipopt="$with_ipopt_ldflags" ff_where_inc_ipopt="$with_ipopt_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add ipopt : $with_ipopt_ldflags $with_ipopt_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add ipopt : $with_ipopt_ldflags $with_ipopt_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add ipopt : $with_ipopt_ldflags $with_ipopt_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add ipopt : $with_ipopt_ldflags $with_ipopt_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_ipopt="" enable_ipopt_download=no fi # Check whether --enable-lapack was given. if test "${enable_lapack+set}" = set; then : enableval=$enable_lapack; fi if test "$enable_lapack" = "no" then TOOL_COMPILE_lapack="" TOOL_DYLIB_lapack="" elif test "$ff_lapack_ok" = "yes" ; then TOOL_DYLIB_lapack="lapack.$DYLIB_SUFFIX fflapack.$DYLIB_SUFFIX" enable_lapack_download=no else TOOL_COMPILE_lapack=lapack TOOL_DYLIB_lapack="lapack.$DYLIB_SUFFIX fflapack.$DYLIB_SUFFIX" enable_lapack_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-lapack_include was given. if test "${with_lapack_include+set}" = set; then : withval=$with_lapack_include; fi # Check whether --with-lapack_ldflags was given. if test "${with_lapack_ldflags+set}" = set; then : withval=$with_lapack_ldflags; fi # Check whether --enable-download-lapack was given. if test "${enable_download_lapack+set}" = set; then : enableval=$enable_download_lapack; fi if test "$with_lapack_include" != "" || test "$with_lapack_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_lapack" ; then echo "lapack LD $with_lapack_ldflags" >>$ff_where_lib_conf test -n "$with_lapack_include" && echo "lapack INCLUDE $with_lapack_include " >>$ff_where_lib_conf ff_where_lib_conf_lapack=1 ff_where_lib_lapack="$with_lapack_ldflags" ff_where_inc_lapack="$with_lapack_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add lapack : $with_lapack_ldflags $with_lapack_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add lapack : $with_lapack_ldflags $with_lapack_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add lapack : $with_lapack_ldflags $with_lapack_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add lapack : $with_lapack_ldflags $with_lapack_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_lapack="" enable_lapack_download=no fi # Check whether --enable-parmetis was given. if test "${enable_parmetis+set}" = set; then : enableval=$enable_parmetis; fi if test "$enable_parmetis" = "no" then TOOL_COMPILE_parmetis="" TOOL_DYLIB_parmetis="" elif test "$ff_parmetis_ok" = "yes" ; then TOOL_DYLIB_parmetis=metis.$DYLIB_SUFFIX enable_parmetis_download=no else TOOL_COMPILE_parmetis=parmetis TOOL_DYLIB_parmetis=metis.$DYLIB_SUFFIX enable_parmetis_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-parmetis_include was given. if test "${with_parmetis_include+set}" = set; then : withval=$with_parmetis_include; fi # Check whether --with-parmetis_ldflags was given. if test "${with_parmetis_ldflags+set}" = set; then : withval=$with_parmetis_ldflags; fi # Check whether --enable-download-parmetis was given. if test "${enable_download_parmetis+set}" = set; then : enableval=$enable_download_parmetis; fi if test "$with_parmetis_include" != "" || test "$with_parmetis_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_parmetis" ; then echo "parmetis LD $with_parmetis_ldflags" >>$ff_where_lib_conf test -n "$with_parmetis_include" && echo "parmetis INCLUDE $with_parmetis_include " >>$ff_where_lib_conf ff_where_lib_conf_parmetis=1 ff_where_lib_parmetis="$with_parmetis_ldflags" ff_where_inc_parmetis="$with_parmetis_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add parmetis : $with_parmetis_ldflags $with_parmetis_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add parmetis : $with_parmetis_ldflags $with_parmetis_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add parmetis : $with_parmetis_ldflags $with_parmetis_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add parmetis : $with_parmetis_ldflags $with_parmetis_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_parmetis="" enable_parmetis_download=no fi # Check whether --enable-mmg3d was given. if test "${enable_mmg3d+set}" = set; then : enableval=$enable_mmg3d; fi if test "$enable_mmg3d" = "no" then TOOL_COMPILE_mmg3d="" TOOL_DYLIB_mmg3d="" elif test "$ff_mmg3d_ok" = "yes" ; then TOOL_DYLIB_mmg3d=mmg3d-v4.0.$DYLIB_SUFFIX enable_mmg3d_download=no else TOOL_COMPILE_mmg3d=mmg3d TOOL_DYLIB_mmg3d=mmg3d-v4.0.$DYLIB_SUFFIX enable_mmg3d_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-mmg3d_include was given. if test "${with_mmg3d_include+set}" = set; then : withval=$with_mmg3d_include; fi # Check whether --with-mmg3d_ldflags was given. if test "${with_mmg3d_ldflags+set}" = set; then : withval=$with_mmg3d_ldflags; fi # Check whether --enable-download-mmg3d was given. if test "${enable_download_mmg3d+set}" = set; then : enableval=$enable_download_mmg3d; fi if test "$with_mmg3d_include" != "" || test "$with_mmg3d_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_mmg3d" ; then echo "mmg3d LD $with_mmg3d_ldflags" >>$ff_where_lib_conf test -n "$with_mmg3d_include" && echo "mmg3d INCLUDE $with_mmg3d_include " >>$ff_where_lib_conf ff_where_lib_conf_mmg3d=1 ff_where_lib_mmg3d="$with_mmg3d_ldflags" ff_where_inc_mmg3d="$with_mmg3d_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mmg3d : $with_mmg3d_ldflags $with_mmg3d_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mmg3d : $with_mmg3d_ldflags $with_mmg3d_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mmg3d : $with_mmg3d_ldflags $with_mmg3d_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mmg3d : $with_mmg3d_ldflags $with_mmg3d_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_mmg3d="" enable_mmg3d_download=no fi # Check whether --enable-mshmet was given. if test "${enable_mshmet+set}" = set; then : enableval=$enable_mshmet; fi if test "$enable_mshmet" = "no" then TOOL_COMPILE_mshmet="" TOOL_DYLIB_mshmet="" elif test "$ff_mshmet_ok" = "yes" ; then TOOL_DYLIB_mshmet="mshmet.$DYLIB_SUFFIX aniso.$DYLIB_SUFFIX" enable_mshmet_download=no else TOOL_COMPILE_mshmet=mshmet TOOL_DYLIB_mshmet="mshmet.$DYLIB_SUFFIX aniso.$DYLIB_SUFFIX" enable_mshmet_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-mshmet_include was given. if test "${with_mshmet_include+set}" = set; then : withval=$with_mshmet_include; fi # Check whether --with-mshmet_ldflags was given. if test "${with_mshmet_ldflags+set}" = set; then : withval=$with_mshmet_ldflags; fi # Check whether --enable-download-mshmet was given. if test "${enable_download_mshmet+set}" = set; then : enableval=$enable_download_mshmet; fi if test "$with_mshmet_include" != "" || test "$with_mshmet_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_mshmet" ; then echo "mshmet LD $with_mshmet_ldflags" >>$ff_where_lib_conf test -n "$with_mshmet_include" && echo "mshmet INCLUDE $with_mshmet_include " >>$ff_where_lib_conf ff_where_lib_conf_mshmet=1 ff_where_lib_mshmet="$with_mshmet_ldflags" ff_where_inc_mshmet="$with_mshmet_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mshmet : $with_mshmet_ldflags $with_mshmet_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mshmet : $with_mshmet_ldflags $with_mshmet_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mshmet : $with_mshmet_ldflags $with_mshmet_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mshmet : $with_mshmet_ldflags $with_mshmet_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_mshmet="" enable_mshmet_download=no fi # Check whether --enable-gmm was given. if test "${enable_gmm+set}" = set; then : enableval=$enable_gmm; fi if test "$enable_gmm" = "no" then TOOL_COMPILE_gmm="" TOOL_DYLIB_gmm="" elif test "$ff_gmm_ok" = "yes" ; then TOOL_DYLIB_gmm=ilut.$DYLIB_SUFFIX enable_gmm_download=no else TOOL_COMPILE_gmm=gmm TOOL_DYLIB_gmm=ilut.$DYLIB_SUFFIX enable_gmm_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-gmm_include was given. if test "${with_gmm_include+set}" = set; then : withval=$with_gmm_include; fi # Check whether --with-gmm_ldflags was given. if test "${with_gmm_ldflags+set}" = set; then : withval=$with_gmm_ldflags; fi # Check whether --enable-download-gmm was given. if test "${enable_download_gmm+set}" = set; then : enableval=$enable_download_gmm; fi if test "$with_gmm_include" != "" || test "$with_gmm_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_gmm" ; then echo "gmm LD $with_gmm_ldflags" >>$ff_where_lib_conf test -n "$with_gmm_include" && echo "gmm INCLUDE $with_gmm_include " >>$ff_where_lib_conf ff_where_lib_conf_gmm=1 ff_where_lib_gmm="$with_gmm_ldflags" ff_where_inc_gmm="$with_gmm_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add gmm : $with_gmm_ldflags $with_gmm_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add gmm : $with_gmm_ldflags $with_gmm_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add gmm : $with_gmm_ldflags $with_gmm_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add gmm : $with_gmm_ldflags $with_gmm_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_gmm="" enable_gmm_download=no fi # Check whether --enable-mumps was given. if test "${enable_mumps+set}" = set; then : enableval=$enable_mumps; fi if test "$enable_mumps" = "no" then TOOL_COMPILE_mumps="" TOOL_DYLIB_mumps="" elif test "$ff_mumps_ok" = "yes" ; then TOOL_DYLIB_mumps="MUMPS_FreeFem.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX" enable_mumps_download=no else TOOL_COMPILE_mumps=mumps TOOL_DYLIB_mumps="MUMPS_FreeFem.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX" enable_mumps_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-mumps_include was given. if test "${with_mumps_include+set}" = set; then : withval=$with_mumps_include; fi # Check whether --with-mumps_ldflags was given. if test "${with_mumps_ldflags+set}" = set; then : withval=$with_mumps_ldflags; fi # Check whether --enable-download-mumps was given. if test "${enable_download_mumps+set}" = set; then : enableval=$enable_download_mumps; fi if test "$with_mumps_include" != "" || test "$with_mumps_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_mumps" ; then echo "mumps LD $with_mumps_ldflags" >>$ff_where_lib_conf test -n "$with_mumps_include" && echo "mumps INCLUDE $with_mumps_include " >>$ff_where_lib_conf ff_where_lib_conf_mumps=1 ff_where_lib_mumps="$with_mumps_ldflags" ff_where_inc_mumps="$with_mumps_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mumps : $with_mumps_ldflags $with_mumps_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mumps : $with_mumps_ldflags $with_mumps_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mumps : $with_mumps_ldflags $with_mumps_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mumps : $with_mumps_ldflags $with_mumps_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_mumps="" enable_mumps_download=no fi # Check whether --enable-mumps_seq was given. if test "${enable_mumps_seq+set}" = set; then : enableval=$enable_mumps_seq; fi if test "$enable_mumps_seq" = "no" then TOOL_COMPILE_mumps_seq="" TOOL_DYLIB_mumps_seq="" elif test "$ff_mumps_seq_ok" = "yes" ; then TOOL_DYLIB_mumps_seq="MUMPS_seq.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX" enable_mumps_seq_download=no else TOOL_COMPILE_mumps_seq=mumps-seq TOOL_DYLIB_mumps_seq="MUMPS_seq.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX" enable_mumps_seq_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-mumps_seq_include was given. if test "${with_mumps_seq_include+set}" = set; then : withval=$with_mumps_seq_include; fi # Check whether --with-mumps_seq_ldflags was given. if test "${with_mumps_seq_ldflags+set}" = set; then : withval=$with_mumps_seq_ldflags; fi # Check whether --enable-download-mumps_seq was given. if test "${enable_download_mumps_seq+set}" = set; then : enableval=$enable_download_mumps_seq; fi if test "$with_mumps_seq_include" != "" || test "$with_mumps_seq_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_mumps_seq" ; then echo "mumps_seq LD $with_mumps_seq_ldflags" >>$ff_where_lib_conf test -n "$with_mumps_seq_include" && echo "mumps_seq INCLUDE $with_mumps_seq_include " >>$ff_where_lib_conf ff_where_lib_conf_mumps_seq=1 ff_where_lib_mumps_seq="$with_mumps_seq_ldflags" ff_where_inc_mumps_seq="$with_mumps_seq_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add mumps_seq : $with_mumps_seq_ldflags $with_mumps_seq_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add mumps_seq : $with_mumps_seq_ldflags $with_mumps_seq_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add mumps_seq : $with_mumps_seq_ldflags $with_mumps_seq_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add mumps_seq : $with_mumps_seq_ldflags $with_mumps_seq_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_mumps_seq="" enable_mumps_seq_download=no fi # Check whether --enable-nlopt was given. if test "${enable_nlopt+set}" = set; then : enableval=$enable_nlopt; fi if test "$enable_nlopt" = "no" then TOOL_COMPILE_nlopt="" TOOL_DYLIB_nlopt="" elif test "$ff_nlopt_ok" = "yes" ; then TOOL_DYLIB_nlopt=ff-NLopt.$DYLIB_SUFFIX enable_nlopt_download=no else TOOL_COMPILE_nlopt=nlopt TOOL_DYLIB_nlopt=ff-NLopt.$DYLIB_SUFFIX enable_nlopt_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-nlopt_include was given. if test "${with_nlopt_include+set}" = set; then : withval=$with_nlopt_include; fi # Check whether --with-nlopt_ldflags was given. if test "${with_nlopt_ldflags+set}" = set; then : withval=$with_nlopt_ldflags; fi # Check whether --enable-download-nlopt was given. if test "${enable_download_nlopt+set}" = set; then : enableval=$enable_download_nlopt; fi if test "$with_nlopt_include" != "" || test "$with_nlopt_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_nlopt" ; then echo "nlopt LD $with_nlopt_ldflags" >>$ff_where_lib_conf test -n "$with_nlopt_include" && echo "nlopt INCLUDE $with_nlopt_include " >>$ff_where_lib_conf ff_where_lib_conf_nlopt=1 ff_where_lib_nlopt="$with_nlopt_ldflags" ff_where_inc_nlopt="$with_nlopt_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add nlopt : $with_nlopt_ldflags $with_nlopt_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add nlopt : $with_nlopt_ldflags $with_nlopt_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add nlopt : $with_nlopt_ldflags $with_nlopt_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add nlopt : $with_nlopt_ldflags $with_nlopt_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_nlopt="" enable_nlopt_download=no fi # Check whether --enable-parms was given. if test "${enable_parms+set}" = set; then : enableval=$enable_parms; fi if test "$enable_parms" = "no" then TOOL_COMPILE_parms="" TOOL_DYLIB_parms="" elif test "$ff_parms_ok" = "yes" ; then TOOL_DYLIB_parms=parms_FreeFem.$DYLIB_SUFFIX enable_parms_download=no else TOOL_COMPILE_parms=parms TOOL_DYLIB_parms=parms_FreeFem.$DYLIB_SUFFIX enable_parms_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-parms_include was given. if test "${with_parms_include+set}" = set; then : withval=$with_parms_include; fi # Check whether --with-parms_ldflags was given. if test "${with_parms_ldflags+set}" = set; then : withval=$with_parms_ldflags; fi # Check whether --enable-download-parms was given. if test "${enable_download_parms+set}" = set; then : enableval=$enable_download_parms; fi if test "$with_parms_include" != "" || test "$with_parms_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_parms" ; then echo "parms LD $with_parms_ldflags" >>$ff_where_lib_conf test -n "$with_parms_include" && echo "parms INCLUDE $with_parms_include " >>$ff_where_lib_conf ff_where_lib_conf_parms=1 ff_where_lib_parms="$with_parms_ldflags" ff_where_inc_parms="$with_parms_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add parms : $with_parms_ldflags $with_parms_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add parms : $with_parms_ldflags $with_parms_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add parms : $with_parms_ldflags $with_parms_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add parms : $with_parms_ldflags $with_parms_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_parms="" enable_parms_download=no fi # Check whether --enable-pastix was given. if test "${enable_pastix+set}" = set; then : enableval=$enable_pastix; fi if test "$enable_pastix" = "no" then TOOL_COMPILE_pastix="" TOOL_DYLIB_pastix="" elif test "$ff_pastix_ok" = "yes" ; then TOOL_DYLIB_pastix="interfacepastix.$DYLIB_SUFFIX complex_pastix_FreeFem.$DYLIB_SUFFIX real_pastix_FreeFem.$DYLIB_SUFFIX" enable_pastix_download=no else TOOL_COMPILE_pastix=pastix TOOL_DYLIB_pastix="interfacepastix.$DYLIB_SUFFIX complex_pastix_FreeFem.$DYLIB_SUFFIX real_pastix_FreeFem.$DYLIB_SUFFIX" enable_pastix_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-pastix_include was given. if test "${with_pastix_include+set}" = set; then : withval=$with_pastix_include; fi # Check whether --with-pastix_ldflags was given. if test "${with_pastix_ldflags+set}" = set; then : withval=$with_pastix_ldflags; fi # Check whether --enable-download-pastix was given. if test "${enable_download_pastix+set}" = set; then : enableval=$enable_download_pastix; fi if test "$with_pastix_include" != "" || test "$with_pastix_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_pastix" ; then echo "pastix LD $with_pastix_ldflags" >>$ff_where_lib_conf test -n "$with_pastix_include" && echo "pastix INCLUDE $with_pastix_include " >>$ff_where_lib_conf ff_where_lib_conf_pastix=1 ff_where_lib_pastix="$with_pastix_ldflags" ff_where_inc_pastix="$with_pastix_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pastix : $with_pastix_ldflags $with_pastix_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pastix : $with_pastix_ldflags $with_pastix_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pastix : $with_pastix_ldflags $with_pastix_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pastix : $with_pastix_ldflags $with_pastix_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_pastix="" enable_pastix_download=no fi # Check whether --enable-pipe was given. if test "${enable_pipe+set}" = set; then : enableval=$enable_pipe; fi if test "$enable_pipe" = "no" then TOOL_COMPILE_pipe="" TOOL_DYLIB_pipe="" elif test "$ff_pipe_ok" = "yes" ; then TOOL_DYLIB_pipe=pipe.$DYLIB_SUFFIX enable_pipe_download=no else TOOL_COMPILE_pipe=pipe TOOL_DYLIB_pipe=pipe.$DYLIB_SUFFIX enable_pipe_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-pipe_include was given. if test "${with_pipe_include+set}" = set; then : withval=$with_pipe_include; fi # Check whether --with-pipe_ldflags was given. if test "${with_pipe_ldflags+set}" = set; then : withval=$with_pipe_ldflags; fi # Check whether --enable-download-pipe was given. if test "${enable_download_pipe+set}" = set; then : enableval=$enable_download_pipe; fi if test "$with_pipe_include" != "" || test "$with_pipe_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_pipe" ; then echo "pipe LD $with_pipe_ldflags" >>$ff_where_lib_conf test -n "$with_pipe_include" && echo "pipe INCLUDE $with_pipe_include " >>$ff_where_lib_conf ff_where_lib_conf_pipe=1 ff_where_lib_pipe="$with_pipe_ldflags" ff_where_inc_pipe="$with_pipe_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_pipe="" enable_pipe_download=no fi # Check whether --enable-scotch was given. if test "${enable_scotch+set}" = set; then : enableval=$enable_scotch; fi if test "$enable_scotch" = "no" then TOOL_COMPILE_scotch="" TOOL_DYLIB_scotch="" elif test "$ff_scotch_ok" = "yes" ; then TOOL_DYLIB_scotch=scotch.$DYLIB_SUFFIX enable_scotch_download=no else TOOL_COMPILE_scotch=scotch TOOL_DYLIB_scotch=scotch.$DYLIB_SUFFIX enable_scotch_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-scotch_include was given. if test "${with_scotch_include+set}" = set; then : withval=$with_scotch_include; fi # Check whether --with-scotch_ldflags was given. if test "${with_scotch_ldflags+set}" = set; then : withval=$with_scotch_ldflags; fi # Check whether --enable-download-scotch was given. if test "${enable_download_scotch+set}" = set; then : enableval=$enable_download_scotch; fi if test "$with_scotch_include" != "" || test "$with_scotch_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_scotch" ; then echo "scotch LD $with_scotch_ldflags" >>$ff_where_lib_conf test -n "$with_scotch_include" && echo "scotch INCLUDE $with_scotch_include " >>$ff_where_lib_conf ff_where_lib_conf_scotch=1 ff_where_lib_scotch="$with_scotch_ldflags" ff_where_inc_scotch="$with_scotch_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add scotch : $with_scotch_ldflags $with_scotch_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add scotch : $with_scotch_ldflags $with_scotch_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add scotch : $with_scotch_ldflags $with_scotch_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add scotch : $with_scotch_ldflags $with_scotch_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_scotch="" enable_scotch_download=no fi # Check whether --enable-superlu4 was given. if test "${enable_superlu4+set}" = set; then : enableval=$enable_superlu4; fi if test "$enable_superlu4" = "no" then TOOL_COMPILE_superlu4="" TOOL_DYLIB_superlu4="" elif test "$ff_superlu4_ok" = "yes" ; then TOOL_DYLIB_superlu4=SuperLu.$DYLIB_SUFFIX enable_superlu4_download=no else TOOL_COMPILE_superlu4=superlu TOOL_DYLIB_superlu4=SuperLu.$DYLIB_SUFFIX enable_superlu4_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-superlu4_include was given. if test "${with_superlu4_include+set}" = set; then : withval=$with_superlu4_include; fi # Check whether --with-superlu4_ldflags was given. if test "${with_superlu4_ldflags+set}" = set; then : withval=$with_superlu4_ldflags; fi # Check whether --enable-download-superlu4 was given. if test "${enable_download_superlu4+set}" = set; then : enableval=$enable_download_superlu4; fi if test "$with_superlu4_include" != "" || test "$with_superlu4_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_superlu4" ; then echo "superlu4 LD $with_superlu4_ldflags" >>$ff_where_lib_conf test -n "$with_superlu4_include" && echo "superlu4 INCLUDE $with_superlu4_include " >>$ff_where_lib_conf ff_where_lib_conf_superlu4=1 ff_where_lib_superlu4="$with_superlu4_ldflags" ff_where_inc_superlu4="$with_superlu4_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add superlu4 : $with_superlu4_ldflags $with_superlu4_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add superlu4 : $with_superlu4_ldflags $with_superlu4_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add superlu4 : $with_superlu4_ldflags $with_superlu4_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add superlu4 : $with_superlu4_ldflags $with_superlu4_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_superlu4="" enable_superlu4_download=no fi # Check whether --enable-superludist was given. if test "${enable_superludist+set}" = set; then : enableval=$enable_superludist; fi if test "$enable_superludist" = "no" then TOOL_COMPILE_superludist="" TOOL_DYLIB_superludist="" elif test "$ff_superludist_ok" = "yes" ; then TOOL_DYLIB_superludist="complex_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX real_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX dSuperLU_DIST.$DYLIB_SUFFIX" enable_superludist_download=no else TOOL_COMPILE_superludist=superludist TOOL_DYLIB_superludist="complex_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX real_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX dSuperLU_DIST.$DYLIB_SUFFIX" enable_superludist_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-superludist_include was given. if test "${with_superludist_include+set}" = set; then : withval=$with_superludist_include; fi # Check whether --with-superludist_ldflags was given. if test "${with_superludist_ldflags+set}" = set; then : withval=$with_superludist_ldflags; fi # Check whether --enable-download-superludist was given. if test "${enable_download_superludist+set}" = set; then : enableval=$enable_download_superludist; fi if test "$with_superludist_include" != "" || test "$with_superludist_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_superludist" ; then echo "superludist LD $with_superludist_ldflags" >>$ff_where_lib_conf test -n "$with_superludist_include" && echo "superludist INCLUDE $with_superludist_include " >>$ff_where_lib_conf ff_where_lib_conf_superludist=1 ff_where_lib_superludist="$with_superludist_ldflags" ff_where_inc_superludist="$with_superludist_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add superludist : $with_superludist_ldflags $with_superludist_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add superludist : $with_superludist_ldflags $with_superludist_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add superludist : $with_superludist_ldflags $with_superludist_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add superludist : $with_superludist_ldflags $with_superludist_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_superludist="" enable_superludist_download=no fi # Check whether --enable-umfpack was given. if test "${enable_umfpack+set}" = set; then : enableval=$enable_umfpack; fi if test "$enable_umfpack" = "no" then TOOL_COMPILE_umfpack="" TOOL_DYLIB_umfpack="" elif test "$ff_umfpack_ok" = "yes" ; then TOOL_DYLIB_umfpack=UMFPACK64.$DYLIB_SUFFIX enable_umfpack_download=no else TOOL_COMPILE_umfpack=umfpack TOOL_DYLIB_umfpack=UMFPACK64.$DYLIB_SUFFIX enable_umfpack_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-umfpack_include was given. if test "${with_umfpack_include+set}" = set; then : withval=$with_umfpack_include; fi # Check whether --with-umfpack_ldflags was given. if test "${with_umfpack_ldflags+set}" = set; then : withval=$with_umfpack_ldflags; fi # Check whether --enable-download-umfpack was given. if test "${enable_download_umfpack+set}" = set; then : enableval=$enable_download_umfpack; fi if test "$with_umfpack_include" != "" || test "$with_umfpack_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_umfpack" ; then echo "umfpack LD $with_umfpack_ldflags" >>$ff_where_lib_conf test -n "$with_umfpack_include" && echo "umfpack INCLUDE $with_umfpack_include " >>$ff_where_lib_conf ff_where_lib_conf_umfpack=1 ff_where_lib_umfpack="$with_umfpack_ldflags" ff_where_inc_umfpack="$with_umfpack_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add umfpack : $with_umfpack_ldflags $with_umfpack_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add umfpack : $with_umfpack_ldflags $with_umfpack_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add umfpack : $with_umfpack_ldflags $with_umfpack_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add umfpack : $with_umfpack_ldflags $with_umfpack_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_umfpack="" enable_umfpack_download=no fi # Check whether --enable-yams was given. if test "${enable_yams+set}" = set; then : enableval=$enable_yams; fi if test "$enable_yams" = "no" then TOOL_COMPILE_yams="" TOOL_DYLIB_yams="" elif test "$ff_yams_ok" = "yes" ; then TOOL_DYLIB_yams=freeyams.$DYLIB_SUFFIX enable_yams_download=no else TOOL_COMPILE_yams=yams TOOL_DYLIB_yams=freeyams.$DYLIB_SUFFIX enable_yams_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-yams_include was given. if test "${with_yams_include+set}" = set; then : withval=$with_yams_include; fi # Check whether --with-yams_ldflags was given. if test "${with_yams_ldflags+set}" = set; then : withval=$with_yams_ldflags; fi # Check whether --enable-download-yams was given. if test "${enable_download_yams+set}" = set; then : enableval=$enable_download_yams; fi if test "$with_yams_include" != "" || test "$with_yams_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_yams" ; then echo "yams LD $with_yams_ldflags" >>$ff_where_lib_conf test -n "$with_yams_include" && echo "yams INCLUDE $with_yams_include " >>$ff_where_lib_conf ff_where_lib_conf_yams=1 ff_where_lib_yams="$with_yams_ldflags" ff_where_inc_yams="$with_yams_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add yams : $with_yams_ldflags $with_yams_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add yams : $with_yams_ldflags $with_yams_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add yams : $with_yams_ldflags $with_yams_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add yams : $with_yams_ldflags $with_yams_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_yams="" enable_yams_download=no fi # Check whether --enable-pipe was given. if test "${enable_pipe+set}" = set; then : enableval=$enable_pipe; fi if test "$enable_pipe" = "no" then TOOL_COMPILE_pipe="" TOOL_DYLIB_pipe="" elif test "$ff_pipe_ok" = "yes" ; then TOOL_DYLIB_pipe=pipe.$DYLIB_SUFFIX enable_pipe_download=no else TOOL_COMPILE_pipe=pipe TOOL_DYLIB_pipe=pipe.$DYLIB_SUFFIX enable_pipe_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-pipe_include was given. if test "${with_pipe_include+set}" = set; then : withval=$with_pipe_include; fi # Check whether --with-pipe_ldflags was given. if test "${with_pipe_ldflags+set}" = set; then : withval=$with_pipe_ldflags; fi # Check whether --enable-download-pipe was given. if test "${enable_download_pipe+set}" = set; then : enableval=$enable_download_pipe; fi if test "$with_pipe_include" != "" || test "$with_pipe_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_pipe" ; then echo "pipe LD $with_pipe_ldflags" >>$ff_where_lib_conf test -n "$with_pipe_include" && echo "pipe INCLUDE $with_pipe_include " >>$ff_where_lib_conf ff_where_lib_conf_pipe=1 ff_where_lib_pipe="$with_pipe_ldflags" ff_where_inc_pipe="$with_pipe_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pipe : $with_pipe_ldflags $with_pipe_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_pipe="" enable_pipe_download=no fi BIN_ffmaster="$BIN_ffmaster" # Check whether --enable-MMAP was given. if test "${enable_MMAP+set}" = set; then : enableval=$enable_MMAP; fi if test "$enable_MMAP" = "no" then TOOL_COMPILE_MMAP="" TOOL_DYLIB_MMAP="" elif test "$ff_MMAP_ok" = "yes" ; then TOOL_DYLIB_MMAP=ff-mmap-semaphore.$DYLIB_SUFFIX enable_MMAP_download=no else TOOL_COMPILE_MMAP=MMAP TOOL_DYLIB_MMAP=ff-mmap-semaphore.$DYLIB_SUFFIX enable_MMAP_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-MMAP_include was given. if test "${with_MMAP_include+set}" = set; then : withval=$with_MMAP_include; fi # Check whether --with-MMAP_ldflags was given. if test "${with_MMAP_ldflags+set}" = set; then : withval=$with_MMAP_ldflags; fi # Check whether --enable-download-MMAP was given. if test "${enable_download_MMAP+set}" = set; then : enableval=$enable_download_MMAP; fi if test "$with_MMAP_include" != "" || test "$with_MMAP_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_MMAP" ; then echo "MMAP LD $with_MMAP_ldflags" >>$ff_where_lib_conf test -n "$with_MMAP_include" && echo "MMAP INCLUDE $with_MMAP_include " >>$ff_where_lib_conf ff_where_lib_conf_MMAP=1 ff_where_lib_MMAP="$with_MMAP_ldflags" ff_where_inc_MMAP="$with_MMAP_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add MMAP : $with_MMAP_ldflags $with_MMAP_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add MMAP : $with_MMAP_ldflags $with_MMAP_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add MMAP : $with_MMAP_ldflags $with_MMAP_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add MMAP : $with_MMAP_ldflags $with_MMAP_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_MMAP="" enable_MMAP_download=no fi # FFCS - MUMPS_seq has a different Win32 compiler setup from FFCS, so we need to add some extra parameters if test "$OS" = Windows_NT then CFLAGS="$CFLAGS -DWITHOUT_PTHREAD -DAdd_" # we also need to satisfy ff-c++ that the pthread are not a blocking point if test -n "$ff_pthread" ; then if test -z "$ff_where_lib_conf_pthread" ; then echo "pthread LD """ >>$ff_where_lib_conf test -n "" && echo "pthread INCLUDE " >>$ff_where_lib_conf ff_where_lib_conf_pthread=1 ff_where_lib_pthread="""" ff_where_inc_pthread="" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pthread : \"\" in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pthread : \"\" in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pthread : \"\" in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pthread : \"\" in $ff_where_lib_conf \"" >&6;} fi fi fi # ALH - pARMS needs "-fno-range-check" on Windows, but this options fails on MacOS 10.8. Add no-range-check for Windows # for hexadecimal parameter constants like: # # [[file:c:/cygwin/home/alh/ffcs/rel/mingw/mpif.h::PARAMETER MPI_SHORT_INT z 8c000003]] # # Such constants are rejected without [[file:download/parms/makefile-parms.in::NO_RANGE_CHECK]] if test "$OS" = Windows_NT then NO_RANGE_CHECK=-fno-range-check fi # ALH - 4/9/13 - request from Helmut Jarausch - allow to change Scotch include path if test "$with_scotch_include" = "" then with_scotch_include=$ac_pwd/download/include/scotch fi SCOTCH_INCLUDE=$with_scotch_include # Find out kernel and libc versions # --------------------------------- if test "$ff_win32" != yes -a "$ff_mac" != yes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel version" >&5 $as_echo_n "checking kernel version... " >&6; } ff_kernel_version=`cat /proc/version|perl -e '=~/(\d+\.\d+\.\d+)/;print $1;'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_kernel_version" >&5 $as_echo "$ff_kernel_version" >&6; } KERNEL_VERSION=$ff_kernel_version { $as_echo "$as_me:${as_lineno-$LINENO}: checking libc version" >&5 $as_echo_n "checking libc version... " >&6; } ff_libc_version=`ldd /bin/sh | awk '/libc/{print $3}' | xargs readlink | sed -e 's/\.so$//'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ff_libc_version" >&5 $as_echo "$ff_libc_version" >&6; } LIBC_VERSION=$ff_libc_version fi # def variable pour les makefiles # creating all makefiles # ---------------------- ff_bamgprog="bamg${EXEEXT} cvmsh2${EXEEXT}" CNOFLAGS=$CNOFLAGS FNOFLAGS=$FNOFLAGS # The final list of executable programs MEDITPROG=$ff_meditprog FFGLUTPROG=$ff_ffglutprog BAMGPROG=$ff_bamgprog STDPROG=$ff_stdprog ff_progs="FreeFem++-nw $ff_bamgprog $ff_mpiprog $ff_meditprog $ff_ffglutprog" TEST_FFPP=$ff_TEST_FFPP TEST_FFPP_MPI=$ff_TEST_FFPP_MPI TEST_FFPPMPI="../src/mpi/ff-mpirun" ff_with_mpi=-openmpi; ff_blacs="-lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi" ff_scalapack=-lscalapack # change MKL interface ... test -n "$ff_mkl_blacs" && ff_blacs="$ff_mkl_blacs" test -n "$ff_mkl_scalapack" && ff_scalapack="$ff_mkl_scalapack" test -n "$ff_mkl_root" && ff_winc="$ff_mkl_root/include/mkl_blas.h" # FFCS - 27/10/11 - Some extra conditionals for things that do not work on certain systems (eg MPI libraries under # Windows) ## search of HDF5 .... { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_path_SED+:} false; 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 { ac_script=; unset 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" as_fn_executable_p "$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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed if test "" = "" ; then : # Recognized value elif test "" = "serial" ; then : # Recognized value elif test "" = "parallel"; then : # Recognized value else as_fn_error $? " Unrecognized value for AX_LIB_HDF5 within configure.ac. If supplied, argument 1 must be either 'serial' or 'parallel'. " "$LINENO" 5 fi # Check whether --with-hdf5 was given. if test "${with_hdf5+set}" = set; then : withval=$with_hdf5; if test "$withval" = "no"; then with_hdf5="no" elif test "$withval" = "yes"; then with_hdf5="yes" else with_hdf5="yes" H5CC="$withval" fi else with_hdf5="yes" fi HDF5_CC="" HDF5_VERSION="" HDF5_CFLAGS="" HDF5_CPPFLAGS="" HDF5_LDFLAGS="" HDF5_LIBS="" HDF5_FC="" HDF5_FFLAGS="" HDF5_FLIBS="" if test "$with_hdf5" = "yes"; then if test -z "$H5CC"; then for ac_prog in h5cc h5pcc 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:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_H5CC+:} false; then : $as_echo_n "(cached) " >&6 else case $H5CC in [\\/]* | ?:[\\/]*) ac_cv_path_H5CC="$H5CC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_H5CC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi H5CC=$ac_cv_path_H5CC if test -n "$H5CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 $as_echo "$H5CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$H5CC" && break done else { $as_echo "$as_me:${as_lineno-$LINENO}: checking Using provided HDF5 C wrapper" >&5 $as_echo_n "checking Using provided HDF5 C wrapper... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 $as_echo "$H5CC" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 libraries" >&5 $as_echo_n "checking for HDF5 libraries... " >&6; } if test ! -f "$H5CC" || test ! -x "$H5CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). " >&5 $as_echo "$as_me: WARNING: Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). " >&2;} with_hdf5="no" with_hdf5_fortran="no" else HDF5_SHOW=$(eval $H5CC -show) HDF5_CC=$(eval $H5CC -show | $AWK '{print $1}') if test "$HDF5_CC" = "ccache"; then HDF5_CC=$(eval $H5CC -show | $AWK '{print $2}') fi HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ | $AWK '{print $3}') HDF5_tmp_flags=$(eval $H5CC -showconfig \ | $GREP 'FLAGS\|Extra libraries:' \ | $AWK -F: '{printf("%s "), $2}' ) HDF5_tmp_inst=$(eval $H5CC -showconfig \ | $GREP 'Installation point:' \ | $AWK '{print $NF}' ) HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" for arg in $HDF5_SHOW $HDF5_tmp_flags ; do case "$arg" in -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_CPPFLAGS="$arg $HDF5_CPPFLAGS" ;; -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_LDFLAGS="$arg $HDF5_LDFLAGS" ;; -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_LIBS="$arg $HDF5_LIBS" ;; esac done HDF5_LIBS="$HDF5_LIBS -lhdf5" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $HDF5_VERSION)" >&5 $as_echo "yes (version $HDF5_VERSION)" >&6; } ax_lib_hdf5_save_CC=$CC ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS ax_lib_hdf5_save_LIBS=$LIBS ax_lib_hdf5_save_LDFLAGS=$LDFLAGS CC=$HDF5_CC CPPFLAGS=$HDF5_CPPFLAGS LIBS=$HDF5_LIBS LDFLAGS=$HDF5_LDFLAGS ac_fn_cxx_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" if test "x$ac_cv_header_hdf5_h" = xyes; then : ac_cv_hadf5_h=yes else ac_cv_hadf5_h=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for H5Fcreate in -lhdf5" >&5 $as_echo_n "checking for H5Fcreate in -lhdf5... " >&6; } if ${ac_cv_lib_hdf5_H5Fcreate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhdf5 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 H5Fcreate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return H5Fcreate (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_hdf5_H5Fcreate=yes else ac_cv_lib_hdf5_H5Fcreate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fcreate" >&5 $as_echo "$ac_cv_lib_hdf5_H5Fcreate" >&6; } if test "x$ac_cv_lib_hdf5_H5Fcreate" = xyes; then : ac_cv_libhdf5=yes else ac_cv_libhdf5=no fi if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile HDF5 test program" >&5 $as_echo "$as_me: WARNING: Unable to compile HDF5 test program" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5_hl" >&5 $as_echo_n "checking for main in -lhdf5_hl... " >&6; } if ${ac_cv_lib_hdf5_hl_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhdf5_hl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_hdf5_hl_main=yes else ac_cv_lib_hdf5_hl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_hl_main" >&5 $as_echo "$ac_cv_lib_hdf5_hl_main" >&6; } if test "x$ac_cv_lib_hdf5_hl_main" = xyes; then : HDF5_LIBS="$HDF5_LIBS -lhdf5_hl" fi ac_cv_lib_hdf5_hl=ac_cv_lib_hdf5_hl_main CC=$ax_lib_hdf5_save_CC CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS LIBS=$ax_lib_hdf5_save_LIBS LDFLAGS=$ax_lib_hdf5_save_LDFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for matching HDF5 Fortran wrapper" >&5 $as_echo_n "checking for matching HDF5 Fortran wrapper... " >&6; } H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') if test -x "$H5FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 $as_echo "$H5FC" >&6; } with_hdf5_fortran="yes" for arg in `$H5FC -show` do case "$arg" in #( -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ || HDF5_FFLAGS="$arg $HDF5_FFLAGS" ;;#( -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ || HDF5_FFLAGS="$arg $HDF5_FFLAGS" echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ || HDF5_FFLAGS="-I${arg#-L} $HDF5_FFLAGS" ;; esac done for arg in $HDF5_LIBS do case "$arg" in #( -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" ;; #( -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" ;; #( *) HDF5_FLIBS="$HDF5_FLIBS $arg" ;; esac done else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } with_hdf5_fortran="no" fi $as_echo "#define HAVE_HDF5 1" >>confdefs.h fi fi if test "$with_hdf5" = "yes"; then ff_save_cppflags="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "H5Cpp.h" "ac_cv_header_H5Cpp_h" "$ac_includes_default" if test "x$ac_cv_header_H5Cpp_h" = xyes; then : else with_hdf=no fi CPPFLAGS="$ff_save_cppflags" if test "$with_hdf5" = "yes"; then if test -z "$ff_where_lib_conf_hdf5" ; then echo "hdf5 LD $HDF5_LDFLAGS $HDF5_LIBS" >>$ff_where_lib_conf test -n "$HDF5_CPPFLAGS" && echo "hdf5 INCLUDE $HDF5_CPPFLAGS " >>$ff_where_lib_conf ff_where_lib_conf_hdf5=1 ff_where_lib_hdf5="$HDF5_LDFLAGS $HDF5_LIBS" ff_where_inc_hdf5="$HDF5_CPPFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add hdf5 : $HDF5_LDFLAGS $HDF5_LIBS $HDF5_CPPFLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add hdf5 : $HDF5_LDFLAGS $HDF5_LIBS $HDF5_CPPFLAGS in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add hdf5 : $HDF5_LDFLAGS $HDF5_LIBS $HDF5_CPPFLAGS in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add hdf5 : $HDF5_LDFLAGS $HDF5_LIBS $HDF5_CPPFLAGS in $ff_where_lib_conf \"" >&6;} fi LIBS="$LIBS $HDF5_LDFLAGS $HDF5_LIBS" fi else enable_iohdf5=no fi # Check whether --enable-iohdf5 was given. if test "${enable_iohdf5+set}" = set; then : enableval=$enable_iohdf5; fi if test "$enable_iohdf5" = "no" then TOOL_COMPILE_iohdf5="" TOOL_DYLIB_iohdf5="" elif test "$ff_iohdf5_ok" = "yes" ; then TOOL_DYLIB_iohdf5=iohdf5.$DYLIB_SUFFIX enable_iohdf5_download=no else TOOL_COMPILE_iohdf5=iohdf5 TOOL_DYLIB_iohdf5=iohdf5.$DYLIB_SUFFIX enable_iohdf5_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-iohdf5_include was given. if test "${with_iohdf5_include+set}" = set; then : withval=$with_iohdf5_include; fi # Check whether --with-iohdf5_ldflags was given. if test "${with_iohdf5_ldflags+set}" = set; then : withval=$with_iohdf5_ldflags; fi # Check whether --enable-download-iohdf5 was given. if test "${enable_download_iohdf5+set}" = set; then : enableval=$enable_download_iohdf5; fi if test "$with_iohdf5_include" != "" || test "$with_iohdf5_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_iohdf5" ; then echo "iohdf5 LD $with_iohdf5_ldflags" >>$ff_where_lib_conf test -n "$with_iohdf5_include" && echo "iohdf5 INCLUDE $with_iohdf5_include " >>$ff_where_lib_conf ff_where_lib_conf_iohdf5=1 ff_where_lib_iohdf5="$with_iohdf5_ldflags" ff_where_inc_iohdf5="$with_iohdf5_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add iohdf5 : $with_iohdf5_ldflags $with_iohdf5_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add iohdf5 : $with_iohdf5_ldflags $with_iohdf5_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add iohdf5 : $with_iohdf5_ldflags $with_iohdf5_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add iohdf5 : $with_iohdf5_ldflags $with_iohdf5_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_iohdf5="" enable_iohdf5_download=no fi if test "$OS" = Windows_NT; then FFCS_WINDOWS_TRUE= FFCS_WINDOWS_FALSE='#' else FFCS_WINDOWS_TRUE='#' FFCS_WINDOWS_FALSE= fi # remove gsl if not find ... FH # correction FH .. 18/12/2013. # ALH - 7/1/14 - not able to compile gsl or pardiso with FFCS on Windows if test "$enable_ffcs" != yes then if test "$ff_where_lib_conf_gsl" = 1 -a "$enable_gsl" != "no" ; then enable_gsl=yes; fi; if test "$ff_where_lib_conf_mkl" = 1 -a "$enable_mkl" != "no" ; then enable_pardiso=yes; fi; fi # Check whether --enable-gsl was given. if test "${enable_gsl+set}" = set; then : enableval=$enable_gsl; fi if test "$enable_gsl" = "no" then TOOL_COMPILE_gsl="" TOOL_DYLIB_gsl="" elif test "$ff_gsl_ok" = "yes" ; then TOOL_DYLIB_gsl="gsl.$DYLIB_SUFFIX" enable_gsl_download=no else TOOL_COMPILE_gsl=gsl TOOL_DYLIB_gsl="gsl.$DYLIB_SUFFIX" enable_gsl_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-gsl_include was given. if test "${with_gsl_include+set}" = set; then : withval=$with_gsl_include; fi # Check whether --with-gsl_ldflags was given. if test "${with_gsl_ldflags+set}" = set; then : withval=$with_gsl_ldflags; fi # Check whether --enable-download-gsl was given. if test "${enable_download_gsl+set}" = set; then : enableval=$enable_download_gsl; fi if test "$with_gsl_include" != "" || test "$with_gsl_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_gsl" ; then echo "gsl LD $with_gsl_ldflags" >>$ff_where_lib_conf test -n "$with_gsl_include" && echo "gsl INCLUDE $with_gsl_include " >>$ff_where_lib_conf ff_where_lib_conf_gsl=1 ff_where_lib_gsl="$with_gsl_ldflags" ff_where_inc_gsl="$with_gsl_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add gsl : $with_gsl_ldflags $with_gsl_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add gsl : $with_gsl_ldflags $with_gsl_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add gsl : $with_gsl_ldflags $with_gsl_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add gsl : $with_gsl_ldflags $with_gsl_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_gsl="" enable_gsl_download=no fi # Check whether --enable-NewSolver was given. if test "${enable_NewSolver+set}" = set; then : enableval=$enable_NewSolver; fi if test "$enable_NewSolver" = "no" then TOOL_COMPILE_NewSolver="" TOOL_DYLIB_NewSolver="" elif test "$ff_NewSolver_ok" = "yes" ; then TOOL_DYLIB_NewSolver="NewSolver.$DYLIB_SUFFIX" enable_NewSolver_download=no else TOOL_COMPILE_NewSolver=NewSolver TOOL_DYLIB_NewSolver="NewSolver.$DYLIB_SUFFIX" enable_NewSolver_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-NewSolver_include was given. if test "${with_NewSolver_include+set}" = set; then : withval=$with_NewSolver_include; fi # Check whether --with-NewSolver_ldflags was given. if test "${with_NewSolver_ldflags+set}" = set; then : withval=$with_NewSolver_ldflags; fi # Check whether --enable-download-NewSolver was given. if test "${enable_download_NewSolver+set}" = set; then : enableval=$enable_download_NewSolver; fi if test "$with_NewSolver_include" != "" || test "$with_NewSolver_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_NewSolver" ; then echo "NewSolver LD $with_NewSolver_ldflags" >>$ff_where_lib_conf test -n "$with_NewSolver_include" && echo "NewSolver INCLUDE $with_NewSolver_include " >>$ff_where_lib_conf ff_where_lib_conf_NewSolver=1 ff_where_lib_NewSolver="$with_NewSolver_ldflags" ff_where_inc_NewSolver="$with_NewSolver_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add NewSolver : $with_NewSolver_ldflags $with_NewSolver_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add NewSolver : $with_NewSolver_ldflags $with_NewSolver_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add NewSolver : $with_NewSolver_ldflags $with_NewSolver_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add NewSolver : $with_NewSolver_ldflags $with_NewSolver_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_NewSolver="" enable_NewSolver_download=no fi # Check whether --enable-pardiso was given. if test "${enable_pardiso+set}" = set; then : enableval=$enable_pardiso; fi if test "$enable_pardiso" = "no" then TOOL_COMPILE_pardiso="" TOOL_DYLIB_pardiso="" elif test "$ff_pardiso_ok" = "yes" ; then TOOL_DYLIB_pardiso="PARDISO.$DYLIB_SUFFIX" enable_pardiso_download=no else TOOL_COMPILE_pardiso=pardiso TOOL_DYLIB_pardiso="PARDISO.$DYLIB_SUFFIX" enable_pardiso_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-pardiso_include was given. if test "${with_pardiso_include+set}" = set; then : withval=$with_pardiso_include; fi # Check whether --with-pardiso_ldflags was given. if test "${with_pardiso_ldflags+set}" = set; then : withval=$with_pardiso_ldflags; fi # Check whether --enable-download-pardiso was given. if test "${enable_download_pardiso+set}" = set; then : enableval=$enable_download_pardiso; fi if test "$with_pardiso_include" != "" || test "$with_pardiso_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_pardiso" ; then echo "pardiso LD $with_pardiso_ldflags" >>$ff_where_lib_conf test -n "$with_pardiso_include" && echo "pardiso INCLUDE $with_pardiso_include " >>$ff_where_lib_conf ff_where_lib_conf_pardiso=1 ff_where_lib_pardiso="$with_pardiso_ldflags" ff_where_inc_pardiso="$with_pardiso_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add pardiso : $with_pardiso_ldflags $with_pardiso_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add pardiso : $with_pardiso_ldflags $with_pardiso_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add pardiso : $with_pardiso_ldflags $with_pardiso_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add pardiso : $with_pardiso_ldflags $with_pardiso_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_pardiso="" enable_pardiso_download=no fi echo "debug cxxx11: $ff_cxx11 mpi: $ff_mpi petsc: $ff_petsc_ok " test "$enable_hpddm" != no && enable_hpddm=yes test "$ff_cxx11" != yes -o "$ff_mpi" != yes -o \( "$ff_umfpack_ok" != "yes" -a "$ff_mumps_ok" != "yes" \) && enable_hpddm=no FF_PETSC_DYLIB="" if test "$ff_petsc_ok" != no ; then FF_PETSC_DYLIB="PETSc.$DYLIB_SUFFIX" fi if test "$ff_petsccomplex_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB PETSc-complex.$DYLIB_SUFFIX" fi if test "$ff_slepccomplex_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc-complex.$DYLIB_SUFFIX" fi if test "$ff_slepc_ok" != no ; then FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc.$DYLIB_SUFFIX" fi ##echo @@@@@@@@@@@@ $ff_petsc_ok @@ "hpddm.$DYLIB_SUFFIX $FF_PETCS_DYLIB" # Check whether --enable-hpddm was given. if test "${enable_hpddm+set}" = set; then : enableval=$enable_hpddm; fi if test "$enable_hpddm" = "no" then TOOL_COMPILE_hpddm="" TOOL_DYLIB_hpddm="" elif test "$ff_hpddm_ok" = "yes" ; then TOOL_DYLIB_hpddm="hpddm.$DYLIB_SUFFIX hpddm_substructuring.$DYLIB_SUFFIX $FF_PETSC_DYLIB" enable_hpddm_download=no else TOOL_COMPILE_hpddm=hpddm TOOL_DYLIB_hpddm="hpddm.$DYLIB_SUFFIX hpddm_substructuring.$DYLIB_SUFFIX $FF_PETSC_DYLIB" enable_hpddm_download=yes fi # Also allow to disable the download of one tool if it is already locally installed # Check whether --with-hpddm_include was given. if test "${with_hpddm_include+set}" = set; then : withval=$with_hpddm_include; fi # Check whether --with-hpddm_ldflags was given. if test "${with_hpddm_ldflags+set}" = set; then : withval=$with_hpddm_ldflags; fi # Check whether --enable-download-hpddm was given. if test "${enable_download_hpddm+set}" = set; then : enableval=$enable_download_hpddm; fi if test "$with_hpddm_include" != "" || test "$with_hpddm_ldflags" != "" then # some directives have been specified, use them instead of downloading if test -z "$ff_where_lib_conf_hpddm" ; then echo "hpddm LD $with_hpddm_ldflags" >>$ff_where_lib_conf test -n "$with_hpddm_include" && echo "hpddm INCLUDE $with_hpddm_include " >>$ff_where_lib_conf ff_where_lib_conf_hpddm=1 ff_where_lib_hpddm="$with_hpddm_ldflags" ff_where_inc_hpddm="$with_hpddm_include" { $as_echo "$as_me:${as_lineno-$LINENO}: ++ add hpddm : $with_hpddm_ldflags $with_hpddm_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: ++ add hpddm : $with_hpddm_ldflags $with_hpddm_include in $ff_where_lib_conf \"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: -- do not add hpddm : $with_hpddm_ldflags $with_hpddm_include in $ff_where_lib_conf \"" >&5 $as_echo "$as_me: -- do not add hpddm : $with_hpddm_ldflags $with_hpddm_include in $ff_where_lib_conf \"" >&6;} fi TOOL_COMPILE_hpddm="" enable_hpddm_download=no fi # All makefiles ac_config_files="$ac_config_files Makefile download/Makefile download/blas/Makefile download/arpack/Makefile download/umfpack/Makefile download/fftw/Makefile src/Makefile src/bamglib/Makefile src/Graphics/Makefile src/femlib/Makefile src/Algo/Makefile src/lglib/Makefile src/fflib/Makefile src/nw/Makefile src/mpi/Makefile src/bamg/Makefile src/libMesh/Makefile src/medit/Makefile src/bin-win32/Makefile examples++-load/Makefile examples++-tutorial/Makefile examples++/Makefile examples++-mpi/Makefile examples++-hpddm/Makefile examples++-eigen/Makefile examples++-chapt3/Makefile examples++-bug/Makefile examples++-other/Makefile examples++-3d/Makefile" 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:${as_lineno-$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= ;; #( *) { eval $ac_var=; 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$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= U= 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. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FFCS_TRUE}" && test -z "${ENABLE_FFCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FFCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FFCS_MPIOK_TRUE}" && test -z "${FFCS_MPIOK_FALSE}"; then as_fn_error $? "conditional \"FFCS_MPIOK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FFCS_WINDOWS_TRUE}" && test -z "${FFCS_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"FFCS_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_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 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 # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (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 # 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. as_myself= 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 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi 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'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { 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_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 FreeFem++ $as_me 3.61-1, which was generated by GNU Autoconf 2.69. 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 and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, 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 ." _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.61-1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= 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 ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; 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"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append 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 as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --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_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append 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" _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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "download/Makefile") CONFIG_FILES="$CONFIG_FILES download/Makefile" ;; "download/blas/Makefile") CONFIG_FILES="$CONFIG_FILES download/blas/Makefile" ;; "download/arpack/Makefile") CONFIG_FILES="$CONFIG_FILES download/arpack/Makefile" ;; "download/umfpack/Makefile") CONFIG_FILES="$CONFIG_FILES download/umfpack/Makefile" ;; "download/fftw/Makefile") CONFIG_FILES="$CONFIG_FILES download/fftw/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/bamglib/Makefile") CONFIG_FILES="$CONFIG_FILES src/bamglib/Makefile" ;; "src/Graphics/Makefile") CONFIG_FILES="$CONFIG_FILES src/Graphics/Makefile" ;; "src/femlib/Makefile") CONFIG_FILES="$CONFIG_FILES src/femlib/Makefile" ;; "src/Algo/Makefile") CONFIG_FILES="$CONFIG_FILES src/Algo/Makefile" ;; "src/lglib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lglib/Makefile" ;; "src/fflib/Makefile") CONFIG_FILES="$CONFIG_FILES src/fflib/Makefile" ;; "src/nw/Makefile") CONFIG_FILES="$CONFIG_FILES src/nw/Makefile" ;; "src/mpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/mpi/Makefile" ;; "src/bamg/Makefile") CONFIG_FILES="$CONFIG_FILES src/bamg/Makefile" ;; "src/libMesh/Makefile") CONFIG_FILES="$CONFIG_FILES src/libMesh/Makefile" ;; "src/medit/Makefile") CONFIG_FILES="$CONFIG_FILES src/medit/Makefile" ;; "src/bin-win32/Makefile") CONFIG_FILES="$CONFIG_FILES src/bin-win32/Makefile" ;; "examples++-load/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-load/Makefile" ;; "examples++-tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-tutorial/Makefile" ;; "examples++/Makefile") CONFIG_FILES="$CONFIG_FILES examples++/Makefile" ;; "examples++-mpi/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-mpi/Makefile" ;; "examples++-hpddm/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-hpddm/Makefile" ;; "examples++-eigen/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-eigen/Makefile" ;; "examples++-chapt3/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-chapt3/Makefile" ;; "examples++-bug/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-bug/Makefile" ;; "examples++-other/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-other/Makefile" ;; "examples++-3d/Makefile") CONFIG_FILES="$CONFIG_FILES examples++-3d/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # 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 ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /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 {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 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 >>"\$ac_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 ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { 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 } print line } _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 < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// 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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 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 ' >$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_fn_error $? "could not setup config headers machinery" "$LINENO" 5 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_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[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="$ac_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_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append 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:${as_lineno-$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 >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 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"; as_fn_mkdir_p 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:${as_lineno-$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" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 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:${as_lineno-$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"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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"` # 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'`; 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; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: freefem++ used download : $enable_download " >&5 $as_echo "$as_me: freefem++ used download : $enable_download " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- Dynamic load facility: $ff_dynload " >&5 $as_echo "$as_me: -- Dynamic load facility: $ff_dynload " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- ARPACK (eigen value): $ff_arpack_ok " >&5 $as_echo "$as_me: -- ARPACK (eigen value): $ff_arpack_ok " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- UMFPACK (sparse solver) $ff_umfpack_ok " >&5 $as_echo "$as_me: -- UMFPACK (sparse solver) $ff_umfpack_ok " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- BLAS $ff_blas_ok " >&5 $as_echo "$as_me: -- BLAS $ff_blas_ok " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- with MPI $ff_mpi" >&5 $as_echo "$as_me: -- with MPI $ff_mpi" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: -- with PETSC $ff_petsc_ok / PETSC complex $ff_petsccomplex_ok " >&5 $as_echo "$as_me: -- with PETSC $ff_petsc_ok / PETSC complex $ff_petsccomplex_ok " >&6;}; { $as_echo "$as_me:${as_lineno-$LINENO}: -- with hpddm $enable_hpddm (need MPI & c++11 : $ff_cxx11 ) " >&5 $as_echo "$as_me: -- with hpddm $enable_hpddm (need MPI & c++11 : $ff_cxx11 ) " >&6;}; { $as_echo "$as_me:${as_lineno-$LINENO}: progs: $ff_progs " >&5 $as_echo "$as_me: progs: $ff_progs " >&6;} if test "$ff_umfpack_download" = yes -a -n "$TOOL_COMPILE_umfpack" ;then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download UMFPACK see download/umfpack/SuiteSparse/UMFPACK/README.txt for the License" >&5 $as_echo "$as_me: use of download UMFPACK see download/umfpack/SuiteSparse/UMFPACK/README.txt for the License" >&6;} fi if test "$ff_arpack_download" = yes -a -n "$TOOL_COMPILE_arpack" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download ARPACK see download/arpack/ARPACK/README no License " >&5 $as_echo "$as_me: use of download ARPACK see download/arpack/ARPACK/README no License " >&6;} fi if test "$enable_download" = yes ;then if test -n "$TOOL_COMPILE_fftw3" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download fftw see download/fftw/fftw-3.2/COPYRIGHT " >&5 $as_echo "$as_me: use of download fftw see download/fftw/fftw-3.2/COPYRIGHT " >&6;} fi if test -n "$TOOL_COMPILE_tetgen" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download tetgen see download/tetgen/tetgen1.5.1-beta/LICENSE " >&5 $as_echo "$as_me: use of download tetgen see download/tetgen/tetgen1.5.1-beta/LICENSE " >&6;} fi if test -n "$TOOL_COMPILE_yams" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download freeyams see download/yams/freeyams.2011.02.22 (suface mesh adaptation) " >&5 $as_echo "$as_me: use of download freeyams see download/yams/freeyams.2011.02.22 (suface mesh adaptation) " >&6;} fi if test -n "$TOOL_COMPILE_mmg3d" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download mmg3d (v4) see download/mmg3d/mmg3d4/LICENCE.txt " >&5 $as_echo "$as_me: use of download mmg3d (v4) see download/mmg3d/mmg3d4/LICENCE.txt " >&6;} fi if test -n "$TOOL_COMPILE_parmets" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download parmetis" >&5 $as_echo "$as_me: use of download parmetis" >&6;} fi # ALH - some tools may be activated but not downloaded if a local version is specified (see # [[TOOL_PARAMETERS]]) if test "$enable_superlu_download" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download superlu" >&5 $as_echo "$as_me: use of download superlu" >&6;} fi if test -n "$MPICC" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: try to download: blacs parmetis scalapack scotch superludist pastix hypre hips library" >&5 $as_echo "$as_me: try to download: blacs parmetis scalapack scotch superludist pastix hypre hips library" >&6;} fi if test "$ff_download_blas" = "generic" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: use of download generic blas and cblas freefem may be slow " >&5 $as_echo "$as_me: use of download generic blas and cblas freefem may be slow " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: you can try to use the Kazushige Goto s BLAS at http://www.cs.utexas.edu/users/flame/goto/ " >&5 $as_echo "$as_me: you can try to use the Kazushige Goto s BLAS at http://www.cs.utexas.edu/users/flame/goto/ " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: or at http://www.tacc.utexas.edu/~kgoto/ for the best BLAS ." >&5 $as_echo "$as_me: or at http://www.tacc.utexas.edu/~kgoto/ for the best BLAS ." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: or try to download/compile the altas blas ." >&5 $as_echo "$as_me: or try to download/compile the altas blas ." >&6;} fi # ALH - 30/10/13 - (request from FH) all downloads are now part of a separate script ([[file:download/getall]]) # which needs to be run before make for the user to specify whether he is ok with each of the package licences. { $as_echo "$as_me:${as_lineno-$LINENO}: Please run \"download/getall\" to download all necessary packages before running make" >&5 $as_echo "$as_me: Please run \"download/getall\" to download all necessary packages before running make" >&6;} fi # FFCS does not use glut, so remove this message because it could make the user think that something is broken if test $enable_ffcs = no then if test "$ff_glut_ok" != yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: *********************************************** " >&5 $as_echo "$as_me: *********************************************** " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: you do not have the new grachics tools " >&5 $as_echo "$as_me: WARNING: you do not have the new grachics tools " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: because the configure do not find OpenGL, GLUT or pthread developer stuff " >&5 $as_echo "$as_me: because the configure do not find OpenGL, GLUT or pthread developer stuff " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: read the README to find missing package " >&5 $as_echo "$as_me: read the README to find missing package " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: F. Hecht " >&5 $as_echo "$as_me: F. Hecht " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: to install missing package under debian or ubuntu, try: sudo apt-get install freeglut3-dev " >&5 $as_echo "$as_me: to install missing package under debian or ubuntu, try: sudo apt-get install freeglut3-dev " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: *********************************************** " >&5 $as_echo "$as_me: *********************************************** " >&6;} fi fi # Local Variables: # mode:shell-script # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/ylwrap000755 000767 000024 00000007644 13256636774 015102 0ustar00hechtstaff000000 000000 #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. # Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. # Usage: # ylwrap INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... # * INPUT is the input file # * OUTPUT is file PROG generates # * DESIRED is file we actually want # * PROGRAM is program to run # * ARGS are passed to PROG # Any number of OUTPUT,DESIRED pairs may be used. # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed -e 's,\\\\,\\\\\\\\,g' -e 's,\\.,\\\\.,g'` echo "got $input_rx" pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname $prog ${1+"$@"} "$input" status=$? if test $status -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # Edit out `#line' or `#' directives. We don't want the # resulting debug information to point at an absolute srcdir; # it is better for it to just mention the .y file with no # path. sed -e "/^#/ s,$input_rx,," "$from" > "$target" || status=$? else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then status=1 fi fi shift shift first=no done else status=$? fi # Remove the directory. cd .. rm -rf $dirname exit $status freefem++-3.61-1/FreeFem++-CoCoa.in000755 000767 000024 00000002560 13256636774 016602 0ustar00hechtstaff000000 000000 #!/bin/sh # # EXTENSIONS : ".edp" # Accepted file extentions # OSTYPES : "****" # Accepted file types # ROLE : None # Role (Editor, Viewer, None) # SERVICEMENU : FreeFem++ # Name of Service menu item # dir=`dirname $0`; ff="@bindir@/FreeFem++" fa="-glut ffglut " q="'" end="exit;" begin="cd $PWD;" # begin the cmd generation ---------- cmd="" # ----------------- for i in "$@"; do d=`dirname "$i"`; f=`basename "$i"`; if [ -f "$i" ] ; then np=`awk -v npo=$np '$1=="//" && $2=="NBPROC" { if( vv == ""){ print $3;}; vv=1}' "$i"` npa=`awk -v npo=$np '$1=="//" && $2=="PARAM" { if( vv == ""){ for(i=3;i<=NF;++i)print $i;}; vv=1}' "$i"` # echo --- $np -- $npa -------- if [ "0$np" -gt 0 ] ; then test -n "@TEST_FFPPMPI@" && ff="@bindir@/ff-mpirun -np $np" fi if [ -n "$npa" ] ; then fa="$fa $npa"; fi cmd="$cmd cd $q$d$q; $ff $q$f$q $fa ;" fi done # ------------------ if [ -z "$cmd" ]; then cmd="$ff;" fi # ------------------ cmd="$cmd" # ---- end of cmd generation ---- echo 'do script "'$cmd'"' # # # send the command $cmd to the apple terminal via osascript # # (echo $0;echo $*;echo "--$TERM--";printenv;set) >/tmp/tutu if [ -z "$TERM_PROGRAM" ] ; then echo ' tell application "Terminal" activate try do script "'$begin$cmd$end'" end try end tell ' | osascript else set -e eval $cmd fi; freefem++-3.61-1/ChangeLog000644 000767 000024 00000035057 13256636773 015406 0ustar00hechtstaff000000 000000 2005-05-03 16:25 hecht * remove pascal in "\p " macos version 2005-05-03 15:12 hecht * try to compile with de idm compiler xlc++ work in progress remove 10^10 an 10.^10 (FH) 2005-05-02 10:57 hecht * do correction for g++-4.0 remove const in Expression type 2005-04-27 14:23 hecht * do correction for g++ version 4.0 (new apple compiler on Tiger) small change in RNM and cadna (FH) 2005-04-22 11:58 lehyaric * Debug checks are ok on Debian Testing 2005-04-17 18:44 hecht * add page to explain how to bluid weak form with Robin / Neumann coundary condition 2005-04-16 21:36 hecht * add tool to solve variationnal inequality add change version to 1.46-1 2005-04-15 22:48 hecht * the 2 new example have probleme with testhighlight.sh we disable the test in chech (FH) 2005-04-15 22:06 hecht * add tools to solve variationnal inequality let d en array and A a square matrix (in .edp) d=A.diag; // get the diagonal of the matrix A.diag = d; //set the diagonal set(A,solver=CG); // important to change precondiconning before solving 2005-04-13 11:58 lehyaric * IDE compiles again under MingW (an include file was missing) 2005-04-12 18:37 hecht * add Modification Kohji Ohtsuka in a manual try too correct problem in eigen value in no symetric cas (??) 2005-04-12 12:07 hecht * add flags to build unionkjack mesh on square example: mesh Th=square(nn,mm,[x/ddx,y/ddy] ,flags=1); 2005-04-05 15:08 lehyaric * FreeFem+-ide compiles on MacOS X 2005-04-05 14:33 lehyaric * First version of FreeFem++-ide without sockets compiles under Linux 2005-03-30 11:38 hecht * correct name of example blakschol.edp in BlackSchole.edp add file in distribution archive (logo2.ico) 2005-03-30 11:05 hecht * add src/ide/testhighlight.sh in distributed file (src/ide/Makefile.am) FH 2005-03-30 11:02 lehyaric * Not regenerating HISTORY if not in a CVS working area 2005-03-30 10:42 hecht * correct some mistake in Makefile.am (in: examples++-load/, src/ide/) 2005-03-30 09:31 hecht * adding 2 new files for allocation (forgot in previous commit) 2005-03-29 23:13 hecht * Big change in code generation alloc (work in progress) to remove all undelete pointer. May be correct trap in arpack++ (alloction problem not sure, very strange thing) Put 1-46-0 version number Inforce compile in example-load remark, all test work on my Mac, FH. 2005-03-25 17:59 hecht * correct bug in trunc function: The bug is the mesh have hole the we get a mesh with triangle in the hole: border a(t=0,2*pi){ x=cos(t); y=sin(t);label=1;} border b(t=0,2*pi){ x=0.3+0.3*cos(t); y=0.3*sin(t);label=2;} mesh Thwithhole = buildmesh(a(50)+b(-30)); mesh Th2=trunc(Thwithhole,1,split=2,label=2); 2005-03-25 14:54 lehyaric * Compiling ok on Linux 2005-03-25 12:37 lehyaric * Client and server merged into one unique executable to make sure that the client can find its server program, even through symbolic links. 2005-03-17 14:15 lehyaric * Included src/lglib/lg.tab.?pp in cleanregen.sh 2005-03-17 14:13 lehyaric * Replaced sem_getvalue() with a separate counter on MacOSX. 2005-03-16 22:28 hecht * add tool to get number of mesh triangle contening a point (x,y) or to get the region number example: int it00 = Th(0.55,0.6).nuTriangle; // get the number of Th's triangle contening (0.55,0.6) int nr00 = Th(0.55,0.6).region;; // get the region number of Th's triangle contening (0.55,0.6) 2005-03-16 15:37 hecht * correct prototype of StrVersionNumber in macrgraf 2005-03-16 15:05 lehyaric * Updates to the no-F77 no-C configuration 2005-03-16 14:41 lehyaric * Fortran and C compilers are now optional (if they are missing, we just don't compile the libraries that need them). 2005-03-16 12:08 hecht * correct error in prototype of StrVersionNumber and add precision to show the correct version number 2005-03-13 16:32 hecht * correct compilation problem in RNM (resize) with g++3.4 (add this->) 2005-03-02 11:50 lehyaric * Correcting compilation problem on RedHat 2005-03-02 11:29 lehyaric * New packaging including FreeFem++-cs features: fast graphics, grammar highlighting, error-line display 2005-03-02 11:22 lehyaric * FreeFem++-cs MinGW bug corrected: does not crash anymore when reading a file name from the command line 2005-03-01 16:06 lehyaric * Removed unnecessary #includes 2005-03-01 15:33 lehyaric * Simplified startup code. Hopefully, this will stop the MinGW segmentation fault bug (at startup when a filename is specified on the command line), but this is not proven yet. 2005-03-01 14:21 lehyaric * Segmentation violation error while loading a file from the command line in FreeFem++-cs. Debugging in progress. 2005-02-28 18:06 lehyaric * Now compiling fine under Cygwin 2005-02-28 11:40 lehyaric * Now compiling fine on MinGW 2005-02-28 11:27 lehyaric * Removed use of regex.h since it is not available under MinGW. 2005-02-25 16:28 lehyaric * Corrected a small compilation error. 2005-02-25 16:14 lehyaric * FreeFem++-cs: compile-time or runtime errors are now highlighted in the editor (the corresponding line number is extracted from all the server messages thanks to a regex). 2005-02-25 13:10 lehyaric * More coherency checks in configure.ac for a correct MPI installation. 2005-02-25 10:50 lehyaric * Added new "resize" reserved word into the highlighting grammar. 2005-02-24 21:27 hecht * correct the documentation 2005-02-24 20:44 hecht * correct mistake in return type in complex mean and jump new function (FH) 2005-02-24 15:33 hecht * resize of array and matrices, continuing 2005-02-24 15:32 hecht * add resize of int,real and complex array or matrices, exemple: real [int] tab2=[1,2,3,3.14]; tab2.resize(10); // to set the new siez of array to 10 2005-02-24 15:08 lehyaric * Grammar-driven highlighting works. Regression tests for it are included in "make check". Include file and macros are not scanned during highlighting. 2005-02-24 09:44 hecht * correct bug in array of complex FE function like Vh[int] Wh(10); // where Vh is a fespace 2005-02-23 15:51 lehyaric * Highlighting test procedure not ready for regression tests yet: disabled from "make check". 2005-02-23 15:40 lehyaric * Renamed some FreeFem++ tokens to avoid collisions with system-dependant defines. 2005-02-23 15:37 lehyaric * Properly compiled lex and yacc source, for machines that do not have working versions of lex or yacc. 2005-02-23 15:35 lehyaric * No CVS keyword in lex and yacc source files to avoid recompiling them after a "cvs commit" on machines that do not have proper versions of this software. 2005-02-23 15:22 lehyaric * "testhighlight" regression tests now work up to (but not including) array.edp 2005-02-23 14:50 lehyaric * Added highlighting grammar files into CVS, in case the compiling environment does not include a working version of bison or lex. 2005-02-23 13:44 lehyaric * The HISTORY file is now created from CVS logs thanks to "cvs2cl". Previous HISTORY items are saved as HISTORY_BEFORE_2005. 2005-02-23 12:45 lehyaric * FreeFem++-cs: grammar-driven syntax highlighting works on (examples++-tutorial/...) Laplace.edp, adapt.edp and adaptindicatorP1.edp (ALH) 2005-02-23 10:49 hecht * add jump and mean of complex function. 2005-02-22 17:37 lehyaric * FreeFem++-cs: grammar-driven highlighting procedure works on (examples++-tutorial/) Laplace.edp and adapt.edp. 2005-02-18 20:13 lehyaric * FreeFem++-cs syntax highlighting is now highlights keywords based on their location in the input buffer, which removes any need for backtracking in the bison grammar. The grammar is now much simpler thanks to this. 2005-02-18 18:00 hecht * ajoute d'un test d'erreur 2005-02-17 16:54 lehyaric * Progressive updates to the highlighting grammar. 2005-02-17 16:02 lehyaric * Added new developments 2005-02-17 15:05 lehyaric * Compiles on MacOS X. 2005-02-17 15:05 lehyaric * Grammar-driven highlighting now includes macros (but it stops highlighting a macro at the first "/"). 2005-02-17 14:27 lehyaric * First working version of syntax highlighting through grammar file in FreeFem++-cs editor. 2005-02-16 18:13 hecht * 3D continuing + truc 2005-02-16 13:44 lehyaric * Socket buffering is now limited to avoid random communication errors. 2005-02-16 12:29 lehyaric * Buffered socket writes implemented in FreeFem++-cs 2005-02-15 14:30 lehyaric * Corrected comments 2005-02-15 14:19 lehyaric * FreeFem++-cs binary TCP flux optimized. 2005-02-14 17:22 lehyaric * Socket communication between client and server in FreeFem++-cs has been translated into binary format for speed. 2005-02-14 11:50 lehyaric * Small spelling mistake 2005-02-11 22:20 hecht * complet DOC 2005-02-11 18:00 hecht * add 2 new quadrature formular qf7pT and qf9pT with respectively 15 and 21 points add P2b a new finite element : P2 + bubble 2005-02-11 15:57 lehyaric * Now drag'n'drop and copy/paste work concurrently in the FreeFem++-cs editor window. 2005-02-08 17:26 hecht * add 3D stuff in quadtree 2005-02-08 16:52 lehyaric * Updated TODO list for FreeFem++-cs 2005-02-08 16:18 lehyaric * Dynamic loading is now disabled if dlopen() does not link properly (bug reported by Haiko Etzel) 2005-02-08 15:18 hecht * add buildmesh example with nbvx= named parameter 2005-02-08 14:23 lehyaric * New Debian package 2005-02-04 16:47 lehyaric * Now checks that FLTK is compiled with threads before accepting it. 2005-02-04 16:24 lehyaric * Patchs de configuration proposs par Thierry Thomas pour FreeBSD intgrs. 2005-02-04 15:30 hecht * beginning of 3D version 2005-02-01 17:17 lehyaric * Compiles on MacOS X 2005-02-01 16:49 lehyaric * New script to remove generated files (in order to prevent CVS conflicts) 2005-02-01 16:04 lehyaric * FreeFem++-cs compiling and running on Windows with fully blocking sockets 2005-02-01 15:01 lehyaric * Cosmetic change 2005-02-01 14:38 lehyaric * FreeFem++-cs works with fully-blocking sockets on Linux. src/fflib/strversionnumber.m4 added to distribution list. 2005-02-01 12:40 lehyaric * Still problems with blocking communication. But FreeFem++-cs compiles 2005-02-01 12:20 lehyaric * Reverting FreeFem++-cs to blocking IO because of Microsoft Windows problems 2005-01-31 15:21 lehyaric * New version number in makefiles. 2005-01-31 15:17 lehyaric * Default version number now includes package number. Build date changes at each build. 2005-01-31 14:07 lehyaric * Problem with busy waiting under Windows solved. Change in version numbering variables (see configure.ac). 2005-01-29 10:15 hecht * end g++3.4 correction on hydre CV: ---------------------------------------------------------------------- 2005-01-29 09:56 hecht * correct some compile error with g++ 3.4 CV ---------------------------------------------------------------------- 2005-01-28 14:52 lehyaric * Corrected "cannot open '-psn_xxx' document" error on MacOS. 2005-01-28 14:00 lehyaric * FreeFem++-cs compiles+runs ok on MacOS X 2005-01-28 13:27 lehyaric * Windows packaging for new improved socket implementation 2005-01-28 12:01 lehyaric * ecompiling ok on Windows. 2005-01-28 11:28 lehyaric * Still trying to resolve discrepancies between Linux and Windows sockets. 2005-01-27 19:01 hecht * correct ; placement in if ... 2005-01-27 18:30 hecht * pour mettre les makefile.in ok 2005-01-27 18:14 hecht * mac install continuing 2005-01-27 18:07 hecht * continuing coorect of macos application installation 2005-01-27 17:16 lehyaric * Reorganising socket communication in FreeFem++-cs because of instabilities on Windows. 2005-01-27 10:59 lehyaric * Drag'n'drop works with Mozilla Firefox for Windows. FreeFem++-cs documentation updated. 2005-01-26 23:34 hecht * add .app.tgz of macos application 2005-01-26 23:31 hecht * correct pb dvi pdf in manual.tex 2005-01-26 23:25 hecht * correct stuff in dist generation correct trouble in configure.ac and tar.gz file 2005-01-26 23:22 hecht * correct problem dvi and pdf chose make lot of small change in configure.ac ... 2005-01-26 17:50 hecht * coorect macos X application) 2005-01-26 17:35 lehyaric * Drag'n'drop works with mozilla-firefox under X11. 2005-01-26 13:58 lehyaric * In configure.ac, PACKAGE_VERSION is already used by autoconf, so we create 'FREEFEM_PACKAGING' instead. 2005-01-26 12:11 lehyaric * Drag'n'drop is now working in FreeFem++-cs. 2005-01-26 11:30 lehyaric * Drag'n'drop being implemented. 2005-01-24 11:28 hecht * add named parameter nbtx=.. in buildmesh function to change the default maximal number of vertex in the build mesh. 2005-01-20 20:10 hecht * Correct a segfault if second derivative of test function exist in problem definition. The Change in problem.cpp: resize : KN buf(Vh.MaximalNbOfDF()*3*Vh.N); to : KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N); 2005-01-20 10:39 hecht * correct parameter passing () in macro argument correct linear combination of sparce matrix. 2005-01-11 13:38 lehyaric * FreeFem++-cs compiles with cygwin. It is not tested yet. File paths may be a problem. 2005-01-10 22:19 hecht * change c i C in speedtest.sh to get Cholesky cpu time 2005-01-10 14:03 hecht * add forgotten file .pdf 2005-01-10 12:07 hecht * window problem continue 2005-01-10 10:41 hecht * correct ???? configure.ac under window 2005-01-07 17:05 hecht * correct expand string in macro 2005-01-07 15:55 hecht * add config.h.in 2005-01-07 12:25 lehyaric * Cosmetic change 2005-01-07 11:50 hecht * correct initialisation in solve in case of un set variable 2005-01-06 21:58 hecht * rewrite the macro generation tool to be more to suppress some bug in argument subtition correct error in line numbering in case of newline in string cosmetic change in output 2005-01-05 23:10 hecht * update HISTORY file 2005-01-05 21:50 hecht * correct segmentation violation error if some FE variable is un set before solving problem because we use this variable to initialise data. 2005-01-04 16:58 hecht * continuing int1d(Th,3,qfe=qf1pElump)( 2005-01-04 16:45 hecht * add qf1pElump new quadrature formular in int1d() ... freefem++-3.61-1/AUTHORS000644 000767 000024 00000000234 13256636773 014671 0ustar00hechtstaff000000 000000 Frdric Hecht Olivier Pironneau Antoine Le Hyaric Albert Ly freefem++-3.61-1/examples++/000755 000767 000024 00000000000 13321644113 015542 5ustar00hechtstaff000000 000000 freefem++-3.61-1/web/000755 000767 000024 00000000000 13321644107 014356 5ustar00hechtstaff000000 000000 freefem++-3.61-1/examples++-eigen/000755 000767 000024 00000000000 13321644114 016630 5ustar00hechtstaff000000 000000 freefem++-3.61-1/acoptim.m4000644 000767 000024 00000020150 13256636774 015517 0ustar00hechtstaff000000 000000 # Choosing debugging and/or optimization flags for compilation # ------------------------------------------------------------ AC_ARG_ENABLE(profiling,[ --enable-profiling Turn on profiling]) if test "$enable_profiling" = yes then CXXFLAGS="$CXXFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi if test "$enable_m64" = yes -a "$enable_m32" then AC_MSG_ERROR([ Choose 32 or 64 architecture not the both ],1); fi AC_ARG_ENABLE(m64,[ --enable-m64 Turn on 64 bits architecture]) if test "$enable_m64" = yes then ff_m64=-m64 ff_ok=no CHECK_COMPILE_FLAG(C,$ff_m64,CFLAGS,ff_ok) if test "$ff_ok" = yes ;then CNOFLAGS="$CFLAGS $ff_m64";fi CHECK_COMPILE_FLAG(C++,$ff_m64,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,$ff_m64,FFLAGS) # add -fPIC on on 64 architecture if test "$ff_ok" = yes -a "$ff_fpic" != "no" ;then CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS,ff_ok) CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-fPIC,FFLAGS) fi fi AC_ARG_ENABLE(m32,[ --enable-m32 Turn on 32 bits architecture]) if test "$enable_m32" = yes then ff_m32=-m32 ff_ok=no CHECK_COMPILE_FLAG(C,$ff_m32,CFLAGS,ff_ok) if test "$ff_ok" = yes ;then CNOFLAGS="$CFLAGS $ff_m32";fi CHECK_COMPILE_FLAG(C,$ff_m32,CNOFLAGS) CHECK_COMPILE_FLAG(C++,$ff_m32,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,$ff_m32,FFLAGS) # add -fPIC on on 64 architecture # CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS) # CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS) # CHECK_COMPILE_FLAG(Fortran 77,-fPIC,FFLAGS) fi # Debug mode (no optimisation) # ---------------------------- AC_MSG_CHECKING(whether to generate debugging information) AC_ARG_ENABLE(debug,[ --enable-debug Turn on debug versions of FreeFem++]) AC_ARG_ENABLE(optim,[ --enable-optim Turn on compiler optimization]) if test "$enable_debug" = yes; then AC_MSG_RESULT(yes) CFLAGS="`echo $CFLAGS | sed 's/-O2//g'`" FFLAGS="`echo $FFLAGS | sed 's/-O2//g'`" CXXFLAGS="`echo $CXXFLAGS | sed 's/-O2//g'`" CHECK_COMPILE_FLAG(C,-g,CFLAGS) CHECK_COMPILE_FLAG(C++,-g,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-g,FFLAGS) else AC_MSG_RESULT(no) # No debugging information in optimized code CFLAGS="$CFLAGS -DNDEBUG" FFLAGS="$FFLAGS -DNDEBUG" CXXFLAGS="$CXXFLAGS -DNDEBUG" fi # Hardware-independant optimization # --------------------------------- if test "$enable_debug" != yes -a "$enable_optim" != no; then CHECK_COMPILE_FLAG(C,-O3,CFLAGS) CHECK_COMPILE_FLAG(C++,-O3,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-O3,FFLAGS) fi AC_ARG_ENABLE(generic, [ --enable-generic Turn off hardware-dependant optimization options]) # FFCS: remove "-mcpu=common" to allow other hardware-dependant values of cpu for PowerPC - thank you Fred (20/02/11) if test $enable_ffcs = yes then # Generic code if test "$enable_debug" != yes \ -a "$enable_optim" != no \ -a "$enable_generic" = yes then CHECK_COMPILE_FLAG(C,-mcpu=common,CFLAGS) CHECK_COMPILE_FLAG(C++,-mcpu=common,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-mcpu=common,FFLAGS) fi fi # Hardware-dependant optimization # ------------------------------- if test "$enable_debug" != yes \ -a "$enable_optim" != no \ -a "$enable_generic" != yes then # Autoconf always chooses -O2. -O2 in gcc makes some functions # disappear. This is not ideal for debugging. And when we optimize, we # do not use -O2 anyway. CFLAGS="`echo $CFLAGS | sed 's/-O2//g'`" FFLAGS="`echo $FFLAGS | sed 's/-O2//g'`" CXXFLAGS="`echo $CXXFLAGS | sed 's/-O2//g'`" # MacOS X Darwin if test -x /usr/bin/hostinfo then # If we are on MacOS X to choise the optimisaztion AC_MSG_CHECKING(GCC version) ff_gcc4=`$CC --version |awk ' NR==1 {print $3}'|sed -e 's/\..*$//'` ff_clang=`$CC --version |awk '/clang/ {print $4}'` if test -n "$ff_clang" ; then ff_gcc4="llvm"; fi AC_MSG_RESULT($ff_gcc4) # At the moment, we do not know how to produce correct # optimizated code on G5. AC_MSG_CHECKING(PowerPC architecture) ff_machine=`(test -x /usr/bin/machine && /usr/bin/machine) || echo unknow` ff_fast="-O3" if test -n "$ff_clang" ; then ff_fast='-O3' elif test `uname` = Darwin then # Optimization flags: -fast option do not work because the # -malign-natural flags create wrong IO code if test "$ff_gcc4" -eq 4 then ff_fast='-fast' else ff_fast='-O3 -funroll-loops -fstrict-aliasing -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math -mpowerpc-gpopt -force_cpusubtype_ALL -fstrict-aliasing -mpowerpc64 ' fi fi # CPU detection case $ff_machine in ppc7450) # G4 ff_fast="$ff_fast -mtune=G4 -mcpu=G4";; ppc970) # G5 # remove -fstrict-aliasing on G5 to much optim the # code cash in GC ff_fast="`echo $ff_fast -mtune=G5 -mcpu=G5| sed 's/-fstrict-aliasing //g'`";; ppc*) # G3 ???? ff_fast="-O3";; i486) ff_fast="-O3 $ff_fast";; x86_64*) ff_fast="-O3 $ff_fast";; *) AC_MSG_ERROR(cannot determine apple cpu type ) ff_fast="-O3";; esac AC_MSG_RESULT($ff_fast) CHECK_COMPILE_FLAG(C,$ff_fast,CFLAGS) CHECK_COMPILE_FLAG(C++,$ff_fast,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,$ff_fast,FFLAGS) # Linux elif test -f /proc/cpuinfo then # Specific processors proc_type=unknown ff_optim_type= if test `grep 'Pentium III (Coppermine)' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium3 ff_optim_type=-P3 elif test `grep 'Intel(R) Pentium(R) III ' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium3 ff_optim_type=-P3 elif test `grep 'Intel(R) Pentium(R) 4 ' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium4 ff_optim_type=-P4 elif test `grep 'Intel(R) Xeon(TM) CPU' /proc/cpuinfo|wc -l` -gt 0 then proc_type=pentium4 ff_optim_type=-P4 elif test `grep 'AMD Athlon(tm) Processor' /proc/cpuinfo|wc -l` -gt 0 then proc_type=athlon ff_optim_type=-Athlon elif test `grep 'AMD Athlon(tm) XP' /proc/cpuinfo|wc -l` -gt 0 then proc_type=athlon-xp ff_optim_type=-AthlonXP fi if test "$proc_type" != unknown then CHECK_COMPILE_FLAG(C,-march=$proc_type,CFLAGS) CHECK_COMPILE_FLAG(C++,-march=$proc_type,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-march=$proc_type,FFLAGS) fi # If we did not find a processor type (this happens with # cygwin), try and select separate capabilities instead. if test "$proc_type" = unknown then if test `grep -e '^flags.*mmx' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-mmmx,CFLAGS) CHECK_COMPILE_FLAG(C++,-mmmx,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-mmmx,FFLAGS) fi if test `grep -e '^flags.*avx' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-mavx,CFLAGS) CHECK_COMPILE_FLAG(C++,-mavx,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-mavx,FFLAGS) else if test `grep -e '^flags.*sse4_2' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-msse4.2,CFLAGS) CHECK_COMPILE_FLAG(C++,-msse4.2,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-msse4.2,FFLAGS) else if test `grep -e '^flags.*sse2' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-msse2,CFLAGS) CHECK_COMPILE_FLAG(C++,-msse2,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-msse2,FFLAGS) else if test `grep -e '^flags.*sse ' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-msse,CFLAGS) CHECK_COMPILE_FLAG(C++,-msse,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-msse,FFLAGS) fi if test `grep -e '^flags.*3dnow' /proc/cpuinfo|wc -l` -gt 0 then CHECK_COMPILE_FLAG(C,-m3dnow,CFLAGS) CHECK_COMPILE_FLAG(C++,-m3dnow,CXXFLAGS) CHECK_COMPILE_FLAG(Fortran 77,-m3dnow,FFLAGS) fi fi fi fi fi fi fi # Defines a variable containing the optimization type, to be used in # binary archive names. It may be empty if only generic optimization # is used. AC_SUBST(OPTIM_TYPE,$ff_optim_type) freefem++-3.61-1/acmpi.m4000644 000767 000024 00000031640 13256636774 015162 0ustar00hechtstaff000000 000000 # Checking wether we can produce a parallel version # ------------------------------------------------- dnl m4_include(ax_mpi.m4) ff_save_path="$PATH" # We need to choose between mpich, openmpi and lam for the Debian package AC_ARG_WITH(mpipath,[ --with-mpipath= the path of mpich under windows (no command mpic++, ... )]) AC_ARG_WITH(mpilibs,[ --with-mpilibs= the libs to add to c++,fc, ... (to link with c++ - ex: -L/usr/local/lib -lmpi_f90 -lmpi_cxx -lmpi -lopen-rte -lopen-pal -lutil) ]) AC_ARG_WITH(mpilibsc,[ --with-mpilibsc= the libs to add to c ... (to link with cc (for pastix lib) ex: -L/usr/local/lib -lmpi -lopen-rte -lopen-pal -lutil) ]) AC_ARG_WITH(mpiinc,[ --with-mpiinc= the include directory directive and preprocess directive (no mpicc++, just use the compiler)) ]) AC_ARG_WITH(mpi,[ --with-mpi=[yes|no|mpic++|lam|mpich|openmpi|/usr/local/bin/mpic++|... ] or --without-mpi Choose MPI implementation (default is mpic++)]) if test "$with_mpi" != no ; then #if test "$with_mpi" != no ; then #AX_MPI(with_mpi=yes, with_mpi=no) #fi # Default is mpic++ ff_mpi_suffix=""; if test "$with_mpi" = yes -o -z "$with_mpi" then ff_mpicxx=mpic++ else case "$with_mpi" in lam|mpich|openmpi) ff_mpi_suffix=.$with_mpi;ff_mpicxx=mpic++.$with_mpi;; *) ff_mpicxx="$with_mpi" ;; esac fi dnl AC_MSG_NOTICE([ xxxxxxxxxxxxxxxxxxxx --$with_mpilibs--]); if test -n "$with_mpiinc" -a "$with_mpiinc" != no ; then if test "$with_mpi" = 'no' ; then with_mpi='yes'; fi ff_MPI_INCLUDE="$with_mpiinc" fi if test -n "$with_mpilibs" -a "$with_mpilibs" != no ; then ff_MPI_LIB="$with_mpilibs" ff_MPI_LIBC="$with_mpilibs" ff_MPI_LIBFC="$with_mpilibs" MPICXX="$CXX $ff_MPI_INCLUDE" MPIF77="$F77 $ff_MPI_INCLUDE" MPIFC="$FC $ff_MPI_INCLUDE" MPICC="$CC $ff_MPI_INCLUDE" AC_MSG_NOTICE([ --- set all MPI compile to compiler: $MPICC , $MPIF77, $MPIFC, $MPICC ]) fi if test -n "$with_mpilibsc" -a "$with_mpilibsc" != no ; then ff_MPI_LIBC="$with_mpilibsc" fi AC_ARG_VAR(MPIRUN,[MPI run command ]) AC_MSG_CHECKING(for MPIRUN) if test -z "$MPIRUN" ; then AC_PATH_PROGS(MPIRUN,mpirun mpiexec mpiexec.exe,no) if test "$MPIRUN" = no then ff_mpi=no fi fi AC_MSG_RESULT($MPIRUN) AC_MSG_CHECKING(for mpipath ) if test "$with_mpi" != no -a ! -d "$with_mpipath" -a "$MPIRUN" != no ; then # if "$MPIRUN" != no ; tehn with_mpipath=`AS_DIRNAME(["$MPIRUN"])` with_mpipath=`AS_DIRNAME(["$with_mpipath"])` # echo " ***** with_mpipath $with_mpipath \n" # else # for i in '/c/Program Files (x86)/MPICH2' '/c/Program Files/MPICH2' 'c:\Program Files (x86)\MPICH2' 'c:\Program Files\MPICH2' ; do # test -d "$i" && with_mpipath="$i" && break # done # fi fi #echo "**** with_mpipath '$with_mpipath' $MPIRUN *****" dnl if test "$with_mpilibs" != "no" ; then dnl fi case "$MPIRUN" in */sgi/mpt/*) ff_MPI_INCLUDE_DIR= ff_MPI_LIB_DIR= test -f "$with_mpipath/include/mpif.h" && ff_MPI_INCLUDE_DIR="$with_mpipath/include" test -f "$with_mpipath/lib/libmpi.so" && ff_MPI_LIB_DIR="$with_mpipath/lib" if test -n "$ff_MPI_INCLUDE_DIR" -a -n "$ff_MPI_LIB_DIR" ; then ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' " with_mpiinc="$ff_MPI_INCLUDE" ff_MPI_LIBC="-L'$ff_MPI_LIB_DIR' -lmpi" ff_MPI_LIB="-L'$ff_MPI_LIB_DIR' -lmpi++ -lmpi" ff_MPI_LIBFC="-L'$ff_MPI_LIB_DIR' -lmpi" ff_mpitype=sgi test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" # echo " *** MPI sgi ..... " fi ;; esac echo " #### --$MSMPI_INC--$MSMPI_BIN--$ff_win32" if test -n "$MSMPI_INC" -a -n "$MSMPI_BIN" -a "$ff_win32" = yes ; then echo " #### check MSMPI" # MSMPI_LIB64 MSMPI_LIB32 $ff_ptrbit is 32 or 64 mkdir -p download/include/msmpi mkdir -p download/lib/msmpi cp "$MSMPI_INC"/*.h download/include/msmpi grep -v INT_PTR_KIND "$MSMPI_INC"/mpif.h >download/include/msmpi/mpif.h test "$ff_ptrbit" -eq 64 && cp "$MSMPI_INC"/x64/*.h download/include/msmpi test "$ff_ptrbit" -eq 32 && cp "$MSMPI_INC"/x86/*.h download/include/msmpi ff_MPI_INCLUDE_DIR=`pwd`/download/include/msmpi ff_msmpi_lib="$MSMPI_LIB64" test "$ff_ptrbit" -eq 32 && ff_msmpi_lib="$MSMPI_LIB32" cp "$ff_msmpi_lib/msmpifec.lib" "$ff_msmpi_lib/msmpi.lib" download/lib/msmpi ff_msmpi_lib=`pwd`/download/lib/msmpi # MSMPI if with_mpilibs=`where msmpi.dll` then # Remove for scotch and parmetis ff_MPI_INCLUDE="-I$ff_MPI_INCLUDE_DIR '-D__int64=long long'" with_mpiinc="$ff_MPI_INCLUDE" test -z "$MPIRUN" && MPIRUN="where mpiexe.exe" ff_MPI_LIBC="'$ff_msmpi_lib/msmpi.lib'" ff_MPI_LIB="'$ff_msmpi_lib/msmpi.lib'" ff_MPI_LIBFC="'$ff_msmpi_lib/msmpifec.lib' '$ff_msmpi_lib/msmpi.lib'" test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" else echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_LOG_FD echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_FD with_mpipath=no with_mpi=no fi elif test -d "$with_mpipath" -a "$ff_win32" = yes ; then # sed -e "s?@MPIDIR@?$with_mpipath?" -e "s?@F77@?$F77?" -e "s?@CC@?$CC?" -e "s?@CXX@?$CXX?" -e "s?@FC@?$FC?" mpic++ # chmod a+rx mpic++ # for i in mpicc mpif90 mpifc mpif77 ; do cp mpic++ $i; done # ff_pwd=`pwd` # with_mpi="$ff_pwd"/mpic++ # MPICXX="$ff_pwd/mpic++" # MPIF77="$ff_pwd/mpif77" # MPIFC="$ff_pwd/mpif90" # MPICC="$ff_pwd/mpicc" zzzzzzzzzzz if with_mpilibs=`which msmpi.dll` then case "$ff_size_ptr" in 4) with_mpipathlib="$with_mpipath/Lib/i386";; 8) with_mpipathlib="$with_mpipath/Lib/amd64";; *) with_mpipath=no;; esac test -d "$with_mpipath/Inc" && ff_MPI_INCLUDE_DIR="$with_mpipath/Inc" test -d "$with_mpipath/Include" && ff_MPI_INCLUDE_DIR="$with_mpipath/Include" # Remove for scotch and parmetis # ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' '-D_MSC_VER' '-D__int64=long long'" ff_MPI_INCLUDE="-I'$ff_MPI_INCLUDE_DIR' '-D__int64=long long'" with_mpiinc="$ff_MPI_INCLUDE" test -z "$MPIRUN" && MPIRUN="$with_mpipath/bin/mpiexe.exe" ff_MPI_LIBC="$with_mpilibs" ff_MPI_LIB="$with_mpilibs" ff_MPI_LIBFC="$with_mpilibs" test -z "$MPICXX" && MPICXX="$CXX $ff_MPI_INCLUDE" test -z "$MPIF77" && MPIF77="$F77 $ff_MPI_INCLUDE" test -z "$MPIFC" && MPIFC="$FC $ff_MPI_INCLUDE" test -z "$MPICC" && MPICC="$CC $ff_MPI_INCLUDE" else echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_LOG_FD echo " #### no msmpi.dll => no mpi under windows .... (FH) " >&AS_MESSAGE_FD with_mpipath=no with_mpi=no fi else with_mpipath=no fi AC_MSG_RESULT($ff_mpi_path) dnl correct ff_mpi_path august 2010 -- FH ... ff_save_cxx="$CXX" ff_save_libs="$LIBS" if test "$with_mpi" != no then ff_mpi_path=`AS_DIRNAME(["$MPIRUN"])` dnl echo "ff_mpi_path '$ff_mpi_path' .............." case "$ff_mpi_path" in .|"") ff_mpi_path="$PATH";ff_defmpicxx="$ff_mpicxx";; *) ff_mpi_path="$ff_mpi_path";ff_defmpicxx=`expr "//$ff_mpicxx" : '.*/\(.*\)'`;; dnl if also add $PATH they could be missing some different mpi version... esac AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) if test -z "$MPICXX" ; then AC_PATH_PROGS(MPICXX,$ff_defmpicxx mpic++$ff_mpi_suffix mpicxx$ff_mpi_suffix mpiCC$ff_mpi_suffix mpCC hcp mpxlC mpxlC_r cmpic++,no,$ff_mpi_path) AC_MSG_CHECKING(for MPICXX) fi ff_mpicxx="eval $MPICXX" CXX=$ff_mpicxx LIBS="$LIBS $ff_MPI_LIB" test -z "$ff_mpi" && ff_mpi=yes AC_LINK_IFELSE( [AC_LANG_SOURCE([ #include #include int main(int argc,char **argv){ char name[[BUFSIZ]]; int length; MPI_Init(&argc, &argv); MPI_Get_processor_name(name, &length); printf("%s: hello world\n", name); MPI_Finalize(); return 0; }])],ff_mpi=yes,ff_mpi=no) AC_MSG_RESULT($ff_mpi) # Also check that mpirun is there. If it isn't, then MPI is # not fully installed. if test "$ff_mpi" = yes; then AC_MSG_CHECKING( MPI_DOUBLE_COMPLEX) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX; ])], ff_mpi_double_complex=yes, ff_mpi_double_complex=no) AC_MSG_RESULT($ff_mpi_double_complex) if test "$ff_mpi_double_complex" = yes ; then AC_DEFINE(HAVE_MPI_DOUBLE_COMPLEX,1, mpi_double_complex) fi echo "MPI CC $ff_mpi" >config_LIB_INFO # We do not AC_DEFINE any special flag for parallel # computation here, because it must only be set when the # parallel program is compiled (see src/mpi/Makfile.am) ff_mpiprog="FreeFem++-mpi${EXEEXT}" AC_SUBST(MPIPROG,"$ff_mpiprog") AC_SUBST(MPISCRIPT,"ff-mpirun") AC_SUBST(MPIRUN,$MPIRUN) AC_SUBST(MPICXX,$MPICXX) else AC_SUBST(MPICXX,$ff_save_cxx) fi if test "$ff_mpi" = yes; then if test "$enable_fortran" != no then AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command]) if test -z "$MPIF77" ; then AC_PATH_PROGS(MPIF77, mpif90$ff_mpi_suffix mpif77$ff_mpi_suffix hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r cmpifc cmpif90c, "",$ff_mpi_path) fi AC_SUBST(MPIF77) AC_ARG_VAR(MPIFC,[MPI Fortran 90 compiler command]) if test -z "$MPIFC" ; then AC_PATH_PROGS(MPIFC, mpif90$ff_mpi_suffix mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, "",$ff_mpi_path) fi AC_SUBST(MPIFC) fi echo " ********************ffmpi= '$ff_mpi' ************* " ff_MPI_INCLUDE="$with_mpiinc" if test -z "$ff_mpitype" ; then ff_mpishow=`$MPICXX -show` 2>/dev/null ff_mpicshow=`$MPICC -show` 2>/dev/null 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 '^[-/][^WLlOgp]|^-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' ' '`] [ff_MPI_LIBFC=`echo $ff_mpifcshow|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|grep -v 'commons,use_dylibs' |tr '\n' ' '`] [ff_mpi_idir=`echo $ff_mpishow|tr ' ' '\n'| grep -E '^-I'|sed s/^-I//|tr '\n' ' '`' /usr/include'] fi [ff_mpi_idir=`echo $ff_MPI_INCLUDE|tr ' ' '\n'| grep -E '^-I'|sed s/^-I//|tr '\n' ' '`' /usr/include'] [ff_mpi_ldir=`echo $ff_MPI_LIB|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|sed -e 's/^-[Llp]//' -e 's/^-Wl,]//' |tr '\n' ' '`' /usr/lib'] if test -z "$ff_MPI_INCLUDE_DIR" ; then for i in $ff_mpi_idir; do if test -f "$i/mpi.h" -a -z "$ff_MPI_INCLUDE_DIR" ;then ff_MPI_INCLUDE_DIR=$i fi done fi for i in $ff_mpi_ldir; do ff_tmp=`ls $i/libmpi.*|head -1` if test -f "$ff_tmp" -a -z "$ff_MPI_LIB_DIRS" ;then ff_MPI_LIB_DIRS=$i fi done fi AC_SUBST(MPICXX,$MPICXX) AC_ARG_VAR(MPICC,[MPI C compiler command in $ff_mpi_path]) if test -z "$MPICC" ; then AC_PATH_PROGS(MPICC,mpicc$ff_mpi_suffix hcc mpcc mpcc_r mpxlc cmpicc, "",$ff_mpi_path) fi AC_SUBST(MPICC,$MPICC) AC_SUBST(PASTIX_HOSTARCH,$ff_HOSTARCH_pastix) if test ! -f "$ff_MPI_INCLUDE_DIR/mpif.h" ; then AC_MSG_NOTICE([ MPI without fortran no file "$ff_MPI_INCLUDE_DIR/mpif.h" ]) else if test -n "$MPIFC" ; then AC_FF_ADDWHERELIB(mpifc,$ff_MPI_LIBFC,$ff_MPI_INCLUDE) AC_FF_ADDWHERELIB(mpif77,$ff_MPI_LIBFC,$ff_MPI_INCLUDE) dnl [echo mpifc LD "'$ff_MPI_LIBFC'" >>$ff_where_lib_conf ] dnl [echo mpifc INCLUDE "'$ff_MPI_INCLUDE'" >>$ff_where_lib_conf ] dnl [echo mpif77 LD "'$ff_MPI_LIBFC'" >>$ff_where_lib_conf ] dnl [echo mpif77 INCLUDE "'$ff_MPI_INCLUDE'" >>$ff_where_lib_conf ] fi fi if test -n "$MPICXX" ; then AC_FF_ADDWHERELIB(mpi,$ff_MPI_LIB,$ff_MPI_INCLUDE) dnl [echo mpi LD "'$ff_MPI_LIB'" >>$ff_where_lib_conf ] dnl [echo mpi INCLUDE "'$ff_MPI_INCLUDE'" >>$ff_where_lib_conf ] fi AC_SUBST(MPI_INC_DIR,$ff_MPI_INCLUDE_DIR) AC_SUBST(MPI_INCLUDE,$ff_MPI_INCLUDE) AC_SUBST(MPI_LIB_DIRS,$ff_MPI_LIB_DIRS) AC_SUBST(MPI_LIB,$ff_MPI_LIB) AC_SUBST(MPI_LIBC,$ff_MPI_LIBC) AC_SUBST(MPI_LIBFC,$ff_MPI_LIBFC) AC_SUBST(SKIP_TESTS_MPI,"no") fi CXX="$ff_save_cxx" LIBS="$ff_save_libs" fi fi ## clean on MPI variable if not MPI ... if test "$ff_mpi" != yes ; then AC_SUBST(MPIRUN,"") AC_SUBST(MPICC,"") AC_SUBST(MPICXX,"") AC_SUBST(MPIF77,"") AC_SUBST(MPIFC,"") AC_SUBST(MPI_INCLUDE,"") AC_SUBST(MPI_LIB_DIRS,"") AC_SUBST(MPI_LIB,"") AC_SUBST(MPI_LIBC,"") AC_SUBST(MPI_LIBFC,"") AC_SUBST(SKIP_TESTS_MPI,"yes") ff_mpi=no fi # Local Variables: # mode:shell-script # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/README_ARPACK.md000644 000767 000024 00000000706 13312446271 016106 0ustar00hechtstaff000000 000000 # How to adapt ARPACK for compilation with FreeFem++ The simplest way is just ```bash configure --enable-download ``` Or to compile arpack Remark: In arpack++, a lot of incoherance this moderne c++ (g++3 or better) so I write the driver by hand (from version 3). arpack++ in included in FreeFem++ now. The last one is in lapack lib second.f in an function not a procedure like in arpack. Two weeks work to find this mistake. Frederic Hecht freefem++-3.61-1/edp.nedit000644 000767 000024 00000004247 13256636774 015427 0ustar00hechtstaff000000 000000 nedit.highlightPatterns: edp:1:0{\n\ comment:"/\\*":"\\*/"::Comment::\n\ cplus comment:"//":"$"::Comment::\n\ string:"L?""":"""":"\\n":String::\n\ preprocessor line:"macro":"//"::Preprocessor::\n\ string escape chars:"\\\\(.|\\n)":::String1:string:\n\ preprocessor esc chars:"\\\\(.|\\n)":::Preprocessor1:preprocessor line:\n\ preprocessor comment:"/\\*":"\\*/"::Comment:preprocessor line:\n\ preproc cplus comment:"//":"$"::Comment:preprocessor line:\n\ preprocessor numeric constant:"<((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?>":::Numeric Const:preprocessor line:D\n\ numeric constant:"<((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?>":::Numeric Const::D\n\ storage keyword:"<(func|real|int|double|mesh|fespace|varf|matrix|problem|solve|ifstream|ofstream|bool)>":::Storage Type::D\n\ keyword:"<(Cmatrix|R3|border|break|complex|continue|element|else|end|fespace|for|if|ifstream|include|load|mesh|problem|real|return|solve|string|varf|vertex|while)>":::Keyword::D\n\ functionff:"<(BFGS|EigenValue|LinearCG|LinearGMRES|NLCG|Newtow|abs|acos|acosh|adaptmesh|arg|asin|asinh|assert|atan|atan2|atanh|average|buildmesh|buildmeshborder|checkmovemesh|clock|conj|convect|cos|cosh|dumptable|dx|dxx|dxy|dy|dyx|dyy|emptymesh|exec|exit|exp|imag|int1d|int2d|intalledges|interplotematrix|interpolate|jump|log|log10|max|mean|min|movemesh|norm|on|otherside|plot|polar|pow|readmesh|savemesh|set|sin|sinh|splitmesh|sqrt|square|tan|tanh|triangulate|trunc)>":::Identifier1::D\n\ constantff:"<(CG|CPUTime|Cholesky|Crout|GMRES|HaveUMFPACK|LU|N|NoUseOfWait|P|P0|P0edge|P1|P1b|P1dc|P1nc|P2|P2b|P2dc|P2h|P2b|RT0|RT0Ortho|RTmodif|UMFPACK|append|area|cin|cout|endl|false|hTriangle|inside|label|lenEdge|nTonEdge|nuEdge|nuTriangle|pi|qf1pE|qf1pElump|qf1pT|qf1pTlump|qf2pE|qf2pT|qf2pT4P1|qf3pE|qf5pT|qf7pT|qf9pT|region|true|verbosity|version|wait|x|y|z)>":::Identifier::D\n\ braces:"[{}]":::Keyword::D\n\ } nedit.languageModes: edp:.edp::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~" nedit.styles: Numeric Const:darkGreen:Plain\n\ Preprocessor:RoyalBlue4:Plain\n\ Preprocessor1:blue:Plain\n\ freefem++-3.61-1/BUGS000644 000767 000024 00000004350 13256636773 014307 0ustar00hechtstaff000000 000000 -- bug in examples++-3d/TruncLac.edp april 2014 assertion under windows system versiuon 3.30 () -- bug in clean variable (delete) after a break , continue or return. example : while(1) { .... if ( ...) break; matrix M= ... } // here we delete the data associated to objet M but the variable M is un set, so some time freefem trap when we free unset pointer. -- bug une fonction with string parameter hard to correct func bool write(string fn,real[int] & u) { cout << fn << endl; // delete 2 times return true; } Now, problem: (correct in version 1.14) adpation and periodic boundary condition are incompatible. no way to inforce periodic adpated mesh today. -- before version 1.28: bug when passing a parameter of funct to a parameter parameter like: func int fi(real a) { int i=a*a/0; return i; }; func real myfunction(real a,real b) { real z =fi(a)+b/0; // bug loop in E_F0para::operator()(void*) const () return z; }; -- before version 1.21, bug in interpolation on non connexe domain, (some pieces of code are lose) on(1,u=N.x); the normal is not set (correct in version 1.20) -- bug in version 1.18 and before The no symetric matrix set form a variationnal form is make with 2 transpositions one on the space and one at the level of the bilineair form fespace Ph(Th,P1),Vh(Th,P2); varf a(p,v)=int2d(Th)(p*dx(v)); matrix A=a(Ph,Vh); // is n m matrix n (resp. m) is the number of DF of Ph (resp. Vh), so the construct matrix is Aij= int2d(Th)(v_j*dx(p_i)); bug in version 1.16 and after: The mixing of fespace with differents periodic boundary condition is not implemented in no-scalar problem. So all the finite element space use for test or unknow functions in a problem, must have the same type of periodic boundary condition or no periodic boundary condition. No clean message is give and the result is impredictible, Sorry. bug in version 1.15 and before: bug know bug: example-bug/aaa.edp Do not make copy mesh and fespace Mesh Thh; { Mesh Th=readmesh( ..); // OK Th=Thh; // BUG the mesh is delete twice. } plot(Thh); // trap because the mesh is delete the same probleme occure with fespace freefem++-3.61-1/INSTALL-MacOSX000644 000767 000024 00000003065 13256636774 015750 0ustar00hechtstaff000000 000000 To install FreeFem++ on your mac you need to run (double click on) the shell script Install-MacOS.command (you will need to type your password and you must be "administrator" of your machine). This script installs FreeFem++, ffglut, ffmedit in /usr/local/bin , as well as some possibly missing libraries and the FreeFem.app in /Applications. This version can be used in 3 modes - Like a Mac application with drap and drop, etc; then it opens a terminal window for the console IO and (when needed) a graphic window which accepts keyboard commands when in wait mode (listed by typing a "?"). - In terminal mode: (only when FreeFem++.app has not been moved out of the/ Applications directory). In the terminal window one must type "FreeFem++ " where is the name of your xxx.edp file. - With the latest version of the smultron.app (http://tuppis.com/smultron/) text editor directly from inside the editor by typing "cmd+r". Smultron recognizes xx.edp files and activates a color highlight of the keywords (don't forget a "cmd+s" before the "cmd+r"). Technical Note: ------------- This will not work on MacOs systems less than 10.3. This version uses OpenGL/GLUT graphics. The installer command puts in /usr/local/bin the following binaries: ff-c++ tools to compile dynamic libray with freefem++ FreeFem++ the freefem++ command ffglut the graphic visalisator ffmedit the medit sofware Some external library are in the archive file OtherMacOsLib.tgz; you may need to install these READ le READ_MAC to buil freefem++ on your mac. freefem++-3.61-1/config.h.in000644 000767 000024 00000013561 13321623126 015630 0ustar00hechtstaff000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* build FreeFem++ for use by FreeFem++-cs */ #undef ENABLE_FFCS /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #undef F77_DUMMY_MAIN /* Define to a macro mangling the given C identifier (in lower and upper case), which must not contain underscores, for linking with Fortran. */ #undef F77_FUNC /* As F77_FUNC, but for C identifiers containing underscores. */ #undef F77_FUNC_ /* Define if F77 and FC dummy `main' functions are identical. */ #undef FC_DUMMY_MAIN_EQ_F77 /* FreeFem prefix dir */ #undef FF_PREFIX_DIR /* FreeFem prefix dir */ #undef FF_PREFIX_DIR_APPLE /* Define to 1 if you have the header file. */ #undef HAVE_ACCELERATE_CBLAS_H /* Define to 1 if you have the `acosh' function. */ #undef HAVE_ACOSH /* Define to 1 if you have the `asinh' function. */ #undef HAVE_ASINH /* Define to 1 if you have the `atanh' function. */ #undef HAVE_ATANH /* Define to 1 if you have the header file. */ #undef HAVE_ATLAS_CBLAS_H /* If umfpack.h is located in UMFPACK subdir */ #undef HAVE_BIG_UMFPACK_UMFPACK_H /* the MKL intel lib is present for BLAS and LAPACK */ #undef HAVE_BLAS /* freecadna is use to evalute the round-off error propagation */ #undef HAVE_CADNA /* Define to 1 if you have the header file. */ #undef HAVE_CBLAS_H /* Define to 1 if you have the header file. */ #undef HAVE_CSTDDEF /* Dynamic loading - not mandatory */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `erfc' function. */ #undef HAVE_ERFC /* Define to 1 if you have the header file. */ #undef HAVE_FFTW3_H /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_GLUT_GLUT_H /* Define to 1 if you have the header file. */ #undef HAVE_GL_GLUT_H /* Define to 1 if you have the header file. */ #undef HAVE_GL_GL_H /* Defined if you have HDF5 support */ #undef HAVE_HDF5 /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `jn' function. */ #undef HAVE_JN /* Arpack is used for eigenvalue computation */ #undef HAVE_LIBARPACK /* Cholmod is used for sparse matrices computations */ #undef HAVE_LIBCHOLMOD /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* UMFPACK */ #undef HAVE_LIBUMFPACK /* Define to 1 if you have the `mallinfo' function. */ #undef HAVE_MALLINFO /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* the MKL intel lib is present for BLAS and LAPACK */ #undef HAVE_MKL /* mpi_double_complex */ #undef HAVE_MPI_DOUBLE_COMPLEX /* Define to 1 if you have the `mstats' function. */ #undef HAVE_MSTATS /* Define to 1 if you have the header file. */ #undef HAVE_OPENGL_GL_H /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `second_' function. */ #undef HAVE_SECOND_ /* Define to 1 if you have the header file. */ #undef HAVE_SEMAPHORE_H /* Define to 1 if you have the `srandomdev' function. */ #undef HAVE_SRANDOMDEV /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SUITESPARSE_UMFPACK_H /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tgamma' function. */ #undef HAVE_TGAMMA /* Define to 1 if you have the `times' function. */ #undef HAVE_TIMES /* Define to 1 if you have the header file. */ #undef HAVE_UFSPARSE_UMFPACK_H /* Define to 1 if you have the header file. */ #undef HAVE_UMFPACK_H /* Define to 1 if you have the header file. */ #undef HAVE_UMFPACK_UMFPACK_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* the ffglut application for the new graphics */ #undef PROG_FFGLUT /* A pure windows applications no cygwin dll */ #undef PURE_WIN32 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* FreeFem++ build date */ #undef VersionFreeFemDate /* FreeFem++ version as a float */ #undef VersionFreeFempp /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER freefem++-3.61-1/examples++-other/000755 000767 000024 00000000000 13321644114 016662 5ustar00hechtstaff000000 000000 freefem++-3.61-1/config.guess000755 000767 000024 00000124652 13256636774 016155 0ustar00hechtstaff000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-07-03' # 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 3 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, see . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . 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 ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 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@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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ /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 ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-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*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ 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 # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; 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}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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@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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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 /* 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 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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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 #include 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 -q __LP64__ 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 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) 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 ;; 8664:Windows_NT:*) echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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.[02]*:*) 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' /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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku 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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < 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: freefem++-3.61-1/copysharedlibs.sh000755 000767 000024 00000000715 13256636774 017200 0ustar00hechtstaff000000 000000 #!/bin/sh # Find out which shared libs an executable needs and copy them # Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 22/11/04 # $Id$ # $1=executable to analyze if test ! -x $1 then echo $1 is not an executable exit 1 fi # $2= where to copy shared libs if test ! -d $2 then echo $2 is not a directory fi # List all shared libs libs=`ldd $1|awk '{print $3}'` if test "$libs" != "dynamic" -a "$libs" != "" then cp $libs $2 fi freefem++-3.61-1/CheckAllEdp000755 000767 000024 00000003170 13256636773 015650 0ustar00hechtstaff000000 000000 #!/bin/bash red='' # Red. grn='' # Green. lgn='' # Light green. blu='' # Blue. mgn='' # Magenta. std='' # No color. NL=0 NA=0 NX=0 NN=0 NO=0 NC=0 NF=0 cmm=$1;shift; if [ $# -eq 0 ]; then list=*.edp elif [ $# -gt 0 ]; then list="$@" fi for i in $list do case $i in all.edp|regtests.edp) echo pass $i;; *) ((NN++)) ( $cmm "$i" )2>&1 1>$i-out; RES=$? ((SIG=$RES%128)); ## error Compile error : Error load # 1 ## error Compile error : ## Exec error : exec assert ## Exec error : errl=`grep 'error Compile error : Error load' $i-out` errC=`grep 'error Compile error :' $i-out` errX=`grep 'Exec error :' $i-out` errA=`grep 'Exec error : exec assert' $i-out` # echo "$RES,$SIG,$errC,$errA." if [ -n "$errl" ] ; then ((NL++)) MSG="${mgn} FAIL(load) ${std}" elif [ -n "$errC" ] ; then ((NC++)) MSG="${lgn} FAIL(Compile) ${std}" elif [ -n "$errA" -a $SIG -ne 0 ] ; then ((NA++)) MSG="${blu} FAIL(Assert) ${std}" elif [ -n "$errX" -a $SIG -ne 0 ] ; then ((NX++)) MSG="${mgn} FAIL(Exec) ${std}" elif [ $SIG -eq 0 ] ; then ((NO++)) MSG="${grn} OK (Exec) ${std}" else MSG="${red} FAIL(signal)=$SIG ${std}" ((NF++)) fi echo $MSG $cmm $i >>$i-out echo $MSG $cmm $i "( see $i-out )"; # echo $MSG $cmm $i "(see $i-out )" >>/tmp/list-ff-$$ ;; esac done echo "Nb Case $NN / ${grn}OK $NO / ${red} FAIL $NF / ${blu} Assert Error $NA/ ${lgn} Compile Error $NC / ${mgn} load Error $NL / Exec Error $NX${std}" freefem++-3.61-1/depcomp000755 000767 000024 00000033052 13256636774 015203 0ustar00hechtstaff000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, 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 . 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 # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi 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. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 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. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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" ;; 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi 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 '/^# [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 freefem++-3.61-1/examples++-chapt3/000755 000767 000024 00000000000 13321644114 016723 5ustar00hechtstaff000000 000000 freefem++-3.61-1/mode-mi-edp.zip000644 000767 000024 00000047403 13256636774 016454 0ustar00hechtstaff000000 000000 PK czx4edp/UX $D#DPKl|4 edp/.DS_StoreUX P)Dx )D;N0EX"MJJ/v` @@AD7 Evj PPsOdȟG@J jH'stK#M˘|<$/ƋE:}iBf*ǟB?b`B>kc_Άi%xot;.BWPKH4}PK |4 __MACOSX/UX P)DP)DPK |4 __MACOSX/edp/UX P)DP)DPKl|4__MACOSX/edp/._.DS_StoreUX P)Dx )Dc`cg`b 1N 6b(?YM PK #wRPKx4edp/edpUX P)DF0$DERa GSnqN]g0&3uS tvD0v"!K-$-:mB@bO4SxiGgK&M!R1}"{C3~:=a8ݵqnFtHc>deh&:€h*jFyqte2sKqjRY7yF N(q2` ,JkiucqU꓅8` gq>):u!Qa󙼮y[=@]@n"/[ZTu ,Tk:m^2Wst #PK˻*PKx4__MACOSX/edp/._edpUX P)DF0$DY pT>mv7 ፈlJl%Yp P(fلm qmBQ;'QgB b ڎHT?LԎ|}$Q{ι s6!~.Uk|R8\h$^l` CX䆜KIutsppa5!DS13Y_y`UC/z'[~= VZ}IĊ&HYj+f4RW2f]V;=ξWrV?+`/2EͦHTk Up@Uj6 \R ;Xdx0?^ A? O`՞EO|%ŸZgxʗ&.>ng'Hm_Cg˂<[ٱPlW`h.x&p% a8LTi[ Tm}=S.G2뚣D8={ɺ˂#sĪ%i۾CKc MMS6[2RKҧN]Jŗyy_=p\V}s,ܤ '2Mڑ}50S/6mS:c,r߭s濽j?kCuK?jhDcMwDһ,/(xCэ&OB}4z?by՗d&|F4jwWu=V]savw@'Os_}j׏洿5{'*W=փzP2vñ~ܺ7m{9 7e,b5䘗`{gЌPdܸ@Sg|FdDng+ǀQuwonx혹~/67c -qg&Xt{/s5 Wc,htՄ@"logE$c1X^>N}YCsh9Y6~3 nKh4AkIw~ʳAђSGWNҨ6-],l)A,ctQ-9A6#p0Z\s8ryKE0ZEbP4Aw *9+ 6::j;v\Z-[ALǜׅCS]['La~јB:y]ɪP:d5աP:iUbUuvܟ9ZeyPk$}HЙmVRV5j1\I?G%wwabBs &ˏaJ\;Y%z7ew7CEM(j*K}cZUjU)"ڪcI7'q8o.,:瞙;s~,UC++u|HƳ*kM~Ed$DU({j/k?φN;gzgμnkw^ゝG6'>Y'ut_8ƣkJJO>%(yGvOQ*P~i/+9Eŗ딜y!A?UQo)=Ugx%Sѐ%lm5IU=m4 @ѓ$cgr2H#ERdz=f{[{XRFvWttkց\:LLjFVۯ>G>'Okh5-R--2u=T *R5*.]'_) )kO@`ʺjCeVN;@қR_:Ac[ y$IY/d~.-UP8rRL~}֎~Ug:F>}NZ TߴNK֑" o{6iݯŸ)IŝT&'*Bxjg- ~ 0OU: TFzb[ZaBPm 0LDA6%n&ȑNzRߎAP-O4+jlgbvpPm̲ ]k(Jq'bN:Z5g-µEzozu.RYzhko 5!JE$݆|G%#HH%KNsvz2UPY$ EL_I/9#rȁڥkCeI_=&mMLI- Y2H}T00U&?|CQ&);'r eJLn|!-m5>[I u.jP#&6p &}@-*)jf91af]0,~'mP_z2gM^:RA[U bBLq~F/nKRP&|䙘[A!oPUz |?Lߤ,oK)-7ED#@;$.Aׯ"W VmsWĈ?h윻PI|֔u˂q)K/x3M,=HdlD.W) _X/JvYw(o<:J6Xcʳ}++ດ楎nxr  XNʞ'ej,A= 2cЃ'J͆{ 줝-fn\GP˪(ke}J$.NVǨe9\ڤnN=L>O)=^` "EzO{Χ\zWP͡PC|R|A>h|B\uRJ;m~/c棨֝stvf[ۃo8u>? YV:l>,}hB%U7{V孑߮n]|SS7p!r6veߡ1+FcPWSGc摝n_*z:Hht@^қ6^de?M[' G+LlP U6/| :gπil'l1㹸9vLk*g9H^ӱ㕃5a9d2,:e SXj^PKPQ PK x4 edp/toolbar/UX (D-0$DPK@x4edp/toolbar/Comment OutUX P)Dw#Dײ vququPKfɄfPK |4__MACOSX/edp/toolbar/UX P)DP)DPK@x4"__MACOSX/edp/toolbar/._Comment OutUX P)Dw#Dc`cg`b 1N 6b(?#:5"(`b{ l@P[p@d =bP1 O400(s00Oe`hfb`di@sP ~D=H0``{ws2hr ,N0222052@r< iYI-Y0E0EdL& [=;P2\ j@ 258?0#4Ai*F% ,@٘xR3 $Ff㾠O>VpI,.NUNͬLM4``jHZSW u o v ;$[`~@? Sfgl<<@0rN ('nGO P H5@ Q-g/HK,́@" _L~i ƽ {@@Wmzr`8umM91v07Y2 i Ləy@}@`,AUh;@L I fbzzz;z{*'(PKdwPK@x4 edp/toolbar/Find Selected StringUX P)Dx#DqsutwPKJ^IPK@x4+__MACOSX/edp/toolbar/._Find Selected StringUX P)Dx#DV=hSQ>' nX)&Tjl-4XZ!1Ƀ^OJ7YCD I(:8ܟ6]|{w=n d+tEџLsH{@Cvȋ4Cq)uiFs9F<01\8ʯ{K{ۊ߃13 /rX_1#o3;5^{f*-vs|I(<}uC !%34;&(x뒄 [rrk[-V|Y-Dg`?=8pQ'=Y}~YU{zl}rгy]bf\:y;X7+5?Tߓ]~^*Yџ0*GyA!e=oV;CO-|Ikk#PՙF&?V}݂oe}ΥoCՁ~Zt8u ]>8 fƂx3|ϝqk˴mc[wF~ |[In6PK[ć= PK@x4'edp/toolbar/Find Selected String - NextUX P)Dx#Dqs vququsPKWr~PK@x42__MACOSX/edp/toolbar/._Find Selected String - NextUX P)Dx#DVMLA~3rM@" Ƃ4I@PjxiJ#bF#Ab"hD=Q= 5DĐ-!FoVDW |6˩ <ވqa0[+qvIY]!8|`y6vp v:4+)hm|Dq9 0"V߉Q>М4|}:4F4!ʱ@g1P)_cs} SYp_hhB 2 q.`yψf3m*;c;\iC]9S35qBʭK3َzʭenYoʧ4{bT K P)(Z-렞tO?YXj^{7FX+8ـn!R\Ϣ8];PKn7DzPK@x4+edp/toolbar/Find Selected String - PreviousUX P)Dx#Dqs vququ r PK3JPK@x46__MACOSX/edp/toolbar/._Find Selected String - PreviousUX P)Dx#DVKQD;ԺJP&$h낉Bu]WFKu[7bC.32 rеZ?jꃸugd( GCjPqe a>5)*=$RHlvWP@ך][hEfk^eJr2WoE^F[X^(mX>W߫{3 e`< O+$vxDs蒢YV $F+%IBR=vIWtS;x(\49s0.Ჰq `t:ShbݮV&nM [ԅGT8n]6v5;8\hIr0@|/rP皋NMSIe=]͑Kۙsp|zv"‰p"сPMV̸}FɂK%gbp,MĴG6L{"ąۯ-W7A{^G"`6]i>!@;B9?E/Ɇ#[Gw24W̧!/svgMZoP|U_CM]t(<5jD̸aUe{n98HsސFG8oc4C|;:|+dnOUp]s}@:&SwPK_UjE PK@x4edp/toolbar/IndentUX P)Dw#Dsq PKd< PK@x4__MACOSX/edp/toolbar/._IndentUX P)Dw#DMHQhNfR^j3qE|>ev4cC]+xSu s7{?cdo7o|5~W`2'w_= Mko&S[۫ g^' !Mi]/Y i ,RaQ-8է r?q`Z }#6 zꚧn[|8K\d=]U&(Il:dD̨R'_]Y]QNS#0k$ϗPY:\I}hr][<k\= cvTJP&vΰ2XC_C#;>yl jǦ1MJyvQ#\' PYFUq#]A P9߃槟N-2a7v}nPT^OϮ)yS&3I&H2¶ӌ+: 5 aۺ%<-S<>b8CZ\X! 6`riN#X!ØGN/0qh~5Xcyg4KPܲџ@#ͣTZ ]lNc-}&ygՔ&> q40LsWr-uZ&0$(5~v3T=i ѓ?9{qrm;G(W δ!> h<;9 y-n0Wp^fo5ZTۣ(iC&[Q&?PKe.(= PK@x4edp/toolbar/Line Comment OutUX P)Dw#D vqu q p rtr Pr qtv ruwЅruPKw57PK@x4'__MACOSX/edp/toolbar/._Line Comment OutUX P)Dw#DVMhA~;IBMmb[t02uD"$䪷pugܿJ MPMQy$Qʹco% #[M 1 DL?ǚ inn'1Yw,xqx"IݷwJzNNSq3!qk˩"b}[Qqakͩg;s(1v$JH_b4>֡tߞ>k.}+,~D2Pנ}BL7f0FJ bn|M~Px쨢erLkr[E|tG&o6C_X+E;ׂ)1 l܄:=C^qW/ w>^Bq;iC8 pނ([a0v9UH|<ޗ|ڐ%bxf <PK;r!PK@x4+edp/toolbar/Multi-File Find Selected StringUX P)Dx#D tqus vququPKyPK@x46__MACOSX/edp/toolbar/._Multi-File Find Selected StringUX P)Dx#DVMlUNǵZ+RWJƉP^ǭq"A#Y4veGA@Gq ^9Uz*N@TPBrBvf}fgͼְ: ubS@̤ɻ$_} Kĝ,"i $6>aA8Ffaظn\Dž.^r!#dЮ1cs &Wߚy_33CB:3ZƞI3=нpsP%9040ځN59-VO/T}qI`?ز谌lqECTU-Mtȋ"j_2iE1%8*#y?1> &vdv?[`BT^qYLF)JbRøV#àU`CM&9 9h^<*KCtjB[cy4\gZ}9ZLn6wII?,*sYH](sq{Aj\?NJڱ1ؼ9$EJIy$|Jk}WS6*_i23NRh;Z `\% u68xٸ$Bl}z m+T?1m-C vwo˥? [ |FDX\#")kk7 KR+cAށ;Q[onֶ9VxԂoln_,o3.+7 7ݿHbziXf+ePK[6*l-?F¤4":kk} wKyߘc̱ҺO M|Y;T(tPKnoU PKx4edp/toolbar/orderUX P)DF0$D N,K K Jny) 9%@FIQf^:VA]Ԋ\rEeż9%n9 XvM+Q/-K2y}2RC2sSs xPKfPKx4__MACOSX/edp/toolbar/._orderUX P)DF0$Dc`cg`b 1N 6b(?$EPK #RPK@x4edp/toolbar/RedoUX P)Dx#D ruPK PK@x4__MACOSX/edp/toolbar/._RedoUX P)Dx#Dc`cg`b 1N 6b(?qkD+=Pi @P[pLE Qx@1(4: Td=?@ -| y&g/)BHk ` b"yCCt="0bNF70M.q FF`kdl(VpZMf5&c`rl`fb~R2d::?P #>a ZǰA8HL op`Gi*$T : KX1 $02g)&I^d}AN}Y\Yhhii$zɇՐ<5U -?$--14_ /,PwI_,Ab/\e<&5pyyOV30ꔀ`ފ"!{Ƌ Pyd`ـ^4/f{ ,2` K!)939ȖS(5Ȃ/V02@A$bƀbގޞ )ɥy% EiPK$(\5 PK@x4edp/toolbar/SaveUX P)Dx#D v sPKq PK@x4__MACOSX/edp/toolbar/._SaveUX P)Dx#DVMhA~3b6-C!UښFXmKͮ f VڋֿzWќD{(RAlk+-^޾y U@W0"Ŵ}Ʈ8 = `GsL;9 !R7f!n.;~A:&f!v 2PcQ# yd[mO(hDY[]EՃ|+ P3';gҗʚ Ɨ 0 2vt-ET-ŧ4EA-6c혯-lF6;]6zk3}+npz kjJB:jn5gF[oꉽ>'ڣLp,k'bS2%7P@#l=ӯagn XOfe s Zx3D=^1?/3˟;\Ir~~7r~|9P~I?Bp)"Mr"̄8mtk> Koue':{Y6 @^rB  pp+8̥_^Z^:9j2mK=.[ϔgaW|p Y%@ՐDv՝[|kJ~jMƷMx[<}-Z$-PKܳU PK@x4edp/toolbar/Time StampUX P)Dw#DRqq q  SPKwVPK@x4!__MACOSX/edp/toolbar/._Time StampUX P)Dw#DVMLA~? xъ6Xict;-fT07D&LsE‘=鑄x%/Ll-C|yg. ^bQ Php4 $D (+I3ݳ_b$۞@[UD5Vik>HbE?uxmVn6y~TKN sXL$:;s :pvvRPxZ[[6WVǷ;)]TijP[yX] @+3^wUj[RKE.8̬/#T]F(y-tfC.:Duѳ6tOn>TDW#($N7ui%}M:x ֬/e\4Y<ꡖKS{‹u,LsЌvL滒0 a֧qj` N1KJ c zpF1p*kQ˚Ud-(, E,6+DsdO0$1,$yD?IANt˖?83e$YwzU~A00Sń yMCCc;P<\őEȒ< r@*PK&[DPK czx4 @Aedp/UX$D#DPKl|4H4} @2edp/.DS_StoreUXP)Dx )DPK |4 @A__MACOSX/UXP)DP)DPK |4 @A__MACOSX/edp/UXP)DP)DPKl|4 #wR @__MACOSX/edp/._.DS_StoreUXP)Dx )DPKx4˻* @dedp/edpUXP)DF0$DPKx4Ҥ @__MACOSX/edp/._edpUXP)DF0$DPK mx4 @A edp/tool/UX)D#DPK8v|4 @ edp/tool/orderUXP)D0)DPK |4 @AP __MACOSX/edp/tool/UXP)DP)DPK8v|4 #R @ __MACOSX/edp/tool/._orderUXP)D0)DPKm|4R @ edp/tool/RunUXP)D ")DPKm|4PQ  @T__MACOSX/edp/tool/._RunUXP)D ")DPK x4 @Aedp/toolbar/UX(D-0$DPK@x4fɄf @4edp/toolbar/Comment OutUXP)Dw#DPK |4 @A__MACOSX/edp/toolbar/UXP)DP)DPK@x4dw" @__MACOSX/edp/toolbar/._Comment OutUXP)Dw#DPK@x4J^I @edp/toolbar/Find Selected StringUXP)Dx#DPK@x4[ć= + @&__MACOSX/edp/toolbar/._Find Selected StringUXP)Dx#DPK@x4Wr~' @B edp/toolbar/Find Selected String - NextUXP)Dx#DPK@x4n7Dz2 @ __MACOSX/edp/toolbar/._Find Selected String - NextUXP)Dx#DPK@x43J+ @s$edp/toolbar/Find Selected String - PreviousUXP)Dx#DPK@x4_UjE 6 @$__MACOSX/edp/toolbar/._Find Selected String - PreviousUXP)Dx#DPK@x4d<  @R(edp/toolbar/IndentUXP)Dw#DPK@x4e.(=  @(__MACOSX/edp/toolbar/._IndentUXP)Dw#DPK@x4w57 @,edp/toolbar/Line Comment OutUXP)Dw#DPK@x4;r!' @,__MACOSX/edp/toolbar/._Line Comment OutUXP)Dw#DPK@x4y+ @/edp/toolbar/Multi-File Find Selected StringUXP)Dx#DPK@x4noU 6 @V0__MACOSX/edp/toolbar/._Multi-File Find Selected StringUXP)Dx#DPKx4f @4edp/toolbar/orderUXP)DF0$DPKx4 #R @T5__MACOSX/edp/toolbar/._orderUXP)DF0$DPK@x4  @5edp/toolbar/RedoUXP)Dx#DPK@x4$(\5  @(6__MACOSX/edp/toolbar/._RedoUXP)Dx#DPK@x4q  @9edp/toolbar/SaveUXP)Dx#DPK@x4ܳU  @v9__MACOSX/edp/toolbar/._SaveUXP)Dx#DPK@x4wV @<edp/toolbar/Time StampUXP)Dw#DPK@x4Ѐk E ! @P=__MACOSX/edp/toolbar/._Time StampUXP)Dw#DPK@x4S g  @@edp/toolbar/UndoUXP)Dx#DPK@x4&[D @&A__MACOSX/edp/toolbar/._UndoUXP)Dx#DPK'' CBfreefem++-3.61-1/missing000755 000767 000024 00000015330 13256636774 015224 0ustar00hechtstaff000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 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, see . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." 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 # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: freefem++-3.61-1/examples++-tutorial/000755 000767 000024 00000000000 13321644113 017403 5ustar00hechtstaff000000 000000 freefem++-3.61-1/README000644 000767 000024 00000000277 13312446271 014471 0ustar00hechtstaff000000 000000 REMARK: 1 mai 2018) on precompile version FreeFem++-3.60-MacOS_10.13.pkg to use petsc/slepc you need to install XQuartz form https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg freefem++-3.61-1/script/000755 000767 000024 00000000000 13321644107 015105 5ustar00hechtstaff000000 000000 freefem++-3.61-1/TODO000644 000767 000024 00000001257 13256636774 014320 0ustar00hechtstaff000000 000000 add doc: gsl interface imax of tableau Short time: build a true aniso 3d adaptation example to day bug in interface of mmg3d with metric and in tetgen ... long time: Add Finite Volume interface. Track: add the sup of a function on a mesh real uinfty=sup(Th,abs(f)); real uhinfty=sup(uh); Newton algorithm. automatique scheme for time depend problem: dt(u) or u_t implicite: problem a(u,v, sheme=Euler , dt = 0.1, tinit = 0, tfinal = 10 , previous=[u1]) = int2d( u_t*v + dx(u)*dx(v)+dy(u)*dy(v) ) ; explicit: problem a(u,v, sheme=thetaScheme(0.5) , dt = 0.1 , tinit = 0 , tfinal = 10 , previous=[u1]) = int2d( u_t*v) + int(dx(u1)*dx(v)+dy(u1)*dy(v)) ; freefem++-3.61-1/ax_lib_hdf5.m4000644 000767 000024 00000025034 13256636774 016235 0ustar00hechtstaff000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html # =========================================================================== # # SYNOPSIS # # AX_LIB_HDF5([serial/parallel]) # # DESCRIPTION # # This macro provides tests of the availability of HDF5 library. # # The optional macro argument should be either 'serial' or 'parallel'. The # former only looks for serial HDF5 installations via h5cc. The latter # only looks for parallel HDF5 installations via h5pcc. If the optional # argument is omitted, serial installations will be preferred over # parallel ones. # # The macro adds a --with-hdf5 option accepting one of three values: # # no - do not check for the HDF5 library. # yes - do check for HDF5 library in standard locations. # path - complete path to the HDF5 helper script h5cc or h5pcc. # # If HDF5 is successfully found, this macro calls # # AC_SUBST(HDF5_VERSION) # AC_SUBST(HDF5_CC) # AC_SUBST(HDF5_CFLAGS) # AC_SUBST(HDF5_CPPFLAGS) # AC_SUBST(HDF5_LDFLAGS) # AC_SUBST(HDF5_LIBS) # AC_SUBST(HDF5_FC) # AC_SUBST(HDF5_FFLAGS) # AC_SUBST(HDF5_FLIBS) # AC_DEFINE(HAVE_HDF5) # # and sets with_hdf5="yes". Additionally, the macro sets # with_hdf5_fortran="yes" if a matching Fortran wrapper script is found. # Note that Autconf's Fortran support is not used to perform this check. # H5CC and H5FC will contain the appropriate serial or parallel HDF5 # wrapper script locations. # # If HDF5 is disabled or not found, this macros sets with_hdf5="no" and # with_hdf5_fortran="no". # # Your configuration script can test $with_hdf to take any further # actions. HDF5_{C,CPP,LD}FLAGS may be used when building with C or C++. # HDF5_F{FLAGS,LIBS} should be used when building Fortran applications. # # To use the macro, one would code one of the following in "configure.ac" # before AC_OUTPUT: # # 1) dnl Check for HDF5 support # AX_LIB_HDF5() # # 2) dnl Check for serial HDF5 support # AX_LIB_HDF5([serial]) # # 3) dnl Check for parallel HDF5 support # AX_LIB_HDF5([parallel]) # # One could test $with_hdf5 for the outcome or display it as follows # # echo "HDF5 support: $with_hdf5" # # You could also for example, override the default CC in "configure.ac" to # enforce compilation with the compiler that HDF5 uses: # # AX_LIB_HDF5([parallel]) # if test "$with_hdf5" = "yes"; then # CC="$HDF5_CC" # else # AC_MSG_ERROR([Unable to find HDF5, we need parallel HDF5.]) # fi # # LICENSE # # Copyright (c) 2009 Timothy Brown # Copyright (c) 2010 Rhys Ulerich # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 11 AC_DEFUN([AX_LIB_HDF5], [ AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_AWK]) AC_REQUIRE([AC_PROG_GREP]) dnl Check first argument is one of the recognized values. dnl Fail eagerly if is incorrect as this simplifies case statements below. if test "m4_normalize(m4_default([$1],[]))" = "" ; then : # Recognized value elif test "m4_normalize(m4_default([$1],[]))" = "serial" ; then : # Recognized value elif test "m4_normalize(m4_default([$1],[]))" = "parallel"; then : # Recognized value else AC_MSG_ERROR([ Unrecognized value for AX[]_LIB_HDF5 within configure.ac. If supplied, argument 1 must be either 'serial' or 'parallel'. ]) fi dnl Add a default --with-hdf5 configuration option. AC_ARG_WITH([hdf5], AS_HELP_STRING( [--with-hdf5=[yes/no/PATH]], m4_case(m4_normalize([$1]), [serial], [location of h5cc for serial HDF5 configuration], [parallel], [location of h5pcc for parallel HDF5 configuration], [location of h5cc or h5pcc for HDF5 configuration]) ), [if test "$withval" = "no"; then with_hdf5="no" elif test "$withval" = "yes"; then with_hdf5="yes" else with_hdf5="yes" H5CC="$withval" fi], [with_hdf5="yes"] ) dnl Set defaults to blank HDF5_CC="" HDF5_VERSION="" HDF5_CFLAGS="" HDF5_CPPFLAGS="" HDF5_LDFLAGS="" HDF5_LIBS="" HDF5_FC="" HDF5_FFLAGS="" HDF5_FLIBS="" dnl Try and find hdf5 compiler tools and options. if test "$with_hdf5" = "yes"; then if test -z "$H5CC"; then dnl Check to see if H5CC is in the path. AC_PATH_PROGS( [H5CC], m4_case(m4_normalize([$1]), [serial], [h5cc], [parallel], [h5pcc], [h5cc h5pcc]), []) else AC_MSG_CHECKING([Using provided HDF5 C wrapper]) AC_MSG_RESULT([$H5CC]) fi AC_MSG_CHECKING([for HDF5 libraries]) if test ! -f "$H5CC" || test ! -x "$H5CC"; then AC_MSG_RESULT([no]) AC_MSG_WARN(m4_case(m4_normalize([$1]), [serial], [ Unable to locate serial HDF5 compilation helper script 'h5cc'. Please specify --with-hdf5= as the full path to h5cc. HDF5 support is being disabled (equivalent to --with-hdf5=no). ], [parallel],[ Unable to locate parallel HDF5 compilation helper script 'h5pcc'. Please specify --with-hdf5= as the full path to h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). ], [ Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). ])) with_hdf5="no" with_hdf5_fortran="no" else dnl Get the h5cc output HDF5_SHOW=$(eval $H5CC -show) dnl Get the actual compiler used HDF5_CC=$(eval $H5CC -show | $AWK '{print $[]1}') if test "$HDF5_CC" = "ccache"; then HDF5_CC=$(eval $H5CC -show | $AWK '{print $[]2}') fi dnl h5cc provides both AM_ and non-AM_ options dnl depending on how it was compiled either one of dnl these are empty. Lets roll them both into one. dnl Look for "HDF5 Version: X.Y.Z" HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ | $AWK '{print $[]3}') dnl A ideal situation would be where everything we needed was dnl in the AM_* variables. However most systems are not like this dnl and seem to have the values in the non-AM variables. dnl dnl We try the following to find the flags: dnl (1) Look for "NAME:" tags dnl (2) Look for "H5_NAME:" tags dnl (3) Look for "AM_NAME:" tags dnl HDF5_tmp_flags=$(eval $H5CC -showconfig \ | $GREP 'FLAGS\|Extra libraries:' \ | $AWK -F: '{printf("%s "), $[]2}' ) dnl Find the installation directory and append include/ HDF5_tmp_inst=$(eval $H5CC -showconfig \ | $GREP 'Installation point:' \ | $AWK '{print $[]NF}' ) dnl Add this to the CPPFLAGS HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" dnl Now sort the flags out based upon their prefixes for arg in $HDF5_SHOW $HDF5_tmp_flags ; do case "$arg" in -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_CPPFLAGS="$arg $HDF5_CPPFLAGS" ;; -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_LDFLAGS="$arg $HDF5_LDFLAGS" ;; -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ || HDF5_LIBS="$arg $HDF5_LIBS" ;; esac done HDF5_LIBS="$HDF5_LIBS -lhdf5" AC_MSG_RESULT([yes (version $[HDF5_VERSION])]) dnl See if we can compile ax_lib_hdf5_save_CC=$CC ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS ax_lib_hdf5_save_LIBS=$LIBS ax_lib_hdf5_save_LDFLAGS=$LDFLAGS CC=$HDF5_CC CPPFLAGS=$HDF5_CPPFLAGS LIBS=$HDF5_LIBS LDFLAGS=$HDF5_LDFLAGS AC_CHECK_HEADER([hdf5.h], [ac_cv_hadf5_h=yes], [ac_cv_hadf5_h=no]) AC_CHECK_LIB([hdf5], [H5Fcreate], [ac_cv_libhdf5=yes], [ac_cv_libhdf5=no]) if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then AC_MSG_WARN([Unable to compile HDF5 test program]) fi dnl Look for HDF5's high level library AC_HAVE_LIBRARY([hdf5_hl], [HDF5_LIBS="$HDF5_LIBS -lhdf5_hl"], [], []) CC=$ax_lib_hdf5_save_CC CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS LIBS=$ax_lib_hdf5_save_LIBS LDFLAGS=$ax_lib_hdf5_save_LDFLAGS AC_MSG_CHECKING([for matching HDF5 Fortran wrapper]) dnl Presume HDF5 Fortran wrapper is just a name variant from H5CC H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') if test -x "$H5FC"; then AC_MSG_RESULT([$H5FC]) with_hdf5_fortran="yes" AC_SUBST([H5FC]) dnl Again, pry any remaining -Idir/-Ldir from compiler wrapper for arg in `$H5FC -show` do case "$arg" in #( -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ || HDF5_FFLAGS="$arg $HDF5_FFLAGS" ;;#( -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ || HDF5_FFLAGS="$arg $HDF5_FFLAGS" dnl HDF5 installs .mod files in with libraries, dnl but some compilers need to find them with -I echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ || HDF5_FFLAGS="-I${arg#-L} $HDF5_FFLAGS" ;; esac done dnl Make Fortran link line by inserting Fortran libraries for arg in $HDF5_LIBS do case "$arg" in #( -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" ;; #( -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" ;; #( *) HDF5_FLIBS="$HDF5_FLIBS $arg" ;; esac done else AC_MSG_RESULT([no]) with_hdf5_fortran="no" fi AC_SUBST([HDF5_VERSION]) AC_SUBST([HDF5_CC]) AC_SUBST([HDF5_CFLAGS]) AC_SUBST([HDF5_CPPFLAGS]) AC_SUBST([HDF5_LDFLAGS]) AC_SUBST([HDF5_LIBS]) AC_SUBST([HDF5_FC]) AC_SUBST([HDF5_FFLAGS]) AC_SUBST([HDF5_FLIBS]) AC_DEFINE([HAVE_HDF5], [1], [Defined if you have HDF5 support]) fi fi ]) freefem++-3.61-1/Makefile.am000644 000767 000024 00000033726 13321622623 015647 0ustar00hechtstaff000000 000000 # Makefile for FreeFem++, adapted to Automake # ------------------------------------------- # Adaptation to Automake: Antoine Le Hyaric - LJLL Paris 6 - # lehyaric@ann.jussieu.fr - 13/5/04 SUBDIRS=download src examples++-load examples++-mpi \ examples++-tutorial examples++ \ examples++-eigen \ examples++-bug examples++-chapt3 examples++-other \ examples++-3d examples++-hpddm EXTRA_DIST=test-driver-ff regtests.sh config-wrapper.h \ FreeFem++.mcp HISTORY HISTORY_BEFORE_2005 BUGS TODO regtests.m4 \ INSTALL INSTALL-MacOSX INNOVATION \ WindowsPackage.m4 README_COMPILATION.md README_ARPACK.md README_WINDOWS.md README_MAC.md \ logo.ico copysharedlibs.sh COPYRIGHT edp.nedit reconfigure \ mode-mi-edp.zip aclocal.m4 acmacros.m4 acoptim.m4 ax_lib_hdf5.m4 \ freefem++.spec \ Install-MacOS.command.in \ examples-bamg/NACA012/naca.awk examples-bamg/quadloop/dotest.pl \ examples-bamg/square/*_g.* examples-bamg/square/do* examples-bamg/NACA012/[adp]* \ examples-bamg/test/dotest*.pl 0ldUserReadMe.txt CheckAllEdp CheckAll \ WHERE_LIBRARY-mkl FreeFem++-CoCoa.in \ uninstall-ff++ \ ./build/cleancrlf ./build/download ./build/links2files \ ./build/orgindex ./build/ff-md5 script/PostInstall.m4 \ web/download.php web/index.php web/macosx.php web/menu.php web/phpfiles.php \ web/ffstyle.css web/linux.php web/main.php web/news.php web/windows.php \ FreeFem++.app.tgz FF_MAC_PREFIX=FreeFem++v$(VERSION)$(ADD_PACKAGE_NAME) FF_EXAMPLES_FILES = COPYRIGHT HISTORY HISTORY_BEFORE_2005 README_COMPILATION.md README_WINDOWS.md README_MAC.md BUGS TODO INSTALL INSTALL-MacOSX INNOVATION \ mode-mi-edp.zip \ examples++-tutorial/aile.msh examples++-tutorial/xyf \ examples++-3d/dodecaedre01.mesh \ examples++-3d/lac-leman-v4.msh \ examples++-load/load.link \ examples++-load/cube.msh \ examples++-load/fig.pgm examples++-load/lg.pgm \ ./examples++-mpi/regtests.sh ./examples++-other/speedtest.sh \ ./download/fftw/Makefile ./download/fftw/Makefile.am \ examples++*/*.[ie]dp CheckAllEdp \ examples++-load/ch.pts examples++-load/g.gmesh # Creates a file named "ChangeLog" containing the chronology of all # modifications to the source files. Needs "cvs2cl" to be installed. changelog: cvs2cl # try and avoid running this under fakeroot (otherwise we may face # problems trying to connect to CVS as pseudo-root). Debian packaging # uses fakeroot. history: if test "$$FAKED_MODE" = ""; then\ hg log >HISTORY ;\ fi documentation: rm freefem++doc.pdf $(WGET) https://github.com/FreeFem/FreeFem-doc-pdf/raw/master/freefem%2B%2Bdoc.pdf # cd DOC && $(MAKE) $(AM_MAKEFLAGS) documentation #DOC/freefem++doc.pdf: # cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) clean-local:: -find . \( -name '*~' -or -name ListOfUnAllocPtr.bin \) |xargs rm -rm examples*/*.eps # "dist" targets clean-local:: -rm freefem++-*.tar.gz freefem++-*.zip -rm Output/FreeFem++-*.exe # Reduced compilation # ------------------- quick: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/std && $(MAKE) $(AM_MAKEFLAGS) nw: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/nw && $(MAKE) $(AM_MAKEFLAGS) bamg: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/bamg && $(MAKE) $(AM_MAKEFLAGS) ide: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd download && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/ide && $(MAKE) $(AM_MAKEFLAGS) FreeFem++-cs$(EXEEXT) # Cleaning generated files which are stored in the CVS repository, to # avoid technical CVS conflicts. clean-gen: ./cleanregen.sh # Testing # ------- # The standard automake goal "make check" is also valid. It just does # not run any test that could prevent the user from working on its # machine (because of unexpected windows opening right in the middle # of the workspace). visualcheck: all $(MAKE) $(AM_MAKEFLAGS) check VISUALCHECK=yes speedtest: all cd examples++-other && $(MAKE) $(AM_MAKEFLAGS) check # Windows package # --------------- # Windows package script (for Inno Setup). We extract version # information from the Debian Changelog to get the package release # number as well. win32:WindowsPackage.iss test ! -d examples++-load/include-tmp || rm -r examples++-load/include-tmp cd examples++-load;tar zxvf include.tar.gz;mkdir include-tmp;cp -Lr *.h include/* include-tmp /c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/ISCC.exe "`cygpath.exe WindowsPackage.iss`" WindowsPackage.iss: WindowsPackage.m4 configure.ac Makefile.am m4 -DVERSION='$(VERSION)$(ADD_PACKAGE_NAME)' \ -DMPIPROG='$(MPIPROG)' -DSIZEOFPTR='$(SIZEOF_PTRINBIT)' \ -DHOSTOS='$(host_os)' WindowsPackage.m4 > WindowsPackage.iss echo loadpath += '"!\."' >freefem++.pref echo includepath += '"!\idp"' >>freefem++.pref # Debian package # -------------- deb: dpkg-buildpackage -rfakeroot @echo Now run CopyToServer.sh in debian subdirectory # Build all versions # ------------------ nativeX: $(FF_MAC_PREFIX)_MacOsX.tgz echo "done" MacOsX: FreeFem++.app.tgz -rm -rf OsXxx mkdir -p OsXxx/Applications/ make install DESTDIR="`pwd`/OsXxx" tar zxvf FreeFem++.app.tgz -C OsXxx/Applications/ cd OsXxx;tar cvfz ../$(FF_MAC_PREFIX)_MacOsX.tgz . rm -rf OsXxx clean-local:: -rm freefem++-$(VERSION).tar.gz -rm -rf FreeFem++v*_MacOS # Native MacOS packaging # ---------------------- install-exec-local:: test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa script/PostInstall.sh $(mkinstalldirs) -m 755 $(DESTDIR)$(pkgdatadir)/$(VERSION) test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/etc/paths.d/ test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/usr/local/bin tar cvf - $(FF_EXAMPLES_FILES)| (cd $(DESTDIR)$(pkgdatadir)/$(VERSION); tar xvf -) $(INSTALL_SCRIPT) CheckAll CheckAllEdp $(DESTDIR)$(pkgdatadir)/$(VERSION) $(mkinstalldirs) -m 755 $(DESTDIR)${bindir} test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)${bindir} test `uname` != Darwin || echo $(bindir) >$(DESTDIR)/etc/paths.d/FreeFem++ test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)/usr/local/bin test `uname` != Darwin || ( $(MAKE) FreeFem++.app.tgz ; test -d $(DESTDIR)/Applications || mkdir $(DESTDIR)/Applications ; tar zxf FreeFem++.app.tgz -C $(DESTDIR)/Applications ) script/PostInstall.sh:./Makefile script/PostInstall.m4 m4 script/PostInstall.m4 "-DFF__FVER=$(PACKAGE_VERSION)" "-DFF_BINDIR=$(bindir)" "-DFF__DATADIR=$(pkgdatadir)" >script/PostInstall.sh chmod a+x script/PostInstall.sh ListFiles-natives: .FORCE test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa echo $(FF_EXAMPLES_FILES) >$@ echo ./download/fftw/Makefile ./download/fftw/Makefile.am >>$@ find . -name '*.[ei]dp' -o -name '*.h*' -o -name '*.cpp' -o -name '*.pgm' |egrep '[.]/examples++' >>$@ find . -name '*.h*' -o -name '*.cpp' |egrep '[.]/examples++' >>$@ List-agl-dylib: src/nw/FreeFem++ otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {print $$1}' >$@ CheckMacLib.sh: src/nw/FreeFem++ echo "for i in `otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@ chmod a+x $@ CheckMPIMacLib.sh: src/mpi/FreeFem++-mpi echo "for i in `otool -L src/mpi/FreeFem++-mpi|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@ chmod a+x $@ .FORCE: $(FF_MAC_PREFIX)_Macos:documentation ListFiles-natives -mkdir $@ cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - ) /Developer/Tools/CpMac "FreeFem++(Carbon)" $@/FreeFem++ cp freefem++-doc.pdf $@ $(FF_MAC_PREFIX)_MacOsX: all documentation ListFiles-natives List-agl-dylib -mkdir $@ cp freefem++doc.pdf $@ cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - ) cd $@ ; tar zxf ../src/agl/FreeFem++.app.tgz sed $@/FreeFem++.app/Contents/Info.plist \ -e "s/@VVERSION@/$(VERSION)$(ADD_PACKAGE_NAME)/g" \ -e "s/@DATE@/`date`/g" cp src/nw/FreeFem++ $@/FreeFem++.app/Contents/bin cp src/nw/ffglut $@/FreeFem++.app/Contents/bin cp src/medit/ffmedit $@/FreeFem++.app/Contents/bin cp examples++-load/ff-get-dep $@/FreeFem++.app/Contents/bin cp examples++-load/ff-pkg-download $@/FreeFem++.app/Contents/bin sed $@/FreeFem++.app/Contents/bin/ff-c++ -e 's;FFAPPLI_INC;$@/FreeFem++.app/Contents/include;' chmod a+x $@/FreeFem++.app/Contents/bin/ff-c++ -mkdir $@/FreeFem++.app/Contents/include -mkdir $@/FreeFem++.app/Contents/idp cp examples++-load/include/* $@/FreeFem++.app/Contents/include cp examples++-load/*.dylib $@/FreeFem++.app/Contents/lib cp examples++-*/*.idp $@/FreeFem++.app/Contents/idp -if [ -s List-agl-dylib ]; then tar zchvf $@/OtherMacOsLib.tgz `cat List-agl-dylib`; fi; ./config.status --file=$@/Install-MacOS.command:Install-MacOS.command.in chmod a+rx $@/Install-MacOS.command -mkdir $@/FreeFem++.app/Contents/etc echo loadpath += \"./\" >$@/FreeFem++.app/Contents/etc/freefem++.pref echo loadpath += \"$(ff_prefix_dir)/lib\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref echo includepath += \"$(ff_prefix_dir)/edp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref echo includepath += \"$(ff_prefix_dir)/idp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref $(FF_MAC_PREFIX)_MacOsX.tgz: $(FF_MAC_PREFIX)_MacOsX tar zcvf $(FF_MAC_PREFIX)_MacOsX.tgz $(FF_MAC_PREFIX)_MacOsX # Linux binary-only package # ------------------------- # Include kernel and libc version in static package name PACKAGE_NAME=FreeFem++v$(VERSION)_linux-$(KERNEL_VERSION)_$(LIBC_VERSION)$(OPTIM_TYPE) linux-package: $(PACKAGE_NAME).tgz # No direct dependency to "all" to be able to debug the packaging # procedure on its own. $(PACKAGE_NAME): ListFiles-natives cat ListFiles-natives|xargs tar cfh - | (cd $@ ; tar xf - ) -mkdir $@ cp src/std/FreeFem++ $@ ./copysharedlibs.sh src/std/FreeFem++ $@ cp src/nw/FreeFem++-nw $@ ./copysharedlibs.sh src/nw/FreeFem++-nw $@ cp src/ide/FreeFem++-cs $@ ./copysharedlibs.sh src/ide/FreeFem++-cs $@ cp src/ide/FreeFem++-server $@ ./copysharedlibs.sh src/ide/FreeFem++-server $@ cp src/ide/FreeFem++-client $@ ./copysharedlibs.sh src/ide/FreeFem++-client $@ -cp src/glx/FreeFem++-glx $@ -./copysharedlibs.sh src/glx/FreeFem++-glx $@ -cp src/mpi/FreeFem++-mpi $@ -./copysharedlibs.sh src/mpi/FreeFem++-mpi $@ $(PACKAGE_NAME).tgz: $(PACKAGE_NAME) tar cvzf $@ $< clean-local:: -rm -r $(PACKAGE_NAME) $(PACKAGE_NAME).tgz autofiles:AutoGeneratedFile.tar.gz LIST_GENERATE_FILE= \ download/umfpack/Makefile.in examples++-tutorial/Makefile.in src/femlib/Makefile.in \ Makefile.in examples++-3d/Makefile.in examples++/Makefile.in src/fflib/Makefile.in \ config.h.in examples++-bug/Makefile.in src/Algo/Makefile.in src/lglib/Makefile.in \ configure examples++-chapt3/Makefile.in src/Graphics/Makefile.in src/libMesh/Makefile.in \ download/Makefile.in examples++-eigen/Makefile.in src/Makefile.in src/medit/Makefile.in \ download/arpack/Makefile.in examples++-load/Makefile.in src/bamg/Makefile.in src/mpi/Makefile.in \ download/blas/Makefile.in examples++-mpi/Makefile.in src/bamglib/Makefile.in src/nw/Makefile.in \ download/fftw/Makefile.in examples++-other/Makefile.in src/bin-win32/Makefile.in examples++-hpddm/Makefile.in LIST_GENERATE_FILE_AM= \ download/umfpack/Makefile.am examples++-tutorial/Makefile.am src/femlib/Makefile.am \ Makefile.am examples++-3d/Makefile.am examples++/Makefile.am src/fflib/Makefile.am \ examples++-bug/Makefile.am src/Algo/Makefile.am src/lglib/Makefile.am \ configure.ac examples++-chapt3/Makefile.am src/Graphics/Makefile.am src/libMesh/Makefile.am \ download/Makefile.am examples++-eigen/Makefile.am src/Makefile.am src/medit/Makefile.am \ download/arpack/Makefile.am examples++-load/Makefile.am src/bamg/Makefile.am src/mpi/Makefile.am \ download/blas/Makefile.am examples++-mpi/Makefile.am src/bamglib/Makefile.am src/nw/Makefile.am \ download/fftw/Makefile.am examples++-other/Makefile.am src/bin-win32/Makefile.am examples++-hpddm/Makefile.am #$(LIST_GENERATE_FILE):$(LIST_GENERATE_FILE_AM) # @echo "WARNING the configure file is older than configure build flies" # @echo "Rebuild configure: do one the three case" # @echo " if you have autoconf # make conf" # @echo " or without # make conf-without-autoconf" # @echo " or by pass this problem # make conf-touch" conf: autoreconf ./config.status --recheck conf-without-autoconf: tar zxvf AutoGeneratedFile.tar.gz ./config.status --recheck conf-touch: touch $(LIST_GENERATE_FILE) AutoGeneratedFile.tar.gz:$(LIST_GENERATE_FILE) configure.ac tar cvfz $@ $(LIST_GENERATE_FILE) FreeFem++-CoCoa:FreeFem++-CoCoa.in ./config.status ./config.status --file="FreeFem++-CoCoa:FreeFem++-CoCoa.in" FreeFem++.app.tgz:./config.status tar zxf FreeFem++.app.tgz ./config.status --file=FreeFem++.scrpt-txt:FreeFem++.scrpt-txt.in -rm FreeFem++.app/Contents/Resources/Scripts/main.scpt osacompile Makefile-for-Checkam echo '@false'| tr '@' '\t' >> Makefile-for-Checkam if $(MAKE) -f Makefile-for-Checkam 2>&1 >/dev/null ; \ then ok=1 ; \ else \ $(MAKE) -f Makefile-for-Checkam ; \ echo "Need to rebuid configure and Makefile files " ;\ echo "Do autoreconf -i or tar zxvf tar zxvf AutoGeneratedFile.tar.gz" ;\ echo " and ./reconfigure" ;\ ok=0; \ fi ; \ test $$ok -eq 1 freefem++-3.61-1/WHERE_LIBRARY-mkl000644 000767 000024 00000000645 13256636774 016372 0ustar00hechtstaff000000 000000 blas LD '-L@MKLDIR@/lib/@MKL_ARCH@ -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lm -lpthread ' blas INCLUDE '-I@MKLDIR@/include' lapack LD '-L@MKLDIR@/lib/@MKL_ARCH@ -llibmkl_lapack' lapack INCLUDE '-I@MKLDIR@/include' scalapack LD '-L@MKLDIR@/lib/@MKL_ARCH@ -lmkl_scalapack_lp64' scalapack INCLUDE '-I@MKLDIR@/include' blacs LD '-L@MKLDIR@/lib/@MKL_ARCH@ -lmkl_blacs_lp64' blacs INCLUDE '-I@MKLDIR@/include' freefem++-3.61-1/regtests.sh000755 000767 000024 00000004323 13256636774 016024 0ustar00hechtstaff000000 000000 #!/bin/bash # Runs all regression tests on all compiled FreeFem++ versions # ------------------------------------------------------------ MPIRUN=`awk '$1 =="MPIRUN" {print $3}' Makefile` # Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 19/5/04 # $Id$ # To run one set of tests on one executable # $1=program to run # $2=tag for trace file # $3=EDP script to run function dotest(){ # Running FreeFem++ on regtests.edp (specific to regression # tests), otherwise on all.edp. echo regtests.sh: running $1 $3, result in regtests-$2.log $1 $3|tee regtests-$2.log if test $PIPESTATUS != 0 then exit 1 fi } # For the example++-load tests export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." # In visual checks, we can run even the most invasive programs script=$REGEDP if test "$VISUALCHECK" = yes -a "$REGEDP" = regtests.edp then script=all.edp fi # Number of processors in parallel mode if test "$NPROCS" != "" then nprocs=$NPROCS else nprocs=1 fi # Do not test windowed programs by default, because their windows are # too invasive. if test "$VISUALCHECK" = yes then export PATH="${PROGLOC}/nw/:$PATH"; dotest FreeFem++${EXEEXT} std $script fi if test $nprocs = 1 then dotest ${PROGLOC}/nw/FreeFem++-nw${EXEEXT} nw $script fi if test "${X11PROG}" != "" -a "${VISUALCHECK}" = "yes" then dotest ${PROGLOC}/x11/FreeFem++-x11${EXEEXT} x11 $script fi if test "${GLXPROG}" != "" -a "${VISUALCHECK}" = "yes" then dotest ${PROGLOC}/glx/FreeFem++-glx${EXEEXT} glx $script fi if test "${AGLPROG}" != "" -a "${VISUALCHECK}" = "yes" then dotest ${PROGLOC}/agl/FreeFem++-agl${EXEEXT} agl $script fi if test "${MPIPROG}" != "" then mpich=`${MPIRUN=mpirun} -h 2>&1 |grep mpich |wc -l` host=`hostname` echo $host>machinefile echo $host>>machinefile if [ $mpich -ne 0 ] ; then dotest "${MPIRUN} -np $nprocs -machinefile machinefile ${PROGLOC}/mpi/FreeFem++-mpi${EXEEXT}" mpi $script else [[ -f "$(which lamboot 2>/dev/null)" ]] && lamboot dotest "${MPIRUN} -np $nprocs ${PROGLOC}/mpi/FreeFem++-mpi${EXEEXT}" mpi $script fi fi if test "${IDEPROG}" != "" -a "${VISUALCHECK}" = "yes" then dotest ${PROGLOC}/ide/FreeFem++-cs${EXEEXT} ide $script fi freefem++-3.61-1/config-wrapper.h000755 000767 000024 00000000543 13256636774 016724 0ustar00hechtstaff000000 000000 // Include a platform-specific configuration file // ---------------------------------------------- // $Id$ // This wrapper is necessary for platforms where the configure script // does not run. #ifndef CONFIG_WRAPPER_H #define CONFIG_WRAPPER_H #ifdef __MWERKS__ #include "config-macos9.h" #else #include #endif #endif // CONFIG_WRAPPER_H freefem++-3.61-1/config.sub000755 000767 000024 00000106444 13256636774 015617 0ustar00hechtstaff000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-07-28' # 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 3 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, see . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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 ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; 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 ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 | 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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; 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 ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -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* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -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* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; 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 ;; -cnk*|-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: freefem++-3.61-1/COPYING000644 000767 000024 00000001751 13256636773 014661 0ustar00hechtstaff000000 000000 // // SUMMARY: FreeFem++ // RELEASE: 2 // USAGE : // AUTHOR: F. Hecht, O. Pironneau // ORG : Universit Pierre et Marie Curie, Paris, France // E-MAIL : Hecht@ann.jussieu.fr // // ORIG-DATE: November 2001 /* 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 */freefem++-3.61-1/ax_lib_gsl.m4000644 000767 000024 00000011743 13256636774 016176 0ustar00hechtstaff000000 000000 # Configure path for the GNU Scientific Library # Christopher R. Gabriel , April 2000 AC_DEFUN([AX_PATH_GSL], [ AC_ARG_WITH(gsl-prefix,[ --with-gsl-prefix=PFX Prefix where GSL is installed (optional)], gsl_prefix="$withval", gsl_prefix="") AC_ARG_WITH(gsl-exec-prefix,[ --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional)], gsl_exec_prefix="$withval", gsl_exec_prefix="") AC_ARG_ENABLE(gsltest, [ --disable-gsltest Do not try to compile and run a test GSL program], , enable_gsltest=yes) if test "x${GSL_CONFIG+set}" != xset ; then if test "x$gsl_prefix" != x ; then GSL_CONFIG="$gsl_prefix/bin/gsl-config" fi if test "x$gsl_exec_prefix" != x ; then GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config" fi fi AC_PATH_PROG(GSL_CONFIG, gsl-config, no) min_gsl_version=ifelse([$1], ,0.2.5,$1) AC_MSG_CHECKING(for GSL - version >= $min_gsl_version) no_gsl="" if test "$GSL_CONFIG" = "no" ; then no_gsl=yes else GSL_CFLAGS=`$GSL_CONFIG --cflags` GSL_LIBS=`$GSL_CONFIG --libs` gsl_major_version=`$GSL_CONFIG --version | \ sed 's/^\([[0-9]]*\).*/\1/'` if test "x${gsl_major_version}" = "x" ; then gsl_major_version=0 fi gsl_minor_version=`$GSL_CONFIG --version | \ sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'` if test "x${gsl_minor_version}" = "x" ; then gsl_minor_version=0 fi gsl_micro_version=`$GSL_CONFIG --version | \ sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'` if test "x${gsl_micro_version}" = "x" ; then gsl_micro_version=0 fi if test "x$enable_gsltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GSL_CFLAGS" LIBS="$LIBS $GSL_LIBS" rm -f conf.gsltest AC_TRY_RUN([ #include #include #include char* my_strdup (const char *str); char* my_strdup (const char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (void) { int major = 0, minor = 0, micro = 0; int n; char *tmp_version; system ("touch conf.gsltest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_gsl_version"); n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) ; if (n != 2 && n != 3) { printf("%s, bad version string\n", "$min_gsl_version"); exit(1); } if (($gsl_major_version > major) || (($gsl_major_version == major) && ($gsl_minor_version > minor)) || (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro))) { exit(0); } else { exit(1); } } ],, no_gsl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gsl" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GSL_CONFIG" = "no" ; then echo "*** The gsl-config script installed by GSL could not be found" echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GSL_CONFIG environment variable to the" echo "*** full path to gsl-config." else if test -f conf.gsltest ; then : else echo "*** Could not run GSL test program, checking why..." CFLAGS="$CFLAGS $GSL_CFLAGS" LIBS="$LIBS $GSL_LIBS" AC_TRY_LINK([ #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GSL or finding the wrong" echo "*** version of GSL. If it is not finding GSL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GSL was incorrectly installed" echo "*** or that you have moved GSL since it was installed. In the latter case, you" echo "*** may want to edit the gsl-config script: $GSL_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi # GSL_CFLAGS="" # GSL_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GSL_CFLAGS) AC_SUBST(GSL_LIBS) rm -f conf.gsltest ]) AU_ALIAS([AM_PATH_GSL], [AX_PATH_GSL]) freefem++-3.61-1/compile000755 000767 000024 00000007072 13256636774 015207 0ustar00hechtstaff000000 000000 #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2003-11-09.00 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit 0 ;; -v | --v*) echo "compile $scriptversion" exit 0 ;; esac prog=$1 shift ofile= cfile= args= while test $# -gt 0; do case "$1" in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we do something ugly here. ofile=$2 shift case "$ofile" in *.o | *.obj) ;; *) args="$args -o $ofile" ofile= ;; esac ;; *.c) cfile=$1 args="$args $1" ;; *) args="$args $1" ;; esac shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$prog" $args fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 # Run the compile. "$prog" $args status=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir $lockdir exit $status # 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: freefem++-3.61-1/NEWS000644 000767 000024 00000000000 13256636774 014310 0ustar00hechtstaff000000 000000 freefem++-3.61-1/download/000755 000767 000024 00000000000 13321644110 015402 5ustar00hechtstaff000000 000000 freefem++-3.61-1/README_COMPILATION.md000644 000767 000024 00000007251 13312446271 016725 0ustar00hechtstaff000000 000000 # Compilation of FreeFem++ and bamg (mesh generator) under Unix, MacOs X or MinGW (Windows) Read the following links, depending on your system for installation instructions: * [FreeFem-doc](https://github.com/FreeFem/FreeFem-doc) -> Documentation website -> Installation * [http://www.freefem.org/ff++/linux.php](http://www.freefem.org/ff++/linux.php) or [web/linux.php ](https://github.com/FreeFem/FreeFem-sources/blob/master/web/linux.php) * [http://www.freefem.org/ff++/windows.php](http://www.freefem.org/ff++/windows.php) or [web/windows.php](https://github.com/FreeFem/FreeFem-sources/blob/master/web/windows.php) * [http://www.freefem.org/ff++/macosx.php](http://www.freefem.org/ff++/macosx.php) or web/[macosx.php](https://github.com/FreeFem/FreeFem-sources/blob/master/web/linux.php) Now (april 2018), the PDF doc is on GitHub on https://github.com/FreeFem/FreeFem-doc-pdf/ ## To use a specific configuration file Create file `config.param` and use the shell script: ```bash ./reconfigure ``` to reconfigure your system ## Examples of `config.param` files: ### Used for the precompiled MacOS version: ```bash $ cat config.param '--enable-download' '--enable-optim' '--enable-m64' 'F77=ifort' 'FC=ifort' '--enable-maintainer-mode' '--with-mkl=/opt/intel/mkl/lib' '--with-petsc=/usr/local/ff++/mpich/petsc/lib/petsc/conf/petscvariables' '-with-hdf5=/usr/local/ff++/mpich/bin/h5cc' '--with-gsl-prefix=/usr/local/ff++/mpich/' '--disable-pastix' '--with-mpipath=/usr/local/ff++/mpich/bin/' ``` ### Used for the MSWindows precompiled version: ```bash $ cat /Volumes/C/msys64/home/hecht/ff++/config.param '-with-glut=-lfreeglut -lglu32 -lopengl32 -lwinmm -lgdi32 -Wl,--subsystem,windows' '-without-mpi' '-with-blas=/home/hecht/64/bin/libopenblas.dll' '-with-lapack=/home/hecht/64/mingw/bin/libopenblas.dll' '--disable-hips' '--disable-pastix' '--enable-download' 'CXX=x86_64-w64-mingw32-g++' 'FC=x86_64-w64-mingw32-gfortran' 'F77=x86_64-w64-mingw32-gfortran' 'CC=x86_64-w64-mingw32-gcc' ``` ### Used for the Ubuntu version #### without MPI ```bash $ cat config.param '--enable-download' '--without-mpi' ``` #### with MPI ```bash $ cat config.param '--enable-download' ``` freefem++-3.61-1/HISTORY000644 000767 000024 00005365657 13321622623 014717 0ustar00hechtstaff000000 000000 * 6c8d9334527679c889a37edf9cc854b3771e92ba (HEAD -> develop) correct web site of windows install * 16fe542f6e063536d1ce7ca3103817ed3c10a683 (origin/develop) coorect bug in trunc in case of very fine mesh (eps too small ) thank to florian.feppon@polytechnique.edu * 557ea2610c22a0b856e2cb9d834ac5c62d158858 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ | * 2f6ad1bfc822b635478a6f1f476dd42713b3b0db Spurious output. * | 37a88879b256d1b2fbe093c977990546507ddf5f add missing file * | 39cb8e2a17738ff7f0887b1ed8546ff4f6edaa97 add plugin to Save Matrix in Harwell-Boeing format. Thank to Hiroshi Fujiwara, fujiwara (ATMARK) acs.i.kyoto-u.ac.jp |/ * 41465166a95bf73d93fa1f50c466daee8da984a7 Try to add call to ddot and zdotu zdotc in RNM correct configure.ac to set HAVE_MKL, HAVE_BLAS coorecty warning with usage of cbals_zdot{uc}_stub * ae6330e600f16a0385a16a4a96dac3241cb9b1ff deployement script fix [skip ci] * 67cf734adeb6991bae8b4bf10a95b9f9e170d158 modify deployment scripts * 59dc1cb912d8e3c98d0f9c1049e50eeaa94c7dda rebuild AutoGeneratedFile.tar.gz * d65630e230045152b8a3caa754a3fac254871c94 coorect type in build win32 target * 1da5fbd6ce5cf80444c86c313a52d7f9a5469892 coorect miss placed ./copy-dll.sh in src/bin-win32/Makefile.am * 2fc604d47b1b4a897544eb22d31e7c83aa7adc84 correct memory leak in case of throw in 2d mesh generation * 8894a830dcfefa8cae2b0d0f3bf7ce3f893a3417 coorect typo in comment * cd03e877e2e1d7a26461394b608ef4df3fab9923 add tools to build mesh with alea (for test) * 4d5e61f0c4bd37172e5952483dfda2853de5d580 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ | * 84e705d0213ceca3a306f739909014a3df3dbdcc README / download / tools * | 8e70391736c0d9465b0fa539e4f0861183f050a4 add change of window install |/ * b68d3cc831fe9a2e69fe9571099a1e80fe3b2a35 (tag: 3.61, origin/master, origin/hotfixes, origin/HEAD, master) Merge branch 'master' of https://github.com/FreeFem/FreeFem-sources merge master and develop branch |\ | * de93b3e5a4197ce1633a119e16148b2ff325a796 Revert "add rescue third-party server" | * 3921224000e970d9b5824cec5e2ebe1bda2756d5 add rescue third-party server | * 175d5af08ca6b2ddb66b172a3c3fcf21c251d014 (tag: v3.60) Merge branch 'develop' | |\ | * | 4565b17ae19b984f339e67e85e8b901d3d26f241 take download/arpack/Makefile.am from develop * | | bca981a8d07d6278dfdff3ced851b48520a15519 (tag: v3.61) pass to version 3.61 * | | 212970f0c60cc789d636d0c46de766221142f7e5 Missing lib dep * | | 1d15ad331a94813c06d89da6b0c45e3fc9369805 add rescue third-party server * | | 86ba4395fe026771dfc7ff1ebe3c7ef6847ac2ca Missing dep library * | | a21908ef7265147c2b95ce562e8d52d1d10aa7a4 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | 4a917a77b29f87821475b834fbee77f9f776a754 bug & style fix in examples++-load | * | | aa3ec8875ab1deb647377673c436f3ed061ab26f fix Windows 64bits bug | * | | c5dc41e11f53f4f3bf7a3c0ee5b167fb82aec904 some bug fix in C/C++ examples++-load | * | | 1aee97258c16c5c843a74d01280cb8296ae5ed5b bug fix README | * | | 5bf94bc68be3c1d8d12b73eee9df127e16ca44ad update README | * | | 4fd8269a01fb9de296bef9adae7128b2abac5df8 modify README.md * | | | 7215ef228686ac9cb9bab8542eec5b18a9d71e7e call missing lib |/ / / * | | 9fdc946fb96a5cff0a753b30c394d6e666ca8520 change type of kernel data of dissecrion solver. correct pb with notaregion set to int because label/region are int correct web site * | | 4840d35c37c25cfbd7a49e8b3da7fe30ba59aaa6 add Windows slaves - in deployment * | | dab0f252c530c1bb5abe69620d2e6d8b9d4efb9f update lauchff++ to find file in case of no parameter * | | 5900ac6ba7a6d6af983bc316ce64f8a6e2eac3e8 restore delete file * | | 2dea51b8fd74a5514d6edd334afdd91b36cb42bf add 3 named parameter in matrix definition for A. Suzuki to get kernel data of a sparse matrix. ` * | | 76f91a7865241794b6e8172b28e115ae949083fc add missing .dll in windows distrubution * | | d207cd2010493cb1217fb5ca4fd1d0bb11f51822 clean some examples/tutorials scripts * | | 7307b593090163ba0226c4242693e81f89943416 coorect insatll pestc DESTDIR with version 3.9 * | | a5854fbd239b5c7c8d54e185d7e383358d2c6aa7 correct reconfigure missing a dir in path add tools to couple the Circumcenter of all traingle in a mesh * | | 5c6ebc32c66699e1da1d5b9e467af8f3f0acb0c7 change te version of downlaod petsc et slepc to 3.9.2 / 3.9.1 * | | 458d8aecba77ced4f0e218a34a194f723ab2a68f Fixes for block matrices not using MPIBAIJ. * | | 30185537c349e8bb322c1607e0fe55fef0761521 add init arry of string and print * | | 651dfa03b0e209867ba0497d0df7e970f8c45c00 I will see Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | 552570e777a11f6823635e0f370fcdd3a9f4b95c Update lgbmo.cpp | * | | 2bb5105728a7048d0902464cc6f2663957f7957c Update ClosePoints.cpp | * | | a0f46c239af712ad9ebbd2a196bfdf62d067604b Update pcm2rnm.cpp | * | | 3fadf8b572afe8c94b7e07bed84edae1a0c4e6d6 Update ff-mmap-semaphore.cpp | * | | aa0f13d9c8de0b3f483de2bac304cd39b8a39cf5 Clean C/C++ code of examples++-load * | | | 784d5e4a3a3b1331dfe9f150e5156606ec02c601 make README_GIT.md more pretty |/ / / * | | adad171deccc25f658efcd618db4cc0cb223d48c remove old file * | | f3d18543ef1e577a30bae69fa49b0350bc3b6f39 modify uncrustify file, a functionnality is bugged * | | 079f9e7dcff7c8f82c9d7cab6fbac0575e22367d update linux file compile * | | ea9d3262e3169045420faac8ad77c702dee875aa Fixes segfaults for students who use split < 0. * | | 6036d73bcdc05db5e84be040660642fd6523ffba remove PaStiX from ff-petsc * | | 1a6be62d840c411cf6e0f6c1fe5d825cdd15c076 corrected typo in printf * | | 40d22622acb1f567bc244ec9b36dd3ea54cd0988 Fix for old MKL versions. * | | a9a6b6cc3aa17fcb1ccf4856c2cb941e1dc7d369 coorect bug in readmesh 3d in case of error * | | e9ed452e39db94d9b2eb0cc9263232210397a0d1 Revert a small change. * | | 0604bb4ca6f20b3872e616a3f5136d69933eea04 Multiple improvements to the PETSc/SLEPc interface. * | | f101f5aae0708353c583adf2d1ee17fd4553725c medit bug fix 4 * | | de70253e028939d810f2681457c7312a973d1bd4 add modif for mesh intersection in 2d * | | 14f163948c0537142344d5522eaafc2237cdb517 add modif for mesh intersection tools in 2d Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | ec9fd55229f911ee38001bac27655615f1767e7e medit bug fix 3 | * | | 149045adb66e393948bd18a828e9261be27a6e57 forgot one ; | * | | 1c83aaa98c2005053ddc462323622815a7ccfc61 medit bug fix 2 | * | | 3f29b33ce697161e231cd7e50610fdbee945fb38 medit bug fix | * | | bd791ae24e0dea8616dad0a190badfb5d2ea7292 uncrustify medit + codacy bug fix | * | | 2c23e6ac6170cbd2e60477b9a26773c2a5dee5c2 clean examples++-load/ using uncrutify and review of edp scripts | * | | 4b05a11097101734aa1450c51770d2ddd551d4f7 correct bug for old compiler, >> need a space! | * | | 2cbe5881a9dff713beb1e9ed8efc911c070449ce more examples of uncrustify | * | | 0a4a646254b21fba3c5b50ae5bce2922dde2eafb add uncrustify config and use it on examples++-load/BernardiRaugel.cpp * | | | c6a5f1f37a26c97f7aac57ad62082b8f33fb7cc2 coorect pb of label in case of intalledges |/ / / * | | 56e8b45b45ae9376f178b4f0738d58f649444bef add print in mshpgt to find error add missing examples of curvature add print in case of missing solver in RNM * | | d2b1dbe112c45da2e101374f9a2d417c8a3f8230 update web site * | | 3e8f76d80d0161748d407b0e61c768fb629c1e3d update web site * | | d369e89882457e43eef833eab2f6ace7eb9e31cb Multiple small fixes. * | | 5256db80894befdbc427986db81311c9424a7ef7 coorect macos compile process * | | 4a3ab27e9a41ba35bd35c31b25420c9ddbe6bf09 update macosx web page . * | | 1e84dbb21ec8b9608fc8ffbf6038afc2e4021019 correct default win exe on the web site * | | 50df63825a43c21186c9243ec94bdac6a89b1dc6 rebuild AutoGeneratedFile.tar.gz * | | 82ec5e1c0761d4bbb0d11c25943ffc06ef9caaf2 add imax,jmax,imin,jmin to get index of row or column of the min ,or max coef. we have: A(A.imin,A.jmin) = A.min see examples++-tutorial/array.edp april 30 change * | | 2c447b3ebf37936983e6019cfb97d72f112e5b83 Yet another possible segmentation fault. * | | ed7ddb33364bb3ccc1ede19c8f8779fd942bea27 clean file * | | b08debc1879e4f9fcd2f99236fcbe91b58dedcdf add missing file * | | d85625aa1a6d98c1634c27284a83b467f3ab4601 add missing file in distrib * | | c0354133a5282f391188ad91a4fefd61dee5177d Fixes #14 by deactivating optimizations with icpc. * | | 85974ff59520a8138f5c6a89cd7334343da02b8c Merge pull request #5 from sgarnotel/develop |\ \ \ | * | | 9bd081b3ae1c341dd4e90b695d8ad7d99b7e75b7 Modify BernardiRaugel finite element * | | | eb1e6cac7b0f23efe01886c48d4a92bb1cc8ea79 add remove of downlaod/include/coin ???, remove spurious cout * | | | 5e63468c12d1c6012ebe1b3b094890ac46d427c5 remove spurious output * | | | 0e0b2a268d7d952e70a7c148256abd0e6a0e9ac2 Change the way to set BC on matrix add a arry for P-H Tournier (in test) * | | | ff4be0f58b6d8e8e52c36115a6e1bfcb9cec82e6 correct problem in C_args::Zero() method, and add trick fot P-H Tournier (tgv=-2) * | | | 4ee485ca384c801440e93f4353caf90750049a1d Update README.md * | | | 3a60ed144b7631168b9aba903eb4aae17827f857 Rename README_COMPLIATION.md to README_COMPILATION.md * | | | dee6306fdaab628e3fcdd999d9001bcbe978b3da Merge pull request #13 from sgarnotel/develop |\ \ \ \ | * | | | abeb7e9df85eeea0f4243e4cc59adf943e8d8b75 Makefile.am wants README? | * | | | 1ed85897e5a19b7e04ac75922de4ffff281e080e README in markdown for direct render in GitHub | * | | | 0f4accce1382664e42cb0867fc237777fd565be9 update READMEs |/ / / / * | | | eafdb354cd08de0a399ae4ec2d780abfffb9e6bd remove print in tetgen * | | | f7c15e244fcbe55c9a81eb0b2148f368f1086681 correct warning * | | | 070f0004646aa9959ff12f2c6316c8a629b5a720 correct pb in show err * | | | 7479d277fbbf1ab8bef7ccd0d3207b5858f70b73 correct Coverity et Codacy (#4) directly | |_|/ |/| | * | | b0113c178c8e4d3998171162815780120b9b6634 correct download/arpack/Makefile.am for // make * | | 9241552c8692969edbbf53c0937761eb95a4ac3f coorect to to change the depot of doc (bug un generation of Makefile) * | | b7f1f7e7e5e89186beed2a1e118931286e101fbd remove the DOC from the depot now the doc is in https://github.com/FreeFem/FreeFem-doc-pdf/ * | | 7f5bcb478ec0219770a98f4b78b8c51b1587d4fb try to fix compilation bug under linux * | | 9e0134ebca32091be8b897d05f0c5b904f0c7be5 add README for obsolete DOC * | | a75552c6910ea1c4b5497a806d82cd89700c119a Update .travis.yml * | | ef0f7f303bced41a2af6e24c1666953ccd5597b7 Update .travis.yml * | | a76c4c798fd4a2e07d24d5c6737d023f2ce728dd Update .travis.yml * | | 40f74cee889f081b3e60f224064adeab8054a5f3 Update .travis.yml * | | fb2628f32063d4f93398be778f5de4fc57dca5df add Travis & Coverity * | | 104a2e08410b94fe31d3fa042eda8bef78cd8f82 Create .travis.yml * | | 8b38785490a839cef816ed65ad32f4098b338090 update INNOVATION * | | 225b72d5f302178d312113b999a0e5ac42513b69 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | ecabc7b881096ab3551f729dd42875f656da6a45 update README.md Jenkins * | | | 88dff0e3b09bd93e84209b583409ff427b231ab1 update README_GIT |/ / / * | | 79fa9371a62b0e50a053684a47626bd0c19ad03e change the version of petsc/slepc to 3.8.4/3.8.3 waiting version 3.9.0 * | | 281f533da14c027ce5c36da681976085f4b8c15c rebuild AutoGeneratedFile.tar.gz * | | 9a56becc9a16b5e85ba8ce39c0c551a20cdc2778 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | 7c8e3dea1848b6ce8a05559c1787aa1705b454b6 Update README.md (and check hooks for jenkins) | * | | a55842348acbce90c0ed98a487aaa4db4cdab976 update README.md: add codacy & jenkins builds * | | | 7491dbe5580f9ed6ef03b2995a62f6daabb85f48 correct and add information in macro generation |/ / / * | | d2b60046faf799fe820d4a8569f98256b86869d3 Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources into develop |\ \ \ | * | | d401ffa777bedc2ad5dfbe76faa280d0aaa46da3 Fix typo * | | | 35c47a66c074496b8787d5389d7c9357e6ec8087 remove space in IFMACRO check |/ / / * | | 2cfe21711d6f9dea16f33b80ad70936ac0a8f868 add trace operator of matrix, and some missing operator on matrix A= A-B |/ / * | 9cf9d90d5a802bae71e19ae5415148ead3403114 Fixes multiple possible segmentation faults. * | b01321f3ef66d0318a0dade6be5972483bdd6396 Merge pull request #4 from FreeFem/master |\ \ | |/ | * 04692fa42c25eaec404aaadb56ea63c5ee46f828 Merge pull request #3 from FreeFem/develop | |\ | * | 46f54c0870f736de814cec7cd94215d5b3595b38 Nonsymmetric renumbering. * | | 2998fb986ff65e2c70c99518fc076abe269d39a6 Bumps HPDDM version. | |/ |/| * | 2bc921b090a09930d4a73ba48d4a46029ba767ac add .gitignore, update README.md * | 6570f9fbd6597920d6fa7768c732c9c65a0b6bee move vim parser to dedicated repo, del crimson parser (obsolete), add README.md |/ * c051585e8bb5dc8117ac941ea2654c8f2ecc6c26 add web modificatio * e33ce5c2f0665f2cda3cba98616560c0d5692386 coorect web site * 9a6f2134f9759b22bd45994e52b03880232ccc30 correct pb More Clang issues * f649f5208738863ef63972b136aaf8bf21bb6a5f correct Clang again : from "Frederick E. Stevens" * 5362df610fb0d7fea89931cfc5df45d16638bece merge heads |\ | * 08d7bda771194cdc72bc91371126d193e34a531a clean examples++-load/Element_Mixte.cpp and coorect examples++-mpi/MPICG.cpp assert problem in AffineGMRES u=Au | * e1808f2904bbf0579244104ed27183d44f41125c correct examples++/NSP1P1.edp missing stabilisation term if LU solver (thank to armand.favrot@yahoo.fr) | * 2a005036c68617519705fd6a5c72ea687df9c671 add test for element P0edgedc in examples++-load/test-ElementMixte.edp | * 087b236ca994829dabc2f84b0468875b8d6740ab Bug when loading a matrix with less nnz than n. | * c9aea3fcb75b92f237f088e2db4672e30d71bdc1 coorect pb on CFLAGS for compile ffmaster | * a8da38fbdc0784bddf84eac2ff703bbd3e809151 correct a huge error in P3 /3D finied => trap in all example which load "Element_P3" go after a array | * fff04ef4b67284ee3f7715a9ce37e2e6d1503edf coorect pn of sizeof in ff-mmap-semaphore.cpp for complex data | * 422d74ebeed619869cc48b6dd9d575f7353c0ec2 rebuid AutoGeneratedFile.tar.gz | * b55e1ed6c23363ee6e1b7746260edbd5372c891b correct missing pthread lib in semaphore test | * 6a9899d12ec2c489c33dcf52c89f5ca3124eb0d3 add missing file in distrib + compil ffmester | * 8eda5e3c7099bfb3c22e83fd2568e1db8c3c82a9 coorect typo in swao of string variable | * 71a8650c40a1990fbc754ab724c3cbc8ada99386 correct problem with the MeshIndependent() virtual function in all of case (thank to Svetoslav Nakov ) the symptome is => Sorry error in Optimization ... add: int2d(Th,optimize=0)(...) | * b445134175926fd44ff04fa4e7d7eeade49dc843 coorect typo in target name | * aad3695974c5511b5cf58cda4957179a9bdb6476 correct pb with complile or not of ffmaster/semaphore tools | * 8db3e74d529f3cc70c295100a571a6cf43d8c484 add new tools to build finite element | * 5c4838f810224eeb63cb1790e4073a6b93268291 try to pass to version 3.59 | * c14a5c0a3ffe7fbf15f2971d17ba3f592a84b625 pass to version 3.59 | * e50b577c84a603181dab2a05f11624f3bf8257ea correct petsc compilatuion problem. | * d32af6bd390ef9f3724ccf05cc4fc98a8ec7241d Add P3 lagrange finite element 3D in Element_P3 * | f0b9f178fd06450b32a5fe6ba37b8311089d7182 try to cooretc merge PB |\ \ | * | f054db2d8648f5042af6dfbd7a14ed11f02cf48a try to coorect pb of merge ... | / * | 0d6af34148c36cf8f9fe42b9e0753cde424bcd5b copie file for version 4278 to 4297 / | * ef8ff020887f669065bb2f2a7215d007d7aa0f0b (origin/geneo4PETSc) Merge pull request #1 from fghoussen/geneo4PETSc | |\ | | * deedb64867b8f51123e243d0bd4b191bfc85177d Fill dofIdxDomLoc for geneo4PETSc. | |/ | * 53b2696bd9d9d219a96a69992a97cce221310a38 geneo4PETSc |/ * 9991c44826f8f8c46cec93f167213dc00ac384f3 coorect type in name of new FE * 29f80e8f2796c0aecb7505d032ac0f89dbeda6f8 revert src/fflib/AFunction.cpp add typo when see * b901a70d4ba3dfb12c853c4cdd967b13caf13a2f add missing file * ce418bdc6751f1c37434d02ed513feb6f7f989ad Update doc * 8d170efb997382f602cb7c3d91dc03e57995ef80 add computation of derivative in P2bulle3 correct compile PB Element_Mixte.cpp with clang++ Thanks to Frederick E. Stevens" * 9dc3cc9120f4b7d3d07514114ec9e29e3b796f72 update makefile for new test * 7788768027f7ecf15d94174804b328826dbaa749 Add new finite element 3d Element_P2pnc * 6bef391a74fb445734dc44c0f8c4e2a68c684e8e add in doc the new interface for mmap and semaphore * cd42f1e9b2c787d2ccddd25a22dcf70edeeaa776 add new tools to coupling ff++ with other program throught mmap and semaphoe see full example ffmaster.c and ffslave.edp * 59d6fdbf341903cccbf053fa1c53042432fdec2a No need for this file since iovtk may save .vtus. * 9560412ddfad6a065d86d97d571c68524f7b2a4c update INNOVATION * 725a0f74afa2bbbb96adf61b2f91d56ef84e5d2c merge with Pierre branch . |\ | * e8e837dd50bc392a40856fbd0639581c3187dcb1 reput old launchff++.cpp and add dc Edge element of finite volume | * 7ea4e199f6a073cf49028baadde376f95d0dd739 coorect pb with signbit under linux | * 18599101f31c906bd4ef7a811e24c73961f2490e next test | * 805c9dab0684e285a3483efe2f2c9c984b851a4f corect type in lapack | * d2891c29c48a0bf445002bdfa36f7c49eb5328c8 correct in typo in lapack.cpp | * 94226779e117836bb5d4da9346cbcbd780f5f29e second coorect | * 9248fcc3adae5ce9981f1b0abeb4bf7c80888600 coreect pb type int in lapack | * 0b714ba69d1658592b43f4b4429a0540232cacdb add new Finite element 3d p1dc3d1 for O. pantz | * 8a4ced160456410e9b7999bb00738b81c0b7f1a1 rebuild AutoGeneratedFile.tar.gz | * e72e49248ca7b40e5af055739ddb30582288c2e8 correct typ | * 1374cbaf390e37e799845747cfa335a55ed4bed2 add new FE and new basis function sign , signbit, ... | * a5d6ce7999a8c8300028a40f572e732513bb042f unset x,y,z at init to find error. | * 80e08343a6d29d3137fffb350cd93d1022a6bdeb Forgot iterative.edp in Makefile.am Remove copy/paste in PETSc/SLEPc files and factorize in common.hpp Fix the border mesh when using trueRestrict and removeZeros Set an initial space in SLEPc EPSSolve when providing input vectors | * e5a7de30280f8d933ac07cae55eb1198cee4f933 pass to version 3.58 add tool to defined finite element function | * c9d4d19d78a701cdde2f0f0a8bd160f37e887d8e Improved the nonoverlapping macros for FreeVol++. | * e333d92753bddb2132e8061cad568d9e368452cb Use MatMatSolve with direct methods. | * 3aad455a3735fc02db35c833a6508189453ffc28 Not everyone use ParaView, remove from tests. | * d06752eecb037f356b75c0c0dc0f1d82b85f03b8 New macro for transient simulation exporting with ParaView. Minor tools for FreeVol++. | * 3a2d6ec34b1a4b8e2c11ecf481d0684930042cda past to versio 3.57-1 add function for freevol | * c20868e959f6ac2a572899bf4f06ccfd9c0858af merge change of Pierre Jolivet | |\ | | * 6824e9b860c2e70baeea0706ae1a715dedaf6e10 add othersite like jump or maen and correct ff-petsc/Makefiel | | * e1bcf0cf03d2137da8e6fcec3c6f608ec8c38a62 correct pb of priority in param errg in adaptmesh | | * ac82cf0a95758dd3b895902c0fb7c1e0035ba964 rebuild AutoGeneratedFile.tar.gz | | * 9222eaa9b22aa060f8c2577c8ec0aab5807e6559 coorect type in download/ff-petsc/Makefile missing rm | | * 79e96cdb39dbc7f4cd73307499d3033ccd28671f coorect big probleme due of correct solve pb : computing int3d(Th) of a manually defined function eats (Thank to sisqo_nakov@yahoo.com ) => to mush memory clean in integrale function | | * 1e253d6c71e814b6314f8f767b8d7594d220aca5 Pass sanity check find error | | * 39d2132cbf60a10a3c3159f60f067ce1043728d5 update download/ff-petsc/Makefile | | * 64c2901a3afd41f83e7700f45f1b958a3a8360aa correct web site | | * 198a56fba1e8e153513f9304aa41f40769ce21b8 try to coorect ff-petsc makefle ... | | * 53a7357148249bd082644921b943c35fd2f9029e add chech when read mesh with vertices in no triangle | | * 83f632f1d226191fe58d35e640072467c2982f5c Update install petsc (sudo case) | | * e9fda24a258a8d42e462ebdc3b5b5070635b6c0a correct pb speed in renum | | * d35b099ec360e059de8b9842ac42fd3211979623 correct to problem of sisqo_nakov@yahoo.com: computing int3d(Th) of a manually defined function eats my memory | | * 5fccdff8f4a17add2aa44a37d6d839bf28baa237 merge Pierre Jolivet works | | |\ | | | * 4e3c4a3c9efb5ad6e9e34e154f6ac170901115e2 correct problem | | | * 78abbdfdc57028df143b79a09bd274c27f62d0eb correct typo download/ff-petsc/Makefile | | | * cb6a7d2b735d9ad1494603bff4bb53dda4419ca8 add debug in Mafile | | | * 80c62fcdca7542948cb16ccbb95830135c592753 coorect space pb in equality | | | * 2a54e0a9f4cbe0cb9039178685d1d1cf283d88dd try to coorect petsc configure if only default mpicc | | | * d6c90d210ec0eb89e225725479ff4ef02ee767a1 rebuild AutoGeneratedFile.tar.gz pass to version 3.57 | | | * 10aa961aad03aaa937df158203f91b5732fecd16 add stuff of atsushi.suzuki@cas.cmc.osaka-u.ac.jp pass SuperLu to version 5.2.1 but not superludist | | | * 18566bb7dc4e2210970a8683f02b56c6c619eb9c New preconditioner and macro to use predefined partitioning. Fix for PCFIELDSPLIT with SLEPc. | | | * ac1d6292aa83854d343613f72bfdc349911379c4 No need to check for the Schur complement. | | | * 185b98eff08ec05074a74f140160d97f994b25b8 coorect pb with complex value | | | |\ | | | | * 385fa950c733cfbfd9c6fe3f874a2d3bc1ecfbe9 Fixes compilation with complex numbers. | | | | * 24ed07c04be6a3b27511d4e86e400b065c9ff248 correct typo in INNOVATION | | | | * b141b183d0a68f2673d3a62ef99c0e2aad7a29ac put modif of pierre en coorect version of dissectio | | | | * e887b693b7c16b8a883c7b2f173510f19a94c4f6 New FieldSplit preconditionner. | | | | * 6af22277f4d51ce86caf82fdbea42eba132fd8a9 correct pb if LONG_MIN macro is undef . | | | | * 2569d1fda7dfb49d4d4c5567936f615ecb68fa75 updat download/dissection | | | | * 1537a78a59c739bd7f0d75dc298c6cb660444fbf add notaregion and correct region data | | | | * 5c9294413293d37d12f411a2beb94bd2eff46504 update INNOVATION | | | | * 0a7aa876a900be3a1e4b8c008c979a99949cd5ef coorect small mistake | | | | * f54303611000c796e937e15c497ea8a300401250 add chi function as characterisc function of a mesh update disection linear solver | | | | * 4bce7734ef27928fad92643a897ae3cc8fdaeff8 New timers. | | | | * cbe5464ca7dc9545d4fb00bca2bcec38d1e26bd3 Multiple fixes. | | | | * 497b2a3dfb08dc9b9915b22f7dcc22dabdcbc50c coorect bug in trunc split > 2 internal boundary thanks to P-H Tournier. | | | | * 61581d7fc7e0c588f59aa035b0fa500bff27833e correct the doc add fdim, fmox, fmin, fmax interface to math.h function | | | | * 02ad650030556c49ca22b0a668fb72db2f437982 update doc | | | | * 885cb8c14457ae39bdb213ad516dd2b5c95971ea coorect bug in cube function without label parameter | | | | * f701c9eb04a4cf6432a028fd54479516f50c93a9 correct pb in affine gmres with check of P. Jolivet to remove the trap | | | | * 90e5f0bb7c6c8f0af207ebc365a83fd26ea2bb53 update history | | | | * 1a1e12fcefd2ff4edb60c2376d46ab25fce34e29 Throw an error when using the same array as input and output. | | | | * eb3e15f3dc125e4b5c0847c685f9d4c51e66751b Pointer freed twice. | | | | * 1073df999adf86a5801cc1b0e60b55e4a8886ddf past to versopn 3.56 and rebuld AutoGeneratedFile.tar.gz | | | | * 163a286d334d27f2d6d91facb85d35fa811d6e95 correct big problem in implicit loop for matrix exchange of i,j name before. | | | | * 1139e4b578a92bb0f9e2f71cb7021384a90306ae No need to preallocate eigenvectors anymore. | | | | * 86bd39d937ac0036d6d53f7c2ff51ac27785be12 Non-constant-expression in initializer list. | | | | * 29409e5b93f2d9fd9cf9aaeda93d2e72b52e5845 Bump HPDDM. Fix 3D examples. | | | | * ea58ac962b3aa0da006edff533639cfc932808f3 corret array overflow in Find tet contening points | | | | * 6bd4b2e93f5508126a27377606a80ed8d7d70500 correct pb un win32 | | | | * 613e6c344e9dff86cd96c752a81e0cdc0e7874c9 past to verstion 3.55-3 | | | | * 05d81397e8e1f8ae1847844806a011f44f79260e correct url of slepc | | | | * a307ee2cb98da39cd30577b397b077fa8b67e278 add basename,dirname, cpfile in shell and correct web/linux.php for install petsc , slepc . | | | | * 99fe65c94223cd0570c58576259d6b7e9de9ff2c coorect makefile of blas | | | | * e568521ca4a50e40d829435736c1a03274beb45c correct md5 of blas.tgz (new version) | | | | * 0b7507c820468cd34cd0ff36511861cf60ab50eb rebuil AutoGeneratedFile.tar.gz | | | | * a30b8747f1e66c7f406149e65eab6de33536d38d correct hsv2Rgv to take h mod 1 add the coorection on internale normale in 3d in case of sens of the normal change according to the region oriantation. | | | | * b01efcc7385f8e24363b532264181b300e06fc35 correct hsv2rgv to be preiodic in h .. | | | | * 770e524ff8f4ab2fffb5ed4cd3c964740da80c34 correct type in getall Suitepasce | | | | * 47afecb5c1ed8537a4ec3c3712e7a8236d9f07e5 Add trick to set/remove CheckPtr void WithoutCheckPtr(){AllocExtern::CheckAlloc=false;} void WithCheckPtr(){AllocExtern::CheckAlloc=true;} | | | | * 71408371969ba1d42eb24b5d54a671c753e0f450 rermove typo mesure _> measure add miss in the doc | | | | * f9d1b4772cf0feb1ba8053de2ef8c888e2407294 Add 3D meshes renumbering with RCM. | | | | * a0ff832305af00dd84b877cba6db3bb28fec0c1c coorect pb of initialization in cube function | | | | * 8520996875b0b6053cda1a09446b74252237d6b5 update innovation | | | | * a0d482d6a8ad7fa176074505dac0d12d390e12d7 Pass to version 3.55-1 correction of PB od normal in 3d for internal boundary | | | | * d421120fd617f51cab0a039139c954aeafd48657 merge modif of Pierre | | | | |\ | | | | | * 38b460f816558acc1707b81d502c637750b61a7c Small improvement. | | | | | * 4b10fe69e3a024b9cf23583a17a52171dbccf352 coorect pb on loo long check in CheckPtr.cpp | | | | | * 3885e6a4929c691ee69a930a2b39772bdd2b9f24 coorect typo in missing file | | | | | * 02b53a8d645e029cadb0e836f0ae00cf93b4952d rebuild AutoGeneratedFile.tar.gz and correct typo in examples++-hpddm/Makefile.am | | | | | * 3c82ef079a829a0302d3440b6eadbcacf4a4f758 coorect mistake for macos install | | | | | * c44322589257ae911ca0a69bd567a8e420d0a0a8 coorect helmholtz passe to complex | | | | | * 5e982d0539b3cecdbdbe6d8ce4070afd25f61774 corretc cube | | | | | * 88ba374a6c543be21ab1afdde425c58a33827465 build version 3.35 with full interface with petsc / slepc real and complex | | | | | * 96b4c3659c7b37faaa5dfd0c6835512ad93e3603 clean makefile | | | | | * b5b2c2614994cfa9434332781d9ef10cc667957a coorect laplace-complex-2d-SLEPc.edp | | | | | * 00b6f7f8b83bbdbda4f39e68afbf00b07ae12292 change the function cube to build mesh of cube (more light) add flag like in 2d to build mesh with cube / split in 5 | | | | | * c497ca77c8b6b542bb2704b34e3d7e2ee73fb0ad coorect typy in config petsc/slepc | | | | | * 78900f0ed783ee45455e5b627d6a103ce4aed617 add missing spelc in WHERE-all | | | | | * aebb8daf5db338176d5e0ea83598db0ce1b79abe correct intype in getall and makefie | | | | | * 6fff225b51c7734e982c83f2a63ca8256c64d901 Fixed HPDDM version. | | | | | * a4d2dfe2a75310d3b7e2c6361a136d9870f83e9b merge with P. version | | | | | |\ | | | | | | * a0b5f41d740ac5f498c0fe909119a1851801fb2b correct the bug find Ivan Rychetsky rychet@fzu.cz [Freefempp] matrix construction destroys the finite element function | | | | | | * 429ec65c7b74642cf17e2b82f12f34500a9996a6 add missing in distrib | | | | | | * 54a05b8e83f954abe874c229ce7876b6f85a658d rebuild AutoGeneratedFile.tar.gz | | | | | | * a8180e1a16b39e78ec1496d3efedb2b05ac79be8 Add compile of petsc and slepc (in test) slepc bug under mac. | | | | | | * 34d46874ea4aff9c17354acb1fb9f769615401ee coorect pb install dir in UMFPACK | | | | | | * ee517820f5266de335a82f37d9e1d1fa13040923 correct typ | | | | | | * 51cd0d9978165cb71949445fba1c7998f0f255bb rebuild AutoGeneratedFile.tar.gz | | | | | | * df5246ba83e6bb3c90f824faa2de2e7da7a48c5f reput version 4.4.4 of SuiteSparse pb of comile under winows | | | | | | * 409cc6e5fdfb37e76c85ae7702a16e23c66a04c5 coorect typo in web/macosx.php | | | | | | * b6bd65de529bc65d5e91f723a77d2b9c8b6563dc correct some typo and change the color syntax of TextMate2 on MacOS files | | | | | | * 0be335691c227366f132ddf508a3d63182a70929 pass to new versio of sparsesuite | | | | | | * cca5cee8be8eccecccd3e4ab9330bf2cc57645ac Multiple small fixes in the PETSc interface. | | | | | | * e4fb4136b031eb35800d1c39bbeb1d7b8f122870 New routines in PETSc interface. | | | | | | * 538c49c3f347204865e3549868862a792c006c94 Add examples Arpack with MPI | | | | | | * c20861ff3c857556853cf3bd671bb4f43d36bc9f pass to version 3.54 add complex version of PETSC/SLEPC see INNOBATION | | | | | | * 7626cfd9666ae29f52f4cf3b44201ffe85b94a32 add complex version for petsc and slepc intest | | | | | | * 7938a9cb310df05f2acc85222a1ba4db8d6a8a87 coorect print level | | | | | | * 8c2ea5267fb5682addf21ee6e316e258b1e47cee New distributed complex eigenproblem example. | | | | | | * 9f259397a10cd24b81ffa4f9d8bb83235b99d7ad merge of P. Jolivet | | | | | | |\ | | | | | | | * 586e4ef95f65178b0d6ca8b9059b24ce4f72bf6b Less verbosity + new example. | | | | | | | * 32ae798e65cf3dbd67baf7348853e4f5d28d46ab Periodic boundary conditions in SLEPc examples. | | | | | | | * 71c8aedc411d2f815b9b6ed20744427722b6299f coorect missing arg in macro_ddm_substructuring.idp when calling partitionerPar macro missing parameter | | | | | | | * d6576604cabf1d226b9522a509f699ba732b5e93 merge with P. Jolivet version | | | | | | | |\ | | | | | | | | * 70177509fd87c18b0ad08be3afd52217a7bea157 correct problem in periodic mesh / adapted mesh Thank To P. ventura | | | | | | | | * 6819be98d7babc1ecba324d6a5d84a679c9191dd coorect Unique and add missing file for petsc in distrib. | | | | | | | | * 76a104cde22855f29d72fec7876b3b161df19d68 Fixes pointers. | | | | | | | | * cd45268fa4b1fd218a5082b1bb2111e5d94855c9 clean version of Element_Mixte3d.cpp (thank to Marcelel Bonazzoli) | | | | | | | | * 27271a30d038936d715b7082ec1edc5fc241efcc clean README_WINDOWS | | | | | | | | * e760b74edfc3b8835803ca9079c928e308269100 update window comment | | | | | | | | * eab0fc23e5524dc6eb78617c806a3c5af345f9de correct examples++-mpi/Makefile.am remove files | | | | | | | | * 725b385540bd7f401ad2515e0c933cbb33e2f8c0 pass to version 3.53 | | | | | | | | * 1b72e73b06344ad4b96a59dc4340d0a34c063512 coorect of P. Jolivet | | | | | | | | |\ | | | | | | | | | * 198b7f14a5bd6faaa0c902fa5bba25d9292234aa correct pb under mpi window isend / revc do not works => but default freefem send is mpi_send ... | | | | | | | | | * 8ba957acc55e3d51f2f0bea44ce95e237e495696 coorect bug insend/renv mesh (2,3) pb of async | | | | | | | | | * 68ebebed3d40a795a72bb2f656376886206a5769 try coorect mpi send / recv mesh under windows | | | | | | | | | * 76a80113619608036dbfbf6b65182176112a920e coorect type in send / recv mesh mpi | | | | | | | | | * e1f4ac5d2fa22fb65cd7e9e4df079a78e857677d cooret mpi send / recv of mesh under window simplificationn | | | | | | | | | * 22e1087032d4b63b6b6b0e618166afbbc8529435 Fixes PETSc plugin compilation. | | | | | | | | | * 7887d446fa16e955a3754517977b798f661efee8 merge branch | | | | | | | | | |\ | | | | | | | | | | * 6e396dda33a32d1cf720a5fa7460e586a85bdef4 try to correct send/recv mesh under mpi | | | | | | | | | | * a3b918aaa88f63acc8892f9635e05ecf7c24c9dd correct pb of launching ffglut by default a mpi cas | | | | | | | | | | * cdc8558ba545e5de5d1afe72a1b17181dbb4fa50 update web/windows.php | | | | | | | | | | * 8e34cf0e5d5fd09e092c8ea2dbea93abe86ad0bd update windows version | | | | | | | | | | * 9a34cd761be5465d43f390f70cdbb30cf0dba9ce update version mpi windows | | | | | | | | | | * 42454c09b639d6615f83395fe17099009f5e723e compile mpi version under msys2 (windows) | | | | | | | | | | * c99bac4d1f7e978f0ad64e2426204a6961276291 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * ded472d9cffeb854512fef15ba2b7c0636fa6882 correct pipe to use pstream execpt under window | | | | | | | | | | * 8e22c48f2dedd7e7fa835ce9c86737ec34b759d0 try to correct missing file under window | | | | | | | | | | * 34dab4d4bda7d5b3e2fd6d181f944868b3d4b093 Adding some safeguards for header inclusions. | | | | | | | | | | * caeece0d79eec9a1769ff1ce47738ca8cf98add4 Missing options. | | | | | | | | | | * e7732b11570138cda60c65ac650610df2dcf0f38 PETSc field split preconditioners now supported. | | | | | | | | | | * 5160d637da76559a70847ce544f85910944dabbb Add dissection solver in freefem++ Thank To Atsushi Suzuki | | | | | | | | | | * 0b938034fa5ab2be847c5b4e24e5dca0668b78c5 re build AutoGeneratedFile.tar.gz | | | | | | | | | | * 69500331f1aa68c8d3ad52bd869ae67dc374db0a update HISTORY | | | | | | | | | | * 578ca185e22b7850dbe3a6aec705af3a08ed180b add missing include in ffapi.cpp 'cstdlib for exit) | | | | | | | | | | * 4832c812f8d0380e4a4f3057a47d57f22844f74f add missing std to exit | | | | | | | | | | * 71cf433703839fc979840d525a37ec3c3aafd87b correct typo in new gestion of ffglut | | | | | | | | | | * 7cd66e3377ad354ab49e8978e214159c955be1cd remove the launch of ffglut in case of no compile ffglut | | | | | | | | | | * de8710f6314629191bdecf1b92feec3a57528b99 correct PB of compile with gcc 6.3.0 coorect problem with ffglut | | | | | | | | | | * 0506047869e7f0053fdf5d3fef934885b4f6098a Zero-size array should be at the end of class. | | | | | | | | | | * 11f31782f3fb3d1385900b843f782c8642678e34 Small fix for PETSc initializer with arrays. | | | | | | | | | | * d8bb8452f577715ff6046bf6e341daf731ca8f4d Typo. | | | | | | | | | | * 8eae9c0873d684f59e18927c73671c8a9552a266 New constructor for PETSc matrices. Fixed kZero. | | | | | | | | | | * 0d5968a0bea697f56e431f5958e984d667849d8b correct in ffglput plot with give isovalue correct INNOVATION missing data try to correct popen problem if no ffglut no way .. | | | | | | | | | | * a8fff391f23175f81eaefcc3911875037218d1f1 add example of plugin (array of finite element function) add strtol and strtod function to transforme string in long or double and genere a error if all data is not used. | | | | | | | | | | * 864fc80a034396df5c428e8f768c815b6c418f7d Small memory improvement. | | | | | | | | | | * 80c4d2d199ab4f7bb34976fbed995e12f9abba3c Simpler way to detect vertices. | | | | | | | | | | * e5a827ceb14acfc74fe1f3abdb109cac2bc09fa4 Adds splitmesh4 and splitmesh12. | | | | | | | | | | * 1574b1b3cee81bf726214685072d7c3f9a925a90 coorect seq MUMPS interface pb change mpi.h to mumps_seq/mpi.h to be compatible with default place | | | | | | | | | | * cd11ae75489988b7595b392d1955829566dc4edd Exposes HPDDM iterative methods. | | | | | | | | | | * 9d4e05fdcd679d7b0a3466043d75d55e7bf32c04 add info | | | | | | | | | | * 63f11f2261a61325200511e33b8d35990dd418ef correct compile of mumps-seq pb of generation of WHERE-LIBRARY-download (global subtit of @DIR@) | | | | | | | | | | * 89e5a022e2b948eac5ec9206c7ceac540c3ae569 coorrect arpack interface with driver 3 modE 2 thank to P-H Tournier and M. Bonazzoli | | | | | | | | | | * 8943aa015531a10835bcd7d97299ad1afbef8073 correct findlocalmin function in soline.cpp | | | | | | | | | | * ccff779883920629d10fe29681eac068eba0d872 correct pb un precon of NLGC remove a mass matric Thank to O. Pantz. | | | | | | | | | | * abc863796e28d55504e951874379e1a1dde16fbe Less communication during matrix assembly. | | | | | | | | | | * 78c36d0148a288c8786df291c2676641ae2feba4 Slight improvement for matrix assembly. | | | | | | | | | | * 4a11a77d1924c9cd840d111b1b326181985d8a29 coorect typo | | | | | | | | | | * ab969f67f5bdba8db97906d905c048e388d93737 correct web/download.php | | | | | | | | | | * e328d789b14e2f5ef9ebd0885eed599accecebea update doc for coloring syntaxe of emacs | | | | | | | | | | * 8d3ea2df49b2f8463fa3dab8a0181d899c391f85 add missing file | | | | | | | | | | * 458399f94e362c90ed95142afc3ce1928d04f781 update innovatio | | | | | | | | | | * 9cd3ed99a5a551ad883546f1fe1c48815e21c0f9 change the dir of install mpi.h for mumps_seq and libseq to be compatible with ubunut avec coorect configue of ipopt | | | | | | | | | | * 327fbc0f6354e19bbfaadcd8af84803f999f458d add ZScalce in ffglut try to add force downlaod version in configure | | | | | | | | | | * f0e2d20e358ecdbdf464772cf78ac17f4a5d73a9 correct typo compile openblas | | | | | | | | | | * 34a326484210910b3615454a37e9d978c2f218a4 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * e4fd23daf422cea9552c134ac2d7a031a73a7a0c correct compile of openblas | | | | | | | | | | * e0dd6b047b99ae826ac391b2d62a2291731fb506 coorect the compilation of openblas in downlaod install all lib and correct configure | | | | | | | | | | * 31a9537fe9b384504d8106b757aa18d547ae4495 correct param of atna2 in the doc. | | | | | | | | | | * c7dcd1ca183687379f12a7a5c71d2f9289888fa7 coorect configure | | | | | | | | | | * 6be8caf2546466d7dc48f7afbfccefad47db5c09 merge INNOVATION | | | | | | | | | | * ef1499f2cb46a75d0de7a19afbcb91d349836ab0 correct INNOVATION | | | | | | | | | | * 0eb92059314aefeae61a957332ee565ecdcf219a passe to version 3.51-1 correct error in BLASLIBS in configure in case of download openblas | | | | | | | | | | * 9de50e45c595df170f5c08d72e4a4d1b4d2c9bba correct problem of lose normal sens after adaptmesh try to keep the sens of edge in mesh.. | | | | | | | | | | * c90c50c136f4b549eabfddac2eed3fa0aa93c34f add comment | | | | | | | | | | * 4b40f00808fbe16a36e90218edb0da671735c5ef add 3 new small usefull function projection(a,b,x) , dist(a,b), dist(a,c,b) | | | | | | | | | | * f3f9a77c2a51d583ae7b238345ab204d6a0601b0 Verbosity + HPDDM version. | | | | | | | | | | * 6a2d59c269c79ee606f83e237e717e8e5be1811a add new exemple | | | | | | | | | | * 9a54b9ce5f40ed842a042a2436da49281e97e8d7 crrect on meromy leak in mshmet pulgin due to mix of allocateur. | | | | | | | | | | * 4c8ef98f65b92edc20f8186552cccdbcd5b660f2 correct nolinear-elas.edp test (more safe) | | | | | | | | | | * ec691ccd5ad906c797d4facb0322644a04ad208e Be careful with Matrice_Creuse! | | | | | | | | | | * b0e297e5b194c0661acc856cfff600904e778d26 New macro for parallel I/O using ParaView. | | | | | | | | | | * 7a5356af6efd811f503fa5c62a0579d59d8f30b5 Updates HPDDM to version 000603. | | | | | | | | | | * 2721cad34852610d5d04a2342381f7fa21ec3c30 Handles different communicators. | | | | | | | | | | * 6b7f8f4106e218641e6b536ad7054ba0355184c2 Wrong basis for rigid bodies. | | | | | | | | | | * 2cf7afd38ebb4f314b62cb057f6e604132a5aca4 This parameter is not needed. | | | | | | | | | | * 985aeace8cefb1b468d930b21b56a8525b5119aa Stick to Metis for now... | | | | | | | | | | * 9a6fbe811dd4d64ad5c1a011071d1dfa03c84a13 update the doc. | | | | | | | | | | * 523ae04f907677228d8bc32db42544355bf55c1c Changed all examples to use IFMACRO. | | | | | | | | | | * d4e7c9712309fe08f6b896b2f73f52b2ad0d5b4c correct mac appli | | | | | | | | | | * d165baf0552454e3482b5504b1cba4dfd6c83430 upate version in INNOVATION | | | | | | | | | | * d243cea935109b1473263b0e96fa52467e1e70ce update the doc on macro | | | | | | | | | | * 1be0d527e969a4a15462bb9ab3944d8d69d7d88e add example with IFMACRO | | | | | | | | | | * fe40d9510607e8e162366a645d3145d59a3928ea put hg tag in INNOVATION | | | | | | | | | | * ad61e669a7681578783ffe11aeb8f6b1b52dcfe7 pasd to version 3.51 correct typepo in configure.ac | | | | | | | | | | * b22364142a02affe45d90c1dd08d4e3bd610b54f corret order in class defmacro, setmacro or ifmacro | | | | | | | | | | * 06979d92eac8ec23f01473255f94273574a3d50d coorect bug in return of IFMacro | | | | | | | | | | * 5fc1b8118efe78e7ec074bc9dcd9d1bc051179c5 remove rong example Laplace-Adapt-aniso-3d.edp | | | | | | | | | | * e613e62bbaf30efee41a39e18c11efd24de258b4 change somt strcmp in strncmp more safe | | | | | | | | | | * 8a16fe5fd819e148dd05196f26ef6dcad8d7e75f correct bug in check get_element_lineorcol | | | | | | | | | | * 842baaecfbb1b02380472b19aca11942e1e546fa rebuuld AutoGeneratedFile.tar.gz | | | | | | | | | | * 161404f3d9eeab1126f47ecb8ca22e283b6ccbc1 merge version of Pierre | | | | | | | | | | |\ | | | | | | | | | | | * 15cdbe10d89b02237feea89376d122a6b9758b7d add coorect of Pierre et remove output in convect 3d | | | | | | | | | | | * 3a4c73a4c522cc23cb1865256c7460b5c0649831 correct bug in convert 3d (thank to guyotyann@yahoo.fr) | | | | | | | | | | | * 6d46e4bd8cf82c910a5abcc46e471fc2dc949172 coorect type on win32 systeme | | | | | | | | | | | * 35d2912fc59501e3cb919ebe4f6134a67a3ea606 put mersen rang in global.cpp of bamg | | | | | | | | | | | * 91d5198b75396845aa3e33a85a07a2f26359cfaa coorect typ randow win32 | | | | | | | | | | | * 64e33ef7ba6848dcc332ad1961eecb42e1539b7e coorect pb randow under windows | | | | | | | | | | | * 13343e54dd0136464f16ff53ac0147f252079059 add new macro stuff in doc | | | | | | | | | | | * 009c35e4895ae24ed3ba77075c1bf2c3275d030b - change myrand to randon (better result ???) - add argument like -Dmacroname=macrodef to def macro - add IFMACRO(macroname) codes ENDIFMACRO compile codes if macro variable is def - add IFMACRO(!macroname) codes ENDIFMACRO compile codes if macro variable is undef - add IFMACRO(macroname,val) codes ENDIFMACRO compile codes if macro variable is def and equal to val val is a string | | | | | | | | | | | * 701fbcaa443a5f0e9fc43dd7acfdf6d9aa22086f rebuild AutoGeneratedFile.tar.gz add modif of vincent.laude@femto-st.fr Arpack propose differents 'drivers'. Le driver qui a servi jusqu'a maintenant dans ff++ (eigenvalue.cpp) est le numero 4 : mode=3 (shift-invert) et bmat='G' (probleme generalise avec une matrice M Hermitienne). | | | | | | | | | | | * 11331004532877ad9f866643e806805cc60aca7a reput all version of examples++-3d/Laplace-Adapt-aniso-3d.edptory to update configure.ac | | | | | | | | | | | * 82d0d74b01fc56d1bc779a93736a7385723140d9 correct pb in configure for hdf5 c++ if missing file H5Cpp.h | | | | | | | | | | | * 6a8034678c67ad6c5d055fd20e232bfaf300b505 include modif of PJ | | | | | | | | | | | * f546b135b8179f6482f539ca7dbef111fcabd4ab New HPDDM version. | | | | | | | | | | | * 503f4f03669f08e79e8017f43b69ab0ff4aca8ef add missing file | | | | | | | | | | | * bfe66b07904cb795261e7f116c224d9d2191e31b add missing fill in distrib | | | | | | | | | | | * c74351aba029ed8bb8a1c29eb077545330ed7eda remobe p1ncdc 3d (bug ?;.. | | | | | | | | | | | * 7fda5ac1aae64d6787efa0846e07cebb83d4fa14 correct typo | | | | | | | | | | | * 9c283b8094410b27a88de594bdab8cce0f4e2ff9 update HISTORY | | | | | | | | | | | * bf3df6454094e0af451474af3f2f4868fd11c641 chnage verbosity in distance.edp to remove dump | | | | | | | | | | | * 9a40f2102a154275ee6cfeb4aef0b12fc091e265 change the rand by myrand to have the same rand geneartor for mesh in bamg (bluidmesh) on all architecture | | | | | | | | | | | * 2a480d62e5313ea0e3897bcfc8c05ceb6beca9e0 add dump in mesh2.cpp for debug | | | | | | | | | | | * dac141f3da046978971e42b3e32fc920125cdc37 cdd ddump in swap for debug | | | | | | | | | | | * 2711c6fadc28d256de03ccce89face8fa63fde3b add print in swap | | | | | | | | | | | * adedf1a31e557d603715f8f1d658920b9ff66bc5 add debug in swap | | | | | | | | | | | * b0fd648427fdbb0d7201da05beca3614322650e8 add missing in distribution g.gmesh | | | | | | | | | | | * ecde7d78c3b62861444bbdceae8ae3661a1ef00b correct missing plugin and example associaded P1dcnc | | | | | | | | | | | * 7a181fad47b80b07750962211ddf6558cccb848c update INNOVATION | | | | | | | | | | | * 3adfed216fa25b972f628e568af154edc3ffc9be correct Fini element BernadiRaugel error in bound/composant the bug appear after the correction of P. Jolivet in dec. of slow construction of -non sysmetrique matrix | | | | | | | | | | | * 34b776ee5c0ee9c1bd0fef9fcbe3546ed9951d86 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | | * add6fd9e8bd999e18414f45838453cb096e34b58 coorect PB with download blas.tgg | | | | | | | | | | | * d023e0312437ca9ac9ec916b614cb50b4f8446a3 Fixes 3D Stokes examples. | | | | | | | | | | | * 7d03de5adf3521b46e224ff3383541ff5e991ad6 correct PB of arithmetics of multiplication operator bool * complex and complex* bool | | | | | | | | | | | * 853f0334833203e50b3fa09860e1fe0af09e9d71 coorect thickness of plot line in postscript | | | | | | | | | | | * 83c10c41ccd6b2513259e4d44062593196d8d9d5 correct problem of link with hpddm know by defaut they use mumps if possible | | | | | | | | | | | * 8debe69f6ff0fb3f5a62a801c5d1d5491b3ef8fe New HPDDM version and less verbose output. | | | | | | | | | | | * 7343f3f0504284cf670f7cbb0072a455443eeefc New ParMETIS interface. | | | | | | | | | | | * 37f3939d0f9f81a3dfcd770f7f0dddeeb96d1f2c coorect apss mump 5.01 to 5.0.2 | | | | | | | | | | | * 59a3cf986ebda206a0edd795ee9276601a2c386d Some more unnecessary messages. | | | | | | | | | | | * 6ba07a25247d5a912185136609d797c836a90988 No output when verbosity set to 0. | | | | | | | | | | | * 354f93c74f9516ce95c31975c880628d57c73ccd coorect NSP2BRP0 example | | | | | | | | | | | * de4cf46ce950d12744d2f7d95a021d82e02eb6f2 jsute commit | | | | | | | | | | | * 3ee976fc5b38cb72e755d5a09540c32d7a7b68f1 pass to version 3.50-1 | | | | | | | | | | | * 9b0bc41bf0976ab118d5889b2e6b658776076791 Huge performance issue with unsymmetric matrix assembly fixed. | | | | | | | | | | | * cc194c4cb29405f5239e0b34a7cee21856b06a62 amerge with P Jolivet | | | | | | | | | | | |\ | | | | | | | | | | | | * e98631e31436c5331859dfd4ee28e2e5d1f0c12f and english name to function voisinage | | | | | | | | | | | | * 67023cfc073f4e1005f1084c83daff4246a3daf9 coorect typ in distance (miss 0 element) and add trivail exact test rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | | | * 3606dda0a28df2f58c417ccc2258896cca681dcc coorect problem of signe in optimisation part in distance function | | | | | | | | | | | | * a03258745fc648cb0045b441c94148bb78f7b03e correct CheckAll no ffmpi in case of sequentiel test | | | | | | | | | | | | * 45e3410bae404e46dc4487b25aacd975d4d11698 New HPDDM version and fixed issue with usedARGV. | | | | | | | | | | | | * 5d4d239de151539f3d51ba718553f63f7d0f637f add comment | | | | | | | | | | | | * 024c0f67032d3a780dbcd30dd151cd2258525e7b coorect color bug find by Jon Sauer. | | | | | | | | | | | | * b3549c6189630678f943e04acb887f71b2068e9c rebuild AutoGeneratedFile.tar.gz file | | | | | | | | | | | | * 01d0fed0104a1f5a460e62af174531e2a9cbb4f4 pass tu version 5.0.2 of MUMPS and change small bug in ttestio.edp | | | | | | | | | | | | * 2a95f82a2dd0fb694c13d918548cad7fbcb82fcc Bump to MUMPS 5.0.2 via N7 server. | | | | | | | | | | | | * e3c951d8ef8cd35c03a3e3fa96027f0a979081a7 Fix Makefile.am. | | | | | | | | | | | | * eff18a13226103801935d65865cb13b521c15cc8 Update HPDDM version and fix ARPACK with complex numbers and MKL. | | | | | | | | | | | | * b4faf06d071abf5ed4e62c6722e3d8a50a256970 correct type in eigen | | | | | | | | | | | | * 2b92bbed662e279a2e0716ba91e03ba05b827a78 update eigen complex functionnal case | | | | | | | | | | | | * e4f8ea6a13084e772fa3e813f22fa2584080ddb2 try to complet arpack interface ... | | | | | | | | | | | | * 38dd9a5210e4427137dc84158f853d69dad0b18b in Arpack coorect pb of mode in cas of Functional amtrix def. | | | | | | | | | | | | * b0cf746fd5204f659c9466d1b6f23a5780b61eaf add which given parametre name in eigenvalue (arpack) | | | | | | | | | | | | * 5bdb8f0b3b79d3f4c5b15b04b8564e9ae992cd10 coorect type in parallelempi.cpp et remove test of auto cast for P-H Tournier. | | | | | | | | | | | | * cf26f8fd9b9b14bc0fcccf759df8a6621a6e6ba9 Add | | | | | | | | | | | | * f762057eeb46540dde3c563adf93c7208e68234e add send, recv, broadcast of real[ini,int] , ... array | | | | | | | | | | | | * 368adab2b1cedc147e72df64014e992d3a44acc0 coorect pb of bound in ffglut | | | | | | | | | | | | * 3252772102f9ca45f365aa1fdb55a11206569923 see INNOVATION | | | | | | | | | | | | * 90b818104018960a4ceac8bb9857ef44c8e22fb9 coorect big in getborder missing initialisatio | | | | | | | | | | | | * 1ff83e291c4e41e9991a016318c00f35a8b35527 update web site | | | | | | | | | | | | * 709a6014467bfeaba2f868e014ba1f6d96d6b1b4 update AutoGeneratedFile.tar.gz | | | | | | | | | | | | * 83919705c42f544271a66657edc591a3ce688982 pass to version 3.49-1 | | | | | | | | | | | | * fd38958d3af894e9216f1d316ae638183951f1b5 update HeapSort (changer index from fortran to C) add script to do movemesh with lapaclien smoothing correct web site | | | | | | | | | | | | * f4eedc6a417620cf10800ce2c144726091fa10fe New interface to build distributed block matrices. | | | | | | | | | | | | * d57697c0a79b43926a6e59c47986ea84f2940a34 add tools to extract border of surface meshes to close surface. and add bound in parameter in gsl spline | | | | | | | | | | | | * 9624bf53203ed2be39eb1de16a420a8286c05a17 add remark on io function in doc. | | | | | | | | | | | | * b0465b8124e926c21e135738c1c18ae71ef1755b correct missing resize function of fespace complex array function | | | | | | | | | | | | * f943f200214e8fb0d00a49ec0538f413b640c242 change a little distance exampel to be pretty and and bounding comment in the doc. | | | | | | | | | | | | * b57bf26b0b9223b9633959b10706ecce62f60950 patch de Pierre Jolivet he example HPDDM code heat-2d-PETSc.edp pour julien.garaud@gmail.com | | | | | | | | | | | | * 54c6aa80e797b47f8945cec2e14e99787f721f2f coorect problem of size of arrowhead when zooming | | | | | | | | | | | | * c08d80707d47e08f77454b53069c76677cef1095 add missing file in distrib. | | | | | | | | | | | | * a9472188387f7f01ad3023d8917b8fce64b329f3 udape AutoGeneratedFile.tar.gz | | | | | | | | | | | | * 2f4e9e1a0ba12a4a3e047804d665a21e7b6aa5d8 add distance and new integration tools | | | | | | | | | | | | * 5d21dd6c940678ab3774bec44f7736392e8e101f correct defaulttoMUMPS() in MUMPS_FreeFem.cpp to remove ambiguity change MUMPS solver in cavityNewtow-MUMPS.edp | | | | | | | | | | | | * 4111ce8398a391c12e3810ea280974699e943abe correct type in download/Makefile.am | | | | | | | | | | | | * 31864afe63dd789a7405e5abc2de44f4325a7511 correct pb of reinstall hpddm is some case | | | | | | | | | | | | * a4c498a45772961150631686237431505231c045 coorect pb off gls versio 1.16 under linux no gsl_interp_steffen | | | | | | | | | | | | * f0013a30d6dc6fdd0e59a7d539b163dea19eb96c do small correction for dist | | | | | | | | | | | | * 434209b3e1121bfaf51aaeeb64c02d49b1b20c31 correct tetgen clean target Makefile add remove of *.done files reput the creation of the pdf in DOC Makefile.am | | | | | | | | | | | | * 2899af95180434d5d97d53178d39fb0856f7027c coorect config in case of given umfpack | | | | | | | | | | | | * c2dd24702e2cf36d97d83e42cadc7fc55a96dd1c update AutoGeneratedFile.tar.gz | | | | | | | | | | | | * 7dd5b2e8aea601d5494a85bdf03f442e98988adf update de doc with new example with matrix | | | | | | | | | | | | * 00a53977cd5e0f4aa7f4706740a6766650cbda51 coorect bug in clean / delete of headrt var in for loop before delete a each time not only once | | | | | | | | | | | | * ab37500f00a1b6a6cf3777ff2045aafee99ddcd4 correct gestion of delete freefem++ variable in plugin | | | | | | | | | | | | * 9b63961abbef4fe5de6e72194f9987daed01025c Do modif to remove probleme of clean varaible after break, exit, continue or return | | | | | | | | | | | | * 398877efc37844abf730865ca57b8f69c9c42739 correct CheckPtr.cpp misstake between delete and delete [] | | | | | | | | | | | | * 11dc3ba4a8d8f905970f70d56cd8df54fe3f345f correct CheckPtr for g++-6 (Thank to P. Jolivet) | | | | | | | | | | | | * 15a6e9d61d74b50e8818d0995638dbf75c99c504 add correction of P. Jolivet in hpddm | | | | | | | | | | | | |\ | | | | | | | | | | | | | * 6bcd0ed9c12a4c6fcc2a70ffedcaa19ba4f141a6 add modif OP schwartz | | | | | | | | | | | * | | d4de07ee45621cbb1ad9f6193a823c57c3a6dee6 FreeFem++ days examples. | | | | | | | | | | | / / | | | | | | | | | | * | | dbdb574a68f82ca2061a2ea0dfed16d3634ea1dd Simplified HPDDM examples. | | | | | | | | | | / / | | | | | | | | | * | | 17abf55a03ff3fe8320d951ea5c0e96e5744c222 Typo. | | | | | | | | | * | | 8e055612b1407fb345af983ed9a950860259a52d New interface to SLEPc (distributed eigensolver). | | | | | | | | | / / | | | | | | | | * | | eff887381ad78903401338b0e80bcb75493a5341 Fixes for meshes with highly varying aspect ratios. | | | | | | | | / / | | | | | | | * | | 3e6c4e7e3fffdf3c92e59964b2f9f894b5fa5467 Wrong parameter name. | | | | | | | * | | 04c6b13cf22e5460776637eb994f95fcc96d0b89 No output. | | | | | | | * | | 1e58d0b20c3045c9415536b9910a263c72168124 Support for periodic boundary conditions. | | | | | | | * | | cd032c635fe16b2ba2336291c38126a56fb2518b Fixes for old compilers. | | | | | | | * | | f5fba6b644f719760b1e09a1fa1241ea6570eb40 New SLEPc examples. | | | | | | | / / | | | | | | * | | 87a2c08d718fc21d38cbbd26e4da5af14d3f9bf7 rebuild AutoGeneratedFile.tar.gz | | | | | | * | | a8582087ec83a85bf6b95fda6f18296c8608a7ac pass to version 3.53-1 | | | | | | / / | | | | | * | | 62c26fadfcb9843e9506c3f6de54b4f2a8639bc7 New HPDDM version. | | | | | / / | | | | * | | 4f4aeba82bd660fae8035c69b2c08896effdf76f see inovation | | | | / / | | | * | | 04e9ceafe52d4bf870d47bf1218105e716df6087 pass petsc to 3.8 and correct pb with new clang++ (clang-900.0.38) | | | * | | 78220eeb0b84d83b41343ae24ef3120db98ce84a try to correct lauchff++ under windows lauch freefem++ in same directoru of app. lauchff++ | | | * | | 51694fcddb56407fd93642137c55c7f7e47d25d7 merge missing update CheckPtr.cpp | | | * | | 163a60f47e79b6821ee45795f2a342aa0bb77e39 correct pb of too long check in CheckPtr | | | / / | | * | | 68713cd2a37538b677ac16674633a7576122d1c1 Aesthetic changes. | | * | | 4c226899f56f85dc39e2c7af11722ac390e713b4 New way to build the domain decomposition when using vectorial finite elements. | | * | | 83f6dc9fe21a2bf18e221f963d91b231a0a633e9 Fixes faulty logic and ff++ assert error when sorting an empty array. | | * | | c6b664fd2484bfba30466a17c65ddfc2aa9cd27c The Schur complement may now be approximated by a PCCOMPOSITE with multiple operators. | | * | | e92166ce08e3b252c9e4a5978d47730ababf82d9 Custom communicator for HPDDM solves. | | * | | 87c279267f4990b43bbe4a78b100803f015ad6bf Only sets the fields when PCFIELDSPLIT is used. | | * | | cac0b13f90978fe36922d1d581044f3ea64a88fa HPDDM may be compiled with MUMPS. | | / / | * | | b4e2fe73bb16b3571ce93c9fadec89bae36116b8 Avoids unnecessary assert. New instruction set added. | * | | 0042b7f7dfe14ac47cd21420b23175a51ae59553 Added product by transpose. Block Jacobi in a single go. Vector initialization. | / / * | | f73e694183d602add82c1cdfde379a5f64894279 Fixes a possible memory error when exchanging values. / / | | * b46af78db1ddd36f3988d01b673d324ecea8b402 (origin/cmake) Installation of medit, bamg and cvmsh2 | | * 4aeceef39c4694a979c823431e1e675e011f0cba Install freefem++ freefem++-mpi and ffglut | | * 640dcf1257295f7dff6107c6acb2427d0e157f32 Enables make install | | * 2129c8569c005038418dcfc0374c10b3f7404d45 Fix some bugs (peculiar regressions in my CMake scripts) | | * 48e4bfb2bda6319e9afb46c082264cae7efb0498 Conditional compilation of fflib wrt UMFPACK | | * 8ca430a8556e6a4b16994f5c1f8724b36c67a011 Do not look for OpenGL and GLUT in ModuleManager anymore | | * 8d986972f62f022ac1e542ff1bf0a3408c79ab8f ffmedit is now built iff OpenGL and GLUT are installed | | * fb29f3564cdad7bf2c2e9f092d8b342821497a39 Remove subdirectories from download directory | | * cbb472c22de45bc79a5b706a4e2f12c0b9386824 patch command for suitesparse (copy of cmake script) | | * 329c1dc873644d3617e66b883dee16e8c349eba5 CMake script for suitesparse | | * c39ac3c17cc10a9277d85ea41c87c5843a5e9a39 Compilation of lglib with ARPACK if available | | * aec7ae2cefd292d3708bd1120b61cd38bc2cb23c Update installation procedure for MMG3D | | * 3dda8305cbe5a95022e95cbdb1f1aa3800a34dac Use the same compiler and flags for FreFem and Nlopt | | * 0961f9fa4a404f4a78ed70118f755aa7071f8a61 Main compilation loop for c++ files in examples++-load-mpi | | * 6c353863a8b3b8eee116024be431692dedaa792f Add the path to examples++-mpi in LD_LIBRARY_PATH for make check | | * b25b75c3a7a5aed65303476d3fff9240867443ed Compilation of MPICG in examples++-mpi | | * 99448823a627b262eab43199d29d2ea24d2280c4 make check can now use FreeFem++-mpi if available | | * 7c3d5b8e1886c3dce93fe319f39d32b63590edcb Define PARALLELE for the generation of FreeFem++-mpi | | * fb4559fca402ae8f13834b985dc06835d8f2fee3 Update include directory path of Ipopt | | * 918ad93fd4aa7b41dcbd8cc9f1eb6e5123716460 Generate shared libraries instead of static ones for superlu and metis | | * 2b576d86cb08e10a9501309c8e7b41f38d2856f0 Modify target name in ExternalProject_Add to avoid conflict names | | * 3105e3f0006c33e5bf762e8b04812d633eab1993 Fix a problem in installation of tetgen | | * 709851554b83b522c6efcc52f13a1e729ffb9413 Create download/include directory if needed | | * ac91e989bf5adf4dd0ebfade0b5017c0213830e2 Add a dependency between external_projects and imported libraries in order to prevent CMake from building libraries before having downloaded their dependencies | | * 280459553d08bae5237d41d89e6f0a3e8792c5b0 Set LD_LIBRARY_PATH for make check and replace SHARED by MODULE for all tests in examples++-load | | * c3262a4b4ad7a2ac94e1667e669480835c4a4ff9 Replace SHARED by MODULE in some calls to ADD_LIBRARY | | * 4a7efe12fd878c1f68df023cb318faf9657107eb Minimal CMake version is now 3.0 | | * aa2620fb889d86fd065b80d7481ab502d58010e7 Add missing FindDLOPEN file | | * 8f3bb39ea325726f8a343deb80428ea326c2a904 Handle metis package with FREEFEM::METIS target | | * 2367dd47eab433964478768683663206314abc9b Downloaded packages are now stored in download/pkgs and installations are performed in download with creation of download/bin, download/include, download/lib, etc. | | * bcae578ee635d48d77d661d7041fd9b5c0816241 Remove trailing whitespace in the date returned for medit (bug fixing) | | * ec216451fe717dd05391e71c6828d76ac84c71dc Search for FLEX as a required package | | * fa03db0e65322c001fceaf54126564167c0ee4e3 Get the current date to generate compil.date for medit | | * e1d094416c98da82508b21ded35c287503cf5c87 Reactivate medit | | * 3dbdd4e01359c4a769a75ab347104ca02626edf3 Remove spurious debug messages | | * 74c5605c4eecf931bab46789bd8ffb0e81d44abd Add -D HAVE_LIBUMFPACK as a compilation flag to activate UMFPACK | | * 665e98def18a990767e450584a89780029dfa089 Remove lib prefix for libraries coming from example++-load | | * 31274f0ec92fb9b1af6871c884114322ebcf46a5 Fix a typo in HAVE_SUITESPARSE_UMFPACK_H | | * c4179943853684368837df4a5a882d360daeb051 Automatic detection of dlopen for load.cpp | | * 07a2068820ff4196eb245d15619dc6ce1c71280a No more hard copied path in CheckAll | | * 3886de9bcc007a1ce883ec70e0c5792e43c3381e Build fflib with UMFPACK when suitesparse has been found | | * 8e3438d624895ea35d2e6880cfbfb3b6a79eb91e Unified target system for system packages | | * 4d7a257cb617845965876c33e2e70d12de5d66a2 Working version on Mac with download (with regressions) | | * 0b873add44dae5545e50bbdbc13b57445b30c16e Refactoring | | * a4c23a99908f966500c1c1ec8193cb4fa0aafb6a Add -p to mkdir for tetgen installation | | * 9dd573becc03f3b81dd445c7c5070dc0cecba163 Simplify package management with imported targets | | * 3d37ba63ea4640a62cc79d4b29cc04f0a6fba7b7 Unified management of system-based and download-based packages | | * cd0df2e0a285937c5fd656454f304b395df593cf Set FREEFEM_FOO_INSTALLED to TRUE when installing FOO from the internet | | * 20510acbea4758dda92cf141d594f574dc65d9c2 Fix some typos | | * dfcc82cb89a728522cd49a6f8f6bad175f5b047b unified find_package function | | * fa393f53c10f66f486a1d98197e13158a56d9a52 CMake scripts for scotch and mumps | | * 9e6b4f89e4057cad6496964cb67007226e6d0965 Automatic installation of PETSC | | * 6fced4d15f23995fcf8ec4d5bd549a838a6775ae Fix naming typos | | * 13b8b90f9953aa2f6a545c287c2e2d5c2fb95080 Remove mumps and mumps-seq (regression) | | * 1903cd3ed1cfc90903ce07551393fc567fc1fcb2 Remove superlu example (regression) | | * beb9a2b527d0f8a280f2e755b0db3c36b875e8bc Remove iohdf5 temporarily (regression) | | * 0b80cc7c2218eb668d2160f7858bea0ace3771a3 Add bamglib for hdf5 example on Mac OSX | | * dd31c277946fe3901d3f540108d0a78dccd9f6d5 Fix linking problems with metis on mac osx | | * 4d4f85b2e2e00c393d353d5bb3a84d76c137212b fftw3 ok on Mac OSX | | * 0bac666297c11a5277793fc86cd609c41fdfb464 Fix linking problems with scotch on Mac OSX | | * bd02faf2f9d5f90371b1401bc5285a549eed7de5 FFTW3 successfully found with macport | | * f2f94dc28af0db0927fc40aaabdbc1a3d3603df8 Mumps successfully found with macport | | * 7b48fab9826e270a43d686f0ea61b902688c8fb2 Research paths for macport | | * 2dda55a5de69ade545c40236c4e0c31c4ea1cc38 Version OK for Ubuntu and Mac without gsl.cpp and ffrandom.cpp (regression) | | * 2e420a7b00d0a8fa83e949a1018aea29e3dacaa3 Procedure pour installer sans telechargement sous ubuntu et mac | | * 92aaa42b45820e1bc189db9a31162e1937c0cda7 Default value of ENABLE_DOWNLOAD set to false | | * fce01f0e31b4ac865a11535a196c82c845c4b061 Fix some interdependency problems between examples | | * 932de299721993eb5362f480edc5003db4005dff Minimal compilation on Mac OSX OK (except FreeFemQA buildlayer ffnewuoa) | | * 5e8a22196e48664f0898f2cb9b1bba7d2e33265d Remove Fortran from project languages | | * 2d491a91c1d22ce6958b349325d1367f8f3777fd Compilation without BLAS | | * 56d9e7f325d1aecbf9bbadb8dca513c15a5f914a Compilation without MUMPS and LAPACK | | * b156bdefc87e2a1c49d74c6765e2ae45101bfcbb Fix a typo in FindSUPERLU.cmake | | * 7e44faaa43d0f3a29ea3994897ec84129579cb96 Remove spurious dependency on CBLAS (revealed from OSX porting) | | * 109ff08a3d3180cd801392c15474a842080a4f3c Remove spurious dependencies on HDF5 (revealed from OSX porting) | | * f414ed935a917edb07211ee00f4517cd09e3576f Remove spurious dependency on Arpack (revealed from OSX porting) | | * 9a31e67aee59e4f0241478bee0b3d3c2fd0ecc28 Improvements toward a minimal version of freefem | | * 831a7ef41bdfffc90fbb86a9bcb3ed417d7b67e2 Automatic detection of METIS and automatic installation of GMM++ | | * bfafd594b04ac6a80487b51736bd9562b788f55b Recipes for Metis and SuperLU | | * 7b1b1923bb0fe53eb57f5d92f74937b577084fc0 Package installation performed in ModuleManager | | * c5ecc4b007e588afe9c008c99509cfb5a9bafbd3 Remove a spurious message | | * 6367b07a1afd21313bf472885e477fc46d30881b GSL problem understood: missing declaration in version 1.5 (ubuntu 12.04) | | * 1f5021704c41ad0b3bab6e426ad94f3680cf0231 GSL linking problem: not fixed but localized in gsl.cpp | | * 07909dbc305cc07819b767f16ed6bea7e62203b8 Documentation about a problem with GSL on Ubuntu 12.04 | | * 31ea076e5e0ffd00bc8af62d4390d8f320c66cc7 Merge heads | | |\ | | | * d673fdefbc6b3750aa23d9ed417f294fe66c7ecf Management of missing modules FFTW GMM IPOPT NLOPT | | | * 45220ce2c7c6d7bc46564c4ef47fa5bfe547a45b Management of package manager paths | | | * 7be1b297641c6c330f504542237f9446ccd421b4 Management files for compilers and modules | | | * 9f87d7243f7a30d29ec25ad8edb1b1a1b255416a Management of make check (on going) | | | * 0712369cb921ef2c7a43a59e7d9639f569247bba Reactivate freefem++-mpi | | | * cf6615fb14561d801fd13590dcc4a786bb7018c6 Management of freefem version number | | | * b8c8ab922d147fc62c42b433197485361065dd2c Fix some dependency problems | | | * 953a0f407b984e3488b78bfaaf8bd8679b407651 put back installscotch.cmake to solve case-folding error on mac | | | * 44ad8093e55af2ab1249f179b92414489056c298 put back modules to solve case-folding error on Mac | | | * 05a6425bbd711b6252c838381e831914fe18e356 Remove modules repo to solve case-folding error on Mac | | | * df0db5f32e364e749ec914ad99ecbf6cbefa786a FindSUPERLU to detect superlu in systems | | | * d3faf91bee408ada0d8c2ae08625c4f3ca4afa42 FindScotch script to detect scotch in systems | | | * 2588243fe8e98e23c4d34ca14e4945d8443df9c5 Put obsolete example files in trash directory | | | * b00fd74ea622472e0dc2b8ddbd5d1f4d4b1bafe2 The load-based example nlopt.cpp is now handled | | | * 017b268b91e5721a2eb2226ff3487b2a9f5cf42e Recipe for NLOPT | | | * 2847b4e5b85d6afed00a98ffa6c273fafbc8ec00 Automatic installation of MMG3D | | | * 39b8f7c36c756e7d9fc585906d39ea76f193be23 Automatic installation of Ipopt | | | * fb4d2b2f83c75f0eee4d43c07baf3b5035204914 Management of the load-based example named mmg3d | | | * d9b0233e8740f8ce103411cde17cfb2bbf3e4906 Installation file for MMG3D completed | | | * a2dbc678906b9d7f6e6b125914696e65c20a47af Additional load-based examples generated thanks to apt-get | | | * 9abb9fc1626859685ce1a7e5791b3406308e6443 Comments about external libraries and load-based examples | | | * 6a6bfab20e6ee228aaaecc8ed2437bcaebf43448 Recipes for external libraries | | | * 2fc44a9e25fc34391afa72cbe09193e27be66092 Management of dfft example | | | * 8266f87c50b10a870fa601f6b2f06e1350e90191 Check existence of third-party libraries before commpiling sources in example++-load | | | * f9bc2ee60c08e85620438a27f4814f29ec395bb3 Fix some compilation and linking problems on Ubuntu 16.04 | | | * 99c883f58700c88a49c02bb3dcb69d20750e41ad More managed tests in examples++-load | | | * fed903b5e406d46db2b9d6a9c12469af43596949 Management of ffrandom example | | | * e21a3d0ab2a74ba4fa181629d8f009aaa161462e Management of example lapack.cpp | | | * a97814ecebb0a2d14bd8422160dce126fa11583e Management of the example tetgen.cpp | | | * 86c740b96d1d011e1e283efd83662d96e380d5ce Splitting of CMakeList done. Management of examples++-load | | | * ea00300c3d7f5891785bbd0fcff799cfb1bdcac2 creation of recipe file for scotch library | | | * c47103a9666b989a7ff949a99ae90a72ef051e02 Simplify syntax of recipes for external libraries | | | * 437ee28b43632a81e5bafdf1ae9bf93fbd34f4e7 installation procedure for fftw library | | | * 008ccf90a575ae5ff94a8c7e55f2fb32e7854918 Remove loop over all packages in ff_install_package function | | | * 97d11b77e35466d0104ebc260f79b3770a3649a6 Remove dependencies on autoconf | | | * 4ebd79ee791d83609c080ac492111079c6daa178 Separate libraries wrt directories | | | * 36ac013efdce6818bf11fb6ab907f6ae7413b520 Management of C++ compiler options in debug and release modes | | | * 0723150b11edf1f0320fda29e240d3d1d7d45b6f Split main CMakeLists for bamg fflib lglib and medit | | | * 14a3f2446cfc469fb5009e4ced8209e64bf6b6c1 Split main CMakeLists for libMesh | | | * ee24ae5bd1463ebf3ef04a60777c2dd849591dae Initial CMake skeleton | |_|/ |/| | * | | 0965db90b443cdd9f91e04ca804487933f4e0621 New HPDDM version with prefix support. |/ / * | 6a7f1251fadccb7e285f0988c9dacde64f40f171 add a example to compute the condition number of matrix * | bdebc38e0bca7a6696f8a74c96d3b2300a44c819 cottect macosx install process * | ce5599c187e12f80f17862db978f7bc292560763 update website * | 369e32ff8bf7d9a00dda051495527b0eb2cb6886 update doc for textmate 2 * | d81addb8e98c779f5344fc8c742a46c86042873d Fixes an issue when using MatIS instead of MatAIJ with PETSc. * | 31929b2cb8184cec7480c83f163b7084509be2af Updated HPDDM documentation. * | 4d0dd440f3e05c142814cd736ee4493547f362af New HPDDM version and PCBDDC example. * | 8ec636acb13d4dcff4430aca96817d2c6d174303 update doc for gsl * | c16cdb20ee906403232af072f8a087b3ab9a3310 add function for spline in gsl plugin * | 4a62d063eadd3d27ce9c3a00575e400722216217 add spline interface in gsl plugin * | 925713807d50fc5b69a717c7449624cbd050fe6b Type qualifier on return type is meaningless. * | 6f42042ef9d6f9673f9cffb948b30caf547670d4 add comment in all mpi example for mac * | a613421223f0ce556a3240541432ec0550c422c0 do cosmetic on windows install files * | 456d882f6eaa85d10fcc9e6398433f5e02cf8fae remove line number in windows.php file * | 7eebc1dd017164ea7ddba4809135147135e59cb7 remove use file * | 8a8b7a86ad900c20707a86d024e76a792eca22c9 try to coorect pb under windows * | 1eebc984c8069115dd31de7096333c3d3b5944d7 try to coorect pb on delete string o dll (hard!) * | 40910ac37f09e15b8deb10b01368807feeff79f6 remove the example with trop under window in forall.edp dur dur! * | 11b31f4b51d4b2bc13f0e5c29718d3c463d70550 correct probleme of new / delete string in same dll for windows * | 1aa4f75439578166566970a382360e5c8d9f8bef try to debug forall string[string] under windows * | 8c0bf4f24aae9058ca8440b9b3f79105d9b89b82 coorect build of all.edp in examples++-load * | e53348ce7072d763e3c1a1f582f0b01a4baddf4e updare windows compile * | 51b5d8b95ac3e5c4cd23cf088043824db9a32f55 remove call gsl_sf_legendre_array_size is gsl ( disapear in versio 2.1 ) * | e415088f830bd08dd73d73bcd703c4163f884189 version merge a Antoine .. |\ \ | * | c46ca42f050983023c16495562f3d996062eacc3 coorect configure.ac to new msys2 win64 version | * | ee92ea70925142c07492032d1a2f1b3f004044d4 add new freeglut for win64 in msys2 | * | ffaf7b85e61bf9ac3a33aa4672c1ab147332b154 rebuild AutoGeneratedFile.tar.gz | * | 8cdf44c9395978359735825d56fdab98a6bcf87f correct ClosePoints.cpp and try to add link to flan lib coorect ff-get-dep.awk * | | e92f352f5521092e3b55938013230aba6fccbd9b Synchronizing alh-dev branch into default branch |\ \ \ | * | | 4f0a99587198a96c8a9d642f27230a1137237ab5 Minor fix for verbosity with multiple RHSs. | / / * | | 164db14c9c0a0737fef7e7e1e7d219d8e484b8a4 Merged from ALH branch (alh-dev) to FH branch (default) |\ \ \ | |/ / |/| | | * | 8df1bacb72859999f80e870428a3d0dc126f494f (origin/alh-dev) Merged updates from FH branch (default) into ALH branch (alh-dev) | |\ \ |/ / / | * | 26b6c25ffe16482f2f605119479187beb8c2c6b3 DebianTesting64 (P) | * | fa5b069510dc2b1bf7e452fdee5254533c818fa8 DebianTesting64 (C) | * | 3fe3173ba29cf13b5a8c02b948ba39f6fc403db3 DebianTesting64 (PA) | * | 1adde1edbea52f58f87154ffb095b301606c36a5 DebianTesting64 (I) | * | 543baa626ace614ded903d835da5140c716fb07c Merged updates from FH branch (default) into ALH branch (alh-dev) | |\ \ | | * | 2c5e3a1c8eec6d87db83e10424244f1b97730abd correct probleme tab(2:4)=[2,3,4]; | | * | ca2070237aca9b5f9bf647e2b93790feada0fd59 add line in INNOVATIOB | | * | 2ffa8f0502153d44ecad3057d95d8ad2f51e8ee3 add tools to get mumps info passe to version 3?42 warning the old plugin are incompatible | | * | 2f96e1646cdf84fe32c2ba514bf6f531ff01a1db rebuild AutoGeneratedFile.tar.gz | | * | b5db129cd227d488d9ccb027c4cfe8012125e413 mv schwarz.hpp in schwarz.hpp to reomve collitio thos hpddm inclue | | * | 36b0692b9edc7f508024be33603db4ff8f027ea6 correct hpddm.cpp : {"threshold", &typeid(HPDDM::underlying_type)}, | | * | 6a7b2e219f0844c401a480fd74e276720dac26b0 correct WHERE lib with new version of HPDDM src > include | | * | 458e353a135dc1b912636b50dbcfdd2ef551fe2e merge of P. Jolivet | | |\ \ | | | * | 80d4fbad4795fa807075269eb606a656139c4647 New path for HPDDM (include instead of src) | | | * | bde94f555f569c9820bbe74cf7fdb24d71f58bee correct big bug in build of 3d interpolation for multi FEspace (thank to L. Bernard)), add nex Maccella Edge13d FEelemen | | | * | a4c1efe5c7968f32e061da38b01f994be73bd6e1 typo | | | * | c9a0fdab1f7f0f2d5e416a883ddd5b1396457472 correct configure machine add check key in map whith operator map@key | | | * | 20fc865ecbe01f1a31f2f205b785b5e439ea4db5 merge branch for newconvect3 in progress | | | |\ \ | | | | * | 0290c9261dab3d4e73cee88aa726a2cbf30d7b53 coorect typo a -> pTh | | | | * | 24a3501b835fdcfa661eb6670e3e097ab2476cbb coorect const mesh* in mpi | | | | * | 2a1d979979df2992a955de6c29b54a54e5174729 corret pb const mesh | | | | * | db5b1c00c55c071ecabf553c493493d24c1c7f66 add u.Th to get mesh of Finite element function in 2d an 3d | | | | * | acb58f9ead0cb0e1c423e9729ee8a194436fb1e0 correct const mesh problem in parallelempi.cpp | | | | * | 77a852cdb44254dfd7a3b685a5f0d7f626612bb9 correct problem of pointeur on const mesh in 2d and 3d | | | | * | 82be329e9accef55427c5bad3279297c6656da16 - add tools to get mesh of fespace Vh in 2d and 3d mesh th2= Vh2d.Th ; mesh3 th3= Vh3d.Th ; not the type of the mesh is a cosnt pointeur => lot of cosmetic change | | | | * | 9318eff279e400cdbd6058ba34ef32f512271dd5 add miisng examples++-hpddm/Makefile.in in AutoGeneratedFile.tar.gz | | | | * | 904f119ff7b39b0ba4d8135c2db04818fdeda790 add info on gsl and ffrandow in doc | | | | * | cb49f6cfc7eab8c55078008366a87d71de21b8c1 correct for 64 / 32 version WindowsPackage.m4 | | | | * | ed9d4ed83df808f7a0462c749d4e81176f916d4f add new type of reconfigure | | | | * | 972b94aad8a88c2860c0b3dc821f1b3bae872a55 past version 3.40-2 - try to resolve probleme with petsc metis and freefem++ metis now freefem++ use petsc lib if petsc is find for parmetis, metis,ptscotch,scotch,fftw3_mpi, mumps,scalapack - correct hpddm examples - rename plugin schowarz in hpddm - correct problem on compilation do scotch | | | | * | 38c7ca1fa4bfb904308339ad370fabebf845c772 correct missing lib in scotch under linux | | | | * | f4c9cf7fe1683acfdc456095a372fd42e75d8930 add missing file in distrib | | | | * | 394bae3f4af8b155487da14ddd959a8483356da1 Merged the FH default branch and the ALH default branch | | | | |\ \ | | | | | * \ ccf8662e5af0f528b1dde95fb473436afd50289a Keeping ALH and FH copies of default branch in sync | | | | | |\ \ | | | | | | * | 2ef9826780117a6a3cc2491df38817c0cf46ebb5 pass to 3.40-1 for hpddm | | | | | | * | 1ecb6241ce25bb2ac30fc30af86c3a5b17d17516 coorect typ in build FreeFem++-CoCoa for apple | | | | | | * | 0fd0621fa5ba4963fbba870f586a60acc008d0cc coorect hppdm | | | | | | * | 2b743ecf8072d5442ff1f9dce39a9cf8c3f87fa9 coorect petsc find | | | | | | * | 054b00a1b337647ebf41f136940ea781300babe1 add missing file | | | | | | * | 5cb91799e92d176d2e1cd5a3b708d9cd4b66b0b0 add missing file add correct configure | | | | | | * | 4ee688a729b455268737c477c5fb923e3e252beb coorect pb on scalapack and mkl under mac | | | | | | * | d72b550b1718f910bb6ba057af59cc3a0c3f195a correct hpddm make new example dir try to coorech hpddm version | | | | | | * | 16c08d021fd49da327847081d647386c3405015d pass to scotch version 6.0.4 | | | | | | * | e8a20fed59bad07ced51130dd5e4a29387f7a158 coorect doc (typo) en add comment on array of array , array of full matrix | | | | | | * | 33812efc8169eb5bbb66f58bcc70a5322ca75e9f correct acmpi.m4 in case of -isysroot /blabla compile option | | | | | | * | 68a1bba2cd3fe1ff36509e5cc2c2224009ddf633 correct typo in if | | | | | | * | c7bd5334befb45c5788df2aae935c95132da6c32 continue remove clang++ warning | | | | | | * | 53a20d277caf9345ce6a20d304f569a1fe3f3263 contine of remove warning | | | | | | * | cc138f32da24211385aec7b23472c9bbfd1d5615 try to remove message like warning: reference cannot be bound to dereferenced null pointer in well-defined C++ | | | | | | * | 80a35ac718f3f06d358a418341fbd05b2ecbbf82 missing include | | | | | | * | 42d5a2fc55959260ee3f8bfcf57cce4921f9b998 move function for dll windows form ffapi to environement | | | | | | * | 6d4b2e73d8a9b8dcf593958a052068386479c167 correct pb with \ under window | | | | | | * | f543406a060fcab90621bb0cfe3e1ca80f82b3fa remove fork part of file in distrib | | | | | | * | 134f8e9ff3d121d75c60c384c2e2f9e40cdb2c04 rebuild AutoGeneratedFile.tar.gz for version 3.40 | | | | | | * | eb7e9103391ab4b1497c2cc588e14b06e5524a2b coorect pb on choose FLIBS | | | | | | * | 8897579f4be9bf2e6513e907b0836176335a503b correct type | | | | | | * | 14bf0fa93846e5c097beb927e37c2e4fd825f4c2 cooret def. place of ff++ petsc | | | | | | * | 88ab166aac95fe45263b1e5b09e85f65bc09176b pass to version 3.40 correct compile PB of HPDDM try pour put a last version of PETSC. | | | | | | * | 7b212416f340b14f2ccd9f18733436a5a1eb3f89 add new finite elemnt HCT HSIEH-CLOUGH-TOCH | | | | | | * | de9a0146b991c0cf12648d690c9606582c651f1e coorect convect in 3d case (bug !!!!) | | | | | | * | 2f88a81905f87c225f897f0839e76126e6a20149 change version of hpddm | | | | | | * | f3bc35521c9c4f31dd0c650874b2c70dcfb4aaf4 correct typo | | | | | | * | d5912ebdf78c47bbd4fe431c6174cd45ddbdea4a try to solve problem of writing in dir example of installation | | | | | | * | 2c32decedb6806a489c9910817b0b55f80eb8f09 add chtmpdir function for test in other directory | | | | | | * | 386d589817b309eecedec4e02466906b26b12272 coorect for msys2 and windows 64 version | | | | | | * | 0dc6fb97b7e8af8f27e058f7f69162ac347ed3d2 continuing ligglut | | | | | | * | 296544e131cd8d0a26f54a845e1bdf1954ed81a2 continuing if config ligglut | | | | | | * | ebade09e2cf8b72c3915e581d257b66c23324d88 coorect choose of glut lib | | | | | | * | c4de61407d5504081ede4795d1f66b0cf0bb3bb5 add choose glut for windows | | | | | | * | 8603ce59743f25dcce7c02b21399d3eb309028e8 correct WHERE_LIBRARY-config for UMFPACK , AMD | | | | | | * | 0863874253afe885feef86c24672123cf3c57725 update configure.ac for mingw-6' cas | | | | | | * | a91e9e9e0d6b2a0832b8c9472ddcafe87a43de0a add ArrowSize= to plot command | | | | | | * | 6bdfef6d81d1dd2670f772a7b6f989bb6f3365fe add missing files | | | | | | * | 6aeb30aa91c79f85b17fe71ea32d73c60219992c remobv -fPIC option under windows | | | | | | * | e74ceac990e45ca6aca86e9904ea85cf7bfc990f pass to mumps version 5.0.1 | | | | | | * | eda9100a16e5af7f7dd4c332c3106f88d5c663ae correct cube function and some pb of memory management | | | | | | * | d65997c4b31f6c8a5dc535518a7ae433fff7b815 correct the new function cube | | | | | | * | 6a68045de046fa483bd97e06ec15158cb3f0eb81 version debug | | | | | | * | e04a9ec341c19a5e5b5bbc854c9e1a03c757fcc0 re build AutoGeneratedFile.tar.gz and merge | | | | | | |\ \ | | | | | | | * | 5ee4ca275d48a12b6a8cc5fee4ac3e39374c1720 pass to version 3.38-2 correction missing doc in standard distribution | | | | | | | * | c202e9147cb1e7437e0a4b1fd36fef7e8291028a add missing files | | | | | | | * | 66d9fe788c1ca9d8aec6c5e125660dfb353213e0 add missing file | | | | | | | * | 688a38e295827c8cab3caebdd84886fec852fbc7 add hpddm doc in the documentation. | | | | | | | * | b77e4a0aa713f9f67076f4189ef10790cb02fa7e coorect dfft map , alld martor example, add error in cas of += varf | | | | | | | * | e4a6a5e348e5ae5936dbaf4d357bc4d7303a9364 remove extra print in ClosePoints | | | | | | | * | c83733aaf2f43b658e74d30c96eef9dff25a294e coorect ClosePoint and M(1:3,4:5)' | | | | | | | * | cb439b237bae8dc2fe8afd0dcd557c2344d9b402 add transpose of M(0.1,3:5)' | | | | | | | * | 2f7b3e6547c4b52e9315dfe941986771eca10221 correct pb of parameters in ClosePoints | | | | | | | * | bf936aed7935f2d7f3e0aac8a80d121455018a01 correct renumbering and add test improve ClosePoints.cpp to find point to close un array of real[int,int] P(2,N) or P(N,2) | | | | | | | * | f367ac3e4331162aa42294cbfd6da195ae4fabc2 remove bug in renumbering (remove DOC ) missing return in c++ | | | | | | | * | bfd6311e0f31a3720c5bf5f204e83d342e19da91 add splitComm for hpddm tools | | | | | | | * | 8f976f1ad67905365feb558aa000a792e2ab7896 correct Navier Stokes examples | | | | | | | * | a61dd8622c148a6dda91f9701009830d46b94d36 coorect type in Curve parameter | | | | | | | * | 33da7ad97ee8682415407a47502905a862790ac5 add one argument un curve (isoline) | | | | | | | * | 288fbdcbb85a1815bc5718d9c79faea1a4ac9d91 add missing file (Element_Mixte3d.cpop) | | | | | | | * | f639ae82c038ec945f11c7da3decb5c17457d9d1 add new Edge13d Finite element and examples | | | | | | | * | af80025c2226c0ed8cbab59ab927fa003172c8e0 coorect removedof | | | | | | | * | 1725c8fd0ce9b8b888c803ccc6c44e5d80364590 update doc | | | | | | | * | 6e7de6424f8955c7d1156d5f5f4199b6033f3422 add INNOVATION word. | | | | | | | * | f71a343969a07f6bf71ab5007bc58a678efe1dc5 add tool to remove test of optimize in all integral optimize=2 => do optimisation without check | | | | | | | * | c5b243e47e27aafcd0bb8cbc60c8771f25a56311 coorect convect 3d , | | | | | | | * | 1dd51fb84eedbe6ff58c23072ffafd710a5b7fb3 add P-H Tournier trich in renumbering eps and only rhs ... | | | | | | | * | 4b5ed80654b6742b4eb8253d695ef073c43a0945 limit number of try in wget | | | | | | | * | 48950624d8ca76691f4eb7d8fa8a673b5e191517 correct getall in case of pb of downlaod correct schwarz.cpp if non petsc | | | | | | | * | e1f163fd7d4e52f6cb708cc2cd9c3838bef2c7cc pass to version 3.28 | | | | | | | * | 69dcad6643e947f5cbb1fd3019e335ecd7320f90 coorect SUPERLU dist witgh gcc 4.9 | | | | | | | * | 139b3589ca7dd75b20585c128036f00bf706dd80 coorect makefile in case of not mpi | | | | | | | * | dd8a84f87d9338af9e8f6574f96052af40090296 rebuold missing file | | | | | | | * | 13feb9f5cdd7d17f00b1d8c66ca8339fbe189249 correct pb in installation process without mpi | | | | | | | * | cc58c9af4c9972505b09c6a0198bfaae2466a821 update AutoGeneratedFile for umfpack | | | | | | | * | dd56f70af32113609050507af3086a7b53e67cf7 correct pb for launch under windows change umfpack version because the web site change; | | | | | | | * | 8c09783f0adc1b21a38ea2167770a5a3834c8d30 add missing file for schwartz.cpp | | | | | | | * | 0dd050f0baa0384f7d2ef49856603a5e59c96107 add missing file in dist . | | | | | | | * | 9abf0f512cc6c8b2770650b574ba2b06c298344e version 3.37 | | | | | | | * | 6c548289012c8e12e740c63b05fa0e4e02088899 correct pb with new version of hpddm | | | | | | | * | 6d91781d9784974d1c74cedeb65af574972ebc66 put less point on ClosePoints.edp | | | | | | | * | b649c9f0bffdbdcbdcb4c857acc6f56d042072a4 coorect pb with new hpddm version | | | | | | | * | ab60dce40a75f0adf26f61ba419785750d1db829 add read on real[int,int] data type | | | | | | | * | 29304cdc797281be7138ff7ce15618ce898460e1 correct precon CG | | | | | | | * | 6071f4dd0dda42a89512679730773928909f1e99 version 3.37 | | | | | | | * | 5e865ec7b735ad7a636c2f40c2bd7ad81527cad0 remove debut cout | | | | | | | * | c28e697180981c69f660243c7c4222a85334a537 add missing plugin aniso | | | | | | | * | 7e2d06cc3a93026f67bc42d84393033d260cdf15 add -wait in case of no parameter in launchff++ under win32 | | | | | | | * | 85522e8a3d60e04f52b92325708200e99eb3bb6c correct wait under windows by default only withvia launchff++ | | | | | | | * | a7cb0644474a8dce9350460bb57c8fb030aac34b pass to version 3.37 | | | | | | | * | 8a32ba2ab5783d36990a7eb87420e4541491ca63 correct be mistake in DG formulation with jump/mean on test function in linear part. | | | | | | | * | 41b6c446fcb3b2058035d8473486522a8cd83d3d correct bug in debugshack try/catch in frrefem++ function, | | | | | | | * | cdf690b87530bf0a6d30a81b6f601f7cbde47d0c Pierre Jolivet correction. | | | | | | | * | e34823bca7eefa2a1413f80854c30d5a62520a17 add ClosePoints tools et exemples | | | | | | | * | 183543b50f72a44ae03ce5da4b6e01c5b3cdbecb rebuild AutoGeneratedFile.tar.gz | | | | | | | * | d10f6c102e8f92373418d260149b1769e512e44b correct for new apple compiler pb on null ref. | | | | | | | * | 2091080cffa96c1afeb9f53504522768d1b5d663 try to remove null ref. | | | | | | | * | e9da9cb94f68183da02d12404335f0616092cd6d correct problem due to null ref | | | | | | | * | fc5c7ef29c72d88f1202f129f026488e226dfb09 contine remoev ref on null | | | | | | | * | 125829df776537d1df9aeaa6107fbbe87d2e29f6 replace ref to point in bamg | | | | | | | * | e75c1f385a32b8ddaf55fbabe35740f76e6597fe correct pb of optimisation of null ref in bamg | | | | | | | * | a76ac903632cafd1435ec536151af52b5ea6d053 correct pb in small allocation (in test) | | | | | | | * | 877b27ad652e6642a09dbc44281196dbb3787b1b coorect type | | | | | | | * | 1d1f73d2dfe900fc97498740bbf46f3f185aab78 add BADCERT in hpddm | | | | | | | * | b978ee649ac50446b29cd28e6878fa3be3b248d7 add new exmaple and rebuild AutoGeneratedFile.tar.gz | | | | | | | * | eb5e9f092c0d35020465f3292533a9f6ee3166ba add trick to remove round off error in computation of the partition | | | | | | | * | 7bfa52ef1042f63398025c6c20fab09740431e2c correct problem of check of negatif volunme in case of no vbolume | | | | | | | * | 2f22d83d331e8e1cd52394c25d4207480e3c7b8b add tools to build mesh a set on interal point add points=P to builmesh | | | | | | | * | c6a0ce314d03e6e459e5271b0979c6ec24b8f701 corect pb in Mesh::Find is case of brute forces. | | | | | | | * | bd5f1c84e48133ceafcd2b1f88894de7491c2116 correct type rank => mpirank | | | | | | | * | 61002022f5c55511d1caa3fd90d0624283ac048d add Pierre Jolivet patch [Freefempp] Regarding the use of FreeFEM++ with PETSC. | | | | | | | * | 60b2aba0b8e36d1bf75f8c61be1d59cb85561e6e correct old bug in find on triangular mesh thank to P. Jolivet | | | | | | | * | 33588dbac398680472616e20a682abcbea5fb326 correct but in evaluation of (aaa')[0] | | | | | | | * | fdcaf82a89445ff166c26397762a7f64a4c5a4b2 coorect un set mesh in Period-Poisson-cube-ballon.edp do some optimisation in DDM-Schwarz - try to add renumering of dof in trunc mesh bad idea | | | | | | | * | 7dafa48fad708542c8902abc5380c0c71aa803a6 add tools to bound aniso in metrix | | | | | | | * | a4f3ef8aa446d53e781bcd3b00f0058ca8191508 correct header of ps file ???? | | | | | | | * | 267aa2f0ce51eeaf9f26a95306d85b35529f67a7 correct the remove of FreeFem++-api.dll in load link | | | | | | | * | cf9a2a02de43778fee7e736feda18e7cd7307807 remove of AddLayer3 same as AddLayer in msh3 | | | | | | | * | 1214eb7036e4359f5abdda851742dbfe8c59e94e pass patch of P. Jolivet. | | | | | | | * | d6d3447d196c6e1f21e0d82dd5243ed3575a8672 coreect INNOVATIOn file | | | | | | | * | 9d3734442eac328ea032b6ec465c1e821fb35fcc try to pub messag in makefile if generate file are out of date. | | | | | | | * | e77ddece101c7abec0f27df38642fa7095502656 coorect pb of space in variable under windows | | | | | | | * | 2d2e7872268db6a912d4127ee75f85256688dfe9 correct missing patch | | | | | | | * | cd9f706d2c16bb753a000c7be2f12f6d0372fe87 correct scotch makefile for windows | | | | | | | * | ef8a19246f5a6101cf2b9168f8de742baec0d67b re buid AutoGeneratedFile.tar.gz and include.tar.gz | | | | | | | * | 122dc7285d2b751c5764fdee9f99fb86a8d3578a coorect makefile for windows | | | | | | | * | e9d914bfe57ad94960e98394c2d7ef9a3ee897ba correct makefile for windows compile process | | | | | | | * | 2a6a44dd3e2b7da86146e984a4bc3aa70f1cd3ab coorect type in innovation file | | | | | | | * | 0bcfa10136275b3db0f366d780726752b5cfb4cf remove fast for schwarz-add-macro.idp | | | | | | | * | 5bbcfe9675390cd84131e046dadcfd0b27d3ccfd update HISTORY | | | | | | | * | 9195817880d2abd242233c3d396911f5e818eb7e merge and correct pastix | | | | | | | |\ \ | | | | | | | | * | c25f3ce07250f3b5f22bc1323b0ec861d33cfd88 coreect pastix compile | | | | | | | | * | 0169dbe650d2f735f892233bbb36acc9f922635f clean a little schwartz.edp | | | | | | | | * | 7aeeae407bf1700a04a16d001516ba86bb3ff7a1 coorect lround and f(aarry) function | | | | | | | | * | 52647df0998514f3ca02d7d66f33fe3431ecc834 add lround off arral double to long | | | | | | | | * | 8ee04f5398dcd51ee3b666bbd451f794b13d99c9 correct update pb. | | | | | | | | |\ \ | | | | | | | | | * | f3089f335035dd0874ed51702a88490cd60fbcdb update schwarz.edp | | | | | | | | | * | 477ed44eee94dc92492c5de8853c5fe9e507574d correct typo | | | | | | | | | * | 94668e3d2af0b11071e6b10392f8b15392dbf481 correct pb of optimisation FLAGS in c++ => slow version | | | | | | | | | * | 543e444d3f1a1bffd286ffb71f1cb505aaf178fd correct pb compile new aprmetsi and metes in hpc2 | | | | | | | | | * | 1a94e0bb9f4d5d04504ada7752e4fad5774af9ad coorect for new hppdm interface | | | | | | | | | * | 1f3e7be8bec04223cd995f0160c443f1ce2f32c9 add new schwarz interface | | | | | | | | | * | ed6061d7d43e4da6e895a24e85f02ee66270dbf0 add coorect for windows compilation | | | | | | | | | * | e2231c58124abf83bab42f68e8483ae5fc6aa111 correct Makefile for windows | | | | | | | | | * | 419b45ec23badf16ac90dbded98275ec58a56efa rebuild AutoGeneratedFile.tar.gz | | | | | | | | | * | 71e4ef4a971ba3b9b8c22d261b2b7f94ab49715d correct type in examples++-mpi/Makefile.am | | | | | | | | | * | f22be367b27ee309792a8fe7bcf7a547f5471eb5 add P. Jolivet as Author of Freefem++ | | | | | | | | | * | abcaf7f8b7622e2b734a560fcb2a0922415f4c56 add new geno example | | | | | | | | | * | 78117ac19e40b77824f4a7230b16376333a57ea7 remove compile of iluyt if no gmm | | | | | | | | | * | d38f1632c765617075573ce248ebe58260a4f7f9 add disabel gmm flag | | | | | | | | | * | 2d0911256d545a11543810d8f30e7f05e3d84e3f add new example | | | | | | | | | * | dfede552e997964705c2233e7c5f75449d0082d1 add new exemple | | | | | | | | | * | b860ea55b8660c20bd5bfc56db38bacdc71c339d Added tag 3.35-dist for changeset c863693513fc | | | | | | | | | * | ee31d3ba2d2c4b01f7929584828d6fc270a2d9f6 (tag: 3.35-dist) up INNOVATIOn | | | | | | | | | * | 02afb5c0c3bbd06bb17f43a9bd3fd0c16c6eb020 correct optiann NO_RANGE_CHECK | | | | | | | | | * | 1e2e0eae6f7eca050f8bbb9375211fd1d4c305fe coorect pb on install form dist version | | | | | | | | | * | 1c9517d6a26b9e06941a52ea78b9c052560443ff remove delete of download file | | | | | | | | | * | fb3bd8e516cefa84c151051717ddf57ffc60b388 change mesh size | | | | | | | | | |\ \ | | | | | | | | | | * | 035e5be6df3303cdfe11d59c8db246577e1da6c7 change mesh in examples++-mpi/Stokes-v1-matrix-superludist.edp | | | | | | | | | | * | 6dc998765e5979d4ad25e3acdcb03f9553ef462b correct pastix downlaod | | | | | | | | | | * | 3304c3233b327fdda05a7c461c303578212767f5 coorect lib in superludist | | | | | | | | | | * | 10e57ba174a167702f3eda11afb3498fd95569d1 continuation of new mpi version | | | | | | | | | | * | 2b0a43dec8931ee99b8a521564800a02a33f7b87 add test lib in schwarz.cpp | | | | | | | | | | * | c3b4cfe017302150f72a01c8d01bcf4b6ef5a957 add test lib seach in WHERE-LIBRARY tools | | | | | | | | | | * | c43ab2c4b01e2cbd48f5d47d703267c10a7b4a79 coorect tupe in makefile parmetis | | | | | | | | | | * | 804c0228c742bbcd37bdc8b471d13b1b39780427 coorect missing CFLAGS in metis and parmetis Makefile | | | | | | | | | | * | 7417f3303f9826a4eddd3802b26a2b100af6f44e change metis to scocth metis interface in parms | | | | | | | | | | * | f4f2c4f8562971d0b8e535e2b996d02162a9b52a remove metis of hips make file | | | | | | | | | | * | 6462d10664da0fb8106945b3c4388cbad3f40725 coorect hips with new version repalce metis by scoth | | | | | | | | | | * | 18cc850950d7c626156d646acd445b6d069c308b change version of download solftware metis, partis, scotch mumps mumps-seq | | | | | | | | | | * | 16f0130df8c7bbf186b8cc95fb5a0c61441ce6f4 add miss file | | | | | | | | | | * | e297f0f112d6bfaed044d15357e6b9cd5a5ef8f2 try to change MUMPS , scocth metsi parmets version . | | | | | | | | | | * | 82cdb45a143c1cc311bab13e92f7804f34dbd7a8 Added tag 3.35 for changeset b45b55da9433 | | | | | | | | | | * | 508e4a328e8ff398df396bf3f6a9c8dda2208c64 (tag: 3.35) rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 1d115f3f805131a4c19ddfa015ef9523f16e20a2 add chech in confiure if autoconf is too old | | | | | | | | | | * | bd0f60c50319ac12e664fec6c988d0ce8836ff7f take un coorect PETSC makefile (i progress under ubunutu) | | | | | | | | | | * | ecf82a8897f2085f0839bedeb665e262d4deb596 add forget fi in src/mpi/ff-mpirun.in | | | | | | | | | | * | 9e83f660ac6c692b32830b58ff9c408270196ec9 just put rev in INNOVATION | | | | | | | | | | * | d3f1995e52e3cba8200c1bc807136bba0e68cbd0 pass to version 3.35 | | | | | | | | | | * | fbc9734d25f50b4037c623f7ed1272eef55ca7c4 correct of non static function in LOADINIT plugin function. | | | | | | | | | | * | 37692fed6f176271ded0c79f23fbcd4e96f23d8d correct pb of install under windows use of launchff++.exe no FreeFem++.exe | | | | | | | | | | * | 82c79cdcffe10e72606d9cf27e574836505a2b83 add dcl of typedef void (*AtEnd)(); void ff_atend(AtEnd f); | | | | | | | | | | * | 3b448121f7a957c07eb3712a274b5fcb5db099ff add Airy and Biry specail function | | | | | | | | | | * | 5e5973cb6ebc9a11553afc27bd3809ee00e4c879 no waint at end if parallele cas | | | | | | | | | | * | 8726502d0a16d995aaf11a11bc0345fcccb11a3f coorect init pointer for ffglut | | | | | | | | | | * | 4b1b5481ef5ca35d2881e81a1ba3e2245d4366bb add comment in innovation | | | | | | | | | | * | 41f29d849ff195355a64e7029689665927267376 finist coorect of compilation under windows Ouf! | | | | | | | | | | * | 5d9b6374e556f4acc0daa2a73bc0b3215cd442a5 correct the WHERE-mumps LIBSPTHREAD | | | | | | | | | | * | 4253152ba660a60dbcc54f987b3eef4f96f18e9c correct phtread lib in WHERE file for mumps | | | | | | | | | | * | c5304ee4e6cbc2e98f988e6ae0eae01c8fc1da65 put ffapt::init in mymain | | | | | | | | | | * | 5229dc727daa16b13855a040dcd9fe5d39808ff6 correct ffapi interface | | | | | | | | | | * | 23004c2a9a696f5ca0b462b22fa71196db3d0198 put the def of ffapi in Global.cpp and gggg.cpp | | | | | | | | | | * | 80f243b962248ef3a4d0fbbb5de2026b9902b55f change all ffapi interface for window en mpi to have one ff++ dll with and without mpi .. new all interface are pointeur .. | | | | | | | | | | * | 158e229df516dee75feb6de47b5713e2642e9937 add namescape under _WIN32 for isnan isinf function | | | | | | | | | | * | 1e97eb450de96473df9b5a4d3498e81a412f5fba add -std= flags in ff-c++ and chose mumps if petsc in schwarz plugin | | | | | | | | | | * | cbbe67561f510554404909bda1dbf0ac6215eeb1 correct typo sdt -> std | | | | | | | | | | * | 9215b9ca3d75e7ed888e92625fcbe7801fcf3d9f remplace c++11 by cxx11 for pattern porblem in shell | | | | | | | | | | * | 25a525713c9b9c1e7501994d17f2030b4fc9c468 remove default c++11 compile if possible too much probleme under windows with g++ 4.9.1 add c++11 flags in WHERE-LIBRARY stuff | | | | | | | | | | * | c545e260dfa6c7d24119d4dfcdb8ffe9a227b956 change WIN32 in _WIN32 (better ??) | | | | | | | | | | * | af258673be26c9682ab77b603170a52a3427dd51 do correction for wondows | | | | | | | | | | * | 3ee1883ced48cfa0d14a13879ffc27b87675b1f4 correct compile pb of compile under mingw | | | | | | | | | | * | 3d5955c84eac1f671a1e8255d1c01eae337d4eb8 correct pb of MPI_Include dir with white space | | | | | | | | | | * | c7422d14ffeef12855e92181319aa3526d247d0b coorect pb of -m64 on m32 machine in CNOFLAGS variable | | | | | | | | | | * | b03bef14667ff30e73e1ee64428540988de4311a coorect pb of libpath in freeyam under windows | | | | | | | | | | * | 825219ddd9a36872ad0a16324ac23d3dd3d6bd91 coorect missing ; the reisntall hpddm | | | | | | | | | | * | 23705ec919cb23270ed8849509780c187dfc605e coorect pb in reinstall hpddm | | | | | | | | | | * | 8a8098832b5e3526fc85494f157fd08c3e1e5bb9 correct typo WITH_PETSC -> WITH_petsc | | | | | | | | | | * | dd77e62cbb831d279ef0d1282e940b1c99e76cd7 add comment in INNOVATION | | | | | | | | | | * | 7b0c61997f4f6fa288d3eadc2482c3236a52cb6d coorect pb in case of no hpddm | | | | | | | | | | * | 44a0f6f04d26f8fab26788450be812dd9632e228 add airy function of gsl | | | | | | | | | | * | 3d957f4022faa7d559b3429b737ec87c4c4a0881 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 87b90dc0c2dcfe0222a56b49bed4ef25fd5941eb coorect pb of space in mpiexec petc varaible ... | | | | | | | | | | * | a2052d5a7c82504e05315c9f550f8a23843ae53a rebuid AutoGeneratedFile.tar.gz | | | | | | | | | | * | 5e613eecbb67e88806b487dbdcdc402f635774cc correct configure remoev ff_petsc variable | | | | | | | | | | * | 071461cce041d343264feef7912f230ff8eba37a correct typo in configure of petsc ... | | | | | | | | | | * | 51c46d92116915b04e02d9c4d03a057ea141be18 correct find petsc | | | | | | | | | | * | ae35c5ca8d68098ef7529ecb30f118f5b9ee3c98 correction in caes of no compilion of hpddm | | | | | | | | | | * | dff9456a469e5017282c41436b80252cb71e308d correct typo in configure output | | | | | | | | | | * | 002f81725b6902ad16dcc2ded969bea1c2bb6015 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 0077dfdb626ec9c8267d18f96f66dcc8ccd79958 put change for hpdmm mlk old. Thank P. Jolivet. | | | | | | | | | | * | ad2276c6e71580683fd8e2db3cbe9fe77bbee082 add reinstall-hpddm targed in downlaod/Makefile | | | | | | | | | | * | 920ffd03d7dff44039b466f9e87e1ee49823ff4c correct typo in find petsc | | | | | | | | | | * | 85b698dfbaef74eed0db607f2fbbe2f38f124111 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 539cb95a1d29a08bf75d89498ce9f636110c7fe5 add notify of petsc | | | | | | | | | | * | 63f9b15665cd5d59d7fe4d205f03400a4cbd8c41 update INNOVATION file | | | | | | | | | | * | 9b49bc97563695c225939fa908f155409f65e0f5 pass to version 3.34-1 for PETSc interface ans schwarz plugins | | | | | | | | | | * | 715eba840e7799a0b8d94ee79129354138a5625c coorect problem on version in PETSc interface and MKL for schawtz.cpp | | | | | | | | | | * | 12664f34f44f0c12488b2037586e856a356831f5 correct typo after big change in plugin (now all test works) | | | | | | | | | | * | 36fae418da9eb1d0dee99433116ee384416b42fd Change all int of plugins due to bug on somme allpe version ??? | | | | | | | | | | * | feed745a6eccc496e2f025e510f564128f6e1f27 try of compile schwarz.cpp on all case | | | | | | | | | | * | 99296e7131b6386d93ee16ebdd522d20980466b5 remove plot in MPI | | | | | | | | | | * | 186d32a0fd32d13d1de9899c0e71b8ce35aeba09 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 3f1efd2ae2bc85733bcd16c4c4ffb840542ae73b remove libiomp5 if non openmp | | | | | | | | | | * | a0fece2128b976a0b8132b34b3488377a3963525 updet missing file for hpddm | | | | | | | | | | * | c9ad67459d937901e609741d4fc8c867b1953c0e coorect pb of compilation of schwarz.cpp plugins in progress. | | | | | | | | | | * | 14f5e8cf092be45508645160a4cc13f4e391e7d3 correct ff-get-dep.in ff-get-dep.awk (pb of new line in awk ) | | | | | | | | | | * | f3e893d4f5964315fc49a7c929bebcfdc154d834 rewrite all automatic search of library in awk ad add no mandatory lib like PETSc see schwarz.cpp example. | | | | | | | | | | * | 4aa06c62fe2dc5f0228ca61314941f19a6df1d4b correct missing include seach in ff-get-dep.in for no mandatori libs | | | | | | | | | | * | 0de9173ea8929291f4e4a483893cdcb9d9306562 update download/Makefile.am | | | | | | | | | | * | a58f682895837eaa2c09786714f28ac96a45773b add install de hpddm ... | | | | | | | | | | * | 08769aee4badf8a88222b4d4a8a068fb5de27c2c correct bad LIB_MPI in scotch | | | | | | | | | | * | 7089cd03dc44f0605b7aaf0ed0731f175f90a32c add no mandatoring lib in automatic lib search (WHERE-LIb search) | | | | | | | | | | * | 2e166137b01187a9bfedfbf6986b75c1543b899d do lot of correction for new install version 3.24 | | | | | | | | | | * | 6f07bbe78e428a9a480fd0705c0a4f969106a1a3 correct acmpi for pb sgi mpicc | | | | | | | | | | * | c017bd59055e4e5acbbd774164aaaf282f07d94d correct problem when find c++11 version in configure | | | | | | | | | | * | 90f7f4b87c5ab54a41cd029310c0748c6e55a4b6 remove a madatory 3d test | | | | | | | | | | * | 3875d72c3df76e22073a6cb8256b11dd491a4479 continue coorect double free | | | | | | | | | | * | d9a4069469d766cfe5932f109a30fd1ae59a3247 correct pb 2 free in bamg | | | | | | | | | | * | 21978da85957e41178909a5347eb5bfc4e7f3493 correct typo | | | | | | | | | | * | 44fca001d5abc1720a6b851115c9a34f06503fe8 remove of pb of 2 free un bamg in case of crossing boundary | | | | | | | | | | * | b53ea9fc99bca8fa9d6284bbf908ec196d737352 change for c++-11 and hdf5 with g++-4.9.1 | | | | | | | | | | * | 589f679cf04ec294ea8e66940a9d6d8025ce3ee1 correct jn call for c++11 | | | | | | | | | | * | 7b46566d28cc805d0e6cac06d1705516b015eac7 coorect pow of c++-11 compiler | | | | | | | | | | * | ca2baadf68a37ca072483db75d99a8fa44576e44 coorect pb with pclose call | | | | | | | | | | * | 4d62a69ec32d108eab1597a9537f1806bb18e7b2 add correct of pb compilation undec g++ 4.8.1 c++-11 | | | | | | | | | | * | 429b98468afb6065a1d002ad4ab8ccd71eac46a8 add schwarz.edp and add AutoGeneratedFile.tar.gz | | | | | | | | | | * | 3676b9828d3a822581ccb7cee914c4a3a475df5a cadd schwarz.edp test | | | | | | | | | | * | db0997da766cb1b7bdbf43014ae5ad377751a446 correct configure.ac to compile plugin schwarz with PETSc | | | | | | | | | | * | 6c9fcc6962686a87c8bed653257bc8adb5572f5a add petsc in configure (first test) | | | | | | | | | | * | 8b52fdb810f096a94b76813b4079522523285c49 correct pb compile e new schwarz pluging | | | | | | | | | | * | 6c3d4b7f7fa7842728d6b64640d2755e0f80c7af add schwarz interface | | | | | | | | | | * | c3db313453259122927ebe8e0dbd905f2c28d535 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 8cb4dd25a1a9dc2f4f8de67b62c8472b6f779531 add new cpu type on apple | | | | | | | | | | * | 1b46877c959ec5cb77675727801e5d48ffad3c7c rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 77015c6d6c8710fd39f59efb1896e4c1ff0c4346 add cxx11 chech | | | | | | | | | | * | 19d0bd6471c916aa05cb30c9021a605189687518 correct build/download to follow link in case of curl usage.. | | | | | | | | | | * | efbdb35696d4fa15c7d813ee50fa79a22964fb70 correct pb on depot | | | | | | | | | | * | 39659c4d772ffd27eb6750c39a143efe273ae9d3 coorect examples++-load/include dir construction | | | | | | | | | | * | dca3675853b31832fa90ef3794d436f53805ebf6 correct reconstrion for examples++-load/include | | | | | | | | | | * | aecffb8fe9ce65a40164d41902b44e5481338633 add missing file | | | | | | | | | | * | 65b73c465c9004a4e4c2779558b5268a4a24157c rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 3a079772db23c356fa659e1e8797f07844504828 correct src/bamg/Makefile.am for hdf5 tools | | | | | | | | | | * | 3f3b333f92f41cf8d3e7296780a6b8d165e1f2d9 add missing file | | | | | | | | | | * | 06094ddf31790aa78e2d618cb91af215a4663441 add hd5 and xml stuff. | | | | | | | | | | * | c3293f7723d4443093c6d2b19cbb02276cb38a86 put modif un lg.ypp not in lg.tab.cpp | | | | | | | | | | * | 48ce0697fc1ee314794c253e39c03503359ea9c2 add missing option in plot | | | | | | | | | | * | 6ca8c472c27adeca1420f4bee3bdb7c31dfd581b correct memory leak | | | | | | | | | | * | 3f69385b4646a3393c28c810728d0eaed95f5b3b correct typo for c++11 >> | | | | | | | | | | * | fbbc00912fce8ac21de49caaf17894150b8b068c rebuild AutoGeneratedFile.tar.gz and a P. Patch for remove print | | | | | | | | | | * | 34e7e4e487aaa191e533c3ca9d6c7350de3a2eaf correct lot of memory leak in case of construct of sparse matrix in loop, Thank to P. Jolivet. | | | | | | | | | | * | e129922403734a9ca50ce9badc525e3cab27dc3c correct memory leack change queue > debugstack; to a pointer queue > * debugstack; to remove memory associated. | | | | | | | | | | * | 2a909ab4e6b036d5cc8ec675d2a11b99d005761f add file fore hpddm interface | | | | | | | | | | * | 4935cde1ae390f130fdcb7fa255e657bbef56d90 correct ff_finalmize | | | | | | | | | | * | e23f02ff47395165f999ab60c31170ce8386e378 add function ff_finalize | | | | | | | | | | * | b7f22dcaca4c6917fffbb55fb2c1f1aa8afc1f25 add missing files | | | | | | | | | | * | 9971d223edd3e77616fce263826a18eb8550cb7d pass to version 3.33 | | | | | | | | | | * | 1d2231dfb14a37269e16c6cb31b36c88bf143ab5 begin of PETSc integration | | | | | | | | | | * | 591ec445cb715701241ee8f92b2313bb7d7c473c correct bug in periodic B.C ( some time loop) in case of same dof with 2 periodic B.C | | | | | | | | | | * | af561c94464ff889271c9af5c099a6c1b382dd56 remove debug call xxxx() | | | | | | | | | | * | e89af6e073fe369f56b8b3c89e0df35bdd783d8c correct bug array growing behaves differently on Linux and Mac | | | | | | | | | | * | 81a0b3afb529693c7a2246a7324d426373931b04 add check on vol tet in readmesh3 | | | | | | | | | | * | 919efaaf6a66038c3c60d48ebad214b7ca32cfcb correct pb under window in load.cpp (no dlerror) | | | | | | | | | | * | 87e82aeaf02085f09505df99c7abbc3381c5480d correct md5 code of OpenBlas.tar.gz | | | | | | | | | | * | 4f2b2e0139aead7049073fab4f4ca4b4e3ce671a Added tag 3.28 for changeset af4fbbef4ecd | | | | | | | | | | * | feaf2a31515294f5f47ec046c3b73daf3a98067e Added tag 3.27 for changeset 4c7506b5ac6c | | | | | | | | | | * | c9ad052ca5a1dc755e42e3fc49a7a45cf4e3ecd7 Added tag 3.29 for changeset d7efc421b561 | | | | | | | | | | * | 72cd3135c1a0eb418f21a737416a22f3a6b5531a Added tag 3.32 for changeset d324bac28890 | | | | | | | | | | * | ef401dc6b17439922fcfce9f93348fa3b8c267ea Added tag 3.31-2 for changeset a7eb0c2116df | | | | | | | | | | * | bd6c0ac4c72d9c405b5b3f53d3e104cbd1772f3c Added tag 3.31-3 for changeset 4e164226411d | | | | | | | | | | * | d0da1d00603c25f2be98ae715d3f976251d71f87 thanck to V. Huber to take care of the verbosity level. | | | | | | | | | | * | 1eef7d3618fead742bcd4f283dba7adaee8ea335 passversion to 3.32-1 | | | | | | | | | | * | 181d286b407bf4b430e522a8ed4237a719b9fb5c a compuation of dx,dy in Element_PkEdge | | | | | | | | | | * | df6701524d90fb9ef4cf74eff85bdacf2aa7c592 coorect plugin | | | | | | | | | | * | abe39f2a19b7fe6016bcff21432f8ba4d263b818 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 163c3ae32da8536eda9dc121dfa5efddeca6a797 add correction of P. Jolivet. | | | | | | | | | | * | 26580526441e888d8e189531a0ebc7bc4a1fa7d6 add correct launchff++ add ++d parameter for debuggin | | | | | | | | | | * | 900ef82402904571ded7d23393479b740b9a0581 update INNOVATION | | | | | | | | | | * | ab0015ab93823974eaa1c2c0160bb8f797fcd5e7 correct big big in memory manageemnt of sparse matrix Matrice_Creuse and remove dump in IPOTest.edp | | | | | | | | | | * | e6b0bcf2ec9f88316c275b10e7447a4fd7e6fb12 correct pb of factorisation | | | | | | | | | | * | 17458c51efe5a0fcf985bfdca6dcc64539bf9fb4 correct type add remove file | | | | | | | | | | * | fdaefb47689266291c0a3774567044b5a4c34306 correct typo and remove test .. | | | | | | | | | | * | b8645e820a05cabeab6a3090f1f6d00f06da2414 add check \ escape on string "\z" -> z "\\" -> \ "\"" -> " | | | | | | | | | | * | 46453c657fbff6d4c918341f534b53f2924a0f53 (tag: 3.32) coorect size on arrow in plot .. | | | | | | | | | | * | bf68a93ebe378b541ac702e29478ee370e41ac32 correct PARDISO / omp interface un uv100 | | | | | | | | | | * | 8ec97f2b72732bfd66c9446ed3527a941ffc4009 coorect type in parms interface | | | | | | | | | | * | 15acc7f576b669ff29bf0fe45347c9a3590d440f rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | a315c9113c9db82382b4f9899116394a4f3ec64e add MUMPS plugin as MUMPS_seq plug without mpi more clear | | | | | | | | | | * | 7ca8bbdae5c14838bdf25033e511011f77eafabc update getall for davis web site change | | | | | | | | | | * | 09f6b99492057cb427af6b35ffac2fa903b1e46b update getall ofr change SuiteSparse change web site. | | | | | | | | | | * | 814baa9c95a6e498494ffc206e5587cd147e46ad rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 97904ecb5aaef6db58062a4431b068b9e4b95157 correct environment.cpp and Makefile.am to find and put plugin for mpi in correct dir. | | | | | | | | | | * | 1f5129e0824cbe95a5a48258d313e5dbe4518ad0 clean return value of /clean_all_installed_ffpp.sh for mac installer | | | | | | | | | | * | 2fd44c45304dd516baa9f60d5f02513a493b5328 add missing chaneg | | | | | | | | | | * | 1986f93aee3cc02a701bd35dcd5a6a4160caf228 next step for mpi plugin | | | | | | | | | | * | f36b8cb5d8f6de06db2529c3e17a8588688c7efc correct MUMPS plugin complex version due to pb on mac, buidl to king of plugin one of scalar machin , one of mpi. in test .. | | | | | | | | | | * | 6ee9b703e4979e24cbbf8b6a52da58dbf5047125 add vectoral operator line v/a (resp. a/v- == v_i/a (resp. a/v_i) correct examples | | | | | | | | | | * | 6e3508c7df99c0577d4f87b07c04c42dc354cde3 missing file in distribution. | | | | | | | | | | * | 2038081df46184a90d00d8f4da060b0b867224f5 crrect pb in chech un window | | | | | | | | | | * | 4728b8d2c7209b7e9375c7ded93895258ccc4129 coorect a bug in buildlayer in case of 0 edge on border... | | | | | | | | | | * | e2b0fbf6a232d9de961fdf4ee862942e5f1d04dc pass to ersion 3.31-3 | | | | | | | | | | * | 6f0c6ed1606f6ceec2dbfeca29c737330bcb98e2 (tag: 3.31-3) coorect of array size in plot | | | | | | | | | | * | 5ee5cf10d43c4b8bc1a4cb06ce0b8f2c360662c3 (tag: 3.31-2) correct iter in stop function in CG | | | | | | | | | | * | 2a90ee8b392f6cb24c052a6df65a4a7414cf015e add script for installation | | | | | | | | | | * | 8b2c95459253dfa208dd14f087f6eaeac55084c0 chech !! | | | | | | | | | | * | ced058e4c96bcb08583dcd0fd169ac6fc9f38dae coorect typo | | | | | | | | | | * | ca0ac76829d006b9734d712f08db7aa7fad0f51e add missing file | | | | | | | | | | * | e095cd60fc804a6e4178e2844d2b75e686e0b79e update INNOVATION | | | | | | | | | | * | b53a20025737d9c4696c1cf0ee47ecef07de28fb correct pb ConjuguedGradient introduct this afternoon (kprint==0) | | | | | | | | | | * | bd4028eb154fe247b91db5de40751e51026d15c7 correct bug put in DG formulation (rev 3044) jump, mean , was wrong from Sun Jun 29 22:39:20 2014 +0200 rev 3028 | | | | | | | | | | * | 542a6610a5af6371c362cb3787c7f1a2b0493c48 remove template initialisation of stopgc .. | | | | | | | | | | * | 160b42b54a8d2fddb4b9c94be037844414daf046 pass to version 3.31-1 | | | | | | | | | | * | d50c8f2f35dc3ff6eac1edd824bcefe8d8e06cb2 add stop function for adapted test ... si doc and iNNVATION file | | | | | | | | | | * | a4640a3b9e0a7c4def2583877b7c0fdc2ced281c rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 71f900cf353516b561cd23ac6bdb00b9b37e63d4 correct problem whitc zdotc on MacOS change zdotc zzdotc , and put the blas.c version , to remove the trap ???? | | | | | | | | | | * | 6ec7daf09b434fc2f2cfc3ce134900c19d5aaef4 update INNOVATION | | | | | | | | | | * | b6ebe9fb5d90c9f5a30965810deb2f3f55d1e6a7 add function matricx for eigein value in test real ok, complex trap to day. | | | | | | | | | | * | b53bd4d686279d2b7ce1cdc131e17cecdd38c1a0 end of corecttion of LinearGMRES and AffineGMREs | | | | | | | | | | * | fbbb712098080ebc7535db7cef59b79f2cb6ad44 correct a big big in LinearGMRES (thank to franco@us.es) add sqr function to compute square number add AffineGMRES name better than LinearGMRES | | | | | | | | | | * | 9f2a5d6c436e3f6e05f85014239c022f29a9d80a add missing plugin in MeshSurface.idp | | | | | | | | | | * | 727a95589823e14c6f5d05ae2fcccdd2af37b4ac correct typo | | | | | | | | | | * | 4f7267a36db9546477319ab1527f01056fd3077c correct misstake in examples++-3d/MeshSurface.idp about computation metric in function build surface Sphere mesh and add a function to build Ellipsoide surface mesh | | | | | | | | | | * | eb8add9001fc5ef528729ed3feb1ef5d5162db6a add '=' for pickinhg on macos on medit.. | | | | | | | | | | * | 5289ccbb5271247752193f5ab9e9609533da2a5a correct getall add -h parameter ... | | | | | | | | | | * | aa19ada86f21352425945566ad53440e657db844 add '=' in medit for picking on mac.. | | | | | | | | | | * | 86bc5d3a383ed9a0ee8a6f1dace28227a92f73cb correct bug in jump in case 1d problem | | | | | | | | | | * | 14f542ff8ca6cd46ea97fc4f665724c9ce7dbda0 coorect bug in change in DG matrice construction in case periodic boundary condition with one layer. | | | | | | | | | | * | 848404eb82c25b9cbb700a204669da6ca9df3864 add new example of C1 approximation witn HCT ... | | | | | | | | | | * | feee1eae5f8636d731827ffc20194fa0ce79ad1c correct pb with freefem++-nw know no graphic). add version in case of error. | | | | | | | | | | * | d4b8362079e3248f81d6d6d80d9a3af33f7ec0d3 correct PARDISO.cpp to compile on Mac. | | | | | | | | | | * | 8654dfcebd168a3b88d578fd579694770436a6f4 correct error in gsl.edp | | | | | | | | | | * | ab808d87dae9fffebf60e7aee945a68fc01e5880 correct Makefine.am | | | | | | | | | | * | ca449d010c42a9c29f08db7cdfbae3e0ea2bf5b8 correct typo (missing ; ) | | | | | | | | | | * | 2813f0b982bad183aa313e54ee752b544f9c7ea0 correct INNOVATION. | | | | | | | | | | * | 22045f3a8f95b9b19fb6f03efa1ec6e6cbb2f4a1 add new plugin to make some binary io, will be in main stream of ff++ soon as possible | | | | | | | | | | * | b556a3b9d1bba659f0d51af01d3229252ac73691 try correct comile pb on UV100 | | | | | | | | | | * | d664ba01e0b6835b6e866a6baf178fe026153ee8 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | d62219a2f3f0e8a4956e2424d9b103296c63ebe3 add levelset integral and pass to version 3.30-1 in 3d | | | | | | | | | | * | 0b9c28bc540fabf45316d00c8e9d91b503dc6a89 correct pb in BEC plugin ( function denpendint of x,y,z point .. | | | | | | | | | | * | 73305f9abee32ae48f96c8cac3c08f39dd8994a6 add new plugins for BEC | | | | | | | | | | * | 06773cac500543a7292a343e077ddafdd3778ca5 remove spurioux cout in ffglut (00) standardistaion of movemesh3 -> movemesh without transfo parameter ... | | | | | | | | | | * | 8bf892116e1826923575817174fc1074c9eec8fb add binary mode file type | | | | | | | | | | * | 7508ca91a007579bad84d991073995d061e8a64d add rev in innovation | | | | | | | | | | * | a4b02d77bc15cefb5f39cd9628f4fef1e3bc57a0 remove DEBUG print to find a bug in examples++-tutorial/periodic4.edp under windows after this the bug disappear problem optimisation, bug in compiler, bug in freefem++; bamg ???? | | | | | | | | | | * | d29603669d23e90a13bff86379a8211b9a39cad3 correct typo | | | | | | | | | | * | 9ea566b19aa2ffdfa490d2f1fb3806f55debf1e3 add dump | | | | | | | | | | * | b595323f4df33ebb29055688a19b93465e555b67 next | | | | | | | | | | * | bbe9ef1a90e125c9ad04fbf41d1c0c56a4dcc8ee correct type in dump | | | | | | | | | | * | fd3d9bc3f32fcb2289c01a006fe57d21bfe15261 add dump | | | | | | | | | | * | 80f032a0cafafc3b69008bd924c58376c4c42f4b add bug in Builmesh. | | | | | | | | | | * | 7e8252886c68f7cc7c69cb81fe1d77cdb1efbd14 version of the distribution 3.30 | | | | | | | | | | * | f88c551c21d12582d41bcc5ad74fff9b7ac79b6f coorect type in doc zero -> two in def of nTonEdge | | | | | | | | | | * | 32040b76f88e5850f423c70f5125daac87c4cda4 correct DOC version | | | | | | | | | | * | 90f0e30531a837608992640999f402a05743af3c update the doc for multy border ... | | | | | | | | | | * | 17d1f4e7f8a3861a260e589068926c4093cdd443 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 6ce31720869df778128fffeb4090af1d9a72469a add multy border , past to version 3.30 .. | | | | | | | | | | * | 55e1b67d73afbd2b0bb21360f41bc912d6643ebf avant un multy border and comment the test .. in mesh.edp | | | | | | | | | | * | f9ebc59b30f3a93c05c4baf83d1d61bc8603ea0e coorect pb of free not alloc pionter in mmg3d4-0 | | | | | | | | | | * | 487e4cb9763f2a31930cf2ec0eada3f319b27417 remove cout in RT1 2d Finite elemnt do better clean coorect LapDG2 examples | | | | | | | | | | * | 13072793f293b6f05dc9cf214ed28f7f62a9140a add tools for Quadrature formular. add missing finite element un doc. | | | | | | | | | | * | 85f0fa1baff3943bb065386a68f7051789de5df8 remove crazy output in lapack.cpp and fflapack.cpp | | | | | | | | | | * | 00fcc4dfc69de87993e8a3682246c82186fc7074 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 639affe53c3b5bd330a1f2be41f770ceb46e6a74 add tools for integrale with levelset (under ) in 2d .. | | | | | | | | | | * | 1dd074b53c56e9c01f9691a73b2dfb3086433204 remve double def of R in P1IsoValue.cpp | | | | | | | | | | * | 82a486f2c19719ce36104dbaa43199cfa67ec319 add tool to compute volume under levelset arealevelset , volumelevelset and and region integration on levelset. | | | | | | | | | | * | d6ac50d93fbc4dd0dd05c4eba7dc4357dbc7824a add tools of mesure doamine def by levelset | | | | | | | | | | * | 5dd9b6fd2d0597c4901691560a85056a3785eb67 correct mistake in include P1IsoValue.hpp erro of namespace buggus on g++ and ok on clang++ | | | | | | | | | | * | b0a81cfd6e096d61483449a848b403e9fec05fb8 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | eb134eff8f2c083f5c368a0b8b52ef0a0dfee5d4 try empty matrix in MUMPS => dono works .. | | | | | | | | | | * | 00ee1511e8e8042d2b02a78cf3596350f072458a put empty matrix in set if need | | | | | | | | | | * | b9d970821c1ce8e7506766da39bbdfdcc63ab09c correct mistake in MUMPS.cpp (plugin) remove empty mat.. | | | | | | | | | | * | 167b9f4b77e28cab047404d639c51679dc198638 update rev innovatiop | | | | | | | | | | * | b4930ae2084a5e21f7d33be2f9cdf8456012603d coorect type and memory mistake in fftime function | | | | | | | | | | * | 81d72c5310ff44fcd8e5d97fbc148611774f6257 add rev in INNOVATIOn | | | | | | | | | | * | 1170c918589aa63236e63b3ffadc9ff98269b999 add macro generation stuff like Stringification,FILE, LINE si INNIVATION, | | | | | | | | | | * | 97f833a6ef67f56c6b61b642ae3b38cb9e78638b add int on levelset for sym matrix, remove all register storage info to remove warning (not use by any compiler) | | | | | | | | | | * | a8c52466c5f35b9007b8c62d83a8299bd4d29cd0 rebuild include.tar.gz | | | | | | | | | | * | 4ac61b8021aebb68218b09b760d259115b60ccb5 add tools to compute int on levelset | | | | | | | | | | * | be3a9de694fd3bc8007def0f956527ffbeb5750a add tool to compute int on levelset | | | | | | | | | | * | 9612b5d60f5ee58ca15ea16a5ee09b985433f9b2 add bace cube function . | | | | | | | | | | * | 4892d8469a74b6b37d600e00d85eaf191382409d update INNIVATION | | | | | | | | | | * | bb61fa313dbce6955be74278ca7245e4ae67ae0a (tag: 3.29) rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 7e3a0c41bcba78a7f95c5c1a67006cbf33600c2e coorect type compilepkg in arpack makefile | | | | | | | | | | * | 82b0548b187e2036800b42efdc66770056dcf85b coorect problem we getall script | | | | | | | | | | * | 1bb4efcc6fb5baa95e1f1e8b4616a5a19af85da6 coorect install pb in linux for next distribution | | | | | | | | | | * | 3d5e1d32109a41a132ad2e1607169ed06177070b missing file in dist lgmesh.hpp | | | | | | | | | | * | 1f11151f8b2887b158a9128e5ee598dee1dc0b09 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 1578d14e0be5e1a1abfb1aa7e8e689596e82b0a9 correct make dist target in blas ... | | | | | | | | | | * | 11c1764e586e9f39375d610c21d93774355a4c0e coorect pb of recomple mmg3d if the patch change | | | | | | | | | | * | 53b8d3dd5d1ad727f2388a287188adb254de096d leak mmg3d next step | | | | | | | | | | * | 6cb3da3728ab793fbc59090e657bfc89ec0b959f try memory leal mmg3d v4 | | | | | | | | | | * | 10e5ea96b8ad8ed2763cadb36ac0501e76e9268c coorect mshmet leak memory problem | | | | | | | | | | * | a45d67cf0b8e66bca6552e79010d5af69b698365 correct typo | | | | | | | | | | * | 484df12e5a584f5efbd872fbcb15bc32b349e68a build AutoGeneratedFile.tar.gz | | | | | | | | | | * | 7315002c20550a72a9892df0c7500b991540e866 add stuff of get memory storage info on mac and linux pass to version 3.29 | | | | | | | | | | * | a6d434b37faaa2f108d3ad279da6e40791e19014 correct mshmet dependec | | | | | | | | | | * | 6e150adfbd80b629a5b6bf1599f26bce1a9fd93b correct typo error | | | | | | | | | | * | bb4b3c60be0442df4a558d22df74c19986e0b430 add tool to find memery leak storageused function .. | | | | | | | | | | * | ad28ce1f36fc34c7b28ee6ecdfc249e7b9de26e5 correct memory leak in mshmet inferface | | | | | | | | | | * | 95d8d726fca944ab46ed68ff0f89a78c1a55b3b1 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | e8da44a8e95cdb08b01c29ef929ac7b9ccb459f3 add uninstall-ff++ script freefem++ | | | | | | | | | | * | 3617200ea5e615a5c6f6ceb157a5a855ef611c4f rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | 149023fb8bc4bb393cc2f66047dee6bdeb400bb9 correct pb in evalution jump of region number | | | | | | | | | | * | 628821beed99b14395005a478b63a647ab04a3d2 change error in warning in message error if missing library. | | | | | | | | | | * | 79d8fd244d1bf549ba08e29a577319a5750c44f2 correct in 2d integral on levelset of bilinear form on same meshes.. | | | | | | | | | | * | d28c39576eb27a24dd5309bbb8cc34e4aeea4bc6 coorect type in getall | | | | | | | | | | * | d99d8a0886f62b5005536dde407eb8fd1fec7d43 make getall with or without thread depending of pearl install | | | | | | | | | | * | 80ae908ae9e031285e94efd03f5b42b0f0de8d6c rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | a372423c447cd90907515f7584605864a91274cd update configure param to compile | | | | | | | | | | * | c0d5b92e84a4fcba14fe8757a65affd43104c5eb coorecct readme | | | | | | | | | | * | f2ccb91b7a0618422c72d423274f087fcfea9b1c (tag: 3.28) correct small bug in + MeshPointStack(stack)->set(Th,K(Pt),Pt,K,K.lab,R2(E.y,-E.x)/le,ie);// correction FH 6/2/2014 | | | | | | | | | | * | 8b578aab1dfb0895f37b8a00f88e8ccfc7d69db4 (tag: 3.27) Synchronizing FH and ALH trees | | | | | | | | | | |\ \ | | | | | | | | | | | * \ 3b922b387d5d457537cffc75a67159ef00e3caaf partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | |\ \ | | | | | | | | | | | | * | 60ed0a9d3fe453568a217a513d0c301e55c4b0f9 partial commit on MacOS108 (athena) | | | | | | | | | | | | * | c04d99143453ea5f47f21d5e07efbc77513de6c9 partial commit on MacOS108 (athena) | | | | | | | | | | | | * | 414bf859b7b780ae6833c2ae9e276cd714364707 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | * | 2987a420732357a50e2bc368f64a9239ed5292a7 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | * | a2dc498d73845703b1d03118122108f7095e0db7 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | * | aa95d9ab10613232ef3c76d9566447ddeaa99fe0 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | * | be06e4cad04f262c2c9986d5aa62fa579d70e24b partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | * | 94c5c03cc4a87fa7bfc44e44750172111ec58cfb partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | * | 3a52f2ce50c017e67004b15614bfdfeaabc2e1d5 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 86dd93ffa194126fc62ca483eafd20bec5fb9317 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 0911c432b62082a15a6a112701f91511ab88f14f partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 15b01b8ed88d5207128bc83c7dcbb331a75e45b5 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | d27c22587d4ed94394f9814933a1b99202aecf79 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 70b94c3a42c8d6205167d7f94c126c0a92a74776 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 0f699d85a183fabd7aaa6083776e7f22e169ee05 partial commit on Ubuntu1310-64 (ubu64) | | | | | | | | | | | | | * | 0bcf6e442e9398b283b702f61ee2d6136219265d partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | * | e5027cd141162fb2ab27d9516fd647a57fecef1f Small updates for FFCS release | | | | | | | | | | | | | * | 815cb9ab81c0a76312d922f313f6146f04f27e5d Small changing for FFCS compilation on Windows | | | | | | | | | | | | | * | 315d8ac1c9517aa380bc96df341de404244a9f1e Compiling FFCS on Windows 64 | | | | | | | | | | | | | * | c6d215e75f1433f3fc7a504d070ffe7c08acebe0 Compiling FFCS on Windows 64 | | | | | | | | | | | | | * | fda373d55b541ec11ba9c4a1fc33fe3b6b65c09e Compiling FFCS on Windows 64 | | | | | | | | | | | | | * | 00d29dee78b9b6c9ee713524c5228f51359d0430 Making FF compile with FFCS on Win32 | | | | | | | | | | | | | * | 9858cfcfeb8631ef768e53755ab5f116b05e853e New FFCS version 14.1 using FF 3.26-3 | | | | | | | | | | | | | * | 6df771b20873d20b9b92a06a994223d61d3b1216 New FFCS version 14.1 using FF 3.26-3 | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | * | d19f6e70e9af52c02512f85fd754bede55b37d56 carrect install windows missing files | | | | | | | | | | | | | | * | 05cbb4079998bb94603729302f59f58b45e6adcc correct WindowsPackage.m4 | | | | | | | | | | | | | | * | a447c27dfdbaca920071b2d5669d0a3d66aaf6b1 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | | | | | * | d9448d1ebe74cec58ca84dd0c7acd95338d4ee33 correct typo | | | | | | | | | | | | | | * | 7636b9bf9b9772ab3e2ee2bdf57a3362499dfc08 coorect typo | | | | | | | | | | | | | | * | bb1b0d443eb88640159448d5c78395087a128be3 update gsl interface with random generator | | | | | | | | | | | | | | * | 9d503d43e2bdecc1538603fa588e3248b3698e3d add random gsl generator | | | | | | | | | | | | | | * | 330bff6655db1815737666b9585b5b4b500524e7 correct doc and pthread on window version | | | | | | | | | | | | | | * | 0193aaa189f097fa082e732bf5923fdc6fb5adce correct mshmesh under window (no phthread lib) correct mumps seq (no phthread) | | | | | | | | | | | | | | * | c1df35f23bed2e836aac0c516474c96aa7132add correct pthread with openblas | | | | | | | | | | | | | | * | 541969f01ed85b3ed7e81cd9997768bde55dcbed pass to version 3.26-3 cadd pthread lib to openblas lib .. | | | | | | | | | | | | | | * | c0fba1f8cbbc27885e475056d534cd29172e37c0 correct link problem of ipopt and blas missing thread libray. | | | | | | | | | | | | | | * | 8f38c9f0cc5dfdef967523f69f8eafa238ab9d8c correct lapack interface and simplify the test. | | | | | | | | | | | | | | * | dc16c78479c4fcc8099291291f61363959bb7e3a add new logo in the doc. | | | | | | | | | | | | | | * | c0599b286f021a8c8f1d321a183485ad7daab110 add warning= flags adaptmesh know if the max numbre of vertiex is reach ex: mesh Th=square(10,10); int w=1; Th=adaptmesh(Th,sin(10*x)*sin(10*y), nbvx = 1000,warning=w); cout << "warning = " << w << endl; | | | | | | | | | | | | | | * | 65c02490e525e84d4b1e4eb1c665f4204e6cda22 correct examples++-mpi/Laplace3d-hips.edp remvoe of none def flags ( the matrix is not symetric due to BC. and tgv = -1) | | | | | | | | | | | | | | * | e290c859b6204f287573cd605c5e123475e9f2cb remove blas and lapack from WHERE-lIBRAY-download | | | | | | | | | | | | | | * | f6e946a8f08e355b4a8cffa0d39b9a1f61793e07 correct pb with norm | | | | | | | | | | | | | | * | 8acb239e0db1c8d84591f78d070d2c45601996b7 new version | | | | | | | | | | | | | | * | 0883fee3998d4fc2d7d6862f40e5c7f447835473 correct bug in script ff-get-dep | | | | | | | | | | | | | | * | f46b9b1952089145fd22fa233988db33add44f52 correct ff-get-dep.in | | | | | | | | | | | | | | * | 1e5414e563338bf799d5d9f65935d5fe2d6f54e3 coorect typo | | | | | | | | | | | | | | * | c2b5bb640052aabc25605d742240765a10ea07fd next correctioon | | | | | | | | | | | | | | * | 31522e29f9349bdc4a3f9e36b00481eda8722882 coorect ff-get-dep.in of simple bash shell | | | | | | | | | | | | | | * | c1bdf3cf52173cb077bab3059583d539ce72ff2f correct gnu.mak to rebuild pdf figure. | | | | | | | | | | | | | | * | 719cb596d024c6beecd00c3dab252c2549e9382d correct typo | | | | | | | | | | | | | | * | d00cf554ba05b33c2ab50d4b91f5731e70ceb4cf correct for install | | | | | | | | | | | | | | * | a4a8e7908328e9076ce341900c111aa5eca6ba3d correct ff-c++ install | | | | | | | | | | | | | | * | c3a4d7e68cd290a8a41334e0838a02cd463f23bf correct ff-c++ and install version | | | | | | | | | | | | | | * | 399d196cd091bdf064d88f5bee507d91499e3aa5 add EXTRA_DIST= path openbals | | | | | | | | | | | | | | * | 6304a3cbeadbe2d67e1de092231edea85abddb05 update INNOVATIO | | | | | | | | | | | | | | * | bb0793920d2dfa24c6393b2a6ac6009b5f242146 reome all relative path in WHERE_LIBRARY-config | | | | | | | | | | | | | | * | 35fa04f0d5f1a43a1023166664a25d99dabb9145 cooret PB SuperLU | | | | | | | | | | | | | | * | 6394e408b680676a72b432bb4e9bfedddc17f0eb coorect pb with superlu | | | | | | | | | | | | | | * | 6e70c0a3a62cf9925bdde389590cf56b8ad984f5 correct typo | | | | | | | | | | | | | | * | d88489b2f94823c010e428a0552ef87f8f677892 correct pb in complex number in MPICG.cpp | | | | | | | | | | | | | | * | 46ca64297f3f1fd58323e291e03f0cbe5b11ffbb coorect after test on MacOS 10.9 | | | | | | | | | | | | | | * | 89f5666452058c9d55050d6f585706f735ef6792 coorect Makefile fr dist | | | | | | | | | | | | | | * | f46a74cec91a230fe6371bd85fd1a0d854f749a8 restored examples++-tutorial/Laplace.cpp | | | | | | | | | | | | | | * | f8118bbc80a549d6b75d082e539cc70db707ed51 update AutoGeneratedFile.tar.gz | | | | | | | | | | | | | | * | ea017eeb93d669652bdafa27996f777529b9debe correct clean Makefile not remove pakage source. | | | | | | | | | | | | | | * | 4d4b07bc6299673c7993b1eabbd3f0b6d2a5409a correct some example ??? | | | | | | | | | | | | | | * | 0e52ed3c31944193e81dd773ea6a142e2675cabd pass to version 3.26 | | | | | | | | | | | | | | * | 91585818b7611fac444c850bbcd386a49a2efefd merge with ALH version, and FH version for compilation on MacOS 10.9 | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | * | d4499b2fe6058a4824c2c42779ae88857a4c727f pass to version 2.55-1 | | | | | | | | | | | | | | | * | c7a872f6bd98e25558fc6cd2ac07d39753a42d90 coorect pb in norm and real with new version complex in c++-11 | | | | | | | | | | | | | | | * | 761976f56615b63a46a2c3eb9adcd7c31922800b coorect mistake in download/ipopt/Makefile for blas | | | | | | | | | | | | | | | * | e586678bef5bd6ab470557c4743c6f3c1431bb8a do correct of MacOS 10.9 , new compiler. | | | | | | | | | | | | | | | * | a2318e7d35101f68a2817a270b68a580aba5d930 correct mistike in the problme of matrix block in case of 0 block. | | | | | | | | | | | | | | | * | cb72759e0131fd51a8a3377078922152e9aef42b correct problem in block matrix with 0 column or 0 row. | | | | | | | | | | | | | | | * | cd4ddbf87d16baac1f78840441688ae04237de7c add missing test | | | | | | | | | | | | | | | * | ea639490a7141c7c3fbfdab0ef56008efd365d3f correct typo and add new autofiles | | | | | | | | | | | | | | | * | 543c660db10fcf8d3d1b2320a99846c57820b072 correct doc and fftw3 downlaod compilation | | | | | | | | | | | | | | | * | 288e73552e9743d20babbb67d39f0d26751ea4fb correct fftw MAkefile.am | | | | | | | | | | | | | | | * | 29c17ee5c68e62f85f8217e1c7574244ca4a77e7 update ffc version and ff++ version | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | * | 332532c75f727e14b9c3bee4f51c7a351fc52c88 coorect mistake in parmetis install files . | | | | | | | | | | | | | | | | * | 8faecc820c896dea825bbc26cf713b486372a9cf coorect for compilation with OpenBlas and a Window versio of sleep. | | | | | | | | | | | | | | | | * | f19ab0521664725394e8682f7f690dcd5ca0ec00 add cote in -T MPIDIR | | | | | | | | | | | | | | | | * | 6612a5a7e5f59992bc55fb6871b88d970fbbc78e correct wget problme in pastis and superludist Makefile | | | | | | | | | | | | | | | | * | 236a2bd65e16b471679602295fd009b1f769148c correct typo | | | | | | | | | | | | | | | | * | 32f0bf8805685a6125e81387209f5bf4ab5c4bfa correct pb of make stop if no arpack.. | | | | | | | | | | | | | | | | * | d9da2609b4d27f9cd46f8847322d1aea21d4a00e correct problem on skip mpi example in some case | | | | | | | | | | | | | | | | * | 40bfb63eba42ee822d6964e0947a8dac180f05e6 rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | | | | | | | * | 22edb3d6ca8ba3a681b10d0a7c28ebcb81b2f4a6 correct problem of stop compilation of load example in case of FFCS_ENABLE => stop make otherwise continue. | | | | | | | | | | | | | | | | * | d14d0aba4d4c99dab3c8eaa4b99e399051f2d7f6 correct pb in mpi test remove graphic | | | | | | | | | | | | | | | | * | 6359caaf655fa93216824e969653a9dbf75ae87f add tools to build le list of AutoGeneratedFile.tar.gz file | | | | | | | | | | | | | | | | * | ba9c41eec565ab1c111e9e07489ad71eff5f763d summer correction. | | | | | | | | | | | | | | | | * | 735ed55f10eccb0435e6250781a75b295e2e5fc6 add patch of holiday scotch dolaod with curl; an pb in a*[b,c,d,..]' with complex value | | | | | | | | | | | | | | | | * | 3b41f09d5d4a66987bbb4d928e40031d64ede12a add comment for compile | | | | | | | | | | | | | | | | * | df57c706e88b31597ca69470078b6d48cd23956e correct mmg3d | | | | | | | | | | | | | | | | * | 5b67a3aeafd02b0b31689b66c5b456bd9fee1e00 correct pb in save make the point is not in tet | | | | | | | | | | | | | | | | * | 2aa306f7e89513c194aac27760dd6ca8b1962674 restore skipcommet example | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | * | 7af4e3d59a86e479930099f9e665c5bccd3d7f00 pass to version 3.25 merge ff++ of ALH and FH remove automake file from the data base | | | | | | | | | | | | | | | | | * | 81a800d3a637851ada640c1505ecc01d7290a332 Keeping FH and ALH trees in sync | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | * \ 0cb2e28aea96922d712ee8029a785ff409f218d2 Transferred all FreeFem++ patches from the FreeFem++-cs source tree to the FreeFem++ source tree | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | * | 5b0d6b399e4d2bd7c92a6279f08d783566294873 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | * | 8807a524ed800c3b5c3ae5a1ce50d54e8458d44f Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | * | 67f3e8af186b3d8fe743e6ff19492a072cb218ea Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | * | 9c804eb9167b0970ec0e2292d873eb1c9fab5cb2 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | * | 7d0f14334c86b59f879de1e9ec0d9dabe621be9f transferred all patches from the FFCS development tree | | | | | | | | | | | | | | | | | | | | * | 70e2254d5eb0a1f03b74389c4e4099fa34bf8e21 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | 89055251b24e68d289f92f8ceedaa8a63fb9023a Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | 886cb02fe835d7cec48b6ef73e7acb0539219f1b Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | e412603181e9d97815b850bac4ac40a9b9ae67ed Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | * \ 5c0428f575aed2351ea6c67f3586f687e6d92c2c Keeping FH and ALH trees in sync | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | * \ d3a31fcc3aabf22e44354e1b4dc29b16b85728ed Discarded obsolete head f01c1ce34eb3 (but kept that version in the repository) | | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | * \ 2d3e601cce592fc40a57f41dae6dbafef7f7bfef Discarded obsolete head 31c99c85707b (but kept that version in the repository) | | | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | * | 056a580903c1b12126a0f5bae48e69718e514120 add missing idp files | | | | | | | | | | | | | | | | | | | | | | | | * | 40866d72b9c6e043c805b25298c87c5d5a3bf878 add new MPI example | | | | | | | | | | | | | | | | | | | | | | | | * | 0b075524fe9bbb3ebcd9beeaff5625ceee6face2 add BinaryIO dynamic lib in example++-load add MPI DDM examples add asyncrone MPI send/recv for meshes and matrix. | | | | | | | | | | | | | | | | | | | | | | | | * | a8d7f3bd8e6fc276860b7d2eda7094249d904faf change the default size of MPI buf to 1Mo | | | | | | | | | | | | | | | | | | | | | | | | * | 0c1bed157e07ba188507cdf22a2ff911670bf342 correct MPIGMRES examples | | | | | | | | | | | | | | | | | | | | | | | | * | 830baad39657a6101ad72ef85c865973ba89f501 correct if (1) ; // trap remove cout in MPI.. | | | | | | | | | | | | | | | | | | | | | | | | * | 8645666246cea7da334488d506fa1bb14d09faee change configure.ac protect MPICMD flags Tanks to P. gostaff | | | | | | | | | | | | | | | | | | | | | | | | * | ae85a081832ea2488fceb27a8f8ad938a3727734 reomve peace of cade for AutoDiff not use | | | | | | | | | | | | | | | | | | | | | | | | * | 855d67451f9e78c08f6452e3fc832226cbafa891 Add MPI CG/GMRES function for // computing add a true // example: examples++-mpi/MPIGMRES2d.edp | | | | | | | | | | | | | | | | | | | | | | | | * | 0e4b4bd9f0316022170b659d84327eabcd879c65 update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | * | c248a985b749127426ef22da5f986beadadbadda correct the bug fing by O. Pantz in expression like ; a(2:)=A^-1*b(1,:) for some linear solver. | | | | | | | | | | | | | | | | | | | | | | | | * | 937f2f625cdae2ec40fc4f11b621bdd7c9aca8d5 correct make check in 3d examples dir | | | | | | | | | | | | | | | | | | | | | | | | * | ecffa27a1ebc291202209e6b7437c550c2226790 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | aec90869717cbfa7d1dc4f6845db7912398a8bca Added tag release_3_10 for changeset f96e7099dbed | | | | | | | | | | | | | | | | | | | | | | | | * | e254bc08743e7567d7ec4f867a66fc6bdff16407 (tag: release_3_10) coorect INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | * | 5272a948683225dbc3cae70265b0c1c2b15fa28a add missing install files | | | | | | | | | | | | | | | | | | | | | | | | * | 081ba7d560f3738e4fc8cbae4a82f8c00c587089 correct install mpi dymanics libs | | | | | | | | | | | | | | | | | | | | | | | | * | 65378cf660ef8e7bf581116b71588ddc0d202493 add install of dynamic lin in mpi | | | | | | | | | | | | | | | | | | | | | | | | * | 0d6a1cfc4a6b96756acb448d32d5dc84c95c6c48 add "-cd" argument to change current directory to edp script directory to freefem++ command | | | | | | | | | | | | | | | | | | | | | | | | * | 1ea8a27dcd8f2b225ae32f8a0fe71abb05b472a0 coorect missing compile parameter in pARMS libs | | | | | | | | | | | | | | | | | | | | | | | | * | 5087ee656fcc32e279e515cf1580cd3225ba7910 correct configure.ac for automatic download of mmg3d lib. | | | | | | | | | | | | | | | | | | | | | | | | * | fcbd9ad42eb6ddc103994105730f76dacdb58cad do modif of g++-4.6 | | | | | | | | | | | | | | | | | | | | | | | | * | 4b1b219d561ae7bb47a7030f01873ddaf80b25d3 mistake in parm makefile | | | | | | | | | | | | | | | | | | | | | | | | * | 1409dd524b80305fd5d6612a4be1587d38238cf0 version ok for ubuntu 64 | | | | | | | | | | | | | | | | | | | | | | | | * | cb631d55616d4510db05f9f036303234ba6f8601 correctr for version 2.10xs | | | | | | | | | | | | | | | | | | | | | | | | * | 378e1f1eb0fef4191a9098dcfef396782a400939 coorection fort 3.10 version | | | | | | | | | | | | | | | | | | | | | | | | * | ca64a6588f0d15b530110ff45ad1b3b70bf2c9a5 try to close version 3.10 | | | | | | | | | | | | | | | | | | | | | | | | * | 9a5e620bdcf6afe8e3b7d5b28843696db8ebaab0 correct IntallWHERE in gmm makefiel | | | | | | | | | | | | | | | | | | | | | | | | * | d9dd92b12712033beb1ace3f4309f66f583eea7c correct parms Makefile | | | | | | | | | | | | | | | | | | | | | | | | * | a07136a840227bb21c7129c334b825465ec4eda4 Add missing exemple correct problem in renumbering matrix passe to next version | | | | | | | | | | | | | | | | | | | | | | | | * | 1f6cc09161cdd5bcaaabbf5a45d8985027e8fde0 correct -fPIC flags un blacs compilation | | | | | | | | | | | | | | | | | | | | | | | | * | 2f0a6ad87ead8065b161a3547f50bb1b7bf7ecf6 update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | * | 4e83bed681a8dce06c3e4395abf61acd15760df9 corecct MUMPS Makefile (missing CC,FC compile flags -fPIC ) | | | | | | | | | | | | | | | | | | | | | | | | * | bcd0734d66be2dbe64a14a7a463915671618441f do autorecconf for add HAVE_SYS_TIME_H | | | | | | | | | | | | | | | | | | | | | | | | * | 627edaf9276f6396bdc88d994141b7610241d334 coorect gmm Makefile for WHERE ... | | | | | | | | | | | | | | | | | | | | | | | | * | a635a3922f9fdba0b6f5d0d3afe38abb8cc511bf correct pb on download/bin creation (so time it a file not a dir) | | | | | | | | | | | | | | | | | | | | | | | | * | f83ecb3a2a78474b8f0f837e1f7056188232192b correct gmm compile and WHERE def. | | | | | | | | | | | | | | | | | | | | | | | | * | f974da120d1c0e10fd17c946cc1cf69cdcaa9ffc correct PB with echo_edp | | | | | | | | | | | | | | | | | | | | | | | | * | 965866dd67a110b4e03dc278ccccfc8e752c731c coorect Makefile of mmglib download .. | | | | | | | | | | | | | | | | | | | | | | | | * | 6cd0cb36cd7f61c1c964f74e3b77707a0fb9d928 correct mmg3lib precompile | | | | | | | | | | | | | | | | | | | | | | | | * | 955e4624f95fcd8012f0d1fb1e216d92b3bcdcd9 add new parameter -ne to remove script output add download of precompile of mmg3dlib | | | | | | | | | | | | | | | | | | | | | | | | * | 945344fe70199194ddafb1e587e21fff9151a133 add gmm and corretc load.link.in for windows | | | | | | | | | | | | | | | | | | | | | | | | * | ce14ae7d19bca8b4735e4c0470b61c3f9a402b4a update README | | | | | | | | | | | | | | | | | | | | | | | | * | ae973d265084f26ed5b1bb2889e6461dc74414df corect innovation | | | | | | | | | | | | | | | | | | | | | | | | * | 922653d73b42de28c3bc877cf16c04585cbf126c add missing compila of mshmet dynamc lib | | | | | | | | | | | | | | | | | | | | | | | | * | 5f9af29c1c48bcb858c8ceb2b4b847afd473f4e7 upate INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | * | df0637d32bc408fc73b892ae4a810e279e28227c correct examples++-load/Makefile.am to recreate examples++-load/WHERE_LIBRARY-download | | | | | | | | | | | | | | | | | | | | | | | | * | 258ab4529a4735baf7a413a846528c4996340657 coorech WHERE of mshlib | | | | | | | | | | | | | | | | | | | | | | | | * | c10c3aee11a1ca4732e46945ca07891502493b78 add build WHERE | | | | | | | | | | | | | | | | | | | | | | | | * | 22f4e76d33db0cac3d5313fb8720e078d216b2be coorect mshmet download compile / makefile | | | | | | | | | | | | | | | | | | | | | | | | * | 1d1b1a121f3fc8fc26c3a4bb508e1fa758477324 correct problem of -fPIC compile option in NOOPT C ompile setup in superludist | | | | | | | | | | | | | | | | | | | | | | | | * | dff562386ea19c698bb2fcc7cb62685e138bbc77 coorect INNOVATION and auto compile fftw under win32 | | | | | | | | | | | | | | | | | | | | | | | | * | 1af296b033f0282ce9c716b51d1a73b9a739e1ae correct problem of creation download/bin as a file not a dir. | | | | | | | | | | | | | | | | | | | | | | | | * | 0494b42057f310126f7f792a5b77f7703e36c8b2 pass to version 3.9-2 | | | | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | * | 16682f8cb9c219a3acc909851e136ec4754e4f63 correc mmg3d interface (j. Morice) ) | | | | | | | | | | | | | | | | | | | | | | | | | * | b3599ab455eb28deede09d4fa1247d6d6340aa93 coorect mmg3d interface | | | | | | | | | | | | | | | | | | | | | | | | | * | a94da4a91f1c2e868aeb5fc8fac49696c7145e06 correct DOC and add dep in ilut.cpp | | | | | | | | | | | | | | | | | | | | | | | | | * | 1887fa3d674503619fc6063a92f9bde1c60c9154 update INNOVATION remove warning on pastix | | | | | | | | | | | | | | | | | | | | | | | | | * | 5645c58be414f6dac711d86e89aa1675446d88be correct problem to compile pastix, scotch undex ubuntu linux. | | | | | | | | | | | | | | | | | | | | | | | | | * | d6e9872d145e27f1e80a7f10730350d181dc2c22 coorect -fPIC option on Fortrn | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fdff54aa4a1346cbcdd55c41d01f641d69dcd6e coorect fftw Makefie | | | | | | | | | | | | | | | | | | | | | | | | | * | 780afe7490283226cfaf7485052323ea26de444f coorect mpi examples essa.edp an add wiat=1 in all medit call (bug on mac ???) | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d26fd699f64dddca023f54f839f73f38360059d update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | * | 8dcc7ea0b178fb92946054380a4701cee0c12013 correct problem of dynamic lib with or without mpi to solve this problem I have add in all case the mpi libs this working on mac. FH. | | | | | | | | | | | | | | | | | | | | | | | | | * | 2f76e35467e67f47bcdea910f3c7e0c65843cc98 add missing file DOC/plots/multiendmesh.eps | | | | | | | | | | | | | | | | | | | | | | | | | * | 328787ad7657aa0c6feb344717d8d672ef4dc77c add missing file | | | | | | | | | | | | | | | | | | | | | | | | | * | 4f8b04861254fe1a8eb9811030d87499d61e5d92 See INNOVATION file for explaination of this change pass to version 3.9-1 add DOC correction of Dominik 'Rathann' Mierzejewski | | | | | | | | | | | | | | | | | | | | | | | | | * | 87abb52d2565031ba6bf49efc7f763280d8d1c5a correct configure mpi search when no full path are given (FH). | | | | | | | | | | | | | | | | | | | | | | | | | * | 1fea157d001d17574a134dbc8f6f4fc25a0a79e5 correct mistake in download/pastix/Makefile | | | | | | | | | | | | | | | | | | | | | | | | | * | 0775ee70cd28831fb2be8143672bbd008746590a update REDME and INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | * | 93f503724f51638c2f7ab48cc7c9f52579b1983c coorect MUMPS link liste. | | | | | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | * | 22cdeadf2347fd1fabb40e335a8fd643a6e35e7a do change un MUMPS_FreeFem.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | * | 945c715eead48db9fa37c817a1c403cadf7c2cbc update README_HG | | | | | | | | | | | | | | | | | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 06913749750a27103b63449e0df0f94e53e44d02 correct download makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 77074163cfb50e8d9ce67f8978225a8125dcbca3 add build .hgrc comment | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 72df62b7e0fad1e01869c60ca622d776dd9f314a try | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a1f34498b9b83fe93ebacd7f031ce150cde3203 converting from CVS to Mercurial | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 045dcc75b01c50f43a8a911e239d4a9412d6af5f update tags | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 92cb196e4258dd32cb8b1eb9a391566bbaa2fc2b coorect sunstring tools | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f76a7088631bbba4e2b15a17691d5f51d01f79ac add missing cast operator from SubString to string | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 200a3f2454ef98f46c88967e0d91948c57bba6c3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38b4b2c30c6fe837e01dc311d7ed87d251d5078d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9067359b04609641305bf9fbff9b96e94437105d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e7b080d8bfa5d6b42d8eceebe1c0b4fb69c9f67b continue WHERE configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 212d22e0d7e6d6407ee545d5455dbd420c96a59c add where seach | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 079ed8f792bbea8245bdd56208e863d65db2487c essai find where for downlaod | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4741b14a701f25a05b3567e3b56a0ce89d5aa15e correct essai | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d3161347efc46b0313603c532a205374d9ec0bc5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 388f202452b2b21a93063ded273cbde280a304cb essai de generation de WHERE-LIB | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1f36c9925a73ccf90b5676629f755e6a957860a change MPI parameter | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7e7a298a4bed6463fc455f663f4833614a68e119 try to find mpi with better way | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4062c56c7fb11ecea7473d1155644fb8cff3849f update OP | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 791120090ca7792714ad1a05a62e3d0b1c71d7d6 update OP. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0fc42c2448cac7e4022059b639d7087461dd1d9 correct win32 trick | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 25d626c141f305b7517eff40885be59cbfd58b04 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 45b640a16a3ca85fbc11ce7bbb0277df50b99338 co | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ba91103aebf699531f2f1095725d1ac9f8a2f55 change to freeyam | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b7b6d2d7ef941f99df2dc37eb123713ab28d2896 upat configire.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f7d13e4cc32f6d0b1314c83ab2d2e4e448f38fa6 add freeyams interface | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aea27966cb3c780ec28c9cf93b4732686f732991 update configure.ac for add MPIRUN | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c61199305affaff6c6a338ca68856c3bc75f4723 a not to bad download directory to hard to exlain. FH. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8594ab660ff7bdeacfc9285928b37f1c3ae78ba mise a jour | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d26d2bd6d096fb490017507523ae1064c7c2483e correct mistake in download dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7d7dc308a2c1ef8dc7416528cdd4c0b82a0ca215 add new file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 90b471686e0ee001969c5852c287c44c64132ad2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a51452043b0497c303412b0acf9014bccfad0d4f try to build automaticaly all parallele solver (huge work) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fcf7fc143187600e37367e20d46c88173e266202 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 155e6b2dcab90e1b91f8cbd6eca094564d12cde5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63ae65f89f5af9a60e2ba87e5c3355d92177b4a2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1bcc4c3b10d95df4f3bd07f3063138f6a4396e95 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edfdc4144b2f291a3fe22154d85f40bf42ff5f50 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ffb484ef56f84234cdb8e3cbc4c14e30035fbff4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f544d522a0b7840e227996514c4f1b6fe905c1e7 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3fb6ad5c131595ed40b0d0107a89ed83b03aee85 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9d74ca768bb7cea106b84a963b844f86c6a6c3c pass to version 3.8-2 big change add mmg3d interface, yams, add automatic compilation of parallele solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c11d0b5dd7260091e4d9a5e5621c9070a9e9735a orientation for element in movemesh3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f7d75fc283cbe0e2e9996901e1e3113bd5245a1d add sphere6.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b48b0fd9dfdec33626c267a4f69f44dc62b39c51 correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7cc56ea1e5230090c7cb1e8ce7963e1ea7fbbb01 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15e5c287fc963dd11473538d2860a8d13a0d256f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ebee6ced2f7f950fafda8ec30c4917378953f72 coorect makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5be8dce73f74ad4af8ad3a8cf37861c86de51638 add new makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8675a47c022d51f710a795586e5674a8b175a55 update parmetis files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3fd0610d074e3e4c454334b1925443a3a097df26 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a1671d5fe8f12c478c3b7418592baa8af981d3d6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 173a3498cf6b1b83c24f2418f05fbb9583e17d8a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c321ae9c1b66601547ebcad0882862d4bfeb054a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b2b8ea56f42a1c888c722851009b9d6f374b9063 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2575327cf19fecc6bdbc54846b5e70086e71048b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7ee71d5ac3a2dbde8270a5d5a2e5b3717cc5dd99 correct configure.ac mpicxx whta unset before | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c1a7e0954a759d109d059777a5854d8864897374 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c5bae9b5397deaf59b999111ef486bf2867e7b6a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8b1ecaf028e61badb0746b3f73faf4cdce43ae4f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ef12322edf0de4f2a14f8f5613f22513f8c3d913 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 209971da011a5b26f688f126550c284ef843ba11 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e321b4be3e83fa75787c96edd9b597ffeefe1ad *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c95920bb008c7283712ee8d12e9b05d5a644d124 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e0de5744b29d84afbb2d3531edff62292fcb967b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5ac30241c37f7d9266fa0852d48cdf251370feb0 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ca1b002e6a0ed874a27fb60a35a4bef981397ee *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0448ed9f0cf2cb13de2cb8b60ed5cbccda7707f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ddcf7641d3c9c2fb1431c62965ac9710f757e0e4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b671442bd5779c27cf12cb49c58420ffd23c2a55 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1cb591778b98dd198856009b5026cef79a776367 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c9243ca02df38e50e4807ebca0173ec20f687491 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e5ae27cddb3f64f7c1bd346cd78c45f63234e8c6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1417dfecfe5f4b4809b925386730a442908c45c3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff8ed78fa84f1a94bb5fee5d3ac66c578a3aed93 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05bee17968814eb6f93a536d5f31ee7cde4f5197 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d6af08a09459117961a3d9d593c21f5436da0a18 correct type ilu.cpp -> ilut.cpp in makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 53dec2834b98f1a5427d15508cb74affd9f1339e add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2f3560badc8c6b4a6c1d14cd0e5770bf394d076e pass to versio 3.8-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d67d54c88d053933e32f45ef7161185651ab4d1a correct bug in return real[int,int] func correct bug in block matrix (wrong size). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b78cb1386385923a208c87b4652007266f7b99d6 add flag in freefem++ command -ffg 'ffg command path' with a traitement of space path. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf7f4be067de0515fa7577b5826778eb19dc6654 corct innovation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ce1021e2facc21a13a6bf55305244323b45c558 correct change renum triangle | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 275b717a4f8a3cb801fe57ede7e1c41be58f69a1 add renumbering of vertex in 2d mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9517e34d9508c0750731e267660ab352cd559e48 add tellp tellg seekp seekg | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83af81f65afa867e6f8f86af01a092b4248b5f6e add seekg and teelg | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3fcdb2db4a3c3085deceefb33beb62d1891c1d2b change all.edp build rule | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d474510aba25424a2537dff8e35a35b8ba690b75 correct makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7134011f7ef4c251f317b2c5e3962645fd07c8b8 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c2e89e173ded3bf57d4de3e1fda39cff43a0687 correct ' operator in lot of case | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c3b35636d311edf39239be8b79ed3ecd34999581 update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0394ef5d0aa307f51f3802db0a1385e65a48ce6f unify lapack and fflapack load interface. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23561255b1fdaa7d4d9b408d1eaad12aea9c626d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 616fc6459ebd07044f0454610ca37b7e05aceb27 correct lapack seack lib. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a7cd48fdb6e3d4885d1ea8f18f9da2d5c7ddd0e correct problem of include search path | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 16fefcad7ce417bafb393496fb20aac1175346d8 add 3d schwarz 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23ea6421573060c80798ed4dbf3d50deac267272 commeit tipo error | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15677fc0e3994afb05e3c273e34d88cb3ca86bb3 add volume | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9ecab936d5d1be0e570a5e5e7e2ef928f40f7ed add tools to get fort wrapper name | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fe1efd385e14287b2c2627188f192fc488712a2 Update co,figure.ac of MPIF77 , ..., sizeof it, long | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6a527f98a7a9e6281aec52d12eb60431cff1538c add MPI fortran and CC interface | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c5c26927dd2adcfee266c1e1b93499ece33d1bd4 correct edp to idp dir of search .idp files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b5d16c025e6bc995685155c144cfc4a5291099f1 change refface= en label= + mise a jour de la doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3bea4fb29b54a4b4c770a5ff6a81b8272f2231fa correct plot of array of FE with new version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6a192b1a20364d9f21a39b08b88530164ea87ff a littte improvante in ffglut (visu of 3d mesh) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4e1c01fdce0b1b9da4e873419c960bec4a3de3bf ad seekp of ostream file ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 73beaf294858741d13a54cafb7559081ff3c4326 correct topy in 3d plot | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 17688abcca84cc12effbca1117bc675a8ce9bc63 remove F77_WRAPPER form configure trap on my mac with fort77 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b5a59e15fdd6d6f658906507786a437d7a786585 pass to version 3.8 big chnage in graphic interface. now plot of complex value and arrow for 3d plot (not test) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f61cdcd092b238f5295fe8d1de2145388fc2d535 coorect computation of eigen value on complex full matrix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 847272903a3b68c911646c796aa021adecf35140 add possibility to put array in int1d,int2d,int3d,on key word to set a set of lab or region. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 361cedb81e6606f7d10712657ffeebeacb2a70b9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 19457545481e24b7e69d06ff0c16241be4d515cc for mingw freeglut version .... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6766d171b88ff0d6206014f6844db3a209ccdb47 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a8f9d4672817b06f0f22b9deb1cfc989c39b9bb6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 182d8bfaa0a9e4c17feb2b7350addee962f91333 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 239b45b7fc5f96bc0bbbc1fdefd4e794a54f497c correct typo in configure.ac under win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 452aaf86d965e3f9df2468ca649847273b4f5941 correct to must cou | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 74401fb7ee9896af1fbe2b5070fddb11e97226d4 correction in bamg for 2d ring shaped sub domaines | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 65fb82181709e45830f24741c3aacc281f1f9bf7 patch gmsh Christophe Trophime | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af37d8687447bb6fdfcf9f12ce409ab4d5e1cc96 try to build configure for mingw ... fist test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d01e26438f3da838e9e024281115cce2b5878120 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 754f29182397aea54c3eb8d15929192d2559ece5 add exemple | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c23c0e8ebc1bfcc3d1531d3a855cfc9ad4f9efbf *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ef625faa4494d03e3daeaa70334f886f3ccf4089 ass Superlu to version 4.0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | acbb8fa4fe1265e5b5c247a23b7416077b403c14 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 265088717942ab80223f53e845fc426b0fdf2ecb correct spuriou cout | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 99774d34bd7f8d8e5db99dd02655058652059ea0 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2cb50eef0b350c343b5d9e2b7f97b8e9559a3904 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 772c3da634fca52cc6f616dd2973e87896e6036e correct fortran link edition in case of incompatible g7?/gfortran and g++ version (for macos) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d11a07411d1996899c282bcf8a2d9b37bc1f951 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dfbb2c59c46e7a5f7b161483fea08caeecea1ccc *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d09ab5819a6b5a194fe4dace5be145d2259be204 coorect gfrotran / lib pb | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2514f0f005e1e494ccad24795c2a98ce7c2a9b06 correct configure un case of gfortran with not same version than gcc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a154960baf12a506e01045427c733c9d42f9b7b0 correct iovtk.cpp (add tekplot case) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 074ca85a766e44cff079bb10e72e59c96de08bd4 add build interpolation interpolation matrix in 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0c9f3e69f4c143fda9e3c61b8b28bf181756951f pass in version 3.7-1 and correct compilation CFLAGS under 64 architecture. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 198875465ff60cf6ce13678cec508d161ddf4ea8 trunc3d.cpp is now in mesh3.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c34f29d4ef886b53b7719c0fa596d710c0b63dce add wait | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9a2a9a01312baf8a8d673686b134da8b510f3b54 remove this supite file in cvs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 86f14af271fa2f76d88d623edc79a2ffffd68144 add trunc mesh in 3d. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4994fcff6817ace3f7fc90a5f42e6de64fab37cd *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 537e0d1b548d0a04dda7ceb4da8439768612e99f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 035c375c7eee1f9706b8b8c677d18f3f1186275b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 86a888264e1c57e726e308662f8567088fa52449 change lg.y -> lg.ypp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eaf9ebbd48ff7b1878ae2ae5f7db8b104d45c3fe suite | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 933a07042a53969e9d1eecccc38cb823a796c0c0 add info in INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8707974913f3ba2068eef6500088b57bb24b96f2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ee834af64fa233f25b3ede5a2cacf67bbd7a68d9 add example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 071ee7b9ae6389efca8b1b2795db30a368e529f4 do best plt of 3d meshes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3c9d4798b8006be19ed7c4c83b0b4256343cf1d coorect cube.idp and change 3d plot of mesh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e78c19fe7c6e62d6452bff6f9a4a362b8d8368f remove imtempestive cout. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c5fd6f33f5ddff019435a09d7e34baa113fa0fce *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d4655a0c847d58163230fa4a01941525578aac2 correct FFLIGS flags of windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6fed7afa2d0ffa00c349c9a1d5d0f8fbd0ca3a23 remove copy of header file form download directory | | | | | | | | | | | | | | | | | | | | | | | | | | | * | efd5550a5f71cff6924472f7eaced68c6b458de4 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7c3ce6aa1f8f76f605dd15f6da6ab1362ff3b4c5 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 265c9e7a3f76a48794367b50b646328d632f9e74 correct fortran flag in ff-c++ command | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91ac20bf1a8c338e22dbd163073af9fbf3ff7ffc add new files for newuao optimiserx | | | | | | | | | | | | | | | | | | | | | | | | | | | * | add6b9b0220bf5d0d61e22cb9daaa04d94529cfc change in innovation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0e15cbad1919e9330d3cd3066aa6951c030d266e correct problem of free mesh to early in case off gluing th = th1+th2; ( before th is free now the ref count is decrease) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c0e02765f240abdb34ec73a71ac22c68deba88d add matrix[int] type in grammar | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd638c62ed3352ad52fd2f8b3a6bba0d5eb1c1ef remove warning | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 066699aa50433c1a0ac032adb1bd66a1ad660093 remove some warning | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dd8c55875948982f30a7ca8a25d9621bb5b99d59 add example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2ca273eecfa3a31597e06a54b91b71f4dce4bb16 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 50e0ba4047ba1c7a57764cae0a00ff8262b573d8 add two examples | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e2c61f04abd8a6805850d5a7e7672d7b19f524e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3cd2511f23cea4a86033be1f185effe60b2a0258 in ffglut remove seg to small ??? | | | | | | | | | | | | | | | | | | | | | | | | | | | * | de33b45c7336775f70f2f7cbfd0dc56cd08f2e95 pass to version 3.7 correct misstake in genertion of file WHERE_LIBRARY-config add initialization of scalar variable add warning in case of use of variable with hide freefem++ name add missing file in distributed files correct typo error in parallele solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 46ee52105803dc1958fccb38cf33e0e32418ebe2 correct spouriou print | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4220c5669c8aebf625a0768353a459420389460a change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | da74d35dc5d0b70e4cf89f30f2a650b0213ed010 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 67aec18a8702316fbc0337c33a8ce7b73b92f600 correct install stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bdf065c9e6c3ea4725e42f2e9f2702be9e67680c build WHERE_LIBRARY-config file for ff-c++ tools | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a8e0a18f21b0639e14feff5b679a046c9fc19f35 add clapack.h interface | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23dc232e56dab38c12baeb56b6c570bb5dc5faa2 correct vtk files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b67fac08b6bde14047d395479407a4a3944fcf6c passe to version 3.6-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cc81b893e8c55902358cfdfcccbbd4597b951c35 add PICHON stuff (for brute force seaching tet ) add UMFPACK long interface for 64 bit architecture load 'UMFPACK64" | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f183feda6da83497b6a144dc2d8a6b5caf016e6b correct problem of missing to 2 functions with g++-4.4 with optimisation (Bug in a compiler ???) ::Draw( .. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 45c6fe6acf12c0202cef82af4c3d44c90623ff23 correct mistake this g+= 4.4 compiler | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0fa938ab6eed4901035d547d6ceb974495b749ca *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ee82c789477e345a8fe194fed2bc69eb9afa9e05 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f8e800a7575efa014c993622f83a912c6110f2ce *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4646f4849a8d9ce348c1130042e94deae7865942 add new tetgen and medit edp file CVS: ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 869f89f449aafeb09401c763d77496a84c63612f add missing file. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3f8cbedb75c578a1170d89df83760a05686da746 change innovation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d41bca677e251ba1cdf58d4cd14832d55ee2cfc4 add auto stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 59fe29fc2b82dc73537b37945087029cbb6de51a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8b2f8a5662389f8dfc94f619163f1a298ffcf657 passe to version 1.4.3 of tetgen. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d29e75c978ffe8618eee363ecacc84834152bbd add eigen value full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7cc6ed0c64ee14aca2efb61514c616d38125011c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4a527b03fd63b966cae99f6928e8680dde8389ee *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c75068cd719eb888ea9b201dd0b70ec9f3b5c88a update INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ad5a3b19d5cd606af7a8a8386f9c905b61ebe1ec passe to version 3.6 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 01800093aab26c9fced0f34818253272b3478293 coorect .cpp and simlify | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e392e0b765a7be5fa8ebe970c5c14618f20f8b4 New version of funcTemplate.cpp with function with stack + 1 2 et 3 argument | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e8a2db1a7c834d6aeda811dd946a6db49716c54 add tools to read .pcm files for optic-flow computation see http://www.cs.otago.ac.nz/research/vision/Research/OpticalFlow/pcm.html C | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e1edaa289f03c2a19ebb06762f922b69960c0ebb add tools to read pcm opticflow pcm.cpp pcm.hpp pcm2rnm.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05ae4f6f91ce574208c5fd1ed1e5a00819bffd10 coorect assert error in gmres without preconditionner. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f97decbe766fe472db5e1883bd13567d0c05759f You find a very hard bug to correct s ( a small miss tapping) This error have a strange beavers, this arrive when the first element is a the boundary, the a random number give this error randomly. Good!!!! | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 12c45dc2028d26a0eeda4c5a8cb6607732a1064c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca05a51fa29b95190d826a23538c81bdacfa15e6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce837071aeeeb47df9bb2da2a0a2f0fabf2f39b5 correct a very old bug in bamg in case of mesh with internal boundary of size one edge. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 569d471da1d8ddc6a144ef2f2492cafde5ed5ec7 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9185df4320504503eb3636b4234d8ef4e7937f14 correct print error | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3383dab2a45530d8960c9972d709f6eb15251e5 add chech of size of fr-ortran integer, force fortran integer to by 4 bytes with f2c coorect misstake in complex eigenvalue code | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf97001fc82dd30a7072bdc8caaa036641cff92b correct msitake in complex eigenvalue problem. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eda044b0c06a438acf64b01068030a30a1508d9b coorect install problem undex windows and Macos. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e66484a4479e597c553f05a452d87958a55716d1 add __VC__ under windows (cygwin) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c4764a8b51124c346eb8598391940a80bb22c61 correct miss tapping in fflaunch++exe | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c30848308ddc09413c74e416371af6759c8412e6 coorect miss take in launchff++.cpp filename | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ae03523572f317613928cfa015f10c390692ea2a corect misstake in filename | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3a6cc79bd1ebfbaff33c86ad44abd17a1bb1f069 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0717bed53f7266a052680ac13978a9ccd34648d0 coorect d-Leman.edp deep is under 0... (before all tet a < 0) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6b42b9dff92d8332085d82eed57de4ed44d459d7 coorect plot of 3d meshes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e18329ef9444fc2350a5e5cd283c6e4f8c293947 corect a stop test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d5e4b2c30d3789a2a45c1a203c70fd1b4845f955 correct big bug in case of 3D fepace with constante number of df / node. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 710e8c52962821ce7cc310af06d133abfe7ebb7d continuning array of vect FE func 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c07dc5909071e5ce9bbdb0b51f4b59af5d93425e correct makefile build WHERE-LIB -download | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 929aa61bca55c033f6b4d1606633e71d71a2d7bc add two examples | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f84a0c7f8b6c577f5525041eb207149a8ca4888c correct set array of vectorail finite element functions fespace RTh(Th,[P1,P1]); RTh[int] [u1,u2](10); [u1[2],u2[2] ] = [3,5]; // works now | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e38a8dcb599058dec75ac520fe167bb0d3016825 rebuild makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11edc265e022e9effc474956ed0346374594cba4 add patch filexs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 81d788e8717e91a507e34ec7410b65d6eb87c2a5 corct make fo intall | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 29619e1550b6825e359ae214938e2e6d16aaf78c correct makefile for metis | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91b12db43439a385bac115b7f937587f455fe870 remove file from data base | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a1e1641ff1612e7ed4b8f0f9f2869345e444646d coorect install makes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | beeffe721b6f8a0dbd3cec02d8d4635fd812e14b continius ff-c++ auto | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 82653824f46d623f6b56c41c0841fd2ccf241bc0 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c92d5e3606453ae0f775b8d1085deb206446d469 rebuild makefiles | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8921a461a0e96a3bed203abebe3dcae8fb507b93 change ff-c++ off auto dep. find | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b19be7a87c2e863ce27d3e2bc9226e2cc8304b05 addfile for ff-pkg-download.in | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3c166576808618058bcc38bac4cb5f7b1ff14e8 change movemesh3d to movemesh3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0abdb7d6298ad84246578bd206b74c8cee843fc5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2537ac3f73d6f41f49f7d327741259cb5e2bf8c9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a581da25868b29e3fbad2edbd24b093012e1e8d3 add missing resize of sparse complex matrix correct compute matrice size of A(I,J) wher I,J are array. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8d6123dc825840a4926b810b1acf6f41c0f1c4d add metis | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f5b55db4aa2296b58afdb7bae0e989d95fd44b39 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2e2e559f96586a26998ecbd2777979ff2e9eee6c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e5b8ada7e86e0e296aa6661a9af828ad156b6b3 add tools of automatics find libs and include | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3c12190ee2d4e7a4e65996338c4dc672cfd106cb *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 582660b738b5ba1249cd7404507653198d02a7b7 add metis link | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b7aec2058e18749474f114b9d2c661473137f12b add MPI_com in solver prameter | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e500fcc0401e16beb234d6b3a465e334ed7c42c9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 214339288aafb931649f1441ad1fecb45816b59e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9176199dd9de5132f2fae95fcac1a4b18784f12 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c8020c0702acff121925c93c1902465894fca7ee CORRECT IN CASE OF mpich | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5ac2d79de4beb4aa76045d7a1469a746d43d494d add missing file to coorect trap tst on ubuntu | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5dc2709b18c56905c7e4d43440be4c26a82b3286 coorect README | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5b39e38e91b3604a9e4e7b883abd5c0181a3a566 add file to remove trap in check of eigen exampel | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edebf8e9468706475dfe738dc0f23da920616176 coorect INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 514043f98f7e35d765c4890f381387f4c0620b4b coorect mistake in parallelempi.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ae904cee2089ba1a365f93d9448f79bc17ae5115 commit version 3.5 see innvovation for all change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9846e46956cb35f9ec1c4da62fc2e906658ebc54 passe to versio 3.5 with a real mpi interface. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c444a0fbdba858a01e858140d4423ad7c1fc611d do a not to bad mpi version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf4ffbfc1a23581a6af4a389966088148be26d93 add mpiBarrier + const of mpiGroup and mpiComm (boggus ???) in progress (see essai.edp) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1c9a37bc2e181d812f574dfed171ef6a367a57e0 add Scatter, Gather, etc in mpi | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 100a403ac61b54ae6ec5dd03f7ce99927c3fd8cb correct mpi version see innovation for detail correct string[string] a(:) = 1:3 ; on arry.. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f09d6a7dd4e65b1a9fc97530df47c0aa827b9f7a bmo is boggus and correct mistapping in convect_dervieux | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 75949dcd762bd89331707d8eea579bf06098bc06 correct convect files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 998675bbe4b52bc56adc7c023e78970991aab3f3 change a little, correct a stop test and do a fast version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 518cb35fbfc635376ed627f6bb024a01ddf8c13e change INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b2047f8ffba8d59717d37fed4d022dafb8c65c47 build version 3.4-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4f8f01662a019542c7a403194fa5a3c77bc44c12 do new mesh inquire also in 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 01d20073c41f0fe2a65ebf33d2e2aba7c86715d0 correct mesh.edp example for new mesh inquiring | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6b31450f8d5b2fd73352eb9ffed80f48cbca6d35 add tools to inquire boudnary directly in freefem++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e2ea8f6308d4f3e7c28971c40eb2570a2c7deedb *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b7db7b53919c200dc0847103e0887843616f6ccb *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1f070031970600ba402b69614ef3d55acfffa96 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 61b0b39a9e7a57f797f2e3da45e11a9fdb95a639 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1218320b39d55259e187a22b139cf49609a16111 :q | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 544c45b8baa82c8cef53c36c4babdb3edfea05a8 add un first example .. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca64dec7dffa3ee1d1d5049189a2ec6cd2807cd3 rewrite of mpi version ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e2d2b4030dc1ade194a401bd4fef6e0a1d58b6fa retore good version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 126539d5a95e5b95b8de28b23ab4a8b113f27110 correct INNOTION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 95ce49119e06346498e45e65e0f892ec725de538 add plot of array of meshes and array of finite element function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6cc90cb294fe7938524aa9129f891afc401a9124 go to version 3.4-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af04d867bab5638e0d58763b4f3d27e047070dcf cosmetic in ffglut | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b853c742fddf0ba107fecac693f2c7d01a1ebe68 update ffglut | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f05396f65ad3d98ec4e568258bf6dffe2c71af0b correct load.link.in or un test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a50abc1f111d432fbbb220c68e63c6fc314f143 coorect ff-c++ on win3? | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 165133c4fb4367fb7f17c7665dd3ddcf3b30e795 correct ff-c++ of windows case and cygwin | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 46892228b9548963132f0d1586ca742f226cf70b add BEM.epd and launchff.cpp ( a wrapper for windows) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38123a67d0a347f897fc9cdcd8593336edfba547 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 456120b579954c4bfc2fbe3d21ba29cf29fa3cbe add -wait parameter for window launchff++ wrapper | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 523437f1f66f620c11a70b7f6e7954626e347e5d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 018e0fc8d92f084b261236508e67fedd5aa5ee3e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 18709a72c2ed51058b3c08ef37cfc51e07a33008 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 89f2c7afea54336261106894819a074b8ab1d792 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 99913b1e32bdb9c40efa79040287a3ca8b65c52d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 31281a36058b5f784dd0b1817c06a22090831a10 correct mpi version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e12e55169fc76a19698e68d9ccda04c3e0600d9d add mpi tools (in test) and correct buyild matrix interplation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f930f035316e9a0030c19576915f4931a1b1985c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd5ed4c6c18e516439aec26c8358679506d442c2 correct PlotStream io in case of array with check. the wrong type was send (2days bugs) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 69b91c6ed60503a5e8636540d031b8e71c517b25 change crimon-freefem++.zip in crimson-freefem++.zip | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b5019cb19f398b9561da5f71d82d8b7a7907892 p ss to version 3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b28f8b17e620ee63b6abce91c8caf3c6897c4f73 change ffglut to bee more safe (version) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6be3b5b97836b79ee72f438181c842075dca2c06 correct include hpd -> idp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 25e94db234418d67e88ac22dc689fbf384f28fe8 coorect bug on window | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2a2d92f142115646f6118fef64d74e2330bd9a9a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7eb28f8468ba95c6e7e68f5c18dd1154f7d78f9f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e814a10f1d178faf4bd7e4c0be2b965edcde0d59 add examples++-3d/lac-leman-v4.msh in the distrib | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 802cbef67b26fc560c20c012c56b0ec629284139 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f560efd2fb5bf7ac5457e76cb2d59a1782bbe5e3 before the next version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4cdf41bf65e4ea1abcebd7cdd96c61dd7bdc7ffb coorect idp file in mortar exemple | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2f54ad6bf5bb8fd571003b8a5b024724c911f30 correct bug in makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a104148de570338076a5442744eb0b2b669820d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15e7a90c0ba6f0bf4eef9d0cce3d67ba98701247 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9dc0f48f9c96e75d86ac71045dae7da391ab1b77 do small correct in 2 member: TypeOfFE_RT0_3d::set TypeOfFE_Edge0_3d::set | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 09eb7dd83d681d2d02a44f8d5728f3f8160a2130 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43d839a25f54285dde25c73eb4ff8bd9246b6de5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 58108b6a8cda3aed73000eed3017d89be5d82891 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce9e013062fae9b9052cd77ecdbb3d9a13c8182b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6389d2fe4b07bcbe5dbca45dd2b134085e00e83e add Egde03d and RT03d finite element , correct mistake in finite element kernel in cas of none constant interpolation formula. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 53d94616d6b4e8cce9a6ec01b2b7652a4de52aee *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 097fd5efb6a91ae1186add89420a9c87d2eca6bf to avec good makefiel | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cef8e15119f84f10e2dfcbc0ddf5bafb4a14774f correct Dxwriter tools | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 72450a5fe7f0678ab4709d5a35a0f991f9b32bae add file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4468998ba6334f72d8d03d5ccc62ce9cba8202a6 add RT0 in 3D . 5 first test) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b91102ef10b6724c300337d7b9997d7758efd209 try to put RT03d> => correct lot of bug in the finite element (vectoriql) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 358ef65edd65a38ffc7cd4d3f88983e4c9ebf84e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 550cc4d65d745960cbeea0001e9e2c6754ecf0fc *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe59b93b8cc7f532621fc75d911e33f445ad5fed *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0993d39e3eabb64adde4fb318b5c22c53c89df2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd4a75572dc05aa6f2f6bf736f21ed600fbe4c78 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c506ef3e247a9657a31969009241989d3e5c5b0f begin of RT0 in 3D. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1b94422b0d287a1b1e335766c53c95e14f9d4b20 add tool to build surfqce mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9dfb160efb92929d261b5b9304fecd2ab9219b2 V 3.3-1 1 juin 2009 to correct the problem of the destruction of parameter in cas: func real[int] a2(real[int] a) {a[0]=2; return a;} so now the parameter cast to KN_ so the array is not duplicate like in C++, and the value of the parameter is change. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 627a456fd91b2e6521dc4847eb4f7474dac34c43 reove unused files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 468780720329e1ec48ac8a75833c225185fe43d8 add change solver problem on return arry and meshes in function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b25fc5d773d047b1cff8e2ce70fc7de1459a6845 begin of clean real array in function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 98d7c9eac2f604bff7bf4c6d6fd689dd9997d1c6 correct convect 3d.. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05b6b48be50310fb4fa6f3fb709fe0c292903dde correct -o in find | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5f4b784e39b15f766baafbd1898beb51a218b74c correct msh3.hpp and SuperLU.cpp mesh3 volume is 0 some time | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ebe2f90d5c8239a16e3b0391f89e0cfc7000df1b add 3d mas lump quadrature furmula (qfV1, qfV2,qfV5 qfV1lump) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 46313a9a5bea19be96b8803af9325f729fa39e97 version 3.3 correct convect operator in 3d correct sign of the exterior normal in 3D | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6648e46232b6663e5c0acf0dbc567d672f94cfca *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 10af546a0a40b6e9545511892bf70c2a00133cd3 add -fPIC flags on 64 achitecture add examples++ and doc in install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9f74da949982d9f9655d47269ebdafdf83d599c9 add 3d eigen value tools | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d90d106c738276390183c10642263f84326e6d66 correct configure.ac and makefile on window for lapack lib in arpack | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b56f389b9972880d00402ee7e96e99efb1fd0c0c put coorect for new sparse matrix intercale | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 57a5ad30b9586118557047d86b1e537f02c97336 remove to change in SuperLU.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 98ff01559133ddf88a53e2c7667b5622b93a9603 put correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b1a3d09186fe67e7b45632ceb79b4ad0017ad44 add oone output | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9c8d3798c6beb0b73c07f2a94de5564550db7e7 correct the doc (in progress) , coorect the size of text in postscrip driver. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d692e74bc1fe75e951205bc20e14ceda9b1e4fba add fig in doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 792b328d58d12691464b9b3f0175939f7e639d24 add pgm figure exemple file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 61be46125f27bd5d83fc382a188a277b8345931e add tool to read ppm and pgm image file see ppm2rnm.edp example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ec72dbf5d40495416a2e08a1abf97881b4db6b52 add tool to set array like in matlab and scilab | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2ef765208260c2ef80730f900b3d802dd4996319 comment change in dump in RNM.hpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 118168e255446e33dfa1571e65523f29e4dfb448 add sort of array and in parallel int array | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5cd4268740c8d16cc720a6fb51aa892e988e0a0a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1984e4de70ca415a00e9a7f1b60d12da328b1e00 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a96c9538e1b8988b6f89246e7ea76ac4707a96a5 add missing file to inv full matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5cd9dec1b84179449fc324ddaa5fd07a91eecdfc add missing delete | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb04b2d2c90f1e3b2346c7b45df0e020d3e551dd update iNNOVATIO | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1f465662f16e8d3f72546bcebeb39210f8f55b66 update innovation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b90fd1746e018509fa6ddef6f08b734405caa6e8 add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a43ca84dba167df70f919839fa9126021fe3c1d3 correct example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e9013fb039617c9f82e16fc2bc5b1033820df52 add perodic FESpace in 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 135be610ce031e551df80e13d4e8cc1b6153ecbe *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6d58ee211073035f6833d272c729abaf651b2b1 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6a8a5e8a49c23cf469f0b522c3c5c5a988468600 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a283378a579a156433b0c5c5cc88fd790f28e433 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 297b85547d5776a3500bb9eb2e9bb44f9fb9d4b2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f5c9233fb88d3ce8f3d035b66a6ef5ec2dd542fa *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 27f7a70cf150cf1ba52d0cddf277424ce88cddad *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6a566edd4dc424647eee0757ff63f6a4408b91ce *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c72477a83c55a5f310f8371cd3b7a0242263922c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 99a012e52325f882c306513e106b6b423b40c2e1 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 821ce6b45ac33a080e8315f7bb53a2242820e6f9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c2e6b82d41ac60f0164567bc0dd713e9a779b89 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b96a0696eeb3c6adaa24b186c7b8ba9ffab49267 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d1668447ade1a8a56062e4403742a91cdbc9ffbc to be sur | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f6b8d77eefd1ef9ea5206ae1d0f928fdda141e7e add dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a59087d54251cdd107f61096c08402c257428d44 gros modif dans la gestion des parameters pour le sparcematrix (unformisatio) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 90f05973fcf638d3b5a43a46f90bed4fba308daf correct search of lapack lib | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cc771563edbe5c8eb9337f539a021500cae38548 correct complie of lapack lib with arpack (buildin in macos) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c39c90abe032bab5caaeb4f3da396875bd3858a0 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4cddef2789039bf0761c98a6aa8ae22950be2ba0 coorect --enable-m64 flags compile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | db7411a32a9fd7097840a8a06d19ce3996b48fc4 correct Makefile-MacOs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1be2e7aa86d212a9a47d447ff7710671889ceef8 passe to version 3.2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7f4c7bddede5ef4390c09b0932c99eecf8708d97 do change for 64 bits on macos. add --enable-m64 flags | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5416b04dc04527a2a3d17ba12157dfd23584fe87 add P1b3d correct operator Th(x,y,z), add resize of matrix ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eb360dd67221a9acfbe7f6106220cc7e987be486 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 975ec49e5c896681b8d87df33c5c45c2dc7d3cf9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1c9a8caa174e7923320a815989e5f40696f5ef5c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0d4530168af3d4d94c7b46afb938601716591e0 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 278dc62a3b9cf3a3cdf6d828c0df99192f770744 version 3.1-0 correct src/Makefile.am dans bug in cas of non umfpack. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4b05f9b7247b10d5be2b53c289b05ab21bc9ac1a coorect load.link.in for f77 compile. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 083554cbc6cfa13d1672e169cc4f053f743adfc7 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 891c6a5bc25256416ab9dc78acfdad384d79dede bug trouver dans Find: CoorBary :: valeur entre 0 et 1 eps :: inferieure a l erreur machine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d45ff9324f2454e548627438d402a7d292d7bda2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5f2e2177363571610966d01d5866f3da04e7ab63 version 3.1 fist step add light in ffglut. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05d7b1b1b48938a43fbe5206226b6ef02a7e4240 correct INNOVATION and remove print | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c45aab7255366f1709857e002e2c7abf033701f correct int2d in 3d. (error on transformation face to Tet) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 181323c5e5056920a9c0911147e5a14e2f142462 make version 3.0-6 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cb46005c17b97d8aa926169e78dbb8a99285b693 correct bmo and extra dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 038d8cc5226cf31e42ff329928ee47d5c3edfa58 version 3.0-6 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 521d6d339225e1e854c89335a2340ad79e935fe9 add required edges in adaptmesh tools. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a5a80e94bc85fa8674563d2462546d62dd6fe16d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 494d2d6c11af09b82678740303574fd77a1e135a add code for lock boundary mesh in adapt process. for JYU ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e825ec3b4838d05e29125dd9818f3877a6d3ad2 add option -nowait for windows. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fba988f9b8fcb76de425a1a1f22225adfcffa915 add 3d color .... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 81c879c0324ffa40f2e236193321c42bc7d505eb correct missing tapping | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dfbc62ce8798fc5b9f68df9ada2314ed10b7e9f7 add a first plot of 3d data witj plot tools. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 54dc0415ee660a49c739f6b78879500f60c991ea add new file for tet siplit. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3c4595844005ed8c09d76ab380692aece483e526 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e46c15dd0645f159f41721a1e6bf64369a61a55 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4abe9388d8de316831bba513094a85aec74c9b17 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b814d1e086326a7f36b4f78d654a231b22501e00 remove last change (bogus) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3bfb7db9e706473d88ec021cd7e39a1f5fa8b43c correct dy(uh) when uh is P13d. (always 0) change second op_dx in op_dy line 97 file src/femlib/P012_3d.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d5f450c17bf75e9fa4d29f9281eefc95622f0a67 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2eda48120dfe36fcbef043176381f9df7ef2a8dd *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b44f08a79c38af386c781471ff3235461ed11bf9 correct bin-win32 install exe | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dee2fc3d230df92bd4836f5d6982f07cb5fb15d6 correct install bin-win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5475f832c95ac1a64c1a64d1872a13ab90fb4fea remove crazy file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cb67f1a0a1bd71c27d7199067094f8176af08801 correct the install on under windows / cygwin add /src/Graphics/ff-win32.cpp missing file in tar.gz under windows correct ff-c++ under cynwin compile (fist test) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 513818b95e92d817e705961f7a5cf6caec92bd36 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | beb548d42d5506af96dcde3f54a24f2369653e7c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d5ad82c18a52ea54cbf74219b1c3883adc12fec correct ffglut.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b18a6da044c6d572cd5eb9818c5ec2812bd323d2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd32c2f6219c8d56660cffe84e4e0b9048f2c43f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0284e6a0e867fb8d0a13cbee2c89c7b4f366a610 ajout de savesurfacemesh VS: ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce69127b305a2968739160c5c206b290e093d4fe pass to version 3.0-5, correct array of 3d finite element function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ddd9fed55e08b89b961be8634d4f762d810ef34b add dx witer and test salalo80@gmail.com | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ea3611b8a97097adfb85b763709693ee20a4770 pass to version 3.0-5 correct for compilation with g+=-3.3.3 of suse 9. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8c244ff15f5c0d3241b468b43096568c1848a191 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 317dc777070a71f1b4d3cd35ddfc912148ac6023 add new comment file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2f6956bdbda20681d6f55a3adcae4856829a093 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c49dd7d32971e57d69fd5d08d16f6a1e951d67cc correct window message in ffglut | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a2c8eb77f7bf3f62dfff892d11713092b32f115d correct 3d view setting | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2550a74429afa80e1b911073eac54930cb2d43da coorect Pvue3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23db1f4489b258e6d9ead48744bb86d65f7b9def add 3d plot | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 174de38dcf5380180da6447d18ab2d5abeb5552d correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 00e1e35174bfda14dc7571aa5614e1bd8421fda6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 890574dbf8e399fa1000acfc251de1acbe7ee95e correct download/tetgen/Makefile more portable add DISTDIR in examples++-load/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 20839611500203f975ee916d968efadbbf52612a correct int2d in 3d, makefiles fo tetgen and pb with $(DESTDIR) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 32c2b5acda06c6f1bc08ea6f8c37e9b439c64171 add test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35d701883900282a08b2684129c36bfcf4b2cb7a correct in2d in 3d (missing factor 0.5) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4affc721d26cd735babd6534ba3bd3544d104a6b coorect the seach of the include dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 50217b5fb3a7e61eb01ceac7cde361aa90d39122 remove the clean routine variable after return, to much trouble. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5312ad8b41c1ec63ea53b2cad6aed23744a42bcf coorect Laplace3d.edp plot with medit | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c55c5537743a7a651c86b9d0397d79565562792d correct medit.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e15de4e26b3efaae07f37b604fa7759148a071c update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 98a4d285b34c1cd1f5fb8602742b5ba0882446fe do pretty print correction | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cc5ccd7727c9f85f6211cc3b06d63d1b4170af90 coorect old bug when return of arry | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c6d134fcf5fa24c2604f2b6904c7052136c600e9 correct makefile for dist install (change install-sh script) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 96f6465febc5f2fa7a61bf699edfa93c7383933d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0ff1d4c21135f747103349e67a54f87f42410b45 correct serialeze mesh in 64 mode | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 352729b3dc990dc2cc3f1befc02126b25e84a879 correct serial in 64 bits mode | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 94eb66264c447bf85e38d46c0264ffa0c3f99199 try to correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a7d502a65e9a6765dd4bb268905284ae639eaa38 correct write string | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5d913c7bb16f5ceb4f2f9242053797381b0c9b27 correct write / read string | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 972c9b763c394fb0fab82e4422078ad950d2c2d8 correct Serialize Mesh chang long in long long | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2780fff15f786bec7a99c57859ffb391235de0a7 correct build of ff-c++ in src/bin-win32/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fed71e63f9359b7eccac04799b68105c7ba9173c now load.lik is bliud from Makefile and load.link.in | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 849831fe63051f757a8262bbffa4604a5872b13a correct graphics of curve now the graphics file are independante of the endianesstype and of the architecture 32 or 64 bits. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9f7d2a4ef7f949d2675f5dda7ca5acc460f0904b correct Makefile and graphoc stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c472fcb714aa89a25acc542fc44b1561f621f67e correct ffglut for zooming y -> y-height ???? now bb= worl in plot. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d6ad403b883fb31e4baa73d4bfd8a63f39d7d3c coorect makefile for install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 834ea116a5bd25bbfaa7685342663e17164b3768 add UMPAck solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4b49d65837d6b1ccede67855647dc05be4efb82e change the umpack matrice solver correct Neuman boundary condition in 3D. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e8aeb1ca6e8d8b1468955defbb610ea8482ee69f correct makefiles | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a93b97946bc8bb61efe8418eb1e665cdf48604c8 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2e34c0129fe5aef37c5624f777ffb618dd8e3ff change ../statu.... in.statu (for install on macos) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3a8036442c6da75480229752992a41e94a1c2b8 correct configure?ac of ubutu build package | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 97638c5f99cda926d07f1c2d00fecf9441d6a6a2 correct missunderstanding of usage of strchr ( return 0 if the search fail). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 02c6d852c9b094ea0a5cfce66f050b0bef89ca8f correct the arpach driver , (pas mal.. FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fd286121ac953b35fe09e7718738defccc3035cf add the mode in eignevalue like in arpack => a big rewriting of the driver , it more clean now. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4f2fc07b645286290a95abadf3dcd70589029b47 last chnage before version 3.0-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5621b59df695a7e62fe1820da157520e67f157f1 coorect for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6bbbdb3445750e9b1d01bfdced4fabf2b5501020 correct conflict with basename (-> baseName) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1555782f5aa5d821dc45be941c30aca347ecd6c3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6969d6da9c2f9c006b9ba91756fb339c925140e6 add ff++.hpp include file to simplify life. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2f01676c7f3d6e566b570d78752b23dc396b14ba correct miss * in pointer | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9408256024fdcf744277e99490cc83aa8da5552 coorect stuff for loadpath on macos. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1985d7ea98f9afb895d0796e94f4f62152e4d760 coorect install on macos | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1c836a0c169bdd1c417a5b3d08aef19f2dec8a56 change == in = miss tapping | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f12b82c6f87f4b52395e27d736376f7aa64cf6bd coorect include dir for install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ac5542fdc66e1ac620a648e5f109d5d2ab9607fa stablization of install process | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 82aaac66bed3e523f8b02defe834cf5e17619409 correct on windows to build file in local dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 75030eba29da259c8622b3184c58af220a64d93d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b07987a4f3fb222af08bccf61b79403dc525ca4 next | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 657f18c5458eef18c016c7fa374ba83c9ed8540f correct binary read on stdin with medit. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b364f87288308841a1fe6da454e6500e985980a coorect makefile remove dependance with ff-c++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff32c027c5cae94ad46e079286c322732564724e corect pb when plot of const function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 02e73a6da31b7d1bbee7f889f67ac4ee193b53fc corret freefem++ args -fglut trap du to mistake in getprog-unix.hpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7b560ce08e5f16cb3b666ddc6e00dc69f6db3111 correct install dir of freefem++ include, load file. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d26626d105001b87e8edb582e58b315e0e783173 pass tversion 3.0-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eaab738334fb81fbf84a17231a8e94beeb454842 coorect win32 end of prog add a wiat et save the logs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7669f4108ebbfa444fd2cb1091a0ac96acb605c0 cooret of save window console??? | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 03f869418ca36ad9827be225db38c6b366829e3f coorect end freefem, try to save consle text | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b2545f3009d0638caff4617fdacc1b19b8f819d8 coorect window version add save console at end job | | | | | | | | | | | | | | | | | | | | | | | | | | | * | daf852d540a939d155de6907fd28fcf67b2fd973 coorect 3d exampel | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 32ccc15142772849697f89ad8e586c45002f982b change medit in ffmedit (the freefem++ version of medit) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ed04ebe7a492cc060f09363aadc45338a2574bba correct .. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 93004a06973dba481832871d494031326b2ca983 add BLASLIB on SuperLu link | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ae691470ea63ce61d0cd4f475e73bbe2fb00b9d3 add no compile on pure win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | df733bcbca58ae8b88c17ce0ae32e339b61ec784 coorect Makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9566878a8f93f41f4f55efea96ceca23c0f2d137 correct Makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e8f32fb0bdeb6c9a8f7c7781a5d039229a529fb0 coorect makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b3fc58e3901992891fb400740afdbc41b7d01e0 correct pb unzip | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 142ccca85074a4278d73887de58a2d037ca92b6b coorect Makefile for window | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a70122e55dca0899b232343945aa6cfc72eddf6f correct Install-MacOS v3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b751806d11dab7652ff896850cd6c3a9939ed713 correct of v3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 98eb27ed7ad491bf823276a8600950cabdf28b50 correct makefile for load compilation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7927ad620cc3eaee76cef9b68646e85749b776a6 correct build medit (compit.date) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63c40c3284edd92a56d25862d1b3d41977a19404 correct ffglut.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38cde02403620ccb1d7948198198dcdc7f48d9e4 change SuperLU.cpp -> SuperLu.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 40911a31c0e97612112775b57717b38f0e33a558 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2960b6f27a3b9c585469a9cd0db9ea4340326cb2 correct bmo.cpp on cygwin | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe229675773242e0605b0dbe98e3655ca73921c5 correct bmo rand generator for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15f8ec6f065a37e6829ca7b2e287348c73e1ae6c change rindex -> strrchr under win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5bd54352e72109234734993a78a40b77a61fe0a7 correct the doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa6c06edf1159e5d201440f5fd448f7de58f3114 Upgrade the doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b53c579e98c23fa49f1d4e375d62150e41efd446 add | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 31b413f6d0f2084408edc9efe1f1ec92b8d3321a add configure --disable-dependency-tracking for universal build (macos) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b13b390d95b86dd73a14de6f7bf8c75643468202 ok a not to bad version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 392d9d9984bfa675ff024dbf85555f7604aa39e7 correct load facily (test if multy load, and load only one time) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 133cf191bf79c4529b4626c62c7835f55bf7a79e correct load example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 33488101eac4b87e559d1cec7c5dea66afaa5ce7 change bmo.cpp -> lgbmo.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d20d059214460fb564de7c8063dade012cd0d71 add bmo stuff) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | adc3ec24fe3e0e1bc10afbd51cb91b218f59128b remove medit lauching when no graphic | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c97b12ac94747778a0e34889587581ba25ff170c recorrect | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fde5fc9b6f46a723a69fc97ee5dc6fbf1efcf7d0 rebuld regtests.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83e456074074850078f6653636cece800f3ff945 remove glumesh.edp form regtest | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43208192d950e9022e490fa1ab7d483a45947979 do graphic only on mpirank==0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 90e9a7b626f8950c0aac15c651b19f3a57c916ca correct bug in eigenvalue part. sometime miss 1 in size of arry du to fortran interface. correct StokesEigen.edp example value computation (the mass matrix was wrong) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ee2f44a1d3f3a6547e33aee64b7a39322518345 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8600a8f0f338325213f3b0acfdecc8490a6f8f0 Transformation Matrice Morse (stockage ligne) en CCS(compressed column storage) pour superlu | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5a30c4bfabd8fda67eb2e7f1f8008c8f4d633985 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7349dddfa9fafefbc2d80832a08a9c40a9b1d7e3 miss tappin SuperLU.cpp -> SuperLu.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 665babeb8da02648c76380c7d36eb28eea64e980 correct 3d exemples | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fd3932f757523697b61fa52e7c19bc3193393604 correct tetgen | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab171d77fab87d32c3081ec3745e8d79cb8dae13 correct missing link pb (tetgen.cpp include msh3.cpp with out int. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fae37b31bcf20ff566a276c84e4192d3943d0956 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e2e94b6327e77a1e19e99ce99c9a4dbc8efa51e a last touch before the version... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84a3604f5bd41aa47f2fdb28cf0a7d375f86c91b correct auto compilation of ffw3, superlu, tetgen in cas au enable-download | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e1e31df34f084b4b0db8e33a876142688d1d8d7 coorect script for freefem++ app | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c8a46ac1373e4648be0fdebf106813cf41d5288 coorect install macos | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 770813a76663a813f82a1226e10e7a0dfbdb1b60 try to finalise version 3.0-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | db3cfa905f39aefdbc956d411903dfea53a15916 next | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fef3c6d623eb7c3fe1e96c7f57e21c40b6ac2010 correct load examples change popoe.cpp in medit.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 32eaaadd000e8e0d13ae80c3c95a5d5c726bdeb1 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91cce8059b5f9938344e6dfb64ad71952530b7c8 coorect mistake in use of ffglut (remove if FreeFem++-xxx ) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2908df13bb5439e65a59b907fb94bff0ed691aae add stuff to save window buff. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e316f9221c2bbbe8f6fa001f6b0a26c9cc6a97a4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa518ecf1e20e14291d5cce75d655db422173343 correct layer.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83f9e17243636fe223b476d0e36931b3d8724c8b coorect glumesh2d load (now in freefem++) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 240a7ceed1e2a9bf2489f5d214929c39d1862561 update to 3.0_1 testing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7c2a7c0b23f08938068d3eb196358685aac70d3a past to version 3.0-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6befe83cceee60daa708ba0462201d27a6d7aae7 correct FreeFem++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5ba679d46b78ef9b2510afd471522513814c8efe correct of missing io | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8b379fa0198383da3a80b337689b2c4bcd8f6ded coorec tmiss tapping | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 48e7c5fb6d9adb46b1c76f43e8e42f7cc0be5057 add window stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9420623259872aa95c8baaab98dd6ba4d98d5270 correct sing flags with PCrgraph.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 86b7f831da0bf5dfed89071e9de8a010aa863081 correct miss tapping | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 69206190482aa50545de637ea21fc17c11a0b067 add @LIBSNOCONSOLE@ to link freefem++ on windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 45b635ffc520e42285a518523cb84eeb1a5aa1d5 yntaxe err. )) -> ) line 51 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e2a6d35f238e6e1374cd383cdb6a0135b5ed7821 do the final (may be ) on no graphics | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 24c52b227d7bb2613a01088f725202cb6139e3f0 remove -mwindows flag | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7acf529cad103f756bf25e062a46b6ee7d3a963e try to have good version of ffglut | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ff87b1481fa86df9914413b366513a646fbfa73 correct for win32 api | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 510af2a1d6728301763929e4fad409d8b7943ade crrech ff_glut lib under win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d9e81387434e6984391465c0d0a6c39e3b22a4c1 change glut libs under win32 (no cygwin) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 926ebce507641e844c7fce04460b963543f1a8d9 add new file for win32 comile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 300fd329d1b62e2570fa5b1dffa4a60cf5eb5d10 update for ffglu and windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3c97e45e9c9b3ba65365bc0e87f59d5c95b61d90 correct of win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21685ef5898c49cd2a4327d08ed1238255beadfb correct PlotStream.hpp for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | efe38870a934c60dddb82b78a7dc42fa086f152a reomve exeption | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 711339a21fe401ae9c83ad5aa52f7319d8debf19 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f73f84d4aaba18b06edc8a4671e1147878f5ec8c correct Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4d9c53150380e8013b6965dfa9f2236380ec7957 add threads interface of windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35c6ad0064afb3a1635f3908bed023893006b36e correct configure.ac fo ffglut compie with pthread | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d4cc7ef52462b84362d555770efb6975e56bb5d1 correct int -> GLint in wiewport array type | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1a0e222669f29e21609a275a2c1b677b16223d0f crrect build pkg dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 42fe13a625557ce8bf556f901f7c4d4454d4aef2 add super bluid lib | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ba94ef21cc97a546a9df6f2f68ad0b7b440524f2 correct of the download/tetgen/Makefile makefile. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d98f0ac9cb3bff4b7b75de59e3b5cd31bd04a5ee add missig file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 843e401408e528906166b9955c84dd9028e0568e try to put all download in same directory download/pkg correct popen.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 25e1635d1cd7ffe97277ca251ab57cb42abaf471 add package you ubuntu | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c0da215b5df36324ab81f36bec52d7fab9fb796 correct the sieze of array to store eigen item (add +1) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3aa870d4810a02838417ce3eea0ea004da4b8ba remove uninitialiez assert. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 64912fd1060e1eca8f3867665352b191a7621277 coorect libmesh -> libmesh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d0b5e00cbdaf3767d97121116f806ba6ff1ac2b1 coorect Makefile.am dependence to bluid compil.date | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 034cd65100ef78f2aec32b028c7f1096b6cbf5a9 correct ffmedit Makefile.am missing bluid of ompil.date file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 77fb4948f1e053f9fd9f3788fb19c240aab947d7 correct srv/nw/Makefile.am change the taget medit in ffmedit | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7abd6b3de7f541cc889358a69608928c02de20f5 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a16793a7e6cdc9fe44a4cb6d414f7532a762825 Huge change in the graphic part. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 306740a7f06aa9bb6d2ab710c7f92325f3374c24 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 581ffc470ff672fe16ac6bb372c61b65f3a9ac0b Removed file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 14f7ee5d04a7df6ed868817785f643c6274042e0 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 78171bfa460512b5472064e475103f17e75b8eb9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4bd66fdf4d50866c39efb410bf1e74f7d9983a4a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d56ee9cf1dbf345813fde74d165d0d563ea7a637 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aaff3800f6e2cc397ebc8517438f324b02257d38 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0b73ccc30ce568e09cf39115319ed8a28405304 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ecb314ed079af06ebe55c0b239169c273ef122b9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0832caadfe3ab0b6de5556f05f0c32b0e08a5aa3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e24159b7592379f6cee9b06e6c8bddd13e831715 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cf9682e5df6aeb257f2b03d143585d58bf2dad42 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e236a6d2319de0ca00fb7441536c2191f5795b8 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 88f1eec330fc449466a7d471d862a6861c8984e4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fcc102c63d0df0de034b53913ca6aaa9af398278 add medit to freefem++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | df30935b9a3ebec962977cc1c76679aabb371328 add medit in ff++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 077421bf2620223fabf1443a4bae0b2cc403b388 -- correct none sym eigen arpack call -- correct ?: with array and variable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c8144e6f72e7e20abdd6786f23aad517c4c4a317 coorect memory misstake in profile matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84a8f8015882c7f6f3fcf639be671f5b791d3e9b correct memory problem with valgrind. unset variable, use of delete memory. in progress | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15fc5766c76ee97f88b8bf578449a3565af07aef correct low of precision of geom change float to double in GeometricalEdge::F GeometricalEdge::R1tg Methode of MeshGeom.cpp (bamglib) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4290b5eae3788ee85af19a14da1f136f8fc64a11 load in correct .edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d6adb346e972f2772a74d73206bc5755cc73f63 correct 3d. convert | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0e0406c906bbabdaf3355cc35ccd163fc37deff2 correct convect 3D | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 07c8ac6099837edece84bf1faaff320bdca2ad6f correct convect in 3D. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 769d446e369fbb191b0b80a0431df5f5a7666913 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3478fd92ceb0d4c1e3ec8a81d6c3d1e877c9d8b8 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2a1c09c3e55a7c57914036fa2fada351e44a11f3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 364bdd0da5c6b802e57b57cff01ca0a4de563342 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c88640ba6625b217a4b0c77cd98e9fe3096feb51 correct PB on win32 version with P102_1.o (bogus) so remve because not used. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 803776fa31f0152fe321e400da5d004b6abd9b87 add NSI3d-carac.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 17e4dcd206a68d1c7867d64b7a8e802ea7025a6a a fist beta version with 3d convect | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2262918c4824ba92f7bdc43620f98d8d330f2657 correct in case of more than 2 proc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 85d1bf0e04b52b13d88db4a8d667e2275a568a91 cleanning mpi output | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1d689bbf0a7a998bc7fc17eebdc147bc1696cf92 same | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cee37cd80ead79ed618e755bb0451f49618b57f7 improve output of end mpi | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7bcad9108b389fa60db88ac351a8b8076bf20ee7 output clening | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fed76e4c560143d99c0f31be2ed2e2617ed95da correct MPI dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3a1edc8e06f4947f90a082e682cf0dc0d0045f57 add new test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 142b498351d049ee2b846e44aaddaf2903d60bb9 add meditsol.edp test (bugus) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7e08ba3c1be4b643141e88335df77b0c190f5f4d correct popen.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd93d41070e1764c5d6a0a77b70b8c273ef5658c add popen.cpp of medit link | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d6ee58b2102f049bef0a7ac571258b350cdb0021 add convect 3D | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eab6636e979311f25983f6c098058a293a16e86a a beta version of 3d version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1f6fe9551d19ca046ba4e3cb3f2f41a1ac61c43d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3a252418466fba50328d1e644aa0af6a43b0b0a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 51763e51907149ddff56f74449188e4ab6516c13 correct CXXFLAGS for load.link | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 565544f99af76e33fe347fd98a545f7f9defbf0e coorect algo.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0b0f39ed29695348544e60d7f324285b15ebee74 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 48bc0adfddbcb54044e61eb9b6793c6fe950934e add new 3d exemple | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 36b074bd1bf7f6605bcde9ea51d1048191a21eec *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 87dda1b347de481ebd7ea41b3a502a606b4e59dd *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2cba76f751d7154eccd30d6a6621bdbd2704b6b8 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 66325a8add32b2652ec85921d5019097b218952a add big change in pointer cleanning of mesh. correst mistake in doc thank to P. Ortegon Spain. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 39c8cb4c3b57a22e45afb87b8fa8b2859ceffa36 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e173ec58668d6263043c3c4a36ef1eb9feaa3ca1 remove const char warning | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 499096140a7e4e96d8c9edffeeb69d8727beeeb2 remove tetgen part | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e0a5f6fb65be696bc2cfbb2467ce9f85337a13eb correct FQuadTree construction | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c1a3af5915b219af3306b52a7337bcd466a0f895 add constructeur dans FQuadTree | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 34fb3ae667fca12b4ea87a6e9da291bbf85a86cf correct RdtoZd fonction | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b94c9ddec49687d1e916809f8a5dc8cc140521c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 75a7bf992fdbc369dab650769462cda4c9dc971f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c10db2c80ae131062902db3003b50b3583fa0e2 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cf987b65a72fa8b85a0ed9c177ec1f7c4c29c5ac *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0ecb35ba122fa820b1f050a9c240c8ba620ecd7 remove of cout | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05704d431af37d9509247428a6206069e67ebfa3 add missing logo | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 34da6a9d9e11e68c5bd3a11216e29d522e420f71 the alpha version. 3.00 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23dad3e592bbede5a8da3f329583eafcf4737939 add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80180963ff4a4d01eb4e1278caf62ee1dff506ff *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | daf9983cc5115929651b503486272b40d41ec967 add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b2944e60539b6a0cc50146b6b5c490d84387c379 correct examples++-load/Makefile.am to add dependence to compile glumesh.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c7e3be1cfdd4c6fdd36fb9eb6e3728d37ae6af37 un version pas mal | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 511bf09e2db81071d766256df34a404dab3e8319 add true random function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 57df11a7f5397baf2b654664817438b68fce7b42 coorect error between R2 and R3 stuff. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47238ebb9f6275c50c980538c40a188d78eeb3b1 coorect missing patch-lapack in arpack | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7d92b10e4e8b1c7f98dedc0b045b86ee571c590a add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ce3c479f53d6416e1487e2556c07ff63005f321 remove arpack++ from freefem++ rewrite apack drive without arpack++ (c++ to bad) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a81cfbfc2a840e94b7889322d1076f0be873b812 remove arpack++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d7fec3baadec3cf50d902b2c7fd8b1fceb23805 remove arpack++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8a82111ca963954ebaa580afa6b16345f2f8a520 correction g++ 4.2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff01b42cbe5d1cca06ae188d56f24456611c67de correction of g++ 4.2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5fd41ee5b143d826d17bf3e872420967c143ff5f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 41fe168541cda6265e69fc54a2fdced39c405d5f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f81d3887ff42691e193a3efd3dc697db1619f6d6 a correct in FEproduct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d220743eb1b1642c8135952aeeb4d02d128f581b remove dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cc42ea472d5b0a20b3db1d12b09cd59c4b44d2aa the first 3d version running all test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e009b8f401433bf977bd7dd2896641cb4b4c057 add explicit instenciation E_set_fev3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2cc2864d6b90400499a1a8a923d015da07e6bb63 Stokes is working now. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c989cfa4f4a909f2e1b93b944f6a8bd6df5f6ce8 add STokes in 3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9bb3d68232c59cd80bf3c999f9fff57da93fc579 the first Laplace Operator in 3d work in P13d,P23d finite element. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b6f124766b101bb7da3a77b60bd320740a791fa correct pb in mesure of tet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e8212a6f961d7563e43bda087fbb5f21cc5c831c correct GTree Case methode | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35fbab101e232c9a561dbde5a0fe4f7c37137f0c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ea718be0f037d74f535e3e677c1d99ca3ac8ea0c pb case sensitive in include | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bdb60aab46a7f4d0c39fc934daa2a6df2f4aff06 modif for layer meshes. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd1c4bc2887957e7b1449bd4cc607f6148ca121b correct layer | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 62c9d6fbab3df887f53f33f54664e9f1c611808b add 3 files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ccde38f4676e5fe35a1ff2750a9927ec9610e93 add int2d on border off 3d mesh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e88d10eaff9865aeb7ac8809d97004de2d7a4c72 add PBord methode to compute genericaly integrale on border element. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c8d05df5452acb71689e9d2652349a2dbb23dcfe correct class Z3 + Save 3d mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84a533bf233c94fddb2e18efd293aea1f5a8d33d remove strversionnumber.cpp (build by the makefiel) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 391ec38907398cb1d3383617b876e84ce175e388 correct win32 mistake double def + PB GQTree R1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 058a6cff63271290ecff32bf14336bb5d86b11bc correct missing assert def in src/femlib/QuadratureFormular.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 293e0764861a646b2a6d9bc35b22a19786bd4cb5 correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b32cc57a906ba34c4ec9c740ad8ee811c8b323d add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8f8d3fcca5a1679a85c28a1a77cb4612ab13eb31 correct include dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d064d7e77900c9b64af67e7271c5800da8613198 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 333f838040d15630fcb461d61e1895dfae3e345b a fist 3d version, with PB on boundaru contion. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 876d328de145fabdaf483dc7947229af76556a78 3d next step | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 18b0861583bc6d8d18f5e40ad9197ec19ff8c1d2 3d continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9882a82e842a790d975a9cd0142f9c67751d493 a first 3d version .. lost off change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91bc0b25be051dd6e72fd05ca928bbd492bbaace add file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84d52cac19ac3da6cf2ef522ed17d30cf1ea68d6 correct examples++-load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 73358a47d8ee8c25639491d4ded6dcc180945586 pass to version 2.25 (last version before 3.0) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd00b8881db12c35bbeca4562e8a7bc28417846b (tag: release_2_24_4) correct missing code in DG of term in linear form pass to 2.24-4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 32475f9ad3c7acdf8c4e7361da82800e15235a64 see innovation + correzction in doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a83e88a2f8d6f3476cf6af3dd85f7e2ef17c00f4 add formal operator .* and ./ on array [] | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 12714589627ef8f842909c0d3bcfe795ff115f20 correct lex.cpp for parameter macro comma between []. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 10723937d1eb1e0ba4bafc9b63fc58c688683d40 correct eigenvalue, (undo remove 1 line) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 81708f41e3aaee80862af9d39fc6ab49f3315623 ad resid= vector in eigen value (see arpack doc) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d7035edf65cedd69adf42ebade33a0c46b6f68e3 correct err 21 trp in mshptg (pile trop petit) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 53aa4e1027806b215dd6dd4ca84aba974c573c97 coorect missing trap in case of errror in msgtpg | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0874161e2922c9c65c2e9b315ec95e2a6315f89 add Bob Gustafson coorect in the doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3efd9d2fb7df07b020c54d80d0678d3326504109 correct confire.ac build FLIBS (suite) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f473180b075efea1acaa894cf247984b4deb0602 misa a jour INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6e063373c016d32441c06e9067b6ea3ee74bd4c7 correct configre.ac to check FLIBS and test the value of FLIBS and X11_LIBS at configure time | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c34b68b795a7f55a9eae56d68bef9f3f8b87d375 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 59cb9167e1145d15699c90a47c882d1fab5f8b65 pass to 2.24.1 and correct buildmesh trap in case of degenerated border. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8140136dfbd3545204c6d4a52e850e0ef991654a correct periodic condition limite to 1 edge. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 40506feae65554d2c1532af4360dfb975ecc0cac correct include.tar.gz | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab0ac7e98e06edd1be7af0ac6ebbf97fa2c120f1 add missing file R[123].hpp in Makefile.am for dist correct very old bug in buildmesh use with func tool. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f4c5e12f16c9981b35054c7172f8425ffb6a0ac4 rebuild include.tar.gz | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b4a304380a7cf1e5a62115d15535f5d0eeed834 v 2.24 - correct bug in periodic Boundary Condition: mistake in abscisse choose. sometime assert fail (loop). add option to the buildmesh that the boundary is fixe (fixeborder=true) see : examples++-tutorial/periodic4bis.edp - and R1.hpp, R2.hpp, R3.hpp files for the 3d version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 495453ac617c473a86ad7e0f6f038d2f3a1b2c1b add script to download medit on windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c098220c392c3c817ea1c3e627845f8112984876 add lazst modification in the doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ba31f78f460ffa1ec1ec04135c369d3086745e8c add Th=triangule(xx,yy); pass to version 2.23-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a053e070b248d6c345de7a6a4918244c661840bc add info INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eddb9dd965a658edf1384b0021a6b98e07fa941d correct rare bug in bamg (missing initialisation variable edges[].adj | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b58ced0434dfff713745cef823efe891626959e0 correct assert fail in case of no UMFPACK in make check | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e01d232e65ed3ef6b16345004d8109e74c5deec4 add mortar (Neuman to Dirichlet ) example in scalar and parallel version with preconditionner | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f1c831bd4f6bcc519d16d0793f57fc70e9b781bf add vectorial operator ( a ? b : c) on array where b and c can be scalar | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 69f63f71b58371f93307e29756e5d4e2349cb07e correct mpi (receive is now synchrone and send is asychrone) correct configure.ac pb in FLIBS with fort | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 349b9697a90196f699d53f4634a51db6ad1d0f83 nothing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ffce4b5b8829a28f1a23c085fb131d5cb229de0e correct README of debian and cnfigure.ac of checking umfpack lib. correct a check message in problem specification ( only on mesh par problem or solve). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd685f9d9b4db1762aa2175932e562e545b743d3 correct Makefile to build universal executable file on MacOS coorect readme file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2210018714acaa80fb3c003557f3ef55e9d2ceda cvs ranlib and ar in umfpack compilation process of universal file on apple. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bbc0d518bfb396b113aec37b81c9fa369a5b9c9d Make big change un configure.ac and makefiel.am to build universal binarie file on apple (ppc and i386) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0b834997429d3a1dd0b7315d403f7d70a809b1e7 correct freefem++-doc and add default font 6x10 in case of no 6x9 font in Xrgraph.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 78ca707fd32795055ee84f01916b5eb506c19a9e missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 04bf69350959b118983b8e2f31ccce07cc591b64 change ref value correct elastycity. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5581f422b1dcbd8f03aba694d4aaad0ea396e3f2 just change in UFconfig_mk.m4 for freebsd for comment | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 76b52e94450b634b8a94b73e5f3a73752f36b4ca see innovation correct bug in function with string argument correct mistake in elacticity problem. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dda501dbf8e1b6b4e03f415b3697d892eecd5085 type correct Pcrgraph | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9564d5b573dbf685e841d173607b101b4bff63a correct error on mpi version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 032027fd2d0625783e9164704c100c0251b993ee suite | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff73f724323b904529f88ee9aad8bec90aa51aa6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 57ae1a54e669f6aa98138ef957396c0e56b5110a next | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 06513dd4a36439124d2863951b3b1ce48049436a correct missing preprocessing variable | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b6876eff52728bd83b41c163e6a0a5f7f1d224c correct configure.ac for umfpack (sometime missng a library) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21cd7a0a804a2d8687fb7a370f5d734cb7ece51a correct missing tapping error in test build drawbdmesh on windows. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 707da88c3c1bc396821b30326592eb27b27b81be correct bamg on windows missing drawbdmesh.exe | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 59d98265334980dc43a5912e08d2ddbae3c43911 coorect missing exe extension on bamg program in confure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8271c60afdcf718577d476b6f76d489a0d67ab6e correct mpi for macos leopard, remove CHECKPTR in case of optimize | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a3327177c97d36fcc8747c96c2b196a56fbdf90 correct MPI configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab36ff3fbaa1beecb33607daa62869c360715be9 continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d9512e16fda895fadeaef429b6d5240d98f1933e missing mpiprog | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c633266c0495e23ac2677a0725da55141d5546b1 correct configure.ac missing FreeFem++ with X11 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | da97a0a23a48252298df1c742b34cd5d9d101047 correct configure.ac without x11 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8f83fd7ff1e5b344fd62b0df34e44fd7becf9894 correct documentation for new edition add better check of X11 and UMFPACK | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 104719df059fb4074351472fa873c574a32f98fa correct doc, | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 874141f5fb022134be0dc3359cdc216a7a2e5762 see INNOVATION file pass to version 2.20-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 29c6a31d48d000c1926d02501f341e8367ddcb61 add format + - , trace and det of array | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c3207b096e15ef7c47d5ae82da78bf1c29b88b2d correct missing parameter SolveGCPrecon and SolveGCDiag | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d4496da8b20576767471b94a8df52614cf0783fc correct miss-spelling CVS: ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e6793edc75bf9d41332b6df546b40093c5e2421 - add in download automatic generation of f2c and fort77 to get a free fortran compiler just go in (download/f2d;make install) - add automatic find of libf2c in case of F77=fort77 (driver of f2c) in configure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5b6e160b2371491de1244fdaf897b413aa114935 Add sparse solver in documentation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 096861d33a1b031941a097dec4f2e394ea7b368d add SuperSolevr | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e033c7f2b4736353c5745bfb75a00c1366a3dc10 add f2d in case of no fortran | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6616922e88a0a0bc0740c18a12064e3efb7025c0 add f2c download | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 26645bc70ea8f89b2dd49f7f36d7752aad29dbef recorrect operator += Virtual matrix operator (introduction in august) symptome : Sous CG no not converge. (tank to the test) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 784c2fbc28904c95f2c2068548b39651c62e8010 correct SuperLU and UMFPACK driver + add comparaison | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 67560b7859dac471aea20f66d5eefc25625318f5 add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 117447c5414d25fa46c437db5aabbff8c6365eed correct 2 def defaulttoGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ecf5cebe2c2c34d3735876457458d23696f90002 correct tool to add other sparse (morse) linear solver with dynamic load two examples NewSolver.cpp SuperLU.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 936fd83ab1139032ef83dbc8796dae8c8eaf8f63 add set sparce solver (morse) set version to 2.20 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a2d5aaff2184fa6a2e73dcc9a62c38a2f1bb6f0 correct complex part of superLU | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b7e1866e37c34df958e6f4502c124cb093cdf169 Add tools to change Sparce Linear Solver add SuperLU driver in example++-load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | db5e5f0f6eaac95ac6cb878abdac9bf7f1de9df6 add N,M in class VirtualMatrix, to correct probleme in RNM class when unset array. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3740dea7ee9e9604618f41dc5a676307333e221e add missing oiperator in array: build array form all operation may be. improve the doc of vartionnal form part section 6.10. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0213a16ab63318e3583a285a12b02ac0405e3300 update doc comtinuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 22aa155533b82d8aa8b1427f19df616c4f8dac78 update the doc. improve varf example. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 93354e81bd5c6bf21afa3796ea05978544636194 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 368e136406872f60969f041b8926779e1ccdf37f correct mean and jump operator in interpolation change SetAdj in MeshPoint.hpp add missing file in examples++-load/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 267db4bf6ad5589ed46cf7a4fec2f9e6c9d34c7c upgrade INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e4de2d49af08b961f0dc09da5fe5496de3e34453 correct, problem of automatic ptr managenemt in plot::operator() | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f1ca0dd0da3443b1e02bb5942f22891ca96f69b9 pass to version 2.19. add tools to get mesh infomation. correct builmesh form bamg geometric file. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8a42c5d3bfbd843c4f35a88af59443391419d26e correct cin on windows and and type on bogus buildmesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a9b4c74bcf071384d9ab497fdeaa6ae8837b5290 correct AdaptResidualErrorIndicator and download/Makefile.am to create dir lib and include | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2bfdbc913fc88e2a521538e9ef87bcad69fd5f53 add missing compile file in example++-load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2cbabf9e29b409e080b389161fa8d28d14b635ec see INNOVATION file, past version 2.18 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a9d9946f3c063a4dc7652842c3c3431ed554c4a7 add quantile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ed7a2695c77f603377dd47dd17ba47a8d51f0c48 add code to sort array | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9fbde3ec78f79c7ce16d4a2e2bf2d786f88de0d1 xcode projet | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e7f3d9c522c4ad496749e2dc800f08206f48231 correct compile error with gcc 3.2.2 lgmat.cpp the meassage is ../femlib/MatriceCreuse_tpl.hpp:1486: excess elements in aggregate initializer or with gcc 3.3.6 ../femlib/RNM.hpp:223: error: too many initializers for `const __class_type_info_pseudo' | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fc688b9b544d5f6212abc32fdafbeaaf36570488 correct ../fflib/environment.hpp:41:24: warning: no newline at end of file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 196ab09c0cd0ee07520ce91d5d64c262cd9e9fc2 correct bilapMorley.edp add missing term in var. formulation. add test in configure to add on not -lXpm in X11 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cb1f27b3822b2633c8dda1a7a93255aa736ae855 set 2.17-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2532c9a7174511903c1b48679bbea850fea4839 add mesh example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | feef9e717f9596aec019adf6d100991f97f3c128 correct old bug in bamg, in case of bogus boundary (auto crossing) add to to hand this error correctly with exception handling. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ef001791969e79dc1aff3d5cf28298dbdf81836 clean the example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5b356688527174ea961e8f261949c7e727829309 correct FreeFem++-Cocoa to add option -v 0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f53af0c203a4adfb715b1065069025c5e66f6ac8 add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4b13f222f107e191b93c6c435d05feccdb2bf5ef end of 2.17-1 modif | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0348966ea0afb470586f55b2b0993387201c7fb4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1672a4f29ff67c8a3bde1a04c78921a4dde4c93e next | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 50801ce0c6198fad45bb4ab6ef824848170a827a add -v xx on pc version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c6724289490b14bb4d0afb151d6f8273263432cc suite | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 03e420384175f7981ed9b442b2e6b7baab819bb3 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 67eacdf9e0ba4eae0b0dedcf089dbc00a35064e9 clear output when verbosity = 0 launching FreeFem++ toto.edp -v 0 of setting environment variable FF_VERBOSITY=0 to remove all spurious output. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3641bfe3c6fb15bd132c77bdc816ae2bc625f329 correct automatique choose of color in plot of arrow correct double use of $(BLASLIB) flag in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3b8e75156d7f48e7811540b1408dd42a07c3f24 add boundary= ... flag in plot fonction. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 64c45c5e3f103b8c3a58478dc52f17ff09987196 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 776592371f1bd502672c1edc5fb9195a26a073b6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d0746e18324a8d25f6712bac01d43227e537024 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 27a28c2893e927fe1c3a65a96687e30c42c5023e correct mistake in tgamma call | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 61c970bc031799d62807b78b9284882ee8bf57fa correct missing update | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e0d70e4a5a55a2cbfd4d8e7ed6312d52b9cf9ad5 add bessel function j0, j1, jn, y0, y1, yn -- bessel functions of first and second kind add erf, erfc -- error function operators add tgamma, lgamma -- gamma and log of gamma add set and get line,colunm and value of a sparce matrix [I,J,C]=A; // resizing array I,J,C A=[I,J,C] ; where int[int] I(k),J(k); real[int] C(k); | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb27fa68344404891f9280033d1ced89f4743746 same for complex eigen value | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7aea79d56333957d58e2d2d436006550a2e10b98 add rawvector= in eigenvector | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 70fa3c313d0bd58f8197bc5f5df5c159add9f474 correct qforder= automatic choose in quadature formular in computation of integrale | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 39239eeef02ddb064d6dee6487ef672c0783f4d2 just add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 190da640dfb9bc144296b847a533484933f641bc correct Makefile.am for examples++-load/include missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b2ebbe8187050cbede114486a4b599af71fe172 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 435cca00303eff855a08bf44764dc7cd17cd8a26 coorect mistake with libcblas | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a6c1a0e72b7a6e98ba177caeb1cae262be4625a correct very old bug in meshptg in case aligne point correct configure.ac for umfpack in debian correct exemple+-load/load.link use variable CXX | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ea3c3de0fc592077e8689dd4bf26c64ef5ba594 correct Makefile.am dans examples++-load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 099cde5ced8fe0b97ae6f02e9e29f4f6b417593b - Add read sparce matrix form a file - Correct mistake in boundary condition in complex case. if the boundary condition is real in a complex problem then the imaginary part is unset. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c04a9aaee600766b79ef24b4e63a31868463861d coorect splitmesh next step | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f27c184aff50cc3b6e727cc04ac1a9cbe6400819 coorect meshsplit function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1a1c8773af42545b949e3c03ca9371084b7f0d18 correct the variable ff_testideprog="testhighlight${EXEEXT}" is imply error is when building src/ide on windows computer1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4326191e34ba37f36e6acd3843c59e442d9cd83a remove dump for debbuging in fem.cpp ( mesh() constructor call splitmesh function) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c790441126bfda19376ba1e742c7c96a6320414b correct miss speeling and fig ref/label | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 76a13b4abee2a5bdacd9ee425b7e63c91b90eb32 remove all compilation in ide dir if --without-fltk configure flags is set. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6492fdff7c4c009481d3aa4abc899adc4a8777c1 correct error when writing mesh, in case of different region (sub-domain) with the same number, we write just one region not the full mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5dee3f9fcfeafea7cbe49273f5e4fd540c18af41 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e84cb7e4e0eb259044e908f8cd3c482f0aea9015 - correct mshptg.cpp (add swap) , this is used in case of splitmesh. The error appear when the difference of two adjacent are splited by a ratio greater than 5. We can get very flat traingle. - add cpp flags for ufsparce/umfpach.h include | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cfef56a9d16f7a75003e8e0ab898d95ec61fac62 correct ligne pof Sun SS -S vss in fem.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e381ec92838f48988538f91d97e589074f3ec6f same next | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf717163e1a98a1757686d420152e33721d54b2a same continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fef0ebcd787a3b5235529b61ddd49a713d2beafa correct fltk configure process on windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84dbc3e3afb8f0960a19928a25e1c3babd96895a coorect mistake on window akefile+ change fltk dowload install dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e5165cb981b4c96d78ebc80be104b19a36568220 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e48faa7af9d019229be4b5644e63f4d8103f8ae5 add file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1a0761c7c4fc9d690fee55e5f2330f0fc5c70815 remove umfpack directory form src use the SuiteSparse for Univ of Foriad (CISE) for UMFPACK add read of string in file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f1014e0a71712ba013690a365e59d32efd5b7543 correct regularity, suite. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2a235b68b6c0dcea54ea37f3491d51dc0103ebb regularity mistake, suite. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8b378e17eb9b16d72a7c5d7d95ddf39c7fa5340 correct impressin of mesh regularity | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d886576ebf6bc1d5e1c446cada7fc0e2199ba959 go to version 2.15-1, see innovation file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d85ffec33b554a93ea018e9dda1a848b4b2865b3 correct examples++-tutorial/sparse-matrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e0237e493a0ea54d71d73c8340a5e0198af20aa6 correct splitmesh with intenals bourdary add sparce matrix fonctionnality a(I,J) a(I^-1,J^-1) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 841bbcd799d4db1ea5c2284b9924a53c64fb9718 correct bug in vectorial operation (a+3.14*b) add merge RNM package and freefem++ RNM sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d29d649bdfc1bb1f809e2cad48fe258f45fe78a5 Correct integration problem in varf of int1d(Th) .. u_Th1 .. v_Th2 .. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d3277e7f96f17a907fd37792dda726b67124f29 correct licence hearder. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9a41671fd69be05882a82e4e64194545f3002cde correct missing speeling in configure.ac mpi++.h -> mpi++.h for mpich.1.2 add computing linear form of 2 meshes (ex. v on mesh Th1, and compute int2d(Th1)(v) ) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ed9069c2f40a23ce5a6631f6a11388b5c7145f7 see INNOVATION for detail. and converstion of matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8e7257c12a7294159fbe8ad80dd537697a42feb9 correct mistake in bluid matrice from varf with 3 meshes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa5aacbd6e3c781adcf31462fd19ae14d9008d0c add scalar term in block matrix as 1x1 sub matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c38d6a79a1e08e58ffbeb5b8f170b682911f1656 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 57d8a36e9921d104577318df47c0f9fc4d1b397b pass to version 2.13 and Add formal operator * and ' (to day just transpose) on vector [ .. ] and matrix [ [],..., []] so we can write macro grad(u) [ dx(u),dy(u)] // EOM int2d(Th)( grad(u)'*grad(v) ) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 657adde402373c59c93fb424cc6c2ada09d1ab95 correct mistake in function Mesh::Mesh(const Mesh & Th,int * split,bool WithMortar,int label) and coorect mshptg_ in case of sub-domain with 1 element | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e0d55e95dfa2a8dbc438b24a362f68cb89e84ab4 correct when return a local new pointeur in freefem++ function like in string.edp return toto+"dfsdf"; do not remove the pointer when catching return exeption is block see method ListOfInst::operator() | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f8ae3686071da00ac1c9e8d24863855810ee581f add comment | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d82f58e555644bb2652ada124ba0f3b446bc0bef pass to 2-12 et correct mistake in no square block matrix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f6d71c18e22e4ecd8d0e4968cc2d7e392e11e192 coorect missing spell in configure.ac (ff_libs => ff_flibs) (fortran libs) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9659bc9d0b6a2fee40cd99759aa76557126d7b14 change PPC in PP_C in problem.cpp, because PPC macro is defined on some linux. Set version to 2.11-3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ed1ce9d049b87b1efd824d68dc91c176f1e1dfa9 coorect LaplaceRT.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fc73d2fc0e3595c4bec32bc343b5e502f34cfca5 correct dependance in examples++-load/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 26b78bdee7057367e13532b92fbdfd774695b460 correct build matrices from varf with different mesh in case for mortar mesh. See INNOVATION for full detail. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 03b0f8dd2836e2e220cdb6d58021ae42957ef5a0 correct bug in interpolation fespace Wf(Th,[RT0,P0]) function passe to version 2.11-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c84528a7f38106adc4aa2ac1a4a26d9b7ef234a5 I correct the problem in arpack (computation of eigen value) under i383 processor. After 2 weeks of hard work, a found the bug. In new version of LAPACK second is a real function and in ARPACK second is a subroutine (Thank the fortran). So I change the Makefile to change the name of function second into secnd2. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fed85fb15fe8b043259baea831cde3f3315f0a54 correct -Wall continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d06f30919dd7d0f6a198f56d9dd3b1929b3c298e correct all -Wall warning, to try to solve probleme in eigen value computation before add tag release_2_10_2_before_Wall add change the version to 2.11. remark: all the dynamic library must be recompiled | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38b6647c9dae1332e37723549caf903a78e3e933 (tag: release_2_10_2_before_Wall) remove debug dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c48fe403222ec68e447354e5fa4af29eabf71bf correct mistake in configure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca12989730678a81cc47c64c3f1451af590bd20b correct error in lapack of arpack (remove div by 0) the patch files is in arpack/arpack-patch-lapack.tar.gz set version to 10-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 431a341fc88f01cc5fb860ebd8e4cfd71972c720 add flags -with-lapack in configure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eb0405920e457a3dc80b2a2f3984b06fc6a32c6f add HIDDEN PARAMETER to fortran route with character parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5224ada4be823626c66f6dccf4064fe8c5535807 coorect 70 in 70. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11d87497773e07f77a22b568722c185b8febf7c0 misa a jour de README_CVS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 841d1e33ab9016bc8324095e3bd52a208efc8c49 ATTENTION le serveur CVS a change :ext:hecht@melis:/Users/hecht/FreeFem++-cvs + correct trouble on configure.ac with blas on macos because libblas now exist in /usr/lib | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 31dc740532470faa757497b9a395ef39c01a76d4 correct configure.ac for MacOs compile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a96e7f6478e018a9b5bfc266222a05601778b490 change version 2.10-1 correct a ? b : c; operator in case of array correct load.link add new example of dynamic load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c5de46c3d3e4570db59ab3a827edfc534e622c7 add modif in the doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3a2063683aaf4a2eb9accd9fb1755c865bdd34b5 QF continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7b3e6ba7c89307d04e0fe97181089f241aba57b3 add QF gauss Legendre 4 and 5 points to coorect Problem when using qforder=9. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 56796ea579551955efb240257cfee1088d21ea76 change in all source file the LGPL flags. (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b03f59a1a2c0092ef3c7b72370b222ad67fbfbe9 correct tool with crimson editor under Windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2cef51d4dcf99df65188ef9d7a45c792908b561 coorect comment on crimson editor | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a47fd3a5a4f420164600cc7f77a848b44e547e5 bluid HISTORY files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d214254e39d46fe8d824d58b52ea1386e126f365 correct openmpi trouble (async communication) set version to 2.9 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 17a2e1485ad6470fb8b5173a16fc8607db3a8b28 update INNIVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ad2163bbef8ee68a51cffbfb5164fe6443cbf9cd change include.tar.gz file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 556871a26e768991d72ecf9d2c59452b59890efc add format output routine see calculus.edp for examples scientific, fixed, showpos, .... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f8de39045c8167133f0bc64b1aa665b61c3df98c correct configure.ac problem with FLIBS flags with gfortan on macos correct example++-load/install.tar.gz files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff82cabbbf88968a32d10b65254d2c353e7d2bc4 change under windows OS the installed files take the static freefem++-cs because bug in dll version put by default programm in \Program Files\FreeFem++ folder to remove automaticaly new installation (For O. Pironneau) set the current version to 2.8-3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 74598c5373d45aa6d67d579ba994daf8653ecdcf passe to version 2.8-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 10514085ed85ef23c48ba9103b5005a0a39f9a45 correct bug with mpi (MPICH-2) change the fortran in MacIntel (bug in complex eigenvalue) to f2c. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b0113b998c746fde72181cde06e1ef1f3972f4b7 add print in arpack error correct missing speeling ciel in ceil function add rint function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8430d9d6965994b915938e07ba56c68ee94e77c add missing file in make dist process | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 912ffee8f1b35240f2ee31e8a609346403a9908d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d4d5fad6ec91c85bb28a9745ccf70afb7a326291 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0080eddca5b74fc07b22bcdfe2760f24087fbdd4 add tool to remove cadna in ./configure -without-cadna | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b4e7091539f3483eab1d5ff4ab58c889c846bbb6 do correction for openmpi but the openmpi is not asyncromous so some examples++-mpi do not work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b6feb5495dd7abc5baef7daf0fa550a3474cb100 version 2.6-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8451f9591713bf36d0e158eb04b41f5d380a41ec correct doc netx step. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3620fc6a212402e20329be52f0653facc676095e coorect lame.edp in chap 3 of the doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ffe77849d6907e87c655195c7c0eff7e1620ba7e add correction from christophe.trophime@grenoble.cnrs.fr to complie on FC5 with gcc 4.1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23e390d7968a87b2356b85d3f1bfb35ad15449e7 add h flag to: Don't write symlinks as symlinks; write the data of the files they name in OtherMacOsLib.tgz archive | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f1a15da638f86a994491dd75a3791ea2d38941d0 correct OpenGL flag under MacOS configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9dc291e001bf67f3e78f2a2b8e12b74af566b78c correct FLIBS in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 44e4af323ec07699d434e4717fa14631b452508e correct configure.ac setting FLIBS variable with g77 compiler to -Ldir -lg2c | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ebb0ea0b286eb04aacc203f4a05b12165c4f5f6 cleanning FLIBS configure variable in case of g77 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0ce87bb03796bc2ba48b2075547300a865af897 correct small error for New macOS install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9414c310e5db52f6fce9f5e87b19b83e9abdafea correct for lam mpi | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a17afe820fb80b0f897674b6c77e1210ec79d721 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a32c2ed3c8503a9b5ab448fc149ea38f15dbfc3e correct INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ace077277c47e56bda22e08a24977f91726f2a3 Correct bug in case of vectorial problem with same FE space. Some time freefem++ do renumbering of the original space. Thank to Carolina C. Manica | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cea13c2f4402a8cf1ec33894d1958d6af35741dd add missing file in distribution | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35a940e8d2324639a4569f4d8d2ed5fb37e35bd1 remove missing speel in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8cd557513236b3269e6cdc3b86d089338ca26847 try to correct X11 link problem on Linux 64bits architecture | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7da58afb139619e265c6fd953edefd1ec91615b0 correct pb on 64bits achitecture in file src/fflib/AnyType.hpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c67ebb713885ab8e7fc0650116f621202b1ca62b do correction geometric data base with RequiredEdge. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 04a97590a54fae3679533608f2fc26fdbfe6ab02 correct configure.ac : if "wget" do not exist then try "curl -O" work now use FLIBS to add fortran library and not just -lf2c | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 93159f1dd2eff53187265c90d3d396d442865acb correct missing spellibg line 920 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f4f1e028008e6aaa00d24ae17293117598029291 correct probele when compioling with g++ 3.2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c58aab7db1e92bf78fc30169c7a3a0877814d711 correct the mpi version for macos lam mpi | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6eca4948349f967fe3ed957d9fcd8707b68443af pass to version 2.7 and correct missing file in mpi Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 78551d54ae32ee57dd6012aa609889fe197892f7 coorect misstake in rc/femlib/FESpace.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 18a12454e23f3bd1d73490b9ecdc8e99662b04e7 correct trouble in Boundary condition when we mixte some composite FE et atomic FE. Example: fespace Xh(Th,[P2,P2]); fespace Mh(Th,P1); Xh [u1,u2], [w1,w2]; Mh p, r; solve stokes([u1,u2,p],[w1,w2,r]) = This imply change in FEspace.hpp so all tke .dll must bee recompiled Thanks To stefano.micheletti@polimi.it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 909c46aef2b7704eb11e70551e7eb7f92e12eaa6 remove check suffix .edp to be compatible with drawbdmesh.exe | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8fde9dd199f02fd46879f3f29b6b49afc23a8311 add line un INNOTAVION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 750a157877bf2c13d65517acbb1340c8765087f9 add bamg example an correct problem beetween bamg and freefem graphic set the version to 2.6-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a8fd7c5bae8e6296ae5f923bed100a158ddfd675 correct load.link under windows with new list of .dll files. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9ca61464ddf9e25f7440c29ac1b3224f702bc40f correct load.link script (change list of ff++ dll) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d563c0edfece9d6fff885743d44538660738740 Now the all.edp of tutorial run under winder (very hard word). FH | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b65cd8a1c284a54050d8f4c5a4ce89dc15af02a6 correct bug under window in Mesh:Find (very rare) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2de00cab3ef8b13b087ca36d20c6f3fb09db2527 change for window free/delete pair | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 247f1ad791c90708a55e1e4df7ec5ed21a3efa85 the new version of the dll file begin to work on windows (no trap in alloction) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 852ef1602378536e9d4f8d11b71d3e69fdb8ac0b next. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fbc04fca48176d11da7a711cf247b297e4c6f252 dur dur Windows,  | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 589a905fb3337d07715398a173f8007a2e5f9e35 continuing malloc/free for window | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d539001fca88595165450641c734357fabaa58b5 suite?? | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 479c3f5da8ca7c6bbbaae2a51bc34134096d38c5 suite, .. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f87caa9e2dbc3e02b09ab6995926bca549956fe8 in progress malloc/free ?? | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 609718889bdde8c468dbce95cba53c1dd7c7608c try find pair of malloc /free for windows .dll | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5831d04fe0aaf67fe668d445b0bd2005f954d416 make change for windows dll because the pair malloc and free must be in same .dll (file); in progress (very hard). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa6e150547ee211a16c0de45866420a2d54d8204 correct missing delete pointeur in a=vmass(0,Vh); where vmass in a varf and a real[int]. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d5b8ae47e960c2532c8d00b78c0ce6b96b37c66f CheckPtr add flag when deleting after cleanning | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9f6bf7e94a78c411b70f4ff29d72b27035447cb6 remove impression | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e7742106167e1d22459b1f6afd766c139b335f58 add cfloat include | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 12d4b5f2c72d8b1a710100162e40cb76059748c0 add missing include climits in src/femlib/fem.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | effb463b83c7b447bb1c630d212e7832e4379b1b correct mistake in interpolation procedure, (in Mesh::Find methode) complete writting (more clean ??) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c26f081d2e386dc4b3626a4a023f0f6877b86fa9 correct bug in freeboundary;edp (trap on windows some time ) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 153b11f00fa102a9045ca5a904e7894961a389a2 coorect consistance beetween movmesh and checkmovemesh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7fd3897b5ef4c9089fb8b55771db85ce0a9472ed add CR at end of file src/fflib/ffstack.hpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 88788e49b9d130422cea89d842a6cdb8e4caae6d correct misspelling | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f08c34113097957e9311fde4da2bb7ba62e35723 pass to 2.5-1 add vim color syntaxe file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dec8574bf0708c26cd45923b329ae87d88705a50 correct randon error on window change newtow in newton nbev= in nev= add key work in ide hightlighting | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d50abc72b9fe45b997185c5bf72b2e1a5956cb5a add bamg.exe, cvmsh2.exe and drawbdmesh.exe in Inno setup package for windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8daa27acc92818176fe8b4aa489f536ed56043af and bamg and string_def.o files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 19ef4547fee3a272f84cc3f7474fc73513e441ba add new example AdaptResidualErrorIndicator in the doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bbb7afb0fb0eef4c9f2a6d30f9501f451701cbc4 add ResidualErrorIndicor example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0c6c3ee803b7ada14d57548671bf4e3c8a3352b9 add 2 files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 303fc3afbc3233c006329168463b17402d9c9801 add string method and correct bug une string parameter. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f162ff830d91fb234a2f8f506ffda906401d5bc2 some optimization on new auto free ptr. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ac509787c293982c593a0113c89d71a2adeff503 add missing clear language ptr in while and for loops. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2e48e8f789860f37f3f8877c3caf755718b58196 pass to version 2.5-0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c33e87afe0d240d2f6391111a5afa46f64f28d0 * add automatic gestion of free language pointeur to correct to correct bug with string argument in routine. Very fist version, in progress, to day the job is do just for the string type. Now the examples++-bug/bug-arg-string.edp work find. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b3ea63abbca8fcbfb8c8303ad4635c73c074476f (tag: release_2_4_3) add mode for mo text editor on MacOs see the freefem++-doc.pdf for full detail | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 66184df615c8ec9a6ce685361e5953ff55c683c0 add freefem++ mode for mi editor on macos http://www.mimikaki.net/en/ in mode-mi-edp.zip archive | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d79ae307dbe84b61a1d3ed0afaac39704198534 * add lot missing vectorial operation with sub array * if u is a complex array (i.e. complex[int u] ..;) then u.re (resp u.im) are the real array of the real (resp. imag ) part of the vector u * in block matrix add utilisation of array to build the block matrix see new Laplace-lagrange-mult.edp file to have an example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 323802d060b427b19941516b9ddba95ad2da6c48 add init of array with a linear form. add vector and matrix term in block matrix correct missing conj() in complex block matrix with operator ' | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 39383bdd417d28ed95cd08f190bf3c03518532c2 add missing operator on sub array (type KN_) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3d0fe436a73273a4c71507c710dce3e5365187eb add new operator on complex array to get real or imag part complex[int] c(10); real[int] r(10); r = c.im ; // imag part of complex array r = c.re ; // real part of complex array add florr and ceil function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d01b1e8caa8fd41f76abb7922872bc4ed312a5eb add x=exp(y); when x,y are array for exp;log,sin,tan , .... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eb59b2eba7991e2f7be91ed524c423e0048578d8 add new kind on interplate matrix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fcfaf7bad32eb0f4ede4647379ac9d6259ebab78 correct freefem-doc.tex until page 29 example 6. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cae770c02b8dcb2d510dd7cc9c152c39a006c934 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 293b09d316f2d970eb2b23d25c109e31aea0fe82 change version number | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 88ba912ef5f5a3afade2cb978abeedb9b34c377e array of matrix work now. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e505f68aba2fb17d2f58d28ffd007b1cf9fadc71 correct error in build array of sparce matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8f0c447591555eb93cebd10403545f291ce906e8 pl with matrix arry -> remove | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1d9e58e21c6927c57accd1b56e943a5b40b74936 make big change in the DOC with O. Kavian Add array of matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3f0a2a2298ee05782e16ea5dc984615571f332a6 tag release_2_4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 881b1f3a36ada4bf6ce706d66c266458212a9e17 (tag: release_2_4) pass to to version 2.4.0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 789e0a7333daa22034d239be5f56b20121a20fe6 same as previous commit (just on the top dir) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe31be147236d0f54d6fca25f5df3106be46f353 add new operator outer product, change the doc, .... pass to version 2.3-3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 36bc318f335c5bdb684165f16e09168eaa24a3e6 add matric operator like in matlab mat(I,J) where I,J are integer array | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 819e2631f649591c8a20a75a6e39f8a1f362d66c *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fda571e27713073fdd7ff5454d9c9f30b411642b add an exemple with 1D lagrange multiplier. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68b9fcda4533e4d3569f14ffc49f6c05def88e8b add out product of 2 vectors to build full matrix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6382d5bd7d7a4f51a7b44f886ccd603c0cc2e0c6 Debian packaging for version 2.3-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11514777e559ca0ebecdf9221309a994bee48a4c correct exec on PC | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6665434b52f0f4c85a16808fca19b13d5bb092a3 tag release_2_3_2 correct print mistake in gmres add drawbdmesh program in bamg correct pb in bamg if the subdomain have only one element. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf530cfae378c141771e02a88f30712f129c9e5b (tag: release_2_3_2) Correct missing sub domain problem when we have only one triangle per sub domain in bammg mesh generator. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0851be17b45965fbbcccde3d89b2a180f89709d5 Improved "make clean", which did not seem to be cleaning correctly anymore. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9d0cbaea19c6cd08c573f6d40e98333287dd855b add configure examples un README files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b28f2335b416c0a686f9913714883fbe27773ebe correct miss spelling, and error in configure.ac --enable-download have be automatic set but it wrong. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 098cf39ee8338f75f084fbbb7177b36c2524c93a reglage in the doc, | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 19cca338c2c9d0514070ae9e7824d9b4e1dbfe5c add new example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5ce91ab3ce86058dee21270124a9353b131aff0d Correct missing free memory in case of exception in problem. add tolpivot= to set the pivot tolerence in LU,choslesky, crout factorisation in problem, ... function. change the test of return UMFPACK status to be more safe if the status != 0 then we get a error, see the UMFPACK doc to the full implication. Write the change in documentation, and add the 3 new keywords: try, catch, throw. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 364fc8098d22da408c6dcfbef2a8b699523daf40 add exception in freefem++ language, the first test is working syntaxe: try { code ; } catch(...) { code ;} know bug in memory management . | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8667edd37e95b820293efdaf3fd84fa37d533b6a add conf flag in README_WINDOWS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c8a7b34de1310b7aa8d3d0697cf3385de1d781ff correct missing bluid of lapack in ARPACK if no lapack plus add comment README_WINDOWS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7b19abc83e2773d78a3c344a9f8a4d6b64ea9162 correct missing include and link order under pure win32 architecture. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 534f667297d522370a0723dae55784b29e0432df correct PB optim on G4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b5d9a8307308dad258bafdb9f929a3cb2d3c1586 correct PB optim on G5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c48cc0d6e8c666f23ba4bb1a55355bad21cdc8ba correct pb in configure to find wget or curl for download | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 808ac6ca9a7fa89b9f02b0eb07fe76a37829b6cb remove highlight test is no ide | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 065a96f49057f96153dcaeef0971f5928540a6e3 correct pb in installing apple version (zcat -> gunzip -c) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d510d72ebc36c401247bbf71c33c656b45c366a5 take account of mac intel | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 16236a84c344b136e0d252c6c002f5c5f1ff5720 add comment in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4caecb745bcefde3d5bfe7dc6f0dd695a6d35da9 correct small problem in configure.ac to build freefem on mac intel work in progress, we use f2c / fort77 to compile arpack | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 70b5ac6d9504713cae8dcd5f99e94d66071094da correct xcode projet + warning | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f15e89c51cd7905f44d69d54604d48c76bf3b8a9 add xcode 2.2 build project for macos (see README_XCODE) add init file to set paths and do load automaticaly dynamic library see INNOVATION for full detail. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 278f503da8ee45a5cd9e2774bbea621716714d54 small correct to use xcode of macos and to build bamg shell command | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7c5d07d323bd4913cafddc5f9edfa88326a704b6 Changed ARPACK library reference for static compiling | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b6100d4f8651cfccd24a0c7bed8e46c3a4e2ee71 Changed Debian packages documentation format from PS to PDF to reflect changes in the DOC directory. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 40eb1e89ca61d87dfee1d5719f155f223767f939 add building of bamg and cvsmsh2 command so now bamg is a part of freefem++ software | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 377b6e557378c8bce96815d352e64f00b4197872 merging the source of bamg and the the bamg freefem++ part | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 046962e50433f6f61571e43009fa2a3cd27f2cd4 add read bamg geometry file with buildmesh function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fcd274996477fe72218314724fbbadb3d1c8dde2 add build mesh from bamg geometry | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fec7ba1729d4291653675c0bb3dcc447895c73e8 New Debian package. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cfb53cf2bcdd32844426f62218a2a3a17f6f624f add forget file distribution | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d45bf2eb49d12657da919399267a517bcd9d5a5 correct pb under Windows change environment to ffenvironment (Global variable) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9a0f7fe30ca1af0690f6df07a47315101ba70698 pb global.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 478cef2fcfbf90f7abe889f41469a10aa97c8a15 correct compile error | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6f098462f4df2634903d752030c4f89a5f11b87b correct pb uneder Windows with environment, put the def in Global.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c1550aa4e416da0f368ba063692cd3ec9445c6f The search directory of load and include seems ok. pass to version 2.2-0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d0efe8abf955ea02d84a2a0b05da1c1a5e349d44 correct environment.cpp under Windows (Pure) and add to bin-win32/Makefile | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 08c64dffb23098aec00e7aaea6640f7f51e0243e add 3 environments varialbe FF_VERBOSITY, FF_INCLUDEPATH, FF_LOADPATH remark the separator is the ";" (in test FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e62e47d6dd01c21a78a5f36af3979d43799ed1a1 reman NSP1BR.edp in NSP2BRP0.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b5da5df1816aece1ce249dd9c63f7e9c14539e12 correct load.link (return compile compile error). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1326fb899549526c4017b1ccbbf4bc86125aed0e add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 859827b8c5421933fdde9c40948d64ed229e8955 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8c45e963fc3d6a820918b4abe6b880d7cbada3ac I make a huge cleanning in the figure of the DOC Now, all the missing figure is recreate in subdir cpfigs The archive is more than 3Mb less than the previous version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0710570a01ef555dc948cf043fbb8e4443d9062f correct the example++-load test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 886e6c6c6c832e6d3e901a4f0abdd65ae3386348 Add two new finite element in examples++-load and change the doc for add new finite element and passe version 2-1.3. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 50cd7a6108093c031a8991e859651c35ce3793b6 add new Finite Element Bernardi-Raugel for Stokes or Navier-Stokes equation with dynamic link in example++-load | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a59a322fdd3b2768bec73612c11602287cccf670 Correct problem in boundary edge (lossing label numbers) in adapated mesh, savemesh, in case of domain with internal unconnected boundary (Thanks to O. Pironneau) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8326c3f1fa099fa05bb56a6f7d52185ac93cb523 Added first support for Doxygen documentation. Inline comments still need to be formatted to Doxygen standards. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 95b30ca71cb1842c09c420171fe2f70da0572c6e Changed --with-suffix configuration in configure.ac to avoid adding a single dash when no suffix is needed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2891a48a99dd8e5e4c57461d7f8fee59a46e3624 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 52be9ba92bdff6ce02b8d3382fb9846c755a060c correct CCFLAGS in umfpack for test | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6d79385b24d6a35c9e4d61c9a7206c5dd38919f add number of parameter in OneOperator class to 10 for F. Dortu, and set version to 2-1-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c47e2972cc70ad87853134c0bf5aa1ae81aa6275 symbols still showed in the Cygwin (not Mingw) version. This is now corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4edf961023b445627f46cc19396cc3597f8db93e add missing files in DOPC dist | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce8a7d6ac5c7e8b39393cc52f1197b62ced11912 New Debian package version 2.1-1. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | df615c290d19ea6c999e6d64c1db4c28b68e0407 Removed option --disable-tagging from configure.ac since @TAGGINGDEPEND@ is not used in src/fflib/Makefile.am any more. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fb58bfefbd8c63e2e85dac459aed6eb0936d9e1 correct LIBRARY problem for umfpack Demo | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4bf27b9489a7fbc464e61022a5feb38c771561ce * correct mistake in quadarture formule in integral computation (nota in variationnal computation) we alway use the qf2pE or qf2pT formula. * correct mistake in umfpack makefile. * set version to 2-1_1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff781ab94e19d563c7d8c1b86b6a1cf60742cc71 correct problem in umfpack with cblas | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7ec8be9ba1e4175d70951938d01e28c23c48db3a correct mistake in cblas on configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | affde076f2766a94d6635465607e8932dd19e1c3 add new file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6887d34c4ac51178ffd956db6843f80ce0cd3831 Use umfpack 4.4, and correct some mistake in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 61c67d076356a0073a8cb06819bf618dee5317a0 Now compiles with gcc (GCC) 4.0.3 20051201 (prerelease) (Debian 4.0.2-5) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 92683bc46a0109106860367ab1cfc1e1c2674597 Add the generation of an error if you try to set a solver on none square matrix, to remove so segmention fault. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1eb50644304b87d24dd4f024ef8b055bcd43a2f0 /tmp/cvsBIs12d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb8ebffe034b4ece3214568780adcf15b5576467 Now dlopen() works even when ARPACK is downloaded | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21414206d743a99eeee5faa0aeb0663b0fa91c8b add optimization of a*b expression if a ou b is zero. add new state of expression (read only) of optimization | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 023e548a336085a1c0c75f64bb08b29aa460f89e add roland correction in the doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47d25e351dc622b21a43140d99a5bab6fcef8129 Added examples++-chapt3/all.edp into cleanregen.sh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d116fad73d39b85d81b5d45983435645f85b160a correct problem in algo and Newtow exemple (forgot 1/2 and 2) coef remove duplicate examples++-tutorial algowithmacro.edp , ... add lost examples in chap3 dir try idea for memory management (ffstack.hpp file is added (in progresse)) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0c3cbefcd43dffafa8cccaa6c2a623cbfd93026 Arbitrary "wget" commands and parameters can be defined through the configure.ac script with the option "--with-wget=xxx". | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 95299f7d2d5245c2ac8febc5fd1b61fe4990f455 I just try autoreconf on my new mac. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11f5818c729e99ad5807e067339bc3157dd4e373 remove the wrong BlackShocle.edp example correct mistake the gradient and hessian computation in algo.edp (forgotten 1./2 , etc ..), correct also freefem++.doc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e4edb829440458e1424afa21b6d42d8d6a53d11 correct the following trouble when we write A=vNS( ..) where A is ma matrix and vNS is a varf old version we build the new matrix and after delete old new version we delete and after we build Thank to Denis Sipp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c44e64e1d4367713d9b8416fb74f85084a08f87d correct probleme when resize of full matrix, before the coef of the matrix was losed. correct missing in the freefem++doc.tex in quadrature formular. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3cb7f1780cf0c1d58ab8d4af987dfba12c8ea51e New Debian packaging | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b450e2ded9e21841c244ce84bc3e18d217db9d80 Changed Debian dependency from libfltk1.1c102 to libfltk1.1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3cb5ca53f22eb602dc454d966d740ffaba4db7c change in grammar lg.y misplaced ternary operator | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d1d0894d41fbec399cf8377cb3039280905220ed uodate INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e830fd6cf3b42784f25fc58159a8f7dc7ffcc42a change the tolerance value un mshptg form 2^-15 to 2^-30 if the computation in long long if it's possible. this correct trouble in trunc, splitmesh, triangulate if the mesh is to fine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3a5387a952eab780145eae462e56fc6a0a14e36a add files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 28b57d7c6f31a4e107e8e991025cf8cb859fd96a addinf missing files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 90b0c6324eefa6932341a3b8c355cdf7a6f3f5b8 correct small mistake in the doc add --with-suffix to build special precompile version under mac and windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 975e6466c523f39c356515804797ad8ef0564ca7 New Debian packages | | | | | | | | | | | | | | | | | | | | | | | | | | | * | de7a422504b1e2ac259c7fcf19df687a195af361 correct windows install file and load.link under windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f250d3c981893fbbaa3911d2971883f920f2aa77 correct problem in array operator /= add test the array.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47c34442bf0bd1121952461e118f9851c502f393 correct src/bin-win32 Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3833712633ecf4c17e4bb764826dad97fa16ddf4 split AFunction3.cpp in 3 files array_{long,real,double}.cpp to solve ld trap under cygwin (memory full) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 802f7a04a013af8cbb0846fb9470481639b5ecdb *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4e8d69b505615590201946a385731d6fe8bcbcf5 - Correction de bug UMFPACK resolution complex problem before we solve conj(A) x = b and not A x = b; - add tool to compute classical norm of array l1,l2,linfty x.l2 , x.l1, x.linfty (see sparse-cmatrix.edp) example - way of get all the coef of the matrix (no tested) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 64806c29c8e978b645307ffd98e6244b0bafb861 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b9cd9a2e2722da25637be042749c7b8f723a5c0 correct problem in eigen value computation under Windows (infinite loop ), change compile optimization option of LAPACK routine see README_WINDOWS for full detail. ( version 2.0-1) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4b548ef98d4c80eba80dfce2ceaa2e3e5abf369 Change MPI package name to keep up with Debian Unstable | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 998f3adb54061c8d669f3e0e725472438262815f Places examples++-other last because it contains speed tests which take longer to run. There is no need to run these tests before making sure that the other, faster, tests work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11408e0211202f144cbc8f2738c51c69d070f18e - Improved the way configure finds libXxf86vm.a - Added support for types like "Vh[int]" in FreeFem++-cs highlighting | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0dab78efc0698b6afa17f1fb5921b2431449a515 Try to correct problem in win32 version random trap on very big job (all.edp) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0d569b0e8e0ef0f1596f436b91346234b056279 add .edp file in example++-eigen dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e13a85bf9ae61da9f223348121110856627c6e20 Compiling with the Cygwin DLL is now OK again | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb69a18772da3f77207c516f3984baa0bc733c49 configure.ac now dynamically checks for libXxf86vm.a | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 344c94c2e092b5e10bec98c3059babdde3be4fec New manual included in Debian packages | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c33fcb3a2d26a2b02d7df7ebd2f596857274715 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b6a00ed682dfd0ac122b5b7021ecbaa10c01b713 correct doc file in Mac vercion | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d689679f3aba394f40fe7e14a4e6591b0dfabfab add link on Desktop to example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2189f0f616fe1f554b14e5c21741236396ce6b29 HISTORY update | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7300e8f087f88d6b4fa2cfa541df41d8fa3b9469 Packaging version 2. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c05e6c787f4f302dde1bd641d79b30552f4521f correct misspelling in previous modif | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ce9dc2e620ccda33dab3486a5e7dd9e3dc0c04c coorect PB LogoUMPC | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b934d11979258de4bd0b69b46fc07c1953bad521 correct overflow in elem mat when assembling skyline matrix passe to 2.0-0 version for the book. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 76290a1ab69b33d8d152fda4aba9215bfbb1ceec *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f0851b45c5795b5ad8b1bfd8184b09986a2c40b5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 65f9ebf630a8086a2b9d987e7a0012027918de81 add .cpp in load.link command in example++-load/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a64895395fb11fe199485362e936a4e1002d98f8 correct return type probleme LinearCG | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9bd2146d8c02db9e0a294e1bc7fc5f2ae1df510c correct same problem when passing array as argument. The error is if we forgot & the array type when the array is delete at return time. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 513bad1499bab7f3a0560c65c6d992c14df2383a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6053e78ce50c6be086e8d6d41c66c71b55961c68 DOC upgrading | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c712d07c2d8c02013c5f49f4c41436a0028c7a14 correct small listake in window version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 662b89b2e8bdd25c48ac3a4f80d6d8b63afa8922 in configure in case off --enable_download don't locat to find an arpack library | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0ae23ba8c8488e33c26eb3722f2d3f891e40dab3 doc book continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 553e37284c1070bb967ccf2f9a2359a1d503366d change the title page of the doc for publishing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c3811ebe83cddd86f4b8347c051581b5a06f4ee7 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 36509294b9b9b41cff5017d17ab1059a01ecc821 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b02bd3217a726f66802150ad1fbd2bd3c8744323 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15d039b26ab69c30049f473d9dd88b8faa3b3d38 add forgotten files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 29a9dcc2228a77c4ea78805b1a99436539ace93d update HISTORY | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dc5b6e9e59dafb7cf45e5a5e20ab6ce634dd81b3 Add makefile to build automaticaly the FreeFem++ version with dll under Windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2ba230fcafd07067d855cb03072775c698814d5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c91f3d384f26dfd4f9ee7321b931b28c6f97a3a coorect freefem++doc.tex | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 773c09699172f4ccf4752d67a218893b8b174242 just add mising eps file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 933fc1f4ed1f9f241b0be2359138952e37929b45 do correct in the manual, make big change in the dynamic load, see the maunal and add random generator number randind32, randin31, ... see manual page 62 , section 5.6. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 02991b837f0b73f5332e0c57dd1cde833df2319d correct small mistake in load.cpp i -> j add _APPLE_ -> __APPLE__ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca5066ed08b3d37e279afed4d3d289779a8ff4ac change the version number to build new window version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 88ed54c89cfed5c03bd3ef091c8f0ccdbaf8f710 correct overflow integer array in elementary martix symptome random trap under win32 version on very long job (all.edp) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9dca3d4abaabc10ccb6dee8094214aa632c49884 correct small proble in load.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b44fb620e50c637c20e98083ebebeb01776ebe42 correct load.cpp to change suffix and prefix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0b0188afb225ecc5cca1ee14368d2997e6b081f6 small correction for buildng the Window version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 736b5f56fc148f65e04372c5e8838eb458e8c103 add bin-win32 dir to bluid win32 executable with .dll files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bff45b9a5c5cf7f9b60e18d6c61f3b3e9c4657b6 version 1.48-1 split AFonction.cpp in AFonction.cpp and AFonction3.cpp for compilation uner cygwin and win32 (build dll). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 443c58039a8ae1fb3ecebe7324069cc36e30dd70 FreeFem++ works on Linux (Debian Testing) thanks to the following modifications: | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a1d6efcedbc38c0d4207ad5a60eeaad1b7dc671f correct bug in set array of array to array of reverse + add sum, min max of sub array. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd543ce2e0aa1fb1435bee3df25afc21b03bad58 Added new examples++-chapt3 directory to Windows distribution | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6cbe28a2afbfe444c7c2d0f1f65a6b0b0d86b080 change the reconstruction of strversionnumber.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e1f076a6416ad5f626f3eeccbc3a76089eae4542 create ref.edp file (empty today) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c032bb57802f62eccd277bc72580218150ab76f0 add examples++-chapt3 stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 782ab602080892ad3750818a4fd7c5d581db44ac add new include file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa0a78b0d44c7da53ac2d6b953733dcc06b6f4d9 correct missing .esp file in Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a73a3109c1f75a6ee9b3a93c23ce3565807e78c6 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2fe46c48a59b9a01470f239fad093599d6e49c0b add threehsv.eps file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 52806557f572593cc3fe372272cbe10c1d48f005 add new arithmetic if expression ( (a ? b : c) like in c++ for basic type and for array with integer index (see array.edp) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 08b6b2f6cdad7f89ee53cfafa885a04af77995e1 correct unmissing print in case of verbosity = 0 . | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 858fff5f56575db4e2b0cb88858b1ad445b09cb3 correct color in window version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7d890a87b0090cc4d45c3a447cbd0386d0cfaf88 Add tool to change the color table of plot: see plot.edp example: | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 08a2aeb7124ea406b3c6f919c5329eb2a90586d8 add new freefem++ documentation freefem++doc.pdf ( from O. Pironneau) add vectorial instruction (int rel, complex or int) real[int] a(5),b(7),c(3); ... real[int] x([a,b,c]); // build vector size 5+7+3 from concatenation of a,b,c or x = [a,b,c,c] ; // set vector x and resize from concatenation of a,b,c,c [a,b,c] = x(0:14); // set the vector a,b,c form corresponding part of // the 3 parts are respectively x(0:4),x(5:11),x(11:13) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 90acbb8104d008984359c800d50a7237b6d792b8 Removed "restricted" option from FreeFem++-cs (the Web service does not need this option any more) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 197bbff97dfde052485633866f1a475e4b002b36 Removed references to undefined class "TheSubFMortars" Added treatments for restricting "exec" keyword | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4aab2c786f1147c5176e84f1e17bc50f5eab73c6 OK, we can make dll under window. first test try the scrip mkdll in dir src/fflib the example++-load/load.edp run if all the .dll and .exe files is put in the example dir. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83e4362ac0154d423aa7099eae75f814b3040504 Big modif to buil .dll under window ( it's hard) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7b8579244c4239671a39ce6a7956f373e821ba79 find a new bug in cas if we declare new variable after a break, continue or a return correction in progress, change all the examples in this case. for full desciption of the bug, see BUGS file. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3714a337f677c5ca0bae793bea9aef2ef79ecff correct problem in meshsplit function in case of final mesh with hole and initial mesh without hole. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5aaee49eb035a8ad301c3bd620a20805c5fac03c change version to 1.47-3 try to correct recurrente trap under window, (in progress) correct bug un meshpslit routine, bug threshold value (foregore a square) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 29063b05cc19aebb4f74856419d0907e22283875 Tuning scripts for Debian amd64 packaging | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 49220cae67d078ba86d1abea504f26299982586d Re-enables PDF and PS documentation in Windows packaging after finding the proper Latex tools under Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8639e29a7b110e8fcd661380f7b6d65dfd65ab7 Removed wrong dynamic linking option bug from configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a2e0c15ad87caafccdf01b17b241e2c54b6a3ba7 Added "-fPIC" in compilation options for 64 bit Linux | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8a0b54648ab7c897bcc105b8b3d90ca637c54f88 correct problem in antype castting under window | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 523dfa1e67867472f690efd932aee900ef506534 Removed documentation from Windows executable package because PDF and PS builds do not work well under cygwin and the documentation is large. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43b512dcbdbe5b73ac077eb052d776db703da294 Changed Debian package dependency from "arpack++" to "libarpack++2-dev" | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ec3eb3d8aeaeee0fd131f316ea6604b4078afbf9 Changing packaging procedure to include new FreeFem++-cs binaries | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 85c069b669f4dcb0d5a0e7ac0c8a16dece4d56ca Changing packaging procedure to include FreeFem++-cs binaries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d77a51d3c7ff533c2d5fbad6c51bc2fb4fe62118 Added 64bit debian package (amd64) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d6bfc7d4f7309114e5c0514ee48b9b73a3146521 Changed makefile to be able to run the Debian packaging procedure. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2f8a5d372508b276dd0c379cf55a388b5b0c564 Minor modifications in 'clean' goal. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 267ab990c2b3a0186bd12b35e05f886473b908f5 New package (1.47-2) currently being built | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 949a4a04805643ccad1caeec4050d097ee19eb1c Building a new package | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f246458c7bdb16e4d4b5e3591fd3e9aa3992879c correct problem with splitmesh with internal boundary previously the internal boundary was lost. (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8a832fe240484df4dac60808e88a408cfba52631 Test examples++-tutorial/freeboundary-weak also disabled from regression tests for the same reason as examples++-tutorial/freeboundary (crashes). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d3e2a3aeb4ff74a175830b9aacd3cae9e62e3652 Disabling example examples++-tutorial/freeboundary.edp from regression tests because it does not run under Mingw ("Error move mesh triangles was reverse"). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1bfae55e3721ec07d4d0460f5b8ee338b8a6deeb Configuration procedure updated with new Cygin/Mingw parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21994adadff42710d5cd2f742f1afa6d16896d56 Standard libraries locations have changed under Cygwin/Mingw | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a661f2b6aeac83f4f2f48d5549b3d32d000e40a9 add FE-medit.edp example to show plot of FE a basis function (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 021769d593b8a1366d5f50ccbe47dcbde133c4c0 Add a new finite element P0edge to build new error indicator on edge, this finite element is constant around each edge. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a5167b88c678f31a86b6ac68dd330a963f379fef configure.ac now checks whether flex is compatible with bison. Otherwise it touches src/ide/hl_lex.c++ to make sure that flex won't be called on src/ide/hl_lex.l++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 882dce3b98963ae5f42f75b9a8545a681f4045c6 Added some comments inside lex files about producing bison-compatible lexers (flex 2.5.31 should be used). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2a7f7e2078bef5281ccb1d7dfa15118c124ec0bb Options bison-bridge and bison-locations are not recognized undef cygwin flex 2.5.4. No solution found for that problem yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | adcd89feddce374dfa7951e90ac0abbb874b20ab At the moment, FreeFem++ does not compile under Cygwin because of problems with gcc 3.4 and flex 2.5.4. These modifications are starting to address this. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 05928489f77e4a920f6e1de8bd9a803a6f039df0 Added a new configure option "--disable-tagging" to speed up recompilations when debugging: with this option, the date and time tag is not rebuilt into the compiled program at each "make". | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edd80d6dc73d12b36aa18be870f3221541b8451d add instruction to copy sub array in array | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a04704d30f9ecb6d88be791358466030c5a69869 Color-coding in FreeFem++-cs now colors multi-line comments (/* ... */) only up to the first '*/', and not the last '*/' as before. So examples++-tutorial/schwarz-gc.edp is correctly highlighted. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e66b304df9fadaafb07280ae948ff6f4374f53f3 FreeFem++-cs no longer crashes under Windows when loading a second EDP program | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 308c885796218f3b5cf08812df50f92287fcba4e correct trouble in block matrix with transpiose sub matrix and cleaning output. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 164af8006d1c62b3567e9e0f301763e76ee5a640 add tools to build bock matrices like A = [[ 0,A],[A',0]]; see sparce-matrice.edp for an example. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80f00605780d5b27f3571856428981703df6eb17 to add Highlighting Patterns for nedit editor of .edp file., do nedit -import edp.nedit | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1aaae6d8b939ed8352c94bc1738aa653e779c516 Add way to bluid matrix with varf on different meshes. I add this for mortar computation. (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 44edf02eed66dd3eee1da5727cb3803b034d8903 coorect error in add Global.Add("intallVFedges","(",new OneOperatorCode); | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3b204d4a026437e1191a3b0e0cc488a3501e3d5 correct some spelling error try to add fft coding (in progress) in progress add Finite Volume element | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9d923d4f99a6429cafeee664a91cfcc39568fa44 add computation of eigen value for complex matrix correct problem complex linear solving Ax=b with UMFPACK ( mistake between real and imag part) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5092e3cf09f40ed65356b9250a0500df656cd8c6 correct une function name in Pcrgraph.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 961061460e0a6bc8e4b9f6b33e44471f3d27a684 try to build a dll file continuing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b0d3debbe8eac10a4b0a35b19af07b13b94d4f4a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0f043aaa466e7f5221b426a7adcf5e2f1319a041 correct doible name (CodeAlloc.cpp) in fflib/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3da25030c70e2f34a86e411af4ffcf996417064b continuing solve problem to make a dll file of freefem | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bdd4659da85536b00b7c68584423276640ae97fd Do big modification in rgraph.hpp: now all the graphical function are now store in pointer to a functio and this pointer "xxxx" is set to fonction "xxxx_" all is do automaticaly, I have just add INGRAPH macro parameter in files we is defined all the graphics function Pcrgraph.cpp, Xrgraph.cpp macrgraf.cpp etc ... I do that for dynamical link under window. FH | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 28c955b452a94b0c31fe8b2dd872bdd1e73b172e correct problem of CFMessagePort: bootstrap_register() | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c70a0cfbb0c89fc6548463a66d45d90d1b2cd0a cosmetic change in PC version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 631bfa2f1f992e29f3b1890f4587c482e91d9f47 correct problem in acoptim.m4 (g++-4 and -fast optim flags) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2f9a1908b7648ec3b81ad1e84db264e45c15284 add CXX and CC setting in fltk configure parameters | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1bb3aa27f10a72dd849ea034eb4f156750ff5f26 add include in some ide files (FH) change some assert in ffassert ( un removable assert) to correct forgotted trap like ( memory problem) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c1fdbb308d8c3029f2405276fd0a6013f16ebf9 add examples++tutorial/xyf file in window distribution | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 85d3c0369e48a24c163f145e25b0bcd6150e8a3c add aile.msh in window distribution | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2e462157da0865b7eadcb180a95ac83a27ccbb5 correct line endding in aile.msh file (make as unix file) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dec0b74ee1f1dade9edb2b02f9ab09872fc50ca3 correct DOC/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c4cb32e0b56773deed929ac70c315ea3c2ebf1f correct the DOC directory and do autoreconf CV ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a56fa48ee5e24ed2cc5f360f62362a94680de74f clean the DOC directory to build manual-full and add make target to build automaticaly .pdf figures from .eps files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1aa7388f6530b9a50c9cba72a3f400df38a00d1 rebuil all.edp in examples++-tutorial (to remove ref to bug.edp) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d4d1bf64dde118bc8c1b4c739aeba6b0dc464b8b do autoreconf to rebuild Makefile.in files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 03e78298af32638cf83516acb3e3249b14a455eb add 10^10 and 10.^10 operator (due to error in sphere .edp) and set the version number to 1.46-2 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80a3145c0d37c6554f4a4b6cad180a8c8e300126 remove pascal in "\p " macos version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 486ad7e8d09d133a5c9334389099f6542eb32cfd try to compile with de idm compiler xlc++ work in progress remove 10^10 an 10.^10 (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5704d2266d85adecd4e231c660cf9f74c3476e93 do correction for g++-4.0 remove const in Expression type | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b782afe3c9de2eaa58201a87df39e9d8fed5ece do correction for g++ version 4.0 (new apple compiler on Tiger) small change in RNM and cadna (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63d3dfdb44592159eeec0b8fef8d3d3644a010a5 Debug checks are ok on Debian Testing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e36771a2088749cbbb03eb2e7b5ff827c5a39ad4 add page to explain how to bluid weak form with Robin / Neumann coundary condition | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 66d491b4ae0f888a23e6db6a260b60a43a956be9 add tool to solve variationnal inequality add change version to 1.46-1 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c6e24c742011867bac0d07b7220d77e42a2757ee add tools to solve variationnal inequality let d en array and A a square matrix (in .edp) d=A.diag; // get the diagonal of the matrix A.diag = d; //set the diagonal set(A,solver=CG); // important to change precondiconning before solving | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ad184930109e27a9bdc18c54e7c8299092fde05f IDE compiles again under MingW (an include file was missing) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e5d2cbb095100309de29735622991bbb9cebbdf7 add Modification Kohji Ohtsuka in a manual try too correct problem in eigen value in no symetric cas (??) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 147b18d582ad60b3d4caa6ce61649a72b690faad add flags to build unionkjack mesh on square example: mesh Th=square(nn,mm,[x/ddx,y/ddy] ,flags=1); | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca60a36964e1ffb48d87aeb3268bad741c42b4ae FreeFem+-ide compiles on MacOS X | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 48a67cbd527e863c30dd9309ef6db722ca10ab8c First version of FreeFem++-ide without sockets compiles under Linux | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0e54f6c432b2942ecb443c1d61b3bfaa900128e4 correct name of example blakschol.edp in BlackSchole.edp add file in distribution archive (logo2.ico) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 04bd400eabc0d30c895292720e837c85ad7bfdf3 Not regenerating HISTORY if not in a CVS working area | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1031a586c610a9c8eadd3dcea80b9dd99e200769 correct some mistake in Makefile.am (in: examples++-load/, src/ide/) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b1e77416609e52d3af049c0b2cd85f96113906e adding 2 new files for allocation (forgot in previous commit) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab8aa79e91f3ff2b3dd8a6899df9c61b6293e3a7 Big change in code generation alloc (work in progress) to remove all undelete pointer. May be correct trap in arpack++ (alloction problem not sure, very strange thing) Put 1-46-0 version number Inforce compile in example-load remark, all test work on my Mac, FH. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 033b6a0fc4ddf5669163d24811d0fd91789e4de3 correct bug in trunc function: The bug is the mesh have hole the we get a mesh with triangle in the hole: border a(t=0,2*pi){ x=cos(t); y=sin(t);label=1;} border b(t=0,2*pi){ x=0.3+0.3*cos(t); y=0.3*sin(t);label=2;} mesh Thwithhole = buildmesh(a(50)+b(-30)); mesh Th2=trunc(Thwithhole,1,split=2,label=2); | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8649d7f85c6aac794c718c945afafed441407f28 Compiling ok on Linux | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cf8e77d0d15acbca8cd28cba509b929edad8d3b0 Client and server merged into one unique executable to make sure that the client can find its server program, even through symbolic links. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 69261b159abec452cbe648a705767e3f1307e541 Included src/lglib/lg.tab.?pp in cleanregen.sh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3fdbed5fc4ac5774dd50f27eb8fdf9d9b1f1b28f Replaced sem_getvalue() with a separate counter on MacOSX. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b546ab1b1e4a80d13d0dae5b41c2a7f75c53fbd9 add tool to get number of mesh triangle contening a point (x,y) or to get the region number example: int it00 = Th(0.55,0.6).nuTriangle; // get the number of Th's triangle contening (0.55,0.6) int nr00 = Th(0.55,0.6).region;; // get the region number of Th's triangle contening (0.55,0.6) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 93919db1f22dd7f6d4c0e99704ef476f605f35df correct prototype of StrVersionNumber in macrgraf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6965d493872634afe7695b707e75a26719ed3222 Updates to the no-F77 no-C configuration | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 30b9049436b919046ab71f1691b04b7fbb16ae5c Fortran and C compilers are now optional (if they are missing, we just don't compile the libraries that need them). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 95e845a8e3d26455007654e9eb8cc4fad0fe0b45 correct error in prototype of StrVersionNumber and add precision to show the correct version number | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4d388a89d90b077f693980ec2a35fcbf2e3f1b26 correct compilation problem in RNM (resize) with g++3.4 (add this->) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | adcda16a6619cdf23694964eec7b74b3736244d0 Correcting compilation problem on RedHat | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 55c3f4125208c5476ce5588bc1a2c4a3a5d21c3f New packaging including FreeFem++-cs features: fast graphics, grammar highlighting, error-line display | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 017012ea8b3f19c3779dfa3261397028094bb1f3 FreeFem++-cs MinGW bug corrected: does not crash anymore when reading a file name from the command line | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8bc90baf5dc99c469c31a23b42f39dfd5a3d90ba Removed unnecessary #includes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d610f1d4dcb7bea57153df5c7f8810967f5019a9 Segmentation violation error while loading a file from the command line in FreeFem++-cs. Debugging in progress. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d21b1a7ff9c8c6a133667b507e290acc5f1b655e Now compiling fine on MinGW | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f782ddd78588bb6b1e599edd0bb36291a97b302e FreeFem++-cs: compile-time or runtime errors are now highlighted in the editor (the corresponding line number is extracted from all the server messages thanks to a regex). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 13af75e253a406acccb89c6816bb39d060f09042 More coherency checks in configure.ac for a correct MPI installation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b090981ec6f0b6d173dd3e84520c20f78e623c76 Added new "resize" reserved word into the highlighting grammar. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8f3e940afd0b3943e66f6d6f2d67b42ab1c786e correct the documentation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23c2917a34854703b6d55f2b0471c5d5169134ed correct mistake in return type in complex mean and jump new function (FH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d9514116a7d6f22df1b3c29c693fe0246bdb4af3 resize of array and matrices, continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4d78379cd15d549ec5666e724827e2e2f0d55476 add resize of int,real and complex array or matrices, exemple: real [int] tab2=[1,2,3,3.14]; tab2.resize(10); // to set the new siez of array to 10 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f60c623e3013d4b0277b73aca21f40bfb7cf361b correct bug in array of complex FE function like Vh[int] Wh(10); // where Vh is a fespace | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7a8be27ebf7ff03263441c4148315517feb38e4e Highlighting test procedure not ready for regression tests yet: disabled from "make check". | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a00cab5b676a1340cbc304bedc9626e55f6f71c7 "testhighlight" regression tests now work up to (but not including) array.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c58b9eb2b45534c30670421fbf8b8afbc94dd15a Added highlighting grammar files into CVS, in case the compiling environment does not include a working version of bison or lex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d5aac0c6c02b8734653a7c4c568fd9a1ba53757f The HISTORY file is now created from CVS logs thanks to "cvs2cl". Previous HISTORY items are saved as HISTORY_BEFORE_2005. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43e2150fb437ec550f11dd6b3e77a5f4a8f6cac0 FreeFem++-cs: grammar-driven syntax highlighting works on (examples++-tutorial/...) Laplace.edp, adapt.edp and adaptindicatorP1.edp (ALH) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4822fb45a8898b9b210ee770cc4aa839a8989c2f add jump and mean of complex function. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d34d7bde1641353c17801ca56c7b1ef8ceaddaef FreeFem++-cs syntax highlighting is now highlights keywords based on their location in the input buffer, which removes any need for backtracking in the bison grammar. The grammar is now much simpler thanks to this. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fb927cc33cc85e993c0d385414cacc44fec3ba9a ajoute d'un test d'erreur | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 67b2928cf8f0ccb4b8d1142e8149d8162b4956bb Added new developments | | | | | | | | | | | | | | | | | | | | | | | | | | | * | df6d9f3f3a054091800635bff42e415ca4b481f5 Compiles on MacOS X. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | abbc82a309634647f3e83ef058aecc8a4fc23457 First working version of syntax highlighting through grammar file in FreeFem++-cs editor. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 538ffa9597cf6305d0e52f9d01f26687a98893f6 3D continuing + truc | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb31260c09a2aedcca8c9129c54d7f3d5639f467 Socket buffering is now limited to avoid random communication errors. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38db49f8f3e19f1232d0d33b4f49318c05dfa401 Socket communication between client and server in FreeFem++-cs has been translated into binary format for speed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 79630f7fc138b40c81598a75020e6a44b38234b6 complet DOC | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1fbb8d7194fcb99911ef5036f80be2e521f950e7 add 2 new quadrature formular qf7pT and qf9pT with respectively 15 and 21 points add P2b a new finite element : P2 + bubble | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c294295b4927ff746a5cb138bd69efc926fce47b add 3D stuff in quadtree | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 351188d3575a7898a18672d6fbd899121795727e Updated TODO list for FreeFem++-cs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d1570f49e71193744e6097b247956783aedbfd46 Dynamic loading is now disabled if dlopen() does not link properly (bug reported by Haiko Etzel) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a7b0a49e95329932cae25dae27754c0bcf8042c1 add buildmesh example with nbvx= named parameter | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a727369c967352f523b8a9f91f0c8f872817f24e New Debian package | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a2d08756d91c857a81578f41dd440dd4b3b9ebe2 Now checks that FLTK is compiled with threads before accepting it. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2f039d42b976bfaad78aa2928aee024d6a9e1bc Patchs de configuration propos?s par Thierry Thomas pour FreeBSD int?gr?s. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 77a7c30101e180b1b10481a1a7a1fff17f57fbfd beginning of 3D version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 923b19e1f647e0814fc3a5b01491683ab59535d3 New script to remove generated files (in order to prevent CVS conflicts) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 072255abccecac38935f059f8652bba1c50a9f62 FreeFem++-cs compiling and running on Windows with fully blocking sockets | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af8657a599860fc4cf2f1d540c159efd440a5d2e FreeFem++-cs works with fully-blocking sockets on Linux. src/fflib/strversionnumber.m4 added to distribution list. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e2f80d8ab15b2cfb0e1be349957445a9f55873c1 Reverting FreeFem++-cs to blocking IO because of Microsoft Windows problems | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1522cfd47429b68c58a8f37481e15021d82e1610 New version number in makefiles. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a04d47ed77250ea3846b84b33e04454a07e170a8 Default version number now includes package number. Build date changes at each build. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 017df2150c866c8afa7da19bded7d5187a229749 Problem with busy waiting under Windows solved. Change in version numbering variables (see configure.ac). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 562fb932ad75388fa0da9c9b6919dc3829096e0d correct some compile error with g++ 3.4 CV ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bb1ab3f1e9db6d1c1564073d74976c878a711b84 Windows packaging for new improved socket implementation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d40352f5e7a3164bd390511fc0061237b95de30 Still trying to resolve discrepancies between Linux and Windows sockets. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fed1814ae698762de8d56f8a4028d3c70c4de9e6 correct ; placement in if ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0572219c20dc8fe678287d665c29d3f2b1e57e85 pour mettre les makefile.in ok | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 25854cfedac316eabb7de943566ee6528eb2adb5 mac install continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b72cd3f2e66dac14672f5e5744ec23ca6f8db29f mac install continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ac49ea8c8361f6ef615d69ad7bd0fb2106e96bc9 continuing coorect of macos application installation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | beb8fc43647016c907a18d1774396f10da7e0265 Reorganising socket communication in FreeFem++-cs because of instabilities on Windows. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e946234c53212f4c2fe2194571c2a2c0aa7b4179 Drag'n'drop works with Mozilla Firefox for Windows. FreeFem++-cs documentation updated. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d078decd8c082c7793d791898af881be8000b0b add .app.tgz of macos application | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c2d8cd556430975ad4dda7063d05106ff50503eb correct pb dvi pdf in manual.tex | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fea33bd93a0aed77498ea3a7d37518cda2ddd3e3 correct stuff in dist generation correct trouble in configure.ac and tar.gz file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d18f096dd2143d273f85b2a66af8644b1bfe709 correct problem dvi and pdf chose make lot of small change in configure.ac ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b44cba1192e6830ff7b88e022a172b875687928 coorect macos X application) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1bb3ea13096dc280a863f1b17585b30f235893d5 In configure.ac, PACKAGE_VERSION is already used by autoconf, so we create 'FREEFEM_PACKAGING' instead. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1c6dc36aa7118f52f6d8000c04c4a2d19a1b1b4 add named parameter nbtx=.. in buildmesh function to change the default maximal number of vertex in the build mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 936c347f2b8b7a2a3873ea71b04c1ed981c86bb6 Correct a segfault if second derivative of test function exist in problem definition. The Change in problem.cpp: resize : KN buf(Vh.MaximalNbOfDF()*3*Vh.N); to : KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N); | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b7458d60656f85314876d6501f5b1aeebd64751 correct parameter passing () in macro argument correct linear combination of sparce matrix. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 636af0db6fdc10d60bf29b4e30384c0a2475ca48 change c i C in speedtest.sh to get Cholesky cpu time | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 675d30dd417704870b19da8dd2321acf94780c08 add forgotten file .pdf | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1a4adab6c5b727052224da7be245f3df2f6eca28 window problem continue | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e4050d310d6a096f7261b430225f0cf8b7493efe correct ???? configure.ac under window | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ca256cf4be3640fd7d6c8ecca270b574a237a46 correct expand string in macro | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9469881a60a702ea9376540492331c3cf4dae746 add config.h.in | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3cb532ce49827eb0b83dac94db3af2e50247170b Cosmetic change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9ebd14a94dd4df3d517578adfc2cd4e303b4da24 correct initialisation in solve in case of un set variable | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 46a4ff867ab5b33a5d912ffa6fce7cfb89301ca2 rewrite the macro generation tool to be more to suppress some bug in argument subtition correct error in line numbering in case of newline in string cosmetic change in output | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b2d944e1b7b94f1e7d1ac8d1083e896aad935f5a update HISTORY file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e60081202beb14e9dbb2956b67e0236a8b0c4665 correct segmentation violation error if some FE variable is un set before solving problem because we use this variable to initialise data. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4e672fefed2a0b9a5711e95cb04cecd435833b38 continuing int1d(Th,3,qfe=qf1pElump)( | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 359e4edf38aa652276d8a092e9dee329f05f7b22 add qf1pElump new quadrature formular in int1d() ... | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e9d98167457aa2a2cd2a01e165bc84d3eea98714 add concat operator in macro generation # | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35e8228d01dea224fcbd2a67421e2b1df471eda5 add mkff-html.pl file to update the web page. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5552edfcc6e0be743d740d161a09ac4905684d09 Windows package including correction for Mingw -mthreads bug | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d1ac39542fd5fb5067bcbec16f8bf2b23e2f5be8 Bug solved: Random crashes in Windows GUI | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ccec56a8fa4f286f6a9be45004f16b8c03697da9 Change naming conventions in package numbering | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd4951453086946d1cb8922d1f4723742cba6ee1 Added files to "clean-gen" goal | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a279b66ec33765b1df0fb6b54a18ad1c633286cb Added goal "clean-gen" to clean generated files which are included in the CVS repository (in case a technical conflict arises with "cvs update"). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2026fcc8963f96c8a5603aed8edf57617cdb31f5 Postscript output in FreeFem++-cs corrected. New $(OPTIM_TYPE) variable useful to name binary packages. New $(PACKAGE_VERSION) variable to distinguish successive packages of the same FreeFem++ version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b33158b235108c652011460c7d1f1ecc2360947e (tag: release_1_44) add one examples and load ide/makefile.in file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7818fe541a9f35a49211b57d39b07f3088a088fc put manual-full.pdf and remove manual-full.ps.gz in dist files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0c199f68ac17e6a0167f70bbe820210c0e53d74c adding change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7d799f98dc7023f25d630ff87bec877bb99f63fa correct missing file in dist target in ide/Makefile.am CV ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 38b33a64d78e4d2226ffccaef561c54918ff7c32 add pdfsync.sty | | | | | | | | | | | | | | | | | | | | | | | | | | | * | de2711f7c9d3617650cde392fe11ca1246d91d62 add pdfsync.sty | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e9e06592f77816e7f3afc603df2efe253d9d5d87 correct bug in LinearGC change name interplotematrix in interpolate | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 20f4c173983047f909fe052592da2ac6f9e3b8b1 correct bug in LinearGC change name interplotematrix in interpolate | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ed7e92e9270c286e612e86ee119cfad57a351421 correct bug in LinearGC change name interplotematrix in interpolate | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ec76496aa12f99b7d5892586ca4715bf83a49e94 correct bug in LinearGC change name interplotematrix in interpolate | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1fb2949b4a35287093be83380254311c6334b607 correct bug in LinearGC change name interplotematrix in interpolate | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0ba52d7c4e529cb35360a8ce10d2f629d248b57 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 26d884869a4c4e4622569c5b04f53382853a12d9 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 570029659eb046332a2cf26fc18ba278a10fe8ba "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5470478c566644f9316a902f5033f4afbbfbf0e0 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e04c0e68d477ddfcae76bb74e8de4d25078a786 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca5d55b155ece9426b329e316d6864ffb08ac0e6 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 86221a49c247669224353b5e4deb5cd9e8e95dd4 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6f02d2a6b83a411d0ce58fd301f0228a750fa4fc "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c1372111a829ee20dada87284081dee87371deb5 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4a89658280f8eef224ef7572b7b85dbbfeccb7b9 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b08b6135c6b66077c45b2d1c3b7f058a9916b9f "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 33381a6d5a5ab698773477dc2dc4fc76637042ae "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e16f4da5ed0b0a0ce029d985af95f6b57704a83 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 27d442e2297800ee0566835d5cc17a742469a5e0 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4ae8308e6388964d17c4b4ab220ccb6f246600d2 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a549091cd3e97c5dc15780381652b519ab923e72 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b9da82fa4deb1eb6e5de400b544292eadc51943 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91396152964d3b49f801a142d1dd4b93dfc2d826 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 98efbb8106e069ac4dddf9ee4d09ad4d9edc49f0 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f42a2de4ab03a308550ff4022fcf35c805db2a51 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 65ce2aec68e26bd82cd7e50968ab704eb06a87c0 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9ed90a11ac731d2e8f7b046363ccda0d372a523c "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 051f11da414d673ce9afcb55e5316b937fff60e4 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d90b3b3dfe18f98c2379a4277408e4bf780a2b9f "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2106b42ff7ce40060b5f211c424ac02f8c5f64fe "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 952479fee22b80690dd8d12ea50c8417bbea30dc "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce3c42ed6423e161514c30603c8d5a94d57f1aec "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd96135372d51093af65a7afaa6467ce8b06ae3a "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 352bad92d38ade9efe7c8570d733b1847d565e20 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 15a213d7d3378fc9bdbd15bc50d4ae7f657575aa "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca698051bc5a97e200ee41304a3f33de356d4d29 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7e2e901d122b109151d76faf5378d57becf1de56 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2ff89abdc40e57fe1afda79e2d34f1c0e2608e3f "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e3adba752e97a7e66f3aa75a1984f91ea9588ad "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7e6aec1d884296de78b5282827c6438301114a12 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dcfc6c3b43cbd45c70cdcd35ffc1a509322384d0 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eaa737d914f22cd585caba1eabe1396c51c58ace "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e805f032e00be0e347797a3a7bea880b11967e9 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dd325ef9b2c479ad238cfb7e3081e3ff9887742b "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 08f0ca0483a2366844b3d2261abe6680ceb20c6e "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a447c5a240ce6c23128e95517d264b8c88017102 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ef9f89e717be7ab8a200f611fd8e4111a9517dcc "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c08cf8782a9e36926ff36d98fa0207d889a7308d "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 601032b7a12237a3690b4fc3fb1fd340ab9a0d88 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 06c0b6638c6f680d44e5ea86b7ea5421d275a8af "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d254f1c0289e9437da2a2688c58c9d317ccd1229 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3aa914a39ab6dcd038ee39cfd0c0dcd3b12a39a "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fed0520154f547cf4597aaa843679cb322ce3e08 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d631fea291522acc627080d20cba4f6bfe3be9b "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c958bb445defe8609c374bf2f5d58fb764ae71c "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cfdd71df461cd36e1f3e3130886371fb6ac7a6c5 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 57fb9ee052998da1c562bf4b9895f1bbb94d91c7 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bfdb530db87e75090773e67f3baacec822d2b45e "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d0705b06a4141be9027ae13799a1c97cfcb8ae7 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21b656d219723f026c733b33408b4053cb0b9873 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 97911d370d9e3fbb272b96bbf16c42d654059f73 "make dist" does not try and include BLAS source files any more configure script and makefile.in are included in CVS (so that the users of anonymous CVS can recompile without automake or autoconf) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2cb91e0599b379726644149062fca8dd9b2d666b Include kernel and libc versions in linux static package name | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21aac9fca31da805b04c19fc40ecd89e50f5842a Include kernel and libc versions in linux static package name | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa7099aa2c4b0eb3514581e0f802237c49d5841d Wording change | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d9668cd8a869a7d91e32ec37eb8599d1d7f9fcfc New package for Windows done | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dc16b17a35a8b2443943e18cb27055c621988ee1 New package for Windows done | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 310734bc107d531e6bf1a45826671fb5927e8fdb New package for Windows done | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7f103bdcfffaa861e92f460f328d7890351fe5b3 Changed reference value for regression tests | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8939818e837e5d91efc2ea4fa6070863adf158c8 Changed reference value for regression tests | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ebaa2afc8639b7dd5e0133ab7a9a2e37058a8ca Changed reference value for regression tests | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1065d707ccc9c004e2ef97d6e8325ea4a83d5e92 Regression tests suite was not running. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d650bda7b6452e7fd0de5389812412fe70c677d Regression tests suite was not running. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | efdf40b262351fa26d5df4626944c7b7a673f5a4 Regression tests suite was not running. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e9632297cd08f894762ae2d49778268c9860bf0e FreeFem++-cs works on MacOSX (uses named semaphores) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dcb499bda29ac1bf2501b2773c03324e3e609aad X11 shared libraries dependencies removed on Mac OS X There is still a problem running FreeFem++-cs because of semaphores (they are not available under Mac OS X) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 504e7dd1713e8840edda0093e61625099d21d556 X11 shared libraries dependencies removed on Mac OS X There is still a problem running FreeFem++-cs because of semaphores (they are not available under Mac OS X) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68d0a66ce0155f7228441dba705edae3ea29acfc Added FreeFem++-cs to visual regression tests Changed reference value for examples++/NSP1P1.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f0670fe1f781b4095d6e6c6dfd687ecf5eeb8ca5 Added FreeFem++-cs to visual regression tests Changed reference value for examples++/NSP1P1.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c8186fc400f191a478c9bbf1d4e7bbde0eb2a98 - Tuned regression tests in examples++-tutorial (convect-apt.edp case) - Removed all X11 libraries dependencies from linking commands where they were not necessary. This avoids some runtime dependencies on the corresponding shared libraries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68816477e8685f656ff50d778accdac4854a0ec1 - Tuned regression tests in examples++-tutorial (convect-apt.edp case) - Removed all X11 libraries dependencies from linking commands where they were not necessary. This avoids some runtime dependencies on the corresponding shared libraries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2a95eb31f5f008f4eb59928e93f24d927d375a04 - Tuned regression tests in examples++-tutorial (convect-apt.edp case) - Removed all X11 libraries dependencies from linking commands where they were not necessary. This avoids some runtime dependencies on the corresponding shared libraries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bbfb6605a7eebffba00804e88e128cc63f360a6e - Tuned regression tests in examples++-tutorial (convect-apt.edp case) - Removed all X11 libraries dependencies from linking commands where they were not necessary. This avoids some runtime dependencies on the corresponding shared libraries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d0b8b5c2b88c6f4d5e36b3f3d9e01c8907ddb25e - Tuned regression tests in examples++-tutorial (convect-apt.edp case) - Removed all X11 libraries dependencies from linking commands where they were not necessary. This avoids some runtime dependencies on the corresponding shared libraries. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5fce9805300d79ace3730f8d54758d059b259cf6 remove operation g - A*x -b ; => bug in opt version in congugate gradient 2 routine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c8b3f8c227cd68eb9ff765c5d770968395a1863 Application icons now work on Windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af34393aa6ebba571d8b867ac9cc6bd637a61963 change 1 un 1. du to complex varf (ambiguity) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4e077f15766249fc4b290c2480a77c17777df067 correct small compile error | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8a6e6f64685ba86882bdec04fa87bcef901f3738 Added X-Windows icon to FreeFem++-cs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe8c1dd81cc4407d54350bfaaff45c6c0a764c84 Correction dans matrixinterpole | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c96197b45594ef17d21ab8977d4cca23aae8494 Correction dans matrixinterpole | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a018ec2f9fa793a878fabe0429b4e5496ebaac04 Correction dans matrixinterpole | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3924fba399737ab658b58b80ee99db2f08206a9 Correction dans matrixinterpole | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 10944730c942f970688718195b79e5cde5742800 Correction dans matrixinterpole | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e7448dbeec930ce6b545e751c3e8aed6a5b37713 New debian package (1.44-8) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d23ef54b4385661080ac9f52f23089f0fe72b28f Remove -mpich version from Debian packages since mpich Debian unstable package is broken. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 14ec4d049056b29f4ebbec7bd704dd8a4144444a Windows packaging modified to improve icons management | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c76ec3af8d92c151f76076e1057988216524f827 Windows packaging modified to improve icons management | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a5481f87a48402fbd68295f563de53bbf67d3bdb Including FreeFem++-cs in the Windows packaging | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 09dc2ef2976ec80fd219049771e4dbfdde90e7ff FreeFem++-cs compiles on Windows _without_ Cygwin | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 17144add69da5a375acd74c452f3f7385af56eba Recompiled on Linux (Debian unstable). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 20e818539cb4fea424d680ca1e9bdca0e34c9f86 FreeFem++-cs currently being compiled without Cygwin (because of license problems) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d5ce53620952b310c87cc8b50747a0a82ce606dd FreeFem++-cs currently being compiled without Cygwin (because of license problems) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e4d96ff5508efd28e90675b8a47ec5450268919e We need cygwin1.dll for FreeFem++-cs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 36f14dc066a0733b0ca862d0de3757eb98797c5b FreeFem++-cs works on Windows | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 711c75123f524753e8b0c8e6c2471791d570513e Cosmetic changes | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0c8899bff7f78246642039e776e23e7856a4bd1f New binary package for Linux, containing static executables (configure option --enable-static). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bccc248353c52f87706b1dd420f5091a50f3f8b2 New binary package for Linux, containing static executables (configure option --enable-static). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 567c3c2022b5da84979edccca9f09c8ca76e3418 New binary package for Linux, containing static executables (configure option --enable-static). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 01db61ebbc7984ef56e27c7edda5ed93152cc63d New Linux binary package | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 628c9d45d4fc4a32c9e773dae05d4ac44b66d7fa Added new configure option --enable-static to have no shared library in the final executables. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f631733aeab08dcc6efc7e389667a37137412529 Added new configure option --enable-static to have no shared library in the final executables. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa94641eae827a83d6931ba6db8ef68eca23fd46 Added new configure option --enable-static to have no shared library in the final executables. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d4cdcce863fb1e877108eb3b27ab79fd699afa1 Renamed MPI Debian package from -mpi to -mpich to reflect the fact that we chose mpich over lam for the binary parallel version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bab5e836bb7bca0730d397fb79dad7e6ef5f8099 Renamed MPI Debian package from -mpi to -mpich to reflect the fact that we chose mpich over lam for the binary parallel version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6234082af23f77c799321b70c6448fe61af5a863 Added rules to create a Debian package with mpich | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8566ac31eacab2673385b3cc5a08182300c1a5af Added rules to create a Debian package with mpich | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3055262803e86d84eca27a8d240c4442aa5e1742 More precise build dependencies for Debian package | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bc05ce654c38209c610069e3e422e244aa663a64 Added profiling option for configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5a46cc48f090e5c9db7b606a51e376ce1589b404 Added possibility to create separate packages for Debian testing and unstable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9704b17cd951bd407617ec9aa678a64d8434b472 Added possibility to create separate packages for Debian testing and unstable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 72b0e3ddb80638ea38861dc34ef52dc94dffd222 Added possibility to create separate packages for Debian testing and unstable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e795714a6a6e8e911aaf2875c30837da5b8ce713 Default Debian package set to -x11 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 257ec85ee13aa6d8a6bfb22077d8480935451041 Updated IDE TODO list | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80816bdcfcd79b05373d9aa880f83aa39a17b30f Debian package (unstable) for FreeFem++ is ready | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 787959c48c412a19f307f00e58293db6d587092d Debian package (unstable) for FreeFem++ is ready | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 07b7507e39d076b2a76d4ab8ed07181c83287034 Debian packages curently being built. Not fully operational yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d6cd851b7671d124ba9dc1f6c290dbd76db3f8d7 Makes doc up-to-date with IDE. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d2b5fcfed8a75e6b3662a4f121cc15d0c0d8a10 Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11da95b0740fad2f4a8ec3445c863b8b79151e28 Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 151824b1645e005941adeb5cfbcf7b208a68ea7b Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c68daee94b4e799d89993a3c23077d44c00a7ca4 Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 03a6b5c0be66f5f3687a2d716b1912ceae5fc33b Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c4cc6190ebc4f97328be354dd89aa4bccf2c594 Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c96d0b7375bb946284a988191a664395250e604e Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ece9df40fb07cd8c9e7389a7a60fc71e60c44bf Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a9fc316307b188c47e2cb47a85cf3b196d791634 Changed macro LONG_LONG to BAMG_LONG_LONG to avoid any interference with MPI. Work in progress on Debian packaging. Work in progress on client/server IDE Pause/Resume buttons. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7fc74d1d8b12e5c1befd86bc9d42660841ed6778 correct problem in integration of complex valued function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 536c5be2547bbfe2d8610696cd0b7e5de2eab56d A paragraph about FreeFem++-cs has been added in the documentation. A bug where FreeFem++-cs did not run FreeFem++-cs-server properly has been corrected. A FreeFem++-cs screenshot for the documentation has been added only in .eps format. There may be further treatments necessary to add a pdf version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 12168faf566c92a8d0877502267f4e865ca8ca57 A paragraph about FreeFem++-cs has been added in the documentation. A bug where FreeFem++-cs did not run FreeFem++-cs-server properly has been corrected. A FreeFem++-cs screenshot for the documentation has been added only in .eps format. There may be further treatments necessary to add a pdf version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a35957c7a129ae5fb986c890f10b1b13b7d5ea33 A paragraph about FreeFem++-cs has been added in the documentation. A bug where FreeFem++-cs did not run FreeFem++-cs-server properly has been corrected. A FreeFem++-cs screenshot for the documentation has been added only in .eps format. There may be further treatments necessary to add a pdf version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab69c1d6f3bf6fe3e55746790fa5431b4272e8ce FreeFem++-cs compiles on Cedre (Red-Hat Enterprise) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9f36db52db9184ec9202e6df2818db67037c3bc Added TODO list for client/server IDE. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 468e0502cb5c1cf91d87140ca0c70687acc5837f orthographe in manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9e8f01c9467dbe65203fc30d400cd03e38d2584 cadna intergration continuing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 26a887df9e20f03e968a28a855b22b714c0d4d78 cadna intergration continuing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 007aa9258e3b7745e6aadd1e65d18f7c74d000d6 cadna intergration continuing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e75894d5b7fd1dd889dbf88656a1028e2a528653 cadna intergration continuing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b0ab549af102a28bc106c3356fd90a04f24a7897 Progressively debugging the IDE and making it usable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 87687a1113d6bac803dfbac8578968950d6d6be2 Some corrections for Cygwin configuration of the IDE. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1062d6b3aaa8efdf8335d63b753f5c30e8e4a14f Integrating Windows+Cygwin changes back into Linux. configure now accepts the option: --disable-cygwin | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1e3534b85b7e2a11b252a23bb6dfddb7a6dfe55 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8844fcbce1e8bbba64d48b719b3b54c90f9f0e1 There was a problem with downloaded BLAS source: it was included in dependencies even when downloading was not necessary. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 77ea6b64d0c63f7a4bb98df52ce91c7a97f2a9f9 add interface with cadna | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4bf9c4817be319894120b40407497de11c5738c2 Windows version of FreeFem++ client/server IDE currently being developed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a61a4206ad1927ee31afd2a073d9d8ce15b8c7d8 Windows version of FreeFem++ client/server IDE currently being developed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5916fdb646343ea1b47fe4418bf9cf867665d823 Windows version of FreeFem++ client/server IDE currently being developed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ddb3a1a0cf5da09f03cc87c43a7314c267efc264 FreeFem++ compiles on MacOSX. But it has not been tested yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0576c29ecfc8a4645a160a88106a023f1184dd22 FreeFem++ compiles on MacOSX. But it has not been tested yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c43ee180614cc9cf0d2800b66bd4eaa5f3112fc0 First stable version for the Integrated Development Environment (client/server version). Merged from the graphical user interface branch (which is useless now). Works on Linux. Macintosh and Windows versions still to come. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 07a30b2ba59d389bde46aa2e9c9636f616ba0b32 First stable version for the Integrated Development Environment (client/server version). Merged from the graphical user interface branch (which is useless now). Works on Linux. Macintosh and Windows versions still to come. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8c070048458c0886cafc8ec7f5bdf3885e593e0d First stable version for the Integrated Development Environment (client/server version). Merged from the graphical user interface branch (which is useless now). Works on Linux. Macintosh and Windows versions still to come. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 56a4048fd36ca9e3ce56d373c1a39653792c59b6 First stable version for the Integrated Development Environment (client/server version). Merged from the graphical user interface branch (which is useless now). Works on Linux. Macintosh and Windows versions still to come. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b4ef65faf1d6f89962887c632d7b08baeb733857 First stable version for the Integrated Development Environment (client/server version). Merged from the graphical user interface branch (which is useless now). Works on Linux. Macintosh and Windows versions still to come. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6f84900dddadf0d1a124e0a4ca3eed6017fb963f coorect bug in FreeFem++.app the plist file was wrong.x | | | | | | | | | | | | | | | | | | | | | | | | | | | * | beb18575e4a22dfa4cdfd643862e70d13429163f coorect bug in FreeFem++.app the plist file was wrong.x | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cee0f400d182a464b539ee37fc07719e4bd10038 rm ./FreeFem++.app/Contents/Resources/Contents/Info.plist | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d43c138f8a1b62f5bf8c97ddfa8a16f89e94534 add install www files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4cc9bcc2b10e9e1332d0adeaf3028eee9201b324 add install www files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f5f7e54a62cd8aba381c27f8df43ab0e65a4f96e add install www files | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b17bf6d525e11424642df5490fc0564d1dc0abd small modif for the look | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a67e790dd8c6c16ec9e7ed25b567d093b8b5b210 corret small problem in LinearCG LinearGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 07d6e470d781bfd5b0db21cec9c87e994a2f85c5 corret small problem in LinearCG LinearGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 08728171446a3978416d894827e2be72dec0326b corret small problem in LinearCG LinearGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9476648bc04abcadbf22c21f72acc697bc340b15 corret small problem in LinearCG LinearGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6045ac08bddc55fc9c5f3b032af0b7d73649cbb4 corret small problem in LinearCG LinearGMRES | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5bfd38b96f263297e49a227cffa500d5ebbed357 continuing regtest | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e33587f7e5ce1dc079c0a2c7c1a9270a07c8914 correct stability of regtest | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 65f3c6d0106f426f65c598712e03b85fa491f8c6 correct regtest in examples++ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a658fe02f24a09ae27e69f006e16d31ea0f880d0 correct sensibility problem in regtest value | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d694e294ab692c4c67ae48b0612b1b8f4f1edb19 correct sensibility problem in regtest value | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 892a0c565a62ff30efdb5edbda8c7be79df53e92 beginning of 1.44 version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c243f5b48216e4e895d99c67731a463c54b893f7 (tag: release_1_43) correct probleme in periodic adapted mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 44b91c9af9878a7c1ff711aa667668125ed203da correct probleme in periodic adapted mesh. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c522c46c53f22cb60a51f3a059ed6ea5698f4799 correct the sparce-cmatrix.edp problem (bug in copy construct of MorseMatrice) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bc36de7096b51d4f5c58d012be50022f42a4373a correct the sparce-cmatrix.edp problem (bug in copy construct of MorseMatrice) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4157c19566eabdf918effba693c7ed6f84260aaf correct plus in copy of real matrix to complex Z CV ---------------------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 40deec9848b759e7564a9b9bc86200ac6c797fbd try correct probleme with sparce_cmatrix.edp on hydre | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd86f3a6543228bad80505e6e84d2838832c2e7d track a bug in complex matrix | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edf6e0c08dcd8d3a56a02835f38f3abdfcadebf9 correct spelling in Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5796a2bf06b97585c6f486e93a54fda05ed31af7 correct missing file in dist TARGET | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6e5a302cec1a41f2c56114701b1d780b9e26f60a correct LD_LIBRARY_PATH in regtests.sh | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 42ce7dd06be4ba23fef042b431a942dde47384b0 correct compilation probleme with g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c798635bb63fe5e8d19d27014705d365e4fa4d6 olve pb of case in filename if figure dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68d426d0a732166355fc3ce83b99f31b655384fe olve pb of case in filename if figure dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 199852c1f9951917a2cc0f0253a1a759d6df661f olve pb of case in filename if figure dir | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 573e8ab157dad3261bb5915489eeb368eba88853 add info in README_CVS update -d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ca2c9c79875299a179367888621d057482cbfdc5 full manual continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b5ab9fe2e8b431037b3da573080d962081e3fc6c change default manual to manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 991f533104deadee98e6898ef4bb7acfa7a407dc add forgetted file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 530496917e8e4ffbd69c07c789228f7d3960469d correct ps generation n tag | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e6773d2fd6b9f71d5f4344dc9eb524dff198df81 correct problem AssembleVarForm compile with -O3 in hydre | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 41380fd984999551f72b4114c89aedbd713d3000 Updates for building debian packages. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a511287afd0060c667874c29fb7f72ec9b40725a correct print in UMFPack driver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c69aa292e5ee5692e8aa3ed3583bc7f8eb408785 add inquire of FE space connectivite (see HISTRY file) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b60b50d6ddbd9ca6355569ce9e46ecfe77e9835e add inquire of FE space connectivite (see HISTRY file) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b940b128d7c57816ce552915640e8f48adf1d390 add inquire of FE space connectivite (see HISTRY file) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | da8dc5aa09cbff8246ada5a264cb29675a90911c correct bug in UMFPACK driver + improvement | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8ee3804d833ef17c4c600e9ad7eee3cf47189003 correct bug in UMFPACK driver + improvement | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4192f8cf07e3d28c189d7d28fde456af54cf4dd9 correct bug in UMFPACK driver + improvement | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6b61ccc6840c109d3822487e354de520c06ab06f correct bug in UMFPACK driver + improvement | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a7c6962d4eb3e3d0ebda708365061e2d9af795e1 correct bug in UMFPACK driver + improvement | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9e8c49f742aef4e02059f786fb4a17dd853da5ca correct line numbering probleme (lose the first line) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 75d8cb905a9bad8155b10ce154cef1dfd7c289e4 correct line numbering probleme (lose the first line) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e092abb8be9ae7031230f656a774ed6a80db8e2e remove accent in GC routine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9af37cc9499e4d68416bb96b6bb131157811d391 remove accent in GC routine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63b36f0adb20b9b0ef9395558d2a827e02b3e951 reput previous version (wrong test) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e4e11d29d1791cfdaed1991e7833496f1b460462 correct probleme in A*x for full matrix and correct probleme in u' is the on complex vector the conj(u^t) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 019e9ee8cc016c8bcd21431f1b05e581f89e30dd add file src/fflib/lgmat.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 460589a289e56a8e382c4da9a621506f75c9a85f complex pde , FE complex function, add complex matrix , first test is now working see FEComplex.edp and sparse-cmatrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c5378c3b5c93fbbb6fc8142575293e3bfe61a19 complex pde , FE complex function, add complex matrix , first test is now working see FEComplex.edp and sparse-cmatrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4b678cd40c9e034dcaf8389d2d042a01799187e6 complex pde , FE complex function, add complex matrix , first test is now working see FEComplex.edp and sparse-cmatrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e84c185e9ba1085a28f14bbd6925d204dbb64a0 complex pde , FE complex function, add complex matrix , first test is now working see FEComplex.edp and sparse-cmatrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5a31768344c31949b26dc9a9229bf089b22c0372 complex pde , FE complex function, add complex matrix , first test is now working see FEComplex.edp and sparse-cmatrix.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eaeb48ffdcfc35324f4683c0167c5c6d174c482d complex matrix continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a0be36598be0686946844443f55f7d52307dde67 complex matrix continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6f05add404a8107fdd1ad563d3d8f041a4f6427f complex matrix continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e737e06bb7491a10966514610e60ec179dff30bf complex matrix continuing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e587011586ff2c2c48266f2fa3ac3648fcdc0027 add a pde complex example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ef7c538486ecc2cb406d18ff35fbea41e51f01b1 pde complex , continuing: first test is now working | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b650108019205bc36d50602a2e8ffcc3655b5973 pde complex , continuing: first test is now working | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3768dff1812acf7a4cfb8d0ee27045040eb11363 complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a5a190a44b84b444558b684645c15926e53c9ed complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a855bcfbd125cd0f33b00975b713673a589cc3ee complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 757de834474163b175483184b013c26823f3d9fe complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 34e7e69cb587567ea1dd4f32e32ead5de1fc7b9e complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0b10348f044c93a9c5fa7f31ef45a740b4e7bce9 complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d90ba77c3da8fabf2a08aa5602d7dd7cb9849694 complex pde probleme ( first test) no validation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4362f4d0dff465765bd334020b68a7e8bce0dda8 Added reduced compilation goal "quick" for development purposes. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2df9e4171272a79f9ec56e1a62b066c23f200994 add complex edp (continued) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b03a6c8d48dd9d0d805e2fb665070e42af99f04d add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 60c84f1177270b2eaac5e04800e7255dbaddb7fa add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c18b2de9f65b74e8c779d83fb31533b55caa477 add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5c0dc6e77b0ea7181b8bedd13b7cdcee0d82300e add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5b3d5a1f79ceead4c4adabd9594e91685f422f73 add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5cb3c91cf6bc7385fdd049923057fae52116bb89 add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cc6a303cf92096f4efa14432efff5c9394b1c474 add complex FE function | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8623dcbf5dfc339157e9868d99fcf96ad6c51f22 add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d09fa316f73d76dafb286449873a6e7a4ecc052 add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1cfa6c371057dcc7bef09dc75a6a72fbeec8beaf add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 94bc56a17999b547cf987f5fb2fa7fbbc9568d5f add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d0b1d5ee00e271c97b07017b8b351b209bd7613 add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa693b713e35d861907a2b065af33def125922e5 add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a93d5fae7249c6f8f7173b05159c9fa153647c78 add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1c9eb7ec7e7d87b88b32d30a035a1ec776e0f51e add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fd2ad63eeddfc58a1ac4bca70a421ee1149e2d6f add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47883d7cafcc0b7a545b3d6b194b5e200267ec1d add new manual call manual-full | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 99f70bd4f7d642d284edd796939449e5f061f78c More information about CVS commands. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3dfd1a5fabc45a1db80426f039728c276f6287a5 Regression tests pass with reduced optimization options on PowerPC G5, fast mode. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1f4c4b81855585663e3336c171f6ba3ba5821014 Regression tests pass again on Macintosh PPC (generic mode). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f1c496c1e8155848d7a5e94bcba282f211085d0d Make regression tests work again on Macintosh PowerPC (debug mode). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7b25e3dc3644b2c487e6d45370975b2eb96c2eb4 Make regression tests work again on Macintosh PowerPC (debug mode). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c742467d8833c9834043404d130a66c3a4a7d1c3 Make regression tests work again on Macintosh PowerPC (debug mode). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fd0b0ef5cdb3edcbb6068fd79f30d23a97a22d83 Make regression tests work again on Macintosh PowerPC (debug mode). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf93fd25fc8158b2da632196b66f00d68f06a83e Still trying to find appropriate optimization options for PowerPC G5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9f382275f00023484f85a2a2fe5cecac84a01f2b G5 optimization options reverted to G4 because of segmentation fault problems | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c731241a014bcffc484d6b528c0a0c4f191a95e0 split AFunction.cpp in 2 files and remove optim option on ppc G5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fdb28d110b973f54832e3c28566c0745a42aec5c split AFunction.cpp in 2 files and remove optim option on ppc G5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 610280ddbae54268f7a37784c6e01a731932570b split AFunction.cpp in 2 files and remove optim option on ppc G5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9ee12cc0e8ce1534ccca08fd217774c64476eb99 correct pb set var CXX in load.sh call in exampelle++-Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 147d0f3174268a3b35646953df9901d811f129b8 Enables load.link work even when $CXX is not defined. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3bb8bcd1e545f37f34d3a1ca855872a6f1ee3ec0 Corrected bug preventing examples++-tutorial/regtests.m4 from being converted in a working regtests.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 25f5644854fab5cedbd72ff0790e2120fc58c83d More updates for FreeBSD compilation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0e4a4569e06e3b2b86abaebf6081189028a55ba8 Modification propos?e par Thierry Thomas pour FreeBSD | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 52cb75509ffcf5024e2e96d74dbadf1222c1f6e7 correct plist version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 66a5365bf32d48e0e63e333340851d6d57b5b075 correct plist version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b33b1a17b6b26e120b5fbe47efe85c4541fc3efb C++ encapsulte cblas.h in src/femlib/MatriceCreuse_tpl.hpp for freebsd OS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3af1765fc99d232a82c16de912e8ef8593d34a08 corret of window install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | db12c7d18a6ccc973fa17343df4a8177a89a5f8d add file for MacOS application | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 46d8daa2bcfb88bfd6d0597f5064f0e01c7b7cf4 Regression tests in examples++ directory re-implemented using regtests.m4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68369f5ee4d70605a55971ed4b26ec1148c77a6f Regression tests in examples++ directory re-implemented using regtests.m4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c5de22a86d619c61c5cd4168313d1c278c85c7c1 correct with-blas=.... tags | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 87de7513fff768fda722400f75cd72f2ae5d649c add if previous download of blas reuse it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4480d5cac9d71548b0b368d55161185ff368e18f add if previous download of blas reuse it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a0f43a9c6a18042f6620a3987bb4a0081dbf0a9 add if previous download of blas reuse it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d344e7169a5689899219bb5e9088bcaca98d55f2 add if previous download of blas reuse it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4925db416e291782293636f96b509361cece83f add if previous download of blas reuse it | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4c28b000ea43eb615a09ac41a9c0d1499f9f4739 add missing file regtest.m4 in dist make target in examples++-tutorial | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 476f9d0c7a42673ecec1365fe51b684e325a3394 Add -enable-generic_blas Download generic blas (implie --enable-download) configure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3f3767bd1fe7ec3a1fa18bb792b8b4564091f94 empty SOURCESS variable in download/blas/Makefile.am because dist target do not work before | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9b784a94738f4b1a078278361ad1ba2defd25d22 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d4db640df59524f4cfabd63fd6efaf37a5507477 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d518fea16bde2906c2c3149df8ee2e59adcd8ad5 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e74702cc763ef5a095d2fa743f8d8eda2ae6f32 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 543ece82d87ceccfa68320dcb40e3b723b5aa052 correct string[string] undelete pointer | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fd6f77983419bb33658ddcc56c49d937e378cf9e correct string[string] undelete pointer | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dfe15dfe389e319552493cf3b72f761c7bb34b52 correct string[string] undelete pointer | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 89dcf0f43192dc99f1e759b6eec69f8582fd481f expand macro problem , suite (et fin?) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | adc685c0d368328a33f1e2f0ce5e0915722e0cbc expand macro problem , suite (et fin?) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | de640a9855917b157f1ba44fdaf3b1fda93f681d correct pb in macro generation (not finish) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6869ae2cb8b7fcf97a7e808a4e9a50e114487de2 correct bug in macro expansion set version to 1.42 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 74e25713d62d14e517df0a35e44e684f7e5ec801 remove blas call on MacOS 9 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bf6eadcba541744d27b1e96e19d3709959fa5a7c add blas call in choleski and LU solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c3dd6716709280581928728a441d17fb5d83684c add blas call in choleski and LU solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 964a8b28d12eba21a47fd8c46a844e24466c7faf add blas call in choleski and LU solver | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 916064e0cb993882eaf067618b0ce677f7c77c25 add blas in choleski | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e16d5128b9bf20cb8e492c9d2824d035ffaa06b add blas in choleski | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1fed023ed0dd0c5dd1e713fc6e6206a098b9bb99 add blas in choleski | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4828b95fda6c880fa6413c366f7f0af737edc824 correct mpi/Makefile.am for compilation with g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aada5b36dea8833c4dac77e4434289b176d339bb correction to by compatible wiath g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 361d85925f7772583ec99a52349b8b10d197e561 correction to by compatible wiath g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ddc72459ee11709ee591ace3f24e412e85ae81b correct g++-3.4 compilation probleme | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47915a4a2cb8b045cf0b41459c5fd384fe7e864c optimize cpu times on choleski and crout | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 47aca8acc3c4977cf6fee967ed2e1eba2e943cb5 correct divide by zero in plot put default solver LU (UMFPACK is too unstable) add one fonction in FESpace to force link include of some finite element P2h because static library do not include all the archive file (.o) so before we forget P2h FElement. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8580b6f7779097dea22e70936c63179a87a7c69c correct divide by zero in plot put default solver LU (UMFPACK is too unstable) add one fonction in FESpace to force link include of some finite element P2h because static library do not include all the archive file (.o) so before we forget P2h FElement. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 379f28bf9d9cfe9ea16d666f572ce3ca240796cf correct divide by zero in plot put default solver LU (UMFPACK is too unstable) add one fonction in FESpace to force link include of some finite element P2h because static library do not include all the archive file (.o) so before we forget P2h FElement. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5f31d2a9b8fd5247f5bfd4d4b58c3919da49514d correct divide by zero in plot put default solver LU (UMFPACK is too unstable) add one fonction in FESpace to force link include of some finite element P2h because static library do not include all the archive file (.o) so before we forget P2h FElement. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6c4b6e5ddc70d016a0aca72a188bbe02dcf3315d correct divide by zero in plot put default solver LU (UMFPACK is too unstable) add one fonction in FESpace to force link include of some finite element P2h because static library do not include all the archive file (.o) so before we forget P2h FElement. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 506a0084477d47c3fe39fbfc71f85f253e6a2e26 Windows package for Version 1.41 complete. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63254250810b89415c79b1da52782838349a7772 Windows package for Version 1.41 complete. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e96f58ef660314e6ed27bb76f8b1f9ec21f0cfeb Windows package for Version 1.41 complete. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5524a03c22154c063de6e510f86cd6b3f7a4336c Windows package for Version 1.41 complete. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e6d2353ae818b1af04b735818fb787368d026cd9 Windows package for Version 1.41 complete. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e2ec071199f456ebf7c5304bec240e8e69fa93e Regression tests ok on an Athlon 1.2 GHz. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c5adce9fff61e25965ce18880d0755bc3f9091e5 Regression tests pass on cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9ddca6a414349dd2148baa284a2a59dd4180978b Small comment change. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 791c2836de46bf77b5d3ad8571b0833332b52edf Downloaded generic BLAS now work on cedre (redhat, pentium 4). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe46ed61d5e835ac9a46b506d9b1942a15267dfc Downloaded generic BLAS now work on cedre (redhat, pentium 4). | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b13c329459d1f2915c4ae536505402197a256e11 Optimized BLAS replaced with generic BLAS for generic compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e6bebb811bc60a39d52f66a6f3ec878893875aac Duplicates xerbla.f when downloading generic blas. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cb7028a52b3d87f21c7757de6fda7e38d9d52e8e Uses generic BLAS for generic compilation, because it is faster to compile (on cygwin) and we do not need as much optimization anyway. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f6e8644e32cea589a7523180cb632dcbe7f7c890 Uses generic BLAS for generic compilation, because it is faster to compile (on cygwin) and we do not need as much optimization anyway. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 823783b011faba82d476eed3c1fec01f3d0b2a35 New script to upload Debian packages. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 41b90f1411b99e9e98fe53421e8ac498f8bfdd72 New script to upload Debian packages. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cd8717bdebeb702b96ff96e99ba68afe3ff93c6b Mise ? jour de la liste des auteurs | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2c82634a1da2846e810625cb7a4e39579b90dda3 Binary ATLAS download disabled for the moment. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 59e6a0d26e033953d54f78a93a0fbe17ac0aafa7 install-www in progress | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 834e675c69da2d15a66515c6df90b53bff6ff0ed The precompiled ATLAS library is now correctly downloaded and uncompressed, but FreeFem++ fails to compile because some symbols are missing from that library, namely _dtrsm_,_dgemm_,_dger_,_dgemv_,_dtrsv_,_dscal_. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c65ee592c1dc9ec84e18311dbb2e48440bbacf2e The precompiled ATLAS library is now correctly downloaded and uncompressed, but FreeFem++ fails to compile because some symbols are missing from that library, namely _dtrsm_,_dgemm_,_dger_,_dgemv_,_dtrsv_,_dscal_. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6eb6b465071e41714adfa672dadba9cff923de90 The precompiled ATLAS library is now correctly downloaded and uncompressed, but FreeFem++ fails to compile because some symbols are missing from that library, namely _dtrsm_,_dgemm_,_dger_,_dgemv_,_dtrsv_,_dscal_. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5bfa89330c57ea099a59ef19175841f0e74d95bb correct install-www | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 16917c1b587f734b93d04f70f581e960f2ba6c02 Reference values for regression tests with and without UMFPACK merged. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a7eb8835e8be49bab0560ba1d46340cc62c38e4c Reference values for regression tests with and without UMFPACK merged. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7439144041c403422fede0ba97ce3245bef40099 Reference values for regression tests with and without UMFPACK merged. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8309b8807cc39ef308c8b1a0cf97d95477926b5b Option to download a precompiled version of ATLAS programmed in, but not tested yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ec81d5ac530ea28c3805eb3ec1ad8f270a754652 Debian binary packages created, but not tested yet. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3273eaaef9891829d8d5e34a4bdbf38547c57dd2 Debian packaging in progress. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fae18186fa3b24824aa97be8cc779b414daecd1b Debian packaging in progress. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 771680ed91573e1def4ec226a68fe5e35b01bf38 correction on macosX version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b626ba1484b57fee725ab2a6abd7122598d4ad4 correction on macosX version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a4f6339b4c990ebc97df5ff231c0bfbaac2c3176 correction on macosX version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd012b7e0dede16dc99e534524769b8df58b3468 correct pb in freefem++.app on macosX | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 303ea21cf663212ebf5c01f4a663e2b7c7e71f46 correct install-www script | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c96f9bcfcfe2191ccbc46cff571b89e88008c5e add native9 make target for Mac9 version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a8ab1f18a647079668753e3a2fb32e012c1760fe correct pb in MACOSX version and instal-www file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c35fcd670b09ed2c7e3721d27d310186684ebd96 correct path of FreeFem++-CoCoa file in install | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6ded6bcd769bc5a18df77b9e8c83603856d890ae Add COPYRIGHT file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 928c002afc3e830bb26c32b5b1e7220b9afcc287 Add INSTALL-MacOS file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 496a1090775a46d008231063468c47d2519f2dbe Debian packaging in progress. VERSION included in WindowsPackage.iss | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5e0afdfdb35a34d71129098b5865fd9c1cbbc506 Debian packaging in progress. VERSION included in WindowsPackage.iss | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b0afe37e2d2b15fd07edd0ff3d6e26a17c63c9df mal change in epsilon for regtest (on idared) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80a8b7c75f8962f51ff891b32c2cb8114b3afb2f correct pb in m4 parameter for building regtests.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6e2686a11873bd7ba76afcc1f47a7dbd01cc362 add install-www to set web server | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4a8ab1cfa33184276c598dd2dedc28f6b43e5df5 (tag: release_1_41_before_packaging) Remove debugging information | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edc8d84d1e103bbb8ad0f1d44b42df6fa6ff69ad Improvements on regression tests on Idared, but still a segmentation fault because of optimization options. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d97fe76fdf7642db84767091423ddc7314665c75 All regression tests ok on Cedre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d872e5e46c741b82ebbb59da8c784d863f5be1d3 All regression tests ok on Cedre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 193f5da0a351a157693f7136333c35e3c692a816 All regression tests ok on Cedre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2688a8443274e34e4117f41c25aafd755b338172 All regression tests ok on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a08db6ad1f2223dea577c425228fbfcf7c1fd29a All regression tests ok on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ac7e2e1fb37d68e0acaa93f0b92c3aab324c18a5 All regression tests ok on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe53f8704df004f69cb71289db84b0c6d2d10104 All regression tests ok on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 41fb8b9f76ce55b8a8d0c779216913e05cba8560 More updates to make parallel regression tests work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e8fe9f2a171bb02d923ec835d973e9ca69f99fb0 More updates to make parallel regression tests work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c9705f2e0a6bc8232f1d70c83fc559597dbaa778 More updates to make parallel regression tests work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f7dc6c2c7b605c2e601038cfab61cef5f2406ce3 Correcting some problems with parallel regressions tests. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4484eef622cd7dea103a1104f84b65c2e08f102 Separate set of reference values when UMFPACK is not available. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8eb4ca3563fa5c27b5f778177aefbd6583327b8 More tests on the parallel version (FreeFem++-mpi) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2bdc5ac8accb89fadbc5b691b72a53e99e82af6 Regression tests installed in examples++-tutorial, with a separate file containing all reference values. The values produced by periodic4.edp and Periodic.edp are accepted but suspicious. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 724065e2003b126955be3655820e6b78e9af321a New file configure.param containing configure parameters. Regression tests being developed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2b59f5fcf018df15a9b66b09a24536fc6e6a472a Describes how to compile FreeFem++ on Windows. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fa5c3580e2c4879f549848b23b4be5e11ffffb8 Because of the way return codes are handled inside shell pipe "|" commands, regtests.sh was not able to detect errors in FreeFem++. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 64fad86e7e5ad308947c505bddafc55030841899 More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2170180127bd7976042ebcf5375b22b73be06eac More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68428b9bd67acbc0ebedd3b703e7ea2d6e6c48c9 More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 693bafe6fc92ed5c4508f5830886a9377093da24 More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fe9039369a12fc03f0b8368fae60cc08aded8b1 More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 021617039519f025a2d53aee809c37e5a71e2a0b More upgrades to make the source tar file compilable on most architectures. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fb3d8ea4c667f5027804dd74d4f5960fe7a3b941 correct double echo in macro expansion | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa9289827f9cd312b9c27914c867aa8a8d6ef710 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e94906ef64575b78ed7536802fe346a21301a186 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f07f158fc52e99dba9af830357a05b8e7bd83b68 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4927994c73550e7d1416868317cfc112fd7c7518 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 55b4dee394537bd7c10d8d2512aea48368501c61 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd89311a38ddc489ef2fc3056f49b35facae07b9 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c205c2480d12f36eac6b4f696a1229de3beac994 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f9ccad12f76f53e631d517e583b74fa1e21280db .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e9f4afa3b0031e98c21c9596f2d69a3bae2c2af4 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 296805d5101a0d7c42ce9f0083c0ab7b8921a610 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5d95b6a6deb7f4d2fb0a65dbb89b42564cf79a53 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6fe2bf81db3da1568b70d727a80c589d9b489ce3 .tar.gz packages currently being tested and improved. Testing architectures are currently: MacOS G4+G5, RedHat 7+8+10, Debian Testing+Unstable, Cygwin. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 31b173584f9043366e1d935074daca52f783673c Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ea488a9f7f41e548c8268cd741108ba4d813ee2 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dd0af0ae303de2962aa0a0965c42d9ecf2d5ff36 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68a73d8189a72950b8596b5853ee01136d93b103 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 160245f805afa983d6124e70136911e43f200665 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7ae75fe93bddd65f19c9498dd5a585c3386b83df Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6b6858cc6a659adca3db8be947023e792cfe285d Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43329b4fc810e3c65949390ecc53e9d52feeb11a Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0a507b7cdac8c08d400af3418ff79faf57980578 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2bba06d6b9dbedc956237df43c49a28dabaaa506 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 28a419d2202c2c740f8416c5df8d7869d1eb3121 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c157f88082277a8bbe29a7ab30d6f3fb7499af2f Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e507c547c7ebeea53e4db326d9e84d9ec8565201 Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0d95b3fc6d5b5610ac533b4153e524e0db8f7e8b Gathering all regression check in one location (regtests.edp) to let the examples free of the checking constraints. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d2378332f4667c891f27d70849b06dc2537c5812 Cleaning and improving the MacOS version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83a7ac6331cc4bf8bdc8a28424a534ea7829601e Cleaning and improving the MacOS version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1f1c31a597af691798780c0249d66057ebfffd32 Cleaning and improving the MacOS version. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 88f4f8a2c7a204ddd5337875772240301ea39f25 small correct | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3fd01dd8542756243d5cc365be46fa4fd5506bf FH correct pb in file name | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 414f0d75a5a3645fa9d96a493ab1217037146b3d Correct small thing in DOC and add losed figure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3dae20f756f2997a6b11b50797b344df0020bf54 Correct small thing in DOC and add losed figure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 10f3bac304732c29d8f32f55d2f71ab8db4d4645 Correct small thing in DOC and add losed figure | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1ea54bc0c6d5ad09a1053e24fc7b52ea1da4ccdc FH modif .plist file for MacOS application | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa92cf0b3a241f772efad33dacb6b9723a3e5db2 FH modif .plist file for MacOS application | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8c5e4b24ec79cd22357919aae56cf0497373d569 FH modif .plist file for MacOS application | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 32595ac7776892089fb5f8c6cc125ae747303ace Added a new scheme for checking numerical results in each example thanks to the "assert" keyword. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ce06827b76ea98cb207adf37eb57a21b1d6c156 FH: add bug example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0ca1ab1d7475863485d0d88516d1030e2676cf1c FH: compile FLAG optimization on MACOS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e6eead78017bb66b494434b4c9a7a6c7c371a7e9 FH: correct the -fast compilation flag on MACOS (remove -malign-natural) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 68b9dd683709ba821d4d9c0d0039769c4cd0be41 FH: correct the -fast compilation flag on MACOS (remove -malign-natural) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bcb877ef121e8cc1603ecee03c2874d2b94cd6f7 Making "make visualcheck" work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4e4e9321f62f9afa3849bd3a52e43572bda8cf1c POSIX system calls times() and sysconf() are not defined in Mingw system libraries. This is checked and UMFPACK makefiles modified as necessary. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f2a9894fac57dcd334a869993b873bc78a852b7c Displays test output as well as recording it during regression tests. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4a07cf59eb3fa33bac0f4463f41eaaa9efb7c547 add a forgottent & in toString Complex) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4d057b23855564f20816f4297aae2b15d809dd7e change toString to remove problem of optimisation flag -fast on MacOS | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b701ad1c0f40abc85bf0ac26fcdeaecbf8e82cb5 Avoids the gcc option "-rdynamic" (used for dlopen()) on MacOS. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3154a167c345adef70ed2264ef5ad4eb8e216d4e Still more corrections to make regtests.sh work. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7ccfdfa04a0cfdc16b046e9a5564ae90f3ebb799 Corrected bug where FreeFem++ command was not correctly constructed | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 591e30455ecefb2627ab5613b41e0b43eaa11366 add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 63bf649c992e870aa76ad6a3e2e0a6a892bc07bc add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af48f7f1c4cd689e7d448661100e89354f5da759 add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0794e3f79baf38fa3b765792a41f2779f1757190 add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cf1360bef82a9256af2ad03f35195e4f034ceb6d add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c3ca50785e53cba17f722dd987da7b29c80d00e add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1e999ba7c2848737dd2f453681ae802ac041db38 add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8fd877d470c47be6636ef8d90561c97549b26314 add periodic adaptmesh stuff | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21d6dc81230f2cbf1d8af298b53b744698491639 Corrected bug where file examples++-other/speedtest.out was not updated properly. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ba71c0b465ed2d8e6af6da4b0646f51ad0c01c01 Replaced all occurrences of regtests.pl with regtests.sh (shell is found more often than perl) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 615b1778fc9a5366a9e9c80eb0264c0ff2b13143 Correcting the definition of VersionFreeFemDate and VersionFreeFempp in config-version.h | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edafe8b206da9e86cf359c950f742f5dc67ad518 More documentation for config-version.h generation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fc52eb847af15353b09ad9ca5ad8f94bdb039a5c - Restructuring the regression tests suite to run all non windowed tests in one go. - New configuration file "config-version.h" that can be included separately into MacOS 9 sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edd267d039e7ea522949439124f00cf5006dcbb6 - Restructuring the regression tests suite to run all non windowed tests in one go. - New configuration file "config-version.h" that can be included separately into MacOS 9 sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe3b61f02ae9848f52c51088052081ab83fddb79 - Restructuring the regression tests suite to run all non windowed tests in one go. - New configuration file "config-version.h" that can be included separately into MacOS 9 sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 50c341105483b0baa78263527b8e56552cce2722 - Restructuring the regression tests suite to run all non windowed tests in one go. - New configuration file "config-version.h" that can be included separately into MacOS 9 sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f581aa558ab06ebe29c48a7894c823d24dc00337 - Restructuring the regression tests suite to run all non windowed tests in one go. - New configuration file "config-version.h" that can be included separately into MacOS 9 sources. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b107670aae377ac4071ffd562d9870e1e4ea8b85 Ajout du packet freefem++-doc contenant la documentation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a007cc6a7891ec67677358e10ca77c42a96d2356 Ajout du packet freefem++-doc contenant la documentation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7c8b10a7b2d5c88fa5d4ca4e5cc186be718bb2db Ajout du packet freefem++-doc contenant la documentation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c922267ea714e0ca1e1b80b4941045b8b8cc234e Some commands (like make speedtest and doc) are more thoroughly documented. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1c0e2a3a92213464191f60b2ec3f51a37602b8e4 Give a value to LD_LIBRARY_PATH for the examples++-load regression tests. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8758a116b127c5a28a2416eda87efb5807851ba3 Regression tests for the parallel version are ok. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 19d95e4c4c2dfabb2e50d738a3f0858cf79b45c6 Changement de priorit? des alternatives. x11 est prioritaire ? glx. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9317393cadb91f67482834a489fdf2fe5f5ce4e4 examples++-load now works on Cedre (Red Hat), with debug options. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4d100abd99d8b60cceb8b613efafc0c634d9cc17 examples++-load now works on Cedre (Red Hat), with debug options. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6c6d2b89d57677c1be1060a91bafc30c986aca9 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 27649d2bfaaf7815b328649ef33a00a83d0ad701 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7e2826606fa2efb83a144af8548fab12552a6f24 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 01d4a0893fec6d2b7c350a1e6d85720e57c63777 Ajout de plusieurs this-> pour la compilation avec g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9fbf8a0e1d7888e98010851625c7ae435109d3fe GLX version was not compiled on MacOS X. Corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 439883c5f387d7ca014e1d6f51cb349971e5f33e examples++-load is being worked on. It still poses problems. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4dbba4d4d6e4740f004d179d82a03bea8ce136e examples++-load is being worked on. It still poses problems. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8544ce69d555b48ba0c03de56c7788761926c9ba modif to bee compatible with g++ 3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 903872aee2c590e08a18f8942355163a15fbc30a Nouvel ajout de this-> pour la compilation avec g++-3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 78beac3cfcb7757519853129b629febb65f18d4a Ajout de quelques this-> pour la compilation avec g++ 3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f3009acf14b61c7699a2f91b28a4c6da9bc0a356 Ajout d'une page man g?n?rique, obligatoire pour Debian. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 455f81273c594682d639bb99f82adf909e4b2a8b Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c842943f7eae647ee05dd6b052fc3a3157e31a91 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9c020e5b3994ea49ebe6ddcc1d467733b9ff917b Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7afa8a9c07c15128b6be6c84d7664b62997db013 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 381665c90825f04f66e8795ff189e03675687008 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c85cc3460f83cb60cb325c8fcfcb78f6420e2989 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e261460bff56c9ecfb61f7ba8e890e85d3eb9759 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e4d697bbda92af93297f89076b3e207c01ce52bc Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 160954c9441f9bf7144fed5846dbcc8bdba9bc81 Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dfabeb13c40c17f6c82fb157d9571727d995337a Insertion du dossier debian contenant les fichiers n?cessaires pour la cr?ation des packets Debian. En ce moment ils cr?ent cinq packets, freefem++, freefem++-nw, freefem++-x11, freefem++-glx et freefem++-mpi. Le premier contient les fichiers communs et les autres les differentes versions de l'executable. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c3ffa06ce1f96506f56e3ad6fb9844cf1c329992 The regression tests have been checked up to examples++-load not included | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 64b28360d6f05dd05669ad10411e67152f753756 Problem with AGL on MasOSX solved: it was not selected for compilation by configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 76090b74f6823332d58e27e7b28c7ff1825a6a6b Regression tests are currently being checked. There seems to be a problem in examples++-tutorial on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8b6b65c6c0560a7c39ea5bf885f946b6c785773a Regression tests are currently being checked. There seems to be a problem in examples++-tutorial on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b8a6eff37263789738299bbeafc14e70a6c5f6cf Regression tests are currently being checked. There seems to be a problem in examples++-tutorial on Hydre. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fa50f79f08a4c8fc1b5cdde65b53cc706450062d Mise ? jour de la configuration de UMFPACK D?but de reformattage du test des exemples (avec "make test") | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d1845df26f56397288e03af9eb2753e239bd8a84 Bug preventing the separate compilation of src/fflib/lex.cpp corrected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8b503e1b605a3362bb3216e09339c6084179953d New 'speedtest' goal to run FreeFem++-nw on examples++-other/lap3-cpu.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7efb5c1bb1560704c600280192930fe52d6f0156 Optimization ok on PowerPC G5 (Idared) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 485ef058c707699c878865ea51793077b454a555 Optimized version ok on cedre (Intel Xeon + gcc + Red Hat Linux) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e1496ddf0bb1fdf394360e3c25d66caa1cbc36be Optimized version ok on cedre (Intel Xeon + gcc + Red Hat Linux) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | af9f9ef1f569aaef90187d9b90069dbf690d31a8 Optimized version ok on cedre (Intel Xeon + gcc + Red Hat Linux) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9744b66c4420760b78cfa03ea1be47a172f6037e correction de la d?tection de UMFPACK | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b1ac54ddbb0c4d4289ceebdd6324495dfb480001 Correction minime de l'explication de --enable-debug. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c7489bb222b73e84b2cb611e4b3d2ff47187f3fd Optimization ok on Debian/Testing. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ad463b7151bb443f6d439dbcf7085f2eed46d43d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 915f43e53d3fd372d1a451599ee1efc4a47b2021 le fichier fflib/lg.tab.hpp est dans de dir lglib et genere par bison | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3c8f5425ab236a1948e8115277c9192e7d51c25 Parallel version modified to use downloaded UMFPACK if available. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 004982a951b2c15f5f58431df8f9d282b050f165 Some corrections for the "generic" optimization mode. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c96756a7ddbb51ace93ad5acc37e365e6daa2987 Hardware-dependant optimization options currently being selected. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a080f56f71243b42a1ea6d43cd0f304dfe30ae52 add example of test the optimised version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e583c4b664aaef0f70fa1d80d33a3fcd9b363617 add example of test the optimised version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8bb8f8ba0570dd4226077da8d19d2e41835c251e add example of test the optimised version | | | | | | | | | | | | | | | | | | | | | | | | | | | * | cee7e675e6969e4994675faaec0063b6d18b8d30 Optimiztion for Pentium III added. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 595d13d5fdc67c3a4c99b8b8e44afc3f8eea23c8 Configuration of compiler optimization flags still being developed. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 810cb0e187b1f5b8729ab7a55b2869e084f95b98 acmacros.m4 and acoptim.m4 will centralize all the necessary treatments for selecting hardware-dependant optimization options for compilers. They will be called from configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0596e2c3d4655c93a46835dff7dcfeecff01ca0d *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 12dcdaade89f99a618e11f8f8785640534e52cb0 add modif compilation avec gcc 3.4 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d186e6672654f22b8656859a4b794b94c69c9cf7 Documentation proofreading ok up to ?3.6 included | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3e0cfd84c52c53a1a6be2e343112104d04e67bb7 - Documentation proofreading ok up to ?3.6 included - Some old project files removed from the current version (they can still be viewed in previous CVS versions) - configure removed from CVS because it can provoke conflicts if generated with different versions of automake+autoconf (same problem as with the makefiles) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3ea01ccf649c0c33c8cb664c1f0a9aa99085fa75 - Removing emacs backup files - Removing automatically-generated makefiles because they are different on every machine. They could create unnecessary conflicts. - Proofreading: "sparce"->"sparse" and documentation ok up to ?3.5 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ce85ac51782fc0b0ce937a8bd71ca4ad21537eb5 add projet codewarrior dans la base CVS en mode Binaire | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b710eb332de15745d247225c8dd4502fb21a17ad *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ac9a224e3b688283ec425e6c3324904846479839 correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a7e8bbbb1ef5fc943e1d0970dfc5556200722abc correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d95ce246acc7d7eba3988e5dba90a93346a7005 correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bd24631c3768be6c18a969771038a54849197452 correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ab640c3c9e0aef811e8ed7aca13cb4db1fbd94c2 correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3d163635cc073b294fa13bc5d11efc80a64a6778 correction of string argument in macro processing | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ff64216ce431a40f1ac35d8cb4e68d9c0751d91b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ffe3be96f8d47d5a2c3de41789a079c3e9536303 Proofreading ok up to ?2.3 included. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 144e9acbdea1a2b22644a4ba664d0aabe81475e3 - Relecture Anglais documentation: chapitre I ok. - Proc?dure de mise ? jour de "ChangeLog" ajout?e ? Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1d5e094873ae995d58e22bb1e9649ebe89cd9810 - Relecture Anglais documentation: chapitre I ok. - Proc?dure de mise ? jour de "ChangeLog" ajout?e ? Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f093d8a850bc7b585b6c666a207addd925793c5a - Relecture Anglais documentation: chapitre I ok. - Proc?dure de mise ? jour de "ChangeLog" ajout?e ? Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 23658c27dc017896a3d445a59bd173a72b0fa188 More help on CVS and automake. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b7fc17d381fcc4fd6098274c426e5ec2e0c86048 Relecture anglais doc arriv? au ? 1.3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1521c27588a72da247b9532a65b80b2e4878640e Premi?re relecture des fichiers README et associ?s. Les contenus sont maintenant en correspondance avec la nouvelle proc?dure de configuration ("autoconf + automake") mais il faudra sans doute une deuxi?me relecture pour ajouter tous les nouveux d?tails de compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d773d196bb2555843c609433a52dabb09b8a7502 Premi?re relecture des fichiers README et associ?s. Les contenus sont maintenant en correspondance avec la nouvelle proc?dure de configuration ("autoconf + automake") mais il faudra sans doute une deuxi?me relecture pour ajouter tous les nouveux d?tails de compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 83c20df4a02f9a60fddac3678e8466ea583886b0 Premi?re relecture des fichiers README et associ?s. Les contenus sont maintenant en correspondance avec la nouvelle proc?dure de configuration ("autoconf + automake") mais il faudra sans doute une deuxi?me relecture pour ajouter tous les nouveux d?tails de compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3d354ec4f87770d0ea3b5d2b57540d54c26bdf47 Premi?re relecture des fichiers README et associ?s. Les contenus sont maintenant en correspondance avec la nouvelle proc?dure de configuration ("autoconf + automake") mais il faudra sans doute une deuxi?me relecture pour ajouter tous les nouveux d?tails de compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b760e915cdef0278fc0228bc82977415682cfbaf Premi?re relecture des fichiers README et associ?s. Les contenus sont maintenant en correspondance avec la nouvelle proc?dure de configuration ("autoconf + automake") mais il faudra sans doute une deuxi?me relecture pour ajouter tous les nouveux d?tails de compilation. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fe1e1dbe992b15cedfc2ce0040394f06abab6bc7 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9164d969ab8c8a93b08efedd1d1128fac68a4c27 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 80be26e87b894023255a24468e7571793ab7ceb7 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2921f932587ffc577a27fb735648bef6bfcf64e5 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ae37ce31b35c4327343cb16974dcdf7f99c8cf67 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 7373fcdb2049d0ce493d509f8dec873bb7233359 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0422ea09b60ac7563ea3522cea5c93a6eca24dd5 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 038a2f4a95be2bd096e272b7d97d49cf3e6e7d2b Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f98bdcf9b375107a9553fadd529c255476eaeba5 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b44d8bf7909a7c4acdf85dca9c8f045783b02349 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | da3861b57a22c25f3597f5a116d83e4612224779 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 56de0a3e2cca7e04ad9c922e1680bdaa8a70e554 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3b462e2add1f948c5b916a0cb04a9e3b8b4bb0a0 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | eb7274dcf47ea70d701112aa341ee8448e811faa Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1d0fe1b629801a948f1d2b7c531192680318f752 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | be282ac71739e77c9479b1143e677f4c2ee9d05c Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 913f3620ff22cd709f53bb9ff238823098ea0c1e Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fcfdfaa9358e5556c09e599af437617f59509026 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 70c32ba0457ee0d4d75b3cd04fd333b723c50d09 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 438ed97c0147ec12f684675b09c565aca6f95d05 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 21b0acbda0cc23d54361c2f35de6b75d2cba3f7e Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0b2b8601fd6c3573ae174311e954cf4d599c3fd8 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 14a2eef7e07623b0cecdd08b6341959af20fb992 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5aba66ab8b889a46a63010073defc6af43b0015b Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d8fe8bb3c2308f2ee31865863c505c6496f7c7d3 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2920e6664fb8a07315debe4440996e28bf5151ae Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b915327105ea5b575d0d03df24945c9acc8fc5f1 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 390cc8ab9734e7168c0aa171ee465162fb6c0653 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ee2987981c57004d7908ba270585ad5215fbd5f5 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aa009c93edeb2d7cfc497816a2328ccbaee4f194 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6b78854fdad22497478c9a8df2f4dade364ef7ab Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1102ab72264f34ac077393584493cdf81c3a69cb Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a3ff5cf617b2dce97a80924aaf57feda77d10c64 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e3d0a73a6950a686fdce354490e5d288a170726a Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 49c2cee9ae34efe620503636be93571e4ca838fa Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a63cbbf355ac748743122dfe5411a664fc545cd6 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 02050bfa3aab91f806c7a8962b0f3f1c9d2eabd3 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f94ec18e56207ce7fc906ba9fbe18f15bdeefdcd Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 20d4b1a7b4984071526cc140566b781258a6a199 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | edcba5bc6115a4ff75c7d878cdb688182a0e0ce3 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9848c522f3184071bc2df8bb4ba99505a8d5a463 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 85da13de5f568a56f2a9b12d330b64f9b4a24976 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5dfeb1050263c83fbf5a05b2cbb3cd444a649c2b Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a4a490adf0908905263cb3f160bdfae5872efa40 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1526f6ad43018f2f04587772d07b5086b6a8b311 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | fc010e546e563363c7ec178ccc4c3df9ceb34506 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 0e7ae26bf46f5e0f9fb9deef9c25496a9cfac15d Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9f1847d1dade2a2ea4fd935fef1b17bbd3d28881 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 736fa15b5331be476960485cf671475c3f69dfb9 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91581a35862e533aa4c1d52f9d42c20a09bb25d0 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4eeff1b1edda2a9657f19a3cb5f32cf996de6fd6 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5ea57e9384856d39b3080ea5f89eb29eed9a9abf Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 697a11d1c107a1a22b2123bc31e5dd9690cfbdff Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 605e1c70d0f16dcec13372faeebee638f9e6526c Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c59fb874ab6fbcfb44d5f5fca239f15f8302eb23 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8d1fc1fe444fbe419ead7744cbb67be029e98ee8 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 06565c232019a80f944f5c357a489b30a8cf10e1 Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 9fbf0500effead2ed61737201c8ab8aa7cba0aed Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bdf1cc4a6211c59ed31036d262de98ad789fa1ff Les modifications faites dans la branche "alh-autoconf" sont r?int?gr?es ? la branche principale. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | dee172a90d645407efc8252b8fe7dcb6a07e7771 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f010cae1f75a68530c38c56a7a210c830957b38e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e9e3730540e53fd1933c431965cbbc861dc7e35a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 781a6a86c55b4b90fa2427cb6ae5d495b2ffa806 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2aebb88b6571c67feb93126dd2dc74bf7f09ec3a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 3dad4fef36b7ab00b1aae69003dff357766cadad manual.tex est r?initialis? ? sa version 1.6, car les modifications pr?sentes dans la version 1.6 semblent avoir disparu de la version 1.7 (probablement ? cause d'une erreur de manipulation). Les modifications pr?sentes dans la version 1.7 seront r?ins?r?es dans une version ult?rieure. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e389bfc910da742575530d5c205fa8b9ad4f82fa *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e7526811ebfd679c0c5927fb5c0a2de439a46dc6 Chaque exemple a ete reecrit dans un fichier tex separe, et inclus dans le manuel par la commande 'include' de Latex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2983eb9ce8411c10a30e8ee6145fd8fd38e56943 Chaque exemple a ete reecrit dans un fichier tex separe, et inclus dans le manuel par la commande 'include' de Latex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 35f16c96bdff6c683657c8111b5897606c54e050 Chaque exemple a ete reecrit dans un fichier tex separe, et inclus dans le manuel par la commande 'include' de Latex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 43181df65637a137492071fafed1b5d4de315a9e Chaque exemple a ete reecrit dans un fichier tex separe, et inclus dans le manuel par la commande 'include' de Latex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e7a3922f64258a0bad8a9117e56314aa7610f104 Chaque exemple a ete reecrit dans un fichier tex separe, et inclus dans le manuel par la commande 'include' de Latex. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 801d1a6b2756eafc5aac15bbfee0d30153e41191 D?but de la relecture de l'anglais de la doc. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | e394cc98bea81910ed4bd5765a8dda46fc68f797 manual.pdf and manual.ps.gz are automaticalle regenerated, so they should not be stored in the CVS repository. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a17b8802f81aa877a04a944018d93444d516652b R?cup?ration des Makefiles (depuis l'archive de la version 1.40) qui avaient disparu suite ? une commande CVS qui aurait d? rest?e localis?e ? la branche "alh-autoconf". | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 325e7c84fd6cd50a9aadf298590be87744135c18 S?paration d'une branche sp?ciale pour les essais de autoconf. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 4fd66f2ce19bfd5a5e62c6d4eb85ab672e8ba9f0 Int?gration de Autoconf et Automake dans la proc?dure de build en cours. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f8dbf111a9169d84a221ac4adefc98ad35a77cbd Ajout progressif de tous les fichiers ? ignorer. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a6f0d222937f0d5601521b8cef4074dbc00ab538 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | d44102cfa8342d259baf74551243a85dc4426b8c Fichier reg?n?r? ? la compilation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b9613edf8d4c6f16a12fba7d27b4a876da10d513 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | b3d741ca293e5ae88530dc5ede569d19a81abfed *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 1cff66a83427515f498a23970dfcb1a4705d95f1 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | f52dd2b2a5feb6c4a0a2cd4d6ef75528c2664c0b *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2d5426fbc6fa08800904d9827d2429f21319e262 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 8c9a382a17281961b92d46be17696944d609d3fe *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 2f716685bb26496f07ff6ca224d57f88ecfb2b88 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | bfd1f19a5d0a76dafa891f5726a053a1f1581185 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | ae588c313739873abe19aee4368bc931e5f3d092 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 207e692d7a038c002dc01f38bbd476b607910242 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 91767507f99c6109f0634581a67515c316a54314 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 694c1c2dbfd9b6adc988b26a9d2f83c58c738666 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 84a49f248bd97aa7febd630cf4fd30105d38a827 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 6d245cb35c68dc1426ae693c0f49989c86149a44 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 5734fa91a22784b36aa76523048c8778da40b723 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c0d994c3e2b0bb0aae41f19056194df12f63428a *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 11bcfe73f75640019a21076a8cbd6174124e4e19 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 29a18fa8399ed096cd35adc528ee5708b5d2a2d1 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 684f71d476f84ad71a5234b7abec940f157b631f *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4465060acc0c7bcfcfd269bc824ff2200404f8e *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | a63ace76a97660d6a9036f8392943642bbb70bd4 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | aea4c673283ea0a8e0a6d188ebc77a9c4e43a392 *** empty log message *** | | | | | | | | | | | | | | | | | | | | | | | | | | | * | 19324b13c85470470b82d83620d9243e4f209b31 Mise ? jour de la documentation enregistr?e dans CVS ? partir de la version de hydre:~hecht/FreeFem++-doc dat?e du 9/4/04. | | | | | | | | | | | | | | | | | | | | | | | | | | | * | c4ccc0aaa9661d1e0b68dd338a525a6ad8452a17 Mise ? jour de la documentation enregistr?e dans CVS ? partir de la version de hydre:~hecht/FreeFem++-doc dat?e du 9/4/04. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f407727df33c38b25f17e22bec33d2ae38acdbe4 Modified by Antoine Le Hyaric on iris.ann.jussieu.fr | | | | | | | | | | | | | | | | | | | | | | | | | | * | | eedf7c157d00e96fed5077818ed5b9291f0486e2 Modified by Antoine Le Hyaric on iris.ann.jussieu.fr | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8ac360b410f02ff01afdf468e8d728664f98667b Modified by Antoine Le Hyaric on iris.ann.jussieu.fr | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7de03ff0d2abdf568e89f6330902274f87371b21 converting from CVS to Mercurial | | | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | | | * | | bcc9d550405e19dcc54d6efcfe9a591e3312e03c correct a mistake in set metric in adapt mesh, thank to J-F Remarcle. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0e2709f51e872f1e0513c24cb9a27f32db023dbc correct missing mpi_include flges in superlu-dist makefile | | | | | | | | | | | | | | | | | | | | | | | | | * | | 65e7ae00da22a849b39c4543221d3aaac6778c4a update | | | | | | | | | | | | | | | | | | | | | | | | | * | | a172191280304eb13a98475d698b510927d5d14e add missing file and correct download/Makefile.am to remove infinite loop if missing directory | | | | | | | | | | | | | | | | | | | | | | | | | * | | 55b3968695a80046ba65902caec7019ea43db8e1 correct pastix complex interface | | | | | | | | | | | | | | | | | | | | | | | | | * | | 71155b5adde0a8d424a2a27bef9cc1bb6a72b021 corret ff-get-dep.in | | | | | | | | | | | | | | | | | | | | | | | | | * | | 02b817ad83732570412ba32dca48dd809e2f40a5 remove stupid assert (matrix sym is CG) | | | | | | | | | | | | | | | | | | | | | | | | | * | | a958775bdcd85ec7ed9d8323ea5c6d57ff1f7848 correct hips and pastix interface | | | | | | | | | | | | | | | | | | | | | | | | | * | | fe5b8cd183ff058549a9d290b12a3d31245f6270 coorect stupid bug (due to remove static). | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7c5a36f4279a1b789b7245944da2d5ffdb865c03 Correct pastix | | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | | * | | 6b32d75689fe6e86b9b14e2647331689c76f6869 correct compile of freeyams and mmg3d under win32 | | | | | | | | | | | | | | | | | | | | | | | | * | | 567ef3f9956e8629540fdd7d3285a997d34b9d01 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | caacb7ea7de82cd2a607ce18c78e9a8e7e54d429 put c++ maning in eigen.h | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | * | | e1031a76ce1694f3856af42c072990958bb80961 Discarded obsolete head f3cbf7394995 (but kept that version in the repository) | | | | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * | | 530b6e7e448d6d96d5db07a3d877de5f191658d3 Created Doxygen main page and started to document the C++ classes | | | | | | | | | | | | | | | | | | | | | | | | * | | eb398ee0bdb4d51ed8390230149f567f2e51e997 Created Doxygen main page and started to document the C++ classes | | | | | | | | | | | | | | | | | | | | | | | | * | | ecbb4044169688f79c8b5761c12326fc803521ff correct test test "${SKIP:-no}" | | | | | | | | | | | | | | | | | | | | | | | | * | | 435d41df6a1f8cdfd9cec035fcb0a62f8127699c correct TESTing of freefem++ in progress | | | | | | | | | | | | | | | | | | | | | | | | * | | 11aa0cb313f95fad8c7ebd89c24ac74b47d28fb0 update automake test of freefem++ | | | | | | | | | | | | | | | | | | | | | | | | * | | 9a224619dc62d2e7c8de63b24f5c556b4b67a98c remove \r in patch file | | | | | | | | | | | | | | | | | | | | | | | | * | | 879290b1c11fa75d4be358c74c3895e6fbb9e9e4 add ff-mpirun on windows distrib. | | | | | | | | | | | | | | | | | | | | | | | | * | | 9b127f57084b0ee596f171a4b85e9706b6cefac8 add quote for windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 2fb7e06d78a2956ffc499d11f5c8bd5d891b14eb correct typo in doc on operator .*+ and ./= correct bug in number of dof computing un 3d in elemnt RT0 in case of more than 1 boundary faces per element (same dof for all this faces). | | | | | | | | | | | | | | | | | | | | | | | | * | | 5a1e57d2d669be15a570828b072da97b515358f8 correct CheckAll | | | | | | | | | | | | | | | | | | | | | | | | * | | d683fd4e9b3cdf29577e730fe88df5139afafa86 correct CheckAll | | | | | | | | | | | | | | | | | | | | | | | | * | | a18c5a90e612af87b3c0e1d55073e5b326a0bb01 correct getline or \r\n files | | | | | | | | | | | | | | | | | | | | | | | | * | | ddff99b2018513648d381d75738478f6cffa4317 correct configure.ac for umfpack downlad | | | | | | | | | | | | | | | | | | | | | | | | * | | fdfdd35d31b720b9e0a6f41f82d364e157995c2b correct pb of compile umfpack if no --enable-download flags | | | | | | | | | | | | | | | | | | | | | | | | * | | 6a09d043820bf2cefc735080cc4c0f2d8dd00171 correct typo in CheckAll to store result | | | | | | | | | | | | | | | | | | | | | | | | * | | 4bfe6f380048b3da2552f25544482f22bde56727 remove dir in Makefile.am glx, std, x11 | | | | | | | | | | | | | | | | | | | | | | | | * | | 7e2e5c9d4e6d8641bd2e81f290182fac7b716ab2 version 3.23 - do cleanning in version remove x11, glx, std : freefem++ clean compile option for clang and clang++ compiler clean automake files | | | | | | | | | | | | | | | | | | | | | | | | * | | b68b97cf67c32d02a8a0f7b658184c25b8ca2d64 reomve x11, glx, ... off the compilation prosess pass to version 3.23 | | | | | | | | | | | | | | | | | | | | | | | | * | | 872d2eab1b04cd611008dc4786360b7b94ed10e6 coorect type in isoline functio,n Area to compute the area of domaine | | | | | | | | | | | | | | | | | | | | | | | | * | | 74cae2b83a51580ca84312671176659ef95aa69b change area to Area because area is not a function. | | | | | | | | | | | | | | | | | | | | | | | | * | | 6a104951ac2978b8230d6e1dda64e2cde40a996a add area of isoline domaine | | | | | | | | | | | | | | | | | | | | | | | | * | | 7fd8934e027cfa747526f6fbaa81580ce2f72b92 coorect bug in close isoline plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | ffbafca367fad199c101222042e235a35dfb9d8e add Sylvain dans le auteur de FreeFem++ | | | | | | | | | | | | | | | | | | | | | | | | * | | 49ac15113e9e5d67ce9f1d7809acd1b026f8cdaa remove graphics in case of -nw flags for batch test | | | | | | | | | | | | | | | | | | | | | | | | * | | 12ab2cf0c796e0f33e62fb1a19884140b8ece776 correct typo | | | | | | | | | | | | | | | | | | | | | | | | * | | c84b97fff6f111a3ab402b2630607a5b2ac36951 up ./CheckAll of win32 | | | | | | | | | | | | | | | | | | | | | | | | * | | f9d201acc6e1d7c3d32510834d1d9718fe353ac9 add patch of freebsd on mshmet add untested function in dfft plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | 12786f9b9b3f0b2fc9e31332c2de72eaf643e8f7 cadd message is case of no compile in configure | | | | | | | | | | | | | | | | | | | | | | | | * | | 20c765c1c55f640766e9ea12bafacdc52039ea44 try to put error when mesh is un set . | | | | | | | | | | | | | | | | | | | | | | | | * | | 5254275e7a60d8eed1a007adbc958c1d69d35544 do gestion on non mesh (0 pointeur) | | | | | | | | | | | | | | | | | | | | | | | | * | | 9bdce335b409e4239507159b53c4fc6e860b8d98 add tools to remove interla faces | | | | | | | | | | | | | | | | | | | | | | | | * | | 29466b70f3851ac163d53cf2013dc0a25c8c82cf coormit glumesh in 2d of no mesh (ok) | | | | | | | | | | | | | | | | | | | | | | | | * | | bad380a8547f839c88f8d1067c32d70724426f34 update ffglut | | | | | | | | | | | | | | | | | | | | | | | | * | | 91dc9245c5e910d83ece7b475affdf762a2c54b3 reput esc in ffglut to stop | | | | | | | | | | | | | | | | | | | | | | | | * | | fbe15a3f7ecb031e0a00a82c8b545bada51e79ae coorect stop ffglut in case of bug | | | | | | | | | | | | | | | | | | | | | | | | * | | c330d53c3b990313cd24597f42131c1b3a4706fd coorect the doc for new graphic option | | | | | | | | | | | | | | | | | | | | | | | | * | | 87957ce8e3216d3cd6c39ce5a967018553ce0bd0 add new graphic event and multy windows correct the doc. | | | | | | | | | | | | | | | | | | | | | | | | * | | fcbc9f4034e9a456a1ef0fe259a3362f80a4bd7a pass to v 3.22 | | | | | | | | | | | | | | | | | | | | | | | | * | | 4d43ec5781d8526528b684d142ab5c0e9bf05ae1 update plot for multy windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 18ca07c380aaf6ff5ffc430032ce1138ba4b918a solve b off int overflow in gibbs renumbering | | | | | | | | | | | | | | | | | | | | | | | | * | | c0473f77b20e790b7654069959f8e69013967f10 add type of real , int , complex in doc | | | | | | | | | | | | | | | | | | | | | | | | * | | 3d019f8d3b291530d79d8e00873cfe61fc8280fb correct sheel plug for windows | | | | | | | | | | | | | | | | | | | | | | | | * | | b46efd235dcbefa2c259b9ff8ba63df40fad8157 cooret shell for windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 97303ff94268a8f9bf68c710427cd0441546b86e add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 09b13410255ce90f014c5265c85197b788683850 correct Makefile for cleanning | | | | | | | | | | | | | | | | | | | | | | | | * | | 477e06ba2e19d80084b996d931c4e2d47f955320 add getenv in shell plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | d44db121ee9f8d9492d0248d16ce0776e53e4acf end for pardiso on hpc1 | | | | | | | | | | | | | | | | | | | | | | | | * | | 5bc387ae9937ca113b3a585c37a3c813e2c7ac08 next PARDISO mkl hpc1 | | | | | | | | | | | | | | | | | | | | | | | | * | | 6cac33d949459eda73ff577cf24cb4cf0d7a14cb blas / mlk hpc1 pb .. | | | | | | | | | | | | | | | | | | | | | | | | * | | 201fbb525600dc3851a0310a95f68494c8e267ce next step mkl | | | | | | | | | | | | | | | | | | | | | | | | * | | 21931c89d51fa5168799f9b9093ac324a85bd611 mkl next step .. | | | | | | | | | | | | | | | | | | | | | | | | * | | eb27a6b1491766b7897e336f7050a6a6f3293e18 MAJ mlk | | | | | | | | | | | | | | | | | | | | | | | | * | | 6195b159886333e0f7532bc07dab855075d2c31b correct mkl seach in autoconf ... | | | | | | | | | | | | | | | | | | | | | | | | * | | 6e77b260fd542ec456dbdf993ce1233fd1002b05 add depend mkl to paridiso | | | | | | | | | | | | | | | | | | | | | | | | * | | 5f7158fa963d834e8acb78a8901cfc8fc8648efe REMOVE Mpi from PARDISO | | | | | | | | | | | | | | | | | | | | | | | | * | | b80bc5c1a8b606a9d22d93efeb10ed5c92744a57 correct 3d trunc . and type in CheckPtr | | | | | | | | | | | | | | | | | | | | | | | | * | | b4f8fd952a7dffa306ad10b9b98228ba07a48b6e correct pb in gestion of outside flag in case of brute force search of tet contening a point | | | | | | | | | | | | | | | | | | | | | | | | * | | b2e43d08dc8e4b3ab3da386c1cce8ff481f5ff36 coorect typo | | | | | | | | | | | | | | | | | | | | | | | | * | | 021fe6ebcea982fa14adebd944fffe7073a8fe0a v 3.21-1 autoreconf. | | | | | | | | | | | | | | | | | | | | | | | | * | | 50dc26c75bff7b39d2b87d7a86612da55d132148 passe to versioon 3.21-1 | | | | | | | | | | | | | | | | | | | | | | | | * | | 38ec86764da76ec1285711f3e1116f3b8fa0412a correct timer for umfpack coorect dowdload url of mmg3d to work with curl | | | | | | | | | | | | | | | | | | | | | | | | * | | d9cee288b64ff994cd3cff4438aeff3f1f620457 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 17a8df99b10f8bb318d4cf121e894ebb20e97e30 change umpack to no version | | | | | | | | | | | | | | | | | | | | | | | | * | | fbc0809cc08e3e0a4bd6c73eed69502f783d83c2 coorect ref value of fluidstruct examples | | | | | | | | | | | | | | | | | | | | | | | | * | | f4c49df286bbb9476321ad57f4a2b51f63453266 add n, resize of arry of finite element function ... | | | | | | | | | | | | | | | | | | | | | | | | * | | fa71039fbef4a375614bbfecf5a9681065f9c8a0 correct doc for NSUzawaCahouetChabart.edp | | | | | | | | | | | | | | | | | | | | | | | | * | | 4c8d676537b758bf5239afef0b53c1fa210e5d55 up. INNOCATION | | | | | | | | | | | | | | | | | | | | | | | | * | | 55a24dfb3b0d59994e7058660e7d026635a6f7ec correct typo | | | | | | | | | | | | | | | | | | | | | | | | * | | bf5b26e03ee15e18fe58de6c79cf600e66e83849 remove export MACOSX_DEPLOYMENT_TARGET=10.4 on macos (too old stuff) | | | | | | | | | | | | | | | | | | | | | | | | * | | 529b04859084e07d7e23a5b5614194e441ea60aa coorect in change function the flabel tools. | | | | | | | | | | | | | | | | | | | | | | | | * | | 7b747e7d0ad6d6894b0362699e588e54a1550c2c rm bad file | | | | | | | | | | | | | | | | | | | | | | | | * | | b014a943898510da240f080187828dc493fc86a7 coorect missing build of quadtree in gmesh 2d case thank to Winfried Boxleitner | | | | | | | | | | | | | | | | | | | | | | | | * | | b1ca7d60ba9c51b93f50ed2c30774e1de258810c correct ff-mpirun to make local launch in some cas chanche max of connect componant in isoline make a smaller mesh size in schwarz-nm-3d.edp 25^3 | | | | | | | | | | | | | | | | | | | | | | | | * | | 720c3c4cbac631f7474b1247079ab0446c327139 pass to version 3.20-3 | | | | | | | | | | | | | | | | | | | | | | | | * | | db8bb2cdd3e46a26ce3d3e03451595454f8f31bd correct the new mmg3d4 | | | | | | | | | | | | | | | | | | | | | | | | * | | 7a963694e494813c71c1f303463920f7e9ffa2bd clean scalapack makefile | | | | | | | | | | | | | | | | | | | | | | | | * | | 3c42ad111868c07c1695851d20c27565901db345 coorect scalapack lib without extern blacs add .oo file in lib in blacs / scalapack . | | | | | | | | | | | | | | | | | | | | | | | | * | | 8146862b2a7797fe6430954099736dbb49c87e86 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 11f4b564d8a59c978d896dcf7d0bef88c601dd0c reomve blacs lib now include in scalapack. | | | | | | | | | | | | | | | | | | | | | | | | * | | f07e75daace4fe732b72521914b1f121af5ad7a7 add blacs in scalapack lib . | | | | | | | | | | | | | | | | | | | | | | | | * | | 4252e9e8fcec68db6c5da287c807f4318bce1b26 correct type in scalapack | | | | | | | | | | | | | | | | | | | | | | | | * | | e620f67fc1c37a8b15e1b33e946eac0ebfc36e1f coorect -FPIC compile falgs in scalapack 2.02 | | | | | | | | | | | | | | | | | | | | | | | | * | | 383bb0482440b2d221b31a1a8313299bca5e5e27 correct DOC freefem++ notepad++ launch freefem++ with lauchff++ and not freefem++ to have the correct working dir. | | | | | | | | | | | | | | | | | | | | | | | | * | | 55ecbbc53656371bfd6d531b758b4bfa34bf67f5 correct def on WGET in scalapack MAKEFILE | | | | | | | | | | | | | | | | | | | | | | | | * | | 71b200631e2b554e629112c44243b10ed976ec1c coorect typo | | | | | | | | | | | | | | | | | | | | | | | | * | | 180f9713320aa3d0e18de46353d0ef6ea4982bfb update pipe.cpp interface add flush tools to sync pipe process correct mUMPS inferface | | | | | | | | | | | | | | | | | | | | | | | | * | | bea8170f47d9f943ed4fe980d0d8e2549125423b move PARDISO to example++-load ( not MPI program) | | | | | | | | | | | | | | | | | | | | | | | | * | | 2cdc7269f13ab2ee1a8b29a5b804e0a4ed06eb79 remove old version ... | | | | | | | | | | | | | | | | | | | | | | | | * | | b7fbd621ed73f6e0db0e411f5c0b0b60c84c51cc PASS PARDISO to complex (not test ..) | | | | | | | | | | | | | | | | | | | | | | | | * | | 0e53fe332601a78558352f181a1c18cf4199f96e Coorect SetDefaultSolver in all case (now in main) | | | | | | | | | | | | | | | | | | | | | | | | * | | 9eaf0edaa98c9a30f0b1174e27cdf1e37b3574c2 update MUMPS mpi complex version | | | | | | | | | | | | | | | | | | | | | | | | * | | 97f494f50a0e354530582bf2e29f046cf387a8ea put compex in MUMPS in progress | | | | | | | | | | | | | | | | | | | | | | | | * | | 86f8b67ea55b4803a66bf693c0fc24f2ddc9e911 add compile MUMPS and PARDISO | | | | | | | | | | | | | | | | | | | | | | | | * | | 7087edb05e2c0be20c5653b5fc3e7795064594b0 coorect MUMPS.cpp | | | | | | | | | | | | | | | | | | | | | | | | * | | 0fa1ca0d94014fe3c91eca43c656f6878e9f48d3 correct metis Makefile | | | | | | | | | | | | | | | | | | | | | | | | * | | c396c54efa95fd8590542383d8075cd95c787af0 type erreur missing Makefile code for camd | | | | | | | | | | | | | | | | | | | | | | | | * | | 553d5718f7d45d05e4fc9546f4916145b62ed87a add new matrix solver interface (see P. Jolivet) add new type of sparsesolveSym add compilation of cholmod | | | | | | | | | | | | | | | | | | | | | | | | * | | 6cf5646b50d06a923ea8aa1aa8add781cfb4be8e coorect missing setting nuTriangle | | | | | | | | | | | | | | | | | | | | | | | | * | | 537664df88c438f5f6912af11d46695590644b00 coorect missing of set nuTriangle some time | | | | | | | | | | | | | | | | | | | | | | | | * | | 701fcc54bb69a2dc83a295cd9bf6ebee9906ca7a correct mistak in mmg3d Makefile | | | | | | | | | | | | | | | | | | | | | | | | * | | 4cce5ab4333793d717a7cea45351e6463c5b992b coorect change of intallfaces integral | | | | | | | | | | | | | | | | | | | | | | | | * | | 521719dc4f2b9cbc1742e09552724ba5969d0238 remove const in cblas interface sdot mistake in openblas | | | | | | | | | | | | | | | | | | | | | | | | * | | 576ca70ba3d35cb5f83e61bbb0ac914f8482bebc coorect PB with OpenBlas cblas include without const in parameter | | | | | | | | | | | | | | | | | | | | | | | | * | | 6d92c66b71c7c1a01743713123007ecacc043ae1 add missing compile files | | | | | | | | | | | | | | | | | | | | | | | | * | | 52d95fcccb24eb80de94b7a9c1acb08a20a5a079 correct pipe.edp example to run under windows. | | | | | | | | | | | | | | | | | | | | | | | | * | | 51503b282c81b7effff28331510d8f8994e43397 add pipe plugin to link with other soft | | | | | | | | | | | | | | | | | | | | | | | | * | | e6652a4f9388e328ff7b8612209f0115f99a5d32 do small coorection of windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 355534da90845b21c0da4a11a36de8c7d3c6a00a coorect pb to set C io under winder | | | | | | | | | | | | | | | | | | | | | | | | * | | f6a1b34d55898e02cc376f374b16be68889eb50f type | | | | | | | | | | | | | | | | | | | | | | | | * | | abf3bb48277f15d71f746afe6ef792c2b300a003 correct mumps compilation | | | | | | | | | | | | | | | | | | | | | | | | * | | eeaf7a68d96fca347e3ae063b23a5a147fc977a2 correct pb of segflaut on window atexit when creating the log file so remove the log file create and a -log option to create the log file. | | | | | | | | | | | | | | | | | | | | | | | | * | | 82c7b2c8a5595ec6449e0f5d0134a7c1bc68a4e0 coorect typo | | | | | | | | | | | | | | | | | | | | | | | | * | | 9488a76e54f08dca9bc6c408e3f94ca904bc9478 add option to remove console output on windows | | | | | | | | | | | | | | | | | | | | | | | | * | | e872e52525f4578195e4bd544d2d693256a1e802 correct thing of windows porting attention change of stdout to ffstdout in all plugin imply recompilatin of all plugin soory.. | | | | | | | | | | | | | | | | | | | | | | | | * | | 810ec89dec1ea5715d3c5849ad6e63c667c71c74 coorect pb compile windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 7d7f0b3e7cee87960451af478a6de4215495eb4a correct mmg3d with new version | | | | | | | | | | | | | | | | | | | | | | | | * | | ed0b555a60c25c76f5e89526386407c247fc8cdb correct pb with drawbdmesh ( not compile now), and change win distribution | | | | | | | | | | | | | | | | | | | | | | | | * | | 29b95ac6fbeac68ee4198441cc0427e76002f5a8 add find root of real poly in gsl plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | 85bc7bbee951112e733b6e54db729995af887aa4 remove drawbdmesh on windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 895826053333f03461f01416b9dbcbbd15ae3b08 A left scalar mul with formal arry. | | | | | | | | | | | | | | | | | | | | | | | | * | | 674aa150d340c8a4071f3b581b7a61217f7b7a58 try a build 3.20 version | | | | | | | | | | | | | | | | | | | | | | | | * | | 1ab2b72976d3c77f5276bcc12525fd89f8f80b9f add levelset integral in 2d.. | | | | | | | | | | | | | | | | | | | | | | | | * | | 5fe47bbd785ba05567afaa0bca5aa04835bcb29b coorect cout | | | | | | | | | | | | | | | | | | | | | | | | * | | a8f391fef24663ee1301e4d159246ec65acb35b3 correct isoline.cpp hard ... | | | | | | | | | | | | | | | | | | | | | | | | * | | 94f5e35d85965e0a75c503142486b766df6a6c2a correct isoline.cpp bug some time .... | | | | | | | | | | | | | | | | | | | | | | | | * | | 7fd5fddb566022aeffd84ba8290c0afea6d3494e do coorect off clang++ compiler | | | | | | | | | | | | | | | | | | | | | | | | * | | 27d64c9b4438b7f889a4bb932e10eb0d4709f115 correct big problem with clang++ compiler ... in bamg with Vertex and VertexGeom copy.. | | | | | | | | | | | | | | | | | | | | | | | | * | | 9f94b277252f84d43fe3e0ca15572d39312e0fef coorect pb with clang compile, verif strange.. | | | | | | | | | | | | | | | | | | | | | | | | * | | 4eda1e626be42a3a942dde8a969411919f7b8d6f add formal tools Cofact, det 3x3, : on formal array. | | | | | | | | | | | | | | | | | | | | | | | | * | | 1ebbae0d2ce027b2a9379a468cbecd0a1f212e82 clang next step. | | | | | | | | | | | | | | | | | | | | | | | | * | | e7cf8f08cfd9fb6be99c38a29f93a1e18a159449 do correct for clang compiler | | | | | | | | | | | | | | | | | | | | | | | | * | | 5df5f12fd539a4fb423e801f89d75367bf738e13 correct for c++11 | | | | | | | | | | | | | | | | | | | | | | | | * | | f0df4d6b1bf665c84ced7ba547a98c66077b42e2 update README macos | | | | | | | | | | | | | | | | | | | | | | | | * | | fea898ea3f7d0e733bbeef886b8bf6851804de61 add CheckMPIMacLib.sh and CheckMacLib.sh taget in makefile for mac pkg install | | | | | | | | | | | | | | | | | | | | | | | | * | | 56daac55af6ccbf0e754e70fd3be16affc6069ad remove print in sparse solver | | | | | | | | | | | | | | | | | | | | | | | | * | | 7a20c8cf275dcc32a7c91a0f021c4c4262e2a398 add missing operator ?: of bool | | | | | | | | | | | | | | | | | | | | | | | | * | | dc83136eb9f0c97850bfad212ae84dda1270ad01 revome print ... | | | | | | | | | | | | | | | | | | | | | | | | * | | 19e1ed1d19bb1c3fbac3034ccb2b63e355c98b0b correct mistake find by P. Jolivet. | | | | | | | | | | | | | | | | | | | | | | | | * | | 46e5d867d8b217a4f641d1a96605364df5b39b74 cooorect automatic seach in configire (P Jolivet). | | | | | | | | | | | | | | | | | | | | | | | | * | | 159f527ec369e48a7d15a644f86e49d9aeb959a1 add comment of my installation | | | | | | | | | | | | | | | | | | | | | | | | * | | 3325f1851c6ad96c37ad882b74b4122d3b25ea04 correct Superludist with g++ v 4.8 | | | | | | | | | | | | | | | | | | | | | | | | * | | c588e434fcd370680bc3d2d6f52404f3874b4295 forget files | | | | | | | | | | | | | | | | | | | | | | | | * | | 241ec229ceaee351f55da247449765a5a96dcb79 coerect Superlu.cpp of g++ v 4.8 add missong this-> | | | | | | | | | | | | | | | | | | | | | | | | * | | e562fac411527475f2ee95724e6a6b3a1101e1a6 change mac compiler gcc version 4.8.0 add correct scotch.cpp interface. | | | | | | | | | | | | | | | | | | | | | | | | * | | d546ffab9122bb057887dff6c21e0f37a2bd6177 add example | | | | | | | | | | | | | | | | | | | | | | | | * | | 9af56277ff1c04fb2643fa963df6e684d39f2b18 add imax, imam, correct sctoch interface not // | | | | | | | | | | | | | | | | | | | | | | | | * | | 03c983bab5cc568b33e825650cf71c080ab8ff65 add compile of shell | | | | | | | | | | | | | | | | | | | | | | | | * | | e9feb94b40cd7ce2d8978ea6e5e3c9719d7b1b78 add shell/unix interface | | | | | | | | | | | | | | | | | | | | | | | | * | | b09393d4f351f1ad8289f2981e445ef29637cb71 correct PB of cleanning memory of array real[int][int] ... | | | | | | | | | | | | | | | | | | | | | | | | * | | 781e8afe333710ffdcfb09b48b8894da8b8e68fa add missing include in some computer unistd.h | | | | | | | | | | | | | | | | | | | | | | | | * | | c4f14c4d48e2ca28780c71af4d95fccb35ddcdec correct mshmet makefile to force the recompilation | | | | | | | | | | | | | | | | | | | | | | | | * | | 534c20da94729ab5b217757fa20641dc8bb8370f chnge version to 3.19-2 | | | | | | | | | | | | | | | | | | | | | | | | * | | fad45ac8da92b156afd7b3006a31e98af771f2ae correct mshmet problem in case of 2 eigen value in Hessian. and add setting of stdout,stdin,stderr in plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | 0f9e3e4efae51a98112d37d086d07a67690818ec correct typo in font size in postcript interface (change in version 3.19-1) | | | | | | | | | | | | | | | | | | | | | | | | * | | fbbcedca440467b8d22dd585bbffa027b17d89ef correct clean part of mshmet makefile + add innovation stufft | | | | | | | | | | | | | | | | | | | | | | | | * | | 8eaedf7b509f9f07cb05be2f418aa208fbc91ae4 correct missing const in qf11to25.cpp | | | | | | | | | | | | | | | | | | | | | | | | * | | 41640d92945891c270945b259e53d790585298f1 add build of Quadratur formular in qf11to25.cpp plugins | | | | | | | | | | | | | | | | | | | | | | | | * | | f86652107b335d12fe39ed7c5dbb276b8967dfdc set fftw to version 3.3.2 | | | | | | | | | | | | | | | | | | | | | | | | * | | b2c7f63b3783697effbbcaad9c4fc30d6dcb0b20 update modif of Ernesto Aranda for new version of mmg3d | | | | | | | | | | | | | | | | | | | | | | | | * | | 74493d2323fef1ed8fdc10334b53265e98c9426a pass to version 3.19-1 | | | | | | | | | | | | | | | | | | | | | | | | * | | d9d515763e12dc1b276820e88ae3b53b4dccefd2 add Ernesto Aranda change ... ++ trick to compile scotoch on win32, blacs, scalapack, | | | | | | | | | | | | | | | | | | | | | | | | * | | 33197fd4224e01a9681180b6e243a21493afb1a2 coorect typo = -> != in configure (mkl sgi) | | | | | | | | | | | | | | | | | | | | | | | | * | | 7e7da53c82936b6b8de62183a0c7c22dc96c5f94 remove of use of MKL scalapack and blacs with sgi MPI | | | | | | | | | | | | | | | | | | | | | | | | * | | 65b123e83cef370b14bbed621d1c9e8d7f6bdd40 remove MKLROOT form configure ( disaper in new mkl configure) | | | | | | | | | | | | | | | | | | | | | | | | * | | 30286ad7b1499f02449d04964974fc284b4604aa add correct in MUMPS mpi solver | | | | | | | | | | | | | | | | | | | | | | | | * | | e533281a761595a2090616edcd749e4f79bd9c7b remove cmake de configure | | | | | | | | | | | | | | | | | | | | | | | | * | | 16a20379f57c0f3eb78212d2d31f79b068d4bd66 add count pour ptr in CheckPtr.cpp | | | | | | | | | | | | | | | | | | | | | | | | * | | b67e663dab9f9c91bb74fd542e3147794bd8488a try to count memery pointeur | | | | | | | | | | | | | | | | | | | | | | | | * | | 0d206cd497fd4887903346be5a38d16e10bc29db change version of superlu. | | | | | | | | | | | | | | | | | | | | | | | | * | | 3f00b84db70a89af186cdbec2cc7c2fc15423f98 update mmg3d swapar.o is also compile without optim. | | | | | | | | | | | | | | | | | | | | | | | | * | | 6b0af9a24372062231e476be5a64089b22ad6fe0 correct atexit problem in mmg3 v4 .. | | | | | | | | | | | | | | | | | | | | | | | | * | | 3b2b082ba4cc89366edb169d75c60ce79265126b correct Interface of Ipopt (ff-Ipopt) correct PB with mmg3d-v4.0 ( bug with full optimisation of cendel.c) | | | | | | | | | | | | | | | | | | | | | | | | * | | 2c5b565a16b9219231c6d7fe879b7843e859328f carrect un set varable in mmage3d-v4 | | | | | | | | | | | | | | | | | | | | | | | | * | | 5762c77bb001172fcdb3b661978eb0c16a127aa8 coorect ff-Ipopt version | | | | | | | | | | | | | | | | | | | | | | | | * | | 5312c2993911d41510ed0ddc24a27df857460b0d coorect typo in innovation file | | | | | | | | | | | | | | | | | | | | | | | | * | | 4478d33436a2576af4e603dab08584aafda7d21b update INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | * | | e15e8a07eb1f0e6f86f9a3b4dbf71f7385c10469 correct typo | | | | | | | | | | | | | | | | | | | | | | | | * | | 2249bee288aed348b8295a6c1fdc8bf6f602a0bd add isNaN,IsInf,IsNormal FP fonction and Nan .. | | | | | | | | | | | | | | | | | | | | | | | | * | | 8b47f40d0a6d5eb2e5ba0a52ba410413f5f172d4 add a true scotch example | | | | | | | | | | | | | | | | | | | | | | | | * | | 49bff21e96d2850306e4d00d96d6198d99f131d7 add sort of integer array I.sort; thank to P. Jolivet. | | | | | | | | | | | | | | | | | | | | | | | | * | | 4472342913510b1e3863e9a09adc36da6a917928 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 3280842666d74542abc5ff9a75f2aab4c80a55f8 coorect header of plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | c6b3b6365debb0b5b2a993741ac97372e9757e4f add scotch interface thanks to P. Jolivet | | | | | | | | | | | | | | | | | | | | | | | | * | | a6a99f03b1026f8918611394a58a1650ddcc6162 Pour P. Jolivet, J'ai aussi besoin d'un accesseur dans la classe FEbaseArray, serait-il possible de rajouter cela dans le fichier src/femlib/lgfem.hpp classe FEbaseArrayKn, methode virtuelle pure ligne 402: virtual KN* get(int i) = 0; | | | | | | | | | | | | | | | | | | | | | | | | * | | 918af2f809ce199bc4810d70226c8eb9f4823a32 correct bug in macro with operator .*= and ./= | | | | | | | | | | | | | | | | | | | | | | | | * | | 98104bef8ba3ba3b9a43948897b6abd3022be7ad comment in stable script examples++-3d/Laplace-Adapt-aniso-3d.edp | | | | | | | | | | | | | | | | | | | | | | | | * | | f55c3fd976e2102e947d79e3711b2a26502041a3 correct mmg3d new interface. | | | | | | | | | | | | | | | | | | | | | | | | * | | b6174fb5b73a4ba22a5455c23916ecd3a2a4b06a correct build fo missing file during test in ttestio | | | | | | | | | | | | | | | | | | | | | | | | * | | ceb22e38c5df745cccc8dec95dcf5096c05ae7e0 update doc with isoline example | | | | | | | | | | | | | | | | | | | | | | | | * | | 115a5170b832079cf32f2417e406f59160512595 correct type in edp files | | | | | | | | | | | | | | | | | | | | | | | | * | | d418d154c7240712eb3c3475443b2a3e346e7980 correct pb plot in 3d-lemen;edp example | | | | | | | | | | | | | | | | | | | | | | | | * | | edcc51380855db320e2914878d35f658da3d8241 correct Makefile for dist | | | | | | | | | | | | | | | | | | | | | | | | * | | 56da4d2635a6f3d2ac3cb9409bd53ae7cc03043a remove assert of generate surface mesh ??? | | | | | | | | | | | | | | | | | | | | | | | | * | | f44c9b437c04a38dfb6100e78240a7e6cbd7e72b add new Ipopt example | | | | | | | | | | | | | | | | | | | | | | | | * | | 053243f62c14b08c9ff2c14bcc43ed8ac4cbd5e1 pass to version 3.19 , and add Ipopt documentation | | | | | | | | | | | | | | | | | | | | | | | | * | | 45d25f19f597fcee7109ed16d863ee1da1a37186 change the return value of inv in lapack , reture info value | | | | | | | | | | | | | | | | | | | | | | | | * | | f4a70f94b5df47d9148b96b850df5f5bb781a058 update IPOPT interface | | | | | | | | | | | | | | | | | | | | | | | | * | | da8489c3ae62bf9090ff0fe64e9b7b981dd3ba4e forget all.edp (automatical rebuild) | | | | | | | | | | | | | | | | | | | | | | | | * | | 806c359a2ff8d8b02bc9bfc791bf9b342706635d coorect install plugin | | | | | | | | | | | | | | | | | | | | | | | | * | | 71e4ad35fce4bdb98237c4ca8252b360bb3daee0 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 28ce031cf4e077a468b08e7743fe5eebb0f5c807 romve use file | | | | | | | | | | | | | | | | | | | | | | | | * | | 2d200afa3f70baa394eb10bfcfdf34283e05d842 correct typo | | | | | | | | | | | | | | | | | | | | | | | | * | | d3e8abec9ef0276ac8db045c0219bef5b4b0321a add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 4f2b1cef17e088d1e1a4dc1ea06bea9699e83173 coorect FFLAGS in ippot | | | | | | | | | | | | | | | | | | | | | | | | * | | ce3b2876ed85b4e9138bf48d3b68e340c1a820cb correct ipopt fortran flags | | | | | | | | | | | | | | | | | | | | | | | | * | | 49a277a422d50c3d0a54346c9e11ab772be6226e correct chanhe of ff-IpOpt in ff-Ipopt | | | | | | | | | | | | | | | | | | | | | | | | * | | 86060aa8e8682bb356a2a2876d2e9331c7dac190 correcrt Ipot name | | | | | | | | | | | | | | | | | | | | | | | | * | | 5ad486b3e8a0d61865cdfd450a50e8335984e515 remove build file | | | | | | | | | | | | | | | | | | | | | | | | * | | 7b7a8550eba730074c71ca2e600b8b5be66ca310 correct missing CFLAGS compile flige in ipopt | | | | | | | | | | | | | | | | | | | | | | | | * | | e5c76d9c6ee1673f61a86cbcf69bf70d7aaaad5b update freeyams versio | | | | | | | | | | | | | | | | | | | | | | | | * | | 2d15a028dbc60b2b93f8e694eb5c1bd3064f6ce7 correct ipopt | | | | | | | | | | | | | | | | | | | | | | | | * | | 38fc4a081029d2b3402fc113c6426d14502c730b carrection iptop interface | | | | | | | | | | | | | | | | | | | | | | | | * | | 23a0a776ad694e25e3c0aa39fbfbf657bbccc42b coorect typo the WHERE file building | | | | | | | | | | | | | | | | | | | | | | | | * | | cd434ae41fb42d53b09f00800fc565ac66ea533a correct msh3.cpp see INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | * | | 2076bd359b4be55d22f593a9560ecf5eaeaf915b correct type error | | | | | | | | | | | | | | | | | | | | | | | | * | | 9c92d325f57a51986dc3da6bc479b5d038825a69 add Ipopt interface, seems workinging whit 2 test IpoptVI2.edp IpoptVI.edp | | | | | | | | | | | | | | | | | | | | | | | | * | | 82be0d5b5d3592177ce12470a7d4b6afc61c85dd add nex example | | | | | | | | | | | | | | | | | | | | | | | | * | | d7469f12221b8633b734a8b8ec118e397e11c10d add IpOpt interface | | | | | | | | | | | | | | | | | | | | | | | | * | | 45bc88d68c32f8adb6a2808d2f3bd60ebcbc4f57 add Ipopt interface | | | | | | | | | | | | | | | | | | | | | | | | * | | 780a81f259d389f8568696a7a988877738891f14 correct pb of name in lapack in arpack configire variable | | | | | | | | | | | | | | | | | | | | | | | | * | | f062693b4c59368790b7dc89a463b1bc507443d8 add -mkl flgs in configure in test .. | | | | | | | | | | | | | | | | | | | | | | | | * | | f54b1b9612eaf05a526c3acedf332c24a1e05c04 add missing operator A(1:3,3:4) on full matrix | | | | | | | | | | | | | | | | | | | | | | | | * | | fb03671fbab7b87fa3aafc6ab7da6047a7268eba add new example | | | | | | | | | | | | | | | | | | | | | | | | * | | 2a46c364ffeaa0cdde60a576658deec0f51d4264 add subarrey of full matrix. | | | | | | | | | | | | | | | | | | | | | | | | * | | f59670989c996472d7035405a8699e73c0c8409b add new type of array , array of array. | | | | | | | | | | | | | | | | | | | | | | | | * | | 21d27abf044daf93d3b899e97dccc9464390316c add ipopt download | | | | | | | | | | | | | | | | | | | | | | | | * | | a2a050ea0bfc2c0794e8765927807f15e9839226 add install of libphread-2.dd or win32 | | | | | | | | | | | | | | | | | | | | | | | | * | | 1934fc039989a5d9b37a804e3e21ca52e5d57576 add pthread in mpi mumps | | | | | | | | | | | | | | | | | | | | | | | | * | | c353583e633c3394ed57330f568058c5f4ed4cb3 add pthread in WHERE-LIBARY-config for mumps-seq | | | | | | | | | | | | | | | | | | | | | | | | * | | 84b595bbd6559e055eb559573141ee52a9f066a2 correct typo in libseq path for mumps-seq compile | | | | | | | | | | | | | | | | | | | | | | | | * | | 487d48af2855203da4920645170168de645aaecf add MUMPS seq pluging | | | | | | | | | | | | | | | | | | | | | | | | * | | 65a7d6e947103e7d4f222de95e585c0a088d2904 add tag + correct missing file in windows distributiuon | | | | | | | | | | | | | | | | | | | | | | | | * | | 6e9f44d3c09d4c31f121ce9a013bfb6b5c7466aa Added tag 3.18-1 for changeset 7a11ffa1f26e | | | | | | | | | | | | | | | | | | | | | | | | * | | a2ff55d60af2a39acb8b5f635a3f35d927ad0864 (tag: 3.18-1) correct edp .. | | | | | | | | | | | | | | | | | | | | | | | | * | | 431794a8e399dc41daa5cabe520f82bfd9b07529 coorect install windows | | | | | | | | | | | | | | | | | | | | | | | | * | | 86eba8f379851e3c0a77d4654889af3df5d66801 correct missing file in makefiles | | | | | | | | | | | | | | | | | | | | | | | | * | | 88e65586f9f7d0eed4a68eecd4cf4c656e68a96b update doc | | | | | | | | | | | | | | | | | | | | | | | | * | | da1aa1b0974137c13c644ee5074e3c85d634217e continuing update | | | | | | | | | | | | | | | | | | | | | | | | * | | 77a409551e8e52c3d82f5114b83d1687f213020d add .im, .re of array..compile test | | | | | | | | | | | | | | | | | | | | | | | | * | | e56ff7f8f1f04d104a2332f325376394dcdba2bd add re , operator in complex sparce matrix | | | | | | | | | | | | | | | | | | | | | | | | * | | ac04cf27180a545b468444a38304b5cd4139ca45 add convert of im and re parl of complex sparse matrix to real sparce matrix. | | | | | | | | | | | | | | | | | | | | | | | | * | | 5c2e1dee7135ab3b3407408c726e84b4679c32ed correct norme lp in RNM thank yo a student. add missing mpi lib in hypre and cmaes mpi example | | | | | | | | | | | | | | | | | | | | | | | | * | | 34a53398142a00fb4517449c18c751877ff155df add comment in INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | * | | e8883444c8c1fa535f09afe51a36fa89d565116c add error in case of probleme ith periodic bondary condition. | | | | | | | | | | | | | | | | | | | | | | | | * | | 1eebe146d8b81239e3d00aa60759cc1af72f8413 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 50bf0fa8b9801596b50accd98b30e4275e7a140a add missing files | | | | | | | | | | | | | | | | | | | | | | | | * | | d9ae5dac59d6e0fecbf40e91eef9f80084249afd add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | 8c78471cf952e60890260e383a9a349e6a5286f4 add missing file | | | | | | | | | | | | | | | | | | | | | | | | * | | dd5931ee7b74e7bf2885230a68642c6aedc1e594 add missing files | | | | | | | | | | | | | | | | | | | | | | | | * | | 5bafa467dd8907facf218316f47045f5094e38e8 correct Makefiles | | | | | | | | | | | | | | | | | | | | | | | | * | | 433b723383db7b113e9d67ce00777d548814d139 remove example without new adaptation schema | | | | | | | | | | | | | | | | | | | | | | | | * | | 2844f04d54f0667f1979d557c3ceaf49917d39cc add adpt tool for PK aniso adation in 2d thank to J-M Mirebeau | | | | | | | | | | | | | | | | | | | | | | | | * | | ba8b3714b21134b86829e4cc64b717564298cc34 coorect scriot | | | | | | | | | | | | | | | | | | | | | | | | * | | 4211f6d355739a2ffe27ac3324e3f353d22d32d8 correct DOC | | | | | | | | | | | | | | | | | | | | | | | | * | | faf635b6062132281454e3bb66fc700edad33cc2 add New example in Chap 3. | | | | | | | | | | | | | | | | | | | | | | | | * | | 7855034178ec3974f240f181a8efa7ab5cadc425 merging with 3.18 (error FH) | | | | | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0c89cb502f5d1d16d15cda90571690069d8271a1 correct file to compile with xcode 4.2 add varf build form incompatible meshes in 3d | | | | | | | | | | | | | | | | | | | | | | | | | * | | 15771bca33312b8ab26ca1684d6e68460923bbe5 (tag: v3.18) add line ininnovation | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3cdcb02e1525d83a83cdb5b7c41aaff127b65eb8 Correct NSprojection example | | | | | | | | | | | | | | | | | | | | | | | | | * | | 794d5e9047a94caf67d5a82cde504d59dd5d87e2 add redownload off mmg34 tar gz | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5e120eef891d5f4c97ad6fca97239100fd852078 correct compile of mmg3d v4 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 64c0ce0cf63f8db3645f0d63d369c82df48bba46 add missing file on windows | | | | | | | | | | | | | | | | | | | | | | | | | * | | b35e51bafa1365dd15f94d535746248ac051c0b8 passe to version 3.18 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6b632cfc86780e10887223f443e9cf8e197ee158 update isoline dll. correct bug in resize of RNM array add operzator's_ classes | | | | | | | | | | | | | | | | | | | | | | | | | * | | 83f3b1ec0755cc78342caacfc596d09983b3cd5e correct mpigather | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8df3022e53c73b7953d1ac1ae9b168c78881a887 correct parallelempi.cpp mpigather assert | | | | | | | | | | | | | | | | | | | | | | | | | * | | a50b89de4f0bff3a2223ff3d07981ad6368f08d6 change the isolineP1 load file by a isoline file correct parallele ffassert in mpigather case.. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5cb73b78115aea8de4525eb0a51b621295e13cc5 correct pb of offset in readmesh in ffglut | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6555894135ab3369dcabcdd68cce3673136414d1 coorect PB de shift of 1 in read .msh in 3d | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3dc4a9866fd9eee929f462a5b0ca0e070f0f779a correct mistake in mpi interface (wrong assert and correct essai.edp) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4aae829f06a2357f9d3af37f571a704a3f3af166 corret MPI problem correct bug in return in loop correct int1d(Th,l)(1) when l is a array. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 81a64ab1fb883d7532fa377eab7cf8e21059a657 correct BLACS interface ( mkl and debain case) mumps run on both computed XS | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8c7c6e156c970d5cfe6aafee2e1180d92d88d780 coorect pb in blacs lib order in WHERE_LIB | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6aa82ea4c0b2b69f1d0a3838904a8f46731f5db1 correct mshmet | | | | | | | | | | | | | | | | | | | | | | | | | * | | b5910947387c741deb131b62bd128080c2ccca45 correct configure.ac (remove trick on odl mmg3 version (not use at all) | | | | | | | | | | | | | | | | | | | | | | | | | * | | eb7101b35faeaa0bf93bf6db48e4f40b00042494 remove double symbloe in freeyam with meshlib | | | | | | | | | | | | | | | | | | | | | | | | | * | | fb51d5bab1eb20c6e31a970769c90d49a22e3722 remove compress tools in scotch by default | | | | | | | | | | | | | | | | | | | | | | | | | * | | 31a95dae3d6395a987d394475117f8e210b8ccfc correct mistake in ymas interface | | | | | | | | | | | | | | | | | | | | | | | | | * | | 78afd60653cb985f9fd2406d4b63ad94da4526fd uodate to last freeymas version | | | | | | | | | | | | | | | | | | | | | | | | | * | | effe686a3c91d93bcf6960bcac9054f1ac979be5 correct aprmetis and mmg3d opt version | | | | | | | | | | | | | | | | | | | | | | | | | * | | 74252291a9085eb0908b29a92db69b4ee29a302d add small correct of fratran stuff in ff-c++ et find mpirun in configure | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4285394e9cc005bf6dac48f2fe0e67f955072017 add new ffapi.o in src/bin-win32/Makefile | | | | | | | | | | | | | | | | | | | | | | | | | * | | da9d25d1975b3e11c650af22654cf06cf9f11714 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | * | | ccf0886a17bf5e45a85291579e33a3921dbfbbe6 make hack for true random number on window (use of mersen randow) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6506c4bb52452f93c431d26d26ced4921d9d1de0 correct typo error and pdate the doc. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 852911d66c2d0d4d747927baeda16a4091362e59 correct the new auto laod interface ... | | | | | | | | | | | | | | | | | | | | | | | | | * | | 09766138fb8ee87c0cf6e49a62830463f0bc7884 passe to versio 3.17 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5b27279f09bc503a366361f356d077fc993d60d0 coorect PB off pluging ( ok may be) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9ca19c0e0103583ea1e6f1e0040063c04db37fe5 correct Typo error in multiple include defence .. | | | | | | | | | | | | | | | | | | | | | | | | | * | | ad6e791c5594e9021a33020d8a50d98403d9c59a up innovation | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0290a4062693a8c709f087b93075611480a75e05 update plugin to by compatible with new load schema see inovation file | | | | | | | | | | | | | | | | | | | | | | | | | * | | f86db922b7b3c4626fcc8a6bd5fa024592379c95 build a work version of mpi on window base of sdk windows hpc | | | | | | | | | | | | | | | | | | | | | | | | | * | | e9c9ccc2f5d771684f97065660379d553a4691d2 correct missing ./plots/VarIneqFill.jpg ./plots/VarIneqIso.jpg in dist | | | | | | | | | | | | | | | | | | | | | | | | | * | | 91365d34316b9427a09ab64cfbafb51d5822927f pass to v 3.16-1 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7df2aa5c5235b4243c64aa10f2c3eabeebb62cee add missing file | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7d06a024851eaee54cdb7da68c30d64d87ba2681 add patch of Marco Atzeri for cygwin add remark of Dominik 'Rathann' Mierzejewski build tree separated from source tree + coorection for nlopt .. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 20f9e7887da4f54bf6f624091c5c9d2da8597550 doc is 3.16-1 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 89f61bc1aad648029f9117334e00075d577d011d update doc S. Auliac (optim) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 34a7328759fcd87439b1903bbfbb261905b80188 MAJ INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1e9e65de816535331395996cc812d1441965e42f add mpi_cmaes lib and examples | | | | | | | | | | | | | | | | | | | | | | | | | * | | 675aa47e3b6ca3ed9da155a3cf55c7aa693f8031 add NLopt interface and cmaes interce (thank to S. Auliac) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 07470c7e089725b055b70dcfe8416d5183bf4569 add truc to remove 2 init | | | | | | | | | | | | | | | | | | | | | | | | | * | | 03f626dfc01080a7195225780a35636aeb8b9609 correct auto load of mumps | | | | | | | | | | | | | | | | | | | | | | | | | * | | e01022045578676ef786c99b9e511bd0e2442118 correct pb of autoinitsfunct | | | | | | | | | | | | | | | | | | | | | | | | | * | | 325561a3fab3484d4dd4ed1c6d909782ff21c4bd add tool to automatique load | | | | | | | | | | | | | | | | | | | | | | | | | * | | 57492c9a38228f3485759828fb80edcf0346bdde coorect pb of alloaction | | | | | | | | | | | | | | | | | | | | | | | | | * | | 754db2413637871663c59b6d3cbf1c160569a59f change testio.edp ttestio.edp | | | | | | | | | | | | | | | | | | | | | | | | | * | | b9d57754700b664d93dc996e123acc60e9f00e36 coorect example | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3f89dc8cb286dae71eab078f7f147c81ee62a361 coorect type in mmg3v4 | | | | | | | | | | | | | | | | | | | | | | | | | * | | cfa49d8005f665d12b1c61800a8f15365979e879 correct CFALGS | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8cecfaa67dad8cd80ed21ec0553091477677749b correct typo error | | | | | | | | | | | | | | | | | | | | | | | | | * | | e668dc70e575dbacb2a2253026aa7b8920ed6dad correct typo error and warning | | | | | | | | | | | | | | | | | | | | | | | | | * | | 452fbad30cdc0749bb9be23d2dce24fa75d974e6 try to bluid v 3.15 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1122bc52fef56255d43189069f6ccfe91edca683 coorect pb in real[int,int] A, B; B=A' , etc.. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3c80caec55adcda02a1afc8a08b869a010d0f88b come back to metis 4.0 for compatibilite reason | | | | | | | | | | | | | | | | | | | | | | | | | * | | a22892fbd845279cac0d404e651fe543e11b8ca9 correct pastix patch include (remove .. in patch file) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 000020dfb6d246910a58bb5be5eb21f7a1d43fff correct A=A' for array real[int,int] or complex[int,int] | | | | | | | | | | | | | | | | | | | | | | | | | * | | c7616e6561e477dcb1d9d53d0e373c10f3d55e0a correct Paul Cazeaux diff | | | | | | | | | | | | | | | | | | | | | | | | | * | | 50e1b911f07577f93961b54e3ed30f0c0add5e3a correct install MacOSX | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6874837720e4b61eb1c0189efc9d6c8a428c5707 add freefem++ laucher | | | | | | | | | | | | | | | | | | | | | | | | | * | | 17e609065f3dd2848189b8979d6567071c8a8954 correc configure cmaek typo error | | | | | | | | | | | | | | | | | | | | | | | | | * | | be32b75945277ea3b1a17eb57178ed59b4127318 try to redo Freefem++.app | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4b0c188e43594c61b816acf19193babfe802b9d4 correct metis makefile | | | | | | | | | | | | | | | | | | | | | | | | | * | | e2df71c0800d35cb487294b702da4e5348d4628f Added tag 3.14-1 for changeset 3d5d2f056b09 | | | | | | | | | | | | | | | | | | | | | | | | | * | | b3ff5afb0ce9d0864853953fd91f3601ea9dceab (tag: 3.14-1) pass to versiuon 3.14-1 | | | | | | | | | | | | | | | | | | | | | | | | | * | | a828eaee8edd490bc79f731346fe7adc10a97409 correct emtis interface to v. 5.0.1 ( version 4.0 diseaper). | | | | | | | | | | | | | | | | | | | | | | | | | * | | 79095706726535add878341c9e97ab924588f2fc correct metis download (version 5.0.1) | | | | | | | | | | | | | | | | | | | | | | | | | * | | eb3a9105a6be7fe47ecb02f6ce23d2318c196eb8 coorect FreeFem++-CoCoa line 26: [: : integer expression expected build WHERE-LIBRARY is not found + correct small stuff in progress complex gemres ... | | | | | | | | | | | | | | | | | | | | | | | | | * | | ba668a1f92fe98f468d055ce253512dd6b55c1ae correct Missing WHERE buils | | | | | | | | | | | | | | | | | | | | | | | | | * | | 13ece410e95523c03731d96e266ba1d831939755 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | * | | cee54a77dade42464128724e57368aad28f7ba20 update innovation | | | | | | | | | | | | | | | | | | | | | | | | | * | | 130aaaba98f0dcf67f9648d07deb5c80c456d810 coorect interface with mmg3d verson 4 | | | | | | | | | | | | | | | | | | | | | | | | | * | | d4cb4dd00b6a1d6354c7e62de04385bf7afbe92e coorect inferface with mmg3d version 4 | | | | | | | | | | | | | | | | | | | | | | | | | * | | a964717a230cafc204041adc3c472baf3e98bfaf Added tag 3.14-0 for changeset e34f8a052707 | | | | | | | | | | | | | | | | | | | | | | | | | * | | e4082ee9179bf75aa2bb95517bc50177a29d8d59 (tag: 3.14-0) correct bug in 3d P1 interpolation | | | | | | | | | | | | | | | | | | | | | | | | | * | | f91e4d72fd5a5a1338fb73dd937d85a9e60c5286 correct mpi exemple | | | | | | | | | | | | | | | | | | | | | | | | | * | | af235bdf28a2fed4da1afa0c44cce7f309fa3a38 correct allGather check | | | | | | | | | | | | | | | | | | | | | | | | | * | | bf8fb98d9f4a8c21c659fba617c096017fe49206 correct pb of allignement in sub array send/recv with MPI | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9b2cdf105fac2261da0fa275d3003dbc6ac7ea98 correct missing return in WSEND | | | | | | | | | | | | | | | | | | | | | | | | | * | | 13eabed6a2a1fbfc55f681a18153e0f49ee3323d recorrect tetger clan makeifle | | | | | | | | | | | | | | | | | | | | | | | | | * | | cfd008ec4c11b4249a83d8f7448a9d2ac6790807 do autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | * | | ef6c8695222562bbf82069af0a8453110bf3973a restart of 3.14 version (big mistake yesterday) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6fa979f3ca522e9f7431c2cd04ff0164f6efee46 remobe -march=native (bug on allpe) | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0a3b62fabaea9793a152f5cda9e612d2e6d3cf6d correct optim compile flags | | | | | | | | | | | | | | | | | | | | | | | | | * | | c7c8289314f05700f3d290d22edf4b6ea25682d2 redo second problem | | | | | | | | | | | | | | | | | | | | | | | | | * | | 42ab3c57e2e5ca6af4993ce8571debb05a9cbc2a correct debug config flags | | | | | | | | | | | | | | | | | | | | | | | | | * | | ee1d1ff2c9719c675e0db325300b9c999402a601 coorect msssing lib in freeyam pluging | | | | | | | | | | | | | | | | | | | | | | | | | * | | f7d3fbf8e2521ecd757d7a2f54dc29e07f4cfdd0 correct typo in int blas type | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4c09c9e9f2806316848f7dd4e9ff8695453f3374 correct int for blas variable .. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4f58e2e37aef3227ada8345b11b240e306f8a3c8 correct typo in doc. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9479c36735f3fadd012ae19d6acd30c0309ee873 go v 3.13 | | | | | | | | | | | | | | | | | | | | | | | | | * | | d5281758af9af99cbeb0d23f1645a53657d86081 autoreconf | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7f693584f6e02ed95a0d439de54d80c04a639e85 update doc | | | | | | | | | | | | | | | | | | | | | | | | | * | | d9262dc6846abe93ca4628dcc6d8deb67a2a6cf5 add final comment on Element_miaxte.cpp file | | | | | | | | | | | | | | | | | | | | | | | | | * | | a76a7070ef858471b273f50bdffad6e10646bf3c add RT1, RT1Ortho, DBM1, DBM1Ortho Finite element in Element_Mixte.cpp dynamics libs | | | | | | | | | | | | | | | | | | | | | | | | | * | | b1149a65f1d0cfa01cd40ff71067d841ee2ecbb0 add BDM1 and BDM1Ortho Finite element | | | | | | | | | | | | | | | | | | | | | | | | | * | | 223735ecb14572328d846d48c7c4d3525e26f85d in progress TD-NND 1 element | | | | | | | | | | | | | | | | | | | | | | | | | * | | a8acf2339d7a9fe2e8046022a9c11080193bdad3 end of validation for RT1 | | | | | | | | | | | | | | | | | | | | | | | | | * | | c1d7ffd7a2186bf0c6b6d2e4b862bd13eed72f69 correct RT1 and add RT1Ortho F.E. | | | | | | | | | | | | | | | | | | | | | | | | | * | | ba1462e1117a1f775923b5bdc2042e09c302c556 correct Elm_TD-NNS.cpp for RT1 F.E. | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7a2ae06b441254feef5290c6a78cfa05b4c2df42 correct lapack | | | | | | | | | | | | | | | | | | | | | | | | | * | | bd3872bfdb91b5bbc1a842e0a334550976c1ba62 coorect lapack.cpp add full matrice multiplication | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0992ffeaf8954be2574e827b9bf275285b700b83 coorct lapack and New FE element | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5c979adf55f6b3fa530bd041aff8180e72e385c3 add New finite in construction add mult of matrice in lapack interface ... | | | | | | | | | | | | | | | | | | | | | | | | | * | | 197eb37a11c438bab6c8607ad488fa9ba50ec83a add splitedges tools of Mghazli Zoubida | | | | | | | | | | | | | | | | | | | | | | | | | * | | 21deab6218a8fc44268520927f79fb5b25c937dc coorect load load under win32 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 802679baec6cc68e325beb117cadaf6b56afa357 correct load link pk of " and ' in var | | | | | | | | | | | | | | | | | | | | | | | | | * | | 08c507d689753a730f1319f69fe5116f6b52649d correct configure.Ac | | | | | | | | | | | | | | | | | | | | | | | | | * | | 67eb04521a019a3c254c1aeacad2990063ef5925 correct configure.ac for mpi under win32 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 2461f310c32cf35f7f6d4c9dc416f388c4f0b717 MPI for win32 | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1311acf9a6d7b787c4e0bd25000c5e0a89740194 coorect Makefile | | | | | | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1f78b5947b14494e5100b4cfe76e39d7d4d4d7d8 coorect mpi configure for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b3fac1cab77cca07e391befb97bc0b77c2b56b75 coorect Problem in WHERE quote | | | | | | | | | | | | | | | | | | | | | | | | | | * | | ddd3eef0d571f929af14fd1ee169782954f6c0f4 correct Chaleur | | | | | | | | | | | | | | | | | | | | | | | | | | * | | be4c6d49d721f5a7c62b87283afe2a51d1ea4a80 correct INNOVATION file | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b0360901db6ed29140dd8d6b52ad99f40ccd24c8 remove suprious dump in superlu dist. and add tools to accelerate the build of // matrix | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 54b267d151aaa17115baab7eebc53fb1ebab7c2c correct change for // computing | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 356e6b6c1b0759f2d4730d0149b53f7520b8efb3 correct configure to build file examples++-load/WHERE_LIBRARY-config | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3035e8b7a47d71d829f0d20985f8afa3e415a290 Added tag 3.12-1 for changeset cd142ee7324d | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a2859909bdf9f6e7c97dcb770f2cc432a6bdc163 (tag: 3.12-1) correct 3d period BC. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 254cd74fef00a104a9d9ab4b72cb3804485f2136 procon gmres remove tgv ???? | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bc8907235e4e64da16e7d6ad2a5f9434c6b6a48a gmres precon same | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 980efd16757c3015b551c062f6e9dc5080126413 change precon gmres | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8d5753cf03c3e8cfc071a20bd7ff76fee9a385e6 correct precon gmres | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 150c7e0b5cef3dd9974a3b6fbe5e1786def3589e correct PB compiel for hypre with blas. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 63c5158c07a57a6a214eca0e223658db1fb6e4fb cooret typo | | | | | | | | | | | | | | | | | | | | | | | | | | * | | ab7c035900bfb38dcda749e79ba0818c688fa783 add missing MPI_LIB | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 02ec308fa56235283236783a2e33fc5e364a6b1a add cast of TypeSparseSlve on int for stokes type of solver . | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 2767cd004b92738dce1790a7624aedfcbeb3bf6e correcd DDM examples; tyop error | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4c09c75f5ac649b685766f30dc3ea3f7ddff4130 coorect missing lin in mkl whith _rf.so .. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c798bfa888a166533e04dce10c1b2e6a9787cdab coorect ref test in tutorial | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 070845f4c6949554db7719659f09feb466eaac85 corect configure for mpi | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 194552b6db031f331872b03a34431efa1572a634 correct bug in intersection of metric in adaptmesh in case of given metrix introduce in versio 3.9 in 07/01. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a86da92201f28e6c5e02703ada4445ebc88df349 coorect pb on configure of mpi (hard jos) | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a81e88b7ff1ca113ec4daac18edb48fef5dfe1a9 add test for m4 and bison command in configure | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bf536eeacb50e07fc95f2e4c72024a726256bc24 update mshmet to version 3.0 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 79c15146b30eb200b7337b8abefed3c7aaacbe4d correct mpi correct of sgi | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5bf0ae23e8fd8e886100706d1ae5c254f630de15 compile with sgi MPI | | | | | | | | | | | | | | | | | | | | | | | | | | * | | cd77ba88108ed11a71ef86273c6a02925d3dff28 add check MPI_DOUBLE_COMPLEX in configure | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f6c9236731dca26b2563f6d96def68afd9420598 cooret mpi / cpp DOUBLE_COMPLEX | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 4e7b858f0caa3838e0a0a3bd1dcbd31cbd76ac8a correct missing cflags in generic blas compilation | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 880fd91b27c9d97e6bac01a9631e0fc768b1a439 corrrect loop in makefile when cleanning | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 815addb4b79fd51e9de61a15472b3c96141e1eb3 correct loop in clean target makefiles | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 2a7af96fb2179226e1e106fedc1b2a74662f07b6 correct clean in freeyam makefile | | | | | | | | | | | | | | | | | | | | | | | | | | * | | d315e5f024b219cbd044f645eda20303f2842835 correct mpi compile flags for sgi computer. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a06c3df42955476147424d6a043af82ff0d79a8c correct missing in install examples++-load/fig.pgm examples++-load/lg.pgm | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b4ad25301cd250ab1caad4656396d0aee7a4696f add missing file in Makefile dist tag. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9274cd20089cf5fd08f02df2e2c94c910c629c4a coorect MPI_DOUBLE_COMPLEX problem in mpi ... | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bca5f3cd77c5ee588786ce1677ab837a0ea5458b correct mpiReduce complex case .. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e34e8f52ed6c51bcc9b7f4c9e5b5f3d64e091067 correct some mistake. + on | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f111e8c49cce0d643579db2703e6de85c95e0d54 reomve spuriou dump | | | | | | | | | | | | | | | | | | | | | | | | | | * | | d9072eb2d7c544e8269289423d68873d2a83adac add mpiAllReduce(umax,dmaxg,comm,mpiMAX); where for real umax,dmaxg; add reove CheckPtr for mpi probleme | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 67e38451798ec78e1f13d6d9f8325c458cf4fd65 add mpiAllReduce on real , long , complex data type | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 571c524f968d75b1dbb1ea73c244111382d5b78d Added tag 3.12-win32 for changeset bea855340647 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b1679211a526fdb2e6f1a4973614b75cd586d221 (tag: 3.12-win32) update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 966307a8c1ee4f7fdc7029010a748d291f96412c correct configure for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e33e64140a5815698d4fafbb28a8076ba5a0ab43 correct typo | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 869722bb9e05eaddfa2fa7c599385c43a99e729e correct typo | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e3d14f5a569bba2abd3b419a9cd762fa18d2d05f correct install idp file in mpi examples | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9195f65fd1d22ec59897b4118172f76b0bcf0820 add tag for version 3.12 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5362dba2b1c2ec844ad69a547055bb9645c39e13 Added tag 3.12 for changeset 270198a4a293 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | ddd291422ce297f447c55e17d9206a26c12e6810 (tag: 3.12) correct HISTORY | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6f0604133abedff050ea84fd194017cd9782c48c coorect type in top Makefile | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b3ba732f43817a66e98d3ba1863fd896d8f409b0 correct mpi sover files | | | | | | | | | | | | | | | | | | | | | | | | | | * | | badf2fd257c3a07a1298d99dbe0048773104d44e correct examples++-mpi/Makefile.am | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 88fc8f272fd97fa94229922640b47aff73d62d30 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c93f2a06cba9b3187ac10900523ea83ba9cf4b96 correct medit makefile | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 41e255716f93a15facbeb48acfb9c112c4e79245 coorect make for install FreeFem++-CoCoa on MAcOS | | | | | | | | | | | | | | | | | | | | | | | | | | * | | ac313d3104ee85c66b726d3457dda51c0fdeced6 coorect MPI example ... | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 55f3b35abc6be64b7261d14448285f64526cac3a correct MPI example and // solver | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1127948ec68685b879f05e9a91a93713bcb9610a correct lot of MPI example | | | | | | | | | | | | | | | | | | | | | | | | | | * | | fd4e3b1141e5b23913ddf3a0d72604223925ce1d add missing files | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3de8ab9d4ad9cbad44bc8963890f1b65cef93b20 - correct link proble in hips and hypre under linux - Add thresholdings.cpp thresholdings.edp in examples++-load to remove to small coef in a matrix . | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 14b1e420817a1e4cff2e78060ceb7c2f2a732c6c add new MPI example DDM-Schwarz method | | | | | | | | | | | | | | | | | | | | | | | | | | * | | d8579e95c743f37672ba8bea1def51dc201c32c2 correct mistake in doc | | | | | | | | | | | | | | | | | | | | | | | | | | * | | fc7b4fc2c1e22f0095c45e63c515be2aab31c251 see INNOVATION file for all modid passe to version 3.12 (good) | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6a074458d223967521dc14fe575f1f849d526ce0 add README_MAC | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a4cf94cd7e5cef931ae4021669bf91321b34cbfc correct isolineP1 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3b7d2ed323b10b2bcfa41b66fca3f8103fdc267f ass isolineP1 dynamic lib to build border form isoline | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 97567f2b2b9196bdb617223f12d9490c9e5cc354 coorect spurious endl | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 788c2bf710304d720153a04922c80bc561dc99be remove spurio endl | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 203743642d3b6d9284cddf7e61bfdda416aa4736 remove spurious cout | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 771244bf350998d7be0344295e1ed5e088f42425 add macro def; | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e490ac58599388fe0b74e34302bf908c9f0c5c9b correct for MINGW load.link | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 627cf5395cc5653ebec119a9834030b3e5da0d94 correct FLIBS on win32 case | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5e008d8e4cd35ec7052789d79e561cea0f4b3485 add gsl interface | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e715ff24f3e6dc409794c3cd3dc3f8be3efc7673 add mesure for area of 2d mesh to by compatible this 3d mesh | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 67d37ed75963847bd175d7997d3a0bfbcb57ba1d update te doc | | | | | | | | | | | | | | | | | | | | | | | | | | * | | fabe15bedc09d15764c5156d6d12c0da87a9a873 see innovation | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 812e2db8c21c6481c2fa5057b5c8937216bbf7f9 crrect configure.ac to be compatible with new version | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 54e91a6eec540d65c3342fb743eff5151961e896 Add brute force for seach of poit to be sure | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7a267074ad8b7cbdd3a9d54655f7152a3a41a996 add tgv < 0 => no tgv = so we put 0 on line except 1 on dig term on matrix probleme. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0b8c705bad44a4a7168e5a534ccdc495ba166a48 mpi win32 suire ... | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 328567d3044c2bf023c102dba72cf95bf0ddd33b mpi win32 suite | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 2797d04fed22488a35031fc52c36608b5abf55e5 mpi coorect on win32 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 15362cffeee8bec790ac78e975b838832e4b81c9 correct parallele version for win32 | | | | | | | | | | | | | | | | | | | | | | | | | | * | | da199fec0f0e38ee94668be196df714eb88f8f3e change mpi ef trouth pointer | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 15bb081b82a3a5a335b269b3f40954b39a800f12 correct pb CNOFLAGS (no opt CFLAGS for medir) under windows | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6f6607361b36eba77d76225f8a9935ff5ae30037 next step | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f5542a697ae96f3bca72e3af8135a048297ad423 correct pb parallele-empty.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 77092b2bc734bf99dabea10c41af18b82fd4627a add src/mpi/parallelempi-empty.cpp to build dll on win32 // | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a84c47dd0ee8d63e6f2a9203faa6cbf750751b23 change default parameter in examples++-mpi/MPIGMRES3D.edp | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 15cb8944e73ca7129bfa0ccceda82c687457e3a6 last modif for v 3.11 (may be) | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f574c1807802452367b07d60b1f8a1aeb881a3de updeta doc an exp | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bf58d38541f1b849ad69753d6093330b269eb11b add macro quting | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0380eecb0741388e3e51486131ad7400667c71bb coorect type in getany (all int are long in freefem++) int -> long | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 020b840e70498962b7476b23da5646574b97c1d8 correct tetgen set coorect defauft valeu in nbregion, nbhole, ... | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 97ebaa4fc26990cc8a75f64d18318ad6d6908413 correct doc and mmg3-d interface | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a3bd2c1c74256fa5c37726ac02e8f9afb32a6007 correct pb picking ffmedit remove -O flags remobe all spurion printf in ffmeid.. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f740fd37d56c1034f69a2deffc1f4da5f6a15c87 update makefie | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e947d4f8ab53a4ead33454cce76bfbf0f1082c4e coorect freeeyam mshmet to a-have more clean option | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0d5a5a24222b8aae3dc6f9fb6c3917d7c95fd8df update mmg3d interface | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8fbc73889128e330829a01631ed87fb3f9fd37ac coorect mshmet .. | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b9736a320a4993f7a5a39df6db7b69593b2a5283 coorect configure.ac pb this blascoorectr freeyam interface with metric | | | | | | | | | | | | | | | | | | | | | | | | | | * | | e2dd5a55435812920601b9f800520d8975c93e89 coorect freeyams aniso | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 509f5d55020bd809685bab60f2fcb98f9732b989 add seach of MKL lib in configure (hard job) | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0ad3df643ab918805e922188ad0a1d5dc4c74f08 see INNOVATION correct MPIGMREs[23]d.edp example | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c6c8c77255508e43a75a685175c918b886da30a4 merge ??? | | | | | | | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c40a5de599e81c660c45fa13c84fe00cc57cc651 remove file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 360478dc872aa40bedfa512da6bd0a4ca03ae343 correct the documenation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 3d70ace866d3c47a4872066cd4f5a78e59a53973 add file for mlk lib . | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 8e5eebb9ce0876e9dff39c39184ca07ad6be7685 correct WHERE_LIBRARY-downlaod creation | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | eccaab826d2e18ce715f7ad43923de6acabe93f9 correct mistake in construction of WHERE.gmm file and build libMesh before for mshmet tool | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 21e7c2e7487b823d3720b6f9d8bd3e052cb70dfc go version 3.10-3 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c68b2236708761b3899b29b106813b17e909f6da do coorect of periodic boundary condition + MUMPS link order | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 366531f1ccad9a68b65312f99d0c16515e8074bf add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 0b2c0a39ae9b8a2f965084ebb7c2ee7e3429d81d correct spurious print with verbosity !=0 | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1978becb384e92fc860f3fbcf35978e6f1bba301 remove spurio print | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bdc35c66e611ac1539ee0282ba3394d43f4dd54a correct Laplace-Adapt-3d.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9308d07fb2cf6625ce2060097c1c4c89ec6423f3 correct Laplace-Adapt-3d.edp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9d9c1fa643364731a12b168ddd60cb1c0c172582 coorect pb compiel on gnome | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c3eb4378a5fa0457f9f1a18f531b49aac653f4b9 add err comment in case of mesh with isolated vertex | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bf179599647d48012390d0993b9b243be7d42caf update INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 129ef403ed8040a0f4b1931ec230f4554bac6ba9 correct 3d adaptation , try to build a first true example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1d4a7c23690b008adf86132dace068c93b842024 add function to cast formal array into array [] toZarray,toRarray , toCarray don correct in freeyams,mshmet,mmg3d | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f01afb4f86746792bac2cd20838bde08709e85ce add getARGV tools | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 5ed9ac9d438ca0c9429ba5ccecb349fc7d58a1c1 next step for ff-mpirun install (dur dur) | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c0879cff23129f0b968e37398a37000512bb30a9 coorect makefile for ff-mpirun and add srandomdev by read /dev/random + time | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7c4de8ca2ab3903f5e10cefca5ac6c63f61ed78a continung tyoo error ff-mpirun | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 80defff4fc7a45dcf36ac36e980a665fd9e851b4 correct typo of ff-mpirun in configure.ac | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | c9eafa1c0ba6ac3bdae08a54b9ffa0acc86646f4 coorect the previous add ff-run | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 62dce71da46e0279a0b2e31a2e8e3f476aa017e7 coorect INNOVATION | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 6ba77fce90c2ec1002aaccd320a0c1edd6b93fa4 add ff-mpirun to launch freefem++-mpi simply | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 20d0b6670796f00a08044bf81d8b02bf91ccf4aa correct mistake | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 7cc4dbef06a0bda1ecc41778b7b96f02516c18ae correct typo error in fftw3 in WHERE_LIBRARY-config | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a6a380865bcf444d640d256b13dabc5bb2ba91d3 correct mistyping in metis.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | aac60fb1644b0d08c0896b0c6d082e933b1b39b0 romve cout in metis.cpp | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | a62777e58049c9dc0cf8cd6972b43dabbc5e5c87 remove strange dump | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | f7f1ac7303caaeef94aeb31cc992e850a015cbe1 correct MPI version from gmone machine | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | b0b947eb0756939c3a17be7dd555acc1a90ed230 coorect pb of comute of area of mesh some time | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 1fb385095324d655a4e9f1a482bd0237f2049047 crrect atof, blas WHERE_LIBRARY | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 284ac568847fb0220f350be926e29767324facde add nex example | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 91f93ef3ae3b56cbbcdcac10a603128b21bdae56 correct output stream | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | cd8c24bb9e198997f604f6d06c2b3a84bddf4369 reove test in MPIGRES2D | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | d4a1f1c400a895bfe7aec7879b2264999b2bbb72 add missing file | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 689596d4b5b7fc7368ebea86e72a882bc73f683f clean | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | 18d1887e3a82a7cae66d6fe4b65101988cdf4260 remove pb file | | | | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | | | | * | | bf23e3ac72c5d679a0f662b97538dfde5a7b21fd correct typo | | | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | | | * | | 73387e10e92ddf2cf56d79a1ab7e66046fc1ac24 updaet Heat3d.idp | | | | | | | | | | | | | | | | | | | | | | | | | * | | 9048e772d7c06888561f1e2d8159064c4929547c correct typ in Heat3d.idp filename | | | | | | | | | | | | | | | | | | | | | | | | | * | | f9879a1cfc7af0703d8843b13ad0ca1143371c41 change Heat3D.idp | | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | | * | | 9c974a3dc61498fd20d83a4864f3e2c2cdada9db Added tag v3.18 for changeset 9506aca1ea28 | | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | | * | | a7fbd56c62e7c3a136321780c86091ce1e47db2d coorect typo in asssert mmg3d.cpp | | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | | * | | 1dfc864d9ebb97fdca7f23560f62e94b300e662e coorect defaul compile flags | | | | | | | | | | | | | | | | | | | | | | * | | c09a68235f2faef3cafa6de6153f72586c8af211 coorect intrinc second to secnd2 in arpach (missing function). | | | | | | | | | | | | | | | | | | | | | | * | | 47af4036b18d7457fbded83f8e9f1a8225068504 correct clean taget in Makefile | | | | | | | | | | | | | | | | | | | | | | * | | 65782f73fb01463e5f8e347b73bdb7d372b1efc0 Added tag 3.14 for changeset fbc48e130737 | | | | | | | | | | | | | | | | | | | | | | * | | ee27b0e43957a583ef1a63187b2229fd22adc465 and add -g in case of --enable-debug - a very old error in the on() functionnal the bug is with a vectorial finite element like RT0, .. the name of vectorial must be in lexicographic order so u1,u2 is ok but v,u is wrong is correct in version 3.14 the 24/08/2011 and pass to v 3.14 | | | | | | | | | | | | | | | | | | | | | | * | | 1e52ff96a463fff9614c0e3e501455853eb437c6 correct of lion os. | | | | | | | | | | | | | | | | | | | | | | * | | 50b44f999bdff13f8a91fb8f3744f338bd29c9d9 see innovation | | | | | | | | | | | | | | | | | | | | | | * | | f306b364c9f0e8d06d38f4a7b96ca593a745ea32 correct makefile add eps in hisp param | | | | | | | | | | | | | | | | | | | | | | * | | 78e760f5672a35fad8b6bcdeda45308cbfa33907 correct typo | | | | | | | | | | | | | | | | | | | | | | * | | 2ca91326c2cea94a90675db3beb1339f24dd229a correct INNOVATION | | | | | | | | | | | | | | | | | | | | | | * | | 4cab041c88a83ec984cdf0113dd9dc200b03e775 correct hips solver typo arror in destructor | | | | | | | | | | | | | | | | | | | | | | * | | c65512827253b05c26331a5b287776c4275ba363 pass to version 3.13-3 | | | | | | | | | | | | | | | | | | | | | | * | | 5b0dfb664437f65174bf62e03727d6e00b58f23c add WGET in download/mumps/Makefile-mumps-4.10.0.inc | | | | | | | | | | | | | | | | | | | | | | * | | 18a30663c58f4bc73262f476feb4ef58aaca767d add missing file | | | | | | | | | | | | | | | | | | | | | | * | | a57936b371ddfa506cf4a5a8be3a2bbf73dbaff1 coorect innovation file | | | | | | | | | | | | | | | | | | | | | | * | | eaed1604fd07c21ef5ccb9a4ac3ae6ba7f4f81f8 coorect hips solver | | | | | | | | | | | | | | | | | | | | | | * | | 516657b0bd09bd375ed0ec9048bf6b537a9bcfdb correct HIPS solver | | | | | | | | | | | | | | | | | | | | | | * | | 7b44f365d1578546de47d68a08458ed98f181c22 upgrade INNOVATION file | | | | | | | | | | | | | | | | | | | | | | * | | 9ab93ae00e2449e8f05083e37fee5be52aec3a86 add interface of New MUMPS version 4.10.0 | | | | | | | | | | | | | | | | | | | | | | * | | 7983021074a3d135d36a8d50030edf2082c15c42 pass to version 3.13-2 | | | | | | | | | | | | | | | | | | | | | | * | | e6a0be868200ec63f9e90c3468a2c735f5ef567e correct gibbs may be algo | | | | | | | | | | | | | | | | | | | | | | * | | 5f866aa15cdefb79a020ba62dcc05336f7c0370b fing a bug un gibbs algo dur dur | | | | | | | | | | | | | | | | | | | | | | * | | 76fcda35d8078778437d092211d189c4bcd2a266 correct interpolation problem with periodic BC. change = with += operator in build the matrix becouse the coef are not unique is this case. | | | | | | | | | | | | | | | | | | | | | | * | | bee5dde28729847230e905ff2d9a2152af40e456 correct typo | | | | | | | | | | | | | | | | | | | | | | * | | 73f1d74fdc915767b909a82006478ad9531fdb9f add mem usage in UMFPACK solver output | | | | | | | | | | | | | | | | | | | | | | * | | ff84eb89c666ea00226d08c210f6e4ec093da630 add exemples examples++-tutorial/Laplace-RHS-Dirac.edp add interpole examples | | | | | | | | | | | | | | | | | | | | | | * | | 44a1586dc05bef3285d3ebeb26e7a9a2c8c6bb99 correct ambiguity in square func. | | | | | | | | | | | | | | | | | | | | | | * | | 80b27ab862f060aaf4162c47011a03c56db8cef5 correct choix of mpimkl | | | | | | | | | | | | | | | | | | | | | | * | | 90f00a962f5fee65c2a56dc15b5d7607226263b8 correct install yams | | | | | | | | | | | | | | | | | | | | | | * | | ab3ab19ea051c030335727a69cf2a601435ec898 correct freeyams | | | | | | | | | | | | | | | | | | | | | | * | | 8d5f6eccb1c86832f01fb439e243d707b88eb739 correct spuriou print | | | | | | | | | | | | | | | | | | | | | | * | | 33c896b8bbfae16a852188180a86f68a188eb452 correct freeyams.cpp LD process. add square of complex and long data add check of contiguity of array in mpi interface | | | | | | | | | | | | | | | | | | | | | | * | | 8ddf750d47f5086b334aeb1d324d047e71c90e73 add new example | | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | | * | | 57444d64efcb7e55d29ed9796005be05069b294c correct pb of auto size of 3d plot | | | | | | | | | | | | | | | | | | | | | * | | 4347a02d0845f1be73c85e6824449db8c06fd44d add -wait "0.1" of ffglut (=> no manuel wait) | | | | | | | | | | | | | | | | | | | | | * | | 6be19f745c44dda4681ee1c450727f8feae23854 correct typo llevelset.edp ->intlevelset.edp | | | | | | | | | | | | | | | | | | | | | * | | 680dbfac611e522c4863094dc9e5b37cc71764e1 put correction of Lorenzo. | | | | | | | | | | | | | | | | | | | | | * | | 03a27d825aaf9c391f9b2af6ef252e81c0a9cff6 add test of pb ?: operator with div / 0. correct message of int1d on levelset ... | | | | | | | | | | | | | | | | | | | | | * | | 9b33b1b230b614a1c1523bb64a79c89389f653c7 change default solver in bilap.edo example | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | * | | 4516b1254267e0ac7e1dbe35284fbffcd3185ab3 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | | 73267ec362bb08a35138c1bc118882595817c139 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | | 2c955df1c9e5fe436c4d6d2cac916bea94d5866b Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | | b78947904f32d3501f0745a426ddf5afcc20ea19 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | | 7350f34af3cd78f26ab2651ddfb11cdb49e91c0c commit for fflibexport | | | | | | | | | | | | | | | | | | | | * | | b1785338636f2c6da1939d79aa8531b3e33694ba Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | * | | d6cd24a78993a67e26cdb9bc1c462b9ee54d01c2 Modified by Antoine Le Hyaric on DebianTesting64 (machine odyssee) | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | * | | 3dd957a5c5f8db58491242e9e7dab2908f9b2500 add parameter in ffglut program like -g 1000x500+100+100 -t toto | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | * | | b15d09913c20c5c318ed7e131f9562a2548d1101 Keeping FH and ALH trees in sync | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | * | | 69b92b9488d1eb4b1d179daf2ecad169fd3ab9ee put code of index and rindex missing in win32 | | | | | | | | | | | | | | | | | * | | e7f403ffcf72816bba860861ed0e15b19ede933f missing xfial Poisson3d.edp | | | | | | | | | | | | | | | | | * | | 99189d811c7ee447dad89835fa454f0ab06da182 autoreconf | | | | | | | | | | | | | | | | | * | | b8c5c79ba012f2cbaae3d2ba3534be414209627f add xfail test in not tetgen | | | | | | | | | | | | | | | | | * | | b656144a1a713fef6521ef07eef8b2e84545db4a autoreconf | | | | | | | | | | | | | | | | | * | | 8ce28029db636af0abc7c822593892a2c7e77192 update list of xfail example | | | | | | | | | | | | | | | | | * | | 34770f126a0d936a8242ebb5b90c9c21cbb0f2eb correct test-driver-ff to set XFAIL (to can fail no sure fail) | | | | | | | | | | | | | | | | | * | | 982b5e0e1d1a1046bf7ed736e1f7ecf9d2825578 correct typo in XFAIL_TESTS automake variable | | | | | | | | | | | | | | | | | * | | fae747871206640a5c713d231c6980a58c7354a5 add in pref missing include dir | | | | | | | | | | | | | | | | | * | | f725ce9517bc056ac15f47ee14931bb469842ea9 add the creation of freefem++.pref file in all directory example | | | | | | | | | | | | | | | | | * | | e0258132d94433ac4104f9125efa2a6d31bf40d6 coorect missing creation of freefem++.pref file before to use new 3d examples | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | * | | 6c47cf7020cb435f9f7b7bad2b9b944996a96860 add skipcomment in readmesh.edp example | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | 5689d50bb6f52b030912f4ccd45471f76c8ae78a Updates for FFCS compilation on Windows | | | | | | | | | | | | | | | * | | 7323ead0f7f534f00d2e81d4799218bddf8f702b partial commit on DebianTesting64 | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | * | | 45c138c25d6938f4c095017e7d746635e2129787 Updates for compiling FFCS on Ubuntu | | | | | | | | | | | | | | | | * | | 3d4e908e49d9a6e83aaa01610b1b851d252c6b24 Update for compiling FFCS on Ubuntu | | | | | | | | | | | | | | | | * | | 13ddcbaf654b869e63146f87c64d225b380eecb3 Small corrections for FFCS compilation | | | | | | | | | | | | | | | | * | | b0c5544eb01ee90d898db24340f0b81d4884525f partial commit on Windows | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | * | | 309208566a2aee414550e9f87240f17aff6b898d Corrections for MacOS 10.6 compilation | | | | | | | | | | | | | | | | | * | | 850cc44eac6148fb39468a5c870d01a0be98cd41 Corrections for scotch compilation | | | | | | | | | | | | | | | | | * | | f27f468e6b2000398d808d944d10b76e3b5075a2 Keeping ALH and FH trees in sync | | | | | | | | | | | | | | | | | * | | 09932b5e67b924b62d34f6d41196b137a98154be Corrected pastix compilation for FFCS on MacOS 10.6 | | | | | | | | | | | | | | | | | * | | e13d3688ec2cea7c2888f4afa98ef147152a5d79 Corrected mumps-seq makefile | | | | | | | | | | | | | | | | | * | | b02912be445870273165592126ea50ba6340152f Synchronizing FF and FFCS updates to the Mumps and Umfpack makefiles | | | | | | | | | | | | | | | | | * | | 00247af32f9e879d00af568bf64e14428f693933 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | * \ \ bd6fd6ad1f869dfada502a74bbfe4f6921b5d902 Committing all changes for FFCS 13.14 back into FF | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | * | | 8f582e8f9dc010dab4725eaec378ace3b427b4e2 Added configuration option --enable-hypre | | | | | | | | | | | | | | | | | | | * | | bea1da7a09f26174376c564cb293e797cf6404b4 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | * | | 1232c12cba759cbca362e0900ca70252cfdfa2c8 Added extra configuration options for metis, parmetis and nlopt | | | | | | | | | | | | | | | | | | | * | | eaf37c189f359028a5ba17e9bd11c8c05278dd79 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | * | | 246d0c9a88042209f327238dae69024a726b8bf4 Parallelized download/mumps-seq compilation | | | | | | | | | | | | | | | | | | | * | | 9fd9fabcb6664541163444536d1113d6c6308dc8 Parallelized MUMPS compilation | | | | | | | | | | | | | | | | | | | * | | 4cef7ad0ace7b78a151729fccd0967ca3ae98cf5 partial commit on DebianTesting32 | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | * | | 30b9e2b12f3156dc1f9d4ab36972b0629644bf30 Fixes for Win32 compilation | | | | | | | | | | | | | | | | | | | | * | | dc337a538a2cdeb6db2230149b78f8f0bdc672d1 Fixed DLL compilation on Windows for MUMPS and pARMS | | | | | | | | | | | | | | | | | | | | * | | ec41e4ecee4a822fdce16bdab3e3823b4206612c Compilation fixes for Windows | | | | | | | | | | | | | | | | | | | | * | | 43fae68853c51047df01fbd5d0643f8b788fcfb5 Small fixes for FFCS release version | | | | | | | | | | | | | | | | | | | | * | | f3df0cfc2c925f534ef246f573056b66686ae076 partial commit on Windows | | | | | | | | | | | | | | | | | | | | * | | 833b394e66f88a1536881fc31b87c71fcd770d15 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | | * | | 9b097373a3799a071c28afb7969f4dec69711007 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | | * | | 3fbe6fe95d922b698b83005315bee07326a5ad13 Copied updates from the default branch to the alh-dev branch | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | * | | 002eee49e1d6824fb14fc9f72a94b83b093f2488 Technical commit: synchronizing all HG heads from the default branch | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | * | | 12acaf9ac0a9451dbf6492c73afd857a6c05e80b technical commit: synchronizing draft ALH developments | | | | | | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | * | | f2345a1b387bab22a3e6cbf8c54c4208268e2d4b Created branch alh-dev for draft ALH developments | | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | | * | | 21682117e06f726d83327dd893da2cbb9930b789 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | | * | | a3a25aef2c017b33a9687fe147fcd8362b8c05b8 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | | | | | * | | 086728d98a9acea36e5c49ee7259965897bc8030 Created branch alh-dev for draft ALH developments | | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | | * | | 4570e0821c00f344d352a5c0838c54438d40cb5b Added configure options --with-[package]-include= and --with-[package]-ldflags= | | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | | * | | 97d6f10098234ba55269d266035bacb12377d90c Keeping FH and ALH trees in sync | | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | | * | | c726c397c4cf8ac6f58d9b15a9ef0a90c14148f6 Corrections for FFCS compilation | | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | | * | | 5d17524b1761c2278221238674cb4091868fbd82 Small corrections for cygwin compilation | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | 1fcb45b4d86119bfa3b17082760606b4d07ed682 Updates for FFCS compilation | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | * | | 9fb1e5c3ee37bdfb1789ff05ac0e105a50c0a8cc Updates for FFCS compilation | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | 079c86ea5b1125662322f133073601009f12467a Small corrections for FFCS compilation | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | * | | 88ddaacbafd8b1068d03438f4c9f6b11f205e889 Keeping ALH and FH trees in sync | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | * | | 2edfab96c1527767bb23ea392790cbd389690a61 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | adad332f6e2d18f67fb668b435f126afe48dcba9 > - split DOC makefiles into Makefile.am and figs.mak to suppress automake warnings about portability partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | 7dcec9cbdaba240deb244f87dd05abaeffb96828 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | |/ / / | | | | | | | | | | | | | | |/| | | | | | | | | | | | | | | | | * | | | debb719a11af061f2243557c9bfecd38670870b3 changed FFCS Fortran MPI configuration for MPICH2 | | | | | | | | | | | | | | * | | | c0b10c58d3433624ef1f0dcc947ae4226ef79108 Keeping ALH and FH trees in sync | | | | | | | | | | | | | | * | | | 4bf062dba5f6845c834d6f43fa064f08e65f41b4 FFCS version number increased to 13.15 | | | | | | | | | | | | | | * | | | 5a5a76b4ccaed3607ca4d9f4d13b11cd636dd56d Small updates for FFCS | | | | | | | | | | | | | | / / / | | | | | | | | | | | | | | * | | 72e684fe03b72661a2d38dcbad06b1d756651772 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | ab2fad6762301de815d64cbc5a8f57a05b62b8e9 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 1aff795e907e3a2b1925bf7d8ead0e06dcaff0bf partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 8f4392b31431189e7d29029834fea11685e76501 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | f0df322ec9f5d2e003c0ae8e35ab692609a37a3d partial commit on MacOS108 (athena) | | | | | | | | | | | | | | * | | 27478fe29eeec5da9e59d088f17944ebd88c341d partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 7782d99525fd8254d91e8c6f4da497d668c67f36 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 64e8035214bde21c55b7f78bf3889ef10f990e10 partial commit on Ubuntu1204-64 (ubults64) | | | | | | | | | | | | | | * | | 2eed720f51b2c4178e2db47fca1e8eb133bef5fb > > - Changed location of lapack WHERE-library setup in [[file:configure.ac::WHERE_lapack]] to insure that it is always > defined (request from Fred) > partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 3cc51a8fe94b86795fb46375d4c2e00642100a45 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | * | | 96d93c5723295ab7fa32e066d880c339ca68687e partial commit on DebianTesting64 (iliade) | | | | | | | | | | | | | | * | | ee46c3d859486d9c1b34f81b54b38108718db386 partial commit on MacOS108 (athena) | | | | | | | | | | | | | | * | | 0ecdb19cad0452fe972fd874e2450450303a67b3 partial commit on MacOS108 (athena) | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | * | | 7c8d02ae2bd8b33547d6a47323325d2ad45dbab1 partial commit on MacOS108 (athena) | | | | | | | | | | | | | | | * | | b9f9b4950bdf7109e4e5f231fad06a428c879fdf partial commit on MacOS108 | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | * | | 7f3a364f9ae50100feb5bb487db22e7ec2bdd9bc Small fixes for MacOS 10.8 compilation | | | | | | | | | | | | | | | | * | | 1ce73c83d739bca70c5f797cef91e9fb78f162b8 Small fixes for pastix compilation on MacOS | | | | | | | | | | | | | | | | * | | e4d9822523b5698d01729a0d186222843f2e637b Small fixes for pastix compilation on MacOS | | | | | | | | | | | | | | | | * | | ebed6d08875a8c074a46cfeee0676ad84f8a2f30 Small fixes for pastix compilation on MacOS | | | | | | | | | | | | | | | | * | | 9a65555a2cda066a283ed0b55394bc7f5ef56a12 Small fixes for MacOS 10.8 compilation | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | baffa407ff695866cfe30b8fdc8b53ac4124ab0e partial commit on DebianTesting64 | | | | | | | | | | | | | | | * | | 34cbe429455449d3a95dac712a6364a2cf7c4a68 partial commit on DebianTesting64 | | | | | | | | | | | | | | | * | | 2f3fe6eb7a1fe0421a44c04d824cfabe7c0935a8 partial commit on DebianTesting64 | | | | | | | | | | | | | | | * | | 2c37151463ee529d68afd6b0149795a34438a3f4 partial commit on DebianTesting64 | | | | | | | | | | | | | | | * | | 07a198ff796c0e283cd20bf0e7dbcea1d452fea5 partial commit on DebianTesting64 | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | * | | 5bf999818051151f972c1c8e41e32eb6aa95c7fb Synchronizing FH and ALH source trees | | | | | | | | | | | | | | | | * | | f5249bd436c0865b065e75b2eefdadbc593baa74 Ignoring .htaccess to go through the web server | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | 7cfc2db4f40514e91ecedca280474a45230e315b partial commit on DebianTesting64 | | | | | | | | | | | | | | | * | | 4d75d4c963ccd95208d2f4cf9b2f8d1db517b766 partial commit on DebianTesting64 | | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | * | | 6dce4dd32d0cb7520156277925a9f85ab6982c00 partial commit on Ubuntu1304 | | | | | | | | | | | | | | | | * | | 6134437482f6e311053d16d6fd60d092a843b0c0 Merged FF default branch into alh-dev branch | | | | | | | | | | | | | | | | * | | 71de64ce0d9c42f483b9da5d98828f7f58769a0f partial commit on DebianTesting32 | | | | | | | | | | | | | | | | * | | 31ef47a5ec34add11491b4282f5298a6492f6f2c partial commit on DebianTesting64 | | | | | | | | | | | | | | | | * | | 44d7ca187006645b7a93661b3cc1a5fc99cceef4 partial commit on DebianTesting32 | | | | | | | | | | | | | | | | * | | c298d40132ada69ca1a74622ea888c1033898017 Merged modifs from FH into alh-dev branch | | | | | | | | | | | | | | | | * | | ec5720101f3efedf2698894c2dcd656b2b82eef5 partial commit on DebianTesting64 | | | | | | | | | | | | | | | | * | | be220c35f5bf4380fa9e6d4fff364609b83bd72b partial commit on DebianTesting64 | | | | | | | | | | | | | | | | * | | 49a050539162c88cfecfa1d9b3ff9f1402d1ca0a partial commit on DebianTesting64 | | | | | | | | | | | | | | | | * | | 77f47e1240302ea468e510b956d24eb28d169485 merged default branch back into alh-dev | | | | | | | | | | | | | | | | * | | 18b9389106ff469907dbb87a2694b947b9ee50a8 partial commit on DebianTesting32 | | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | | * | | 68d3abc7b8353e41d03ebc0c5eb48d524d4d3a77 partial commit on DebianTesting64 | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | * | | 6999ff89558d4de609e9b0b2de546dbbfc737967 partial commit on DebianTesting64 (iliade) | | | | | | | | | | | | | | * | | 87e2b831355830078273e02eb4ed7ab28303e72c partial commit on DebianTesting64 (iliade) | | | | | | | | | | | | | | / / | | | | | | | | | | | | | * | | 5ac4ac46780b1861811bf96d557cabad0c4fb86e partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | * | | 8ee7857278481110c8e0cb5454e44cb3cc40d923 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | * | | de4d4ebb547d0e6c9a0b892290c5d646a02e5101 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | d862d7bad989bbe2862de10c718f4cd1fbea8715 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | ea3b641c4c4617ad8296898420ed1cc156512657 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | 039b1189a47bc6e444d99b22dfc8d00374c98deb partial commit on Windows (telemos) | | | | | | | | | | | | | * | | 2649a7cf5d41bb315ba5b07ab13e92897a6f2f06 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | 8567eb9dc31a0b2efb0bda7ff54b8381dff84a79 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | db38e53e0128dfc3d77d300674477e4397fdd571 partial commit on Windows (telemos) | | | | | | | | | | | | | * | | 1559e5f47f8c74a9446bcd91e7b13c862da3cf80 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | * \ \ ef3251415af44750e1ec38ca8cb4a91a496426e8 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | * | | 07c050b3e6018476a80169efb42ceb0ad41074d9 partial commit on DebianTesting64 (caen) | | | | | | | | | | | | | | | * | | 72c182ba9bc2c58f8c6c78e5e6cfa2197c139161 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | d3f7461b66e5174510ec7aa51e97560abfc01308 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | dd47329afe0a070159f0df06b7f4f56f0ce64340 > - Separate download script for all third-party software [[file:download/getall]] (request from FH) > - created common makefile goals in [[file:download/common.mak]] for all downloaded packages (request from FH) > - changed [[file:download/arpack/Makefile.am]] to make use of [[file:download/common.mak]] > - done for [[file:download/blas/Makefile.am]] as well > - added option --enable-mkl-mlt in [[file:configure.ac::enable_mkl_mlt]] to allow FF to be linked with the > multithreaded MKL when an external library requires it (request from Atsushi Suzuki) partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | 719816dc9b79aa865531dced9658c3c4ef25779a > - Separate download script for all third-party software [[file:download/getall]], request from FH partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | bd907b3ad2e517ab9358c99214e00c7ec8eb332e partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | 3bc8d192efff8c87f09680b0ec387ec7865e2ef3 > - Set all hyperlinks to relative paths to make sure that they work from any location partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | 42049c3aa04547695d2f78d3cc902a1d5903163b partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | cd7468d75bdf73459be312dcb9cd42a6ae40f11c partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | * | | 5d4029bdb814dd83d232441609696bfa05170796 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | | / / | | | | | | | | | | | | | | * | | d205a0e119cee04ee79134a3aebd4440856feb41 partial commit on DebianTesting64 (odyssee) | | | | | | | | | | | | | | / / | | | | | | | | | | | | | * | | c4a6cccad1c89843388bfcfaa6b6a8a1554ce415 Incorporating changes from FH (default branch) into ALH developments (alh-dev branch) | | | | | | | | | | | | | * | | 9ee49d6dac6fdb9553b0dd4417ee74f06e653a45 Incorporating changes from FH (default branch) into ALH developments (alh-dev branch) | | | | | | | | | | | | | / / | | | | | | | | | | | | * | | 26d04f608e9f161ef732171543058c96669ae5ff partial commit on DebianTesting32 (buis) | | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | | * | | f794d00776381f79859bad8903fc30b3ca359adc partial commit on DebianTesting32 (buis) | | | | | | | | | | | | | / / | | | | | | | | | | | | * | | ff2ee039385a8c51225596884c9dc863cb718d77 Compiling FFCS on Windows 64 | | | | | | | | | | | | / / | | | | | | | | | | | * | | 2dbb3adc9dd16a6557a567bfcaa532a600fd3cec add remark in innovation file | | | | | | | | | | | * | | 79bde50fdaf2e24a2b77abb33d372e2620f87b3d add missing function in gsl | | | | | | | | | | | / / | | | | | | | | | | * | | 5a8046e27d8ed5345db0df426411dff355661c1d add AddLayers in 3d | | | | | | | | | | * | | 54121801156fa2310f4fee599ccd561ca888cd3a correct AddLayers | | | | | | | | | | * | | 90e2e4a363d062ccd4a39ac90ed919d55d567941 at init of full matrix this inverse matrix. | | | | | | | | | | * | | 568e859e194eb6154f5267acec869851c7dc752b rebuild AutoGeneratedFile.tar.gz | | | | | | | | | | * | | 7bda159115448ffb65fd1261b294b25f7191613f correct SplitMesh function in case of P1b3d display. PB in memory management of tet. | | | | | | | | | | * | | f502107ef496d4a8c08cd835778a6039f5d5f0af up AutoGeneratedFile.tar.gz | | | | | | | | | | * | | 5ecb3fac470f1191925b7d10f8fead2a74ef5151 correct but in splitsimplex.cpp of P1b 3d case add cerr stream | | | | | | | | | | * | | a5721a77f8e1f5988d9985f08f8a88fc40b0d61b add BuildLayer function i C++ | | | | | | | | | | * | | 6bd7c128f14d5868026961ecb3afb0451012e9a7 ajout pour P. jolivet de int[int] IPG(1); trunc(Th, x<0, new2old=IPG, old2new=IGP); | | | | | | | | | | * | | 62267b7b31987055f4bbd935673f6b4558699554 add hypot c function | | | | | | | | | | / / | | | | | | | | | * | | 3344aaacd3c407f784f5b44817028242e18c0d1a merge and put pastix coorect | | | | | | | | | |\ \ \ | | | | | | | | | | * \ \ 25aedc55b3d05c88975a34f3f8dbe9feb499791d mergeing bad branch .. | | | | | | | | | | |\ \ \ | | | | | | | | | | | * | | c5d2c87a18972b8198c1a324cc8888fbbd82ca80 merge | | | | | | | | | | | * | | 8cac6ce007825fa7e67fe0a6f5eb6042490e2076 correct somme topy after big change in all plugins. | | | | | | | | | | | / / | | | | | | | | | | * | | 72ede2482670a3009ad8d77044df55535b4323a3 revome bad change | | | | | | | | | | * | | f51e5e191fc26c06b56f1413bbcaceacdd005b9e coorect merge | | | | | | | | | | |\ \ \ | | | | | | | | | | | * \ \ e82fc4fa55dcc23379b1a8fdc25d938f034da7c6 correct Makefile | | | | | | | | | | | |\ \ \ | | | | | | | | | | | | * | | 1a9fa22c670ce97bda958e0e22c1b379c615d112 merge | | | | | | | | | | | | * | | 8baba3ef050444f163918e409f70e044d0a4f6b3 coorect pb in MUMPS and add tool to find undef un plugin | | | | | | | | | | | | / / | | | | | | | | | | | * | | 7b6c2c06bb3da0dfe2a6303e7d5e8540b17513ce merge ... | | | | | | | | | | | * | | 2f9666b084ee572f65582bb64aa441f2babae840 coorect DOC/gnu.mak to build .pdf .eps | | | | | | | | | | | / / | | | | | | | | | | * | | 143ddf1a9f27aabffa2d5573e3ba23e21d57e280 correct makefile | | | | | | | | | | * | | c323709450004be5d7673245e519d6406e4253d1 merge | | | | | | | | | | |\ \ \ | | | | | | | | | | | * | | 26c95e6e9cb4d2ee0b1987e70b26fe36b663861f coorect retrun value of clean_all_installed_ffpp.sh of install on mac; | | | | | | | | | | | / / | | | | | | | | | | * | | a76b60792267c2f5903d416fc39f6a25545d9193 merge | | | | | | | | | | * | | 29737befc9e97eae129c3939effd0db08d4bc9f8 correct typo in parm interface (not check) | | | | | | | | | | / / | | | | | | | | | * | | c3da3df75531f35c9a8d4de88b717de6e6c48d79 correct pastix | | | | | | | | | / / | | | | | | | | * | | c408aa6f9c840282ef309dcb94e9c2eb5fe0142e correct type | | | | | | | | / / | | | | | | | * | | 4db15f78c0ad2a22e9cbd3b49ebba7eb55a383ea remerge version | | | | | | | * | | a3be935d7b11ea2d8b30e8c0632f6b583f275096 past to version 3.36 | | | | | | | * | | cc5f67995685bda7f2a973eb05d934dbca212b08 coorect metsi | | | | | | | / / | | | | | | * | | b01ecd628a1600982ef2fb148ce745d56d900a66 add new test cube.edp in check | | | | | | / / | | | | | * | | 78bf8c4744c830a963c93ba86b9ff40514f16423 Keeping ALH and FH copies of default branch in sync | | | | | * | | c0726ea8572998f65dc17252004b6f3b70d15b15 Merged new developments from FH into default branch | | | | | * | | f2520adee7340f322d50278a9097f77c8cb00ec2 Merged the FH default branch and the ALH default branch | | | | | * | | 1381aafab4bd223c9be7622d381d1213bacd9418 Merged the FH default branch and the ALH default branch | | | | | * | | cfbadb058b76f540442f18cb483cabdd4e76121b merging | | | | | * | | fba1da71db4fc71ba660ca0f54c6e03d7b277d8a Merged changes from FH and ALH in default branch | | | | | * | | d40c11a9dbcc2ed0f5a24b44bd08eb66368b7eb8 Keeping ALH and FH copies of default branch in sync | | | | | * | | 66cf941be04d667bbd82495a03a8f3d8019821ff Merging mods from FH and ALH in default branch | | | | | * | | 0f8fa6eab3c290133fc5c1441601462e8eb703fe Keeping in sync with FH's tree | | | | | * | | 73fc2dc227a60f23e079bca2514199b8ba37c259 Keeping ALH and FH trees in sync | | | | | * | | 2b7d26209b21dbc71690e7eeb9e41e36b81e28df Forwarding ALH changes in default branch | | | | | * | | ad20b8c9e2ad215cf7208615e1da5971958240b7 partial commit on DebianTesting64 (iliade) | | | | | * | | 4b913182a6ac370183d68124ab4dbb7acbabfb73 partial commit on DebianTesting64 (iliade) | | | | | * | | 4903450f7a7a411a1ce07ee448a94f85451c25a4 Merged SuiteSparse download address change into default Mercurial branch | | | | | * | | 691ee85d0038ae7bbaf889abf4bce7efcc66428e partial commit on DebianTesting64 (iliade) | | | | | * | | 31789dad926bef2c99f7b2270fc41462940ef678 changed SuiteSparse download address | | | | | * | | 09ad8f3abc3b41fb410df03bb16d0f6e251b0248 new -h inline help option in download/getall script | | | | | * | | 6bead515fc39f92bf49c2e042f1fc511a7821fe4 Synchronizing FH and ALH trees | | | | | * | | db1b3c1b0bf9a7d7ce7299242bf18862eb8cc18d > (ALH) > - [[file:download/getall]] now checks downloaded packages against known MD5 values > 6/2/14 (ALH) partial commit on DebianTesting64 (odyssee) | | | | | * | | 3cfb133aa6f9f47074108c8a8b43731b41544d70 [[file:download/getall]] now checks downloaded packages against known MD5 values | | | | | * | | 7f0eeee858a587636226014548873b46bbcf1ede partial commit on DebianTesting64 (odyssee) | | | | | * | | 41b39a1f7c351792b7e89c99d7d67354041d5076 partial commit on DebianTesting32 (buis) | | | | | |\ \ \ | | | | | | * \ \ f8924ccf04fd74fdb7aa83d26484b780339b80be partial commit on DebianTesting64 (odyssee) | | | | | | |\ \ \ | | | | | | | * | | 1c739cda067ce2ca96f75409214c56ce476742f5 Keeping ALH and FH trees in sync | | | | | | | * | | 99dfd3f0ee66eecd947a66d0777378b630c365b9 partial commit on DebianTesting64 (odyssee) | | | | | | | / / | | | | | | * | | 2c79b08ee54c54e576d329aa7e631d2f409c56af Corrections for ffcs-src.tgz standalone compilation | | | | | | / / | | | | | * | | 200dcb83362ea0e7d750a07f590ae25c4f75f125 Enabled downloading packages without threads | | | | | / / | | | | * | | 8b34575f3b9e5a112d03e624940329a551f114e0 romve extra file not used | | | | * | | 66089a51fae5f80e2428afc6bf03c617af922b52 clean hpddm dir | | | | * | | f8bcc25189f4b7796010641de007697a2dde6e8a remove used file | | | | * | | 8403dd05f92e01d347e94a77b60b0e8c971efc74 correct diffusion and comment buggus elasticity-3d.edp | | | | * | | 2976b0c0a5b027b71ce1ca2676eb6e2f205fe65b correct FreeFeM++.app | | | | / / | | | * | | 0894e3988e2ce1372b3f6e10b50dda866276d06c rebuild FreeFem++.app.tgz | | | * | | 48800c4a12335d5ddce0b55943bdf1cf66c9a958 add new convect 3d in test | | | * | | 14a4056fb0fa7818758bc9190d6ac0923058fda6 rebuild AutoGeneratedFile.tar.gz | | | * | | cef06d6489e7ac2ff9e4a01e2ee18823c0f78b41 coorect pb install aniso plugin if no mshmet | | | * | | a62b742676276763eb0a1bf35161967ebcb2ee46 rebuild AutoGeneratedFile.tar.gz | | | * | | 000662277d5fb4d0eeb9f159ff455368d8c1b9d6 correct pb of download when install | | | * | | ab1b62549d0b4d93b7208b17ac2382f9845811cd rebuild AutoGeneratedFile.tar.gz | | | * | | 271760c521a2e947e11fbb95dc72b588640af32a add missing file | | | * | | ecbed7c0b4287a7107f85373976f5f8adcfaeb08 add missing file | | | * | | 612e62d8c6ed734e3f4e76276d52e8e03d4b9e3e add missing file in distrub. | | | * | | fc06e898efc9d96641ef795c406ad47badb2f220 Coorect PB install on MacOS | | | * | | d50d665ab41c42fd729325637ec292f86ea5fb75 correct md5 of blas.tgz | | | * | | 73f0e0529368352feb207d2d85f229d7be539834 Modif to mingw64 build on msys2 change ipopt version to 3.12.4 change flag for scotch under msys2 / mingw64 | | | * | | 2f91f72bfd5d12493f2a6e17a7eff87325907f01 correct CheckAll test | | | * | | 180e8e30e0732bba4484bfe8ea3d41ae6cc5c51f do all of change for install freefem++ on Mac | | | * | | 03960b677849d5d6d19693fd45f0dc0af97f225b rebuild AutoGeneratedFile.tar.gz | | | * | | a33eae5ecfbc6c459fcfe2e90cc6519779df6dfd correct small bug of parallelempi du to const mesh change | | | / / | | * | | a272b760477f144300706cf42f70a3eba502fa03 add new 3dquadrature formula until order 15. | | / / | * | | c1a1acf063d338cf78474b08f5d662ea93020493 Win64 () | * | | c17763a66edbb99691b4d90a32b1b8fdca5215ef DebianTesting64 (C) | * | | 44f75a8160c592096c09277c7f36712c913bf8de Merged updates from FH branch (default) into ALH branch (alh-dev) | * | | 9618e09cb966b3f15477b042874574047aa36179 DebianTesting64 (C) | * | | 496cad4bf5e48585784bdc356abbe26a0ef1cc57 DebianTesting64 (C) | * | | 21aadc1f6630aa95e7753cd57019b4253e8febb1 Merged updates from FH branch (default) into ALH branch (alh-dev) | * | | 03136ab02e8fabbd70a5d41d7cf7dc0245582486 DebianTesting64 (I) | * | | f1be162400c53773546915d86c8b1d828e037880 DebianTesting64 (I) | * | | d48429fb0862e756d95a140fc7af73b228d9cfaa partial commit on DebianTesting64 (I) | * | | 883bf52bd810d6afd154ef6cb92093200f914b23 Merged updates from FH branch (default) into ALH branch (alh-dev) | * | | 475163334b268aa90ebc4f3534503b2973951443 Merged updates from FH branch (default) into ALH branch (alh-dev) | * | | 73b7ca45eda0360a298d16ad01dada4254fef654 partial commit on DebianTesting64 (I) | * | | d39060832283af6e03baae07d83e2dcbca55cf5f partial commit on DebianTesting64 (I) | * | | e0b8300ccbc6294d2df4d2b84fb00fbf9538dc6c partial commit on DebianTesting64 (I) | * | | 3508c2b2905f5c7c3a9bb4580febe2400683ce2e partial commit on DebianTesting64 (I) | * | | d2942d856e8b6d85de7b9c365244ed3ebec1f7fe partial commit on DebianTesting64 (I) | * | | 7770045a558f9670575ae8a632346f783779bb13 > - synchronized lg.ypp with lg.tab.cpp | * | | 3041f4b89b2ce8dbf23ac8ac6c959e54e6a15271 Merged updates from FH branch (default) into ALH branch (alh-dev) | * | | 6cb6516896f6d2e32713681f8cc3989245e9d3ee partial commit on DebianTesting64 (I) | * | | 0b19f83caf17d9a65df32f5a9be524beddc6fee4 partial commit on Win64 (PO) | * | | e74c12750934da7ae351cdba51b34bb000a77255 partial commit on DebianTesting64 (C) | * | | f60beaa2356fcd6d49467fec1e795b413d11a1f7 partial commit on Win64 () | * | | f75a11c87264eaa95ef6e4d57e35f741bc24d55d partial commit on DebianTesting64 (C) | * | | bba5113eb1b79c544df5a6250b4dee51ad6980ec partial commit on DebianTesting64 (C) | * | | aa1a9cd7e27772a6d529c998d12ef0f687c9d454 partial commit on DebianTesting64 (I) | * | | 6a177f8f3a94fd776124928c28a43bd1fd88e7eb partial commit on DebianTesting64 (I) | |\ \ \ | | * | | 271a798c4d1470b0084d2ccff01b002a10831cf2 partial commit on Win64 (PO) | | * | | aee3f7c5786f4196aebeeb07ad21311d97579960 partial commit on Win64 (PO) | | * | | 2053f6065af6f5bee3ecd4f0ff99f3f27766cd56 partial commit on Win64 (polypheme) | | |\ \ \ | | | * | | 8aa30c636b12fbe108bcb7a2b8b060e2a7ef2fb6 partial commit on Win64 (polypheme) | | | * | | 690eafb88f4d926e5eac5d02f6201f54b46f161c partial commit on Win64 (polypheme) | | | * | | 426ec9a163d7ae8f339515eb2006ab7d255f8143 partial commit on Win64 (polypheme) | | | |\ \ \ | | | | * | | f0d72667a69abfb33ecc0d083f19ce18f769dfa2 partial commit on Win64 (polypheme) | | | | * | | 90725e23eff059dd82102750bfc6d9535cd9b8d4 partial commit on Win64 (polypheme) | | | | |\ \ \ | | | | | * \ \ 458a2c37a4af64596d26ce103c1e8f4e4ef24917 partial commit on Deb64 (iliade) | | | | | |\ \ \ | | | | | | * | | 6e13f7ff2c28d5a4a7a4de33b8467e314c3881e8 partial commit on Deb64 (prelude) | | | | | | * | | 912f130375f4b213f69d8e6d4f0fd1fd3780d6d2 partial commit on Deb64 (prelude) | | | | | | * | | 7e67fd2a709869138d30b5f5bc4b1bb62da4ddc3 Merged updates from FH branch (default) into ALH branch (alh-dev) | | | | | | * | | 19621ce3130d703f2d69578b938dfb22c3dda173 Merged updates from FH branch (default) into ALH branch (alh-dev) | | | | | | * | | ce2553730df536e84003b035c1f6325c212575ed partial commit on Deb64 (iliade) | | | | | | * | | d024b4c5cbfec7abf47870f907eac3bee417cb79 partial commit on Deb64 (caen) | | | | | | * | | 23866dd3272e73d52adf94e0b3339c0acae96ce9 partial commit on Deb64 (caen) | | | | | | * | | 3923fd3d2debe23d01bd9e463c87f23ab552a375 partial commit on Deb64 (caen) | | | | | | * | | b846aacd0c40338e6e43726f7655f8127ff988dd > > 4/3/2015 (ALH) > - Edited for compatibility with Emscripten > - Added calls for Javascript graphical output along with postscript output partial commit on Deb64 (iliade) | | | | | | * | | c10b8930e82e303264f1d382ae64240f9f6969db Merged updates from FH branch (default) into ALH branch (alh-dev) | | | | | | * | | 355447ce11c5e4bf29393e4996c4bcd5c133f046 partial commit on Deb64 (iliade) | | | | | | * | | 5ff0367f4339e0c3af0b5c61fee205b44fb13b76 partial commit on Deb64 (prelude) | | | | | | * | | 4fefcc988d2a8fb6925a49d1bae9950f817af691 partial commit on Deb64 (iliade) | | | | | | * | | f9a1aa099a81460b09ee625e98219b12e60d6b0b Merged updates from FH branch (default) into ALH branch (alh-dev) | | | | | | * | | 2cb75ad61bfaf2b0a8f6174283c411300900bcaa partial commit on Deb64 (iliade) | | | | | | * | | 977d79a0eaadba72ec48e327522345adba833d6c partial commit on Deb64 (iliade) | | | | | | * | | eac396f2ef4c1b1e4ca05ce3454ae720f8ecad1d partial commit on Deb64 (prelude) | | | | | | * | | 85c99ef9836d443fe995b1b960d74b7102cda083 partial commit on Deb64 (clipperton) | | | | | | * | | 6ab93fac180b41a86bdc48e6be0aeb67c114159c Merged updates from FH branch (default) into ALH branch (alh-dev) | | | | | | * | | c768607f9635a54d55664b8c9e9f4385dc0e5bfd partial commit on Deb64 (prelude) | | | | | | * | | 4831a98e4741780bb669101b7cf785a6dd66bb4d partial commit on Deb64 (iliade) | | | | | | * | | 5e9fca7c40a0fa7bb4fc01c957fefeada57e7c4c > - Added calls for Javascript graphical output along with postscript output partial commit on Deb64 (caen) | | | | | | * | | ce1ac484b3d23fa1a303cd29dc64c47c17aaa6a3 partial commit on Deb64 (clipperton) | | | | | | * | | 30624a0f1702a2ea7ea586059c9cf158c4e4068b partial commit on Deb64 (iliade) | | | | | | * | | 189d3f2f6edbc8519ce89a93d67c1260c252a51d partial commit on Deb64 (prelude) | | | | | | * | | 668fa0d00dd7c6c615841b90c48cf39818f3e281 partial commit on Deb64 (iliade) | | | | | | * | | ee77dbd8a10862112314b56423058a05a44539d1 partial commit on Deb64 (iliade) | | | | | | * | | fc6b2654eded51f9b7d045e623836752083fd897 partial commit on Deb64 (iliade) | | | | | | * | | aee5d01e1f8f6771a32e231cddc0a5f09e829fe8 partial commit on Deb64 (iliade) | | | | | | * | | b6e05859ed441143115706eee162087bce2a9b44 Merging mods from FH tree into ALH tree | | | | | | * | | 3d239c35bd42d8de2e8648983bbc961cb5a09bfe merging | | | | | | * | | 6e30d90ae2e63d7927dd1e6e1eba3b10eb51b906 merging | | | | | | * | | a1dae196f382842f88244ca090c833623ffbb712 partial commit on Deb64 (iliade) | | | | | | * | | 6495a95c23a17a132f0f9f9b135b545234e20e0a Copied new developments from FFCS into FF (ffforcs) | | | | | | * | | 104efde87d550dcaf099521fc734f8be0d3c6532 Merged new FF developments from alh-dev and default branches (ffforcs) | | | | | | * | | 78a542efd5aa2fccb966133c1320a8109438a174 Merged new FF developments from alh-dev and default branches (ffforcs) | | | | | | * | | 2d25b22740a30c796c7eb0fb05a2cdd093d22151 Merged new FF developments from alh-dev and from FFCS (ffforcs) | | | | | | |\ \ \ | | | | | | | * | | 05fcd566cd2de3b2221b303f3ad88bdb32e4ae78 Copied new developments from FFCS into FF (ffforcs) | | | | | | | * | | 45c0ec10d21d706d5ae65d4d1f7f1a0d74bd8477 Merged default branch into alh-dev branch | | | | | | | * | | fb897b47008c9d9b3c1bf717bdadf99a9839f1c4 Merged new FF developments from alh-dev and default branches | | | | | | | * | | 30eb22987395443b666c18e1353a0c085ad8912c Merged new FF developments from alh-dev and from FFCS | | | | | | | |\ \ \ | | | | | | | | * | | b031337c6fbc68b14fdf4755799175082a27d95c Copied new developments from FFCS into FF | | | | | | | | * | | 50ab74ac5fdcbc1e17bbe7a7f2f0cf412a53b73d partial commit on DebianTesting64 (odyssee) | | | | | | | | * | | cc7dfdee2d33c3dd026ae113062d0a740e596d1b partial commit on DebianTesting64 (odyssee) | | | | | | | | * | | b000e5143e050654b5b3244b7b65830806d82838 Pulling changes from branch default (FH) to branch alh-dev (ALH) | | | | | | | | * | | 9de6016295a3b2313102e0380e88f090b8183485 > - Corrected --disable-pdf configuration option (useful for FFCS build) > - Removed obsolete cvs history directives partial commit on DebianTesting64 (odyssee) | | | | | | | | * | | 01dd42ff8701356b4044a9ede826c58955777169 Pulled updates from FH tree to ALH tree | | | | | | | | * | | 6ec42c065fd174714aa9cb2215fa1636a9692d13 partial commit on DebianTesting64 (odyssee) | | | | | | | | * | | f656502b6fe4479336170489b5eb53c82badc9a5 partial commit on DebianTesting64 (odyssee) | | | | | | | | * | | 43dfc20cde2301ff0d0c4faff732a21edd8684a1 partial commit on DebianTesting64 (odyssee) | | | | | | | | |\ \ \ | | | | | | | | | * | | 0d8ab2aa91ff5405c8e05c22ac6cbdd0f920cbd6 partial commit on DebianTesting32 (buis) | | | | | | | | | * | | 984170323a6682bca0ececec1af458f840f10fc8 Imported changes from default branch to alh-dev | | | | | | | | | * | | 34d103bd6e5b958a03e192a367d653d1cac83a4f partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | f2933811c0dd3c685c08953e8475f7008e468647 partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | b6d4a93e7968f95a6af1f93b2da17a63a979ebde partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 49806715814c5866593d1a2315e758b4f93c5ce6 partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 76c2694d93702b50ea5ddca170c18abde4efb39d partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 6354de31f1bfdbab8befb3c175e4e4677c69c7a3 > - New script build/orgindex and file index.org to list all hyperlinks in the FF source in Emacs org-mode format > - cleaned up old comments from the documentation to enable automatic convertion into other formats (eg wiki format) > - many small corrections for Windows compilation > - added "NbColors" in plot() parameters partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 05ff187045620726e7d413ff86ed3c1fc589aff6 partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 411a82dc7cc8d600c7313c4fe1b0dd4f8e5c0a3a partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 6356f6d9dfb26fcf7da40b141b2864b719271f21 partial commit on Windows (telemos) | | | | | | | | | * | | 50e589c3ca91badbdff08daafaf7bfd72cedb207 partial commit on Windows (telemos) | | | | | | | | | * | | ce34e2cf07bc6797d8771253eb683d335d4f42e9 partial commit on Windows (telemos) | | | | | | | | | * | | 14398d225d88f9061dd7d7916e2b51d8b2804056 partial commit on DebianTesting64 (odyssee) | | | | | | | | | * | | 5c35eb78f2694f6ed848329367ec80a521db8f92 New FFCS version 14.1 using FF 3.26-3 | | | | | | | | | / / | | | | | | | | * | | 0e0423e485b9f455c5e6fa3241b5bbeeb2a1e740 > - (ALH) > - Enabled monothreaded downloads in download/getall for platforms that do not support threads (eg Mingw) partial commit on DebianTesting64 (odyssee) | | | | | | | | / / | | | | | | | * | | 586f57ea76b02d93a79083741729f1a93955f188 partial commit on DebianTesting64 (iliade) | | | | | | | / / | | | | | | * | | 57c24da42b509e13678004a97adcb4f2a58bbe0e partial commit on DebianTesting64 (iliade) | | | | | | / / | | | | | * | | 1bc17f453bdf2aee00381bd4b1c931e00b092fa8 partial commit on Win64 (polypheme) | | | | | / / | | | | * | | fb08d09d93ae7c7118aaf249e717ece81fd23198 partial commit on Win64 (polypheme) | | | | / / | | | * | | d9d34d279319ab27c774406b5104b42eadf01035 partial commit on Deb64 (iliade) | | | * | | 7b913de2242f38e532aa3afffa9f1bd8e66b03a4 partial commit on Deb64 (caen) | | | * | | f9bc076227b8830156e085ed85b5d08c951b39aa partial commit on Deb64 (caen) | | | * | | 5867466071fb329f7ec8eeae5cf53b3c4f768d84 partial commit on Deb64 (caen) | | | * | | f6b1fa1791c345102e715a719a125359affb7ddb partial commit on Deb64 (caen) | | | * | | 84ea53d1a2fa2597500fe862e8ff2ac8cf8de01a partial commit on Deb64 (caen) | | | * | | ca4230a6f5fcbfab5f1b4532934690ec5bd7132e partial commit on Deb64 (caen) | | | * | | 71cf5d8d3df87bdc97c4e4604f7a27c44ba93c59 partial commit on Deb64 (caen) | | | * | | 819c69970c28803a074fc21e7942e45320f48f8b partial commit on Deb64 (caen) | | | / / | | * | | c26c8c26e0256bb070ccb380fe65d3c72c72bedb Merged updates from FH branch (default) into ALH branch (alh-dev) | | / / | * | | 6664bb8950d5750e2a051d56a8f661dd24cb3b5f partial commit on DebianTesting64 (I) | * | | 7005778c82d4b38bfad78ba11b2e2c99e628371f partial commit on DebianTesting64 (I) | * | | f639c5a839d435c3a7df4cb32d41e1520c48c78a partial commit on DebianTesting64 (I) | / / * | | a7f737a68067571894254fc130ba74e2f0f235f4 coorect of pb float / float un vtk file * | | 8c982af90483b83cb802e941de79a3f164dedfee Maxwell solver + less output when not needed. * | | 1677aee31cb0ba29f7c43322711a23047c703901 correct the class OneOperator1s_ mistake beetween E_F0 and CODE class add GPvortices function in BEC plugin * | | c2113330a73a2ff1a7870d28c9cff67f6669e94e add GPvortex and dxGPvertex , dyGPVortex in BEC plugin * | | a6c443c3636d72b1012816b9b1eb626b256e6df6 try wrong thing * | | 056acff7cf099c4f700b97bac8ac28f1e7d8c530 - tools to build new FiniteElement2d and FiniteElement3d from quadrature formula * | | 0706b01c4331b791f1f8ffa833790a24eff6aa46 pass to version 3.47 add last hpddm stuff * | | 7d62effaada3343a7ecbbedbd8508924c5d138cc FETI/BDD solvers from HPDDM. * | | 96c268bb18c2bdce7e0db9cd425dfa55822e8c6f add new include file to extract an orient list of dof 2d border * | | b3b3d79f39072561101423b3dd04dd21da550772 Exposes another rountine from HPDDM. * | | 522cba48f23d28932b97ec6c4ac419145fdd22d1 Bumps to the latest versions of HPDDM and PETSc. * | | 04abd3f769412190fdaeb3f145c435f62f6e3e5c update a the doc for levelset intergration * | | 98f0f09ac9fdcef05b99d4b8eaf1eb36a9e75355 correct typo/ comment in gmsh.cpp and update INNOVATIUON * | | 3c5054c1a8bbd1637769c0b1779198b78c3beb41 add savegmsh 3d mesh in gmsh plugin .. * | | 8c67ad3840c02879857dc36feb43ba2ffc9ab483 merge with P. Jolivet |\ \ \ | * | | 6cb3e1fa8747c5ed2dff3c4a604aa0e2390fc8ca correct small (m too small) pb in Element_QF.cpp for EFQF21 and EFQF15 | * | | d4b1588bb3a7c9e4e54b916d1ebd0e05361e5a07 correct configure in case of no umfpack .. | * | | 2e11a2212a0217ee322e814b86af906592a25446 correct type in configure.ac for windows | * | | 0a032f169e0e861006cf45bba06e9b7133db01b7 rebuid AutoGeneratedFile.tar.gz | * | | 30934ab2ad707ef0d32cb2ca9062d639a8aadd8b coorect type in make file | * | | 8cc76e1ae6ae77d65e0c11af59e64406dc4a0baa rebuild AutoGeneratedFile.tar.gz | * | | ddc86446ed1e8e27bf623f78278ba3be3df9ddfa add save of PATH in reconfigure process in configure.ac | * | | 3f3e48f7f5012cf79e1a36fe214c34cb6e772268 add patch on metis from Martin Stachon | * | | f73f0217f1b5f2534553cbbbf8656f5a421cfda9 coorect typo in INNOVATION | * | | d9f8d57c95e719fd8e047774dd5c8266c1078348 pass to version 3.45-1 andd add new finite element | * | | 232fb0b8070bb2f7927d3bdd6f5edf1453e2fd49 merge P. Jovile modif | |\ \ \ | | * \ \ b2e333e304aff0d6e8c0be62599ea676ca40b2b7 add merge | | |\ \ \ | | | * | | b0ffc0e1ce2f0d796b3f5a7efdf83fbdc38191ec Avoids problems with penalization in Stokes examples. | | | * | | 7e02826fe50fd1a2f81cca0df404248ee3855ea5 Spurious output. | | | * | | 4ddcb504689a6872243a4fb1a301f4032ee20ba3 Fixes PETSc for complex numbers. Adds a Helmholtz example solved with PETSc. Updates the downloaded version of HPDDM. Fixes the options of the Stokes examples. | | | * | | 83ed869c02d038635bbe98408b42a95a62bfe4c4 add the real use of --with-umfpack-include= | | | * | | 687504a24d3afed98dfbc8c7ee17ea77b32ca698 merge version to remove print | | | |\ \ \ | | | | * | | d08491d238cbb6789b42ca3e8d4a6241549d9c59 coorect missing static in load func | | | | * | | 67a8a0c4b6fcc22984fc39412c3ea1871f16270d some spelling corrected in freefem doc | | | | |\ \ \ | | | | | * | | 8e985f979f0d85dccceddfeb328455ed2d520c33 some spelling corrected in freefem doc | | | | | * | | 4b417866351cb4759b4e04f34f5efc21370df71d ccoorect alse PETSC.cpp | | | | | * | | b4f02c323bc242ce183c6be8b364265790c2a428 correct PB compile hpddm with petsc in so case | | | | | * | | 2fad7d1976167364af68318135f185fefa8d7510 coorect typo | | | | | * | | 26f9b18893441a12c46b20430773d4a3673f0229 add missing Element_P1bl.cpp in distribution | | | | | * | | ca5e44eb7db604059ba118eb45269721bb3a19ee add in doc forall stuff / or implicite loop | | | | | * | | ac547512bc976bf74b95cd30e73c4293a5dc2f9e correct strange bug under windows OS of new ForAll loop on string map | | | | | * | | 34f09267ff4415e1ac657cdf33cb650f0a3318ab coorect typo un missg clean memore in for all loop | | | | | * | | dfc3719466bb86986e1cac38f7fadaea513befe6 coorect ffglut bug si INNOVATION | | | | | * | | f340b45d39504510251be5781ffd2a2a2cb195cb coorect typo in Makefile.am | | | | | * | | 4022eac2a4f2e4435b383d18756960c5da34377f correct install Freefem++ cocoa all on darwin | | | | | * | | af9f500cfd74ce51554699b1cb9f8f445e389bbe update README file | | | | | * | | 93c1cb1fa6f7ee349a7f49b5202c7ae52c3aaee4 corrrect tyo | | | | | * | | af797d34bdebba715417ab9b47aac6d2df7e7bd1 coorect last type for lacpack plugin | | | | | * | | 36df2b5bf4f1d04b0e5774cd10316f1d0b86212c add include in ../config.h in /ff-Ipopt.cpp | | | | | * | | 9c6507a4b7cc10a6fa76d41a9eb24b0fe3a949f7 add missing lib ligseg | | | | | * | | de02efe92c7db1c695e00fbb3d1770232dfdb28e coorect pb tag superlu | | | | | * | | c2887be33202e7091f4a325e27edf45b54e9b3ac correct topy super4 | | | | | * | | 6ff8aeed2efac0d7f0b06821d1156944a9c64d45 coorect nlopt search | | | | | * | | 891458b8e3ef4b780c29a39b84d6fb547f3dc921 correct typo on superlu | | | | | * | | 9f47ace02baaa5e94013e3b4b212a65853978b20 coorect bug in congigure | | | | | * | | 0ef371a21b71a7aeecd357f038538b03bf4c0ada correct superlub pb | | | | | * | | b61c17c03a38d190418b7389bec5634c27d17892 correct typo | | | | | * | | 01180c5e75edcc673f7e27703eb7b2d324cc26ce coorect search lib | | | | | * | | 0e6689d1d2fa2540f8b7b640210155d003e12582 change lib name Ipopt in ipopt due to mistake | | | | | * | | cbd93aa676467e9e6e992c8a871f94c2bba15eaf add missing flage | | | | | * | | 61b7d46daffcc762ca2d3b743dbc804346c51219 pass to last version of tetgen 1.5.1 bea | | | | | * | | 1c5244721201f3a2015404374ff054cf33f66b10 coorect typo | | | | | * | | 025a0816ba9c743309ad1ba5244153da5a7b5ffd remoev a fist test of tetgen | | | | | * | | fe86a01ef198759eb593d6e048b2998687e49559 correct typo | | | | | * | | 056ca6f8205872e5d0076badf3afd142101b0c8d add remove tetgen compile | | | | | * | | d71450d0667362ead462b85803b7db788ee87b49 try pre install tetgen | | | | | * | | 6fa811ae831a112f22273fb420e20d93cb8ac786 coorect pb of search mumps-seq => mumps_seq | | | | | * | | 59ae04f7afac5844a5382e453ca2c4e29b210761 correct search preinstall lib | | | | | * | | d27c0964b498173fdd44187d169b18701044a6ef correct type in package list for ubuntu | | | | | * | | ff370fe61982b1c4098566849f5f1ba39328ae69 add web site file | | | | | * | | a903f2ad725c5a5ca22c56db89c6bbf2da9e3574 coorect wrong negative in CheckAllEdp | | | | | * | | fc857a0dce4738b4350536d7ca771528ccc5c26f gthis file are now in examples++-hpddm | | | | | * | | ca2ec3e872f62cd50ddb247107ad9ed1b8746a20 add missing compilation plugin Element_P1bl | | | | | * | | 1df0e6d4e71c52dbf4b598753efc24f454bf460d add Th.hmin, Th.hin, to get meshsize info add configuration of petsc script | | | | | * | | 97ebc6bde8a9a5a8729c54c984b9399c95105946 pass to version 3.44-1 | | | | | * | | f5f0ac555437a7e18c568df9d8f4fc81a006f932 correctcoorect IINNOVATION | | | | | * | | a3e4729e21e68dd948438341efa5cc07a87932a6 Remove unnecessary output. | | | | | * | | 00cf6262d55cc36e76481502309699293a05e6ec Fixes PARDISO for saddle problems. Changes access permissions of HPDDM examples. Downloads the latest HPDDM archive. | | | | | * | | 14ac4d2e74a6b00d6496ddd44eb0362545e44087 put new stuff of in hpddm for Stokes Problem | | | | | * | | 0413e82cc534a94c325766885c80c32a33a32842 3D Stokes examples | | | | | * | | 98494e3cbb7a040eecc6fa57576e4fbd670f8ce3 Stokes examples | | | | | * | | f0f596961561d02d2dfe6087795d12875eae6e85 put new 3d convect a the new defautl. | | | | | * | | b7f9848b935425172f8e0272796537a0937d287d correct pb in ClosePoint when the set on point is one point | | | | | * | | b668c86f067024424405e0accb3bf929981ce2b4 try of correct pb in search point method in 3s | | | | | * | | 8fcbc168256a62cd1e3024042c006efd6bdee923 coorect in interpolation operator | | | | | * | | 98001e9eddda3d7601b2cba7e507a76907fece47 try new 3d convect schema .. | | | | | * | | b1d4908445a11cc45644262be6231efb2b176922 correct type in example | | | | | * | | 99a7637edd9ac9a9cfd5b72dde1e18f5c8c8f224 add missing examples | | | | | * | | 33bbfa8ae499ba438034e9e372069b7c8b78c353 add missing file | | | | | * | | bd5626838d8cd2e51316b5a177539c4f6034120d correct examples++-hpddm/PETSc.cpp in case of developper petsc | | | | | * | | b574962dc55d17e978e96d9e3070c33abb8c6e5d add missing file | | | | | * | | f99d130a5457e3ed602b285319d71aa3c665095f coorect dowload mekae file to force try to downlood of hpddm | | | | | * | | b6025f5065ce48f7766b3e8eacc5589dec687565 coorect install de hpddm | | | | | * | | b0a0e8a983d6c12509f5d139924f50a7691c04c0 correct of ff-get-dep.awk missing blank lib (coorect) and clean Curvature.cpp | | | | | * | | 2f08e2ef20b5846bf9461b44e9f5d8ecde07e1ec correct closepoint add cast transpose to KNM_ | | | | | * | | 8af6a0a57c6b90c460187c92da3b439738d8880a update AutoGeneratedFile.tar.gz | | | | | * | | a0da17d5312add96f4e78c88b57ec131bcdd0d48 restructure examples++-hpddm thank to P. Jolivet | | | | | * | | d9ad26384af9513f4d9bcce5501105785cef8c16 - remove some spurious print when verbosity = 0 - add initialisation of array which string parameter like in string[string] b= ["-1",1,"13","qsdqdq"]; int[string] a=["2",1,"12",4]; - add setw iomap stuff like in: cout << setw(10) << 1 << " " << 3; | | | | | * | | 8d8a740c95cc72e4b50641a3f0f1dad2cf3f17a0 correct PETSc.hpp for version 3.6.3 of petsc | | | | | * | | 75cd10ec154dbccb40f9ce0d2e19502e9bbdfd55 correct find auto lib wiht where | | | | | * | | e810b126412f03bab5f311df8f39a6376f3cb31f correct configure | | | | | * | | fb9072c8dcca64fce497970f3cc9e409dca4581d try to bluid a version without the compilation soft in petsc | | | | | * | | 6d488695955a6caa612ba96aaf5e7ea05d093f2d add missing file in include-hppdm | | | | | * | | 34f743056d71e85b23f7b18e567eaf2b91f7f5e4 add missing file + cosmetics | | | | | * | | 6b6ea2e66deecd82c3f1465a5588008f2b47bacb correct INNOVATION | | | | | * | | 11e134135c399f374946cf200598a9e8fab1703e update hpddm to git checkout d2a99d89ee37777d2423da218b29e2080950da1e | | | | | * | | 72703228e2a91bb81dbb0efd2ad13c19a65ea502 pass to version 3.43-1 | | | | | * | | 2e35a9f9dc61348d3aa75fbd08b65e736b38fa63 coorect typo | | | | | * | | 0a91f5800f981e2f826d0aaaa2f7c3acfd295711 coorect typo | | | | | * | | 92c29eb6342f99d03c94115c57d520b827c74208 - change RT03d finite element interpolation (put 1 point integration by face) - add renum=false in all trunc fonction of DDM examples - warning change the defaut no renumbering to be sure trunc commute the two mesh must be the same truc(trunc(Th,I),J) == truc(trunc(Th,J),I) | | | | | * | | bdbed84d7957f5257eeb182a342d3d97859bc36b update innovation | | | | | * | | 625d80da125e990cfde4c77d67b50a9ee4767840 coorect olso tranc 3d to by compatible of trunc 2d an keep vertex numbering order for DDM methode. | | | | | * | | b415fc843cd4a410d320bc37ee3c4508273db89c change ordering of buld vertices in 2d trunc function such the injection corresponding to the restriction have only 0 and 1 terms. | | | | | * | | 1d201e05563ca4373bcb8efe58c467fec082bd26 correct formal trace operator | | | | | * | | 9ca05f2e24e1467db3dc14579251b96f253f09e6 correct PB of build freefem++.pref in hppdm example | | | | | * | | 1ab9e51631c4f2f817221c4f9c8521120b1b9198 add remark in INNOVATION | | | | | * | | 0b8a56beea15c37b01903ab407baf7e7dbfa0f5b put hppdm include source in distibution | | | | | * | | b99c84e1273c4c4b58b3b336e1776312f9c1584d add tools to get zero if matrix even if the term donot exist. aii=a[i,j] correct ClosePoints.cpp | | | | | * | | e8f396aa3a890b37e6d6119bd09213f7690bb055 Correct formulation Stokes axisymetric formulation. | | | | | * | | 4d0892b7d41a97b910cd0d8c7520d8852d6b816c add missing file | | | | | * | | 110cd51bafccd3a82c483c3b3be7d0def8600994 - update a little the documentation (add new finite element) - add new finite elemnt just for interpolate partition of unity in DDM / HPDDM method Edge23ds0, Edge13ds0,Edge03d in plugin Element_Mixte3d - add new finite element P1bl, P1bl3d in plugin Element_P1bl - add new finite element Edge23d, P1bl,in plugin Element_Mixte3d - change EPSD in eigenv because touble in some very rare case (see G. Vergez) - correct problem for vectoral solution on implicity declaration of product of simple EF like P1b - add tools to compute curvature of border in Cuvature plugin | | | | | * | | 1053cc8ec73176f87b8cf6f4429006490f039ced correct bug in complex solve / probleme finite element add tools to compute cuvature of border add tools to find closepoint in set of point | | | | | * | | 6ca7910153995c8a551ca7e767e57f17829b9414 correct type | | | | | * | | dddf99e0ad5785f5d15a6cb4dff29de2f21fa52d rebuild AutoGeneratedFile.tar.gz missing example | | | | | * | | d5801b2ea4c6b148ffb62c467a3ddc505093419a - add new kind of loop in freefem see INNOVATION file - correct some // test case - pass to version 3.43 | | | | | * | | 6e807f5248359a35a17d73b3de39b51e1887064c try add add new kind of loop in progress FH | | | | | * | | e7189bfa36b5c80f8c0119ec27a301ca49e65583 correct pb A'*x , missing conj in complex case add A'*x if A is complex[int,int] | | | | | * | | 731688656790e1f90e4f99b9d946df9081915bd4 correct bug in add +mpi in seach plugin path correct bug in install process under linux. | | | | | * | | beb7e2fd25e55e83dae69e23e7a59ff45fd52861 coorect order of makefile.am of examples++* sub directory | | | | | * | | c9d05797bcdc05494ccb9a5a0c9535c0d80d5a1a carrect order of check file | | | | | * | | 62635620a929ab8285c922c489ba84cce411a204 add new Finet element P1bl (linear bulle) | | | | | * | | d88d92a8179fd0c36c3836bcb99d439cb9304d00 merge modif of Peirre | | | | | |\ \ \ | | | | | | * | | a1d2159045f26d260ce70149f25cca55f61a4a75 rebuild AutoGeneratedFile.tar.gz | | | | | | * | | 666440e8ea867adbf91843ac393e30aa28e90c29 correct new configure check | | | | | | * | | b2edbbe37c9999cb126a1b63d2e160673db67526 coorect new check | | | | | | * | | e25c6b9e842a7dd9b7c7b20cbf24fae398386cb3 add chech of timestramp of configure , Makefiel | | | | | | * | | 7c4b70d40cd513cfe26a47a6ab4c52081501daa4 add case for g++-5 | | | | | | * | | 2a80553d940a39e758aa2ddcb1e47e7d73800492 rebuild AutoGeneratedFile.tar.gz | | | | | | * | | 132e60432aa2beb87cb6ac19422d67ab1d533436 change /Stokes-v1-matrix-mumps.edp | | | | | | * | | 8248795c81e69671a433ca807a8b9927b5777045 add missing file | | | | | | * | | db04a3d8416f482b9b3c70f0586244b3c178d115 add missing file | | | | | | * | | 394a7c208390a3d466f55beae16dd9bcd4c88646 coorect INNOVATION | | | | | | * | | ee21317624607835cb50c799a6d2f65e6b91e563 Change configure to use petsc lib rather to download and recompile. | | | | | | * | | 756ff156612e62533696ddf8da18518dad416c6d correct pb. in config.param | | | | | | * | | eb72071cd77ef27529d23e85d4d3d1183670002d correct bug in caractistique et optimisation if same caracteristique | | | | | | * | | 801da47c13d44c16cbb62fb64357084cf9eaf24b try do debut convect in windows | | | | | | * | | 50f4f72d66f0ea8ebae977626d55d0deab67f166 last coorection of remove_pointer | | | | | | * | | cc2255dc2dc2df7bc73a6f6ea055ba332d2a69fd add my code for remove_pointer | | | | | | * | | 950b38a761bf402d2c1f0c3fd273901f128a0260 add type_traits include | | | | | | * | | bc9f2e995f3fbc1ddcbcd9ca617e21371f9f916d correct wrong modif in HCT Finite Element | | | | | | * | | 719b1487b30249c0a5ca299d505b5f37cf6d2a44 correct problem in bilaplacion with HCT finite element add tripleQF to build a quadrature formuate for basis quadratur formula. | | | | | | * | | 4b56e4ea6f8b193cd2bd834636b5c713867fb9c4 rebuild AutoGeneratedFile.tar.gz | | | | | | / / | | | | | * | | 128b84252e849b6d7bccf1df739dff7450d2a4e9 permuting right-hand side and solution in HPDDM plugin | | | | | / / | | | | * | | 2b647aaea859cf8cb84f62ffe799f6a1d105fde0 No need for PETSc when building HPDDM plugin. No need for Scalapack when building HPDDM plugin without MUMPS. Remove deprecated PETSc examples (please check examples++-hpddm now). | | | | / / | | | * | | 4d7ac3c15c7b46bf5ad63201a9d4352120c204a9 Remove spurious output. | | | / / | | * | | b3970ec4952befa2565d6c3920d8018386fe8dca add gluemesh and b=R*a; where a, b is complex and R real matrix. | | * | | c7b7ab31c31c12115388c89b2f7f000e02c34ec8 update FreeFem++.app.tgz | | / / | * | | a5b60405f03fdc6a6162ed13c62d7e1e469c7933 Updates hpddm package and examples. | / / * | | 6d7c22f9514dd792c177fd7a5e1ce862afe0951a Multiple fixes. * | | d2f1f3740d6bea66fb466642180050e9e0eca9a1 SymmetrizeCSR for complex matrices. * | | 38b722ca856fcdfabf7e1f1d99fb8c3ada4a6b6f Exposes a new routine from HPDDM. / / | * edf49bf3000c16fe89a2cdc8e849df18ae8bd21d Installation procedure for Ubuntu 16.04 | * 6c47888e0f9b1088f1b4618b87b279996e44752e (origin/alh-autoconf) close branch incompreansible, plus utiliser | * 5418de8c4bfabd8c1e8e77a5897c9faefff788d8 Compilation ok sur Hydre. Codes de retour d'erreur mieux propag?s dans FreeFem++. | * 07548be631aaa3d2d00fa3a446d2b12a50a0643f Compilation ok sur idared | * 6a634d4e00eca02c0904d3225845a66937e1114d Les biblioth?ques BLAS, ARPACK et UMFPACK sont automatiquement t?l?charg?es et compil?es si configure.ac ne trouve aucune version locale. Test? sur Debian/unstable. | * 1b0aacdae59989bd7483b48c538b7bc42e7f122f Configuration des telechargements en cours | * 45f9d1edfce24c69b89e8fe9bd6e593d442cbc8c Configuration des telechargements en cours | * 4ed265735269fc2b85d5dda8b0dc43636549759a Ajout des libs Blas, Arpack et Umfpack en cours sous Windows | * a78d37261ecabee5367d0177100bba41f52e5f6a Premiere installation Windows | * 4317b9f3ff93ab9a64e1903b8e8a02b72a089176 Le rpertoir src/std contient maintenant non plus une version x11 mais la version par d?faut pour l'architecture (par exemple win32) | * a8670b6744cc5513b4fd213661178a11d655b123 Toute premi?re version de FreeFem++ compilable sur Windows avec Cygwin, Mingw, Automake et Autoconf. La version Windows est stock?e pour l'instant dans le r?pertoire src/pc mais sera d?plac?e dans src/std. | * 2b5324c2fd4464af22958ffe4376f34a8b40ec22 Clarification de quelques commentaires. | * baaf9b30e4ddfbf102efc25afbc60ec444280ac5 Trois options de configuration manuelle ajout?es: --with-arpack=fichier.a --with-amd=fichier.a --with-arpack=fichier.a Options test?es sur macserv2 | * e9e364645f1ac7e96cc8176fcfaa8fb2e6cb46eb - Modification de la proc?dure de test pour ex?cuter les scripts all.edp - Mise au point de la proc?dure de cr?ation d'archive .tar.gz avec "make dist" | * 154bee5101b2bc4216c791423f0d5871445a8cf2 Automake ok pour X11 sur MacOS X. | * 55aa206bd46326d17f885711fdf4a65a5d0c4b68 Ajoute l'extension "-g" ? la version debug des programmes en vue de la configuration de l'installation. | * 45d7b6939c0b5368eb00632a8e61b2e7c0b67a9a Automake ok sur Debian/Testing. | * effde43017255532ef1b79552cd527ae5f2c8cb6 Test de la configuration Automake sur macserv2+X11: compilation ok. | * 1127c74795a5b5d6dec63deba6b95b811afb9cfc D?but de configuration de FreeFem++ sur Windows/Cygwin. Pour l'instant le programme ne compile pas car Cygwin/g++ 3.3.1 plante sur lg.tab.cpp (segmentation fault). | * e86e4c0423295a6452fc382c1ade66a9ab78c950 Int?gration de la biblioth?que Umfpack dans la configuration et am?lioration du test de Arpack. Test? sur Debian Unstable. | * d6054cec5f9ef2231c763470aa8b95760df801ba Ajoute src/Eigen/eigenvalue.cpp dans la biblioth?que src/fflib/libff.a | * d2c7d49b2abefddb5b4b7f364138c370f71ec704 Premi?re version de la proc?dure de test de non-regression. Il reste des questions sur l'emploi de "NoUseOfWait=true;" et sur les valeurs ? contr?ler. | * 88b3426350476b4d4cf42ea21746ec817a345e5e Am?lioration de la gestion des num?ros de version. | * 7b811186df8c415407219a4833127a76dee7558c Automake configur? sur macserv2 | * 8883422aab641ad9a0c05a8b96b87e3b536e65f4 Configuration de la compilation sur MacOSX toujours en cours. | * e8bec961f23e1099eebe4cbb21b086a26c43a3eb Configuration de la proc?dure de compilation sur MacOSX en cours. | * 34d0af5dd45783265178fdc275ced6a28fa55ee1 Compilation ok sur Debian/Testing et Debian/Unstable | * 4b4731263225c182389e33ee402ffd9aa8c5a557 Modification de l'arborescence des r?pertoires dans src/ afin de placer chaque version de FreeFem++ dans un r?pertoire diff?rent, ce qui simplifie les Makefile.am | * b02ca8e4106f95499898fafca6441e70c6ddaba4 Transformation de la compilation de programmes multiples (-g, -nw, -x11, ...) en fonction des conventions de Automake. | * 41080b34a7292183f371296a05d91f4c879970eb Int?gration de Arpack et Umfpack en cours sur plusieurs architectures | * 2a443415e033fa1e511f1b4fce01067e589422da *** empty log message *** | * c09b421f73e4fe1f4d644415a84275d59b90458f Test de la pr?sence de mpiCC ajout? (s'il est absent, la version parall?le de FreeFem++ n'est pas compil?e) | * e43a9baa00970547df86e6c59c0b18b126b330c4 Extension de la recherche de la biblioth?que BLAS. | * 1d75a2b1724bcade7ea15ac115ce13757888bce5 Quelques nouveaux fichiers install?s par la proc?dure standard Autoreconf -i. | * 8b915aad21386c876de3d1392b556e3b02b65fa9 La proc?dure Automake + Autoconf a ?t? test?e sur Hydre (Debian Testing). | * 32ea9f75435923574c414b704a6d0dac4054cf32 Essai de configuration de autoconf en cours. | * 343e5a5baf8252832b24143df5d931916a17bd7d Int?gration de Autoconf et Automake dans la proc?dure de build en cours. |/ | * 3015b309ca43608f03641e3dd66cd98bbbcc7aa6 (origin/graphical-user-interface-branch) close branch incompreansible, plus utiliser | * 55c3b3fa44aed22a1458fd95029c657ba4f1aa14 (tag: merged_from_gui_branch_to_trunk) The zoom facility is operational. | * c263194404de4742718d728eb978547a021f4c33 IDE client currently being debugged. IDE server not connected yet. | * 06d1d11b66143b536ef9cc93d73ffc077a991b3e Client/server IDE compiles, but the server process does not run yet. | * db933465f3479a2284251e09369f6564b8fc96bf client/server framework done. But the program is still far from compiling. | * e4354816e4b136053629a7904188e15c2babaf12 Client/server version of FreeFEM++ IDE currently being implemented. | * 4510edc1a1215d2eba266fb959ae4c4b09f304f3 Reverts object "Global" back to static storage temporarily, while Frederic is recoding it to split the initialisation step and the execution step. | * a044b997a8255b648430d991afa83400482442af The IDE is programmed and compiled, but not running yet. | * ee06b875e53900075f26c899df5c1cb4a06f2639 First model of an Integrated Development Environment for FreeFem++. The main window layout is already in place. |/ * 24ceda5e8a5e8c08f081eaf777488bf7926125ed (tag: FREEFEM_1_38) Initial revision freefem++-3.61-1/test-driver000755 000767 000024 00000011040 13256704232 015776 0ustar00hechtstaff000000 000000 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 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, see . # 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 or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: freefem++-3.61-1/reconfigure000755 000767 000024 00000001153 13312446271 016041 0ustar00hechtstaff000000 000000 #!/bin/sh if [ -f ./config.param ]; then test -s ./config.path && eval export PATH="'`cat ./config.path`:$PATH'" ## remove dup export PATH=`echo $PATH|awk -F: ' {p=""; for(i=1; i<= NF; i++) { ok =0; for(j=1; j struct SameType, type of OK must be int and not bool 2001/11/24 add fonctionality in plot, bb=[[x1,y1],[x2,y2]] add loop if enter character +,-,=,c,C,r in graphic window. 2001/11/28 correction bug initialization of QuadTree if less than 4 points in the quadtree files QuadTree.cpp and FQuadTree.hpp add exec("xxx..."); //to execute on system command. "xxx ... " add dumptable(cout); //to show all internal table 2001/11/29: Version ans graphique + ajout d'option dans plot (cf. doc) correction ajoute renum() des maillage crees. 2001/12/10 Correct missing check in plot ex: plot(1); trap before now, genere a compile error Correct in the interpolation is full not conforme FE, do not prolonged by continuity. change add after line 479 in file lgfem.cpp if (outside && !KK.tfe->NbDfOnVertex && !KK.tfe->NbDfOnEdge) return SetAny(0.0); 2001/12/12 correction in gibbs (mesh renum) reconstruct the array of triangle for each vertex (PB. of interpolation in non convexe domain) Big bug. Make version 1.14 ----------------- 2001/12/14 correction in trunc mesh, bug if empty mesh is created, and move a little the test point in a triangle is not exactly the barycenter. 2002/01/14 correction in probem.cpp line 1309 bug when we write qft= ... , in int2d if (nargs[0]) return *GetAny((*nargs[1])... becomes: if (nargs[0]) return *GetAny((*nargs[0])... 2002/01/15 in lgfem.cpp remove line 522 reffecran();//bug if not graphique some time in file MeshGeom.cpp line 108 bug if name == 0 ; add test before the cout like if(name) cout << " ... " << name << .... correct the name of the exec file (FreeFee++ -> FreeFem++) in Makefile 2002/02/03 in Mesh2.cpp in preinit() add call to srand(), to get the same mesh with the same data. correct mesh tth=th; Make version 1.15 ----------------- 2002/02/20 Add periodic boundary condition see the manual //\index{periodic} Make version 1.16 ----------------- Add Parallele Mpi correct bug in SegmentationFault.edp missing placing of delete[] operator put declaration in for wait =xx change the default value of wait ofstream f("foo.txt",append) open a file in append mode add NoUseOfWait=true; never wait for run test easly\index{NoUseOfWait} Make version 1.17 2002/03/20 ---------------------------- Make default iso value changing with zoom option. Add GMRES solver dimKrylov= , tgv= //\index{GMRES}\index{problem!dimKrylov=}\index{solve!tgv=}\index{problem!tgv=} april 2002 Make the current version without CheckPtr, and correct some bug in string allocation (forgetting +1 in some length) Improving the speed of the software add CPUTime global bool variable to print the CPU time of each instruction. correct some printing without verbosity adding some checking in array management Add option in the Makefile (gnumake) Make version 1.18 the 2002/04/08 -------------------------------- Big correction in automatic cast see bugv1.18.edp correction in interpolation of label see also bugv1.18.edp Big correction in construction of non-symetrix matrix (see BUG) Make version 1.19 2002/04/18 ---------------------------- Correction in Quadtree integer overflow when interpolate solution of from one big domain to a very small one. Correction in embedded function (return problem) Correction in return type of function (right value an note left value) Correction cast bool to int, so lots of bug in expression like (region==2)*5 given alway 0, invisibl before 1.18 (because bug in automatics cast) Make version 1.20 2002/04/25 ---------------------------- Correction of bug in interpolation on non convexe domain. correction of bug in periodic boundary condition (pb of sens(in french)) correction some compilation bug under g++ v3.0 in RNM file correction find common point buildmesh (change threshold value) Make version 1.21 2002/04/29 ---------------------------- Add Non linear Conjugued Gradient (CGNL) routine. correct bug in linearGC with non zero right and size. Make version 1.22 2002/05/02 ---------------------------- all optimisation tool from //\url{http://coool.mines.edu/} Add BFGS optimisation tools form cool //\index{BFGS} correct bug in CGNL, correct tgv=, in linear form //\index{CGNL} make algo.edp example Make version 1.23 2002/05/13 ---------------------------- correct bug of the symetric matrix are independ of x,y,.. add line at 285, in file problem.cpp: MeshPointStack(stack)->set(T(pi),pi,Ku); correct bug in sign of int1d in linearform, so change in exemple fluidstructure, schwarz-no-overlap, LaplaceP1, aalapacien, lapacienprecon correct some bug in -= operator with result of *. */ add some operator: -square(u) = u^2 //\index{square} -intalledges(Th)(...) to compute integrale on all edges of all triangle //\index{intalledges} for error indicator add global : -lenEdge the len of the current edge //\index{lenEdge} -hTriangle the size of the current triangle //\index{hTriangle} -area the area of the current triangle //\index{area} Make version 1.24 ----------------- add in BamgFreeFem.cpp after line 211 to set name Tn->name= new char[strlen("msh2bamg")+1]; strcpy(Tn->name,"msh2bamg"); add - of linearform and bilinearform see LaplaceP1bis.edp correct: July 8, 2002 Vh u1,u2,v1,v2; bug in problem(u1,u2,v1,v2,.... ) = in file: FESSpace.hpp line 193: { throwassert(dim_which_sub_fem[N-1]>=0 && dim_which_sub_fem[N-1]< nb_sub_fem); for(int i=0,n0=0,l=0,i0=0; i delete [] (example testFE.edp) 26 septembre 2002 add New Finite element RTortho (a conforme //\index{RTortho} FE in $H(curl)$ like RT conforme FE in $H(div)$. see exemple aaRT.epd correct the computation of dx(v) and dy(u) in [u,v] RT finite element function. compile on hpux 11 with gcc 3.2 see Makefile-hp9000s700 correct argument passing in GMRES routine Make version 1.26 le 26 septembre 2002 -------------------------------------- 05 nov. 2002 Correct very small mistake in bamglib part. 19 nov 2002: add: -tanh function //\index{tanh} -qf2pT4P1 a triangular QuadratureFormular (4P1 the qf2pT QuadratureFormular) //\index{qf2pT4P1} small change une meshadapt to just compute the metrix see exemple convectapt.edp make interpolation matrix between to FEspace (not wet finish) 3/12/2002 make correction to get a not to bad linenumber in error. add add test is used of unset x,y to make a error. add checkmovemesh(Th,[x+u,y+v]) function to return the //\index{checkmovemesh} value of the area of the minimal triangle of the movemesh. see mesh.edp example. 23/12/2002: add eigen value solver //\index{eigenvalue} see eigen README_ARPACK to compile see examples++-eigen to test. Make version 1.28 2/1/2003 --------------------- 09/1/2003: add sub array option in array: //\index{array!sub} real[int] tab(100); tab(:) = array from 0 to 99=tab.n-1 tab(2:10) sub array from 2 to 10 tab(2:10:2) sub array from 2 to 10 by step 2 tab(2:10:2)[0] = 5 ; => modificaton of tab[2] = 5; tab(2:10:2)[1] = 6 ; => modificaton of tab[2+2] = 6; 16/01/2003 add macro generation like cpp preprosseur://\index{macro} this is usefull to make automatic diff exemple: real cc=2; macro f(u) (cc*(exp(u)-1)) // macro df(f) (cc*(exp(f))) // real u=1; cout << (cc*(exp(u)-1)) << endl; cout << f(u) << endl; cout << df(f(u)) << endl; see macro.edp for more detail: 22/01/2003 in file lex.cpp add .c_str() for compilation problem on g++ 2.95 15/04/2003 add new finite element: P1b P1 + Bubble //\index{P1b} P1dc P1 discontinious //\index{P1dc} P2dc P2 discontinious //\index{P2dc} correct bug periodic BC with vectorial FESpace, add the code. Make version 1.31 ----------------- 23/04/2003 small correction to compile with g++ 2.95.2 in eigen value tools 26/04/2003 add function triangulate(filename) to build the //\index{triangulate} Delaunay Triangulation of a set of points in R^2. to build a function form a set of : x y f(x,y) see exemple mesh.edp make version 1.32 (29/04/2003) ----------------- -add optimization in automatique interpolation CPU of all tutoral exemples 172 s( mon my Mac) new version 1.33 (with graphics) CPU of all tutoral exemples 167 s( mon my Mac) new version 1.33 (without graphics) CPU of all tutoral exemples 169 s( mon my Mac) new version 1.32 (without graphics) bofbof. -correct bug in macro generation, a macro existe just in a block {..}. // lex.cpp if ( ret =='{') { /*cout << " listMacroDef->push_back"<< endl; */ listMacroDef->push_back( MapMacroDef() );} else if (ret == '}') {/*cout << " listMacroDef->pop_back"<< endl; */ listMacroDef->pop_back( );} -small correction to be compatible with g++ version 3.3 Make version 1.33 01/07/2003 ----------------------------- - small correction in parallelempi.cpp add a ; line 159 - comment line 519 in file AFunction.hpp (pb with g++ 3.3.1) // operator Expression() const {return f;} (double definition)see line 527 operator const E_F0 * () const {return f;} - correct Makefile for mpi version 21/08/2003: - Bug in optmization in case on non constant robin boundary condition correct - add grey=1 ion plot command to make grey plot, and //\index{grey=}\index{plot!grey=} correct small mistake ( on mac and X11 , ...) Make version 1.34 (22/08/2003) ------------------------------ 16/09/2003 - bug in local variable stack if the size is larger the 8 ( complex) complex a;real b; a=0;b=1; // here a is 0+i; correction is: voila la correction dans AFunction.hpp vers la ligne 1486: template inline Type_Expr NewVariable(aType t,size_t &off) { size_t o= align8(off);// align // off += t->un\_ptr\_type->size; // bug off += t->size; off += t->un_ptr_type->size; // correction return Type_Expr(t,new T(o,t)); } 02/11/2003 -correct probleme of renumbering the traingles of a mesh when reading in the bamg software (with readmesh command). This implies error when we restore mesh and non P1 finite element solution, see example saveandrestore.edp. 28/11/2003 -correction of bug in window version add the umfpack sparce linear solver (this solver have some problem in some case), so I do'nt put this one in default linearsolver. remark, I think is due to the way of taking Dirichlet boundary condition Huge value on diagonal (tgv=1e30) and Stokes matrice.//\index{problem!tgv=}\index{solve!tgv=} -put this file on the web -put on the web -the codewarroir projet to build arpack ands umfpack lib. Make version 1.36 ------------------- - Change the graphic window in Window xx version 8/12/2003 - repare in mpi version get mesh via mpi - forget build quadtree soo the interpolation bugs - add 4 line in file parallelempi.cpp in mesh serialization (recivied // add 3 line FH 08/12/2003 forget build quadtree sorry Fem2D::R2 Pn,Px; a->BoundingBox(Pn,Px); a->quadtree=new FQuadTree(m,Pn,Px,m->nv); 18/12/2003 - add in mpi version://\index{broadcast} broadcast(processor(1),th); // broadcast th from proc 1 to all other. see the mpi exemple change the precision to 6 to 12 is savemesh. - add tool to change the default precision on ostream or ofstream with the C++ syntaxe see saverestore.edp example. cout.precision(12); //\index{precision} - add UMFPACK linear solver ( not well test) //\index{UMFPACK} http://www.cise.ufl.edu/research/sparse/umfpack - add full matrix with few operator //\index{matrix!full} real [int,int] A(10,10); A= 2; A(5,5) = 2; cout << A << endl; -add array of mesh //\index{array!mesh} 08/01/2004 - merge all mesh example in one file call mesh.edp - add discontinuous Galerkin method (see LapDG2.edp example) - add syntaxe to get mesh information (see end of mesh.edp exemple) - add meshsplit function to make conformal recusive locat mesh spliting //\index{meshsplit} (see mesh.edp example) - add dynamic load via dlopen see load.edp in example++-load //\index{dynamic load} Make version 1.37 ----------------- 15/01/2004 - change metrix= in metric= the in adapted mesh metric=[m11,m12,m22]// \index{meshadapt!metric=} (change the ordre to compatible with the fonction order with IsMetric=1) 02/02/2004 - change printing in gmres algorithme - print the size of matrix 06/02/2004 - change intalledges in change of discontinuous Galerkin loop also boundary edge//\index{intalledges} jump(u) is external - internal value of u with normal go to internal to external jump(u) on boundary is -internal value of u //\index{jump} average(u) on boundary is internal value of u //\index{average} - add nTonEdge to get the number of Triangles which see the current edge//\index{nTonEdge} so see the new LapDG2.edp example for full detail 07/02/2004 - correct bug in real[string] map; // map array \index{array!string} change in get_element and operator < of String - add int array Make Version 1.38 ---------------- - remove (void) line 14 of throwassert.hpp file (erreur compile g++3.3.5 ) make change in macro expansion of shell (no perfect to day) 16/04/2004 - add matrix tools bluid interpolation interpolation matric from a FEspace VH to an other FEspace Vh matrix Ih=matrix B= interplotematrix(VH,Vh); // where Vh correspond to line and Vh to column the named parameters can be t= true or false (to bluid the transpose or not matrix) op=0 ,1 or 2 (to build the interpolation of value, dx,dy ) inside=true or false (to remove or not all ouside interpolation quadrature point) build diagonal sparce matrix (type is morse) do the matrice product of to sparce matrix (type is morse) add build a sparce matrix from a full matrix so if you have install UMFPACK solver it is possible to solve systeme with full matrix. add set function to change the solver see exemple sparce-matrix.edp - correct bug flag ouside of mesh add line in file fem.cpp line 864 outside=true; so some time the P0 interpolatation is no zero add new king of mesh of multiplicator data : mesh emptyTh=emptymesh(Th); // to build a mesh with no internal point see mesh.edp example Make Version 1.40 ----------------- - add les linear combination of sparce matrice - set a sparce solver to a sparce matrice (to day just UMFPACK) - transforme a full matrix in sparce matrix - add istream f("toto"); f.good() or f.EOF to test state the file remark: the state is set after the read so the previous value is wrong 02/06/2004 ---------- - correction in call macro with string "..." parameter 24/06/2004 ---------- add tools to bluid periodic adapmesh see sphere.edp of exemple add HaveUMFPACK global variable see sparse-matrix.edp exemple Change all the structure of the software Use ./configure to build all the make file see (README) you can build the Window version with g++ under cygwin ( http: cygwin.... ) Make Version 1.41 ----------------- 07/07/2004 ---------- an anonymous CVS server is avialable to get FreeFem++ source cvs -d :pserver:anonymous@idared.ann.jussieu.fr:/Users/pubcvs/cvs login (password = freefem++) cvs -d :pserver:anonymous@idared.ann.jussieu.fr:/Users/pubcvs/cvs freefem++ co the TAG release_1_41_before_packaging is created 30/08/04 -------- Correct divide by 0 in plot instruction when the bounding box is flat. Set default solver to LU because UMFPACK sometime by bad result. Correct all g++-3.4 error Optimize Choleski and Crout solver (divide cpu time by two on pentium) Add stuff for adding new finite element due to the new software achitecture. 31/08/04 -------- Add string[string] array correct bug in macro expansion macro parameter will be not expanded example of bug: macro a(i) i // macro b a(x) // bug here b = 1 ; // we get "i=1" or we want "x =1" Make Version 1.42 ----------------- 11/10/04 -------- Add Finite element with complex value, and matrix see sparse-cmatrix.edp and FEComplex.edp files for a full examples Vh ur; varf av(u,v)=int(Th)(u*v*(1i+1)); Matrix A = vav(Vh,Vh); // warning don't mixte Matrix and Matrix in a expression 19/10/04 -------- correct UMFPACK driver problem, ands set this solver as a default solver. add finite element connectivite inquire ice FE.epd exemple fespace Wh(Th,P2); Wh.nt // given the number of element Wh.ndof // given the number of degree of freedom Wh.ndofK // given the number of degree of freedom on one element Wh(k,i) // given the number of i degree of freedom of element k. // with $0 <= i < Wh.ndofK $ and $0 <= k < Wh.nt $ } build the source and compile version 1.43 01/11/04 -------- correct problem on period adapted mesh if orientation are reverse. add cvs tag release_1_43 Now the current version is 1.44 (CVS) 04/11/004 --------- correct problem in LinearGMRES and LinearGC in LinearCG algorithme for solving A*x = b0+b the matrix function can compute A*x or A*x-b0 , and the other part b of the right end side can exist or not. But in LinearGMRES must the function must compute A*x and b0 can't exist. see algo.edp exist for a full example 06/12/2004 __________ change function name interplotematrix to interpolate correct bug introduce in 04/12 change a new graphic FreeFem++-cs: integrated development environment (located in src/ide) see REAME and maunal-full.pdf add new examples++-tutorial mat_interpol.edp # to test interpolate function shur-comp.edp # a shur complement domaine decomposition 11/12/2004 TAG release_1_44 now the current version is 1.45 29/12/2004 add concat operator # in macro generator. 04/01/2005 add new quadrature formular on edge (a,b) :qf1pElump : 1/2(f(a)+f(b))*length(ab) 05/01/2005 correction bug unset FE variable dans le .edp => use a null pointeur (in sol) to set the *X array in problem.cpp (*X)[K(df)]= (*sol[kfe])[SK(kdf)] ; make some time make a seg trap error. 06/01/2005 rewrite the macro generation tool to be more to suppress some bug in argument subtition correct error in line numbering in case of newline in string cosmetic change in output 20/01/2005 count () in macro parameter to handle couple of () in macro parameter. macro sum(a,b) (a+b); sum((1),2) // now works and given (1)+2 sum(atan2(2,1),2) // now works and given atan2(2,1)+2 correct bug in linear combination of sparce matrix: the correction is: change line 1069, in file MatriceCreuse_tpl.hpp mij[make_pair(i,j)] = coef*a[k]; to mij[make_pair(i,j)] += coef*a[k]; Correct a segfault if second derivative of test function exist in problem definition. The Change in problem.cpp: resize : KN buf(Vh.MaximalNbOfDF()*3*Vh.N); to : KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N); 24/01/2005 add named parameter nbtx=.. in buildmesh function to change the default maximal number of vertex in the build mesh. 26/01/2005 correct pb with --disable-pdf in configure.ac correct pdflatex and latex compilation correct FreeFem++.app problem when usind in a shell script FreeFem++-CoCoa correct web site and distrib file freefem++-1.45-2.tar.gz 02/02/2005 correct problem with socket in FLTK in freefem++-cs (not wet finish) ALH add nbvx= named parameter to change the default maximum number vertices in creted mesh in builmesh (see mesh.edp exemple) 10/02/2005 add 2 new quadrature formular qf7pT and qf9pT with respectively 15 and 21 points add P2b a new finite element : P2 + bubble make drag and drop on ide version + copy paste 14/02/2005 create a error when you do uh = .. when uh is a componant of a vectorial fe element function (for exemple fespace Vh(Th,TR), Vh [uh,vh]; uh = 1 (error here ;) because it's impossible to build uh and vh independantly. 17/02/2005 FreeFem++-cs: Communication speed between client and server has been increased ten-fold (ALH) 23/02/2005 add jump and mean of complex function (FH) 23/02/2005 FreeFem++-cs: grammar-driven syntax highlighting works on (examples++-tutorial/...) Laplace.edp, adapt.edp and adaptindicatorP1.edp (ALH) freefem++-3.61-1/acmacros.m4000644 000767 000024 00000001571 13256636774 015661 0ustar00hechtstaff000000 000000 # Checks whether a compiler accepts a given flag # ---------------------------------------------- # $1 = compiler name # $2 = flag # $3 = make macro containing flags for that compiler # $4 = exec is true .. # Note: changes AC_LANG() AC_DEFUN([CHECK_COMPILE_FLAG], [AC_MSG_CHECKING(whether the $1 compiler accepts $2) check_save_flags="$$3" AC_LANG_PUSH($1) $3="$$3 $2" # The program needs to contain something for the test source # file to be created by autoconf. # Some options really need to be linked (not only compiled) to # check whether they work. AC_LINK_IFELSE([ifelse($1,Fortran 77, [ program x end], [AC_LANG_PROGRAM])], check_flag_ok=yes, check_flag_ok=no) AC_MSG_RESULT($check_flag_ok) if test "$check_flag_ok" = no; then $3="$check_save_flags" fi if test -n "$4" ; then $4="$check_flag_ok" fi AC_LANG_POP($1) ]) freefem++-3.61-1/COPYRIGHT000644 000767 000024 00000045071 13256636773 015124 0ustar00hechtstaff000000 000000 This is The FreeFem++ software. Programs in it were maintained by Frederic hecht and by Olivier Pironneau and by Antoine Le Hyaric All its programs which may be redistributed under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Except files : Comming form COOOL sofware (all files in directory src/Algo, mailto:coool@coool.mines.edu), no license. and the file mt19937ar.cpp ( mailto:m-mat@math.sci.hiroshima-u.ac.jp ) with they own like license. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS freefem++-3.61-1/uninstall-ff++000755 000767 000024 00000002100 13256636774 016272 0ustar00hechtstaff000000 000000 echo rm /usr/local/bin/FreeFem++ /usr/local/bin/bamg /usr/local/bin/ff-mpirun echo rm /usr/local/bin/FreeFem++-CoCoa /usr/local/bin/cvmsh2 /usr/local/bin/ff-pkg-download echo rm /usr/local/bin/FreeFem++-mpi /usr/local/bin/ff-c++ /usr/local/bin/ffglut echo rm /usr/local/bin/FreeFem++-nw /usr/local/bin/ff-get-dep /usr/local/bin/ffmedit echo rm -rf /usr/local/share/freefem++ echo rm -rf /usr/local/lib/ff++/ echo rm -rf /usr/local/ff++ echo rm /etc/paths.d/FreeFem++ if [ -d /Applications/FreeFem++.app ]; then echo rm -rf /Applications/FreeFem++.app fi rm /usr/local/bin/FreeFem++ /usr/local/bin/bamg /usr/local/bin/ff-mpirun rm /usr/local/bin/FreeFem++-CoCoa /usr/local/bin/cvmsh2 /usr/local/bin/ff-pkg-download rm /usr/local/bin/FreeFem++-mpi /usr/local/bin/ff-c++ /usr/local/bin/ffglut rm /usr/local/bin/FreeFem++-nw /usr/local/bin/ff-get-dep /usr/local/bin/ffmedit rm -rf /usr/local/ff++ echo rm /etc/paths.d/FreeFem++ rm -rf /usr/local/share/freefem++ rm -rf /usr/local/lib/ff++/ if [ -d /Applications/FreeFem++.app ]; then rm -rf /Applications/FreeFem++.app fi freefem++-3.61-1/examples++-3d/000755 000767 000024 00000000000 13321644114 016047 5ustar00hechtstaff000000 000000 freefem++-3.61-1/build/000755 000767 000024 00000000000 13321644107 014700 5ustar00hechtstaff000000 000000 freefem++-3.61-1/0ldUserReadMe.txt000644 000767 000024 00000003103 13256636773 016754 0ustar00hechtstaff000000 000000 /////////////////////////////// New 3D features of freefem++ /////////////////////////////// Version 3.0 is the first version capable of 3D computations. The price to pay is more difficult mesh generations and difficulties to display the results. More details can be found in the documentation 1. Mesh generation ============== There is an interface with the mesh generator tetgen (http://tetgen.berlios.de/) see: examples++-3d/Poisson3d.edp ( mesh of a sphere) There is a small 3D mesh generator for cylindrical meshes by extrusion of a 2D mesh see example: examples++-3d/Lac.edp for a mesh of a lac examples++-3d/Stokes.edp for a mesh a cube. There is a mesh reader from files in format .mesh of medit (http://www.ann.jussieu.fr/~frey/software.html) see example: examples++-3d/dodecaedre01.mesh 2. Graphics ======== 2D Graphics ------------- The standard graphic windows now use a client/server architecture based on openGL GLUT, so the commands have changed: - to go to the next graphic type "enter key" - to close the graphic window type escape - to find out about other commands type the ? key Warning: you must have "ffglut" in your path; this is done for you by the install program on windows system if you do not uncheck the click box. 3D Graphics ------------- Real 3D graphics can be obtained with medit, built in freefem andit can be launched independently of freefem by the command shell "ffmedit". Freefem can also launch medit by the keywork medit. Two calls to medit will launch two instances of medit. To close these windows use escape.freefem++-3.61-1/mkinstalldirs000755 000767 000024 00000003704 13256636774 016435 0ustar00hechtstaff000000 000000 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here freefem++-3.61-1/examples++-mpi/000755 000767 000024 00000000000 13321644113 016325 5ustar00hechtstaff000000 000000 freefem++-3.61-1/Makefile.in000644 000767 000024 00000126662 13321623166 015665 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile for FreeFem++, adapted to Automake # ------------------------------------------- # Adaptation to Automake: Antoine Le Hyaric - LJLL Paris 6 - # lehyaric@ann.jussieu.fr - 13/5/04 VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README TODO compile \ config.guess config.sub depcomp install-sh missing \ mkinstalldirs ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip GZIP_ENV = --best DIST_TARGETS = dist-gzip dist-zip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ # Linux binary-only package # ------------------------- # Include kernel and libc version in static package name PACKAGE_NAME = FreeFem++v$(VERSION)_linux-$(KERNEL_VERSION)_$(LIBC_VERSION)$(OPTIM_TYPE) PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = download src examples++-load examples++-mpi \ examples++-tutorial examples++ \ examples++-eigen \ examples++-bug examples++-chapt3 examples++-other \ examples++-3d examples++-hpddm EXTRA_DIST = test-driver-ff regtests.sh config-wrapper.h \ FreeFem++.mcp HISTORY HISTORY_BEFORE_2005 BUGS TODO regtests.m4 \ INSTALL INSTALL-MacOSX INNOVATION \ WindowsPackage.m4 README_COMPILATION.md README_ARPACK.md README_WINDOWS.md README_MAC.md \ logo.ico copysharedlibs.sh COPYRIGHT edp.nedit reconfigure \ mode-mi-edp.zip aclocal.m4 acmacros.m4 acoptim.m4 ax_lib_hdf5.m4 \ freefem++.spec \ Install-MacOS.command.in \ examples-bamg/NACA012/naca.awk examples-bamg/quadloop/dotest.pl \ examples-bamg/square/*_g.* examples-bamg/square/do* examples-bamg/NACA012/[adp]* \ examples-bamg/test/dotest*.pl 0ldUserReadMe.txt CheckAllEdp CheckAll \ WHERE_LIBRARY-mkl FreeFem++-CoCoa.in \ uninstall-ff++ \ ./build/cleancrlf ./build/download ./build/links2files \ ./build/orgindex ./build/ff-md5 script/PostInstall.m4 \ web/download.php web/index.php web/macosx.php web/menu.php web/phpfiles.php \ web/ffstyle.css web/linux.php web/main.php web/news.php web/windows.php \ FreeFem++.app.tgz FF_MAC_PREFIX = FreeFem++v$(VERSION)$(ADD_PACKAGE_NAME) FF_EXAMPLES_FILES = COPYRIGHT HISTORY HISTORY_BEFORE_2005 README_COMPILATION.md README_WINDOWS.md README_MAC.md BUGS TODO INSTALL INSTALL-MacOSX INNOVATION \ mode-mi-edp.zip \ examples++-tutorial/aile.msh examples++-tutorial/xyf \ examples++-3d/dodecaedre01.mesh \ examples++-3d/lac-leman-v4.msh \ examples++-load/load.link \ examples++-load/cube.msh \ examples++-load/fig.pgm examples++-load/lg.pgm \ ./examples++-mpi/regtests.sh ./examples++-other/speedtest.sh \ ./download/fftw/Makefile ./download/fftw/Makefile.am \ examples++*/*.[ie]dp CheckAllEdp \ examples++-load/ch.pts examples++-load/g.gmesh LIST_GENERATE_FILE = \ download/umfpack/Makefile.in examples++-tutorial/Makefile.in src/femlib/Makefile.in \ Makefile.in examples++-3d/Makefile.in examples++/Makefile.in src/fflib/Makefile.in \ config.h.in examples++-bug/Makefile.in src/Algo/Makefile.in src/lglib/Makefile.in \ configure examples++-chapt3/Makefile.in src/Graphics/Makefile.in src/libMesh/Makefile.in \ download/Makefile.in examples++-eigen/Makefile.in src/Makefile.in src/medit/Makefile.in \ download/arpack/Makefile.in examples++-load/Makefile.in src/bamg/Makefile.in src/mpi/Makefile.in \ download/blas/Makefile.in examples++-mpi/Makefile.in src/bamglib/Makefile.in src/nw/Makefile.in \ download/fftw/Makefile.in examples++-other/Makefile.in src/bin-win32/Makefile.in examples++-hpddm/Makefile.in LIST_GENERATE_FILE_AM = \ download/umfpack/Makefile.am examples++-tutorial/Makefile.am src/femlib/Makefile.am \ Makefile.am examples++-3d/Makefile.am examples++/Makefile.am src/fflib/Makefile.am \ examples++-bug/Makefile.am src/Algo/Makefile.am src/lglib/Makefile.am \ configure.ac examples++-chapt3/Makefile.am src/Graphics/Makefile.am src/libMesh/Makefile.am \ download/Makefile.am examples++-eigen/Makefile.am src/Makefile.am src/medit/Makefile.am \ download/arpack/Makefile.am examples++-load/Makefile.am src/bamg/Makefile.am src/mpi/Makefile.am \ download/blas/Makefile.am examples++-mpi/Makefile.am src/bamglib/Makefile.am src/nw/Makefile.am \ download/fftw/Makefile.am examples++-other/Makefile.am src/bin-win32/Makefile.am examples++-hpddm/Makefile.am all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(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'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(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 \ && cd "$$am__cwd" \ || exit 1 $(am__post_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: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { 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 config.h 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-local cscope cscopelist-am ctags ctags-am dist dist-all \ dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck 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-exec-local 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 pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Creates a file named "ChangeLog" containing the chronology of all # modifications to the source files. Needs "cvs2cl" to be installed. changelog: cvs2cl # try and avoid running this under fakeroot (otherwise we may face # problems trying to connect to CVS as pseudo-root). Debian packaging # uses fakeroot. history: if test "$$FAKED_MODE" = ""; then\ hg log >HISTORY ;\ fi documentation: rm freefem++doc.pdf $(WGET) https://github.com/FreeFem/FreeFem-doc-pdf/raw/master/freefem%2B%2Bdoc.pdf # cd DOC && $(MAKE) $(AM_MAKEFLAGS) documentation #DOC/freefem++doc.pdf: # cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) clean-local:: -find . \( -name '*~' -or -name ListOfUnAllocPtr.bin \) |xargs rm -rm examples*/*.eps # "dist" targets clean-local:: -rm freefem++-*.tar.gz freefem++-*.zip -rm Output/FreeFem++-*.exe # Reduced compilation # ------------------- quick: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/std && $(MAKE) $(AM_MAKEFLAGS) nw: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/nw && $(MAKE) $(AM_MAKEFLAGS) bamg: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/bamg && $(MAKE) $(AM_MAKEFLAGS) ide: cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS) cd download && $(MAKE) $(AM_MAKEFLAGS) cd src/lglib && $(MAKE) $(AM_MAKEFLAGS) cd src/fflib && $(MAKE) $(AM_MAKEFLAGS) cd src/ide && $(MAKE) $(AM_MAKEFLAGS) FreeFem++-cs$(EXEEXT) # Cleaning generated files which are stored in the CVS repository, to # avoid technical CVS conflicts. clean-gen: ./cleanregen.sh # Testing # ------- # The standard automake goal "make check" is also valid. It just does # not run any test that could prevent the user from working on its # machine (because of unexpected windows opening right in the middle # of the workspace). visualcheck: all $(MAKE) $(AM_MAKEFLAGS) check VISUALCHECK=yes speedtest: all cd examples++-other && $(MAKE) $(AM_MAKEFLAGS) check # Windows package # --------------- # Windows package script (for Inno Setup). We extract version # information from the Debian Changelog to get the package release # number as well. win32:WindowsPackage.iss test ! -d examples++-load/include-tmp || rm -r examples++-load/include-tmp cd examples++-load;tar zxvf include.tar.gz;mkdir include-tmp;cp -Lr *.h include/* include-tmp /c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/ISCC.exe "`cygpath.exe WindowsPackage.iss`" WindowsPackage.iss: WindowsPackage.m4 configure.ac Makefile.am m4 -DVERSION='$(VERSION)$(ADD_PACKAGE_NAME)' \ -DMPIPROG='$(MPIPROG)' -DSIZEOFPTR='$(SIZEOF_PTRINBIT)' \ -DHOSTOS='$(host_os)' WindowsPackage.m4 > WindowsPackage.iss echo loadpath += '"!\."' >freefem++.pref echo includepath += '"!\idp"' >>freefem++.pref # Debian package # -------------- deb: dpkg-buildpackage -rfakeroot @echo Now run CopyToServer.sh in debian subdirectory # Build all versions # ------------------ nativeX: $(FF_MAC_PREFIX)_MacOsX.tgz echo "done" MacOsX: FreeFem++.app.tgz -rm -rf OsXxx mkdir -p OsXxx/Applications/ make install DESTDIR="`pwd`/OsXxx" tar zxvf FreeFem++.app.tgz -C OsXxx/Applications/ cd OsXxx;tar cvfz ../$(FF_MAC_PREFIX)_MacOsX.tgz . rm -rf OsXxx clean-local:: -rm freefem++-$(VERSION).tar.gz -rm -rf FreeFem++v*_MacOS # Native MacOS packaging # ---------------------- install-exec-local:: test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa script/PostInstall.sh $(mkinstalldirs) -m 755 $(DESTDIR)$(pkgdatadir)/$(VERSION) test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/etc/paths.d/ test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/usr/local/bin tar cvf - $(FF_EXAMPLES_FILES)| (cd $(DESTDIR)$(pkgdatadir)/$(VERSION); tar xvf -) $(INSTALL_SCRIPT) CheckAll CheckAllEdp $(DESTDIR)$(pkgdatadir)/$(VERSION) $(mkinstalldirs) -m 755 $(DESTDIR)${bindir} test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)${bindir} test `uname` != Darwin || echo $(bindir) >$(DESTDIR)/etc/paths.d/FreeFem++ test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)/usr/local/bin test `uname` != Darwin || ( $(MAKE) FreeFem++.app.tgz ; test -d $(DESTDIR)/Applications || mkdir $(DESTDIR)/Applications ; tar zxf FreeFem++.app.tgz -C $(DESTDIR)/Applications ) script/PostInstall.sh:./Makefile script/PostInstall.m4 m4 script/PostInstall.m4 "-DFF__FVER=$(PACKAGE_VERSION)" "-DFF_BINDIR=$(bindir)" "-DFF__DATADIR=$(pkgdatadir)" >script/PostInstall.sh chmod a+x script/PostInstall.sh ListFiles-natives: .FORCE test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa echo $(FF_EXAMPLES_FILES) >$@ echo ./download/fftw/Makefile ./download/fftw/Makefile.am >>$@ find . -name '*.[ei]dp' -o -name '*.h*' -o -name '*.cpp' -o -name '*.pgm' |egrep '[.]/examples++' >>$@ find . -name '*.h*' -o -name '*.cpp' |egrep '[.]/examples++' >>$@ List-agl-dylib: src/nw/FreeFem++ otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {print $$1}' >$@ CheckMacLib.sh: src/nw/FreeFem++ echo "for i in `otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@ chmod a+x $@ CheckMPIMacLib.sh: src/mpi/FreeFem++-mpi echo "for i in `otool -L src/mpi/FreeFem++-mpi|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@ chmod a+x $@ .FORCE: $(FF_MAC_PREFIX)_Macos:documentation ListFiles-natives -mkdir $@ cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - ) /Developer/Tools/CpMac "FreeFem++(Carbon)" $@/FreeFem++ cp freefem++-doc.pdf $@ $(FF_MAC_PREFIX)_MacOsX: all documentation ListFiles-natives List-agl-dylib -mkdir $@ cp freefem++doc.pdf $@ cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - ) cd $@ ; tar zxf ../src/agl/FreeFem++.app.tgz sed $@/FreeFem++.app/Contents/Info.plist \ -e "s/@VVERSION@/$(VERSION)$(ADD_PACKAGE_NAME)/g" \ -e "s/@DATE@/`date`/g" cp src/nw/FreeFem++ $@/FreeFem++.app/Contents/bin cp src/nw/ffglut $@/FreeFem++.app/Contents/bin cp src/medit/ffmedit $@/FreeFem++.app/Contents/bin cp examples++-load/ff-get-dep $@/FreeFem++.app/Contents/bin cp examples++-load/ff-pkg-download $@/FreeFem++.app/Contents/bin sed $@/FreeFem++.app/Contents/bin/ff-c++ -e 's;FFAPPLI_INC;$@/FreeFem++.app/Contents/include;' chmod a+x $@/FreeFem++.app/Contents/bin/ff-c++ -mkdir $@/FreeFem++.app/Contents/include -mkdir $@/FreeFem++.app/Contents/idp cp examples++-load/include/* $@/FreeFem++.app/Contents/include cp examples++-load/*.dylib $@/FreeFem++.app/Contents/lib cp examples++-*/*.idp $@/FreeFem++.app/Contents/idp -if [ -s List-agl-dylib ]; then tar zchvf $@/OtherMacOsLib.tgz `cat List-agl-dylib`; fi; ./config.status --file=$@/Install-MacOS.command:Install-MacOS.command.in chmod a+rx $@/Install-MacOS.command -mkdir $@/FreeFem++.app/Contents/etc echo loadpath += \"./\" >$@/FreeFem++.app/Contents/etc/freefem++.pref echo loadpath += \"$(ff_prefix_dir)/lib\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref echo includepath += \"$(ff_prefix_dir)/edp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref echo includepath += \"$(ff_prefix_dir)/idp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref $(FF_MAC_PREFIX)_MacOsX.tgz: $(FF_MAC_PREFIX)_MacOsX tar zcvf $(FF_MAC_PREFIX)_MacOsX.tgz $(FF_MAC_PREFIX)_MacOsX linux-package: $(PACKAGE_NAME).tgz # No direct dependency to "all" to be able to debug the packaging # procedure on its own. $(PACKAGE_NAME): ListFiles-natives cat ListFiles-natives|xargs tar cfh - | (cd $@ ; tar xf - ) -mkdir $@ cp src/std/FreeFem++ $@ ./copysharedlibs.sh src/std/FreeFem++ $@ cp src/nw/FreeFem++-nw $@ ./copysharedlibs.sh src/nw/FreeFem++-nw $@ cp src/ide/FreeFem++-cs $@ ./copysharedlibs.sh src/ide/FreeFem++-cs $@ cp src/ide/FreeFem++-server $@ ./copysharedlibs.sh src/ide/FreeFem++-server $@ cp src/ide/FreeFem++-client $@ ./copysharedlibs.sh src/ide/FreeFem++-client $@ -cp src/glx/FreeFem++-glx $@ -./copysharedlibs.sh src/glx/FreeFem++-glx $@ -cp src/mpi/FreeFem++-mpi $@ -./copysharedlibs.sh src/mpi/FreeFem++-mpi $@ $(PACKAGE_NAME).tgz: $(PACKAGE_NAME) tar cvzf $@ $< clean-local:: -rm -r $(PACKAGE_NAME) $(PACKAGE_NAME).tgz autofiles:AutoGeneratedFile.tar.gz #$(LIST_GENERATE_FILE):$(LIST_GENERATE_FILE_AM) # @echo "WARNING the configure file is older than configure build flies" # @echo "Rebuild configure: do one the three case" # @echo " if you have autoconf # make conf" # @echo " or without # make conf-without-autoconf" # @echo " or by pass this problem # make conf-touch" conf: autoreconf ./config.status --recheck conf-without-autoconf: tar zxvf AutoGeneratedFile.tar.gz ./config.status --recheck conf-touch: touch $(LIST_GENERATE_FILE) AutoGeneratedFile.tar.gz:$(LIST_GENERATE_FILE) configure.ac tar cvfz $@ $(LIST_GENERATE_FILE) FreeFem++-CoCoa:FreeFem++-CoCoa.in ./config.status ./config.status --file="FreeFem++-CoCoa:FreeFem++-CoCoa.in" FreeFem++.app.tgz:./config.status tar zxf FreeFem++.app.tgz ./config.status --file=FreeFem++.scrpt-txt:FreeFem++.scrpt-txt.in -rm FreeFem++.app/Contents/Resources/Scripts/main.scpt osacompile Makefile-for-Checkam echo '@false'| tr '@' '\t' >> Makefile-for-Checkam if $(MAKE) -f Makefile-for-Checkam 2>&1 >/dev/null ; \ then ok=1 ; \ else \ $(MAKE) -f Makefile-for-Checkam ; \ echo "Need to rebuid configure and Makefile files " ;\ echo "Do autoreconf -i or tar zxvf tar zxvf AutoGeneratedFile.tar.gz" ;\ echo " and ./reconfigure" ;\ ok=0; \ fi ; \ test $$ok -eq 1 # 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: freefem++-3.61-1/aclocal.m4000644 000767 000024 00000126516 13321623125 015451 0ustar00hechtstaff000000 000000 # generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. 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'.])]) # Copyright (C) 2002-2014 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.15' 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.15], [], [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 AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 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_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$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 m4_define([_AM_COND_VALUE_$1], [$2])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-2014 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. # 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", "OBJC", "OBJCXX", "UPC", or "GJC". # 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 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" 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". rm -rf conftest.dir 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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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"` # 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'`; 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-2014 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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.65])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], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) 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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [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]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). 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])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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-2014 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 if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 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. # 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])]) # Copyright (C) 1998-2014 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_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2014 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_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .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 # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac 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-2014 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_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 is modern enough. # If it is, 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 if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 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_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], [m4_foreach_w([_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-2014 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_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 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-2014 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_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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 if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done 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]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 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_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 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-2014 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]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 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_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. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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 /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 freefem++-3.61-1/Install-MacOS.command.in000644 000767 000024 00000003055 13256636774 020141 0ustar00hechtstaff000000 000000 #!/bin/sh appl=/Applications cd `dirname $0` echo "Installtion of Freefem++ " if [ -f OtherMacOsLib.tgz ]; then for i in `tar ztf OtherMacOsLib.tgz`; do if [ ! -f "/$i" ]; then echo " the Libary '/$i' don't exist => install (need of admin password)" sudo tar zxvf OtherMacOsLib.tgz -C / $i else echo " the Libary '/$i' exist " fi done # verif .... for i in `tar ztf OtherMacOsLib.tgz`; do if [ ! -f "/$i" ]; then echo " the Libary '/$i' don't exist FreeFEM cannot run (call you adminisator sorry)" echo "Sorry" exit 1; fi done fi echo " copy FreeFem++.app in "$appl" " if [ -d FreeFem++.app ] ; then rsync -avHE --delete FreeFem++.app/ "$appl"/FreeFem++.app fi lbin=`cd "$appl"/FreeFem++.app/Contents/bin/; echo *` echo " install $lbin commands in /usr/local/bin (need of admin password)" sudo mkdir -p /usr/local/bin sudo mkdir -p `dirname @ff_prefix_dir@` sudo ln -s "$appl"/FreeFem++.app/Contents/bin/* /usr/local/bin sudo rm /usr/local/bin/ff-c++ sudo sed <"$appl"/FreeFem++.app/Contents/bin/ff-c++ >/usr/local/bin/ff-c++ \ -e 's;FFAPPLI_INC;$app/FreeFem++.app/Contents/include;' chmod a+rx /usr/local/bin/ff-c++ if [ -d "@ff_prefix_dir@" ] ; then echo Warning "@ff_prefix_dir@" is a dirctory keep this. else sudo rm -f "@ff_prefix_dir@" sudo ln -s "$appl/FreeFem++.app/Contents" "@ff_prefix_dir@" echo link "@ff_prefix_dir@ -> $appl/FreeFem++.app/Contents/ " fi echo "++ FreeFem++ is correctly install in $appl directory." echo " install in /usr/local/bin: $lbin " echo " Thanks for using FreeFem++ v3 "freefem++-3.61-1/README_WINDOWS.md000644 000767 000024 00000005255 13312446271 016303 0ustar00hechtstaff000000 000000 # How to compile FreeFem++ on Microsoft Windows _april 2017_ Visit this [web page](http://www.freefem.org/ff++/windows.php) Bug warning (Windows 64): if you launch FreeFem++ without script by double clicking on the icon, you get an error (it is due to a bug in GetOpenFileName). From version 3.52 onwards, the Windows 64 version is built with MPI support and with the following options ```bash ./configure '--enable-download' '--disable-pastix' '--disable-hips' ``` Then, execute and follow the instructions. ## To test the MPI usage: in windows terminal (cmd, shell, PowerShell) Go to the directory `C:\Program Files (86)\FreeFem++\examples++-mpi` To lauch an example: ```bash mpiexec.exe -np 4 FreeFem++-mpi DDM-Schwarz-Lame-2d.edp -wg ``` or without graphics: ```bash mpiexec.exe -np 4 FreeFem++-mpi DDM-Schwarz-Lame-2d.edp ``` ## To use MPI, you must first install `MSMPI` Download [MS MPI V7](https://www.microsoft.com/en-us/download/details.aspx?id=49926 ), and install both `msmpisdk.msi` and `MSMpiSetup.exe`. Remark: Under msys2 do not forger to do open `c:\msys64\mingw64.ini` in an editor and remove `rem` before `set MSYS2_PATH_TYPE=inherit` freefem++-3.61-1/WindowsPackage.m4000644 000767 000024 00000022644 13312446271 016763 0ustar00hechtstaff000000 000000 ; Creating a FreeFem++ package for Microsoft Windows with Inno Setup ; $Id$ ;; m4 def ;; `DHOSTOS' = HOSTOS ;; `SIZEOFPTR' = SIZEOFPTR ;; ifelse(SIZEOFPTR,64, define(`SUFF64',`-64' ),define(`SUFF64',`' )) ;; define(IFMPI,ifelse(len(MPIPROG),0,; ,)) ;; define(IFMGW32,ifelse(SIZEOFPTR,32,,;)) ;; define(IFMGW64,ifelse(SIZEOFPTR,64,,;)) ;; -- end def m4 ; The Inno Setup configuration file WindowsPackage.iss is built from ; WindowsPackage.m4 with the command "make WindowsPackage.iss". ; No source file here. They are in the source tar ball. ; suppress -cs version no fltk to day , wait the next version ; FH version 3.0-1 [Setup] AppName=FreeFem++-win`'SIZEOFPTR-VERSION AppVerName=FreeFem++ version VERSION (win SIZEOFPTR bits) DefaultDirName={pf}\FreeFem++`'SUFF64 DefaultGroupName=FreeFem++`'SUFF64 Compression=lzma SolidCompression=yes ChangesAssociations=yes OutputBaseFilename=FreeFem++-VERSION-win`'SIZEOFPTR ChangesEnvironment=yes [Dirs] Name: "{app}"; ; set writing permissions for examples with write and read files Name: "{app}\examples++"; Permissions: everyone-full Name: "{app}\examples++-load"; Permissions: everyone-full Name: "{app}\examples++-tutorial"; Permissions: everyone-full Name: "{app}\examples++-3d"; Permissions: everyone-full Name: "{app}\examples++-chap3"; Permissions: everyone-full Name: "{app}\examples++-eigen"; Permissions: everyone-full Name: "{app}\idp"; Permissions: everyone-full IFMPI Name: "{app}\examples++-mpi"; Permissions: everyone-full IFMPI Name: "{app}\examples++-hpddm"; Permissions: everyone-full [Files] ; README Source: "README.md"; DestDir: "{app}" Source: "README_WINDOWS.md"; DestDir: "{app}" Source: "INNOVATION"; DestDir: "{app}" Source: "AUTHORS"; DestDir: "{app}" Source: "BUGS"; DestDir: "{app}" Source: "COPYRIGHT"; DestDir: "{app}" Source: "COPYING"; DestDir: "{app}" ;Source: "README"; DestDir: "{app}" ;Source: "crimson-freefem++.zip"; DestDir: "{app}" Source: "0ldUserReadMe.txt"; DestDir: "{app}" ; Programs Source: "src\bin-win32\FreeFem++.exe"; DestDir: "{app}" Source: "freefem++.pref"; DestDir: "{app}" ifelse(len(MPIPROG),0,; ,)Source: "src\bin-win32\FreeFem++-mpi.exe"; DestDir: "{app}" ifelse(len(MPIPROG),0,; ,)Source: "src\mpi\ff-mpirun"; DestDir: "{app}" Source: "src\bin-win32\launchff++.exe"; DestDir: "{app}" ; no freefem++-cs today see ALH (FH) ;Source: "src\bin-win32\FreeFem++-cs.exe"; DestDir: "{app}" ;Source: "src\ide\FreeFem++-cs.exe"; DestDir: "{app}" Source: "src\nw\ffglut.exe"; DestDir: "{app}" Source: "src\medit\ffmedit.exe"; DestDir: "{app}" ;Source: "src\bin-win32\FreeFem++-nw.exe"; DestDir: "{app}" Source: "src\bin-win32\bamg.exe"; DestDir: "{app}" Source: "src\bin-win32\cvmsh2.exe"; DestDir: "{app}" ; Source: "src\bin-win32\drawbdmesh.exe"; DestDir: "{app}" Source: "src\bin-win32\*.dll"; DestDir: "{app}" Source: "examples++-load\ff-c++"; DestDir: "{app}\examples++-load" Source: "examples++-load\ff-get-dep.awk"; DestDir: "{app}\examples++-load" Source: "examples++-load\WHERE_LIBRARY-config"; DestDir: "{app}\examples++-load" Source: "examples++-load\WHERE_LIBRARY"; DestDir: "{app}\examples++-load" Source: "examples++-load\WHERE_LIBRARY-download"; DestDir: "{app}\examples++-load" Source: "examples++-load\ff-pkg-download"; DestDir: "{app}\examples++-load" Source: "examples++-load\ff-get-dep"; DestDir: "{app}\examples++-load" ; mingwm10.dll is necessary when "-mthreads" is used as a compilation ; flag. ; ;ldd.exe src/bin-win32/FreeFem++.exe |awk '/mingw64/ {print "cygpath -w ",$3}'|sh|awk '{print "IFMGW64 Source: @" $0 "@ DestDir: @{app}@"}'|sed 's/@/"/g' IFMGW32 ; mingw32 .... FH. I have put all dll in bin-win32 dir .... IFMGW32 Source: "C:\MinGW\bin\mingwm10.dll"; DestDir: "{app}" ; Source: "C:\Cygwin\bin\glut32.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\msys\1.0\bin\freeglut.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\bin\pthreadGC2.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\bin\libgcc_s_dw2-1.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\bin\libstdc++-6.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\bin\libgfortran-3.dll"; DestDir: "{app}" IFMGW32 Source: "C:\MinGW\bin\libquadmath-0.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libgcc_s_seh-1.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libstdc++-6.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libwinpthread-1.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libgfortran-4.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libquadmath-0.dll"; DestDir: "{app}" IFMGW64 Source: "C:\msys64\mingw64\bin\libfreeglut.dll"; DestDir: "{app}" IFMGW64 ; mingw64 .... FH. I have put all dll in bin-win32 dir .... ;; end of mingw ------------ ; Does not include FreeFem++-x11 which would need the Cygwin X-Server ; Does not include FreeFem++-glx which would need the Cygwin X-Server ; Examples Source: "examples++\*.edp"; DestDir: "{app}\examples++" Source: "examples++-eigen\*.edp"; DestDir: "{app}\examples++-eigen" Source: "examples++-tutorial\*.edp"; DestDir: "{app}\examples++-tutorial" Source: "examples++-tutorial\*.idp"; DestDir: "{app}\examples++-tutorial" Source: "examples++-tutorial\aile.msh"; DestDir: "{app}\examples++-tutorial" Source: "examples++-tutorial\xyf"; DestDir: "{app}\examples++-tutorial" Source: "examples++-chapt3\*.edp"; DestDir: "{app}\examples++-chapt3" Source: "examples++-other\*.edp"; DestDir: "{app}\examples++-other" Source: "examples++-load\*.edp"; DestDir: "{app}\examples++-load" Source: "examples++-load\*.idp"; DestDir: "{app}\examples++-load" Source: "examples++-load\*.cpp"; DestDir: "{app}\examples++-load" Source: "examples++-load\*.pgm"; DestDir: "{app}\examples++-load" Source: "examples++-load\*.pts"; DestDir: "{app}\examples++-load" Source: "examples++-load\cube.msh"; DestDir: "{app}\examples++-load" Source: "examples++-load\g.gmesh"; DestDir: "{app}\examples++-load" Source: "examples++-load\load.link"; DestDir: "{app}\examples++-load" Source: "examples++-load\include-tmp\*"; DestDir: "{app}\examples++-load\include" Source: "examples++-3d\*.edp"; DestDir: "{app}\examples++-3d" Source: "examples++-3d\dodecaedre01.mesh"; DestDir: "{app}\examples++-3d" Source: "examples++-3d\lac-leman-v4.msh"; DestDir: "{app}\examples++-3d" Source: "examples++-3d\*.idp"; DestDir: "{app}\examples++-3d" Source: "examples++-mpi\*.idp"; DestDir: "{app}\examples++-mpi" Source: "examples++-3d\*.idp"; DestDir: "{app}\idp" Source: "examples++-mpi\*.idp"; DestDir: "{app}\idp" Source: "examples++-tutorial\*.idp"; DestDir: "{app}\idp" IFMPI Source: "examples++-mpi\ff*.txt"; DestDir: "{app}\examples++-mpi" IFMPI Source: "examples++-mpi\*.edp"; DestDir: "{app}\examples++-mpi" IFMPI Source: "examples++-hpddm\*.edp"; DestDir: "{app}\examples++-hpddm" IFMPI Source: "examples++-hpddm\*.idp"; DestDir: "{app}\examples++-hpddm" Source: "0ldUserReadMe.txt"; DestDir: "{app}\examples++-load" Source: "0ldUserReadMe.txt"; DestDir: "{app}\examples++-tutorial" Source: "0ldUserReadMe.txt"; DestDir: "{app}\examples++-chapt3" Source: "0ldUserReadMe.txt"; DestDir: "{app}\examples++" Source: "0ldUserReadMe.txt"; DestDir: "{app}\examples++-eigen" ; Documentation files may need to be copied from another machine if ; Cygwin refuses to build them. Source: "freefem++doc.pdf"; DestDir: "{app}" ; Icons for Windows can be created from a 32x32 image with icotool ; (Linux Debian unstable), or IrfanView (Windows, not very good ; results) or paint (Windows, save in .bmp then rename to .ico). Source: "logo.ico"; DestDir: "{app}" [Icons] ; Menu Name: "{group}\FreeFem++"; Filename: "{app}\launchff++.exe"; IconFilename: "{app}\logo.ico" ;Name: "{group}\FreeFem++ GUI"; Filename: "{app}\FreeFem++-cs.exe" Name: "{group}\PDF manual"; Filename: "{app}\freefem++doc.pdf" Name: "{group}\Examples\Tutorial"; Filename: "{app}\examples++-tutorial" Name: "{group}\Examples\chapt3"; Filename: "{app}\examples++-chapt3" Name: "{group}\Examples\load"; Filename: "{app}\examples++-load" Name: "{group}\Examples\Main"; Filename: "{app}\examples++" Name: "{group}\Examples\Eigenvalues"; Filename: "{app}\examples++-eigen" Name: "{group}\Examples\3d"; Filename: "{app}\examples++-3d" IFMPI Name: "{group}\Examples\mpi"; Filename: "{app}\examples++-mpi" IFMPI Name: "{group}\Examples\hpddm"; Filename: "{app}\examples++-hpddm" Name: "{group}\Uninstall FreeFem++ VERSION"; Filename: "{uninstallexe}" ; Desktop Name: "{userdesktop}\FreeFem++ VERSION"; Filename: "{app}\launchff++.exe"; IconFilename: "{app}\logo.ico" ;Name: "{userdesktop}\FreeFem++ VERSION GUI"; Filename: "{app}\FreeFem++-cs.exe" Name: "{userdesktop}\FreeFem++ VERSION Examples"; Filename: "{group}\Examples" [Registry] ; Link .edp file extension to FreeFem++ Root: HKCR; Subkey: ".edp"; ValueType: string; ValueName: ""; ValueData: "FreeFemVERSIONScript"; Flags: uninsdeletevalue Root: HKCR; Subkey: "FreeFemVERSIONScript"; ValueType: string; ValueName: ""; ValueData: "FreeFem++ Script"; Flags: uninsdeletekey Root: HKCR; Subkey: "FreeFemVERSIONScript\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\logo.ico" Root: HKCR; Subkey: "FreeFemVERSIONScript\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\launchff++.exe"" ""%1""" [Tasks] Name: modifypath; Description: &Add application directory to your system path (if missing you can have trouble with on-the-fly graphic ) ; Flags: checkedonce ; unchecked [Code] function ModPathDir(): TArrayOfString; var Dir: TArrayOfString; begin setArrayLength(Dir, 1) Dir[0] := ExpandConstant('{app}'); Result := Dir; end; #include "modpath.iss" freefem++-3.61-1/test-driver-ff000755 000767 000024 00000010104 13256636774 016406 0ustar00hechtstaff000000 000000 #!/bin/sh # test-driver-ff from test-driver - basic testsuite driver script. # modif F. Hecht UPMC. scriptversion=2013-06-27.18; # UTC # Copyright (C) 2011-2013 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, see . # 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 or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=77 else do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' trap "st=129; $do_exit" 1 trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 # Test script is run here. ${TEST_FFPP} ${FLAGS_FFPP} "$@" >$log_file 2>&1 estatus=$? fi if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$grn res=PASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: freefem++-3.61-1/examples++-load/000755 000767 000024 00000000000 13321644113 016457 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/000755 000767 000024 00000000000 13321644112 014364 5ustar00hechtstaff000000 000000 freefem++-3.61-1/FreeFem++.app.tgz000644 000767 000024 00000075424 13321644016 016560 0ustar00hechtstaff000000 000000 HG[} `eyMdgkPԙl2ًp(BfWŸf'ݐl2,sX2\KPQMUVc1Z[S{&xB߻o=; m^wx"qibYgm_~iooߺysDlMWJlk{$۲)־q֭["M6RW˓doMSsL%Ru) m"ѕ}k"9j_.ş ⢫Sc:Vcwop[yg9B~5c<)7oLͿp,$/I%FR_.#T߸,=&߼qc̣QA;~Y\K֍r $_&ucG nL%?m>@cҿcG;=(}Ñё 6$F#{.Xʝ},p~|"_uG֟vp풝D;#裭mU#Rc綵8p@k8!>O*&ۮKnS1pp0zYč/Ү#ÉG\9xCxRh6\ 㩁~_\M_0I\c:7w--7y(]=O,ɍ׽Y L3LAs]HqJH儞kA2&?s*QQ3N<&*b_Qئ6 k9<ݡ| 1@7ἐly\3Y@\Op1WD4 ]]9Yj;FK뢝C5е20[TP {f2Tds*۝9n K=SUg<;!TRWs *D؛0gX]D3VRPvwZ *0rh 0qVP)%p8zPTPQgƨ/njQ!x='ǘsf :daC|!mswZr(z6@,ΠPY^ƕ K[DIPOtܰ(]M E4ՕY~neR8(GzU,QkCA NRs q+ Ἇʨ6CUUęh[؈yuF\*+Jpe0LI`mCMEa37{0YThҎiNerNl~7WD[xXr噶^W~ue0^g6ʯ{+^k$;o3$fz ˙:M9d?a }f:]#W7 '8f9P2P~q46mQ3&|0h/-lzR=#bgiO&G;𺖘+@zT˱>?ޢ])Tq=Cc oYP>@"zVE^31)jzpWo']''I,dh |'[r&p::|4Xsi7e%קޟ1;Wt#'Mri'G4-P"K#_TIt '&*/X3%`/:w>aP\XIjc:L<wLoFoB.eN!\1g{r>mI(jD6 g/-IfD$eՕg뢆qɊ:PߏHq5cJR s2Ԝc 9h!tC~11%=S5hɘƒ,4kx?~sm(p7νh\Q4&z(Qi A"ȈԅV[i 5D}fy~ni6D_PkC#Tü\aR4;0:6*{(I›-^'c8f*\Vl$DQ [+Ͻ$W-*OxLoeA،N1胔Kz3ڞTp<F&@QEol5KF7HԘ;2+C79__UIo+$PQ%SŢj1\i}Q,}|h%')tgƖ$Ӗ\2g̺ðIʨBP ƩƖFC2=TQr)ŴU bY)`ġ^Fwъ0 {Fհ;a` ʾѾ^S55Wx+ye0%/\W~$w+K?[ ~W¬Iif_/fw'}]繱\r\9+rŧ}k@/=HVZd_Y]@;2&8; 4x N<"ƪbFeWg⟬ q-swG1A\*bq笎H5ىks'je0F8nP0oaR2ب\@2B5$1qry% o(,5](9"(-6bZ L͵iV"^Bn<$jn@\ eUf VŷYm,Ja!T|K)wL͓(_=P̊A3$ ЊRaeZa>:2Zz2V4U"֒Q0jtn2i)!rӊ8rE"/kQsq;it`I [X ,_*Tc,ƠHee@ͱC }`)/L X *!3s:!*1\a|_RפYտNhQ +U*Œl@܌iwFZME+)e͕hv ugSC[x/Nɳk%y<εQ:Va ˅ |!Kw]~לܑ'-^B^e-|{KB"bZE' Y6-75$% - lfוcsPPhQ ! ?+|KI{S}uU0RFS_n+jW-;V@vOJ\0!0|!I$*cX,V4&6ֻ.:뚉{Sv!N y0e @%)dm_ |VAcpJ!迡aN[ ZȊC1yΰw8 -&SƁPR%I$?~6T͈0ž<-+xPIҷɬ(-(ڭv2=.`7%7e&h Œz52Z7Kr@26^:wybNܿӖy̻UWVg3wpdlλxghż4,YoE9Ͳ;Xf.d-ph2͓j<߭ ,2'UN+A]IoL+j 5%ş**^z:%ytlJ9 Fި^3k!^6Z=?mML@獸4,{>Mzy lK\o]sY:7ln}2\%hA%Ą˭XFV Uy,@W% Xg6X*hC4*ZyzQɼFY>=EJ_iF:6ͪuEy@{ׇUa+\y0:sDa@R_ Tgr:YR#(3W\$WeyFBiVPїUPD *Rf;ira&a &@pΰ; 9EwfVgBqP)V`< FZOH} ܓiT;kճ6Q,|el$Le&__e8QDTKWzؘŒAhw7YeH.:)Bcf$ oҗ$XWAp ԥ3qK}%$['[*.zOvhfڴEa80e޿H]yɽ _дWZXՈJzwRƁKLuKUf$|9g;GLM%Xj'{B&cId͒Kg&'iǍ+ 3)0NQC^eδ$Ô]],5Ut%7i[dok$4p]f)j( /s\\Ax %Aԉj(ʛEί).f3ƾoV' WnS~ܨo%6JUykl2tF_?Z5m^@R1y4RBJBkE[Зn=NJ: 93a Fz$.TAɆ/AcN3; Tβ+b~IxZ+:OCRDc1YCN,Mۨpgd_bY\+M띭Q]J*8limSh hϤޣL[13:y !tjXThRC\Hꌣ[uhuSu4.DzYؾL',O/m3zNzV^m-6i:X.8웵[W/~eРgknY2nѳ܆}+(a5d|EW2.!U, =:dg^Ԍ]qkXl!+VGT%]Ul>7x M\rsL[1lo3aY5/"ِ]cdq6Y"9XSzBb ;!MU;gl6e9d<:-[Tꉈ=.ӫ{/'b,Yt&ni]$y cl*0usaBi#Vc|&jy 1 RZ:raAhq.x0ĊG)9ckJ4d t LBFb!]>!@7QP=/⇡WCFZ 9U:* 0N`\M(afƭ1NQ9i#YTXǸz!)12XOu~(+e(Sb1IVD㇛ZJol_^eD=SWMQ/#vbThPW5/#"dW` j[j엗$ E[b\\1I7tC*zRWx+^Wx+^Wx+^Wx+^Wx+^Wx+^Wx+^WxA_rx"qibYgmkxt$I%zD-KBcoݼ9[o{&۲yS$ֱy[6utlwo޼"9OD|jǹnSmGڒ{D"vmW|U;"s#7$7(OD$q0HEDnKHWlrnё3JglL4ā~z+Z/v嶫^V5^U}сȎDd_bdd08%?8~:Oř ڎu?}} 1 v' \>9W_LER{ȞHbOp9Vr|%00:^Hh 62pw%O" DNԁST@OH`p oh9O q;@6PӝHy PG#FD֟.-O_:q[R+Fþ&5@}dJ~=?Swnן76>(Tk$Ծa8ʯgo\t%1؈X27S[ӂ>O ^ߗJS7##&\!S:<}}$ЬEMG~ouZ@b8ى@z[qz~1aK]]]}`ԭ[#%O >GGQ]`͛w ֮t874857޿+uClӦvts%l"?[;]׍ 8ծ@{dW`j1b:l:}{G@'#M97"u.ak%Kٮ:#sΉ\ <0bp|(re!t΍ٛJFIؤD?ξz|0ҿ/A\,X CN~WL~L80IcWcp:#ؖM훷lܾU˦?ŐSpx/ &ɹz]a]n9Yn4,חͧ(u1 )n%W,O,P?rcmYAVO? w3oA Ӣ._њzh)eʇR rTWԝ3Su[9sţ/#u*_|)gg 6L}|pHqXxt;f](p^H6ZC*b|ыYwgl+"oYk@x~`R|vTwkJ145d`(*Hkڥ0gFZnhY?.r*۝9n]zlV⑏ʒ9Y>Wzs|ٌ&4O(93IJ+a+6e) @KmqzYbEFT Q4_2o kCFEݪ䗯̨VzY6@ϲGSy D,l|!mswZr(z6 㕙DrwpS|U3IDvnXs&R :g]vw5!L*\|(.(YֆAl.1eMOl|',vT"LTUaܤ1$եfw7JRhp²neR e9f]@?[uftEJEX,Ӝ>l{U1xz4[xXr噶^W~ue0^g6ʯ{+^k$Zv!16kkݧއxPReu0E20V>x3op(Vx8MO>dYdFr%MOgdRzk\W/7bTY,8=rM}joѮiY.C`Ɏ 6>d4;Qt-p,b'Cv5Y%5bfpW.cgV G:t1,]ߒ7dasCi>IGNR~뛲ĂNC0IsvE MPIB@.MblOں3}R3sI1TfaL-"E2KtY6!S\Yֈ]_lgJ^fu|t-;Cqa%"e2l,W7FIMXf3k9eJ6y]2k8JDe88M|Ki/ofMZ*.cf{۸.jr"d^]jeni\)#/0'+=N~,dBE2Ox:!]ev NN4rdyAmsQ?۹6d3z3D)jiLVC3)Q6@+dQsE9Y1vy7 .hY b,e=/-;ͦ" JtmtH4Wpջd>SLy¤ iv `tlT~1Q*Z奅7[N(p$&Tzu]PY $ [ْI*M'iV{IZU.91^,[Y6+gTep(?i{ Dy`B$[<[͒Q.3RsYfe&뫱*mzE`*jeɻ%SeּgVP;I- (ANKLҲROZ 3%eI*[ST CLWMUu?d!a,rC)f'[ PE,zr)Ŵ5˭tyrO~78 3g\ M6 +!(&2VcPyt`W hQf:r^pԪn*z'&dRVf_xFghW&] W @,,i*8i6zԐ2i$w(Kb7k:$Li IA5 jrR,kX5UL`2ZYaԲ,_tj3%<',˂EKfu.:i )hE{iD<U!QnGqZѐ@? !~&uG3lN#B)n(fb+SAOk}Q [ʸTtx-""jG\9# RMv܉jF(L =T"zX$KhalK.k i!Tɘ8y%mCAdK@dMa!e#欈p=Jyˆs4SH~Zs4+{/b7UvZ57Uy .*w`Z3TCM][ Nh6rztQLPMyC/<ߍs2:W4K4O||ÚC0+ΐ0@+:KVIPdҖ[3Gh5̇f [k:ɘJh[T([KFDʪEEM+KfI F-jG닟\뭻KRT0Ec7I:3Tjc^eeHLRZY.șHf/ MY N}}KByi%rB9Mȓ1'7[aw*C¡^dШGQC$w`I [X ,_*Tc,ƠHee@ͱC }`)/L X *!3s:!*1\a|_RפYտNhQ +U*Œl@܌iwFZME+)e͕hv ugSC[x/Nɳk%]Z( {KUhBxMSlUM¥;.?kRoȓI/!>HJuN?o1ZDWr, U̖z3J|\n19u((4Y㨆ŏe$ =>ں^*h)ѩ/R7ZUȕ^5+fifG'bb .m (Vkjfi7it)WYL: uJσ-KV%-L%kX5} S A esjN˚E /ARhժFVj厹Ex's+VNh42 *L%)lFTd.i ]+wJNf]ŬFiAnސ|,u{ż-AF.3GfTMՋkrY[␱3Ѽ`Cc\5wcŜR:#$d/vޥ;G5/D az.͉hl2wE'kKFiT;nUe9rZT Lz`Z?W ^)).PQI,=8[ͧ .%ẹSgSU_6BFI  HoaGT7r5Dx b%A@lBD`Ah1a}%)*i_ACX@?&sK]y\X% UProVD ri_/wiH(dޘ1DefSrFbf(: (pTB^cQX Vx <+,-$-V35B8TC -!t )y?\C9al) =&霐..xyYYqw"ishb"|7ݮP.g\p w>oĥahכ_k`[t~Ҟb=-Рѿa0u۔qh,G (!&\n 6Peʓf!eR\*VX7R=ӵRAҤaV ԣH5Y /RN0\ ԹmVe,.ڻ>_ [9ʋAiĝ&u.F DTw:sTL2H6A"ɭb$(̳6J ڮmB|E'U\7O 0&@]H5u4J,sMȉ.5= bI[0ƌ!Qd M\/2a% /Oj# 1Jᴪ(a0jzDK\MkG$LzYݸ|贑:e/5yqZӚ/mGU"2 5Ac^H$KP ,YFI(>ݞrf;hRn5UU-t+iaJ޸I, Ǐ!gjzI &Vbkk'J_(>dY R[ŔTsR);(}nh;u߁ŸrBԷ fozM/7^~ozM/7^~ozM/7o7TaӝޓyjGHc>'_oo|3+jF5$I* :80*/$< ` _1o |'qؐVTգd)h%O~X Hf?o)c a%L.KW4:,;Ź p_;f }B#>K T̪(CvIBs6#&)^Px%)ź /V0?.m[{L,!Jtȴ>i9KjE&6)Kb'k$]8 \4i3-;ZE9~[NXTx3IV%zŵs>qQVHssܰhX0#HRRB?49g5eP؆ULk^;nqqfYIc.+i=xZ&e zI 2ċn6T`6Ǣ5ќf% ]駵 t a\ % jIKy4FWe5'N!$Cq/mHrT4Z7$p/C @B{Arø _DqಹĂYb?7UZ]]. *rhF)rڃDqe%LWN M\40\#fgD1Gz/wFqyN A\lg2&Kb,ɽ㢀D3+2,bF$4^xNׁ3gYS!4 ]RfEd~T]A56k\A s {+w-ՕqybQoY̨';mդf_Fo^b_APդ:ʼ*qe`KhB俗c ߊa~ ;Byɠ͆ԇw]`&ӵɂ' y>OyUŒ0+hxy&i*p9+ef(!Ї䱠iآRODlq^{q?`yZ ׎\5701uKp'L㗍dl0cVI LaS3QQ%A jFs!V< M[S!$>`۝͔u|Pf23 |@h%5 j5ظy ? 52bV"Wd wjjD +7S4n18v5)Mɢ²<գIz25usKFU\0'/Cݘ Om5'Z?LR2~f*#2jB|3B;GZ"_!&TPQcR`$i(JLB8I 8RWx+^Wx+^Wx+^Wx+^Wx+^Wx+^Wx+^Wx+ KK:kCXţ#H*֓H'm;c8 ޾un٪̯-ƍ-6ǶD;ڷn_,S'S}eo"7uz60pv_S_Ȇd|x8:F>@cѿ#͛)˟o:hG$!.kq1|TB b}T+ Ħn,`6F"O\!L퍤&p8<jp$ft%G-%?9uLh?h/8. űMa n0aoTxj~[iхqaO>LGj bS`"A?]C/"Db|0As} vP^{ :O{jo8 11ڧg^G- ߴNtVEdD$9::70IKE7NОE4 %g}5p{IZ xscx"G)6o)09AljS/z.=\zp<4":x|G'`#O?"r?eC•tr8Uz!ȑ/^4JC$vGHF# 'W /X_qYQv`+?Cچ2rE^mk j6+B 65St&ٛJv }ھȆ6POO]Ge*&)s  JFZne\| m>%Al|"t:#MFgP+{ ~NhduDJӊ3 6Ψi'?Tx^V~ T %N>73\2 ĦyN1G+h6&7t_q3Q L! cz# BkSgjj#2s( - 6H˂F8D/ 81r{ƯO&:Z]WZCk. ԣBkZ<|:t;v :lvDL\]L =|. b{ߢ˂vq. 6s\n*-rbzW|rߠ+M)ycrTXnxtdBi?< ӕtU?1 u0_kft|?# G4x>K-\: -o YTR0#u_֑ :\٫ ԥ<xM*X?.[c.^PoxWQyQًҮ 6J3Rs~~7MoSZ*l>%5QmYovie'[NMp)OU[k:֗+l>)*]Ao`Q $8YpZx ~~C4Fk GJBx4Vgt,( 0W'ȱ~ 68%y2(R_6':0E}?$BPka0 bO|UR`7(lσ_=(lϣ0y `3hDCPx?4Pz-:~P` R.v*d&yĎv*$z(lig-gǂmh`gO}A1gO 7ȃ[T6' +oyG7aJ7le 0{بux+FMAl:Er/TotA*:7f~OG]0u'(Hw$g4'xW X}u;8n7>;ZG"Ma~{qUn[xIr8{mAǰͅ@޽A׈t)[Zs9 gOCyl&E ͙?H\f7\u a }-~\Ši_ }j&m<m>rfF'JzjCǢM߯y\>+Iy4Y|DwN.8|pl R{޵A8n0ω$F%zeo<ٰI# `a-@(#ׂ`7 M Q{|η9&v&B?Yy+oqVF"5߇?? bS,Ya ^Hϋh%d"}舝̢LSn:}PZgiA T0?CNл:A AO.v^GV<7ðIKAlԶaU>BY7` ~D_y&H_zauafdsPxiH壿B&$-Q@S7Al4:@ SR ;Ó-OgHz#̫mQQp&H+f&DX8G!9*0HvjDE)}1cێ:'C| ƞ7>,}>F#g>Oa &%Jh!&b=cBF<_0AIH_NOF{}c h(*_"n s 6; 68J_R{bj@'C& uu(6^eiI9  a*w",/Ɂh5_ h ܘ}Do읭G0aqUJUCE8/|} _T2z1~c-}C&uMP:*KSߛN#y(H_6[k[ѷᆯ}|@|q5|Iq:n~Q }>}?™MF:8+;G5ok@G 6a!I\$& 釫V)3!k^DD? bSw~7鿍 sy/(cefut"'Z8qq(?ټ?f/$r<Uݓv;[zK@g:^/ס_StViNNNp#éH/|N#4suӸ8N}PêjVE^SNs;Niqwdqi׬s 4c̠6wޢ9wk DrjM˯qN p5T W{_Y_#ZfyZs9ͦQ9"qH\w6κUf~U Hqxl^+d]: :5 P +yg =-(vNWWGo˦G}lvJA+.͕Rd:/\ ~T2FPPĸyb'D)_yt^D [|)oK'gZ#v|qTI/vB^5ybj qΩi> |eKe[H/[-|.r'[['96-ܹ[ms֟Ӏ-7Fsoq8iooFlkێ5 ?_N/6m|5Dt_;/K͇oh-Rӵ'At| v k饴3ӝ3GpZ>KhtZgiEçOH):;/Z%G]oӎ3P9ͧzrOr\ G-[8rtq+Ι~u,roCB7}]!9=֋k뵽CzzqǷ_OYduU>/:g:g-8Q^'>6=՗g>4$_?gu۟M'~-}봇Ni8j+k}%0^0*k  Ox3Vku[Dd#8&\c*q:ҋG_ u{UN6:mN7G:[,t}F1rZJvӥvĠ' /?cmq@; o1j?Sugm3?A5RiQWDRC0a<5߶󚝲3q7n޼5mk߸iVykz=ebh7M|lOcsǮh|O.65H5оK5 a{dD9{n|txt5ؼy؈ޟ^8Ǟ>GڷX&{Ü<}B۽=5JQ$۱7olo ؕSd;28>ējNvŇឥ&"?5^=؟ѱeK;RI=({v7\]7{GnN }b'?1ןh{õݵq'o8g˦ޓ4qtDΠx(p7@9D#j4dtT!T*ZT'Z֫ިUQZb[n ~͛훙}R6PfXU4h@@$#QYD:TIL.*p:*_xuZ8aC]B"EWC[@Qd`+q\Nv %1N)pMJk0\)Ij,Ojh5,!cDF4=^zD`DM) Pb*'2X@/$_SCePI'%jqNV:jLfa5!2?J5Z4 ΔI4bd+\;e'H 1"GK^#@)q,TeUJ\+éw+ӀXt i43U$ IU{8Uh՞*C\Ŵk@x\6ylrTk&ǽ3<1>9y͏TI'$! B"H[n ]L,+?2$F9% ^~Uo-<@(DWiN*յH-lPM< ұT%1~r"`I Rz T] ƅ/6: `x( +c5cSG`R;їb$RKv!B*_,*'=PTjzKIFR:AW6¦V {9͖u!(T520_%_Ef 22z0.ZjB;?*ߒk+;?JT%,p"!C KMI{yk9}0Jbc<Ƃ!~ܿ-1Lgˁ/H$\Wl?뀿Rеոͣ_'JgА B LsA?4Y0& Y,?+*1BqIUM$PpRbDrljDl >>Q(Hw d+|_eY8hhS8th02qy;dJ*>,7(uP(]Nt- 79 YY_bn]mD6nli gd$yNxJcܮU#[ +kDҚ:/Ut^Mu2{>odϊE$޿Ws^Vs;lMPME&ZBQ/[Bt`<^Cau^CK 4:FTIpT djm}91Q!S"-))Pl=<l`)R+ˠv.CkR CԡEy0)џ+;xޏå4HThQh-N37^"GJ3 *1ID\&H40ZHT>7Lv ꝐU~DJ:S (B薠 *d]q Mvoh9O7G@` `Es 24«;LKh(l %VmpTEBHЃ\JfoX0kK%g!#`9-LXrw  n*jU[2ミ?Q@o9r]u`POԆ8Ђ g"pOzؤH8xJe(+B\HH [Dg^n!utjKe}2UƧe}ece=eF{2cE@yc6ޭ6\m6V-0ڟ58x >)`0.9Ɔ*u1ڃh0nc 9 H%2e"`wkC :%gPq BIni<-Aɢd"=ʢ(@U:\QtME V=~۾,R@'u& k*!eǠsBSYczsi0U5`z0:tg zY,54=~b4 tȧ´K6mڌ)H|a5Cfz"SAe:C>7U萕:T=:dij:C֛N萍/!%Qe:'X?ΈĿ0(0T  0Oh(Z AQ+p;t. 1660a, , , ,18s0G$<\qvR`T|GXN/@_ z s(H: l O@ %Z9tUzF~) ֍1od3V*s L _kJK7b1% *ok~fvjVF,,Qm|06 Rrz=\ +bu"]%hdCb9za V~~\OOR(TzCz) =*5c~BxKb .V0]=_ִ2x:V_&*,0Fn >Z]v F\@&r"] ˓˘ ۜ7J Z>AqgTz#L9Px fx  ]^M~reCΌ H'%dnC-Re?.`^T "`X 2:K?Կտ7ctyX=+bX`a<W|#Z~WmЇqEBW 3HQ*_}d_^(?$W4nvj9o49RuM{QTfs@es@2wMCYPBnB7 (7)/tNl1Bd D]Y!6݂n;!+hMtEoQIt";`& ݧֽ\u3[s ch>gO-g̝jz, , , , , I!HpFo^q0\ s GIrxJ+5ф:Gf! 2DBh;4u80.uHhdT,VdYZ .%0pj~DHmWgһ}ZjBCKhpx5 C*KZ!%2@ذ.9UV@귋vХCC>hqwCR0ǶPq[YԎEE ?5q?5M5vzT۷oqr~o$cҞtͷͻz _Y~O owdwZ ֠6 LܿcoW ;6VxV{TܳKkp]^8gԞtpEl{p:" _\7av pB:HؤrpREmnƁ>7'^)xS x0आ`cg M^@;;ijiL W4XTk{gaa`@p`@@߀w < hzYᘈTs_HXzY jw(|{fZݝ?ѥeśo;7Bƕu[ףb,Ŕv{w)nvA,knE/t/˺mK,syZ[wN\lk?0cw.xPyO?=-M.AJT~suӪuǻq1lXc"hnPQE\.Ra;NB;^o;Эml0 ڀpq?$V͍L~62r0O؜VBO4ljZ==?|ؤw+ {/Yнc(T" AF2Ɏ߯Lp#nzX~|g%=[/"%UKv}p3Y<;z;gu;ё9' W9,!_$ifLaQkӓ-gWP;ںEu^=؎ju~b_.]emcu/_Ff\0|pA6b~{dzOY篭k%yE Ywhȩ9%&L浩3 5gT@(ؔ3BO Pap` P PeykZyλ56w~CJL3ccu^BNMAOSZf,v;^z^{<|:iE1 :5;4SťlO@Fۄo{lşKپ{tJfɡ _Lu0*U1%߳-\r-?ruAJ7vk9=BzuĊRw!k9G~*Oy31;QW/4w46g?7,_;= IF&4v͍&p#mq Pp0#٢BCa/~!strBOL:DDZap,=:@~j~@*s4t yp)-f1hO ARʈ&hոorT m٠P`R45$M &~uwV_rKN8+۳}) ƹ}H]zPsN4g-)N޿ʶՔ#ݺjN~5UWoUeט{|xzK/r*3٧{dYnܾcZ J|w\اm|34sKcdҠ'}G>vuǡ[BZjΝ~ "[5iRS´)kg>lj lfLj/ F  OPxhp+0^ؖfЅ24(lOsķYiQLwy$VlH{$/[ ԗF;V7o>{P%U__g6Ei/ybfx~^>m~SnM"M~V'>%{e⚓]9a?u8w|h{wwE}o2o{Vpx<木8~K:ž>ǏMܺ\sa&ln/g"Gi}'cV=yz 5OR/ojcgA3iB:y"/kꅜvnQMovqCV'i s@Xdn }dG:Hkv@..76[j)jǿL[{8|oWSq{->K2> %M].eavÝ{2OxhC/=*?^X6`f#n~~g^2şf8yV_퍍זDy*S\TNyɇNw=z٧zv{6ѴB>+_w"} {otʣۭk=fǜaO^Ŕ#STdI]k'9}k8rfȼtP8@lXR(0\~۸?~xpT: vB=6n|EEBZR^\y~}(`n{.|bX.YޘۿH8$'®pjS#+ c }ޚ[CUBn Ӂ؄ {V;4K%mHypeb&>-vLZK)*lsckyo>gXS+, , , (mOZ}m?8m ڤ3Áf5eG؁Y.v~ͼb 7̛ɓ>S#{k;l~R/) hD{#{}kz-om6cה}>Է){|+j6Q4y|h[7yh6ݻc-{#<:껥5  t]kC-Nm^m7en s6i>b[v ?֫Qyuzp\6kn0nc{LT3W1M6v0}־X`X`W RV=} !E2`cv̝ho~R.2ޙs ] C|ef}h_Yˠn*1(So^ƛ;ɻ&L0!EΝ.sw5w(|b"bj1P81Oa po=&o?8zYءO(Kù{ Q7 FT¯ Yf:톈7Gn~- Jdb.i8B"'&X*u* *jS r*A'ffX* ꯁ>6\) , , , , <,su>}`V|joԉq%w W?mSϧW`8\kҏrݔ]l+ +w{{Zw%B:$8yt)e1}ߤ>@*4nH#cš`'fVr姇V˿gf͸ pUIݗ6ldQ~syȋo98||||||||||||Ǟ|<*n\6%e}<_}'P0)&n\PsT;qg=Xʟwͥު_l% , , , ,cNXfreefem++-3.61-1/src/lglib/000755 000767 000024 00000000000 13321644111 015454 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/bamglib/000755 000767 000024 00000000000 13321644111 015760 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/mpi/000755 000767 000024 00000000000 13321644112 015151 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/femlib/000755 000767 000024 00000000000 13321644111 015621 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Algo/000755 000767 000024 00000000000 13321644111 015245 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/depcomp000755 000767 000024 00000033052 13256636774 015772 0ustar00hechtstaff000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, 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 . 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 # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi 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. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 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. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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" ;; 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi 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 '/^# [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 freefem++-3.61-1/src/solver/000755 000767 000024 00000000000 13321644110 015674 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Eigen/000755 000767 000024 00000000000 13321644111 015412 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Makefile.am000644 000767 000024 00000001302 13256636774 016442 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ SUBDIRS=libMesh bamglib femlib Graphics Algo lglib fflib \ nw mpi bamg medit bin-win32 EXTRA_DIST= Carbon.r \ solver/MUMPS_FreeFem.cpp \ solver/README_COMPILE \ solver/complex_SuperLU_DIST_FreeFem.cpp \ solver/complex_pastix_FreeFem.cpp \ solver/ffsuperludistoption.hpp \ solver/hips_FreeFem.cpp \ solver/hypre_FreeFem.cpp \ solver/makefile \ solver/makefile-common.inc \ solver/makefile-sparsesolver.inc \ solver/parms_FreeFem.cpp \ solver/real_SuperLU_DIST_FreeFem.cpp \ solver/real_pastix_FreeFem.cpp \ solver/wrapper_dotblas.c \ solver/wrapper_dotblas.f \ solver/wrapper_dotblas1.c \ solver/wrapper_dotblas1.f freefem++-3.61-1/src/nw/000755 000767 000024 00000000000 13321644112 015010 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/fflib/000755 000767 000024 00000000000 13321644112 015446 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Carbon.r000755 000767 000024 00000000541 13256636774 016004 0ustar00hechtstaff000000 000000 /* * Permit this Carbon application to launch on OS X * * 1997-2000 Metrowerks Corp. * * Questions and comments to: * * */ /*----------------------------carb Carbon on OS X launch information --------------------------*/ type 'carb' { }; resource 'carb'(0) { };freefem++-3.61-1/src/bamg/000755 000767 000024 00000000000 13321644112 015272 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Graphics/000755 000767 000024 00000000000 13321644112 016124 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/Makefile.in000644 000767 000024 00000057440 13321623167 016452 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libMesh bamglib femlib Graphics Algo lglib fflib \ nw mpi bamg medit bin-win32 EXTRA_DIST = Carbon.r \ solver/MUMPS_FreeFem.cpp \ solver/README_COMPILE \ solver/complex_SuperLU_DIST_FreeFem.cpp \ solver/complex_pastix_FreeFem.cpp \ solver/ffsuperludistoption.hpp \ solver/hips_FreeFem.cpp \ solver/hypre_FreeFem.cpp \ solver/makefile \ solver/makefile-common.inc \ solver/makefile-sparsesolver.inc \ solver/parms_FreeFem.cpp \ solver/real_SuperLU_DIST_FreeFem.cpp \ solver/real_pastix_FreeFem.cpp \ solver/wrapper_dotblas.c \ solver/wrapper_dotblas.f \ solver/wrapper_dotblas1.c \ solver/wrapper_dotblas1.f 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/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 $(am__aclocal_m4_deps): # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic 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 pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/medit/000755 000767 000024 00000000000 13321644112 015466 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/bin-win32/000755 000767 000024 00000000000 13321644112 016074 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/libMesh/000755 000767 000024 00000000000 13321644110 015745 5ustar00hechtstaff000000 000000 freefem++-3.61-1/src/libMesh/memory.c000644 000767 000024 00000014233 13312446271 017434 0ustar00hechtstaff000000 000000 /* file : memory.c * C code for memory debugging, to be used in lieu * of standard memory functions */ #include #include #include #include #include "memory.h" typedef struct memstack { size_t size; void *ptr; int nxt; char call[30]; } Memstack; typedef Memstack * pMemstack; const int MAXMEM = 300; pMemstack mstack; int stack,cur; int M_memLeak() { int i,c=0; for (i=1; i<=MAXMEM; i++) if (mstack[i].ptr) c++; return(c); } /* print out allocated pointers */ void M_memDump() { size_t size; int i,c; static long mega = 1024 * 1024; static long kilo = 1024; fprintf(stdout,"\n -- MEMORY USAGE\n"); fprintf(stdout," Allocated pointers\n"); size = 0; c = 0; for (i=1; i<=MAXMEM; i++) if ( mstack[i].ptr ) { fprintf(stdout," %3d %3d Pointer %10p size ",++c,i,mstack[i].ptr); if (mstack[i].size > mega) fprintf(stdout," %10d Mbytes ",(int)(mstack[i].size/mega)); else if (mstack[i].size > kilo) fprintf(stdout," %10d Kbytes ",(int)(mstack[i].size/kilo)); else fprintf(stdout," %10d bytes ",(int)(mstack[i].size)); fprintf(stdout,"(%s)\n",mstack[i].call); size += mstack[i].size; } fprintf(stdout," Memory leaks "); if ( size > mega ) fprintf(stdout," %10d Mbytes %d pointers\n",(int)(size/mega),c); else if ( size > kilo ) fprintf(stdout," %10d Kbytes %d pointers\n",(int)(size/kilo),c); else if ( size ) fprintf(stdout," %10d bytes %d pointers\n",(int)size,c); } /* Returns allocated memory space in bytes */ size_t M_memSize() { size_t size; int i; size = 0; for (i=1; i<=MAXMEM; i++) if ( mstack[i].ptr ) size += mstack[i].size; return size; } /* Allocates space for a block of at least size bytes, but does not initialize the space. */ void *M_malloc(size_t size,char *call) { int i; /* check if first call */ if ( !mstack ) { mstack = (Memstack *)calloc((1+MAXMEM),sizeof(Memstack)); assert(mstack); for (i=1; i= nelem * elsize bytes. */ void *M_calloc(size_t nelem, size_t elsize,char *call) { int i; /* check if first call */ if ( !mstack ) { mstack = (Memstack *)calloc((1+MAXMEM),sizeof(Memstack)); assert(mstack); for (i=1; i 1024*1024) fprintf(stdout," Total size : %10zd Mbytes", (long int)(memsize/(1024.*1024.))); else if (memsize > 1024) fprintf(stdout," Total size : %10zd Kbytes",(long int)(memsize/1024.)); else fprintf(stdout," Total size : %10zd bytes ",(long int)memsize); fprintf(stdout," (i.e. %d bytes/point)\n",memsize / np); } } freefem++-3.61-1/src/libMesh/chrono.h000644 000767 000024 00000000713 13256636774 017437 0ustar00hechtstaff000000 000000 #ifdef __cplusplus extern "C" { #endif #include #ifndef ON #define RESET 0 #define ON 1 #define OFF 2 #endif #define TIMEMAX 16 #define MAXCLK ( 1073741823. / (double)CLOCKS_PER_SEC ) typedef struct mytime { double ctim,dtim; time_t ptim; short call; } mytime; /* prototypes */ void chrono(int cmode,mytime *ptt); double gttime(mytime t); void tminit(mytime *t,int maxtim); #ifdef __cplusplus } #endif freefem++-3.61-1/src/libMesh/libmesh3.c000644 000767 000024 00000056167 13256636774 017666 0ustar00hechtstaff000000 000000 /*----------------------------------------------------------*/ /* */ /* LIBMESH V 3.0 */ /* */ /*----------------------------------------------------------*/ /* */ /* Description: handle .meshb file format I/O */ /* Author: Loic MARECHAL */ /* Creation date: aug 2 2003 */ /* Last modification: jan 25 2006 */ /* */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Includes */ /*----------------------------------------------------------*/ #include #include #include #include #include "libmesh3.h" /*----------------------------------------------------------*/ /* Global variables */ /*----------------------------------------------------------*/ char *LM_kw_table[ LM_NBKW + 1 ][3] = { {"Reserved", "", ""}, {"MeshVersionFormatted", "", "i"}, {"Reserved", "", ""}, {"Dimension", "", "i"}, {"Vertices", "i", "dri"}, {"Edges", "i", "iii"}, {"Triangles", "i", "iiii"}, {"Quadrilaterals", "i", "iiiii"}, {"Tetrahedra", "i", "iiiii"}, {"Pentahedra", "i", "iiiiiii"}, {"Hexahedra", "i", "iiiiiiiii"}, {"SubDomainFromGeom", "i", "iiii"}, {"SubDomainFromMesh", "i", "iiii"}, {"Corners", "i", "i"}, {"Ridges", "i", "i"}, {"RequiredVertices", "i", "i"}, {"RequiredEdges", "i", "i"}, {"RequiredTriangles", "i", "i"}, {"RequiredQuadrilaterals", "i", "i"}, {"TangentAtEdgeVertices", "i", "iii"}, {"NormalAtVertices", "i", "ii"}, {"NormalAtTriangleVertices", "i", "iii"}, {"NormalAtQuadrilateralVertices", "i", "iiii"}, {"AngleOfCornerBound", "", "r"}, {"Geometry", "", "c"}, {"VertexOnGeometricVertex", "i", "ii"}, {"VertexOnGeometricEdge", "i", "iir"}, {"VertexOnGeometricTriangle", "i", "iirr"}, {"VertexOnGeometricQuadrilateral", "i", "iirr"}, {"EdgeOnGeometricEdge", "i", "ii"}, {"TriangleOnGeometricTriangle", "i", "ii"}, {"TriangleOnGeometricQuadrilateral", "i", "ii"}, {"QuadrilateralOnGeometricTriangle", "i", "ii"}, {"QuadrilateralOnGeometricQuadrilateral", "i", "ii"}, {"MeshSupportOfVertices", "", "c"}, {"VertexOnSupportVertex", "i", "ii"}, {"VertexOnSupportEdge", "i", "iir"}, {"VertexOnSupportTriangle", "i", "iirr"}, {"VertexOnSupportQuadrilateral", "i", "iirr"}, {"VertexOnSupportTetrahedron", "i", "iirrr"}, {"VertexOnSupportPentahedron", "i", "iirrr"}, {"VertexOnSupportHexahedron", "i", "iirrr"}, {"CrackedEdges", "i", "ii"}, {"CrackedTriangles", "i", "ii"}, {"CrackedQuadrilaterals", "i", "ii"}, {"EquivalentEdges", "i", "ii"}, {"EquivalentTriangles", "i", "ii"}, {"EquivalentQuadrilaterals", "i", "ii"}, {"PhysicsReference", "i", "ic"}, {"IncludeFile", "", "c"}, {"BoundingBox", "", "drdr"}, {"Identifier", "", "c"}, {"IdentityOfGeometry", "", "c"}, {"IdentityOfMeshSupport", "", "c"}, {"End", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Tangents", "i", "dr"}, {"Normals", "i", "dr"}, {"TangentAtVertices", "i", "ii"}, {"SolAtVertices", "i", "sr"}, {"SolAtEdges", "i", "sr"}, {"SolAtTriangles", "i", "sr"}, {"SolAtQuadrilaterals", "i", "sr"}, {"SolAtTetrahedra", "i", "sr"}, {"SolAtPentahedra", "i", "sr"}, {"SolAtHexahedra", "i", "sr"}, {"DSolAtVertices", "i", "sr"}, {"ISolAtVertices", "i", "i"}, {"ISolAtEdges", "i", "ii"}, {"ISolAtTriangles", "i", "iii"}, {"ISolAtQuadrilaterals", "i", "iiii"}, {"ISolAtTetrahedra", "i", "iiii"}, {"ISolAtPentahedra", "i", "iiiiii"}, {"ISolAtHexahedra", "i", "iiiiiiii"}, {"Iterations","","i"}, {"Time","","r"}, {"VertexHack","","drdr"} }; /*----------------------------------------------------------*/ /* Prototypes of local procedures */ /*----------------------------------------------------------*/ static void write_kw(LM_mesh_struct *, int); static int read_int(LM_mesh_struct *); static void write_int(LM_mesh_struct *, int); static void file2kw_tab(LM_mesh_struct *); static void kw_tab2file(LM_mesh_struct *); static int expand_format(LM_mesh_struct *, int, char *); static void swap_bytes(void *, void *, int); static void read_sol_headers(LM_mesh_struct *); /*----------------------------------------------------------*/ /* Open a mesh file in read or write mode */ /*----------------------------------------------------------*/ int LM_open_mesh(const char *filename, int mode, LM_mesh_struct *mesh, ...) { int i; va_list pa; /*---------------------*/ /* MESH STRUCTURE INIT */ /*---------------------*/ /* Init the kw table */ for(i=0;i<=LM_NBKW;i++) { mesh->kw_counters[i] = 0; mesh->kw_pos[i][0] = 0; mesh->kw_pos[i][1] = 0; mesh->kw_pos[i][2] = 0; mesh->sol_headers[i] = NULL; } /* Allocate a string large enough to contain the full filename and path plus the ".meshb" extension. */ mesh->filename = (char *)calloc((strlen(filename) + 7), sizeof(char)); strcpy(mesh->filename, filename); /* Store the opening mode (read or write) and guess the filetype (binary or ascii) depending on the extension */ mesh->mode = mode; mesh->current_kw = mesh->type = 0; mesh->endian = 1; if(strstr(mesh->filename, ".meshb")) mesh->type |= (LM_BINARY | LM_MESH); else if(strstr(mesh->filename, ".mesh")) mesh->type |= (LM_ASCII | LM_MESH); else if(strstr(mesh->filename, ".solb")) mesh->type |= (LM_BINARY | LM_SOL); else if(strstr(mesh->filename, ".sol")) mesh->type |= (LM_ASCII | LM_SOL); else return(0); /* Open the file in the required mode and initialyse the mesh structure */ if(mesh->mode == LM_READ) { /*-----------------------*/ /* OPEN FILE FOR READING */ /*-----------------------*/ /* Create the name string and open the file */ if(!(mesh->handle = fopen(mesh->filename, "rb"))) return(0); /* Read the endian tag and the mesh version in binary */ if(mesh->type & LM_BINARY) { mesh->endian = read_int(mesh); if( (mesh->endian != 1) && (mesh->endian != 16777216) ) return(0); mesh->version = read_int(mesh); } /*------------*/ /* KW READING */ /*------------*/ /* Read the list of kw present in the file */ file2kw_tab(mesh); /* Check the mesh dimension */ if(!mesh->kw_counters[ LM_Dimension ]) return(0); LM_read_field(mesh, LM_Dimension, 1, &mesh->dimension); if( (mesh->dimension != 2) && (mesh->dimension != 3) ) return(0); /* Read the meshversion in ascii case */ if(mesh->type & LM_ASCII) LM_read_field(mesh, LM_MeshVersionFormatted, 1, &mesh->version); /* And read the extended sol headers */ read_sol_headers(mesh); } else if(mesh->mode == LM_WRITE) { /*-----------------------*/ /* OPEN FILE FOR WRITING */ /*-----------------------*/ /* Check if the user provided a valid dimension */ va_start(pa, mesh); mesh->dimension = va_arg(pa, int); va_end(pa); if( (mesh->dimension != 2) && (mesh->dimension != 3) ) return(0); /* If no extension has been provided, create a binary file */ if(!(mesh->handle = fopen(mesh->filename, "wb"))) return(0); /*------------*/ /* KW WRITING */ /*------------*/ /* Initialyse the required fields. The kw will be stored afterward. */ mesh->version = LM_MESH_VERSION; mesh->endian = 1; /* Write the mesh version */ if(mesh->type & LM_ASCII) LM_write_field(mesh, LM_MeshVersionFormatted, 1, &mesh->version); else { write_int(mesh, mesh->endian); write_int(mesh, mesh->version); } /* Write the mesh dimension */ LM_write_field(mesh, LM_Dimension, 1, &mesh->dimension); } else return(0); return(1); } /*----------------------------------------------------------*/ /* Close a meshfile in the right way */ /*----------------------------------------------------------*/ int LM_close_mesh(LM_mesh_struct *mesh) { if(mesh->mode == LM_WRITE) { /* Test if the user wrote the "End" kw */ if(!mesh->kw_counters[ LM_End ]) LM_write_field(mesh, LM_End, 0, NULL); /* Write down the number lines written in each field to the file */ kw_tab2file(mesh); } if(fclose(mesh->handle)) return(0); else return(1); } /*----------------------------------------------------------*/ /* Bufferized read of a whole orpart of a field */ /*----------------------------------------------------------*/ int LM_read_field(LM_mesh_struct *mesh, int kw_code, int nbl, void *buffer) { int i, j, swaped, size, *int_buffer = (int *)buffer, string_size; float *flt_buffer = (float *)buffer; char format[256], letter, str_buf[256]; /* Check if the kw code is valid */ if( (kw_code < 1) || (kw_code > LM_NBKW) ) return(0); /* Check if this kw has a format */ if(!strlen(LM_kw_table[ kw_code ][2])) return(0); /* If this kw is only a header, the number of lines to be read is set to one */ if(!strlen(LM_kw_table[ kw_code ][1])) nbl = 1; /* Check if the user is not asking more lines than the remaining lines in the file */ if(nbl > mesh->kw_counters[ kw_code ] - mesh->kw_pos[ kw_code ][2]) nbl = mesh->kw_counters[ kw_code ] - mesh->kw_pos[ kw_code ][2]; if(!nbl) return(0); /* Set the curent position in file to the begining of this kw's data */ fseek(mesh->handle, mesh->kw_pos[ kw_code ][1], SEEK_SET); /* Transform the internal format into a "c" format string for the scanf and compute the size of field's line in order to compute the right adresses in the buffer */ size = expand_format(mesh, kw_code, format); if(mesh->type & LM_ASCII) { for(i=0;ihandle, "%d", &int_buffer[ i * size + j ]); else if(format[j] == 'r') fscanf(mesh->handle, "%g", &flt_buffer[ i * size + j ]); else if(format[j] == 'c') { string_size = 0; do { fscanf(mesh->handle, "%c", &letter); }while(letter != '"'); do { fscanf(mesh->handle, "%c", &letter); str_buf[ string_size++ ] = letter; }while( (letter != '"') && (string_size <= 256) ); str_buf[ string_size-1 ] = 0; memset(&flt_buffer[ i * size + j ], 0, 256); strcpy((char *)&flt_buffer[ i * size + j ], str_buf); } } else { fread(buffer, nbl * size * 4, 1, mesh->handle); /* Swap the bytes in the whole buffer in case of different endian */ if(mesh->endian != 1) for(i=0;ikw_pos[ kw_code ][1] = ftell(mesh->handle); mesh->kw_pos[ kw_code ][2] += nbl; return(nbl); } /*----------------------------------------------------------*/ /* Bufferized write of a whole field or part of it */ /*----------------------------------------------------------*/ int LM_write_field(LM_mesh_struct *mesh, int kw_code, int nbl, void *buffer, ...) { int i, j, size, *int_buffer = (int *)buffer, nbsol; float *flt_buffer = (float *)buffer; char format[256]; va_list pa; /* Check if the kw code is valid */ if( (kw_code < 1) || (kw_code > LM_NBKW) ) return(0); /* Read further arguments if this kw is solution field and the extra header was not provided by the user */ if(!mesh->sol_headers[ kw_code ] && !strcmp(LM_kw_table[ kw_code ][2], "sr")) { va_start(pa, buffer); nbsol = va_arg(pa, int); if(!(mesh->sol_headers[ kw_code ] = malloc((nbsol+2) * sizeof(int)))) return(0); mesh->sol_headers[ kw_code ][0] = nbsol; mesh->sol_headers[ kw_code ][1] = 0; for(i=1;i<=nbsol;i++) { mesh->sol_headers[ kw_code ][i+1] = va_arg(pa, int); switch(mesh->sol_headers[ kw_code ][i+1]) { case 1 : mesh->sol_headers[ kw_code ][1] += 1; break; case 2 : mesh->sol_headers[ kw_code ][1] += mesh->dimension; break; case 3 : mesh->sol_headers[ kw_code ][1] += (mesh->dimension * (mesh->dimension+1)) / 2; break; case 4 : mesh->sol_headers[ kw_code ][1] += mesh->dimension * mesh->dimension; break; } } va_end(pa); } /* If this kw is only a header, the number of lines to be read is set to one */ if(!strlen(LM_kw_table[ kw_code ][1])) nbl = 1; if(!mesh->kw_counters[ kw_code ]) write_kw(mesh, kw_code); mesh->kw_counters[ kw_code ] += nbl; /* Check if this kw has a format */ if(!strlen(LM_kw_table[ kw_code ][2])) return(0); size = expand_format(mesh, kw_code, format); if(mesh->type & LM_ASCII) { for(i=0;ihandle, "%d ", int_buffer[ i * size + j ]); else if(format[j] == 'r') fprintf(mesh->handle, "%g ", flt_buffer[ i * size + j ]); else if(format[j] == 'c') { fputc('"', mesh->handle); fprintf(mesh->handle, "%s", (char *)&flt_buffer[ i * size + j ]); fputc('"', mesh->handle); } fprintf(mesh->handle, "\n"); } } else fwrite(buffer, nbl * size * 4, 1, mesh->handle); mesh->kw_pos[ kw_code ][1] = ftell(mesh->handle); return(1); } /*----------------------------------------------------------*/ /* Single line read */ /*----------------------------------------------------------*/ int LM_read_line(LM_mesh_struct *mesh, int kw_code, ...) { float buffer[10], *ptr_flt; int i, size; char format[256]; va_list pa; /* Check wether this kw is not a simple header */ if(!strlen(LM_kw_table[ kw_code ][2])) return(0); /* Get a one line buffer */ LM_read_field(mesh, kw_code, 1, buffer); /* Start decoding the arguments */ va_start(pa, kw_code); size = expand_format(mesh, kw_code, format); for(i=0;itype & LM_ASCII) { /* Scan each string of the file until the end */ while(fscanf(mesh->handle, "%s", str) != EOF) { /* Fast test in order to reject quickly the numeric values */ if(isalpha(str[0])) { /* Search which kw code this string is associated with */ for(kw_code=1; kw_code<= LM_NBKW; kw_code++) if(!strcmp(str, LM_kw_table[ kw_code ][0])) { /* The base position (0) in the file is set right after the kw */ mesh->kw_pos[ kw_code ][0] = ftell(mesh->handle); /* If this kw has a header, read the number of lines */ if(!strcmp(LM_kw_table[ kw_code ][1], "i")) mesh->kw_counters[ kw_code ] = read_int(mesh); else mesh->kw_counters[ kw_code ] = 1; /* The curent position (1) in the file is set right before the data */ mesh->kw_pos[ kw_code ][1] = ftell(mesh->handle); break; } } else if(str[0] == '#') while(fgetc(mesh->handle) != '\n'); } } else { /* Jump through kw positions in the file */ do { kw_code = read_int(mesh); /* Check if this kw belongs to this mesh version */ if( (kw_code >= 1) && (kw_code <= LM_NBKW) ) { /* The base position (0) in the file is set right after the kw */ mesh->kw_pos[ kw_code ][0] = ftell(mesh->handle); /* Read the next kw position */ next_pos = read_int(mesh); /* If this kw has a header, read the number of lines */ if(!strcmp(LM_kw_table[ kw_code ][1], "i")) mesh->kw_counters[ kw_code ] = read_int(mesh); else mesh->kw_counters[ kw_code ] = 1; /* The curent position (1) in the file is set right before the data */ mesh->kw_pos[ kw_code ][1] = ftell(mesh->handle); } else { /* Otherwise, read the next kw position in order to skip these unknown kw */ next_pos = read_int(mesh); } /* Go to the next kw */ if(next_pos) fseek(mesh->handle, next_pos, SEEK_SET); }while(next_pos); } } /*----------------------------------------------------------*/ /* Update the number of lines written for each kw */ /*----------------------------------------------------------*/ static void kw_tab2file(LM_mesh_struct *mesh) { int i; for(i=1;i<=LM_NBKW;i++) if( mesh->kw_counters[i] && strlen(LM_kw_table[i][2]) ) write_kw(mesh, i); } /*----------------------------------------------------------*/ /* Write the string associated with the kw code */ /*----------------------------------------------------------*/ static void write_kw(LM_mesh_struct *mesh, int kw_code) { int i; if(mesh->type & LM_ASCII) { /* Test if it is the first time this kw is written */ if(!mesh->kw_counters[ kw_code ]) { /* If so, write the string and reserve some place afterward in order to store the number of lines */ fprintf(mesh->handle, "\n%s\n", LM_kw_table[ kw_code ][0]); mesh->kw_pos[ kw_code ][0] = ftell(mesh->handle); if(!strcmp("i", LM_kw_table[ kw_code ][1])) fprintf(mesh->handle, " \n"); /* In case of solution field, write the extended header at once */ if(mesh->sol_headers[ kw_code ]) { fprintf(mesh->handle, "%d ", mesh->sol_headers[ kw_code ][0]); for(i=1;i<=mesh->sol_headers[ kw_code ][0];i++) fprintf(mesh->handle, "%d ", mesh->sol_headers[ kw_code ][i+1]); fprintf(mesh->handle, "\n\n"); } /* Store the positions right after the kw in order to write the number of lines at closing time. Store the position right before the data for the write_field process. */ mesh->kw_pos[ kw_code ][1] = ftell(mesh->handle); } else { /* If this kw has already be written in the file and has a header, go to pos(0) and write down the final value */ if(strcmp("i", LM_kw_table[ kw_code ][1])) return; fseek(mesh->handle, mesh->kw_pos[ kw_code][0], SEEK_SET); fprintf(mesh->handle, "%d\n", mesh->kw_counters[ kw_code ]); } } else { /* Test if it is the first time this kw is written */ if(!mesh->kw_counters[ kw_code ]) { /* If so, write the code, store the position afterward, reserve an int for the next kw position and write the number of lines */ write_int(mesh, kw_code); mesh->kw_pos[ kw_code ][0] = ftell(mesh->handle); write_int(mesh, 0); /* Set the next kw pos in the previously written kw */ if(mesh->current_kw) { fseek(mesh->handle, mesh->kw_pos[ mesh->current_kw ][0], SEEK_SET); write_int(mesh, mesh->kw_pos[ kw_code ][0] - 4); fseek(mesh->handle, mesh->kw_pos[ kw_code ][0] + 4, SEEK_SET); } mesh->current_kw = kw_code; if(!strcmp("i", LM_kw_table[ kw_code ][1])) write_int(mesh, 0); /* In case of solution field, write the extended header at once */ if(mesh->sol_headers[ kw_code ]) { write_int(mesh, mesh->sol_headers[ kw_code ][0]); for(i=1;i<=mesh->sol_headers[ kw_code ][0];i++) write_int(mesh, mesh->sol_headers[ kw_code ][i+1]); } mesh->kw_pos[ kw_code ][1] = ftell(mesh->handle); } else { /* Write the number of lines written at closing time */ if(strcmp("i", LM_kw_table[ kw_code ][1])) return; fseek(mesh->handle, mesh->kw_pos[ kw_code ][0] + 4, SEEK_SET); write_int(mesh, mesh->kw_counters[ kw_code ]); } } } /*----------------------------------------------------------*/ /* Read an integer in a mesh file */ /*----------------------------------------------------------*/ static int read_int(LM_mesh_struct *mesh) { int swaped, integer = 0; if(mesh->type & LM_ASCII) fscanf(mesh->handle, "%d", &integer); else { /* Read a 4 bytes block in the file */ fread(&integer, 4, 1, mesh->handle); if(mesh->endian != 1) { swap_bytes((void *)&integer, (void *)&swaped, 4); integer = swaped; } } return(integer); } /*----------------------------------------------------------*/ /* Write an integer in a mesh file */ /*----------------------------------------------------------*/ static void write_int(LM_mesh_struct *mesh, int integer) { if(mesh->type & LM_ASCII) fprintf(mesh->handle, "%d ", integer); else fwrite(&integer, 4, 1, mesh->handle); } /*----------------------------------------------------------*/ /* Convert little endian <-> big endian */ /*----------------------------------------------------------*/ static void swap_bytes(void *c1, void *c2, int nbytes) { int k; char *c11, *c22; c11 = (char*)c1; c22 = (char*)c2; for (k=0; kdimension times */ duplicate_next = mesh->dimension; } else if(in_format[i] == 's') { /* 's' means duplicate the next character mesh->solsize times */ duplicate_next = mesh->sol_headers[ kw_code ][1]; } } /* Return the sum of item to be read */ return(size); } /*----------------------------------------------------------*/ /* Read the extended sol headers */ /*----------------------------------------------------------*/ static void read_sol_headers(LM_mesh_struct *mesh) { int i, j, nbsol, solsize; for(i=1;i<=LM_NBKW;i++) { /* If the kw is a special Sol field, read the extended header */ if(!mesh->kw_counters[i] || strcmp(LM_kw_table[i][2], "sr")) continue; /* Set the curent position in file to the begining of this kw's data */ fseek(mesh->handle, mesh->kw_pos[i][1], SEEK_SET); nbsol = read_int(mesh); if( (mesh->sol_headers[i] = malloc((nbsol+2) * sizeof(int)))) { mesh->sol_headers[i][0] = nbsol; solsize = 0; for(j=1;j<=nbsol;j++) { mesh->sol_headers[i][j+1] = read_int(mesh); switch(mesh->sol_headers[i][j+1]) { case LM_SCALAR : solsize += 1; break; case LM_VECTOR : solsize += mesh->dimension; break; case LM_SYM_MATRIX : solsize += (mesh->dimension * (mesh->dimension+1)) / 2; break; case LM_MATRIX : solsize += mesh->dimension * mesh->dimension; break; } mesh->sol_headers[i][1] = solsize; } mesh->kw_pos[i][1] = ftell(mesh->handle); } } } freefem++-3.61-1/src/libMesh/libmesh5.h000644 000767 000024 00000011171 13256636774 017657 0ustar00hechtstaff000000 000000 /*----------------------------------------------------------*/ /* */ /* LIBMESH V 5.0 */ /* */ /*----------------------------------------------------------*/ /* */ /* Description: handle .meshb file format I/O */ /* Author: Loic MARECHAL */ /* Creation date: feb 16 2007 */ /* Last modification: apr 10 2007 */ /* */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Defines */ /*----------------------------------------------------------*/ #define GmfStrSiz 1024 #define GmfMaxTyp 20 #define GmfMaxKwd 79 #define GmfMshVer 1 #define GmfRead 1 #define GmfWrite 2 #define GmfSca 1 #define GmfVec 2 #define GmfSymMat 3 #define GmfMat 4 #define GmfFloat 1 #define GmfDouble 2 enum GmfKwdCod { GmfReserved1, \ GmfVersionFormatted, \ GmfReserved2, \ GmfDimension, \ GmfVertices, \ GmfEdges, \ GmfTriangles, \ GmfQuadrilaterals, \ GmfTetrahedra, \ GmfPentahedra, \ GmfHexahedra, \ GmfReserved3, \ GmfReserved4, \ GmfCorners, \ GmfRidges, \ GmfRequiredVertices, \ GmfRequiredEdges, \ GmfRequiredTriangles, \ GmfRequiredQuadrilaterals, \ GmfTangentAtEdgeVertices, \ GmfNormalAtVertices, \ GmfNormalAtTriangleVertices, \ GmfNormalAtQuadrilateralVertices, \ GmfAngleOfCornerBound, \ GmfReserved5, \ GmfReserved6, \ GmfReserved7, \ GmfReserved8, \ GmfReserved9, \ GmfReserved10, \ GmfReserved11, \ GmfReserved12, \ GmfReserved13, \ GmfReserved14, \ GmfReserved15, \ GmfReserved16, \ GmfReserved17, \ GmfReserved18, \ GmfReserved19, \ GmfReserved20, \ GmfReserved21, \ GmfReserved22, \ GmfReserved23, \ GmfReserved24, \ GmfReserved25, \ GmfReserved26, \ GmfReserved27, \ GmfReserved28, \ GmfReserved29, \ GmfReserved30, \ GmfBoundingBox, \ GmfReserved31, \ GmfReserved32, \ GmfReserved33, \ GmfEnd, \ GmfReserved34, \ GmfReserved35, \ GmfReserved36, \ GmfReserved37, \ GmfTangents, \ GmfNormals, \ GmfTangentAtVertices, \ GmfSolAtVertices, \ GmfSolAtEdges, \ GmfSolAtTriangles, \ GmfSolAtQuadrilaterals, \ GmfSolAtTetrahedra, \ GmfSolAtPentahedra, \ GmfSolAtHexahedra, \ GmfDSolAtVertices, \ GmfISolAtVertices, \ GmfISolAtEdges, \ GmfISolAtTriangles, \ GmfISolAtQuadrilaterals, \ GmfISolAtTetrahedra, \ GmfISolAtPentahedra, \ GmfISolAtHexahedra, \ GmfIterations, \ GmfTime, \ GmfReserved38 }; /*----------------------------------------------------------*/ /* External procedures */ /*----------------------------------------------------------*/ extern int GmfOpenMesh(const char *, int, ...); extern int GmfCloseMesh(int); extern int GmfStatKwd(int, int, ...); extern int GmfGotoKwd(int, int); extern int GmfSetKwd(int, int, ...); extern void GmfGetLin(int, int, ...); extern void GmfSetLin(int, int, ...); /*----------------------------------------------------------*/ /* Fortran 77 API */ /*----------------------------------------------------------*/ #if defined(F77_NO_UNDER_SCORE) #define call(x) x #else #define call(x) x ## _ #endif int call(gmfopenmeshf77)(char *, int *, int *, int *, int); int call(gmfclosemeshf77)(int *); int call(gmfstatkwdf77)(int *, int *, int *, int *, int *); int call(gmfgotokwdf77)(int *, int *); int call(gmfsetkwdf77)(int *, int *, int *, int *, int *); int call(gmfgetvertex2df77)(int *, float *, float *, int *); int call(gmfgetvertex3df77)(int *, float *, float *, float *, int *); int call(gmfsetvertex2df77)(int *, float *, float *, int *); int call(gmfsetvertex3df77)(int *, float *, float *, float *, int *); int call(gmfgettrianglef77)(int *, int *, int *, int *, int *); int call(gmfsettrianglef77)(int *, int *, int *, int *, int *); int call(gmfgettetrahedronf77)(int *, int *, int *, int *, int *, int *); int call(gmfsettetrahedronf77)(int *, int *, int *, int *, int *, int *); int call(gmfgetedgef77)(int *, int *, int *, int *); int call(gmfsetedgef77)(int *, int *, int *, int *); int call(gmfgetquadrilateralf77)(int *, int *, int *, int *, int *, int *); int call(gmfsetquadrilateralf77)(int *, int *, int *, int *, int *, int *); int call(gmfgethexahedronf77)(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); int call(gmfsethexahedronf77)(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); int call(gmfsetsolf77)(int *, int *, int *); int call(gmfgetsolf77)(int *, int *, int *); /*----------------------------------------------------------*/ /* Transmesh private API */ /*----------------------------------------------------------*/ #ifdef TRANSMESH extern char *KwdFmt[ GmfMaxKwd + 1 ][3]; extern int GmfCpyLin(int, int, int); #endif freefem++-3.61-1/src/libMesh/eigenv.h000644 000767 000024 00000000300 13256636774 017414 0ustar00hechtstaff000000 000000 #ifdef __cplusplus extern "C" { #endif int eigenv(int symmat,double *mat,double lambda[3],double v[3][3]); int eigen2(double *mm,double *lambda,double vp[2][2]); #ifdef __cplusplus } #endif freefem++-3.61-1/src/libMesh/Makefile.am000644 000767 000024 00000000541 13256636774 020031 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. noinst_LIBRARIES=libMesh.a libMesh_a_SOURCES= \ chrono.c eigenv.c libmesh3.c libmesh5.c memory.c \ chrono.h eigenv.h libmesh3.h libmesh5.h memory.h freefem++-3.61-1/src/libMesh/memory.h000644 000767 000024 00000000625 13256636774 017461 0ustar00hechtstaff000000 000000 #ifdef __cplusplus extern "C" { #endif #include #include /* prototype (re)definitions */ void *M_malloc(size_t size,char *call); void *M_calloc(size_t nelem,size_t elsize,char *call); void *M_realloc(void *ptr, size_t size,char *call); void M_free(void *ptr); /* ptototypes : tools */ int M_memLeak(); void M_memDump(); size_t M_memSize(); #ifdef __cplusplus } #endif freefem++-3.61-1/src/libMesh/chrono.c000644 000767 000024 00000003257 13256636774 017440 0ustar00hechtstaff000000 000000 /* * simulation of a chronograph * in : tim * out: tim.dtim = elapsed time in micro-secs * tim.ptim = elapsed time in secs * tim.call = number of calls * * Written by Pascal J. Frey * email: Pascal.Frey@inria.fr, 1999 */ #ifdef __cplusplus extern "C" { #endif #include #include #include #include "chrono.h" /* return elapsed time in secs. */ static double diftim(time_t t2,time_t t1) { struct tm *ptm; double tim; int hh1,mm1,ss1,hh2,mm2,ss2; ptm = localtime(&t1); hh1 = ptm->tm_hour; mm1 = ptm->tm_min; ss1 = ptm->tm_sec; ptm = localtime(&t2); hh2 = ptm->tm_hour; mm2 = ptm->tm_min; ss2 = ptm->tm_sec; if ( hh2 < hh1 ) hh2 += 24; tim = 3600.0*(hh2-hh1); tim += 60.0*(mm2-mm1); tim += ss2-ss1; return(tim); } /* get system and user times in micro-seconds */ void chrono(int cmode,mytime *ptt) { time_t tt; if ( cmode == RESET ) { ptt->dtim = clock(); ptt->ctim = 0.0f; ptt->ptim = 0; ptt->call = 0; } else { ptt->dtim = difftime(clock(),ptt->dtim); /* in secs */ if ( cmode == ON ) { ptt->ptim = time(NULL); ptt->call++; } else if ( cmode == OFF ) { tt = time(NULL); ptt->ctim += diftim(tt,ptt->ptim); ptt->ptim = 0; } } } /* return time (converted in secs */ double gttime(mytime t) { if ( t.ctim < MAXCLK ) return(t.dtim / (double)CLOCKS_PER_SEC); else return(t.ctim); } /* initialize time table */ void tminit(mytime *t,int maxtim) { int k; for (k=0; k #include #include /* seeking 1.e-05 accuracy */ /* Modif F. Hecht because in some case the result a wrong */ #define EPSD 1.e-12 #define EPSD2 1.e-10 #define EPS6 5.e-06 #define EPS 1.e-06 #define EPSX2 2.e-06 #define MAXTOU 50 /* check if numbers are equal */ #define egal(x,y) ( \ ( ((x) == 0.0f) ? (fabs(y) < EPS) : \ ( ((y) == 0.0f) ? (fabs(x) < EPS) : \ (fabs((x)-(y)) / (fabs(x) + fabs(y)) < EPSX2) ) ) ) static double Id[3][3] = { { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0} }; /* find root(s) of polynomial: P(x)= x^3+bx^2+cx+d return 1: 3 roots, 2: 2 roots, 3: 1 root */ static int newton3(double p[4],double x[3]) { double b,c,d,da,db,dc,epsd; double delta,fx,dfx,dxx; double fdx0,fdx1,dx0,dx1,x1,x2; int it,n; /* coeffs polynomial, a=1 */ b = p[2]; c = p[1]; d = p[0]; n = 1; /* 1st derivative of f */ da = 3.0; db = 2.0*b; /* solve 2nd order eqn */ delta = db*db - 4.0*da*c; epsd = db*db*EPSD2; /* inflexion (f'(x)=0, x=-b/2a) */ x1 = -db / 6.0f; n = 1; if ( delta > epsd ) { delta = sqrt(delta); dx0 = (-db + delta) / 6.0; dx1 = (-db - delta) / 6.0; /* Horner */ fdx0 = d + dx0*(c+dx0*(b+dx0)); fdx1 = d + dx1*(c+dx1*(b+dx1)); if ( fabs(fdx0) < EPSD ) { /* dx0: double root, compute single root */ n = 2; x[0] = dx0; x[1] = dx0; x[2] = -b - 2.0*dx0; /* check if P(x) = 0 */ fx = d + x[2]*(c+x[2]*(b+x[2])); if ( fabs(fx) > EPSD2 ) { #ifdef DDEBUG fprintf(stderr," ## ERR 9100, newton3: fx= %E\n",fx); #endif return(0); } return(n); } else if ( fabs(fdx1) < EPSD ) { /* dx1: double root, compute single root */ n = 2; x[0] = dx1; x[1] = dx1; x[2] = -b - 2.0*dx1; /* check if P(x) = 0 */ fx = d + x[2]*(c+x[2]*(b+x[2])); if ( fabs(fx) > EPSD2 ) { #ifdef DDEBUG fprintf(stderr," ## ERR 9100, newton3: fx= %E\n",fx); #endif return(0); } return(n); } } else if ( fabs(delta) < epsd ) { /* triple root */ n = 3; x[0] = x1; x[1] = x1; x[2] = x1; /* check if P(x) = 0 */ fx = d + x[0]*(c+x[0]*(b+x[0])); if ( fabs(fx) > EPSD2 ) { #ifdef DDEBUG fprintf(stderr," ## ERR 9100, newton3: fx= %E\n",fx); #endif return(0); } return(n); } else { #ifdef DDEBUG fprintf(stderr," ## ERR 9101, newton3: no real roots\n"); #endif return(0); } /* Newton method: find one root (middle) starting point: P"(x)=0 */ x1 = -b / 3.0; dfx = c + b*x1; fx = d + x1*(c -2.0*x1*x1); it = 0; do { x2 = x1 - fx / dfx; fx = d + x2*(c+x2*(b+x2)); if ( fabs(fx) < EPSD ) { x[0] = x2; break; } dfx = c + x2*(db + da*x2); /* check for break-off condition */ dxx = fabs((x2-x1) / x2); if ( dxx < 1.0e-10 ) { x[0] = x2; if ( fabs(fx) > EPSD2 ) { fprintf(stderr," ## ERR 9102, newton3, no root found (fx %E).\n",fx); return(0); } break; } else x1 = x2; } while ( ++it < MAXTOU ); if ( it == MAXTOU ) { x[0] = x1; fx = d + x1*(c+(x1*(b+x1))); if ( fabs(fx) > EPSD2 ) { fprintf(stderr," ## ERR 9102, newton3, no root found (fx %E).\n",fx); return(0); } } /* solve 2nd order equation P(x) = (x-sol(1))* (x^2+bb*x+cc) */ db = b + x[0]; dc = c + x[0]*db; delta = db*db - 4.0*dc; if ( delta <= 0.0 ) { fprintf(stderr," ## ERR 9103, newton3, det = 0.\n"); return(0); } delta = sqrt(delta); x[1] = 0.5 * (-db+delta); x[2] = 0.5 * (-db-delta); #ifdef DDEBUG /* check for root accuracy */ fx = d + x[1]*(c+x[1]*(b+x[1])); if ( fabs(fx) > EPSD2 ) { fprintf(stderr," ## ERR 9104, newton3: fx= %E x= %E\n",fx,x[1]); return(0); } fx = d + x[2]*(c+x[2]*(b+x[2])); if ( fabs(fx) > EPSD2 ) { fprintf(stderr," ## ERR 9104, newton3: fx= %E x= %E\n",fx,x[2]); return(0); } #endif return(n); } /* find eigenvalues and vectors of a 3x3 symmetric definite * positive matrix * return order of eigenvalues (1,2,3) or 0 if failed */ int eigenv(int symmat,double *mat,double lambda[3],double v[3][3]) { double a11,a12,a13,a21,a22,a23,a31,a32,a33; double aa,bb,cc,dd,ee,ii,vx1[3],vx2[3],vx3[3],dd1,dd2,dd3; double maxd,maxm,valm,p[4],w1[3],w2[3],w3[3]; int k,n; /* default */ memcpy(v,Id,9*sizeof(double)); if ( symmat ) { lambda[0] = (double)mat[0]; lambda[1] = (double)mat[3]; lambda[2] = (double)mat[5]; maxm = fabs(mat[0]); for (k=1; k<6; k++) { valm = fabs(mat[k]); if ( valm > maxm ) maxm = valm; } /* single float accuracy */ if ( maxm < EPS6 ) return(1); /* normalize matrix */ dd = 1.0 / maxm; a11 = mat[0] * dd; a12 = mat[1] * dd; a13 = mat[2] * dd; a22 = mat[3] * dd; a23 = mat[4] * dd; a33 = mat[5] * dd; /* diagonal matrix */ maxd = fabs(a12); valm = fabs(a13); if ( valm > maxd ) maxd = valm; valm = fabs(a23); if ( valm > maxd ) maxd = valm; if ( maxd < EPSD ) return(1); a21 = a12; a31 = a13; a32 = a23; /* build characteristic polynomial P(X) = X^3 - trace X^2 + (somme des mineurs)X - det = 0 */ aa = a11*a22; bb = a23*a32; cc = a12*a21; dd = a13*a31; p[0] = a11*bb + a33*(cc-aa) + a22*dd -2.0*a12*a13*a23; p[1] = a11*(a22 + a33) + a22*a33 - bb - cc - dd; p[2] = -a11 - a22 - a33; p[3] = 1.0; } else { lambda[0] = (double)mat[0]; lambda[1] = (double)mat[4]; lambda[2] = (double)mat[8]; maxm = fabs(mat[0]); for (k=1; k<9; k++) { valm = fabs(mat[k]); if ( valm > maxm ) maxm = valm; } if ( maxm < EPS6 ) return(1); /* normalize matrix */ dd = 1.0 / maxm; a11 = mat[0] * dd; a12 = mat[1] * dd; a13 = mat[2] * dd; a21 = mat[3] * dd; a22 = mat[4] * dd; a23 = mat[5] * dd; a31 = mat[6] * dd; a32 = mat[7] * dd; a33 = mat[8] * dd; /* diagonal matrix */ maxd = fabs(a12); valm = fabs(a13); if ( valm > maxd ) maxd = valm; valm = fabs(a23); if ( valm > maxd ) maxd = valm; valm = fabs(a21); if ( valm > maxd ) maxd = valm; valm = fabs(a31); if ( valm > maxd ) maxd = valm; valm = fabs(a32); if ( valm > maxd ) maxd = valm; if ( maxd < EPSD ) return(1); /* build characteristic polynomial P(X) = X^3 - trace X^2 + (somme des mineurs)X - det = 0 */ aa = a22*a33 - a23*a32; bb = a23*a31 - a21*a33; cc = a21*a32 - a31*a22; ee = a11*a33 - a13*a31; ii = a11*a22 - a12*a21; p[0] = -a11*aa - a12*bb - a13*cc; p[1] = aa + ee + ii; p[2] = -a11 - a22 - a33; p[3] = 1.0; } /* solve polynomial (find roots using newton) */ n = newton3(p,lambda); if ( n <= 0 ) return(0); /* compute eigenvectors: an eigenvalue belong to orthogonal of Im(A-lambda*Id) */ v[0][0] = 1.0; v[0][1] = v[0][2] = 0.0; v[1][1] = 1.0; v[1][0] = v[1][2] = 0.0; v[2][2] = 1.0; v[2][0] = v[2][1] = 0.0; w1[1] = a12; w1[2] = a13; w2[0] = a21; w2[2] = a23; w3[0] = a31; w3[1] = a32; if ( n == 1 ) { /* vk = crsprd(wi,wj) */ for (k=0; k<3; k++) { w1[0] = a11 - lambda[k]; w2[1] = a22 - lambda[k]; w3[2] = a33 - lambda[k]; /* cross product vectors in (Im(A-lambda(i) Id) ortho */ vx1[0] = w1[1]*w3[2] - w1[2]*w3[1]; vx1[1] = w1[2]*w3[0] - w1[0]*w3[2]; vx1[2] = w1[0]*w3[1] - w1[1]*w3[0]; dd1 = vx1[0]*vx1[0] + vx1[1]*vx1[1] + vx1[2]*vx1[2]; vx2[0] = w1[1]*w2[2] - w1[2]*w2[1]; vx2[1] = w1[2]*w2[0] - w1[0]*w2[2]; vx2[2] = w1[0]*w2[1] - w1[1]*w2[0]; dd2 = vx2[0]*vx2[0] + vx2[1]*vx2[1] + vx2[2]*vx2[2]; vx3[0] = w2[1]*w3[2] - w2[2]*w3[1]; vx3[1] = w2[2]*w3[0] - w2[0]*w3[2]; vx3[2] = w2[0]*w3[1] - w2[1]*w3[0]; dd3 = vx3[0]*vx3[0] + vx3[1]*vx3[1] + vx3[2]*vx3[2]; /* find vector of max norm */ if ( dd1 > dd2 ) { if ( dd1 > dd3 ) { dd1 = 1.0 / sqrt(dd1); v[k][0] = vx1[0] * dd1; v[k][1] = vx1[1] * dd1; v[k][2] = vx1[2] * dd1; } else { dd3 = 1.0 / sqrt(dd3); v[k][0] = vx3[0] * dd3; v[k][1] = vx3[1] * dd3; v[k][2] = vx3[2] * dd3; } } else { if ( dd2 > dd3 ) { dd2 = 1.0 / sqrt(dd2); v[k][0] = vx2[0] * dd2; v[k][1] = vx2[1] * dd2; v[k][2] = vx2[2] * dd2; } else { dd3 = 1.0 / sqrt(dd3); v[k][0] = vx3[0] * dd3; v[k][1] = vx3[1] * dd3; v[k][2] = vx3[2] * dd3; } } } } /* (vp1,vp2) double, vp3 simple root */ else if ( n == 2 ) { w1[0] = a11 - lambda[2]; w2[1] = a22 - lambda[2]; w3[2] = a33 - lambda[2]; /* cross product */ vx1[0] = w1[1]*w3[2] - w1[2]*w3[1]; vx1[1] = w1[2]*w3[0] - w1[0]*w3[2]; vx1[2] = w1[0]*w3[1] - w1[1]*w3[0]; dd1 = vx1[0]*vx1[0] + vx1[1]*vx1[1] + vx1[2]*vx1[2]; vx2[0] = w1[1]*w2[2] - w1[2]*w2[1]; vx2[1] = w1[2]*w2[0] - w1[0]*w2[2]; vx2[2] = w1[0]*w2[1] - w1[1]*w2[0]; dd2 = vx2[0]*vx2[0] + vx2[1]*vx2[1] + vx2[2]*vx2[2]; vx3[0] = w2[1]*w3[2] - w2[2]*w3[1]; vx3[1] = w2[2]*w3[0] - w2[0]*w3[2]; vx3[2] = w2[0]*w3[1] - w2[1]*w3[0]; dd3 = vx3[0]*vx3[0] + vx3[1]*vx3[1] + vx3[2]*vx3[2]; /* find vector of max norm */ if ( dd1 > dd2 ) { if ( dd1 > dd3 ) { dd1 = 1.0 / sqrt(dd1); v[2][0] = vx1[0] * dd1; v[2][1] = vx1[1] * dd1; v[2][2] = vx1[2] * dd1; } else { dd3 = 1.0 / sqrt(dd3); v[2][0] = vx3[0] * dd3; v[2][1] = vx3[1] * dd3; v[2][2] = vx3[2] * dd3; } } else { if ( dd2 > dd3 ) { dd2 = 1.0 / sqrt(dd2); v[2][0] = vx2[0] * dd2; v[2][1] = vx2[1] * dd2; v[2][2] = vx2[2] * dd2; } else { dd3 = 1.0 / sqrt(dd3); v[2][0] = vx3[0] * dd3; v[2][1] = vx3[1] * dd3; v[2][2] = vx3[2] * dd3; } } /* compute v1 and v2 in Im(A-vp3*Id) */ dd1 = w1[0]*w1[0] + w1[1]*w1[1] + w1[2]*w1[2]; dd2 = w2[0]*w2[0] + w2[1]*w2[1] + w2[2]*w2[2]; if ( dd1 > dd2 ) { dd1 = 1.0 / sqrt(dd1); v[0][0] = w1[0]*dd1; v[0][1] = w1[1]*dd1; v[0][2] = w1[2]*dd1; } else { dd2 = 1.0 / sqrt(dd2); v[0][0] = w2[0]*dd2; v[0][1] = w2[1]*dd2; v[0][2] = w2[2]*dd2; } /* 3rd vector orthogonal */ v[1][0] = v[2][1]*v[0][2] - v[2][2]*v[0][1]; v[1][1] = v[2][2]*v[0][0] - v[2][0]*v[0][2]; v[1][2] = v[2][0]*v[0][1] - v[2][1]*v[0][0]; dd1 = v[1][0]*v[1][0] + v[1][1]*v[1][1] + v[1][2]*v[1][2]; dd1 = 1.0 / sqrt(dd1); v[1][0] *= dd1; v[1][1] *= dd1; v[1][2] *= dd1; } lambda[0] *= maxm; lambda[1] *= maxm; lambda[2] *= maxm; /* check accuracy */ /*------------------------------------------------------------------- if ( ddebug && symmat ) { double err,tmpx,tmpy,tmpz; float m[6]; int i,j; k = 0; for (i=0; i<3; i++) for (j=i; j<3; j++) m[k++] = lambda[0]*v[i][0]*v[j][0] + lambda[1]*v[i][1]*v[j][1] + lambda[2]*v[i][2]*v[j][2]; err = fabs(mat[0]-m[0]); for (i=1; i<6; i++) if ( fabs(m[i]-mat[i]) > err ) err = fabs(m[i]-mat[i]); if ( err > 1.e03*maxm ) { printf("\nProbleme eigenv3: err= %f\n",err*maxm); printf("mat depart :\n"); printf("%13.6f %13.6f %13.6f\n",mat[0],mat[1],mat[2]); printf("%13.6f %13.6f %13.6f\n",mat[1],mat[3],mat[4]); printf("%13.6f %13.6f %13.6f\n",mat[2],mat[4],mat[5]); printf("mat finale :\n"); printf("%13.6f %13.6f %13.6f\n",m[0],m[1],m[2]); printf("%13.6f %13.6f %13.6f\n",m[1],m[3],m[4]); printf("%13.6f %13.6f %13.6f\n",m[2],m[4],m[5]); printf("lambda : %f %f %f\n",lambda[0],lambda[1],lambda[2]); printf(" ordre %d\n",n); printf("\nOrtho:\n"); printf("v1.v2 = %.14f\n", v[0][0]*v[1][0]+v[0][1]*v[1][1]+ v[0][2]*v[1][2]); printf("v1.v3 = %.14f\n", v[0][0]*v[2][0]+v[0][1]*v[2][1]+ v[0][2]*v[2][2]); printf("v2.v3 = %.14f\n", v[1][0]*v[2][0]+v[1][1]*v[2][1]+ v[1][2]*v[2][2]); printf("Consistency\n"); for (i=0; i<3; i++) { tmpx = v[0][i]*m[0] + v[1][i]*m[1] + v[2][i]*m[2] - lambda[i]*v[0][i]; tmpy = v[0][i]*m[1] + v[1][i]*m[3] + v[2][i]*m[4] - lambda[i]*v[1][i]; tmpz = v[0][i]*m[2] + v[1][i]*m[4] + v[2][i]*m[5] - lambda[i]*v[2][i]; printf(" Av %d - lambda %d *v %d = %f %f %f\n", i,i,i,tmpx,tmpy,tmpz); printf("w1 %f %f %f\n",w1[0],w1[1],w1[2]); printf("w2 %f %f %f\n",w2[0],w2[1],w2[2]); printf("w3 %f %f %f\n",w3[0],w3[1],w3[2]); } exit(1); } } -------------------------------------------------------------------*/ return(n); } /* eigen value + vector extraction */ int eigen2(double *mm,double *lambda,double vp[2][2]) { double m[3],dd,a1,xn,ddeltb,rr1,rr2,ux,uy; /* init */ ux = 1.0; uy = 0.0; /* normalize */ memcpy(m,mm,3*sizeof(double)); xn = fabs(m[0]); if ( fabs(m[1]) > xn ) xn = fabs(m[1]); if ( fabs(m[2]) > xn ) xn = fabs(m[2]); if ( xn < EPSD2 ) { lambda[0] = lambda[1] = 0.0; vp[0][0] = 1.0; vp[0][1] = 0.0; vp[1][0] = 0.0; vp[1][1] = 1.0; return(1); } xn = 1.0 / xn; m[0] *= xn; m[1] *= xn; m[2] *= xn; if ( egal(m[1],0.0) ) { rr1 = m[0]; rr2 = m[2]; goto vect; } /* eigenvalues of jacobian */ a1 = -(m[0] + m[2]); ddeltb = a1*a1 - 4.0 * (m[0]*m[2] - m[1]*m[1]); if ( ddeltb < 0.0 ) { fprintf(stderr," Delta: %f\n",ddeltb); ddeltb = 0.0; } ddeltb = sqrt(ddeltb); if ( fabs(a1) < EPS ) { rr1 = 0.5 * sqrt(ddeltb); rr2 = -rr1; } else if ( a1 < 0.0 ) { rr1 = 0.5 * (-a1 + ddeltb); rr2 = (-m[1]*m[1] + m[0]*m[2]) / rr1; } else if ( a1 > 0.0 ) { rr1 = 0.5 * (-a1 - ddeltb); rr2 = (-m[1]*m[1] + m[0]*m[2]) / rr1; } else { rr1 = 0.5 * ddeltb; rr2 = -rr1; } vect: xn = 1.0 / xn; lambda[0] = rr1 * xn; lambda[1] = rr2 * xn; /* eigenvectors */ a1 = m[0] - rr1; if ( fabs(a1)+fabs(m[1]) < EPS ) { if (fabs(lambda[1]) < fabs(lambda[0]) ) { ux = 1.0; uy = 0.0; } else { ux = 0.0; uy = 1.0; } } else if ( fabs(a1) < fabs(m[1]) ) { ux = 1.0; uy = -a1 / m[1]; } else if ( fabs(a1) > fabs(m[1]) ) { ux = -m[1] / a1; uy = 1.0; } else if ( fabs(lambda[1]) > fabs(lambda[0]) ) { ux = 0.0; uy = 1.0; } else { ux = 1.0; uy = 0.0; } dd = sqrt(ux*ux + uy*uy); dd = 1.0 / dd; if ( fabs(lambda[0]) > fabs(lambda[1]) ) { vp[0][0] = ux * dd; vp[0][1] = uy * dd; } else { vp[0][0] = uy * dd; vp[0][1] = -ux * dd; } /* orthogonal vector */ vp[1][0] = -vp[0][1]; vp[1][1] = vp[0][0]; return(1); } freefem++-3.61-1/src/libMesh/Makefile.in000644 000767 000024 00000053774 13321623167 020043 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/libMesh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libMesh_a_AR = $(AR) $(ARFLAGS) libMesh_a_LIBADD = am_libMesh_a_OBJECTS = chrono.$(OBJEXT) eigenv.$(OBJEXT) \ libmesh3.$(OBJEXT) libmesh5.$(OBJEXT) memory.$(OBJEXT) libMesh_a_OBJECTS = $(am_libMesh_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libMesh_a_SOURCES) DIST_SOURCES = $(libMesh_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libMesh.a libMesh_a_SOURCES = \ chrono.c eigenv.c libmesh3.c libmesh5.c memory.c \ chrono.h eigenv.h libmesh3.h libmesh5.h memory.h all: all-am .SUFFIXES: .SUFFIXES: .c .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libMesh/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libMesh/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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libMesh.a: $(libMesh_a_OBJECTS) $(libMesh_a_DEPENDENCIES) $(EXTRA_libMesh_a_DEPENDENCIES) $(AM_V_at)-rm -f libMesh.a $(AM_V_AR)$(libMesh_a_AR) libMesh.a $(libMesh_a_OBJECTS) $(libMesh_a_LIBADD) $(AM_V_at)$(RANLIB) libMesh.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chrono.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmesh3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmesh5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LIBRARIES) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-noinstLIBRARIES 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/libMesh/libmesh5.c000644 000767 000024 00000064502 13256636774 017660 0ustar00hechtstaff000000 000000 /*----------------------------------------------------------*/ /* */ /* LIBMESH V 5.0 */ /* */ /*----------------------------------------------------------*/ /* */ /* Description: handle .meshb file format I/O */ /* Author: Loic MARECHAL */ /* Creation date: feb 16 2007 */ /* Last modification: jul 12 2007 */ /* */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Includes */ /*----------------------------------------------------------*/ #include #include #include #include #include #include #include #include "libmesh5.h" /*----------------------------------------------------------*/ /* Structures */ /*----------------------------------------------------------*/ typedef struct { int pos, typ, SolSiz, NmbLin, NmbTyp, TypTab[ GmfMaxTyp ]; char fmt[ GmfMaxTyp ]; }KwdSct; typedef struct { int dim, ver, iter, mod, typ, cod, NexKwdPos; double angle, bbox[3][2], time; KwdSct KwdTab[ GmfMaxKwd + 1 ]; FILE *hdl; char FilNam[ GmfStrSiz ]; }GmfMshSct; /*----------------------------------------------------------*/ /* Defines */ /*----------------------------------------------------------*/ #define Asc 1 #define Bin 2 #define MshFil 4 #define SolFil 8 #define MaxMsh 100 #define InfKwd 1 #define RegKwd 2 #define SolKwd 3 #define WrdSiz 4 /*----------------------------------------------------------*/ /* Global variables */ /*----------------------------------------------------------*/ int IniFlg=0; GmfMshSct *MshTab[ MaxMsh + 1 ]; char *KwdFmt[ GmfMaxKwd + 1 ][3] = { {"Reserved", "", ""}, {"MeshVersionFormatted", "", "i"}, {"Reserved", "", ""}, {"Dimension", "", "i"}, {"Vertices", "i", "dri"}, {"Edges", "i", "iii"}, {"Triangles", "i", "iiii"}, {"Quadrilaterals", "i", "iiiii"}, {"Tetrahedra", "i", "iiiii"}, {"Pentahedra", "i", "iiiiiii"}, {"Hexahedra", "i", "iiiiiiiii"}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Corners", "i", "i"}, {"Ridges", "i", "i"}, {"RequiredVertices", "i", "i"}, {"RequiredEdges", "i", "i"}, {"RequiredTriangles", "i", "i"}, {"RequiredQuadrilaterals", "i", "i"}, {"TangentAtEdgeVertices", "i", "iii"}, {"NormalAtVertices", "i", "ii"}, {"NormalAtTriangleVertices", "i", "iii"}, {"NormalAtQuadrilateralVertices", "i", "iiii"}, {"AngleOfCornerBound", "", "r"}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"BoundingBox", "", "drdr"}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"End", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Reserved", "", ""}, {"Tangents", "i", "dr"}, {"Normals", "i", "dr"}, {"TangentAtVertices", "i", "ii"}, {"SolAtVertices", "i", "sr"}, {"SolAtEdges", "i", "sr"}, {"SolAtTriangles", "i", "sr"}, {"SolAtQuadrilaterals", "i", "sr"}, {"SolAtTetrahedra", "i", "sr"}, {"SolAtPentahedra", "i", "sr"}, {"SolAtHexahedra", "i", "sr"}, {"DSolAtVertices", "i", "sr"}, {"ISolAtVertices", "i", "i"}, {"ISolAtEdges", "i", "ii"}, {"ISolAtTriangles", "i", "iii"}, {"ISolAtQuadrilaterals", "i", "iiii"}, {"ISolAtTetrahedra", "i", "iiii"}, {"ISolAtPentahedra", "i", "iiiiii"}, {"ISolAtHexahedra", "i", "iiiiiiii"}, {"Iterations","","i"}, {"Time","","r"}, {"Reserved","",""} }; /*----------------------------------------------------------*/ /* Prototypes of local procedures */ /*----------------------------------------------------------*/ static void ScaWrd(GmfMshSct *, unsigned char *); static void ScaDblWrd(GmfMshSct *, unsigned char *); static void RecWrd(GmfMshSct *, unsigned char *); static void RecDblWrd(GmfMshSct *, unsigned char *); static int ScaKwdTab(GmfMshSct *); static void ExpFmt(GmfMshSct *, int); static void ScaKwdHdr(GmfMshSct *, int); /*----------------------------------------------------------*/ /* Open a mesh file in read or write mod */ /*----------------------------------------------------------*/ int GmfOpenMesh(const char *FilNam, int mod, ...) { int i, KwdCod, res, *PtrVer, *PtrDim, MshIdx=0; char str[ GmfStrSiz ]; va_list par; GmfMshSct *msh; if(!IniFlg) { for(i=0;i= GmfStrSiz) return(0); strcpy(msh->FilNam, FilNam); /* Store the opening mod (read or write) and guess the filetype (binary or ascii) depending on the extension */ msh->mod = mod; if(strstr(msh->FilNam, ".meshb")) msh->typ |= (Bin | MshFil); else if(strstr(msh->FilNam, ".mesh")) msh->typ |= (Asc | MshFil); else if(strstr(msh->FilNam, ".solb")) msh->typ |= (Bin | SolFil); else if(strstr(msh->FilNam, ".sol")) msh->typ |= (Asc | SolFil); else return(0); /* Open the file in the required mod and initialyse the mesh structure */ if(msh->mod == GmfRead) { /*-----------------------*/ /* OPEN FILE FOR READING */ /*-----------------------*/ va_start(par, mod); PtrVer = va_arg(par, int *); PtrDim = va_arg(par, int *); va_end(par); /* Create the name string and open the file */ if(!(msh->hdl = fopen(msh->FilNam, "rb"))) return(0); /* Read the endian coding tag, the mesh version and the mesh dimension (mandatory kwd) */ if(msh->typ & Bin) { fread((unsigned char *)&msh->cod, WrdSiz, 1, msh->hdl); if( (msh->cod != 1) && (msh->cod != 16777216) ) return(0); ScaWrd(msh, (unsigned char *)&msh->ver); ScaWrd(msh, (unsigned char *)&KwdCod); if(KwdCod != GmfDimension) return(0); ScaWrd(msh, (unsigned char *)&KwdCod); ScaWrd(msh, (unsigned char *)&msh->dim); } else { do { res = fscanf(msh->hdl, "%s", str); }while( (res != EOF) && strcmp(str, "MeshVersionFormatted") ); if(res == EOF) return(0); fscanf(msh->hdl, "%d", &msh->ver); do { res = fscanf(msh->hdl, "%s", str); }while( (res != EOF) && strcmp(str, "Dimension") ); if(res == EOF) return(0); fscanf(msh->hdl, "%d", &msh->dim); } if( (msh->dim != 2) && (msh->dim != 3) ) return(0); (*PtrVer) = msh->ver; (*PtrDim) = msh->dim; /*------------*/ /* KW READING */ /*------------*/ /* Read the list of kw present in the file */ if(!ScaKwdTab(msh)) return(0); MshTab[ MshIdx ] = msh; return(MshIdx); } else if(msh->mod == GmfWrite) { /*-----------------------*/ /* OPEN FILE FOR WRITING */ /*-----------------------*/ msh->cod = 1; /* Check if the user provided a valid version number and dimension */ va_start(par, mod); msh->ver = va_arg(par, int); msh->dim = va_arg(par, int); va_end(par); if( (msh->ver != 1) && (msh->ver != 2) ) return(0); if( (msh->dim != 2) && (msh->dim != 3) ) return(0); /* Create the mesh file */ if(!(msh->hdl = fopen(msh->FilNam, "wb"))) return(0); MshTab[ MshIdx ] = msh; /*------------*/ /* KW WRITING */ /*------------*/ /* Write the mesh version and dimension */ if(msh->typ & Asc) { fprintf(msh->hdl, "%s %d\n\n", KwdFmt[ GmfVersionFormatted ][0], msh->ver); fprintf(msh->hdl, "%s %d\n", KwdFmt[ GmfDimension ][0], msh->dim); } else { RecWrd(msh, (unsigned char *)&msh->cod); RecWrd(msh, (unsigned char *)&msh->ver); GmfSetKwd(MshIdx, GmfDimension, 0); RecWrd(msh, (unsigned char *)&msh->dim); } return(MshIdx); } else return(0); } /*----------------------------------------------------------*/ /* Close a meshfile in the right way */ /*----------------------------------------------------------*/ int GmfCloseMesh(int MshIdx) { int res = 1; GmfMshSct *msh; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); fflush(stdout); msh = MshTab[ MshIdx ]; /* In write down the "End" kw in write mode */ if(msh->mod == GmfWrite) if(msh->typ & Asc) fprintf(msh->hdl, "\n%s\n", KwdFmt[ GmfEnd ][0]); else GmfSetKwd(MshIdx, GmfEnd, 0); /* Close the file and free the mesh structure */ if(fclose(msh->hdl)) res = 0; free(msh); MshTab[ MshIdx ] = NULL; return(res); } /*----------------------------------------------------------*/ /* Read the number of lines and set the position to this kwd*/ /*----------------------------------------------------------*/ int GmfStatKwd(int MshIdx, int KwdCod, ...) { int i, *PtrNmbTyp, *PtrSolSiz, *TypTab; GmfMshSct *msh; KwdSct *kwd; va_list par; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; if(!kwd->NmbLin) return(0); /* Read further arguments if this kw is a sol */ if(kwd->typ == SolKwd) { va_start(par, KwdCod); PtrNmbTyp = va_arg(par, int *); *PtrNmbTyp = kwd->NmbTyp; PtrSolSiz = va_arg(par, int *); *PtrSolSiz = kwd->SolSiz; TypTab = va_arg(par, int *); for(i=0;iNmbTyp;i++) TypTab[i] = kwd->TypTab[i]; va_end(par); } return(kwd->NmbLin); } /*----------------------------------------------------------*/ /* Set the current file position to a given kwd */ /*----------------------------------------------------------*/ int GmfGotoKwd(int MshIdx, int KwdCod) { GmfMshSct *msh; KwdSct *kwd; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; if(!kwd->NmbLin) return(0); return(fseek(msh->hdl, kwd->pos, SEEK_SET)); } /*----------------------------------------------------------*/ /* Write the kwd and set the number of lines */ /*----------------------------------------------------------*/ int GmfSetKwd(int MshIdx, int KwdCod, ...) { int i, CurPos, NmbLin=0, NulPos=0, *TypTab; va_list par; GmfMshSct *msh; KwdSct *kwd; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; /* Read further arguments if this kw has a header */ if(strlen(KwdFmt[ KwdCod ][1])) { va_start(par, KwdCod); NmbLin = va_arg(par, int); if(!strcmp(KwdFmt[ KwdCod ][2], "sr")) { kwd->NmbTyp = va_arg(par, int); TypTab = va_arg(par, int *); for(i=0;iNmbTyp;i++) kwd->TypTab[i] = TypTab[i]; } va_end(par); } /* Setup the kwd info */ ExpFmt(msh, KwdCod); if(!kwd->typ) return(0); else if(kwd->typ == InfKwd) kwd->NmbLin = 1; else kwd->NmbLin = NmbLin; /* Store the next kwd position in binary file */ if( (msh->typ & Bin) && msh->NexKwdPos ) { CurPos = ftell(msh->hdl); fseek(msh->hdl, msh->NexKwdPos, SEEK_SET); RecWrd(msh, (unsigned char *)&CurPos); fseek(msh->hdl, CurPos, SEEK_SET); } /* Write the header */ if(msh->typ & Asc) { fprintf(msh->hdl, "\n%s\n", KwdFmt[ KwdCod ][0]); if(kwd->typ != InfKwd) fprintf(msh->hdl, "%d\n", kwd->NmbLin); /* In case of solution field, write the extended header */ if(kwd->typ == SolKwd) { fprintf(msh->hdl, "%d ", kwd->NmbTyp); for(i=0;iNmbTyp;i++) fprintf(msh->hdl, "%d ", kwd->TypTab[i]); fprintf(msh->hdl, "\n\n"); } } else { RecWrd(msh, (unsigned char *)&KwdCod); msh->NexKwdPos = ftell(msh->hdl); RecWrd(msh, (unsigned char *)&NulPos); if(kwd->typ != InfKwd) RecWrd(msh, (unsigned char *)&kwd->NmbLin); /* In case of solution field, write the extended header at once */ if(kwd->typ == SolKwd) { RecWrd(msh, (unsigned char *)&kwd->NmbTyp); for(i=0;iNmbTyp;i++) RecWrd(msh, (unsigned char *)&kwd->TypTab[i]); } } return(kwd->NmbLin); } /*----------------------------------------------------------*/ /* Read a full line from the current kwd */ /*----------------------------------------------------------*/ void GmfGetLin(int MshIdx, int KwdCod, ...) { double *DblPtr, *DblSolTab; float *FltPtr, *FltSolTab; int i, j, *IntPtr; va_list par; GmfMshSct *msh = MshTab[ MshIdx ]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Start decoding the arguments */ va_start(par, KwdCod); if(kwd->typ != SolKwd) { if(msh->ver == 1) { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { FltPtr = va_arg(par, float *); fscanf(msh->hdl, "%f", FltPtr); } else { IntPtr = va_arg(par, int *); fscanf(msh->hdl, "%d", IntPtr); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { FltPtr = va_arg(par, float *); ScaWrd(msh, (unsigned char *)FltPtr); } else { IntPtr = va_arg(par, int *); ScaWrd(msh, (unsigned char *)IntPtr); } } } } else { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { DblPtr = va_arg(par, double *); fscanf(msh->hdl, "%lf", DblPtr); } else { IntPtr = va_arg(par, int *); fscanf(msh->hdl, "%d", IntPtr); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { DblPtr = va_arg(par, double *); ScaDblWrd(msh, (unsigned char *)DblPtr); } else { IntPtr = va_arg(par, int *); ScaWrd(msh, (unsigned char *)IntPtr); } } } } } else { if(msh->ver == 1) { FltSolTab = va_arg(par, float *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fscanf(msh->hdl, "%f", &FltSolTab[j]); else for(j=0;jSolSiz;j++) ScaWrd(msh, (unsigned char *)&FltSolTab[j]); } else if(msh->ver == 2) { DblSolTab = va_arg(par, double *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fscanf(msh->hdl, "%lf", &DblSolTab[j]); else for(j=0;jSolSiz;j++) ScaDblWrd(msh, (unsigned char *)&DblSolTab[j]); } } va_end(par); } /*----------------------------------------------------------*/ /* Write a full line from the current kwd */ /*----------------------------------------------------------*/ void GmfSetLin(int MshIdx, int KwdCod, ...) { double d, *DblSolTab; float f, *FltSolTab; int i, j; va_list par; GmfMshSct *msh = MshTab[ MshIdx ]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Start decoding the arguments */ va_start(par, KwdCod); if(kwd->typ != SolKwd) { if(msh->ver == 1) { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); fprintf(msh->hdl, "%g ", (float)d); } else { j = va_arg(par, int); fprintf(msh->hdl, "%d ", j); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); f = d; RecWrd(msh, (unsigned char *)&f); } else { j = va_arg(par, int); RecWrd(msh, (unsigned char *)&j); } } } } else { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); fprintf(msh->hdl, "%.15lg ", d); } else { j = va_arg(par, int); fprintf(msh->hdl, "%d ", j); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); RecDblWrd(msh, (unsigned char *)&d); } else { j = va_arg(par, int); RecWrd(msh, (unsigned char *)&j); } } } } } else { if(msh->ver == 1) { FltSolTab = va_arg(par, float *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fprintf(msh->hdl, "%g ", FltSolTab[j]); else for(j=0;jSolSiz;j++) RecWrd(msh, (unsigned char *)&FltSolTab[j]); } else if(msh->ver == 2) { DblSolTab = va_arg(par, double *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fprintf(msh->hdl, "%.15lg ", DblSolTab[j]); else for(j=0;jSolSiz;j++) RecDblWrd(msh, (unsigned char *)&DblSolTab[j]); } } va_end(par); if(msh->typ & Asc) fprintf(msh->hdl, "\n"); } /*----------------------------------------------------------*/ /* Private procedure for transmesh : copy a whole line */ /*----------------------------------------------------------*/ void GmfCpyLin(int InpIdx, int OutIdx, int KwdCod) { double d; float f; int i, a; GmfMshSct *InpMsh = MshTab[ InpIdx ], *OutMsh = MshTab[ OutIdx ]; KwdSct *kwd = &InpMsh->KwdTab[ KwdCod ]; for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { if(InpMsh->ver == 1) { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%f", &f); else ScaWrd(InpMsh, (unsigned char *)&f); d = f; } else { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%lf", &d); else ScaDblWrd(InpMsh, (unsigned char *)&d); f = (float)d; } if(OutMsh->ver == 1) if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%g ", f); else RecWrd(OutMsh, (unsigned char *)&f); else if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%.15g ", d); else RecDblWrd(OutMsh, (unsigned char *)&d); } else { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%d", &a); else ScaWrd(InpMsh, (unsigned char *)&a); if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%d ", a); else RecWrd(OutMsh, (unsigned char *)&a); } } if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "\n"); } /*----------------------------------------------------------*/ /* Find every kw present in a meshfile */ /*----------------------------------------------------------*/ static int ScaKwdTab(GmfMshSct *msh) { int KwdCod, NexPos, CurPos, EndPos; char str[ GmfStrSiz ]; if(msh->typ & Asc) { /* Scan each string in the file until the end */ while(fscanf(msh->hdl, "%s", str) != EOF) { /* Fast test in order to reject quickly the numeric values */ if(isalpha(str[0])) { /* Search which kwd code this string is associated with, then get its header and save the curent position in file (just before the data) */ for(KwdCod=1; KwdCod<= GmfMaxKwd; KwdCod++) if(!strcmp(str, KwdFmt[ KwdCod ][0])) { ScaKwdHdr(msh, KwdCod); break; } } else if(str[0] == '#') while(fgetc(msh->hdl) != '\n'); } } else { /* Get file size */ CurPos = ftell(msh->hdl); fseek(msh->hdl, 0, SEEK_END); EndPos = ftell(msh->hdl); fseek(msh->hdl, CurPos, SEEK_SET); /* Jump through kwd positions in the file */ do { /* Get the kwd code and the next kwd position */ ScaWrd(msh, (unsigned char *)&KwdCod); ScaWrd(msh, (unsigned char *)&NexPos); if(NexPos > EndPos) return(0); /* Check if this kwd belongs to this mesh version */ if( (KwdCod >= 1) && (KwdCod <= GmfMaxKwd) ) ScaKwdHdr(msh, KwdCod); /* Go to the next kwd */ if(NexPos) fseek(msh->hdl, NexPos, SEEK_SET); }while(NexPos && (KwdCod != GmfEnd)); } return(1); } /*----------------------------------------------------------*/ /* Read and setup the keyword's header */ /*----------------------------------------------------------*/ static void ScaKwdHdr(GmfMshSct *msh, int KwdCod) { int i; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; if(!strcmp("i", KwdFmt[ KwdCod ][1])) { if(msh->typ & Asc) fscanf(msh->hdl, "%d", &kwd->NmbLin); else ScaWrd(msh, (unsigned char *)&kwd->NmbLin); } else kwd->NmbLin = 1; if(!strcmp("sr", KwdFmt[ KwdCod ][2])) { if(msh->typ & Asc) { fscanf(msh->hdl, "%d", &kwd->NmbTyp); for(i=0;iNmbTyp;i++) fscanf(msh->hdl, "%d", &kwd->TypTab[i]); } else { ScaWrd(msh, (unsigned char *)&kwd->NmbTyp); for(i=0;iNmbTyp;i++) ScaWrd(msh, (unsigned char *)&kwd->TypTab[i]); } } ExpFmt(msh, KwdCod); kwd->pos = ftell(msh->hdl); } /*----------------------------------------------------------*/ /* Expand the compacted format and compute the line size */ /*----------------------------------------------------------*/ static void ExpFmt(GmfMshSct *msh, int KwdCod) { int i, j, TmpSiz=0; char chr, *InpFmt = KwdFmt[ KwdCod ][2]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Set the kwd's type */ if(!strlen(KwdFmt[ KwdCod ][1])) kwd->typ = InfKwd; else if(!strcmp(InpFmt, "sr")) kwd->typ = SolKwd; else kwd->typ = RegKwd; /* Get the solution-field's size */ if(kwd->typ == SolKwd) for(i=0;iNmbTyp;i++) switch(kwd->TypTab[i]) { case GmfSca : TmpSiz += 1; break; case GmfVec : TmpSiz += msh->dim; break; case GmfSymMat : TmpSiz += (msh->dim * (msh->dim+1)) / 2; break; case GmfMat : TmpSiz += msh->dim * msh->dim; break; } /* Scan each character from the format string */ i = 0; while(i < (int) strlen(InpFmt)) { chr = InpFmt[ i++ ]; if(chr == 'd') { chr = InpFmt[i++]; for(j=0;jdim;j++) kwd->fmt[ kwd->SolSiz++ ] = chr; } else if(chr == 's') { chr = InpFmt[i++]; for(j=0;jfmt[ kwd->SolSiz++ ] = chr; } else kwd->fmt[ kwd->SolSiz++ ] = chr; } } /*----------------------------------------------------------*/ /* Read a four bytes word in a mesh file */ /*----------------------------------------------------------*/ static void ScaWrd(GmfMshSct *msh, unsigned char *wrd) { unsigned char swp; fread(wrd, WrdSiz, 1, msh->hdl); if(msh->cod == 1) return; swp = wrd[3]; wrd[3] = wrd[0]; wrd[0] = swp; swp = wrd[2]; wrd[2] = wrd[1]; wrd[1] = swp; } /*----------------------------------------------------------*/ /* Read an eight bytes word in a mesh file */ /*----------------------------------------------------------*/ static void ScaDblWrd(GmfMshSct *msh, unsigned char *wrd) { int i; unsigned char swp; fread(wrd, WrdSiz, 2, msh->hdl); if(msh->cod == 1) return; for(i=0;i<4;i++) { swp = wrd[7-i]; wrd[7-i] = wrd[i]; wrd[i] = swp; } } /*----------------------------------------------------------*/ /* Write a four bytes word in a mesh file */ /*----------------------------------------------------------*/ static void RecWrd(GmfMshSct *msh, unsigned char *wrd) { fwrite(wrd, WrdSiz, 1, msh->hdl); } /*----------------------------------------------------------*/ /* Write an eight bytes word in a mesh file */ /*----------------------------------------------------------*/ static void RecDblWrd(GmfMshSct *msh, unsigned char *wrd) { fwrite(wrd, WrdSiz, 2, msh->hdl); } /*----------------------------------------------------------*/ /* Fortran 77 API */ /*----------------------------------------------------------*/ int call(gmfopenmeshf77)(char *FilNam, int *mod, int *ver, int *dim, int StrSiz) { int i; char TmpNam[ GmfStrSiz ]; for(i=0;i #include #include /*----------------------------------------------------------*/ /* Defines */ /*----------------------------------------------------------*/ #define LM_NBKW 79 #define LM_MESH_VERSION 1 #define LM_INT 1 #define LM_REAL 2 #define LM_READ 1 #define LM_WRITE 2 #define LM_ASCII 1 #define LM_BINARY 2 #define LM_MESH 4 #define LM_SOL 8 #define LM_SCALAR 1 #define LM_VECTOR 2 #define LM_SYM_MATRIX 3 #define LM_MATRIX 4 enum LM_kw_tags { LM_Reserved1, \ LM_MeshVersionFormatted, \ LM_Reserved2, \ LM_Dimension, \ LM_Vertices, \ LM_Edges, \ LM_Triangles, \ LM_Quadrilaterals, \ LM_Tetrahedra, \ LM_Pentahedra, \ LM_Hexahedra, \ LM_SubDomainFromGeom, \ LM_SubDomainFromMesh, \ LM_Corners, \ LM_Ridges, \ LM_RequiredVertices, \ LM_RequiredEdges, \ LM_RequiredTriangles, \ LM_RequiredQuadrilaterals, \ LM_TangentAtEdgeVertices, \ LM_NormalAtVertices, \ LM_NormalAtTriangleVertices, \ LM_NormalAtQuadrilateralVertices, \ LM_AngleOfCornerBound, \ LM_Geometry, \ LM_VertexOnGeometricVertex, \ LM_VertexOnGeometricEdge, \ LM_VertexOnGeometricTriangle, \ LM_VertexOnGeometricQuadrilateral, \ LM_EdgeOnGeometricEdge, \ LM_TriangleOnGeometricTriangle, \ LM_TriangleOnGeometricQuadrilateral, \ LM_QuadrilateralOnGeometricTriangle, \ LM_QuadrilateralOnGeometricQuadrilateral, \ LM_MeshSupportOfVertices, \ LM_VertexOnSupportVertex, \ LM_VertexOnSupportEdge, \ LM_VertexOnSupportTriangle, \ LM_VertexOnSupportQuadrilateral, \ LM_VertexOnSupportTetrahedron, \ LM_VertexOnSupportPentahedron, \ LM_VertexOnSupportHexahedron, \ LM_CrackedEdges, \ LM_CrackedTriangles, \ LM_CrackedQuadrilaterals, \ LM_EquivalentEdges, \ LM_EquivalentTriangles, \ LM_EquivalentQuadrilaterals, \ LM_PhysicsReference, \ LM_IncludeFile, \ LM_BoundingBox, \ LM_Identifier, \ LM_IdentityOfGeometry, \ LM_IdentityOfMeshSupport, \ LM_End, \ LM_Reserved10, \ LM_Reserved11, \ LM_Reserved12, \ LM_Reserved13, \ LM_Tangents, \ LM_Normals, \ LM_TangentAtVertices, \ LM_SolAtVertices, \ LM_SolAtEdges, \ LM_SolAtTriangles, \ LM_SolAtQuadrilaterals, \ LM_SolAtTetrahedra, \ LM_SolAtPentahedra, \ LM_SolAtHexahedra, \ LM_DSolAtVertices, \ LM_ISolAtVertices, \ LM_ISolAtEdges, \ LM_ISolAtTriangles, \ LM_ISolAtQuadrilaterals, \ LM_ISolAtTetrahedra, \ LM_ISolAtPentahedra, \ LM_ISolAtHexahedra, \ LM_Iterations, \ LM_Time, \ LM_VertexHack }; /*----------------------------------------------------------*/ /* Structures */ /*----------------------------------------------------------*/ typedef struct { /* Public */ int dimension; int kw_counters[ LM_NBKW + 1 ]; int *sol_headers[ LM_NBKW + 1 ]; /* Private */ int version, mode, type, endian, current_kw; FILE *handle; char *filename; size_t kw_pos[ LM_NBKW + 1 ][3]; }LM_mesh_struct; /*----------------------------------------------------------*/ /* External tables and procedures */ /*----------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif extern int LM_open_mesh(const char *, int, LM_mesh_struct *, ...); extern int LM_read_field(LM_mesh_struct *, int, int, void *); extern int LM_write_field(LM_mesh_struct *, int, int, void *, ...); extern int LM_read_line(LM_mesh_struct *, int, ...); extern int LM_write_line(LM_mesh_struct *, int, ...); extern int LM_close_mesh(LM_mesh_struct *); extern char *LM_kw_table[][3]; #ifdef __cplusplus } #endif freefem++-3.61-1/src/bin-win32/launchff++.cpp000755 000767 000024 00000011352 13312446271 020527 0ustar00hechtstaff000000 000000 #include #include #include #include #include #include #include using namespace std; #include const char C='"'; char * dirname(const char *pp) { int i,l= strlen(pp); for( i=l-1;i>=0;i--) if(pp[i]=='\\') break; char *dir= new char [l+1]; strcpy(dir,pp); dir[i]=0; return dir; } char * newq(const char *p) { int l = strlen(p); assert(l< 1000); char *c = new char[l+100]; assert(c); c[0]=C; strcpy(c+1,p); c[l+1]=C; c[l+2]=0; return c; } int main(int argc,const char **argv) { char filename[ MAX_PATH ]; const int n100=100; const char * ffargv[n100]; int debug=0; char *dir=0; const char *dirll=dirname(argv[0]); const char *pp=0; char ff[1000]; const char *fe=//"C:\\msys64\\home\\hecht\\ff++\\src\\bin-win32\\ar v.exe"; "\\freefem++.exe"; *ff=0; strcat(ff,dirll); strcat(ff,fe); //string cmd="freefem++.exe "; for(int i=0; i2) if( argv[i][1]==':') pp= argv[i]; // cmd += C; // cmd += " "; ffargv[nffa++]=newq(argv[i]); if( debug) cout << " ffl: arg " << i << argv[i] << endl; }} if(!pp) { // 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"; OPENFILENAME ofn; ZeroMemory( &filename, sizeof( filename ) ); ZeroMemory( &ofn, sizeof( ofn ) ); ofn.lStructSize = sizeof( ofn ); ofn.hwndOwner = NULL; // If you have a window to center over, put its HANDLE here ofn.lpstrFilter = "freefem++ Files (*.edp)\0*.edp\0All Files (*.*)\0*.*\0\0"; ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; ofn.lpstrTitle = "Select a File, yo!"; ofn.Flags = OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST; if (GetOpenFileNameA( &ofn )) { std::cout << "You chose the file \"" << filename << "\"\n"; /* cmd +=" -cd "; //cmd += C; for(int i=0; i< MAX_PATH; ++i) if( filename[i] == 0 ) break; else if( filename[i] == ' ' ) cmd += "\\ "; else cmd += filename[i] ; */ if(!pp &&strlen(filename)>2) if( filename[1]==':') pp= filename; ffargv[nffa++]=newq(filename); //cmd += filename; //cmd += C; // cout << " system : " << cmd << endl; //int ret= system(cmd.c_str()); } else { // All this stuff below is to tell you exactly how you messed up above. // Once you've got that fixed, you can often (not always!) reduce it to a 'user cancelled' assumption. switch (CommDlgExtendedError()) { case CDERR_DIALOGFAILURE : std::cout << "CDERR_DIALOGFAILURE\n"; break; case CDERR_FINDRESFAILURE : std::cout << "CDERR_FINDRESFAILURE\n"; break; case CDERR_INITIALIZATION : std::cout << "CDERR_INITIALIZATION\n"; break; case CDERR_LOADRESFAILURE : std::cout << "CDERR_LOADRESFAILURE\n"; break; case CDERR_LOADSTRFAILURE : std::cout << "CDERR_LOADSTRFAILURE\n"; break; case CDERR_LOCKRESFAILURE : std::cout << "CDERR_LOCKRESFAILURE\n"; break; case CDERR_MEMALLOCFAILURE : std::cout << "CDERR_MEMALLOCFAILURE\n"; break; case CDERR_MEMLOCKFAILURE : std::cout << "CDERR_MEMLOCKFAILURE\n"; break; case CDERR_NOHINSTANCE : std::cout << "CDERR_NOHINSTANCE\n"; break; case CDERR_NOHOOK : std::cout << "CDERR_NOHOOK\n"; break; case CDERR_NOTEMPLATE : std::cout << "CDERR_NOTEMPLATE\n"; break; case CDERR_STRUCTSIZE : std::cout << "CDERR_STRUCTSIZE\n"; break; case FNERR_BUFFERTOOSMALL : std::cout << "FNERR_BUFFERTOOSMALL\n"; break; case FNERR_INVALIDFILENAME : std::cout << "FNERR_INVALIDFILENAME\n"; break; case FNERR_SUBCLASSFAILURE : std::cout << "FNERR_SUBCLASSFAILURE\n"; break; default : std::cout << "You cancelled.\n"; } //int ret= system(cmd.c_str()); return 1; } } debug =0; if(pp) { if( debug ) cout << " ffl: file:" << pp << endl; int i=0; dir = dirname(pp); if(debug) cout << " ffl: chdir to " << dir << endl; _chdir(dir); delete [] dir; } ffargv[nffa++]="-log"; // ffargv[nffa++]="-wait"; // cmd += " -wait -log"; if(debug) { // cout << "exec " << cmd << endl; for(int i=0; i memory fault in ld # but now I see thant the couple allocation/delete # must be make in same .dll file under windows # is impossible to manage with the template generation # so one .dll (this work with gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)) # change the entry points mymain to mainff # to be compatibile with bamg. # FF_OBJ0 = CodeAlloc.o AFunction2.o CheckPtr.o lex.o global.o environment.o load.o FF_OBJ_AC = array_complex.o FF_OBJ_AR = array_real.o FF_OBJ_AL = array_long.o FF_OBJ1 = AFunction.o InitFunct.o strversionnumber.o mt19937ar.o string_def.o FF_OBJ2 = BamgFreeFem.o Drawing.o Element_P2h.o Element_RT.o FESpace.o FQuadTree.o InitFunct.o Mesh2.o MeshDraw.o MeshGeom.o MeshQuad.o MeshRead.o MeshWrite.o Meshio.o Metric.o QuadTree.o QuadratureFormular.o R2.o SetOfE4.o eigenvalue.o fem.o gibbs.o lgalgo.o lgfem.o lgmat.o lgmesh.o mshptg.o problem.o DefColor.o lgmesh3.o P012_2d.o P012_3d.o FESpacen.o ../libMesh/chrono.o ../libMesh/libmesh3.o ../libMesh/memory.o ../libMesh/eigenv.o ../libMesh/libmesh5.o Mesh1dn.o Mesh2dn.o Mesh3dn.o GQuadTree.o glumesh2D.o UMFPack_Solver.o splitsimplex.o P1IsoValue.o FF_OBJIDE = FreeFem___cs-cs.o FreeFem___cs-commands.o FreeFem___cs-draw.o FreeFem___cs-strversionnumber.o FreeFem___cs-socket.o FreeFem___cs-threads.o FreeFem___cs-hl_yacc.o FreeFem___cs-hl_lex.o FreeFem___cs-highlight.o FreeFem___cs-spawn.o FreeFem___cs-editor.o FreeFem___cs-server.o windres.o FFD_OBJ0 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ0)) FFD_OBJ_AC = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AC)) FFD_OBJ_AL = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AL)) FFD_OBJ_AR = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AR)) FFD_OBJ1 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ1)) FFD_OBJ2 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ2)) FFD_OBJIDE = $(patsubst %.o,../ide/%.o,$(FF_OBJIDE)) FFD_OBJLMSH = $(patsubst %.o,../ide/%.o,$(FF_OBJLMSH)) LIBS_FF = ../nw/ffapi.o libff.dll LIBS_FFmpi = ../mpi/ffapi.o libff.dll all-local: $(WIN32DLLTARGET) echo done # FFCS does not need most Windows executables since it compiles # executables in ffcs/src and ffcs/pack. But still keep one executable # to make sure that the whole process works and that libff.dll is # correctly built. if ENABLE_FFCS win32-dll-target: FreeFem++.exe ff-c++ -for i in $(LDADD2) ; do case $$i in *.dll) echo cp -p $$i .; cp -p $$i . ;; esac ; done ./copy-dll.sh echo "on a fini" else win32-dll-target: FreeFem++.exe FreeFem++-nw.exe bamg.exe cvmsh2.exe launchff++.exe ff-c++ $(MPIPROG) -for i in $(LDADD2) ; do case $$i in *.dll) echo cp -p $$i .; cp -p $$i . ;; esac ; done ./copy-dll.sh echo "on a fini" endif libff.dll: $(FFD_OBJ0) $(FFD_OBJ_AR) $(FFD_OBJ_AC) $(FFD_OBJ_AL) $(FFD_OBJ1) $(FFD_OBJ2) ../lglib/lg.tab.o $(CXX) $(GCCNOCYGWIN) -shared -Wl,--enable-auto-import $^ -o $@ $(LDADD2) parallelempi-empty.o:../mpi/parallelempi-empty.cpp $(CXX) $(CXXFLAGS) $< -c -o $@ FreeFem++-nw.exe: ../nw/sansrgraph.o parallelempi-empty.o ../lglib/mymain.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 # ALH - 28/7/14 - the new automake default is to place the objects in # the same directory as the corresponding source file FreeFem++.exe: ../nw/sansrgraph.o parallelempi-empty.o ../lglib/mymain.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 ## FH.. Strange : pb with MPI finaly with ffapi-mpi.dll ( J'ai compris) ## dur dur ... ## on mais init ffpt dans mymain.cpp FreeFem++-mpi.exe: ../nw/sansrgraph.o ../mpi/parallelempi.o ../lglib/mymain.o $(LIBS_FFmpi) $(MPICXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 $(MPI_LIB) bamg.exe: libff.dll $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) ../bamg/bamg.o -Wl,--enable-auto-import $^ -o $@ cvmsh2.exe: $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) -Wl,--enable-auto-import ../bamg/cvmsh2.o $^ -o $@ drawbdmesh.exe:../std/Pcrgraph.o ../bamg/drawbdmesh.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) -mwindows -Wl,--enable-auto-import $^ -o $@ launchff++.exe:launchff++.cpp $(CXX) $(GCCNOCYGWIN) launchff++.cpp -o launchff++.exe -lcomdlg32 ff-c++:../../examples++-load/load.link.in ../../config.status --file=ff-c++:$< chmod a+x ff-c++ install-exec-local:: install-exec-local--$(WIN32DLLTARGET) install-exec-local--win32-dll-target:: $(INSTALL_SCRIPT) launchff++.exe FreeFem++.exe FreeFem++-nw.exe bamg.exe cvmsh2.exe ff-c++ $(MPIPROG) $(DESTDIR)${bindir} $(INSTALL_SCRIPT) *.dll $(DESTDIR)${bindir} install-exec-local--:: # FFCS: automake does not clean the exes automatically because they are not built automatically. clean-local:: -rm *.exe freefem++-3.61-1/src/bin-win32/Makefile.in000644 000767 000024 00000053153 13321623167 020157 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/bin-win32 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = launchff++.cpp LDADD2 = $(ARPACKLIBS) $(UMFPACKLIBS) $(BLASLIBS) $(G2CLIB) # remark the libff.dll was splited in 6 because ld trap # to much routine => memory fault in ld # but now I see thant the couple allocation/delete # must be make in same .dll file under windows # is impossible to manage with the template generation # so one .dll (this work with gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)) # change the entry points mymain to mainff # to be compatibile with bamg. # FF_OBJ0 = CodeAlloc.o AFunction2.o CheckPtr.o lex.o global.o environment.o load.o FF_OBJ_AC = array_complex.o FF_OBJ_AR = array_real.o FF_OBJ_AL = array_long.o FF_OBJ1 = AFunction.o InitFunct.o strversionnumber.o mt19937ar.o string_def.o FF_OBJ2 = BamgFreeFem.o Drawing.o Element_P2h.o Element_RT.o FESpace.o FQuadTree.o InitFunct.o Mesh2.o MeshDraw.o MeshGeom.o MeshQuad.o MeshRead.o MeshWrite.o Meshio.o Metric.o QuadTree.o QuadratureFormular.o R2.o SetOfE4.o eigenvalue.o fem.o gibbs.o lgalgo.o lgfem.o lgmat.o lgmesh.o mshptg.o problem.o DefColor.o lgmesh3.o P012_2d.o P012_3d.o FESpacen.o ../libMesh/chrono.o ../libMesh/libmesh3.o ../libMesh/memory.o ../libMesh/eigenv.o ../libMesh/libmesh5.o Mesh1dn.o Mesh2dn.o Mesh3dn.o GQuadTree.o glumesh2D.o UMFPack_Solver.o splitsimplex.o P1IsoValue.o FF_OBJIDE = FreeFem___cs-cs.o FreeFem___cs-commands.o FreeFem___cs-draw.o FreeFem___cs-strversionnumber.o FreeFem___cs-socket.o FreeFem___cs-threads.o FreeFem___cs-hl_yacc.o FreeFem___cs-hl_lex.o FreeFem___cs-highlight.o FreeFem___cs-spawn.o FreeFem___cs-editor.o FreeFem___cs-server.o windres.o FFD_OBJ0 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ0)) FFD_OBJ_AC = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AC)) FFD_OBJ_AL = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AL)) FFD_OBJ_AR = $(patsubst %.o,../fflib/%.o,$(FF_OBJ_AR)) FFD_OBJ1 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ1)) FFD_OBJ2 = $(patsubst %.o,../fflib/%.o,$(FF_OBJ2)) FFD_OBJIDE = $(patsubst %.o,../ide/%.o,$(FF_OBJIDE)) FFD_OBJLMSH = $(patsubst %.o,../ide/%.o,$(FF_OBJLMSH)) LIBS_FF = ../nw/ffapi.o libff.dll LIBS_FFmpi = ../mpi/ffapi.o libff.dll 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bin-win32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/bin-win32/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ 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-exec-local \ 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 pdf pdf-am ps ps-am tags-am \ uninstall uninstall-am .PRECIOUS: Makefile all-local: $(WIN32DLLTARGET) echo done # FFCS does not need most Windows executables since it compiles # executables in ffcs/src and ffcs/pack. But still keep one executable # to make sure that the whole process works and that libff.dll is # correctly built. @ENABLE_FFCS_TRUE@win32-dll-target: FreeFem++.exe ff-c++ @ENABLE_FFCS_TRUE@ -for i in $(LDADD2) ; do case $$i in *.dll) echo cp -p $$i .; cp -p $$i . ;; esac ; done @ENABLE_FFCS_TRUE@ ./copy-dll.sh @ENABLE_FFCS_TRUE@ echo "on a fini" @ENABLE_FFCS_FALSE@win32-dll-target: FreeFem++.exe FreeFem++-nw.exe bamg.exe cvmsh2.exe launchff++.exe ff-c++ $(MPIPROG) @ENABLE_FFCS_FALSE@ -for i in $(LDADD2) ; do case $$i in *.dll) echo cp -p $$i .; cp -p $$i . ;; esac ; done @ENABLE_FFCS_FALSE@ ./copy-dll.sh @ENABLE_FFCS_FALSE@ echo "on a fini" libff.dll: $(FFD_OBJ0) $(FFD_OBJ_AR) $(FFD_OBJ_AC) $(FFD_OBJ_AL) $(FFD_OBJ1) $(FFD_OBJ2) ../lglib/lg.tab.o $(CXX) $(GCCNOCYGWIN) -shared -Wl,--enable-auto-import $^ -o $@ $(LDADD2) parallelempi-empty.o:../mpi/parallelempi-empty.cpp $(CXX) $(CXXFLAGS) $< -c -o $@ FreeFem++-nw.exe: ../nw/sansrgraph.o parallelempi-empty.o ../lglib/mymain.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 # ALH - 28/7/14 - the new automake default is to place the objects in # the same directory as the corresponding source file FreeFem++.exe: ../nw/sansrgraph.o parallelempi-empty.o ../lglib/mymain.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 FreeFem++-mpi.exe: ../nw/sansrgraph.o ../mpi/parallelempi.o ../lglib/mymain.o $(LIBS_FFmpi) $(MPICXX) $(GCCNOCYGWIN) libff.dll $^ -o $@ -lcomdlg32 $(MPI_LIB) bamg.exe: libff.dll $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) ../bamg/bamg.o -Wl,--enable-auto-import $^ -o $@ cvmsh2.exe: $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) -Wl,--enable-auto-import ../bamg/cvmsh2.o $^ -o $@ drawbdmesh.exe:../std/Pcrgraph.o ../bamg/drawbdmesh.o $(LIBS_FF) $(CXX) $(GCCNOCYGWIN) -mwindows -Wl,--enable-auto-import $^ -o $@ launchff++.exe:launchff++.cpp $(CXX) $(GCCNOCYGWIN) launchff++.cpp -o launchff++.exe -lcomdlg32 ff-c++:../../examples++-load/load.link.in ../../config.status --file=ff-c++:$< chmod a+x ff-c++ install-exec-local:: install-exec-local--$(WIN32DLLTARGET) install-exec-local--win32-dll-target:: $(INSTALL_SCRIPT) launchff++.exe FreeFem++.exe FreeFem++-nw.exe bamg.exe cvmsh2.exe ff-c++ $(MPIPROG) $(DESTDIR)${bindir} $(INSTALL_SCRIPT) *.dll $(DESTDIR)${bindir} install-exec-local--:: # FFCS: automake does not clean the exes automatically because they are not built automatically. clean-local:: -rm *.exe # 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: freefem++-3.61-1/src/medit/sftcpy.c000644 000767 000024 00000021212 13312446271 017146 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include "medit.h" #include "extern.h" #include "sproto.h" /* OpenGL's GL_3D_COLOR feedback vertex format */ typedef struct Feedback3Dcolor { GLfloat x, y, z; GLfloat r, g, b, a; } Feedback3Dcolor; typedef struct Token { GLfloat depth; GLfloat *ptr; } Token; static int compare (const void *a, const void *b) { Token *p1 = (Token *)a; Token *p2 = (Token *)b; GLfloat diff = p2->depth - p1->depth; if (diff > 0.0f) return 1; else if (diff < 0.0f) return -1; else return 0; } void headps (FILE *file) { GLfloat color[4], viewport[4]; GLfloat linewidth = 0.1; GLfloat pointsize; glGetFloatv(GL_VIEWPORT, viewport); glGetFloatv(GL_COLOR_CLEAR_VALUE, color); glGetFloatv(GL_LINE_WIDTH, &linewidth); glGetFloatv(GL_POINT_SIZE, &pointsize); /* write EPS header */ fprintf(file, "%%!PS-Adobe-2.0 EPSF-2.0\n"); fprintf(file, "%%LanguageLevel: 1\n"); fprintf(file, "%%%%Creator: Medit (via OpenGL feedback)\n"); fprintf(file, "%%%%Pages: (atend)\n"); fprintf(file, "%%%%BoundingBox: %g %g %g %g\n", viewport[0], viewport[1], viewport[2], viewport[3]); fprintf(file, "%%EndComments\n\n"); /* define macros */ /* fprintf(file,"100 dict begin\n"); */ fprintf(file, "%%%%BeginProlog\n"); fprintf(file, "/sgm {moveto lineto stroke } def\n"); fprintf(file, "/stg {setgray} def\n"); fprintf(file, "/stc {setrgbcolor} def\n"); fprintf(file, "/mt {moveto} def\n"); fprintf(file, "/lt {lineto} def\n"); fprintf(file, "/dc {currentrgbcolor mark} def\n"); fprintf(file, "/fc {stc newpath moveto\n"); fprintf(file, " counttomark 2 idiv {lineto} repeat\n"); fprintf(file, " closepath fill cleartomark stc} def\n"); fprintf(file, "%%%%EndProlog\n\n"); fprintf(file, "gsave\n\n"); /* set background color */ fprintf(file, "%g %g %g setrgbcolor\n", color[0], color[1], color[2]); fprintf(file, "%g %g %g %g rectfill\n\n", viewport[0], viewport[1], viewport[2], viewport[3]); fprintf(file, "%g setlinewidth\n\n", 0.01 * linewidth); } void tailps (FILE *file) { /* write EPS tail */ fprintf(file, "\n"); fprintf(file, "%%%%Trailer\n"); fprintf(file, "%%%%Pages: 1\n"); fprintf(file, "grestore\n\n"); fprintf(file, "showpage\n\n"); fclose(file); } int coreps (FILE *file, GLsizei size, GLfloat *buffer) { Token *ttoken; pScene sc; Feedback3Dcolor *v; GLfloat *ptr; int i, k, idw, token, nit, nbv, sorting = TRUE; /* default */ if (ddebug) printf("dump EPS file\n"); idw = currentScene(); sc = cv.scene[idw]; /* Count tokens */ nit = 0; ptr = buffer; while (*ptr && ptr < buffer + size) { token = (int)*ptr; switch (token) { case GL_LINE_TOKEN: case GL_LINE_RESET_TOKEN: nit++; ptr += 14; break; case GL_POLYGON_TOKEN: nit++; ++ptr; nbv = *ptr; ptr += (7 * nbv); break; case GL_POINT_TOKEN: ptr += 7; break; case GL_BITMAP_TOKEN: puts("BITMAP"); nit++; ++ptr; nbv = *ptr; printf("nbv = %d\n", nbv); break; default: fprintf(stdout, " Unrecognized token %d\n", token); break; } ptr++; } if (ddebug) printf("size = %d ptr = %p buffer = %p -> size = %d\n", size, ptr, buffer, (int)(ptr - buffer)); /* allocate mem to store tokens */ if (ddebug) printf("%d tokens found\n", nit); ttoken = (Token *)malloc((1 + nit) * sizeof(struct Token)); assert(ttoken); /* store tokens */ nit = 0; ptr = buffer; while (*ptr && ptr < buffer + size) { ttoken[++nit].ptr = ptr; token = (int)*ptr; ptr++; switch (token) { case GL_LINE_TOKEN: case GL_LINE_RESET_TOKEN: v = (Feedback3Dcolor *)ptr; ttoken[nit].depth = 0.5 * (v[0].z + v[1].z); ptr += 14; break; case GL_POLYGON_TOKEN: nbv = *ptr; ptr++; v = (Feedback3Dcolor *)ptr; ttoken[nit].depth = v[0].z; for (k = 1; k < nbv; k++) { ttoken[nit].depth += v[k].z; } ttoken[nit].depth /= nbv; ptr += (7 * nbv); break; case GL_POINT_TOKEN: ptr += 7; nit--; break; default: ptr += 4; break; } } /* Sort the primitives according to depth */ if (sc->mode == WIRE || sc->mode == WIRE + S_MATERIAL) sorting = FALSE; if (ddebug) printf("prim = %d size = %d, %d\n", nit, (int)(ptr - buffer - 1), size); if (sorting == TRUE) { if (ddebug) printf("start sorting %d tokens...\n", nit); qsort(ttoken + 1, nit, sizeof(struct Token), compare); if (ddebug) printf("end sorting\n"); } /* write tokens in EPS file */ for (k = 1; k <= nit; k++) { ptr = ttoken[k].ptr; if (*ptr == 0) continue; token = *ptr; ptr++; switch (token) { case GL_LINE_RESET_TOKEN: case GL_LINE_TOKEN: v = (Feedback3Dcolor *)ptr; fprintf(file, "%g %g %g stc\n", v[0].r, v[0].g, v[0].b); fprintf(file, "%g %g %g %g sgm\n", v[0].x, v[0].y, v[1].x, v[1].y); ptr += 14; break; case GL_POLYGON_TOKEN: nbv = *ptr; ptr++; v = (Feedback3Dcolor *)ptr; /* draw filled polygon */ if (sorting == TRUE) { /* fprintf(file,"1. stg\n"); */ fprintf(file, "dc "); for (i = 0; i < nbv; i++) { fprintf(file, " %g %g", v[i].x, v[i].y); } fprintf(file, " %g %g %g fc\n", v[0].r, v[0].g, v[0].b); } /* draw polygon border */ if (sc->mode & S_BDRY) { fprintf(file, "0. stg\n"); for (i = 0; i < nbv - 1; i++) { fprintf(file, "%g %g %g %g sgm\n", v[i].x, v[i].y, v[i + 1].x, v[i + 1].y); } fprintf(file, "%g %g %g %g sgm\n\n", v[nbv - 1].x, v[nbv - 1].y, v[0].x, v[0].y); } ptr += (7 * nbv); break; case GL_POINT_TOKEN: v = (Feedback3Dcolor *)ptr; ptr += 7; break; default: printf("problem: token %d\n", token); } } free(ttoken); return (1); } int sftcpy (pScene sc, pMesh mesh) { FILE *file; GLfloat *fbbuffer; GLint nvalues; GLsizei size; char *ptr, data[128], tmpdata[128]; static int nfree = 0; /* default */ if (ddebug) printf("soft copy\n"); /* get file name */ strcpy(tmpdata, mesh->name); ptr = (char *)strstr(tmpdata, ".mesh"); if (ptr) *ptr = '\0'; nfree = filnum(tmpdata, nfree, "ps"); if (nfree == -1) return (0); /* open PS file */ sprintf(data, "%s.%.3d.ps", tmpdata, nfree); file = fopen(data, "w"); if (!file) { fprintf(stdout, " Unable to open %s\n", data); return (0); } /* size for feedback buffer */ size = 0; nvalues = -1; do { size += 1024 * 1024; fbbuffer = (GLfloat *)calloc(1 + size, sizeof(GLfloat)); if (!fbbuffer) return (0); if (ddebug) printf("feedback pointer = %p\n", fbbuffer); /* draw scene in back buffer */ glFeedbackBuffer(size, GL_3D_COLOR, fbbuffer); (void)glRenderMode(GL_FEEDBACK); /* * glMatrixMode(GL_MODELVIEW); * glLoadIdentity(); * gluLookAt(0.,0.,-sc->persp->depth, 0.,0.,0., 0.0,1.0,0.0); * * setupView(sc); * glMultMatrixf(sc->view->matrix); * glTranslatef(sc->cx,sc->cy,sc->cz); */ drawModel(sc); if (sc->type & S_DECO) redrawStatusBar(sc); /*drawModel(sc);*/ nvalues = (GLint)glRenderMode(GL_RENDER); if (nvalues < 0) free(fbbuffer); } while (nvalues < 0); if (nvalues < 1) return (0); else if (ddebug) printf("nvalues = %d size = %d\n", nvalues, size); /* write EPS file */ glutSetCursor(GLUT_CURSOR_WAIT); headps(file); coreps(file, size, fbbuffer); tailps(file); if (ddebug) fprintf(stdout, "%s written\n", data); glutSetCursor(GLUT_CURSOR_INHERIT); return (1); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/normal.c000644 000767 000024 00000010755 13312446271 017140 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" GLuint drawNormals (pMesh mesh, pScene sc) { pPoint ppt; GLuint dlist = 0; double nn[3]; float *n, p[3], scal; int i, k, kk, ki, iadr; /* default */ if (!mesh->nvn) return (0); if (ddebug) printf("display normals, tangents\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); if (sc->type & S_OPPOS) scal = -0.025; else scal = 0.025; scal *= sc->dmax; glColor3f(0.8, 0.2, 0.6); glLineWidth(2.0); glBegin(GL_LINES); /* normals at vertices */ if (mesh->extra->iv && mesh->extra->nv) { for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; ki = mesh->extra->nv[k]; if (ki > 0) { iadr = 3 * (ki - 1) + 1; n = &mesh->extra->n[iadr]; p[0] = ppt->c[0]; p[1] = ppt->c[1]; p[2] = ppt->c[2]; nn[0] = n[0]; nn[1] = n[1]; nn[2] = n[2]; drawVector3D(p, nn, scal); } } } /* normal at triangle vertices */ if (mesh->extra->it && mesh->extra->nt) { for (k = 1; k <= mesh->nt; k++) { pTriangle pt; pt = &mesh->tria[k]; if (!pt->v[0]) continue; for (i = 0; i < 3; i++) { kk = 3 * (k - 1) + i + 1; ki = mesh->extra->nt[kk]; if (ki > 0) { ppt = &mesh->point[pt->v[i]]; iadr = 3 * (ki - 1) + 1; n = &mesh->extra->n[iadr]; p[0] = ppt->c[0]; p[1] = ppt->c[1]; p[2] = ppt->c[2]; nn[0] = n[0]; nn[1] = n[1]; nn[2] = n[2]; drawVector3D(p, nn, scal); } } } } /* normal at quad vertices */ if (mesh->extra->iq && mesh->extra->nq) { for (k = 1; k <= mesh->nq; k++) { pQuad pq; pq = &mesh->quad[k]; if (!pq->v[0]) continue; for (i = 0; i < 4; i++) { kk = 4 * (k - 1) + i + 1; ki = mesh->extra->nq[kk]; if (ki > 0) { ppt = &mesh->point[pq->v[i]]; iadr = 3 * (ki - 1) + 1; n = &mesh->extra->n[iadr]; p[0] = ppt->c[0]; p[1] = ppt->c[1]; p[2] = ppt->c[2]; nn[0] = n[0]; nn[1] = n[1]; nn[2] = n[2]; drawVector3D(p, nn, scal); } } } } /* tangents at vertices */ if (mesh->extra->jv && mesh->extra->tv) { glColor3f(0.2, 0.6, 0.8); for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; ki = mesh->extra->tv[k]; if (ki > 0) { iadr = 3 * (ki - 1) + 1; n = &mesh->extra->t[iadr]; p[0] = ppt->c[0]; p[1] = ppt->c[1]; p[2] = ppt->c[2]; nn[0] = n[0]; nn[1] = n[1]; nn[2] = n[2]; drawVector3D(p, nn, scal); } } } /* tangent at edge vertices */ if (mesh->extra->je && mesh->extra->te) { for (k = 1; k <= mesh->na; k++) { pEdge pr; pr = &mesh->edge[k]; if (!pr->v[0]) continue; for (i = 0; i < 2; i++) { kk = 2 * (k - 1) + i + 1; ki = mesh->extra->te[kk]; if (ki > 0) { ppt = &mesh->point[pr->v[i]]; iadr = 3 * (ki - 1) + 1; n = &mesh->extra->t[iadr]; p[0] = ppt->c[0]; p[1] = ppt->c[1]; p[2] = ppt->c[2]; nn[0] = n[0]; nn[1] = n[1]; nn[2] = n[2]; drawVector3D(p, nn, scal); } } } } glEnd(); glLineWidth(1.0); glEndList(); return (dlist); } freefem++-3.61-1/src/medit/clip.c000644 000767 000024 00000023543 13312446271 016576 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" static pClip cclip = 0; static ubyte curclip = 0; static GLfloat plane[4] = {-1.0, 0.0, 0.0, 0.0}; static void drawCap (pScene sc, pClip clip, GLboolean docap) { if (!docap) { if (clip->active & C_EDIT) glColor3f(1.0, 0.0, 1.0); else if (clip->active & C_FREEZE) glColor3f(0.0, 0.6, 0.9); else glColor3f(0.0, 1.0, 0.0); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(3.); glBegin(GL_QUADS); glVertex3f(0., -1., -1.); glVertex3f(0., 1., -1.); glVertex3f(0., 1., 1.); glVertex3f(0., -1., 1.); glEnd(); glLineWidth(1.); glColor3f(1., 0.7, 0.); glBegin(GL_LINES); glVertex3f(0., 0., -1.); glVertex3f(0., 0., 1.); glColor3f(1., 0.7, 0.); glVertex3f(0., -1., 0.); glVertex3f(0., 1., 0.); glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } else { glDisable(GL_LIGHTING); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor4fv(sc->material[DEFAULT_MAT].dif); glRecti(-100, -100, 100, 100); } } /* display clipping plane */ void updateClip (pClip clip, pMesh mesh) { pScene sc; pTransform cliptr, view; GLfloat dd, dmax, inv[16], axis[4], trans[4], matrix[16]; int idw; /* default */ if (ddebug) printf("updateClip\n"); /* retrieve context */ idw = currentScene(); sc = cv.scene[idw]; view = sc->view; cliptr = clip->cliptr; /* compute clip transform */ if (clip->active & C_EDIT) { invertMatrix(view->matrix, inv); inv[3] = inv[7] = inv[11] = 0.0; inv[15] = 1.0; /* rotation cumulative */ if (cliptr->angle != 0.0) { transformVector(trans, cliptr->axis, inv); glPushMatrix(); glLoadIdentity(); glRotatef(cliptr->angle, trans[0], trans[1], trans[2]); glMultMatrixf(cliptr->rot); glGetFloatv(GL_MODELVIEW_MATRIX, cliptr->rot); glPopMatrix(); } /* translation cumulative */ axis[0] = cliptr->panx; axis[1] = cliptr->pany; axis[2] = 0.0; axis[3] = 1.0; if (cliptr->manim == GL_FALSE) cliptr->panx = cliptr->pany = 0.0; transformVector(trans, axis, inv); dd = trans[0] * clip->eqn[0] + trans[1] * clip->eqn[1] + trans[2] * clip->eqn[2]; trans[0] = dd * clip->eqn[0]; trans[1] = dd * clip->eqn[1]; trans[2] = dd * clip->eqn[2]; cliptr->tra[12] += trans[0]; cliptr->tra[13] += trans[1]; cliptr->tra[14] += trans[2]; /* truncation */ dmax = mesh->xmax - mesh->xmin; dmax = max(dmax, mesh->ymax - mesh->ymin); dmax = max(dmax, mesh->zmax - mesh->zmin) / 1.8; if (fabs(cliptr->tra[12]) > dmax || fabs(cliptr->tra[13]) > dmax || fabs(cliptr->tra[14]) > dmax) { if (cliptr->manim == GL_TRUE) { cliptr->panx = -cliptr->panx; cliptr->pany = -cliptr->pany; } else { cliptr->tra[12] = max(-dmax, min(dmax, cliptr->tra[12])); cliptr->tra[13] = max(-dmax, min(dmax, cliptr->tra[13])); cliptr->tra[14] = max(-dmax, min(dmax, cliptr->tra[14])); } } /* final transformation */ glPushMatrix(); glLoadIdentity(); glMultMatrixf(cliptr->tra); glMultMatrixf(cliptr->rot); glGetFloatv(GL_MODELVIEW_MATRIX, cliptr->matrix); glPopMatrix(); /* compute plane equation */ invertMatrix(cliptr->matrix, inv); transformPoint(clip->eqn, plane, inv); if (clip->active & C_REDO) clipVertices(mesh, sc, clip); /* clip->active |= C_REDO;*/ } else if (clip->active & C_FREEZE) { glPushMatrix(); glLoadMatrixf(view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); glGetFloatv(GL_MODELVIEW_MATRIX, matrix); glPopMatrix(); invertMatrix(matrix, inv); inv[3] = inv[7] = inv[11] = 0.0; inv[15] = 1.0; glPushMatrix(); glLoadMatrixf(inv); glMultMatrixf(view->oldmat); glTranslatef(sc->cx, sc->cy, sc->cz); glMultMatrixf(cliptr->matrix); glGetFloatv(GL_MODELVIEW_MATRIX, cliptr->matrix); glPopMatrix(); /* compute plane equation */ invertMatrix(cliptr->matrix, inv); transformPoint(clip->eqn, plane, inv); clip->active |= C_REDO; } if (!cliptr->manim) { cliptr->angle = 0.0; clip->active ^= C_UPDATE; } } void clipVertices (pMesh mesh, pScene sc, pClip clip) { pPoint p0; double dd1, zero; int k, l, nbpos, nbnul; /* check points in plane */ zero = sc->dmax * 1.e-13; for (k = 1; k <= mesh->np; k++) { p0 = &mesh->point[k]; if (p0->tag & M_UNUSED) continue; dd1 = p0->c[0] * clip->eqn[0] + p0->c[1] * clip->eqn[1] \ + p0->c[2] * clip->eqn[2] + clip->eqn[3]; if (dd1 > zero) p0->clip = 2; else if (dd1 < zero) p0->clip = 1; else p0->clip = 0; } /* update tetrahedra */ for (k = 1; k <= mesh->ntet; k++) { pTetra pt; pt = &mesh->tetra[k]; pt->clip = 0; nbpos = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; if (p0->clip == 2) nbpos++; else if (p0->clip == 1); else nbnul++; } if (nbpos && nbpos + nbnul < 4) pt->clip = 1; } /* update hexahedra */ for (k = 1; k <= mesh->nhex; k++) { pHexa ph; ph = &mesh->hexa[k]; ph->clip = 0; nbpos = nbnul = 0; for (l = 0; l < 8; l++) { p0 = &mesh->point[ph->v[l]]; if (p0->clip == 2) nbpos++; else if (p0->clip == 1); else nbnul++; } if (nbpos && nbpos + nbnul < 8) ph->clip = 1; } } void drawClip (pScene sc, pClip clip, pMesh mesh, GLboolean docap) { pTransform cliptr; GLfloat scale; /* default */ if (ddebug) printf("drawClip\n"); cliptr = clip->cliptr; if (clip->active & C_UPDATE) updateClip(clip, mesh); if (clip->active & C_REDO) { if (!animate) glutSetCursor(GLUT_CURSOR_WAIT); /* update clip plane */ clipVertices(mesh, sc, clip); /* build display lists */ if (clip->active & C_VOL) { if (sc->clist[LTets]) glDeleteLists(sc->clist[LTets], 1); if (sc->clist[LHexa]) glDeleteLists(sc->clist[LHexa], 1); if (sc->cmlist[LTets]) glDeleteLists(sc->cmlist[LTets], 1); if (sc->cmlist[LHexa]) glDeleteLists(sc->cmlist[LHexa], 1); sc->clist[LTets] = sc->cmlist[LTets] = (GLuint)0; sc->clist[LHexa] = sc->cmlist[LHexa] = (GLuint)0; if (clip->active & C_CAP) { sc->clist[LTets] = capTetra(mesh); if (sc->mode & S_MAP) sc->cmlist[LTets] = capTetraMap(mesh); else if (sc->isotyp & S_ISOLINE) sc->ilist[LTets] = capTetraIso(mesh); } else { sc->clist[LTets] = listTetra(sc, mesh, 1); sc->clist[LHexa] = listHexa(sc, mesh, 1); if (sc->mode & S_MAP) { sc->cmlist[LTets] = listTetraMap(sc, mesh, 1); sc->cmlist[LHexa] = listHexaMap(sc, mesh, 1); } } if (!animate) clip->active ^= C_REDO; } else {clip->active ^= C_REDO;} if (sc->isotyp & S_VECTOR) { if (sc->vlist[LTets]) glDeleteLists(sc->vlist[LTets], 1); sc->vlist[LTets] = listClipTetraVector(mesh); if (sc->vlist[LHexa]) glDeleteLists(sc->vlist[LHexa], 1); sc->vlist[LHexa] = listClipHexaVector(mesh); } if (!animate) glutSetCursor(GLUT_CURSOR_INHERIT); } /* display plane frame */ if (clip->active & C_HIDE) return; glPushMatrix(); glMultMatrixf(cliptr->matrix); scale = 0.3 * (sc->dmax + sc->dmin); glScalef(scale, scale, scale); drawCap(sc, clip, docap); glPopMatrix(); } void copyClip (pClip clip) { if (!cclip) { cclip = (pClip)M_calloc(1, sizeof(struct clip), "clip"); if (!clip) exit(2); } cclip = (pClip)memcpy(cclip, clip, sizeof(struct clip)); if (!cclip) exit(2); curclip = 1; } int pasteClip (pClip clip) { if (!curclip) return (0); clip = (pClip)memcpy(clip, cclip, sizeof(struct clip)); if (!clip) exit(2); clip->active = 0; curclip = 0; return (1); } void tiltClip (pScene sc, pClip clip) { float axis[4]; axis[0] = clip->cliptr->axis[0]; axis[1] = clip->cliptr->axis[1]; axis[2] = clip->cliptr->axis[2]; transformVector(clip->cliptr->axis, axis, sc->view->matrix); /*clip->cliptr->angle = 90.0;*/ clip->active |= C_REDO; } /* change clip orientation */ void invertClip (pScene sc, pClip clip) { clip->eqn[0] = -clip->eqn[0]; clip->eqn[1] = -clip->eqn[1]; clip->eqn[2] = -clip->eqn[2]; clip->eqn[3] = -clip->eqn[3]; plane[0] = -plane[0]; } void resetClip (pScene sc, pClip clip, pMesh mesh) { double dd; resetTransform(clip->cliptr); dd = sc->par.clip[0] * sc->par.clip[3] + sc->par.clip[1] * sc->par.clip[4] \ + sc->par.clip[2] * sc->par.clip[5]; clip->active |= C_REDO; clip->eqn[0] = sc->par.clip[3]; clip->eqn[1] = sc->par.clip[4]; clip->eqn[2] = sc->par.clip[5]; clip->eqn[3] = -dd; /*clip->active = C_ON + C_VOL;*/ } /* create a clipping plane */ pClip createClip (pScene sc, pMesh mesh) { pClip clip; /* default */ clip = (pClip)M_calloc(1, sizeof(struct clip), "clip"); assert(clip); clip->cliptr = (pTransform)M_calloc(1, sizeof(struct transform), "clip"); assert(clip->cliptr); resetClip(sc, clip, mesh); return (clip); } freefem++-3.61-1/src/medit/animat.c000644 000767 000024 00000016305 13312446271 017116 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" extern void resetLists (pScene, pMesh); static int getmesh (pMesh mesh, int range) { int ret; static char base[256]; /* allocate mesh structure */ if (ddebug) fprintf(stdout, "getmesh: create mesh %d\n", range); if (mesh->tria) M_free(mesh->tria); if (mesh->quad) M_free(mesh->quad); if (mesh->edge) M_free(mesh->edge); if (mesh->tetra) M_free(mesh->tetra); if (mesh->hexa) M_free(mesh->hexa); if (mesh->adja) M_free(mesh->adja); if (mesh->voy) M_free(mesh->voy); if (mesh->point) M_free(mesh->point); if (mesh->extra) { if (mesh->extra->iv) M_free(mesh->extra->nv); if (mesh->extra->it) M_free(mesh->extra->nt); if (mesh->extra->iq) M_free(mesh->extra->nq); if (mesh->extra->n) M_free(mesh->extra->n); M_free(mesh->extra); mesh->extra = (void *)0; } if (mesh->sol && mesh->nbb) { if ((mesh->dim == 2 && mesh->nfield == 3) || (mesh->dim == 3 && mesh->nfield == 6)) { int k; for (k = 1; k <= mesh->nbb; k++) { free(mesh->sol[k].m); } } M_free(mesh->sol); mesh->sol = (void *)0; } mesh->point = (void *)0; mesh->tria = (void *)0; mesh->quad = (void *)0; mesh->edge = (void *)0; mesh->tetra = (void *)0; mesh->hexa = (void *)0; mesh->adja = (void *)0; mesh->voy = (void *)0; mesh->np = mesh->nt = mesh->nq = mesh->ne = 0; mesh->ntet = mesh->nhex = mesh->nbb = 0; if (animdep == range) { /*char *ptr, data[256]; sprintf(data, ".%d", range); ptr = (char *)strstr(mesh->name, data); if (ptr) *ptr = '\0';*/ strcpy(base, mesh->name); } /* adjust file name */ sprintf(mesh->name, "%s.%d", base, range); if (ddebug) fprintf(stdout, "load %s\n", mesh->name); /* read mesh */ if (quiet) { fprintf(stdout, " Loading %s \r", mesh->name); fflush(stdout); } mesh->typ = 0; ret = loadMesh(mesh); if (ret < 1) { mesh->typ = 1; ret = inmsh2(mesh); if (!ret) { mesh->typ = 2; ret = loadGIS(mesh); if (!ret) return (0); } } if ((mesh->ntet && !mesh->nt) || (mesh->nhex && !mesh->nq)) meshSurf(mesh); meshBox(mesh, animdep == range); if (!quiet) meshInfo(mesh); /* read metric */ if (!loadSol(mesh, mesh->name, 1)) bbfile(mesh); if (!quiet && mesh->nbb) fprintf(stdout, " Solutions %8d\n", mesh->nbb); return (1); } int loadNextMesh (pMesh mesh, int k, int parse) { pScene sc; int is; if (!getmesh(mesh, k)) return (0); if (ddebug) printf("loadNextMesh: create %d window(s)\n", cv.nbs); /* compute mesh box */ is = currentScene(); if (!cv.scene[is]) { cv.scene[is] = (pScene)M_calloc(1, sizeof(Scene), "loadNextMesh.scene"); if (!cv.scene[is]) return (0); } sc = cv.scene[is]; if (parse) parsop(sc, mesh); setupPalette(sc, mesh); meshRef(sc, mesh); matSort(sc); return (1); } int playAnim (pScene sc, pMesh mesh, int deb, int fin) { int k; char *ptr, data[256], base[256]; /* get basename */ sprintf(data, ".%d", deb); ptr = (char *)strstr(mesh->name, data); if (ptr) *ptr = '\0'; strcpy(base, mesh->name); if (saveimg) glDrawBuffer(GL_BACK_LEFT); /* start animation */ for (k = deb; k <= fin; k++) { strcpy(mesh->name, base); resetLists(sc, mesh); if (!loadNextMesh(mesh, k, 0)) return (0); doLists(sc, mesh); sc->glist = geomList(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); if (sc->isotyp) doIsoLists(sc, mesh, 1); if (!saveimg) { sprintf(data, "Medit - [%s] #%d", mesh->name, sc->idwin); glutSetWindowTitle(data); } glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); if (sc->type & S_SCISSOR) scissorScene(); else redrawScene(); } fprintf(stdout, "\n Done.\n"); strcpy(mesh->name, base); if (saveimg) { glDrawBuffer(GL_FRONT | GL_BACK); if (saveimg) { sprintf(data, "Medit - [%s] #%d", mesh->name, sc->idwin); glutSetWindowTitle(data); } glutPostRedisplay(); saveimg = 0; } return (1); } int animParticle (pScene sc, pMesh mesh) { int cur; char *ptr, data[256], base[256]; /* get basename */ strcpy(base, mesh->name); ptr = (char *)strstr(base, "."); sscanf(ptr, ".%d", &cur); cur++; if (cur > animfin) return (0); if (ptr) ptr[0] = '\0'; sprintf(data, "%s.%.3d", base, cur); strcpy(mesh->name, base); resetLists(sc, mesh); if (!loadNextMesh(mesh, cur, 1)) return (0); doLists(sc, mesh); sc->glist = geomList(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); if (sc->isotyp) doIsoLists(sc, mesh, 2); if (!advectParticle(sc, mesh)) return (0); return (1); } int animat () { pMesh mesh; pScene sc; /* default */ if (ddebug) printf("animat: read file(s)\n"); /* enter basename */ if (!cv.nbm) { char data[128], *name; fprintf(stdout, " File name(s) missing. Please enter : "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fgets(data, 120, stdin); if (!strlen(data)) { fprintf(stdout, " ## Error\n"); return (0); } fprintf(stdout, " Enter range [start,end] :"); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fscanf(stdin, "%d %d", &animdep, &animfin); /* parse file name(s) */ name = strtok(data, " \n"); while (name) { if (!cv.mesh[cv.nbm]) { cv.mesh[cv.nbm] = (pMesh)M_calloc(1, sizeof(Mesh), "animat.mesh"); if (!cv.mesh[cv.nbm]) return (0); } /*(cv.mesh[cv.nbm])->name = calloc(strlen(name)+15,sizeof(char));*/ strcpy(cv.mesh[cv.nbm]->name, name); break; } if (!cv.nbm) return (0); } cv.nbs = cv.nbm; /* read initial mesh */ mesh = cv.mesh[0]; if (!loadNextMesh(mesh, animdep, 1)) return (0); /* create grafix */ sc = cv.scene[0]; if (!createScene(sc, 0)) { fprintf(stderr, " ## Unable to create scene\n"); return (0); } quiet = 1; return (1); } freefem++-3.61-1/src/medit/param.c000644 000767 000024 00000004734 13312446271 016750 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include "medit.h" #include "extern.h" #include "sproto.h" #ifndef ON #define ON 1 #define OFF 0 #endif extern void ortho2D (pScene, ubyte); /* globals */ /*typedef struct sparval { int arg; } Parval; typedef Parval *pParval;*/ static void parMotion (int x, int y) { pScene sc; sc = cv.scene[currentScene()]; glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_XOR); glColor3ub(255, 255, 0); setFont("helvetica", 10); drwstr(10, sc->par.ys - 120, "Vector length"); glColor3ub(0, 255, 128); drwstr(150, sc->par.ys - 120, "%g", 10.1); glFlush(); glDisable(GL_COLOR_LOGIC_OP); } static void parMouse (int button, int state, int x, int y) { pScene sc; if (button != GLUT_LEFT_BUTTON) return; sc = cv.scene[currentScene()]; if (state == GLUT_DOWN) { glColor3ub(0, 255, 128); glDrawBuffer(GL_FRONT); ortho2D(sc, ON); glutMotionFunc(parMotion); } else { glDrawBuffer(GL_BACK); ortho2D(sc, OFF); glutMotionFunc(parMotion); } } void parEdit (pScene sc) { glutMouseFunc(parMouse); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/parsop.c000644 000767 000024 00000026541 13312446271 017154 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" extern ubyte stereoMode; int saveMeditFile (char *file, pScene sc) { FILE *out; time_t timeptr; int k; char *ptr, data[128]; strcpy(data, file); ptr = (char *)strstr(data, ".mesh"); if (ptr) *ptr = '\0'; if (!strstr(data, ".medit")) strcat(data, ".medit"); fprintf(stdout, " Writing %s\n", data); out = fopen(data, "w"); if (!out) { fprintf(stdout, " ## Unnable to write file\n"); return (0); } /* create standard parameter file */ fprintf(out, "# File created with Medit %s\n", ME_VER); fprintf(out, "# Release %s\n", ME_REL); time(&timeptr); fprintf(out, "# Created: %s", ctime(&timeptr)); fprintf(out, "\n# Assign background color\n"); fprintf(out, "BackgroundColor\n%f %f %f\n", sc->par.back[0], sc->par.back[1], sc->par.back[2]); if (sc->par.linc) fprintf(out, "LineColor\n%f %f %f\n", sc->par.line[0], sc->par.line[1], sc->par.line[2]); if (sc->mode == HIDDEN) fprintf(out, "\nRenderMode\nhidden\n"); else if (sc->mode == FILL) fprintf(out, "\nRenderMode\nfill\n"); else if (sc->mode == S_FILL + S_COLOR + S_MATERIAL) fprintf(out, "\nRenderMode\ncolorshading\n"); else if (sc->mode == SHADED) fprintf(out, "\nRenderMode\nshading\n"); else if (sc->mode == S_FILL + S_BDRY + S_COLOR + S_MATERIAL) fprintf(out, "\nRenderMode\ncolorshadingline\n"); fprintf(out, "\n# Window Size\n"); fprintf(out, "WindowSize\n%d %d\n", sc->par.xs, sc->par.ys); if (sc->par.sunp) { fprintf(out, "\n# Source Light\n"); fprintf(out, "SunPosition\n%f %f %f\n", sc->par.sunpos[0] / (2.0 * sc->dmax), sc->par.sunpos[1] / (2.0 * sc->dmax), sc->par.sunpos[2] / (2.0 * sc->dmax)); } if (sc->iso.palette) { fprintf(out, "# Color palette\n"); fprintf(out, "Palette\n"); for (k = 0; k < MAXISO; k++) { fprintf(out, "%f ", sc->iso.val[k]); } fprintf(out, "\n"); } if (sc->par.nbmat) { pMaterial pm; int i, m; m = 0; for (k = 0; k < sc->par.nbmat; k++) { pm = &sc->material[k]; for (i = LTria; i <= LHexa; i++) { if (pm->depmat[i] && !pm->flag) m++; } } fprintf(out, "\n# Subdomains colors\n"); fprintf(out, "NbMaterials\n%d\n", m); for (k = 0; k < sc->par.nbmat; k++) { pm = &sc->material[k]; m = 0; for (i = LTria; i <= LHexa; i++) { if (pm->depmat[i] && !pm->flag) break; } if (i > LHexa) continue; fprintf(out, "# Material %s %d\n", pm->name, pm->ref); fprintf(out, "Material %s %d\n", pm->name, pm->ref); fprintf(out, "%.2f %.2f %.2f %.2f\n", pm->amb[0], pm->amb[1], pm->amb[2], pm->amb[3]); fprintf(out, "%.2f %.2f %.2f %.2f\n", pm->dif[0], pm->dif[1], pm->dif[2], pm->dif[3]); fprintf(out, "%.2f %.2f %.2f %.2f\n", pm->spe[0], pm->spe[1], pm->spe[2], pm->spe[3]); fprintf(out, "%.2f %.2f %.2f %.2f\n", pm->emi[0], pm->emi[1], pm->emi[2], pm->emi[3]); fprintf(out, "%.2f\n", pm->shininess); } } if (stereoMode != MONO) fprintf(out, "EyeSep\n%f", sc->par.eyesep); fclose(out); return (1); } /* setup default values */ void iniopt (pScene sc, pMesh mesh) { GLfloat sunpos[4] = {0.0, 0.0, 1.0, 1.0}; int k; sc->par.back[0] = sc->par.back[1] = sc->par.back[2] = 0.0; sc->par.back[3] = 1.0; sc->par.line[0] = sc->par.line[1] = sc->par.line[2] = 1.0; sc->par.line[3] = 1.0; sc->par.edge[0] = 1.0; sc->par.edge[1] = 0.7; sc->par.edge[2] = 0.1; sc->par.edge[3] = 1.0; memcpy(sc->par.sunpos, sunpos, 4 * sizeof(GLfloat)); sc->par.nbmat = -1; sc->par.sunp = 0; sc->par.linc = 0; sc->par.linewidth = mesh->dim == 3 ? 3 : 2; sc->par.pointsize = 3.0; for (k = 0; k < MAXISO; k++) { sc->iso.val[k] = 0.0; sc->iso.col[k] = 0.0; } sc->iso.palette = 0; /* postscript */ sc->par.dpi = 300.; sc->par.cm = 10.; sc->par.coeff = 0.0; /* streamlines */ sc->par.maxtime = FLT_MAX; sc->par.dt = FLT_MAX; sc->par.nbpart = 1; /* clip plane */ sc->par.clip[0] = 0.0; sc->par.clip[1] = 0.0; sc->par.clip[2] = 0.0; sc->par.clip[3] = -1.0; sc->par.clip[4] = 0.0; sc->par.clip[5] = 0.0; sc->par.eyesep = -1.0; } /* parse the program options */ int parsop (pScene sc, pMesh mesh) { FILE *in; pMaterial pm; double dd; float r, g, b, ca, cb, cc, na, nb, nc; int k, i, m, n, xs, ys, ret, ref, nbmat; char *ptr, ub, data[128], key[256], buf[256], pscol[32]; /* check if user-specified parameters */ iniopt(sc, mesh); strcpy(data, mesh->name); ptr = (char *)strstr(data, ".mesh"); if (ptr) *ptr = '\0'; in = 0; if (!strstr(data, ".medit")) { strcat(data, ".medit"); in = fopen(data, "r"); } if (!in) { sprintf(data, "%s", DEFAULT_FILE); in = fopen(data, "r"); if (!in) { fprintf(stdout, " Loading default options\n"); sc->par.nbmat = MAX_MATERIAL; matInit(sc); return (1); } } if (!quiet) fprintf(stdout, " Reading %s\n", data); m = n = 0; while (!feof(in)) { fscanf(in, "%255s", key); if (feof(in)) break; for (i = 0; i < strlen(key); i++) { key[i] = tolower(key[i]); } if (key[0] == '#') { fgets(key, 255, in); } else if (!strcmp(key, "backgroundcolor")) { fscanf(in, "%f %f %f", &r, &g, &b); sc->par.back[0] = r; sc->par.back[1] = g; sc->par.back[2] = b; sc->par.back[3] = 1.0f; } else if (!strcmp(key, "boundingbox")) { fscanf(in, "%f %f %f %f %f %f", &ca, &cb, &cc, &na, &nb, &nc); mesh->xmin = ca; mesh->ymin = cb; mesh->zmin = cc; mesh->xmax = na; mesh->ymax = nb; mesh->zmax = nc; } else if (!strcmp(key, "clipplane")) { fscanf(in, "%f %f %f %f %f %f", &ca, &cb, &cc, &na, &nb, &nc); sc->par.clip[0] = ca - mesh->xtra; sc->par.clip[1] = cb - mesh->ytra; sc->par.clip[2] = cc - mesh->ztra; dd = sqrt(na * na + nb * nb + nc * nc); if (dd > EPS) { sc->par.clip[3] = na / dd; sc->par.clip[4] = nb / dd; sc->par.clip[5] = nc / dd; } } else if (!strcmp(key, "linecolor")) { fscanf(in, "%f %f %f", &r, &g, &b); sc->par.line[0] = r; sc->par.line[1] = g; sc->par.line[2] = b; sc->par.linc = 1; } else if (!strcmp(key, "linewidth")) { fscanf(in, "%f", &r); sc->par.linewidth = max(1.0, min(10.0, r)); sc->par.linc = 1; } else if (!strcmp(key, "pointsize")) { fscanf(in, "%f", &r); sc->par.pointsize = max(1.0, min(10.0, r)); sc->par.linc = 1; } else if (!strcmp(key, "edgecolor")) { fscanf(in, "%f %f %f", &r, &g, &b); sc->par.edge[0] = r; sc->par.edge[1] = g; sc->par.edge[2] = b; sc->par.linc = 1; } else if (!strcmp(key, "sunposition")) { fscanf(in, "%f %f %f", &r, &g, &b); sc->dmax = mesh->xmax - mesh->xmin; sc->dmax = max(sc->dmax, mesh->ymax - mesh->ymin); sc->dmax = max(sc->dmax, mesh->zmax - mesh->zmin); sc->dmax = fabs(sc->dmax); sc->par.sunpos[0] = 2.0 * sc->dmax * r; sc->par.sunpos[1] = 2.0 * sc->dmax * g; sc->par.sunpos[2] = 2.0 * sc->dmax * b; sc->par.sunp = 1; } else if (!strcmp(key, "windowsize")) { fscanf(in, "%d %d", &xs, &ys); sc->par.xs = (short)xs; sc->par.ys = (short)ys; } else if (!strcmp(key, "rendermode")) { fscanf(in, "%255s", buf); for (i = 0; i < strlen(buf); i++) { buf[i] = tolower(buf[i]); } if (strstr(buf, "hidden")) sc->mode = HIDDEN; else if (strstr(buf, "fill")) sc->mode = FILL; else if (strstr(buf, "colorshadingline")) sc->mode = SHADED + S_MATERIAL; else if (strstr(buf, "colorshading")) sc->mode = S_FILL + S_COLOR + S_MATERIAL; else if (strstr(buf, "shading")) sc->mode = SHADED; } else if (strstr(key, "palette")) { sc->iso.palette = 1; if (!strcmp(key, "palettet")) sc->iso.palette = 1; else if (!strcmp(key, "paletteb")) sc->iso.palette = 2; else if (!strcmp(key, "palettel")) sc->iso.palette = 3; else if (!strcmp(key, "paletter")) sc->iso.palette = 4; for (k = 0; k < MAXISO; k++) { ret = fscanf(in, "%f", &sc->iso.val[k]); } if (sc->iso.val[MAXISO - 1] < sc->iso.val[0]) sc->iso.palette = 0; } else if (!strcmp(key, "postscript")) { fscanf(in, "%f %f %255s %31s", &sc->par.cm, &sc->par.dpi, buf, pscol); strncpy(sc->par.pscolor, pscol, 10); sc->par.coeff = atof(buf); if (sc->par.coeff < 0.0f) sc->par.coeff = 0.0f; if (sc->par.coeff > 1.0f) sc->par.coeff = 1.0f; } else if (!strcmp(key, "time")) { ret = fscanf(in, "%f %f %f", &sc->par.maxtime, &sc->par.pertime, &sc->par.dt); if (!EatSpace(in)) { fscanf(in, "%c", &ub); sc->par.nbpart = max(atoi(&ub), 1); } } else if (!strcmp(key, "nbmaterial")) { fscanf(in, "%d", &nbmat); sc->par.nbmat = max(2, nbmat); matInit(sc); } else if (!strcmp(key, "material")) { if (sc->par.nbmat == -1) { sc->par.nbmat = MAX_MATERIAL; matInit(sc); } fgets(buf, 255, in); if (n > sc->par.nbmat) continue; ret = sscanf(buf, "%255s %d", buf, &ref); ptr = strstr(buf, "DEFAULT"); pm = ptr ? &sc->material[DEFAULT_MAT] : &sc->material[++n]; strcpy(pm->name, buf); if (ret < 2) ref = 0; pm->ref = ref ? ref : n; fscanf(in, "%f %f %f %f", &pm->amb[0], &pm->amb[1], &pm->amb[2], &pm->amb[3]); fscanf(in, "%f %f %f %f", &pm->dif[0], &pm->dif[1], &pm->dif[2], &pm->dif[3]); fscanf(in, "%f %f %f %f", &pm->spe[0], &pm->spe[1], &pm->spe[2], &pm->spe[3]); fscanf(in, "%f %f %f %f", &pm->emi[0], &pm->emi[1], &pm->emi[2], &pm->emi[3]); fscanf(in, "%f", &pm->shininess); if (pm->amb[3] == 0.0) pm->amb[3] = 1.0; if (pm->dif[3] == 0.0) pm->dif[3] = 1.0; if (pm->spe[3] == 0.0) pm->spe[3] = 1.0; if (pm->emi[3] == 0.0) pm->emi[3] = 1.0; pm->shininess = min(fabs(pm->shininess), 128.0f); pm->shininess = max(pm->shininess, 3.0f); ++m; } /* stereo mode */ else if (!strcmp(key, "eyesep")) { fscanf(in, "%f", &sc->par.eyesep); } } fclose(in); if (sc->par.nbmat < 0) { sc->par.nbmat = MAX_MATERIAL; matInit(sc); } else if (m == n) {sc->par.nbmat++;} if (!sc->par.linc) { sc->par.line[0] = 1.0 - sc->par.back[0]; sc->par.line[1] = 1.0 - sc->par.back[1]; sc->par.line[2] = 1.0 - sc->par.back[2]; } if (ddebug) fprintf(stdout, " Materials %8d\n", sc->par.nbmat); return (1); } freefem++-3.61-1/src/medit/mouse.c000644 000767 000024 00000025170 13312446271 016775 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #ifndef ON #define ON 1 #define OFF 0 #endif GLuint lasttime; GLboolean tracking = GL_FALSE, ctracking = GL_FALSE; GLboolean picking = GL_FALSE; int cbutton = 0; int startx, starty, curx, cury; int rxi, ryi, rx1, rx2, ry1, ry2; #define MinWH 0.1 #define MaxWH 0.9 #ifndef GLUT_BUTTON_3 #define GLUT_BUTTON_3 2 #define GLUT_BUTTON_4 3 #endif /* project x,y, onto a hemi-sphere */ static void point2Vect (int x, int y, int w, int h, float *v) { double d, a, areax, areay; areax = (w - startx) / w; areay = (h - starty) / h; if (areax > MinWH && areax < MaxWH && areay > MinWH && areay < MaxWH) { v[0] = (2.0 * x - w) / w; v[1] = (h - 2.0 * y) / h; v[2] = 1.0f; } else { v[0] = 2.0f * (x - startx) / w; v[1] = -2.0f * (y - starty) / h; v[2] = 1.0f; } d = v[0] * v[0] + v[1] * v[1]; if (d == 0.0f) return; d = sqrt(d); v[2] = cos(M_PI_2 * ((d < 1.0) ? d : 1.0)); d = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; a = 1.0f / sqrt(d); v[0] *= a; v[1] *= a; v[2] *= a; } void ortho2D (pScene sc, ubyte mode) { if (mode == ON) { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0, sc->par.xs, 0., sc->par.ys); glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_MODELVIEW); } else if (mode == OFF) { glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST); glLineWidth(1.); } } static void drawRubberBand (int xa, int ya, int xb, int yb) { glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(2.0); glColor3f(0.5, 0.5, 0.5); glRecti(xa, ya, xb, yb); } static void rubberMotion (int x, int y) { pScene sc; pPersp p; sc = cv.scene[currentScene()]; p = sc->persp; glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_XOR); /* draw frame */ drawRubberBand(rxi, ryi, rx1, ry1); rx2 = x; ry2 = sc->par.ys - y; drawRubberBand(rxi, ryi, rx2, ry2); glFlush(); glLogicOp(GL_COPY); glDisable(GL_COLOR_LOGIC_OP); /* keep old coords */ rx1 = rx2; ry1 = ry2; } void zoomMotion (int x, int y) { pScene sc; pPersp p; int dy; sc = cv.scene[currentScene()]; p = sc->persp; dy = starty - y; if (dy > 0) if (p->fovy < 1.0e-02) return; else p->fovy = max(0.95 * p->fovy, 1e-05); else if (p->fovy > 160.0) return; else p->fovy = min(1.1 * p->fovy, 179.0); farclip(1); starty = y; glutPostRedisplay(); } void mouse (int button, int state, int x, int y) { pScene sc; pTransform tr; pPersp p; int keyact, idw = currentScene(); static int olds = -1; picking = GL_FALSE; /* default */ if (ddebug) printf("control mouse %d\n", state); sc = cv.scene[idw]; p = sc->persp; if (sc->cube->active & C_EDIT) tr = sc->cube->cubetr; else if (sc->clip->active & C_EDIT) tr = sc->clip->cliptr; else tr = sc->view; tr->mstate = state; tr->mbutton = button; /* check if ctrl-shift-alt pressed */ keyact = glutGetModifiers(); if (state == GLUT_DOWN) { tracking = GL_TRUE; lasttime = glutGet(GLUT_ELAPSED_TIME); if (button == GLUT_LEFT_BUTTON) { if (keyact == GLUT_ACTIVE_SHIFT) { /* entity designation */ picking = GL_TRUE; if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = pickingScene(sc, x, y, 0); return; } else if (keyact == GLUT_ACTIVE_ALT) { /* zoom */ starty = y; glutMotionFunc(zoomMotion); return; } else if (keyact == GLUT_ACTIVE_CTRL) { /* rubberband selection */ glutSetCursor(GLUT_CURSOR_CROSSHAIR); p->rubix = p->rubfx = x; p->rubiy = p->rubfy = sc->par.ys - y; rxi = rx1 = x; ryi = ry1 = sc->par.ys - y; p->rubber = 1; glDrawBuffer(GL_BACK_LEFT); ortho2D(sc, ON); glutMotionFunc(rubberMotion); return; } } else if (button == GLUT_MIDDLE_BUTTON && keyact & GLUT_ACTIVE_SHIFT) { picking = GL_TRUE; if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = pickingScene(sc, x, y, LPoint); return; } /* transformation */ startx = x; starty = y; point2Vect(x, y, sc->par.xs, sc->par.ys, tr->pos); glutSetCursor(GLUT_CURSOR_INFO); } else if (state == GLUT_UP) { if (button == GLUT_LEFT_BUTTON) { if (keyact == GLUT_ACTIVE_CTRL) { /* rubberband selection */ p->rubfx = x; p->rubfy = sc->par.ys - y; p->rubber = 2; glDrawBuffer(GL_BACK_LEFT); ortho2D(sc, OFF); glutMotionFunc(motion); return; } else if (keyact == GLUT_ACTIVE_ALT) { glutMotionFunc(motion); return; } else if (picking == GL_TRUE) { picking = GL_FALSE; reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); } } glutMotionFunc(motion); if (sc->clip->active & C_EDIT) sc->clip->active |= C_REDO; /* transformation */ glutSetCursor(GLUT_CURSOR_INHERIT); tracking = GL_FALSE; if (glutGet(GLUT_ELAPSED_TIME) >= lasttime) { if (tr->manim == GL_TRUE) glutIdleFunc(glutIdle); else tr->angle = 0.0; /*if ( abs(startx-x) + abs(starty-y) > 0 )*/ glutPostRedisplay(); } else if (tr->manim == GL_TRUE && olds == idw) { glutIdleFunc(NULL); } } olds = idw; } void motion (int x, int y) { pScene sc; pTransform tr; pPersp p; GLuint gtime; double deltax, deltay; float coeff, pos[3]; int idw = currentScene(); /* default */ if (picking) return; if (ddebug) fprintf(stdout, "motion\n"); if (tracking == GL_FALSE) return; sc = cv.scene[idw]; p = sc->persp; if (p->rubber == 1) return; /* what is transformed ? */ if (sc->cube->active & C_EDIT) tr = sc->cube->cubetr; else if (sc->clip->active & C_EDIT) tr = sc->clip->cliptr; else tr = sc->view; if (tr->mstate != GLUT_DOWN) return; if (picking) tr->angle = 0.0f; gtime = glutGet(GLUT_ELAPSED_TIME); if ((animate || sc->type & S_FOLLOW) && gtime < lasttime + 40) return; if (tr->mbutton == GLUT_LEFT_BUTTON) { /* calculate axis of rotation: cross product */ point2Vect(x, y, sc->par.xs, sc->par.ys, pos); tr->axis[0] = tr->pos[1] * pos[2] - tr->pos[2] * pos[1]; tr->axis[1] = tr->pos[2] * pos[0] - tr->pos[0] * pos[2]; tr->axis[2] = tr->pos[0] * pos[1] - tr->pos[1] * pos[0]; /* calculate angle to rotate by */ if (animate && saveimg) { tr->angle = 2.0f; } else { float dx, dy, dz; dx = pos[0] - tr->pos[0]; dy = pos[1] - tr->pos[1]; dz = pos[2] - tr->pos[2]; tr->angle = 180.0 * sqrt(dx * dx + dy * dy + dz * dz); } /* reset for next time */ tr->pos[0] = pos[0]; tr->pos[1] = pos[1]; tr->pos[2] = pos[2]; lasttime = gtime; if (sc->cube->active & C_ON && sc->cube->active & C_EDIT) sc->cube->active |= C_UPDATE; else if (sc->clip->active & C_ON && (sc->clip->active & C_EDIT || sc->clip->active & C_FREEZE)) sc->clip->active |= C_UPDATE; glutPostRedisplay(); } else if (tr->mbutton == GLUT_MIDDLE_BUTTON) { coeff = tr->manim == GL_TRUE ? 0.2 : 2.0; deltax = coeff * (x - startx) / (float)sc->par.xs; deltay = coeff * (starty - y) / (float)sc->par.ys; if (deltax != 0.0) tr->panx += -deltax *p->depth*tan (p->fovy / 360. *M_PI); if (deltay != 0.0) tr->pany += -deltay *p->depth*tan (p->fovy / 360. *M_PI); tr->angle = 0.0; startx = x; starty = y; lasttime = gtime; if (sc->cube->active & C_ON && sc->cube->active & C_EDIT) sc->cube->active |= C_UPDATE; else if (sc->clip->active & C_ON && (sc->clip->active & C_EDIT || sc->clip->active & C_FREEZE)) sc->clip->active |= C_UPDATE; glutPostRedisplay(); } } void mouseCamera (int button, int state, int x, int y) { /* default */ if (ddebug) printf("control mouse camera %d button %d\n", state, button); cbutton = button; if (state == GLUT_DOWN) { ctracking = GL_TRUE; startx = x; starty = y; curx = x; cury = y; } else { startx = x; starty = y; ctracking = GL_FALSE; } } void motionCamera (int x, int y) { pScene sc; pCamera c; double dazim, delev, azim, elev; float cfelev, cfazim; /* keep current pos */ curx = x; cury = y; if (animate) return; sc = cv.scene[currentScene()]; c = sc->camera; azim = Azimuth(c); elev = Elevation(c); switch (cbutton) { case GLUT_LEFT_BUTTON: cfelev = 50.0; cfazim = 50.0; delev = cfelev * (y - starty) / (float)sc->par.ys; dazim = cfazim * (x - startx) / (float)sc->par.xs; startx = x; starty = y; elev += delev; azim -= dazim; break; case GLUT_MIDDLE_BUTTON: break; case GLUT_BUTTON_3: puts("button3"); break; case GLUT_BUTTON_4: puts("button4"); break; } updateCamera(sc, c, azim, elev); reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); } void animateCamera () { pScene sc; pCamera c; double dazim, delev, azim, elev; float cfelev, cfazim; if (!animate || !ctracking) return; sc = cv.scene[currentScene()]; c = sc->camera; azim = Azimuth(c); elev = Elevation(c); switch (cbutton) { case GLUT_LEFT_BUTTON: cfelev = 3.0; cfazim = 3.0; delev = 2.0 * (cury - starty) / (float)sc->par.ys; dazim = 2.0 * (curx - startx) / (float)sc->par.xs; if (delev >= 0.0) delev *= delev; else delev = -delev * delev; if (dazim >= 0.0) dazim *= dazim; else dazim = -dazim * dazim; elev += cfelev * delev; azim -= cfazim * dazim; break; case GLUT_MIDDLE_BUTTON: break; case GLUT_BUTTON_3: puts("button3"); break; case GLUT_BUTTON_4: puts("button4"); break; } updateCamera(sc, c, azim, elev); reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); } freefem++-3.61-1/src/medit/critip.c000644 000767 000024 00000021055 13312446271 017135 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" typedef struct saddle { double r1, r2; float pt[3]; float vp1[2], vp2[2]; int k; } Saddle; #define EPSD 1.e-14 #define EPS3 1.e-03 #define MAXPS 100 #define HSIZ 0.001 static int idir[5] = {0, 1, 2, 0, 1}; int closedBall (pMesh mesh, int depart, ubyte i) { int adj, iadr; ubyte voy; voy = idir[i + 1]; iadr = 3 * (depart - 1) + 1; adj = mesh->adja[iadr + voy]; /* search triangles in ball */ while (adj && adj != depart) { voy = mesh->voy[iadr + voy]; iadr = 3 * (adj - 1) + 1; voy = idir[voy + 2]; adj = mesh->adja[iadr + voy]; } return (adj == depart); } GLuint listCritPoint (pScene sc, pMesh mesh) { pTriangle pt; pPoint p0, p1, p2; pSolution s0, s1, s2; pMaterial pm; Saddle sad[MAXPS]; GLuint dlist; double aire, ux, uy, vx, vy, dd, cb0[3], cb1[3], cb2[3], vv[3][2], bc[3]; double rgb[3], a0, a1, delta, rr1, rr2, aa, dmin; float p[3]; int *adj, iadr, i, i1, i2, k, m, ncp, ps, ifilt; ubyte typ, tag; static double hsv[3] = {0.0f, 1.0f, 0.80f}; if (!mesh->nbb || mesh->nfield != mesh->dim) return (0); if (mesh->nt && !hashTria(mesh)) return (0); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("find critical points\n"); /* build list */ typ = 0; ncp = 0; ps = 0; dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); glPointSize(4.0); dmin = sc->dmax * EPS; dmin *= dmin; ifilt = 0; hsv[0] = sc->iso.col[0]; hsvrgb(hsv, rgb); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; s0 = &mesh->sol[pt->v[0]]; s1 = &mesh->sol[pt->v[1]]; s2 = &mesh->sol[pt->v[2]]; ux = p1->c[0] - p0->c[0]; uy = p1->c[1] - p0->c[1]; vx = p2->c[0] - p0->c[0]; vy = p2->c[1] - p0->c[1]; aire = ux * vy - uy * vx; if (aire == 0.0) { k = pt->nxt; continue; } else if (aire < 0.0) { p1 = &mesh->point[pt->v[2]]; p2 = &mesh->point[pt->v[1]]; s1 = &mesh->sol[pt->v[2]]; s2 = &mesh->sol[pt->v[1]]; aire = -aire; } /* coef des barycentriques */ aire = 1.0 / aire; cb0[0] = p1->c[1] - p2->c[1]; cb0[1] = -(p1->c[0] - p2->c[0]); cb0[2] = p1->c[0] * p2->c[1] - p1->c[1] * p2->c[0]; cb1[0] = p2->c[1] - p0->c[1]; cb1[1] = -(p2->c[0] - p0->c[0]); cb1[2] = p2->c[0] * p0->c[1] - p2->c[1] * p0->c[0]; cb2[0] = p0->c[1] - p1->c[1]; cb2[1] = -(p0->c[0] - p1->c[0]); cb2[2] = p0->c[0] * p1->c[1] - p0->c[1] * p1->c[0]; for (i = 0; i < 3; i++) { vv[i][0] = aire * (cb0[i] * s0->m[0] + cb1[i] * s1->m[0] + cb2[i] * s2->m[0]); vv[i][1] = aire * (cb0[i] * s0->m[1] + cb1[i] * s1->m[1] + cb2[i] * s2->m[1]); } dd = vv[0][0] * vv[1][1] - vv[0][1] * vv[1][0]; if (fabs(dd) < EPSD) { k = pt->nxt; continue; } dd = 1.0 / dd; p[0] = dd * (vv[1][0] * vv[2][1] - vv[2][0] * vv[1][1]); p[1] = dd * (vv[0][1] * vv[2][0] - vv[0][0] * vv[2][1]); p[2] = 0.0; if (p[0] < mesh->xmin - mesh->xtra || p[0] > mesh->xmax - mesh->xtra || p[1] < mesh->ymin - mesh->ytra || p[1] > mesh->ymax - mesh->ytra) { k = pt->nxt; continue; } else if (!inTria(mesh, k, p, bc)) { k = pt->nxt; continue; } /* filtering boundary points */ tag = 0; for (i = 0; i < 3; i++) { tag |= (bc[i] < EPS3) << i; } if (tag) { iadr = 3 * (k - 1) + 1; adj = &mesh->adja[iadr]; ifilt++; switch (tag) { case 1: if (!adj[0]) { k = pt->nxt; continue; } break; case 2: if (!adj[1]) { k = pt->nxt; continue; } break; case 4: if (!adj[2]) { k = pt->nxt; continue; } break; case 3: if (!closedBall(mesh, k, 2)) { k = pt->nxt; continue; } break; case 5: if (!closedBall(mesh, k, 1)) { k = pt->nxt; continue; } break; case 6: if (!closedBall(mesh, k, 0)) { k = pt->nxt; continue; } break; } } /* eigenvalues of jacobian */ a1 = -(vv[0][0] + vv[1][1]); a0 = vv[0][0] * vv[1][1] - vv[0][1] * vv[1][0]; delta = a1 * a1 - 4 * a0; i1 = i2 = 0; if (delta >= 0.0) { delta = sqrt(delta); rr1 = 0.5 * (-a1 + delta); rr2 = 0.5 * (-a1 - delta); } else { delta = sqrt(fabs(delta)); rr1 = rr2 = -0.5 * a1; i1 = i2 = 0.5 * delta; } /* classification */ if (i1 && i2) { glColor3f(0.0, 1.0, 0.5); if (rr1 == 0.0f && rr2 == 0.0f) output2(p[0], p[1], "Cp"); /* center */ else if (rr1 > 0.0f && rr2 > 0.0f) output2(p[0], p[1], "Rf"); /* repelling focus */ else if (rr1 < 0.0f && rr2 < 0.0f) output2(p[0], p[1], "Af"); /* attracting focus */ } else if (!i1 && !i2) { glColor3f(1.0, 0.5, 0.0); if (rr1 > 0.0f && rr2 > 0.0f) { output2(p[0], p[1], "Rn"); /* repelling node */ } else if (rr1 < 0.0f && rr2 < 0.0f) { output2(p[0], p[1], "An"); /* attracting node */ } else if (rr1 * rr2 < 0.0f) { output2(p[0], p[1], "Sp"); /* Saddle point */ if (ddebug) printf(" saddle point %f %f\n", p[0] + mesh->xtra, p[1] + mesh->ytra); if (ps < MAXPS - 5) { ++ps; sad[ps].pt[0] = p[0]; sad[ps].pt[1] = p[1]; sad[ps].pt[2] = 0.0f; /* eigenvalues */ sad[ps].r1 = rr1; sad[ps].r2 = rr2; /* eigenvectors */ aa = vv[0][0] * vv[0][0]; dd = vv[1][1] * vv[1][1]; delta = sqrt(aa - 2.0 * vv[0][0] * vv[1][1] + dd + 4.0 * vv[0][1] * vv[1][0]); sad[ps].vp1[0] = -0.5 * (-vv[0][0] + vv[1][1] - delta); sad[ps].vp1[1] = vv[0][1]; sad[ps].vp2[0] = -0.5 * (-vv[0][0] + vv[1][1] + delta); sad[ps].vp2[1] = vv[0][1]; sad[ps].k = k; } } } /* point color */ glBegin(GL_POINTS); glColor3dv(rgb); glVertex2fv(p); glEnd(); pt->cpt--; ++ncp; k = pt->nxt; } } glPointSize(1.0); glEndList(); if (ncp) fprintf(stdout, " %d critical points identified (%d filtered)\n", ncp, ifilt); return (dlist); if (ps) { time_t t; fprintf(stdout, " Building streamline(s)"); fflush(stdout); t = clock(); if (!sc->slist) { sc->stream = createStream(sc, mesh); if (!sc->stream) return (dlist); } for (k = 1; k <= ps; k++) { if (ddebug) printf(" eigenv1 %f %f\n", sad[k].vp1[0], sad[k].vp1[1]); listSaddleStream(sc, mesh, sad[k].k, sad[k].pt, sad[k].vp1, sad[k].r1); sad[k].vp1[0] = -sad[k].vp1[0]; sad[k].vp1[1] = -sad[k].vp1[1]; listSaddleStream(sc, mesh, sad[k].k, sad[k].pt, sad[k].vp1, sad[k].r1); if (ddebug) printf(" eigenv2 %f %f\n", sad[k].vp2[0], sad[k].vp2[1]); listSaddleStream(sc, mesh, sad[k].k, sad[k].pt, sad[k].vp2, sad[k].r2); sad[k].vp2[0] = -sad[k].vp2[0]; sad[k].vp2[1] = -sad[k].vp2[1]; listSaddleStream(sc, mesh, sad[k].k, sad[k].pt, sad[k].vp2, sad[k].r2); } sc->isotyp |= S_STREAML; fprintf(stdout, ": %d lines", ps); t = clock() - t; fprintf(stdout, " %6.2f sec.\n", t / (float)CLOCKS_PER_SEC); } return (dlist); } freefem++-3.61-1/src/medit/items.c000644 000767 000024 00000032511 13312446271 016763 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" void drawRulers (pScene sc) { pMesh mesh = cv.mesh[sc->idmesh]; if (ddebug) printf("draw rulers\n"); glPushMatrix(); glTranslatef(-mesh->xtra, -mesh->ytra, -mesh->ztra); glColor3fv(sc->par.line); glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x0444); glLineWidth(2.); glBegin(GL_LINES); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmax); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmax); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmin, mesh->ymax, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymin, mesh->zmax); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmin); glVertex3f(mesh->xmax, mesh->ymax, mesh->zmax); glEnd(); glLineWidth(1.); glDisable(GL_LINE_STIPPLE); glPopMatrix(); } void drawAxis (pScene sc, int dim) { pMesh mesh; /* default */ if (ddebug) printf("draw axis\n"); mesh = cv.mesh[sc->idmesh]; glPushMatrix(); glTranslatef(1.01 * (mesh->xmin - mesh->xtra), 1.01 * (mesh->ymin - mesh->ytra), 1.01 * (mesh->zmin - mesh->ztra)); glScalef(0.6 * sc->dmin, 0.6 * sc->dmin, 0.6 * sc->dmin); glLineWidth(max(2, sc->par.linewidth)); glColor3f(1.0, 0., 0.); if (mesh->dim == 2) { glBegin(GL_LINE_STRIP); glVertex2f(0.0, 0.0); glVertex2f(1.0, 0.0); glVertex2f(0.95, 0.01); glVertex2f(0.95, -0.01); glVertex2f(1.0, 0.0); glEnd(); glBegin(GL_LINE_STRIP); glVertex2f(0.0, 0.0); glVertex2f(0.0, 1.0); glVertex2f(-0.01, 0.95); glVertex2f(0.01, 0.95); glVertex2f(0.0, 1.0); glEnd(); /*glColor3f(0.0f,1.0f,0.0f);*/ glColor3f(1. - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); glRasterPos3f(1.02, 0.0, 0.0); glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'x'); glRasterPos3f(0.0, 1.02, 0.0); glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'y'); } else { glBegin(GL_LINE_STRIP); glVertex3f(0.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0); glVertex3f(0.95, 0.01, 0.0); glVertex3f(0.95, -0.01, 0.0); glVertex3f(1.0, 0.0, 0.0); glVertex3f(0.95, 0.0, 0.01); glVertex3f(0.95, 0.0, -0.01); glVertex3f(1.0, 0.0, 0.0); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glVertex3f(0.0, 0.95, 0.01); glVertex3f(0.0, 0.95, -0.01); glVertex3f(0.0, 1.0, 0.0); glVertex3f(0.01, 0.95, 0.0); glVertex3f(-0.01, 0.95, 0.0); glVertex3f(0.0, 1.0, 0.0); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 1.0); glVertex3f(0.01, 0.0, 0.95); glVertex3f(-0.01, 0.0, 0.95); glVertex3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.01, 0.95); glVertex3f(0.0, -0.01, 0.95); glVertex3f(0.0, 0.0, 1.0); glEnd(); /*glColor3f(0.0f,1.0f,0.0f);*/ glColor3f(1. - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); glRasterPos3f(1.02, 0.0, 0.0); glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'x'); glRasterPos3f(0.0, 1.02, 0.0); glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'y'); glRasterPos3f(0.0, 0.0, 1.02); glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'z'); } glLineWidth(1.0); glPopMatrix(); } void drawBox (pScene sc, pMesh mesh, int mode) { pMaterial pm; glDisable(GL_LIGHTING); glPushMatrix(); glScalef(1.01 * fabs(mesh->xmax - mesh->xmin), 1.01 * fabs(mesh->ymax - mesh->ymin), 1.01 * fabs(mesh->zmax - mesh->zmin)); glColor3f(1.0, 0.0, 0.5); glutWireCube(1.0); glPopMatrix(); /* one box per sub-domain */ if (mode) { int m; for (m = 0; m < sc->par.nbmat; m++) { int i; pm = &sc->material[m]; for (i = 0; i < MAX_LIST; i++) { float cx, cy, cz; int k; k = pm->depmat[i]; if (!k || pm->flag) continue; cx = 0.5 * (pm->ext[3] + pm->ext[0]); cy = 0.5 * (pm->ext[4] + pm->ext[1]); cz = 0.5 * (pm->ext[5] + pm->ext[2]); glPushMatrix(); glColor3fv(pm->dif); glTranslatef(cx, cy, cz); glScalef(pm->ext[3] - pm->ext[0], pm->ext[4] - pm->ext[1], pm->ext[5] - pm->ext[2]); glutWireCube(1.0); glPopMatrix(); } } } } void drawCube (pScene sc, pMesh mesh) { pTransform cubetr; pCube cube; float x1, y1, z1/*, x2, y2*/, z2, xd, yd/*, zd*/; cube = sc->cube; cubetr = cube->cubetr; if (cube->active & C_UPDATE) updateCube(cube, mesh); glDisable(GL_LIGHTING); glPushMatrix(); glMultMatrixf(cubetr->matrix); glLineWidth(3.0); if (cube->active & C_EDIT) glColor3f(1.0, 0.0, 1.0); else if (cube->active & C_FREEZE) glColor3f(0.0, 0.6, 0.9); else glColor3f(0.0, 1.0, 0.0); x1 = cube->cmi[0] - mesh->xtra; y1 = cube->cmi[1] - mesh->ytra; z1 = cube->cmi[2] - mesh->ztra; /*x2 = cube->cma[0] - mesh->xtra;*/ /*y2 = cube->cma[1] - mesh->ytra;*/ z2 = cube->cma[2] - mesh->ztra; xd = cube->cma[0] - cube->cmi[0]; yd = cube->cma[1] - cube->cmi[1]; /*zd = cube->cma[2] - cube->cmi[2];*/ glBegin(GL_QUADS); glVertex3f(x1, y1, z1); glVertex3f(x1 + xd, y1, z1); glVertex3f(x1 + xd, y1 + yd, z1); glVertex3f(x1, y1 + yd, z1); glVertex3f(x1, y1, z2); glVertex3f(x1 + xd, y1, z2); glVertex3f(x1 + xd, y1 + yd, z2); glVertex3f(x1, y1 + yd, z2); glEnd(); glBegin(GL_LINES); glVertex3f(x1, y1, z1); glVertex3f(x1, y1, z2); glVertex3f(x1 + xd, y1, z1); glVertex3f(x1 + xd, y1, z2); glVertex3f(x1 + xd, y1 + yd, z1); glVertex3f(x1 + xd, y1 + yd, z2); glVertex3f(x1, y1 + yd, z1); glVertex3f(x1, y1 + yd, z2); glEnd(); glLineWidth(1.0); glPopMatrix(); } void drawGrid (pScene sc, pMesh mesh) { /* default */ if (ddebug) printf("draw grid + graduation\n"); if (!sc->grid) { int k; sc->grid = glGenLists(1); glNewList(sc->grid, GL_COMPILE); glBegin(GL_LINES); for (k = 0; k < 5; k++) { glVertex3f(k * 0.25, 0., 0.); glVertex3f(k * 0.25, 1., 0.); glVertex3f(0., k * 0.25, 0.); glVertex3f(1., k * 0.25, 0.); glVertex3f(0., k * 0.25, 0.); glVertex3f(0., k * 0.25, 1.); glVertex3f(0., 0., k * 0.25); glVertex3f(0., 1., k * 0.25); glVertex3f(k * 0.25, 0., 0.); glVertex3f(k * 0.25, 0., 1.); glVertex3f(0., 0., k * 0.25); glVertex3f(1., 0., k * 0.25); } glEnd(); glEndList(); } /* call display list */ glPushMatrix(); glTranslatef(-0.3 * fabs(sc->dmax), 0., -4.7 * sc->dmax); glRotatef(-60., 1., 0., 0.); glRotatef(-120., 0., 0., 1.); glScalef(2.5 * sc->dmax, 2.5 * sc->dmax, 2.5 * sc->dmax); glDisable(GL_LIGHTING); glColor3f(0.4, 0.4, 0.4); glCallList(sc->grid); glColor3fv(sc->par.line); output3(0.0, 0.0, 0.0, "%.2f", mesh->xmin); output3(1.1, 0.0, 0.0, "%.2f", mesh->xmax); output3(0.0, 1.01, 0.0, "%.2f", mesh->ymax); output3(0.0, 0.0, 1.01, "%.2f", mesh->zmax); glEnable(GL_LIGHTING); glPopMatrix(); } void drawBase (pScene sc, pMesh mesh) { /* default */ if (ddebug) printf("draw base\n"); if (!sc->grid) { int k; sc->grid = glGenLists(1); glNewList(sc->grid, GL_COMPILE); if (glGetError()) return; glColor3f(0.5, 0.5, 0.5); glLineWidth(2.0); glBegin(GL_LINES); for (k = 0; k < 21; k += 5) { glVertex3f(k * 0.05, 0., 0.); glVertex3f(k * 0.05, 1., 0.); glVertex3f(0., k * 0.05, 0.); glVertex3f(1., k * 0.05, 0.); } glEnd(); glColor3f(0.6, 0.6, 0.6); glLineWidth(1.0); glBegin(GL_LINES); for (k = 0; k < 21; k++) { if (k % 5 == 0) continue; glVertex3f(k * 0.05, 0., 0.); glVertex3f(k * 0.05, 1., 0.); glVertex3f(0., k * 0.05, 0.); glVertex3f(1., k * 0.05, 0.); } glEnd(); glEndList(); } glPushMatrix(); glTranslatef(-1.5 * sc->dmax, -1.5 * sc->dmax, -0.5 * (mesh->zmax - mesh->zmin)); glScalef(3 * sc->dmax, 3 * sc->dmax, 3 * sc->dmax); glDisable(GL_LIGHTING); glCallList(sc->grid); glPopMatrix(); } /* draw HUD system for flight */ void drawHUD (pScene sc) { pCamera c; pMesh mesh; GLfloat xm, ym, x, y, dx, dy, alt; double azim, elev; int i, j; if (ddebug) fprintf(stdout, "drawHUD\n"); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(-0.5, 639.5, -0.5, 479.5); c = sc->camera; mesh = cv.mesh[sc->idmesh]; glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor3f(0.0, 0.5, 0.0); glLineWidth(1.0f); xm = sc->par.xs / 2.0f; ym = sc->par.ys / 2.0f; glRecti(200, 160, 440, 320); /* altitude */ glColor3f(1.0, 0.5, 0.0); output2(230, 330, "speed: %6.1f", 1000.0f * c->spmod / sc->dmax); switch (c->vecup) { case X_AXIS: alt = (c->eye[1] + mesh->xtra) / (mesh->xmax - mesh->xmin); break; case Y_AXIS: alt = (c->eye[1] + mesh->ytra) / (mesh->ymax - mesh->ymin); break; case Z_AXIS: alt = (c->eye[1] + mesh->ztra) / (mesh->zmax - mesh->zmin); break; default: alt = 0.0; break; } glColor3f(1.0, 0.5, 0.0); output2(350, 330, "alt: %9.1f", 1000.0f * alt); /* horiz rulers */ output2(310, 139.0f, "azim"); glColor3f(0.0, 1.0, 0.0); output2(197, 150, "-180"); output2(257, 150, " -90"); output2(317, 150, "0"); output2(377, 150, " 90"); output2(437, 150, "180"); x = 200.0f; glBegin(GL_LINES); for (i = 1; i < 8; i++) { x += 240.0 / 8.0; glVertex2f(x, 158.0); glVertex2f(x, 162.0); } glEnd(); /* vert rulers */ glColor3f(0.0, 1.0, 0.0); output2(185, 160, "-90"); output2(185, 200, "-45"); output2(185, 240, "0"); output2(185, 280, "45"); output2(185, 320, "90"); y = 160.0f; glBegin(GL_LINES); for (i = 1; i < 8; i++) { y += 160.0 / 8.0; glVertex2f(198, y); glVertex2f(202, y); } glEnd(); /* azimuth */ azim = Azimuth(c); if (azim > 0.0f) azim = 180.0f - azim; else if (azim < 0.0f) azim = -180.0f - azim; x = 2.0 / 3.0 * azim + 320.0f; glColor3f(1.0, 0.0, 0.0); glLineWidth(1.0); output2(x, 143.0, "%d", azim > 0 ? (int)(azim + 0.5) : (int)(azim - 0.5)); glBegin(GL_LINES); glVertex2f(x, 166.0); glVertex2f(x, 318.0); glEnd(); y = 160.0f; dy = 160.0 / 8.0; glBegin(GL_LINES); for (i = 0; i < 8; i++) { glVertex2f(x - 4, y); glVertex2f(x + 4, y); for (j = 0; j < 5; j++) { glVertex2f(x - 2, y + j * dy / 5.0); glVertex2f(x + 2, y + j * dy / 5.0); } y += dy; } glEnd(); /* elevation */ elev = Elevation(c); if (elev > 90.0f) y = 320.0f; else if (elev < -90.0f) y = 160.0f; else y = 8.0 / 9.0 * elev + 240.0; glColor3f(1.0, 0.0, 0.0); output2(175.0, y, "%5.1f", elev); glBegin(GL_LINES); glVertex2f(206.0, y); glVertex2f(438.0, y); glEnd(); x = 200.0f; dx = 240.0f / 8.0f; glBegin(GL_LINES); for (i = 1; i <= 8; i++) { glVertex2f(x, y - 4); glVertex2f(x, y + 4); for (j = 0; j < 5; j++) { glVertex2f(x + j * dx / 5.0, y - 2); glVertex2f(x + j * dx / 5.0, y + 2); } x += dx; } glEnd(); /* horizon */ glLineWidth(2.0f); glColor3f(0.0, 0.0, 1.0); glBegin(GL_LINES); glVertex2f(200.0, 240.0); glVertex2f(440.0, 240.0); glEnd(); glLineWidth(1.0f); /* HUD */ glColor3f(1.0, 0.0, 0.0); glBegin(GL_LINES); glVertex2f(310, 230); glVertex2f(330, 230); glVertex2f(310, 250); glVertex2f(330, 250); glVertex2f(310, 230); glVertex2f(310, 234); glVertex2f(330, 230); glVertex2f(330, 234); glVertex2f(310, 246); glVertex2f(310, 250); glVertex2f(330, 246); glVertex2f(330, 250); glEnd(); /*glRecti(318,238,322,242);*/ glColor3f(0.0, 1.0, 0.0); glLineWidth(3.0f); glBegin(GL_LINES); glVertex2f(320., 235.); glVertex2f(320., 245.); glVertex2f(315., 240.); glVertex2f(325., 240.); glEnd(); glLineWidth(1.0f); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST); } freefem++-3.61-1/src/medit/util.c000644 000767 000024 00000020670 13312446271 016622 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include #include #include "medit.h" #include "extern.h" #include "sproto.h" static GLfloat IdMatrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; /* set font style and size */ void setFont (char *name, int size) { GLvoid *font_style = GLUT_BITMAP_HELVETICA_10; if (!strcmp(name, "helvetica")) { if (size == 12) font_style = GLUT_BITMAP_HELVETICA_12; else if (size == 18) font_style = GLUT_BITMAP_HELVETICA_18; } else if (strcmp(name, "times roman") == 0) { font_style = GLUT_BITMAP_TIMES_ROMAN_10; if (size == 24) font_style = GLUT_BITMAP_TIMES_ROMAN_24; } /* * else if (strcmp(name, "8x13") == 0) * font_style = GLUT_BITMAP_8_BY_13; */ else if (strcmp(name, "9x15") == 0) { font_style = GLUT_BITMAP_9_BY_15; } //TODO do something with that ? printf("%s", font_style); } /* display string format at pos(x,y) */ void drwstr (GLuint x, GLuint y, char *format, ...) { va_list args; char *s, buffer[255]; va_start(args, format); vsprintf(buffer, format, args); va_end(args); glRasterPos2i(x, y); for (s = buffer; *s; s++) { glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *s); } } void output2 (GLfloat x, GLfloat y, char *format, ...) { va_list args; char *s, buffer[255]; /*strcpy(myerror.procname,"output2");*/ va_start(args, format); vsprintf(buffer, format, args); va_end(args); glRasterPos2f(x, y); for (s = buffer; *s; s++) { /*glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10,*s);*/ /*glutBitmapCharacter(font_style,*s);*/ glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *s); } } void output3 (GLfloat x, GLfloat y, GLfloat z, char *format, ...) { va_list args; char buffer[255], *s; /*strcpy(myerror.procname,"output3");*/ va_start(args, format); vsprintf(buffer, format, args); va_end(args); glRasterPos3f(x, y, z); for (s = buffer; *s; s++) { glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *s); } } /* color converter */ void hsvrgb (double *hsv, double *rgb) { double f, p, q, t; int i; hsv[0] = ((int)hsv[0] % 360) / 60.; i = (int)floor((double)hsv[0]); /* largest int <= h */ f = hsv[0] - i; /* fractional part of h */ p = hsv[2] * (1.0 - hsv[1]); q = hsv[2] * (1.0 - (hsv[1] * f)); t = hsv[2] * (1.0 - (hsv[1] * (1.0 - f))); switch (i) { case 0: rgb[0] = hsv[2]; rgb[1] = t; rgb[2] = p; break; case 1: rgb[0] = q; rgb[1] = hsv[2]; rgb[2] = p; break; case 2: rgb[0] = p; rgb[1] = hsv[2]; rgb[2] = t; break; case 3: rgb[0] = p; rgb[1] = q; rgb[2] = hsv[2]; break; case 4: rgb[0] = t; rgb[1] = p; rgb[2] = hsv[2]; break; case 5: rgb[0] = hsv[2]; rgb[1] = p; rgb[2] = q; break; } } /* transform: u = MxV */ void transformPoint (double u[4], float v[4], float m[16]) { u[0] = v[0] * m[0] + v[1] * m[1] + v[2] * m[2] + v[3] * m[3]; u[1] = v[0] * m[4] + v[1] * m[5] + v[2] * m[6] + v[3] * m[7]; u[2] = v[0] * m[8] + v[1] * m[9] + v[2] * m[10] + v[3] * m[11]; u[3] = v[0] * m[12] + v[1] * m[13] + v[2] * m[14] + v[3] * m[15]; } void transformPoint2 (double u[4], float v[4], float m[16]) { u[0] = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12]; u[1] = v[0] * m[1] + v[1] * m[5] + v[2] * m[9] + v[3] * m[13]; u[2] = v[0] * m[2] + v[1] * m[6] + v[2] * m[10] + v[3] * m[14]; u[3] = v[0] * m[3] + v[1] * m[7] + v[2] * m[11] + v[3] * m[15]; } void transformPointd (double u[3], double v[3], double m[16]) { u[0] = v[0] * m[0] + v[1] * m[1] + v[2] * m[2]; u[1] = v[0] * m[4] + v[1] * m[5] + v[2] * m[6]; u[2] = v[0] * m[8] + v[1] * m[9] + v[2] * m[10]; } void transformVector (float u[4], float v[4], float m[16]) { u[0] = v[0] * m[0] + v[1] * m[4] + v[2] * m[8]; u[1] = v[0] * m[1] + v[1] * m[5] + v[2] * m[9]; u[2] = v[0] * m[2] + v[1] * m[6] + v[2] * m[10]; u[3] = v[0] * m[3] + v[1] * m[7] + v[2] * m[11]; } /* p = axb */ void multMatrix (GLfloat *p, GLfloat *a, GLfloat *b) { GLint i, row; for (i = 0; i < 4; i++) { row = i * 4; p[row + 0] = a[row] * b[0] + a[row + 1] * b[4] + a[row + 2] * b[8] + a[row + 3] * b[12]; p[row + 1] = a[row] * b[1] + a[row + 1] * b[5] + a[row + 2] * b[9] + a[row + 3] * b[13]; p[row + 2] = a[row] * b[2] + a[row + 1] * b[6] + a[row + 2] * b[10] + a[row + 3] * b[14]; p[row + 3] = a[row] * b[3] + a[row + 1] * b[7] + a[row + 2] * b[11] + a[row + 3] * b[15]; } } void rotateMatrix (GLfloat angle, GLfloat x, GLfloat y, GLfloat z, GLfloat rm[16]) { GLfloat mag, s, c; GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c; if (angle == 0.0f) { memcpy(rm, IdMatrix, 16 * sizeof(GLfloat)); return; } mag = x * x + y * y + z * z; if (mag == 0.0f) { memcpy(rm, IdMatrix, 16 * sizeof(GLfloat)); return; } mag = 1.0f / sqrt(mag); x *= mag; y *= mag; z *= mag; s = sin(angle * DTOR); c = cos(angle * DTOR); xx = x * x; yy = y * y; zz = z * z; xy = x * y; yz = y * z; zx = z * x; xs = x * s; ys = y * s; zs = z * s; one_c = 1.0f - c; rm[0] = (one_c * xx) + c; rm[1] = (one_c * xy) - zs; rm[2] = (one_c * zx) + ys; rm[3] = 0.0f; rm[4] = (one_c * xy) + zs; rm[5] = (one_c * yy) + c; rm[6] = (one_c * yz) - xs; rm[7] = 0.0f; rm[8] = (one_c * zx) - ys; rm[9] = (one_c * yz) + xs; rm[10] = (one_c * zz) + c; rm[11] = 0.0f; rm[12] = rm[13] = rm[14] = 0.0f; rm[15] = 1.0f; } int invertMatrix (float src[16], float inverse[16]) { double t; int i, j, k; double tmp[4][4]; memcpy(inverse, IdMatrix, 16 * sizeof(GLfloat)); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { tmp[i][j] = src[i * 4 + j]; } } for (i = 0; i < 4; i++) { int swap; /* look for largest element in column. */ swap = i; for (j = i + 1; j < 4; j++) { if (fabs(tmp[j][i]) > fabs(tmp[i][i])) swap = j; } if (swap != i) { /* swap rows. */ for (k = 0; k < 4; k++) { t = tmp[i][k]; tmp[i][k] = tmp[swap][k]; tmp[swap][k] = t; t = inverse[i * 4 + k]; inverse[i * 4 + k] = inverse[swap * 4 + k]; inverse[swap * 4 + k] = t; } } /* The matrix is singular. */ if (tmp[i][i] == 0) return (0); t = tmp[i][i]; for (k = 0; k < 4; k++) { tmp[i][k] /= t; inverse[i * 4 + k] /= t; } for (j = 0; j < 4; j++) { if (j != i) { t = tmp[j][i]; for (k = 0; k < 4; k++) { tmp[j][k] -= tmp[i][k] * t; inverse[j * 4 + k] -= inverse[i * 4 + k] * t; } } } } return (1); } void print_matrix (const GLfloat m[16], const char *ligne) { int i; printf("---- %s ----\n", ligne); for (i = 0; i < 4; i++) { printf("%f %f %f %f\n", m[i], m[4 + i], m[8 + i], m[12 + i]); } printf("---------------------------------\n"); } void print_matrixd (const GLdouble m[16], const char *ligne) { int i; printf("---- %s ----\n", ligne); for (i = 0; i < 4; i++) { printf("%f %f %f %f\n", m[i], m[4 + i], m[8 + i], m[12 + i]); } printf("---------------------------------\n"); } int filnum (char *data, int numdep, char *ext) { do { FILE *in; char tmpstr[256]; sprintf(tmpstr, "%s.%.3d.%s", data, numdep, ext); in = fopen(tmpstr, "r"); if (!in) return (numdep); fclose(in); } while (++numdep < 999); return (-1); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/persp.c000644 000767 000024 00000006350 13312446271 016775 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include #include "medit.h" #include "extern.h" #include "sproto.h" static float ident[16] = { 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1. }; void setPersp (pScene sc, pPersp p, int pmode) { float tgalpha, deltax, deltay, alphax, alphay, alpha, beta; float /*rapx, */rapy, Deltax, Deltay, yy; /* defalut */ Deltax = sc->par.xs; Deltay = sc->par.ys; alphax = p->fovy / 2.0f; alphay = p->fovy / 2.0f; deltax = (p->rubix + p->rubfx - Deltax) / (float)Deltax; deltay = (p->rubiy + p->rubfy - Deltay) / (float)Deltay; alpha = atan(deltax * tan(alphax * DTOR)); beta = atan(deltay * tan(alphay * DTOR)); yy = cos(alpha) * cos(alpha) * sin(beta) * sin(beta); yy /= yy + cos(beta) * cos(beta); yy = sqrt(yy); p->gamma = asin(yy) * RTOD; if (deltay < 0.) p->gamma = -p->gamma; p->alpha = alpha * RTOD; /* new fovy */ tgalpha = tan(p->fovy * DTOR); /*rapx = fabs(p->rubfx - p->rubix) / (float)sc->par.xs;*/ rapy = fabs(p->rubfy - p->rubiy) / (float)sc->par.ys; if (pmode == 1) p->fovy = atan(tgalpha * rapy) * RTOD; else if (pmode == 0) p->fovy = atan(tgalpha / rapy) * RTOD; p->rubix = p->rubfx = 0; p->rubiy = p->rubfy = 0; } pPersp initPersp (pPersp p, float dmax) { pPersp pp; if (p) { p->fovy = 35.0f; p->rubber = 0; p->rubix = p->rubfx = 0; p->rubiy = p->rubfy = 0; p->alpha = p->gamma = 0.0f; p->depth = -2.0 * dmax; p->pmode = PERSPECTIVE; memcpy(p->matrix, ident, 16 * sizeof(float)); return (p); } else { pp = (pPersp)M_calloc(1, sizeof(struct sperspective), "persp"); assert(pp); pp->fovy = 35.0f; pp->rubber = 0; pp->rubix = pp->rubfx = 0; pp->rubiy = pp->rubfy = 0; pp->alpha = pp->gamma = 0.0f; pp->depth = -2.0 * dmax; pp->pmode = PERSPECTIVE; memcpy(pp->matrix, ident, 16 * sizeof(float)); return (pp); } } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/mlists.c000644 000767 000024 00000110014 13312446271 017150 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" static int ct[4][3] = {{0, 1, 2}, {0, 3, 1}, {1, 3, 2}, {0, 2, 3}}; static int ch[6][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {0, 3, 7, 4}}; /* recursively subdivide a triangle */ void cutTriangle (pScene sc, triangle t) { triangle t1, t2; double kc, rgb[4], maxe; int ia, ib, ic, iedge; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* analyze triangle edges */ if (t.va < sc->iso.val[0]) t.va = sc->iso.val[0]; else if (t.va > sc->iso.val[MAXISO - 1]) t.va = sc->iso.val[MAXISO - 1]; if (t.vb < sc->iso.val[0]) t.vb = sc->iso.val[0]; else if (t.vb > sc->iso.val[MAXISO - 1]) t.vb = sc->iso.val[MAXISO - 1]; if (t.vc < sc->iso.val[0]) t.vc = sc->iso.val[0]; else if (t.vc > sc->iso.val[MAXISO - 1]) t.vc = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (t.va < sc->iso.val[ia]) break; } for (ib = 0; ib < MAXISO - 1; ib++) { if (t.vb < sc->iso.val[ib]) break; } for (ic = 0; ic < MAXISO - 1; ic++) { if (t.vc < sc->iso.val[ic]) break; } /* search longest edge */ maxe = fabs(t.va - t.vb); iedge = 1; if (maxe < fabs(t.vb - t.vc)) { maxe = fabs(t.vb - t.vc); iedge = 2; } if (maxe < fabs(t.va - t.vc)) { maxe = fabs(t.va - t.vc); iedge = 3; } /* split longest edge */ if (maxe > 0.0) { double x, dd; int i; switch (iedge) { case 1: /* edge a-b */ x = ia < ib ? sc->iso.val[ia] : sc->iso.val[ib]; dd = (x - t.va) / (t.vb - t.va); if (dd > 0.001 && dd < 0.999) { memcpy(&t1, &t, sizeof(struct triangle)); memcpy(&t2, &t, sizeof(struct triangle)); for (i = 0; i < 3; i++) { t1.b[i] = t2.a[i] = t.a[i] + dd * (t.b[i] - t.a[i]); t1.nb[i] = t2.na[i] = t.na[i] + dd * (t.nb[i] - t.na[i]); } t1.vb = t2.va = x; cutTriangle(sc, t1); cutTriangle(sc, t2); return; } break; case 2: /* edge b-c */ x = ib < ic ? sc->iso.val[ib] : sc->iso.val[ic]; dd = (x - t.vb) / (t.vc - t.vb); if (dd > 0.001f && dd < 0.999f) { memcpy(&t1, &t, sizeof(struct triangle)); memcpy(&t2, &t, sizeof(struct triangle)); for (i = 0; i < 3; i++) { t1.c[i] = t2.b[i] = t.b[i] + dd * (t.c[i] - t.b[i]); t1.nc[i] = t2.nb[i] = t.nb[i] + dd * (t.nc[i] - t.nb[i]); } t1.vc = t2.vb = x; cutTriangle(sc, t1); cutTriangle(sc, t2); return; } break; case 3: /* edge c-a */ x = ia < ic ? sc->iso.val[ia] : sc->iso.val[ic]; dd = (x - t.va) / (t.vc - t.va); if (dd > 0.001f && dd < 0.999f) { memcpy(&t1, &t, sizeof(struct triangle)); memcpy(&t2, &t, sizeof(struct triangle)); for (i = 0; i < 3; i++) { t1.c[i] = t2.a[i] = t.a[i] + dd * (t.c[i] - t.a[i]); t1.nc[i] = t2.na[i] = t.na[i] + dd * (t.nc[i] - t.na[i]); } t1.vc = t2.va = x; cutTriangle(sc, t1); cutTriangle(sc, t2); return; } break; } } /* draw triangle */ if (t.va < sc->iso.val[0]) t.va = sc->iso.val[0]; else if (t.va > sc->iso.val[MAXISO - 1]) t.va = sc->iso.val[MAXISO - 1]; kc = (t.va - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor4dv(rgb); glNormal3fv(t.na); glVertex3fv(t.a); if (t.vb < sc->iso.val[0]) t.vb = sc->iso.val[0]; else if (t.vb > sc->iso.val[MAXISO - 1]) t.vb = sc->iso.val[MAXISO - 1]; kc = (t.vb - sc->iso.val[ib - 1]) / (sc->iso.val[ib] - sc->iso.val[ib - 1]); hsv[0] = sc->iso.col[ib - 1] * (1.0 - kc) + sc->iso.col[ib] * kc; hsvrgb(hsv, rgb); glColor4dv(rgb); glNormal3fv(t.nb); glVertex3fv(t.b); if (t.vc < sc->iso.val[0]) t.vc = sc->iso.val[0]; else if (t.vc > sc->iso.val[MAXISO - 1]) t.vc = sc->iso.val[MAXISO - 1]; kc = (t.vc - sc->iso.val[ic - 1]) / (sc->iso.val[ic] - sc->iso.val[ic - 1]); hsv[0] = sc->iso.col[ic - 1] * (1.0 - kc) + sc->iso.col[ic] * kc; hsvrgb(hsv, rgb); glColor4dv(rgb); glNormal3fv(t.nc); glVertex3fv(t.c); } /* metric map: use linear interpolation on values * rather than color interpolation ! */ GLuint listTriaMap (pScene sc, pMesh mesh) { pMaterial pm; pTriangle pt; pPoint p0, p1, p2; pSolution ps0, ps1, ps2; GLint dlist; double ax, ay, az, bx, by, bz, dd; float cx, cy, cz, n[3]; int m, is0, is1, is2; triangle t; /* default */ if (!mesh->nt) return (0); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("create display list map / TRIA\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; if (sc->type & S_FLAT) { glBegin(GL_TRIANGLES); while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } memcpy(t.na, n, 3 * sizeof(float)); memcpy(t.nb, n, 3 * sizeof(float)); memcpy(t.nc, n, 3 * sizeof(float)); if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.0; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.0; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.0; t.a[0] = sc->shrink * (p0->c[0] - cx) + cx; t.a[1] = sc->shrink * (p0->c[1] - cy) + cy; t.a[2] = sc->shrink * (p0->c[2] - cz) + cz; t.b[0] = sc->shrink * (p1->c[0] - cx) + cx; t.b[1] = sc->shrink * (p1->c[1] - cy) + cy; t.b[2] = sc->shrink * (p1->c[2] - cz) + cz; t.c[0] = sc->shrink * (p2->c[0] - cx) + cx; t.c[1] = sc->shrink * (p2->c[1] - cy) + cy; t.c[2] = sc->shrink * (p2->c[2] - cz) + cz; } else { t.a[0] = p0->c[0]; t.a[1] = p0->c[1]; t.a[2] = p0->c[2]; t.b[0] = p1->c[0]; t.b[1] = p1->c[1]; t.b[2] = p1->c[2]; t.c[0] = p2->c[0]; t.c[1] = p2->c[1]; t.c[2] = p2->c[2]; } if (mesh->typage == 2) { ps0 = &mesh->sol[pt->v[0]]; ps1 = &mesh->sol[pt->v[1]]; ps2 = &mesh->sol[pt->v[2]]; t.va = ps0->bb; t.vb = ps1->bb; t.vc = ps2->bb; } else { ps0 = &mesh->sol[k]; t.va = t.vb = t.vc = ps0->bb; } cutTriangle(sc, t); k = pt->nxt; } glEnd(); } else { glBegin(GL_TRIANGLES); while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } is0 = is1 = is2 = 0; if (mesh->extra->iv) { if (pt->v[0] <= mesh->nvn) is0 = mesh->extra->nv[pt->v[0]]; if (pt->v[1] <= mesh->nvn) is1 = mesh->extra->nv[pt->v[1]]; if (pt->v[2] <= mesh->nvn) is2 = mesh->extra->nv[pt->v[2]]; } if (!is0 && pt->v[0] <= mesh->extra->it) is0 = mesh->extra->nt[3 * (k - 1) + 1]; if (!is1 && pt->v[1] <= mesh->extra->it) is1 = mesh->extra->nt[3 * (k - 1) + 2]; if (!is2 && pt->v[2] <= mesh->extra->it) is2 = mesh->extra->nt[3 * (k - 1) + 3]; if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.; t.a[0] = sc->shrink * (p0->c[0] - cx) + cx; t.a[1] = sc->shrink * (p0->c[1] - cy) + cy; t.a[2] = sc->shrink * (p0->c[2] - cz) + cz; t.b[0] = sc->shrink * (p1->c[0] - cx) + cx; t.b[1] = sc->shrink * (p1->c[1] - cy) + cy; t.b[2] = sc->shrink * (p1->c[2] - cz) + cz; t.c[0] = sc->shrink * (p2->c[0] - cx) + cx; t.c[1] = sc->shrink * (p2->c[1] - cy) + cy; t.c[2] = sc->shrink * (p2->c[2] - cz) + cz; } else { t.a[0] = p0->c[0]; t.a[1] = p0->c[1]; t.a[2] = p0->c[2]; t.b[0] = p1->c[0]; t.b[1] = p1->c[1]; t.b[2] = p1->c[2]; t.c[0] = p2->c[0]; t.c[1] = p2->c[1]; t.c[2] = p2->c[2]; } if (!is0) { memcpy(t.na, n, 3 * sizeof(float)); } else { t.na[0] = mesh->extra->n[3 * (is0 - 1) + 1]; t.na[1] = mesh->extra->n[3 * (is0 - 1) + 2]; t.na[2] = mesh->extra->n[3 * (is0 - 1) + 3]; } if (!is1) { memcpy(t.nb, n, 3 * sizeof(float)); } else { t.nb[0] = mesh->extra->n[3 * (is1 - 1) + 1]; t.nb[1] = mesh->extra->n[3 * (is1 - 1) + 2]; t.nb[2] = mesh->extra->n[3 * (is1 - 1) + 3]; } if (!is2) { memcpy(t.nc, n, 3 * sizeof(float)); } else { t.nc[0] = mesh->extra->n[3 * (is2 - 1) + 1]; t.nc[1] = mesh->extra->n[3 * (is2 - 1) + 2]; t.nc[2] = mesh->extra->n[3 * (is2 - 1) + 3]; } if (mesh->typage == 2) { ps0 = &mesh->sol[pt->v[0]]; ps1 = &mesh->sol[pt->v[1]]; ps2 = &mesh->sol[pt->v[2]]; t.va = ps0->bb; t.vb = ps1->bb; t.vc = ps2->bb; } else { ps0 = &mesh->sol[k]; t.va = t.vb = t.vc = ps0->bb; } cutTriangle(sc, t); k = pt->nxt; } glEnd(); } } glEndList(); return (dlist); } /* build list of quadrilaterals */ GLuint listQuadMap (pScene sc, pMesh mesh) { pMaterial pm; pQuad pq; pPoint p0, p1, p2, p3; pSolution ps0, ps1, ps2, ps3; GLint dlist = 0; double ax, ay, az, bx, by, bz, dd; float cx, cy, cz, n[3]; int m, is0, is1, is2, is3; triangle t1, t2; /* default */ if (!mesh->nq) return (0); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("create display list map / QUADS\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; glBegin(GL_TRIANGLES); while (k != 0) { pq = &mesh->quad[k]; if (pq->v[0] == 0) { k = pq->nxt; continue; } p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } if (sc->shrink < 1.0) { cx = 0.25 * (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]); cy = 0.25 * (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]); cz = 0.25 * (p0->c[2] + p1->c[2] + p2->c[2] + p3->c[2]); t1.a[0] = t2.a[0] = sc->shrink * (p0->c[0] - cx) + cx; t1.a[1] = t2.a[1] = sc->shrink * (p0->c[1] - cy) + cy; t1.a[2] = t2.a[2] = sc->shrink * (p0->c[2] - cz) + cz; t1.b[0] = sc->shrink * (p1->c[0] - cx) + cx; t1.b[1] = sc->shrink * (p1->c[1] - cy) + cy; t1.b[2] = sc->shrink * (p1->c[2] - cz) + cz; t1.c[0] = t2.b[0] = sc->shrink * (p2->c[0] - cx) + cx; t1.c[1] = t2.b[1] = sc->shrink * (p2->c[1] - cy) + cy; t1.c[2] = t2.b[2] = sc->shrink * (p2->c[2] - cz) + cz; t2.c[0] = sc->shrink * (p3->c[0] - cx) + cx; t2.c[1] = sc->shrink * (p3->c[1] - cy) + cy; t2.c[2] = sc->shrink * (p3->c[2] - cz) + cz; } else { t1.a[0] = t2.a[0] = p0->c[0]; t1.a[1] = t2.a[1] = p0->c[1]; t1.a[2] = t2.a[2] = p0->c[2]; t1.b[0] = p1->c[0]; t1.b[1] = p1->c[1]; t1.b[2] = p1->c[2]; t1.c[0] = t2.b[0] = p2->c[0]; t1.c[1] = t2.b[1] = p2->c[1]; t1.c[2] = t2.b[2] = p2->c[2]; t2.c[0] = p3->c[0]; t2.c[1] = p3->c[1]; t2.c[2] = p3->c[2]; } if (sc->type & S_FLAT) { memcpy(t1.na, n, 3 * sizeof(float)); memcpy(t1.nb, n, 3 * sizeof(float)); memcpy(t1.nc, n, 3 * sizeof(float)); memcpy(t2.na, n, 3 * sizeof(float)); memcpy(t2.nb, n, 3 * sizeof(float)); memcpy(t2.nc, n, 3 * sizeof(float)); } else { is0 = is1 = is2 = is3 = 0; if (mesh->extra->iv) { if (pq->v[0] <= mesh->nvn) is0 = mesh->extra->nv[pq->v[0]]; if (pq->v[1] <= mesh->nvn) is1 = mesh->extra->nv[pq->v[1]]; if (pq->v[2] <= mesh->nvn) is2 = mesh->extra->nv[pq->v[2]]; if (pq->v[3] <= mesh->nvn) is3 = mesh->extra->nv[pq->v[3]]; } if (!is0 && pq->v[0] <= mesh->extra->iq) is0 = mesh->extra->nq[4 * (k - 1) + 1]; if (!is1 && pq->v[1] <= mesh->extra->iq) is1 = mesh->extra->nq[4 * (k - 1) + 2]; if (!is2 && pq->v[2] <= mesh->extra->iq) is2 = mesh->extra->nq[4 * (k - 1) + 3]; if (!is3 && pq->v[3] <= mesh->extra->iq) is3 = mesh->extra->nq[4 * (k - 1) + 4]; if (!is0) { memcpy(t1.na, n, 3 * sizeof(float)); } else { t1.na[0] = t2.na[0] = mesh->extra->n[3 * (is0 - 1) + 1]; t1.na[1] = t2.na[1] = mesh->extra->n[3 * (is0 - 1) + 2]; t1.na[2] = t2.na[2] = mesh->extra->n[3 * (is0 - 1) + 3]; } if (!is1) { memcpy(t1.nb, n, 3 * sizeof(float)); } else { t1.nb[0] = mesh->extra->n[3 * (is1 - 1) + 1]; t1.nb[1] = mesh->extra->n[3 * (is1 - 1) + 2]; t1.nb[2] = mesh->extra->n[3 * (is1 - 1) + 3]; } if (!is2) { memcpy(t1.nc, n, 3 * sizeof(float)); } else { t1.nc[0] = t2.nb[0] = mesh->extra->n[3 * (is2 - 1) + 1]; t1.nc[1] = t2.nb[1] = mesh->extra->n[3 * (is2 - 1) + 2]; t1.nc[2] = t2.nb[2] = mesh->extra->n[3 * (is2 - 1) + 3]; } if (!is3) { memcpy(t1.nc, n, 3 * sizeof(float)); } else { t2.nc[0] = mesh->extra->n[3 * (is3 - 1) + 1]; t2.nc[1] = mesh->extra->n[3 * (is3 - 1) + 2]; t2.nc[2] = mesh->extra->n[3 * (is3 - 1) + 3]; } } if (mesh->typage == 2) { /* solutions at vertices */ ps0 = &mesh->sol[pq->v[0]]; ps1 = &mesh->sol[pq->v[1]]; ps2 = &mesh->sol[pq->v[2]]; ps3 = &mesh->sol[pq->v[3]]; t1.va = t2.va = ps0->bb; t1.vb = ps1->bb; t1.vc = t2.vb = ps2->bb; t2.vc = ps3->bb; } else { /* solution at element */ ps0 = &mesh->sol[k]; t1.va = t1.vb = t1.vc = ps0->bb; t2.va = t2.vb = t2.vc = ps0->bb; } /* color interpolation */ cutTriangle(sc, t1); cutTriangle(sc, t2); k = pq->nxt; } glEnd(); } glEndList(); return (dlist); } /* build list of tetrahedra */ GLuint listTetraMap (pScene sc, pMesh mesh, ubyte clip) { pMaterial pm; pTetra pt; pPoint p0, p1, p2; pSolution ps0, ps1, ps2; GLint dlist = 0; float cx, cy, cz, ax, ay, az, bx, by, bz, d, n[3]; int l, m; triangle t; /* default */ if (!mesh->ntet) return (0); if (ddebug) printf("create display list map / TETRA\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; glBegin(GL_TRIANGLES); while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || (clip && !pt->clip)) { k = pt->nxt; continue; } /* build 4 faces */ cx = cy = cz = 0.0f; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; } cx /= 4.; cy /= 4.; cz /= 4.; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[ct[l][0]]]; p1 = &mesh->point[pt->v[ct[l][1]]]; p2 = &mesh->point[pt->v[ct[l][2]]]; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } /* store triangle */ t.a[0] = sc->shrink * (p0->c[0] - cx) + cx; t.a[1] = sc->shrink * (p0->c[1] - cy) + cy; t.a[2] = sc->shrink * (p0->c[2] - cz) + cz; t.b[0] = sc->shrink * (p1->c[0] - cx) + cx; t.b[1] = sc->shrink * (p1->c[1] - cy) + cy; t.b[2] = sc->shrink * (p1->c[2] - cz) + cz; t.c[0] = sc->shrink * (p2->c[0] - cx) + cx; t.c[1] = sc->shrink * (p2->c[1] - cy) + cy; t.c[2] = sc->shrink * (p2->c[2] - cz) + cz; /* store normals */ memcpy(t.na, n, 3 * sizeof(float)); memcpy(t.nb, n, 3 * sizeof(float)); memcpy(t.nc, n, 3 * sizeof(float)); if (mesh->typage == 2) { /* solutions at vertices */ ps0 = &mesh->sol[pt->v[ct[l][0]]]; ps1 = &mesh->sol[pt->v[ct[l][1]]]; ps2 = &mesh->sol[pt->v[ct[l][2]]]; t.va = ps0->bb; t.vb = ps1->bb; t.vc = ps2->bb; } else { /* solution at element */ ps0 = &mesh->sol[k]; t.va = t.vb = t.vc = ps0->bb; } /* color interpolation */ cutTriangle(sc, t); } k = pt->nxt; } glEnd(); } glEndList(); return (dlist); } /* build list of hexahedra */ GLuint listHexaMap (pScene sc, pMesh mesh, ubyte clip) { pMaterial pm; pHexa ph; pPoint p0, p1, p2, p3; pSolution ps0, ps1, ps2, ps3; GLint dlist = 0; double ax, ay, az, bx, by, bz, d; float n[3], cx, cy, cz; int l, m; triangle t1, t2; if (!mesh->nhex) return (0); if (ddebug) printf("create display list map / HEXA\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LHexa]; if (!k || pm->flag) continue; glBegin(GL_TRIANGLES); while (k != 0) { ph = &mesh->hexa[k]; if (!ph->v[0] || (clip && !ph->clip)) { k = ph->nxt; continue; } cx = cy = cz = 0.0f; for (l = 0; l < 8; l++) { p0 = &mesh->point[ph->v[l]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; } cx /= 8.; cy /= 8.; cz /= 8.; for (l = 0; l < 6; l++) { p0 = &mesh->point[ph->v[ch[l][0]]]; p1 = &mesh->point[ph->v[ch[l][1]]]; p2 = &mesh->point[ph->v[ch[l][2]]]; p3 = &mesh->point[ph->v[ch[l][3]]]; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } /* store triangles */ t1.a[0] = t2.a[0] = sc->shrink * (p0->c[0] - cx) + cx; t1.a[1] = t2.a[1] = sc->shrink * (p0->c[1] - cy) + cy; t1.a[2] = t2.a[2] = sc->shrink * (p0->c[2] - cz) + cz; t1.b[0] = sc->shrink * (p1->c[0] - cx) + cx; t1.b[1] = sc->shrink * (p1->c[1] - cy) + cy; t1.b[2] = sc->shrink * (p1->c[2] - cz) + cz; t1.c[0] = t2.b[0] = sc->shrink * (p2->c[0] - cx) + cx; t1.c[1] = t2.b[1] = sc->shrink * (p2->c[1] - cy) + cy; t1.c[2] = t2.b[2] = sc->shrink * (p2->c[2] - cz) + cz; t2.c[0] = sc->shrink * (p3->c[0] - cx) + cx; t2.c[1] = sc->shrink * (p3->c[1] - cy) + cy; t2.c[2] = sc->shrink * (p3->c[2] - cz) + cz; /* store normals */ memcpy(t1.na, n, 3 * sizeof(float)); memcpy(t1.nb, n, 3 * sizeof(float)); memcpy(t1.nc, n, 3 * sizeof(float)); memcpy(t2.na, n, 3 * sizeof(float)); memcpy(t2.nb, n, 3 * sizeof(float)); memcpy(t2.nc, n, 3 * sizeof(float)); if (mesh->typage == 2) { /* solutions at vertices */ ps0 = &mesh->sol[ph->v[ch[l][0]]]; ps1 = &mesh->sol[ph->v[ch[l][1]]]; ps2 = &mesh->sol[ph->v[ch[l][2]]]; ps3 = &mesh->sol[ph->v[ch[l][3]]]; t1.va = t2.va = ps0->bb; t1.vb = ps1->bb; t1.vc = t2.vb = ps2->bb; t2.vc = ps3->bb; } else { /* solution at element */ ps0 = &mesh->sol[k]; t1.va = t1.vb = t1.vc = ps0->bb; t2.va = t2.vb = t2.vc = ps0->bb; } /* color interpolation */ cutTriangle(sc, t1); cutTriangle(sc, t2); } k = ph->nxt; } glEnd(); } glEndList(); return (dlist); } GLuint alt2dList (pScene sc, pMesh mesh, int geomtype, float shrink, float altcoef) { pTriangle pt, pt1; pMaterial pm; pQuad pq; pPoint p0, p1, p2, p3; pSolution ps0, ps1, ps2, ps3; GLuint dlist; double ax, ay, az, bx, by, bz, dd, kc, rgb[4]; float cx, cy, cz, n[3]; int *adj, k, m, ia, iadr; ubyte *voy; triangle t, t1, t2; static double hsv[3] = {0.0, 1.0, 0.80}; static float nn[3] = {1.0, 0.0, 0.0}; /* default */ if (ddebug) printf("create 2d elevation map list\n"); if (geomtype == LTria && !mesh->nt) return (0); if (geomtype == LQuad && !mesh->nq) return (0); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); mesh->zmin = altcoef * mesh->bbmin; mesh->zmax = altcoef * mesh->bbmax; if (mesh->bbmin * mesh->bbmax < 0.0) mesh->ztra = mesh->zmin; else mesh->ztra = 0.95 * mesh->zmin; switch (geomtype) { case LTria: if (ddebug) printf("create triangle list %d\n", mesh->nt); if (mesh->typage == 1) if (mesh->nt && !hashTria(mesh)) return (0); glBegin(GL_TRIANGLES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; if (mesh->typage == 1) { ps0 = ps1 = ps2 = &mesh->sol[k]; } else { ps0 = &mesh->sol[pt->v[0]]; ps1 = &mesh->sol[pt->v[1]]; ps2 = &mesh->sol[pt->v[2]]; } cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.0; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.0; cz = (ps0->bb + ps1->bb + ps2->bb) / 3.0; t.a[0] = shrink * (p0->c[0] - cx) + cx; t.a[1] = shrink * (p0->c[1] - cy) + cy; t.a[2] = shrink * (altcoef * ps0->bb - cz) + cz - 0.25 * mesh->ztra; t.b[0] = shrink * (p1->c[0] - cx) + cx; t.b[1] = shrink * (p1->c[1] - cy) + cy; t.b[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t.c[0] = shrink * (p2->c[0] - cx) + cx; t.c[1] = shrink * (p2->c[1] - cy) + cy; t.c[2] = shrink * (altcoef * ps2->bb - cz) + cz - 0.25 * mesh->ztra; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } memcpy(t.na, n, 3 * sizeof(float)); memcpy(t.nb, n, 3 * sizeof(float)); memcpy(t.nc, n, 3 * sizeof(float)); t.va = ps0->bb; t.vb = ps1->bb; t.vc = ps2->bb; if (mesh->typage == 2) { cutTriangle(sc, t); } else { if (t.va < sc->iso.val[0]) t.va = sc->iso.val[0]; else if (t.va > sc->iso.val[MAXISO - 1]) t.va = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (t.va < sc->iso.val[ia]) break; } kc = (t.va - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor4dv(rgb); glNormal3fv(t.na); glVertex3fv(t.a); glVertex3fv(t.b); glVertex3fv(t.c); /* add quads to sides (thanks to F. Lagoutiere) */ iadr = 3 * (k - 1) + 1; adj = &mesh->adja[iadr]; voy = &mesh->voy[iadr]; if (adj[0] && adj[0] < k) { pt1 = &mesh->tria[adj[0]]; p3 = &mesh->point[pt1->v[voy[0]]]; ps1 = &mesh->sol[adj[0]]; cx = (p1->c[0] + p2->c[0] + p3->c[0]) / 3.0; cy = (p1->c[1] + p2->c[1] + p3->c[1]) / 3.0; cz = ps1->bb; memcpy(t1.a, t.b, 3 * sizeof(float)); memcpy(t1.b, t.c, 3 * sizeof(float)); memcpy(t1.c, t.b, 3 * sizeof(float)); t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps0->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); memcpy(t1.a, t.c, 3 * sizeof(float)); memcpy(t1.b, t.c, 3 * sizeof(float)); memcpy(t1.c, t.b, 3 * sizeof(float)); t1.b[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps1->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); } if (adj[1] && adj[1] < k) { pt1 = &mesh->tria[adj[1]]; p3 = &mesh->point[pt1->v[voy[1]]]; ps1 = &mesh->sol[adj[1]]; cx = (p0->c[0] + p2->c[0] + p3->c[0]) / 3.0; cy = (p0->c[1] + p2->c[1] + p3->c[1]) / 3.0; cz = ps1->bb; memcpy(t1.a, t.a, 3 * sizeof(float)); memcpy(t1.b, t.c, 3 * sizeof(float)); memcpy(t1.c, t.a, 3 * sizeof(float)); t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps0->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); memcpy(t1.a, t.c, 3 * sizeof(float)); memcpy(t1.b, t.c, 3 * sizeof(float)); memcpy(t1.c, t.a, 3 * sizeof(float)); t1.b[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps1->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); } if (adj[2] && adj[2] < k) { pt1 = &mesh->tria[adj[2]]; p3 = &mesh->point[pt1->v[voy[2]]]; ps1 = &mesh->sol[adj[2]]; cx = (p0->c[0] + p1->c[0] + p3->c[0]) / 3.0; cy = (p0->c[1] + p1->c[1] + p3->c[1]) / 3.0; cz = ps1->bb; memcpy(t1.a, t.a, 3 * sizeof(float)); memcpy(t1.b, t.b, 3 * sizeof(float)); memcpy(t1.c, t.a, 3 * sizeof(float)); t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps0->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); memcpy(t1.a, t.b, 3 * sizeof(float)); memcpy(t1.b, t.b, 3 * sizeof(float)); memcpy(t1.c, t.a, 3 * sizeof(float)); t1.b[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.c[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t1.va = ps0->bb; t1.vb = ps1->bb; t1.vc = ps1->bb; memcpy(t1.na, nn, 3 * sizeof(float)); memcpy(t1.nb, nn, 3 * sizeof(float)); memcpy(t1.nc, nn, 3 * sizeof(float)); cutTriangle(sc, t1); } } k = pt->nxt; } } glEnd(); break; case LQuad: if (ddebug) printf("create quadrilateral list %d\n", mesh->nq); glBegin(GL_TRIANGLES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; while (k != 0) { pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; if (mesh->typage == 1) { ps0 = ps1 = ps2 = ps3 = &mesh->sol[k]; } else { ps0 = &mesh->sol[pq->v[0]]; ps1 = &mesh->sol[pq->v[1]]; ps2 = &mesh->sol[pq->v[2]]; ps3 = &mesh->sol[pq->v[3]]; } cx = 0.25 * (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]); cy = 0.25 * (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]); cz = 0.25 * (ps0->bb + ps1->bb + ps2->bb + ps3->bb); t.a[0] = t2.a[0] = shrink * (p0->c[0] - cx) + cx; t.a[1] = t2.a[1] = shrink * (p0->c[1] - cy) + cy; t.a[2] = t2.a[2] = shrink * (altcoef * ps0->bb - cz) + cz - 0.25 * mesh->ztra; t.b[0] = shrink * (p1->c[0] - cx) + cx; t.b[1] = shrink * (p1->c[1] - cy) + cy; t.b[2] = shrink * (altcoef * ps1->bb - cz) + cz - 0.25 * mesh->ztra; t.c[0] = t2.b[0] = shrink * (p2->c[0] - cx) + cx; t.c[1] = t2.b[1] = shrink * (p2->c[1] - cy) + cy; t.c[2] = t2.b[2] = shrink * (altcoef * ps2->bb - cz) + cz - 0.25 * mesh->ztra; t2.c[0] = shrink * (p3->c[0] - cx) + cx; t2.c[1] = shrink * (p3->c[1] - cy) + cy; t2.c[2] = shrink * (altcoef * ps3->bb - cz) + cz - 0.25 * mesh->ztra; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } memcpy(t.na, n, 3 * sizeof(float)); memcpy(t.nb, n, 3 * sizeof(float)); memcpy(t.nc, n, 3 * sizeof(float)); memcpy(t2.na, n, 3 * sizeof(float)); memcpy(t2.nb, n, 3 * sizeof(float)); memcpy(t2.nc, n, 3 * sizeof(float)); t.va = t2.va = ps0->bb; t.vb = ps1->bb; t.vc = t2.vb = ps2->bb; t2.vc = ps3->bb; cutTriangle(sc, t); cutTriangle(sc, t2); k = pq->nxt; } } glEnd(); break; } glEndList(); return (dlist); } /* setup color table */ void setupPalette (pScene sc, pMesh mesh) { int i; if (ddebug) printf("create palette %f %f\n", mesh->bbmin, mesh->bbmax); if (!sc->iso.palette) { double delta; delta = mesh->bbmax - mesh->bbmin; for (i = 0; i < MAXISO; i++) { sc->iso.col[i] = 240.0 * (1.0 - (float)i / (MAXISO - 1)); sc->iso.val[i] = mesh->bbmin + i * delta / (MAXISO - 1); } sc->iso.palette = 1; } else { for (i = 0; i < MAXISO; i++) { sc->iso.col[i] = 240.0 * (1.0 - (float)i / (MAXISO - 1)); } } } /* build color palette */ GLuint drawPalette (pScene sc) { double rgb[3]; float ypos, inc, top, bottom, left, right; int i; static double hsv[3] = {1.0, 1.0, 0.80}; if (sc->iso.palette < 3) { float xpos; if (sc->iso.palette <= 2) { top = sc->par.ys - 20; bottom = top - 10; left = sc->par.xs / 10; right = sc->par.xs - left; } else if (sc->iso.palette == 2) { top = 40; bottom = top - 10; left = sc->par.xs / 10; right = sc->par.xs - left; } inc = (sc->par.xs - 2 * left) / (MAXISO - 1); xpos = left; glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_QUADS); for (i = 1; i < MAXISO; i++) { hsv[0] = sc->iso.col[i - 1]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(xpos, bottom); glVertex2f(xpos, top); hsv[0] = sc->iso.col[i]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(xpos + inc, top); glVertex2f(xpos + inc, bottom); xpos += inc; } glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(1.0); glColor3fv(sc->par.line); glRectf(left, bottom, xpos, top); /* graduate */ xpos = left / 2; bottom -= 10; top += 5; output2(xpos, bottom, "%.4E", sc->iso.val[0]); xpos = left; for (i = 1; i < MAXISO - 1; i++) { xpos += inc; if ((i % 2) == 0) { output2(xpos - 25.0, bottom, "%.4E", sc->iso.val[i]); glBegin(GL_LINES); glVertex2f(xpos, bottom + 15); glVertex2f(xpos, bottom + 10); glEnd(); } else { output2(xpos - 25.0, top, "%.4E", sc->iso.val[i]); glBegin(GL_LINES); glVertex2f(xpos, top - 10); glVertex2f(xpos, top - 5); glEnd(); } } output2(right - left / 2, bottom, "%.4E", sc->iso.val[MAXISO - 1]); } else if (sc->iso.palette == 3) { bottom = sc->par.ys / 10; top = sc->par.ys - bottom; left = 10; right = left + 15; inc = (sc->par.ys - 2 * bottom) / (MAXISO - 1); ypos = bottom; glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_QUADS); for (i = 1; i < MAXISO; i++) { hsv[0] = sc->iso.col[i - 1]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(left, ypos); glVertex2f(right, ypos); hsv[0] = sc->iso.col[i]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(right, ypos + inc); glVertex2f(left, ypos + inc); ypos += inc; } glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(1.0); glColor3fv(sc->par.line); glRectf(left, bottom, right, top); /* graduate */ ypos = bottom; right += 5; output2(right, bottom, "%.4E", sc->iso.val[0]); for (i = 1; i < MAXISO - 1; i++) { ypos += inc; output2(right, ypos, "%.4E", sc->iso.val[i]); glBegin(GL_LINES); glVertex2f(right - 5, ypos); glVertex2f(right - 13, ypos); glEnd(); } output2(right, top, "%.4E", sc->iso.val[MAXISO - 1]); } else { bottom = sc->par.ys / 10; top = sc->par.ys - bottom; right = sc->par.xs - 10; left = right - 15; inc = (sc->par.ys - 2 * bottom) / (MAXISO - 1); ypos = bottom; glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_QUADS); for (i = 1; i < MAXISO; i++) { hsv[0] = sc->iso.col[i - 1]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(left, ypos); glVertex2f(right, ypos); hsv[0] = sc->iso.col[i]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex2f(right, ypos + inc); glVertex2f(left, ypos + inc); ypos += inc; } glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(1.0); glColor3fv(sc->par.line); glRectf(left, bottom, right, top); /* graduate */ ypos = bottom; left -= 65; output2(left, bottom, "%.4E", sc->iso.val[0]); for (i = 1; i < MAXISO - 1; i++) { ypos += inc; output2(left, ypos, "%.4E", sc->iso.val[i]); glBegin(GL_LINES); glVertex2f(left + 65, ypos); glVertex2f(left + 75, ypos); glEnd(); } output2(left, top, "%.4E", sc->iso.val[MAXISO - 1]); } return (1); } freefem++-3.61-1/src/medit/particle.c000644 000767 000024 00000023422 13312446271 017446 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define MAX_PRT 10 #define MAX_LST 1024 #define MAX_CPT 5000 #define HSIZ 0.03 extern int reftype, refitem; typedef struct spart { double cb[4]; float pos[MAX_PRT + 1][3], col[MAX_PRT + 1][3], size, norm, ct, step; int nsdep, cur; ubyte flag; } Particle; typedef Particle *pParticle; Particle *tp; void colorParticle (pScene sc, pParticle pp) { double rgb[3], norm, kc; int i; static double hsv[3] = {0.0, 1.0, 0.80}; norm = pp->norm; if (norm < sc->iso.val[0]) norm = sc->iso.val[0]; else if (norm > sc->iso.val[MAXISO - 1]) norm = sc->iso.val[MAXISO - 1]; for (i = 0; i < MAXISO - 1; i++) { if (norm < sc->iso.val[i]) break; } kc = (norm - sc->iso.val[i - 1]) / (sc->iso.val[i] - sc->iso.val[i - 1]); hsv[0] = sc->iso.col[i - 1] * (1.0 - kc) + sc->iso.col[i] * kc; hsvrgb(hsv, rgb); pp->col[pp->cur][0] = rgb[0]; pp->col[pp->cur][1] = rgb[1]; pp->col[pp->cur][2] = rgb[2]; } void drawParticle (pScene sc, pParticle pp) { float radius; int i; radius = 0.005 * sc->dmax; for (i = 1; i <= sc->par.nbpart; i++) { glPushMatrix(); glTranslatef(pp->pos[i][0], pp->pos[i][1], pp->pos[i][2]); glColor3fv(pp->col[i]); glutSolidSphere(radius, 10, 10); glPopMatrix(); } } void computeTetraParticle (pScene sc, pMesh mesh, int k) { pStream st; pParticle pp; double cb[4], v[4]; float pos[3], ldt; int cur, nsold, nbp; st = sc->stream; pp = &tp[k]; if (pp->ct > sc->par.pertime) return; ldt = 0.0; nbp = 0; nsold = pp->nsdep; pos[0] = pp->pos[pp->cur][0]; pos[1] = pp->pos[pp->cur][1]; pos[2] = pp->pos[pp->cur][2]; do { pTetra pt; double dd; float ux, uy, uz; int nsfin; ux = pos[0]; uy = pos[1]; uz = pos[2]; if (st->typtrack == 1 || !nxtPoint3D(mesh, pp->nsdep, pos, pp->step, v)) { pos[0] += pp->step * v[0]; pos[1] += pp->step * v[1]; pos[2] += pp->step * v[2]; } if (pos[0] < st->xmin || pos[0] > st->xmax || pos[1] < st->ymin || pos[1] > st->ymax || pos[2] < st->zmin || pos[2] > st->zmax) { pp->flag = 0; break; } ux -= pos[0]; uy -= pos[1]; uz -= pos[2]; dd = sqrt(ux * ux + uy * uy + uz * uz) / pp->norm; ldt += dd; pp->ct += dd; if (pp->ct >= sc->par.pertime) { pp->flag = 0; sc->par.cumpertime = sc->par.pertime + 1.e-06; break; /*return;*/ } else if (ldt >= sc->par.dt) { pp->cur = 1 + (pp->cur % sc->par.nbpart); pp->pos[pp->cur][0] = pos[0]; pp->pos[pp->cur][1] = pos[1]; pp->pos[pp->cur][2] = pos[2]; colorParticle(sc, pp); break; /*return;*/ } /* find tet containing p */ nsfin = locateTetra(mesh, pp->nsdep, ++mesh->mark, pos, cb); if (!nsfin) { pp->flag = 0; break; /*return;*/ } pp->nsdep = nsfin; pt = &mesh->tetra[pp->nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (pp->nsdep != nsold) { pp->size = sizeTetra(mesh, pp->nsdep); nsold = pp->nsdep; } /* vector field interpolation */ pp->norm = field3DInterp(mesh, pp->nsdep, pp->cb, v); pp->step = HSIZ * min(pp->size, pp->norm); if (sc->par.maxtime < FLT_MAX) pp->step = min(0.05 * sc->par.dt, pp->step); if (pp->step == 0.0) { pp->flag = 0; return; } nbp++; } while (ldt <= sc->par.dt); cur = (pp->cur % MAX_PRT) + 1; pp->pos[cur][0] = pp->pos[pp->cur][0]; pp->pos[cur][1] = pp->pos[pp->cur][1]; pp->pos[cur][2] = pp->pos[pp->cur][2]; pp->cur = cur; colorParticle(sc, pp); } int displayParticle (pScene sc, pMesh mesh) { pStream st; int k; st = sc->stream; if (sc->par.advtim) for (k = 1; k <= st->nbstl; k++) { computeTetraParticle(sc, mesh, k); } /* redraw particles */ for (k = 1; k <= st->nbstl; k++) { pParticle pp; pp = &tp[k]; if (pp->flag) drawParticle(sc, pp); } return (1); } int createParticle (pScene sc, pMesh mesh) { pParticle pp; pStream st; pMaterial pm; pTetra pt1; pTriangle pt; pPoint ppt; double v[4], cx, cy, cz; int i, j, k, l, nmat, nbp, base; if (ddebug) printf("create particles\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (sc->stream) { st = sc->stream; if (st->listp) free(st->listp); free(sc->stream); } sc->stream = createStream(sc, mesh); sc->par.cumtim = 0.0; sc->par.advtim = 0; assert(sc->stream); st = sc->stream; fprintf(stdout, " Creating particles :"); fflush(stdout); st->nbstl = 0; base = ++mesh->mark; pt = &mesh->tria[refitem]; nmat = matRef(sc, pt->ref); pm = &sc->material[nmat]; k = pm->depmat[LTria]; if (!k || pm->flag) return (0); /* point positions */ for (i = 1; i <= mesh->np; i++) { ppt = &mesh->point[i]; ppt->mark = base; } if (sc->par.nbpart >= MAX_PRT) sc->par.nbpart = MAX_PRT; ++base; l = 1; nbp = 0; while (k != 0 && st->nbstl < MAX_LST - 1) { pt = &mesh->tria[k]; if (pt->v[0]) { cx = cy = cz = 0.0; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; cx += 0.33 * ppt->c[0]; cy += 0.33 * ppt->c[1]; cz += 0.33 * ppt->c[2]; ppt->flag = 1; } st->listp[l++] = cx; st->listp[l++] = cy; st->listp[l++] = cz; ++st->nbstl; if (st->nbstl > MAX_LST - 1) break; k = pt->nxt; } } fprintf(stdout, "%d\n", st->nbstl); if (!st->nbstl) return (0); /* init positions */ tp = calloc((st->nbstl + 1), sizeof(Particle)); assert(tp); for (k = 1; k <= st->nbstl; k++) { tp[k].nsdep = mesh->ntet / 2; } for (k = 1; k <= mesh->ntet; k++) { mesh->tetra[k].cpt = 0; } l = 1; for (k = 1; k <= st->nbstl; k++) { pp = &tp[k]; pp->pos[1][0] = st->listp[l++]; pp->pos[1][1] = st->listp[l++]; pp->pos[1][2] = st->listp[l++]; tp[k].nsdep = locateTetra(mesh, pp->nsdep, ++mesh->mark, pp->pos[1], pp->cb); if (!pp->nsdep) { for (j = 1; j <= mesh->ntet; j++) { pt1 = &mesh->tetra[j]; if (pt1->mark != mesh->mark && inTetra(mesh, j, pp->pos[1], pp->cb)) break; } if (j > mesh->ntet) return (0); else pp->nsdep = j; } pp->norm = field3DInterp(mesh, tp[k].nsdep, tp[k].cb, v); pp->size = sizeTetra(mesh, tp[k].nsdep); if (pp->size == 0.0) pp->step = EPS * sc->dmax; else pp->step = HSIZ * min(pp->size, pp->norm); pp->step = min(0.05 * sc->par.dt, pp->step); pp->flag = 1; pp->cur = 1; colorParticle(sc, pp); for (i = 2; i <= sc->par.nbpart; i++) { pp->pos[i][0] = pp->pos[1][0]; pp->pos[i][1] = pp->pos[1][1]; pp->pos[i][2] = pp->pos[1][2]; } } return (1); } int advectParticle (pScene sc, pMesh mesh) { pParticle pp; pStream st; pTetra pt1; double v[4]; int i, j, k, l, base; if (ddebug) printf("advect particles\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (!sc->stream) return (0); st = sc->stream; if (mesh->ntet && !hashTetra(mesh)) return (0); st->xmin = mesh->xmin - mesh->xtra; st->ymin = mesh->ymin - mesh->ytra; st->zmin = mesh->zmin - mesh->ztra; st->xmax = mesh->xmax - mesh->xtra; st->ymax = mesh->ymax - mesh->ytra; st->zmax = mesh->zmax - mesh->ztra; sc->par.cumpertime = 0.0; sc->par.advtim = 0; /* init list */ sc->slist = (GLuint *)calloc(MAX_LST, sizeof(GLuint)); if (!sc->slist) return (0); /* point positions */ base = ++mesh->mark; for (i = 1; i <= mesh->np; i++) { pPoint ppt; ppt = &mesh->point[i]; ppt->mark = base; } for (k = 1; k <= mesh->ntet; k++) { mesh->tetra[k].cpt = 0; } l = 1; for (k = 1; k <= st->nbstl; k++) { pp = &tp[k]; pp->ct = 0.0; st->listp[l++] = pp->pos[pp->cur][0]; st->listp[l++] = pp->pos[pp->cur][1]; st->listp[l++] = pp->pos[pp->cur][2]; pp->cur = 1; } ++base; l = 1; for (k = 1; k <= st->nbstl; k++) { pp = &tp[k]; pp->pos[1][0] = st->listp[l++]; pp->pos[1][1] = st->listp[l++]; pp->pos[1][2] = st->listp[l++]; tp[k].nsdep = locateTetra(mesh, pp->nsdep, ++mesh->mark, pp->pos[1], pp->cb); if (!pp->nsdep) { for (j = 1; j <= mesh->ntet; j++) { pt1 = &mesh->tetra[j]; if (pt1->mark != mesh->mark && inTetra(mesh, j, pp->pos[1], pp->cb)) break; } if (j > mesh->ntet) continue; else pp->nsdep = j; } pp->norm = field3DInterp(mesh, tp[k].nsdep, tp[k].cb, v); pp->size = sizeTetra(mesh, tp[k].nsdep); if (pp->size == 0.0) pp->step = EPS * sc->dmax; else pp->step = HSIZ * min(pp->size, pp->norm); pp->step = min(0.05 * sc->par.dt, pp->step); pp->flag = 1; pp->cur = 1; colorParticle(sc, pp); for (i = 2; i <= sc->par.nbpart; i++) { pp->pos[i][0] = pp->pos[1][0]; pp->pos[i][1] = pp->pos[1][1]; pp->pos[i][2] = pp->pos[1][2]; } } return (1); } freefem++-3.61-1/src/medit/transform.c000644 000767 000024 00000004320 13312446271 017652 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" void resetTransform (pTransform tr) { static float itransf[16] = {1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1.}; tr->pos[0] = tr->pos[1] = tr->pos[2] = 0.0f; tr->angle = 0.0f; tr->panx = tr->pany = 0.0f; tr->opanx = tr->opany = 0.0f; tr->mstate = 1; tr->manim = GL_FALSE; memcpy(tr->matrix, itransf, 16 * sizeof(float)); memcpy(tr->rot, itransf, 16 * sizeof(float)); memcpy(tr->tra, itransf, 16 * sizeof(float)); } pTransform createTransform () { pTransform tr; /* default */ if (ddebug) printf("create transformation\n"); tr = (pTransform)M_calloc(1, sizeof(struct transform), "transform"); assert(tr); /* set default values */ resetTransform(tr); tr->mbutton = 0; return (tr); } freefem++-3.61-1/src/medit/keyboard.c000644 000767 000024 00000051703 13312446271 017446 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" extern int refmat, reftype, refitem; int *pilmat, ipilmat; int refpick = -1; GLfloat dazim = 1.0; GLfloat delev = 1.0; extern void mouseCamera (int button, int state, int x, int y); extern void motionCamera (int x, int y); extern GLboolean picking; static void usage () { fprintf(stdout, "\n"); fprintf(stdout, "-- Medit: OnLine Help --\n"); fprintf(stdout, "** Rendering options (toggle):\n"); fprintf(stdout, "f - facets l - lines g - const. entities\n"); fprintf(stdout, "c - obj. color e - material b - back color\n"); fprintf(stdout, "A - axis B - box G - grid\n"); fprintf(stdout, "C - capping r(R) - hide (show) refs.\n"); fprintf(stdout, "n - smooth/flat shading\n"); fprintf(stdout, "\n** Controls options:\n"); fprintf(stdout, "i - reset view a - animate I - interactive\n"); fprintf(stdout, "h - online help q - quit X - close window\n"); fprintf(stdout, "\n** View controls (ALT + key):\n"); fprintf(stdout, "c - copy d - duplicate p - paste l - link u - unlink\n"); fprintf(stdout, "J - toggle flight y - change axis\n"); fprintf(stdout, "\n** Misc. features\n"); fprintf(stdout, "L - load prefs W - save prefs\n"); fprintf(stdout, "H - hardcopy PPM\n"); fprintf(stdout, "F - face nums P - point nums # - select entity\n"); fprintf(stdout, "N - normals O - oppos. normals ! - select plane\n"); fprintf(stdout, "m - data o - iso-lines w - tensor/vector\n"); fprintf(stdout, "v - streamlines k - toggle elev. K - elev. coeff.\n"); fprintf(stdout, "j - toggle deco p - palette S - play animation\n"); fprintf(stdout, "+/- scale object z/Z scale view\n"); fprintf(stdout, "F1,F2,F3 - clipping: On/Off, Edit, Freeze\n"); } /* special keys CAMERA mode */ void specCamera (pScene sc, int key) { pCamera c; double dd, azim, elev; GLfloat axe[3]; int keyact; c = sc->camera; keyact = glutGetModifiers(); axe[0] = c->speed[2]; axe[1] = 0.0; axe[2] = -c->speed[0]; dd = sqrt(axe[0] * axe[0] + axe[2] * axe[2]); if (dd != 0.0f) { axe[0] /= dd; axe[2] /= dd; } switch (key) { case GLUT_KEY_LEFT: if (keyact & GLUT_ACTIVE_SHIFT) { c->eye[0] += axe[0] * c->altinc; c->eye[2] += axe[2] * c->altinc; reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); return; } else { azim = Azimuth(c); elev = Elevation(c); azim += dazim; } break; case GLUT_KEY_RIGHT: if (keyact & GLUT_ACTIVE_SHIFT) { c->eye[0] -= axe[0] * c->altinc; c->eye[2] -= axe[2] * c->altinc; reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); return; } else { azim = Azimuth(c); elev = Elevation(c); azim -= dazim; } break; case GLUT_KEY_UP: if (keyact & GLUT_ACTIVE_SHIFT) { c->eye[1] += c->altinc; reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); return; } else { azim = Azimuth(c); elev = Elevation(c); elev -= delev; } break; case GLUT_KEY_DOWN: if (keyact & GLUT_ACTIVE_SHIFT) { c->eye[1] -= c->altinc; reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); return; } else { azim = Azimuth(c); elev = Elevation(c); elev += delev; } break; default: return; } updateCamera(sc, c, azim, elev); /* refresh scene */ reshapeScene(sc->par.xs, sc->par.ys); glutPostRedisplay(); } /* change center of scene */ static void changeCenter (pScene sc, pMesh mesh) { pPoint p0; pTriangle pt; pQuad pq; pTetra ptt; pHexa ph; float cx, cy, cz; int i; if (!refitem) return; cx = cy = cz = 0.0; switch (reftype) { case LPoint: p0 = &mesh->point[refitem]; cx = p0->c[0]; cy = p0->c[1]; cz = p0->c[2]; break; case LTria: pt = &mesh->tria[refitem]; for (i = 0; i < 3; i++) { p0 = &mesh->point[pt->v[i]]; cx += 0.33 * p0->c[0]; cy += 0.33 * p0->c[1]; cz += 0.33 * p0->c[2]; } break; case LQuad: pq = &mesh->quad[refitem]; for (i = 0; i < 4; i++) { p0 = &mesh->point[pq->v[i]]; cx += 0.25 * p0->c[0]; cy += 0.25 * p0->c[1]; cz += 0.25 * p0->c[2]; } break; case LTets: ptt = &mesh->tetra[refitem]; for (i = 0; i < 4; i++) { p0 = &mesh->point[ptt->v[i]]; cx += 0.25 * p0->c[0]; cy += 0.25 * p0->c[1]; cz += 0.25 * p0->c[2]; } break; case LHexa: ph = &mesh->hexa[refitem]; for (i = 0; i < 8; i++) { p0 = &mesh->point[ph->v[i]]; cx += 0.125 * p0->c[0]; cy += 0.125 * p0->c[1]; cz += 0.125 * p0->c[2]; } break; } /* reset translation and move to center */ sc->view->panx = sc->view->pany = 0.0; sc->cx = -cx; sc->cy = -cy; sc->cz = -cz; } /* special keys PERSPECTIVE mode */ void special (int key, int x, int y) { pTransform view; pScene sc; pMesh mesh; pClip clip; pCube cube; float pancoeff = 0.1f; int keyact, idw = currentScene(); ubyte post = TRUE; /* default */ if (ddebug) printf("special key %d\n", key); sc = cv.scene[idw]; /* special mode camera */ if (sc->persp->pmode == CAMERA) { specCamera(sc, key); return; } view = sc->view; mesh = cv.mesh[sc->idmesh]; clip = sc->clip; cube = sc->cube; keyact = glutGetModifiers(); if (keyact & GLUT_ACTIVE_SHIFT) pancoeff = 0.01; switch (key) { case GLUT_KEY_F1: /* toggle clipping plane */ if (mesh->dim == 3) { if (cube->active & C_ON) keyCube('C', 0, 0); else keyClip('C', 0, 0); } post = FALSE; break; case GLUT_KEY_F2: /* edit clipping plane */ if (mesh->dim == 3) { if (cube->active & C_ON) keyCube('E', 0, 0); else if (clip->active & C_ON) keyClip('E', 0, 0); } post = FALSE; break; case GLUT_KEY_F3: /* freeze clipping plane */ if (cube->active & C_ON) keyCube('F', 0, 0); else if (clip->active & C_ON) keyClip('F', 0, 0); post = FALSE; break; case GLUT_KEY_F4: /* toggle Vclip */ if (mesh->dim == 3) keyClip('Z', 0, 0); post = FALSE; break; case GLUT_KEY_F5: /* Toggle Shrink */ if (mesh->ntet + mesh->nhex > 0) keyFeature('V', 0, 0); else keyFeature('S', 0, 0); break; case GLUT_KEY_F6: /* Increase Shrink */ keyFeature('I', 0, 0); break; case GLUT_KEY_F7: /* Decrease Shrink */ keyFeature('i', 0, 0); break; case GLUT_KEY_LEFT: /* translate eyes or object */ if (clip->active & C_EDIT) { clip->cliptr->panx -= 0.02 * sc->dmax; clip->cliptr->angle = 0.0; clip->active |= C_UPDATE + C_REDO; } else if (keyact & GLUT_ACTIVE_CTRL) { sc->par.eyesep *= 0.9; printf("eyesep %f\n", sc->par.eyesep); } else { view->panx -= pancoeff * sc->dmax; } break; case GLUT_KEY_RIGHT: if (clip->active & C_EDIT) { clip->cliptr->panx += 0.02 * sc->dmax; clip->cliptr->angle = 0.0; clip->active |= C_UPDATE + C_REDO; } else if (keyact & GLUT_ACTIVE_CTRL) { sc->par.eyesep *= 1.1; printf("eyesep %f\n", sc->par.eyesep); } else { view->panx += pancoeff * sc->dmax; } break; case GLUT_KEY_UP: if (clip->active & C_EDIT) { clip->cliptr->pany += 0.02 * sc->dmax; clip->cliptr->angle = 0.0; clip->active |= C_UPDATE + C_REDO; } else { view->pany += pancoeff * sc->dmax; } break; case GLUT_KEY_DOWN: if (clip->active & C_EDIT) { clip->cliptr->pany -= 0.02 * sc->dmax; clip->cliptr->angle = 0.0; clip->active |= C_UPDATE + C_REDO; } else { view->pany -= pancoeff * sc->dmax; } break; default: return; } if (post) glutPostRedisplay(); } void keyScene (unsigned char key, int x, int y) { pMaterial pm; pTetra ptt; pHexa ph; pTriangle pt; pQuad pq; pScene sc, sc1; pMesh mesh; pClip clip; pCube cube; pPersp p; pCamera cam; double dd; float a, b, c, d; int k, keyact, numit, idw = currentScene(); ubyte post = FALSE, dolist = FALSE; if (idw < 0) exit(0); /* ESC = end medit */ if (key == 'q' || key == 27) exit(0); else if (key == 'h' || key == '?') usage(); /* default */ sc = cv.scene[idw]; mesh = cv.mesh[sc->idmesh]; clip = sc->clip; cube = sc->cube; p = sc->persp; keyact = glutGetModifiers(); if (key == ' ') { if (option == MORPHING) { morphMesh(sc, mesh); } else if (sc->isotyp & S_PARTICLE) { glutIdleFunc(0); } else { cam = sc->camera; cam->eye[0] += cam->spmod * cam->speed[0]; cam->eye[1] += cam->spmod * cam->speed[1]; cam->eye[2] += cam->spmod * cam->speed[2]; reshapeScene(sc->par.xs, sc->par.ys); } post = TRUE; } else if (islower(key)) { switch (key) { case 'a': /* toggle animate */ keyAnim('A', 0, 0); break; case 'b': /* backcolor */ keyColor('b', 0, 0); break; case 'c': if (keyact & GLUT_ACTIVE_ALT) { keyView('C', 0, 0); } else { sc->mode ^= S_COLOR; post = TRUE; } break; case 'd': if (keyact & GLUT_ACTIVE_ALT) keyView('D', 0, 0); break; case 'e': keyColor('e', 0, 0); break; case 'f': sc->mode ^= S_FILL; post = TRUE; break; case 'g': keyItem('g', 0, 0); break; case 'h': usage(); break; case 'i': keyView('R', 0, 0); if (clip->active & C_ON) resetClip(sc, clip, mesh); if (cube->active & C_ON) resetCube(sc, cube, mesh); sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; glutSetWindow(sc1->idwin); keyScene('i', 0, 0); } glutSetWindow(sc->idwin); break; case 'j': sc->type ^= S_DECO; post = TRUE; break; case 'k': keyMetric('k', 0, 0); break; case 'l': if (keyact & GLUT_ACTIVE_ALT) keyView('L', 0, 0); else sc->mode ^= S_BDRY; post = TRUE; break; case 'm': /* toggle metric */ if (mesh->nbb) keyMetric('m', 0, 0); keyMode('n', 0, 0); break; case 'o': /* iso-lines */ if (mesh->nbb) keyMetric('l', 0, 0); break; case 'p': if (keyact & GLUT_ACTIVE_ALT) keyView('P', 0, 0); else keyMetric('p', 0, 0); break; case 'r': if (refmat < 0 || ipilmat == sc->par.nbmat) return; pilmat[++ipilmat] = refmat; pm = &sc->material[refmat]; pm->flag = 1; updatePoints(sc, mesh, refmat); if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = 0; refmat = -1; dolist = TRUE; post = TRUE; break; case 's': if (!refitem) return; switch (reftype) { case LTria: pt = &mesh->tria[refitem]; pt->v[0] = 0; break; case LQuad: pq = &mesh->quad[refitem]; pq->v[0] = 0; break; case LTets: ptt = &mesh->tetra[refitem]; ptt->v[0] = 0; break; case LHexa: ph = &mesh->hexa[refitem]; ph->v[0] = 0; break; } sc->picklist = 0; dolist = TRUE; post = TRUE; break; case 't': /* toggle texture */ /*keyColor('t',0,0);*/ break; case 'u': if (keyact & GLUT_ACTIVE_ALT) keyView('U', 0, 0); break; case 'v': keyMetric('v', 0, 0); break; case 'w': keyMetric('w', 0, 0); break; case 'x': if (cube->active & C_EDIT) { cube->cma[0] += 0.1 * sc->dmax; post = TRUE; break; } case 'y': if (cube->active & C_EDIT) { cube->cma[1] += 0.1 * sc->dmax; post = TRUE; break; } if (p->pmode & CAMERA) { cam = sc->camera; cam->vecup = (cam->vecup + 1) % 3; switch (cam->vecup) { case X_AXIS: cam->altinc = (mesh->xmax - mesh->xmin); break; case Y_AXIS: cam->altinc = (mesh->ymax - mesh->ymin); break; case Z_AXIS: cam->altinc = (mesh->zmax - mesh->zmin); break; } cam->altinc *= 0.005f; sc->type |= S_RESET; reshapeScene(sc->par.xs, sc->par.ys); } /* tilt cut plane */ else if (clip->active & C_EDIT) { tiltClip(sc, clip); } else {return;} post = TRUE; break; case 'z': /* zoom in */ if (cube->active & C_EDIT) { cube->cma[2] += 0.1 * sc->dmax; post = TRUE; break; } else { if (p->rubber == 2) setPersp(sc, p, 1); else p->fovy = max(0.9 * p->fovy, 1e-05); farclip(1); } post = TRUE; /* get linked view */ sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; memcpy(sc1->view, sc->view, sizeof(struct transform)); memcpy(sc1->persp, sc->persp, sizeof(struct sperspective)); glutSetWindow(sc1->idwin); reshapeScene(sc1->par.xs, sc1->par.ys); } glutSetWindow(sc->idwin); break; } } else if (isupper(key)) { switch (key) { case 'A': /* toggle axis */ keyItem('A', 0, 0); break; case 'B': /* toggle box */ keyItem('B', 0, 0); break; case 'C': /* toggle capping */ keyClip('K', 0, 0); break; case 'D': /* selection cube */ if (mesh->dim == 3) keyItem('D', 0, 0); break; case 'E': keyColor('E', 0, 0); glutSetWindow(sc->idwin); break; case 'F': /* toggle face nums */ keyItem('F', 0, 0); break; case 'G': /* toggle grid */ keyItem('G', 0, 0); break; case 'H': /* hardcopy PPM */ keyFile('H', 0, 0); break; case 'I': /* follows mouse */ sc->type ^= S_FOLLOW; sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; sc1->type = sc->type; } break; case 'J': if (mesh->dim == 2 && !(sc->mode & S_ALTITUDE)) break; if (p->pmode == PERSPECTIVE) { p->pmode = CAMERA; glutMouseFunc(mouseCamera); glutMotionFunc(motionCamera); } else { p->pmode = PERSPECTIVE; glutMouseFunc(mouse); glutMotionFunc(motion); } sc->type = S_RESET; reshapeScene(sc->par.xs, sc->par.ys); post = TRUE; break; case 'K': keyMetric('K', 0, 0); break; case 'L': keyFile('L', 0, 0); break; case 'M': morphing = 1 - morphing; post = TRUE; break; case 'N': /* draw normals */ case 'O': if (mesh->nvn) keyItem(key, 0, 0); break; case 'P': /* toggle point nums */ keyItem('P', 0, 0); break; case 'Q': /*keyMetric('q',0,0);*/ break; case 'R': if (ipilmat < 1) return; refmat = pilmat[ipilmat--]; pm = &sc->material[refmat]; pm->flag = 0; updatePoints(sc, mesh, refmat); dolist = TRUE; post = TRUE; break; case 'S': /* softcopy */ /*keyFile('S',0,0);*/ keyAnim('S', 0, 0); break; case 'V': /* change center of scene */ if (!refitem) return; changeCenter(sc, mesh); reshapeScene(sc->par.xs, sc->par.ys); post = TRUE; /* linked view */ sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; sc1->cx = sc->cx; sc1->cy = sc->cy; sc1->cz = sc->cz; memcpy(sc1->view, sc->view, sizeof(struct transform)); memcpy(sc1->persp, sc->persp, sizeof(struct sperspective)); glutSetWindow(sc1->idwin); reshapeScene(sc1->par.xs, sc1->par.ys); } glutSetWindow(sc->idwin); break; case 'W': keyFile('W', 0, 0); break; case 'X': /* close window */ if (cube->active & C_EDIT) { cube->cma[0] -= 0.1 * sc->dmax; post = TRUE; break; } if (idw != cv.nbs) { deleteScene(sc); for (k = idw + 1; k < cv.nbs; k++) { cv.scene[k - 1] = cv.scene[k]; } cv.scene[cv.nbs - 1] = 0; } glutHideWindow(); if (--cv.nbs == 0) exit(0); break; case 'Y': /* close window */ if (cube->active & C_EDIT) { cube->cma[1] -= 0.1 * sc->dmax; post = TRUE; break; } case 'Z': /* zoom out */ if (cube->active & C_EDIT) { cube->cma[2] -= 0.1 * sc->dmax; post = TRUE; break; } else { if (p->rubber == 2) setPersp(sc, p, 0); else p->fovy = min(1.1 * p->fovy, 179.0); farclip(1); } post = TRUE; /* get linked view */ sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; memcpy(sc1->view, sc->view, sizeof(struct transform)); memcpy(sc1->persp, sc->persp, sizeof(struct sperspective)); glutSetWindow(sc1->idwin); reshapeScene(sc1->par.xs, sc1->par.ys); } glutSetWindow(sc->idwin); break; } } else { switch (key) { case '-': if (keyact & GLUT_ACTIVE_ALT) { keyAnim('p', 0, 0); break; } if (cube->active & C_EDIT) { cube->cma[0] *= 0.95; cube->cma[1] *= 0.95; cube->cma[2] *= 0.95; post = TRUE; break; } if (sc->persp->pmode == CAMERA) { cam = sc->camera; cam->spmod -= 1.e-04 * sc->dmax; post = TRUE; break; } if (p->depth < -20.0 * sc->dmax) break; p->depth -= 0.1 * sc->dmax; farclip(1); post = TRUE; /* * if ( p->rubber == 2 ) * setPersp(sc,p,0); * else * p->fovy = min(1.1*p->fovy,179.0); * farclip(1); * post = TRUE; */ /* get linked view */ sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; memcpy(sc1->view, sc->view, sizeof(struct transform)); memcpy(sc1->persp, sc->persp, sizeof(struct sperspective)); glutSetWindow(sc1->idwin); reshapeScene(sc1->par.xs, sc1->par.ys); } glutSetWindow(sc->idwin); break; case '+': if (keyact & GLUT_ACTIVE_ALT) { keyAnim('n', 0, 0); break; } if (cube->active & C_EDIT) { cube->cma[0] *= 1.05; cube->cma[1] *= 1.05; cube->cma[2] *= 1.05; post = TRUE; break; } if (sc->persp->pmode == CAMERA) { cam = sc->camera; cam->spmod += 1.e-04 * sc->dmax; post = TRUE; break; } if (p->depth > 0.0) break; p->depth += 0.1 * sc->dmax; farclip(1); post = TRUE; /* * if ( p->rubber == 2 ) * setPersp(sc,p,1); * else * p->fovy = max(0.9*p->fovy,1e-05); * farclip(1); * post = TRUE; */ /* update linked view */ sc1 = sc; while (sc1->slave > -1) { sc1 = cv.scene[sc1->slave]; memcpy(sc1->view, sc->view, sizeof(struct transform)); memcpy(sc1->camera, sc->camera, sizeof(struct camera)); memcpy(sc1->persp, sc->persp, sizeof(struct sperspective)); glutSetWindow(sc1->idwin); reshapeScene(sc1->par.xs, sc1->par.ys); } glutSetWindow(sc->idwin); break; case '#': /* select entity */ fprintf(stdout, "ENTITY NUMBER: "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fscanf(stdin, "%d", &numit); if (sc->picklist) glDeleteLists(sc->picklist, 1); if (numit > 0) sc->picklist = pickItem(mesh, sc, numit); post = TRUE; break; case '=': picking = GL_TRUE; if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = pickingScene(sc, x, y, 0); break; case '!': /* clip plane */ return; if (!(clip->active & C_ON)) return; dd = clip->eqn[3] - clip->eqn[0] * mesh->xtra \ - clip->eqn[1] * mesh->ytra - clip->eqn[2] * mesh->ztra; fprintf(stdout, "\nCurrent plane: %gx %+gy %+gz %+g = 0\n", clip->eqn[0], clip->eqn[1], clip->eqn[2], dd); fprintf(stdout, "Plane coeffs : "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fscanf(stdin, "%f %f %f %f", &a, &b, &c, &d); resetClip(sc, clip, mesh); clip->eqn[0] = a; clip->eqn[1] = b; clip->eqn[2] = c; clip->eqn[3] = d; fprintf(stdout, "New plane eq.: "); if (clip->eqn[0]) fprintf(stdout, "%+gx", clip->eqn[0]); if (clip->eqn[1]) fprintf(stdout, " %+gy", clip->eqn[1]); if (clip->eqn[2]) fprintf(stdout, " %+gz", clip->eqn[2]); if (clip->eqn[3]) fprintf(stdout, " %+g", clip->eqn[3]); fprintf(stdout, " = 0\n"); clip->eqn[3] += (a * mesh->xtra + b * mesh->ytra + c * mesh->ztra); post = TRUE; dolist = TRUE; break; case '@': /* add trajectoire point */ if (p->pmode == CAMERA) pathAdd(sc, x, y); break; case '%': fprintf(stdout, "reference (%d): ", refpick); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fscanf(stdin, "%d", &refpick); break; case '&': puts("ADJUST"); parEdit(sc); break; } } if (dolist) { doLists(sc, mesh); doMapLists(sc, mesh, 1); doIsoLists(sc, mesh, 1); } if (post) glutPostRedisplay(); } freefem++-3.61-1/src/medit/zaldy1.c000644 000767 000024 00000006026 13312446271 017050 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : Memory allocation for data structures /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include #include #include "medit.h" #include "extern.h" #include "sproto.h" int zaldy1 (pMesh mesh) { /* default */ if (ddebug) printf("allocate %d points\n", mesh->np); mesh->point = (pPoint)M_calloc(mesh->np + 1, sizeof(Point), "zaldy1.point"); assert(mesh->point); if (ddebug) printf("allocate %d tria\n", mesh->nt); mesh->tria = (pTriangle)M_calloc(mesh->nt + 1, sizeof(Triangle), "zaldy1.tria"); assert(mesh->tria); if (ddebug) printf("allocate %d quad\n", mesh->nq); if (mesh->nq) { mesh->quad = (pQuad)M_calloc(mesh->nq + 1, sizeof(Quad), "zaldy1.quad"); assert(mesh->quad); } if (mesh->ntet) { if (ddebug) printf("allocate %d tetra\n", mesh->ntet); mesh->tetra = (pTetra)M_calloc(mesh->ntet + 1, sizeof(Tetra), "zaldy1.tetra"); assert(mesh->tetra); } if (mesh->nhex) { if (ddebug) printf("allocate %d hexa\n", mesh->nhex); mesh->hexa = (pHexa)M_calloc(mesh->nhex + 1, sizeof(Hexa), "zaldy1.hexa"); assert(mesh->hexa); } if (mesh->na) { if (ddebug) printf("allocate %d edges\n", mesh->na); mesh->edge = (pEdge)M_calloc(mesh->na + 1, sizeof(Edge), "zaldy1.edge"); assert(mesh->edge); } if (mesh->nvn || mesh->ntg) { mesh->extra = (pExtra)M_calloc(1, sizeof(Extra), "zaldy1.extra"); assert(mesh->extra); if (mesh->nvn) { mesh->extra->n = (float *)M_calloc(3 * mesh->nvn + 1, sizeof(float), "inmesh"); assert(mesh->extra->n); } if (mesh->ntg) { mesh->extra->t = (float *)M_calloc(3 * mesh->ntg + 1, sizeof(float), "inmesh"); assert(mesh->extra->n); } } return (1); } freefem++-3.61-1/src/medit/inout.c000644 000767 000024 00000050776 13312446271 017015 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "libmesh5.h" #include "extern.h" int loadMesh (pMesh mesh) { pPoint ppt; pEdge pr; pTriangle pt; pQuad pq; pTetra ptet; pHexa ph; double d, dp1, dp2, dp3, dn[3]; float *n, fp1, fp2, fp3; int i, ia, ib, inm, ref, is, k, disc, nn, nt, nq; char *ptr, data[256]; printf("use loadMesh\n"); /* default */ strcpy(data, mesh->name); ptr = strstr(data, ".mesh"); if (!ptr) { strcat(data, ".meshb"); if (!(inm = GmfOpenMesh(data, GmfRead, &mesh->ver, &mesh->dim))) { ptr = strstr(data, ".mesh"); *ptr = '\0'; strcat(data, ".mesh"); if (!(inm = GmfOpenMesh(data, GmfRead, &mesh->ver, &mesh->dim))) { fprintf(stderr, " ** %s NOT FOUND.\n", data); return (-1); } } } else if (!(inm = GmfOpenMesh(data, GmfRead, &mesh->ver, &mesh->dim))) { fprintf(stderr, " ** %s NOT FOUND.\n", data); return (-1); } if (!quiet) fprintf(stdout, " Reading %s\n", data); /* parse keywords */ mesh->np = GmfStatKwd(inm, GmfVertices); printf("mesh->np=%i\n", mesh->np); mesh->nt = GmfStatKwd(inm, GmfTriangles); printf("mesh->np=%i\n", mesh->nt); mesh->nq = GmfStatKwd(inm, GmfQuadrilaterals); mesh->ntet = GmfStatKwd(inm, GmfTetrahedra); mesh->nhex = GmfStatKwd(inm, GmfHexahedra); mesh->nc = GmfStatKwd(inm, GmfCorners); mesh->nr = GmfStatKwd(inm, GmfRequiredVertices); mesh->na = GmfStatKwd(inm, GmfEdges); mesh->nri = GmfStatKwd(inm, GmfRidges); mesh->nre = GmfStatKwd(inm, GmfRequiredEdges); mesh->nvn = GmfStatKwd(inm, GmfNormals); mesh->ntg = GmfStatKwd(inm, GmfTangents); mesh->ne = mesh->nt + mesh->nq + mesh->ntet + mesh->nhex; /* check space dimension */ if (mesh->dim < 2 || mesh->dim > 3) { fprintf(stdout, " ## Wrong dim\n"); GmfCloseMesh(inm); return (-1); } /* check if vertices and elements found */ if (!mesh->np) { fprintf(stdout, " ## No vertex\n"); GmfCloseMesh(inm); return (-1); } /* memory allocation for mesh */ if (!zaldy1(mesh)) { GmfCloseMesh(inm); return (-1); } /* read mesh vertices */ GmfGotoKwd(inm, GmfVertices); for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (mesh->ver == GmfFloat) { if (mesh->dim == 2) { GmfGetLin(inm, GmfVertices, &fp1, &fp2, &ref); ppt->c[0] = fp1; ppt->c[1] = fp2; printf("vertices %f %f %i\n", fp1, fp2, ref); } else { GmfGetLin(inm, GmfVertices, &fp1, &fp2, &fp3, &ref); ppt->c[0] = fp1; ppt->c[1] = fp2; ppt->c[2] = fp3; } } else { if (mesh->dim == 2) { GmfGetLin(inm, GmfVertices, &dp1, &dp2, &ref); ppt->c[0] = dp1; ppt->c[1] = dp2; } else { GmfGetLin(inm, GmfVertices, &dp1, &dp2, &dp3, &ref); ppt->c[0] = dp1; ppt->c[1] = dp2; ppt->c[2] = dp3; } } ppt->ref = ref & 0x7fff; ppt->tag = M_UNUSED; } /* read mesh triangles */ disc = 0; GmfGotoKwd(inm, GmfTriangles); for (k = 1; k <= mesh->nt; k++) { pt = &mesh->tria[k]; GmfGetLin(inm, GmfTriangles, &pt->v[0], &pt->v[1], &pt->v[2], &ref); pt->ref = ref & 0x7fff; for (i = 0; i < 3; i++) { if (pt->v[i] < 1 || pt->v[i] > mesh->np) { disc++; pt->v[0] = 0; break; } else { ppt = &mesh->point[pt->v[i]]; ppt->tag &= ~M_UNUSED; } } } /* mesh quadrilaterals */ GmfGotoKwd(inm, GmfQuadrilaterals); for (k = 1; k <= mesh->nq; k++) { pq = &mesh->quad[k]; GmfGetLin(inm, GmfQuadrilaterals, &pq->v[0], &pq->v[1], &pq->v[2], &pq->v[3], &ref); pq->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (pq->v[i] < 1 || pq->v[i] > mesh->np) { disc++; pq->v[0] = 0; break; } else { ppt = &mesh->point[pq->v[i]]; ppt->tag &= ~M_UNUSED; } } } /* mesh tetrahedra */ GmfGotoKwd(inm, GmfTetrahedra); for (k = 1; k <= mesh->ntet; k++) { ptet = &mesh->tetra[k]; GmfGetLin(inm, GmfTetrahedra, &ptet->v[0], &ptet->v[1], &ptet->v[2], &ptet->v[3], &ref); ptet->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (ptet->v[i] < 1 || ptet->v[i] > mesh->np) { disc++; ptet->v[0] = 0; break; } else { ppt = &mesh->point[ptet->v[i]]; ppt->tag &= ~M_UNUSED; } } } /* mesh hexahedra */ GmfGotoKwd(inm, GmfHexahedra); for (k = 1; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; GmfGetLin(inm, GmfHexahedra, &ph->v[0], &ph->v[1], &ph->v[2], &ph->v[3], &ph->v[4], &ph->v[5], &ph->v[6], &ph->v[7], &ref); ph->ref = ref & 0x7fff; for (i = 0; i < 8; i++) { if (ph->v[i] < 1 || ph->v[i] > mesh->np) { disc++; ph->v[0] = 0; break; } else { ppt = &mesh->point[ph->v[i]]; ppt->tag &= ~M_UNUSED; } } } /* mesh corners */ GmfGotoKwd(inm, GmfCorners); for (k = 1; k <= mesh->nc; k++) { GmfGetLin(inm, GmfCorners, &is); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_CORNER; ppt->tag &= ~M_UNUSED; } } /* required vertices */ GmfGotoKwd(inm, GmfRequiredVertices); for (k = 1; k <= mesh->nr; k++) { GmfGetLin(inm, GmfRequiredVertices, &is); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_REQUIRED; ppt->tag &= ~M_UNUSED; } } /*mesh edges */ GmfGotoKwd(inm, GmfEdges); for (k = 1; k <= mesh->na; k++) { GmfGetLin(inm, GmfEdges, &ia, &ib, &ref); if (ia < 1 || ia > mesh->np || ib < 1 || ib > mesh->np) { disc++; } else { pr = &mesh->edge[k]; pr->v[0] = ia; pr->v[1] = ib; pr->ref = ref & 0x7fff; pr->tag = !pr->ref ? M_NOTAG : M_TAG; ppt = &mesh->point[ia]; ppt->tag &= ~M_UNUSED; ppt = &mesh->point[ib]; ppt->tag &= ~M_UNUSED; } } /* mesh ridges */ GmfGotoKwd(inm, GmfRidges); for (k = 1; k <= mesh->nri; k++) { GmfGetLin(inm, GmfRidges, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_RIDGE; } } /* required edges */ GmfGotoKwd(inm, GmfRequiredEdges); for (k = 1; k <= mesh->nre; k++) { GmfGetLin(inm, GmfRequiredEdges, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_REQUIRED; } } /* mesh normals */ GmfGotoKwd(inm, GmfNormals); for (k = 1; k <= mesh->nvn; k++) { n = &mesh->extra->n[3 * (k - 1) + 1]; if (mesh->ver == GmfFloat) { GmfGetLin(inm, GmfNormals, &n[0], &n[1], &n[2]); } else { GmfGetLin(inm, GmfNormals, &dn[0], &dn[1], &dn[2]); n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; } d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } if (mesh->nvn) { /* normals at vertices */ mesh->extra->iv = GmfStatKwd(inm, GmfNormalAtVertices); mesh->extra->nv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->nv); GmfGotoKwd(inm, GmfNormalAtVertices); for (k = 1; k <= mesh->extra->iv; k++) { GmfGetLin(inm, GmfNormalAtVertices, &nn, &is); if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->nv[nn] = is; } /* normals at triangle vertices */ mesh->extra->it = GmfStatKwd(inm, GmfNormalAtTriangleVertices); mesh->extra->nt = (int *)M_calloc(3 * mesh->nt + 1, sizeof(int), "inmesh"); assert(mesh->extra->nt); GmfGotoKwd(inm, GmfNormalAtTriangleVertices); for (k = 1; k <= mesh->extra->it; k++) { GmfGetLin(inm, GmfNormalAtTriangleVertices, &nt, &is, &nn); if (nt < 1 || nt > mesh->nt || is < 1 || is > 3 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nt[3 * (nt - 1) + is] = nn; } /*normals at quadrilateral vertices */ mesh->extra->iq = GmfStatKwd(inm, GmfNormalAtQuadrilateralVertices); mesh->extra->nq = (int *)M_calloc(4 * mesh->nq + 1, sizeof(int), "inmesh"); assert(mesh->extra->nq); GmfGotoKwd(inm, GmfNormalAtQuadrilateralVertices); for (k = 1; k <= mesh->extra->iq; k++) { GmfGetLin(inm, GmfNormalAtQuadrilateralVertices, &nq, &is, &nn); if (nq < 1 || nq > mesh->nq || is < 1 || is > 4 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nq[3 * (nq - 1) + is] = nn; } } /*mesh tangents */ GmfGotoKwd(inm, GmfTangents); for (k = 1; k <= mesh->ntg; k++) { n = &mesh->extra->t[3 * (k - 1) + 1]; if (mesh->ver == GmfFloat) { GmfGetLin(inm, GmfTangents, &n[0], &n[1], &n[2]); } else { GmfGetLin(inm, GmfTangents, &dn[0], &dn[1], &dn[2]); n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; } d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } if (mesh->ntg) { /*tangents at vertices */ mesh->extra->jv = GmfStatKwd(inm, GmfTangentAtVertices); mesh->extra->tv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->tv); GmfGotoKwd(inm, GmfTangentAtVertices); for (k = 1; k <= mesh->extra->jv; k++) { GmfGetLin(inm, GmfTangentAtVertices, &nn, &is); if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->tv[nn] = is; } /* tangent at edge vertices */ mesh->extra->je = GmfStatKwd(inm, GmfTangentAtEdgeVertices); mesh->extra->te = (int *)M_calloc(2 * mesh->na + 1, sizeof(int), "inmesh"); assert(mesh->extra->te); GmfGotoKwd(inm, GmfTangentAtEdgeVertices); for (k = 1; k <= mesh->extra->je; k++) { GmfGetLin(inm, GmfTangentAtEdgeVertices, &nt, &is, &nn); if (nt < 1 || nt > mesh->np || is < 1 || is > 2 || nn < 1 || nn > mesh->ntg) disc++; else mesh->extra->te[3 * (nt - 1) + is] = is; } } GmfCloseMesh(inm); if (disc > 0) fprintf(stdout, " ## %d entities discarded\n", disc); return (1); } /*mark clipped elements */ static int markPt (pMesh mesh) { pPoint ppt; int i, k, pos, neg, nul; for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag & M_UNUSED) continue; ppt->tmp = 0; } for (k = 1; k <= mesh->nt; k++) { pTriangle pt; pt = &mesh->tria[k]; if (!pt->v[0]) continue; pos = neg = nul = 0; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; if (ppt->clip == 2) pos++; else if (ppt->clip == 1) neg++; else nul++; } if (pos && pos + nul < 4) { for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; ppt->tmp = 1; } } } for (k = 1; k <= mesh->nq; k++) { pQuad pq; pq = &mesh->quad[k]; if (!pq->v[0]) continue; pos = neg = nul = 0; for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; if (ppt->clip == 2) pos++; else if (ppt->clip == 1) neg++; else nul++; } if (pos && pos + nul < 5) { for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; ppt->tmp = 1; } } } return (1); } /* save (part of) mesh to disk */ int saveMesh (pScene sc, pMesh mesh, char *fileout, ubyte clipon) { pPoint ppt; pTriangle pt; pQuad pq; pTetra ptt; pMaterial pm; float fp1, fp2, fp3; int outm, i, k, m, ver, np, nt, nq, ref; ver = GmfFloat; if (!(outm = GmfOpenMesh(fileout, GmfWrite, ver, mesh->dim))) { fprintf(stderr, " ** UNABLE TO OPEN %s.\n", fileout); return (0); } fprintf(stdout, " %%%% %s OPENED\n", fileout); /*compact vertices */ if (clipon) markPt(mesh); np = 0; for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag & M_UNUSED) continue; ppt->tmp = ++np; } GmfSetKwd(outm, GmfVertices, np); for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag & M_UNUSED) continue; ref = ppt->ref; if (mesh->dim == 2) { fp1 = ppt->c[0] + mesh->xtra; fp2 = ppt->c[1] + mesh->ytra; ref = ppt->ref; GmfSetLin(outm, GmfVertices, fp1, fp2, ref); } else { fp1 = ppt->c[0] + mesh->xtra; fp2 = ppt->c[1] + mesh->ytra; fp3 = ppt->c[2] + mesh->ztra; ref = ppt->ref; GmfSetLin(outm, GmfVertices, fp1, fp2, fp3, ref); } } /* write triangles */ nt = 0; for (k = 1; k <= mesh->nt; k++) { pt = &mesh->tria[k]; if (!pt->v[0]) continue; m = matRef(sc, pt->ref); pm = &sc->material[m]; if (pm->flag) continue; for (i = 0; i < 3; i++) { if (!mesh->point[pt->v[i]].tmp) break; } if (i == 3) nt++; } GmfSetKwd(outm, GmfTriangles, nt); for (k = 1; k <= mesh->nt; k++) { pt = &mesh->tria[k]; if (!pt->v[0]) continue; m = matRef(sc, pt->ref); pm = &sc->material[m]; if (pm->flag) continue; for (i = 0; i < 3; i++) { if (!mesh->point[pt->v[i]].tmp) break; } if (i < 3) continue; ref = pt->ref; GmfSetLin(outm, GmfTriangles, mesh->point[pt->v[0]].tmp, mesh->point[pt->v[1]].tmp, mesh->point[pt->v[2]].tmp, ref); } /* write quads */ nq = 0; for (k = 1; k <= mesh->nq; k++) { pq = &mesh->quad[k]; if (!pq->v[0]) continue; m = matRef(sc, pq->ref); pm = &sc->material[m]; if (pm->flag) continue; for (i = 0; i < 4; i++) { if (!mesh->point[pq->v[i]].tmp) break; } if (i == 4) nq++; } GmfSetKwd(outm, GmfQuadrilaterals, nq); for (k = 1; k <= mesh->nq; k++) { pq = &mesh->quad[k]; if (!pq->v[0]) continue; m = matRef(sc, pq->ref); pm = &sc->material[m]; if (pm->flag) continue; for (i = 0; i < 4; i++) { if (!mesh->point[pq->v[i]].tmp) break; } if (i < 4) continue; ref = pq->ref; GmfSetLin(outm, GmfQuadrilaterals, mesh->point[pq->v[0]].tmp, mesh->point[pq->v[1]].tmp, mesh->point[pq->v[2]].tmp, mesh->point[pq->v[3]].tmp, ref); } /* write tetrahedra */ GmfSetKwd(outm, GmfTetrahedra, mesh->ntet); for (k = 1; k <= mesh->ntet; k++) { ptt = &mesh->tetra[k]; if (!ptt->v[0]) continue; m = matRef(sc, ptt->ref); pm = &sc->material[m]; if (pm->flag) continue; for (i = 0; i < 4; i++) { if (!mesh->point[ptt->v[i]].tmp) break; } if (i < 4) continue; ref = ptt->ref; GmfSetLin(outm, GmfTetrahedra, mesh->point[ptt->v[0]].tmp, mesh->point[ptt->v[1]].tmp, mesh->point[ptt->v[2]].tmp, mesh->point[ptt->v[3]].tmp, ref); } /* write hexahedra */ if (!quiet) { fprintf(stdout, " TOTAL NUMBER OF VERTICES %8d\n", np); fprintf(stdout, " TOTAL NUMBER OF TRIANGLES %8d\n", nt); fprintf(stdout, " TOTAL NUMBER OF QUADS %8d\n", nq); fprintf(stdout, " TOTAL NUMBER OF TETRA %8d\n", mesh->ntet); } GmfCloseMesh(outm); return (1); } /* load solution (metric) */ int loadSol (pMesh mesh, char *filename, int numsol) { pSolution sol; double dbuf[GmfMaxTyp]; float fbuf[GmfMaxTyp]; double m[6], lambda[3], eigv[3][3], vp[2][2]; int inm, k, i, key, nel, size, type, iord, off, typtab[GmfMaxTyp], ver, dim; char *ptr, data[128]; strcpy(data, filename); ptr = strstr(data, ".mesh"); if (ptr) *ptr = '\0'; strcat(data, ".solb"); if (!(inm = GmfOpenMesh(data, GmfRead, &ver, &dim))) { ptr = strstr(data, ".sol"); *ptr = '\0'; strcat(data, ".sol"); if (!(inm = GmfOpenMesh(data, GmfRead, &ver, &dim))) return (0); } if (!quiet) fprintf(stdout, " Reading %s\n", data); if (dim != mesh->dim) { fprintf(stderr, " %%%% Wrong dimension %d.\n", dim); GmfCloseMesh(inm); return (0); } nel = GmfStatKwd(inm, GmfSolAtVertices, &type, &size, typtab); if (nel) { if (nel > mesh->np) fprintf(stderr, " %%%% Wrong number: %d Solutions discarded\n", nel - mesh->np); mesh->typage = 2; key = GmfSolAtVertices; } else { mesh->typage = 1; if (mesh->dim == 2 && mesh->nt) { // if( mesh->nt){ nel = GmfStatKwd(inm, GmfSolAtTriangles, &type, &size, typtab); if (nel && nel != mesh->nt) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); return (0); } key = GmfSolAtTriangles; } else if (mesh->dim == 2 && mesh->nq) { nel = GmfStatKwd(inm, GmfSolAtQuadrilaterals, &type, &size, typtab); if (nel && nel != mesh->nq) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); return (0); } key = GmfSolAtQuadrilaterals; } else if (mesh->ntet) { nel = GmfStatKwd(inm, GmfSolAtTetrahedra, &type, &size, typtab); if (nel && nel != mesh->ntet) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); return (0); } key = GmfSolAtTetrahedra; } else if (mesh->nhex) { nel = GmfStatKwd(inm, GmfSolAtHexahedra, &type, &size, typtab); if (nel && nel != mesh->nhex) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); return (0); } key = GmfSolAtHexahedra; } } if (!nel) return (1); if (ddebug) printf("numsol=%i, type=%i, size=%i\n", numsol, type, size); if (numsol > type) numsol = 1; numsol--; mesh->nbb = nel; mesh->bbmin = 1.0e20; mesh->bbmax = -1.0e20; if (!zaldy2(mesh)) { GmfCloseMesh(inm); return (0); } sol = mesh->sol; sol->dim = dim; sol->ver = ver; off = 0; for (i = 0; i < numsol; i++) { if (ddebug) printf("typtab[%i]=%i", i, typtab[i]); switch (typtab[i]) { case GmfSca: off++; break; case GmfVec: off += sol->dim; break; case GmfSymMat: off += sol->dim * (sol->dim + 1) / 2; break; } } if (ddebug) printf("typtab[%i]=%i, off%i", i, typtab[i], off); GmfGotoKwd(inm, key); if (ddebug) printf("numsol=%i,typtab[i]=%i\n", numsol, typtab[i]); switch (typtab[numsol]) { case GmfSca: if (ddebug) printf(" scalar field\n"); mesh->nfield = 1; for (k = 1; k <= nel; k++) { if (sol->ver == GmfFloat) { GmfGetLin(inm, key, fbuf); } else { GmfGetLin(inm, key, dbuf); for (i = 0; i < GmfMaxTyp; i++) { fbuf[i] = dbuf[off + i]; } } mesh->sol[k].bb = fbuf[off]; if (ddebug) printf("valeur donneer %i %f\n", k, fbuf[off]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } break; case GmfVec: if (ddebug) printf(" vector field\n"); mesh->nfield = sol->dim; for (k = 1; k <= nel; k++) { mesh->sol[k].bb = 0.0; if (sol->ver == GmfFloat) { GmfGetLin(inm, key, fbuf); } else { GmfGetLin(inm, key, dbuf); for (i = 0; i < GmfMaxTyp; i++) { fbuf[i] = dbuf[off + i]; } } for (i = 0; i < sol->dim; i++) { mesh->sol[k].m[i] = fbuf[off + i]; if (ddebug) printf("valeur donner %i composante %i %f\n", k, i, fbuf[off + i]); mesh->sol[k].bb += fbuf[off + i] * fbuf[off + i]; } mesh->sol[k].bb = sqrt(mesh->sol[k].bb); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } break; case GmfSymMat: if (ddebug) printf(" metric field\n"); mesh->nfield = sol->dim * (sol->dim + 1) / 2; for (k = 1; k <= nel; k++) { if (sol->ver == GmfFloat) { GmfGetLin(inm, key, fbuf); } else { GmfGetLin(inm, key, dbuf); for (i = 0; i < GmfMaxTyp; i++) { fbuf[i] = dbuf[off + i]; } } if (sol->dim == 2) { for (i = 0; i < 3; i++) { mesh->sol[k].m[i] = m[i] = fbuf[off + i]; } iord = eigen2(m, lambda, vp); mesh->sol[k].bb = min(lambda[0], lambda[1]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } else { for (i = 0; i < 6; i++) { mesh->sol[k].m[i] = fbuf[off + i]; } mesh->sol[k].m[2] = fbuf[off + 3]; mesh->sol[k].m[3] = fbuf[off + 2]; for (i = 0; i < 6; i++) { m[i] = mesh->sol[k].m[i]; } iord = eigenv(1, m, lambda, eigv); if (iord) { mesh->sol[k].bb = lambda[0]; mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[1]); mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[2]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } } } break; } GmfCloseMesh(inm); return (1); } freefem++-3.61-1/src/medit/chrono.h000644 000767 000024 00000003523 13312446271 017140 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include #ifndef ON #define RESET 0 #define ON 1 #define OFF 2 #endif #define TIMEMAX 16 #define MAXCLK (1073741823. / (double)CLOCKS_PER_SEC) typedef struct mytime { double ctim, dtim; time_t ptim; short call; } mytime; /* prototypes */ void chrono (int cmode, mytime *ptt); double gttime (mytime t); void tminit (mytime *t, int maxtim); #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/vector.c000644 000767 000024 00000047572 13312446271 017161 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define SCALV 1.0e-04 #define EPST 1.e-14 #define COSPI15 .9781476007338057 #define SINPI15 .2079116908177593 /* draw a vector in 3D: u = unit vector */ void drawVector3D (float p[3], double u[3], double scale) { double c[3], cc[3], m[9], dd, scal5; /* local frame */ m[0] = u[0]; m[1] = u[1]; m[2] = u[2]; if (fabs(u[0]) > EPS) { m[3] = -(u[1] + u[2]) / u[0]; m[4] = m[5] = 1.0f; } else if (fabs(u[1]) > EPS) { m[4] = -(u[0] + u[2]) / u[1]; m[3] = m[5] = 1.0f; } else { m[5] = -(u[0] + u[1]) / u[2]; m[3] = m[4] = 1.0; } dd = 1.0 / sqrt(m[3] * m[3] + m[4] * m[4] + m[5] * m[5]); m[3] *= dd; m[4] *= dd; m[5] *= dd; m[6] = m[1] * m[5] - m[2] * m[4]; m[7] = m[2] * m[3] - m[0] * m[5]; m[8] = m[0] * m[4] - m[3] * m[1]; u[0] *= scale; u[1] *= scale; u[2] *= scale; c[0] = p[0] + u[0]; c[1] = p[1] + u[1]; c[2] = p[2] + u[2]; glVertex3fv(p); glVertex3dv(c); /* draw 4 arrows */ scal5 = scale / 10.0; cc[0] = -COSPI15 * scal5; cc[1] = 0.0; cc[2] = SINPI15 * scal5; /* M^-1 . X */ glVertex3dv(c); glVertex3d(c[0] + (m[0] * cc[0] + m[6] * cc[2]), c[1] + (m[1] * cc[0] + m[7] * cc[2]), c[2] + (m[2] * cc[0] + m[8] * cc[2])); cc[0] = -COSPI15 * scal5; cc[2] = -cc[2]; glVertex3dv(c); glVertex3d(c[0] + (m[0] * cc[0] + m[6] * cc[2]), c[1] + (m[1] * cc[0] + m[7] * cc[2]), c[2] + (m[2] * cc[0] + m[8] * cc[2])); cc[0] = -COSPI15 * scal5; cc[1] = SINPI15 * scal5; cc[2] = 0.0; glVertex3dv(c); glVertex3d(c[0] + (m[0] * cc[0] + m[3] * cc[1]), c[1] + (m[1] * cc[0] + m[4] * cc[1]), c[2] + (m[2] * cc[0] + m[5] * cc[1])); cc[1] = -cc[1]; glVertex3dv(c); glVertex3d(c[0] + (m[0] * cc[0] + m[3] * cc[1]), c[1] + (m[1] * cc[0] + m[4] * cc[1]), c[2] + (m[2] * cc[0] + m[5] * cc[1])); } void drawVector2D (float p[2], double u[2], double scale) { double c[2], dx, dy; u[0] *= scale; u[1] *= scale; c[0] = p[0] + u[0]; c[1] = p[1] + u[1]; glVertex2fv(p); glVertex2dv(c); dx = (COSPI15 * u[0] + SINPI15 * u[1]) / 3.0; dy = (-SINPI15 * u[0] + COSPI15 * u[1]) / 3.0; glVertex2dv(c); glVertex2d(c[0] - dx, c[1] - dy); dx = (COSPI15 * u[0] - SINPI15 * u[1]) / 3.0; dy = (SINPI15 * u[0] + COSPI15 * u[1]) / 3.0; glVertex2dv(c); glVertex2d(c[0] - dx, c[1] - dy); } GLuint listClipTetraVector (pMesh mesh) { pMaterial pm; pTetra pt; pPoint ppt; pSolution ps0; pScene sc; pClip clip; double rgb[3], u[3], epsra, iso, kc, dd, scal, scalemin, scalemax; float cp[3]; GLuint dlist = 0; int ia, l, m; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* default */ if (!mesh->ntet || !mesh->nbb) return (0); if (ddebug) printf("create vector list for clip\n"); sc = cv.scene[currentScene()]; clip = sc->clip; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ scalemin = sc->dmax * SCALV; scalemax = 10.0 * scalemin; mesh->mark++; glLineWidth(2.0); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; glBegin(GL_LINES); while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || !pt->clip) { k = pt->nxt; continue; } /* element size */ scal = 0.5 * sizeTetra(mesh, k); epsra = EPST * scal; /* linear interpol. */ if (mesh->typage == 2) { for (l = 0; l < 4; l++) { ppt = &mesh->point[pt->v[l]]; if (ppt->mark == mesh->mark) continue; ppt->mark = mesh->mark; ps0 = &mesh->sol[pt->v[l]]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd < epsra) continue; /* color = norm */ if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); /* 3D vectors */ dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; u[2] = ps0->m[2] * dd; cp[0] = ppt->c[0]; cp[1] = ppt->c[1]; cp[2] = ppt->c[2]; drawVector3D(cp, u, scal); } } else { cp[0] = cp[1] = cp[2] = 0.0; for (l = 0; l < 4; l++) { ppt = &mesh->point[pt->v[l]]; cp[0] += ppt->c[0]; cp[1] += ppt->c[1]; cp[2] += ppt->c[2]; } cp[0] *= 0.25; cp[1] *= 0.25; cp[2] *= 0.25; /* color = norm */ ps0 = &mesh->sol[k]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd > epsra) { if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; u[2] = ps0->m[2] * dd; drawVector3D(cp, u, scal); } } k = pt->nxt; } glEnd(); } glLineWidth(1.0); glEndList(); return (dlist); } GLuint listClipHexaVector (pMesh mesh) { pMaterial pm; pHexa ph; pPoint ppt; pSolution ps0; pScene sc; pClip clip; double rgb[3], u[3], epsra, iso, kc, dd, scal, scalemin, scalemax; float cp[3]; GLuint dlist = 0; int ia, l, m; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* default */ if (!mesh->nhex || !mesh->nbb) return (0); if (ddebug) printf("create vector list for clip\n"); sc = cv.scene[currentScene()]; clip = sc->clip; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ scalemin = sc->dmax * SCALV; scalemax = 10.0 * scalemin; mesh->mark++; glLineWidth(2.0); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LHexa]; if (!k || pm->flag) continue; glBegin(GL_LINES); while (k != 0) { ph = &mesh->hexa[k]; if (!ph->v[0] || !ph->clip) { k = ph->nxt; continue; } /* element size */ scal = 0.5 * sizeHexa(mesh, k); epsra = EPST * scal; /* linear interpol. */ if (mesh->typage == 2) { for (l = 0; l < 8; l++) { ppt = &mesh->point[ph->v[l]]; if (ppt->mark == mesh->mark) continue; ppt->mark = mesh->mark; ps0 = &mesh->sol[ph->v[l]]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd < epsra) continue; /* color = norm */ if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); /* 3D vectors */ dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; u[2] = ps0->m[2] * dd; cp[0] = ppt->c[0]; cp[1] = ppt->c[1]; cp[2] = ppt->c[2]; drawVector3D(cp, u, scal); } } else { cp[0] = cp[1] = cp[2] = 0.0; for (l = 0; l < 8; l++) { ppt = &mesh->point[ph->v[l]]; cp[0] += ppt->c[0]; cp[1] += ppt->c[1]; cp[2] += ppt->c[2]; } cp[0] *= 0.125; cp[1] *= 0.125; cp[2] *= 0.125; /* color = norm */ ps0 = &mesh->sol[k]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd > epsra) { if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; u[2] = ps0->m[2] * dd; drawVector3D(cp, u, scal); } } k = ph->nxt; } glEnd(); } glLineWidth(1.0); glEndList(); return (dlist); } GLuint listTria2dVector (pMesh mesh) { pMaterial pm; pTriangle pt; pPoint ppt; pSolution ps0; pScene sc; double rgb[3], u[2], epsra, iso, kc, dd, scalemin, scalemax, scal; float cp[2]; GLuint dlist = 0; int ia, k, m; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* default */ if (!mesh->nt || !mesh->nbb) return (0); sc = cv.scene[currentScene()]; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("create vector list\n"); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); scalemin = sc->dmax * SCALV; scalemax = 15 * scalemin; mesh->mark++; glLineWidth(3.0); if (mesh->typage == 2) { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { int i; pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } scal = 0.5 * sizeTria(mesh, k); epsra = EPST * scal; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; if (ppt->mark == mesh->mark) continue; ppt->mark = mesh->mark; ps0 = &mesh->sol[pt->v[i]]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1]); if (dd < epsra) continue; /* color = norm */ if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; cp[0] = ppt->c[0]; cp[1] = ppt->c[1]; drawVector2D(cp, u, scal); } k = pt->nxt; } } glEnd(); } else { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { int l; pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } scal = 0.5 * sizeTria(mesh, k); epsra = EPST * scal; cp[0] = cp[1] = 0.0; for (l = 0; l < 3; l++) { ppt = &mesh->point[pt->v[l]]; cp[0] += ppt->c[0]; cp[1] += ppt->c[1]; } cp[0] /= 3.0; cp[1] /= 3.0; /* color = norm */ ps0 = &mesh->sol[k]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1]); if (dd < epsra) { k = pt->nxt; continue; } if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; drawVector2D(cp, u, scal); k = pt->nxt; } } glEnd(); } glLineWidth(1.0); glEndList(); return (dlist); } GLuint listQuad2dVector (pMesh mesh) { pMaterial pm; pQuad pq; pPoint ppt; pSolution ps0; pScene sc; double rgb[3], u[2], epsra, iso, kc, dd, scalemin, scalemax, scal; float cp[2]; GLuint dlist = 0; int ia, k, m; static double hsv[3] = {0.0, 1.0, 0.80}; /* default */ if (!mesh->nq || !mesh->nbb) return (0); sc = cv.scene[currentScene()]; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("create vector list\n"); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); scalemin = sc->dmax * SCALV; scalemax = 15 * scalemin; mesh->mark++; glLineWidth(3.0); if (mesh->typage == 2) { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; while (k != 0) { int i; pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } scal = 0.5 * sizeQuad(mesh, k); epsra = EPST * scal; for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; if (ppt->mark == mesh->mark) continue; ppt->mark = mesh->mark; ps0 = &mesh->sol[pq->v[i]]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1]); if (dd < epsra) continue; /* color = norm */ if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; cp[0] = ppt->c[0]; cp[1] = ppt->c[1]; drawVector2D(cp, u, scal); } k = pq->nxt; } } glEnd(); } else { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; while (k != 0) { int l; pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } scal = 0.5 * sizeQuad(mesh, k); epsra = EPST * scal; cp[0] = cp[1] = 0.0; for (l = 0; l < 4; l++) { ppt = &mesh->point[pq->v[l]]; cp[0] += ppt->c[0]; cp[1] += ppt->c[1]; } cp[0] *= 0.25; cp[1] *= 0.25; /* color = norm */ ps0 = &mesh->sol[k]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1]); if (dd < epsra) { k = pq->nxt; continue; } if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; drawVector2D(cp, u, scal); k = pq->nxt; } } glEnd(); } glLineWidth(1.0); glEndList(); return (dlist); } GLuint listTria3dVector (pMesh mesh) { pMaterial pm; pTriangle pt; pPoint ppt; pSolution ps0; pScene sc; double rgb[3], u[3], epsra, iso, kc, dd, scalemin, scalemax, scal; float cp[3]; GLuint dlist = 0; int ia, k, m; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* default */ if (!mesh->nbb) return (0); sc = cv.scene[currentScene()]; /*if ( egal(sc->iso.val[0],sc->iso.val[MAXISO-1]) ) return(0);*/ if (ddebug) printf("create vector list\n"); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); scalemin = sc->dmax * SCALV; scalemax = 15 * scalemin; mesh->mark++; glLineWidth(2.0); if (mesh->typage == 2) { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { int i; pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } scal = sizeTria(mesh, k); epsra = EPST * scal; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; if (ppt->mark == mesh->mark) continue; ppt->mark = mesh->mark; ps0 = &mesh->sol[pt->v[i]]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd < epsra) continue; /* color = norm */ if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] * dd; u[1] = ps0->m[1] * dd; u[2] = ps0->m[2] * dd; cp[0] = ppt->c[0]; cp[1] = ppt->c[1]; cp[2] = ppt->c[2]; drawVector3D(cp, u, scal); } k = pt->nxt; } } glEnd(); } else { glBegin(GL_LINES); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { int l; pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } scal = 0.5 * sizeTria(mesh, k); epsra = EPST * scal; cp[0] = cp[1] = 0.0; for (l = 0; l < 3; l++) { ppt = &mesh->point[pt->v[l]]; cp[0] += ppt->c[0]; cp[1] += ppt->c[1]; cp[2] += ppt->c[2]; } cp[0] /= 3.0; cp[1] /= 3.0; cp[2] /= 3.0; /* color = norm */ ps0 = &mesh->sol[k]; dd = iso = sqrt(ps0->m[0] * ps0->m[0] + ps0->m[1] * ps0->m[1] \ + ps0->m[2] * ps0->m[2]); if (dd < epsra) { k = pt->nxt; continue; } if (iso < sc->iso.val[0]) iso = sc->iso.val[0]; else if (iso > sc->iso.val[MAXISO - 1]) iso = sc->iso.val[MAXISO - 1]; for (ia = 0; ia < MAXISO - 1; ia++) { if (iso < sc->iso.val[ia]) break; } kc = (iso - sc->iso.val[ia - 1]) / (sc->iso.val[ia] - sc->iso.val[ia - 1]); hsv[0] = sc->iso.col[ia - 1] * (1.0 - kc) + sc->iso.col[ia] * kc; hsvrgb(hsv, rgb); glColor3dv(rgb); dd = 1.0 / dd; u[0] = ps0->m[0] / dd; u[1] = ps0->m[1] / dd; u[2] = ps0->m[2] / dd; drawVector3D(cp, u, scal); k = pt->nxt; } } glEnd(); } glLineWidth(1.0); glEndList(); return (dlist); } freefem++-3.61-1/src/medit/ellipse.c000644 000767 000024 00000023332 13312446271 017300 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #include "eigenv.h" #ifndef M_PI2 #define M_PI2 (2.0 * M_PI) #endif extern int refmat; extern int eigen2 (double m[3], double lambda[2], double vp[2][2]); static GLfloat IdMatrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; void drawEllipsoid (pScene sc, pMesh mesh, int typel, int k) { pMaterial pm; pSolution ps; pTriangle pt; pTetra pt1; pPoint p0; GLfloat mat[16], cx, cy, cz; double m[6], lambda[3], v[3][3]; int i, j, l; /* compute average size */ if (mesh->nfield != 6 || !mesh->nbb) return; /* draw average ellipse at element */ if (typel == LPoint) { int iord; p0 = &mesh->point[k]; /*pm = &sc->material[refmat];*/ pm = &sc->material[p0->ref]; ps = &mesh->sol[k]; for (j = 0; j < 6; j++) { m[j] = ps->m[j]; } iord = eigenv(1, m, lambda, v); if (!iord) return; if (mesh->ne) { fprintf(stdout, " Eigenvectors :\n vp1 : %f %f %f\n", v[0][0], v[0][1], v[0][2]); fprintf(stdout, " vp2 : %f %f %f\n", v[1][0], v[1][1], v[1][2]); fprintf(stdout, " vp3 : %f %f %f\n", v[2][0], v[2][1], v[2][2]); fprintf(stdout, " Eigenvalues : %f %f %f %d\n", lambda[0], lambda[1], lambda[2], iord); if (lambda[0] <= 0.0 || lambda[1] <= 0.0 || lambda[2] <= 0.0) return; fprintf(stdout, " Sizes : %f %f %f\n", 1.0 / sqrt(lambda[0]), 1.0 / sqrt(lambda[1]), 1.0 / sqrt(lambda[2])); } else if (lambda[0] <= 0.0 || lambda[1] <= 0.0 || lambda[2] <= 0.0) { return; } lambda[0] = max(EPS, 0.5 / sqrt(lambda[0])); lambda[1] = max(EPS, 0.5 / sqrt(lambda[1])); lambda[2] = max(EPS, 0.5 / sqrt(lambda[2])); memcpy(mat, IdMatrix, 16 * sizeof(GLfloat)); for (j = 0; j < 3; j++) { for (l = 0; l < 3; l++) { mat[j * 4 + l] = v[j][l]; } } glDisable(GL_LIGHTING); glPushMatrix(); glColor4fv(pm->dif); glTranslatef(p0->c[0], p0->c[1], p0->c[2]); glMultMatrixf(mat); glScalef(lambda[0], lambda[1], lambda[2]); glutWireSphere(1., 30, 30); glPopMatrix(); glEnable(GL_LIGHTING); } else if (typel == LTria) { pt = &mesh->tria[k]; if (mesh->nbb == mesh->np) pm = &sc->material[refmat]; else if (mesh->nbb == mesh->nt) pm = &sc->material[k]; else return; glColor4fv(pm->dif); for (j = 0; j < 6; j++) { m[j] = 0.; } cx = cy = cz = 0.0; for (i = 0; i < 3; i++) { ps = &mesh->sol[pt->v[i]]; p0 = &mesh->point[pt->v[i]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; for (j = 0; j < 6; j++) { m[j] += ps->m[j]; } } cx /= 3.; cy /= 3.; cz /= 3.; for (j = 0; j < 6; j++) { m[j] /= 6.; } if (!eigenv(1, m, lambda, v)) return; lambda[0] = max(EPS, 0.5 / sqrt(lambda[0])); lambda[1] = max(EPS, 0.5 / sqrt(lambda[1])); lambda[2] = max(EPS, 0.5 / sqrt(lambda[2])); memcpy(mat, IdMatrix, 16 * sizeof(GLfloat)); for (j = 0; j < 3; j++) { for (l = 0; l < 3; l++) { mat[j * 4 + l] = v[j][l]; } } glDisable(GL_LIGHTING); glPushMatrix(); glColor4fv(pm->dif); glTranslatef(cx, cy, cz); glMultMatrixf(mat); glScalef(lambda[0], lambda[1], lambda[2]); glutWireSphere(1., 30, 30); glPopMatrix(); glEnable(GL_LIGHTING); } else if (typel == LTets) { pt1 = &mesh->tetra[k]; pm = &sc->material[refmat]; glColor4fv(pm->dif); for (j = 0; j < 6; j++) { m[j] = 0.; } cx = cy = cz = 0.0; for (i = 0; i < 4; i++) { if (mesh->nbb == mesh->np) ps = &mesh->sol[pt1->v[i]]; else if (mesh->nbb == mesh->ntet) ps = &mesh->sol[k]; else return; p0 = &mesh->point[pt1->v[i]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; for (j = 0; j < 6; j++) { m[j] += ps->m[j]; } } cx /= 4.; cy /= 4.; cz /= 4.; for (j = 0; j < 6; j++) { m[j] /= 6.; } if (!eigenv(1, m, lambda, v)) return; lambda[0] = max(EPS, 0.5 / sqrt(lambda[0])); lambda[1] = max(EPS, 0.5 / sqrt(lambda[1])); lambda[2] = max(EPS, 0.5 / sqrt(lambda[2])); memcpy(mat, IdMatrix, 16 * sizeof(GLfloat)); for (j = 0; j < 3; j++) { for (l = 0; l < 3; l++) { mat[j * 4 + l] = v[j][l]; } } glDisable(GL_LIGHTING); glPushMatrix(); glColor4fv(pm->dif); glTranslatef(cx, cy, cz); glMultMatrixf(mat); glScalef(lambda[0], lambda[1], lambda[2]); glutWireSphere(1., 30, 30); glPopMatrix(); glEnable(GL_LIGHTING); } else {return;} } void glCircle (float radius) { float ang, ux, uy; ux = 0.0f; uy = radius; glBegin(GL_LINE_STRIP); for (ang = 0.0f; ang <= 2 * M_PI + 0.2; ang += 0.2) { ux = radius * (float)sin((double)ang); uy = radius * (float)cos((double)ang); glVertex2f(ux, uy); } glEnd(); } void drawEllipse (pScene sc, pMesh mesh, int typel, int k) { pSolution ps; double vp[2][2]; /* draw ellipse at vertex */ if (typel == LPoint) { pMaterial pm; pPoint p0; double m[3], lambda[2], dd1, dd2; float theta; ps = &mesh->sol[k]; p0 = &mesh->point[k]; pm = &sc->material[refmat]; m[0] = ps->m[0]; m[1] = ps->m[1]; m[2] = ps->m[2]; if (!eigen2(m, lambda, vp)) return; /* consider eigenvalues as sizes */ dd1 = 1.0 / sqrt(fabs(lambda[0])); dd2 = 1.0 / sqrt(fabs(lambda[1])); glDisable(GL_LIGHTING); glPushMatrix(); glLineWidth(1.0); glBegin(GL_LINES); glColor3fv(pm->dif); glVertex3f(p0->c[0], p0->c[1], 0.0); glColor3fv(pm->dif); glVertex3f(p0->c[0] + dd1 * vp[0][0], p0->c[1] + dd1 * vp[0][1], 0.0); glColor3fv(pm->dif); glVertex3f(p0->c[0], p0->c[1], 0.0); glColor3fv(pm->dif); glVertex3f(p0->c[0] + dd2 * vp[1][0], p0->c[1] + dd2 * vp[1][1], 0.0); glEnd(); theta = atan2(vp[0][1], vp[0][0]) * RTOD; glTranslatef(p0->c[0], p0->c[1], 0.0); glRotatef(theta, 0.0, 0.0, 1.0); glScaled(dd1, dd2, 0.0); glColor3fv(pm->dif); glCircle(1.0); glLineWidth(1.0); glPopMatrix(); glEnable(GL_LIGHTING); /* print out info */ fprintf(stdout, " Eigenvectors :\n"); fprintf(stdout, " vp1 : %f %f\n", vp[0][0], vp[0][1]); fprintf(stdout, " vp2 : %f %f\n", vp[1][0], vp[1][1]); fprintf(stdout, " Eigenvalues : %f %f\n", lambda[0], lambda[1]); fprintf(stdout, " Sizes : %f %f\n", dd1, dd2); } } GLuint drawAllEllipse (pScene sc, pMesh mesh) { GLuint dlist; pSolution ps; pMaterial pm; pPoint p0; double m[3], vp[2][2], lambda[2], dd1, dd2; float theta; int k, ref; dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* draw ellipse at vertex */ glDisable(GL_LIGHTING); glLineWidth(1.0); if (mesh->typage == 1) { for (k = 1; k <= mesh->ne; k++) { pTriangle pt; float cx, cy; int i; ps = &mesh->sol[k]; pt = &mesh->tria[k]; if (!pt->v[0]) continue; ref = matRef(sc, pt->ref); pm = &sc->material[ref]; if (pm->flag) continue; cx = cy = 0.0; for (i = 0; i < 3; i++) { p0 = &mesh->point[pt->v[i]]; cx += p0->c[0]; cy += p0->c[1]; } cx *= 1. / 3.; cy *= 1. / 3.; m[0] = ps->m[0]; m[1] = ps->m[1]; m[2] = ps->m[2]; if (!eigen2(m, lambda, vp)) return (0); /* consider eigenvalues as sizes */ dd1 = 1.0 / sqrt(fabs(lambda[0])); dd2 = 1.0 / sqrt(fabs(lambda[1])); glPushMatrix(); theta = atan2(vp[0][1], vp[0][0]) * RTOD; glTranslatef(cx, cy, 0.0); glRotatef(theta, 0.0, 0.0, 1.0); glScaled(dd1, dd2, 0.0); glColor3fv(pm->dif); glCircle(1.0); glPopMatrix(); } } else { for (k = 1; k <= mesh->np; k++) { ps = &mesh->sol[k]; p0 = &mesh->point[k]; ref = matRef(sc, p0->ref); pm = &sc->material[ref]; if (pm->flag) continue; m[0] = ps->m[0]; m[1] = ps->m[1]; m[2] = ps->m[2]; if (!eigen2(m, lambda, vp)) return (0); /* consider eigenvalues as sizes */ dd1 = 1.0 / sqrt(fabs(lambda[0])); dd2 = 1.0 / sqrt(fabs(lambda[1])); glPushMatrix(); theta = atan2(vp[0][1], vp[0][0]) * RTOD; glTranslatef(p0->c[0], p0->c[1], 0.0); glRotatef(theta, 0.0, 0.0, 1.0); glScaled(dd1, dd2, 0.0); glColor3fv(pm->dif); glCircle(1.0); glPopMatrix(); } } glEnable(GL_LIGHTING); glEndList(); return (dlist); } void circumSphere (pScene sc, pMesh mesh, int typel, int k) { pMaterial pm; double c[3], rad; cenrad(mesh, k, c, &rad); rad = sqrt(rad); pm = &sc->material[refmat]; glDisable(GL_LIGHTING); glPushMatrix(); glColor4fv(pm->dif); glTranslated(c[0], c[1], c[2]); glScalef(rad, rad, rad); glutWireSphere(1., 30, 30); glPopMatrix(); glEnable(GL_LIGHTING); } freefem++-3.61-1/src/medit/medit.h000644 000767 000024 00000006152 13312446271 016753 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifndef _MEDIT_H #define _MEDIT_H #include #include #include #include #include #include #include #include #include #include #ifdef WIN32 #include #endif #ifdef __APPLE__ #include #include #include #else #include #include #include #endif #include "chrono.h" #include "memory.h" #include "mesh.h" #include "grafic.h" #include "image.h" #include "sproto.h" #define ME_VER "3.0a" #define ME_REL "Nov. 30, 2007" #define ME_CPY "Copyright (c) LJLL, 1999-2007" #define ME_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" #define DEFAULT_FILE "DEFAULT.medit" #define MAX_MESH 32 #define MAX_SCENE 32 #define MAX_OBJ 32 #define MAX_MATERIAL 128 #define DEFAULT_MAT 0 #define DTOR 0.0174532925 #define RTOD 57.29577951308232 #define EPS 1.e-06 #define EPS2 2.e-10 #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #ifdef M_PI #undef M_PI #undef M_PI_2 #endif #define M_PI 3.14159265358979323846 /* pi */ #define M_PI_2 1.57079632679489661923 /* pi/2 */ #ifdef min #undef min #undef max #endif #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((b) > (a)) ? (b) : (a)) /* check if numbers are equal */ #define egal(x, y) ( \ (((x) == 0.0f) ? (fabs(y) < EPS) : \ (((y) == 0.0f) ? (fabs(x) < EPS) : \ (fabs((x) - (y)) / (fabs(x) + fabs(y)) < EPS2)))) /* options */ enum {STANDARD=1, SEQUENCE, VERYBIG, MORPHING, SCHNAUZER, ISOSURF, PARTICLE}; /* structure canvas */ typedef struct canvas { pMesh mesh[MAX_MESH]; pScene scene[MAX_SCENE]; int nbm, nbs; } Canvas; typedef Canvas *pCanvas; #endif freefem++-3.61-1/src/medit/menus.c000644 000767 000024 00000074003 13312446271 016773 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" GLfloat altcoef = 0.0; static int nbimg; extern int refitem, refmat, reftype, imstep, imreverse; extern int *pilmat, ipilmat; #define MAX_LST 128 /* rebuild display lists */ void doLists (pScene sc, pMesh mesh) { int k; /*default */ if (ddebug) printf("build display lists\n"); if (!morphing) glutSetCursor(GLUT_CURSOR_WAIT); for (k = 0; k < MAX_LIST; k++) { if (sc->dlist[k]) glDeleteLists(sc->dlist[k], 1); if (sc->clist[k]) glDeleteLists(sc->clist[k], 1); sc->dlist[k] = sc->clist[k] = (GLuint)0; } /* poly lists */ sc->dlist[LTria] = listTria(sc, mesh); sc->dlist[LQuad] = listQuad(sc, mesh); if (!mesh->nt && !mesh->nq) { sc->dlist[LTets] = listTetra(sc, mesh, 0); sc->dlist[LHexa] = listHexa(sc, mesh, 0); } if (sc->clip->active & C_VOL) sc->clip->active |= C_REDO; glutSetCursor(GLUT_CURSOR_INHERIT); checkErrors(); } /* build metric list */ void doMapLists (pScene sc, pMesh mesh, int reset) { /*default */ if (!mesh->sol) return; if (ddebug) printf("build map lists\n"); glutSetCursor(GLUT_CURSOR_WAIT); /* delete old lists */ if (reset) { int k; for (k = 0; k < MAX_LIST; k++) { if (sc->mlist[k]) glDeleteLists(sc->mlist[k], 1); sc->mlist[k] = (GLuint)0; } } /* create map list */ if (sc->mode & S_ALTITUDE) { sc->mlist[LTria] = alt2dList(sc, mesh, LTria, sc->shrink, altcoef); sc->mlist[LQuad] = alt2dList(sc, mesh, LQuad, sc->shrink, altcoef); } else if (sc->mode & S_MAP) { if (mesh->nt && !sc->mlist[LTria]) sc->mlist[LTria] = listTriaMap(sc, mesh); if (mesh->nq && !sc->mlist[LQuad]) sc->mlist[LQuad] = listQuadMap(sc, mesh); if (!mesh->nt && mesh->ntet && !sc->mlist[LTets]) sc->mlist[LTets] = listTetraMap(sc, mesh, 0); if (!mesh->nq && mesh->nhex && !sc->mlist[LHexa]) sc->mlist[LHexa] = listHexaMap(sc, mesh, 0); } glutSetCursor(GLUT_CURSOR_INHERIT); checkErrors(); } /* rebuild iso-values lists */ void doIsoLists (pScene sc, pMesh mesh, int reset) { /*default */ if (ddebug) printf("build iso lists\n"); glutSetCursor(GLUT_CURSOR_WAIT); /* delete old lists */ if (reset) { int k; for (k = 0; k < MAX_LIST; k++) { if (sc->ilist[k]) glDeleteLists(sc->ilist[k], 1); if (sc->vlist[k]) glDeleteLists(sc->vlist[k], 1); if (sc->cplist) glDeleteLists(sc->cplist, 1); sc->ilist[k] = sc->vlist[k] = (GLuint)0; sc->cplist = (GLuint)0; } if (sc->stream && sc->stream->nbstl) { int kk; for (kk = 0; kk < sc->stream->nbstl; kk++) { if (sc->slist[kk]) glDeleteLists(sc->slist[kk], 1); sc->slist[kk] = (GLuint)0; } sc->slist = (GLuint)0; if (reset < 2) sc->stream->nbstl = 0; for (k = 1; k <= mesh->np; k++) { pPoint ppt; ppt = &mesh->point[k]; ppt->flag = 0; } } } /* iso-lines */ if (sc->isotyp & S_ISOLINE) { if (mesh->nt && !sc->ilist[LTria]) sc->ilist[LTria] = listTriaIso(sc, mesh); if (mesh->nq && !sc->ilist[LQuad]) sc->ilist[LQuad] = listQuadIso(sc, mesh); } /* iso-surfaces */ if (sc->isotyp & S_ISOSURF) if (mesh->ntet && !sc->ilist[LTets]) sc->ilist[LTets] = listTetraIso(sc, mesh); /* vector */ if (sc->isotyp & S_VECTOR) { if (mesh->dim == 2) { if (mesh->nt && !sc->vlist[LTria]) sc->vlist[LTria] = listTria2dVector(mesh); if (mesh->nq && !sc->vlist[LQuad]) sc->vlist[LQuad] = listQuad2dVector(mesh); } else { if (mesh->ntet + mesh->nhex == 0) { sc->vlist[LTria] = listTria3dVector(mesh); } else { if (mesh->ntet && !sc->vlist[LTets]) sc->vlist[LTets] = listClipTetraVector(mesh); else if (mesh->nhex && !sc->vlist[LHexa]) sc->vlist[LHexa] = listClipHexaVector(mesh); } } } /* streamlines */ if (sc->isotyp & S_STREAML) { if (!mesh->adja || !sc->slist) { sc->stream = createStream(sc, mesh); if (!sc->stream) sc->isotyp &= ~S_STREAML; } if (sc->stream) { if (reftype == LPoint) { streamRefPoint(sc, mesh); } else if (mesh->dim == 3) { if (reftype == LTria) streamRefTria(sc, mesh); else if (reftype == LQuad) streamRefQuad(sc, mesh); if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = 0; } } } /* critical points */ if (sc->isotyp & S_CRITP) if (mesh->dim == 2) if (mesh->nt && !sc->cplist) sc->cplist = listCritPoint(sc, mesh); glutSetCursor(GLUT_CURSOR_INHERIT); checkErrors(); } void resetLists (pScene sc, pMesh mesh) { int kk; for (kk = 0; kk < MAX_LIST; kk++) { if (sc->dlist[kk]) glDeleteLists(sc->dlist[kk], 1); if (sc->mlist[kk]) glDeleteLists(sc->mlist[kk], 1); if (sc->ilist[kk]) glDeleteLists(sc->ilist[kk], 1); if (sc->clist[kk]) glDeleteLists(sc->clist[kk], 1); if (sc->cmlist[kk]) glDeleteLists(sc->cmlist[kk], 1); if (sc->vlist[kk]) glDeleteLists(sc->vlist[kk], 1); if (sc->cplist) glDeleteLists(sc->cplist, 1); sc->dlist[kk] = sc->clist[kk] = sc->mlist[kk] = (GLuint)0; sc->ilist[kk] = sc->vlist[kk] = sc->cplist = (GLuint)0; } if (sc->glist) glDeleteLists(sc->glist, 1); if (sc->nlist) glDeleteLists(sc->nlist, 1); sc->glist = sc->nlist = (GLuint)0; } void keyFile (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pTransform view; char *ptr, data[128], tmpdata[128];; ubyte post = FALSE, clipon; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; view = sc->view; switch (key) { case 'L': /* load prefs */ if (parsop(sc, mesh)) { refitem = reftype = 0; setupPalette(sc, mesh); initGrafix(sc, mesh); doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); if (sc->isotyp) doIsoLists(sc, mesh, 1); glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); post = GL_TRUE; } break; case 'W': /* save prefs */ saveMeditFile(mesh->name, sc); break; case 'R': /* reload mesh */ refitem = reftype = 0; if (!meshUpdate(sc, mesh)) exit(1); meshRef(sc, mesh); matSort(sc); setupPalette(sc, mesh); doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); if (sc->isotyp) doIsoLists(sc, mesh, 1); glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); post = GL_TRUE; break; case 'S': /* save mesh */ strcpy(tmpdata, mesh->name); ptr = (char *)strstr(tmpdata, ".mesh"); if (ptr) *ptr = '\0'; sprintf(data, "%s.d.mesh", tmpdata); clipon = sc->clip->active & C_ON; if (clipon) clipVertices(mesh, sc, sc->clip); saveMesh(sc, mesh, data, clipon); break; case 'B': case 'C': case 'G': case 'H': /* hardcopy */ case 'T': strcpy(tmpdata, mesh->name); ptr = (char *)strstr(tmpdata, ".mesh"); if (ptr) *ptr = '\0'; ptr = (char *)strstr(tmpdata, ".gis"); if (ptr) *ptr = '\0'; if (option != SEQUENCE) { static int nfree = 0; if (key == 'H') nfree = filnum(tmpdata, nfree, "ppm"); else nfree = filnum(tmpdata, nfree, "ps"); if (nfree == -1) break; sprintf(data, "%s.%.3d", tmpdata, nfree); } else { sprintf(data, "%s.ppm", tmpdata); } if (!saveimg) glutSetCursor(GLUT_CURSOR_WAIT); if (key == 'B' || key == 'C' || key == 'G') imgTiling(sc, data, key); else imgHard(sc, data, key); if (animate && !(sc->persp->pmode & CAMERA) && ++nbimg > 179) { view->angle = 0.0; nbimg = 0; keyAnim('A', 0, 0); } if (!saveimg) glutSetCursor(GLUT_CURSOR_INHERIT); break; case 's': /* softcopy */ sftcpy(sc, mesh); post = FALSE; break; } if (post) glutPostRedisplay(); } void menuFile (int item) { keyFile((unsigned char)item, 0, 0); } void keyItem (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pCube cube; ubyte post = TRUE; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; cube = sc->cube; switch (key) { case 'A': /* draw axis */ sc->item ^= S_AXIS; break; case 'B': /* draw bounding box */ sc->item ^= S_BOX; break; case 'D': /*draw selection cube */ if (cube->active & C_ON) { cube->active &= ~(C_ON + C_EDIT); dumpCube(sc, mesh, cube); } else { cube->active |= C_ON; } break; case 'G': /* draw grid */ sc->item ^= S_GRID; break; case 'j': /* toggle info */ sc->type ^= S_DECO; break; case 'P': /* toggle point nums */ sc->item ^= S_NUMP; break; case 'F': /* toggle face nums */ sc->item ^= S_NUMF; break; case 'g': /* const. items */ if (!sc->glist) post = FALSE; sc->item ^= S_GEOM; break; case 'N': if (mesh->nvn) sc->type ^= S_NORMAL; else post = FALSE; break; case 'O': if (mesh->nvn) { sc->type ^= S_OPPOS; if (sc->nlist) { glDeleteLists(sc->nlist, 1); sc->nlist = 0; } else { post = FALSE; } } else { post = FALSE; } break; } if (post) glutPostRedisplay(); } void menuItem (int item) { keyItem((unsigned char)item, 0, 0); } void keyAnim (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pClip clip; ubyte post = TRUE; char *ptr, base[256]; static int depart = -1; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; clip = sc->clip; if (depart == -1) depart = animdep; switch (key) { case 'A': /* switch animation */ if (animate) { sc->view->manim = GL_FALSE; clip->cliptr->manim = GL_FALSE; sc->view->angle = 0.0f; glutIdleFunc(NULL); } else { sc->view->manim = GL_TRUE; clip->cliptr->manim = GL_TRUE; if (sc->persp->pmode == CAMERA) glutIdleFunc(glutIdle); } animate = 1 - animate; post = FALSE; break; case 'I': /* save image */ saveimg = 1 - saveimg; nbimg = 0; post = GL_FALSE; break; case 'M': /* morphing */ if (morphing) glutIdleFunc(NULL); else glutIdleFunc(glutIdle); morphing = 1 - morphing; post = FALSE; break; case 'R': /* next morph */ imreverse = 1 - imreverse; break; case 'S': /* start animation */ if (ddebug) fprintf(stdout, "debut sequence %d a %d\n", animdep, animfin); glutSetWindow(sc->idwin); if (option == SEQUENCE) playAnim(sc, mesh, animdep, animfin); if (!saveimg) post = FALSE; break; case 'f': /* first mesh */ /* get basename */ ptr = (char *)strrchr(mesh->name, '.'); if (ptr) *ptr = '\0'; strcpy(base, mesh->name); resetLists(sc, mesh); if (!loadNextMesh(mesh, animdep, 0)) break; doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 0); if (sc->isotyp) doIsoLists(sc, mesh, 0); strcpy(mesh->name, base); break; case 'l': /* get basename */ ptr = (char *)strrchr(mesh->name, '.'); if (ptr) *ptr = '\0'; strcpy(base, mesh->name); resetLists(sc, mesh); if (!loadNextMesh(mesh, animfin, 0)) break; doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 0); if (sc->isotyp) doIsoLists(sc, mesh, 0); strcpy(mesh->name, base); break; case 'n': /* get basename */ if (++depart > animfin) depart = animdep; ptr = (char *)strrchr(mesh->name, '.'); if (ptr) *ptr = '\0'; strcpy(base, mesh->name); resetLists(sc, mesh); if (!loadNextMesh(mesh, depart, 0)) break; doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 0); if (sc->isotyp) doIsoLists(sc, mesh, 0); strcpy(mesh->name, base); break; case 'p': /* get basename */ if (--depart < animdep) depart = animfin; ptr = (char *)strrchr(mesh->name, '.'); if (ptr) *ptr = '\0'; strcpy(base, mesh->name); resetLists(sc, mesh); if (!loadNextMesh(mesh, depart, 0)) break; doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 0); if (sc->isotyp) doIsoLists(sc, mesh, 0); strcpy(mesh->name, base); break; } if (post == TRUE) glutPostRedisplay(); } void menuAnim (int item) { keyAnim((unsigned char)item, 0, 0); } void keyTrajet (unsigned char key, int x, int y) { pScene sc; pMesh mesh; sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; switch (key) { case 'C': /* add control point */ pathAdd(sc, x, y); break; case 'S': /* show all points */ sc->type ^= S_PATH; /*if ( sc->path.tlist ) glDeleteLists(sc->path.tlist,1);*/ if (sc->type & S_PATH && !sc->path.tlist) sc->path.tlist = pathList(sc); break; case 'F': /* follow path */ break; case 'L': /* load path */ pathLoad(mesh->name, sc); break; case 'W': /* save path */ pathSave(mesh->name, sc); break; } glutPostRedisplay(); } void menuTrajet (int item) { keyTrajet((unsigned char)item, 0, 0); } void keyMode (unsigned char key, int x, int y) { pScene sc; pMesh mesh; ubyte post = TRUE, dolist = FALSE, material; sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; material = sc->mode & S_MATERIAL; switch (key) { case 'D': /* depth lines */ if (sc->mode == DEPTH) break; sc->mode = DEPTH; break; case 'S': /* toggle smooth shading */ if (sc->mode == FILL) break; sc->mode = FILL; if (material) sc->mode |= S_MATERIAL; break; case 'P': /* toggle smooth shaded polys */ if (sc->mode == SHADED) break; sc->mode = SHADED; if (material) sc->mode |= S_MATERIAL; break; case 'H': /* hidden lines */ if (sc->mode == HIDDEN) break; sc->mode = HIDDEN; if (material) sc->mode |= S_MATERIAL; break; case 'W': /* wireframe */ if (sc->mode == WIRE) break; sc->mode = WIRE; if (material) sc->mode |= S_MATERIAL; break; case 'n': /* toggle normals */ if (mesh->nvn == 0) { post = FALSE; break; } sc->type ^= S_FLAT; dolist = TRUE; break; default: post = FALSE; break; } if (dolist == TRUE) doLists(sc, mesh); if (post == TRUE) glutPostRedisplay(); } void menuMode (int item) { keyMode((unsigned char)item, 0, 0); } void menuScene (int item) { keyScene((unsigned char)item, 0, 0); } void keyView (unsigned char key, int x, int y) { pScene sc, sc1; pMesh mesh; float dmax; ubyte post = FALSE; sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; /*glutSetMenu(vmenu);*/ switch (key) { case 'R': sc->type |= S_RESET; dmax = mesh->xmax - mesh->xmin; dmax = max(dmax, mesh->ymax - mesh->ymin); dmax = max(dmax, mesh->zmax - mesh->zmin); sc->cx = sc->cy = sc->cz = 0.0f; sc->dmax = fabs(dmax); if (sc->persp->pmode == PERSPECTIVE) { resetTransform(sc->view); initPersp(sc->persp, sc->dmax); } else if (sc->persp->pmode == CAMERA) { initPersp(sc->persp, sc->dmax); initCamera(sc, sc->camera->vecup); sc->persp->pmode = CAMERA; } reshapeScene(sc->par.xs, sc->par.ys); post = TRUE; break; case 'C': copyView(sc->view, sc->camera, sc->persp); copyClip(sc->clip); break; case 'L': /* link view */ if (!linkView(sc)) return; reshapeScene(sc->par.xs, sc->par.ys); post = TRUE; break; case 'P': if (pasteView(sc->view, sc->camera, sc->persp) && pasteClip(sc->clip)) { reshapeScene(sc->par.xs, sc->par.ys); post = TRUE; } break; case 'U': unlinkView(sc); break; case 'D': /* duplicate view */ if (cv.nbs == MAX_SCENE) break; if (!cv.scene[++cv.nbs]) { cv.scene[cv.nbs] = (pScene)M_calloc(1, sizeof(Scene), "menus.scene"); if (!cv.scene[cv.nbs]) break; sc1 = cv.scene[cv.nbs]; sc1->material = (pMaterial)calloc(2 + sc->par.nbmat, sizeof(Material)); assert(sc1->material); } sc1 = cv.scene[cv.nbs]; memcpy(sc1, sc, sizeof(Scene)); memcpy(sc1->material, sc->material, sc->par.nbmat * sizeof(Material)); memcpy(&sc1->par, &sc->par, sizeof(Param)); if (!createScene(sc1, sc1->idmesh)) { fprintf(stdout, " ## Unable to create\n"); return; } copyView(sc->view, sc->camera, sc->persp); copyClip(sc->clip); pasteView(sc1->view, sc1->camera, sc1->persp); pasteClip(sc1->clip); break; } if (post) glutPostRedisplay(); } void menuView (int item) { keyView((unsigned char)item, 0, 0); } void keyColor (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pMaterial pm; int i, k; ubyte post = TRUE, dolist = FALSE; sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; switch (key) { case 'b': /* reverse backcolor */ sc->par.back[0] = 1.0f - sc->par.back[0]; sc->par.back[1] = 1.0f - sc->par.back[1]; sc->par.back[2] = 1.0f - sc->par.back[2]; glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); if (!sc->par.linc) { sc->par.line[0] = 1.0f - sc->par.line[0]; sc->par.line[1] = 1.0f - sc->par.line[1]; sc->par.line[2] = 1.0f - sc->par.line[2]; } break; case 'e': /* toggle matcolors */ sc->mode ^= S_MATERIAL; dolist = TRUE; break; case 'E': /* edit matcolors */ post = FALSE; matEdit(sc); break; case 'r': if (refmat < 0 || ipilmat == sc->par.nbmat) break; pilmat[++ipilmat] = refmat; pm = &sc->material[refmat]; pm->flag = 1; updatePoints(sc, mesh, refmat); if (sc->picklist) glDeleteLists(sc->picklist, 1); sc->picklist = 0; refmat = -1; dolist = TRUE; post = TRUE; break; case 'R': /* reset materials */ for (k = 0; k < sc->par.nbmat; k++) { pm = &sc->material[k]; for (i = LTria; i <= LHexa; i++) { pm->depmat[i] = abs(pm->depmat[i]); } } dolist = TRUE; break; default: post = FALSE; } if (dolist) doLists(sc, mesh); if (post) glutPostRedisplay(); } void menuColor (int item) { keyColor((unsigned char)item, 0, 0); } void keyClip (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pClip clip; ubyte post = TRUE; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; clip = sc->clip; switch (key) { case 'C': /* toggle clipping */ if (clip->active & C_ON) { clip->active &= ~(C_ON + C_EDIT); } else { clip->active |= C_ON; if (mesh->ntet + mesh->nhex) clip->active |= C_VOL; } break; case 'E': /* edit clip plane */ if (!(clip->active & C_ON)) return; if (clip->active & C_FREEZE) clip->active ^= C_FREEZE; clip->active ^= C_EDIT; break; case 'F': /* freeze clip */ if (!(clip->active & C_ON)) return; if (clip->active & C_EDIT) clip->active ^= C_EDIT; clip->active ^= C_FREEZE; break; case 'H': /* toggle draw plane */ clip->active ^= C_HIDE; break; case 'I': /* inverse orientation */ invertClip(sc, clip); clip->active |= C_REDO; break; case 'K': /* toggle capping */ clip->active ^= C_CAP; clip->active |= C_REDO; break; case 'R': /* reset clip */ if (!(clip->active & C_ON)) break; resetClip(sc, clip, mesh); break; case 'Z': /* toggle volclip */ clip->active ^= C_VOL; if (clip->active & C_VOL) clip->active |= C_REDO; break; } if (post) glutPostRedisplay(); } void menuClip (int item) { keyClip((unsigned char)item, 0, 0); } void keyCube (unsigned char key, int x, int y) { pScene sc; pMesh mesh; pCube cube; ubyte post = TRUE; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; cube = sc->cube; switch (key) { case 'C': /* toggle clipping */ if (cube->active & C_ON) cube->active &= ~(C_ON + C_EDIT); else cube->active |= C_ON; break; case 'E': /* edit clip plane */ if (!(cube->active & C_ON)) return; if (cube->active & C_FREEZE) cube->active ^= C_FREEZE; cube->active ^= C_EDIT; break; case 'F': /* freeze cube */ if (!(cube->active & C_ON)) return; if (cube->active & C_EDIT) cube->active ^= C_EDIT; cube->active ^= C_FREEZE; break; case 'R': /* reset cube */ if (!(cube->active & C_ON)) break; resetCube(sc, cube, mesh); break; } if (post) glutPostRedisplay(); } void keyFeature (unsigned char key, int x, int y) { pScene sc; pMesh mesh; ubyte post = TRUE, dolist = TRUE; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; switch (key) { case 'S': /* shrink mode */ case 'V': /* volumic shrink */ if (sc->shrink < 0.99) sc->shrink = 1.0f; else sc->shrink = 0.95; dolist = TRUE; break; case 'I': /* increase shrink value */ if (sc->shrink > 0.99) break; sc->shrink -= .05; if (sc->shrink < 0.1) sc->shrink = 0.1; dolist = TRUE; break; case 'i': /* decrease shrink value */ if (sc->shrink > 0.99) break; sc->shrink += .05; if (sc->shrink > 0.95) sc->shrink = 0.95; dolist = TRUE; break; case 's': /* scissor mode */ if (mesh->dim == 2) break; sc->type ^= S_SCISSOR; if (sc->type & S_SCISSOR) { glutDisplayFunc(scissorScene); } else { glutDisplayFunc(redrawScene); reshapeScene(sc->par.xs, sc->par.ys); } break; } if (dolist == TRUE) { doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); /*if ( sc->isotyp ) doIsoLists(sc,mesh,1);*/ } if (post == TRUE) glutPostRedisplay(); } void menuFeature (int item) { keyFeature((unsigned char)item, 0, 0); } void menuImage (int item) { imgtype = item; } void keyMetric (unsigned char key, int x, int y) { pScene sc; pMesh mesh; ubyte post = TRUE; /* default */ sc = cv.scene[currentScene()]; mesh = cv.mesh[sc->idmesh]; switch (key) { case 'c': /* critical points */ if (!mesh->nbb) return; sc->isotyp ^= S_CRITP; doIsoLists(sc, mesh, 0); break; case 'f': /* flush streamlines */ if (sc->stream->nbstl) { int k, kk; for (kk = 0; kk < sc->stream->nbstl; kk++) { if (sc->slist[kk]) glDeleteLists(sc->slist[kk], 1); sc->slist[kk] = (GLuint)0; } sc->stream->nbstl = 0; for (k = 1; k <= mesh->np; k++) { pPoint ppt; ppt = &mesh->point[k]; ppt->flag = 0; } } break; case 'l': /* iso-lines */ if (!mesh->nbb) return; sc->isotyp ^= S_ISOLINE; doIsoLists(sc, mesh, 0); break; case 's': /* iso-surfaces */ if (!mesh->nbb) return; sc->isotyp ^= S_ISOSURF; doIsoLists(sc, mesh, 0); break; case 'u': /* field lines animation */ if (!mesh->nbb || mesh->nfield != mesh->dim) return; if (refitem) { sc->isotyp |= S_PARTICLE; createParticle(sc, mesh); } glutIdleFunc(streamIdle); break; case 'd': /* displacement */ if (!mesh->nbb || mesh->nfield != mesh->dim) return; sc->mode ^= S_DISPL; meshCoord(mesh, (sc->mode & S_DISPL) ? 1 : 0); meshBox(mesh, 1); doLists(sc, mesh); if (sc->mode & S_MAP) doMapLists(sc, mesh, 1); if (sc->isotyp) doIsoLists(sc, mesh, 1); break; case 'v': /* streamlines */ if (!mesh->nbb || mesh->nfield != mesh->dim) return; if (refitem) { sc->isotyp |= S_STREAML; doIsoLists(sc, mesh, 0); } else { if (!streamIsoPoint(sc, mesh)) { post = FALSE; sc->isotyp &= ~S_STREAML; } } break; case 'w': /*vector/tensor */ if (mesh->nfield != mesh->dim) { if (mesh->dim == 2 && mesh->nfield == 3) { if (sc->picklist) { glDeleteLists(sc->picklist, 1); sc->picklist = 0; break; } else { sc->picklist = drawAllEllipse(sc, mesh); } break; } return; } sc->isotyp ^= S_VECTOR; if (mesh->dim == 3) if (mesh->ntet + mesh->nhex && !(sc->clip->active & C_ON)) return; doIsoLists(sc, mesh, 0); break; case 'k': /* toggle elevation */ if (mesh->dim != 2) return; sc->mode ^= S_ALTITUDE; if (altcoef == 0.0) { float maxd; maxd = max(mesh->xmax - mesh->xmin, mesh->ymax - mesh->ymin); altcoef = 0.3 * maxd / mesh->bbmax; } if (!(sc->mode & S_ALTITUDE)) sc->type |= S_RESET; doMapLists(sc, mesh, 1); break; case 'K': /* elevation coeff */ fprintf(stdout, "elevation coeff (%.2f): ", altcoef); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fscanf(stdin, "%f", &altcoef); if (altcoef == 0.0) sc->mode |= ~S_ALTITUDE; sc->type |= S_RESET; doMapLists(sc, mesh, 1); doIsoLists(sc, mesh, 1); break; case 'm': /* display metric */ if (!mesh->nbb) return; sc->mode ^= S_MAP; doMapLists(sc, mesh, 1); if (sc->mode & S_MAP) { if (sc->clip->active & C_ON) sc->clip->active |= C_REDO; if (!(sc->item & S_PALETTE)) sc->item ^= S_PALETTE; } else if (sc->item & S_PALETTE) { sc->item ^= S_PALETTE; } break; case 'p': /* toggle palette */ if (!mesh->nbb) return; sc->item ^= S_PALETTE; break; default: post = FALSE; break; } if (post) glutPostRedisplay(); } void menuMetric (int item) { keyMetric((unsigned char)item, 0, 0); } int createMenus (pScene sc, pMesh mesh) { int amenu, fmenu, femenu, vmenu, mmenu, smenu; int clmenu, cmenu, vwmenu; /* default */ if (ddebug) printf("create menus\n"); smenu = 0; /* File management menu */ fmenu = glutCreateMenu(menuFile); glutAddMenuEntry("[L] Load prefs", 'L'); glutAddMenuEntry("[W] Save prefs", 'W'); glutAddMenuEntry(" Update mesh", 'R'); glutAddMenuEntry(" Save mesh", 'S'); glutAddMenuEntry("[H] Hardcopy PPM", 'H'); glutAddMenuEntry(" Hardcopy EPS (Color)", 'C'); glutAddMenuEntry(" Hardcopy EPS (Grey)", 'G'); glutAddMenuEntry(" Hardcopy EPS (B/W)", 'B'); glutAddMenuEntry(" Softcopy EPS", 's'); /* rendering mode selector */ mmenu = glutCreateMenu(menuMode); glutAddMenuEntry("Wireframe", 'W'); glutAddMenuEntry("Depth lines", 'D'); glutAddMenuEntry("Hidden lines", 'H'); glutAddMenuEntry("Shading", 'S'); glutAddMenuEntry("Shading+lines", 'P'); if (mesh->nvn > 0) glutAddMenuEntry("[n] Toggle Normals", 'n'); /* color & material menu */ cmenu = glutCreateMenu(menuColor); glutAddMenuEntry("[b] Toggle backcolor", 'b'); glutAddMenuEntry("[e] Toggle matcolors", 'e'); glutAddMenuEntry("[E] Edit matcolors", 'E'); glutAddMenuEntry("[r] Hide material", 'r'); glutAddMenuEntry("[R] Reset materials", 'R'); /* metric */ if (mesh->nbb > 0) { smenu = glutCreateMenu(menuMetric); glutAddMenuEntry("[m] Toggle metric", 'm'); glutAddMenuEntry("[p] Toggle palette", 'p'); if (mesh->typage == 2) glutAddMenuEntry("[o] Toggle iso-lines", 'l'); if (mesh->ntet + mesh->nhex > 0 && mesh->nfield == 1) glutAddMenuEntry(" Toggle iso-surfaces", 's'); if (mesh->nfield == mesh->dim) { glutAddMenuEntry("[w] Toggle vector/tensor", 'w'); glutAddMenuEntry(" Toggle displacement", 'd'); glutAddMenuEntry("[v] Toggle streamlines", 'v'); glutAddMenuEntry(" Flush streamlines", 'f'); glutAddMenuEntry(" Particle advection", 'u'); if (mesh->dim == 2) glutAddMenuEntry(" Critical points", 'c'); } if (mesh->dim == 2) { glutAddMenuEntry("[k] Toggle elevation", 'k'); glutAddMenuEntry("[K] Elevation coeff", 'K'); } } /* Show misc. items */ vmenu = glutCreateMenu(menuItem); glutAddMenuEntry("[A] Axis", 'A'); glutAddMenuEntry("[B] Bounding box", 'B'); glutAddMenuEntry("[G] Grid ", 'G'); if (sc->glist) glutAddMenuEntry("[g] Geometric items", 'g'); glutAddMenuEntry("[j] Toggle Info", 'j'); glutAddMenuEntry("[P] Toggle Point num", 'P'); glutAddMenuEntry("[F] Toggle Face num", 'F'); if (mesh->nvn) { glutAddMenuEntry("[N] Toggle normals", 'N'); glutAddMenuEntry("[O] Revert normals", 'O'); } /* clipping menu */ clmenu = glutCreateMenu(menuClip); glutAddMenuEntry("[F1] Toggle clip", 'C'); glutAddMenuEntry("[F2] Edit clip", 'E'); glutAddMenuEntry("[F3] Freeze clip", 'F'); glutAddMenuEntry(" Inverse orient", 'I'); if (mesh->ntet + mesh->nhex > 0) glutAddMenuEntry(" Toggle capping", 'K'); glutAddMenuEntry(" Toggle plane", 'H'); glutAddMenuEntry(" -- Reset clip", 'R'); if (mesh->ntet + mesh->nhex > 0) { sc->clip->active |= C_VOL; glutAddMenuEntry("[F4] Toggle Vclip", 'Z'); } /* feature menu */ femenu = glutCreateMenu(menuFeature); if (mesh->ntet + mesh->nhex > 0) glutAddMenuEntry("[F5] Toggle Vshrink", 'V'); else glutAddMenuEntry("[F5] Toggle shrink", 'S'); glutAddMenuEntry("[F6] Increase shrink", 'I'); glutAddMenuEntry("[F7] Decrease shrink", 'i'); if (mesh->dim == 3) glutAddMenuEntry("Toggle splitview", 's'); /* view handler menu */ vwmenu = glutCreateMenu(menuView); glutAddMenuEntry("[i] Reset", 'R'); glutAddMenuEntry("[Alt-c] Copy", 'C'); glutAddMenuEntry("[Alt-p] Paste", 'P'); glutAddMenuEntry("[Alt+l] Link", 'L'); glutAddMenuEntry("[Alt+u] Unlink", 'U'); /*glutAddMenuEntry("[Alt+d] Duplicate",'D');*/ /* animation menu */ amenu = glutCreateMenu(menuAnim); glutAddMenuEntry("[a] Toggle Anim", 'A'); glutAddMenuEntry("Toggle ImgSave", 'I'); if (option == SEQUENCE || option == SEQUENCE + PARTICLE) { glutAddMenuEntry("Play sequence", 'S'); glutAddMenuEntry("First mesh", 'f'); glutAddMenuEntry("Last mesh", 'l'); glutAddMenuEntry("Next mesh", 'n'); glutAddMenuEntry("Prev mesh", 'p'); } else if (option == MORPHING) { glutAddMenuEntry("Start/Stop morph.", 'M'); glutAddMenuEntry("Toggle AutoReverse", 'R'); } /* trajectoire menu */ if (mesh->dim == 3 || mesh->nbb) { glutCreateMenu(menuTrajet); glutAddMenuEntry("New Ctrl point", 'C'); glutAddMenuEntry("Toggle path", 'S'); glutAddMenuEntry("Follow path", 'F'); glutAddMenuEntry("Load path", 'L'); glutAddMenuEntry("Save path", 'W'); } /* main scene menu */ glutCreateMenu(menuScene); glutAddSubMenu("File", fmenu); glutAddSubMenu("Render mode", mmenu); glutAddSubMenu("Colors, Materials", cmenu); if (mesh->nbb) glutAddSubMenu("Data", smenu); glutAddSubMenu("Items", vmenu); if (mesh->dim == 3) glutAddSubMenu("Clipping", clmenu); glutAddSubMenu("Features", femenu); glutAddSubMenu("View", vwmenu); glutAddSubMenu("Animation", amenu); glutAddMenuEntry("", '\0'); glutAddMenuEntry("Close window", 'X'); glutAddMenuEntry("Quit", 'q'); return (1); } freefem++-3.61-1/src/medit/bbfile.c000644 000767 000024 00000016117 13312446271 017071 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" int EatLine (FILE *in) { int k, c; k = 0; while ((c = fgetc(in)) != EOF) { k++; if (c == 10 || c == 13) return (1); } return (0); } int EatSpace (FILE *in) { int k, c, ret = 0; k = 0; while (isspace(c = fgetc(in))) { k++; if (c == 10 || c == 13) ret = 1; } if (c == EOF) return -1; /* fprintf(stdout,"EatSpace %d %d last char=%d\n",ret,k,c); */ ungetc(c, in); return ret; } int bbfile (pMesh mesh) { FILE *in; pSolution ps; double a, b, c, lambda[3], eigv[3][3], m[6], vp[2][2]; float dummy; int j, k, l, dim, np, nf, i1, i2, i3, err, iord; char *ptr, data[128], tmp[128]; ubyte bigbb; /* default */ strcpy(tmp, mesh->name); ptr = (char *)strstr(tmp, ".mesh"); if (ptr) *ptr = '\0'; sprintf(data, "%s.bb", tmp); in = fopen(data, "r"); bigbb = 0; if (!in) { sprintf(data, "%s.pbb", tmp); in = fopen(data, "r"); } if (!in) { bigbb = 1; sprintf(data, "%s.BB", tmp); in = fopen(data, "r"); if (!in) { /* hack FH pour le mac */ sprintf(data, "%s.gbb", tmp); in = fopen(data, "r"); } } if (!in) return (0); /* if ( !quiet ) fprintf(stdout," Reading %s\n",data); */ i1 = i2 = i3 = -1; /* read file format */ err = 0; fscanf(in, "%d", &dim); if (EatSpace(in)) err++; fscanf(in, "%d", &i1); if (EatSpace(in)) err++; fscanf(in, "%d", &i2); if (EatSpace(in)) err++; fscanf(in, "%d", &i3); bigbb = (EatSpace(in) == 0);/* not nl after the 4 integer => BB */ if (!quiet) if (bigbb) fprintf(stdout, " Reading BB file %s\n", data); else fprintf(stdout, " Reading bb file %s\n", data); if (dim < 2 || dim > 3 || err) { fprintf(stderr, " %%%% Wrong file (dim=%d) (err=%d). Ignored\n", dim, err); return (0); } /* read number of field(s) */ nf = 0; if (bigbb) { int nfield; /* get only 1st field */ /* fscanf(in,"%d",&nfield);*/ nfield = i1; /*fscanf(in,"%d",&mesh->nfield);*/ mesh->nfield = i2; if (nfield > 1) { nf += i3; for (k = 1; k < nfield - 1; k++) { fscanf(in, "%d", &np); nf += np; } fscanf(in, "%d", &np); } else { np = i3; } /* read file type */ fscanf(in, "%d", &mesh->typage); printf(" np= %d, type= %d\n", np, mesh->typage); } else { /* fscanf(in,"%d",&mesh->nfield); * fscanf(in,"%d",&np);*/ /* read file type */ /* fscanf(in,"%d",&mesh->typage);*/ mesh->nfield = i1; np = i2; mesh->typage = i3; } if (mesh->typage == 2) { if (np < mesh->np) { fprintf(stderr, " %%%% Wrong solution number (%d , %d). Ignored\n", np, mesh->np); fclose(in); return (0); } mesh->nbb = mesh->np; } else if (mesh->typage == 1) { if (np < mesh->ne) { fprintf(stderr, " %%%% Wrong solution number (%d , %d). Ignored\n", np, mesh->ne); fclose(in); return (0); } mesh->nbb = mesh->ne; } else { fprintf(stderr, " %%%% Wrong typage (%d). Ignored\n", mesh->typage); fclose(in); return (0); } /* read solutions */ mesh->bbmin = 1.e10; mesh->bbmax = -1.e10; /* allocate memory */ if (!zaldy2(mesh)) { mesh->nbb = 0; fclose(in); return (0); } /* scalar field */ if (mesh->nfield == 1) { if (ddebug) printf(" scalar (isotropic) field\n"); for (k = 1; k <= mesh->nbb; k++) { ps = &mesh->sol[k]; ps->bb = 0.0; if (fscanf(in, "%127s", data) != 1) continue; if (ptr = strpbrk(data, "dD")) *ptr = 'E'; sscanf(data, "%f", &ps->bb); if (ps->bb < mesh->bbmin) mesh->bbmin = ps->bb; if (ps->bb > mesh->bbmax) mesh->bbmax = ps->bb; for (j = 1; j <= nf; j++) { fscanf(in, "%f", &dummy); } } } /* vector field */ else if (mesh->nfield == mesh->dim) { if (ddebug) fprintf(stdout, " vector field \n"); for (k = 1; k <= mesh->nbb; k++) { ps = &mesh->sol[k]; ps->bb = 0.0; for (l = 0; l < mesh->dim; l++) { if (fscanf(in, "%127s", data) != 1) continue; if (ptr = strpbrk(data, "dD")) *ptr = 'E'; sscanf(data, "%f", &ps->m[l]); ps->bb += ps->m[l] * ps->m[l]; } ps->bb = sqrt(ps->bb); if (ps->bb < mesh->bbmin) mesh->bbmin = ps->bb; if (ps->bb > mesh->bbmax) mesh->bbmax = ps->bb; for (j = 1; j < nf; j++) { fscanf(in, "%f", &dummy); } } fclose(in); return (0); } else if (dim == 2 && mesh->nfield == 3) { if (ddebug) fprintf(stdout, " 2D metric field\n"); for (k = 1; k <= mesh->np; k++) { ps = &mesh->sol[k]; fscanf(in, "%lf %lf %lf", &a, &b, &c); ps->m[0] = a; ps->m[1] = b; ps->m[2] = c; m[0] = a; m[1] = b; m[2] = c; eigen2(m, lambda, vp); ps->bb = min(lambda[0], lambda[1]); if (ps->bb < mesh->bbmin) mesh->bbmin = ps->bb; if (ps->bb > mesh->bbmax) mesh->bbmax = ps->bb; for (j = 1; j < nf; j++) { fscanf(in, "%f", &dummy); } } } else if (dim == 3 && mesh->nfield == 6) { if (ddebug) fprintf(stdout, " 3D metric field\n"); for (k = 1; k <= mesh->np; k++) { ps = &mesh->sol[k]; ps->bb = 0.0f; for (l = 0; l < 6; l++) { if (fscanf(in, "%127s", data) != 1) continue; if (ptr = strpbrk(data, "dD")) *ptr = 'E'; sscanf(data, "%f", &dummy); m[l] = dummy; } ps->m[0] = m[0]; ps->m[1] = m[1]; ps->m[2] = m[3]; ps->m[3] = m[2]; ps->m[4] = m[4]; ps->m[5] = m[5]; m[2] = ps->m[2]; m[3] = ps->m[3]; iord = eigenv(1, m, lambda, eigv); if (iord) { ps->bb = lambda[0]; ps->bb = max(ps->bb, lambda[1]); ps->bb = max(ps->bb, lambda[2]); if (ps->bb < mesh->bbmin) mesh->bbmin = ps->bb; if (ps->bb > mesh->bbmax) mesh->bbmax = ps->bb; } else { fprintf(stdout, " ## Eigenvalue problem.\n"); } for (j = 1; j < nf; j++) { fscanf(in, "%f", &dummy); } } } else { fprintf(stderr, " %%%% Solution not suitable. Ignored\n"); mesh->nbb = 0; } fclose(in); return (np); } freefem++-3.61-1/src/medit/ilists.c000644 000767 000024 00000037062 13312446271 017157 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define BASETR 0.2 #define NBCOL 9 /* build lists for iso-surfaces */ GLuint listTriaIso (pScene sc, pMesh mesh) { GLuint dlist = 0; pTriangle pt; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double rgb[3]; float iso, cx, cy, cz, cc, kc; int m, k, i, l, l1, nc, ncol; static double hsv[3] = {0.0, 1.0, 0.9}; static int idir[5] = {0, 1, 2, 0, 1}; /* default */ if (!mesh->nt || !mesh->nbb || mesh->typage == 1) return (0); if (ddebug) printf("create iso-values map list / TRIA\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* create display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ glBegin(GL_LINES); ncol = NBCOL; for (i = 0; i <= ncol * (MAXISO - 1); i++) { if (i < ncol * (MAXISO - 1)) { l = i / ncol; kc = (i % ncol) / (float)ncol; iso = sc->iso.val[l] * (1.0 - kc) + sc->iso.val[l + 1] * kc; hsv[0] = sc->iso.col[l] * (1.0 - kc) + sc->iso.col[l + 1] * kc; } else { iso = sc->iso.val[MAXISO - 1]; hsv[0] = sc->iso.col[MAXISO - 1]; } hsvrgb(hsv, rgb); glColor3dv(rgb); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } /* analyze edges */ nc = 0; cx = cy = cz = 0.0; for (l = 0; l < 3; l++) { l1 = idir[l + 1]; p0 = &mesh->point[pt->v[l]]; p1 = &mesh->point[pt->v[l1]]; ps0 = &mesh->sol[pt->v[l]]; ps1 = &mesh->sol[pt->v[l1]]; if ((ps0->bb > iso && ps1->bb <= iso) || (ps0->bb < iso && ps1->bb >= iso)) { cc = 0.0; if (fabs(ps1->bb - ps0->bb) > 0.0) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); if (cc == 0.0 || cc == 1.0) continue; cx = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy = p0->c[1] + cc * (p1->c[1] - p0->c[1]); nc++; if (mesh->dim == 2) { glVertex2f(cx, cy); } else { cz = p0->c[2] + cc * (p1->c[2] - p0->c[2]); glVertex3f(cx, cy, cz); } } else if (ps0->bb == iso && ps1->bb == iso) { nc = 2; if (mesh->dim == 2) { glVertex2f(p0->c[0], p0->c[1]); glVertex2f(p1->c[0], p1->c[1]); break; } else { glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); break; } } } if (nc > 0 && nc != 2) { if (mesh->dim == 2) glVertex2f(cx, cy); else glVertex3f(cx, cy, cz); } k = pt->nxt; } } } glEnd(); glEndList(); return (dlist); } /* build lists for iso-surfaces */ GLuint listQuadIso (pScene sc, pMesh mesh) { GLuint dlist = 0; pQuad pq; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double rgb[3]; float iso, cx, cy, cz, cc, kc; int m, k, i, l, l1, ncol; static double hsv[3] = {0.0f, 1.0f, 0.8f}; static int idir[6] = {0, 1, 2, 3, 0, 1}; /* default */ if (!mesh->nq || !mesh->nbb || mesh->typage == 1) return (0); if (ddebug) printf("create iso-values map list / QUAD\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ glBegin(GL_LINES); ncol = NBCOL; for (i = 0; i <= ncol * (MAXISO - 1); i++) { if (i < ncol * (MAXISO - 1)) { l = i / ncol; kc = (i % ncol) / (float)ncol; iso = sc->iso.val[l] * (1.0 - kc) + sc->iso.val[l + 1] * kc; hsv[0] = sc->iso.col[l] * (1.0 - kc) + sc->iso.col[l + 1] * kc; } else { iso = sc->iso.val[MAXISO - 1]; hsv[0] = sc->iso.col[MAXISO - 1]; } hsvrgb(hsv, rgb); glColor3dv(rgb); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; while (k != 0) { pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } /* analyze edges */ for (l = 0; l < 4; l++) { p0 = &mesh->point[pq->v[l]]; ps0 = &mesh->sol[pq->v[l]]; l1 = idir[l + 1]; p1 = &mesh->point[pq->v[l1]]; ps1 = &mesh->sol[pq->v[l1]]; if ((ps0->bb > iso && ps1->bb <= iso) || (ps0->bb < iso && ps1->bb >= iso)) { cc = 0.0f; if (fabs(ps1->bb - ps0->bb) > 0.0f) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); if (cc == 0.0f || cc == 1.0f) continue; cx = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy = p0->c[1] + cc * (p1->c[1] - p0->c[1]); if (mesh->dim == 2) { glVertex2f(cx, cy); } else { cz = p0->c[2] + cc * (p1->c[2] - p0->c[2]); glVertex3f(cx, cy, cz); } } } k = pq->nxt; } } } glEnd(); glEndList(); return (dlist); } /* build lists for iso-surfaces */ GLuint listTetraIso (pScene sc, pMesh mesh) { FILE *outv, *outf; GLuint dlist = 0; pTetra pt; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double delta, rgb[4], d, ax, ay, az, bx, by, bz; float n[3], cx[4], cy[4], cz[4], cc; int m, k, k1, k2, i, l, pos[4], neg[4], nbpos, nbneg, nbnul, nv, nf; static double hsv[3] = {0.0f, 1.0f, 0.80f}; static int tn[4] = {0, 0, 1, 1}; static int tp[4] = {0, 1, 1, 0}; /* default */ if (!mesh->ntet || !mesh->nbb || mesh->typage == 1) return (0); if (ddebug) printf("create iso-values map list / TETRA\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); delta = sc->iso.val[MAXISO - 1] - sc->iso.val[0]; /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE); if (ddebug) { outv = fopen("vertex.mesh", "w"); fprintf(outv, "MeshVersionFormatted 1\n Dimension\n 3\n\nVertices\n \n"); outf = fopen("faces.mesh2", "w"); fprintf(outv, "Triangles\n \n"); } nv = nf = 0; glBegin(GL_TRIANGLES); for (i = MAXISO - 1; i >= 0; i--) { float iso; iso = sc->iso.val[i]; /* base color */ /*hsv[0] = 240.0f*(1.0f - (iso-sc->iso.val[0])/delta);*/ hsv[0] = sc->iso.col[i]; hsvrgb(hsv, rgb); rgb[0] = min(1.0, rgb[0] + BASETR); rgb[1] = min(1.0, rgb[1] + BASETR); rgb[2] = min(1.0, rgb[2] + BASETR); rgb[3] = BASETR + (float)(i - 1) / (float)MAXISO * (1.0 - BASETR); /*rgb[3] = 0.5; */ glColor4dv(rgb); if (i == MAXISO - 1) iso -= 0.001 * fabs(iso) / delta; else if (i == 0) iso += 0.001 * fabs(iso) / delta; for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0]) { k = pt->nxt; continue; } /* analyze vertices */ nbpos = nbneg = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; ps0 = &mesh->sol[pt->v[l]]; /*if ( ps0->bb < sc->iso.val[0] ) ps0->bb = sc->iso.val[0];*/ if (ps0->bb > iso) pos[nbpos++] = l; else if (ps0->bb < iso) neg[nbneg++] = l; else nbnul++; } if (nbneg == 4 || nbpos == 4) { k = pt->nxt; continue; } if (nbneg == 2 && nbpos == 2) { for (l = 0; l < 4; l++) { k1 = neg[tn[l]]; k2 = pos[tp[l]]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; cc = 0.0f; if (fabs(ps1->bb - ps0->bb) > 0.0f) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(cx[0], cy[0], cz[0]); glVertex3f(cx[1], cy[1], cz[1]); glVertex3f(cx[2], cy[2], cz[2]); glNormal3fv(n); glVertex3f(cx[0], cy[0], cz[0]); glVertex3f(cx[2], cy[2], cz[2]); glVertex3f(cx[3], cy[3], cz[3]); if (ddebug) { fprintf(outv, "%f %f %f 0\n", cx[0], cy[0], cz[0]); fprintf(outv, "%f %f %f 0\n", cx[1], cy[1], cz[1]); fprintf(outv, "%f %f %f 0\n", cx[2], cy[2], cz[2]); fprintf(outv, "%f %f %f 0\n", cx[3], cy[3], cz[3]); fprintf(outf, "%d %d %d 0\n", nv + 1, nv + 2, nv + 3); fprintf(outf, "%d %d %d 0\n", nv + 1, nv + 3, nv + 4); } nv += 4; nf += 2; } else if (!nbnul) { for (l = 0; l < 3; l++) { k1 = nbneg == 3 ? neg[l] : pos[l]; k2 = nbneg == 3 ? pos[0] : neg[0]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; cc = 0.0f; if (fabs(ps1->bb - ps0->bb) > 0.0f) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(cx[0], cy[0], cz[0]); glVertex3f(cx[1], cy[1], cz[1]); glVertex3f(cx[2], cy[2], cz[2]); if (ddebug) { fprintf(outv, "%f %f %f 0\n", cx[0], cy[0], cz[0]); fprintf(outv, "%f %f %f 0\n", cx[1], cy[1], cz[1]); fprintf(outv, "%f %f %f 0\n", cx[2], cy[2], cz[2]); fprintf(outf, "%d %d %d 0\n", nv + 1, nv + 2, nv + 3); } nv += 3; nf += 1; } k = pt->nxt; } } } glEnd(); glDepthMask(GL_TRUE); glDisable(GL_BLEND); if (ddebug) { fclose(outv); fclose(outf); } printf(" Vertices %d Triangles %d\n", nv, nf); glEndList(); return (dlist); } int tetraIsoPOVray (pScene sc, pMesh mesh) { FILE *isofil; pTetra pt; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double delta; float cx[4], cy[4], cz[4], cc; int m, k, k1, k2, i, l, pos[4], neg[4], nbpos, nbneg, nbnul; char data[128]; static int tn[4] = {0, 0, 1, 1}; static int tp[4] = {0, 1, 1, 0}; /* default */ if (!mesh->ntet || !mesh->nbb || mesh->typage == 1) return (0); if (ddebug) printf("create isosurfaces POVray\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); delta = sc->iso.val[MAXISO - 1] - sc->iso.val[0]; strcpy(data, mesh->name); strcat(data, ".pov"); if (ddebug) fprintf(stdout, " Writing POVRay file %s\n", data); isofil = fopen(data, "w"); if (!isofil) return (0); for (i = MAXISO - 1; i >= 0; i--) { float iso; iso = sc->iso.val[i]; if (i == MAXISO - 1) iso -= 0.001 * fabs(iso) / delta; else if (i == 0) iso += 0.001 * fabs(iso) / delta; fprintf(isofil, "\n#declare isosurf%d = mesh {\n", i); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0]) { k = pt->nxt; continue; } /* analyze vertices */ nbpos = nbneg = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; ps0 = &mesh->sol[pt->v[l]]; if (ps0->bb > iso) pos[nbpos++] = l; else if (ps0->bb < iso) neg[nbneg++] = l; else nbnul++; } if (nbneg == 4 || nbpos == 4) { k = pt->nxt; continue; } if (nbneg == 2 && nbpos == 2) { for (l = 0; l < 4; l++) { k1 = neg[tn[l]]; k2 = pos[tp[l]]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; cc = 0.0f; if (fabs(ps1->bb - ps0->bb) > 0.0f) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } fprintf(isofil, "triangle {\n"); fprintf(isofil, " <%f,%f,%f>,\n", cx[0] + mesh->xtra, cy[0] + mesh->ytra, cz[0] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>,\n", cx[1] + mesh->xtra, cy[1] + mesh->ytra, cz[1] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>\n", cx[2] + mesh->xtra, cy[2] + mesh->ytra, cz[2] + mesh->ztra); fprintf(isofil, "}\n"); fprintf(isofil, "triangle {\n"); fprintf(isofil, " <%f,%f,%f>,\n", cx[0] + mesh->xtra, cy[0] + mesh->ytra, cz[0] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>,\n", cx[2] + mesh->xtra, cy[2] + mesh->ytra, cz[2] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>\n", cx[3] + mesh->xtra, cy[3] + mesh->ytra, cz[3] + mesh->ztra); fprintf(isofil, "}\n"); } else if (!nbnul) { for (l = 0; l < 3; l++) { k1 = nbneg == 3 ? neg[l] : pos[l]; k2 = nbneg == 3 ? pos[0] : neg[0]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; cc = 0.0f; if (fabs(ps1->bb - ps0->bb) > 0.0f) cc = (iso - ps0->bb) / (ps1->bb - ps0->bb); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } fprintf(isofil, "triangle {\n"); fprintf(isofil, " <%f,%f,%f>,\n", cx[0] + mesh->xtra, cy[0] + mesh->ytra, cz[0] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>,\n", cx[1] + mesh->xtra, cy[1] + mesh->ytra, cz[1] + mesh->ztra); fprintf(isofil, " <%f,%f,%f>\n", cx[2] + mesh->xtra, cy[2] + mesh->ytra, cz[2] + mesh->ztra); fprintf(isofil, "}\n"); } k = pt->nxt; } } fprintf(isofil, "}\n"); } fclose(isofil); return (1); } freefem++-3.61-1/src/medit/scene.c000644 000767 000024 00000056501 13312446271 016744 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" extern GLboolean hasStereo; extern int *pilmat, ipilmat, refmat, reftype, refitem; extern short schw, schh; extern ubyte quiet, fullscreen, tiling, stereoMode; /* return current active scene */ int currentScene () { int k, idw; idw = glutGetWindow(); for (k = 0; k < MAX_SCENE; k++) { if (cv.scene[k] && idw == cv.scene[k]->idwin) return (k); } return (0); } /* check for OpenGL error */ void checkErrors (void) { GLenum error; while ((error = glGetError()) != GL_NO_ERROR) { fprintf(stderr, " ## ERROR: %d: %s\n", (int)error, (char *)gluErrorString(error)); exit(1); } } void farclip (GLboolean b) { pScene sc; pPersp p; pCamera c; float look[3], ratio, units; int idw = currentScene(); static GLfloat up[3] = {0.0, 1.0, 0.0}; /* default */ sc = cv.scene[idw]; p = sc->persp; c = sc->camera; ratio = (GLfloat)sc->par.xs / sc->par.ys; glMatrixMode(GL_PROJECTION); glLoadIdentity(); switch (p->pmode) { case ORTHO: glOrtho(-1., 1., -1., 0.1, 0.01, 0.01); break; case PERSPECTIVE: if (b) gluPerspective(p->fovy, ratio, sc->dmax, 4.0 * sc->dmax); else gluPerspective(p->fovy, ratio, 0.01, 10000.0 * sc->dmax); units = 1.e-02; glPolygonOffset(1.0, units); break; case CAMERA: gluPerspective(p->fovy, ratio, 0.001 * sc->dmax, 4.0 * sc->dmax); look[0] = c->eye[0] + 0.001 * sc->dmax * c->speed[0]; look[1] = c->eye[1] + 0.001 * sc->dmax * c->speed[1]; look[2] = c->eye[2] + 0.001 * sc->dmax * c->speed[2]; gluLookAt(c->eye[0], c->eye[1], c->eye[2], look[0], look[1], look[2], up[0], up[1], up[2]); break; } /* zoom transformation */ if (p->rubber == 2) { glPushMatrix(); glLoadIdentity(); glRotatef(-p->gamma, 1., 0., 0.); glRotatef(p->alpha, 0., 1., 0.); glMultMatrixf(p->matrix); glGetFloatv(GL_PROJECTION_MATRIX, p->matrix); glPopMatrix(); p->rubber = 0; } /* apply transformation */ glMultMatrixf(p->matrix); glMatrixMode(GL_MODELVIEW); } void reshapeScene (int width, int height) { pScene sc; if (ddebug) printf("reshape scene\n"); sc = cv.scene[currentScene()]; sc->par.xs = width; sc->par.ys = height; glViewport(0, 0, width, height); farclip(GL_TRUE); } static void drawList (pScene sc, int clip, int map) { pMesh mesh = cv.mesh[sc->idmesh]; ubyte elev = sc->mode & S_ALTITUDE; if (ddebug) printf("drawList %p %d %d\n", sc, clip, map); if (mesh->dim == 2 && !elev) glDisable(GL_DEPTH_TEST); glLineWidth(1.0); if (clip) { if (map) { if (sc->cmlist[LTets]) glCallList(sc->cmlist[LTets]); if (sc->cmlist[LHexa]) glCallList(sc->cmlist[LHexa]); } else { if (sc->clist[LTets]) glCallList(sc->clist[LTets]); if (sc->clist[LHexa]) glCallList(sc->clist[LHexa]); } } else if (map) { if (mesh->nt + mesh->nq) { if (sc->mlist[LTria]) glCallList(sc->mlist[LTria]); if (sc->mlist[LQuad]) glCallList(sc->mlist[LQuad]); } else { if (sc->mlist[LTets]) glCallList(sc->mlist[LTets]); if (sc->mlist[LHexa]) glCallList(sc->mlist[LHexa]); } } else { if (mesh->nt + mesh->nq) { if (sc->dlist[LTria]) glCallList(sc->dlist[LTria]); if (sc->dlist[LQuad]) glCallList(sc->dlist[LQuad]); } else { if (sc->dlist[LTets]) glCallList(sc->dlist[LTets]); if (sc->dlist[LHexa]) glCallList(sc->dlist[LHexa]); } } if (mesh->dim == 2 && !elev) glEnable(GL_DEPTH_TEST); } #ifdef ppc void bogusQuad (pScene sc) { /* bogus polygon (nvidia) */ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glLineWidth(1.0); glColor3fv(sc->par.back); glBegin(GL_QUADS); glVertex3f(0., 0., -sc->persp->depth); glVertex3f(0., 0., -sc->persp->depth); glVertex3f(0., 0., -sc->persp->depth); glVertex3f(0., 0., -sc->persp->depth); glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } #endif static void displayScene (pScene sc, int mode, int clip) { int map; map = mode & S_MAP; switch (mode) { case FILL: /* solid fill */ if (ddebug) printf("solid fill\n"); glEnable(GL_LIGHTING); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glDisable(GL_POLYGON_OFFSET_FILL); drawList(sc, clip, 0); glDisable(GL_LIGHTING); break; case WIRE: /* basic wireframe */ case WIRE + S_MATERIAL: if (ddebug) printf("wireframe\n"); #ifdef ppc bogusQuad(sc); #endif glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor4fv(sc->par.line); glDisable(GL_POLYGON_OFFSET_FILL); drawList(sc, clip, 0); break; case DEPTH: /* depth wireframe */ case DEPTH + S_MATERIAL: if (ddebug) printf("depth wireframe\n"); glEnable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisable(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); drawList(sc, clip, 0); glDisable(GL_LIGHTING); break; case HIDDEN:/* hidden lines removal */ case HIDDEN + S_MATERIAL: if (ddebug) printf("hidden lines\n"); glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor3fv(sc->par.back); drawList(sc, clip, 0); glDisable(GL_POLYGON_OFFSET_FILL); #ifdef ppc bogusQuad(sc); #endif glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor4fv(sc->par.line); drawList(sc, clip, 0); break; case SHADED:/* shaded polygons */ case SHADED + S_MATERIAL: if (ddebug) printf("shaded polygons\n"); glEnable(GL_LIGHTING); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glEnable(GL_POLYGON_OFFSET_FILL); drawList(sc, clip, 0); glDisable(GL_LIGHTING); glDisable(GL_POLYGON_OFFSET_FILL); #ifdef ppc bogusQuad(sc); #endif glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor4fv(sc->par.line); drawList(sc, clip, 0); break; case SIZEMAP: /* display metric map */ case SIZEMAP + S_MATERIAL: if (ddebug) printf("display sizemap\n"); glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); drawList(sc, clip, map); glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisable(GL_POLYGON_OFFSET_FILL); #ifdef ppc bogusQuad(sc); #endif glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor4fv(sc->par.line); glLineWidth(1.0); drawList(sc, clip, 0); if (sc->mode & S_ALTITUDE) { glColor4fv(sc->par.line); if (sc->mlist[LTets]) glCallList(sc->mlist[LTets]); if (sc->mlist[LHexa]) glCallList(sc->mlist[LHexa]); } break; default:/* other modes */ if (ddebug) printf("rendering mode %d\n", sc->mode); /* interior */ if (sc->mode & S_FILL) { if (sc->mode & S_COLOR) glEnable(GL_LIGHTING); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glEnable(GL_POLYGON_OFFSET_FILL); if (sc->mode & S_MAP) { glEnable(GL_COLOR_MATERIAL); drawList(sc, clip, map); glDisable(GL_COLOR_MATERIAL); } else { glColor4fv(sc->par.back); drawList(sc, clip, 0); } } /* boundary */ glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisable(GL_POLYGON_OFFSET_FILL); #ifdef ppc bogusQuad(sc); #endif glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); if (!(sc->mode & S_BDRY)) break; if (sc->mode & S_COLOR && !(sc->mode & S_FILL)) { glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); } if (sc->mode & S_MAP) { if (sc->mode & S_FILL) { glColor4fv(sc->par.line); drawList(sc, clip, 0); } else { drawList(sc, clip, map); } } else if (sc->mode & S_ALTITUDE) { glColor4fv(sc->par.line); drawList(sc, clip, map); if (sc->mlist[LTets]) glCallList(sc->mlist[LTets]); if (sc->mlist[LHexa]) glCallList(sc->mlist[LHexa]); } else { glColor4fv(sc->par.line); drawList(sc, clip, 0); } } } static void displayData (pScene sc, pMesh mesh) { glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); /* iso-lines */ if (sc->isotyp & S_ISOLINE) { glLineWidth(1.0); if (sc->ilist[LTria]) glCallList(sc->ilist[LTria]); if (sc->ilist[LQuad]) glCallList(sc->ilist[LQuad]); glDisable(GL_CLIP_PLANE0); if (sc->ilist[LTets] && sc->clip->active & C_ON) glCallList(sc->ilist[LTets]); } /* vector field */ if (sc->isotyp & S_VECTOR) { if (mesh->dim == 2) { if (sc->vlist[LTria]) glCallList(sc->vlist[LTria]); if (sc->vlist[LQuad]) glCallList(sc->vlist[LQuad]); } else { if (sc->clip->active & C_ON) { glDisable(GL_CLIP_PLANE0); if (sc->vlist[LTets]) glCallList(sc->vlist[LTets]); if (sc->vlist[LHexa]) glCallList(sc->vlist[LHexa]); } else if (mesh->ntet + mesh->nhex == 0) { if (sc->vlist[LTria]) glCallList(sc->vlist[LTria]); } } } /* streamlines */ if (sc->isotyp & S_CRITP && sc->cplist) glCallList(sc->cplist); if (sc->isotyp & S_STREAML) { int kk; for (kk = 0; kk < sc->stream->nbstl; kk++) { glCallList(sc->slist[kk]); } } else if (sc->isotyp & S_PARTICLE) { glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); displayParticle(sc, mesh); glDisable(GL_COLOR_MATERIAL); } /* iso-surfaces */ if (sc->isotyp & S_ISOSURF) { glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); if (sc->ilist[LTets]) glCallList(sc->ilist[LTets]); if (sc->ilist[LHexa]) glCallList(sc->ilist[LHexa]); glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); } } void setupView (pScene sc) { pScene slave; pMesh mesh; pTransform view; pPersp p; pCamera c; /* default */ if (ddebug) fprintf(stdout, "setupView\n"); mesh = cv.mesh[sc->idmesh]; view = sc->view; p = sc->persp; c = sc->camera; /* init transformation matrix */ if (sc->type & S_RESET) { glPushMatrix(); glLoadIdentity(); if (p->pmode != CAMERA) { if (mesh->dim == 3 || sc->mode & S_ALTITUDE) { glRotatef(-60., 1., 0., 0.); glRotatef(-120., 0., 0., 1.); } } else { if (c->vecup == X_AXIS) glRotatef(90.0, 0.0, 0.0, 1.0); else if (c->vecup == Z_AXIS) glRotatef(-90.0, 1.0, 0.0, 0.0); } glGetFloatv(GL_MODELVIEW_MATRIX, view->matrix); glPopMatrix(); sc->type ^= S_RESET; } /* keep old transformation */ memcpy(view->oldmat, view->matrix, 16 * sizeof(float)); /* compute new transformation */ glPushMatrix(); glLoadIdentity(); if (p->pmode != CAMERA) { glTranslatef(view->panx, view->pany, 0.0); if (mesh->dim == 3 || sc->mode & S_ALTITUDE) glRotatef(view->angle, view->axis[0], view->axis[1], view->axis[2]); glTranslatef(-view->opanx, -view->opany, 0.); glMultMatrixf(view->matrix); glGetFloatv(GL_MODELVIEW_MATRIX, view->matrix); } else if (animate) { c->eye[0] += c->spmod * c->speed[0]; c->eye[1] += c->spmod * c->speed[1]; c->eye[2] += c->spmod * c->speed[2]; animateCamera(); reshapeScene(sc->par.xs, sc->par.ys); } glPopMatrix(); /* keep old translation */ view->opanx = view->panx; view->opany = view->pany; /* copy views */ if (!animate && sc->slave > -1) { int clvol; slave = cv.scene[sc->slave]; memcpy(slave->view, sc->view, sizeof(struct transform)); memcpy(slave->camera, sc->camera, sizeof(struct camera)); slave->view->angle = 0.0f; clvol = slave->clip->active & C_VOL; memcpy(slave->clip, sc->clip, sizeof(struct clip)); if (clvol) slave->clip->active |= C_VOL; } } void drawModel (pScene sc) { pMesh mesh; pTransform view; pClip clip; ubyte sstatic; /* default */ mesh = cv.mesh[sc->idmesh]; view = sc->view; clip = sc->clip; if (ddebug) printf("\n-- redraw scene %d, mesh %d\n", sc->idwin, sc->idmesh); glDisable(GL_LIGHTING); /* draw clipping plane */ if (clip->active & C_ON) { drawClip(sc, clip, mesh, 0); glClipPlane(GL_CLIP_PLANE0, clip->eqn); glEnable(GL_CLIP_PLANE0); } else { glDisable(GL_CLIP_PLANE0); } /* draw object if static scene */ sstatic = view->mstate > 0 && clip->cliptr->mstate > 0; if (sstatic || sc->type & S_FOLLOW) { displayScene(sc, sc->mode, 0); if (sc->item & S_NUMP || sc->item & S_NUMF) listNum(sc, mesh); /* draw normals */ if (sc->type & S_NORMAL) { if (!sc->nlist) sc->nlist = drawNormals(mesh, sc); glCallList(sc->nlist); } /* draw data */ if (sstatic) displayData(sc, mesh); } else if (!(sc->item & S_BOX)) { drawBox(sc, mesh, 0); } /* draw ridges, corners, etc. */ if ((sc->item & S_GEOM) && sc->glist) { glDisable(GL_LIGHTING); if (!mesh->ne) glPointSize(1); else glPointSize(5); glDisable(GL_COLOR_MATERIAL); glCallList(sc->glist); } glDisable(GL_CLIP_PLANE0); if (clip->active & C_EDIT || sc->item & S_BOX) drawBox(sc, mesh, 0); if (sc->item & S_AXIS) drawAxis(sc, mesh->dim); if ((mesh->dim == 3 || sc->mode & S_ALTITUDE) && sc->item & S_GRID) drawBase(sc, mesh); if (sc->cube->active & C_ON) drawCube(sc, mesh); sstatic |= tiling; if (sstatic && clip->active & C_ON && clip->active & C_VOL) displayScene(sc, sc->mode, 1); if (sc->picklist && !(sc->isotyp & S_PARTICLE)) { glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glDisable(GL_POLYGON_OFFSET_FILL); glCallList(sc->picklist); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glDisable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); } /* show path, if any */ if (sc->type & S_PATH && sc->path.tlist) glCallList(sc->path.tlist); } void redrawMorphing (pScene sc) { if (morphing) { pMesh mesh; mesh = cv.mesh[sc->idmesh]; if (!morphMesh(sc, mesh)) return; } } /* animate */ void glutIdle (void) { static float timePassed = 0.0; static float timeRedraw = 0.02; /*1.0 / 50.0*/ float clk, timeElaps; clk = clock(); timeElaps = (clk - timePassed) / (float)CLOCKS_PER_SEC; if (timeElaps >= timeRedraw) { timePassed = clk; glutPostRedisplay(); } } void streamIdle (void) { pScene sc; pMesh mesh; static clock_t timbase = 0; static float maxtim = 0.; sc = cv.scene[currentScene()]; sc->par.cumtim += sc->par.dt; sc->par.advtim = 1; if (sc->par.cumtim > sc->par.maxtime) { sc->par.cumtim = 0.0; sc->par.cumpertime = 0.0; saveimg = 0; sc->isotyp &= ~S_PARTICLE; glutIdleFunc(0); printf("\nfin"); } else if (sc->par.cumpertime >= sc->par.pertime) { mesh = cv.mesh[sc->idmesh]; sc->par.cumpertime = 0.0; if (!animParticle(sc, mesh)) { sc->par.cumtim = 0.0; sc->par.cumpertime = 0.0; saveimg = 0; glutIdleFunc(0); printf("\nfin"); } else { glutPostRedisplay(); } } else { glutPostRedisplay(); } return; if (timbase < 1) { timbase = clock(); maxtim = 0.0; sc->par.advtim = 0; glutPostRedisplay(); } else { float elp; clock_t tim; tim = clock(); elp = (tim - timbase) / (float)CLOCKS_PER_SEC; if (elp > sc->par.dt) { timbase = tim; maxtim += elp; sc->par.advtim = 1; if (maxtim > sc->par.maxtime) glutIdleFunc(0); } sc->par.cumtim += sc->par.dt; glutPostRedisplay(); } } /* OpenGL callbacks */ void redrawScene () { pScene sc; pTransform view; pPersp p; pCamera c; sc = cv.scene[currentScene()]; view = sc->view; p = sc->persp; c = sc->camera; if (stereoMode == MONO || !hasStereo) { glDrawBuffer(GL_BACK_LEFT); glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -p->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glMultMatrixf(view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModel(sc); if (sc->type & S_DECO) redrawStatusBar(sc); } else { double ndfl, ratio, top, bottom; double left, right, nnear, ffar; nnear = -p->depth - 0.5 * sc->dmax; if (nnear < 0.1) nnear = 0.1; ffar = -p->depth + 0.5 * sc->dmax; ratio = sc->par.xs / (double)sc->par.ys; top = nnear * tan(DTOR * 0.5 * p->fovy); ndfl = nnear / p->depth; if (sc->par.eyesep < 0.0) sc->par.eyesep = fabs(p->depth / 20.0); /* left view */ glDrawBuffer(GL_BACK_LEFT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); left = -ratio * top + 0.5 * sc->par.eyesep * ndfl; right = ratio * top + 0.5 * sc->par.eyesep * ndfl; bottom = -top; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(left, right, top, bottom, nnear, ffar); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(-sc->par.eyesep, 0., -p->depth, sc->par.eyesep / 3.0, 0., 0., 0.0, 1.0, 0.0); setupView(sc); glMultMatrixf(view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModel(sc); if (sc->type & S_DECO) redrawStatusBar(sc); /* right view */ glDrawBuffer(GL_BACK_RIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); left = -ratio * top - 0.5 * sc->par.eyesep * ndfl; right = ratio * top - 0.5 * sc->par.eyesep * ndfl; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(left, right, top, bottom, nnear, ffar); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(sc->par.eyesep, 0., -p->depth, sc->par.eyesep / 3.0, 0., 0., 0.0, 1.0, 0.0); setupView(sc); glMultMatrixf(view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModel(sc); if (sc->type & S_DECO) redrawStatusBar(sc); } /* refresh screen */ if (saveimg && animate) glFlush(); else glutSwapBuffers(); if (ddebug) checkErrors(); if (saveimg && !(sc->type & S_SCISSOR)) keyFile('H', 0, 0); /* redraw linked scene */ if (!animate && sc->slave > -1) { pScene slave; slave = cv.scene[sc->slave]; glutSetWindow(slave->idwin); redrawScene(); } } /* OpenGL callbacks */ void redrawSchnauzer () { pScene sc = cv.scene[currentScene()]; pMesh mesh; char *ptr, data[256]; mesh = cv.mesh[sc->idmesh]; strcpy(data, mesh->name); ptr = (char *)strstr(data, ".mesh"); if (ptr) *ptr = '\0'; ptr = (char *)strstr(data, ".gis"); if (ptr) *ptr = '\0'; strcat(data, ".ppm"); redrawScene(); imgHard(sc, data, 'H'); exit(0); } void deleteScene (pScene sc) { /* default */ if (ddebug) printf("deleteScene\n"); M_free(sc->view); M_free(sc->clip); M_free(sc->persp); M_free(sc->camera); M_free(sc->material); M_free(sc->matsort); M_free(sc); } void initGrafix (pScene sc, pMesh mesh) { GLfloat lightamb[4] = {0.3, 0.3, 0.3, 1.0}; GLfloat lightdif[4] = {1.0, 1.0, 1.0, 1.0}; GLfloat lightpos[4] = {0.0, 0.0, 1.0, 0.0}; if (ddebug) printf("initGrafix\n"); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glPolygonOffset(1.0, 1.0 / (float)0x10000); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glShadeModel(GL_SMOOTH); glDisable(GL_NORMALIZE); glDisable(GL_LINE_SMOOTH); glDisable(GL_POINT_SMOOTH); glDisable(GL_DITHER); glDisable(GL_CULL_FACE); if (mesh->typ == 2) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); } glPixelStorei(GL_UNPACK_ALIGNMENT, 1); /* lighting */ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE); #if (!defined (GL_VERSION_1_1)) glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); #endif glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdif); glLightfv(GL_LIGHT0, GL_AMBIENT, lightamb); glEnable(GL_LIGHTING); if (stereoMode != MONO) { lightpos[2] = -1.0; if (sc->par.sunpos) sc->par.sunpos[2] = -fabs(sc->par.sunpos[2]); } if (sc->par.sunp) glLightfv(GL_LIGHT0, GL_POSITION, sc->par.sunpos); else glLightfv(GL_LIGHT0, GL_POSITION, lightpos); glEnable(GL_LIGHT0); } /* new scene */ int createScene (pScene sc, int idmesh) { pMesh mesh; char data[128]; /* default */ mesh = cv.mesh[idmesh]; if (!quiet) fprintf(stdout, " Computing 3D scene\n"); /* set default mode */ sc->idmesh = idmesh; sc->par.xi = sc->par.yi = 10; if (option == SCHNAUZER) { sc->par.xs = schw; sc->par.ys = schh; } else { if (sc->par.xs == 0) sc->par.xs = 600; if (sc->par.ys == 0) sc->par.ys = 600; } if (!sc->mode) sc->mode = HIDDEN; sc->item = 0; sc->shrink = 1.0; sc->slave = sc->master = -1; sc->picked = 0; if (mesh->nvn == 0) sc->type ^= S_FLAT; if (mesh->ne == 0) sc->item |= S_GEOM; /* compute scene depth */ sc->dmax = sc->dmin = mesh->xmax - mesh->xmin; sc->dmax = max(sc->dmax, mesh->ymax - mesh->ymin); sc->dmin = min(sc->dmin, mesh->ymax - mesh->ymin); if (mesh->dim == 3) { sc->dmax = max(sc->dmax, mesh->zmax - mesh->zmin); sc->dmin = min(sc->dmin, mesh->zmax - mesh->zmin); } sc->dmax = fabs(sc->dmax); sc->dmin = fabs(sc->dmin); if (!sc->par.sunp) { sc->par.sunpos[0] *= 2.0 * sc->dmax; sc->par.sunpos[1] *= 2.0 * sc->dmax; sc->par.sunpos[2] *= 2.0 * sc->dmax; } sc->par.sunpos[3] = 1.0; /* create window */ glutInitWindowSize(sc->par.xs, sc->par.ys); sc->idwin = glutCreateWindow(""); assert(sc->idwin != 0); if (fullscreen) { glutFullScreen(); sc->par.xs = glutGet(GLUT_SCREEN_WIDTH); sc->par.ys = glutGet(GLUT_SCREEN_HEIGHT); } /* set window name */ sprintf(data, "Medit - [%s] #%d", mesh->name, sc->idwin); glutSetWindowTitle(data); glutSetIconTitle(data); /* required! to change background color */ glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); /* init perspective */ sc->persp = initPersp(0, sc->dmax); sc->camera = (pCamera)initCamera(sc, Y_AXIS); if (mesh->typ == 2) { sc->persp->pmode = CAMERA; sc->persp->depth *= 0.5; } /* create default view */ sc->view = (pTransform)createTransform(); if (!sc->view) return (0); sc->type |= S_RESET + S_DECO; sc->clip = (pClip)createClip(sc, mesh); if (!sc->clip) return (0); sc->cube = (pCube)createCube(sc, mesh); if (!sc->cube) return (0); /* create menus */ if (!createMenus(sc, mesh)) return (0); /* assign callbacks */ if (sc->type & S_SCISSOR) { glutDisplayFunc(scissorScene); } else if (option == SCHNAUZER) { glutDisplayFunc(redrawSchnauzer); } else if (sc->persp->pmode == CAMERA) { glutMouseFunc(mouseCamera); glutMotionFunc(motionCamera); glutDisplayFunc(redrawScene); } else { glutMouseFunc(mouse); glutMotionFunc(motion); glutDisplayFunc(redrawScene); } glutReshapeFunc(reshapeScene); glutKeyboardFunc(keyScene); glutSpecialFunc(special); glutAttachMenu(GLUT_RIGHT_BUTTON); /* create display lists by geom type */ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); doLists(sc, mesh); sc->glist = geomList(sc, mesh); sc->type |= S_FOLLOW; /* local stack */ if (!pilmat) { pilmat = (int *)calloc(sc->par.nbmat + 2, sizeof(int)); if (!pilmat) return (0); } /* color list */ setupPalette(sc, mesh); sc->stream = NULL; initGrafix(sc, mesh); return (1); } freefem++-3.61-1/src/medit/geometry.c000644 000767 000024 00000010277 13312446271 017502 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" GLuint geomList (pScene sc, pMesh mesh) { GLuint list = 0; pMaterial pm; pPoint ppt, pp0, pp1; float n[3]; int k, it = 0, nm; static float rouge[4] = {1.0, 0.0, 0.0, 1.0}; static float jaune[4] = {1.0, 1.0, 0.0, 1.0}; /* default */ if (mesh->na + mesh->nc + mesh->np == 0) return (0); /* create display list */ list = glGenLists(1); if (!list) return (0); glNewList(list, GL_COMPILE); if (glGetError()) return (0); /* draw corners, ridges and required items */ if (ddebug) printf("construct point list\n"); if (mesh->ne) { /*glPointSize(3);*/ glPointSize(sc->par.pointsize); /* pour Herve LeDret */ glBegin(GL_POINTS); for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag & M_UNUSED && !ppt->ref) continue; if (ppt->tag == M_CORNER) glColor3fv(rouge); else if (ppt->tag == M_REQUIRED){ static float green[4] = {0.0, 1.0, 0.0, 1.0}; glColor3fv(green); } else continue; it++; if (sc->par.linc == 1) glColor3fv(sc->par.edge); glVertex3f(ppt->c[0], ppt->c[1], ppt->c[2]); } glEnd(); glPointSize(1); } else { pm = &sc->material[DEFAULT_MAT]; glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); glBegin(GL_POINTS); for (k = 1; k <= mesh->np; k++) { double dd; ppt = &mesh->point[k]; n[0] = ppt->c[0] - sc->cx; n[1] = ppt->c[1] - sc->cy; n[2] = ppt->c[2] - sc->cz; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } glNormal3fv(n); glVertex3f(ppt->c[0], ppt->c[1], ppt->c[2]); } glEnd(); it = mesh->np; } /* draw edges */ if (ddebug) printf("construct edge list\n"); glLineWidth(sc->par.linewidth); glBegin(GL_LINES); for (k = 1; k <= mesh->na; k++) { pEdge pr; pr = &mesh->edge[k]; if (pr->v[0] > mesh->np || pr->v[1] > mesh->np) continue; if (pr->tag & M_RIDGE) { if (pr->tag & M_TAG) glColor3fv(jaune); /* ridge + ref en jaune */ else glColor3fv(rouge); /* ridges en rouge */ } else if (!pr->ref) { glColor3fv(sc->par.edge); } else { nm = matRef(sc, pr->ref); pm = &sc->material[nm]; glColor3fv(pm->dif); } if (sc->par.linc == 1) glColor3fv(sc->par.edge); pp0 = &mesh->point[pr->v[0]]; pp1 = &mesh->point[pr->v[1]]; glVertex3f(pp0->c[0], pp0->c[1], pp0->c[2]); glVertex3f(pp1->c[0], pp1->c[1], pp1->c[2]); it++; } glEnd(); glLineWidth(1.0); glEndList(); if (it == 0) { glDeleteLists(list, 1); return (0); } else { return (list); } } freefem++-3.61-1/src/medit/mesh.h000644 000767 000024 00000006062 13312446271 016605 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifndef _MESH_H #define _MESH_H #define M_NOTAG 0 #define M_CORNER (1 << 0) #define M_RIDGE (1 << 1) #define M_REQUIRED (1 << 2) #define M_TAG (1 << 3) #define M_UNUSED (1 << 5) #ifndef ubyte typedef unsigned char ubyte; #endif #ifndef ushort typedef unsigned short uShort; #endif typedef struct spoint { double c[3]; int tmp; short ref; uShort mark; char tag, clip, flag; } Point; typedef Point *pPoint; typedef struct striangle { int v[3], nxt; short ref; /* reference */ uShort mark, cpt; char clip; } Triangle; typedef Triangle *pTriangle; typedef struct squad { int v[4], nxt; short ref; char clip; } Quad; typedef Quad *pQuad; typedef struct edge { int v[2]; short ref; char tag; } Edge; typedef Edge *pEdge; typedef struct stetra { int v[4], nxt, mark; short ref; uShort cpt; char clip; } Tetra; typedef Tetra *pTetra; typedef struct shexa { int v[8], nxt, mark; short ref; uShort cpt; char clip; } Hexa; typedef Hexa *pHexa; typedef struct extra { float *n, *t; int *nv, *nt, *nq, *tv, *te; int iv, it, iq, jv, je; } Extra; typedef Extra *pExtra; typedef struct solu { float bb; float *m; int ver, dim; } Solution; typedef Solution *pSolution; /* Mesh: mesh data structure */ typedef struct mesh { double xmin, ymin, zmin, xmax, ymax, zmax; double xtra, ytra, ztra; float bbmin, bbmax; int ne, nt, nq, ntet, nhex; int np, nc, nr, na, nre, nri; int nvn, ntg, dim, ver, nbb, typage, nfield; uShort mark; char name[256], typ; pPoint point; pTriangle tria; pQuad quad; pEdge edge; pTetra tetra; pHexa hexa; int *adja; int *grid; ubyte *voy; pExtra extra; pSolution sol; } Mesh; typedef Mesh *pMesh; #endif freefem++-3.61-1/src/medit/zaldy2.c000644 000767 000024 00000003674 13312446271 017057 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" int zaldy2 (pMesh mesh) { int k, nbf; /* memory alloc. */ mesh->sol = (pSolution)M_calloc(mesh->nbb + 1, sizeof(struct solu), "zaldy2"); assert(mesh->sol); if (mesh->nfield == 1) return (1); if (mesh->nfield == mesh->dim) nbf = mesh->dim;/* vector field */ else nbf = mesh->dim * (mesh->dim + 1) / 2; /* d*d matrix */ for (k = 1; k <= mesh->nbb; k++) { pSolution ps; ps = &mesh->sol[k]; ps->m = (float *)malloc(nbf * sizeof(float)); } return (1); } freefem++-3.61-1/src/medit/image.c000644 000767 000024 00000022021 13312446271 016717 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "sproto.h" #include "extern.h" PPMimage*loadPPM (const char *imgname, int *type) { pPPMimage result; FILE *fp; int i, k, typimg, ret, r, g, b, s, maxval, bitsize; char *ptr, c, buff[1024]; /* search for image */ ptr = strstr(imgname, ".ppm"); if (!ptr) { char data[256]; strcpy(data, imgname); strcat(data, ".ppm"); fp = fopen(data, "rb"); } else { fp = fopen(imgname, "rb"); } if (!fp) { fprintf(stderr, " ## Unable to open file %s.\n", imgname); return (0); } if (!fgets(buff, sizeof(buff), fp)) { fprintf(stderr, " ## Invalid file header.\n"); fclose(fp); return (0); } /* check header file */ if (buff[0] != 'P') { fprintf(stderr, " ## Invalid image format.\n"); fclose(fp); return (0); } switch (buff[1]) { case '2': typimg = P2; break; case '3': typimg = P3; break; case '5': typimg = P5; break; case '6': typimg = P6; break; default: fprintf(stderr, " ## Invalid image format.\n"); fclose(fp); return (0); } /* allocate memory to store imagee */ result = malloc(sizeof(PPMimage)); if (!result) { fprintf(stderr, " ## Unable to load image.\n"); fclose(fp); return (0); } do { ret = fscanf(fp, "%1023s", buff); if (ret == EOF) break; /* check and strip comments */ if (buff[0] == '#') do { c = getc(fp); } while (c != '\n'); else break; } while (1); /* read columns + lines */ ret = sscanf(buff, "%d", &s); result->sizeX = (short)s; ret += fscanf(fp, "%d", &s); result->sizeY = (short)s; if (ret != 2) { fprintf(stderr, " ## Error loading image.\n"); free(result); fclose(fp); return (0); } if (!quiet) fprintf(stdout, " image size: %d x %d\n", result->sizeX, result->sizeY); if (fscanf(fp, "%d", &maxval) != 1) { fprintf(stderr, " ## Invalid image size.\n"); free(result); fclose(fp); return (0); } /* strip line */ while (fgetc(fp) != '\n') {;} /* size based on type */ if (typimg == P2 || typimg == P5) bitsize = result->sizeX * result->sizeY; else bitsize = 3 * result->sizeX * result->sizeY; result->data = (ubyte *)malloc(bitsize * sizeof(ubyte)); if (!result->data) { fprintf(stderr, " ## Unable to load image.\n"); free(result); fclose(fp); return (0); } /* read data file */ switch (typimg) { case P2:/* ascii file (grey) */ case P3:/* ascii file (color) */ for (i = 0; i < bitsize; i++) { fscanf(fp, "%d", &r); result->data[i] = (ubyte)r; } break; case P5:/* binary file (grey) */ case P6:/* binary file (color) */ ret = fread(result->data, sizeof(ubyte), bitsize, fp); if (ret != bitsize) { fprintf(stderr, " ## Error loading image.\n"); free(result->data); free(result); fclose(fp); return (0); } break; } fclose(fp); if (*type == DEFAULT) { switch (typimg) { case P2: case P5: *type = GREY; break; case P3: case P6: *type = RGB; break; } } /* convert to grey levels */ else if (*type == GREY && (typimg == P3 || typimg == P6)) { fprintf(stdout, " converting to grey levels\n"); for (i = 0, k = 0; i < bitsize; i += 3, k++) { r = (int)result->data[i]; g = (int)result->data[i + 1]; b = (int)result->data[i + 2]; result->data[k] = (ubyte)(0.3 * r + 0.59 * g + 0.11 * b); } result->data = (ubyte *)realloc(result->data, sizeof(ubyte) * bitsize / 3); } return (result); } int savePPM (const char *imgname, pPPMimage img, int typimg) { FILE *out; int i, c, bitsize; char *ptr, data[512]; strcpy(data, imgname); ptr = (char *)strstr(data, ".ppm"); if (!ptr) strcat(data, ".ppm"); out = fopen(data, "w"); if (!out) { fprintf(stderr, " ## Unable to open file %s.\n", data); exit(1); } bitsize = img->sizeX * img->sizeY; switch (typimg) { case P2: fprintf(out, "P2\n"); fprintf(out, "# Created using medit %s %s, (c) INRIA\n", ME_VER, ME_REL); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); c = 0; for (i = 0; i < img->sizeX * img->sizeY; i++) { fprintf(out, "%3d ", (int)img->data[i]); if (++c == 17) { c = 0; fprintf(out, "\n"); } } fprintf(out, "\n"); break; case P5: fprintf(out, "P5\n"); fprintf(out, "# Created using medit %s %s, (c) INRIA\n", ME_VER, ME_REL); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); fwrite(img->data, sizeof(ubyte), bitsize, out); break; case P6: fprintf(out, "P6\n"); fprintf(out, "# Created using medit %s %s, (c) INRIA\n", ME_VER, ME_REL); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); bitsize = (img->sizeX * 24 + 7) / 8 * img->sizeY; if (fwrite(img->data, sizeof(ubyte), bitsize, out) < bitsize) fprintf(stderr, " ## Data file corrupted.\n"); break; } fclose(out); return (1); } int saveTGA (const char *imgname, GLubyte *img, int w, int h) { TGAheader tga; int i; char *ptr, data[256]; FILE *out; strcpy(data, imgname); ptr = (char *)strstr(data, ".tga"); if (!ptr) strcat(data, ".tga"); out = fopen(data, "wb"); if (!out) { fprintf(stderr, " ## UNABLE TO OPEN FILE %s.\n", data); exit(1); } tga.idfield_len = 0; tga.cmap_type = 0; tga.image_type = 2; for (i = 0; i < 5; i++) { tga.cmap_spec[i] = 0; } for (i = 0; i < 2; i++) { tga.x_orig[i] = 0; tga.y_orig[i] = 0; } /* Lo bits */ tga.width[0] = w & 0xFF; /* Hi bits */ tga.width[1] = (w >> 8) & 0xFF; tga.height[0] = h & 0xFF; tga.height[1] = (h >> 8) & 0xFF; tga.pixel_size = 24; tga.image_desc = 0; /* Output header */ fwrite(&tga, sizeof(TGAheader), 1, out); /* Output image */ fwrite(img, sizeof(unsigned char), w * h * 3, out); fclose(out); return (1); } void swapPixels (PPMimage *pixels) { GLubyte *row; int i, bits; bits = 3 * pixels->sizeX; row = (GLubyte *)malloc(bits * sizeof(GLubyte)); if (!row) return; /* exchange rows */ for (i = 0; i < pixels->sizeY / 2; i++) { int k, ck; k = 3 * i * pixels->sizeX; ck = 3 * (pixels->sizeY - i - 1) * pixels->sizeX; memcpy(row, &pixels->data[k], bits); memcpy(&pixels->data[k], &pixels->data[ck], bits); memcpy(&pixels->data[ck], row, bits); } free(row); } int imgHard (pScene sc, char *data, char key) { PPMimage *pixels; GLint viewport[4]; pPersp p; int xx0, yy0, ww, hh; pixels = (PPMimage *)M_malloc(sizeof(PPMimage), "imgHard"); if (!pixels) { fprintf(stderr, " ## UNABLE TO ALLOCATE MEMORY FOR IMAGE.\n"); return (0); } p = sc->persp; if (abs(p->rubfx - p->rubix) > 0) { ww = abs(p->rubfx - p->rubix) - 2; hh = abs(p->rubfy - p->rubiy) - 2; xx0 = min(p->rubix, p->rubfx) + 1; yy0 = min(p->rubiy, p->rubfy) + 1; } else { glGetIntegerv(GL_VIEWPORT, viewport); ww = viewport[2]; hh = viewport[3]; xx0 = 0; yy0 = 0; } /* align to 8 bytes */ ww = ww & ~7; hh = hh & ~7; pixels->sizeX = (short)ww; pixels->sizeY = (short)hh; pixels->data = (ubyte *)M_calloc(3 * ww * hh, sizeof(ubyte), "imgHard.data"); if (!pixels->data) { fprintf(stderr, " ## Not enough memory to save image.\n"); M_free(pixels); return (0); } if (ddebug) fprintf(stdout, "size %d x %d\n", ww, hh); glFinish(); if (saveimg) glReadBuffer(GL_BACK_LEFT); else glReadBuffer(GL_FRONT); glPixelStorei(GL_PACK_ALIGNMENT, 4); glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_ROWS, 0); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); glReadPixels(xx0, yy0, ww, hh, GL_RGB, GL_UNSIGNED_BYTE, pixels->data); if (glGetError() != GL_NO_ERROR) { fprintf(stderr, " ## Unable to save image\n"); M_free(pixels->data); M_free(pixels); return (0); } if (key == 'H') { swapPixels(pixels); savePPM(data, pixels, P6); } else if (key == 'T') { saveTGA(data, pixels->data, ww, hh); } M_free(pixels->data); M_free(pixels); return (1); } freefem++-3.61-1/src/medit/hash.c000644 000767 000024 00000022510 13312446271 016563 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #include #define NC 32 #define NC2 (NC * NC) #define NC3 (NC2 * NC) #define KA 31 #define KB 57 #define KC 79 static int ch[6][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {0, 3, 7, 4}}; static int idir[5] = {0, 1, 2, 0, 1}; static int idirt[7] = {0, 1, 2, 3, 0, 1, 2}; /* very sioux! (09/2002) */ int hashTetra (pMesh mesh) { pTetra pt, pt1; int k, kk, pp, l, ll, mins, mins1, maxs, maxs1, sum, sum1, iadr; int *hcode, *link, inival, hsize; char *hvoy; ubyte i, ii, i1, i2, i3; unsigned int key; /* avoid building */ if (mesh->adja) return (1); if (4 * sizeof(char) != sizeof(int)) exit(1); /* default */ if (ddebug) { fprintf(stdout, " Setting topology."); fflush(stdout); } /* memory alloc */ hcode = (int *)M_calloc(max(100, mesh->ntet + 1), sizeof(int), "hash.tetra"); link = (int *)M_calloc(4 * max(100, mesh->ntet + 1), sizeof(int), "hash.tetra"); hsize = max(100, mesh->ntet); assert(hcode); assert(link); hvoy = (char *)hcode; /* init */ inival = 2 << 30; for (k = 0; k <= mesh->ntet; k++) { hcode[k] = -inival; } /* build hash table */ for (k = 1; k <= mesh->ntet; k++) { pt = &mesh->tetra[k]; if (!pt->v[0]) continue; for (i = 0; i < 4; i++) { i1 = idirt[i + 1]; i2 = idirt[i + 2]; i3 = idirt[i + 3]; mins = min(pt->v[i1], pt->v[i2]); mins = min(mins, pt->v[i3]); maxs = max(pt->v[i1], pt->v[i2]); maxs = max(maxs, pt->v[i3]); /* compute key */ sum = pt->v[i1] + pt->v[i2] + pt->v[i3]; key = KA * mins + KB * maxs + KC * sum; key = key % hsize + 1; /* insert */ iadr = 4 * (k - 1) + i + 1; link[iadr] = hcode[key]; hcode[key] = -iadr; } } if (ddebug) { fprintf(stdout, "."); fflush(stdout); } /* set adjacency */ for (l = 4 * mesh->ntet; l > 0; l--) { if (link[l] >= 0) continue; k = (l - 1) / 4 + 1; i = (l - 1) % 4; i1 = idirt[i + 1]; i2 = idirt[i + 2]; i3 = idirt[i + 3]; pt = &mesh->tetra[k]; sum = pt->v[i1] + pt->v[i2] + pt->v[i3]; mins = min(pt->v[i1], pt->v[i2]); mins = min(mins, pt->v[i3]); maxs = max(pt->v[i1], pt->v[i2]); maxs = max(maxs, pt->v[i3]); /* accross link */ ll = -link[l]; pp = 0; link[l] = 0; hvoy[l] = 0; while (ll != inival) { kk = (ll - 1) / 4 + 1; ii = (ll - 1) % 4; i1 = idirt[ii + 1]; i2 = idirt[ii + 2]; i3 = idirt[ii + 3]; pt1 = &mesh->tetra[kk]; sum1 = pt1->v[i1] + pt1->v[i2] + pt1->v[i3]; if (sum1 == sum) { mins1 = min(pt1->v[i1], pt1->v[i2]); mins1 = min(mins1, pt1->v[i3]); if (mins1 == mins) { maxs1 = max(pt1->v[i1], pt1->v[i2]); maxs1 = max(maxs1, pt1->v[i3]); if (maxs1 == maxs) { /* adjacent found */ if (pp != 0) link[pp] = link[ll]; link[l] = kk; hvoy[l] = ii; link[ll] = k; hvoy[ll] = i; break; } } } pp = ll; ll = -link[ll]; } } mesh->adja = (int *)link; mesh->voy = (ubyte *)hcode; if (ddebug) fprintf(stdout, "..\n"); return (1); } /* very sioux! (09/2002) */ int hashHexa (pMesh mesh) { pHexa ph, ph1; int k, kk, iadr, pp, l, ll, v; int imin, mins, mins1, opps, opps1; int *hcode, *link, inival, hsize; char *hvoy; ubyte i, i1, ii; unsigned int key; /* avoid building again! */ if (mesh->adja) return (1); if (4 * sizeof(char) != sizeof(int)) exit(1); /* default */ if (ddebug) { fprintf(stdout, " Setting topology."); fflush(stdout); } /* memory alloc */ /* bug fixe: 17/04/2007 * hcode = (int*)M_calloc(max(11,mesh->nhex+1),sizeof(int),"hash.hexa"); * link = (int*)M_calloc(6*max(11,mesh->nhex+1),sizeof(int),"hash.hexa"); * hsize = max(10,mesh->nhex); * if ( !hcode || !link ) { * myerror.coderr = 1000; * return(0); * } * hvoy = (char*)hcode; */ hcode = (int *)M_calloc(max(10, 6 * mesh->nhex / 4 + 1), sizeof(int), "hash.hexa"); assert(hcode); link = (int *)M_calloc(max(10, 6 * mesh->nhex + 1), sizeof(int), "hash.hexa"); assert(link); hsize = max(2, mesh->nhex); hvoy = (char *)hcode; /* init */ inival = 2 << 30; for (k = 0; k <= 6 * mesh->nhex / 4; k++) { hcode[k] = -inival; } /* build hash table */ for (k = 1; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; if (!ph->v[0]) continue; for (i = 0; i < 6; i++) { mins = ph->v[ch[i][0]]; imin = 0; for (v = 1; v < 4; v++) { if (ph->v[ch[i][v]] < mins) { mins = ph->v[ch[i][v]]; imin = v; } } i1 = (imin + 2) % 4; opps = ph->v[ch[i][i1]]; /* compute key */ key = KA * mins + KB * opps; key = key % hsize + 1; /* insert */ iadr = 6 * (k - 1) + i + 1; link[iadr] = hcode[key]; hcode[key] = -iadr; } } if (ddebug) { fprintf(stdout, "."); fflush(stdout); } /* set adjacency */ for (l = 6 * mesh->nhex; l > 0; l--) { if (link[l] >= 0) continue; k = (l - 1) / 6 + 1; i = (l - 1) % 6; ph = &mesh->hexa[k]; mins = ph->v[ch[i][0]]; imin = 0; for (v = 1; v < 4; v++) { if (ph->v[ch[i][v]] < mins) { mins = ph->v[ch[i][v]]; imin = v; } } i1 = (imin + 2) % 4; opps = ph->v[ch[i][i1]]; /* accross link */ ll = -link[l]; pp = 0; link[l] = 0; hvoy[l] = 0; while (ll != inival) { kk = (ll - 1) / 6 + 1; ii = (ll - 1) % 6; ph1 = &mesh->hexa[kk]; mins1 = ph1->v[ch[ii][0]]; imin = 0; for (v = 1; v < 4; v++) { if (ph1->v[ch[ii][v]] < mins1) { mins1 = ph1->v[ch[ii][v]]; imin = v; } } i1 = (imin + 2) % 4; opps1 = ph1->v[ch[ii][i1]]; /* adjacent found */ if (mins1 == mins && opps1 == opps) { if (pp != 0) link[pp] = link[ll]; link[l] = kk; hvoy[l] = ii; link[ll] = k; hvoy[ll] = i; break; } pp = ll; ll = -link[ll]; } } mesh->adja = (int *)link; mesh->voy = (ubyte *)hcode; if (ddebug) fprintf(stdout, "..\n"); return (1); } /* very sioux! (09/2002) */ int hashTria (pMesh mesh) { pTriangle pt, pt1; int k, kk, l, ll, mins, maxs, mins1, maxs1, hsize; int *hcode, *link, inival, iadr, pp; char *hvoy; ubyte i, i1, i2, ii; unsigned int key; /* avoid building again! */ if (mesh->adja) return (1); if (4 * sizeof(char) != sizeof(int)) exit(1); /* default */ if (ddebug) { fprintf(stdout, " Setting topology."); fflush(stdout); } /* memory alloc */ hcode = (int *)M_calloc(max(1, 3 * mesh->nt / 4) + 1, sizeof(int), "hash.tria"); link = (int *)M_calloc(3 * mesh->nt + 1, sizeof(int), "hash.tria"); hsize = max(2, 3 * mesh->nt / 4 - 1); assert(hcode); assert(link); hvoy = (char *)hcode; /* init */ inival = 2 << 30; for (k = 0; k <= 3 * mesh->nt / 4; k++) { hcode[k] = -inival; } /* build hash table */ for (k = 1; k <= mesh->nt; k++) { pt = &mesh->tria[k]; if (!pt->v[0]) continue; for (i = 0; i < 3; i++) { i1 = idir[i + 1]; i2 = idir[i + 2]; mins = min(pt->v[i1], pt->v[i2]); maxs = max(pt->v[i1], pt->v[i2]); /* compute key */ key = KA * mins + KB * maxs; key = key % hsize + 1; /* insert */ iadr = 3 * (k - 1) + i + 1; link[iadr] = hcode[key]; hcode[key] = -iadr; } } if (ddebug) { fprintf(stdout, "."); fflush(stdout); } /* set adjacency */ for (l = 3 * mesh->nt; l > 0; l--) { if (link[l] >= 0) continue; k = (l - 1) / 3 + 1; i = (l - 1) % 3; i1 = idir[i + 1]; i2 = idir[i + 2]; pt = &mesh->tria[k]; mins = min(pt->v[i1], pt->v[i2]); maxs = max(pt->v[i1], pt->v[i2]); /* accross link */ ll = -link[l]; pp = 0; link[l] = 0; hvoy[l] = 0; while (ll != inival) { kk = (ll - 1) / 3 + 1; ii = (ll - 1) % 3; i1 = idir[ii + 1]; i2 = idir[ii + 2]; pt1 = &mesh->tria[kk]; mins1 = min(pt1->v[i1], pt1->v[i2]); maxs1 = max(pt1->v[i1], pt1->v[i2]); /* adjacent found */ if (mins1 == mins && maxs1 == maxs) { if (pp != 0) link[pp] = link[ll]; link[l] = kk; hvoy[l] = ii; link[ll] = k; hvoy[ll] = i; break; } pp = ll; ll = -link[ll]; } } mesh->adja = (int *)link; mesh->voy = (ubyte *)hcode; if (ddebug) fprintf(stdout, ".\n"); return (1); } freefem++-3.61-1/src/medit/eigenv.h000644 000767 000024 00000003047 13312446271 017126 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ int eigenv (int symmat, double *mat, double lambda[3], double v[3][3]); int eigen2 (double *mm, double *lambda, double vp[2][2]); freefem++-3.61-1/src/medit/listnum.c000644 000767 000024 00000010247 13312446271 017337 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" void updatePoints (pScene sc, pMesh mesh, int refmat) { pPoint ppt; pTriangle pt; pQuad pq; pTetra ptet; pHexa ph; pMaterial pm; int i, k, m; /* mark all points */ for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; ppt->tag = M_UNUSED; } /* unmark points */ for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; if (pm->flag) continue; /*triangles */ k = pm->depmat[LTria]; while (k > 0) { pt = &mesh->tria[k]; if (pt->v[0]) { for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; ppt->tag &= ~M_UNUSED; } } k = pt->nxt; } /* quads */ k = pm->depmat[LQuad]; while (k > 0) { pq = &mesh->quad[k]; if (pq->v[0]) { for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; ppt->tag &= ~M_UNUSED; } } k = pq->nxt; } /* tetras */ k = pm->depmat[LTets]; while (k > 0) { ptet = &mesh->tetra[k]; if (ptet->v[0]) { for (i = 0; i < 4; i++) { ppt = &mesh->point[ptet->v[i]]; ppt->tag &= ~M_UNUSED; } } k = ptet->nxt; } /* hexas */ k = pm->depmat[LHexa]; while (k > 0) { ph = &mesh->hexa[k]; if (ph->v[0]) { for (i = 0; i < 8; i++) { ppt = &mesh->point[ph->v[i]]; ppt->tag &= ~M_UNUSED; } } k = ph->nxt; } } } void listNum (pScene sc, pMesh mesh) { pMaterial pm; pPoint ppt; pTriangle pt; pQuad pq; int k, m; glDisable(GL_LIGHTING); /* point numbers */ if (sc->item & S_NUMP) { for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag == M_UNUSED) continue; if (ppt->ref) { m = matRef(sc, ppt->ref); pm = &sc->material[m]; glColor3f(pm->dif[0], pm->dif[1], pm->dif[2]); } else { glColor3fv(sc->par.line); } output3(ppt->c[0], ppt->c[1], ppt->c[2], "%d", k); } } /* facets numbers */ if (sc->item & S_NUMF) { glColor4fv(sc->par.line); for (m = 0; m < sc->par.nbmat; m++) { double cx, cy, cz; int i; pm = &sc->material[m]; if (pm->flag) continue; /*triangles */ k = pm->depmat[LTria]; while (k > 0) { pt = &mesh->tria[k]; if (pt->v[0]) { cx = cy = cz = 0.0f; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; cx += 0.333 * ppt->c[0]; cy += 0.333 * ppt->c[1]; cz += 0.333 * ppt->c[2]; } output3(cx, cy, cz, "%d", k); } k = pt->nxt; } /* quads */ k = pm->depmat[LQuad]; while (k > 0) { pq = &mesh->quad[k]; if (pq->v[0]) { cx = cy = cz = 0.0f; for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; cx += 0.25 * ppt->c[0]; cy += 0.25 * ppt->c[1]; cz += 0.25 * ppt->c[2]; } output3(cx, cy, cz, "%d", k); } k = pq->nxt; } } } } freefem++-3.61-1/src/medit/grafic.h000644 000767 000024 00000013751 13312446271 017107 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifndef _GRAFIC_H #define _GRAFIC_H #define MAX_LIST 4 #define MAXISO 5 #define C_ON (1 << 0) #define C_EDIT (1 << 1) #define C_VOL (1 << 2) #define C_UPDATE (1 << 3) #define C_FREEZE (1 << 4) #define C_CAP (1 << 5) #define C_REDO (1 << 6) #define C_HIDE (1 << 7) /* view modes */ #define S_BDRY (1 << 0) #define S_FILL (1 << 1) #define S_COLOR (1 << 2) #define S_MAP (1 << 3) #define S_MATERIAL (1 << 4) #define S_ALTITUDE (1 << 5) #define S_DISPL (1 << 6) #define MONO 0 #define LEFT 1 #define RIGHT 2 enum {WIRE = S_BDRY, HIDDEN = S_BDRY + S_FILL, DEPTH = S_BDRY + S_COLOR, FILL = S_FILL + S_COLOR, SHADED = S_BDRY + S_FILL + S_COLOR, SIZEMAP= S_BDRY + S_FILL + S_MAP}; enum {LTria, LQuad, LTets, LHexa, LEdges, LPoint}; enum {PERSPECTIVE, CAMERA, ORTHO}; enum {X_AXIS=0, Y_AXIS, Z_AXIS}; enum {VECTOR, CONE}; /* items */ #define S_AXIS (1 << 0) #define S_BOX (1 << 1) #define S_GRID (1 << 2) #define S_GEOM (1 << 3) #define S_ISO (1 << 4) #define S_PALETTE (1 << 5) #define S_NUMP (1 << 6) #define S_NUMF (1 << 7) /* type */ #define S_FLAT (1 << 0) /* render with facet normals */ #define S_SCISSOR (1 << 1) /* scissoring mode */ #define S_FOLLOW (1 << 2) /* picking mode */ #define S_NORMAL (1 << 3) #define S_OPPOS (1 << 4) #define S_DECO (1 << 5) #define S_PATH (1 << 6) #define S_RESET (1 << 7) /* iso-values */ #define MAX_ISO 5 #define S_ISOLINE (1 << 1) #define S_ISOSURF (1 << 2) #define S_STREAML (1 << 3) #define S_STREAMR (1 << 4) #define S_VECTOR (1 << 5) #define S_CRITP (1 << 6) #define S_PARTICLE (1 << 7) typedef struct sperspective { float fovy, depth; float matrix[16], alpha, gamma; int rubix, rubfx, rubiy, rubfy; ubyte pmode, rubber; } Persp; typedef Persp *pPersp; typedef struct triangle { float a[3], b[3], c[3]; float va, vb, vc; float na[3], nb[3], nc[3]; } triangle; typedef struct material { float amb[4], emi[4], dif[4], spe[4], shininess; float ext[6]; GLint list; int depmat[MAX_LIST]; int ref, sort; char name[128]; ubyte flag; } Material; typedef Material *pMaterial; typedef struct _cell { int id; int x, y; float min, max; float value; float step; char *info; char *format; } cell; typedef struct transform { float pos[3]; /* current mouse position */ float angle, axis[3]; /* rotation angle + axis */ float panx, pany, opanx, opany; /* screen translation */ float matrix[16], oldmat[16]; /* transformation matrix */ float rot[16], tra[16]; int mstate, mbutton, manim; } Transform; typedef Transform *pTransform; typedef struct cube { pTransform cubetr; float cmi[3], cma[3]; ubyte active; } Cube; typedef Cube *pCube; typedef struct clip { pTransform cliptr; double eqn[4]; ubyte active; } Clip; typedef Clip *pClip; typedef struct camera { GLfloat eye[3]; /* Position of the camera */ GLfloat speed[3], spmod, altinc; int vecup; } Camera; typedef Camera *pCamera; /* scene parameters */ typedef struct sparam { float back[4], line[4], edge[4], sunpos[4], clip[6]; float cm, dpi, coeff, cumtim, cumpertime, maxtime, pertime, dt; float eyesep, linewidth, pointsize; short xi, yi, xs, ys; int nbmat; char pscolor[10]; ubyte sunp, linc, advtim, nbpart; } Param; /* trajectoire */ typedef struct straj { int np; float *pt; float *tg; float sec; GLuint tlist; } Trajet; /* streamlines */ typedef struct sstream { double size, norm; float xmin, xmax, ymin, ymax, zmin, zmax; float *listp; float stpt[4][3], stcol[4]; int stnp, stiso[4]; short nbstl; ubyte typtrack; } Stream; typedef Stream *pStream; typedef struct strgrd { pTransform strtr; GLuint grid; ubyte active; } Strgrd; typedef Strgrd *pStrgrd; typedef struct siso { float val[MAXISO + 2]; float col[MAXISO + 2]; ubyte palette, ptyp; } Iso; typedef struct scene { pTransform view; pClip clip; pCube cube; pPersp persp; pCamera camera; pMaterial material; pStream stream; /*pStrgrd stg;*/ Param par; Trajet path; Iso iso; float dmin, dmax; /* scene size */ float shrink; /* shrink value */ float cx, cy, cz; /* center of scene */ GLuint dlist[MAX_LIST]; /* display lists */ GLuint mlist[MAX_LIST]; /* metric lists */ GLuint ilist[MAX_LIST]; /* iso-surfaces */ GLuint clist[MAX_LIST]; GLuint cmlist[MAX_LIST];/* clipped elts */ GLuint vlist[MAX_LIST]; /* vector list */ GLuint *slist, cplist; /* streamlines */ GLuint glist, nlist;/* geometry lists */ GLuint grid; GLuint picklist; int *matsort; short idwin, idmesh;/* window, mesh id */ short master, slave; ubyte item; /* display items */ ubyte mode; /* render mode */ ubyte type; ubyte isotyp; ubyte picked; } Scene; typedef Scene *pScene; #endif freefem++-3.61-1/src/medit/Makefile.am000644 000767 000024 00000003046 13312446271 017533 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- CXXLD=$(STATICTOOL) $(CXX) bin_PROGRAMS=$(MEDITPROG) EXTRA_DIST=picking.c EXTRA_PROGRAMS=ffmedit ffmedit_SOURCES=animat.c cube.c image.c listnum.c mouse.c persp.c stream.c zaldy2.c bbfile.c dlists.c inmsh2.c \ material.c normal.c tiles.c camera.c ellipse.c inout.c medit.c param.c psfile.c transform.c cenrad.c geometry.c \ inout_morice.c menus.c parsar.c scene.c util.c clip.c gisfil.c inout_popenbinaire.c mesh.c parsop.c scissor.c vector.c \ clipvol.c hash.c items.c mlists.c particle.c sftcpy.c view.c critip.c ilists.c keyboard.c morphing.c path.c status.c \ zaldy1.c chrono.h extern.h image.h mesh.h eigenv.h grafic.h medit.h sproto.h LDADD=picking.$(OBJEXT) ../libMesh/libMesh.a $(LIBSGLUT) -lm AM_CPPFLAGS=-I$(srcdir)/../libMesh BUILT_SOURCES=compil.date compil.date: $(ffmedit_SOURCES) echo "#define COMPIL " '"' `date` '(with ff++ $(VERSION))''"' > compil.date #.PHONY: compil.date # ALH - during a parallel make, we should make sure that picking.o is not used before being made by a different # thread. If I understand things correctly, picking.c should not be compiled with the regular CFLAGS options. ffmedit_DEPENDENCIES=picking.$(OBJEXT) picking.$(OBJEXT):picking.c ${CC} -c $< $(CNOFLAGS) -o $@ #pinking.no-optffmedit$(EXEEXT):picking.c # rm picking.$(OBJEXT) # $(MAKE) picking.o $(MEDITPROG) CFLAGS="$(CNOFLAGS)" # touch pinking.no-optffmedit$(EXEEXT) #pinking.no-opt:picking.c # touch pinking.no-opt #clean-local: # -rm pinking.no-opt pinking.no-optffmedit$(EXEEXT) freefem++-3.61-1/src/medit/picking.c000644 000767 000024 00000064737 13312446271 017305 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" typedef struct color { GLuint rMask, gMask, bMask, aMask; int rShift, gShift, bShift; int rBits, gBits, bBits, aBits; } Color; int refmat = -1, reftype = -1, refitem = 0, numel = 0, refval = 0; static int ch[6][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {0, 3, 7, 4}}; static int ct[4][3] = {{0, 1, 2}, {0, 3, 1}, {1, 3, 2}, {0, 2, 3}}; extern int refpick; static void drawTria (pScene sc, pMesh mesh, int k) { pMaterial pm; pTriangle pt; pPoint p0, p1, p2; double ax, ay, az, bx, by, bz, dd; float shrink, cx, cy, cz, n[3]; /* default */ if (ddebug) printf("draw triangle %d\n", k); if (k < 1 || k > mesh->nt) return; pt = &mesh->tria[k]; if (refpick > 0) pt->ref = refpick; refmat = matRef(sc, pt->ref); p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; pm = &sc->material[refmat]; cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.; shrink = 0.95 * sc->shrink; glBegin(GL_TRIANGLES); glColor3f(1.0 - pm->dif[0], 1.0 - pm->dif[1], 1.0 - pm->dif[2]); /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } glNormal3fv(n); glVertex3f(shrink * (p0->c[0] - cx) + cx, shrink * (p0->c[1] - cy) + cy, shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p1->c[0] - cx) + cx, shrink * (p1->c[1] - cy) + cy, shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p2->c[0] - cx) + cx, shrink * (p2->c[1] - cy) + cy, shrink * (p2->c[2] - cz) + cz); glEnd(); glColor3f(1.0 - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); output3(p0->c[0], p0->c[1], p0->c[2], "%d", pt->v[0]); output3(p1->c[0], p1->c[1], p1->c[2], "%d", pt->v[1]); output3(p2->c[0], p2->c[1], p2->c[2], "%d", pt->v[2]); } static void drawQuad (pScene sc, pMesh mesh, int k) { pMaterial pm; pQuad pq; pPoint p0, p1, p2, p3; double ax, ay, az, bx, by, bz, dd; float shrink, cx, cy, cz, n[3]; /* default */ if (ddebug) printf("draw quad %d\n", k); if (k < 1 || k > mesh->nq) return; pq = &mesh->quad[k]; if (refpick > 0) pq->ref = refpick; refmat = matRef(sc, pq->ref); p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; pm = &sc->material[refmat]; cx = (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]) / 4.; cy = (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]) / 4.; cz = (p0->c[2] + p1->c[2] + p2->c[2] + p3->c[2]) / 4.; shrink = 0.95 * sc->shrink; glBegin(GL_QUADS); glColor3f(1.0 - pm->dif[0], 1.0 - pm->dif[1], 1.0 - pm->dif[2]); /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0f) { dd = 1.0f / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } glNormal3fv(n); glVertex3f(shrink * (p0->c[0] - cx) + cx, shrink * (p0->c[1] - cy) + cy, shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p1->c[0] - cx) + cx, shrink * (p1->c[1] - cy) + cy, shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p2->c[0] - cx) + cx, shrink * (p2->c[1] - cy) + cy, shrink * (p2->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p3->c[0] - cx) + cx, shrink * (p3->c[1] - cy) + cy, shrink * (p3->c[2] - cz) + cz); glEnd(); /* display vertex number */ glColor3f(1.0 - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); output3(p0->c[0], p0->c[1], p0->c[2], "%d", pq->v[0]); output3(p1->c[0], p1->c[1], p1->c[2], "%d", pq->v[1]); output3(p2->c[0], p2->c[1], p2->c[2], "%d", pq->v[2]); output3(p3->c[0], p3->c[1], p3->c[2], "%d", pq->v[3]); } static void drawTets (pScene sc, pMesh mesh, int k) { pMaterial pm; pTetra pt; pPoint p0, p1, p2, p3; float n[3]; float shrink; int l; /* default */ if (ddebug) printf("draw tetra %d\n", k); if (k < 1 || k > mesh->ntet) return; pt = &mesh->tetra[k]; if (refpick > 0) pt->ref = refpick; refmat = matRef(sc, pt->ref); pm = &sc->material[refmat]; shrink = 0.95 * sc->shrink; glBegin(GL_TRIANGLES); glColor3f(1.0 - pm->dif[0], 1.0 - pm->dif[1], 1.0 - pm->dif[2]); for (l = 0; l < 4; l++) { float ax, ay, az, bx, by, bz, d; float cx, cy, cz; p0 = &mesh->point[pt->v[ct[l][0]]]; p1 = &mesh->point[pt->v[ct[l][1]]]; p2 = &mesh->point[pt->v[ct[l][2]]]; cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(shrink * (p0->c[0] - cx) + cx, shrink * (p0->c[1] - cy) + cy, shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p1->c[0] - cx) + cx, shrink * (p1->c[1] - cy) + cy, shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p2->c[0] - cx) + cx, shrink * (p2->c[1] - cy) + cy, shrink * (p2->c[2] - cz) + cz); } glEnd(); /* display vertex number */ p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; p3 = &mesh->point[pt->v[3]]; glColor3f(1.0 - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); output3(p0->c[0], p0->c[1], p0->c[2], "%d", pt->v[0]); output3(p1->c[0], p1->c[1], p1->c[2], "%d", pt->v[1]); output3(p2->c[0], p2->c[1], p2->c[2], "%d", pt->v[2]); output3(p3->c[0], p3->c[1], p3->c[2], "%d", pt->v[3]); /*if ( mesh->nfield == 6 ) drawEllipse(sc,mesh,LTets,k);*/ if (!mesh->nbb) circumSphere(sc, mesh, LTets, k); } static void drawHexa (pScene sc, pMesh mesh, int k) { pMaterial pm; pHexa ph; pPoint p0; float n[3]; /*float shrink; */ int l; /* default */ if (ddebug) printf("draw hexa %d\n", k); if (k < 1 || k > mesh->nhex) return; ph = &mesh->hexa[k]; if (refpick > 0) ph->ref = refpick; refmat = matRef(sc, ph->ref); pm = &sc->material[refmat]; /*shrink = 0.95 * sc->shrink;*/ glBegin(GL_QUADS); glColor3f(1.0 - pm->dif[0], 1.0 - pm->dif[1], 1.0 - pm->dif[2]); for (l = 0; l < 6; l++) { pPoint p1, p2, p3; float ax, ay, az, bx, by, bz, d; float cx, cy, cz; p0 = &mesh->point[ph->v[ch[l][0]]]; p1 = &mesh->point[ph->v[ch[l][1]]]; p2 = &mesh->point[ph->v[ch[l][2]]]; p3 = &mesh->point[ph->v[ch[l][3]]]; cx = (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]) / 4.; cy = (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]) / 4.; cz = (p0->c[2] + p1->c[2] + p2->c[2] + p3->c[2]) / 4.; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(sc->shrink * (p0->c[0] - cx) + cx, sc->shrink * (p0->c[1] - cy) + cy, sc->shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(sc->shrink * (p1->c[0] - cx) + cx, sc->shrink * (p1->c[1] - cy) + cy, sc->shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(sc->shrink * (p2->c[0] - cx) + cx, sc->shrink * (p2->c[1] - cy) + cy, sc->shrink * (p2->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(sc->shrink * (p3->c[0] - cx) + cx, sc->shrink * (p3->c[1] - cy) + cy, sc->shrink * (p3->c[2] - cz) + cz); } glEnd(); /* display vertex number */ glColor3f(1.0 - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); for (l = 0; l < 8; l++) { p0 = &mesh->point[ph->v[l]]; output3(p0->c[0], p0->c[1], p0->c[2], "%d", ph->v[l]); } } static void drawPoint (pScene sc, pMesh mesh, int k) { pPoint pt; pt = &mesh->point[k]; /*glDisable(GL_DEPTH_TEST);*/ glDisable(GL_LIGHTING); glPointSize(6.0); glColor3f(1.0, 0., 0.); glBegin(GL_POINTS); glVertex3f(pt->c[0], pt->c[1], pt->c[2]); glEnd(); output3(pt->c[0], pt->c[1], pt->c[2], "%d", refitem); glEnable(GL_LIGHTING); /*glEnable(GL_DEPTH_TEST);*/ } static void infoData (pScene sc, pMesh mesh, int k, int typel) { pSolution ps; if (!mesh->nbb) return; ps = &mesh->sol[k]; if (mesh->nfield == 1) { fprintf(stdout, " Data (scalar): %f\n", ps->bb); } else if (mesh->nfield == mesh->dim) { fprintf(stdout, " Data (vector): %f %f", ps->m[0], ps->m[1]); if (mesh->dim == 3) fprintf(stdout, " %f", ps->m[2]); fprintf(stdout, "\n"); } else if (mesh->dim == 2 && mesh->nfield == 3) { fprintf(stdout, " Data (tensor): %f %f %f\n", ps->m[0], ps->m[1], ps->m[2]); drawEllipse(sc, mesh, typel, k); } else if (mesh->dim == 3 && mesh->nfield == 6) { if (mesh->ne) fprintf(stdout, " Data (tensor): %f %f %f %f %f %f\n", ps->m[0], ps->m[1], ps->m[2], ps->m[3], ps->m[4], ps->m[5]); drawEllipsoid(sc, mesh, typel, k); } fflush(stdout); /* add J. Morice 12/2008 */ } static void infoEntity (pScene sc, pMesh mesh, int k, int type) { pMaterial pm; pTriangle pt; pTetra ptt; pHexa ph; pQuad pq; pPoint p0; int i; if (mesh->ne) fprintf(stdout, "\n Picking result :\n"); pm = &sc->material[refmat]; switch (type) { case LPoint: p0 = &mesh->point[k]; if (mesh->ne) fprintf(stdout, " Vertex %5d : %f, %f, %f ref : %d\n", k, p0->c[0] + mesh->xtra, p0->c[1] + mesh->ytra, p0->c[2] + mesh->ztra, p0->ref); if (mesh->nbb && mesh->typage == 2) infoData(sc, mesh, k, LPoint); break; case LTria: pt = &mesh->tria[k]; fprintf(stdout, " Triangle %5d : %d, %d, %d ref : %d [%s]\n", k, pt->v[0], pt->v[1], pt->v[2], pt->ref, pm->name); if (mesh->nbb && mesh->typage == 1) infoData(sc, mesh, k, LTria); for (i = 0; i < 3; i++) { p0 = &mesh->point[pt->v[i]]; fprintf(stdout, " vertex %5d : %f %f %f ref %d\n", pt->v[i], p0->c[0] + mesh->xtra, p0->c[1] + mesh->ytra, p0->c[2] + mesh->ztra, p0->ref); if (mesh->nbb && mesh->typage == 2) infoData(sc, mesh, pt->v[i], LPoint); } break; case LQuad: pq = &mesh->quad[k]; fprintf(stdout, " Quad %5d : %d, %d, %d, %d ref : %d [%s]\n", k, pq->v[0], pq->v[1], pq->v[2], pq->v[3], pq->ref, pm->name); if (mesh->nbb && mesh->typage == 1) infoData(sc, mesh, k, LQuad); for (i = 0; i < 4; i++) { p0 = &mesh->point[pq->v[i]]; fprintf(stdout, " vertex %5d : %f %f %f ref %d\n", pq->v[i], p0->c[0] + mesh->xtra, p0->c[1] + mesh->ytra, p0->c[2] + mesh->ztra, p0->ref); if (mesh->nbb && mesh->typage == 2) infoData(sc, mesh, pq->v[i], LPoint); } break; case LTets: ptt = &mesh->tetra[k]; fprintf(stdout, " Tetra %5d : %d, %d, %d, %d ref : %d [%s]\n", k, ptt->v[0], ptt->v[1], ptt->v[2], ptt->v[3], ptt->ref, pm->name); if (mesh->nbb && mesh->typage == 1) infoData(sc, mesh, k, LTets); for (i = 0; i < 4; i++) { p0 = &mesh->point[ptt->v[i]]; fprintf(stdout, " vertex %5d : %f %f %f ref %d\n", ptt->v[i], p0->c[0] + mesh->xtra, p0->c[1] + mesh->ytra, p0->c[2] + mesh->ztra, p0->ref); if (mesh->nbb && mesh->typage == 2) infoData(sc, mesh, ptt->v[i], LPoint); } break; case LHexa: ph = &mesh->hexa[k]; fprintf(stdout, " Hexa %5d : %d, %d, %d, %d, %d, %d, %d, %d ref : %d [%s]\n", k, ph->v[0], ph->v[1], ph->v[2], ph->v[3], ph->v[4], ph->v[5], ph->v[6], ph->v[7], ph->ref, pm->name); if (mesh->nbb && mesh->typage == 1) infoData(sc, mesh, k, LHexa); for (i = 0; i < 8; i++) { p0 = &mesh->point[ph->v[i]]; fprintf(stdout, " vertex %5d : %f %f %f ref %d\n", ph->v[i], p0->c[0] + mesh->xtra, p0->c[1] + mesh->ytra, p0->c[2] + mesh->ztra, p0->ref); if (mesh->nbb && mesh->typage == 2) infoData(sc, mesh, ph->v[i], LPoint); } break; } fflush(stdout); /* add J. Morice 12/2008 */ } static int getColorRange (Color *c, pMesh mesh) { GLubyte mask; GLint rBits, gBits, bBits, aBits; int i, nbits; glGetIntegerv(GL_RED_BITS, &rBits); glGetIntegerv(GL_GREEN_BITS, &gBits); glGetIntegerv(GL_BLUE_BITS, &bBits); glGetIntegerv(GL_ALPHA_BITS, &aBits); nbits = rBits + gBits + bBits + aBits; if (nbits < 32) { long nbmax; nbmax = 2 << (nbits - 1); if (nbmax < mesh->nt + mesh->nq + mesh->ntet + mesh->nhex) { fprintf(stderr, " Sorry. Picking disabled. (%ld,%d)\n", nbmax, mesh->nt + mesh->nq); return (0); } else if (nbmax < 0.1 * (mesh->ntet + mesh->nhex)) { fprintf(stderr, " Sorry. Picking disabled. (%ld,%d)\n", nbmax, mesh->nt + mesh->nq); return (0); } } mask = 0; nbits = nbits - rBits; for (i = 0; i < rBits; i++) { mask |= 1 << i; } c->rMask = mask << nbits; c->rShift = nbits; c->rBits = 8 - rBits; mask = 0; nbits = nbits - gBits; for (i = 0; i < gBits; i++) { mask |= 1 << i; } c->gMask = mask << nbits; c->gShift = nbits; c->gBits = 8 - gBits; mask = 0; nbits = nbits - bBits; for (i = 0; i < bBits; i++) { mask |= 1 << i; } c->bMask = mask << aBits; c->bShift = nbits; c->bBits = 8 - bBits; mask = 0; for (i = 0; i < aBits; i++) { mask |= 1 << i; } c->aMask = mask; c->aBits = 8 - aBits; } static void displayPoint (pScene sc, pMesh mesh, Color *c) { unsigned int k; glPointSize(5); glBegin(GL_POINTS); for (k = 1; k <= mesh->np; k++) { pPoint ppt; unsigned int kk; ppt = &mesh->point[k]; kk = 2 * k + 1; glColor4ub((kk & c->rMask) >> c->rShift << c->rBits, (kk & c->gMask) >> c->gShift << c->gBits, (kk & c->bMask) >> c->bShift << c->bBits, (kk & c->aMask) << c->aBits); if (mesh->dim == 2) glVertex2dv(ppt->c); else glVertex3dv(ppt->c); } glEnd(); glPointSize(1); } static void displayTria (pScene sc, pMesh mesh, Color *c) { pTriangle pt; pPoint p0, p1, p2; int m; unsigned int kk; glBegin(GL_TRIANGLES); for (m = 0; m < sc->par.nbmat; m++) { pMaterial pm; unsigned int k; pm = &sc->material[m]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tria[k]; if (pt->v[0]) { p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; kk = 2 * k + 1; glColor4ub((kk & c->rMask) >> c->rShift << c->rBits, (kk & c->gMask) >> c->gShift << c->gBits, (kk & c->bMask) >> c->bShift << c->bBits, (kk & c->aMask) << c->aBits); glVertex3dv(p0->c); glVertex3dv(p1->c); glVertex3dv(p2->c); } k = pt->nxt; } } glEnd(); } static int displayQuad (pScene sc, pMesh mesh, Color *c) { pQuad pq; pPoint p0, p1, p2, p3; pMaterial pm; int m, base; unsigned int kk; base = mesh->nt; glBegin(GL_QUADS); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; while (k != 0) { pq = &mesh->quad[k]; if (pq->v[0]) { p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; kk = base + k; kk = 2 * kk + 1; glColor4ub((kk & c->rMask) >> c->rShift << c->rBits, (kk & c->gMask) >> c->gShift << c->gBits, (kk & c->bMask) >> c->bShift << c->bBits, (kk & c->aMask) << c->aBits); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); glVertex3f(p3->c[0], p3->c[1], p3->c[2]); } k = pq->nxt; } } glEnd(); } static int displayTets (pScene sc, pMesh mesh, Color *c) { pTetra ptt; pPoint p0, p1, p2; pMaterial pm; pClip clip; int l, m, base; unsigned int kk; clip = sc->clip; base = mesh->nt + mesh->nq; glBegin(GL_TRIANGLES); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; while (k != 0) { ptt = &mesh->tetra[k]; if (ptt->v[0]) { if ((clip->active & C_ON && ptt->clip) || !(clip->active & C_ON)) { kk = base + k; kk = 2 * kk + 1; for (l = 0; l < 4; l++) { p0 = &mesh->point[ptt->v[ct[l][0]]]; p1 = &mesh->point[ptt->v[ct[l][1]]]; p2 = &mesh->point[ptt->v[ct[l][2]]]; glColor4ub((kk & c->rMask) >> c->rShift << c->rBits, (kk & c->gMask) >> c->gShift << c->gBits, (kk & c->bMask) >> c->bShift << c->bBits, (kk & c->aMask) << c->aBits); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); } } } k = ptt->nxt; } } glEnd(); } static int displayHexa (pScene sc, pMesh mesh, Color *c) { pHexa ph; pPoint p0, p1, p2, p3; pMaterial pm; pClip clip; int l, m, base; unsigned int kk; clip = sc->clip; base = mesh->nt + mesh->nq + mesh->ntet; glBegin(GL_QUADS); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LHexa]; if (!k || pm->flag) continue; while (k != 0) { ph = &mesh->hexa[k]; if (ph->v[0]) { if ((clip->active & C_ON && ph->clip) || !(clip->active & C_ON)) { kk = base + k; kk = 2 * kk + 1; for (l = 0; l < 6; l++) { p0 = &mesh->point[ph->v[ch[l][0]]]; p1 = &mesh->point[ph->v[ch[l][1]]]; p2 = &mesh->point[ph->v[ch[l][2]]]; p3 = &mesh->point[ph->v[ch[l][3]]]; glColor4ub((kk & c->rMask) >> c->rShift << c->rBits, (kk & c->gMask) >> c->gShift << c->gBits, (kk & c->bMask) >> c->bShift << c->bBits, (kk & c->aMask) << c->aBits); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); glVertex3f(p3->c[0], p3->c[1], p3->c[2]); } } } k = ph->nxt; } } glEnd(); } void drawModelSimple (pScene sc, pMesh mesh, Color *c) { glDisable(GL_BLEND); glDisable(GL_LIGHTING); glShadeModel(GL_FLAT); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); if (sc->clip->active & C_ON) { glClipPlane(GL_CLIP_PLANE0, sc->clip->eqn); glEnable(GL_CLIP_PLANE0); if (mesh->nt) displayTria(sc, mesh, c); if (mesh->nq) displayQuad(sc, mesh, c); glDisable(GL_CLIP_PLANE0); if (sc->clip->active & C_VOL) { if (mesh->ntet) displayTets(sc, mesh, c); if (mesh->nhex) displayHexa(sc, mesh, c); } } else { if (mesh->nt) displayTria(sc, mesh, c); if (mesh->nq) displayQuad(sc, mesh, c); if (mesh->dim == 3) { if (!mesh->nt) displayTets(sc, mesh, c); if (!mesh->nq) displayHexa(sc, mesh, c); } } if (!mesh->ne) displayPoint(sc, mesh, c); glEnable(GL_LIGHTING); glShadeModel(GL_SMOOTH); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } static int closestPoint (pScene sc, pMesh mesh, int x, int y, int item, int type) { pTriangle pt; pQuad pq; pTetra pte; pHexa ph; pPoint ppt; GLdouble projmat[16], winx, winy, winz, matrix[16]; GLint viewport[4]; double dd, dmin; int i, id; glGetDoublev(GL_PROJECTION_MATRIX, projmat); glGetIntegerv(GL_VIEWPORT, viewport); glGetDoublev(GL_MODELVIEW_MATRIX, matrix); y = viewport[3] - y; id = -1; dmin = 1.e20; switch (type) { case LTria: pt = &mesh->tria[item]; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; gluProject(ppt->c[0], ppt->c[1], ppt->c[2], matrix, projmat, viewport, &winx, &winy, &winz); dd = (winx - x) * (winx - x) + (winy - y) * (winy - y); if (dd < dmin) { dmin = dd; id = i; } } return (pt->v[id]); case LQuad: pq = &mesh->quad[item]; for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; gluProject(ppt->c[0] - sc->cx, ppt->c[1] - sc->cy, ppt->c[2] - sc->cz, matrix, projmat, viewport, &winx, &winy, &winz); dd = (winx - x) * (winx - x) + (winy - y) * (winy - y); if (dd < dmin) { dmin = dd; id = i; } } return (pq->v[id]); case LTets: pte = &mesh->tetra[item]; for (i = 0; i < 4; i++) { ppt = &mesh->point[pte->v[i]]; gluProject(ppt->c[0] - sc->cx, ppt->c[1] - sc->cy, ppt->c[2] - sc->cz, matrix, projmat, viewport, &winx, &winy, &winz); dd = (winx - x) * (winx - x) + (winy - y) * (winy - y); if (dd < dmin) { dmin = dd; id = i; } } return (pte->v[id]); case LHexa: ph = &mesh->hexa[item]; for (i = 0; i < 8; i++) { ppt = &mesh->point[ph->v[i]]; gluProject(ppt->c[0] - sc->cx, ppt->c[1] - sc->cy, ppt->c[2] - sc->cz, matrix, projmat, viewport, &winx, &winy, &winz); dd = (winx - x) * (winx - x) + (winy - y) * (winy - y); if (dd < dmin) { dmin = dd; id = i; } } return (ph->v[id]); } return (0); } GLuint pickingScene (pScene sc, int x, int y, int ident) { pMesh mesh; pClip clip; GLint viewport[4]; GLubyte pixel[4]; GLuint dlist; Color c; unsigned int item; dlist = 0; refitem = 0; refmat = -1; mesh = cv.mesh[sc->idmesh]; clip = sc->clip; if (!getColorRange(&c, mesh)) return (dlist); glGetIntegerv(GL_VIEWPORT, viewport); glDrawBuffer(GL_BACK_LEFT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -sc->persp->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glMultMatrixf(sc->view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModelSimple(sc, mesh, &c); glFlush(); /* process color */ glReadBuffer(GL_BACK_LEFT); glReadPixels(x, viewport[3] - y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void *)pixel); glDrawBuffer(GL_BACK_LEFT); if (ddebug) printf("pixel %d %d %d %d\n", pixel[0], pixel[1], pixel[2], pixel[3]); item = pixel[0] >> c.rBits << c.rShift & c.rMask; item += pixel[1] >> c.gBits << c.gShift & c.gMask; item += pixel[2] >> c.bBits << c.bShift & c.bMask; item += pixel[3] >> c.aBits & c.aMask; item /= 2; if (!item) return (dlist); if (ddebug) printf("item %ud\n", item); if (!mesh->ne) { if (item <= mesh->np) { refitem = item; reftype = LPoint; } } else if (item <= mesh->nt) { refitem = item; reftype = LTria; } else if (item <= mesh->nt + mesh->nq) { refitem = item - mesh->nt; reftype = LQuad; } else if (item <= mesh->nt + mesh->nq + mesh->ntet) { refitem = item - (mesh->nt + mesh->nq); reftype = LTets; } else if (item <= mesh->nt + mesh->nq + mesh->ntet + mesh->nhex) { refitem = item - (mesh->nt + mesh->nq + mesh->ntet); reftype = LHexa; } /* peculiar case: vertex */ if (refitem > 0 && ident == LPoint) { if (mesh->ne) { refitem = closestPoint(sc, mesh, x, y, refitem, reftype); reftype = LPoint; } } if (refitem > 0) { dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); switch (reftype) { case LPoint: if (refitem <= mesh->np && !mesh->ne) { int k; for (k = 1; k <= mesh->np; k++) { /*drawPoint(sc,mesh,k);*/ infoEntity(sc, mesh, k, LPoint); } } else { drawPoint(sc, mesh, refitem); infoEntity(sc, mesh, refitem, LPoint); } break; case LTria: drawTria(sc, mesh, refitem); infoEntity(sc, mesh, refitem, LTria); break; case LQuad: drawQuad(sc, mesh, refitem); infoEntity(sc, mesh, refitem, LQuad); break; case LTets: drawTets(sc, mesh, refitem); infoEntity(sc, mesh, refitem, LTets); break; case LHexa: drawHexa(sc, mesh, refitem); infoEntity(sc, mesh, refitem, LHexa); break; } glEndList(); return (dlist); } else { refmat = -1; } return (dlist); } GLuint pickItem (pMesh mesh, pScene sc, int numit) { GLuint dlist; /* default */ if (ddebug) printf("create pickitem list\n"); dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); if (numit <= mesh->np && mesh->ne) { pMaterial pm; pPoint ppt; ppt = &mesh->point[numit]; pm = &sc->material[DEFAULT_MAT]; if (ppt->tag != M_UNUSED) { if (ppt->ref) { int nm; nm = matRef(sc, ppt->ref); /*nm = 1+(ppt->ref-1) % (sc->par.nbmat-1);*/ pm = &sc->material[nm]; } glPointSize(3.0); glColor3f(pm->dif[0], pm->dif[1], pm->dif[2]); output3(ppt->c[0], ppt->c[1], ppt->c[2], "%d", numit); } } if (numit <= mesh->nt) drawTria(sc, mesh, numit); if (numit <= mesh->nq) drawQuad(sc, mesh, numit); if (numit <= mesh->ntet) drawTets(sc, mesh, numit); if (numit <= mesh->nhex) drawHexa(sc, mesh, numit); glEndList(); return (dlist); } freefem++-3.61-1/src/medit/inmsh2.c000644 000767 000024 00000013754 13312446271 017052 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" int inmsh2 (pMesh mesh) { FILE *inp, *inf; pPoint pp0, pp1, pp2, pp3; pTriangle pt1; pQuad pq1; pEdge pr; int k, disc, degree, dum, ref, tag; char data[256], sx[128], sy[128], sz[128]; /* check for .points */ strcpy(data, mesh->name); strcat(data, ".points"); inp = fopen(data, "r"); if (!inp) return (0); /* check for .faces */ strcpy(data, mesh->name); strcat(data, ".faces"); inf = fopen(data, "r"); if (!inf) { fclose(inp); return (0); } if (!quiet) fprintf(stdout, " Reading %s.{points,.faces}\n", mesh->name); /* get number of elements */ /*fgets(data,255,inp); * sscanf(data,"%d",&mesh->np);*/ fscanf(inp, "%d", &mesh->np); EatLine(inp); /*fgets(data,255,inf); * sscanf(data,"%d",&mesh->ne);*/ fscanf(inf, "%d", &mesh->ne); EatLine(inf); if (!mesh->np) {/*|| (mesh->dim == 3 && !mesh->ne) ) {*/ fprintf(stdout, " ## No vertex.\n"); fclose(inp); fclose(inf); return (-1); } mesh->dim = 3; mesh->nt = mesh->nq = mesh->ntet = mesh->nhex = mesh->nvn = 0; /* first pass get number of faces */ for (k = 1; k <= mesh->ne; k++) { fscanf(inf, "%d", °ree); if (degree < 2 || degree > 4) { fprintf(stdout, " ## Wrong degree\n"); fclose(inp); fclose(inf); return (0); } else if (degree == 2) { mesh->na++; } else if (degree == 3) { mesh->nt++; } else if (degree == 4) { mesh->nq++; } /*fgets(data,80,inf);*/ EatLine(inf); } /* check if vertices and elements found */ if (!mesh->np) {/*|| mesh->ne == 0 ) {*/ fclose(inp); fclose(inf); return (0); } /* memory allocation for mesh */ if (zaldy1(mesh) != TRUE) { fclose(inp); fclose(inf); return (0); } /* read mesh vertices */ for (k = 1; k <= mesh->np; k++) { char *ptr; int ret; pPoint ppt; ppt = &mesh->point[k]; /* parse coordinates into strings */ ret = fscanf(inp, "%127s %127s %127s %d", sx, sy, sz, &ref); if (ret != 4) { fclose(inp); fclose(inf); return (0); } if (ptr = strpbrk(sx, "dD")) *ptr = 'E'; if (ptr = strpbrk(sy, "dD")) *ptr = 'E'; if (ptr = strpbrk(sz, "dD")) *ptr = 'E'; /* * sscanf(sx,"%f",&ppt->c[0]); * sscanf(sy,"%f",&ppt->c[1]); * sscanf(sz,"%f",&ppt->c[2]); */ ppt->c[0] = atof(sx); ppt->c[1] = atof(sy); ppt->c[2] = atof(sz); ppt->ref = ref; ppt->tag = M_UNUSED; } fclose(inp); /* allocate memory for mesh edges */ if (mesh->na > 0) { mesh->edge = (pEdge)M_calloc(mesh->na + 1, sizeof(Edge), "inmsh2.edge"); if (!mesh->edge) { fprintf(stderr, " ## WARN 0004, INMESH, %d\n", mesh->na); fclose(inf); return (1); } } /* read mesh faces */ rewind(inf); /*fgets(data,255,inf); * sscanf(data,"%d",&mesh->ne);*/ fscanf(inf, "%d", &mesh->ne); EatLine(inf); mesh->nt = 0; mesh->nq = 0; mesh->na = 0; disc = 0; for (k = 1; k <= mesh->ne; k++) { fscanf(inf, "%d", °ree); if (degree == 2) { pr = &mesh->edge[++mesh->na]; fscanf(inf, "%d %d %d %d %d\n", &pr->v[0], &pr->v[1], &tag, &dum, &dum); pr->tag = tag == 0 ? M_NOTAG : M_TAG; pp0 = &mesh->point[pr->v[0]]; pp1 = &mesh->point[pr->v[1]]; pp0->tag = M_NOTAG; pp1->tag = M_NOTAG; } else if (degree == 3) { pt1 = &mesh->tria[++mesh->nt]; fscanf(inf, "%d %d %d %d %d %d %d\n", &pt1->v[0], &pt1->v[1], &pt1->v[2], &ref, &dum, &dum, &dum); if (pt1->v[0] <= 0 || pt1->v[0] > mesh->np || pt1->v[1] <= 0 || pt1->v[1] > mesh->np || pt1->v[2] <= 0 || pt1->v[2] > mesh->np) { fprintf(stdout, " ## Wrong index\n"); disc++; pt1->v[0] = 0; continue; } pt1->ref = fabs(ref); pp0 = &mesh->point[pt1->v[0]]; pp1 = &mesh->point[pt1->v[1]]; pp2 = &mesh->point[pt1->v[2]]; pp0->tag = M_NOTAG; pp1->tag = M_NOTAG; pp2->tag = M_NOTAG; } else if (degree == 4) { pq1 = &mesh->quad[++mesh->nq]; fscanf(inf, "%d %d %d %d", &pq1->v[0], &pq1->v[1], &pq1->v[2], &pq1->v[3]); fscanf(inf, "%d %d %d %d %d", &ref, &dum, &dum, &dum, &dum); if (pq1->v[0] <= 0 || pq1->v[0] > mesh->np || pq1->v[1] <= 0 || pq1->v[1] > mesh->np || pq1->v[2] <= 0 || pq1->v[2] > mesh->np || pq1->v[3] <= 0 || pq1->v[3] > mesh->np) { fprintf(stdout, " ## Wrong index\n"); disc++; pq1->v[0] = 0; continue; } pq1->ref = fabs(ref); pp0 = &mesh->point[pq1->v[0]]; pp1 = &mesh->point[pq1->v[1]]; pp2 = &mesh->point[pq1->v[2]]; pp3 = &mesh->point[pq1->v[3]]; pp0->tag = M_NOTAG; pp1->tag = M_NOTAG; pp2->tag = M_NOTAG; pp3->tag = M_NOTAG; } } fclose(inf); if (disc > 0) fprintf(stdout, " ## %d entities discarded\n", disc); return (1); } freefem++-3.61-1/src/medit/inout_morice.c000644 000767 000024 00000111243 13312446271 020336 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "libmesh5.h" #include "extern.h" #include "string.h" static int debug = 0; void getline_number (char *nature, int *nb) { char data[256]; char *tictac; fgets(data, 256, stdin); tictac = strtok(data, " \n"); if (tictac == NULL) { printf("problem in reading the number of %s\n", nature); exit(1); } else { // printf("tictac=%s\n",tictac); *nb = atoi(tictac); if (debug) fprintf(stdout, "Number of %s %i \n", nature, *nb); } } void getline_1int (char *nature, int *nbint) { char data[256]; char *tictac; fgets(data, 256, stdin); tictac = strtok(data, " \n"); if (tictac == NULL) { printf("problem in reading the %s", nature); exit(1); } *nbint = atoi(tictac); } void getline_1intfirst (char *nature, int *nbint) { char data[256]; char *tictac; fgets(data, 256, stdin); tictac = strtok(data, " \n"); if (tictac == NULL) { fgets(data, 256, stdin); tictac = strtok(data, " \n"); } if (tictac == NULL) { printf("problem in reading the first %s", nature); exit(1); } *nbint = atoi(tictac); } void getline_popen_vertex (int ddim, double *c, int *ref) { char data[256]; char *tictac; int i; /*int lench; char keyseE [] = "eE"; char keyse [] = "e"; float res;*/ fgets(data, 256, stdin); c[0] = strtod(data, &tictac); // printf("valeur strtod c[0] %f c%sc \n",c[0], tictac); for (i = 1; i < ddim; i++) { c[i] = strtod(tictac, &tictac); // printf("valeur strtod c[i] %f c%sc \n",c[i], tictac); } /* * tictac = strtok(data," \n"); * if(tictac == NULL) * printf("problem in reading the vertices"); * * for(i=0; inp = 0; mesh->nt = 0; mesh->nq = 0; mesh->ntet = 0; mesh->nhex = 0; mesh->nc = 0; mesh->nr = 0; mesh->na = 0; mesh->nri = 0; mesh->nre = 0; mesh->nvn = 0; mesh->ntg = 0; mesh->ne = mesh->nt + mesh->nq + mesh->ntet + mesh->nhex; // int tablecture[5]; // tablecture = loopdebug = -1; while (!feof(stdin)) { char *tictac; fgets(data, 256, stdin); tictac = strtok(data, " \n"); loopdebug = loopdebug + 1; // fprintf(stdout,"%i: data %s \n",loopdebug,data); // fprintf(stdout,"%i: tictac %s \n",loopdebug,tictac); // fprintf(stdout,"%i: capture vertex %i\n",loopdebug,strcmp(tictac,"Vertices")); // fprintf(stdout,"%s\n",tictac); if (tictac == NULL) continue; if (!strncmp(tictac, "MeshVersionFormatted", 20)) { /* read mesh format */ natureread = "MeshVersionFormatted"; getline_number(natureread, &(mesh->ver)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * //fprintf(stdout,"tictac= %s\n",tictac); * if(tictac == NULL){ * printf("problem in reading the %s\n",natureread); * exit(1); * } * else{ * mesh->ver = atoi(tictac); * } * fprintf(stdout,"reading format %s %i \n",natureread,mesh->ver); */ } else if (!strncmp(tictac, "Dimension", 9)) { /* read mesh dimension */ natureread = "Dimension"; getline_number(natureread, &(mesh->dim)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * //fprintf(stdout,"tictac= %s\n",tictac); * * if(tictac == NULL){ * printf("problem in reading the %s\n",natureread); * exit(1); * } * else{ * mesh->dim = atoi(tictac); * if(debug) printf("%s %i\n",natureread,mesh->dim); * } */ /*control of the dimension*/ if ((mesh->dim != 2) && (mesh->dim != 3)) printf("the dimension is not correct"); } else if (!strncmp(tictac, "Vertices", 8)) { /* read mesh vetices */ natureread = "Vertices"; getline_number(natureread, &(mesh->np)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of %s\n",natureread); * exit(1); * } * else{ * mesh->np = atoi(tictac); * if(debug) fprintf(stdout,"Number of %s %i\n",natureread,mesh->np); * } */ /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ /* Allocation of array of vertices */ if (ddebug) printf("allocate %d points\n", mesh->np); mesh->point = (pPoint)M_calloc(mesh->np + 1, sizeof(Point), "zaldy1.point"); assert(mesh->point); /* read the first vertex */ k = 1; ppt = &mesh->point[k]; getline_popen_firstvertex(mesh->dim, ppt->c, &ref); ppt->ref = ref & 0x7fff; ppt->tag = M_UNUSED; /* read the other vertices */ for (k = 2; k <= mesh->np; k++) { ppt = &mesh->point[k]; getline_popen_vertex(mesh->dim, ppt->c, &ref); // fprintf(stdout,"sortie vertex:= %i %i \n", k, ref); ppt->ref = ref & 0x7fff; ppt->tag = M_UNUSED; } } else if (!strncmp(tictac, "Triangles", 9)) { natureread = "Triangles"; getline_number(natureread, &(mesh->nt)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of triangles"); * exit(1); * } * else{ * mesh->nt = atoi(tictac); * } */ /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ /* Allocation of array of triangles */ if (ddebug) printf("allocate %d tria\n", mesh->nt); mesh->tria = (pTriangle)M_calloc(mesh->nt + 1, sizeof(Triangle), "zaldy1.tria"); assert(mesh->tria); /* read the first triangle */ k = 1; disc = 0; pt = &mesh->tria[k]; getline_popen_firstelem(3, pt->v, &ref); pt->ref = ref & 0x7fff; for (i = 0; i < 3; i++) { if (pt->v[i] < 1 || pt->v[i] > mesh->np) { disc++; pt->v[0] = 0; break; } else { ppt = &mesh->point[pt->v[i]]; ppt->tag &= ~M_UNUSED; } } /* read mesh triangles */ for (k = 2; k <= mesh->nt; k++) { pt = &mesh->tria[k]; getline_popen_elem(3, pt->v, &ref); pt->ref = ref & 0x7fff; for (i = 0; i < 3; i++) { if (pt->v[i] < 1 || pt->v[i] > mesh->np) { disc++; pt->v[0] = 0; break; } else { ppt = &mesh->point[pt->v[i]]; ppt->tag &= ~M_UNUSED; } } } } else if (!strncmp(tictac, "Quadrilaterals", 14)) { natureread = "Quadrilaterals"; getline_number(natureread, &(mesh->nq)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of Quadrilaterals"); * exit(1); * } * else{ * mesh->nq = atoi(tictac); * } */ /****************/ /* allocation */ if (ddebug) printf("allocate %d quad\n", mesh->nq); if (mesh->nq) { mesh->quad = (pQuad)M_calloc(mesh->nq + 1, sizeof(Quad), "zaldy1.quad"); assert(mesh->quad); } k = 1; pq = &mesh->quad[k]; getline_popen_firstelem(4, pq->v, &ref); pq->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (pq->v[i] < 1 || pq->v[i] > mesh->np) { disc++; pq->v[0] = 0; break; } else { ppt = &mesh->point[pq->v[i]]; ppt->tag &= ~M_UNUSED; } } for (k = 2; k <= mesh->nq; k++) { pq = &mesh->quad[k]; getline_popen_elem(4, pq->v, &ref); pq->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (pq->v[i] < 1 || pq->v[i] > mesh->np) { disc++; pq->v[0] = 0; break; } else { ppt = &mesh->point[pq->v[i]]; ppt->tag &= ~M_UNUSED; } } } } else if (!strncmp(tictac, "Tetrahedra", 10)) { natureread = "Tetrahedra"; getline_number(natureread, &(mesh->ntet)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of Tetrahedrons"); * exit(1); * } * else{ * mesh->ntet = atoi(tictac); * } */ /******************************/ /* allocation de la memoire */ if (mesh->ntet) { if (ddebug) printf("allocate %d tetra\n", mesh->ntet); mesh->tetra = (pTetra)M_calloc(mesh->ntet + 1, sizeof(Tetra), "zaldy1.tetra"); assert(mesh->tetra); } k = 1; // printf("valeur de k%i",k); ptet = &mesh->tetra[k]; getline_popen_elem(4, ptet->v, &ref); // printf("valeur de k%i",k); ptet->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (ptet->v[i] < 1 || ptet->v[i] > mesh->np) { disc++; ptet->v[0] = 0; break; } else { ppt = &mesh->point[ptet->v[i]]; ppt->tag &= ~M_UNUSED; } } for (k = 2; k <= mesh->ntet; k++) { // printf("valeur de k%i",k); ptet = &mesh->tetra[k]; getline_popen_elem(4, ptet->v, &ref); // printf("valeur de k%i",k); ptet->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (ptet->v[i] < 1 || ptet->v[i] > mesh->np) { disc++; ptet->v[0] = 0; break; } else { ppt = &mesh->point[ptet->v[i]]; ppt->tag &= ~M_UNUSED; } } } } /* mesh hexahedra */ else if (!strncmp(tictac, "Hexahedra", 9)) { natureread = "Hexahedra"; getline_number(natureread, &(mesh->nhex)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of Hexahedrons"); * exit(1); * } * else{ * mesh->nhex = atoi(tictac); * //fprintf(stdout,"mesh->nbex %i \n",mesh->nbex); * } */ /******************************/ /* allocation de la memoire */ if (ddebug) printf("allocate %d hexa\n", mesh->nhex); mesh->hexa = (pHexa)M_calloc(mesh->nhex + 1, sizeof(Hexa), "zaldy1.hexa"); assert(mesh->hexa); k = 1; ph = &mesh->hexa[k]; getline_popen_firstelem(8, ph->v, &ref); ph->ref = ref & 0x7fff; for (i = 0; i < 8; i++) { if (ph->v[i] < 1 || ph->v[i] > mesh->np) { disc++; ph->v[0] = 0; break; } else { ppt = &mesh->point[ph->v[i]]; ppt->tag &= ~M_UNUSED; } } for (k = 2; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; getline_popen_elem(8, ph->v, &ref); ph->ref = ref & 0x7fff; for (i = 0; i < 8; i++) { if (ph->v[i] < 1 || ph->v[i] > mesh->np) { disc++; ph->v[0] = 0; break; } else { ppt = &mesh->point[ph->v[i]]; ppt->tag &= ~M_UNUSED; } } } } /* mesh corners */ else if (!strncmp(tictac, "Corners", 7)) { natureread = "Corners"; getline_number(natureread, &(mesh->nc)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of Corners"); * exit(1); * } * else{ * mesh->nc = atoi(tictac); * fprintf(stdout,"Number of corners %i \n",mesh->nc); * } */ fgets(data, 256, stdin); if (tictac == NULL) { fgets(data, 256, stdin); tictac = strtok(data, " \n"); } if (tictac == NULL) printf("problem in reading the first corner"); tictac = strtok(data, " \n"); is = atoi(tictac); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_CORNER; ppt->tag &= ~M_UNUSED; } for (k = 2; k <= mesh->nc; k++) { fgets(data, 256, stdin); tictac = strtok(data, " \n"); is = atoi(tictac); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_CORNER; ppt->tag &= ~M_UNUSED; } } } /* required vertices */ else if (!strncmp(tictac, "RequiredVertices", 12)) { natureread = "RequiredVertices"; getline_number(natureread, &(mesh->nr)); /* * fgets(data,256,stdin); * tictac = strtok(data," \n"); * if(tictac == NULL){ * printf("problem in reading the number of RequiredVertices"); * exit(1); * } * else{ * mesh->nr = atoi(tictac); * fprintf(stdout,"Number of RequiredVertices %i \n",mesh->nr); * } */ fgets(data, 256, stdin); if (tictac == NULL) { fgets(data, 256, stdin); tictac = strtok(data, " \n"); } if (tictac == NULL) printf("problem in reading the first RequiredVertex"); tictac = strtok(data, " \n"); is = atoi(tictac); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_REQUIRED; ppt->tag &= ~M_UNUSED; } for (k = 2; k <= mesh->nr; k++) { fgets(data, 256, stdin); tictac = strtok(data, " \n"); is = atoi(tictac); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_REQUIRED; ppt->tag &= ~M_UNUSED; } } } /* mesh edges */ else if (!strncmp(tictac, "Edges", 5)) { natureread = "Edges"; getline_number(natureread, &(mesh->na)); fprintf(stdout, "Number of %s %i \n", natureread, mesh->na); /************************/ /* allocation memoire */ if (ddebug) printf("allocate %d edges\n", mesh->na); mesh->edge = (pEdge)M_calloc(mesh->na + 1, sizeof(Edge), "zaldy1.edge"); assert(mesh->edge); k = 1; getline_popen_firstedge(&ia, &ib, &ref); if (ia < 1 || ia > mesh->np || ib < 1 || ib > mesh->np) { disc++; } else { pr = &mesh->edge[k]; pr->v[0] = ia; pr->v[1] = ib; pr->ref = ref & 0x7fff; pr->tag = !pr->ref ? M_NOTAG : M_TAG; ppt = &mesh->point[ia]; ppt->tag &= ~M_UNUSED; ppt = &mesh->point[ib]; ppt->tag &= ~M_UNUSED; } for (k = 2; k <= mesh->na; k++) { getline_popen_edge(&ia, &ib, &ref); if (ia < 1 || ia > mesh->np || ib < 1 || ib > mesh->np) { disc++; } else { pr = &mesh->edge[k]; pr->v[0] = ia; pr->v[1] = ib; pr->ref = ref & 0x7fff; pr->tag = !pr->ref ? M_NOTAG : M_TAG; ppt = &mesh->point[ia]; ppt->tag &= ~M_UNUSED; ppt = &mesh->point[ib]; ppt->tag &= ~M_UNUSED; } } } /* mesh ridges */ else if (!strcmp(tictac, "Ridges")) { natureread = "Ridges"; getline_number(natureread, &(mesh->nri)); getline_1intfirst(natureread, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_RIDGE; } for (k = 2; k <= mesh->nri; k++) { getline_1int(natureread, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_RIDGE; } } } /* required edges */ else if (!strncmp(tictac, "RequiredEdges", 13)) { natureread = "RequiredEdges"; getline_number(natureread, &(mesh->nre)); getline_1intfirst(natureread, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_REQUIRED; } for (k = 2; k <= mesh->nre; k++) { getline_1int(natureread, &is); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_REQUIRED; } } } /* mesh normals */ else if (!strncmp(tictac, "Normals", 7)) { natureread = "Normals"; getline_number(natureread, &(mesh->nvn)); /*****************/ /* allocation */ if (!mesh->ntg) { mesh->extra = (pExtra)M_calloc(1, sizeof(Extra), "zaldy1.extra"); assert(mesh->extra); } mesh->extra->n = (float *)M_calloc(3 * mesh->nvn + 1, sizeof(float), "inmesh"); assert(mesh->extra->n); k = 1; n = &mesh->extra->n[3 * (k - 1) + 1]; getline_popen_firstdouble(natureread, 3, dn); n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } for (k = 2; k <= mesh->nvn; k++) { n = &mesh->extra->n[3 * (k - 1) + 1]; getline_popen_double(natureread, 3, dn);// modif FH n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } } else if (!strncmp(tictac, "NormalAtVertices", 16)) { natureread = "NormalAtVertices"; if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } /* normals at vertices */ getline_number(natureread, &(mesh->extra->iv)); mesh->extra->nv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->nv); k = 1; getline_popen_firstelemnoref(natureread, 2, vatn); nn = vatn[0]; is = vatn[1]; if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->nv[nn] = is; for (k = 2; k <= mesh->extra->iv; k++) { // GmfGetLin(inm,GmfNormalAtVertices,&nn,&is); getline_popen_elemnoref(natureread, 2, vatn); nn = vatn[0]; is = vatn[1]; if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->nv[nn] = is; } } else if (!strncmp(tictac, "NormalAtTriangleVertices", 24)) { natureread = "NormalAtTriangleVertices"; if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } /* normals at triangle vertices */ getline_number(natureread, &(mesh->extra->it)); mesh->extra->nt = (int *)M_calloc(3 * mesh->nt + 1, sizeof(int), "inmesh"); assert(mesh->extra->nt); k = 1; getline_popen_elemnoref(natureread, 3, tvatn); // GmfGetLin(inm,GmfNormalAtTriangleVertices,&nt,&is,&nn); tvatn[0] = nt; tvatn[1] = is; tvatn[2] = nn; if (nt < 1 || nt > mesh->nt || is < 1 || is > 3 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nt[3 * (nt - 1) + is] = nn; for (k = 2; k <= mesh->extra->it; k++) { getline_popen_elemnoref(natureread, 3, tvatn); // GmfGetLin(inm,GmfNormalAtTriangleVertices,&nt,&is,&nn); tvatn[0] = nt; tvatn[1] = is; tvatn[2] = nn; if (nt < 1 || nt > mesh->nt || is < 1 || is > 3 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nt[3 * (nt - 1) + is] = nn; } } /*normals at quadrilateral vertices */ else if (!strncmp(tictac, "NormalAtQuadrilateralVertices", 19)) { natureread = "NormalAtQuadrilateralVertices"; if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } getline_number(natureread, &(mesh->extra->iq)); mesh->extra->nq = (int *)M_calloc(4 * mesh->nq + 1, sizeof(int), "inmesh"); assert(mesh->extra->nq); k = 1; getline_popen_firstelemnoref(natureread, 3, tvatn); tvatn[0] = nq; tvatn[1] = is; tvatn[2] = nn; if (nq < 1 || nq > mesh->nq || is < 1 || is > 4 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nq[3 * (nq - 1) + is] = nn; for (k = 2; k <= mesh->extra->iq; k++) { // GmfGetLin(inm,GmfNormalAtQuadrilateralVertices,&nq,&is,&nn); getline_popen_elemnoref(natureread, 3, tvatn); tvatn[0] = nq; tvatn[1] = is; tvatn[2] = nn; if (nq < 1 || nq > mesh->nq || is < 1 || is > 4 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nq[3 * (nq - 1) + is] = nn; } } /*mesh tangents */ else if (!strncmp(tictac, "Tangents", 8)) { natureread = "Tangents"; getline_number(natureread, &(mesh->ntg)); /*****************/ /* allocation */ if (!mesh->nvn) { mesh->extra = (pExtra)M_calloc(1, sizeof(Extra), "zaldy1.extra"); assert(mesh->extra); } mesh->extra->t = (float *)M_calloc(3 * mesh->ntg + 1, sizeof(float), "inmesh"); assert(mesh->extra->t); k = 1; for (k = 1; k <= mesh->ntg; k++) { n = &mesh->extra->t[3 * (k - 1) + 1]; getline_popen_double(natureread, 3, dn);// modif FH n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } } /* tangent at vertices */ else if (!strncmp(tictac, "TangentAtVertices", 17)) { natureread = "TangentAtVertices"; if (!mesh->ntg) { printf("The field Tangent need to be reading before %s", natureread); exit(1); } getline_number(natureread, &(mesh->extra->jv)); // mesh->extra->jv = GmfStatKwd(inm,GmfTangentAtVertices); mesh->extra->tv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->tv); k = 1; getline_popen_firstelemnoref(natureread, 2, vatn); nn = vatn[0]; is = vatn[1]; if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->tv[nn] = is; for (k = 2; k <= mesh->extra->jv; k++) { getline_popen_elemnoref(natureread, 2, vatn); nn = vatn[0]; is = vatn[1]; // GmfGetLin(inm,GmfTangentAtVertices,&nn,&is); if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->tv[nn] = is; } } /* tangent at edge vertices */ else if (!strncmp(tictac, "TangentAtEdgeVertices", 21)) { natureread = "TangentAtEdgeVertices"; if (!mesh->ntg) { printf("The field Tangent need to be reading before %s", natureread); exit(1); } getline_number(natureread, &(mesh->extra->je)); mesh->extra->te = (int *)M_calloc(2 * mesh->na + 1, sizeof(int), "inmesh"); assert(mesh->extra->te); k = 1; getline_popen_firstelemnoref(natureread, 3, tvatn); nt = tvatn[0]; is = tvatn[1]; nn = tvatn[2]; if (nt < 1 || nt > mesh->np || is < 1 || is > 2 || nn < 1 || nn > mesh->ntg) disc++; else mesh->extra->te[3 * (nt - 1) + is] = is; for (k = 2; k <= mesh->extra->je; k++) { getline_popen_elemnoref(natureread, 3, tvatn); nt = tvatn[0]; is = tvatn[1]; nn = tvatn[2]; // GmfGetLin(inm,GmfTangentAtEdgeVertices,&nt,&is,&nn); if (nt < 1 || nt > mesh->np || is < 1 || is > 2 || nn < 1 || nn > mesh->ntg) disc++; else mesh->extra->te[3 * (nt - 1) + is] = is; } } else if (!strncmp(tictac, "End", 3) || !strncmp(tictac, "END", 3)) { if (ddebug) printf("Reading of mesh file is finished"); break; } } /* check if vertices and elements found */ if (!mesh->np) { fprintf(stdout, " ## No vertex\n"); return (-1); } mesh->ne = mesh->nt + mesh->nq + mesh->ntet + mesh->nhex; if (disc > 0) fprintf(stdout, " ## %d entities discarded\n", disc); return (1); } /* function of lecture */ int loadScaVecTen (pMesh mesh, int numsol, int dim, int ver, int nel, int type, int size, int *typtab, int key, char *natureread) { pSolution sol; double dbuf[GmfMaxTyp]; float fbuf[GmfMaxTyp]; double m[6], lambda[3], eigv[3][3], vp[2][2]; int inm, k, i, iord, off; char *ptr, data[128]; double ScaSol[1], VecSol[3], TenSol[9]; if (numsol > type) numsol = 1; numsol--; mesh->nbb = nel; mesh->bbmin = 1.0e20; mesh->bbmax = -1.0e20; if (!zaldy2(mesh)) return (0); sol = mesh->sol; sol->dim = dim; sol->ver = ver; off = 0; for (i = 0; i < numsol; i++) { switch (typtab[i]) { case GmfSca: off++; break; case GmfVec: off += sol->dim; break; case GmfSymMat: off += sol->dim * (sol->dim + 1) / 2; break; } } // printf("min= %f, max= %f\n",mesh->bbmin,mesh->bbmax); switch (typtab[numsol]) { case GmfSca: mesh->nfield = 1; for (k = 1; k <= nel; k++) { /* * if ( sol->ver == GmfFloat ) * GmfGetLin(inm,key,fbuf); * else { * GmfGetLin(inm,key,dbuf); * for (i=0; isol[k].bb = ScaSol[0]; if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } break; case GmfVec: if (ddebug) printf(" vector field\n"); mesh->nfield = sol->dim; for (k = 1; k <= nel; k++) { mesh->sol[k].bb = 0.0; /* * if ( sol->ver == GmfFloat ) * GmfGetLin(inm,key,fbuf); * else { * GmfGetLin(inm,key,dbuf); * for (i=0; idim, VecSol); for (i = 0; i < sol->dim; i++) { fbuf[off + i] = VecSol[i]; // printf("solution vectorielle %i composante %i %f\n",k,i,VecSol[i]); } for (i = 0; i < sol->dim; i++) { mesh->sol[k].m[i] = fbuf[off + i]; mesh->sol[k].bb += fbuf[off + i] * fbuf[off + i]; } mesh->sol[k].bb = sqrt(mesh->sol[k].bb); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } // printf("max= %f, min= %f",mesh->bbmin,mesh->bbmax); break; case GmfSymMat: if (ddebug) printf(" metric field\n"); mesh->nfield = sol->dim * (sol->dim + 1) / 2; for (k = 1; k <= nel; k++) { /* * if ( sol->ver == GmfFloat ) * GmfGetLin(inm,key,fbuf); * else { * GmfGetLin(inm,key,dbuf); * for (i=0; idim * (sol->dim + 1) / 2, TenSol); for (i = 0; i < sol->dim * (sol->dim + 1) / 2; i++) { fbuf[off + i] = TenSol[i]; } if (sol->dim == 2) { for (i = 0; i < 3; i++) { mesh->sol[k].m[i] = m[i] = fbuf[off + i]; } iord = eigen2(m, lambda, vp); mesh->sol[k].bb = min(lambda[0], lambda[1]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } else { for (i = 0; i < 6; i++) { mesh->sol[k].m[i] = fbuf[off + i]; } mesh->sol[k].m[2] = fbuf[off + 3]; mesh->sol[k].m[3] = fbuf[off + 2]; for (i = 0; i < 6; i++) { m[i] = mesh->sol[k].m[i]; } iord = eigenv(1, m, lambda, eigv); if (iord) { mesh->sol[k].bb = lambda[0]; mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[1]); mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[2]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } } } break; } return (1); } /*load solution (metric) */ int loadSol_popen (pMesh mesh, char *filename, int numsol) { pSolution sol; double dbuf[GmfMaxTyp]; float fbuf[GmfMaxTyp]; double m[6], lambda[3], eigv[3][3], vp[2][2]; int inm, k, i, key, nel, size, type, iord, off, typtab[GmfMaxTyp], ver, dim; char *ptr, data[256]; // rajout pour popen int NumberofSolAT; char *natureread; NumberofSolAT = 0; while (!feof(stdin)) { char *tictac; // fprintf(stdout,"data= %s\n",data); fgets(data, 256, stdin); tictac = strtok(data, " \n"); if (tictac == NULL) continue; // fprintf(stdout,"data= %s, tictac= %s\n",data,tictac); if (!strncmp(tictac, "MeshVersionFormatted", 20)) { /* read mesh format */ natureread = "MeshVersionFormatted"; tictac = strtok(NULL, " \n"); printf("data= %s\n", data); if (tictac == NULL) { printf(".sol: problem in reading the %s\n", natureread); exit(1); } else { ver = atoi(tictac); } if (debug) fprintf(stdout, ".sol: reading format %s %i \n", natureread, ver); } if (!strncmp(tictac, "Dimension", 9)) { /* read mesh dimension */ natureread = "Dimension"; tictac = strtok(NULL, " \n"); printf("data= %s\n", data); if (tictac == NULL) { printf("problem in reading the %s\n", natureread); exit(1); } else { dim = atoi(tictac); // if(debug) printf(".sol: %s %i (mesh)%i (lecture)%s \n",natureread,dim,mesh->dim,tictac); } /*control of the dimension*/ if (dim != mesh->dim) { fprintf(stderr, " %%%% Wrong dimension %d.\n", dim); GmfCloseMesh(inm); return (0); } } if (!strncmp(tictac, "SolAtVertices", 13)) { NumberofSolAT = NumberofSolAT + 10; natureread = "SolAtVertices"; fprintf(stdout, "data= %s\n", data); getline_number(natureread, &(nel)); fprintf(stdout, "nel %d, mesh->np %d \n", nel, mesh->np); if (nel != mesh->np) { fprintf(stderr, " %%%% Wrong number: %d Solutions discarded\n", nel - mesh->np); return (0); } mesh->typage = 2; key = GmfSolAtVertices; /* type,size,typetab */ read_TypeSizeTyptab(natureread, &type, &size, typtab); printf("sol: %s; type %i; size%i;\n", natureread, type, size); /* Reading solutions*/ loadScaVecTen(mesh, 1, dim, ver, nel, type, size, typtab, key, natureread); } if (mesh->dim == 2 && mesh->nt) { if (!strncmp(tictac, "SolAtTriangles", 14)) { NumberofSolAT = NumberofSolAT + 1; natureread = "SolAtTriangles"; fprintf(stdout, "data= %s\n", data); getline_number(natureread, &(nel)); if (nel && nel != mesh->nt) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); return (0); } mesh->typage = 1; key = GmfSolAtTriangles; /* type,size,typetab */ read_TypeSizeTyptab(natureread, &type, &size, typtab); printf("sol: %s; type %i; size%i;\n", natureread, type, size); /* Reading solutions*/ loadScaVecTen(mesh, 1, dim, ver, nel, type, size, typtab, key, natureread); } } if (mesh->dim == 2 && mesh->nq) { if (!strncmp(tictac, "SolAtQuadrilaterals", 19)) { NumberofSolAT = NumberofSolAT + 1; natureread = "SolAtQuadrilaterals"; fprintf(stdout, "data= %s\n", data); getline_number(natureread, &(nel)); if (nel && nel != mesh->nq) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); return (0); } mesh->typage = 1; key = GmfSolAtQuadrilaterals; /* type,size,typetab */ read_TypeSizeTyptab(natureread, &type, &size, typtab); /* Reading solutions*/ loadScaVecTen(mesh, 1, dim, ver, nel, type, size, typtab, key, natureread); } } if (mesh->dim == 3 && mesh->ntet) { if (!strncmp(tictac, "SolAtTetrahedra", 15)) { fprintf(stdout, "data= %s\n", data); NumberofSolAT = NumberofSolAT + 1; natureread = "SolAtTetrahedra"; getline_number(natureread, &(nel)); if (nel && nel != mesh->ntet) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); return (0); } mesh->typage = 1; key = GmfSolAtTetrahedra; /* type,size,typetab */ read_TypeSizeTyptab(natureread, &type, &size, typtab); /* Reading solutions*/ loadScaVecTen(mesh, 1, dim, ver, nel, type, size, typtab, key, natureread); } } if (mesh->dim == 3 && mesh->nhex) { if (!strncmp(tictac, "SolAtHexahedra", 14)) { fprintf(stdout, "data= %s\n", data); NumberofSolAT = NumberofSolAT + 1; natureread = "SolAtHexahedra"; getline_number(natureread, &(nel)); if (nel && nel != mesh->nhex) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); return (0); } mesh->typage = 1; key = GmfSolAtHexahedra; /* type,size,typetab */ read_TypeSizeTyptab(natureread, &type, &size, typtab); /* Reading solutions*/ loadScaVecTen(mesh, 1, dim, ver, nel, type, size, typtab, key, natureread); } } if (!strncmp(tictac, "End", 3) || !strncmp(tictac, "END", 3)) { if (ddebug) printf("Reading of mesh file is finished"); break; } } printf("NumberofSolAT %i\n", NumberofSolAT); return (1); } freefem++-3.61-1/src/medit/gisfil.c000644 000767 000024 00000013260 13312446271 017117 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define FLOAT_MAX 1.e20 int loadGIS (pMesh mesh) { pQuad pq; pPoint ppt; pSolution ps; FILE *fp; double xxm, yym, ggx, ggy, hhz; float *te, cx, cy, cz, gu, hu, xmi, ymi; int i, j, k, sx, sy, ret, bitsize, pos, ref; char *ptr, c, buf[256], data[256]; ubyte ityp; /* default */ strcpy(data, mesh->name); ptr = strstr(data, ".gis"); if (!ptr) strcat(data, ".gis"); fp = fopen(data, "rb"); if (!fp) return (0); fprintf(stdout, " Reading %s\n", data); if (!fgets(buf, sizeof(buf), fp)) { fprintf(stderr, " ## Invalid header.\n"); fclose(fp); return (0); } /* remove leading spaces */ pos = 0; while ((buf[0] == ' ') && (buf[0] != 0x0d) && (buf[0] != 0x0a)) { memmove(&buf[0], &buf[1], strlen(buf)); } /* check header file */ if (buf[0] != 'G') { fprintf(stderr, " ## Invalid format.\n"); fclose(fp); return (0); } if (buf[1] == '1') {ityp = 1;} else if (buf[1] == '2') {ityp = 2;} else { fprintf(stderr, " ## Invalid format ('G?' expected).\n"); fclose(fp); return (0); } /* check and strip comments */ do { ret = fscanf(fp, "%255s", buf); if (ret == EOF) break; if (buf[0] == '#') do { c = getc(fp); } while (c != '\n'); else break; } while (1); /* header */ ret = sscanf(buf, "%d", &sx); ret += fscanf(fp, "%d", &sy); ret += fscanf(fp, "%f %f %f", &cx, &cy, &cz); ret += fscanf(fp, "%f", &gu); ret += fscanf(fp, "%f", &hu); ret += fscanf(fp, "%f %f", &xmi, &ymi); if (ret != 9) { fprintf(stderr, " ## Error loading terrain.\n"); free(mesh); return (0); } bitsize = mesh->np * sizeof(float); if (ddebug) { fprintf(stdout, " header: sx %7d sy %7d\n", sx, sy); fprintf(stdout, " cx %7.2f cy %7.2f cz %7.2f\n", cx, cy, cz); fprintf(stdout, " units: %7.2f %7.2f\n", gu, hu); fprintf(stdout, " min: %7.3e %7.3e\n", xmi, ymi); fprintf(stdout, " terrain size: %dx%d %ld bytes\n", sx, sy, (long)bitsize); } mesh->np = sx * sy; mesh->nt = 0; mesh->nq = (sx - 1) * (sy - 1); mesh->ne = mesh->nq; /* memory allocation for mesh */ if (!zaldy1(mesh)) { fclose(fp); return (0); } /* read data */ if (ityp == 1) { xxm = xmi / cx; yym = ymi / cy; ggx = gu * cx; ggy = gu * cy; hhz = hu * cz; for (j = 1; j <= sy; j++) { for (i = 1; i <= sx; i++) { k = (j - 1) * sx + i; ppt = &mesh->point[k]; fscanf(fp, "%lf", &ppt->c[2]); ppt->c[0] = (float)(ggx * (xxm + i - 1)); ppt->c[1] = (float)(ggy * (yym + j - 1)); ppt->c[2] = (float)(hhz * ppt->c[2]); } } } else { int ni; te = (float *)malloc(sx * sizeof(float)); if (!te) exit(1); ni = 0; xxm = xmi / cx; yym = ymi / cy; ggx = gu / cx; ggy = gu / cy; hhz = hu / cz; for (j = 1; j <= sy; j++) { ret = fread(te, sizeof(int), sx, fp); if (ret != sx) { fprintf(stderr, " ## Error loading terrain.\n"); free(mesh->point); free(mesh); free(te); return (0); } for (i = 1; i <= sx; i++) { k = (j - 1) * sx + i; ppt = &mesh->point[k]; ppt->c[2] = te[ni++]; ppt->c[0] = ggx * (xxm + i - 1); ppt->c[1] = ggy * (yym + j - 1); ppt->c[2] = hhz * ppt->c[2]; } } free(te); } /* construct topology */ mesh->dim = 3; for (j = 1; j < sy; j++) { for (i = 1; i < sx; i++) { k = (j - 1) * (sx - 1) + i; pq = &mesh->quad[k]; pq->v[0] = (j - 1) * sx + i; pq->v[1] = pq->v[0] + 1; pq->v[2] = j * sx + i + 1; pq->v[3] = pq->v[2] - 1; pq->ref = 0; } } /* read references, if any */ if (ityp == 1) { pos = ftell(fp); ret = fscanf(fp, "%d", &i); if (ret != EOF) { fseek(fp, pos, SEEK_SET); for (j = 1; j < sy; j++) { for (i = 1; i < sx; i++) { k = (j - 1) * (sx - 1) + i; pq = &mesh->quad[k]; fscanf(fp, "%d", &ref); pq->ref = ref; } } } } /* solution = elevations */ mesh->nbb = mesh->np; mesh->bbmin = FLOAT_MAX; mesh->bbmax = -FLOAT_MAX; mesh->typage = 2; mesh->nfield = 1; /* allocate memory */ if (!zaldy2(mesh)) { mesh->nbb = 0; fclose(fp); return (1); } for (j = 1; j <= mesh->np; j++) { ps = &mesh->sol[j]; ppt = &mesh->point[j]; ps->bb = ppt->c[2]; if (ps->bb < mesh->bbmin) mesh->bbmin = ps->bb; if (ps->bb > mesh->bbmax) mesh->bbmax = ps->bb; } fclose(fp); return (1); } freefem++-3.61-1/src/medit/path.c000644 000767 000024 00000012536 13312446271 016603 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define MAX_PATH 1024 #define IMG_PER_SEC 25 /* add point to path */ int pathAdd (pScene sc, int x, int y) { GLdouble modelmat[16], projmat[16]; GLdouble ptx, pty, ptz; GLint viewport[4]; Trajet *path; pMesh mesh; pTransform view; float *p; int k; if (ddebug) fprintf(stdout, "pathAdd"); path = &sc->path; mesh = cv.mesh[sc->idmesh]; view = sc->view; if (path->np == MAX_PATH) return (0); /* memory alloc */ if (!path->np) { path->pt = (float *)calloc(mesh->dim * (MAX_PATH + 1), sizeof(float)); if (!path->pt) { fprintf(stderr, " Not enough memory to store path.\n"); return (0); } path->tg = (float *)calloc(mesh->dim * (MAX_PATH + 1), sizeof(float)); if (!path->tg) { fprintf(stderr, " Not enough memory to store tangents.\n"); return (0); } } else if (path->np > MAX_PATH - 1) {return (0);} /* get 3D point */ glGetDoublev(GL_PROJECTION_MATRIX, projmat); glGetIntegerv(GL_VIEWPORT, viewport); for (k = 0; k < 16; k++) { modelmat[k] = view->matrix[k]; } gluUnProject(x, y, -100, modelmat, projmat, viewport, &ptx, &pty, &ptz); /* store point coords */ ++path->np; p = &path->pt[mesh->dim * path->np]; p[0] = ptx; p[1] = pty; p[2] = ptz; /* compute tangent at point-1 */ if (path->np > 2) { float *p1, *a; p1 = &path->pt[mesh->dim * (path->np - 2)]; a = &path->tg[mesh->dim * path->np]; a[0] = 0.5 * (p[0] - p1[0]); a[1] = 0.5 * (p[1] - p1[1]); a[2] = 0.5 * (p[2] - p1[2]); } if (ddebug) printf(" Point %d: (%f %f %f) added\n", path->np, p[0], p[1], p[2]); return (1); } /* build list of points */ GLuint pathList (pScene sc) { Trajet path; pMesh mesh; GLuint dlist; float *p; int k; static GLfloat green[3] = {0.2, 1.0, 0.2}; /*static GLfloat orang[3] = {1.0, 0.7, 0.1};*/ if (ddebug) fprintf(stdout, "pathList"); path = sc->path; mesh = cv.mesh[sc->idmesh]; /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* node positions */ glPointSize(5); glColor3f(1.0, 0.3, 0.3); glBegin(GL_POINTS); for (k = 1; k <= path.np; k++) { p = &path.pt[mesh->dim * k]; glVertex3fv(p); } glEnd(); /* straight path */ glLineWidth(2.0); glColor3fv(green); glBegin(GL_LINE_STRIP); for (k = 1; k <= path.np; k++) { p = &path.pt[mesh->dim * k]; glVertex3fv(p); } glEnd(); glLineWidth(1.0); /* curvilinear path */ /* * glBegin(GL_LINE_STRIP); * glColor3fv(orang); * glEnd(); */ glEndList(); return (dlist); } /* follow path */ void pathFollow (pScene sc) { if (!sc->path.np) return; if (ddebug) fprintf(stdout, "pathFollow %d\n", sc->path.np); } int pathLoad (char *file, pScene sc) { FILE *in; char *ptr, data[256]; strcpy(data, file); ptr = (char *)strstr(data, ".mesh"); if (ptr) *ptr = '\0'; if (!strstr(data, ".path")) strcat(data, ".path"); in = fopen(data, "r"); if (!in) { sscanf(data, "DEFAULT.path"); in = fopen(data, "r"); if (!in) return (0); } if (!quiet) fprintf(stdout, " Loading %s\n", data); fclose(in); return (1); } int pathSave (char *file, pScene sc) { FILE *out; pMesh mesh; time_t timeptr; int i, k; char *ptr, data[256]; strcpy(data, file); ptr = (char *)strstr(data, ".mesh"); if (ptr) *ptr = '\0'; if (!strstr(data, ".path")) strcat(data, ".path"); out = fopen(data, "w"); if (!out) { fprintf(stdout, " ## Unable to open file\n"); ; return (0); } if (!quiet) fprintf(stdout, " Writing %s\n", data); /* create standard path file */ fprintf(out, "# File created with Medit %s\n", ME_VER); fprintf(out, "# Release %s\n", ME_REL); time(&timeptr); fprintf(out, "# Created: %s", ctime(&timeptr)); mesh = cv.mesh[sc->idmesh]; fprintf(out, "NbPoints\n%d\n", sc->path.np); for (k = 1; k <= sc->path.np; k++) { float *p; p = &sc->path.pt[mesh->dim * k]; for (i = 0; i < mesh->dim; i++) { fprintf(out, "%f ", p[i]); } fprintf(out, "\n"); } fclose(out); return (1); } freefem++-3.61-1/src/medit/sproto.h000644 000767 000024 00000023406 13312446271 017200 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ /* animat.c */ int loadNextMesh(pMesh, int, int); int animat (); int playAnim(pScene, pMesh, int, int); void glutIdle (void); /* camera.c */ double Azimuth(pCamera); double Elevation(pCamera); void updateSun(pScene, pCamera); void updateCamera(pScene, pCamera, double, double); pCamera initCamera(pScene, int); /* clip.c */ void updateClip(pClip, pMesh); void clipVertices(pMesh, pScene, pClip); void invertClip(pScene sc, pClip); void drawClip(pScene, pClip, pMesh, GLboolean); void copyClip(pClip); int pasteClip(pClip); void resetClip(pScene, pClip, pMesh); pClip createClip(pScene, pMesh); void updateCube(pCube, pMesh); pCube createCube(pScene, pMesh); /* clipvol.c */ GLuint capTetra(pMesh); GLuint capTetraMap(pMesh); GLuint capTetraIso(pMesh); /* critip.c */ GLuint listCritPoint(pScene, pMesh); /* dlists.c */ GLuint listTria(pScene, pMesh); GLuint listQuad(pScene, pMesh); GLuint listTetra(pScene, pMesh, ubyte); GLuint listHexa(pScene, pMesh, ubyte); /* eigenv.c */ int eigenv (int sym, double mat[6], double lambda[3], double v[3][3]); /* geometry.c */ GLuint geomList(pScene, pMesh); /* gisfil.c */ int loadGIS(pMesh); /* hash.c */ int hashTria(pMesh); int hashTetra(pMesh); /* image.c */ PPMimage*loadPPM (const char *imgname, int *type); int savePPM (const char *imgname, pPPMimage img, int typimg); void saveEPS (pScene sc, const char *imgname, pPPMimage pixels); int imgHard (pScene sc, char *data, char key); /* input/output */ int EatLine(FILE * in); int inmsh2 (pMesh mesh); int bbfile(pMesh); int loadMesh(pMesh); int saveMesh(pScene, pMesh, char *, ubyte); int loadSol (pMesh mesh, char *filename, int numsol); int loadMesh_popen(pMesh); // pour popen /* ilists.c */ GLuint listTriaIso(pScene, pMesh); GLuint listQuadIso(pScene, pMesh); GLuint listTetraIso(pScene, pMesh); /* items.c */ void drawAxis(pScene, int); void drawBox(pScene, pMesh, int); void drawCube(pScene, pMesh); void drawGrid(pScene, pMesh); void rubberBand(pPersp); void drawBase(pScene, pMesh); void drawIso(pScene); /* keyboard.c */ void specCamera(pScene, int); void special (int, int, int); void keyScene (unsigned char, int, int); /* listnum.c */ void updatePoints (pScene sc, pMesh mesh, int refmat); void listNum (pScene sc, pMesh mesh); /* material.c */ void matInit(pScene); void matSort(pScene); int matRef(pScene, int); void matReshape (int, int); void matsubReshape (int, int); void matsubDisplay (); void matDisplay (); void matMouse (int, int, int, int); void matKeyboard (unsigned char, int, int); void matEdit(pScene); /* medit.c */ int medit0 (); int medit1 (); /* menus.c */ void doLists(pScene, pMesh); void doMapLists(pScene, pMesh, int); void doIsoLists(pScene, pMesh, int); void keyFile (unsigned char, int, int); void menuFile (int); void keyItem (unsigned char, int, int); void menuItem (int); void keyAnim (unsigned char, int, int); void menuAnim (int); void keyTrajet (unsigned char, int, int); void menuTrajet (int); void keyMode (unsigned char, int, int); void menuMode (int); void menuScene (int); void keyView (unsigned char, int, int); void menuView (int); void keyColor (unsigned char, int, int); void menuColor (int); void keyClip (unsigned char, int, int); void menuClip (int); void keyFeature (unsigned char, int, int); void menuFeature (int); void menuImage (int); void keyMetric (unsigned char key, int x, int y); int createMenus(pScene, pMesh); GLuint pickingScene (pScene sc, int x, int y, int ident); /* mesh.c */ void meshInfo(pMesh); int meshSurf(pMesh); void meshCoord(pMesh, int); void meshBox (pMesh mesh, int bb); void meshRef (pScene sc, pMesh mesh); int meshUpdate (pScene sc, pMesh mesh); /* mlists.c */ GLuint listTriaMap(pScene, pMesh); GLuint listQuadMap(pScene, pMesh); GLuint listTetraMap(pScene, pMesh, ubyte); GLuint listHexaMap(pScene, pMesh, ubyte); void cutTriangle(pScene, triangle); GLuint alt2dList(pScene, pMesh, int, float, float); void setupPalette(pScene, pMesh); GLuint drawPalette(pScene); /* morphing */ int morphMesh (pScene sc, pMesh mesh1); int modeMorphing (); /* mouse.c */ void mouse (int button, int state, int x, int y); void motion (int x, int y); void redrawOverlay (int stretchX, int stretchY); void motionCamera (int x, int y); void mouseCamera (int button, int state, int x, int y); void animateCamera (); /* normal.c */ GLuint drawNormals (pMesh mesh, pScene sc); /* outmsh.c */ int outmsh(pScene, pMesh, char *name, ubyte clipon); /* parsar.c */ int parsar (int argc, char *argv []); /* parsop.c */ int saveMeditFile(char *, pScene); void iniopt(pScene, pMesh); int parsop(pScene, pMesh); /* particle.c */ int createParticle(pScene, pMesh); /* path.c */ int pathAdd(pScene, int, int); GLuint pathList(pScene); int pathLoad(char *data, pScene); int pathSave(char *file, pScene); void pathFollow(pScene); /* persp.c */ void setPersp(pScene, pPersp, int); pPersp initPersp(pPersp, float); /* picking.c */ GLuint pickingList(pScene, int, int); GLuint pickingPoint (pScene sc, int x, int y); GLuint pickItem(pMesh, pScene, int); /* prierr.c */ void prierr (int typerr, int indice); /* psfile.c */ void writeEPSheader (FILE *, char *, char, int, int, float, float); void writeEPStrailer (FILE *); void writeEPSRow(FILE *, char, ubyte *, int, ubyte); /* scene.c */ int currentScene (); void checkErrors (void); void oglerr (GLenum error); void farclip(GLboolean); void reshapeScene (int width, int height); void setupView (pScene sc); void drawBackTex (pScene sc); void drawModel (pScene sc); void drawScene(pScene); void redrawScene (); void deleteScene (pScene sc); void initGrafix (pScene sc, pMesh mesh); int createScene (pScene sc, int idmesh); void streamIdle (); /* scissor.c */ void scissorScene (); /* status.c */ void reshapeStatusBar (pScene sc, int width, int height); void redrawStatusBar (pScene sc); void mouseStatus (int button, int state, int x, int y); /* stream.c */ double sizeTetra(pMesh, int); double sizeHexa(pMesh, int); double sizeTria(pMesh, int); int locateTria (pMesh mesh, int nsdep, int base, float *p, double *cb); int locateTetra (pMesh mesh, int nsdep, int base, float *p, double *cb); int inTria(pMesh, int, float *, double *); int listTetraStream(pScene, pMesh, float *, int); int listHexaStream(pScene, pMesh, float *, int); int listTriaStream(pScene, pMesh, float *); pStream createStream(pScene, pMesh); int streamRefTria (pScene sc, pMesh mesh); int streamRefQuad (pScene sc, pMesh mesh); int streamRefPoint (pScene sc, pMesh mesh); int listSaddleStream (pScene sc, pMesh mesh, int depart, float *pp, float *vv, double lambda); int nxtPoint3D (pMesh mesh, int nsdep, float *p, float step, double *v); int nxtPoint2D (pMesh mesh, int nsdep, float *p, float step, double *v); double field2DInterp (pMesh mesh, int iel, double *cb, double *v); double vector3DInterp (pMesh mesh, pPoint pt[4], double *cb, double *v); double field3DInterp (pMesh mesh, int iel, double *cb, double *v); double sizeTria (pMesh mesh, int k); double sizeQuad (pMesh mesh, int k); double sizeTetra (pMesh mesh, int k); /* tensor.c */ GLuint listPointVector(pMesh, ubyte); /* texture.c */ pPPMimage texDistortion(pPPMimage); /* tiles.c */ int imgTiling (pScene sc, char *data, char key); /* transform.c */ void resetTransform(pTransform); pTransform createTransform (); /* util.c */ void setFont (char *name, int size); void drwstr (GLuint x, GLuint y, char *format, ...); void output2 (GLfloat x, GLfloat y, char *format, ...); void output3 (GLfloat x, GLfloat y, GLfloat z, char *format, ...); void hsvrgb (double *hsv, double *rgb); void transformPoint (double u[4], float v[4], float m[16]); void transformPointd (double u[4], double v[4], double m[16]); void transformVector (float u[4], float v[4], float m[16]); void multMatrix (GLfloat *p, GLfloat *a, GLfloat *b); void rotateMatrix (GLfloat angle, GLfloat x, GLfloat y, GLfloat z, GLfloat rm[16]); int invertMatrix (float src[16], float inverse[16]); int filnum (char *data, int numdep, char *ext); /* vector.c */ void drawVector2D (float p[2], double u[2], double scal); void drawVector3D (float p[3], double u[3], double scal); GLuint listTria2dVector (pMesh mesh); GLuint listTria3dVector (pMesh mesh); GLuint listClipTetraVector (pMesh mesh); GLuint listClipHexaVector (pMesh mesh); /* view.c */ void copyView (pTransform view, pCamera cam, pPersp persp); int pasteView (pTransform view, pCamera cam, pPersp persp); int linkView (pScene sc1); void unlinkView (pScene sc1); /* zaldy.c */ int zaldy1 (pMesh mesh); int zaldy2 (pMesh mesh); freefem++-3.61-1/src/medit/morphing.c000644 000767 000024 00000006074 13312446271 017472 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define MAX_MORPH 100 int imstep, imreverse; int modeMorphing () { pScene scene; pMesh mesh1, mesh2; int k; clock_t ct; /* default */ cv.nbs = 1; imstep = 1; imreverse = 1; if (ddebug) printf("morphing: create window\n"); fprintf(stdout, "\n Building scene\n"); ct = clock(); /* create grafix */ scene = cv.scene[0]; mesh1 = cv.mesh[0]; iniopt(scene, mesh1); parsop(scene, mesh1); meshRef(scene, mesh1); matSort(scene); mesh2 = cv.mesh[1]; parsop(scene, mesh2); meshRef(scene, mesh2); for (k = 1; k <= mesh2->np; k++) { pPoint ppt1, ppt2; ppt1 = &mesh1->point[k]; ppt2 = &mesh2->point[k]; ppt2->c[0] -= ppt1->c[0]; ppt2->c[1] -= ppt1->c[1]; ppt2->c[2] -= ppt1->c[2]; } if (!createScene(scene, 0)) { fprintf(stderr, " ## Unable to create scene\n"); return (0); } ct = difftime(clock(), ct); fprintf(stdout, " Scene seconds: %.2f\n", (double)ct / (double)CLOCKS_PER_SEC); return (1); } int morphMesh (pScene sc, pMesh mesh1) { pMesh mesh2; int k; static float dt = 1.0 / MAX_MORPH; imstep++; if (imstep == 0) { imstep = 2; dt = -dt; if (!imreverse) { glutIdleFunc(NULL); morphing = 0; return (0); } } else if (imstep == MAX_MORPH + 1) { imstep = -MAX_MORPH + 1; dt = -dt; if (!imreverse) { glutIdleFunc(NULL); morphing = 0; return (0); } } mesh2 = cv.mesh[1]; for (k = 1; k <= mesh1->np; k++) { pPoint ppt1, ppt2; ppt1 = &mesh1->point[k]; ppt2 = &mesh2->point[k]; ppt1->c[0] += dt * ppt2->c[0]; ppt1->c[1] += dt * ppt2->c[1]; ppt1->c[2] += dt * ppt2->c[2]; } doLists(sc, mesh1); return (1); } freefem++-3.61-1/src/medit/cenrad.c000644 000767 000024 00000007107 13312446271 017101 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include #include #include #include "medit.h" #include "extern.h" #include "sproto.h" /* compute circumradius and center */ int cenrad (pMesh mesh, int iel, double *c, double *rad) { pTetra pt; pPoint p1, p2, p3, p4; double dd, ux, uy, uz, n1[3], n2[3], n3[3], c1, c2, c3, pl1, pl2, pl3; pt = &mesh->tetra[iel]; if (!pt->v[0]) return (0); p1 = &mesh->point[pt->v[0]]; p2 = &mesh->point[pt->v[1]]; p3 = &mesh->point[pt->v[2]]; p4 = &mesh->point[pt->v[3]]; ux = p4->c[0] - p1->c[0]; uy = p4->c[1] - p1->c[1]; uz = p4->c[2] - p1->c[2]; dd = 1.0 / sqrt(ux * ux + uy * uy + uz * uz); n1[0] = ux * dd; n1[1] = uy * dd; n1[2] = uz * dd; /* plan: vecteur directeur passant par milieu(1,4) */ pl1 = n1[0] * (p4->c[0] + p1->c[0]) \ + n1[1] * (p4->c[1] + p1->c[1]) + n1[2] * (p4->c[2] + p1->c[2]); ux = p4->c[0] - p2->c[0]; uy = p4->c[1] - p2->c[1]; uz = p4->c[2] - p2->c[2]; dd = 1.0 / sqrt(ux * ux + uy * uy + uz * uz); n2[0] = ux * dd; n2[1] = uy * dd; n2[2] = uz * dd; pl2 = n2[0] * (p4->c[0] + p2->c[0]) \ + n2[1] * (p4->c[1] + p2->c[1]) + n2[2] * (p4->c[2] + p2->c[2]); ux = p4->c[0] - p3->c[0]; uy = p4->c[1] - p3->c[1]; uz = p4->c[2] - p3->c[2]; dd = 1.0 / sqrt(ux * ux + uy * uy + uz * uz); n3[0] = ux * dd; n3[1] = uy * dd; n3[2] = uz * dd; pl3 = n3[0] * (p4->c[0] + p3->c[0]) \ + n3[1] * (p4->c[1] + p3->c[1]) + n3[2] * (p4->c[2] + p3->c[2]); /* center = intersection of 3 planes */ ux = n2[1] * n3[2] - n2[2] * n3[1]; uy = n1[2] * n3[1] - n1[1] * n3[2]; uz = n1[1] * n2[2] - n1[2] * n2[1]; dd = n1[0] * ux + n2[0] * uy + n3[0] * uz; dd = 0.5 / dd; c1 = ux * pl1 + uy * pl2 + uz * pl3; c2 = pl1 * (n2[2] * n3[0] - n2[0] * n3[2]) \ + pl2 * (n1[0] * n3[2] - n3[0] * n1[2]) \ + pl3 * (n2[0] * n1[2] - n2[2] * n1[0]); c3 = pl1 * (n2[0] * n3[1] - n2[1] * n3[0]) \ + pl2 * (n3[0] * n1[1] - n3[1] * n1[0]) \ + pl3 * (n1[0] * n2[1] - n2[0] * n1[1]); c[0] = dd * c1; c[1] = dd * c2; c[2] = dd * c3; /* radius (squared) */ *rad = (c[0] - p4->c[0]) * (c[0] - p4->c[0]) \ + (c[1] - p4->c[1]) * (c[1] - p4->c[1]) \ + (c[2] - p4->c[2]) * (c[2] - p4->c[2]); return (1); } freefem++-3.61-1/src/medit/status.c000644 000767 000024 00000013551 13312446271 017170 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include "medit.h" #include "extern.h" #include "sproto.h" extern void drawHUD (pScene); extern int refmat, imstep; void initTexture (void) { PPMimage *imgtex; int typimg; ubyte iquiet; GLuint texname; iquiet = quiet; quiet = 1; imgtex = loadPPM("Lions.ppm", &typimg); quiet = iquiet; if (!imgtex) return; glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &texname); glBindTexture(GL_TEXTURE_2D, texname); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, imgtex->sizeX, imgtex->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, imgtex->data); free(imgtex); } void backTexture (pScene sc) { glEnable(GL_TEXTURE_2D); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glPushAttrib(GL_ENABLE_BIT); glEnable(GL_TEXTURE_2D); glDisable(GL_LIGHTING); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0, 0.0); glTexCoord2f(sc->par.xs, 0.0); glVertex2f(sc->par.xs, 0.0); glTexCoord2f(sc->par.xs, sc->par.ys); glVertex2f(sc->par.xs, sc->par.ys); glTexCoord2f(0.0, sc->par.ys); glVertex2f(0.0, sc->par.ys); glEnd(); glPopAttrib(); glDisable(GL_TEXTURE_2D); } void redrawStatusBar (pScene sc) { pClip clip = sc->clip; pMesh mesh = cv.mesh[sc->idmesh]; if (sc->par.xs < 100) return; if (ddebug) fprintf(stdout, "redrawStatusBar\n"); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(1., sc->par.xs, 1., sc->par.ys); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); /* other info */ glColor3f(1.0 - sc->par.back[0], 1.0 - sc->par.back[1], 1.0 - sc->par.back[2]); if (animate && !(sc->isotyp & S_PARTICLE)) { float frame, elpms; static float fps = 0.0, lastfr = 0.0; static int nfr = 0, pps = 0; nfr++; frame = glutGet(GLUT_ELAPSED_TIME) / 1000.0f; elpms = frame - lastfr; if (elpms > 0.999) { fps = nfr / elpms; if (mesh->nt + mesh->nq) pps = fps * (mesh->nt + mesh->nq); else if (mesh->ntet + mesh->nhex) pps = fps * (mesh->ntet + mesh->nhex); else pps = fps * mesh->np; nfr = 0; lastfr = frame; } output2(15, 8, "Fps: %6.2f Pps: %8d", fps, pps); } if (option == MORPHING) output2(15, 28, "%d", abs(imstep)); if (sc->isotyp & S_STREAML && sc->par.maxtime < FLT_MAX) output2(15, 8, "t= %8.3f", sc->par.cumtim); else if (sc->isotyp & S_PARTICLE) output2(15, 8, "t= %8.3f", sc->par.cumtim); /* clip eqn */ if (clip->active & C_ON && !(clip->active & C_HIDE)) { double dd; char buf[128], tmpbuf[128]; sprintf(buf, "Eqn: "); strcpy(tmpbuf, buf); if (fabs(clip->eqn[0]) > EPS) sprintf(buf, "%s %+.2gx", tmpbuf, clip->eqn[0]); if (fabs(clip->eqn[1]) > EPS) sprintf(buf, "%s %+.2gy", tmpbuf, clip->eqn[1]); if (fabs(clip->eqn[2]) > EPS) sprintf(buf, "%s %+.2gz", tmpbuf, clip->eqn[2]); strcpy(tmpbuf, buf); dd = clip->eqn[3] - clip->eqn[0] * mesh->xtra \ - clip->eqn[1] * mesh->ytra - clip->eqn[2] * mesh->ztra; if (dd) sprintf(buf, "%s %+.2g", tmpbuf, dd); if (sc->par.xs > 180) output2(150, 8, "%s = 0", buf); } if ((sc->picklist) && (sc->par.xs > 390) && (!sc->isotyp) & (S_PARTICLE)) output2(350, 8, "%15s", sc->material[refmat].name); if (sc->persp->pmode == PERSPECTIVE && sc->item & S_PALETTE) drawPalette(sc); if (sc->persp->pmode == CAMERA) drawHUD(sc); glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glEnable(GL_LIGHTING); glEnable(GL_DEPTH_TEST); } void mouseStatus (int button, int state, int x, int y) { pScene sc = cv.scene[currentScene()]; pTransform view = sc->view; ubyte axis = X_AXIS; /* default */ if (ddebug) printf("control mouse %d\n", state); if (button == GLUT_LEFT_BUTTON) { if (x < 16 && x > 5) axis = X_AXIS; else if (x < 26 && x > 15) axis = Y_AXIS; else if (x < 36 && x > 25) axis = Z_AXIS; switch (axis) { case X_AXIS: view->angle = 90.0; break; case Y_AXIS: view->angle = 90.0; view->axis[0] = 1.0; view->axis[1] = view->axis[2] = 0.0f; break; case Z_AXIS: view->angle = 90.0; view->axis[1] = 0.0f; view->axis[0] = view->axis[2] = 0.0f; break; } } } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/material.c000644 000767 000024 00000035314 13312446271 017444 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include #include "medit.h" #include "extern.h" #include "sproto.h" #define Width 630 #define Height 250 #define MAX_MAT 32 extern int refmat, reftype; /* globals */ pScene main_scene; GLint matwin = 0, m_subwin; GLint selection; static float colors[MAX_MAT + 1][3] = { {0.1, 0.4, 0.9},/* blue */ {1.0, 0.0, 0.0},/* red */ {0.0, 1.0, 0.0},/* green */ {1.0, 1.0, 0.0},/* yellow */ {0.0, 1.0, 1.0},/* cyan */ {1.0, 0.5, 0.0},/* orange */ {0.5, 0.0, 1.0},/* violet */ {0.0, 0.0, 0.4},/* dark blue */ {0.0, 0.4, 0.0},/* dark green */ {0.4, 0.0, 0.0},/* dark red */ {1.0, 1.0, 0.5}, {1.0, 0.5, 1.0}, {1.0, 0.5, 0.5}, {1.0, 0.5, 0.0},/* orange */ {1.0, 0.0, 1.0}, {1.0, 0.0, 0.5}, {0.5, 1.0, 1.0}, {0.5, 1.0, 0.5}, {0.5, 1.0, 0.0}, {0.5, 0.5, 1.0}, {0.5, 0.5, 0.5}, {0.5, 0.5, 0.0}, {0.5, 0.0, 0.5}, {0.5, 0.0, 0.0}, {0.0, 1.0, 0.5}, {0.0, 0.5, 1.0}, {0.0, 0.5, 0.5}, {0.0, 0.5, 0.0}, {0.0, 0.0, 0.5}, {0.4, 0.4, 0.0},/* dark yellow */ {0.0, 0.4, 0.4},/* dark cyan */ {0.3, 0.7, 0.9},/* default blue */ {0.3, 0.7, 0.9} /* default blue */ }; cell ambient[4] = { {1, 120, 60, 0.0, 1.0, 0.0, 0.01, "Specifies R coordinate of ambient vector.", "%.2f"}, {2, 180, 60, 0.0, 1.0, 0.0, 0.01, "Specifies G coordinate of ambient vector.", "%.2f"}, {3, 240, 60, 0.0, 1.0, 0.0, 0.01, "Specifies B coordinate of ambient vector.", "%.2f"}, {4, 300, 60, 0.0, 1.0, 0.0, 0.01, "Specifies A coordinate of ambient vector.", "%.2f"}, }; cell diffuse[4] = { {5, 120, 90, 0.0, 1.0, 0.0, 0.01, "Specifies R coordinate of diffuse vector.", "%.2f"}, {6, 180, 90, 0.0, 1.0, 0.0, 0.01, "Specifies G coordinate of diffuse vector.", "%.2f"}, {7, 240, 90, 0.0, 1.0, 0.0, 0.01, "Specifies B coordinate of diffuse vector.", "%.2f"}, {8, 300, 90, 0.0, 1.0, 0.0, 0.01, "Specifies A coordinate of diffuse vector.", "%.2f"}, }; cell specular[4] = { {9, 120, 120, 0.0, 1.0, 0.0, 0.01, "Specifies R coordinate of specular vector.", "%.2f"}, {10, 180, 120, 0.0, 1.0, 0.0, 0.01, "Specifies G coordinate of specular vector.", "%.2f"}, {11, 240, 120, 0.0, 1.0, 0.0, 0.01, "Specifies B coordinate of specular vector.", "%.2f"}, {12, 300, 120, 0.0, 1.0, 0.0, 0.01, "Specifies A coordinate of specular vector.", "%.2f"}, }; cell emission[4] = { {13, 120, 150, 0.0, 1.0, 0.0, 0.01, "Specifies R coordinate of emission vector.", "%.2f"}, {14, 180, 150, 0.0, 1.0, 0.0, 0.01, "Specifies G coordinate of emission vector.", "%.2f"}, {15, 240, 150, 0.0, 1.0, 0.0, 0.01, "Specifies B coordinate of emission vector.", "%.2f"}, {16, 300, 150, 0.0, 1.0, 0.0, 0.01, "Specifies A coordinate of emission vector.", "%.2f"}, }; cell shininess[1] = { {17, 120, 180, 3.0, 128.0, 0.0, 0.5, "Specifies value of shininess.", "%.2f"}, }; void matInit (pScene sc) { pMaterial pm; int m; /* default */ if (!sc->material) { sc->material = (pMaterial)M_calloc(2 + sc->par.nbmat, sizeof(Material), "matinit"); assert(sc->material); sc->matsort = (int *)M_calloc(2 + sc->par.nbmat, sizeof(int), "matinit"); assert(sc->matsort); } /* store color in table */ for (m = 0; m <= sc->par.nbmat; m++) { int mm; pm = &sc->material[m]; /* diffuse : primary color */ mm = m % MAX_MAT; memcpy(pm->dif, colors[mm], 3 * sizeof(float)); pm->dif[3] = 1.0; /* ambient : grey level */ pm->amb[0] = pm->amb[1] = pm->amb[2] = 0.2; pm->amb[3] = 1.0; /* emission: null (pas un neon!) */ pm->emi[0] = pm->emi[1] = pm->emi[2] = 0.0; pm->emi[3] = 1.0; /* specular: soleil blanc */ pm->spe[0] = pm->spe[1] = pm->spe[2] = 0.4; pm->spe[3] = 1.0; /* shininess: etalement des reflections spec. */ pm->shininess = 80.0; if (m != DEFAULT_MAT) sprintf(pm->name, "%s%.2d", "MAT", m); else strcpy(pm->name, "DEFAULT_MAT"); pm->flag = 0; if (!pm->ref) pm->ref = m; pm->sort = m; } } void matSort (pScene sc) { pMaterial pm, pm1; int m, mm, transp; /* sort materials */ if (!quiet) fprintf(stdout, " Sorting %d materials\n", sc->par.nbmat); transp = 0; for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->sort = m; sc->matsort[m] = m; if (pm->dif[3] < 0.999) transp++; } if (!transp) return; /* sorting */ if (ddebug) fprintf(stdout, " %d translucent\n", transp); mm = sc->par.nbmat - 1; for (m = 0; m < sc->par.nbmat - transp - 1; m++) { pm = &sc->material[m]; if (pm->dif[3] < 0.995) { pm1 = &sc->material[mm]; sc->matsort[mm] = m; sc->matsort[m] = mm; pm->sort = mm; pm1->sort = m; mm--; } } } int matRef (pScene sc, int ref) { int m; if (!ref) return (ref); for (m = 1; m < sc->par.nbmat; m++) { pMaterial pm; pm = &sc->material[m]; if (pm->ref == ref) return (m); } if (sc->par.nbmat < 2) return (0); m = 1 + (ref - 1) % (sc->par.nbmat - 1); return (m); } /* reshape material window */ void matReshape (int width, int height) { glutSetWindow(matwin); glViewport(0, 0, Width, Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, Width, Height, 0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glutReshapeWindow(Width, Height); } static void cellInit (int mat) { pMaterial pm; int i; pm = &main_scene->material[mat]; for (i = 0; i < 4; i++) { ambient[i].value = pm->amb[i]; diffuse[i].value = pm->dif[i]; specular[i].value = pm->spe[i]; emission[i].value = pm->emi[i]; } shininess[0].value = pm->shininess; glutPostRedisplay(); } static int cellCopy (int mat) { pMaterial pm; int i, dosort; pm = &main_scene->material[mat]; dosort = pm->dif[3] != diffuse[3].value; for (i = 0; i < 4; i++) { pm->amb[i] = ambient[i].value; pm->dif[i] = diffuse[i].value; pm->spe[i] = specular[i].value; pm->emi[i] = emission[i].value; } pm->shininess = shininess[0].value; return (dosort); } static void cellDraw (cell *cel) { if (selection == cel->id) { glColor3ub(255, 255, 0); drwstr(10, 240, cel->info); glColor3ub(255, 0, 0); } else { glColor3ub(0, 255, 128); } drwstr(cel->x, cel->y, cel->format, cel->value); } static int cellHit (cell *cel, int x, int y) { if (x > cel->x && x < cel->x + 60 && y > cel->y - 30 && y < cel->y + 10) return cel->id; else return 0; } static void cellUpdate (cell *cel, int update) { if (selection != cel->id) return; cel->value += update * cel->step; if (cel->value < cel->min) cel->value = cel->min; else if (cel->value > cel->max) cel->value = cel->max; } void matsubReshape (int x, int y) { GLfloat sunpos[4] = {5., 2., 10.0, 0.}; glutSetWindow(m_subwin); glViewport(0, 0, 200, 200); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(50.0, 1.0, 0.01f, 100.0f); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); glLightfv(GL_LIGHT0, GL_POSITION, sunpos); glEnable(GL_LIGHT0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0, 0.0, -5.0); glutSetWindow(matwin); } void matsubDisplay () { GLfloat amb[4], dif[4], emi[4], spe[4]; int i, transp; glutSetWindow(m_subwin); glDisable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); glClearColor(0.0f, 0.0f, 0.0f, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBegin(GL_QUADS); glColor3f(0.8, 0., 0.); glVertex3f(-2.0, -1.5, -2.0); glVertex3f(0.0, -1.5, -2.0); glVertex3f(0.0, -1.5, 5.0); glVertex3f(-2.0, -1.5, 5.0); glColor3f(0., 0.8, 0.); glVertex3f(0.0, -1.5, -2.0); glVertex3f(2.0, -1.5, -2.0); glVertex3f(2.0, -1.5, 5.0); glVertex3f(0.0, -1.5, 5.0); glColor3f(0., 0., 0.8); glVertex3f(0.0, -1.5, -5.0); glVertex3f(2.0, -1.5, -5.0); glVertex3f(2.0, -1.5, -2.0); glVertex3f(0.0, -1.5, -2.0); glColor3f(0.4, 0.4, 0.4); glVertex3f(-2.0, -1.5, -5.0); glVertex3f(0.0, -1.5, -5.0); glVertex3f(0.0, -1.5, -2.0); glVertex3f(-2.0, -1.5, -2.0); glEnd(); glEnable(GL_LIGHTING); transp = ambient[3].value < 0.999 || diffuse[3].value < 0.999 || specular[3].value < 0.999; if (transp) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE); } for (i = 0; i < 4; i++) { amb[i] = ambient[i].value; dif[i] = diffuse[i].value; spe[i] = specular[i].value; emi[i] = emission[i].value; } glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, dif); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &shininess[0].value); glutSolidSphere(1.5, 20, 10); if (transp) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } glutSwapBuffers(); glutSetWindow(matwin); } /* display mat properties */ void matDisplay () { pMaterial pm; glutSetWindow(matwin); glClearColor(0.1, 0.1, 0.1, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); pm = &main_scene->material[refmat]; glColor3ub(255, 255, 0); setFont("helvetica", 18); drwstr(10, 20, pm->name); glColor3ub(255, 255, 255); setFont("helvetica", 18); drwstr(30, ambient[0].y, "Ambient("); drwstr(170, ambient[0].y, ","); drwstr(230, ambient[1].y, ","); drwstr(290, ambient[2].y, ","); drwstr(350, ambient[3].y, ");"); cellDraw(&ambient[0]); cellDraw(&ambient[1]); cellDraw(&ambient[2]); cellDraw(&ambient[3]); glColor3ub(255, 255, 255); drwstr(40, diffuse[0].y, "Diffuse("); drwstr(170, diffuse[0].y, ","); drwstr(230, diffuse[1].y, ","); drwstr(290, diffuse[2].y, ","); drwstr(350, diffuse[3].y, ");"); cellDraw(&diffuse[0]); cellDraw(&diffuse[1]); cellDraw(&diffuse[2]); cellDraw(&diffuse[3]); glColor3ub(255, 255, 255); drwstr(25, specular[0].y, "Specular("); drwstr(170, specular[0].y, ","); drwstr(230, specular[1].y, ","); drwstr(290, specular[2].y, ","); drwstr(350, specular[3].y, ");"); cellDraw(&specular[0]); cellDraw(&specular[1]); cellDraw(&specular[2]); cellDraw(&specular[3]); glColor3ub(255, 255, 255); drwstr(25, emission[0].y, "Emission("); drwstr(170, emission[0].y, ","); drwstr(230, emission[1].y, ","); drwstr(290, emission[2].y, ","); drwstr(350, emission[3].y, ");"); cellDraw(&emission[0]); cellDraw(&emission[1]); cellDraw(&emission[2]); cellDraw(&emission[3]); glColor3ub(255, 255, 255); drwstr(20, shininess[0].y, "Shininess("); drwstr(350, shininess[0].y, ");"); cellDraw(&shininess[0]); if (!selection) { glColor3ub(255, 255, 0); setFont("helvetica", 18); drwstr(10, 240, "Click and move the mouse to modify values ('A' to apply)."); } glutSwapBuffers(); } static int old_y = 0; void matMouse (int button, int state, int x, int y) { glutSetWindow(matwin); selection = 0; if (button != GLUT_LEFT_BUTTON) return; if (state == GLUT_DOWN) { /* mouse should only hit _one_ of the cells, so adding up all * the hits just propagates a single hit. */ selection += cellHit(&ambient[0], x, y); selection += cellHit(&ambient[1], x, y); selection += cellHit(&ambient[2], x, y); selection += cellHit(&ambient[3], x, y); selection += cellHit(&diffuse[0], x, y); selection += cellHit(&diffuse[1], x, y); selection += cellHit(&diffuse[2], x, y); selection += cellHit(&diffuse[3], x, y); selection += cellHit(&specular[0], x, y); selection += cellHit(&specular[1], x, y); selection += cellHit(&specular[2], x, y); selection += cellHit(&specular[3], x, y); selection += cellHit(&emission[0], x, y); selection += cellHit(&emission[1], x, y); selection += cellHit(&emission[2], x, y); selection += cellHit(&emission[3], x, y); selection += cellHit(&shininess[0], x, y); } else { /* update material */ glutSetWindow(m_subwin); } old_y = y; glutPostRedisplay(); } static void matMotion (int x, int y) { cellUpdate(&ambient[0], old_y - y); cellUpdate(&ambient[1], old_y - y); cellUpdate(&ambient[2], old_y - y); cellUpdate(&ambient[3], old_y - y); cellUpdate(&diffuse[0], old_y - y); cellUpdate(&diffuse[1], old_y - y); cellUpdate(&diffuse[2], old_y - y); cellUpdate(&diffuse[3], old_y - y); cellUpdate(&specular[0], old_y - y); cellUpdate(&specular[1], old_y - y); cellUpdate(&specular[2], old_y - y); cellUpdate(&specular[3], old_y - y); cellUpdate(&emission[0], old_y - y); cellUpdate(&emission[1], old_y - y); cellUpdate(&emission[2], old_y - y); cellUpdate(&emission[3], old_y - y); cellUpdate(&shininess[0], old_y - y); old_y = y; glutPostRedisplay(); glutSetWindow(m_subwin); glutPostRedisplay(); } void matKeyboard (unsigned char key, int x, int y) { if (isdigit(key)) return; glutSetWindow(matwin); switch (key) { case 'a': case 'A': if (cellCopy(refmat)) matSort(main_scene); matwin = 0; glutHideWindow(); /*glutPostRedisplay();*/ glutSetWindow(main_scene->idwin); doLists(main_scene, cv.mesh[main_scene->idmesh]); glutPostRedisplay(); break; case 'q': case 27: matwin = 0; glutHideWindow(); glutPostRedisplay(); break; } } void matEdit (pScene sc) { /* init window */ if (matwin || refmat < 0) return; matwin = m_subwin = 0; /* create 2d window */ glutInitWindowSize(Width, Height); matwin = glutCreateWindow("Material Properties"); if (!matwin) return; main_scene = sc; /* set callbacks */ glutSetIconTitle("MatProp"); glutReshapeFunc(matReshape); glutDisplayFunc(matDisplay); glutKeyboardFunc(matKeyboard); glutMouseFunc(matMouse); glutMotionFunc(matMotion); /* create 3d sub-window */ glutSetWindow(matwin); m_subwin = glutCreateSubWindow(matwin, 400, 20, 200, 200); if (ddebug) printf("window %d\n", (int)matwin); glutDisplayFunc(matsubDisplay); glutReshapeFunc(matsubReshape); glutSetWindow(matwin); cellInit(refmat); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/dlists.c000644 000767 000024 00000047345 13312446271 017157 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" /* list of element faces */ static int ct[4][3] = {{0, 1, 2}, {0, 3, 1}, {1, 3, 2}, {0, 2, 3}}; static int ch[6][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {0, 3, 7, 4}}; static float redcol[4] = {1.0, 0.0, 0.0, 1.0}; static float greencol[4] = {0.0, 0.6, 0.0, 1.0}; /* build list of triangles */ GLuint listTria (pScene sc, pMesh mesh) { pMaterial pm; pTriangle pt; pPoint p0, p1, p2; GLuint dlist; double dd, ax, ay, az, bx, by, bz; float cx, cy, cz, n[3], pp0[3], pp1[3], pp2[3]; int m, is0, is1, is2, transp; /* default */ if (!mesh->nt) return (0); if (ddebug) printf("create display list / TRIA\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k, mm; mm = sc->matsort[m]; pm = &sc->material[mm]; k = pm->depmat[LTria]; if (!k || pm->flag) continue; transp = 0; if (!(sc->mode & S_MATERIAL)) pm = &sc->material[DEFAULT_MAT]; transp = pm->amb[3] < 0.999 || pm->dif[3] < 0.999 || pm->spe[3] < 0.999; if (transp) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE); } glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glBegin(GL_TRIANGLES); if (sc->type & S_FLAT) { while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.0; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.0; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.0; pp0[0] = sc->shrink * (p0->c[0] - cx) + cx; pp0[1] = sc->shrink * (p0->c[1] - cy) + cy; pp0[2] = sc->shrink * (p0->c[2] - cz) + cz; pp1[0] = sc->shrink * (p1->c[0] - cx) + cx; pp1[1] = sc->shrink * (p1->c[1] - cy) + cy; pp1[2] = sc->shrink * (p1->c[2] - cz) + cz; pp2[0] = sc->shrink * (p2->c[0] - cx) + cx; pp2[1] = sc->shrink * (p2->c[1] - cy) + cy; pp2[2] = sc->shrink * (p2->c[2] - cz) + cz; glNormal3fv(n); glVertex3fv(pp0); glNormal3fv(n); glVertex3fv(pp1); glNormal3fv(n); glVertex3fv(pp2); } else { glNormal3fv(n); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glNormal3fv(n); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); glNormal3fv(n); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); } k = pt->nxt; } } else { while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } is0 = is1 = is2 = 0; if (mesh->extra->iv) { if (pt->v[0] <= mesh->nvn) is0 = mesh->extra->nv[pt->v[0]]; if (pt->v[1] <= mesh->nvn) is1 = mesh->extra->nv[pt->v[1]]; if (pt->v[2] <= mesh->nvn) is2 = mesh->extra->nv[pt->v[2]]; } if (!is0 && pt->v[0] <= mesh->extra->it) is0 = mesh->extra->nt[3 * (k - 1) + 1]; if (!is1 && pt->v[1] <= mesh->extra->it) is1 = mesh->extra->nt[3 * (k - 1) + 2]; if (!is2 && pt->v[2] <= mesh->extra->it) is2 = mesh->extra->nt[3 * (k - 1) + 3]; if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0]) / 3.; cy = (p0->c[1] + p1->c[1] + p2->c[1]) / 3.; cz = (p0->c[2] + p1->c[2] + p2->c[2]) / 3.; pp0[0] = sc->shrink * (p0->c[0] - cx) + cx; pp0[1] = sc->shrink * (p0->c[1] - cy) + cy; pp0[2] = sc->shrink * (p0->c[2] - cz) + cz; pp1[0] = sc->shrink * (p1->c[0] - cx) + cx; pp1[1] = sc->shrink * (p1->c[1] - cy) + cy; pp1[2] = sc->shrink * (p1->c[2] - cz) + cz; pp2[0] = sc->shrink * (p2->c[0] - cx) + cx; pp2[1] = sc->shrink * (p2->c[1] - cy) + cy; pp2[2] = sc->shrink * (p2->c[2] - cz) + cz; if (!is0) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is0 - 1) + 1]); glVertex3fv(pp0); if (!is1) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is1 - 1) + 1]); glVertex3fv(pp1); if (!is2) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is2 - 1) + 1]); glVertex3fv(pp2); } else { if (!is0) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is0 - 1) + 1]); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); if (!is1) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is1 - 1) + 1]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); if (!is2) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is2 - 1) + 1]); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); } k = pt->nxt; } } glEnd(); if (transp) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } } glEndList(); return (dlist); } /* build list of quadrilaterals */ GLuint listQuad (pScene sc, pMesh mesh) { pMaterial pm; pQuad pq; pPoint p0, p1, p2, p3; GLuint dlist = 0; double ax, ay, az, bx, by, bz, dd; float cx, cy, cz, n[3], pp0[3], pp1[3], pp2[3], pp3[3]; int m, is0, is1, is2, is3, transp; /* default */ if (!mesh->nq) return (0); if (ddebug) printf("create display list / QUADS\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k, mm; mm = sc->matsort[m]; pm = &sc->material[mm]; k = pm->depmat[LQuad]; if (!k || pm->flag) continue; transp = 0; if (!(sc->mode & S_MATERIAL)) pm = &sc->material[DEFAULT_MAT]; transp = pm->amb[3] < 0.999 || pm->dif[3] < 0.999 || pm->spe[3] < 0.999; if (transp) { glEnable(GL_BLEND); glDepthMask(GL_FALSE); glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glBegin(GL_QUADS); if (sc->type & S_FLAT) { while (k != 0) { pq = &mesh->quad[k]; if (pq->v[0] == 0) { k = pq->nxt; continue; } p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]) / 4.; cy = (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]) / 4.; cz = (p0->c[2] + p1->c[2] + p2->c[2] + p3->c[2]) / 4.; pp0[0] = sc->shrink * (p0->c[0] - cx) + cx; pp0[1] = sc->shrink * (p0->c[1] - cy) + cy; pp0[2] = sc->shrink * (p0->c[2] - cz) + cz; pp1[0] = sc->shrink * (p1->c[0] - cx) + cx; pp1[1] = sc->shrink * (p1->c[1] - cy) + cy; pp1[2] = sc->shrink * (p1->c[2] - cz) + cz; pp2[0] = sc->shrink * (p2->c[0] - cx) + cx; pp2[1] = sc->shrink * (p2->c[1] - cy) + cy; pp2[2] = sc->shrink * (p2->c[2] - cz) + cz; pp3[0] = sc->shrink * (p3->c[0] - cx) + cx; pp3[1] = sc->shrink * (p3->c[1] - cy) + cy; pp3[2] = sc->shrink * (p3->c[2] - cz) + cz; glNormal3fv(n); glVertex3fv(pp0); glNormal3fv(n); glVertex3fv(pp1); glNormal3fv(n); glVertex3fv(pp2); glNormal3fv(n); glVertex3fv(pp3); } else { glNormal3fv(n); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); glNormal3fv(n); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); glNormal3fv(n); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); glNormal3fv(n); glVertex3f(p3->c[0], p3->c[1], p3->c[2]); } k = pq->nxt; } } else { while (k != 0) { pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } p0 = &mesh->point[pq->v[0]]; p1 = &mesh->point[pq->v[1]]; p2 = &mesh->point[pq->v[2]]; p3 = &mesh->point[pq->v[3]]; /* compute normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; dd = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (dd > 0.0) { dd = 1.0 / sqrt(dd); n[0] *= dd; n[1] *= dd; n[2] *= dd; } is0 = is1 = is2 = is3 = 0; if (mesh->extra->iv) { if (pq->v[0] <= mesh->nvn) is0 = mesh->extra->nv[pq->v[0]]; if (pq->v[1] <= mesh->nvn) is1 = mesh->extra->nv[pq->v[1]]; if (pq->v[2] <= mesh->nvn) is2 = mesh->extra->nv[pq->v[2]]; if (pq->v[3] <= mesh->nvn) is3 = mesh->extra->nv[pq->v[3]]; } if (!is0 && pq->v[0] <= mesh->extra->iq) is0 = mesh->extra->nq[4 * (k - 1) + 1]; if (!is1 && pq->v[1] <= mesh->extra->iq) is1 = mesh->extra->nq[4 * (k - 1) + 2]; if (!is2 && pq->v[2] <= mesh->extra->iq) is2 = mesh->extra->nq[4 * (k - 1) + 3]; if (!is3 && pq->v[3] <= mesh->extra->iq) is3 = mesh->extra->nq[4 * (k - 1) + 4]; if (sc->shrink < 1.0) { cx = (p0->c[0] + p1->c[0] + p2->c[0] + p3->c[0]) / 4.; cy = (p0->c[1] + p1->c[1] + p2->c[1] + p3->c[1]) / 4.; cz = (p0->c[2] + p1->c[2] + p2->c[2] + p3->c[2]) / 4.; pp0[0] = sc->shrink * (p0->c[0] - cx) + cx; pp0[1] = sc->shrink * (p0->c[1] - cy) + cy; pp0[2] = sc->shrink * (p0->c[2] - cz) + cz; pp1[0] = sc->shrink * (p1->c[0] - cx) + cx; pp1[1] = sc->shrink * (p1->c[1] - cy) + cy; pp1[2] = sc->shrink * (p1->c[2] - cz) + cz; pp2[0] = sc->shrink * (p2->c[0] - cx) + cx; pp2[1] = sc->shrink * (p2->c[1] - cy) + cy; pp2[2] = sc->shrink * (p2->c[2] - cz) + cz; pp3[0] = sc->shrink * (p3->c[0] - cx) + cx; pp3[1] = sc->shrink * (p3->c[1] - cy) + cy; pp3[2] = sc->shrink * (p3->c[2] - cz) + cz; if (!is0) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is0 - 1) + 1]); glVertex3fv(pp0); if (!is1) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is1 - 1) + 1]); glVertex3fv(pp1); if (!is2) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is2 - 1) + 1]); glVertex3fv(pp2); if (!is3) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is3 - 1) + 1]); glVertex3fv(pp3); } else { if (!is0) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is0 - 1) + 1]); glVertex3f(p0->c[0], p0->c[1], p0->c[2]); if (!is1) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is1 - 1) + 1]); glVertex3f(p1->c[0], p1->c[1], p1->c[2]); if (!is2) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is2 - 1) + 1]); glVertex3f(p2->c[0], p2->c[1], p2->c[2]); if (!is3) glNormal3fv(n); else glNormal3fv(&mesh->extra->n[3 * (is3 - 1) + 1]); glVertex3f(p3->c[0], p3->c[1], p3->c[2]); } k = pq->nxt; } } glEnd(); if (transp) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } } glEndList(); return (dlist); } /* build list of tetrahedra */ GLuint listTetra (pScene sc, pMesh mesh, ubyte clip) { pMaterial pm; pTetra pt; pPoint p0, p1, p2; GLuint dlist; double ax, ay, az, bx, by, bz, d; float n[3], shrink, cx, cy, cz; int l, m; if (!mesh->ntet) return (0); if (ddebug) printf("create 3d display list w. materials\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); shrink = min(sc->shrink, 0.995); /* scan tetra */ for (m = 0; m < sc->par.nbmat; m++) { int k, mm; mm = sc->matsort[m]; pm = &sc->material[mm]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; if (sc->mode & S_MATERIAL) { if (pm->dif[3] < 0.999) { glDepthMask(GL_FALSE); glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); } glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); } else { glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, redcol); } /* display triangular faces */ glBegin(GL_TRIANGLES); while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || (clip && !pt->clip)) { k = pt->nxt; continue; } /* build 4 faces */ cx = cy = cz = 0.; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; } cx *= 0.25; cy *= 0.25; cz *= 0.25; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[ct[l][0]]]; p1 = &mesh->point[pt->v[ct[l][1]]]; p2 = &mesh->point[pt->v[ct[l][2]]]; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(shrink * (p0->c[0] - cx) + cx, shrink * (p0->c[1] - cy) + cy, shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p1->c[0] - cx) + cx, shrink * (p1->c[1] - cy) + cy, shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p2->c[0] - cx) + cx, shrink * (p2->c[1] - cy) + cy, shrink * (p2->c[2] - cz) + cz); } k = pt->nxt; } glEnd(); if (sc->mode & S_MATERIAL && pm->dif[3] < 0.999) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } } glEndList(); return (dlist); } /* build list of hexahedra */ GLuint listHexa (pScene sc, pMesh mesh, ubyte clip) { pMaterial pm; pHexa ph; pPoint p0, p1, p2, p3; GLuint dlist; double ax, ay, az, bx, by, bz, d; float n[3], cx, cy, cz, shrink; int l, m; if (!mesh->nhex) return (0); if (ddebug) printf("create 3d display list w. materials\n"); /* build display list */ dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); shrink = min(sc->shrink, 0.995); /* scan hexa */ for (m = 0; m < sc->par.nbmat; m++) { int k, mm; mm = sc->matsort[m]; pm = &sc->material[mm]; k = pm->depmat[LHexa]; if (!k || pm->flag) continue; if (sc->mode & S_MATERIAL) { if (pm->dif[3] < 0.999) { glDepthMask(GL_FALSE); glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); } glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); } else { glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, greencol); } /* display quadrilateral faces */ glBegin(GL_QUADS); while (k != 0) { ph = &mesh->hexa[k]; if (!ph->v[0] || (clip && !ph->clip)) { k = ph->nxt; continue; } /* build 6 faces */ cx = cy = cz = 0.; for (l = 0; l < 8; l++) { p0 = &mesh->point[ph->v[l]]; cx += p0->c[0]; cy += p0->c[1]; cz += p0->c[2]; } cx /= 8.; cy /= 8.; cz /= 8.; for (l = 0; l < 6; l++) { p0 = &mesh->point[ph->v[ch[l][0]]]; p1 = &mesh->point[ph->v[ch[l][1]]]; p2 = &mesh->point[ph->v[ch[l][2]]]; p3 = &mesh->point[ph->v[ch[l][3]]]; /* compute face normal */ ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; az = p1->c[2] - p0->c[2]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; bz = p2->c[2] - p0->c[2]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glNormal3fv(n); glVertex3f(shrink * (p0->c[0] - cx) + cx, shrink * (p0->c[1] - cy) + cy, shrink * (p0->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p1->c[0] - cx) + cx, shrink * (p1->c[1] - cy) + cy, shrink * (p1->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p2->c[0] - cx) + cx, shrink * (p2->c[1] - cy) + cy, shrink * (p2->c[2] - cz) + cz); glNormal3fv(n); glVertex3f(shrink * (p3->c[0] - cx) + cx, shrink * (p3->c[1] - cy) + cy, shrink * (p3->c[2] - cz) + cz); } k = ph->nxt; } glEnd(); if (sc->mode & S_MATERIAL && pm->dif[3] < 0.999) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } } glEndList(); return (dlist); } freefem++-3.61-1/src/medit/medit.c000644 000767 000024 00000026611 13312446271 016750 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : Mesh visualization tool /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "compil.date" #ifdef ppc #include #endif /* global variables (see extern.h) */ GLboolean hasStereo = 1; Canvas cv; mytime ctim[TIMEMAX]; ubyte ddebug, animate, saveimg, imgtype, infogl, fullscreen; ubyte quiet, option, morphing, stereoMode; int menu, amenu, fmenu, femenu, vmenu, mmenu, smenu; int clmenu, cmenu, vwmenu, txmenu, trmenu; int animdep, animfin; /**********************/ /* Rajout pour popen */ ubyte dpopen, dpopensol, dpopenbin; static void excfun (int sigid) { fprintf(stdout, "\n Unexpected error:"); fflush(stdout); switch (sigid) { case SIGABRT: fprintf(stdout, " Abnormal stop\n"); break; case SIGFPE: fprintf(stdout, " Floating-point exception\n"); break; case SIGILL: fprintf(stdout, " Illegal instruction\n"); break; case SIGSEGV: fprintf(stdout, " Segmentation fault\n"); break; case SIGTERM: case SIGINT: fprintf(stdout, " Program killed\n"); break; } exit(1); } static void endcod () { chrono(OFF, &ctim[0]); fprintf(stdout, "\n Total running seconds: %.2f\n", gttime(ctim[0])); fprintf(stdout, " Thank you for using Medit.\n"); } static void grInfo (void) { GLboolean b; GLint i; glutCreateWindow("Info"); fprintf(stdout, "Graphic info:\n"); fprintf(stdout, " GL Vendor:\t%s\n", glGetString(GL_VENDOR)); fprintf(stdout, " GL Version:\t%s\n", glGetString(GL_VERSION)); fprintf(stdout, " GL Renderer:\t%s\n\n", glGetString(GL_RENDERER)); glGetBooleanv(GL_RGBA_MODE, &b); if (b) fprintf(stdout, " RGBA Mode\n"); glGetBooleanv(GL_DOUBLEBUFFER, &b); if (b) fprintf(stdout, " Double Buffer\n"); glGetBooleanv(GL_STEREO, &b); if (b) fprintf(stdout, " Stereo\n"); glGetIntegerv(GL_AUX_BUFFERS, &i); if (i) fprintf(stdout, " Auxilary Buffers\t%2d\n", (int)i); glGetIntegerv(GL_INDEX_BITS, &i); if (i) fprintf(stdout, " Index Bits\t\t%2d\n", (int)i); glGetIntegerv(GL_RED_BITS, &i); fprintf(stdout, " RGBA Bits\t\t%2d", (int)i); glGetIntegerv(GL_GREEN_BITS, &i); fprintf(stdout, "\t%2d", (int)i); glGetIntegerv(GL_BLUE_BITS, &i); fprintf(stdout, "\t%2d", (int)i); glGetIntegerv(GL_ALPHA_BITS, &i); fprintf(stdout, "\t%2d\n", (int)i); glGetIntegerv(GL_ACCUM_RED_BITS, &i); fprintf(stdout, " Accum RGBA Bits\t%2d", (int)i); glGetIntegerv(GL_ACCUM_GREEN_BITS, &i); fprintf(stdout, "\t%2d", (int)i); glGetIntegerv(GL_ACCUM_BLUE_BITS, &i); fprintf(stdout, "\t%2d", (int)i); glGetIntegerv(GL_ACCUM_ALPHA_BITS, &i); fprintf(stdout, "\t%2d\n", (int)i); glGetIntegerv(GL_DEPTH_BITS, &i); fprintf(stdout, " Depth Bits\t\t%2d\n", (int)i); glGetIntegerv(GL_STENCIL_BITS, &i); fprintf(stdout, " Stencil Bits\t\t%2d\n", (int)i); exit(1); } int medit0 () { char data[128]; int k, l; clock_t ct; /* default */ // fprintf(stdout," \n medit0() \n"); fprintf(stdout, " Loading data file(s)\n"); ct = clock(); /* enter name */ if (!cv.nbm) { char *name; fprintf(stdout, " File name(s) missing. Please enter : "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fgets(data, 120, stdin); if (!strlen(data)) { fprintf(stdout, " ## No data\n"); return (0); } /* parse file name(s) */ name = strtok(data, " \n"); while (name) { if (!cv.mesh[cv.nbm]) { cv.mesh[cv.nbm] = (pMesh)M_calloc(1, sizeof(Mesh), "medit0.mesh"); if (!cv.mesh[cv.nbm]) return (0); } /*(cv.mesh[cv.nbm])->name = calloc(strlen(name)+1,sizeof(char));*/ strcpy(cv.mesh[cv.nbm]->name, name); name = strtok(NULL, " \n\0"); if (++cv.nbm == MAX_MESH) break; } if (!cv.nbm) return (0); } if (!cv.nbm) { fprintf(stdout, " Number of mesh missing:. Please enter : "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fgets(data, 120, stdin); cv.nbm = atoi(data); } /* read mesh(es) */ k = 0; do { pMesh mesh; int ret; if (!cv.mesh[k]) { cv.mesh[k] = M_calloc(1, sizeof(Mesh), "medit0.mesh"); if (!cv.mesh[k]) return (0); } mesh = cv.mesh[k]; mesh->typ = 0; ret = loadMesh(mesh); if (ret < 0) { mesh->typ = 1; ret = inmsh2(mesh); if (!ret) { mesh->typ = 2; ret = loadGIS(mesh); } } if (ret <= 0) { for (l = k + 1; l < cv.nbm; l++) { cv.mesh[l - 1] = cv.mesh[l]; } cv.nbm--; k--; continue; } /* compute mesh box */ if ((mesh->ntet && !mesh->nt) || (mesh->nhex && !mesh->nq)) meshSurf(mesh); meshBox(mesh, 1); if (!quiet) meshInfo(mesh); /* read metric */ if (!loadSol(mesh, mesh->name, 1)) bbfile(mesh); if (!quiet && mesh->nbb) fprintf(stdout, " Solutions %8d\n", mesh->nbb); } while (++k < cv.nbm); cv.nbs = cv.nbm; ct = difftime(clock(), ct); fprintf(stdout, " Input seconds: %.2f\n", (double)ct / (double)CLOCKS_PER_SEC); return (cv.nbm); } int medit0_popen () { int k; clock_t ct; /* default */ /*fprintf(stdout," \n medit0() \n");*/ fprintf(stdout, " Loading data file(s)\n"); ct = clock(); /* enter number of mesh */ if (!cv.nbm) { char data[128]; fprintf(stdout, " Number of mesh missing:. Please enter : "); fflush(stdout); while(fgetc(stdin)!=EOF); //fflush() called on input stream 'stdin' may result in undefined behaviour on non-linux systems fgets(data, 128, stdin); cv.nbm = atoi(data); } /* read mesh(es) */ k = 0; do { pMesh mesh; // printf("mesh number %i\n",k+1); if (!cv.mesh[k]) { cv.mesh[k] = M_calloc(1, sizeof(Mesh), "medit0.mesh"); if (!cv.mesh[k]) return (0); } mesh = cv.mesh[k]; mesh->typ = 0; // fgets(data,128,stdin); // name = data; // printf("data=%s\n",data); // name = "toto.dat"; // strcpy(cv.mesh[k]->name,name); if (dpopenbin) loadMesh_popen_bin(mesh); else loadMesh_popen(mesh); /* compute mesh box */ if ((mesh->ntet && !mesh->nt) || (mesh->nhex && !mesh->nq)) meshSurf(mesh); meshBox(mesh, 1); if (!quiet) meshInfo(mesh); /* /\* read metric *\/ // a changer lecture .sol et .bb */ /* if ( !loadSol_popen(mesh,mesh->name,1) ) */ /* bbfile_popen(mesh); */ /* if ( !quiet && mesh->nbb ) */ /* fprintf(stdout," Solutions %8d\n",mesh->nbb); */ if (dpopensol) { if (dpopenbin) loadSol_popen_bin(mesh, mesh->name, 1); else loadSol_popen(mesh, mesh->name, 1); } if (!quiet && mesh->nbb) fprintf(stdout, " Solutions %8d\n", mesh->nbb); } while (++k < cv.nbm); cv.nbs = cv.nbm; ct = difftime(clock(), ct); fprintf(stdout, " Input seconds: %.2f\n", (double)ct / (double)CLOCKS_PER_SEC); return (cv.nbm); } int medit1 () { int k; clock_t ct; /* create grafix */ fprintf(stdout, "\n medit1() \n"); fprintf(stdout, "\n Building scene(s)\n"); ct = clock(); for (k = 0; k < cv.nbs; k++) { pScene scene; pMesh mesh; if (!cv.scene[k]) { cv.scene[k] = (pScene)M_calloc(1, sizeof(Scene), "medit1.scene"); if (!cv.scene[k]) return (0); } scene = cv.scene[k]; if (!cv.mesh[k]) { cv.mesh[k] = (pMesh)M_calloc(1, sizeof(Mesh), "medit1.mesh"); if (!cv.mesh[k]) return (0); } mesh = cv.mesh[k]; fprintf(stdout, " Creating scene %d\n", k + 1); parsop(scene, mesh); meshRef(scene, mesh); matSort(scene); if (option == ISOSURF) { if (!mesh->nbb) return (0); setupPalette(scene, mesh); tetraIsoPOVray(scene, mesh); } else if (!createScene(scene, k)) { fprintf(stderr, " ## Unable to create scene\n"); return (0); } } ct = difftime(clock(), ct); fprintf(stdout, " Scene seconds: %.2f\n", (double)ct / (double)CLOCKS_PER_SEC); return (1); } int main (int argc, char *argv []) { int type; char pwd[1024]; #ifdef ppc if (!getwd(pwd)) exit(2); #endif fprintf(stdout, " -- Medit, Release %s (%s)\n", ME_VER, ME_REL); fprintf(stdout, " %s.\n", ME_CPY); fprintf(stdout, " compiled: %s.\n\n", COMPIL); /* trap exceptions */ signal(SIGABRT, excfun); signal(SIGFPE, excfun); signal(SIGILL, excfun); signal(SIGSEGV, excfun); signal(SIGTERM, excfun); signal(SIGINT, excfun); atexit(endcod); tminit(ctim, TIMEMAX); chrono(ON, &ctim[0]); /* default values */ option = STANDARD; saveimg = GL_FALSE; imgtype = P6; animate = FALSE; morphing = FALSE; fullscreen = FALSE; animdep = 0; animfin = 0; ddebug = FALSE; quiet = TRUE; // FALSE; stereoMode = 0; cv.nbm = cv.nbs = 0; /* default value for popen */ dpopen = FALSE; dpopenbin = FALSE; dpopensol = FALSE; /* init grafix */ parsar(argc, argv); // printf("fin de parsar"); if (option == ISOSURF) { fprintf(stdout, "ISOSURF"); if (!medit0()) exit(1); if (!medit1()) exit(1); return (0); } glutInit(&argc, argv); // printf("fin de glutInit"); #ifdef ppc chdir(pwd); #endif chrono(ON, &ctim[0]); if (stereoMode == MONO) type = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH; else type = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STEREO; glutInitDisplayMode(type); if (infogl) grInfo(); /* call animate or normal mode */ if (dpopen == FALSE) { switch (option) { case STANDARD: case SCHNAUZER: if (!medit0()) exit(1); if (!medit1()) exit(1); break; case SEQUENCE: if (!animat()) exit(1); break; case SEQUENCE + PARTICLE: if (!animat()) exit(1); break; case MORPHING: if (!medit0()) exit(1); if (!modeMorphing()) exit(1); morphing = GL_FALSE; break; default: fprintf(stderr, " ## Unrecognized option %d\n", option); exit(1); break; } } else { switch (option) { case STANDARD: case SCHNAUZER: if (!medit0_popen()) exit(1); if (!medit1()) exit(1); break; case SEQUENCE: if (!animat()) exit(1); break; case SEQUENCE + PARTICLE: if (!animat()) exit(1); break; case MORPHING: if (!medit0_popen()) exit(1); if (!modeMorphing()) exit(1); morphing = GL_FALSE; break; default: fprintf(stderr, " ## Unrecognized option %d\n", option); exit(1); break; } } /* main grafix loop */ fprintf(stdout, "\n Rendering scene(s)\n"); glGetBooleanv(GL_STEREO, &hasStereo); glutMainLoop(); return (0); } freefem++-3.61-1/src/medit/parsar.c000644 000767 000024 00000013033 13312446271 017130 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : Parse arguments from command line /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" short schw, schh; extern ubyte option, infogl, fullscreen, dosurf, stereoMode; /********************/ /* rajout popen */ extern ubyte dpopen; extern ubyte dpopenbin; extern ubyte dpopensol; void usage () { fprintf(stdout, "Usage: medit [options] [f1 .. fn]\n"); fprintf(stdout, "\n** Generic options :\n"); fprintf(stdout, "-d \t Debug mode (lot of info)\n"); fprintf(stdout, "-fs\t Fullscreen mode\n"); fprintf(stdout, "-h \t Print this message\n"); fprintf(stdout, "-i \t Print info on OpenGL configuration\n"); fprintf(stdout, "-l \t Process very large files\n"); fprintf(stdout, "-s \t Do no build surface\n"); fprintf(stdout, "-v \t Turn off quiet mode\n"); fprintf(stdout, "f1..fn\t Input data file(s)\n"); fprintf(stdout, "\n** Graphic options\n"); fprintf(stdout, "-a start stop\t Animation sequence\n"); fprintf(stdout, "-m Morphing\n"); fprintf(stdout, "-xv width height\t Visual Schnauzer\n"); fprintf(stdout, "-stereo\t Stereo mode\n"); fprintf(stdout, "\n"); exit(1); } int parsar (int argc, char *argv []) { pMesh mesh; int i; int k; /* default*/ cv.nbm = cv.nbs = 0; i = 1; infogl = FALSE; dosurf = 1; stereoMode = MONO; while (i < argc) { if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-help")) { usage(); } else if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "-debug")) { ddebug = TRUE; } // Rajout de l option popen else if (!strcmp(argv[i], "-popen")) { // printf("valeur de i=%i \n",i); dpopen = TRUE; if (!strcmp(argv[i + 1], "-filebin")) { dpopenbin = TRUE; i = i + 1; } if (!strcmp(argv[i + 1], "-addsol")) { dpopensol = TRUE; i = i + 1; } if (dpopensol == TRUE && dpopenbin == TRUE) printf("medit with binary version of popen : mesh(es) and solution(s) \n"); else if (dpopensol == FALSE && dpopenbin == TRUE) printf("medit with binary version of popen : mesh(es) \n"); else if (dpopensol == TRUE && dpopenbin == FALSE) printf("medit with popen : mesh(es) and solution(s) \n"); else printf("medit with popen : mesh(es) \n"); if (i + 1 != argc) { // printf("valeur de i=%i \n",i); cv.nbm = atoi(argv[i + 1]); // printf("number of mesh= %i\n",cv.nbm); i++; if (cv.nbm == 0) return (0); } for (k = 0; k < cv.nbm; k++) { // printf("valeur de i=%i \n",i); cv.mesh[k] = (pMesh)M_calloc(1, sizeof(Mesh), "parsar.mesh"); if (!cv.mesh[k]) return (0); mesh = cv.mesh[k]; strcpy(mesh->name, argv[i + 1]); printf("mesh_name= %s\n", mesh->name); i++; } // assert(i==argc); } // Fin Rajout de popen else if (!strcmp(argv[i], "-i")) { infogl = TRUE; } else if (!strcmp(argv[i], "-fs")) { fullscreen = TRUE; } else if (!strcmp(argv[i], "-l")) { option = VERYBIG; } else if (!strcmp(argv[i], "-m")) { option = MORPHING; } else if (!strcmp(argv[i], "-iso")) { option = ISOSURF; } else if (!strcmp(argv[i], "-stereo")) { stereoMode = LEFT + RIGHT; } else if (!strcmp(argv[i], "-s")) { dosurf = 0; } else if (!strcmp(argv[i], "-v")) { quiet = 0; } else if (!strcmp(argv[i], "-xv")) { if (++i < argc && isdigit(argv[i][0])) schw = atoi(argv[i]); else usage(); if (++i < argc && isdigit(argv[i][0])) schh = atoi(argv[i]); else usage(); option = SCHNAUZER; } else if (!strcmp(argv[i], "-a")) { option = SEQUENCE; if (++i < argc && isdigit(argv[i][0])) animdep = atoi(argv[i]); if (++i < argc && isdigit(argv[i][0])) animfin = atoi(argv[i]); } else if (!strcmp(argv[i], "-p")) { option = SEQUENCE + PARTICLE; if (++i < argc && isdigit(argv[i][0])) animdep = atoi(argv[i]); if (++i < argc && isdigit(argv[i][0])) animfin = atoi(argv[i]); } else { if (!cv.mesh[cv.nbm]) { cv.mesh[cv.nbm] = (pMesh)M_calloc(1, sizeof(Mesh), "parsar.mesh"); if (!cv.mesh[cv.nbm]) return (0); } mesh = cv.mesh[cv.nbm]; /*mesh->name = argv[i];*/ strcpy(mesh->name, argv[i]); if (ddebug) printf("parsar: mesh[%d] %s\n", cv.nbm, mesh->name); if (++cv.nbm == MAX_MESH) return (1); } i++; } return (1); } freefem++-3.61-1/src/medit/extern.h000644 000767 000024 00000003124 13312446271 017152 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifndef __MEDIT extern Canvas cv; extern ubyte ddebug, quiet, imprim, option, morphing, animate, saveimg, imgtype; extern int animdep, animfin; extern char *imgtyp []; #endif freefem++-3.61-1/src/medit/camera.c000644 000767 000024 00000011275 13312446271 017076 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include "medit.h" #include "extern.h" #include "sproto.h" double Azimuth (pCamera c) { double dd, azim, cosazim, sinazim; dd = sqrt((double)c->speed[0] * c->speed[0] + (double)c->speed[2] * c->speed[2]); cosazim = c->speed[2] / dd; sinazim = c->speed[0] / dd; azim = atan2(sinazim, cosazim) * RTOD; return (azim); } double Elevation (pCamera c) { double elev; elev = sqrt((double)c->speed[0] * c->speed[0] + (double)c->speed[2] * c->speed[2]); elev = atan2(c->speed[1], elev) * RTOD; return (elev); } /* compute new sun position */ void updateSun (pScene sc, pCamera c) { double dd; GLfloat axe[3], sunf[4]; GLdouble speed[3], sunp[4], matrix[16]; axe[0] = c->speed[2]; axe[1] = 0.0f; axe[2] = -c->speed[0]; dd = sqrt(axe[0] * axe[0] + axe[2] * axe[2]); if (dd != 0.0f) { axe[0] /= dd; axe[2] /= dd; } speed[0] = c->speed[0]; speed[1] = c->speed[1]; speed[2] = c->speed[2]; glPushMatrix(); glLoadIdentity(); glRotatef(-30.0f, axe[0], axe[1], axe[2]); glGetDoublev(GL_MODELVIEW_MATRIX, matrix); glPopMatrix(); transformPointd(sunp, speed, matrix); sunf[0] = -sc->dmax * sunp[0]; sunf[1] = -sc->dmax * sunp[1]; sunf[2] = -sc->dmax * sunp[2]; sunf[3] = 0.0; glLightfv(GL_LIGHT0, GL_POSITION, sunf); if (ddebug) { printf(" speed %g %g %g\n", c->speed[0], c->speed[1], c->speed[2]); printf(" axe %g %g %g\n", axe[0], axe[1], axe[2]); printf(" sunpos %g %g %g\n", sunp[0], sunp[1], sunp[2]); } } void updateCamera (pScene sc, pCamera c, double azim, double elev) { double d, lazim, lelev; /* compute speed vector */ if (elev > 89.0f) elev = 89.0; else if (elev < -89.0f) elev = -89.0; lazim = azim * DTOR; lelev = elev * DTOR; c->speed[0] = sin(lazim) * cos(lelev); c->speed[1] = sin(lelev); c->speed[2] = cos(lazim) * cos(lelev); d = (double)c->speed[0] * sc->par.sunpos[0] + c->speed[1] * sc->par.sunpos[1] + c->speed[2] * sc->par.sunpos[2]; d = d / sqrt((double)sc->par.sunpos[0] * sc->par.sunpos[0] + sc->par.sunpos[1] * sc->par.sunpos[1] + sc->par.sunpos[2] * sc->par.sunpos[2]); d = acos(d); if (fabs(d) > 0.10 * sc->persp->fovy * DTOR) updateSun(sc, c); } pCamera initCamera (pScene sc, int up) { pCamera c; pMesh mesh; double dd; if (ddebug) printf(" initCamera dmax %g\n", sc->dmax); if (sc->camera) {c = sc->camera;} else { c = (pCamera)M_calloc(1, sizeof(struct camera), "camera"); if (!c) { printf(" ## unable to allocate memory / camera\n"); exit(1); } } /* adjust coeffs */ mesh = cv.mesh[sc->idmesh]; c->eye[0] = c->eye[1] = 0.0; c->eye[2] = sc->dmax; c->vecup = up; c->speed[0] = 0.0; c->speed[1] = 0.0; c->speed[2] = c->eye[2]; dd = -1.0 / sqrt(c->speed[2] * c->speed[2]); c->speed[2] *= dd; c->spmod = 0.01 * sc->dmax; c->altinc = 0.01 * (mesh->ymax - mesh->ymin); /* set sun position */ updateSun(sc, c); if (ddebug) { double look[3]; look[0] = c->eye[0] + sc->dmax * c->speed[0]; look[1] = c->eye[1] + sc->dmax * c->speed[1]; look[2] = c->eye[2] + sc->dmax * c->speed[2]; printf(" eye %g %g %g\n", c->eye[0], c->eye[1], c->eye[2]); printf(" speed %g %g %g\n", c->speed[0], c->speed[1], c->speed[2]); printf(" look %g %g %g\n", look[0], look[1], look[2]); } return (c); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/scissor.c000644 000767 000024 00000010147 13312446271 017330 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" void scissorScene () { pScene sc; pPersp p; pTransform view; int width, height; /* default */ if (ddebug) printf("enable scissoring\n"); sc = cv.scene[currentScene()]; view = sc->view; p = sc->persp; /* subdivide main window */ glViewport(0, 0, sc->par.xs, sc->par.ys); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, sc->par.xs, 0, sc->par.ys); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(sc->par.back[0], sc->par.back[1], sc->par.back[2], sc->par.back[3]); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* split window */ glDisable(GL_LIGHTING); glColor4fv(sc->par.line); glBegin(GL_LINES); glVertex2i(sc->par.xs / 2, 0); glVertex2i(sc->par.xs / 2, sc->par.ys); glVertex2i(0, sc->par.ys / 2); glVertex2i(sc->par.xs, sc->par.ys / 2); glEnd(); glEnable(GL_LIGHTING); width = (sc->par.xs + 1) / 2; height = (sc->par.ys + 1) / 2; glDisable(GL_LIGHTING); glColor4fv(sc->par.line); output2(5, sc->par.ys / 2 + 5, "Top"); output2(5, 5, "Front"); output2(sc->par.xs / 2 + 5, 5, "Right"); glEnable(GL_SCISSOR_TEST); /* draw top right : normal */ glViewport(width, height, width, height); glScissor(width, height, width, height); farclip(1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -p->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glMultMatrixf(view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModel(sc); if (sc->type & S_DECO) redrawStatusBar(sc); /* draw top left : top view */ glViewport(0, height, width, height); glScissor(0, height, width, height); farclip(1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -p->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glTranslatef(sc->cx, sc->cy, sc->cz); glRotatef(-90, 0.0, 0.0, 1.0); glTranslatef(view->opanx, 0., 0.); drawModel(sc); /* draw bottom left : front */ glViewport(0, 0, width, height); glScissor(0, 0, width, height); farclip(1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -p->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glTranslatef(sc->cx, sc->cy, sc->cz); glRotatef(-90.0, 1.0, 0.0, 0.0); glTranslatef(view->opanx, 0., 0.); drawModel(sc); /* draw bottom right : right */ glViewport(width, 0, width, height); glScissor(width, 0, width, height); farclip(1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0., 0., -p->depth, 0., 0., 0., 0.0, 1.0, 0.0); setupView(sc); glRotatef(-90.0, 1.0, 0.0, 0.0); glRotatef(-90.0, 0.0, 0.0, 1.0); glTranslatef(0., view->opany, 0.); drawModel(sc); glutSwapBuffers(); glDisable(GL_SCISSOR_TEST); glViewport(0, 0, sc->par.xs, sc->par.ys); if (saveimg) keyFile('H', 0, 0); } freefem++-3.61-1/src/medit/tiles.c000644 000767 000024 00000020304 13312446271 016757 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "sproto.h" #include "extern.h" extern ubyte ddebug; ubyte tiling; #define IN2CM 2.54 #define CM2IN 0.3937 void dumpTile (char *data, int width, int height, GLubyte *buffer) { FILE *out2; out2 = fopen(data, "w"); fprintf(out2, "P6\n"); fprintf(out2, "# Created using medit %s %s, (c) INRIA\n", ME_VER, ME_REL); fprintf(out2, "%d %d\n", width, height); fprintf(out2, "255\n"); fwrite(buffer, sizeof(GLubyte), width * height * 3, out2); fclose(out2); } /* dump big image */ int imgTiling (pScene sc, char *data, char key) { FILE *out; pCamera c = sc->camera; GLubyte *tile, *buffer, *rowPtr; GLint matmode, viewport[4]; double xmin, xmax, ymin, ymax, left, right, top, bottom, ratio; float finhaut, finlarg, look[3]; int i, tw, th, col, row, nbcol, nbrow; int imgWidth, imgHeight, tileWidth, tileHeight, tileWidthNB, tileHeightNB; int bitsTileRow, bitsImgOffset, bitsCurTileRow, border; int bitsTileOffset, bitsPixel, imgRowSize; char *ptr, name[256]; ubyte bckbyte; static GLfloat up[3] = {0.0, 1.0, 0.0}; glPixelStorei(GL_PACK_ALIGNMENT, 1); bckbyte = (ubyte)(255 * (0.30 * sc->par.back[0] + 0.59 * sc->par.back[1] + 0.11 * sc->par.back[2]) + 0.5); /* compute image size */ ratio = (double)sc->par.xs / (double)sc->par.ys; ymax = 0.1f * sc->dmax * tan(sc->persp->fovy * M_PI / 360.0); ymin = -ymax; xmin = ymin * ratio; xmax = ymax * ratio; bitsPixel = 3 * sizeof(GLubyte); imgWidth = (int)(sc->par.dpi * CM2IN * sc->par.cm + 0.5); imgHeight = (int)((double)imgWidth / ratio + 0.5); imgRowSize = imgWidth * bitsPixel; tileWidth = sc->par.xs; tileHeight = sc->par.ys; border = (sc->mode & S_BDRY) ? 1 : 0; tileWidthNB = tileWidth - 2 * border; tileHeightNB = tileHeight - 2 * border; if (ddebug) { fprintf(stdout, " Generating %d by %d image\n", imgWidth, imgHeight); fprintf(stdout, " tile %d x %d\n", tileWidth, tileHeight); fprintf(stdout, " image size %f x %f cm\n", sc->par.cm, (double)imgHeight / sc->par.dpi / CM2IN); } /* buffer to store one tile */ tile = (GLubyte *)calloc(tileWidthNB * tileHeightNB, bitsPixel); if (!tile) { fprintf(stderr, " ## Unable to store buffer!\n"); return (0); } /* buffer for a row of tiles */ buffer = (GLubyte *)calloc(imgWidth * tileHeightNB, bitsPixel); if (!buffer) { free(tile); fprintf(stderr, " ## Unable to store a row of tiles!\n"); return (0); } /* open EPS file */ strcpy(name, data); ptr = (char *)strstr(name, ".ps"); if (!ptr) strcat(name, ".ps"); out = fopen(name, "w"); if (!out) { fprintf(stderr, " ## Unable to open file %s.\n", name); free(tile); free(buffer); return (0); } writeEPSheader(out, name, key, imgWidth, imgHeight, sc->par.cm, sc->par.dpi); /* save current viewport */ glGetIntegerv(GL_VIEWPORT, viewport); glDrawBuffer(GL_BACK_LEFT); glReadBuffer(GL_BACK_LEFT); /* dump tiles */ nbcol = (int)((float)imgWidth / tileWidthNB) + 1; nbrow = (int)((float)imgHeight / tileHeightNB) + 1; tiling = 1; th = tileHeightNB; finhaut = sc->par.ys; for (row = nbrow - 1; row >= 0; row--) { float debhaut, deblarg; if (row < nbrow - 1) th = tileHeightNB; else th = imgHeight - row * tileHeightNB; debhaut = finhaut - sc->par.ys * th / imgHeight; deblarg = 0; for (col = 0; col < nbcol; col++) { if (col < nbcol - 1) tw = tileWidthNB; else tw = imgWidth - col * tileWidthNB; if (th > tileHeightNB || tw > tileWidthNB) { fprintf(stderr, " %%%% Wrong tile size (%d,%d).\n", th, tw); free(buffer); free(tile); return (0); } finlarg = deblarg + sc->par.xs * tw / imgWidth; /* set viewport to tilesize (with border) */ glViewport(0, 0, tw + 2 * border, th + 2 * border); /* current matrix */ glGetIntegerv(GL_MATRIX_MODE, &matmode); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMultMatrixf(sc->persp->matrix); /* compute projection parameters */ if (sc->persp->pmode == PERSPECTIVE) { left = xmin + (xmax - xmin) * (col * tileWidthNB) / imgWidth; right = left + (xmax - xmin) * tw / imgWidth; bottom = ymin + (ymax - ymin) * (row * tileHeightNB) / imgHeight; top = bottom + (ymax - ymin) * th / imgHeight; glFrustum(left, right, bottom, top, 0.1 * sc->dmax, 10.0f * sc->dmax); glTranslatef(0.0f, 0.0, sc->persp->depth); } else if (sc->persp->pmode == CAMERA) { left = xmin + (xmax - xmin) * (col * tileWidthNB) / imgWidth; right = left + (xmax - xmin) * tw / imgWidth; bottom = ymin + (ymax - ymin) * (row * tileHeightNB) / imgHeight; top = bottom + (ymax - ymin) * th / imgHeight; glFrustum(left, right, bottom, top, 0.1f * sc->dmax, 10.0f * sc->dmax); look[0] = c->eye[0] + 0.001 * sc->dmax * c->speed[0]; look[1] = c->eye[1] + 0.001 * sc->dmax * c->speed[1]; look[2] = c->eye[2] + 0.001 * sc->dmax * c->speed[2]; gluLookAt(c->eye[0], c->eye[1], c->eye[2], look[0], look[1], look[2], up[0], up[1], up[2]); glTranslatef(0.0f, 0.0f, 0.5 * sc->persp->depth); } else if (sc->persp->pmode == ORTHO) { glOrtho(-1., 1., -1., 0.1, 0.01, 0.01); glTranslatef(0.0, 0.0, sc->persp->depth); } /* redraw scene */ glDisable(GL_LIGHTING); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); /*gluLookAt(0.,0.,-sc->persp->depth, 0.,0.,0., 0.0,1.0,0.0);*/ glMultMatrixf(sc->view->matrix); glTranslatef(sc->cx, sc->cy, sc->cz); drawModel(sc); /* read buffer */ glFlush(); glReadPixels(border, border, tileWidthNB, tileHeightNB, GL_RGB, GL_UNSIGNED_BYTE, tile); /* store to row buffer */ bitsImgOffset = col * tileWidthNB * bitsPixel; bitsTileRow = tileWidthNB * bitsPixel; bitsCurTileRow = tw * bitsPixel; /*bitsTileOffset = border * bitsPixel;*/ bitsTileOffset = 0; for (i = 0; i < th; i++) { memcpy(buffer + i * imgRowSize + bitsImgOffset, tile + i * bitsTileRow + bitsTileOffset, bitsCurTileRow); } deblarg = finlarg + 1; } finhaut = debhaut - 1; /* modify color */ if (sc->par.coeff > 0.0f) for (i = 0; i < imgWidth * tileHeightNB * bitsPixel; i++) { if (buffer[i] > 10) buffer[i] += (255 - buffer[i]) * sc->par.coeff; else buffer[i] += buffer[i] * sc->par.coeff; } /* write row of tiles */ for (i = 0; i < th; i++) { /* reverse image */ rowPtr = buffer + (th - 1 - i) * imgRowSize; writeEPSRow(out, key, rowPtr, imgWidth, bckbyte); } } writeEPStrailer(out); fclose(out); free(tile); free(buffer); tiling = 0; /* restore viewport */ glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); glDrawBuffer(GL_FRONT | GL_BACK); farclip(GL_TRUE); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); if (ddebug) fprintf(stdout, " Tiling completed.\n"); return (1); } freefem++-3.61-1/src/medit/psfile.c000644 000767 000024 00000017517 13312446271 017135 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif #include #include #ifndef ubyte typedef unsigned char ubyte; #endif #define CM2IN 0.3937 void writeEPSheader (FILE *out, char *data, char key, int ww, int hh, float cm, float dpi) { fprintf(out, "%%!PS-Adobe-2.0 EPSF-2.0\n"); fprintf(out, "%%LanguageLevel: 1\n"); fprintf(out, "%%%%Title: %s\n", data); fprintf(out, "%%%%Creator: medit - (C) INRIA-Rocquencourt, 1999-2001\n"); fprintf(out, "%%%%BoundingBox: 50 50 %d %d\n", (int)(ww * 72. / dpi + 50.5), (int)(hh * 72.0 / dpi + 50.5)); fprintf(out, "%%%%Pages: (atend)\n"); fprintf(out, "%%DocumentFonts:\n"); fprintf(out, "%%%%EndComments\n"); fprintf(out, "%%%%EndProlog\n"); fprintf(out, "\n%%%%Page: 1 1\n"); fprintf(out, "\n%% remember original state\n"); fprintf(out, "/origstate save def\n"); fprintf(out, "\n%% build a temporary dictionary\n"); fprintf(out, "20 dict begin\n"); fprintf(out, "\n%% define space for color conversions\n"); fprintf(out, "/grays %d string def %% space for gray scale line\n", ww); fprintf(out, "/npixls 0 def\n"); fprintf(out, "/rgbindx 0 def\n"); fprintf(out, "\n%% lower left corner\n"); fprintf(out, "50 50 translate\n"); fprintf(out, "\n%% size of image (on paper, in 1/72inch coords)\n"); fprintf(out, "%g %g scale\n", 72.0 * CM2IN * cm, 72.0 * CM2IN * cm * (float)hh / ww); fprintf(out, "\n%% define string to hold a scanline's worth of data\n"); /* write BW image */ if (key == 'B') { int wpad; wpad = (ww + 7) & ~7; fprintf(out, "/pix %d string def\n", wpad / 8); fprintf(out, "\n%% dimensions of data\n"); fprintf(out, "%d %d 1\n", ww, hh); fprintf(out, "\n%% mapping matrix\n"); fprintf(out, "[%d 0 0 %d 0 %d]\n", ww, -hh, hh); fprintf(out, "\n{currentfile pix readhexstring pop}\n"); fprintf(out, "image\n"); } /* write greyscale image */ else if (key == 'G') { fprintf(out, "/pix %d string def\n", ww); fprintf(out, "\n%% dimensions of data\n"); fprintf(out, "%d %d 8\n", ww, hh); fprintf(out, "\n%% mapping matrix\n"); fprintf(out, "[%d 0 0 %d 0 %d]\n", ww, -hh, hh); fprintf(out, "\n{currentfile pix readhexstring pop}\n"); fprintf(out, "image\n"); } /* color image */ else if (key == 'C') { fprintf(out, "/pix %d string def\n", 3 * ww); fprintf(out, "\n%% dimensions of data\n"); fprintf(out, "%d %d 8\n", ww, hh); fprintf(out, "\n%% mapping matrix\n"); fprintf(out, "[%d 0 0 %d 0 %d]\n", ww, -hh, hh); fprintf(out, "\n%% define 'colorimage' if it isn't defined\n"); fprintf(out, "/colorimage where %% do we know about 'colorimage'?\n"); fprintf(out, " { pop } %% yes: pop off the 'dict' returned\n"); fprintf(out, " { %% no: define one\n"); fprintf(out, " /colortogray { %% define an RGB->I function\n"); fprintf(out, " /rgbdata exch store %% call input 'rgbdata'\n"); fprintf(out, " rgbdata length 3 idiv\n"); fprintf(out, " /npixls exch store\n"); fprintf(out, " /rgbindx 0 store\n"); fprintf(out, " 0 1 npixls 1 sub {\n"); fprintf(out, " grays exch\n"); fprintf(out, " rgbdata rgbindx get 20 mul %% Red\n"); fprintf(out, " rgbdata rgbindx 1 add get 32 mul %% Green\n"); fprintf(out, " rgbdata rgbindx 2 add get 12 mul %% Blue\n"); fprintf(out, " add add 64 idiv %% I = .5G + .31R + .18B\n"); fprintf(out, " put\n"); fprintf(out, " /rgbindx rgbindx 3 add store\n"); fprintf(out, " } for\n"); fprintf(out, " grays 0 npixls getinterval\n"); fprintf(out, " } bind def\n"); fprintf(out, "\n %% Utility procedure for colorimage operator.\n"); fprintf(out, " %% This procedure takes two procedures off the\n"); fprintf(out, " %% stack and merges them into a single procedure.\n"); fprintf(out, "\n /mergeprocs { %% def\n"); fprintf(out, " dup length\n"); fprintf(out, " 3 -1 roll\n"); fprintf(out, " dup\n"); fprintf(out, " length\n"); fprintf(out, " dup\n"); fprintf(out, " 5 1 roll\n"); fprintf(out, " 3 -1 roll\n"); fprintf(out, " add\n"); fprintf(out, " array cvx\n"); fprintf(out, " dup\n"); fprintf(out, " 3 -1 roll\n"); fprintf(out, " 0 exch\n"); fprintf(out, " putinterval\n"); fprintf(out, " dup\n"); fprintf(out, " 4 2 roll\n"); fprintf(out, " putinterval\n"); fprintf(out, " } bind def\n"); fprintf(out, " /colorimage { %% def\n"); fprintf(out, " pop pop %% remove 'false 3' operands\n"); fprintf(out, " {colortogray} mergeprocs\n"); fprintf(out, " image\n"); fprintf(out, " } bind def\n"); fprintf(out, " } ifelse %% end of 'false' case\n"); fprintf(out, "\n{currentfile pix readhexstring pop}\n"); fprintf(out, "false 3 colorimage\n\n"); } } void writeEPStrailer (FILE *out) { fprintf(out, "\nshowpage\n"); fprintf(out, "\n%% stop using temporary dictionary\n"); fprintf(out, "end\n"); fprintf(out, "\n%% restore original state\n"); fprintf(out, "origstate restore\n"); fprintf(out, "\n%%%%Trailer\n"); } void writeEPSRow (FILE *out, char key, ubyte *buffer, int size, ubyte bckbyt) { int c, k, l; ubyte byte; l = 0; switch (key) { case 'B': /* black & white */ byte = 0x0; c = 0; for (k = 0; k < 3 * size; k += 3) { ubyte bbyte; bbyte = (ubyte)(0.30 * buffer[k] + 0.59 * buffer[k + 1] + 0.11 * buffer[k + 2] + 0.5); if (bbyte == bckbyt) byte |= (1 << (7 - c)); /* * if ( bbyte > 253 ) byte |= (1 << (7-c)); * * if ( bbyte && bbyte != 255 ) { * printf("buffer %d %d %d\n",buffer[k],buffer[k+1],buffer[k+2]); * printf("bbyte %d byte %d\n",bbyte,byte); * exit(1); * } */ if (++c == 8) { fprintf(out, "%.2x", byte); if (++l == 36) { fprintf(out, "\n"); l = 0; } byte = 0x0; c = 0; } } /* padding */ if (c) { for (l = 8; l > c; l--) { byte |= (1 << l); } fprintf(out, "%.2x", byte); } break; case 'G': /* greyscale */ for (k = 0; k < 3 * size; k += 3) { byte = (ubyte)(0.30 * buffer[k] + 0.59 * buffer[k + 1] + 0.11 * buffer[k + 2]); fprintf(out, "%.2x", byte); if (++l == 36) { fprintf(out, "\n"); l = 0; } } break; case 'C': /* color scale */ for (k = 0; k < 3 * size; k++) { fprintf(out, "%.2x", buffer[k]); if (++l == 36) { fprintf(out, "\n"); l = 0; } } break; } fprintf(out, "\n"); } #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/cube.c000644 000767 000024 00000010636 13312446271 016564 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" /* display cube */ void updateCube (pCube cube, pMesh mesh) { pScene sc; pTransform cubetr, view; GLfloat inv[16], axis[4], trans[4]; int idw; /* default */ if (ddebug) printf("updateCube\n"); /* retrieve context */ idw = currentScene(); sc = cv.scene[idw]; view = sc->view; cubetr = cube->cubetr; /* compute cube transform */ if (cube->active & C_EDIT) { invertMatrix(view->matrix, inv); inv[3] = inv[7] = inv[11] = 0.0f; inv[15] = 1.0; /* rotation cumulative */ if (cubetr->angle != 0.0) { transformVector(trans, cubetr->axis, inv); glPushMatrix(); glLoadIdentity(); glRotatef(cubetr->angle, trans[0], trans[1], trans[2]); glMultMatrixf(cubetr->rot); glGetFloatv(GL_MODELVIEW_MATRIX, cubetr->rot); glPopMatrix(); } /* translation cumulative */ axis[0] = cubetr->panx; axis[1] = cubetr->pany; axis[2] = 0.0; axis[3] = 1.0; transformVector(trans, axis, inv); cubetr->tra[12] = trans[0]; cubetr->tra[13] = trans[1]; cubetr->tra[14] = trans[2]; /* final transformation */ glPushMatrix(); glLoadIdentity(); glMultMatrixf(cubetr->tra); glMultMatrixf(cubetr->rot); glGetFloatv(GL_MODELVIEW_MATRIX, cubetr->matrix); glPopMatrix(); } if (!cubetr->manim) { cubetr->angle = 0.0; cube->active ^= C_UPDATE; } } void dumpCube (pScene sc, pMesh mesh, pCube cube) { float *tr, u[4]; double v[4]; int i; FILE *out; tr = cube->cubetr->matrix; out = fopen("tr.data", "w"); for (i = 0; i < 4; i++) { fprintf(out, "%f %f %f %f\n", tr[i], tr[4 + i], tr[8 + i], tr[12 + i]); } u[0] = cube->cmi[0] - mesh->xtra; u[1] = cube->cmi[1] - mesh->ytra; u[2] = cube->cmi[2] - mesh->ztra; u[3] = 1.0; /*printf("avant %f %f %f %f\n",u[0],u[1],u[2],u[3]);*/ transformPoint2(v, u, tr); fprintf(out, "\n%f %f %f %f\n", v[0] + mesh->xtra, v[1] + mesh->ytra, v[2] + mesh->ztra, v[3]); u[0] = cube->cma[0] - mesh->xtra; u[1] = cube->cma[1] - mesh->ytra; u[2] = cube->cma[2] - mesh->ztra; /*printf("avant %f %f %f %f\n",u[0],u[1],u[2],u[3]);*/ transformPoint2(v, u, tr); fprintf(out, "%f %f %f %f\n", v[0] + mesh->xtra, v[1] + mesh->ytra, v[2] + mesh->ztra, v[3]); fprintf(out, "\n%f %f %f\n", cube->cubetr->tra[12], cube->cubetr->tra[13], cube->cubetr->tra[14]); fprintf(out, "%f %f %f %f\n", cube->cubetr->angle, cube->cubetr->axis[0], cube->cubetr->axis[1], cube->cubetr->axis[2]); fclose(out); } void resetCube (pScene sc, pCube cube, pMesh mesh) { resetTransform(cube->cubetr); cube->active |= C_REDO; cube->cmi[0] = mesh->xmin; cube->cmi[1] = mesh->ymin; cube->cmi[2] = mesh->zmin; cube->cma[0] = mesh->xmax; cube->cma[1] = mesh->ymax; cube->cma[2] = mesh->zmax; } pCube createCube (pScene sc, pMesh mesh) { pCube cube; cube = (pCube)M_calloc(1, sizeof(struct cube), "cube"); assert(cube); cube->cubetr = (pTransform)M_calloc(1, sizeof(struct transform), "cube"); if (!cube->cubetr) return (0); resetCube(sc, cube, mesh); return (cube); } freefem++-3.61-1/src/medit/Makefile.in000644 000767 000024 00000071325 13321623167 017552 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ EXTRA_PROGRAMS = ffmedit$(EXEEXT) subdir = src/medit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_ffmedit_OBJECTS = animat.$(OBJEXT) cube.$(OBJEXT) image.$(OBJEXT) \ listnum.$(OBJEXT) mouse.$(OBJEXT) persp.$(OBJEXT) \ stream.$(OBJEXT) zaldy2.$(OBJEXT) bbfile.$(OBJEXT) \ dlists.$(OBJEXT) inmsh2.$(OBJEXT) material.$(OBJEXT) \ normal.$(OBJEXT) tiles.$(OBJEXT) camera.$(OBJEXT) \ ellipse.$(OBJEXT) inout.$(OBJEXT) medit.$(OBJEXT) \ param.$(OBJEXT) psfile.$(OBJEXT) transform.$(OBJEXT) \ cenrad.$(OBJEXT) geometry.$(OBJEXT) inout_morice.$(OBJEXT) \ menus.$(OBJEXT) parsar.$(OBJEXT) scene.$(OBJEXT) \ util.$(OBJEXT) clip.$(OBJEXT) gisfil.$(OBJEXT) \ inout_popenbinaire.$(OBJEXT) mesh.$(OBJEXT) parsop.$(OBJEXT) \ scissor.$(OBJEXT) vector.$(OBJEXT) clipvol.$(OBJEXT) \ hash.$(OBJEXT) items.$(OBJEXT) mlists.$(OBJEXT) \ particle.$(OBJEXT) sftcpy.$(OBJEXT) view.$(OBJEXT) \ critip.$(OBJEXT) ilists.$(OBJEXT) keyboard.$(OBJEXT) \ morphing.$(OBJEXT) path.$(OBJEXT) status.$(OBJEXT) \ zaldy1.$(OBJEXT) ffmedit_OBJECTS = $(am_ffmedit_OBJECTS) ffmedit_LDADD = $(LDADD) am__DEPENDENCIES_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ffmedit_SOURCES) DIST_SOURCES = $(ffmedit_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CXXLD = $(STATICTOOL) $(CXX) bin_PROGRAMS = $(MEDITPROG) EXTRA_DIST = picking.c ffmedit_SOURCES = animat.c cube.c image.c listnum.c mouse.c persp.c stream.c zaldy2.c bbfile.c dlists.c inmsh2.c \ material.c normal.c tiles.c camera.c ellipse.c inout.c medit.c param.c psfile.c transform.c cenrad.c geometry.c \ inout_morice.c menus.c parsar.c scene.c util.c clip.c gisfil.c inout_popenbinaire.c mesh.c parsop.c scissor.c vector.c \ clipvol.c hash.c items.c mlists.c particle.c sftcpy.c view.c critip.c ilists.c keyboard.c morphing.c path.c status.c \ zaldy1.c chrono.h extern.h image.h mesh.h eigenv.h grafic.h medit.h sproto.h LDADD = picking.$(OBJEXT) ../libMesh/libMesh.a $(LIBSGLUT) -lm AM_CPPFLAGS = -I$(srcdir)/../libMesh BUILT_SOURCES = compil.date #.PHONY: compil.date # ALH - during a parallel make, we should make sure that picking.o is not used before being made by a different # thread. If I understand things correctly, picking.c should not be compiled with the regular CFLAGS options. ffmedit_DEPENDENCIES = picking.$(OBJEXT) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/medit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/medit/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) ffmedit$(EXEEXT): $(ffmedit_OBJECTS) $(ffmedit_DEPENDENCIES) $(EXTRA_ffmedit_DEPENDENCIES) @rm -f ffmedit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ffmedit_OBJECTS) $(ffmedit_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bbfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cenrad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clipvol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/critip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cube.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ellipse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geometry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gisfil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ilists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inmsh2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inout_morice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inout_popenbinaire.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/items.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/medit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mesh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/morphing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/param.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/persp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scene.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scissor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/view.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zaldy1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zaldy2.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic 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-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 pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: Makefile compil.date: $(ffmedit_SOURCES) echo "#define COMPIL " '"' `date` '(with ff++ $(VERSION))''"' > compil.date picking.$(OBJEXT):picking.c ${CC} -c $< $(CNOFLAGS) -o $@ #pinking.no-optffmedit$(EXEEXT):picking.c # rm picking.$(OBJEXT) # $(MAKE) picking.o $(MEDITPROG) CFLAGS="$(CNOFLAGS)" # touch pinking.no-optffmedit$(EXEEXT) #pinking.no-opt:picking.c # touch pinking.no-opt #clean-local: # -rm pinking.no-opt pinking.no-optffmedit$(EXEEXT) # 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: freefem++-3.61-1/src/medit/view.c000644 000767 000024 00000007142 13312446271 016616 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "sproto.h" #include "extern.h" static pTransform cview = 0; static pCamera ccam = 0; static pPersp cpersp = 0; static int cscene = 0; static ubyte curview = 0; void copyView (pTransform view, pCamera cam, pPersp persp) { cscene = currentScene(); if (!cview) { cview = (pTransform)calloc(1, sizeof(struct transform)); if (!cview) exit(2); } cview = (pTransform)memcpy(cview, view, sizeof(struct transform)); if (!cview) exit(2); if (!ccam) { ccam = (pCamera)calloc(1, sizeof(struct camera)); if (!ccam) exit(2); } ccam = (pCamera)memcpy(ccam, cam, sizeof(struct camera)); if (!ccam) exit(2); if (!cpersp) { cpersp = (pPersp)calloc(1, sizeof(struct sperspective)); if (!cpersp) exit(2); } cpersp = (pPersp)memcpy(cpersp, persp, sizeof(struct sperspective)); if (!cpersp) exit(2); curview = 1; } int pasteView (pTransform view, pCamera cam, pPersp persp) { if (!curview && !ccam && !persp) return (0); view = (pTransform)memcpy(view, cview, sizeof(struct transform)); cam = (pCamera)memcpy(cam, ccam, sizeof(struct camera)); persp = memcpy(persp, cpersp, sizeof(struct sperspective)); if (!view || !cam || !persp) exit(2); curview = 0; return (1); } /* link scene 1 (slave) to scene 2 (master) */ int linkView (pScene slave) { pScene master; int idw = currentScene(); /* default */ if (ddebug) printf("link view\n"); if (!curview || idw == cscene) return (0); /* link 2 scenes */ master = cv.scene[cscene]; master->slave = idw; master->master = -1; memcpy(slave->view, master->view, sizeof(struct transform)); memcpy(slave->camera, master->camera, sizeof(struct camera)); memcpy(slave->persp, master->persp, sizeof(struct sperspective)); memcpy(slave->clip->eqn, master->clip->eqn, 4 * sizeof(float)); memcpy(slave->clip->cliptr, master->clip->cliptr, sizeof(struct transform)); slave->slave = -1; slave->master = cscene; curview = 0; return (1); } void unlinkView (pScene sc1) { pScene sc2; if (sc1->master == -1) return; /* copy master view */ sc2 = cv.scene[sc1->master]; sc1->view = (pTransform)createTransform(); memcpy(sc1->view, sc2->view, sizeof(struct transform)); /* remove link */ sc1->master = -1; sc2->slave = -1; } freefem++-3.61-1/src/medit/mesh.c000644 000767 000024 00000034021 13312446271 016574 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define FLOAT_MAX 1.e20 ubyte dosurf; double volTet (double *c1, double *c2, double *c3, double *c4) { double ax, ay, az, bx, by, bz, vol; ax = c3[0] - c1[0]; ay = c3[1] - c1[1]; az = c3[2] - c1[2]; bx = c4[0] - c1[0]; by = c4[1] - c1[1]; bz = c4[2] - c1[2]; vol = (c2[0] - c1[0]) * (ay * bz - az * by) \ + (c2[1] - c1[1]) * (az * bx - ax * bz) \ + (c2[2] - c1[2]) * (ax * by - ay * bx); return (vol / 6.0); } /* dump mesh info */ void meshInfo (pMesh mesh) { fprintf(stdout, " Vertices %8d", mesh->np); if (mesh->nc) fprintf(stdout, " Corners %d", mesh->nc); if (mesh->nr) fprintf(stdout, " Required %d", mesh->nr); fprintf(stdout, "\n"); if (mesh->nt) fprintf(stdout, " Triangles %8d\n", mesh->nt); if (mesh->nq) fprintf(stdout, " Quads %8d\n", mesh->nq); if (mesh->ntet) fprintf(stdout, " Tetrahedra %8d\n", mesh->ntet); if (mesh->nhex) fprintf(stdout, " Hexahedra %8d\n", mesh->nhex); if (mesh->na) { fprintf(stdout, " Edges %8d", mesh->na); if (mesh->nri) fprintf(stdout, " Ridges %d", mesh->nri); if (mesh->nre) fprintf(stdout, " Required %d", mesh->nre); fprintf(stdout, "\n"); } if (mesh->nvn || mesh->ntg) { fprintf(stdout, " Normals %8d", mesh->nvn); fprintf(stdout, " Tangents %d\n", mesh->ntg); } fprintf(stdout, " Bounding box: x:[%g %g] y:[%g %g] z:[%g %g]\n", mesh->xmin, mesh->xmax, mesh->ymin, mesh->ymax, mesh->zmin, mesh->zmax); } void meshCoord (pMesh mesh, int displ) { pPoint ppt; pSolution ps; double mul; int k; /* default */ if (ddebug) printf("change mesh coord\n"); mul = 2.0 * displ - 1.; if (mesh->dim == 2) { for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; ps = &mesh->sol[k]; ppt->c[0] = ppt->c[0] + mul * ps->m[0]; ppt->c[1] = ppt->c[1] + mul * ps->m[1]; } } else { pTetra pt1; double *c1, *c2, *c3, *c4, vold, volf; vold = 0.0; for (k = 1; k <= mesh->ntet; k++) { pt1 = &mesh->tetra[k]; if (!pt1->v[0]) continue; c1 = &mesh->point[pt1->v[0]].c[0]; c2 = &mesh->point[pt1->v[1]].c[0]; c3 = &mesh->point[pt1->v[2]].c[0]; c4 = &mesh->point[pt1->v[3]].c[0]; vold += volTet(c1, c2, c3, c4); } for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; ps = &mesh->sol[k]; ppt->c[0] = mesh->xtra + ppt->c[0] + mul * ps->m[0]; ppt->c[1] = mesh->ytra + ppt->c[1] + mul * ps->m[1]; ppt->c[2] = mesh->ztra + ppt->c[2] + mul * ps->m[2]; } volf = 0.0; for (k = 1; k <= mesh->ntet; k++) { pt1 = &mesh->tetra[k]; if (!pt1->v[0]) continue; c1 = &mesh->point[pt1->v[0]].c[0]; c2 = &mesh->point[pt1->v[1]].c[0]; c3 = &mesh->point[pt1->v[2]].c[0]; c4 = &mesh->point[pt1->v[3]].c[0]; volf += volTet(c1, c2, c3, c4); } fprintf(stdout, " Volume: initial %E final %E\n", vold, volf); } } void meshBox (pMesh mesh, int bb) { pPoint ppt; int k; /* default */ if (ddebug) printf("compute mesh box\n"); if (bb) { mesh->xmin = mesh->ymin = mesh->zmin = FLOAT_MAX; mesh->xmax = mesh->ymax = mesh->zmax = -FLOAT_MAX; for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; if (ppt->tag == M_UNUSED && mesh->ne) continue; if (ppt->c[0] < mesh->xmin) mesh->xmin = ppt->c[0]; if (ppt->c[0] > mesh->xmax) mesh->xmax = ppt->c[0]; if (ppt->c[1] < mesh->ymin) mesh->ymin = ppt->c[1]; if (ppt->c[1] > mesh->ymax) mesh->ymax = ppt->c[1]; if (ppt->c[2] < mesh->zmin) mesh->zmin = ppt->c[2]; if (ppt->c[2] > mesh->zmax) mesh->zmax = ppt->c[2]; } } /* translate mesh at center */ mesh->xtra = 0.5 * (mesh->xmin + mesh->xmax); mesh->ytra = 0.5 * (mesh->ymin + mesh->ymax); mesh->ztra = 0.5 * (mesh->zmin + mesh->zmax); for (k = 1; k <= mesh->np; k++) { ppt = &mesh->point[k]; /*if ( ppt->tag == M_UNUSED && mesh->ne ) continue;*/ ppt->c[0] -= mesh->xtra; ppt->c[1] -= mesh->ytra; ppt->c[2] -= mesh->ztra; } } int meshSurf (pMesh mesh) { pTetra ptt; pHexa ph; int *adj, i, k, iadr; static int idirt[7] = {0, 1, 2, 3, 0, 1, 2}; if (!dosurf) return (1); /* extract surface */ if (mesh->ntet > 0 && !mesh->nt) { pTetra pt2; if (!hashTetra(mesh)) return (0); for (k = 1; k <= mesh->ntet; k++) { ptt = &mesh->tetra[k]; if (!ptt->v[0]) continue; iadr = 4 * (k - 1) + 1; adj = &mesh->adja[iadr]; for (i = 0; i < 4; i++) { if (!adj[i]) {++mesh->nt;} else { pt2 = &mesh->tetra[adj[i]]; if (ptt->ref != pt2->ref && k < adj[i]) ++mesh->nt; } } } /* memory alloc */ if (ddebug) printf("allocate %d tria\n", mesh->nt); mesh->tria = (pTriangle)calloc(mesh->nt + 1, sizeof(struct striangle)); if (!mesh->tria) { fprintf(stdout, " ## No triangle\n"); return (0); } /* find triangles */ mesh->nt = 0; for (k = 1; k <= mesh->ntet; k++) { ptt = &mesh->tetra[k]; if (!ptt->v[0]) continue; iadr = 4 * (k - 1) + 1; adj = &mesh->adja[iadr]; for (i = 0; i < 4; i++) { pTriangle pt; ubyte i1, i2, i3; if (!adj[i]) { pt = &mesh->tria[++mesh->nt]; i1 = idirt[i + 1]; i2 = idirt[i + 2]; i3 = idirt[i + 3]; pt->v[0] = ptt->v[i1]; pt->v[1] = ptt->v[i2]; pt->v[2] = ptt->v[i3]; pt->ref = 0; } else { pt2 = &mesh->tetra[adj[i]]; if ((ptt->ref != pt2->ref) && (k < adj[i])) { pt = &mesh->tria[++mesh->nt]; i1 = idirt[i + 1]; i2 = idirt[i + 2]; i3 = idirt[i + 3]; pt->v[0] = ptt->v[i1]; pt->v[1] = ptt->v[i2]; pt->v[2] = ptt->v[i3]; pt->ref = max(ptt->ref, pt2->ref); } } } } } if (mesh->nhex > 0 && !mesh->nq) { if (mesh->adja) { free(mesh->adja); free(mesh->voy); mesh->adja = 0; mesh->voy = 0; } if (!hashHexa(mesh)) return (0); for (k = 1; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; if (!ph->v[0]) continue; iadr = 6 * (k - 1) + 1; adj = &mesh->adja[iadr]; for (i = 0; i < 6; i++) { if (!adj[i]) ++mesh->nq; } } /* memory alloc */ if (ddebug) printf("allocate %d quads\n", mesh->nq); mesh->quad = (pQuad)calloc(mesh->nq + 1, sizeof(struct squad)); if (!mesh->quad) { fprintf(stdout, " ## No quad\n"); return (0); } /* find quadrilaterals */ mesh->nq = 0; for (k = 1; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; if (!ph->v[0]) continue; iadr = 6 * (k - 1) + 1; adj = &mesh->adja[iadr]; for (i = 0; i < 6; i++) { if (!adj[i]) { pQuad pq; static int ch[6][4] = {{0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, {0, 3, 7, 4}}; pq = &mesh->quad[++mesh->nq]; pq->v[0] = ph->v[ch[i][0]]; pq->v[1] = ph->v[ch[i][1]]; pq->v[2] = ph->v[ch[i][2]]; pq->v[3] = ph->v[ch[i][3]]; } } } } return (1); } void meshRef (pScene sc, pMesh mesh) { pMaterial pm; pPoint ppt; int *old, i, k, m, nmat; /* default */ if (ddebug) printf(" assign %d references\n", sc->par.nbmat - 1); /* sort elements by references */ if (!quiet) fprintf(stdout, " Identifying sub-domains\n"); old = (int *)calloc(sc->par.nbmat + 1, sizeof(int)); if (!old) exit(2); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->ext[0] = mesh->xmax - mesh->xtra; pm->ext[1] = mesh->ymax - mesh->ytra; pm->ext[2] = mesh->zmax - mesh->ztra; pm->ext[3] = mesh->xmin - mesh->xtra; pm->ext[4] = mesh->ymin - mesh->ytra; pm->ext[5] = mesh->zmin - mesh->ztra; } for (k = mesh->nt; k > 0; k--) { pTriangle pt; pt = &mesh->tria[k]; if (!pt->v[0]) continue; nmat = matRef(sc, pt->ref); /*nmat = !pt->ref ? DEFAULT_MAT : 1+(pt->ref-1)%(sc->par.nbmat-1);*/ pt->nxt = old[nmat]; old[nmat] = k; pm = &sc->material[nmat]; for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; pm->ext[0] = min(pm->ext[0], ppt->c[0]); pm->ext[1] = min(pm->ext[1], ppt->c[1]); pm->ext[2] = min(pm->ext[2], ppt->c[2]); pm->ext[3] = max(pm->ext[3], ppt->c[0]); pm->ext[4] = max(pm->ext[4], ppt->c[1]); pm->ext[5] = max(pm->ext[5], ppt->c[2]); } } for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->depmat[LTria] = old[m]; old[m] = 0; } for (k = mesh->nq; k > 0; k--) { pQuad pq; pq = &mesh->quad[k]; if (!pq->v[0]) continue; nmat = matRef(sc, pq->ref); /*nmat = !pq->ref ? DEFAULT_MAT : 1+(pq->ref-1)%(sc->par.nbmat-1);*/ pq->nxt = old[nmat]; old[nmat] = k; pm = &sc->material[nmat]; for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; pm->ext[0] = min(pm->ext[0], ppt->c[0]); pm->ext[1] = min(pm->ext[1], ppt->c[1]); pm->ext[2] = min(pm->ext[2], ppt->c[2]); pm->ext[3] = max(pm->ext[3], ppt->c[0]); pm->ext[4] = max(pm->ext[4], ppt->c[1]); pm->ext[5] = max(pm->ext[5], ppt->c[2]); } } for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->depmat[LQuad] = old[m]; old[m] = 0; } for (k = mesh->ntet; k > 0; k--) { pTetra pte; pte = &mesh->tetra[k]; if (!pte->v[0]) continue; nmat = matRef(sc, pte->ref); /*nmat = !pte->ref ? DEFAULT_MAT : 1+(pte->ref-1)%(sc->par.nbmat-1);*/ pte->nxt = old[nmat]; old[nmat] = k; pm = &sc->material[nmat]; for (i = 0; i < 4; i++) { ppt = &mesh->point[pte->v[i]]; pm->ext[0] = min(pm->ext[0], ppt->c[0]); pm->ext[1] = min(pm->ext[1], ppt->c[1]); pm->ext[2] = min(pm->ext[2], ppt->c[2]); pm->ext[3] = max(pm->ext[3], ppt->c[0]); pm->ext[4] = max(pm->ext[4], ppt->c[1]); pm->ext[5] = max(pm->ext[5], ppt->c[2]); } } for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->depmat[LTets] = old[m]; old[m] = 0; } for (k = mesh->nhex; k > 0; k--) { pHexa ph; ph = &mesh->hexa[k]; nmat = matRef(sc, ph->ref); /*nmat = !ph->ref ? DEFAULT_MAT : 1+(ph->ref-1)%(sc->par.nbmat-1);*/ ph->nxt = old[nmat]; old[nmat] = k; pm = &sc->material[nmat]; for (i = 0; i < 8; i++) { ppt = &mesh->point[ph->v[i]]; pm->ext[0] = min(pm->ext[0], ppt->c[0]); pm->ext[1] = min(pm->ext[1], ppt->c[1]); pm->ext[2] = min(pm->ext[2], ppt->c[2]); pm->ext[3] = max(pm->ext[3], ppt->c[0]); pm->ext[4] = max(pm->ext[4], ppt->c[1]); pm->ext[5] = max(pm->ext[5], ppt->c[2]); } } for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; pm->depmat[LHexa] = old[m]; old[m] = 0; } free(old); /* remove unused materials */ /* * for (m=1; mpar.nbmat; m++) { * pm = &sc->material[m]; * if ( !pm->depmat[LTria] && !pm->depmat[LQuad] && * !pm->depmat[LTets] && !pm->depmat[LHexa] ) { * pm1 = &sc->material[sc->par.nbmat-1]; * memcpy(pm,pm1,sizeof(struct material)); * sc->par.nbmat--; * m--; * } * } */ if (ddebug) for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; if (pm->depmat[LTria] || pm->depmat[LQuad] || pm->depmat[LTets] || pm->depmat[LHexa]) fprintf(stdout, " depart[%d], ref %d = %d %d %d %d\n", m, pm->ref, pm->depmat[LTria], pm->depmat[LQuad], pm->depmat[LTets], pm->depmat[LHexa]); } } int meshUpdate (pScene sc, pMesh mesh) { int ret; clock_t ct; /* release mesh structure */ if (ddebug) fprintf(stdout, "loadMesh: update mesh\n"); if (mesh->tria) {M_free(mesh->tria); mesh->tria = 0;} if (mesh->quad) {M_free(mesh->quad); mesh->quad = 0;} if (mesh->edge) {M_free(mesh->edge); mesh->edge = 0;} if (mesh->tetra) {M_free(mesh->tetra); mesh->tetra = 0;} if (mesh->hexa) {M_free(mesh->hexa); mesh->hexa = 0;} if (mesh->adja) {M_free(mesh->adja); mesh->adja = 0;} if (mesh->voy) {M_free(mesh->voy); mesh->voy = 0;} if (mesh->point) {M_free(mesh->point); mesh->point = 0;} if (mesh->extra) { if (mesh->extra->iv) M_free(mesh->extra->nv); if (mesh->extra->it) M_free(mesh->extra->nt); if (mesh->extra->iq) M_free(mesh->extra->nq); if (mesh->extra->n) M_free(mesh->extra->n); M_free(mesh->extra); mesh->extra = 0; } if (mesh->nbb && mesh->sol) { if ((mesh->dim == 2 && mesh->nfield == 3) || (mesh->dim == 3 && mesh->nfield == 6)) { int k; for (k = 1; k <= mesh->nbb; k++) { free(mesh->sol[k].m); } } M_free(mesh->sol); mesh->sol = 0; } /* read mesh */ fprintf(stdout, " Loading data file(s)\n"); ct = clock(); ret = 0; switch (mesh->typ) { case 0: ret = loadMesh(mesh); break; case 1: ret = inmsh2(mesh); break; case 2: ret = loadGIS(mesh); break; } if (!ret) return (0); /* compute mesh box */ if ((mesh->ntet && !mesh->nt) || (mesh->nhex && !mesh->nq)) meshSurf(mesh); meshBox(mesh, 1); /*parsop(sc,mesh);*/ if (!quiet) meshInfo(mesh); /* read metric */ if (!loadSol(mesh, mesh->name, 1)) bbfile(mesh); if (!quiet && mesh->nbb) fprintf(stdout, " Solutions %8d\n", mesh->nbb); ct = difftime(clock(), ct); fprintf(stdout, " Input seconds: %.2f\n", (double)ct / (double)CLOCKS_PER_SEC); return (1); } freefem++-3.61-1/src/medit/image.h000644 000767 000024 00000003714 13312446271 016734 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #ifdef __cplusplus extern "C" { #endif enum imgtyp {DEFAULT=0, P2, P3, P5, P6, PS, GREY, RGB, RED, GREEN, BLUE, COLOR}; typedef struct { int sizeX, sizeY; GLubyte *data; } PPMimage; typedef PPMimage *pPPMimage; typedef struct { unsigned char idfield_len; unsigned char cmap_type; unsigned char image_type; unsigned char cmap_spec[5]; unsigned char x_orig[2]; unsigned char y_orig[2]; unsigned char width[2]; unsigned char height[2]; unsigned char pixel_size; unsigned char image_desc; } TGAheader; #ifdef __cplusplus } #endif freefem++-3.61-1/src/medit/stream.c000644 000767 000024 00000135042 13312446271 017140 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define MAX_PTS 100000 #define MAX_CPT 5000 #define MAX_LST 1024 #define COS175 -0.996194698 #define COS178 -0.99939083 #define HSIZ 0.03 #define EPST -1.e-14 #define EPSR 1.e+14 extern int reftype, refitem; extern GLfloat altcoef; int nbar = 0; enum {Euler=1, RK4=2}; /* find tetra containg p, starting nsdep */ int locateTetra (pMesh mesh, int nsdep, int base, float *p, double *cb) { pPoint p1, p2, p3; int *adj, it, nsfin; it = 0; nsfin = nsdep; /* printf("locateTetra: searching for %f %f %f\n",p[0],p[1],p[2]);*/ do { pTetra pt; pPoint p0; double bx, by, bz, cx, cy, cz, dx, dy, dz, vx, vy, vz, apx, apy, apz; double epsra, vol1, vol2, vol3, vol4, dd; int iadr; if (!nsfin) return (0); pt = &mesh->tetra[nsfin]; if (!pt->v[0]) return (0); if (pt->mark == base) return (0); pt->mark = base; iadr = 4 * (nsfin - 1) + 1; adj = &mesh->adja[iadr]; p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; p3 = &mesh->point[pt->v[3]]; /* barycentric */ bx = p1->c[0] - p0->c[0]; by = p1->c[1] - p0->c[1]; bz = p1->c[2] - p0->c[2]; cx = p2->c[0] - p0->c[0]; cy = p2->c[1] - p0->c[1]; cz = p2->c[2] - p0->c[2]; dx = p3->c[0] - p0->c[0]; dy = p3->c[1] - p0->c[1]; dz = p3->c[2] - p0->c[2]; /* test volume */ vx = cy * dz - cz * dy; vy = cz * dx - cx * dz; vz = cx * dy - cy * dx; epsra = EPST * (bx * vx + by * vy + bz * vz); apx = p[0] - p0->c[0]; apy = p[1] - p0->c[1]; apz = p[2] - p0->c[2]; /* p in 2 */ vol2 = apx * vx + apy * vy + apz * vz; if (epsra > vol2) { nsfin = adj[1]; continue; } /* p in 3 */ vx = by * apz - bz * apy; vy = bz * apx - bx * apz; vz = bx * apy - by * apx; vol3 = dx * vx + dy * vy + dz * vz; if (epsra > vol3) { nsfin = adj[2]; continue; } /* p in 4 */ vol4 = -cx * vx - cy * vy - cz * vz; if (epsra > vol4) { nsfin = adj[3]; continue; } /* p in 1 */ vol1 = -epsra * EPSR - vol2 - vol3 - vol4; if (epsra > vol1) { nsfin = adj[0]; continue; } dd = vol1 + vol2 + vol3 + vol4; if (dd != 0.0) dd = 1.0 / dd; cb[0] = vol1 * dd; cb[1] = vol2 * dd; cb[2] = vol3 * dd; cb[3] = vol4 * dd; pt->cpt++; return (nsfin); } while (++it <= mesh->ntet); return (0); } /* return 1 if point in tetra, adjacent #, if not */ int inSubTetra (pPoint pt[4], float *p, double *cb) { double bx, by, bz, cx, cy, cz, dx, dy, dz, vx, vy, vz, apx, apy, apz; double epsra, vol1, vol2, vol3, vol4, dd; /* barycentric */ bx = pt[1]->c[0] - pt[0]->c[0]; by = pt[1]->c[1] - pt[0]->c[1]; bz = pt[1]->c[2] - pt[0]->c[2]; cx = pt[2]->c[0] - pt[0]->c[0]; cy = pt[2]->c[1] - pt[0]->c[1]; cz = pt[2]->c[2] - pt[0]->c[2]; dx = pt[3]->c[0] - pt[0]->c[0]; dy = pt[3]->c[1] - pt[0]->c[1]; dz = pt[3]->c[2] - pt[0]->c[2]; /* test volume */ vx = cy * dz - cz * dy; vy = cz * dx - cx * dz; vz = cx * dy - cy * dx; epsra = EPST * (bx * vx + by * vy + bz * vz); apx = p[0] - pt[0]->c[0]; apy = p[1] - pt[0]->c[1]; apz = p[2] - pt[0]->c[2]; /* p in 2 */ vol2 = apx * vx + apy * vy + apz * vz; if (epsra > vol2) return (-1); /* p in 3 */ vx = by * apz - bz * apy; vy = bz * apx - bx * apz; vz = bx * apy - by * apx; vol3 = dx * vx + dy * vy + dz * vz; if (epsra > vol3) return (-2); /* p in 4 */ vol4 = -cx * vx - cy * vy - cz * vz; if (epsra > vol4) return (-3); /* p in 1 */ vol1 = -epsra * EPSR - vol2 - vol3 - vol4; if (epsra > vol1) return (0); dd = vol1 + vol2 + vol3 + vol4; if (dd != 0.0f) dd = 1.0 / dd; cb[0] = vol1 * dd; cb[1] = vol2 * dd; cb[2] = vol3 * dd; cb[3] = vol4 * dd; return (1); } int locateHexa (pMesh mesh, int nsdep, int base, float *p, double *cb, pPoint pt[4]) { /*double bx, by, bz, cx, cy, cz, dx, dy, dz, vx, vy, vz, apx, apy, apz; double epsra, vol1, vol2, vol3, vol4, dd;*/ int *adj, it, nsfin; it = 0; nsfin = nsdep; /*printf("locateHexa: searching for %f %f %f\n",p[0],p[1],p[2]);*/ do { pHexa ph; int iadr, in; if (!nsfin) return (0); ph = &mesh->hexa[nsfin]; /*printf("\nnsfin %d base %d mark %d\n",nsfin,base,ph->mark);*/ if (!ph->v[0] || ph->mark == base) return (0); ph->mark = base; iadr = 6 * (nsfin - 1) + 1; adj = &mesh->adja[iadr]; /*printf("adj %d %d %d %d %d %d\n",adj[0],adj[1],adj[2],adj[3],adj[4],adj[5]);*/ /* tetra1: 0,2,3,7 : 3 external faces */ /*printf("tet1: %d %d %d %d\n",ph->v[0],ph->v[2],ph->v[3],ph->v[7]);*/ pt[0] = &mesh->point[ph->v[0]]; pt[1] = &mesh->point[ph->v[2]]; pt[2] = &mesh->point[ph->v[3]]; pt[3] = &mesh->point[ph->v[7]]; in = inSubTetra(pt, p, cb); printf("tet1 : on sort en %d\n", in); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == 0) { nsfin = adj[4]; continue; } else if (in == -1) { nsfin = adj[5]; continue; } else if (in == -3) { nsfin = adj[0]; continue; } /* tetra2: 1,4,5,6 : 3 external faces */ pt[0] = &mesh->point[ph->v[1]]; pt[1] = &mesh->point[ph->v[4]]; pt[2] = &mesh->point[ph->v[5]]; pt[3] = &mesh->point[ph->v[6]]; in = inSubTetra(pt, p, cb); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == 0) { nsfin = adj[1]; continue; } else if (in == -1) { nsfin = adj[3]; continue; } else if (in == -3) { nsfin = adj[2]; continue; } /* tetra3: 0,4,6,7 : 2 external faces */ pt[0] = &mesh->point[ph->v[0]]; pt[1] = &mesh->point[ph->v[4]]; pt[2] = &mesh->point[ph->v[6]]; pt[3] = &mesh->point[ph->v[7]]; in = inSubTetra(pt, p, cb); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == 0) { nsfin = adj[1]; continue; } else if (in == -2) { nsfin = adj[5]; continue; } /* tetra4: 0,1,2,6 : 2 external faces */ pt[0] = &mesh->point[ph->v[0]]; pt[1] = &mesh->point[ph->v[1]]; pt[2] = &mesh->point[ph->v[2]]; pt[3] = &mesh->point[ph->v[6]]; in = inSubTetra(pt, p, cb); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == 0) { nsfin = adj[3]; continue; } else if (in == -3) { nsfin = adj[0]; continue; } /* tetra5: 0,6,2,7 : 1 external face */ pt[0] = &mesh->point[ph->v[0]]; pt[1] = &mesh->point[ph->v[6]]; pt[2] = &mesh->point[ph->v[2]]; pt[3] = &mesh->point[ph->v[7]]; in = inSubTetra(pt, p, cb); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == 0) { nsfin = adj[4]; continue; } /* tetra6: 0,4,1,6 : 1 external face */ pt[0] = &mesh->point[ph->v[0]]; pt[1] = &mesh->point[ph->v[4]]; pt[2] = &mesh->point[ph->v[1]]; pt[3] = &mesh->point[ph->v[6]]; in = inSubTetra(pt, p, cb); if (in > 0) { ph->cpt++; return (nsfin); } else if (in == -3) { nsfin = adj[2]; continue; } puts("PROBLEME"); exit(1); } while (++it <= mesh->nhex); return (0); } int locateTria (pMesh mesh, int nsdep, int base, float *p, double *cb) { pPoint p0, p1, p2; int it, nsfin; it = 0; nsfin = nsdep; /*printf("locateTria: searching for %f %f\n",p[0],p[1]);*/ do { pTriangle pt; double ax, ay, bx, by, cx, cy; double epsra, aire1, aire2, aire3, dd; int *adj, iadr, isign; pt = &mesh->tria[nsfin]; if (!pt->v[0]) return (0); if (pt->mark == base) return (0); pt->mark = base; iadr = 3 * (nsfin - 1) + 1; adj = &mesh->adja[iadr]; p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; dd = ax * by - ay * bx; isign = dd > 0 ? 1 : -1; epsra = isign > 0 ? EPST * dd : -(EPST * dd); /* barycentric */ bx = p1->c[0] - p[0]; by = p1->c[1] - p[1]; cx = p2->c[0] - p[0]; cy = p2->c[1] - p[1]; /* p in 1 */ aire1 = isign * (bx * cy - by * cx); if (epsra > aire1) { nsfin = adj[0]; continue; } ax = p0->c[0] - p[0]; ay = p0->c[1] - p[1]; aire2 = isign * (cx * ay - cy * ax); if (epsra > aire2) { nsfin = adj[1]; continue; } aire3 = -epsra * EPSR - aire1 - aire2; if (epsra > aire3) { nsfin = adj[2]; continue; } dd = aire1 + aire2 + aire3; if (dd != 0.0f) dd = 1.0 / dd; cb[0] = aire1 * dd; cb[1] = aire2 * dd; cb[2] = aire3 * dd; pt->cpt++; return (nsfin); } while (++it <= mesh->nt); return (0); } /* point in tetra */ int inTetra (pMesh mesh, int nsdep, float *p, double *cb) { pTetra pt; pPoint p0, p1, p2, p3; double bx, by, bz, cx, cy, cz, dx, dy, dz, vx, vy, vz, apx, apy, apz; double epsra, vol1, vol2, vol3, vol4, dd; pt = &mesh->tetra[nsdep]; if (!pt->v[0]) return (0); p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; p3 = &mesh->point[pt->v[3]]; /* barycentric */ bx = p1->c[0] - p0->c[0]; by = p1->c[1] - p0->c[1]; bz = p1->c[2] - p0->c[2]; cx = p2->c[0] - p0->c[0]; cy = p2->c[1] - p0->c[1]; cz = p2->c[2] - p0->c[2]; dx = p3->c[0] - p0->c[0]; dy = p3->c[1] - p0->c[1]; dz = p3->c[2] - p0->c[2]; /* test volume */ vx = cy * dz - cz * dy; vy = cz * dx - cx * dz; vz = cx * dy - cy * dx; epsra = EPST * (bx * vx + by * vy + bz * vz); apx = p[0] - p0->c[0]; apy = p[1] - p0->c[1]; apz = p[2] - p0->c[2]; /* p in 2 */ vol2 = apx * vx + apy * vy + apz * vz; if (epsra > vol2) return (0); /* p in 3 */ vx = by * apz - bz * apy; vy = bz * apx - bx * apz; vz = bx * apy - by * apx; vol3 = dx * vx + dy * vy + dz * vz; if (epsra > vol3) return (0); /* p in 4 */ vol4 = -cx * vx - cy * vy - cz * vz; if (epsra > vol4) return (0); /* p in 1 */ vol1 = -epsra * EPSR - vol2 - vol3 - vol4; if (epsra > vol1) return (0); dd = vol1 + vol2 + vol3 + vol4; if (dd != 0.0f) dd = 1.0 / dd; cb[0] = vol1 * dd; cb[1] = vol2 * dd; cb[2] = vol3 * dd; cb[3] = vol4 * dd; pt->cpt++; return (1); } int inHexa (pMesh mesh, int nsdep, float *p, double *cb, pPoint pt[4]) { return (0); } int inTria (pMesh mesh, int nsdep, float *p, double *cb) { pTriangle pt; pPoint p0, p1, p2; double ax, ay, bx, by, cx, cy; double epsra, dd, aire1, aire2, aire3; int isign; pt = &mesh->tria[nsdep]; if (!pt->v[0]) return (0); p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; dd = ax * by - ay * bx; isign = dd > 0 ? 1 : -1; epsra = isign > 0 ? EPST * dd : -(EPST * dd); /* barycentric */ bx = p[0] - p1->c[0]; by = p[1] - p1->c[1]; cx = p[0] - p2->c[0]; cy = p[1] - p2->c[1]; aire1 = isign * (bx * cy - by * cx); if (epsra > aire1) return (0); ax = p[0] - p0->c[0]; ay = p[1] - p0->c[1]; aire2 = isign * (cx * ay - cy * ax); if (epsra > aire2) return (0); aire3 = -epsra * EPSR - aire1 - aire2; if (epsra > aire3) return (0); dd = aire1 + aire2 + aire3; if (dd != 0.0f) dd = 1.0 / dd; cb[0] = aire1 * dd; cb[1] = aire2 * dd; cb[2] = aire3 * dd; pt->cpt++; return (1); } /* return size of tetra */ double sizeTetra (pMesh mesh, int k) { pTetra pt; pPoint p[4]; double hmin; int i; static int idire[6][2] = {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}}; pt = &mesh->tetra[k]; for (i = 0; i < 4; i++) { p[i] = &mesh->point[pt->v[i]]; } hmin = FLT_MAX; for (i = 1; i < 6; i++) { double ax, ay, az, dd; ax = p[idire[i][0]]->c[0] - p[idire[i][1]]->c[0]; ay = p[idire[i][0]]->c[1] - p[idire[i][1]]->c[1]; az = p[idire[i][0]]->c[2] - p[idire[i][1]]->c[2]; dd = ax * ax + ay * ay + az * az; hmin = min(dd, hmin); } return (sqrt(hmin)); } double sizeHexa (pMesh mesh, int k) { pHexa ph; pPoint p[8]; double hmin; int i; static int idire[12][2] = {{0, 1}, {1, 2}, {2, 3}, {0, 3}, {4, 5}, {5, 6}, {6, 7}, {4, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7}}; ph = &mesh->hexa[k]; for (i = 0; i < 8; i++) { p[i] = &mesh->point[ph->v[i]]; } hmin = FLT_MAX; for (i = 1; i < 12; i++) { double ax, ay, az, dd; ax = p[idire[i][0]]->c[0] - p[idire[i][1]]->c[0]; ay = p[idire[i][0]]->c[1] - p[idire[i][1]]->c[1]; az = p[idire[i][0]]->c[2] - p[idire[i][1]]->c[2]; dd = ax * ax + ay * ay + az * az; hmin = min(dd, hmin); } return (sqrt(hmin)); } double sizeTria (pMesh mesh, int k) { pTriangle pt; double hmin; int i; static int idir[5] = {0, 1, 2, 0, 1}; pt = &mesh->tria[k]; hmin = FLT_MAX; for (i = 0; i < 3; i++) { pPoint p0, p1; double ax, ay, dd; p0 = &mesh->point[pt->v[i]]; p1 = &mesh->point[pt->v[idir[i + 1]]]; ax = p0->c[0] - p1->c[0]; ay = p0->c[1] - p1->c[1]; dd = ax * ax + ay * ay; hmin = min(dd, hmin); } return (sqrt(hmin)); } double sizeQuad (pMesh mesh, int k) { pQuad pq; double hmin; int i; static int idir[7] = {0, 1, 2, 3, 0, 1, 2}; pq = &mesh->quad[k]; hmin = FLT_MAX; for (i = 0; i < 4; i++) { pPoint p0, p1; double ax, ay, dd; p0 = &mesh->point[pq->v[i]]; p1 = &mesh->point[pq->v[idir[i + 1]]]; ax = p0->c[0] - p1->c[0]; ay = p0->c[1] - p1->c[1]; dd = ax * ax + ay * ay; hmin = min(dd, hmin); } return (sqrt(hmin)); } /* vector interpolation */ double field3DInterp (pMesh mesh, int iel, double *cb, double *v) { pTetra pt; pSolution ps0, ps1, ps2, ps3; double dd; pt = &mesh->tetra[iel]; ps0 = &mesh->sol[pt->v[0]]; ps1 = &mesh->sol[pt->v[1]]; ps2 = &mesh->sol[pt->v[2]]; ps3 = &mesh->sol[pt->v[3]]; v[0] = cb[0] * ps0->m[0] + cb[1] * ps1->m[0] + \ cb[2] * ps2->m[0] + cb[3] * ps3->m[0]; v[1] = cb[0] * ps0->m[1] + cb[1] * ps1->m[1] + \ cb[2] * ps2->m[1] + cb[3] * ps3->m[1]; v[2] = cb[0] * ps0->m[2] + cb[1] * ps1->m[2] + \ cb[2] * ps2->m[2] + cb[3] * ps3->m[2]; dd = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); if (dd > 0.0f) { v[0] /= dd; v[1] /= dd; v[2] /= dd; } return (dd); } /* vector interpolation */ double vector3DInterp (pMesh mesh, pPoint pt[4], double *cb, double *v) { pSolution ps0, ps1, ps2, ps3; double dd; ps0 = &mesh->sol[pt[0] - &mesh->point[0]]; ps1 = &mesh->sol[pt[1] - &mesh->point[0]]; ps2 = &mesh->sol[pt[2] - &mesh->point[0]]; ps3 = &mesh->sol[pt[3] - &mesh->point[0]]; v[0] = cb[0] * ps0->m[0] + cb[1] * ps1->m[0] + \ cb[2] * ps2->m[0] + cb[3] * ps3->m[0]; v[1] = cb[0] * ps0->m[1] + cb[1] * ps1->m[1] + \ cb[2] * ps2->m[1] + cb[3] * ps3->m[1]; v[2] = cb[0] * ps0->m[2] + cb[1] * ps1->m[2] + \ cb[2] * ps2->m[2] + cb[3] * ps3->m[2]; dd = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); if (dd > 0.0f) { v[0] /= dd; v[1] /= dd; v[2] /= dd; } return (dd); } double field2DInterp (pMesh mesh, int iel, double *cb, double *v) { pTriangle pt; pSolution ps0, ps1, ps2; double dd; pt = &mesh->tria[iel]; ps0 = &mesh->sol[pt->v[0]]; ps1 = &mesh->sol[pt->v[1]]; ps2 = &mesh->sol[pt->v[2]]; v[0] = cb[0] * ps0->m[0] + cb[1] * ps1->m[0] + cb[2] * ps2->m[0]; v[1] = cb[0] * ps0->m[1] + cb[1] * ps1->m[1] + cb[2] * ps2->m[1]; v[2] = 0.0f; dd = sqrt(v[0] * v[0] + v[1] * v[1]); if (dd > 0.0f) { v[0] /= dd; v[1] /= dd; } return (dd); } /* add point to display list, if needed */ int filterPoint (pScene sc, Stream *st, float *p, ubyte color) { double norm, rgb[3], ux, uy, uz, vx, vy, vz, dd; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* store point */ memcpy(st->stpt[++st->stnp], p, 3 * sizeof(float)); nbar++; /* point color */ norm = st->norm; if (!color) { double kc; int i; if (norm < sc->iso.val[0]) norm = sc->iso.val[0]; else if (norm > sc->iso.val[MAXISO - 1]) norm = sc->iso.val[MAXISO - 1]; for (i = 0; i < MAXISO - 1; i++) { if (norm < sc->iso.val[i]) break; } kc = (norm - sc->iso.val[i - 1]) / (sc->iso.val[i] - sc->iso.val[i - 1]); st->stcol[st->stnp] = sc->iso.col[i - 1] * (1.0 - kc) + sc->iso.col[i] * kc; st->stiso[st->stnp] = i; } else { st->stcol[st->stnp] = sc->iso.col[MAXISO - 1]; st->stiso[st->stnp] = MAXISO - 1; } if (sc->mode & S_ALTITUDE) st->stpt[st->stnp][2] = altcoef * norm; if (!color && (st->stiso[0] != st->stiso[st->stnp])) { hsv[0] = st->stcol[st->stnp]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex3fv(st->stpt[st->stnp]); memcpy(st->stpt[0], st->stpt[st->stnp], 3 * sizeof(float)); st->stcol[0] = st->stcol[st->stnp]; st->stiso[0] = st->stiso[st->stnp]; st->stnp = 0; return (1); } if (st->stnp < 2) return (0); /* filtering point */ ux = st->stpt[0][0] - st->stpt[1][0]; uy = st->stpt[0][1] - st->stpt[1][1]; uz = st->stpt[0][2] - st->stpt[1][2]; dd = ux * ux + uy * uy + uz * uz; if (dd > 0.0) { dd = 1.0f / sqrt(dd); ux *= dd; uy *= dd; uz *= dd; } else { memcpy(st->stpt[0], st->stpt[1], 2 * 3 * sizeof(float)); st->stnp--; return (0); } vx = st->stpt[2][0] - st->stpt[1][0]; vy = st->stpt[2][1] - st->stpt[1][1]; vz = st->stpt[2][2] - st->stpt[1][2]; dd = vx * vx + vy * vy + vz * vz; if (dd > 0.0) { dd = 1.0f / sqrt(dd); vx *= dd; vy *= dd; vz *= dd; } else { memcpy(st->stpt[1], st->stpt[2], 3 * sizeof(float)); st->stnp--; return (0); } dd = ux * vx + uy * vy + uz * vz; if (dd > COS178) { hsv[0] = st->stcol[st->stnp]; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex3fv(st->stpt[st->stnp]); memcpy(st->stpt[0], st->stpt[st->stnp], 3 * sizeof(float)); st->stcol[0] = st->stcol[st->stnp]; st->stiso[0] = st->stiso[st->stnp]; st->stnp = 0; return (1); } else { memcpy(st->stpt[st->stnp - 1], st->stpt[st->stnp], 3 * sizeof(float)); st->stcol[st->stnp - 1] = st->stcol[st->stnp]; st->stiso[st->stnp - 1] = st->stiso[st->stnp]; st->stnp--; return (0); } } /* add vertex to display list */ void addPoint (pScene sc, Stream *st, float *p, ubyte color) { double norm, rgb[3]; int i; static double hsv[3] = {0.0f, 1.0f, 0.80f}; /* point color */ norm = st->norm; i = MAXISO - 1; if (!color) { double kc; norm = st->norm; if (norm < sc->iso.val[0]) norm = sc->iso.val[0]; else if (norm > sc->iso.val[MAXISO - 1]) norm = sc->iso.val[MAXISO - 1]; for (i = 0; i < MAXISO - 1; i++) { if (norm < sc->iso.val[i]) break; } kc = (norm - sc->iso.val[i - 1]) / (sc->iso.val[i] - sc->iso.val[i - 1]); hsv[0] = sc->iso.col[i - 1] * (1.0 - kc) + sc->iso.col[i] * kc; } if (sc->mode & S_ALTITUDE) p[2] = altcoef * norm; hsvrgb(hsv, rgb); glColor3dv(rgb); glVertex3fv(p); st->stnp = 0; memcpy(st->stpt[st->stnp], p, 3 * sizeof(float)); st->stcol[st->stnp] = hsv[0]; st->stiso[st->stnp] = i; st->stnp++; } int nxtPoint3D (pMesh mesh, int nsdep, float *p, float step, double *v) { pTetra pt; double /*norm, */h6, cb[4], v1[3], v2[3], v3[3]; float xp1[3], xp2[3], xp3[3]; int k; /* 4th order Runge-Kutta */ xp1[0] = p[0] + 0.5 * step * v[0]; xp1[1] = p[1] + 0.5 * step * v[1]; xp1[2] = p[2] + 0.5 * step * v[2]; k = locateTetra(mesh, nsdep, ++mesh->mark, xp1, cb); if (!k) return (0); /*norm = */field3DInterp(mesh, k, cb, v1); pt = &mesh->tetra[k]; pt->cpt--; xp2[0] = p[0] + 0.5 * step * v1[0]; xp2[1] = p[1] + 0.5 * step * v1[1]; xp2[2] = p[2] + 0.5 * step * v1[2]; k = locateTetra(mesh, k, ++mesh->mark, xp2, cb); if (!k) return (0); /*norm = */field3DInterp(mesh, k, cb, v2); pt = &mesh->tetra[k]; pt->cpt--; xp3[0] = p[0] + step * v2[0]; xp3[1] = p[1] + step * v2[1]; xp3[2] = p[2] + step * v2[2]; k = locateTetra(mesh, k, ++mesh->mark, xp3, cb); if (!k) return (0); /*norm = */field3DInterp(mesh, k, cb, v3); pt = &mesh->tetra[k]; pt->cpt--; h6 = step / 6.0; p[0] += h6 * (v[0] + 2 * (v1[0] + v2[0]) + v3[0]); p[1] += h6 * (v[1] + 2 * (v1[1] + v2[1]) + v3[1]); p[2] += h6 * (v[2] + 2 * (v1[2] + v2[2]) + v3[2]); return (1); } int nxtPoint2D (pMesh mesh, int nsdep, float *p, float step, double *v) { pTriangle pt; double /*norm, */h6, cb[3], v1[3], v2[3], v3[3]; float xp1[3], xp2[3], xp3[3]; int k; /* 4th order Runge-Kutta */ xp1[0] = p[0] + 0.5 * step * v[0]; xp1[1] = p[1] + 0.5 * step * v[1]; k = locateTria(mesh, nsdep, ++mesh->mark, xp1, cb); if (!k) return (0); /*norm = */field2DInterp(mesh, k, cb, v1); pt = &mesh->tria[k]; pt->cpt--; xp2[0] = p[0] + 0.5 * step * v1[0]; xp2[1] = p[1] + 0.5 * step * v1[1]; k = locateTria(mesh, k, ++mesh->mark, xp2, cb); if (!k) return (0); /*norm = */field2DInterp(mesh, k, cb, v2); pt = &mesh->tria[k]; pt->cpt--; xp3[0] = p[0] + step * v2[0]; xp3[1] = p[1] + step * v2[1]; k = locateTria(mesh, k, ++mesh->mark, xp3, cb); if (!k) return (0); /*norm = */field2DInterp(mesh, k, cb, v3); pt = &mesh->tria[k]; pt->cpt--; h6 = step / 6.0; p[0] += h6 * (v[0] + 2 * (v1[0] + v2[0]) + v3[0]); p[1] += h6 * (v[1] + 2 * (v1[1] + v2[1]) + v3[1]); return (1); } /* read streamlines origins */ int parseStream (pScene sc, pMesh mesh) { FILE *in; pStream st; float x, y, z; int i, k, nbp, ret; char *ptr, data[128], key[256], tmp[128]; /* input file */ strcpy(tmp, mesh->name); ptr = (char *)strstr(tmp, ".mesh"); if (ptr) *ptr = '\0'; sprintf(data, "%s.iso", tmp); in = fopen(data, "r"); if (!in) { sscanf(data, "DEFAULT.iso"); in = fopen(data, "r"); if (!in) return (0); } if (!quiet) fprintf(stdout, " Reading %s\n", data); sc->stream = createStream(sc, mesh); st = sc->stream; while (!feof(in)) { fscanf(in, "%255s", key); for (i = 0; i < strlen(key); i++) { key[i] = tolower(key[i]); } if (!strcmp(key, "nblines")) { fscanf(in, "%d", &nbp); st->nbstl = nbp; if (mesh->dim == 3) for (k = 1; k <= 3 * st->nbstl; k += 3) { ret = fscanf(in, "%f %f %f\n", &x, &y, &z); printf("x %f %f %f\n", x, y, z); st->listp[k] = x - mesh->xtra; st->listp[k + 1] = y - mesh->ytra; st->listp[k + 2] = z - mesh->ztra; printf("x %f %f %f\n", st->listp[k], st->listp[k + 1], st->listp[k + 2]); } else for (k = 1; k <= 2 * st->nbstl; k += 2) { ret = fscanf(in, "%f %f\n", &x, &y); st->listp[k] = x - mesh->xtra; st->listp[k + 1] = y - mesh->ytra; } } else if (!strcmp(key, "euler")) { st->typtrack = Euler; } else if (!strcmp(key, "box")) { ret = fscanf(in, "%f %f", &x, &y); if (ret != 2) break; st->xmin = x - mesh->xtra; st->xmax = y - mesh->xtra; ret = fscanf(in, "%f %f", &x, &y); if (ret != 2) break; st->ymin = x - mesh->ytra; st->ymax = y - mesh->ytra; if (mesh->dim == 3) { ret = fscanf(in, "%f %f", &x, &y); if (ret != 2) break; st->zmin = x - mesh->ztra; st->zmax = y - mesh->ztra; } } else if (key[0] == '#') { fgets(key, 255, in); } } fclose(in); if (!st->nbstl) { fprintf(stderr, " ## No data found.\n"); return (0); } k = 1; printf("fin proc %f %f %f\n", sc->stream->listp[k], sc->stream->listp[k + 1], sc->stream->listp[k + 2]); return (1); } /* build lists for streamlines */ int listTetraStream (pScene sc, pMesh mesh, float *pp, int squiet) { pTetra pt; pStream st; double dd, cb[4], cbdep[4], v[4], vdep[4], sizedep, normdep; float step, p[3], ldt; int i, k, exh, depart, nsdep, nsfin, nsold, nbp, maxpts; clock_t ct; FILE *out; /* default */ if (!mesh->ntet) return (0); else if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("\n create streamlines list / TETRA\n"); if (!squiet && !ddebug) { fprintf(stdout, " Building streamline(s)"); fflush(stdout); } ct = clock(); /* build display list */ st = sc->stream; if (st->nbstl > MAX_LST - 1) return (0); sc->slist[st->nbstl] = glGenLists(1); glNewList(sc->slist[st->nbstl], GL_COMPILE); if (glGetError()) return (0); k = st->nbstl * 3 + 1; st->listp[k + 0] = pp[0]; st->listp[k + 1] = pp[1]; st->listp[k + 2] = pp[2]; st->nbstl++; printf("\n%d: pp = %f %f %f\n", st->nbstl, st->listp[k + 0], st->listp[k + 1], st->listp[k + 2]); maxpts = max(MAX_PTS, 5 * mesh->ntet); glLineWidth(2.0); /* compute streamline */ nbp = 0; exh = 0; nsdep = mesh->ntet / 2; step = 0.0; nbar = 0; if (ddebug) printf(" start point %d: %f %f %f\n", 3 * k / 3, st->listp[k], st->listp[k + 1], st->listp[k + 2]); for (i = 1; i < mesh->ntet; i++) { pt = &mesh->tetra[i]; pt->cpt = 0; } /* find enclosing tet */ memcpy(p, pp, 3 * sizeof(float)); depart = locateTetra(mesh, nsdep, ++mesh->mark, p, cb); printf("depart = %d\n", depart); if (!depart) { for (depart = 1; depart <= mesh->ntet; depart++) { pt = &mesh->tetra[depart]; if (pt->mark != mesh->mark && inTetra(mesh, depart, p, cb)) break; } if (depart > mesh->ntet) { glEndList(); return (0); } } st->norm = field3DInterp(mesh, depart, cb, v); memcpy(cbdep, cb, 4 * sizeof(double)); memcpy(vdep, v, 4 * sizeof(double)); st->size = sizeTetra(mesh, depart); sizedep = st->size; normdep = st->norm; ldt = 0.0; if (st->size == 0.0) step = EPS * sc->dmax; else step = HSIZ * min(st->size, st->norm); /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; if (sc->par.maxtime < FLT_MAX) { sc->par.cumtim = 0.0; step = min(0.05 * sc->par.dt, step); out = fopen("particules.dat", "a+"); assert(out); fprintf(out, "\n%8.2f %f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra, p[2] + mesh->ztra); } do { float ox, oy, oz; ox = p[0]; oy = p[1]; oz = p[2]; /* move to next point */ if (st->typtrack == Euler || !nxtPoint3D(mesh, nsdep, p, step, v)) { p[0] += step * v[0]; p[1] += step * v[1]; p[2] += step * v[2]; } if (p[0] < st->xmin || p[1] < st->ymin || p[2] < st->zmin || p[0] > st->xmax || p[1] > st->ymax || p[2] > st->zmax) { break; } else if (sc->par.maxtime < FLT_MAX) { ox -= p[0]; oy -= p[1]; oz -= p[2]; dd = sqrt(ox * ox + oy * oy + oz * oz) / st->norm; ldt += dd; sc->par.cumtim += dd; if (sc->par.cumtim > sc->par.maxtime) break; if (ldt > sc->par.dt) { fprintf(out, "%8.2f %f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra, p[2] + mesh->ztra); ldt = fabs(sc->par.dt - ldt); } } /* find tet containing p */ nsfin = locateTetra(mesh, nsdep, ++mesh->mark, p, cb); if (!nsfin) break; nsdep = nsfin; pt = &mesh->tetra[nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeTetra(mesh, nsdep); nsold = nsdep; } /* vector field interpolation */ st->norm = field3DInterp(mesh, nsdep, cb, v); step = HSIZ * min(st->size, st->norm); if (sc->par.maxtime < FLT_MAX) step = min(0.05 * sc->par.dt, step); if (step == 0.0) break; nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); addPoint(sc, st, p, 0); glEnd(); if (nbp >= maxpts || sc->par.maxtime < FLT_MAX) { glLineWidth(1.0); glEndList(); if (!squiet && !ddebug) { fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); ct = difftime(clock(), ct); fprintf(stdout, " %6.2f sec.\n", ct); } if (sc->par.maxtime < FLT_MAX) { fprintf(out, "%8.2f %f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra, p[2] + mesh->ztra); fclose(out); } return (1); } /* reverse orientation */ memcpy(p, pp, 3 * sizeof(float)); memcpy(cb, cbdep, 4 * sizeof(double)); memcpy(v, vdep, 4 * sizeof(double)); st->norm = normdep; st->size = sizedep; if (st->size == 0.0) step = EPS * sc->dmax; else step = HSIZ * min(st->size, st->norm); /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; do { /* move to next point */ if (st->typtrack == Euler || !nxtPoint3D(mesh, nsdep, p, -step, v)) { p[0] -= step * v[0]; p[1] -= step * v[1]; p[2] -= step * v[2]; } if (p[0] < st->xmin || p[1] < st->ymin || p[2] < st->zmin || p[0] > st->xmax || p[1] > st->ymax || p[2] > st->zmax) break; /* find tet containing p */ nsfin = locateTetra(mesh, nsdep, ++mesh->mark, p, cb); if (!nsfin) break; nsdep = nsfin; pt = &mesh->tetra[nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeTetra(mesh, nsdep); nsold = nsdep; } /* vector field interpolation */ st->norm = field3DInterp(mesh, nsdep, cb, v); step = HSIZ * min(st->size, st->norm); if (step == 0.0) break; nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); addPoint(sc, st, p, 0); glEnd(); glLineWidth(1.0); glEndList(); if (!nbp) { st->nbstl--; if (!squiet && !ddebug) fprintf(stdout, "..empty\n"); return (0); } if (!squiet && !ddebug) { if (nbar) fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); ct = difftime(clock(), ct); fprintf(stdout, " %6.2f sec.\n", ct); } return (1); } int listHexaStream (pScene sc, pMesh mesh, float *pp, int squiet) { pHexa ph; pPoint pt[4]; pStream st; double cbdep[4], cb[4], v[6], vdep[6], sizedep, normdep; float step, p[3]; int i, k, exh, depart, nsdep, nsfin, nsold, nbp, maxpts; mytime tt; /* default */ if (!mesh->nhex) return (0); else if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); if (ddebug) printf("create streamlines list / HEXA\n"); if (!squiet && !ddebug) { fprintf(stdout, " Building streamline(s)"); fflush(stdout); chrono(ON, &tt); } /* build display list */ st = sc->stream; if (st->nbstl > MAX_LST - 1) return (0); sc->slist[st->nbstl] = glGenLists(1); glNewList(sc->slist[st->nbstl], GL_COMPILE); if (glGetError()) return (0); st->nbstl++; k = st->nbstl * 3; st->listp[k] = pp[0]; st->listp[k + 1] = pp[1]; st->listp[k + 2] = pp[2]; maxpts = max(MAX_PTS, 5 * mesh->nhex); glLineWidth(2.0); /* compute streamline */ nbp = 0; exh = 0; nsdep = mesh->nhex / 2; step = 0.0f; nbar = 0; if (ddebug) printf(" start point %d: %f %f %f\n", 3 * k / 3, st->listp[k], st->listp[k + 1], st->listp[k + 2]); for (i = 1; i < mesh->nhex; i++) { ph = &mesh->hexa[i]; ph->cpt = 0; } /* find enclosing tet */ memcpy(p, pp, 3 * sizeof(float)); depart = locateHexa(mesh, nsdep, ++mesh->mark, p, cb, pt); printf("DEPART %d\n", depart); ph = &mesh->hexa[depart]; printf("sommets %d %d %d %d %d %d %d %d\n", ph->v[0], ph->v[1], ph->v[2], ph->v[3], ph->v[4], ph->v[5], ph->v[6], ph->v[7]); if (!depart) { for (depart = 1; depart <= mesh->nhex; depart++) { ph = &mesh->hexa[depart]; if (ph->mark != mesh->mark && inHexa(mesh, depart, p, cb, pt)) break; } if (depart > mesh->nhex) return (0); } st->norm = vector3DInterp(mesh, pt, cb, v); memcpy(cbdep, cb, 4 * sizeof(double)); memcpy(vdep, v, 4 * sizeof(double)); st->size = sizeHexa(mesh, depart); sizedep = st->size; normdep = st->norm; if (st->size == 0.0f) step = EPS * sc->dmax; else step = HSIZ * st->size; /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; do { /* move to next point */ if (st->typtrack == Euler || !nxtPoint3D(mesh, nsdep, p, step, v)) { p[0] += step * v[0]; p[1] += step * v[1]; p[2] += step * v[2]; } if (p[0] < st->xmin || p[1] < st->ymin || p[2] < st->zmin || p[0] > st->xmax || p[1] > st->ymax || p[2] > st->zmax) break; /* find tet containing p */ nsfin = locateHexa(mesh, nsdep, ++mesh->mark, p, cb, pt); if (!nsfin) break; nsdep = nsfin; ph = &mesh->hexa[nsdep]; if (ph->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeHexa(mesh, nsdep); step = HSIZ * st->size; nsold = nsdep; } /* vector field interpolation */ st->norm = vector3DInterp(mesh, pt, cb, v); if (st->norm < EPS * step) break; step = min(step, st->norm); if (step == 0.0f) break;/*step = 1.0e-06*sc->dmax;*/ nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); glEnd(); if (nbp >= maxpts) { glLineWidth(1.0); glEndList(); if (!squiet && !ddebug) { fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); chrono(OFF, &tt); fprintf(stdout, " %6.2f sec.\n", gttime(tt)); } return (1); } /* reverse orientation */ memcpy(p, pp, 3 * sizeof(float)); memcpy(cb, cbdep, 4 * sizeof(double)); memcpy(v, vdep, 4 * sizeof(double)); st->norm = normdep; st->size = sizedep; if (st->size == 0.0f) step = EPS * sc->dmax; else step = HSIZ * st->size; /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; do { /* move to next point */ if (st->typtrack == Euler || !nxtPoint3D(mesh, nsdep, p, -step, v)) { p[0] -= step * v[0]; p[1] -= step * v[1]; p[2] -= step * v[2]; } if (p[0] < st->xmin || p[1] < st->ymin || p[2] < st->zmin || p[0] > st->xmax || p[1] > st->ymax || p[2] > st->zmax) break; /* find tet containing p */ nsfin = locateHexa(mesh, nsdep, ++mesh->mark, p, cb, pt); if (!nsfin) break; nsdep = nsfin; ph = &mesh->hexa[nsdep]; if (ph->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeHexa(mesh, nsdep); step = HSIZ * st->size; nsold = nsdep; } /* vector field interpolation */ st->norm = vector3DInterp(mesh, pt, cb, v); if (st->norm < EPS * step) break; step = min(step, st->norm); if (step == 0.0f) break;/*step = 1.e-06 * sc->dmax;*/ nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); glEnd(); glLineWidth(1.0); glEndList(); if (nbp >= maxpts) { glLineWidth(1.0); glEndList(); if (!squiet && !ddebug) { fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); chrono(OFF, &tt); fprintf(stdout, " %6.2f sec.\n", gttime(tt)); } return (1); } if (!nbp) { st->nbstl--; if (!squiet && !ddebug) fprintf(stdout, "..empty\n"); return (0); } if (!squiet && !ddebug) { if (nbar) fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); chrono(OFF, &tt); fprintf(stdout, " %6.2f sec.\n", gttime(tt)); } return (1); } int listTriaStream (pScene sc, pMesh mesh, float *pp) { pTriangle pt; pStream st; double dd, cb[3], cbdep[3], v[3], vdep[3], sizedep, normdep; float step, p[3], ldt; int i, k, exh, depart, nsdep, nsfin, nsold, nbp, maxpts; clock_t ct; FILE *out; /* default */ if (!mesh->nt) return (0); if (ddebug) printf("create streamlines / TRIA\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); fprintf(stdout, " Building streamline(s)"); fflush(stdout); ct = clock(); /* build display list */ st = sc->stream; if (st->nbstl > MAX_LST - 1) return (0); sc->slist[st->nbstl] = glGenLists(1); glNewList(sc->slist[st->nbstl], GL_COMPILE); if (glGetError()) return (0); st->nbstl++; k = st->nbstl * 3; st->listp[k] = pp[0]; st->listp[k + 1] = pp[1]; st->listp[k + 2] = pp[2]; maxpts = max(MAX_PTS, 5 * mesh->nt); glLineWidth(2.0); /* compute streamlines */ nbp = 0; exh = 0; nsdep = mesh->nt / 2; step = 0.0; nbar = 0; if (ddebug) printf(" start point %d: %f %f\n", 3 * k / 3, st->listp[k], st->listp[k + 1]); for (i = 1; i <= mesh->nt; i++) { pt = &mesh->tria[i]; pt->cpt = 0; } /* find enclosing triangle */ memcpy(p, pp, 3 * sizeof(float)); depart = locateTria(mesh, nsdep, ++mesh->mark, p, cb); if (!depart) { if (ddebug) printf("exhaustif search\n"); for (depart = 1; depart <= mesh->nt; depart++) { pt = &mesh->tria[depart]; if (pt->mark != mesh->mark && inTria(mesh, depart, p, cb)) break; } if (depart > mesh->nt) { st->nbstl--; glEndList(); glLineWidth(1.0); fflush(stdout); return (0); } } st->norm = field2DInterp(mesh, depart, cb, v); memcpy(cbdep, cb, 3 * sizeof(double)); memcpy(vdep, v, 3 * sizeof(double)); st->size = sizeTria(mesh, depart); sizedep = st->size; normdep = st->norm; ldt = 0.0; if (st->size == 0.0) step = EPS * sc->dmax; else step = HSIZ * min(st->size, st->norm); /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; if (sc->par.maxtime < FLT_MAX) { sc->par.cumtim = 0.0; step = min(0.05 * sc->par.dt, step); out = fopen("particules.dat", "a+"); assert(out); fprintf(out, "\n%8.2f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra); } do { float ox, oy; ox = p[0]; oy = p[1]; /* move to next point */ if (st->typtrack == Euler || !nxtPoint2D(mesh, nsdep, p, step, v)) { p[0] += step * v[0]; p[1] += step * v[1]; } if (p[0] < st->xmin || p[1] < st->ymin || p[0] > st->xmax || p[1] > st->ymax) { break; } else if (sc->par.maxtime < FLT_MAX) { ox -= p[0]; oy -= p[1]; dd = sqrt(ox * ox + oy * oy) / st->norm; ldt += dd; sc->par.cumtim += dd; if (sc->par.cumtim >= sc->par.maxtime) break; if (ldt > sc->par.dt) { fprintf(out, "%8.2f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra); ldt = fabs(sc->par.dt - ldt); } } /* find tet containing p */ nsfin = locateTria(mesh, nsdep, ++mesh->mark, p, cb); if (!nsfin) break; nsdep = nsfin; pt = &mesh->tria[nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeTria(mesh, nsdep); nsold = nsdep; } /* vector field interpolation */ st->norm = field2DInterp(mesh, nsdep, cb, v); step = HSIZ * min(st->size, st->norm); if (sc->par.maxtime < FLT_MAX) step = min(0.05 * sc->par.dt, step); if (step == 0.0) break; nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); addPoint(sc, st, p, 0); glEnd(); if (nbp >= maxpts || sc->par.maxtime < FLT_MAX) { glLineWidth(1.0); glEndList(); fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); ct = difftime(clock(), ct); fprintf(stdout, " %6.2f sec.\n", ct); if (sc->par.maxtime < FLT_MAX) { fprintf(out, "%8.2f %f %f\n", sc->par.cumtim, p[0] + mesh->xtra, p[1] + mesh->ytra); fclose(out); } return (1); } /* reverse orientation */ memcpy(p, pp, 3 * sizeof(float)); memcpy(cb, cbdep, 3 * sizeof(double)); memcpy(v, vdep, 3 * sizeof(double)); st->norm = normdep; st->size = sizedep; if (st->size == 0.0) step = EPS * sc->dmax; else step = HSIZ * st->size; /* build display list incrementally */ nsdep = nsold = depart; glBegin(GL_LINE_STRIP); addPoint(sc, st, p, 0); nbp++; do { /* move to next point */ if (st->typtrack == Euler || !nxtPoint2D(mesh, nsdep, p, -step, v)) { p[0] -= step * v[0]; p[1] -= step * v[1]; } if (p[0] < st->xmin || p[1] < st->ymin || p[0] > st->xmax || p[1] > st->ymax) break; /* find tet containing p */ nsfin = locateTria(mesh, nsdep, ++mesh->mark, p, cb); if (!nsfin) break; nsdep = nsfin; pt = &mesh->tria[nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeTria(mesh, nsdep); nsold = nsdep; } /* vector field interpolation */ st->norm = field2DInterp(mesh, nsdep, cb, v); step = HSIZ * min(st->size, st->norm); if (step == 0.0) break; nbp += filterPoint(sc, st, p, 0); } while (nbp < maxpts); addPoint(sc, st, p, 0); glEnd(); glLineWidth(1.0); glEndList(); if (!nbp) { st->nbstl--; fprintf(stdout, ".. empty.\n"); return (0); } /*if ( ddebug ) */ if (nbar) fprintf(stdout, ": %d (%d, %.2f) / %d lines", nbar, nbp, (float)nbp / nbar, k / 3); ct = difftime(clock(), ct); fprintf(stdout, " %6.2f sec.\n", ct); return (1); } int listSaddleStream (pScene sc, pMesh mesh, int depart, float *pp, float *vv, double lambda) { pTriangle pt; pStream st; double cb[3], v[3]; float sens, step, p[3]; int i, k, nsdep, nsold, nbp, maxpts; /* default */ if (!mesh->nt) return (0); if (ddebug) printf("create streamlines for saddle point\n"); if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ st = sc->stream; if (st->nbstl > MAX_LST - 1) return (0); sc->slist[st->nbstl] = glGenLists(1); glNewList(sc->slist[st->nbstl], GL_COMPILE); if (glGetError()) return (0); maxpts = max(MAX_PTS, 5 * mesh->nt); glLineWidth(2.0); st->nbstl++; k = st->nbstl * 3; st->listp[k] = p[0] = pp[0]; st->listp[k + 1] = p[1] = pp[1]; st->listp[k + 2] = p[2] = 0.0f; for (i = 1; i <= mesh->nt; i++) { pt = &mesh->tria[i]; pt->cpt = 0; } /* compute streamlines */ nsold = nsdep = depart; nbp = nbar = 0; glBegin(GL_LINE_STRIP); addPoint(sc, st, pp, 1); st->size = sizeTria(mesh, depart); st->norm = sqrt(vv[0] * vv[0] + vv[1] * vv[1]); if (st->size == 0.0f) step = EPS * sc->dmax; else step = HSIZ * st->size; if (st->norm > 0.0f) { v[0] = vv[0] / st->norm; v[1] = vv[1] / st->norm; } sens = lambda < 0.0f ? -1. : 1.; /* build display list incrementally */ do { int nsfin; /* move to next point */ if (st->typtrack == Euler || !nxtPoint2D(mesh, nsdep, p, step, v)) { p[0] += sens * step * v[0]; p[1] += sens * step * v[1]; } if (p[0] < st->xmin || p[1] < st->ymin || p[0] > st->xmax || p[1] > st->ymax) break; /* find tet containing p */ nsfin = locateTria(mesh, nsdep, ++mesh->mark, p, cb); if (!nsfin) break; nsdep = nsfin; pt = &mesh->tria[nsdep]; if (pt->cpt > MAX_CPT) break; /* adjust local stepsize */ if (nsdep != nsold) { st->size = sizeTria(mesh, nsdep); step = HSIZ * st->size; nsold = nsdep; } /* vector field interpolation */ st->norm = field2DInterp(mesh, nsdep, cb, v); if (st->norm < EPS * step) break; step = min(step, st->norm); if (step == 0.0f) break; nbp += filterPoint(sc, st, p, 1); } while (nbp < maxpts); glEnd(); glLineWidth(1.0); glEndList(); if (!nbp) { glDeleteLists(sc->slist[st->nbstl--], 1); return (0); } return (1); } pStream createStream (pScene sc, pMesh mesh) { pStream st; /* hash simplices */ if (mesh->dim == 2) { if (mesh->nt && !hashTria(mesh)) return (0); } else { if (mesh->ntet && !hashTetra(mesh)) return (0); if (mesh->nhex && !hashHexa(mesh)) return (0); } st = (pStream)calloc(1, sizeof(struct sstream)); if (!st) return (0); /*st->typtrack = Euler;*/ st->typtrack = RK4; st->stnp = 0; st->nbstl = 0; /* bounding box */ st->xmin = mesh->xmin - mesh->xtra; st->ymin = mesh->ymin - mesh->ytra; st->zmin = mesh->zmin - mesh->ztra; st->xmax = mesh->xmax - mesh->xtra; st->ymax = mesh->ymax - mesh->ytra; st->zmax = mesh->zmax - mesh->ztra; /* init list */ st->listp = (float *)malloc((MAX_LST * 3 + 1) * sizeof(float)); assert(st->listp); sc->slist = (GLuint *)calloc(MAX_LST, sizeof(GLuint)); if (!sc->slist) { free(st); return (0); } return (st); } /* create from point picking */ int streamRefPoint (pScene sc, pMesh mesh) { pPoint ppt; float s[3]; ppt = &mesh->point[refitem]; if (ppt->flag) return (0); s[0] = ppt->c[0]; s[1] = ppt->c[1]; s[2] = ppt->c[2]; if (mesh->dim == 2) { listTriaStream(sc, mesh, s); } else { if (mesh->ntet) listTetraStream(sc, mesh, s, 0); else if (mesh->nhex) listHexaStream(sc, mesh, s, 0); } ppt->flag = 1; return (1); } /* read starting point in file.iso */ int streamIsoPoint (pScene sc, pMesh mesh) { pStream st; int nbp, nbstl; time_t t; if (!parseStream(sc, mesh)) return (0); t = clock(); fprintf(stdout, " Building streamline(s)"); fflush(stdout); st = sc->stream; nbstl = st->nbstl; nbp = 0; st->nbstl = 0; if (mesh->dim == 3) { int k; if (!mesh->ntet) return (0); nbp = 0; for (k = 1; k <= 3 * nbstl; k += 3) { printf("\n ici: %f %f %f\n", st->listp[k], st->listp[k + 1], st->listp[k + 2]); nbp += listTetraStream(sc, mesh, &st->listp[k], 1); } } if (!nbp) return (0); if (ddebug) printf("stream start: %d points ", nbp); fprintf(stdout, ": %d lines", nbp); t = clock() - t; fprintf(stdout, " %6.2f sec.\n", t / (float)CLOCKS_PER_SEC); return (1); } int streamRefTria (pScene sc, pMesh mesh) { pMaterial pm; pTriangle pt; pPoint ppt; float s[3]; int i, k, nmat, nbp, base; time_t t; /* build list */ base = ++mesh->mark; nbp = 0; pt = &mesh->tria[refitem]; nmat = matRef(sc, pt->ref); /*nmat = !pt->ref ? DEFAULT_MAT : 1+(pt->ref-1)%(sc->par.nbmat-1);*/ pm = &sc->material[nmat]; k = pm->depmat[LTria]; if (!k || pm->flag) return (0); t = clock(); fprintf(stdout, " Building streamline(s)"); fflush(stdout); for (i = 1; i <= mesh->np; i++) { ppt = &mesh->point[i]; ppt->mark = base; } ++base; while (k != 0) { pt = &mesh->tria[k]; if (!pt->v[0]) { k = pt->nxt; continue; } for (i = 0; i < 3; i++) { ppt = &mesh->point[pt->v[i]]; if (ppt->mark != base) { ppt->mark = base; s[0] = ppt->c[0]; s[1] = ppt->c[1]; s[2] = ppt->c[2]; if (++nbp > MAX_LST - 1) break; listTetraStream(sc, mesh, s, 1); ppt->flag = 1; } } k = pt->nxt; } if (!nbp) return (0); if (ddebug) printf("stream start: %d points ", nbp); fprintf(stdout, ": %d lines", nbp); t = clock() - t; fprintf(stdout, " %6.2f sec.\n", t / (float)CLOCKS_PER_SEC); return (1); } int streamRefQuad (pScene sc, pMesh mesh) { pMaterial pm; pQuad pq; pPoint ppt; float s[3]; int i, k, nmat, nbp, base; time_t t; /* build list */ base = ++mesh->mark; nbp = 0; pq = &mesh->quad[refitem]; nmat = matRef(sc, pq->ref); /*nmat = !pt->ref ? DEFAULT_MAT : 1+(pt->ref-1)%(sc->par.nbmat-1);*/ pm = &sc->material[nmat]; k = pm->depmat[LQuad]; if (!k || pm->flag) return (0); t = clock(); fprintf(stdout, " Building streamline(s)"); fflush(stdout); for (i = 1; i <= mesh->np; i++) { ppt = &mesh->point[i]; ppt->mark = base; } ++base; while (k != 0) { pq = &mesh->quad[k]; if (!pq->v[0]) { k = pq->nxt; continue; } for (i = 0; i < 4; i++) { ppt = &mesh->point[pq->v[i]]; if (ppt->mark != base) { ppt->mark = base; s[0] = ppt->c[0]; s[1] = ppt->c[1]; s[2] = ppt->c[2]; if (++nbp > MAX_LST - 1) break; listHexaStream(sc, mesh, s, 1); ppt->flag = 1; } } k = pq->nxt; } if (!nbp) return (0); if (ddebug) printf("stream start: %d points ", nbp); fprintf(stdout, ": %d lines", nbp); t = clock() - t; fprintf(stdout, " %6.2f sec.\n", t / (float)CLOCKS_PER_SEC); return (1); } freefem++-3.61-1/src/medit/inout_popenbinaire.c000644 000767 000024 00000065211 13312446271 021536 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "libmesh5.h" #include "extern.h" #include "string.h" #ifdef WIN32 #include #endif #define WrdSiz 4 static int debug = 0; void getline_bin_float_vertex (int ddim, double *c, int *ref) { int i; float ff; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(ff), WrdSiz, 1, stdin); c[i] = ff; } fread((unsigned char *)&(*ref), WrdSiz, 1, stdin); } void getline_bin_double_vertex (int ddim, double *c, int *ref) { int i; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(c[i]), WrdSiz, 2, stdin); } fread((unsigned char *)&(*ref), WrdSiz, 1, stdin); } void getline_bin_elem (int ddim, int *v, int *ref) { int i; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(v[i]), WrdSiz, 1, stdin); } fread((unsigned char *)&(*ref), WrdSiz, 1, stdin); } void getline_bin_edge (int *v0, int *v1, int *ref) { fread((unsigned char *)&(*v0), WrdSiz, 1, stdin); fread((unsigned char *)&(*v1), WrdSiz, 1, stdin); fread((unsigned char *)&(*ref), WrdSiz, 1, stdin); } void getline_bin_int_noref (int ddim, int *v) { int i; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(v[i]), WrdSiz, 1, stdin); } } void getline_bin_float_noref (int ddim, double *v) { int i; float ff; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(ff), WrdSiz, 1, stdin); if (debug) printf("value of ff %f\n", ff); v[i] = ff; } } void getline_bin_double_noref (int ddim, double *v) { int i; for (i = 0; i < ddim; i++) { fread((unsigned char *)&(v[i]), WrdSiz, 2, stdin); } } /**********************************/ /* function for loadsol_popen */ void read_TypeSizeTyptab_bin (int *type, int *size, int *typtab) { int i; int tmptype; int tmpsize; fread((unsigned char *)&(tmptype), WrdSiz, 1, stdin); assert(tmptype <= GmfMaxTyp); tmpsize = 0; for (i = 0; i < tmptype; i++) { fread((unsigned char *)&(typtab[i]), WrdSiz, 1, stdin); // printf("typtab[%i]=%i\n",i,typtab[i]); tmpsize += typtab[i]; } *size = tmpsize; *type = tmptype; } int loadMesh_popen_bin (pMesh mesh) { pPoint ppt; pEdge pr; pTriangle pt; pQuad pq; pTetra ptet; pHexa ph; double d, dp1, dp2, dp3, dn[3]; float *n, fp1, fp2, fp3; int i, ia, ib, inm, ref, is, k, disc, nn, nt, nq; char *ptr, data[256]; /* Rajout popen*/ char *tictac; char *natureread; int loopdebug; int vatn[2]; int tvatn[3]; /* variable rajouter pour popen */ int retcode = 0; int cod; int KwdCod; int NulPos; int NextKwdPos; /* rajout */ float ftab[3]; #ifdef WIN32 _setmode(fileno(stdin), O_BINARY); #endif /* parse keywords */ mesh->np = 0; mesh->nt = 0; mesh->nq = 0; mesh->ntet = 0; mesh->nhex = 0; mesh->nc = 0; mesh->nr = 0; mesh->na = 0; mesh->nri = 0; mesh->nre = 0; mesh->nvn = 0; mesh->ntg = 0; mesh->ne = mesh->nt + mesh->nq + mesh->ntet + mesh->nhex; loopdebug = -1; // read code fread((unsigned char *)&cod, WrdSiz, 1, stdin); if (cod != 1) { printf("error in reading the binary file .meshb with popen\n"); exit(1); } fread((unsigned char *)&(mesh->ver), WrdSiz, 1, stdin); fread((unsigned char *)&KwdCod, WrdSiz, 1, stdin); if (KwdCod != GmfDimension) { printf("error in reading the binary file .meshb with popen\n"); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->dim), WrdSiz, 1, stdin); /*control of the dimension*/ if ((mesh->dim != 2) && (mesh->dim != 3)) printf("the dimension is not correct"); if (debug) printf("reading dimension %i \n", mesh->dim); while (!feof(stdin)) { loopdebug = loopdebug + 1; fread((unsigned char *)&KwdCod, WrdSiz, 1, stdin); /* determination of KwdCod */ if (debug) printf("reading KwdCod %i %i\n", KwdCod, loopdebug); switch (KwdCod) { case GmfVertices: natureread = "Vertices"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->np), WrdSiz, 1, stdin); if (debug) printf(": number of vertices %i\n", mesh->np); if (!mesh->np) { if (debug) fprintf(stdout, " ## No vertex\n"); retcode = -1; goto Lret; } if (ddebug) printf("allocate %d points\n", mesh->np); mesh->point = (pPoint)M_calloc(mesh->np + 1, sizeof(Point), "zaldy1.point"); assert(mesh->point); for (k = 1; k <= mesh->np; k++) { // if(0) printf("lecture point du maillage k=%i np=%i ver=%i \n",k,mesh->np,mesh->ver); ppt = &mesh->point[k]; if (mesh->ver == GmfFloat) getline_bin_float_vertex(mesh->dim, ppt->c, &ref); else getline_bin_double_vertex(mesh->dim, ppt->c, &ref); ppt->ref = ref & 0x7fff; ppt->tag = M_UNUSED; } ppt = &mesh->point[k]; break; case GmfTriangles: natureread = "Triangles"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nt), WrdSiz, 1, stdin); if (debug) printf(": number of triangles %i\n", mesh->nt); if (ddebug) printf("allocate %d tria\n", mesh->nt); mesh->tria = (pTriangle)M_calloc(mesh->nt + 1, sizeof(Triangle), "zaldy1.tria"); assert(mesh->tria); disc = 0; for (k = 1; k <= mesh->nt; k++) { pt = &mesh->tria[k]; getline_bin_elem(3, pt->v, &ref); pt->ref = ref & 0x7fff; for (i = 0; i < 3; i++) { if (pt->v[i] < 1 || pt->v[i] > mesh->np) { disc++; pt->v[0] = 0; break; } else { ppt = &mesh->point[pt->v[i]]; ppt->tag &= ~M_UNUSED; } } } break; case GmfQuadrilaterals: natureread = "Quadrilateral"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nq), WrdSiz, 1, stdin); if (debug) printf(": number of hexahedrons %i\n", mesh->nq); if (ddebug) printf("allocate %d quad\n", mesh->nq); if (mesh->nq) { mesh->quad = (pQuad)M_calloc(mesh->nq + 1, sizeof(Quad), "zaldy1.quad"); assert(mesh->quad); } for (k = 1; k <= mesh->nq; k++) { pq = &mesh->quad[k]; getline_bin_elem(4, pq->v, &ref); pq->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (pq->v[i] < 1 || pq->v[i] > mesh->np) { disc++; pq->v[0] = 0; break; } else { ppt = &mesh->point[pq->v[i]]; ppt->tag &= ~M_UNUSED; } } } break; case GmfTetrahedra: natureread = "Tetrahedra"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->ntet), WrdSiz, 1, stdin); if (debug) printf(": number of tetrahedrons %i\n", mesh->ntet); if (mesh->ntet) { if (ddebug) printf("allocate %d tetra\n", mesh->ntet); mesh->tetra = (pTetra)M_calloc(mesh->ntet + 1, sizeof(Tetra), "zaldy1.tetra"); assert(mesh->tetra); } for (k = 1; k <= mesh->ntet; k++) { ptet = &mesh->tetra[k]; getline_bin_elem(4, ptet->v, &ref); ptet->ref = ref & 0x7fff; for (i = 0; i < 4; i++) { if (ptet->v[i] < 1 || ptet->v[i] > mesh->np) { disc++; ptet->v[0] = 0; break; } else { ppt = &mesh->point[ptet->v[i]]; ppt->tag &= ~M_UNUSED; } } } break; case GmfHexahedra: natureread = "Hexahedra"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nhex), WrdSiz, 1, stdin); if (debug) printf(": number of hexahedrons %i\n", mesh->nhex); if (ddebug) printf("allocate %d hexa\n", mesh->nhex); mesh->hexa = (pHexa)M_calloc(mesh->nhex + 1, sizeof(Hexa), "zaldy1.hexa"); assert(mesh->hexa); for (k = 1; k <= mesh->nhex; k++) { ph = &mesh->hexa[k]; getline_bin_elem(8, ph->v, &ref); ph->ref = ref & 0x7fff; for (i = 0; i < 8; i++) { if (ph->v[i] < 1 || ph->v[i] > mesh->np) { disc++; ph->v[0] = 0; break; } else { ppt = &mesh->point[ph->v[i]]; ppt->tag &= ~M_UNUSED; } } } break; case GmfCorners: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nc), WrdSiz, 1, stdin); for (k = 1; k <= mesh->nc; k++) { fread((unsigned char *)&is, WrdSiz, 1, stdin); // fgets(data,256,stdin); tictac = strtok(data," \n"); is = atoi(tictac); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_CORNER; ppt->tag &= ~M_UNUSED; } } break; case GmfRequiredVertices: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nr), WrdSiz, 1, stdin); for (k = 1; k <= mesh->nr; k++) { // fgets(data,256,stdin); tictac = strtok(data," \n"); is = atoi(tictac); fread((unsigned char *)&is, WrdSiz, 1, stdin); if (is < 1 || is > mesh->np) { disc++; } else { ppt = &mesh->point[is]; ppt->tag |= M_REQUIRED; ppt->tag &= ~M_UNUSED; } } break; case GmfEdges: natureread = "Edges"; if (debug) printf("reading %s", natureread); fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->na), WrdSiz, 1, stdin); if (debug) printf(": number of edges %i\n", mesh->na); if (ddebug) printf("allocate %d edges\n", mesh->na); mesh->edge = (pEdge)M_calloc(mesh->na + 1, sizeof(Edge), "zaldy1.edge"); assert(mesh->edge); for (k = 1; k <= mesh->na; k++) { getline_bin_edge(&ia, &ib, &ref); if (ia < 1 || ia > mesh->np || ib < 1 || ib > mesh->np) { disc++; } else { pr = &mesh->edge[k]; pr->v[0] = ia; pr->v[1] = ib; pr->ref = ref & 0x7fff; pr->tag = !pr->ref ? M_NOTAG : M_TAG; ppt = &mesh->point[ia]; ppt->tag &= ~M_UNUSED; ppt = &mesh->point[ib]; ppt->tag &= ~M_UNUSED; } } break; case GmfRidges: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nri), WrdSiz, 1, stdin); for (k = 1; k <= mesh->nri; k++) { // getline_1int( natureread, &is); fread((unsigned char *)&is, WrdSiz, 1, stdin); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_RIDGE; } } break; case GmfRequiredEdges: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nre), WrdSiz, 1, stdin); for (k = 2; k <= mesh->nre; k++) { // getline_1int( natureread, &is); fread((unsigned char *)&is, WrdSiz, 1, stdin); if (is < 1 || is > mesh->na) { disc++; } else { pr = &mesh->edge[is]; pr->tag |= M_REQUIRED; } } break; case GmfNormals: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->nvn), WrdSiz, 1, stdin); /* allocation */ if (!mesh->ntg) { mesh->extra = (pExtra)M_calloc(1, sizeof(Extra), "zaldy1.extra"); assert(mesh->extra); } mesh->extra->n = (float *)M_calloc(3 * mesh->nvn + 1, sizeof(float), "inmesh"); assert(mesh->extra->n); for (k = 1; k <= mesh->nvn; k++) { n = &mesh->extra->n[3 * (k - 1) + 1]; if (mesh->ver == GmfFloat) getline_bin_float_noref(3, dn); else getline_bin_double_noref(3, dn); n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } break; case GmfNormalAtVertices: if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->extra->iv), WrdSiz, 1, stdin); mesh->extra->nv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->nv); for (k = 1; k <= mesh->extra->iv; k++) { // GmfGetLin(inm,GmfNormalAtVertices,&nn,&is); getline_bin_int_noref(2, vatn); nn = vatn[0]; is = vatn[1]; if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->nv[nn] = is; } break; case GmfNormalAtTriangleVertices: if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->extra->it), WrdSiz, 1, stdin); mesh->extra->nt = (int *)M_calloc(3 * mesh->nt + 1, sizeof(int), "inmesh"); assert(mesh->extra->nt); for (k = 1; k <= mesh->extra->it; k++) { // GmfGetLin(inm,GmfNormalAtTriangleVertices,&nt,&is,&nn); getline_bin_int_noref(3, tvatn); tvatn[0] = nt; tvatn[1] = is; tvatn[2] = nn; if (nt < 1 || nt > mesh->nt || is < 1 || is > 3 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nt[3 * (nt - 1) + is] = nn; } break; case GmfNormalAtQuadrilateralVertices: if (!mesh->nvn) { printf("The field Normal need to be reading before %s", natureread); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->extra->iq), WrdSiz, 1, stdin); mesh->extra->nq = (int *)M_calloc(4 * mesh->nq + 1, sizeof(int), "inmesh"); assert(mesh->extra->nq); for (k = 1; k <= mesh->extra->iq; k++) { // GmfGetLin(inm,GmfNormalAtQuadrilateralVertices,&nq,&is,&nn); getline_bin_int_noref(3, tvatn); tvatn[0] = nq; tvatn[1] = is; tvatn[2] = nn; if (nq < 1 || nq > mesh->nq || is < 1 || is > 4 || nn < 1 || nn > mesh->nvn) disc++; else mesh->extra->nq[3 * (nq - 1) + is] = nn; } break; case GmfTangents: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->ntg), WrdSiz, 1, stdin); if (!mesh->nvn) { mesh->extra = (pExtra)M_calloc(1, sizeof(Extra), "zaldy1.extra"); assert(mesh->extra); } mesh->extra->t = (float *)M_calloc(3 * mesh->ntg + 1, sizeof(float), "inmesh"); assert(mesh->extra->t); for (k = 1; k <= mesh->ntg; k++) { n = &mesh->extra->t[3 * (k - 1) + 1]; if (mesh->ver == GmfFloat) getline_bin_float_noref(3, dn); else getline_bin_double_noref(3, dn); n[0] = dn[0]; n[1] = dn[1]; n[2] = dn[2]; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0) { d = 1.0 / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } } break; case GmfTangentAtVertices: if (!mesh->ntg) { printf("The field Tangent need to be reading before %s", natureread); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->extra->tv), WrdSiz, 1, stdin); mesh->extra->tv = (int *)M_calloc(mesh->np + 1, sizeof(int), "inmesh"); assert(mesh->extra->tv); for (k = 1; k <= mesh->extra->jv; k++) { getline_bin_int_noref(2, vatn); nn = vatn[0]; is = vatn[1]; if (nn < 1 || nn > mesh->np) disc++; else mesh->extra->tv[nn] = is; } break; case GmfTangentAtEdgeVertices: if (!mesh->ntg) { printf("The field Tangent need to be reading before %s", natureread); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&(mesh->extra->je), WrdSiz, 1, stdin); mesh->extra->te = (int *)M_calloc(2 * mesh->na + 1, sizeof(int), "inmesh"); assert(mesh->extra->te); for (k = 1; k <= mesh->extra->je; k++) { getline_bin_int_noref(3, tvatn); nt = tvatn[0]; is = tvatn[1]; nn = tvatn[2]; if (nt < 1 || nt > mesh->np || is < 1 || is > 2 || nn < 1 || nn > mesh->ntg) disc++; else mesh->extra->te[3 * (nt - 1) + is] = is; } break; case GmfEnd: fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); printf("End of mesh\n"); break; default: printf("This data KwdCod it is not taken in this version\n"); exit(1); break; } if (KwdCod == GmfEnd) break; /* * if( KwdCod == GmfVertices ){ * } * else if(KwdCod == GmfTriangles){ * } * else if(KwdCod == GmfQuadrilaterals){ * } * else if(KwdCod == GmfTetrahedra){ * } * else if(KwdCod == GmfHexahedra){ * } * else if(KwdCod == GmfCorners){ * } * else if(KwdCod == GmfRequiredVertices){ * } * else if(KwdCod == GmfEdges){ * } * else if(KwdCod == GmfRidges){ * } * else if(KwdCod == GmfRequiredEdges){ * } * else if(KwdCod == GmfNormals){ * } * else if(KwdCod == GmfTangents){ * } * else if(KwdCod == GmfEnd){ * } * else{ * printf("This data KwdCod it is not taken in this version\n"); * exit(1); * } */ } /* check if vertices and elements found */ if (!mesh->np) { fprintf(stdout, " ## No vertex\n"); retcode = -1; goto Lret; } mesh->ne = mesh->nt + mesh->nq + mesh->ntet + mesh->nhex; if (disc > 0) fprintf(stdout, " ## %d entities discarded\n", disc); retcode = 1; Lret: #ifdef WIN32 _setmode(fileno(stdin), O_TEXT); #endif return retcode; } /* function of lecture */ int loadScaVecTen_bin (pMesh mesh, int numsol, int dim, int ver, int nel, int type, int size, int *typtab, int key) { pSolution sol; double dbuf[GmfMaxTyp]; float fbuf[GmfMaxTyp]; double m[6], lambda[3], eigv[3][3], vp[2][2]; int inm, k, i, iord, off; char *ptr, data[128]; double ScaSol[1], VecSol[3], TenSol[9]; float fScaSol[1], fVecSol[3], fTenSol[9]; int retcode = 0; if (ddebug) printf("numsol=%i, type=%i, size=%i\n", numsol, type, size); if (numsol > type) numsol = 1; numsol--; mesh->nbb = nel; mesh->bbmin = 1.0e20; mesh->bbmax = -1.0e20; if (!zaldy2(mesh)) retcode = 0; sol = mesh->sol; sol->dim = dim; sol->ver = ver; off = 0; for (i = 0; i < numsol; i++) { if (ddebug) printf("typtab[%i]=%i", i, typtab[i]); switch (typtab[i]) { case GmfSca: off++; break; case GmfVec: off += sol->dim; break; case GmfSymMat: off += sol->dim * (sol->dim + 1) / 2; break; } } if (ddebug) printf("typtab[%i]=%i, off%i", i, typtab[i], off); // printf("min= %f, max= %f\n",mesh->bbmin,mesh->bbmax); if (ddebug) printf("numsol=%i,typtab[i]=%i\n", numsol, typtab[i]); fflush(stdout); switch (typtab[numsol]) { case GmfSca: mesh->nfield = 1; for (k = 1; k <= nel; k++) { // reading data must be a double ! getline_bin_double_noref(1, ScaSol); mesh->sol[k].bb = ScaSol[0]; if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } break; case GmfVec: if (ddebug) printf(" vector field\n"); mesh->nfield = sol->dim; for (k = 1; k <= nel; k++) { // reading data must be a double ! mesh->sol[k].bb = 0.0; getline_bin_double_noref(sol->dim, VecSol); for (i = 0; i < sol->dim; i++) { fbuf[off + i] = VecSol[i]; // printf("solution vectorielle %i composante %i %f\n",k,i,VecSol[i]); } for (i = 0; i < sol->dim; i++) { mesh->sol[k].m[i] = fbuf[off + i]; mesh->sol[k].bb += fbuf[off + i] * fbuf[off + i]; } mesh->sol[k].bb = sqrt(mesh->sol[k].bb); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } // printf("max= %f, min= %f",mesh->bbmin,mesh->bbmax); break; case GmfSymMat: if (ddebug) printf(" metric field\n"); mesh->nfield = sol->dim * (sol->dim + 1) / 2; for (k = 1; k <= nel; k++) { // reading data must be double !!! getline_bin_double_noref(sol->dim * (sol->dim + 1) / 2, TenSol); for (i = 0; i < sol->dim * (sol->dim + 1) / 2; i++) { fbuf[off + i] = TenSol[i]; } if (sol->dim == 2) { for (i = 0; i < 3; i++) { mesh->sol[k].m[i] = m[i] = fbuf[off + i]; } iord = eigen2(m, lambda, vp); mesh->sol[k].bb = min(lambda[0], lambda[1]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } else { for (i = 0; i < 6; i++) { mesh->sol[k].m[i] = fbuf[off + i]; } mesh->sol[k].m[2] = fbuf[off + 3]; mesh->sol[k].m[3] = fbuf[off + 2]; for (i = 0; i < 6; i++) { m[i] = mesh->sol[k].m[i]; } iord = eigenv(1, m, lambda, eigv); if (iord) { mesh->sol[k].bb = lambda[0]; mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[1]); mesh->sol[k].bb = max(mesh->sol[k].bb, lambda[2]); if (mesh->sol[k].bb < mesh->bbmin) mesh->bbmin = mesh->sol[k].bb; if (mesh->sol[k].bb > mesh->bbmax) mesh->bbmax = mesh->sol[k].bb; } } } break; } retcode = 1; return retcode; } /*load solution (metric) */ int loadSol_popen_bin (pMesh mesh, char *filename, int numsol) { pSolution sol; double dbuf[GmfMaxTyp]; float fbuf[GmfMaxTyp]; double m[6], lambda[3], eigv[3][3], vp[2][2]; int inm, k, i, key, nel, size, type, iord, off, typtab[GmfMaxTyp], ver, dim; char *ptr, data[128]; // rajout pour popen int NumberofSolAT; char *natureread; // rajout binaire int KwdCod; int cod; int NulPos; int retcode = 0; NumberofSolAT = 0; #ifdef WIN32 _setmode(fileno(stdin), O_BINARY); #endif // read code fread((unsigned char *)&cod, WrdSiz, 1, stdin); if (cod != 1) { printf("error in reading the binary file .meshb with popen\n"); exit(1); } fread((unsigned char *)&ver, WrdSiz, 1, stdin); fread((unsigned char *)&KwdCod, WrdSiz, 1, stdin); if (KwdCod != GmfDimension) { printf("error in reading the binary file .meshb with popen\n"); exit(1); } fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&dim, WrdSiz, 1, stdin); natureread = "Dimension"; printf(".sol: %s %i (mesh)%i (lecture)%i \n", natureread, dim, mesh->dim, ver); /*control of the dimension*/ if (dim != mesh->dim) { fprintf(stderr, " %%%% Wrong dimension %d.\n", dim); retcode = 0; goto Lret; // return(0); } while (!feof(stdin)) { fread((unsigned char *)&KwdCod, WrdSiz, 1, stdin); if (KwdCod == GmfSolAtVertices) { fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&nel, WrdSiz, 1, stdin); natureread = "SolAtVertices"; if (debug) fprintf(stdout, "SolAtVertices : nel %i, mesh->np %i \n", nel, mesh->np); if (nel != mesh->np) { fprintf(stderr, " %%%% Wrong number: %d Solutions discarded\n", nel - mesh->np); retcode = 0; goto Lret; // return(0); } mesh->typage = 2; key = GmfSolAtVertices; /* type,size,typetab */ read_TypeSizeTyptab_bin(&type, &size, typtab); if (debug) printf("sol: %s; type %i; size%i;\n", natureread, type, size); fflush(stdout); /* Reading solutions*/ loadScaVecTen_bin(mesh, 1, dim, ver, nel, type, size, typtab, key); } if (mesh->dim == 2 && mesh->nt) { if (KwdCod == GmfSolAtTriangles) { natureread = "SolAtTriangles"; fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&nel, WrdSiz, 1, stdin); if (debug) printf(stdout, "SolAtTriangles : nel %d, mesh->nt %d \n", nel, mesh->nt); if (nel && nel != mesh->nt) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); retcode = 0; goto Lret; // return(0); } mesh->typage = 1; key = GmfSolAtTriangles; /* type,size,typetab */ read_TypeSizeTyptab_bin(&type, &size, typtab); printf("sol: %s; type %i; size%i;\n", natureread, type, size); /* Reading solutions*/ loadScaVecTen_bin(mesh, 1, dim, ver, nel, type, size, typtab, key); } } if (mesh->dim == 2 && mesh->nq) { if (KwdCod == GmfSolAtQuadrilaterals) { natureread = "SolAtQuadrilaterals"; fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&nel, WrdSiz, 1, stdin); if (debug) fprintf(stdout, "SolAtQuadrilaterals : nel %i, mesh->nq %i \n", nel, mesh->nq); if (nel && nel != mesh->nq) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); retcode = 0; goto Lret; // return(0); } mesh->typage = 1; key = GmfSolAtQuadrilaterals; /* type,size,typetab */ read_TypeSizeTyptab_bin(&type, &size, typtab); /* Reading solutions*/ loadScaVecTen_bin(mesh, 1, dim, ver, nel, type, size, typtab, key); } } if (mesh->dim == 3 && mesh->ntet) { if (KwdCod == GmfSolAtTetrahedra) { natureread = "SolAtTetrahedra"; fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&nel, WrdSiz, 1, stdin); if (debug) fprintf(stdout, "SolAtTetrahedra : nel %i, mesh->ntet %i \n", nel, mesh->ntet); if (nel && nel != mesh->ntet) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); retcode = 0; goto Lret; // return(0); } mesh->typage = 1; key = GmfSolAtTetrahedra; /* type,size,typetab */ read_TypeSizeTyptab_bin(&type, &size, typtab); /* Reading solutions */ loadScaVecTen_bin(mesh, 1, dim, ver, nel, type, size, typtab, key); } } if (mesh->dim == 3 && mesh->nhex) { if (KwdCod == GmfSolAtHexahedra) { natureread = "SolAtHexahedra"; fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); fread((unsigned char *)&nel, WrdSiz, 1, stdin); if (debug) fprintf(stdout, "SolAtHexahedra : nel %d, mesh->nhex %d \n", nel, mesh->nhex); if (nel && nel != mesh->nhex) { fprintf(stderr, " %%%% Wrong number %d.\n", nel); GmfCloseMesh(inm); retcode = 0; goto Lret; // return(0); } mesh->typage = 1; key = GmfSolAtHexahedra; /* type,size,typetab */ read_TypeSizeTyptab_bin(&type, &size, typtab); /* Reading solutions*/ loadScaVecTen_bin(mesh, 1, dim, ver, nel, type, size, typtab, key); } } if (KwdCod == GmfEnd) { fread((unsigned char *)&NulPos, WrdSiz, 1, stdin); if (debug) printf("End of solution\n"); if (ddebug) printf("Reading of mesh file is finished"); break; } } retcode = 1; Lret: #ifdef WIN32 _setmode(fileno(stdin), O_BINARY); #endif return (retcode); } freefem++-3.61-1/src/medit/clipvol.c000644 000767 000024 00000035547 13312446271 017326 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ /* SUMMARY : ... /* LICENSE : LGPLv3 /* ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE /* AUTHORS : Pascal Frey /* E-MAIL : pascal.frey@sorbonne-universite.fr */ #include "medit.h" #include "extern.h" #include "sproto.h" #define NBCOL 9 /* build list for capping */ GLuint capTetra (pMesh mesh) { pScene sc; pClip clip; GLuint dlist = 0; pTetra pt; pPoint p0, p1; pMaterial pm; double dd1[6], d, ax, ay, az, bx, by, bz; double cx[4], cy[4], cz[4], cc; float n[3]; int m, k1, k2, l, transp, pos[6], neg[6], nbpos, nbneg, nbnul; static int tn[4] = {0, 0, 1, 1}; static int tp[4] = {0, 1, 1, 0}; /* default */ if (!mesh->ntet) return (0); if (ddebug) printf("create capping list / TETRA\n"); /* build display list */ sc = cv.scene[currentScene()]; clip = sc->clip; dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; transp = 0; if (!(sc->mode & S_MATERIAL)) pm = &sc->material[DEFAULT_MAT + 1]; /* check transparency */ transp = pm->amb[3] < 0.999 || pm->dif[3] < 0.999 || pm->spe[3] < 0.999; if (transp) { glDepthMask(GL_FALSE); glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); } glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pm->dif); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, pm->amb); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pm->spe); glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pm->emi); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &pm->shininess); while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || !pt->clip) { k = pt->nxt; continue; } nbpos = nbneg = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; if (p0->clip == 2) pos[nbpos++] = l; else if (p0->clip == 1) neg[nbneg++] = l; else nbnul++; dd1[l] = p0->c[0] * clip->eqn[0] + p0->c[1] * clip->eqn[1] \ + p0->c[2] * clip->eqn[2] + clip->eqn[3]; } if (nbneg == 2 && nbpos == 2) { /* display quadrilateral */ for (l = 0; l < 4; l++) { k1 = neg[tn[l]]; k2 = pos[tp[l]]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = 1.0f; if (dd1[k2] - dd1[k1] != 0.0f) cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glBegin(GL_QUADS); glNormal3fv(n); glVertex3f(cx[0], cy[0], cz[0]); glVertex3f(cx[1], cy[1], cz[1]); glVertex3f(cx[2], cy[2], cz[2]); glVertex3f(cx[3], cy[3], cz[3]); glEnd(); } else { /* display triangle */ for (l = 0; l < 3; l++) { k1 = nbneg == 3 ? neg[l] : pos[l]; k2 = nbneg == 3 ? pos[0] : neg[0]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } glBegin(GL_TRIANGLES); glNormal3fv(n); glVertex3f(cx[0], cy[0], cz[0]); glVertex3f(cx[1], cy[1], cz[1]); glVertex3f(cx[2], cy[2], cz[2]); glEnd(); } k = pt->nxt; } if (transp) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } } glEndList(); return (dlist); } /* build list for capping map */ GLuint capTetraMap (pMesh mesh) { pScene sc; pClip clip; GLuint dlist = 0; pTetra pt; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double dd1[6], d, ax, ay, az, bx, by, bz; double cx[4], cy[4], cz[4], cc; float n[3], sol[4]; int m, k1, k2, l, pos[6], neg[6], nbpos, nbneg, nbnul; static int tn[4] = {0, 0, 1, 1}; static int tp[4] = {0, 1, 1, 0}; triangle t1, t2; /* default */ if (!mesh->ntet || !mesh->nbb) return (0); if (ddebug) printf("create capping map list / TETRA\n"); sc = cv.scene[currentScene()]; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ clip = sc->clip; dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ glBegin(GL_TRIANGLES); for (m = 0; m < sc->par.nbmat; m++) { int k; pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || !pt->clip) { k = pt->nxt; continue; } nbpos = nbneg = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; if (p0->clip == 2) pos[nbpos++] = l; else if (p0->clip == 1) neg[nbneg++] = l; else nbnul++; dd1[l] = p0->c[0] * clip->eqn[0] + p0->c[1] * clip->eqn[1] \ + p0->c[2] * clip->eqn[2] + clip->eqn[3]; } if (nbneg == 2 && nbpos == 2) { /* display quadrilateral */ for (l = 0; l < 4; l++) { k1 = neg[tn[l]]; k2 = pos[tp[l]]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = 1.0f; if (dd1[k2] - dd1[k1] != 0.0f) cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); if (mesh->typage == 2) { ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; sol[l] = ps0->bb + cc * (ps1->bb - ps0->bb); } else { ps0 = &mesh->sol[k]; sol[l] = ps0->bb; } } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } /* store triangles */ t1.a[0] = t2.a[0] = cx[0]; t1.a[1] = t2.a[1] = cy[0]; t1.a[2] = t2.a[2] = cz[0]; t1.b[0] = cx[1]; t1.b[1] = cy[1]; t1.b[2] = cz[1]; t1.c[0] = t2.b[0] = cx[2]; t1.c[1] = t2.b[1] = cy[2]; t1.c[2] = t2.b[2] = cz[2]; t2.c[0] = cx[3]; t2.c[1] = cy[3]; t2.c[2] = cz[3]; /* store normals */ memcpy(t1.na, n, 3 * sizeof(float)); memcpy(t1.nb, n, 3 * sizeof(float)); memcpy(t1.nc, n, 3 * sizeof(float)); memcpy(t2.na, n, 3 * sizeof(float)); memcpy(t2.nb, n, 3 * sizeof(float)); memcpy(t2.nc, n, 3 * sizeof(float)); /* store solutions */ t1.va = t2.va = sol[0]; t1.vb = sol[1]; t1.vc = t2.vb = sol[2]; t2.vc = sol[3]; /* color interpolation */ cutTriangle(sc, t1); cutTriangle(sc, t2); } else { /* display triangle */ for (l = 0; l < 3; l++) { k1 = nbneg == 3 ? neg[l] : pos[l]; k2 = nbneg == 3 ? pos[0] : neg[0]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); if (mesh->typage == 2) { ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; sol[l] = ps0->bb + cc * (ps1->bb - ps0->bb); } else { ps0 = &mesh->sol[k]; sol[l] = ps0->bb; } } /* compute face normal */ ax = cx[1] - cx[0]; ay = cy[1] - cy[0]; az = cz[1] - cz[0]; bx = cx[2] - cx[0]; by = cy[2] - cy[0]; bz = cz[2] - cz[0]; n[0] = ay * bz - az * by; n[1] = az * bx - ax * bz; n[2] = ax * by - ay * bx; d = n[0] * n[0] + n[1] * n[1] + n[2] * n[2]; if (d > 0.0f) { d = 1.0f / sqrt(d); n[0] *= d; n[1] *= d; n[2] *= d; } /* store triangle */ t1.a[0] = cx[0]; t1.a[1] = cy[0]; t1.a[2] = cz[0]; t1.b[0] = cx[1]; t1.b[1] = cy[1]; t1.b[2] = cz[1]; t1.c[0] = cx[2]; t1.c[1] = cy[2]; t1.c[2] = cz[2]; /* store normal */ memcpy(t1.na, n, 3 * sizeof(float)); memcpy(t1.nb, n, 3 * sizeof(float)); memcpy(t1.nc, n, 3 * sizeof(float)); /* store solutions */ t1.va = sol[0]; t1.vb = sol[1]; t1.vc = sol[2]; /* color interpolation */ cutTriangle(sc, t1); } k = pt->nxt; } } glEnd(); glEndList(); return (dlist); } /* build list for capping isolines */ GLuint capTetraIso (pMesh mesh) { pScene sc; pClip clip; GLuint dlist = 0; pTetra pt; pPoint p0, p1; pMaterial pm; pSolution ps0, ps1; double dd1[6]; double rgb[3], cx[4], cy[4], cz[4], ccx, ccy, ccz, cc; float iso, kc, sol[4]; int i, m, k, k1, k2, l, l1, nc, pos[6], neg[6], nbpos, nbneg, nbnul, ncol; static int tn[4] = {0, 0, 1, 1}; static int tp[4] = {0, 1, 1, 0}; static double hsv[3] = {0.0f, 1.0f, 0.20f}; static int idirt[5] = {0, 1, 2, 0, 1}; static int idirq[6] = {0, 1, 2, 3, 0, 1}; /* default */ if (!mesh->ntet || !mesh->nbb || mesh->typage == 1) return (0); if (ddebug) printf("create capping iso list / TETRA\n"); sc = cv.scene[currentScene()]; if (egal(sc->iso.val[0], sc->iso.val[MAXISO - 1])) return (0); /* build display list */ clip = sc->clip; if (!(clip->active & C_ON)) return (0); dlist = glGenLists(1); glNewList(dlist, GL_COMPILE); if (glGetError()) return (0); /* build list */ glBegin(GL_LINES); ncol = NBCOL; for (i = 0; i <= ncol * (MAXISO - 1); i++) { if (i < ncol * (MAXISO - 1)) { l = i / ncol; kc = (i % ncol) / (float)ncol; iso = sc->iso.val[l] * (1.0 - kc) + sc->iso.val[l + 1] * kc; hsv[0] = sc->iso.col[l] * (1.0 - kc) + sc->iso.col[l + 1] * kc; } else { iso = sc->iso.val[MAXISO - 1]; hsv[0] = sc->iso.col[MAXISO - 1]; } hsvrgb(hsv, rgb); glColor3dv(rgb); for (m = 0; m < sc->par.nbmat; m++) { pm = &sc->material[m]; k = pm->depmat[LTets]; if (!k || pm->flag) continue; while (k != 0) { pt = &mesh->tetra[k]; if (!pt->v[0] || !pt->clip) { k = pt->nxt; continue; } nbpos = nbneg = nbnul = 0; for (l = 0; l < 4; l++) { p0 = &mesh->point[pt->v[l]]; if (p0->clip == 2) pos[nbpos++] = l; else if (p0->clip == 1) neg[nbneg++] = l; else nbnul++; dd1[l] = p0->c[0] * clip->eqn[0] + p0->c[1] * clip->eqn[1] \ + p0->c[2] * clip->eqn[2] + clip->eqn[3]; } if (nbneg == 2 && nbpos == 2) { /* analyze quadrilateral */ for (l = 0; l < 4; l++) { k1 = neg[tn[l]]; k2 = pos[tp[l]]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = 1.0f; if (dd1[k2] - dd1[k1] != 0.0f) cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; sol[l] = ps0->bb + cc * (ps1->bb - ps0->bb); } for (l = 0; l < 4; l++) { l1 = idirq[l + 1]; if ((sol[l] > iso && sol[l1] <= iso) || (sol[l] < iso && sol[l1] >= iso)) { cc = 0.0f; if (fabs(sol[l1] - sol[l]) > 0.0f) cc = (iso - sol[l]) / (sol[l1] - sol[l]); if (cc == 0.0f || cc == 1.0f) continue; ccx = cx[l] + cc * (cx[l1] - cx[l]); ccy = cy[l] + cc * (cy[l1] - cy[l]); ccz = cz[l] + cc * (cz[l1] - cz[l]); glVertex3f(ccx, ccy, ccz); nc++; } else if (sol[l] == iso && sol[l1] == iso) { nc = 2; glVertex3f(cx[l], cy[l], cz[l]); glVertex3f(cx[l1], cy[l1], cz[l1]); break; } } } else { /* analyze triangle */ for (l = 0; l < 3; l++) { k1 = nbneg == 3 ? neg[l] : pos[l]; k2 = nbneg == 3 ? pos[0] : neg[0]; p0 = &mesh->point[pt->v[k1]]; p1 = &mesh->point[pt->v[k2]]; cc = fabs(dd1[k1] / (dd1[k2] - dd1[k1])); cx[l] = p0->c[0] + cc * (p1->c[0] - p0->c[0]); cy[l] = p0->c[1] + cc * (p1->c[1] - p0->c[1]); cz[l] = p0->c[2] + cc * (p1->c[2] - p0->c[2]); ps0 = &mesh->sol[pt->v[k1]]; ps1 = &mesh->sol[pt->v[k2]]; sol[l] = ps0->bb + cc * (ps1->bb - ps0->bb); } nc = 0; ccx = ccy = ccz = 0.0f; for (l = 0; l < 3; l++) { l1 = idirt[l + 1]; if ((sol[l] > iso && sol[l1] <= iso) || (sol[l] < iso && sol[l1] >= iso)) { cc = 0.0f; if (fabs(sol[l1] - sol[l]) > 0.0f) cc = (iso - sol[l]) / (sol[l1] - sol[l]); if (cc == 0.0f || cc == 1.0f) continue; ccx = cx[l] + cc * (cx[l1] - cx[l]); ccy = cy[l] + cc * (cy[l1] - cy[l]); ccz = cz[l] + cc * (cz[l1] - cz[l]); glVertex3f(ccx, ccy, ccz); nc++; } else if (sol[l] == iso && sol[l1] == iso) { nc = 2; glVertex3f(cx[l], cy[l], cz[l]); glVertex3f(cx[l1], cy[l1], cz[l1]); break; } } if (nc > 0 && nc != 2) glVertex3f(ccx, ccy, ccz); } k = pt->nxt; } } } glEnd(); glEndList(); return (dlist); } freefem++-3.61-1/src/Graphics/mode_open.hpp000644 000767 000024 00000000317 13256636774 020631 0ustar00hechtstaff000000 000000 #ifndef MODE_OPEN_HPP #define MODE_OPEN_HPP #ifdef __WIN32__ #define MODE_READ_BINARY "rb" #define MODE_WRITE_BINARY "wb" #else #define MODE_READ_BINARY "r" #define MODE_WRITE_BINARY "w" #endif #endif freefem++-3.61-1/src/Graphics/glrgraph.hpp000644 000767 000024 00000120464 13256636774 020500 0ustar00hechtstaff000000 000000 /**************DO NOR REMOVE THIS BANNER***************/ /* FreeFEM : Language for a Finite Element Method */ /* ------- Release 2.0: June 2007. */ /* Authors: D. Bernardi, Y. Darmaillac F. Hecht, */ /* O. Pironneau */ // ********** DO NOT REMOVE THIS BANNER ********** /* // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr 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 */ /* (fax) Olivier.Pironneau@ann.jussieu.fr */ /******************************************************/ //#define FREEFEM // AGL apple // XGL X11 // WGL window (a faire) const char * edpfilenamearg=0; bool waitatend=true; bool consoleatend=true; #ifdef AGL #define TARGET_API_MAC_CARBON 1 #define CALL_IN_SPOCKETS_BUT_NOT_IN_CARBON 1 #include #include #include #include #endif #ifdef XGL #include #include #include #endif #ifndef AGL #include #include #endif #include #include "error.hpp" #include #include #include using namespace std; #include #include #include #include #include "rgraph.hpp" #include #include #include int currx=0,curry=0; static FILE *psfile = 0; static FILE *psfile_save = 0; #ifdef AGL static AGLPixelFormat fmt; static AGLContext ctx; int pStrCopy (StringPtr p1, char * p2); StringPtr c2p(const char * p,char *buf); #endif #ifdef XGL static Display *dpy; static Window win; static XSizeHints size_hints; //static GC gc; static XFontStruct *font_info; GLXContext cx; int stensize; static Cursor cursor_watch,cursor_arrow; static int shift, control,shiftlock,alt; static GLuint basefont; #endif extern long verbosity; // level off printing #ifdef FREEFEM void myenviron () { cout << "FreeFEM error: operator new failed; not enough memory" << endl; if (myenviron) longjmp(myenvironj,1); exit(2); } // pour imprimer la version FH #define STRING(i) #i #include jmp_buf myenvironj; static int myenviron = 0; void out_of_memory (); void NEW_HANDLER (void); void compile(char *fname); float scali(int i); float scalj(int j); void execute(char* what); char Getijc(int & x,int & y); int DoMouseDown (int windowPart, WindowPtr whichWindow, EventRecord *myEvent); void NEW_HANDLER (void){ set_new_handler (&myenvironj);} #endif static int nbcolor; static int ncolortable; static int LastColor; // LastColor=1 => Noir et Blanc #ifdef AGL #define ours(w) (w==grafWindow0) static WindowPtr grafWindow0; static GrafPtr grafPort0; static Rect boundsRect; static CursHandle CrossCurseur ; static CursHandle WatchCurseur ; static Pattern white,black; #else struct RGBColor { unsigned short red; /*magnitude of red component*/ unsigned short green; /*magnitude of green component*/ unsigned short blue; /*magnitude of blue component*/ }; #endif template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} static bool grey=false; static int cube6[7][3] ={ {65534,0,0},{65534,65534,0},{0,65534,0},{0,65534,65534},{0,0,65534} , {65534,0,65534},{65534,0,0} }; static int grey6[2][3] ={ {65534,65534,65534},{0,0,0} }; char errbuf[255]; static int INITGRAPH=0; static float aspx, aspy, echx,echy,ech,rxmin,rxmax,rymin,rymax; static int carre, lacouleur; static GLuint fontList; static int width,height; static RGBColor * colortable; int getcolor(); void putpixel(int ix,int iy, int couleur); int scalx(float x); int scaly(float y); void thisexit(); void DrawCStringGL (const char * cstrOut, GLuint fontList) { GLint i = 0; glRasterPos3d(currx,height-curry,0); while (cstrOut [i]) glCallList (fontList + cstrOut[i++]); } #ifdef AGL void InitMac(); // -------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------- // APPLE EVENT SUPPORT ROUTINES // -------------------------------------------------------------------------------------------------------------- StringPtr c2p(const char * p, unsigned char * buf) { int l=strlen(p); assert(l<255); buf[0]=l; memcpy(buf+1,p,l); return buf; } int pStrCopy (StringPtr p1, char * p2) /* copies a pascal string `p1 into a C string */ { int len,i; len = (*p1++) %256; for(i=1;i<=len;i++) *p2++=*p1++; *p2 = 0; return 0; } void InitMac() { BitMap screenBitMap; Rect screenBits; Cursor theArrow; GetQDGlobalsScreenBits(&screenBitMap); screenBits = screenBitMap.bounds; SetCursor(GetQDGlobalsArrow(&theArrow)); } class InitilisationMac { static int init; public: InitilisationMac(){ InitMac();} }; static InitilisationMac Initmac; // to call InitMac int getprog(char* fn,int argc, char** argv) { if (argc > 1) { int ret=0; for (int i=1; i0) cerr << " Syntaxe : " << argv[0] << " -f filename [-v verbosity] " << endl; else cerr << " Syntaxe : FreeFem++-agl -f filename [-v verbosity] " << endl; return ret; } return 1; } else { OSErr anErr; FSRef fsRef; NavDialogOptions dialogOptions; NavReplyRecord reply; anErr=NavGetDefaultDialogOptions(& dialogOptions); if( anErr != noErr) return -1; anErr =NavChooseFile(0,&reply,&dialogOptions,0,0,0,0,0) ; if (anErr == noErr && reply.validRecord) { // Deal with multiple file selection long count; anErr = AECountItems(&(reply.selection), &count); // Set up index for file list if (anErr == noErr) { long index; for (index = 1; index <= count; index++) { AEKeyword theKeyword; DescType actualType; Size actualSize; FSSpec documentFSSpec; // Get a pointer to selected file anErr = AEGetNthPtr(&(reply.selection), index, typeFSRef, &theKeyword, &actualType,&fsRef, sizeof(fsRef), &actualSize); if (anErr == noErr) { anErr=FSRefMakePath(&fsRef,(UInt8*)fn,256); if ( anErr == noErr ) { cout << "Path : " << fn << endl; char * ff=fn,*fff=0; while ( *ff) { if (*ff=='/') fff=ff; ff++; } if (fff) { *fff=0; cout << "chdir to "<< fn << endl; chdir(fn); *fff='/';} } else cout << "Err: "<< anErr << endl; /* anErr = AEGetNthPtr(&(reply.selection), index, typeFSS, &theKeyword, &actualType,&documentFSSpec, sizeof(documentFSSpec), &actualSize); anErr = HSetVol(0,documentFSSpec.vRefNum,documentFSSpec.parID); pStrCopy(documentFSSpec.name, fn);*/ } } } // Dispose of NavReplyRecord, resources, descriptors anErr = NavDisposeReply(&reply); } else return 0; // erreur cancel return (2); } } //----------------------------------------------------------------------------------------------------------------------- GLuint BuildFontGL (AGLContext ctx, GLint fontID, Style face, GLint size) { GLuint listBase = glGenLists (256); if (aglUseFont (ctx, fontID , face, size, 0, 256, (long) listBase)) { glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); return listBase; } else { glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glDeleteLists (listBase, 256); return 0; } } #else #include "getprog-unix.hpp" #endif #ifdef XGL void MyXSelectInput(Display * dpy,Window w,int mask) { XSetWindowAttributes attributes; attributes.event_mask = mask; XChangeWindowAttributes(dpy, w, CWEventMask, &attributes); } #endif //----------------------------------------------------------------------------------------------------------------------- void DeleteFontGL (GLuint fontList) { if (fontList) glDeleteLists (fontList, 256); } void coutmode(short i) { cout << flush; cerr << flush; ;} #ifdef FREEFEM void myexit(int err) { if (INITGRAPH) { rattente(0); closegraphique(); } if (err !=0) cout << "Error: freefem+ has ended with error code " <screen), vi->visual, AllocNone); /* create a window */ swa.colormap = cmap; swa.border_pixel = 0; swa.event_mask = StructureNotifyMask; height = 512; width = 512; aspx = width; aspy =height; win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa); XMapWindow(dpy, win); glXMakeCurrent(dpy, win, cx); cursor_arrow = XCreateFontCursor(dpy,XC_arrow); cursor_watch = XCreateFontCursor(dpy,XC_watch); XDefineCursor(dpy,win,cursor_watch); MyXSelectInput (dpy, win, (int) (ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask /* | ResizeRedirectMask */ | StructureNotifyMask) ); font_info = XLoadQueryFont(dpy, "6x9"); //XSetFont(dpy, gc, font_info->fid); {unsigned int first, last; int id = font_info->fid; first = font_info->min_char_or_byte2; last = font_info->max_char_or_byte2; fontList = glGenLists(last+1); if (fontList == 0) { printf ("out of display lists\n"); exit (1); } glXUseXFont(id, first, last-first+1, fontList+first); } } #endif #ifdef WGL a faire #endif carre = aspx == aspy; lacouleur = getcolor(); nbcolor= 256; ncolortable =0; LastColor=2;// En couleur pas defaul colortable=0; SetColorTable(2+6); INITGRAPH = 1; gluOrtho2D(0.0, height,0,width); glLineWidth(1); // cout <<" End Initgraphique\n"; } static RGBColor DefColorGL( int k,int nb, bool hsv,bool grey,int nbcolors,float *colors) { RGBColor C; float r,g,b; extern void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,int nbcolors,float *colors); DefColor(r,g,b, k,nb,hsv,grey,nbcolors,colors); C.red= (short unsigned int) (65535*r); C.green=(short unsigned int)(65535*g); C.blue= (short unsigned int) (65535*b); return C; } void SetColorTable1(int nb,bool hsv,int nbcolors,float *colors) { static bool greyo = !grey; static float * colorso=0; if(!INITGRAPH) return; if (ncolortable == nb && greyo == grey && colorso == colors ) return;// optim greyo = grey; colorso=colors; if (nbcolor && nb>2) { if(colortable) delete [] colortable; colortable = new RGBColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; for (int i0=0;i0 LastColor ? 1 : c; // c=Min(c,LastColor); pour noir et blanc lacouleur =c; float r=1,g=1,b=1; if (c>=0 && c < ncolortable) { r = (float) colortable[c].red /65535.F; g = (float) colortable[c].green /65535.F; b = (float) colortable[c].blue /65535.F; } else if (c!=0) r=g=b=0; glColor4f (r,g,b,1.); if (psfile) fprintf(psfile,"%.3f %.3f %.3f C\n",r,g,b); } int InRecScreen(float x1, float y1,float x2, float y2) { float xi = Min(x1,x2),xa=Max(x1,x2); float yi = Min(y1,y2),ya=Max(y1,y2); return (xa >= rxmin) && (xi <= rxmax) && (ya >= rymin) && (yi <= rymax); } int InPtScreen( float x, float y) { return (x >= rxmin) && (x <= rxmax) && (y >= rymin) && (y <= rymax); } void penthickness(int pepais) { // PenSize(pepais,pepais); glLineWidth(pepais); if (psfile) fprintf(psfile,"%d setlinewidth\n",pepais); } void cadre(float xmin,float xmax,float ymin,float ymax) { rxmin = xmin; rxmax = xmax; rymin = ymin; rymax = ymax; echx = aspx / (xmax - xmin); echy = aspy / (ymax - ymin); } void getcadre(float &xmin,float &xmax,float &ymin,float &ymax) { xmin = rxmin; xmax = rxmax; ymin = rymin; ymax = rymax; } void cadreortho(float centrex, float centrey, float rayon) { float xasp,yasp, getmaxx, getmaxy; getmaxx = xasp =aspx; getmaxy = yasp = aspy; if (getmaxx * (float)xasp > getmaxy * (float)yasp) { rymin = centrey - rayon; rymax = centrey + rayon; echy= getmaxy / (2 * rayon); echx= (echy * xasp) / yasp; rxmin= centrex - getmaxx / (2 * echx); rxmax= centrex + getmaxx / (2 * echx); } else { rxmin = centrex - rayon; rxmax = centrex + rayon; echx = getmaxx / (2 * rayon); echy = (echx * yasp) / xasp; rymin = centrey - getmaxy / (2 * echy); rymax = centrey + getmaxy / (2 * echy); } // cout << "cadreortho\n"; } int scalx(float x) { return int((x - rxmin) * echx); } int scaly(float y) { return int((rymax - y) * echy); } float scali(int i) { return i/echx + rxmin; } float scalj(int j) { return -j/echy + rymax; } void pointe(float x, float y) { int newx = scalx(x), newy = scaly(y); putpixel(newx, newy, lacouleur); if (psfile) fprintf(psfile,"%d %d P\n", newx, height-newy); } void rmoveto(float x, float y) { int newx = scalx(x), newy = scaly(y); // MoveTo(newx,newy); if (psfile) fprintf(psfile,"%d %d M\n", newx, height-newy); currx = newx; curry = newy; } void rlineto(float x, float y) { int newx = scalx(x), newy = scaly(y); glBegin(GL_LINES); glVertex2i(currx, height-curry); glVertex2i(newx, height-newy); glEnd(); if (psfile) fprintf(psfile,"%d %d L\n", newx,height-newy); currx = newx; curry = newy; } void fillpoly(int n, float *poly) { glBegin(GL_POLYGON); for (int i=0;iwhere)) { closegraphique(); cout << "The end (closing the graphic window) " <portRect)); ZoomWindow(whichWindow, inZoomIn, true); InitCursor(); } break; case inZoomOut: /* if (ours(whichWindow)) { SetCursor(&waitCursor); SetPort(whichWindow); EraseRect(&(whichWindow->portRect)); ZoomWindow(whichWindow, inZoomOut, true); if(whichWindow == editWindow) MyZoomWindow(whichWindow); InitCursor(); }*/ break; case inMenuBar: // return(DoCommand(MenuSelect(myEvent->where))); break; case inSysWindow: //SystemClick(myEvent, whichWindow); break; case inDrag: if (ours(whichWindow)) { SetPortWindowPort(whichWindow); GetPort(&grafPort0); // DragWindow(whichWindow, myEvent->where, &dragRect); } break; case inGrow: //if (ours(whichWindow)) // {MyGrowWindow(whichWindow, myEvent->where);} break; case inContent: wasactive = (whichWindow == FrontWindow()); if(!wasactive) { SelectWindow(whichWindow); // if (ours(whichWindow) && MacReDraw ) (* MacReDraw)(); } else if (ours(whichWindow)) { SetPortWindowPort(whichWindow); GetPort(&grafPort0); while (Button()) ; return 0; } break; } return 1; } char HandleEvent(EventRecord & myEvent) { // cout << "HandleEvent\n"; WindowPtr whichWindow=NULL; short windowPart; char char1=0; switch (myEvent.what) { case mouseDown: windowPart = FindWindow(myEvent.where, &whichWindow); if( DoMouseDown(windowPart, whichWindow, &myEvent) ==0) char1= 251; break; // // // case keyDown: case keyUp: case autoKey: { windowPart = FindWindow(myEvent.where, &whichWindow); if((whichWindow==grafWindow0) /* && (inContent == windowPart)*/) { if (grafWindow0 != FrontWindow()) { SelectWindow(whichWindow); SetPortWindowPort(whichWindow); GetPort(&grafPort0); } char1 = (myEvent.message & 127L); } break;} case updateEvt: /* if (ours((WindowPtr) myEvent.message)) { BeginUpdate((WindowPtr) myEvent.message); EndUpdate((WindowPtr) myEvent.message); } */ break; // cout << "End HandleEvent" << int(char1) << endl; } return char1; } #endif char Getijc(int & x,int & y) { char char1=0; #ifdef AGL viderbuff(); showgraphic(); EventRecord myEvent; int flag=1; // HLock( (Handle) WatchCurseur); // SetCursor(*CrossCurseur); // HUnlock( (Handle) WatchCurseur); SelectWindow(grafWindow0); while (char1==0) { if (GetNextEvent(everyEvent, &myEvent) /* ,OxFFFFFFFF,h)*/) char1=HandleEvent(myEvent); } GlobalToLocal( & myEvent.where); x = myEvent.where.h; y = myEvent.where.v; #endif #ifdef XGL XEvent event; int flag,nb; XComposeStatus status; char buffer[20]; KeySym keysym; /* incidence */ XDefineCursor(dpy,win,cursor_arrow); flag=0; while (!flag) { XNextEvent(dpy, &event); if(event.type == ButtonRelease) { x = event.xbutton.x; y = event.xbutton.y; if (event.xbutton.button == Button1) char1=shift?248:251; else if (event.xbutton.button == Button2) char1=shift?249:252; else char1=shift?250:253; // printf(" mouse release %d\n",(int) char1); flag=1; } else if(event.type == KeyPress) { x = event.xkey.x; y = event.xkey.y; char1= event.xkey.keycode ; keysym=0; nb=XLookupString(&event.xkey,buffer,20,&keysym,&status); /* printf("nb= %d keysym= %d buffer=",nb,keysym); /* for(i=0;i<20;i++) /* printf(" %d ",(int)buffer[i]); /* printf("\n"); */ /* voir /usr/include/X11/keysymdef.h + ap_keysym */ if (nb != 0) {char1 = buffer[0]; flag= 1; } else { /* if (IsFunctionKey(keysym)) printf("function down\n"); else if(IsModifierKey(keysym)) printf("modifier down\n"); else if(IsKeypadKey(keysym)) printf(" keypad down\n"); else if(IsMiscFunctionKey(keysym)) printf(" misc function down\n"); else if(IsPFKey(keysym)) printf(" PF key down\n"); */ #ifdef XK_MISCELLANY switch(keysym) { /* Cursor control & motion */ /* case XK_Left : flag = 1; char1 = call(keyboa).curs_left; break; case XK_Up : flag = 1; char1 = call(keyboa).curs_up; break; case XK_Right : flag = 1; char1 = call(keyboa).curs_right; break; case XK_Down : flag = 1; char1 = call(keyboa).curs_down; break; case XK_Next : flag = 1; char1 = call(keyboa).pad_down; break; case XK_Prior : flag = 1; char1 = call(keyboa).pad_up; break; case XK_End : flag = 1; char1 = call(keyboa).marg_right; break; case XK_Begin : flag = 1; char1 = call(keyboa).marg_left; break; */ /* Misc Functions */ /* case XK_Select : flag = 1; char1 = call(keyboa).mark; break; */ /* case XK_Print : flag = 1; char1 = ; break; case XK_Execute : flag = 1; char1 = ; break; case XK_Insert : flag = 1; char1 = ; break; case XK_Undo : flag = 1; char1 = call(keyboa).undo; break; case XK_Redo : flag = 1; char1 = ; break; case XK_Menu : flag = 1; char1 = ; break; case XK_Find : flag = 1; char1 = ; break; case XK_Cancel : flag = 1; char1 = call(keyboa).line_del; break; case XK_Help : flag = 1; char1 = call(keyboa).help; break; case XK_Break : flag = 1; char1 = ; break; case XK_Mode_switch : flag = 1; char1 = ; break; case XK_script_switch : flag = 1; char1 = ; break; case XK_Num_Lock : flag = 1; char1 = ; break; case XK_F1 : flag = 1; char1 = shift ? call(keyboa).sfunct1 : call(keyboa).funct1 ; break; case XK_F2 : flag = 1; char1 = shift ? call(keyboa).sfunct2 : call(keyboa).funct2 ; break; case XK_F3 : flag = 1; char1 = shift ? call(keyboa).sfunct3 : call(keyboa).funct3 ; break; case XK_F4 : flag = 1; char1 = shift ? call(keyboa).sfunct4 : call(keyboa).funct4 ; break; case XK_F5 : flag = 1; char1 = shift ? call(keyboa).sfunct5 : call(keyboa).funct5 ; break; case XK_F6 : flag = 1; char1 = shift ? call(keyboa).sfunct6 : call(keyboa).funct6 ; break; case XK_F7 : flag = 1; char1 = shift ? call(keyboa).sfunct7 : call(keyboa).funct7 ; break; case XK_F8 : flag = 1; char1 = shift ? call(keyboa).sfunct8 : call(keyboa).funct8 ; break; case XK_F9 : flag = 1; char1 = shift ? call(keyboa).sfunct9 : call(keyboa).funct9 ; break; case XK_F10 : flag = 1; char1 = shift ? call(keyboa).sfunct10 : call(keyboa).funct10 ; break; case XK_F11 : flag = 1; char1 = shift ? call(keyboa).sfunct11 : call(keyboa).funct11 ; break; case XK_F12 : flag = 1; char1 = shift ? call(keyboa).sfunct12 : call(keyboa).funct12 ; break; */ case XK_Shift_L : shift=1; break; case XK_Shift_R : shift=1; break; case XK_Control_L : control=1; break; case XK_Control_R : control=1; break; case XK_Caps_Lock : shiftlock = 1 ; break; case XK_Shift_Lock : shiftlock = 1 ; break; case XK_Meta_L : alt=1; break; case XK_Meta_R : alt=1; break; case XK_Alt_L : alt=1; break; case XK_Alt_R : alt=1; break; } /* end switch */ #endif } } else if(event.type == KeyRelease) { x = event.xkey.x; y = event.xkey.y; char1= event.xkey.keycode ; keysym=0; nb=XLookupString(&event.xkey,buffer,20,&keysym,&status); /* if (IsFunctionKey(keysym)) printf("function up\n"); else if(IsModifierKey(keysym)) printf("modifier up\n"); else if(IsKeypadKey(keysym)) printf(" keypad up\n"); else if(IsMiscFunctionKey(keysym)) printf(" misc function up\n"); else if(IsPFKey(keysym)) printf(" PF key up\n"); */ if (nb == 0) { #ifdef XK_MISCELLANY switch(keysym) { case XK_Shift_L : shift=0; break; case XK_Shift_R : shift=0; break; case XK_Control_L : control=0; break; case XK_Control_R : control=0; break; case XK_Caps_Lock : shiftlock = 0 ; break; case XK_Shift_Lock : shiftlock = 0 ; break; case XK_Meta_L : alt=0; break; case XK_Meta_R : alt=0; break; case XK_Alt_L : alt=0; break; case XK_Alt_R : alt=0; break; } /* end switch */ #endif } } } XDefineCursor(dpy,win,cursor_watch); XFlush(dpy); #endif #ifdef WGL a faire #endif return char1; } char Getxyc(float &x,float &y) { char c; int i,j; // cout << "getxyc \n"; c = Getijc( i,j); x = scali(i); y = scalj(j); // cout << "getxyc out \n"; return c; } void viderbuff(){ glFinish(); #ifdef AGL aglSwapBuffers (ctx); // send swap command #endif #ifdef XGL glXSwapBuffers (dpy,win); // send swap command #endif } void rattente(int waitm) { int i,j; char c=0; if(waitm) c = Getijc( i,j); if ( c == 3) {cout << "rattente: ^c => abort " << endl;closegraphique();exit(1);}// ^c => exit /* you may prefer to use carriage return to move to the next graph */ /* getc(stdin); */ // if(waitm) while(!Button()){ }; } //void GetSizeScreen(int & ix,int &iy); // GetScreenSize_ void GetScreenSize(int & ix,int &iy) { ix = width ; iy = height; } void openPS(const char *filename ) { char ffff[32]; int count=0; if(psfile_save) closePS(); time_t t_loc; float s=0.5; const int shiftx=50,shifty=50; // char username[10]; time(&t_loc); bool notfound; if( !filename) do { struct stat buf; sprintf(ffff,"rgraph_%.3d.ps",count++); volatile int r= stat(ffff,&buf) ; notfound = r !=0; if(count>1000) break; } while ( !notfound ); psfile=fopen(filename?filename:ffff,"w"); if(psfile==0) {printf("Erreur %s errno %d\n",filename?filename:ffff,errno);exit(1);} if(psfile) { fprintf(psfile,"%%!PS-Adobe-2.0 EPSF-2.0\n%%%%Creator: %s\n%%%%Title: FreeFem++\n","user"); fprintf(psfile,"%%%%CreationDate: %s",ctime(&t_loc)); fprintf(psfile,"%%%%Pages: 1\n"); fprintf(psfile,"%%%%BoundingBox: %d %d %d %d\n",shiftx,shifty,int(shiftx+width*s),int(shifty+height*s)); fprintf(psfile,"%%%%EndComments\n"); fprintf(psfile," /L { lineto currentpoint stroke newpath moveto} def\n"); fprintf(psfile," /M { moveto } def\n"); fprintf(psfile," /C {setrgbcolor} def\n"); fprintf(psfile," /rec {newpath 4 copy 8 1 roll moveto 3 -1 roll lineto 4 2 roll exch lineto lineto closepath} def\n"); fprintf(psfile," %d %d translate \n",shiftx,shifty); fprintf(psfile," %f %f scale \n",s,s); fprintf(psfile," 0 %d 0 %d rec clip newpath\n",int(width),int(height)); fprintf(psfile," /Helvetica findfont 10 scalefont setfont\n"); fprintf(psfile," /S { show} def\n"); fprintf(psfile," /bF { mark} def \n"); fprintf(psfile," /eF {newpath moveto counttomark 2 idiv {lineto} repeat closepath fill cleartomark} def\n"); fprintf(psfile," /P { /yy exch def /xx exch def xx xx 1 add yy yy 1 add rec fill } def\n"); fprintf(psfile," 1 setlinewidth\n"); psfile_save=psfile; } } void closePS(void) { if(psfile_save) { fprintf(psfile_save,"showpage\n"); fclose(psfile_save); } psfile=0; psfile_save=0; } void Commentaire(const char * c) { if(psfile) { fprintf(psfile,"%% %s\n",c); } }; void NoirEtBlanc(int NB) { if(NB) LastColor=1; else LastColor=ncolortable?ncolortable:2; } void MettreDansPostScript(int in) { if(in) psfile=psfile_save; else psfile=0; } static void FillRect(float x0,float y0, float x1, float y1) { float r[8]; r[0]=x0;r[1]=y0; r[2]=x1;r[3]=y0; r[4]=x1;r[5]=y1; r[6]=x0;r[7]=y1; fillpoly(4,r); } float GetHeigthFont() { // FontInfo MyFontInfo; // GetFontInfo(&MyFontInfo); #ifdef XGL int dir,asc,desc,k; XCharStruct overall; XTextExtents(font_info,"gML",3,&dir,&asc,&desc,&overall); return (asc+desc)*(0.9/echy); #else int interligne = 9;// MyFontInfo.ascent + MyFontInfo.descent + MyFontInfo.leading; return interligne/echy; #endif } int PutLevel(int lineno, float xf, int col) { float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); float xleft = xmax - (xmax-xmin)*0.1; float ytop = ymax; float ydelta = (ymax-ymin)/40; ydelta=GetHeigthFont(); xleft = xmax - 6*ydelta; ytop -= ydelta*(col+2); couleur(col); FillRect(xleft+ydelta/8.,ytop+ydelta/8.,xleft+ydelta*7./8.,ytop+ydelta*7./8.); rmoveto(xleft+ydelta*1.4,ytop+ydelta/4); char buf[30]; sprintf(buf,"%g",xf); couleur(1); plotstring(buf); return lineno; } void ShowHelp(const char * s,int k) { if(k) { MettreDansPostScript(0); couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); MettreDansPostScript(1); // couleur(1); } } class Grid; void setgrey(bool gg ){grey=gg;} int getgrey(){ return grey;} void SaveMesh(Grid &t){} void SavePlot(int D, Grid& t, double *f){} void SavePlot(int D, Grid& t, float *f){} freefem++-3.61-1/src/Graphics/ffglut.hpp000644 000767 000024 00000021243 13256636774 020154 0ustar00hechtstaff000000 000000 /* * ffglut.hpp * ff * * Created by FrÈdÈric Hecht on 04/11/08. * Copyright 2008 UPMC. All rights reserved. * */ #include typedef std::complex Complex; extern int debug; static const double dinfty=numeric_limits::max(); void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,KN colors); void hsvToRgb (float h, float s, float v, float & r, float & g, float & b); class ThePlot; class OneWindow; struct OnePlot { int dim; R3 Pmin,Pmax; double fmin,fmax; double vmax2; long what; GLsizei ngllists; GLint gllists; KN oklist; int setgllists; virtual void Draw(OneWindow *win) =0; virtual bool NextCase() {return false;} void bb(R3 & Pmn,R3 &Pmx) const { Pmn=Minc(Pmin,Pmn); Pmx=Maxc(Pmax,Pmx); } void bfv(R & fmn,R &fmx,R & vmx) const { // cout << "\t\t\t\t f min, max v max :" << fmin << " " << fmax << " " << vmax2 << endl; fmn=Min(fmin,fmn); fmx=Max(fmax,fmx); vmx=Max(vmax2,vmx); } virtual void dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn,R & vmx) const {// compute the function bound and arrow bound view .... } OnePlot(long w,int ddim=2,int nbgllist=0) : dim(ddim), Pmin(dinfty,dinfty,dinfty),Pmax(-dinfty,-dinfty,-dinfty), fmin(dinfty),fmax(-dinfty),vmax2(0), what(w),ngllists(nbgllist),gllists(0), oklist(nbgllist),setgllists(0){ } void initlist() { if(! setgllists) if(ngllists>0) { oklist=0; // gllists= glGenLists(ngllists); setgllists=1; assert(gllists); } } void GLDraw(OneWindow *win); virtual ~OnePlot() { if(setgllists) glDeleteLists(gllists,ngllists); }; private: // pas de copy car il y a des destructeurs dans les classes derives OnePlot(const OnePlot & ); OnePlot & operator=(const OnePlot & ); }; template struct OnePlotMesh : public OnePlot { const Mesh *Th; OnePlotMesh(const Mesh *T) : OnePlot(0,2,3),Th(T) { R2 P0,P1; Th->BoundingBox(P0,P1); Pmin=P0; Pmax=P1; } void Draw(OneWindow *win); }; struct OnePlotMesh3 : public OnePlot { const Mesh3 *Th; OnePlotMesh3(const Mesh3 *T) : OnePlot(0,3,3),Th(T) { Pmin=Th->Pmin; Pmax=Th->Pmax; //Th->BoundingBox(Pmin,Pmax); } void Draw(OneWindow *win); }; template struct OnePlotFE: public OnePlot { const Mesh *Th; // long nsub; KN v; KN vc; KN Psub; KN Ksub; int cas; // in cas of complex chaage interpertation of complex value OnePlotFE(const Mesh *T,long w,PlotStream & f); void Draw(OneWindow *win); void dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn,R & vmx) const ; bool vc2v(); bool NextCase() { cas++; return vc2v();} }; struct OnePlotFE3: public OnePlot { const Mesh3 *Th; long nsub; KN v; KN vc; KN Psub; KN Ksub; int cas; // in cas of complex chaage interpertation of complex value OnePlotFE3(const Mesh3 *T,long w,PlotStream & f) :OnePlot(w,3,5),Th(T),cas(2) { Pmin=Th->Pmin; Pmax=Th->Pmax; f >> Psub ; f >> Ksub ; if(what<10) f >> v; else f >> vc; vc2v(); if(debug>3) cout << "OnePlotFE3" << Th <<" " << what<< " " << nsub <<" " << v.N() << endl << " Pmin " << Pmin << " Pmax " << Pmax << endl; ffassert(f.good()); } void Draw(OneWindow *win); bool vc2v(); bool NextCase() { cas++; return vc2v();} }; struct OnePlotCurve: public OnePlot { KN xx,yy,zz,cc; OnePlotCurve(PlotStream & f,int nfield=2,ThePlot *theplot=0); void Draw(OneWindow *win); void dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn2,R & vmx2) const; }; struct OnePlotBorder: public OnePlot { vector > > data; OnePlotBorder(PlotStream & f); void Draw(OneWindow *win); }; // add 11/12/2008 for gestion of error FH (what -1) struct OnePlotError: public OnePlot { long item; OnePlotError(PlotStream & f) : OnePlot(-1) { f >> item; } void Draw(OneWindow *win) ; }; class ThePlot { public: int count; int state; // 0 new GLint gllist; KN colors; bool hsv; // hsv type KN boundingbox; double coeff; bool wait; bool value; bool fill; bool aspectratio; bool clean; bool uaspectratio; bool pViso,pVarrow; bool withiso; bool witharrow; long Niso,Narrow; R3 Pmin,Pmax,PminT,PmaxT;// with R -> true bound R fmin,fmax,fminT,fmaxT; // with bound with previous plot. R vmax2; KN Viso,Varrow; bool bw; string * psfile; string * cm; bool grey; bool greyo; bool drawborder; bool drawmeshes; bool add,keepPV; double echelle; double ArrowSize; vector Ths; vector Ths2; vector Ths3; list plots; bool changeViso,changeVarrow,changeColor,changeBorder,changeFill; R3 Pvue,Peyes; R alpha; R coefr; R z0; // z pour les objets 2d. R ZScale; // for 3d plot jan 2009 int plotdim; R theta, phi, dcoef, focal; int datadim; // 2D long winnum; bool NextCase(); bool Change() const { return changeViso||changeVarrow||changeColor||changeBorder||changeFill;} ~ThePlot() { for (list::iterator i= plots.begin();i != plots.end(); ++i) if(*i) delete *i; for (vector::iterator i= Ths.begin();i != Ths.end(); ++i) if(*i) delete *i; for (vector::iterator i= Ths2.begin();i != Ths2.end(); ++i) if(*i) delete *i; for (vector::iterator i= Ths3.begin();i != Ths3.end(); ++i) if(*i) delete *i; } ThePlot(PlotStream & fin,ThePlot *old , int kcount); void Draw(OneWindow *win) ; void DrawHelp(OneWindow *win) ; struct RGB { float r,g,b; void set(int k,int nb,ThePlot *theplot ) { DefColor(r,g,b, k,nb,theplot->hsv,theplot->grey,theplot->colors); } } ; vector tbc; void color(int i,R alpha=1.) { ffassert(tbc.size()); RGB c(tbc[min(max(0,i),(const int) tbc.size())]); if(alpha<1) { R a1=1.-alpha; c.r=c.r*alpha+a1; c.g=c.g*alpha+a1; c.b=c.b*alpha+a1; // cout << " aaaa" << alpha << endl; } glColor4f(c.r,c.g,c.b,alpha); } void SetColorTable(int nb); void SetDefIsoV(int niso=0,int narr=0,R fmn=1.,R fmx=-1.,R vmn=1.,R vmx=-1.); void DrawIsoT(const R2 Pt[3],const R ff[3],const R * Viso,int NbIso, R rapz=1); void DrawIsoTfill(const R2 Pt[3],const R ff[3],const R * Viso,int NbIso, R rapz=1); void dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn,R & vmx) const ; }; class OneWindow { public: ThePlot *theplot; list lplots;// to store some plot list::iterator icurrentPlot;//=lplots.begin(); int lplotssize; int height,width; R2 Bmin,Bmax; R2 oBmin,oBmax;// orign box R zmin,zmax; R hpixel;// taille pixel en coordonne x,y,z int xold,yold; bool windowdump,help; GLdouble modelMatrix[16]; GLdouble projMatrix[16]; GLint viewport[4]; int plotdim; R theta, phi, coef_dist, focal, dtheta; R rapz,rapz0; R3 Bmin3,Bmax3,Pvue3; R3 cam; bool withlight; bool changearrow,changeiso;// to rebuild de graphic list if neccessary bool keepPV,init; //double aspx, aspy, echx,echy,ech,rxmin,rxmax,rymin,rymax; OneWindow(int h,int w,ThePlot *p); void DefaultView(int state) ; bool NextCase() ; void SetView() ; void MoveXView(R dx,R dy) ; void set(ThePlot *p); void add(ThePlot *p); void cadre(R2 A,R2 B); void cadreortho(R2 A,R2 B); void getcadre(double &xmin,double &xmax,double &ymin,double &ymax); void Display(); void resize(int w,int h); void zoom(int w,int h,R coef); void zoom(R coef); float GetHeigthFont(){return 10;} void color(int i,R alpha=1) {theplot->color(i,alpha);} void FillRect(R x0,R y0,R x1,R y1); void PlotValue(const KN_ & Viso,int k0,const char * cmm); void DrawCommentaire(const char * cm,R x,R y); void SetScreenView() const ; void Show(const char *str,int i); void setLighting(); void unsetLighting(); void Seg(R2 A, R2 B) const { glVertex3d(A.x,A.y,theplot->z0); glVertex3d(B.x,B.y,theplot->z0); } int InRecScreen(R2 P1,R2 P2) const { R2 Pmn=Minc(P1,P2),Pmx=Maxc(P1,P2); return (Pmx.x >= Bmin.x) && (Pmn.x <= Bmax.x) && (Pmx.y >= Bmin.y) && (Pmn.y <= Bmax.y); } int InRecScreen(R3 P1,R3 P2) const { R3 Pmn=Minc(P1,P2),Pmx=Maxc(P1,P2); return (Pmx.x >= viewport[0]) && (Pmn.x <= viewport[2]) && (Pmx.y >= viewport[1]) && (Pmn.y <= viewport[3]); } }; void plot(double x,double y,const char *cmm,int font=-1); void plot(double x,double y,double i,int fint = -1); extern map AllWindows; inline OneWindow* CurrentWin() { OneWindow* w= AllWindows[glutGetWindow()]; ffassert(w); return w; } freefem++-3.61-1/src/Graphics/Xrgraph.cpp000644 000767 000024 00000074351 13256636774 020303 0ustar00hechtstaff000000 000000 /********** DO NOT REMOVE THIS BANNER **********/ // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR: D. Bernardi, F. Hecht, O. Pironneau , Y. Darmaillac // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ /******************************************************************/ const char * edpfilenamearg=0; bool waitatend=true; bool consoleatend=true; #define FF_GRAPH_SET_PTR #include #include #include #include #include #include #include "strversionnumber.hpp" using namespace std; #define MAXSHORT 0xFFFF #ifdef HPPA #ifndef __GNUC__ typedef char *caddr_t; #endif #endif #ifdef __MWERKS__ #include #include #include #include #include #include #else #include #include #include #include #include #include #endif #undef index #include "rgraph.hpp" #ifdef macintoshxx #include #include #else #include #endif template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} static long cube6[7][3] ={ { 65535,32000,32000},{ 65535, 65535,0},{0, 65535,0},{0, 65535, 65535},{0,0, 65535} , { 65535,0, 65535},{ 32000,0,0} }; static long grey6[2][3] ={ {65534,65534,65534},{0,0,0} }; static FILE *psfile = 0; static FILE *psfile_save = 0; static bool grey=false; static int LastColor=2; // pour est en couleur par defaut const float fMinPixel = -32000; const float fMaxPixel = +32000; #define reel float static Display *display; static Window win; static XSizeHints size_hints; // static XEvent report; static int ncolortable,fcolor; static XColor *colortable; static GC gc; static XFontStruct *font_info; static int shift, control,shiftlock,alt; static reel echx,echy,rxmin,rxmax,rymin,rymax; static int lacouleur,screen, width, height, currx, curry; static unsigned long background,foreground; static Cursor cursor_watch,cursor_arrow; static long NbErrX11 =0; Colormap color_map,color_map_sys; #define call(i) i static Visual *visual; static int INITGRAPH=0; void myend() { if (INITGRAPH) closegraphique(); cout << "the end" <error_code, msg, 80); fprintf(stderr, "Error code %s\n", msg);} return 0; } /* void xerror() { fprintf(stderr, "Probleme avec X-Windows\n"); assert(0); } */ void xerrorio() { fprintf(stderr, "Fatal erreur avec X-Windows\n"); assert(0); exit(2); } void MyXSelectInput(Display * dpy,Window w,int mask) { XSetWindowAttributes attributes; attributes.event_mask = mask; XChangeWindowAttributes(dpy, w, CWEventMask, &attributes); } int LaCouleur() {return lacouleur;} void couleur(int c) { if ( lacouleur == c) // small optim return; c= c > LastColor ? 1 : c; // c=Min(c,LastColor); pour noir et blanc lacouleur = c; if (colortable) { if (c>=0 && c < ncolortable) XSetForeground(display,gc,colortable[c].pixel); else XSetForeground(display,gc,foreground); } else if ( c == 0 ) XSetForeground(display,gc,background); else XSetForeground(display,gc,foreground); if (psfile) { float r=1,g=1,b=1; if (colortable) { if (c>0 && c < ncolortable) { r = (float) colortable[c].red /65535.; g = (float) colortable[c].green /65535.; b = (float) colortable[c].blue /65535.; } } else if (c!=0) r=g=b=0; fprintf(psfile,"%.3f %.3f %.3f C\n",r,g,b); } } static XColor DefColorX11( int k,int nb, bool hsv,bool grey,int nbcolors,float *colors) { XColor C; float r,g,b; extern void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,int nbcolors,float *colors); DefColor(r,g,b, k,nb,hsv,grey,nbcolors,colors); C.red=65535*r; C.green=65535*g; C.blue=65535*b; C.flags = DoRed | DoGreen | DoBlue; C.pixel=k; // cout << " color : " << k << " " << C.red << " "<< C.green << " " << C.blue << " " << r << endl; return C; } void SetColorTable1(int nb,bool hsv,int nbcolors,float *colors) { static bool greyo = !grey; static float * colorso =0; if(!INITGRAPH) return; if (ncolortable == nb && greyo == grey && colorso == colors ) return;// optim greyo = grey; colorso=colors; if (fcolor && nb>2 && nb < 256) { if(colortable) delete [] colortable; colortable = new XColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; for (int i0=0;i0c_class != TrueColor) { // cout << "XStoreColors( not TrueColor)" << ncolortable << " " << XStoreColors (display, color_map, colortable, ncolortable) ; // << endl; } else { // cout << "XAllocColor (TrueColor)" << endl; for (int i=0;i2 && nb < 256) { nb = Max(nb,8); if (ncolortable == nb) return;// optim if(colortable) delete [] colortable; colortable = new XColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; int k=0; colortable[k].pixel=k; colortable[k].red= 65535; colortable[k].green= 65535; colortable[k].blue= 65535; colortable[k].flags = DoRed | DoGreen | DoBlue; background=k; k++; colortable[k].pixel=k; colortable[k].red=0; colortable[k].green=0; colortable[k].blue=0; colortable[k].flags = DoRed | DoGreen | DoBlue; foreground=k; k++; nb = nb -2; for (long i0=0;i0bits_per_rgb; color_map_sys = DefaultColormap (display, DefaultScreen (display)); color_map = color_map_sys; foreground= BlackPixel(display, screen); background= WhitePixel(display, screen); switch (visual->c_class) { case GrayScale: {break;} case PseudoColor: { cout << " PseudoColor nbcolor =" << visual->map_entries << endl; color_map= XCreateColormap (display, RootWindow (display, DefaultScreen (display)), visual,AllocAll); // copy the def color map for (int i=0;imap_entries;i++) { XColor colorcell_defs; colorcell_defs.pixel = (unsigned long) i; XQueryColor (display, color_map_sys, &colorcell_defs); XStoreColor (display, color_map, &colorcell_defs); } fcolor=1; SetColorTable(8); // set break; } case DirectColor: { cout << " DirectColor " << endl; fcolor=1; SetColorTable(8); // set break; } case TrueColor : { cout << " TrueColor " << endl; fcolor=1; SetColorTable(8); // set break; } } font_info = XLoadQueryFont(display, "6x9"); if (!font_info) font_info = XLoadQueryFont(display, "6x10"); if( !font_info) {cout << " erreur font 6x10 and 6x9 not found !\n";exit(2);}; XSetErrorHandler((XErrorHandler)xerror); XSetIOErrorHandler((XIOErrorHandler)xerrorio); screen = DefaultScreen(display); width = DisplayWidth(display, screen); height = DisplayHeight(display, screen); ddd = width < height ? width : height; width = ddd*8/10; height = ddd*8/10; attributes.background_pixel = background; attributes.border_pixel = foreground; attributes.backing_store = Always; attributes.colormap = color_map; win = XCreateWindow(display, RootWindow(display, DefaultScreen(display)), 50, 80, width, height,4, CopyFromParent, InputOutput, visual, CWBackPixel | CWBorderPixel | CWBackingStore | CWColormap, &attributes); char title[256]; sprintf(title,"%s%s","FreeFrem++ ",StrVersionNumber().c_str()); XChangeProperty(display, win, XA_WM_NAME, XA_STRING, 8 , PropModeReplace,(const unsigned char *) title , strlen(title)); gcvalues.foreground = foreground; gcvalues.background = background; gcvalues.function = GXcopy ; gc = XCreateGC(display, win, GCForeground | GCBackground | GCFunction, &gcvalues); XSetFillRule(display,gc,WindingRule); // win = XCreateSimpleWindow(display, RootWindow(display, screen), 50, 80, width, height, 4, // foreground,background); cursor_arrow = XCreateFontCursor(display,XC_arrow); cursor_watch = XCreateFontCursor(display,XC_watch); size_hints.flags = PPosition | PSize; size_hints.x = 0; size_hints.y = 0; size_hints.width = width; size_hints.height = height; XSetFont(display, gc, font_info->fid); XSetForeground(display, gc, foreground); XMapWindow(display, win); MyXSelectInput (display, win, (int) (ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask /* | ResizeRedirectMask */ | StructureNotifyMask) ); // do XNextEvent(display, &report); while (report.type != Expose); XDefineCursor(display,win,cursor_watch); XFlush(display); INITGRAPH = 1; } void closegraphique() { if (INITGRAPH) { INITGRAPH = 0; XUnloadFont(display, font_info->fid); XFreeGC(display, gc); XCloseDisplay(display); closePS(); } } void cadre(reel xmin,reel xmax,reel ymin,reel ymax) { rxmin = xmin; rxmax = xmax; rymin = ymin; rymax = ymax; echx = width / (xmax - xmin); echy = height / (ymax - ymin); } void getcadre(reel &xmin,reel &xmax,reel &ymin,reel &ymax) { xmin = rxmin; xmax = rxmax; ymin = rymin; ymax = rymax; } int InRecScreen(reel x1, reel y1,reel x2, reel y2) { return (Max(x1,x2)>= rxmin) && (Min(x1,x2) <= rxmax) && (Max(y1,y2) >= rymin) && (Min(y1,y2) <= rymax); } int InPtScreen( reel x, reel y) { return (x >= rxmin) && (x <= rxmax) && (y >= rymin) && (y <= rymax); } float scali(int i) { return i/echx + rxmin; } float scalj(int j) { return -j/echy + rymax; } int scalx(reel x) { return (int) Min(fMaxPixel,Max(fMinPixel,((x - rxmin) * echx))); } int scaly(reel y) { return (int)Min(fMaxPixel,Max(fMinPixel,((rymax - y) * echy))); } void pointe(reel x, reel y) { XDrawPoint(display, win, gc, scalx(x), scaly(y)); } void rmoveto(reel x, reel y) { currx = scalx(x); curry = scaly(y); } void rlineto(reel x, reel y) { int newx = scalx(x), newy = scaly(y); XDrawLine(display, win, gc, currx, curry, newx, newy); if (psfile) fprintf(psfile,"%d %d %d %d L\n",currx, height-curry, newx, height-newy); currx = newx; curry = newy; /* XFlush(display); */ } void cadreortho(reel centrex, reel centrey, reel rayon) { // int xasp,yasp; if (height < width) { rymin = centrey - rayon; rymax = centrey + rayon; echx = echy= height / (2 * rayon); rxmin= centrex - width / (2 * echx); rxmax= centrex + width / (2 * echx); } else { rxmin = centrex - rayon; rxmax = centrex + rayon; echx = echy = width / (2 * rayon); rymin = centrey - height / (2 * echy); rymax = centrey + height / (2 * echy); } } void plotstring (const char * string) { int lx,l = strlen(string); XDrawString(display, win, gc, currx, curry , string, l); lx = XTextWidth( font_info,string,l); if(psfile) fprintf(psfile,"(%s) %d %d S\n",string,currx,height-curry); currx += lx; } void showgraphic() { } void x11draw3(int * ptype) { XGCValues gcvalues; int type; type= *ptype; switch (type) { case 0 : {gcvalues.line_style = LineSolid; break;} case 1 : {gcvalues.line_style = LineOnOffDash; break;} default : {gcvalues.line_style = LineDoubleDash;break;} } XChangeGC(display, gc, GCLineStyle, &gcvalues); if (psfile) switch (type) { case 0 : {fprintf(psfile,"[] setdash\n");break;} case 1 : {fprintf(psfile,"[3] setdash\n");break;} default : {fprintf(psfile,"[4 1] setdash\n");break;} } } void penthickness(int pepais) { XGCValues gcvalues; gcvalues.line_width = pepais; XChangeGC(display, gc, GCLineWidth, &gcvalues); if (psfile) fprintf(psfile,"%d setlinewidth\n",pepais); } void x11linsrn(int * x1,int * x2,int * y1,int * y2) //int *x1,*x2,*y1,*y2; { XDrawLine(display, win, gc, *x1, *x2, *y1, *y2); /* call(viderbuff)(); */ } void viderbuff() { XRaiseWindow (display,win); XFlush(display); } void cercle(reel centrex, reel centrey, reel rayon) { int r = (int) (rayon * echx); XDrawArc(display, win, gc, scalx(centrex) - r, scaly(centrey) - r, width, height, 0, 360 * 64); XFlush(display); } void reffecran() { XClearWindow(display,win); } void fillpoly(int n, float *poly) { int i; XPoint *poly0,polyloc[10]; if(n<10) poly0=polyloc; else if(poly0= (XPoint *) malloc(n*sizeof(XPoint)), !poly) { fprintf(stderr, "Erreur d'allocation dans raffpoly\n"); return; } for(i=0; i1000) break; } while ( !notfound ); const char *fps (filename?filename:ffff); psfile=fopen(fps,"w"); if(psfile) { psfile_save=psfile; fprintf(psfile,"%%!PS-Adobe-2.0 EPSF-2.0\n%%%%Creator: %s\n%%%%Title: FreeFem++\n","user"); fprintf(psfile,"%%%%CreationDate: %s",ctime(&t_loc)); fprintf(psfile,"%%%%Pages: 1\n"); fprintf(psfile,"%%%%BoundingBox: 0 0 %d %d\n",int(width*s),int(height*s)); fprintf(psfile,"%%%%EndComments\n"); fprintf(psfile," /L {newpath moveto lineto stroke} def\n"); fprintf(psfile," /C {setrgbcolor} def\n"); fprintf(psfile," /rec {newpath 4 copy 8 1 roll moveto 3 -1 roll lineto 4 2 roll exch lineto lineto closepath} def\n"); fprintf(psfile," %f %f scale \n",s,s); fprintf(psfile," 0 %d 0 %d rec clip\n",int(width),int(height)); fprintf(psfile," /Helvetica findfont 10 scalefont setfont\n"); fprintf(psfile," /S {moveto show} def\n"); fprintf(psfile," /bF { mark} def \n"); fprintf(psfile," /eF {newpath moveto counttomark 2 idiv {lineto} repeat closepath fill cleartomark} def\n"); fprintf(psfile," /P { /yy exch def /xx exch def xx xx 1 add yy yy 1 add rec fill } def\n"); fprintf(psfile," 1 setlinewidth\n"); } else cerr << " Err openning postscript file " << fps << endl; } void closePS(void) { if(psfile_save) { fprintf(psfile_save,"showpage\n"); fclose(psfile_save); } psfile_save=0; psfile=0; } void coutmode(short i) {} // bof bof --- float GetHeigthFont() { int dir,asc,desc,k; XCharStruct overall; XTextExtents(font_info,"gML",3,&dir,&asc,&desc,&overall); return (asc+desc)*(0.9/echy); } void Commentaire(const char * c) { if(psfile) { fprintf(psfile,"%% %s\n",c); } }; void NoirEtBlanc(int NB) { if(NB) LastColor=1; else LastColor=ncolortable?ncolortable:2; } void MettreDansPostScript(int in) { if(in) psfile=psfile_save; else psfile=0; } static void FillRect(float x0,float y0, float x1, float y1) { float r[8]; r[0]=x0;r[1]=y0; r[2]=x1;r[3]=y0; r[4]=x1;r[5]=y1; r[6]=x0;r[7]=y1; fillpoly(4,r); } int PutLevel(int lineno, float xf, int col) { float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); float xleft = xmax - (xmax-xmin)*0.1; float ytop = ymax; float ydelta = (ymax-ymin)/40; ydelta=GetHeigthFont(); xleft = xmax - 6*ydelta; ytop -= ydelta*(col+2); couleur(col); FillRect(xleft+ydelta/8.,ytop+ydelta/8.,xleft+ydelta*7./8.,ytop+ydelta*7./8.); rmoveto(xleft+ydelta*1.4,ytop+ydelta/4); char buf[30]; sprintf(buf,"%g",xf); couleur(1); plotstring(buf); return lineno; } void ShowHelp(const char * s,int k) { if(k) { MettreDansPostScript(0); couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); MettreDansPostScript(1); // couleur(1); } } void setgrey(bool gg ){grey=gg;} int getgrey(){ return grey;} class Grid; void SaveMesh(Grid &t){} void SavePlot(int D, Grid& t, double *f){} void SavePlot(int D, Grid& t, float *f){} freefem++-3.61-1/src/Graphics/ff-win32.cpp000644 000767 000024 00000004721 13321622623 020172 0ustar00hechtstaff000000 000000 #ifdef _WIN32 #include using namespace std; #include #ifdef _WIN64 #pragma pack( push ) #pragma pack( 16 ) #include "Commdlg.h" #pragma pack( pop ) #else #include "Commdlg.h" #endif // _WIN64 //#include #include //*OT use for the console window BOOL ShowOpenDialogBox1(char *fileName) { OPENFILENAME *pofn= new OPENFILENAME[2], &ofn= *pofn; char szDirName[256]; const char *strFilter="freefem++ Files (*.edp)\0*.edp\0All Files (*.*)\0*.*\0\0"; memset(&ofn, 0, 2*sizeof(OPENFILENAME)); getcwd(szDirName,sizeof(szDirName)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = NULL; ofn.lpstrFilter = strFilter; ofn.lpstrFileTitle = fileName; ofn.nMaxFileTitle = 1024; ofn.lpstrInitialDir=szDirName; ofn.lpstrTitle ="Choose you freefem '*.edp' File"; ofn.Flags=OFN_SHOWHELP|OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST; BOOL ret= GetOpenFileNameA(pofn); cout << " ret "<< ret << " "<< fileName << " "<< szDirName << endl; delete[] pofn; return ret; } string ChangeExt(const string & ff,const char * suff) { int dot = ff.rfind(".edp"); assert(dot>0); return ff.substr(0,dot)+suff; } bool GetConsoleBuff(const string &edpname) { CONSOLE_SCREEN_BUFFER_INFO csbi; //* to get buffer info HANDLE hConOut= GetStdHandle(STD_OUTPUT_HANDLE); //cout << " handle " << hConOut << endl; if( hConOut == 0) return false ; if ( INVALID_HANDLE_VALUE == hConOut) return false; GetConsoleScreenBufferInfo(hConOut, &csbi); COORD coordLine = {0,0}; CHAR *szLine=0; //* buffer to read from the console (a line) DWORD dwCharsRead; FILE *fp; string fname=ChangeExt(edpname,".log"); if ((fp = fopen(fname.c_str(),"w"))==NULL) { perror(fname.c_str()); cout<< " err fopen logfile: "<< fname << endl; return false; } szLine = new CHAR [csbi.dwSize.X+1]; for (int i=0; i 0)) szLine[j--] =0; if (j < csbi.dwSize.X-1) szLine[j+1] = '\n'; fprintf(fp,"%s",szLine); coordLine.Y++; } fclose(fp); delete [] szLine; cout << " save log in : '"<< fname << "'\n" ; return true; } #endif freefem++-3.61-1/src/Graphics/ffthreads.cpp000644 000767 000024 00000004561 13256636774 020632 0ustar00hechtstaff000000 000000 // SUMMARY : Threads for Linux and Microsoft Win32 // USAGE : // ORG : // AUTHOR : Antoine Le Hyaric / F. Hecht // E-MAIL : lehyaric@ann.jussieu.fr // 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 // Frederic Hecht . #include #include #include #include #include #include using namespace std; #define ERROR_FF(msg) (cerr << msg< #else #include #endif Thread::Id Thread::Start(THREADFUNC(f,),Thread::Parm p){ Id tid; #ifdef __MINGW32__ unsigned ThreadId; tid = (HANDLE) _beginthreadex(NULL,0,f,p,0,&ThreadId); if(tid == NULL) ERROR_FF("Thread::Start: Thread could not be created"); #else int R = pthread_create(&tid,NULL,f,p); if(R != 0) ERROR_FF("Thread::Start: Thread could not be created"); #endif return tid; } void Thread::Wait(Thread::Id tid){ #ifdef __MINGW32__ DWORD R = WaitForSingleObject(tid,INFINITE); if(R == WAIT_FAILED) ERROR_FF("Thread::Wait" " -- Wait failed"); CloseHandle(tid); #else int R=pthread_join(tid,NULL); if(R!=0) ERROR_FF("Thread::Wait: Wait failed"); #endif } void Thread::Exit(){ #ifdef __MINGW32__ _endthreadex(0); #else pthread_exit(NULL); // No test: returns void. #endif } void Thread::Kill(Thread::Id tid){ #ifdef __MINGW32__ if(TerminateThread(tid,0) == 0) ERROR_FF("Thread::Kill: Thread not killed"); #else if(pthread_kill(tid,SIGINT)!=0) ERROR_FF("Thread::Kill: Thread not killed"); #endif } Thread::Id Thread::Current(){ #ifdef __MINGW32__ return GetCurrentThread(); #else return pthread_self(); #endif } freefem++-3.61-1/src/Graphics/xglrgraf.cpp000644 000767 000024 00000001677 13256636774 020505 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #define XGL #define FF_GRAPH_SET_PTR #include "glrgraph.hpp" freefem++-3.61-1/src/Graphics/rgraph.hpp000644 000767 000024 00000015555 13256636774 020161 0ustar00hechtstaff000000 000000 // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr /* ------------------- */ /* (e-mail) Olivier.Pironneau@ann.jussieu.fr */ /* (e-mail) hecht@ann.jussieu.fr */ /******************************************************/ /* 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 */ // E-MAIL : Frederic.Hecht@Inria.fr // // ORIG-DATE: Dec 97 #ifndef RGRAPH_H_ #define RGRAPH_H_ // Modif F Hecht for dll on win32 // pass all the graphic function via pointeur // now the real graphic function of a pointeur xxxx is call xxxx_ // We just need to add <> in all graphic.cpp version // the dcl of xxxx pointeur is done via GRAPH_PTR_DCL macro (set one time ) // // ----- #ifdef FF_GRAPH_SET_PTR #define EXTERNFF(t,f,arg) t f##_ arg; extern t (*f) arg #else #ifdef FF_GRAPH_PTR_DCL #define EXTERNFF(t,f,arg) t (*f) arg #else #define EXTERNFF(t,f,arg) extern t (*f) arg #endif #endif //#define EXTERN #ifdef __cplusplus #include "config-wrapper.h" //extern "C" { EXTERNFF( void ,getcadre,(float &xmin,float &xmax, float &ymin, float &ymax)) ; EXTERNFF( void ,GetScreenSize,(int &ix,int &iy)) ; // unused EXTERNFF( char ,Getxyc,(float &x,float &y)) ; EXTERNFF( void ,ShowHelp,(const char * s,int k)) ; // k=1 ??//tlr: deplace ici #endif EXTERNFF( void ,erreur,(char *s)) ; EXTERNFF( void ,initgraphique,()) ; // only in main EXTERNFF( void ,closegraphique,()) ; EXTERNFF( void ,showgraphic,()) ; EXTERNFF( void ,rattente,(int waitm)) ; EXTERNFF( void ,cadre,(float xmin,float xmax, float ymin, float ymax)) ; EXTERNFF( void ,cadreortho,(float centrex, float centrey, float rayon)) ; EXTERNFF( void ,couleur,(int c)) ; EXTERNFF( int ,LaCouleur,()) ; EXTERNFF( void ,pointe,(float x, float y)) ; EXTERNFF( int ,InPtScreen,(float x, float y)) ; EXTERNFF( int ,InRecScreen,(float x1, float y1,float x2, float y2)) ; EXTERNFF( void ,plotstring,(const char *s)) ; EXTERNFF( void ,rmoveto,(float x, float y)) ; EXTERNFF( void ,rlineto,(float x, float y)) ; EXTERNFF( void ,penthickness,(int )) ; EXTERNFF( int ,execute,(const char* s)) ; EXTERNFF( void ,reffecran,()) ; EXTERNFF( void ,fillpoly,(int n, float *poly)) ; EXTERNFF( void ,SetColorTable,(int nb)) ; EXTERNFF( void ,SetColorTable1,(int nb,bool hsv,int nbcolors,float *colors)) ; EXTERNFF( float ,GetHeigthFont,()) ; // old function for freefem+ //EXTERNFF( void ,compile,(char *fname)) ; //EXTERNFF( void ,compileString,(char *texte)) ;/*tlr: add a string stream */ EXTERNFF( void ,openPS,(const char * )) ; EXTERNFF( void ,closePS,(void)) ; EXTERNFF( void ,coutmode,(short i)) ; EXTERNFF( void ,myexit,(int err)) ; // err=0 ?? EXTERNFF( void ,viderbuff,()) ; EXTERNFF( void ,Commentaire,(const char *)) ; EXTERNFF( void ,NoirEtBlanc,(int NB)) ; EXTERNFF( void ,MettreDansPostScript,(int in)) ;// oui=1 ou non=0 EXTERNFF( int ,getprog,(char* fn,int , char** argvptr)) ; EXTERNFF( void ,setgrey,(bool )) ; EXTERNFF( int ,getgrey,( )) ; // wrapping of function ----- #ifdef FF_GRAPH_SET_PTR static int init_ff_graph_ptr_func() { // a small function to set all pointeur getcadre=getcadre_; GetScreenSize=GetScreenSize_; Getxyc=Getxyc_; ShowHelp=ShowHelp_; erreur=erreur_; initgraphique=initgraphique_; closegraphique=closegraphique_; showgraphic=showgraphic_; rattente=rattente_; cadre=cadre_; cadreortho=cadreortho_; couleur=couleur_; LaCouleur=LaCouleur_; pointe=pointe_; InPtScreen=InPtScreen_; InRecScreen=InRecScreen_; plotstring=plotstring_; rmoveto=rmoveto_; rlineto=rlineto_; penthickness=penthickness_; execute=execute_; reffecran=reffecran_; fillpoly=fillpoly_; SetColorTable=SetColorTable_; SetColorTable1=SetColorTable1_; GetHeigthFont=GetHeigthFont_; //compile=compile_; //compileString=compileString_; openPS=openPS_; closePS=closePS_; coutmode=coutmode_; myexit=myexit_; viderbuff=viderbuff_; Commentaire=Commentaire_; NoirEtBlanc=NoirEtBlanc_; MettreDansPostScript=MettreDansPostScript_; getprog=getprog_; setgrey=setgrey_; getgrey=getgrey_; return 1; } // to call the init function before main static int init_ff_graph_ptr_func_call = init_ff_graph_ptr_func(); #define getcadre getcadre_ #define GetScreenSize GetScreenSize_ #define Getxyc Getxyc_ #define ShowHelp ShowHelp_ #define erreur erreur_ #define initgraphique initgraphique_ #define closegraphique closegraphique_ #define showgraphic showgraphic_ #define rattente rattente_ #define cadre cadre_ #define cadreortho cadreortho_ #define couleur couleur_ #define LaCouleur LaCouleur_ #define pointe pointe_ #define InPtScreen InPtScreen_ #define InRecScreen InRecScreen_ #define plotstring plotstring_ #define rmoveto rmoveto_ #define rlineto rlineto_ #define penthickness penthickness_ #define execute execute_ #define reffecran reffecran_ #define fillpoly fillpoly_ #define SetColorTable SetColorTable_ #define SetColorTable1 SetColorTable1_ #define GetHeigthFont GetHeigthFont_ //#define compile compile_ //#define compileString compileString_ #define openPS openPS_ #define closePS closePS_ #define coutmode coutmode_ #define myexit myexit_ #define viderbuff viderbuff_ #define Commentaire Commentaire_ #define NoirEtBlanc NoirEtBlanc_ #define MettreDansPostScript MettreDansPostScript_ #define getprog getprog_ #define setgrey setgrey_ #define getgrey getgrey_ #endif // end wrapping ---- #ifdef __cplusplus //} #ifdef TERM_USED /** Ouput on the terminal window */ class myostream { int channel; public: myostream(int ch) { channel = ch; } myostream& operator<<(char c); myostream& operator<<(const char *s); myostream& operator<<(const void *p); myostream& operator<<(int n); myostream& operator<<(unsigned int n) { return *this << (int)n; } myostream& operator<<(long n); myostream& operator<<(unsigned long n) { return *this << (long)n; } myostream& operator<<(double n); myostream& operator<<(float n) { return *this << (double)n; } myostream& operator<<(__omanip func); }; extern myostream termout; // could be cout, or another thing extern myostream termerr; // could be cerr, or another thing #define cout termout #define cerr termerr #endif /* TERM_USED */ #endif /* __cplusplus */ #endif /* RGRAPH_H_ */ freefem++-3.61-1/src/Graphics/macrgraf.cpp000644 000767 000024 00000071665 13256636774 020457 0ustar00hechtstaff000000 000000 // // SUMMARY : // ORG : UPMC // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /**************DO NOR REMOVE THIS BANNER***************/ /* FreeFEM++ : Language for a Finite Element Method */ /* ------- Release 1.0: June 1994. */ /* Authors: D. Bernardi, Y. Darmaillac F. Hecht, */ /* O. Pironneau */ // -*- Mode : c++ -*- /* 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 */ /* out our consent : fax (33)1 44 27 44 11 */ /* (fax) Olivier.Pironneau@ann.jussieu.fr */ /******************************************************/ // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : /* Authors: D. Bernardi, Y. Darmaillac F. Hecht, */ /* O. Pironneau */ // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ const char * edpfilenamearg=0; bool waitatend=true; //#define TARGET_API_MAC_CARBON 1 #define FF_GRAPH_SET_PTR #include #include #include //OP my hack #include "error.hpp" #include #include #include using namespace std; #include #include #include #include #define fill thequikdrawfill #include "rgraph.hpp" #include #include #include #include //#include #include #include #include #include #include #include #undef fill static FILE *psfile = 0; static FILE *psfile_save = 0; static bool grey=false; int pStrCopy (StringPtr p1, char * p2); #ifdef FREEFEM // pour imprimer la version FH #define STRING(i) #i #include jmp_buf environ; static int myenviron = 0; TEHandle TESioux; void out_of_memory (); void NEW_HANDLER (void); void compile(char *fname); float scali(int i); float scalj(int j); void execute(char* what); int DoMouseDown (int windowPart, WindowPtr whichWindow, EventRecord *myEvent); char Getijc(int & x,int & y); void out_of_memory () { cout << "FreeFEM error: operator new failed; not enough memory" << endl; if (myenviron) longjmp(environ,1); exit(2); } void NEW_HANDLER (void){ set_new_handler (&out_of_memory);} #endif #define ours(w) (w==grafWindow0) template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} static int cube6[7][3] ={ {65534,0,0},{65534,65534,0},{0,65534,0},{0,65534,65534},{0,0,65534} , {65534,0,65534},{65534,0,0} }; static int grey6[2][3] ={ {65534,65534,65534},{0,0,0} }; char errbuf[255]; static int INITGRAPH=0; static float aspx, aspy, echx,echy,ech,rxmin,rxmax,rymin,rymax; static int carre, lacouleur; // static CWindowRecord wgRecord0; static WindowPtr grafWindow0; static GrafPtr grafPort0; static Rect boundsRect; static int nbcolor; static CursHandle CrossCurseur ; static CursHandle WatchCurseur ; static int ncolortable; static int LastColor; // LastColor=1 => Noir et Blanc static Pattern white,black; static int width,height; static RGBColor * colortable; int getcolor(); void putpixel(int ix,int iy, int couleur); int scalx(float x); int scaly(float y); void thisexit(); void InitMac(); // -------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------- // APPLE EVENT SUPPORT ROUTINES // -------------------------------------------------------------------------------------------------------------- static OSStatus MissingParameterCheck( const AppleEvent *inputEvent) /* This routine checks an input AppleEvent for the missing keyword. If the missing keyword is found, that means that some required parameters were missing (ie, an error). However, if the missing keyword isn't found, that means that we aren't missing any required parameters (that is to say, all REQUIRED parameters were supplied by the person who created the event). SOME DAY, THE ABOVE COMMENT WILL MAKE SENSE TO YOU. IT STILL DOESN'T TO ME AND I WAS THE ONE WHO WROTE IT. */ { OSStatus anErr; AEKeyword missingKeyword; DescType ignoredActualType; Size ignoredActualSize; anErr = AEGetAttributePtr( inputEvent, keyMissedKeywordAttr, typeWildCard, &ignoredActualType, (Ptr) &missingKeyword, sizeof(AEKeyword), &ignoredActualSize); if (anErr == noErr) anErr = errAEParamMissed; else if (anErr == errAEDescNotFound) anErr = noErr; return anErr; } // MissingParameterCheck static pascal OSErr DoOpenApp( const AppleEvent *inputEvent, AppleEvent *outputEvent, SInt32 handlerRefCon) { /* #pragma unused (outputEvent, handlerRefCon) DoCommand(nil, cNew, 0, 0); // so that the initial document opens more quickly, we don't start // the threads until we get an OpenApp or OpenDocument AppleEvent if (gStarterThread != kNoThreadID) SetThreadState(gStarterThread, kReadyThreadState, gStarterThread); */ return(MissingParameterCheck(inputEvent)); } // DoOpenApp // -------------------------------------------------------------------------------------------------------------- static pascal OSErr DoReopenApp( const AppleEvent *inputEvent, AppleEvent *outputEvent, SInt32 handlerRefCon) { /* #pragma unused (outputEvent, handlerRefCon) if (FrontWindow() == nil) DoCommand(nil, cNew, 0, 0); */ return(MissingParameterCheck(inputEvent)); } // DoReopenApp // -------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------- static pascal OSStatus DoOpenFile( const AppleEvent *inputEvent ) // nil == 0, zero length == print to default, other == printer name { OSStatus anErr, anErr2; AEDescList docList; // list of docs passed in long index, itemsInList; Boolean wasAlreadyOpen; /* anErr = AEGetParamDesc( inputEvent, keyDirectObject, typeAEList, &docList); nrequire(anErr, GetFileList); anErr = AECountItems( &docList, &itemsInList); // how many files passed in nrequire(anErr, CountDocs); for (index = 1; index <= itemsInList; index++) // handle each file passed in { AEKeyword keywd; DescType returnedType; Size actualSize; FSRef fileRef; FSCatalogInfo theCatInfo; anErr = AEGetNthPtr( &docList, index, typeFSRef, &keywd, &returnedType, (Ptr)(&fileRef), sizeof( fileRef ), &actualSize ); nrequire(anErr, AEGetNthPtr); anErr = FSGetCatalogInfo( &fileRef, kFSCatInfoFinderInfo, &theCatInfo, NULL, NULL, NULL ); /* nrequire(anErr, FSGetCatalogInfo); if (anErr == noErr) anErr = DetermineWindowTypeOrOpen(&fileRef, ((FInfo*)&theCatInfo.finderInfo)->fdType, nil, nil, &wasAlreadyOpen); */ // } return anErr; } // DoOpenOrPrint // -------------------------------------------------------------------------------------------------------------- static pascal OSErr DoOpenDocument( const AppleEvent *inputEvent, AppleEvent *outputEvent, SInt32 handlerRefCon) { #pragma unused (outputEvent, handlerRefCon) OSStatus anErr=0; anErr = DoOpenFile(inputEvent); return anErr; } // DoOpenDocument void InitMac() { #if TARGET_API_MAC_OS8 InitGraf(&qd.thePort); InitFonts(); InitWindows(); InitMenus(); TEInit(); InitDialogs(0L); FlushEvents(everyEvent, 0L); MaxApplZone(); #endif /* TARGET_API_MAC_OS8 */ MoreMasters(); InitCursor(); #if TARGET_API_MAC_CARBON BitMap screenBitMap; Rect screenBits; Cursor theArrow; GetQDGlobalsScreenBits(&screenBitMap); screenBits = screenBitMap.bounds; SetCursor(GetQDGlobalsArrow(&theArrow)); #else Rect screenBits = qd.screenBits.bounds; SetCursor(&qd.arrow); #endif /* TARGET_API_MAC_CARBON */ SIOUXSettings.initializeTB = 0; // else SIOUX initialize the toolbox for us SIOUXSettings.toppixel = 45; SIOUXSettings.leftpixel = 15; // SIOUXSettings.fontface = bold + italic;// or normal SIOUXSettings.asktosaveonclose = 0; short bas = screenBits.bottom; short droit = screenBits.right; SIOUXSettings.columns = (short)(2.+(float)droit/8.); SIOUXSettings.rows = (short)(10. + (float)bas/18.); SIOUXSetTitle("\pfreefem+ line output"); //marche pas!! SIOUXSettings.fontface = normal; SIOUXSettings.fontid = 22;// courier; SIOUXSettings.fontsize = 10; cout << "Initmac" << endl; #define INSTALL(event, handler) \ AEInstallEventHandler(kCoreEventClass, event, handler, 0, false) // AEC, changed to use the correct handler procs // INSTALL (kAEOpenApplication, NewAEEventHandlerUPP(DoOpenApp)); // INSTALL (kAEReopenApplication, NewAEEventHandlerUPP(DoReopenApp)); INSTALL (kAEOpenDocuments, NewAEEventHandlerUPP(DoOpenDocument)); #undef INSTALL } class InitilisationMac { static int init; public: InitilisationMac(){ InitMac();} }; static InitilisationMac Initmac; // to call InitMac int getprog(char* fn,int argc, char** argvptr) { OSErr anErr; NavDialogOptions dialogOptions; NavReplyRecord reply; anErr=NavGetDefaultDialogOptions(& dialogOptions); if( anErr != noErr) return -1; anErr =NavChooseFile(0,&reply,&dialogOptions,0,0,0,0,0) ; if (anErr == noErr && reply.validRecord) { // Deal with multiple file selection long count; anErr = AECountItems(&(reply.selection), &count); // Set up index for file list if (anErr == noErr) { long index; for (index = 1; index <= count; index++) { AEKeyword theKeyword; DescType actualType; Size actualSize; FSSpec documentFSSpec; // Get a pointer to selected file anErr = AEGetNthPtr(&(reply.selection), index, typeFSS, &theKeyword, &actualType,&documentFSSpec, sizeof(documentFSSpec), &actualSize); if (anErr == noErr) { anErr = HSetVol(0,documentFSSpec.vRefNum,documentFSSpec.parID); pStrCopy(documentFSSpec.name, fn); } } } // Dispose of NavReplyRecord, resources, descriptors anErr = NavDisposeReply(&reply); } else return 0; // erreur cancel return (2); } #ifdef FREEFEM void thisexit(){ myexit();} int main (int argc, char **argv) { char *prog; char fname[256]; SIOUXSettings.sleep=1; argc = getprog (fname, argc, argv); atexit(thisexit); NEW_HANDLER (); // see dependent system files ({pc,x,mac}rgraph.{h,cpp}) int OPTION = 0; if (argc == 2) { initgraphique(); if(0==setjmp(environ)) { myenviron=1; compile (fname); // cout << "No Error" << endl; } myenviron = 0; } else printf ("To launch freefem you must type freefem and a file name\n"); return 0; } #else extern int mymain(int argc,char **argv); string StrVersionNumber(); int main (int argc, char **argv) { SIOUXUseWaitNextEvent = true; SIOUXSettings.sleep=0; char * wn = new char [256]; for (int i=0;i<256;i++) wn[i] = 0; strcpy(wn," -- FreeFem++ "); strcat(wn,StrVersionNumber().c_str()); SIOUXSetTitle((unsigned char *) wn); int ret=15; try { ret=mymain(argc,argv);} catch( ...) { cerr << "catch exception ???";} catch( Error & err) { cerr << err.what() << endl; } return ret; } void myexit(int i) { exit(i); } #endif void coutmode(short i) { cout << flush; cerr << flush; // if(i)(**(SIOUXTextWindow->edit)).txFace = 0; // else (**(SIOUXTextWindow->edit)).txFace = 1; ;} void message(char *s) { printf("%s \n", s); } void erreur(char *s) { cout << endl; cerr << "##Fatal error :" << s << endl << "exit(1)" << endl; exit(1); } void *safecalloc(long nb, long size) { void* p=NULL; p = calloc(nb, size); if (p == NULL) erreur("Out of Memory!\n"); return p; } void safefree(void** f) { if(*f) { free(*f); *f=NULL; } } void initgraphique(void) { if(INITGRAPH) return; #if TARGET_API_MAC_CARBON BitMap screenBitMap; Rect screenBits; Cursor theArrow; GetQDGlobalsScreenBits(&screenBitMap); screenBits = screenBitMap.bounds; SetCursor(GetQDGlobalsArrow(&theArrow)); #else Rect screenBits = qd.screenBits.bounds; SetCursor(&qd.arrow); #endif /* TARGET_API_MAC_CARBON */ boundsRect.top = 45; boundsRect.left = (short) (15 + (0.35 * screenBits.right)); boundsRect.bottom = screenBits.bottom - 25; boundsRect.right = screenBits.right- 25; if((boundsRect.bottom - boundsRect.top) < (boundsRect.right - boundsRect.left)) boundsRect.right = boundsRect.left + boundsRect.bottom - boundsRect.top; else boundsRect.bottom = boundsRect.top + boundsRect.right - boundsRect.left; grafWindow0=NewCWindow(0, &boundsRect, "\pFreeFem Graphics",true, 8, NULL, true, 0); ShowWindow(grafWindow0); BringToFront(grafWindow0); SelectWindow(grafWindow0); SetPortWindowPort(grafWindow0); GetPort(&grafPort0); height = boundsRect.bottom - boundsRect.top - 10; width = boundsRect.right - boundsRect.left -10; aspx = boundsRect.right - boundsRect.left -10; aspy = boundsRect.bottom - boundsRect.top - 10; carre = aspx == aspy; lacouleur = getcolor(); CrossCurseur = GetCursor(crossCursor); WatchCurseur = GetCursor(watchCursor); GetQDGlobalsWhite(&white); GetQDGlobalsBlack(&black); //if( (**(wgRecord0.port.portPixMap)).pixelSize>7) nbcolor= 256; //else // nbcolor= 2; ncolortable =0; LastColor=2;// En couleur pas defaul colortable=0; SetColorTable(2+6); // TextFont(fontNum); TextSize(9); // small size INITGRAPH = 1; } static RGBColor DefColorMacOs( int k,int nb,bool hsv, bool grey,int nbcolors,float *colors) { RGBColor C; float r,g,b; extern void DefColor(float & r, float & g, float & b, int k,int nb,bool hsv, bool grey,int nbcolors,float *colors); DefColor(r,g,b, k,nb,hsv,grey,nbcolors,colors); C.red=65535*r; C.green=65535*g; C.blue=65535*b; return C; } void SetColorTable1(int nb,bool hsv,int nbcolors,float *colors) { static bool greyo = !grey; static float * colorso =0; if(!INITGRAPH) return; if (ncolortable == nb && greyo == grey && colorso == colors ) return;// optim greyo = grey; colorso=colors; if (nbcolor && nb>2) { if(colortable) delete [] colortable; colortable = new RGBColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; for (int i0=0;i0 LastColor ? 1 : c; // c=Min(c,LastColor); pour noir et blanc lacouleur =c; if ( c == 0 ) ForeColor(30); else if (ncolortable>3 && c < ncolortable && c >=0 ) RGBForeColor(colortable+c); else ForeColor(33); if (psfile) { float r=1,g=1,b=1; if (colortable) { if (c>0 && c < ncolortable) { r = (float) colortable[c].red /65535.F; g = (float) colortable[c].green /65535.F; b = (float) colortable[c].blue /65535.F; } } else if (c!=0) r=g=b=0; fprintf(psfile,"%.3f %.3f %.3f C\n",r,g,b); } } int InRecScreen(float x1, float y1,float x2, float y2) { float xi = Min(x1,x2),xa=Max(x1,x2); float yi = Min(y1,y2),ya=Max(y1,y2); return (xa >= rxmin) && (xi <= rxmax) && (ya >= rymin) && (yi <= rymax); } int InPtScreen( float x, float y) { return (x >= rxmin) && (x <= rxmax) && (y >= rymin) && (y <= rymax); } void penthickness(int pepais) { PenSize(pepais,pepais); if (psfile) fprintf(psfile,"%d setlinewidth\n",pepais); } void cadre(float xmin,float xmax,float ymin,float ymax) { rxmin = xmin; rxmax = xmax; rymin = ymin; rymax = ymax; echx = aspx / (xmax - xmin); echy = aspy / (ymax - ymin); } void getcadre(float &xmin,float &xmax,float &ymin,float &ymax) { xmin = rxmin; xmax = rxmax; ymin = rymin; ymax = rymax; } void cadreortho(float centrex, float centrey, float rayon) { int xasp,yasp, getmaxx, getmaxy; getmaxx = xasp =aspx; getmaxy = yasp = aspy; if (getmaxx * (float)xasp > getmaxy * (float)yasp) { rymin = centrey - rayon; rymax = centrey + rayon; echy= getmaxy / (2 * rayon); echx= (echy * xasp) / yasp; rxmin= centrex - getmaxx / (2 * echx); rxmax= centrex + getmaxx / (2 * echx); } else { rxmin = centrex - rayon; rxmax = centrex + rayon; echx = getmaxx / (2 * rayon); echy = (echx * yasp) / xasp; rymin = centrey - getmaxy / (2 * echy); rymax = centrey + getmaxy / (2 * echy); } } int scalx(float x) { return int((x - rxmin) * echx); } int scaly(float y) { return int((rymax - y) * echy); } float scali(int i) { return i/echx + rxmin; } float scalj(int j) { return -j/echy + rymax; } void pointe(float x, float y) { int newx = scalx(x), newy = scaly(y); putpixel(newx, newy, lacouleur); if (psfile) fprintf(psfile,"%d %d P\n", newx, height-newy); } void rmoveto(float x, float y) { int newx = scalx(x), newy = scaly(y); MoveTo(newx,newy); if (psfile) fprintf(psfile,"%d %d M\n", newx, height-newy); } void rlineto(float x, float y) { int newx = scalx(x), newy = scaly(y); LineTo(newx,newy); if (psfile) fprintf(psfile,"%d %d L\n", newx,height-newy); } void raffpoly(int n, float *poly) { PolyHandle thePoly; int i; thePoly =OpenPoly(); MoveTo(scalx(poly[0]),scaly( poly[1])); for(i=1; iwhere)) { closegraphique(); cout << "Fin (fermeture fenetre graphique) " <portRect)); ZoomWindow(whichWindow, inZoomIn, true); InitCursor(); } break; case inZoomOut: /* if (ours(whichWindow)) { SetCursor(&waitCursor); SetPort(whichWindow); EraseRect(&(whichWindow->portRect)); ZoomWindow(whichWindow, inZoomOut, true); if(whichWindow == editWindow) MyZoomWindow(whichWindow); InitCursor(); }*/ break; case inMenuBar: // return(DoCommand(MenuSelect(myEvent->where))); break; case inSysWindow: //SystemClick(myEvent, whichWindow); break; case inDrag: if (ours(whichWindow)) { SetPortWindowPort(whichWindow); GetPort(&grafPort0); DragWindow(whichWindow, myEvent->where, 0); } break; case inGrow: //if (ours(whichWindow)) // {MyGrowWindow(whichWindow, myEvent->where);} break; case inContent: wasactive = (whichWindow == FrontWindow()); if(!wasactive) { SelectWindow(whichWindow); // if (ours(whichWindow) && MacReDraw ) (* MacReDraw)(); } else if (ours(whichWindow)) { SetPortWindowPort(whichWindow); GetPort(&grafPort0); while (Button()) ; return 0; } break; } return 1; } char HandleEvent(EventRecord & myEvent) { WindowPtr whichWindow=NULL; short windowPart; char char1=0; switch (myEvent.what) { case mouseDown: windowPart = FindWindow(myEvent.where, &whichWindow); if( DoMouseDown(windowPart, whichWindow, &myEvent) ==0) char1= 251; break; // // // case keyDown: case keyUp: case autoKey: { windowPart = FindWindow(myEvent.where, &whichWindow); if((whichWindow==grafWindow0) /* && (inContent == windowPart)*/) { if (grafWindow0 != FrontWindow()) { SelectWindow(whichWindow); SetPortWindowPort(whichWindow); GetPort(&grafPort0); } char1 = (myEvent.message & 127L); } break;} case updateEvt: if (ours((WindowPtr) myEvent.message)) { BeginUpdate((WindowPtr) myEvent.message); EndUpdate((WindowPtr) myEvent.message); } break; } return char1; } void viderbuff(){ QDFlushPortBuffer(grafPort0,0); } char Getijc(int & x,int & y) { char char1=0; showgraphic(); EventRecord myEvent; int flag=1; HLock( (Handle) WatchCurseur); SetCursor(*CrossCurseur); HUnlock( (Handle) WatchCurseur); SelectWindow(grafWindow0); while (char1==0) { if (GetNextEvent(everyEvent, &myEvent) /* ,OxFFFFFFFF,h)*/) char1=HandleEvent(myEvent); } GlobalToLocal( & myEvent.where); x = myEvent.where.h; y = myEvent.where.v; HLock( (Handle) WatchCurseur); SetCursor(*WatchCurseur); HUnlock( (Handle) WatchCurseur); // printf("\t\t x = %d y = %d c=%d\n", x,y,char1); return char1; } char Getxyc(float &x,float &y) { char c; int i,j; c = Getijc( i,j); x = scali(i); y = scalj(j); return c; } void rattente(int waitm) { int i,j; char c=0; if(waitm) c = Getijc( i,j); if ( c == 3) {cout << "rattente: ^c => abort " << endl;closegraphique();exit(1);}// ^c => exit /* you may prefer to use carriage return to move to the next graph */ /* getc(stdin); */ // if(waitm) while(!Button()){ }; } void GetSizeScreen(int & ix,int &iy); void GetScreenSize(int & ix,int &iy) { ix = width ; iy = height; } void openPS(const char *filename ) { char ffff[32]; int count=0; if(psfile_save) closePS(); time_t t_loc; float s=0.5; const int shiftx=50,shifty=50; // char username[10]; time(&t_loc); bool notfound; if( !filename) do { struct stat buf; sprintf(ffff,"rgraph_%.3d.ps",count++); volatile int r= stat(ffff,&buf) ; notfound = r !=0; if(count>1000) break; } while ( !notfound ); psfile=fopen(filename?filename:ffff,"w"); if(psfile==0) {printf("Erreur %s errno %d\d",filename?filename:ffff,errno);exit(1);} if(psfile) { fprintf(psfile,"%%!PS-Adobe-2.0 EPSF-2.0\n%%%%Creator: %s\n%%%%Title: FreeFem++\n","user"); fprintf(psfile,"%%%%CreationDate: %s",ctime(&t_loc)); fprintf(psfile,"%%%%Pages: 1\n"); fprintf(psfile,"%%%%BoundingBox: %d %d %d %d\n",shiftx,shifty,int(shiftx+width*s),int(shifty+height*s)); fprintf(psfile,"%%%%EndComments\n"); fprintf(psfile," /L { lineto currentpoint stroke newpath moveto} def\n"); fprintf(psfile," /M { moveto } def\n"); fprintf(psfile," /C {setrgbcolor} def\n"); fprintf(psfile," /rec {newpath 4 copy 8 1 roll moveto 3 -1 roll lineto 4 2 roll exch lineto lineto closepath} def\n"); fprintf(psfile," %d %d translate \n",shiftx,shifty); fprintf(psfile," %f %f scale \n",s,s); fprintf(psfile," 0 %d 0 %d rec clip newpath\n",int(width),int(height)); fprintf(psfile," /Helvetica findfont 10 scalefont setfont\n"); fprintf(psfile," /S { show} def\n"); fprintf(psfile," /bF { mark} def \n"); fprintf(psfile," /eF {newpath moveto counttomark 2 idiv {lineto} repeat closepath fill cleartomark} def\n"); fprintf(psfile," /P { /yy exch def /xx exch def xx xx 1 add yy yy 1 add rec fill } def\n"); fprintf(psfile," 1 setlinewidth\n"); psfile_save=psfile; } } void closePS(void) { if(psfile_save) { fprintf(psfile_save,"showpage\n"); fclose(psfile_save); } psfile=0; psfile_save=0; } void Commentaire(const char * c) { if(psfile) { fprintf(psfile,"%% %s\n",c); } }; void NoirEtBlanc(int NB) { if(NB) LastColor=1; else LastColor=ncolortable?ncolortable:2; } void MettreDansPostScript(int in) { if(in) psfile=psfile_save; else psfile=0; } static void FillRect(float x0,float y0, float x1, float y1) { float r[8]; r[0]=x0;r[1]=y0; r[2]=x1;r[3]=y0; r[4]=x1;r[5]=y1; r[6]=x0;r[7]=y1; fillpoly(4,r); } float GetHeigthFont() { FontInfo MyFontInfo; GetFontInfo(&MyFontInfo); int interligne = MyFontInfo.ascent + MyFontInfo.descent + MyFontInfo.leading; return interligne*0.7/echy; } int PutLevel(int lineno, float xf, int col) { float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); float xleft = xmax - (xmax-xmin)*0.1; float ytop = ymax; float ydelta = (ymax-ymin)/40; ydelta=GetHeigthFont(); xleft = xmax - 6*ydelta; ytop -= ydelta*(col+2); couleur(col); FillRect(xleft+ydelta/8.,ytop+ydelta/8.,xleft+ydelta*7./8.,ytop+ydelta*7./8.); rmoveto(xleft+ydelta*1.4,ytop+ydelta/4); char buf[30]; sprintf(buf,"%g",xf); couleur(1); plotstring(buf); return lineno; } void ShowHelp(const char * s,int k) { if(k) { MettreDansPostScript(0); couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); MettreDansPostScript(1); // couleur(1); } } void setgrey(bool gg ){grey=gg;} int getgrey(){ return grey;} class Grid; void SaveMesh(Grid &t){} void SavePlot(int D, Grid& t, double *f){} void SavePlot(int D, Grid& t, float *f){} freefem++-3.61-1/src/Graphics/Makefile.am000644 000767 000024 00000000475 13256636774 020214 0ustar00hechtstaff000000 000000 EXTRA_DIST=glrgraph.hpp macglrgraf.cpp \ macrgraf.cpp Pcrgraph.cpp rgraph.hpp \ sansrgraph.cpp xglrgraf.cpp Xrgraph.cpp DefColor.cpp \ getprog-unix.hpp mode_open.hpp ffglut.hpp ff-win32.cpp # FFCS: no compilation here, so the tags file must be built by hand tags:TAGS TAGS: etags *.?pp clean-local:: -rm TAGS freefem++-3.61-1/src/Graphics/gggg.cpp000644 000767 000024 00000007032 13256636774 017573 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include namespace ffapi { // void init) (); // need #include // need #include // need using namespace std; std::istream * (*cin)(); std::ostream *(*cout)(); std::ostream *(*cerr)(); // <> Cannot name these functions identically to the original file pointers under MingW32 (compile // error). Impacts [[file:InitFunct.hpp::LOADINITIO]]. Changed from stdxxx_ptr() to ffstdxxx() according to the way FF // itself was changed. FILE *(*ffstdout)(); FILE *(*ffstderr)(); FILE *(*ffstdin)(); /// Initiate graphical pipe output. I need a separate function for this to warn ffcs to check the corresponding ffglut /// magic number size_t (*fwriteinit)(const void *ptr, size_t size, size_t nmemb,FILE *stream); /// Indicates the begining of a new plot to avoid sending socket control data with each plot item. void (*newplot)(); /// Redefinition of standard system calls FILE *(*ff_popen)(const char *command, const char *type); int (*ff_pclose)(FILE *stream); size_t (*ff_fwrite)(const void *ptr, size_t size, size_t nmemb,FILE *stream); int (*ff_fflush)(FILE *stream); int (*ff_ferror)(FILE *stream); int (*ff_feof)(FILE *stream); // Windows file mode // ----------------- /// Changing file mode needs to be disabled when the file is a TCP socket to FFCS. Since the treatment is different in /// FF and in FFLANG executables, they have to be stored in a DLL that changes between these two programs. void (*wintextmode)(FILE *f); void (*winbinmode)(FILE *f); // Transfer basic MPI control // -------------------------- void (*mpi_init)(int &argc, char **& argv); void (*mpi_finalize)(); // Permanent server control // ------------------------ /// if true, FF is considered to be accessible from remote anonymous connections and some commands (like shell /// commands) are not allowed. bool (*protectedservermode)(); } #include "config-wrapper.h" #include #include #include #include #include "environment.hpp" #define FF_GRAPH_PTR_DCL #include "rgraph.hpp" void ShowDebugStack(){} long verbosity = 1; long searchMethod=0; // = 9999; //pichon //PROBABLY BUG : can't compile without it FILE *ThePlotStream=0; // Add for new plot. FH oct 2008 int TheCurrentLine=-1; // unset: by default long mpisize=0,mpirank=0; bool showCPU= false; long npichon2d=0, npichon3d=0; long npichon2d1=0, npichon3d1=0; // add F. Hecht EnvironmentData ffenvironment; freefem++-3.61-1/src/Graphics/ffthreads.hpp000644 000767 000024 00000003713 13256636774 020635 0ustar00hechtstaff000000 000000 // SUMMARY : Threads for Linux and Microsoft Win32 // USAGE : // ORG : // AUTHOR : Antoine Le Hyaric, Modif F. hecht // E-MAIL : lehyaric@ann.jussieu.fr // 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 // from: // Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 21/10/04 // simplify by F. Hecht // Antoine Le Hyaric - LJLL Paris 6 - hect@ann.jussieu.fr - 22/11/08 #ifndef FFTHREADS_HPP #define FFTHREADS_HPP #include "mode_open.hpp" #include using namespace std; #ifdef __MINGW32__ #include #else #include #endif // Just check that we are in a known environment (otherwise it may be // difficult to recognise that the simple cause is an ifdef problem). class Thread{ public: #ifdef __MINGW32__ #define THREADFUNC(f,parm) unsigned int (__stdcall f)(Thread::Parm parm) typedef LPVOID Parm; typedef HANDLE Id; #else #define THREADFUNC(f,parm) void* f(Thread::Parm parm) typedef void* Parm; typedef pthread_t Id; #endif // Mingw is a little puzzled if there are no brackets around // __stdcall static Id Start(THREADFUNC(f,),Parm p); static void Wait(Id tid); static void Exit(); // From inside the thread static void Kill(Id tid); static Id Current(); }; #endif // THREADS_HPP freefem++-3.61-1/src/Graphics/DefColor.cpp000644 000767 000024 00000005550 13256636774 020360 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include using namespace std; void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,int nbcolors,float *colors); void hsvToRgb (float h, float s, float v, float & r, float & g, float & b) { int i; float aa, bb, cc, f; if (s == 0) /* Grayscale */ r = g = b = v; else { h = h - floorf(h); h*=6.; i = int(h); f = h - i; aa = v * (1 - s); bb = v * (1 - (s * f)); cc = v * (1 - (s * (1 - f))); switch (i) { case 0: r = v; g = cc; b = aa; break; case 1: r = bb; g = v; b = aa; break; case 2: r = aa; g = v; b = cc; break; case 3: r = aa; g = bb; b = v; break; case 4: r = cc; g = aa; b = v; break; case 5: r = v; g = aa; b = bb; break; } } } // def des couleurs de la tables void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,int nbcolors,float *colors) { if(k<=0) { r=g=b=1.;} // white else if (k==1) { r=g=b=0.; } // black else if (k >= nb) { r=g=b=0.;} // black else if (grey) { float gg = 0.1+0.9*float(k-2)/(nb-3); r=g=b=gg;} else if (nbcolors<=1) { float h=float(k-2)/(nb-2),s=1.,v=1.; hsvToRgb(h,s,v,r,g,b); return;} else { // interpolation dans la table hsv int i= (k-2); int j0= i*(nbcolors-1) / (nb-2); int j1=j0+1; int i0= j0*(nb-2)/(nbcolors-1); int i1= j1*(nb-2)/(nbcolors-1); int j03=j0*3,j13=j1*3; float a=float(i1-i)/(i1-i0),a1=1-a; if (hsv) { float h = colors[j03+0]*a + colors[j13+0]*a1; float s = colors[j03+1]*a + colors[j13+1]*a1; float v = colors[j03+2]*a + colors[j13+2]*a1; hsvToRgb(h,s,v,r,g,b); } else { r = colors[j03+0]*a + colors[j13+0]*a1; g = colors[j03+1]*a + colors[j13+1]*a1; b = colors[j03+2]*a + colors[j13+2]*a1; } } } freefem++-3.61-1/src/Graphics/macglrgraf.cpp000644 000767 000024 00000001664 13256636774 020772 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // ORG : UPMC // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #define AGL 1 #define FF_GRAPH_SET_PTR #include "glrgraph.hpp" freefem++-3.61-1/src/Graphics/getprog-unix.hpp000644 000767 000024 00000023417 13256636774 021322 0ustar00hechtstaff000000 000000 #include "mode_open.hpp" #if _WIN32 #include "ff-win32.cpp" #else #include #endif // FFCS: required for chdir() when g++ 4.7 is used #include // FFCS: redirecting visualization output #include "ffapi.hpp" #include "strversionnumber.hpp" #include extern long mpirank; extern long verbosity; extern FILE *ThePlotStream; // Add for new plot. FH oct 2008 // for the environ variables ... extern const char * prognamearg; extern const char * edpfilenamearg; extern bool waitatend; extern bool consoleatend; extern bool echo_edp; extern bool NoGraphicWindow; char * Shell_Space(const char * s); char * Shell_Space(const char * s) { const char *c=s; int nbspace; int i; for( i=0;i<100000;++i) if (! s[i]) break; else if(isspace(s[i])) ++nbspace; if (!(i<100000)) { cerr << " Bug Shell_Space routine " <> called by [[file:../lglib/lg.ypp::getprog]] int getprog(char* fn,int argc, char **argv) { waitatend= 0; // init_lgparallele==0; // attent if no parallele consoleatend=false; // bug with redirection FH int ret=0; *fn='\0'; #ifdef _WIN32 const int lsuffix= 4; #else const int lsuffix= 0; #endif #ifdef PROG_FFGLUT const char * ffglut=PROG_FFGLUT; #else const char *ffglut= "ffglut"; #endif const char *progffglut=0; const char *fileglut=0; bool noffglut=true; // // FFCS - remove the test for noffglut to be able to create pictures // in any situation. Even FreeFem++-mpilang needs to send pictures // (eg when called in a FreeFem++-server situation by EJS) // is the name -nw or -nw.exe -> no graphics // if no ffglut do try to launch ffglut by default .. april 2017 (FH) #ifdef PROG_FFGLUT noffglut=false; NoGraphicWindow=false; #else noffglut=true; NoGraphicWindow=true; #endif ffapi::ff_ch2edpdtmpir = false; bool ch2edpdir = false; if(argc) prognamearg=argv[0]; if(prognamearg ) // FH add to remove ffglut in case of -nw or -nw.exe , mpi ,mpi.exp program FH juin 2014.., april 2017 {int l = strlen(prognamearg); if( (( l>4 ) && (strcmp("-nw",prognamearg+l-3) ==0)) || (( l>8) &&(strcmp("-nw.exe",prognamearg+l-7) ==0)) || (( l>5) &&(strcmp("-mpi",prognamearg+l-4) ==0)) // Correct april 2017 FH || (( l>9) &&(strcmp("-mpi.exe",prognamearg+l-8) ==0)) // Correct april 2017 FH ) { consoleatend=false; noffglut=true; NoGraphicWindow=true; waitatend=false; } } echo_edp=true; ffapi::ff_justcompile=false; if(argc) for (int i=1; i 3) cout << " ARGV "<< i << " " << argv[i] << " " << fn << endl; if (ret ==0 && strcmp(argv[i],"-f")==0 && i+1 < argc ) { strcpy(fn,argv[i+1]); i++; edpfilenamearg=argv[i]; ret=1; } else if (strcmp(argv[i],"-v")==0 && i+1 < argc) { verbosity = atoi(argv[i+1]); i++; if(verbosity>10) cout << " verbosity " <4) cout << " fn :" << fn << endl; } else if(ret==0) { strcpy(fn,argv[i]); edpfilenamearg=argv[i]; ret=1; if(verbosity>4) cout << " fn :" << fn << endl; } } if( ch2edpdir && edpfilenamearg) { int i=0; int l= strlen(edpfilenamearg); #ifdef _WIN32 const char sepdir='\\'; #else const char sepdir='/'; #endif for(i=l-1;i>=0;i--) if(edpfilenamearg[i]==sepdir) break; if(i>0) { char *dir= new char [l+1]; strcpy(dir,edpfilenamearg); dir[i]=0; int err=0; if(verbosity>1) cout << " chdir '" << dir <<"'"<< endl; // FFCS: mingw64 API change err=chdir(dir); //cout << err << endl; if(err) { cerr << " error : chdir " << dir << endl; exit(1); } delete [] dir; } } if( ! progffglut && !noffglut) progffglut=ffglut; if(progffglut && mpirank==0) { // FFCS: divert stream to FFCS ThePlotStream = ffapi::ff_popen(progffglut,"w"); // FFCS: just forget the following message because it could be understood as an error during FFCS execution // although ffglut is not used there. //if(verbosity) // printf(" EXEC of the plot : %s\n",progffglut); if(!ThePlotStream) { cerr << " Error popen "<< progffglut << endl;exit(1);} } else if (fileglut) {// correction progffglut -> fileglut v3.0-2 FH. ThePlotStream = fopen(fileglut, MODE_WRITE_BINARY ); if(verbosity) printf(" save of the plot in file : %s\n",fileglut); if(!ThePlotStream) { cerr << " Error save file glut " << fileglut << " mode " << MODE_WRITE_BINARY<< endl; exit(1); } } #ifdef _WIN32 if(ret==0) { if ( ShowOpenDialogBox1(fn) ) ret=1; } #endif if(ret !=1) { const char * ff = argc ? argv[0] : "FreeFem++" ; cout << " Error parameter: "<< ff << " , version : " << StrVersionNumber() << " " << sizeof(void*)*8 <<"bits "<< endl; cout << " Syntaxe = " << ff << " [ -v verbosity ] [ -fglut filepath ] [ -glut command ] [ -nw] [ -f] filename [SCRIPT-arguments]\n" << " -v verbosity : 0 -- 1000000 level of freefem output \n" << " -fglut filepath : the file name of save all plots (replot with ffglut command ) \n" << " -glut command : change command compatible with ffglut \n" << " -gff command : change command compatible with ffglut (with space quoting)\n" << " -nowait : nowait at the end on window \n" << " -wait : wait at the end on window \n" << " -nw or -ng : no ffglut, ffmedit (=> no graphics windows) \n" << " -wg : with graphic (=> graphics windows) \n" << " -ne : no edp script output\n" << " -cd : Change dir to script dir\n" << " -jc : just compile\n" << " -cdtmp : Change dir to tmp dir (for test)\n" << endl ; ; if(noffglut) cout << " without default ffglut : " << ffglut << endl; else cout << " with default ffglut : " << ffglut << endl; cout << endl; exit(1); return ret; } if(verbosity>10) cout << " file : " << fn << endl ; // cout << " verbosity= "<< verbosity << endl; return 1; } freefem++-3.61-1/src/Graphics/ffglut.cpp000644 000767 000024 00000230762 13256636774 020157 0ustar00hechtstaff000000 000000 #ifdef __APPLE__ #include #else #include #endif //#include #include #include #include #include #include using namespace std; #include #include #include #include #include #include #include #include #include #include "rgraph.hpp" #include "fem.hpp" #include "RNM.hpp" #include "Mesh2dn.hpp" #include "Mesh3dn.hpp" #include "PlotStream.hpp" extern long verbosity; // add for the gestion of the endianness of the file. //PlotStream::fBytes PlotStream::zott; //0123; //PlotStream::hBytes PlotStream::zottffss; //012345678; // ---- FH using namespace Fem2D; using std::numeric_limits; const R pi=M_PI;//4*atan(1.); using namespace std; static int nbSendForNextPlot=0,nbTimerNextPlot=0; int debug=1; int casemouse=0,keyact=0; double gwait=0;// no wait in second #include "ffglut.hpp" #include "ffthreads.hpp" int version =0; //Mutex MutexNextPlot; Thread::Id tidRead=0; bool NoMorePlot=false; bool NoMorePlotTilte=false; ThePlot *currentPlot=0, *nextPlot=0; bool inThreadRead=false; FILE *datafile=0; static bool TryNewPlot( void ); void LauchNextRead(); void WaitNextRead(); THREADFUNC(ThreadRead,fd); //void * ThreadRead(void *fd); int kread=-1; map AllWindows; map Num2Windows; int Fin(int code) { WaitNextRead(); if(!NoMorePlot && debug>2) cout << " exit before end " << endl; if(NoMorePlot && !code) exit(NoMorePlot ? 0 : 1); if(code) exit(NoMorePlot ? 0 : 1); return 0; } int ReadOnePlot(FILE *fp) { int err=0; if(!fp) return -4; err= feof(fp) ; if(err) return -2; err= ferror(fp) ; if(err) return -3; PlotStream f(fp); f.set_binary_mode(); const char * magic2="#!ffglutdata2.."; const char * magic3="#!ffglutdata3.."; const char * magic3_1="#!ffglutdata3.1"; const char * magic3_2="#!ffglutdata3.2"; /* change version 3.2 add colored curve */ const int lmagic=strlen(magic2); char magicxx[32]; err=0; // init .. if(kread==-1) { for(int i=0;i2) cout << " Err read magic heading " << endl; goto Lreturn; //return err; } kread++; if(debug>2) cout << " Read entete " << version << endl; int c1 =getc(fp);// if(c1==13) int c2 =getc(fp);// } long cas; f >> cas; err=-1; if (feof(fp)) goto Lreturn ; if((debug > 2)) cout << " ReadOnePlot " << kread+1<< " cas = " << cas << " " << nextPlot << endl; if(cas==PlotStream::dt_newplot) { assert(nextPlot==0); nextPlot = new ThePlot(f,currentPlot,++kread); if(debug>1) cout << "\n\n\n next is build " << nextPlot<< " wait :" << nextPlot->wait << " -> " << kread << " gwait = " << gwait << "\n\n\n"<1 && debug >2 ) cout << " ###### Warning more than 1 nbTimerNextPlot" << nbTimerNextPlot << endl; value=min(1000,(value*3)/2);// try at leat every 1 second (not to heavy computation) if(TryNewPlot()) { if(debug >9) cout << " #### TimerNextPlot TryNewPlot:: glutPostRedisplay "<< nbTimerNextPlot << " " << nbSendForNextPlot <9) cout << " #### TimerNextPlot wait "<< nbTimerNextPlot << " " << nbSendForNextPlot<0 && debug >2 ) cout << " ###### Warning more than 1 SendForNextPlot" << nbSendForNextPlot+1 << endl; if(nbSendForNextPlot) return 0; // nbSendForNextPlot++; // to send a event to plot the date sheet. // and out a timer to wait to the end of read.. // every 25/ second.. = 1000/25 = 40 ms if(NoMorePlot) { if(gwait ) {usleep((useconds_t)(1e6*gwait)); Fin(0); } if((debug > 1)) cout << " send signal For Next plot, skip: No More Plot ! " << endl; nbSendForNextPlot--; return 0; } if((debug > 1)) cout << " Try to read read plot "<< endl; // put a timer for wait to the end of read glutTimerFunc(40,TimerNextPlot,40); return 1; } static bool TryNewPlot( void ); int signep4(int i0,int i1,int i2,int i3) { // calcul du signe dans la permutation int s =1; if(i0>i1) s=-s,Exchange(i0,i1); if(i1>i2) s=-s,Exchange(i1,i2); if(i2>i3) s=-s,Exchange(i2,i3); // i3 max if(i0>i1) s=-s,Exchange(i0,i1); if(i1>i2) s=-s,Exchange(i1,i2); // i2 max < i if(i0>i1) s=-s,Exchange(i0,i1); return s; } inline R3 bary(const R3 K[4],R f[4],int i0,int i1,R v) { R d=f[i0]-f[i1]; assert(fabs(d)>1e-20); R l1= (f[i0] - v)/ d; // == 1 si v = f[i1] R l0 = 1. -l1; assert(l0 >=-1e-10 && l1 >= -1e-10); return K[i0]*l0 + K[i1]*l1; // == K[i1] si l1 ==1 => v = f[i1] } void drawisoTet(const R3 K[4],R f[4],R v) { static const int nvfaceTet[4][3] ={{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}} ;//{ {2,1,3},{0,2,3},{1,0,3},{0,1,2} }; R3 P[4]; int nP=0; int np[4],nm[4]; int km=0,kp=0; for (int i=0;i<4;++i) { if(f[i]<=v) nm[km++]=i; if(f[i]>=v) np[kp++]=i; } //cout << "km kp "<< km << " " << kp << endl; int h=-1,b[3]; if(kp==1 && km==3) { h = np[0]; b[0]=nvfaceTet[h][0]; b[1]=nvfaceTet[h][1]; b[2]=nvfaceTet[h][2]; } if(km==1 && kp == 3) { h = nm[0]; b[0]=nvfaceTet[h][0]; b[2]=nvfaceTet[h][1]; b[1]=nvfaceTet[h][2]; } if(kp==2 && km==2) {// cas quad if(signep4(nm[0],nm[1],np[0],np[1]) < 0) Exchange(nm[0],nm[1]); // le tet m[0],nm[1],np[0],np[1] est positif P[0]=bary(K,f,nm[0],np[0],v); P[1]=bary(K,f,nm[0],np[1],v); P[2]=bary(K,f,nm[1],np[1],v); P[3]=bary(K,f,nm[1],np[0],v); nP=4; } else if (h>=0) { // cas triangle P[0]=bary(K,f,h,b[0],v); P[1]=bary(K,f,h,b[1],v); P[2]=bary(K,f,h,b[2],v); nP=3; } /* if(nP) { cout << "+ " << np[0] << " - " << nm[0] << endl; cout << nP << " ; "; for(int i=0;i2) { R3 N(R3(P[0],P[1])^R3(P[0],P[2])); N /= N.norme(); glNormal3d(N.x,N.y,N.z); } glBegin(GL_POLYGON); for(int i=0;i=0) ; // assert(nP < 3 || det(P[0],P[1],P[2],K[nm[0]]) <=0) ; } int dichotomie(const KN_ &viso,R v) { int i=0,j=viso.N(),k; if (v viso[j-1]) return -1; while (i v) j=k; else i=k; return i; } int ShowGlerror(const char *s) { GLint error = glGetError(); if ( error != GL_NO_ERROR ) printf("Attention %s erreur : %x \n",s,error); return error; } // def des couleurs de la tables void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,KN colors) { int nbcolors = colors.N()/3; if(k<=0) { r=g=b=1.;} // white else if (k==1) { r=g=b=0.; } // black else if (k >= nb) { r=g=b=0.;} // black else if (grey) { float gg = 0.1+0.9*float(k-2)/(nb-3); r=g=b=gg;} else if (nbcolors<=1) { float h=float(k-2)/(nb-2),s=1.,v=1.; hsvToRgb(h,s,v,r,g,b); return;} else { // interpolation dans la table hsv int i= (k-2); int j0= i*(nbcolors-1) / (nb-2); int j1=j0+1; int i0= j0*(nb-2)/(nbcolors-1); int i1= j1*(nb-2)/(nbcolors-1); int j03=j0*3,j13=j1*3; float a=float(i1-i)/(i1-i0),a1=1-a; if (hsv) { float h = colors[j03+0]*a + colors[j13+0]*a1; float s = colors[j03+1]*a + colors[j13+1]*a1; float v = colors[j03+2]*a + colors[j13+2]*a1; hsvToRgb(h,s,v,r,g,b); } else { r = colors[j03+0]*a + colors[j13+0]*a1; g = colors[j03+1]*a + colors[j13+1]*a1; b = colors[j03+2]*a + colors[j13+2]*a1; } } } template void Plot(const Mesh & Th,bool fill,bool plotmesh,bool plotborder,ThePlot & plot,GLint gllists,int * lok) { glDisable(GL_DEPTH_TEST); ShowGlerror("begin Mesh plot"); glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); R z1= plot.z0; R z2= plot.z0; double r=0,g=0,b=0; if((debug > 3)) cout<< " OnePlotMesh::Draw " << plotmesh << " " << plotborder << " " << Th.nbBrdElmts() << " " << z1 << " " << z2 << endl; // plot.SetColorTable(16) ; bool cc[3]= { plotborder , plotmesh && fill , plotmesh }; int kk=0; //for(int i=0;i<3;i++) // cout << cc[i] << " " << lok[i] << " , "; //cout << endl; if(cc[kk]) if(lok[kk]) glCallList(gllists+kk); else { lok[kk]=1; glNewList(gllists+kk,GL_COMPILE_AND_EXECUTE ); // save la list sans affichage glLineWidth(2); glBegin(GL_LINES); for (int i=0;itheplot; win->SetScreenView() ; glColor3d(0.,0.,0.); cout << " Error plot item empty " << item << endl; int i = 4; char s[100]; sprintf(s,"Warning the item %ld fot the plot is empty",item); win->Show(s,4+item*2); win->SetView() ; } template void OnePlotMesh::Draw(OneWindow *win) { initlist(); ThePlot & plot=*win->theplot; Plot(*Th,plot.fill,true,true,plot,gllists,oklist); ShowGlerror("OnePlotMesh::Draw"); } void OnePlotMesh3::Draw(OneWindow *win) { initlist(); ThePlot & plot=*win->theplot; Plot(*Th,plot.fill,true,true,plot,gllists,oklist); ShowGlerror("OnePlotMesh3::Draw"); } void OnePlotFE3::Draw(OneWindow *win) { initlist(); ThePlot & plot=*win->theplot; ShowGlerror("begin OnePlotFE3 plot"); /// plot.SetDefIsoV(); if(plot.fill && what%10==6) glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); else glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); bool change=false; if( (what%10==6) ) { change = win->changeiso ; } if(what%10==6) glEnable(GL_DEPTH_TEST); else glEnable(GL_DEPTH_TEST); win->setLighting(); if(oklist[0] && !change) glCallList(gllists+0); else { oklist[0]=1; glNewList(gllists+0,GL_COMPILE_AND_EXECUTE); // save la list sans affichage int nsubV=Psub.N(); int nsubT=Ksub.N()/4; KN Pn(nsubV); int nK=v.N()/ Th->nt; for(int k=0,o=0;knt;++k, o+= nK) { const Mesh3::Element & K=(*Th)[k]; int ii[4];// R ff[4]; R3 Pt[4]; for(int i=0;iunsetLighting(); ShowGlerror("b mesh OnePlotFE plot"); Plot(*Th,false,plot.drawmeshes,plot.drawborder,plot,gllists+2,&oklist[2]); ShowGlerror("OnePlotFE::Draw"); } template OnePlotFE::OnePlotFE(const Mesh *T,long w,PlotStream & f) :OnePlot(w,2,5),Th(T) { R2 P0,P1; Th->BoundingBox(P0,P1); Pmin=P0; Pmax=P1; if(version==2) { long nsub; f>> nsub; int nsubT=NbOfSubTriangle(nsub); int nsubV=NbOfSubInternalVertices(nsub); Psub.resize(nsubV); Ksub.resize(nsubT*3); for(int i=0,j=0;i> Psub ; f >> Ksub ; if(debug>2) { cout << " Psub " << Psub << endl; cout << " Ksub " << Ksub << endl;} } if(what<10) f>> v; else { f>> vc; vc2v(); } cas =2; vc2v(); if(debug>3) cout << "OnePlotFE" << Th <<" " << what<< " " << Psub.N() << " " << Ksub.N()/3 <<" " << v.N() << endl; ffassert(f.good()); } template bool OnePlotFE::vc2v() { bool ret=false; if(what>=10) { ret=true; int n = vc.N(); if(v.size() !=n) v.resize(n); for(int i=0;i=10) { ret=true; int n = vc.N(); if(v.size() !=n) v.resize(n); for(int i=0;isetLighting(); // OneWindow * win=plot.win;// bof bof la struct est tres mauvaise . assert(win); const Mesh & Th(*this->Th); int nsubT= Ksub.N()/3;//NbOfSubTriangle(nsub); int nsubV=Psub.N();//NbOfSubInternalVertices(nsub); int nK=v.N()/ Th.nt; if(debug>4) cout << "\t\t\tOnePlotMesh::Draw " <getcadre(xmin,xmax,ymin,ymax); double d= Max(ymax-ymin,xmax-xmin); R kk = 4*win->hpixel; if(plot.ArrowSize>0) kk=win->hpixel*max(win->width*plot.ArrowSize/100.,1.); R cc = win->hpixel*40; int klist=0; bool change=false; if( (what%10==1) ) { if ( plot.fill) klist=1; change = win->changeiso ; } else if (what%10==2) change = win->changearrow ; if(debug>9) cout << change << " " << klist << " ... " << oklist[klist] << " fill = " << plot.fill << " " << coef << endl; if (oklist[klist] && ! change ) glCallList(gllists+klist); else { // R fmn,fmx,vmn,vmx; // win->theplot->dyn_bfv(win,fmn,fmx,vmn,vmx) ; //win->theplot->SetDefIsoV(0,0,fmn,fmx,vmn,vmx) ; oklist[klist]=1; glNewList(gllists+klist,GL_COMPILE_AND_EXECUTE); // save la list aevc affichage if(debug>100) cout << win->Bmin << ", Bmax: " << win->Bmax << " Viso: "<< plot.Viso << endl; for(int k=0;k100) cout << uv << " l= " << l << " " << coef << " " < cc) uv = uv*(cc/l); glBegin(GL_LINES); win->Seg(P,P+uv); if (10*l>kk) { win->Seg(P+uv,P+uv+dd+dn); win->Seg(P+uv,P+uv+dd-dn); } glEnd(); } } glEndList(); // fin de la list } // if(plot.drawmeshes) // if(what==2) // glEnable(GL_DEPTH_TEST); ShowGlerror("b mesh OnePlotFE plot"); win->unsetLighting(); Plot(Th,false,plot.drawmeshes,plot.drawborder,plot,gllists+2,&oklist[2]); ShowGlerror("OnePlotFE::Draw"); } template void OnePlotFE::dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn2,R & vmx2) const { const Mesh & Th(*this->Th); int nsubT= Ksub.N()/3;//NbOfSubTriangle(nsub); int nsubV=Psub.N();//NbOfSubInternalVertices(nsub); int nK=v.N()/ Th.nt; ffassert(v.N()== Th.nt*nK); ffassert(nK == nsubV*(what%10)); int o=0; KN Pn(Psub.N()); KN P3(Psub.N()); double xmin,xmax,ymin,ymax; KN inCadre(nsubV); win->getcadre(xmin,xmax,ymin,ymax); bool ccc=false; bool ddd=false; if(ddd) cout << " dyn__ .. " << endl; for(int k=0;kmodelMatrix,win->projMatrix,win->viewport, &P3[i].x,&P3[i].y,&P3[i].z); if(ddd) cout <InRecScreen(P0,P1)) { if(debug>100) cout << " ??? " << P0 << " " << P1 << " , " << win->Bmin << " , " << win->Bmax << endl; inCadre[i1]=2; inCadre[i2]=2; inCadre[i3]=2; } } for (int i=0,j=0;i100 && ccc) cout << " dny_bfv : " << fmn << " " << fmx << " " << sqrt(vmn2) << " " << sqrt(vmx2) << " : " << Pn[0] << endl; } } OnePlotCurve::OnePlotCurve(PlotStream & f,int nfield,ThePlot *theplot) :OnePlot(3,2,1) { f >> xx>>yy; if( nfield >=3) f >> zz; if( nfield ==4) f >> cc; // cout << xx << " " << yy <withiso=true; } } if( cc.N() ) { fmax = Max(fmax,cc.max()); fmin = Min(fmin,cc.min()); theplot->withiso=true; } if(debug>3) cout << " OnePlotCurve nbfield "<< nfield << " max, N= " << xx.max() << " " << xx.N() << ", " << yy.max() << " " << yy.N() << " "<< zz.N() << " " << cc.N() << " f " << fmin << " " << fmax << endl;; } void OnePlotCurve::dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn2,R & vmx2) const { if( cc.N() == xx.N()) { 0; // afaire ???? } } void OnePlotCurve::Draw(OneWindow *win) { initlist(); ThePlot & plot= *win->theplot; // correct of color bug thank to Jon Sauer // if( cc.N() != xx.N()) // plot.SetColorTable(16) ; // else // plot.SetColorTable(Max(plot.Niso,plot.Narrow)+4) ; // end of correct !!!! FH nov 2016 double z = plot.z0; if(debug>3) cout << " OnePlotCurve::Draw " << (cc.N() != xx.N()) << endl; glBegin(GL_LINE_STRIP); plot.color(2); // cout << "nePlotCurve::Draw " << xx << " " << yy << endl; if( (zz.N()!=xx.N()) && (cc.N()==0) ) for (int i=0;iplot.Viso.N()) col=plot.Viso.N(); plot.color(col); glVertex3d(xx[i],yy[i],zz[i]); } glEnd(); } void OnePlotBorder::Draw(OneWindow *win) { initlist(); glDisable(GL_DEPTH_TEST); ThePlot & plot= *win->theplot; R h = 8*win->hpixel; double z = plot.z0; plot.SetColorTable(16) ; // vector > > data; for(int i=0;i > & v=data[i]; ShowGlerror("end OnePlotBorder::Draw 1"); for(int j=1;jSeg(Po,Pn); glEnd(); glLineWidth(1); glBegin(GL_LINES); if(j!=1) { win->Seg(Po,Po+dd+dn); win->Seg(Po,Po+dd-dn); } glEnd(); } ShowGlerror("end OnePlotBorder::Draw 2"); glPointSize(7); glBegin(GL_POINTS); int l= v.size()-1; plot.color(2+v[0].first); glVertex3d(v[0].second.x,v[0].second.y,z); plot.color(2+v[l].first); glVertex3d(v[l].second.x,v[l].second.y,z); glEnd(); glPointSize(1); ShowGlerror("end OnePlotBorder::Draw 3"); } ShowGlerror("end OnePlotBorder::Draw"); } OneWindow::OneWindow(int h,int w,ThePlot *p) : icurrentPlot(lplots.begin()), lplotssize(0), height(h),width(w),theplot(0),hpixel(1), Bmin(0,0),Bmax(1,1),oBmin(Bmin),oBmax(Bmax),zmin(0),zmax(1), windowdump(false),help(false), rapz0(-1.),rapz(1),withlight(false), changearrow(true),changeiso(true), keepPV(false),init(false) { add(p); } void OneWindow::set(ThePlot *p) { //ffassert(p); bool first = !theplot; bool change = theplot != p; theplot=p; if(p) { plotdim=p->plotdim; rapz0 = p->ZScale; } if(!init) { rapz0 =-1; if(p) rapz0 = p->ZScale; // to recompute the defalut rapz // p->win=this; // if(first) DefaultView(2) ; } } void OneWindow::add(ThePlot *p) { if(p) { lplots.push_back(p); lplotssize++; ++icurrentPlot; if(icurrentPlot==lplots.end()) --icurrentPlot;// the previous if(icurrentPlot != lplots.end()) set(*icurrentPlot); if( lplotssize>10) { bool isfirst = theplot == *lplots.begin(); if(debug >1) cout << " delete a plot " << *lplots.begin() << endl; delete *lplots.begin(); lplots.erase(lplots.begin()); lplotssize--; if(isfirst) set(*lplots.begin()); // change to the next plot } } else set(p); } void OneWindow::DefaultView(int state) { if(debug>1) cout << "DefaultView " << state << " " <ZScale>0) rapz0=theplot->ZScale; else rapz0=-1; } if(theplot) { init =1; plotdim=theplot->plotdim; R3 A(theplot->Pmin),B(theplot->Pmax); R3 D(A,B); R dxy= max(D.x,D.y); zmax = theplot->fmax; zmin = theplot->fmin; theta=theplot->theta; phi=theplot->phi; if(theplot->ZScale>0) rapz0=theplot->ZScale; if(theplot->datadim==3) rapz0=1; else if(rapz0<=0) { // ( zmax-zmin )*rapz0 = 0.3 dxyy rapz0 = 0.4* dxy/(zmax-zmin) ; if(debug>2) { cout << " rapz0 = " << rapz0 ; cout << " dz = " << zmax-zmin << " dxy =" << dxy << endl; } } rapz=rapz0; coef_dist=theplot->dcoef; focal=theplot->focal; if(theplot->datadim==3) { Bmin3=A; Bmax3=B; } else { // data plot 2d ou 1 d... if(theplot->boundingbox.size() ==4) { Bmin3.x=theplot->boundingbox[0]; Bmin3.y=theplot->boundingbox[1]; Bmax3.x=theplot->boundingbox[2]; Bmax3.y=theplot->boundingbox[3]; } else { Bmin3.x=A.x; Bmin3.y=A.y; Bmax3.x=B.x; Bmax3.y=B.y; } Bmin3.z=theplot->fmin; Bmax3.z=theplot->fmax; } Pvue3=(Bmin3+Bmax3)/2; D *=0.05; if(theplot->boundingbox.size() !=4) { A -= D; B += D; } else { R x1=theplot->boundingbox[0],y1=theplot->boundingbox[1]; R x2=theplot->boundingbox[2],y2=theplot->boundingbox[3]; A = R2(min(x1,x2),min(y1,y2)); B = R2(max(x1,x2),max(y1,y2)); } if (theplot->aspectratio) cadreortho(A.p2(),B.p2()); else cadre(A.p2(),B.p2()); } hpixel = (Bmax.x-Bmin.x)/width; // SetView() ; } void OneWindow::SetScreenView() const { glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,width,0,height,-1,1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void OneWindow::SetView() { if(plotdim==3 && theplot) { glViewport(0, 0,width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); R ratio= (double) width / (double) height; glMatrixMode(GL_MODELVIEW); glLoadIdentity(); R aspect=ratio; R3 DD(Bmin3,Bmax3); DD.z *= rapz; R dmax= DD.norme();; R dist = 0.5*dmax/sin(focal/2)*coef_dist; cam.x=Pvue3.x+cos(phi)*cos(theta)*dist; cam.y=Pvue3.y+cos(phi)*sin(theta)*dist; cam.z=Pvue3.z*rapz+dist*sin(phi); R znear=max(dist-dmax,1e-30); R zfare=dist+dmax; gluPerspective(focal*180./M_PI,aspect,znear,zfare); /* if (eye) { R dmm = -dmax*ceyes; R dx = -dmm*sin(theta); R dy = dmm*cos(theta); camx += dx*eye; camy += dy*eye; } */ if(debug>2) { cout <<" setview 3d: rapz " << rapz << " cam: "; cout << cam << " Pvue:" ; cout << Pvue3 << " theta " << theta << " phi = "<< phi << endl; } gluLookAt(cam.x,cam.y,cam.z,Pvue3.x,Pvue3.y,Pvue3.z*rapz,0.,0.,1.); glScaled(1.,1.,rapz); glGetDoublev(GL_PROJECTION_MATRIX,projMatrix); ShowGlerror(" Get PM"); glGetDoublev(GL_MODELVIEW_MATRIX,modelMatrix); ShowGlerror(" Get MV"); glGetIntegerv(GL_VIEWPORT,viewport); ShowGlerror(" Get VP"); } else { ShowGlerror("Begin SetView"); glDisable(GL_DEPTH_TEST); glViewport(0, 0,width, height); R dz0,dz1,zm=0; if(plotdim==3) { dz0=Bmin3.z; dz1=Bmax3.z; } else { R zzmin = Min(zmin,theplot->fminT); R zzmax = Max(zmax,theplot->fmaxT); R dz = (zzmax-zzmin); zm=(zzmin+zzmax)*0.5; // to be sur the the z size is no zero . dz = max(dz,(Bmax.x-Bmin.x)*0.1); dz = max(dz,(Bmax.y-Bmin.y)*0.1); dz0=-dz; dz1 = dz; } if((debug>3 )) cout << "\t\t\t SetView " << this << " " << Bmin << " " << Bmax << " dz " << dz0 << " " << dz1 << " theta " << theta << " phi = "<< phi << endl; ShowGlerror("0 Set MV"); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); ShowGlerror(" Set MV"); glMatrixMode(GL_PROJECTION); glLoadIdentity(); ShowGlerror(" Set PM 1"); glOrtho(Bmin.x,Bmax.x,Bmin.y,Bmax.y,dz0,dz1); ShowGlerror(" Set PM 2"); R2 M=(Bmin+Bmax)/2.; glTranslated(0,0,-zm); //glLineWidth(1); //glColor3d(0.,0.,0.); glGetDoublev(GL_PROJECTION_MATRIX,projMatrix); ShowGlerror(" Get PM"); glGetDoublev(GL_MODELVIEW_MATRIX,modelMatrix); ShowGlerror(" Get MV"); glGetIntegerv(GL_VIEWPORT,viewport); ShowGlerror(" Get VP"); ShowGlerror("End SetView "); } } void OneWindow::resize(int w,int h) { double ww=width,hh=height; width=w; height=h; if (theplot && theplot->aspectratio) { cadreortho(oBmin,oBmax); } } void OneWindow::zoom(R coef) { coef_dist*=coef; R2 M=(oBmin+oBmax)/2.; R2 D=(oBmax-oBmin)/2.; R2 A= M - D*coef; R2 B= M + D*coef; if (theplot->aspectratio) cadreortho(A,B); else cadre(A,B); } void OneWindow::zoom(int w,int h,R coef) { GLdouble x=w,y=height-h,z=(zmin+zmax)/2.; GLdouble xx,yy,zz; GLint ok= gluUnProject( x,y,z,modelMatrix,projMatrix,viewport,&xx,&yy,&zz); ShowGlerror(" UnPro .. "); if(debug>2) cout << " ok " << ok << " " << x << " " << y << " " << z << " -> " << xx << " " << yy << " " << zz << endl; R2 oD(oBmin,oBmax); R2 D(Bmin,Bmax); R2 O(xx,yy);// oBmin.x+D.x*xx/width,oBmin.y+D.y*yy/height); if((debug > 3)) cout<< " zoom : " << this << " O " << O << " " << coef << " D = "<< D<< "as " << theplot->aspectratio << endl; oD *= 0.5*coef; R2 A = O - oD; R2 B = O + oD; if (theplot->aspectratio) cadreortho(A,B); else cadre(A,B); } void OneWindow::MoveXView(R dx,R dy) { R3 D(Bmin3,Bmax3); R3 dd( dx*D.x*sin(theta),-dx*D.y*cos(theta), - dy*D.z); if(debug>2) cout << " MoveXView "<< dx << " " << dy << " " << D << " mn: " << Bmin3 <<" mx :" << Bmax3 << " d=" << dd << endl; Pvue3 += dd/50.; // 2d ... add FH july 2009 R2 D2(-dx*5*hpixel,-dy*5*hpixel); oBmin += D2; oBmax += D2; Bmin += D2; Bmax += D2; // cout << xm << " " << ym << " " << zm << endl; } void OneWindow::cadre(R2 A,R2 B) { oBmin=Bmin=A; oBmax=Bmax=B; hpixel = (Bmax.x-Bmin.x)/width; } void OneWindow::getcadre(double &xmin,double &xmax,double &ymin,double &ymax) { xmin = Bmin.x; xmax = Bmax.x; ymin = Bmin.y; ymax = Bmax.y; } void OneWindow::Display() { if(!theplot) return; ffassert(this && theplot); SetScreenView() ; glColor3d(0.,0.,0.); if(help) { theplot->DrawHelp(this); help=false; } else { ShowGlerror("Begin Display"); // SetView(); if(theplot) theplot->Draw(this); ShowGlerror("After Display"); } } void OneWindow::cadreortho(R2 A, R2 B) { R2 D(A,B); oBmin=A; oBmax=B; double cxy = D.y*width/ (D.x*height); if ( D.y*width < D.x*height) // width -> infty => D.x la ref D.y = D.x*(double) height/ width; else // height -> infty => D.y la ref D.x = D.y*(double) width/height; R2 M=(A+B)/2., D2=D/2.; Bmin= M - D2; Bmax= M + D2; hpixel = (Bmax.x-Bmin.x)/width; if((debug > 10)) cout << " cadreortho: "<< " :: " << Bmin << " " << Bmax <<" oB " << oBmin << " " << oBmax << endl; // if((debug > 10)) cout << "cadreortho\n"; } void OneWindow::setLighting() { if(withlight) { if(plotdim==3) { GLfloat lp0[4] = { (float) cam.x,(float) cam.y, (float) cam.z, 1.0F }; glLightfv(GL_LIGHT0,GL_POSITION,lp0); if(debug>1) cout << " Light pos 3d: " << cam << endl; } else { GLfloat position[] = {(float) Pvue3.x,(float) Pvue3.y,(float) (Pvue3.z+(Bmax3.z-Bmin3.z)*3),1.f} ; glLightfv(GL_LIGHT0, GL_POSITION, position); } float cca=0.3,ccd=1., ccs=0.8; GLfloat ambient[] = {cca,cca,cca,1.0f};//diffrents paramtres GLfloat diffuse[] = {ccd,ccd,ccd,1.0f}; GLfloat specular_reflexion[] = {ccs,ccs,ccs,1.0f}; GLubyte shiny_obj = 128; glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,1); glEnable(GL_LIGHTING);//positionnement de la lumire avec glLightfv(GL_LIGHT0,GL_AMBIENT,ambient);//les diffrents paramtres glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse); glEnable(GL_COLOR_MATERIAL);//spcification de la rflexion sur les matriaux glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE); glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,ambient); glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,diffuse); // glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,specular_reflexion);// on peut le faire avant chaque objet //glMateriali(GL_FRONT_AND_BACK,GL_SHININESS,shiny_obj);//si on veut qu'ils aient des caractristiques # glShadeModel(GL_FLAT); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); } else { glDisable(GL_LIGHTING); glDisable(GL_LIGHT0); } } void OneWindow::unsetLighting() { glDisable(GL_LIGHTING); glDisable(GL_LIGHT0); //g->lightning=false; } OnePlotBorder::OnePlotBorder(PlotStream & f) :OnePlot(4,2,1) { long nbd; f>> nbd; data.resize(nbd); for(int i=0;i> n; //cout << n << endl; data[i].resize(n+1); for(int j=0;j<=n;++j) { long l; double x,y; f >> l>> x >> y; // cout << x << ' ' << y << ' ' << l << endl; R2 P(x,y); Pmin=Minc(Pmin,P); Pmax=Maxc(Pmax,P); data[i][j]=make_pair(l,P); } } ffassert(f.good()); } void OnePlot::GLDraw(OneWindow *win) { ThePlot & plot= *win->theplot; Draw(win); win->changeiso=0; win->changearrow=0; } void ThePlot::DrawHelp(OneWindow *win) { int i = 1; win->Show("Enter a keyboard character in the FreeFem Graphics window in order to:",i++); i+=1; win->Show("enter) wait next plot",i++); win->Show("p) previous plot (10 plots saved) ",i++); win->Show("ESC) exit from ffglut (if termined) ",i++); win->Show("^c) non-ignorable exit from ffglut ",i++); win->Show("?) show this help window",i++); win->Show("+) -) zoom in/out around the cursor 3/2 times ",i++); win->Show("=) reset vue ",i++); win->Show("r) refresh plot ",i++); win->Show("up, down, left, right) special keys to tanslate ",i++); win->Show("3) switch 3d/2d plot (in test) keys : ",i++); win->Show(" z) Z) (focal zoom unzoom) ",i++); win->Show(" H) h) switch increase or decrease the Z scale of the plot ",i++); win->Show("mouse motion) ",i++); win->Show(" - left button) rotate ",i++); win->Show(" - right button) zoom (ctrl+button on mac) ",i++); win->Show(" - right button +alt) tanslate (alt+ctrl+button on mac)",i++); win->Show("a) A) increase or decrease the arrow size",i++); win->Show("B) switch between show border meshes or not",i++); win->Show("i) I) update or not: the min/max bound of the functions to the window",i++); win->Show("n) N) decrease or increase the number of iso value array ",i++); win->Show("b) switch between black and white or color plotting ",i++); win->Show("g) switch between grey or color plotting ",i++); win->Show("f) switch between filling iso or iso line ",i++); win->Show("l) switch between lighting or not ",i++); win->Show("v) switch between show or not the numerical value of colors ",i++); win->Show("m) switch between show or not meshes ",i++); win->Show("w) window dump in file ffglutXXXX.ppm ",i++); win->Show("*) keep/unkeep viewpoint for next plot",i++); win->Show("k) complex data / change view type ",i++); win->Show("any other key : nothing ",++i); } void ThePlot::dyn_bfv(OneWindow *win,R & fmn,R &fmx,R & vmn2,R & vmx2) const { fmn=+1e100; fmx=-fmn; vmx2=0; vmn2=fmin; for (list::const_iterator i= plots.begin();i != plots.end(); ++i) { if(*i) (*i)->dyn_bfv(win,fmn,fmx,vmn2,vmx2) ; } if(debug>4) cout << "dyn_bfv " << fmn << " " << fmx << endl; if(fmn>fmx) fmn=fmin,fmx=fmax; if(vmn2>vmx2) vmn2=0,vmx2=vmax2; } bool ThePlot::NextCase() { bool ret=false; for (list::iterator i= plots.begin();i != plots.end(); ++i) ret = (**i).NextCase() || ret; // alway run NextCase .. return ret; } void ThePlot::Draw(OneWindow *win) { if((debug>1 )) { cout << " ThePlot::Plot " << count << " " << this << " win " << win << " " << state ; for (list::iterator i= plots.begin();i != plots.end(); ++i) cout << (**i).what; cout << endl; } if(state==0) { state=1; win->DefaultView(0); } win->SetView(); for (list::iterator i= plots.begin();i != plots.end(); ++i) (*i)->Draw(win); if(cm || value) { // screen plot ... win->SetScreenView(); if(cm) { color(1); win->DrawCommentaire(cm->c_str(),0.1,0.97); } if(value) { int k0=0; if(withiso) { win->PlotValue(Viso,k0,"IsoValue"); k0=1+Viso.N(); } if(witharrow) win->PlotValue(Varrow,k0,"Vec Value"); } // for picking.. win->SetView(); } changeViso=false; changeVarrow=false; changeColor=false; changeBorder=false; changeFill=false; } void ThePlot::SetColorTable(int nb) { tbc.resize(nb); for (int i=0;igrey; } greyo=grey; drawborder=true; drawmeshes=false; add=false; keepPV=false; echelle=1.; Pmin=R3(+dinfty,+dinfty,+dinfty); fmin = +dinfty; fmax = -dinfty; Pmax=R3(-dinfty,-dinfty,-dinfty); vmax2=0; coefr=1; long dimpp=0; long cas; #define READ_VTK_PARAM(index,type) \ case 20+index: {type dummy; fin >= dummy;} break; while(1) { fin >> cas; if((debug > 4)) cout << " read cas: " << cas << " " << PlotStream::dt_endarg << endl; if(cas==PlotStream::dt_endarg) break; if(version==2) switch (cas) { case 0: fin >> coeff; break; case 1: fin >> cm; break; case 2: fin >> psfile; break; case 3: fin >> wait; break; case 4: fin >> fill; break; case 5: fin >> value; break; case 6: fin >> clean; break; case 7: fin >> aspectratio;uaspectratio=true; break; case 8: fin >> boundingbox; break; case 9: fin >> Niso; break; case 10: fin >> Narrow; break; case 11: fin >> Viso;Niso=Viso.N();pViso=true; break; case 12: fin >> Varrow;Narrow=Varrow.N();pVarrow=true; break; case 13: fin >> bw; break; case 14: fin >> grey; break; case 15: fin >> colors; break; case 16: fin >> drawborder; break; case 17: fin >> dimpp; break;// ajout fevr 2008 v3.0.6 case 18: fin >> add; break; case 19: fin >> keepPV; break; case 20: fin >> echelle;break; default: cout << "Fatal error: Unknow case : " << cas <= coeff; break; case 1: fin >= cm; break; case 2: fin >= psfile; break; case 3: fin >= wait; break; case 4: fin >= fill; break; case 5: fin >= value; break; case 6: fin >= clean; break; case 7: fin >= aspectratio;uaspectratio=true; break; case 8: fin >= boundingbox; break; case 9: fin >= Niso; break; case 10: fin >= Narrow; break; case 11: fin >= Viso;Niso=Viso.N();pViso=true; break; case 12: fin >= Varrow;Narrow=Varrow.N();pVarrow=true; break; case 13: fin >= bw; break; case 14: fin >= grey; break; case 15: fin >= colors; break; case 16: fin >= drawborder; break; case 17: fin >= dimpp; break;// ajout fevr 2008 v3.0.6 case 18: fin >= add; break; case 19: fin >= keepPV; break; case 20: fin >= echelle;break; case 21: fin >= ZScale;break; // unsed parameter ... //READ_VTK_PARAM(1,double); // ZScale READ_VTK_PARAM(2,bool); // WhiteBackground READ_VTK_PARAM(3,bool); // OpaqueBorders READ_VTK_PARAM(4,bool); // BorderAsMesh READ_VTK_PARAM(5,bool); // ShowMeshes READ_VTK_PARAM(6,long); // ColorScheme READ_VTK_PARAM(7,long); // ArrowShape // READ_VTK_PARAM(8,double); // ArrowSize case 28: fin >= ArrowSize; break; READ_VTK_PARAM(9,long); // ComplexDisplay READ_VTK_PARAM(10,bool); // LabelColors READ_VTK_PARAM(11,bool); // ShowAxes READ_VTK_PARAM(12,bool); // CutPlane READ_VTK_PARAM(13,KN); // CameraPosition READ_VTK_PARAM(14,KN); // CameraFocalPoint READ_VTK_PARAM(15,KN); // CameraViewUp READ_VTK_PARAM(16,double); // CameraViewAngle READ_VTK_PARAM(17,KN); // CameraClippingRange READ_VTK_PARAM(18,KN); // CutPlaneOrigin READ_VTK_PARAM(19,KN); // CutPlaneNormal // SEND_VTK_PARAM(20,long); // WindowIndex case 40: fin >= winnum; break; default: static int nccc=0; if(nccc++<5) cout << " Skip Unknow case " << cas <<" (ffglut is too old ?)\n"; fin.SkipData(); break; } else ffassert(0); ffassert(fin.good() && ! fin.eof()); } if(dimpp) plotdim=dimpp; // if( !uaspectratio) aspectratio= true; ffassert(cas==PlotStream::dt_endarg); if((debug > 2)) { cout << " ***** get ::: "; cout << " Window num " << winnum << ", "; cout << " coeff " << coeff <<", "; if(cm) cout << " cm " << *cm <<", "; if(wait) cout << " wait " ; if(fill) cout << " fill " ; if(value) cout << " value " ; if(bw) cout << " bw " ; if(grey) cout << " grey " ; if(drawborder) cout << " drawborder " ; if(colors.N()) cout << "\n colors =" << colors; if(boundingbox.N()) cout << "\n bb =" << boundingbox; cout << endl; } fin.GetMeshes(); long nbmeshes; fin >> nbmeshes; if((debug > 2)) cout << " read nb : mesh " << nbmeshes << endl; if(version==2) { Ths.resize(nbmeshes); for(int i=0;i> l; if(l>=0) { if((debug > 3)) cout << " read mesh " << i << " -> " << l << " " <=0 && l < nbmeshes); if(version==2) { ffassert(Ths[l]==0); fin >>Ths[l] ; } else { ffassert(Ths2[l]==0); fin >>Ths2[l] ; } if((debug > 3)) { if(version==2) cout << i << " nt/nv " << l << " " <nt << " " << Ths[l]->nv << endl; else cout << i << " nt/nv " << l << " " <nt << " " << Ths2[l]->nv << endl; } ffassert(fin.good()); } else // Add FH optimisation FH 11/12/2008 (not use to day) {// the mesh is already in the previous plot with number ll ffassert(l==-1); long ll; fin >> l>> ll; // read l and ll ffassert(old); if(version==2) { Ths[l]=old->Ths[ll]; Ths[l]->increment(); // } else { Ths2[l]=old->Ths2[ll]; Ths2[l]->increment(); // } } } long nbmeshes3=0; if(fin.GetMeshes3()) // read GetPlots if false ... { // il y a des solution 3d; fin >> nbmeshes3; if((debug > 2)) cout << " read nb : mesh3 " << nbmeshes3 << endl; Ths3.resize(nbmeshes3); for(int i=0;i> l; if(l>=0) { if((debug > 3)) cout << " read mesh3 " << i << " -> " << l << " " <=0 && l < nbmeshes3); ffassert(Ths3[l]==0); fin >>Ths3[l] ; if((debug > 3)) cout << i << " nt/nv " << l << " " <nt << " " << Ths3[l]->nv << endl; ffassert(fin.good()); } else // Add FH optimisation FH 11/12/2008 (not use to day) {// the mesh is already in the previous plot with number ll ffassert(l==-1); long ll; fin >> l>> ll; // read l and ll ffassert(old); Ths3[l]=old->Ths3[ll]; Ths3[l]->increment(); // } } fin.GetPlots(); } long nbplot; int iso3d=0; fin >>nbplot; if((debug > 2)) cout << " nb item plot " << nbplot << endl; for(int i=0;i> what; long imsh; if((what !=3 && what != 13 )&& !uaspectratio) aspectratio= true; if((debug > 2)) cout << " plot " << i << " what " << what << " as : " << aspectratio << endl; if(what==-1) // gestion of error (empty plot) p = new OnePlotError(fin); else if(what==0) { fin >> imsh; if(version==2) p=new OnePlotMesh(Ths[imsh-1]); else p=new OnePlotMesh(Ths2[imsh-1]); } else if (what==1 || what==2 || what==11 || what==12 ) { fin >> imsh; if(what%10==1) withiso=true; else if (what%10==2) witharrow=true; if((debug >= 10)) cout << " plot : mesh " << imsh << endl; ffassert(imsh>0 && imsh <=nbmeshes); if(version==2) p=new OnePlotFE(Ths[imsh-1],what,fin); else p=new OnePlotFE(Ths2[imsh-1],what,fin); } else if(what==3) p=new OnePlotCurve(fin); else if(what==13) p=new OnePlotCurve(fin,4,this);// add zz and color .. else if(what==4) p=new OnePlotBorder(fin); else if(what==5) { fin >> imsh; p=new OnePlotMesh3(Ths3[imsh-1]); } else if (what==6 || what==7|| what==16 || what==17) { iso3d++; fin >> imsh; if(what==6||what==16 ) withiso=true; if((debug > 10)) cout << " plot : mesh3 " << imsh << endl; ffassert(imsh>0 && imsh <=nbmeshes3); p=new OnePlotFE3(Ths3[imsh-1],what,fin); } else { cout << "Bizarre unkown what : " << what<< endl; ffassert(0); } ffassert(p); plots.push_back(p); p->bb(Pmin,Pmax); p->bfv(fmin,fmax,vmax2); plotdim=max(plotdim,p->dim); ffassert(fin.good()); datadim=max(datadim,p->dim); } if(Niso==0) Niso = iso3d ? 5 : 20; // cout << "\t\t\t\t f min, max v max :" << fmin << " " << fmax << " " << vmax2 << endl; double ref_f = abs(fmax)+abs(fmin) ; if(fmax < fmin) { fmax = 1; fmin = 0; } else if( (fmax-fmin) <= 1e-8*ref_f) { if(ref_f< 1e-20) ref_f=0.5; fmax += ref_f/2; fmin -= ref_f/2; } PminT=Pmin; PmaxT=Pmax; fminT=fmin; fmaxT=fmax; if(old && 0) { Pmin= Minc(Pmin,old->PminT); Pmax= Maxc(Pmax,old->PmaxT); fmax= Max(fmax,old->fmaxT); fmin= Min(fmin,old->fminT); } z0= fminT +(fmaxT-fminT)*0.01; if((debug > 2)) cout << " data bound: " << PminT << " " << PmaxT << " fmin == " << fminT << " " << fmaxT << " z0 " << z0 << endl; fin.GetEndPlot(); Viso.resize(Niso); Varrow.resize(Narrow); SetColorTable(Max(Niso,Narrow)+4) ; SetDefIsoV(Niso,Narrow,fmin,fmax) ; //SetDefIsoV(ni,na,fmn,fmx,vmn,vmx) } void ThePlot::SetDefIsoV(int niso,int narr,double fmn,double fmx,double vmn,double vmx) { bool dyn=false; R d,x; if(debug>3 && !(fmx>fmn) ) cout << " SetDefIsoV (not) " << endl; if( fmx>fmn) { if(debug>3) cout << " SetDefIsoV " << fmn << " " << fmx << "pViso= " << pViso << endl; dyn = niso !=Viso.N() ; pViso = pViso && niso ==Viso.N(); if(niso>2) Viso.resize(niso); Niso=Viso.N(); Narrow=narr; d = (fmx-fmn)/(Niso-2) ; x = (fmn+fmx)/2-d*0.5*(Niso-1); // dyn=true; } else { d = 1 ? (fmaxT-fminT)/(Niso-2) : (fmaxT-fminT)/(Niso-1); x = 1 ? (fminT+fmaxT)/2-d*0.5*(Niso-1) :fminT+d/2; } if(!pViso || dyn) { for (int i = 0;i < Niso;i++) {Viso[i]=x;x +=d; } //if (fill ) {Viso[0]=fminT-d;Viso[Niso-1]=fmaxT+d;} } dyn=false; if(vmx>vmn) { if(narr>2) Varrow.resize(niso); Narrow=Varrow.N(); dyn=true; x = sqrt(vmn); d = (sqrt(vmx)-x)/(Narrow-1.1); } else { x=0; if(debug>10) cout << "vmax2= " << vmax2 << endl; d= sqrt(vmax2)/(Narrow-1.1); } if (!pVarrow || dyn) for (int i = 0;i < Narrow;i++) { Varrow[i]=x; x +=d; } if(debug>100) cout << " Viso ..; " << Viso < 10)) cout << "FR Rp: " << x0 << " " << y0 << " " << x1 << " " << y1 << endl; glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);//GL_FILL glBegin(GL_POLYGON); glVertex2d(x0, y0); glVertex2d(x1, y0); glVertex2d(x1, y1); glVertex2d(x0, y1); glEnd(); } void OneWindow::FillRect(R x0,R y0,R x1,R y1) { double z1= (zmin+zmax)/2; // line glPolygonMode(GL_FRONT,GL_FILL);//GL_FILL glBegin(GL_POLYGON); glVertex3d(x0, y0,z1); glVertex3d(x1, y0,z1); glVertex3d(x1, y1,z1); glVertex3d(x0, y1,z1); glEnd(); } void OneWindow::PlotValue(const KN_ & Viso,int k0,const char * cmm) { ShowGlerror("PlotValue b"); // glRasterPos2f(x,y); if((debug > 10)) cout << "PlotValue:" << cmm << " " << k0 << " " << width << " " < 10)) cout << "PlotValue " << Viso << endl; // int ix,iy; // GetSizeScreen(ix,iy); R dx=(xmax-xmin); R dy=(ymax-ymin); // 10 points // int kk = Max(30,iy/10); R h=10; R ho=h*1.1; R x0=xmin+dx*0.85; R y= ymin+dy*0.97; if((debug > 10)) cout << x0 << " " << y << " " << h << endl; y -= k0* ho; this->color(0); FillRectRasterPos(x0-h*0.5,y-h*(1.4*Viso.N()+0.3),x0+h*9,y+h*1.5); ShowGlerror("PlotValue m"); this->color(1); plot(x0+ho,y,cmm); y -= ho; for (int i=0;i 10)) cout << " x0 : " << x0<< " " << y << " " << h << " v = " << Viso[i] << endl; this->color(i+4); FillRectRasterPos(x0,y,x0+h,y+h); plot(x0+ho,y+3*h/10,Viso[i]); y -= ho; ; } ShowGlerror("PlotValue f"); } void OneWindow::DrawCommentaire(const char * cm,R x,R y) { R xmin=0,xmax=height,ymin=0,ymax=height; float dx=(xmax-xmin); float dy=(ymax-ymin); plot(xmin+dx*x,ymin+dy*y,cm); } /* void drwstr(R x,R y,char* format, ...) { va_list args; char *s,buffer[1024]; va_start(args,format); vsnprintf(buffer,1024,format,args); va_end(args); } */ void plot(double xx,double yy,const char *cmm,int font) { glRasterPos2f(xx,yy); float x[4]; glGetFloatv(GL_CURRENT_RASTER_POSITION,x); if((debug > 10)) cout<<"avant x : "< 10)) cout << *s ; glutBitmapCharacter(glut_font,*s); } if((debug > 10)) cout << " ;;; " <=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)<=0.1e-10) /* one side must be drawn */ { color(l+4); glVertex3f(Pt[i].x, Pt[i].y,xf*rapz); glVertex3f(Pt[j].x, Pt[j].y,xf*rapz); //MoveTo(Pt[i]); //LineTo(Pt[j]); } else { R xlam=(fi-xf)/(fi-fj); PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } } if (im>=2) /* draw one segment */ { color(l+4); //MoveTo(PQ[0]); //LineTo(PQ[1]); if( R2(PQ[0],PQ[1]).norme2() > eps2 ) { glVertex3f(PQ[0].x, PQ[0].y,xf*rapz); glVertex3f(PQ[1].x, PQ[1].y,xf*rapz); } } } glEnd(); } void ThePlot::DrawIsoTfill(const R2 Pt[3],const R ff[3],const R * Viso,int NbIso, R rapz) { R2 PQ[10]; R z[10]; R eps= (Viso[NbIso-1]-Viso[0])*1e-6; for(int l=1;l< NbIso;l++) // loop on the level curves { R xfb = Viso[l-1]; R xfh = Viso[l]; assert(xfb < xfh); int im=0; for(int i=0;i<3;i++) // for the 3 edges { int j=(i+1)%3; R fi=(ff[i]); R fj=(ff[j]); R xxfb = xfb; R xxfh = xfh; if (fj=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); z[im] = ff[i] * (1.F-xlam) + ff[j]* xlam; PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } xf = xxfh; if(((fi<=xf)&&(fj>=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); z[im] = ff[i] * (1.F-xlam) + ff[j]* xlam; PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } if ( xfb-eps <=fj && fj <= xfh+eps) z[im]=ff[j],PQ[im++] = Pt[j]; } if (im>2) { color(l+4); R3 P[10]; for(int i=0;i 10)) cout << i << " \t : " << PQ[i].x << " " << PQ[i].y << " " << z[i]*rapz << endl; glVertex3f(P[i].x, P[i].y,P[i].z); } glEnd(); } } } bool WindowDump(int width,int height) { int i,j; FILE *fptr; static int counter = 0; char fname[32]; unsigned char *image; /* Allocate our buffer for the image */ if ((image = new unsigned char[3*width*height]) == NULL) { fprintf(stderr,"WindowDump - Failed to allocate memory for image\n"); return(false); } /* Open the file */ sprintf(fname,"ffglut_%04d.ppm",counter); if ((fptr = fopen(fname, MODE_WRITE_BINARY)) == NULL) { fprintf(stderr,"WindowDump - Failed to open file for window dump\n"); return(false); } if((debug > 10)) cout << " WindowDump in " << fname << endl; /* Copy the image into our buffer */ glReadBuffer(GL_FRONT); glReadPixels(0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,image); /* Write the PPM file */ fprintf(fptr,"P6\n%d %d\n255\n",width,height); for (j=height-1;j>=0;j--) { for (i=0;iresize(width,height); glutPostRedisplay(); } void Display(void) { OneWindow * win=CurrentWin(); if(win) { if(debug>9) { cout << "\n\n Display "<< win->theplot << " true wiat: " << (!win->theplot || !win->theplot->wait || gwait) << endl; } /* if (win->stereo) { ffassert(0); glClearColor(1.0, 1.0, 1.0, 0.0); glDrawBuffer(GL_BACK_RIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); global->SetView(-1); glCallList(TheDrawList); glClearColor(1.0, 1.0, 1.0, 0.0); glDrawBuffer(GL_BACK_LEFT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); global->SetView(+1); glCallList(TheDrawList); //win->Display(); glFlush(); glutSwapBuffers(); } else */ { Clean(); win->Display(); glFlush(); glutSwapBuffers(); if ( win->windowdump) WindowDump(win->width,win->height); win->windowdump=false; } } if(debug>9) { cout << " Send SendForNextPlot : win->theplot " << win->theplot << " " << (!win->theplot || !win->theplot->wait || gwait);; if(win->theplot) cout << " wait" << win->theplot->wait << endl; cout <<"\n\n\n"<< endl; } if(!win->theplot || !win->theplot->wait || gwait ) SendForNextPlot(); if(!NoMorePlotTilte &&NoMorePlot) { NoMorePlotTilte=true; glutSetWindowTitle("FreeFem++ / Program ended; enter ESC to exit)"); // if(gwait) {usleep((useconds_t)(1e6*gwait)); Fin(0); } } } static void Mouse( int button,int state,int x,int y ) { // state up or down OneWindow * win=CurrentWin(); keyact = glutGetModifiers(); switch(button) { case GLUT_LEFT_BUTTON: casemouse=GLUT_LEFT_BUTTON; if(win) { if(win && state == GLUT_DOWN) { win->xold=x,win->yold=y;return;} win->phi += (y-win->yold)/(2.*180.); win->theta -= (x-win->xold)/(2*180.); glutPostRedisplay(); } break; case GLUT_RIGHT_BUTTON: casemouse=GLUT_RIGHT_BUTTON; if(win) { if(win && state == GLUT_DOWN) { win->xold=x,win->yold=y;return;} } break; } } static void MotionMouse(int x,int y ) { OneWindow * win=CurrentWin(); switch(casemouse) { case GLUT_LEFT_BUTTON: if(win) { win->phi += (y-win->yold)/(2.*180.); win->theta -= (x-win->xold)/(2*180.); win->xold=x; win->yold=y; glutPostRedisplay(); } break; case GLUT_RIGHT_BUTTON: casemouse=GLUT_RIGHT_BUTTON; if(win) { if(keyact & GLUT_ACTIVE_ALT) { int dx = (x-win->xold); int dy = (y-win->yold); win->MoveXView(dx,-dy); glutPostRedisplay(); { win->xold=x,win->yold=y;} } else { // zoom en y R dd= (y-win->yold); { win->xold=x,win->yold=y;} win->zoom(pow(0.99,dd)); glutPostRedisplay(); } } break; } } static void Key( unsigned char key, int x, int y ) { OneWindow * win=CurrentWin(); if(!win->theplot)return; if(debug>1) cout << "Key winnum: " <theplot->winnum << endl; int ni=win->theplot->Viso.N(); int na=win->theplot->Varrow.N(); switch (key) { case 27: // esc char Fin(0); break; case 3: // esc char Fin(9); break; case 'w': if(win) win->windowdump=true; break; case 'l': win->withlight = !win->withlight; break; case '?' : if(win) win->help=true; case '+': win->zoom(x,y,0.7); win->coef_dist /= 1.2; break; case '-': win->zoom(x,y,1./0.7); win->coef_dist *= 1.2; break; case '3': win->plotdim=win->plotdim==2?3:2; break; /* case '2': win->plotdim=2; break; */ case '=': win->DefaultView(1); break; case 'f': win->theplot->fill = ! win->theplot->fill ; break; case '@': win->dtheta = win->dtheta ? 0 : pi/1800.; break; case '*': // add FH mars 2013 .. win->keepPV = ! win->keepPV; break; case 'k': if(win->theplot->NextCase()) { R fmn,fmx,vmn,vmx; win->theplot->dyn_bfv(win,fmn,fmx,vmn,vmx) ; win->theplot->SetDefIsoV(ni,na,fmn,fmx,vmn,vmx) ; win->changeiso=true; win->changearrow=true; } break; case 'b': win->theplot->grey = ! win->theplot->grey ; win->changeiso=true; win->changearrow=true; break; case 'g': win->theplot->grey = ! win->theplot->grey ; win->changeiso=true; win->changearrow=true; break; case 'v': win->theplot->value = ! win->theplot->value ; break; case 'm': win->theplot->drawmeshes = ! win->theplot->drawmeshes ; break; case 'B': win->theplot->drawborder = ! win->theplot->drawborder ; break; case 'H': win->rapz *= 1.2; break; case 'h': win->rapz /= 1.2; break; case 'p': if(win->icurrentPlot != win->lplots.begin()) win->set(*--win->icurrentPlot); break; case 'a': win->theplot->coeff/= 1.2; win->changearrow=true; break; case 'A': win->theplot->coeff*= 1.2; win->changearrow=true; break; case 'n': { na -= na < 10 ? 2 : 5; ni -= ni <10 ? 2 : 5; na = max(na,2); ni = max(ni,2); R fmn,fmx,vmn,vmx; win->theplot->dyn_bfv(win,fmn,fmx,vmn,vmx) ; win->theplot->SetDefIsoV(ni,na,fmn,fmx,vmn,vmx) ; win->changeiso=true; win->changearrow=true; } break ; case 'N': { na += na < 10 ? 2 : 5; ni += ni < 10 ? 2 : 5; } case 'i': { R fmn,fmx,vmn,vmx; win->theplot->dyn_bfv(win,fmn,fmx,vmn,vmx) ; win->theplot->SetDefIsoV(ni,na,fmn,fmx,vmn,vmx) ; win->changeiso=true; win->changearrow=true; } break; case 'I': { R fmn,fmx,vmn,vmx; win->theplot->SetDefIsoV(ni,na) ; win->changeiso=true; win->changearrow=true; } break; case 'z': if(win->focal < M_PI/1.2 ) { win->coef_dist*=sin(win->focal*1.2/2)/sin(win->focal/2); win->focal *=1.2; } break; case 'Z': if(win->focal > 1e-5) { win->coef_dist*=sin(win->focal/1.2/2)/sin(win->focal/2); win->focal /=1.2; } break; case '\r': case '\n': { list::iterator ic = win->icurrentPlot; if(++ic == win->lplots.end()) // last plot -> try new one SendForNextPlot(); else win->set(*++win->icurrentPlot); break; } default: if((debug > 10)) cout << " Key Character " << (int) key << " " << key << endl; } glutPostRedisplay(); } void SpecialKey(int key, int x, int y) { OneWindow * win=CurrentWin(); if(win) { // if((debug > 10)) cout << " SpecialKey " << key << " " << x << " " << y << " : "; R dx(0),dy(0); switch (key) { case GLUT_KEY_LEFT: dx = -1; break; case GLUT_KEY_RIGHT: dx = +1; break; case GLUT_KEY_DOWN: dy = -1; break; case GLUT_KEY_UP: dy = +1; break; } // calcul du deplacement de xm,ym,zm; // if((debug > 10)) cout << " " << dx << " " << dy << endl; win->MoveXView(dx,dy); glutPostRedisplay(); } } void LauchNextRead() { if(!NoMorePlot) { inThreadRead=true; tidRead = Thread::Start(&ThreadRead,(void *) datafile); } } void WaitNextRead() { if( inThreadRead ) { assert(tidRead!=0); Thread::Wait(tidRead); tidRead =0; inThreadRead=false;; } } //void * ThreadRead(void *fd) THREADFUNC(ThreadRead,fd) { int err=0; assert(nextPlot==0); // MutexNextPlot.WAIT(); if(gwait) usleep((useconds_t) (gwait*1.e6) ); err=ReadOnePlot((FILE*)fd); // MutexNextPlot.Free(); if(debug>1) cout << " We Read a plot : " << kread << " " << nextPlot << " " << err << endl; if(err<0) { NoMorePlot=true; } Thread::Exit(); return 0; } static bool TryNewPlot( void ) { // the routine to try to see if the next plot is read or not. // ----------------------------------------------------------- bool ret=false; if(debug>2) cout << " TryNewPlot plot : " << currentPlot << " next = " << nextPlot << endl;; if (nextPlot!=0) { WaitNextRead(); int iwnp= nextPlot-> winnum; if(debug>1) cout << " change current plot to: " << nextPlot << " et Lock Plot . winnum " << iwnp << endl;; //cout << " winnum: " << iwnp << endl; if(Num2Windows[iwnp]==0) { ostringstream titre; titre << "W "<< iwnp << " /FreeFem++: type return key to proceed (or ? for help on other)"; int Height = 512; int Width = 512*3/2; glutInitWindowSize(Width , Height); glutInitWindowPosition(100+iwnp*50, 100+iwnp*50); int iw0=glutCreateWindow(titre.str().c_str()); if(debug>1) cout << " ** glutCreateWindow " << iw0 << endl; glDisable(GL_DEPTH_TEST); glutReshapeFunc( Reshape ); // pour changement de fenetre glutKeyboardFunc( Key ); // pour les evenements clavier glutSpecialFunc(SpecialKey); glutMouseFunc(Mouse); // pour les evenements sourie glutMotionFunc(MotionMouse); // les mouvements de la sourie glutDisplayFunc( Display ); // l'affichage glutPushWindow(); glutShowWindow(); AllWindows[iw0]= new OneWindow(Width , Height,nextPlot); Num2Windows[iwnp]=iw0; } else AllWindows[Num2Windows[iwnp]]->add(nextPlot); glutSetWindow(Num2Windows[iwnp]); //if(currentPlot) delete currentPlot; // a change fait dans add // MutexNextPlot.WAIT(); currentPlot=nextPlot; nextPlot=0; // MutexNextPlot.Free(); LauchNextRead(); ret=true; } if(gwait && NoMorePlot ) {usleep((useconds_t)(1e6*gwait)); Fin(0); } return ret; } const char * Index(const char * p, const char c) { int k=0; while(k++<1000000) if(!*p) return 0; else if( *p==c) return p; else ++p; return 0; } const char * rIndex(const char * p, const char c) { int k=0; const char *pp=0; while(k++<1000000) if(!*p) break; else if( *p==c) pp= p; else ++p; return pp; } void SetDefWin(const char *p,int & iii0,int & jjj0,int & Width,int &Height) { // syntax // 1024x1024+100+100 // or // 1024x1024 const char *bx = p; const char *by = Index(p,'x'); const char *ox = Index(p,'+'); const char *oy = rIndex(p,'+'); if(by ==0) return; Width= atoi(bx); Height= atoi(by+1); if(ox && (ox != oy)) { iii0= atoi(ox+1); jjj0=atoi(oy+1); } if(debug>1) cout << " position = "<< Width << "x" << Height << "+"<< iii0 << "+" << jjj0 << endl; assert(Width >0 && Width < 3000); assert(Height >0 && Height < 3000); assert(iii0 >0 && iii0 < 3000); assert(jjj0 >0 && jjj0 < 3000); } int main(int argc, char** argv) { ffapi::init(); glutInit(&argc, argv); bool stereo=false; bool fullscreen = false; if(stereo) glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STEREO); else glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); int i1=1; int Height = 512,Width = 512*3/2, iii0=100,jjj0=100; string titre = "W0/FreeFem++: type return key to proceed (or ? for help on other)"; int eerr=0; if(argc>1) { if( (i1 < argc) &&strcmp(argv[i1],"-?")==0) i1++,eerr=-1; if (i1 < argc) { if( strcmp(argv[i1],"-nv")==0) i1++,debug=0; else if( strcmp(argv[i1],"-v")==0) i1++,debug=2,verbosity=2; else if( strcmp(argv[i1],"-vv")==0) i1++,debug=5,verbosity=2; else if( strcmp(argv[i1],"-vvv")==0) i1++,debug=10, verbosity=1000; else if( strcmp(argv[i1],"-vvvv")==0) i1++,debug=99999, verbosity=1000; else if( strcmp(argv[i1],"-0")==0) return 0; // do nothing } if( (i1+1 < argc) && (strcmp(argv[i1],"-wait")==0)) { i1++; gwait=atof(argv[i1++]); } if( (i1+1 < argc) && (strcmp(argv[i1],"-g")==0)) { i1++; SetDefWin(argv[i1++], iii0,jjj0,Width,Height); } if( (i1+1 < argc) && (strcmp(argv[i1],"-t")==0)) { i1++; titre = argv[i1++]; } if( (i1 - argc > 1) ) { eerr = 1; cout << " error ming args " << i1 - argc << endl; } } datafile =0; if(debug>1) cout << "ffglut : " << (argc>i1) << eerr << endl; if(argc>i1 && (eerr==0))// && *argv[argc-1] != '-' ) { datafile=fopen(argv[argc-1], "r"); if(debug >1) cout << " fopen :" << argv[argc-1] << " " <1) cout << " mode read = " << MODE_READ_BINARY << endl; if(datafile==0) datafile=stdin; if ( !datafile){ cerr<< " Erreur fdopen stdin in binary " << endl; Fin(1); } int err=ReadOnePlot(datafile); if(err) { //cout << "Err ReadOnePlot " << err << endl; Fin(1);} if(kread==0) { //cout << " Error: no graphic data " << endl; Fin(1); } if(debug>1) cout << "on a lue le premier plot next plot: " << nextPlot << endl; glutInitWindowSize(Width , Height); glutInitWindowPosition(iii0,jjj0); int iw0=glutCreateWindow(titre.c_str()); //glutPushWindow(); // if (fullscreen) // glutFullScreen(); Num2Windows[0]=iw0; glDisable(GL_DEPTH_TEST); glutReshapeFunc( Reshape ); // pour changement de fenetre glutKeyboardFunc( Key ); // pour les evenements clavier glutSpecialFunc(SpecialKey); glutMouseFunc(Mouse); // pour les evenements sourie glutMotionFunc(MotionMouse); // les mouvements de la sourie glutDisplayFunc( Display ); // l'affichage glutSetWindow(iw0); AllWindows[iw0]=new OneWindow(Width , Height,currentPlot); TryNewPlot(); //cout << " Window " << iw0 << endl; glutMainLoop(); return 0; } freefem++-3.61-1/src/Graphics/Pcrgraph.cpp000644 000767 000024 00000113640 13256636774 020431 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : D. Bernardi, Y. Darmaillac F. Hecht, */ /* O. Pironneau, K.Ohtsuka */ // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #define PCRGRAPH_CPP #define FF_GRAPH_SET_PTR #include #define TOSTRING1(i) #i #define TOSTRING(i) TOSTRING1(i) #include #include ///#include #include #include #include #include #include #include #include using namespace std; //#include "vect.h" #include "error.hpp" #include "strversionnumber.hpp" //#include /* ** Windows includes */ #include #include ///#include #include #include #include #include //*OT use for the console window ///#include const char * edpfilenamearg=0; bool waitatend=true; bool consoleatend=true; #define fill thequikdrawfill #include "rgraph.hpp" //char *Version = "1.2.7"; void out_of_memory (); void NEW_HANDLER (void); void myexit(int); void compile(char *fname); float scali(int i); float scalj(int j); //int pStrCopy (StringPtr p1, StringPtr p2); int execute(char* what); //int DoMouseDown (int windowPart, WindowPtr whichWindow, EventRecord *myEvent); char Getijc(int & x,int & y); void postexit(); static int cube6[7][3] ={ {255,0,0},{255,255,0},{0,255,0}, {0,255,255},{0,0,255}, {255,0,255},{255,0,0} }; static int grey6[2][3] ={ {255,255,255},{0,0,0} }; static bool grey=false; static int ncolortable=0; static int LastColor=2; // LastColor=1 => Noir et Blanc >2 =>couleur typedef struct rgb { BYTE r; // red component of color BYTE g; // green component of color BYTE b; // blue component of color } rgb; static rgb * colortable=0; static HPEN* hpen=0; static HBRUSH* hbr=0; static HFONT hFont=0; static int fontH = 0; // The height of font static int cstatic=1; int getcolor(); void putpixel(int ix,int iy, int couleur); int scalx(float x); int scaly(float y); void compile (char *); void NEW_HANDLER (void){ set_new_handler (&out_of_memory);} #define ours(w) (w==grafWindow0) template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} char errbuf[255]; static int INITGRAPH=0; float rayon; static int width,height; static FILE *psfile = 0; static FILE *psfile_save = 0; static float aspx, aspy, echx,echy,ech,rxmin,rxmax,rymin,rymax; static int currx, curry; static int carre; static HWND hWnd; static WNDCLASS rClass; static HDC hdc; static HANDLE hConOut=0; const float fMinPixel = -32000; // to avoid int overflot const float fMaxPixel = 32000; /* Function definitions */ BOOL Init(HINSTANCE, HINSTANCE, LPSTR, int); int DoMain(HINSTANCE hInstance); LONG WINAPI OpenWindowProc1(HWND, UINT, WPARAM, LPARAM); int getcolor(); void putpixel(int ix,int iy, int couleur); int scalx(float x); int scaly(float y); void rattente (int); BOOL inittext(VOID); BOOL ShowOpenDialogBox(char *fileName); BOOL CreateProjetFile(char *fileName); char *ChangePdeToExt(char *fileName,char *ext); BOOL mainFreeFEM(); int GetFileName(char *fullname, char *shortname); DWORD GetOption(char lpszCmdLine[]); void SetConsole(HANDLE hConsole); FILE *GetConsoleHandle(DWORD Dev); BOOL GetConsoleBuff(); BOOL EditLog(); //void SaveMesh(Grid& t); //void SavePlot(int D,Grid& t, Real *f); BOOL FatalErr(char *s, int err); //BOOL CheckSameTrig(Grid& t); //*OT flag for FreeFEM+/WinfFEM #define winf_VFFEM 1 #define winf_NOWAIT 2 #define winf_NOCOLOR 4 #define winf_NOEDIT 8 #define winf_Usage 1024 unsigned int winf_flg = 0; // end char FreeFemCache[256]="\0", shortName[256]="\0", fullName[256]="\0"; void fillpoly(int n, float *poly){ POINT *pt; pt = new POINT[n]; for (int i=0; i < n; i++) { pt[i].x = scalx(poly[2*i]); pt[i].y = scaly(poly[2*i+1]); } if (cstatic <0 || cstatic > ncolortable) cstatic =1; SelectObject(hdc,hbr[cstatic]); int ret = Polygon(hdc,pt,n); delete [] pt; SelectObject(hdc,hpen[n]); if (psfile) { fprintf(psfile,"bF "); for (int i=0;i((x - rxmin) * echx); } int scaly(float y) { return static_cast((rymax - y) * echy); } float scali(int i) { return i/echx + rxmin; } float scalj(int j) { return -j/echy + rymax; } void pointe(float x, float y) { // putpixel(scalx(x), scaly(y), LastColor); } int InRecScreen(float x1, float y1,float x2, float y2) { float xi = Min(x1,x2),xa=Max(x1,x2); float yi = Min(y1,y2),ya=Max(y1,y2); return (xa >= rxmin) && (xi <= rxmax) && (ya >= rymin) && (yi <= rymax); } int InPtScreen( float x, float y) { return (x >= rxmin) && (x <= rxmax) && (y >= rymin) && (y <= rymax); } void SetRGBpen(int n) { SelectObject(hdc, hpen[n]); } static rgb DefColorWin32( int k,int nb, bool hsv,bool grey,int nbcolors,float *colors) { rgb C; float r,g,b; extern void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool grey,int nbcolors,float *colors); DefColor(r,g,b, k,nb,hsv,grey,nbcolors,colors); C.r= (BYTE) (255*r); C.g= (BYTE) (255*g); C.b= (BYTE) (255*b); return C; } void SetColorTable1(int nb,bool hsv,int nbcolors,float *colors) { static bool greyo = !grey; static float * colorso =0; if(!INITGRAPH) return; if (ncolortable == nb && greyo == grey && colorso == colors ) return;// optim greyo = grey; colorso=colors; { if (hpen) for(int i=0; i1) LastColor=nb-1; for (int i0=0;i01) LastColor=nb-1; if (hpen) for(int i=0; i2) { nb -= 2; for (long i0=0;i0 LastColor ? 1 : c; // c=Min(c,LastColor); pour noir et blanc if (!(winf_flg&winf_NOCOLOR)) { if (c>=0 && c < ncolortable) cstatic = c; else cstatic = 1; SetRGBpen(cstatic); } // else SetRGBpen(1); } if (psfile) { float r=1,g=1,b=1; if (colortable) { if (c>0 && c < ncolortable) { r = (float) colortable[c].r /255.; g = (float) colortable[c].g /255.; b = (float) colortable[c].b /255.; } } else if (c!=0) r=g=b=0; fprintf(psfile,"%.3f %.3f %.3f C\n",r,g,b); } } int LaCouleur(){return cstatic;} //* Control on the graphic window void rattente(int waitm) { int i=0, j=0; char c; if (waitm) if(!(winf_flg&winf_NOWAIT)) c = Getijc(i,j); } char Getijc(int & x,int & y) { char char1=' '; if(!INITGRAPH) { x = 0; y = 0; return char1; } int cont=1; POINT xy; xy.x =0; xy.y =0; MSG msg; SetWindowText(hWnd,"Click mouse to continue"); do { GetMessage(&msg,hWnd,0,0);// all message GetCursorPos(&xy); switch (msg.message) { case WM_LBUTTONDOWN:char1=char(251), cont=0; break; // with shift 248 case WM_RBUTTONDOWN:char1=char(253), cont=0; break; // with shit 250 // if the 2 buttom, 252, et shith 249; case WM_CLOSE: myexit(2); case WM_DESTROY: myexit(3); case WM_CHAR: char1 = (TCHAR)msg.wParam; cont = 0; break; //case WM_KEYDOWN: char1 = (TCHAR)msg.wParam; cont=0; break; default: TranslateMessage(&msg); DispatchMessage(&msg); break; } } while (cont); // ScreenToClient(hWnd,&xy); ShowWindow(hWnd, SW_SHOW ); // SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetWindowText(hWnd, PACKAGE_STRING " works..."); RECT rc; ScreenToClient(hWnd,&xy); GetClientRect(hWnd, &rc); x = xy.x-rc.left; y = xy.y-rc.top; // cout << " x = " << x << " y = " << y << " char = " << ((unsigned char)char1 > 127 ? '*': char1) << ")" << endl; return char1; } char Getxyc(float &x,float &y) { char c=' '; int i=0,j=0; if(!(winf_flg&winf_NOWAIT)) c = Getijc( i,j); x = scali(i); y = scalj(j); //rattente(1); return c; } //* clear the screen with white void reffecran(void) { HBRUSH hbr; RECT rc; GetClientRect(hWnd, &rc); hbr = CreateSolidBrush(RGB(255, 255, 255)); FillRect(hdc,&rc,hbr); DeleteObject(hbr); } BOOL ShowOpenDialogBox(char *fileName) { OPENFILENAME ofn; char szDirName[256]; char *strFilter="PCgFEM Files (*.edp)\0*.edp\0All Files (*.*)\0*.*\0\0"; memset(&ofn, 0, sizeof(OPENFILENAME)); getcwd(szDirName,sizeof(szDirName)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = NULL; ofn.lpstrFilter = strFilter; ofn.lpstrFileTitle = fileName; ofn.nMaxFileTitle = 80; ofn.lpstrInitialDir=szDirName; ofn.lpstrTitle ="Choose you freefem '*.edp' File"; ofn.Flags=OFN_SHOWHELP|OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST; return GetOpenFileName(&ofn); } void coutmode(short r) { ;}// will be done later void initgraphique(void) { if (INITGRAPH) return; hdc=GetDC(hWnd); hpen=0; SetColorTable(2+6); RECT rc; GetClientRect(hWnd, &rc); aspx = (float)(rc.right - rc.left); aspy = (float)(rc.bottom - rc.top); width = rc.right - rc.left; height = rc.bottom - rc.top; carre = aspx == aspy; // Define the font style LOGFONT lf; TEXTMETRIC tm; HFONT hFont, hOldFont; memset(&lf, 0, sizeof lf); lf.lfHeight = -9; lstrcpy(lf.lfFaceName,"Arial"); lf.lfOutPrecision = OUT_TT_PRECIS; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfQuality = PROOF_QUALITY; lf.lfPitchAndFamily = FF_SWISS | VARIABLE_PITCH; hFont = ::CreateFontIndirect(&lf); hOldFont = (HFONT)::SelectObject(hdc,hFont); ::GetTextMetrics(hdc, &tm); ::DeleteObject(hOldFont); fontH = static_cast((tm.tmHeight + tm.tmExternalLeading)*0.6); // end of font style INITGRAPH = 1; // cout << flush << "end inigraphique " << endl; } void closegraphique(void) { if(INITGRAPH) { if(hpen) DeleteObject(hpen), delete [] colortable; if (hbr) DeleteObject(hbr), INITGRAPH =0; // before DestroyWindow to avoid loop ReleaseDC(hWnd,hdc); // DestroyWindow(hWnd); } } void GetScreenSize(int & ix,int &iy) { ix = width ; iy = height; } void openPS(const char *filename ) { RECT rc; GetClientRect(hWnd, &rc); width = rc.right - rc.left; height = rc.bottom - rc.top; closePS(); time_t t_loc; float s=0.5; const int shiftx=50,shifty=50; time(&t_loc); printf(" Save Postscript in file '%s'\n",filename?filename:"freefem.ps"), psfile=fopen(filename?filename:"freefem.ps","w"); if(psfile==0) {printf("Erreur %s \n",filename);exit(1);} if(psfile) { fprintf(psfile,"%%!PS-Adobe-2.0 EPSF-2.0\n%%%%Creator: %s\n%%%%Title: FreeFem++\n","user"); fprintf(psfile,"%%%%CreationDate: %s",ctime(&t_loc)); fprintf(psfile,"%%%%Pages: 1\n"); fprintf(psfile,"%%%%BoundingBox: %d %d %d %d\n",shiftx,shifty,int(shiftx+width*s),int(shifty+height*s)); fprintf(psfile,"%%%%EndComments\n"); fprintf(psfile," /L { lineto currentpoint stroke newpath moveto} def\n"); fprintf(psfile," /M { moveto } def\n"); fprintf(psfile," /C {setrgbcolor} def\n"); fprintf(psfile," /rec {newpath 4 copy 8 1 roll moveto 3 -1 roll lineto 4 2 roll exch lineto lineto closepath} def\n"); fprintf(psfile," %d %d translate \n",shiftx,shifty); fprintf(psfile," %f %f scale \n",s,s); fprintf(psfile," 0 %d 0 %d rec clip newpath\n",int(width),int(height)); fprintf(psfile," /Helvetica findfont 10 scalefont setfont\n"); fprintf(psfile," /S { show} def\n"); fprintf(psfile," /bF { mark} def \n"); fprintf(psfile," /eF {newpath moveto counttomark 2 idiv {lineto} repeat closepath fill cleartomark} def\n"); fprintf(psfile," /P { /yy exch def /xx exch def xx xx 1 add yy yy 1 add rec fill } def\n"); fprintf(psfile," 1 setlinewidth\n"); psfile_save=psfile; } } void closePS(void) { if(psfile_save) { fprintf(psfile_save,"showpage\n");//fprintf(psfile,"showpage\n"); fclose(psfile_save);//fclose(psfile); } psfile=0; psfile_save=0; } void Commentaire(const char * c) { if(psfile) { fprintf(psfile,"%% %s\n",c); } }; void NoirEtBlanc(int NB) { if(NB) LastColor=1; else LastColor=ncolortable?ncolortable:2; } void MettreDansPostScript(int in) { if(in) psfile=psfile_save; else psfile=0; } // Various works when the program will end void myexit(int err) { time_t ltime; // write the time stump in console struct tm *now; time(<ime); // write the end time now = localtime(<ime); cout << "\nEnd Time: " << asctime(now) << endl; if (err==0) { // normal end cout << "end No Error " << endl << flush ; } else cout << "end by Error (no.=" << err << ')' << endl; rattente(1); if (GetConsoleBuff()==FALSE) FatalErr("Log file creation error !",0); if (!(winf_flg&winf_NOEDIT)) EditLog(); if (INITGRAPH) closegraphique(); FreeConsole(); PostQuitMessage(0); exit(err); } // initialize the console void SetcppIo() { FILE *fp=NULL,*fin=NULL; // Get the standard output fin = GetConsoleHandle(STD_INPUT_HANDLE); if(fin!=NULL) *stdin = *fin; // get the standard output if((fp = GetConsoleHandle(STD_OUTPUT_HANDLE)) == NULL) *stdout = *fp; freopen("conin$", "r", stdin); freopen("conout$", "w", stdout); // freopen("conout$", "w", stderr); using namespace __gnu_cxx; stdio_filebuf * ccout = new stdio_filebuf(stdout, std::ios_base::out); //static stdio_filebuf ccerr(stderr, std::ios_base::out); stdio_filebuf *ccin= new stdio_filebuf(stdin, std::ios_base::in); cout.rdbuf(ccout); cin.rdbuf(ccin); cerr.rdbuf(ccout); ios::sync_with_stdio(); } BOOL inittext(VOID) { OSVERSIONINFO osVer; // for GetVersionEx() osVer.dwOSVersionInfoSize = sizeof(osVer); GetVersionEx(&osVer); if (osVer.dwPlatformId == VER_PLATFORM_WIN32s) { MessageBox(NULL, "This FreeFEM++ cannot run on Windows 3.1.\n" "This application will now terminate.", "Error: Windows NT or Windows 95 Required to Run", MB_OK ); return FALSE; // Console API is not able in Windows 3.1 } // FreeConsole(); // If the console is already used AllocConsole(); // Use the console API SetcppIo(); /* freopen("conin$", "r", stdin); freopen("conout$", "w", stdout); freopen("conout$", "w", stderr); */ SetConsoleTitle(PACKAGE_STRING " console"); return TRUE; } //*------- Modules for MS-Windows //*OT 12/3/1999 //* Get the buffer of the console //* The buffer is stored in the filename.log BOOL GetConsoleBuff() { CONSOLE_SCREEN_BUFFER_INFO csbi; //* to get buffer info GetConsoleScreenBufferInfo(hConOut, &csbi); COORD coordLine = {0,0}; CHAR *szLine; //* buffer to read from the console (a line) DWORD dwCharsRead; char fname[255]; FILE *fp; strcpy(fname,ChangePdeToExt(shortName,"log")); if ((fp = fopen(fname,"w"))==NULL) { perror(fname); return FALSE; } szLine = (CHAR *)malloc((csbi.dwSize.X+1) * sizeof(CHAR)); for (int i=0; i 0)) szLine[j--] =0; if (j < csbi.dwSize.X-1) szLine[j+1] = '\n'; fprintf(fp,"%s",szLine); coordLine.Y++; } fclose(fp); return TRUE; } //*OT 12/3/1999 //* Open the filename.log by the editor //* default editor is notepad.exe //* Using variable "ffemEd", we can change the editor BOOL EditLog() { char *editor, fname[256], cmdLine[255]; strcpy(fname,ChangePdeToExt(shortName,"log")); editor = getenv("ffed"); if (editor == 0) sprintf(cmdLine,"notepad.exe %s",fname); else sprintf(cmdLine,"%s %s",editor,fname); if (WinExec(cmdLine,SW_SHOWNORMAL) < 31) { sprintf(errbuf,"Cannot execute [%s]",cmdLine); FatalErr(errbuf,99); return FALSE; } FreeConsole(); return true; } void Usage() { cout << "Usage: freefem++ [options]" << endl; cout << "Select a program file by the dialog box if option is omitted.\n[option]" << endl; cout << "-f filename: Run the program file \"filename\"." << endl; cout << " In this mode, all plotted datas are stored in the \".\\cache\"." << endl; cout << " The stored datas are used in \"WinfFEM\" (IDE for freefem+)." << endl; cout << " You can get this from ." << endl; cout << "-s : No wait at end." << endl; cout << "-b : Do not use the color" << endl; cout << "-n : Do not open the log file at end. The editor is the notepad if you do not" << endl; cout << " set \"ffed=[name of editor]\" in environments." << endl; cout << "-h : Display the usage (this)." << endl; } // freefem+ arg1 arg2 arg3 // Hack the args and analysis int StoreFname(char Line[], int len) { char msg[256]; char *ext; // ALH - 2/6/04 - add treatments for names surrounded with quotes // (but still breaks on names including quotes). char stopchar = ' '; bool skipone = false; if(Line[0] == '"' || Line[0] == '\''){ stopchar = Line[0]; skipone = true; } // Copies the name string, including its surrounding quotes if // necessary. int i; int j=0; for (i=0; i0 )||isdigit(c) )) if(isdigit(c)) vv+= c; verbosity=atoi(vv.c_str()); } case 's': // not wait at end of execution winf_flg |= winf_NOWAIT; ++i; break; case 'b': // no color winf_flg |= winf_NOCOLOR; ++i; break; case 'n': winf_flg |= winf_NOEDIT; ++i; break; case 'h': winf_flg |= winf_Usage; ++i; break; default: while (lpszCmdLine[i]!=' ' && (i < CmdLen)) i++; } } else { i += StoreFname(&lpszCmdLine[i],CmdLen-i); break; } } cout << " v = " << verbosity << endl; return 0; } /* * Init * Initialization for the program is done here: * 1) Register the window class (if this is the first instance) * 2) Create the desktop window for the app. * 3) Show the desktop window in the manner requested by the User. * */ BOOL Init(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { DWORD dwStyle = WS_OVERLAPPEDWINDOW; if (!hPrevInstance) { /* Register Class for First Overlapped Window */ rClass.lpszClassName = "FreeFem++" ; rClass.hInstance = hInstance; rClass.lpfnWndProc = OpenWindowProc1; rClass.hCursor = LoadCursor(NULL, IDC_ARROW); rClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); rClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); rClass.style = 0x4000; rClass.cbClsExtra = 0; rClass.cbWndExtra = 0; if (!RegisterClass( &rClass)) return FALSE; } int dd=600; int ddx0=200; int ddy0=30; // long dwFlags; /* DEVMODE dev_mode = {0}; if(!EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&dev_mode)) { cout << " screen size ?? " << dev_mode.dmPelsWidth << " x " << dev_mode.dmPelsHeight << endl; dd = Min(dev_mode.dmPelsWidth*0.7,dev_mode.dmPelsHeight*0.9); ddx0 = dev_mode.dmPelsWidth*0.28; ddy0=dev_mode.dmPelsHeight*0.05; } else cout << " Error EnumDisplaySettings => no screen size " << endl; */ int sx = GetSystemMetrics(SM_CXSCREEN); int sy = GetSystemMetrics(SM_CYSCREEN); dd = static_cast(Min(sx*0.7,sy*0.9)); ddx0 = static_cast(sx*0.28); ddy0 = static_cast(sy*0.05); //cout << " Screen Size " << sx << " x " << sy << endl; // Rectangle ss=Get_VirtualScreen(); // dd=(Abs(ss.get_Top-ss.get_Bottom())*90)/100; GetOption(lpszCmdLine); hWnd = CreateWindow("FreeFEM++", PACKAGE_STRING " for Windows", dwStyle,ddx0,ddy0,dd,dd,/* CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,*/ NULL, NULL, hInstance, NULL); if (*fullName == '\0' && (winf_flg != winf_Usage)) { // in command line, there is no filename if (ShowOpenDialogBox(shortName)==FALSE) { exit(0); } strcpy(fullName,shortName); } if (inittext()==FALSE) myexit(1); else if (winf_flg & winf_VFFEM ) { // create only cache, option "-f" is given if (!getcwd(FreeFemCache,MAX_PATH)) { FatalErr("Fail to get current path",-1); } strcat(FreeFemCache,"\\cache\\"); if (chdir(FreeFemCache)) { // check the cache directory #ifndef __CYGWIN__ if (mkdir(FreeFemCache)) { #else if (mkdir(FreeFemCache,0777)) { #endif sprintf(errbuf,"Fail to create the directory %s",FreeFemCache); FatalErr(errbuf,-1); } } else (chdir("..\\")); // already created return TRUE; }; return TRUE; } /* OpenWindowProc1 - Handles messages for the main window. * Parameters: * hWnd - Handle to Window which message is delivered to. * msgID - ID number of message * wParam - 16-bit parameter * lParam - 32-bit parameter * */ LONG WINAPI OpenWindowProc1( HWND hWnd, UINT wMsgID, WPARAM wParam, LPARAM lParam) { switch (wMsgID) { case WM_DESTROY: PostQuitMessage(0); DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, wMsgID, wParam, lParam); } return 0; } //*OT 29/12/98 // Routines and functions for WinfFEM int chkCacheDir(); BOOL TestProjetPresence(char *shortName); BOOL CreateProjetFile(char *shortName); BOOL SaveLogFile(char *fileName); void GetOption(int argc, char *argv[]); FILE *projet=NULL; // end int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, // int argc, char *argv[] int nCmdShow) { MSG msg; LPTSTR cmd = GetCommandLine(); if (Init(hInstance, hPrevInstance,lpszCmdLine,nCmdShow)) { // main after checking options if (mainFreeFEM() == FALSE) myexit(99); // exit with error else myexit(0); while (GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } myexit(msg.wParam); // exit(msg.wParam); } return -1; } // the real main extern int mymain(int argc,char **argv); // main() in FreeFEM+ for PCs BOOL mainFreeFEM() { char prjName[256]; if (winf_flg & winf_VFFEM) { // given by "-f filename" strcpy(prjName,ChangePdeToExt(shortName,"prj")); if (strcmp(FreeFemCache,"")!=0) if (CreateProjetFile(prjName)==FALSE) FatalErr(prjName,-1); } cout << "Welcome to freefem++ v " << StrVersionNumber() <= 0 ; i-- ) { // loop 1 if ( fullname[i] == '\\' ) { for ( j = i+1, k=0 ; j < tail ; j++, k++ ) *(shortname + k) = *(fullname + j ) ; *(shortname + k) = '\0'; break; } } if (i == -1) strcpy(shortname,fullname); return 0 ; // OK! } void ShowHelp(const char * s,int k) { if(k) { MettreDansPostScript(0); couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); MettreDansPostScript(1); // couleur(1); } } char *ChangePdeToExt(char *fileName,char *ext) { int len; len=strlen(fileName); char *file = new char[len+1]; for(int i=0; i #define MAXPATH 256 char * getOp(const char *what) { int tail=0, len=0; char *p; p = strrchr(what, '\\'); if (p == NULL) p = (char *)what; while (*p && (*p != ' ')) p++; if (*p) *p++ = '\0'; else return NULL; while (*p && (*p == ' ')) p++; if (*p) return p; else return NULL; } #ifdef WWWWWWWWWWWWWWWWWWWW int execute(const char* what) { char szBuffer[MAXPATH + 1]; char *option; int r=0; char *vide=""; option = getOp(what); if(!option) option = vide; cout << "excute :: " <&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/Graphics ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = glrgraph.hpp macglrgraf.cpp \ macrgraf.cpp Pcrgraph.cpp rgraph.hpp \ sansrgraph.cpp xglrgraf.cpp Xrgraph.cpp DefColor.cpp \ getprog-unix.hpp mode_open.hpp ffglut.hpp ff-win32.cpp 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Graphics/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Graphics/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ cscopelist-am ctags-am distclean distclean-generic 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 pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # FFCS: no compilation here, so the tags file must be built by hand tags:TAGS TAGS: etags *.?pp clean-local:: -rm TAGS # 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: freefem++-3.61-1/src/Graphics/sansrgraph.cpp000644 000767 000024 00000046651 13256636774 021042 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ // ALH - javascript output #ifdef FFJS #ifndef NATIVEFFJS // [[file:~/ffjs/Makefile::NATIVEFFJS]] #include #endif // NATIVEFFJS #endif // FFJS #define FF_GRAPH_SET_PTR using namespace std; #include #include #include #include #include #include #include "rgraph.hpp" #include "error.hpp" #ifdef macintoshxx #include #include #else #include #endif #ifdef xTARGET_CARBON #include int pStrCopy (StringPtr p1, char * p2) /* copies a pascal string `p1 into a C string */ { int len,i; len = (*p1++) %256; for(i=1;i<=len;i++) *p2++=*p1++; *p2 = 0; return 0; } int getprog(char* fn,int argc, char** argvptr) { OSErr anErr; NavDialogOptions dialogOptions; NavReplyRecord reply; anErr=NavGetDefaultDialogOptions(& dialogOptions); if( anErr != noErr) return -1; anErr =NavChooseFile(0,&reply,&dialogOptions,0,0,0,0,0) ; if (anErr == noErr && reply.validRecord) { // Deal with multiple file selection long count; anErr = AECountItems(&(reply.selection), &count); // Set up index for file list if (anErr == noErr) { long index; for (index = 1; index <= count; index++) { AEKeyword theKeyword; DescType actualType; Size actualSize; FSSpec documentFSSpec; // Get a pointer to selected file anErr = AEGetNthPtr(&(reply.selection), index, typeFSS, &theKeyword, &actualType,&documentFSSpec, sizeof(documentFSSpec), &actualSize); if (anErr == noErr) { anErr = HSetVol(0,documentFSSpec.vRefNum,documentFSSpec.parID); pStrCopy(documentFSSpec.name, fn); } } } // Dispose of NavReplyRecord, resources, descriptors anErr = NavDisposeReply(&reply); } return (2); } #else #include "getprog-unix.hpp" #endif template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} static long cube6[7][3] ={ { 65535,32000,32000},{ 65535, 65535,0},{0, 65535,0},{0, 65535, 65535},{0,0, 65535} , { 65535,0, 65535},{ 32000,0,0} }; static long grey6[2][3] ={ {65534,65534,65534},{0,0,0} }; static bool grey=false; static FILE *psfile = 0; static FILE *psfile_save = 0; static int LastColor=2; // pour est en couleur par defaut const float fMinPixel = -32000; const float fMaxPixel = +32000; #define reel float typedef struct XColor { unsigned short red,green,blue; } XColor; static XColor *colortable; static int ncolortable,fcolor; static reel echx,echy,rxmin,rxmax,rymin,rymax; static int lacouleur=0, width, height, currx=0, curry=0; #define call(i) i static int INITGRAPH=0; void myend(); void myend() { if (INITGRAPH) closegraphique(); cout << "the end" <> // ALH - 4/4/15 - main() is not desired if FF is used as a library #ifndef WITHOUT_MAIN // ALH - 24/2/15 - the main entry point for javascript is on the HTML page so we need to give it a different name here. // Built by [[file:~/fflib/Makefile::FFLIB_MAIN]] and called by [[file:~/fflib/fflib.cpp::calling_fflib_main]]. #ifdef FFLIB_MAIN int fflib_main(int argc,char **argv) #else int main (int argc, char **argv) #endif { atexit(doatexitff); int ret=mymain(argc,argv); // <> return ret; } #endif // WITHOUT_MAIN #endif // FREEFEM void message(char *s); void message(char *s) { printf("%s \n",s);} void erreur(char *s) { message(s); exit(0);} void *safecalloc(size_t nb, size_t size); void *safecalloc(size_t nb, size_t size) { void* p=NULL; p = calloc(nb, size); if (p == NULL) printf("Run out of Memory!\n"); return p; } void safefree(void** f); void safefree(void** f) { if(*f){ free((char*) *f); *f=NULL;} } void rflush(); void rflush() { } int LaCouleur() {return lacouleur;} void couleur(int c) { if ( lacouleur == c) // small optim return; c= c > LastColor ? 1 : c; // c=Min(c,LastColor); pour noir et blanc lacouleur = c; float r=1,g=1,b=1; if (colortable) { if (c>0 && c < ncolortable) { r = (float) colortable[c].red /65535.; g = (float) colortable[c].green /65535.; b = (float) colortable[c].blue /65535.; } } else if (c!=0) r=g=b=0; if(psfile) fprintf(psfile,"%.3f %.3f %.3f C\n",r,g,b); #ifdef FFJS_GRAPH // ALH - <> javascript graph [[file:~/ffjs/main.js::ffjs_couleur]] EM_ASM_DOUBLE({ffjs_couleur($0,$1,$2)},r,g,b); #endif } static XColor DefColorSansG( int k,int nb, bool hsv,bool ggrey,int nbcolors,float *colors) { XColor C; float r,g,b; extern void DefColor(float & r, float & g, float & b, int k,int nb, bool hsv,bool ggrey,int nbcolors,float *colors); DefColor(r,g,b, k,nb,hsv,ggrey,nbcolors,colors); C.red= (short unsigned int) (65535*r); C.green=(short unsigned int)(65535*g); C.blue= (short unsigned int) (65535*b); return C; } void SetColorTable1(int nb,bool hsv,int nbcolors,float *colors) { static bool greyo = !grey; static float *colorso =0; if(!INITGRAPH) return; if (ncolortable == nb && greyo == grey && colorso == colors ) return;// optim greyo = grey; colorso=colors; if (nbcolors && nb>2) { if(colortable) delete [] colortable; colortable = new XColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; for (int i0=0;i02 && nb < 256) { nb = Max(nb,8); if (ncolortable == nb) return;// optim if(colortable) delete [] colortable; colortable = new XColor[nb]; ncolortable = nb; if(LastColor>1) LastColor=nb-1; // cout << "SetColorTable "<< nb << endl; int k=0; colortable[k].red= 65535; colortable[k].green= 65535; colortable[k].blue= 65535; k++; colortable[k].red=0; colortable[k].green=0; colortable[k].blue=0; k++; nb = nb -2; for (long i0=0;i0> javascript graph [[file:~/ffjs/main.js::ffjs_rlineto]] EM_ASM_INT({ffjs_rlineto($0,$1)},newx,newy); #endif } void cadreortho(reel centrex, reel centrey, reel rayon) { if (height < width) { rymin = centrey - rayon; rymax = centrey + rayon; echx = echy= height / (2 * rayon); rxmin= centrex - width / (2 * echx); rxmax= centrex + width / (2 * echx); } else { rxmin = centrex - rayon; rxmax = centrex + rayon; echx = echy = width / (2 * rayon); rymin = centrey - height / (2 * echy); rymax = centrey + height / (2 * echy); } } void plotstring (const char * string) { //int l = strlen(string); if(psfile) fprintf(psfile,"(%s) %d %d S\n",string,currx,height-curry); #ifdef FFJS_GRAPH // ALH - <> javascript graph - Send the string character by character to // [[file:~/ffjs/main.js::ffjs_plotstring]] because there is no string parameter at the moment // [[http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html#c.EM_ASM_]] for(const char *c=string;*c;c++)EM_ASM_INT({ffjs_plotstring($0)},*c); EM_ASM(ffjs_plotstring(0)); #endif } void showgraphic() { } void penthickness(int pepais) { if (psfile) fprintf(psfile,"%d setlinewidth\n",pepais*2); #ifdef FFJS_GRAPH // ALH - <> javascript graph [[file:~/ffjs/main.js::ffjs_penthickness]] EM_ASM_INT({ffjs_penthickness($0)},pepais); #endif } void x11linsrn(int * ,int * ,int * ,int * ); void x11linsrn(int * ,int * ,int * ,int * ) //int *x1,*x2,*y1,*y2; { } void viderbuff() { } void cercle(reel , reel , reel ); void cercle(reel , reel , reel ) { //int r = (int) (rayon * echx); } void reffecran(){ #ifdef FFJS_GRAPH // ALH - <> javascript graph [[file:~/ffjs/main.js::ffjs_graphstart]] EM_ASM(ffjs_graphstart()); #endif } void fillpoly(int n, float *poly) { int i; if (psfile) { fprintf(psfile,"bF "); for (i=0;i> javascript graph [[file:~/ffjs/main.js::ffjs_fillpoly]] EM_ASM_INT({ffjs_fillpoly_begin($0,$1)},scalx(poly[0]),scaly(poly[1])); for(i=1;i>char1 ; return 0;// char1; } char Getxyc(float &x,float &y) { // cout << " in Getxyc" << endl; char c; int i,j; c = Getijc( &i,&j); x = scali(i); y = scalj(j); // cout << " out Getxyc" << x << " " << y << " " << c << endl; return c; } /// <> void rattente(int ) { } void GetScreenSize(int &ix,int &iy) { ix = width; iy = height; } // <> void openPS(const char *filename ) { char ffff[32]; int count=0; if(psfile_save) closePS(); time_t t_loc; int widthA4PS=596; //int heightA4PS=842; float s= (double)widthA4PS/width; char username[10]; /*if (!cuserid(username)) */ strcpy(username,"inconnue"); time(&t_loc); bool notfound; if( !filename) do { struct stat buf; sprintf(ffff,"rgraph_%.3d.ps",count++); volatile int r= stat(ffff,&buf) ; notfound = r !=0; if(count>1000) break; } while ( !notfound ); const char *fps (filename?filename:ffff); psfile=fopen(fps,"w"); #ifdef FFJS_GRAPH // <> ALH - extract the list of graphs generated by FF during a run // [[file:~/ffjs/ffapi.js::ffjs_listgraphs]]. Send the file name character by character to // [[file:~/ffjs/ffapi.js::ffjs_listgraphs]] because there is no string parameter at the moment // [[http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html#c.EM_ASM_]] for(const char *c=fps;*c;c++)EM_ASM_INT({ffjs_listgraphs($0)},*c); EM_ASM(ffjs_listgraphs(0)); #endif if(psfile) { psfile_save=psfile; fprintf(psfile,"%%!PS-Adobe-2.0 EPSF-2.0\n%%%%Creator: %s\n%%%%Title: FreeFem++\n","user"); fprintf(psfile,"%%%%CreationDate: %s",ctime(&t_loc)); fprintf(psfile,"%%%%Pages: 1\n"); fprintf(psfile,"%%%%BoundingBox: 0 0 %d %d\n",int(width*s),int(height*s)); fprintf(psfile,"%%%%EndComments\n"); fprintf(psfile," /L {newpath moveto lineto stroke} def\n"); fprintf(psfile," /C {setrgbcolor} def\n"); fprintf(psfile," /rec {newpath 4 copy 8 1 roll moveto 3 -1 roll lineto 4 2 roll exch lineto lineto closepath} def\n"); fprintf(psfile," %f %f scale \n",s,s); fprintf(psfile," 0 %d 0 %d rec clip\n",int(width),int(height)); fprintf(psfile," /Helvetica findfont %d scalefont setfont\n",int(9/s)); fprintf(psfile," /S {moveto show} def\n"); fprintf(psfile," /bF { mark} def \n"); fprintf(psfile," /eF {newpath moveto counttomark 2 idiv {lineto} repeat closepath fill cleartomark} def\n"); fprintf(psfile," /P { /yy exch def /xx exch def xx xx 1 add yy yy 1 add rec fill } def\n"); fprintf(psfile," 2 setlinewidth\n"); } else cerr << " Err openning postscript file " << fps << endl; } void closePS(void) { if(psfile_save) { fprintf(psfile_save,"showpage\n"); fclose(psfile_save); } psfile_save=0; psfile=0; #ifdef FFJS_GRAPH // ALH - <> javascript graph [[file:~/ffjs/main.js::ffjs_graphdone]] EM_ASM({ffjs_graphdone()}); #endif } void coutmode(short ) {} // bof bof --- float GetHeigthFont() { double widthA4PS=596; float s=widthA4PS/width; return 5.5/s/echy; } void Commentaire(const char * c) { if(psfile) { fprintf(psfile,"%% %s\n",c); } } void NoirEtBlanc(int NB) { if(NB) LastColor=1; else LastColor=ncolortable?ncolortable:2; } void MettreDansPostScript(int in) { if(in) psfile=psfile_save; else psfile=0; } static void FillRect(float x0,float y0, float x1, float y1) { float r[8]; r[0]=x0;r[1]=y0; r[2]=x1;r[3]=y0; r[4]=x1;r[5]=y1; r[6]=x0;r[7]=y1; fillpoly(4,r); } int PutLevel(int lineno, float xf, int col); int PutLevel(int lineno, float xf, int col) { float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); float xleft = xmax - (xmax-xmin)*0.1; float ytop = ymax; float ydelta = (ymax-ymin)/40; ydelta=GetHeigthFont(); xleft = xmax - 6*ydelta; ytop -= ydelta*(col+2); couleur(col); FillRect(xleft+ydelta/8.,ytop+ydelta/8.,xleft+ydelta*7./8.,ytop+ydelta*7./8.); rmoveto(xleft+ydelta*1.4,ytop+ydelta/4); char buf[30]; sprintf(buf,"%g",xf); couleur(1); plotstring(buf); return lineno; } void ShowHelp(const char * s,int k) { if(k) { MettreDansPostScript(0); couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); MettreDansPostScript(1); // couleur(1); } } void setgrey(bool gg ){grey=gg;} int getgrey(){ return grey;} class Grid; void SaveMesh(Grid &); void SavePlot(int , Grid& , double *); void SavePlot(int , Grid& , float *); void SaveMesh(Grid &){} void SavePlot(int , Grid& , double *){} void SavePlot(int , Grid& , float *){} freefem++-3.61-1/src/bamg/bamg.cpp000644 000767 000024 00000071233 13256636774 016740 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // // SUMMARY: Bamg: Bidimensional Anisotrope Mesh Generator // RELEASE: 0 // // AUTHOR: F. Hecht, // ORG : UMPC // E-MAIL : Frederic.Hecht@Inria.fr // // ORIG-DATE: Dec 97 // Modif March 98 /* This file is part of Bamg or 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 */ // E-MAIL : Frederic.Hecht@Inria.fr // // ORIG-DATE: Dec 97 #include #include #include #include #include #include #include #include "Meshio.h" #include #include "Mesh2.h" #include "QuadTree.h" using namespace bamg; using namespace std; #include #ifdef __MWERKS__ #define NBVMAX 10000 #else #define NBVMAX 50000 #endif // 0 1 2 3 // 0123456789012345678901234567890 const char whatbamg []= "@(#)LJLL, le 20 fevr 2006, Bamg v1.02 "; const char *bamgversion = whatbamg + 28; int initgraph=0; //long verbosity=2; #ifdef __MWERKS__ #define R_OK 0 #define F_OK 0 #define W_OK 0 #include inline int access( char *fileName, int notUsed ) { struct stat statRec; return stat( fileName, &statRec ); } #endif #ifdef _MSC_VER #define R_OK 04 #define F_OK 0 #define W_OK 02 #include inline int access( char *fileName, int mode) { return _access( fileName, mode ); } #endif void NewHandler(); void NewHandler() { cerr << " Not enought memory " << endl; exit(1); } void forDebug(); void MeshErrorIO(ios& ) { MeshError(999); exit(1); } #ifdef DRAWING bool withrgraphique= initgraphique; #else bool withrgraphique=false; #endif void forDebug() { #ifdef DRAWING if(initgraph) { if (CurrentTh) CurrentTh->inquire(); closegraphique();initgraph=0; } #endif } int main(int argc, char **argv) { #ifdef __MWERKS__ cout << " version " << bamgversion << " for initialisation of the toolbox " << endl; #endif // JUST for HP CC bug #ifdef LONGLONG long long bidon=2; if( (double) bidon != 2.0) { cerr << "Compiler bug Pb of cast of long long to a double => remove the LONGLONG define" << endl; exit(10); } #endif double time0, time1,time2,time3,time4; // 2 way for uses --- // 1 first mesh // or adaptation MeshIstreamErrorHandler = MeshErrorIO; // double *sol=0; // int adaptation = 0 ; Int4 i; hinterpole=1; // by def interpolation a h // int Err=0; int fileout=0; int nbvx = NBVMAX; int iso =0,AbsError=0,nbjacoby=1,allquad=0; int NoMeshReconstruction=0; int Rescaling = 1; double costheta=2; Real8 cutoffradian=-1; double anisomax = 1e6; double err=0.01,errg=0.1,coef=1,hmin=1.e-100,hmax=1.e17,raison=0,CutOff=1e-5; int KeepBackVertices=1; double hminaniso=1e-100; const double boundmaxsubdiv = 10; double maxsubdiv=boundmaxsubdiv; double omega=1.8; int NbSmooth=3; double *solMbb =0,*solMBB=0; int *typesolsBB =0; Int4 nbsolbb=0,lsolbb=0; Int4 nbsolBB=0,lsolBB=0; int SplitEdgeWith2Boundary=0; int rbbeqMbb=0,rBBeqMBB=0; int ChoiseHessien = 0; double power=1; Triangles *Thr=0,*Thb=0; char * fgeom=0,*fmeshback=0,*fmeshout=0,*fmeshr=0,*fmetrix=0,*famfmt=0,*fmsh=0, *fnopo=0,*fftq=0,*fam=0,*famdba=0,*rbb=0,*rBB=0,*wbb=0,*wBB=0, *fMbb=0,*foM=0,*fMBB=0; verbosity =2; char *datargv[128] ; int datargc=1; datargv[0]= datargv[1]=0;// for create a error if no parameter const char * datafile = argc ==2 ? argv[1] : "DATA_bamg"; atexit( forDebug); set_new_handler( &NewHandler); if (argc<3) { // for test on the mac if (!access(datafile,R_OK)) { MeshIstream data(datafile); while(data.cm() && datargc <128) datargv[datargc++]=data.ReadStr(); if (argc==1) datargv[0]=argv[0]; // copy of the program name argc=datargc; argv=datargv; } }; for (i=1;i isotropic (1e6 by default) " << endl; cout << " -RelError Construct metric with relative error " << endl; cout << " -AbsError Construct metric with with abs error " << endl; cout << " -CutOff (double) Set the limit of the relative error (1.e-5)" << endl; cout << " -NbJacobi (int) Set the number of Jacobi iteration for smoothing " << endl; cout << " the construction of metric (1 by default)." << endl; cout << " -NoRescaling Don't rescaling of all solution between [0..1] " << "before metric computation " << endl; cout << " -Rescaling Do rescaling of all solution between [0..1] " << "before metric computation ((default case)" << endl; cout << " -H (int) choices for computing the hessein (test)" << endl; cout << "" << endl; cout << "" << endl; cout << " Definition of some internal variable and limitation." << endl; cout << "" << endl; cout << " -v (int) Set the level of impression (verbosity) " << endl; cout << " between 0 and 10 (1 by default)." << endl; cout << " -nbv (int) Set the maximal of vertices (" << nbvx << " by default)." << endl; cout << "" << endl; cout << "" << endl; cout << " To interpoled a solution form background mesh to generated " << endl; cout << " mesh (in case of adpatation)" << endl; cout << "" << endl; cout << " -rbb filename Read solution file defined on the background " << endl; cout << " mesh for interpolation on created mesh." << endl; cout << " bb file. (by default the -Mbb filename)" << endl; cout << " -wbb filename Write the file of interpolation of the solutions" << endl; cout << " read with -rbb argument. " << endl; cout << " bb file." << endl; cout << " -rBB filename same -rbb but with BB file "; cout << " -wBB filename same -wbb but with BB file "; cout << "" << endl; cout << " Output mesh file for adpation or generation." << endl; cout << " Remark: one of output mesh file is require " << endl; cout << endl; cout << " -o filename Create a DB Mesh file." << endl; cout << " -oamdba filename Create a amdba file." << endl; cout << " -oftq filename Create a ftq file." << endl; cout << " -omsh filename Create a msh file (freefem3 file)." << endl; cout << " -oam_fmt filename Create a am_fmt file. " << endl; cout << " -oam filename Create a am file. " << endl; cout << " -onopo filename Create a nopo file. " << endl; cout << " -oM filename Create a metric file. " << endl; cout << endl; cout << endl; cout << " -thetaquad (double) minimal angle of a quadrangle " << endl; cout << " -2q split triangles in 3 quad and quad in 4 quad " << endl; cout << " -2 split triangles in 4 trai and quad in 4 quad " << endl; cout << endl; cout << " Remark: if no argument is given when the arguments are read in "< boundmaxsubdiv || maxsubdiv <= 1.0) { cerr << " -maxsubdiv " << maxsubdiv << " is not in ]1,"<< boundmaxsubdiv << "]" << endl; exit(3); } if (iso) anisomax=1; if (!(fmetrix||fMbb)) NbSmooth=0; // no metric -> no smoothing if( ! rbb) // to set the rbb filename by default rbb=fMbb; if( ! rBB) // to set the rbb filename by default rBB=fMBB; if (fMbb && rbb) rbbeqMbb = !strcmp(rbb,fMbb); if (fMBB && rBB) rBBeqMBB = !strcmp(rBB,fMBB); #ifdef DRAWING if(initgraphique) { initgraphique(); initgraph=1; withrgraphique=0; } #endif if (verbosity) cout << bamgversion <<" : "; if (verbosity) if (fgeom && fileout) cout << " Construction of a mesh from the geometry : " << fgeom << endl << " with less than " << nbvx << " vertices " << endl; else if(fmeshback && fileout) if (NoMeshReconstruction) cout << " Modification of a adpated mesh " << fmeshback << " with less than " << nbvx << " vertices" << endl; else cout << " Construction of a adpated mesh from the background mesh: " << fmeshback << " with less than " << nbvx << " vertices" << endl; else if (fmeshback && foM) cout << " Construction of the metric file on the background mesh: " << fmeshback << endl; if (fgeom && fileout) { if (verbosity) cout << " Construction of a mesh from the geometry : " << fgeom << endl << " with less than " << nbvx << " vertices " << endl; time0 = CPUtime(); Geometry Gh(fgeom); hmin = Max(hmin,Gh.MinimalHmin()); hmax = Min(hmax,Gh.MaximalHmax()); if(fmetrix) Gh.ReadMetric(fmetrix,hmin,hmax,coef); else { Int4 iv; for(iv=0;iv3) cout << " Cpu for read the geometry " << time1-time0 << "s" << endl; Triangles Th(nbvx,Gh); if(costheta<=1) Th.MakeQuadrangles(costheta); if (allquad) Th.SplitElement(allquad==2); if(SplitEdgeWith2Boundary) Th.SplitInternalEdgeWithBorderVertices(); Th.ReNumberingTheTriangleBySubDomain(); time2 = CPUtime(); if(verbosity>3) Th.ShowHistogram(); if(NbSmooth>0) Th.SmoothingVertex(NbSmooth,omega); if(verbosity>3 && NbSmooth>0) Th.ShowHistogram(); #ifdef DRAWING if(initgraph) { Th.InitDraw(); Th.Draw(); Th.inquire(); } #endif time3 = CPUtime(); if(verbosity> 1) cout << " Cpu for meshing :" << setw(8) << time2-time1 << "s, for Smoothing " << time3-time2 << "s Nb Vertices/s = " << (Th.nbv) /(time2-time1) << setw(0) <0) { cout << " Cpu for meshing with io :" << setw(8) <2) cout << " -- write Metric file " << foM <Gh,Thb,nbvx) // copy the mesh + free space to modification : new Triangles(nbvx,BTh,KeepBackVertices) // construct a new mesh )); if (Thr != &BTh) delete Thr; if(costheta<=1.0) Th.MakeQuadrangles(costheta); if (allquad) Th.SplitElement(allquad==2); if(SplitEdgeWith2Boundary) Th.SplitInternalEdgeWithBorderVertices(); Th.ReNumberingTheTriangleBySubDomain(); time3 = CPUtime(); if(verbosity>0) cout << " Cpu time for meshing : " << time3-time2 << "s Nb Vertices/s = " << (Th.nbv) /(time3-time2) << endl; if(verbosity>3) Th.ShowHistogram(); if(NbSmooth>0) Th.SmoothingVertex(NbSmooth,omega); if(verbosity>3 && NbSmooth>0) Th.ShowHistogram(); #ifdef DRAWING if(initgraph) { Th.InitDraw(); Th.Draw(); Th.inquire(); } #endif Th.BTh.ReMakeTriangleContainingTheVertex(); if (fmeshout) Th.Write(fmeshout ,Triangles::BDMesh); if (famfmt) Th.Write(famfmt ,Triangles::am_fmtMesh); if (fam) Th.Write(fam ,Triangles::amMesh); if (famdba) Th.Write(famdba ,Triangles::amdbaMesh); if (fftq) Th.Write(fftq ,Triangles::ftqMesh); if (fmsh) Th.Write(fmsh ,Triangles::mshMesh); if (fnopo) Th.Write(fnopo ,Triangles::NOPOMesh); if ( ( rbb && wbb) ||( rBB && wBB)) // the code for interpolation { if(verbosity >1) { if (rbb ) cout << " -- interpolation P1 files : " << rbb << " -> " << wbb < " << wBB <precision(15); //if(fbb) fbb->precision(15); for(i=0;i0) { // internal point a[0]= (Real8) dete[0]/ tb.det; a[1]= (Real8) dete[1] / tb.det; a[2] = (Real8) dete[2] / tb.det; i0=Th.BTh.Number(tb[0]); i1=Th.BTh.Number(tb[1]); i2=Th.BTh.Number(tb[2]);} else { double aa,bb; TriangleAdjacent ta=CloseBoundaryEdge(I,&tb,aa,bb).Adj(); int k = ta; Triangle & tc = *(Triangle *)ta; i0=Th.BTh.Number(tc[0]); i1=Th.BTh.Number(tc[1]); i2=Th.BTh.Number(tc[2]); a[VerticesOfTriangularEdge[k][1]] =aa; a[VerticesOfTriangularEdge[k][0]] = bb; a[OppositeVertex[k]] = 1- aa -bb;} Int4 ibb0 = nbfieldbb*i0; Int4 ibb1 = nbfieldbb*i1; Int4 ibb2 = nbfieldbb*i2; Int4 iBB0 = nbfieldBB*i0; Int4 iBB1 = nbfieldBB*i1; Int4 iBB2 = nbfieldBB*i2; Int4 j=0; for ( j=0;j0) cout << " Cpu time for interpolation " << time04-time00 << " s" <0) { cout << " Cpu time for meshing with io : " << time4-time0 << "s Nb Vertices/s = " << Th.nbv/(time4-time0) << endl << " Nb vertices = " << Th.nbv; if (Th.nbt-Th.NbOutT-Th.NbOfQuad*2) cout << " Nb Triangles = " << (Th.nbt-Th.NbOutT-Th.NbOfQuad*2); if (Th.NbOfQuad ) cout << " Nb Quadrilaterals = " << Th.NbOfQuad ; cout << endl; } #ifdef DRAWING if(initgraph) { reffecran(); Th.InitDraw(); Th.Draw(); Th.inquire(); } #endif // cout << "delete &Th " ; delete &Th; //cout << " end " << endl; } }// if (fgeom && fmeshout) // clean the for(i=1;i #include #include #include #include #include #include "Meshio.h" #include "Mesh2.h" #include "QuadTree.h" using namespace std; using namespace bamg; //long verbosity=2; #ifdef DRAWING bool withrgraphique= initgraphique; #else bool withrgraphique=false; #endif #ifdef HAVE_UNISTD_H #include #else #ifdef __MWERKS__ #define R_OK 0 #define F_OK 0 #define W_OK 0 #include inline int access( char *fileName, int notUsed ) { struct stat statRec; return stat( fileName, &statRec ); } #endif #ifdef PURE_WIN32 #define R_OK 0 #define F_OK 0 #define W_OK 0 #define access(i,j) 1 #endif #endif int initgraph=0; void NewHandler(); void NewHandler() { cerr << " Not enought memory " << endl; exit(1); } void MeshErrorIO(ios& ) { MeshError(999); exit(1); } int main(int argc, char **argv) { Real8 cutoffradian = 30.0*Pi/180.0; char * fin=0,*fout=0,*fgeom=0; verbosity = 2; int ok=0,i=0; if (argc >= 3) { fin=argv[1]; fout=argv[2]; ok= !access(fin,R_OK) && (access(fout,F_OK) || !access(fout,W_OK)) ; } for (i=3;i no message, 99 to much \n"; cout << endl; cout << " remark: "; cout << " the type of OutMesh is defined with the suffix\n"; cout << " si the suffixe is not in .am_fmt .amdba .am .nopo .msh .ftq, then \n"; cout << " the mesh is a bd mesh (cf .mesh)" << endl; return 1; } MeshIstreamErrorHandler = MeshErrorIO; set_new_handler( &NewHandler); #ifdef DRAWING if(initgraphique) { initgraphique(); initgraph=1; } #endif // cout << "open file in " << fin<< endl; Triangles Th(fin,cutoffradian); if (!fgeom) ((void ) 0); // Th.Write( (const char *) fout); else { // cout << " geom " << fgeom << endl; Th.Gh.Write(fgeom); Th.Write(fout,Triangles::BDMesh); } return 0; } freefem++-3.61-1/src/bamg/Makefile.am000644 000767 000024 00000002563 13256636774 017362 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ CXXLD=$(STATICTOOL) $(CXX) bin_PROGRAMS=$(BAMGPROG) EXTRA_PROGRAMS=bamg cvmsh2 #drawbdmesh bamg_SOURCES=bamg.cpp global.cpp bamg_DEPENDENCIES=../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o cvmsh2_SOURCES=cvmsh2.cpp global.cpp cvmsh2_DEPENDENCIES=../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o #EXTRA_drawbdmesh_SOURCES= # ../Graphics/Xrgraph.cpp ../Graphics/Pcrgraph.cpp #drawbdmesh_DEPENDENCIES=../fflib/libff.a @STD_GRAPH_OBJ@ #drawbdmesh_SOURCES= drawbdmesh.cpp #drawbdmesh_LDADD = @STD_GRAPH_OBJ@ $(LDADD) @STD_LIBS@ @LIBSNOCONSOLE@ LDADD= ../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o AM_CPPFLAGS=-I$(srcdir)/../fflib -I$(srcdir)/../bamglib -I$(srcdir)/../Graphics $(HDF5_CPPFLAGS) freefem++-3.61-1/src/bamg/global.cpp000644 000767 000024 00000014416 13256636774 017272 0ustar00hechtstaff000000 000000 long verbosity=1; long mpirank =0; void ShowDebugStack(){} /* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ #include /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfUL /* constant vector a */ #define UPPER_MASK 0x80000000UL /* most significant w-r bits */ #define LOWER_MASK 0x7fffffffUL /* least significant r bits */ static unsigned long mt[N]; /* the array for the state vector */ static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializes mt[N] with a seed */ void init_genrand(unsigned long s) { mt[0]= s & 0xffffffffUL; for (mti=1; mti> 30)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ mt[mti] &= 0xffffffffUL; /* for >32 bit machines */ } } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ /* slight change for C++, 2004/2/26 */ void init_by_array(unsigned long init_key[], int key_length) { int i, j, k; init_genrand(19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key_length) j=0; } for (k=N-1; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } /* generates a random number on [0,0xffffffff]-interval */ unsigned long genrand_int32(void) { unsigned long y; static unsigned long mag01[2]={0x0UL, MATRIX_A}; /* mag01[x] = x * MATRIX_A for x=0,1 */ if (mti >= N) { /* generate N words at one time */ int kk; if (mti == N+1) /* if init_genrand() has not been called, */ init_genrand(5489UL); /* a default initial seed is used */ for (kk=0;kk> 1) ^ mag01[y & 0x1UL]; } for (;kk> 1) ^ mag01[y & 0x1UL]; } y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL]; mti = 0; } y = mt[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return y; } /* generates a random number on [0,0x7fffffff]-interval */ long genrand_int31(void) { return (long)(genrand_int32()>>1); } /* generates a random number on [0,1]-real-interval */ double genrand_real1(void) { return genrand_int32()*(1.0/4294967295.0); /* divided by 2^32-1 */ } /* generates a random number on [0,1)-real-interval */ double genrand_real2(void) { return genrand_int32()*(1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on (0,1)-real-interval */ double genrand_real3(void) { return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on [0,1) with 53-bit resolution*/ double genrand_res53(void) { unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; return(a*67108864.0+b)*(1.0/9007199254740992.0); } /* These real versions are due to Isaku Wada, 2002/01/09 added */ /* int main(void) { int i; unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4; init_by_array(init, length); printf("1000 outputs of genrand_int32()\n"); for (i=0; i<1000; i++) { printf("%10lu ", genrand_int32()); if (i%5==4) printf("\n"); } printf("\n1000 outputs of genrand_real2()\n"); for (i=0; i<1000; i++) { printf("%10.8f ", genrand_real2()); if (i%5==4) printf("\n"); } return 0; } */ freefem++-3.61-1/src/bamg/Makefile.in000644 000767 000024 00000061240 13321623167 017351 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ EXTRA_PROGRAMS = bamg$(EXEEXT) cvmsh2$(EXEEXT) subdir = src/bamg ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_bamg_OBJECTS = bamg.$(OBJEXT) global.$(OBJEXT) bamg_OBJECTS = $(am_bamg_OBJECTS) bamg_LDADD = $(LDADD) am_cvmsh2_OBJECTS = cvmsh2.$(OBJEXT) global.$(OBJEXT) cvmsh2_OBJECTS = $(am_cvmsh2_OBJECTS) cvmsh2_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(bamg_SOURCES) $(cvmsh2_SOURCES) DIST_SOURCES = $(bamg_SOURCES) $(cvmsh2_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ CXXLD = $(STATICTOOL) $(CXX) bin_PROGRAMS = $(BAMGPROG) bamg_SOURCES = bamg.cpp global.cpp bamg_DEPENDENCIES = ../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o cvmsh2_SOURCES = cvmsh2.cpp global.cpp cvmsh2_DEPENDENCIES = ../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o #EXTRA_drawbdmesh_SOURCES= # ../Graphics/Xrgraph.cpp ../Graphics/Pcrgraph.cpp #drawbdmesh_DEPENDENCIES=../fflib/libff.a @STD_GRAPH_OBJ@ #drawbdmesh_SOURCES= drawbdmesh.cpp #drawbdmesh_LDADD = @STD_GRAPH_OBJ@ $(LDADD) @STD_LIBS@ @LIBSNOCONSOLE@ LDADD = ../fflib/Mesh2.o ../fflib/MeshDraw.o ../fflib/MeshGeom.o ../fflib/MeshQuad.o ../fflib/MeshRead.o ../fflib/MeshWrite.o ../fflib/Meshio.o ../fflib/Metric.o ../fflib/QuadTree.o ../fflib/R2.o ../fflib/SetOfE4.o ../fflib/write_hdf5.o ../fflib/write_xdmf.o AM_CPPFLAGS = -I$(srcdir)/../fflib -I$(srcdir)/../bamglib -I$(srcdir)/../Graphics $(HDF5_CPPFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bamg/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/bamg/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) bamg$(EXEEXT): $(bamg_OBJECTS) $(bamg_DEPENDENCIES) $(EXTRA_bamg_DEPENDENCIES) @rm -f bamg$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(bamg_OBJECTS) $(bamg_LDADD) $(LIBS) cvmsh2$(EXEEXT): $(cvmsh2_OBJECTS) $(cvmsh2_DEPENDENCIES) $(EXTRA_cvmsh2_DEPENDENCIES) @rm -f cvmsh2$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(cvmsh2_OBJECTS) $(cvmsh2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bamg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvmsh2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) installdirs: for dir in "$(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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic 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-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 pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/fflib/lgmat.cpp000644 000767 000024 00000343520 13312446271 017273 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifdef __MWERKS__ #pragma optimization_level 0 //#pragma inline_depth(0) #endif /* #include "error.hpp" #include "RNM.hpp" #include #include #include #include #include #include #include using namespace std; #include "FESpacen.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include "MatriceCreuse_tpl.hpp" //#include "fem3.hpp" #include "MeshPoint.hpp" #include "Operator.hpp" #include "lex.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" */ #include "ff++.hpp" #include "array_resize.hpp" #include "AFunction_ext.hpp" #include "CGNL.hpp" namespace bamg { class Triangles; } namespace Fem2D { void DrawIsoT(const R2 Pt[3],const R ff[3],const RN_ & Viso); } extern const basicForEachType *aatypeknlongp; //// for compilation error with g++ 3.2.2 #include "BamgFreeFem.hpp" // Debut FH Houston -------- avril 2004 --------- // class for operator on sparse matrix // ------------------------------------ // pour le addition de matrice ----matrice creuse in french) // MatriceCreuse real class for matrix sparse // Matrice_Creuse class for matrix sparse + poiteur on FE space def // to recompute matrice in case of mesh change // list *,bool> > * is liste of // \sum_i a_i*A_i where a_i is a scalare and A_i is a sparse matrix // template list *, bool > > * to(Matrice_Creuse * M) { list *,bool> > * l=new list *,bool> >; l ->push_back(make_triplet *,bool>(1,M->A,false)); return l; } template list *, bool > > * to(Matrice_Creuse_Transpose M) { list *,bool> > * l=new list *,bool> >; l ->push_back(make_triplet *,bool>(1,M.A->A,true)); return l; } template AnyType M2L3 (Stack , const AnyType & pp) { return to(GetAny *>(pp)); } template AnyType tM2L3 (Stack , const AnyType & pp) { return to(GetAny >(pp)); } template struct Op2_ListCM: public binary_function *,list *,bool> > *> { typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef R AA; typedef Matrice_Creuse * BB; static RR f(const AA & a,const BB & b) { RR r= new list

; r ->push_back(make_triplet *>(a,b->A,false)); return r;} }; template struct Op2_ListMC: public binary_function *,R,list *,bool> > *> { typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef R AA; typedef Matrice_Creuse * BB; static RR f(const BB & b,const AA & a) { RR r= new list

; r ->push_back(make_triplet *>(a,b->A,false)); return r;} }; // ADD FH 16/02/2007 template struct Op2_ListCMt: public binary_function ,list *,bool> > *> { typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef R AA; typedef Matrice_Creuse_Transpose BB; static RR f(const AA & a,const BB & b) { RR r= new list

; r ->push_back(make_triplet *>(a,b.A->A,true)); return r;} }; template struct Op2_ListMtC: public binary_function ,R,list *,bool> > *> { typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef R AA; typedef Matrice_Creuse_Transpose BB; static RR f(const BB & b,const AA & a) { RR r= new list

; r ->push_back(make_triplet *>(a,b.A->A,true)); return r;} }; // FIN ADD 16/02/2007 template struct Op1_LCMd: public unary_function *,bool> > *, list *,bool> > * > { // - ... typedef triplet *,bool> P; typedef list

L; typedef L * RR; static RR f(const RR & l) { typedef typename list *,bool> >::iterator lci; for (lci i= l->begin();i !=l->end();++i) i->first *= R(-1); return l; } }; template struct Op2_ListCMCMadd: public binary_function *,bool> > *, list *,bool> > *, list *,bool> > * > { // ... + ... typedef triplet *,bool> P; typedef list

L; typedef L * RR; static RR f(const RR & a,const RR & b) { a->insert(a->end(),b->begin(),b->end()); delete b; return a; } }; template struct Op2_ListCMCMsub: public binary_function *,bool> > *, list *,bool> > *, list *,bool> > * > { // ... + ... typedef triplet *,bool> P; typedef list

L; typedef L * RR; static RR f(const RR & a,const RR & b) { Op1_LCMd::f(b); a->insert(a->end(),b->begin(),b->end()); delete b; return a; } }; template struct Op2_ListMCMadd: public binary_function *, list *,bool> > *, list *,bool> > * > { // M + .... typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef Matrice_Creuse * MM; static RR f(const MM & a,const RR & b) { b->push_front(make_triplet *>(R(cc),a->A,false)); return b; } }; template struct Op2_ListCMMadd: public binary_function< list *,bool> > *, Matrice_Creuse * , list *,bool> > *> { // .... + M typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef Matrice_Creuse * MM; static RR f(const RR & a,const MM & b) { a->push_back(make_triplet *,bool>(R(cc),b->A,false)); return a; } }; template struct Op2_ListMMadd: public binary_function< Matrice_Creuse *, Matrice_Creuse * , list *,bool> > *> { // M + M typedef triplet *,bool> P; typedef list

L; typedef L * RR; typedef Matrice_Creuse * MM; static RR f(const MM & a,const MM & b) { L * l=to(a); l->push_back(make_triplet *>(R(cc),b->A,false)); return l; } }; // Fin Add FH Houston -------- // for Jolivet to build restriction jan 2014 // t[int] I= restrict(VCh,VGh,IPG); // ou template class RestrictArray : public OneOperator { public: template< typename T > struct Base { typedef T B; }; template< typename T > struct Base< T* >{ typedef T B;}; typedef typename Base::B::FESpace FESpace; typedef typename FESpace::FElement FElement; // typedef FESpace FESpace; class Op : public E_F0info { public: // passe de l'info .. typedef pfes * A; Expression a,b,c,d; // if c = 0 => a,b FESpace // if c != a FESpace et b,c KN_ static const int n_name_param =0; // static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} KN_ arg(int i,Stack stack,KN_ a ) const{ return nargs[i] ? GetAny >( (*nargs[i])(stack) ): a;} public: Op(const basicAC_F0 & args,Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc),d(0) { args.SetNameParam(n_name_param,0,nargs); } /* AnyType operator()(Stack stack) const { if( verbosity>9) cout << " -- RestrictArray "<< endl; pfes * pCUh = GetAny< pfes * >((* a)(stack)); pfes * pFVh = GetAny< pfes * >((* b)(stack)); // verif same FE. KN_ ncf= GetAny< KN_ >((* c)(stack)); FESpace * pVCh = **pCUh; FESpace * pVFh = **pFVh; FESpace VCh = *pVCh; FESpace VFh = *pVFh; long neC = VCh.NbOfElements ; long neF = VFh.NbOfElements ; long ndfC = VCh.NbOfDF ; long ndfF = VFh.NbOfDF ; KN_ nc2f= ncf; KN *pnum=new KN(ndfC); KN inj=*pnum; inj = -1; // un set .. if( verbosity>9) cout<< " ne =" << neC << " " << neF << endl; for(int kc=0; kc 99) cout << kc << " " << kf << " : " <= 0 && kf < neF); ffassert( kc >= 0 && kc< neC); for(int df=0; df99) cout << dfC <<" -> "<< dfF << endl; assert(dfC >= 0 && dfC < ndfC); inj[dfC] = dfF; } } if( verbosity>9) cout << " restrict: Inject= " << inj << endl; ffassert(inj.min() != -1); //Add2StackOfPtr2FreeRC(stack,pnum); return pnum; } */ }; RestrictArray() : OneOperator( atype::Op *>(),//atype* >(), atype(), atype(), atype >()) {} E_F0 * code(const basicAC_F0 & args) const { if(args.size()!=3)CompileError("Bug in RestrictArray code nb of args != 3 ????? bizarre" ); return new Op(args,t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; // end restrict ... template< typename T > struct Base { typedef T B; }; template< typename T > struct Base< T* >{ typedef T B;}; template AnyType SetRestrict(Stack stack,Expression einj,Expression erest) { typedef typename Base::B::FESpace FESpace; typedef typename FESpace::FElement FElement; KN * pinj =GetAny*>((*einj)(stack)); const typename RestrictArray::Op * ar(dynamic_cast::Op *>(erest)); ffassert(ar); if( verbosity>9) cout << " -- RestrictArray "<< endl; pfes * pCUh = GetAny< pfes * >((* ar->a)(stack)); pfes * pFVh = GetAny< pfes * >((* ar->b)(stack)); // verif same FE. KN_ ncf= GetAny< KN_ >((* ar->c)(stack)); FESpace * pVCh = **pCUh; FESpace * pVFh = **pFVh; FESpace & VCh = *pVCh; FESpace & VFh = *pVFh; long neC = VCh.NbOfElements ; long neF = VFh.NbOfElements ; long ndfC = VCh.NbOfDF ; long ndfF = VFh.NbOfDF ; KN_ nc2f= ncf; if(INIT==0) pinj->init(ndfC); else pinj->resize(ndfC); // KN *pnum= INIT ==0 ? new KN(ndfC): pnum; KN & inj=*pinj; inj = -1; // un set .. if( verbosity>9) cout<< " ne =" << neC << " " << neF << endl; for(int kc=0; kc 99) cout << kc << " " << kf << " : " <= 0 && kf < neF); ffassert( kc >= 0 && kc< neC); for(int df=0; df99) cout << dfC <<" -> "<< dfF << endl; assert(dfC >= 0 && dfC < ndfC); inj[dfC] = dfF; } } if( verbosity>9) cout << " restrict: Inject= " << inj << endl; ffassert(inj.min() != -1); return pinj; } // Fin Add FH Houston -------- template class MatrixInterpolation : public OneOperator { public: class Op : public E_F0info { public: typedef pfes * A; Expression a,b,c,d; // if c = 0 => a,b FESpace // if c != a FESpace et b,c KN_ static const int n_name_param =5; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} KN_ arg(int i,Stack stack,KN_ a ) const{ return nargs[i] ? GetAny >( (*nargs[i])(stack) ): a;} public: Op(const basicAC_F0 & args,Expression aa,Expression bb) : a(aa),b(bb),c(0),d(0) { args.SetNameParam(n_name_param,name_param,nargs); } Op(const basicAC_F0 & args,Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc),d(0) { args.SetNameParam(n_name_param,name_param,nargs); } Op(const basicAC_F0 & args,Expression aa,Expression bb,Expression cc,Expression dd) : a(aa),b(bb),c(cc),d(dd) { args.SetNameParam(n_name_param,name_param,nargs); } }; // interpolation(Vh,Vh) MatrixInterpolation() : OneOperator(atype::Op *>(), atype(), atype()) {} // interpolation(Vh,xx,yy) // 2d MatrixInterpolation(int bidon) : OneOperator(atype::Op *>(), atype(),atype >(),atype >()) {} // interpolation(Vh,xx,yy,zz) // 3d MatrixInterpolation(int bidon,int bidon2) : OneOperator(atype::Op *>(), atype(),atype >(),atype >(),atype >()) {} E_F0 * code(const basicAC_F0 & args) const { if(args.size()==2) return new Op(args,t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); else if(args.size()==3) return new Op(args,t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); else if(args.size()==4) return new Op(args,t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[2]->CastTo(args[3]) ); else CompileError("Bug in MatrixInterpolation code nb != 2 or 3 ????? bizarre" ); return 0; } }; template<> basicAC_F0::name_and_type MatrixInterpolation::Op::name_param[]= { { "t", &typeid(bool)}, { "op", &typeid(long)}, { "inside",&typeid(bool)}, { "composante",&typeid(long)}, { "U2Vc",&typeid(KN_)} }; template<> basicAC_F0::name_and_type MatrixInterpolation::Op::name_param[]= { { "t", &typeid(bool)}, { "op", &typeid(long)}, { "inside",&typeid(bool)}, { "composante",&typeid(long)}, { "U2Vc",&typeid(KN_)} }; template class SetMatrix_Op : public E_F0mps { public: Expression a; static aType btype; static const int n_name_param =NB_NAME_PARM_MAT; // add nbiter FH 30/01/2007 11 -> 12 //add var MUMPS+autre static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; const OneOperator * precon; bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} public: SetMatrix_Op(const basicAC_F0 & args,Expression aa) : a(aa) { args.SetNameParam(n_name_param,name_param,nargs); precon = 0; // a changer if ( nargs[3]) { const Polymorphic * op= dynamic_cast(nargs[3]); assert(op); precon = op->Find("(",ArrayOfaType(atype* >(),false)); // strange bug in g++ is R become a double } } AnyType operator()(Stack stack) const ; }; template class SetMatrix : public OneOperator { public: // SetMatrix() : OneOperator(atype::Op *>(),atype *>() ) {} SetMatrix() : OneOperator(SetMatrix_Op::btype,atype *>() ) {} E_F0 * code(const basicAC_F0 & args) const { return new SetMatrix_Op(args,t[0]->CastTo(args[0])); } }; template aType SetMatrix_Op::btype=0; template basicAC_F0::name_and_type SetMatrix_Op::name_param[]= { LIST_NAME_PARM_MAT /* { "paramint",&typeid(KN)}, // Add J. Morice 02/09 { "paramdouble",&typeid(KN)}, { "paramstring",&typeid(string*)}, { "permrow",&typeid(KN_)}, { "permcol",&typeid(KN_)}, { "fileparamint",&typeid(string*)}, // Add J. Morice 02/09 { "fileparamdouble",&typeid(string*)}, { "fileparamstring",&typeid(string* )}, { "filepermrow",&typeid(string*)}, { "filepermcol",&typeid(string*)} //22 */ }; template AnyType SetMatrix_Op::operator()(Stack stack) const { Matrice_Creuse * A= GetAny *>((*a)(stack)); ffassert(A); if( !A->A) A->A.master(new MatriceMorse());// set to empty matrix .. mars 2014 FH .. Data_Sparse_Solver ds; bool VF=false; // bool factorize=false; ds.factorize=false; /* long NbSpace = 50; long itmax=0; double epsilon=1e-6; // bool VF=false; // VF=isVF(op->largs); // assert(!VF); double tgv = ff_tgv; double tol_pivot=-1; double tol_pivot_sym=-1; KN param_int; KN param_double; string *param_char=NULL; KN perm_r; KN perm_c; string *file_param_int; // Add J. Morice 02/09 string *file_param_double; string* file_param_char; string* file_param_perm_r; string* file_param_perm_c; */ // type de matrice par default TypeSolveMat tmat= TypeSolveMat::defaultvalue; if( tmat != TypeSolveMat::SparseSolver ) tmat=TypeSolveMat::GMRES; ds.typemat=&tmat; SetEnd_Data_Sparse_Solver(stack,ds,nargs,n_name_param); /* TypeSolveMat *typemat=&tmat; bool initmat=true; int strategy=0; if (nargs[0]) ds.initmat= ! GetAny((*nargs[0])(stack)); if (nargs[1]) ds.typemat= GetAny((*nargs[1])(stack)); if (nargs[2]) ds.epsilon= GetAny((*nargs[2])(stack)); // 3 precon if (nargs[4]) ds.NbSpace= GetAny((*nargs[4])(stack)); if (nargs[6]) ds.tgv= GetAny((*nargs[6])(stack)); if (nargs[7]) ds.factorize= GetAny((*nargs[7])(stack)); if (nargs[8]) ds.strategy = GetAny((*nargs[8])(stack)); if (nargs[9]) ds.tol_pivot = GetAny((*nargs[9])(stack)); if (nargs[10]) ds.tol_pivot_sym = GetAny((*nargs[10])(stack)); if (nargs[11]) ds.itmax = GetAny((*nargs[11])(stack)); // frev 2007 OK if (nargs[12]) ds.param_int= GetAny< KN >((*nargs[12])(stack)); // Add J. Morice 02/09 if (nargs[13]) ds.param_double= GetAny< KN >((*nargs[13])(stack)); if (nargs[14]) ds.param_char= GetAny< string * >((*nargs[14])(stack)); // if (nargs[15]) ds.perm_r = GetAny< KN >((*nargs[15])(stack)); if (nargs[16]) ds.perm_c = GetAny< KN >((*nargs[16])(stack)); // if (nargs[17]) ds.file_param_int= GetAny< string* >((*nargs[17])(stack)); // Add J. Morice 02/09 if (nargs[18]) ds.file_param_double= GetAny< string* >((*nargs[18])(stack)); if (nargs[19]) ds.file_param_char= GetAny< string* >((*nargs[19])(stack)); // if (nargs[20]) ds.file_param_perm_r = GetAny< string* >((*nargs[20])(stack)); if (nargs[21]) ds.file_param_perm_c = GetAny< string* >((*nargs[21])(stack)); // */ if(A->typemat.profile != ds.typemat->profile) { cerr << " type of matrix " << A->typemat< * pf = dynamic_cast *>((MatriceCreuse *) A->A); assert(pf); switch (ds.typemat->t) { case TypeSolveMat::LU: pf->LU(Abs(ds.epsilon));break; case TypeSolveMat::CROUT: pf->crout(Abs(ds.epsilon));break; case TypeSolveMat::CHOLESKY: pf->cholesky(Abs(ds.epsilon));break; default: ExecError("Sorry no factorization for this type for matrix"); } } SetSolver(stack,VF,*A->A,ds) ;/*stack,*A->A,typemat,VF,epsilon,NbSpace,itmax,precon,strategy,tgv,tol_pivot,tol_pivot_sym, param_int, param_double, param_char, perm_r, perm_c, file_param_int, file_param_double, file_param_char, file_param_perm_r, file_param_perm_c);*/ return Nothing; } bool SetDefaultSolver() { #ifdef HAVE_LIBUMFPACKXXXXXX if(verbosity>1) cout << " SetDefault sparse solver to UMFPACK" << endl; DefSparseSolver::solver =BuildSolverUMFPack; DefSparseSolver::solver =BuildSolverUMFPack; DefSparseSolverSym::solver =BuildSolverGMRES; DefSparseSolverSym::solver =BuildSolverGMRES; #else if(verbosity>1) cout << " SetDefault sparse solver to GMRES (no UMFPACK)" << endl; DefSparseSolver::solver =BuildSolverGMRES; DefSparseSolver::solver =BuildSolverGMRES; DefSparseSolverSym::solver =BuildSolverGMRES; DefSparseSolverSym::solver =BuildSolverGMRES; #endif return true; } template AnyType SetMatrixInterpolation(Stack,Expression ,Expression); template AnyType SetMatrixInterpolation3(Stack,Expression ,Expression); //------ template void BuildCombMat(map< pair, R> & mij,const KNM_ & A, int ii00=0,int jj00=0,R coef=R(1.),bool cnj=false) { double eps0=numeric_limits::min(); int i,j; int n = A.N(),m=A.M(); for ( i=0;ieps0) mij[ij_mat(false,ii00,jj00,i,j)] += cij; } } void buildInterpolationMatrix(MatriceMorse * m,const FESpace & Uh,const FESpace & Vh,void *data) { // Uh = Vh int op=op_id; // value of the function bool transpose=false; bool inside=false; int * iU2V=0; if (data) { int * idata=static_cast(data); transpose=idata[0]; op=idata[1]; inside=idata[2]; iU2V= idata + 4; ffassert(op>=0 && op < 4); } if(verbosity>2) { cout << " -- buildInterpolationMatrix transpose =" << transpose << endl << " value, dx , dy op = " << op << endl << " just inside = " << inside << endl; } using namespace Fem2D; int n=Uh.NbOfDF; int mm=Vh.NbOfDF; if(transpose) Exchange(n,mm); m->symetrique = false; m->dummy=false; m->a=0; m->lg=0; m->cl=0; m->nbcoef=0; m->n=n; m->m=mm; int n1=n+1; const Mesh & ThU =Uh.Th; // line const Mesh & ThV =Vh.Th; // colunm bool samemesh = &Uh.Th == &Vh.Th; // same Mesh int thecolor =0; // int nbn_u = Uh.NbOfNodes; //int nbn_v = Vh.NbOfNodes; int nbcoef =0; KN color(ThV.nt); KN mark(n); mark=0; int *lg = new int [n1]; int * cl = 0; double *a=0; color=thecolor++; FElement Uh0 = Uh[0]; FElement Vh0 = Vh[0]; FElement::aIPJ ipjU(Uh0.Pi_h_ipj()); FElement::aR2 PtHatU(Uh0.Pi_h_R2()); // FElement::aIPJ ipjV(Vh0.Pi_h_ipj()); // FElement::aR2 PtHatV(Vh0.Pi_h_R2()); int nbdfVK= Vh0.NbDoF(); // int nbdfUK= Uh0.NbDoF(); int NVh= Vh0.N; //int NUh= Uh0.N; //ffassert(NVh==NUh); int nbp= PtHatU.N(); // // int nbc= ipjU.N(); // KN PV(nbp); // the PtHat in ThV mesh KN itV(nbp); // the Triangle number KN intV(nbp); // ouside or not KN AipjU(ipjU.N()); KNM aaa(nbp,nbdfVK); const R eps = 1.0e-10; const int sfb1=Vh0.N*last_operatortype*Vh0.NbDoF(); KN kv(sfb1*nbp); R * v = kv; KN ik(nbp); // the Triangle number // KNMK_ fb(v+ik[i],VhV0.NbDoF,VhV0.N,1); // the value for basic fonction bool whatd[last_operatortype]; for (int i=0;i fait(Uh.NbOfDF); fait=false; map< pair , double > sij; for (int step=0;step<2;step++) { for (int it=0;it9 ) cout << it << " " << i << " :: " << TU(PtHatU[i]) << " -- "<< outside << PV[i] << " " << ThV(ts) << " -> " << (*ts)(PV[i]) < fb(v+p*sfb1,nbdfVK,NVh,last_operatortype); // valeur de fonction de base de Vh // ou: fb(idf,j,0) valeur de la j composante de la fonction idf Vh0.tfe->FB(whatd,ThV,ThV[itV[p]],PV[p],fb); } for (int i=0;i next R aipj = AipjU[i]; FElement KV(Vh[itV[p]]); int jV=jU; if(iU2V) jV=iU2V[jU]; if(jV>=0 && jV fb(v+p*sfb1,nbdfVK,NVh,last_operatortype); KN_ fbj(fb('.',jV,op)); for (int idfv=0;idfveps) { int dfv=KV(idfv); int ii=dfu, jj=dfv; if(transpose) Exchange(ii,jj); // le term dfu,dfv existe dans la matrice R c= fbj[idfv]*aipj; // cout << " Mat inter " << i << " , "<< j << " = " << c << " " <eps) // sij[make_pair(ii,jj)] += c;// correct du to periodic BC. June 2011 /* if(step==0) sij.insert(make_pair(i,j)); else (*m)(i,j)=c; */ } } } for (int df=0;df, double >::iterator kk=sij.begin();kk!=sij.end();++kk) { int i= kk->first.first; int j= kk->first.second; // cout << " Mat inter " << i << " , "<< j << endl; cl[k]=j; a[k]= kk->second; lg[i+1]=++k; } assert(k==nbcoef); // on bouche les ligne vide lg[i]=0; // lg est un tableau croissant => for(int i=1;ilg=lg; m->cl=cl; m->a=a; m->nbcoef=nbcoef; fait=false; } } sij.clear(); //assert(0); // a faire to do } void buildInterpolationMatrix(MatriceMorse * m,const FESpace3 & Uh,const FESpace3 & Vh,void *data) { // Uh = Vh typedef FESpace3::Mesh Mesh; typedef FESpace3::FElement FElement; typedef Mesh::Element Element; typedef FESpace3::Rd Rd; typedef Element::RdHat RdHat; int op=op_id; // value of the function bool transpose=false; bool inside=false; int * iU2V=0; if (data) { int * idata=static_cast(data); transpose=idata[0]; op=idata[1]; inside=idata[2]; iU2V= idata + 4; ffassert(op>=0 && op < 4); } if(verbosity>2) { cout << " -- buildInterpolationMatrix transpose =" << transpose << endl << " value, dx , dy op = " << op << endl << " just inside = " << inside << endl; } using namespace Fem2D; int n=Uh.NbOfDF; int mm=Vh.NbOfDF; if(transpose) Exchange(n,mm); m->symetrique = false; m->dummy=false; m->a=0; m->lg=0; m->cl=0; m->nbcoef=0; m->n=n; m->m=mm; int n1=n+1; const Mesh & ThU =Uh.Th; // line const Mesh & ThV =Vh.Th; // colunm bool samemesh = &Uh.Th == &Vh.Th; // same Mesh int thecolor =0; // int nbn_u = Uh.NbOfNodes; //int nbn_v = Vh.NbOfNodes; int nbcoef =0; KN color(ThV.nt); KN mark(n); mark=0; int *lg = new int [n1]; int * cl = 0; double *a=0; color=thecolor++; FElement Uh0 = Uh[0]; FElement Vh0 = Vh[0]; // FElement::aIPJ ipjU(Uh0.Pi_h_ipj()); // FElement::aR2 PtHatU(Uh0.Pi_h_R2()); // FElement::aIPJ ipjV(Vh0.Pi_h_ipj()); // FElement::aR2 PtHatV(Vh0.Pi_h_R2()); int nbdfVK= Vh0.NbDoF(); // int nbdfUK= Uh0.NbDoF(); int NVh= Vh0.N; // int NUh= Uh0.N; //ffassert(NVh==NUh); InterpolationMatrix ipmat(Uh); int nbp=ipmat.np; // // int nbc= ipjU.N(); // KN PV(nbp); // the PtHat in ThV mesh KN itV(nbp); // the Triangle number KN intV(nbp); // ouside or not // KN AipjU(ipjU.N()); KNM aaa(nbp,nbdfVK); const R eps = 1.0e-10; const int sfb1=Vh0.N*last_operatortype*Vh0.NbDoF(); KN kv(sfb1*nbp); R * v = kv; KN ik(nbp); // the Triangle number // KNMK_ fb(v+ik[i],VhV0.NbDoF,VhV0.N,1); // the value for basic fonction op= op==3 ? op_dz : op; // renumber op ???? dec 2010 FH. What_d whatd= 1<< op; KN fait(Uh.NbOfDF); fait=false; map< pair , double > sij; for (int step=0;step<2;step++) { for (int it=0;it9 ) cout << it << " " << i << " :: " << TU(ipmat.P[i]) << " -- "<< outside << PV[i] << " " << ThV(ts) << " -> " << (*ts)(PV[i]) < fb(v+p*sfb1,nbdfVK,NVh,last_operatortype); // valeur de fonction de base de Vh // ou: fb(idf,j,0) valeur de la j composante de la fonction idf Vh0.tfe->FB(whatd,ThV,ThV[itV[p]],PV[p],fb); } for (int i=0;i next R aipj = ipmat.coef[i]; FElement KV(Vh[itV[p]]); int jV=jU; if(iU2V) jV=iU2V[jU]; if(jV>=0 && jV fb(v+p*sfb1,nbdfVK,NVh,last_operatortype); KN_ fbj(fb('.',jV,op)); for (int idfv=0;idfveps) { int dfv=KV(idfv); int ii=dfu, jj=dfv; if(transpose) Exchange(ii,jj); // le term dfu,dfv existe dans la matrice R c= fbj[idfv]*aipj; // cout << " Mat inter " << i << " , "<< j << " = " << c << " " <eps) // sij[make_pair(ii,jj)] += c;// correct du to periodic BC. June 2011 /* if(step==0) sij.insert(make_pair(i,j)); else (*m)(i,j)=c; */ } } } for (int df=0;df, double >::iterator kk=sij.begin();kk!=sij.end();++kk) { int i= kk->first.first; int j= kk->first.second; // cout << " Mat inter " << i << " , "<< j << endl; cl[k]=j; a[k]= kk->second; lg[i+1]=++k; } assert(k==nbcoef); // on bouche les ligne vide lg[i]=0; // lg est un tableau croissant => for(int i=1;ilg=lg; m->cl=cl; m->a=a; m->nbcoef=nbcoef; fait=false; } } sij.clear(); //assert(0); // a faire to do } MatriceMorse * buildInterpolationMatrix1(const FESpace & Uh,const KN_ & xx,const KN_ & yy ,int *data) { // Uh = Vh int op=op_id; // value of the function int icomp=0; bool transpose=false; bool inside=false; if (data) { transpose=data[0]; op=data[1]; inside=data[2]; icomp = data[3]; ffassert(op>=0 && op < 4); } if(verbosity>2) { cout << " -- buildInterpolationMatrix transpose =" << transpose << endl << " value, dx , dy op = " << op << endl << " composante = " << icomp << endl << " just inside = " << inside << endl; } using namespace Fem2D; int n=Uh.NbOfDF; int mm=xx.N(); int nbxx= mm; if(transpose) Exchange(n,mm); const Mesh & ThU =Uh.Th; // line FElement Uh0 = Uh[0]; int nbdfUK= Uh0.NbDoF(); int NUh= Uh0.N; ffassert(icomp < NUh && icomp >=0); const int sfb1=Uh0.N*last_operatortype*Uh0.NbDoF(); KN kv(sfb1); R * v = kv; const R eps = 1.0e-10; bool whatd[last_operatortype]; for (int i=0;i fait(Uh.NbOfDF); fait=false; map< pair , double > sij; R2 Phat; bool outside; for(int ii=0;ii fb(v,nbdfUK,NUh,last_operatortype); Uh0.tfe->FB(whatd,ThU,ThU[it],Phat,fb); KN_ Fwi(fb('.',icomp,op)); for (int idfu=0;idfueps) sij[make_pair(i,j)] += c;// correct du to periodic BC. June 2011 } } MatriceMorse * m = new MatriceMorse(n,mm,sij,false); sij.clear(); return m; //assert(0); // a faire to do } MatriceMorse * buildInterpolationMatrix1(const FESpace3 & Uh,const KN_ & xx,const KN_ & yy ,const KN_ & zz,int *data) { // Uh = Vh typedef FESpace3::Mesh Mesh; typedef FESpace3::FElement FElement; typedef Mesh::Element Element; typedef FESpace3::Rd Rd; int op=op_id; // value of the function int icomp=0; bool transpose=false; bool inside=false; if (data) { transpose=data[0]; op=data[1]; inside=data[2]; icomp = data[3]; ffassert(op>=0 && op < 4); if(op==3) op=op_dz;// correct missing } if(verbosity>2) { cout << " -- buildInterpolationMatrix transpose =" << transpose << endl << " value, dx , dy op = " << op << endl << " composante = " << icomp << endl << " just inside = " << inside << endl; } using namespace Fem2D; int n=Uh.NbOfDF; int mm=xx.N(); int nbxx= mm; if(transpose) Exchange(n,mm); const Mesh & ThU =Uh.Th; // line FElement Uh0 = Uh[0]; int nbdfUK= Uh0.NbDoF(); int NUh= Uh0.N; ffassert(icomp < NUh && icomp >=0); const int sfb1=Uh0.N*last_operatortype*Uh0.NbDoF(); KN kv(sfb1); R * v = kv; const R eps = 1.0e-10; What_d whatd= 1 < fait(Uh.NbOfDF); fait=false; map< pair , double > sij; Rd Phat; bool outside; for(int ii=0;ii fb(v,nbdfUK,NUh,last_operatortype); Uh0.tfe->FB(whatd,ThU,ThU[it],Phat,fb); KN_ Fwi(fb('.',icomp,op)); for (int idfu=0;idfueps) sij[make_pair(i,j)] += c;// correct du to periodic BC. June 2011 } } MatriceMorse * m = new MatriceMorse(n,mm,sij,false); sij.clear(); return m; //assert(0); // a faire to do } AnyType SetMatrixInterpolation1(Stack stack,Expression emat,Expression einter,int init) { using namespace Fem2D; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); const MatrixInterpolation::Op * mi(dynamic_cast::Op *>(einter)); ffassert(einter); pfes * pUh = GetAny< pfes * >((* mi->a)(stack)); FESpace * Uh = **pUh; int NUh =Uh->N; int* data = new int[4 + NUh]; data[0]=mi->arg(0,stack,false); // transpose not data[1]=mi->arg(1,stack,(long) op_id); ; // get just value data[2]=mi->arg(2,stack,false); ; // get just value data[3]=mi->arg(3,stack,0L); ; // get just value KN U2Vc; U2Vc= mi->arg(4,stack,U2Vc); ; if( mi->c==0) { // old cas pfes * pVh = GetAny< pfes * >((* mi->b)(stack)); FESpace * Vh = **pVh; int NVh =Vh->N; for(int i=0;i3) for(int i=0;i " << data[4+i] << " Componante of Vh " <=NVh) { cout << "The Uh componante " << i << " -> " << data[4+i] << " >= " << NVh << " number of Vh Componante " <pUh=pUh; //sparse_mat->pVh=pVh; if(!init) sparse_mat->init(); sparse_mat->typemat=TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) sparse_mat->A.master(new MatriceMorse(*Uh,*Vh,buildInterpolationMatrix,data)); // sparse_mat->A.master(new MatriceMorse(*Uh,*Vh,buildInterpolationMatrix,data)); } else { // new cas mars 2006 KN_ xx = GetAny< KN_ >((* mi->b)(stack)); KN_ yy = GetAny< KN_ >((* mi->c)(stack)); ffassert( xx.N() == yy.N()); ffassert(Uh); // sparse_mat->pUh=0; // sparse_mat->pVh=0; if(!init) sparse_mat->init(); sparse_mat->typemat=TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) sparse_mat->A.master(buildInterpolationMatrix1(*Uh,xx,yy,data)); } delete [] data; return sparse_mat; // Warning .. no correct gestion of temp ptr .. // return Add2StackOfPtr2Free(stack,sparse_mat); } AnyType SetMatrixInterpolation31(Stack stack,Expression emat,Expression einter,int init) { using namespace Fem2D; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); const MatrixInterpolation::Op * mi(dynamic_cast::Op *>(einter)); ffassert(einter); pfes3 * pUh = GetAny< pfes3 * >((* mi->a)(stack)); FESpace3 * Uh = **pUh; int NUh =Uh->N; int* data = new int[4 + NUh]; data[0]=mi->arg(0,stack,false); // transpose not data[1]=mi->arg(1,stack,(long) op_id); ; // get just value data[2]=mi->arg(2,stack,false); ; // get just value data[3]=mi->arg(3,stack,0L); ; // get just value KN U2Vc; U2Vc= mi->arg(4,stack,U2Vc); ; if( mi->c==0) { // old cas pfes3 * pVh = GetAny< pfes3 * >((* mi->b)(stack)); FESpace3 * Vh = **pVh; int NVh =Vh->N; for(int i=0;i3) for(int i=0;i " << data[4+i] << " Componante of Vh " <=NVh) { cout << "The Uh componante " << i << " -> " << data[4+i] << " >= " << NVh << " number of Vh Componante " <init(); // sparse_mat->pUh=pUh; //sparse_mat->pVh=pVh; sparse_mat->typemat=TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) sparse_mat->A.master(new MatriceMorse(*Uh,*Vh,buildInterpolationMatrix,data)); // sparse_mat->A.master(new MatriceMorse(*Uh,*Vh,buildInterpolationMatrix,data)); } else { // new cas mars 2006 KN_ xx = GetAny< KN_ >((* mi->b)(stack)); KN_ yy = GetAny< KN_ >((* mi->c)(stack)); KN_ zz = GetAny< KN_ >((* mi->d)(stack)); ffassert( xx.N() == yy.N()); ffassert( xx.N() == zz.N()); ffassert(Uh); if(!init) sparse_mat->init(); // sparse_mat->pUh=0; // sparse_mat->pVh=0; sparse_mat->typemat=TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) sparse_mat->A.master(buildInterpolationMatrix1(*Uh,xx,yy,zz,data)); } delete [] data; return sparse_mat; } template AnyType SetMatrixInterpolation(Stack stack,Expression emat,Expression einter) { return SetMatrixInterpolation1(stack,emat,einter,init);} template AnyType SetMatrixInterpolation3(Stack stack,Expression emat,Expression einter) { return SetMatrixInterpolation31(stack,emat,einter,init);} template AnyType ProdMat(Stack stack,Expression emat,Expression prodmat) { using namespace Fem2D; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); const Matrix_Prod AB = GetAny >((*prodmat)(stack)); // sparse_mat->pUh=AB.A->pUh; //sparse_mat->pVh=AB.B->pVh; MatriceMorse *mA= AB.A->A->toMatriceMorse(AB.ta); MatriceMorse *mB= AB.B->A->toMatriceMorse(AB.tb); if( !mA && ! mB) ExecError(" Sorry error: in MatProd, pb trans in MorseMat"); if( mA->m != mB->n) { cerr << " -- Error dim ProdMat A*B : tA =" << AB.ta << " = tB " << AB.tb << endl; cerr << " --MatProd " << mA->n<< " "<< mA->m << " x " << mB->n<< " "<< mB->m << endl; ExecError(" Wrong mat dim in MatProd"); } MatriceMorse *mAB=new MatriceMorse(); mA->prod(*mB,*mAB); if(!init) sparse_mat->init(); sparse_mat->typemat=(mA->n == mB->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) sparse_mat->A.master(mAB); delete mA; delete mB; return sparse_mat; } template AnyType CombMat(Stack stack,Expression emat,Expression combMat) { using namespace Fem2D; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); list *,bool> > * lcB = GetAny *,bool> >*>((*combMat)(stack)); // sparse_mat->pUh=0; // sparse_mat->pVh=0; MatriceCreuse * AA=BuildCombMat(*lcB,false,0,0); if(!init) sparse_mat->init(); sparse_mat->A.master(AA); sparse_mat->typemat=(AA->n == AA->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) delete lcB; return sparse_mat; } template AnyType MatriceCreuse2map(Stack , const AnyType & mat) { using namespace Fem2D; Matrice_Creuse * sparse_mat =GetAny* >(mat); ffassert(sparse_mat); int n=sparse_mat->N(),m=sparse_mat->M(); map,R> *M=new map,R>; if (n >0 && m>0 && sparse_mat->A) { sparse_mat->A->addMatTo(R(1.),*M); // hack (*M)[make_pair(n-1,m-1)]+=R(); } return M; } template AnyType DiagMat(Stack stack,Expression emat,Expression edia) { using namespace Fem2D; KN * diag=GetAny* >((*edia)(stack)); Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); // sparse_mat->pUh=0; // sparse_mat->pVh=0; if(!init) sparse_mat->init(); sparse_mat->typemat=TypeSolveMat(TypeSolveMat::GC); // none square matrice (morse) sparse_mat->A.master(new MatriceMorse((int) diag->N(),(const R*) *diag)); return sparse_mat; } template struct ChangeMatriceMorse { static MatriceMorse *f(MatriceMorse *mr) { MatriceMorse* mrr=new MatriceMorse(*mr); delete mr; return mrr; } }; template struct ChangeMatriceMorse { static MatriceMorse* f(MatriceMorse* mr) { return mr; } }; template AnyType CopyMat_tt(Stack stack,Expression emat,Expression eA,bool transp) { using namespace Fem2D; Matrice_Creuse * Mat; if(transp) { Matrice_Creuse_Transpose tMat=GetAny >((*eA)(stack)); Mat=tMat; } else Mat =GetAny*>((*eA)(stack)); MatriceMorse * mr=Mat->A->toMatriceMorse(transp,false); MatriceMorse * mrr = ChangeMatriceMorse::f(mr); Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); // sparse_mat->pUh=Mat->pUh; // sparse_mat->pVh=Mat->pUh;; // cout << " CopyMat_tt " << init << " "<init() ; sparse_mat->typemat=TypeSolveMat(TypeSolveMat::GC); // none square matrice (morse) sparse_mat->A.master(mrr); //delete mr; return sparse_mat; } template AnyType CopyTrans(Stack stack,Expression emat,Expression eA) { return CopyMat_tt(stack,emat,eA,true); } template AnyType CopyMat(Stack stack,Expression emat,Expression eA) { return CopyMat_tt(stack,emat,eA,false); } template AnyType MatFull2Sparse(Stack stack,Expression emat,Expression eA) { KNM * A=GetAny* >((*eA)(stack)); Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); // sparse_mat->pUh=0; // sparse_mat->pVh=0; if(!init) sparse_mat->init() ; sparse_mat->typemat=TypeSolveMat(TypeSolveMat::GMRES); // none square matrice (morse) sparse_mat->A.master(new MatriceMorse((KNM_ &)*A,0.0)); return sparse_mat; } template AnyType MatMap2Sparse(Stack stack,Expression emat,Expression eA) { map< pair, R> * A=GetAny< map< pair, R> * >((*eA)(stack)); int n=0,m=0; // hack: the last element must exist in the map to set matrix size typename map< pair, R>::const_iterator last= --A->end(); // le last element if( last != A->end() ) { n = last->first.first+1; m=last->first.second+1; } Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); if(!init) sparse_mat->init() ; // sparse_mat->pUh=0; // sparse_mat->pVh=0; sparse_mat->typemat=TypeSolveMat(TypeSolveMat::GMRES); // none square matrice (morse) sparse_mat->A.master(new MatriceMorse(n,m,*A,false)); delete A; return sparse_mat; } template struct Op2_pair: public binary_function { static RR f(const AA & a,const BB & b) { return RR( a, b);} }; template long get_mat_n(Matrice_Creuse * p) { ffassert(p ) ; return p->A ?p->A->n: 0 ;} template long get_mat_m(Matrice_Creuse * p) { ffassert(p ) ; return p->A ?p->A->m: 0 ;} template long get_mat_nbcoef(Matrice_Creuse * p) { ffassert(p ) ; return p->A ?p->A->NbCoef(): 0 ;} template pair get_NM(const list *,bool> > & lM) { typedef typename list *,bool> >::const_iterator lconst_iterator; lconst_iterator begin=lM.begin(); lconst_iterator end=lM.end(); lconst_iterator i; long n=0,m=0; for(i=begin;i!=end;i++++) { ffassert(i->second); MatriceCreuse & M=*i->second; bool t=i->third; int nn= M.n,mm=M.m; if (t) swap(nn,mm); if ( n==0) n = nn; if ( m==0) m = mm; if (n != 0) ffassert(nn == n); if (m != 0) ffassert(mm == m); } return make_pair(n,m); } template long get_diag(Matrice_Creuse * p, KN * x) { ffassert(p && x ) ; return p->A ?p->A->getdiag(*x): 0 ;} template long set_diag(Matrice_Creuse * p, KN * x) { ffassert(p && x ) ; return p->A ?p->A->setdiag(*x): 0 ;} template R * get_elementp2mc(Matrice_Creuse * const & ac,const long & b,const long & c){ MatriceCreuse * a= ac ? ac->A:0 ; if( !a || a->n <= b || c<0 || a->m <= c ) { cerr << " Out of bound 0 <=" << b << " < " << a->n << ", 0 <= " << c << " < " << a->m << " Matrix type = " << typeid(ac).name() << endl; cerr << ac << " " << a << endl; ExecError("Out of bound in operator Matrice_Creuse (,)");} R * p =a->pij(b,c); if( !p) { if(verbosity) cerr << "Error: the coef a(" << b << "," << c << ") do'nt exist in sparse matrix " << " Matrix type = " << typeid(ac).name() << endl; ExecError("Use of unexisting coef in sparse matrix operator a(i,j) ");} return p;} template R get_element2mc(Matrice_Creuse * const & ac,const long & b,const long & c){ MatriceCreuse * a= ac ? ac->A:0 ; R r=R(); if( !a || a->n <= b || c<0 || a->m <= c ) { cerr << " Out of bound 0 <=" << b << " < " << a->n << ", 0 <= " << c << " < " << a->m << " Matrix type = " << typeid(ac).name() << endl; cerr << ac << " " << a << endl; ExecError("Out of bound in operator Matrice_Creuse (,)");} R * p =a->pij(b,c); if(p) r=*p; return r;} template struct Op2_mulAv: public binary_function { static RR f(const AA & a,const BB & b) { return (*a->A * *b );} }; template struct Op2_mulvirtAv: public binary_function { static RR f(const AA & a,const BB & b) { return RR( (*a).A, b );} }; class Matrice_Creuse_C2R { public: typedef Complex K; Matrice_Creuse * A; int cas; // 0 re , 1 im Matrice_Creuse_C2R(Matrice_Creuse * AA,int cass) : A(AA),cas(cass) {assert(A);} operator MatriceCreuse & () const {return *A->A;} operator Matrice_Creuse * () const {return A;} }; template Matrice_Creuse_C2R Build_Matrice_Creuse_C2R(Matrice_Creuse * pAA) { return Matrice_Creuse_C2R(pAA,cas); } template class OneBinaryOperatorA_inv : public OneOperator { public: OneBinaryOperatorA_inv() : OneOperator(atype >(),atype *>(),atype()) {} E_F0 * code(const basicAC_F0 & args) const { Expression p=args[1]; if ( ! p->EvaluableWithOutStack() ) { bool bb=p->EvaluableWithOutStack(); cout << bb << " " << * p << endl; CompileError(" A^p, The p must be a constant == -1, sorry");} long pv = GetAny((*p)(NullStack)); if (pv !=-1) { char buf[100]; sprintf(buf," A^%ld, The pow must be == -1, sorry",pv); CompileError(buf);} return new E_F_F0,Matrice_Creuse *>(Build,Matrice_Creuse *>,t[0]->CastTo(args[0])); } }; template class Psor : public E_F0 { public: typedef double Result; Expression mat; Expression xx,gmn,gmx,oomega; Psor(const basicAC_F0 & args) { args.SetNameParam(); mat=to *>(args[0]); gmn=to*>(args[1]); gmx=to*>(args[2]); xx=to*>(args[3]); oomega=to(args[4]); } static ArrayOfaType typeargs() { return ArrayOfaType( atype(), atype *>(), atype*>(), atype*>(), atype*>(), atype(),false);} static E_F0 * f(const basicAC_F0 & args){ return new Psor(args);} AnyType operator()(Stack s) const { Matrice_Creuse* A= GetAny* >( (*mat)(s) ); KN* gmin = GetAny* >( (*gmn)(s) ); KN* gmax = GetAny* >( (*gmx)(s) ); KN* x = GetAny* >( (*xx)(s) ); double omega = GetAny((*oomega)(s)); return A->A->psor(*gmin,*gmax,*x,omega); } }; template struct TheDiagMat { Matrice_Creuse * A; TheDiagMat(Matrice_Creuse * AA) :A(AA) {ffassert(A);} void get_mat_daig( KN_ & x) { ffassert(A && A->A && x.N() == A->A->n && A->A->n == A->A->m ); A->A->getdiag(x);} void init_get_mat_daig( KN & x) { ffassert(A && A->A && A->A->n == A->A->m ); x.init(A->A->n); A->A->getdiag(x);} void set_mat_daig(const KN_ & x) { ffassert(A && A->A && x.N() == A->A->n && A->A->n == A->A->m ); A->A->setdiag(x);} }; template struct TheCoefMat { Matrice_Creuse * A; TheCoefMat(Matrice_Creuse * AA) :A(AA) {ffassert(A);} void get_mat_coef( KN_ & x) { ffassert(A && A->A && x.N() == A->A->NbCoef() ); A->A->getcoef(x);} void set_mat_coef(const KN_ & x) { ffassert(A && A->A && x.N() == A->A->NbCoef() ); A->A->setcoef(x);} R trace() { return A->A->trace(); } }; template R get_trace_mat(Matrice_Creuse * p) { return p ? p->A->trace():0.; } template TheDiagMat thediag(Matrice_Creuse * p) { return TheDiagMat(p);} template TheCoefMat thecoef(Matrice_Creuse * p) { return TheCoefMat(p);} template TheDiagMat set_mat_daig(TheDiagMat dm,KN * x) { dm.set_mat_daig(*x); return dm; } template KN * get_mat_daig(KN * x,TheDiagMat dm) { dm.get_mat_daig(*x); return x; } template KN * init_get_mat_daig(KN * x,TheDiagMat dm) { dm.init_get_mat_daig(*x); return x; } template TheCoefMat set_mat_coef(TheCoefMat dm,KN * x) { dm.set_mat_coef(*x); return dm; } template KN * get_mat_coef(KN * x,TheCoefMat dm) { dm.get_mat_coef(*x); return x; } template bool IsRawMat(const basicAC_F0 & args) { const E_Array * pee= dynamic_cast((Expression) args[1]); if (!pee) return 0; const E_Array &ee=*pee; int N=ee.size(); if (N==1) { C_F0 c0(ee[0]); return atype >()->CastingFrom(ee[0].left()); } else if (N==3) { C_F0 c0(ee[0]),c1(ee[1]),c2(ee[2]); return atype >()->CastingFrom(ee[0].left()) && atype >()->CastingFrom(ee[1].left()) && atype >()->CastingFrom(ee[2].left()); } return 0; } template class RawMatrix : public E_F0 { public: int init; typedef Matrice_Creuse * Result; Expression emat; Expression coef,col,lig; RawMatrix(const basicAC_F0 & args,int initt) ; static ArrayOfaType typeargs() { return ArrayOfaType(atype*>(),atype());} AnyType operator()(Stack s) const ; }; template class BlockMatrix : public E_F0 { public: typedef Matrice_Creuse * Result; int N,M; int init; Expression emat; Expression ** e_Mij; int ** t_Mij; BlockMatrix(const basicAC_F0 & args,int iinit=0) ; ~BlockMatrix() ; static ArrayOfaType typeargs() { return ArrayOfaType(atype*>(),atype());} static E_F0 * f(const basicAC_F0 & args){ if(IsRawMat(args)) return new RawMatrix(args,0); else return new BlockMatrix(args,0); } AnyType operator()(Stack s) const ; }; template class BlockMatrix1 : public BlockMatrix { public: BlockMatrix1(const basicAC_F0 & args): BlockMatrix(args,1) {} static E_F0 * f(const basicAC_F0 & args){ if(IsRawMat(args)) return new RawMatrix(args,1); else return new BlockMatrix(args,1); } }; template map< pair, R> *Matrixfull2mapIJ_inv (KNM * const & pa,const Inv_KN_long & iii,const Inv_KN_long & jjj) { const KN_ &ii(iii), &jj(jjj); const KNM & a(*pa); int N=a.N(),M=a.M(); long n = ii(SubArray(N)).max()+1; long m= jj(SubArray(M)).max()+1; /* long minn = ii(SubArray(N)).min()+1; long minm= jj(SubArray(M)).min()+1; if ( !(0 <= minn && 0 <= minm) ) { cerr << " Out of Bound in A(I^-1,J^1) : "<< minn << " " << minm <<" => negative value!! " << endl; ExecError("Out of Bound Error"); } */ // cout << " ### n m " << n << " " << m << endl; map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); A[make_pair(n-1,m-1)] = R(); // Hack to be sure that the last term existe for (long i=0;i, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); A[make_pair(n-1,m-1)] += R(); // Hack to be sure that the last term existe for (long il=0;il=0 && j >=0) { if ( !(0 <= i && i < N && 0 <= j && j < M ) ) { cerr << " Out of Bound in A(I,J) : " << i << " " << j << " not in " << "[0,"< negative value!! " << endl; ExecError("Out of Bound Error"); } */ map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); A[make_pair(n-1,m-1)] = R(); // Hack to be sure that the last term existe for (int i=0;i=0 && jj[j]>=0 && Fem2D::norm(aij)>1e-40) // if (norm(aij)>1e-40 &) A[make_pair(ii[i],jj[j])] += aij; } delete pop; return pA; } template map< pair, R> *Matrixmapp2mapIJ1 (map< pair, R> *const & B,const Inv_KN_long & iii,const Inv_KN_long & jjj) { const KN_ &ii(iii), &jj(jjj); typedef typename map< pair, R>::const_iterator It; map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); int n=0,m=0; // hack: the last element must exist in the map to set matrix size /* It lastb= --B->end(); // le last element if( lastb != B->end() ) { nb = last->first.first+1; mb=last->first.second+1; } */ int N=ii.N(),M=jj.N(); // A[make_pair(n-1,m-1)] = R(); // Hack to be sure that the last term existe for (It k=B->begin();k!=B->end();++k) { int il = k->first.first; int jl = k->first.second; if ( !( 0 <= il && il < N && 0 <= jl && jl < M ) ) { cerr << " Out of Bound in (Map)(I,J) : " << il << " " << jl << " not in " << "[0,"<second; if(i >=0 && j>=0) A[make_pair(i,j)] += aij; } A[make_pair(n,m)] += R(); // Hack to be sure that the last term existe delete B; return pA; } template map< pair, R> *Matrixmapp2mapIJ (map< pair, R> *const & B,const KN_ & ii,const KN_ & jj) { typedef typename map< pair, R>::const_iterator It; typedef typename multimap< int,int>::iterator MI; map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); multimap< int,int > I,J; int N=ii.N(),M=jj.N(); for (int i=0;i=0) I.insert(make_pair(ii[i],i)); for (int j=0;j=0) J.insert(make_pair(jj[j],j)); int n=N-1,m=M-1;// change FH sep 2009 to have the correct size.. for (It k=B->begin();k!=B->end();++k) { int il = k->first.first; int jl = k->first.second; R aij =k->second; pair PPi=I.equal_range(il); pair PPj=J.equal_range(jl); for(MI pi=PPi.first ; pi != PPi.second; ++pi) { int i=pi->second; for(MI pj=PPj.first ; pj != PPj.second; ++pj) { int j=pj->second; n=max(i,n); m=max(j,m); if(i >=0 && j>=0) A[make_pair(i,j)] += aij; } } } A[make_pair(n,m)] += R(); // Hack to be sure that the last term existe delete B; return pA; } template map< pair, R> *Matrixoutp2mapIJ (outProduct_KN_ * const & pop,const KN_ & ii,const KN_ & jj) { const outProduct_KN_ & op(*pop); long N=op.a.N(),M=op.b.N(); long n=ii.N(),m=jj.N(); map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); A[make_pair(n-1,m-1)] = R(); // Hack to be sure that the last term existe for (long il=0;il=0 && j >=0) { if ( !( 0 <= i && i < N && 0 <= j && j < M ) ) { cerr << " Out of Bound in (a*b')(I,J) : " << i << " " << j << " not in " << "[0,"<1e-40) A[make_pair(il,jl)] += aij; } } delete pop; return pA; } template AnyType Matrixoutp2map (Stack , const AnyType & pp) { const outProduct_KN_ & op(*GetAny *>(pp)); long N=op.a.N(),M=op.b.N(); long n = N; long m= M; map< pair, R> *pA= new map< pair, R>; map< pair, R> & A(*pA); A[make_pair(n-1,m-1)] = R(); // Hack to be sure that the last term existe for (long i=0;i1e-40) A[make_pair(i,j)] += aij; } delete &op; return pA; } template BlockMatrix::~BlockMatrix() { if (e_Mij) { cout << " del Block matrix "<< this << " " << e_Mij <<" N = " << N << " M = " << M << endl; for (int i=0;i RawMatrix::RawMatrix(const basicAC_F0 & args,int iinit) : init(iinit) { args.SetNameParam(); emat = args[0]; const E_Array & ee= *dynamic_cast((Expression) args[1]); int N=ee.size(); if (N==1) { C_F0 c0(ee[0]); coef=to >(ee[0]); lig=0; col=0; } else if (N==3) { C_F0 c0(ee[0]),c1(ee[1]),c2(ee[2]); coef=to >(ee[2]); lig=to >(ee[0]); col=to >(ee[1]); } } template BlockMatrix::BlockMatrix(const basicAC_F0 & args,int iinit) : init(iinit) { N=0; M=0; args.SetNameParam(); emat = args[0]; const E_Array & eMij= *dynamic_cast((Expression) args[1]); N=eMij.size(); int err =0; for (int i=0;i((Expression) eMij[i]); if (!emi) err++; else { if ( i==0) M = emi->size(); else if(M != emi->size()) err++; } } if (err) { CompileError(" Block matrix : [[ a, b, c], [ a,b,c ]] or Raw Matrix [a] or [ l, c, a ] "); } assert(N && M); e_Mij = new Expression * [N]; t_Mij = new int * [N]; for (int i=0;i((Expression) eMij[i]); e_Mij[i] = new Expression [M]; t_Mij[i] = new int [M]; for (int j=0; j() && eij->EvaluableWithOutStack() ) { long contm = GetAny((*eij)(NullStack)); /* prev version if(contm !=0) CompileError(" Block matrix , Just 0 matrix"); e_Mij[i][j]=0; t_Mij[i][j]=0;*/ if(contm==0) { e_Mij[i][j]=0; t_Mij[i][j]=0; } else if ( atype()->CastingFrom(rij) ) { // frev 2007 e_Mij[i][j]=to(c_Mij); t_Mij[i][j]=7; // just un scalaire } else CompileError(" Block matrix , Just 0 matrix"); } else if ( rij == atype *>()) { e_Mij[i][j]=eij; t_Mij[i][j]=1; } else if ( rij == atype >()) { e_Mij[i][j]=eij; t_Mij[i][j]=2; } else if ( atype * >()->CastingFrom(rij) ) { // before KN_ because KNM can be cast in KN_ e_Mij[i][j]=to * >(c_Mij); t_Mij[i][j]=5; } else if ( atype >()->CastingFrom(rij) ) { e_Mij[i][j]=to >(c_Mij); t_Mij[i][j]=3; } else if ( atype > >()->CastingFrom(rij) ) { e_Mij[i][j]=to > >(c_Mij); t_Mij[i][j]=4; } else if ( atype * > >()->CastingFrom(rij) ) { e_Mij[i][j]=to *> >(c_Mij); t_Mij[i][j]=6; } else if ( atype()->CastingFrom(rij) ) { // frev 2007 e_Mij[i][j]=to(c_Mij); t_Mij[i][j]=7; // just un scalaire } else { CompileError(" Block matrix , bad type in block matrix"); } /* else if ( atype, R> * >()->CastingFrom(rij) ) { e_Mij[i][j]= to, R> *>(C_F0(eij,rij)).LeftValue(); t_Mij[i][j]=10; }*/ } } } template class SetRawMatformMat : public OneOperator { public: typedef Matrice_Creuse * A; // Warning B type of 2 parameter typedef Matrice_Creuse * R; typedef E_Array B; // A type of 1 parameter class CODE : public E_F0 { public: Expression Mat; Expression lig; Expression col; Expression coef; bool mi; CODE(Expression a,const E_Array & tt) : Mat(a), mi(tt.MeshIndependent()) { assert(&tt); if(tt.size()!=3) CompileError("Set raw matrix: [ lg,col, a] = A (size !=3) "); if ( aatypeknlongp->CastingFrom(tt[0].left() ) //// for compilation error with g++ 3.2.2 (4 times) && aatypeknlongp->CastingFrom(tt[1].left() ) && atype* >()->CastingFrom(tt[2].left() ) ) { lig = aatypeknlongp->CastTo(tt[0]); col = aatypeknlongp->CastTo(tt[1]); coef = atype* >()->CastTo(tt[2]); } else CompileError(" we are waiting for [ lg,col,a] = A"); } AnyType operator()(Stack stack) const { A a=GetAny((*Mat)(stack)); KN *lg,*cl; KN *cc; lg = GetAny*>((*lig)(stack)); cl = GetAny*>((*col)(stack)); cc = GetAny*>((*coef)(stack)); int n=a->N(),m=a->M(); map,RR> *M=new map,RR>; if (n >0 && m>0 && a->A) { a->A->addMatTo(RR(1.),*M); // hack (*M)[make_pair(n-1,m-1)]+=RR(); } int kk = M->size(); lg->resize(kk); cc->resize(kk); cl->resize(kk); int k=0; typename map,RR>::const_iterator i; //if (!a->sym) for (i=M->begin(); i != M->end();++i,++k) { (*lg)[k]= i->first.first; (*cl)[k]= i->first.second; (*cc)[k]= i->second; } delete M; return SetAny(a); } bool MeshIndependent() const {return mi;} // ~CODE() {} operator aType () const { return atype();} }; // end sub class CODE public: // warning hack A and B E_F0 * code(const basicAC_F0 & args) const { return new CODE(t[1]->CastTo(args[1]),*dynamic_cast( t[0]->CastTo(args[0]).RightValue()));} SetRawMatformMat(): OneOperator(atype(),atype(),atype()) {} // warning with A and B }; R realC(Complex c) {return c.real();} R imagC(Complex c) {return c.imag();} template AnyType CopyMatC2R(Stack stack,Expression emat,Expression CR2eA) { typedef Complex C; typedef double R; using namespace Fem2D; Matrice_Creuse_C2R CRMat =GetAny((*CR2eA)(stack)); Matrice_Creuse *Mat=CRMat; int cas = CRMat.cas; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); MatriceMorse * mr=Mat->A->toMatriceMorse(false,false); MatriceMorse * mrr = 0; // cout << " CopyMatC2R: " << init << " " << sparse_mat <(*mr,realC); else if(cas==1) mrr = new MatriceMorse(*mr,imagC); else { cout << " cas = " << cas <init() ; // ???? sparse_mat->A.master(mrr); //ffassert(0);// a faire return sparse_mat; } template AnyType RawMatrix::operator()(Stack stack) const { MatriceMorse * amorse =0; KN_ cc(GetAny< KN_ >((*coef)(stack))); int k= cc.N(); int n= k; int m=n; map< pair, R> Aij; bool sym=false; if( lig && col) { KN_ lg(GetAny< KN_ >((*lig)(stack))); KN_ cl=(GetAny< KN_ >((*col)(stack))); n = lg.max()+1; m = cl.max()+1; ffassert( lg.N()==k && cl.N()==k && lg.min()>=0 && lg.max()>=0); sym=false; for(int i=0;i(lg[i],cl[i])]+=cc[i]; } else { sym=true; for(int i=0;i(n,m,Aij,sym); if(verbosity) cout << " -- Raw Matrix nxm =" <nbcoef << endl; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(stack)); if( !init) sparse_mat->init(); // sparse_mat->pUh=0; // sparse_mat->pVh=0; sparse_mat->A.master(amorse); sparse_mat->typemat=(amorse->n == amorse->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) if(verbosity>3) { cout << " End Raw Matrix : " << endl;} return sparse_mat; } template AnyType BlockMatrix::operator()(Stack s) const { typedef list *,bool> > * L; KNM Bij(N,M); KNM * > Fij(N,M); KNM cnjij(N,M); KNM Rij(N,M); // to sto cnjij = false; KN Oi(N+1), Oj(M+1); if(verbosity>3) { cout << " Build Block Matrix : " << N << " x " << M << endl;} Bij = (L) 0; Oi = (long) 0; Oj = (long)0; for (int i=0;i* >( e)) ; else if (tij==2) Bij(i,j) = to( GetAny >(e)); else if (tij==3) { KN_ x=GetAny< KN_ >( e); Fij(i,j) = new KNM_(x,x.N(),1);} else if (tij==4) { KN_ x=GetAny< Transpose< KN_ > >( e).t ; Fij(i,j) = new KNM_(x,1,x.N());} else if (tij==5) { KNM * m= GetAny< KNM* >( e); Fij(i,j) = new KNM_(*m);} else if (tij==6) { KNM * m= GetAny< Transpose< KNM* > >( e).t; Fij(i,j) = new KNM_(m->t()); } else if (tij==7) { Rij(i,j)=GetAny< R >( e); Fij(i,j) = new KNM_(&(Rij(i,j)),1,1);} // else if (tij==3) {} else { cout << " Bug " << tij << endl; ExecError(" Type sub matrix block unknown "); } } } // compute size of matrix int err=0; for (int i=0;i nm(0,0); if (Bij(i,j)) nm = get_NM( *Bij(i,j)); else if(Fij(i,j)) nm = make_pair(Fij(i,j)->N(), Fij(i,j)->M()); if (( nm.first || nm.second) && verbosity>3) cout << " Block [ " << i << "," << j << " ] = " << nm.first << " x " << nm.second << " cnj = " << cnjij(i,j) << endl; if (nm.first) { if ( Oi(i+1) ==0 ) Oi(i+1)=nm.first; else if(Oi(i+1) != nm.first) { err++; cerr <<"Error Block Matrix, size sub matrix" << i << ","<< j << " n (old) " << Oi(i+1) << " n (new) " << nm.first << endl; } } if(nm.second) { if ( Oj(j+1) ==0) Oj(j+1)=nm.second; else if(Oj(j+1) != nm.second) { cerr <<"Error Block Matrix, size sub matrix" << i << ","<< j << " m (old) " << Oj(j+1) << " m (new) " << nm.second << endl; err++;} } } if (err) ExecError("Error Block Matrix, size sub matrix"); // gestion of zero block ???? for (int j=0;j9) cout << j << " colum size" << Oj(j+1) << endl; if ( Oj(j+1) ==0) { Oj(j+1)=1; if( Oj(j+1) !=1) err++;} } for (int i=0;i9) cout << i << " row size" << Oi(i+1) << endl; if ( Oi(i+1) ==0) { Oi(i+1)=1; if( Oi(i+1) !=1) err++;} } if (err) ExecError("Error Block Matrix with 0 line or 0 colomn.."); // cout << "Oi = " << Oi << endl; // cout << "Oj = " << Oj << endl; for (int i=0;i3) { cout << " Oi = " << Oi << endl; cout << " Oj = " << Oj << endl; } MatriceMorse * amorse =0; { map< pair, R> Aij; for (int i=0;i3) cout << " Add Block S " << i << "," << j << " = at " << Oi(i) << " x " << Oj(j) << " conj = " << cnjij(i,j) << endl; BuildCombMat(Aij,*Bij(i,j),false,Oi(i),Oj(j),cnjij(i,j)); } else if (Fij(i,j)) { if(verbosity>3) cout << " Add Block F " << i << "," << j << " = at " << Oi(i) << " x " << Oj(j) << endl; BuildCombMat(Aij,*Fij(i,j),Oi(i),Oj(j),R(1.),cnjij(i,j));// BuildCombMat } amorse= new MatriceMorse(n,m,Aij,false); } if(verbosity) cout << " -- Block Matrix NxM = " << N << "x" << M << " nxm =" <nbcoef << endl; Matrice_Creuse * sparse_mat =GetAny* >((*emat)(s)); if(!init) sparse_mat->init(); //sparse_mat->pUh=0; // sparse_mat->pVh=0; sparse_mat->A.master(amorse); sparse_mat->typemat=(amorse->n == amorse->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) // cleanning for (int i=0;i3) { cout << " End Build Blok Matrix : " << endl;} return sparse_mat; } template class minusMat { public: list *,bool> > *l; minusMat(list *,bool> > *ll): l(new list *,bool> >(*ll) ) { typedef typename list *,bool> >::iterator lci; for (lci i= l->begin();i !=l->end();++i) i->first*= R(-1); } }; template AnyType mM2L3 (Stack , const AnyType & pp) { minusMat mpp(to(GetAny *>(pp))); return SetAny >(mpp); } /* template AnyType mmM2L3 (Stack , const AnyType & pp) { minusMat & p(GetAny >(pp)); minusMat mpp(p.l); delete p.l; return mpp.l; } template AnyType mmM2L3c (Stack , const AnyType & pp) { list *,bool> > * p(GetAny >(pp)) minusMat mpp(p.l); delete p.l; return mpp.l; } */ template class E_ForAllLoopMatrix { public: typedef R *VV; typedef long KK; typedef Matrice_Creuse * Tab; typedef ForAllLoopOpBase DataL; const DataL *data; E_ForAllLoopMatrix(const DataL *t): data(t){} AnyType f(Stack s) const { Tab t= GetAny(data->tab(s)); KK * i = GetAny(data->i(s)); KK * j = GetAny(data->j(s)); VV v = GetAny(data->v(s)); // cout << i << " " << j << " " << v << " " << data->epl << endl; if(verbosity>1000) { cout << " i " << (char*) (void *) i - (char*)(void*) s ; cout << " j " << (char*) (void *) j - (char*)(void*) s ; cout << " vi " << (char*) (void *) v - (char*)(void*) s ; cout << endl; } ffassert(i && v); MatriceCreuse *m=t->A; MatriceMorse *mm = dynamic_cast*>(m); if(!mm) ExecError(" Matrix sparce of bad type ( not morse ) , sorry.. "); if(mm) for (long ii=0;ii < mm->n;++ii) for (long k=mm->lg[ii];k < mm->lg[ii+1];++k) { *i=ii; *j= mm->cl[k]; *v = mm->a[k]; data->code(s); mm->a[k] = *v; } // data->end(s); return Nothing ; } }; // Mat real -> mat complex .... ??? FH. april 2016 .... struct VirtualMatCR :public VirtualMatrice { public: VirtualMatrice & VM; typedef Complex R; VirtualMatCR(VirtualMatrice & MM): VirtualMatrice(MM.N,MM.M), VM(MM) {} void addMatMul(const KN_ & cx, KN_ & cy) const { double *px = static_cast(static_cast(cx)); double *py = static_cast(static_cast(cy)); KN_ rx(px+0,cx.N(),cx.step*2); KN_ ix(px+1,cx.N(),cx.step*2); KN_ ry(py+0,cy.N(),cy.step*2); KN_ iy(py+1,cy.N(),cy.step*2); VM.addMatMul(rx,ry); VM.addMatMul(ix,iy); } void addMatTransMul(const KN_ & cx , KN_ & cy ) const { double *px = static_cast(static_cast(cx)); double *py = static_cast(static_cast(cy)); KN_ rx(px+0,cx.N(),cx.step*2); KN_ ix(px+1,cx.N(),cx.step*2); KN_ ry(py+0,cy.N(),cy.step*2); KN_ iy(py+1,cy.N(),cy.step*2); VM.addMatTransMul(rx,ry); VM.addMatTransMul(ix,iy); } bool WithSolver() const {return VM.WithSolver();} // by default no solver virtual void Solve( KN_ & cx ,const KN_ & cy) const { if( !VM.WithSolver()) InternalError("VirtualMatrice::solve not implemented "); double *px = static_cast(static_cast(cx)); double *py = static_cast(static_cast(cy)); KN_ rx(px+0,cx.N(),cx.step*2); KN_ ix(px+1,cx.N(),cx.step*2); KN_ ry(py+0,cy.N(),cy.step*2); KN_ iy(py+1,cy.N(),cy.step*2); VM.Solve(rx,ry); VM.Solve(ix,iy); } bool ChecknbLine (int n) const { return VM.ChecknbLine(n); } bool ChecknbColumn (int m) const { return VM.ChecknbColumn(m); } }; template // extend (4th arg.) class Op2_mulvirtAvCR : public OneOperator { // aType r; // return type public: class CODE :public E_F0 { public: // extend Expression a0,a1; // extend CODE( Expression aa0,Expression aa1) : a0(aa0), a1(aa1) {} // extend (2th arg.) AnyType operator()(Stack s) const { VirtualMatrice *pv = new VirtualMatCR ((*GetAny((*a0)(s))).A); Add2StackOfPtr2Free(s,pv); return SetAny(R(pv,GetAny((*a1)(s)))); } virtual size_t nbitem() const {return a1->nbitem(); } // modif ??? bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent() ;} }; E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE( t[0]->CastTo(args[0]), t[1]->CastTo(args[1]));} // extend Op2_mulvirtAvCR(int preff=0): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()]) {pref=preff;} }; template void AddSparseMat() { // aType tkrp = atype *>(); SetMatrix_Op::btype = Dcl_Type * >(); Dcl_Type >(); Dcl_Type >(); // Add FH oct 2005 Dcl_Type< map< pair, R> * >(); // Add FH mars 2005 Dcl_Type< minusMat >(); // Add FJH mars 2007 basicForEachType * t_MC=atype< Matrice_Creuse* >(); t_MC->SetTypeLoop(atype< R* >(),atype< long* >(),atype< long* >()); // basicForEachType * t_MCt=atype< Matrice_Creuse_Transpose >(); // basicForEachType * t_lM=atype< list *,bool> > * >(); // basicForEachType * t_nM=atype< minusMat >(); basicForEachType * t_MM=atype, R> * >(); TheOperators->Add("*", new OneBinaryOperator::plusAx,Matrice_Creuse*,KN_ > >, new OneBinaryOperator::plusAtx,Matrice_Creuse_Transpose,KN_ > >, new OneBinaryOperator::solveAxeqb,Matrice_Creuse_inv,KN_ > > ); /*if(0) TheOperators->Add("*", new OneBinaryOperator::plusAx,Matrice_Creuse*,KN_ > >( 0 ,tkrp), new OneBinaryOperator::plusAtx,Matrice_Creuse_Transpose,KN_ > >( 0 ,tkrp), new OneBinaryOperator::solveAxeqb,Matrice_Creuse_inv,KN_ > >( 0 ,tkrp) ); */ TheOperators->Add("^", new OneBinaryOperatorA_inv()); // matrix new code FH (Houston 2004) TheOperators->Add("=", // new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation), new OneOperator2_*,Matrice_Creuse*,const Matrix_Prod,E_F_StackF0F0>(ProdMat), new OneOperator2_*,Matrice_Creuse*,KN *,E_F_StackF0F0>(DiagMat), new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse_Transpose,E_F_StackF0F0>(CopyTrans), new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse*,E_F_StackF0F0>(CopyMat) , new OneOperator2_*,Matrice_Creuse*,KNM*,E_F_StackF0F0>(MatFull2Sparse) , new OneOperator2_*,Matrice_Creuse*,map< pair, R> * ,E_F_StackF0F0>(MatMap2Sparse) , new OneOperator2_*,Matrice_Creuse*,list *,bool> > *,E_F_StackF0F0>(CombMat) , new OneOperatorCode >() ); TheOperators->Add("<-", new OneOperatorCode >(), // new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation), new OneOperator2_*,Matrice_Creuse*,const Matrix_Prod,E_F_StackF0F0>(ProdMat), new OneOperator2_*,Matrice_Creuse*,KN *,E_F_StackF0F0>(DiagMat) , new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse_Transpose,E_F_StackF0F0>(CopyTrans), new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse*,E_F_StackF0F0>(CopyMat) , new OneOperator2_*,Matrice_Creuse*,KNM*,E_F_StackF0F0>(MatFull2Sparse) , new OneOperator2_*,Matrice_Creuse*,map< pair, R> * ,E_F_StackF0F0>(MatMap2Sparse) , new OneOperator2_*,Matrice_Creuse*,list *,bool> > *,E_F_StackF0F0>(CombMat) ); TheOperators->Add("*", new OneBinaryOperator,Matrice_Creuse*,Matrice_Creuse*> >, new OneBinaryOperator,Matrice_Creuse_Transpose,Matrice_Creuse* > >, new OneBinaryOperator,Matrice_Creuse_Transpose,Matrice_Creuse_Transpose > >, new OneBinaryOperator,Matrice_Creuse*,Matrice_Creuse_Transpose > > , new OneBinaryOperator > , new OneBinaryOperator > , new OneBinaryOperator > , new OneBinaryOperator > ); TheOperators->Add("+", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, // new OneBinaryOperator >(t_MCt,t_lM), // new OneBinaryOperator >(t_MC,t_lM), new OneBinaryOperator > ); TheOperators->Add("-", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, // new OneBinaryOperator >(t_MCt,t_lM), // new OneBinaryOperator >(t_MC,t_lM), new OneBinaryOperator > ); TheOperators->Add("-", new OneUnaryOperator > ); Add *>("n",".",new OneOperator1 *>(get_mat_n) ); Add *>("m",".",new OneOperator1 *>(get_mat_m) ); Add *>("nbcoef",".",new OneOperator1 *>(get_mat_nbcoef) ); Add *>("nnz",".",new OneOperator1 *>(get_mat_nbcoef) ); Add *>("size",".",new OneOperator1 *>(get_mat_nbcoef) ); Add *>("trace",".",new OneOperator1* >(get_trace_mat) ); Add *>("diag",".",new OneOperator1 ,Matrice_Creuse *>(thediag) ); Add *>("coef",".",new OneOperator1 ,Matrice_Creuse *>(thecoef) ); // Add *>("setdiag",".",new OneOperator2 *,KN *>(set_diag) ); TheOperators->Add("=", new OneOperator2*,KN*,TheDiagMat >(get_mat_daig) ); TheOperators->Add("<-", new OneOperator2*,KN*,TheDiagMat >(init_get_mat_daig) ); TheOperators->Add("=", new OneOperator2,TheDiagMat,KN*>(set_mat_daig) ); // TheOperators->Add("=", new OneOperator2*,KN*,TheDiagMat >(get_mat_daig) ); // TheOperators->Add("=", new OneOperator2,TheDiagMat,KN*>(set_mat_daig) ); // ADD oct 2005 TheOperators->Add("=", new OneOperator2*,KN*,TheCoefMat >(get_mat_coef) ); TheOperators->Add("=", new OneOperator2,TheCoefMat,KN*>(set_mat_coef) ); // TheOperators->Add("=", new OneOperator2*,KN*,TheCoefMat >(get_mat_coef) ); // TheOperators->Add("=", new OneOperator2,TheCoefMat,KN*>(set_mat_coef) ); Global.Add("set","(",new SetMatrix); //Global.Add("psor","(",new OneOperatorCode > ); // a(i,i) atype * >()->Add("(","",new OneOperator3_ *,long,long >(1,get_elementp2mc)); atype * >()->Add("[","",new OneOperator3_ *,long,long >(10,get_element2mc)); atype*>()->Add("(","",new OneOperator3_, R> *,KNM*,Inv_KN_long,Inv_KN_long >(Matrixfull2mapIJ_inv)); atype*>()->Add("(","",new OneOperator3_, R> *,KNM*,KN_,KN_ >(Matrixfull2mapIJ)); atype*>()->Add("(","",new OneOperator3_, R> *,outProduct_KN_*,Inv_KN_long,Inv_KN_long >(Matrixoutp2mapIJ_inv)); atype*>()->Add("(","",new OneOperator3_, R> *,outProduct_KN_*,KN_,KN_ >(Matrixoutp2mapIJ)); TheOperators->Add("=", new SetRawMatformMat); t_MM->Add("(","", new OneOperator3_, R> *,map< pair, R> *,Inv_KN_long,Inv_KN_long >(Matrixmapp2mapIJ1)); t_MM->Add("(","",new OneOperator3_, R> *,map< pair, R> *,KN_,KN_ >(Matrixmapp2mapIJ)); t_MC->Add("(","",new OneOperator3_, R> *,map< pair, R> *,Inv_KN_long,Inv_KN_long >(Matrixmapp2mapIJ1,t_MC)); t_MC->Add("(","",new OneOperator3_, R> *,map< pair, R> *,KN_,KN_ >(Matrixmapp2mapIJ,t_MC)); //atype*>()->Add("(","",new OneOperator3_, R> *,map< pair, R> *,Inv_KN_long,Inv_KN_long >(Matrixmapp2mapIJ1),t_lM); //atype*>()->Add("(","",new OneOperator3_, R> *,map< pair, R> *,KN_,KN_ >(Matrixmapp2mapIJ),t_lM); //map< pair, R> * ttt= (0); // ; map_type[typeid(map< pair, R> *).name()]->AddCast( new E_F1_funcT, R> *,KNM* >(Matrixfull2map), new E_F1_funcT, R> *,outProduct_KN_* >(Matrixoutp2map), new E_F1_funcT, R> *,Matrice_Creuse* >(MatriceCreuse2map) ); map_type[typeid(list *,bool> > *).name()]->AddCast( new E_F1_funcT *,bool> > *,Matrice_Creuse* >(M2L3), new E_F1_funcT *,bool> > *,Matrice_Creuse_Transpose >(tM2L3), new E_F1_funcT *,bool> > *,minusMat >(mM2L3 ) ); /* map_type[typeid(minusMat).name()]->AddCast( new E_F1_funcT,list *,bool> > * >(mmM2L3 ) //new E_F1_funcT,Matrice_Creuse* > * >(mmM2L3c ), //new E_F1_funcT,Matrice_Creuse_Transpose > * >(mmM2L3ct ) ); */ TheOperators->Add("{}",new ForAllLoop >); // --- end } //extern Map_type_of_map map_type_of_map ; // to store te type //extern Map_type_of_map map_pair_of_type ; // to store te type extern int lineno(); class PrintErrorCompile : public OneOperator { public: const char * cmm; E_F0 * code(const basicAC_F0 & ) const { ErrorCompile(cmm,lineno()); return 0;} PrintErrorCompile(const char * cc): OneOperator(map_type[typeid(R).name()]),cmm(cc){} }; class PrintErrorCompileIM : public E_F0info { public: typedef double Result; static E_F0 * f(const basicAC_F0 & args) { lgerror("\n\n *** change interplotematrix in interpole.\n *** Bad name in previous version,\n *** sorry FH.\n\n"); return 0; } static ArrayOfaType typeargs() {return ArrayOfaType(true);} operator aType () const { return atype();} }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_R ; ; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; DefSparseSolverSym::solver =SparseMatSolverSym_R; DefSparseSolverSym::solver =SparseMatSolverSym_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return true; } template class removeDOF_Op : public E_F0mps { public: Expression A; Expression R; Expression x; Expression out; int nbarg; static const int n_name_param = 4; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; removeDOF_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : A(param1), R(param2), x(param3), out(param4),nbarg(4) { args.SetNameParam(n_name_param, name_param, nargs); } removeDOF_Op(const basicAC_F0& args, Expression param2, Expression param3, Expression param4) : A(0), R(param2), x(param3), out(param4) ,nbarg(3){ args.SetNameParam(n_name_param, name_param, nargs); } removeDOF_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), R(param2), x(0), out(0) ,nbarg(2){ args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type removeDOF_Op::name_param[] = { {"symmetrize", &typeid(bool)}, {"condensation", &typeid(KN*)}, {"R", &typeid(Matrice_Creuse*)}, {"eps",&typeid(double)} }; template class removeDOF : public OneOperator { const unsigned short withA; public: removeDOF() : OneOperator(atype(), atype*>(), atype*>(), atype*>(), atype*>()),withA(1) {} removeDOF(int ) : OneOperator(atype(), atype*>(), atype*>(), atype*>()),withA(0) {} removeDOF(int, int ) : OneOperator(atype(), atype*>(), atype*>()),withA(2) {} E_F0* code(const basicAC_F0& args) const { if(withA == 1) return new removeDOF_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); else if(withA == 0) return new removeDOF_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); else return new removeDOF_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template bool cmp(const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; } template AnyType removeDOF_Op::operator()(Stack stack) const { static const double defEPS=1e-12; Matrice_Creuse* pA = A ? GetAny* >((*A)(stack)):0; Matrice_Creuse* pR = GetAny* >((*R)(stack)); KN* pX = x ? GetAny* >((*x)(stack)) : 0; KN* pOut = out ? GetAny* >((*out)(stack)) : 0; Matrice_Creuse* pC = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; MatriceMorse *mC = 0; if(pC && pC->A) { mC = static_cast*>(&(*pC->A)); } ffassert(pR); bool rhs = (pX && pOut) && (pOut->n > 0 || pX->n > 0); if(pA) { if(!pC) pC = pR; pA->Uh = pR->Uh; pA->Vh = pC->Vh; MatriceMorse *mA = static_cast*>(&(*pA->A)); MatriceMorse *mR = static_cast*>(&(*pR->A)); if(!mC) mC = mR; bool symmetrize = nargs[0] ? GetAny((*nargs[0])(stack)) : false; double EPS=nargs[3] ? GetAny((*nargs[3])(stack)) :defEPS ; KN* condensation = nargs[1] ? GetAny* >((*nargs[1])(stack)) : (KN*) 0; unsigned int n = condensation ? condensation->n : mR->nbcoef; unsigned int m = condensation ? condensation->n : mC->nbcoef; int* lg = new int[n + 1]; int* cl; T* val; T* b; if(rhs && pOut->n != n) pOut->resize(n); std::vector tmpVec; if(!condensation) { tmpVec.resize(mA->m); for(unsigned int i = 0; i < m; ++i) tmpVec[mC->cl[i]] = i + 1; if(!mA->symetrique) { std::vector > tmp; tmp.reserve(mA->nbcoef); lg[0] = 0; for(unsigned int i = 0; i < n; ++i) { for(unsigned int j = mA->lg[mR->cl[i]]; j < mA->lg[mR->cl[i] + 1]; ++j) { unsigned int col = tmpVec[mA->cl[j]]; if(col != 0 && abs(mA->a[j]) > EPS) { if(symmetrize) { if(col - 1 <= i) tmp.push_back(std::make_pair(col - 1, mA->a[j])); } else tmp.push_back(std::make_pair(col - 1, mA->a[j])); } } std::sort(tmp.begin() + lg[i], tmp.end(),cmp ); // c++11 , [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); if(rhs) *(*pOut + i) = *(*pX + mC->cl[i]); lg[i + 1] = tmp.size(); } mA->nbcoef = tmp.size(); if(symmetrize) mA->symetrique = true; else mA->symetrique = false; cl = new int[tmp.size()]; val = new T[tmp.size()]; for(unsigned int i = 0; i < tmp.size(); ++i) { cl[i] = tmp[i].first; val[i] = tmp[i].second; } } else { std::vector > > tmp(n); for(unsigned int i = 0; i < n; ++i) tmp[i].reserve(mA->lg[mR->cl[i] + 1] - mA->lg[mR->cl[i]]); unsigned int nnz = 0; for(unsigned int i = 0; i < n; ++i) { for(unsigned int j = mA->lg[mR->cl[i]]; j < mA->lg[mR->cl[i] + 1]; ++j) { unsigned int col = tmpVec[mA->cl[j]]; if(col != 0 && abs(mA->a[j]) > EPS) { if(i < col - 1) tmp[col - 1].push_back(make_pair(i, mA->a[j])); else tmp[i].push_back(make_pair(col - 1, mA->a[j])); ++nnz; } } if(rhs) *(*pOut + i) = *(*pX + mC->cl[i]); } mA->nbcoef = nnz; cl = new int[nnz]; val = new T[nnz]; nnz = 0; lg[0] = 0; for(unsigned int i = 0; i < n; ++i) { std::sort(tmp[i].begin(), tmp[i].end(),cmp); // c++11, [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); for(typename std::vector >::const_iterator it = tmp[i].begin(); it != tmp[i].end(); ++it) { cl[nnz] = it->first; val[nnz++] = it->second; } lg[i + 1] = nnz; } } delete [] mA->cl; delete [] mA->lg; delete [] mA->a; mA->n = n; mA->m = m; mA->N = n; mA->M = m; mA->lg = lg; mA->cl = cl; mA->a = val; } else { tmpVec.reserve(mA->n); unsigned int i = 0, j = 1; for(unsigned int k = 0; k < mA->n; ++k) { if(k == *(*condensation + i)) { ++i; tmpVec.push_back(i); } else { tmpVec.push_back(-j); ++j; } } // if(!mA->symetrique) { std::vector > tmpInterior; std::vector > tmpBoundary; std::vector > tmpInteraction; tmpInterior.reserve(mA->nbcoef); tmpBoundary.reserve(mA->nbcoef); tmpInteraction.reserve(mA->nbcoef); lg[0] = 0; for(unsigned int i = 0; i < mA->n; ++i) { int row = tmpVec[i]; if(row < 0) { for(unsigned int j = mA->lg[i]; j < mA->lg[i + 1]; ++j) { int col = tmpVec[mA->cl[j]]; if(col < 0) tmpInterior.push_back(make_pair(-col - 1, mA->a[j])); else tmpInteraction.push_back(make_pair(col - 1, mA->a[j])); } } else { for(unsigned int j = mA->lg[i]; j < mA->lg[i + 1]; ++j) { int col = tmpVec[mA->cl[j]]; if(col > 0) tmpBoundary.push_back(make_pair(col - 1, mA->a[j])); } // std::sort(tmp.begin() + lg[i], tmp.end()); if(rhs) *(*pOut + i) = *(*pX + *(*condensation + i)); lg[i + 1] = tmpBoundary.size(); } } cl = new int[tmpBoundary.size()]; val = new T[tmpBoundary.size()]; for(unsigned int i = 0; i < tmpBoundary.size(); ++i) { cl[i] = tmpBoundary[i].first; val[i] = tmpBoundary[i].second; } // } MatriceMorse* m = new MatriceMorse(n, n, tmpBoundary.size(), mA->symetrique, val, lg, cl, true); pR->typemat = TypeSolveMat(TypeSolveMat::GMRES); pR->A.master(m); m->dummy = false; } } else if(rhs) { MatriceMorse *mR = static_cast*>(&(*pR->A)); unsigned int n = mR->nbcoef; if(pOut->n != n) pOut->resize(n); for(unsigned int i = 0; i < n; ++i) { *(*pOut + i) = *(*pX + mR->cl[i]); } } return 0L; } bool SparseDefault() { return TypeSolveMat::SparseSolver== TypeSolveMat::defaultvalue; } bool Have_UMFPACK_=false; bool Have_UMFPACK() { return Have_UMFPACK_;} //OneOperator0 *TheSetDefaultSolver=0; // to change the SetDefaultSolver void init_lgmat() { SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; SparseMatSolverSym_R= DefSparseSolverSym::solver; SparseMatSolverSym_C= DefSparseSolverSym::solver; Dcl_Type::Op *>(); Dcl_Type::Op *>(); map_type_of_map[make_pair(atype* >(),atype())]=atype *>(); map_type_of_map[make_pair(atype* >(),atype())]=atype *>(); AddSparseMat(); AddSparseMat(); Add::Op *>("<-","(", new MatrixInterpolation); Add::Op *>("<-","(", new MatrixInterpolation(1)); Add::Op *>("<-","(", new MatrixInterpolation); Add::Op *>("<-","(", new MatrixInterpolation(1,1)); Dcl_Type::Op *>(); Dcl_Type::Op *>(); // Add::Op *>("<-","(", new RestrictArray); // Add::Op *>("<-","(", new RestrictArray); Global.Add("restrict","(",new RestrictArray);// FH Jan 2014 Global.Add("restrict","(",new RestrictArray);// FH Jan 2014 TheOperators->Add("=", new OneOperator2_*,KN*,const RestrictArray::Op*,E_F_StackF0F0>(SetRestrict), new OneOperator2_*,KN*,const RestrictArray::Op*,E_F_StackF0F0>(SetRestrict) ); TheOperators->Add("<-", new OneOperator2_*,KN*,const RestrictArray::Op*,E_F_StackF0F0>(SetRestrict), new OneOperator2_*,KN*,const RestrictArray::Op*,E_F_StackF0F0>(SetRestrict) ); Global.Add("interpolate","(",new MatrixInterpolation); Global.Add("interpolate","(",new MatrixInterpolation(1)); Global.Add("interpolate","(",new MatrixInterpolation); Global.Add("interpolate","(",new MatrixInterpolation(1,1)); Global.Add("interplotematrix","(",new OneOperatorCode); zzzfff->Add("mapmatrix",atype, double> *>()); zzzfff->Add("Cmapmatrix",atype, Complex> *>()); // a voir Global.Add("defaulttoGMRES","(",new OneOperator0(SetGMRES)); Global.Add("defaulttoCG","(",new OneOperator0(SetCG)); Global.New("havesparsesolver",CVariable(SparseDefault)); Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Dcl_Type< Resize > > (); Add *>("resize",".",new OneOperator1< Resize >,Matrice_Creuse *>(to_Resize)); Add > >("(","",new OneOperator3_ *,Resize > , long, long >(resize2)); // add missing in Dcl_Type< Resize > > (); Add *>("resize",".",new OneOperator1< Resize >,Matrice_Creuse *>(to_Resize)); Add > >("(","",new OneOperator3_ *,Resize > , long, long >(resize2)); //Global.Add("defaultsolver","(",new OneOperator0(SetDefaultSolver)); // pour compatibiliter TheOperators->Add("=", new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation<1>), new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation3<1>) ); TheOperators->Add("<-", new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation<0>), new OneOperator2_*,Matrice_Creuse*,const MatrixInterpolation::Op*,E_F_StackF0F0>(SetMatrixInterpolation3<0>) ); // construction of complex matrix form a double matrix TheOperators->Add("=", new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse*,E_F_StackF0F0>(CopyMat) ); TheOperators->Add("<-", new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse*,E_F_StackF0F0>(CopyMat) ); // Global.Add("imag","(",new OneOperator1_(Imag)); // Add("<--","(",new OneOperator1_(Real)); Dcl_Type(); Add*>("re",".",new OneOperator1* >(Build_Matrice_Creuse_C2R<0> )); Add*>("im",".",new OneOperator1* >(Build_Matrice_Creuse_C2R<1> )); // construction of complex matrix form a double matrix TheOperators->Add("=", new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse_C2R,E_F_StackF0F0>(CopyMatC2R<1>)); TheOperators->Add("<-", new OneOperator2_*,Matrice_Creuse*,Matrice_Creuse_C2R,E_F_StackF0F0>(CopyMatC2R<0>)); extern void init_UMFPack_solver(); init_UMFPack_solver(); Global.Add("renumbering", "(", new removeDOF); Global.Add("renumbering", "(", new removeDOF); Global.Add("renumbering", "(", new removeDOF(1)); Global.Add("renumbering", "(", new removeDOF(1)); Global.Add("renumbering", "(", new removeDOF(1, 1)); Global.Add("renumbering", "(", new removeDOF(1, 1)); TheOperators->Add("*", new Op2_mulvirtAvCR< VirtualMatrice::plusAx,Matrice_Creuse*,KN_ > , new Op2_mulvirtAvCR< VirtualMatrice::plusAtx,Matrice_Creuse_Transpose,KN_ > , new Op2_mulvirtAvCR< VirtualMatrice::solveAxeqb,Matrice_Creuse_inv,KN_ > ); } int Data_Sparse_Solver_version() { return VDATASPARSESOLVER;} freefem++-3.61-1/src/fflib/AFunction.hpp000644 000767 000024 00000357213 13312446271 020066 0ustar00hechtstaff000000 000000 /// \file // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ //file afonction.h #ifndef __AFONCTION__ #define __AFONCTION__ #include "showverb.hpp" #include "InitFunct.hpp" #include #include #include #include #include #include "error.hpp" #include #include #include #include #include #include #include #include #include extern bool showCPU; #include "RNM.hpp" #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif // #include #include "CodeAlloc.hpp" inline double CPUtime(){ #ifdef SYSTIMES struct tms buf; if (times(&buf)!=-1) return ((double)buf.tms_utime+(double)buf.tms_stime)/(long) sysconf(_SC_CLK_TCK); else #endif return ((double) clock())/CLOCKS_PER_SEC; } extern long verbosity; // level off printing extern long searchMethod; //pichon extern bool withrgraphique; using namespace std; #include "ffstack.hpp" #include "AnyType.hpp" #include "String.hpp" class basicForEachType; class E_F1_funcT_Type; class E_F0; // une instruction exec time class C_F0; // une instruction complie time class ListOfInst; class Polymorphic; class OneOperator; /// <> is used as the type of the local list contained in ListOfInst typedef E_F0 * Expression; // [[E_F0]] class AC_F0; class basicAC_F0; typedef complex Complex; /// <> [[file:AnyType.hpp::aType]] [[E_F0]] typedef pair Type_Expr ;// to store the type and the expression 29042005 FH int FindType(const char * name) ; void lgerror (const char* s) ; void CompileError(string msg="",aType r=0); void ExecError(string msg=""); struct UnId { const char * id; aType r; Expression e; deque * array; // to store a array aType re; bool ref; // a ref or non UnId() :id(0),r(0),e(0),array(0),re(0),ref(false) {} UnId(const char * idd) :id(idd),r(0),e(0),array(0),re(0),ref(false) {} UnId(const char * idd,const C_F0 & ee,aType rr,bool reff) ; UnId(deque * d) : id(0),r(0),e(0),array(d?new deque(*d):0),re(0),ref(false) {} UnId(const UnId & u) : id(u.id),r(u.r),e(u.e), array(u.array?new deque(*u.array):0), re(u.re),ref(u.ref) {} // Modif 24032005 void operator= (const UnId & u) { id=u.id; r=u.r; e=u.e; re=u.re; ref=u.ref; if(array) delete array; array=0; if(u.array) array= new deque(*u.array); } ~UnId(){ if( array) delete array;} // Modif 24032005 }; /// <> typedef deque ListOfId; // xxx is a type so xxx can't be a parameter #define ATYPE(xxx) map_type[typeid(xxx).name()] /* #define NEW_TYPE(type) map_type[typeid(type).name()] = new ForEachType(0,0) //#define NEW_TYPE(type) map_type[typeid(type).name()] = new ForEachType() #define NEW_TYPE_I(type,i,d) map_type[typeid(type).name()] = new ForEachType(i,d) #define NEW_TYPE_Ptr(type) map_type[typeid(type*).name()] = new ForEachTypePtr() #define NEW_TYPE_PtrND(type) map_type[typeid(type*).name()] = new ForEachTypePtr(0) #define NEW_TYPE_PtrNIND(type) map_type[typeid(type*).name()] = new ForEachTypePtr(0,0) //#define NEW_TYPE_PtrI(type) map_type[typeid(type*).name()] = new ForEachTypePtr(Initialize) */ /// Doxygen doc extern Polymorphic * TheOperators, * TheRightOperators; // ------------- extern C_F0 *pOne,*pZero,*pminusOne; typedef AnyType (* Function1)(Stack, const AnyType &); typedef AnyType (* Function2)(Stack, const AnyType &,const AnyType &); typedef AnyType (* CFunction2)(Stack, E_F0 *, E_F0 *); typedef AnyType (* CFunction4)(Stack, E_F0 *, E_F0 *, E_F0 *, E_F0 *); Expression NewExpression(Function1,Expression); Expression NewExpression(Function2,Expression,Expression); inline Type_Expr make_Type_Expr(aType t, E_F0 * e) {return make_pair(t,e);} inline Type_Expr make_Type_Expr( E_F0 * e,aType t) {return make_pair(t,e);} struct Keyless : binary_function { typedef const char * Key; bool operator()(const Key& x, const Key& y) const { return strcmp(x,y)<0;} }; // <> class vectorOfInst; class TableOfIdentifier: public CodeAlloc { public: struct Value; typedef const char * Key; typedef map maptype; typedef pair pKV; typedef maptype::iterator iterator; typedef maptype::const_iterator const_iterator; struct Value :public Type_Expr { pKV * next; // link all the variable in reverse order to call delete on each variable bool del; Value(const Type_Expr & vv,pKV * n,bool dd=true) : Type_Expr(vv),next(n),del(dd) {} Value(aType t,E_F0 *f,pKV *n,bool dd=true): Type_Expr(t,f),next(n),del(dd) {} };// to store the type and the expression pKV * listofvar; // struct Keyless : binary_function // { bool operator()(const Key& x, const Key& y) const{ return strcmp(x,y)<0;} }; maptype m; int nIdWithDelete; C_F0 Find(Key) const ; C_F0 Find(Key,const basicAC_F0 &) const ; const Type_Expr & New(Key k,const Type_Expr & v,bool del=true); void Add(Key k,Key op,OneOperator *p0,OneOperator *p1=0, OneOperator *p2=0,OneOperator *p3=0,OneOperator *p4=0, OneOperator *p5=0,OneOperator *p6=0) ; void clear(); template C_F0 NewVar(Key k,aType t,size_t & top,const C_F0 &i) ; template C_F0 NewVar(Key k,aType t,size_t & top,const basicAC_F0 &args) ; template C_F0 NewVar(Key k,aType t,size_t & top,const basicAC_F0 &args,const U & data) ; // C_F0 NewVar(Key k,aType t,size_t & top,const basicAC_F0 &args,const C_F0& f) ; template C_F0 NewVar(Key k,aType t,size_t & top) ; C_F0 NewID(aType t,Key k, C_F0 & c,size_t & top,bool del=true); C_F0 NewID(aType t,Key k, C_F0 & c,const ListOfId & l,size_t & top,bool del=true); template C_F0 NewFESpace(Key k,aType t,size_t & top,const basicAC_F0 &args); friend ostream & operator<<(ostream & f,const TableOfIdentifier & ); vectorOfInst* newdestroy(); C_F0 destroy(); TableOfIdentifier() ; //: listofvar(0) {}; ~TableOfIdentifier(); // }; // <> for all the type of the language 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; typedef OneOperator * CastFunc; typedef map::const_iterator const_cast_iterator; typedef const char * Key; // virtual void print(ostream &f,const void *p) const =0; friend ostream & operator<<(ostream & f,const basicForEachType & e) { f << '<' << e.name() << '>' ;return f;} void Show(ostream & f) const ; 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);} // virtual Type_Expr init(const Type_Expr & te) const { return Type_Expr(0,0);} virtual int TYPEOFID() const {return 0;} // bool SametypeLeft(const basicForEachType * t) const {return t == this;} // bool To(const basicForEachType * t) const { throwassert(t && this);return un_ptr_type == this ? t->un_ptr_type == this : t == this;} virtual C_F0 CastTo(const C_F0 & e) const ; virtual void SetArgs(const ListOfId *lid) const ;// { cout << "SetArgs::\n " ;throwassert(lid==0 || lid->size()==0);} aType right() const {return un_ptr_type;}; Expression RightValueExpr(Expression f) const; // Type_Expr NewVar(Key k,aType t,size_t & top,const C_F0 &i); virtual C_F0 Initialization(const Type_Expr & e) const ; virtual Expression Destroy(const C_F0 &) const ; virtual bool ExistDestroy() const {return destroy;} virtual Type_Expr SetParam(const C_F0 & c,const ListOfId * l,size_t & top) const; virtual Expression OnReturn(Expression f) const; // { return make_pair(this,c.left());} protected: basicForEachType(const type_info & k ,const size_t , const E_F1_funcT_Type * p=0,basicForEachType *rr=0, Function1 iv=0,Function1 id=0, Function1 dreturn=0) ; /* inline basicForEachType(const type_info & k ,const type_info & kf ,const size_t , const E_F1_funcT_Type * p=0,basicForEachType *rr=0, Function1 iv=0,Function1 id=0) ;*/ public: static const basicForEachType * type_C_F0; // for any type un formal operation .... FH add 09/2012 const basicForEachType * un_ptr_type; // type of right exp private: // map mapofcast; OneOperator * casting; // <> list of operator for casting to this type const E_F1_funcT_Type * un_ptr; // is ptr -> get value function Function1 DoOnReturn; // to call some thing on return. Function1 InitExp; // to init the ptr value Function1 destroy;// the destroy function TableOfIdentifier ti; // all polymorphisme of the Identifier public: // basicForEachType * FunctionType() const;// { return funct_type ? funct_type : (funct_type= new FuncForEachType(this));} C_F0 Find(const char * k) const; // {return ti->Find(k);} C_F0 Find(const char * k,const basicAC_F0 & args) const; // {return ti->Find(k);} void New(Key k,Type_Expr v,bool del=true){ti.New(k,v,del);} void Add(Key k,Key op,OneOperator *p0,OneOperator *p1=0, OneOperator *p2=0,OneOperator *p3=0,OneOperator *p4=0, OneOperator *p5=0,OneOperator *p6=0) {ti.Add(k,op,p0,p1,p2,p3,p4,p5,p6);} void AddCast(CastFunc f1,CastFunc f2=0,CastFunc f3=0,CastFunc f4=0, CastFunc f5=0,CastFunc f6=0,CastFunc f7=0,CastFunc f8=0); ostream & ShowTable(ostream & f) const { f << ti; return f;} // basicForEachType * funct_type; virtual ~basicForEachType(); // Add FH: for implicite loop FH. Jan 2016 // type for i, type for j, type valeur basicForEachType *typei,*typej,*typev; void SetTypeLoop(basicForEachType *v,basicForEachType *i=0,basicForEachType *j=0) { typev=v; typei=i;typej=j;} }; template inline basicForEachType * atype() { map::iterator ir=map_type.find(typeid(T).name()); // basicForEachType * r=map_type[]; if (ir == map_type.end()) { cerr << "Error: aType '" << typeid(T).name() << "', doesn't exist\n"; ShowType(cerr); throw(ErrorExec("exit",1));} return ir->second;} template inline basicForEachType * atype0() { map::iterator ir=map_type.find(typeid(T).name()); if (ir == map_type.end()) return 0; return ir->second;} // -------- //typedef basicForEachType TheType; // const basicForEachType * ktype; // compilation time // class for all exp // a left exp is a pointer expression // ------- // -- exec times le code is just E_F0*(fonction without args) class C_LF2; class C_LF1; // 3 types of function/expression 0,1,2 args /// <> is the base class for all expressions built by parsing an EDP script in the grammar of the FreeFem++ /// language (see [[file:../lglib/lg.ypp]]). E_F0 pointers are typed as [[Expression]], stored as a list in /// [[ListOfInst]], and evaluated when CListOfInst::eval() [[file:AFunction.hpp::CListOfInst::eval]] is called at /// [[file:../lglib/lg.ypp::evaluate_parsed_FF_script]] (see \ref index). No internal data member. class E_F0 :public CodeAlloc { public: static E_F0 *tnull; struct kless : binary_function { bool operator()(const Expression& x, const Expression& y) const{ //cout << x << " " << y << x->compare(y) << " ::: "; int r1 = x->compare(y);// , r2 = y->compare(x); //assert(r1+r2==0); return r1<0;} }; typedef map< E_F0 *,int,kless> MapOfE_F0; virtual AnyType operator()(Stack) const =0; 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;} virtual bool EvaluableWithOutStack() const {return false;} // virtual bool MeshIndependent() const {return true;} // virtual bool Zero() const {return false;} // virtual E_F0 * right_E_F0() const { return 0;} virtual bool ReadOnly() const { return true;} // the expression do not change the memory virtual ~E_F0() {} virtual int compare (const E_F0 *t) const { int r= (t==this) ? 0 : ( ( this > &l,MapOfE_F0 & m, size_t & n) ; // build optimisation virtual AnyType operator()(Stack stack,AnyType *) const { return operator()(stack);} // call optim code virtual operator aType () const { assert(0);return 0;} // the type of the expression virtual ostream & dump(ostream &f) const { f << ' ' << typeid(*this).name() << ' ' << this << ' ' ;return f; } // for OPTIMIZATION int find(const MapOfE_F0 & m) ; int insert(Expression opt,deque > &l,MapOfE_F0 & m, size_t & n) ; // ajoute for optimisation to say if a expression in meshindep a exec time // to solve 0*x // question // juin 2007 FH virtual AnyType eval(Stack stack, bool & meshindep ) const { meshindep=MeshIndependent();return operator()(stack);} }; inline ostream & operator<<(ostream & f,const E_F0 &e) { if(!e.Empty()) e.dump(f); else f << " --0-- " ;return f;} /// <> Specialization of [[E_F0]] where MeshIndependent() always returns false instead of true. class E_F0mps : public E_F0 { public: virtual bool MeshIndependent() const {return false;} // }; class E_F0info : public E_F0 { public: // not a real expression just to pass information virtual bool EvaluableWithOutStack() const {return true;} // virtual bool MeshIndependent() const {return true;} // virtual AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} }; class E_F1 : public CodeAlloc{ public: virtual AnyType operator()(Stack,AnyType &) const =0;}; class E_F2 : public CodeAlloc{ public: virtual AnyType operator()(Stack,AnyType &,AnyType &) const =0;}; class E_FN : public CodeAlloc{ public: virtual AnyType operator()(Stack,size_t N,...) const =0;}; // class to play with polymorphisme // --------------------------------- class basicAC_F0; class ArrayOfaType : public CodeAlloc{ // class for the type of parameter aType tt[11]; protected: int n; aType * t; // array of type bool ellipse; void operator=(const ArrayOfaType &); // no set operator public: // ArrayOfaType() :n(0),t(0),ellipse(false) {} explicit ArrayOfaType(bool ell=false) :n(0),t(0),ellipse(ell) {} explicit ArrayOfaType(const aType & a,bool ell=false) :n(1),t(tt),ellipse(ell) {t[0]=a;} explicit ArrayOfaType(const aType & a,const aType & b,bool ell=false) :n(2),t(tt),ellipse(ell) {t[0]=a,t[1]=b;} explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,bool ell=false) :n(3),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;} explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,bool ell=false) :n(4),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; /* cout << * a << *b << * c << * d << " ---------" << endl; */} explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e,bool ell=false) :n(5),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; } explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e,const aType & f,bool ell=false) :n(6),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; } explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e, const aType & f,const aType & g, bool ell=false) :n(7),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; t[6]=g; } // (6 args) Added by Fabian Dortu explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e, const aType & f,const aType & g,const aType & h, bool ell=false) :n(8),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; t[6]=g; t[7]=h; } // (7 args) Added by Fabian Dortu explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e, const aType & f,const aType & g,const aType & h, const aType & i, bool ell=false) :n(9),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; t[6]=g; t[7]=h; t[8]=i; } // (8 args) Added by Fabian Dortu explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d, const aType & e, const aType & f,const aType & g,const aType & h, const aType & i, const aType & j, bool ell=false) :n(10),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; t[6]=g; t[7]=h; t[8]=i; t[9]=j; } // (10 args) Added by Fabian Dortu explicit ArrayOfaType(const aType & a,const aType & b,const aType & c,const aType & d,const aType & e,const aType & f,const aType & g,const aType & h, const aType & i, const aType & j, const aType & k,bool ell=false) :n(11),t(tt),ellipse(ell) {t[0]=a,t[1]=b;t[2]=c;t[3]=d; t[4]=e; t[5]=f; t[6]=g; t[7]=h; t[8]=i; t[9]=j; t[10]=k; } // (10 args) Added by Fabian Dortu ArrayOfaType(const basicAC_F0 & ) ; ArrayOfaType(const ArrayOfaType & ); // ArrayOfaType(const ListOfId * l); ~ArrayOfaType() { if(t && t != tt) delete [] t;t=0;n=0;} bool WithOutCast( const ArrayOfaType & a) const ; bool WithCast( const ArrayOfaType & a,int nbcast=100000) const ; // return the number of cast // exactly comparaison bool operator==( const ArrayOfaType & a) const { if (a.n != n || a.ellipse !=ellipse) return false; for (int i=0;i> Base class for all language operators. Daughter classes have the same name with several extensions: /// "[1-9]" represent the number of operator arguments, "_" designates operators that take a reference instead of a /// copied argument, "s" designates operators that require a stack argument. class OneOperator : public ArrayOfaType { friend class MakeVectSpaceN; friend class basicForEachType; const basicForEachType * r; // return type OneOperator *next; // to make a list of OneOperator public: int pref; // to try to solve ambiguity for binary operator // 10 for bool, 20 for int , 30 for long , 40, for float, 50 double, 60 for complex, 70 string // string+ 1 => string // 1+string => string OneOperator(aType rr) ;// : r(rr),ArrayOfaType(),next(0),pref(0) {throwassert(r);} OneOperator(aType rr,aType a) ;//: r(rr),ArrayOfaType(a,false),next(0),pref(0) {throwassert(rr && a );} OneOperator(aType rr,aType a,aType b);// : r(rr),ArrayOfaType(a,b,false),next(0),pref(0) { // throwassert(rr && a && b);} OneOperator(aType rr,aType a,aType b,aType c) ; //: r(rr),ArrayOfaType(a,b,c,false),next(0),pref(0) {throwassert(rr && a && b && c);} OneOperator(aType rr,aType a,aType b,aType c,aType d) ; //: r(rr),ArrayOfaType(a,b,c,d,false),next(0),pref(0) {throwassert(rr && a && b && c);} OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e) ; //: r(rr),ArrayOfaType(a,b,c,d,e,false),next(0),pref(0) {throwassert(rr && a && b && c && d);} // Added by Fabian Dortu (5 parameters) OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f) ; //: r(rr),ArrayOfaType(a,b,c,d,e,f,false),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f);} // Added by Fabian Dortu (6 parameters) OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g); // : r(rr),ArrayOfaType(a,b,c,d,e,f,g,false),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g);} // Added by Fabian Dortu (7 parameters) OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h); // : r(rr),ArrayOfaType(a,b,c,d,e,f,g,h,false),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h);} // Added by Fabian Dortu (8 parameters) OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h, aType i) ; //: r(rr),ArrayOfaType(a,b,c,d,e,f,g,h,i,false),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h && i);} // Added by Fabian Dortu (9 parameters) OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h, aType i, aType j); // : r(rr),ArrayOfaType(a,b,c,d,e,f,g,h,i,j,false),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h && i && j);} // Added by Fabian Dortu (10 parameters) OneOperator(aType rr,const ArrayOfaType &ta) ; //: r(rr),ArrayOfaType(ta),next(0),pref(0) {throwassert(rr);} OneOperator(aType rr,bool ellipse) ; //: r(rr),ArrayOfaType(ellipse),next(0),pref(0) {throwassert(rr );} OneOperator(aType rr,const ListOfId *l) ; //: r(rr),ArrayOfaType(l),next(0),pref(0) {throwassert(rr );} typedef pair pair_find; void operator+=(OneOperator &a){throwassert(a.next==0);a.next=next;next=&a;} // a way to make none recurve delete good virtual ~OneOperator(); pair_find Find(const ArrayOfaType & at) const ; pair_find FindWithOutCast(const ArrayOfaType & at) const ; // for OneOperator * FindSameR(const ArrayOfaType & at) ; void Show(const ArrayOfaType & at,ostream &f=cerr) const; void Show(ostream &f=cerr) const; operator aType () const { return r;} // <> virtual E_F0 * code(const basicAC_F0 &) const =0; virtual C_F0 code2(const basicAC_F0 &a) const ; // {return code(code(a),r);} const OneOperator * Simple() const { return next||n?0:this;} friend ostream & operator<<(ostream & f,const OneOperator & a); }; /// <> class Polymorphic: public E_F0mps // [[E_F0mps]] { // a list of type // simple, array or function private: typedef const char * Key; typedef OneOperator * Value; // struct Keyless : binary_function // { bool operator()(const Key& x, const Key& y) const{ return strcmp(x,y)<0;} }; typedef map maptype; // typedef maptype::const_iterator const_iterator; // typedef maptype::iterator iterator; // // remark the map is mutable because // a expression is const E_F0 * // So There is a incompatibility between // we save an expression in a variable // we have to add thing to a polymorphisme expression mutable maptype m; // all polymorphisme of the Identifier Expression e; // default expression public: Polymorphic() : m(),e(0) {} // by default Empty and do nothing virtual AnyType operator()(Stack ) const { return Nothing;} virtual bool Empty() const {return true;} // by default Empty void clear() { m.clear();} const OneOperator * Find(const char *op, const ArrayOfaType &at) const; const OneOperator * FindWithOutCast(const char *op,const ArrayOfaType &at) const; void Show(const char *op,const ArrayOfaType & at,ostream &f=cerr)const ; void Add(const char * op,OneOperator * p0 ,OneOperator * p1=0,OneOperator * p2=0, OneOperator * p3=0,OneOperator * p4=0,OneOperator * p5=0, OneOperator * p6=0,OneOperator * p7=0,OneOperator * p8=0, OneOperator * p9=0,OneOperator * pa=0,OneOperator * pb=0, OneOperator * pc=0,OneOperator * pd=0,OneOperator * pe=0 ) const {Addp(op,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,0);} void Add(const char * op,OneOperator ** pp) const ; private: void Addp(const char * op,OneOperator * pp,...) const ; friend ostream & operator<<(ostream & f,const Polymorphic & a); }; /// <> The type for polymorphisme of id. Contains one [[Expression]] and the type that the expression will return /// [[file:../fflib/AnyType.hpp::aType]] (useful to select the right operator when using that type). class basicAC_F0; class C_F0 { friend class CC_F0; // cf [[CC_F0]] protected: Expression f; // the expression code, cf [[Expression]] aType r; // the expression type, cf [[file:../fflib/AnyType.hpp::aType]] public: // the constructeur C_F0() :f(0),r(0) {} C_F0(const C_F0 & c):f(c.f),r(c.r) {} C_F0(const C_F0 & a,const C_F0 & b); // concatenation /// cf [[Type_Expr]] C_F0(const Type_Expr & a):f(a.second),r(a.first) {} /// <> [[file:AFunction2.cpp::C_F0_constructor_pop_char_basicAC_F0_impl]] /// cf [[Polymorphic]] C_F0(const Polymorphic *,const char *,const basicAC_F0 & ); C_F0(const Polymorphic *,const char *, AC_F0 & ); // function, array .. C_F0(const C_F0 & e,const char *op,const basicAC_F0 & p) ; C_F0(const C_F0 & e,const char *op, AC_F0 & p) ; // <> [[C_F0_constructor_char_C_F0_impl]] C_F0(const C_F0 & e,const char *op,const C_F0 & ee); C_F0(const C_F0 & e,const char *op,const C_F0 & a,const C_F0 & b) ; C_F0(const C_F0 & e,const char *nm) ; // without parameter ex f(). cf [[Polymorphic]] C_F0(const Polymorphic * pop,const char *op); // unary operator C_F0(const Polymorphic * pop,const char *op,const C_F0 & a); // <> binary operator [[file:AFunction2.cpp::C_F0_constructor_binary]] C_F0(const Polymorphic * pop,const char *op,const C_F0 & a,const C_F0 & b); // ternary operator C_F0(const Polymorphic * pop,const char *op,const C_F0 & a,const C_F0 & b,const C_F0 & c); C_F0( Expression ff,aType rr ): f(ff),r(rr) { // cout << "C_F0: " << * rr << endl;// dec 2007 FH // if (!rr && ff) cerr << "Type Null" << endl; } // operator Expression() const {return f;} AnyType eval(Stack s) const {return (*f)(s);} Expression RightValue() const { return r->RightValueExpr(f);} Expression LeftValue() const; aType left() const {return r;} aType right() const {return r->right();} C_F0 RightExp() const { return C_F0(RightValue(),right());} // FH add 07/2005 operator E_F0 * () const {return f;} bool Empty() const {return !f || f->Empty();} bool NotNull() const {return f;} int TYPEOFID() const { return r ? r->TYPEOFID(): 0;} int nbitem() const { return f ? f->nbitem() : 0;} bool EvaluableWithOutStack() const { return f && f->EvaluableWithOutStack();} bool Zero() const { return !f || f->Zero();} Expression Destroy() { return r->Destroy(*this);} operator const Polymorphic * () const {return dynamic_cast(f);} bool operator==(const C_F0 & a) const {return f==a.f && r == a.r;} bool operator!=(const C_F0 & a) const {return f!=a.f || r != a.r;} // Type_Expr SetParam(const ListOfId * l,size_t & top) const ; bool MeshIndependent() const { return f ==0 ? f->MeshIndependent() : false;} C_F0 OnReturn() { f=r->OnReturn(f); return *this; } // Add mai 2009 (for return statment. private: friend class Block; friend class TableOfIdentifier; C_F0( Expression ff ): f(ff),r(0) {} }; // for bison [[CListOfInst]] class CListOfInst; // a => b // f => t||f // t => t // (a =>b) <=> (!a || b ) // warning ------------------ class ForTypeVoid: public basicForEachType{public: ForTypeVoid():basicForEachType(typeid(void),0,0,0,0,0) {} }; template class ForEachType: public basicForEachType{public: ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(T),sizeof(T),0,0,iv,id,OOnReturn) { if (sizeof(T) > sizeof(AnyTypeWithOutCheck) ) { cout << " Sorry the " < " << sizeof(AnyTypeWithOutCheck) << " ) " << endl; throwassert(sizeof(T) <= sizeof(AnyTypeWithOutCheck) ); } } }; template class ForEachType: public basicForEachType{public:// coorection july 2009..... FH Hoooo.... (Il y a un bug DUR DUR FH ...) ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(T),sizeof(T),0,0,iv,id,OOnReturn) { //T i= 0.0; } }; template AnyType UnRef(Stack,const AnyType &a) ; template AnyType Initialize(Stack,const AnyType &a) ; template AnyType Destroy(Stack,const AnyType &a) ; // the type of variable is pointer because we need to write in template class ForEachTypePtr: public basicForEachType { public: ForEachTypePtr(); ForEachTypePtr(Function1 init,Function1 dl,Function1 onreturn=0); ForEachTypePtr(Function1 dl); }; template class ForEachTypePtr: public basicForEachType { public: ForEachTypePtr(T* bb=0,Function1 onreturn=0); ForEachTypePtr(Function1 init,Function1 dl,Function1 onreturn=0); ForEachTypePtr(Function1 dl); }; template class ForEachTypePtrfspace: public ForEachTypePtr { public: ForEachTypePtrfspace():ForEachTypePtr() {} int TYPEOFID() const {return RTYPE;} }; class ForTypeAnyType: public basicForEachType{public: ForTypeAnyType(): basicForEachType(typeid(AnyType),sizeof(AnyType)) {} bool CastingFrom(const basicForEachType * ) const {return true;} C_F0 CastTo(const C_F0 & e) const {return e;} }; // for cast and get value associed to a pointer template AnyType Cast(Stack,const AnyType &b) { return SetAny(static_cast(GetAny(b)));} template AnyType FCast(Stack s,const AnyType &b) { return SetAny(Add2StackOfPtr2Free(s,F(GetAny(b))));} template AnyType UnRef(Stack,const AnyType &a) { return SetAny(*PGetAny(a));} template AnyType UnRef(Stack,const AnyType &a) { return SetAny(*GetAny(a));} template AnyType UnRefCopyPtr(Stack s,const AnyType &a) { A ** ppa=PGetAny(a); A * pc = new A(**ppa); return SetPtrAny(Add2StackOfPtr2Free(s,pc)) ;} template AnyType Initialize(Stack,const AnyType &x){ A * a=PGetAny(x); A *b=new A;// memcpy(a,b,sizeof(A));// bitcopy ::operator delete(b); // delete with no destruction return SetPtrAny(a); } template AnyType InitializePtr(Stack stack,const AnyType &x){ A * a=PGetAny(x); SHOWVERB( cout << " init ptr " << typeid(A*).name() << (char *) a - (char*) stack<< endl); *a=0; return x; } template AnyType InitializeDef(Stack stack,const AnyType &x){ A * a=PGetAny(x); SHOWVERB( cout << " init ptr " << typeid(A*).name() << (char *) a - (char*) stack<< endl); *a=A(); return x; } template inline AnyType Delete(Stack,const AnyType &x){ A * a=PGetAny(x); SHOWVERB(cout << "DESTROY " < inline AnyType Destroy(Stack,const AnyType &x){ A * a=PGetAny(x); SHOWVERB(cout << "DESTROY " <destroy(); return Nothing; } template inline AnyType DestroyS(Stack,const AnyType &x){ A a=GetAny(x); SHOWVERB(cout << "DESTROY " < inline AnyType InitS(Stack,const AnyType &x){ A a=GetAny(x); SHOWVERB(cout << "InitS " < inline AnyType InitP(Stack,const AnyType &x){ A *a=PGetAny(x); SHOWVERB(cout << "InitP " <init(); return Nothing; } template inline AnyType DestroyPtr(Stack,const AnyType &x) { const A * a=PGetAny(x); SHOWVERB(cout << "DestroyPtr " << typeid(A).name() << *a << endl); (*a)->destroy(); // delete *a; return Nothing; }; template inline AnyType DeletePtr(Stack,const AnyType &x) { const A * a=PGetAny(x); if(verbosity>99)cout << "DeletePtr " << typeid(A).name() << *a << endl; // (*a)->destroy(); delete *a; return Nothing; }; template<> AnyType inline DestroyPtr(Stack,const AnyType &x) { string ** a=PGetAny(x); SHOWVERB( cout << "DestroyPtr " << typeid(string*).name() << *a << endl); freestring(*a); return Nothing; }; template AnyType Initialize(Stack,const AnyType &x,const AnyType &y){ A * a=PGetAny(x); A *b=new A(GetAny(x));// memcpy(a,b,sizeof(A));// bitcopy ::operator delete(b); // delete with no destruction return PtrtoAny(a); } class E_F0_CFunc2 :public E_F0mps { public: CFunction2 f2; E_F0 *a,*b; AnyType operator()(Stack s) const {return f2(s,a,b);} E_F0_CFunc2( CFunction2 ff,E_F0 *aa,E_F0 *bb) : f2(ff),a(aa),b(bb){} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack() && b->EvaluableWithOutStack();} // operator aType () const { return atype();} }; class E_F0_CFunc4 :public E_F0mps { public: CFunction4 f4; E_F0 *a,*b,*c,*d; AnyType operator()(Stack s) const {return f4(s,a,b,c,d);} E_F0_CFunc4( CFunction4 ff,E_F0 *aa,E_F0 *bb,E_F0 *cc,E_F0 *dd) : f4(ff),a(aa),b(bb),c(cc),d(dd){} operator aType () const { return atype();} }; template class E_F1_F :public E_F1 { public: typedef R (*func)(A) ; func f; E_F1_F(func ff) : f(ff) {} AnyType operator()(Stack s,AnyType & a) const {return SetAny(f(GetAny(a)));} }; template class E_F2_F :public E_F2 { public: typedef R (*func)(const A0 &,const A1&) ; func f; E_F2_F(func ff) : f(ff) {} AnyType operator()(Stack s,AnyType & a0,AnyType & a1) const {return SetAny(f(GetAny(a0),GetAny(a1)));} }; template class E_F_F0 :public E_F0 { public: template struct remove_reference {typedef T type;}; // template struct remove_reference {typedef T type;}; template struct remove_reference {typedef T type;}; typedef typename remove_reference::type A0; typedef R (*func)( TA0 ) ; func f; Expression a; E_F_F0(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {return SetAny(f(GetAny( (*a)(s) )));} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack();} // bool MeshIndependent() const {return a->MeshIndependent();} // bool ReadOnly() const { return RO ;} int compare (const E_F0 *t) const { int rr; // cout << "cmp " << typeid(*this).name() << " and " << typeid(t).name() << endl; const E_F_F0* tt=dynamic_cast(t); if (tt && f == tt->f) rr = a->compare(tt->a); else rr = E_F0::compare(t); return rr; } // to give a order in instuction int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) ; virtual ostream & dump(ostream &ff) const { ff << typeid(*this).name() <<" f= " << f << " a= "<< *a << ' ' ;return ff; } }; // modif for xlc++ FH template class E_F_F0_Opt: public E_F_F0 { public : size_t ia; E_F_F0_Opt(const E_F_F0 &t,size_t iaa) : E_F_F0(t) , ia(iaa) {assert(iaa<2000000 && iaa >0);} AnyType operator()(Stack s) const { // A0 x = *static_cast(static_cast(static_cast(s)+ia)); // cout << " opt f (" << x << " ) = " << ": " << ia << endl; return SetAny( this->f( *static_cast::A0 *>(static_cast(static_cast(s)+ia)) ) );} }; template int E_F_F0::Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; return insert(new E_F_F0_Opt(*this,a->Optimize(l,m,n)),l,m,n); } // fin modif xlc++ template class E_VF_F0 :public E_F0 { public: typedef void (*func)( A0 ) ; func f; Expression a; E_VF_F0(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {f(GetAny( (*a)(s) ));return Nothing;} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack();} // bool MeshIndependent() const { return a->MeshIndependent(); } }; inline int clexico(int i,int j) { return i==0 ? j : i;} inline int clexico(int i,int j,int k) { int ll=clexico(i,j); return ll==0 ? k : ll;} template class E_F_F0F0 :public E_F0 { public: template struct remove_reference {typedef T type;}; template struct remove_reference {typedef T type;}; typedef typename remove_reference::type A0; typedef typename remove_reference::type A1; typedef R (*func)( A0 , A1 ) ; func f; Expression a0,a1; E_F_F0F0(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) {} AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)) , GetAny((*a1)(s)) ) );} bool EvaluableWithOutStack() const {return a0->EvaluableWithOutStack() && a1->EvaluableWithOutStack();} // bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent();} // int compare (const E_F0 *t) const { int rr; // cout << "cmp " << typeid(*this).name() << " and " << typeid(t).name() << endl; const E_F_F0F0* tt=dynamic_cast(t); if (tt && f == tt->f) rr= clexico(a0->compare(tt->a0),a1->compare(tt->a1)); else rr = E_F0::compare(t); return rr; } // to give a order in instuction int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) ; }; // modif for xlc++ template class E_F_F0F0_Opt: public E_F_F0F0 { public : size_t ia,ib; E_F_F0F0_Opt(const E_F_F0F0 &t,size_t iaa,size_t ibb) : E_F_F0F0(t) , ia(iaa),ib(ibb) {} AnyType operator()(Stack s) const { //A0 aa =*static_cast(static_cast(static_cast(s)+ia)); //A1 bb=*static_cast(static_cast(static_cast(s)+ib)) ; //cout << ia << " " << ib << "f( " << aa << "," << bb << " ) = "<< f(aa,bb) << endl; return SetAny( this->f( *static_cast::A0 *>(static_cast(static_cast(s)+ia)) , *static_cast::A1 *>(static_cast(static_cast(s)+ib)) ) );} }; template int E_F_F0F0::Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; return insert(new E_F_F0F0_Opt(*this,a0->Optimize(l,m,n),a1->Optimize(l,m,n)),l,m,n); } // add modif for xlc++ template class E_F_F0_ :public E_F0 { public: typedef R (*func)(const A0& ) ; func f; Expression a; E_F_F0_(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {return SetAny(f(GetAny( (*a)(s) )));} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack() ;} // bool MeshIndependent() const {return a->MeshIndependent();} // }; // add FH 07/2008 for pmesh clean template class E_F_F0_Add2RC :public E_F0 { public: typedef R (*func)(const A0& ) ; func f; Expression a; E_F_F0_Add2RC(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {return SetAny(Add2StackOfPtr2FreeRC(s,f(GetAny( (*a)(s) ))));} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack() ;} // bool MeshIndependent() const {return a->MeshIndependent();} // }; // end add. template class E_F_F0s_ :public E { public: typedef R (*func)(Stack stack,const A0& ) ; func f; Expression a; E_F_F0s_(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {return SetAny(f(s,GetAny( (*a)(s) )));} // bool MeshIndependent() const {return true;} // def in E operator aType () const { return atype();} }; template class E_F_F0F0_ :public E { public: typedef R (*func)(const A0 &,const A1 & ) ; func f; Expression a0,a1; E_F_F0F0_(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) {} AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)) , GetAny((*a1)(s)) ) );} bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent();} // }; // FH Add 07/2008 // class with add 1 to the refcounter for mesh . template class E_F_F0F0_Add2RC :public E { public: typedef R (*func)(const A0 &,const A1 & ) ; func f; Expression a0,a1; E_F_F0F0_Add2RC(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) {} AnyType operator()(Stack s) const {return SetAny(Add2StackOfPtr2FreeRC(s, f( GetAny((*a0)(s)) , GetAny((*a1)(s)) ) ));} bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent();} // }; // FH end 07/2008 template class E_F_F0F0F0_ :public E { public: typedef R (*func)(const A0 &,const A1 & , const A2 &) ; func f; Expression a0,a1,a2; E_F_F0F0F0_(func ff,Expression aa0,Expression aa1,Expression aa2) : f(ff),a0(aa0),a1(aa1),a2(aa2) {} AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)) , GetAny((*a1)(s)),GetAny((*a2)(s)) ) );} virtual size_t nbitem() const {return a2->nbitem(); } bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent();} // }; template class E_F_stackF0F0F0_ :public E_F0mps { public: typedef R (*func)(Stack, const A0 &,const A1 & , const A2 &) ; func f; Expression a0,a1,a2; E_F_stackF0F0F0_(func ff,Expression aa0,Expression aa1,Expression aa2) : f(ff),a0(aa0),a1(aa1),a2(aa2) {} AnyType operator()(Stack s) const {return SetAny( f(s, GetAny((*a0)(s)) , GetAny((*a1)(s)),GetAny((*a2)(s)) ) );} virtual size_t nbitem() const {return a2->nbitem(); } bool MeshIndependent() const { return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent();} }; template class E_F_F0F0_NC :public E_F0 { public: typedef R (*func)( A0 &,const A1 & ) ; func f; Expression a0,a1; E_F_F0F0_NC(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) {} AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)) , GetAny((*a1)(s)) ) );} bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent() ; } // }; class E_F_StackF0F0 :public E_F0mps { public: typedef AnyType (*func)(Stack,Expression ,Expression ) ; func f; Expression a0,a1; E_F_StackF0F0(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) { } AnyType operator()(Stack s) const {return (*f)(s, a0 , a1) ;} }; /* class E_F_F0F0_ :public E_F0 { public: typedef AnyType (*func)(const AnyType &,const AnyType & ) ; func f; Expression a0,a1; E_F_F0F0_(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) {} AnyType operator()(Stack s) const {return f( (*a0)(s) , (*a1)(s) );} bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent() ; } // }; */ class E_F2_func :public E_F2 { public: Function2 f; AnyType operator()(Stack s,AnyType & a,AnyType & b) const {return f(s,a,b);} E_F2_func( Function2 ff) : f(ff) {} }; class E_F0_Func1 :public E_F0 { public: Function1 f; E_F0 *a; AnyType operator()(Stack s) const {return f(s,(*a)(s));} E_F0_Func1( Function1 f1,E_F0 *aa) : f(f1),a(aa){} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack();} // bool MeshIndependent() const {return a->MeshIndependent();} // int compare (const E_F0 *t) const { int rr; const E_F0_Func1* tt=dynamic_cast(t); if (tt && f == tt->f) rr = a->compare(tt->a); else rr = E_F0::compare(t); if(tt && 0) { cout << "\n\t\t\t -------- " << (void *) f << " " << (void *) tt->f << " rr=" << a->compare(tt->a) << endl; cout << "\t\t\tcmp E_F0_Func1 " << rr <<" << " << *this << " cmp " << *t << " " << tt << ">>\n"; } return rr; } // to give a order in instuction // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &ff) const { ff << "E_F0_Func1 f= " << f << " a= "<< *a << ' ' ;return ff; } }; class E_F0_Func2 :public E_F0 { public: Function2 f; E_F0 *a,*b; AnyType operator()(Stack s) const {return f(s,(*a)(s),(*b)(s));} E_F0_Func2( Function2 f1,E_F0 *aa,E_F0 *bb) : f(f1),a(aa),b(bb){} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack() &&b->EvaluableWithOutStack();} // bool MeshIndependent() const {return a->MeshIndependent() && b->MeshIndependent();} // }; // the variable offset / stack (local variable) template class Value1:public E_F0 { size_t offset; public: AnyType operator()(Stack s) const { return SetAny(static_cast(static_cast( static_cast(s)+offset)));} Value1(size_t o):offset(o) {} }; // the variable globale template class GValue:public E_F0 { mutable R v; public: AnyType operator()(Stack ) const { return SetAny(static_cast(static_cast(&v)));} GValue(R o):v(o) {} bool EvaluableWithOutStack() const {return true;} // }; // a constante value template int ccompare(const R & a,const R& b){ return a==b ? 0 :( a int ccompare(const complex & a,const complex& b){ int c=ccompare(a.real(),b.real()); return c==0 ? ccompare(a.imag(),b.imag()): c ;} template class EConstant:public E_F0 { const R v; public: AnyType operator()(Stack ) const { /*cout << " ()" << v << endl*/;return SetAny(v);} EConstant(const R & o):v(o) { /*cout << "New constant " << o << endl;*/} bool EvaluableWithOutStack() const {return true;} // operator aType () const { return atype();} bool Zero()const { return v == R();} int compare (const E_F0 *t) const { int rr; const EConstant * tt=dynamic_cast(t); if (tt) rr = ccompare(v,tt->v); else rr = E_F0::compare(t); return rr; } ostream & dump(ostream &f) const { f << " ((" <name() << endl); // return PtrtoAny(static_cast(static_cast(s)+offset),t);} return PtrtoAny(Stack_offset(s,offset),t);} LocalVariable(size_t o,aType tt):offset(o),t(tt) {throwassert(tt); SHOWVERB(cout << "\n--------new var " << offset << " " << t->name() << endl); } }; class LocalVariableFES : public LocalVariable { public: size_t data; LocalVariableFES(size_t o,aType tt,const size_t & d) : LocalVariable(o,tt),data(d) {} size_t nbitem() const { return data;} }; template class LocalVariablePlus : public LocalVariable { public: U data; LocalVariablePlus(size_t o,aType tt,const U & d) : LocalVariable(o,tt),data(d) {} }; // global variable bof bof template class PValue:public E_F0 { T * p; public: AnyType operator()(Stack ) const { return p;} PValue(T * pp):p(pp) {} }; // global variable bof bof // value througth a pointeur add F.H july 2014 template class dPValue:public E_F0 { T * p; public: AnyType operator()(Stack ) const { return SetAny(*p);} dPValue(T * pp):p(pp) {} }; template class PPValue:public E_F0 { R ** p; public: AnyType operator()(Stack ) const { return SetAny(*p);} PPValue(R ** pp):p(pp) {} }; template Type_Expr CPValue(R & v) { throwassert(map_type[typeid(R*).name()]); return make_pair(map_type[typeid(R*).name()],new PValue(&v)); } template Type_Expr dCPValue(R * v) { throwassert(map_type[typeid(R).name()]); return make_pair(map_type[typeid(R).name()],new dPValue(v)); } template Type_Expr CPPValue(R *& v) { throwassert(map_type[typeid(R*).name()]); return make_pair(map_type[typeid(R*).name()],new PPValue(&v)); } // <> returns [[Type_Expr]] template Type_Expr CConstant(const R & v) { throwassert(map_type[typeid(R).name()]); return make_pair(map_type[typeid(R).name()],new EConstant(v)); } /// <>, same as [[C_F0]] but without constructor/destructor to be used in union [[file:../lglib/lg.ypp::YYSTYPE]] class vectorOfInst; class CC_F0 { Expression f; // [[Expression]] aType r; public: void operator=(const C_F0& c) { f=c.f;r=c.r;;} void operator=(const AC_F0& a) ; //{ f=new E_Array(a); f= atype();}; void operator=(long ) {f=0;r=0;} void operator=(const CListOfInst& c);//{ C_FO cc=c;f=cc.f;r=cc.r} operator C_F0 () const {return C_F0(f,r);} bool Empty() const {return !f || f->Empty();} aType left() const {return r;} // operator const C_F0 &() const {return *this;} }; /// <> class ListOfInst : public E_F0mps // [[E_F0mps]] { int n; Expression * list; int * linenumber; int * lsldel; const int nx; vectorOfInst * atclose; // Sep 2017 FH // add sep. 2016 FH public: ListOfInst():n(0),list(0),linenumber(0),lsldel(0),nx(10),atclose(0){} ListOfInst(int nn):n(0),list(0),linenumber(0),lsldel(0),nx(nn?nn:10),atclose(0) {} void Add(const C_F0 & ins); /// <> implemented at [[file:AFunction2.cpp::ListOfInst::operator()]] AnyType operator()(Stack s) const; // AnyType reval(Stack s,int & i) const; // eval of Routine // AnyType rcleaneval(Stack s,int & i) const; // clean of Routine operator aType () const { return n ? (aType) * (list[n-1]) : atype();} Expression &operator[](int i){return list[i];} bool empty() const {return n==0;} int size() const {return n;} Expression * ptr() const {return list;} int * nlines() const {return linenumber;} void setclose(vectorOfInst * at) {atclose=at;} // Sep 2017 FH ~ListOfInst(){ // cout << " ----- ~ListOfInst " << endl; if(list) delete [] list; list=0; if(linenumber) delete[] linenumber; if(lsldel) delete[] lsldel; linenumber=0; lsldel=0; } }; /// <> used in [[file:../lglib/lg.ypp::YYSTYPE]] class CListOfInst{ private: /// class [[ListOfInst]] ListOfInst * f; const basicForEachType *r; public: void operator=(const CC_F0 &a){ f=new ListOfInst(); if( !a.Empty() ) { f->Add(a); r=a.left(); }} CListOfInst & operator+=(const CC_F0 & a);//{ if( !a.Empty()){ f->Add(a);r=a.left();};return *this;} void setclose( vectorOfInst * fin) { assert(f); if(verbosity>99999) cout << "CListOfInst: setclose n " << f->size() << " " << f << " " << fin << endl; f->setclose(fin); } operator C_F0 () const { return C_F0(f,r);} operator ListOfInst * () const { return f;} /// <> Called by yyparse() at [[file:../lglib/lg.ypp::start_symbol]] to evaluate the /// complete expression tree when reaching the end of its "start" symbol. It calls ListOfInst::operator()() at /// [[ListOfInst::operator()]] for its private [[ListOfInst]] pointer #f. void eval(Stack s) {(*f)(s);} int size() const {return f->size();} Expression * ptr() const {return f->ptr();} int * nlines() const { return f->nlines();} }; AnyType FWhile(Stack ,E_F0 * test,E_F0 * ins); AnyType FFor(Stack s ,E_F0 * i0,E_F0 * i1,E_F0 * i2,E_F0 * ins); AnyType FIf(Stack s ,E_F0 * test,E_F0 * i1,E_F0 * i2,E_F0 * notuse); AnyType TTry(Stack s ,E_F0 * i0,E_F0 * i1,E_F0 * i2,E_F0 * notuse); /// <> Contains all FreeFem++ language keywords. Definition in [[file:global.cpp::Global]], uses [[TableOfIdentifier]] extern TableOfIdentifier Global; void ShowType(ostream & ); template inline C_F0 to(const C_F0 & a) { return map_type[typeid(T).name()]->CastTo(a);} /* inline C_F0 toBool(const C_F0 & a) {return ATYPE(bool)->CastTo(a);} inline C_F0 toInt(const C_F0 & a) {return ATYPE(int)->CastTo(a);} inline C_F0 toLong(const C_F0 & a) {return ATYPE(long)->CastTo(a);} inline C_F0 toDouble(const C_F0 & a) {return ATYPE(double)->CastTo(a);} inline C_F0 toComplex(const C_F0 & a) {return ATYPE(Complex)->CastTo(a);} */ inline C_F0 While(C_F0 test,C_F0 ins) {return C_F0(new E_F0_CFunc2(FWhile,to(test),ins),0);} inline C_F0 For(C_F0 i0,C_F0 i1,C_F0 i2,C_F0 ins) {return C_F0(new E_F0_CFunc4(FFor,i0,to(i1),i2,ins),0);} inline C_F0 Try(C_F0 i0,C_F0 i1,C_F0 i2) {return C_F0(new E_F0_CFunc4(TTry,i0,i1,i2,0),0);} inline C_F0 Try(C_F0 i0,C_F0 i1) {return C_F0(new E_F0_CFunc4(TTry,i0,i1,0,0),0);} inline C_F0 FIf(C_F0 i0,C_F0 i1,C_F0 i2) {return C_F0(new E_F0_CFunc4(FIf,to(i0),i1,i2,0),0);} inline C_F0 FIf(C_F0 i0,C_F0 i1) {return C_F0(new E_F0_CFunc4(FIf,to(i0),i1,0,0),0);} //inline C_F0 C_F0::PtrValue() const{ // if (!(r && r->un_ptr)) { cerr << "PtrValue: Not a Left value " << *r << endl;CompileError();} // return C_F0(new E_F0_Func1(r->un_ptr->f,f),r->un_ptr->r);} /// <> version de base d'un tableau d'un parametres pour les operateurs unaire, binaire, pas d'allocation class basicAC_F0 { friend class E_Array; // for mapping fonction protected: typedef const C_F0 const_C_F0; int nb; C_F0 *a; public: typedef map maptype ; typedef maptype::iterator iterator; typedef maptype::const_iterator const_iterator; maptype * named_parameter; basicAC_F0 & operator=(int i) {throwassert(i==0);named_parameter=0,nb=0;return *this;} // pas de parametres basicAC_F0 & operator=(C_F0 & c) {named_parameter=0;nb=1;a=&c;return *this;} basicAC_F0 & operator=(pair p) {named_parameter=0;nb=p.first;a=p.second;return *this;} const C_F0 & operator [] (int i) const {throwassert(a && ifind(k) ; if (i == named_parameter->end() ) return C_F0(); else return i->second;} else return C_F0();} struct name_and_type{ const char * name; const type_info * type; } ; void SetNameParam(int n=0,name_and_type *l=0 , Expression * e=0) const ; }; /// <> array of parameters for FF language operators. uses [[basicAC_F0]] class AC_F0: public basicAC_F0 { // a Array of [[C_F0]] // tableau d'un parametres max 1024 parametres // avec allocation const static int MaxSize; // no constructor in this class (this class is in a union ) public: AC_F0 & operator=(pair p) { named_parameter=0; a=new C_F0[MaxSize]; nb=0;Add(p.first,p.second);return *this;} AC_F0 & operator+=(pair p) {Add(p.first,p.second);return *this;} AC_F0 & operator=(long k) {throwassert(k==0);named_parameter=0;a=new C_F0[MaxSize]; nb=0;return *this;} AC_F0 & operator=(const C_F0& c) {named_parameter=0; a=new C_F0[MaxSize]; nb=0;a[nb++]=c;return *this;} AC_F0 & operator+=(const C_F0& c) { if ( ! (a&& nb 1024"); a[nb++]=c;return *this;} AC_F0 & Add(const char * nm,const C_F0 &c) { if (!named_parameter) named_parameter=new maptype(); iterator i=named_parameter->find(nm); if(i==named_parameter->end()) named_parameter->insert(make_pair(nm,c)); else {cerr << " the named in the list already exists "<< nm <> class E_Array :public E_F0 { public: basicAC_F0_wa *v;// the value E_Array(const basicAC_F0 & aa) : v(new basicAC_F0_wa(aa)) {throwassert(v);} AnyType operator()(Stack) const { cerr << " No evaluation of an E_array" << endl; throwassert(0); return Nothing;} const C_F0 & operator [] (int i) const {throwassert(v );return (*v)[i];} int size() const {return v->size();} size_t nbitem() const {return v->size();} void map(C_F0 (*mapping)(const C_F0 & )) const { for (int i=0;isize();i++) v->a[i]=(*mapping)(v->a[i]);} virtual bool MeshIndependent() const { for (int i=0;isize();i++) if (v->a[i].MeshIndependent()) return false; return false; } // operator aType () const { return atype();} }; class PlotStream; class E_Border ; class E_BorderN :public E_F0mps { public: const E_Border * b; int cas;// 0 long , 1, KN_ , 2 : Array // FH april 14 .. Expression n; const E_BorderN * next; static int Cas(C_F0 nn) { if( atype()->CastingFrom(nn.left())) return 0; else if(atype >()->CastingFrom(nn.left())) return 1; else if( atype< const E_Array * >()->CastingFrom(nn.left()) ) { E_Array & a = *dynamic_cast< E_Array *>((Expression) nn); ffassert(a); a.map(::to); // a[i]=CastTo(a[i]); return 2; } else CompileError(" Number of element of a border ( longn , int array, [ ] array "); return -1; // bug } E_BorderN(const E_Border * bb, C_F0 nn,const E_BorderN * nx=0) ; E_BorderN(const E_BorderN & bb,const E_BorderN * nx) : b(bb.b),n(bb.n),cas(bb.cas),next(nx) { int kk=1; if(bb.next) {// modif FH. 13/02/2008 const E_BorderN ** pnext = &next; E_BorderN *pp; next = bb.next; // copy bb; for(int step=0;step<2;++step) { while (*pnext) { kk++; pp = new E_BorderN(**pnext); // copy *pnext = pp; pnext = & pp->next; } if(step==0) *pnext= nx; // copy de nx } // cout << " BorderN : nb item : " << kk << " == " << size()<< endl; } } AnyType operator()(Stack) const { return SetAny(this);} operator aType () const { return atype();} int size() const { int k=0;for(const E_BorderN *pp=this;pp; pp=pp->next) k++; return k;} E_BorderN * operator+( const E_BorderN & bb) const { throwassert(bb.next==0); return new E_BorderN(bb,this);} static C_F0 to(int cas, C_F0 nn) { if(cas==0) return ::to(nn); else if(cas ==1) return ::to >(nn); else if(cas == 2) return ::to (nn); else ffassert(0); // Big bug .. FH .. } long Nbseg(Stack stack,int index) const { if(cas==0) {assert(index==0); return GetAny((*n)(stack));} else if (cas==1 ) return (GetAny >((*n)(stack)))(index); else if (cas==2) {E_Array & a = *dynamic_cast< E_Array *>((Expression) n);assert(a); Expression nn= a[index]; return GetAny((*nn)(stack));} else return 0; } long NbBorder(Stack stack) const { if(cas==0) return 1; else if (cas==1 ) return GetAny >((*n)(stack)).N(); else if (cas==2) return dynamic_cast(n)->size(); else return 0; } //GetAny((*n)(stack));} double from(Stack stack) const ;//{ return GetAny((*n)(stack));} double to(Stack stack) const ;//{ return GetAny((*b)(stack));} long * index(Stack stack) const ;//{ return GetAny((*b)(stack));} double * var(Stack stack) const ;//{ return GetAny((*n)(stack));} void code(Stack stack) const ; long label()const ; void Plot(Stack stack) const ; void SavePlot(Stack stack,PlotStream & plot ) const; void BoundingBox(Stack stack,double &xmin,double & xmax, double & ymin,double & ymax) const ; }; class AddBorderOperator: public OneOperator{ typedef const E_BorderN * A; public: E_F0 * code(const basicAC_F0 & args) const { A a0=dynamic_cast((Expression) args[0]); A a1=dynamic_cast((Expression) args[1]); ffassert( a0 && a1); //ffassert(a1->next==0); // change FH 13/02/2008 return new E_BorderN(*a1,a0);} AddBorderOperator(): OneOperator(map_type[typeid(A).name()],map_type[typeid(A).name()],map_type[typeid(A).name()]) {pref = 0;} }; class OneOperator_borderN : public OneOperator {public: const E_Border * theborder;int cas; E_F0 * code(const basicAC_F0 & a) const { return new E_BorderN(theborder,a[0]);} OneOperator_borderN(const E_Border * b) : OneOperator(atype(),atype()), theborder(b),cas(0){} OneOperator_borderN(const E_Border * b,int ) : OneOperator(atype(),atype >()), theborder(b),cas(1){} OneOperator_borderN(const E_Border * b,int,int ) : OneOperator(atype(),atype()), theborder(b),cas(2){} }; class E_Border :public Polymorphic { public: static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =0; static long Count; Expression xvar,xfrom,xto,xcode,xindex; basicAC_F0_wa * tab; long label; E_Border(const E_Array * a) : xvar(0),xfrom(0),xto(0),xcode(0),xindex(0), tab(a? a->v:0) ,label(++Count) { assert(tab); Add("(",new OneOperator_borderN(this)); Add("(",new OneOperator_borderN(this,1)); Add("(",new OneOperator_borderN(this,1,1)); /* A FAIRE pour multy border ****/ } E_Border(const basicAC_F0 & aa) : xvar(to(aa[0])), xfrom(to(aa[1])), xto(to(aa[2])), xcode(aa[aa.size()-1].LeftValue()), xindex( (aa.size() > 4) ? (Expression) to(aa[3]) : 0 ), //xindex( to(aa[3]) ), tab(0), label(++Count) { Add("(",new OneOperator_borderN(this)); Add("(",new OneOperator_borderN(this,1)); Add("(",new OneOperator_borderN(this,1,1)); } AnyType operator()(Stack) const { return SetAny(this);} double length(Stack ) const { ffassert(0);return 0.0; /* a faire */ } }; inline E_BorderN::E_BorderN(const E_Border *bb, C_F0 nn,const E_BorderN * nx) :b(bb),cas(Cas(nn)),n(to(cas,nn) ),next(nx) { /* cout << " -- E_BorderN : cas " << cas << endl; */ throwassert(b);} inline double E_BorderN::from(Stack stack) const { return b->xfrom ? GetAny((*b->xfrom)(stack)): double(0.0);} inline double E_BorderN::to(Stack stack) const { return b->xto? GetAny((*b->xto)(stack)): b->length(stack) ;} inline double * E_BorderN::var(Stack stack) const { return b->xvar ? GetAny((*b->xvar)(stack)): (double*) 0 ;} inline long * E_BorderN::index(Stack stack) const { return b->xindex ? GetAny((*b->xindex)(stack)): (long*) 0 ;} inline void E_BorderN::code(Stack stack)const { (*b->xcode)(stack);} inline long E_BorderN::label()const { return b->label;} inline ArrayOfaType::ArrayOfaType(const basicAC_F0 & aa) : n(aa.size()),t(n ? (n<=4 ? tt : new aType[n]):0),ellipse(false) { for (int i=0;isecond);} inline C_F0 TableOfIdentifier::Find(const char * name,const basicAC_F0 & args) const { const_iterator i=m.find(name); if ( i == m.end()) {cerr<<"No operator " << name<second),"(",args);}} // Attention il y a moralement un bug // les initialisation x = y ( passe par l'operateur binaire <- dans TheOperators // les initialisation x(y) ( passe par l'operateur unaire <- du type de x // ------- inline size_t align8(size_t &off) { size_t o= off %8 ; off += o ? 8-o : 0; return off; } template inline Type_Expr NewVariable(aType t,size_t &off) { size_t o= align8(off);// align // off += t->un_ptr_type->size; // bug off += t->size; off += t->un_ptr_type->size; // correction 16/09/2003 merci Richard MICHEL return Type_Expr(t,new T(o,t)); } template inline Type_Expr NewVariable(aType t,size_t &off,const basicAC_F0 &args) { size_t o= align8(off);// align off += t->un_ptr_type->size; return Type_Expr(t,new T(o,t,args)); } template inline Type_Expr NewVariable(aType t,size_t &off,const U & data) { size_t o= align8(off);// align off += t->un_ptr_type->size; return Type_Expr(t,new T(o,t,data)); } //extern int NbNewVarWithDel; // def in global.cpp sep 2016 FH. template inline C_F0 TableOfIdentifier::NewVar(Key k,aType t,size_t & top,const C_F0 &i) { // if( t-> ExistDestroy()) NbNewVarWithDel++; return C_F0(TheOperators,"<-",New(k,NewVariable(t,top)),i);} template inline C_F0 TableOfIdentifier::NewVar(Key k,aType t,size_t & top,const basicAC_F0 &args) { // return C_F0(TheOperators,"<-",New(k,NewVariable(t,top)),t->Find("<-",args));} // if( t-> ExistDestroy()) NbNewVarWithDel++; return C_F0(TheOperators,"<-",basicAC_F0_wa(New(k,NewVariable(t,top)),args));} template inline C_F0 TableOfIdentifier::NewFESpace(Key k,aType t,size_t & top,const basicAC_F0 &args) { return C_F0(TheOperators,"<-",basicAC_F0_wa(New(k,NewFESpace(t,top,args)),args));} template inline C_F0 TableOfIdentifier::NewVar(Key k,aType t,size_t & top,const basicAC_F0 &args,const U & data) { // if( t-> ExistDestroy()) NbNewVarWithDel++; // return C_F0(TheOperators,"<-",New(k,t->NewVar(top)),t->Find("<-",args));} return C_F0(TheOperators,"<-",basicAC_F0_wa(New(k,NewVariable(t,top,data)),args));} //inline C_F0 TableOfIdentifier::NewVar(Key k,aType t,size_t & top,const AC_F0 &args,const C_F0& ) // { throwassert(0); return C_F0(TheOperators,"<-",New(k,NewVariable(t,top)),t->Find("<-",args));} template inline C_F0 TableOfIdentifier::NewVar(Key k,aType t,size_t & top) { // if( t-> ExistDestroy()) NbNewVarWithDel++; return t->Initialization(New(k,NewVariable(t,top))); } // save a expression inline C_F0 TableOfIdentifier::NewID(aType r,Key k, C_F0 & c,size_t &top, bool del ) { New(k,(make_pair(c.left(),c.LeftValue())),del);return 0; } // { return r->Initialization(New(k,r->SetParam(c,ListOfId(),top),del));} inline C_F0 TableOfIdentifier::NewID(aType r,Key k, C_F0 & c,const ListOfId & l,size_t & top,bool del) { return r->Initialization(New(k,r->SetParam(c,&l,top),del));} /// <> allocated at [[file:global.cpp::tables_of_identifier]] typedef list ListOfTOfId; extern list tables_of_identifier; /// [[file:AFunction2.cpp::Find]] C_F0 Find(const char * name); inline C_F0 basicForEachType::Find(const char * k) const { C_F0 r( ti.Find(k)); //if (r.Empty()) {cerr << " no member " <MeshIndependent() && b->MeshIndependent();} } ; inline C_F0::C_F0(const C_F0 & a,const C_F0 & b) { // the concatenation if (a.Empty()) {r=b.r,f=b.f;} else if (b.Empty()) {r=a.r,f=b.f;} else {r=b.r; f= new E_comma(a.f,b.f);} } inline C_F0::C_F0(const C_F0 & e,const char *op, AC_F0 & p) { *this=C_F0(e,op,(const basicAC_F0 &) p); p.destroy(); } inline C_F0::C_F0(const Polymorphic * poly,const char *op, AC_F0 & p) { *this=C_F0(poly,op,(const basicAC_F0 &) p); p.destroy(); } inline C_F0::C_F0(const C_F0 & e,const char *op,const basicAC_F0 & p) { const Polymorphic * pop=e; if (pop) { //cerr << "poly: " << *pop << endl; *this=C_F0(pop,op,p); } else { // cerr << *e.r << " : table " << endl; // e.r->ShowTable(cerr); C_F0 x=e.r->Find(op); pop=x; if(pop) { basicAC_F0_wa ep(e,p); *this=C_F0(pop,"",ep); } else { cerr << " unknown operator " << op << " on type " << *e.r << endl; CompileError(); }} } inline C_F0::C_F0(const C_F0 & e,const char *op,const C_F0 & a,const C_F0 & b) { C_F0 tab[2]={a,b}; basicAC_F0 p; p=make_pair(2,tab); *this= C_F0(e,op,p); } /// <> inline C_F0::C_F0(const C_F0 & e,const char *op,const C_F0 & ee) { const Polymorphic * pop=e; if (pop) { // calls [[C_F0_constructor_binary_decl]] *this=C_F0(pop,op,e,ee); } else { // cerr << *e.r << " : table " << endl; // e.r->ShowTable(cerr); C_F0 x=e.r->Find(op); pop=x; if(pop) *this=C_F0(pop,"",e,ee); else { cerr << " unknown operator " << op << " on type " << *e.r << " " << *ee.r<< endl; CompileError(); } } } inline C_F0::C_F0(const C_F0 & e,const char *nm) { // cerr << " C_F0(const C_F0 & e,const char *item) : " << " " << nm << endl; C_F0 x=e.r->Find(nm); const Polymorphic * pop=x; // cerr << "Find " << *pop << endl; if (pop) *this=C_F0(pop,".",e); // unary oper . else { cerr << " No operator ." << nm << " for type " << *e.r << endl; lgerror(""); } } inline E_F0 * C_F0::LeftValue() const { return f; } /*inline Type_Expr C_F0::SetParam(const ListOfId * l,size_t & top) const { return r->SetParam(*this,l,top); }*/ /// Declaration of TypeArray aType TypeArray(aType,aType); aType TypeArray(aType c,aType b,aType a); /// Declaration of TypeTemplate aType TypeTemplate(aType,aType); void Init_map_type(); /// <> class Block { // static size_t Max(size_t a,size_t b){ return a < b ? b :a;} typedef const char * Key; Block * fatherblock; size_t top,topmax; TableOfIdentifier table; ListOfTOfId::iterator itabl; public: // list of variable size_t OffSet(size_t ssize) { top=align8(top); size_t r=top; top+=ssize ;topmax=Max(topmax,top); return r;} Block(Block * f=0); /* :fatherblock(f),top(f?f->top:BeginOffset*sizeof(void*)),topmax(top) { itabl=tables_of_identifier.insert(tables_of_identifier.begin(),&table); }*/ size_t size() const { return Max(topmax,top);} void Add(Key k,Key op,OneOperator *p0) { table.Add(k,op,p0);} // <> template C_F0 NewVar(Key k,aType t,const C_F0 &i) {return table.NewVar(k, t,top,i);} template C_F0 NewFESpace(Key k,aType t,const basicAC_F0 &args) {return table.NewFESpace(k, t,top,args);} template C_F0 NewVar(Key k,aType t, AC_F0 &args) {C_F0 r= table.NewVar(k, t,top,args); args.destroy(); topmax=Max(topmax,top); return r;} template C_F0 NewVar(Key k,aType t,const basicAC_F0 &args) {C_F0 r= table.NewVar(k, t,top,args); topmax=Max(topmax,top); return r;} template C_F0 NewVar(Key k,aType t,const basicAC_F0 &args,const U & data) {C_F0 r= table.NewVar(k, t,top,args,data); topmax=Max(topmax,top); return r;} // C_F0 NewVar(Key k,aType t,const AC_F0 &args,const C_F0 & f) // {return table.NewVar(k, t,top,args,f);} template C_F0 NewVar(Key k,aType t) {C_F0 r= table.NewVar(k, t,top); topmax=Max(topmax,top); return r; } // C_F0 NewVar(aType t,Key k,C_F0 f) // {return table.NewVar(t,k, f);} C_F0 NewID(aType t,Key k,C_F0 f,bool del=true) {C_F0 r= table.NewID(t,k, f,top,del); topmax=Max(topmax,top); return r;} C_F0 NewID(aType t,Key k,C_F0 f,const ListOfId & l,bool del=true) {C_F0 r= table.NewID(t,k,f,l,top,del); topmax=Max(topmax,top); return r;} static Block * open(Block *& c); static vectorOfInst * snewclose(Block *& c); //vectorOfInst * newclose(Block *& c) ;// sep 2016 FH static CC_F0 close(Block *& c,C_F0 ); static CC_F0 close(Block *& c,CListOfInst ); /* { tables_of_identifier.erase(itabl); c=fatherblock; if (fatherblock) {fatherblock->topmax=topmax; fatherblock->top=top;} CC_F0 r; r = table.destroy(); delete this; return r;}*/ C_F0 Find(const char * k) const {return table.Find(k);} ~Block(); //{} int nIdWithDelete() const { return table.nIdWithDelete;} }; /// <> To know the meaning of OneOperator name extensions, see [[OneOperator]]. The template arguments to /// OneOperator classes are identical to the types of the arguments of the C++ function that is called from the /// class. The matrices are of type KNM* or KNM** (for left-side expressions, but this is "more /// tricky") which correspond to a real[int,int] in the edp script. template > class OneOperator1 : public OneOperator { aType r,t0; // return type typedef typename CODE::func func; // R (*func)(A) ; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(f,t0->CastTo(args[0]));} OneOperator1(func ff,int ppref=0): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()]), t0( map_type[typeid(A).name()] ), f(ff) {pref=ppref;} OneOperator1(func ff,aType tt0,int ppref=0): OneOperator(map_type[typeid(R).name()],tt0), t0( map_type[typeid(A).name()] ), f(ff) {pref=ppref;} }; template > class OneOperator2 : public OneOperator { aType r,t0,t1; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(f,t0->CastTo(args[0]),t1->CastTo(args[1]));} OneOperator2(func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ), f(ff) {} OneOperator2(func ff,aType tt0,aType tt1): OneOperator(map_type[typeid(R).name()],tt0,tt1), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ), f(ff) {} }; /*template struct OneBinaryOperator_Traits { typedef C::result_type R; typedef C::first_argument_type A; typedef C::second_argument_type B; };*/ // the greatest pref win ... template struct SameType { static const int OK=0;}; template struct SameType { static const int OK=1;}; template<> struct SameType { static const int OK=10;}; //template<> struct SameType { static const int OK=19;}; //template<> struct SameType { static const int OK=19;}; template<> struct SameType { static const int OK=20;}; template<> struct SameType { static const int OK=30;}; template<> struct SameType { static const int OK=40;}; //template<> struct SameType { static const int OK=43;}; //template<> struct SameType { static const int OK=43;}; //template<> struct SameType { static const int OK=42;}; //template<> struct SameType { static const int OK=42;}; //template<> struct SameType { static const int OK=41;}; //template<> struct SameType { static const int OK=41;}; template<> struct SameType { static const int OK=50;}; template struct ternary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Arg3 third_argument_type; typedef Result result_type; }; template struct quad_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Arg3 third_argument_type; typedef Arg4 fourth_argument_type; typedef Result result_type; }; template class OneTernaryOperator : public OneOperator{ typedef typename T::result_type R; typedef typename T::first_argument_type A; typedef typename T::second_argument_type B; typedef typename T::third_argument_type C; class Op : public E_F0 { typedef typename C::result_type Result; Expression a,b,c; public: AnyType operator()(Stack s) const {return SetAny(static_cast(C::f( GetAny((*a)(s)) , GetAny((*b)(s)) , GetAny((*c)(s)))));} Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} bool MeshIndependent() const { return a->MeshIndependent() && b->MeshIndependent() && c->MeshIndependent();} }; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(t[0]->CastTo(args[0]),t[1]->CastTo(args[1]),t[2]->CastTo(args[2]));} OneTernaryOperator(): OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()]) {} }; template class OneQuadOperator : public OneOperator{ typedef typename T::result_type R; typedef typename T::first_argument_type A; typedef typename T::second_argument_type B; typedef typename T::third_argument_type C; typedef typename T::fourth_argument_type D; class Op : public E_F0 { typedef typename C::result_type Result; Expression a,b,c,d; public: AnyType operator()(Stack s) const {return SetAny(static_cast(T::f( GetAny((*a)(s)) , GetAny((*b)(s)) , GetAny((*c)(s)), GetAny((*d)(s)) )));} Op(Expression aa,Expression bb,Expression cc,Expression dd) : a(aa),b(bb),c(cc),d(dd) {} bool MeshIndependent() const { return a->MeshIndependent() && b->MeshIndependent() && c->MeshIndependent() && d->MeshIndependent();} }; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(t[0]->CastTo(args[0]),t[1]->CastTo(args[1]),t[2]->CastTo(args[2]),t[3]->CastTo(args[3]));} OneQuadOperator(): OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()] ) {} }; template class OneTernaryOperator3 : public OneOperator{ typedef typename T::result_type R; typedef typename T::first_argument_type A; typedef typename T::second_argument_type B; typedef typename T::third_argument_type C; class Op : public E_F0 { // typedef typename C::result_type Result; Expression a,b,c; public: AnyType operator()(Stack s) const {return SetAny(static_cast(T::f( s, GetAny((*a)(s)) , GetAny((*b)(s)) , GetAny((*c)(s)))));} Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} bool MeshIndependent() const { return a->MeshIndependent() && b->MeshIndependent() && c->MeshIndependent();} }; public: E_F0 * code(const basicAC_F0 & args) const { return new Op(t[0]->CastTo(args[0]),t[1]->CastTo(args[1]),t[2]->CastTo(args[2]));} OneTernaryOperator3(): OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()]) {} }; struct OneBinaryOperatorMI { static bool MeshIndependent(Expression a,Expression b) { return a->MeshIndependent() && b->MeshIndependent();} static bool ReadOnly() { return true;} }; struct OneBinaryOperatorMIWO { static bool MeshIndependent(Expression a,Expression b) { return a->MeshIndependent() && b->MeshIndependent();} static bool ReadOnly() { return false;} }; // ---------- operator with stack ??? for auto delete template class OneBinaryOperator_st : public OneOperator{ typedef typename C::result_type R; typedef typename C::first_argument_type A; typedef typename C::second_argument_type B; aType t0,t1; // type of template modif FH mars 2006 class Op : public E_F0 { typedef typename C::result_type Result; Expression a,b; public: AnyType operator()(Stack s) const {return SetAny(static_cast(C::f(s, GetAny((*a)(s)) , GetAny((*b)(s)))));} Op(Expression aa,Expression bb) : a(aa),b(bb) {} bool MeshIndependent() const { return MI::MeshIndependent(a,b);} bool ReadOnly() const { return MI::ReadOnly() ;} int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; int Opa = a->Optimize(l,m,n); int Opb =b->Optimize(l,m,n); return insert(new Opt(*this,Opa,Opb),l,m,n); } int compare (const E_F0 *t) const { int rr; const Op * tt=dynamic_cast(t); if (tt ) rr = clexico(a->compare(tt->a),b->compare(tt->b)); else rr = E_F0::compare(t); // cout << "cmp E_F0_Func1 " << rr << endl; return rr; } // to give a order in instuction // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &f) const { f << "Op<" << typeid(C).name() << "> \n\t\t\t( a= "<< *a<< ") \n\t\t\t(b= "<< *b << ") " ; return f; } }; // build optimisation class Opt: public Op { public : size_t ia,ib; Opt(const Op &t,size_t iaa,size_t ibb) : Op(t) , ia(iaa),ib(ibb) {} AnyType operator()(Stack s) const { // cout << "Opt2 ::: " << ia << " "<< ib << " f = " // << GetAny(SetAny(C::f( *static_cast(static_cast(static_cast(s)+ia)) , // *static_cast(static_cast(static_cast(s)+ib))))) << endl; return SetAny( C::f(s, *static_cast(static_cast(static_cast(s)+ia)) , *static_cast(static_cast(static_cast(s)+ib)) ) );} }; // aType r; // return type public: E_F0 * code(const basicAC_F0 & args) const { //cout << "A op B \n" ; return new Op(t0->CastTo(args[0]),t1->CastTo(args[1]));} OneBinaryOperator_st(): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0(t[0]), t1(t[1]) {pref = SameType::OK ;} OneBinaryOperator_st(aType tt0,aType tt1): OneOperator(map_type[typeid(R).name()], tt0 ? tt0 : map_type[typeid(A).name()] , tt1 ? tt1 : map_type[typeid(B).name()]), t0(map_type[typeid(A).name()]), t1(map_type[typeid(B).name()]) {pref = SameType::OK ;} }; struct evalE_F2 { static AnyType eval(Stack s,const E_F0 * ab,const E_F0 * a,const E_F0 * b, bool & meshidenp) { return ab->E_F0::eval(s,meshidenp); } }; // template class OneBinaryOperator : public OneOperator{ typedef typename C::result_type R; typedef typename C::first_argument_type A; typedef typename C::second_argument_type B; aType t0,t1; // type of template modif FH mars 2006 class Op : public E_F0 { typedef typename C::first_argument_type A; typedef typename C::second_argument_type B; typedef typename C::result_type Result; Expression a,b; public: AnyType operator()(Stack s) const {return SetAny(static_cast(C::f( GetAny((*a)(s)) , GetAny((*b)(s)))));} // optim eval MI ... juin 2007 FH ... AnyType eval(Stack s, bool & meshidenp) const {return MIx::eval(s,this,a,b,meshidenp);} // fi optime Op(Expression aa,Expression bb) : a(aa),b(bb) {} bool MeshIndependent() const { return MI::MeshIndependent(a,b);} bool ReadOnly() const { return MI::ReadOnly() ;} int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; int Opa = a->Optimize(l,m,n); int Opb =b->Optimize(l,m,n); return insert(new Opt(*this,Opa,Opb),l,m,n); } int compare (const E_F0 *t) const { int rr; const Op * tt=dynamic_cast(t); if (tt ) rr = clexico(a->compare(tt->a),b->compare(tt->b)); else rr = E_F0::compare(t); // cout << "cmp E_F0_Func1 " << rr << endl; return rr; } // to give a order in instuction // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &f) const { f << "Op<" << typeid(C).name() << "> \n\t\t\t( a= "<< *a<< ") \n\t\t\t(b= "<< *b << ") " ; return f; } }; // build optimisation class Opt: public Op { public : size_t ia,ib; Opt(const Op &t,size_t iaa,size_t ibb) : Op(t) , ia(iaa),ib(ibb) {} AnyType operator()(Stack s) const { // cout << "Opt2 ::: " << ia << " "<< ib << " f = " // << GetAny(SetAny(C::f( *static_cast(static_cast(static_cast(s)+ia)) , // *static_cast(static_cast(static_cast(s)+ib))))) << endl; return SetAny( C::f( *static_cast(static_cast(static_cast(s)+ia)) , *static_cast(static_cast(static_cast(s)+ib)) ) );} }; // aType r; // return type public: E_F0 * code(const basicAC_F0 & args) const { //cout << "A op B \n" ; if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new Op(t0->CastTo(args[0]),t1->CastTo(args[1]));} OneBinaryOperator(): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0(t[0]), t1(t[1]) {pref = SameType::OK ;} OneBinaryOperator(aType tt0,aType tt1): OneOperator(map_type[typeid(R).name()], tt0 ? tt0 : map_type[typeid(A).name()] , tt1 ? tt1 : map_type[typeid(B).name()]), t0(map_type[typeid(A).name()]), t1(map_type[typeid(B).name()]) {pref = SameType::OK ;} }; //------------- template class Operator_Aritm_If : public OneOperator{ typedef bool A; typedef R B; typedef R C; class Op : public E_F0 { typedef R Result; Expression a,b,c; public: AnyType operator()(Stack s) const { bool ok = GetAny((*a)(s)) ; R r ; if( ok) r=GetAny((*b)(s)) ; else r =GetAny((*c)(s)) ; return SetAny(r);// static_cast( ? GetAny((*b)(s)) : GetAny((*c)(s)) )); } Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc){} bool MeshIndependent() const { return a->MeshIndependent() && b->MeshIndependent() &&b->MeshIndependent() ;} int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; int Opa = a->Optimize(l,m,n); int Opb =b->Optimize(l,m,n); int Opc =c->Optimize(l,m,n); return insert(new Opt(*this,Opa,Opb,Opc),l,m,n); } int compare (const E_F0 *t) const { int rr; const Op * tt=dynamic_cast(t); if (tt ) rr = clexico(a->compare(tt->a),b->compare(tt->b),c->compare(tt->c)); else rr = E_F0::compare(t); // cout << "cmp E_F0_Func1 " << rr << endl; return rr; } // to give a order in instuction // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &f) const { f << "Op<" << typeid(C).name() << "> \n\t\t\t( a= "<< *a<< ") \n\t\t\t(b= "<< *b << ") " ; return f; } }; // build optimisation class Opt: public Op { public : size_t ia,ib,ic; Opt(const Op &t,size_t iaa,size_t ibb,size_t icc) : Op(t) , ia(iaa),ib(ibb),ic(icc) {} AnyType operator()(Stack s) const { // cout << "Opt2 ::: " << ia << " "<< ib << " f = " // << GetAny(SetAny(C::f( *static_cast(static_cast(static_cast(s)+ia)) , // *static_cast(static_cast(static_cast(s)+ib))))) << endl; return SetAny( static_cast ( *static_cast(static_cast(static_cast(s)+ia)) ? *static_cast(static_cast(static_cast(s)+ib)) : *static_cast(static_cast(static_cast(s)+ic)) ) );} }; // aType r; // return type public: E_F0 * code(const basicAC_F0 & args) const { //cout << "A op B \n" ; if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new Op(t[0]->CastTo(args[0]),t[1]->CastTo(args[1]),t[2]->CastTo(args[2]));} Operator_Aritm_If(): OneOperator(map_type[typeid(R).name()],map_type[typeid(bool).name()],map_type[typeid(B).name()],map_type[typeid(B).name()]) {pref = SameType::OK ;} }; /* essai d'unification des classes template struct F_1 : unary_function,public E_F0 { AnyType operator()(Stack s) const { return SetAny( ff(GetAny((*a)(s)))) ;} }; template class bUnary_Op : public C { public: Expression a; public: bUnary_Op(Expression aa) : a(aa) {} int compare (const E_F0 *t) const { int rr; const bUnary_Op * tt=dynamic_cast(t); if (tt) rr = a->compare(tt->a); else rr = E_F0::compare(t); // cout << "cmp E_F0_Func1 " << rr << endl; return rr; } // to give a order in instuction bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack();} // bool MeshIndependent() const {return a->MeshIndependent();} // // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &f) const { f << "Op1<" << typeid(C).name() << "> \n\t\t\t( a= "<< *a<< ") " ; return f; } }; */ template class Unary_Op : public E_F0 { public: typedef typename C::result_type R; typedef typename C::argument_type A; Expression a; public: AnyType operator()(Stack s) const { return SetAny( C::f(GetAny((*a)(s)))) ;} Unary_Op(Expression aa) : a(aa) {} int compare (const E_F0 *t) const { int rr; const Unary_Op * tt=dynamic_cast(t); if (tt) rr = a->compare(tt->a); else rr = E_F0::compare(t); // cout << "cmp E_F0_Func1 " << rr << endl; return rr; } // to give a order in instuction bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack();} // bool MeshIndependent() const {return a->MeshIndependent();} // // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation virtual ostream & dump(ostream &f) const { f << "Op1<" << typeid(C).name() << "> \n\t\t\t( a= "<< *a<< ") " ; return f; } }; template > class OneUnaryOperator : public OneOperator{ typedef typename C::result_type R; typedef typename C::argument_type A; aType tA; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new Op(tA->CastTo(args[0]));} OneUnaryOperator(aType tt0=map_type[typeid(A).name()]): OneOperator(map_type[typeid(R).name()],tt0), tA(map_type[typeid(A).name()]) {} }; template > class OneOperator1s_ : public OneOperator { typedef R (*func)(Stack stack, const A &) ; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f,t[0]->CastTo(args[0]));} OneOperator1s_(func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()]),f(ff){} }; template > class OneOperator1_ : public OneOperator { aType t0; // return type typedef R (*func)(const A &) ; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f,t[0]->CastTo(args[0]));} OneOperator1_(func ff,int ppref=0): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()]),t0( map_type[typeid(A).name()] ),f(ff){pref=ppref;} OneOperator1_(func ff,aType tt0,int ppref=0): OneOperator(map_type[typeid(R).name()],tt0), t0( map_type[typeid(A).name()]), f(ff) {pref=ppref;} }; template class E_F_F0F0_; template > class OneOperator2_ : public OneOperator { aType t0,t1; // return type type de f, f(t1, t2) typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f,t0->CastTo(args[0]),t1->CastTo(args[1]));} OneOperator2_(func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ), f(ff) {} OneOperator2_(int ppref,func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ), f(ff) {pref=ppref;} OneOperator2_(func ff,aType tt0,aType tt1): OneOperator(map_type[typeid(R).name()],tt0,tt1), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ), f(ff) {} }; template > class OneOperator3_ : public OneOperator { // aType r; // return type aType tA,tB,tC; // type of template modif FH mars 2007 typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f,tA->CastTo(args[0]),tB->CastTo(args[1]),tC->CastTo(args[2]));} OneOperator3_(func ff, aType tt0=map_type[typeid(A).name()], aType tt1=map_type[typeid(B).name()], aType tt2=map_type[typeid(C).name()]) : OneOperator(map_type[typeid(R).name()],tt0,tt1,tt2), tA(map_type[typeid(A).name()]), tB(map_type[typeid(B).name()]), tC(map_type[typeid(C).name()]), f(ff){} OneOperator3_(int ppref,func ff, aType tt0=map_type[typeid(A).name()], aType tt1=map_type[typeid(B).name()], aType tt2=map_type[typeid(C).name()]) : OneOperator(map_type[typeid(R).name()],tt0,tt1,tt2), tA(map_type[typeid(A).name()]), tB(map_type[typeid(B).name()]), tC(map_type[typeid(C).name()]), f(ff) {pref=ppref;} }; // <> utilise [[E_F0]]. la class code doit contenir /* class CODE: public E_F0 { typedef ... func .. ; typedef .. R; static ArrayOfaType typeargs(); // the list of type de l'operateur of the args typedef ... R; // return type } */ template class OneOperatorCode : public OneOperator { public: E_F0 * code(const basicAC_F0 & args) const { return CODE::f(args);} OneOperatorCode(): OneOperator(atype(),CODE::typeargs()) {pref=ppref;} OneOperatorCode(aType rr,const ArrayOfaType & l): OneOperator(rr,l) {pref=ppref;} OneOperatorCode(aType rr,aType a): OneOperator(rr,a) {pref=ppref;} OneOperatorCode(aType rr,aType a,aType b): OneOperator(rr,a,b) {pref=ppref;} OneOperatorCode(aType rr,aType a,aType b,aType c): OneOperator(rr,a,b,c) {pref=ppref;} }; template struct binary_trait{ typedef A R ;}; template<> struct binary_trait { typedef double R;}; template<> struct binary_trait { typedef double R;}; template<> struct binary_trait > { typedef complex R;}; template<> struct binary_trait > { typedef complex R;}; template<> struct binary_trait > { typedef complex R ;}; template struct binary_trait { typedef string* R ;}; // 1 variable pour les operation de cast class E_F1_funcT_Type: public OneOperator{ public: // const basicForEachType *r,*a; Function1 f; E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new E_F0_Func1(f,args[0]);} E_F1_funcT_Type(const basicForEachType *rr,const basicForEachType *aa,Function1 ff) : OneOperator(rr,aa), f(ff) {} //: r(rr),a(aa),f(ff) {} // friend ostream & operator<<(ostream & f,const E_F1_funcT_Type & e) { f << *e.a << " -> " << *e.r ;return f;} }; template class E_F1_funcT :public E_F1_funcT_Type{ public: E_F1_funcT(Function1 ff) : E_F1_funcT_Type(map_type[typeid(R).name()],map_type[typeid(A).name()],ff){} E_F1_funcT(aType rr,aType a,Function1 ff) : E_F1_funcT_Type(rr,a,ff){} }; template ForEachTypePtr::ForEachTypePtr(): basicForEachType(typeid(PT),sizeof(PT), // new E_F1_funcT(UnRef),atype(), new E_F1_funcT_Type(atype(),this,UnRef),atype(), ::Initialize,::Delete){} template ForEachTypePtr::ForEachTypePtr(Function1 init,Function1 dl,Function1 onreturn): basicForEachType(typeid(PT),sizeof(PT), // new E_F1_funcT(UnRef),atype(), new E_F1_funcT_Type(atype(),this,UnRef),atype(), init, dl , onreturn ){} template ForEachTypePtr::ForEachTypePtr(Function1 dl): basicForEachType(typeid(PT),sizeof(PT), new E_F1_funcT_Type(atype(),this,UnRef),atype(), ::Initialize,dl){} template ForEachTypePtr::ForEachTypePtr(T* unused,Function1 OOnReturn): basicForEachType(typeid(T**),sizeof(T**), // new E_F1_funcT(UnRef),atype(), new E_F1_funcT_Type(atype(),this,UnRef),atype(), ::InitializePtr,::DestroyPtr,OOnReturn){} template ForEachTypePtr::ForEachTypePtr(Function1 init,Function1 dl,Function1 onreturn): basicForEachType(typeid(T**),sizeof(T**), // new E_F1_funcT(UnRef),atype(), new E_F1_funcT_Type(atype(),this,UnRef),atype(), init , dl , onreturn){} template ForEachTypePtr::ForEachTypePtr(Function1 dl): basicForEachType(typeid(T**),sizeof(T**), // new E_F1_funcT(UnRef),atype(), new E_F1_funcT_Type(atype(),this,UnRef),atype(), ::InitializePtr,dl){} /* class FuncForEachType : public basicForEachType {public: FuncForEachType(const basicForEachType * t); const basicForEachType * rtype; }; */ /* inline basicForEachType::basicForEachType(const type_info & k, const type_info & kf, const size_t s, const E_F1_funcT_Type * p, basicForEachType *rr, Function1 iv,Function1 id) : ktype(&k),ktypefunc(&kf), size(s), un_ptr(p), un_ptr_type(rr?rr:this), InitExp(iv), destroy(id) , funct_type(new FuncForEachType(this)){} */ inline C_F0 & operator+=(C_F0 & a,C_F0 &b) { C_F0 r = C_F0(TheOperators,"+",a,b); a=r; return a; } template void Dcl_TypeandPtr_ (Function1 i,Function1 d,Function1 pi,Function1 pd,Function1 OnReturn=0,Function1 pOnReturn=0) { map_type[typeid(T).name()] = new ForEachType(i,d,OnReturn); map_type[typeid(PT).name()] = new ForEachTypePtr(pi,pd,pOnReturn); } template void Dcl_TypeandPtr (Function1 i,Function1 d,Function1 pi,Function1 pd,Function1 OnReturn=0,Function1 pOnReturn=0) { map_type[typeid(T).name()] = new ForEachType(i,d,OnReturn); map_type[typeid(T*).name()] = new ForEachTypePtr(pi,pd,pOnReturn); } template void Dcl_TypeandPtr (Function1 pi,Function1 pd) { map_type[typeid(T).name()] = new ForEachType(); map_type[typeid(T*).name()] = new ForEachTypePtr(pi,pd); } template void Dcl_TypeandPtr (Function1 pd) { map_type[typeid(T).name()] = new ForEachType(); map_type[typeid(T*).name()] = new ForEachTypePtr(pd); } template void Dcl_TypeandPtr () { map_type[typeid(T).name()] = new ForEachType(); map_type[typeid(T*).name()] = new ForEachTypePtr(); } template aType Dcl_Type (Function1 iv=0,Function1 id=0,Function1 Onreturn=0) { if (sizeof(T) >sizeof(AnyData)) { cerr << " the type " << typeid(T).name() << " is too large " << sizeof(AnyData) << endl; throwassert(sizeof(T) <=sizeof(AnyData));} return map_type[typeid(T).name()] = new ForEachType(iv,id,Onreturn); } template void Add(const char * k,const char * op,OneOperator *p0,OneOperator *p1=0, OneOperator *p2=0,OneOperator *p3=0,OneOperator *p4=0, OneOperator *p5=0,OneOperator *p6=0) {atype()->Add(k,op,p0,p1,p2,p3,p4,p5,p6);} inline C_F0 operator *(const C_F0 &a,const C_F0 &b) { return a==*pOne ? b : ( b ==*pOne ? a : C_F0(TheOperators,"*",a,b)) ;} inline C_F0 operator+(const C_F0 &a,const C_F0 &b){ return C_F0(TheOperators,"+",a,b);} inline C_F0 operator-(const C_F0 &a,const C_F0 &b){ return C_F0(TheOperators,"-",a,b);} /// <> inline C_F0 &operator +=(C_F0 &a,const C_F0 &b) { C_F0 r=C_F0(TheOperators,"+",a,b); a=r; return a;} //inline bool CC_F0::Empty() const {return !f || f->Empty();} inline void CC_F0::operator=(const CListOfInst& c) { C_F0 cc=c;f=cc.f;r=cc.r;} inline CListOfInst & CListOfInst::operator+=(const CC_F0 & a) { if( !a.Empty()){ f->Add(a);r=a.left();};return *this;} inline Type_Expr basicForEachType::SetParam(const C_F0 & ,const ListOfId * ,size_t & ) const { cerr << " int basicForEachType " << name() << endl; InternalError("basicForEachType::SetParam non defined"); }//return make_pair(c.left(),c.LeftValue());} /* // --- pour les cast ------ class OneOpCast: public OneOperator { typedef const E_F1_funcT_Type * CastFunc; CastFunc f; public: E_F0 * code(const basicAC_F0 & args) const { return new E_F0_Func1(f->f,args[0]);} OneOpCast(CastFunc ff): OneOperator(ff->r,ff->a),f(ff){} }; */ // inline bool basicForEachType::CastingFrom(aType t) const { 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)); // uses [[casting]] [[file:AFunction2.cpp::FindSameR]] } inline void CerrCast(const pair & i) { cerr << "\t" << *i.first << ":" << i.second << endl; } inline C_F0 basicForEachType::CastTo(const C_F0 & e) const { throwassert(this); aType t = e.left(); if (this== t) return e; C_F0 ce=e; basicAC_F0 at; at=ce; OneOperator * opcast =casting->FindSameR(ArrayOfaType(t,false)); if ( opcast ) if ( *opcast == at ) // left value return C_F0(opcast->code(at),this); else { // rigth value aType tr = e.right(); ce = C_F0(e.RightValue(),tr); at = ce; return C_F0(opcast->code(at),this); } else { cerr << "Impossible to cast " << *e.left() << " in " << *this << endl; if (casting) casting->Show(cerr) ; CompileError();} return C_F0(); } inline Expression basicForEachType::RightValueExpr(Expression f) const { if (un_ptr) return new E_F0_Func1(un_ptr->f,f); else return f; } inline void CompileError(string msg,aType r){ string m= r ? msg + " type: " + r->name() : msg ; lgerror(m.c_str()); } inline void ExecError(string msg){ // cerr << "Fatal ExecError: " << msg << endl; throw(ErrorExec(msg.c_str(),1)); } const Function1 NotReturnOfthisType = reinterpret_cast(1); inline Expression basicForEachType::OnReturn(Expression f) const { if(!DoOnReturn) return f; else if(DoOnReturn== NotReturnOfthisType ) CompileError("Problem when returning this type (sorry work in progress FH!) ", this); else return new E_F0_Func1(DoOnReturn,f); return 0; } inline void CC_F0::operator=(const AC_F0& a) { f=new E_Array(a); r= atype();}; inline UnId::UnId(const char * idd,const C_F0 & ee,aType rr=0,bool reff=false) :id(idd),r(rr),e(ee),array(0),re(ee.left()) ,ref(reff){} class E_exception : public exception { public: enum CODE_exception { UNKNOWN,e_break,e_continue,e_return} ; CODE_exception code; AnyType r; // for return public: E_exception(CODE_exception c,AnyType rr=Nothing) : code(c),r(rr) {} int type() {return code;} virtual const char * what() const throw() { return "E_exception (break,continue or return) "; } ~E_exception() throw() {} }; class E_throw : public E_F0mps { public: E_exception::CODE_exception kind; Expression ret; // return value E_throw(E_exception::CODE_exception c,Expression e=0) :kind(c),ret(e) {} AnyType operator()(Stack s) const { (ret ? throw(E_exception(kind,(*ret)(s))) : throw(E_exception(kind))); return Nothing; } operator aType () const { return atype();} } ; /* class E_block : public E_F0mps { public: const int n; Expression * code; int * linenumber; Expression clean; E_block(CListOfInst l,C_F0 c) : n(l.size()),code(l.ptr()),linenumber(l.nlines()),clean(c) {} E_block(CListOfInst l,vectorOfInst * c) : n(l.size()),code(l.ptr()),linenumber(l.nlines()),clean(0) {l.setclose(c);} E_block( C_F0 l,C_F0 c) : n(1),code(new Expression),clean(c) { code[0]=l;} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; */ class Routine; class E_Routine : public E_F0mps { public: ListOfInst * code; // Expression clean; aType rt; int nbparam; Expression * param; const char * name; E_Routine(const Routine * routine,const basicAC_F0 & args); AnyType operator()(Stack s) const; ~E_Routine() ;//{ delete [] param;} modif del for windows private: E_Routine(const E_Routine &); void operator=(const E_Routine &); operator aType () const{ return rt;} }; /// <> used in [[file:../lglib/lg.ypp::YYSTYPE]] class Routine: public OneOperator{ public: size_t offset; aType tfunc,tret; const char * name; const ListOfId param; Block * currentblock; ListOfInst * ins; E_F0 * code(const basicAC_F0 & args) const ; Routine(aType tf,aType tr,const char * iden, ListOfId *l,Block * & cb); Block * Set(CListOfInst instr) ; }; class TypeLineFunction: public ForEachType { public: TypeLineFunction() : ForEachType(0,0) {} void SetArgs(const ListOfId *lid) const { if (lid) CompileError("No Argument in line function"); } Type_Expr SetParam(const C_F0 & c,const ListOfId *l,size_t & top) const { return Type_Expr(c.left(),c.LeftValue()); } C_F0 Initialization(const Type_Expr & ) const { return C_F0(); } // nothing to initialize }; class E_F0_Optimize : public E_F0 { deque > l; // mutable deque var; MapOfE_F0 m; int NBbitem; int ret; public: E_F0_Optimize(deque > &ll,MapOfE_F0 & mm,int rett) : l(ll),m(mm),NBbitem(1),ret(rett) {} int sizevar() const {return l.size();} AnyType eval(Stack s,int notinit,bool * unvar) const { int k= l.size(),kk=0; if(notinit ==0) { //var.resize(k); for (int i=0;i(s,offset) = l[i].first->eval(s, unvar[i]); if( unvar[i]) kk++; } if (verbosity/100 && verbosity % 10 == 2) cout << "E_F0_Optimize nb MI exp: " << kk << " / " << k << endl; } else for (int i=0;i(s,offset) = (*l[i].first)(s); //*static_cast(static_cast((char*)s+offset))= (*l[i].first)(s); // FH NEWSTACK // cout << " E_F0_Optimize " << offset << " " << *static_cast(static_cast((char*)s+offset)) << endl; ; } // return *static_cast(static_cast((char*)s+ret)); return *Stack_offset(s,ret); // FH NEWSTACK } virtual AnyType operator()(Stack s) const { int k= l.size(); for (int i=0;i(s,offset) = (*l[i].first)(s); //*static_cast(static_cast((char*)s+offset))= (*l[i].first)(s); // FH NEWSTACK // cout << " E_F0_Optimize " << offset << " " << *static_cast(static_cast((char*)s+offset)) << endl; ; } // return *static_cast(static_cast((char*)s+ret)); return *Stack_offset(s,ret); // FH NEWSTACK } virtual bool Empty() const {return l.size(); } // virtual E_F0 * destroy(Stack ) const {return 0;} // virtual const E_F0 * Parameter(Stack ) const {return this;} virtual size_t nbitem() const { return NBbitem;} virtual bool EvaluableWithOutStack() const {return false;} // virtual bool MeshIndependent() const {return false;} // virtual E_F0 * right_E_F0() const { return 0;} virtual ~E_F0_Optimize() {} // virtual int compare (const E_F0 *t) const { return t-this;} // to give a order in instuction virtual operator aType () const { return *(l.back().first);} // the type of the expression }; inline int E_F0::find(const MapOfE_F0 & m) { // exp // cout << " ffff :" ; MapOfE_F0::const_iterator i= m.find(this); if(i != m.end()) { if( (verbosity / 100)% 10 == 1) { cout << "\n find : "; cout << i->second << " mi=" ; cout << MeshIndependent() << " " ; cout << typeid(*this).name() ; cout << " cmp = " << compare(i->first) ; cout << " " << i->first->compare(this) << " "; dump(cout); } assert( compare(i->first) == 0); } return i == m.end() ? 0 : i->second ; } inline int E_F0::insert(Expression opt,deque > &l,MapOfE_F0 & m, size_t & n) { int rr=align8(n); pair p(this,rr); if( (verbosity / 100)% 10 == 1) cout << " -- insert opt " << n << " " << *this << endl; n += sizeof(AnyType); l.push_back(make_pair((Expression)opt,(int)rr)); m.insert(p); return rr; } extern vector > * debugstack; struct NothingType { // a type to do nothing NothingType() {}; }; extern basicForEachType * typevarreal, * typevarcomplex; // type of real and complex variable void initArrayOperators(); void initArrayDCL(); void ClearMem(); // <> inline C_F0 OneOperator::code2(const basicAC_F0 &a) const {return C_F0(code(a),r);} template class OneOperator0 : public OneOperator {public: class E_F0_F :public E_F0 { public: typedef R (*func)( ) ; func f; E_F0_F(func ff) : f(ff) {} AnyType operator()(Stack ) const {return SetAny( f()) ;} operator aType () const { return atype();} }; // aType r; // return type typedef R (*func)() ; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new E_F0_F(f);} OneOperator0(func ff): OneOperator(map_type[typeid(R).name()]),f(ff){} }; template Type_Expr CVariable(R (*ff)() ) { throwassert(map_type[typeid(R).name()]); return make_pair(map_type[typeid(R).name()],new typename OneOperator0::E_F0_F(ff)); } void InitLoop(); C_F0 ForAll(Block *,ListOfId * id,C_F0 m); C_F0 ForAll(C_F0 loop,C_F0 inst); class PolymorphicLoop:public Polymorphic { public: typedef Expression Exp; C_F0 t; Exp v,i,j; PolymorphicLoop(C_F0 tt,AC_F0 &args) : t(tt),v(0),i(0), j(0){ if(verbosity>1000) cout << "PolymorphicLoop args " << args.size() << endl; if(args.size()>1) v=args[1]; // v if(args.size()>2) i=args[2]; // i,v if(args.size()>3) j=i,i=args[3];// i,j, v if(verbosity>1000) cout <<" v " << v << " i=" << i << " j=" << j << endl; } AnyType ftab(Stack s) const { return (*(Expression) t)(s);} AnyType fv(Stack s) const { return v ? (*v)(s): Nothing ;} AnyType fi(Stack s) const { return i ? (*i)(s): Nothing ;} AnyType fj(Stack s) const { return j ? (*j)(s): Nothing ;} }; class ForAllLoopOpBase : public E_F0mps { public: Expression et,ecode; const PolymorphicLoop *epl; ForAllLoopOpBase( basicForEachType * ret,const basicAC_F0 & args) : et(ret->CastTo(args[0])), ecode(args[2]),epl(0) { // if(args.size() > 3) efin=args[3]; epl = dynamic_cast((Expression) args[1]); assert(epl!=0); } AnyType tab(Stack s) const { return (*et)(s);} AnyType v(Stack s) const { return epl->fv(s);} AnyType i(Stack s) const { return epl->fi(s);} AnyType j(Stack s) const { return epl->fj(s);} void code(Stack s) const { (*ecode)(s) ;} // void end(Stack s) const { if(efin) (*efin)(s);} }; template class ForAllLoop : public OneOperator {public: typedef typename F::Tab T; class ForAllLoopOp : public ForAllLoopOpBase { public: F f; ForAllLoopOp(const basicAC_F0 & args):ForAllLoopOpBase(atype(),args),f((const ForAllLoopOpBase*)this) {} AnyType operator()(Stack s) const { return this->f.f(s);} }; E_F0 * code(const basicAC_F0 & args) const { return new ForAllLoopOp(args); } ForAllLoop() :OneOperator(atype(),atype(),atype()){ this->ellipse=true; } }; #endif freefem++-3.61-1/src/fflib/CodeAlloc.hpp000644 000767 000024 00000004015 13256636774 020032 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ class CodeAlloc { public: static size_t nb,nbt,lg, nbdl,nbpx, chunk ; static CodeAlloc ** mem; static bool cleanning; 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; } static void setdel(int i) { mem[i] = (CodeAlloc *) (void *) (((char *) mem[i] - (char *) 0)+ 1); } static void resize(); static void * Add2CleanAtEnd(void * p) { if(p) { if(nbt>=nbpx) resize(); if(nbt>0) sort = sort && mem[nbt-1] < p; nb++; mem[nbt++]=(CodeAlloc*)p; } return p; } void *operator new(size_t ll ) { lg+=ll; return Add2CleanAtEnd(::operator new(ll));} static void Sort_mem(); static void clear(); static void ErrorDel(void *pp); void operator delete(void * pp); virtual ~CodeAlloc() {} }; template class CodeAllocT: public CodeAlloc{ T * p; public: CodeAllocT(int n): p(new T[n]) { assert(p);} static T * New(int n) { return (new CodeAllocT(n))->p;} ~CodeAllocT(){ delete [] p;} }; freefem++-3.61-1/src/fflib/strversionnumber.cpp000644 000767 000024 00000001122 13321623724 021603 0ustar00hechtstaff000000 000000 #include "config-wrapper.h" #include "strversionnumber.hpp" // [[file:strversionnumber.hpp]] #include using namespace std; #define TOSTRING1(i) #i #define TOSTRING(i) TOSTRING1(i) //#include #include using namespace std; double VersionNumber(){ return VersionFreeFempp; } string StrVersionNumber(){ // std::ostringstream buffer; // buffer.precision(8); // buffer< using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "Mesh3dn.hpp" #include "MeshPoint.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" #include basicAC_F0::name_and_type CDomainOfIntegration::name_param[]= { { "qft", &typeid(const Fem2D::QuadratureFormular *)}, { "qfe", &typeid(const Fem2D::QuadratureFormular1d *)}, { "qforder",&typeid(long)}, { "qfnbpT",&typeid(long)}, { "qfnbpE",&typeid(long)}, { "optimize",&typeid(long)}, { "binside",&typeid(double)}, { "mortar",&typeid(bool)}, { "qfV", &typeid(const Fem2D::GQuadratureFormular *)}, { "levelset",&typeid(double)}, { "mapt",&typeid(E_Array)}, { "mapu",&typeid(E_Array)} }; basicAC_F0::name_and_type Problem::name_param[]= { { "save",&typeid(string* )}, { "cadna",&typeid(KN*)}, { "bmat",&typeid(Matrice_Creuse* )}, LIST_NAME_PARM_MAT /* { "init", &typeid(bool)}, { "solver", &typeid(TypeSolveMat*)}, { "eps", &typeid(double) }, { "precon",&typeid(Polymorphic*)}, { "dimKrylov",&typeid(long)}, { "bmat",&typeid(Matrice_Creuse* )}, { "tgv",&typeid(double )}, { "strategy",&typeid(long )}, { "save",&typeid(string* )}, { "cadna",&typeid(KN*)}, { "tolpivot", &typeid(double)}, { "tolpivotsym", &typeid(double)}, { "nbiter", &typeid(long)}, // 12 { "paramint",&typeid(KN_)}, // Add J. Morice 02/09 { "paramdouble",&typeid(KN_)}, { "paramstring",&typeid(string *)}, { "permrow",&typeid(KN_)}, { "permcol",&typeid(KN_)}, { "fileparamint",&typeid(string*)}, // Add J. Morice 02/09 { "fileparamdouble",&typeid(string*)}, { "fileparamstring",&typeid(string* )}, { "filepermrow",&typeid(string*)}, { "filepermcol",&typeid(string*)} //22 */ }; struct pair_stack_double { Stack first; double *second; pair_stack_double(Stack ss,double* bb) : first(ss),second(bb) {}; }; namespace Fem2D { void Expandsetoflab(Stack stack,const CDomainOfIntegration & di,set & setoflab,bool &all); void Expandsetoflab(Stack stack,const BC_set & bc,set & setoflab); void Check(const Opera &Op,int N,int M) { int err=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); pair jj(ll.first.first),ii(ll.first.second); if (ii.first <0 || ii.first >= M) err++; if (jj.first <0 || jj.first >= N) err++; } if (err) { cout << "Check Bilinear Operator" << N << " " << M << endl; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); pair jj(ll.first.first),ii(ll.first.second); cout << " + " << jj.first << " " << jj.second << "*" << ii.first << " " << ii.second << endl; } ExecError("Check BilinearOperator N M"); } } void Check(const BC_set * bc,int N) { int err=0; int kk=bc->bc.size(); for (int k=0;k xx=bc->bc[k]; if (xx.first >= N) { err++; cerr << " Sorry : just " << N << " componant in FE space \n" << " and Boundary condition refere to " << xx.first << "+1 componant " << endl; } } if (err) ExecError("Incompatibility beetwen boundary condition and FE space"); } void Check(const Ftest * fl,int N) { assert(fl); int err=0; Ftest::const_iterator kk= fl->v.end(),k; int ii=0; for (k=fl->v.begin();kfirst.first; if ( j >= N) { err++; cerr << " Sorry : just " << N << " componant in FE space \n" << " and linear var form refere to " << j << "+1 componant (part " << ii << ")" << endl; } } if (err) ExecError("Incompatibility beetwen linear varf and FE space"); } //--------------------------------------------------------------------------------------- template void Element_OpVF(MatriceElementairePleine & mat, const FElement3 & Ku,const FElement3 & KKu, const FElement3 & Kv,const FElement3 & KKv, double * p,int ie,int iie, int label,void *bstack,R3 *B) { ffassert(0); } template void Element_OpVF(MatriceElementairePleine & mat, const FElement & Ku,const FElement & KKu, const FElement & Kv,const FElement & KKv, double * p,int ie,int iie, int label,void *bstack,R2 *B) { ffassert(B==0); pair_stack_double * bs=static_cast(bstack); Stack stack= bs->first; double binside = *bs->second; // truc FH pour fluide de grad2 (decentrage bizard) assert(mat.onFace); // Finite Volume or discontinous Galerkine assert(ie>=0 && ie < 3); // int on edge MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool same = &Ku == & Kv; assert(same); const Triangle & T = Ku.T; int nTonEdge = &Ku == &KKu ? 1 : 2; double cmean = 1./nTonEdge; throwassert(&T == &Kv.T); // const QuadratureFormular & FI = mat.FIT; const QuadratureFormular1d & FIb = mat.FIE; long npi; R *a=mat.a; R *pa=a; long i,j; long n= mat.n,m=mat.m,nx=n*m; assert(nx<=mat.lga); long N= Kv.N; long M= Ku.N; long mu=Ku.NbDoF(); long mmu=KKu.NbDoF(); long nv=Kv.NbDoF(); long nnv=Kv.NbDoF(); assert(mu==mmu && nv == nnv) ; const Opera &Op(*mat.bilinearform); bool classoptm = copt && Op.optiexpK; // if (Ku.number<1 && verbosity/100 && verbosity % 10 == 2) if (Ku.number<1 && ( verbosity > 1 ) ) cout << "Element_OpVF P: copt = " << copt << " " << classoptm << " binside (For FH) =" << binside << " opt: " << mat.optim << endl; KN Dop(last_operatortype); // sinon ca plate bizarre Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(lastop<=3); int lffv = nv*N*last_operatortype; int lffu = mu*M*last_operatortype; int loffset = same ? 0 : (nv+nnv)*N*last_operatortype; RNMK_ fv(p,nv,N,lastop); // the value for basic fonction in K RNMK_ ffv(p + lffv ,nnv,N,lastop); // the value for basic fonction in KK RNMK_ fu( (double*) fv + loffset ,mu,M,lastop); // the value for basic fonction RNMK_ ffu( (double*) fu + lffu ,mmu,M,lastop); // the value for basic fonction R2 E=T.Edge(ie); double le = sqrt((E,E)); R2 PA(TriangleHat[VerticesOfTriangularEdge[ie][0]]), PB(TriangleHat[VerticesOfTriangularEdge[ie][1]]), PC(TriangleHat[OppositeVertex[ie]]); // warning the to edge are in opposite sens R2 PP_A(TriangleHat[VerticesOfTriangularEdge[iie][1]]), PP_B(TriangleHat[VerticesOfTriangularEdge[iie][0]]), PP_C(TriangleHat[OppositeVertex[ie]]); R2 Normal(E.perp()/-le); for (npi=0;npiset(T(Pt),Pt,Kv,label, Normal,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i jj(ll.first.first),ii(ll.first.second); int iis = ii.second, jjs=jj.second; int iicase = iis / last_operatortype; int jjcase = jjs / last_operatortype; iis %= last_operatortype; jjs %= last_operatortype; double w_i=0,w_j=0,ww_i=0,ww_j=0; if(ik>=0) w_i = wi(ii.first,iis ); if(jk>=0) w_j = wj(jj.first,jjs ); if( iicase>0 && ikk>=0) ww_i = wwi(ii.first,iis ); if( jjcase>0 && jkk>=0) ww_j = wwj(jj.first,jjs ); 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 (jjcase==Code_Jump) w_j = ww_j-w_j; // jump else if (jjcase==Code_Mean) w_j = cmean* (w_j +ww_j ); // average else if (jjcase==Code_OtherSide) w_j = ww_j; // valeur de l'autre cote // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization Element_OpVF2d (b) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } *pa += coef * ccc * w_i*w_j; } } } // else pa += m; } pa=a; if ( (verbosity > 9999) ||( (verbosity > 55) && (Ku.number <=0 || KKu.number <=0 ))) { cout < void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse & A, const FormBilinear * b ) { /*FH: case ..in 2D in varf ... standard case .. */ StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; const CDomainOfIntegration & di= *b->di; const Mesh * pThdi = GetAny( (* di.Th)(stack)); if ( pThdi != &Th || &Uh.Th !=&Th || &Vh.Th !=&Th) { cout << " --Use matrix formulation ---" << endl; ExecError("No way to compute bilinear form with integrale of on mesh \n" " test or unkown function defined on an other mesh! sorry to hard. "); } SHOWVERB(cout << " FormBilinear " << endl); double CPU0 = CPUtime(); MatriceElementaireSymetrique *mates =0; MatriceElementairePleine *matep =0; const int useopt=di.UseOpt(stack); double binside=di.binside(stack); //const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; set setoflab; bool all=true; const Mesh & ThI = Th;//* GetAny( (* di.Th)(stack)); bool sameMesh = &ThI == &Vh.Th && &ThI == &Uh.Th; // const QuadratureFormular1d & FIE = di.FIE(stack); // const QuadratureFormular & FIT = di.FIT(stack); const QuadratureFormular1d & FIEo = di.FIE(stack); const QuadratureFormular & FITo = di.FIT(stack); // const GQuadratureFormular & FIVo = di.FIV(stack); // to change the quadrature on element ... may 2014 FH .. QuadratureFormular1d FIE(FIEo,3); QuadratureFormular FIT(FITo,3); // GQuadratureFormular FIV(FIVo,3); bool VF=b->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- discontinous Galerkin =" << VF << " size of Mat =" << A.size()<< " Bytes\n"; if (verbosity>3) { if (CDomainOfIntegration::int1d==kind) cout << " -- boundary int border ( nQP: "<< FIE.n << ") ," ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIE.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIE.n << ")," ; else cout << " -- int (nQP: "<< FIT.n << " ) in " ; } //if(di.islevelset()) InternalError("So no levelset integration type on this case (6)"); if( di.withmap()) { ExecError(" no map in the case (2)??");} if(di.islevelset() && ( (CDomainOfIntegration::int1d!=kind) && (CDomainOfIntegration::int2d!=kind) ) ) InternalError("So no levelset integration type on no int1d case (6)"); Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; }*/ if (verbosity>3) cout <<" Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(b->b->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;ib->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); KN ok(b->b->v.size()); { // remove the zero coef in the liste // R zero=R(); int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) ok[il] = ! (b->b->mesh_indep_stack_opt[il] && ( Fem2D::norm(*(where_in_stack[il])) < 1e-100 ) ); } BilinearOperator b_nozer(*b->b,ok); if (verbosity % 10 > 3 ) cout << " -- nb term in bilinear form (!0) : " << b_nozer.v.size() << " total " << n_where_in_stack_opt << endl; if ( (verbosity/100) % 10 >= 2) { int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) cout << il << " coef (" << l->first << ") = " << *(where_in_stack[il]) << " offset=" << b->b->where_in_stack_opt[il] << " dep mesh " << l->second.MeshIndependent() << b->b->mesh_indep_stack_opt[il] << endl; } } Stack_Ptr(stack,ElemMatPtrOffset) =where_in_stack; void *paramate=stack; pair_stack_double parammatElement_OpVF(stack,& binside); // parammatElement_OpVF.first = stack; // parammatElement_OpVF.second= & binside; if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if(VF) { if(&Uh != &Vh || sym) cout << ("To Day in bilinear form with discontinous Galerkin (2d): \n" " test or unkown function must be defined on the same FEspace, \n" " and the matrix is not symmetric. \n" " To do other case in a future (F. Hecht) dec. 2003 "); if(&Uh == &Vh) matep= new MatriceElementairePleine(Uh,VF,FIT,FIE,useopt); else matep= new MatriceElementairePleine(Uh,Vh,VF,FIT,FIE,useopt); // matep= new MatriceElementairePleine(Uh,Vh,VF,FIT,FIE); matep->faceelement = Element_OpVF; paramate= ¶mmatElement_OpVF; } else if (sym) { mates= new MatriceElementaireSymetrique(Uh,FIT,FIE,useopt); mates->element = Element_Op; } else { matep= new MatriceElementairePleine(Uh,Vh,FIT,FIE,useopt); matep->element = Element_Op; } MatriceElementaireFES & mate(*( sym? (MatriceElementaireFES *)mates : (MatriceElementaireFES *) matep)); mate.bilinearform=b->b; Check(*mate.bilinearform,mate.Uh.N,mate.Vh.N); if(verbosity>9) cout << " -- CPU init assemble mat " << CPUtime()-CPU0 << " s\n"; if (di.kind == CDomainOfIntegration::int1d ) { if(di.islevelset()) { double uset = HUGE_VAL; R2 Q[3]; KN phi(Th.nv);phi=uset; double f[3]; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10); if(np==2) { /* if ( sameMesh) { Element_rhs(Vh[t],*l->l,buf,stack,*B,FIE,Q[0],Q[1]); } else*/ // InternalError(" No levelSet on Diff mesh : to day int1d of Matrix"); A += mate(t,10,Th[t].lab,stack,Q); } if(sptrclean) sptrclean=sptr->clean(); } } } } else for( int e=0;eclean(); // modif FH mars 2006 clean Ptr } } } else if (di.kind == CDomainOfIntegration::intalledges) { for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) { // modif F.H to get the correct label in intalledges int e0=VerticesOfTriangularEdge[ie][0]; int e1=VerticesOfTriangularEdge[ie][1]; int i1 = Th(Th[i][e0]),i2 = Th(Th[i][e1]); BoundaryEdge * be = Th.TheBoundaryEdge(i1,i2); int lab = be ? be->lab : notalabel; A += mate(i,ie,lab,paramate); } if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (di.kind == CDomainOfIntegration::intallVFedges) { cerr << " a faire intallVFedges " << endl; ffassert(0); for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) A += mate(i,ie,Th[i].lab,paramate); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (di.kind == CDomainOfIntegration::int2d ) { if(di.islevelset()) { double uset = HUGE_VAL; R2 Q[2][3]; double vol6[2]; KN phi(Th.nv);phi=uset; double f[3]; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } int nt= UnderIso(f,Q, vol6,1e-14); setQF(FIT,FITo,QuadratureFormular_T_1, Q,vol6,nt); if(FIT.n) A += mate(t,-1,Th[t].lab,stack); if(sptrclean) sptrclean=sptr->clean(); } } FIT =FITo; } else for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) A += mate(i,-1,Th[i].lab,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr // AA += mate; } } else InternalError(" kind of CDomainOfIntegration unkown"); if (where_in_stack) delete [] where_in_stack; delete &mate; if(verbosity>9) cout << " -- CPU assemble mat " << CPUtime()-CPU0 << " s\n"; } // --------- FH 120105 // 3d template void AssembleBilinearForm(Stack stack,const FESpace3::Mesh & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse & A, const FormBilinear * b ) { /*FH: case ..in 3D in varf ... standard case .. */ typedef FESpace3 FESpace; typedef FESpace3::Mesh Mesh; typedef Mesh *pmesh ; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); Fem2D::MeshPoint & mp (*Fem2D::MeshPointStack(stack)), mps = mp; bool sptrclean=true; const CDomainOfIntegration & di= *b->di; ffassert(di.d==3); const Mesh * pThdi = GetAny( (* di.Th)(stack)); if ( pThdi != &Th || &Uh.Th !=&Th || &Vh.Th !=&Th) { cout << " Use matrix formulation .... " << endl; ExecError("No way to compute bilinear form with integrale of on mesh \n" " test or unkown function defined on an other mesh! sorry to hard. "); } SHOWVERB(cout << " FormBilinear " << endl); MatriceElementaireSymetrique *mates =0; MatriceElementairePleine *matep =0; const int useopt=di.UseOpt(stack); double binside=di.binside(stack); if( di.withmap()) { ExecError(" no map in the case (3)??");} //const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; set setoflab; bool all=true; const QuadratureFormular1d & FIEo = di.FIE(stack); const QuadratureFormular & FITo = di.FIT(stack); const GQuadratureFormular & FIVo = di.FIV(stack); // to change the quadrature on element ... may 2014 FH .. QuadratureFormular1d FIE(FIEo,3); QuadratureFormular FIT(FITo,3); GQuadratureFormular FIV(FIVo,3); bool VF=b->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- discontinous Galerkin =" << VF << " size of Mat =" << A.size()<< " Bytes\n"; if (verbosity>3) { if (CDomainOfIntegration::int2d==kind) cout << " -- boundary int border ( nQP: "<< FIT.n << ") ," ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIT.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIE.n << ")," ; else cout << " -- int3d (nQP: "<< FIV.n << " ) in " ; if(di.islevelset()) cout << " ( int on Levelset) " << endl; } if(di.islevelset() && (CDomainOfIntegration::int2d!=kind) && (CDomainOfIntegration::int3d!=kind)) InternalError("Sorry no levelset integration type on no int[2|3]d case"); Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; }*/ if (verbosity>3) cout <<" Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(b->b->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;ib->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); KN ok(b->b->v.size()); { // remove the zero coef in the liste // R zero=R(); int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) ok[il] = ! (b->b->mesh_indep_stack_opt[il] && ( Fem2D::norm(*(where_in_stack[il])) < 1e-100 ) ); } BilinearOperator b_nozer(*b->b,ok); if (verbosity % 10 > 3 ) cout << " -- nb term in bilinear form (!0) : " << b_nozer.v.size() << " total " << n_where_in_stack_opt << endl; if ( (verbosity/100) % 10 >= 2) { int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) cout << il << " coef (" << l->first << ") = " << *(where_in_stack[il]) << " offset=" << b->b->where_in_stack_opt[il] << " dep mesh " << l->second.MeshIndependent() << b->b->mesh_indep_stack_opt[il] << endl; } } Stack_Ptr(stack,ElemMatPtrOffset) =where_in_stack; void *paramate=stack; pair_stack_double parammatElement_OpVF(stack, & binside); parammatElement_OpVF.first = stack; parammatElement_OpVF.second= & binside; if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if(VF) { if(&Uh != &Vh || sym) cout << ("To Day in bilinear form with discontinous Galerkin (3d): \n" " test or unkown function must be defined on the same FEspace, \n" " and the matrix is not symmetric. \n" " To do other case in a future (F. Hecht) dec. 2014 "); if(&Uh == &Vh) matep= new MatriceElementairePleine(Uh,VF,FIV,FIT,useopt); else matep= new MatriceElementairePleine(Uh,Vh,VF,FIV,FIT,useopt); matep->faceelement = Element_OpVF; paramate= ¶mmatElement_OpVF; } else if (sym) { mates= new MatriceElementaireSymetrique(Uh,FIV,FIT,useopt); mates->element = Element_Op; } else { matep= new MatriceElementairePleine(Uh,Vh,FIV,FIT,useopt); matep->element = Element_Op; } MatriceElementaireFES & mate(*( sym? (MatriceElementaireFES *)mates : (MatriceElementaireFES *) matep)); mate.bilinearform=b->b; Check(*mate.bilinearform,mate.Uh.N,mate.Vh.N); if (di.kind == CDomainOfIntegration::int2d ) { if(di.islevelset()) { if(verbosity>99) cout << " int2d on levelset in 3d " << endl; double uset = HUGE_VAL; R3 Q[4]; KN phi(Th.nv);phi=uset; double f[4]; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<4;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10);// ca code ... // cout <2 ) { if( verbosity > 999 ) cout << " -- int " << np << " on: " << Q[0] << " " << Q[1] << " " << Q[2] << " " << Q[3] << endl; A += mate(t,10+np,Th[t].lab,stack,Q); } if(sptrclean) sptrclean=sptr->clean(); } }} } else for( int e=0;eclean(); // modif FH mars 2006 clean Ptr } } } else if (di.kind == CDomainOfIntegration::intallfaces ) { for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) A += mate(i,ie,Th[i].lab,paramate); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (di.kind == CDomainOfIntegration::intallVFedges) { cerr << " a faire intallVFedges " << endl; ffassert(0); for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) A += mate(i,ie,Th[i].lab,paramate); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (di.kind == CDomainOfIntegration::int3d ) { if(di.islevelset()) // may 2014 FH ... { // int3d levelset < 0 double llevelset = 0; const double uset = std::numeric_limits::max(); // cout << " uset ="< phi(Th.nv); phi=uset; double f[4]; for (int t=0;t< Th.nt; t++) { const Mesh3::Element & K(Th[t]); if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=std::numeric_limits::min(),umn=std::numeric_limits::max(); for(int i=0;i<4;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; } int ntets= UnderIso(f,Q, vol6,1e-14); setQF(FIV,FIVo,QuadratureFormular_Tet_1, Q,vol6,ntets); if(FIV.n) { A += mate(t,-1,Th[t].lab,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } FIV=FIVo; } else for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) A += mate(i,-1,Th[i].lab,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr // AA += mate; } } else { cerr << " kind of CDomainOfIntegration unkown ?? " << di.kind << endl; InternalError(" kind of CDomainOfIntegration unkown"); } if (where_in_stack) delete [] where_in_stack; delete &mate; mp = mps;// restore data x,yz } // end 3d // --------- FH 170605 template void AddMatElem(map, R > & A,const Mesh & Th,const BilinearOperator & Op,bool sym,int it, int ie,int label, const FESpace & Uh,const FESpace & Vh, const QuadratureFormular & FI, const QuadratureFormular1d & FIb, double *p, void *vstack, bool intmortar=false,R2 *Q=0) { //cout << "AddMatElem" << Q << " " << ie << endl; Stack stack=pvoid2Stack(vstack); MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Mesh & Thu(Uh.Th); const Mesh & Thv(Vh.Th); bool same = &Uh == & Vh; const Triangle & T = Th[it]; long npi; long i,j; bool classoptm = copt && Op.optiexpK; assert(Op.MaxOp() Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(lastop<=3); if (ie<0) { for (npi=0;npi100) cout << " On a pas trouver (u) " << P << " " << endl; continue;}} if(same) { tv=tu; outsidev=outsideu; Ptv=Ptu; } else { if(&Th == & Thv ) { tv =&T; Ptv=Pt; } else { tv= Thv.Find(P,Ptv,outsidev); if( !tv || outsidev) { if(verbosity>100) cout << " On a pas trouver (v) " << P << " " << endl; continue; }} } iut = Thu(tu); ivt = Thv(tv); if( verbosity>1000) cout << " T " << it << " iut " << iut << " ivt " << ivt << endl ; FElement Ku(Uh[iut]); FElement Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); MeshPointStack(stack)->set(Th,P,Pt,T,label); if (classoptm) (*Op.optiexpK)(stack); // call optim version if (!same) Kv.BF(Dop,Ptv,fv); for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)) ; if( verbosity>1000) cout << ig << " " << jg << " " << " " << ccc << " " << coef * ccc * w_i*w_j << " on T \n" ; double wij = w_i*w_j; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += coef * ccc * wij; } } } } } else // int on edge ie { R2 PA,PB,E; if(Q) { PA=Q[0]; PB=Q[1]; E=T(PB)-T(PA); // cout << " AddMAtElem " << PA << " " << PB << " "<< sqrt((E,E))<< endl; } else { PA=TriangleHat[VerticesOfTriangularEdge[ie][0]]; PB=TriangleHat[VerticesOfTriangularEdge[ie][1]]; E=T.Edge(ie); } double le = sqrt((E,E)); for (npi=0;npi100) cout << " On a pas trouver (u) " << P << " " <100) cout << " On a pas trouver (v) " << P << " " << endl; continue;}} ivt = Thv(tv); } FElement Ku(Uh[iut]); FElement Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; // cout << P << " " << Pt << " " << iut << " " << ivt << " Ptu : " << Ptu << " Ptv: " << Ptv << " n:" << n << " m:" << m << endl; RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); if( !same) Kv.BF(Dop,Ptv,fv); // int label=-999999; // a passer en argument MeshPointStack(stack)->set(Th,P,Pt,T,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); double wij = w_i*w_j; if (abs(wij)>= 1e-10&& (verbosity>1000)) cout << " \t\t\t" << ig << " " << jg << " " << ccc << " " << coef * ccc * w_i*w_j << " on edge \n" ; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += wij*coef*ccc ; } } } } } *MeshPointStack(stack) = mp; } template void AddMatElem(Expression const *const mapu,Expression const * const mapt, map, R > & A,const Mesh & Th,const BilinearOperator & Op,bool sym,int it, int ie,int label, const FESpace & Uh,const FESpace & Vh, const QuadratureFormular & FI, const QuadratureFormular1d & FIb, double *p, void *vstack, bool intmortar=false,R2 *Q=0) { //cout << "AddMatElem" << Q << " " << ie << endl; Stack stack=pvoid2Stack(vstack); MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Mesh & Thu(Uh.Th); const Mesh & Thv(Vh.Th); bool same = (&Uh == & Vh) && !mapu && !mapt; bool sameu = &Th == & Thu && !mapu ; bool samev = &Th == & Thv && !mapt ; const Triangle & T = Th[it]; long npi; long i,j; bool classoptm = copt && Op.optiexpK; assert(Op.MaxOp() Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(lastop<=3); if (ie<0) { for (npi=0;npiset(Th,P,Pt,T,label); if(mapu) Pu = R2( GetAny((*mapu[0])(vstack)), GetAny((*mapu[1])(vstack))); if(mapt) Pv = R2( GetAny((*mapt[0])(vstack)), GetAny((*mapt[1])(vstack))); if(verbosity>9999 && (mapu || mapt) ) cout << " mapinng: " << P << " AddMatElem + map -> (u) " << Pu << " (t) ->"<< Pv << endl; bool outsideu,outsidev; // ici trouve le T int iut=0,ivt=0; const Triangle * tu,*tv; if(sameu ) { tu =&T; Ptu=Pt; } else { tu= Thu.Find(Pu,Ptu,outsideu); if( !tu || outsideu) { if(verbosity>100) cout << " On a pas trouver (u) " << P << " " << endl; continue;}} if(same ) { tv=tu; outsidev=outsideu; Ptv=Ptu; } else if(samev) { tv =&T; Ptv=Pt; } else { tv= Thv.Find(Pv,Ptv,outsidev); if( !tv || outsidev) { if(verbosity>100) cout << " On a pas trouver (v) " << P << " " << endl; continue; } } iut = Thu(tu); ivt = Thv(tv); if( verbosity>1000) cout << " T " << it << " iut " << iut << " ivt " << ivt << endl ; FElement Ku(Uh[iut]); FElement Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); if (classoptm) (*Op.optiexpK)(stack); // call optim version if (!same) Kv.BF(Dop,Ptv,fv); for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)) ; if( verbosity>1000) cout << ig << " " << jg << " " << " " << ccc << " " << coef * ccc * w_i*w_j << " on T \n" ; double wij = w_i*w_j; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += coef * ccc * wij; } } } } } else // int on edge ie { R2 PA,PB,E; if(Q) { PA=Q[0]; PB=Q[1]; E=T(PB)-T(PA); // cout << " AddMAtElem " << PA << " " << PB << " "<< sqrt((E,E))<< endl; } else { PA=TriangleHat[VerticesOfTriangularEdge[ie][0]]; PB=TriangleHat[VerticesOfTriangularEdge[ie][1]]; E=T.Edge(ie); } double le = sqrt((E,E)); for (npi=0;npiset(Th,P,Pt,T,label,R2(E.y,-E.x)/le,ie); if(mapu) Pu = R2( GetAny((*mapu[0])(vstack)), GetAny((*mapu[1])(vstack))); if(mapt) Pv = R2( GetAny((*mapt[0])(vstack)), GetAny((*mapt[1])(vstack))); bool outsideu,outsidev; // ici trouve le T int iut=0,ivt=0; const Triangle * tu, *tv; if(sameu ) { tu =&T; Ptu=Pt; } else { tu= Thu.Find(Pu,Ptu,outsideu); if( !tu || (outsideu && !intmortar) ) { //R dd=-1; //if(tu) { R2 PP((*tu)(Ptu)),PPP(P,PP) ; cout << PP << " " << sqrt( (PPP,PPP) ) <<" "; } if(verbosity>100) cout << " On a pas trouver (u) " << P << " " <100) cout << " On a pas trouver (v) " << P << " " << endl; continue;}} ivt = Thv(tv); FElement Ku(Uh[iut]); FElement Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; // cout << P << " " << Pt << " " << iut << " " << ivt << " Ptu : " << Ptu << " Ptv: " << Ptv << " n:" << n << " m:" << m << endl; RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); if( !same) Kv.BF(Dop,Ptv,fv); // int label=-999999; // a passer en argument if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); double wij = w_i*w_j; if (abs(wij)>= 1e-10&& (verbosity>1000)) cout << " \t\t\t" << ig << " " << jg << " " << ccc << " " << coef * ccc * w_i*w_j << " on edge \n" ; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += wij*coef*ccc ; } } } } } *MeshPointStack(stack) = mp; } template void AddMatElem(map, R > & A,const Mesh3 & Th,const BilinearOperator & Op,bool sym,int it, int ie,int label, const FESpace3 & Uh,const FESpace3 & Vh, const Fem2D::GQuadratureFormular & FI, const QuadratureFormular & FIb, double *p, void *vstack, bool intmortar=false) { Stack stack=pvoid2Stack(vstack); MeshPoint mp= *MeshPointStack(stack); static int count =0; // non test FH ......................... if(count++ < 1) { cout << " Warning : Assemble Matrix with incompatible 3d meshes in test (FH) " << endl; cout << " ------------------------------------------------------------- " << endl; } R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Mesh3 & Thu(Uh.Th); const Mesh3 & Thv(Vh.Th); bool same = &Uh == & Vh; const Tet & T = Th[it]; long npi; long i,j; bool classoptm = copt && Op.optiexpK; assert(Op.MaxOp() pi(FI[npi]); double coef = T.mesure()*pi.a; R3 Pt(pi),Ptu,Ptv; R3 P(T(Pt)); bool outsideu,outsidev; // ici trouve le T int iut=0,ivt=0; const Tet * tu,*tv; if(&Th == & Thu ) { tu =&T; Ptu=Pt; } else { tu= Thu.Find(P,Ptu,outsideu); if( !tu || outsideu) { if(verbosity>100) cout << " On a pas trouver (u) " << P << " " << endl; continue;}} if(same) { tv=tu; outsidev=outsideu; Ptv=Ptu; } else { if(&Th == & Thv ) { tv =&T; Ptv=Pt; } else { tv= Thv.Find(P,Ptv,outsidev); if( !tv || outsidev) { if(verbosity>100) cout << " On a pas trouver (v) " << P << " " << endl; continue; }} } iut = Thu(tu); ivt = Thv(tv); if( verbosity>1000) cout << " T " << it << " iut " << iut << " ivt " << ivt << endl ; FElement3 Ku(Uh[iut]); FElement3 Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; RNMK_ fv(p,n,N,(long) lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,(long) lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); MeshPointStack(stack)->set(Th,P,Pt,T,label); if (classoptm) (*Op.optiexpK)(stack); // call optim version if (!same) Kv.BF(Dop,Ptv,fv); for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)) ; if( verbosity>1000) cout << ig << " " << jg << " " << " " << ccc << " " << coef * ccc * w_i*w_j << " on T \n" ; double wij = w_i*w_j; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += coef * ccc * wij; } } } } else // int on edge ie for (npi=0;npi pi( FIb[npi]); R3 NN= T.N(ie); double mes=NN.norme(); NN/=mes; double coef = 0.5*mes*pi.a; // correction 0.5 050109 FH R3 Pt(T.PBord(ie,pi)); //Ku.BF(Dop,Pt,fu); R3 Ptu,Ptv; R3 P(T(Pt)); bool outsideu,outsidev; // ici trouve le T int iut=0,ivt=0; const Tet * tu, *tv; if(&Th == & Thu ) { tu =&T; Ptu=Pt; } else { tu= Thu.Find(P,Ptu,outsideu); if( !tu || (outsideu && !intmortar) ) { //R dd=-1; //if(tu) { R2 PP((*tu)(Ptu)),PPP(P,PP) ; cout << PP << " " << sqrt( (PPP,PPP) ) <<" "; } if(verbosity>100) cout << " On a pas trouver (u) " << P << " " <100) cout << " On a pas trouver (v) " << P << " " << endl; continue;}} ivt = Thv(tv); } FElement3 Ku(Uh[iut]); FElement3 Kv(Vh[ivt]); long n= Kv.NbDoF() ,m=Ku.NbDoF(); long N= Kv.N; long M= Ku.N; // cout << P << " " << Pt << " " << iut << " " << ivt << " Ptu : " << Ptu << " Ptv: " << Ptv << " n:" << n << " m:" << m << endl; RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction Ku.BF(Dop,Ptu,fu); if( !same) Kv.BF(Dop,Ptv,fv); // int label=-999999; // a passer en argument MeshPointStack(stack)->set(Th,P,Pt,T,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); double wij = w_i*w_j; if (abs(wij)>= 1e-10&& (verbosity>1000)) cout << " \t\t\t" << ig << " " << jg << " " << ccc << " " << coef * ccc * w_i*w_j << " on edge \n" ; if (abs(wij)>= 1e-10) A[make_pair(ig,jg)] += wij*coef*ccc ; } } } } *MeshPointStack(stack) = mp; } template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, map, R > & A, const FormBilinear * b ) { /*FH: case ..in 2D in varf ... all mesh can can be different .... */ StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr const CDomainOfIntegration & di= *b->di; const Mesh * pThdi = GetAny( (* di.Th)(stack)); SHOWVERB(cout << " FormBilinear () " << endl); //MatriceElementaireSymetrique *mates =0; // MatriceElementairePleine *matep =0; const int useopt=di.UseOpt(stack); //double binside=di.binside(stack); const bool intmortar=di.intmortar(stack); if ( verbosity >1) { cout << " Integral on Th nv : " << Th.nv << " nt : " << Th.nt << endl; cout << " Th/ u nv : " << Uh.Th.nv << " nt : " << Uh.Th.nt << endl; cout << " Th/ v nv : " << Vh.Th.nv << " nt : " << Vh.Th.nt << endl; cout << " suppose in mortar " << intmortar << " levelset= " << di.islevelset() << " withmap: " << di.withmap() << endl; } Expression const * const mapt=*di.mapt?di.mapt:0 ; Expression const * const mapu=*di.mapu?di.mapu:0 ; bool withmap =di.withmap(); // ExecError(" no map in the case (4) ??");} assert(pThdi == & Th); //const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; set setoflab; bool all=true; const QuadratureFormular1d & FIE = di.FIE(stack); const QuadratureFormular & FITo = di.FIT(stack); QuadratureFormular FIT(FITo,3); bool VF=b->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- discontinous Galerkin =" << VF << " size of Mat =" << A.size()<< " Bytes\n"; if (verbosity>3) { if (CDomainOfIntegration::int1d==kind) cout << " -- boundary int border ( nQP: "<< FIE.n << ") ," ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIE.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIE.n << ")," ; else cout << " -- int 2d (nQP: "<< FIT.n << " ) in " ; } // if(di.islevelset()) InternalError("Sorry no levelset integration type on this case (1)"); if(di.islevelset() && (CDomainOfIntegration::int1d!=kind) && (CDomainOfIntegration::int2d!=kind) ) InternalError("Sorry no levelset integration type on no int1d case"); /* if (verbosity>3) if (CDomainOfIntegration::int1d==kind) cout << " -- boundary int border " ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges, " ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges, " ; else cout << " -- int in " ; */ Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; }*/ if (verbosity>3) cout <<" Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(b->b->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;ib->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); KN ok(b->b->v.size()); { // remove the zero coef in the liste // R zero=R(); int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) ok[il] = ! (b->b->mesh_indep_stack_opt[il] && ( Fem2D::norm(*(where_in_stack[il])) < 1e-100 ) ); } BilinearOperator b_nozer(*b->b,ok); if (verbosity % 10 > 3 ) cout << " -- nb term in bilinear form (!0) : " << b_nozer.v.size() << " total " << n_where_in_stack_opt << endl; if ( (verbosity/100) % 10 >= 2) { int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) cout << il << " coef (" << l->first << ") = " << *(where_in_stack[il]) << " offset=" << b->b->where_in_stack_opt[il] << " dep mesh " << l->second.MeshIndependent() << b->b->mesh_indep_stack_opt[il] << endl; } } Stack_Ptr(stack,ElemMatPtrOffset) =where_in_stack; KN p(Vh.esize()+ Uh.esize() ); if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if (di.kind == CDomainOfIntegration::int1d ) { if(di.islevelset()) { double uset = HUGE_VAL; R2 Q[2]; double vol6[2]; KN phi(Th.nv);phi=uset; double f[3], ll=0; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } int ntp= IsoLineK(f,Q,1e-10); if(verbosity>999 && ntp==2) { const Triangle &T = Th[t]; R2 E(T(Q[0]),T(Q[1])); double le=sqrt((E,E)); ll += le; cout << "\t\t" << ntp <<" : " << Q[0] << " " << Q[1] << " ; " << f[0] << " " << f[1] << " " << f[2] << " " << le << " / " << ll<b,sym,t,10,Th[t].lab,Uh,Vh,FIT,FIE,p,stack,intmortar,Q); else AddMatElem(A,Th,*b->b,sym,t,10,Th[t].lab,Uh,Vh,FIT,FIE,p,stack,intmortar,Q); if(sptrclean) sptrclean=sptr->clean(); } } } FIT =FITo; } else { for( int e=0;eb,sym,i,ie,Th.bedges[e].lab,Uh,Vh,FIT,FIE,p,stack,intmortar); else AddMatElem(A,Th,*b->b,sym,i,ie,Th.bedges[e].lab,Uh,Vh,FIT,FIE,p,stack,intmortar); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } }} else if (di.kind == CDomainOfIntegration::intalledges) { cerr << " Sorry no implement to hard "<< endl; ExecError("FH: no intalledges on diff mesh ???"); ffassert(0); // a faire if(withmap) for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) AddMatElem(mapu,mapt,A,Th,*b->b,sym,i,ie,Th[i].lab,Uh,Vh,FIT,FIE,p,stack,intmortar); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } else for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) AddMatElem(A,Th,*b->b,sym,i,ie,Th[i].lab,Uh,Vh,FIT,FIE,p,stack,intmortar); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (di.kind == CDomainOfIntegration::intallVFedges) { cerr << " a faire intallVFedges " << endl; ffassert(0); } else if (di.kind == CDomainOfIntegration::int2d ) { // cerr << " a faire CDomainOfIntegration::int2d " << endl; if(di.islevelset()) { double uset = HUGE_VAL; R2 Q[2][3]; double vol6[2]; KN phi(Th.nv);phi=uset; double f[3]; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } int nt= UnderIso(f,Q, vol6,1e-14); setQF(FIT,FITo,QuadratureFormular_T_1, Q,vol6,nt); if(FIT.n) { if(withmap) AddMatElem(mapu,mapt,A,Th,*b->b,sym,t,-1,Th[t].lab,Uh,Vh,FIT,FIE,p,stack); else AddMatElem(A,Th,*b->b,sym,t,-1,Th[t].lab,Uh,Vh,FIT,FIE,p,stack); } if(sptrclean) sptrclean=sptr->clean(); } } FIT =FITo; } else { if(withmap) for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) AddMatElem(mapu,mapt,A,Th,*b->b,sym,i,-1,Th[i].lab,Uh,Vh,FIT,FIE,p,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } else for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) AddMatElem(A,Th,*b->b,sym,i,-1,Th[i].lab,Uh,Vh,FIT,FIE,p,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } }} else InternalError(" kind of CDomainOfIntegration unkown"); if (where_in_stack) delete [] where_in_stack; } template void AssembleBilinearForm(Stack stack,const Mesh3 & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, map, R > & A, const FormBilinear * b ) { /*FH: case ..in 3D in varf ... all mesh can can be different .... */ StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr Fem2D::MeshPoint & mp (*Fem2D::MeshPointStack(stack)), mps = mp; const CDomainOfIntegration & di= *b->di; const Mesh3 * pThdi = GetAny( (* di.Th)(stack)); SHOWVERB(cout << " FormBilinear () " << endl); //MatriceElementaireSymetrique *mates =0; // MatriceElementairePleine *matep =0; const int useopt=di.UseOpt(stack); //double binside=di.binside(stack); const bool intmortar=di.intmortar(stack); if ( verbosity >1) { cout << " Integral on Th nv : " << Th.nv << " nt : " << Th.nt << endl; cout << " Th/ u nv : " << Uh.Th.nv << " nt : " << Uh.Th.nt << endl; cout << " Th/ v nv : " << Vh.Th.nv << " nt : " << Vh.Th.nt << endl; cout << " suppose in mortar " << intmortar << endl; } assert(pThdi == & Th); //const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; set setoflab; bool all=true; // const QuadratureFormular1d & FIEo = di.FIE(stack); const QuadratureFormular & FITo = di.FIT(stack); const GQuadratureFormular & FIVo = di.FIV(stack); // to change the quadrature on element ... may 2014 FH .. // QuadratureFormular1d FIE(FIEo,3); QuadratureFormular FIT(FITo,3); GQuadratureFormular FIV(FIVo,3); // const QuadratureFormular & FIT = di.FIT(stack); // const Fem2D::GQuadratureFormular & FIV = di.FIV(stack); bool VF=b->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- discontinous Galerkin =" << VF << " size of Mat =" << A.size()<< " Bytes\n"; if (verbosity>3) { if (CDomainOfIntegration::int2d==kind) cout << " -- boundary int border ( nQP: "<< FIT.n << ") ," ; else if (CDomainOfIntegration::intallfaces==kind) cout << " -- boundary int all edges ( nQP: "<< FIT.n << ")," ; //else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIT.n << ")," ; else cout << " -- int 3d (nQP: "<< FIV.n << " ) in " ; } if(di.islevelset()) InternalError("Sorry no levelset integration type on this case (2)"); if(di.islevelset() && (CDomainOfIntegration::int2d!=kind) && (CDomainOfIntegration::int3d!=kind) ) InternalError("Sorry no levelset integration type on no int2d case"); Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; }*/ if (verbosity>3) cout <<" Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(b->b->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;ib->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); KN ok(b->b->v.size()); { // remove the zero coef in the liste // R zero=R(); int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) ok[il] = ! (b->b->mesh_indep_stack_opt[il] && ( Fem2D::norm(*(where_in_stack[il])) < 1e-100 ) ); } BilinearOperator b_nozer(*b->b,ok); if (verbosity % 10 > 3 ) cout << " -- nb term in bilinear form (!0) : " << b_nozer.v.size() << " total " << n_where_in_stack_opt << endl; if ( (verbosity/100) % 10 >= 2) { int il=0; for (BilinearOperator::const_iterator l=b->b->v.begin();l!=b->b->v.end();l++,il++) cout << il << " coef (" << l->first << ") = " << *(where_in_stack[il]) << " offset=" << b->b->where_in_stack_opt[il] << " dep mesh " << l->second.MeshIndependent() << b->b->mesh_indep_stack_opt[il] << endl; } } Stack_Ptr(stack,ElemMatPtrOffset) =where_in_stack; KN p(Vh.esize()+ Uh.esize() ); if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if (di.kind == CDomainOfIntegration::int2d ) { for( int e=0;eb,sym,i,ie,Th.be(e).lab,Uh,Vh,FIV,FIT,p,stack,intmortar); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } else if (di.kind == CDomainOfIntegration::intallfaces) { ffassert(0); // a faire for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) AddMatElem(A,Th,*b->b,sym,i,ie,Th[i].lab,Uh,Vh,FIV,FIT,p,stack,intmortar); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } /* else if (di.kind == CDomainOfIntegration::intallVFedges) { cerr << " a faire intallVFedges " << endl; ffassert(0); } */ else if (di.kind == CDomainOfIntegration::int3d ) { if(di.islevelset()) // may 2014 FH ... { // int3d levelset < 0 double llevelset = 0; const double uset = std::numeric_limits::max(); // cout << " uset ="< phi(Th.nv); phi=uset; double f[4]; for (int t=0;t< Th.nt; t++) { const Mesh3::Element & K(Th[t]); if (all || setoflab.find(Th[t].lab) != setoflab.end()) { double umx=std::numeric_limits::min(),umn=std::numeric_limits::max(); for(int i=0;i<4;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; } int ntets= UnderIso(f,Q, vol6,1e-14); setQF(FIV,FIVo,QuadratureFormular_Tet_1, Q,vol6,ntets); if(FIV.n) { AddMatElem(A,Th,*b->b,sym,t,-1,Th[t].lab,Uh,Vh,FIV,FIT,p,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } FIV = FIVo; } else { // cerr << " a faire CDomainOfIntegration::int3d " << endl; for (int i=0;i< Th.nt; i++) { if ( all || setoflab.find(Th[i].lab) != setoflab.end()) AddMatElem(A,Th,*b->b,sym,i,-1,Th[i].lab,Uh,Vh,FIV,FIT,p,stack); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } else InternalError(" kind of CDomainOfIntegration unkown"); if (where_in_stack) delete [] where_in_stack; mp=mps;// restore x,y,z } // --------- FH 170605 template void Element_Op(MatriceElementairePleine & mat,const FElement3 & Ku,const FElement3 & Kv,double * p,int ie,int label,void *vstack,R3 *B) { // ffassert(B==0); Stack stack=pvoid2Stack(vstack); // ffassert(0); typedef FElement3::Element Element; MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool same = &Ku == & Kv; const Element & T = Ku.T; throwassert(&T == &Kv.T); const GQuadratureFormular & FI = mat.FIT; const GQuadratureFormular & FIb = mat.FIE; long npi; R *a=mat.a; R *pa=a; long i,j; long n= mat.n,m=mat.m,nx=n*m; long N= Kv.N; long M= Ku.N; const Opera &Op(*mat.bilinearform); bool classoptm = copt && Op.optiexpK; bool oldopt=1; // juin 2007 FH ???? a voir int iloop=0; KN unvarexp(classoptm ? Op.optiexpK->sizevar() : 1); if (Ku.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_Op 3d P: copt = " << copt << " " << classoptm << " opt: " << mat.optim << endl; assert(Op.MaxOp() Dop(last_operatortype); //p.DiffOp(Dop); //int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(lastop<=3); RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction for (i=0;i< nx;i++) *pa++ = 0.; if (ie<0) for (npi=0;npi pi(FI[npi]); R coef = T.mesure()*pi.a; R3 Pt(pi); pa =a; Ku.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(Pt),Pt,Kv); if (classoptm) { if( oldopt) (*Op.optiexpK)(stack); // call old optim version else Op.optiexpK->eval(stack,iloop++,unvarexp); // new optim version } if (!same) Kv.BF(Dop,Pt,fv); int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); //cout << *(copt[il]) << " == " << cc << endl; if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization Element_Op plein 3d (a) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } int fi=Kv.dfcbegin(icomp); int li=Kv.dfcend(icomp); int fj=Ku.dfcbegin(jcomp); int lj=Ku.dfcend(jcomp); ccc *= coef; // attention la fonction test donne la ligne // et la fonction test est en second for ( i=fi; i999) cout << " Ass mat pleine /"<< np << endl; assert( np==3 || np==4); // XXXXXXX double epsmes3=T.mesure()*T.mesure()*1e-18; R3 PP[4]; double l[3]; for(int i=0; i< np; ++i) PP[i]= T(B[i]); for( int i =0; i+1 < np; i+=2) { // 0,1,, a and 2,3,0. int i0=i,i1=i+1,i2=(i+2)%np; R3 NN= R3(PP[i0],PP[i1])^R3(PP[i0],PP[i2]); double mes2 = (NN,NN); double mes = sqrt(mes2); if(mes2*mes 999) cout << " --int on leveset3d " << np << " " << mes << " " << i0< pi( FIb[npi]); // cout << " %% " << npi << " " << pi.a << " " << pi.x << " " << pi.y << endl; asum+= pi.a; pi.toBary(l); R3 Pt( l[0]*B[i0]+l[1]*B[i1]+l[2]*B[i2]); // double coef = mes*pi.a; // correction 0.5 050109 FH Ku.BF(Dop,Pt,fu); if (!same) Kv.BF(Dop,Pt,fv); MeshPointStack(stack)->set(T(Pt),Pt,Ku,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version pa=a; for (int i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization Element_Op plein 3d (b) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } if(verbosity>999) cout << " -- int on leveset3d aij = "<< pi.a* ccc * w_i*w_j <<" " << ccc << " " << w_i*w_j <999) cout << " ++\n"; } if(verbosity>999) cout << " @@ "<< asum << endl;; } }// end int level set ... else // int on edge ie for (npi=0;npi pi( FIb[npi]); R3 NN= T.N(ie); double mes=NN.norme(); NN/=mes; double coef = 0.5*mes*pi.a; // correction 0.5 050109 FH R3 Pt(T.PBord(ie,pi)); Ku.BF(Dop,Pt,fu); if (!same) Kv.BF(Dop,Pt,fv); MeshPointStack(stack)->set(T(Pt),Pt,Ku,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization Element_Op plein 3d (c) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } *pa += coef * ccc * w_i*w_j; } } } } if (Ku.Vh.Th(T) <1 && verbosity>100) { pa=mat.a; cout < void Element_Op(MatriceElementairePleine & mat,const FElement & Ku,const FElement & Kv,double * p,int ie,int label,void *vstack,R2 *B) { Stack stack=pvoid2Stack(vstack); typedef FElement::Element Element; MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool same = &Ku == & Kv; const Element & T = Ku.T; throwassert(&T == &Kv.T); const QuadratureFormular & FI = mat.FIT; const QuadratureFormular1d & FIb = mat.FIE; long npi; R *a=mat.a; R *pa=a; long i,j; long n= mat.n,m=mat.m,nx=n*m; long N= Kv.N; long M= Ku.N; const Opera &Op(*mat.bilinearform); bool classoptm = copt && Op.optiexpK; bool oldopt=1; // juin 2007 FH ???? a voir int iloop=0; KN unvarexp(classoptm ? Op.optiexpK->sizevar() : 1); if (Ku.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_Op P: copt = " << copt << " " << classoptm << " opt: " << mat.optim << endl; assert(Op.MaxOp() Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(lastop<=3); RNMK_ fv(p,n,N,lastop); // the value for basic fonction RNMK_ fu(p+ (same ?0:n*N*lastop) ,m,M,lastop); // the value for basic fonction for (i=0;i< nx;i++) *pa++ = 0.; if (ie<0 )//&& B==0) for (npi=0;npix : T.area; R coef = mes *pi.a; R2 Pt(pi); pa =a; Ku.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(Pt),Pt,Kv); if (classoptm) { if( oldopt) (*Op.optiexpK)(stack); // call old optim version else Op.optiexpK->eval(stack,iloop++,unvarexp); // new optim version } if (!same) Kv.BF(Dop,Pt,fv); int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); //cout << *(copt[il]) << " == " << cc << endl; if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization (e) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } int fi=Kv.dfcbegin(icomp); int li=Kv.dfcend(icomp); int fj=Ku.dfcbegin(jcomp); int lj=Ku.dfcend(jcomp); ccc *= coef; // attention la fonction test donne la ligne // et la fonction test est en second for ( i=fi; i 1e-15) // bofbof ???? for (npi=0;npiset(T(Pt),Pt,Kv,-1,R2(E.y,-E.x)/le,-1); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); //cout << *(copt[il]) << " == " << cc << endl; if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization (f) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } int fi=Kv.dfcbegin(icomp); int li=Kv.dfcend(icomp); int fj=Ku.dfcbegin(jcomp); int lj=Ku.dfcend(jcomp); ccc *= coef; // attention la fonction test donne la ligne // et la fonction test est en second for ( i=fi; iset(T(Pt),Pt,Kv,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); //cout << *(copt[il]) << " == " << cc << endl; if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization (g) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } int fi=Kv.dfcbegin(icomp); int li=Kv.dfcend(icomp); int fj=Ku.dfcbegin(jcomp); int lj=Ku.dfcend(jcomp); ccc *= coef; // attention la fonction test donne la ligne // et la fonction test est en second for ( i=fi; i jj(ll.first.first),ii(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); if ( copt && ( mat.optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( ccc != cc) { cerr << cc << " != " << ccc << " => "; cerr << "Sorry error in Optimization (h) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } *pa += coef * ccc * w_i*w_j; } } } // else pa += m; FH dec 2003 */ } /* pa=a; if (Ku.Vh.Th(T) >=0 ) { cout < void Element_Op(MatriceElementaireSymetrique & mat,const FElement3 & Ku,double * p,int ie,int label, void * vstack,R3 *B) { // ffassert(B==0); Stack stack=pvoid2Stack(vstack); typedef FESpace3 FESpace; typedef typename FESpace3::Mesh Mesh; typedef Mesh *pmesh ; typedef typename Mesh::Element Element; MeshPoint mp= *MeshPointStack(stack); R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Element & T = Ku.T; const GQuadratureFormular & FI = mat.FIT; const GQuadratureFormular & FIb = mat.FIE; long npi; R *a=mat.a; R *pa=a; long i,j; long n= mat.n,m=mat.m,nx=n*(m+1)/2; long N= Ku.N; assert(mat.bilinearform); const Opera &Op(*mat.bilinearform); bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) || (Op.where_in_stack_opt.size() !=0) ); int lastop; What_d Dop = Op.DiffOp(lastop); if (Ku.number<1 && verbosity/100 && verbosity % 10 == 2 ) cout << "Element_Op S 3d: copt = " << copt << " " << classoptm << " lastop = "<< lastop << " Dop " << Dop << " opt: " << mat.optim << endl; assert(Op.MaxOp() pi(FI[npi]); double coef = T.mesure()*pi.a; //R3 Pt(pi); pa =a; Ku.BF(Dop,pi,fu); MeshPointStack(stack)->set(T(pi),pi,Ku); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (i) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); for ( i=fi; i999) cout << " Ass mat pleine /"<< np << endl; assert( np==3 || np==4); // XXXXXXX double epsmes3=T.mesure()*T.mesure()*1e-18; R3 PP[4]; double l[3]; for(int i=0; i< np; ++i) PP[i]= T(B[i]); for( int i =0; i+1 < np; i+=2) { // 0,1,, a and 2,3,0. int i0=i,i1=i+1,i2=(i+2)%np; R3 NN= R3(PP[i0],PP[i1])^R3(PP[i0],PP[i2]); double mes2 = (NN,NN); double mes = sqrt(mes2); if(mes2*mes 999) cout << " --int on leveset3d " << np << " " << mes << " " << i0< pi( FIb[npi]); // cout << " %% " << npi << " " << pi.a << " " << pi.x << " " << pi.y << endl; asum+= pi.a; pi.toBary(l); R3 Pt( l[0]*B[i0]+l[1]*B[i1]+l[2]*B[i2]); // double coef = mes*pi.a; // correction 0.5 050109 FH Ku.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(Pt),Pt,Ku,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version pa=a; int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (j) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); for (long i=fi; i pi( FIb[npi]); R3 NN= T.N(ie); double mes=NN.norme(); NN/=mes; mes *=0.5; double coef = mes*pi.a; // correction 0.5 050109 FH R3 Pt(T.PBord(ie,pi)); Ku.BF(Dop,Pt,fu); // int label=-999999; // a passer en argument MeshPointStack(stack)->set(T(Pt),Pt,Ku,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (k) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); for (long i=fi; i100) { cout < Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); // assert(lastop<=3); RNMK_ fu(p,n,N,lastop); // the value for basic fonction pa =a; for (i=0;i< nx;i++) *pa++ = 0.; if (ie<0) for (npi=0;npix :T.area; double coef = mes*pi.a; R2 Pt(pi); pa =a; Ku.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(pi),pi,Ku); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (l) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); if (verbosity>10 && Ku.Vh.Th(T) < 1 && npi < 1) cout << " ic "<< icomp << fi<< " "<< lj << " "<< " c "<< jcomp << " " < "; cerr << "Sorry error in Optimization (m) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } *pa += coef * c * w_i*w_j; } } }*/ } else if(B) { R2 PA(B[0]),PB(B[0]); R2 A=T(PA),B=T(PB); R2 E(A,B); double le = sqrt((E,E)); if(le > 1e-15) for (npi=0;npiset(T(Pt),Pt,Ku,0,R2(E.y,-E.x)/le,0); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (n) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); for ( i=fi; iset(T(Pt),Pt,Ku,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version int il=0; for (BilinearOperator::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++) { // attention la fonction test donne la ligne // et la fonction test est en second BilinearOperator::K ll(*l); // pair jj(ll.first.first),ii(ll.first.second); long jcomp= ll.first.first.first,jop=ll.first.first.second; long icomp= ll.first.second.first,iop=ll.first.second.second; R c = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); // cout << *(copt[il]) << " == " << cc << endl; if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (o) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } c *= coef ; long fi=Ku.dfcbegin(icomp); long li=Ku.dfcend(icomp); long fj=Ku.dfcbegin(jcomp); long lj=Ku.dfcend(jcomp); for ( i=fi; i ii(ll.first.first),jj(ll.first.second); double w_i = wi(ii.first,ii.second); double w_j = wj(jj.first,jj.second); // R ccc = GetAny(ll.second.eval(stack)); R ccc = copt ? *(copt[il]): GetAny(ll.second.eval(stack)); if ( copt && Ku.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( ccc != cc) { cerr << ccc << " != " << cc << ", xy = "<< T(Pt) << " => "; cerr << "Sorry error in Optimization (d) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } *pa += coef * ccc * w_i*w_j; } } } //else pa+= i+1; */ } /* pa=a; if (Ku.Vh.Th(T) <=0 ) { cout < Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(T(Pt),Pt,Kv); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); //copt=0; R c = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); //GetAny(ll.second.eval(stack)); if ( copt && ( optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization add: (p) int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //if (Kv.number<5) cout << il<< " " << i << " c== " << c << endl; R a = coef * c * w_i; B[Kv(i)] += a; } } } *MeshPointStack(stack) = mp; } // 3D template void Element_rhs(const FElement3 & Kv,const LOperaD &Op,double * p,void * vstack,KN_ & B, const GQuadratureFormular & FI = QuadratureFormular_Tet_2,int optim=1) { Stack stack=pvoid2Stack(vstack); typedef FElement3::Element Element; MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Element & T = Kv.T; // const QuadratureFormular & FI = QuadratureFormular_T_2; // const QuadratureFormular & FI = QuadratureFormular_T_2; long npi; long i,n=Kv.NbDoF(),N=Kv.N; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S0: copt = " << copt << " " << classoptm << " opt: " << optim << endl; int lastop; What_d Dop = Op.DiffOp(lastop); assert(Op.MaxOp() pi(FI[npi]); double coef = T.mesure()*pi.a; R3 Pt(pi); Kv.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(Pt),Pt,Kv); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); //copt=0; R c = copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); //GetAny(ll.second.eval(stack)); if ( copt && ( optim==1) && Kv.number <1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (q) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //if (Kv.number<5) cout << il<< " " << i << " c== " << c << endl; R a = coef * c * w_i; B[Kv(i)] += a; } } } *MeshPointStack(stack) = mp; } // fin 3d // #pragma optimization_level 0 // 3d template void Element_rhs(const Mesh3 & ThI,const Mesh3::Element & KI, const FESpace3 & Vh,const LOperaD &Op,double * p,void * vstack,KN_ & B, const GQuadratureFormular & FI,int optim) { Stack stack=pvoid2Stack(vstack); // AFAIRE("Element_rhs 3d diff meshes"); static int count=0; if(count++<1) { cout << "Warning: Element_rhs 3 3d diff meshes in test (FH) " << endl; cout << "--------------------------------------------------- " << endl; } MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); // int maxd = Op.MaxOp(); // assert(maxd pi(FI[npi]); R3 PI(KI(pi)); double coef = KI.mesure()*pi.a; MeshPointStack(stack)->set(ThI,PI,pi,KI,KI.lab); if (classoptm) (*Op.optiexpK)(stack); // call optim version bool outside; R3 Pt; const Tet & K = *Vh.Th.Find(PI,Pt,outside,Kp); if ( ! outside) { const FElement3 Kv= Vh[K]; long i,n=Kv.NbDoF(),N=Kv.N; RNMK_ fu(p,n,N,lastop); // the value for basic fonction Kv.BF(Dop,Pt,fu); for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c = copt ? *(copt[il]) : GetAny(ll.second.eval(stack));;//GetAny(ll.second.eval(stack)); if ( copt && ThI(KI) <1 && optim==1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (r) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } R a = coef * c * w_i; B[Kv(i)] += a; } } } Kp = & K; } *MeshPointStack(stack) = mp; } // template void Element_rhs(const Mesh & ThI,const Triangle & KI, const FESpace & Vh,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular & FI = QuadratureFormular_T_2,int optim=1) { Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); // int maxd = Op.MaxOp(); // assert(maxd Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(ThI,PI,pi,KI,KI.lab); if (classoptm) (*Op.optiexpK)(stack); // call optim version bool outside; R2 Pt; const Triangle & K = *Vh.Th.Find(PI,Pt,outside,Kp); if ( ! outside) { const FElement Kv= Vh[K]; long i,n=Kv.NbDoF(),N=Kv.N; RNMK_ fu(p,n,N,lastop); // the value for basic fonction Kv.BF(Dop,Pt,fu); for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c = copt ? *(copt[il]) : GetAny(ll.second.eval(stack));;//GetAny(ll.second.eval(stack)); if ( copt && ThI(KI) <1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (s) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } R a = coef * c * w_i; B[Kv(i)] += a; } } } Kp = & K; } *MeshPointStack(stack) = mp; } // template void Element_rhs(Expression const * const mapt,const Mesh & ThI,const Triangle & KI, const FESpace & Vh,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular & FI = QuadratureFormular_T_2,int optim=1) { Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); // int maxd = Op.MaxOp(); // assert(maxd Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(ThI,PI,pi,KI,KI.lab); if(mapt) { // move poit PI= R2( GetAny((*mapt[0])(vstack)), GetAny((*mapt[1])(vstack))); if(verbosity>9999) cout << " Element_rhs mapt =" << PIo << " -> " < ii(ll.first); double w_i = wi(ii.first,ii.second); R c = copt ? *(copt[il]) : GetAny(ll.second.eval(stack));;//GetAny(ll.second.eval(stack)); if ( copt && ThI(KI) <1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " != " << cc << " => "; cerr << "Sorry error in Optimization (s) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } R a = coef * c * w_i; B[Kv(i)] += a; } } } Kp = & K; } *MeshPointStack(stack) = mp; } // 3d template void Element_rhs(const FElement3 & Kv,int ie,int label,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular & FI ,bool alledges=false,int optim=1) { // AFAIRE("Element_rhs on border"); Stack stack=pvoid2Stack(vstack); typedef FElement3::Element Element; MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Element & T = Kv.T; long npi; long i,n=Kv.NbDoF(),N=Kv.N; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs 3d S: copt = " << copt << " " << classoptm <<" opt " << optim << endl; int lastop; What_d Dop = Op.DiffOp(lastop); assert(Op.MaxOp() pi( FI[npi]); R3 NN=T.N(ie); double le= NN.norme(); NN /= le; double coef = le*pi.a*0.5;// correction 050109 FH R3 Pt(T.PBord(ie,pi)); // Kv.BF(Dop,Pt,fu); MeshPointStack(stack)->set(T(Pt),Pt,Kv,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (t) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } *MeshPointStack(stack) = mp; } // 3d isoline ... levelset ... template void Element_rhs(const FElement3 & Kv,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular & FI ,int np, R3 *Q,int optim) { // AFAIRE("Element_rhs on border"); Stack stack=pvoid2Stack(vstack); typedef FElement3::Element Element; MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Element & K = Kv.T; const Mesh3 & Th= Kv.Vh.Th; double epsmes3=K.mesure()*K.mesure()*1e-18; long npi; long n=Kv.NbDoF(),N=Kv.N; double l[3]; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs 3d S(levelset): copt = " << copt << " " << classoptm << " opt " << optim << endl; int lastop; What_d Dop = Op.DiffOp(lastop); assert(Op.MaxOp() pi( FI[npi]); pi.toBary(l); R3 Pt( l[0]*Q[i0]+l[1]*Q[i1]+l[2]*Q[i2]); // MeshPointStack(stack)->set(Th,K(Pt),Pt,K,-1,NN,-1); // Kv.BF(Dop,Pt,fu); // MeshPointStack(stack)->set(K(Pt),Pt,Kv,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version double coef = mes*pi.a; for (int i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (u) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } } *MeshPointStack(stack) = mp; } // end 3d template void Element_rhs(const FElement & Kv,int ie,int label,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular1d & FI = QF_GaussLegendre2,bool alledges=false,int optim=1) { Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Triangle & T = Kv.T; // const QuadratureFormular1d & FI = QF_GaussLegendre2; long npi; long i,n=Kv.NbDoF(),N=Kv.N; // bool show = Kv.Vh.Th(T)==0; // char * xxx[] ={" u"," v,"," p"," q"," r"}; // char * xxxx[] ={" u'"," v',"," p'"," q'"," r'"}; // char * yyy[] ={" ","_x ","_y "}; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S: copt = " << copt << " " << classoptm << "opt " << optim << endl; KN Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(T(Pt),Pt,Kv,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (v) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } *MeshPointStack(stack) = mp; } template void Element_rhs(const FElement & Kv,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular1d & FI ,const R2 & PPA,const R2 &PPB,int optim) { Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); const Triangle & T = Kv.T; R2 PA=T(PPA),PB=T(PPB); // const QuadratureFormular1d & FI = QF_GaussLegendre2; long npi; long i,n=Kv.NbDoF(),N=Kv.N; // bool show = Kv.Vh.Th(T)==0; // char * xxx[] ={" u"," v,"," p"," q"," r"}; // char * xxxx[] ={" u'"," v',"," p'"," q'"," r'"}; // char * yyy[] ={" ","_x ","_y "}; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs(levelset) S: copt = " << copt << " " << classoptm <<" opt " << optim << endl; KN Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(T(Pt),Pt,Kv,0,R2(E.y,-E.x)/le,0); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (w) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } *MeshPointStack(stack) = mp; } template 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_ & B, const QuadratureFormular1d & FI = QF_GaussLegendre2,int optim=1) // 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 { pair_stack_double * bs=static_cast(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(stack,ElemMatPtrOffset); const Triangle & T = Kv.T; // const QuadratureFormular1d & FI = QF_GaussLegendre2; long npi; long i,nv=Kv.NbDoF(),N=Kv.N; long nnv=KKv.NbDoF(); assert(nv==nnv); // bool show = Kv.Vh.Th(T)==0; // char * xxx[] ={" u"," v,"," p"," q"," r"}; // char * xxxx[] ={" u'"," v',"," p'"," q'"," r'"}; // char * yyy[] ={" ","_x ","_y "}; bool classoptm = copt && Op.optiexpK; // assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (Kv.number<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S: copt = " << copt << " " << classoptm << " opt " << optim << endl; KN Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); //assert(Op.MaxOp() pp(ip,lp),pk(ip+lp,lp),pkk(ip+2*lp,lp); 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 R2 E=T.Edge(ie); double le = sqrt((E,E)); R2 PA(TriangleHat[VerticesOfTriangularEdge[ie][0]]), PB(TriangleHat[VerticesOfTriangularEdge[ie][1]]), PC(TriangleHat[OppositeVertex[ie]]); // warning the to edge are in opposite sens R2 PP_A(TriangleHat[VerticesOfTriangularEdge[iie][1]]), PP_B(TriangleHat[VerticesOfTriangularEdge[iie][0]]), PP_C(TriangleHat[OppositeVertex[ie]]); R2 Normal(E.perp()/-le); double cmean = onborder ? 1. : 0.5; for (npi=0;npiset(T(Pt),Pt,Kv,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version for ( i=0; i=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++) { LOperaD::K ll(*l); pair ii(ll.first); int iis = ii.second; int iicase = iis / last_operatortype; iis %= last_operatortype; double w_i=0,ww_i=0; if(ik>=0) w_i = wi(ii.first,iis ); if( iicase>0 ) { if( ikk>=0) ww_i = wwi(ii.first,iis ); 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(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (x) add: int2d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); if(dofik>=0) B[dofik] += coef * c * w_i; if(dofikk>=0) B[dofikk] += coef * c * ww_i; } } } *MeshPointStack(stack) = mp; } // 3d template void Element_rhs(const Mesh3 & ThI,const Mesh3::Element & KI, const FESpace3 & Vh, int ie,int label,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular & FI,bool alledges=false,int optim=1) { Stack stack=pvoid2Stack(vstack); int intmortar=0; // AFAIRE("Element_rhs 3d on surface 2 diff mesh "); static int count =0; if(count++<1) { cout << " Element_rhs 3d on surface 2 diff mesh int test (FH)" << endl; cout << " -----------------------------------------------------" << endl; } // integration 1d on 2 diff mesh MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool classoptm = copt && Op.optiexpK; //assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (ThI(KI)<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S: copt = " << copt << " " << classoptm << " opt "<< optim < pi(FI[npi]); R3 NN= T.N(ie); double mes=NN.norme(); NN/=mes; double coef = 0.5*mes*pi.a; // R3 Pt(T.PBord(ie,pi)),PI(T(Pt)); MeshPointStack(stack)->set(ThI,PI,Pt,KI,label,NN,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version bool outside; R3 PIt; const Tet & K = *Vh.Th.Find(PI,PIt,outside,Kp); if ( ! outside || intmortar) // FH march 2009 ??? { const FElement3 Kv= Vh[K]; long i,n=Kv.NbDoF(),N=Kv.N; RNMK_ fu(p,n,N,lastop); // the value for basic fonction Kv.BF(Dop,PIt,fu); for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (y) add: int1d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } } *MeshPointStack(stack) = mp; } // 3d template void Element_rhs(const Mesh & ThI,const Triangle & KI, const FESpace & Vh, int ie,int label,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular1d & FI = QF_GaussLegendre2,bool alledges=false,bool intmortar=false, R2 *Q=0,int optim=1) { // integration 1d on 2 diff mesh Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool classoptm = copt && Op.optiexpK; //assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (ThI.number(KI)<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S: copt = " << copt << " " << classoptm << " opt " << optim << endl; KN Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(ThI,PI,Pt,KI,label,R2(E.y,-E.x)/le,ie); if (classoptm) (*Op.optiexpK)(stack); // call optim version bool outside; R2 PIt; const Triangle & K = *Vh.Th.Find(PI,PIt,outside,Kp); if ( ! outside || intmortar) // FH march 2009 ??? { const FElement Kv= Vh[K]; long i,n=Kv.NbDoF(),N=Kv.N; RNMK_ fu(p,n,N,lastop); // the value for basic fonction Kv.BF(Dop,PIt,fu); for ( i=0; i ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (z) add: int1d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } } *MeshPointStack(stack) = mp; } template void Element_rhs(Expression const * const mapt,const Mesh & ThI,const Triangle & KI, const FESpace & Vh, int ie,int label,const LOperaD &Op,double * p,void * vstack,KN_ & B, const QuadratureFormular1d & FI = QF_GaussLegendre2,bool alledges=false,bool intmortar=false, R2 *Q=0,int optim=1) { // integration 1d on 2 diff mesh // ffassert(0); Stack stack=pvoid2Stack(vstack); MeshPoint mp=*MeshPointStack(stack) ; R ** copt = Stack_Ptr(stack,ElemMatPtrOffset); bool classoptm = copt && Op.optiexpK; //assert( (copt !=0) == (Op.where_in_stack_opt.size() !=0) ); if (ThI.number(KI)<1 && verbosity/100 && verbosity % 10 == 2) cout << "Element_rhs S: copt = " << copt << " " << classoptm << " opt " << optim << endl; KN Dop(last_operatortype); Op.DiffOp(Dop); int lastop=1+Dop.last(binder1st >(equal_to(),true)); assert(Op.MaxOp() set(ThI,PI,Pt,KI,label,R2(E.y,-E.x)/le,ie); if(mapt) { // move poit PI= R2( GetAny((*mapt[0])(vstack)), GetAny((*mapt[1])(vstack))); if(verbosity>9999) cout << " Element_rhs(2) mapt =" << PIo << " -> " < ii(ll.first); double w_i = wi(ii.first,ii.second); R c =copt ? *(copt[il]) : GetAny(ll.second.eval(stack)); // FFCS - removing what is probably a small glitch if ( copt && ( optim==1) && Kv.number<1) { R cc = GetAny(ll.second.eval(stack)); if ( c != cc) { cerr << c << " =! " << cc << endl; cerr << "Sorry error in Optimization (z) add: int1d(Th,optimize=0)(...)" << endl; ExecError("In Optimized version "); } } //= GetAny(ll.second.eval(stack)); B[Kv(i)] += coef * c * w_i; } } } } *MeshPointStack(stack) = mp; } template bool AssembleVarForm(Stack stack,const typename FESpace::Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MC * A,KN_ * B,const list &largs) { // return true if BC typedef typename FESpace::Mesh Mesh ; typedef Mesh * pmesh; bool ret=false; typedef DotStar_KN_ DotStar; typedef DotSlash_KN_ DotSlash; list::const_iterator ii,ib=largs.begin(), ie=largs.end(); using namespace FreeFempp; TypeVarForm *tvf=TypeVarForm::Global; assert( tvf); for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); // if(A) cout << "AssembleVarForm " << * r << " " << (*A)(0,3) << endl; if (r== tvf->tFB) { if (A) { const FormBilinear * bf =dynamic_cast(e); pmesh Thbf = GetAny((*bf->di->Th)(stack)); if(Thbf)AssembleBilinearForm( stack,*Thbf,Uh,Vh,sym,*A,bf); } } else if (r==tvf->tMat) { if (A) InternalError(" Add sparse matrice; to do, sorry"); } else if (r==tvf->tFL) { if (B) { const FormLinear * bf =dynamic_cast(e); pmesh Thbf = GetAny((*bf->di->Th)(stack)); if(Thbf) AssembleLinearForm( stack,*Thbf, Vh, B,bf) ; } } else if (r==tvf->tTab) { if ( B) *B += *GetAny *>( (*e)(stack) ); } else if (r==tvf->tDotStar) { if ( B) { DotStar ab=GetAny( (*e)(stack) ); *B += ab; } } else if (r==tvf->tMatX) { if ( B) { *B += GetAny::plusAx >( (*e)(stack) ) ; } } else if (r==tvf->tMatTX) { if ( B) { *B += GetAny::plusAtx >( (*e)(stack) ) ; } } else if (r== tvf->tBC) ret=true; else { cerr << "AssembleVarForm invalid type : " << * r << endl; throw(ErrorExec("AssembleVarForm invalid type in varf",1)); } } return ret; } template void AssembleBC(Stack stack,const typename FESpace::Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ) { list::const_iterator ii,ib=largs.begin(), ie=largs.end(); aType tBC( atype()) ; for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==tBC) AssembleBC(stack,Th,Uh,Vh,sym,A,B,X, dynamic_cast(e),tgv); } } template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc, double tgv ) { MeshPoint *mps= MeshPointStack(stack),mp=*mps; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr int ktbc=0, nbon =0; bool Aii = A && A->n == A->m; int Nbcomp=Vh.N; Check(bc,Nbcomp); ffassert(Vh.N == Uh.N); TabFuncArg tabexp(stack,Vh.N); KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N); int ndofBC = Aii ? A->n : 1; KN onBC(ndofBC); onBC= '\0'; KN gg(buf); if ( B && B->N() != Vh.NbOfDF) ExecError("AssembleBC size rhs and nb of DF of Vh"); if(verbosity>99) cout << " Problem : BC_set "<< typeid(R).name() << " " ; nbon =bc->on.size(); set on; Expandsetoflab(stack,*bc, on); /* for (int i=0;i( (*bc->on[i])(stack)); if(verbosity>99) cout << lab << " " ; on.insert(lab); } if(verbosity>99) cout << endl; */ int kk=bc->bc.size(); const int dim=Vh.N; FElement::aIPJ ipj(Vh[0].Pi_h_ipj()); FElement::aR2 PtHat(Vh[0].Pi_h_R2()); KN PtonB(PtHat.N()); KN Aipj(ipj.N()); KNM Vp(dim,PtHat.N()); double tgv1=tgv <0? 1: tgv; // change 21 dec 2010 FH (Hack of ILU) for (int ib=0;ib99) cout << "BC " << it << " " << ie << " lab=" << r << ":\t" << K.T[VerticesOfTriangularEdge[ie][0]] << "; " << K.T[VerticesOfTriangularEdge[ie][1]] << " E=" << K.T.Edge(ie) << endl; for (int k=0;k xx=bc->bc[k]; tabexp=0; int comp = xx.first; tabexp[comp]=xx.second; // while (comp+1 bc[k].first) ) tabexp[comp]=bc->bc[k].second; else CompileError("In Boundary condition the vector FESpace , we must have:" " all componant, in the right order"); } // cout << " k "<< k << " " << comp << " " << " Nbcomp=" << Nbcomp << " " << Uh.dim_which_sub_fem[comp] << " " << Uh.dim_which_sub_fem[comp+1] << endl; #ifdef OLDPih K.Pi_h(gg,F_Pi_h,buf,&tabexp); #else K.Pi_h(Aipj); PtonB = 0; for (int i=0;icomplextype: " << bc->complextype << endl; for (int p=0;pset(K.T(PtHat[p]),PtHat[p],K,r,R2(E.y,-E.x)/le,ie); // la normal bofbof ? KN_ Vpp(Vp('.',p)); Vpp=R(); for (int j=0;jcomplextype) // FH may 2007 MatriceCreuse Vpp[j]=GetAny( (*tabexp[j])(stack) ); else Vpp[j]=GetAny( (*tabexp[j])(stack) ); } else Vpp[j]=0.; } //cout << " ..... Vp " << Vp << " " << bc->complextype << " " << bc << endl; for (int i=0;iSetBC(ddf, tgv);// change 21 dec 2010 FH (Hack of ILU) if (B) (*B)[ddf]= tgv1*gg[df]; if (X) (*X)[ddf]=gg[df]; } } if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } if( Aii) A->SetBC(onBC,tgv); if (! ktbc && nbon && verbosity ) { cout << " Warning: -- Your set of boundary condition is incompatible with the mesh label." << endl; } *mps =mp; } template void AssembleBC(Stack stack,const Mesh3 & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc, double tgv ) { typedef Mesh3 Mesh; typedef typename FESpace3::FElement FElement; typedef typename Mesh::BorderElement BorderElement; typedef typename Mesh::Rd Rd; typedef typename Mesh::Element Element; typedef typename Mesh::RdHat RdHat; MeshPoint *mps= MeshPointStack(stack),mp=*mps; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr int ktbc=0, nbon =0; bool Aii = A && A->n == A->m; int ndofBC = Aii ? A->n : 1; KN onBC(ndofBC); onBC= '\0'; int Nbcomp=Vh.N; Check(bc,Nbcomp); assert(Vh.N == Uh.N); TabFuncArg tabexp(stack,Vh.N); KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N); KN gg(buf); if ( B && B->N() != Vh.NbOfDF) ExecError("AssembleBC size rhs and nb of DF of Vh"); if(verbosity>99) cout << " Problem : BC_set "<< typeid(R).name() << " " ; nbon =bc->on.size(); set on; Expandsetoflab(stack,*bc, on); /* for (int i=0;i( (*bc->on[i])(stack)); if(verbosity>99) cout << lab << " " ; on.insert(lab); } if(verbosity>99) cout << endl;*/ int kk=bc->bc.size(); const int dim=Vh.N; InterpolationMatrix ipmat(Vh); int npPh = Vh.maxNbPtforInterpolation; KN PtonB(npPh); KNM Vp(npPh,dim); Vp=R(); KN Vdf(Vh.MaxNbDFPerElement); double tgv1=tgv <0? 1: tgv; map lll; for (int ib=0;ib99) cout << "BC " << it << " " << ie << " lab=" << r << ":\t" << K.T[VerticesOfTriangularEdge[ie][0]] << "; " << K.T[VerticesOfTriangularEdge[ie][1]] << " E=" << K.T.Edge(ie) << endl; */ for (int k=0;k xx=bc->bc[k]; tabexp=0; int comp = xx.first; tabexp[comp]=xx.second; // while (comp+1 bc[k].first) ) tabexp[comp]=bc->bc[k].second; else CompileError("In Boundary condition the vector FESpace , we must have:" " all componant, in the right order"); } int nbdf=K.NbDoF() ; //ipmat.set(it); PtonB = 0; Rd NN=K.T.N(ie); NN /= NN.norme(); for (int i=0;iset(K.T(PtHat),PtHat,K,r,NN,ie); // la normal bofbof ? KN_ Vpp(Vp(p,'.')); for (int j=0;jcomplextype) // FH may 2007 Vpp[j]=GetAny( (*tabexp[j])(stack) ); else Vpp[j]=GetAny( (*tabexp[j])(stack) ); else Vpp[j]=0.; } // cout << " Vp: " << Vp << endl; K.Pi_h(Vp,Vdf,ipmat); for (int df=0;df::const_iterator i=lll.begin();i!=lll.end();i++) cout << " lab " << i-> first << " nb " << i->second << endl; } *mps =mp; } void Expandsetoflab(Stack stack,const BC_set & bc,set & setoflab); void Expandsetoflab(Stack stack,const CDomainOfIntegration & di,set & setoflab,bool &all); template void AssembleLinearForm(Stack stack,const Mesh3 & Th,const FESpace3 & Vh,KN_ * B,const FormLinear * l ) { typedef FESpace3 FESpace; typedef FESpace3::Mesh Mesh; typedef Mesh *pmesh ; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr Check(l->l,Vh.N); if ( B && B->N() != Vh.NbOfDF) ExecError("AssembleLinearForm size rhs and nb of DF of Vh"); // if ( & Th != &Vh.Th ) ExecError("AssembleLinearForm on different meshes ( not implemented FH)."); KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N*2); // const FormLinear * l=dynamic_cast(e); const CDomainOfIntegration & di= *l->di; ffassert(di.d==3); // const Mesh * pThdi = GetAny( (* di.Th)(stack)); const Mesh & ThI = Th;//* GetAny( (* di.Th)(stack)); bool sameMesh = &ThI == &Vh.Th; SHOWVERB(cout << " FormLinear " << endl); //const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; //const QuadratureFormular1d & FIE = di.FIE(stack); // const QuadratureFormular & FIT = di.FIT(stack); // const GQuadratureFormular & FIV = di.FIV(stack); // const QuadratureFormular1d & FIEo = di.FIE(stack); const QuadratureFormular & FITo = di.FIT(stack); const GQuadratureFormular & FIVo = di.FIV(stack); // to change the quadrature on element ... may 2014 FH .. // QuadratureFormular1d FIE(FIEo,3); QuadratureFormular FIT(FITo,3); GQuadratureFormular FIV(FIVo,3); const int useopt=di.UseOpt(stack); double binside=di.binside(stack); // truc FH pour fluide de grad2 (decentrage bizard) // cout << "AssembleLinearForm " << l->l->v.size() << endl; set setoflab; bool all=true; bool VF=l->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- AssembleLinearForm 1, discontinous Galerkin =" << VF << " binside = "<< binside <<"\n"; if (verbosity>3) { if (CDomainOfIntegration::int2d==kind) cout << " -- boundary int border ( nQP: "<< FIT.n << ") , samemesh: " << sameMesh << " " ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIT.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIT.n << ")," ; else cout << " -- int 3d (nQP: "<< FIV.n << " ) in " ; } if( di.withmap()) { ExecError(" no map in the case (5)??");} // if(di.islevelset()) InternalError("So no levelset integration type on this case (3)"); if(di.islevelset() && (CDomainOfIntegration::int2d!=kind) && (CDomainOfIntegration::int3d!=kind) ) InternalError("So no levelset intgeration type on no int2d/3d case"); /* if ( verbosity>3) if (kind==CDomainOfIntegration::int1d) cout << " -- boundary int border " ; else if (kind==CDomainOfIntegration::intalledges) cout << " -- boundary int all edges " ; else if (kind==CDomainOfIntegration::intallVFedges) cout << " -- boundary int all edges " ; else cout << " -- boundary int " ; */ Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; } else { KN labs( GetAny >( (*what[i])(stack))); for (long j=0; j3) cout << labs[j] << " "; } all=false; }*/ if (verbosity>3) cout << " Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(l->l->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;il->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); if( (verbosity/100) && verbosity % 10 == 2) { int il=0; for (LinearOperatorD::const_iterator ll=l->l->v.begin();ll!=l->l->v.end();ll++,il++) cout << il << " coef (" << ll->first << ") = " << *(where_in_stack[il]) << " offset=" << l->l->where_in_stack_opt[il] < phi(ThI.nv);phi=uset; double f[4]; for(int t=0; t< ThI.nt;++t) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<4;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10);// ca code ... if(np==3 || np==4) { // if(np==3) Q[3]=Q[0]; // same 0 == 3 bofbof ??? FH // cout << " Q[0]" << Q[0] << endl; if( verbosity> 99) { R3 PP[4]; const Tet &K(ThI[t]); for(int i=0; i< np; ++i) PP[i]= K(Q[i]); for( int i =0; i+1 < np; i+=2) { int i0=i,i1=i+1,i2=(i+2)%np; R3 NN= R3(PP[i0],PP[i1])^R3(PP[i0],PP[i2]); double mes2 = (NN,NN); double mes = sqrt(mes2)/2; ss+= mes; //cout << "mes " << mes << " " << i << " , "; } } if ( sameMesh) Element_rhs(Vh[t],*l->l,buf,stack,*B,FIT,np,Q,useopt); else // else InternalError(" No levelSet on Diff mesh3 : to day int2d of RHS"); // Element_rhs(ThI,ThI[t],Vh,-1,lab,*l->l,buf,stack,*B,FIT,false); } if(sptrclean) sptrclean=sptr->clean(); } } if( verbosity> 99) cout << " surf levelset = " << ss << endl; } else for( int e=0;e(Vh[i],ie,Th.be(e).lab,*l->l,buf,stack,*B,FIT,false,useopt); else Element_rhs(ThI,ThI[i],Vh,ie,Th.be(e).lab,*l->l,buf,stack,*B,FIT,false,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } else if (kind==CDomainOfIntegration::intalledges) { AFAIRE("3D Elment RHS CDomainOfIntegration::intalledges"); /* if(VF) { pair_stack_double bstack; bstack.first = stack; bstack.second= & binside; //InternalError(" Today no jump or average in intalledges of RHS "); for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { for (int ie=0;ie<3;ie++) if ( sameMesh) { int iie=ie,ii=Th.ElementAdj(i,iie); if(ii<0) ii=i;// sur le bord Element_rhsVF(Vh[i],Vh[ii],ie,iie,Th[i].lab,*l->l,buf,ip,&bstack,*B,FIE); } else InternalError("To Do") ; if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { for (int ie=0;ie<3;ie++) if ( sameMesh) Element_rhs(Vh[i],ie,Th[i].lab,*l->l,buf,stack,*B,FIE,true); else InternalError("To Do") ; if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr }*/ } else if (kind==CDomainOfIntegration::intallVFedges) { cerr << " intallVFedges a faire" << endl; InternalError(" intallVFedges a faire "); ffassert(0);/* for (int i=0;i< ThI.nt; i++) { if (all || setoflab.find(ThI[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) if ( sameMesh) Element_rhs(Vh[i],ie,Th[i].lab,*l->l,buf,stack,*B,FIE,true); else InternalError("To Do") ; if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr }*/ } else if(kind==CDomainOfIntegration::int3d) { if(di.islevelset()) // may 2014 FH ... { // int3d levelset < 0 double llevelset = 0; const double uset = std::numeric_limits::max(); // cout << " uset ="< phi(Th.nv); phi=uset; double f[4]; for (int t=0;t< Th.nt; t++) { const Mesh3::Element & K(ThI[t]); if (all || setoflab.find(ThI[t].lab) != setoflab.end()) { double umx=std::numeric_limits::min(),umn=std::numeric_limits::max(); for(int i=0;i<4;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; } int ntets= UnderIso(f,Q, vol6,1e-14); setQF(FIV,FIVo,QuadratureFormular_Tet_1, Q,vol6,ntets); if(FIV.n) { if ( sameMesh ) Element_rhs(Vh[t],*l->l,buf,stack,*B,FIV,useopt); else Element_rhs(ThI,ThI[t],Vh,*l->l,buf,stack,*B,FIV,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } FIV=FIVo; } else { for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { if ( sameMesh ) Element_rhs(Vh[i],*l->l,buf,stack,*B,FIV,useopt); else Element_rhs(ThI,ThI[i],Vh,*l->l,buf,stack,*B,FIV,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr }} } else if(kind==CDomainOfIntegration::intallfaces ) { if(VF) InternalError(" no jump or average in intallfaces of RHS"); for(int i=0;i(Vh[i],ie,lab,*l->l,buf,stack,*B,FIT,false,useopt); else Element_rhs(ThI,ThI[i],Vh,ie,lab,*l->l,buf,stack,*B,FIT,false,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else { cout << " Strange (unknows) kind = " << kind << endl; ffassert(0); } if (n_where_in_stack_opt) delete [] where_in_stack; } template void AssembleLinearForm(Stack stack,const Mesh & Th,const FESpace & Vh,KN_ * B,const FormLinear * l ) { StackOfPtr2Free * sptr = WhereStackOfPtr2Free(stack); bool sptrclean=true; // sptr->clean(); // modif FH mars 2006 clean Ptr Check(l->l,Vh.N); if ( B && B->N() != Vh.NbOfDF) ExecError("AssembleLinearForm size rhs and nb of DF of Vh"); // if ( & Th != &Vh.Th ) ExecError("AssembleLinearForm on different meshes ( not implemented FH)."); KN buf(Vh.MaximalNbOfDF()*last_operatortype*Vh.N*2); // const FormLinear * l=dynamic_cast(e); const CDomainOfIntegration & di= *l->di; const Mesh & ThI = Th;//* GetAny( (* di.Th)(stack)); bool sameMesh = &ThI == &Vh.Th; const bool intmortar=di.intmortar(stack); SHOWVERB(cout << " FormLinear " << endl); // const vector & what(di.what); CDomainOfIntegration::typeofkind kind = di.kind; const QuadratureFormular1d & FIE = di.FIE(stack); const QuadratureFormular & FIT = di.FIT(stack); const int useopt=di.UseOpt(stack); double binside=di.binside(stack); // truc FH pour fluide de grad2 (decentrage bizard) // cout << "AssembleLinearForm " << l->l->v.size() << endl; set setoflab; bool all=true; bool VF=l->VF(); // finite Volume or discontinous Galerkin if (verbosity>2) cout << " -- AssembleLinearForm 2, discontinous Galerkin =" << VF << " binside = "<< binside << " levelset integration " <3) { if (CDomainOfIntegration::int1d==kind) cout << " -- boundary int border ( nQP: "<< FIE.n << ") "; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIE.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIE.n << ")," ; else cout << " -- int 2d (nQP: "<< FIT.n << " ) in " ; cout << ", samemesh :"<< sameMesh<< " int mortar: " << intmortar ; } /* if ( verbosity>3) if (kind==CDomainOfIntegration::int1d) cout << " -- boundary int border " ; else if (kind==CDomainOfIntegration::intalledges) cout << " -- boundary int all edges " ; else if (kind==CDomainOfIntegration::intallVFedges) cout << " -- boundary int all edges " ; else cout << " -- boundary int " ; */ if(di.islevelset() && ( (CDomainOfIntegration::int1d!=kind) && (CDomainOfIntegration::int2d!=kind) ) ) InternalError("So no levelset integration type on no int1d/int2d case (4)"); Expandsetoflab(stack,di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; } */ if (verbosity>3) cout << " Optimized = "<< useopt << ", "; 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; if (n_where_in_stack_opt && useopt) where_in_stack = new R * [n_where_in_stack_opt]; if (where_in_stack) { assert(l->l->v.size()==(size_t) n_where_in_stack_opt); for (int i=0;il->where_in_stack_opt[i]; assert(offset>10); where_in_stack[i]= static_cast(static_cast((char*)stack+offset)); *(where_in_stack[i])=0; } if(poptiexp0) (*poptiexp0)(stack); if( (verbosity/100) && verbosity % 10 == 2) { int il=0; for (LinearOperatorD::const_iterator ll=l->l->v.begin();ll!=l->l->v.end();ll++,il++) cout << il << " coef (" << ll->first << ") = " << *(where_in_stack[il]) << " offset=" << l->l->where_in_stack_opt[il] < phi(ThI.nv);phi=uset; double f[3]; for(int t=0; t< ThI.nt;++t) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10); if(np==2) { if ( sameMesh ) {/* void Element_rhs(const FElement & Kv,const LOperaD &Op,double * p,void * stack,KN_ & B, const QuadratureFormular1d & FI ,const R2 & PA,const R2 &PB) */ Element_rhs(Vh[t],*l->l,buf,stack,*B,FIE,Q[0],Q[1],useopt); } else if(!mapt) Element_rhs(ThI,ThI[t],Vh,0,ThI[t].lab,*l->l,buf,stack,*B,FIE,false,intmortar,Q,useopt); else Element_rhs(mapt,ThI,ThI[t],Vh,0,ThI[t].lab,*l->l,buf,stack,*B,FIE,false,intmortar,Q,useopt); //InternalError(" No levelSet on Diff mesh : to day int1d of RHS"); } if(sptrclean) sptrclean=sptr->clean(); } } } else for( int e=0;e(Vh[i],ie,Th.bedges[e].lab,*l->l,buf,stack,*B,FIE,false,useopt); else if(!mapt) Element_rhs(ThI,ThI[i],Vh,ie,Th.bedges[e].lab,*l->l,buf,stack,*B,FIE,false,intmortar,0,useopt); else Element_rhs(mapt,ThI,ThI[i],Vh,ie,Th.bedges[e].lab,*l->l,buf,stack,*B,FIE,false,intmortar,0,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } } else if (kind==CDomainOfIntegration::intalledges) { ffassert(mapt==0); if(VF) { pair_stack_double bstack(stack,& binside); //bstack.first = stack; //bstack.second= & binside; //InternalError(" Today no jump or average in intalledges of RHS "); for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { for (int ie=0;ie<3;ie++) if ( sameMesh) { int iie=ie,ii=Th.ElementAdj(i,iie); if(ii<0) ii=i;// sur le bord const Triangle & K(ThI[i]); int e0=VerticesOfTriangularEdge[ie][0]; int e1=VerticesOfTriangularEdge[ie][1]; int i1 = ThI(K[e0]),i2 = ThI(K[e1]); BoundaryEdge * be = ThI.TheBoundaryEdge(i1,i2); int lab = be ? be->lab : notalabel; Element_rhsVF(Vh[i],Vh[ii],ie,iie,lab,*l->l,buf,ip,&bstack,*B,FIE,useopt); } else InternalError("To Do") ; if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { for (int ie=0;ie<3;ie++) if ( sameMesh) Element_rhs(Vh[i],ie,Th[i].lab,*l->l,buf,stack,*B,FIE,true,useopt); else InternalError("To Do") ; if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (kind==CDomainOfIntegration::intallVFedges) { cerr << " intallVFedges a faire" << endl; InternalError(" intallVFedges a faire "); ffassert(0); for (int i=0;i< ThI.nt; i++) { if (all || setoflab.find(ThI[i].lab) != setoflab.end()) for (int ie=0;ie<3;ie++) { if ( sameMesh) Element_rhs(Vh[i],ie,Th[i].lab,*l->l,buf,stack,*B,FIE,true,useopt); else InternalError("To Do") ; } if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } else if (kind==CDomainOfIntegration::int2d){ if(di.islevelset()) { QuadratureFormular FITM(FIT); double uset = HUGE_VAL; R2 Q[4]; KN phi(Th.nv);phi=uset; double f[3]; for(int t=0; t< Th.nt;++t) { if ( all || setoflab.find(ThI[t].lab) != setoflab.end()) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= ThI(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&ThI,t,i); phi[j]= di.levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umx <=0 ) Element_rhs(Vh[t],*l->l,buf,stack,*B,FIT,useopt); else if( umn <0 ) { // coupe .. int i0 = 0, i1 = 1, i2 =2; if( f[i0] > f[i1] ) swap(i0,i1) ; if( f[i0] > f[i2] ) swap(i0,i2) ; if( f[i1] > f[i2] ) swap(i1,i2) ; double c = (f[i2]-f[i1])/(f[i2]-f[i0]); // coef Up Traing if( f[i1] < 0 ) {double y=f[i2]/(f[i2]-f[i1]); c *=y*y; } else {double y=f[i0]/(f[i0]-f[i1]) ; c = 1.- (1.-c)*y*y; }; assert( c > 0 && c < 1); double arean = (1-c)*Th[t].area; FITM=FIT; FITM*=1-c; ffassert(mapt==0); Element_rhs(Vh[t],*l->l,buf,stack,*B,FITM,useopt); } if(sptrclean) sptrclean=sptr->clean(); } } } else for (int i=0;i< ThI.nt; i++) if (all || setoflab.find(ThI[i].lab) != setoflab.end()) { if ( sameMesh ) Element_rhs(Vh[i],*l->l,buf,stack,*B,FIT,useopt); else if(!mapt) Element_rhs(ThI,ThI[i],Vh,*l->l,buf,stack,*B,FIT,useopt); else Element_rhs(mapt,ThI,ThI[i],Vh,*l->l,buf,stack,*B,FIT,useopt); if(sptrclean) sptrclean=sptr->clean(); // modif FH mars 2006 clean Ptr } } if (n_where_in_stack_opt) delete [] where_in_stack; } }// END of NameSpace Fem2D bool isVF(const list & largs) // true => VF type of Matrix { list::const_iterator ii,ib=largs.begin(), ie=largs.end(); bool VVF =false; for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==atype()) { const FormBilinear * bb=dynamic_cast(e); bool vvf = bb->VF(); if( vvf && (bb->di->kind != CDomainOfIntegration::intalledges && bb->di->kind != CDomainOfIntegration::intallVFedges ) && (bb->di->kind != CDomainOfIntegration::intallfaces )) CompileError("Sorry, no jump or moy in bilinear form no of type intalledges or intallVFedges "); VVF = vvf || VVF; } } return VVF; } bool isSameMesh(const list & largs,const void * Thu,const void * Thv,Stack stack) // true => VF type of Matrix { if( Thv != Thu ) return false; list::const_iterator ii,ib=largs.begin(), ie=largs.end(); // bool VVF =false; for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==atype()) { const FormBilinear * bb=dynamic_cast(e); const void * Thbf = GetAny((*bb->di->Th)(stack)); if (Thbf != Thu) return false; } else if (r==atype()) { const FormLinear * bb=dynamic_cast(e); const void * Thbf = GetAny((*bb->di->Th)(stack)); if (Thbf != Thu) return false; } } return true; } template void InitProblem( int Nb, const FESpace & Uh, const FESpace & Vh, KN *&B,KN *&X,vector< pair< FEbase * ,int> > &u_hh, TypeSolveMat *typemat , vector< FEbase * > & u_h,const FESpace ** LL, bool initx ) { typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; *B=R(); // bool initx = typemat->t==TypeSolveMat::GC; const Mesh & Th(Uh.Th); if (initx) { if (!X || (X =B) ) X=new KN(B->N()); const FEbase & u_h0 = *(u_h[0]); const FESpace * u_Vh = u_h0.Vh ; if ( u_Vh==0 || &((u_h[0])->Vh->Th) != &Th ) { *X=R(); if(verbosity>1) cout << " -- Change of Mesh " << (u_Vh ? & (*(u_h[0])).Vh->Th: 0 ) << " " << &Th << endl; } else { // copy the previous soluton to initialize CG, GMRES, etc ... if (Nb==1) { // modif FH 0701/2005 + april 2006 if(u_h[0]->x()->N() != X->N() ) cout << " bug ???? " << endl; if (u_h[0]->x() && u_h[0]->x()->N() == X->N() ) *X= * u_h[0]->x(); else *X=R(); } else { // dispatch the solution const FElement ** sK= new const FElement * [Nb]; KN ** sol= new KN * [Nb]; for (int i=0;i void DefSolver(Stack stack, MatriceCreuse & A, Data_Sparse_Solver & ds ) { const OneOperator* pprecon= static_cast(ds.precon); if (ds.typemat->profile) { if(verbosity>5) cout << " Matrix skyline type:" << ds.typemat->t < & AA(dynamic_cast &>(A)); throwassert(&AA); double tol_pivot1= (ds.tol_pivot>0.) ? ds.tol_pivot : EPSILON/8.; // cout << " tol_pivot1 " <t) { case TypeSolveMat::LU : AA.LU(tol_pivot1); break; case TypeSolveMat::CROUT : AA.crout(tol_pivot1); break; case TypeSolveMat::CHOLESKY : AA.cholesky(tol_pivot1); break; default: cerr << " type resolution " << ds.typemat->t << endl; CompileError("type resolution profile inconnue"); break; } } else { if(verbosity>5) cout << " Matrix morse type:" << ds.typemat->t < & AA(dynamic_cast &>(A)); throwassert(&A); switch (ds.typemat->t) { case TypeSolveMat::GC: if (ds.precon) AA.SetSolverMaster(new SolveGCPrecon(AA,pprecon,stack,ds.itmax,ds.epsilon)); else AA.SetSolverMaster(new SolveGCDiag(AA,ds.itmax,ds.epsilon)); break; case TypeSolveMat::GMRES : if (ds.precon) AA.SetSolverMaster(new SolveGMRESPrecon(AA,pprecon,stack,ds.NbSpace,ds.itmax,ds.epsilon)); else AA.SetSolverMaster(new SolveGMRESDiag(AA,ds.NbSpace,ds.itmax,ds.epsilon)); break; //#ifdef HAVE_LIBUMFPACK case TypeSolveMat::SparseSolver : AA.SetSolverMaster(DefSparseSolver::Build(stack,&AA,ds)); // AA.SetSolverMaster(new SolveUMFPack(AA,umfpackstrategy,tgv,eps,tol_pivot,tol_pivot_sym)); break; case TypeSolveMat::SparseSolverSym : AA.SetSolverMaster(DefSparseSolverSym::Build(stack,&AA,ds)); // AA.SetSolverMaster(new SolveUMFPack(AA,umfpackstrategy,tgv,eps,tol_pivot,tol_pivot_sym)); break; //#endif default: cerr << " type resolution " << ds.typemat->t << endl; CompileError("type resolution inconnue"); break; } } } bool SetGMRES() { if(verbosity>1) cout << " SetDefault sparse (morse) solver to GMRES" << endl; DefSparseSolver::solver =BuildSolverGMRES; DefSparseSolver::solver =BuildSolverGMRES; return true; } bool SetCG() { if(verbosity>1) cout << " SetDefault sparse (morse) solver to CG" << endl; DefSparseSolver::solver =BuildSolverCG; DefSparseSolver::solver =BuildSolverCG; return true; } #ifdef XXXXXXXXXXX #ifdef HAVE_LIBUMFPACK bool SetUMFPACK() { if(verbosity>1) cout << " SetDefault sparse solver to UMFPack" << endl; DefSparseSolver::solver =BuildSolverUMFPack; DefSparseSolver::solver =BuildSolverUMFPack; return true; } template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverUMFPack; template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverUMFPack; #else template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverGMRES; template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverGMRES; bool SetUMFPACK() { if(verbosity>1) cout << " Sorry no UMFPack" << endl; return false; } #endif #endif template <> DefSparseSolverSym::SparseMatSolver DefSparseSolverSym::solver =BuildSolverGMRES; template <> DefSparseSolverSym::SparseMatSolver DefSparseSolverSym::solver =BuildSolverGMRES; template MatriceCreuse::Scalaire> * DefSolverCadna( Stack stack, MatriceCreuse & A, Data_Sparse_Solver & ds /* long NbSpace , long itmax, double & eps, bool initmat, int strategy, const OneOperator *precon, double tgv, double tol_pivot, double tol_pivot_sym */ ) { typedef typename CadnaType::Scalaire R_st; // MatriceCreuse *CadnaMat; if (ds.typemat->profile) { if(verbosity>5) cout << " Matrix skyline type:" << ds.typemat->t < & AAA(dynamic_cast &>(A)); MatriceProfile &AA(*new MatriceProfile(AAA)); // throwassert(&AA); double tol_pivot1= (ds.tol_pivot>0) ? ds.tol_pivot : EPSILON/8.; // cout << " tol_pivot1 " <t) { case TypeSolveMat::LU : AA.LU(tol_pivot1); break; case TypeSolveMat::CROUT : AA.crout(tol_pivot1); break; case TypeSolveMat::CHOLESKY : AA.cholesky(tol_pivot1); break; default: cerr << " type resolution " << ds.typemat->t << endl; CompileError("type resolution profile inconnue"); break; } return &AA; } else { ExecError("matrix morse & CADNA are incompatible today, sorry!"); return 0; } return 0; } template void DispatchSolution(const typename FESpace::Mesh & Th,int Nb, vector< FEbase * > & u_h,KN * X,KN * B,const FESpace ** LL,const FESpace & Uh) { typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; // dispatch the solution if (Nb==1) { *(u_h[0])=X; if (X != B ) delete B; } else { const FElement ** sK= new const FElement * [Nb]; KN ** sol= new KN * [Nb]; for (int i=0;i( LL[i]->NbOfDF) ; *(u_h[i]) = sol[i]; } for (int it=0;it AnyType Problem::eval(Stack stack,Data * data,CountPointer > & dataA, MatriceCreuse< typename CadnaType::Scalaire > * & cadnamat ) const { typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; using namespace Fem2D; typedef typename CadnaType::Scalaire R_st; MeshPoint *mps= MeshPointStack(stack),mp=*mps; Data_Sparse_Solver ds; /* long NbSpace = 50; long itmax=0; double epsilon=1e-6;*/ string save; // bool VF=false; // VF=isVF(op->largs); // assert(!VF); // double tgv = 1e30; // type de matrice par default TypeSolveMat tmat(TypeSolveMat::defaultvalue); ds.typemat=&tmat; // bool initmat=true; /* int strategy=0; double tol_pivot=-1.; // defaut UMFPACK value Add FH 31 oct 2005 double tol_pivot_sym=-1.; // defaut Add FH 31 oct 2005 KN param_int; KN param_double; string *param_char = NULL; KN perm_r; KN perm_c; string *file_param_int; // Add J. Morice 02/09 string *file_param_double; string* file_param_char; string* file_param_perm_r; string* file_param_perm_c; */ KN* cadna=0; /* { "save",&typeid(string* )}, 0 { "cadna",&typeid(KN*)}, 1 { "bmat",&typeid(Matrice_Creuse* )}, 2 */ if (nargs[0]) save = *GetAny((*nargs[0])(stack)); if (nargs[1]) cadna= GetAny* >((*nargs[1])(stack)); // bmat not used .... bizarre /* if (nargs[0]) ds.initmat= ! GetAny((*nargs[0])(stack)); if (nargs[1]) ds.typemat= GetAny((*nargs[1])(stack)); if (nargs[2]) ds.epsilon= GetAny((*nargs[2])(stack)); // 3 precon if (nargs[4]) ds.NbSpace= GetAny((*nargs[4])(stack)); if (nargs[6]) ds.tgv= GetAny((*nargs[6])(stack)); if (nargs[7]) ds.strategy = GetAny((*nargs[7])(stack)); if (nargs[8]) save = *GetAny((*nargs[8])(stack)); if (nargs[9]) cadna= GetAny* >((*nargs[9])(stack)); */ /* if (nargs[10]) ds.tol_pivot= GetAny((*nargs[10])(stack)); if (nargs[11]) ds.tol_pivot_sym= GetAny((*nargs[11])(stack)); if (nargs[12]) ds.itmax = GetAny((*nargs[12])(stack)); // fevr 2007 if (nargs[13]) ds.param_int= GetAny< KN >((*nargs[13])(stack)); // Add J. Morice 02/09 if (nargs[14]) ds.param_double= GetAny< KN >((*nargs[14])(stack)); if (nargs[15]) ds.param_char= GetAny< string * >((*nargs[15])(stack)); // if (nargs[16]) ds.perm_r = GetAny< KN >((*nargs[16])(stack)); if (nargs[17]) ds.perm_c = GetAny< KN >((*nargs[17])(stack)); // if (nargs[18]) ds.file_param_int= GetAny< string* >((*nargs[18])(stack)); // Add J. Morice 02/09 if (nargs[19]) ds.file_param_double= GetAny< string* > ((*nargs[19])(stack)); if (nargs[20]) ds.file_param_char= GetAny< string* >((*nargs[20])(stack)); // if (nargs[21]) ds.file_param_perm_r = GetAny< string* >((*nargs[21])(stack)); if (nargs[22]) ds.file_param_perm_c = GetAny< string* >((*nargs[22])(stack)); // */ SetEnd_Data_Sparse_Solver(stack,ds,nargs,n_name_param); // for the gestion of the PTR. WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH aout 2007 bool sym = ds.typemat->sym; list::const_iterator ii,ib=op->largs.begin(), ie=op->largs.end(); int Nbcomp2=var.size(),Nbcomp=Nbcomp2/2; // nb de composante throwassert(Nbcomp2==2*Nbcomp); // Data *data= dataptr(stack); // data->init(); KN which_comp(Nbcomp2),which_uh(Nbcomp2); TabFuncArg tabexp(stack,Nbcomp); typedef pair< FEbase *,int> pfer; vector< pair< FEbase *,int> > u_hh(Nbcomp2); for (size_t i=0;i( (*(var[i]))(stack)); for (size_t i=0;inewVh(); // compression pour les cas vectoriel int kkk=0; for (int i=0;i * > u_h(kkk); kkk= 0; for (int i=0;i LL(var.size()); for (int i=0;iTh; for (int i=0;iTh != pTh) ExecError("all the finites elements spaces must be defined on the same mesh in solve"); if ( pTh != data->pTh ) { ds.initmat = true; data->pTh=pTh; if (Nb==1) { // cas scalaire data->Uh=LL[0]; data->Vh=LL[1]; } else { // cas vectoriel bool same=true; for (int i=0;iFirstDfOfNodeData)// Correct jan 2015 not FE product this case { unique = false; break; } if (unique) data->Uh.master( new FESpace(*LL[0],Nb)); else data->Uh.master(new FESpace(LL,Nb)); data->Vh=data->Uh; } } } const FESpace & Uh(*data->Uh); const FESpace & Vh(*data->Vh); throwassert(Nbcomp==Uh.N && Nbcomp==Vh.N); KN *B=new KN(Vh.NbOfDF); KN *X=B; // const Mesh & Th(Uh.Th); bool initx = true; //typemat->t==TypeSolveMat::GC ; // make x and b different in all case // more safe for the future ( 4 days lose with is optimization FH ) InitProblem( Nb, Uh, Vh, B, X,u_hh,ds.typemat , u_h, LL, initx); if(verbosity>2) cout << " Problem(): initmat " << ds.initmat << " VF (discontinuous Galerkin) = " << VF << endl; if (ds.initmat) { if (ds.typemat->profile) { dataA.master(new MatriceProfile(Vh,VF)); } else { if ( &Uh == & Vh ) dataA.master(new MatriceMorse(Vh,sym,VF)); else dataA.master(new MatriceMorse(Vh,Uh,VF)); } MatriceCreuse & AA(dataA); if(verbosity>1) cout << " -- size of Matrix " << AA.size()<< " Bytes" << " skyline =" <profile << endl; } MatriceCreuse & A(dataA); if (AssembleVarForm( stack,Th,Uh,Vh,sym, ds.initmat ? &A:0 , B, op->largs)) { *B = - *B; // hach FH for (int i=0, n= B->N(); i< n; i++) if( abs((*B)[i]) < 1.e-60 ) (*B)[i]=0; AssembleBC ( stack,Th,Uh,Vh,sym, ds.initmat ? &A:0 , B, initx ? X:0, op->largs, ds.tgv ); } else *B = - *B; MatriceCreuse * ACadna = 0; try { if (ds.initmat) { if(cadna) ACadna = DefSolverCadna( stack,A, ds); else DefSolver(stack, A, ds); } // if(verbosity>3) cout << " B min " << B->min() << " , max = " << B->max() << endl; if( save.length() ) { string savem=save+".matrix"; string saveb=save+".b"; { ofstream outmtx( savem.c_str()); outmtx << A << endl; } { ofstream outb(saveb.c_str()); outb<< *B << endl; } } if (verbosity>99) { cout << " X= " << *X << endl; cout << " B= " << *B << endl; } if(ACadna) { KN XX(*X); KN BB(*B); ACadna->Solve(XX,BB); *X=XX; *cadna =-1.; #ifdef HAVE_CADNA R_st xxmin = XX.min(); R_st xxmax = XX.max(); cout << " cadna: min " << xxmin << "/ nd " << cestac(xxmin) << " , max " << xxmax << " / nd " << cestac(xxmax) << endl ; int nn= XX.N(); if ( cadna->N() == nn ) for (int i=0;i set sol = 0 !!!!!!! " << endl; *X=R(); // erreur set the sol of zero ???? DispatchSolution(Th,Nb,u_h,X,B,LL,Uh); throw ; } DispatchSolution(Th,Nb,u_h,X,B,LL,Uh); if (verbosity) {cout << " -- Solve : \n" ; for (int i=0;ix()->min() << " max " << (u_h[i])->x()->max() << endl ; } // delete [] LL; // if (save) delete save; // clean memory *mps=mp; return SetAny(this); } int dimProblem(const ListOfId &l) { int dim=2; int nb=l.size();//,nbarray=0;//,n=0, //const UnId *p1; if(nb>0) { if (l[0].array) { ListOfId * array=l[0].array; if(array->size()>0) { const UnId & idi( (*array)[0]); if (idi.r == 0 && idi.re == 0 && idi.array==0 ) { C_F0 c=::Find( idi.id); if(BCastTo(c) ) dim=3; if(BCastTo(c) ) dim=3; } } } else { C_F0 c=::Find(l[0].id); if(BCastTo(c) ) dim=3; if(BCastTo(c) ) dim=3; } } return dim; } template bool GetBilinearParam(const ListOfId &l,basicAC_F0::name_and_type *name_param,int n_name_param, Expression *nargs,int & N,int & M, vector & var ) { bool unset=true,complextype=false; for (int i=0;iname()]->CastTo(C_F0(l[i].e,l[i].re)); break; } if (!ok) { cerr << " Error name argument " << l[i].id << " the kown arg : "; for (int k=0;ksize(); M = array[1]->size(); var.resize(N+M); for (size_t k=0,j=0;k<2;k++) for (size_t i=0;isize();i++) { const UnId & idi((*array[k])[i]); if (idi.r == 0 && idi.re == 0 && idi.array==0 ) { C_F0 c=::Find( idi.id); if (unset) complextype = BCastTo(c) , unset=false; if(complextype) var[j++]=CastTo(c); else var[j++]=CastTo(c); } else CompileError(" Just Variable in array parameter "); } } else { // old version assert(n%2==0); N=n/2; M=N; var.resize(N+M); for (size_t i=0,j=0;i(c) , unset=false; if(complextype) var[j++]=CastTo(c); else var[j++]=CastTo(c); } } return complextype; } /* int DimForm( list & largs) { int dim=0; list::iterator ii,ib=largs.begin(), ie=largs.end(); for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==atype()) { const FormBilinear * bb=dynamic_cast(e); if(dim) ffassert(bb->d==dim); else dim=bb->d; } else if (r==atype()) { const FormLinear * ll=dynamic_cast(e); if(dim) ffassert(bb->d==dim); else dim=bb->d; } else if (r == atype()) { const BC_set * bc=dynamic_cast(e); if (bc->complextype) complextype=true; } } }*/ bool FieldOfForm( list & largs ,bool complextype) // true => complex problem { // bool iscomplextype=complextype; list::iterator ii,ib=largs.begin(), ie=largs.end(); // bool complextype =false; for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==atype()) { const FormBilinear * bb=dynamic_cast(e); if (! bb->b->mappable(BCastToR)) complextype=true; } else if (r==atype()) { const FormLinear * ll=dynamic_cast(e); if (! ll->l->mappable(BCastToR)) complextype=true; } else if (r == atype()) { const BC_set * bc=dynamic_cast(e); if (bc->complextype) complextype=true; } } for (ii=ib;ii != ie;ii++) { Expression e=ii->LeftValue(); aType r = ii->left(); if (r==atype()) { FormBilinear * bb=new FormBilinear(*dynamic_cast(e)); Foperator * b=const_cast< Foperator *>(bb->b); // const Foperator * b=bb->b; //cout << b << " bb->b " << bb->b << " " << bb->b << " " << bb->b->isoptimize <isoptimize==false); if (complextype) b->mapping(&CCastToC); else b->mapping(&CCastToR) ; Foperator * bn = b->Optimize(currentblock); *bb->b = *bn; *ii=C_F0(bb,r); } else if (r==atype()) { FormLinear * ll=new FormLinear(*dynamic_cast(e)); Ftest * l= const_cast(ll->l); if (complextype) l->mapping(&CCastToC) ; else l->mapping(&CCastToR) ; Ftest * ln = l->Optimize(currentblock); *ll->l=*ln; *ii=C_F0(ll,r); //cout << l << " ll->l " << ll->l << " " << ll->l->isoptimize <()) {// modif FH mai 2007 A FAIRE il y a un bug ici XXXXXXXXXXXXX BC_set * bc= new BC_set(*dynamic_cast(e)); if (complextype && !bc->complextype) { bc->CastToK() ; if(verbosity > 10) cout << " Bc to complex " << endl; } //else bc->mapping(&CCastToR) ; //cout << l << " ll->l " << ll->l << " " << ll->l->isoptimize <* >(),false)); } VF=isVF(op->largs); // cout << " Problem ) VF = " << VF << endl; complextype = FieldOfForm(op->largs,iscomplex) ; // Warning do the casting of all expression in double or complex if( complextype && !iscomplex) CompileError("Error: Problem a complex problem with no complex FE function "); if( verbosity > 1) cout << " -- Problem type ( complex : " << complextype << " ) " <nbitem(); E_Array * vvi(dynamic_cast< E_Array *>(f)); if ( ! vvi) return 0; E_Array & vi(*vvi); Expression febase=0; for (size_t i=0;i() ); const E_FEcomp * comp=dynamic_cast *>( vi[i].LeftValue()) ; if (!(comp && comp->comp == (int) i && comp->N == (int) N)) return 0; if (!febase) febase = comp->a0; else if(comp->a0 != febase) return 0; } return febase; } template Call_FormBilinear::Call_FormBilinear(int dd,Expression * na,Expression BB,Expression fi, Expression fj) : d(dd),nargs(na),largs(),N(fi->nbitem()),M(fj->nbitem()), euh(fi), evh(fj) { assert(nargs ); const C_args * LLL=dynamic_cast(BB); if (!LLL) CompileError("Sorry the variationnal form (varf) is not a the variationnal form (type const C_args *)"); largs=LLL->largs; } template Call_FormLinear::Call_FormLinear(int dd,Expression *na,Expression LL, Expression ft) : d(dd),largs(),nargs(na),N(ft->nbitem()), ppfes(ft)//IsFebaseArray(ft)) { const C_args * LLL=dynamic_cast(LL); if ( !LLL) CompileError("The parameter of a LinearForm must be a array of all componate of FE function"); largs=LLL->largs; } bool C_args::IsLinearOperator() const { // int n=largs.size(); aType tRn =atype* >(); aType tCn =atype* >(); for (const_iterator i=largs.begin(); i != largs.end();i++) { C_F0 c= *i; // Expression e=c; aType r=c.left(); if ( ( r != atype() ) && ( r != atype() ) && ( r != atype::plusAx >() ) && ( r != atype::plusAtx >() ) && ( r != atype::plusAx >() ) && ( r != atype::plusAtx >() ) && ( r != tRn) && ( r != tCn) ) return false; } return true;} bool C_args::IsBilinearOperator() const { //int n=largs.size(); aType tRn =atype* >(); aType tCn =atype* >(); for (const_iterator i=largs.begin(); i != largs.end();i++) { C_F0 c= *i; //Expression e=c; aType r=c.left(); if ( ( r!= atype() ) && ( r != atype() ) && ( r != tRn) && ( r != tCn) ) return false; } return true;} void SetArgsFormLinear(const ListOfId *lid,int ordre) { // the local parameter are // ordre ==2 => bilinear form unknown (newU_) and test function (newV_) // ordre ==1 => linear form just test function (newV_) // --------------------- throwassert(ordre >0 && ordre <=2 && (lid || lid->size()>0 ) ); const ListOfId & l(*lid); int nb=l.size(); int n=0; C_F0 type,init; int nbarray=0; ListOfId * array[2]; aType uh=atype(),vh=atype(); for (int i=0;isize();iNewID(uh,idi.id,C_F0(newU_(i),uh)); else // test function currentblock->NewID(vh,idi.id,C_F0(newV_(i),vh)); } else CompileError(" Just Variable in array parameter "); } } else if (nbarray==0) { // a supprimer to remove in case of bilinear SHOWVERB(cout << "SetArgs:: form set parameter " << endl); if( ! ( ordre==1 || n%2==0) ) CompileError(" Error in test or unkwon function (odd number of function) "); ffassert( ordre==1 || n%2==0); int nn=ordre==1 ? 0 : n/2; // ordre == 1 => no unknown function just test function for (int i=0,j=0;iNewID(uh,l[i].id,C_F0(newU_(j%nn),uh)); else currentblock->NewID(vh,l[i].id,C_F0(newV_(j%nn),vh)); j++; } } else { CompileError(" Sorry you mixte formulation with and without array "); } } const Fem2D::GQuadratureFormular & CDomainOfIntegration::FIV(Stack stack) const { using namespace Fem2D; if (nargs[8]) return *GetAny *>((*nargs[8])(stack)); int exact = 5; if (nargs[2]) exact= GetAny((*nargs[2])(stack))-1; GQuadratureFormular *qf=QF_Simplex(exact);//QF_Tria_exact(exact); if(verbosity>99 && qf ) cout << " QF Tet n:" << qf->n << " exact = " << exact << endl; if(qf) return *qf; /* if( QuadratureFormular_T_1.exact >= exact ) return QuadratureFormular_T_1; if( QuadratureFormular_T_2.exact >= exact ) return QuadratureFormular_T_2; if( QuadratureFormular_T_5.exact >= exact ) return QuadratureFormular_T_5; if( QuadratureFormular_T_7.exact >= exact ) return QuadratureFormular_T_7; if( QuadratureFormular_T_9.exact >= exact ) return QuadratureFormular_T_9; */ static long count = 0; if(verbosity > 1 && count++ < 5) cerr << "Warning : Max Order of the Quadrature Formular Tet is 6 and expect: " << exact+1 << endl; // ExecError(" We find no Quadrature Formular on Tet for this order: too high"); return QuadratureFormular_Tet_5; } const Fem2D::QuadratureFormular & CDomainOfIntegration::FIT(Stack stack) const { using namespace Fem2D; if (nargs[0]) return *GetAny((*nargs[0])(stack)); int exact = 5; if (nargs[2]) exact= GetAny((*nargs[2])(stack))-1; QuadratureFormular *qf=QF_Simplex(exact);//QF_Tria_exact(exact); if(verbosity>99 && qf ) cout << " QF Tria n:" << qf->n << " exact = " << exact << endl; if(qf) return *qf; /* if( QuadratureFormular_T_1.exact >= exact ) return QuadratureFormular_T_1; if( QuadratureFormular_T_2.exact >= exact ) return QuadratureFormular_T_2; if( QuadratureFormular_T_5.exact >= exact ) return QuadratureFormular_T_5; if( QuadratureFormular_T_7.exact >= exact ) return QuadratureFormular_T_7; if( QuadratureFormular_T_9.exact >= exact ) return QuadratureFormular_T_9; */ cerr << " Order of the Quadature Formular: order = " << exact+1 << " exact = " << exact << endl; ExecError("Sorry, we find no Quadrature Formular on Triangle for this order: too high."); return QuadratureFormular_T_1; } const Fem2D::QuadratureFormular1d & CDomainOfIntegration::FIE(Stack stack) const { using namespace Fem2D; if (nargs[1]) return *GetAny((*nargs[1])(stack)); int exact = 5; if (nargs[2]) exact= GetAny((*nargs[2])(stack))-1; QuadratureFormular1d *qf=QF_Simplex(exact);//QF_1d_exact(exact); if(verbosity>99 && qf ) cout << " QF 1d n:" << qf->n << " exact = " << exact << endl; if(qf) return *qf; /* if( 1 >= exact ) return QF_GaussLegendre1; if( 3 >= exact ) return QF_GaussLegendre2; if( 5 >= exact ) return QF_GaussLegendre3; if( 7 >= exact ) return QF_GaussLegendre4; if( 9 >= exact ) return QF_GaussLegendre5; */ cerr << " Ordre of the Integration Formular on Edge, order = " << exact+1 << " exact = " << exact << endl; ExecError(" We find no Quadrature Formular on Edge for this order: too high."); return QF_GaussLegendre1; } namespace Fem2D { // instantiation des template en double template bool AssembleVarForm,FESpace >(Stack stack,const FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,const list &largs ); template bool AssembleVarForm,FESpace3 >(Stack stack,const FESpace3::Mesh & Th, const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse * A,KN_ * B,const list &largs ); template bool AssembleVarForm, double>,FESpace >(Stack stack,const FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, map< pair, double> * A,KN_ * B,const list &largs ); //3d -> template bool AssembleVarForm, double>,FESpace3 >(Stack stack,const FESpace3::Mesh & Th, const FESpace3 & Uh,const FESpace3 & Vh,bool sym, map< pair, double> * A,KN_ * B,const list &largs ); template void AssembleLinearForm(Stack stack,const Mesh & Th,const FESpace & Vh,KN_ * B,const FormLinear * const l); template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse & A, const FormBilinear * b ); template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, map, double > & A, const FormBilinear * b ); // instantiation des template en Complex template bool AssembleVarForm,FESpace >(Stack stack,const FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,const list &largs ); template bool AssembleVarForm, Complex >,FESpace >(Stack stack,const FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, map, Complex > * A,KN_ * B,const list &largs ); // 3d template bool AssembleVarForm,FESpace3 >(Stack stack,const FESpace3::Mesh & Th, const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse * A,KN_ * B,const list &largs ); template bool AssembleVarForm, Complex >,FESpace3 >(Stack stack,const FESpace3::Mesh & Th, const FESpace3 & Uh,const FESpace3 & Vh,bool sym, map, Complex > * A,KN_ * B,const list &largs ); // 3d fin //template bool AssembleVarForm, Complex> >(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, // map< pair, Complex> * A,KN * B,const list &largs ); template void AssembleLinearForm(Stack stack,const Mesh & Th,const FESpace & Vh,KN_ * B,const FormLinear * const l); template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse & A, const FormBilinear * b ); template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, map, Complex > & A, const FormBilinear * b ); //template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, // MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc , double tgv ); // template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, // MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc , double tgv ); template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); template void AssembleBC(Stack stack,const Mesh3 & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); template void AssembleBC(Stack stack,const Mesh3 & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); } template class Call_FormLinear; template class Call_FormLinear; template class Call_FormBilinear; template class Call_FormBilinear; freefem++-3.61-1/src/fflib/AFunction2.cpp000644 000767 000024 00000102407 13312446271 020134 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ //#pragma dont_inline on //#pragma inline_depth(1) #include "config-wrapper.h" #include #include "AFunction.hpp" #include #include #include "error.hpp" #include "lex.hpp" #include "RNM.hpp" #include "Operator.hpp" // for exec routine #include "rgraph.hpp" #include "InitFunct.hpp" vector > *debugstack=0; class vectorOfInst : public E_F0mps { public: int n; Expression * v; vectorOfInst(int k): n(k),v(new Expression[k]) {ffassert(v); for(int i=0;i=0) j = n-j; else j =0; if(verbosity>999) cout << " eval vectorOfInst " << j << " " << n << endl; for (int i=j;inext) if (oo->pref>=p && oo->WithOutCast(at)) { if(ppref) {nn=0;p=oo->pref;} nn++; w=oo;} if (nn) return make_pair(w,nn);*/ for (int ncast=0;ncast<=n;ncast++) // loop on the number of cast { p=-10000; for (oo=this;oo;oo=oo->next) if (oo->pref>=p && oo->WithCast(at,ncast)) { if(ppref) {nn=0;p=oo->pref;} nn++; w=oo;} if (nn) return make_pair(w,nn); } for (oo=this;oo;oo=oo->next) if (oo->WithCast(at)) {nn++; w=oo;} return make_pair(w,nn); } OneOperator::pair_find OneOperator::FindWithOutCast(const ArrayOfaType & at)const { const OneOperator *w=0,*oo; int n=0; for (oo=this;oo;oo=oo->next) if (oo->WithOutCast(at)) {n++; w=oo;} return make_pair(w,n); } // <> OneOperator* OneOperator::FindSameR(const ArrayOfaType & at) { if (this==tnull) return 0; OneOperator *oo,*r; int n=0; for (oo=this;oo;oo=oo->next) { //if (oo->WithOutCast(at)) if (at==*oo) n++,r=oo; else if (oo->WithOutCast(at)) n++,r=oo; // if (n) cout << " \t " << oo << " " << *oo << " <-----> " << at << " n =" << n << endl; } // if (n>1) cout << "FindSameR " << n << endl; // if (n) cout << *r << " <-----> " << at << " n =" << n << endl; return n==1 ? r : 0; } void OneOperator::Show(ostream &f) const { const OneOperator *oo; for (oo=this;oo;oo=oo->next) f << "\t (" << *oo << ")\n"; } void OneOperator::Show(const ArrayOfaType & at,ostream &f) const { const OneOperator *oo; int n=0,np=0; for (oo=this;oo;oo=oo->next) if (oo->WithOutCast(at)) {n++;f << "\t (" << *oo << ")\n";} if(n==0) for (oo=this;oo;oo=oo->next) if (oo->WithCast(at)) { n++; if (oo->pref) np++; if (oo->pref) f << " c(" << oo->pref << ") \t (" << *oo << ")\n" ; else f << " \t c(" << *oo << ")\n"; } if (n==0) { f << " List of choices "<< endl; Show(f); } else if (np != 1) f << " We have ambiguity " << n << endl; } const OneOperator * Polymorphic::Find(const char *op, const ArrayOfaType &at) const { const_iterator i=m.find(op); if (i!=m.end()) { OneOperator::pair_find r=i->second->Find(at); if (r.second==1) return r.first; } return 0; } const OneOperator * Polymorphic::FindWithOutCast(const char *op, const ArrayOfaType &at) const { const_iterator i=m.find(op); if (i!=m.end()) { OneOperator::pair_find r=i->second->FindWithOutCast(at); if (r.second==1) return r.first; } return 0; } void Polymorphic::Show(const char *op,const ArrayOfaType & at,ostream &f) const { const_iterator i=m.find(op); if (i==m.end()) f << " unknow " << op << " operator " << endl; else i->second->Show(at,f); } // <> cf [[file:AFunction.hpp::C_F0_constructor_pop_char_basicAC_F0_decl]] C_F0::C_F0(const Polymorphic * poly,const char *op,const basicAC_F0 & p) { ArrayOfaType at(p); if (poly) { // a Polymorphic => polymorphisme const OneOperator * ff=poly->Find(op,at); if (ff) { if( verbosity>9999) {cout << endl; poly->Show(op,at,cout); cout << op << ": (in " << at << ") => " << " " << *ff<< "\n\n";} // [[file:AFunction.hpp::OneOperator_code2]] *this= ff->code2(p); } else { if(mpirank==0) { cerr << " error operator " << op << " " << at << endl; poly->Show(op,at,cerr); // const OneOperator * ff= poly->Find(op,at); } CompileError(); } } else { // no polymorphisme if(mpirank==0){ cerr << " const Polymorphic * poly,const char *op,const basicAC_F0 & p) " << endl; cerr << op << " " << at << endl; } CompileError(); } } // operator without parameter C_F0::C_F0(const Polymorphic * pop,const char *op) { basicAC_F0 p; p=0; *this= C_F0(pop,op,p); } // operator unaire C_F0::C_F0(const Polymorphic * pop,const char *op,const C_F0 & aa) { basicAC_F0 p; C_F0 a(aa); p=a; *this= C_F0(pop,op,p); } // <> operator binaire C_F0::C_F0(const Polymorphic * pop,const char *op,const C_F0 & a,const C_F0 & b) { C_F0 tab[2]={a,b}; basicAC_F0 p; p=make_pair(2,tab); // [[file:AFunction.hpp::C_F0_constructor_pop_char_basicAC_F0_decl]] *this=C_F0(pop,op,p); } // operator trinaire C_F0::C_F0(const Polymorphic * pop,const char *op,const C_F0 & a,const C_F0 & b,const C_F0 & c) { C_F0 tab[3]={a,b,c}; basicAC_F0 p; p=make_pair(3,tab); *this= C_F0(pop,op,p); } OneOperator::~OneOperator(){ OneOperator * d=next; next=0; if(! CodeAlloc::cleanning) // hash FH (pour les fuite de mmoire) while(d) { OneOperator * dd=d->next; d->next=0; delete d; d=dd; } } OneOperator::OneOperator(aType rr) : ArrayOfaType(),r(rr),next(0),pref(0) {throwassert(r);} OneOperator::OneOperator(aType rr,aType a) : ArrayOfaType(a,false),r(rr),next(0),pref(0) {throwassert(rr && a );} OneOperator::OneOperator(aType rr,aType a,aType b) : ArrayOfaType(a,b,false),r(rr),next(0),pref(0) { throwassert(rr && a && b);} OneOperator::OneOperator(aType rr,aType a,aType b,aType c) : ArrayOfaType(a,b,c,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c);} OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d) : ArrayOfaType(a,b,c,d,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c);} OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e) : ArrayOfaType(a,b,c,d,e,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d);} // Added by Fabian Dortu (5 parameters) OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f) : ArrayOfaType(a,b,c,d,e,f,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f);} // Added by Fabian Dortu (6 parameters) OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g) : ArrayOfaType(a,b,c,d,e,f,g,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g);} // Added by Fabian Dortu (7 parameters) OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h) : ArrayOfaType(a,b,c,d,e,f,g,h,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h);} // Added by Fabian Dortu (8 parameters) OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h, aType i) : ArrayOfaType(a,b,c,d,e,f,g,h,i,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h && i);} // Added by Fabian Dortu (9 parameters) OneOperator::OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f, aType g, aType h, aType i, aType j) : ArrayOfaType(a,b,c,d,e,f,g,h,i,j,false),r(rr),next(0),pref(0) {throwassert(rr && a && b && c && d && e && f && g && h && i && j);} // Added by Fabian Dortu (10 parameters) OneOperator::OneOperator(aType rr,const ArrayOfaType &ta) : ArrayOfaType(ta),r(rr),next(0),pref(0) {throwassert(rr);} OneOperator::OneOperator(aType rr,bool ellipse) : ArrayOfaType(ellipse),r(rr),next(0),pref(0) {throwassert(rr );} OneOperator::OneOperator(aType rr,const ListOfId *l) : ArrayOfaType(l),r(rr),next(0),pref(0) {throwassert(rr );} void Polymorphic::Addp(const char * op,Value pp,...) const { pair p=m.insert(pair(op,pp)); Value f= p.first->second; if (!p.second) // not insert => old *f += *pp; va_list ap; va_start(ap,pp); for(pp=va_arg(ap,OneOperator * );pp;pp=va_arg(ap,OneOperator * )) *f += *pp; /* if ( ! strlen(op) ) { // no polymorphisme if(m.size() !=1 || !f->Simple()) { cerr << " no polymorphisme and polymorphisme are mixed " << endl; // for_each(m.begin,m.end(),ShowOn_cerr); CompileError(); } } */ } void Polymorphic::Add(const char * op,Value *pp) const { if (*pp) { pair p=m.insert(pair(op,*pp)); Value f= p.first->second; if (!p.second) // not insert => old *f += **pp; pp++; for(;*pp;pp++) *f += **pp; /*if ( ! strlen(op) ) { // no polymorphisme if(m.size() !=1 || !f->Simple()) { cerr << " no polymorphisme and polymorphisme are mixed " << endl; // for_each(m.begin,m.end(),ShowOn_cerr); CompileError(); } } */ } } // <> int FindType(const char * name) { C_F0 r; ListOfTOfId::const_iterator i=tables_of_identifier.begin(); for(;i!=tables_of_identifier.end();++i) { TableOfIdentifier * ti=*i; r = ti->Find(name); if (r.NotNull()) return r.TYPEOFID(); } return 0; } /// <> uses [[file:global.cpp::tables_of_identifier]] C_F0 Find(const char * name) { C_F0 r; ListOfTOfId::const_iterator i=tables_of_identifier.begin(); for(;i!=tables_of_identifier.end();++i) { TableOfIdentifier * ti=*i; r = ti->Find(name); if (r.NotNull()) return r; } if(mpirank==0) cerr << " The Identifier " << name << " does not exist " << endl; CompileError(); return r; } vectorOfInst* TableOfIdentifier::newdestroy() { int k=0; // cout << "\n\t List of destroy variables " << m.size() << " : " ; for (pKV * i=listofvar;i;i=i->second.next) { if (i->second.del && i->second.first->ExistDestroy() ) // cout << i->first << ", " ; assert(i->second.first); if (i->second.del && i->second.first->ExistDestroy() ) k++; } ffassert(nIdWithDelete==k); // cout << endl; /* old code ListOfInst *l=new ListOfInst(k); for (pKV * i=listofvar;i;i=i->second.next) if (i->second.del && i->second.first->ExistDestroy()) l->Add(i->second.first->Destroy(i->second) ); */ // new code vectorOfInst * l= new vectorOfInst(k); int j=0; for (pKV * i=listofvar;i;i=i->second.next) if (i->second.del && i->second.first->ExistDestroy()) l->v[j++]=i->second.first->Destroy(i->second) ; ffassert(j==k); return l; } C_F0 TableOfIdentifier::destroy() {return C_F0(newdestroy());} void TableOfIdentifier::clear() { for (iterator i=m.begin();i!=m.end();++i) { // delete i->first; } m.clear(); } Expression basicForEachType::Destroy(const C_F0 & e) const { return destroy ? NewExpression(destroy,e) : (Expression) e; } basicForEachType::~basicForEachType() { if(casting) delete casting; ti.clear(); } basicForEachType::basicForEachType(const type_info & k, const size_t s, const E_F1_funcT_Type * p, basicForEachType *rr, Function1 iv,Function1 id, Function1 dreturn) : ktype(&k),//ktypefunc(0), size(s), un_ptr_type(rr?rr:this), casting(0), // no casting to un_ptr(p), InitExp(iv), DoOnReturn(dreturn), //funct_type(0), destroy(id) {} void basicForEachType::SetArgs(const ListOfId *lid) const { SHOWVERB(cout << "SetArgs::\n ") ;ffassert(lid==0 || lid->size()==0);} TableOfIdentifier::TableOfIdentifier() : listofvar(0),nIdWithDelete(0) {} TableOfIdentifier:: ~TableOfIdentifier() {} Block::Block(Block * f):fatherblock(f),top(f?f->top:BeginOffset*sizeof(void*)),topmax(top) { itabl=tables_of_identifier.insert(tables_of_identifier.begin(),&table); } Block::~Block(){} /* vectorOfInst * Block::newclose(Block *& c) { tables_of_identifier.erase(itabl); c=fatherblock; if (fatherblock) {fatherblock->topmax=topmax; fatherblock->top=top;} vectorOfInst * r; r = table.newdestroy(); delete this; return r;} */ vectorOfInst * Block::snewclose(Block *& c) { Block * a=c; tables_of_identifier.erase(a->itabl); c=a->fatherblock; if (a->fatherblock) {a->fatherblock->topmax=a->topmax; a->fatherblock->top=a->top;} vectorOfInst * r; r = a->table.newdestroy(); delete a; return r;} CC_F0 Block::close(Block *& c,C_F0 ins) { CListOfInst inst; CC_F0 cins; cins=ins; inst = cins; inst.setclose(Block::snewclose(c)); CC_F0 rr; rr=inst; return rr; } CC_F0 Block::close(Block *& c,CListOfInst inst) { inst.setclose(Block::snewclose(c)); CC_F0 rr; rr=inst; return rr; } Block * Block::open(Block *& cb) { return cb = new Block(cb); } const Type_Expr & TableOfIdentifier::New(Key k,const Type_Expr & v,bool del) { if( this != &Global) { if ( Global.m.find(k) != Global.m.end() ) { if(mpirank==0 && (verbosity>0)) cerr << "\n *** Warning The identifier " << k << " hide a Global identifier \n"; } } pair p=m.insert(pKV(k,Value(v,listofvar,del))); listofvar = &*m.find(k); if (!p.second) { if(mpirank==0) { cerr << " The identifier " << k << " exists \n"; cerr << " \t the existing type is " << *p.first->second.first << endl; cerr << " \t the new type is " << *v.first << endl; } CompileError(); } if(del && v.first->ExistDestroy() ) { nIdWithDelete++; if(verbosity>9999) cout << "\n \t add ExistDestroy" << endl; } return v; } void TableOfIdentifier::Add(Key k,Key op,OneOperator *p0,OneOperator *p1, OneOperator *p2,OneOperator *p3,OneOperator *p4,OneOperator *p5,OneOperator *p6) { iterator i= m.find(k); if (i==m.end()) // new { Value poly0=Value(atype(),new Polymorphic(),listofvar); i=m.insert(pair(k,poly0)).first; listofvar= &*i; } const Polymorphic * p= dynamic_cast(i->second.second); if ( !p) { if(mpirank==0) cerr << k << " is not a Polymorphic id " << endl; CompileError(); } p->Add(op,p0,p1,p2,p3,p4,p5,p6); } ArrayOfaType::ArrayOfaType(const ListOfId * l) : n(l->size()),t(new aType[n]),ellipse(false) { for (int i=0;i a.n) ) return false; for (int i=0;iSametypeRight(t[i])) return false; // cerr << " TRUE " << endl; return true; } bool ArrayOfaType::WithCast( const ArrayOfaType & a,int nbcast) const { if ( ( !ellipse && (a.n != n)) || (ellipse && n > a.n) ) return false; for (int i=0;iSametypeRight(t[i])) ; else if (! t[i]->CastingFrom(a.t[i])) return false; else if ( --nbcast <0) return false; return true; } void basicForEachType::AddCast(CastFunc f1,CastFunc f2,CastFunc f3,CastFunc f4, CastFunc f5,CastFunc f6,CastFunc f7,CastFunc f8) { CastFunc ff[]={f1,f2,f3,f4,f5,f6,f7,f8,0}; for (int i=0;ff[i];i++) { ffassert(this == *ff[i] ); if (casting->FindSameR(*ff[i])) { if(mpirank==0) { cerr << " The casting to " << *ff[i] << " exists " << endl; cerr << " List of cast " << endl; casting->Show(cerr); } CompileError(); } if (casting) *casting += *ff[i]; else casting = ff[i]; /* if( ! mapofcast.insert(make_pair(ff[i]->a,ff[i])).second) { cerr << " The casting to "<< *this << " from " << ff[i]->a << " exists " << endl; cerr << " List of cast " << endl; for_each(mapofcast.begin(),mapofcast.end(),CerrCast); CompileError(); } */ } } ostream & operator<<(ostream & f,const OneOperator & a) { // for(const OneOperator * tt=&a;tt;tt=tt->next) f << "\t " << * (a.r) << " : " <<(const ArrayOfaType &) a; return f; } ostream & operator<<(ostream & f,const Polymorphic & a) { Polymorphic::const_iterator i; if(&a==E_F0::tnull) return f << "Null " << endl; for (i=a.m.begin();i!=a.m.end();i++) { f << " operator" << i->first << " : " << endl; i->second->Show(f); } return f; } ostream & operator<<(ostream & f,const ArrayOfaType & a) { for (int i=0;isecond; f << i->first << ": " << *v.first << " <- " ; const Polymorphic * p=dynamic_cast(v.second); if(p) f << "Polymorphic " << *p << endl; else f << " Simple @" << v.second << endl; } return f; } Expression NewExpression(Function1 f,Expression a) { ffassert(f); return new E_F0_Func1(f,a); } Expression NewExpression(Function2 f,Expression a,Expression b) { ffassert(f); return new E_F0_Func2(f,a,b); } // <> void ShowType(ostream & f) { map::const_iterator i; for(i=map_type.begin();i!=map_type.end();i++) { f << " --"<< i->first <<" = " ; i->second->Show(f) ; f << endl; } } void basicForEachType::Show(ostream & f) const { f << " " <<* this << endl; if (casting) casting->Show(f) ; if (ti.m.size()) { TableOfIdentifier::const_iterator mc=ti.m.begin(); TableOfIdentifier::const_iterator end=ti.m.end(); for (;mc != end;mc++) { f << " " << mc->first << ", type :" << *mc->second.first << endl; const Polymorphic * op =dynamic_cast(mc->second.second) ; if ( op ) f << *op << endl; } } } E_Routine::E_Routine(const Routine * routine,const basicAC_F0 & args) : code(routine->ins), //clean(routine->clean), rt(routine->tret), nbparam(args.size()), param(new Expression[nbparam]), name(routine->name) { assert(routine->ins); for (int i=0;i10000) cout << "E_Routine " << *routine->param[i].r << " <- " << *args[i].left() << endl; param[i]=routine->param[i].r->CastTo(args[i]); } }; E_Routine::~E_Routine() { if(verbosity>10000) cout << "~E_Routine()"<< endl; delete [] param;} /* struct CleanE_Routine { const E_Routine * er; Stack s; AnyType * l; CleanE_Routine(const E_Routine * r,Stack ss,AnyType *ll): er(r),s(ss),l(ll) {} ~CleanE_Routine() { // cout << " Clean E_routine " << er <clean)(s); delete [] l; } }; */ AnyType E_Routine::operator()(Stack s) const { //cout << " E_Routine:: push " <size() << endl; debugstack->push_back(pair(this,TheCurrentLine)); const int lgsave=BeginOffset*sizeof(void*); char save[lgsave]; AnyType ret=Nothing; memcpy(save,s,lgsave); // save AnyType *listparam; // Add2StackOfPtr2Free(s,new CleanE_Routine(this,s,listparam=new AnyType[nbparam])); Add2StackOfPtr2FreeA(s,listparam=new AnyType[nbparam]); // AnyType *listparam =Add2StackOfPtr2FreeA(s,new AnyType[nbparam]); // // WhereStackOfPtr2Free(s)->Add2StackOfPtr2Free(s,listparam); // to day the memory gestion of the local variable are static, for (int i=0;i(s,ParamPtrOffset) = listparam; WhereStackOfPtr2Free(s)=new StackOfPtr2Free(s);// FH mars 2006 try { ret=(*code)(s); } catch( E_exception & e) { // cout << " catch " << e.what() << " clean & throw " << endl; if (e.type() == E_exception::e_return) ret = e.r; else ErrorExec("E_exception: break or contine not in loop ",1); } catch(...) { // clean and rethrow the exception //::delete [] listparam; // (*clean)(s); WhereStackOfPtr2Free(s)->clean(); // FH mars 2005 memcpy(s,save,lgsave); // restore TheCurrentLine=debugstack->back().second; debugstack->pop_back(); // cout << " E_Routine:: ... pop " <size() << endl; throw ; } // (*clean)(s); // the clean is done in CleanE_Routine delete . // delete [] listparam; after return memcpy(s,save,lgsave); // restore TheCurrentLine=debugstack->back().second; debugstack->pop_back(); // cout << " E_Routine:: pop " <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 // en fin d'instruction programme de l'appelant FH 2007 // ... ou alors changer le return ???? qui doit copie le resultat.. (voir) return ret; } extern Block *currentblock;// def in lg.ypp void ListOfInst::Add(const C_F0 & ins) { if( (!ins.Empty()) ) { if( verbosity > 9999 ) cout << " Add " << n << " " << TheCurrentLine << endl; if (n%nx==0){ Expression * l = new Expression [n+nx]; int * ln = new int [n+nx]; int * lsd = new int [n+nx]; for (int i=0;inIdWithDelete(); // NbNewVarWithDel=0; list[n++] = ins; } } /// <> Iteratively calls each item in the local array #list of type #Expression AnyType ListOfInst::operator()(Stack s) const { AnyType r; int i; double s0=CPUtime(),s1=s0,ss0=s0; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); try { // modif FH oct 2006 for (i=0;iclean(); // modif FH mars 2006 clean Ptr s1=CPUtime(); if (showCPU) cout << " CPU: "<< i <<" " << linenumber[i] << ": " << s1-s0 << "s" << " " << s1-ss0 << "s" << " / " << " " <99999) cout << " ListOfInst::operator() " << n << " " << atclose->n << " // " << lsldel[n-1] << endl; atclose->eval(s,atclose->n);}// Add for sep 2016 FH } catch( E_exception & e) { if(verbosity>999) cout << " catch E_exception " << i << " " << lsldel[i] << endl; if(atclose) {atclose->eval(s,lsldel[i]);}// Add sep 2016 FH for clean init varaible if (e.type() != E_exception::e_return) sptr->clean(); // pour ne pas detruire la valeur retourne ... FH jan 2007 throw; // rethow } catch(...) { if(verbosity>999) cout << " catch .... " << i << " " << lsldel[i] << endl; if(atclose) {atclose->eval(s,lsldel[i]);} sptr->clean(); throw; } return r;} /* AnyType E_block::operator()(Stack s) const { StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); if (clean) { try { for (int i=0;iclean(); }} catch( E_exception & e) { (*clean)(s); if (e.type() != E_exception::e_return) sptr->clean(); throw; // rethow } catch(...) { // catch all for cleanning (*clean)(s); sptr->clean(); // if(verbosity>50) // cout << " catch " << e.what() << " clean & throw " << endl; // throw(e); throw; // rethow } (*clean)(s); sptr->clean(); } else // not catch exception if no clean (optimization} for (int i=0;iclean(); // mars 2006 FH clean Ptr } return Nothing; } */ void ShowDebugStack() { if (mpisize) cerr << " current line = " << TheCurrentLine << " mpirank " << mpirank << " / " << mpisize <at(i).first->name<< " at line " <at(i).second << endl; } } int E_F0::Optimize(deque > &l,MapOfE_F0 & m, size_t & n) { int rr = find(m); if (rr) return rr; if( (verbosity / 10)% 10 == 1) cout << "\n new expression : " << n << " mi=" << MeshIndependent()<< " " << typeid(*this).name() << " :" << *this << endl; return insert(this,l,m,n); } class E_F0para :public E_F0 { public: const int i; AnyType operator()(Stack s) const { // return (* Stack_Ptr(s,ParamPtrOffset)[i])(s); return Stack_Ptr(s,ParamPtrOffset)[i]; } E_F0para(int ii) : i(ii){} }; Routine::Routine(aType tf,aType tr,const char * iden, ListOfId *l,Block * & cb) : OneOperator(tr,l),offset(cb->OffSet(sizeof(void*))), tfunc(tf),tret(tr),name(iden),param(*l), currentblock(new Block(cb)),ins(0)//,clean(0) { delete l; // add FH 24032005 (trap ) cb = currentblock; // cout <<"Routine: tf = " << *tf << " " << *tr << endl; for (size_t i=0;iright() << endl; currentblock->NewID(param[i].r,param[i].id,C_F0(new E_F0para(i),// modif FH 2007 param[i].r), // (param[i].ref ? param[i].r : param[i].r->right() ), !param[i].ref); } } Block * Routine::Set(CListOfInst instrs) { instrs.setclose(Block::snewclose(currentblock)); ins=instrs; // clean = (C_F0) currentblock->close(currentblock); return currentblock;} E_F0 * Routine::code(const basicAC_F0 & args) const { return new E_Routine(this,args); } void basicAC_F0::SetNameParam(int n,name_and_type *l , Expression * e) const { int k=0; if ( !n && !named_parameter) return; for (int i=0;iname()] ) { if(mpirank==0) { cerr << " missing ff type: '" <name() << "' "<< map_type.size() << "\n"; cerr << "i= " << i << "\n"; } InternalError(" missing type "); assert(map_type[l[i].type->name()]); } e[i]= map_type[l[i].type->name()]->CastTo(ce); k++; } } if (!named_parameter) return; if ((size_t) k!= named_parameter->size()) { cout << " Sorry some name parameter are not used! found" << k << " == " << named_parameter->size() <begin(); ii != named_parameter->end();ii++) { for (int i=0;ifirst)) goto L1; cout << "\t the parameter is '" << ii->first << "' is unused " << endl; L1:; } if ( n && mpirank==0) { cerr << " The named parameter can be " << endl; for (int i=0;iname() << ">\n"; } CompileError("Unused named parameter"); } } // change FH to bluid .dll void lgerror (const char* s) { if(mpirank==0) { cerr << endl; cerr <<" Error line number " << zzzfff->lineno() << ", in file " << zzzfff->filename() <<", before token " <YYText() << endl << s << endl; } throw(ErrorCompile(s,zzzfff->lineno(),zzzfff->YYText() )); } C_F0 ForAll(Block *cb,ListOfId * id,C_F0 m) { //Block::open(cb); // new block // decl variable if(verbosity>1000) cout << "InitAutoLoop ::: " << id->size()<< " type=" << *(m.left()) << endl; ffassert(id->size()<4); aType t=m.left() ; ffassert(id->size()<=0 || t->typev); ffassert(id->size()<=1 || t->typei); ffassert(id->size()<=2 || t->typej); // missing this king of code atype->SetTypeLoop(atype(),atype()) maybe !!!! FH. ffassert(id->size()<4); // find the size do data aType tt[4]; int k=0; if(t->typei) tt[k++]=t->typei; if(t->typej) tt[k++]=t->typej; if(t->typev) tt[k++]=t->typev; for(int i=0;i1000) cout << " aType = " << i << " left " << *tt[i] << " right="<< *tt[i]->right() <size(); jsize() ; ++j) { --i; C_F0 ci=cb->NewVar((*id)[i].id,tt[i]); C_F0 cv=Find((*id)[i].id); args+=cv; const LocalVariable *lv = dynamic_cast((E_F0*) cv); if(verbosity>1000) cout << " new id " << tt[i] << " "<< (*id)[i].id << " " << " E=" << (Expression) args[i] << " " << (Expression) ci << " " <offset: -1) << " " << *cv.left() << endl; } Expression loop= new PolymorphicLoop(m,args); if(verbosity>1000) cout << "a type: " << *atype() << " " << loop << endl; return C_F0(loop,atype()); } C_F0 ForAll(C_F0 cloop,C_F0 inst) { if(verbosity>1000) cout << " type cloop " << *cloop.left() << " " << cloop.LeftValue() << " " << endl; const PolymorphicLoop *loop= dynamic_cast(cloop.LeftValue()); ffassert(loop); AC_F0 args; args=0; args+=loop->t; args+=cloop; C_F0 instt(inst,atype()); // C_F0 eend(end,atype()); args+=instt; // if( (Expression) end !=0) // args+=end; return C_F0(TheOperators,"{}",args); } void InitLoop() { // TheLoopOpt=new Polymorphic(); Dcl_Type(0); } freefem++-3.61-1/src/fflib/InitFunct.hpp000644 000767 000024 00000006107 13256636774 020114 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef INITSFUNCT_HPP_ #define INITSFUNCT_HPP_ #include "ffapi.hpp" // [[file:~/ff/src/fflib/InitFunct.cpp::addInitFunct]] void addInitFunct(int i,void (* f)(),const char *name) ; // [[file:InitFunct.cpp::callInitsFunct]] void callInitsFunct(); class addingInitFunct { public: addingInitFunct(int i,void (* f)(),const char *name="") { // [[file:~/ff/src/fflib/InitFunct.cpp::addInitFunct]] addInitFunct(i,f,name); } } ; // <> In Emscripten manipulating input and output streams is not allowed (cf // [[file:~/fflib/Makefile::NO_STREAM_REDIRECT]]) #ifdef NO_STREAM_REDIRECT #define LOADINITIO #else #if _WIN32 #define LOADINITIO { \ streambuf * so =ffapi::cout()->rdbuf() ; \ streambuf * si =ffapi::cin()->rdbuf() ; \ streambuf * se =ffapi::cerr()->rdbuf() ; \ if( so && cout.rdbuf() != so ) cout.rdbuf(so); \ if( si && cin.rdbuf() != si ) cin.rdbuf(si); \ if( se && cerr.rdbuf() != se ) cerr.rdbuf(se); \ } #else // [[_WIN32]] #define LOADINITIO { \ streambuf * so =ffapi::cout()->rdbuf() ; \ streambuf * si =ffapi::cin()->rdbuf() ; \ streambuf * se =ffapi::cerr()->rdbuf() ; \ if( so && cout.rdbuf() != so ) cout.rdbuf(so); \ if( si && cin.rdbuf() != si ) cin.rdbuf(si); \ if( se && cerr.rdbuf() != se ) cerr.rdbuf(se); \ stdout = ffapi::ffstdout(); \ stderr = ffapi::ffstderr(); \ stdin = ffapi::ffstdin(); \ } #endif // [[_WIN32]] #endif // [[NO_STREAM_REDIRECT]] #define LOADINITNM(EXEC,NM) \ \ static void AutoLoadInit() { \ \ /* [[LOADINITIO]] */ \ LOADINITIO; \ if(verbosity>9) cout << "\n loadfile " NM "\n" ; \ EXEC; \ } \ \ static int DoLoadInit() { \ if(verbosity>9) cout << " **** " << NM << " ****\n" ; \ \ /* <> */ \ /* [[file:~/ff/src/fflib/InitFunct.cpp::addInitFunct]] */ \ addInitFunct(10000,&AutoLoadInit,NM); \ return 2; \ } \ \ static int callDoLoadInit=DoLoadInit(); #define LOADINIT(TI) LOADINITNM(TI init obsolete,__FILE__) #define LOADFUNC(FC) LOADINITNM(FC() ,__FILE__) #endif // [[INITSFUNCT_HPP_]] freefem++-3.61-1/src/fflib/array_real.cpp000644 000767 000024 00000010230 13312446271 020275 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "array_tlp.hpp" #include "array_init.hpp" double square(double x){return x*x;} void initArrayDCLdouble() { // ArrayOperator(); ArrayDCL(); } //template A Build(B b) { return A(b);} void initArrayOperatordouble() { ArrayOperator(); ArrayOperatorF(); typedef double K; typedef double KK; Dcl_Type< QuantileKN > (); Global.Add("abs","(",new OneOperator1F_KN_,K,KK,KN_ >(fabs)); Global.Add("acos","(",new OneOperator1F_KN_,K,KK,KN_ >(acos)); Global.Add("asin","(",new OneOperator1F_KN_,K,KK,KN_ >(asin)); Global.Add("atan","(",new OneOperator1F_KN_,K,KK,KN_ >(atan)); Global.Add("floor","(",new OneOperator1F_KN_,K,KK,KN_ >(floor)); Global.Add("ceil","(",new OneOperator1F_KN_,K,KK,KN_ >(ceil)); Global.Add("square","(",new OneOperator1F_KN_,K,KK,KN_ >(square)); Add >("sort",".",new OneOperator1_,KN_ >(SortKn >)); // Add >("sort",".",new OneOperator1_,KN >(SortKn >)); Add *>("sort",".",new OneOperator1_*,KN* >(SortpKn)); // Add >("sort",".",new OneOperator2_,KN_,KN_ >(SortKn,KN_ >)); // Add >("sort",".",new OneOperator2_,KN,KN_ >(SortKn,KN_ >)); Global.Add("sort","(",new OneOperator2_*,KN*,KN* >(SortpKn2)); Add >("quantile",".",new OneOperator1,KN_ >(Build,KN_ >)); // Add >("quantile",".",new OneOperator1,KN_ >(Build,KN_ >, atype >())); // Add * >("quantile",".",new OneOperator1,KN_ >(Build,KN_ >, atype >())); Add * >("quantile",".",new OneOperator1,KN_ >(Build,KN_ >, atype *>() )); Add >("(","",new OneOperator2_,double>(Quantile)); map_type[typeid(SetArray).name()]->AddCast( new E_F1_funcT,SetArray >(Cast,SetArray >) ); Global.Add("toRarray","(",new OneOperator_2KN_); Add *>("imin",".",new OneOperator1 *>(get_imin)); Add *>("imax",".",new OneOperator1 *>(get_imax)); Add *>("imin",".",new OneOperator1 *>(get_imin));// Add april 2018 FH Add *>("imax",".",new OneOperator1 *>(get_imax));// Add april 2018 FH Add *>("jmin",".",new OneOperator1 *>(get_jmin));// Add april 2018 FH Add *>("jmax",".",new OneOperator1 *>(get_jmax));// Add april 2018 FH Global.Add("ijmax","(",new OneOperator3_ *,long*,long*>(get_ijmax));// Add april 2018 FH Global.Add("ijmin","(",new OneOperator3_ *,long*,long*>(get_ijmin));// Add april 2018 FH // madd FH. march 2015 ... Global.Add("Unique", "(", new Unique); Global.Add("Unique", "(", new Unique); // ArrayDCL(); } freefem++-3.61-1/src/fflib/environment.cpp000644 000767 000024 00000025633 13256636774 020555 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "environment.hpp" #include "iostream" #include #include #include #include #include // set in getprog-unix.hpp in Graphic dir.. const char * prognamearg=0; extern void (*initparallele)(int &, char **&); // to know if mpiversion ... #ifdef PURE_WIN32 #include #endif #ifdef HAVE_GETENV #include #endif using namespace std; bool load(string s); const char SLACH='/'; const char BACKSLACH='\\'; #ifdef PURE_WIN32 const char dirsep=BACKSLACH, dirnsep=SLACH; #else const char dirnsep=BACKSLACH, dirsep=SLACH; #endif #include int dirExists(const string & path) { struct stat info; if(stat( path.c_str(), &info ) != 0) return 0; else if(info.st_mode & S_IFDIR) return 1; else return 0; } string DirName(const char * f) { const char *c= strrchr(f,dirsep); if(!c) return string(""); else return string(f,strlen(f)-strlen(c)); } string TransDir(string dir,string adddir="") { for (size_t i=0; i1 && dir[dir.size()-1] != dirsep) dir += dirsep; if(adddir.length() && dir[0]=='!') { dir = adddir +dirsep +dir.substr(1); } return dir; } template void show(const char * s,const T & l,const char * separateur="\n") { cout << s << * separateur; for (typename T::const_iterator i=l.begin(); i != l.end(); i++) cout << * i << * separateur; //cout << endl; } bool EnvironmentFind(string key,string item) { EnvironmentData::iterator ekey=ffenvironment.find(key); if( ekey != ffenvironment.end()) { OneEnvironmentData * pl= &ekey->second; OneEnvironmentData::iterator i=find(pl->begin(),pl->end(),item); return i != pl->end(); } return false; } bool EnvironmentClean(string key) { EnvironmentData::iterator ekey=ffenvironment.find(key); if( ekey != ffenvironment.end()) { OneEnvironmentData * pl= &ekey->second; pl->clear(); return true; } return false; } bool EnvironmentInsert(string key,string item,string before) { bool ret=true; OneEnvironmentData & l = ffenvironment[key]; char sufmpi[] = {'m','p','i',dirsep,'\0'}; string suf= ((key== "loadpath") && initparallele ) ? sufmpi : ""; if( verbosity > 1000) cout << " **EnvironmentInsert " <=100) cout << " EnvironmentInsert: Add suf " << suf << " to " << item << " in GetEnvironment "<< key << endl; item += suf; } OneEnvironmentData::iterator i=find(l.begin(),l.end(),item); if(i!=l.end()) {ret=false; l.erase(i);} // if existe remove i=find(l.begin(),l.end(),before); if(verbosity>=100) cout << " insert " << key << " " << item << " " << before << endl; if(i == l.end() && before!="$") l.insert(l.begin(),item); // insert in front else l.insert(i,item); // insert before i return ret; } int GetEnvironment(const string & key, string items) { if(verbosity>=100) cout << key << " -> " << items << endl; bool path=key.find("path")!= string::npos; int d=0, k=0; if(path) items+=";;"; for (size_t i=0;i=100) cout << " + " << item << endl; if(!EnvironmentFind(key,item)) { EnvironmentInsert(key,item,"$"); k++; } d=i+1; } return k; } int readinitfile(const string & file) { string line=""; string key; string value; bool add=false; ifstream f(file.c_str()); if( ! f) { if(verbosity>=20) cout << "error opening init file: " << file << endl; return 0;} string dirfile=DirName(file.c_str()); char c,c1,bv=0; int linenumber = 1; bool inkey=false,invalue=false,cmm=false; while (f) { c= f.get(); c1=f.peek(); //cout << c ; // if(bv) //cerr << bv ; //else cerr << '.'; if(c == EOF) break; if(c =='\n' || c=='\r' ) { linenumber++; line=""; cmm = false; } else line+= c; if(c=='#') cmm=true; if(!cmm) { if(invalue) // get value key [=|+= value ] { if (bv) // store the value { if (! (c == bv || ( bv==' ' && isspace(c)) ) ) { value+= c; // add to value } else // end of value { bv =0; invalue=0; // fin de la value if(verbosity >= 50) cout < 0) ff_verbosity=envv; if (GetEnvironmentVariable("FF_LOADPATH", envl, LEN) > 0) ff_loadpath=envl; if (GetEnvironmentVariable("FF_INCLUDEPATH", envi, LEN) > 0) ff_incpath=envi; if (GetEnvironmentVariable("HOMEPATH", envh, LEN) > 0) home=envh; #endif if ( ff_verbosity ) { verbosity = atoi(ff_verbosity); if(verbosity > 4) cout << " -- GetEnvironmentVariable: verbosity= " <2) cout << " try initfile : " <<*i << endl; readinitfile(*i++); } } // if ( ff_verbosity ) { // verbosity = atoi(ff_verbosity); // } if(ff_loadpath) GetEnvironment("loadpath",ff_loadpath); if(ff_incpath) GetEnvironment("includepath",ff_incpath); EnvironmentInsert("includepath","","");// always add "" the first include path if( verbosity >2) { EnvironmentData::iterator loadpath=ffenvironment.find("loadpath"); EnvironmentData::iterator inc=ffenvironment.find("includepath"); if( loadpath != ffenvironment.end()) { show("\nload path : ",loadpath->second, "\n \t "); cout <<"(.)"<second, "\n \t "); cout <<"(.)"<10) cout << " -- GetEnvironment: verbosity is set to " << verbosity << endl; // } } void EnvironmentLoad() { EnvironmentData::iterator toload=ffenvironment.find("load"); if( toload != ffenvironment.end()) for (OneEnvironmentData::iterator i=toload->second.begin(); i != toload->second.end(); ++i) { if(verbosity) cout << "PreEnv load :"<< *i << endl; load(*i); } } // from ffapi to env. F. Hecht .. #include "ffapi.hpp" #include #include #ifdef _WIN32 #include #else #include #endif namespace ffapi { // to change to tmp dir for exec ... long chtmpdir() { char tmp[256]; #ifdef _WIN32 strcpy(tmp,"c:\\Temp"); if (GetEnvironmentVariable("TEMP", tmp, 256) > 0); #else strcpy(tmp,"/tmp/"); #endif if(verbosity>2) std::cout << " Change to " << endl; return chdir(tmp); } bool ff_justcompile=false; bool ff_ch2edpdtmpir=0; void ifchtmpdir() { if(ff_ch2edpdtmpir) { } } } #ifdef TESTMAIN long verbosity=50; EnvironmentData environment; int main() { GetEnvironment(); return 0; } } #endif freefem++-3.61-1/src/fflib/lgmesh3.hpp000644 000767 000024 00000003126 13256636774 017551 0ustar00hechtstaff000000 000000 #ifndef LGMESH3_HPP #define LGMESH3_HPP // 3d real (2d equivalent at [[file:problem.hpp::pferbase]]) typedef FEbase * pf3rbase ; // <> typedef FEbaseArray * pf3rbasearray ; // <> typedef pair pf3r ; // <> typedef pair pf3rarray ; // <> // 3d complex (2d equivalent at [[file:problem.hpp::pfecbase]]) typedef FEbase * pf3cbase ; // < typedef FEbaseArray * pf3cbasearray ; // <> typedef pair pf3c ; // <> typedef pair pf3carray ; // <> // fin bool isSameMesh(const list & largs,const void * Thu,const void * Thv,Stack stack) ; // true => VF type of Matrix //bool isSameMesh(const list & largs,const Mesh * Thu,const Mesh * Thv,Stack stack) ; inline C_F0 CCastToR(const C_F0 & f){ return C_F0(atype()->CastTo(f),atype());} inline bool BCastToR(const C_F0 & f){ return atype()->CastingFrom(f.left());} inline C_F0 CCastToC(const C_F0 & f){ return C_F0(atype()->CastTo(f),atype());} inline bool BCastToC(const C_F0 & f){ return atype()->CastingFrom(f.left());} template inline Expression CastTo(const C_F0 & f) { return atype()->CastTo(f);} // <> template inline bool BCastTo(const C_F0 & f) { return atype()->CastingFrom(f.left());} inline void Check(bool v,const char * mess) { if (!v) { cerr << " Error " << mess ; throw(ErrorExec(mess,1)); } } #endif freefem++-3.61-1/src/fflib/lgfem.hpp000644 000767 000024 00000067071 13256636774 017312 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ // ATTENTION pfes est la classe qui modelise un pointeur // sur un FESpace (donc un espace d'element fini // mais si la maillage change alors // l'espace change // cf la fonction set qui reconstruit FESpace #ifndef lgfem_hpp_ #define lgfem_hpp_ extern Block *currentblock; void init_lgmat(); // initialisation for sparse mat functionnallity class v_fes; class v_fes3; typedef v_fes *pfes; typedef v_fes3 *pfes3; namespace Fem2D { class Mesh3; } using Fem2D::Mesh; using Fem2D::Mesh3; typedef const Mesh * pmesh; typedef const Mesh3 * pmesh3; using Fem2D::FESpace; using Fem2D::TypeOfFE; using Fem2D::R; // typedef double R; namespace { using namespace Fem2D; using Fem2D::Vertex; class lgVertex { public: typedef double R; CountPointer pTh; Vertex *v; void Check() const { if (!v || !pTh) { ExecError("Too bad! Unset Vertex!"); } } void init() { v=0;pTh.init();} lgVertex(const Mesh * Th,long kk): pTh(Th),v( &(*pTh)(kk)) {} lgVertex(const Mesh * Th,Vertex * kk): pTh(Th),v(kk) {} operator int() const { Check(); return (* pTh)(v);} operator R2*(){ Check(); return v;} R x() const {Check() ; return v->x;} R y() const {Check() ; return v->y;} // R z() const {Check() ; return v->z;} long lab() const {Check() ; return v->lab;} void destroy() {pTh.destroy();} }; class lgElement { public: struct Adj {// const Mesh *pTh; Triangle *k; Adj(const lgElement & pp) : pTh(pp.pTh),k(pp.k) {} lgElement adj(long & e) const { int ee; ffassert(pTh && k && e >=0 && e < 3 ); long kk=pTh->ElementAdj((*pTh)(k),ee=e); e=ee; return lgElement(pTh,kk);} }; CountPointer pTh; Triangle *k; lgElement(): k(0) {} void Check() const { if (!k || !pTh) { ExecError("Unset Triangle,Sorry!"); } } void init() { k=0;pTh.init();} void destroy() {pTh.destroy();} lgElement(const Mesh * Th,long kk): pTh(Th),k( &(*Th)[kk]) {} lgElement(const Mesh * Th,Triangle * kk): pTh(Th),k(kk) {} operator int() const { Check(); return (* pTh)(k);} lgVertex operator [](const long & i) const { Check(); return lgVertex(pTh,&(*k)[i]);} long lab() const {Check() ; return k ? k->lab : LONG_MIN;} double area() const {Check() ; return k->area ;} long n() const { return k ? 3: 0 ;} bool operator==(const lgElement & l) const { return pTh==l.pTh && k == l.k;} bool operator!=(const lgElement & l) const { return pTh!=l.pTh || k != l.k;} bool operator<(const lgElement & l) const { return pTh==l.pTh && k pTh; BoundaryEdge *k; lgBoundaryEdge(): k(0) {} void Check() const { if (!k || !pTh) { ExecError("Unset BoundaryEdge,Sorry!"); } } void init() { k=0;pTh.init();} void destroy() {pTh.destroy();} lgBoundaryEdge(const Mesh * Th,long kk): pTh(Th),k( &(*pTh).be(kk)) {} lgBoundaryEdge(const Mesh * Th,BoundaryEdge * kk): pTh(Th),k(kk) {} lgBoundaryEdge(const BE & be,long kk): pTh(be.p),k( &(*pTh).be(kk)) {} lgBoundaryEdge(const BE & be,BoundaryEdge * kk): pTh(be.p),k(kk) {} operator int() const { Check(); return (* pTh)(k);} lgVertex operator [](const long & i) const { Check(); return lgVertex(pTh,&(*k)[i]);} long lab() const {Check() ; return k ? k->lab : 0;} double length() const {Check() ; return k->length() ;} long n() const { return k ? 2: 0 ;} lgElement Element() const {Check() ;int ee; return lgElement(pTh,(*pTh).BoundaryElement((*pTh)(k),ee));} long EdgeElement() const {Check() ;int ee; (*pTh).BoundaryElement((*pTh)(k),ee);return ee;} }; } // end namespace blanc void GetPeriodic(const int d,Expression perio, int & nbcperiodic , Expression * &periodic); bool BuildPeriodic( int nbcperiodic, Expression *periodic, const Mesh &Th,Stack stack, int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe); // <> uses [[file:~/ff/src/femlib/RefCounter.hpp::RefCounter]] class v_fes : public RefCounter { public: typedef ::pfes pfes; typedef ::FESpace FESpace; static const int d=2; const int N; const pmesh* ppTh; // adr du maillage CountPointer pVh; Stack stack; // the stack is use whith periodique expression int nbcperiodic; Expression *periodic; operator FESpace * () { throwassert( d==2); if ( !pVh || *ppTh != &pVh->Th ) pVh=CountPointer(update(),true); return pVh ;} FESpace * update() ; v_fes(int NN,const pmesh* t,Stack s, int n,Expression *p) : N(NN), ppTh(t),pVh(0),stack(s), nbcperiodic(n),periodic(p) {} v_fes(int NN,const v_fes *f,Stack s,int n,Expression *p) : N(NN),ppTh(f->ppTh),pVh(0),stack(s), nbcperiodic(n),periodic(p) {} void destroy(){ ppTh=0;pVh=0; delete this;} virtual ~v_fes() {} bool buildperiodic(Stack stack,int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) ; virtual FESpace * buildupdate(int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) =0; virtual FESpace * buildupdate() =0; }; class v_fes3 : public RefCounter { public: typedef pfes3 pfes; typedef FESpace3 FESpace; static const int d=3; const int N; const pmesh3* ppTh; // adr du maillage CountPointer pVh; Stack stack; // the stack is use whith periodique expression int nbcperiodic; Expression *periodic; operator FESpace3 * () { throwassert( d==3); if ( !pVh || *ppTh != &pVh->Th ) pVh=CountPointer(update(),true); return pVh ;} FESpace3 * update() ; v_fes3(int NN,const pmesh3* t,Stack s, int n,Expression *p) : N(NN), ppTh(t),pVh(0),stack(s), nbcperiodic(n),periodic(p) {} v_fes3(int NN,const v_fes3 *f,Stack s,int n,Expression *p) : N(NN),ppTh(f->ppTh),pVh(0),stack(s), nbcperiodic(n),periodic(p) {} // void destroy(){ ppTh=0;pVh=0; delete this;} virtual ~v_fes3() {} bool buildperiodic(Stack stack, KN & ndfe) ; virtual FESpace3 * buildupdate( KN & ndfe) { return 0;} virtual FESpace3 * buildupdate() {return 0;}; }; class pfes_tef : public v_fes { public: const TypeOfFE * tef ; pfes_tef(const pmesh* t,const TypeOfFE * tt,Stack s=NullStack, int n=0,Expression *p=0 ) : v_fes(tt->N,t,s,n,p),tef(tt) { operator FESpace * ();} FESpace * buildupdate(int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) { return *ppTh ? new FESpace(**ppTh,*tef,nbdfv,(int *) ndfv,nbdfe,(int*)ndfe): 0;} FESpace * buildupdate() { return *ppTh ? new FESpace(**ppTh,*tef):0 ;} }; class pfes_tefk : public v_fes { public: const TypeOfFE ** tef ; const int k; pfes_tefk(const pmesh* t,const TypeOfFE ** tt,int kk,Stack s=NullStack,int n=0,Expression *p=0 ) : v_fes(sum(tt,&Fem2D::TypeOfFE::N,kk),t,s,n,p),tef(tt),k(kk) { // cout << "pfes_tefk const" << tef << " " << this << endl; operator FESpace * ();} FESpace * buildupdate() { // cout << "pfes_tefk upd:" << tef << " " << this << endl; assert(tef); return *ppTh? new FESpace(**ppTh,tef,k):0;} virtual ~pfes_tefk() { delete [] tef;} FESpace * buildupdate(int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) { assert(tef); return *ppTh? new FESpace(**ppTh,tef,k,nbdfv,ndfv,nbdfe,ndfe):0 ;} }; class pfes3_tef : public v_fes3 { public: const TypeOfFE3 * tef ; pfes3_tef(const pmesh3* t,const TypeOfFE3 * tt,Stack s=NullStack, int n=0,Expression *p=0 ) : v_fes3(tt->N,t,s,n,p),tef(tt) { operator FESpace3 * ();} FESpace3 * buildupdate( KN & ndfe) { return *ppTh ? new FESpace3(**ppTh,*tef,ndfe.size()/2,ndfe):0; } FESpace3 * buildupdate() { return *ppTh? new FESpace3(**ppTh,*tef):0;} }; class pfes3_tefk : public v_fes3 { public: const TypeOfFE3 ** tef ; const int k; KN< GTypeOfFE const *> atef; GTypeOfFESum tefs; static int sum(const Fem2D::TypeOfFE3 ** l,int const Fem2D::TypeOfFE3::*p,int n) { int r=0; for (int i=0;i*p; return r; } pfes3_tefk(const pmesh3* t,const Fem2D::TypeOfFE3 ** tt,int kk,Stack s=NullStack,int n=0,Expression *p=0 ) : v_fes3(sum((const Fem2D::TypeOfFE3 **)tt,&Fem2D::TypeOfFE3::N,kk),t,s,n,p), tef(tt),k(kk), atef(kk,tt),tefs(atef) { // cout << "pfes_tefk const" << tef << " " << this << endl; operator FESpace3 * (); } FESpace3 * buildupdate() { // cout << "pfes_tefk upd:" << tef << " " << this << endl; //assert(tef); return *ppTh? new FESpace3(**ppTh,tefs):0;} virtual ~pfes3_tefk() { delete [] tef;} FESpace3 * buildupdate(KN & ndfe) { return *ppTh? new FESpace3(**ppTh,tefs,ndfe.size()/2,ndfe):0; } }; class pfes_fes : public v_fes { public: pfes * Vh; int n; pfes_fes( pfes * Vhh, int nn,Stack s=NullStack,int n=0,Expression *p=0) :v_fes((**Vhh).N*nn,static_cast(*Vhh),s,n,p), Vh(Vhh),n(nn) { operator FESpace * () ;}; FESpace * buildupdate() { return new FESpace(*(FESpace *)**Vh,n); } FESpace * buildupdate(int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) { InternalError(" No way to define a periodic BC in this case: tensorisation of FEspace "); // return new FESpace(***Vh,n,nbdfv,ndfv,nbdfe,ndfe); } }; template class FEbase; // <> template class FEcomp { public: typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; friend class FEbase; FEbase * base; int comp; FEcomp(FEbase * b,int c) :base(b),comp(c) {}; private: // rule of programming FEcomp(const FEcomp &); void operator= (const FEcomp &); }; template class FEbase { public: typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; v_fes *const*pVh; // pointeur sur la variable stockant FESpace; KN * xx; // value CountPointer Vh; // espace courant KN *x() {return xx;} FEbase(const pfes *ppVh) :pVh(ppVh), xx(0),Vh(0) {} ~FEbase() { delete xx;} void destroy() { // cout << "~FEbase destroy " << this << endl; delete this;} void operator=( KN *y) { Vh=**pVh; throwassert((bool) Vh); if (xx) delete xx;xx=y; ffassert( y->N() == Vh->NbOfDF); } void operator=(KN_ & y) { Vh=**pVh; throwassert((bool) Vh); if (xx) { // resize if need if(xx->N() != Vh->NbOfDF) delete xx;xx=0; } if(!xx) xx= new KN(Vh->NbOfDF) ; ffassert(SameShape(y,*xx)); *xx=y; } FESpace * newVh() { throwassert(pVh ); const pfes pp= *pVh; // cout << pVh << " " << *pVh << endl; return *pp; } operator FESpace &() { throwassert(Vh); return *Vh;} private: // rule of programming FEbase(const FEbase &); void operator= (const FEbase &); }; template class FEbaseArrayKn { public:// for eigen value int N; FEbaseArrayKn(int NN):N(NN){} virtual void set(int i,KN_ ) =0; virtual KN* get (int i) const = 0; // for P. Jolivet virtual void resize(int i) = 0; // for P. Jolivet }; template class FEbaseArray :public FEbaseArrayKn { public: typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; // int N; FEbase **xx; FEbaseArray(const pfes *ppVh,int NN) :FEbaseArrayKn(NN),xx(new FEbase * [std::max(NN, 1)]) { for (int i=0;iN, 1);i++) xx[i]=new FEbase(ppVh); } ~FEbaseArray() { // cout << " ~FEbaseArray " << endl; for (int i=0;iN, 1);i++) xx[i]->destroy(); delete [] xx;} void destroy() { //cout << " destroy ~FEbaseArray " << endl; delete this;} FEbase** operator[](int i) const { if(xx==0 || i <0 || i>=this->N) ExecError("Out of bound in FEbaseArray"); return xx+i;} void resize(int i) { if(xx != 0 && i > 0 && i != this->N) { FEbase** yy = new FEbase*[i]; if(i > this->N) { for(unsigned int j = 0; j < std::max(this->N, 1); ++j) yy[j] = xx[j]; for(unsigned int j = std::max(this->N, 1); j < i; ++j) yy[j] = new FEbase(xx[0]->pVh); } else { for(unsigned int j = 0; j < i; ++j) yy[j] = xx[j]; for(unsigned int j = i; j < this->N; ++j) xx[j]->destroy(); } FEbase **oldXx = this->xx; this->xx = yy; delete [] oldXx; this->N = i; } } void set(int i,KN_ v){ **(operator[](i))=v;} KN* get(int i)const { return (**(operator[](i))).xx; } private: // rule of programming FEbaseArray(const FEbaseArray &); void operator= (const FEbaseArray &); }; void GetPeriodic(const int d,Expression perio, int & nbcperiodic , Expression * &periodic); int GetPeriodic(Expression bb, Expression & b,Expression & f); int GetPeriodic(Expression bb, Expression & b,Expression & f1,Expression & f2); C_F0 NewFEarray(const char * id,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim); C_F0 NewFEarray(ListOfId * ids,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim); C_F0 NewFEvariable(const char * id,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim); C_F0 NewFEvariable(ListOfId * ids,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim); inline C_F0 NewFEvariable(const char * id,Block *currentblock,C_F0 & fespacetype,bool cplx,int dim) { CC_F0 init;init=0;return NewFEvariable( id,currentblock,fespacetype, init, cplx,dim);} inline C_F0 NewFEvariable(ListOfId * ids,Block *currentblock,C_F0 & fespacetype,bool cplx,int dim) { CC_F0 init;init=0;return NewFEvariable( ids,currentblock,fespacetype, init,cplx,dim);} size_t dimFESpaceImage(const basicAC_F0 &args) ; aType typeFESpace(const basicAC_F0 &args) ; template > class E_FEcomp : public E_F0mps { public: // typedef FEbase FE; typedef vv_fes v_fes; typedef pair< FE * ,int> Result; Expression a0; const int comp, N; AnyType operator()(Stack s) const { return SetAny( Result( *GetAny((*a0)(s)),comp) );} E_FEcomp(const C_F0 & x,const int cc,int NN) : a0(x.LeftValue()),comp(cc),N(NN) {if(x.left()!=atype() ) cout << "E_FEcomp: Bug " << *x.left() << " != " << *atype() << " case " <() &&a0);} operator aType () const { return atype();} }; //typedef double R; typedef pair< FEbase * ,int> aFEvarR; typedef pair< FEbaseArray * ,int> aFEArrayR; typedef pair< FEbase * ,int> aFEvarC; template class interpolate_f_X_1 : public OneOperator { public: // to interpolate f o X^{-1} typedef FEbase * pferbase ; typedef FEbaseArray * pferbasearray ; typedef pair pfer ; typedef pair pferarray ; class type {}; class CODE : public E_F0mps { public: Expression f; Expression x,y; CODE(const basicAC_F0 & args) : f(args[0].LeftValue()) { const E_Array * X(dynamic_cast(args[1].LeftValue())); if ( ! X || X->size() != 2) { CompileError("array of 2 double x,y f([xx,yy]) = ... "); } x=to((*X)[0]); y=to((*X)[1]); assert(f && x && y ); } AnyType operator()(Stack) const { ExecError("No evaluation"); return Nothing;} operator aType () const { return atype();} }; // end class CODE E_F0 * code(const basicAC_F0 & args) const { return new CODE(args);} interpolate_f_X_1(): OneOperator(map_type[typeid(type).name()],map_type[typeid(pfer).name()],map_type[typeid(E_Array).name()]) {} }; inline FESpace * v_fes::update() { assert(d==2); if(!*ppTh) return 0; if (nbcperiodic ) { assert(periodic); const Mesh &Th(**ppTh); KN ndfv(Th.nv); KN ndfe(Th.neb); int nbdfv,nbdfe; bool ret = buildperiodic(stack,nbdfv,ndfv,nbdfe,ndfe); return ret ? buildupdate(nbdfv,ndfv,nbdfe,ndfe) : buildupdate(); } else return buildupdate(); } inline FESpace3 * v_fes3::update() { assert(d==3); if(!*ppTh) return 0; if (nbcperiodic ) { assert(periodic); //const Mesh3 &Th(**ppTh); // KN ndfv(Th.nv); KN ndfe; // int nbdfv,nbdfe; bool ret = buildperiodic(stack,ndfe); return ret ? buildupdate(ndfe) : buildupdate(); } else return buildupdate(); } template A Build(B b) { return A(b);} class TabFuncArg { public: typedef double R; typedef Fem2D::R2 R2; Stack s; int nb; Expression * e; void eval(R *v) const { for (int i=0;i( (*e[i])(s)); // cout <<" (" << i << " " << *v << ") "; } else v[i] = 0; } R2 eval_X() const { return R2(GetAny( (*e[nb-2])(s)),GetAny( (*e[nb-1])(s))); } void eval_2(R *v) const { for (int i=0;i( (*e[i])(s)); else v[i] = 0; } TabFuncArg(Stack ss,int n) : s(ss),nb(n),e(new Expression[n]) {} void operator=(int j) { ffassert(j==0); for (int i=0;i class E_F_StackF0F0opt2 :public E_F0mps { public: typedef AnyType (*func)(Stack,Expression ,Expression ) ; func f; Expression a0,a1; E_F_StackF0F0opt2(func ff,Expression aa0,Expression aa1) : f(ff),a0(aa0),a1(aa1) { const E_FEcomp * e= dynamic_cast*>(a0); if ( e && e->N != 1) { cerr << " err interpolation of no scalar FE function componant ("<< e->comp<< " in 0.." << e->N<< ") << with scalar function \n" ; CompileError("interpolation of no scalar FE function componant with scalar function "); } /* // inutil car a0 est un composante d'un vecteur ???? // pour l'instant on a juste une erreur a l'execution // et non a la compilation. if (a0->nbitem() != a1->nbitem() ) { // bofbof cerr << " err interpolation of no scalar FE function ("<< a0->nbitem() << " != " << a1->nbitem() << ") << with scalar function \n" ; CompileError("interpolation of no scalar FE function with scalar function "); } */ deque > ll; MapOfE_F0 m; size_t top = currentblock->OffSet(0), topbb=top; // FH. bofbof ??? int ret =aa1->Optimize(ll, m, top); a1 = new E_F0_Optimize(ll,m,ret); currentblock->OffSet(top-topbb); } AnyType operator()(Stack s) const {return (*f)(s, a0 , a1) ;} }; template inline ostream & ShowBound(const KN & y,ostream & f) { f << " -- vector function's bound " << y.min() << " " << y.max() ; return f; } template<> inline ostream & ShowBound(const KN & y,ostream & f) { f << " -- vector function's bound : (no complex Value) " ; return f; } template class Op3_K2R : public ternary_function { public: class Op : public E_F0mps { public: Expression a,b,c; Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} AnyType operator()(Stack s) const { R xx(GetAny((*b)(s))); R yy(GetAny((*c)(s))); MeshPoint & mp = *MeshPointStack(s),mps=mp; mp.set(xx,yy,0.0); AnyType ret = (*a)(s); mp=mps; return ret;} }; }; template class Op4_K2R : public quad_function { public: class Op : public E_F0mps { public: Expression a,b,c,d; Op(Expression aa,Expression bb,Expression cc,Expression dd) : a(aa),b(bb),c(cc),d(dd) {} AnyType operator()(Stack s) const { //cout <<"class Op4_K2R : public quad_function" << endl; R xx(GetAny((*b)(s))); R yy(GetAny((*c)(s))); R zz(GetAny((*d)(s))); MeshPoint & mp = *MeshPointStack(s),mps=mp; mp.set(xx,yy,zz); AnyType ret = (*a)(s); mp=mps; return ret;} }; }; template class E_set_fev3: public E_F0mps { public: typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; E_Array aa; Expression ppfe; bool optimize, optimizecheck; vector where_in_stack_opt; Expression optiexp0,optiexpK; E_set_fev3(const E_Array * a,Expression pp) ; AnyType operator()(Stack) const ; operator aType () const { return atype();} }; template class E_set_fev: public E_F0mps {public: const int dim; E_Array aa; Expression ppfe; bool optimize,optimizecheck; vector where_in_stack_opt; Expression optiexp0,optiexpK; E_set_fev(const E_Array * a,Expression pp,int ddim=2) ; AnyType operator()(Stack) const ; AnyType Op2d(Stack) const ; AnyType Op3d(Stack) const ; operator aType () const { return atype();} }; bool InCircularList(const int *p,int i,int k); template int numeroteclink(KN_ & ndfv) ; // for ... vectorial FE array .. template class E_FEcomp_get_elmnt_array :public E_F0 { public: typedef FEbaseArray * pfekbasearray ; typedef FEbase * pfekbase ; typedef pair pfek ; typedef pair pfekarray ; typedef pfek R; typedef pfekarray A; typedef long B; typedef FEbaseArray CFE; typedef E_FEcomp E_KFEArray; Expression a0,a1; const E_KFEArray * a00; const int comp, N; E_FEcomp_get_elmnt_array(Expression aa0,Expression aa1,int compp,int NN,const E_KFEArray * aa00) : a0(aa0),a1(aa1),a00(aa00),comp(compp),N(NN) {} AnyType operator()(Stack s) const {return SetAny( get_element( GetAny((*a0)(s)) , GetAny((*a1)(s)) ) );} bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent();} // }; template class OneOperator2_FE_get_elmnt : public OneOperator { // /// Add("[","",new OneOperator2_FEcomp(get_element)); // not used ... // Add("[","",new OneOperator2_(get_element)); typedef FEbase * pfekbase ; typedef FEbaseArray * pfekbasearray ; typedef pair pfek ; typedef pair pfekarray ; typedef pfek R; typedef pfekarray A; typedef long B; typedef E_FEcomp_get_elmnt_array CODE; typedef FEbaseArray CFE; typedef E_FEcomp E_KFEArray; typedef E_FEcomp E_KFEi; aType t0,t1; // return type type de f, f(t1, t2) public: E_F0 * code(const basicAC_F0 & args) const { const E_KFEArray * afe=dynamic_cast (args[0].LeftValue()); // cout << " build xxx " << afe << " " << *args[0].left() << endl; //afe=0;// E_KFEi n'est pas le bon type on mame le vieux code ????? ffassert(afe); return new CODE(t0->CastTo(args[0]),t1->CastTo(args[1]),afe->comp,afe->N,afe); } OneOperator2_FE_get_elmnt(): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()]), t0( map_type[typeid(A).name()] ),t1(map_type[typeid(B).name()] ){} }; template struct FFset3 { typedef KK K; typedef vv_fes v_fes; typedef vv_fes *pfes; typedef FEbase ** R; typedef R A; typedef pfes* B; typedef CC C; typedef Expression MC; static Expression Clone(Expression e){return e;} static bool Check(MC l) {return true;} static void f(KN *x,MC a,A pp,Stack stack) { CC at= GetAny((*a)(stack)); *x = at;} }; template class init_FE_eqarray : public OneOperator { public: // ** R; typedef R A; typedef pfes* B; typedef typename FF::C C; typedef typename FF::MC MC; class CODE :public E_F0{ public: Expression a0,a1; MC a2; CODE(Expression aa0,Expression aa1,Expression aa2) : a0(aa0),a1(aa1),a2(FF::Clone(aa2)) {ffassert(FF::Check(a2));} AnyType operator()(Stack s) const { AnyType aa0= (*a0)(s); AnyType aa1= (*a1)(s); A pp = GetAny(aa0); B a= GetAny(aa1); *pp=new FEbase(a); KN *x = (**pp).x(); if ( !x) { // defined FESpace * Vh= (*pp)->newVh(); throwassert( Vh); **pp = x = new KN(Vh->NbOfDF); *x=K(); } int n= x->N(); FF::f(x,a2,pp,s); int nn= x->N(); ffassert(n==nn); return aa0; } virtual size_t nbitem() const {return a2->nbitem(); } bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent();} // }; init_FE_eqarray(int ppref): OneOperator( map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()]) {pref=ppref;} E_F0 * code(const basicAC_F0 & args) const { return new CODE(args[0],args[1],map_type[typeid(C).name()]->CastTo(args[2])); } }; #endif freefem++-3.61-1/src/fflib/P1IsoValue.hpp000644 000767 000024 00000002421 13256636774 020134 0ustar00hechtstaff000000 000000 // // P1IsoValue.h // ff // // Created by Frédéric Hecht on 07/03/2014. // // /* 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 */ #ifndef __ff__P1IsoValue__ #define __ff__P1IsoValue__ #include #include #include #include "ufunction.hpp" namespace Fem2D { #include "R3.hpp" } int IsoLineK(double *f,Fem2D::R3 *Q, double eps); int IsoLineK(double *f,Fem2D::R2 *Q, double eps); int UnderIso(double *f,Fem2D::R3 Q[3][4] ,double vol[3], double eps); int UnderIso(double *f,Fem2D::R2 Q[2][3] ,double area[2], double eps); #endif /* defined(__ff__P1IsoValue__) */ freefem++-3.61-1/src/fflib/array_resize.hpp000644 000767 000024 00000001403 13256636774 020702 0ustar00hechtstaff000000 000000 template struct Resize{ T *v; Resize( T * vv) : v(vv) {} }; template T *resize1(const Resize & t,const long &n) { t.v->resize(n); return t.v; } template T *resizeandclean1(const Resize & t,const long &n) { int nn= t.v->N(); // old size for (int i=n;iresize(n); for (int i=nn;i T *resize2(const Resize & t,const long &n, const long & m) { t.v->resize(n,m); return t.v; } template Resize to_Resize( T *v){ return Resize(v);} template struct Resize1{ T v; Resize1( T vv) : v(vv) {} }; template Resize1 to_Resize1( T v){ return Resize1(v);} freefem++-3.61-1/src/fflib/lex.hpp000644 000767 000024 00000012071 13312446271 016756 0ustar00hechtstaff000000 000000 /// \file // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef MY_LEX_HPP_ #define MY_LEX_HPP_ // with New version of macro expansion more simple and more stable // FH jan 2005 #include #include "environment.hpp" extern bool lexdebug; extern long mpisize,mpirank; /// <> class mylex : public CodeAlloc { public: typedef const char * Key; typedef pair Value; struct MacroData{ deque d; int l; string f;};// f is not a pointeur (pb of delete) // Warning f not a pointeur because // struct Keyless : binary_function { bool operator()(const Key& x, const Key& y) const{ return strcmp(x,y)<0;} }; typedef map MapMotClef; typedef map MapMacroDef; typedef map MapMacroParam; typedef MapMotClef::const_iterator const_iterator; typedef MapMotClef::iterator iterator; public: int linenumber,charnumber; list ffincludedir; // <> typedef list::iterator Iffincludedir; typedef list::const_iterator ICffincludedir; private: bool firsttime; int level; char buf[1024]; int typetoken; bool echo; stack strdata; struct xxxx { int l; istream * f; const string * filename; // <> int macroarg; istream * nf; xxxx() : l(0), f(0) , filename(0),macroarg(0),nf(0) {} void open(mylex *lexx,const char * ff) ; void readin(mylex *lexx,const string & s,const string *name=0,int macroargg=0); void close() ; }; friend struct mylex::xxxx; xxxx pilesource[100]; istream & source() const {return * pilesource[level].f;} const string file() const { return pilesource[level].filename? *pilesource[level].filename : string("") ;} ostream & cout ; // <> MapMotClef MotClef; list *listMacroDef; list *listMacroParam; public: mylex(ostream & out,bool eecho=true,const KN *pargs=0 ); string token() const; void print(ostream &f) const; /// This is the main [[file:../lglib/lg.ypp::yylex]] entry point from the grammar. Implemented in /// [[file:lex.cpp::mylex_scan]] int scan(int lvl=0); int lineno(){return linenumber;} char * YYText() { return buf;} void dump(ostream & f ) ; void erreur(const char * s) { cerr << " Error line number" <> [[file:lex.cpp::mylex_input_string]] bool InMotClef(const char *b,aType &t,int &r)const; void Add(Key k,int r,aType t); void Check(bool b,Key k,const char * s) { if(b) {cout <<"Add " << s << " null: " << k << endl; CompileError();}} void Add(Key k,int i) ;// {Check(!i,k,"mot clef");Add(k,i,0); } void Add(Key k,aType t);// {Check(!t,k,"type");Add(k,TYPE,t); } void AddF(Key k,aType t);// {Check(!t,k,"type");Add(k,FUNCTION,t); } void AddSpace(Key k,aType t);// {Check(!t,k,"type");Add(k,FUNCTION,t); } const char * filename() const { if ( level >=0 ) return pilesource[level].filename ? pilesource[level].filename->c_str() : " -- in macro -- "; return "-- unkown --";} void input(const char * filename) ; void input(const string &str,const string *name=0,int lg=0); bool close() ; char * newcopy(const char * s) { char *r(new char [strlen(s)+1]); strcpy(r, s); strdata.push(r); return r; } ostream & ShowStack(ostream & f); ~mylex(); private: int basescan(); int basescanprint(int lvl=0); // with print if lvl =0 int EatCommentAndSpace(string *data=0); int scan1(); bool SetMacro(int &ret); bool CallMacro(int &ret); bool IFMacro(int &ret); bool AddMacro(string m,string def) ; char * match(int i); void ErrorScan(const char * s) { cerr << "\n" ; ShowStack(cerr); throw(ErrorCompile(s,lineno(),YYText() ) );} } ; mylex * Newlex( ostream & out,bool =true,KN * args=0); void Destroylex(mylex * m); /// <> This pointer is allocated in [[file:global.cpp::zzzfff]] and initialized in /// [[file:../lglib/lg.ypp::zzzfff]] extern mylex *zzzfff; #endif freefem++-3.61-1/src/fflib/mt19937ar.cpp000755 000767 000024 00000014320 13256636774 017563 0ustar00hechtstaff000000 000000 /* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ #include /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfUL /* constant vector a */ #define UPPER_MASK 0x80000000UL /* most significant w-r bits */ #define LOWER_MASK 0x7fffffffUL /* least significant r bits */ static unsigned long mt[N]; /* the array for the state vector */ static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializes mt[N] with a seed */ void init_genrand(unsigned long s) { mt[0]= s & 0xffffffffUL; for (mti=1; mti> 30)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ mt[mti] &= 0xffffffffUL; /* for >32 bit machines */ } } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ /* slight change for C++, 2004/2/26 */ void init_by_array(unsigned long init_key[], int key_length) { int i, j, k; init_genrand(19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key_length) j=0; } for (k=N-1; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } /* generates a random number on [0,0xffffffff]-interval */ unsigned long genrand_int32(void) { unsigned long y; static unsigned long mag01[2]={0x0UL, MATRIX_A}; /* mag01[x] = x * MATRIX_A for x=0,1 */ if (mti >= N) { /* generate N words at one time */ int kk; if (mti == N+1) /* if init_genrand() has not been called, */ init_genrand(5489UL); /* a default initial seed is used */ for (kk=0;kk> 1) ^ mag01[y & 0x1UL]; } for (;kk> 1) ^ mag01[y & 0x1UL]; } y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL]; mti = 0; } y = mt[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return y; } /* generates a random number on [0,0x7fffffff]-interval */ long genrand_int31(void) { return (long)(genrand_int32()>>1); } /* generates a random number on [0,1]-real-interval */ double genrand_real1(void) { return genrand_int32()*(1.0/4294967295.0); /* divided by 2^32-1 */ } /* generates a random number on [0,1)-real-interval */ double genrand_real2(void) { return genrand_int32()*(1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on (0,1)-real-interval */ double genrand_real3(void) { return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on [0,1) with 53-bit resolution*/ double genrand_res53(void) { unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; return(a*67108864.0+b)*(1.0/9007199254740992.0); } /* These real versions are due to Isaku Wada, 2002/01/09 added */ /* int main(void) { int i; unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4; init_by_array(init, length); printf("1000 outputs of genrand_int32()\n"); for (i=0; i<1000; i++) { printf("%10lu ", genrand_int32()); if (i%5==4) printf("\n"); } printf("\n1000 outputs of genrand_real2()\n"); for (i=0; i<1000; i++) { printf("%10.8f ", genrand_real2()); if (i%5==4) printf("\n"); } return 0; } */ freefem++-3.61-1/src/fflib/ffapi.cpp000644 000767 000024 00000022640 13256636774 017271 0ustar00hechtstaff000000 000000 /// \file /// ====================================================================== /// Written by Antoine Le Hyaric /// Laboratoire Jacques-Louis Lions /// Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France /// http://www.ljll.math.upmc.fr/lehyaric /// ====================================================================== /// 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 /// ====================================================================== /// headeralh cpp freefem start=21/01/10 upmc // Proposed FreeFem++ Application Programming Interface // ---------------------------------------------------- #ifdef WITH_PETSC #include #endif // headerfilter [[shell:headerfilter '../../ff/src/fflib/ffapi.cpp']] [[file:~/alh/bin/headerfilter]] #include "ffapi.hpp" // [[file:ffapi.hpp]] found by [[file:~/alh/bin/headerfilter]] #include #ifdef FFLANG #include "socket.hpp" #include "spawn.hpp" #include "buffer.hpp" // [[file:~/ffcs/src/buffer.hpp::Buffer]] #endif #include #include #ifndef FFLANG #include #endif #ifdef FFLANG #include "options.hpp" #include #endif #ifndef FFLANG #ifdef _WIN32 #include #endif #endif #ifndef FFLANG #ifdef PARALLELE #include "mpi.h" #endif #endif extern long verbosity ; // FFCS-specific implementations for the FF API // -------------------------------------------- /// <> defined means that FFCS is being compiled. I am fairly confident that FFCS will not be defined while /// compiling the original FF. /// Need to choose a non-zero stream number because FF will check it (as global variable ThePlotStream) #define FFAPISTREAM 1 /// if FFCS is around, we need to bufferize all communications to avoid mixing up CMD_FFG and CMD_STDOUT messages #ifdef FFLANG void bufferwrite(const char *b,const int l){ Socket::dialoglock->WAIT(); // need #include "socket.hpp" // thank to the buffering, there is only one CMD_FFG tag for multiple visualization data items. onlyffsock()<(b),l); Socket::dialoglock->Free(); } Buffer buffer(NULL,bufferwrite); // need #include "buffer.hpp" // [[file:~/ffcs/src/buffer.hpp::Buffer]] #endif // allocation/definition of all ffapi in Global.cpp namespace ffapi{ // Get a pointer to the local cin/cout (which is distinct from ffcs's stdin/stdout under Windows because each DLL owns // separate cin/cout objects). // need #include static std::istream *ffapi_cin(){return &std::cin;} static std::ostream *ffapi_cout(){return &std::cout;} static std::ostream *ffapi_cerr(){return &std::cerr;} // FFCS - ::stdout not accepted under mingw32 // need #include static FILE *ffapi_ffstdout(){return stdout;} static FILE *ffapi_ffstderr(){return stderr;} static FILE *ffapi_ffstdin(){return stdin;} static void ffapi_newplot(){} FILE *ffapi_ff_popen(const char *command, const char *type){ #ifdef FFLANG // this happens right at the begining of FF, so the socket // communication must not be started yet (only when actual // visualization data needs to be transfered). PROGRESS; return (FILE*)FFAPISTREAM; #else // need #include FILE *f= popen(command,type); if( f!=0) { // ne marche pas car ffglut plante si flux vide // int ppok=pclose(f); // f =0; // if(ppok==0) // f= popen(command,type); // else // std::cerr << " fopen ok but plose bug ! =" << ppok << "\n"; } if( f==0) { std::cerr << "Error: popen " << f << " " << command << " " << type << std::endl; exit(1); } return f; #endif } // <> static int ffapi_ff_pclose(FILE *stream){ #ifdef FFLANG // nothing to close in FFCS return 0; #else return pclose(stream); #endif } static size_t ffapi_fwriteinit(const void *ptr, size_t size, size_t nmemb,FILE *stream){ // printf() is useful for debug because it is not redirected through // the FFCS socket. But it is asynchronous with cout so it may end up // in the middle of the lines checked by test/compare. So deactivate // it by default. #ifdef DEBUG_FFAPI #ifdef FFLANG printf("debug: ffapi: using TCP sockets\n"); #else printf("debug: ffapi: using an anonymous pipe\n"); #endif // FFLANG #endif // DEBUG_FFAPI #ifdef FFLANG // Ask FFCS to analyze the visualization flux header. I could just skip this stage, but it will be useful to check // the coherency between FFCS and FF when FF evolves in the future. Socket::dialoglock->WAIT(); onlyffsock()<Free(); #endif return ff_fwrite(ptr,size,nmemb,stream); } static size_t ffapi_ff_fwrite(const void *ptr, size_t size, size_t nmemb,FILE *stream){ #ifdef FFLANG // if the ffsock pointer is null here, it means that the pointer exported from the FFCS shared library is not a // valid one (this has been the case with Windows DLLs in the past). // we won't make use of the stream, but make sure that the call from // FF is coherent with what we know. assert(stream==(FILE*)FFAPISTREAM); buffer.write(static_cast(ptr),size*nmemb); // stops the server flux at one precise point (point value expressed during a previous crash while reading server // data in the client in visudata.cpp). Use abort() to call the debugger (which can display the call stack and show // where the problematic pipe value came from). // need #include "options.hpp" if(options->AbortFFGraphicsDataAt==buffer.getpoint())abort(); // need #include #else fwrite(ptr,size,nmemb,stream); #endif return 0; } static int ffapi_ff_fflush(FILE *stream){ #ifdef FFLANG assert(stream==(FILE*)FFAPISTREAM); // we need to flush both the buffer and the socket to avoid a separate callback for flush in the buffer buffer.flush(); // ff_fflush() is used by FF only at the end of a plot, so we can use this location to send a marker for the // sequential java client to deal with one complete plot at a time. Socket::dialoglock->WAIT(); onlyffsock()<Free(); #else fflush(stream); #endif return 0; } static int ffapi_ff_ferror(FILE *stream){ #ifndef FFLANG return ferror(stream); #else return 0; #endif } static int ffapi_ff_feof(FILE *stream){ #ifndef FFLANG return feof(stream); #else return 0; #endif } static void ffapi_wintextmode(FILE *f){ #ifndef FFLANG #ifdef _WIN32 // need #include _setmode(fileno(f),O_TEXT); #endif #endif } static void ffapi_winbinmode(FILE *f){ #ifndef FFLANG #ifdef _WIN32 _setmode(fileno(f),O_BINARY); #endif #endif } static void ffapi_mpi_init(int &argc, char** &argv){ /// only call MPI_Init() if this has not already been done in [[file:~/ffcs/src/server.cpp]] #ifndef FFLANG #ifdef PARALLELE // need #include "mpi.h" int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); if(provided < MPI_THREAD_SERIALIZED) { MPI_Comm_rank(MPI_COMM_WORLD, &provided); if(provided == 0) std::cout << "MPI_THREAD_SERIALIZED not supported !" << std::endl; } #ifdef WITH_PETSCxxxxx PetscInitialize(&argc, &argv, 0, ""); #endif #endif #endif } static void ffapi_mpi_finalize(){ #ifndef FFLANG #ifdef PARALLELE #ifdef WITH_PETSCxxxxxxxx PetscFinalize(); #endif MPI_Finalize(); #endif #endif } static bool ffapi_protectedservermode(){ #ifdef FFLANG return !options->LocalClient; #else return false; #endif } // <> [[file:ffapi.hpp::init]] called by [[file:../lglib/mymain.cpp::ffapi::init]] void init(){ ffapi::cin = ffapi::ffapi_cin; ffapi::cout = ffapi::ffapi_cout; ffapi::cerr = ffapi::ffapi_cerr; ffapi::ffstdout = ffapi::ffapi_ffstdout; ffapi::ffstderr = ffapi::ffapi_ffstderr; ffapi::ffstdin = ffapi::ffapi_ffstdin; ffapi::newplot = ffapi::ffapi_newplot; ffapi::ff_popen = ffapi::ffapi_ff_popen; ffapi::ff_pclose = ffapi::ffapi_ff_pclose; // <> ffapi::fwriteinit = ffapi::ffapi_fwriteinit; ffapi::ff_fwrite = ffapi::ffapi_ff_fwrite; ffapi::ff_fflush = ffapi::ffapi_ff_fflush; ffapi::ff_ferror = ffapi::ffapi_ff_ferror; ffapi::ff_feof = ffapi::ffapi_ff_feof; ffapi::wintextmode = ffapi::ffapi_wintextmode; ffapi::winbinmode = ffapi::ffapi_winbinmode; ffapi::mpi_init = ffapi::ffapi_mpi_init; ffapi::mpi_finalize = ffapi::ffapi_mpi_finalize; ffapi::protectedservermode = ffapi::ffapi_protectedservermode; } } /// Local Variables: /// mode:c++ /// ispell-local-dictionary:"british" /// coding:utf-8 /// End: freefem++-3.61-1/src/fflib/lgmesh.hpp000644 000767 000024 00000003067 13256636774 017472 0ustar00hechtstaff000000 000000 /*! * \file * * \brief Exposed functions from lgmesh.cpp * * * \author Written by Antoine Le Hyaric * \author http://www.ljll.math.upmc.fr/lehyaric * \author Laboratoire Jacques-Louis Lions * \author Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France * * \copyright This file is part of Freefem++ * * \copyright 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. * * \copyright 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. * * \copyright 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 * * headeralh brief="Exposed functions from lgmesh.cpp" cpp default=0 dox freefem start=21/10/2013 upmc written */ // <> [[file:lgmesh.cpp::Carre]] Fem2D::Mesh * Carre_(int nx,int ny,Expression fx,Expression fy,Stack stack,int flags,KN_ lab,long reg=0); Fem2D::Mesh* Carre(int nx,int ny,Expression fx,Expression fy,Stack stack,int flags,KN_ lab,long reg=0); /*! * Local Variables: * mode:c++ * ispell-local-dictionary:"british" * coding:utf-8 * End: */ freefem++-3.61-1/src/fflib/throwassert.hpp000644 000767 000024 00000003512 13256636774 020573 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef THROWASSERT #define THROWASSERT #include //#ifdef __INTEL__ #define cerr cout //#endif #include "error.hpp" #ifdef NDEBUG #define throwassert(i) ( (void) 0) #else #define throwassert(condition) ((condition) ? ( (void) 0) : throw(ErrorAssert(#condition,__FILE__, __LINE__))) #undef assert #define assert(condition) throwassert(condition) #endif // <> an unremovable assert. According to FH, ffassert() is as a more reliable way to trap FF than assert(). #undef ffassert #define ffassert(condition) ((condition) ? ( (void) 0) : throw(ErrorAssert(#condition,__FILE__, __LINE__))) //#define AFAIRE(str) ( (cerr << " TO be Done " << str << endl), throw(ErrorAssert("AFAIRE)/TO DO (FH????",__FILE__, __LINE__))) #define AFAIRE(cmm) ( cerr << "FH: A Faire/ To Do "<< cmm << " file " << __FILE__<< " line "<< __LINE__ << endl, InternalError(cmm)) #define InternalError(message) throw(ErrorInternal(message,__LINE__,__FILE__)) #endif freefem++-3.61-1/src/fflib/error.hpp000644 000767 000024 00000007067 13256636774 017350 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef ERROR_H #define ERROR_H #include #include #include "throwassert.hpp" #include extern int TheCurrentLine; #if defined(__GNUC__) && __GNUC__+0 < 3 #include typedef istrstream istringstream ; typedef ostrstream ostringstream ; #define ENDS << '\0' #define OLDCPP 1 #else // car ostringstream n'est pas encore defin sous g++ // #include #define ENDS #endif using std::exception; extern long mpirank; class Error : public exception { public: enum CODE_ERROR { NONE, COMPILE_ERROR,EXEC_ERROR, MEM_ERROR,MESH_ERROR,ASSERT_ERROR,INTERNAL_ERROR, UNKNOWN }; private: std::string message; const CODE_ERROR code; protected: Error(CODE_ERROR c,const char * t1,const char * t2,const char * t3=0, int n=0,const char * t4=0,const char * t5=0,const char * t6=0, const char * t7=0,const char * t8=0,const char * t9=0) : message(),code(c) { using namespace std; ostringstream mess; if(t1) mess << t1; if(t2) mess << t2; if(t3) mess << t3 << n ; if(t4) mess << t4; if(t5) mess << t5; if(t6) mess << t6; if(t7) mess << t7; if(t8) mess << t8; if(t9) mess << t9; message = mess.str(); extern void ShowDebugStack(); ShowDebugStack(); if (c!=NONE && mpirank==0) cerr << message << endl; // cerr << " at exec line " << TheCurrentLine << endl; } public: virtual int errcode() const {return code;} virtual const char * what() const throw () { return message.c_str(); } virtual ~Error() throw () {} }; class ErrorCompile : public Error { public: ErrorCompile(const char * Text,int l,const char * t2="") : Error(COMPILE_ERROR,"Compile error : ",Text,"\n\tline number :",l,", ", t2) {} }; class ErrorExec : public Error { public: ErrorExec(const char * Text,int l) : Error(UNKNOWN,"Exec error : ",Text, "\n -- number :", l) {} }; class ErrorInternal : public Error { public: ErrorInternal(const char * Text,int l,const char * t2="") : Error(INTERNAL_ERROR,"Internal error : ",Text, "\n\tline :",l,", in file ", t2) {} }; class ErrorAssert : public Error { public: ErrorAssert(const char * Text,const char *file,const int line) : Error(ASSERT_ERROR,"Assertion fail : (",Text, ")\n\tline :", line,", in file ",file) {} }; class ErrorMemory : public Error { public: ErrorMemory(const char * Text,int l=0) : Error(MEM_ERROR,"Memory Error : ",Text," number: ",l) {} }; class ErrorExit : public Error { int codeexit; public: ErrorExit(const char * ,int l) : Error(NONE,"exit","(","",l,")"), codeexit(l) {} // the exit code fo freefem++ is given by l int errcode() const{return codeexit;} }; #endif freefem++-3.61-1/src/fflib/AddNewFE.h000644 000767 000024 00000006461 13256636774 017231 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ // to add Finite Element to ff++ class EConstantTypeOfFE :public E_F0 { // using namespace Fem2D; Fem2D::TypeOfFE * v; size_t N; bool isconst; public: AnyType operator()(Stack ) const { /*cout << " ()" << v << endl*/;return SetAny(v);} EConstantTypeOfFE( Fem2D::TypeOfFE * o,bool ic=true):v(o),N(v->N),isconst(ic) {assert(v); /*cout << "New constant " << o << endl;*/} size_t nbitem() const { return N ;} EConstantTypeOfFE & operator=(Fem2D::TypeOfFE * vv) { ffassert( !isconst && vv && (vv->N == N)); // same type v = vv; return *this; } operator aType () const { assert(v);return atype();} }; struct AddNewFE { AddNewFE (const char * FEname,Fem2D::TypeOfFE* tfe) { ffassert(tfe); // check Global.New(FEname, Type_Expr(atype() ,new EConstantTypeOfFE(tfe))); } }; // 3d case class EConstantTypeOfFE3 :public E_F0 { public: // using namespace Fem2D; typedef Fem2D::TypeOfFE3 * T; T v; public: AnyType operator()(Stack ) const { /*cout << " ()" << v << endl*/;return SetAny(v);} EConstantTypeOfFE3( T o):v(o) { /*cout << "New constant " << o << endl;*/} size_t nbitem() const { assert(v); if(verbosity > 2) cout << " nb item = " << v->N << endl; return v->N ;} operator aType () const { return atype();} }; Type_Expr CConstantTFE3(const EConstantTypeOfFE3::T & v); /* class EConstantTypeOfFE3 :public E_F0 { // using namespace Fem2D; Fem2D::TypeOfFE3 * v; size_t N; bool isconst; public: AnyType operator()(Stack ) const { return SetAny(v);} EConstantTypeOfFE3( Fem2D::TypeOfFE3 * o,bool ic=true):v(o),N(v->N),isconst(ic) {assert(v); //cout << "New constant " << o << endl;} size_t nbitem() const { return N ;} EConstantTypeOfFE3 & operator=(Fem2D::TypeOfFE3 * vv) { ffassert( !isconst && vv && (vv->N == N)); // same type v = vv; } operator aType () const { assert(v);return atype();} }; */ extern map TEF2dto3d; TypeOfFE * FindFE2(const char * s); struct AddNewFE3 { AddNewFE3 (const char * FEname,Fem2D::TypeOfFE3* tfe,const char * FEname2=0) { ffassert(tfe); // check Global.New(FEname, Type_Expr(atype() ,new EConstantTypeOfFE3(tfe))); if(FEname2 && strlen(FEname2)) TEF2dto3d[FindFE2(FEname2)]=tfe; } }; freefem++-3.61-1/src/fflib/PlotStream.hpp000644 000767 000024 00000022544 13256636774 020306 0ustar00hechtstaff000000 000000 /* * PlotStream.hpp * * Created by Frederic Hecht on 27/10/08. * Copyright 2008 UPMC. * */ #include #ifdef _WIN32 #include #endif #include "endian.hpp" //FFCS visualization stream redirection #include "ffapi.hpp" using Fem2D::Mesh; using Fem2D::Mesh3; namespace Fem2D { } class PlotStream { public: FILE * TheStream; PlotStream(FILE *Stream) :TheStream(Stream) { } operator bool() const { return TheStream;} // datatype mush be < 0 to have no collistion with arg number. // FFCS: <> enum datatype { dt_meshes=-1,dt_plots=-2,dt_endplot=-3,dt_meshes3=-10,dt_plots3=-11,dt_endarg=99999,dt_newplot=-5 }; //FFCS:need to send control data to FFCS at least once per plot void SendNewPlot() { ffapi::newplot();write((long )dt_newplot); set_binary_mode(); } void SendEndArgPlot() {write((long )dt_endarg); } //FFCS:redirect visualization stream void SendEndPlot() { write((long )dt_endplot);ffapi::ff_fflush(TheStream); set_text_mode() ;} void SendPlots() { write((long )dt_plots); } void SendMeshes() { write((long )dt_meshes);} void SendMeshes3() { write((long )dt_meshes3);} //FFCS: divert stream to FFCS void write(const void *data,size_t l) {ffapi::ff_fwrite(data,1,l,TheStream);} PlotStream& write(const bool& bb) {bool b=w_endian(bb);write(reinterpret_cast (&b),sizeof(bool));return *this;} PlotStream& write(const long long& bb) {long long b=w_endian(bb);write(reinterpret_cast (&b),sizeof(long long));return *this;} PlotStream& write(const long& bb) { // always write 8 bits for a long FH. long long ll=bb;ll=w_endian(ll);write(reinterpret_cast (&ll),sizeof(long long)); return *this;} PlotStream& write(const int& bb) {int b=w_endian(bb);write(reinterpret_cast (&b),sizeof(int));return *this;} PlotStream& write(const double& bb) {double b=w_endian(bb);write(reinterpret_cast (&b),sizeof(double));return *this;} PlotStream& write(const complex& bb) {return write(bb.real()),write(bb.imag());} PlotStream &write(const Fem2D::R1 & P) { return write(P.x);} PlotStream &write(const Fem2D::R2 & P) { return write(P.x),write(P.y);} PlotStream &write(const Fem2D::R3 & P) { return write(P.x),write(P.y),write(P.z);} PlotStream& write(const string& b) { int l=b.size(); write(l); write(b.data(),l); return *this; } void set_text_mode() { //FFCS:visualization stream redirection ffapi::wintextmode(TheStream); } void set_binary_mode() { //FFCS:visualization stream redirection ffapi::winbinmode(TheStream); } PlotStream & operator << (const bool& b) { return write(b); } PlotStream & operator << (const long& b) { return write(b); } PlotStream & operator << (const long long & b) { return write(b); } PlotStream & operator << (const int& b) { return write(b); } PlotStream & operator << (const double& b) { return write(b); } PlotStream & operator << (const complex& b) { return write(b); } PlotStream & operator << (const string& s) { return write(s); } PlotStream & operator << (const string* s) { ffassert(s); return write(*s); } template PlotStream & operator << (const KN_& b) { long n=b.N(); write(n); // cout << "PlotStream :<< n " << n << endl; for (int i=0;i (&b),sizeof(bool)); b=r_endian(b);return *this;} PlotStream& read( long long& b) {read(reinterpret_cast< void *> (&b),sizeof(long long)); b=r_endian(b);return *this;} PlotStream& read( long& b) { long long l; read(reinterpret_cast< void *> (&l),sizeof(long long)); l=r_endian(l); b=(long) l; if(( b-(long) l) !=0) { cout << " err err read long : error " << b << " != " << l << endl; assert( (b-(long) l)==0);} return *this;} PlotStream& read( int& b) {read(reinterpret_cast< void *> (&b),sizeof(int)); b=r_endian(b);return *this;} PlotStream& read( double& b) {read(reinterpret_cast< void *> (&b),sizeof(double)); b=r_endian(b);return *this;} PlotStream &read( complex &C) { double re,im; read(re); read(im); C=complex(re,im); return *this;} PlotStream &read( Fem2D::R1 & P) { return read(P.x);} PlotStream &read( Fem2D::R2 & P) { return read(P.x),read(P.y);} PlotStream &read( Fem2D::R3 & P) { return read(P.x),read(P.y),read(P.z);} PlotStream& read( string& b) { int l; read(l); b.resize(l); read(& (b[0]),l); return *this; } PlotStream & operator >> ( bool& b) { return read(b); } PlotStream & operator >> ( long& b) { return read(b); } PlotStream & operator >> ( long long& b) { return read(b); } PlotStream & operator >> ( int& b) { return read(b); } PlotStream & operator >> ( double& b) { return read(b); } PlotStream & operator >> ( complex& b) { return read(b); } PlotStream & operator >> ( string& s) { return read(s); } PlotStream & operator >> ( string *& s) { if(!s) s= new string(); return read(*s); // cout << " fread string " << s <> ( Mesh *& Th) { long n; read(n); Serialize s(n,Mesh::magicmesh); read(s,n ); Th= new Mesh(s); return *this; } template PlotStream & operator >> ( KN& b) { long n; read(n); // cout << "PlotStream >> : n " << n << endl; // read empty array .... (n ==0) if( ! b.N() && n) b.init(n);// if n ==0 do nothing .. Add FH nov. 2016 ffassert( b.N()==n); for (int i=0;i> ( Mesh3 *& Th); PlotStream & operator >> ( Fem2D::Mesh3 *& Th) { Th= new Fem2D::Mesh3(TheStream); return *this;} PlotStream & operator >> ( Fem2D::Mesh2 *& Th) { Th= new Fem2D::Mesh2(TheStream); return *this;} // --- I also write the type .. to skip data if we need to skip data // just change >> and << by : <= and >= PlotStream & operator <= (const bool& b) { return write(1),write(b); } PlotStream & operator <= (const long& b) { return write(2),write(b); } PlotStream & operator <= (const long long & b) { return write(3),write(b); } PlotStream & operator <= (const int& b) { return write(4),write(b); } PlotStream & operator <= (const double& b) { return write(5),write(b); } PlotStream & operator <= (const string& s) { return write(6),write(s); } PlotStream & operator <= (const string* s) { return write(6),write(*s); } template PlotStream & operator <= (const KN_& b) { return write(10),write((int) sizeof(T)),operator<<(b);} PlotStream & operator >= ( bool& b) { return readc(1)>>b; } PlotStream & operator >= ( long& b) { return readc(2)>>b; } PlotStream & operator >= ( long long & b) {return readc(3)>>b; } PlotStream & operator >= ( int& b) { return readc(4)>>b; } PlotStream & operator >= ( double& b) { return readc(5)>>b; } PlotStream & operator >= ( string& s) { return readc(6)>>s; } PlotStream & operator >= ( string*& s) { return readc(6)>>s; } template PlotStream & operator >= ( KN& b) { return readc(10), readc(sizeof(T)), operator>>(b);} PlotStream & readc(int cc) { int c; read(c); assert(c==cc); return *this;} void SkipData() { int c; read(c); bool b; int i; long l,n; long long ll; string s; double d; char buf[100]; switch (c) { case 1: read(b);break; case 2: read(l);break; case 3: read(ll);break; case 4: read(i);break; case 5: read(d);break; case 6: read(s);break; case 10: read(l); assert(l>0 && l <100); read(n); for(int i=0;i #include using namespace std; #include "P1IsoValue.hpp" using namespace Fem2D; extern long verbosity; //typedef double R; inline R3 bary(const R3 K[4],R f[4],int i0,int i1,R v) { R d=f[i0]-f[i1]; assert(fabs(d)>1e-20); R l1= (f[i0] - v)/ d; // == 1 si v = f[i1] R l0 = 1. -l1; assert(l0 >=-1e-10 && l1 >= -1e-10); return K[i0]*l0 + K[i1]*l1; // == K[i1] si l1 ==1 => v = f[i1] } inline R2 bary(const R2 K[3],R f[3],int i0,int i1,R v) { R d=f[i0]-f[i1]; assert(fabs(d)>1e-20); R l1= (f[i0] - v)/ d; // == 1 si v = f[i1] R l0 = 1. -l1; assert(l0 >=-1e-10 && l1 >= -1e-10); return K[i0]*l0 + K[i1]*l1; // == K[i1] si l1 ==1 => v = f[i1] } static inline int signep4(int i0,int i1,int i2,int i3) { // calcul du signe dans la permutation int s =1; if(i0>i1) s=-s,Exchange(i0,i1); if(i1>i2) s=-s,Exchange(i1,i2); if(i2>i3) s=-s,Exchange(i2,i3); // i3 max if(i0>i1) s=-s,Exchange(i0,i1); if(i1>i2) s=-s,Exchange(i1,i2); // i2 max < i if(i0>i1) s=-s,Exchange(i0,i1); return s; } inline int signe_permutation(int i0,int i1,int i2,int i3) { int p=1; if(i0>i1) Exchange(i0,i1), p = -p; if(i0>i2) Exchange(i0,i2), p = -p; if(i0>i3) Exchange(i0,i3), p = -p; if(i1>i2) Exchange(i1,i2), p = -p; if(i1>i3) Exchange(i1,i3), p = -p; if(i2>i3) Exchange(i2,i3), p = -p; return p; } inline void pen23tet(R3 P[6],R3 Q[3][4]) { //int d1[3][4]= { {1,6,2,3}, {1,5,2,6}, {1,6,4,5}}; int d0[3][4]= { {0,5,1,2}, {0,4,1,5}, {0,5,3,4}}; /* the 6 way to spilt a pent en tet ... DATA PDD /1,0,2,3,4,5,0,6/ DATA (MU(I, 1),I=1,12) /1,6,2,3, 1,5,2,6, 1,6,4,5/ DATA (MU(I, 2),I=1,12) /1,6,2,3, 1,4,2,6, 2,6,4,5/ DATA (MU(I, 3),I=1,12) /1,4,2,3, 2,6,3,4, 2,6,4,5/ DATA (MU(I, 4),I=1,12) /1,5,2,3, 1,5,3,6, 1,6,4,5/ DATA (MU(I, 5),I=1,12) /1,5,2,3, 1,5,3,4, 3,6,4,5/ DATA (MU(I, 6),I=1,12) /1,4,2,3, 2,5,3,4, 3,6,4,5/ */ for(int k=0; k<3; ++k) for(int i=0; i<4;++i) Q[k][i]=P[d0[k][i]]; } int UnderIso(double *f,R2 Q[2][3] ,double area2[2], double eps) { const R2 *K = R2::KHat; const int p1[]= {1,2,0}; const int p2[]= {2,0,1}; R v=0; // build the negative tetra under zero iso value of f .. double fmx=f[0], fmn=f[0]; fmx = std::max(fmx,f[1]); fmn = std::min(fmn,f[1]); fmx = std::max(fmx,f[2]); fmn = std::min(fmn,f[2]); if( fmn >= v - eps) { area2[0]=1; return 0; // no intersection .. } if( fmx <= v+ eps) { area2[0]=1; return 1; }; // full triz .. int np[4],nm[4]; int km=0,kp=0; int ntria=0; for (int i=0;i<3;++i) { if(f[i]<=v+eps) nm[km++]=i; else np[kp++] = i; } if(km == 0) { area2[0]=0; return 0; } else if( km == 1) { // 1 tet j, j+1, j+2, j+3 int j0=nm[0]; int j1=p1[j0], j2=p2[j0]; Q[0][0]=K[j0]; Q[0][1]=bary(K,f,j0,j1,v); Q[0][2]=bary(K,f,j0,j2,v); ntria=1; } else if( km == 2) {// 1 prisme ntria=2; int j0 = np[0]; int j1=p1[j0], j2=p2[j0]; R2 Q1=bary(K,f,j0,j1,v); R2 Q2=bary(K,f,j0,j2,v); Q[0][0]=K[j1]; Q[0][1]=K[j2]; Q[0][2]=Q2; Q[1][0]=K[j1]; Q[1][1]=Q2; Q[1][2]=Q1; } else if( km == 3) { area2[0]=1; return 1; } // vol computation for(int k=0; k< ntria; ++k) { area2[k]=det(Q[k][0],Q[k][1],Q[k][2]); //cout <= - eps); } return ntria; } int UnderIso(double *f,R3 Q[3][4] ,double vol6[3], double eps) { const R3 *K = R3::KHat; const int p1[]= {1,2,3,0}; const int p2[]= {2,0,0,2}; const int p3[]= {3,3,1,1}; R v=0; // build the negative tetra under zero iso value of f .. double fmx=f[0], fmn=f[0]; fmx = std::max(fmx,f[1]); fmn = std::min(fmn,f[1]); fmx = std::max(fmx,f[2]); fmn = std::min(fmn,f[2]); fmx = std::max(fmx,f[3]); fmn = std::min(fmn,f[3]); if( fmn >= v - eps) { vol6[0]=1; return 0; // no intersection .. } if( fmx <= v+ eps) { vol6[0]=1; return 1; }; // full tet .. // hard case .. // count number vol6[0]=1; int np[4],nm[4]; int km=0,kp=0; int ntet=0; for (int i=0;i<4;++i) { if(f[i]<=v+eps) nm[km++]=i; else np[kp++] = i; } if(km == 0) { vol6[0]=0; return 0; } else if( km == 1) { // 1 tet j, j+1, j+2, j+3 int j0=nm[0]; int j1=p1[j0], j2=p2[j0], j3=p3[j0]; Q[0][0]=K[j0]; Q[0][1]=bary(K,f,j0,j1,v); Q[0][2]=bary(K,f,j0,j2,v); Q[0][3]=bary(K,f,j0,j3,v); ntet=1; } else if( km == 2) {// 1 prisme i0,i1, j0,j1, k0, k0 ntet=3; int i0=nm[0]; int i1=nm[1]; int k0=np[0]; int k1=np[1]; if(signe_permutation(i0,i1,k0,k1)<0) std::swap(k0,k1); R3 P[6]; P[0]=K[i0]; P[1]=bary(K,f,i0,k0,v); P[2]=bary(K,f,i0,k1,v); P[3]=K[i1]; P[4]=bary(K,f,i1,k0,v); P[5]=bary(K,f,i1,k1,v); pen23tet(P,Q); } else if( km == 3) { // prisme ntet=3; int k0=np[0]; int i1=p1[k0]; int i2=p2[k0]; int i3=p3[k0]; assert(signe_permutation(k0,i1,i2,i3)>0); R3 P[6]; P[3]=K[i1]; P[4]=K[i2]; P[5]=K[i3]; P[0]=bary(K,f,i1,k0,v); P[1]=bary(K,f,i2,k0,v); P[2]=bary(K,f,i3,k0,v); pen23tet(P,Q); } else if( km == 4) { vol6[0]=1; return 1; } // vol computation for(int k=0; k< ntet; ++k) { vol6[k]=det(Q[k][0],Q[k][1],Q[k][2],Q[k][3]); assert(vol6[k] >= - eps); if( vol6[k] 99 ) cout <0) ? 3:0;// to take one fulL face not to times ... } R v=0; int nP=0; int np[4],nm[4],nps[4],nms[4];; int km=0,kp=0,kms=0,kps=0; for (int i=0;i<4;++i) { if(f[i]<=v+eps) nm[km++]=i; if(f[i]>=v-eps) np[kp++]=i; // strict .. if(f[i]v+eps) nps[kps++]=i; } // cout << "IsoLineK: km kp "<< km << " " << kp << endl; int h=-1,b[3]; if(kps==1 && km==3) { h = nps[0]; b[0]=nvfaceTet[h][0]; b[1]=nvfaceTet[h][1]; b[2]=nvfaceTet[h][2]; } if(kms==1 && kp == 3) { h = nms[0]; b[0]=nvfaceTet[h][0]; b[2]=nvfaceTet[h][1]; b[1]=nvfaceTet[h][2]; } if(kp==2 && km==2) {// cas quad if(signep4(nm[0],nm[1],np[0],np[1]) < 0) Exchange(nm[0],nm[1]); Q[0]=bary(K,f,nm[0],np[0],v); Q[1]=bary(K,f,nm[0],np[1],v); Q[2]=bary(K,f,nm[1],np[1],v); Q[3]=bary(K,f,nm[1],np[0],v); nP=4; } else if (h>=0) { // cas triangle Q[0]=bary(K,f,h,b[0],v); Q[1]=bary(K,f,h,b[1],v); Q[2]=bary(K,f,h,b[2],v); nP=3; } return nP; } int IsoLineK(double *f,Fem2D::R2 *Q, double eps) { int debug=0; R2 P[3]={ R2(0.,0.),R2(1.,0.),R2(0.,1.)}; int kv=0,ke=0,e=3; int tv[3],te[3],vk[3],i0[3],i1[3]; for(int i=0;i<3;++i) { if( abs(f[i]) <= eps) { e -= tv[kv++]=i; vk[i]=1; } else vk[i]=0; } if(debug) cout << " ** " << kv << endl; if(kv>1) // on 2 vertex on the isoline .... { if(kv==2) { if(f[e] > 0.) { int j0=(e+1)%3; int j1=(e+2)%3; te[ke]=e+3,i0[ke]=j0,i1[ke]=j0,++ke; te[ke]=e,i0[ke]=j1,i1[ke]=j1,++ke; // pb d'unicity, need to see the adj triangle ... //return 10+e ; // edge number + 10 } else return 0; // skip edge ... } else return 0; // const funct... } else // see internal edge .. for(int ee=0;ee<3;++ee) { int j0=(ee+1)%3; int j1=(ee+2)%3; if( vk[j0]) // the intial point on iso line { if(0. < f[j1]) te[ke]=ee,i0[ke]=j0,i1[ke]=j0,++ke; else te[ke]=ee+3,i0[ke]=j0,i1[ke]=j0,++ke; } else if (vk[j1]); // skip the final point on iso line else if( f[j0] < 0. && 0. < f[j1]) // good sens te[ke]=ee,i0[ke]=j0,i1[ke]=j1,++ke; else if ( f[j0] > 0. && 0. > f[j1]) // inverse sens te[ke]=ee+3,i0[ke]=j1,i1[ke]=j0,++ke; } if( ke==2) { // the K[i1[0]] , Q[0], Q[1] must be direct ... // the K[i0[1]] , Q[0], Q[1] must be direct ... // Warning no trivail case .. make a plot to see // with is good // the first edge must be if(te[0]<3) // oriente the line { assert(te[1] >=3); std::swap(te[0],te[1]); std::swap(i0[0],i0[1]); std::swap(i1[0],i1[1]); if(debug) cout << " swap " << endl; } for(int i=0;i<2;++i) { int j0=i0[i],j1=i1[i]; if( j0== j1) Q[i] = P[j0]; else Q[i] = (P[j0]*(f[j1]) - P[j1]*(f[j0]) ) /(f[j1]-f[j0]); if(debug) cout << i << " " << j0 << " " << j1 << " : " << Q[i] << "***" << endl; } if(!vk[i1[0]]) assert( det(P[i1[0]],Q[0],Q[1]) > 0); if(!vk[i0[1]]) assert( det(P[i0[1]],Q[1],Q[0]) > 0); return 2; } // remark, the left of the line is upper . return 0; } freefem++-3.61-1/src/fflib/lgsolver.hpp000644 000767 000024 00000043647 13312446271 020040 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef lgsolver_hpp_ #define lgsolver_hpp_ #include "gmres.hpp" typedef void * pcommworld; namespace Fem2D { // hack --- F. Hecht ----- // une fonction pour change un tableau de // complex en tableau de real // Idee faire // Une class qui tranforme une matrice complex en matric real // et faire de transformateur de vecteur inline KN_ C2R(KN_ > & vc) { assert(vc.step==1); complex * pc=vc; // pointeur du tableau double *pr = static_cast(static_cast(pc)); return KN_(pr,vc.N()*2); } inline const KN_ C2R(const KN_ > & vc) { assert(vc.step==1); complex * pc=vc; // pointeur du tableau double *pr = static_cast(static_cast(pc)); return KN_(pr,vc.N()*2); } inline KN_ > R2C(KN_ & vr) { assert(vr.step==1 && vr.N() %2 ==0); double *pr =vr; // pointeur du tableau complex * pc = static_cast* >(static_cast(pr)); return KN_ >(pc,vr.N()/2); } inline const KN_ > R2C(const KN_ & vr) { assert(vr.step==1 && vr.N() %2 ==0); double *pr =vr; // pointeur du tableau complex * pc = static_cast* >(static_cast(pr)); return KN_ >(pc,vr.N()/2); } // une classe pour transforme une Matrice complex en Matrice real // ----------------------------------------------------------------- template class MatC2R : public VirtualMatrice { public: typedef typename VirtualMatrice::plusAx plusAx; // typedef VirtualMatrice > M; const MM &m; MatC2R(const MM &mm): VirtualMatrice(mm.N*2,mm.M*2),m(mm) {} void addMatMul(const KN_ & x, KN_ & Ax) const { R2C(Ax) += m*R2C(x); } plusAx operator*(const KN & x) const {return plusAx(this,x);} virtual bool ChecknbLine(int n) const { return !N ||n==N;} virtual bool ChecknbColumn(int m) const { return !M ||m==M;} }; template class SolveGCPrecon : public MatriceMorse::VirtualSolver , public VirtualMatrice{ int n; int nbitermax; double eps; mutable double epsr; const E_F0 * precon; KN D1; // pour le CL bloque (tgv) mutable KN xx; Expression xx_del, code_del; Stack stack; typedef typename VirtualMatrice::plusAx plusAx; public: SolveGCPrecon(const MatriceMorse &A,const OneOperator * C,Stack stk,int itmax, double epsilon=1e-6) : VirtualMatrice(A.n), n(A.n),nbitermax(itmax?itmax: Max(100,n)),eps(epsilon),epsr(0),precon(0), D1(n),xx(n),stack(stk) { assert(C); WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 throwassert(A.sym()); Type_Expr te_xx(CPValue(xx)); xx_del=te_xx.second; C_F0 e_xx(te_xx); // 1 undelete pointer code_del= C->code(basicAC_F0_wa(e_xx)); precon = to >(C_F0(code_del,*C));// 2 undelete pointer throwassert(precon); R aii; A.getdiag(D1); double tgv=Fem2D::norm(D1.linfty() ) ; if( Fem2D::norm(tgv) < 1e10) tgv=1e100; double tgv1 = 1./tgv; // Corrige fH 11 mai 2015 ... for (int i=0;i &a,KN_ &x,const KN_ &b) const { epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; ConjuguedGradient,SolveGCPrecon,StopGC >(a,*this,b,x,nbitermax,epsr); } plusAx operator*(const KN_ & x) const {return plusAx(this,x);} void addMatMul(const KN_ & x, KN_ & Ax) const { assert(x.N()==Ax.N()); xx=x; // cout << x[0] << " "; xx=GetAny >((*precon)(stack)); WhereStackOfPtr2Free(stack)->clean(); // cout << (xx)[0] << " " << endl; R dii; for (int i=0;iclean(); // FH mars 2005 delete xx_del; delete code_del; // cout << "~SolveGCPrecon " << endl; } virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} }; template class SolveGMRESPrecon : public MatriceMorse::VirtualSolver , public VirtualMatrice{ int n; int nbitermax; double eps; mutable double epsr; const E_F0 * precon; KN D1; mutable KN xx; Expression xx_del, code_del; Stack stack; int dKrylov; typedef typename VirtualMatrice::plusAx plusAx; public: SolveGMRESPrecon(const MatriceMorse &A,const OneOperator * C,Stack stk,int dk=50,int itmax=0,double epsilon=1e-6) : VirtualMatrice(A.n), n(A.n),nbitermax(itmax?itmax: Max(100,n)),eps(epsilon),epsr(0),precon(0), D1(n),xx(n), stack(stk),dKrylov(dk) { assert(C); WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 // C_F0 e_xx(CPValue(xx)); //precon = to >(C_F0(C->code(basicAC_F0_wa(e_xx)),*C)); Type_Expr te_xx(CPValue(xx)); xx_del=te_xx.second; C_F0 e_xx(te_xx); // 1 undelete pointer code_del= C->code(basicAC_F0_wa(e_xx)); precon = to >(C_F0(code_del,*C));// 2 undelete pointer throwassert(precon); R aii; A.getdiag(D1); double tgv = D1.linfty(); if( tgv < 1e5) tgv = 1e100; // if no tgv remove .. // if(verbosity>10 ) cout << " in Precon GMRES, find tgv = " << tgv << endl; for (int i=0;i &a,KN_ &x,const KN_ &b) const { epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; // ConjuguedGradient,SolveGCPrecon >(a,*this,b,x,nbitermax,epsr); KNM H(dKrylov+1,dKrylov+1); int k=dKrylov,nn=nbitermax; //int res= GMRES(a,(KN &)x, (const KN &)b,*this,H,k,nn,epsr,verbosity); } plusAx operator*(const KN_ & x) const {return plusAx(this,x);} void addMatMul(const KN_ & x, KN_ & Ax) const { assert(x.N()==Ax.N()); xx=x; // cout << x[0] << " "; xx=GetAny >((*precon)(stack)); // xx value of the preoco WhereStackOfPtr2Free(stack)->clean(); // cout << (xx)[0] << " " << endl; // R dii; // for (int i=0;iclean(); // FH mars 2005 // cout << "~SolveGMRESPrecon; " << endl; } virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} }; template class SolveGMRESDiag : public MatriceMorse::VirtualSolver , public VirtualMatrice{ int n; int nbitermax; double eps; mutable double epsr; int dKrilov; KN D1; public: typedef typename VirtualMatrice::plusAx plusAx; SolveGMRESDiag(const MatriceMorse &A,int nbk=50,int itmax=0,double epsilon=1e-6) : VirtualMatrice(A.n), n(A.n),nbitermax(itmax?itmax: Max(100,n)),eps(epsilon),epsr(0), dKrilov(nbk) ,D1(n) { R aii=0; A.getdiag(D1); for (int i=0;i &a,KN_ &x,const KN_ &b) const { epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; // ConjuguedGradient,SolveGCDiag >(a,*this,b,x,nbitermax,epsr); KNM H(dKrilov+1,dKrilov+1); int k=dKrilov,nn=nbitermax; //int res= GMRES(a,(KN &)x,(const KN &)b,*this,H,k,nn,epsr,verbosity); } plusAx operator*(const KN_ & x) const {return plusAx(this,x);} void addMatMul(const KN_ & x, KN_ & Ax) const { assert(x.N()==Ax.N()); for (int i=0;i class SolveGMRESDiag : public MatriceMorse::VirtualSolver , public VirtualMatrice{ int n; int nbitermax; KN D1; double eps; mutable double epsr; int dKrilov; public: typedef VirtualMatrice::plusAx plusAx; SolveGMRESDiag(const MatriceMorse &A,int nbk=50,int itmax=0,double epsilon=1e-6) : VirtualMatrice(A.n), n(A.n),nbitermax(itmax?itmax: Max(100,n)),D1(n),eps(epsilon),epsr(0), dKrilov(nbk) { Complex aii=0; A.getdiag(D1); for (int i=0;i &a,KN_ &x,const KN_ &b) const { epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; // ConjuguedGradient,SolveGCDiag >(a,*this,b,x,nbitermax,epsr); KNM H(dKrilov+1,dKrilov+1); int k=dKrilov,nn=nbitermax; KN_ rx=C2R(x); const KN_ rb=C2R(b); typedef MatC2R > VA; typedef MatC2R > VC; VA AR(a); VC CR(*this); //int res= GMRES(AR,(KN &)rx,(const KN &)rb,CR,H,k,nn,epsr,verbosity); } plusAx operator*(const KN_ & x) const {return plusAx(this,x);} void addMatMul(const KN_ & x, KN_ & Ax) const { assert(x.N()==Ax.N()); for (int i=0;i class SolveGMRESPrecon : public MatriceMorse::VirtualSolver , public VirtualMatrice{ public: int n; int nbitermax; Expression xx_del, code_del; const E_F0 * precon; Stack stack; double eps; mutable double epsr; int dKrylov; KN D1; mutable KN xx; typedef VirtualMatrice::plusAx plusAx; public: SolveGMRESPrecon(const MatriceMorse &A,const OneOperator * C,Stack stk,int dk=50,int itmax=0,double epsilon=1e-6) : VirtualMatrice(A.n), n(A.n),nbitermax(itmax?itmax: Max(100,n)), xx_del(0),code_del(0), precon(0),stack(stk),eps(epsilon),epsr(0),dKrylov(dk), D1(n),xx(n) { assert(C); WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 Type_Expr te_xx(CPValue(xx)); xx_del=te_xx.second; C_F0 e_xx(te_xx); // 1 undelete pointer code_del= C->code(basicAC_F0_wa(e_xx)); precon = to >(C_F0(code_del,*C));// 2 undelete pointer //C_F0 e_xx(CPValue(xx)); //precon = to >(C_F0(C->code(basicAC_F0_wa(e_xx)),*C)); throwassert(precon); Complex aii; A.getdiag(D1); for (int i=0;i &a,KN_ &x,const KN_ &b) const { epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; // ConjuguedGradient,SolveGCPrecon >(a,*this,b,x,nbitermax,epsr); KNM H(dKrylov+1,dKrylov+1); int k=dKrylov,nn=nbitermax; KN_ rx=C2R(x); const KN_ rb=C2R(b); typedef MatC2R > VA; typedef MatC2R > VC; VA AR(a); VC CR(*this); //int res= GMRES(AR,(KN &)rx,(const KN &)rb,CR,H,k,nn,epsr,verbosity); // assert(0); // a faire //int res=GMRES(a,(KN &)x, (const KN &)b,*this,H,k,nn,epsr); } plusAx operator*(const KN_ & x) const {return plusAx(this,x);} void addMatMul(const KN_ & x, KN_ & Ax) const { assert(x.N()==Ax.N()); xx=x; // cout << x[0] << " "; xx=GetAny >((*precon)(stack)); WhereStackOfPtr2Free(stack)->clean(); // cout << (xx)[0] << " " << endl; Complex dii; for (int i=0;iclean(); // FH mars 2005 delete xx_del; delete code_del; // cout << "~SolveGMRESPrecon; " << endl; } virtual bool ChecknbLine(int ) const { return true;} virtual bool ChecknbColumn(int ) const { return true;} }; template typename MatriceMorse::VirtualSolver * BuildSolverGMRES(DCL_ARG_SPARSE_SOLVER(R,A)) { typename MatriceMorse::VirtualSolver * ret=0; if (ds.precon) ret=new SolveGMRESPrecon(*A,(const OneOperator *)ds.precon,stack,ds.NbSpace,ds.itmax,ds.epsilon); else ret=new SolveGMRESDiag(*A,ds.NbSpace,ds.itmax,ds.epsilon); return ret; } template typename MatriceMorse::VirtualSolver * BuildSolverCG(DCL_ARG_SPARSE_SOLVER(R,A) ) { typename MatriceMorse::VirtualSolver * ret=0; if (ds.precon) ret=new SolveGCPrecon(*A,(const OneOperator *)ds.precon,stack,ds.itmax,ds.epsilon); else ret=new SolveGCDiag(*A,ds.itmax,ds.epsilon); return ret; } #define LIST_NAME_PARM_MAT \ { "init", &typeid(bool)}, \ { "solver", &typeid(TypeSolveMat*)}, \ { "eps", &typeid(double) }, \ { "precon",&typeid(Polymorphic*)}, \ { "dimKrylov",&typeid(long)}, \ { "tgv",&typeid(double )}, \ { "factorize",&typeid(bool)}, \ { "strategy",&typeid(long )}, \ { "tolpivot",&typeid(double )}, \ { "tolpivotsym",&typeid(double )}, \ { "nbiter", &typeid(long)}, \ { "datafilename", &typeid(string*)} , \ { "lparams",&typeid(KN_)} , \ { "dparams", &typeid(KN_)}, \ { "smap", &typeid(map*)}, \ { "permr", &typeid(KN_)}, \ { "permc", &typeid(KN_)}, \ { "scaler", &typeid(KN_)}, \ { "scalec", &typeid(KN_)}, \ { "sparams", &typeid(string*)}, \ { "commworld", &typeid(pcommworld)}, \ { "master", &typeid(long)}, \ { "rinfo", &typeid(KN*)}, \ { "info", &typeid(KN*)}, \ { "kerneln", &typeid( KNM *)}, \ { "kernelt", &typeid( KNM *)}, \ { "kerneldim", &typeid(long*)} \ const int NB_NAME_PARM_MAT = 24 +3 ; template inline void SetEnd_Data_Sparse_Solver(Stack stack,Data_Sparse_Solver & ds,Expression const *nargs ,int n_name_param) { int kk = n_name_param-NB_NAME_PARM_MAT-1; if (nargs[++kk]) ds.initmat= ! GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.typemat= GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.epsilon= GetAny((*nargs[kk])(stack)); if (nargs[++kk]) {// modif FH fev 2010 ... const Polymorphic * op= dynamic_cast(nargs[kk]); if(op) ds.precon = op->Find("(",ArrayOfaType(atype* >(),false)); // strange bug in g++ is R become a double } if (nargs[++kk]) ds.NbSpace= GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.tgv= GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.factorize= GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.strategy = GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.tol_pivot = GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.tol_pivot_sym = GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.itmax = GetAny((*nargs[kk])(stack)); // frev 2007 OK if (nargs[++kk]) ds.data_filename = *GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.lparams = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.dparams = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.smap = GetAny *>((*nargs[kk])(stack)); if (nargs[++kk]) ds.perm_r = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.perm_c = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.scale_r = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.scale_c = GetAny >((*nargs[kk])(stack)); if (nargs[++kk]) ds.sparams = *GetAny((*nargs[kk])(stack)); if (nargs[++kk]) ds.commworld = GetAny((*nargs[kk])(stack)); #ifdef VDATASPARSESOLVER if (nargs[++kk]) ds.master = GetAny((*nargs[kk])(stack)); #else ++kk; #endif // add FH nov 2015 .. if (nargs[++kk]) ds.rinfo = GetAny* >((*nargs[kk])(stack)); if (nargs[++kk]) ds.info = GetAny* >((*nargs[kk])(stack)); // add FH juin 2018 .. if (nargs[++kk]) ds.kerneln = GetAny< KNM* >((*nargs[kk])(stack)); if (nargs[++kk]) ds.kernelt = GetAny< KNM* >((*nargs[kk])(stack)); if (nargs[++kk]) ds.kerneldim = GetAny((*nargs[kk])(stack)); ffassert(++kk == n_name_param); } } // end of namespace Fem2D #endif freefem++-3.61-1/src/fflib/Makefile.am000644 000767 000024 00000005147 13256636774 017537 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ noinst_LIBRARIES=libff.a # FFCS - 28/11/11 - ffapi.cpp cannot be part of libff.a because it # needs to be compiled with different options depending on the # executable it is included in (eg with/without MPI) libff_a_SOURCES2= UMFPack_Solver.cpp \ AFunction.cpp AFunction2.cpp \ array_long.cpp array_real.cpp array_complex.cpp \ lex.cpp lgmesh.cpp lgmesh3.cpp \ CodeAlloc.cpp lgmat.cpp global.cpp \ ../femlib/Drawing.cpp ../femlib/gibbs.cpp \ ../femlib/CheckPtr.cpp ../femlib/fem.cpp \ ../femlib/QuadratureFormular.cpp ../femlib/FESpace.cpp \ ../femlib/Element_RT.cpp ../femlib/mshptg.cpp ../femlib/FQuadTree.cpp \ ../bamglib/QuadTree.cpp ../bamglib/R2.cpp ../bamglib/Meshio.cpp \ ../bamglib/Mesh2.cpp ../bamglib/Metric.cpp ../femlib/BamgFreeFem.cpp \ ../bamglib/MeshDraw.cpp ../bamglib/MeshGeom.cpp \ ../bamglib/MeshQuad.cpp ../bamglib/SetOfE4.cpp ../bamglib/MeshRead.cpp \ ../bamglib/write_hdf5.cpp ../bamglib/write_hdf5.hpp ../bamglib/write_xdmf.cpp \ ../bamglib/MeshWrite.cpp problem.cpp mt19937ar.cpp \ ../Graphics/DefColor.cpp \ InitFunct.cpp ../Algo/lgalgo.cpp \ ../femlib/Element_P2h.cpp load.cpp lgfem.cpp AFunction.hpp AnyType.hpp \ error.hpp ../femlib/gmres.hpp InitFunct.hpp lex.hpp lgfem.hpp lgmesh3.hpp \ lgmesh.hpp lgsolver.hpp \ Operator.hpp problem.hpp Serialize.hpp showverb.hpp String.hpp \ throwassert.hpp versionnumber.hpp CodeAlloc.hpp \ array_init.hpp array_tlp.hpp array_resize.hpp \ strversionnumber.hpp ffstack.hpp AddNewFE.h \ environment.cpp environment.hpp string_def.cpp \ ../femlib/FESpacen.cpp \ ../femlib/P012_1d.cpp \ ../femlib/P012_2d.cpp \ ../femlib/P012_3d.cpp \ ../femlib/Mesh1dn.cpp \ ../femlib/Mesh2dn.cpp \ ../femlib/Mesh3dn.cpp \ ../femlib/GQuadTree.cpp \ ../femlib/libmesh5.c \ glumesh2D.cpp \ PlotStream.hpp \ endian.hpp \ ff++.hpp \ ../Eigen/arpackff.hpp \ ../femlib/splitsimplex.cpp AFunction_ext.hpp \ ffapi.hpp P1IsoValue.cpp P1IsoValue.hpp libff_a_SOURCES=$(libff_a_SOURCES2) strversionnumber.cpp # eigenvalue.cpp is optional (see [[file:../../configure.ac::EIGENOBJ]]) EXTRA_libff_a_SOURCES=../Eigen/eigenvalue.cpp libff_a_LIBADD=@EIGENOBJ@ libff_a_DEPENDENCIES=@EIGENOBJ@ AM_CPPFLAGS=-I$(srcdir)/../lglib -I$(srcdir)/../bamglib -I$(srcdir)/../Graphics -I$(srcdir)/../femlib $(HDF5_CPPFLAGS) $(UMFPACK_CPPFLAGS) # -I$(top_srcdir)/arpack/arpack++/include # Build date changes at every change EXTRA_DIST=strversionnumber.m4 BUILT_SOURCES=strversionnumber.cpp strversionnumber.cpp: $(libff_a_SOURCES2) ../../configure m4 -DVersionFreeFemDate="`date`" strversionnumber.m4 > $@ FORCE: freefem++-3.61-1/src/fflib/Operator.hpp000644 000767 000024 00000052433 13256636774 020007 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef Operator_hpp_ #define Operator_hpp_ #if defined(__GNUC__) && __GNUC__+0 >= 3 inline double pow(double x,long l) { return pow(x,(double)l);} #endif template struct Op1_neg: public unary_function { static R f(const A & a) { return - (R)a;} }; template struct Op1_plus: public unary_function { static R f(const A & a) { return + (R)a;} }; template struct Op1_not: public unary_function { static bool f(const A & a) { return ! (bool)a;} }; template struct Op2_add: public binary_function { static R f(const A & a,const B & b) { return ((R)a + (R)b);} }; template struct Op2_sub: public binary_function { static R f(const A & a,const B & b) { return ((R)a - (R)b);} }; template struct Op2_mul: public binary_function { static R f(const A & a,const B & b) { // cout << a << " * " << b <<" => " << ((R)a * (R)b) << endl; return ((R)a * (R)b);} }; template struct Op2_div: public binary_function { static R f(const A & a,const B & b) { if (b == B()) {cerr << a << "/" << b << " : " << typeid(A).name() << " " << typeid(B).name() << " " << typeid(R).name() << endl;ExecError(" Div by 0");} return ((R)a / (R)b);} }; template struct Op2_pipe: public binary_function { static R f(const R & a,const R & b) { return (a | b);} }; template struct Op2_mod: public binary_function { static R f(const A & a,const B & b) { return ((R)a % (R)b);} }; template struct Op2_lt: public binary_function { static bool f(const A & a,const B & b) { // cout << a << " < " << b << " = " << ( a struct Op2_le: public binary_function { static bool f(const A & a,const B & b) { return a <= b;} }; template struct Op2_gt: public binary_function { static bool f(const A & a,const B & b) { return a > b;} }; template struct Op2_ge: public binary_function { static bool f(const A & a,const B & b) { return a >= b;} }; template struct Op2_eq: public binary_function { static bool f(const A & a,const B & b) { //cout << a << " == " << b << " => " <<( a == b) << endl; return a == b;} }; template struct Op2_ne: public binary_function { static bool f(const A & a,const B & b) { return a != b;} }; struct Op2_and: public binary_function { static bool f(const bool & a,const bool & b) { return a && b;} }; struct Op2_or: public binary_function { static bool f(const bool & a,const bool & b) { return a || b;} }; template struct Op2_padd: public binary_function { static R * f(Stack s,const A & a,const B & b) { R* r= Add2StackOfPtr2Free(s,new R (*a + *b)); // delete a,delete b; return r;} }; template struct Op2_plt: public binary_function { static bool f(const A & a,const B & b) { bool r= *a < *b; //delete a,delete b; return r;} }; template struct Op2_ple: public binary_function { static bool f(const A & a,const B & b) { bool r= *a <= *b; // delete a,delete b; return r;} }; template struct Op2_pgt: public binary_function { static bool f(const A & a,const B & b) { bool r= *a > *b; // delete a,delete b; return r;} }; template struct Op2_pge: public binary_function { static bool f(const A & a,const B & b) { bool r= *a >= *b; // delete a,delete b; return r;} }; template struct Op2_peq: public binary_function { static bool f(const A & a,const B & b) { bool r= *a == *b; // delete a,delete b; return r;} }; template struct Op2_pne: public binary_function { static bool f(const A & a,const B & b) { bool r=*a != *b; // delete a,delete b; return r;} }; template struct Op2_pow: public binary_function { static R f(const A & a,const B & b) { return R(pow(a,b));}}; template struct Op_Read : public binary_function { static istream * f(istream * const & f,A * const & a) { *f >> *a; return f; } }; template struct Op_ReadP : public binary_function { static istream * f(istream * const & f,A ** const & a) { assert(a); if( ! *a) *a= new A ; *f >> **a; return f; } }; template struct Op_ReadKN : public binary_function*,istream*> { static istream * f(istream * const & f,KN* const & a) { if( !f || !*f) ExecError("Fatal Error: file not open in read array (Op_ReadKN)"); int n;char c; *f >> n; if(!f->good()) ExecError("Fatal Error: file not good in read array (Op_ReadKN)"); if(n !=a->N()) { cerr << " length on the array " << a->N() << " != " << n << " length in file " << endl; ExecError("Fatal Error: incompatible length in read array (Op_ReadKN)"); assert(n==a->N()); } while (f->get(c) && (c!='\n' && c!='\r' ) ) ((void) 0); // eat until control (new line for (int i=0;i> (*a)[i] ; return f; } }; template struct Op_ReadKNM : public binary_function*,istream*> { static istream * f(istream * const & f,KNM* const & a) { if( !f || !*f) ExecError("Fatal Error: file not open in read array (Op_ReadKN)"); int n,m;char c; *f >> n >> m; if(!f->good()) ExecError("Fatal Error: file not good in read array (Op_ReadKN)"); if(n !=a->N() || m != a->M() ) { cerr << " length on the array N " << a->N() << " != " << n << " n in file " << endl; cerr << " or M " << a->M() << " != " << m << " m in file " << endl; ExecError("Fatal Error: incompatible length in read array (Op_ReadKNM)"); assert(n==a->N()); } while (f->get(c) && (c!='\n' && c!='\r' ) ) ((void) 0); // eat until control (new line for (int i=0;i> (*a)(i,j) ; if(!f->good()) ExecError("Fatal Error: file not good in read array after reading )"); return f; } }; template struct Print: public binary_function { static ostream* f(ostream* const & a,const A & b) { *a << b; return a;} }; // --------------------------------------------- template struct set_eq: public binary_function { static A* f(A* const & a,const A & b) { *a = b; return a;} }; template struct set_eqq: public binary_function { static A f(const A & a,const B & b) {A aa(a); aa = b; return aa;} }; template struct set_eqq_add: public binary_function { static A f(const A & a,const B & b) {A aa(a); aa += b; return aa;} }; template struct set_eq_add: public binary_function { static A* f(A* const & a,const A & b) { *a += b; return a;} }; template struct set_eq_sub: public binary_function { static A* f(A* const & a,const A & b) { *a -= b; return a;} }; template struct set_eq_mul: public binary_function { static A* f(A* const & a,const A & b) { *a *= b; return a;} }; template struct set_eq_div: public binary_function { static A* f(A* const & a,const A & b) { *a /= b; return a;} }; struct set_peqstring: public binary_function { static string** f(string** const & a, string * const & b) { if(*a != b ) { //cerr << " set_peq " << *a << endl; freestring(*a); //cerr << " set_peq " << *a << " " << " = " << b << " " << endl; *a = newstring(*b); //(stack ptr) FH mars 2006 //cerr << " set_peq " << *a << " " << **a << " = " << *b << " " << b << endl; } return a;} }; // --------------------------------------------- template struct set_eqarrayp: public binary_function { static A* f(A* const & a, B const & b) { *a = *b; return a;} }; template struct set_eqarrayp_add: public binary_function { static A* f(A* const & a, B const & b) { assert(SameShape(*a,*b)); *a += *b; return a;} }; template struct set_eqarrayp_sub: public binary_function { static A* f(A* const & a, B const & b) { assert(SameShape(*a,*b)); *a -= *b; return a;} }; template struct set_eqarrayp_mul: public binary_function { static A* f(A* const & a, B const & b) { assert(SameShape(*a,*b)); *a *= *b; return a;} }; template struct set_eqarrayp_div: public binary_function { static A* f(A* const & a, B const & b) { assert(SameShape(*a,*b)); *a /= *b; return a;} }; // --------------------------------------------- template struct set_eqarraypd: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,*b)); *a = *b; delete b; return a;} }; template struct set_eqarraypd_add: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,*b)); *a += *b; delete b; return a;} }; template struct set_eqarraypd_sub: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,*b)); *a -= *b; delete b; return a;} }; template struct set_eqarraypd_mul: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,*b)); *a *= *b; delete b; return a;} }; template struct set_eqarraypd_div: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,*b)); *a /= *b; delete b; return a;} }; // --------------------------------------------- template struct set_eqarray: public binary_function { static A* f(A* const & a, B const & b) { *a = b; return a;} }; // --------------------------------------------- august 2007 FH template struct init_eqarray: public binary_function { static A* f(A* const & a, B const & b) { a->init(); *a = b; return a;} }; // --------------------------------------------- template struct init_eqarraypd: public binary_function { static A* f(A* const & a, B const & b) {a->init(); *a = *b; delete b; return a;} }; // --------------------------------------------- template struct init_eqarrayp: public binary_function { static A* f(A* const & a, B const & b) { a->init(); *a = *b; return a;} }; // ---------------------------------------- fin modif august 2007 template struct set_eqarray_add: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,b)); *a += b; return a;} }; template struct set_eqarray_sub: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,b)); *a -= b; return a;} }; template struct set_eqarray_mul: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,b)); *a *= b; return a;} }; template struct set_eqarray_div: public binary_function { static A* f(A* const & a, B const & b) {assert(SameShape(*a,b)); *a /= b; return a;} }; template struct set_eq_array: public binary_function { static A f(const A & a, B const & b) { A aa=a;aa = b; return a;} }; template struct set_eq_array_add: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,b)); A aa(a); aa += b; return a;} }; template struct set_eq_array_sub: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,b)); A aa(a); aa -= b; return a;} }; template struct set_eq_array_mul: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,b)); A aa(a); aa *= b; return a;} }; template struct set_eq_array_div: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,b)); A aa(a); aa /= b; return a;} }; template struct set_eq_arrayp: public binary_function { static A f(A const & a, B const & b) { A aa(a); aa = *b; return a;} }; // --------------------------------------------- template struct set_eq_arraypd: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,*b));A aa(a); aa = *b; delete b; return a;} }; template struct set_eq_arrayp_sub: public binary_function { static A f(A const & a, B const & b) { assert(SameShape(a,*b)); A aa(a); aa -= *b; return a;} }; template struct set_eq_arrayp_mul: public binary_function { static A f(A const & a, B const & b) { assert(SameShape(a,*b)); A aa(a); aa *= *b; return a;} }; template struct set_eq_arrayp_div: public binary_function { static A f(A const & a, B const & b) { assert(SameShape(a,*b)); A aa(a); aa /= *b; return a;} }; template struct set_eq_arrayp_add: public binary_function { static A f(A const & a, B const & b) { assert(SameShape(a,*b)); A aa(a); aa += *b; return a;} }; template struct set_eq_arraypd_add: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,*b)); A aa(a); aa += *b; delete b; return a;} }; template struct set_eq_arraypd_sub: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,*b)); A aa(a); aa -= *b; delete b; return a;} }; template struct set_eq_arraypd_mul: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,*b)); A aa(a); aa *= *b; delete b; return a;} }; template struct set_eq_arraypd_div: public binary_function { static A f(A const & a, B const & b) {assert(SameShape(a,*b)); A aa(a); aa /= *b; delete b; return a;} }; template struct PrintP: public binary_function { static ostream* f(ostream* const & a,const A & b) { *a << *b; // a->flush();// ADD FH MAi 2010 to empty the buffer baf idea add flush of ostream //delete b; mars 2006 FH return a;} }; template struct PrintPnd: public binary_function { static ostream* f(ostream* const & a,const A & b) { *a << *b; return a;} }; template R * set_eqP(R* a,A b){ if (*a != b) delete (*a) ; ( *a =b); return a;} template R * set_eqdestroy(R* a,A b){ if (*a != b) (**a).destroy() ;// le cas debile Th=Th doit marcher // cout << " set_eqdestroy " << a << " " << b << endl; ( *a =b); return a;} template R * set_eqdestroy_incr(R* a,A b){ if(b) (*b).increment() ; if(*a) (**a).destroy() ;// le cas debile Th=Th doit marcher // cout << " set_eqdestroy " << a << " " << b << endl; ( *a =b); return a;} template R * set_copy( R* const & a,const R & b){ SHOWVERB( cout << " set_copy " << typeid(R).name() << " " << &b << endl); memcpy(a,&b,sizeof(R)); return a;} template R ** set_copy_new( R** const & a,const R * & b){ SHOWVERB( cout << " set_copy_new " << typeid(R).name() << " " << &b << endl); *a= new R(*b); return a;} template R * set_copyp( R* const & a,const R & b){ SHOWVERB( cout << " set_copy " << typeid(R).name() << " " << &b << endl); // memcpy(a,&b,sizeof(R)); *a = b; return a;} template R ** set_copyp_new( R** a,R* b){ SHOWVERB( cout << " set_copy " << typeid(R).name() << " " << &b << endl); //memcpy(a,&b,sizeof(R)); return a; FH 2007 // cerr << " set_copyp_new " << typeid(R).name() << " " << b << " " << *b ; *a = new R(*b); // cerr << " -> " << *a << endl; return a; } template R ** set_copy_incr( R** const & a, R * const & b){ *a=b; SHOWVERB( cout << "set_copy_incr " << b << " dans "<< a << endl); if(b) b->increment(); return a;} template R * set_init2( R* const & a,const A & b,const A & c){ SHOWVERB( cout << " set_init2 " << typeid(R).name() << " " << &b << " " << &c << endl); a->init(b,c); return a;} template R * set_init( R* const & a,const A & b){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << &b << endl); a->init(b); return a;} template R * set_initp( R* const & a,const A & b){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << &b << endl); a->init(*b); return a;} template struct Op2_add0: public binary_function { static R f(const A & a,const B & b) { return (a + b);} }; template struct Op2_build: public binary_function { static R f(const A & a,const B & b) { return R(a,b);} }; template struct Op2_pbuild: public binary_function { static R *f(const A & a,const B & b) { return new R(a,b);} }; template struct Op2_add__n: public binary_function { static R * f(const A & a,const B & b) { return new R(a + b);} }; template struct Op2_addp_n: public binary_function { static R* f(const A & a,const B & b) { return new R(*a + b);} }; template struct Op2_add_pn: public binary_function { static R* f(const A & a,const B & b) { return new R(a + *b);} }; template struct Op2_sub0: public binary_function { static R f(const A & a,const B & b) { return (a - b);} }; template struct Op1_subp: public unary_function { static R f(const A & a) { return (- *a );} }; template struct Op1_sub: public unary_function { static R f(const A & a) { return (- a );} }; template struct Op2_mulcp: public binary_function { static R f(const A & a,const B & b) { return (a * *b);} }; template struct Op2_mulc: public binary_function { static R f(const A & a,const B & b) { return (a * b);} }; template struct Op2_divc: public binary_function { static R f(const A & a,const B & b) { return (a / b);} }; template struct Op2_mulpc: public binary_function { static R f(const A & a,const B & b) { return (b * *a);} }; template struct Op2_mulpcp: public binary_function { static R f(const A & a,const B & b) { return (*a * *b);} }; template struct Op2_2p_: public binary_function { static R f(const A & a,const B & b) { return R(*a,*b);} }; template struct Op2_sub__n: public binary_function { static R * f(const A & a,const B & b) { return new R(a - b);} }; template struct Op2_subp_n: public binary_function { static R* f(const A & a,const B & b) { return new R(*a - b);} }; template struct Op2_sub_pn: public binary_function { static R* f(const A & a,const B & b) { return new R(a - *b);} }; template struct Op3_p: public ternary_function { static R* f(Stack s,const A & a,const B & b,const C & c ) { return new R(a,b,c);} }; template struct Op2_p: public binary_function { static R* f(const A & a,const B & b) { return new R(a,b);} }; template class Transpose{ public: T t; Transpose( T v) : t(v) {} template Transpose( TT v) : t(v) {} template Transpose( TT * v) : t(*v) {} operator const T & () const {return t;} }; #endif freefem++-3.61-1/src/fflib/endian.hpp000644 000767 000024 00000007640 13256636774 017452 0ustar00hechtstaff000000 000000 #ifndef ENDIAN_HPP__ #define ENDIAN_HPP__ // -------------------------------------------- // read and write without endianess problem. // the choise is little endian , such than the // the order of the bytes is the same order of // a shift operator << in a integer. // F. Hecht. // -------------------------------------------- template inline void w_endian(const unsigned char * c,unsigned char * k) {cerr<< " L = "<< L << endl; assert(0); } template inline void r_endian(const unsigned char *c,unsigned char * k) {assert(0); } template<> inline void w_endian<1>(const unsigned char *c,unsigned char* k) {*k=*c;} template<> inline void w_endian<8>(const unsigned char *c,unsigned char* k) { static const unsigned long long ull =( 0ULL + (1ULL << 8) + (2ULL << 16) + (3ULL << 24) + (4ULL << 32) + (5ULL << 40) + (6ULL << 48 ) + (7ULL << 56 )); static const unsigned char *o = reinterpret_cast(&ull); // cout << " ++++ " << ull << " .. " ; // for(int i=0;i<8;++i) cout <<(int) o[i] ; assert(8==sizeof(ull)); k[o[0]]=c[0]; k[o[1]]=c[1]; k[o[2]]=c[2]; k[o[3]]=c[3]; k[o[4]]=c[4]; k[o[5]]=c[5]; k[o[6]]=c[6]; k[o[7]]=c[7]; // cout << " --- " ; // for (int i=0;i<8;++i) // cout << k[i] ; // cout << k << endl; } /* template std::ostream &dump(std::ostream & f, const T &t) { const unsigned char *o = reinterpret_cast(&t); // f << " " << t << " " << & t << " == " << (void *) o << " -> "; for( int i=0;i< sizeof(t); ++i) f << (unsigned int) o[i] ; return f; } */ template<> inline void w_endian<4>(const unsigned char *c,unsigned char * k) { static const unsigned int u0123 = 0U + (1U << 8) + (2U << 16) + (3U << 24); static const unsigned char *o = reinterpret_cast(&u0123); // ordre c[o^-1] : si o: 0123 -> 2130 // si c == 1U + (2U << 8) + (3U << 16) + (4U << 24); // alors k[0] = 1, k[1]=2, k[2] = 3, k[3]=4 // ------------------ assert(4==sizeof(u0123)); k[o[0]]=c[0]; k[o[1]]=c[1]; k[o[2]]=c[2]; k[o[3]]=c[3]; } template<> inline void w_endian<2>(const unsigned char *c,unsigned char *k) { static const unsigned short int u01 = 0U + (1U << 8); static const unsigned char *o = reinterpret_cast(&u01); assert(2==sizeof(u01)); k[o[0]]=c[0]; k[o[1]]=c[1]; } template<> inline void r_endian<1>(const unsigned char *c,unsigned char *k) { *k=*c; } template<> inline void r_endian<8>(const unsigned char *c,unsigned char *k) { static const unsigned long long ull =( 0ULL + (1ULL << 8) + (2ULL << 16) + (3ULL << 24) + (4ULL << 32) + (5ULL << 40) + (6ULL << 48 ) + (7ULL << 56 )); static const unsigned char *o = reinterpret_cast(&ull); assert(8==sizeof(ull)); k[0]=c[o[0]]; k[1]=c[o[1]]; k[2]=c[o[2]]; k[3]=c[o[3]]; k[4]=c[o[4]]; k[5]=c[o[5]]; k[6]=c[o[6]]; k[7]=c[o[7]]; } template<> inline void r_endian<4>(const unsigned char c[4],unsigned char k[4]) { static const unsigned int u0123 = 0U + (1U << 8) + (2U << 16) + (3U << 24); static const unsigned char *o = reinterpret_cast(&u0123); assert(4==sizeof(u0123)); k[0]=c[o[0]]; k[1]=c[o[1]]; k[2]=c[o[2]]; k[3]=c[o[3]]; } template<> inline void r_endian<2>(const unsigned char c[2],unsigned char k[2]) { static const unsigned short u01 = 0U + (1U << 8) ; static const unsigned char *o = reinterpret_cast(&u01); assert(2==sizeof(u01)); k[0]=c[o[0]]; k[1]=c[o[1]]; } template inline T r_endian(const T & t ) { T r; r_endian(reinterpret_cast(&t),reinterpret_cast(&r)); return r; } template inline T w_endian(const T & t ) { T r; w_endian(reinterpret_cast(&t),reinterpret_cast(&r)); return r; } #endif freefem++-3.61-1/src/fflib/UMFPack_Solver.cpp000644 000767 000024 00000026666 13256636774 021000 0ustar00hechtstaff000000 000000 // file to add UMFPACK solver with dynamic load. #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" #include "MatriceCreuse_tpl.hpp" #include "lgsolver.hpp" #ifdef HAVE_LIBUMFPACK extern "C" { #ifdef HAVE_UMFPACK_H #include #else #ifdef HAVE_UMFPACK_UMFPACK_H #include #else #ifdef HAVE_BIG_UMFPACK_UMFPACK_H #include #else #ifdef HAVE_UFSPARSE_UMFPACK_H #include #else #ifdef HAVE_SUITESPARSE_UMFPACK_H #include #else // Defaults to a local version of the UMFPACK headers #include "../../download/include/umfpack.h" #endif // HAVE_SUITESPARSE_UMFPACK_H #endif // HAVE_UFSPARSE_UMFPACK_H #endif // HAVE_BIG_UMFPACK_UMFPACK_H #endif // HAVE_UMFPACK_UMFPACK_H #endif // HAVE_UMFPACK_H } template class SolveUMFPACK : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; void *Symbolic, *Numeric ; int umfpackstrategy; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 public: SolveUMFPACK(const MatriceMorse &A,int strategy,double ttgv, double epsilon=1e-6, double pivot=-1.,double pivot_sym=-1. ) : eps(epsilon),epsr(0), tgv(ttgv), Symbolic(0),Numeric(0) , umfpackstrategy(strategy), tol_pivot_sym(pivot_sym),tol_pivot(pivot) { int status; throwassert( !A.sym() && Numeric == 0 && Symbolic==0 ); int n=A.n; double Control[UMFPACK_CONTROL]; double Info[UMFPACK_INFO]; for(int i=0;i4) Control[UMFPACK_PRL]=2; if(tol_pivot_sym>0) Control[UMFPACK_SYM_PIVOT_TOLERANCE]=pivot_sym; if(tol_pivot>0) Control[UMFPACK_PIVOT_TOLERANCE]=pivot; if(umfpackstrategy>=0) Control[UMFPACK_STRATEGY]=umfpackstrategy; if(verbosity>3) { cout << " UMFPACK real Solver Control :" ; cout << "\n\t SYM_PIVOT_TOLERANCE "<< Control[UMFPACK_SYM_PIVOT_TOLERANCE]; cout << "\n\t PIVOT_TOLERANCE "<< Control[UMFPACK_PIVOT_TOLERANCE]; cout << "\n\t PRL "<< Control[UMFPACK_PRL]; cout << "\n"; } status = umfpack_di_symbolic (n, n, A.lg, A.cl, A.a, &Symbolic,Control,Info) ; if (status != 0) { (void) umfpack_di_report_matrix (n, n, A.lg, A.cl, A.a, 1, Control) ; umfpack_di_report_info (Control, Info) ; umfpack_di_report_status (Control, status) ; cerr << "umfpack_di_symbolic failed" << endl; ExecError("umfpack_di_symbolic failed"); //ffassert(0); } status = umfpack_di_numeric (A.lg, A.cl, A.a, Symbolic, &Numeric,Control,Info) ; if (status != 0) { umfpack_di_report_info (Control, Info) ; umfpack_di_report_status (Control, status) ; cerr << "umfpack_di_numeric failed" << endl; ExecError("umfpack_di_numeric failed"); ffassert(0); } if (Symbolic) umfpack_di_free_symbolic (&Symbolic),Symbolic=0; if(verbosity>3) cout << " -- umfpack_di_build LU " << n << endl; if(verbosity>5) (void) umfpack_di_report_info(Control,Info); } void Solver(const MatriceMorse &A,KN_ &x,const KN_ &b) const { ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; double Control[UMFPACK_CONTROL]; double Info[UMFPACK_INFO]; for(int i=0;i(x), KN_2Ptr(b), Numeric,Control,Info) ; if (status != 0) { umfpack_di_report_info (Control, Info) ; umfpack_di_report_status (Control, status) ; cerr << "umfpack_di_solve failed" << endl; ExecError("umfpack_di_solve failed"); ffassert(0); } if(verbosity>2) cout << " -- umfpack_di_solve, peak Mem: " << long(Info[UMFPACK_PEAK_MEMORY])/(1024*1024)*Info[UMFPACK_SIZE_OF_UNIT] << "Mbytes " << endl; if(verbosity>3) cout << " b min max " << b.min() << " " <3) (void) umfpack_di_report_info(Control,Info); if(verbosity>1) cout << " x min max " << x.min() << " " <3) cout << "~SolveUMFPACK S:" << Symbolic << " N:" << Numeric < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; template<> class SolveUMFPACK : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; int umfpackstrategy; double tgv; void *Symbolic, *Numeric ; double *ar,*ai; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 public: SolveUMFPACK(const MatriceMorse &A,int strategy,double ttgv, double epsilon=1e-6, double pivot=-1.,double pivot_sym=-1. ) : eps(epsilon),epsr(0),umfpackstrategy(strategy),tgv(ttgv), Symbolic(0),Numeric(0), ar(0),ai(0), tol_pivot_sym(pivot_sym), tol_pivot(pivot) { int status; throwassert( !A.sym()); int n=A.n; // copy the coef of the matrice --- ar= new double[A.nbcoef]; ai= new double[A.nbcoef]; ffassert(ar && ai); C2RR(A.nbcoef,A.a,ar,ai); double Control[UMFPACK_CONTROL]; double Info[UMFPACK_INFO]; umfpack_zi_defaults (Control) ; Control[UMFPACK_PRL]=1; if(verbosity>4) Control[UMFPACK_PRL]=2; // Control[UMFPACK_SYM_PIVOT_TOLERANCE]=1E-10; // Control[UMFPACK_PIVOT_TOLERANCE]=1E-10; if(tol_pivot_sym>0) Control[UMFPACK_SYM_PIVOT_TOLERANCE]=pivot_sym; if(tol_pivot>0) Control[UMFPACK_PIVOT_TOLERANCE]=pivot; if(umfpackstrategy>=0) Control[UMFPACK_STRATEGY]=umfpackstrategy; if(verbosity>3) { cout << " UMFPACK complex Solver Control :" ; cout << "\n\t SYM_PIVOT_TOLERANCE "<< Control[UMFPACK_SYM_PIVOT_TOLERANCE]; cout << "\n\t PIVOT_TOLERANCE "<< Control[UMFPACK_PIVOT_TOLERANCE]; cout << "\n\t PRL "<< Control[UMFPACK_PRL]; cout << "\n"; } status = umfpack_zi_symbolic (n, n, A.lg, A.cl, ar,ai, &Symbolic,Control,Info) ; if (status < 0) { (void) umfpack_zi_report_matrix (n, n, A.lg, A.cl, ar,ai, 1, Control) ; umfpack_zi_report_info (Control, Info) ; umfpack_zi_report_status (Control, status) ; cerr << "umfpack_zi_symbolic failed" << endl; ExecError("umfpack_zi_symbolic failed"); ffassert(0); exit(2); } status = umfpack_zi_numeric (A.lg, A.cl, ar,ai, Symbolic, &Numeric,Control,Info) ; if (status < 0) { umfpack_zi_report_info (Control, Info) ; umfpack_zi_report_status (Control, status) ; cerr << "umfpack_zi_numeric failed" << endl; ExecError("umfpack_zi_numeric failed"); ffassert(0); exit(2); } if (Symbolic) umfpack_zi_free_symbolic (&Symbolic),Symbolic=0; if(verbosity>3) cout << "umfpack_zi_build LU " << n << endl; if(verbosity>5) (void) umfpack_zi_report_info(Control,Info); } void Solver(const MatriceMorse &A,KN_ &x,const KN_ &b) const { ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // cout << " epsr = " << epsr << endl; double Control[UMFPACK_CONTROL]; double Info[UMFPACK_INFO]; umfpack_zi_defaults (Control) ; int n = b.N(); ffassert(A.ChecknbLine( n) && n == x.N() && A.ChecknbColumn(n) ); KN xr(n),xi(n),br(n),bi(n); C2RR(n,b,br,bi); // change UMFPACK_At to UMFPACK_Aat in complex oct 2005 int status = umfpack_zi_solve (UMFPACK_Aat, A.lg, A.cl, ar,ai, xr, xi, br,bi, Numeric,Control,Info) ; if (status < 0) { umfpack_zi_report_info (Control, Info) ; umfpack_zi_report_status (Control, status) ; cerr << "umfpack_zi_solve failed" << endl; ExecError("umfpack_zi_numeric failed"); ffassert(0); exit(2); } RR2C(n,xr,xi,x); if(verbosity>1) { cout << " -- umfpack_zi_solve, peak Mem : " << long(Info[UMFPACK_PEAK_MEMORY])/(1024*1024)*Info[UMFPACK_SIZE_OF_UNIT] << "Mbytes " << endl; if(verbosity>3) (void) umfpack_zi_report_info(Control,Info); cout << " b min max " << b.min() << " " <5) cout << "~SolveUMFPACK " << endl; if (Symbolic) umfpack_zi_free_symbolic (&Symbolic),Symbolic=0; if (Numeric) umfpack_zi_free_numeric (&Numeric),Numeric=0; delete [] ar; delete [] ai; } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; inline MatriceMorse::VirtualSolver * BuildSolverIUMFPack(DCL_ARG_SPARSE_SOLVER(double,A)) { //cout << " BuildSolverUMFPack" << endl; return new SolveUMFPACK(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym); } inline MatriceMorse::VirtualSolver * BuildSolverIUMFPack(DCL_ARG_SPARSE_SOLVER(Complex,A)) { //cout << " BuildSolverUMFPack" << endl; return new SolveUMFPACK(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym); } // the 2 default sparse solver double and complex //DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver extern TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue;//=TypeSolveMat::defaultvalue; template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverIUMFPack; template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverIUMFPack; static bool SetUMFPACK() { if(verbosity>1) cout << " SetDefault sparse solver to UMFPack" << endl; DefSparseSolver::solver =BuildSolverIUMFPack; DefSparseSolver::solver =BuildSolverIUMFPack; TypeSolveMat::defaultvalue =TypeSolveMatdefaultvalue; return 1; } void init_UMFPack_solver() { if(verbosity>2) cout << " UMFPACK "; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverIUMFPack; DefSparseSolver::solver =BuildSolverIUMFPack; Global.Add("defaulttoUMFPACK","(",new OneOperator0(SetUMFPACK)); Global.Add("defaultoUMFPACK","(",new OneOperator0(SetUMFPACK)); Global.New("HaveUMFPACK",CConstant(true)); } #ifdef LOAD_LINK_ class Init { public: Init(); }; Init init; Init::Init(){ init_UMFPack_solver(); } #endif #else using namespace Fem2D; bool SetGMRES(); void init_UMFPack_solver() { if(verbosity&& (mpirank==0)) cout << " no UMFPACK -> replace by LU or GMRES "; Global.Add("defaultoUMFPACK","(",new OneOperator0(SetGMRES)); Global.New("HaveUMFPACK",CConstant(false)); } template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverGMRES; template <> DefSparseSolver::SparseMatSolver DefSparseSolver::solver =BuildSolverGMRES; #endif freefem++-3.61-1/src/fflib/lex.cpp000644 000767 000024 00000073646 13312446271 016770 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include "error.hpp" #include #include #include #include "AFunction.hpp" //class pfes; #include #include "lg.tab.hpp" #include "lex.hpp" extern YYSTYPE *plglval; // New version of macro expantion more classical // and more simple // FH Jan. 2005 static const bool debugmacro = false; /*inline char * newcopy(const char * s) { char *r(new char [strlen(s)+1]); strcpy(r, s);return r; } */ void mylex::Add(Key k,int i) { Check(!i,k,"mot clef"); Add(k,i,0); } // <> void mylex::Add(Key k,aType t) { Check(!t,k,"type"); // TYPE defined at [[file:../lglib/lg.ypp::token type TYPE]] Add(k,TYPE,t); } void mylex::AddF(Key k,aType t) { Check(!t,k,"FUNCTION"); Add(k,FUNCTION,t); } void mylex::AddSpace(Key k,aType t) { Check(!t,k,"FESPACE"); Add(k,FESPACE,t); } // <> looks in MotClef for the token contained in buf (buf is set by by [[mylex_basescan]]) and returns // its type as t and the grammar token id as r (eg [[file:~/ff/src/lglib/lg.ypp::TYPE]]). bool mylex::InMotClef (aType & t, int & r) const { const_iterator i= MotClef.find(buf); if (i== MotClef.end()) { t=0;r=ID; return false;} else { r=i->second.first; t=i->second.second; ffassert(r); return true;}} // alh - 5/4/15 - <> [[file:lex.hpp::InMotClef_string]] Same as [[mylex_InMotClef]], but checks // another buffer than buf bool mylex::InMotClef(const char *b,aType &t,int &r)const{ const_iterator i=MotClef.find(b); if(i==MotClef.end()){t=0;r=ID;return false;} else { r=i->second.first; t=i->second.second; ffassert(r); return true; } } // <> void mylex::Add(Key k,int r,aType t){ iterator ii= MotClef.find(k); ffassert(ii==MotClef.end()); MotClef.insert(pair(k,Value(r,t))); } // <> void mylex::dump(ostream & f ) { const_iterator i=MotClef.begin(),e=MotClef.end(); for (;i != e;i++) { f << " " << i->first << " " << i->second.first << " " << i->second.second->name() << endl; } } inline bool isNLCR(istream & f,int c) { // eat CR NL or NL CR paire int cc= f.peek(); bool ret=(c == 10 || c == 13) ; if(ret && ( cc != c) && (cc == 10 || cc == 13) ) f.get(); return ret; } int mylex::EatCommentAndSpace(string *data) { // if data is !0 then add reading char in data // return the last read char c // -------------------- int c,caux,sep=0; const int space=(int) ' '; int incomment =0; do { incomment = 0; c = source().peek(); // eat spaces while (isspace(c) || c == 10 || c == 13 ) {sep=space; c = source().get(); if(isNLCR(source(),c)) c='\n'; if (echo) cout << (char) c; if(c=='\n') { linenumber++; if (echo) cout << setw(5) <> int mylex::basescanprint(int lvl) { int r=basescan(); if (! lexdebug && echo && lvl==0 ) print(cout); return r; } int mylex::basescan() { // extern long mpirank; int c; buf[0]=0; buf[1]=0; buf[2]=0; buf[3]=0; // debut: TheCurrentLine=linenumber; // modif FH if (firsttime) { firsttime=false; if(echo) cout << setw(5) <> else if (isdigit(c) || (c=='.' && isdigit(nc))) { int i=1; buf[0]=c; bool real= (c=='.'); while ( isdigit(nc) && i< 50 ) buf[i++]=source().get(),nc=source().peek(); if (!real && (nc == '.')) real=true,buf[i++]=source().get(),nc=source().peek(); while ( isdigit(nc) && i< 50 ) buf[i++]=source().get(),nc=source().peek(); if (nc =='E' || nc =='e' || nc =='D' || nc =='d') {real=true; buf[i++]=source().get(),nc=source().peek(); if (nc =='+' || nc =='-' || isdigit(nc)) buf[i++]=source().get(),nc=source().peek(); while ( isdigit(nc) && i< 50 ) buf[i++]=source().get(),nc=source().peek(); } if (i>= 50) erreur("Number too long"); buf[i]=0; if (nc=='i' ) { buf[i++]=source().get(),buf[i]=0,plglval->dnum = atof(buf),ret=CNUM;} else if (real) plglval->dnum = atof(buf),ret=DNUM; else plglval->lnum = atoi(buf),ret=LNUM; if(lexdebug) cout << " NUM : " << buf << " "<> else if (isalpha(c) || c=='\\') { ret = ID; int i; for (i = 1; i < 256 && isalnum(source().peek()); i++) buf[i]=source().get(); if (i == 256) erreur ("Identifier too long"); buf[i] = 0; } // <> else if (c=='"') { int i; char cc,ccc; for ( i = 0,cc=source().peek(); i < 256 && ( (isprint(cc)|isspace(cc)) && cc !='\n' && cc !='"'); cc=source().peek(),++i ) { if ( cc == '\\') // escape { cc= source().get(); cc= source().get(); ccc= source().peek(); switch (cc) { case 'n': buf[i]='\n';break; case 'r': buf[i]='\r';break; case 'f': buf[i]='\f';break; case 't': buf[i]='\t';break; case 'a': buf[i]='\a';break; case 10: case 13: cc='\n'; if(ccc!=cc && (ccc==10 || ccc==13)) source().get();// NL CR eat ... linenumber++; //if (echo) cout << setw(5) <str = newcopy(buf); if(lexdebug) cout << "STRING=" << '"' << buf << '"' << endl; ret= STRING; } // Anything else (eg brackets and operators) else { ret = c; switch(c) { case '{': case '%': case '}': case '(': case ')': case '[': case ']': case ',': case ';': case '#': break; case '*': if (nc == '=') ret=MULEQ; break; case '/': if (nc == '=') ret=DIVEQ; break; case '^': case '~': case '\'': case '_': case '?': break; case '.': if (nc == '*') ret = DOTSTAR; else if (nc == '/') ret = DOTSLASH; break; case ':': if (nc == '=') ret= SET; break; case '&': if (nc == '&') ret= AND; break; case '|': if (nc == '|') ret= OR; break; case '!': if (nc == '=') ret=NE; break; case '<': if (nc == '=') ret=LE; if (nc == '<') ret=LTLT; if (nc == '>') ret= NE; break; case '>': if (nc == '=') ret=GE; if (nc == '>') ret=GTGT; break; case '=': if (nc == '=') ret=EQ; break; case '-': if (nc == '>') ret=ARROW; if (nc == '-') ret=MOINSMOINS; if (nc == '=') ret=MOINSEQ; break; case '+': if (nc == '+') ret=PLUSPLUS; if (nc == '=') ret=PLUSEQ; break; default: cerr << "'" << (char) c << (char) nc << "' <=> " << (int) c << " is " ; erreur (" Unexpected character"); } if( (ret == DOTSTAR) || (ret==DOTSLASH)) { source().get(); nc = source().peek(); if(nc == '=' ) { buf[2]='=';// ad FH 19 april 2012 (bug in macro ) buf[3]=0; source().get(); ret = (ret == DOTSTAR) ?DOTMULEQ : DOTDIVEQ; } } else if (ret!=c) source().get(); else buf[1] = 0; strcpy(plglval->oper,buf); if(lexdebug) cout << "Special '" << plglval->oper << "' " << ret << " "; } typetoken=ret; return ret; } // <> int mylex::scan1() { // extern long mpirank; // bool echo = mpirank == 0; int ret= basescan(); // [[mylex_basescan]] if(debugmacro) cout << " scan1 " << ret << " " << token() << " " << ID << endl; while ( ret == ID && ( SetMacro(ret) // correction mars 2014 FH || CallMacro(ret) // correction mars 2014 FH || IFMacro(ret) ) ) ; // correction mars 2014 FH return ret; } // <> int mylex::scan(int lvl) { int ret= scan1(); // ID defined at [[file:../lglib/lg.ypp::ID]] and detected at [[found_an_identifier]] if ( ret == ID) { if (! InMotClef(plglval->type,ret)) { int ft = FindType(buf); // FESPACE, FESPACE1, FESPACE3 defined at [[file:../lglib/lg.ypp::FESPACE]] int feid3[4] ={ ID,FESPACE1,FESPACE,FESPACE3}; assert ( ft >= 0 && ft <= 3) ; ret = feid3[ft]; plglval->str = newcopy(buf); }} if ( ret =='{') { //cout << " listMacroDef->push_back"<< endl; listMacroDef->push_back( MapMacroDef() );} else if (ret == '}') {//cout << " listMacroDef->pop_back"<< endl; listMacroDef->pop_back( );} if (! lexdebug && echo && lvl==0 ) print(cout); return ret; } string mylex::token() const { int i=-1; string f; // found at [[found_a_string]] if (typetoken == STRING) { f += '"'; while (buf[++i]) if (buf[i]=='\n') f += "\\n"; else if (buf[i]=='"') f += "\\\""; else f += buf[i] ; f+= '"'; } else while (buf[++i]) if (buf[i]=='\n') f += "\\n"; else f += buf[i] ; return f; } void mylex::print(ostream &f) const { int i=-1; int k=0; if (typetoken == STRING) { f <<'"'; while (buf[++i]) { k++; if (buf[i]=='\n') k++, f << "\\n"; else if (buf[i]=='"') k++,f << "\\\""; else f << buf[i] ; if ( k%50==49) f << "\n ... : "; } f << '"'; } else while (buf[++i]) if (buf[i]=='\n') f << "\\n"; else f << buf[i] ; } char * mylex::match(int i) { if ( i != basescanprint() ) {// basescan -> scan1 change 2/2/2007 (non pas des substitution de parametres FH) cerr << " we waiting for a '" << char(i) <<"'" << endl; ErrorScan(" err macro ");}; return buf; } bool mylex::AddMacro(string m,string def) { bool ok=1; char *macroname=newcopy(m.c_str()); int nbparam =0; MacroData macroparm; macroparm.f=""; macroparm.l=0; macroparm.d.push_back(def); MapMacroDef & MacroDef =listMacroDef->back(); MapMacroDef::const_iterator i=MacroDef.find(macroname); if(verbosity>3) cout << " add macro "<< m << "->" << def << endl; if ( i == MacroDef.end() ) MacroDef[macroname]=macroparm; else { cerr << " Error add macro varf: "<< m << "->" << def << " the macro exist"<< endl; ErrorScan("Error in AddMacro parameters"); ok = false; } return ok; } bool mylex::SetMacro(int &ret) { char endmacro[]="EndMacro"; char newmacro[]="NewMacro"; bool rt=false; int oldmacro=1; if (strncmp(buf,"macro",6)==0 || (oldmacro=strncmp(buf,newmacro,9))==0 ) { if(echo) print(cout);//xxxxxx char *macroname=newcopy(match(ID)); //if(echo) print(cout); int nbparam =0; MacroData macroparm; int rr=basescanprint(); string def; if (rr!='(') def += buf; else { // a '(' after macro name rr = basescanprint(); if (rr != ')' ) do { if (nbparam++>= 100) { cerr << "in macro " <back(); MapMacroDef::const_iterator i=MacroDef.find(macroname); if ( i == MacroDef.end() ) MacroDef[macroname]=macroparm; else { cerr << "ERREUR in macro name:" <::const_iterator i=listMacroDef->begin(); i != listMacroDef->end(); i++) { j=i->find(id.c_str()); if( j != i->end()) { exist =true; break;} } if(withval && exist) { const MacroData & macroparm= j->second; if(macroparm.d.size()>0) { const string & mval = macroparm.d[macroparm.d.size()-1]; if(debugmacro) cout << " check IFMACRO '"<< val << "' '"<< mval <<"'"<str = newcopy(p.c_str()); ret = STRING; return false; } // <> else if(strncmp(buf,"FILE",5)==0) { if(echo) cout << buf ; plglval->str = newcopy(filename() ); ret = STRING; return false; } // <> else if(strncmp(buf,"LINE",5)==0) { if(echo) cout << buf ; plglval->lnum = linenumber; ret=LNUM; return false; } else for (list::const_iterator i=listMacroDef->begin(); i != listMacroDef->end(); i++) { MapMacroDef::const_iterator j= i->find(buf); if (j != i->end()) { // int inmacroold=withmacropara; const MacroData & macroparm= j->second; int nbparam= macroparm.d.size()-1; if(debugmacro) cout <<"call macro : " << buf << endl; string * macronn= newstring(" macro: "); *macronn+= buf; *macronn+=" in "; *macronn+= macroparm.f; if(echo) cout << buf ; MapMacroParam lp; if (nbparam > 0 ) { match('('); for (int k=0;k scan1 change 2/2/2007 ( not change to pass macro name as a parameter) if ( (rr=='}') && (--lvll==0) ) continue; // remove first { else if ( (rr=='{') && (++lvll==1) ) continue; // remove last } else if(lvll==0) // count the open close () [] { if(lvl && rr==')') lvl--; // if ( then we eat next ) else if(lvl && rr==']') lvl--; // if ( then we eat next ) else if (rr=='(') lvl++ ; // eat next else if (rr=='[') lvl++ ; // eat next else if (lvl<=0) { if (rr==kend ) break; else if (rr==')' || rr==',') {// Correction FH 2/06/2004 cerr << "Error in macro expansion "<< j->first << ", we wait for "<< char(kend) << " and we get " << char(rr)<< endl; cerr << " number of macro parameter in definition is " << nbparam << endl; ErrorScan(" Wrong number of parameter in macro call"); }}} if (rr==ENDOFFILE) ErrorScan(" ENDOFFILE in macro usage"); if(sep==' ') p+=' '; p += token(); // Correction FH 2/06/2004 of string parameter } if(debugmacro) cout << "macro arg "<< k << " :" << macroparm.d[k] << " -> " << p << endl; lp.insert(pair(macroparm.d[k],p)); //lp[macroparm[k]] = p; } } if(debugmacro) cout << " input in : -> " << macroparm.d[nbparam] << " <-> " << nbparam << endl; input(macroparm.d[nbparam],0,macroparm.l);// no file no error here FH. // ici il faut faire la substitution de parameter // ----------------------------------------------- string expandtxt; bool echosave=echo; while(1) { int c= EatCommentAndSpace(&expandtxt); // eat comment to save it; if (c == EOF) break; ret = basescan(); if(debugmacro) cout << " ret = " << ret << token() << endl; if(ret== ENDOFFILE) break; if (nbparam && ret == ID) { MapMacroParam::const_iterator j=lp.find(buf); if ( j != lp.end()) expandtxt+=j->second; else expandtxt+=token(); } else if (ret!='#') // macro concatenation operator expandtxt+=token(); } echo=echosave; if(debugmacro) cout <<" (macro) eadin : " << expandtxt << endl; input(expandtxt,macronn,macroparm.l); ret = scan1(); // Correction FH 6/06/2004 of string parameter return true; } } return false; } void mylex::xxxx::open(mylex *lex,const char * ff) { l=0; nf=f=0; // Try to open the given file name without any extra path from [[file:lex.hpp::ffincludedir]] if(lex->ffincludedir.empty()) // if no liste nf=f= new ifstream(ff,ios_base::binary); // modif of win32 // If it worked, set [[file:lex.hpp::filename]] to ff, otherwise try to add path elements from // [[file:lex.hpp::ffincludedir]] if (!f || !*f) { if ( f) { delete f; nf=f=0; } // for every potential path element for (ICffincludedir k=lex->ffincludedir.begin(); k!=lex->ffincludedir.end(); ++k) { string dif_ff(*k+ff); if (verbosity>=50) lex->cout << " --lex open :" << dif_ff << endl; nf=f= new ifstream(dif_ff.c_str(),ios_base::binary); if ( f) { // If path works, set [[file:lex.hpp::filename]] and close test stream if ( f->good()) { filename = newstring(dif_ff); break; } delete f; nf=f=0; } } } else filename=newstring(ff); // Error message if no path was right if (!f || !*f) { lex->cout << " Error openning file " <ffincludedir.begin(); k!=lex->ffincludedir.end(); ++k) lex->cout << " -- try :\"" << *k+ff << "\"\n"; lgerror("lex: Error input openning file "); } } void mylex::xxxx::readin(mylex *lex,const string & s,const string *name, int macroargs) { filename=name; macroarg=macroargs; l=0; nf=f= new istringstream(s.c_str()); if (!f || !*f) { lex->cout << " Error readin string :" <> void mylex::input(const char * filename) { ffassert(level<99 && level >= -1); if (level>=0) pilesource[level].l =linenumber; pilesource[level+1].open(this,filename); pilesource[level+1].l =0; // cout << "\n ++include " << filename << ";" << level+1 << endl; linenumber = 1; level++; } // <> void mylex::input(const string & str,const string * name,int lg) { ffassert(level<99 && level >= -1); if (level>=0) { pilesource[level].l =linenumber; } pilesource[level+1].readin(this,str,name); linenumber = lg; level++; } bool mylex::close() { if(debugmacro ) cout << "\n close " << level ; ffassert(level >=0 && level < 100); // cout << "\n-- close " << level << endl; pilesource[level].close(); // [[mylex::xxxx::close]] // cout << "\n ++ " << level << endl; if (--level<0) return false; linenumber = pilesource[level].l; return true; } mylex::~mylex() { delete listMacroDef; while( ! strdata.empty()) { // commente july 2005 FH ???. a test plus finement. delete [] strdata.top(); // bug ????? FH 25032005 strdata.pop(); } } mylex::mylex(ostream & out,bool eecho,const KN *pargs) : linenumber(1), charnumber(0), ffincludedir(ffenvironment["includepath"]), firsttime(true), level(-1), echo(eecho && (mpirank == 0) && verbosity), cout(out), listMacroDef(new list), listMacroParam(0) { listMacroDef->push_front(MapMacroDef()); if(pargs) { const KN &args=*pargs; for (int i=1;i 3) AddMacro(a.substr(2,ie-2),a.substr(ie+1,a.length()-ie-1)); } } } }; mylex * Newlex( ostream & out,bool eecho,KN * args) { return new mylex(out,eecho,args); } void Destroylex(mylex * m) { delete m; } ostream & mylex::ShowStack(ostream & f){ for (int i=0;i(); ArrayOperator(); ArrayOperator(); } void initArrayDCL() { ArrayDCL(); ArrayDCL(); ArrayDCL(); } */ aType aaaa_knlp; void initArrayDCLlong() { // ArrayOperator(); Dcl_Type(); // Add FH mars 2005 ArrayDCL(); aaaa_knlp = atype*>(); } class OneBinaryOperatorInv_KN_long : public OneOperator { public: OneBinaryOperatorInv_KN_long(basicForEachType * ti) : OneOperator(atype(), ti ,atype()) {} E_F0 * code(const basicAC_F0 & args) const { Expression p=args[1]; if ( ! p->EvaluableWithOutStack() ) { bool bb=p->EvaluableWithOutStack(); cout << bb << " " << * p << endl; CompileError("Inverse: int[int] I, array, with I^p, The p must be a constant == -1, sorry");} long pv = GetAny((*p)(NullStack)); if (pv !=-1) { char buf[100]; sprintf(buf,"Inverse: int[int] I, array, I^%ld, The pow must be == -1, sorry",pv); CompileError(buf);} return new E_F_F0 >(Build >,to< KN_ >(args[0])); } }; // end Hack // Add mars 2010 template R * set_init_init( R* const & a,const long & n){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << n << endl); a->init(n); for (int i=0;i * const & a,long const & b) { ffassert( a && b >=0 && b < a->size()); String & Sret = (*a)[b]; // correction FH feb 2004 // delete b; la chaine est detruire automatiquement en fin d'instruction FH jan 2010 return Sret.getap();} template inline AnyType Destroy_KN(Stack,const AnyType &x){ KN * a=GetAny*>(x); for (int i=0;iN(); i++) (a)[i].destroy(); a->destroy(); return Nothing; } // fin add template struct set_Inv_KN_long: public binary_function { static A f(const A & a, B const & b) { int n=a.N(); KN_ I(b.t); for(int i=0;i=0 && j struct set_Inv_pKN_longI: public binary_function { static A f(const A & a, B const & b) { KN_ I(b.t); int n=I.max()+1; a->init(n); (*a)=-1; for(int i=0;i=0 && j(); // to def inverse permutation // Add FH mars 2005 TheOperators->Add("^", new OneBinaryOperatorInv_KN_long(atype >() )); //- TheOperators->Add("^", new OneBinaryOperatorInv_KN_long(atype *>() )) ; aatypeknlongp= atype*>(); // for compilation error with g++ 3.2.2 Add >("sort",".",new OneOperator1_,KN_ >(SortKn >)); // Add >("sort",".",new OneOperator1_,KN >(SortKn >)); Add *>("sort",".",new OneOperator1_*,KN* >(SortpKn)); Global.Add("sort","(",new OneOperator2_*,KN*,KN* >(SortpKn2)); // ArrayDCL(); Dcl_TypeandPtr_,KN *>(0,0,0,::Destroy >, ::ClearReturnKK_,KN_ >,::ClearReturnpKK >); atype* >()->Add("[","",new OneOperator2_*,long >(get_elements)); TheOperators->Add("<-", new OneOperator2_ *,KN *,long>(&set_init_init), new InitArrayfromArray*,true> ); map_type_of_map[make_pair(atype(),atype())]=atype*>(); // vector Add *>("n",".",new OneOperator1 *>(get_n)); extern KN *pkarg; Global.New("ARGV",CPValue >(*pkarg));// add FH mars 2010 Global.Add("toZarray","(",new OneOperator_2KN_); TheOperators->Add("=", new OneBinaryOperator ,Inv_KN_long > > ); TheOperators->Add("<-", new OneBinaryOperator*,Inv_KN_long > > ); Add *>("imin",".",new OneOperator1 *>(get_imin)); Add *>("imax",".",new OneOperator1 *>(get_imax)); Add *>("imin",".",new OneOperator1 *>(get_imin));// Add april 2018 FH Add *>("imax",".",new OneOperator1 *>(get_imax));// Add april 2018 FH Add *>("jmin",".",new OneOperator1 *>(get_jmin));// Add april 2018 FH Add *>("jmax",".",new OneOperator1 *>(get_jmax));// Add april 2018 FH TheOperators->Add("ijmax",new OneOperator3_ *,long*,long*>(get_ijmax));// Add april 2018 FH TheOperators->Add("ijmin",new OneOperator3_ *,long*,long*>(get_ijmin));// Add april 2018 FH // madd FH. march 2015 ... Global.Add("Unique", "(", new Unique); Global.Add("Unique", "(", new Unique); // convertion double -> long (via lround) Dcl_Type >(); Global.Add("lround","(",new OneOperator1F_KN_,K,double,KN_ >(lround)); TheOperators->Add("=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("+=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("-=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("/=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("*=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("<-",new InitMapfromArray*,string *,string*,true> ); TheOperators->Add("<<", new OneBinaryOperator * > > // ADD mai 2018 FH. ); } void xxxx() { } freefem++-3.61-1/src/fflib/ffapi.hpp000755 000767 000024 00000010317 13256636774 017277 0ustar00hechtstaff000000 000000 /// \file /// ====================================================================== /// Written by Antoine Le Hyaric /// Laboratoire Jacques-Louis Lions /// Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France /// http://www.ljll.math.upmc.fr/lehyaric /// ====================================================================== /// 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 /// ====================================================================== /// headeralh cpp freefem start=21/01/10 upmc // Proposed FreeFem++ Application Programming Interface // ---------------------------------------------------- // headerfilter #ifndef FFAPI_HPP #include #include #include #include using namespace std; #endif //FFAPI_HPP #ifndef FFAPI_HPP #define FFAPI_HPP // void ff_finalize(); // void ff_atend( void (*atendff)()); typedef void (*AtEnd)(); void ff_atend(AtEnd f); // big change F. Hecht Frev 2015 // passe all function by pointer namespace ffapi{ extern bool ff_ch2edpdtmpir; extern bool ff_justcompile; // Redirecting the FF data stream // ------------------------------ // Getting a pointer to FF stdin and stdout enables extra DLLs to use standard IO even when they are redirected (eg // through FFCS). void init (); // <> def all pointeur [[file:ffapi.cpp::init]] // need #include // need #include // need using namespace std; extern std::istream * (*cin)(); extern std::ostream *(*cout)(); extern std::ostream *(*cerr)(); // <> Cannot name these functions identically to the original file pointers under MingW32 (compile // error). Impacts [[file:InitFunct.hpp::LOADINITIO]]. Changed from stdxxx_ptr() to ffstdxxx() according to the way FF // itself was changed. extern FILE *(*ffstdout)(); extern FILE *(*ffstderr)(); extern FILE *(*ffstdin)(); /// Initiate graphical pipe output. I need a separate function for this to warn ffcs to check the corresponding ffglut /// magic number extern size_t (*fwriteinit)(const void *ptr, size_t size, size_t nmemb,FILE *stream); /// Indicates the begining of a new plot to avoid sending socket control data with each plot item. extern void (*newplot)(); /// Redefinition of standard system calls extern FILE *(*ff_popen)(const char *command, const char *type); extern int (*ff_pclose)(FILE *stream); extern size_t (*ff_fwrite)(const void *ptr, size_t size, size_t nmemb,FILE *stream); extern int (*ff_fflush)(FILE *stream); extern int (*ff_ferror)(FILE *stream); extern int (*ff_feof)(FILE *stream); // Windows file mode // ----------------- /// Changing file mode needs to be disabled when the file is a TCP socket to FFCS. Since the treatment is different in /// FF and in FFLANG executables, they have to be stored in a DLL that changes between these two programs. extern void (*wintextmode)(FILE *f); extern void (*winbinmode)(FILE *f); // Transfer basic MPI control // -------------------------- extern void (*mpi_init)(int &argc, char **& argv); extern void (*mpi_finalize)(); // Permanent server control // ------------------------ /// if true, FF is considered to be accessible from remote anonymous connections and some commands (like shell /// commands) are not allowed. extern bool (*protectedservermode)(); extern void ifchtmpdir(); extern long chtmpdir(); } #endif // FFAPI_HPP /// Local Variables: /// mode:c++ /// ispell-local-dictionary:"british" /// coding:utf-8 /// End: freefem++-3.61-1/src/fflib/array_init.hpp000644 000767 000024 00000002131 13256636774 020343 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ void initArrayDCLComplex(); void initArrayOperatorComplex(); // void initArrayDCLdouble(); void initArrayOperatordouble(); // void initArrayDCLlong(); void initArrayOperatorlong(); // void initStringOperator(); freefem++-3.61-1/src/fflib/lgmesh.cpp000644 000767 000024 00000171466 13321622623 017453 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ /* #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include "RNM.hpp" #include "fem.hpp" #include "FESpacen.hpp" #include "FESpace.hpp" //#include "fem3.hpp" #include "MeshPoint.hpp" #include #include "Operator.hpp" #include #include #include #include "lex.hpp" #include "Mesh2.h" #include "BamgFreeFem.hpp" #include "lgfem.hpp" */ #include "ff++.hpp" #include "AFunction_ext.hpp" #include "lgmesh.hpp" using Fem2D::Mesh; using Fem2D::MeshPoint; extern bool NoWait; typedef Mesh const * pmesh; class classBuildMesh : public E_F0mps { public: typedef pmesh Result; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =5; Expression nargs[n_name_param]; Expression getborders; long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} double arg(int i,Stack stack,double a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} KNM* arg(int i,Stack stack,KNM* p) const{ return nargs[i] ? GetAny*>( (*nargs[i])(stack) ): p;} classBuildMesh(const basicAC_F0 & args) { args.SetNameParam(n_name_param,name_param,nargs); getborders=to(args[0]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype());} static E_F0 * f(const basicAC_F0 & args){ return new classBuildMesh(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; class classBuildMeshArray : public E_F0mps { public: typedef pmesh Result; //static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =0; //Expression nargs[n_name_param]; Expression env,ent,enbe; Expression ev,et,ebe; classBuildMeshArray(const basicAC_F0 & args) { args.SetNameParam(0,0,0); env=to(args[0]); ent=to(args[1]); enbe=to(args[2]); ev=to >(args[3]); et=to >(args[4]); ebe=to >(args[5]); } static ArrayOfaType typeargs() { aType ffint =atype< long >(); aType ffMi =atype< KNM_ >(); aType ffMr =atype< KNM_ >(); return ArrayOfaType(ffint,ffint,ffint,ffMr,ffMi,ffMi);} static E_F0 * f(const basicAC_F0 & args){ return new classBuildMeshArray(args);} AnyType operator()(Stack s) const { long nv = GetAny((*env)(s)); long nt = GetAny((*ent)(s)); long nbe = GetAny((*enbe)(s)); KNM_ xyl( GetAny >((*ev)(s))); KNM_ nut( GetAny >((*et)(s))); KNM_ nube( GetAny >((*ebe)(s))); using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; using Fem2D::MeshPointStack; // Mesh(int nbv,int nbt,int nbeb,Vertex *v,Triangle *t,BoundaryEdge *b); cout << nv << " " << nt << " " << nbe << endl; cout << xyl.N() << " "<< xyl.M() << endl; cout << nut.N() << " "<< nut.M() << endl; cout << nube.N() << " "<< nube.M() << endl; ffassert(xyl.N() >=nv && xyl.M() >= 3); ffassert(nut.N() >=nt && nut.M() >= 4); ffassert(nube.N() >=nbe && nube.M() >= 3); Vertex *v= new Vertex [nv]; Triangle *t= new Triangle[nt]; BoundaryEdge *b = new BoundaryEdge[nbe]; for(int i=0;iBoundingBox(Pn,Px); if(!pth->quadtree) pth->quadtree=new Fem2D::FQuadTree(pth,Pn,Px,pth->nv); return Add2StackOfPtr2FreeRC(s,pth);// 07/2008 FH } operator aType () const { return atype();} }; basicAC_F0::name_and_type classBuildMesh::name_param[]= { { "nbvx", &typeid(long)} , {"fixeborder", &typeid(bool)},// obsolete {"points", &typeid(KNM*)}, {"fixedborder", &typeid(bool)}, {"alea", &typeid(double)} }; // modif aout 2007 class BuildMeshFile : public E_F0mps { public: typedef pmesh Result; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =1; Expression nargs[n_name_param]; Expression getfilename; long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} BuildMeshFile(const basicAC_F0 & args) { args.SetNameParam(n_name_param,name_param,nargs); getfilename=to(args[0]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype());} static E_F0 * f(const basicAC_F0 & args){ return new BuildMeshFile(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; basicAC_F0::name_and_type BuildMeshFile::name_param[]= { { "nbvx", &typeid(long) } }; // fin modif 2007 class MoveMesh : public E_F0mps { public: typedef pmesh Result; Expression getmesh; Expression U,V; int nbsol; vector sol; MoveMesh(const basicAC_F0 & args) :nbsol(args.size()-2),sol(args.size()-2) { using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; // using Fem2D::R; using Fem2D::MeshPointStack; args.SetNameParam(); getmesh=to(args[0]); const E_Array * a = dynamic_cast(args[1].LeftValue()); ffassert(a); if (a->size() !=2) CompileError("movemesh(Th,[u,v],...) need 2 componate in array ",atype()); U=to( (*a)[0]); V=to( (*a)[1]); for (int i=2;i(args[i]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new MoveMesh(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; class SplitMesh : public E_F0mps { public: typedef pmesh Result; Expression getmesh; Expression U; SplitMesh(const basicAC_F0 & args) { args.SetNameParam(); getmesh=to(args[0]); U = to(args[1]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype());} static E_F0 * f(const basicAC_F0 & args){ return new SplitMesh(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; class SaveMesh : public E_F0 { public: typedef pmesh Result; Expression getmesh; Expression filename; Expression xx,yy,zz; SaveMesh(const basicAC_F0 & args) { xx=0; yy=0; zz=0; args.SetNameParam(); getmesh=to(args[0]); filename=to(args[1]); if (args.size() >2) { const E_Array * a = dynamic_cast(args[2].LeftValue()); if (!a) CompileError("savemesh(Th,\"filename\",[u,v,w],..."); int k=a->size() ; // cout << k << endl; if ( k!=2 && k !=3) CompileError("savemesh(Th,\"filename\",[u,v,w]) need 2 or 3 componate in array ",atype()); xx=to( (*a)[0]); yy=to( (*a)[1]); if(k==3) zz=to( (*a)[2]); } } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new SaveMesh(args);} AnyType operator()(Stack s) const ; }; class Adaptation : public E_F0mps { public: typedef pmesh Result; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =28; int nbsol; Expression nargs[n_name_param]; Expression getmesh; Expression em11,em22,em12; int typesol[100]; vector sol; int nbcperiodic; Expression *periodic; double arg(int i,Stack stack,double a) const { return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} long* arg(int i,Stack stack,long* a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} int arg(int i,Stack stack,int a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} Adaptation(const basicAC_F0 & args) :nbsol(args.size()-1),sol(args.size()-1) { em11=0; em22=0; em12=0; args.SetNameParam(n_name_param,name_param,nargs); getmesh=to(args[0]); int ksol=0; ffassert(nbsol<100); for (int i=1;i()) { const E_Array * a = dynamic_cast(args[i].LeftValue()); ffassert(a); ksol+=a->size(); } else ksol++; sol.resize(ksol); ksol=0; for (int i=1;i()) { const E_Array * a = dynamic_cast(args[i].LeftValue()); ffassert(a); int N=a->size(); typesol[i-1]=N-1; // ok en 2D if (N<=4) { for (int j=0;j((*a)[j]); } else { lgerror(" Adaptation vecteur a plus de 4 compossantes inconnue"); } } else { typesol[i-1]=0; sol[ksol++]=to(args[i]); } const E_Array * expmetrix = dynamic_cast(nargs[24]); if(expmetrix) { if(expmetrix->nbitem()!=3) ExecError("\nSorry we wait an array with 3 componants in: metrix=[m11,m12,m22]"); em11=(*expmetrix)[0]; em12=(*expmetrix)[1]; em22=(*expmetrix)[2]; if( (*expmetrix)[0].left()!= atype *>() ) CompileError("Sorry the fist array componant in metrix=[m11,m12,m22] must be vector"); if( (*expmetrix)[1].left()!= atype *>() ) CompileError("Sorry the second array componant in metrix=[m11,m12,m22] must be vector"); if( (*expmetrix)[2].left()!= atype *>() ) CompileError("Sorry the third array componant in metrix=[m11,m12,m22] must be vector"); } nbcperiodic=0; periodic=0; GetPeriodic(2,nargs[25],nbcperiodic,periodic); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new Adaptation(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; basicAC_F0::name_and_type Adaptation::name_param[Adaptation::n_name_param] = { { "hmin", &typeid(double)}, // { "hmax", &typeid(double)}, { "err", &typeid(double)}, { "errg", &typeid(double)}, { "nbvx", &typeid(long)}, // 4 { "nbsmooth", &typeid(long)}, { "nbjacoby", &typeid(long)}, { "ratio", &typeid(double)}, { "omega", &typeid(double)}, { "iso", &typeid(bool)}, // 9 { "abserror", &typeid(bool)}, { "cutoff", &typeid(double)}, { "verbosity", &typeid(long)}, { "inquire", &typeid(bool)}, { "splitpbedge", &typeid(bool)}, // 14 { "maxsubdiv", &typeid(double)}, { "anisomax", &typeid(double)}, { "rescaling", &typeid(bool)}, { "keepbackvertices", &typeid(bool)}, { "IsMetric", &typeid(bool)}, // 19 { "power", &typeid(double)}, // 20 { "thetamax", &typeid(double)}, { "splitin2", &typeid(bool) }, { "nomeshgeneration", &typeid(bool) }, { "metric" , &typeid(E_Array)}, // 24 { "periodic" , &typeid(E_Array) },// 25 { "requirededges", &typeid(KN_ ) }, // 26 { "warning", &typeid(long *) } // 27 }; struct Op_trunc_mesh : public OneOperator { class Op: public E_F0mps { public: static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =5; Expression nargs[n_name_param]; Expression getmesh,bbb; long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} bool arg(int i,Stack stack,bool a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} KN * arg(int i,Stack stack) const{ return nargs[i] ? GetAny *>( (*nargs[i])(stack) ): 0;} Op(const basicAC_F0 & args,Expression t,Expression b) : getmesh(t),bbb(b) { args.SetNameParam(n_name_param,name_param,nargs); } AnyType operator()(Stack s) const ; }; E_F0 * code(const basicAC_F0 & args) const { return new Op(args,to(args[0]),to(args[1])) ;} Op_trunc_mesh() : OneOperator(atype(),atype(),atype()) {} }; basicAC_F0::name_and_type Op_trunc_mesh::Op::name_param[Op_trunc_mesh::Op::n_name_param] = { { "split", &typeid(long)}, { "label", &typeid(long)}, { "new2old", &typeid(KN*)}, // ajout FH pour P. Jolivet jan 2014 { "old2new", &typeid(KN*)}, // ajout FH pour P. JoLivet jan 2014 { "renum",&typeid(bool)} }; //extern Fem2D::Mesh * BuildMesh(Stack stack, E_BorderN const * const & b,bool justboundary,int nbvmax,) ; AnyType classBuildMesh::operator()(Stack stack) const { const E_BorderN * borders = GetAny((*getborders)(stack)); long nbvx = arg(0,stack,0L); bool requireborder= arg(3,stack,arg(1,stack,false)); KNM * p=0; p=arg(2,stack,p); double alea = arg(4,stack,0.); ffassert( nbvx >= 0); return SetAny(Add2StackOfPtr2FreeRC(stack,BuildMesh(stack,borders,false,nbvx,requireborder,p,alea))); } AnyType BuildMeshFile::operator()(Stack stack) const { string* filename = GetAny((*getfilename)(stack)); long nbvx = arg(0,stack,0); ffassert( nbvx >= 0); pmesh pmsh=buildmeshbamg( filename,nbvx); Add2StackOfPtr2FreeRC(stack,pmsh);// 07/2008 FH return SetAny(pmsh); } AnyType Op_trunc_mesh::Op::operator()(Stack stack) const { // Remark : F.Hecht feb 2016 ... // WARNING for DDM // trunc(trunc(Th,op1),op2) =trunc(trunc(Th,op2),op1) => no renumbering .... using namespace Fem2D; const Mesh & Th = *GetAny((*getmesh)(stack)); long kkksplit =std::max(1L, arg(0,stack,1L)); long label =arg(1,stack,2L); KN * pn2o = arg(2,stack); KN * po2n = arg(3,stack); KN split(Th.nt); bool renum=arg(4,stack,false);// change to false too dangerous with ddm the trunc must commute in DDM split=kkksplit; long ks=kkksplit*kkksplit; MeshPoint *mp= MeshPointStack(stack),mps=*mp; long kk=0; for (int k=0;kset(Th,K(B),B,K,0); if ( GetAny((*bbb)(stack)) ) kk++; else split[k]=0 ; } if(pn2o) { pn2o->resize(kk*ks); KN &n2o(*pn2o); int l=0; for(int k=0; k< Th.nt; ++k) if( split[k] ) for(int i=0; i< ks; ++i) n2o[l++] = k; } if(po2n) { po2n->resize(Th.nt); KN &o2n(*po2n); int l=0; for(int k=0; k< Th.nt; ++k) if( split[k] ) { o2n[k] = l; l+=ks; } else o2n[k]=-1; } *mp=mps; if (verbosity>1) cout << " -- Trunc mesh: Nb of Triangle = " << kk << " label=" <((*a)(NullStack)); // cout << " va = " << va << endl; if ( va == A() ) { // cout << " va = " << va << endl; return true; } } if (mib && b->EvaluableWithOutStack() ) { B vb = GetAny((*b)(NullStack)); // cout << " vb = " << vb << endl; if ( vb == B() ) { //cout << " vb = " << vb << endl; return true; } } return false; } } static bool ReadOnly() { return RO;} }; // add frev 2007 class TransE_Array: public E_F0 { public: const E_Array * v; int size() const {return v->size();} size_t nbitem() const {return v->size();} bool MeshIndependent(){return v->MeshIndependent();} TransE_Array(const E_Array * e): v(e) {ffassert(e);} AnyType operator()(Stack s) const {ffassert(0);return 0L;} }; // add frev 2007 class opTrans : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} opTrans(): OneOperator(atype(),atype() ) {} E_F0 * code(const basicAC_F0 & args) const { return new TransE_Array(dynamic_cast((Expression) args[0])); } }; /* class opTTrans : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} opTTrans(): OneOperator(atype(),atype() ) {} E_F0 * code(const basicAC_F0 & args) const { return dynamic_cast((Expression) args[0])->v; } }; */ class opDot : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} opDot(aType A, aType B): OneOperator(atype(),A,B) {} opDot(): OneOperator(atype(),atype(),atype() ) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const; }; class opColumn : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} opColumn(aType A, aType B): OneOperator(atype(),A,B) {if( A== basicForEachType::type_C_F0)pref=-100;} opColumn(aType A): OneOperator(atype(),ArrayOfaType(A,true)) {pref=-100;} // opColumn(): OneOperator(atype(),atype(),atype() ) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const; }; class opSum : public OneOperator{ public: const char * op; AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} opSum(const char *opp,aType A, aType B): OneOperator(atype(),A,B),op(opp) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const; }; /* class opArray : public OneOperator{ public: const char * op; AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} opSum(const char *opp,aType A, aType B): OneOperator(atype(),A,B),op(opp) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const; }; */ class opFormal : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} C_F0 (*thecode2)(const basicAC_F0 &args); opFormal(aType A,C_F0 (c2)(const basicAC_F0 &args) ): OneOperator(atype(),A),thecode2(c2) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const { return (*thecode2)(args);} }; // fin frev 2007 // nov 2007 v[i] class opVI : public OneOperator{ public: AnyType operator()(Stack s) const {ffassert(0);return 0L;} bool MeshIndependent() const { return false;} opVI(aType A): OneOperator(atype(),A,atype()) {} E_F0 * code(const basicAC_F0 & ) const {ffassert(0);} C_F0 code2(const basicAC_F0 &args) const; }; // fin nov 2007 // add 2010 feb. FH C_F0 TryConj(const C_F0 & c) { // here put the conj operator ... ArrayOfaType at(c.left()); basicAC_F0_wa p(c); const OneOperator * ff=TheOperators->Find("\'",at); if (ff) { if(verbosity>10) cout << " ( do Conj) " ; return ff->code2(p); } return c; } // fin add 2010 feb. // avril 2007 C_F0 formalMatCofactor(const basicAC_F0 &args) { bool ta =args[0].left()==atype(); const TransE_Array * tea=0; const E_Array * ea=0; if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); assert( ea || tea ); const E_Array & a= ta ? *tea->v : *ea; int ma =1; int na=a.size(); if(na <1 ) CompileError(" Cofactor ([ ...]) "); bool maa= a[0].left()==atype(); if(maa) { ma= a[0].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" a matrix with variable number of columm"); } int na1=na,ma1=ma; if(ta) RNM::Exchange(na1,ma1); if(na1 != ma1) CompileError(" CoFactor: no square matrix "); if(na1 > 3 || ( na1 <1) ) CompileError(" CoFactor: square matrix size is more then 3 "); KNM A(na1,na1); KNM C(na1,na1); if(maa) for (int i=0;i(a[i].LeftValue()); ffassert(li); for (int j=0; j(); const TransE_Array * tea=0; const E_Array * ea=0; if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); assert( ea || tea ); const E_Array & a= ta ? *tea->v : *ea; int ma =1; int na=a.size(); if(na <1 ) CompileError(" trace [ ...] "); bool maa= a[0].left()==atype(); if(maa) { ma= a[0].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" first matrix with variable number of columm"); } int na1=na,ma1=ma; if(ta) RNM::Exchange(na1,ma1); if(na1 != ma1) CompileError(" trace: no square matrix "); KNM A(na1,ma1); if(maa) for (int i=0;i(a[i].LeftValue()); ffassert(li); for (int j=0; j(); const TransE_Array * tea=0; const E_Array * ea=0; if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); assert( ea || tea ); const E_Array & a= ta ? *tea->v : *ea; int ma =1; int na=a.size(); if(na <1 ) CompileError(" trace [ ...] "); bool maa= a[0].left()==atype(); if(maa) { ma= a[0].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" matrix with variable number of columm"); } int na1=na,ma1=ma; if(ta) RNM::Exchange(na1,ma1); if(na1 != ma1) CompileError(" trace: no square matrix "); KNM A(na1,ma1); if(maa) for (int i=0;i(a[i].LeftValue()); ffassert(li); for (int j=0; j struct evalE_mul { static AnyType eval(Stack s,const E_F0 * ab,const E_F0 * a,const E_F0 * b, bool & meshidenp) { A aa = GetAny((*a)(s)) ; B bb = GetAny((*b)(s)) ; R rr(aa*bb); bool mia=a->MeshIndependent(); bool mib=b->MeshIndependent(); if (( aa == A()) && mia ) meshidenp=true; else if(( bb == B()) && mib ) meshidenp=true; else meshidenp = mib && mia; cout << " meshidenp ??? " << meshidenp << " " << rr << endl; return SetAny(static_cast(rr)); } }; istream *Getline(istream * f, string ** s) { if( *s==0) *s=newstring(); getline(*f,**s); size_t l = (**s).length(); if( l > 0 && ((**s)[l-1]=='\r')) (**s).resize(l-1); // return f; } // Fin Add ne marche pas .... // fiun avril 2007 // Hack to Bypass a bug in freefem FH ... template<> class ForEachType: public basicForEachType{public:// correction july 2009..... FH Hoooo.... (Il y a un bug DUR DUR FH ...) ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(void *),sizeof(void *),0,0,iv,id,OOnReturn) { } }; inline double walltime(){ #ifdef HAVE_GETTIMEOFDAY struct timeval currentWallTime; double msecTime; gettimeofday(¤tWallTime, NULL); //time with milliseconds msecTime = ( currentWallTime.tv_sec*1000. + currentWallTime.tv_usec/1000. )/1000.0; // return time with milliseconds return msecTime; #else // add for Pichon mars 2010 time_t currentWallTime; time(¤tWallTime); return (double)currentWallTime; #endif } inline long fftime() { #ifdef HAVE_GETTIMEOFDAY time_t tloc; return time(&tloc); #endif return -1; } long ffstrtol(string* p) { char * pe; const char *pp=p->c_str(); long r = strtol(pp,&pe,10); const char *ppe = pe, *pppe= pp+p->size(); // cout << " .ffstrtol. " << pppe - pe << endl; assert(ppe <= pppe); for(const char *ppe = pe; ppe < pppe; ++ppe) ffassert(isspace(*ppe)); return r; } long ffstrtol(string* p,long d) { char * pe; const char *pp=p->c_str(); long r = strtol(pp,&pe,d); const char *ppe = pe, *pppe= pp+p->size(); // cout << " .ffstrtol. " << pppe - pe << endl; ffassert(ppe <= pppe); for(const char *ppe = pe; ppe < pppe; ++ppe) ffassert(isspace(*ppe)); return r; } double ffstrtod(string* p) { char * pe; const char *pp=p->c_str(); double r = strtod(pp,&pe); const char *ppe = pe, *pppe= pp+p->size(); // cout << " .ffstrtol. " << pppe - pe << endl; ffassert(ppe <= pppe); for(const char *ppe = pe; ppe < pppe; ++ppe) ffassert(isspace(*ppe)); return r; } long atoi(string* p) {return atol(p->c_str());}// add march 2010 double atof(string* p) {return atof(p->c_str());}// add march 2010 double NaN(string* p) { return nan(p->c_str());}// add march 2012 double NaN() {return nan("");}// add march 2012 int ShowAlloc(const char *s,size_t & lg); long ShowAlloc1(string * s,long * np) { size_t lg; long n= ShowAlloc(s->c_str(),lg); *np=lg; return n;} long ShowAlloc1(string * s) { size_t lg; long n= ShowAlloc(s->c_str(),lg); return n;} //template class E_ForAllLoopMapSS { public: typedef String K; typedef String V; typedef string *KK; typedef string *VV; typedef MyMap *Tab; typedef MyMap::iterator TabI ; typedef ForAllLoopOpBase DataL; const DataL *data; E_ForAllLoopMapSS(const DataL *t): data(t){} AnyType f(Stack s) const { TabI ii; Tab t= GetAny(data->tab(s)); KK * i = GetAny(data->i(s)); VV * v = GetAny(data->v(s)); if(verbosity>1000) { // cout << i << " " << j << " " << v << " " << data->epl << endl; cout << " i " << (char*) (void *) i - (char*)(void*) s ; cout << " vi " << (char*) (void *) v - (char*)(void*) s ; cout << endl;} ffassert(i && v); if(t->m) ii=t->m->begin(); bool ok = true; while(ok) { if(verbosity>99999) cout << " new n"; TabI iip=ii++; ok = ii != t->m->end(); String kk = iip->first; String vv = iip->second; const string * pvo=iip->second; *i = kk; *v = vv; const string * pv =*v; // for Windows otherwise trap ???? FH. march 2016 if(verbosity>99999) cout << " b:" << i << " "<< v << " " << kk << " " << vv << endl; data->code(s); if(verbosity>99999) cout << " a:" << i << " "<< v << " " << kk << " " << **v << endl; if( pvo == (const string *) iip->second) // no change m[i]= {if( *v != pv ) // v change iip->second = **v; } else if( *v != pv ) {// v change cerr << " Erreur forall change m[i] and mi (stupide please choosse) \n"; ffassert(0); } if(verbosity>99999) cout << " A;" << i << " "<< v << " " << kk << " " << vv << " ok =" << ok << endl; *i=0; *v=0; if(verbosity>99999) { cout << " 0:" << i << " "<< v << " " << kk << " " << vv << endl; for (TabI iii=t->m->begin();iii!= t->m->end();++iii) cout << " map =" << iii->first << " -> " << iii->second << endl; cout << " end of map " << endl; } // ii=iinext;// } // if(verbosity>99999) cout << "befor end \n"; // data->end(s); // if(verbosity>99999) cout <<"afert end \n"; return Nothing ; } }; double projection(const double & aa, const double & bb, const double & x ) { double a=aa,b=bb; if(a>b) std::swap(a,b); return min(max(a,x),b);} double dist(const double & aa, const double & bb) { return sqrt( aa*aa+bb*bb);} double dist(const double & aa, const double & bb,const double & cc) { return sqrt(aa*aa+bb*bb+cc*cc);} // Add Jan 2017 FH double diffpos(const double & aa, const double & bb) { return aabb ? bb-aa : 0.;} double invdiffnp(const double & aa, const double & bb) { return aa<0. && 0.>bb ? 1./(bb-aa) : 0.;} double invdiff(const double & aa, const double & bb) { double d= aa-bb; return abs(d) < 1e-30 ? d : 1/d;} double invdiff(const double & aa, const double & bb,const double &eps) { double d= aa-bb; return abs(d) < eps ? d : 1/d;} extern double ff_tgv; // Add FH jan 2018 double sign(double x){return (x>0.)-(x<0.); }// Add FH jan 2018 long sign(long x){return (x>0)-(x<0); }// Add FH jan 2018 bool ffsignbit(long x){return signbit(x);} bool ffsignbit(double x){return signbit(x);} template bool pswap(T *a,T *b) {swap(*a,*b);return 0; } void Init_map_type() { TheOperators=new Polymorphic(), TheRightOperators=new Polymorphic(); // cout << sizeof(string) << endl; map_type[typeid(AnyType).name()] = new ForTypeAnyType(); map_type[typeid(void).name()] = new ForTypeVoid(); InitLoop(); Dcl_Type(0); Dcl_TypeandPtr(0,0,::InitializeDef,0); Dcl_TypeandPtr(0,0,::InitializeDef,0); Dcl_TypeandPtr(0,0,::InitializeDef,0); Dcl_TypeandPtr(0,0,::InitializeDef,0); Dcl_Type(); // add FH ... for mpi comm world Dcl_Type(); Dcl_Type(); Dcl_Type(); Dcl_TypeandPtr(0,0,::InitializePtr,::DeletePtr); Dcl_TypeandPtr(0,0,::InitializePtr,::DeletePtr); Dcl_TypeandPtr(0,0,::InitializePtr,::DeletePtr); Dcl_Type< ostream_precis > (); Dcl_Type< ostream_seekp > (); Dcl_Type< istream_seekg > (); Dcl_Type< istream_good > (); Dcl_Type< NothingType > (); Dcl_Type(); Dcl_Type(); // Dcl_Type(); basicForEachType::type_C_F0 = map_type[typeid(C_F0).name()] = new TypeLineFunction; Dcl_Type(); Dcl_Type();// add Dcl_Type(); Dcl_Type(); // string[string] type typedef MyMap MyMapSS; map_type[typeid(MyMapSS*).name()] = new ForEachType(Initialize,Delete) ; map_type_of_map[make_pair(atype(),atype())]=atype(); Dcl_Type(); Dcl_Type >(); initArrayDCLlong(); initArrayDCLdouble(); initArrayDCLComplex(); Dcl_Type(); // <> les types des variables zzzfff->Add("real",typevarreal=atype()); zzzfff->Add("int",atype()); zzzfff->Add("complex",typevarcomplex=atype()); zzzfff->Add("bool",atype()); zzzfff->Add("string",atype()); zzzfff->Add("ifstream",atype()); zzzfff->Add("ofstream",atype()); zzzfff->AddF("func",atype()); // end of know types map_type[typeid(bool).name()]->AddCast( new E_F1_funcT(UnRef), new E_F1_funcT(Cast), new E_F1_funcT(Cast) ); map_type[typeid(long).name()]->AddCast( new E_F1_funcT(UnRef), new E_F1_funcT(Cast), new E_F1_funcT(Cast), new E_F1_funcT(Cast), new E_F1_funcT(Cast), new E_F1_funcT(Cast) ); map_type[typeid(double).name()]->AddCast( new E_F1_funcT(UnRef), new E_F1_funcT(Cast), new E_F1_funcT(Cast) ); map_type[typeid(Complex).name()]->AddCast( new E_F1_funcT(UnRef), new E_F1_funcT(Cast), new E_F1_funcT(Cast) ); map_type[typeid(string*).name()]->AddCast( new E_F1_funcT(UnRefCopyPtr), new E_F1_funcT(FCast), new E_F1_funcT(FCast), new E_F1_funcT(FCast), new E_F1_funcT(FCast) ); // a changer --------------- modif map_type[typeid(string*).name()]->AddCast( new E_F1_funcT(FCast), new E_F1_funcT(FCast) ); map_type[typeid(long).name()]->AddCast(new OneOperator_border_label); Global.New("verbosity",CPValue(verbosity)); Global.New("searchMethod",CPValue(searchMethod)); //pichon Global.New("tgv",CPValue(ff_tgv)); extern long newconvect3;// def in global.cpp Global.New("newconvect",CPValue(newconvect3)); //pichon // <> uses [[file:AFunction.hpp::CConstant]] Global.New("cout",CConstant(&cout)); Global.New("cerr",CConstant(&cerr));// add jan 2014 FH. Global.New("cin",CConstant(&cin)); Global.New("append",CConstant(ios::app)); Global.New("binary",CConstant(ios::binary)); // add FH april 2014 TheOperators->Add("|",new OneBinaryOperator >); // add FH april 2014 Global.New("endl",CConstant("\n")); Global.New("true",CConstant(true)); Global.New("false",CConstant(false)); Global.New("pi",CConstant(3.14159265358979323846264338328)); Global.New("version",CConstant(VersionNumber())); Global.New("showCPU",CPValue(showCPU)); Global.New("CPUTime",CConstant(&showCPU)); // def de Zero et One pZero = new C_F0(CConstant(0.0)); pOne = new C_F0(CConstant(1.0)); pminusOne = new C_F0(CConstant(-1.0)); TheOperators->Add(":", new OneOperatorConst(new EConstant(':')), new OneBinaryOperator, new OneTernaryOperator3); TheOperators->Add("+", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > , new OneBinaryOperator_st > // a changer to do FH string * mars 2006 ); TheOperators->Add("-", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("*", new OneBinaryOperator,OneBinaryOperatorMI,evalE_mul >, new OneBinaryOperator,OneBinaryOperatorMI,evalE_mul >, new OneBinaryOperator,MIMul,evalE_mul >, new OneBinaryOperator, MIMul,evalE_mul >, new OneBinaryOperator,MIMul,evalE_mul >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > ); // add missing operation jan 2017 FH. TheOperators->Add("*", new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("+", new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("-", new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("/", // new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("/", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("%", new OneBinaryOperator > ); TheOperators->Add("+", new OneUnaryOperator >, new OneUnaryOperator >, new OneUnaryOperator >); TheOperators->Add("-", new OneUnaryOperator >, new OneUnaryOperator >, new OneUnaryOperator >); TheOperators->Add("^", new OneBinaryOperator >, // new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, // new OneBinaryOperator >, // new OneBinaryOperator >, new OneBinaryOperator > ); TheOperators->Add("<", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheOperators->Add("<=", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheOperators->Add(">", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // string * mars 2006 ); TheOperators->Add(">=", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheOperators->Add("==", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheOperators->Add("!=", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheOperators->Add("!", new OneUnaryOperator > ); TheOperators->Add("&&", new OneBinaryOperator ); TheOperators->Add("&", new OneBinaryOperator ); TheOperators->Add("||", new OneBinaryOperator ); TheOperators->Add("|", new OneBinaryOperator ); // Unary_Op_Comparaision TheOperators->Add("=", new OneBinaryOperator ,OneBinaryOperatorMIWO >, new OneBinaryOperator ,OneBinaryOperatorMIWO>, new OneBinaryOperator ,OneBinaryOperatorMIWO>, new OneBinaryOperator ,OneBinaryOperatorMIWO>, new OneBinaryOperator // FH string * mars 2006 ); TheOperators->Add("?:", new Operator_Aritm_If, new Operator_Aritm_If, new Operator_Aritm_If, new Operator_Aritm_If, new Operator_Aritm_If // (OK???) to do FH string * mars 2006 ); /* ArrayOperator(); ArrayOperator(); ArrayOperator(); */ // initArrayOperators() ; initArrayOperatorlong(); initArrayOperatordouble(); initArrayOperatorComplex(); initStringOperator(); TheOperators->Add("+=", new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO > ); TheOperators->Add("-=", new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO > ); TheOperators->Add("*=", new OneBinaryOperator ,OneBinaryOperatorMIWO>, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO > ); TheOperators->Add("/=", new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO > ); TheOperators->Add("+", // new OneBinaryOperator >, new AddBorderOperator ); // add frev 2007 TheOperators->Add("\'", new opTrans); // TheOperators->Add("\'", new opTTrans); TheOperators->Add("*",new opDot(atype(),atype() ) ); // a faire mais dur TheOperators->Add("*",new opDot(atype(),atype() ) ); // a faire mais dur TheOperators->Add("*",new opColumn(atype() ) ); // [ ]* C_F0 (all) TheOperators->Add("*",new opColumn(basicForEachType::type_C_F0,atype() ) ); // [ ]* C_F0 (all) TheOperators->Add("*",new opColumn(basicForEachType::type_C_F0,atype() ) ); // [ ]* C_F0 (all) // type_C_F0 TheOperators->Add("::",new opColumn(atype(),atype() ) ); // a faire mais dur TheOperators->Add("*",new opDot(atype(),atype() ) ); // a faire mais dur TheOperators->Add("*",new opDot(atype(),atype() ) ); // a faire mais dur // car le type de retour depent des objets du tableau atype()->Add("[","",new opVI(atype()) ); atype()->Add("[","",new opVI(atype()) ); TheOperators->Add("+",new opSum("+",atype(),atype() ) ); // a faire mais dur TheOperators->Add("+",new opSum("+",atype(),atype() ) ); // a faire mais dur TheOperators->Add("+",new opSum("+",atype(),atype() ) ); // a faire mais dur TheOperators->Add("+",new opSum("+",atype(),atype() ) ); // a faire mais dur TheOperators->Add("-",new opSum("-",atype(),atype() ) ); // a faire mais dur TheOperators->Add("-",new opSum("-",atype(),atype() ) ); // a faire mais dur TheOperators->Add("-",new opSum("-",atype(),atype() ) ); // a faire mais dur TheOperators->Add("-",new opSum("-",atype(),atype() ) ); // a faire mais dur TheOperators->Add(".*",new opSum("*",atype(),atype() ) ); // a faire mais dur TheOperators->Add(".*",new opSum("*",atype(),atype() ) ); // a faire mais dur TheOperators->Add(".*",new opSum("*",atype(),atype() ) ); // a faire mais dur TheOperators->Add(".*",new opSum("*",atype(),atype() ) ); // a faire mais dur TheOperators->Add("./",new opSum("/",atype(),atype() ) ); // a faire mais dur TheOperators->Add("./",new opSum("/",atype(),atype() ) ); // a faire mais dur TheOperators->Add("./",new opSum("/",atype(),atype() ) ); // a faire mais dur // correct in sept. 2009 TheOperators->Add("./",new opSum("/",atype(),atype() ) ); // a faire mais dur // il faut refechir ..... FH // il faut definir le type d'un tableau bof, bof (atype()) TheOperators->Add(">>", new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO >, new OneBinaryOperator,OneBinaryOperatorMIWO > ); TheOperators->Add("<<", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > // FH string * mars 2006 ); TheRightOperators->Add("++", new OneOperator1 >(&RIncremantation)); TheRightOperators->Add("--", new OneOperator1 >(&RDecremantation)); TheOperators->Add("++", new OneOperator1 >(&LIncremantation)); TheOperators->Add("--", new OneOperator1 >(&LDecremantation)); // init TheOperators->Add("<-", new OneOperator2(&set_copyp_new), // FH string * mars 2006 new OneOperator2_(&set_copyp), // new OneOperator2_(&set_copyp), new OneOperator2_(&set_copyp), // mars 2006 new OneOperator2_(&set_copy), // new OneOperator2_(&set_copy_new), // new OneOperator2_(&set_copy_new), // new OneUnaryOperator >, // new OneUnaryOperator >, new OneBinaryOperator >, // FH string * mars 2006 new OneBinaryOperator >, // FH string * mars 2006 new OneTernaryOperator3 > , // FH string * mars 2006 new OneTernaryOperator3 > // FH string * april 2014 ); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); // Add("<-","(", new OneUnaryOperator >); Add("<-","(", new OneUnaryOperator >); // FH string * mars 2006 // Polymorphic * precis =new Polymorphic(); // Add("precision",".",precis); Add("precision",".",new OneOperator1(ostream_precision)); Add("precision",".",new OneOperator1(ostream_precision)); // add FH jan 2010 ... Add("seekp",".",new OneOperator1(ff_oseekp)); Add("seekp",".",new OneOperator1(ff_oseekp)); Add("seekg",".",new OneOperator1(ff_iseekg)); Add("seekg",".",new OneOperator1(ff_iseekg)); Add("tellp",".",new OneOperator1(ff_oseekp)); Add("tellp",".",new OneOperator1(ff_oseekp)); Add("tellg",".",new OneOperator1(ff_iseekg)); Add("tellg",".",new OneOperator1(ff_iseekg)); // Add("(","",new OneOperator1(fftellp), // new OneOperator2(ffseekp)); Add("(","",new OneOperator1(fftellp), new OneOperator2(ffseekp)); Add("(","",new OneOperator1(fftellg), new OneOperator2(ffseekg)); // end add jan 2010 .. Add("(","",new OneOperator1(get_precis), new OneOperator2(set_precis)); // add v 1.41 Add("good",".",new OneOperator1(to_istream_good)); Add("good",".",new OneOperator1(to_istream_good)); Add("good",".",new OneOperator1(to_istream_good)); Add("(","",new OneOperator1(get_good)); Add("eof",".",new OneOperator1(get_eof)); // add v 2.8 Add("scientific",".",new OneOperator1(set_os)); Add("fixed",".",new OneOperator1(set_os)); Add("showbase",".",new OneOperator1(set_os)); Add("noshowbase",".",new OneOperator1(set_os)); Add("showpos",".",new OneOperator1(set_os)); Add("noshowpos",".",new OneOperator1(set_os)); Add("default",".",new OneOperator1(set_os)); Add("flush",".",new OneOperator1(set_os_flush));// ADD may 2010 Add("scientific",".",new OneOperator1(set_os1)); Add("fixed",".",new OneOperator1(set_os1)); Add("showbase",".",new OneOperator1(set_os1)); Add("noshowbase",".",new OneOperator1(set_os1)); Add("showpos",".",new OneOperator1(set_os1)); Add("noshowpos",".",new OneOperator1(set_os1)); Add("default",".",new OneOperator1(set_os1)); Add("flush",".",new OneOperator1(set_os_flush));// ADD may 2010 Global.Add("getline","(",new OneOperator2(Getline)); // add 2.16 Global.Add("trace","(",new opFormal(atype(),formalMatTrace )); Global.Add("det","(",new opFormal(atype(),formalMatDet )); // end add // add 3.20 Global.Add("Cofactor","(",new opFormal(atype(),formalMatCofactor )); TheOperators->Add("[]",new OneOperator_array ); TheOperators->Add("[border]",new OneOperator_border ); Global.Add("cos","(",new OneOperator1(cos)); // Global.Add("square","(",new OneOperator1_(Square)); Global.Add("square","(",new OneOperator1 >(Square));// add FH Mai 2011 Global.Add("square","(",new OneOperator1 >(Square)); Global.Add("square","(",new OneOperator1 >(Square));// add FH Mai 2011 //add for Olivier FH July 2014 Global.Add("sqr","(",new OneOperator1 >(Square));// Global.Add("sqr","(",new OneOperator1 >(Square)); Global.Add("sqr","(",new OneOperator1 >(Square));// Global.Add("round","(",new OneOperator1(round)); // add june 2007 Global.Add("lround","(",new OneOperator1(lround)); // add june 2007 Global.Add("floor","(",new OneOperator1(floor)); // add march 2006 Global.Add("ceil","(",new OneOperator1(ceil)); // add march 2006 Global.Add("rint","(",new OneOperator1(rint)); // add june 2006 Global.Add("lrint","(",new OneOperator1(lrint)); // add mars 2014 Global.Add("sin","(",new OneOperator1(sin)); Global.Add("tan","(",new OneOperator1(tan)); Global.Add("atan","(",new OneOperator1(atan)); Global.Add("sinh","(",new OneOperator1(sinh)); Global.Add("cosh","(",new OneOperator1(cosh)); Global.Add("tanh","(",new OneOperator1(tanh)); Global.Add("atoi","(",new OneOperator1(atoi));// add march 2010 Global.Add("atof","(",new OneOperator1(atof));// add march 2010 Global.Add("strtol","(",new OneOperator1(ffstrtol));// add march 2017 Global.Add("strtol","(",new OneOperator2(ffstrtol));// add march 2017 Global.Add("strtod","(",new OneOperator1(ffstrtod));// add march 2017 #ifdef HAVE_ATANH Global.Add("atanh","(",new OneOperator1(atanh)); #endif Global.Add("asin","(",new OneOperator1(asin)); Global.Add("acos","(",new OneOperator1(acos)); #ifdef HAVE_ASINH Global.Add("asinh","(",new OneOperator1(asinh)); #endif #ifdef HAVE_ACOSH Global.Add("acosh","(",new OneOperator1(acosh)); #endif #ifdef HAVE_ERFC Global.Add("erf","(",new OneOperator1(erf)); Global.Add("erfc","(",new OneOperator1(erfc)); #endif #ifdef HAVE_TGAMMA Global.Add("tgamma","(",new OneOperator1(tgamma)); Global.Add("lgamma","(",new OneOperator1(lgamma)); #endif // function de bessel j0, j1, jn, y0, y1, yn -- bessel functions of first and second kind #ifdef HAVE_JN Global.Add("j0","(",new OneOperator1(j0)); Global.Add("j1","(",new OneOperator1(j1)); Global.Add("jn","(",new OneOperator2(myjn)); Global.Add("y0","(",new OneOperator1(y0)); Global.Add("y1","(",new OneOperator1(y1)); Global.Add("yn","(",new OneOperator2(myyn)); #endif Global.Add("exp","(",new OneOperator1(exp)); Global.Add("log","(",new OneOperator1(log)); Global.Add("log10","(",new OneOperator1(log10)); Global.Add("pow","(",new OneOperator2(pow)); // Global.Add("pow","(",new OneOperator2(pow)); Global.Add("max","(",new OneOperator2_(Max )); Global.Add("min","(",new OneOperator2_(Min )); Global.Add("diffpos","(",new OneOperator2_(diffpos )); // jan 2018 FH Global.Add("invdiffpos","(",new OneOperator2_(invdiffpos )); // jan 2018 FH Global.Add("diffnp","(",new OneOperator2_(diffnp )); // jan 2018 FH Global.Add("invdiffnp","(",new OneOperator2_(invdiffnp )); // jan 2018 FH Global.Add("invdiff","(",new OneOperator2_(invdiff )); // jan 2018 FH Global.Add("invdiff","(",new OneOperator3_(invdiff )); // jan 2018 FH Global.Add("max","(",new OneOperator2_(Max)); Global.Add("min","(",new OneOperator2_(Min)); Global.Add("max","(",new OneOperator3_(Max )); Global.Add("min","(",new OneOperator3_(Min )); Global.Add("max","(",new OneOperator3_(Max)); Global.Add("min","(",new OneOperator3_(Min)); Global.Add("atan2","(",new OneOperator2(atan2)); Global.Add("fmod","(",new OneOperator2(fmod));// add sep 2017 Global.Add("fdim ","(",new OneOperator2(fdim));// add sep 2017 Global.Add("fmax ","(",new OneOperator2(fmax));// add sep 2017 Global.Add("fmin ","(",new OneOperator2(fmin));// add sep 2017 Global.Add("hypot","(",new OneOperator2(hypot));// add Jan 2014 Global.Add("atan","(",new OneOperator2(atan2)); Global.Add("sqrt","(",new OneOperator1(sqrt,2)); Global.Add("abs","(",new OneOperator1(Abs)); Global.Add("abs","(",new OneOperator1(Abs)); Global.Add("cos","(",new OneOperator1_(cos)); Global.Add("sin","(",new OneOperator1_(sin)); Global.Add("sinh","(",new OneOperator1_(sinh)); Global.Add("cosh","(",new OneOperator1_(cosh)); Global.Add("tanh","(",new OneOperator1_(tanh));// Add June 2016 FH.. Global.Add("log","(",new OneOperator1_(log)); // Global.Add("log10","(",new OneOperator1_(log10)); Global.Add("tan","(",new OneOperator1_(tan)); Global.Add("exp","(",new OneOperator1_(exp)); //Complex (* powcc )( const Complex &, const Complex &) =pow; Global.Add("pow","(",new OneBinaryOperator >); //new OneOperator2_(pow )); Global.Add("sqrt","(",new OneOperator1_(sqrt,0)); Global.Add("conj","(",new OneOperator1_(conj,0)); Global.Add("conj","(",new OneOperator1_(RNM::conj,1)); TheOperators->Add("\'",new OneOperator1_(conj,0)); TheOperators->Add("\'",new OneOperator1_(RNM::conj,1)); // add F. Feb 2010 of conj of varf.. Global.Add("imag","(",new OneOperator1_(Imag)); // Big probleme real is a type Add("<--","(",new OneOperator1_(Real)); // Global.Add("real","(",new OneOperator1_(Real)); // Add(typevarreal->right()->name(),".",new OneOperator1_(Real)); // Global.Add(typevarreal->right()->name(),".",new OneOperator1_(Real)); // Add(typevarreal->left()->name(),".",new OneOperator1_(preal)); Global.Add("abs","(",new OneOperator1_(abs)); Global.Add("arg","(",new OneOperator1_(arg)); Global.Add("norm","(",new OneOperator1_(norm)); Global.Add("exit","(",new OneOperator1(Exit)); Global.Add("assert","(",new OneOperator1(Assert)); Global.Add("clock","(",new OneOperator0(CPUtime)); Global.Add("time","(",new OneOperator0(walltime));// add mars 2010 for Pichon. Global.Add("ltime","(",new OneOperator0(fftime));// add mars 2014 ( the times unix fonction) Global.Add("storageused","(",new OneOperator0(storageused)); Global.Add("storagetotal","(",new OneOperator0(storagetotal)); Global.Add("dumptable","(",new OneOperator1(dumptable)); Global.Add("exec","(",new OneOperator1(exec)); //FH string * mars 2006 Global.Add("system","(",new OneOperator1(exec)); //FH string fevr 2011 Global.Add("polar","(",new OneOperator2_(polar)); // rand generator --- unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4; init_by_array(init, length); extern long genrand_int31(void); extern double genrand_real1(void); extern double genrand_real2(void); extern double genrand_real3(void); extern double genrand_res53(void) ; Global.Add("randint32","(",new OneOperator_0(genrandint32)); Global.Add("randint31","(",new OneOperator_0(genrand_int31)); Global.Add("randreal1","(",new OneOperator_0(genrand_real1)); Global.Add("randreal2","(",new OneOperator_0(genrand_real2)); Global.Add("randreal3","(",new OneOperator_0(genrand_real3)); Global.Add("randres53","(",new OneOperator_0(genrand_res53)); Global.Add("randinit","(",new OneOperator1(genrandint)); // NaN and Inf Global.Add("ShowAlloc","(",new OneOperator1(ShowAlloc1));// debuging Global.Add("ShowAlloc","(",new OneOperator2(ShowAlloc1));// debuging Global.Add("NaN","(",new OneOperator0(NaN)); Global.Add("NaN","(",new OneOperator1(NaN)); Global.Add("isNaN","(",new OneOperator1(isNaN)); Global.Add("copysign","(",new OneOperator2(copysign));// Add jan 2018 FH Global.Add("sign","(",new OneOperator1(sign));// Add jan 2018 FH Global.Add("sign","(",new OneOperator1(sign));// Add jan 2018 FH Global.Add("signbit","(",new OneOperator1(ffsignbit));// Add jan 2018 FH Global.Add("signbit","(",new OneOperator1(ffsignbit));// Add jan 2018 FH Global.Add("isInf","(",new OneOperator1(isInf)); Global.Add("isNormal","(",new OneOperator1(isNormal)); Global.Add("chtmpdir","(",new OneOperator0(ffapi::chtmpdir)); Global.Add("projection","(",new OneOperator3_(projection)); Global.Add("dist","(",new OneOperator2_(dist)); Global.Add("dist","(",new OneOperator3_(dist)); Global.Add("swap","(",new OneOperator2(pswap)); Global.Add("swap","(",new OneOperator2(pswap)); Global.Add("swap","(",new OneOperator2(pswap)); Global.Add("swap","(",new OneOperator2(pswap)); Global.Add("swap","(",new OneOperator2(pswap)); atype()->Add("[","",new OneOperator2_(get_elements)); atype()->SetTypeLoop(atype(),atype()); tables_of_identifier.push_back(&Global); TheOperators->Add("<<",new OneBinaryOperator >); TheOperators->Add("{}",new ForAllLoop); // add setw feb 2015 FH Global.Add("setw","(",new OneOperator1(defOP_setw)); TheOperators->Add("<<", new OneBinaryOperator >); } //int ShowAlloc(const char *s,size_t & lg); void ClearMem() { size_t lg; ShowAlloc("ClearMem: begin" , lg); delete pZero; delete pOne; delete pminusOne; tables_of_identifier.clear(); for (map::iterator i=map_type.begin();i!=map_type.end();++i) delete i->second; map_type.clear(); map_type_of_map.clear(); map_pair_of_type.clear(); Global.clear(); if(TheOperators) TheOperators->clear(); if(TheRightOperators) TheRightOperators->clear(); CodeAlloc::clear(); ShowAlloc("ClearMem: end" , lg); } // <> static addingInitFunct TheaddingInitFunct(-10000,Init_map_type); C_F0 opVI::code2(const basicAC_F0 &args) const { Expression p=args[1]; if ( ! p->EvaluableWithOutStack() ) { bool bb=p->EvaluableWithOutStack(); //cout << bb << " " << * p << endl; CompileError(" [...][p], The p must be a constant , sorry"); } int pv = GetAny((*p)(NullStack)); bool ta =args[0].left()==atype(); const TransE_Array * tea=0; const E_Array * ea=0; if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); assert( ea || tea ); const E_Array & a= ta ? *tea->v : *ea; // cout << " pv =" << pv << " size = "<< a.size() << endl; //ffassert(pv >=0 && pv (a[i].LeftValue()); ffassert(li && (li->size() >pv)); const C_F0 vi = TryConj( (*li)[pv]); if(i==0) v=vi; else v+= vi; } return C_F0(TheOperators,"[]",v); } if(!(pv >=0 && pv (); bool tb = args[1].left()==atype(); const TransE_Array * tea=0; const TransE_Array * teb=0; const E_Array * ea=0; const E_Array * eb=0;// E_F0 if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); if( tb) teb = dynamic_cast((Expression) args[1]); else eb = dynamic_cast((Expression) args[1]); assert( ea || tea ); assert( eb || teb ); const E_Array & a= ta ? *tea->v : *ea; const E_Array & b= tb ? *teb->v : *eb; int ma =1; int mb =1; int na=a.size(); int nb=b.size(); if(na <1 && nb < 1) CompileError(" empty array [ ...]'*[ ... ] "); bool mab= b[0].left()==atype(); bool maa= a[0].left()==atype(); if(maa) { ma= a[0].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" first matrix with variable number of columm"); } if(mab) { mb= b[1].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" second matrix with variable number of columm"); } int na1=na,ma1=ma,nb1=nb,mb1=mb; if(ta) RNM::Exchange(na1,ma1); if(tb) RNM::Exchange(nb1,mb1); KNM A(na1,ma1), B(nb1,mb1); if ( A.M() != B.N()) { cout << " formal prod array or matrix : [ .. ] * [ .. ] " << endl; cout << " first array : matrix " << maa << " trans " << ta << " " << na << "x" << ma <(a[i].LeftValue()); ffassert(li); for (int j=0; j(b[i].LeftValue()); ffassert(li); for (int j=0; j C(na1,mb1); CC_F0 s,abi; for (int i=0;i(); bool tb = args[1].left()==atype(); const TransE_Array * tea=0; const TransE_Array * teb=0; const E_Array * ea=0; const E_Array * eb=0;// E_F0 if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); if( tb) teb = dynamic_cast((Expression) args[1]); else eb = dynamic_cast((Expression) args[1]); // ffassert( ea || tea ); if( (eb || teb) && ( ea || tea ) ) { const E_Array & a= ta ? *tea->v : *ea; const E_Array & b= tb ? *teb->v : *eb; int ma =1; int mb =1; int na=a.size(); int nb=b.size(); if(na <1 && nb < 1) CompileError(" empty array [ ...]':[ ... ] "); bool mab= b[0].left()==atype(); bool maa= a[0].left()==atype(); if(maa) { ma= a[0].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" first matrix with variable number of columm"); } if(mab) { mb= b[1].LeftValue()->nbitem(); for (int i=1;inbitem()) CompileError(" second matrix with variable number of columm"); } int na1=na,ma1=ma,nb1=nb,mb1=mb; if(ta) RNM::Exchange(na1,ma1); if(tb) RNM::Exchange(nb1,mb1); KNM A(na1,ma1), B(nb1,mb1); if ( (na1!=nb1 ) || (ma1 != mb1) || (na1 * ma1 ==0) ) { cout << "\n formal array or matrix : [ .. ] : [ .. ] " << endl; cout << " first array : matrix " << maa << " trans " << ta << " " << na << "x" << ma <(a[i].LeftValue()); ffassert(li); for (int j=0; j(b[i].LeftValue()); ffassert(li); for (int j=0; j C(na1,mb1); CC_F0 s,aibi; for (int i=0;i [ a0*b',a1*b', const E_Array & a= ta ? *tea->v : *ea; int na=a.size(); AC_F0 v; v = 0; // empty C_F0 b =ta ? TryConj(args[1]) :args[1]; for (int i=0;iv : *eb; int nb=b.size(); C_F0 a =tb ? TryConj(args[0]) :args[0]; AC_F0 v; v = 0; // empty for (int i=0;i(); bool tb = args[1].left()==atype(); const TransE_Array * tea=0; const TransE_Array * teb=0; const E_Array * ea=0; const E_Array * eb=0;// E_F0 if( ta) tea = dynamic_cast((Expression) args[0]); else ea = dynamic_cast((Expression) args[0]); if( tb) teb = dynamic_cast((Expression) args[1]); else eb = dynamic_cast((Expression) args[1]); assert( ea || tea ); assert( eb || teb ); const E_Array & a= ta ? *tea->v : *ea; const E_Array & b= tb ? *teb->v : *eb; int na=a.size(); int nb=b.size(); if(na != nb) CompileError(" formal [ [...] [] ] : [ [..], [..] , ... ] "); AC_F0 v; v = 0; // empty for (int i=0;i999999) cout << p << "=newstring() " <999999) cout << p << "=newstring((string) "<< c << ") \n"; return p;} string *newstring(const char * c){ string * p=new string(c); if(verbosity>999999) cout << p << "=newstring((char*) "<< c << " ) \n"; return p;} void freestring(const string * c){ if(verbosity>999999) cout << c << "freestring( "<< *c <<") \n"; delete c;} freefem++-3.61-1/src/fflib/array_complex.cpp000644 000767 000024 00000010434 13256636774 021047 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "array_tlp.hpp" #include "array_init.hpp" KN_ Get_C2R(KN_ > vc) { ffassert(vc.step==1); complex * pc=vc; // pointeur du tableau double *pr = static_cast(static_cast(pc)); return KN_(pr,vc.N()*2); } template KN_ Get_C2R_(KN_ > vc) { complex * pc=vc; // pointeur du tableau double *pr = static_cast(static_cast(pc)); return KN_(pr+offset,vc.N(),vc.step*2); } template KNM_ Get_C2R_(KNM_ > vc) { complex * pc=vc; // pointeur du tableau double *pr = static_cast(static_cast(pc)); return KNM_(pr+offset,ShapeOfArray(vc.N(),vc.step*2),vc.shapei,vc.shapej); } void initArrayDCLComplex() { ArrayDCL(); Dcl_Type >(); } Complex square(const Complex & x){return x*x;} double imagc(const Complex & x){return imag(x);} double realc(const Complex & x){return realc(x);} void initArrayOperatorComplex() { typedef Complex K; typedef const K & KK; typedef double R; typedef const R & RR; ArrayOperator(); ArrayOperatorF(); // take the real or imag part of complex array Add *>("im",".",new OneOperator1,KN_ >(Get_C2R_<1>,atype * >())); Add >("im",".",new OneOperator1,KN_ >(Get_C2R_<1>,atype >())); Add *>("re",".",new OneOperator1,KN_ >(Get_C2R_<0>,atype * >())); Add >("re",".",new OneOperator1,KN_ >(Get_C2R_<0>,atype >())); Add *>("im",".",new OneOperator1,KNM_ >(Get_C2R_<1>,atype * >())); Add >("im",".",new OneOperator1,KNM_ >(Get_C2R_<1>,atype >())); Add *>("re",".",new OneOperator1,KNM_ >(Get_C2R_<0>,atype * >())); Add >("re",".",new OneOperator1,KNM_ >(Get_C2R_<0>,atype >())); Global.Add("square","(",new OneOperator1F_KN_,K,KK,KN_ >(square)); Global.Add("conj","(",new OneOperator1F_KN_,K,KK,KN_ >(conj)); // Global.Add("imag","(",new OneOperator1F_KN_,R,KK,KN_ >(imagc)); // Add >("<--","(",new OneOperator1F_KN_,R,KK,KN_ >(realc)); TheOperators->Add("*", new OneBinaryOperator,Transpose*>,KN*> >);// A'*b zzzzzzz TheOperators->Add("=",new OneBinaryOperator ,Mul_KNMh_KN_ > > ); TheOperators->Add("<-",new OneBinaryOperator ,Mul_KNMh_KN_ > > ); map_type[typeid(SetArray).name()]->AddCast( new E_F1_funcT,SetArray >(Cast,SetArray >), new E_F1_funcT,SetArray >(Cast,SetArray >) ); Global.Add("toCarray","(",new OneOperator_2KN_); } freefem++-3.61-1/src/fflib/CodeAlloc.cpp000644 000767 000024 00000007270 13256636774 020033 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include #include #include "error.hpp" using namespace std; #include "CodeAlloc.hpp" /* now in global.cpp size_t CodeAlloc::nb=0, CodeAlloc::lg=0,CodeAlloc::nbpx=0,CodeAlloc::chunk=2048; size_t CodeAlloc::nbt,CodeAlloc::nbdl=0; CodeAlloc ** CodeAlloc::mem=0; bool CodeAlloc::sort=true; bool CodeAlloc::cleanning=false; */ static long kerr=0; static long nbsort =0; template static void HeapSort(T *c,long n) { long l,j,r,i; T crit; c--; // on decale de 1 pour que le tableau commence a 1 if( n <= 1) return; l = n/2 + 1; r = n; while (1) { // label 2 if(l <= 1 ) { // label 20 crit = c[r]; c[r--] = c[1]; if ( r == 1 ) { c[1]=crit; return;} } else crit = c[--l]; j=l; while (1) {// label 4 i=j; j=2*j; if (j>r) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } void CodeAlloc::resize() { Sort_mem(); if( nbt*1.5 +10 >= nbpx ) { nbpx = chunk; mem=(CodeAlloc **)realloc(mem,chunk*sizeof(void*)); if(mem) nbpx=chunk; else ErrorExec("Alloc problem",0); chunk *= 3; chunk /= 2; assert(chunk > nbpx); } } void CodeAlloc::Sort_mem() { size_t i,j; if(nbt ==0) return; nbsort++; HeapSort(mem,nbt); for( i=0,j=0;i nbt) ) Sort_mem(); int ib=0,ie=nbt-1,im; if(pp< mem[ib]) ErrorDel(pp); if(pp> mem[ie]) ErrorDel(pp); int p=-1; while( ib < ie ) { im = (ib + ie)/2; { if( pp < mem[im]) ie=im-1; // in [ib , im-1] else if (mem[im] == pp) { p=im;break;} else ib =im+1;// in [im+1 , ie] } } if( p <0 && mem[ib] == pp) p=ib; if(p<0) ErrorDel(pp); else { setdel(p); //le tableau est detruit nbdl++;nb--; ::operator delete(pp); } } freefem++-3.61-1/src/fflib/load.cpp000644 000767 000024 00000012152 13256636774 017120 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "config-wrapper.h" // needed for HAVE_DLFCN_H #include #include #include #include "AFunction.hpp" #include "environment.hpp" #include "InitFunct.hpp" using namespace std; #include "lex.hpp" #define LOAD 1 // ALH - 11/3/15 - added NOLOAD macro option because no dynamic load available in javascript #if defined(__INTEL__) || defined(__MWERKS__) || !defined(HAVE_DLFCN_H) || defined(NOLOAD) #undef LOAD #endif #ifdef LOAD #include #elif _WIN32 #include #endif #include "ffapi.hpp" set SetLoadFile; bool load(string ss) { // FFCS - do not allow potentially dangerous commands from remote anonymous clients if(ffapi::protectedservermode() && (ss=="pipe" || ss=="shell")){ cerr<<"library "< prefix(ffenvironment["loadpath"]); if(prefix.empty()) { prefix.push_back(""); prefix.push_back("./"); } string suffix[nbsuffix] ; suffix[0]=""; suffix[1]=".so"; #ifdef __APPLE__ suffix[1]=".dylib"; #endif #ifdef _WIN32 suffix[1]=".dll"; #endif int j; for (list::const_iterator i= prefix.begin();i !=prefix.end();++i) for ( j= 0;j< nbsuffix;++j) { string s= *i+ss+suffix[j]; #ifdef LOAD handle = dlopen (s.c_str(), RTLD_LAZY ); if (verbosity>9) cout << " test dlopen(" << s << ")= " << handle << endl; // FFCS - 20/9/11 - print explanation for load errors if(verbosity>9 && !handle){ cout<<"load error was: "< 1 && (mpirank ==0)) cout << " (load: dlopen " << s << " " << handle << ") "; callInitsFunct() ; // [[file:InitFunct.cpp::callInitsFunct]] return handle; } #elif _WIN32 { HINSTANCE mod= LoadLibrary(s.c_str()); if (verbosity>9) cout << " test LoadLibrary(" << s << ")= " << mod << endl; if(mod==0) { DWORD merr = GetLastError(); if(verbosity>19) cerr << "\n try loadLibary : " <> Enable statically linked libraries for [[file:~/fflib/Makefile::STATIC_LINKING]] - ALH bool ok=false; // <> [[file:~/ff/examples++-load/msh3.cpp::dynamic_loading]] if(ss=="msh3"){ // [[file:~/ff/examples++-load/msh3.cpp::msh3_Load_Init]] void msh3_Load_Init(); msh3_Load_Init(); ok=true; } // <> [[file:~/ff/examples++-load/medit.cpp::dynamic_loading]] if(ss=="medit"){ // [[file:~/ff/examples++-load/medit.cpp::medit_Load_Init]] void medit_Load_Init(); medit_Load_Init(); ok=true; } if(ok && verbosity && (mpirank ==0)) cout << " (static load: " << ss << " " << ") "; return ok; #else if(mpirank ==0) { cout << "------------------------------------ \n" ; cout << " load: sorry no dlopen on this system " << s << " \n" ; cout << "------------------------------------ \n" ; } CompileError("Error load"); return 0; #endif } if(mpirank ==0) { cerr << "\nload error : " << ss << "\n \t fail : " << endl; char *error=0; #ifndef _WIN32 #ifdef LOAD error= dlerror(); if ( error != NULL) { cerr << " dlerror : " << error << endl; } #endif #endif cerr << "list prefix: " ; for (list::const_iterator i= prefix.begin();i !=prefix.end();++i) cerr <<"'"<<*i<<"' "; cerr << "list suffix : '"<< suffix[0] << "' , '" << suffix[1] << "' "; cerr << endl; } CompileError("Error load"); } return 0 ; } freefem++-3.61-1/src/fflib/ffstack.hpp000644 000767 000024 00000025720 13256636774 017634 0ustar00hechtstaff000000 000000 /// \file // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ //----------------------------------- // to manage the freefem stack #include "throwassert.hpp" // in the stack we save all the variable // a adresse 0 we have the MeshPointStack to defineP,N, .... // a adresse sizeof(void *) // // // Offset in (void *) const int MeshPointStackOffset =0; const int ParamPtrOffset = 1; const int ElemMatPtrOffset = 2; const int ExprPtrs = 4; const int NbPtrs = 5; const int BeginOffset = 6; // 0 : MeshPoint pointeur // 1 : ParamPtrOffset // 2 : Truc les matrice elementaire #define NEWFFSTACKxxx #ifndef NEWFFSTACK typedef void StackType; /// <> typedef void *Stack; const Stack NullStack=0; //typedef StackType& Stack; inline Stack pvoid2Stack(void * pv) { return pv;} template T * Stack_offset (Stack stack,size_t offset) { //cout << "Stack_offset" << stack << " " << offset << endl; return (T *) (void *) (((char *) stack)+offset);} // <> template T * & Stack_Ptr (Stack stack,size_t offset) {return (T * &) (((void **) stack)[offset]);} void ShowType(ostream & f); struct VOIDPtrType { virtual ~VOIDPtrType(); }; template struct PtrType: public VOIDPtrType { T * p; PtrType(T* pp):p(pp) {} ~PtrType() {delete p;} }; template struct PtrArrayType: public VOIDPtrType { T * p; PtrArrayType(T* pp):p(pp) {} PtrArrayType() {delete [] p;} }; #else struct StackType; //typedef void *Stack; /// Stack used by CListOfInst::eval() typedef StackType & Stack; struct StackType { size_t lg; char * stack; char * MeshPointStack; operator char *() { return stack;} operator void *() { return stack;} operator long *() { return (long *)(void *)stack;} operator void **() {return (void **) (void *) stack;} operator StackType *() { return this;} template T * Offset(size_t offset){ return (T*) (void*) (stack+offset);} template T *& ptr(size_t offset){ return (T* &) ((void**) (void *) stack)[offset];} StackType(size_t ll) :lg(ll),stack(new char[ll]),MeshPointStack(new char[1000]) { long * p= ptr(0); long l4=lg/sizeof(long); for (int i = 0;i< l4;i++) p[i]=0; ptr(MeshPointStackOffset)=MeshPointStack; } void clean() { delete []stack; delete [] MeshPointStack; } }; inline Stack pvoid2Stack(void * pv) { return *static_cast(pv) ;} static StackType * NullStackPtr= 0; static StackType & NullStack(*NullStackPtr); //typedef StackType& Stack; template T * Stack_offset (Stack stack,size_t offset) {return stack.Offset(offset);} template T * & Stack_Ptr (Stack stack,size_t offset) {return (T * &) (((void **) (void *) stack.stack)[offset]);} void ShowType(ostream & f); struct VOIDPtrType { virtual ~VOIDPtrType(); }; template struct PtrType: public VOIDPtrType { T * p; PtrType(T* pp):p(pp) {} ~PtrType() {delete p;} }; template struct PtrArrayType: public VOIDPtrType { T * p; PtrArrayType(T* pp):p(pp) {} PtrArrayType() {delete [] p;} }; #endif //------------------------------------ // Add FH mars 2006 // clean pointeur ceated by the language // ---- struct BaseNewInStack { virtual ~BaseNewInStack() {}; }; struct BaseNewInStack; struct StackOfPtr2Free; // <> [[Stack_Ptr]] [[StackOfPtr2Free]] [[ExprPtrs]] inline StackOfPtr2Free * & WhereStackOfPtr2Free(Stack s) { return Stack_Ptr(s,ExprPtrs) ;} // fait // <> struct StackOfPtr2Free { typedef vector::iterator iterator; typedef vector::reverse_iterator reverse_iterator; StackOfPtr2Free ** where; // where is store the ptr to the stack StackOfPtr2Free *prev; // previous stack vector stackptr; static const int sizeofmemory4tmp=1024; int topmemory4tmp; char *memory4tmp ; // void add(BaseNewInStack *p) { // cout << "\n\t\t ### ptr/lg add " << p << " at " << stackptr.size() << " \n"; stackptr.push_back(p);} public: StackOfPtr2Free(Stack s): where(&WhereStackOfPtr2Free(s)), prev(*where), topmemory4tmp(0), // add FH oct 2008 of tmp allocation clean after each instruction memory4tmp(new char[sizeofmemory4tmp]) // add FH oct 2008 of tmp allocation clean after each instruction { stackptr.reserve(20); if(prev) Add2StackOfPtr2Free(s,this); } size_t size() const {return stackptr.size();} // Add FH dec 2017 bool clean(int ssize=0) { topmemory4tmp=0;// clean the tmp allocation bool ret= !stackptr.empty(); if(ret) { 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"; reverse_iterator re= stackptr.rend()-ssize; for (reverse_iterator i=stackptr.rbegin(); i != re;++i) { delete (* (i) ); // cout << "StackOfPtr2Free: clean " << (* (i) ) << " " << endl; } stackptr.resize(ssize);// clean the } return ret; } void * alloc(int lg) { int lg8=lg%8; if(lg8) lg += 8-lg8; 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 (memory4tmp+topmemory4tmp);// correct FH Oct 2009 topmemory4tmp+= lg; return p; } ~StackOfPtr2Free() {clean();delete [] memory4tmp; *where=prev;} // restore the previous stack private:// no copy .... StackOfPtr2Free(const StackOfPtr2Free&); void operator =(const StackOfPtr2Free&); template friend T * NewTmp(Stack s); template friend T * Add2StackOfPtr2Free(Stack s,T * p); }; inline void * NewAllocTmp(Stack s,size_t l) { return WhereStackOfPtr2Free(s)->alloc(l); } template struct NewInStack: public BaseNewInStack { T * p; bool array; ~NewInStack() { // cout << "~NewInStack " << typeid(T).name() << " " << p << " array " << array << " " << this << "\n"; if(p) delete p;} private: NewInStack(T * pp,bool aa=false) : p(pp),array(aa) { // cout << "NewInStack " << typeid(T).name() << " " << p << " array " << aa << " " << this << "\n"; } template friend TT * Add2StackOfPtr2FreeA(Stack s,TT * p); template friend TT * Add2StackOfPtr2Free(Stack s,TT * p); }; extern void freestring(const string *); template<> struct NewInStack : public BaseNewInStack { typedef string T; T * p; bool array; ~NewInStack() { // cout << "~NewInStack " << typeid(T).name() << " " << p << " array " << array << " " << this << "\n"; if(p) freestring(p);} private: NewInStack(T * pp,bool aa=false) : p(pp),array(aa) { // cout << "NewInStack " << typeid(T).name() << " " << p << " array " << aa << " " << this << "\n"; } template friend TT * Add2StackOfPtr2FreeA(Stack s,TT * p); template friend TT * Add2StackOfPtr2Free(Stack s,TT * p); }; // ajout of 2 class NewRefCountInStack and NewArrayInStack // for clean of meshes template struct NewRefCountInStack: public BaseNewInStack { T * p; bool array; ~NewRefCountInStack() { // cout << "~NewInStack " << typeid(T).name() << " " << p << " array " << array << " " << this << "\n"; if(p) p->destroy();} private: NewRefCountInStack(T * pp,bool aa=false) : p(pp),array(aa) { // cout << "NewInStack " << typeid(T).name() << " " << p << " array " << aa << " " << this << "\n"; } template friend TT * Add2StackOfPtr2FreeRC(Stack s,TT * p); }; template struct NewArrayInStack: public BaseNewInStack { T * p; bool array; ~NewArrayInStack() { // cout << "~NewInStack " << typeid(T).name() << " " << p << " array " << array << " " << this << "\n"; if(p) delete [] p; } private: NewArrayInStack(T * pp,bool aa=false) : p(pp),array(aa) { // cout << "NewInStack " << typeid(T).name() << " " << p << " array " << aa << " " << this << "\n"; } template friend TT * Add2StackOfPtr2FreeA(Stack s,TT * p); template friend TT * Add2StackOfPtr2Free(Stack s,TT * p); }; template T * Add2StackOfPtr2FreeRC(Stack s,T * p) { if(p) WhereStackOfPtr2Free(s)->add(new NewRefCountInStack(p)); return p; } template T * Add2StackOfPtr2Free(Stack s,T * p) { if(p) WhereStackOfPtr2Free(s)->add(new NewInStack(p)); return p; } template T * Add2StackOfPtr2FreeA(Stack s,T * p) { if(p) WhereStackOfPtr2Free(s)->add(new NewArrayInStack(p)); return p; } // fin modif gestion of allocation of Ptr in Language // --------------------------------------------------- #ifndef NEWFFSTACK extern void InitMeshPoint(void *p); /// <> inline Stack newStack(size_t l) { char * mps; Stack thestack = new char[l]; for (size_t i = 0;i< l/sizeof(long);i++) ((long*) thestack)[i]=0; ((char **) thestack)[MeshPointStackOffset] = mps = new char [1000]; for(int i=0;i<1000;++i) mps[i]=0; // unset x,y,z InitMeshPoint(mps); // [[WhereStackOfPtr2Free]] [[StackOfPtr2Free]] WhereStackOfPtr2Free(thestack)=new StackOfPtr2Free(thestack); return thestack; // return *new StackType(l);} } inline void deleteStack(Stack s) { delete WhereStackOfPtr2Free(s); // add gestion of the Ptr delete [] (((char **) s)[MeshPointStackOffset]); delete [] (char *) s; // s.clean(); } #else // a faire .... /// Called to create a new #Stack used to evaluate a FreeFem++ script in CListOfInst::eval() inline Stack newStack(size_t l) { /* Stack thestack = new char[l]; for (int i = 0;i< l/sizeof(long);i++) ((long*) thestack)[i]=0; ((char **) thestack)[MeshPointStackOffset] = new char [1000]; return thestack;*/ return *new StackType(l); } inline void deleteStack(Stack s) { // delete [] (((char **) s)[MeshPointStackOffset]); // delete [] (char *) s; s.clean(); } #endif freefem++-3.61-1/src/fflib/Serialize.hpp000644 000767 000024 00000005435 13256636774 020143 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef SERIALEZE_HPP_ #define SERIALEZE_HPP_ #include #include "endian.hpp" struct MPIrank; class Serialize { // we store a refcounter in the pointer p a adresse p-sizeof(long) // so we can use the copy constructor protected: size_t lg; const char *what; char * p; public: Serialize(size_t lgg,const char * wht): lg(lgg), what(wht) , p((new char[lg+sizeof(long)])+sizeof(long)) { //cout << " begin count()=0 " << endl; count()=0; } void resize(size_t lgn) { // Add nov 2010 FH of asyncrone recv MPI ... if (lgn>lg) { char *p0= new char[lgn+sizeof(long)]; memcpy(p0,p-sizeof(long),lg+sizeof(long)); delete [] (p-sizeof(long)); p= p0+sizeof(long); } lg=lgn; } ~Serialize(){ if(count()--==0) delete [] (p-sizeof(long));} size_t size() const { return lg;} // mpi routine void mpisend(const MPIrank &,long tag,const void * comm); Serialize(const MPIrank &,const char * wht,long tag,const void * comm); // end mpi routine operator void *() { return p;} operator char *() { return p;} bool samewhat(const char * w) const { return strncmp(what,w,8)==0; } Serialize(const Serialize & s) : lg(s.lg), what(s.what) , p(s.p) { count()++; } template inline void get(size_t & k,T & x) const { T xx;//= r_endian(x); assert(k<=lg+sizeof(T)); memcpy(&xx,p+ k,sizeof(T)); k += sizeof(T); x=r_endian(xx); } template inline void put(size_t & k,const T & x) { if ( !(k<=lg+sizeof(T)) ) { cout << " assert put " << k << " <=" << lg + sizeof(T) << endl; assert((k<=lg+sizeof(T))); } T xx= w_endian(x); memcpy( p + k,&xx,sizeof(T)); k += sizeof(T); } protected: long & count() const { return * (long*) (void*) (p-sizeof(long));} private: void operator=(Serialize & s) ; // no affectation }; #endif freefem++-3.61-1/src/fflib/problem.hpp000644 000767 000024 00000144762 13312446271 017643 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef PROBLEM_HPP_ #define PROBLEM_HPP_ extern Block *currentblock; template class Matrice_Creuse; template class MatriceCreuse; namespace Fem2D { template class SolveGCPrecon; template class SolveGMRESPrecon; template class SolveGMRESDiag; // int IsoLineK(double *f,R2 *Q,double eps); } #include "P1IsoValue.hpp" template class SolveGCDiag; class Plot; class v_fes; // [[file:lgfem.hpp::v_fes]] // real [[file:lgfem.hpp::FEbase]] using [[file:lgfem.hpp::v_fes]] typedef FEbase * pferbase ; // <> typedef FEbaseArray * pferbasearray ; // <> typedef pair pfer ; // <> typedef pair pferarray ; // <> // complex [[file:lgfem.hpp::FEbase]] using [[file:lgfem.hpp::v_fes]] typedef FEbase * pfecbase ; // <> typedef FEbaseArray * pfecbasearray ; // <> typedef pair pfec ; // <> typedef pair pfecarray ; // <> //typedef pair pmesharray ; typedef LinearComb Finconnue; typedef LinearComb Ftest; typedef LinearComb,C_F0> Foperator; inline int intOp(const MGauche &i) {return i.second;} inline int intOp(const MDroit &i) {return i.second;} inline int intOp(pair & p) {return Max(intOp(p.first),intOp(p.second));} inline void SetOp(KN_ & d,const MGauche &i) { d[i.second% last_operatortype]=true;} inline void SetOp(KN_ & d,const MDroit &i) { d[(int) i.second % last_operatortype]=true;} inline void SetOp(KN_ & d,const pair & p) {SetOp(d,p.first);SetOp(d,p.second);} inline unsigned int GetDiffOp(const MGauche &i, int& lastop) {int op=(i.second% last_operatortype); lastop=max(lastop,op) ; return 1< &p, int& lastop) { return GetDiffOp(p.first,lastop)|GetDiffOp(p.second,lastop);} typedef const Finconnue finconnue; typedef const Ftest ftest; typedef const Foperator foperator; Expression IsFebaseArray(Expression f); void SetArgsFormLinear(const ListOfId *lid,int ordre); inline ostream & operator<<(ostream & f,const TypeSolveMat & tm) { switch(tm.t) { case TypeSolveMat::NONESQUARE: f << "No Square (Sparse Morse)"; break; case TypeSolveMat::LU: f << "LU (Skyline)"; break; case TypeSolveMat::CROUT: f << "CROUT (Skyline)"; break; case TypeSolveMat::CHOLESKY: f << "CHOLESKY (Skyline)"; break; case TypeSolveMat::GC: f << "CG (Sparse Morse)"; break; case TypeSolveMat::GMRES: f << "GMRES (Sparse Morse)"; break; case TypeSolveMat::SparseSolver: f << "SparseSolver (Sparse Morse)"; break; default: f << "Unknown bug???"; } return f; } class C_args: public E_F0mps {public: typedef const C_args * Result; list largs; typedef list ::const_iterator const_iterator ; // il faut expendre C_args() :largs(){} C_args(C_F0 c) : largs() { if(!c.Zero() )largs.push_back(c);} C_args( const basicAC_F0 & args) :largs(){ int n=args.size(); for (int i=0;i< n;i++) { if(args[i].Zero()) ; // skip zero term ... else if (args[i].left() == atype()) { const C_args * a = dynamic_cast(args[i].LeftValue()); for (list::const_iterator i=a->largs.begin();i!=a->largs.end();i++) if( ! i->Zero()) // skip Zero term largs.push_back(*i); } else largs.push_back(args[i]); };} static ArrayOfaType typeargs() { return ArrayOfaType(true);} AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} static E_F0 * f(const basicAC_F0 & args) { return new C_args(args);} bool Zero() const { return largs.empty();} // BIG WARNING April and wrong functon FH v 3.60 ....... bool IsLinearOperator() const; bool IsBilinearOperator() const; }; class C_args_minus: public C_args {public: C_args_minus( const basicAC_F0 & args) { int n=args.size(); ffassert(n==2); if (args[0].left() == atype()) { const C_args * a = dynamic_cast(args[0].LeftValue()); ffassert(a); for (list::const_iterator i=a->largs.begin();i!=a->largs.end();i++) largs.push_back(*i); } else largs.push_back(args[0]); largs.push_back(C_F0(TheOperators,"-",args[1])); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),true);} static E_F0 * f(const basicAC_F0 & args) { return new C_args_minus(args);} }; bool isVF(const list & largs); template class Minus_Form: public E_F0mps {public: typedef const F * Result; static ArrayOfaType typeargs() { return ArrayOfaType(atype());} static E_F0 * f(const basicAC_F0 & args) { int n=args.size(); ffassert(n==1); aType tF=atype(); ffassert(args[0].left() == tF); Result f = dynamic_cast(args[0].LeftValue()); ffassert(f); // F mf = -*f; F * rf=new F(-*f); return rf; } operator aType () const { return atype();} }; //template class BC_set : public E_F0mps { public: bool complextype; typedef const BC_set* Result; vector on; vector onis; vector > bc; // n de l'inconnue+ valeur BC_set( const basicAC_F0 & args) :on(args.size()),onis(args.size()) { int n = args.size(); ffassert(args.named_parameter); AC_F0::const_iterator ii=args.named_parameter->begin(); AC_F0::const_iterator ie=args.named_parameter->end(); bc.resize(args.named_parameter->size()); complextype=false; for (int kk=0;ii!=ie;kk++,ii++) { if( ! BCastTo(ii->second)) complextype = true; } ii=args.named_parameter->begin(); for (int kk=0;ii!=ie;kk++,ii++) { // C_F0 x=Find(ii->first); if (x.left() != atype()) CompileError("We expected an unkown u=... of the problem"); const finconnue * uu = dynamic_cast(x.LeftValue()); ffassert(uu); const MGauche *ui=uu->simple(); ffassert(ui && ui->second == op_id); if(verbosity>9) cout << " on : " << ii->first << " n " << ui->first << " = ? " << endl; if (complextype) bc[kk]= make_pair(ui->first,CastTo(ii->second)); else bc[kk]= make_pair(ui->first,CastTo(ii->second)); //ii->second; } // sort bc / num de composante std::sort(bc.begin(),bc.end()); if(verbosity>9) for (vector >::iterator i=bc.begin(); i !=bc.end();++i) cout <<" on " << i->first << " " << i->second << endl; for (int i=0;i >(args[i])) { on[i]=CastTo(args[i]); onis[i]=0; } else { on[i]=CastTo >(args[i]); onis[i]=1; } } template void CastToK() { aType rr = complextype ? atype() : atype(); if (rr == atype()) complextype= true; if(verbosity > 10) cout << " CastToK => " << complextype < >::iterator k=bc.begin();k!=bc.end();k++) k->second=CastTo(C_F0(k->second,rr)) ; } /* De // ajout modif FH mai 2007 XXXXXXXXXXXXX.... void mappingC(C_F0 (*f)(const C_F0 &)) { for ( vector >::iterator k=bc.begin();k!=bc.end();k++) k->second=CastTo(C_F0(k->second,rr)) ;} // fin ajout */ static ArrayOfaType typeargs() { return ArrayOfaType(/*atype(),*/true);} // change frev 2011 FH... AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} static E_F0 * f(const basicAC_F0 & args) { return new BC_set(args);} // void init(Stack stack) const {} }; class CDomainOfIntegration: public E_F0mps { public: static const int n_name_param =12; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; enum typeofkind { int2d=0, int1d=1, intalledges=2,intallVFedges=3, int3d = 4, intallfaces= 5,intallVFfaces=6 } ; //3d typeofkind kind; // 0 int d; // 3d typedef const CDomainOfIntegration* Result; Expression Th; Expression mapt[3],mapu[3]; vector what; vector whatis; // 0 -> long , 1 -> array ??? CDomainOfIntegration( const basicAC_F0 & args,typeofkind b=int2d,int ddim=2) // 3d :kind(b),d(ddim), Th(0), what(args.size()-1),whatis(args.size()-1) { mapt[0]=mapt[1]=mapt[2]=0; // no map of intergration points for test function mapu[0]=mapu[1]=mapu[2]=0; // no map of intergration points for unknows function args.SetNameParam(n_name_param,name_param,nargs); if(d==2) // 3d Th=CastTo(args[0]); else if(d==3) Th=CastTo(args[0]); else ffassert(0); // a faire int n=args.size(); for (int i=1;i >(args[i]) ) { whatis[i-1]=0; what[i-1]=CastTo(args[i]); } else { whatis[i-1]=1; what[i-1]=CastTo >(args[i]); } const E_Array *pmapt = dynamic_cast(nargs[10]); const E_Array *pmapu = dynamic_cast(nargs[11]); if(pmapt ) { if( pmapt->size() != d ) ErrorCompile("mapt bad arry size ",1); for(int i=0; i((*pmapt)[i]); } if(pmapu ) { if( pmapu->size() != d ) ErrorCompile("mapu bad arry size ",1); for(int i=0; i((*pmapu)[i]); } // cout << " CDomainOfIntegration " << this << endl; } static ArrayOfaType typeargs() { return ArrayOfaType(atype(), true);} // all type AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args);} const Fem2D::QuadratureFormular & FIT(Stack) const ; const Fem2D::QuadratureFormular1d & FIE(Stack) const ; const Fem2D::GQuadratureFormular & FIV(Stack) const ; // 3d long UseOpt(Stack s) const { return nargs[5] ? GetAny( (*(nargs[5]))(s) ) : 1;} double binside(Stack s) const { return nargs[6] ? GetAny( (*(nargs[6]))(s) ) : 0;} // truc pour FH bool intmortar(Stack s) const { return nargs[7] ? GetAny( (*(nargs[7])) (s) ) : 1;} // truc pour double levelset(Stack s) const { return nargs[9] ? GetAny( (*(nargs[9]))(s) ) : 0;} bool islevelset() const { return nargs[9] != 0; } bool withmap() const {return mapu[0] || mapt[0]; } }; class CDomainOfIntegrationBorder: public CDomainOfIntegration { public: CDomainOfIntegrationBorder( const basicAC_F0 & args) :CDomainOfIntegration(args,int1d) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,int1d);} }; class CDomainOfIntegrationAllEdges: public CDomainOfIntegration { public: CDomainOfIntegrationAllEdges( const basicAC_F0 & args) :CDomainOfIntegration(args,intalledges) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,intalledges);} }; class CDomainOfIntegrationVFEdges: public CDomainOfIntegration { public: CDomainOfIntegrationVFEdges( const basicAC_F0 & args) :CDomainOfIntegration(args,intallVFedges) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,intallVFedges);} }; // add for the 3d case .. // 3d class CDomainOfIntegration3d: public CDomainOfIntegration { public: CDomainOfIntegration3d( const basicAC_F0 & args) :CDomainOfIntegration(args,int3d,3) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,int3d,3);} static ArrayOfaType typeargs() { return ArrayOfaType(atype(), true);} // all type }; class CDomainOfIntegrationBorder3d: public CDomainOfIntegration { public: CDomainOfIntegrationBorder3d( const basicAC_F0 & args) :CDomainOfIntegration(args,int2d,3) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,int2d,3);} static ArrayOfaType typeargs() { return ArrayOfaType(atype(), true);} // all type }; class CDomainOfIntegrationAllFaces: public CDomainOfIntegration { public: CDomainOfIntegrationAllFaces( const basicAC_F0 & args) :CDomainOfIntegration(args,intallfaces,3) {} static E_F0 * f(const basicAC_F0 & args) { return new CDomainOfIntegration(args,intallfaces,3);} static ArrayOfaType typeargs() { return ArrayOfaType(atype(), true);} // all type }; // end add // hack build template template struct CadnaType{ typedef T Scalaire; }; #ifdef HAVE_CADNA #include // specialisation template<> struct CadnaType >{ typedef complex Scalaire; }; template<> struct CadnaType { typedef double_st Scalaire; }; inline double_st conj(const double_st &x){ return x;}; inline complex conj(const complex &x){ return complex(x.real(),-x.imag());} inline double norm(complex x){return x.real()*x.real()+x.imag()*x.imag();} inline double norm(double_st x){return x*x;} inline int cestac(const complex & z) {return min(cestac(z.real()),cestac(z.imag()));} #endif class Problem : public Polymorphic { // typedef double R; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =3+NB_NAME_PARM_MAT; // modi FH oct 2005 add tol_pivot 02/ 2007 add nbiter int Nitem,Mitem; const int dim; public: template struct Data { typedef typename FESpace::Mesh Mesh; const Mesh * pTh; CountPointer Uh; CountPointer Vh; CountPointer > AR; CountPointer > AC; typedef CadnaType::Scalaire double_st; typedef CadnaType >::Scalaire cmplx_st; MatriceCreuse * AcadnaR; MatriceCreuse * AcadnaC; void init() {pTh=0; AcadnaR=0;AcadnaC=0; Uh.init(),Vh.init();AR.init();AC.init();} void destroy() { pTh=0; Uh.destroy(); Vh.destroy(); AR.destroy(); AC.destroy(); if(AcadnaR) AcadnaR->destroy(); if(AcadnaC) AcadnaC->destroy(); } } ; const OneOperator *precon; C_args *op; // the list of all operator mutable vector var; // list des var pour les solutions et test bool complextype,VF; // Expression noinit,type,epsilon; Expression nargs[n_name_param]; const size_t offset; Problem(const C_args * ca,const ListOfId &l,size_t & top) ; static ArrayOfaType typeargs() { return ArrayOfaType(true);}// all type Data * dataptr (Stack stack) const {return (Data *) (void *) (((char *) stack)+offset);} Data * dataptr3 (Stack stack) const {return (Data *) (void *) (((char *) stack)+offset);} void init(Stack stack) const { // cout << " init " << (char *) dataptr(stack) - (char*) stack << " " << offset << endl; if(dim==2) dataptr(stack)->init(); else dataptr3(stack)->init(); } void destroy(Stack stack) const { if(dim==2) dataptr(stack)->destroy(); else dataptr3(stack)->destroy(); } template AnyType eval(Stack stack,Data * data,CountPointer > & dataA, MatriceCreuse< typename CadnaType::Scalaire > * & dataCadna) const; AnyType operator()(Stack stack) const { if(dim==2) { Data *data= dataptr(stack); if (complextype) return eval(stack,data,data->AC,data->AcadnaC); else return eval(stack,data,data->AR,data->AcadnaR); } else if(dim==3) { Data *data= dataptr3(stack); if (complextype) return eval(stack,data,data->AC,data->AcadnaC); else return eval(stack,data,data->AR,data->AcadnaR); } else ffassert(0); } bool Empty() const {return false;} size_t nbitem() const { return Nitem;} }; class Solve : public Problem { public: // just a problem with implicit solve Solve(const C_args * ca,const ListOfId &l,size_t & top) : Problem(new C_args(*ca),l,top) {} }; class FormBilinear : public E_F0mps { public: typedef const FormBilinear* Result; typedef const CDomainOfIntegration * A; typedef const foperator * B; A di; Foperator * b; FormBilinear(const basicAC_F0 & args) { di= dynamic_cast(CastTo(args[0])); B bb= dynamic_cast(CastTo(args[1])); // b = bb->Optimize(currentblock); // FH1004 b=new Foperator(*bb); // FH1004 no optimisation here because we don't the type of the bilinear form here. // the opimisation is done after in FieldOfForm routine // to find if the form is real or complex // delete bb; il ne faut pas detruire .. car bb peut etre dans une variable ffassert(di && b); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype());}// all type AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} static E_F0 * f(const basicAC_F0 & args) { return new FormBilinear(args);} FormBilinear(A a,Expression bb) : di(a),b(new Foperator(*dynamic_cast(bb))/*->Optimize(currentblock) FH1004 */) {ffassert(b);} FormBilinear operator-() const { return FormBilinear(di,C_F0(TheOperators,"-",C_F0(b,atype())));} bool VF() const { return MaxOp(b) >= last_operatortype;} int dim() const {return di->d;} FormBilinear(const FormBilinear & fb) : di(fb.di),b(new Foperator(*fb.b) ) {} // void init(Stack stack) const {} }; //template class FormLinear : public E_F0mps { public: typedef const FormLinear* Result; typedef const CDomainOfIntegration * A; typedef const ftest * B; A di; Ftest * l; FormLinear(const basicAC_F0 & args) { di= dynamic_cast(CastTo(args[0])); assert(di); Expression a1=CastTo(args[1]); assert(a1); // cout << " ---FormLinear: "<< a1 << " " << typeid(*a1).name() << *a1 <(a1); assert(ll); l = new Ftest(*ll); // FH1004 ->Optimize(currentblock); same as bilinear // delete ll; // il ne faut pas detruire car ll peut etre dans une variable assert(l); ffassert(di && l); } bool VF() const { return MaxOp(l) >= last_operatortype;} static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype());}// all type AnyType operator()(Stack ) const { return SetAny(this);} operator aType () const { return atype();} int dim() const {return di->d;} static E_F0 * f(const basicAC_F0 & args) { return new FormLinear(args);} FormLinear(A a,Expression bb) : di(a),l(new Ftest(*dynamic_cast(bb))/*->Optimize(currentblock) FH1004 */) {ffassert(l);} FormLinear operator-() const { return FormLinear(di,C_F0(TheOperators,"-",C_F0(l,atype())));} // void init(Stack stack) const {} FormLinear(const FormLinear & fb) : di(fb.di),l(new Ftest(*fb.l) ) {} }; template class Call_FormLinear: public E_F0mps { public: const int d; list largs; Expression *nargs; typedef list::const_iterator const_iterator; const int N; Expression ppfes; Call_FormLinear(int dd,Expression * na,Expression LL, Expression ft) ; AnyType operator()(Stack stack) const { InternalError(" bug: no eval of Call_FormLinear ");} operator aType () const { return atype();} }; template class Call_FormBilinear: public E_F0mps { public: const int d; Expression *nargs; list largs; typedef list::const_iterator const_iterator; const int N,M; Expression euh,evh; Call_FormBilinear(int dd,Expression * na,Expression LL, Expression fi,Expression fj) ; AnyType operator()(Stack stack) const { InternalError(" bug: no eval of Call_FormBilinear ");} operator aType () const { return atype();} }; struct OpCall_FormLinear_np { static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =1; }; struct OpCall_FormBilinear_np { static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =1+NB_NAME_PARM_MAT; // 9-> 11 FH 31/10/2005 11->12 nbiter 02/2007 // 12->22 MUMPS+ Autre Solveur 02/08 }; template struct OpCall_FormLinear : public OneOperator, public OpCall_FormLinear_np { typedef v_fes *pfes; E_F0 * code(const basicAC_F0 & args) const { Expression * nargs = new Expression[n_name_param]; args.SetNameParam(n_name_param,name_param,nargs); return new Call_FormLinear(v_fes::d,nargs,to(args[0]),to(args[1]));} OpCall_FormLinear() : OneOperator(atype*>(),atype(),atype()) {} }; template struct OpCall_FormLinear2 : public OneOperator, public OpCall_FormLinear_np { static const int d=v_fes::d; typedef v_fes *pfes; E_F0 * code(const basicAC_F0 & args) const { Expression * nargs = new Expression[this->n_name_param]; args.SetNameParam(this->n_name_param,this->name_param,nargs); Expression p=args[1]; if ( ! p->EvaluableWithOutStack() ) { CompileError(" a(long,Vh) , The long must be a constant, and = 0, sorry");} long pv = GetAny((*p)(NullStack)); if ( pv ) { CompileError(" a(long,Vh) , The long must be a constant == 0, sorry");} return new Call_FormLinear(v_fes::d,nargs,to(args[0]),to(args[2]));} OpCall_FormLinear2() : OneOperator(atype*>(),atype(),atype(),atype()) {} }; template struct OpCall_FormBilinear : public OneOperator , OpCall_FormBilinear_np { typedef v_fes *pfes; static const int d=v_fes::d; E_F0 * code(const basicAC_F0 & args) const { Expression * nargs = new Expression[n_name_param]; args.SetNameParam(n_name_param,name_param,nargs); // cout << " OpCall_FormBilinear " << *args[0].left() << " " << args[0].LeftValue() << endl; return new Call_FormBilinear(v_fes::d,nargs,to(args[0]),to(args[1]),to(args[2]));} OpCall_FormBilinear() : OneOperator(atype*>(),atype(),atype(),atype()) {} }; bool FieldOfForm( list & largs ,bool complextype); template struct IsComplexType { static const bool value=false;}; template<> struct IsComplexType { static const bool value=true;}; template // to make x=linearform(x) struct OpArraytoLinearForm : public OneOperator { typedef typename Call_FormLinear::const_iterator const_iterator; const bool isptr; const bool init; const bool zero; class Op : public E_F0mps { public: Call_FormLinear *l; Expression x; const bool isptr; const bool init; const bool zero; AnyType operator()(Stack s) const ; Op(Expression xx,Expression ll,bool isptrr,bool initt,bool zzero) : l(new Call_FormLinear(*dynamic_cast *>(ll))), x(xx), isptr(isptrr),init(initt),zero(zzero) {assert(l); bool iscmplx=FieldOfForm(l->largs,IsComplexType::value); //cout<< "FieldOfForm:iscmplx " << iscmplx << " " << IsComplexType::value << " " <<( (iscmplx) == IsComplexType::value) << endl; ffassert( (iscmplx) == IsComplexType::value); } operator aType () const { return atype *>();} }; E_F0 * code(const basicAC_F0 & args) const { if(isptr) return new Op(to *>(args[0]),args[1],isptr,init,zero); else return new Op(to >(args[0]),args[1],isptr,init,zero);} // OpArraytoLinearForm(const basicForEachType * tt) : // OneOperator(atype >(),tt,atype()),init(false),isptr(false) {} OpArraytoLinearForm(const basicForEachType * tt,bool isptrr, bool initt,bool zzero=1) : OneOperator(atype >(),tt,atype*>()), isptr(isptrr), init(initt),zero(zzero) {} }; template // to make A=linearform(x) struct OpMatrixtoBilinearForm : public OneOperator { typedef typename Call_FormBilinear::const_iterator const_iterator; int init; class Op : public E_F0mps { public: Call_FormBilinear *b; Expression a; int init; AnyType operator()(Stack s) const ; Op(Expression aa,Expression bb,int initt) : b(new Call_FormBilinear(* dynamic_cast *>(bb))),a(aa),init(initt) { assert(b && b->nargs); bool iscmplx=FieldOfForm(b->largs,IsComplexType::value) ; // cout<< "FieldOfForm:iscmplx " << iscmplx << " " << IsComplexType::value << " " << ((iscmplx) == IsComplexType::value) << endl; ffassert( (iscmplx) == IsComplexType::value); } operator aType () const { return atype *>();} }; E_F0 * code(const basicAC_F0 & args) const { return new Op(to*>(args[0]),args[1],init);} OpMatrixtoBilinearForm(int initt=0) : OneOperator(atype*>(),atype*>(),atype*>()), init(initt) {} }; template class IntFunction : public E_F0mps { public: typedef R Result; typedef const CDomainOfIntegration * A; typedef R B; A di; Expression fonc; IntFunction(const basicAC_F0 & args) { di= dynamic_cast(CastTo(args[0])); fonc= CastTo(args[1]); ffassert(di && fonc); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype());}// all type AnyType operator()(Stack ) const; static E_F0 * f(const basicAC_F0 & args) { return new IntFunction(args);} // IntFunction(A a,Expression bb) : di(a),fonc(bb) {} operator aType () const { return atype();} }; extern Block *currentblock; class TypeFormOperator: public ForEachType { public: TypeFormOperator() : ForEachType(0,0) {} void SetArgs(const ListOfId *lid) const { SetArgsFormLinear(lid,2); } Type_Expr SetParam(const C_F0 & c,const ListOfId *l,size_t & top) const { return Type_Expr(this,CastTo(c));} inline C_F0 Initialization(const Type_Expr & e) const {return C_F0();} }; class TypeFormBilinear: public ForEachType { public: TypeFormBilinear() : ForEachType(0,0) {} void SetArgs(const ListOfId *lid) const { SetArgsFormLinear(lid,2); } Type_Expr SetParam(const C_F0 & c,const ListOfId *l,size_t & top) const { return Type_Expr(this,CastTo(c));} C_F0 Initialization(const Type_Expr & e) const { // cout << "Initialization " << *e.first << endl; return C_F0(); } // nothing to initialize Type_Expr construct(const Type_Expr & e) const { //cout << "construct " << *e.first << endl; return e; } }; template class TypeSolve : public ForEachType { public: TypeSolve() : ForEachType(0,0) {} void SetArgs(const ListOfId *lid) const { SetArgsFormLinear(lid,2); } Type_Expr SetParam(const C_F0 & c,const ListOfId *l,size_t & top) const { if (c.left() != atype()) CompileError(" Problem a(...) = invalid type ",c.left()); const C_args * ca = dynamic_cast(c.LeftValue()); Problem * pb=new Problem(ca,*l,top); SHOWVERB(cout << "solve:SetParam " << ca << " pb=" << pb << endl); return Type_Expr(this,pb); } class SolveInit: public E_F0 { public: const Problem * a; AnyType operator()(Stack s) const { a->init(s); return exec_init ? (*a)(s) : Nothing ; } SolveInit(const Type_Expr & te) : a(dynamic_cast(te.second)) { SHOWVERB(cout << "SolveInit " << te.second << endl); ffassert(a);} }; class SolveDel: public E_F0 { public: const Problem * a; SolveDel(const C_F0 & c) : a(dynamic_cast(c.LeftValue())) { SHOWVERB(cout << "SolveDel " << c.left() << endl); ffassert(a);} AnyType operator()(Stack s) const { a->destroy(s); return Nothing; }}; Expression Destroy(const C_F0 & c) const { return new SolveDel(c);} bool ExistDestroy() const {return true;} C_F0 Initialization(const Type_Expr & e) const { return C_F0( new SolveInit(e) ,atype()); } }; class TypeFormLinear: public ForEachType { public: TypeFormLinear() : ForEachType(0,0) {} void SetArgs(const ListOfId *lid) const { SetArgsFormLinear(lid,1); } Type_Expr SetParam(const C_F0 & c,const ListOfId *l,size_t & top) const { return Type_Expr(this,CastTo(c));} // { return Type_Expr(c.left(),c.LeftValue()); } // C_F0 Initialization(const Type_Expr & e) const { return C_F0(); } // nothing to initialize }; template class Matrice_Creuse { // CountPointer Uh,Vh; //pfes *pUh,*pVh; // pointeur sur la variable stockant FESpace; public: UniqueffId Uh,Vh; // pour la reconstruction // const void * pUh,pVh; // pointeur pour la reconstruction CountPointer > A; TypeSolveMat typemat; size_t count; void init() { count=0; A.init();Uh.init();Vh.init(); typemat=TypeSolveMat(TypeSolveMat::NONESQUARE);} Matrice_Creuse() { init();} void destroy() {// Correct Oct 2015 FH (avant test a 'envert) !!!! if(count--==0) A.destroy(); //else count--; // Uh.destroy(); //Vh.destroy(); } Matrice_Creuse( MatriceCreuse * aa)//,const pfes *ppUh,const pfes *ppVh) :A(aa){}//,pUh(ppUh),pVh(ppVh),Uh(*ppUh),Vh(*ppVh) {} Matrice_Creuse( MatriceCreuse * aa,const UniqueffId *pUh,const UniqueffId *pVh)//,const pfes *ppUh,const pfes *ppVh) :A(aa),Uh(*pUh),Vh(*pVh) {}//,pUh(ppUh),pVh(ppVh),Uh(*ppUh),Vh(*ppVh) {} long N() const {return A ? A->n : 0;} long M() const { return A ? A->m : 0;} void resize(int n,int m) { if(A) A->resize(n,m);} void increment(){ count++;} }; template class Matrice_Creuse_Transpose; template class Matrix_Prod { public: Matrice_Creuse *A; Matrice_Creuse *B; bool ta,tb; Matrix_Prod(Matrice_Creuse *AA,Matrice_Creuse *BB) : A(AA),B(BB),ta(false),tb(false) {assert(AA && BB);} Matrix_Prod(Matrice_Creuse_Transpose AA,Matrice_Creuse *BB) : A(AA),B(BB),ta(true),tb(false) {assert(AA && BB);} Matrix_Prod(Matrice_Creuse *AA,Matrice_Creuse_Transpose BB) : A(AA),B(BB),ta(false),tb(true) {assert(AA && BB);} Matrix_Prod(Matrice_Creuse_Transpose AA,Matrice_Creuse_Transpose BB) : A(AA),B(BB),ta(true),tb(true) {assert(AA && BB);} }; template ostream & operator << (ostream & f,const Matrice_Creuse & A) { if ( !A.A) f << " unset sparse matrix " << endl; else f << *A.A ; return f; } template istream & operator >> (istream & f,Matrice_Creuse & A) { if ( WhichMatrix(f)== 2 ) { // A.pUh=0; //A.pVh=0; A.A.master(new MatriceMorse(f)); A.typemat=(A.A->n == A.A->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE); // none square matrice (morse) } else { cerr << " unkwon type of matrix " << endl; ExecError("Erreur read matrix "); A.A =0; } return f; } template class Matrice_Creuse_Transpose { public: Matrice_Creuse * A; Matrice_Creuse_Transpose(Matrice_Creuse * AA) : A(AA) {assert(A);} operator MatriceCreuse & () const {return *A->A;} operator Matrice_Creuse * () const {return A;} }; template class Matrice_Creuse_inv { public: Matrice_Creuse * A; Matrice_Creuse_inv(Matrice_Creuse * AA) : A(AA) {assert(A);} operator MatriceCreuse & () const {return *A->A;} operator Matrice_Creuse * () const {return A;} }; namespace Fem2D { inline void F_Pi_h(R* v, const R2 & P,const baseFElement & K,int i,const R2 & Phat,void * arg) { TabFuncArg &tabe(*(TabFuncArg*)arg); //MeshPoint & mp = *MeshPointStack(tabe.s); MeshPointStack(tabe.s)->set(P,Phat,K); tabe.eval(v); // if (Norme2_2(P-mp.P) > 1e-10) // cout << " bug?? F_Pi_h " << endl; } inline void FoX_1_Pi_h(R* v, const R2 & P,const baseFElement & K,int i,const R2 & Phat,void * arg) { TabFuncArg &tabe(*(TabFuncArg*)arg); MeshPointStack(tabe.s)->set(P,Phat,K); R2 X=tabe.eval_X(); MeshPointStack(tabe.s)->set(X.x,X.y); tabe.eval_2(v); } template bool AssembleVarForm(Stack stack,const typename FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, MC * A,KN_ * B,const list &largs ); template void AssembleBC(Stack stack,const typename FESpace::Mesh & Th, const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); template void AssembleLinearForm(Stack stack,const Mesh & Th,const FESpace & Vh,KN_ * B,const FormLinear * const l); // template void AssembleBC(Stack stack,const Mesh3 & Th,const FESpace3 & Uh,const FESpace3 & Vh,bool sym, // MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); template void AssembleLinearForm(Stack stack,const Mesh3 & Th,const FESpace3 & Vh,KN_ * B,const FormLinear * const l); template void AssembleBC(Stack stack,const Mesh & Th3,const FESpace & Uh3,const FESpace & Vh3,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc , double tgv ); template void Element_rhs(const FElement3 & Kv,int ie,int label,const LOperaD &Op,double * p,void * stack,KN_ & B,bool all,int optim); template void Element_rhs(const FElement3 & Kv,const LOperaD &Op,double * p,void * stack,KN_ & B,int optim); template void Element_Op(MatriceElementairePleine & mat,const FElement3 & Ku,const FElement3 & Kv,double * p,int ie,int label, void *stack,R3 *B); template void Element_Op(MatriceElementaireSymetrique & mat,const FElement3 & Ku,double * p,int ie,int label, void * stack,R3 *B); template void AssembleBC(Stack stack,const typename FESpace::Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse * A,KN_ * B,KN_ * X, const list &largs , double tgv ); // fin 3d template void Element_rhs(const FElement & Kv,int ie,int label,const LOperaD &Op,double * p,void * stack,KN_ & B,bool all,int optim); template void Element_rhs(const FElement & Kv,const LOperaD &Op,double * p,void * stack,KN_ & B,int optim); template void Element_Op(MatriceElementairePleine & mat,const FElement & Ku,const FElement & Kv,double * p,int ie,int label, void *stack,R2 *B); template void Element_Op(MatriceElementaireSymetrique & mat,const FElement & Ku,double * p,int ie,int label, void * stack,R2 *B); /*template void AssembleBilinearForm(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, MatriceCreuse & A, const FormBilinear * b ); */ // --------- FH 120105 //template void AssembleBC(Stack stack,const Mesh & Th,const FESpace & Uh,const FESpace & Vh,bool sym, // MatriceCreuse * A,KN_ * B,KN_ * X, const BC_set * bc , double tgv ); //------ } template AnyType OpArraytoLinearForm::Op::operator()(Stack stack) const { typedef v_fes *pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; pfes & pp= *GetAny((*l->ppfes)(stack)); FESpace * pVh = *pp ; FESpace & Vh = *pVh ; double tgv= ff_tgv; if (l->nargs[0]) tgv= GetAny((*l->nargs[0])(stack)); long NbOfDF = pVh ? Vh.NbOfDF: 0; KN *px=0; if(isptr) { px = GetAny * >((*x)(stack) ); if(init ) px->init(NbOfDF); if(px->N() != NbOfDF) //add Dec 2009 { if(!zero ) ExecError("Error in OpArraytoLinearForm += not correct size: n != NbOfDF !"); px->resize(NbOfDF); } ffassert(px->N() == NbOfDF); } KN_ xx( px ? *(KN_ *) px : GetAny >((*x)(stack) )); if(zero && NbOfDF ) xx=R(); if ( pVh && AssembleVarForm,FESpace >(stack,Vh.Th,Vh,Vh,false,0,&xx,l->largs) ) AssembleBC(stack,Vh.Th,Vh,Vh,false,0,&xx,0,l->largs,tgv); return SetAny >(xx); } template struct FF_L_args { typedef KK K; typedef vv_fes v_fes; typedef v_fes *pfes; typedef typename v_fes::FESpace FESpace; typedef FEbase ** R; typedef R A; typedef pfes* B; typedef const CC * C; typedef CC * MC; static bool Check(MC l) {return IsComplexType::value==FieldOfForm(l->largs,IsComplexType::value);} static MC Clone(Expression ll){C l = dynamic_cast(ll);ffassert(l);return new CC(*l); } static void f(KN *x,MC l,A pp,Stack stack) { ffassert(l); double tgv=ff_tgv; if (l->nargs[0]) tgv= GetAny((*l->nargs[0])(stack)); FESpace * pVh= (*pp)->newVh(); KN_ xx=*x; if ( pVh && AssembleVarForm,FESpace >(stack,pVh->Th,*pVh,*pVh,false,0,&xx,l->largs) ) AssembleBC(stack,pVh->Th,*pVh,*pVh,false,0,&xx,0,l->largs,tgv); } }; template void SetSolver(Stack stack,bool VF,MatriceCreuse & A, Data_Sparse_Solver & ds) /*Stack stack,MatriceCreuse & A,const TypeSolveMat *typemat,bool VF,double eps,int NbSpace,int itmax, const OneOperator * const precon,int umfpackstrategy, double tgv, double tol_pivot,double tol_pivot_sym, int *param_int, double *param_double, string *param_char, int *perm_r, int *perm_c, string *file_param_int, string *file_param_double, string *file_param_char, string *file_param_perm_r, string *file_param_perm_c)*/ { using namespace Fem2D; const OneOperator* pprecon= static_cast(ds.precon); if (ds.typemat->profile) { MatriceProfile & AA(dynamic_cast &>(A)); ffassert(&AA); switch (ds.typemat->t) { case TypeSolveMat::LU : AA.typesolver=FactorizationLU; break; case TypeSolveMat::CROUT : AA.typesolver=FactorizationCrout; break; case TypeSolveMat::CHOLESKY : AA.typesolver=FactorizationCholeski; break; default: cerr << " type resolution " << ds.typemat->t <<" sym=" << ds.typemat->profile << endl; CompileError("type resolution unknown"); break; } } else { typedef typename MatriceMorse::VirtualSolver VirtualSolver; if(verbosity>5) cout << " Morse matrix GC Precond diag" << endl; MatriceMorse & AA(dynamic_cast &>(A)); ffassert(&AA); // ffassert(typemat->t==TypeSolveMat::GC); // using Fem2D; switch (ds.typemat->t) { case TypeSolveMat::GC: if (pprecon) AA.SetSolverMaster(static_cast( new Fem2D::SolveGCPrecon(AA,pprecon,stack,ds.itmax,ds.epsilon))); else AA.SetSolverMaster(static_cast( new SolveGCDiag(AA,ds.itmax,ds.epsilon))); break; case TypeSolveMat::GMRES : // InternalError("GMRES solveur to do"); if (pprecon) AA.SetSolverMaster(new SolveGMRESPrecon(AA,pprecon,stack,ds.NbSpace,ds.itmax,ds.epsilon)); else AA.SetSolverMaster(new SolveGMRESDiag(AA,ds.NbSpace,ds.itmax,ds.epsilon)); break; //#ifdef HAVE_LIBUMFPACK case TypeSolveMat::SparseSolver : AA.SetSolverMaster(DefSparseSolver::Build( stack,&AA,ds) ); // AA.SetSolverMaster(new SolveUMFPack(AA,umfpackstrategy,tgv,epsilon,tol_pivot,tol_pivot_sym)); break; //#endif default: if (verbosity >5) cout << " SetSolver:: no default solver " << endl; // cerr << " type resolution " << ds.typemat->t << endl; // CompileError("type resolution inconnue"); break; } } } template AnyType OpMatrixtoBilinearForm::Op::operator()(Stack stack) const { typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; assert(b && b->nargs);// *GetAny pfes * pUh= GetAny((*b->euh)(stack)); pfes * pVh= GetAny((*b->evh)(stack)); const FESpace * PUh = (FESpace*) **pUh ; const FESpace * PVh = (FESpace*) **pVh ; bool A_is_square= PUh == PVh || PUh->NbOfDF == PVh->NbOfDF ; // MatriceProfile *pmatpf=0; bool VF=isVF(b->largs); // assert(!VF); // bool factorize=false; Data_Sparse_Solver ds; ds.factorize=false; /* long NbSpace = 50; long itmax=0; double epsilon=1e-6; double tgv = ff_tgv; int strategy=0; double tol_pivot=-1; double tol_pivot_sym=-1; KN param_int; KN param_double; string *param_char = NULL; KN perm_r; KN perm_c; string *file_param_int; // Add J. Morice 02/09 string *file_param_double; string* file_param_char; string* file_param_perm_r; string* file_param_perm_c; */ TypeSolveMat tmat= ( PUh == PVh ? TypeSolveMat::GMRES : TypeSolveMat::NONESQUARE); ds.typemat=&tmat; ds.initmat=true; SetEnd_Data_Sparse_Solver(stack,ds, b->nargs,OpCall_FormBilinear_np::n_name_param); /* if (b->nargs[0]) initmat= ! GetAny((*b->nargs[0])(stack)); if (b->nargs[1]) typemat= *GetAny((*b->nargs[1])(stack)); if (b->nargs[2]) ds.epsilon= GetAny((*b->nargs[2])(stack)); if (b->nargs[4]) ds.NbSpace= GetAny((*b->nargs[4])(stack)); if (b->nargs[6]) ds.tgv= GetAny((*b->nargs[6])(stack)); if (b->nargs[7]) factorize= GetAny((*b->nargs[7])(stack)); if (b->nargs[8]) ds.strategy= GetAny((*b->nargs[8])(stack)); if (b->nargs[9]) ds.tol_pivot= GetAny((*b->nargs[9])(stack)); if (b->nargs[10]) ds.tol_pivot_sym= GetAny((*b->nargs[10])(stack)); if (b->nargs[11]) ds.itmax= GetAny((*b->nargs[11])(stack)); if (b->nargs[12]) ds.param_int= GetAny< KN >((*b->nargs[12])(stack)); // Add J. Morice 02/09 if (b->nargs[13]) ds.param_double= GetAny< KN >((*b->nargs[13])(stack)); if (b->nargs[14]) ds.param_char= GetAny< string * >((*b->nargs[14])(stack)); // if (b->nargs[15]) ds.perm_r = GetAny< KN< int > >((*b->nargs[15])(stack)); if (b->nargs[16]) ds.perm_c = GetAny< KN< int > >((*b->nargs[16])(stack)); // if (b->nargs[17]) ds.file_param_int= GetAny< string* >((*b->nargs[17])(stack)); // Add J. Morice 02/09 if (b->nargs[18]) ds.file_param_double= GetAny< string* >((*b->nargs[18])(stack)); if (b->nargs[19]) ds.file_param_char= GetAny< string* >((*b->nargs[19])(stack)); // if (b->nargs[20]) ds.file_param_perm_r = GetAny< string* >((*b->nargs[20])(stack)); if (b->nargs[21]) ds.file_param_perm_c = GetAny< string* >((*b->nargs[21])(stack)); // */ if (! A_is_square && *ds.typemat != TypeSolveMat::NONESQUARE) { cout << " -- Error the solver << "<< ds.typemat <<" is set on rectangular matrix " << endl; ExecError("A solver is set on a none square matrix!"); ds.typemat= &(tmat =TypeSolveMat::NONESQUARE); } /* const OneOperator *precon = static_cast (ds.precon); // a changer if ( ds.precon) { // const Polymorphic * op= dynamic_cast(precon); //ffassert(op); precon = ds.precon op->Find("(",ArrayOfaType(atype* >(),false)); } */ // change mars 2011 // for the gestion of the PTR. WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH aout 2007 Matrice_Creuse & A( * GetAny*>((*a)(stack))); if(init) A.init(); // if( ! PUh || ! PVh) return SetAny *>(&A); const FESpace & Uh = *PUh ; const FESpace & Vh = *PVh ; /* if ( (pUh != A.pUh ) || (pVh != A.pVh || A.typemat->t != typemat->t) ) { A.Uh.destroy(); A.Vh.destroy(); }*/ const Mesh & Th = Uh.Th; bool same=isSameMesh(b->largs,&Uh.Th,&Vh.Th,stack); if ( same) { A.typemat = *ds.typemat; if ( A.Uh != Uh || A.Vh != Vh ) { // reconstruct all the matrix A.A=0; // to delete old matrix ADD FH 16112005 A.Uh=Uh; A.Vh=Vh; if (ds.typemat->profile) { A.A.master( new MatriceProfile(Vh,VF) ); ffassert( &Uh == & Vh);} else if (ds.typemat->sym ) { A.A.master( new MatriceMorse(Vh,ds.typemat->sym,VF) ); ffassert( &Uh == & Vh);} else { A.A.master( new MatriceMorse(Vh,Uh,VF) ); // lines corresponding to test functions } } *A.A=R(); // reset value of the matrix if ( AssembleVarForm,FESpace >( stack,Th,Uh,Vh,ds.typemat->sym,A.A,0,b->largs) ) AssembleBC( stack,Th,Uh,Vh,ds.typemat->sym,A.A,0,0,b->largs,ds.tgv); } else { // add FH 17 06 2005 int on different meshes. map, R > AAA; bool bc=AssembleVarForm, R >,FESpace >( stack,Th,Uh,Vh,ds.typemat->sym,&AAA,0,b->largs); if (ds.typemat->profile) { ExecError(" Sorry, construction of Skyline matrix with different meshes is not implemented! ");} else { A.A.master( new MatriceMorse(Vh.NbOfDF,Uh.NbOfDF,AAA,ds.typemat->sym) ); } if (bc) AssembleBC( stack,Th,Uh,Vh,ds.typemat->sym,A.A,0,0,b->largs,ds.tgv); } if( A_is_square && ds.factorize ) { MatriceProfile * pf = dynamic_cast *>((MatriceCreuse *) A.A); assert(pf); switch (ds.typemat->t) { case TypeSolveMat::LU: pf->LU(Abs(ds.epsilon));break; case TypeSolveMat::CROUT: pf->crout(Abs(ds.epsilon));break; case TypeSolveMat::CHOLESKY: pf->cholesky(Abs(ds.epsilon));break; default: ExecError("Sorry no factorize for this type for matrix"); } } if (A_is_square) SetSolver(stack,VF,*A.A,ds); /*stack,*A.A,&typemat,VF,eps,NbSpace,itmax,precon,umfpackstrategy,tgv,tol_pivot,tol_pivot_sym, param_int, param_double, param_char, perm_r, perm_c, file_param_int, file_param_double, file_param_char, file_param_perm_r, file_param_perm_c );*/ return SetAny *>(&A); } bool SetGMRES(); bool SetCG(); #ifdef HAVE_LIBUMFPACK bool SetUMFPACK(); #endif /* template AnyType ProdMat(Stack,Expression ,Expression); template AnyType DiagMat(Stack,Expression ,Expression); template AnyType CopyTrans(Stack stack,Expression emat,Expression eA); template AnyType CopyMat(Stack stack,Expression emat,Expression eA); template AnyType CombMat(Stack stack,Expression emat,Expression combMat); template AnyType MatFull2Sparse(Stack stack,Expression emat,Expression eA); */ namespace FreeFempp { template class TypeVarForm { public: aType tFB; // aType tFB3; aType tMat; aType tMat3; aType tFL; //aType tFL3; aType tTab; aType tMatX; aType tMatTX; aType tDotStar; aType tBC ; // aType tBC3 ; TypeVarForm() : tFB( atype() ), //tFB3( atype *>() ), tMat( atype*>() ), // tMat3( atype*>() ), tFL( atype() ), //tFL3( atype *>() ), tTab( atype *>() ), tMatX( atype::plusAx >() ), tMatTX( atype::plusAtx >() ), tDotStar(atype< DotStar_KN_ >() ), tBC( atype()) { } static TypeVarForm *Global; }; } #endif freefem++-3.61-1/src/fflib/strversionnumber.hpp000644 000767 000024 00000002066 13256636774 021640 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef STRVERSIONNUMBER_HPP #define STRVERSIONNUMBER_HPP #include using namespace std; double VersionNumber(); string StrVersionNumber(); #endif//STRVERSIONNUMBER_HPP freefem++-3.61-1/src/fflib/global.cpp000644 000767 000024 00000013054 13256636774 017443 0ustar00hechtstaff000000 000000 /// \file // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include namespace ffapi { // void init) (); // need #include // need #include // need using namespace std; std::istream * (*cin)(); std::ostream *(*cout)(); std::ostream *(*cerr)(); // <> Cannot name these functions identically to the original file pointers under MingW32 (compile // error). Impacts [[file:InitFunct.hpp::LOADINITIO]]. Changed from stdxxx_ptr() to ffstdxxx() according to the way FF // itself was changed. FILE *(*ffstdout)(); FILE *(*ffstderr)(); FILE *(*ffstdin)(); /// Initiate graphical pipe output. I need a separate function for this to warn ffcs to check the corresponding ffglut /// magic number size_t (*fwriteinit)(const void *ptr, size_t size, size_t nmemb,FILE *stream); /// Indicates the begining of a new plot to avoid sending socket control data with each plot item. void (*newplot)(); /// Redefinition of standard system calls FILE *(*ff_popen)(const char *command, const char *type); int (*ff_pclose)(FILE *stream); // [[file:ffapi.cpp::ff_pclose]] size_t (*ff_fwrite)(const void *ptr, size_t size, size_t nmemb,FILE *stream); int (*ff_fflush)(FILE *stream); int (*ff_ferror)(FILE *stream); int (*ff_feof)(FILE *stream); // Windows file mode // ----------------- /// Changing file mode needs to be disabled when the file is a TCP socket to FFCS. Since the treatment is different in /// FF and in FFLANG executables, they have to be stored in a DLL that changes between these two programs. void (*wintextmode)(FILE *f); void (*winbinmode)(FILE *f); // Transfer basic MPI control // -------------------------- void (*mpi_init)(int &argc, char **& argv); void (*mpi_finalize)(); // Permanent server control // ------------------------ /// if true, FF is considered to be accessible from remote anonymous connections and some commands (like shell /// commands) are not allowed. bool (*protectedservermode)(); } #include "config-wrapper.h" #include #include "AFunction.hpp" #include "error.hpp" #include "lex.hpp" #include "RNM.hpp" #include #include "environment.hpp" #include "ufunction.hpp" using namespace std; #define FF_GRAPH_PTR_DCL #include "rgraph.hpp" #include "fem.hpp" #include "Mesh3dn.hpp" #include "MatriceCreuse_tpl.hpp" #include "MeshPoint.hpp" bool NoGraphicWindow=false; /// <> long verbosity = 1; long searchMethod = 0; //pichon long npichon2d=0, npichon3d=0; long npichon2d1=0, npichon3d1=0; FILE *ThePlotStream=0; // Add for new plot. FH oct 2008 KN *pkarg;// for the list of argument mars 2010 Map_type_of_map map_type_of_map ; // to store te type Map_type_of_map map_pair_of_type ; // to store te type basicForEachType * typevarreal, * typevarcomplex; // type of real and complex variable /// <> see [[file:lex.hpp::mylex]] mylex *zzzfff; bool lexdebug; /// <> see [[file:../lglib/lg.ypp::YYSTYPE]] and [[file:../lglib/lg.ypp::yylval]] #include "lg.tab.hpp" YYSTYPE *plglval; int TheCurrentLine=-1; // unset: by default //int NbNewVarWithDel =0; // add FH sep 2016 (bof bof global variable not got but hard to set in E_F0 or C_F0 long mpisize=0,mpirank=0; C_F0 *pOne=0,*pZero=0,*pminusOne=0; // const C_F0 & One(*pOne), &Zero(*pZero); Polymorphic * TheOperators=0, //=new Polymorphic(), * TheRightOperators=0;//=new Polymorphic(); /// <> Contains all FreeFem++ language keywords. Declaration in [[file:AFunction.hpp::Global]] TableOfIdentifier Global; long E_Border::Count =0; /// <> declared at [[file:AFunction.hpp::tables_of_identifier]] typedef list ListOfTOfId; ListOfTOfId tables_of_identifier; const int AC_F0::MaxSize=1024; // maximal number of parameters map map_type; bool showCPU= false; size_t CodeAlloc::nb=0, CodeAlloc::lg=0,CodeAlloc::nbpx=0,CodeAlloc::chunk=2048; size_t CodeAlloc::nbt,CodeAlloc::nbdl=0; CodeAlloc ** CodeAlloc::mem=0; size_t CodeAlloc::memoryusage=0; bool CodeAlloc::sort=true; bool CodeAlloc::cleanning=false; 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; long newconvect3=0;// old convect 3d CodeAlloc *CodeAlloc::tnull=0; #include RefCounter *RefCounter::tnull=0; double ff_tgv=1e30; void InitMeshPoint(void * p) { EF23::MeshPoint*mps=static_cast(p); mps->unset(); } freefem++-3.61-1/src/fflib/array_tlp.hpp000644 000767 000024 00000214161 13312446271 020167 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ //#pragma dont_inline on //#pragma inline_depth(1) #include "config-wrapper.h" #include #include //#include #include "AFunction.hpp" #include #include #include "error.hpp" #include "lex.hpp" #include "RNM.hpp" #include "Operator.hpp" // for exec routine #include "rgraph.hpp" #include "InitFunct.hpp" #include #include "array_resize.hpp" #include "HeapSort.hpp" template struct affectation: binary_function { T& operator()(T& x, const T& y) const {return (x=y);} }; template struct affectation_add: binary_function { T& operator()(T& x, const T& y) const {return (x+=y);}// correct FH 25/10/2013 }; template struct affectation_sub: binary_function { T& operator()(T& x, const T& y) const {return (x-=y);}// correct FH 25/10/2013 }; extern Map_type_of_map map_type_of_map ; // to store te type extern Map_type_of_map map_pair_of_type ; // to store te type extern basicForEachType * typevarreal, * typevarcomplex; // type of real and complex variable extern int TheCurrentLine; // unset: by default extern long mpisize,mpirank; template inline T Max (const T &a,const T & b){return a > b ? a : b;} template inline T Min (const T &a,const T & b){return a < b ? a : b;} template inline T Abs (const T &a){return a <0 ? -a : a;} template inline T Max (const T &a,const T & b,const T & c){return Max(Max(a,b),c);} template inline T Min (const T &a,const T & b,const T & c){return Min(Min(a,b),c);} template inline T Square (const T &a){return a*a;} template struct Op2_dotproduct: public binary_function >,KN *,K> { static K f( Transpose > const & a, KN * const& b) { return (conj(a.t),*b);} }; template struct Op2_dotproduct_: public binary_function >,KN_ ,K> { static K f( Transpose > const & a, KN_ const& b) { return (conj(a.t),b);} }; template A Build(B b) { return A(b);} template void HeapSort(T *c,long n,long o) { // trie un tableau c de n valeur avec un decalage de o. // le tableau: c[i*o] , pour i = 0 a n-1 long l,j,r,i; T crit; c-=o; // on decale de o pour que le tableau commence a o if( n <= 1) return; l = (n/2 + 1)*o; r = n*o; while (1) { // label 2 if(l <= o ) { // label 20 crit = c[r]; c[r] = c[o]; r-=o; if ( r == o ) { c[o]=crit; return;} } else crit = c[l-=o]; j=l; while (1) {// label 4 i=j; j=2*j; if (j>r) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } template A SortKn(const A & ca) { A a(ca); if(a.n > 0) HeapSort(&a[0],a.n,a.step); return a;} template A SortKn(const A & ca,const B & cb) { cout << "SortKn " << endl; const A &a(ca); const B &b(cb); ffassert(a.n == b.n); ffassert(a.step == b.step && b.step ==1); if(a.n > 0) HeapSort(&a[0],&b[0],a.n); cout << b << endl; return a;} template KN * SortpKn2( KN * const & pa,KN * const & pb){ // cout << " SortpKn2 " << endl; KN &a(*pa); KN &b(*pb); ffassert(a.n == b.n); ffassert(a.step == b.step && b.step ==1); if(a.n > 0) HeapSort(&a[0],&b[0],a.n); return pa;} template KN * SortpKn( KN * const & pa){ KN &a(*pa); if(a.n > 0) HeapSort(&a[0],a.n,a.step); return pa;} template class QuantileKN: public KN_ { public: QuantileKN(const KN_ &a): KN_(a) {} QuantileKN(KN * p): KN_(*p) {} operator R *() const {return this->KN_::operator R *() ;} }; template R Quantile(QuantileKN const & a,const double & q){ KN b(a); HeapSort(b,b.n,b.step); long m=lrint(b.n*q); if( m >= b.n) m=b.n-1; if( m < 0) m=0; R qq=b[m]; // cout << "Quantile: m = " << m << " " << b < RR * get_elementp_(const A & a,const B & b){ if( b<0 || a->N() <= b) { cerr << " Out of bound 0 <=" << b << " < " << a->N() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator []");} return &((*a)[b]);} template KN_ fSubArray(const KN_ & a,const SubArray & b) { return a(b);} template KN_ fSubArrayp( KN * const & a,const SubArray & b) { return (*a)(b);} template KNM_ fSubArraybb(const KNM_ & a,const SubArray & b,const SubArray & c) { return a(b,c);} template KNM_ fSubArraypbb( KNM * const & a,const SubArray & b,const SubArray & c) { return (*a)(b,c);} template KN_ fSubArrayib(const KNM_ & a,const long &i,const SubArray & b) { return a(i,b);} template KN_ fSubArraybi(const KNM_ & a,const SubArray & b,const long &i) { return a(b,i);} template KN_ fSubArraypib( KNM *const & a,const long &i,const SubArray & b) { return (*a)(i,b);} template KN_ fSubArraypbi( KNM *const & a,const SubArray & b,const long &i) { return (*a)(b,i);} template A fSubArrayc(const A & a,const char & b) { return a;} template RR * get_elementp2_(const A & a,const B & b,const C & c){ if( b<0 || a->N() <= b || c<0 || a->M() <= c ) { cerr << " Out of bound 0 <=" << b << " < " << a->N() << " " << c << " < " << a->M() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator (,)");} return &((*a)(b,c));} template RR get_element_is(const A & a,const B & b,const C & c){ // cout << b << " .... " << ((*a)(SubArray(1,b),c)) << endl;; return ((*a)(b,'.')(c));} template RR get_element_si(const A & a,const B & b,const C & c){ // cout << c << " .... " << ((*a)(b,SubArray(1,c) )) << endl;; return ((*a)('.',c)(b));} template struct check_get_element_lineorcol { static void check(const A & a,const B & b,const C & c){ if(c == ':' && (b<0 || a->N() <= b)) ExecError("Out of bound"); if(b == ':' && (c<0 || a->M() <= c)) ExecError("Out of bound"); } }; template struct check_get_element_lineorcol { static void check(const A & a,const B & b,const char & c){ if( (b<0 || a->N() <= b)) ExecError("Out of bound"); } }; template struct check_get_element_lineorcol { static void check(const A & a,const char & b,const B & c){ if( (c<0 || a->M() <= c)) ExecError("Out of bound"); } }; template RR get_element_lineorcol(const A & a,const B & b,const C & c){ // cout << b << " .... " << ((*a)(SubArray(1,b),c)) << endl;; check_get_element_lineorcol::check(a,b,c); return ((*a)(b,c)); } template RR get_element_is_(const A & a,const B & b,const C & c){ // cout << b << " .... " << ((*a)(SubArray(1,b),c)) << endl;; return ((a)(b,'.')(c));} template RR get_element_si_(const A & a,const B & b,const C & c){ // cout << c << " .... " << ((*a)(b,SubArray(1,c) )) << endl;; return ((a)('.',c)(b));} template RR get_element_lineorcol_(const A & a,const B & b,const C & c){ // cout << b << " .... " << ((*a)(SubArray(1,b),c)) << endl;; return ((a)(b,c));} template RR * get_elementp2__(const A & a,const B & b,const C & c){ if( b<0 || a.N() <= b || c<0 || a.M() <= c ) { cerr << " Out of bound 0 <=" << b << " < " << a.N() << " " << c << " < " << a.M() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator (,)");} return &((a)(b,c));} template struct myremove_pointer { typedef T type; }; template struct myremove_pointer { typedef typename myremove_pointer::type type; }; template class InitMapfromArray : public OneOperator { public: typedef typename myremove_pointer::type MMap ; // typedef typename KNR::K RR; typedef Map A; typedef Map R; typedef E_Array B; class CODE : public E_F0 { public: Expression a0; int N; Expression * tab; int * what;// 0 RR, 1 KN, const bool mi; /* static KN_ &set(KN * a,KN *& p,int n){ if(isinit) a->init(n); else a->resize(n); p =a; return *a;}*/ /* static KN_ &set(KN_ & a,KN *& p,int n){p=0;return a;}*/ CODE(Expression a,const E_Array & tt) : a0(a),N(tt.size()), tab(new Expression [N]), what(new int[N]) , mi(tt.MeshIndependent()) { assert(&tt); // int err=0; for (int i=0;i()->CastingFrom(tt[i].right() ) ) { tab[i]=atype()->CastTo(tt[i]); what[i]=1; } else if(i%2==1 && atype()->CastingFrom(tt[i].right() ) ) { tab[i]=atype()->CastTo(tt[i]); what[i]=1; } else CompileError(" InitMapfromArray: we are waiting for Key or Value type"); } AnyType operator()(Stack stack) const { A aa=GetAny((*a0)(stack)); if(isinit) aa->init(); for(int i=0,j=0; i((*(tab[j++]))(stack)); // String sk(*k); Value v= GetAny((*(tab[j++]))(stack)); //cout << "InitMapfromArray "<< *k << " " << (string) sk << " "<< v << endl; aa->insert(*k,v); } return SetAny(aa); } bool MeshIndependent() const {return mi;} // ~CODE() { delete [] tab; delete[] what;} operator aType () const { return atype();} }; // end sub class CODE public: E_F0 * code(const basicAC_F0 & args) const { if(verbosity>9999) cout << "\n code InitMapfromArray:" << *args[0].left() << " " << *args[1].left() << "( "<< *t[0] << " " << *t[1] <<")" <CastTo(args[0]),*dynamic_cast( t[1]->CastTo(args[1]).LeftValue()));} InitMapfromArray(int preff=0): OneOperator(atype(),atype(),atype()) { pref=preff; } }; template class InitArrayfromArray : public OneOperator { public: typedef typename myremove_pointer::type KNR ; typedef typename KNR::K RR; typedef KNRR A; typedef KNRR R; typedef E_Array B; class CODE : public E_F0 { public: Expression a0; int N; Expression * tab; int * what;// 0 RR, 1 KN, const bool mi; static KN_ &set(KN * a,KN *& p,int n){ if(isinit) a->init(n); else a->resize(n); p =a; return *a;} static KN_ &set(KN_ & a,KN *& p,int n){p=0;return a;} CODE(Expression a,const E_Array & tt) : a0(a),N(tt.size()), tab(new Expression [N]), what(new int[N]) , mi(tt.MeshIndependent()) { assert(&tt); // int err=0; for (int i=0;i()->CastingFrom(tt[i].right() ) ) { tab[i]=atype()->CastTo(tt[i]); what[i]=0; } else if(atype >()->CastingFrom(tt[i].right() ) ) { tab[i]=atype >()->CastTo(tt[i].RightExp()); what[i]=1; } else CompileError(" InitArrayfromArray: we are waiting for scalar or vector of scalar"); } AnyType operator()(Stack stack) const { // a verifier ... FH nov 2015..... //extern void xxxx(); //xxxx(); KN * pa=0; A aa=GetAny((*a0)(stack)); KN v(N); KN nn(N+1); for (int i=0;i >(v[i]).size(); n += nn[i]; } if(verbosity>10000)cout << " InitArrayfromArray aa = " <=n); for (int i=0,j=0 ;i(v[i]); else if (what[i]==1) a(SubArray(nn[i],j)) = GetAny >((*(tab[i]))(stack));// correct bug nov 2014 } // (due to resize=> pointer change Fh return SetAny(aa); } bool MeshIndependent() const {return mi;} // ~CODE() { delete [] tab; delete[] what;} operator aType () const { return atype();} }; // end sub class CODE public: E_F0 * code(const basicAC_F0 & args) const { if(verbosity>9999) cout << "\n code InitArrayfromArray:" << *args[0].left() << " " << *args[1].left() << "( "<< *t[0] << " " << *t[1] <<")" <CastTo(args[0]),*dynamic_cast( t[1]->CastTo(args[1]).LeftValue()));} InitArrayfromArray(int preff=0): OneOperator(atype(),atype(),atype()) { pref=preff; // cout << "\n @@@ R " << *atype()<< " A " << *atype() << " B " << * atype() << " " << preff < class InitMatfromAArray : public OneOperator { public: typedef KNM * A; typedef KNM * R; typedef E_Array B; class CODE : public E_F0 { public: Expression a0; int N; int M; Expression ** tab; const bool mi; CODE(Expression a,const E_Array & tt) : a0(a),N(tt.size()),M(0), tab(new Expression* [N]), mi(tt.MeshIndependent()) { assert(&tt); // int err=0; for (int i=0;i(tt[i].LeftValue()); if (li) { const E_Array & lli = *li; // -- check --- if( i == 0) { M = lli.size(); ffassert( M>0 ); for (int i=0;isize() ) { cout << " line " << i << " the size of the column change " << M << " to " << li->size() << endl; CompileError(" Is not a matrix, M is not constant" ); } } for (int j=0;j()->CastTo( lli[j]); } else // li == 0 CompileError(" we are waiting for vector of scalar [ , , , ] "); } } AnyType operator()(Stack stack) const { A a=GetAny((*a0)(stack)); if (isinit) a->init(N,M); else a->resize(N,M); for (int i =0;i( (*(tab[i][j]))(stack)) ; return SetAny(a); } bool MeshIndependent() const {return mi;} // ~CODE() { for (int i=0;i();} }; // end sub class CODE public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(t[0]->CastTo(args[0]),*dynamic_cast( t[1]->CastTo(args[1]).LeftValue()));} InitMatfromAArray(): OneOperator(atype(),atype(),atype()) {} }; template class SetArrayofKNfromKN : public OneOperator { public: typedef KN_ A; // Warning B type of 1 parameter typedef KN_ R; typedef E_Array B; // A type of 2 parameter class CODE : public E_F0 { public: Expression a0; int N; Expression * tab; int * what;// 0 RR, 1 KN, const bool mi; CODE(Expression a,const E_Array & tt) : a0(a),N(tt.size()), tab(new Expression [N]), what(new int[N]) , mi(tt.MeshIndependent()) { assert(&tt); // int err=0; for (int i=0;i()->CastingFrom(tt[i].left() ) ) { tab[i]=atype()->CastTo(tt[i]); what[i]=0; } else if(atype >()->CastingFrom(tt[i].right() ) ) { tab[i]=atype >()->CastTo(tt[i].RightExp()); what[i]=1; } else CompileError("SetArrayofKNfromKN: we are waiting for scalar or vector of scalar"); } AnyType operator()(Stack stack) const { A a=GetAny((*a0)(stack)); KN v(N); KN nn(N+1); for (int i=0;i >(v[i]).size(); n += nn[i]; } ffassert(n == a.size()); for (int i=0,j=0 ;i(v[i]) = a[j]; else if (what[i]==1) { // hack FH KN_ tab(GetAny >(v[i])); tab =a(SubArray(nn[i],j)); } return SetAny(a); } bool MeshIndependent() const {return mi;} // ~CODE() { delete [] tab; delete[] what;} operator aType () const { return atype();} }; // end sub class CODE public: // warning hack A and B E_F0 * code(const basicAC_F0 & args) const { return new CODE(t[1]->CastTo(args[1]),*dynamic_cast( t[0]->CastTo(args[0]).RightValue()));} SetArrayofKNfromKN(): OneOperator(atype(),atype(),atype()) {} // warning with A and B }; template long get_n(KN * p){ return p->N();}// template long get_n(KNM * p){ return p->N();}// template long get_m(KNM * p){ return p->M();}// template K get_max(KN * p){ return p->max();}// template K get_min(KN * p){ return p->min();}// template long get_imax(KN * p){ long i =0; for(long k=1;k< p->N(); ++k) if( (*p)[k]>(*p)[i] ) i=k; return i ;} template long get_imin(KN * p){ long i =0; for(long k=1;k< p->N(); ++k) if( (*p)[k]<(*p)[i] ) i=k; return i ;} template long get_imin(KNM * p){ long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) <(*p)(i,j) ) i=k,j=l; return i ;} template long get_jmin(KNM * p){ long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) <(*p)(i,j) ) i=k,j=l; return j ;} template long get_imax(KNM * p){ long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) >(*p)(i,j) ) i=k,j=l; return i ;} /*template K get_max(KNM * p){ K m = (*p)(0,0), mm; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (mm=(*p)(k,l)) > m ) m=mm ; return m ;} template K get_min(KNM * p){ K m = (*p)(0,0), mm; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (mm=(*p)(k,l)) < m ) m=mm ; return m ;} */ template long get_jmax(KNM * p){ long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) >(*p)(i,j) ) i=k,j=l; return j ;} template NothingType get_ijmax(KNM * const & p,long * const & pi,long * const & pj ){ long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) >(*p)(i,j) ) i=k,j=l; *pi = i; *pj = j; return NothingType() ;} template NothingType get_ijmin(KNM * const & p,long * const & pi,long * const & pj ) { long i =0,j=0; for(long k=0;k< p->N(); ++k) for(long l=0;l< p->M(); ++l) if( (*p)(k,l) <(*p)(i,j) ) i=k,j=l; *pi = i; *pj = j; return NothingType() ;} template K get_sum(KN * p){ return p->sum();} template double get_l2(KN * p){ return p->l2();} template double get_l1(KN * p){ return p->l1();} template double get_linfty(KN * p){ return p->linfty();} template K get_max(KNM * p){ return p->max();} template K get_min(KNM * p){ return p->min();} template K get_sum(KNM * p){ return p->sum();} template double get_l2(KNM * p){ return p->l2();} template double get_l1(KNM * p){ return p->l1();} template double get_linfty(KNM * p){ return p->linfty();} template K get_sum0(const T & p){ return p.sum();} template K get_max0(const T &p){ return p.max();} template K get_min0(const T &p){ return p.min();} template K get_l2_0(const T &p){ return p.l2();} template K get_l1_0(const T &p){ return p.l1();} template K get_linfty_0(const T &p){ return p.linfty();} class ostream_precis { public: ostream_precis(ostream * ff) :f(ff) {} ostream * f; operator long () const {return f->precision();} }; template B castto(const A & a){ return a;} /* template AnyType ClearReturnpKN(Stack stack, const AnyType & a) { KN * m = GetAny(a); Add2StackOfPtr2FreeRC(stack, (K*) (*m) ); if(verbosity>1) cout << "AddIncrement:: increment + Add2StackOfPtr2FreeRC " << endl; return new KN(true, *m); }*/ template AnyType ClearReturnpKK(Stack stack, const AnyType & a) { // a ne faire que pour les variables local au return... // pour l'instant on copie pour fqire mqrche // a repense FH mqi 2009.... KK * m = GetAny(a); // KN *cm=new KN(true, *m); bug quant KN est une variable global // KN *cm=new KN( *m); // on duplique le tableau comme en C++ (dur dur ?????? FH) m->increment(); Add2StackOfPtr2FreeRC(stack,m); if(verbosity>400) cout << "ClearReturnpKK:: increment + Add2StackOfPtr2FreeRC nb ref " << -m->next << endl; return m; } template AnyType ClearReturnpKK_(Stack stack, const AnyType & a) { // il faut faire un copie du tableau KK_ * m = GetAny(a); KK *cm=new KK(*m); Add2StackOfPtr2Free(stack,cm);// detruire la copie if(verbosity>400) cout << "ClearReturnpKK_:: copie Add2StackOfPtr2Free " << endl; return (KK_ *) cm; } template AnyType ClearReturnKK_(Stack stack, const AnyType & a) { // il faut faire un copie du tableau KK_ m = GetAny(a); KK *cm=new KK(m); Add2StackOfPtr2Free(stack,cm);// detruire la copie if(verbosity>400) cout << "ClearReturnKK_:: copie Add2StackOfPtr2Free " << endl; return SetAny(*cm); } template AnyType CopieKK_pKK(Stack stack,const AnyType &a) { KK_ m = GetAny(a); KK *cm=new KK(m); if(verbosity>400) cout << "CopieKK_pKK:: copie Add2StackOfPtr2Free "<< cm << endl; Add2StackOfPtr2Free(stack,cm);// detruire la copie return cm;} template AnyType UnRefpKN(Stack,const AnyType &a) { KK_ a_(*PGetAny(a)); return SetAny(a_);} template inline AnyType DestroyKN(Stack,const AnyType &x){ KN * a=PGetAny >(x); SHOWVERB(cout << "DESTROY " <N(); ++i) (*a)[i].destroy(); a->destroy(); return Nothing; } template AnyType TransposeKNM(Stack,const AnyType &a) { Transpose< KNM * > ta(GetAny * > >(a)); return SetAny >((*ta.t).t());} template void ArrayDCL() { // Dcl_TypeandPtr >(0,0,0,::Destroy >, 0 , ::ClearReturnKN ); //Dcl_Type *>(0,::Destroy >, ::ClearReturnpKK > ); //Dcl_TypeandPtr >(0,0,0,0,::ClearReturnKK_,KN_ >,::ClearReturnpKK_,KN_ >); Dcl_TypeandPtr_ ,KN* > (0,0,::InitP >,::Destroy >, ::ClearReturnKK_,KN_ >,::ClearReturnpKK >); // add init 0 // Dcl_Type *>(0,::Destroy >); // Dcl_Type *>(0,::Destroy >); // Modif 17102005 // attention un exp KN<> * right est un KN<> et non un KN<> * // Dcl_Type *>(0,::Destroy > ,::ClearReturnpKK >); Dcl_TypeandPtr_ ,KNM* > (0,0,0,::Destroy >, ::ClearReturnKK_,KNM_ >,::ClearReturnpKK >); Dcl_Type< KN >* >(0,::DestroyKN >,::ClearReturnpKK,KN > >); Dcl_Type< KN >* >(0,::DestroyKN >,::ClearReturnpKK,KN > >); Dcl_Type< outProduct_KN_* >(); Dcl_Type< Transpose > > (); Dcl_Type< Transpose< KNM *> >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type >(); Dcl_Type *>(); Dcl_Type *>(); // for B(I) and B(I^-1) Dcl_Type,Inv_KN_long> *>(); Dcl_Type,KN_ > *>(); map_type[typeid(KN * ).name()]->AddCast( new E_F1_funcT*,KN_ >(CopieKK_pKK,KN > ) ); // add august 2009 FH to see full matrix as a array map_type[typeid(KN_ ).name()]->AddCast( new E_F1_funcT,KNM* >(UnRef,KNM *> )); map_type[typeid(KN_ ).name()]->AddCast( // new E_F1_funcT,KN_*>(UnRefpKN_ ), new E_F1_funcT,KN*>(UnRefpKN,KN_ > ) // inutil cas KN est right expression de KN* // new E_F1_funcT,KN >(Cast,KN >) ); map_type[typeid(KNM_ ).name()]->AddCast( new E_F1_funcT,KNM*>(UnRefpKN,KNM_ > ) , new E_F1_funcT,Transpose< KNM *> >(TransposeKNM) ); // ,new E_F1_funcT,K>(ValueToKN_), // new E_F1_funcT,K*>(PtrToKN_) /* // Ajoute FH map_type[typeid(KN ).name()]->AddCast( new E_F1_funcT,KN*>(UnRef >) // ,new E_F1_funcT,K>(ValueToKN_), // new E_F1_funcT,K*>(PtrToKN_) ); */ map_type_of_map[make_pair(atype(),atype())]=atype*>(); // vector map_pair_of_type[make_pair(atype(),atype())] =atype >(); map_type_of_map[make_pair(atype >(),atype())]=atype*>(); // matrix map_type_of_map[make_pair(atype(),atype >())]=atype >*>();// tableau de tableau map_type_of_map[make_pair(atype(),atype >())]=atype >*>();// tableau de matrix // Add FH for loop 2015 atype*>()->SetTypeLoop(atype(),atype()); atype*>()->SetTypeLoop(atype(),atype(),atype()); atype >()->SetTypeLoop(atype(),atype()); atype >()->SetTypeLoop(atype(),atype(),atype()); } template pair * pBuild(const A & a,const B & b) { return new pair(a,b);} // add mars 2006 template struct set_A_BI: public binary_function,pair, KN_ > *,KN_ > { static KN_ f(const KN_ & a, pair, KN_ > * const & b) { KN_ x(a); OP op; const KN_ & y(b->first); const KN_ & I(b->second); L N = x.N(); L n = y.N(); L maxI=I(SubArray(N)).max() ; L minI=I(SubArray(N)).min() ; if( maxI >= n || I.N() < N) { cerr << " Out of Bound x=y(I) : 0 <= " << minI << " < "<< maxI << "< " << n << endl; cerr << " or I.N() " << I.N() << " > " << N << endl; ExecError("Out of Bound error"); } for(int i=0;i=0) op(x(i),y(I[i])); delete b; return a; } }; template struct set_AI_B: public binary_function, KN_ > * ,KN_, NothingType > { static NothingType f( pair, KN_ > * const & b,const KN_ & a) { KN_ x(a); OP op; const KN_ & y(b->first); const KN_ & I(b->second); L N = I.N(); L n = y.N(); L maxI=I(SubArray(N)).max() ; L minI=I(SubArray(N)).min() ; if( maxI >= n || x.N() < N ) { cerr << " Out of Bound x(I)=y : 0 <= " << minI << " < "<< maxI << "< " << n << endl; cerr << " or x.N() " << I.N() << " > " << N << endl; ExecError("Out of Bound error"); } for(int i=0;i=0) op(y(I[i]),x[i]); delete b; return NothingType(); } }; template struct Op3_paac: public ternary_function,KN_,K,if_arth_KN_*> { static if_arth_KN_* f(Stack s,const KN_ & a,const KN_ & b,const K & c ) { //K cc(c); KN_ kc(new(NewAllocTmp(s,sizeof(c))) K(c),1,0); return new if_arth_KN_(a,b,kc);} }; template struct Op3_paca: public ternary_function,K,KN_,if_arth_KN_*> { static if_arth_KN_* f(Stack s,const KN_ & a,const K & b,const KN_ & c ) { //K bb(b); KN_ kb(new(NewAllocTmp(s,sizeof(b))) K(b),1,0); return new if_arth_KN_(a,kb,c);} }; template struct Op3_pacc: public ternary_function,K,K,if_arth_KN_*> { static if_arth_KN_* f(Stack s,const KN_ & a,const K & b,const K & c ) { K cc(c),bb(b); KN_ kc(new(NewAllocTmp(s,sizeof(c))) K(c),1,0), kb(new(NewAllocTmp(s,sizeof(b))) K(b),1,0); return new if_arth_KN_(a,kb,kc);} }; template KNM_ Transp(KNM_ M){ return M.t();} // Add FH July 2015 template struct SetArray2: public binary_function > { static SetArray f(const K & a,const K & b) { // cout << "SubArray: " << a << " " << b << endl; // SetArray(long nn,R oo=R(),R sstep=R(1)): o(oo),n(nn),step(sstep) {} long n= long(abs((b-a))); ffassert(n); K s= (b-a)/K(n); n++; if(verbosity>100) cout << " SetArray " << n << " " << a << " " << s << endl; return SetArray(n,a,s);} }; template struct SetArray3: public ternary_function > { static SetArray f(Stack s,const K & a,const K &b,const K & c) { // cout << "SubArray: " << a << " " << b << " " << c << endl; long n= long(1+abs((c-a)/b)); if(verbosity>100) cout << " SetArray " << n << " : " << " " << a << " " << b << " " << c << endl; return SetArray(n,a,b);} }; template R * set_init_array( R* const & a,const A & b){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << &b << endl); a->init(b.size()); *a=b; return a;} template R * set_array( R* const & a,const A & b){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << &b << endl); a->resize(b.size()); *a=b; return a;} // missing FH august 2009 template R * set_arrayp( R* const & a,const A & b){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << &b << endl); a->resize(b->size()); *a=*b; return a;} template R set_array_( R const & a,const A & b){ SHOWVERB( cout << " set_array_ " << typeid(R).name() << " " << &b << endl); ffassert(a.N()==b.size()); R aa=a; aa=b; return a;} // xxxxxxxxxxx template KNM * set_initmat_t(KNM * a,Transpose * > b ){ ConjKNM_ tb=b.t->t(); ; a->init(tb.N(),tb.M()); *a=tb; return a;} template KNM * set_initmat(KNM * a,KNM * b ){ a->init(b->N(),b->M()); *a=*b; return a;} template KNM * set_mat_t(KNM * a,Transpose * > b ){ ConjKNM_ tb=b.t->t(); ; a->resize(tb.N(),tb.M());// correction mars 2013 *a=tb; return a;} template KNM * addto_mat_t(KNM * a,Transpose * > b ){ ConjKNM_ tb=b.t->t(); ; *a+=tb; return a;} template KNM * subto_mat_t(KNM * a,Transpose * > b ){ ConjKNM_ tb=b.t->t(); ; *a-=tb; return a;} template KNM * set_mat(KNM * a,KNM * b ){ a->resize(b->N(),b->M()); *a=*b; return a;} template class OneOperator_2KN_ : public OneOperator {public: class Op : public E_F0 { public: int N; Expression *tab; Op( const E_Array &bb) : N(bb.size()), tab(new Expression[N]) { for(int i=0;i()->CastTo( bb[i]); } AnyType operator()(Stack s) const { K * p = Add2StackOfPtr2FreeA(s,new K[N]); // mark to be delete .. KN A(N, p); for(int i=0;i( (*tab[i])(s)); return SetAny >(A);} }; E_F0 * code(const basicAC_F0 & a) const { const E_Array * b = dynamic_cast(a[0].LeftValue()); ffassert(b); return new Op(*b);} OneOperator_2KN_(): OneOperator(atype >(),atype()) { pref=-1;} }; template class Unique_Op : public E_F0mps { public: Expression ar; Expression va; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; Unique_Op(const basicAC_F0& args, Expression param1, Expression param2) : ar(param1), va(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type Unique_Op::name_param[] = { {"remove", &typeid(long)}, }; template class Unique : public OneOperator { public: Unique() : OneOperator(atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new Unique_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType Unique_Op::operator()(Stack stack) const { KN* array = GetAny*>((*ar)(stack)); KN* val = GetAny*>((*va)(stack)); std::set vals; for(int i = 0; i < array->n; ++i) // if(!nargs[0] || (*array)[i] != remove) vals.insert((*array)[i]); if( nargs[0]) // remove { long remove = GetAny((*nargs[0])(stack)) ; typename std::set::iterator lr = vals.find(remove); if( lr != vals.end()) vals.erase(lr); } val->resize(vals.size()); int i = 0; for(typename std::set::iterator it = vals.begin(); it != vals.end(); ++it) (*val)[i++] = *it; return static_cast(vals.size()); } template class E_ForAllLoopRNM { public: typedef KNM_ Tab; typedef ForAllLoopOpBase DataL; const DataL *data; E_ForAllLoopRNM(const DataL *t): data(t){} AnyType f(Stack s) const { Tab t= GetAny >(data->tab(s)); long * i= GetAny(data->i(s)); long * j= GetAny(data->j(s)); K * v = GetAny(data->v(s)); if(verbosity>1000) { cout << i << " " << j << " " << v << " " << data->epl << endl; cout << " i " << (char*) (void *) i - (char*)(void*) s ; cout << " j " << (char*)(void *) j - (char*)(void*) s ; cout << " vij " << (char*) (void *) v - (char*)(void*) s ; cout << endl; } ffassert(i && j && v); for ( *i=0;*icode(s); t(*i,*j)= *v; } // data->end(s); return Nothing ; } }; template class E_ForAllLoopRN { public: typedef KN_ Tab; typedef ForAllLoopOpBase DataL; const DataL *data; E_ForAllLoopRN(const DataL *t): data(t){} AnyType f(Stack s) const { Tab t= GetAny >(data->tab(s)); long * i= GetAny(data->i(s)); K * v = GetAny(data->v(s)); // cout << i << " " << j << " " << v << " " << data->epl << endl; if(verbosity>1000) { cout << " i " << (char*) (void *) i - (char*)(void*) s ; cout << " vi " << (char*) (void *) v - (char*)(void*) s ; cout << endl; } ffassert(i && v); for ( *i=0;*icode(s); t[*i]= *v; } // data->end(s); return Nothing ; } }; template class E_ForAllLoopMapSI { public: typedef String K; typedef string *KK; typedef V *VV; typedef MyMap *Tab; typedef typename MyMap::iterator TabI ; typedef ForAllLoopOpBase DataL; const DataL *data; E_ForAllLoopMapSI(const DataL *t): data(t){} AnyType f(Stack s) const { Tab t= GetAny(data->tab(s)); KK * i = GetAny(data->i(s)); VV v = GetAny(data->v(s)); // cout << i << " " << j << " " << v << " " << data->epl << endl; if(verbosity>1000) { cout << " i " << (char*) (void *) i - (char*)(void*) s ; cout << " vi " << (char*) (void *) v - (char*)(void*) s ; cout << endl; } ffassert(i && v); if(t->m) for (TabI ii=t->m->begin();ii != t->m->end();++ii) { String kk = ii->first; V vv = ii->second; *i = kk; *v = vv; // for Windows otherwise trap ???? FH. march 2016 if(verbosity>99999) cout << " " << i << " "<< v << " " << kk << " " << vv << endl; data->code(s); ii->second = *v; *i=0; } // data->end(s); return Nothing ; } }; extern aType aaaa_knlp; template void ArrayOperator() { // juin 2009 remove type KN_< > * // and set KN<> * 9left expression) qnd KN_<> is the associated expression.. // => lot of change because KN<>* and KN_< > can generqte ambuguity. // so remove all to code with KN<>* type. // the remove cqde are in comment : // the comment begin //- // and the if(0) in comment /* */ Dcl_Type< Resize > > (); Dcl_Type< Resize > > (); aType knrp = atype *>(); aType knr_ = atype >(); //- typedef KN ZN; // add dec 2009. ne marche pas ( incompatible avec MatrixBlock) a comprendre ????? FH. // // xxxxxxxxxx 2010 feb. retest .. FH // il y a plusieurs problems // 1) [1,2,3.] -> tableau de quel type int, real , complex ???? // // map_type[typeid(KN_).name()]->AddCast(new OneOperator_2KN_); // fin add // ---- aType knlp= aaaa_knlp ; atype* >()->Add("[","",new OneOperator2_*,Z >(get_elementp_*,Z>)); atype* >()->Add("(","",new OneOperator2_*,Z >(get_elementp_*,Z>)); atype >()->Add("(","",new OneOperator2_,KN_,char >(fSubArrayc >)); atype >()->Add("(","",new OneOperator2_,KN_,SubArray>(fSubArray )); atype*>()->Add("(","",new OneOperator2_,KN*,SubArray>(fSubArrayp )); atype* >()->Add("(","",new OneOperator2_*,KN*,char >(fSubArrayc* >)); // atype >()->Add("(","",new OneOperator3_,KNM_,SubArray,SubArray>(fSubArraybb )); atype* >()->Add("(","",new OneOperator3_,KNM*,SubArray,SubArray>(fSubArraypbb )); /* atype >()->Add("(","",new OneOperator3_,KNM_,SubArray,long>(fSubArraybi )); atype >()->Add("(","",new OneOperator3_,KNM_,long,SubArray>(fSubArrayib )); atype >()->Add("(","",new OneOperator3_,KNM*,SubArray,long>(fSubArraypbi )); atype >()->Add("(","",new OneOperator3_,KNM*,long,SubArray>(fSubArraypib )); */ // atype >()->Add("[","",new OneOperator2_,Z >(get_element_,Z>)); atype >()->Add("(","",new OneOperator2_,Z >(get_element_,Z>)); atype* >()->Add("(","",new OneOperator3_,KNM*,Z,SubArray >(get_element_is,KNM*,Z,SubArray>)); atype* >()->Add("(","",new OneOperator3_,KNM*,SubArray,Z >(get_element_si,KNM*,SubArray,Z>)); atype* >()->Add("(","",new OneOperator3_,KNM*,Z,char >(get_element_lineorcol,KNM*,Z,char>)); atype* >()->Add("(","",new OneOperator3_,KNM*,char,Z >(get_element_lineorcol,KNM*,char,Z>)); atype* >()->Add("(","",new OneOperator3_*,Z,Z >(get_elementp2_*,Z,Z>)); atype >()->Add("(","",new OneOperator3_,KNM_,Z,SubArray >(get_element_is_,KNM_,Z,SubArray>)); atype >()->Add("(","",new OneOperator3_,KNM_,SubArray,Z >(get_element_si_,KNM_,SubArray,Z>)); atype >()->Add("(","",new OneOperator3_,KNM_,Z,char >(get_element_lineorcol_,KNM_,Z,char>)); atype >()->Add("(","",new OneOperator3_,KNM_,char,Z >(get_element_lineorcol_,KNM_,char,Z>)); atype >()->Add("(","",new OneOperator3_,Z,Z >(get_elementp2__,Z,Z>)); Add *>("sum",".",new OneOperator1 *>(get_sum)); Add *>("min",".",new OneOperator1 *>(get_min)); Add *>("max",".",new OneOperator1 *>(get_max)); Add *>("l2",".",new OneOperator1 *>(get_l2)); Add *>("l1",".",new OneOperator1 *>(get_l1)); Add *>("linfty",".",new OneOperator1 *>(get_linfty)); // add july 2009 Add *>("sum",".",new OneOperator1 *>(get_sum)); Add *>("min",".",new OneOperator1 *>(get_min)); Add *>("max",".",new OneOperator1 *>(get_max)); Add *>("l2",".",new OneOperator1 *>(get_l2)); Add *>("l1",".",new OneOperator1 *>(get_l1)); Add *>("linfty",".",new OneOperator1 *>(get_linfty)); // end add Add >("sum",".",new OneOperator1_ >(get_sum0 >)); Add >("min",".",new OneOperator1_ >(get_min0 >)); Add >("max",".",new OneOperator1_ >(get_max0 >)); Add >("l2",".",new OneOperator1_ >(get_l2_0 >)); Add >("l1",".",new OneOperator1_ >(get_l1_0 >)); Add >("linfty",".",new OneOperator1_ >(get_linfty_0 >)); // add july 2009 Add >("sum",".",new OneOperator1_ >(get_sum0 >)); Add >("min",".",new OneOperator1_ >(get_min0 >)); Add >("max",".",new OneOperator1_ >(get_max0 >)); Add >("l2",".",new OneOperator1_ >(get_l2_0 >)); Add >("l1",".",new OneOperator1_ >(get_l1_0 >)); Add >("linfty",".",new OneOperator1_ >(get_linfty_0 >)); // end add /* Add >("sum",".", new OneOperator1_ >(get_sum0 >)); Add >("min",".", new OneOperator1_ >(get_min0 >)); Add >("max",".", new OneOperator1_ >(get_max0 >)); Add >("l2",".", new OneOperator1_ >(get_l2_0 >)); Add >("l1",".", new OneOperator1_ >(get_l1_0 >)); Add >("linfty",".",new OneOperator1_ >(get_linfty_0 >)); */ Add *>("resize",".",new OneOperator1< Resize >,KN *>(to_Resize)); Add *>("resize",".",new OneOperator1< Resize >,KNM *>(to_Resize)); Add > >("(","",new OneOperator2_ *,Resize > , Z >(resize1)); Add > >("(","",new OneOperator3_ *,Resize > , Z, Z >(resize2)); TheOperators->Add("<-", new OneOperator2_ *,KN *,Z>(&set_init), new InitArrayfromArray*,true> // new OneOperator2_ *,KN *,KN >(&set_init), // new OneOperator2_ *,KN *,KN_ >(&set_init) ???? // new OneOperator2_ *,KN *,KN * >(&set_initp) ); TheOperators->Add("<-", new OneOperator2_ > *,KN< KN > * ,Z >(&set_init)); TheOperators->Add("<-", new OneOperator2_ > *,KN< KNM > * ,Z >(&set_init)); TheOperators->Add("<-", new OneOperator3_ *,KNM *,Z,Z>(&set_init2), new InitMatfromAArray ); Add *>("<-","(",new OneOperator2_ *,KN *,Z>(&set_init)); // Add *>("<-","(",new OneOperator2_ *,KN *,KN >(&set_init)); //Add *>("<-","(",new OneOperator2_ *,KN *,KN_ >(&set_init)); // Add *>("<-","(",new OneOperator2_ *,KN *,KN * >(&set_initp)); Add *>("<-","(",new OneOperator3_ *,KNM *,Z,Z>(&set_init2)); TheOperators->Add("<-",new OneOperator2 *,KNM *,Transpose * > >(&set_initmat_t));// may 2011 FH.. TheOperators->Add("=",new OneOperator2 *,KNM *,Transpose * > >(&set_mat_t));// may 2011 FH.. TheOperators->Add("+=",new OneOperator2 *,KNM *,Transpose * > >(&addto_mat_t));// oct 2011 FH.. TheOperators->Add("-=",new OneOperator2 *,KNM *,Transpose * > >(&subto_mat_t));// oct 2011 FH.. // TheOperators->Add("-=",new OneOperator2 *,KNM *,Transpose * > >(&subto_mat_t<-1>));// oct 2011 FH.. // Add *>("<-","(",new OneOperator2 *,KNM *,KNM * >(&set_initmat));// may 2011 FH.. // Add *>("=","(",new OneOperator2 *,KNM *,Transpose * > >(&set_mat_t));// may 2011 FH.. // Add *>("=","(",new OneOperator2 *,KNM *,KNM * >(&set_mat));// may 2011 FH.. // Add *>("=","(",new OneOperator2_ *,KNM *,Transpose * > >(&set_tt)); Add *>("<-","(",new InitArrayfromArray*,true>); Add *>("<-","(",new InitMatfromAArray); Add *>("n",".",new OneOperator1 *>(get_n)); Add *>("n",".",new OneOperator1 *>(get_n)); Add *>("m",".",new OneOperator1 *>(get_m)); //ajout ars 2012 FH Add > *>("n",".",new OneOperator1 > *>(get_n)); Add > *>("n",".",new OneOperator1 > *>(get_n)); atype > * >()->Add("[","",new OneOperator2_*,KN >*,Z >(get_elementp_,KN >*,Z>)); atype > * >()->Add("[","",new OneOperator2_*,KN >*,Z >(get_elementp_,KN >*,Z>)); Dcl_Type< Resize > > > (); Dcl_Type< Resize > > >(); Add > * >("resize",".",new OneOperator1< Resize > >,KN > *>(to_Resize)); Add > * >("resize",".",new OneOperator1< Resize > >,KN > *>(to_Resize)); Add > > >("(","",new OneOperator2_ > *,Resize > > , long >(resize1)); Add > > >("(","",new OneOperator2_ > *,Resize > > , long >(resize1)); // AddOpeqarray("="); TheOperators->Add("=", new InitArrayfromArray*,false>(10)); TheOperators->Add("=", new InitArrayfromArray,false>(1));// ???????? FH nov 2015 .. TheOperators->Add("=", new InitMatfromAArray ); TheOperators->Add("=", new SetArrayofKNfromKN ); if(0) // a change il faut regle un PB ambiguite ... TheOperators->Add("=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,KN_ > > , // Add FH juin 2005 new OneBinaryOperator ,Add_Mulc_KN_* > > , // Add FH aug 2005 new OneBinaryOperator ,if_arth_KN_* > > // new OneBinaryOperator ,KN* > > // test aug 2009 ); // add august 2007 TheOperators->Add("<-", // new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,KN_ > > , // Add FH juin 2005 new OneBinaryOperator ,Add_Mulc_KN_* > > , // Add FH aug 2005 new OneBinaryOperator ,if_arth_KN_* > > // new OneBinaryOperator ,KN* > > ); TheOperators->Add("=", new OneBinaryOperator ,K > > , new OneBinaryOperator , KNM * > > ); TheOperators->Add("=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,if_arth_KN_* > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , // Add FH aug 2005 new OneBinaryOperator ,KN_ > >, // add FH juin 2005 new OneBinaryOperator ,KN* > > //- new OneBinaryOperator ,KN* > > ); // ajoute mars 2010 FH TheOperators->Add("<-", new OneBinaryOperator ,KNM_ > > ); TheOperators->Add("=", new OneBinaryOperator ,KNM_ > > // new OneBinaryOperator ,K > > , // new OneBinaryOperator ,KNM_ > >, // new OneBinaryOperator ,KNM* > > ); // end add ... /*if(0) TheOperators->Add("+=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,if_arth_KN_* > > , new OneBinaryOperator ,KN_ > > , // Add FH juin 2005 new OneBinaryOperator ,KN* > > ); */ TheOperators->Add("+=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,if_arth_KN_* > > , new OneBinaryOperator ,KN_ > > // add FH juin 2005 // new OneBinaryOperator ,KN* > > ); /* if(0) TheOperators->Add("-=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,if_arth_KN_* > > , new OneBinaryOperator ,KN_ > > , // Add FH juin 2005 new OneBinaryOperator ,KN* > > );*/ TheOperators->Add("-=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,DotStar_KN_ > > , new OneBinaryOperator ,DotSlash_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,if_arth_KN_* > > , //- new OneBinaryOperator ,KN* > > new OneBinaryOperator ,KN_ > > // Add FH juin 2005 ); /* if(0) TheOperators->Add("*=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,KN* > > );*/ TheOperators->Add("*=", new OneBinaryOperator ,K > > ); TheOperators->Add(".*=", new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , //- new OneBinaryOperator ,KN* > > new OneBinaryOperator ,KN_ > > ); // FH correction 01 nov 2005 FH copy paste mistake eq_ exchange ok v2.0-3 /* if(0) TheOperators->Add("/=", new OneBinaryOperator ,K > > , new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,KN_ > > );*/ TheOperators->Add("/=", new OneBinaryOperator ,K > > ); TheOperators->Add("./=", new OneBinaryOperator ,Add_KN_ > > , new OneBinaryOperator ,Sub_KN_ > > , new OneBinaryOperator ,Mulc_KN_ > > , new OneBinaryOperator ,Divc_KN_ > > , new OneBinaryOperator ,Mul_KNM_KN_ > > , new OneBinaryOperator ,Add_Mulc_KN_* > > , new OneBinaryOperator ,KN_ > > ); // end correction TheOperators->Add("+", new OneBinaryOperator,KN_,KN_ > >, //- new OneBinaryOperator,KN_,KN_ > >(knrp,knrp), new OneBinaryOperator,Mulc_KN_,Mulc_KN_ > >, new OneBinaryOperator,KN_,Mulc_KN_ > >, new OneBinaryOperator,Mulc_KN_ ,KN_ > > ); TheOperators->Add("-", new OneBinaryOperator,KN_ ,KN_ > >, //- new OneBinaryOperator,KN_ ,KN_ > >(knrp,knrp), new OneUnaryOperator,KN_ > >, new OneBinaryOperator,Mulc_KN_,Mulc_KN_ > >, new OneBinaryOperator,KN_,Mulc_KN_ > >, new OneBinaryOperator,Mulc_KN_ ,KN_ > > ); TheOperators->Add("*", //- new OneBinaryOperator,KN*,K> >, //- new OneBinaryOperator,K,KN*> >, new OneBinaryOperator,KN_,K> >, new OneBinaryOperator,K,KN_ > >, new OneBinaryOperator,KNM*,KN*> >,// A*b zzzzzzz // new OneBinaryOperator,KNM_,KN_> >, // - add #1 mqi 2009 // new OneBinaryOperator >, new OneBinaryOperator > //- ,new OneBinaryOperator,KN*,Transpose > > > ,new OneBinaryOperator,KN_,Transpose > > > ,new OneBinaryOperator,Mulc_KN_,Transpose > > > ); TheOperators->Add("/", new OneBinaryOperator,K,KN_ > >, new OneBinaryOperator,KN_,K > > ); // nouvel operateur TheOperators->Add("+=", new OneBinaryOperator ,outProduct_KN_* > > ); TheOperators->Add("-=", new OneBinaryOperator ,outProduct_KN_* > > ); TheOperators->Add("=", new OneBinaryOperator ,outProduct_KN_* > > ); // tested ok ... FH TheOperators->Add("?:", new OneTernaryOperator3, KN_ > > , new OneTernaryOperator3 > , new OneTernaryOperator3 > , new OneTernaryOperator3 > ); // end ... // add mars 2006 // atype >()->Add("(","",new OneOperator2_< pair,KN_ > * ,KN_ , KN_ >(pBuild< KN_ , KN_ >)); atype >()->Add("(","",new OneOperator2_< pair,KN_ > * ,KN_ , KN_ >(pBuild< KN_ , KN_ >,atype >(), atype >() )); atype *>()->Add("(","",new OneOperator2_< pair,KN_ > * ,KN_ , KN_ >(pBuild< KN_ , KN_ >,atype * >(), atype >() )); //atype >()->Add("(","",new OneOperator2_< pair,KN_ > * ,KN_ , KN_ >(pBuild< KN_ , KN_ >,atype >(), knlp )); //atype *>()->Add("(","",new OneOperator2_< pair,KN_ > * ,KN_ , KN_ >(pBuild< KN_ , KN_ >,atype * >(), knlp )); TheOperators->Add("=", new OneBinaryOperator > > , new OneBinaryOperator > > ); TheOperators->Add("+=", new OneBinaryOperator > > , new OneBinaryOperator > > ); TheOperators->Add("-=", new OneBinaryOperator > > , new OneBinaryOperator > > ); // fin TheOperators->Add("\'", // new OneOperator1 >,KN *>(&Build >,KN *>), new OneOperator1 >,KN_ >(&Build >,KN_ >), new OneOperator1 * >, KNM * >(&Build * >,KNM * >,10) , new OneOperator1 , KNM_ >(Transp, 1) ); TheOperators->Add(".*", new OneBinaryOperator,KN_,KN_ > > //-, //- new OneBinaryOperator,KN_,KN_ > >(knrp,knrp), //- new OneBinaryOperator,KN_,KN_ > >(knr_,knrp), //- new OneBinaryOperator,KN_,KN_ > >(knrp,knr_) ); TheOperators->Add("./", new OneBinaryOperator,KN_,KN_ > > //-, //- new OneBinaryOperator,KN_,KN_ > >(knrp,knrp), //- new OneBinaryOperator,KN_,KN_ > >(knr_,knrp), //- new OneBinaryOperator,KN_,KN_ > >(knrp,knr_) ); TheOperators->Add("<<", // new OneBinaryOperator*> >, new OneBinaryOperator > >, new OneBinaryOperator > > ); TheOperators->Add("<<", new OneBinaryOperator< PrintPnd< KN< KNM >* > >, new OneBinaryOperator< PrintPnd< KN< KN >* > > ); TheOperators->Add(">>", new OneBinaryOperator >, new OneBinaryOperator > ); map_type[typeid(MyMap*).name()] = new ForEachType*>(Initialize >,Delete >) ; map_type_of_map[make_pair(atype(),atype())]=atype*>(); atype*>()->Add("[","",new OneOperator2_*,string*>(get_element)); TheOperators->Add("&",new OneOperator2_*,string*>(exist_element)); TheOperators->Add("<<",new OneBinaryOperator*> >); // Add Mai 2009 Dcl_Type >(); TheOperators->Add("::", new OneBinaryOperator >, new OneTernaryOperator3 >); TheOperators->Add("<-", new OneOperator2_ *,KN *,SetArray >(&set_init_array)); TheOperators->Add("=", new OneOperator2_ *,KN *,SetArray >(&set_array), new OneOperator2_ *,KN *,KN * >(&set_arrayp), // to reomve ambiguity aug 2009 new OneOperator2_ ,KN_ ,SetArray >(-1,&set_array_) // missing aug 2009 a(:)=1:3 less prioritaire ); atype*>()->SetTypeLoop(atype(),atype()); TheOperators->Add("{}",new ForAllLoop >); TheOperators->Add("{}",new ForAllLoop >); TheOperators->Add("{}",new ForAllLoop >); TheOperators->Add("<-",new InitMapfromArray*,string *,K,true> ); } template class OneOperator1F_KN_ : public OneOperator { aType r; // return type typedef A (*func)( B ) ; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new Op(f,t[0]->CastTo(args[0]));} OneOperator1F_KN_(func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(BB).name()]),f(ff){} class Op :public E_F0 { public: typedef A (*func)(B ) ; func f; Expression a; Op(func ff,Expression aa) : f(ff),a(aa) {} AnyType operator()(Stack s) const {return SetAny( R(f, GetAny( (*a)(s)) ) );} bool EvaluableWithOutStack() const {return a->EvaluableWithOutStack() ;} // bool MeshIndependent() const {return a->MeshIndependent();} // }; }; template void ArrayOperatorF() { Dcl_Type >(); Global.Add("exp","(",new OneOperator1F_KN_,K,KK,KN_ >(exp)); Global.Add("log","(",new OneOperator1F_KN_,K,KK,KN_ >(log)); Global.Add("log10","(",new OneOperator1F_KN_,K,KK,KN_ >(log10)); Global.Add("sqrt","(",new OneOperator1F_KN_,K,KK,KN_ >(sqrt)); Global.Add("sin","(",new OneOperator1F_KN_,K,KK,KN_ >(sin)); Global.Add("cos","(",new OneOperator1F_KN_,K,KK,KN_ >(cos)); Global.Add("tan","(",new OneOperator1F_KN_,K,KK,KN_ >(tan)); Global.Add("cosh","(",new OneOperator1F_KN_,K,KK,KN_ >(cosh)); Global.Add("sinh","(",new OneOperator1F_KN_,K,KK,KN_ >(sinh)); Global.Add("tanh","(",new OneOperator1F_KN_,K,KK,KN_ >(tanh)); // Global.Add("acos","(",new OneOperator1F_KN_,K,KK,KN_ >(acos)); // Global.Add("asin","(",new OneOperator1F_KN_,K,KK,KN_ >(asin)); // Global.Add("atan","(",new OneOperator1F_KN_,K,KK,KN_ >(atan)); TheOperators->Add("=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("+=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("-=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("/=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 TheOperators->Add("*=",new OneBinaryOperator ,F_KN_ > > ); // add FH juin 2005 } freefem++-3.61-1/src/fflib/AFunction_ext.hpp000644 000767 000024 00000057242 13256636774 020765 0ustar00hechtstaff000000 000000 // In order to use functions with the stack and 2 parameters , and more new classes (OneOperator2s_, OneOperator3s_, etc.) must // In order to use functions with more than 3 parameters, new classes (OneOperator4_, OneOperator5_, etc.) must // be defined. See example code in include/AFunction.hpp // Two classes must be defined (here we show an example for a function accepting 4 arguments): // // class OneOperator4_ // class E_F_F0F0F0F0_ // // Note: in file includeAFunction.hpp, the class "OneOperator" (around line 400) mut be modified. // ************************************************ // Add F. Hecht oct 2009 // **** 2 paramters with the stack // class OneOperator2s_ // class E_F_F0F0s_ #ifndef AFUNCTION_EXT_HPP__ #define AFUNCTION_EXT_HPP__ template // extend (4th arg.) class E_F_F0F0s_ :public E { public: // extend typedef R (*func)(Stack s,const A0 &,const A1 & ) ; // extend (statck +2th arg.) func f; Expression a0,a1; // extend E_F_F0F0s_(func ff, Expression aa0, Expression aa1) : f(ff), a0(aa0), a1(aa1) {} // extend (2th arg.) AnyType operator()(Stack s) const {return SetAny( f( s, GetAny((*a0)(s)), GetAny((*a1)(s)) ) );} // extend (2th arg.) virtual size_t nbitem() const {return a1->nbitem(); } // modif ??? bool MeshIndependent() const {return E::MeshIndependent() &&a0->MeshIndependent() && a1->MeshIndependent() ;} // extend (2th arg.) }; template > // extend (4th arg.) class OneOperator2s_ : public OneOperator { // aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]));} // extend OneOperator2s_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()]), // extens f(ff){} OneOperator2s_(func ff,int preff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()]), // extens f(ff){pref=preff;} }; // **** 2 paramters with the stack // class OneOperator2s_ // class E_F_F0F0s_ template // extend (4th arg.) class E_F_F0F0F0s_ :public E { public: // extend typedef R (*func)(Stack s,const A0 &,const A1 &,const A2 & ) ; // extend (statck +2th arg.) func f; Expression a0,a1,a2; // extend E_F_F0F0F0s_(func ff, Expression aa0, Expression aa1, Expression aa2) : f(ff), a0(aa0), a1(aa1), a2(aa2) {} // extend (2th arg.) AnyType operator()(Stack s) const {return SetAny( f( s, GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)) ) );} // extend (3th arg.) virtual size_t nbitem() const {return a2->nbitem(); } // modif ??? bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent() && a2->MeshIndependent() ;} // extend (2th arg.) }; template > // extend (3th arg.) class OneOperator3s_ : public OneOperator { // aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), 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()], map_type[typeid(B).name()], map_type[typeid(C).name()]), // extend f(ff){} }; // *********************************************** // *********************************************** // **** 4 parameters // *********************** template // extend (4th arg.) class E_F_F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 & ) ; // extend (4th arg.) func f; Expression a0,a1,a2,a3; // extend E_F_F0F0F0F0_(func ff, Expression aa0, Expression aa1, Expression aa2, Expression aa3) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3) {} // extend (4th arg.) AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)) ) );} // extend (4th arg.) virtual size_t nbitem() const {return a3->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent()&& a3->MeshIndependent();} // extend (4th arg.) }; template > // extend (4th arg.) class OneOperator4_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]));} // extend OneOperator4_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()]), // extens f(ff){} }; template // extend (4th arg.) class E_F_F0F0F0F0s_ :public E { public: // extend typedef R (*func)(Stack, const A0 &,const A1 & , const A2 &, const A3 & ) ; // extend (4th arg.) func f; Expression a0,a1,a2,a3; // extend E_F_F0F0F0F0s_(func ff, Expression aa0, Expression aa1, Expression aa2, Expression aa3) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3) {} // extend (4th arg.) AnyType operator()(Stack s) const {return SetAny( f( s, GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)) ) );} // extend (4th arg.) virtual size_t nbitem() const {return a3->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent()&& a3->MeshIndependent();} // extend (4th arg.) }; template > // extend (4th arg.) class OneOperator4s_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]));} // extend OneOperator4s_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()]), // extens f(ff){} }; // *********************************************** // **** 5 parameters // *********************** // // NOTE: add the following line in AFunction.hpp // // OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e) // : r(rr),ArrayOfaType(a,b,c,d,e,false),next(0),pref(0) {throwassert(rr && a && b && c && d);} template // extend AX class E_F_F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4; // extend aX E_F_F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)) ) );} // extend aX virtual size_t nbitem() const {return a4->nbitem(); } bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent();} // extend aX }; template > // extend class OneOperator5_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]));} // extend OneOperator5_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()]), // extend f(ff){} }; // *********************************************** // **** 6 parameters // *********************** // // NOTE: add the following line in AFunction.hpp // OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f) // : r(rr),ArrayOfaType(a,b,c,d,e,f,false),next(0),pref(0) {throwassert(rr && a && b && c && d && f);} template // extend AX class E_F_F0F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 &, const A5 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4,a5; // extend aX E_F_F0F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4, Expression aa5) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4), a5(aa5) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)), GetAny((*a5)(s)) ) );} // extend aX virtual size_t nbitem() const {return a5->nbitem(); } bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent()&& a5->MeshIndependent();} // extend aX }; template > // extend class OneOperator6_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]), t[5]->CastTo(args[5]));} // extend OneOperator6_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()], map_type[typeid(F).name()]), // extend f(ff){} }; // *********************************************** // **** 7 parameters // *********************** // // NOTE: add the following line in AFunction.hpp // OneOperator(aType rr,aType a,aType b,aType c,aType d,aType e,aType f) // : r(rr),ArrayOfaType(a,b,c,d,e,f,false),next(0),pref(0) {throwassert(rr && a && b && c && d && f);} template // extend AX class E_F_F0F0F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 &, const A5 &, const A6 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4,a5,a6; // extend aX E_F_F0F0F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4, Expression aa5, Expression aa6) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4), a5(aa5), a6(aa6) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)), GetAny((*a5)(s)), GetAny((*a6)(s)) ) );} // extend aX virtual size_t nbitem() const {return a6->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent()&& a5->MeshIndependent()&& a6->MeshIndependent();} // extend aX }; template > // extend class OneOperator7_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]), t[5]->CastTo(args[5]), t[6]->CastTo(args[6]));} // extend OneOperator7_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()], map_type[typeid(F).name()], map_type[typeid(G).name()]), // extend f(ff){} }; // *********************************************** // **** 8 parameters // *********************** // template // extend AX class E_F_F0F0F0F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4,a5,a6,a7; // extend aX E_F_F0F0F0F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4, Expression aa5, Expression aa6, Expression aa7) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4), a5(aa5), a6(aa6), a7(aa7) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)), GetAny((*a5)(s)), GetAny((*a6)(s)), GetAny((*a7)(s)) ) );} // extend aX virtual size_t nbitem() const {return a7->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() && a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent()&& a5->MeshIndependent()&& a6->MeshIndependent()&& a7->MeshIndependent();} // extend aX }; template > // extend class OneOperator8_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { if ( args.named_parameter && !args.named_parameter->empty() ) CompileError( " They are used Named parameter "); return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]), t[5]->CastTo(args[5]), t[6]->CastTo(args[6]), t[7]->CastTo(args[7]));} // extend OneOperator8_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()], map_type[typeid(F).name()], map_type[typeid(G).name()], map_type[typeid(H).name()]), // extend f(ff){} }; // *********************************************** // **** 9 parameters // *********************** // /* template // extend AX class E_F_F0F0F0F0F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4,a5,a6,a7,a8; // extend aX E_F_F0F0F0F0F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4, Expression aa5, Expression aa6, Expression aa7, Expression aa8) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4), a5(aa5), a6(aa6), a7(aa7), a8(aa8) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)), GetAny((*a5)(s)), GetAny((*a6)(s)), GetAny((*a7)(s)), GetAny((*a8)(s)) ) );} // extend aX virtual size_t nbitem() const {return a8->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() &&a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent()&& a5->MeshIndependent()&& a6->MeshIndependent()&& a7->MeshIndependent()&& a8->MeshIndependent();} // extend aX }; template > // extend class OneOperator9_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]), t[5]->CastTo(args[5]), t[6]->CastTo(args[6]), t[7]->CastTo(args[7]), t[8]->CastTo(args[8]));} // extend OneOperator9_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()], map_type[typeid(F).name()], map_type[typeid(G).name()], map_type[typeid(H).name()], map_type[typeid(I).name()]), // extend f(ff){} }; */ /* // // *********************************************** // **** 10 parameters // *********************** // template // extend AX class E_F_F0F0F0F0F0F0F0F0F0F0_ :public E { public: // extend typedef R (*func)(const A0 &,const A1 & , const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 &, const A9 & ) ; // extend AX func f; Expression a0,a1,a2,a3,a4,a5,a6,a7,a8,a9; // extend aX E_F_F0F0F0F0F0F0F0F0F0F0_(func ff, // extend F0 Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4, Expression aa5, Expression aa6, Expression aa7, Expression aa8, Expression aa9) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4), a5(aa5), a6(aa6), a7(aa7), a8(aa8), a9(aa9) {} // extend aX AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)), GetAny((*a5)(s)), GetAny((*a6)(s)), GetAny((*a7)(s)), GetAny((*a8)(s)), GetAny((*a9)(s)) ) );} // extend aX virtual size_t nbitem() const {return a9->nbitem(); } // modif bool MeshIndependent() const {return E::MeshIndependent() &&a0->MeshIndependent() && a1->MeshIndependent()&& a2->MeshIndependent() && a3->MeshIndependent()&& a4->MeshIndependent()&& a5->MeshIndependent()&& a6->MeshIndependent() && a7->MeshIndependent()&& a8->MeshIndependent()&& a9->MeshIndependent();} // extend aX }; template > // extend class OneOperator10_ : public OneOperator { // 3->4 aType r; // return type typedef typename CODE::func func; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4]), t[5]->CastTo(args[5]), t[6]->CastTo(args[6]), t[7]->CastTo(args[7]), t[8]->CastTo(args[8]), t[9]->CastTo(args[9]));} // extend OneOperator10_(func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()], map_type[typeid(F).name()], map_type[typeid(G).name()], map_type[typeid(H).name()], map_type[typeid(I).name()], map_type[typeid(J).name()]), // extend f(ff){} }; */ #endif freefem++-3.61-1/src/fflib/Makefile.in000644 000767 000024 00000304045 13321623167 017530 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/fflib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libff_a_AR = $(AR) $(ARFLAGS) am__objects_1 = UMFPack_Solver.$(OBJEXT) AFunction.$(OBJEXT) \ AFunction2.$(OBJEXT) array_long.$(OBJEXT) array_real.$(OBJEXT) \ array_complex.$(OBJEXT) lex.$(OBJEXT) lgmesh.$(OBJEXT) \ lgmesh3.$(OBJEXT) CodeAlloc.$(OBJEXT) lgmat.$(OBJEXT) \ global.$(OBJEXT) Drawing.$(OBJEXT) gibbs.$(OBJEXT) \ CheckPtr.$(OBJEXT) fem.$(OBJEXT) QuadratureFormular.$(OBJEXT) \ FESpace.$(OBJEXT) Element_RT.$(OBJEXT) mshptg.$(OBJEXT) \ FQuadTree.$(OBJEXT) QuadTree.$(OBJEXT) R2.$(OBJEXT) \ Meshio.$(OBJEXT) Mesh2.$(OBJEXT) Metric.$(OBJEXT) \ BamgFreeFem.$(OBJEXT) MeshDraw.$(OBJEXT) MeshGeom.$(OBJEXT) \ MeshQuad.$(OBJEXT) SetOfE4.$(OBJEXT) MeshRead.$(OBJEXT) \ write_hdf5.$(OBJEXT) write_xdmf.$(OBJEXT) MeshWrite.$(OBJEXT) \ problem.$(OBJEXT) mt19937ar.$(OBJEXT) DefColor.$(OBJEXT) \ InitFunct.$(OBJEXT) lgalgo.$(OBJEXT) Element_P2h.$(OBJEXT) \ load.$(OBJEXT) lgfem.$(OBJEXT) environment.$(OBJEXT) \ string_def.$(OBJEXT) FESpacen.$(OBJEXT) P012_1d.$(OBJEXT) \ P012_2d.$(OBJEXT) P012_3d.$(OBJEXT) Mesh1dn.$(OBJEXT) \ Mesh2dn.$(OBJEXT) Mesh3dn.$(OBJEXT) GQuadTree.$(OBJEXT) \ libmesh5.$(OBJEXT) glumesh2D.$(OBJEXT) splitsimplex.$(OBJEXT) \ P1IsoValue.$(OBJEXT) am_libff_a_OBJECTS = $(am__objects_1) strversionnumber.$(OBJEXT) libff_a_OBJECTS = $(am_libff_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libff_a_SOURCES) $(EXTRA_libff_a_SOURCES) DIST_SOURCES = $(libff_a_SOURCES) $(EXTRA_libff_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libff.a # FFCS - 28/11/11 - ffapi.cpp cannot be part of libff.a because it # needs to be compiled with different options depending on the # executable it is included in (eg with/without MPI) libff_a_SOURCES2 = UMFPack_Solver.cpp \ AFunction.cpp AFunction2.cpp \ array_long.cpp array_real.cpp array_complex.cpp \ lex.cpp lgmesh.cpp lgmesh3.cpp \ CodeAlloc.cpp lgmat.cpp global.cpp \ ../femlib/Drawing.cpp ../femlib/gibbs.cpp \ ../femlib/CheckPtr.cpp ../femlib/fem.cpp \ ../femlib/QuadratureFormular.cpp ../femlib/FESpace.cpp \ ../femlib/Element_RT.cpp ../femlib/mshptg.cpp ../femlib/FQuadTree.cpp \ ../bamglib/QuadTree.cpp ../bamglib/R2.cpp ../bamglib/Meshio.cpp \ ../bamglib/Mesh2.cpp ../bamglib/Metric.cpp ../femlib/BamgFreeFem.cpp \ ../bamglib/MeshDraw.cpp ../bamglib/MeshGeom.cpp \ ../bamglib/MeshQuad.cpp ../bamglib/SetOfE4.cpp ../bamglib/MeshRead.cpp \ ../bamglib/write_hdf5.cpp ../bamglib/write_hdf5.hpp ../bamglib/write_xdmf.cpp \ ../bamglib/MeshWrite.cpp problem.cpp mt19937ar.cpp \ ../Graphics/DefColor.cpp \ InitFunct.cpp ../Algo/lgalgo.cpp \ ../femlib/Element_P2h.cpp load.cpp lgfem.cpp AFunction.hpp AnyType.hpp \ error.hpp ../femlib/gmres.hpp InitFunct.hpp lex.hpp lgfem.hpp lgmesh3.hpp \ lgmesh.hpp lgsolver.hpp \ Operator.hpp problem.hpp Serialize.hpp showverb.hpp String.hpp \ throwassert.hpp versionnumber.hpp CodeAlloc.hpp \ array_init.hpp array_tlp.hpp array_resize.hpp \ strversionnumber.hpp ffstack.hpp AddNewFE.h \ environment.cpp environment.hpp string_def.cpp \ ../femlib/FESpacen.cpp \ ../femlib/P012_1d.cpp \ ../femlib/P012_2d.cpp \ ../femlib/P012_3d.cpp \ ../femlib/Mesh1dn.cpp \ ../femlib/Mesh2dn.cpp \ ../femlib/Mesh3dn.cpp \ ../femlib/GQuadTree.cpp \ ../femlib/libmesh5.c \ glumesh2D.cpp \ PlotStream.hpp \ endian.hpp \ ff++.hpp \ ../Eigen/arpackff.hpp \ ../femlib/splitsimplex.cpp AFunction_ext.hpp \ ffapi.hpp P1IsoValue.cpp P1IsoValue.hpp libff_a_SOURCES = $(libff_a_SOURCES2) strversionnumber.cpp # eigenvalue.cpp is optional (see [[file:../../configure.ac::EIGENOBJ]]) EXTRA_libff_a_SOURCES = ../Eigen/eigenvalue.cpp libff_a_LIBADD = @EIGENOBJ@ libff_a_DEPENDENCIES = @EIGENOBJ@ AM_CPPFLAGS = -I$(srcdir)/../lglib -I$(srcdir)/../bamglib -I$(srcdir)/../Graphics -I$(srcdir)/../femlib $(HDF5_CPPFLAGS) $(UMFPACK_CPPFLAGS) # -I$(top_srcdir)/arpack/arpack++/include # Build date changes at every change EXTRA_DIST = strversionnumber.m4 BUILT_SOURCES = strversionnumber.cpp all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cpp .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/fflib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/fflib/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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libff.a: $(libff_a_OBJECTS) $(libff_a_DEPENDENCIES) $(EXTRA_libff_a_DEPENDENCIES) $(AM_V_at)-rm -f libff.a $(AM_V_AR)$(libff_a_AR) libff.a $(libff_a_OBJECTS) $(libff_a_LIBADD) $(AM_V_at)$(RANLIB) libff.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AFunction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AFunction2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BamgFreeFem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CheckPtr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CodeAlloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefColor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Drawing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Element_P2h.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Element_RT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FESpace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FESpacen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FQuadTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GQuadTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InitFunct.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh1dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh2dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh3dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshDraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshGeom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshQuad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshRead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MeshWrite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Meshio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Metric.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/P012_1d.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/P012_2d.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/P012_3d.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/P1IsoValue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuadTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuadratureFormular.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/R2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SetOfE4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UMFPack_Solver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array_long.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array_real.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigenvalue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gibbs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glumesh2D.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lgalgo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lgfem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lgmat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lgmesh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lgmesh3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmesh5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mshptg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt19937ar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/problem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splitsimplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_def.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strversionnumber.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write_hdf5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write_xdmf.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libmesh5.o: ../femlib/libmesh5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmesh5.o -MD -MP -MF $(DEPDIR)/libmesh5.Tpo -c -o libmesh5.o `test -f '../femlib/libmesh5.c' || echo '$(srcdir)/'`../femlib/libmesh5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmesh5.Tpo $(DEPDIR)/libmesh5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../femlib/libmesh5.c' object='libmesh5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmesh5.o `test -f '../femlib/libmesh5.c' || echo '$(srcdir)/'`../femlib/libmesh5.c libmesh5.obj: ../femlib/libmesh5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmesh5.obj -MD -MP -MF $(DEPDIR)/libmesh5.Tpo -c -o libmesh5.obj `if test -f '../femlib/libmesh5.c'; then $(CYGPATH_W) '../femlib/libmesh5.c'; else $(CYGPATH_W) '$(srcdir)/../femlib/libmesh5.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmesh5.Tpo $(DEPDIR)/libmesh5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../femlib/libmesh5.c' object='libmesh5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmesh5.obj `if test -f '../femlib/libmesh5.c'; then $(CYGPATH_W) '../femlib/libmesh5.c'; else $(CYGPATH_W) '$(srcdir)/../femlib/libmesh5.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` Drawing.o: ../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Drawing.o -MD -MP -MF $(DEPDIR)/Drawing.Tpo -c -o Drawing.o `test -f '../femlib/Drawing.cpp' || echo '$(srcdir)/'`../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Drawing.Tpo $(DEPDIR)/Drawing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Drawing.cpp' object='Drawing.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Drawing.o `test -f '../femlib/Drawing.cpp' || echo '$(srcdir)/'`../femlib/Drawing.cpp Drawing.obj: ../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Drawing.obj -MD -MP -MF $(DEPDIR)/Drawing.Tpo -c -o Drawing.obj `if test -f '../femlib/Drawing.cpp'; then $(CYGPATH_W) '../femlib/Drawing.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Drawing.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Drawing.Tpo $(DEPDIR)/Drawing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Drawing.cpp' object='Drawing.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Drawing.obj `if test -f '../femlib/Drawing.cpp'; then $(CYGPATH_W) '../femlib/Drawing.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Drawing.cpp'; fi` gibbs.o: ../femlib/gibbs.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gibbs.o -MD -MP -MF $(DEPDIR)/gibbs.Tpo -c -o gibbs.o `test -f '../femlib/gibbs.cpp' || echo '$(srcdir)/'`../femlib/gibbs.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gibbs.Tpo $(DEPDIR)/gibbs.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/gibbs.cpp' object='gibbs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gibbs.o `test -f '../femlib/gibbs.cpp' || echo '$(srcdir)/'`../femlib/gibbs.cpp gibbs.obj: ../femlib/gibbs.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gibbs.obj -MD -MP -MF $(DEPDIR)/gibbs.Tpo -c -o gibbs.obj `if test -f '../femlib/gibbs.cpp'; then $(CYGPATH_W) '../femlib/gibbs.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/gibbs.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gibbs.Tpo $(DEPDIR)/gibbs.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/gibbs.cpp' object='gibbs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gibbs.obj `if test -f '../femlib/gibbs.cpp'; then $(CYGPATH_W) '../femlib/gibbs.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/gibbs.cpp'; fi` CheckPtr.o: ../femlib/CheckPtr.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CheckPtr.o -MD -MP -MF $(DEPDIR)/CheckPtr.Tpo -c -o CheckPtr.o `test -f '../femlib/CheckPtr.cpp' || echo '$(srcdir)/'`../femlib/CheckPtr.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/CheckPtr.Tpo $(DEPDIR)/CheckPtr.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/CheckPtr.cpp' object='CheckPtr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CheckPtr.o `test -f '../femlib/CheckPtr.cpp' || echo '$(srcdir)/'`../femlib/CheckPtr.cpp CheckPtr.obj: ../femlib/CheckPtr.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CheckPtr.obj -MD -MP -MF $(DEPDIR)/CheckPtr.Tpo -c -o CheckPtr.obj `if test -f '../femlib/CheckPtr.cpp'; then $(CYGPATH_W) '../femlib/CheckPtr.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/CheckPtr.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/CheckPtr.Tpo $(DEPDIR)/CheckPtr.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/CheckPtr.cpp' object='CheckPtr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CheckPtr.obj `if test -f '../femlib/CheckPtr.cpp'; then $(CYGPATH_W) '../femlib/CheckPtr.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/CheckPtr.cpp'; fi` fem.o: ../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fem.o -MD -MP -MF $(DEPDIR)/fem.Tpo -c -o fem.o `test -f '../femlib/fem.cpp' || echo '$(srcdir)/'`../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fem.Tpo $(DEPDIR)/fem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/fem.cpp' object='fem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fem.o `test -f '../femlib/fem.cpp' || echo '$(srcdir)/'`../femlib/fem.cpp fem.obj: ../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fem.obj -MD -MP -MF $(DEPDIR)/fem.Tpo -c -o fem.obj `if test -f '../femlib/fem.cpp'; then $(CYGPATH_W) '../femlib/fem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/fem.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fem.Tpo $(DEPDIR)/fem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/fem.cpp' object='fem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fem.obj `if test -f '../femlib/fem.cpp'; then $(CYGPATH_W) '../femlib/fem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/fem.cpp'; fi` QuadratureFormular.o: ../femlib/QuadratureFormular.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT QuadratureFormular.o -MD -MP -MF $(DEPDIR)/QuadratureFormular.Tpo -c -o QuadratureFormular.o `test -f '../femlib/QuadratureFormular.cpp' || echo '$(srcdir)/'`../femlib/QuadratureFormular.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/QuadratureFormular.Tpo $(DEPDIR)/QuadratureFormular.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/QuadratureFormular.cpp' object='QuadratureFormular.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o QuadratureFormular.o `test -f '../femlib/QuadratureFormular.cpp' || echo '$(srcdir)/'`../femlib/QuadratureFormular.cpp QuadratureFormular.obj: ../femlib/QuadratureFormular.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT QuadratureFormular.obj -MD -MP -MF $(DEPDIR)/QuadratureFormular.Tpo -c -o QuadratureFormular.obj `if test -f '../femlib/QuadratureFormular.cpp'; then $(CYGPATH_W) '../femlib/QuadratureFormular.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/QuadratureFormular.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/QuadratureFormular.Tpo $(DEPDIR)/QuadratureFormular.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/QuadratureFormular.cpp' object='QuadratureFormular.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o QuadratureFormular.obj `if test -f '../femlib/QuadratureFormular.cpp'; then $(CYGPATH_W) '../femlib/QuadratureFormular.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/QuadratureFormular.cpp'; fi` FESpace.o: ../femlib/FESpace.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FESpace.o -MD -MP -MF $(DEPDIR)/FESpace.Tpo -c -o FESpace.o `test -f '../femlib/FESpace.cpp' || echo '$(srcdir)/'`../femlib/FESpace.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FESpace.Tpo $(DEPDIR)/FESpace.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FESpace.cpp' object='FESpace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FESpace.o `test -f '../femlib/FESpace.cpp' || echo '$(srcdir)/'`../femlib/FESpace.cpp FESpace.obj: ../femlib/FESpace.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FESpace.obj -MD -MP -MF $(DEPDIR)/FESpace.Tpo -c -o FESpace.obj `if test -f '../femlib/FESpace.cpp'; then $(CYGPATH_W) '../femlib/FESpace.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FESpace.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FESpace.Tpo $(DEPDIR)/FESpace.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FESpace.cpp' object='FESpace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FESpace.obj `if test -f '../femlib/FESpace.cpp'; then $(CYGPATH_W) '../femlib/FESpace.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FESpace.cpp'; fi` Element_RT.o: ../femlib/Element_RT.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Element_RT.o -MD -MP -MF $(DEPDIR)/Element_RT.Tpo -c -o Element_RT.o `test -f '../femlib/Element_RT.cpp' || echo '$(srcdir)/'`../femlib/Element_RT.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Element_RT.Tpo $(DEPDIR)/Element_RT.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Element_RT.cpp' object='Element_RT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Element_RT.o `test -f '../femlib/Element_RT.cpp' || echo '$(srcdir)/'`../femlib/Element_RT.cpp Element_RT.obj: ../femlib/Element_RT.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Element_RT.obj -MD -MP -MF $(DEPDIR)/Element_RT.Tpo -c -o Element_RT.obj `if test -f '../femlib/Element_RT.cpp'; then $(CYGPATH_W) '../femlib/Element_RT.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Element_RT.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Element_RT.Tpo $(DEPDIR)/Element_RT.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Element_RT.cpp' object='Element_RT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Element_RT.obj `if test -f '../femlib/Element_RT.cpp'; then $(CYGPATH_W) '../femlib/Element_RT.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Element_RT.cpp'; fi` mshptg.o: ../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mshptg.o -MD -MP -MF $(DEPDIR)/mshptg.Tpo -c -o mshptg.o `test -f '../femlib/mshptg.cpp' || echo '$(srcdir)/'`../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mshptg.Tpo $(DEPDIR)/mshptg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/mshptg.cpp' object='mshptg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mshptg.o `test -f '../femlib/mshptg.cpp' || echo '$(srcdir)/'`../femlib/mshptg.cpp mshptg.obj: ../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mshptg.obj -MD -MP -MF $(DEPDIR)/mshptg.Tpo -c -o mshptg.obj `if test -f '../femlib/mshptg.cpp'; then $(CYGPATH_W) '../femlib/mshptg.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/mshptg.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mshptg.Tpo $(DEPDIR)/mshptg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/mshptg.cpp' object='mshptg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mshptg.obj `if test -f '../femlib/mshptg.cpp'; then $(CYGPATH_W) '../femlib/mshptg.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/mshptg.cpp'; fi` FQuadTree.o: ../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FQuadTree.o -MD -MP -MF $(DEPDIR)/FQuadTree.Tpo -c -o FQuadTree.o `test -f '../femlib/FQuadTree.cpp' || echo '$(srcdir)/'`../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FQuadTree.Tpo $(DEPDIR)/FQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FQuadTree.cpp' object='FQuadTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FQuadTree.o `test -f '../femlib/FQuadTree.cpp' || echo '$(srcdir)/'`../femlib/FQuadTree.cpp FQuadTree.obj: ../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FQuadTree.obj -MD -MP -MF $(DEPDIR)/FQuadTree.Tpo -c -o FQuadTree.obj `if test -f '../femlib/FQuadTree.cpp'; then $(CYGPATH_W) '../femlib/FQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FQuadTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FQuadTree.Tpo $(DEPDIR)/FQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FQuadTree.cpp' object='FQuadTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FQuadTree.obj `if test -f '../femlib/FQuadTree.cpp'; then $(CYGPATH_W) '../femlib/FQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FQuadTree.cpp'; fi` QuadTree.o: ../bamglib/QuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT QuadTree.o -MD -MP -MF $(DEPDIR)/QuadTree.Tpo -c -o QuadTree.o `test -f '../bamglib/QuadTree.cpp' || echo '$(srcdir)/'`../bamglib/QuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/QuadTree.Tpo $(DEPDIR)/QuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/QuadTree.cpp' object='QuadTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o QuadTree.o `test -f '../bamglib/QuadTree.cpp' || echo '$(srcdir)/'`../bamglib/QuadTree.cpp QuadTree.obj: ../bamglib/QuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT QuadTree.obj -MD -MP -MF $(DEPDIR)/QuadTree.Tpo -c -o QuadTree.obj `if test -f '../bamglib/QuadTree.cpp'; then $(CYGPATH_W) '../bamglib/QuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/QuadTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/QuadTree.Tpo $(DEPDIR)/QuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/QuadTree.cpp' object='QuadTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o QuadTree.obj `if test -f '../bamglib/QuadTree.cpp'; then $(CYGPATH_W) '../bamglib/QuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/QuadTree.cpp'; fi` R2.o: ../bamglib/R2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT R2.o -MD -MP -MF $(DEPDIR)/R2.Tpo -c -o R2.o `test -f '../bamglib/R2.cpp' || echo '$(srcdir)/'`../bamglib/R2.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/R2.Tpo $(DEPDIR)/R2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/R2.cpp' object='R2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o R2.o `test -f '../bamglib/R2.cpp' || echo '$(srcdir)/'`../bamglib/R2.cpp R2.obj: ../bamglib/R2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT R2.obj -MD -MP -MF $(DEPDIR)/R2.Tpo -c -o R2.obj `if test -f '../bamglib/R2.cpp'; then $(CYGPATH_W) '../bamglib/R2.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/R2.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/R2.Tpo $(DEPDIR)/R2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/R2.cpp' object='R2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o R2.obj `if test -f '../bamglib/R2.cpp'; then $(CYGPATH_W) '../bamglib/R2.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/R2.cpp'; fi` Meshio.o: ../bamglib/Meshio.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Meshio.o -MD -MP -MF $(DEPDIR)/Meshio.Tpo -c -o Meshio.o `test -f '../bamglib/Meshio.cpp' || echo '$(srcdir)/'`../bamglib/Meshio.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Meshio.Tpo $(DEPDIR)/Meshio.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Meshio.cpp' object='Meshio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Meshio.o `test -f '../bamglib/Meshio.cpp' || echo '$(srcdir)/'`../bamglib/Meshio.cpp Meshio.obj: ../bamglib/Meshio.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Meshio.obj -MD -MP -MF $(DEPDIR)/Meshio.Tpo -c -o Meshio.obj `if test -f '../bamglib/Meshio.cpp'; then $(CYGPATH_W) '../bamglib/Meshio.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Meshio.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Meshio.Tpo $(DEPDIR)/Meshio.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Meshio.cpp' object='Meshio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Meshio.obj `if test -f '../bamglib/Meshio.cpp'; then $(CYGPATH_W) '../bamglib/Meshio.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Meshio.cpp'; fi` Mesh2.o: ../bamglib/Mesh2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2.o -MD -MP -MF $(DEPDIR)/Mesh2.Tpo -c -o Mesh2.o `test -f '../bamglib/Mesh2.cpp' || echo '$(srcdir)/'`../bamglib/Mesh2.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2.Tpo $(DEPDIR)/Mesh2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Mesh2.cpp' object='Mesh2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2.o `test -f '../bamglib/Mesh2.cpp' || echo '$(srcdir)/'`../bamglib/Mesh2.cpp Mesh2.obj: ../bamglib/Mesh2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2.obj -MD -MP -MF $(DEPDIR)/Mesh2.Tpo -c -o Mesh2.obj `if test -f '../bamglib/Mesh2.cpp'; then $(CYGPATH_W) '../bamglib/Mesh2.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Mesh2.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2.Tpo $(DEPDIR)/Mesh2.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Mesh2.cpp' object='Mesh2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2.obj `if test -f '../bamglib/Mesh2.cpp'; then $(CYGPATH_W) '../bamglib/Mesh2.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Mesh2.cpp'; fi` Metric.o: ../bamglib/Metric.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Metric.o -MD -MP -MF $(DEPDIR)/Metric.Tpo -c -o Metric.o `test -f '../bamglib/Metric.cpp' || echo '$(srcdir)/'`../bamglib/Metric.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Metric.Tpo $(DEPDIR)/Metric.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Metric.cpp' object='Metric.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Metric.o `test -f '../bamglib/Metric.cpp' || echo '$(srcdir)/'`../bamglib/Metric.cpp Metric.obj: ../bamglib/Metric.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Metric.obj -MD -MP -MF $(DEPDIR)/Metric.Tpo -c -o Metric.obj `if test -f '../bamglib/Metric.cpp'; then $(CYGPATH_W) '../bamglib/Metric.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Metric.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Metric.Tpo $(DEPDIR)/Metric.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/Metric.cpp' object='Metric.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Metric.obj `if test -f '../bamglib/Metric.cpp'; then $(CYGPATH_W) '../bamglib/Metric.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/Metric.cpp'; fi` BamgFreeFem.o: ../femlib/BamgFreeFem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BamgFreeFem.o -MD -MP -MF $(DEPDIR)/BamgFreeFem.Tpo -c -o BamgFreeFem.o `test -f '../femlib/BamgFreeFem.cpp' || echo '$(srcdir)/'`../femlib/BamgFreeFem.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/BamgFreeFem.Tpo $(DEPDIR)/BamgFreeFem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/BamgFreeFem.cpp' object='BamgFreeFem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BamgFreeFem.o `test -f '../femlib/BamgFreeFem.cpp' || echo '$(srcdir)/'`../femlib/BamgFreeFem.cpp BamgFreeFem.obj: ../femlib/BamgFreeFem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BamgFreeFem.obj -MD -MP -MF $(DEPDIR)/BamgFreeFem.Tpo -c -o BamgFreeFem.obj `if test -f '../femlib/BamgFreeFem.cpp'; then $(CYGPATH_W) '../femlib/BamgFreeFem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/BamgFreeFem.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/BamgFreeFem.Tpo $(DEPDIR)/BamgFreeFem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/BamgFreeFem.cpp' object='BamgFreeFem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BamgFreeFem.obj `if test -f '../femlib/BamgFreeFem.cpp'; then $(CYGPATH_W) '../femlib/BamgFreeFem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/BamgFreeFem.cpp'; fi` MeshDraw.o: ../bamglib/MeshDraw.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshDraw.o -MD -MP -MF $(DEPDIR)/MeshDraw.Tpo -c -o MeshDraw.o `test -f '../bamglib/MeshDraw.cpp' || echo '$(srcdir)/'`../bamglib/MeshDraw.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshDraw.Tpo $(DEPDIR)/MeshDraw.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshDraw.cpp' object='MeshDraw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshDraw.o `test -f '../bamglib/MeshDraw.cpp' || echo '$(srcdir)/'`../bamglib/MeshDraw.cpp MeshDraw.obj: ../bamglib/MeshDraw.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshDraw.obj -MD -MP -MF $(DEPDIR)/MeshDraw.Tpo -c -o MeshDraw.obj `if test -f '../bamglib/MeshDraw.cpp'; then $(CYGPATH_W) '../bamglib/MeshDraw.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshDraw.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshDraw.Tpo $(DEPDIR)/MeshDraw.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshDraw.cpp' object='MeshDraw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshDraw.obj `if test -f '../bamglib/MeshDraw.cpp'; then $(CYGPATH_W) '../bamglib/MeshDraw.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshDraw.cpp'; fi` MeshGeom.o: ../bamglib/MeshGeom.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshGeom.o -MD -MP -MF $(DEPDIR)/MeshGeom.Tpo -c -o MeshGeom.o `test -f '../bamglib/MeshGeom.cpp' || echo '$(srcdir)/'`../bamglib/MeshGeom.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshGeom.Tpo $(DEPDIR)/MeshGeom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshGeom.cpp' object='MeshGeom.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshGeom.o `test -f '../bamglib/MeshGeom.cpp' || echo '$(srcdir)/'`../bamglib/MeshGeom.cpp MeshGeom.obj: ../bamglib/MeshGeom.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshGeom.obj -MD -MP -MF $(DEPDIR)/MeshGeom.Tpo -c -o MeshGeom.obj `if test -f '../bamglib/MeshGeom.cpp'; then $(CYGPATH_W) '../bamglib/MeshGeom.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshGeom.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshGeom.Tpo $(DEPDIR)/MeshGeom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshGeom.cpp' object='MeshGeom.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshGeom.obj `if test -f '../bamglib/MeshGeom.cpp'; then $(CYGPATH_W) '../bamglib/MeshGeom.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshGeom.cpp'; fi` MeshQuad.o: ../bamglib/MeshQuad.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshQuad.o -MD -MP -MF $(DEPDIR)/MeshQuad.Tpo -c -o MeshQuad.o `test -f '../bamglib/MeshQuad.cpp' || echo '$(srcdir)/'`../bamglib/MeshQuad.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshQuad.Tpo $(DEPDIR)/MeshQuad.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshQuad.cpp' object='MeshQuad.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshQuad.o `test -f '../bamglib/MeshQuad.cpp' || echo '$(srcdir)/'`../bamglib/MeshQuad.cpp MeshQuad.obj: ../bamglib/MeshQuad.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshQuad.obj -MD -MP -MF $(DEPDIR)/MeshQuad.Tpo -c -o MeshQuad.obj `if test -f '../bamglib/MeshQuad.cpp'; then $(CYGPATH_W) '../bamglib/MeshQuad.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshQuad.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshQuad.Tpo $(DEPDIR)/MeshQuad.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshQuad.cpp' object='MeshQuad.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshQuad.obj `if test -f '../bamglib/MeshQuad.cpp'; then $(CYGPATH_W) '../bamglib/MeshQuad.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshQuad.cpp'; fi` SetOfE4.o: ../bamglib/SetOfE4.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SetOfE4.o -MD -MP -MF $(DEPDIR)/SetOfE4.Tpo -c -o SetOfE4.o `test -f '../bamglib/SetOfE4.cpp' || echo '$(srcdir)/'`../bamglib/SetOfE4.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/SetOfE4.Tpo $(DEPDIR)/SetOfE4.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/SetOfE4.cpp' object='SetOfE4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SetOfE4.o `test -f '../bamglib/SetOfE4.cpp' || echo '$(srcdir)/'`../bamglib/SetOfE4.cpp SetOfE4.obj: ../bamglib/SetOfE4.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SetOfE4.obj -MD -MP -MF $(DEPDIR)/SetOfE4.Tpo -c -o SetOfE4.obj `if test -f '../bamglib/SetOfE4.cpp'; then $(CYGPATH_W) '../bamglib/SetOfE4.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/SetOfE4.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/SetOfE4.Tpo $(DEPDIR)/SetOfE4.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/SetOfE4.cpp' object='SetOfE4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SetOfE4.obj `if test -f '../bamglib/SetOfE4.cpp'; then $(CYGPATH_W) '../bamglib/SetOfE4.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/SetOfE4.cpp'; fi` MeshRead.o: ../bamglib/MeshRead.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshRead.o -MD -MP -MF $(DEPDIR)/MeshRead.Tpo -c -o MeshRead.o `test -f '../bamglib/MeshRead.cpp' || echo '$(srcdir)/'`../bamglib/MeshRead.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshRead.Tpo $(DEPDIR)/MeshRead.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshRead.cpp' object='MeshRead.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshRead.o `test -f '../bamglib/MeshRead.cpp' || echo '$(srcdir)/'`../bamglib/MeshRead.cpp MeshRead.obj: ../bamglib/MeshRead.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshRead.obj -MD -MP -MF $(DEPDIR)/MeshRead.Tpo -c -o MeshRead.obj `if test -f '../bamglib/MeshRead.cpp'; then $(CYGPATH_W) '../bamglib/MeshRead.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshRead.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshRead.Tpo $(DEPDIR)/MeshRead.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshRead.cpp' object='MeshRead.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshRead.obj `if test -f '../bamglib/MeshRead.cpp'; then $(CYGPATH_W) '../bamglib/MeshRead.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshRead.cpp'; fi` write_hdf5.o: ../bamglib/write_hdf5.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT write_hdf5.o -MD -MP -MF $(DEPDIR)/write_hdf5.Tpo -c -o write_hdf5.o `test -f '../bamglib/write_hdf5.cpp' || echo '$(srcdir)/'`../bamglib/write_hdf5.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/write_hdf5.Tpo $(DEPDIR)/write_hdf5.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/write_hdf5.cpp' object='write_hdf5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o write_hdf5.o `test -f '../bamglib/write_hdf5.cpp' || echo '$(srcdir)/'`../bamglib/write_hdf5.cpp write_hdf5.obj: ../bamglib/write_hdf5.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT write_hdf5.obj -MD -MP -MF $(DEPDIR)/write_hdf5.Tpo -c -o write_hdf5.obj `if test -f '../bamglib/write_hdf5.cpp'; then $(CYGPATH_W) '../bamglib/write_hdf5.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/write_hdf5.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/write_hdf5.Tpo $(DEPDIR)/write_hdf5.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/write_hdf5.cpp' object='write_hdf5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o write_hdf5.obj `if test -f '../bamglib/write_hdf5.cpp'; then $(CYGPATH_W) '../bamglib/write_hdf5.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/write_hdf5.cpp'; fi` write_xdmf.o: ../bamglib/write_xdmf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT write_xdmf.o -MD -MP -MF $(DEPDIR)/write_xdmf.Tpo -c -o write_xdmf.o `test -f '../bamglib/write_xdmf.cpp' || echo '$(srcdir)/'`../bamglib/write_xdmf.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/write_xdmf.Tpo $(DEPDIR)/write_xdmf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/write_xdmf.cpp' object='write_xdmf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o write_xdmf.o `test -f '../bamglib/write_xdmf.cpp' || echo '$(srcdir)/'`../bamglib/write_xdmf.cpp write_xdmf.obj: ../bamglib/write_xdmf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT write_xdmf.obj -MD -MP -MF $(DEPDIR)/write_xdmf.Tpo -c -o write_xdmf.obj `if test -f '../bamglib/write_xdmf.cpp'; then $(CYGPATH_W) '../bamglib/write_xdmf.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/write_xdmf.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/write_xdmf.Tpo $(DEPDIR)/write_xdmf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/write_xdmf.cpp' object='write_xdmf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o write_xdmf.obj `if test -f '../bamglib/write_xdmf.cpp'; then $(CYGPATH_W) '../bamglib/write_xdmf.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/write_xdmf.cpp'; fi` MeshWrite.o: ../bamglib/MeshWrite.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshWrite.o -MD -MP -MF $(DEPDIR)/MeshWrite.Tpo -c -o MeshWrite.o `test -f '../bamglib/MeshWrite.cpp' || echo '$(srcdir)/'`../bamglib/MeshWrite.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshWrite.Tpo $(DEPDIR)/MeshWrite.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshWrite.cpp' object='MeshWrite.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshWrite.o `test -f '../bamglib/MeshWrite.cpp' || echo '$(srcdir)/'`../bamglib/MeshWrite.cpp MeshWrite.obj: ../bamglib/MeshWrite.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MeshWrite.obj -MD -MP -MF $(DEPDIR)/MeshWrite.Tpo -c -o MeshWrite.obj `if test -f '../bamglib/MeshWrite.cpp'; then $(CYGPATH_W) '../bamglib/MeshWrite.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshWrite.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/MeshWrite.Tpo $(DEPDIR)/MeshWrite.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../bamglib/MeshWrite.cpp' object='MeshWrite.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MeshWrite.obj `if test -f '../bamglib/MeshWrite.cpp'; then $(CYGPATH_W) '../bamglib/MeshWrite.cpp'; else $(CYGPATH_W) '$(srcdir)/../bamglib/MeshWrite.cpp'; fi` DefColor.o: ../Graphics/DefColor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DefColor.o -MD -MP -MF $(DEPDIR)/DefColor.Tpo -c -o DefColor.o `test -f '../Graphics/DefColor.cpp' || echo '$(srcdir)/'`../Graphics/DefColor.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DefColor.Tpo $(DEPDIR)/DefColor.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/DefColor.cpp' object='DefColor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DefColor.o `test -f '../Graphics/DefColor.cpp' || echo '$(srcdir)/'`../Graphics/DefColor.cpp DefColor.obj: ../Graphics/DefColor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DefColor.obj -MD -MP -MF $(DEPDIR)/DefColor.Tpo -c -o DefColor.obj `if test -f '../Graphics/DefColor.cpp'; then $(CYGPATH_W) '../Graphics/DefColor.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/DefColor.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/DefColor.Tpo $(DEPDIR)/DefColor.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/DefColor.cpp' object='DefColor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DefColor.obj `if test -f '../Graphics/DefColor.cpp'; then $(CYGPATH_W) '../Graphics/DefColor.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/DefColor.cpp'; fi` lgalgo.o: ../Algo/lgalgo.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lgalgo.o -MD -MP -MF $(DEPDIR)/lgalgo.Tpo -c -o lgalgo.o `test -f '../Algo/lgalgo.cpp' || echo '$(srcdir)/'`../Algo/lgalgo.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lgalgo.Tpo $(DEPDIR)/lgalgo.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Algo/lgalgo.cpp' object='lgalgo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lgalgo.o `test -f '../Algo/lgalgo.cpp' || echo '$(srcdir)/'`../Algo/lgalgo.cpp lgalgo.obj: ../Algo/lgalgo.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lgalgo.obj -MD -MP -MF $(DEPDIR)/lgalgo.Tpo -c -o lgalgo.obj `if test -f '../Algo/lgalgo.cpp'; then $(CYGPATH_W) '../Algo/lgalgo.cpp'; else $(CYGPATH_W) '$(srcdir)/../Algo/lgalgo.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lgalgo.Tpo $(DEPDIR)/lgalgo.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Algo/lgalgo.cpp' object='lgalgo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lgalgo.obj `if test -f '../Algo/lgalgo.cpp'; then $(CYGPATH_W) '../Algo/lgalgo.cpp'; else $(CYGPATH_W) '$(srcdir)/../Algo/lgalgo.cpp'; fi` Element_P2h.o: ../femlib/Element_P2h.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Element_P2h.o -MD -MP -MF $(DEPDIR)/Element_P2h.Tpo -c -o Element_P2h.o `test -f '../femlib/Element_P2h.cpp' || echo '$(srcdir)/'`../femlib/Element_P2h.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Element_P2h.Tpo $(DEPDIR)/Element_P2h.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Element_P2h.cpp' object='Element_P2h.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Element_P2h.o `test -f '../femlib/Element_P2h.cpp' || echo '$(srcdir)/'`../femlib/Element_P2h.cpp Element_P2h.obj: ../femlib/Element_P2h.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Element_P2h.obj -MD -MP -MF $(DEPDIR)/Element_P2h.Tpo -c -o Element_P2h.obj `if test -f '../femlib/Element_P2h.cpp'; then $(CYGPATH_W) '../femlib/Element_P2h.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Element_P2h.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Element_P2h.Tpo $(DEPDIR)/Element_P2h.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Element_P2h.cpp' object='Element_P2h.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Element_P2h.obj `if test -f '../femlib/Element_P2h.cpp'; then $(CYGPATH_W) '../femlib/Element_P2h.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Element_P2h.cpp'; fi` FESpacen.o: ../femlib/FESpacen.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FESpacen.o -MD -MP -MF $(DEPDIR)/FESpacen.Tpo -c -o FESpacen.o `test -f '../femlib/FESpacen.cpp' || echo '$(srcdir)/'`../femlib/FESpacen.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FESpacen.Tpo $(DEPDIR)/FESpacen.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FESpacen.cpp' object='FESpacen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FESpacen.o `test -f '../femlib/FESpacen.cpp' || echo '$(srcdir)/'`../femlib/FESpacen.cpp FESpacen.obj: ../femlib/FESpacen.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FESpacen.obj -MD -MP -MF $(DEPDIR)/FESpacen.Tpo -c -o FESpacen.obj `if test -f '../femlib/FESpacen.cpp'; then $(CYGPATH_W) '../femlib/FESpacen.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FESpacen.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FESpacen.Tpo $(DEPDIR)/FESpacen.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FESpacen.cpp' object='FESpacen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FESpacen.obj `if test -f '../femlib/FESpacen.cpp'; then $(CYGPATH_W) '../femlib/FESpacen.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FESpacen.cpp'; fi` P012_1d.o: ../femlib/P012_1d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_1d.o -MD -MP -MF $(DEPDIR)/P012_1d.Tpo -c -o P012_1d.o `test -f '../femlib/P012_1d.cpp' || echo '$(srcdir)/'`../femlib/P012_1d.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_1d.Tpo $(DEPDIR)/P012_1d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_1d.cpp' object='P012_1d.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_1d.o `test -f '../femlib/P012_1d.cpp' || echo '$(srcdir)/'`../femlib/P012_1d.cpp P012_1d.obj: ../femlib/P012_1d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_1d.obj -MD -MP -MF $(DEPDIR)/P012_1d.Tpo -c -o P012_1d.obj `if test -f '../femlib/P012_1d.cpp'; then $(CYGPATH_W) '../femlib/P012_1d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_1d.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_1d.Tpo $(DEPDIR)/P012_1d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_1d.cpp' object='P012_1d.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_1d.obj `if test -f '../femlib/P012_1d.cpp'; then $(CYGPATH_W) '../femlib/P012_1d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_1d.cpp'; fi` P012_2d.o: ../femlib/P012_2d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_2d.o -MD -MP -MF $(DEPDIR)/P012_2d.Tpo -c -o P012_2d.o `test -f '../femlib/P012_2d.cpp' || echo '$(srcdir)/'`../femlib/P012_2d.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_2d.Tpo $(DEPDIR)/P012_2d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_2d.cpp' object='P012_2d.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_2d.o `test -f '../femlib/P012_2d.cpp' || echo '$(srcdir)/'`../femlib/P012_2d.cpp P012_2d.obj: ../femlib/P012_2d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_2d.obj -MD -MP -MF $(DEPDIR)/P012_2d.Tpo -c -o P012_2d.obj `if test -f '../femlib/P012_2d.cpp'; then $(CYGPATH_W) '../femlib/P012_2d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_2d.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_2d.Tpo $(DEPDIR)/P012_2d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_2d.cpp' object='P012_2d.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_2d.obj `if test -f '../femlib/P012_2d.cpp'; then $(CYGPATH_W) '../femlib/P012_2d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_2d.cpp'; fi` P012_3d.o: ../femlib/P012_3d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_3d.o -MD -MP -MF $(DEPDIR)/P012_3d.Tpo -c -o P012_3d.o `test -f '../femlib/P012_3d.cpp' || echo '$(srcdir)/'`../femlib/P012_3d.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_3d.Tpo $(DEPDIR)/P012_3d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_3d.cpp' object='P012_3d.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_3d.o `test -f '../femlib/P012_3d.cpp' || echo '$(srcdir)/'`../femlib/P012_3d.cpp P012_3d.obj: ../femlib/P012_3d.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT P012_3d.obj -MD -MP -MF $(DEPDIR)/P012_3d.Tpo -c -o P012_3d.obj `if test -f '../femlib/P012_3d.cpp'; then $(CYGPATH_W) '../femlib/P012_3d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_3d.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/P012_3d.Tpo $(DEPDIR)/P012_3d.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/P012_3d.cpp' object='P012_3d.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o P012_3d.obj `if test -f '../femlib/P012_3d.cpp'; then $(CYGPATH_W) '../femlib/P012_3d.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/P012_3d.cpp'; fi` Mesh1dn.o: ../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh1dn.o -MD -MP -MF $(DEPDIR)/Mesh1dn.Tpo -c -o Mesh1dn.o `test -f '../femlib/Mesh1dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh1dn.Tpo $(DEPDIR)/Mesh1dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh1dn.cpp' object='Mesh1dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh1dn.o `test -f '../femlib/Mesh1dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh1dn.cpp Mesh1dn.obj: ../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh1dn.obj -MD -MP -MF $(DEPDIR)/Mesh1dn.Tpo -c -o Mesh1dn.obj `if test -f '../femlib/Mesh1dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh1dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh1dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh1dn.Tpo $(DEPDIR)/Mesh1dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh1dn.cpp' object='Mesh1dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh1dn.obj `if test -f '../femlib/Mesh1dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh1dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh1dn.cpp'; fi` Mesh2dn.o: ../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2dn.o -MD -MP -MF $(DEPDIR)/Mesh2dn.Tpo -c -o Mesh2dn.o `test -f '../femlib/Mesh2dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2dn.Tpo $(DEPDIR)/Mesh2dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh2dn.cpp' object='Mesh2dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2dn.o `test -f '../femlib/Mesh2dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh2dn.cpp Mesh2dn.obj: ../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2dn.obj -MD -MP -MF $(DEPDIR)/Mesh2dn.Tpo -c -o Mesh2dn.obj `if test -f '../femlib/Mesh2dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh2dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh2dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2dn.Tpo $(DEPDIR)/Mesh2dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh2dn.cpp' object='Mesh2dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2dn.obj `if test -f '../femlib/Mesh2dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh2dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh2dn.cpp'; fi` Mesh3dn.o: ../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh3dn.o -MD -MP -MF $(DEPDIR)/Mesh3dn.Tpo -c -o Mesh3dn.o `test -f '../femlib/Mesh3dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh3dn.Tpo $(DEPDIR)/Mesh3dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh3dn.cpp' object='Mesh3dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh3dn.o `test -f '../femlib/Mesh3dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh3dn.cpp Mesh3dn.obj: ../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh3dn.obj -MD -MP -MF $(DEPDIR)/Mesh3dn.Tpo -c -o Mesh3dn.obj `if test -f '../femlib/Mesh3dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh3dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh3dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh3dn.Tpo $(DEPDIR)/Mesh3dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh3dn.cpp' object='Mesh3dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh3dn.obj `if test -f '../femlib/Mesh3dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh3dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh3dn.cpp'; fi` GQuadTree.o: ../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GQuadTree.o -MD -MP -MF $(DEPDIR)/GQuadTree.Tpo -c -o GQuadTree.o `test -f '../femlib/GQuadTree.cpp' || echo '$(srcdir)/'`../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/GQuadTree.Tpo $(DEPDIR)/GQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/GQuadTree.cpp' object='GQuadTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GQuadTree.o `test -f '../femlib/GQuadTree.cpp' || echo '$(srcdir)/'`../femlib/GQuadTree.cpp GQuadTree.obj: ../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GQuadTree.obj -MD -MP -MF $(DEPDIR)/GQuadTree.Tpo -c -o GQuadTree.obj `if test -f '../femlib/GQuadTree.cpp'; then $(CYGPATH_W) '../femlib/GQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/GQuadTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/GQuadTree.Tpo $(DEPDIR)/GQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/GQuadTree.cpp' object='GQuadTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GQuadTree.obj `if test -f '../femlib/GQuadTree.cpp'; then $(CYGPATH_W) '../femlib/GQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/GQuadTree.cpp'; fi` splitsimplex.o: ../femlib/splitsimplex.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT splitsimplex.o -MD -MP -MF $(DEPDIR)/splitsimplex.Tpo -c -o splitsimplex.o `test -f '../femlib/splitsimplex.cpp' || echo '$(srcdir)/'`../femlib/splitsimplex.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/splitsimplex.Tpo $(DEPDIR)/splitsimplex.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/splitsimplex.cpp' object='splitsimplex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o splitsimplex.o `test -f '../femlib/splitsimplex.cpp' || echo '$(srcdir)/'`../femlib/splitsimplex.cpp splitsimplex.obj: ../femlib/splitsimplex.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT splitsimplex.obj -MD -MP -MF $(DEPDIR)/splitsimplex.Tpo -c -o splitsimplex.obj `if test -f '../femlib/splitsimplex.cpp'; then $(CYGPATH_W) '../femlib/splitsimplex.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/splitsimplex.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/splitsimplex.Tpo $(DEPDIR)/splitsimplex.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/splitsimplex.cpp' object='splitsimplex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o splitsimplex.obj `if test -f '../femlib/splitsimplex.cpp'; then $(CYGPATH_W) '../femlib/splitsimplex.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/splitsimplex.cpp'; fi` eigenvalue.o: ../Eigen/eigenvalue.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT eigenvalue.o -MD -MP -MF $(DEPDIR)/eigenvalue.Tpo -c -o eigenvalue.o `test -f '../Eigen/eigenvalue.cpp' || echo '$(srcdir)/'`../Eigen/eigenvalue.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/eigenvalue.Tpo $(DEPDIR)/eigenvalue.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Eigen/eigenvalue.cpp' object='eigenvalue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o eigenvalue.o `test -f '../Eigen/eigenvalue.cpp' || echo '$(srcdir)/'`../Eigen/eigenvalue.cpp eigenvalue.obj: ../Eigen/eigenvalue.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT eigenvalue.obj -MD -MP -MF $(DEPDIR)/eigenvalue.Tpo -c -o eigenvalue.obj `if test -f '../Eigen/eigenvalue.cpp'; then $(CYGPATH_W) '../Eigen/eigenvalue.cpp'; else $(CYGPATH_W) '$(srcdir)/../Eigen/eigenvalue.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/eigenvalue.Tpo $(DEPDIR)/eigenvalue.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Eigen/eigenvalue.cpp' object='eigenvalue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o eigenvalue.obj `if test -f '../Eigen/eigenvalue.cpp'; then $(CYGPATH_W) '../Eigen/eigenvalue.cpp'; else $(CYGPATH_W) '$(srcdir)/../Eigen/eigenvalue.cpp'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile strversionnumber.cpp: $(libff_a_SOURCES2) ../../configure m4 -DVersionFreeFemDate="`date`" strversionnumber.m4 > $@ FORCE: # 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: freefem++-3.61-1/src/fflib/InitFunct.cpp000644 000767 000024 00000004631 13256636774 020107 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "InitFunct.hpp" #include #include #include #include #include "ffapi.hpp" using namespace std; typedef void (* afunc)(); typedef pair InitFunct; deque * getInitFunctlist() { static deque * data = new deque(); return data; } extern long verbosity; set & ff_SetofInitFunct() { static set sset; return sset;} // <> void call(const InitFunct & a) { if(verbosity>5) cout << "\n addInitFunct : " << a.first << " call : " <5) cout << " ) " ; } bool comp(const InitFunct a,const InitFunct b) { return a.first < b.first; } // <> called by [[file:load.cpp::callInitsFunct]] void callInitsFunct() { deque *l(getInitFunctlist()); // [[getInitFunctlist]] sort(l->begin(),l->end(),comp); if(verbosity>5) cout << " callInitsFunct : " << l->size() << endl; for_each(l->begin(),l->end(),call); // [[call]] l->clear(); } // <> called by [[file:InitFunct.hpp::calling_addInitFunct]] void addInitFunct(int i,void (* f)(),const char *name) { if(!name || (! *name ) // [[ff_SetofInitFunct]] || ff_SetofInitFunct().insert(name).second ){ getInitFunctlist()->push_back(make_pair(i,f)); if(verbosity>9) cout << " -- addInitFunct: " << i << " " << f << " " << (name ? name : "" ) < #include #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" using namespace std; #include "rgraph.hpp" #include "RNM.hpp" #include "fem.hpp" #include "FESpacen.hpp" #include "FESpace.hpp" #include "MatriceCreuse_tpl.hpp" #include "MeshPoint.hpp" #include "Operator.hpp" #include "lex.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" #include #include #include using namespace Fem2D; class listMesh { public: list *lth; void init() { lth=new list;} void destroy() { delete lth;} listMesh(Stack s,Mesh const*th) : lth(Add2StackOfPtr2Free(s,new list)) { lth->push_back(th);} listMesh(Stack s,Mesh const*const tha,Mesh const* const thb) : lth(Add2StackOfPtr2Free(s,new list)) { lth->push_back(tha);lth->push_back(thb);} listMesh(Stack s,const listMesh &l,Mesh const*const th) : lth(Add2StackOfPtr2Free(s,new list(*l.lth))) { lth->push_back(th);} }; Mesh * GluMesh(listMesh const & lst) { int nbt=0; int neb=0; int nebx=0; int nbv=0; int nbvx=0; double hmin=1e100; R2 Pn(1e100,1e100),Px(-1e100,-1e100); const list lth(*lst.lth); const Mesh * th0=0; int kk=0; for(list::const_iterator i=lth.begin();i != lth.end();++i) { if(! *i ) continue; // ++kk; const Mesh &Th(**i); th0=&Th; if(verbosity>1) cout << " GluMesh + "<< Th.nv << " " << Th.nt << endl; nbt+= Th.nt; nbvx += Th.nv; nebx += Th.neb; for (int k=0;k2) cout << " - hmin =" << hmin << " , Bounding Box: " << Pn << " "<< Px << endl; Vertex * v= new Vertex[nbvx]; Triangle *t= new Triangle[nbt]; Triangle *tt=t; BoundaryEdge *b= new BoundaryEdge[nebx]; BoundaryEdge *bb= b; ffassert(hmin>Norme2(Pn-Px)/1e9); double hseuil =hmin/10.; FQuadTree *quadtree=new Fem2D::FQuadTree(th0,Pn,Px,0); { map,int> bbe; for(list::const_iterator i=lth.begin();i != lth.end();++i) { if(! *i ) continue; // const Mesh &Th(**i); if(!*i) continue; if(verbosity>1) cout << " GluMesh + "<< Th.nv << " " << Th.nt << endl; int nbv0 = nbv; for (int ii=0;iiToClose(vi,hseuil); if(!pvi) { v[nbv].x = vi.x; v[nbv].y = vi.y; v[nbv].lab = vi.lab; quadtree->Add(v[nbv++]); } } for (int k=0;kToClose(K[0],hseuil)-v; //NearestVertex(K[0])-v; int i1=quadtree->ToClose(K[1],hseuil)-v; //NearestVertex(K[1])-v; int i2=quadtree->ToClose(K[2],hseuil)-v; //NearestVertex(K[2])-v; (*tt++).set(v,i0,i1,i2,K.lab); } for (int k=0;kToClose(be[0],hseuil)-v; int i1=quadtree->ToClose(be[1],hseuil)-v; int ii0=i0,ii1=i1; if(ii1 i01(ii0,ii1); if( bbe.find(i01) == bbe.end()) { (*bb++).set(v,i0,i1,be.lab); bbe[i01]= neb++; } } } } delete quadtree; if(verbosity>1) { cout << " Nb points : "<< nbv << " , nb edges : " << neb << endl; cout << " Nb of glu point " << nbvx -nbv; cout << " Nb of glu Boundary edge " << nebx-neb; } { Mesh * m = new Mesh(nbv,nbt,neb,v,t,b); R2 Pn,Px; m->BoundingBox(Pn,Px); m->quadtree=new Fem2D::FQuadTree(m,Pn,Px,m->nv); // m->decrement(); return m; } } template struct Op2_addmesh: public binary_function { static RR f(Stack s,const AA & a,const BB & b) { return RR(s, a, b );} }; template struct Op2_setmesh: public binary_function { static RR f(Stack stack, const AA & a,const BB & b) { ffassert(a ); pmesh p=GluMesh(b); if(!INIT && *a) (**a).destroy() ; // Add2StackOfPtr2FreeRC(stack,p); // the pointer is use to set variable so no remove. return *a=p,a; } }; class SetMesh_Op : public E_F0mps { public: Expression a; static const int n_name_param =2+2+2+2+2; // add nbiter FH 30/01/2007 11 -> 12 static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; KN_ arg(int i,Stack stack,KN_ a ) const{ return nargs[i] ? GetAny >( (*nargs[i])(stack) ): a;} long arg(int i,Stack stack, long a ) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} bool arg(int i,Stack stack, bool a ) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} public: SetMesh_Op(const basicAC_F0 & args,Expression aa) : a(aa) { args.SetNameParam(n_name_param,name_param,nargs); if( nargs[0] && nargs[2] ) CompileError("uncompatible change (Th, label= , refe= "); if( nargs[1] && nargs[3] ) CompileError("uncompatible change (Th, region= , reft= "); } AnyType operator()(Stack stack) const ; }; basicAC_F0::name_and_type SetMesh_Op::name_param[]= { { "refe", &typeid(KN_ )}, { "reft", &typeid(KN_ )}, { "label", &typeid(KN_ )}, { "region", &typeid(KN_ )}, { "renumv",&typeid(KN_)}, { "renumt",&typeid(KN_)}, { "flabel", &typeid(long)}, { "fregion", &typeid(long)}, { "rmledges", &typeid(long)}, { "rmInternalEdges", &typeid(bool)} }; int ChangeLab(const map & m,int lab) { map::const_iterator i=m.find(lab); if(i != m.end()) lab=i->second; return lab; } AnyType SetMesh_Op::operator()(Stack stack) const { MeshPoint *mp=MeshPointStack(stack),smp=*mp; Mesh * pTh= GetAny((*a)(stack)); Mesh & Th=*pTh; Mesh *m= pTh; int nbv=Th.nv; // nombre de sommet int nbt=Th.nt; // nombre de triangles int neb=Th.neb; // nombre d'aretes fontiere KN zz; KN nre (arg(0,stack,arg(2,stack,zz))); KN nrt (arg(1,stack,arg(3,stack,zz))); KN rv (arg(4,stack,zz)); KN rt (arg(5,stack,zz)); Expression flab = nargs[6] ; Expression freg = nargs[7] ; bool rm_edge = nargs[8]; long rmlabedges (arg(8,stack,0L)); bool rm_i_edges = (arg(9,stack,false)); bool rV = (rv.size()== nbv); bool rT = (rt.size()== nbt); if(verbosity>1) cout << " -- SetMesh_Op: nb vertices" << nbv<< " nb Trai "<< nbt << " nb b. edges " << neb << "renum V " << rV << " , renum T "<< rT << " rm internal edges " << rm_i_edges<< endl; if(nre.N() <=0 && nrt.N()<=0 && !rV && ! rT && ! flab && ! freg && !rm_i_edges && !rm_edge ) return m; ffassert( nre.N() %2 ==0); ffassert( nrt.N() %2 ==0); map mape,mapt; int z00 = false; for(int i=0;ibedges[i].lab) ; nebn++; } Vertex * v= new Vertex[nbv]; Triangle *t= new Triangle[nbt]; BoundaryEdge *b= new BoundaryEdge[nebn]; // generation des nouveaux sommets Vertex *vv=v; // copie des anciens sommets (remarque il n'y a pas operateur de copy des sommets) for (int i=0;ix=V.x; vv->y=V.y; vv->lab = V.lab; } // generation des triangles int nberr=0; R2 PtHat(1./3.,1./3.); for (int i=0;iset(Th,Th[i](PtHat),PtHat,Th[i],Th[i].lab); t[ii].lab =GetAny( (* freg)(stack)) ; } } int nrmedge=0; // les arete frontieres qui n'ont pas change BoundaryEdge * bb=b; for (int i=0;ibedges[i].lab) ; mp->set(Th,Th[k](PtHat),PtHat,Th[k],l1); if(flab) { R2 E=K.Edge(ke); double le = sqrt((E,E)); double sa=0.5,sb=1-sa; R2 PA(TriangleHat[VerticesOfTriangularEdge[ke][0]]), PB(TriangleHat[VerticesOfTriangularEdge[ke][1]]); R2 Pt(PA*sa+PB*sb ); // // void set(const Mesh & aTh,const R2 &P2,const R2 & P_Hat,const Triangle & aK,int ll,const R2 &NN,int iedge,int VFF=0) MeshPointStack(stack)->set(Th,K(Pt),Pt,K,l1,R2(E.y,-E.x)/le,ke); l1 =GetAny( (*flab)(stack)) ; } if( !( intern && ( rm_i_edges || (rmlabedges && (l1 == rmlabedges)) ) )) *bb++ = BoundaryEdge(v,i1,i2,l1); else ++nrmedge; } nebn -= nrmedge; if(nrmedge && verbosity > 2) cout << " change mesh2 : number of removed internal edges " << nrmedge << endl; assert(nebn==bb-b); m = new Mesh(nbv,nbt,nebn,v,t,b); R2 Pn,Px; m->BoundingBox(Pn,Px); m->quadtree=new Fem2D::FQuadTree(m,Pn,Px,m->nv); // m->decrement(); Add2StackOfPtr2FreeRC(stack,m); *mp=smp; return m; } class SetMesh : public OneOperator { public: typedef Mesh const *pmesh; SetMesh() : OneOperator(atype(),atype() ) {} E_F0 * code(const basicAC_F0 & args) const { return new SetMesh_Op(args,t[0]->CastTo(args[0])); } }; // truc pour que la fonction // Init::Init() soit appele a moment du chargement dynamique // du fichier // #ifndef DYNAMICS_LIBS void init_glumesh2D() { Dcl_Type(); typedef Mesh const *pmesh; //Dcl_Type(); //typedef Mesh3 *pmesh3; if(verbosity>2) cout << " glumesh2D " ; //cout << " je suis dans Init " << endl; TheOperators->Add("+",new OneBinaryOperator_st< Op2_addmesh > ); TheOperators->Add("+",new OneBinaryOperator_st< Op2_addmesh > ); TheOperators->Add("=",new OneBinaryOperator_st< Op2_setmesh > ); TheOperators->Add("<-",new OneBinaryOperator_st< Op2_setmesh > ); Global.Add("change","(",new SetMesh); } #else class Init { public: Init(); }; static Init init; // une variable globale qui serat construite au chargement dynamique Init::Init(){ // le constructeur qui ajoute la fonction "splitmesh3" a freefem++ Dcl_Type(); typedef Mesh *pmesh; //Dcl_Type(); //typedef Mesh3 *pmesh3; if (verbosity) cout << " glumesh2D " ; //cout << " je suis dans Init " << endl; TheOperators->Add("+",new OneBinaryOperator_st< Op2_addmesh > ); TheOperators->Add("+",new OneBinaryOperator_st< Op2_addmesh > ); TheOperators->Add("=",new OneBinaryOperator_st< Op2_setmesh > ); TheOperators->Add("<-",new OneBinaryOperator_st< Op2_setmesh > ); Global.Add("change","(",new SetMesh); } #endif freefem++-3.61-1/src/fflib/environment.hpp000644 000767 000024 00000002405 13256636774 020552 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "config-wrapper.h" #include #include #include typedef std::list OneEnvironmentData; typedef std::map EnvironmentData; extern EnvironmentData ffenvironment; extern long verbosity; bool EnvironmentInsert(std::string key,std::string item,std::string before); void GetEnvironment(); void EnvironmentLoad(); freefem++-3.61-1/src/fflib/versionnumber.hpp000644 000767 000024 00000000034 13256636774 021100 0ustar00hechtstaff000000 000000 #include "config-wrapper.h" freefem++-3.61-1/src/fflib/showverb.hpp000644 000767 000024 00000002002 13256636774 020036 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef SHOWVERB #ifdef VERBOSE #define SHOWVERB(i) i #else #define SHOWVERB(i) ( (void)0) #endif #endif #define SHOWVERB1(i) i freefem++-3.61-1/src/fflib/lgmesh3.cpp000644 000767 000024 00000154054 13321622623 017530 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "ff++.hpp" #include "array_resize.hpp" #include "AFunction_ext.hpp" using Fem2D::Mesh; using Fem2D::MeshPoint; extern bool NoWait; typedef Mesh const * pmesh; typedef Mesh3 const * pmesh3; map,int>::iterator closeto(map,int> & m, pair & k) { map,int>::iterator it= m.end(); for (int i=-1;i<2;++i) for (int j=-1;j<2;++j) { pair kk(k.first+i,k.second+j);// bug corrigie april 2011 FH. tanks . J. Morice it= m.find(kk); if(it != m.end()) return it; } return it; } inline void Perm3_I2J(const int *I,const int*J,int *S) { if(I[0]==J[0]) S[0]=0; else if(I[0]==J[1]) S[0]=1; else {S[0]=2; assert(I[0]==J[2]) ;} if(I[1]==J[0]) S[1]=0; else if(I[1]==J[1]) S[1]=1; else {S[1]=2; assert(I[1]==J[2]) ; } S[2]=3-S[0]-S[1]; assert(I[2]==J[3-S[0]-S[1]]); } bool BuildPeriodic( int nbcperiodic , Expression *periodic, const Mesh3 &Th,Stack stack, KN & ndfe) { /* build numbering of vertex form 0 to nbdfv-1 and build numbering of edge form 0 to nbdfe-1 we removing common vextex or common edge -- we suppose one df by vertex nbdfv number of df on vertex ndfv[i] given the numero of the df of the vertex -- we suppose 1 df */ typedef Mesh3::BorderElement BE; //typedef Smallvect int2; if (nbcperiodic ) { // KN ndfv(Th.nv); // KN ndfe(Th.nbe); //ffassert(ndfv.N()==Th.nv); //ffassert(ndfe.N()==Th.nbe); MeshPoint *mp=MeshPointStack(stack),smp=*mp; int n= nbcperiodic; if (verbosity >2) cout << " Nb of pair of periodic conditions (3d) : = " << n << endl; int * link1=0; int * link2=0; KN plk1(n),plk2(n); KN nlk1(n),nlk2(n); KN lab1(n),lab2(n); #ifndef HUGE_VAL const double infty= numeric_limits::infinity(); #else const double infty= HUGE_VAL; #endif int nblink1, nblink2; int *plink1 , *plink2; for (int step=0;step<2;step++) { nblink1=0, nblink2=0; plink1=link1, plink2=link2; for (int ip=0, k=0;ip((*periodic[k+0])(stack)); int label2=GetAny((*periodic[k+3])(stack)); lab1[ip]=label1; lab2[ip]=label2; int l1=nblink1; int l2=nblink2; plk1[ip]= plink1; plk2[ip]= plink2; for (int ke=0;ke3) cout << " Periodic = " << nblink1 << " " << nblink2 << " step=" << step << endl; if(nblink1 != nblink2) ExecError("Periodic 3d: the both number of face is not the same "); ndfe.resize(nblink1*2); link1 = new int[nblink1]; link2 = new int[nblink2]; } if ( nblink1 >0) { int indfe=0; for (int ip=0, k=0;ip,int> m; const int kkx1=1,kky1=2,kkx2=4,kky2=5; int label1=lab1[ip],label2=lab2[ip]; int n1=nlk1[ip],n2=nlk2[ip]; int *pke1=plk1[ip], *pke2=plk2[ip]; //int oip=pke1-link1; typedef HashTable,int> HTable; typedef HTable::iterator HTiterator; HashTable,int> table1(n1,Th.nv); // Table of face lab 1 R2 P[3]; R2 Pmin(infty,infty),Pmax(-infty,-infty); double hmn=infty; int iface[3]; if (verbosity >1) cout << " --Update: periodic couple label1= " << label1 << ", n faces= " << n1 << "; " << ", label2= " << label2<< ", n faces= " << n2 <set(e[ee].x,e[ee].y,e[ee].z); P[ee].x=GetAny((*periodic[k+kkx1])(stack)); P[ee].y=GetAny((*periodic[k+kky1])(stack)); } HTiterator hte=table1.add(SortArray(iface),pke1[i1]); ffassert(hte-table1.begin() == i1); for(int ee=0,eo=2;ee<3;eo=ee++) { double l = (P[ee]-P[eo]).norme2(); Pmin=Minc(Pmin,P[ee]); Pmax=Maxc(Pmax,P[ee]); hmn=Min(hmn,l); } } } hmn=sqrt(hmn); ffassert(hmn>1.0e-20); double coef = 8/hmn; double x0 = Pmin.x; double y0 = Pmin.y; if (verbosity > 2) cout << " --Update: periodic " << Pmin << " " << Pmax << " " << " h=" << hmn << " , coef = "<< coef << " / " << (Pmax-Pmin).norme2()*coef*coef << endl; ffassert(coef>1e-10 && (Pmax-Pmin).norme2()*coef*coef < 1.e14 ); // correct FH mars 2013 // map construction ---- for (int i1=0;i1set(e[ne].x,e[ne].y,e[ne].z); double xx=GetAny((*periodic[k+kkx1])(stack)); double yy=GetAny((*periodic[k+kky1])(stack)); pair ij((int) ((xx-x0)*coef),(int) ((yy-y0)*coef)); map,int>::iterator im=closeto(m,ij); if (im==m.end()) { if (verbosity >50) cout << kv << " " << xx << " " << yy << " -> " << ij << " :: " << ie << endl; im=m.insert(pair,int>(ij,kv)).first; } else { if(im->second != kv) cout << kv << " == " << im->second << " " << xx << " " << yy << " -> " << ij << " == " << im->first << endl; ffassert( im->second == kv); } } } // find ... face of list 2 in list 1 .... int err=0; for (int i2=0;i250) cout << ie2 << " : " < I[3]; map,int>::iterator im; int i2to1[3]; for(int ee=0;ee<3;++ee) { mp->set(e[ee].x,e[ee].y,e[ee].z); P[ee].x=GetAny((*periodic[k+kkx2])(stack)); P[ee].y=GetAny((*periodic[k+kky2])(stack)); I[ee].first = int((P[ee].x-x0)*coef); I[ee].second= int((P[ee].y-y0)*coef); im=closeto(m,I[ee]); if(im == m.end() ) { cout << " vertex : " << Th(e[ee]) << " " <second; } //int ie1=-1; SortArray sf(i2to1); HTiterator ht=table1.find(sf); if( ! ht ) { err++; cerr << " missing face " << ie2 << " " << sf << endl; } else { int ie1 = ht->v; assert(ie1>=0 ); const BE & eo =Th.be(ie1); int fo[3]={Th(eo[0]),Th(eo[1]),Th(eo[2])}; int np1= NumPerm1<3>(fo); // number of int np2= NumPerm1<3>(i2to1); ndfe[indfe++]=ie1*8+np1; ndfe[indfe++]=ie2*8+np2; int p1[3],p2[3]; SetNumPerm<3>(np1,p1); SetNumPerm<3>(np2,p2); if(verbosity>50) cout <<" " << ie1 << " == " << ie2 << ": " << fo[p1[0]] << " " << fo[p1[1]] << " " << fo[p1[2]] << " == " << i2to1[p2[0]] << " " << i2to1[p2[1]] << " " << i2to1[p2[2]] << " e =" << Th(e[p2[0]]) << " " << Th(e[p2[1]]) << " " << Th(e[p2[2]]) << " " << " nu= " << np1 << " , " << np2 << endl; } } } if(err ) { cerr << " 3d periodic FE: number of missing periodic faces " << err << endl; ExecError(" 3d periodic condition missing common face "); } } *mp = smp; ffassert(indfe==ndfe.size()); /* rm FH : for (int i=0;i50) cout << " face " << ie1 << " <==> " << ie2 << endl; ffassert(ie1!=ie2); if(!InCircularList(ndfe,ie1,ie2)) // merge of two list Exchange(ndfe[ie1],ndfe[ie2]); int kv1[3],kv2[3]; // kv1 == kv2 (p) const BE & e1=Th.be(ie1), &e2=Th.be(ie2); for (int ee=0;ee<3;ee++) { kv1[ee] =Th(e1[ee]); kv2[ee] =Th(e2[ee]); } for (int ee=0;ee<3;ee++) { int iv1=kv1[ee]; int iv2=kv2[p[ee]]; // l'orientation de la face 2 / face 1 est dans p. if (!InCircularList(ndfv,iv1,iv2)) { // merge of two list Exchange(ndfv[iv2],ndfv[iv1]); if (verbosity >50) { int ii=iv1,l=1; while ( (ii=ndfv[ii]) != iv1 && l++<10) (void) 0; if( (verbosity >50) || ( l > 2 && verbosity >40)) cout << l << " vertex " << iv1 << "<==> " << iv2 << " list : " << iv1 << " " << Th(iv1) << " <=> " << Th(iv2); int i=iv1,k=0; while ( (i=ndfv[i]) != iv1 && k++<10) cout << ", "<< i ; cout << endl; }} } } // generation de numero de dlt nbdfv = numeroteclink(ndfv) ; nbdfe = numeroteclink(ndfe) ; if (verbosity>2) cout << " -- nb df on vertices " << nbdfv << endl; */ delete [] link1; delete [] link2; return true; //new FESpace(**ppTh,*tef,nbdfv,ndfv,nbdfe,ndfe); } else { delete [] link1; delete [] link2; } } return false; } bool v_fes3::buildperiodic(Stack stack, KN & ndfe) { return BuildPeriodic(nbcperiodic,periodic,**ppTh,stack,ndfe); } template class GlgVertex { public: typedef double R; typedef typename Mesh::Rd Rd; typedef typename Mesh::Vertex Vertex; CountPointer pTh; const Vertex *v; void Check() const { if (!v || !pTh) { ExecError("Too bad! Unset Vertex!"); } } void init() { v=0;pTh.init();} GlgVertex(const Mesh * Th,long kk): pTh(Th),v( &(*pTh)(kk)) {} GlgVertex(const Mesh * Th,const Vertex * kk): pTh(Th),v(kk) {} operator int() const { Check(); return (* pTh)(v);} operator Rd*(){ Check(); return v;} R x() const {Check() ; return v->X();} R y() const {Check() ; return v->Y();} R z() const {Check() ; return v->Z();} long lab() const {Check() ; return v->lab;} void destroy() {pTh.destroy();} }; template class GlgElement { public: typedef typename Mesh::Element Element; struct Adj {// const Mesh *pTh; const Element *k; Adj(const GlgElement & pp) : pTh(pp.pTh),k(pp.k) {} GlgElement adj(long & e) const { int ee,ko; ffassert(pTh && k && e >=0 && e < Element::nv ); long kk=pTh->ElementAdj(ko=(*pTh)(k),ee=e); if(ee>=0) e=ee;// ok adj exist else return GlgElement(pTh,ko);// return same .. return GlgElement(pTh,kk);} }; CountPointer pTh; const Element *k; GlgElement(): k(0) {} void Check() const { if (!k || !pTh) { ExecError("Unset Triangle,Sorry!"); } } void init() { k=0;pTh.init();} void destroy() {pTh.destroy();} GlgElement(const Mesh * Th,long kk): pTh(Th),k( &(*pTh)[kk]) {} GlgElement(const Mesh * Th,Element * kk): pTh(Th),k(kk) {} operator int() const { Check(); return (* pTh)(k);} GlgVertex operator [](const long & i) const { Check(); return GlgVertex(pTh,&(*k)[i]);} long lab() const {Check() ; return k ? k->lab : LONG_MIN;} double mes() const {Check() ; return k->mesure() ;} long n() const { return k ? Element::nv: 0 ;} bool operator==(const GlgElement & l) const { return pTh==l.pTh && k == l.k;} bool operator!=(const GlgElement & l) const { return pTh!=l.pTh || k != l.k;} bool operator<(const GlgElement & l) const { return pTh==l.pTh && k class GlgBoundaryElement { public: typedef typename Mesh::Element Element; typedef typename Mesh::BorderElement BorderElement; struct BE { const Mesh * p; BE(const Mesh *pp) : p(pp) {} BE(const Mesh **pp) : p(*pp) {} operator const Mesh * () const {return p;} }; CountPointer pTh; const BorderElement *k; GlgBoundaryElement(): k(0) {} void Check() const { if (!k || !pTh) { ExecError("Unset BoundaryEdge,Sorry!"); } } void init() { k=0;pTh.init();} void destroy() {pTh.destroy();} GlgBoundaryElement(const Mesh * Th,long kk): pTh(Th),k( &(*pTh).be(kk)) {} GlgBoundaryElement(const Mesh * Th,BoundaryEdge * kk): pTh(Th),k(kk) {} GlgBoundaryElement(const BE & be,long kk): pTh(be.p),k( &(*pTh).be(kk)) {} GlgBoundaryElement(const BE & be,BoundaryEdge * kk): pTh(be.p),k(kk) {} operator int() const { Check(); return (* pTh)(k);} GlgVertex operator [](const long & i) const { Check(); return GlgVertex(pTh,&(*k)[i]);} long lab() const {Check() ; return k ? k->lab : 0;} double length() const {Check() ; return k->length() ;} long n() const { return k ? BorderElement::nv : 0 ;} GlgElement element() const {Check() ;int ee; return GlgElement(pTh,(*pTh).BoundaryElement((*pTh)(k),ee));} long nuBoundaryElement() const {Check() ;int ee; (*pTh).BoundaryElement((*pTh)(k),ee);return ee;} }; GlgBoundaryElement get_element(GlgBoundaryElement::BE const & a, long const & n){ return GlgBoundaryElement(a,n);} GlgVertex get_element(GlgBoundaryElement const & a, long const & n){ return a[n];} GlgElement get_adj(GlgElement::Adj const & a, long * const & n){return a.adj(*n);} GlgElement get_element(pmesh3 const & a, long const & n) { return GlgElement(a,n);} GlgElement get_element(pmesh3 *const & a, long const & n) { return GlgElement(*a,n);} GlgVertex get_vertex(pmesh3 const & a, long const & n){ return GlgVertex(a,n);} GlgVertex get_vertex(pmesh3 *const & a, long const & n){ return GlgVertex(*a,n);} GlgVertex get_element(GlgElement const & a, long const & n) { return a[n];} GlgElement getElement(GlgBoundaryElement const & a) { return a.element();} long NuElement(GlgBoundaryElement const & a) { return a.nuBoundaryElement(); } R getx(GlgVertex const & a){ return a.x();} R gety(GlgVertex const & a){ return a.y();} R getz(GlgVertex const & a){ return a.z();} long getlab(GlgVertex const & a){ return a.lab();} long getlab(GlgElement const & a){ return a.lab();} long getlab(GlgBoundaryElement const & a){ return a.lab();} R getmes(GlgElement const & a){ return a.mes();} double pmesh_mes(pmesh3 * p) { ffassert(p && *p) ; return (**p).mes ;} double pmesh_mesb(pmesh3 * p) { ffassert(p && *p) ; return (**p).mesb;} long pmesh_nt(pmesh3 * p) { ffassert(p && *p) ; return (**p).nt ;} long pmesh_nv(pmesh3 * p) { ffassert(p && *p) ; return (**p).nv ;} long pmesh_nbe(pmesh3 * p) { ffassert(p && *p) ; return (**p).nbe ;} double pmesh_hmax(pmesh3 * p) { ffassert(p && *p) ; double hmax2 =0; const Mesh3 & Th = **p; for(int k=0; k< Th.nt; ++k) for(int e=0; e<6; ++e) hmax2=max(hmax2,Th[k].Edge(e).norme2()); return sqrt(hmax2);} double pmesh_hmin(pmesh3 * p) { throwassert(p && *p) ; double hmin2 =1e100; const Mesh3 & Th = **p; for(int k=0; k< Th.nt; ++k) for(int e=0; e<6; ++e) hmin2=min(hmin2,Th[k].Edge(e).norme2()); return sqrt(hmin2);} pf3rbase* get_element(pf3rbasearray *const & a, long const & n) { return (**a)[n]; } pf3r get_element(pf3rarray const & a, long const & n) { //cout << " ************ " << n << " " << a.second << endl; return pf3r( *(*a.first)[n],a.second); } // complex case pf3cbase* get_element(pf3cbasearray *const & a, long const & n) { return (**a)[n]; } pf3c get_element(pf3carray const & a, long const & n) { return pf3c( *(*a.first)[n],a.second); } // end complex case class MoveMesh3 : public E_F0mps { public: typedef pmesh Result; Expression getmesh; Expression U,V; int nbsol; vector sol; MoveMesh3(const basicAC_F0 & args) :nbsol(args.size()-2),sol(args.size()-2) { using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; // using Fem2D::R; using Fem2D::MeshPointStack; args.SetNameParam(); getmesh=to(args[0]); const E_Array * a = dynamic_cast(args[1].LeftValue()); ffassert(a); if (a->size() !=2) CompileError("movemesh(Th,[u,v],...) need 2 componate in array ",atype()); U=to( (*a)[0]); V=to( (*a)[1]); for (int i=2;i(args[i]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new MoveMesh3(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; class ReadMesh3 : public E_F0 { public: Expression filename; typedef pmesh3 Result; ReadMesh3(const basicAC_F0 & args) { args.SetNameParam(); filename=to(args[0]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype());} static E_F0 * f(const basicAC_F0 & args){ return new ReadMesh3(args);} AnyType operator()(Stack stack) const; }; AnyType ReadMesh3::operator()(Stack stack) const { using Fem2D::MeshPointStack; string * fn = GetAny((*filename)(stack)); if(verbosity > 2) cout << "ReadMesh3 " << *fn << endl; Mesh3 *Thh = new Mesh3(*fn); Thh->BuildGTree(); Add2StackOfPtr2FreeRC(stack,Thh); return SetAny(Thh);; } class SaveMesh3 : public E_F0 { public: typedef pmesh3 Result; Expression getmesh; Expression filename; Expression xx,yy,zz; SaveMesh3(const basicAC_F0 & args) { xx=0; yy=0; zz=0; args.SetNameParam(); getmesh=to(args[0]); filename=to(args[1]); if (args.size() >2) { const E_Array * a = dynamic_cast(args[2].LeftValue()); if (!a) CompileError("savemesh(Th,\"filename\",[u,v,w],..."); int k=a->size() ; // cout << k << endl; if ( k!=2 && k !=3) CompileError("savemesh(Th,\"filename\",[u,v,w]) need 2 or 3 componate in array ",atype()); xx=to( (*a)[0]); yy=to( (*a)[1]); if(k==3) zz=to( (*a)[2]); } } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new SaveMesh3(args);} AnyType operator()(Stack s) const ; }; AnyType SaveMesh3::operator()(Stack stack) const { using Fem2D::MeshPointStack; pmesh3 Thh = GetAny((*getmesh)(stack)); string * fn = GetAny((*filename)(stack)); if (verbosity > 2) cout << "SaveMesh3 " << *fn << " " << Thh << endl; int ret=Thh->Save(*fn); if( ret!=0) {ExecError("PB Write error !");} return SetAny(Thh); } class SaveSurfaceMesh3 : public E_F0 { public: typedef pmesh Result; Expression getmesh; Expression filename; Expression filename1; int pointsfaces; SaveSurfaceMesh3(const basicAC_F0 & args) { args.SetNameParam(); getmesh=to(args[0]); filename=to(args[1]); pointsfaces=0; if (args.size() >2) { if(BCastTo(args[2])){ pointsfaces=1; filename1=CastTo(args[2]); } else{ CompileError("savesurfmesh(Th,filename.points,filename.faces)"); } } } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),true);} static E_F0 * f(const basicAC_F0 & args){ return new SaveSurfaceMesh3(args);} AnyType operator()(Stack s) const ; }; AnyType SaveSurfaceMesh3::operator()(Stack stack) const { using Fem2D::MeshPointStack; pmesh3 Thh = GetAny((*getmesh)(stack)); string * fn = GetAny((*filename)(stack)); if( pointsfaces==0 ){ cout << "SaveSurfaceMesh3 " << *fn << " " << Thh << endl; Thh->SaveSurface(*fn); } else{ string * fn1 = GetAny((*filename1)(stack)); cout << "SaveSurfaceMesh3 " << *fn << " " << *fn1 << " " << Thh << endl; Thh->SaveSurface(*fn,*fn1); } return SetAny(Thh); } AnyType MoveMesh3::operator()(Stack stack) const { ffassert(0); /* using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; // using Fem2D::R; using Fem2D::MeshPointStack; MeshPoint *mp(MeshPointStack(stack)) , mps=*mp; Mesh * Thh = GetAny((*getmesh)(stack)); ffassert(Thh); long nbv=Thh->nv; long nbt=Thh->nt; KN u(nbv),v(nbv); double infini=DBL_MAX; u=infini; for (int it=0;itsetP(Thh,it,iv); u[i]=GetAny((*U)(stack)); v[i]=GetAny((*V)(stack)); } } Mesh * pth= MoveTheMesh(*Thh,u,v); if (pth) for (size_t i=0;i,int> * s = GetAny,int>*>( (*sol[i])(stack)); ffassert(s->first.Vh); ffassert( &s->first.Vh->Th == Thh); // same old mesh ffassert(0); // a faire ???? } *mp=mps; pth->decrement(); return SetAny(pth); */ } inline pmesh3 * initMesh(pmesh3 * const & p, string * const & s) { Mesh3 * m; if(verbosity > 2) cout << " initMesh " << *s << endl; *p= m =new Mesh3(*s); m->BuildGTree(); // delete s; modif mars 2006 auto del ptr return p; } /* class CheckMoveMesh : public E_F0mps { public: typedef double Result; Expression getmesh; Expression U,V; int nbsol; vector sol; CheckMoveMesh(const basicAC_F0 & args) :nbsol(args.size()-2),sol(args.size()-2) { using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; // using Fem2D::R; using Fem2D::MeshPointStack; args.SetNameParam(); getmesh=to(args[0]); const E_Array * a = dynamic_cast(args[1].LeftValue()); ffassert(a); if (a->size() !=2) CompileError("CheckMoveMesh(Th,[u,v]) need 2 componate in array ",atype()); U=to( (*a)[0]); V=to( (*a)[1]); for (int i=2;i(args[i]); } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),false);} static E_F0 * f(const basicAC_F0 & args){ return new CheckMoveMesh(args);} AnyType operator()(Stack s) const ; operator aType () const { return atype();} }; AnyType CheckMoveMesh::operator()(Stack stack) const { using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; // using Fem2D::R; using Fem2D::MeshPointStack; MeshPoint *mp(MeshPointStack(stack)) , mps=*mp; Mesh * Thh = GetAny((*getmesh)(stack)); Mesh & Th(*Thh); ffassert(Thh); long nbv=Thh->nv; long nbt=Thh->nt; KN u(nbv),v(nbv); double infini=DBL_MAX; u=infini; for (int it=0;itsetP(Thh,it,iv); u[i]=GetAny((*U)(stack)); v[i]=GetAny((*V)(stack)); } } double minarea=DBL_MAX; for (int t=0;t(minarea/2.); } */ template AnyType set_fe3 (Stack s,Expression ppfe, Expression e) { typedef v_fes3 v_fes; typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; long kkff = Mesh::kfind, kkth = Mesh::kthrough; StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); MeshPoint *mps=MeshPointStack(s),mp=*mps; pair *,int> pp=GetAny *,int> >((*ppfe)(s)); FEbase & fe(*pp.first); const FESpace & Vh(*fe.newVh()); KN gg(Vh.MaximalNbOfDF()); const Mesh & Th(Vh.Th); // R F[100]; // buffer TabFuncArg tabexp(s,Vh.N); tabexp[0]=e; if(Vh.N!=1) { cerr << " Try to set a vectorial FE function (nb componant=" << Vh.N << ") with one scalar " << endl; ExecError(" Error interploation (set) FE function (vectorial) with a scalar"); } KN * y=new KN(Vh.NbOfDF); KN & yy(*y); // interpoler int npPh = Vh.maxNbPtforInterpolation; KNM Vp(npPh,1); KN Vdf(Vh.MaxNbDFPerElement); const E_F0 & ff(* (const E_F0 *) e ) ; // cout << "Vh.isFEMesh() :" <=0); mps->setP(&Th,ik,il); yy[iv] = GetAny( ff(s) ); sptr->clean(); // modif FH mars 2006 clean Ptr } } else { InterpolationMatrix ipmat(Vh); for (int t=0;tset(K.T(PtHat),PtHat,K); Vp[p]=GetAny( ff(s) ); } K.Pi_h(Vp,Vdf,ipmat); // cout << "Vp::: " << Vp << " " << Vdf << endl; for (int df=0;dfclean(); // modif FH mars 2006 clean Ptr } } *mps=mp; fe=y; kkff = Mesh::kfind - kkff; kkth = Mesh::kthrough -kkth; if(verbosity>1) ShowBound(*y,cout) << " " << kkth << "/" << kkff << " = " << double(kkth)/Max(1.,kkff) << endl; return SetAny*>(&fe); } template E_set_fev3::E_set_fev3(const E_Array * a,Expression pp) :aa(*a),ppfe(pp),optimize(true), where_in_stack_opt(),optiexp0(),optiexpK() { aa.map(to) ; bool kdump=false; if(optimize) { // new code Optimized ------- int n=aa.size(); deque > ll; MapOfE_F0 m; where_in_stack_opt.resize(n); size_t top = currentblock->OffSet(0), topbb=top; // FH. bofbof ??? for (int i=0; iOptimize(ll, m, top); if (kdump) cout << "\n\t\t"<< i << ": " << where_in_stack_opt[i] << endl; } currentblock->OffSet(top-topbb); // int k=ll.size(),k0=0,k1=0; for (int i=0;iMeshIndependent()) k0++; deque > l0(k0),l1(k-k0); k0=0,k1=0; for (int i=0;iMeshIndependent()) { if (kdump) cout << " mi " << ll[i].second << " " << *(ll[i].first) << endl; l0[k0++]=ll[i]; } else { if (kdump) cout << " md " << ll[i].second << " " << *(ll[i].first) << endl; l1[k1++]=ll[i]; } if (k0) optiexp0 = new E_F0_Optimize(l0,m,0); // constant part if (k1) optiexpK = new E_F0_Optimize(l1,m,0); // none constant part } } template AnyType E_set_fev3::operator()(Stack s) const { StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); MeshPoint *mps=MeshPointStack(s), mp=*mps; FEbase ** pp=GetAny< FEbase **>((*ppfe)(s)); FEbase & fe(**pp); const FESpace & Vh(*fe.newVh()); // KN gg(Vh.MaximalNbOfDF()); const Mesh & Th(Vh.Th); const int dim=Vh.N; K ** copt=0; if (optimize) copt= new K *[dim]; if(copt) { assert((size_t) dim== where_in_stack_opt.size()); for (int i=0;i10); copt[i]= static_cast(static_cast((char*)s+offset)); *(copt[i])=0; } if (optiexp0) (*optiexp0)(s); // init } ffassert(dim<100); // R F[100]; // buffer TabFuncArg tabexp(s,Vh.N); // const E_Array * aa = dynamic_cast(e); ffassert( aa.size() == Vh.N); for (int i=0;i * y=new KN(Vh.NbOfDF); KN & yy(*y); int npPh = Vh.maxNbPtforInterpolation; KNM Vp(npPh,dim); KN Vdf(Vh.MaxNbDFPerElement); if (Vh.isFEMesh() ) { // crrect bug 29/08/2011 (thanks to rychet@fzu.cz) // remove wrong bulid of KHat (memory out of bound) ffassert(Vh.NbOfDF == Th.nv && dim == 1 ); for (int iv=0;iv=0); mps->set(Th,v,RdHat::KHat[il],Kv,v.lab); if (copt) { if (optiexpK) (*optiexpK)(s); yy[iv] = *(copt[0]); } else yy[iv] = GetAny( ff(s) ); sptr->clean(); // modif FH mars 2006 clean Ptr } } else { InterpolationMatrix ipmat(Vh); for (int t=0;tset(Kt.T(PtHat),PtHat,Kt); if (copt) { // optimize version if (optiexpK) (*optiexpK)(s); for (int j=0;j( (*tabexp[j])(s) ); else Vp(p,j)=0; } Kt.Pi_h(Vp,Vdf,ipmat); // cout << "Vp --- "<< Vp << " Vdf;; " << Vdf[0] << endl; for (int df=0;dfclean(); // modif FH mars 2006 clean Ptr } } fe=y; if (copt) delete [] copt; *MeshPointStack(s) = mp; if(verbosity>1) ShowBound(*y,cout) << endl ; return Nothing; } template inline FEbase * MakePtrFE3_(pfes3 * const & a){ FEbase * p=new FEbase(a); return p ;} template inline FEbase ** MakePtrFE3_2(FEbase * * const & p,pfes3 * const & a){ *p=new FEbase(a); return p ;} template inline FEbaseArray ** MakePtrFE3_3(FEbaseArray * * const & p,pfes3 * const & a,const long & N){ *p=new FEbaseArray(a,N); return p ;} template class OneOperatorMakePtrFE3 : public OneOperator { public: typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; // il faut Optimize // typedef double K; typedef FEbase ** R; typedef pfes* B; class CODE : public E_F0mps { public: Expression fer,fes; E_set_fev3 * e_set_fev3; const E_Array * v; CODE(const basicAC_F0 & args) : fer(to(args[0])), fes(to(args[1])), e_set_fev3(0) { if (BCastTo(args[2]) ) v = new E_Array(basicAC_F0_wa(to(args[2]))); else v = dynamic_cast( args[2].LeftValue() ); if (!v) { cout << "Error: type of arg :" << *args[2].left() << " in " << typeid(K).name() << " case " << endl; ErrorCompile(" We wait a double/complex expression or a array expression",1); } e_set_fev3= new E_set_fev3(v,fer); } AnyType operator()(Stack stack) const { R p = GetAny( (*fer)(stack)); B a = GetAny( (*fes)(stack)); *p=new FEbase(a); (*e_set_fev3)(stack); return SetAny(p); } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new CODE(args);} OneOperatorMakePtrFE3(aType tt): // tt= aType() or aType() OneOperator(map_type[typeid(R).name()],map_type[typeid(R).name()],map_type[typeid(B).name()],tt) {} }; /* template KN * pf3r2vect( pair *,int> p) { KN * x=p.first->x(); if ( !x) { // defined FESpace3 * Vh= p.first->newVh(); throwassert( Vh); *p.first = x = new KN(Vh->NbOfDF); *x=K(); } return x;} */ template long pf3r_nbdf(pair *,int> p) { if (!p.first->Vh) p.first->Vh= p.first->newVh(); throwassert( !!p.first->Vh); return p.first->Vh->NbOfDF; } template pmesh3 pf3r_Th(pair *,int> p) { if (!p.first->Vh) p.first->Vh= p.first->newVh(); throwassert( !!p.first->Vh); return & p.first->Vh->Th; } long pVh3_ndof(pfes3 * p) { throwassert(p && *p); FESpace3 *fes=**p; ; return fes->NbOfDF ;} long pVh3_nt(pfes3 * p) { throwassert(p && *p); FESpace3 *fes=**p; ; return fes->NbOfElements ;} long pVh3_ndofK(pfes3 * p) { throwassert(p && *p); FESpace3 *fes=**p; return (*fes)[0].NbDoF() ;} pmesh3 pVh3_Th(pfes3 * p) { throwassert(p && *p); FESpace3 *fes=**p; ; return &fes->Th ;} template AnyType pf3r2R(Stack s,const AnyType &a) { typedef typename v_fes::pfes pfes; typedef typename v_fes::FESpace FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::FElement FElement; typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::RdHat RdHat; typedef typename Mesh::Rd Rd; pair< FEbase * ,int> ppfe=GetAny *,int> >(a); FEbase & fe( *ppfe.first); int componante=ppfe.second; // cout << "+++++++++++ " << componante <(0.0); } } const FESpace & Vh(*fe.Vh); const Mesh & Th(Vh.Th); MeshPoint & mp = *MeshPointStack(s); const Element *K; RdHat PHat; bool outside=false; bool qnu=true; if ( mp.Th3 && mp.Th3->elements == Th.elements && mp.T) { qnu=false; K=mp.T3; PHat=mp.PHat; } else if ( mp.other.Th3 && (mp.other.Th3->elements == Th.elements) && (mp.other.P.x == mp.P.x) && (mp.other.P.y == mp.P.y) && (mp.other.P.z == mp.P.z) ) { K=mp.other.T3; PHat=mp.other.PHat; outside = mp.other.outside; } else { if (mp.isUnset()) ExecError("Try to get unset x,y, ..."); K=Th.Find(mp.P,PHat,outside); mp.other.set(Th,mp.P,PHat,*K,0,outside); } if(verbosity>1000) { if(outside) cout << " --- " << qnu << " " << mp.P << " out=" << mp.outside << " out=" << outside << " K= " << K << " " << PHat << endl; else cout << " --- " << qnu << " P= " << mp.P << " out=" << mp.outside << " out=" << outside << " K(PHat) == P = " << (*K)(PHat) << " PHat = " << PHat << endl; } const FElement KK(Vh[Th(K)]); if (outside && KK.tfe->discontinue) { if(verbosity>=10000) cout << " outside f() = 0. " << KK.tfe->discontinue << "\n"; return SetAny(0.0); } #ifndef NDEBUG if (!outside) { if ( Norme2_2( (*K)(PHat) - mp.P ) > 1e-12 ) cout << "bug ?? " << Norme2_2( (*K)(PHat) - mp.P ) << " " << mp.P << " " << (*K)(PHat) << endl; } #endif /* int nbdf=KK.NbDoF(); int N= KK.N; KN_ U(*fe.x()); KNMK fb(nbdf,N,3); // the value for basic fonction KN fk(nbdf); for (int i=0;i 0.05 && Norme2_2(mp.P) < 0.4*0.4 ) { int vv=verbosity; cout << " f() triangle " << Th(K) << " " << mp.P << " " << PHat << " = " << r << " " < * x=p.first->x(); if ( !x) { // defined FESpace * Vh= p.first->newVh(); throwassert( Vh); *p.first = x = new KN(Vh->NbOfDF); *x=K(); } return x;} // add 19 jan 2009 FH class pVh3_ndf : public ternary_function { public: class Op : public E_F0mps { public: Expression a,b,c; Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} AnyType operator()(Stack s) const { pfes3 * p(GetAny((*a)(s))); long k(GetAny((*b)(s))); long i(GetAny((*c)(s))); throwassert(p && *p); FESpace3 *fes=**p; throwassert(fes && k >=0 && k < fes->NbOfElements ); FESpace3::FElement K=(*fes)[k]; throwassert(i>=0 && i { public: class Op : public E_F0mps { public: Expression a,b,c,d; Op(Expression aa,Expression bb,Expression cc,Expression dd) : a(aa),b(bb),c(cc),d(dd) {} AnyType operator()(Stack s) const { R xx(GetAny((*b)(s))); R yy(GetAny((*c)(s))); R zz(GetAny((*d)(s))); pmesh3 *ppTh(GetAny((*a)(s))); if( !ppTh || !*ppTh) ExecError("Op3_Mesh32mp unset mesh ??"); pmesh3 pTh(*ppTh); MeshPoint * mp = new MeshPoint(); mp->set(xx,yy,zz); R3 PHat; bool outside; const Tet * K=pTh->Find(mp->P,PHat,outside); int n=(*pTh)(K); if(verbosity>200) cout << " n Tet = " << n << " " << K << " " << mp->P << endl; mp->set(*pTh,mp->P,PHat,*K,0,outside); return mp;} }; }; // FH // add Feb. 2010 FH template inline AnyType DestroyKN(Stack,const AnyType &x){ KN * a=GetAny*>(x); for (int i=0;iN(); i++) (*a)[i]->destroy(); a->destroy(); return Nothing; } template RR * get_elementp_(const A & a,const B & b){ if( b<0 || a->N() <= b) { cerr << " Out of bound 0 <=" << b << " < " << a->N() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator []");} return &((*a)[b]);} template R * set_initinit( R* const & a,const long & n){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << n << endl); a->init(n); for (int i=0;i *>(0,::DestroyKN ); atype* >()->Add("[","",new OneOperator2_*,long >(get_elementp_*,long>)); TheOperators->Add("<-", new OneOperator2_ *,KN *,long>(&set_initinit)); map_type_of_map[make_pair(atype(),atype())]=atype*>(); // vector Dcl_Type< Resize > > (); Add*>("resize",".",new OneOperator1< Resize >,KN*>(to_Resize)); Add > >("(","",new OneOperator2_ *,Resize > , long >(resizeandclean1)); } void init_lgmesh3() { if(verbosity&&(mpirank==0)) cout <<"lg_mesh3 "; // Global.Add("buildmesh","(",new OneOperatorCode); // Global.Add("buildmesh","(",new OneOperatorCode); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); Add("[]",".",new OneOperator1 *,pf3r>(pf3r2vect)); Add("[]",".",new OneOperator1 *,pf3c>(pf3r2vect)); Add("(","",new OneQuadOperator,Op4_pf32K::Op> ); Add("(","",new OneQuadOperator,Op4_pf32K::Op> ); Add("(","",new OneQuadOperator,Op4_K2R::Op> ); // Add("(","",new OneTernaryOperator,Op3_K2R::Op> ); // FH stupide Add("(","",new OneQuadOperator,Op4_K2R::Op> ); Add("(","",new OneQuadOperator ); TheOperators->Add("<-", new OneOperator2_(&initMesh)); // use for : mesh Th = readmesh ( ...); TheOperators->Add("<-", new OneOperator2_(&set_copy_incr)); TheOperators->Add("=", new OneOperator2(&set_eqdestroy_incr) ); Global.Add("readmesh3","(",new OneOperatorCode); Global.Add("savemesh","(",new OneOperatorCode); Global.Add("savesurfacemesh","(",new OneOperatorCode); Dcl_Type >(); Dcl_Type >( ); Dcl_Type::Adj>( ); Dcl_Type::BE >( ); Dcl_Type >( ); atype()->AddCast( new E_F1_funcT >(Cast >), new E_F1_funcT >(Cast >), new E_F1_funcT >(Cast >) ); Add("[","",new OneOperator2_,pmesh3,long>(get_element)); Add("[","",new OneOperator2_,pmesh3*,long>(get_element)); Add("(","",new OneOperator2_,pmesh3,long>(get_vertex)); Add("(","",new OneOperator2_,pmesh3*,long>(get_vertex)); Add("be",".",new OneOperator1_::BE,pmesh3*>(Build)); Add >("adj",".",new OneOperator1_::Adj,GlgElement >(Build)); Add::BE>("(","",new OneOperator2_,GlgBoundaryElement::BE,long>(get_element)); Add::Adj>("(","",new OneOperator2_,GlgElement::Adj,long*>(get_adj)); TheOperators->Add("==", new OneBinaryOperator,GlgElement > >); TheOperators->Add("!=", new OneBinaryOperator,GlgElement > >); TheOperators->Add("<", new OneBinaryOperator,GlgElement > >); TheOperators->Add("<=", new OneBinaryOperator,GlgElement > >); Add >("label",".",new OneOperator1_ >(getlab)); Add >("Element",".",new OneOperator1_ ,GlgBoundaryElement >(getElement)); Add >("whoinElement",".",new OneOperator1_ >(NuElement)); Add >("[","",new OneOperator2_ ,GlgElement ,long>(get_element)); Add >("[","",new OneOperator2_,GlgBoundaryElement,long>(get_element)); Add >("x",".",new OneOperator1_ >(getx)); Add >("y",".",new OneOperator1_ >(gety)); Add >("z",".",new OneOperator1_ >(getz)); Add >("label",".",new OneOperator1_ >(getlab)); Add >("label",".",new OneOperator1_ >(getlab)); Add >("region",".",new OneOperator1_ >(getlab)); Add >("mesure",".",new OneOperator1_ >(getmes)); Add >("measure",".",new OneOperator1_ >(getmes)); Add("mesure",".",new OneOperator1(pmesh_mes)); Add("measure",".",new OneOperator1(pmesh_mes)); Add("bordermesure",".",new OneOperator1(pmesh_mesb)); Add("bordermeasure",".",new OneOperator1(pmesh_mesb)); Add("nt",".",new OneOperator1(pmesh_nt)); Add("nv",".",new OneOperator1(pmesh_nv)); Add("nbe",".",new OneOperator1(pmesh_nbe)); Add("hmax",".",new OneOperator1(pmesh_hmax)); Add("hmin",".",new OneOperator1(pmesh_hmin)); TheOperators->Add("<-", new OneOperator2_(MakePtrFE3_2), new OneOperator3_(MakePtrFE3_3), new OneOperator2_(MakePtrFE3_2), new OneOperator3_(MakePtrFE3_3) //, // new OneOperator2_(MakePtr) ); TheOperators->Add("<-", new OneOperatorMakePtrFE3(atype()), // scalar case new OneOperatorMakePtrFE3(atype()), // vect case new OneOperatorMakePtrFE3(atype()), // scalar complex case new OneOperatorMakePtrFE3(atype()) // vect complex case ); TheOperators->Add("<-", new OneOperator2_(&set_copy_incr)); TheOperators->Add("=", new OneOperator2(&set_eqdestroy_incr) ); TheOperators->Add("=", new OneOperator2_ >(set_fe3) , new OneOperator2_ >(set_fe3) ) ; map_type[typeid(double).name()]->AddCast( new E_F1_funcT(pf3r2R) ); map_type[typeid(Complex).name()]->AddCast( new E_F1_funcT(pf3r2R) ); Global.Add("dz","(",new OneOperatorCode >); Global.Add("dxz","(",new OneOperatorCode >); Global.Add("dyz","(",new OneOperatorCode >); Global.Add("dzx","(",new OneOperatorCode >); Global.Add("dzx","(",new OneOperatorCode >); Global.Add("dzz","(",new OneOperatorCode >); Global.Add("dz","(",new OneOperatorCode >); Global.Add("dxz","(",new OneOperatorCode >); Global.Add("dyz","(",new OneOperatorCode >); Global.Add("dzx","(",new OneOperatorCode >); Global.Add("dzx","(",new OneOperatorCode >); Global.Add("dzz","(",new OneOperatorCode >); // bof Global.Add("dx","(",new E_F1_funcT(pf3r2R)); Global.Add("dy","(",new E_F1_funcT(pf3r2R)); Global.Add("dz","(",new E_F1_funcT(pf3r2R)); Global.Add("dxx","(",new E_F1_funcT(pf3r2R)); Global.Add("dyy","(",new E_F1_funcT(pf3r2R)); Global.Add("dxy","(",new E_F1_funcT(pf3r2R)); Global.Add("dyx","(",new E_F1_funcT(pf3r2R)); Global.Add("dzx","(",new E_F1_funcT(pf3r2R)); Global.Add("dzy","(",new E_F1_funcT(pf3r2R)); Global.Add("dzz","(",new E_F1_funcT(pf3r2R)); Global.Add("dxz","(",new E_F1_funcT(pf3r2R)); Global.Add("dyz","(",new E_F1_funcT(pf3r2R)); Global.Add("dx","(",new E_F1_funcT(pf3r2R)); Global.Add("dy","(",new E_F1_funcT(pf3r2R)); Global.Add("dz","(",new E_F1_funcT(pf3r2R)); Global.Add("dxx","(",new E_F1_funcT(pf3r2R)); Global.Add("dyy","(",new E_F1_funcT(pf3r2R)); Global.Add("dxy","(",new E_F1_funcT(pf3r2R)); Global.Add("dyx","(",new E_F1_funcT(pf3r2R)); Global.Add("dzx","(",new E_F1_funcT(pf3r2R)); Global.Add("dzy","(",new E_F1_funcT(pf3r2R)); Global.Add("dzz","(",new E_F1_funcT(pf3r2R)); Global.Add("dxz","(",new E_F1_funcT(pf3r2R)); Global.Add("dyz","(",new E_F1_funcT(pf3r2R)); Global.Add("int3d","(",new OneOperatorCode); Global.Add("int2d","(",new OneOperatorCode); Global.Add("intallfaces","(",new OneOperatorCode); /*decommente par J. Morice 14/01/09*/ Add("n",".",new OneOperator1(pf3r_nbdf)); Add("n",".",new OneOperator1(pf3r_nbdf)); Add("Th",".",new OneOperator1(pf3r_Th)); Add("Th",".",new OneOperator1(pf3r_Th)); Add("ndof",".",new OneOperator1(pVh3_ndof)); Add("nt",".",new OneOperator1(pVh3_nt)); Add("ndofK",".",new OneOperator1(pVh3_ndofK)); Add("Th",".",new OneOperator1(pVh3_Th)); //Add("[","",new OneOperator2_(get_element)); //Add("[","",new OneOperator2_(get_element)); //Add("[","",new OneOperator2_(get_element)); // 3d new code Add("[","",new OneOperator2_(get_element)); // use ???? FH sep. 2009 Add("[","",new OneOperator2_(get_element)); // use ???? FH sep. 2009 Add("[","",new OneOperator2_FE_get_elmnt());// new version FH sep 2009 Add("[","",new OneOperator2_FE_get_elmnt()); Add("(","", new OneTernaryOperator ); init_mesh3_array(); } //#include "InitFunct.hpp" //static addingInitFunct TheaddingInitFunct(-10,init_lgmesh3); template E_set_fev3::E_set_fev3(const E_Array * a,Expression pp) ; template E_set_fev3::E_set_fev3(const E_Array * a,Expression pp) ; freefem++-3.61-1/src/fflib/lgfem.cpp000644 000767 000024 00000655557 13312446271 017301 0ustar00hechtstaff000000 000000 /// \file // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifdef __MWERKS__ #pragma optimization_level 0 //#pragma inline_depth(0) #endif #include #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include #include "fem.hpp" #include "Mesh3dn.hpp" #include "MatriceCreuse_tpl.hpp" #include "MeshPoint.hpp" #include #include "Operator.hpp" #include #include #include #include "lex.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" #include "CGNL.hpp" #include "AddNewFE.h" #include "array_resize.hpp" #include "PlotStream.hpp" // add for the gestion of the endianness of the file. //PlotStream::fBytes PlotStream::zott; //0123; //PlotStream::hBytes PlotStream::zottffss; //012345678; // ---- FH namespace bamg { class Triangles; } namespace Fem2D { void DrawIsoT(const R2 Pt[3],const R ff[3],const RN_ & Viso); extern GTypeOfFE &P1bLagrange3d; extern GTypeOfFE &RT03d; extern GTypeOfFE &Edge03d; void Expandsetoflab(Stack stack,const CDomainOfIntegration & di,set & setoflab,bool &all); } #include "BamgFreeFem.hpp" static bool TheWait=false; bool NoWait=false; extern bool NoGraphicWindow; extern long verbosity; extern FILE *ThePlotStream; // Add for new plot. FH oct 2008 void init_lgmesh() ; namespace FreeFempp { template TypeVarForm * TypeVarForm::Global; } const int nTypeSolveMat=10; int kTypeSolveMat; TypeSolveMat *dTypeSolveMat[nTypeSolveMat]; AnyType Long2TypeSolveMat(Stack, const AnyType &ll) { long l=GetAny(ll); ffassert( l>=0 && l (tt); for(long l=0; l * )}, LIST_NAME_PARM_MAT /* { "init", &typeid(bool)}, { "solver", &typeid(TypeSolveMat*)}, { "eps", &typeid(double) } , { "precon",&typeid(Polymorphic*)}, { "dimKrylov",&typeid(long)}, { "bmat",&typeid(Matrice_Creuse* )}, { "tgv",&typeid(double )}, { "factorize",&typeid(bool)}, { "strategy",&typeid(long )}, { "tolpivot", &typeid(double)}, { "tolpivotsym", &typeid(double) }, { "nbiter", &typeid(long)}, // 12 { "paramint",&typeid(KN_)}, // Add J. Morice 02/09 { "paramdouble",&typeid(KN_)}, { "paramstring",&typeid(string*)}, { "permrow",&typeid(KN_)}, { "permcol",&typeid(KN_)}, { "fileparamint",&typeid(string*)}, // Add J. Morice 02/09 { "fileparamdouble",&typeid(string*)}, { "fileparamstring",&typeid(string* )}, { "filepermrow",&typeid(string*)}, { "filepermcol",&typeid(string*)} //22 */ }; basicAC_F0::name_and_type OpCall_FormLinear_np::name_param[]= { "tgv",&typeid(double ) }; /* template class E_F_F0F0F0 :public E_F0 { public: template struct remove_reference {typedef T type;}; template struct remove_reference {typedef T type;}; typedef typename remove_reference::type A0; typedef typename remove_reference::type A1; typedef typename remove_reference::type A2; typedef R (*func)( A0 , A1, A2 ) ; func f; Expression a0,a1,a2; E_F_F0F0F0(func ff,Expression aa0,Expression aa1,Expression aa2) : f(ff),a0(aa0),a1(aa1),a2(aa2) {} AnyType operator()(Stack s) const {return SetAny( f( GetAny((*a0)(s)) , GetAny((*a1)(s)), GetAny((*a2)(s)) ) );} bool EvaluableWithOutStack() const {return a0->EvaluableWithOutStack() && a1->EvaluableWithOutStack() && a2->EvaluableWithOutStack() ;} // bool MeshIndependent() const {return a0->MeshIndependent() && a1->MeshIndependent() && a2->MeshIndependent();} // int compare (const E_F0 *t) const { int rr; // cout << "cmp " << typeid(*this).name() << " and " << typeid(t).name() << endl; const E_F_F0F0F0* tt=dynamic_cast(t); if (tt && f == tt->f) rr= clexico(a0->compare(tt->a0),a1->compare(tt->a1),a2->compare(tt->a2)); else rr = E_F0::compare(t); return rr; } // to give a order in instuction int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const { int rr = find(m); if (rr) return rr; return insert(new Opt(*this,a0->Optimize(l,m,n),a1->Optimize(l,m,n),a2->Optimize(l,m,n)),l,m,n); } // build optimisation class Opt: public E_F_F0F0F0 { public : size_t ia,ib,ic; Opt(const E_F_F0F0F0 &t,size_t iaa,size_t ibb,size_t icc) : E_F_F0F0F0(t) , ia(iaa),ib(ibb),ic(icc) {} AnyType operator()(Stack s) const { //A0 aa =*static_cast(static_cast(static_cast(s)+ia)); //A1 bb=*static_cast(static_cast(static_cast(s)+ib)) ; //cout << ia << " " << ib << "f( " << aa << "," << bb << " ) = "<< f(aa,bb) << endl; return SetAny( f( *static_cast(static_cast(static_cast(s)+ia)) , *static_cast(static_cast(static_cast(s)+ib)) , *static_cast(static_cast(static_cast(s)+ic)) ) );} }; }; template > class OneOperator3 : public OneOperator { aType r; // return type typedef typename CODE::func func; //typedef R (*func)(A,B) ; func f; public: E_F0 * code(const basicAC_F0 & args) const { return new CODE(f,t[0]->CastTo(args[0]),t[1]->CastTo(args[1]),t[2]->CastTo(args[3]));} OneOperator3(func ff): OneOperator(map_type[typeid(R).name()],map_type[typeid(A).name()],map_type[typeid(B).name()],map_type[typeid(C).name()]), f(ff){} }; */ const E_Array * Array(const C_F0 & a) { if (a.left() == atype() ) return dynamic_cast(a.LeftValue()); else return 0; } bool Box2(const C_F0 & bb, Expression * box) { const E_Array * a= Array(bb); if(a && a->size() == 2) { box[0] = to((*a)[0]); box[1] = to((*a)[1]); return true; } else return false; } bool Box2x2(Expression bb, Expression * box) { const E_Array * a= dynamic_cast(bb); if(a && a->size() == 2) return Box2((*a)[0],box) && Box2((*a)[1],box+2) ; else return false; } void dump_table() { cout << " dump the table of the language " << endl; cout << " ------------------------------ " <::const_iterator i; ; for (i= map_type.begin();i !=map_type.end();i++) { cout << " type : " << i->first << endl; if( i->second ) i->second->ShowTable(cout); else cout << " Null \n"; cout << "\n\n"; } for (i= map_type.begin();i !=map_type.end();i++) { cout << " type : " << i->first << endl; if( i->second ) i->second->ShowTable(cout); else cout << " Null \n"; cout << "\n\n"; } cout << "--------------------- " << endl; cout << *TheOperators << endl; cout << "--------------------- " << endl; } /* class LocalArrayVariable:public E_F0 { size_t offset; aType t; // type of the variable just for check Expression n; // expression of the size public: AnyType operator()(Stack s) const { SHOWVERB( cout << "\n\tget var " << offset << " " << t->name() << endl); return PtrtoAny(static_cast(static_cast(s)+offset),t);} LocalArrayVariable(size_t o,aType tt,Expression nn):offset(o),t(tt),n(nn) {ffassert(tt); SHOWVERB(cout << "\n--------new var " << offset << " " << t->name() << endl); } }; */ bool In(long *viso,int n,long v) { int i=0,j=n,k; if (v viso[j-1]) return false; while (i v) j=k; else i=k; return (viso[i]=v); } class LinkToInterpreter { public: Type_Expr P,N,x,y,z,label,region,nu_triangle,nu_edge,lenEdge,hTriangle,area,inside,volume; LinkToInterpreter() ; }; LinkToInterpreter * l2interpreter; using namespace Fem2D; using namespace EF23; /* inline pmesh ReadMesh( string * const & s) { Mesh * m=new Mesh(*s); R2 Pn,Px; m->BoundingBox(Pn,Px); m->quadtree=new FQuadTree(m,Pn,Px,m->nv); // delete s; modif FH 2006 (stack ptr) return m; } inline pmesh3 ReadMesh3( string * const & s) { Mesh3 * m=new Mesh3(s->c_str()); R3 Pn,Px; // m->BoundingBox(Pn,Px); m->gtree=new Mesh3::GTree(m->vertices,m->Pmin,m->Pmax,m->nv); // delete s; modif FH 2006 (stack ptr) return m; } */ template class E_F_A_Ptr_o_R :public E_F0 { public: typedef Result A::* ptr; Expression a0; ptr p; E_F_A_Ptr_o_R(Expression aa0,ptr pp) : a0(aa0),p(pp) {} AnyType operator()(Stack s) const { return SetAny(&(GetAny((*a0)(s))->*p));} bool MeshIndependent() const {return a0->MeshIndependent();} // }; // ---- // remarque pas de template, cela ne marche pas encore ...... class E_P_Stack_P :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->P);} operator aType () const { return atype();} }; class E_P_Stack_Px :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->P.x);} operator aType () const { return atype();} }; class E_P_Stack_Py :public E_F0mps { public: AnyType operator()(Stack s) const {throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->P.y);} operator aType () const { return atype();} }; class E_P_Stack_Pz :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->P.z);} operator aType () const { return atype();} }; class E_P_Stack_N :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->N);} operator aType () const { return atype();} }; class E_P_Stack_Nx :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->N.x);} operator aType () const { return atype();} }; class E_P_Stack_Ny :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->N.y);} operator aType () const { return atype();} }; class E_P_Stack_Nz :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->N.z);} operator aType () const { return atype();} }; class E_P_Stack_Region :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->region);} operator aType () const { return atype();} }; class E_P_Stack_Label :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(&MeshPointStack(s)->label);} operator aType () const { return atype();} }; class E_P_Stack_Mesh :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(const_cast(MeshPointStack(s)->Th));} operator aType () const { return atype();} }; class E_P_Stack_Nu_Triangle :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(MeshPointStack(s)->t);} operator aType () const { return atype();} }; class E_P_Stack_Nu_Vertex :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(MeshPointStack(s)->v);} operator aType () const { return atype();} }; class E_P_Stack_Nu_Face :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(MeshPointStack(s)->f);} operator aType () const { return atype();} }; class E_P_Stack_Nu_Edge :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(MeshPointStack(s)->e);} operator aType () const { return atype();} }; class E_P_Stack_inside :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); return SetAny(MeshPointStack(s)->outside? 0.0 : 1.0 );} operator aType () const { return atype();} }; class E_P_Stack_lenEdge :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); ffassert(mp->T && mp ->e >=0 && mp->d==2); double l= mp->T->lenEdge(mp->e); return SetAny(l);} operator aType () const { return atype();} }; class E_P_Stack_hTriangle :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); assert(mp->T) ; double l= mp->T->h(); return SetAny(l);} operator aType () const { return atype();} }; class E_P_Stack_nTonEdge :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); assert(mp->T && mp->e > -1 && mp->d==2 ) ; long l=mp->Th->nTonEdge(mp->t,mp->e); // cout << " nTonEdge " << l << endl; return SetAny( l) ;} operator aType () const { return atype();} }; template class E_P_Stack_TypeEdge :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); assert(mp->T && mp->e > -1 && mp->d==2 ) ; long l=mp->Th->nTonEdge(mp->t,mp->e)==NBT; // cout << " nTonEdge " << l << endl; return SetAny( l) ;} operator aType () const { return atype();} }; class E_P_Stack_areaTriangle :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); assert(mp->T) ; double l=-1; // unset ... if(mp->d==2) l= mp->T->area; else if (mp->d==3 && mp->f >=0) { R3 NN = mp->T3->N(mp->f); l= NN.norme()/2.; } else { cout << "erreur : E_P_Stack_areaTriangle" << mp->d << " " << mp->f << endl; ffassert(0); // undef } return SetAny(l);} operator aType () const { return atype();} }; // Add jan 2018 class E_P_Stack_EdgeOrient :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint &mp= *MeshPointStack(s); // the struct to get x,y, normal , value double r=1; if(mp.d==2) { if( mp.T && mp.e >=0 ) r=mp.T->EdgeOrientation(mp.e); } else // 3D ... { if( mp.T3 && mp.f >=0 ) r = mp.T3->faceOrient( mp.f); } return r ; } operator aType () const { return atype();} }; // add FH class E_P_Stack_VolumeTet :public E_F0mps { public: AnyType operator()(Stack s) const { throwassert(* (long *) s); MeshPoint * mp=MeshPointStack(s); assert(mp->T) ; double l=-1; // unset ... if (mp->d==3 && mp->T3 ) { l= mp->T3->mesure(); } else { cout << "erreur : E_P_Stack_VolumeTet" << mp->d << " " << mp->f << endl; ffassert(0); // undef } return SetAny(l);} operator aType () const { return atype();} }; /* class New_MeshPoint : public E_F0mps { };*/ //inline pfes MakePtr(pmesh * const & a, TypeOfFE * const & tef){ return pfes(new pfes_tef(a,tef)) ;} //inline pfes MakePtr(pmesh * const & a){ return pfes(new pfes_tef(a,&P1Lagrange)) ;} //inline pfes MakePtr(pfes * const & a,long const & n){ return pfes(new pfes_fes(a,n)) ;} /* class E_pfes : public E_F0 { const int N; Expression *Th,*tef; E_pfes(Expression *TTh,*ttef) : Th(TTh),tef(ttef),N(ttef?ttef->nbitem():0) {} virtual AnyType operator()(Stack) const { return AnyType } virtual size_t nbitem() const {return 1;} }; OneOperator_pfes():OneOperator(atype(),atype(),atype()) {} E_F0 * code(const basicAC_F0 & args) const ; };*/ template class E_StopGC: public StopGC { public: typedef KN Kn; typedef KN_ Kn_; Stack s; long n; long iter; Kn_ xx,gg; C_F0 citer,cxx,cgg; C_F0 stop; E_StopGC(Stack ss,long nn,const Polymorphic * op): s(ss),n(nn),iter(-1), xx(0,0),gg(0,0), citer(CConstant(&iter)), cxx(dCPValue(&xx)), cgg(dCPValue(&gg)), stop(op,"(",citer,cxx,cgg) { } ~E_StopGC() {// a verifier ???? FH.... delete (E_F0 *) cxx; // ??? delete (E_F0 *) cgg; // ??? delete (E_F0 *) citer; // ??? delete (E_F0 *) stop; // ??? } // template class StopGC { public: virtual bool Stop(int iter, R *, R * ){return false;} }; bool Stop(int iterr, R *x, R * g) { // cout << " Stop " << iterr << endl; iter=iterr; xx.set(x,n); gg.set(g,n); return GetAny(stop.eval(s)); } }; template class LinearCG : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; const int cas; class MatF_O: VirtualMatrice { public: Stack stack; mutable Kn x; C_F0 c_x; Expression mat1,mat; typedef typename VirtualMatrice::plusAx plusAx; MatF_O(int n,Stack stk,const OneOperator * op) : VirtualMatrice(n),stack(stk), x(n),c_x(CPValue(x)), mat1(op->code(basicAC_F0_wa(c_x))), mat( CastTo(C_F0(mat1,(aType)*op))) { //ffassert(atype() ==(aType) *op); // WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 } ~MatF_O() { // cout << " del MatF_O mat " << endl; if(mat1 != mat) delete mat; delete mat1; // cout << " del MatF_Ocx ..." << endl; Expression zzz = c_x; // cout << " zzz "<< zzz << endl; delete zzz; // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 } void addMatMul(const Kn_ & xx, Kn_ & Ax) const { ffassert(xx.N()==Ax.N()); x =xx; Ax += GetAny((*mat)(stack)); WhereStackOfPtr2Free(stack)->clean(); } plusAx operator*(const Kn & x) const {return plusAx(this,x);} virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} }; class E_LCG: public E_F0mps { public: const int cas;// <0 => Nolinear static const int n_name_param=6; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; const OneOperator *A, *C; Expression X,B; E_LCG(const basicAC_F0 & args,int cc) :cas(cc) { args.SetNameParam(n_name_param,name_param,nargs); { const Polymorphic * op= dynamic_cast(args[0].LeftValue()); ffassert(op); A = op->Find("(",ArrayOfaType(atype(),false)); } if (nargs[2]) { const Polymorphic * op= dynamic_cast(nargs[2]); ffassert(op); C = op->Find("(",ArrayOfaType(atype(),false)); } else C =0; X = to(args[1]); if (args.size()>2) B = to(args[2]); else B=0; } virtual AnyType operator()(Stack stack) const { int ret=-1; E_StopGC *stop=0; // WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 try { Kn &x = *GetAny((*X)(stack)); int n=x.N(); MatF_O AA(n,stack,A); double eps = 1.0e-6; double *veps=0; int nbitermax= 100; long verb = verbosity; if (nargs[0]) eps= GetAny((*nargs[0])(stack)); if (nargs[1]) nbitermax = GetAny((*nargs[1])(stack)); if (nargs[3]) veps=GetAny((*nargs[3])(stack)); if (nargs[4]) verb=Abs(GetAny((*nargs[4])(stack))); if (nargs[5]) stop= new E_StopGC(stack,n,dynamic_cast(nargs[5])); // cout << " E_LCG: Stop = " << stop << " " << verb << endl; long gcverb=51L-Min(Abs(verb),50L); if(verb==0) gcverb = 1000000000;// no print if(veps) eps= *veps; KN bzero(B?1:n); // const array zero bzero=R(); KN *bb=&bzero; if (B) { Kn &b = *GetAny((*B)(stack)); R p = (b,b); if (p== R()) { // ExecError("Sorry LinearCG work only with nul right hand side, so put the right hand in the function"); } bb = &b; } if (cas<0) { if (C) { MatF_O CC(n,stack,C); ret = NLCG(AA,CC,x,nbitermax,eps, gcverb,stop );} else ret = NLCG(AA,MatriceIdentite(n),x,nbitermax,eps, gcverb,stop); } else if (C) { MatF_O CC(n,stack,C); ret = ConjuguedGradient2(AA,CC,x,*bb,nbitermax,eps, gcverb, stop );} else ret = ConjuguedGradient2(AA,MatriceIdentite(n),x,*bb,nbitermax,eps, gcverb, stop ); if(veps) *veps = -(eps); } catch(...) { if( stop) delete stop; // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 throw; } // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 if( stop) delete stop; return SetAny(ret); } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_LCG(args,cas);} LinearCG() : OneOperator(atype(), atype(), atype *>(),atype *>()),cas(2){} LinearCG(int cc) : OneOperator(atype(), atype(), atype *>()),cas(cc){} }; template basicAC_F0::name_and_type LinearCG::E_LCG::name_param[]= { { "eps", &typeid(double) }, { "nbiter",&typeid(long) }, { "precon",&typeid(Polymorphic*)}, { "veps" , &typeid(double*) }, { "verbosity" , &typeid(long)}, { "stop" , &typeid(Polymorphic*)} }; template class LinearGMRES : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; const int cas; class MatF_O: VirtualMatrice { public: Stack stack; mutable Kn x; C_F0 c_x; Kn *b; Expression mat1,mat; typedef typename VirtualMatrice::plusAx plusAx; MatF_O(int n,Stack stk,const OneOperator * op,Kn *bb) : VirtualMatrice(n), stack(stk), x(n),c_x(CPValue(x)),b(bb), mat1(op->code(basicAC_F0_wa(c_x))), mat( CastTo(C_F0(mat1,(aType)*op)) /*op->code(basicAC_F0_wa(c_x))*/) { // ffassert(atype() ==(aType) *op); } ~MatF_O() { if(mat1!=mat) delete mat; delete mat1; delete c_x.LeftValue();} void addMatMul(const Kn_ & xx, Kn_ & Ax) const { ffassert(xx.N()==Ax.N()); x =xx; Ax += GetAny((*mat)(stack)); if(b && &Ax!=b) Ax += *b; // Ax -b => add b (not in cas of init. b c.a.d &Ax == b WhereStackOfPtr2Free(stack)->clean(); // add dec 2008 } plusAx operator*(const Kn & x) const {return plusAx(this,x);} virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} }; class E_LGMRES: public E_F0mps { public: const int cas;// <0 => Nolinear static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =7; Expression nargs[n_name_param]; const OneOperator *A, *C; Expression X,B; E_LGMRES(const basicAC_F0 & args,int cc) :cas(cc) { args.SetNameParam(n_name_param,name_param,nargs); { const Polymorphic * op= dynamic_cast(args[0].LeftValue()); ffassert(op); A = op->Find("(",ArrayOfaType(atype(),false)); } if (nargs[2]) { const Polymorphic * op= dynamic_cast(nargs[2]); ffassert(op); C = op->Find("(",ArrayOfaType(atype(),false)); } else C =0; X = to(args[1]); if (args.size()>2) B = to(args[2]); else B=0; } virtual AnyType operator()(Stack stack) const { Kn &x = *GetAny((*X)(stack)); Kn b(x.n); E_StopGC *stop=0; if (B) b = *GetAny((*B)(stack)); else b= R(); int n=x.N(); int dKrylov=50; double eps = 1.0e-6; int nbitermax= 100; long verb = verbosity; if (nargs[0]) eps= GetAny((*nargs[0])(stack)); if (nargs[1]) nbitermax = GetAny((*nargs[1])(stack)); if (nargs[3]) eps= *GetAny((*nargs[3])(stack)); if (nargs[4]) dKrylov= GetAny((*nargs[4])(stack)); if (nargs[5]) verb=Abs(GetAny((*nargs[5])(stack))); if (nargs[6]) stop= new E_StopGC(stack,n,dynamic_cast(nargs[6])); long gcverb=51L-Min(Abs(verb),50L); int ret; if(verbosity>4) cout << " ..GMRES: eps= " << eps << " max iter " << nbitermax << " dim of Krylov space " << dKrylov << endl; KNM H(dKrylov+1,dKrylov+1); int k=dKrylov;//,nn=n; double epsr=eps; KN bzero(B?1:n); // const array zero bzero=R(); KN *bb=&bzero; if (B) { Kn &b = *GetAny((*B)(stack)); R p = (b,b); if (p) { // ExecError("Sorry MPILinearCG work only with nul right hand side, so put the right hand in the function"); } bb = &b; } KN * bbgmres =0; if ( !B ) bbgmres=bb; // none zero if gmres without B MatF_O AA(n,stack,A,bbgmres); if(bbgmres ){ AA.addMatMul(*bbgmres,*bbgmres); // Ok Ax == b -> not translation of b . *bbgmres = - *bbgmres; if(verbosity>1) cout << " ** GMRES set b = -A(0); : max=" << bbgmres->max() << " " << bbgmres->min()<min()<(n),x,nbitermax,eps, 51L-Min(Abs(verbosity),50L)); ConjuguedGradient */ } else { if (C) { MatF_O CC(n,stack,C,0); ret=GMRES(AA,(KN &)x, *bb,CC,H,k,nbitermax,epsr,verb,stop);} else ret=GMRES(AA,(KN &)x, *bb,MatriceIdentite(n),H,k,nbitermax,epsr,verb,stop); } if(verbosity>99) cout << " Sol GMRES :" << x << endl; if(stop) delete stop; return SetAny(ret); } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_LGMRES(args,cas);} LinearGMRES() : OneOperator(atype(), atype(), atype *>(),atype *>()),cas(2){} LinearGMRES(int cc) : OneOperator(atype(), atype(), atype *>()),cas(cc){} }; template basicAC_F0::name_and_type LinearGMRES::E_LGMRES::name_param[]= { { "eps", &typeid(double) }, { "nbiter",&typeid(long) }, { "precon",&typeid(Polymorphic*)}, { "veps" , &typeid(double*) }, { "dimKrylov", &typeid(long) }, { "verbosity", &typeid(long) }, { "stop" , &typeid(Polymorphic*)} }; template typename map::iterator closeto(map & m, int k) { typename map::iterator i= m.find(k); if (i==m.end()) { i= m.find(k+1); if (i==m.end()) i= m.find(k-1); } return i; } template class Smallvect { public: T v[N]; T & operator[](int i){return v[i];} const T & operator[](int i) const {return v[i];} }; template ostream & operator<<(ostream & f,const Smallvect & v) { for(int i=0;i int numeroteclink(KN_ & ndfv) { int nbdfv =0; for (int i=0;i=i) { int j=i,ii,kkk=0; do { ii=ndfv[j]; ffassert(kkk++<10); assert(nbdfv <= j); // assert(ii>=nbdfv); ndfv[j]=nbdfv ; j=ii; } while (j!=nbdfv); if (verbosity > 100) cout << " ndf: " << j << " " << ii << " <- " << nbdfv << " " << kkk << endl; nbdfv++; } return nbdfv; } bool InCircularList(const int *p,int i,int k) // find k in circular list: i , p[i], p[p[i]], ... { int j=i,l=0; do { if (j==k) return true; ffassert(l++<10); j=p[j]; } while (j!=i); return false; } bool BuildPeriodic( int nbcperiodic, Expression *periodic, const Mesh &Th,Stack stack, int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) { /* build numbering of vertex form 0 to nbdfv-1 and build numbering of edge form 0 to nbdfe-1 we removing common vextex or common edge -- we suppose one df by vertex nbdfv number of df on vertex ndfv[i] given the numero of the df of the vertex -- we suppose 1 df */ typedef Smallvect int2; if (nbcperiodic ) { // KN ndfv(Th.nv); // KN ndfe(Th.neb); ffassert(ndfv.N()==Th.nv); ffassert(ndfe.N()==Th.neb); MeshPoint *mp=MeshPointStack(stack),smp=*mp; int n= nbcperiodic; if (verbosity >2) cout << " Nb of pair of periodic conditions: = " << n << endl; int * link1=0; int * link2=0; KN plk1(n),plk2(n); KN nlk1(n),nlk2(n); KN lab1(n),lab2(n); #ifndef HUGE_VAL const double infty= numeric_limits::infinity(); #else const double infty= HUGE_VAL; #endif int nblink1, nblink2; int *plink1 , *plink2; for (int step=0;step<2;step++) { nblink1=0, nblink2=0; plink1=link1, plink2=link2; for (int ip=0, k=0;ip((*periodic[k+0])(stack)); int label2=GetAny((*periodic[k+2])(stack)); lab1[ip]=label1; lab2[ip]=label2; int l1=nblink1; int l2=nblink2; plk1[ip]= plink1; plk2[ip]= plink2; for (int ke=0;ke3) cout << " Periodic = " << nblink1 << " " << nblink2 << " step=" << step << endl; link1 = new int[nblink1]; link2 = new int[nblink2]; if(nblink1 != nblink2) { ExecError("Periodic: the both number of edges is not the same "); } } if ( nblink1 >0) { for (int ip=0, k=0;ip m; const int kk1=1,kk2=3; int label1=lab1[ip],label2=lab2[ip]; int n1=nlk1[ip],n2=nlk2[ip]; int *pke1=plk1[ip], *pke2=plk2[ip]; double xmn=infty,xmx=-infty,hmn=infty; if (verbosity >1) cout << " --Update: periodic couple label1= " << label1 << ", n edges= " << n1 << "; " << ", label2= " << label2<< ", n edges= " << n2 <set(e[0].x,e[0].y); double x0=GetAny((*periodic[k+kk1])(stack)); mp->set(e[1].x,e[1].y); double x1=GetAny((*periodic[k+kk1])(stack)); if(verbosity>5) cout << "lab1: e[" << pke1[i1] << "] v0: " << e[0].x << " " << e[0].y << " s = " << x0 << "\t v1 " << e[1].x << " " << e[1].y << " s = " << x1 << endl; xmn=Min(x1,x0,xmn); xmx=Max(x1,x0,xmx); hmn=Min(hmn,Abs(x1-x0)); } } ffassert(hmn>1.0e-20); double coef = 8/hmn; double x0 = xmn; if (verbosity > 2) cout << " --Update: periodic " << xmn << " " << xmx << " " << " h=" << hmn << endl; ffassert(coef>1e-10 && (xmx-xmn)*coef < 1.e7 ); // map construction ---- for (int i1=0;i1set(e[ne].x,e[ne].y); double xx=GetAny((*periodic[k+kk1])(stack)); int i0= (int) ((xx-x0)*coef); map::iterator im=closeto(m,i0); if (im==m.end()) { if (verbosity >50) cout << xx << " " << i0 << " " << ie << endl; im=m.insert(pair(i0,i2)).first; } else { if (verbosity >50) cout << xx << " " << i0 << " " << ie << " : " << im->second[0] << " " << im->second[1] << endl; assert( (im->second[1] < 0) && (im->second[0] >=0) ); im->second[1]=ie;} } } for (int i2=0;i250) cout << i2 << " : " <set(e[0].x,e[0].y); double xx0=GetAny((*periodic[k+kk2])(stack)); mp->set(e[1].x,e[1].y); double xx1=GetAny((*periodic[k+kk2])(stack)); if(verbosity>5 ) cout << "lab2: e[" << pke2[i2] << "] v0: " << e[0].x << " " << e[0].y << " s = " << xx0 << "\t v1 " << e[1].x << " " << e[1].y << " s = " << xx1 << endl; int i0= int((xx0-x0)*coef); int i1= int((xx1-x0)*coef); map::iterator im0=closeto(m,i0); map::iterator im1=closeto(m,i1); if(im0 == m.end() || im1 == m.end() ) { cout << "Abscisse: s0 = "<< xx0 << " <==> s1 " << xx1 <second[0])==im1->second[1]) && (ie1>=0)) ; else if (((ie1=im0->second[0])==im1->second[1]) && (ie1>=0)) ; else if (((ie1=im0->second[1])==im1->second[1]) && (ie1>=0)) ; else if (((ie1=im0->second[1])==im1->second[0]) && (ie1>=0)) ; else if (((ie1=im0->second[0])==im1->second[0]) && (ie1>=0)) ; else { cout << ie2 << " ~ " << im0->second[0] << " " << im0->second[1] << ", " << im1->second[0] << " " << im1->second[1] << endl; ExecError("periodic: Sorry one egde is losted "); } if(verbosity>50) cout << " ( " << im0->second << " , " << im1->second << " ) .. "; ffassert(ie1>=0 && ie1 < Th.neb ); const BoundaryEdge & ep =Th.bedges[ie1]; mp->set(ep[0].x,ep[0].y); double yy0=GetAny((*periodic[k+kk1])(stack)); mp->set(ep[1].x,ep[1].y); double yy1=GetAny((*periodic[k+kk1])(stack)); if(verbosity>50) cout << " e0: s "<< xx0 << " " << xx1 << "e1 s "<< yy0 << " " << yy1 ; pke1[i2]=ie1*2+ ( ( (yy1-yy0) < 0) == ( (xx1-xx0) < 0) ) ; if (verbosity >50) cout << " \t edge " << ie1 << " <=> " << ie2 << " " << ( ( (yy1-yy0) < 0) == ( (xx1-xx0) < 0) ) << "; " << xx0 << " " < " << yy0 << " " <50) { cout << " vertex " << iv1 << "<==> " << iv2 << " list : " << iv1; int i=iv1,k=0; while ( (i=ndfv[i]) != iv1 && k++<10) cout << ", "<< i ; cout << endl; }} } } // generation de numero de dlt nbdfv = numeroteclink(ndfv) ; nbdfe = numeroteclink(ndfe) ; if (verbosity>2) cout << " -- nb df on vertices " << nbdfv << endl; delete [] link1; delete [] link2; return true; //new FESpace(**ppTh,*tef,nbdfv,ndfv,nbdfe,ndfe); } else { delete [] link1; delete [] link2; } } return false; } bool v_fes::buildperiodic(Stack stack,int & nbdfv, KN & ndfv,int & nbdfe, KN & ndfe) { return BuildPeriodic(nbcperiodic,periodic,**ppTh,stack,nbdfv,ndfv,nbdfe,ndfe); } #ifdef ZZZZZZZZ FESpace * pfes_tef::update() { typedef Smallvect int2; if (nbcperiodic ) { const Mesh &Th(**ppTh); KN ndfv(Th.nv); KN ndfe(Th.neb); int nbdfv,nbdfe; return new FESpace(**ppTh,*tef,nbdfv,ndfv,nbdfe,ndfe); } else return new FESpace(**ppTh,*tef); } #endif struct OpMake_pfes_np { static const int n_name_param =1; static basicAC_F0::name_and_type name_param[] ; }; basicAC_F0::name_and_type OpMake_pfes_np::name_param[]= { "periodic", &typeid(E_Array) }; map TEF2dto3d; AnyType TypeOfFE3to2(Stack,const AnyType &b) { TypeOfFE3 *t3=0; TypeOfFE *t2=GetAny(b); map::const_iterator i=TEF2dto3d.find(t2); if(i != TEF2dto3d.end()) t3=i->second; if(t3==0) { cerr << " sorry no cast to this 3d finite element " <next) { ffassert(i->tfe); // check AddNewFE(i->name,i->tfe); // Global.New(i->name, Type_Expr(atype(),new EConstantTypeOfFE(i->tfe))); } */ TypeOfFE * FindFE2(const char * s) { for (ListOfTFE * i=ListOfTFE::all;i;i=i->next) if(strcmp(i->name,s)==0) return i->tfe; cout << " s =" << s << endl; lgerror("FindFE2 "); return 0; } typedef TypeOfFE TypeOfFE2; template struct OpMake_pfes: public OneOperator , public OpMake_pfes_np { struct Op: public E_F0mps { public: Expression eppTh; Expression eppfes; const E_Array & atef; int nb; int nbcperiodic; Expression *periodic; KN tedim; Op(Expression ppfes,Expression ppTh, const E_Array & aatef,int nbp,Expression * pr,KN &ttedim) : eppTh(ppTh),eppfes(ppfes),atef(aatef),nbcperiodic(nbp),periodic(pr),tedim(ttedim) { } ~Op() { if(periodic) delete []periodic;} AnyType operator()(Stack s) const { const int d = Mesh::Rd::d; const Mesh ** ppTh = GetAny( (*eppTh)(s) ); AnyType r = (*eppfes)(s) ; const TypeOfFE ** tef= new const TypeOfFE * [ atef.size()]; for (int i=0;i(atef[i].eval(s)); else if(tedim[i]==2 && d ==3) tef[i]= GetAny(TypeOfFE3to2(s,atef[i].eval(s))); else ffassert(0); pfes * ppfes = GetAny(r); bool same = true; for (int i=1;i(); aType t_tfe2= atype(); int d= TypeOfFE::Rd::d; string sdim= d ? " 2d : " : " 3d : " ; const E_Array * a2(dynamic_cast(args[2].LeftValue())); ffassert(a2); int N = a2->size(); ; if (!N) CompileError(sdim+" We wait an array of Type of Element "); KN tedim(N); for (int i=0;i< N; i++) if ((*a2)[i].left() == t_tfe) tedim[i]=d; else if ((*a2)[i].left() ==t_tfe2) tedim[i]=2; else CompileError(sdim+" We wait an array of Type of Element "); // ffassert(0); return new Op(args[0],args[1],*a2,nbcperiodic,periodic,tedim); } OpMake_pfes() : OneOperator(atype(),atype(),atype(),atype()) {} }; inline pfes* MakePtr2(pfes * const &p,pmesh * const & a, TypeOfFE * const & tef) { *p=new pfes_tef(a,tef) ; //(**p).decrement(); return p;} inline pfes3* MakePtr3(pfes3 * const &p,pmesh3 * const & a, TypeOfFE3 * const & tef) { *p=new pfes3_tef(a,tef) ; //(**p).decrement(); return p;} class OP_MakePtr2 { public: class Op : public E_F0mps { public: // static int GetPeriodic(Expression bb, Expression & b,Expression & f); static const int n_name_param =1; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; typedef pfes * R; typedef pfes * A; typedef pmesh * B; typedef TypeOfFE * C; Expression a,b,c; int nbcperiodic ; Expression *periodic; Op(const basicAC_F0 & args); AnyType operator()(Stack s) const { A p= GetAny( (*a)(s) ); B th= GetAny( (*b)(s) ); C tef= GetAny( (*c)(s) ); // cout << " ----------- " << endl; *p=new pfes_tef(th,tef,s,nbcperiodic,periodic) ; //(**p).decrement(); return SetAny(p); } }; // end Op class typedef Op::R Result; static E_F0 * f(const basicAC_F0 & args) { return new Op(args);} static ArrayOfaType typeargs() { return ArrayOfaType( atype(), atype(), atype(),false ) ;} }; class OP_MakePtr3 { public: class Op : public E_F0mps { public: // static int GetPeriodic(Expression bb, Expression & b,Expression & f); static const int n_name_param =1; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; typedef pfes3 * R; typedef pfes3 * A; typedef pmesh3 * B; typedef TypeOfFE3 * C; Expression a,b,c; int nbcperiodic ; Expression *periodic; Op(const basicAC_F0 & args); AnyType operator()(Stack s) const { A p= GetAny( (*a)(s) ); B th= GetAny( (*b)(s) ); C tef= GetAny( (*c)(s) ); // cout << " ----------- " << endl; *p=new pfes3_tef(th,tef,s,nbcperiodic,periodic) ; //(**p).decrement(); return SetAny(p); } }; // end Op class typedef Op::R Result; static E_F0 * f(const basicAC_F0 & args) { return new Op(args);} static ArrayOfaType typeargs() { return ArrayOfaType( atype(), atype(), atype(),false ) ;} }; void GetPeriodic(const int d,Expression perio, int & nbcperiodic , Expression * &periodic) { ffassert(d==2 || d ==3); if ( perio) { if( verbosity>1) cout << " -- Periodical Condition to do" << endl; const E_Array * a= dynamic_cast(perio); ffassert(a); int n = a->size(); nbcperiodic= n/2; if( verbosity>1) cout << " the number of periodicBC " << n << endl; if ( 2*nbcperiodic != n ) CompileError(" Sorry the number of periodicBC must by even"); periodic = new Expression[n*d]; for (int i=0,j=0;i(args[0])),b(to(args[1])),c(to(args[2])) { nbcperiodic=0; periodic=0; args.SetNameParam(n_name_param,name_param,nargs); GetPeriodic(2,nargs[0],nbcperiodic,periodic); } OP_MakePtr3::Op::Op(const basicAC_F0 & args) : a(to(args[0])),b(to(args[1])),c(to(args[2])) { nbcperiodic=0; periodic=0; args.SetNameParam(n_name_param,name_param,nargs); GetPeriodic(3,nargs[0],nbcperiodic,periodic); } int GetPeriodic(Expression bb, Expression & b,Expression & f) { const E_Array * a= dynamic_cast(bb); if(a && a->size() == 2) { b= to((*a)[0]); f= to((*a)[1]); return 1; } else return 0; } int GetPeriodic(Expression bb, Expression & b,Expression & f1,Expression & f2) { const E_Array * a= dynamic_cast(bb); if(a && a->size() == 3) { b= to((*a)[0]); f1= to((*a)[1]); f2= to((*a)[2]); return 1; } else return 0; } basicAC_F0::name_and_type OP_MakePtr2::Op::name_param[]= { "periodic", &typeid(E_Array) }; basicAC_F0::name_and_type OP_MakePtr3::Op::name_param[]= { "periodic", &typeid(E_Array) }; inline pfes* MakePtr2(pfes * const &p,pmesh * const & a){ *p=new pfes_tef(a,&P1Lagrange); //(**p).decrement(); return p ;} inline pfes* MakePtr2(pfes * const &p,pfes * const & a,long const & n){ *p= new pfes_fes(a,n); //(**p).decrement(); return p ;} long FindTxy(Stack s,pmesh * const & ppTh,const double & x,const double & y) { R2 P(x,y),PHat; bool outside; MeshPoint & mp = *MeshPointStack(s); const Mesh * pTh= *ppTh; if(pTh == 0) return 0; const Triangle * K=pTh->Find(mp.P.p2(),PHat,outside); if (!outside) mp.set(*pTh,P,PHat,*K,K->lab); else return 0; return 1; } template KN * pfer2vect( pair *,int> p) { KN * x=p.first->x(); if ( !x) { // defined FESpace * Vh= p.first->newVh(); throwassert( Vh); *p.first = x = new KN(Vh->NbOfDF); *x=K(); } return x;} template pmesh pfer_Th(pair *,int> p) { if (!p.first->Vh) p.first->Vh= p.first->newVh(); throwassert( !!p.first->Vh); return &p.first->Vh->Th; } template long pfer_nbdf(pair *,int> p) { if (!p.first->Vh) p.first->Vh= p.first->newVh(); throwassert( !!p.first->Vh); return p.first->Vh->NbOfDF; } double pmesh_area(pmesh * p) { throwassert(p && *p) ; return (**p).area ;} double pmesh_bordermeasure(pmesh * p) { throwassert(p && *p) ; return (**p).lenbord ;} long pmesh_nt(pmesh * p) { throwassert(p && *p) ; return (**p).nt ;} long pmesh_nbe(pmesh * p) { throwassert(p && *p) ; return (**p).neb ;} long pmesh_nv(pmesh * p) { throwassert(p && *p) ; return (**p).nv ;} double pmesh_hmax(pmesh * p) { throwassert(p && *p) ; double hmax2 =0; const Mesh & Th = **p; for(int k=0; k< Th.nt; ++k) for(int e=0; e<3; ++e) hmax2=max(hmax2,Th[k].lenEdge2(e)); return sqrt(hmax2);} double pmesh_hmin(pmesh * p) { throwassert(p && *p) ; double hmin2 =1e100; const Mesh & Th = **p; for(int k=0; k< Th.nt; ++k) for(int e=0; e<3; ++e) hmin2=min(hmin2,Th[k].lenEdge2(e)); return sqrt(hmin2);} long pVh_ndof(pfes * p) { throwassert(p && *p); FESpace *fes=**p; ; return fes->NbOfDF ;} pmesh pVh_Th(pfes * p) { throwassert(p && *p); FESpace *fes=**p; ; return &fes->Th ;} long pVh_nt(pfes * p) { throwassert(p && *p); FESpace *fes=**p; ; return fes->NbOfElements ;} long pVh_ndofK(pfes * p) { throwassert(p && *p); FESpace *fes=**p; return (*fes)[0].NbDoF() ;} long mp_nuTriangle(MeshPoint * p) { throwassert(p && p->Th && p->T); long nu=0; if(p->d==2) nu=(*p->Th)(p->T); else if (p->d==3) nu=(*p->Th3)(p->T3); else ffassert(0); delete p; return nu ;} long mp_region(MeshPoint * p) { //throwassert(p && p->Th); long nu(p->region); delete p; return nu ;} class pVh_ndf : public ternary_function { public: class Op : public E_F0mps { public: Expression a,b,c; Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} AnyType operator()(Stack s) const { pfes * p(GetAny((*a)(s))); long k(GetAny((*b)(s))); long i(GetAny((*c)(s))); throwassert(p && *p); FESpace *fes=**p; throwassert(fes && k >=0 && k < fes->NbOfElements ); FElement K=(*fes)[k]; throwassert(i>=0 && i *,KN *> { public: static KN * f(Stack s,pfes *p ,KN * k) { ffassert(0); // debile ... return k ; } }; */ //plus class Op_CopyArray : public OneOperator { public: Op_CopyArray():OneOperator(atype(),atype(),atype()) {} E_F0 * code(const basicAC_F0 & args) const ; }; template AnyType pfer2R(Stack s,const AnyType &a) { pair< FEbase * ,int> ppfe=GetAny *,int> >(a); FEbase & fe( *ppfe.first); int componante=ppfe.second; if ( !fe.x()) { if ( !fe.x()){ // CompileError(" Sorry unset fem array "); return SetAny(0.0); } } const FESpace & Vh(*fe.Vh); const Mesh & Th(Vh.Th); assert(Th.ntet==0 && Th.volume==0 && Th.triangles != 0); MeshPoint & mp = *MeshPointStack(s); const Triangle *K; R2 PHat; bool outside=false; bool qnu=true; if ( mp.Th == &Th && mp.T) { qnu=false; K=mp.T; PHat=mp.PHat.p2(); } else if ( mp.other.Th == & Th && mp.other.P.x == mp.P.x && mp.other.P.y == mp.P.y ) { K=mp.other.T; PHat=mp.other.PHat.p2(); outside = mp.other.outside; } else { if (mp.isUnset()) ExecError("Try to get unset x,y, ..."); K=Th.Find(mp.P.p2(),PHat,outside); mp.other.set(Th,mp.P.p2(),PHat,*K,0,outside); } // cout << " --- " << qnu << " " << mp.P << " " << mp.outside << " " << outside << endl; const FElement KK(Vh[Th(K)]); if (outside && !KK.tfe->NbDfOnVertex && !KK.tfe->NbDfOnEdge) return SetAny(0.0); /* if (!outside) { if ( Norme2_2( (*K)(PHat) - mp.P ) > 1e-12 ) cout << "bug ?? " << Norme2_2( (*K)(PHat) - mp.P ) << " " << mp.P << " " << (*K)(PHat) << endl; } */ /* int nbdf=KK.NbDoF(); int N= KK.N; KN_ U(*fe.x()); KNMK fb(nbdf,N,3); // the value for basic fonction KN fk(nbdf); for (int i=0;i 0.05 && Norme2_2(mp.P) < 0.4*0.4 ) { int vv=verbosity; cout << " f() triangle " << Th(K) << " " << mp.P << " " << PHat << " = " << r << " " < * y=new KN(Vh.NbOfDF); KN & yy(*y); KN Viso(100); // R2 Ptt[3]; for (int i=0;i Aipj(ipj.N()); KN Vp(PtHat.N()); const E_F0 & ff(* (const E_F0 *) e ) ; if (Vh.isFEMesh() ) { ffassert(Vh.NbOfDF == Th.nv && Vh.N == 1 ); for (int iv=0;iv=0); mps->set(Th,v,TriangleHat[il],K,v.lab); yy[iv] = GetAny( ff(s) ); sptr->clean(); // modif FH mars 2006 clean Ptr } } else for (int t=0;tset(K.T(PtHat[p]),PtHat[p],K); Vp[p]=GetAny( ff(s) ); } for (int i=0;iclean(); // modif FH mars 2006 clean Ptr } *mps=mp; fe=y; kkff = Mesh::kfind - kkff; kkth = Mesh::kthrough -kkth; if(verbosity>1) ShowBound(*y,cout) << " " << kkth << "/" << kkff << " = " << double(kkth)/Max(1.,kkff) << endl; return SetAny*>(&fe); } AnyType set_feoX_1 (Stack s,Expression ppfeX_1, Expression e) { // inutile // mme chose que v(X1,X2); StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); typedef const interpolate_f_X_1::CODE * code; MeshPoint mp= *MeshPointStack(s); code ipp = dynamic_cast(ppfeX_1); pair *,int> pp=GetAny *,int> >((*ipp->f)(s)); FEbase & fe(*pp.first); const FESpace & Vh(*fe.newVh()); KN gg(Vh.MaximalNbOfDF()); const Mesh & Th(Vh.Th); R F[100]; // buffer TabFuncArg tabexp(s,Vh.N+2); tabexp[0]=e; tabexp[1]=ipp->x; tabexp[2]=ipp->y; throwassert(Vh.N==1); KN * y=new KN(Vh.NbOfDF); for (int t=0;tclean(); // modif FH mars 2006 clean Ptr } *MeshPointStack(s)=mp; fe=y; if(verbosity>1) cout << " -- interpole f= g*X^-1, function's bound: " << y->min() << " " << y->max() << endl; return SetAny*>(&fe); } template E_set_fev::E_set_fev(const E_Array * a,Expression pp,int ddim) :dim(ddim), aa(*a),ppfe(pp),optimize(true), where_in_stack_opt(),optiexp0(),optiexpK() { aa.map(to) ; bool kdump=false; if(optimize) { // new code Optimized ------- int n=aa.size(); deque > ll; MapOfE_F0 m; where_in_stack_opt.resize(n); size_t top = currentblock->OffSet(0), topbb=top; // FH. bofbof ??? for (int i=0; iOptimize(ll, m, top); if (kdump) cout << "\n\t\t"<< i << ": " << where_in_stack_opt[i] << endl; } currentblock->OffSet(top-topbb); // int k=ll.size(),k0=0,k1=0; for (int i=0;iMeshIndependent()) k0++; deque > l0(k0),l1(k-k0); k0=0,k1=0; for (int i=0;iMeshIndependent()) { if (kdump) cout << " mi " << ll[i].second << " " << *(ll[i].first) << endl; l0[k0++]=ll[i]; } else { if (kdump) cout << " md " << ll[i].second << " " << *(ll[i].first) << endl; l1[k1++]=ll[i]; } if (k0) optiexp0 = new E_F0_Optimize(l0,m,0); // constant part if (k1) optiexpK = new E_F0_Optimize(l1,m,0); // none constant part } } template AnyType E_set_fev::operator()(Stack s) const { if(dim== 2) return Op2d(s); else if(dim == 3) return Op3d(s); return Nothing; } template AnyType E_set_fev::Op3d(Stack s) const { // voir E_set_fev3 ( pb de consitance a revoir FH) ffassert(0); // a faire } template AnyType E_set_fev::Op2d(Stack s) const { StackOfPtr2Free * sptr = WhereStackOfPtr2Free(s); MeshPoint *mps=MeshPointStack(s), mp=*mps; FEbase ** pp=GetAny< FEbase **>((*ppfe)(s)); FEbase & fe(**pp); const FESpace & Vh(*fe.newVh()); KN gg(Vh.MaximalNbOfDF()); const Mesh & Th(Vh.Th); const int dim=Vh.N; K ** copt=0; if (optimize) copt= new K *[dim]; if(copt) { assert((size_t) dim== where_in_stack_opt.size()); for (int i=0;i10); copt[i]= static_cast(static_cast((char*)s+offset)); *(copt[i])=0; } if (optiexp0) (*optiexp0)(s); // init } #ifdef OLDPih ffassert(dim<100); #endif // R F[100]; // buffer TabFuncArg tabexp(s,Vh.N); // const E_Array * aa = dynamic_cast(e); ffassert( aa.size() == Vh.N); for (int i=0;i * y=new KN(Vh.NbOfDF); KN & yy(*y); FElement::aIPJ ipj(Vh[0].Pi_h_ipj()); FElement::aR2 PtHat(Vh[0].Pi_h_R2()); KN Aipj(ipj.N()); // KNM Vp(dim,PtHat.N());// bug // g++ error: too many initializers for `const __class_type_info_pseudo KN Vp1(dim*PtHat.N()); if (Vh.isFEMesh() ) { ffassert(Vh.NbOfDF == Th.nv && dim == 1 ); for (int iv=0;iv=0); mps->set(Th,v,TriangleHat[il],Kt,v.lab); if (copt) { if (optiexpK) (*optiexpK)(s); yy[iv] = *(copt[0]); } else yy[iv] = GetAny( ff(s) ); sptr->clean(); // modif FH mars 2006 clean Ptr } } else for (int t=0;tset(Kt.T(PtHat[p]),PtHat[p],Kt); // KN_ Vpp(Vp('.',p)); KN_ Vpp(Vp1,SubArray(dim,p*dim)); // a Change FHHHHHHHH if (copt) { // optimize version if (optiexpK) (*optiexpK)(s); for (int j=0;j( (*tabexp[j])(s) ); else Vpp[j]=0; } for (int i=0;iclean(); // modif FH mars 2006 clean Ptr } #endif for (int df=0;dfunset(); fe=y; if (copt) delete [] copt; *MeshPointStack(s) = mp; if(verbosity>1) ShowBound(*y,cout) << endl ; //HHHH*/ return Nothing; } template inline FEbase * MakePtrFE(pfes * const & a){ FEbase * p=new FEbase(a); //cout << "MakePtrFE " << p<< endl; return p ;} template inline FEbase ** MakePtrFE2(FEbase * * const & p,pfes * const & a){ *p=new FEbase(a); //cout << "MakePtrFE2 " << *p<< endl; return p ;} template inline FEbaseArray ** MakePtrFE3(FEbaseArray * * const & p,pfes * const & a,const long & N){ *p=new FEbaseArray(a,N); //cout << "MakePtrFE2 " << *p<< endl; return p ;} /* inline pmesharray* MakePtr(pmesharray* const & p,long const & a){ p->first=new pmesh [a]; p->second=a; for (int i=0;ifirst[i]=0; // nuset return p ;} */ template class OneOperatorMakePtrFE : public OneOperator { public: // il faut Optimize // typedef double K; typedef FEbase ** R; typedef pfes* B; class CODE : public E_F0mps { public: Expression fer,fes; E_set_fev * e_set_fev; const E_Array * v; CODE(const basicAC_F0 & args) : fer(to(args[0])), fes(to(args[1])), e_set_fev(0) { if (BCastTo(args[2]) ) v = new E_Array(basicAC_F0_wa(to(args[2]))); else v = dynamic_cast( args[2].LeftValue() ); if (!v) { cout << "Error: type of arg :" << *args[2].left() << " in " << typeid(K).name() << " case " << endl; ErrorCompile(" We wait a double/complex expression or a array expression",1); } //v->map(to); e_set_fev= new E_set_fev(v,fer,v_fes::d); } AnyType operator()(Stack stack) const { R p = GetAny( (*fer)(stack)); B a = GetAny( (*fes)(stack)); *p=new FEbase(a); (*e_set_fev)(stack); // cout << "MakePtrFE: build p " << p << " " << *p << endl; return SetAny(p); } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new CODE(args);} OneOperatorMakePtrFE(aType tt): // tt= aType() or aType() OneOperator(map_type[typeid(R).name()],map_type[typeid(R).name()],map_type[typeid(B).name()],tt) {} }; // --- template class OneOperator_Ptr_o_R: public OneOperator { // aType r; // return type typedef Result A::* ptr; ptr p; public: E_F0 * code(const basicAC_F0 & args) const { return new E_F_A_Ptr_o_R(t[0]->CastTo(args[0]),p);} OneOperator_Ptr_o_R(ptr pp): OneOperator(atype(),atype()),p(pp) {} }; template K *PAddition(const K * a,const K * b) {return new K(*a+*b);} // class fCLD { public: typedef pair Key; typedef map::iterator iterator; map *l; fCLD (){ l=new map;} void operator=(const fCLD & a){ *l=*a.l;} void destroy() { delete l;l=0;} ~fCLD(){ delete l;l=0;} void Add(finconnue *v,int lab,C_F0 f) { const MGauche *pn= v->simple(); Check(pn,"Def CL Dirichet "); Label r(lab); Key k(make_pair(pn->first,r)); iterator i=l->find(k); Check( i != l->end() ,"Def CL Dirichet already exists"); l->insert(make_pair(k,CastTo(f))); } }; // pour stocker des expression de compilation class Convect : public E_F0mps { public: typedef double Result; // return type Expression u,v,w,ff,dt; long state; static Expression ou,ov,ow,odt; // previous def static long count; int d; Convect(const basicAC_F0 & args) : u(0),v(0),w(0),ff(0),dt(0) { args.SetNameParam(); const E_Array * a = dynamic_cast(args[0].LeftValue()); ffassert(a); d= a->size(); if (d == 3) w= CastTo((*a)[2]); else if (d != 2) { CompileError("convect vector have only 2 or 3 componant");} u= CastTo((*a)[0]); v= CastTo((*a)[1]); dt=CastTo(args[1]); ff=CastTo(args[2]); // save previous state if( !(( ou && u->compare(ou)==0) && (v->compare(ov)==0) && ( (w==0) || (w->compare(ov)==0)) && (dt->compare(odt)==0) )) { count++; } state= count;// use of optim of convect if(verbosity>3) cout << "\n -- Convert number of Convect case: .... "<< state << endl; ou=u; ov=v; ow=w; odt=dt; } static ArrayOfaType typeargs() { return ArrayOfaType(atype(),atype(),atype());} static E_F0 * f(const basicAC_F0 & args) { return new Convect(args);} AnyType operator()(Stack s) const ; AnyType eval2(Stack s) const ; AnyType eval3(Stack s) const ; AnyType eval3old(Stack s) const ; // old version a supprime en 2017 operator aType () const { return atype();} }; Expression Convect::ou=0; Expression Convect::ov=0; Expression Convect::ow=0; Expression Convect::odt=0; long Convect::count=0; /// <> used for the [[plot_keyword]] class Plot : public E_F0mps /* [[file:AFunction.hpp::E_F0mps]] */ { public: typedef KN_ tab; typedef KN >* pttab; typedef pferbase sol; typedef pferbasearray asol; typedef pf3rbase sol3; typedef pf3rbasearray asol3; typedef pfecbase solc; typedef pfecbasearray asolc; typedef pf3cbase solc3; typedef pf3cbasearray asolc3; typedef long Result; struct ListWhat { int what,i; int cmp[4]; int n; union { long l[4]; void * v[4];// for const void * cv[4];// for }; pmesh th() { assert(v[0] && what==0); return static_cast(cv[0]);} pmesh3 th3() { assert(v[0] && what==5); return static_cast(cv[0]);} void Set(int nn=0,void **vv=0,int *c=0) { cmp[0]=cmp[1]=cmp[2]=cmp[3]=-1; v[0]=v[1]=v[2]=v[3]=0; n=nn; for(int i=0;i void eval(S *f,int *c) { for(int i=0;i<3;++i) { f[i]= static_cast(v[i]); c[i]= cmp[i]; } } template M eval() { assert(v[0]); return static_cast(v[0]); } void eval(sol & f0,int & cmp0, sol &f1,int &cmp1) { f0=static_cast(v[0]); f1=static_cast(v[1]); cmp0=cmp[0]; cmp1=cmp[1]; } }; /// <> struct Expression2 {// FH. change nov 2016 add one expression for colored curve ... long what; // 0 mesh, 1 iso, 2 vector, 3 curve , 4 border , 5 mesh3, 6 iso 3d, // 7: vector 3d ( +10 -> complex visu ???? ) // 101 array of iso 2d , 106 array of iso 3d , 100 array of meshes // 103 array of curves ... bool composant; Expression e[4]; Expression2() {e[0]=0;e[1]=0;e[2]=0;e[3]=0;composant=false;what=0;} Expression &operator[](int i){return e[i];} int EvalandPush(Stack s,int ii,vector & ll,vector & lat ) const { // add for curve ... and multi curve ... // store date in lat.. long f[4]; for(int i=0; i< 4;++i) { f[i]=-1; if( e[i] ) { // eval .. f[i]= lat.size(); lat.push_back((*e[i])(s)); } } ll.push_back(ListWhat(what,ii,4,f)); return 4; } template int EvalandPush(Stack s,int ii,vector & ll ) const { int n=-1; S f[3]={0,0,0}; int cmp[3]={-1,-1,-1}; for(int i=0;i<3;++i) if (e[i]) { if (!composant) { pair p= GetAny< pair >((*e[i])(s)); n=i;cmp[i]=p.second; f[i]= p.first;} else { cmp[i]=0; f[i]=GetAny< S >((*e[i])(s)); n=i;} } ll.push_back(ListWhat(what,ii,n+1,f,cmp)); return n;} int AEvalandPush(Stack s,int ii,vector & ll,vector & lat) const { pttab pt[4]={0,0,0,0}; pt[0] =evalptt(0,s); pt[1]=evalptt(1,s); if (e[2]) pt[2]=evalptt(2,s); if (e[3]) pt[3]=evalptt(3,s); int kt = min(pt[0]->N() , pt[1]->N()); for( int j=0; j99) cout << " plot : A curve "<< j << " " ; for(int k=0; k<4; ++k) { pttab ptk=pt[k]; f[k]=-1; if(ptk) { KN_ t=(*ptk)[j]; f[k]=lat.size(); if(verbosity>99) cout << " ("< >(t)); } } if(verbosity>99) cout << endl; ll.push_back(ListWhat(what,ii,4,f)); } return 4; } template // ok of mesh too because composant=true; int AEvalandPush(Stack s,int ii,vector & ll ) const { typedef pair PA; int nn=-1; A f[3]; union { S fj[3]; void *fv[3]; }; f[0]=f[1]=f[2]=0; int cmp[3]={-1,-1,-1}; for(int i=0;i<3;++i) if (e[i]) { if (!composant) { PA p= GetAny< PA >((*e[i])(s)); cmp[i]=p.second;f[i]=p.first; nn=i;} else { f[i]= GetAny< A >((*e[i])(s)); cmp[i]=0; nn=i;} } else break; nn++; int n = f[0]->N; if(verbosity>50) // add 01/2011 FH ???? cout << "add N = " << n << " " << nn << " "<< what << endl; for(int j=0;joperator[](j); if(fj[i] && fj[i]->x()) m=i; else break; } if(m>=0) { ll.push_back(ListWhat(what%100,ii,m+1,fv,cmp)); if(verbosity>100) cout << "."; } } if(verbosity>100) cout << endl; return nn; } template int MEvalandPush(Stack s,int ii,vector & ll ) const { typedef KN * A; A ath; ath= GetAny< A >((*e[0])(s)); int n=0; if(ath) n = ath->N(); S th; for(int j=0;joperator[](j); if(th) ll.push_back(ListWhat(what%100,ii,static_cast(th))); } return n; } sol eval(int i,Stack s,int & cmp) const { cmp=-1; if (e[i]) { if (!composant) {pfer p= GetAny< pfer >((*e[i])(s)); cmp=p.second;return p.first;} else {return GetAny< pferbase >((*e[i])(s));} } else return 0;} sol3 eval3(int i,Stack s,int & cmp) const { cmp=-1; if (e[i]) { if (!composant) {pf3r p= GetAny< pf3r >((*e[i])(s)); cmp=p.second;return p.first;} else {return GetAny< pf3rbase >((*e[i])(s));} } else return 0;} // add FH Japon 2010 .. for complex visu ... to complex .... try to uniformize ... solc evalc(int i,Stack s,int & cmp) const { cmp=-1; if (e[i]) { if (!composant) {pfec p= GetAny< pfec >((*e[i])(s)); cmp=p.second;return p.first;} else {return GetAny< pfecbase >((*e[i])(s));} } else return 0;} solc3 evalc3(int i,Stack s,int & cmp) const { cmp=-1; if (e[i]) { if (!composant) {pf3c p= GetAny< pf3c >((*e[i])(s)); cmp=p.second;return p.first;} else {return GetAny< pf3cbase >((*e[i])(s));} } else return 0;} asol evala(int i, Stack s,int & cmp) const { cmp=-1; if (e[i]) {pferarray p= GetAny< pferarray >((*e[i])(s)); cmp=p.second;return p.first;} else return 0;} asol3 evala3(int i, Stack s,int & cmp) const { cmp=-1; if (e[i]) {pf3rarray p= GetAny< pf3rarray >((*e[i])(s)); cmp=p.second;return p.first;} else return 0;} asolc evalca(int i, Stack s,int & cmp) const { cmp=-1; if (e[i]) {pfecarray p= GetAny< pfecarray >((*e[i])(s)); cmp=p.second;return p.first;} else return 0;} asolc3 evalca3(int i, Stack s,int & cmp) const { cmp=-1; if (e[i]) {pf3carray p= GetAny< pf3carray >((*e[i])(s)); cmp=p.second;return p.first;} else return 0;} const Mesh & evalm(int i,Stack s) const { throwassert(e[i]);return * GetAny< pmesh >((*e[i])(s)) ;} KN * evalma(int i,Stack s) const { throwassert(e[i]);return GetAny< KN * >((*e[i])(s)) ;} const Mesh3 & evalm3(int i,Stack s) const { throwassert(e[i]);return * GetAny< pmesh3 >((*e[i])(s)) ;} const E_BorderN * evalb(int i,Stack s) const { throwassert(e[i]);return GetAny< const E_BorderN *>((*e[i])(s)) ;} tab evalt(int i,Stack s) const { throwassert(e[i]);return GetAny((*e[i])(s)) ;} pttab evalptt(int i,Stack s) const { throwassert(e[i]);return GetAny((*e[i])(s)) ;} }; // see [[Plot_name_param]] static basicAC_F0::name_and_type name_param[] ; /// <> FFCS: added new parameters for VTK graphics. See /// [[Plot_name_param]] for new parameter names static const int n_name_param=43; Expression bb[4]; /// [[Expression2]] is a description of an object to plot vector l; typedef KN > * ptaboftab; Expression nargs[n_name_param]; Plot(const basicAC_F0 & args) : l(args.size()) { args.SetNameParam(n_name_param,name_param,nargs); if ( nargs[8] ) Box2x2( nargs[8] , bb); // scan all the parameters of the plot() call for (size_t i=0;i()) { //cout << "args[i].left()==atype()" << endl; l[i].composant=false; const E_Array * a = dynamic_cast(args[i].LeftValue()); ffassert(a); int asizea=a->size(); if(asizea==0) CompileError("plot of vector with 0 of components(!= 2 or 3) "); bool bpfer= BCastTo((*a)[0]); bool bpf3r= BCastTo((*a)[0]); bool bpfec= BCastTo((*a)[0]); bool bpf3c= BCastTo((*a)[0]); bool bptab= BCastTo ((*a)[0]); bool bpttab= BCastTo((*a)[0]); if ( bpfer && asizea <3) { l[i].what=asizea; for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else if ( bpfec && asizea <3) { l[i].what=10+asizea; for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else if (bptab && asizea>=2 && asizea<=4)// change nov 2016 FH for color corve { l[i].what=3; for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else if (bpttab && asizea>=2 && asizea<=4)// change nov 2016 FH for arry of curve { l[i].what=103; for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else if (asizea == 3 && bpf3r ) // 3d vector ... { l[i].what=7; // new 3d vector for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else if (asizea == 3 && bpf3c ) // 3d vector ... { l[i].what=17; // new 3d vector for (int j=0;jsize();j++) l[i][j]= CastTo((*a)[j]); } else { CompileError("plot of array with wrong number of components (!= 2 or 3) ");} } else if (BCastTo(args[i])) { // [[file:problem.hpp::pferbase]] [[file:lgmesh3.hpp::BCastTo]] l[i].what=1; // iso value 2d // cout << "BCastTo(args[i])" << endl; l[i].composant=true; l[i][0]=CastTo(args[i]); } else if (BCastTo(args[i])) { // [[file:problem.hpp::pfer]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=1; // iso value 2d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // [[file:problem.hpp::pfecbase]] l[i].what=11; // iso value 2d // cout << "BCastTo(args[i])" << endl; l[i].composant=true; l[i][0]=CastTo(args[i]); } else if (BCastTo(args[i])) { // [[file:problem.hpp::pfec]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=11; // iso value 2d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // [[file:lgmesh3.hpp::pf3r]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=6; // iso value 3d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // [[file:lgmesh3.hpp::pf3c]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=16; // iso value 3d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=101; // iso value array iso value 2d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=111; // iso value array iso value 2d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // [[file:lgmesh3.hpp::pf3rarray]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=106; //arry iso value array iso value 3d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])) { // [[file:lgmesh3.hpp::pf3carray]] // cout << "BCastTo(args[i])" << endl; l[i].composant=false; l[i].what=116; //arry iso value array iso value 3d l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])){ l[i].composant=true; l[i].what=0; // mesh ... l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])){ l[i].composant=true; l[i].what=5;// 3d mesh ... l[i][0]=CastTo(args[i]);} else if (BCastTo(args[i])){ // cout << "BCastTo(args[i])" << endl; l[i].what=4; // border 2d l[i].composant=true; l[i][0]=CastTo(args[i]);} else if (BCastTo *>(args[i])){ l[i].composant=true; // cout << "BCastTo(args[i])" << endl; l[i].what=100; // mesh 2d array l[i][0]=CastTo *>(args[i]);} else { CompileError("Sorry no way to plot this kind of data"); } } static ArrayOfaType typeargs() { return ArrayOfaType(true);}// all type /// <> Creates a Plot object with the list of arguments obtained from the script during the grammatical /// analysis of the script (in lg.ypp) static E_F0 * f(const basicAC_F0 & args) { return new Plot(args);} /// Evaluates the contents of the Plot object during script evaluation. Implemented at [[Plot_operator_brackets]] AnyType operator()(Stack s) const ; }; /// <> basicAC_F0::name_and_type Plot::name_param[Plot::n_name_param] = { { "coef", &typeid(double)}, { "cmm", &typeid(string*)}, { "ps", &typeid(string*) }, { "wait", &typeid(bool) }, { "fill", &typeid(bool) }, { "value", &typeid(bool) }, { "clean", &typeid(bool) }, { "aspectratio", &typeid(bool)}, { "bb",&typeid(E_Array) }, { "nbiso", &typeid(long)}, { "nbarrow", &typeid(long)}, { "viso", &typeid(KN_)}, { "varrow", &typeid(KN_)}, { "bw",&typeid(bool)}, { "grey", &typeid(bool)}, { "hsv", &typeid(KN_)}, { "boundary", &typeid(bool)}, // 16 { "dim", &typeid(long)}, // 2 or 3 { "add", &typeid(bool)}, // add to previous plot { "prev", &typeid(bool)}, // keep previou view point { "ech", &typeid(double)}, // keep previou view point // FFCS: more options for VTK graphics (numbers are required for processing) {"ZScale",&typeid(double)}, // #1 {"WhiteBackground",&typeid(bool)}, // #2 {"OpaqueBorders",&typeid(bool)}, // #3 {"BorderAsMesh",&typeid(bool)}, // #4 {"ShowMeshes",&typeid(bool)}, // #5 {"ColorScheme",&typeid(long)}, // #6 {"ArrowShape",&typeid(long)}, // #7 {"ArrowSize",&typeid(double)}, // #8 {"ComplexDisplay",&typeid(long)}, // #9 {"LabelColors",&typeid(bool)}, // #10 {"ShowAxes",&typeid(bool)}, // #11 {"CutPlane",&typeid(bool)}, // #12 {"CameraPosition",&typeid(KN_)}, // #13 {"CameraFocalPoint",&typeid(KN_)}, // #14 {"CameraViewUp",&typeid(KN_)}, // #15 {"CameraViewAngle",&typeid(double)}, // #16 {"CameraClippingRange",&typeid(KN_)}, // #17 {"CutPlaneOrigin",&typeid(KN_)}, // #18 {"CutPlaneNormal",&typeid(KN_)}, // #19 {"WindowIndex",&typeid(long)}, // #20 {"NbColorTicks",&typeid(long)}, // #21 {"NbColors",&typeid(long)} // #22 }; template class pb2mat : public E_F0 { public: typedef Matrice_Creuse * Result; const Problem * pb; pb2mat(const basicAC_F0 & args) : pb(dynamic_cast(args[0].left())) {ffassert(pb);} static ArrayOfaType typeargs() { return ArrayOfaType(atype());} static E_F0 * f(const basicAC_F0 & args) { return new Plot(args);} AnyType operator()(Stack s) const { Problem::Data *data= pb->dataptr(this->stack); if ( SameType::OK ) { ffassert( !!data->AR); return SetAny * >(&data->AR) ; } else { ffassert( !!data->AC); return SetAny * >(&data->AC) ; } } }; //template void PrintP(RR* a, A b){ *a <<*b;} LinkToInterpreter::LinkToInterpreter() { //P,N,x,y,z,label,region,nu_triangle; P=make_Type_Expr(atype(),new E_P_Stack_P); x=make_Type_Expr(atype(),new E_P_Stack_Px); y=make_Type_Expr(atype(),new E_P_Stack_Py); z=make_Type_Expr(atype(),new E_P_Stack_Pz); N=make_Type_Expr(atype(),new E_P_Stack_N); region=make_Type_Expr(new E_P_Stack_Region,atype()); label=make_Type_Expr(new E_P_Stack_Label,atype()); nu_triangle= make_Type_Expr(atype(),new E_P_Stack_Nu_Triangle); nu_edge= make_Type_Expr(atype(),new E_P_Stack_Nu_Edge); lenEdge = make_Type_Expr(atype(),new E_P_Stack_lenEdge); hTriangle = make_Type_Expr(atype(),new E_P_Stack_hTriangle); area = make_Type_Expr(atype(),new E_P_Stack_areaTriangle); volume = make_Type_Expr(atype(),new E_P_Stack_VolumeTet); inside = make_Type_Expr(atype(),new E_P_Stack_inside); Global.New("x",x); Global.New("y",y); Global.New("z",z); Global.New("label",label); Global.New("region",region); Global.New("notaregion",CConstant(lnotaregion)); Global.New("nuTriangle",nu_triangle); Global.New("nuTet",nu_triangle); Global.New("nuEdge",nu_edge); Global.New("P",P); Global.New("N",N); Global.New("lenEdge",lenEdge); Global.New("area",area); Global.New("volume",volume); Global.New("hTriangle",hTriangle); Global.New("inside",inside); Global.New("nTonEdge",make_Type_Expr(atype(),new E_P_Stack_nTonEdge)); Global.New("edgeOrientation",make_Type_Expr(atype(),new E_P_Stack_EdgeOrient)); // Add FH jan 2018 Global.New("BoundaryEdge",make_Type_Expr(atype(),new E_P_Stack_TypeEdge<1>));// Add FH jan 2018 Global.New("InternalEdge",make_Type_Expr(atype(),new E_P_Stack_TypeEdge<2>));// Add FH jan 2018 } template struct set_eqmatrice_creuse_fbl: public binary_function*,const Matrice_Creuse *,const C_args * > { static Matrice_Creuse* f(Matrice_Creuse* const & a,const C_args * const & b) { // 1 verif the FESpace // 2 set = or += ffassert(0); return a;} }; template struct set_eqvect_fl: public binary_function*,const FormLinear *,KN*> { static KN* f(KN* const & a,const FormLinear * const & b) { ffassert(0); return a;} }; template AnyType IntFunction::operator()(Stack stack) const { MeshPoint mp=* MeshPointStack(stack); StackOfPtr2Free * wsptr2free=WhereStackOfPtr2Free(stack); size_t swsptr2free =wsptr2free->size(); R r=0; SHOWVERB(cout << " int " << endl); const vector & what(di->what); const int dim =di->d; const GQuadratureFormular& FIE = di->FIE(stack); const GQuadratureFormular & FIT = di->FIT(stack); const GQuadratureFormular & FIV = di->FIV(stack); CDomainOfIntegration::typeofkind kind = di->kind; set setoflab; bool all=true; if( di->withmap()) { ExecError(" no map in the case (1)??");} if (verbosity>3) { if(dim==2) { if (CDomainOfIntegration::int1d==kind) cout << " -- boundary int border ( nQP: "<< FIE.n << ") levelset: "<< di->islevelset() << " ," ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all edges ( nQP: "<< FIE.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF edges nQP: ("<< FIE.n << ")," ; else cout << " -- int 2d (nQP: "<< FIT.n << " ) in " ; } else if(dim==3) { if (CDomainOfIntegration::int2d==kind) cout << " -- boundary int border ( nQP: "<< FIT.n << ") ," ; else if (CDomainOfIntegration::intalledges==kind) cout << " -- boundary int all faces ( nQP: "<< FIT.n << ")," ; else if (CDomainOfIntegration::intallVFedges==kind) cout << " -- boundary int all VF face nQP: ("<< FIT.n << ")," ; else cout << " -- int 3d (nQP: "<< FIV.n << " ) in " ; } } /* if ( verbosity>3) if (kind==CDomainOfIntegration::int1d) cout << " -- boundary int border " ; else if (kind==CDomainOfIntegration::intalledges) cout << " -- boundary int all edges " ; else if (kind==CDomainOfIntegration::intallVFedges) cout << " -- boundary int all VF edges " ; else cout << " -- boundary int " ;*/ Expandsetoflab(stack,*di, setoflab,all); /* for (size_t i=0;i( (*what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; } */ if(dim==2) { if(di->islevelset() && (CDomainOfIntegration::int1d!=kind) && (CDomainOfIntegration::int2d!=kind) ) InternalError("So no levelset integration type case (10 2d)"); const Mesh & Th = * GetAny( (*di->Th)(stack) ); ffassert(&Th); if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if (kind==CDomainOfIntegration::int1d) { const QuadratureFormular1d & FI = FIE; if(di->islevelset()) { double llevelset = 0; double uset = HUGE_VAL; R2 Q[3]; KN phi(Th.nv);phi=uset; double f[3]; for(int t=0; t< Th.nt;++t) { double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di->levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10); if(np==2) { const Triangle & K(Th[t]); R2 PA(K(Q[0])),PB(K(Q[1])); R2 NAB(PA,PB); double lAB=sqrt((NAB,NAB)); NAB = NAB.perp()/lAB; llevelset += lAB; for (int npi=0;npiset(Th,K(Pt),Pt,K,-1,NAB,-1); r += lAB*pi.a*GetAny( (*fonc)(stack)); } } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } if(verbosity > 5) cout << " Lenght level set = " << llevelset << endl; } else for( int e=0;eset(Th,K(Pt),Pt,K,Th.bedges[e].lab,R2(E.y,-E.x)/le,ie); r += le*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else if (kind==CDomainOfIntegration::int2d) { const QuadratureFormular & FI =FIT; if(di->islevelset()) { // add FH mars 2014 compute int2d on phi < 0 .. double llevelset = 0; double uset = HUGE_VAL; R2 Q[3]; KN phi(Th.nv);phi=uset; double f[3],umx,umn; for(int t=0; t< Th.nt;++t) { if (all || setoflab.find(Th[t].lab) != setoflab.end()) { const Triangle & K(Th[t]); double umx=-HUGE_VAL,umn=HUGE_VAL; for(int i=0;i<3;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di->levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,phi[j]); umn = std::min(umn,phi[j]); } double area =K.area; if( umn >=0 ) continue; // all positif => nothing if( umx >0 ) { // coupe .. int i0 = 0, i1 = 1, i2 =2; if( f[i0] > f[i1] ) swap(i0,i1) ; if( f[i0] > f[i2] ) swap(i0,i2) ; if( f[i1] > f[i2] ) swap(i1,i2) ; double c = (f[i2]-f[i1])/(f[i2]-f[i0]); // coef Up Traing if( f[i1] < 0 ) {double y=f[i2]/(f[i2]-f[i1]); c *=y*y; } else {double y=f[i0]/(f[i0]-f[i1]) ; c = 1.- (1.-c)*y*y; }; assert( c > 0 && c < 1); area *= 1-c; } // warning quadrature wrong just ok for constante FH, we must also change the quadaturer points .. // just order 1 here ??? for (int npi=0; npiset(Th,K(pi),pi,K,K.lab); r += area*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else for (int i=0;i< Th.nt; i++) { const Triangle & K(Th[i]); if (all || setoflab.find(Th[i].lab) != setoflab.end()) for (int npi=0; npiset(Th,K(pi),pi,K,K.lab); r += K.area*pi.a*GetAny( (*fonc)(stack)); } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else if (kind==CDomainOfIntegration::intalledges) { const QuadratureFormular1d & FI = FIE; for (int i=0;i< Th.nt; i++) if (all || setoflab.find(Th[i].lab) != setoflab.end()) { for( int ie=0;ie<3;ie++) { const Triangle & K(Th[i]); int e0=VerticesOfTriangularEdge[ie][0]; int e1=VerticesOfTriangularEdge[ie][1]; int i1 = Th(K[e0]),i2 = Th(K[e1]); BoundaryEdge * be = Th.TheBoundaryEdge(i1,i2); int lab = be ? be->lab : notaregion; R2 E=K.Edge(ie); double le = sqrt((E,E)); R2 PA(TriangleHat[VerticesOfTriangularEdge[ie][0]]), PB(TriangleHat[VerticesOfTriangularEdge[ie][1]]); for (int npi=0;npiset(Th,K(Pt),Pt,K,lab,R2(E.y,-E.x)/le,ie);// correction FH 6/2/2014 r += le*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else if (kind==CDomainOfIntegration::intallVFedges) { double untier(1./3.); cerr << " a faire CDomainOfIntegration::intallVFedges " << endl; //%%%%%%%%% ffassert(0); const QuadratureFormular1d & FI = FIE; for (int i=0;i< Th.nt; i++) if (all || setoflab.find(Th[i].lab) != setoflab.end()) { const Triangle & K(Th[i]); const R2 GH(untier,untier); const R2 G=K(GH); for( int ie=0;ie<3;ie++) { int ie0=VerticesOfTriangularEdge[ie][0] ; int ie1=VerticesOfTriangularEdge[ie][1] ; const R2 MH=(TriangleHat[ie0]+TriangleHat[ie1])*0.5; const R2 M(K(MH)); R2 E(G,M); double le = sqrt((E,E)); for (int npi=0;npiset(Th,K(Pt),Pt,K,Th[ie].lab,R2(E.y,-E.x)/le,ie,1); r += le*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else { InternalError("CDomainOfIntegration kind unkown"); } } else if(dim==3) { if(di->islevelset() && (CDomainOfIntegration::int2d!=kind) && (CDomainOfIntegration::int3d!=kind) ) InternalError("So no levelset integration type on no int2d / int3d case (10 3d)"); const Mesh3 & Th = * GetAny( (*di->Th)(stack) ); ffassert(&Th); if (verbosity >3) { if (all) cout << " all " << endl ; else cout << endl; } if (kind==CDomainOfIntegration::int2d) if(di->islevelset()) { const GQuadratureFormular & FI = FIT; double llevelset = 0; const double uset = std::numeric_limits::max(); // cout << " uset ="< phi(Th.nv); phi=uset; double f[4]; for(int t=0; t< Th.nt;++t) { double umx=std::numeric_limits::min(),umn=std::numeric_limits::max(); for(int i=0;i<4;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di->levelset(stack);//zzzz } f[i]=phi[j]; umx = std::max(umx,f[i]); umn = std::min(umn,f[i]); } if( umn <=0 && umx >= 0) { int np= IsoLineK(f,Q,1e-10); double l[3]; if(np>2) { if(verbosity>999) cout << t << " int levelset : " << umn << " .. " << umx << " np " << np <<" " << f[0] << " " << f[1] << " "<< f[2] << " "<< f[3] << " "< pi( FI[npi]); pi.toBary(l); R3 Pt( l[0]*Q[i0]+l[1]*Q[i1]+l[2]*Q[i2]); // MeshPointStack(stack)->set(Th,K(Pt),Pt,K,-1,NN,-1); r += mes*pi.a*GetAny( (*fonc)(stack)); } } } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } if(verbosity > 5) cout << " Area level set = " << llevelset << endl; // if(verbosity > 50) cout << "phi " << phi << endl; } else { const GQuadratureFormular & FI = FIT; int lab; for( int e=0;e pi( FI[npi]); R3 Pt(K.PBord(ie,pi)); // MeshPointStack(stack)->set(Th,K(Pt),Pt,K,lab,NN,ie); r += mes*pi.a*GetAny( (*fonc)(stack)); } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } } else if (kind==CDomainOfIntegration::int3d) { if(di->islevelset()) { // int3d levelset < 0 GQuadratureFormular FI(FIV.n*3); double llevelset = 0; const double uset = std::numeric_limits::max(); // cout << " uset ="< phi(Th.nv); phi=uset; double f[4]; for (int t=0;t< Th.nt; t++) { const Mesh3::Element & K(Th[t]); if (all || setoflab.find(K.lab) != setoflab.end()) { double umx=std::numeric_limits::min(),umn=std::numeric_limits::max(); for(int i=0;i<4;++i) { int j= Th(t,i); if( phi[j]==uset) { MeshPointStack(stack)->setP(&Th,t,i); phi[j]= di->levelset(stack);//zzzz } f[i]=phi[j]; } int ntets= UnderIso(f,Q, vol6,1e-14); setQF(FI,FIV,QuadratureFormular_Tet_1, Q,vol6,ntets); for (int npi=0; npi pi(FI[npi]); MeshPointStack(stack)->set(Th,K(pi),pi,K,K.lab); r += K.mesure()*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else { const GQuadratureFormular & FI =FIV; for (int i=0;i< Th.nt; i++) { const Mesh3::Element & K(Th[i]); if (all || setoflab.find(K.lab) != setoflab.end()) for (int npi=0; npi pi(FI[npi]); MeshPointStack(stack)->set(Th,K(pi),pi,K,K.lab); r += K.mesure()*pi.a*GetAny( (*fonc)(stack)); } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } } else if (kind==CDomainOfIntegration::intalledges) { const GQuadratureFormular & FI = FIT; int lab; for (int i=0;i< Th.nt; i++) if (all || setoflab.find(Th[i].lab) != setoflab.end()) for( int ie=0;ie<4;ie++) // Coorection mai 2018 FH ???????????????? never tested { const Mesh3::Element & K(Th[i]); R3 NN=K.N(ie); double mes = NN.norme(); NN /= mes; mes*=0.5;// correction 05/01/09 FH for (int npi=0;npi pi( FI[npi]); R3 Pt(K.PBord(ie,pi)); // MeshPointStack(stack)->set(Th,K(Pt),Pt,K,lab,NN,ie); r += mes*pi.a*GetAny( (*fonc)(stack)); } } wsptr2free->clean(swsptr2free);// ADD FH 11/2017 } } else { InternalError("CDomainOfIntegration dim unkown");} *MeshPointStack(stack)=mp; return SetAny(r); } void Show(const char * s,int k=1) { if(k) { couleur(1); float xmin,xmax,ymin,ymax; getcadre(xmin,xmax,ymin,ymax); rmoveto(xmin+(xmax-xmin)/100,ymax-(k)*(ymax-ymin)/30); plotstring(s); // couleur(1); } } template int Send2d(PlotStream & theplot,Plot::ListWhat & lli,map & mapth) { typedef FEbase * pfek ; pfek fe[3]={0,0,0}; int cmp[3]={-1,-1,-1}; int err=1; long what=lli.what; int lg,nsb; lli.eval(fe,cmp); if (fe[0]->x() && what %10 ==1) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage KN V1=fe[0]->Vh->newSaveDraw(*fe[0]->x(),cmp[0],lg,nsb); // construction of the sub division ... int nsubT=NbOfSubTriangle(nsb); int nsubV=NbOfSubInternalVertices(nsb); KN Psub(nsubV); KN Ksub(nsubT*3); for(int i=0;i9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " Max " << V1.max() << " min " << V1.min() << endl; theplot << Psub ; theplot << Ksub ; theplot << V1; // theplot << (long) nsb<< V1; } else if (fe[0]->x() && fe[1]->x() &&what %10 ==2) { { err=0; theplot << what ; KN V1=fe[0]->Vh->newSaveDraw(*fe[0]->x(),*fe[1]->x(),cmp[0],cmp[1],lg,nsb); // construction of the sub division ... int nsubT=NbOfSubTriangle(nsb); int nsubV=NbOfSubInternalVertices(nsb); KN Psub(nsubV); KN Ksub(nsubT*3); for(int i=0;iVh->Th)];// numero du maillage theplot << Psub ; theplot << Ksub ; theplot << V1; // theplot << (long) nsb<< V1; } } return err; } template int Send3d(PlotStream & theplot,Plot::ListWhat &lli,map &mapth3) { typedef FEbase * pfek3 ; pfek3 fe3[3]={0,0,0}; int cmp[3]={-1,-1,-1}; int err=1; long what=lli.what; int lg,nsb; if (what%10==6) { int lg,nsb; lli.eval(fe3,cmp); // FFCS is able to display 3d complex data //if(what==6) { if (fe3[0]->x()) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage // KN GFESpace::newSaveDraw(const KN_ & U,int composante,int & lg, // KN &Psub,KN &Ksub,int op_U) const KN Psub; KN Ksub; KN V1=fe3[0]->Vh->newSaveDraw(*fe3[0]->x(),cmp[0],lg,Psub,Ksub,0); if(verbosity>9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " " << V1.max() << " " << V1.min() << endl; theplot << Psub ; theplot << Ksub ; theplot << V1; } } } else if (what%10==7) { int lg,nsb; lli.eval(fe3,cmp); // FFCS is able to display 3d complex data //if(what==7) // ve { if (fe3[0]->x()&& fe3[1]->x() && fe3[2]->x()) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage // KN GFESpace::newSaveDraw(const KN_ & U,int composante,int & lg, // KN &Psub,KN &Ksub,int op_U) const KN Psub1,Psub2,Psub3; // bf Bof ... KN Ksub1,Ksub2,Ksub3; KN V1=fe3[0]->Vh->newSaveDraw(*fe3[0]->x(),cmp[0],lg,Psub1,Ksub1,0); KN V2=fe3[1]->Vh->newSaveDraw(*fe3[1]->x(),cmp[1],lg,Psub2,Ksub2,0); KN V3=fe3[2]->Vh->newSaveDraw(*fe3[2]->x(),cmp[2],lg,Psub3,Ksub3,0); if(verbosity>9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " " << V1.max() << " " << V1.min() << endl; theplot << Psub1 ; theplot << Ksub1 ; ffassert( V1.N() == V2.N() &&V1.N() == V3.N()); KNM V123(3,V1.N()); // warning fortran numbering ... V123(0,'.')=V1; V123(1,'.')=V2; V123(2,'.')=V3; // FFCS: should be able to deal with complex as well theplot << (KN_&) V123; } } } return err; } // missing function inline void NewSetColorTable(int nb,float *colors=0,int nbcolors=0,bool hsv=true) { if(colors && nbcolors) SetColorTable1(nb,hsv,nbcolors,colors); else SetColorTable(nb); } /// <> from class [[Plot]] AnyType Plot::operator()(Stack s) const{ // remap case 107 and 108 , 109 for array of FE. vector ll; vector lat; ll.reserve(l.size()); // generation de la list de plot ... for (size_t i=0;i * ath; //pmesh th; //int cmp0=0,cmp1=1,cmp2=2; switch (l[i].what) { case 3: l[i].EvalandPush(s,i,ll,lat); break; case 0: case 5: l[i].EvalandPush(s,i,ll); break; case 1: case 2: case 6 : case 7 : case 11: case 12: case 16 : case 17 : l[i].EvalandPush(s,i,ll);break; case 100 : l[i].MEvalandPush< pmesh>(s,i,ll);break; case 105 : l[i].MEvalandPush< pmesh3>(s,i,ll);break; case 101 : l[i].AEvalandPush(s,i,ll);break; case 106 : l[i].AEvalandPush(s,i,ll);break; case 111: l[i].AEvalandPush(s,i,ll);break; case 116: l[i].AEvalandPush(s,i,ll);break; case 103 : l[i].AEvalandPush(s,i,ll,lat); break; default: ffassert(l[i].what<100) ; // missing piece of code FH (jan 2010) ... ll.push_back(ListWhat(l[i].what,i)); break; } } if(ThePlotStream) { /* les different item of the plot are given by the number what: what = 0 -> mesh what = 1 -> scalar field (FE function 2d) what = 2 -> 2d vector field (two FE function 2d) what = 3 -> curve def by 2,.., 4 array what = 13 -> curve def by 4 array : x,y,z, value for color ... what = 4 -> border what = 5 3d meshes what = 6 FE function 3d what = 100,101,106 // remap ... what = 7 => 3d vector field (tree FE function 3d) what = 8 ??? what = -1 -> error, item empty */ PlotStream theplot(ThePlotStream); pferbase fe[3]={0,0,0}; pf3rbase fe3[3]={0,0,0}; double echelle=1; int cmp[3]={-1,-1,-1}; theplot.SendNewPlot(); if (nargs[0]) (theplot<< 0L) <= GetAny((*nargs[0])(s)); if (nargs[1]) (theplot<< 1L) <= GetAny((*nargs[1])(s)); if (nargs[2]) (theplot<< 2L) <= GetAny((*nargs[2])(s)); if (nargs[3]) (theplot<< 3L) <= (bool) (!NoWait && GetAny((*nargs[3])(s))); else (theplot<< 3L) <= (bool) (TheWait&& !NoWait); if (nargs[4]) (theplot<< 4L) <= GetAny((*nargs[4])(s)); if (nargs[5]) (theplot<< 5L) <= GetAny((*nargs[5])(s)); if (nargs[6]) (theplot<< 6L) <= GetAny((*nargs[6])(s)); if (nargs[7]) (theplot<< 7L) <= GetAny((*nargs[7])(s)); if (nargs[8]) { KN bbox(4); for (int i=0;i<4;i++) bbox[i]= GetAny((*bb[i])(s)); (theplot<< 8L) <= bbox ; } if (nargs[9]) (theplot<< 9L) <= GetAny((*nargs[9])(s)); if (nargs[10]) (theplot<< 10L) <= GetAny((*nargs[10])(s)); if (nargs[11]) { KN_ v =GetAny >((*nargs[11])(s)) ; (theplot<< 11L) <= v ;} if (nargs[12]) (theplot<< 12L) <= GetAny >((*nargs[12])(s)) ; if (nargs[13]) (theplot<< 13L) <= GetAny((*nargs[13])(s)); if (nargs[14]) (theplot<< 14L) <= GetAny((*nargs[14])(s)); if (nargs[15]) (theplot<< 15L) <= GetAny >((*nargs[15])(s)); if (nargs[16]) (theplot<< 16L) <= GetAny((*nargs[16])(s)); // add frev 2008 FH for 3d plot ... if (nargs[17]) (theplot<< 17L) <= GetAny((*nargs[17])(s)); if (nargs[18]) (theplot<< 18L) <= GetAny((*nargs[18])(s)); if (nargs[19]) (theplot<< 19L) <= GetAny((*nargs[19])(s)); if (nargs[20]) (theplot<< 20L) <= (echelle=GetAny((*nargs[20])(s))); // FFCS: extra plot options for VTK (indexed from 1 to keep these lines unchanged even if the number of standard // FF parameters above changes) received in [[file:../ffcs/src/visudata.cpp::receiving_plot_parameters]]. When // adding a parameter here, do _NOT_ forget to change the size of the array at // [[number_of_distinct_named_parameters_for_plot]] and to name the new parameters at [[Plot_name_param]]. Also // update the list of displayed values at [[file:../ffcs/src/plot.cpp::Plotparam_listvalues]] and read the // parameter value from the pipe at [[file:../ffcs/src/visudata.cpp::receiving_plot_parameters]]. #define VTK_START 20 #define SEND_VTK_PARAM(index,type) \ if(nargs[VTK_START+index]) \ (theplot<<(long)(VTK_START+index)) \ <=GetAny((*nargs[VTK_START+index])(s)); SEND_VTK_PARAM(1,double); // ZScale SEND_VTK_PARAM(2,bool); // WhiteBackground SEND_VTK_PARAM(3,bool); // OpaqueBorders SEND_VTK_PARAM(4,bool); // BorderAsMesh SEND_VTK_PARAM(5,bool); // ShowMeshes SEND_VTK_PARAM(6,long); // ColorScheme SEND_VTK_PARAM(7,long); // ArrowShape SEND_VTK_PARAM(8,double); // ArrowSize SEND_VTK_PARAM(9,long); // ComplexDisplay SEND_VTK_PARAM(10,bool); // LabelColors SEND_VTK_PARAM(11,bool); // ShowAxes SEND_VTK_PARAM(12,bool); // CutPlane SEND_VTK_PARAM(13,KN_); // CameraPosition SEND_VTK_PARAM(14,KN_); // CameraFocalPoint SEND_VTK_PARAM(15,KN_); // CameraViewUp SEND_VTK_PARAM(16,double); // CameraViewAngle SEND_VTK_PARAM(17,KN_); // CameraClippingRange SEND_VTK_PARAM(18,KN_); // CutPlaneOrigin SEND_VTK_PARAM(19,KN_); // CutPlaneNormal SEND_VTK_PARAM(20,long); // WindowIndex SEND_VTK_PARAM(21,long); // NbColorTicks SEND_VTK_PARAM(22,long); // NbColors theplot.SendEndArgPlot(); map mapth; map mapth3; long kth=0,kth3=0; // send all the mesh: for (size_t ii=0;iix()) th=&fe[0]->Vh->Th; if(fe[1] && fe[1]->x()) { ffassert(th == &fe[1]->Vh->Th); // assert(th); }; } else if (what==6 || what==7|| what==16 || what==17) { ll[ii].eval(fe3,cmp); if (fe3[0]->x()) th3=&fe3[0]->Vh->Th; if (fe3[1]) ffassert(th3 == &fe3[1]->Vh->Th); if (fe3[2]) ffassert(th3 == &fe3[2]->Vh->Th); } if(th && mapth.find(th)==mapth.end()) mapth[th]=++kth; if(th3 && (mapth3.find(th3)==mapth3.end())) mapth3[th3]=++kth3; } theplot.SendMeshes(); theplot << kth ; for (map::const_iterator i=mapth.begin();i != mapth.end(); ++i) { theplot << i->second << * i->first ; } // 3d meshes if(kth3) { theplot.SendMeshes3(); theplot << kth3 ; for (map::const_iterator i=mapth3.begin();i != mapth3.end(); ++i) { theplot << i->second << * i->first ; } } theplot.SendPlots(); theplot <<(long) ll.size(); for (size_t ii=0;ii( theplot,ll[ii] ,mapth); else if (what==11 || what==12 ) err = Send2d( theplot,ll[ii] ,mapth); /* { int lg,nsb; ll[ii].eval(fe,cmp); if(what==1) { if (fe[0]->x()) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage KN V1=fe[0]->Vh->newSaveDraw(*fe[0]->x(),cmp[0],lg,nsb); // construction of the sub division ... int nsubT=NbOfSubTriangle(nsb); int nsubV=NbOfSubInternalVertices(nsb); KN Psub(nsubV); KN Ksub(nsubT*3); for(int i=0;i9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " " << V1.max() << " " << V1.min() << endl; theplot << Psub ; theplot << Ksub ; theplot << V1; // theplot << (long) nsb<< V1; } } else { if ( fe[0]->x() && fe[1]->x()) { err=0; theplot << what ; KN V1=fe[0]->Vh->newSaveDraw(*fe[0]->x(),*fe[1]->x(),cmp[0],cmp[1],lg,nsb); // construction of the sub division ... int nsubT=NbOfSubTriangle(nsb); int nsubV=NbOfSubInternalVertices(nsb); KN Psub(nsubV); KN Ksub(nsubT*3); for(int i=0;iVh->Th)];// numero du maillage theplot << Psub ; theplot << Ksub ; theplot << V1; // theplot << (long) nsb<< V1; } } }*/ else if (what==3 || what==13 ) { what=13; theplot << what ; // KN z0; if(verbosity>99) cout << " sendplot curve "<< what << " " << ii ; for(int k=0; k<4; ++k) { int ilat=ll[ii].l[k]; if (ilat>=0) { KN_ t = GetAny >(lat[ilat]); theplot << t; if(verbosity>99) cout << " (" << k <<" " << ilat << ") " << t.N(); } else theplot << z0;// empty arry ... } if(verbosity>99) cout <SavePlot(s,theplot); } else if(what ==5) { pTh3=&l[i].evalm3(0,s); if(pTh3) { err=0; theplot << what ; theplot <( theplot,ll[ii] ,mapth3); else if (what==16 || what==17 ) err = Send3d( theplot,ll[ii] ,mapth3); /* { int lg,nsb; ll[ii].eval(fe3,cmp); if(what==6) { if (fe3[0]->x()) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage // KN GFESpace::newSaveDraw(const KN_ & U,int composante,int & lg, // KN &Psub,KN &Ksub,int op_U) const KN Psub; KN Ksub; KN V1=fe3[0]->Vh->newSaveDraw(*fe3[0]->x(),cmp[0],lg,Psub,Ksub,0); if(verbosity>9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " " << V1.max() << " " << V1.min() << endl; theplot << Psub ; theplot << Ksub ; theplot << V1; } } } else if (what==7) { int lg,nsb; ll[ii].eval(fe3,cmp); if(what==7) // ve { if (fe3[0]->x()&& fe3[1]->x() && fe3[2]->x()) { err=0; theplot << what ; theplot <Vh->Th)];// numero du maillage // KN GFESpace::newSaveDraw(const KN_ & U,int composante,int & lg, // KN &Psub,KN &Ksub,int op_U) const KN Psub1,Psub2,Psub3; // bf Bof ... KN Ksub1,Ksub2,Ksub3; KN V1=fe3[0]->Vh->newSaveDraw(*fe3[0]->x(),cmp[0],lg,Psub1,Ksub1,0); KN V2=fe3[1]->Vh->newSaveDraw(*fe3[1]->x(),cmp[1],lg,Psub2,Ksub2,0); KN V3=fe3[2]->Vh->newSaveDraw(*fe3[2]->x(),cmp[2],lg,Psub3,Ksub3,0); if(verbosity>9) cout << " Send plot:what: " << what << " " << nsb << " "<< V1.N() << " " << V1.max() << " " << V1.min() << endl; theplot << Psub1 ; theplot << Ksub1 ; ffassert( V1.N() == V2.N() &&V1.N() == V3.N()); KNM V123(3,V1.N()); // warning fortran numbering ... V123(0,'.')=V1; V123(1,'.')=V2; V123(2,'.')=V3; theplot << (KN_&) V123; } } }*/ else ffassert(0);// erreur type theplot inconnue if(err==1) { if(verbosity) cerr << "Warning: May be a bug in your script, \n" << " a part of the plot is wrong t (mesh or FE function, curve) => skip the item " << i+1 << " in plot command " << endl; theplot << -1L << (long) i ; } } theplot.SendEndPlot(); } if (!withrgraphique) {initgraphique();withrgraphique=true;} viderbuff(); MeshPoint *mps=MeshPointStack(s),mp=*mps ; int nbcolors=0; float *colors=0; bool hsv=true; // hsv type R boundingbox[4]; double coeff=1; bool wait=TheWait; bool value=false; bool fill=false; bool aspectratio=false; bool clean=true; bool uaspectratio=false; bool pViso=false,pVarrow=false; int Niso=20,Narrow=20; double ArrowSize=-1; // PPPPP KN Viso,Varrow; bool bw=false; string * psfile=0; string * cm=0; pferbase fe=0,fe1=0; int cmp0,cmp1; bool grey=getgrey(); bool greyo=grey; bool drawborder=true; if (nargs[0]) coeff= GetAny((*nargs[0])(s)); if (nargs[1]) cm = GetAny((*nargs[1])(s)); if (nargs[2]) psfile= GetAny((*nargs[2])(s)); if (nargs[3]) wait= GetAny((*nargs[3])(s)); if (nargs[4]) fill= GetAny((*nargs[4])(s)); if (nargs[5]) value= GetAny((*nargs[5])(s)); if (nargs[6]) clean= GetAny((*nargs[6])(s)); if (nargs[7]) uaspectratio=true,uaspectratio= GetAny((*nargs[7])(s)); if (nargs[8]) for (int i=0;i<4;i++) boundingbox[i]= GetAny((*bb[i])(s)); if (nargs[9]) Niso= GetAny((*nargs[9])(s)); if (nargs[10]) Narrow= GetAny((*nargs[10])(s)); if (nargs[11]) { KN_ v =GetAny >((*nargs[11])(s)) ; Niso=v.N(); Viso.init(Niso); Viso=v; pViso=true;} if (nargs[12]) { KN_ v =GetAny >((*nargs[12])(s)) ; Niso=v.N(); Varrow.init(Niso); Varrow=v; pVarrow=true; } if (nargs[13]) bw= GetAny((*nargs[13])(s)); if (nargs[14]) grey= GetAny((*nargs[14])(s)); if (nargs[15]) { KN_ cc= GetAny >((*nargs[15])(s)); nbcolors= cc.N()/3; if ( nbcolors > 1&& nbcolors < 100) { colors = new float [nbcolors*3]; for (int i=0; i<3*nbcolors; i++) colors[i]=cc[i]; } else nbcolors = 0; } if (nargs[16]) drawborder= GetAny((*nargs[16])(s)); int dimplot=2; if (nargs[17]) dimplot= GetAny((*nargs[17])(s)); bool addtoplot=false, keepPV=false; if (nargs[18]) addtoplot= GetAny((*nargs[18])(s)); if (nargs[19]) keepPV= GetAny((*nargs[19])(s)); if (nargs[VTK_START+8]) ArrowSize = GetAny((*nargs[VTK_START+8])(s)); // for the gestion of the PTR. WhereStackOfPtr2Free(s)=new StackOfPtr2Free(s);// FH aout 2007 setgrey(grey); if (Viso.unset()) Viso.init(Niso); if (Varrow.unset()) Varrow.init(Narrow); // KN Viso(Niso); // KN Varrow(Narrow); // if (pViso) Viso=*pViso; // if (pVarrow) Varrow=*pVarrow; const Mesh * cTh=0; bool vecvalue=false,isovalue=false; bool ops=psfile; bool drawmeshes=false; if ( clean ) { // ALH - 28/3/15 - Open PS file before blanking the current picture because Javascript needs to know any "ps=" // parameter to send the graphical commands to the right canvas. if (psfile) { // [[file:../Graphics/sansrgraph.cpp::openPS]] openPS(psfile->c_str()); } reffecran(); if (bw) NoirEtBlanc(1); R2 Pmin,Pmax; R2 uminmax(1e100,-1e100); R2 Vminmax(1e100,-1e100); bool first=true; for (size_t ii=0;iix()) continue; //int nb=fe->x()->N(); fe->Vh->cmesh->BoundingBox(P1,P2); cTh=fe->Vh->cmesh; if (fe1==0) uminmax = minmax(uminmax,fe->Vh->MinMax(*fe->x(),cmp0)); else { if (fe1) { if (fe->Vh == fe1->Vh) { KN_ u( *fe->x()),v(*fe1->x()); Vminmax = minmax(Vminmax,fe->Vh->MinMax(u,v,cmp0,cmp1)); } else cerr << " On ne sait tracer que de vecteur sur un meme type element finite. " << endl; } } } else if (l[i].what==0) { if( !uaspectratio) aspectratio= true; const Mesh & Th= *ll[ii].th(); Th.BoundingBox(P1,P2); cTh=&Th; } else if (l[i].what==4) { if( !uaspectratio) aspectratio= true; const E_BorderN * Bh= l[i].evalb(0,s); Bh->BoundingBox(s,P1.x,P2.x,P1.y,P2.y); } else if (l[i].what==3) { tab ttx=l[i].evalt(0,s); tab tty=l[i].evalt(1,s); tab *tx=&ttx,*ty=&tty; P1=R2(tx->min(),ty->min()); P2=R2(tx->max(),ty->max()); if(verbosity>2) cout << "Plot: bound Pmin=" << P1 << ", Pmax=" << P2 << endl; } else continue; if (first) {first=false; Pmin=P1;Pmax=P2;} else { Pmin.x = Min(Pmin.x,P1.x); Pmin.y = Min(Pmin.y,P1.y); Pmax.x = Max(Pmax.x,P2.x); Pmax.y = Max(Pmax.y,P2.y); } } { R umx=uminmax.y,umn=uminmax.x; if (verbosity>5) cout << " u bound " << uminmax << " V : " << Vminmax <1) cout << "Plot bound [x,y] " << Pmin << " max [x,y] " << Pmax << endl; int N=Viso.N(); int Na=Varrow.N(); R2 O((Pmin+Pmax)/2); R rx(Pmax.x-Pmin.x),ry(Pmax.y-Pmin.y); // bug version 1.41 correct FH to remove div by zero. rx = Max(rx,1e-30); ry = Max(ry,1e-30); // -- end correction R r = (Max(rx,ry)*0.55); showgraphic(); if (aspectratio) cadreortho((float)O.x,(float)(O.y+r*0.05),(float) r); else cadre( (float)(O.x-rx*.55),(float)(O.x+rx*0.55),(float)(O.y-ry*.55),(float)(O.y+ry*.55)); R d = fill ? (umx-umn)/(N-1) : (umx-umn)/(N); R x = fill ? umn-d/2 :umn+d/2; if (!pViso) for (int i = 0;i < N;i++) {Viso[i]=x;x +=d; } if (fill && !pViso) {Viso[0]=umn-d;Viso[N-1]=umx+d;} x=0; d= sqrt(Vminmax.y)/(Na-1.001); if (!pVarrow) for (int i = 0;i < Na;i++) {Varrow[i]=x;x +=d; } SetColorTable(Max(N,Na)+4) ; } } // clean float xx0,xx1,yy0,yy1; if (nargs[8]) { xx0=min(boundingbox[0],boundingbox[2]); xx1=max(boundingbox[0],boundingbox[2]); yy0=min(boundingbox[1],boundingbox[3]); yy1=max(boundingbox[1],boundingbox[3]); if (verbosity>2) cout << "bb= xmin =" << xx0 << ", max =" << xx1 << ", ymin = " << yy0 << ", ymax = " << yy1 << endl; if (aspectratio) cadreortho((xx0+xx1)*0.5,(yy0+yy1)*0.5, max(xx1-xx0,yy1-yy0)*0.5); else cadre(xx0,xx1,yy0,yy1); } getcadre(xx0,xx1,yy0,yy1); const R ccoeff=coeff; bool plotting = true; // drawing part ------------------------------ while (plotting) { if(verbosity>99) cout << "plot::operator() Drawing part \n"; plotting = false; bool thfill=fill; for (size_t ii=0;iiDraw(0,thfill); else ll[ii].th()->Draw(0,thfill); else if (what==1 || what==2) { ll[ii].eval(fe,cmp0,fe1,cmp1); // fe= l[i].eval(0,s,cmp0); // fe1= l[i].eval(1,s,cmp1);; if (!fe->x()) continue; #ifdef VVVVVVV cout << " Min = " << fe->x->min() << " max = " << fe->x->max() ; if(fe1 && verbosity > 1) cout << " Min = " << fe1->x->min() << " max = " << fe1->x->max() ; cout << endl; #endif if (fe1) { if (fe->Vh == fe1->Vh) vecvalue=true,fe->Vh->Draw(*fe->x(),*fe1->x(),Varrow,coeff,cmp0,cmp1,colors,nbcolors,hsv,drawborder,ArrowSize); else cerr << " Draw only vector field on same Finites Element , Sorry. " << endl; if (drawmeshes) fe->Vh->Th.Draw(0,fill); } else if (fill) isovalue=true,fe->Vh->Drawfill(*fe->x(),Viso,cmp0,1.,colors,nbcolors,hsv,drawborder); else isovalue=true,fe->Vh->Draw(*fe->x(),Viso,cmp0,colors,nbcolors,hsv,drawborder); if (drawmeshes) fe->Vh->Th.Draw(0,fill); } else if (l[i].what==4) { const E_BorderN * Bh= l[i].evalb(0,s); Bh->Plot(s); } else if(l[i].what==3) { penthickness(6); tab x=l[i].evalt(0,s); tab y=l[i].evalt(1,s); KN pz0; KN_ z(pz0), v(pz0); if (l[i].e[2]) { z.set(l[i].evalt(2,s));} if (l[i].e[3]) { v.set(l[i].evalt(3,s));} long k= Min(x.N(),y.N()); bool colored= (v.N()==k); // if(colored) NewSetColorTable(Viso.N()+4,colors,nbcolors,hsv); // cout << " a faire " << endl; // cout << " plot :\n" << * l[i].evalt(0,s) << endl << * l[i].evalt(1,s) << endl; rmoveto(x[0],y[0]); couleur(2+i); for (int i= 1;iN() , pty->N()); for( int j=0; jc_str(),0.1,0.97); } if (ops ) { ops=false; closePS(); } if (wait && ! NoWait) { next: float x,y,x0,y0,x1,y1,dx,dy,coef=1.5; getcadre(x0,x1,y0,y1); char c=Getxyc(x,y); dx=(x1-x0)/2.;dy=(y1-y0)/2.; switch (c) { case '+' : plotting=true; cadre(x-dx/coef,x+dx/coef,y-dy/coef,y+dy/coef);reffecran(); break; case '-' : plotting=true; cadre(x-dx*coef,x+dx*coef,y-dy*coef,y+dy*coef);;reffecran(); break; case '=' : plotting=true; coeff=ccoeff; cadre(xx0,xx1,yy0,yy1);;reffecran(); break; case 'r' : plotting=true; reffecran(); break; case 'a' : case 'c' : coeff /= 1.5; plotting=true;reffecran(); reffecran(); break; case 'A' : case 'C' : coeff *= 1.5; plotting=true; reffecran(); break; case 'b' : bw= !bw;NoirEtBlanc(bw) ; plotting=true; reffecran(); break; case 'v' : value = !value ; plotting=true; reffecran(); break; case 'f' : fill = !fill ; plotting=true; reffecran(); break; case 'g' : setgrey(grey=!getgrey()); plotting=true; reffecran(); break; case 'm' : reffecran(); drawmeshes= !drawmeshes; plotting=true; break; case 'p' : plotting=true; reffecran(); ops=true; openPS(0); plotting=true; break; case 'q' : couleur(8); #ifdef DRAWING if (cTh) cTh->quadtree->Draw(); #endif couleur(1); goto next; case 's' : if(cTh) { R2 P(x,y),PF(P),Phat; bool outside; const Vertex * v=cTh->quadtree->NearestVertexWithNormal(P); if (!v) v=cTh->quadtree->NearestVertex(P); else { couleur(2); const Triangle * t= cTh->Find( PF, Phat,outside,&(*cTh)[cTh->Contening(v)]) ; t->Draw(0.8); couleur(2); PF=(*t)(Phat); DrawMark(PF,0.003); } couleur(5); DrawMark(P,0.0015); couleur(1); if (v) DrawMark(*v,0.005); goto next;} case '?': int i=2; reffecran(); //Show("Enter a keyboard character in graphic window to do :",i++); Show("Enter a keyboard character in the FreeFem Graphics window in order to:",i++); i+=2; //Show("+) zomm around the cursor 3/2 times ",i++); Show("+) zoom in around the cursor 3/2 times ",i++); Show("-) zoom out around the cursor 3/2 times ",i++); //Show("-) unzomm around the cursor 3/2 times ",i++) ; Show("=) reset zooming ",i++); Show("r) refresh plot ",i++); Show("ac) increase the size arrow ",i++); Show("AC) decrease the size arrow ",i++); Show("b) switch between black and white or color plotting ",i++); Show("g) switch between grey or color plotting ",i++); Show("f) switch between filling iso or not ",i++); Show("v) switch between show the numerical value of iso or not",i++); Show("p) save plot in a Postscprit file",i++); Show("m) switch between show meshes or not",i++); Show("p) switch between show quadtree or not (for debuging)",i++); Show("t) find Triangle ",i++); Show("?) show this help window",i++); Show("any other key : continue ",++i); goto next; } if (!pViso || !pVarrow) { // recompute the iso bound R2 uminmax(1e100,-1e100); R2 Vminmax(1e100,-1e100); for (size_t i=0;ix()) continue; // int nb=fe->x()->N(); if (fe1==0) uminmax = minmax(uminmax,fe->Vh->MinMax(*fe->x(),cmp0,false)); else { if (fe1) if (fe->Vh == fe1->Vh) { KN_ u( *fe->x()),v(*fe1->x()); Vminmax = minmax(uminmax,fe->Vh->MinMax(u,v,cmp0,cmp1,false)); } } } else continue; } if (verbosity>5) cout << " u bound " << uminmax << endl; R umx=uminmax.y,umn=uminmax.x; int N=Viso.N(); int Na=Varrow.N(); R d = fill ? (umx-umn)/(N-1) : (umx-umn)/(N); R x = fill ? umn-d/2 :umn+d/2; if (!pViso) for (int i = 0;i < N;i++) {Viso[i]=x;x +=d; } if (fill && !pViso) {Viso[0]=umn-d;Viso[N-1]=umx+d;} x=0; d= sqrt(Vminmax.y)/Na; if (!pVarrow) for (int i = 0;i < Na;i++) {Varrow[i]=x;x +=d; } } } *mps=mp; } // end plotting NoirEtBlanc(0) ; setgrey(greyo); if (colors) delete[] colors; // modif mars 2006 auto stack ptr // if (cm) delete cm; // if (psfile) delete psfile; viderbuff(); return 0L; } AnyType Convect::operator()(Stack s) const { if(d==2) return eval2(s); else return eval3(s); } AnyType Convect::eval2(Stack s) const { MeshPoint* mp(MeshPointStack(s)),mpc(*mp); MeshPointStack(s,&mpc);// P ptr on variable mpc ... static MeshPoint mpp,mps; static int stateold=0; static int count =0; static R ddtp=0; R ddt = GetAny((*dt)(s)); if (ddt) { if( (stateold == state) && (ddt==ddtp) && (*mp==mpp ) )// optim same convect at same point nov/2015 { if( verbosity > 3 && count++ < 10) cout <<" -- optim convect " <T << " chi(P) = " << mps.P << ","<< mps.T < 3 && count++ < 10*10) cout <<" -- no optim convect " < velocity too high ???? or NaN F. Hecht " << endl; ffassert(0); } } mpc.change(R2(l[1],l[2]),Th[it],0); mpp=*mp;// previous value mps=mpc;// convect value } } // warning use poit on &mpc .. bug correct in dec 2015 F.H. AnyType r= (*ff)(s); if( verbosity > 3 && count++ < 10*10) cout << " %%%r= "<< GetAny(r) << " P= " << mp->P << ", "<< mp->T << endl; MeshPointStack(s,mp);// restor old pointeur .. return r; } inline int FindandAdd(set *st,vector & lst,int k) { if(lst.size() < 10) { } return 0; } AnyType Convect::eval3old(Stack s) const { extern long newconvect3; if(newconvect3) return eval3(s);// New Convect in test MeshPoint* mp(MeshPointStack(s)),mpc(*mp); MeshPointStack(s,&mpc);// P ptr on variable mpc ... static MeshPoint mpp,mps;// previous state .. static int stateold=0; static int count =0; static R ddtp=0; randwalk(-1); // init randwalk // set *st=0; // vector lst; R ddt = GetAny((*dt)(s)); if (ddt) { bool ddd=verbosity>1000; if( (stateold == state) && (ddt==ddtp) && (*mp==mpp ) )// optim same convect at same point nov/2015 { if( verbosity > 3 && count++ < 10) cout <<" -- optim convect3 " < 3 && count++ < 10*10) cout <<" -- no optim3 convect " <((*u)(s)),GetAny((*v)(s)),GetAny((*w)(s))),ddt))>=0) if(j>3) { it=j-4; mpc.change(PHat,Th3[it],0); if(ddd) cout << " **P= "<< (*mpc.T3)(PHat) << " , Ph " << PHat << " : j = " << j << " it: " << it << "ddt=" << ddt ; if(ddt==0) break; // finish ... } else { if(ddd) cout << "P= "<< (*mpc.T3)(PHat) << " , Ph " << PHat << " : j = " << j << " it: " << it ; #ifdef DEBUG R3 Po=(*mpc.T3)(PHat),Pho=PHat; int ito=it; #endif int itt = Th3.ElementAdj(it,j,PHat); if(ddd && itt>=0) cout << " -> " << itt << " " << j << " : Pn " << Th3[itt](PHat) << " PHn " << PHat << " , " << ddt << endl; if(itt<0) break; it=itt; mpc.change(PHat,Th3[it],0); #ifdef DEBUG if(((Po-mpc.P).norme2() > 1e-10)) { cout << ito << " " << &Th3[ito][0] << " " << &Th3[ito][1] << " " << &Th3[ito][2] << " " << &Th3[ito][3] << " " << endl; cout << it << " " << &Th3[it][0] << " " << &Th3[it][1] << " " << &Th3[it][2] << " " << &Th3[it][3] << endl; cout << Pho << "o Hat " << PHat << endl; cout << Po << " o != " << mpc.P << " diff= "<< (Po-mpc.P).norme2() < *st=0; // vector lst; R3 offset; R ddt = GetAny((*dt)(s)); if (ddt) { bool ddd=verbosity>1000; if(*mp==mpp && ddt == ddts) mpc=mps; else { const Mesh3 & Th3(*mp->Th3); ffassert(mp->Th3 && mp->T3); R3 PHat=mpc.PHat; int k=0; int j; int it=Th3(mpc.T3); if(ddd) cout << " IN: " << (*mpc.T3)(PHat) << " ; " << mpc.P <<" : " << ddt << endl; while ( (j=WalkInTetn(Th3,it,PHat,R3(GetAny((*u)(s)),GetAny((*v)(s)),GetAny((*w)(s))),ddt,offset))>=0) if(j>3) { it=j-4; mpc.change(PHat,Th3[it],0); if(ddd) cout << " **P= "<< (*mpc.T3)(PHat) << " , Ph " << PHat << " : j = " << j << " it: " << it << "ddt=" << ddt ; if(ddt==0) break; // finish ... } else { if(ddd) cout << "P= "<< (*mpc.T3)(PHat) << " , Ph " << PHat << " : j = " << j << " it: " << it ; #ifdef DEBUG R3 Po=(*mpc.T3)(PHat),Pho=PHat; int ito=it; #endif int itt = Th3.ElementAdj(it,j,PHat); if(ddd && itt>=0) cout << " -> " << itt << " " << j << " : Pn " << Th3[itt](PHat) << " PHn " << PHat << " , " << ddt << endl; if(itt<0) break; it=itt; mpc.change(PHat,Th3[it],0); #ifdef DEBUG if(((Po-mpc.P).norme2() > 1e-10)) { cout << ito << " " << &Th3[ito][0] << " " << &Th3[ito][1] << " " << &Th3[ito][2] << " " << &Th3[ito][3] << " " << endl; cout << it << " " << &Th3[it][0] << " " << &Th3[it][1] << " " << &Th3[it][2] << " " << &Th3[it][3] << endl; cout << Pho << "o Hat " << PHat << endl; cout << Po << " o != " << mpc.P << " diff= "<< (Po-mpc.P).norme2() < class Op3_pfe2K : public ternary_function *,int>,R,R,K> { public: class Op : public E_F0mps { public: Expression a,b,c; Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {/*cout << "Op3_pfe2K" << endl;*/} AnyType operator()(Stack s) const { R xx(GetAny((*b)(s))); R yy(GetAny((*c)(s))); MeshPoint & mp = *MeshPointStack(s),mps=mp; mp.set(xx,yy,0.0); AnyType ret = pfer2R(s,(*a)(s)); mp=mps; return ret; } }; }; //Add FH 16032005 class Op3_Mesh2mp : public ternary_function { public: class Op : public E_F0mps { public: Expression a,b,c; Op(Expression aa,Expression bb,Expression cc) : a(aa),b(bb),c(cc) {} AnyType operator()(Stack s) const { R xx(GetAny((*b)(s))); R yy(GetAny((*c)(s))); pmesh *ppTh(GetAny((*a)(s))); if( !ppTh || !*ppTh) ExecError("Op3_Mesh2mp unset mesh ??"); pmesh pTh(*ppTh); MeshPoint * mp = new MeshPoint(); mp->set(xx,yy,0.0); R2 PHat; bool outside; const Triangle * K=pTh->Find(mp->P.p2(),PHat,outside); mp->set(*pTh,(R2) mp->P.p2(),PHat,*K,0,outside); return mp;} }; }; template class JumpOp : public E_F0mps { public: typedef RR R; typedef AA A; typedef RR result_type; typedef AA argument_type; Expression a; public: AnyType operator()(Stack stack) const { // a faire A rd,rg; MeshPoint *mp=MeshPointStack(stack),smp=*mp; rg = GetAny((*a)(stack)); rd = 0. ;// to be compatible with varf def... FH april 2014 ... v 3.31. if ( mp->SetAdj() ) rd = GetAny((*a)(stack)); *mp=smp; return SetAny(rd-rg);// external - internal } JumpOp(Expression aa) : a(aa) {} }; template class MeanOp : public E_F0mps { public: typedef RR R; typedef AA A; typedef RR result_type; typedef AA argument_type; Expression a; public: AnyType operator()(Stack stack) const { // a faire A rd,rg; MeshPoint *mp=MeshPointStack(stack),smp=*mp; rg = GetAny((*a)(stack)); rd = rg; if ( mp->SetAdj() ) rd = GetAny((*a)(stack)); *mp=smp; return SetAny((rg+rd)*0.5); } MeanOp(Expression aa) : a(aa) {} }; template class OthersideOp: public E_F0mps { public: typedef RR R; typedef AA A; typedef RR result_type; typedef AA argument_type; Expression a; public: AnyType operator()(Stack stack) const { // a faire A rd,rg; MeshPoint *mp=MeshPointStack(stack),smp=*mp; rd = 0.; if ( mp->SetAdj() ) rd = GetAny((*a)(stack)); *mp=smp; return SetAny(rd); } OthersideOp(Expression aa) : a(aa) {} }; long get_size(pferarray const & a) { return a.first->N; } long get_size(pfecarray const & a) { return a.first->N; } long get_size(pferbasearray *const & a) { return (**a).N; } long get_size(pfecbasearray *const & a) { return (**a).N; } long get_size(pf3rarray const & a) { return a.first->N; } long get_size(pf3rbasearray *const & a) { return (**a).N; } long get_size(pf3carray const & a) { return a.first->N; } long get_size(pf3cbasearray *const & a) { return (**a).N; } long resize(pferbasearray *const & a, long const & n) { (**a).resize(n); return n; } long resize(pfecbasearray *const & a, long const & n) { (**a).resize(n); return n; } pferbase* get_element(pferbasearray *const & a, long const & n) { return (**a)[n]; } pfer get_element(pferarray const & a, long const & n) { return pfer( *(*a.first)[n],a.second); } // complex case pfecbase* get_element(pfecbasearray *const & a, long const & n) { return (**a)[n]; } pfec get_element(pfecarray const & a, long const & n) { return pfec( *(*a.first)[n],a.second); } // end complex case lgElement get_element(pmesh const & a, long const & n) { return lgElement(a,n); } lgElement get_element(pmesh *const & a, long const & n) { return lgElement(*a,n); } lgBoundaryEdge get_belement(lgBoundaryEdge::BE const & a, long const & n) { return lgBoundaryEdge(a,n); } lgElement get_adj(lgElement::Adj const & a, long * const & n) { return a.adj(*n); } lgVertex get_vertex(pmesh const & a, long const & n) { return lgVertex(a,n); } lgVertex get_vertex(pmesh *const & a, long const & n) { return lgVertex(*a,n); } lgVertex get_element(lgElement const & a, long const & n) { return a[n]; } lgVertex get_belement(lgBoundaryEdge const & a, long const & n) { return a[n]; } R getx(lgVertex const & a) { return a.x(); } R gety(lgVertex const & a) { return a.y(); } long getlab(lgVertex const & a) { return a.lab(); } long getlab(lgElement const & a) { return a.lab(); } long getlab(lgBoundaryEdge const & a) { return a.lab(); } double getarea(lgElement const & a) { return a.area(); } double getlength(lgBoundaryEdge const & a) { return a.length(); } lgElement getElement(lgBoundaryEdge const & a) { return a.Element(); } long EdgeElement(lgBoundaryEdge const & a) { return a.EdgeElement(); } /* pmesh* get_element(pmesharray *const & a, long const & n) { assert(n>=0 && n <=a->second); return a->first +n; } */ template inline AnyType DestroyKN(Stack,const AnyType &x){ KN * a=GetAny*>(x); for (int i=0;iN(); i++) (*a)[i]->destroy(); a->destroy(); return Nothing; } template RR * get_elementp_(const A & a,const B & b){ if( b<0 || a->N() <= b) { cerr << " Out of bound 0 <=" << b << " < " << a->N() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator []");} return &((*a)[b]);} template R * set_initinit( R* const & a,const long & n){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << n << endl); a->init(n); for (int i=0;i inline AnyType DestroyKNmat(Stack,const AnyType &x){ KN * a=GetAny*>(x); for (int i=0;iN(); i++) (*a)[i].destroy(); a->destroy(); return Nothing; } template R * set_initmat( R* const & a,const long & n){ SHOWVERB( cout << " set_init " << typeid(R).name() << " " << n << endl); a->init(n); for (int i=0;i *>(0,::DestroyKN ); atype* >()->Add("[","",new OneOperator2_*,long >(get_elementp_*,long>)); TheOperators->Add("<-", new OneOperator2_ *,KN *,long>(&set_initinit)); map_type_of_map[make_pair(atype(),atype())]=atype*>(); // vector // resize mars 2006 v2.4-1 Dcl_Type< Resize > > (); Add*>("resize",".",new OneOperator1< Resize >,KN*>(to_Resize)); Add > >("(","",new OneOperator2_ *,Resize > , long >(resizeandclean1)); } template RR get_elementp(const A & a,const B & b){ if( b<0 || a->N() <= b) { cerr << " Out of bound 0 <=" << b << " < " << a->N() << " array type = " << typeid(A).name() << endl; ExecError("Out of bound in operator []");} return ((*a)[b]);} template T *resizeandclean2(const Resize & t,const long &n) { // resizeandclean1 int nn= t.v->N(); // old size for (int i=n;iresize(n); for (int i=nn;i AnyType ClearReturn(Stack stack, const AnyType & a) { // a ne faire que pour les variables local au return... // pour l'instant on copie pour fqire mqrche // a repense FH mqi 20014.... PMat * m = GetAny(a); // KN *cm=new KN(true, *m); bug quant KN est une variable global // KN *cm=new KN( *m); // on duplique le tableau comme en C++ (dur dur ?????? FH) m->increment(); Add2StackOfPtr2FreeRC(stack,m); return m; } template void DclTypeMatrix() { Dcl_Type* >(InitP >,Destroy >, ClearReturn >); Dcl_Type >(); // matrice^t (A') Dcl_Type >(); // matrice^-1 A^{-1} Dcl_Type::plusAx >(); // A*x (A'*x) Dcl_Type::plusAtx >(); // A^t*x (A'*x) Dcl_Type::solveAxeqb >(); // A^t*x (A'*x) Dcl_Type >(); Dcl_Type *,bool> >*>(); // resize mars 2006 v2.4-1 // array of matrix matrix[int] A(n); typedef Matrice_Creuse Mat; typedef Mat * PMat; typedef KN AMat; Dcl_Type(0,::DestroyKNmat ); // init array TheOperators->Add("<-", new OneOperator2_(&set_initmat)); // A[i] atype()->Add("[","",new OneOperator2_(get_elementp_)); // resize Dcl_Type< Resize > (); Add("resize",".",new OneOperator1< Resize,AMat*>(to_Resize)); Add >("(","",new OneOperator2_ , long >(resizeandclean2)); // to declare matrix[int] map_type_of_map[make_pair(atype(),atype())]=atype(); } template AnyType First(Stack,const AnyType &b) { return SetAny(GetAny(b).first);} template AnyType AddIncrement(Stack stack, const AnyType & a) { K m = GetAny(a); m->increment(); Add2StackOfPtr2FreeRC(stack,m); if(verbosity>1) cout << "AddIncrement:: increment + Add2StackOfPtr2FreeRC " << endl; return a; } /* class EConstantTypeOfFE3 :public E_F0 { public: // using namespace Fem2D; typedef Fem2D::TypeOfFE3 * T; T v; public: AnyType operator()(Stack ) const { ;return SetAny(v);} EConstantTypeOfFE3( T o):v(o) {} size_t nbitem() const { assert(v); cout << " nb item = " << v->N << endl; return v->N ;} operator aType () const { return atype();} }; */ Type_Expr CConstantTFE3(const EConstantTypeOfFE3::T & v) { throwassert(map_type[typeid( EConstantTypeOfFE3::T).name()]); return make_pair(map_type[typeid( EConstantTypeOfFE3::T).name()],new EConstantTypeOfFE3(v)); } // end --- call meth be .. // 2013 resize of array of fe function.. template T fepresize(const Resize1 & rt,const long &n) { (**(rt.v)).resize(n); return rt.v;} template T feresize(const Resize1 & rt,const long &n) { rt.v.first->resize(n); return rt.v;} double get_R3(R3 *p,long i){return (*p)[i];} R3 * set_eqp(R3 *a,R3 *b) { *a=*b; return a;} void init_lgfem() { // ThePlotStream = new ofstream("ttttt.plot"); if(verbosity&& (mpirank==0)) cout <<"lg_fem "; #ifdef HAVE_CADNA cout << "cadna "; cadna_init(-1); // pas de fichier #endif //Dcl_Type(); // to store compilation expression Dcl_Type(); Dcl_Type(::Initialize); Dcl_Type(::Initialize); map_type[typeid(R3*).name()] = new ForEachType(Initialize); Dcl_TypeandPtr(0,0, ::InitializePtr,::DestroyPtr,AddIncrement,NotReturnOfthisType); Dcl_TypeandPtr(0,0,::InitializePtr,::DestroyPtr,AddIncrement,NotReturnOfthisType); Dcl_Type(); Dcl_Type( ); Dcl_Type( ); Dcl_Type( ); Dcl_Type( ); atype()->AddCast( new E_F1_funcT(Cast), new E_F1_funcT(Cast), new E_F1_funcT(Cast) ); Dcl_Type(); Dcl_Type(); // 3d map_type[typeid(TypeOfFE3*).name()]->AddCast( new E_F1_funcT(TypeOfFE3to2) ); Dcl_Type(); DclTypeMatrix(); DclTypeMatrix(); // Dcl_Type >(); // A^(-1) x Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_Type< pfer >(); Dcl_Type< pferarray >(); Dcl_Type< pferarray >(); // pour des Func FE complex // FH v 1.43 Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_Type< pfec >(); Dcl_Type< pfecarray >(); // FH v 1.43 // add mai 2009 FH for 3d eigen value. Dcl_Type *>(); Dcl_Type *>(); // Dcl_Type< pmesharray *>(); // il faut le 2 pour pourvoir initialiser map_type[typeid(pfes).name()] = new ForEachType(); map_type[typeid(pfes*).name()] = new ForEachTypePtrfspace(); Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_Type< pf3r >(); Dcl_Type< pf3rarray >(); // pour des Func FE complex // FH v 1.43 Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_TypeandPtr(); // il faut le 2 pour pourvoir initialiser Dcl_Type< pf3c >(); Dcl_Type< pf3carray >(); // cast of eigen value mai 2009 ... map_type[typeid(FEbaseArrayKn *).name()]->AddCast( new E_F1_funcT *,pferbasearray>(Cast *,pferbasearray> ), new E_F1_funcT *,pferarray>(First *,pferarray> ), new E_F1_funcT *,pf3rbasearray>(Cast *,pf3rbasearray> ), new E_F1_funcT *,pf3rarray>(First *,pf3rarray> ) ); map_type[typeid(FEbaseArrayKn *).name()]->AddCast( new E_F1_funcT *,pfecbasearray>(Cast *,pfecbasearray> ), new E_F1_funcT *,pfecarray>(First *,pfecarray> ), new E_F1_funcT *,pf3cbasearray>(Cast *,pf3cbasearray> ), new E_F1_funcT *,pf3carray>(First *,pf3carray> ) ); map_type[typeid(pfes3).name()] = new ForEachType(); // 3d map_type[typeid(pfes3*).name()] = new ForEachTypePtrfspace(); // 3d // Dcl_Type(); Dcl_Type(); Dcl_Type *>(); Global.New("qf1pT",CConstant(&QuadratureFormular_T_1)); Global.New("qf1pTlump",CConstant(&QuadratureFormular_T_1lump)); Global.New("qf2pT",CConstant(&QuadratureFormular_T_2)); Global.New("qf2pT4P1",CConstant(&QuadratureFormular_T_2_4P1)); Global.New("qf5pT",CConstant(&QuadratureFormular_T_5)); Global.New("qf7pT",CConstant(&QuadratureFormular_T_7)); Global.New("qf9pT",CConstant(&QuadratureFormular_T_9)); Global.New("qf1pE",CConstant(&QF_GaussLegendre1)); Global.New("qf2pE",CConstant(&QF_GaussLegendre2)); Global.New("qf3pE",CConstant(&QF_GaussLegendre3)); Global.New("qf4pE",CConstant(&QF_GaussLegendre4)); Global.New("qf5pE",CConstant(&QF_GaussLegendre5)); Global.New("qf1pElump",CConstant(&QF_LumpP1_1D)); Global.New("qfV1",CConstant *>(&QuadratureFormular_Tet_1)); Global.New("qfV2",CConstant *>(&QuadratureFormular_Tet_2)); Global.New("qfV5",CConstant *>(&QuadratureFormular_Tet_5)); Global.New("qfV1lump",CConstant *>(&QuadratureFormular_Tet_1lump)); // juste du code genere Global.New("wait",CConstant(&TheWait)); Global.New("NoUseOfWait",CConstant(&NoWait)); Global.New("NoGraphicWindow",CConstant(&NoGraphicWindow)); Dcl_Type(); Dcl_Type(); Dcl_Type(); Dcl_Type(); Dcl_Type(); Dcl_Type(); // a set of boundary condition Dcl_Type *>(); // to set Vector Dcl_Type *>(); // to set Matrix Dcl_Type *>(); // to set Vector 3d Dcl_Type *>(); // to set Matrix 3d Dcl_Type::type>(); // to make interpolation x=f o X^1 ; map_type[typeid(const FormBilinear*).name()] = new TypeFormBilinear; map_type[typeid(const FormLinear*).name()] = new TypeFormLinear; aType t_C_args = map_type[typeid(const C_args*).name()] = new TypeFormOperator; map_type[typeid(const Problem*).name()] = new TypeSolve; map_type[typeid(const Solve*).name()] = new TypeSolve; Dcl_Type*>(); Dcl_Type >*>(); basicForEachType * t_solve=atype(); basicForEachType * t_problem=atype(); basicForEachType * t_fbilin=atype(); basicForEachType * t_flin=atype(); basicForEachType * t_BC=atype(); /// Doxygen doc basicForEachType * t_form=atype(); Dcl_Type(); atype()->AddCast( new E_F1_funcT(UnRef)); // in mesh3 atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); atype()->AddCast( new E_F1_funcT(UnRef)); Add("[]",".",new OneOperator1 *,pfer>(pfer2vect)); Add("[]",".",new OneOperator1 *,pfec>(pfer2vect)); Add("(","",new OneTernaryOperator,Op3_pfe2K::Op> ); Add("(","",new OneTernaryOperator,Op3_pfe2K::Op> ); Add("(","",new OneTernaryOperator,Op3_K2R::Op> ); // Add("(","",new OneTernaryOperator,Op3_K2R::Op> ); // FH stupide Add("(","",new OneTernaryOperator,Op3_K2R::Op> ); Add("(","",new OneTernaryOperator ); Add("nuTriangle",".",new OneOperator1(mp_nuTriangle)); Add("region",".",new OneOperator1(mp_region)); Add("n",".",new OneOperator1(pfer_nbdf)); Add("n",".",new OneOperator1(pfer_nbdf)); Add("Th",".",new OneOperator1(pfer_Th)); Add("Th",".",new OneOperator1(pfer_Th)); Add("area",".",new OneOperator1(pmesh_area)); Add("mesure",".",new OneOperator1(pmesh_area)); Add("measure",".",new OneOperator1(pmesh_area)); Add("bordermeasure",".",new OneOperator1(pmesh_bordermeasure));// add june 2017 F.H Add("nt",".",new OneOperator1(pmesh_nt)); Add("nbe",".",new OneOperator1(pmesh_nbe)); Add("nv",".",new OneOperator1(pmesh_nv)); Add("hmax",".",new OneOperator1(pmesh_hmax)); Add("hmin",".",new OneOperator1(pmesh_hmin)); Add("ndof",".",new OneOperator1(pVh_ndof)); Add("Th",".",new OneOperator1(pVh_Th)); Add("nt",".",new OneOperator1(pVh_nt)); Add("ndofK",".",new OneOperator1(pVh_ndofK)); Add("(","", new OneTernaryOperator ); /* FH: ne peux pas marcher, il faut passer aussi le nouveau Vh Add("(","", new OneBinaryOperator_st ); */ //new OneOperator3(pVh_ndf)); atype * >()->AddCast(new OneOperatorCode >); atype * >()->AddCast(new OneOperatorCode >); /* TheOperators->Add("*", new OneBinaryOperator::plusAx,Matrice_Creuse*,KN* > >, new OneBinaryOperator::plusAtx,Matrice_Creuse_Transpose,KN* > >, new OneBinaryOperator::solveAxeqb,Matrice_Creuse_inv,KN* > > ); TheOperators->Add("^", new OneBinaryOperatorA_inv()); */ // Add all Finite Element "P0","P1","P2","RT0", ... for (ListOfTFE * i=ListOfTFE::all;i;i=i->next) { ffassert(i->tfe); // check AddNewFE(i->name,i->tfe); // Global.New(i->name, Type_Expr(atype(),new EConstantTypeOfFE(i->tfe))); } // Global.New("P1",CConstant(&P1Lagrange)) // Global.New("P2",CConstant(&P2Lagrange)); kTypeSolveMat=0; Global.New("LU",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::LU))); Global.New("CG",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::GC))); Global.New("Crout",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::CROUT))); Global.New("Cholesky",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::CHOLESKY))); Global.New("GMRES",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::GMRES))); Global.New("UMFPACK",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::SparseSolver))); Global.New("sparsesolver",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::SparseSolver))); Global.New("sparsesolverSym",CConstant(dTypeSolveMat[kTypeSolveMat++]=new TypeSolveMat(TypeSolveMat::SparseSolverSym))); ffassert(kTypeSolveMatAddCast(new E_F1_funcT(Long2TypeSolveMat) ); map_type[typeid(long).name()]->AddCast( new E_F1_funcT(TypeSolveMat2Long) ); // init pmesh /* Add("<-","(", new OneOperator1_(ReadMesh), new OneOperator3_ >(& FindTxy ) ); Add("<-","(", new OneOperator1_(ReadMesh3) ); */ /*TheOperators->Add("<-",); );*/ //old -- // init FESpace TheOperators->Add("<-", new OneOperator2_(& MakePtr2 ), // new OneOperator2_(& MakePtr3 ), // new OneOperator3_(& MakePtr2 ), // new OneOperator3_(& MakePtr2 ), new OneOperatorCode, new OneOperatorCode, new OpMake_pfes, new OpMake_pfes ); TheOperators->Add("=",new OneOperator2(&set_eqp)); Add("P",".", new OneOperator_Ptr_o_R( & MeshPoint::P)); Add("N",".", new OneOperator_Ptr_o_R( & MeshPoint::N)); Add("x",".", new OneOperator_Ptr_o_R( & R3::x)); Add("y",".", new OneOperator_Ptr_o_R( & R3::y)); Add("z",".", new OneOperator_Ptr_o_R( & R3::z)); Add("x",".", new OneOperator_Ptr_o_R( & R2::x)); Add("y",".", new OneOperator_Ptr_o_R( & R2::y)); Add("[","",new OneOperator2(get_R3)); Add("[","",new OneOperator2_(get_element)); Add("be",".",new OneOperator1_(Build)); Add("adj",".",new OneOperator1_(Build)); Add("(","",new OneOperator2_(get_belement)); Add("(","",new OneOperator2_(get_adj)); TheOperators->Add("==", new OneBinaryOperator >); TheOperators->Add("!=", new OneBinaryOperator >); TheOperators->Add("<", new OneBinaryOperator >); TheOperators->Add("<=", new OneBinaryOperator >); Add("[","",new OneOperator2_(get_element)); Add("(","",new OneOperator2_(get_vertex)); Add("(","",new OneOperator2_(get_vertex)); Add("[","",new OneOperator2_(get_element)); Add("[","",new OneOperator2_(get_belement)); Add("x",".",new OneOperator1_(getx)); Add("y",".",new OneOperator1_(gety)); Add("label",".",new OneOperator1_(getlab)); Add("label",".",new OneOperator1_(getlab)); Add("region",".",new OneOperator1_(getlab)); Add("area",".",new OneOperator1_(getarea)); Add("mesure",".",new OneOperator1_(getarea)); Add("measure",".",new OneOperator1_(getarea)); Add("length",".",new OneOperator1_(getlength)); Add("label",".",new OneOperator1_(getlab)); Add("Element",".",new OneOperator1_(getElement)); Add("whoinElement",".",new OneOperator1_(EdgeElement)); // New FF language types. zzzfff is defined at [[file:lex.hpp::zzzfff]] as a pointer to an object of class mylex // [[file:lex.hpp::class mylex]]. zzzfff->Add() is at [[file:lex.cpp::void mylex Add Key k aType t]]. The lexer will // then be called from the parser via [[file:../lglib/lg.ypp::yylex]] zzzfff->Add("R3",atype()); // <> pmesh is a pointer to Mesh [[file:../femlib/fem.hpp::class Mesh]] defined at // [[file:lgfem.hpp::typedef Mesh pmesh]] zzzfff->Add("mesh",atype()); // pmesh3 is a pointer to Mesh3 defined at [[file:lgfem.hpp::typedef Mesh3 pmesh3]] zzzfff->Add("mesh3",atype()); zzzfff->Add("element",atype()); zzzfff->Add("vertex",atype()); // zzzfff->Add("fespace",atype()); zzzfff->Add("matrix",atype *>()); zzzfff->Add("Cmatrix",atype *>()); // a voir Global.Add("LinearCG","(",new LinearCG()); // old form with rhs (must be zer Global.Add("LinearGMRES","(",new LinearGMRES()); // old form Global.Add("LinearGMRES","(",new LinearGMRES(1)); // old form without rhs Global.Add("AffineGMRES","(",new LinearGMRES(1)); // New better Global.Add("LinearCG","(",new LinearCG(1)); // without right handsize Global.Add("AffineCG","(",new LinearCG(1)); // without right handsize Global.Add("NLCG","(",new LinearCG(-1)); // without right handsize // Global.Add("LinearCG","(",new LinearCG()); // old form with rhs (must be zer // Global.Add("LinearGMRES","(",new LinearGMRES()); // old form with rhs (must be zer // Global.Add("LinearGMRES","(",new LinearGMRES(1)); // old form without rhs // Global.Add("LinearCG","(",new LinearCG(1)); // without right handsize // Global.Add("NLCG","(",new LinearCG(-1)); // without right handsize zzzfff->AddF("varf",t_form); // var. form ~ <> zzzfff->AddF("solve",t_solve); zzzfff->AddF("problem",t_problem); Global.Add("jump","(",new OneOperatorCode >); Global.Add("jump","(",new OneOperatorCode >); Global.Add("average","(",new OneOperatorCode >); Global.Add("average","(",new OneOperatorCode >); Global.Add("mean","(",new OneOperatorCode >); Global.Add("mean","(",new OneOperatorCode >); Global.Add("otherside","(",new OneOperatorCode >); Global.Add("otherside","(",new OneOperatorCode >); Global.Add("conj","(",new OneOperatorCode >); Global.Add("conj","(",new OneOperatorCode >); Global.Add("conj","(",new OneOperatorCode >); TheOperators->Add("\'", new OneOperatorCode >); TheOperators->Add("\'", new OneOperatorCode >); TheOperators->Add("\'", new OneOperatorCode >); Global.Add("dx","(",new OneOperatorCode >); Global.Add("dy","(",new OneOperatorCode >); Global.Add("dx","(",new OneOperatorCode >); Global.Add("dy","(",new OneOperatorCode >); Global.Add("dxx","(",new OneOperatorCode >); Global.Add("dxy","(",new OneOperatorCode >); Global.Add("dyx","(",new OneOperatorCode >); Global.Add("dyy","(",new OneOperatorCode >); Global.Add("dxx","(",new OneOperatorCode >); Global.Add("dyy","(",new OneOperatorCode >); Global.Add("dxy","(",new OneOperatorCode >); Global.Add("dyx","(",new OneOperatorCode >); Global.Add("on","(",new OneOperatorCode ); /// <> uses [[Plot]] and [[file:AFunction.hpp::OneOperatorCode]] and [[file:AFunction.hpp::Global]] Global.Add("plot","(",new OneOperatorCode ); Global.Add("convect","(",new OneOperatorCode ); TheOperators->Add("+", new OneOperatorCode > , new OneOperatorCode > , new OneOperatorCode > , new OneOperatorCode(t_C_args,t_C_args,t_C_args) // , // new OperatorIdentity(), // add FH 13042005 // new OperatorIdentity() // add FH 13042005 + int2d ( ..) ); TheOperators->Add("-", new OneOperatorCode > , new OneOperatorCode > , new OneOperatorCode >, new OneOperatorCode > , new OneOperatorCode > , new OneOperatorCode >, new OneOperatorCode(t_C_args,t_C_args,t_fbilin) , new OneOperatorCode(t_C_args,t_C_args,t_flin) , new OneOperatorCode >, new OneOperatorCode > ); atype()->AddCast( new OneOperatorCode(t_C_args,t_fbilin) , new OneOperatorCode(t_C_args,t_flin) , new OneOperatorCode(t_C_args,t_BC) ); atype()->AddCast( new OneOperatorCode(t_C_args,atype >()) , new OneOperatorCode(t_C_args,atype*>()) , new OneOperatorCode(t_C_args,atype >()) , new OneOperatorCode(t_C_args,atype*>()) , new OneOperatorCode(t_C_args,atype::plusAx >()), new OneOperatorCode(t_C_args,atype::plusAtx >()) ); atype()->AddCast( new OneOperatorCode(t_C_args,atype >()) , new OneOperatorCode(t_C_args,atype*>()) , new OneOperatorCode(t_C_args,atype >()) , new OneOperatorCode(t_C_args,atype*>()) , new OneOperatorCode(t_C_args,atype::plusAx >()), new OneOperatorCode(t_C_args,atype::plusAtx >()) ); TheOperators->Add("*", new OneOperatorCode > , new OneOperatorCode > ); // Warning just double or complex in following operator // ---------------------------------------------------- // in case of ambiguity we take the double version // case long -> double // long -> complex TheOperators->Add("*", new OneOperatorCode, 20> , new OneOperatorCode, 20 > , new OneOperatorCode, 20 > , new OneOperatorCode, 20 > , new OneOperatorCode, 20 > , new OneOperatorCode, 20 > ); TheOperators->Add("*", new OneOperatorCode, 10 > , new OneOperatorCode, 10 > , new OneOperatorCode, 10 > , new OneOperatorCode, 10 > , new OneOperatorCode, 10 > , new OneOperatorCode, 10 > ); TheOperators->Add("/", new OneOperatorCode, 20 > , new OneOperatorCode, 20 > , new OneOperatorCode, 20 > ); TheOperators->Add("/", new OneOperatorCode, 10 > , new OneOperatorCode, 10 > , new OneOperatorCode, 10 > ); // Warning just double or complex in previous operator // ---------------------------------------------------- // TheOperators->Add("=",new OneOperatorCode >); TheOperators->Add("=", new OneOperator2(&set_eqdestroy_incr), //- new OneBinaryOperator ,VirtualMatrice::plusAx > > , //- new OneBinaryOperator ,VirtualMatrice::plusAtx > > , //- new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > , new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > , //- new OpArraytoLinearForm(atype< KN* >(),true,false) , new OpArraytoLinearForm(atype< KN_ >(),false,false) , new OpMatrixtoBilinearForm); TheOperators->Add("=", //- new OpArraytoLinearForm(atype< KN* >(),true,false) ,// 3d new OpArraytoLinearForm(atype< KN_ >(),false,false) ,//3d new OpMatrixtoBilinearForm);//3d TheOperators->Add("<-", new OpArraytoLinearForm(atype< KN* >(),true,true) , new OpArraytoLinearForm(atype< KN* >(),true,true) , new OpArraytoLinearForm(atype< KN* >(),true,true) , //3d new OpArraytoLinearForm(atype< KN* >(),true,true) //3d ); TheOperators->Add("=", // new OneBinaryOperator ,VirtualMatrice::plusAx > > , // new OneBinaryOperator ,VirtualMatrice::plusAtx > > , // new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > , new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > , new OpArraytoLinearForm(atype< KN* >(),true,false) , //- new OpArraytoLinearForm(atype< KN_ >(),false,false) , new OpMatrixtoBilinearForm); TheOperators->Add("=", //- new OpArraytoLinearForm(atype< KN* >(),true,false) , // 3d new OpArraytoLinearForm(atype< KN_ >(),false,false) , //3d new OpMatrixtoBilinearForm);// 3d // add august 2007 TheOperators->Add("<-", new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > , new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::solveAxeqb > > ); // Jan 2018 FH Vh uh=yu[]; // A FAIRE FH POUR F NATAF FFFFFFFF TheOperators->Add("<-" , new init_FE_eqarray::plusAx> >(10) , new init_FE_eqarray::solveAxeqb> >(10) , new init_FE_eqarray::plusAtx> >(10) , new init_FE_eqarray > >(10) , new init_FE_eqarray > >(10) ); TheOperators->Add("<-" , new init_FE_eqarray::plusAx> >(10) , new init_FE_eqarray::solveAxeqb> >(10) , new init_FE_eqarray::plusAtx> >(10) , new init_FE_eqarray > >(10) , new init_FE_eqarray > >(10) ); TheOperators->Add("<-" , new init_FE_eqarray::plusAx> >(10) , new init_FE_eqarray::solveAxeqb> >(10) , new init_FE_eqarray::plusAtx> >(10) , new init_FE_eqarray > >(10) , new init_FE_eqarray > >(10) ); TheOperators->Add("<-" , new init_FE_eqarray::plusAx> >(10) , new init_FE_eqarray::solveAxeqb> >(10) , new init_FE_eqarray::plusAtx> >(10) , new init_FE_eqarray > >(10) , new init_FE_eqarray > >(10) ); // Fin // Fin TheOperators->Add("+=", //- new OneBinaryOperator ,VirtualMatrice::plusAx > > , //- new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > >, //- new OpArraytoLinearForm(atype< KN* >(),true,false,false) , new OpArraytoLinearForm(atype< KN_ >(),false,false,false) , //- new OpArraytoLinearForm(atype< KN* >(),true,false,false) , // 3d new OpArraytoLinearForm(atype< KN_ >(),false,false,false) // 3d ); TheOperators->Add("+=", //- new OneBinaryOperator ,VirtualMatrice::plusAx > > , //- new OneBinaryOperator ,VirtualMatrice::plusAtx > > , new OneBinaryOperator ,VirtualMatrice::plusAx > > , new OneBinaryOperator ,VirtualMatrice::plusAtx > >, //- new OpArraytoLinearForm(atype< KN* >(),true,false,false) , new OpArraytoLinearForm(atype< KN_ >(),false,false,false) , //- new OpArraytoLinearForm(atype< KN* >(),true,false,false) , new OpArraytoLinearForm(atype< KN_ >(),false,false,false) ); TheOperators->Add("<-",new OpMatrixtoBilinearForm(1) ); TheOperators->Add("<-",new OpMatrixtoBilinearForm(1) ); TheOperators->Add("<-",new OpMatrixtoBilinearForm(1) ); // 3d TheOperators->Add("<-",new OpMatrixtoBilinearForm(1) );// 3d Add("(","",new OpCall_FormLinear ); Add("(","",new OpCall_FormBilinear ); Add("(","",new OpCall_FormLinear2 ); Add("(","",new OpCall_FormLinear2); Add("(","",new OpCall_FormBilinear ); Add("(","",new OpCall_FormLinear ); Add("(","",new OpCall_FormBilinear ); Add("(","",new OpCall_FormLinear2 ); Add("(","",new OpCall_FormLinear2); Add("(","",new OpCall_FormBilinear ); // correction du bug morale // Attention il y a moralement un bug // les initialisation x = y ( passe par l'operateur binaire <- dans TheOperators // les initialisation x(y) ( passe par l'operateur unaire <- de typedebase de x (inutile 2007). // x(y1,..,yn) est un operator n+1 (x,y1,..,yn) // on passe toujours par x(y) maintenant. // ------- TheOperators->Add("<-", new OneOperator2_(MakePtrFE2), new OneOperator3_(MakePtrFE3), new OneOperator2_(MakePtrFE2), new OneOperator3_(MakePtrFE3) //, // new OneOperator2_(MakePtr) ); TheOperators->Add("<-", new OneOperatorMakePtrFE(atype()), // scalar case new OneOperatorMakePtrFE(atype()), // vect case new OneOperatorMakePtrFE(atype()), // scalar complex case new OneOperatorMakePtrFE(atype()) // vect complex case ); // interpolation operator TheOperators->Add("=", new OneOperator2_ >(set_fe) , new OneOperator2_ >(set_fe) ) ; // new OneOperator2_(set_fev)); // Attention il y a moralement un bug // les initialisation x = y ( passe par l'operateur binaire <- dans TheOperators // les initialisation x(y) ( passe par l'operateur unaire <- de typedebase de x // ------- corrige TheOperators->Add("=", new OneOperator2(&set_eqdestroy_incr), new Op_CopyArray() ); TheOperators->Add("<-", new OneOperator2_(&set_copy_incr)); TheOperators->Add("<<", new OneBinaryOperator >, new OneBinaryOperator*> >, new OneBinaryOperator*> > ); TheOperators->Add(">>", new OneBinaryOperator > >, new OneBinaryOperator > > ); Global.Add("int2d","(",new OneOperatorCode); Global.Add("int1d","(",new OneOperatorCode); Global.Add("intalledges","(",new OneOperatorCode); Global.Add("intallVFedges","(",new OneOperatorCode); Global.Add("jump","(",new OneUnaryOperator,JumpOp >); Global.Add("mean","(",new OneUnaryOperator,MeanOp >); Global.Add("average","(",new OneUnaryOperator,MeanOp >); Global.Add("otherside","(",new OneUnaryOperator,OthersideOp >); Global.Add("jump","(",new OneUnaryOperator,JumpOp >); Global.Add("mean","(",new OneUnaryOperator,MeanOp >); Global.Add("average","(",new OneUnaryOperator,MeanOp >); Global.Add("otherside","(",new OneUnaryOperator,OthersideOp >); Add("(","",new OneOperatorCode ); Add("(","",new OneOperatorCode ); Add("(","",new OneOperatorCode,1 >); Add("(","",new OneOperatorCode >,0 >); map_type[typeid(double).name()]->AddCast( new E_F1_funcT(pfer2R) ); map_type[typeid(Complex).name()]->AddCast( new E_F1_funcT(pfer2R) ); // bof Global.Add("dx","(",new E_F1_funcT(pfer2R)); Global.Add("dy","(",new E_F1_funcT(pfer2R)); Global.Add("dxx","(",new E_F1_funcT(pfer2R)); Global.Add("dyy","(",new E_F1_funcT(pfer2R)); Global.Add("dxy","(",new E_F1_funcT(pfer2R)); Global.Add("dyx","(",new E_F1_funcT(pfer2R)); Global.Add("dx","(",new E_F1_funcT(pfer2R)); Global.Add("dy","(",new E_F1_funcT(pfer2R)); Global.Add("dxx","(",new E_F1_funcT(pfer2R)); Global.Add("dyy","(",new E_F1_funcT(pfer2R)); Global.Add("dxy","(",new E_F1_funcT(pfer2R)); Global.Add("dyx","(",new E_F1_funcT(pfer2R)); // Add("[","",new OneOperator2_FEcomp(get_element)); Add("[","",new OneOperator2_(get_element)); // use FH sep. 2009 Add("[","",new OneOperator2_(get_element)); // use ???? FH sep. 2009 // bof bof .. // resize of array of Finite element .. a little hard 2013 FH Dcl_Type< Resize1 > (); Dcl_Type< Resize1 > (); Dcl_Type< Resize1 > (); Dcl_Type< Resize1 > (); Add("resize",".",new OneOperator1,pfecbasearray*>(to_Resize1)); // FH fev 2013 Add("resize",".",new OneOperator1,pferbasearray*>(to_Resize1)); // FH fev. 2013 Add("resize",".",new OneOperator1,pferarray>(to_Resize1)); // FH fev 2013 Add("resize",".",new OneOperator1,pfecarray>(to_Resize1)); // FH fev. 2013 new OneOperator2_ , long >(fepresize); Add >("(","",new OneOperator2_ , long >(fepresize)); Add >("(","",new OneOperator2_ , long >(fepresize)); Add >("(","",new OneOperator2_ , long >(feresize)); Add >("(","",new OneOperator2_ , long >(feresize)); Dcl_Type< Resize1 > (); Dcl_Type< Resize1 > (); Dcl_Type< Resize1 > (); // FH oct. 2016 Dcl_Type< Resize1 > (); // FH oct. 2016 Add("resize",".",new OneOperator1,pf3rbasearray*>(to_Resize1)); // FH fev. 2013 Add("resize",".",new OneOperator1,pf3rarray>(to_Resize1)); // FH fev 2013 Add("resize",".",new OneOperator1,pf3cbasearray*>(to_Resize1)); // FH oct. 2016 Add("resize",".",new OneOperator1,pf3carray>(to_Resize1)); // FH Oct 2016 //new OneOperator2_ , long >(fepresize); Add >("(","",new OneOperator2_ , long >(fepresize)); Add >("(","",new OneOperator2_ , long >(feresize)); Add >("(","",new OneOperator2_ , long >(fepresize));// FH Oct 2016 Add >("(","",new OneOperator2_ , long >(feresize));// FH Oct 2016 // end of resize ... Add("n",".",new OneOperator1_(get_size)); // FH fev 2013 Add("n",".",new OneOperator1_(get_size)); // FH fev. 2013 Add("n",".",new OneOperator1_(get_size)); // FH fev 2013 Add("n",".",new OneOperator1_(get_size)); // FH fev. 2013 Add("n",".",new OneOperator1_(get_size)); // FH fev. 2013 Add("n",".",new OneOperator1_(get_size)); // FH fev 2013 Add("n",".",new OneOperator1_(get_size)); // FH Oct 2016 Add("n",".",new OneOperator1_(get_size)); // FH Oct 2016 Add("[","",new OneOperator2_FE_get_elmnt());// new version FH sep 2009 Add("[","",new OneOperator2_FE_get_elmnt()); Add("[","",new OneOperator2_FE_get_elmnt());// new version FH sep 2009 Add("[","",new OneOperator2_FE_get_elmnt());// FH Oct 2016 // Add("[","",new OneOperator2_(get_element)); // Add("[","",new OneOperator2_(get_element)); // Add("[","",new OneOperator2_(get_element)); TheOperators->Add("\'", new OneOperator1,Matrice_Creuse *>(&Build,Matrice_Creuse *>), new OneOperator1,Matrice_Creuse *>(&Build,Matrice_Creuse *>) ); Add("(","",new interpolate_f_X_1 ); TheOperators->Add("=", new OneOperator2_::type,double,E_F_StackF0F0 >(set_feoX_1) ) ; // init_lgmesh() ; init_lgmat(); init_mesh_array(); l2interpreter = new LinkToInterpreter; using namespace FreeFempp; FreeFempp::TypeVarForm::Global = new TypeVarForm(); FreeFempp::TypeVarForm::Global = new TypeVarForm(); Global.New("P13d",CConstantTFE3(&DataFE::P1)); Global.New("P23d",CConstantTFE3(&DataFE::P2)); Global.New("P03d",CConstantTFE3(&DataFE::P0)); Global.New("RT03d",CConstantTFE3(&RT03d)); Global.New("Edge03d",CConstantTFE3(&Edge03d)); Global.New("P1b3d",CConstantTFE3(&P1bLagrange3d)); /* for (ListOfTFE * i=ListOfTFE::all;i;i=i->next) { ffassert(i->tfe); // check AddNewFE(i->name,i->tfe); // Global.New(i->name, Type_Expr(atype(),new EConstantTypeOfFE(i->tfe))); } */ TEF2dto3d[FindFE2("P1")]=&DataFE::P1; TEF2dto3d[FindFE2("P2")]=&DataFE::P2; TEF2dto3d[FindFE2("P0")]=&DataFE::P0; TEF2dto3d[FindFE2("P1b")]=&P1bLagrange3d; TEF2dto3d[FindFE2("RT0")]=&RT03d; /* // add may 2011 F. HEcHt // in progress ????? to set varaible to store FinitELEMEnt type. zzzfff->Add("FiniteElement",atype()); zzzfff->Add("FiniteElement3",atype()); TheOperators->Add("=",new OneOperator2(&setFE<1>) ); TheOperators->Add("<-",new OneOperator2_(&setFE<0>)); */ } /* in progress ????? to set varaible to store FinitELEMEnt type. template TypeOfFE* setFE(TypeOfFE* a,TypeOfFE* b) { if(init) return a; } */ void clean_lgfem() { for (int i=0;i::Global; delete FreeFempp::TypeVarForm::Global; } template Expression IsFEcomp(const C_F0 &c,int i, Expression & rrr,Expression &iii) { Expression r=0; if(!i) rrr=0,iii=0; // typedef double K; if(atype::Result>() == c.left()) { const E_FEcomp * e= dynamic_cast*>(c.LeftValue() ); if( !e) { const E_FEcomp_get_elmnt_array * ee= dynamic_cast*>(c.LeftValue() ); if( !ee) { cerr <<" Fatal error Copy array .." << *c.left()<< " composante : " << i << endl; ffassert(ee); } else { if (ee->comp ==i) { if (i && ee->a00->a0 != rrr) cerr << " error composante arry vect. incompatible " << ee->comp << " "<< ee->a00->a0 << " != " << rrr << endl; else { r= ee->a0; rrr= ee->a00->a0; iii= ee->a1; } } else cerr << " erreur composante " << ee->comp << " != " << i << endl; } } else { if (e->comp ==i) { if (i && e->a0 != rrr) cerr << " error composante incompatible " << e->comp << endl; else rrr=r=e->a0; } else cerr << " erreur composante " << e->comp << " != " << endl; } } return r; } /* Expression IsCFEcomp(const C_F0 &c,int i) { typedef Complex K; if(atype::Result>() == c.left()) { const E_FEcomp * e= dynamic_cast*>(c.LeftValue() ); ffassert(e); if (e->comp !=i) return 0; else return e->a0; } else return 0; } */ template Expression Op_CopyArrayT(const E_Array & a,const E_Array & b) { typedef FEbaseArray FEba; //int na=a.size(); int nb=b.size(); Expression r=0,rr=0,rrr,iii; // try real voctor value FE interpolation rr=IsFEcomp(a[0],0,rrr,iii) ; if (rr !=0) { for (int i=1;i(a[i],i,rrr,iii)) CompileError("Copy of Array with incompatible K vector value FE function () !");; if(iii) {// ffassert(0); // moralement il : rrr[iii] C_F0 aa(rrr,atype()),ii(iii,atype()); C_F0 aa_ii(aa,"[",ii); rr=aa_ii.LeftValue(); } if(v_fes::d==2) r=new E_set_fev(&b,rr,2); else if(v_fes::d==3) r=new E_set_fev3(&b,rr); } // try complex vector value FE interpolation return r; } E_F0 * Op_CopyArray::code(const basicAC_F0 & args) const { E_F0 * ret=0; const E_Array & a= *dynamic_cast(args[0].LeftValue()); const E_Array & b= *dynamic_cast(args[1].LeftValue()); int na=a.size(); int nb=b.size(); if (na != nb ) CompileError("Copy of Array with incompatible size!"); if(0) { // old code !!!!!!! before removing FH sept. 2009 Expression rr=0,rrr,iii; // try real voctor value FE interpolation rr=IsFEcomp(a[0],0,rrr,iii) ; if (rr !=0) { for (int i=1;i(a[i],i,rrr,iii)) CompileError("Copy of Array with incompatible real vector value FE function () !");; return new E_set_fev(&b,rr,2); } // try complex vector value FE interpolation rr=IsFEcomp(a[0],0,rrr,iii) ; if (rr !=0) { for (int i=1;i(a[i],i,rrr,iii)) CompileError("Copy of Array with incompatible complex vector value FE function () !");; return new E_set_fev(&b,rr,2); } rr=IsFEcomp(a[0],0,rrr,iii) ; if (rr !=0) { for (int i=1;i(a[i],i,rrr,iii)) CompileError("Copy of Array with incompatible real vector value FE function () !");; return new E_set_fev3(&b,rr); } // try complex vector value FE interpolation rr=IsFEcomp(a[0],0,rrr,iii) ; if (rr !=0) { for (int i=1;i(a[i],i,rrr,iii)) CompileError("Copy of Array with incompatible complex vector value FE function () !");; return new E_set_fev3(&b,rr); } } else { Expression r=0; // new code FH sep 2009. if(!r) r=Op_CopyArrayT(a,b); if(!r) r=Op_CopyArrayT(a,b); if(!r) r=Op_CopyArrayT(a,b); if(!r) r=Op_CopyArrayT(a,b); if(r) return r; } CompileError("Internal Error: General Copy of Array : to do "); return ret;} template C_F0 NewFEvariableT(ListOfId * pids,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim) { ffassert(dim==DIM); // if (cplx) // cout << "NewFEvariable cplx=" << cplx << endl; typedef FEbase FE; typedef E_FEcomp FEi; typedef typename FEi::Result FEiR; typedef FEbase CFE; typedef E_FEcomp CFEi; typedef typename CFEi::Result CFEiR; Expression fes =fespacetype; aType dcltype=atype(); aType cf0type=atype(); aType rtype=atype(); if(cplx) { dcltype=atype(); rtype=atype(); } ffassert(pids); ListOfId &ids(*pids); string str("["); const int n=ids.size(); ffassert(n>0); if ( fes->nbitem() != (size_t) n) { cerr << " the array size must be " << fes->nbitem() << " not " << n << endl; CompileError("Invalide array size for vectorial fespace function"); } for (int i=0;i::New(str.size()+1),str.c_str()); C_F0 ret; // modif 100109 (add Block:: before NewVar for g++ 3.3.3 on Suse 9) ret= binit ? currentblock->Block::NewVar(name,dcltype,basicAC_F0_wa(fespacetype,init)) : currentblock->Block::NewVar(name,dcltype,basicAC_F0_wa(fespacetype)); C_F0 base = currentblock->Find(name); if (cplx) for (int i=0;iNewID(cf0type,ids[i].id, C_F0(new CFEi(base,i,n), rtype) ); else for (int i=0;iNewID(cf0type,ids[i].id, C_F0(new FEi(base,i,n), rtype) ); delete pids; // add FH 25032005 return ret ; } C_F0 NewFEvariable(ListOfId * pids,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim) { if(dim==2) return NewFEvariableT(pids,currentblock,fespacetype,init,cplx,dim); else if (dim==3) return NewFEvariableT(pids,currentblock,fespacetype,init,cplx,dim); else CompileError("Invalide fespace on Rd ( d != 2 or 3) "); return C_F0(); } C_F0 NewFEvariable(const char * id,Block *currentblock,C_F0 & fespacetype,CC_F0 init,bool cplx,int dim) { ListOfId * lid =new ListOfId; lid->push_back(UnId(id)); return NewFEvariable(lid,currentblock,fespacetype,init,cplx,dim); } size_t dimFESpaceImage(const basicAC_F0 &args) { //aType t_m2= atype(); // aType t_m3= atype(); aType t_tfe= atype(); aType t_tfe3= atype(); aType t_a= atype(); size_t dim23=0; for (int i=0;inbitem(); else if (args[i].left() == t_a) { const E_Array & ea= *dynamic_cast(args[i].LeftValue()); ffassert(&ea); for (int i=0;i(); aType t_m3= atype(); aType t_tfe= atype(); aType t_tfe3= atype(); //aType t_a= atype(); size_t d=0; // 20 avril 2009 add brak for (int i=0;i0); if ( fes->nbitem() != (size_t) n) { cerr << " the array size must be " << fes->nbitem() << " not " << n << endl; CompileError("Invalid array size for vectorial fespace function"); } for (int i=0;i::New(str.size()+1),str.c_str()); C_F0 ret= currentblock->Block::NewVar(name,dcltype,basicAC_F0_wa(fespacetype,sizeofarray)); C_F0 base = currentblock->Find(name); if(cplx) for (int i=0;iNewID(cf0type,ids[i].id, C_F0(new CFEi(base,i,n), rtype) ); else for (int i=0;iNewID(cf0type,ids[i].id, C_F0(new FEi(base,i,n), rtype) ); delete pids ; // add FH 25032005 return ret ; } C_F0 NewFEarray(ListOfId * pids,Block *currentblock,C_F0 & fespacetype,CC_F0 sizeofarray,bool cplx,int dim) { if(dim==2) return NewFEarrayT(pids,currentblock,fespacetype,sizeofarray,cplx,dim); else if (dim==3) return NewFEarrayT(pids,currentblock,fespacetype,sizeofarray,cplx,dim); else CompileError("Invalid vectorial fespace on Rd ( d != 2 or 3) "); return C_F0(); } C_F0 NewFEarray(const char * id,Block *currentblock,C_F0 & fespacetype,CC_F0 sizeofarray,bool cplx,int dim) { ListOfId *lid= new ListOfId; lid->push_back(UnId(id)); return NewFEarray(lid,currentblock,fespacetype,sizeofarray,cplx,dim); } namespace Fem2D { void Expandsetoflab(Stack stack,const BC_set & bc,set & setoflab) { for (size_t i=0;i( (*bc.on[i])(stack)); setoflab.insert(lab); if ( verbosity>99) cout << lab << " "; } else { KN labs( GetAny >( (*bc.on[i])(stack))); for (long j=0; j99) cout << labs[j] << " "; } } if(verbosity>99) cout << endl; } void Expandsetoflab(Stack stack,const CDomainOfIntegration & di,set & setoflab,bool &all) { for (size_t i=0;i( (*di.what[i])(stack)); setoflab.insert(lab); if ( verbosity>3) cout << lab << " "; all=false; } else { KN labs( GetAny >( (*di.what[i])(stack))); for (long j=0; j3) cout << labs[j] << " "; } all=false; } } } #include "InitFunct.hpp" static addingInitFunct TheaddingInitFunct(-20,init_lgfem); freefem++-3.61-1/src/nw/Makefile.am000644 000767 000024 00000002254 13321622623 017052 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # To create statically linked executables (see configure.ac) CXXLD=$(STATICTOOL) $(CXX) bin_PROGRAMS=FreeFem++ FreeFem++-nw @FFGLUTPROG@ EXTRA_PROGRAMS=ffglut # FFCS:visualization stream redirection ffglut_SOURCES=../Graphics/ffglut.cpp ../Graphics/gggg.cpp ../Graphics/ffthreads.cpp \ ../Graphics/ffthreads.hpp \ ../femlib/fem.cpp ../femlib/Mesh3dn.cpp ../femlib/Mesh2dn.cpp ../femlib/Mesh1dn.cpp ../femlib/GQuadTree.cpp ../femlib/FQuadTree.cpp \ ../femlib/Drawing.cpp ../femlib/mshptg.cpp ../fflib/ffapi.cpp ffglut_DEPENDENCIES= ../libMesh/libMesh.a ffglut_LDADD= ../libMesh/libMesh.a @LIBSGLUT@ @LIBSPTHREAD@ @BLASLIBS@ FreeFem___nw_SOURCES=../Graphics/sansrgraph.cpp ../mpi/parallelempi-empty.cpp ../fflib/ffapi.cpp FreeFem___SOURCES=../Graphics/sansrgraph.cpp ../mpi/parallelempi-empty.cpp ../fflib/ffapi.cpp FreeFem___nw_DEPENDENCIES=../fflib/libff.a ../lglib/liblg.a FreeFem___DEPENDENCIES=../fflib/libff.a ../lglib/liblg.a LDADD=../lglib/liblg.a ../fflib/libff.a @UMFPACKLIBS@ @ARPACKLIBS@ @BLASLIBS@ AM_CPPFLAGS=-I$(srcdir)/../fflib -I$(srcdir)/../Graphics -I$(srcdir)/../.. -I$(srcdir)/../femlib freefem++-3.61-1/src/nw/Makefile.in000644 000767 000024 00000147523 13321623170 017072 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ bin_PROGRAMS = FreeFem++$(EXEEXT) FreeFem++-nw$(EXEEXT) @FFGLUTPROG@ EXTRA_PROGRAMS = ffglut$(EXEEXT) subdir = src/nw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_FreeFem___OBJECTS = sansrgraph.$(OBJEXT) \ parallelempi-empty.$(OBJEXT) ffapi.$(OBJEXT) FreeFem___OBJECTS = $(am_FreeFem___OBJECTS) FreeFem___LDADD = $(LDADD) am_FreeFem___nw_OBJECTS = sansrgraph.$(OBJEXT) \ parallelempi-empty.$(OBJEXT) ffapi.$(OBJEXT) FreeFem___nw_OBJECTS = $(am_FreeFem___nw_OBJECTS) FreeFem___nw_LDADD = $(LDADD) am_ffglut_OBJECTS = ffglut.$(OBJEXT) gggg.$(OBJEXT) \ ffthreads.$(OBJEXT) fem.$(OBJEXT) Mesh3dn.$(OBJEXT) \ Mesh2dn.$(OBJEXT) Mesh1dn.$(OBJEXT) GQuadTree.$(OBJEXT) \ FQuadTree.$(OBJEXT) Drawing.$(OBJEXT) mshptg.$(OBJEXT) \ ffapi.$(OBJEXT) ffglut_OBJECTS = $(am_ffglut_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(FreeFem___SOURCES) $(FreeFem___nw_SOURCES) \ $(ffglut_SOURCES) DIST_SOURCES = $(FreeFem___SOURCES) $(FreeFem___nw_SOURCES) \ $(ffglut_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # To create statically linked executables (see configure.ac) CXXLD = $(STATICTOOL) $(CXX) # FFCS:visualization stream redirection ffglut_SOURCES = ../Graphics/ffglut.cpp ../Graphics/gggg.cpp ../Graphics/ffthreads.cpp \ ../Graphics/ffthreads.hpp \ ../femlib/fem.cpp ../femlib/Mesh3dn.cpp ../femlib/Mesh2dn.cpp ../femlib/Mesh1dn.cpp ../femlib/GQuadTree.cpp ../femlib/FQuadTree.cpp \ ../femlib/Drawing.cpp ../femlib/mshptg.cpp ../fflib/ffapi.cpp ffglut_DEPENDENCIES = ../libMesh/libMesh.a ffglut_LDADD = ../libMesh/libMesh.a @LIBSGLUT@ @LIBSPTHREAD@ @BLASLIBS@ FreeFem___nw_SOURCES = ../Graphics/sansrgraph.cpp ../mpi/parallelempi-empty.cpp ../fflib/ffapi.cpp FreeFem___SOURCES = ../Graphics/sansrgraph.cpp ../mpi/parallelempi-empty.cpp ../fflib/ffapi.cpp FreeFem___nw_DEPENDENCIES = ../fflib/libff.a ../lglib/liblg.a FreeFem___DEPENDENCIES = ../fflib/libff.a ../lglib/liblg.a LDADD = ../lglib/liblg.a ../fflib/libff.a @UMFPACKLIBS@ @ARPACKLIBS@ @BLASLIBS@ AM_CPPFLAGS = -I$(srcdir)/../fflib -I$(srcdir)/../Graphics -I$(srcdir)/../.. -I$(srcdir)/../femlib all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/nw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/nw/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) FreeFem++$(EXEEXT): $(FreeFem___OBJECTS) $(FreeFem___DEPENDENCIES) $(EXTRA_FreeFem___DEPENDENCIES) @rm -f FreeFem++$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(FreeFem___OBJECTS) $(FreeFem___LDADD) $(LIBS) FreeFem++-nw$(EXEEXT): $(FreeFem___nw_OBJECTS) $(FreeFem___nw_DEPENDENCIES) $(EXTRA_FreeFem___nw_DEPENDENCIES) @rm -f FreeFem++-nw$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(FreeFem___nw_OBJECTS) $(FreeFem___nw_LDADD) $(LIBS) ffglut$(EXEEXT): $(ffglut_OBJECTS) $(ffglut_DEPENDENCIES) $(EXTRA_ffglut_DEPENDENCIES) @rm -f ffglut$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(ffglut_OBJECTS) $(ffglut_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Drawing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FQuadTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GQuadTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh1dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh2dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mesh3dn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffglut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffthreads.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gggg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mshptg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallelempi-empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sansrgraph.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` sansrgraph.o: ../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sansrgraph.o -MD -MP -MF $(DEPDIR)/sansrgraph.Tpo -c -o sansrgraph.o `test -f '../Graphics/sansrgraph.cpp' || echo '$(srcdir)/'`../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sansrgraph.Tpo $(DEPDIR)/sansrgraph.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/sansrgraph.cpp' object='sansrgraph.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sansrgraph.o `test -f '../Graphics/sansrgraph.cpp' || echo '$(srcdir)/'`../Graphics/sansrgraph.cpp sansrgraph.obj: ../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sansrgraph.obj -MD -MP -MF $(DEPDIR)/sansrgraph.Tpo -c -o sansrgraph.obj `if test -f '../Graphics/sansrgraph.cpp'; then $(CYGPATH_W) '../Graphics/sansrgraph.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/sansrgraph.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sansrgraph.Tpo $(DEPDIR)/sansrgraph.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/sansrgraph.cpp' object='sansrgraph.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sansrgraph.obj `if test -f '../Graphics/sansrgraph.cpp'; then $(CYGPATH_W) '../Graphics/sansrgraph.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/sansrgraph.cpp'; fi` parallelempi-empty.o: ../mpi/parallelempi-empty.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parallelempi-empty.o -MD -MP -MF $(DEPDIR)/parallelempi-empty.Tpo -c -o parallelempi-empty.o `test -f '../mpi/parallelempi-empty.cpp' || echo '$(srcdir)/'`../mpi/parallelempi-empty.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/parallelempi-empty.Tpo $(DEPDIR)/parallelempi-empty.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../mpi/parallelempi-empty.cpp' object='parallelempi-empty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parallelempi-empty.o `test -f '../mpi/parallelempi-empty.cpp' || echo '$(srcdir)/'`../mpi/parallelempi-empty.cpp parallelempi-empty.obj: ../mpi/parallelempi-empty.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parallelempi-empty.obj -MD -MP -MF $(DEPDIR)/parallelempi-empty.Tpo -c -o parallelempi-empty.obj `if test -f '../mpi/parallelempi-empty.cpp'; then $(CYGPATH_W) '../mpi/parallelempi-empty.cpp'; else $(CYGPATH_W) '$(srcdir)/../mpi/parallelempi-empty.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/parallelempi-empty.Tpo $(DEPDIR)/parallelempi-empty.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../mpi/parallelempi-empty.cpp' object='parallelempi-empty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parallelempi-empty.obj `if test -f '../mpi/parallelempi-empty.cpp'; then $(CYGPATH_W) '../mpi/parallelempi-empty.cpp'; else $(CYGPATH_W) '$(srcdir)/../mpi/parallelempi-empty.cpp'; fi` ffapi.o: ../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffapi.o -MD -MP -MF $(DEPDIR)/ffapi.Tpo -c -o ffapi.o `test -f '../fflib/ffapi.cpp' || echo '$(srcdir)/'`../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffapi.Tpo $(DEPDIR)/ffapi.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../fflib/ffapi.cpp' object='ffapi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffapi.o `test -f '../fflib/ffapi.cpp' || echo '$(srcdir)/'`../fflib/ffapi.cpp ffapi.obj: ../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffapi.obj -MD -MP -MF $(DEPDIR)/ffapi.Tpo -c -o ffapi.obj `if test -f '../fflib/ffapi.cpp'; then $(CYGPATH_W) '../fflib/ffapi.cpp'; else $(CYGPATH_W) '$(srcdir)/../fflib/ffapi.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffapi.Tpo $(DEPDIR)/ffapi.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../fflib/ffapi.cpp' object='ffapi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffapi.obj `if test -f '../fflib/ffapi.cpp'; then $(CYGPATH_W) '../fflib/ffapi.cpp'; else $(CYGPATH_W) '$(srcdir)/../fflib/ffapi.cpp'; fi` ffglut.o: ../Graphics/ffglut.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffglut.o -MD -MP -MF $(DEPDIR)/ffglut.Tpo -c -o ffglut.o `test -f '../Graphics/ffglut.cpp' || echo '$(srcdir)/'`../Graphics/ffglut.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffglut.Tpo $(DEPDIR)/ffglut.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/ffglut.cpp' object='ffglut.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffglut.o `test -f '../Graphics/ffglut.cpp' || echo '$(srcdir)/'`../Graphics/ffglut.cpp ffglut.obj: ../Graphics/ffglut.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffglut.obj -MD -MP -MF $(DEPDIR)/ffglut.Tpo -c -o ffglut.obj `if test -f '../Graphics/ffglut.cpp'; then $(CYGPATH_W) '../Graphics/ffglut.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/ffglut.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffglut.Tpo $(DEPDIR)/ffglut.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/ffglut.cpp' object='ffglut.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffglut.obj `if test -f '../Graphics/ffglut.cpp'; then $(CYGPATH_W) '../Graphics/ffglut.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/ffglut.cpp'; fi` gggg.o: ../Graphics/gggg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gggg.o -MD -MP -MF $(DEPDIR)/gggg.Tpo -c -o gggg.o `test -f '../Graphics/gggg.cpp' || echo '$(srcdir)/'`../Graphics/gggg.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gggg.Tpo $(DEPDIR)/gggg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/gggg.cpp' object='gggg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gggg.o `test -f '../Graphics/gggg.cpp' || echo '$(srcdir)/'`../Graphics/gggg.cpp gggg.obj: ../Graphics/gggg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gggg.obj -MD -MP -MF $(DEPDIR)/gggg.Tpo -c -o gggg.obj `if test -f '../Graphics/gggg.cpp'; then $(CYGPATH_W) '../Graphics/gggg.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/gggg.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gggg.Tpo $(DEPDIR)/gggg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/gggg.cpp' object='gggg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gggg.obj `if test -f '../Graphics/gggg.cpp'; then $(CYGPATH_W) '../Graphics/gggg.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/gggg.cpp'; fi` ffthreads.o: ../Graphics/ffthreads.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffthreads.o -MD -MP -MF $(DEPDIR)/ffthreads.Tpo -c -o ffthreads.o `test -f '../Graphics/ffthreads.cpp' || echo '$(srcdir)/'`../Graphics/ffthreads.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffthreads.Tpo $(DEPDIR)/ffthreads.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/ffthreads.cpp' object='ffthreads.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffthreads.o `test -f '../Graphics/ffthreads.cpp' || echo '$(srcdir)/'`../Graphics/ffthreads.cpp ffthreads.obj: ../Graphics/ffthreads.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffthreads.obj -MD -MP -MF $(DEPDIR)/ffthreads.Tpo -c -o ffthreads.obj `if test -f '../Graphics/ffthreads.cpp'; then $(CYGPATH_W) '../Graphics/ffthreads.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/ffthreads.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffthreads.Tpo $(DEPDIR)/ffthreads.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/ffthreads.cpp' object='ffthreads.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffthreads.obj `if test -f '../Graphics/ffthreads.cpp'; then $(CYGPATH_W) '../Graphics/ffthreads.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/ffthreads.cpp'; fi` fem.o: ../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fem.o -MD -MP -MF $(DEPDIR)/fem.Tpo -c -o fem.o `test -f '../femlib/fem.cpp' || echo '$(srcdir)/'`../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fem.Tpo $(DEPDIR)/fem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/fem.cpp' object='fem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fem.o `test -f '../femlib/fem.cpp' || echo '$(srcdir)/'`../femlib/fem.cpp fem.obj: ../femlib/fem.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fem.obj -MD -MP -MF $(DEPDIR)/fem.Tpo -c -o fem.obj `if test -f '../femlib/fem.cpp'; then $(CYGPATH_W) '../femlib/fem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/fem.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fem.Tpo $(DEPDIR)/fem.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/fem.cpp' object='fem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fem.obj `if test -f '../femlib/fem.cpp'; then $(CYGPATH_W) '../femlib/fem.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/fem.cpp'; fi` Mesh3dn.o: ../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh3dn.o -MD -MP -MF $(DEPDIR)/Mesh3dn.Tpo -c -o Mesh3dn.o `test -f '../femlib/Mesh3dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh3dn.Tpo $(DEPDIR)/Mesh3dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh3dn.cpp' object='Mesh3dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh3dn.o `test -f '../femlib/Mesh3dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh3dn.cpp Mesh3dn.obj: ../femlib/Mesh3dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh3dn.obj -MD -MP -MF $(DEPDIR)/Mesh3dn.Tpo -c -o Mesh3dn.obj `if test -f '../femlib/Mesh3dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh3dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh3dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh3dn.Tpo $(DEPDIR)/Mesh3dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh3dn.cpp' object='Mesh3dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh3dn.obj `if test -f '../femlib/Mesh3dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh3dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh3dn.cpp'; fi` Mesh2dn.o: ../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2dn.o -MD -MP -MF $(DEPDIR)/Mesh2dn.Tpo -c -o Mesh2dn.o `test -f '../femlib/Mesh2dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2dn.Tpo $(DEPDIR)/Mesh2dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh2dn.cpp' object='Mesh2dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2dn.o `test -f '../femlib/Mesh2dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh2dn.cpp Mesh2dn.obj: ../femlib/Mesh2dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh2dn.obj -MD -MP -MF $(DEPDIR)/Mesh2dn.Tpo -c -o Mesh2dn.obj `if test -f '../femlib/Mesh2dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh2dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh2dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh2dn.Tpo $(DEPDIR)/Mesh2dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh2dn.cpp' object='Mesh2dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh2dn.obj `if test -f '../femlib/Mesh2dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh2dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh2dn.cpp'; fi` Mesh1dn.o: ../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh1dn.o -MD -MP -MF $(DEPDIR)/Mesh1dn.Tpo -c -o Mesh1dn.o `test -f '../femlib/Mesh1dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh1dn.Tpo $(DEPDIR)/Mesh1dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh1dn.cpp' object='Mesh1dn.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh1dn.o `test -f '../femlib/Mesh1dn.cpp' || echo '$(srcdir)/'`../femlib/Mesh1dn.cpp Mesh1dn.obj: ../femlib/Mesh1dn.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Mesh1dn.obj -MD -MP -MF $(DEPDIR)/Mesh1dn.Tpo -c -o Mesh1dn.obj `if test -f '../femlib/Mesh1dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh1dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh1dn.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Mesh1dn.Tpo $(DEPDIR)/Mesh1dn.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Mesh1dn.cpp' object='Mesh1dn.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Mesh1dn.obj `if test -f '../femlib/Mesh1dn.cpp'; then $(CYGPATH_W) '../femlib/Mesh1dn.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Mesh1dn.cpp'; fi` GQuadTree.o: ../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GQuadTree.o -MD -MP -MF $(DEPDIR)/GQuadTree.Tpo -c -o GQuadTree.o `test -f '../femlib/GQuadTree.cpp' || echo '$(srcdir)/'`../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/GQuadTree.Tpo $(DEPDIR)/GQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/GQuadTree.cpp' object='GQuadTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GQuadTree.o `test -f '../femlib/GQuadTree.cpp' || echo '$(srcdir)/'`../femlib/GQuadTree.cpp GQuadTree.obj: ../femlib/GQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GQuadTree.obj -MD -MP -MF $(DEPDIR)/GQuadTree.Tpo -c -o GQuadTree.obj `if test -f '../femlib/GQuadTree.cpp'; then $(CYGPATH_W) '../femlib/GQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/GQuadTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/GQuadTree.Tpo $(DEPDIR)/GQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/GQuadTree.cpp' object='GQuadTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GQuadTree.obj `if test -f '../femlib/GQuadTree.cpp'; then $(CYGPATH_W) '../femlib/GQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/GQuadTree.cpp'; fi` FQuadTree.o: ../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FQuadTree.o -MD -MP -MF $(DEPDIR)/FQuadTree.Tpo -c -o FQuadTree.o `test -f '../femlib/FQuadTree.cpp' || echo '$(srcdir)/'`../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FQuadTree.Tpo $(DEPDIR)/FQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FQuadTree.cpp' object='FQuadTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FQuadTree.o `test -f '../femlib/FQuadTree.cpp' || echo '$(srcdir)/'`../femlib/FQuadTree.cpp FQuadTree.obj: ../femlib/FQuadTree.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FQuadTree.obj -MD -MP -MF $(DEPDIR)/FQuadTree.Tpo -c -o FQuadTree.obj `if test -f '../femlib/FQuadTree.cpp'; then $(CYGPATH_W) '../femlib/FQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FQuadTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/FQuadTree.Tpo $(DEPDIR)/FQuadTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/FQuadTree.cpp' object='FQuadTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FQuadTree.obj `if test -f '../femlib/FQuadTree.cpp'; then $(CYGPATH_W) '../femlib/FQuadTree.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/FQuadTree.cpp'; fi` Drawing.o: ../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Drawing.o -MD -MP -MF $(DEPDIR)/Drawing.Tpo -c -o Drawing.o `test -f '../femlib/Drawing.cpp' || echo '$(srcdir)/'`../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Drawing.Tpo $(DEPDIR)/Drawing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Drawing.cpp' object='Drawing.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Drawing.o `test -f '../femlib/Drawing.cpp' || echo '$(srcdir)/'`../femlib/Drawing.cpp Drawing.obj: ../femlib/Drawing.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Drawing.obj -MD -MP -MF $(DEPDIR)/Drawing.Tpo -c -o Drawing.obj `if test -f '../femlib/Drawing.cpp'; then $(CYGPATH_W) '../femlib/Drawing.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Drawing.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/Drawing.Tpo $(DEPDIR)/Drawing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/Drawing.cpp' object='Drawing.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Drawing.obj `if test -f '../femlib/Drawing.cpp'; then $(CYGPATH_W) '../femlib/Drawing.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/Drawing.cpp'; fi` mshptg.o: ../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mshptg.o -MD -MP -MF $(DEPDIR)/mshptg.Tpo -c -o mshptg.o `test -f '../femlib/mshptg.cpp' || echo '$(srcdir)/'`../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mshptg.Tpo $(DEPDIR)/mshptg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/mshptg.cpp' object='mshptg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mshptg.o `test -f '../femlib/mshptg.cpp' || echo '$(srcdir)/'`../femlib/mshptg.cpp mshptg.obj: ../femlib/mshptg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mshptg.obj -MD -MP -MF $(DEPDIR)/mshptg.Tpo -c -o mshptg.obj `if test -f '../femlib/mshptg.cpp'; then $(CYGPATH_W) '../femlib/mshptg.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/mshptg.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mshptg.Tpo $(DEPDIR)/mshptg.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../femlib/mshptg.cpp' object='mshptg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mshptg.obj `if test -f '../femlib/mshptg.cpp'; then $(CYGPATH_W) '../femlib/mshptg.cpp'; else $(CYGPATH_W) '$(srcdir)/../femlib/mshptg.cpp'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) installdirs: for dir in "$(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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic 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-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 pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/Eigen/arpackff.hpp000644 000767 000024 00000040013 13256636774 017725 0ustar00hechtstaff000000 000000 /* The freefem++ arpack interface without arpack ++ aprack++ is do too much c++ error with modern compiler but a by tanks to arpack++ for the idea of this code F. Hecht. */ // Change V[1] -> V[0] // Change workev[1] -> workev[0] #ifndef ARPACKFF_HPP #define ARPACKFF_HPP #include "error.hpp" typedef int integer; typedef int logical; #define F77NAME(x) x ## _ #define HIDDEN_HBW ,int,int,int #define HIDDEN_BW ,int,int #define HIDDEN_12 ,1,2 #define HIDDEN_112 ,1,1,2 extern "C" { /* // debug "common" statement. struct { integer logfil, ndigit, mgetv0; integer msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd; integer mnaupd, mnaup2, mnaitr, mneigt, mnapps, mngets, mneupd; integer mcaupd, mcaup2, mcaitr, mceigt, mcapps, mcgets, mceupd; } F77NAME(debug); // add FH pour lib dynamic so win 32 struct { integer nopx, nbx, nrorth, nitref, nrstrt; float tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv, tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv, tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv, tmvopx, tmvbx, tgetv0, titref, trvec; } F77NAME(timing); */ // double precision symmetric routines. void F77NAME(dsaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, double *tol, double *resid, integer *ncv, double *V, integer *ldv, integer *iparam, integer *ipntr, double *workd, double *workl, integer *lworkl, integer *info HIDDEN_BW); void F77NAME(dseupd)(logical *rvec, char *HowMny, logical *select, double *d, double *Z, integer *ldz, double *sigma, char *bmat, integer *n, char *which, integer *nev, double *tol, double *resid, integer *ncv, double *V, integer *ldv, integer *iparam, integer *ipntr, double *workd, double *workl, integer *lworkl, integer *info HIDDEN_HBW ); // double precision nonsymmetric routines. void F77NAME(dnaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, double *tol, double *resid, integer *ncv, double *V, integer *ldv, integer *iparam, integer *ipntr, double *workd, double *workl, integer *lworkl, integer *info HIDDEN_BW); void F77NAME(dneupd)(logical *rvec, char *HowMny, logical *select, double *dr, double *di, double *Z, integer *ldz, double *sigmar, double *sigmai, double *workev, char *bmat, integer *n, char *which, integer *nev, double *tol, double *resid, integer *ncv, double *V, integer *ldv, integer *iparam, integer *ipntr, double *workd, double *workl, integer *lworkl, integer *info HIDDEN_HBW); // single precision symmetric routines. void F77NAME(ssaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, float *tol, float *resid, integer *ncv, float *V, integer *ldv, integer *iparam, integer *ipntr, float *workd, float *workl, integer *lworkl, integer *info HIDDEN_BW); void F77NAME(sseupd)(logical *rvec, char *HowMny, logical *select, float *d, float *Z, integer *ldz, float *sigma, char *bmat, integer *n, char *which, integer *nev, float *tol, float *resid, integer *ncv, float *V, integer *ldv, integer *iparam, integer *ipntr, float *workd, float *workl, integer *lworkl, integer *info HIDDEN_HBW); // single precision nonsymmetric routines. void F77NAME(snaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, float *tol, float *resid, integer *ncv, float *V, integer *ldv, integer *iparam, integer *ipntr, float *workd, float *workl, integer *lworkl, integer *info HIDDEN_BW); void F77NAME(sneupd)(logical *rvec, char *HowMny, logical *select, float *dr, float *di, float *Z, integer *ldz, float *sigmar, float *sigmai, float *workev, char *bmat, integer *n, char *which, integer *nev, float *tol, float *resid, integer *ncv, float *V, integer *ldv, integer *iparam, integer *ipntr, float *workd, float *workl, integer *lworkl, integer *info HIDDEN_HBW); void F77NAME(cnaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, float *tol, complex *resid, integer *ncv, complex *V, integer *ldv, integer *iparam, integer *ipntr, complex *workd, complex *workl, integer *lworkl, float *rwork, integer *info HIDDEN_BW); void F77NAME(cneupd)(logical *rvec, char *HowMny, logical *select, complex *d, complex *Z, integer *ldz, complex *sigma, complex *workev, char *bmat, integer *n, char *which, integer *nev, float *tol, complex *resid, integer *ncv, complex *V, integer *ldv, integer *iparam, integer *ipntr, complex *workd, complex *workl, integer *lworkl, float *rwork, integer *info HIDDEN_HBW); // double precision complex routines. void F77NAME(znaupd)(integer *ido, char *bmat, integer *n, char *which, integer *nev, double *tol, complex *resid, integer *ncv, complex *V, integer *ldv, integer *iparam, integer *ipntr, complex *workd, complex *workl, integer *lworkl, double *rwork, integer *info HIDDEN_BW); void F77NAME(zneupd)(logical *rvec, char *HowMny, logical *select, complex *d, complex *Z, integer *ldz, complex *sigma, complex *workev, char *bmat, integer *n, char *which, integer *nev, double *tol, complex *resid, integer *ncv, complex *V, integer *ldv, integer *iparam, integer *ipntr, complex *workd, complex *workl, integer *lworkl, double *rwork, integer *info HIDDEN_HBW); } inline void saupp(int& ido, char bmat, int n, char* which, int nev, double& tol, double resid[], int ncv, double V[], int ldv, int iparam[], int ipntr[], double workd[], double workl[], int lworkl, int& info) { F77NAME(dsaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_12); } // saupp (double). inline void saupp(int& ido, char bmat, int n, char* which, int nev, float& tol, float resid[], int ncv, float V[], int ldv, int iparam[], int ipntr[], float workd[], float workl[], int lworkl, int& info) { F77NAME(ssaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_12); } // saupp (float). inline void seupp(bool rvec, char HowMny, double d[], double Z[], int ldz, double sigma, char bmat, int n, char* which, int nev, double tol, double resid[], int ncv, double V[], int ldv, int iparam[], int ipntr[], double workd[], double workl[], int lworkl, int& info) { int irvec; logical* iselect; double* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(dseupd)(&irvec, &HowMny, iselect, d, iZ, &ldz, &sigma, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_112); delete[] iselect; } // seupp (double). inline void seupp(bool rvec, char HowMny, float d[], float Z[], int ldz, float sigma, char bmat, int n, char* which, int nev, float tol, float resid[], int ncv, float V[], int ldv, int iparam[], int ipntr[], float workd[], float workl[], int lworkl, int& info) { int irvec; logical* iselect; float* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(sseupd)(&irvec, &HowMny, iselect, d, iZ, &ldz, &sigma, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_112 ); delete[] iselect; } // seupp (float). inline void naupp(int& ido, char bmat, int n, char* which, int nev, double& tol, double resid[], int ncv, double V[], int ldv, int iparam[], int ipntr[], double workd[], double workl[], int lworkl, int& info) { F77NAME(dnaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_12); } // naupp (double). inline void naupp(int& ido, char bmat, int n, char* which, int nev, float& tol, float resid[], int ncv, float V[], int ldv, int iparam[], int ipntr[], float workd[], float workl[], int lworkl, int& info) { F77NAME(snaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_12 ); } // naupp (float). inline void caupp(int& ido, char bmat, int n, char* which, int nev, double& tol, complex resid[], int ncv, complex V[], int ldv, int iparam[], int ipntr[], complex workd[], complex workl[], int lworkl, double rwork[], int& info) { F77NAME(znaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &rwork[1], &info HIDDEN_12 ); } // caupp inline void caupp(int& ido, char bmat, int n, char* which, int nev, float& tol, complex resid[], int ncv, complex V[], int ldv, int iparam[], int ipntr[], complex workd[], complex workl[], int lworkl, float rwork[], int& info) { F77NAME(cnaupd)(&ido, &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &rwork[1], &info HIDDEN_12); } // caupp inline void ceupp(bool rvec, char HowMny, complex d[], complex Z[], int ldz, complex sigma, complex workev[], char bmat, int n, char* which, int nev, double tol, complex resid[], int ncv, complex V[], int ldv, int iparam[], int ipntr[], complex workd[], complex workl[], int lworkl, double rwork[], int& info) { int irvec; logical* iselect; complex* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(zneupd)(&irvec, &HowMny, iselect, d, iZ, &ldz, &sigma, &workev[0], &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &rwork[1], &info HIDDEN_112); delete[] iselect; } // ceupp (complex). inline void ceupp(bool rvec, char HowMny, complex d[], complex Z[], int ldz, complex sigma, complex workev[], char bmat, int n, char* which, int nev, float tol, complex resid[], int ncv, complex V[], int ldv, int iparam[], int ipntr[], complex workd[], complex workl[], int lworkl, float rwork[], int& info) { int irvec; logical* iselect; complex* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(cneupd)(&irvec, &HowMny, iselect, d, iZ, &ldz, &sigma, &workev[0], &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &rwork[1], &info HIDDEN_112); delete[] iselect; } // ceupp (complex). inline void neupp(bool rvec, char HowMny, double dr[], double di[], double Z[], int ldz, double sigmar, double sigmai, double workv[], char bmat, int n, char* which, int nev, double tol, double resid[], int ncv, double V[], int ldv, int iparam[], int ipntr[], double workd[], double workl[], int lworkl, int& info) { int irvec; logical* iselect; double* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(dneupd)(&irvec, &HowMny, iselect, dr, di, iZ, &ldz, &sigmar, &sigmai, &workv[1], &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_112); delete[] iselect; } // neupp (double). inline void neupp(bool rvec, char HowMny, float dr[], float di[], float Z[], int ldz, float sigmar, float sigmai, float workv[], char bmat, int n, char* which, int nev, float tol, float resid[], int ncv, float V[], int ldv, int iparam[], int ipntr[], float workd[], float workl[], int lworkl, int& info) { int irvec; logical* iselect; float* iZ; irvec = (int) rvec; iselect = new logical[ncv]; iZ = (Z == NULL) ? &V[0] : Z; F77NAME(sneupd)(&irvec, &HowMny, iselect, dr, di, iZ, &ldz, &sigmar, &sigmai, &workv[1], &bmat, &n, which, &nev, &tol, resid, &ncv, &V[0], &ldv, &iparam[1], &ipntr[1], &workd[1], &workl[1], &lworkl, &info HIDDEN_112); delete[] iselect; } // neupp (float). inline void sauppError(int info) { if(info<0) cerr << " erreur arpack sauppError" < #include #include #include #include using namespace std; #include "error.hpp" #include "arpackff.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include "RNM.hpp" #include "MatriceCreuse_tpl.hpp" #include "Mesh3dn.hpp" #include "MeshPoint.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" //#include "ffstack.hpp" extern Block *currentblock; typedef double R; static bool dddd=false; template void Show(int ido,KN_ w,const char *cmm) { cout << cmm << ido << " max " << w.max() << " min " << w.min() << " sum =" << w.sum() << endl; } template class FuncMat: public VirtualMatrice { public: // typedef double K; typedef KN Kn; typedef KN_ Kn_; Stack stack; mutable Kn x; C_F0 c_x; Kn *b; Expression mat1,mat; typedef typename VirtualMatrice::plusAx plusAx; FuncMat(int n,Stack stk,const OneOperator * op,const OneOperator * op1,Kn *bb=0) : VirtualMatrice(n), stack(stk), x(n),c_x(CPValue(x)),b(bb), mat1(op1? CastTo(C_F0(op1->code(basicAC_F0_wa(c_x)),(aType)*op1)):0), mat (op ? CastTo(C_F0(op->code(basicAC_F0_wa(c_x)),(aType)*op)):0) { } FuncMat() { if(mat1!=mat) delete mat; delete mat1; delete c_x.LeftValue();} void addMatMul(const Kn_ & xx, Kn_ & Ax) const { // cout <<" addMatMul " <((*mat)(stack)); if(b && &Ax!=b) Ax += *b; // Ax -b => add b (not in cas of init. b c.a.d &Ax == b WhereStackOfPtr2Free(stack)->clean(); // add dec 2008 } void Solve( KN_ & Ax ,const KN_ & xx) const { ffassert(xx.N()==Ax.N() && mat1); x =xx; Ax = GetAny((*mat1)(stack)); if(b && &Ax!=b) Ax += *b; // Ax -b => add b (not in cas of init. b c.a.d &Ax == b WhereStackOfPtr2Free(stack)->clean(); // add dec 2008 } plusAx operator*(const Kn & x) const {return plusAx(this,x);} virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} bool WithSolver() const {return mat1;} }; void ToWhich(Stack stack,char *which,Expression ew) { if(!ew) strcpy(which,"LM"); else { string * sw=GetAny((*ew)(stack)); if (sw && sw->length()==2) strcpy(which,sw->c_str()); int ok=0; if( strcmp(which,"LM")==0) ok=1; else if( strcmp(which,"LA")==0) ok=1; else if( strcmp(which,"SM")==0) ok=1; else if( strcmp(which,"SA")==0) ok=1; else if( strcmp(which,"SR")==0) ok=1; else if( strcmp(which,"LR")==0) ok=1; else if( strcmp(which,"BE")==0) ok=1; ffassert(ok); } } void CheckMode(int mode,bool A,bool A1,bool B, bool B1) { if( mode ==1) {ffassert(A);} if( mode ==2) {ffassert(A && B && B1 );} if( mode ==3) {ffassert(A1 && B );} } template void DoIdoAction(int ido,char bmat,int mode,KN_ &xx,KN_ &yy,KN_ &zz,KN_ &work,Mat &OP1,Mat &B) { if ((mode==3)&&(bmat=='G')) // shift-invert mode, generalized problem switch (ido) { case -1: //y <--- OP*x = inv[A-SIGMA*M]*M*x if(dddd) Show(ido,xx," <- (xx) "); OP1.Solve(yy,work=B*xx); if(dddd) Show(ido,yy," -> (yy) "); break; case 1:// y <-- OP*x = inv[A-sigma*M]*z if(dddd) Show(ido,zz," <- (zz) "); OP1.Solve(yy,zz); if(dddd) Show(ido,yy," -> (yy) "); break; case 2: // y <--- M*x if(dddd) Show(ido,xx," <- (xx) "); yy = B*xx; if(dddd) Show(ido,yy," -> (yy) "); break; default : ffassert(0); } else if ((mode==2)&&(bmat=='G')) // shift-invert mode, generalized problem { switch (ido) { case -1: // y <--- OP*x = inv[M]*A*x case 1: if(mode== 1) // M = Id yy=OP1*xx; else B.Solve(yy,work=OP1*xx); break; case 2: // y <--- M*x. // not use mode = 1 yy = B*xx; break; default : ffassert(0); } } else if ((mode==1)&&(bmat=='I')) // direct mode, simple problem switch (ido) { case 1: B.Solve(yy,work=OP1*xx); break; default : ffassert(0); } else if ((mode==3)&&(bmat=='I')) // shift-invert mode, simple problem switch (ido) { case -1: case 1: OP1.Solve(yy,work=B*xx); break; default : ffassert(0); } } /*void DoIdoAction(int ido,int mode,KN_ &xx,KN_ &yy,KN_ &zz,KN_ &work,Mat &A,Mat &B) { if(mode>2) // inverse mode switch (ido) { case -1: //y <--- OP*x = inv[A-SIGMA*M]*M*x if(dddd) Show(ido,xx," <- (xx) "); A.Solve(yy,work=B*xx); if(dddd) Show(ido,yy," -> (yy) "); break; case 1:// y <-- OP*x = inv[A-sigma*M]*z if(dddd) Show(ido,zz," <- (zz) "); A.Solve(yy,zz); if(dddd) Show(ido,yy," -> (yy) "); break; case 2: // y <--- M*x if(dddd) Show(ido,xx," <- (xx) "); yy = B*xx; if(dddd) Show(ido,yy," -> (yy) "); break; default : ffassert(0); } else // direct mode switch (ido) { case -1: // y <--- OP*x = inv[M]*A*x case 1: if(mode== 1) // M = Id yy=A*xx; else B.Solve(yy,work=A*xx); break; case 2: // y <--- M*x. // not use mode = 1 yy = B*xx; break; default : ffassert(0); } }*/ template const OneOperator * ToCode(Expression e) { const OneOperator * code=0; if(e!=0) { const Polymorphic * op= dynamic_cast(e); ffassert(op); code= op->Find("(",ArrayOfaType(atype * >(),false)); } return code; } class EigenValue : public OneOperator { public: typedef R K; typedef KN Kn; typedef KN_ Kn_; const int cas; class E_EV: public E_F0mps { public: const int cas; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =18; Expression nargs[n_name_param]; Expression expOP1,expB,expn; const OneOperator * codeOP1, *codeB, *codeOP,*codeB1; template T arg(int i,Stack stack,const T & a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} E_EV(const basicAC_F0 & args,int cc) : cas(cc),expOP1(0),expB(0),expn(0),codeOP1(0), codeB(0), codeOP(0),codeB1(0) { // OP1 = (A-sigma*B) // int nbj= args.size()-1; args.SetNameParam(n_name_param,name_param,nargs); if( cas==1 || cas ==2) { expn=to< long>(args[0]); const Polymorphic * op= dynamic_cast(args[1].LeftValue()); ffassert(op); codeOP1 = op->Find("(",ArrayOfaType(atype(),false)); if( cas== 2) { const Polymorphic * op= dynamic_cast(args[2].LeftValue()); ffassert(op); codeB = op->Find("(",ArrayOfaType(atype(),false)); } } else if( cas== 3) { expn=to< long>(args[0]); } else { expOP1=to< Matrice_Creuse *>(args[0]); expB=to< Matrice_Creuse *>(args[1]); } ffassert( (codeOP1==0) || (nargs[15]==0) ); // Double def ffassert( (codeB==0) || (nargs[14]==0) ); // Double def codeOP=ToCode(nargs[13]); if(!codeB)codeB=ToCode(nargs[14]); if(!codeOP1)codeOP1=ToCode(nargs[15]); codeB1=ToCode(nargs[16]); } AnyType operator()(Stack stack) const; operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_EV(args,cas);} EigenValue() : OneOperator(atype(), atype *>(), atype *>()), cas(0){} EigenValue(int ,int ) : OneOperator(atype(),atype(), atype(), atype()), cas(2){} EigenValue(int ) : OneOperator(atype(),atype(), atype()), cas(1){} EigenValue(int,int,int ) :// All data are given through A=, B= A1=, B1= OneOperator(atype(),atype()), cas(3){} }; class EigenValueC : public OneOperator { public: typedef Complex K; typedef double R; typedef KN Kn; typedef KN_ Kn_; const int cas; class E_EV: public E_F0mps { public: const int cas; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =16; Expression nargs[n_name_param]; Expression expOP1,expB,expn; const OneOperator * codeOP1, *codeB, *codeOP, *codeB1; template T arg(int i,Stack stack,const T & a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} E_EV(const basicAC_F0 & args,int cc) : cas(cc),expOP1(0),expB(0),expn(0),codeOP1(0), codeB(0), codeOP(0),codeB1(0) { // OP1 = (A-sigma*B) // int nbj= args.size()-1; args.SetNameParam(n_name_param,name_param,nargs); if( cas==1 || cas ==2) { expn=to< long>(args[0]); const Polymorphic * op= dynamic_cast(args[1].LeftValue()); ffassert(op); codeOP1 = op->Find("(",ArrayOfaType(atype(),false)); if( cas== 2) { const Polymorphic * op= dynamic_cast(args[2].LeftValue()); ffassert(op); codeB = op->Find("(",ArrayOfaType(atype(),false)); } } else if( cas==3) { expn=to< long>(args[0]); } else { expOP1=to< Matrice_Creuse *>(args[0]); expB=to< Matrice_Creuse *>(args[1]); } ffassert( (codeOP1==0) || (nargs[13]==0) ); // Double def ffassert( (codeB==0) || (nargs[12]==0) ); // Double def codeOP=ToCode(nargs[11]); if(!codeB)codeB=ToCode(nargs[12]); if(!codeOP1)codeOP1=ToCode(nargs[13]); codeB1=ToCode(nargs[14]); } AnyType operator()(Stack stack) const; operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_EV(args,cas);} EigenValueC() : OneOperator(atype(), atype *>(), atype *>()), cas(0){} EigenValueC(int ,int ) : OneOperator(atype(),atype(), atype(), atype()), cas(2){} EigenValueC(int ) : OneOperator(atype(),atype(), atype()), cas(1){} EigenValueC(int,int,int ) :// All data are given through A=, B= A1=, B1= OneOperator(atype(),atype()), cas(3){} }; /* class EigenValueC : public OneOperator { public: typedef Complex K; typedef double R; typedef KN Kn; typedef KN_ Kn_; const int cas; class E_EV: public E_F0mps { public: const int cas; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =10; Expression nargs[n_name_param]; Expression expOP1,expB; template T arg(int i,Stack stack,const T & a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} E_EV(const basicAC_F0 & args,int cc) : cas(cc) { // OP1 = (A-sigma*B) // int nbj= args.size()-1; args.SetNameParam(n_name_param,name_param,nargs); expOP1=to< Matrice_Creuse *>(args[0]); expB=to< Matrice_Creuse *>(args[1]); } AnyType operator()(Stack stack) const; operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_EV(args,cas);} EigenValueC(int c) : OneOperator(atype(), atype *>(), atype *>()), cas(c){} }; */ basicAC_F0::name_and_type EigenValue::E_EV::name_param[]= { { "tol", &typeid(double) }, { "nev",&typeid(long) }, { "sym",&typeid(bool)}, { "sigma",&typeid(double)}, { "value",&typeid(KN *)}, { "vector",&typeid(FEbaseArrayKn *) }, // pferarray { "ncv",&typeid(long) }, // the number of Arnoldi vectors generated { "maxit",&typeid(long)}, // the maximum number of Arnoldi iterations { "ivalue",&typeid(KN *)}, { "rawvector",&typeid(KNM *) }, { "resid",&typeid(KN *) }, { "driver",&typeid(long) }, // 11 ieme { "which",&typeid(string*) }, // 12 ieme { "A",&typeid(Polymorphic*)}, { "B",&typeid(Polymorphic*)}, { "A1",&typeid(Polymorphic*)}, { "B1",&typeid(Polymorphic*)}, { "mode",&typeid(long) } // 17 ieme }; basicAC_F0::name_and_type EigenValueC::E_EV::name_param[]= { { "tol", &typeid(double) }, { "nev",&typeid(long) }, { "sigma",&typeid(K)}, { "value",&typeid(KN *)}, { "vector",&typeid(FEbaseArrayKn *) }, // pfecarray { "ncv",&typeid(long) }, // the number of Arnoldi vectors generated { "maxit",&typeid(long)}, // the maximum number of Arnoldi iterations { "rawvector",&typeid(KNM *) }, { "resid",&typeid(KN *)}, { "driver",&typeid(long) },// 9 ieme { "which",&typeid(string*) }, // 10 ieme { "A",&typeid(Polymorphic*)}, { "B",&typeid(Polymorphic*)}, { "A1",&typeid(Polymorphic*)}, { "B1",&typeid(Polymorphic*)}, { "mode",&typeid(long) } // 15 ieme }; AnyType EigenValue::E_EV::operator()(Stack stack) const { dddd = (verbosity>=200); double tol=1e-6; long nconv=0; long nbev=1; bool sym=false; long ncv =0; // the number of Arnoldi vectors generated long maxit=0; // the maximum number of Arnoldi iterations double sigma=0; int driver = 4; // int mymode = -1;// unset KN * evalue=0; KN * evaluei=0; KN * resid=0; KNM * rawvector=0; //double ws,vs; // for debugging FH ++++++++++ // pferarray evector2; FEbaseArrayKn * evector=0;// change mai 2009 tol=arg(0,stack,0); nbev=arg(1,stack,10); sym=arg(2,stack,false); sigma=arg(3,stack,0.0); evalue=arg *>(4,stack,0); evector =arg *>(5,stack,0); ncv= arg(6,stack,0); maxit= arg(7,stack,0); evaluei=arg *>(8,stack,0); rawvector=arg *>(9,stack,0); resid=arg *>(10,stack,0); mymode = arg(17,stack,-1); driver = arg(11,stack,mymode==2 ? 3 : 4); char which[3]; ToWhich(stack,which,nargs[12]); // evector=evector2.first; Matrice_Creuse *pOP1=0, *pB=0; if(expOP1) pOP1 = GetAny *>((*expOP1)(stack)); if(expB) pB = GetAny *>((*expB)(stack)); double * residptr=resid? (double*) *resid : 0; long n=0; if( pOP1) n =pOP1->A->n; else { ffassert(expn); n = GetAny((*expn)(stack)); } if(evalue) nbev=Max( (long)evalue->N(),nbev); const VirtualMatrice * ptOP1=0, *ptB=0,*ptOP=0, *ptB1=0; if(pOP1) ptOP1= & (const VirtualMatrice&)(pOP1->A); if(pB) ptB = & (const VirtualMatrice&)(pB->A); FuncMat *pcOP=0, *pcB=0; if(codeOP1 || codeOP) ptOP1=pcOP= new FuncMat(n,stack,codeOP,codeOP1); if(codeB || codeB1) ptB=pcB= new FuncMat(n,stack,codeB,codeB1); MatriceIdentite Id(n); if(!ptB) ptB = &Id; const VirtualMatrice &OP1= *ptOP1, &B=*ptB; if(sym) { nbev=min(n-1,nbev); if(!ncv) ncv = min(nbev*2+1,n); } else { nbev=min(nbev,n-2); if(!ncv) ncv = nbev*2+1; } ncv = max(nbev+2,ncv); ncv = min(ncv,n); if(!maxit) maxit = 100*nbev; const char *serr[10]; int err=0; if( ! (nbev < n) ) serr[err++]=" Number of eigenvalues of OP to be computed nev <= n "; if( (driver < 1 || driver > 5) && sym) serr[err++]=" the driver = 1 ,2 ,3, 4, 5 "; if( (driver < 1 || driver > 4) && !sym) serr[err++]=" the driver = 1 ,2 ,3, 4 "; // 2 <= NCV-NEV and NCV <= N if( ! ( ncv <= n) && sym ) serr[err++]=" ( ncv <= n) (symetric case) "; if( ! ( ( ncv <= n) && 2 <= (ncv-nbev ) ) && !sym ) serr[err++]=" ( ncv <= n) 2 <= (ncv-nev ) ( no-symetric case) "; if (n != OP1.M) serr[err++]=" the first matrix in EigneValue is not square."; if (n != B.N ) serr[err++]="Sorry the row's number of the secand matrix in EigneValue is wrong."; if (n != B.M ) serr[err++]="Sorry the colum's number of the secand matrix in EigneValue is wrong."; if(verbosity && mpirank==0) { if(sym) cout << "Real symmetric eigenvalue problem: A*x - B*x*lambda" << endl; else cout << "Real non symmetric eigenvalue problem: A*x - B*x*lambda" << endl; } if(verbosity>9 || err) cout << " n " << n << ", nev "<< nbev << ", tol =" << tol << ", maxit =" << maxit << ", ncv = " < work(n); int dmode[]={-1,1,3,2,3}; if(sym) { int ido=0; //char bmat= mode == 1 ? 'I' : 'G'; char bmat = (driver<3)? 'I' : 'G'; int mode = dmode[driver]; if( mymode>0 && (mymode != mode)) { cerr << " Erreur mode== " << mymode << " == " << mode << " driver =" << driver << endl; ExecError("wrong mod in Arpack sym");} // char which[3]= "LM"; // larger value // if(mode >2) which[0] ='S'; // smaller value int ishift=1; // Auto Shift true by default int iparam[12]= {0,ishift,0,(int)maxit,1,(int) nconv,0,mode,0,0,0,0}; int ipntr[12]={ 0,0,0, 0,0,0, 0,0,0, 0,0,0 }; KN workd(3*n+1); int lworkl = ncv*(ncv+9); KN workl(lworkl+1); KN vp(ncv*n+1); int info= (residptr !=0); KN vresid(residptr? 1: n); if(!residptr) residptr=&vresid[0]; while (1) { saupp(ido,bmat,n,which,nbev,tol, residptr, ncv, vp, n, iparam, ipntr, workd, workl, lworkl, info); if(verbosity>99) cout << " saupp ido: " << ido << " info : " << info << endl; if(info<0) {cerr << " -- err arpack info = " << info << endl;} sauppError(info); if(ido==99) break; KN_ xx(&workd[ipntr[1]],n); KN_ yy(&workd[ipntr[2]],n); KN_ zz(&workd[ipntr[3]],n); DoIdoAction(ido,bmat,mode,xx,yy,zz,work,OP1,B); } nconv = iparam[5]; if(nconv==0) cerr << " -- Strange: no eigens values ??? " << endl; // Finding eigenvalues and eigenvectors. if(nconv) { int newdim = nbev; if(nconv>nbev) { cerr << "WARNING: nconv(saupp) > nbev: " << nconv << " > " << nbev << endl; newdim = nconv; } KN evr(newdim); KNM Z(n,newdim); int ldz=n; char HowMny ='A'; int rvec=1; seupp( rvec, HowMny, evr, Z, ldz, sigma, bmat, n, which, nbev, tol, residptr, ncv, vp, n, iparam,ipntr, workd, workl,lworkl,info); if(verbosity>5) { cout << "Dimension of the system : " << n << endl; cout << "Number of 'requested' eigenvalues : " << nbev << endl; cout << "Number of 'converged' eigenvalues : " << nconv << endl; cout << "Number of Arnoldi vectors generated: " << ncv << endl; cout << "Number of iterations taken : " << iparam[3] << endl; cout << endl; nconv = min(nconv,nbev); //if (prob.EigenvaluesFound()) { cout << "Eigenvalues:" << endl;// Add FH feb 2016 for (int i=0; i vi(Z(':',i)) ; if(verbosity>99) cout <<" Eigenvector: :" << vi << endl; } cout << endl; } if (evalue) { KN & ev(*evalue); int m = Min(nconv,ev.N()); for(int i=0;iM()); ffassert(rawvector->N()==n); for(int i=0;i vi(Z(':',i)) ; // cout << " ------ EV--raw " << vi.min() << " " << vi.max() << endl; (*rawvector)(':',i)=vi; } } if (evector) { FEbaseArrayKn & ev(*evector); int m = Min(nconv,(long) ev.N); for(int i=0;i & xx= *(ev(i)); //if(xx.pVh->NbDoF != n) //ExecError("Wrong Type size of FEspace to store the eigen vector "); // if (xx.pVh != pOP1->pUh) // ExecError("Wrong Type of FEspace to store the eigen vector "); //xx.Vh = pOP1->Uh; KN_ vi(Z(':',i)) ; ev.set(i,vi); } } } } else { // cas non symetrique , // Finding an Arnoldi basis. //int mode=3; // Shift invert int ido=0; //char bmat='G'; char bmat = (driver<3)? 'I' : 'G'; int mode = dmode[driver]; if( mymode>0 && (mymode != mode)) { cerr << " Erreur nosym mode== " << mymode << " == " << mode << " driver =" << driver << endl; ExecError("wrong mod in Arpack no sym");} // char which[]="LM"; int ishift=1; // Auto Shift true by default int iparam[12]= {0,ishift,0,(int)maxit,1,(int)nconv,0,mode,0,0,0,0}; int ipntr[15]={ 0,0,0, 0,0,0, 0,0,0, 0,0,0 ,0,0,0}; KN workd(3*n+1); int lworkl = 3*ncv*(ncv+2); KN workl(lworkl+1); KN vp(ncv*n+1); int info= (residptr !=0); KN vresid(residptr? 1: n); if(!residptr) residptr=&vresid[0]; if(verbosity>9) cout << " n " << n << " nbev "<< nbev << " tol =" << tol << " maxit =" << maxit << " ncv = " <99) {cout << " naupp ido: " << ido << " info : " << info << endl;} if(info<0) {cerr << " -- err arpack info = " << info << endl;} sauppError(info); if(ido==99) break; KN_ xx(&workd[ipntr[1]],n); KN_ yy(&workd[ipntr[2]],n); KN_ zz(&workd[ipntr[3]],n); DoIdoAction(ido,bmat,mode,xx,yy,zz,work,OP1,B); } nconv = iparam[5]; if(nconv) { int newdim = nbev; if(nconv>nbev) { cerr << "WARNING: nconv(naupp) > nbev: " << nconv << " > " << nbev << endl; newdim = nconv; } KN evr(newdim+1), evi(newdim+1); KNM Z(n,newdim+1); KN workev(3*ncv); int ldz=n; char HowMny ='A'; int rvec=1; double sigmai=0; neupp( rvec, HowMny, evr,evi, Z , ldz, sigma,sigmai, workev, bmat, n, which, nbev, tol, residptr, ncv, vp, n, iparam , ipntr, workd, workl,lworkl,info); if (verbosity) { cout << "Real non-symmetric eigenvalue problem: A*x - B*x*lambda" << endl; cout << "mode " << mode << " sigma=" << sigma << endl << endl; cout << "Dimension of the system : " << n << endl; cout << "Number of 'requested' eigenvalues : " << nbev << endl; cout << "Number of 'converged' eigenvalues : " << nconv << endl; cout << "Number of Arnoldi vectors generated: " << ncv << endl; cout << "Number of iterations taken : " << iparam[3] << endl; cout << endl; nconv = min(nconv,nbev);// Add FH feb 2016 cout << "Eigenvalues:" << endl; for (int i=0; i vi(Z(':',i)) ; if(verbosity>99) { cout <<" Eigenvector: :" << vi << endl; cout << endl; } } } if (evalue) { KN & ev(*evalue); int m = Min(nconv,ev.N()); for(int i=0;i & ev(*evaluei); int m = Min(nconv,ev.N()); for(int i=0;iM()); ffassert(rawvector->N()==n); for(int i=0;i vi(Z(':',i)) ; if(verbosity>2 && mpirank ==0 ) cout << " ------ EV--raw " << vi.min() << " " << vi.max() << endl; (*rawvector)(':',i)=vi; } } if (evector) { // K* rawev(prob.RawEigenvectors()); // rawev + n*k is // iev = prob.EigenvalueImag(k) // iev==0 => the eigen vector // iev> 0 => real // start real : rawev + n*k // start imag : ramev +n*(k+1) // iev < 0 => complex // start real : rawev + n*(k-1) // -start imag : ramev +n*(k) FEbaseArrayKn & ev(*evector); int m = Min(nconv,(long) ev.N); for(int i=0;i & xx= *(ev[i]); // if (xx.pVh != pOP1->pUh) // ExecError("Wrong Type of FEspace to store the eigen vector "); // xx.Vh = pOP1->Uh; // int k=(ev_i < 0) ? i-1 : i; //int k=i; KN_ vi(Z(':',i));//rawev+n*k,n) ; //xx= new KN(vi); ev.set(i,vi);//new KN(vi)); } } } } if(pcOP) delete pcOP; if(pcB) delete pcB; return (long) nconv; } AnyType EigenValueC::E_EV::operator()(Stack stack) const { dddd = (verbosity>=200); double tol=1e-6; long nconv=0; long nbev=1; long ncv =0; // the number of Arnoldi vectors generated long maxit=0; // the maximum number of Arnoldi iterations long driver=4; K sigma=0; KN * evalue=0; KN * resid=0; KNM * rawvector=0; // pfecarray evector2; FEbaseArrayKn * evector=0; tol=arg(0,stack,0); nbev=arg(1,stack,0); sigma=arg(2,stack,0.0); evalue=arg *>(3,stack,0); // evector2 =arg(4,stack,make_pair(0,0)); evector= arg * >(4,stack,0); ncv= arg(5,stack,0); maxit= arg(6,stack,0); rawvector=arg *>(7,stack,0); resid=arg *>(8,stack,0); int mymode = arg(15,stack,-1); driver = arg(9,stack,mymode==2 ? 3: 4); K * residptr= resid ? (K*) *resid : 0; char which[3]; ToWhich(stack,which,nargs[10]); //evector=evector2.first; ffassert(driver>0 && driver <5) ; // Matrice_Creuse *pOP1 = GetAny *>((*expOP1)(stack)); // Matrice_Creuse *pB = GetAny *>((*expB)(stack)); if(evalue) nbev=Max( (long)evalue->N(),nbev); if(!maxit) maxit = 100*nbev; //const MatriceCreuse & OP1 = pOP1->A; //const MatriceCreuse & B = pB->A; //long n=OP1.n; Matrice_Creuse *pOP1=0, *pB=0; if(expOP1) pOP1 = GetAny *>((*expOP1)(stack)); if(expB) pB = GetAny *>((*expB)(stack)); // double * residptr=resid? (double*) *resid : 0; // cout << " residptr = " << residptr <A->n; else { ffassert(expn); n = GetAny((*expn)(stack)); } if(evalue) nbev=Max( (long)evalue->N(),nbev); const VirtualMatrice * ptOP1, *ptB; if(pOP1) ptOP1= & (const VirtualMatrice&)(pOP1->A); if(pB) ptB = & (const VirtualMatrice&)(pB->A); FuncMat *pcOP1=0, *pcB=0; if(codeOP1 || codeOP) ptOP1=pcOP1= new FuncMat(n,stack,codeOP,codeOP1); if(codeB || codeB1) ptB=pcB= new FuncMat(n,stack,codeB,codeB1); MatriceIdentite Id(n); if(!ptB) ptB = &Id; const VirtualMatrice &OP1= *ptOP1, &B=*ptB; nbev=min(nbev,n-2); if(!ncv) ncv = nbev*2+1; ncv = max(nbev+2,ncv); ncv = min(ncv,n); const char *serr[10]; int err=0; if(nbev>= n-1) serr[err++]=" Number of eigenvalues of OP to be computed <= n-2 "; if( driver < 1 || driver > 4) serr[err++]=" the driver = 1 ,2 ,4 "; // 2 <= NCV-NEV and NCV <= N if( ! ( 2 <= nbev && ncv <= n)) serr[err++]=" ( 2 <= nbve && nvc <= n) "; if (n != OP1.N) serr[err++]=" the first matrix in EigneValue is not Hermitien."; if (n != B.N ) serr[err++]="Sorry the row's number of the secand matrix in EigneValue is wrong."; if (n != B.M ) serr[err++]="Sorry the colum's number of the secand matrix in EigneValue is wrong."; if(verbosity) cout << "Complex eigenvalue problem: A*x - B*x*lambda" << endl; if(verbosity>9 || err) cout << " n " << n << " nev "<< nbev << " tol =" << tol << " maxit =" << maxit << " ncv = " << ncv << " driver = " << driver << " which = " << which << endl; if(err) { cerr << " list of the error " << endl; for (int i=0;i work(n); // ARrcSymGenEig is a class that requires the user to provide a // way to perform the matrix-vector products w = OP*Bv = // inv(A-sigma*B)*B*v and w = B*v, where sigma is the adopted shift. // OP1 = (A-sigma*B) // OP = inv(OP) /* ffassert(0); ARrcCompGenEig prob( n, nbev, sigma,"LM",ncv,tol,maxit,residptr); // OP = inv[A - sigma*I] // Finding an Arnoldi basis. while (!prob.ArnoldiBasisFound()) { // Calling ARPACK FORTRAN code. Almost all work needed to prob.TakeStep(); */ // cas non symetrique , // Finding an Arnoldi basis. \ // int mode=3; // Shift invert \ int ido=0; //char bmat='G'; int dmode[]={-1,1,3,2,3}; char bmat = (driver<3)? 'I' : 'G'; int mode = dmode[driver]; // char which[]="LM"; int ishift=1; // Auto Shift true by default if( mymode>0 && (mymode != mode)) { cerr << " Erreur complex case: mode== " << mymode << " == " << mode << " driver =" << driver << endl; ExecError("wrong mod in Arpack complex case:");} int iparam[12]= { 0, ishift, 0, (int) maxit, 1,(int) nconv, 0,(int) mode, 0, 0, 0, 0 }; int ipntr[15]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; KN workd(3*n+1); int lworkl = 3*ncv*ncv+5*ncv; KN workl(lworkl+1); KN vp(ncv*n+1); int info= (residptr !=0); KN rwork(ncv+1); KN vresid(residptr? 1: n); if(!residptr) residptr=&vresid[0]; while(1) { caupp(ido, bmat, n, which, nbev, tol, residptr, ncv, vp, n, iparam, ipntr, workd, workl, lworkl,rwork, info); if(verbosity>99) { cout << " caupp ido: " << ido << " info : " << info << endl; } if(info<0) {cerr << " -- err arpack info = " << info << endl;} sauppError(info); if(ido==99) break; KN_ xx(&workd[ipntr[1]],n); KN_ yy(&workd[ipntr[2]],n); KN_ zz(&workd[ipntr[3]],n); DoIdoAction(ido,bmat,mode,xx,yy,zz,work,OP1,B); } nconv = iparam[5]; if(nconv) { int newdim = nbev; if(nconv>nbev) { cerr << "WARNING: nconv(caupp) > nbev: " << nconv << " > " << nbev << endl; newdim = nconv; } KN evc(newdim); KNM Z(n,newdim); KN workev(3*ncv); //int ldz=n; char HowMny ='A'; int rvec=1; ceupp( rvec, HowMny, evc, Z, n, sigma, workev, bmat, n, which, nbev, tol, residptr, ncv, vp, n, iparam, ipntr, workd, workl,lworkl,rwork,info); if (verbosity) { cout << "Complex eigenvalue problem: A*x - B*x*lambda" << endl; cout << "driver =" << driver << " sigma=" << sigma << endl << endl; cout << "Dimension of the system : " << n << endl; cout << "Number of 'requested' eigenvalues : " << nbev << endl; cout << "Number of 'converged' eigenvalues : " << nconv << endl; cout << "Number of Arnoldi vectors generated: " << ncv << endl; cout << "Number of iterations taken : " << iparam[3] << endl; cout << endl; nconv = min(nconv,nbev); cout << "Eigenvalues:" << endl;// Add FH feb 2016 for (int i=0; i vi(Z(':',i)) ; if(verbosity>99) cout <<" Eigenvector: :" << vi << endl; } cout << endl; } if (evalue) { KN & ev(*evalue); int m = Min(nconv,ev.N()); for(int i=0;i & ev(*evector); FEbaseArrayKn & ev(*evector); int m = Min(nconv,(long) ev.N); for(int i=0;i & xx= **(ev[i]); //KN_ vi(Z(':',i)) ; //xx= new KN(vi); ev.set(i,Z(':',i)); } } if(rawvector) { int m = Min(nconv,rawvector->M()); ffassert(rawvector->N()==n); for(int i=0;i vi(Z(':',i)) ; (*rawvector)(':',i)=vi; if(verbosity>2 && mpirank ==0 ) cout << " raw " << vi.l2() << " == " << (*rawvector)(':',i).l2()<< endl; } } } return (long) nconv; } #ifndef DYNM_LOAD void init_eigenvalue() { if(verbosity&& (mpirank==0) ) cout << "eigenvalue "; Global.Add("EigenValue","(",new EigenValue()); // j + dJ Global.Add("EigenValue","(",new EigenValueC()); // j + dJ Global.Add("EigenValue","(",new EigenValue(1)); // j + dJ Global.Add("EigenValue","(",new EigenValue(1,1)); // j + dJ Global.Add("EigenValue","(",new EigenValue(1,1,1)); // A=, B= // sorry no to solve ambiguity => change of name Global.Add("complexEigenValue","(",new EigenValueC(1)); // j + dJ Global.Add("complexEigenValue","(",new EigenValueC(1,1)); // j + dJ Global.Add("complexEigenValue","(",new EigenValueC(1,1,1)); // A=, B= ... } #else class Init { public: Init() { if(verbosity&&(mpirank==0) ) cout << "eigenvalue "; Global.Add("EigenValue2","(",new EigenValue()); // j + dJ Global.Add("EigenValue2","(",new EigenValueC(1)); // j + dJ } }; Init init; #endif freefem++-3.61-1/src/solver/complex_pastix_FreeFem.cpp000644 000767 000024 00000052121 13256636774 023061 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // /* 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 */ /* Interface entre freefem++ et pastix */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include #include #include #include #include #include // #include // #include // #include // #include // //#include // #include // #include // #include // #include "mpi.h" // #include // #include "pastix.h" // #include "cscd_utils.h" // #include "read_matrix.h" #include #ifdef __cplusplus extern "C" { #endif #include "pastix.h" #include "cscd_utils.h" #ifdef __cplusplus } #endif //#include "read_matrix.h" #undef memFree_null #define memFree_null(x) {if (x ==NULL) {fprintf(stdout,"%s:%d freeing NULL\n",__FILE__,__LINE__);} free(x); x=NULL;} #define STR_SIZE 256 static pastix_int_t * pastixint(int * ii){ return (pastix_int_t*) (void *) ii;} static pastix_float_t * pastixfloat(Complex * ii){ return (pastix_float_t*) (void *) ii;} typedef struct pastix_param { pastix_data_t *pastix_data; /*Pointer used by PaStiX to keep information alive between calls */ MPI_Comm comm; /* Communicator used by PaStiX */ pastix_int_t Ncol; /* Size of the Matrix */ pastix_int_t *ia; /* Index of first element of each column in ja and avals */ pastix_int_t *ja; /* Rows of the unknows of the matrix */ pastix_float_t *avals; /* Values of the matrix */ pastix_int_t *perm; /* Permutation used for re-numbering of the unknowns */ pastix_int_t *invp; /* Inverse permutation */ pastix_float_t *rhs; /* Right hand side */ pastix_int_t *iparm; /* Integer parameters */ double *dparm; /* Floating parameters */ } pastix_param_t; void Morse_to_CSC(int m, int n, int nnz, Complex *a, int *colind, int *rowptr, pastix_float_t **at, pastix_int_t **rowind, pastix_int_t **colptr) { register int i, j, col, relpos; pastix_int_t *marker; /* Allocate storage for another copy of the matrix. */ *at = (pastix_float_t *) malloc(sizeof(pastix_float_t)*nnz); *rowind = (pastix_int_t *) malloc(sizeof(pastix_int_t)*nnz); *colptr = (pastix_int_t *) malloc(sizeof(pastix_int_t)*(n+1)); marker = (pastix_int_t *) malloc(sizeof(pastix_int_t)*n); for (i = 0; i < n; ++i) marker[i] = 0; /* Get counts of each column of A, and set up column pointers */ for (i = 0; i < m; ++i) for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; (*colptr)[0] = 0; for (j = 0; j < n; ++j) { (*colptr)[j+1] = (*colptr)[j] + marker[j]; marker[j] = (*colptr)[j]; } /* Transfer the matrix into the compressed column storage. */ for (i = 0; i < m; ++i) { for (j = rowptr[i]; j < rowptr[i+1]; ++j) { col = colind[j]; relpos = marker[col]; (*rowind)[relpos] = i; (*at)[relpos] = a[j]; ++marker[col]; } } free(marker); } static const int MAX_CHAR_PER_LINE=256; //void read_datafile_pastixff(const string &datafile, pastix_int_t *iparmtab, double *dparmtab){ void read_datafile_pastixff(const string &datafile, int &mpi_flag, pastix_int_t *iparmtab, double *dparmtab){ FILE* m_File; int i = 0; char szbuff[MAX_CHAR_PER_LINE]; char* token; char filename[datafile.size()+1]; strcpy( filename, datafile.c_str()); m_File = fopen(filename,"rt"); if(!m_File) { printf("error in reading filename %s\n",&filename); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"matrix") == 0) ){ printf("freefem++: error in reading matrix parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading matrix parameter for pastix \n"); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if(strcmp(token,"assembled") == 0) mpi_flag = 0; else if(strcmp(token,"distributedglobal") == 0) mpi_flag = 1; else if(strcmp(token,"distributed") == 0) mpi_flag = 2; else{ printf("value of parameter matrix is not correct %s \n", token ); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"iparm") == 0) ){ printf("freefem++: error in reading iparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading iparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); iparmtab[i] = (pastix_int_t)atol(token); i++; } i=0; fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"dparm") == 0) ){ printf("freefem++: error in reading dparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading dparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); dparmtab[i] = atof(token); i++; } fclose(m_File); #ifdef OOC /* if (iparmtab[IPARM_OOC_THREAD] > 1) */ iparmtab[IPARM_OOC_THREAD] = 1; #endif /* On empeche le 2d avec NUMA_ALLOC */ #ifdef NUMA_ALLOC if (iparmtab[IPARM_DISTRIBUTION_LEVEL] != 0) { errorPrint("2D not available with NUMA allocation\n"); exit(-1); } #endif } // ATTENTION :: pastix_float_t // peut tre soit un complex ou un reel cela depend de la maniere dont on a compiler pastix // CAS COMPLEX SEULEMENT class zSolvepastixmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 int paraoption; int myid, mpi_size; int Nrow; int mpi_flag; int init_raff; int thrd_flag; int SYM; string data_option; mutable pastix_int_t iparm[64]; mutable double dparm[64]; mutable pastix_int_t Ncol; mutable pastix_int_t *ia; mutable pastix_int_t *ja; mutable pastix_float_t *avals; mutable pastix_int_t *loc2glob; //char *Type = NULL; //char *RhsType = NULL; mutable pastix_float_t *rhs; mutable pastix_int_t *perm; mutable pastix_int_t *invp; mutable pastix_data_t *pastix_data; public: zSolvepastixmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN &pperm_c) : eps(epsilon),epsr(0), tgv(ttgv),tol_pivot_sym(pivot_sym),tol_pivot(pivot), data_option(datafile) { //KN_ param_int(pparam_int); //KN_ param_double(pparam_double); //int m; //int ierr; struct timeval tv1, tv2; int nnz; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); ia = NULL; ja = NULL; avals = NULL; loc2glob = NULL; rhs = NULL; pastix_data = NULL; // matrix assembled on host MPI_Comm_rank(MPI_COMM_WORLD, &myid); printf("- Rang MPI : %d\n", myid); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); // SYMETRIQUE // MPI_flag need to unselect for non distributed matrix mpi_flag = 0; thrd_flag = 0; // ###################### //pastix_int_t init_raff; fprintf(stdout,"-- INIT PARAMETERS --\n"); // reading iparm from array if(!data_option.empty()){ read_datafile_pastixff(data_option,mpi_flag,iparm,dparm); if(mpi_flag != 0) cerr << "ERROR :: GLOBAT INPUT MATRIX FOR ALL PROCS matrix=assembled" << endl; } else if( !(param_int==NULL) || !(param_double==NULL)){ if( ! (param_int==NULL) ) { cout << "internal param_int" << endl; assert(param_int.N() == 64); for(int ii=0; ii<64; ii++) iparm[ii] = param_int[ii]; iparm[IPARM_MODIFY_PARAMETER] = API_YES; } if( !(param_double==NULL) ) { cout << "internal param_double" << endl; assert(param_double.N() == 64); for(int ii=0; ii<64; ii++) dparm[ii] = param_double[ii]; } } else{ iparm[IPARM_MODIFY_PARAMETER] = API_NO; cout << "initialize default parameter" << endl; } //################################ if(myid == 0){ Ncol = AA.m; Nrow = AA.n; nnz = AA.nbcoef; // Avant : on ecrit la transpose // AA.cl : indices des colonnes // AA.lg : pointeurs des lignes Morse_to_CSC( AA.n , AA.m, AA.nbcoef, AA.a, AA.cl, AA.lg, &avals, &ja, &ia); // ia : pointeurs des colonnes // ja : indices des lignes cout << "AA.n= "<< AA.n << " AA.m=" << AA.m << " AA.nbcoef=" << AA.nbcoef << endl; for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = ia[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++){ ja[ii] = ja[ii]+1; } MPI_Bcast( &Ncol, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &Nrow, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &nnz, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, MPI_COMM_WORLD ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); } else{ MPI_Bcast( &Ncol, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &Nrow, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &nnz, 1, MPI_INT, 0, MPI_COMM_WORLD ); avals = (pastix_float_t *) malloc( nnz*sizeof(pastix_float_t) ); ia = (pastix_int_t *) malloc( (Ncol+1)*sizeof(pastix_int_t) ); ja = (pastix_int_t *) malloc( nnz*sizeof(pastix_int_t) ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, MPI_COMM_WORLD ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); } perm = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); invp = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); rhs = (pastix_float_t *) malloc(Ncol*sizeof(pastix_float_t)); // reading permutation given by the user if(pperm_r) for(int ii=0; ii < Ncol; ii++) perm[ii] = pperm_r[ii]; if(pperm_c) for(int ii=0; ii < Ncol; ii++) invp[ii] = pperm_c[ii]; iparm[IPARM_START_TASK] = API_TASK_INIT; iparm[IPARM_END_TASK] = API_TASK_INIT; iparm[IPARM_SYM] = API_SYM_NO; // Matrix is considered nonsymetric if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; fprintf(stdout,"-- FIN INIT PARAMETERS --\n"); init_raff = iparm[IPARM_ITERMAX]; cout << "init_raff=" << init_raff << endl; fflush(stdout); /* Passage en mode verbose */ iparm[IPARM_RHS_MAKING] = API_RHS_B; if( (param_int==NULL) && data_option.empty() ){ iparm[IPARM_MATRIX_VERIFICATION] = API_YES; iparm[IPARM_REFINEMENT] = API_RAF_GMRES; iparm[IPARM_INCOMPLETE] = API_NO; } if( (param_double==NULL) && data_option.empty()){ dparm[DPARM_EPSILON_REFINEMENT] = 1e-12; dparm[DPARM_EPSILON_MAGN_CTRL] = 1e-32; } // cscd_checksym(Ncol, ia, ja, loc2glob, MPI_COMM_WORLD); // if (iparm[IPARM_SYM]==API_SYM_YES) // { // /* Symetric problem */ // /* Build non oriented graph */ // /* build non symmetric csc from symmetric csc */ // /*maillage global*/ // INT *tmpia; // INT *tmpja; // INT tmpn; // cscd_symgraph_int(*n2, *col2, *row2 , NULL, // &tmpn, &tmpia, &tmpja, NULL, // *loc2glob2, pastix_comm, API_YES); // memFree_null(*col2); // *col2 = tmpia; // memFree_null(*row2); // *row2 = tmpja; // *n2 = tmpn; // } SYM = AA.symetrique; cout << "SYM = "<< SYM << endl; // SYMETRIQUE if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Scotch */ fprintf(stdout,"-- Scotch --\n"); fflush(stdout); iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_ORDERING; if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; iparm[IPARM_SYM] = API_SYM_NO; /* Fax */ fprintf(stdout,"-- Fax --\n"); iparm[IPARM_START_TASK] = API_TASK_SYMBFACT; iparm[IPARM_END_TASK] = API_TASK_SYMBFACT; if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Blend */ fprintf(stdout,"-- Blend --\n"); iparm[IPARM_START_TASK] = API_TASK_ANALYSE; iparm[IPARM_END_TASK] = API_TASK_ANALYSE; if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Factorisation */ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_NUMFACT; gettimeofday(&tv1, NULL); fprintf(stdout,"-- SOPALIN --\n"); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call factorization : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; //for(int ii=0; ii < ia[Ncol]-1; ii++) // ja[ii] = ja[ii]-1; if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time factorization :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { struct timeval tv1, tv2; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); // index for pastix for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]+1; for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]+1; // give value of the second member for(int ii=0; ii < Ncol; ii++){ rhs[ii] = b[ii]; } //fprintf(stdout,"SOLVE STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* updo */ iparm[IPARM_START_TASK] = API_TASK_SOLVE; iparm[IPARM_END_TASK] = API_TASK_SOLVE; iparm[IPARM_RHS_MAKING] = API_RHS_B; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call updown : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); if(verbosity > 1) for(int jj=0; jj < Ncol; jj++) cout << "rhs["<< jj << "]=" << rhs[jj] << endl; //fprintf(stdout,"RAFF STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* raff */ iparm[IPARM_START_TASK] = API_TASK_REFINE; iparm[IPARM_END_TASK] = API_TASK_REFINE; iparm[IPARM_RHS_MAKING] = API_RHS_B; iparm[IPARM_ITERMAX] = init_raff; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call refinement : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol; ii++) x[ii] = rhs[ii]; // index for freefem for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; //for(int ii=0; ii < ia[Ncol]-1; ii++) // ja[ii] = ja[ii]-1; if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverpastix_complex_mpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverpastix_complex_mpi" << endl; return new zSolvepastixmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c); } class Init { public: Init(); }; // the 2 default sparse solver double and complex //DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; //DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; } bool Setpastixmpi() { if(verbosity) cout << " SetDefault sparse solver to pastixmpi" << endl; //DefSparseSolver::solver =BuildSolverpastix_complex_mpi; DefSparseSolver::solver =BuildSolverpastix_complex_mpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; } Init init; Init::Init() { //SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pastix, defaultsolver defaultsolverpastix" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; //DefSparseSolver::solver =BuildSolverpastix_complex_mpi; DefSparseSolver::solver =BuildSolverpastix_complex_mpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("complexdefaulttopastix","(",new OneOperator0(Setpastixmpi)); } freefem++-3.61-1/src/solver/wrapper_dotblas1.f000644 000767 000024 00000002343 13256636774 021346 0ustar00hechtstaff000000 000000 c a compile sans underscore -fno-underscoring c gfortran -fno-underscoring -O3 -c wrapper_dotblas.f c ------- double complex function zdotc_(n, zx, incx, zy, incy) double complex zx(*), zy(*), z integer n, incx, incy call cblas_zdotc_sub((n), zx, (incx), zy, (incy), z) c print*,'cblas_zdotc_sub' zdotc_ = z return end double complex function zdotu_(n, zx, incx, zy, incy) double complex zx(*), zy(*), z integer n, incx, incy call cblas_zdotu_sub((n), zx, (incx), zy, (incy), z) c print*,'cblas_zdotu_sub' zdotu_ = z return end complex function cdotc_(n, cx, incx, cy, incy) complex cx(*), cy(*), c integer n, incx, incy call cblas_cdotc_sub((n), cx, (incx), cy, (incy), c) c print*,'cblas_cdotc_sub' cdotc_ = c return end complex function cdotu_(n, cx, incx, cy, incy) complex cx(*), cy(*), c integer n, incx, incy call cblas_cdotu_sub((n), cx, (incx), cy, (incy), c) c print*,'cblas_cdotu_sub' cdotu_ = c return end freefem++-3.61-1/src/solver/hypre_FreeFem.cpp000644 000767 000024 00000160445 13256636774 021162 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : INRIA Saclay // AUTHOR : Guy Atenekeng // E-MAIL : Guy_Antoine_Atenekeng_Kahou@lri.fr // //ff-c++-LIBRARY-dep: metis hypre blas //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 */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #ifdef __cplusplus extern "C" { #include "metis.h" #endif #ifdef __cplusplus } #endif #include #include #include #include "mpi.h" #ifdef MPI_WTIME_IS_GLOBAL #undef MPI_WTIME_IS_GLOBAL #endif #define MPI_WTIME_IS_GLOBAL 1 #define STATS #include "_hypre_utilities.h" #include "HYPRE.h" #include "HYPRE_krylov.h" #include "HYPRE_IJ_mv.h" #include "HYPRE_parcsr_ls.h" #include "_hypre_parcsr_mv.h" #include "fortran_matrix.h" #include "HYPRE_lobpcg.h" #include "interpreter.h" #include "multivector.h" #include "HYPRE_MatvecFunctions.h" #include "HYPRE_parcsr_int.h" #define CHECK_ZERO #define MCW MPI_COMM_WORLD #define BUFLEN 100 #define SCALE 0 #ifdef SUN /* * It uses the system call gethrtime(3C), which is accurate to * nanoseconds. */ #include double dwalltime() { return ( (double)gethrtime() / 1e9 ); } #else #ifndef NO_TIMER #include #include #include #include #endif #ifndef CLK_TCK #define CLK_TCK 60 #endif double dwalltime() { #ifdef NO_TIMER /* no sys/times.h on _WIN32 */ double tmp; tmp = 0.0; #else struct tms use; double tmp; times(&use); tmp = use.tms_utime; tmp += use.tms_stime; #endif return (double)(tmp) / CLK_TCK; } #endif int roscal(int n, int job,int nrm, double *AAv, int *p, int *pr, double * scaletmpr , int *ierr) { /*--------------------------------------------------------------------- | | This routine scales each row of mata so that the norm is 1. | |---------------------------------------------------------------------- | on entry: | mata = the matrix (in SparRow form) | nrm = type of norm | 0 (\infty), 1 or 2 | | on return | diag = diag[j] = 1/norm(row[j]) | | 0 --> normal return | j --> row j is a zero row |--------------------------------------------------------------------*/ /* local variables */ int i, k; double scal; for (i=0; i scal) scal = fabs(AAv[k]); } else if (nrm == 1) { for (k=pr[i]; k normal return | j --> column j is a zero column |--------------------------------------------------------------------*/ /* local variables */ int i, j, k; double *kr; int *ki; for (i=0; i scaletmpc[p[k]]) scaletmpc[p[k]] = fabs(AAv[k]); } } else if (nrm == 1) { for (k=pr[i]; kilower=rk*(n/size); ilower=(A_loc)->ilower; (A_loc)->iupper=(rk+1)*(n/size)-1; if(rk==size-1) (A_loc)->iupper=(A_loc)->iupper+n%size; iupper=(A_loc)->iupper; (A_loc)->n_loc=n_loc; if( !((A_loc)->ptr=(int *)malloc((n_loc+1)*sizeof(int))) ) {printf("%s","Malloc fails for ptr \n"); exit(1);} if( !((A_loc)->rows=(int *)malloc((n_loc)*sizeof(int))) ) {printf("%s","Malloc fails for rows \n");exit(1);} if( !((A_loc)->ncols=(int *)malloc((n_loc)*sizeof(int))) ) {printf("%s","Malloc fails for ncols \n");exit(1);} //Change global Input matrix (A) to local (A_loc) on each process if(type==0){ //Matrix A is in CSR format //Gets local nnz i1=(A_loc)->ilower; i2=(A_loc)->iupper; (A_loc)->ilower=i1; (A_loc)->iupper=i2; nnz_loc=0; for(i=i1;i<=i2;i++){ nnz_loc+=ptr[i+1]-ptr[i]; } //Allocate memory for local matrix if( !((A_loc)->id_cols=(int *)malloc(nnz_loc*sizeof(int))) ) {printf("%s","Malloc fails for id_cols \n");exit(1);} if( !((A_loc)->vals=(double *)malloc(nnz_loc*sizeof(double))) ) {printf("%s","Malloc fails for vals"); exit(1);} //Transfer the corresponding values from global to local relpos=0; //int ncols; //count number of elements in each row for(i=i1;i<=i2;i++){ (A_loc)->rows[i-i1]=i; (A_loc)->ptr[i-i1]=relpos; ncols=relpos; for(j=ptr[i];jid_cols[relpos]=id_rows[j]; (A_loc)->vals[relpos]=vals[j]; relpos++; } (A_loc)->ncols[i-i1]=relpos-ncols; } //cout << "taille des sous domaines" << nnz_loc << endl; } else{ //matrix A is in CSC format marker= (int *)calloc(n, sizeof(int)); //count number of elements in each row for(i=0; iptr[0]=0; //set up the beginning of each row for(i=0; iptr[i+1] = (A_loc)->ptr[i] + marker[i+ilower]; (A_loc)->id_cols[relpos]=id_rows[j]; (A_loc)->vals[relpos]=vals[j]; relpos++; } (A_loc)->ncols[i-ilower]=relpos-ncols; } return 0; } class hypreParam { //Solveur and preconditionner public: char solver[BUFLEN]; char precon[BUFLEN]; //BoomerAMG parameter int amg_coarsentype ; /* Falgout coarsening */ int amg_relaxtype; /* hybrid Gauss-Seidel or SOR */ int amg_interptype; /* default*/ int amg_maxlevels; int amg_numsweeps; /*default*/ double amg_strongthreshold;/*suitable for 3D Laplace Operator*/ double amg_truncfactor; int amg_prntlevel; /* print setup info */ double amg_tol; //BoomerAMG Tolerance int amg_maxiter; int scale; int gsmg_sample, measure_type,cycle_type; int solv_stopcrit ; double trunc_factor; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) int smooth_type; int smooth_numlevels; int smooth_numsweeps; double pilut_droptol; double pilut_maxnz; int schwarz_overlap; int schwarz_variant; int schwarz_domaintype; //parasails parameter int sai_max_levels ; double sai_threshold ; double sai_filter ; int sai_sym ; int sai_log ; int VERBOSE; /***************************HYPRE_BOOMERAMG***********************/ double strong_threshold; int * num_grid_sweeps; int * grid_relax_type; int * grid_relax_points; double * relax_weight; double * omega; //Solver parameter (used for GMRES , PCG or BiCGStab) double solv_tol ; int solv_maxiter; int solv_kdim; int solv_log; int solv_prntlevel; int precond_id, solver_id,matrix_id,solver_type; int smooth_num_levels,smooth_num_sweeps,max_levels,Two_Norm; int domain_type, num_functions,variant,overlap,nonzeros_to_keep; double max_row_sum,drop_tol; int *dof_func; int pcg_max_its,rrow_size,Rel_change; int dscg_max_its,coarsen_type,hybrid,k_dim,num_sweep; int pmax_iter; double cf_tol,tol,pc_tol; double schwarz_rlx_weight; /*For timing*/ int timing; public : hypreParam(const KN ¶m_int, const KN ¶m_double) { amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=0.0; //BoomerAMG Tolerance amg_maxiter=20; gsmg_sample=1; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) smooth_type=6; smooth_numlevels=3; smooth_numsweeps=1; pilut_droptol=1.0e-4; pilut_maxnz=100; schwarz_overlap=10; schwarz_variant=2; schwarz_domaintype=2; //parasails parameter sai_max_levels = 1; sai_threshold = 0.1; sai_filter = 0.1; sai_sym =0; sai_log = 1; int i; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-11; solv_maxiter = 1000; solv_kdim =40; solv_log = 0; solv_prntlevel = 2; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; pmax_iter=30; rrow_size=1000; solv_stopcrit=1; amg_interptype =6; gsmg_sample =5; amg_coarsentype =6; measure_type =1;amg_strongthreshold=0.25; trunc_factor=1e-2; amg_maxiter=20; cycle_type=1; smooth_num_levels=3; smooth_num_sweeps=1; max_levels=25; hybrid=1; k_dim = 5; smooth_type = 6; num_functions = 1; smooth_num_levels = 3; smooth_num_sweeps = 2; num_sweep = 1; variant = 0; overlap = 10; domain_type = 2; nonzeros_to_keep = 1000; tol = 1.e-8; pc_tol = 0.; drop_tol = -1.; max_row_sum = 0.9; schwarz_rlx_weight = 1.; sai_threshold = 0.1; sai_filter = 0.1; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } max_row_sum=0.9; schwarz_rlx_weight=1.; variant=0; num_functions=1; overlap=10; domain_type= 2; if(param_int.N()>0) {if((param_int[0]>=0)&&(param_int[0]<=9)) solver_id=param_int[0]; else solver_id=1;} //GMRES as solver if((solver_id!=4)&&(solver_id!=5)){ if(param_int.N()>1) {if((param_int[1]>=0)&&(param_int[1]<=9)) precond_id=param_int[1]; else precond_id=0;}//BOOMER AMG } if(param_int.N()>2) {if(param_int[2]>0) solv_maxiter = param_int[2];else solv_maxiter=1000;} if(param_int.N()>3) {if(param_int[3]>0) solv_kdim =param_int[3];else solv_kdim=40;} if(param_int.N()>4) {if(param_int[4]>=0) solv_prntlevel = param_int[4];} if(param_int.N()>5) {if(param_int[5]>=0) solv_log = param_int[5];} if(param_int.N()>6) {if(param_int[6]>=0) solv_stopcrit = param_int[6];} if(param_double.N()>0) {if(param_double[0]>0) solv_tol = param_double[0];} switch(precond_id) { case 0 : //Preconditionner AMG if(param_int.N()>7) {if(param_int[7]>=0) amg_interptype =param_int[7];} if(param_int.N()>8) {if(param_int[8]>=0) gsmg_sample =param_int[8];} if(param_int.N()>9) {if(param_int[9]>=0) amg_coarsentype =param_int[9];} if(param_int.N()>10) {if(param_int[10]>=0) measure_type =param_int[10];} if(param_double.N()>1) {if(param_double[1]>0) amg_strongthreshold = param_double[1];} if(param_double.N()>2) {if(param_double[2]>0) trunc_factor = param_double[2];} //if(param_int.N()>11) {if(param_int[11]>0) amg_maxiter=param_int[11];} if(param_int.N()>11) {if(param_int[11]>0) cycle_type=param_int[11];} if(param_int.N()>12) {if(param_int[12]>0) smooth_type=param_int[12];} if(param_int.N()>13) {if(param_int[13]>0) smooth_num_levels=param_int[13];} if(param_int.N()>14) {if(param_int[14]>0) smooth_num_sweeps=param_int[14];} if(param_int.N()>15) {if(param_int[15]>0) max_levels = param_int[15];} relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } if(param_double.N()>3) {if(param_double[3]>0) max_row_sum = param_double[3];else max_row_sum=0.9;} else max_row_sum=0.9; if(param_double.N()>4) {if(param_double[4]>0) schwarz_rlx_weight = param_double[4];else schwarz_rlx_weight=1.;} else schwarz_rlx_weight=1.; if(param_int.N()>16) {if(param_int[16]>0) variant = param_int[16];else variant=3;} else variant=3; if(param_int.N()>17) {if(param_int[17]>0) num_functions = param_int[17];else num_functions=1;} else num_functions=1; if(param_int.N()>18) {if(param_int[18]>0) overlap = param_int[18];else overlap=10;} else overlap=10; if(param_int.N()>19) {if(param_int[19]>0) domain_type = param_int[19]; else domain_type= 2;} else domain_type= 2; break; case 1: //Preconditionner PILUT if(param_double.N()>1) {if(param_double[1]>0) drop_tol = param_double[1]; else drop_tol=1e-5;} else drop_tol=1e-5; if(param_int.N()>7) {if(param_int[7]>0) nonzeros_to_keep = param_int[7]; else nonzeros_to_keep=1000;} else nonzeros_to_keep=1000; if(param_int.N()>8) {if(param_int[8]>0) pmax_iter = param_int[8];} if(param_int.N()>9) {if(param_int[9]>0) rrow_size = param_int[9];} break; case 2://Preconditionner ParaSails if(param_double.N()>1) {if(param_double[1]>0) sai_filter = param_double[1];else sai_filter=0.1;} else sai_filter=0.1; if(param_double.N()>2) {if(param_double[2]>0) sai_threshold = param_double[2];else sai_threshold=0.1;} else sai_threshold=0.1; if(param_int.N()>7) {if(param_int[7]>0) max_levels = param_int[7];else max_levels=1;} else max_levels=1; if(param_int.N()>8) {if(param_int[8]>0) sai_sym =param_int[8];else sai_sym=0;} else sai_sym=0; break; case 3: //Preconditionner Schwarz if(param_double.N()>1) {if(param_double[1]>0) schwarz_rlx_weight = param_double[1];schwarz_rlx_weight=1;} else schwarz_rlx_weight=1.; if(param_int.N()>7) {if(param_int[7]>0) variant = param_int[7];else variant=1;} else variant=1; if(param_int.N()>8) {if(param_int[8]>0) overlap = param_int[8];else overlap=1;} else overlap=1; if(param_int.N()>9) {if(param_int[9]>0) domain_type = param_int[9];else domain_type=3;} else domain_type=3; break; default: break; } } if(solver_id==4) // Solver AMG_HYBRID { if(param_double.N()>1) {if(param_double[1]>=0) amg_tol =param_double[1];else amg_tol=1e-9;} else amg_tol=1e-9; if(param_double.N()>2) {if(param_double[2]>=0) cf_tol =param_double[2];else cf_tol= 1e-3;} else cf_tol= 1e-3; if(param_int.N()>1) {if(param_int[1]>=0) solver_type =param_int[1];else solver_type=1;} else solver_type=1; if(param_int.N()>2) {if(param_int[2]>0) dscg_max_its=param_int[2];else dscg_max_its=1000;} else dscg_max_its=1000; if(param_int.N()>3) {if(param_int[3]>0) pcg_max_its=param_int[3];else pcg_max_its=200;} else pcg_max_its=200; if(param_int.N()>4) {if(param_int[4]>0) coarsen_type=param_int[4]; else coarsen_type=6;} else coarsen_type=6; if(param_double.N()>3) {if(param_double[3]>0) strong_threshold = param_double[3]; else strong_threshold=1e-3;} else strong_threshold=1e-3; if(param_double.N()>4) {if(param_double[4]>0) trunc_factor = param_double[4]; else trunc_factor=1e-2;} else trunc_factor=1e-2; if(param_int.N()>5) {if(param_int[5]>0) max_levels = param_int[5]; else max_levels=25;} else max_levels=25; if(param_double.N()>5) {if(param_double[5]>0) max_row_sum = param_double[5];else max_row_sum=0.9;} else max_row_sum=0.9; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } } if(solver_id==3) { if(param_int.N()>7) {if(param_int[7]>=0) Two_Norm =param_int[7];else Two_Norm=2;} else Two_Norm=2; if(param_int.N()>8) {if(param_int[8]>=0) Rel_change =param_int[8];else Rel_change=1;} else Rel_change=1; } if(solver_id==5) //Solver AMG { if(param_int.N()>7) {if(param_int[7]>=0) amg_interptype =param_int[7];} if(param_int.N()>8) {if(param_int[8]>=0) gsmg_sample =param_int[8];} if(param_int.N()>9) {if(param_int[9]>=0) amg_coarsentype =param_int[9];} if(param_int.N()>10) {if(param_int[10]>=0) measure_type =param_int[10];} if(param_double.N()>2) {if(param_double[2]>0) amg_strongthreshold = param_double[2];} if(param_double.N()>3) {if(param_double[3]>0) trunc_factor = param_double[3];} if(param_int.N()>11) {if(param_int[11]>0) amg_maxiter=param_int[11];} if(param_int.N()>12) {if(param_int[12]>0) cycle_type=param_int[12];} if(param_int.N()>13) {if(param_int[13]>0) smooth_type=param_int[13];} if(param_int.N()>14) {if(param_int[14]>0) smooth_num_levels=param_int[14];} if(param_int.N()>15) {if(param_int[15]>0) smooth_num_sweeps=param_int[15];} if(param_int.N()>16) {if(param_int[16]>0) max_levels = param_int[16];} relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } if(param_double.N()>4) {if(param_double[4]>0) max_row_sum = param_double[4];else max_row_sum=1e-1;} else max_row_sum=1e-1; if(param_double.N()>5) {if(param_double[5]>0) schwarz_rlx_weight = param_double[5];else schwarz_rlx_weight=1.;} else schwarz_rlx_weight=1.; if(param_int.N()>17) {if(param_int[17]>0) variant = param_int[17];else variant=1;} else variant=1; if(param_int.N()>19) {if(param_int[18]>0) num_functions = param_int[18];else num_functions=5;} else num_functions=5; if(param_int.N()>20) {if(param_int[19]>0) overlap = param_int[19];else overlap=1;} else overlap=1; if(param_int.N()>21) {if(param_int[20]>0) domain_type = param_int[20];else domain_type= 1;} else domain_type= 1; } if(param_int.N()>22) {if(param_int[22]>0) VERBOSE = param_int[22];} if(param_int.N()>23) {if(param_int[23]>0) scale = param_int[23]; else scale=1;} else scale=1; if(param_int.N()>24) {if(param_int[24]>0) timing = param_int[24]; else timing=1;} else timing=1; } public : hypreParam() { int i; amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=1e-7; //BoomerAMG Tolerance amg_maxiter=1; gsmg_sample=1; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-11; solv_maxiter = 1000; solv_kdim =40; solv_log = 0; solv_prntlevel = 2; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; pmax_iter=30; rrow_size=1000; amg_interptype =0; gsmg_sample =1; amg_coarsentype =6; measure_type =1;amg_strongthreshold=0.25; trunc_factor=1e-2; amg_maxiter=20; cycle_type=1; smooth_type=6; smooth_num_levels=0; smooth_num_sweeps=2; max_levels=25; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } max_row_sum=0.9; schwarz_rlx_weight=1.; variant=0; num_functions=1; overlap=10; domain_type= 0; } public : hypreParam(char * fileparameter, MPI_Comm comm) { FILE *f; char buf[BUFLEN]; int num; int rk, size; MPI_Comm_rank(comm,&rk); MPI_Comm_size(comm, &size); amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=0.0; //BoomerAMG Tolerance amg_maxiter=20; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) smooth_type=6; smooth_numlevels=3; smooth_numsweeps=1; pilut_droptol=1.0e-4; pilut_maxnz=100; schwarz_overlap=10; schwarz_variant=2; schwarz_domaintype=2; //parasails parameter sai_max_levels = 1; sai_threshold = 0.1; sai_filter = 0.05; sai_sym =0; sai_log = 1; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-30; solv_maxiter = 80; solv_kdim =40; // int solv_stopcrit = 1; //only for BiCGSTAB solv_log = 0; solv_prntlevel = 0; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; if(fileparameter==NULL) { if(rk==0) printf("%s","Set default parameter because you not precise the parameter file \n \n"); solver_id=1; //GMRES as solver precond_id=0;//BOOMER AMG } else if( (f=fopen(fileparameter,"r") )==NULL) { if(rk==0)printf("%s","Set default parameter because your parameter file not exist \n \n"); solver_id=1; //GMRES as solver precond_id=0;//BOOMER AMG } else { if(rk==0) printf("%s%s%s","Read parameter from file ", fileparameter, "\n \n"); num =0; while(fgets(buf, BUFLEN, f) != NULL) { switch(num) { case 0: sscanf(buf, "%s", solver); break; case 1: sscanf(buf, "%d", &solver_id); break; case 2: sscanf(buf, "%lf", &solv_tol); break; case 3: sscanf(buf, "%d", &solv_maxiter); break; case 4: sscanf(buf, "%d", &solv_prntlevel); break; case 5: sscanf(buf, "%d", &solv_log); if(solver_id!=1) {fgets(buf, BUFLEN, f);num++;} break; case 6: sscanf(buf, "%d", &solv_kdim); break; case 7: sscanf(buf, "%s", precon); break; case 8: sscanf(buf, "%d", &precond_id); if(precond_id==2) //The parameter of preconditionner is inside file { fclose(f); exit(1); } break; case 9: if(precond_id==0) sscanf(buf, "%d", &amg_coarsentype); if(precond_id==1) sscanf(buf, "%lf", &sai_threshold); break; case 10: if(precond_id==0) sscanf(buf, "%d", &amg_prntlevel); if(precond_id==1) sscanf(buf, "%d", &sai_max_levels); break; case 11: if(precond_id==0) sscanf(buf, "%d", &amg_interptype); if(precond_id==1) sscanf(buf, "%lf", &sai_filter); break; case 12: if(precond_id==0) sscanf(buf, "%d", &amg_maxlevels); if(precond_id==1) case 17: sscanf(buf, "%d", &amg_prntlevel); break; case 18: sscanf(buf, "%lf", &amg_tol); break; case 19: sscanf(buf, "%d", &amg_maxiter); break; case 20: sscanf(buf, "%d", &scale); break; default: break; } num++; } if(fclose(f)==EOF) printf("%s","Error while closing the file \n"); else printf("%s","File is well close \n"); } } }; class HypreSolver : public MatriceMorse::VirtualSolver { mutable HYPRE_IJMatrix ij_A; mutable HYPRE_IJVector ij_B; mutable HYPRE_IJVector ij_X; mutable HYPRE_ParCSRMatrix par_A; mutable HYPRE_ParVector par_B; mutable HYPRE_ParVector par_X; void *object; HYPRE_ParCSRMatrix parcsr_A; string data_option; mutable int time_index,time_index1; mutable HYPRE_Solver solver; mutable HYPRE_Solver precond; mutable hypreParam *param; mutable double *scaletmpr, *scaletmpc; mutable int rk,size; int jlower, jupper; int ilower, iupper; mutable int num_iter; mutable double final_res_norm; mutable double tgv,eps,tol_pivot,tol_pivot_sym,epsr; sparse_mat_loc A_loc; mutable int *iwork, *maptmp, *mapptr, *iwork1,*riord; mutable int n_loc,n,VERBOSE; mutable MPI_Comm comm; mutable int pcg_num_its,dscg_num_its; public: HypreSolver(const MatriceMorse &AA,string datafile, KN ¶m_int, KN ¶m_double, MPI_Comm * mpicommw ) { int i,j,ierrr; if(mpicommw==NULL){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /*****INITIALIZE MPI ENVIRONMENT*****/ ierrr = MPI_Comm_rank(comm, &rk); ierrr = MPI_Comm_size(comm, &size); if(((param_double!=NULL)||(param_int!=NULL))&&(datafile.empty())) { if(rk==0) cout << "#########PARAMETERS ARE SET INSIDE A VECTOR###"<< endl; param=new hypreParam(param_int,param_double); } if((datafile.empty())&&((param_int==NULL)&&(param_double==NULL))) { if(rk==0) cout << "###########DEFAULT PARAMETERS WILL BE SET#######"<< endl; param= new hypreParam(); } if((!datafile.empty())&&((param_int==NULL)&&(param_double==NULL))) { if(rk==0) cout << "#########PARAMETERS ARE INSIDE A FILE#########"<< endl; char *p; p=new char[datafile.length()+1]; strcpy(p,datafile.c_str()); param= new hypreParam(p,comm); } /*################################################### USING HYPRE ####################################################*/ int n,nnz, *pr, *p,ierr; double * AAv; n=AA.n; nnz=AA.nbcoef; /*################################################## COPY ENTRY MATRIX ##################################################*/ if(param->timing){ time_index = hypre_InitializeTiming("MATRIX DISTRIBUTION"); hypre_BeginTiming(time_index); } pr= new int[n+1];p= new int[nnz]; AAv=new double[nnz]; for(i=0;iscale) { job = 1; /*-- compute 1-norm */ tmp = 2; /*-- compute 2-norm */ scaletmpr=new double[n]; scaletmpc=new double[n]; roscal(n,job,tmp,AAv,p,pr,scaletmpr,&ierr); if (ierr) fprintf(stderr, "ERROR: IN ROSCAL, IERR = %d\n", ierr); /*------- scale the RHS according to row scaling coefficients */ coscal(n,job,tmp,AAv,p,pr,scaletmpc,&ierr); if (ierr) fprintf(stderr, "ERROR : IN COSCAL, IERR = %d\n", ierr); } /*--- end of branch on scaling */ /************************************************************* Distribute input matrix into local structures *************************************************************/ int type=0,wgtflag=0, numflag=0, volume; //0=CSR; 1=CSC int option[5]; option[0]=0; riord=(int *)malloc(sizeof(int)*n); if(riord==NULL){if(rk==0) printf("%s","IN PARTITION , MEMORY ALLOCATION FAILED \n");exit(1);} /************************USE METIS FOR DATA DISTRIBUTION**************************/ if(size>1) METIS_PartGraphKway(&n, pr, p, NULL, NULL, &wgtflag, &numflag,&size, option, &volume, riord); else if(size==1){ for (i=0; itiming){ hypre_EndTiming(time_index); hypre_PrintTiming("IJ Matrix Setup", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } /************************************************************* Create preconditioner Setup and Use solver **************************************************************/ param->timing=1; switch(param->solver_id){ case 0 : //BiCGStab solver HYPRE_ParCSRBiCGSTABCreate(comm, &solver); HYPRE_ParCSRBiCGSTABSetTol(solver, param->solv_tol); HYPRE_ParCSRBiCGSTABSetMaxIter(solver, param->solv_maxiter); //HYPRE_ParCSRBiCGSTABSetStopCrit(solver, solv_stopcrit); HYPRE_ParCSRBiCGSTABSetPrintLevel(solver, param->solv_prntlevel); HYPRE_ParCSRBiCGSTABSetLogging(solver, param->solv_log); //Set Preconditioner switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner if(rk==0) printf("SOLVER: BOOMERAMG-BiCGSTAB\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_BiCGSTABSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 4: /*use diagonal scaling as preconditioner*/ if(rk==0) printf("SOLVER: DS-BiCGSTAB\n"); precond=NULL; HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScale, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScaleSetup, precond); break; case 1: /*Use PILUT as preconditioner*/ if(rk==0) printf("SOLVER: PILUT-BiCGSTAB\n"); ierr=HYPRE_ParCSRPilutCreate(comm,&precond); if(ierr) printf("ERROR: PILUT-BiCGSTAB\n"); if(param->drop_tol>=0) HYPRE_ParCSRPilutSetDropTolerance(precond,param->drop_tol); if(param->nonzeros_to_keep>=0) HYPRE_ParCSRPilutSetFactorRowSize(precond,param->nonzeros_to_keep); HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-BicGSTAB\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-BicGSTAB\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-PCG \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_BiCGSTABSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, precond); break; default: break; } break; case 2:/*USE PCG AS SOLVER*/ HYPRE_ParCSRPCGCreate(comm, &solver); HYPRE_ParCSRPCGSetTol(solver, param->solv_tol); HYPRE_PCGSetMaxIter(solver, param->solv_maxiter); HYPRE_PCGSetPrintLevel(solver, param->solv_prntlevel); HYPRE_PCGSetTwoNorm(solver, param->Two_Norm); HYPRE_PCGSetRelChange(solver,param->Rel_change); HYPRE_PCGGetPrecond(solver,&precond); switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner in PCG if(rk==0) printf("SOLVER: AMG-PCG\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-PCG\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-PCG\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-PCG \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, precond); break; default: break; } break; case 5: if(rk==0) printf("SOLVER: AMG \n"); HYPRE_BoomerAMGCreate(&solver); HYPRE_BoomerAMGSetInterpType(solver, param->amg_interptype); HYPRE_BoomerAMGSetNumSamples(solver, param->gsmg_sample); HYPRE_BoomerAMGSetTol(solver, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(solver, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(solver,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(solver, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(solver,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(solver, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(solver,param->cycle_type); HYPRE_BoomerAMGSetRelaxWeight(solver,param->relax_weight); HYPRE_BoomerAMGSetOmega(solver,param->omega); HYPRE_BoomerAMGSetSmoothType(solver,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(solver,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(solver,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(solver,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(solver,param->max_row_sum); HYPRE_BoomerAMGSetVariant(solver, param->variant); // HYPRE_BoomerAMGSetNumFunctions(solver, param->num_functions); //HYPRE_BoomerAMGSetSchwarzRlxWeight(solver,param->schwarz_rlx_weight); HYPRE_BoomerAMGSetOverlap(solver, param->overlap); HYPRE_BoomerAMGSetVariant(solver, param->domain_type); /* if(param->num_functions>1) HYPRE_BoomerAMGSetDofFunc(solver,param->dof_func);*/ break; case 4: if(rk==0) printf("SOLVER: AMG_HYBRID \n"); HYPRE_ParCSRHybridCreate(&solver); HYPRE_ParCSRHybridSetTol(solver, param->amg_tol); HYPRE_ParCSRHybridSetCoarsenType(solver,param->coarsen_type); HYPRE_ParCSRHybridSetStrongThreshold(solver, param->strong_threshold); HYPRE_ParCSRHybridSetTruncFactor(solver,param->trunc_factor); HYPRE_ParCSRHybridSetDSCGMaxIter(solver,param->dscg_max_its); HYPRE_ParCSRHybridSetPCGMaxIter(solver,param->pcg_max_its); HYPRE_ParCSRHybridSetConvergenceTol(solver, param->cf_tol); HYPRE_ParCSRHybridSetSolverType(solver, param->solver_type); HYPRE_ParCSRHybridSetRelaxWeight(solver,param->relax_weight); HYPRE_ParCSRHybridSetOmega(solver,param->omega); HYPRE_ParCSRHybridSetMaxLevels(solver,param->max_levels); HYPRE_ParCSRHybridSetMaxRowSum(solver,param->max_row_sum); break; case 1:/*GMRES AS SOLVER*/ HYPRE_ParCSRFlexGMRESCreate (comm, &solver); HYPRE_ParCSRFlexGMRESSetPrintLevel(solver,VERBOSE); HYPRE_ParCSRFlexGMRESSetKDim(solver,param->solv_kdim); HYPRE_ParCSRFlexGMRESSetMaxIter(solver, param->solv_maxiter ); HYPRE_ParCSRFlexGMRESSetTol(solver,param->solv_tol ); HYPRE_FlexGMRESSetLogging(solver, param->solv_log); HYPRE_ParCSRGMRESSetPrintLevel(solver,param->solv_prntlevel); //Set Preconditioner switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner if(rk==0) printf("SOLVER: AMG-GMRES\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); // HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 4: /*use diagonal scaling as preconditioner*/ if(rk==0) printf("SOLVER: DS-GMRES\n"); precond = NULL; HYPRE_ParCSRFlexGMRESSetPrecond (solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScale, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScaleSetup, precond); break; case 1: /*Use PILUT as preconditioner*/ if(rk==0) printf("SOLVER: PILUT-GMRES\n"); ierr=HYPRE_ParCSRPilutCreate(comm,&precond); HYPRE_ParCSRPilutSetMaxIter(precond,param->pmax_iter); if(param->drop_tol>=0) HYPRE_ParCSRPilutSetDropTolerance(precond,param->drop_tol); if(param->nonzeros_to_keep>=0) HYPRE_ParCSRPilutSetFactorRowSize(precond,param->nonzeros_to_keep); if(ierr) printf("ERROR: PILUT-GMRES \n"); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-GMRES \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToParSolverFcn) HYPRE_SchwarzSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-GMRES\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-GMRES\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSetup, precond); break; } default: break; } } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; int i, i1,i2; int *row,*row1; double * b_loc,*X_loc,*rhs,*xx; n=AA.n; rhs= (double *)malloc(sizeof(double)*n); xx= (double *)malloc(sizeof(double)*n); x= (double *)malloc(sizeof(double)*n); i1=ilower; i2=iupper; double t2,t1; for(i=0;iscale) for(i = 0; i < n; i++) rhs[i] *= scaletmpr[i]; b_loc=(double *)malloc(n_loc*sizeof(double)); X_loc=(double *)malloc(n_loc*sizeof(double)); row=(int *)malloc(n_loc*sizeof(int)); row1=(int *)malloc(n_loc*sizeof(int)); for(i=i1;i <=i2; i++){ // node = maptmp[i]; b_loc[i-i1]=rhs[i]; X_loc[i-i1]=0.0; //Initial Guest row[i-i1]=i; //used to get results later row1[i-i1]=i; } int ierr=0; HYPRE_IJVectorCreate(comm, ilower, iupper, &ij_B); HYPRE_IJVectorCreate(comm, ilower, iupper, &ij_X); HYPRE_IJVectorSetObjectType(ij_B, HYPRE_PARCSR); HYPRE_IJVectorSetObjectType(ij_X, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_B); HYPRE_IJVectorInitialize(ij_X); HYPRE_IJVectorSetValues(ij_B, n_loc, row, b_loc); HYPRE_IJVectorSetValues(ij_X, n_loc, row, X_loc); HYPRE_IJVectorAssemble(ij_B); HYPRE_IJVectorAssemble(ij_X); ierr=HYPRE_IJVectorGetObject(ij_B, (void **) &par_B); ierr=HYPRE_IJVectorGetObject(ij_X, (void **) &par_X); switch (param->solver_id){ case 0 : //BICGSTAB solver if(param->timing){ time_index1 = hypre_InitializeTiming("BiCGSTAB SETUP"); hypre_BeginTiming(time_index1); } HYPRE_ParCSRBiCGSTABSetup (solver, par_A, par_B, par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("BiCGSTAB SETUP TIME", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR BICGSTAB Solver"); hypre_BeginTiming(time_index1);} HYPRE_ParCSRBiCGSTABSolve (solver, par_A, par_B, par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("SOLVE PHASE TIMES", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRBiCGSTABGetNumIterations(solver, &num_iter); HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm(solver, &final_res_norm); //HYPRE_ParCSRBiCGSTABDestroy(solver); break; case 1 : //GMRES Solver if(param->timing){ time_index1 = hypre_InitializeTiming("GMRES SETUP"); hypre_BeginTiming(time_index1); } HYPRE_FlexGMRESSetup(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR GMRES Solver"); hypre_BeginTiming(time_index1); } HYPRE_FlexGMRESSolve(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_GMRESGetNumIterations(solver, &num_iter); HYPRE_GMRESGetFinalRelativeResidualNorm(solver, &final_res_norm); //HYPRE_ParCSRGMRESDestroy(solver); break; case 2 : //PCG if(param->timing){ time_index1 = hypre_InitializeTiming("PCG SETUP"); hypre_BeginTiming(time_index1); } HYPRE_PCGSetup(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR PCG Solve"); hypre_BeginTiming(time_index1);} HYPRE_PCGSolve(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRPCGGetNumIterations(solver,&dscg_num_its); HYPRE_ParCSRPCGGetFinalRelativeResidualNorm(solver,&final_res_norm); break; case 4: if(param->timing){ time_index1 = hypre_InitializeTiming("HYBRID SETUP"); hypre_BeginTiming(time_index1); } HYPRE_ParCSRHybridSetup(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR Hybrid Solve"); hypre_BeginTiming(time_index1);} HYPRE_ParCSRHybridSolve(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRHybridGetNumIterations(solver,&num_iter); HYPRE_ParCSRHybridGetPCGNumIterations(solver,&pcg_num_its); HYPRE_ParCSRHybridGetDSCGNumIterations(solver,&dscg_num_its); HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(solver,&final_res_norm); if(rk==0){ printf("\n"); printf("Iterations = %d\n", num_iter); printf("PCG_Iterations = %d\n", pcg_num_its); printf("DSCG_Iterations = %d\n", dscg_num_its); printf("Final Relative Residual Norm = %e\n", final_res_norm); printf("\n"); } break; case 5: if(param->timing){ time_index1 = hypre_InitializeTiming("BoomerAMG SETUP"); hypre_BeginTiming(time_index1); } HYPRE_BoomerAMGSetup(solver,par_A, par_B,par_X); if(param->timing){ time_index1 = hypre_InitializeTiming("BoomerAMG SETUP Solve"); hypre_BeginTiming(time_index1);} HYPRE_BoomerAMGSolve(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} break; default : break; } /*Reconstruction of vector*/ delete [] iwork1; delete []mapptr; iwork1=new int[size+1]; mapptr=new int[size+1]; int disp=0; for(i=0;iscale) x[i]=x[i]*scaletmpc[i];} if(verbosity==0) { MPI_Barrier(comm); t2 = dwalltime(); t2=t2-t1; MPI_Reduce(&t2, &t1, 1, MPI_DOUBLE, MPI_MAX, 0,comm); MPI_Bcast(&t1, 1, MPI_DOUBLE,0,comm); if(rk==0){printf("%s%18.6g%s","TIME FOR SOLVING ", fabs(t1) ,"\n \n"); printf("%s%18.6g%s","RELATIVE RESIDU ", final_res_norm ,"\n \n"); printf("%s%d%s","NUMBER OF ITERATION ", num_iter ," \n \n"); } } if(X_loc!=NULL) free(X_loc); if(rhs!=NULL) free(rhs); if(xx!=NULL) free(xx); if(b_loc!=NULL) free(b_loc); if(row!=NULL) free(row); if(iwork1!=NULL) delete [] iwork1; if(mapptr!=NULL) delete [] mapptr; } ~HypreSolver() { if(verbosity){ cout << "~HypreSolver():" << endl; HYPRE_IJMatrixDestroy(ij_A); HYPRE_IJVectorDestroy(ij_B); HYPRE_IJVectorDestroy(ij_X); switch (param->solver_id){ case 0 : //BICGSTAB solver HYPRE_ParCSRBiCGSTABDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; case 4: HYPRE_ParCSRPilutDestroy(precond); break; default: break; } break; case 1 : //GMRES Solver HYPRE_ParCSRFlexGMRESDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; case 4: HYPRE_ParCSRPilutDestroy(precond); break; default: break; } break; case 3 : //PCG HYPRE_ParCSRPCGDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; default: break; } break; case 4: //AMG-Hybrid HYPRE_ParCSRHybridDestroy(solver); break; case 5: //AMG HYPRE_BoomerAMGDestroy(solver); break; default : break; } } } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; inline MatriceMorse::VirtualSolver * BuildHypreSolver(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverHypre>" << endl; return new HypreSolver(*A,ds.data_filename, ds.lparams, ds.dparams,(MPI_Comm *)ds.commworld); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return 1; } bool SetHypreSolver() { if(verbosity>1) cout << " SetDefault sparse solver to Hyprempi" << endl; DefSparseSolver::solver =BuildHypreSolver; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return 1; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Hyprempi, defaultsolver defaultsolverHyprempi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildHypreSolver; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoHyprempi","(",new OneOperator0(SetHypreSolver)); } freefem++-3.61-1/src/solver/wrapper_dotblas.c000644 000767 000024 00000001625 13256636774 021264 0ustar00hechtstaff000000 000000 typedef void doublecomplex; typedef void complex; typedef int integer; #include /* Double Complex */ void zdotc_(doublecomplex * ret_val, integer *n, doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) { cblas_zdotc_sub(*n, zx, *incx, zy, *incx , ret_val); } /* Double Complex */ void zdotu_(doublecomplex * ret_val, integer *n, doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) { cblas_zdotu_sub(*n, zx, *incx, zy, *incx , ret_val); return ; } /* zdotu___ */ /* Complex */ void cdotc_(complex * ret_val, integer *n, complex *cx, integer *incx, complex *cy, integer *incy) { cblas_cdotc_sub (*n, cx, *incx, cy, *incx , ret_val); } /* cdotc___ */ /* Complex */ void cdotu_(complex * ret_val, integer *n, complex *cx, integer *incx, complex *cy, integer *incy) { cblas_cdotu_sub(*n, cx, *incx, cy, *incx , ret_val); } /* cdotu___ */ freefem++-3.61-1/src/solver/makefile-sparsesolver.inc000644 000767 000024 00000025673 13256636774 022737 0ustar00hechtstaff000000 000000 #// ORIG-DATE: 02/2009 #// -*- Mode : c++ -*- #// #// SUMMARY : #// USAGE : LGPL #// ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE #// AUTHOR : Jacques Morice #// E-MAIL : jacques.morice@ann.jussieu.fr #// #/* # 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 # */ ##################################################### # SECTION 1: # General variables to compile sparse solver ##################################################### # Note :: A remplir automatique avec automake # Regarder notation de FreeFem++ ################### # Compiler ################### # C compiler CC = gcc MPICC = /usr/local/bin/mpicc # C++ compiler CXX = g++ MPICXX = /usr/local/bin/mpicxx # Fortran compiler FC = fort77 MPIFC = /usr/local/bin/mpif77 #mpifort77 #/Users/morice/librairie/openmpi/bin/mpif90 --prefix /Users/morice/librairie/openmpi/ FC_LIB = -L/usr/local/lib -lmpi_f77 # Linker MPILD = # directory of include file for mpi MPI_INCLUDE = /I/usr/local/include #-I/Users/morice/librairie/openmpi/include/ MPI_LIB = -L/usr/local/lib -lmpi -lmpi_cxx -lmpi_f77 -lmpi_f90 -lopen-rte -lopen-pal ############### # FLAGS ############### # LDFLAGS_FREEFEM = -bundle -undefined dynamic_lookup -DNDEBUG -g -DDRAWING -DBAMG_LONG_LONG -DCHECK_KN -fno-inline -fexceptions -I/usr/X11/include/ CFLAGS_FREEFEM = -DNDEBUG -g -DDRAWING -DBAMG_LONG_LONG -DCHECK_KN -fno-inline -fexceptions -I/usr/X11/include/ # CFLAGS = $(CFLAGS_FREEFEM) # Additional C compiler flags FFLAGS = $(LDFLAGS_FREEFEM) # Additional Fortran compiler flags LDFLAGS = $(LDFLAGS_FREEFEM) # linker flags COPTFLAGS = -O3 # Optimization flags FOPTFLAGS = -O3 # LDOPTFLAGS = -O3 # # SUFFIX OF DYNAMIC LIBRARY # linux SUF = so # windows SUF = dll # mac osx SUF = dylib SUF = dylib ########################################################## # SECTION 2: # common variable for the different parallel sparse solver # ######################################################### # frefem++ variables FREEFEM_DIR = /Volumes/Ike/cazeaux/ff++/ FREEFEM_INCLUDE = -I$(FREEFEM_DIR)examples++-load/include/ FREEFEM_INCLUDE = -I$(FREEFEM_DIR)examples++-load/include/ # directory of the different package #SOFT_DIR = /Users/morice/librairie/ SOFT_DIR = $(FREEFEM_DIR)/download/ #========== # BLAS #========== BLAS_INCLUDE = BLAS_LIB = -L$(FREEFEM_DIR)ff++/src/solver/PATCHVECLIB/libwrapperdostblas.a -framework veclib #============ # BLACS : this library is need by MUMPS #============ BLACS_DIR = $(SOFT_DIR) BLACS_INCLUDE = BLACS_LIB = -L$(BLACS_DIR)lib/ -lblacsCinit_MPI-FREEFEM-0 -lblacs_MPI-FREEFEM-0 -lblacsF77init_MPI-FREEFEM-0 #============= # SCALAPACK : this library is need by MUMPS #============= SCALAPACK_DIR = $(SOFT_DIR) SCALAPACK_INCLUDE = -I$(SCALAPACK_DIR)include/ SCALAPACK_LIB = -L$(SCALAPACK_DIR)lib/ -lscalapack #============================================== # ordering : metis, parmetis, scotch #=============================================== # scotch SCOTCH_DIR = $(SOFT_DIR) SCOTCH_INCLUDE = -I$(SCOTCH_DIR)include/ SCOTCH_LIB = -L$(SCOTCH_DIR)lib/ -lesmumps -lscotch -lscotcherr -lscotcherrexit -lm # ptscotch PTSCOTCH_INCLUDE = -I$(SCOTCH_DIR)include/ PTSCOTCH_LIB = -L$(SCOTCH_DIR)lib/ -lptscotch -lptscotcherrexit -lm # metis METIS_DIR = $(SOFT_DIR) METIS_INCLUDE = -I$(METIS_DIR)include/metis/ METIS_LIB = -L$(METIS_DIR)lib -lmetis # parmetis PARMETIS_DIR = $(SOFT_DIR) PARMETIS_INCLUDE = -I$(PARMETIS_DIR)include/ PARMETIS_LIB = -L$(PARMETIS_DIR)lib/ -lparmetis -lmetis ########################################### # SECTION 3: # ITERATIVE/PRECONDITIONNER SPARSE SOLVER # ########################################### # HIPS ########################################### # To compile HIPS, we need the following librairies # -- ordering Metis or Scotch # comment lines corresponding to Metis or Scotch in SECTION 2 # -- BLAS # comment lines corresponding to BLAS in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Variables needs by HIPS #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # directory of HIPS HIPS_DIR = $(SOFT_DIR) # include file of HIPS HIPS_INCLUDE = -I$(HIPS_DIR)include/hips/ # library of package hips HIPS_ALL_LIBS = -L$(HIPS_DIR)lib/hips -lio -lhipssequential -lhips #-lspkit IO_LIB = $(HIPS_DIR)lib/hips/libio.a HIPSSEQUENTIAL_LIB = $(HIPS_DIR)lib/hips/libhipssequential.a HIPS_LIB = $(HIPS_DIR)lib/hips/libhips.a #SPKIT_LIB = $(HIPS_DIR)LIB/libspkit.a # other compiler option for HIPS (see value of CFLAGS in SECTION 1) CFLAGS_HIPS = # other include file and library file for interfacing HIPS_OTHER_INCLUDE = HIPS_OTHER_LIB = ########################################### # HYPRE ########################################### # To compile HYPRE, we need the following librairies # -- ordering Metis # comment lines corresponding to Metis in SECTION 2 # -- BLAS # comment lines corresponding to BLAS in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Variables needs by HYPRE #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # directory of HYPRE HYPRE_DIR = $(SOFT_DIR) # include file of HYPRE HYPRE_INCLUDE = -I$(HYPRE_DIR)include/hypre # library of HYPRE HYPRE_LIB = -L$(HYPRE_DIR)lib/hypre/ -lHYPRE # other compiler option for HYPRE (see value of CFLAGS in SECTION 1) CFLAGS_HYPRE = -Wall -DHAVE_CONFIG_H -DHYPRE_TIMING -Wno-deprecated -DLINUX -DSPKIT_F -DMPICH_SKIP_MPICXX # other directory of header file and library file for interfacing HYPRE_OTHER_INCLUDE = HYPRE_OTHER_LIB = -lm -lstdc++ ########################################### # pARMS ########################################### # To compile pARMS, we need the following librairies # -- ordering Metis # comment lines corresponding to Metis in SECTION 2 # -- BLAS # comment lines corresponding to BLAS in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # variable needs by pARMS #!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # directory of pARMS PARMS_DIR = $(SOFT_DIR) # include file of pARMS PARMS_INCLUDE = -I$(PARMS_DIR)include/parms # library of HYPRE PARMS_LIB = -L$(PARMS_DIR)lib/ -lparms-O3 # other compiler option for HIPS (see value of CFLAGS in ) # PARMS NEED THE ARCHITECTURE (see generaldefs.h). For Mac Osx defined the architecture as -DLINUX CFLAGS_PARMS = -DLINUX -DSPKIT_F # other include file and library file for interfacing PARMS_OTHER_INCLUDE = PARMS_OTHER_LIB = ########################################### # SECTION 4: # DIRECT SPARSE SOLVER # ########################################### # MUMPS ########################################### # To compile MUMPS, we need the following librairies # -- ordering metis, scotch # comment lines corresponding to Metis and Scotch in SECTION 2 # -- BLAS, BLACS, SCALAPACK # comment lines corresponding to BLAS, BLACS and SCALAPACK in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Variables needs by MUMPS #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MUMPS_HOST = BROCHET # directory of MUMPS MUMPS_DIR = $(SOFT_DIR)mumps/MUMPS_4.9.2/ # directory of Header File for MUMPS MUMPS_INCLUDE = -I$(MUMPS_DIR)include/ # library of MUMPS MUMPS_LIB = -L$(MUMPS_DIR)lib/ -lmumps_common_$(MUMPS_HOST) -ldmumps_$(MUMPS_HOST) -lzmumps_$(MUMPS_HOST) # pord : ordering include in MUMPS package PORD_DIR = $(MUMPS_DIR)PORD/ PORD_INCLUDE = -I$(PORD_DIR)include PORD_LIB = -L$(MUMPS_DIR)lib/ -lpord_$(MUMPS_HOST) # other compiler option for MUMPS (see value of CFLAGS in SECTION 1) CFLAGS_MUMPS = # other include file and library file for interfacing MUMPS_OTHER_INCLUDE = -I/usr/X11/include MUMPS_OTHER_LIB = -L/usr/lib/gcc/i686-apple-darwin9/4.2.1/ -lgfortran ########################################### # SuperLU_DIST ########################################### # To compile SuperLU_DIST, we need the following librairies # -- ordering Metis and ParMetis # comment lines corresponding to Metis and ParMetis in SECTION 2 # -- BLAS # comment lines corresponding to BLAS in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Variables needs by SuperLU_DIST #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # directory of superlu_dist SLUDIST_DIR = $(SOFT_DIR) # include file of superlu_dist SLUDIST_INCLUDE = -I$(SLUDIST_DIR)include # librairie of superlu_dist SLUDIST_LIB = -L$(SLUDIST_DIR)lib/ -lsuperlu_dist_2.3 # other compiler option for SuperLU (see value of CFLAGS in SECTION 1) SLUDIST_CFLAGS = # other include file and library file for interfacing SLUDIST_OTHER_INCLUDE = SLUDIST_OTHER_LIB = ########################################### # Pastix ########################################### # To compile pastix, we need the following librairies # -- ordering scotch, ptscotch, metis # comment lines corresponding to metis, scotch and ptsccoth in SECTION 2 # -- BLAS # comment lines corresponding to BLAS in SECTION 2 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Variables needs by pastix #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # To obtain real and complex arithmetics, we need to install for real and for complex separately. # Hence we need to have two differents pastix directory #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # real pastix # directory of pastix REAL_PASTIX_DIR = $(SOFT_DIR)/ # include directory of pastix REAL_PASTIX_INCLUDE = -I$(REAL_PASTIX_DIR)include/pastix/double/ # library REAL_PASTIX_LIB = -L$(REAL_PASTIX_DIR)lib/pastix/double -lpastix #-lmatrix_driver # complex pastix # directory of pstix COMPLEX_PASTIX_DIR = $(SOFT_DIR) # include directory of pastix COMPLEX_PASTIX_INCLUDE = -I$(COMPLEX_PASTIX_DIR)include/pastix/complex/ # library COMPLEX_PASTIX_LIB = -L$(COMPLEX_PASTIX_DIR)lib/pastix/complex/ -lpastix #-lmatrix_driver # other compiler option for PASTIX (see value of CFLAGS in SECTION 1) CFLAGS_FLAGS = -DFORCE_LONG -DNUMA_ALLOC -DX_ARCHi686_mac -DDOF_CONSTANT -DCOMMON_DEBUG -DSYMBOL_DEBUG -DDOF_DEBUG -DSOLVER_DEBUG -DORDER_DEBUG -DFAX_DEBUG -DSCOTCH_DEBUG -DDEBUG_BLEND -DBUBBLE_DEBUG -DPASTIX_DEBUG -Wno-depreciated # other directory of header file and library file for interfacing PASTIX_OTHER_INCLUDE = PASTIX_OTHER_LIB = -lm -lsupc++ -lpthreadfreefem++-3.61-1/src/solver/makefile000644 000767 000024 00000007235 13256636774 017433 0ustar00hechtstaff000000 000000 include makefile-sparsesolver.inc #Creation of Hips dynamic librairy hips : $(MPICC) -c $(CFLAGS) $(CFLAGS_HIPS) $(FREEFEM_INCLUDE) $(HIPS_INCLUDE) $(METIS_INCLUDE) $(HIPS_OTHER_INCLUDE) hips_FreeFem.cpp $(MPIFC)$ $(FFLAGS) hips_FreeFem.o -o hips_FreeFem.$(SUF) $(HIPS_ALL_LIBS) $(BLAS_LIB) $(METIS_LIB) $(HIPS_OTHER_LIB) parms : $(MPICC) -c $(CFLAGS) $(CFLAGS_PARMS) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(PARMS_INCLUDE) $(METIS_INCLUDE) $(PARMS_OTHER_INCLUDE) parms_FreeFem.cpp $(MPIFC)$ $(FFLAGS) parms_FreeFem.o -o parms_FreeFem.$(SUF) $(PARMS_LIB) $(BLAS_LIB) $(METIS_LIB) $(PARMS_OTHER_LIB) hypre : $(MPICC) -c $(CFLAGS) $(CFLAGS_HYPRE) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(HYPRE_INCLUDE) $(METIS_INCLUDE) $(HYPRE_OTHER_INCLUDE) hypre_FreeFem.cpp $(MPIFC)$ $(FFLAGS) hypre_FreeFem.o -o hypre_FreeFem.$(SUF) $(HYPRE_LIB) $(BLAS_LIB) $(METIS_LIB) $(HYPRE_OTHER_LIB) mumps : $(MPICC) -c $(CFLAGS) $(CFLAGS_MUMPS) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(MUMPS_OTHER_INCLUDE) $(MUMPS_INCLUDE) $(SCOTCH_INCLUDE) MUMPS_FreeFem.cpp $(MPIFC) $(FFLAGS) $(MPI_INCLUDE) $(MUMPS_OTHER_INCLUDE) $(MUMPS_INCLUDE) MUMPS_FreeFem.o -o MUMPS_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(BLACS_LIB) $(SCALAPACK_LIB) $(METIS_LIB) $(PORD_LIB) $(SCOTCH_LIB) $(MUMPS_LIB) $(MUMPS_OTHER_LIB) # rpastix_dist: $(MPICC) -c $(CFLAGS) $(CFLAGS_PASTIX) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(PTSCOTCH_INCLUDE) $(REAL_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) real_dpastix_FreeFem.cpp $(MPIFC) $(FFLAGS) $(PTSCOTCH_INCLUDE) $(REAL_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) real_dpastix_FreeFem.o -o real_dpastix_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(PTSCOTCH_LIB) $(METIS_LIB) $(REAL_PASTIX_LIB) $(PASTIX_OTHER_LIB) rpastix: $(MPICC) -c $(CFLAGS) $(CFLAGS_PASTIX) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(SCOTCH_INCLUDE) $(REAL_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) real_pastix_FreeFem.cpp $(MPIFC) $(FFLAGS) $(SCOTCH_INCLUDE) $(REAL_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) real_pastix_FreeFem.o -o real_pastix_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(SCOTCH_LIB) $(METIS_LIB) $(REAL_PASTIX_LIB) $(PASTIX_OTHER_LIB) cpastix_dist: $(MPICC) -c $(CFLAGS) $(CFLAGS_PASTIX) -Wno-deprecated $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(SCOTCH_INCLUDE) $(COMPLEX_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) complex_dpastix_FreeFem.cpp $(MPIFC) $(FFLAGS) $(PTSCOTCH_INCLUDE) $(COMPLEX_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) complex_dpastix_FreeFem.o -o complex_dpastix_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(PTSCOTCH_LIB) $(METIS_LIB) $(COMPLEX_PASTIX_LIB) $(PASTIX_OTHER_LIB) cpastix: $(MPICXX) -c $(CFLAGS) $(CFLAGS_PASTIX) -Wno-deprecated $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(SCOTCH_INCLUDE) $(COMPLEX_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) complex_pastix_FreeFem.cpp $(MPIFC) $(FFLAGS) $(SCOTCH_INCLUDE) $(COMPLEX_PASTIX_INCLUDE) $(PASTIX_OTHER_INCLUDE) complex_pastix_FreeFem.o -o complex_pastix_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(SCOTCH_LIB) $(METIS_LIB) $(COMPLEX_PASTIX_LIB) $(PASTIX_OTHER_LIB) rsludist: $(MPICC) -c $(CFLAGS) $(CFLAGS_SLUDIST) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(SLUDIST_INCLUDE) $(SLUDIST_OTHER_INCLUDE) real_SuperLU_DIST_FreeFem.cpp $(MPIFC) $(FFLAGS) $(SLUDIST_INCLUDE) $(SLUDIST_OTHER_INCLUDE) real_SuperLU_DIST_FreeFem.o -o real_SuperLU_DIST_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(PARMETIS_LIB) $(METIS_LIB) $(SLUDIST_LIB) $(SLUDIST_OTHER_LIB) csludist: $(MPICC) -c $(CFLAGS) $(CFLAGS_SLUDIST) $(MPI_INCLUDE) $(FREEFEM_INCLUDE) $(SLUDIST_INCLUDE) $(SLUDIST_OTHER_INCLUDE) complex_SuperLU_DIST_FreeFem.cpp $(MPIFC) $(FFLAGS) $(SLUDIST_INCLUDE) $(SLUDIST_OTHER_INCLUDE) complex_SuperLU_DIST_FreeFem.o -o complex_SuperLU_DIST_FreeFem.$(SUF) $(MPI_LIB) $(BLAS_LIB) $(PARMETIS_LIB) $(METIS_LIB) $(SLUDIST_LIB) $(SLUDIST_OTHER_LIB) freefem++-3.61-1/src/solver/real_SuperLU_DIST_FreeFem.cpp000644 000767 000024 00000054642 13256636774 023221 0ustar00hechtstaff000000 000000 // for automatic compilation with ff-c++ //ff-c++-LIBRARY-dep: superlu_dist parmetis metis blas //ff-c++-cpp-dep: // // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // /* 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 */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "mpi.h" #include "superlu_ddefs.h" #include "ffsuperludistoption.hpp" template struct SuperLUmpiDISTDriver { }; template <> struct SuperLUmpiDISTDriver { /* Driver routines */ static Dtype_t R_SLU_T() { return SLU_D;} static void pgssvx(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, SOLVEstruct_t *p9, double *p10, SuperLUStat_t *p11, int *p12) { pdgssvx( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12 ); } static void pgssvx_ABglobal(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, double *p9, SuperLUStat_t *p10, int *p11) { pdgssvx_ABglobal( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11); } static void Print_CompRowLoc_Matrix_dist(SuperMatrix *p1) { dPrint_CompRowLoc_Matrix_dist(p1); } static void Create_CompCol_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, Stype_t p8, Dtype_t p9, Mtype_t p10) { dCreate_CompCol_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); } static void Create_CompRowLoc_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, int_t p5, int_t p6, double *p7, int_t *p8, int_t *p9, Stype_t p10, Dtype_t p11, Mtype_t p12) { dCreate_CompRowLoc_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12); } static void CompRow_to_CompCol_dist(int_t p1, int_t p2, int_t p3, double *p4, int_t *p5, int_t *p6, double **p7, int_t **p8, int_t **p9) { dCompRow_to_CompCol_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9 ); } static void Create_Dense_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, double *p4, int_t p5, Stype_t p6, Dtype_t p7, Mtype_t p8) { dCreate_Dense_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8 ); } static void Create_SuperNode_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, int_t *p8, int_t *p9, int_t *p10, Stype_t p11, Dtype_t p12, Mtype_t p13) { dCreate_SuperNode_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10, p11,p12,p13); } }; template class SolveSuperLUmpi : public MatriceMorse::VirtualSolver, public SuperLUmpiDISTDriver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 //mutable char equed[1]; //yes_no_t equil; mutable SuperMatrix A; NCformat *Astore; //NCformat *Ustore; //SCformat *Lstore; mutable superlu_options_t options; mutable mem_usage_t mem_usage; mutable ScalePermstruct_t ScalePermstruct; mutable LUstruct_t LUstruct; mutable SOLVEstruct_t SOLVEstruct; mutable gridinfo_t grid; string string_option; string data_option; R *a; int *asub, *xa; int_t m, n, nnz; // rajout pour // int_t nprow,npcol; /* process rows and process columns*/ int matrixdist; // type of distributed matrix MPI_Comm commworld ; static const int assembled =0; static const int distributedglobal =1; static const int distributed =2; int iam; public: SolveSuperLUmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, string param_char, KN &pperm_r, KN &pperm_c,void * ccommworld=0) : eps(epsilon),epsr(0), tgv(ttgv),string_option(param_char),data_option(datafile), tol_pivot_sym(pivot_sym),tol_pivot(pivot) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; R* B; //R* X; SuperLUStat_t stat; int info, ldb, nrhs=0; int i; double* berr; //int iam; // Add for distributed matrix int_t m_loc, m_loc_fst, fst_row, nnz_loc, fst_nnz; R *aloc; int *asubloc, *xaloc; // End Add for distributed matrix A.Store=0; int status; // time variables long int starttime,finishtime; long int timeused; // rajout debug int myid; if(verbosity) starttime = clock(); /* Defaults */ nrhs = 0; /* lecture de nprow and npcol */ // Cas max deux procs nprow = 1; npcol = 1; matrixdist=0; if(!data_option.empty()) read_nprow_npcol_matrixdist_superlu_datafile(&data_option, &nprow, &npcol, &matrixdist); if(!string_option.empty()) read_nprow_npcol_freefem( &string_option, &nprow, &npcol, &matrixdist); /* ------------------------------------------------------------ INITIALIZE THE SUPERLU PROCESS GRID. ------------------------------------------------------------*/ cout << "Real superlu_gridinit" << " " << commworld << " " << ccommworld <= nprow * npcol ){ printf("this process is not used in superlu %d \n",iam); } else { /* set the default options */ set_default_options_dist(&options); DiagScale_t optionDiagScale; if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); if(!data_option.empty()) read_options_superlu_datafile(&data_option,&options,&nprow, &npcol, &matrixdist,&optionDiagScale); // matrix to procs and vectors if( matrixdist == assembled ){ if(!iam){ cout << "iam=" << iam << endl; printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; assert( AA.lg[n] == nnz ); printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* transform Row to Col */ // cela coute cher comme fonction // //dallocateA_dist(n, nnz, &a, &asub, &xa); //dCompRow_to_CompCol_dist(m,n,nnz,arow,asubrow,xarow,&a,&asub,&xa); dCompRow_to_CompCol_dist(m,n,nnz,AA.a,AA.cl,AA.lg,&a,&asub,&xa); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } else{ /* printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompCol_Matrix_dist" <::pgssvx_ABglobal(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } //########################################################## // // matrix distributed with matrix global given // //########################################################## else if( matrixdist == distributedglobal) { if(!iam){ printf("\tProcess grid\t%d X %d iam=%d \n", grid.nprow, grid.npcol,iam); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; a=AA.a; asub=AA.cl; xa=AA.lg; xa[n] = nnz; printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( AA.cl, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.lg, n+1, mpi_int_t, 0, grid.comm ); } else{ printf("\tProcess grid\t%d X %d iam=%d \n", grid.nprow, grid.npcol,iam); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } /* Compute the number of rows to be distributed to local process */ m_loc = m / (grid.nprow * grid.npcol); m_loc_fst = m_loc; /* When m / procs is not an integer */ if ((m_loc * grid.nprow * grid.npcol) != m) { /*m_loc = m_loc+1; m_loc_fst = m_loc;*/ if (iam == (grid.nprow * grid.npcol - 1)) /* last proc. gets all*/ m_loc = m - m_loc * (grid.nprow * grid.npcol - 1); } fst_row = iam * m_loc_fst; nnz_loc = xa[fst_row+m_loc]-xa[fst_row]; xaloc = (int_t*) intMalloc_dist(m_loc+1); for(int ii=0; ii < m_loc; ii++){ xaloc[ii] = xa[fst_row+ii]-xa[fst_row]; } xaloc[m_loc]=nnz_loc; fst_nnz = xa[fst_row]; aloc = (double*) doubleMalloc_dist(nnz_loc); asubloc = (int_t*) intMalloc_dist(nnz_loc); for(int ii=0; ii < nnz_loc; ii++){ aloc[ii] = a[fst_nnz+ii]; asubloc[ii] = asub[fst_nnz+ii]; } if( iam ){ SUPERLU_FREE( a ); SUPERLU_FREE( asub ); SUPERLU_FREE( xa ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompRowCol_Matrix_dist" <::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } SUPERLU_FREE( B ); options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ nrhs=1; SUPERLU_FREE(berr); if(iam==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "SuperLU_DIST : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { R* B; SuperLUStat_t stat; //int iam; int info=0, ldb=m, nrhs=1; int i; double* berr; double ferr; double rpg, rcond; int_t m_loc,m_loc_fst,fst_row; // time variable long int starttime,finishtime; long int timeused; if( iam < nprow*npcol){ if(verbosity) starttime = clock(); if(n != m) exit(1); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); nrhs= 1; //iam = grid.iam; //if( iam < nprow*npcol){ /* Initialize the statistics variables. */ PStatInit(&stat); /* cas matrix assembled */ if( matrixdist == assembled ){ if( !(B = doubleMalloc_dist(m*nrhs)) ){ printf("probleme d allocation\n"); exit(1); } for(int ii=0; ii::pgssvx_ABglobal (&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if(verbosity) PStatPrint(&options, &stat, &grid); for(int ii=0; ii::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if ( !(xtemp = doubleMalloc_dist(AA.n)) ){ printf("probleme d allocation de xtemp\n"); exit(1); } int disp[nprow*npcol]; MPI_Allgather(&fst_row, 1, MPI_INT, disp, 1, MPI_INT, grid.comm); int recv[nprow*npcol]; MPI_Allgather(&m_loc, 1, MPI_INT, recv, 1, MPI_INT, grid.comm); MPI_Allgatherv(B, m_loc, MPI_DOUBLE, xtemp, recv, disp, MPI_DOUBLE, grid.comm); for(int ii= 0; ii< AA.n ; ii++) x[ii] = xtemp[ii]; if(verbosity) cout << " x min max " << x.min() << " " < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverSuperLUmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverSuperLUmpi" << endl; return new SolveSuperLUmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.sparams, ds.perm_r, ds.perm_c, ds.commworld); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; } bool SetSuperLUmpi() { if(verbosity) cout << " SetDefault sparse solver to SuperLUmpi double" << endl; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Real SuperLUdist, defaultsolver defaultsolverSuperLUdist" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("realdefaulttoSuperLUdist","(",new OneOperator0(SetSuperLUmpi)); } freefem++-3.61-1/src/solver/wrapper_dotblas1.c000644 000767 000024 00000006470 13256636774 021350 0ustar00hechtstaff000000 000000 /* wrapper_dotblas1.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" /* a compile sans underscore -fno-underscoring */ /* gfortran -fno-underscoring -O3 -c wrapper_dotblas.f */ /* ------- */ /* Double Complex */ VOID zdotc___(doublecomplex * ret_val, integer *n, doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static doublecomplex z__; extern /* Subroutine */ int cblas_zdotc_sub__(integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *); /* Parameter adjustments */ --zy; --zx; /* Function Body */ i__1 = *n; i__2 = *incx; i__3 = *incy; cblas_zdotc_sub__(&i__1, &zx[1], &i__2, &zy[1], &i__3, &z__); /* print*,'cblas_zdotc_sub' */ ret_val->r = z__.r, ret_val->i = z__.i; return ; } /* zdotc___ */ /* Double Complex */ VOID zdotu___(doublecomplex * ret_val, integer *n, doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static doublecomplex z__; extern /* Subroutine */ int cblas_zdotu_sub__(integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *); /* Parameter adjustments */ --zy; --zx; /* Function Body */ i__1 = *n; i__2 = *incx; i__3 = *incy; cblas_zdotu_sub__(&i__1, &zx[1], &i__2, &zy[1], &i__3, &z__); /* print*,'cblas_zdotu_sub' */ ret_val->r = z__.r, ret_val->i = z__.i; return ; } /* zdotu___ */ /* Complex */ VOID cdotc___(complex * ret_val, integer *n, complex *cx, integer *incx, complex *cy, integer *incy) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static complex c__; extern /* Subroutine */ int cblas_cdotc_sub__(integer *, complex *, integer *, complex *, integer *, complex *); /* Parameter adjustments */ --cy; --cx; /* Function Body */ i__1 = *n; i__2 = *incx; i__3 = *incy; cblas_cdotc_sub__(&i__1, &cx[1], &i__2, &cy[1], &i__3, &c__); /* print*,'cblas_cdotc_sub' */ ret_val->r = c__.r, ret_val->i = c__.i; return ; } /* cdotc___ */ /* Complex */ VOID cdotu___(complex * ret_val, integer *n, complex *cx, integer *incx, complex *cy, integer *incy) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static complex c__; extern /* Subroutine */ int cblas_cdotu_sub__(integer *, complex *, integer *, complex *, integer *, complex *); /* Parameter adjustments */ --cy; --cx; /* Function Body */ i__1 = *n; i__2 = *incx; i__3 = *incy; cblas_cdotu_sub__(&i__1, &cx[1], &i__2, &cy[1], &i__3, &c__); /* print*,'cblas_cdotu_sub' */ ret_val->r = c__.r, ret_val->i = c__.i; return ; } /* cdotu___ */ freefem++-3.61-1/src/solver/complex_SuperLU_DIST_FreeFem.cpp000644 000767 000024 00000056760 13256636774 023750 0ustar00hechtstaff000000 000000 // for automatic compilation with ff-c++ //ff-c++-LIBRARY-dep: superlu_dist parmetis metis blas //ff-c++-cpp-dep: // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // /* 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 */ /* Interface freefem++ et SuperLU_DIST_2.3 /bin/sh ff-mpic++ zSuperLU_DIST.cpp -I/Users/morice/librairie/SuperLU_DIST_2.3/SRC/ -L/Users/morice/librairie/openmpi/lib/ -lmpi -lopen-pal -lopen-rte -L/Users/morice/librairie/PATCHVECLIB/ -lwrapperdotblas -framework veclib -L/Users/morice/librairie/ParMetis-3.1/ -lparmetis -lmetis -L/Users/morice/librairie/SuperLU_DIST_2.3/lib/ -lsuperlu_dist_2.3 */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "mpi.h" #include "superlu_zdefs.h" #include "ffsuperludistoption.hpp" template struct SuperLUmpiDISTDriver { }; template <> struct SuperLUmpiDISTDriver { /* Driver routines */ /* Driver routines */ static Dtype_t R_SLU_T() { return SLU_Z;} static doublecomplex *dc(Complex *p) { return (doublecomplex *) (void *) p;} static doublecomplex **dc(Complex **p) { return (doublecomplex **) (void *) p;} // Remplacement doublecomplex par Complex static void pgssvx(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, Complex *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, SOLVEstruct_t *p9, double *p10, SuperLUStat_t *p11, int *p12) { pzgssvx( p1,p2,p3, dc(p4),p5,p6,p7,p8,p9,p10,p11,p12 ); } static void pgssvx_ABglobal(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, Complex *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, double *p9, SuperLUStat_t *p10, int *p11) { pzgssvx_ABglobal( p1,p2,p3, dc(p4),p5,p6,p7,p8,p9,p10,p11 ); } static void Create_CompCol_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, Complex *p5, int_t *p6, int_t *p7, Stype_t p8, Dtype_t p9, Mtype_t p10) { zCreate_CompCol_Matrix_dist( p1,p2,p3, p4,dc(p5),p6,p7,p8,p9,p10 ); } static void Create_CompRowLoc_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, int_t p5, int_t p6, Complex *p7, int_t *p8, int_t *p9, Stype_t p10, Dtype_t p11, Mtype_t p12) { zCreate_CompRowLoc_Matrix_dist( p1,p2,p3, p4,p5,p6,dc(p7),p8,p9,p10,p11,p12 ); } static void CompRow_to_CompCol_dist(int_t p1, int_t p2, int_t p3, Complex *p4, int_t *p5, int_t *p6, Complex **p7, int_t **p8, int_t **p9) { zCompRow_to_CompCol_dist( p1,p2,p3, dc(p4),p5,p6,dc(p7),p8,p9 ); } static void Create_Dense_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, Complex *p4, int_t p5, Stype_t p6, Dtype_t p7,Mtype_t p8) { zCreate_Dense_Matrix_dist( p1,p2,p3, dc(p4),p5,p6,p7,p8 ); } static void Create_SuperNode_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, Complex *p5, int_t *p6, int_t *p7, int_t *p8, int_t *p9, int_t *p10, Stype_t p11, Dtype_t p12, Mtype_t p13) { zCreate_SuperNode_Matrix_dist( p1,p2,p3, p4,dc(p5),p6,p7,p8,p9,p10,p11,p12,p13 ); } static void Print_CompRowLoc_Matrix_dist(SuperMatrix *p1) { zPrint_CompRowLoc_Matrix_dist(p1); } }; template class ZSolveSuperLUmpi : public MatriceMorse::VirtualSolver, public SuperLUmpiDISTDriver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 //mutable char equed[1]; //yes_no_t equil; mutable SuperMatrix A; NCformat *Astore; //NCformat *Ustore; //SCformat *Lstore; mutable superlu_options_t options; mutable mem_usage_t mem_usage; mutable ScalePermstruct_t ScalePermstruct; mutable LUstruct_t LUstruct; mutable SOLVEstruct_t SOLVEstruct; mutable gridinfo_t grid; string string_option; string data_option; R *a; int *asub, *xa; int_t m, n, nnz; // rajout pour // int_t nprow,npcol; /* process rows and process columns*/ int matrixdist; // type of distributed matrix MPI_Comm commworld ; static const int assembled =0; static const int distributedglobal =1; static const int distributed =2; public: ZSolveSuperLUmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, string param_char, KN &pperm_r, KN &pperm_c, void * ccommworld=0 ) : eps(epsilon),epsr(0), tgv(ttgv),string_option(param_char),data_option(datafile), tol_pivot_sym(pivot_sym),tol_pivot(pivot) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; R* B; //R* X; SuperLUStat_t stat; int info, ldb, nrhs=0; int i; double* berr; int iam; // Add for distributed matrix int_t m_loc, m_loc_fst, fst_row, nnz_loc, fst_nnz; R *aloc; int *asubloc, *xaloc; // End Add for distributed matrix // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); A.Store=0; /* Defaults */ nrhs = 0; /* lecture de nprow and npcol */ // Cas max deux procs nprow = 1; npcol = 1; matrixdist=0; /* set the default options */ set_default_options_dist(&options); DiagScale_t optionDiagScale; //if(verbosity > 10) print_options_dist(&options); if(!string_option.empty()) read_nprow_npcol_freefem( &string_option, &nprow, &npcol, &matrixdist); if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); if(!data_option.empty()) read_options_superlu_datafile(&data_option,&options,&nprow, &npcol, &matrixdist,&optionDiagScale); //if(verbosity > 10) print_options_dist(&options); /* ------------------------------------------------------------ INITIALIZE THE SUPERLU PROCESS GRID. ------------------------------------------------------------*/ cout << "Complex superlu_gridinit " << commworld << " "<< ccommworld << " : " << nprow << "X" << npcol <= nprow * npcol ){ //superlu_gridexit(&grid); printf("this process is not used in superlu %d \n",iam); } else { // matrix to procs and vectors if( matrixdist == assembled ){ if(!iam){ cout << "iam=" << iam << endl; printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; assert( AA.lg[n] == nnz ); printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* transform Row to Col */ // cela coute cher comme fonction // // dallocateA_dist(n, nnz, &a, &asub, &xa); // dCompRow_to_CompCol_dist(m,n,nnz,arow,asubrow,xarow,&a,&asub,&xa); CompRow_to_CompCol_dist(m,n,nnz,AA.a,AA.cl,AA.lg,&a,&asub,&xa); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } else{ /* printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ zallocateA_dist(n, nnz, dc(&a), &asub, &xa); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompCol_Matrix_dist" <::pgssvx_ABglobal(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } //########################################################## // // matrix distributed with matrix global given // //########################################################## else if( matrixdist == distributedglobal) { if(!iam){ printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; a=AA.a; asub=AA.cl; xa=AA.lg; xa[n] = nnz; printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( AA.cl, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.lg, n+1, mpi_int_t, 0, grid.comm ); } else { printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ zallocateA_dist(n, nnz, dc(&a), &asub, &xa); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } /* Compute the number of rows to be distributed to local process */ m_loc = m / (grid.nprow * grid.npcol); m_loc_fst = m_loc; /* When m / procs is not an integer */ if ((m_loc * grid.nprow * grid.npcol) != m) { /*m_loc = m_loc+1; m_loc_fst = m_loc;*/ if (iam == (grid.nprow * grid.npcol - 1)) /* last proc. gets all*/ m_loc = m - m_loc * (grid.nprow * grid.npcol - 1); } fst_row = iam * m_loc_fst; nnz_loc = xa[fst_row+m_loc]-xa[fst_row]; zallocateA_dist(m_loc, nnz_loc, dc(&aloc), &asubloc, &xaloc); //xaloc = (int_t*) intMalloc_dist(m_loc+1); for(int ii=0; ii < m_loc; ii++){ xaloc[ii] = xa[fst_row+ii]-xa[fst_row]; } xaloc[m_loc]=nnz_loc; fst_nnz = xa[fst_row]; //aloc = new R[nnz_loc]; //aloc = (Complex*) doubleMalloc_dist(nnz_loc); //asubloc = (int_t*) intMalloc_dist(nnz_loc); for(int ii=0; ii < nnz_loc; ii++){ aloc[ii] = a[fst_nnz+ii]; asubloc[ii] = asub[fst_nnz+ii]; } if( iam ){ SUPERLU_FREE( a ); SUPERLU_FREE( asub ); SUPERLU_FREE( xa ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); if(verbosity) cout << "Debut: Create_CompRowCol_Matrix_dist" <::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } delete [] B; options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ nrhs=1; SUPERLU_FREE(berr); if(iam==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "SuperLU_DIST : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { R* B; SuperLUStat_t stat; int iam; int info=0, ldb=m, nrhs=1; int i; double* berr; double ferr; double rpg, rcond; int_t m_loc,m_loc_fst,fst_row; // time variables long int starttime,finishtime; long int timeused; iam = grid.iam; if( iam < nprow*npcol){ if(verbosity) starttime = clock(); if(n != m) exit(1); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); nrhs= 1; /* Initialize the statistics variables. */ PStatInit(&stat); /* cas matrix assembled */ if( matrixdist == assembled ){ if( !(B = new R[m*nrhs] ) ){ printf("probleme d allocation\n"); exit(1); } for(int ii=0; ii::pgssvx_ABglobal (&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if(verbosity) PStatPrint(&options, &stat, &grid); for(int ii=0; ii::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if ( !(xtemp = new R[AA.n]) ){ printf("probleme d allocation de xtemp\n"); exit(1); } int disp[nprow*npcol]; MPI_Allgather(&fst_row, 1, MPI_INT, disp, 1, MPI_INT, grid.comm); int recv[nprow*npcol]; MPI_Allgather(&m_loc, 1, MPI_INT, recv, 1, MPI_INT, grid.comm); MPI_Allgatherv(B, m_loc, SuperLU_MPI_DOUBLE_COMPLEX, xtemp, recv, disp, SuperLU_MPI_DOUBLE_COMPLEX, grid.comm); for(int ii= 0; ii< AA.n ; ii++) x[ii] = xtemp[ii]; if(verbosity) cout << " x min max " << x.min() << " " < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverSuperLUmpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverSuperLUmpi" << endl; return new ZSolveSuperLUmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.sparams, ds.perm_r, ds.perm_c); } class Init { public: Init(); }; // the 2 default sparse solver double and complex //DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; //DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; } bool SetSuperLUmpi() { if(verbosity) cout << " SetDefault sparse solver to SuperLUmpi double" << endl; //DefSparseSolver::solver =BuildSolverSuperLUmpi; DefSparseSolver::solver =BuildSolverSuperLUmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; } Init init; Init::Init() { //SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Complex SuperLU_DIST, defaultsolver defaultsolverSuperLUdist" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; //DefSparseSolver::solver =BuildSolverSuperLUmpi; DefSparseSolver::solver =BuildSolverSuperLUmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("complexdefaulttoSuperLUdist","(",new OneOperator0(SetSuperLUmpi)); } freefem++-3.61-1/src/solver/parms_FreeFem.cpp000755 000767 000024 00000101470 13256636774 021151 0ustar00hechtstaff000000 000000 // ORIG-DATE: 04/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : INRIA FUTUR // AUTHOR : Guy Atenekeng // E-MAIL : Guy_Antoine_Atenekeng_Kahou@lri.fr // /* 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 */ #include using namespace std; #define MCW MPI_COMM_WORLD #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "mpi.h" /* Explain here what foobar does */ #ifdef __cplusplus extern "C" { #endif #include "psparslib.h" #include "generaldefs.h" #ifdef __cplusplus } #endif extern "C" { #include "metis.h" } #include #include #include #define BUFLEN 100 #define NORHS 0 #define BUFLEN 100 //This functions come from pARMS package and consist to scale matrix class parm_param { public: mutable PrePar prepar; mutable IterPar ipar; mutable int sol_type; mutable int iov,scale, unsymm,method; mutable int solver; mutable int VERBOSE; public: parm_param(){ PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); /*---------------------------------------------------------------------- * * This function sets some default parameters just to get started with * * pARMS. There are two arrays which define the parameters in pARMS. * * Because ther\ e are so many methods, the number of parameters may seem * * overwhelming.. However\ , not all are used. For example when add_ilut * * is used only two parameters are r\ equired which are the drop * * tolerance and the max fill per row.. This function s\ ets everything * * so that all the methods can be safely tested. YS - * * * *------------------------------------------------------------------------*/ int i; /*------------------------------------------------------------------------*/ for (i=1; i<18; i++) ipar->ipar[i] = 0; /* parameters to be set for the solver -- not all of these are used -- depending on the method selected - */ /* parameters associated with various accelerators (inner/outer) */ ipar->ipar[0] = 3; /* nlev in arms when used */ ipar->ipar[1] = 20; /* block size in arms when used */ ipar->ipar[5] = 30; /* Outer iteration Krylov subs. dimension */ ipar->ipar[6] = 200; /* Max. outer iterations */ ipar->ipar[3] = 3; /* Inner iteration Krylov subs. dimension */ ipar->ipar[4] = 3; /* Max. inner iterations */ ipar->pgfpar[0] = 0.01; /* tolerance for inner iteration when used */ ipar->pgfpar[1] = 1.e-10;/* tolerance for outer iteration */ /* preconditioning parameters */ prepar->tolind = 0.1; /* tolerance used for diag dom. filtration alg.*/ prepar->lfil[0] = 20; /* lfil0 (ilut, iluk, and arms) */ prepar->lfil[4] = 20; /* lfil for Schur complement const. */ prepar->lfil[5] = 20; /* lfil for Schur complement const. */ prepar->droptol[0]=.001; /* droptol0 (ilut, iluk, and arms) */ prepar->droptol[4]=.001; /* droptol for Schur complement const. */ prepar->droptol[5]=.001; /* droptol for Schur complement const. */ prepar->mc = 1; /* multicoloring or not in ILU when used */ //Integer parameter iov=0; scale=1; unsymm=1; method= 2; VERBOSE=0; /*no statistic infos has print*/ /*VERBOSE=1 Only informations on convergence will be print*/ /*VERBOSE=2 Only informations on time will be print*/ solver=0; memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); for (i=1; i<4; i++) { prepar->droptol[i] = prepar->droptol[0]; prepar->lfil[i] = prepar->lfil[0]; } prepar->lfil[6] = prepar->lfil[5]; ipar->in_iters = 0; /*-------------------- done */ } public: parm_param(const KN ¶m_int, const KN ¶m_double) { int i; PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); for (i=1; i<18; i++) ipar->ipar[i] = 0; if(param_int.N()>0){if((param_int[0]<0)||(param_int[0]>2)) {printf("%s","WRONG SOLVER INDEX WE SET DEFAULT ONE \n"); solver=0; } else solver=param_int[0];}else solver=0; if(param_int.N()>1){if((param_int[1]<0)||(param_int[1]>13)) {printf("%s","WRONG INDEX FOR PRECONDITIONER, WE SET DEFAULT ONE \n"); method=2; } else if((param_int[1]>=0)||(param_int[1]<=13)) method=param_int[1];}else method=2; if(param_int.N()>2){if(param_int[2]>0) ipar->ipar[5]=param_int[2]; else ipar->ipar[5]=30;} else ipar->ipar[5]=30; /* Outer iteration Krylov subs. dimension */ if(param_int.N()>3){if(param_int[3]>0) ipar->ipar[6]=param_int[3]; else ipar->ipar[6]=1000;} else ipar->ipar[6]=1000; /* Max. outer iterations */ if((method==3)||(method==7)||(method==11)) {if(param_int.N()>4) {if(param_int[4]>0) ipar->ipar[0]=param_int[4]; else ipar->ipar[0]=3;} else ipar->ipar[0]=3; } /* nlev in arms when used */ if(param_int.N()>5){ if(param_int[5]>0) ipar->ipar[3]=param_int[5]; else ipar->ipar[3]=3;} else ipar->ipar[3]=3; /* Inner iteration Krylov subs. dimension */ if(param_int.N()>6){if(param_int[6]>0) ipar->ipar[4]=param_int[6]; else ipar->ipar[4]=3;} else ipar->ipar[4]=3; /* Max. inner iterations */ if(param_int.N()>7){if(param_int[7]>=0) unsymm=param_int[7]; else unsymm=0;} else unsymm=0; if(param_int.N()>8) {if(param_int[8]>=0) iov=param_int[8]; else iov=0;} else iov=0; if(param_int.N()>9) {if(param_int[9]>0) scale=param_int[9]; else scale=1;}else scale=1; if(param_int.N()>10){if(param_int[10]>0) ipar->ipar[1]=param_int[10]; else ipar->ipar[1]=20; }else ipar->ipar[1]=20; if(param_int.N()>11){if(param_int[11]>0) prepar->lfil[0]=param_int[11]; else prepar->lfil[0]=20;} else prepar->lfil[0]=20; /* lfil0(ilut, iluk, and arms) */ if(param_int.N()>12){if(param_int[12]>0) prepar->lfil[4]=param_int[12]; else prepar->lfil[4]=20;} else prepar->lfil[4]=20; /* lfil for Schur complement const. */ if(param_int.N()>13){if(param_int[13]>0) prepar->lfil[5]=param_int[13]; else prepar->lfil[13]=20;} else prepar->lfil[5]=20; /* lfil for Schur complement const. */ if(param_int.N()>14){if(param_int[14]>0) prepar->mc=param_int[14]; else prepar->mc=1; } else prepar->mc=1; if(param_int.N()>15){if(param_int[15]>0) ipar->in_iters=param_int[15]; else ipar->in_iters=0; } else ipar->in_iters=0; if(param_int.N()>16){if(param_int[16]>0) VERBOSE=param_int[16]; else VERBOSE=0; }else VERBOSE=0; if(param_double.N()>0){if(param_double[0]>0) ipar->pgfpar[1]=param_double[0]; else ipar->pgfpar[1]=1.e-08;} ipar->pgfpar[1]=1.e-08; /* tolerance for outer iteration */ if(param_double.N()>1){if(param_double[1]>0) ipar->pgfpar[0]=param_double[1]; else ipar->pgfpar[0]=0.01;} else ipar->pgfpar[0]=0.01; /* tolerance for inner iteration when used */ if(param_double.N()>2) {if(param_double[2]>0) prepar->tolind = param_double[2]; else prepar->tolind=0.1;} else prepar->tolind=0.1; /* tolerance used for diag dom. filtration alg.*/ if(param_double.N()>3){if(param_double[3]>0) prepar->droptol[0]=param_double[3]; else prepar->droptol[0]=.001;} else prepar->droptol[0]=.001; /* droptol0 (ilut, iluk, and arms) */ if(param_double.N()>4) {if(param_double[4]>0) prepar->droptol[4]=param_double[4]; else prepar->droptol[4]=.001;} else prepar->droptol[4]=.001; /* droptol for Schur complement const. */ if(param_double.N()>5){if(param_double[5]>0) prepar->droptol[5]=param_double[5]; else prepar->droptol[5]=.001;} else prepar->droptol[5]=.001; /* droptol for Schur complement const. */ memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); for (i=1; i<4; i++) { prepar->droptol[i] = prepar->droptol[0]; prepar->lfil[i] = prepar->lfil[0]; } prepar->lfil[6] = prepar->lfil[5]; } public: parm_param(string datafile,DistMatrix dm) { FILE *fp; char buf[BUFLEN], meth_buf[BUFLEN]; int num; PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); parm_param(); char * filename=new char[datafile.length()+1]; strcpy(filename,datafile.c_str()); /* read parameters for preconditioner and iteration from file 'filename' */ /* ---- start modification by MS */ if( (fp = fopen(filename, "r")) == NULL ){ fprintf(stderr, "Cannot open file inputs\n"); PARMS_Final();exit(1); } for (num=0; num< 18; num++) ipar->ipar[num] = 0; num = 1; while(fgets(buf, BUFLEN, fp) != NULL) { switch(num) { case 1: /* solver */ sscanf(buf, "%d", &solver); if((solver!=0)&&(solver!=1)&&(solver!=2)) {printf("%s","WRONG SOLVER INDEX, WE SET DEFAULT ONE \n"); solver=0;} break; case 2: /* preconditionner */ sscanf(buf,"%s",meth_buf); method = assignprecon(meth_buf, dm); if((method<0)||(method>13)) {printf("%s","WRONG INDEX FOR PRECONDITIONER, WE SET DEFAULT ONE \n"); method=2; } break; case 3: /* im (Outer Krylov subs dim) */ sscanf(buf,"%d",&ipar->ipar[5]); break; case 4: /* im (Outer Krylov subs dim) */ sscanf(buf,"%d",&ipar->ipar[6]); break; case 5: /* outer tol */ sscanf(buf,"%lf",&ipar->pgfpar[1]); break; case 6: /* inner tol */ sscanf(buf,"%lf",&ipar->pgfpar[0]); break; case 7: /* unsym */ sscanf(buf, "%d", &unsymm); break; case 8: /* inim (inned Krylov subs dim) */ sscanf(buf, "%d", &ipar->ipar[3]); break; case 9: /* Max. inner iterations */ sscanf(buf,"%d",&ipar->ipar[4]); break; case 10: /* nlev */ sscanf(buf, "%d", &iov); break; case 11: /* scale */ sscanf(buf,"%d",&scale); break; case 12: /* For printing result */ sscanf(buf, "%d", &VERBOSE); break; case 13: /* lfil0 (ilut, iluk, and arms) */ sscanf(buf, "%d", &prepar->lfil[0]); break; case 14: /* lfil 4 (schur construction) */ sscanf(buf, "%d", &prepar->lfil[4]); break; case 15: /* lfil 5 (ILUT for Schur) */ sscanf(buf, "%d", &prepar->lfil[5]); break; case 16: /* bsize */ sscanf(buf,"%d",&ipar->ipar[1]); break; case 17: /* tolerance used for diag dom. filtration alg.*/ sscanf(buf,"%lf",&prepar->tolind); break; case 18: /*droptol (0) -- simliar to lfil0*/ sscanf(buf, "%lf", &prepar->droptol[0]); break; case 19: /*droptol (4) -- simliar to lfil4*/ sscanf(buf, "%lf", &prepar->droptol[4]); break; case 20: /*droptol (5) -- simliar to lfil5*/ sscanf(buf, "%lf", &prepar->droptol[5]); break; case 21: /* multicoloring or not */ sscanf(buf, "%d", &prepar->mc); break; default: break; } num++; } fclose(fp); memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); prepar->droptol[1] = prepar->droptol[2] = prepar->droptol[3] = prepar->droptol[0]; prepar->droptol[6] = prepar->droptol[5]; prepar->lfil[1] = prepar->lfil[2] = prepar->lfil[3] = prepar->lfil[0]; prepar->lfil[6] = prepar->lfil[5]; ipar->in_iters = 0; free(filename); } ~parm_param(){ free(prepar); free(ipar); } }; int assignprecon( char *precon_str, DistMatrix dm) { /*------------------------------------------------------------------ create preconditioner handler * precon -- preconditioning handler * add_ilu0 -- additive schwarz preconditioner with ilu0 as local preconditioner * add_ilut -- additive schwarz preconditioner with ilut as local preconditioner * add_iluk -- additive schwarz preconditioner with iluk as local preconditioner * add_arms -- additive schwarz preconditioner with arms as local preconditioner * lsch_ilu0 -- schur complement preconditioner with ilu0 as local preconditioner * lsch_ilut -- schur complement preconditioner with ilut as local preconditioner * lsch_iluk -- schur complement preconditioner with iluk as local preconditioner * lsch_arms -- schur complement preconditioner with arms as local preconditioner * sch_gilu0 -- parallel ilu0 preconditioner * sch_sgs -- Schur-Symmetric GS preconditioner *------------------------------------------------------------------*/ /* set the method label for preconditioning and parameter for inner iteration -- actual labels (int) are defined in SRC/ARMS/data.h */ int ierr, method; ierr = 0; method=0; if(!strcmp(precon_str, "add_ilu0")) method = add_ilu0; else if(!strcmp(precon_str, "add_ilut")) method = add_ilut; else if(!strcmp(precon_str, "add_iluk")) method = add_iluk; else if(!strcmp(precon_str, "add_arms")) method = add_arms; else if(!strcmp(precon_str, "lsch_ilu0")) method = lsch_ilu0; else if(!strcmp(precon_str, "lsch_ilut")) method = lsch_ilut; else if(!strcmp(precon_str, "lsch_iluk")) method = lsch_iluk; else if(!strcmp(precon_str, "lsch_arms")) method = lsch_arms; else if(!strcmp(precon_str, "rsch_ilu0")) method = rsch_ilu0; else if(!strcmp(precon_str, "rsch_ilut")) method = rsch_ilut; else if(!strcmp(precon_str, "rsch_iluk")) method = rsch_iluk; else if(!strcmp(precon_str, "rsch_arms")) method = rsch_arms; else if(!strcmp(precon_str, "sch_sgs")) method = sch_sgs; else if(!strcmp(precon_str, "sch_gilu0")) method = sch_gilu0; else ierr = 1; char pcrM[40]; strcpy(pcrM,"invalid choice for the preconditioner \n"); if (ErrHand(ierr, dm, pcrM)) exit(1) ; return method;cout << "Cette resolution semble prendre du temps" << endl; } #define minint(a, b) ( (a) < (b) ? (a) : (b) ) #define maxint(a, b) ( (a) > (b) ? (a) : (b) ) #define max(a, b) ( (a) > (b) ? (a) : (b) ) #define min(a, b) ( a < b ? (a) : (b) ) #define fabsmin(a, b) ( fabs(a) < fabs(b) ? (a) : (b) ) #define fabsmax(a, b) ( fabs(a) > fabs(b) ? (a) : (b) ) class dSolvePARMS : public MatriceMorse::VirtualSolver { char mat_domain[BUFLEN]; int *riord; mutable int n, nnz, nloc; int iov, scale, unsymm, method,solver,VERBOSE; string data_option; int rk, size; mutable double *rhs1, res; //double t1, t2, t3, t4; double *u, *v; int job,i1,i2; mutable DistMatrix dm; //distributed matrix object mutable PrePar prepar; mutable PreCon precon; //structure for preconditioner mutable IterPar ipar; //structure for iteration mutable int * maptmp1, *mapptr1; double eps, tol_pivot_sym,tgv, tol_pivot,epsr; mutable double t1,t2,t3,t4; mutable char * meth[14]; mutable int *maptmp, *mapptr,*iwork1,*iwork; mutable double *scaletmpr, *scaletmpc; mutable MPI_Comm comm; char *p; //Constructor construct the distribute matrix and also preconditionner public: dSolvePARMS(const MatriceMorse &AA,string datafile, KN ¶m_int, KN ¶m_double, MPI_Comm * mpicommw) { int n,i,job,nnz,ierr,tmp; int *ptr2,*id_rows2; double *vals2; double *AAv; int *p, *pr; int j, node; /* Initialize PARMSARSLIB environment */ if(mpicommw==NULL){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; // comm=MPI_COMM_WORLD; ierr = MPI_Comm_rank(comm, &rk); ierr = MPI_Comm_size(comm, &size); parm_param * pp; /*Differents preconditionners use*/ meth[0]=(char *)malloc(sizeof(char)*9); strcpy(meth[0],"add_ilu0"); meth[1]=(char *)malloc(sizeof(char)*9); strcpy(meth[1],"add_ilut"); meth[2]=(char *)malloc(sizeof(char)*9); strcpy(meth[2],"add_iluk"); meth[3]=(char *)malloc(sizeof(char)*9); strcpy(meth[3],"add_arms"); // FFCS - fixed "buffer overflow" warning by JHunt meth[4]=(char *)malloc(sizeof(char)*10); strcpy(meth[4],"lsch_ilu0"); meth[5]=(char *)malloc(sizeof(char)*10); strcpy(meth[5],"lsch_ilut"); meth[6]=(char *)malloc(sizeof(char)*10); strcpy(meth[6],"lsch_iluk"); meth[7]=(char *)malloc(sizeof(char)*10); strcpy(meth[7],"lsch_arms"); meth[8]=(char *)malloc(sizeof(char)*10); strcpy(meth[8],"rsch_ilu0"); meth[9]=(char *)malloc(sizeof(char)*10); strcpy(meth[9],"rsch_ilut"); meth[10]=(char *)malloc(sizeof(char)*10); strcpy(meth[10],"rsch_iluk"); meth[11]=(char *)malloc(sizeof(char)*10); strcpy(meth[11],"rsch_arms"); meth[12]=(char *)malloc(sizeof(char)*10); strcpy(meth[12],"sch_gilu0"); meth[13]=(char *)malloc(sizeof(char)*8); strcpy(meth[13],"sch_sgs"); /*storage format of the matrix*/ char pcrM[4]; strcpy(pcrM,"csr"); /*- Create Distributed Matrix dm in CSR format */ CreateMat(&dm, pcrM); dm->comm->mpi_comm=comm;dm->comm->myproc=rk; dm->comm->npro=size; /*------ Create PrePar /iterPar pointer */ /*---- parameters for preconditioning and iteration*/ if((datafile.empty())&&(param_double==NULL)&&(param_int==NULL)){ if(dm->comm->myproc==0) printf("%s","We are going to set default parameters because user did not specify any one \n \n "); parm_param * pp= new parm_param(); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method= assignprecon(meth[pp->method], dm); prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if(((param_double!=NULL)||(param_int!=NULL))&&(datafile.empty())) { if(dm->comm->myproc==0) printf("%s","User have set parameter inside vector of parameter \n"); parm_param * pp= new parm_param(param_int, param_double); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method= assignprecon(meth[pp->method], dm); prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if((!datafile.empty())&&((param_double==NULL)&&(param_int==NULL))) { if(dm->comm->myproc==0) printf("%s","User have set parameter inside file of parameter \n"); parm_param * pp= new parm_param(datafile, dm); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method=pp->method; prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if(((solver==1)||(solver==2))&&((method!=0)||(method!=4))) { if(dm->comm->myproc==0) printf("%s%s%s", "WE NOT GARANTI THE PRECONDITIONNER WILL WORK BECAUSE ACCELARATOR ", meth[method] ," NO NEED INNER ITERATION \n"); //MPI_Finalize(); } if((dm->comm->myproc==0)&&(VERBOSE>=0)){ printf("###########################################\n"); printf("######### CALLING PARMS PACKAGE ###########\n"); if(solver==0) printf("########### SOLVER : FGMRES #######\n"); if(solver==1) printf("########### SOLVER : BiCGStab #######\n"); if(solver==2) printf("########### SOLVER : DGMRES #######\n"); printf("%s%s%s","########### PRECONDITIONNER : ", meth[method], "\n" ); printf("###########################################\n"); } /*----from zero-based to 1-based before calling pARMS routine----*/ n=AA.n; nnz=AA.nbcoef; PARMS_malloc(pr,n+1,int) ; PARMS_malloc(p,nnz,int) ; PARMS_malloc(AAv,nnz,double) ; for(i=0;i1){ METIS_PartGraphVKway(&n, pr, p, NULL, NULL, &wgtflag, &numflag,&size, option, &volume, riord); } else if(size==1){ for (i=0; ipgfpar[0] == 0.0){ if (rk == 0) fprintf(stderr, "Error: Tolerance for inner solver\n"); ierr = 1; } if (ipar->ipar[3] == 0){ if (rk == 0) fprintf(stderr, "Error: Krylov subspace size for inner solver\n"); ierr = 1; } if (ipar->ipar[4] == 0){ if (rk == 0) fprintf(stderr, "Error: Maximum number of inner iterations\n"); ierr = 1; } if (ierr == 1){ if (rk == 0) fprintf(stderr,"should be nonzero to invoke the Schur Complement iteration\n "); PARMS_Final(); exit(1); } } /*----- create preconditioner */ if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t1 = dwalltime();} ierr = CreatePrec(dm,&precon,method,prepar,ipar); if(VERBOSE==3) { MPI_Barrier(dm->comm->mpi_comm); t2 = dwalltime(); t2 = fabs(t2-t1); double tmax=0.0; MPI_Reduce(&t2, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0,dm->comm->mpi_comm); MPI_Bcast(&tmax, 1, MPI_INT,0,dm->comm->mpi_comm); t2=tmax; } /*----- check for errors in preconditioning construction, quit if any */ if (ierr != 0) fprintf(stderr, "Fatal Error (ierr = %d) in preconditioner construction on processor %d\nExiting...\n", ierr, rk); ierr = ierr*ierr; int tmp_ierr=0; MPI_Allreduce(&ierr, &tmp_ierr, 1, MPI_INT, MPI_SUM, dm->comm->mpi_comm); if ( tmp_ierr > 0 ){ /* delete distributed local matrix */ DeleteMat(&dm); /* delete distributed local vector */ free(prepar); free(ipar); free(pp); /* exit PARMS and MPI environment */ PARMS_Final(); exit(1); } } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { /* Vec structure rhs -- right hand side, sol -- solution, xsol -- exact solution */ Vec sol, rhs; int i,comt,node; int * poloc; double res1; double dnnz_pre, dgprec_nnz; nnz=AA.nbcoef; CreateVec(&rhs); CreateVec(&sol); n=AA.n; double * rhsb=(double *)malloc(sizeof(double)*n); for(i=0;ivec, nloc, double); PARMS_malloc(poloc, nloc, int); comt=0; if(scale) { for(i = 0; i < n; i++) rhsb[i] *= scaletmpr[i]; } for(i=i1;i<=i2;i++) { node = maptmp1[i-1];poloc[comt]=node-1; rhs->vec[comt]=rhsb[node-1];comt++; } /*----Iteration count-------------------------------------*/ ipar->in_iters=0; ipar->iters=0; /*--- Permute RHS according to result of setup routine ---*/ setuprhs(rhs); /*------- populate the initial guess with values */ VecSetVal(sol,0.0); /*------- calculate the norm of the residual on input */ res1 = ResiNorm2(dm, sol, rhs); if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t3 = dwalltime(); } double dgnnz; if(VERBOSE==3){ dnnz_pre = precon->nnz_pre; dgnnz = (double)nnz; dgprec_nnz=0; MPI_Reduce(&dgprec_nnz, &dnnz_pre, 1, MPI_DOUBLE, MPI_SUM, 0, dm->comm->mpi_comm); } if(rk == 0) { printf("Total NNZ(PreCon) / (NNZ*npro) = %6.2f\n",dgprec_nnz/dgnnz); } if(solver==0) fgmresd(dm,precon,ipar,rhs,sol); if(solver==1) dgmresd(dm,precon,ipar,rhs,sol); if(solver==2) bcgstabd(dm,precon,ipar,rhs,sol); res = ResiNorm2(dm, sol, rhs); if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t4 = dwalltime(); t4 = fabs(t4-t3); double tmax=0; MPI_Reduce(&t4, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0,dm->comm->mpi_comm); MPI_Bcast(&tmax, 1, MPI_DOUBLE,0,dm->comm->mpi_comm); t4=tmax; } /*----find the norm of the solution error */ i=1; t3 = -1.0; int j; for (i=0; inode[i]-1; /* get the global node corresponding to node i*/ poloc[i]=j; } if (scale){ /*--------- apply permutations to scaletmp */ for (i=0; inode[i]-1; /* get the global node corresponding to node i*/ sol->vec[i] = sol->vec[i]*scaletmpc[j]; /*---- find the residual of the computed solution */ } } /*----- compute the relative error of computed solution */ if((dm->comm->myproc == 0)&&(VERBOSE==3)) { fprintf(stdout,"################ SOLVER STATISTICS ####################\n"); fprintf(stdout, "OUTER ITERATIONS COUNT IS %d\n", ipar->iters); fprintf(stdout, "INNER ITERATION COUNT IS %d\n", ipar->in_iters); fprintf(stdout, "THE TOTAL TIME IS %16.8f\n", t2+t4); fprintf(stdout, "THE TIME FOR CREATING PRECONDITIONER IS %16.8f\n", t2); fprintf(stdout, "THE TIME FOR SOLVING PROCESS is %16.8f\n", t4); fprintf(stdout, "The 2-NORM OF THE RELATIVE RESIDUAL IS %16.8g\n", res/res1); } if((dm->comm->myproc == 0)&&(VERBOSE==2)) { fprintf(stdout, "THE TOTAL TIME IS %16.8f\n", t2+t4); fprintf(stdout, "THE TIME FOR CREATING PRECONDITIONER IS %16.8f\n", t2); fprintf(stdout, "THE TIME FOR SOLVING PROCESS is %16.8f\n", t4); } if((dm->comm->myproc == 0)&&(VERBOSE==1)) { fprintf(stdout, "OUTER ITERATIONS COUNT IS %d\n", ipar->iters); fprintf(stdout, "INNER ITERATION COUNT IS %d\n", ipar->in_iters); fprintf(stdout, "The 2-NORM OF THE RELATIVE RESIDUAL IS %16.8g\n", res/res1); } double * xx= (double *)malloc(sizeof(double)*n); comt=0; for(i=0;icomm->npro;i++) mapptr[i]--; int *displs, *perm; PARMS_malloc(displs, nloc, int);PARMS_malloc(perm, n, int); MPI_Gatherv(&(sol->vec[0]), nloc, MPI_DOUBLE, &(xx[0]), iwork, mapptr , MPI_DOUBLE, 0,comm ); MPI_Gatherv(&(poloc[0]), nloc, MPI_INT, &(perm[0]), iwork, mapptr , MPI_INT, 0,comm ); MPI_Bcast(perm,AA.n,MPI_INT,0, comm); int *invp=(int *)malloc(sizeof(int)*n); for(i=0;icomm->myproc==0){for(i=0;icomm->npro;i++) mapptr[i]++; /*Delete use vectors*/ DeleteVec(&sol); DeleteVec(&rhs); free(xx); //This should be in Destructor free(perm); free(invp); } ~dSolvePARMS() { if(VERBOSE==3){ cout << "~SolvePARMS:" << endl; free(mapptr); DeletePrec(precon); free(scaletmpc); free(scaletmpr); /*---- Delete distributed local matrix */ DeleteMat(&dm); /*---- Delete distributed local vector */ free(prepar); free(ipar); /*Delete matrix and right hand side*/ } //PARMS_Final(); } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; inline MatriceMorse::VirtualSolver * BuilddSolvePARMS(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverMUMPSmpi" << endl; return new dSolvePARMS(*A,ds.data_filename, ds.lparams, ds.dparams,(MPI_Comm *)ds.commworld); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return TRUE; } bool SetdSolvePARMS() { if(verbosity>1) cout << " SetDefault sparse solver to PARMS" << endl; DefSparseSolver::solver =BuilddSolvePARMS; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return TRUE; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pARMSmpi, defaultsolver defaultsolverpARMSmpi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuilddSolvePARMS; //DefSparseSolver::solver =BuildSolverMUMPSmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttopARMSmpi","(",new OneOperator0(SetdSolvePARMS)); } freefem++-3.61-1/src/solver/README_COMPILE000644 000767 000024 00000025161 13256636774 017761 0ustar00hechtstaff000000 000000 ############################################# # README_COMPILE: # # HELP TO COMPILE THE DIFFERENT SPARSE SOLVER # ############################################# General pre-requirements : - C, C++ and Fortran (f77, f90) compilers - MPI library - BLAS library These different elements are defined in the configure step of the compilation FreeFem++. Therefore, it must be same for the following solver. For computation, it is important to have an optimized BLAS. Among optimized BLAS can be cited ATLAS (Automatically Tuned Linear Algebra Software) http://math-atlas.sourceforge.net/ (BSD licence), GotoBLAS http://www.tacc.utexas.edu/resources/software/ (UT TACC Research license). These library can be used free under their license limitation. For GotoBLAS, the software and documentation can be used without any charge for academic, research, experimental or personal use. For commercial use, it is required to purchase a license. For more details, please see the UT TACC Research license http://svn.pardus.org.tr/uludag/trunk/pisi/licenses/tacc. Remark: In Mac OSX, a problem occur in calling the Blas function CDOTC, CDOTU, ZDOTC, ZDOTU with veclib in Fortran (see http://developper.apple.com/hardwaredrivers/ve/errata.html). A patch for the library veclib is given in the directory PATCHVECLIB. A) Sparse Direct Solver We have interfaced freefem++ with the following parallel sparse direct solver: SuperLU_DIST, MUMPS and pastix. These solver used different ordering library: Metis, ParMetis and scotch and pt-scotch. 1. SuperLU_DIST The interface of SuperLU_DIST with freefem++ was tested with the version 3.2 of SuperLU_DIST. This solver use the external ordering libraries: Metis and ParMetis. To used these ordering or parallel symbolic factorization (which depend on ParMetis) in SuperLU_DIST, we need to install them. In the section ordering library, a description of installation of Metis and ParMetis is given. pre-requirement: - Metis and ParMetis ordering libraries installation procedure: - install Metis and ParMetis (see section ordering library for more details) - donwload the SuperLU_DIST 3.2 package on the web site http://crd.lbl.gov/~xiaoye/SuperLU - untar and decompress the tar.gz file tar xvfz superlu_dist_2.3.tar.gz - go to the directory SuperLU_DIST_3.2 - edit the make.inc to yours system (see the README file in this directory for more details) - compilation can be done by simply typing "make" on this directory. compilation of freefem++ load file of SuperLU_DIST (interface): - go to the directory /src/solver/ on the tree of the source code of Freefem++ - edit the makefile-sparsesolver.inc - type in this directory "make rslu_dist"(resp."make cslu_dist") to obtain dynamic library of the interface for real (resp. complex) arithmetic. References on SuperLU_DIST: [1] SuperLU_DIST: A Scalable Distributed-Memory Sparse Direct Solver for Unsymmetric Linear Systems. Xiaoye S. Li and James W. Demmel. ACM Trans. on Math. Software, Vol. 29, No. 2, pp.110-140, 2003. [2] Parallel Symbolic Factorization for Sparse LU with Static Pivoting. L. Grigori, J. Demmel and X.S. Li. SIAM J. Sci. Comp, Vol. 29, Issue 3, pp 1289--1314, 2007. 2. MUMPS MUMPS is a package writing in fortran 90. So we need a fortran compiler. The interface of MUMPS with freefem++ was tested with the version 4.8.3 and 4.8.4 of MUMPS. This solver use the external libraries: BLAS, BLACS, LAPACK, ScaLAPACK, Metis, ParMetis and Scotch. BLAS and LAPACK are installed in most of system now. Therefore, we only describe BLACS and ScaLAPACK installations. BLAS, BLACS and LAPACK are libraries need by ScaLAPACK. Hence, we need to compile BLACS before. A ScaLAPACK installer allow to download, compile and install automatically all the following librairies BLAS, LAPACK, BLACS and ScaLAPACK. This installer is based on Python and it can download at http://www.netlib.org/scalapack/. Here, we describe only the installation procedure by hand of BLACS and ScaLAPACK. Pre-requirement: - Fortran 90 compiler - BLACS (http://www.netlib.org/blacs/) - LAPACK (http://www.netlib.org/lapack/) - SCALAPACK (http://www.netlib.org/scalapack/) - Metis and Scotch ordering (optional). It is recommended by the MUMPS team to have full possibility to ordering automatically. Installation procedure for BLACS and ScaLAPACK: a) installation of BLACS - download on the website http://www.netlib.org/blacs/ : mpiblacs.tgz, mpiblacs-patch03.tgz and blacstester.tgz - decompress all these file tar -xvzf mpiblacs.tgz tar -xvzf mpiblacs-patch03.tgz tar -xvzf blacstester.tgz - go to the directory BLACS. - edit the Bmake.inc for yours system (some example of Bmake.inc is given in the directory BMAKES). Please refer to blacs_install.ps on the web site of BLACS for more information about this file. - the installation can be done by typing "make mpi" in this directory. b) installation of ScaLAPACK - download the file "scalapack.tgz" on the website http://www.netlib.org/scalapack/. - decompress this file tar -xvzf scalapack.tgz - go to the directory's created scalapack-1.8.0 - edit the SLmake.inc for your system (some example of SLmake.inc is given in the directory INSTALL). Please refer to scalapack_install.ps on the web site of ScaLAPACK for more information about this file. - the installation can be done by typing "make" in this directory. Installation procedure for MUMPS: - install BLACS, SCALAPACK, Metis ordering(optional) and Scotch ordering (optional). Please see section ordering library for Metis and Scotch. - go to website http://mumps.enseeiht.fr/ to fill the download request submission. - decompress the tar.gz file. tar -xvfz MUMPS_4.8.4.tar.gz - go to the directory MUMPS_4.8.4. - edit the Makefile.inc to yours system (see README file in this directory and example of Makefile.inc in the directory Make.inc). - compilation can be done by simply "make" in this directory. Compilation of freefem++ load file of MUMPS(interface) - go to the directory /src/solver/ on the tree of the source code of Freefem++. - edit the makefile-sparsesolver.inc. - type in this directory "make mumps" to obtain dynamic library of the interface. References on MUMPS: [1] P. R. Amestoy, I. S. Duff and J.-Y. L'Excellent. Multifrontal parallel ditributed symmetric and unsymmetric solvers, in Comput. Methods in Appl. Mech. Eng., 184, pp 501-520, 2000. [2] P. R. Amestoy, I. S. Duff, J. Koster and J.-Y. L'Excellent. A fully asynchronous multifrontal solver using distributed dynamic scheduling, SIAM J. Math. Anal. and Appl., Vol. 23(1), pp 15-41, 2001. [3] P. R. Amestoy, A. Guermouche, J.-Y.L'Excellent and S. Pralet. Hybrid scheduling for the parallel solution of linear systems. Parallel Computing, Vol. 32(2), pp 136-156, 2006. 3. Pastix The interface of pastix with freefem++ was tested with the package pastix_release_2200.tar.bz2. The distributed matrix version of pastix is under developpement and some bug are not fixed in this release. The interface with distributed matrix version of pastix in Freefem++ is not given yet for this reason. Pre-requirement : - Fortran 90 compiler - Scotch or Metis ordering Procedure installation: - install Scotch or Metis ordering - download on the website http://gforge.inria.fr/frs/?group_id=248 the pastix package. - decompress the package pastix_releas_***. - go to the pastix directory's created. For package pastix_release_2200.tar.bz2, this directory is pastix_release_2200. - go to the directory src. Installation instruction are given in the file INSTALL.txt. - select the config file corresponding to your machine (these files are located in the directory config) and copy this file in the main src directory of pastix. For Mac, just type cp config/Mac.in config.in (if there is not a config file corresponding copy one of them). - adapt the config.in to yours system. For freefem++ interface, the double precision support must be selected. - compile the Pastix library make expor - install the Pastix library make install The header file and Pastix library are located in the directory pastix_release_2200/install for the package pastix_release_2200.tar.bz2. We have constructed interface for real and complex support. The header file and Pastix library are compile for one of these arithmetics (see the file config.in). A simple method to obtain these two arithmetics is to compile and install pastix in two different directory. Compilation of freefem++ load file of pastix(interface) - go to the directory src/solver/ on the tree of the source code of Freefem++. - edit the makefile makefile-sparsesolver.inc. - type in this directory make rpastix (real dynamic library) make cpastix (complex dynamic library) References on Pastix: [1] P. Hnon, P.Ramet and J. Roman. PaStiX: A High-Performance Parallel Direct Solver for Sparse Symmetric Definite Systems. Parallel Computing, Vol. 28(2), pp. 301-321, 2002. B) Sparse Iterative Solver under construction C) Ordering 1. Metis and ParMetis The Metis Library is include in ParMetis package. Hence, we only need to build ParMetis. To install ParMetis, download on the web site http://glaros.dtc.umn.edu/gkhome/metis/parmetis/download the file ParMetis-3.1.1. After this, read installation instuction on this web page to obtain ParMetis's library. References on Metis and ParMetis: [1] G. Karypis and V. Kumar. A fast and Highly Quality Multilevel Scheme for Partitioning Irregular Graphs. SIAM J. Sci. Comp., Vol. 20(1), pp. 359 - 392, 1999. [2] G. Karypis and V. Kumar. A Parallel Algorithm for Multilevel Graph Partitioning and Sparse Matrix Ordering. Journal of Parallel and Distributed Computing. Vol. 48, pp. 71-85, 1998. 2. Scotch and Pt-Scotch Scotch and Pt-Scotch are include in the same package. This file can be download on http://www.labri.fr/perso/pelegrin/scotch/. We must take the version of Scotch with interface for mumps. This file is named scotch_*.*.*_esmumps.tar.gz where *.*.* is the number of version of scotch. After decompress this file tar -xvfz scotch_*.*.*_esmumps.tar.gz. Go to the new directory named scotch_*.*_esmumps. Go to the src directory and edit makefile.inc to your system. The instruction for fill this file is given in scotch_*.*_esmumps/INSTALL.txt. To compile these libraries, just type "make" and "make ptscotch". References on Scotch and Pt-Scotch: [1] C. Chevalier and F. Pellegrini, PT-SCOTCH: a tool for efficient parallel graph ordering. Parallel Computing, 34(6-8), pp. 318-331, 2008. [2] F. Pellegrini and J. Roman, SCOTCH: a software package for static mapping by dual recursive bipartitioning of process and architecture graphs. In: Proc. HPCN'96, Brussels. LNCS, Vol 1067, pp 493-498, 1996. freefem++-3.61-1/src/solver/wrapper_dotblas.f000644 000767 000024 00000002423 13256636774 021264 0ustar00hechtstaff000000 000000 c a compile sans underscore -fno-underscoring c gfortran -fno-underscoring -O3 -c wrapper_dotblas.f c ------- double complex function zdotc_(n, zx, incx, zy, incy) double complex zx(*), zy(*), z integer n, incx, incy call cblas_zdotc_sub(%val(n), zx, %val(incx), zy, %val(incy), z) c print*,'cblas_zdotc_sub' zdotc_ = z return end double complex function zdotu_(n, zx, incx, zy, incy) double complex zx(*), zy(*), z integer n, incx, incy call cblas_zdotu_sub(%val(n), zx, %val(incx), zy, %val(incy), z) c print*,'cblas_zdotu_sub' zdotu_ = z return end complex function cdotc_(n, cx, incx, cy, incy) complex cx(*), cy(*), c integer n, incx, incy call cblas_cdotc_sub(%val(n), cx, %val(incx), cy, %val(incy), c) c print*,'cblas_cdotc_sub' cdotc_ = c return end complex function cdotu_(n, cx, incx, cy, incy) complex cx(*), cy(*), c integer n, incx, incy call cblas_cdotu_sub(%val(n), cx, %val(incx), cy, %val(incy), c) c print*,'cblas_cdotu_sub' cdotu_ = c return end freefem++-3.61-1/src/solver/hips_FreeFem.cpp000755 000767 000024 00000046025 13256636774 020776 0ustar00hechtstaff000000 000000 // ORIG-DATE: 04/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : INRIA FUTUR // AUTHOR : Guy Atenekeng // E-MAIL : Guy_Antoine_Atenekeng_Kahou@lri.fr // //ff-c++-LIBRARY-dep: metis hips blas //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 */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" #include "MatriceCreuse_tpl.hpp" #include "mpi.h" extern "C" { #include "hips.h" // #include "io.h" #include "metis.h" } #include #include #include #define BUFLEN 200 #define MCW MPI_COMM_WORLD //roscal(&n,&job,&tmp,AAv,p,pr,scaletmpr,AAv,p,pr,&ierr); int roscal(int n, int job,int nrm, double *AAv, int *p, int *pr, double * scaletmpr , int *ierr) { /*--------------------------------------------------------------------- | | This routine scales each row of mata so that the norm is 1. | |---------------------------------------------------------------------- | on entry: | mata = the matrix (in SparRow form) | nrm = type of norm | 0 (\infty), 1 or 2 | | on return | diag = diag[j] = 1/norm(row[j]) | | 0 --> normal return | j --> row j is a zero row |--------------------------------------------------------------------*/ /* local variables */ int i, k; double scal; for (i=0; i scal) scal = fabs(AAv[k]); } else if (nrm == 1) { for (k=pr[i]; k normal return | j --> column j is a zero column |--------------------------------------------------------------------*/ /* local variables */ int i, j, k; double *kr; int *ki; for (i=0; i scaletmpc[p[k]]) scaletmpc[p[k]] = fabs(AAv[k]); } } else if (nrm == 1) { for (k=pr[i]; k param_int,KN param_double) { char buf[BUFLEN]; int num,in_val; double val; FILE *fp; char * filename=new char[datafile.length()+1]; strcpy(filename,datafile.c_str()); int i; for(i=0;i<16;i++) param_int[i]=-1; for(i=0;i<9;i++) param_double[i]=-1.0; /* read parameters for preconditioner and iteration from file 'filename' */ /* ---- start modification by MS */ if( (fp = fopen(filename, "r")) == NULL ){ fprintf(stderr, "Cannot open file inputs\n"); exit(1); } num = 0; while(fgets(buf, BUFLEN, fp) != NULL) { if(num<=15) {sscanf(buf, "%d", &in_val); param_int[num]=in_val;} else {sscanf(buf, "%lf", &val); param_double[num]=val;} num++; } fclose(fp); } class HipsSolver : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 string data_option; MPI_Comm comm; mutable INTS id, idnbr, i, j; mutable INTS *unknownlist; mutable double *x; mutable INTS ln; mutable INTS ierr; mutable INTS n,nnz; mutable double * a; mutable INTS *ia, *ja; mutable int *pp; int loc_size,pbegin, pend; INTS domsize, nproc,proc_id; mutable int sym_pattern, sym_matrix; KN param_int; KN param_double; mutable double *scaletmpr, *scaletmpc; mutable int *mapptr,*maptmp,*iwork,*riord,*iwork1,scale; mutable int *pr, *p; mutable double * AAv; public: HipsSolver(const MatriceMorse &AA,string datafile, const KN ¶m_int1, const KN ¶m_double1, MPI_Comm * mpicommw ) : data_option(datafile) { int argc,sym,symm; argc=1; param_int=param_int1; param_double=param_double1; if(mpicommw==0){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; MPI_Comm_rank(comm, &proc_id); MPI_Comm_size(comm, &nproc); id = 0; /** id of the linear system **/ /***************************************/ /* Initialize HIPS for one problem */ /***************************************/ idnbr = 1; /* total */ ierr = HIPS_Initialize(idnbr); HIPS_ExitOnError(ierr); id = 0; /** id of the linear system **/ int ic; if((!data_option.empty())&&((param_int==NULL)||(param_double==NULL))) parm_param(datafile,param_int,param_double); else{ if((param_double.N()>0)||(param_int.N()>0)){ if(proc_id==0) cout << " WE SET PARAMETER FROM VECTORS " << endl;} else if(proc_id==0) cout << " WE SET DEFAULT PARAMETERS " << endl; } if(param_int.N()>0) { if((param_int[0]==HIPS_ITERATIVE)||(param_int[0]==HIPS_HYBRID)) // Using strategy. Input is ok { HIPS_SetDefaultOptions(id,param_int[0]); ic=param_int[0];} else { HIPS_SetDefaultOptions(id,HIPS_ITERATIVE );ic=HIPS_ITERATIVE; } // Strategy is not they existing one }else {HIPS_SetDefaultOptions(id,HIPS_ITERATIVE);ic=HIPS_ITERATIVE;} //Default strategy is ITERATIVE if(param_double.N()>0) {if(param_double[0]>0) HIPS_SetOptionREAL(id,HIPS_PREC,param_double[0]); else HIPS_SetOptionREAL(id,HIPS_PREC,1e-09);} else HIPS_SetOptionREAL(id,HIPS_PREC,1e-09); if((param_int.N()>1)&&(ic==HIPS_ITERATIVE)) {if((param_int[1]==1)||(param_int[1]==0)) HIPS_SetOptionINT(id,HIPS_KRYLOV_METHOD,param_int[1]); else HIPS_SetOptionINT(id,HIPS_KRYLOV_METHOD,0);}else {if(ic==HIPS_ITERATIVE) HIPS_SetOptionINT(id,HIPS_KRYLOV_METHOD,0);} if(param_int.N()>2) { if(param_int[2]>0) HIPS_SetOptionINT(id,HIPS_ITMAX,param_int[2]); else HIPS_SetOptionINT(id,HIPS_ITMAX,1000);} else HIPS_SetOptionINT(id,HIPS_ITMAX,1000); if(param_int.N()>3) { if(param_int[3]>0) HIPS_SetOptionINT(id,HIPS_KRYLOV_RESTART,param_int[3]); else HIPS_SetOptionINT(id,HIPS_KRYLOV_RESTART,40);} else HIPS_SetOptionINT(id,HIPS_KRYLOV_RESTART,40); if(param_int.N()>4) {if(param_int[4]>0) {HIPS_SetOptionINT(id,HIPS_SYMMETRIC,param_int[4]); symm=param_int[4];}} else {HIPS_SetOptionINT(id,HIPS_SYMMETRIC,1);symm=1;} if(param_int.N()>5) {if((param_int[5]==0)||(param_int[5]==1)) {HIPS_SetOptionINT(id,HIPS_GRAPH_SYM,param_int[5]);sym=param_int[5];} else {HIPS_SetOptionINT(id,HIPS_GRAPH_SYM,1);sym=1;}} else {HIPS_SetOptionINT(id,HIPS_GRAPH_SYM,1);sym=1;} if(param_int.N()>6) { if(param_int[6]>0) HIPS_SetOptionINT(id,HIPS_PARTITION_TYPE,param_int[6]); else HIPS_SetOptionINT(id,HIPS_PARTITION_TYPE,0);}else HIPS_SetOptionINT(id,HIPS_PARTITION_TYPE,0); if(param_int.N()>7) {if(param_int[7]>0) HIPS_SetOptionINT(id,HIPS_LOCALLY,param_int[7]); else HIPS_SetOptionINT(id,HIPS_LOCALLY,2);}else HIPS_SetOptionINT(id,HIPS_LOCALLY,2); if(param_int.N()>8) {if(param_int[8]>0) HIPS_SetOptionINT(id,HIPS_FORTRAN_NUMBERING,param_int[8]); else HIPS_SetOptionINT(id,HIPS_FORTRAN_NUMBERING,0);} else HIPS_SetOptionINT(id,HIPS_FORTRAN_NUMBERING,0); if(param_int.N()>9) {if(param_int[9]>0) HIPS_SetOptionINT(id,HIPS_SCALE,param_int[9]); else { HIPS_SetOptionINT(id,HIPS_SCALE,1); scale=1;}} else {HIPS_SetOptionINT(id,HIPS_SCALE,1); scale=1;} if(param_int.N()>10) {if(param_int[10]>0) HIPS_SetOptionINT(id,HIPS_REORDER,param_int[10]); else HIPS_SetOptionINT(id,HIPS_REORDER,1);} else HIPS_SetOptionINT(id,HIPS_REORDER,1); if(param_int.N()>11) {if(param_int[11]>0) HIPS_SetOptionINT(id,HIPS_DOF,param_int[11]); else HIPS_SetOptionINT(id,HIPS_DOF,1);} else HIPS_SetOptionINT(id,HIPS_DOF,1); if(param_int.N()>12) {if(param_int[12]>0) HIPS_SetOptionINT(id,HIPS_SCALENBR,param_int[12]); else HIPS_SetOptionINT(id,HIPS_SCALENBR,2);} else HIPS_SetOptionINT(id,HIPS_SCALENBR,2); if(param_int.N()>13) {if(param_int[13]>0) HIPS_SetOptionINT(id,HIPS_VERBOSE,param_int[13]); else HIPS_SetOptionINT(id,HIPS_VERBOSE,5);} else HIPS_SetOptionINT(id,HIPS_VERBOSE,5); if(param_int.N()>14) {if(param_int[14]>0) HIPS_SetOptionINT(id,HIPS_DOMSIZE,param_int[14]); else HIPS_SetOptionINT(id,HIPS_DOMSIZE,2);} else HIPS_SetOptionINT(id,HIPS_DOMSIZE,2); // if(param_int.N()>15) {if(param_int[15]>0) HIPS_SetOptionINT(id,HIPS_SCHUR_METHOD,param_int[15]); //else HIPS_SetOptionINT(id,HIPS_SCHUR_METHOD,2);} else HIPS_SetOptionINT(id,HIPS_SCHUR_METHOD,2); // if(param_int.N()>16) {if(param_int[16]>0) HIPS_SetOptionINT(id,HIPS_ITMAX_SCHUR,param_int[16]); // else HIPS_SetOptionINT(id,HIPS_ITMAX_SCHUR,2);} else HIPS_SetOptionINT(id,HIPS_ITMAX_SCHUR,2); if(param_double.N()>1){if(param_double[1]>0.0) HIPS_SetOptionREAL(id,HIPS_DROPTOL0,param_double[1]); else HIPS_SetOptionREAL(id,HIPS_DROPTOL0,0.005);} else HIPS_SetOptionREAL(id,HIPS_DROPTOL0,0.005); if(param_double.N()>2) {if(param_double[2]>0.0) HIPS_SetOptionREAL(id,HIPS_DROPTOL1,param_double[2]); else HIPS_SetOptionREAL(id,HIPS_DROPTOL1,0.005);} else HIPS_SetOptionREAL(id,HIPS_DROPTOL1,0.005); if(param_double.N()>3){if(param_double[3]>0.0) HIPS_SetOptionREAL(id,HIPS_DROPTOLE,param_double[3]); else HIPS_SetOptionREAL(id,HIPS_DROPTOLE,0.005);} HIPS_SetOptionREAL(id,HIPS_DROPTOLE,0.005); if(param_double.N()>4){if(param_double[4]>0.0) HIPS_SetOptionREAL(id,HIPS_AMALG,param_double[4]); else HIPS_SetOptionREAL(id,HIPS_AMALG,0.005);} HIPS_SetOptionREAL(id,HIPS_AMALG,0.005); /*if(param_double.N()>5){if(param_double[5]>0.0) HIPS_SetOptionREAL(id,HIPS_DROPTOLSCHUR ,param_double[5]); else HIPS_SetOptionREAL(id,HIPS_DROPTOLSCHUR ,0.005);} HIPS_SetOptionREAL(id,HIPS_DROPTOLSCHUR ,0.005);*/ HIPS_SetCommunicator(id,comm); n=AA.n; nnz=AA.nbcoef; int ierr; pr= new int[n+1]; p= new int[nnz]; AAv=new double[nnz]; for(i=0;i1){ METIS_PartGraphKway(&n, AA.lg, AA.cl, NULL, NULL, &wgtflag, &numflag,&nproc, option, &volume, riord); } else if(nproc==1){ for (i=0; i &AA,KN_ &x,const KN_ &b) const { /***************************************************/ /* */ /* ENTER THE RIGHT-HAND-SIDE */ /* */ /***************************************************/ int i,nloc; nloc=0; int nnsize; MPI_Comm_size(comm,&nnsize); COEF * rhsloc = (COEF *)malloc(sizeof(COEF)*iwork1[proc_id]); COEF * xx = (COEF *)malloc(sizeof(COEF)*iwork1[proc_id]); int * unknownlist = (INTS *)malloc(sizeof(INTS)*iwork1[proc_id]); COEF * xz = (COEF *)malloc(sizeof(COEF)*n); nloc=0; if(scale){ for(i=0;i3) cout << "~Hips_Solver S:" << endl; free(iwork1); free(mapptr); free(iwork); free(maptmp); HIPS_SetOptionINT(id,HIPS_DISABLE_PRECOND,0);HIPS_ExitOnError(ierr); ierr = HIPS_Clean(id); HIPS_ExitOnError(ierr); } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; //BuildSolverIUMFPack(DCL_ARG_SPARSE_SOLVER(double,A)) inline MatriceMorse::VirtualSolver * BuildSolverHipsSolvermpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverSuperLU" << endl; return new HipsSolver(*A,ds.data_filename, ds.lparams, ds.dparams,(MPI_Comm *)ds.commworld); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return 1; } bool SetHipsSolver() { if(verbosity>1) cout << " SetDefault sparse solver to Hips" << endl; DefSparseSolver::solver =BuildSolverHipsSolvermpi; //DefSparseSolver::solver =BuildSolverHipsSolvermpi; TypeSolveMat::defaultvalue =TypeSolveMatdefaultvalue; return 1; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Hips, defaultsolver defaultsolverHips" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverHipsSolvermpi; // DefSparseSolver::solver =BuildSolverHipsSolver; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoHips","(",new OneOperator0(SetHipsSolver)); } freefem++-3.61-1/src/solver/ffsuperludistoption.hpp000644 000767 000024 00000042511 13256636774 022570 0ustar00hechtstaff000000 000000 // read options for superlu in freefem++ int s_(char* str, const char* cmp[]) { int i = 0; while( cmp[i] != 0){ if( strcmp(str, cmp[i]) == 0){ //cout << *str << " return" << i << endl; return i+1 ; } i++; } //cout << *str << " return 0" << endl; return 0; } void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol){ static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; case 15: // matrix printf("parameter matrix \n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("value of parameter matrix is not correct %s \n", tictac ); } break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_options_freefem(string *string_option, superlu_options_t *options, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE, SINGLE, DOUBLE, EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //static const char* compMemType_t[] = {"LUSUP", "UCOL", "LSUB", "USUB",0}; //static const char* compstack_end_t[] = {"HEAD", "TAIL",0}; //static const char* compLU_space_t[] = {"SYSTEM", "USER",0}; static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","DiagScale","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); cout << "data=" << data << endl; char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2=tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; // case 13 nprow // case 14 npcol case 15: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } // void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ // static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", // "DiagPivotThresh","IterRefine","Trans", // "ReplaceTinyPivot","SolveInitialized", // "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; // char data[string_option->size()+1]; // strcpy( data, string_option->c_str()); // char *tictac; // char *tictac2; // tictac = strtok(data," =,\t\n"); // while(tictac != NULL){ // int id_option = s_(tictac, comp); // tictac2 = tictac; // tictac = strtok(NULL," =,\t\n"); // int val_options; // printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); // switch (id_option) // { // case 13: // nprow // *nprow = atoi(tictac); // break; // case 14: // npcol // *npcol = atoi(tictac); // break; // case 15: // matrix // printf("parameter matrix \n"); // if(strcmp(tictac,"assembled") == 0) // *matrixdist = 0; // else if(strcmp(tictac,"distributedglobal") == 0) // *matrixdist = 1; // else if(strcmp(tictac,"distributed") == 0) // *matrixdist = 2; // else{ // printf("value of parameter matrix is not correct %s \n", tictac ); // } // break; // default: // Equivalent of case default // if(id_option == 0) // { // printf("parameter is not valid for superlu_dist %s \n", tictac2 ); // exit(1); // } // break; // } // tictac = strtok(NULL," =,\t\n"); // } // } void read_nprow_npcol_matrixdist_superlu_datafile(string *data_option, int_t *nprow, int_t *npcol, int *matrixdist){ char datafile[data_option->size()+1]; strcpy( datafile, data_option->c_str()); FILE* pfile= fopen( datafile,"rt"); char data[256]; char *tictac; fgets(data,256,pfile); cout << "data=" << data << endl; tictac = strtok(data," /!#\t\n"); *nprow = (int) atol(tictac); if(verbosity) printf("nprow=%d\n",*nprow); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); *npcol = (int) atol(tictac); if(verbosity) printf("npcol=%d\n",*npcol); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("matrix input %s for superlu_dist is not correct\n", tictac ); exit(1); } fclose(pfile); } void read_options_superlu_datafile(string *data_option, superlu_options_t *options, int_t *nprow, int_t *npcol, int *matrixdist, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE, SINGLE, DOUBLE, EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //int_t ffnprow,ffnpcol; //int matrixdist; char datafile[data_option->size()+1]; strcpy( datafile, data_option->c_str()); FILE* pfile= fopen( datafile,"rt"); char data[256]; char *tictac; fgets(data,256,pfile); cout << "data=" << data << endl; tictac = strtok(data," /!#\t\n"); *nprow = (int) atol(tictac); if(verbosity) printf("nprow=%d\n",*nprow); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); *npcol = (int) atol(tictac); if(verbosity) printf("npcol=%d\n",*npcol); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("matrix input %s for superlu_dist is not correct\n", tictac ); exit(1); } int id_option=0; while( !feof(pfile) && id_option<12){ fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); id_option++; int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; case 13: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0 && id_option > 13) { printf("Error in reading data file for superlu_dist %s\n",datafile); exit(1); } break; } } fclose(pfile); } freefem++-3.61-1/src/solver/makefile-common.inc000644 000767 000024 00000003540 13256636774 021464 0ustar00hechtstaff000000 000000 ########################################################## # # common variable for the different parallel sparse solver # ######################################################### # frefem++ variables FREEFEM_DIR = /Volumes/Ike/cazeaux/ff++/ FREEFEM_INCLUDE = -I$(FREEFEM_DIR)examples++-load/include/ # directory of the different package SOFT_DIR = $(FREEFEM_DIR)download/ #========== # BLAS #========== BLAS_INCLUDE = BLAS_LIB = -L$(SOFT_DIR)BLAS/blas_LINUX.a #============ # BLACS : this library is need by MUMPS #============ BLACS_DIR = $(SOFT_DIR)/BLACS/ BLACS_INCLUDE = BLACS_LIB = -L$(BLACS_DIR)LIB/ -lblacsCinit_MPI-BROCHET-0 -lblacs_MPI-BROCHET-0 -lblacsF77init_MPI-BROCHET-0 #============= # SCALAPACK : this library is need by MUMPS #============= SCALAPACK_DIR = $(SOFT_DIR)/scalapack-1.8.0/ SCALAPACK_INCLUDE = -I$(SCALAPACK_DIR)SRC/ SCALAPACK_LIB = -L$(SCALAPACK_DIR) -lscalapack #============================================== # ordering : metis, parmetis, scotch #=============================================== # pord : this ordering is given in the mumps package # and it is only need by MUMPS #PORD_DIR = $(SOFT_DIR)MUMPS_4.8.3/PORD/ #PORD_INCLUDE = -I$(PORD_DIR)include #PORD_LIB = -L$(PORD_DIR)lib/ -lpord # scotch SCOTCH_DIR = $(SOFT_DIR)/scotch_5.1_esmumps/ SCOTCH_INCLUDE = -I$(SCOTCH_DIR)include/ SCOTCH_LIB = -L$(SCOTCH_DIR)lib/ -lesmumps -lscotch -lscotcherr -lscotcherrexit -lm # ptscotch PTSCOTCH_INCLUDE = -I$(SCOTCH_DIR)include/ PTSCOTCH_LIB = -L$(SCOTCH_DIR)lib/ -lptscotch -lptscotcherrexit -lm # metis METIS_DIR = $(SOFT_DIR)metis-4.0/ METIS_INCLUDE = -I$(METIS_DIR)Lib/ METIS_LIB = -L$(METIS_DIR) -lmetis # parmetis PARMETIS_DIR = $(SOFT_DIR)ParMetis-3.1.1/ PARMETIS_INCLUDE = -I$(PARMETIS_DIR) PARMETIS_LIB = -L$(PARMETIS_DIR) -lparmetis -lmetis freefem++-3.61-1/src/solver/MUMPS_FreeFem.cpp000644 000767 000024 00000207446 13256636774 020737 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // //ff-c++-LIBRARY-dep: metis mumps blas //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 */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include "mpi.h" #include "dmumps_c.h" #include "zmumps_c.h" // read options for MUMPS in freefem++ int s_(char* str, const char* cmp[]) { int i = 0; while( cmp[i] != 0){ if( strcmp(str, cmp[i]) == 0){ //cout << *str << " return" << i << endl; return i+1 ; } i++; } //cout << *str << " return 0" << endl; return 0; } void read_options_freefem(string *string_option, int *SYM, int *PAR){ static const char* comp[] = {"SYM", "PAR", 0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); cout << "data=" << data << endl; char * tictac; tictac = strtok(data," =,\t\n"); cout << "tictac=" << data << endl; while(tictac != NULL){ int id_option = s_(tictac, comp); tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 1 : // SYM *SYM = atoi(tictac); // strtol ??? if(*SYM != 0 && *SYM !=1) cout << "SYM must be equal to 1 or 0 for MUMPS" << endl; break; case 2: // PAR *PAR = atoi(tictac); if(*PAR != 0 && *PAR !=1) cout << "PAR must be equal to 1 or 0" << endl; //strtol ??? break; case 0: // Equivalent of case default break; } tictac = strtok(NULL," =,\t\n"); } } class dSolveMUMPSmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 mutable MPI_Comm comm; double *a; int *irn, *jcn; int n, m, nz; // parameter MUMPS KN_ perm_r; /* row permutations from partial pivoting */ KN_ perm_c; KN_ scale_r; KN_ scale_c; string string_option; string data_option; int SYM; int PAR; int myid; // distribuer int nz_loc; int *jcn_loc, *irn_loc; double *a_loc; static const int JOB_INIT=-1; static const int JOB_END=-2; static const int USE_COMM_WORLD= -987654; // variable reel mutable DMUMPS_STRUC_C id; #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ #define CNTL(I) cntl[(I)-1] /* macro s.t. indices match documentation */ #define RINFOG(I) rinfog[(I)-1] /* macro s.t. indices match documentation */ #define INFOG(I) infog[(I)-1] /* macro s.t. indices match documentation */ public: dSolveMUMPSmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string param_string, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN &pperm_c, KN &pscale_r,KN &pscale_c, MPI_Comm * mpicommw ) : eps(epsilon),epsr(0), tgv(ttgv), string_option(param_string), data_option(datafile), perm_r(pperm_r), perm_c(pperm_c), tol_pivot_sym(pivot_sym),tol_pivot(pivot), scale_r(pscale_r), scale_c(pscale_c) { long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); int dataint[40]; double datadouble[15]; int ierr; if(mpicommw==0){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ ierr = MPI_Comm_rank(comm, &myid); if( myid ==0){ n = AA.n; m = AA.m; nz = AA.nbcoef; MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } else{ MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } if( !(param_int==NULL) ) assert( param_int.N() == 42); if( !(param_double==NULL) ) assert( param_double.N() == 15); if(perm_r) assert( perm_r.N() == n); if(perm_c) assert( perm_c.N() == m); if(scale_r) assert( scale_r.N() == n); if(scale_c) assert( scale_c.N() == m); if( n != m ) cerr << "only square matrix are supported by MUMPS" << endl; // initialisation par defaut SYM=0; PAR=1; /* if(!string_option.empty()) { if(myid==0){ cout << "read string option" < double definition of parameters.",data_option.c_str()); exit(1); } if( !(param_int == NULL) ){ cout << "internal parameter" << endl; for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = param_int[ii+2]; } else{ // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } if( !(param_double == NULL) ){ cout << "internal parameter" << endl; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = param_double[ii]; } } else if(!data_option.empty()){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = dataint[ii]; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = datadouble[ii]; } else{ // parameter by default cout << "default parameter" << endl; id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } // uniquement donner au host if(myid==0){ if( !(perm_r==NULL) && id.ICNTL(7)==1){ for(int ii=0; ii id.ICNTL(5) = 0; \n"); id.ICNTL(5) = 0; exit(1); } if (myid == 0) { id.n = n; id.nz =nz; //id.irn=irn; id.jcn=jcn; //id.a = a; //id.rhs = rhs; } if( id.ICNTL(18) == 0) { // CASE:: NON DISTRIBUTED MATRIX if (myid == 0) { // nouveau a=AA.a; // ATTENTION // AA.cl :: indice des colonnes (exacte) et AA.lg :: indice des lignes // index of row and colummn by 1 jcn = AA.cl; for(int ii=0; ii 1) cout <<"id.ICNTL(18) = 1 || id.ICNTL(18) == 2 "<< endl; // ATTENTION // AA.cl :: indice des colonnes (exacte) et AA.lg :: indice des lignes // index of row and column by 1 if (myid == 0) { // new host process jcn = AA.cl; for(int ii=0; ii 0){ id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } if( myid == 0){ //free( irn_loc ); //free( jcn_loc ); //free( a_loc ); free( nz_loc_procs ); free( fst_nz_procs ); free( irn_g ); free( jcn_g ); free( a_g ); } } if( PAR == 1 ){ int *nz_loc_procs; int *fst_nz_procs; int *irn_g; int *jcn_g; double *a_g; int commSize; MPI_Comm_size(comm,&commSize); if(myid==0){ // allocation des differents tableaux nz_loc_procs = (int*) malloc ( commSize*sizeof(int) ); for(int ii=0; ii pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } } if(PAR == 1){ //============================== // besoin de irn, jcn, AA.a //============================== int commSize; ierr=MPI_Comm_size(comm,&commSize); int m_loc_fst = m/commSize; int m_loc; if( myid == commSize-1 && ( m_loc_fst*commSize != m ) ) m_loc = m-m_loc_fst*( commSize-1 ); else m_loc = m_loc_fst; int fst_row= myid*m_loc_fst; nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // allocation des tableaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (double*) malloc(sizeof(double)*nz_loc); int fst_nnz = AA.lg[fst_row]; for(int ii=0; ii < nz_loc; ii++){ a_loc[ii] = AA.a[fst_nnz+ii]; jcn_loc[ii] = AA.cl[fst_nnz+ii]; // jcn=AA.cl a ete augmenter de 1 avant => pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } /* Call the MUMPS package. */ // Factorisation id.job=2; dmumps_c(&id); } } if( id.ICNTL(18) == 3 ) { // indices et colonnes de la matrice // // Cas Matrice parallele :: // // ======================== // // // Cas stockage Morse parallele // m_loc = AA.m_loc; // Nombre de lignes prise en compte // nz_loc = AA.nbcoef_loc; // Nombre de coefficients non nulles // // indice des colonnes // jcn_loc = AA.cl_loc; // indices des colonnes dans la matrice locale // // if( !(irn_loc = (int*) malloc(sizeof(int)*nz_loc)) ){ // printf("problem allocation jcn "); // exit(1); // } // assert(AA.lg_loc[nrow_loc] == nz_loc); // for(int ii=0; ii< nrow_loc; ii++) // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1] = ii+1; // // a_loc=AA.a_loc; // // Pas de matrice parallele ==> utilisation astuce de SuperLU // Matrice :: distribution bloc continue de lignes :: voir SuperLU // Attention :: performance ??? // //================== // // pour un proc : // // a: AA.a[fstow] , ..., AA.a[fstrow+nz_loc-1] // // jcn: AA.cl[fstrow] , ..., AA.cl[fstrow+nz_loc-1] // // irn: AA.lg[fstrow] , ..., AA.lg[fstrow+m_loc] // //================== // // apres reception : // // irn_reel: // // int jj=0, // // do ii=0,m_loc-1 // // do ii1=irn_donnee[ii],irn_donnee[ii+1]-1 // // irn_reel[jj] = fst_row+ii+1; // // jj++ // // end do // // end do // //================= cout <<"id.ICNTL(18) = 3, PAR="<< PAR << endl; if(PAR == 0){ // if(myid != 0) { // int commSize; // ierr=MPI_Comm_size(comm,&commSize); // commSize=commSize-1; // int myidpar=myid-1; // int m_loc_fst; // m_loc_fst= m/commSize; // int m_loc; // if( myidpar == commSize-1 && ( m_loc_fst*commSize != m ) ) // m_loc = m-m_loc_fst*( commSize-1 ); // else // m_loc = m_loc_fst; // int fst_row; // fst_row= myidpar*m_loc_fst; // nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // // allocation des tableaux // irn_loc = (int*) malloc(sizeof(int)*nz_loc); // jcn_loc = (int*) malloc(sizeof(int)*nz_loc); // a_loc = (double*) malloc(sizeof(double)* nz_loc); // int fst_nnz; // fst_nnz = AA.lg[fst_row]; // for(int ii=0; ii < nz_loc; ii++){ // a_loc[ii] = AA.a[fst_nnz+ii]; // jcn_loc[ii] = AA.cl[fst_nnz+ii]+1; // } // for(int ii=fst_row; ii< fst_row+m_loc; ii++){ // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1-fst_nnz] = ii+1; // } // id.nz_loc = nz_loc; // id.irn_loc = irn_loc; // id.jcn_loc = jcn_loc; // id.a_loc = a_loc; // } // definition de variables int commSize; int m_loc_fst; int m_loc; int fst_row; int *nz_loc_procs; int *fst_nz_procs; int *m_loc_procs; int *fst_row_procs; double *tab_a; int *tab_cl; int *tab_lg; int *tab_lg_loc; MPI_Comm_size(comm,&commSize); if( myid !=0){ int commSizemm; int myidpar=myid-1; commSizemm = commSize-1; m_loc_fst= m/commSizemm; if( myidpar == commSizemm-1 && ( m_loc_fst*commSizemm != m ) ) m_loc = m-m_loc_fst*( commSizemm-1 ); else m_loc = m_loc_fst; if(verbosity > 5){ fst_row = myidpar*m_loc_fst; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } } if( myid ==0){ int commSizemm; commSizemm = commSize-1; m_loc_fst= m/commSizemm; fst_row_procs = (int* ) malloc( commSize*sizeof(int) ); m_loc_procs = (int* ) malloc( commSize*sizeof(int) ); fst_nz_procs = (int* ) malloc( commSize*sizeof(int) ); nz_loc_procs = (int* ) malloc ( commSize*sizeof(int) ); fst_row_procs [0] = 0; m_loc_procs [0] = 0; for( int ii= 1; ii 5){ cout << "after scatter " << myid << endl; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } // allocation des tableaux locaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (double*) malloc(sizeof(double)*nz_loc); tab_lg_loc = (int*) malloc(sizeof(int)*(m_loc) ); MPI_Scatterv( tab_a, nz_loc_procs, fst_nz_procs, MPI_DOUBLE, a_loc, nz_loc, MPI_DOUBLE, 0, comm); MPI_Scatterv( tab_cl, nz_loc_procs, fst_nz_procs, MPI_INT, jcn_loc, nz_loc, MPI_INT, 0, comm); MPI_Scatterv( tab_lg, m_loc_procs, fst_row_procs, MPI_INT, tab_lg_loc, m_loc, MPI_INT, 0, comm); int jj=0; for(int ii=0; ii &AA,KN_ &x,const KN_ &b) const { long int starttime,finishtime; long int timeused; ///////////////////////////// double *rhs; int job; if(verbosity) starttime = clock(); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // indices des colonnes commence par 1 avec mumps // et 0 dans freefem ==> renumerotation if(jcn != NULL) for(int ii=0; ii renumerotation if(jcn != NULL) for(int ii=0; ii1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Solving ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if( verbosity ){ if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "MUMPS : time solve step :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; static mumps_double_complex *mumps_dc(Complex *p) { return (mumps_double_complex *) (void *) p;} static Complex *inv_mumps_dc(mumps_double_complex *p) { return (Complex *) (void *) p;} class zSolveMUMPSmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 mutable MPI_Comm comm; Complex *a; int *irn, *jcn; int n, m, nz; // parameter MUMPS KN perm_r; /* row permutations from partial pivoting */ KN perm_c; KN scale_r; KN scale_c; string string_option; string data_option; int SYM; int PAR; int myid; // distribuer int nz_loc; int *jcn_loc, *irn_loc; Complex *a_loc; static const int JOB_INIT=-1; static const int JOB_END=-2; static const int USE_COMM_WORLD= -987654; // variable complex mutable ZMUMPS_STRUC_C id; /* variable d'informations */ #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ #define CNTL(I) cntl[(I)-1] /* macro s.t. indices match documentation */ #define RINFOG(I) rinfog[(I)-1] /* macro s.t. indices match documentation */ #define INFOG(I) infog[(I)-1] /* macro s.t. indices match documentation */ public: zSolveMUMPSmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string param_string, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN_ &pperm_c, KN &pscale_r,KN &pscale_c, MPI_Comm * mpicommw) : eps(epsilon),epsr(0), tgv(ttgv), string_option(param_string), data_option(datafile), perm_r(pperm_r), perm_c(pperm_c), tol_pivot_sym(pivot_sym),tol_pivot(pivot), scale_r(pscale_r), scale_c(pscale_c) { long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); int dataint[40]; double datadouble[15]; int ierr; if(mpicommw==0){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ ierr = MPI_Comm_rank(comm, &myid); if( myid ==0){ n = AA.n; m = AA.m; nz = AA.nbcoef; MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } else{ MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } if( !(param_int==NULL) ) assert( param_int.N() == 42); if( !(param_double==NULL) ) assert( param_double.N() == 15); if(pperm_r) assert( perm_r.N() == n); if(pscale_r) assert( scale_r.N() == n+m ); if(pscale_c) assert( scale_c.N() == n+m ); if( n != m ) cerr << "only square matrix are supported by MUMPS" << endl; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ // initialisation par defaut SYM=0; PAR=1; // if(!string_option.empty()) // { // read_options_freefem(&string_option,&SYM,&PAR); // } if( !(param_int==NULL) ){ SYM = param_int[0]; PAR = param_int[1]; } else if(!data_option.empty()) { if(myid==0){ char * retfile= new char[data_option.size()+1]; strcpy(retfile, (&data_option)->c_str()); printf("read data from file %s\n", retfile); FILE *pFile=fopen(retfile,"rt"); int i_data=0; int d_data=0.; char data[256]; char *tictac; fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); SYM = atoi(tictac); fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); PAR = atoi(tictac); while( !feof(pFile) && i_data < 40){ fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); dataint[i_data] = (int)atol(tictac); i_data++; } assert(i_data == 40); while( !feof(pFile) && d_data < 15){ fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); datadouble[d_data] = (double)atof(tictac); d_data++; } assert(d_data == 15); fclose(pFile); delete [] retfile; MPI_Bcast( &SYM, 1, MPI_INT, 0, comm ); MPI_Bcast( &PAR, 1, MPI_INT, 0, comm ); MPI_Bcast( dataint, 40, MPI_INT, 0, comm ); MPI_Bcast( datadouble, 15, MPI_DOUBLE, 0, comm ); fclose(pFile); delete [] retfile; } else{ MPI_Bcast( &SYM, 1, MPI_INT, 0, comm ); MPI_Bcast( &PAR, 1, MPI_INT, 0, comm ); MPI_Bcast( dataint, 40, MPI_INT, 0, comm ); MPI_Bcast( datadouble, 15, MPI_DOUBLE, 0, comm ); } } /* Initialize a MUMPS instance. Use comm */ id.job=JOB_INIT; id.par=PAR; id.sym=SYM; id.comm_fortran=(MUMPS_INT) MPI_Comm_c2f(comm); zmumps_c(&id); /* set parameter of mumps */ if( !(param_int==NULL) || !(param_double==NULL) ){ if(!data_option.empty()){ printf("read option before with the file %s\n",data_option.c_str()); exit(1); } if( !(param_int==NULL) ){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = param_int[ii+2]; } else // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; if( !(param_double==NULL) ) for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = param_double[ii]; } else if(!data_option.empty()){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = dataint[ii]; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = datadouble[ii]; } else{ // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } // uniquement donner au host if(myid==0){ if( !(perm_r==NULL) && id.ICNTL(7)==1){ for(int ii=0; ii pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = mumps_dc(a_loc); } } if(PAR == 1){ int commSize; ierr=MPI_Comm_size(comm,&commSize); int m_loc_fst = m/commSize; int m_loc; if( myid == commSize-1 && ( m_loc_fst*commSize != m ) ) m_loc = m-m_loc_fst*( commSize-1 ); else m_loc = m_loc_fst; int fst_row= myid*m_loc_fst; nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // allocation des tableaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (Complex*) malloc(sizeof(Complex)*nz_loc); int fst_nnz = AA.lg[fst_row]; for(int ii=0; ii < nz_loc; ii++){ a_loc[ii] = AA.a[fst_nnz+ii]; jcn_loc[ii] = AA.cl[fst_nnz+ii]; // jcn=AA.cl a ete augmenter de 1 avant => pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = mumps_dc(a_loc); } /* Call the MUMPS package. */ // Factorisation id.job=2; zmumps_c(&id); } } if( id.ICNTL(18) == 3 ) { // indices et colonnes de la matrice // // Cas Matrice parallele :: // // ======================== // // // Cas stockage Morse parallele // m_loc = AA.m_loc; // Nombre de lignes prise en compte // nz_loc = AA.nbcoef_loc; // Nombre de coefficients non nulles // // indice des colonnes // jcn_loc = AA.cl_loc; // indices des colonnes dans la matrice locale // // if( !(irn_loc = (int*) malloc(sizeof(int)*nz_loc)) ){ // printf("problem allocation jcn "); // exit(1); // } // assert(AA.lg_loc[nrow_loc] == nz_loc); // for(int ii=0; ii< nrow_loc; ii++) // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1] = ii+1; // // a_loc=AA.a_loc; // // Pas de matrice parallele ==> utilisation astuce de SuperLU // Matrice :: distribution bloc continue de lignes :: voir SuperLU // Attention :: performance ??? cout <<"id.ICNTL(18) = 3, PAR="<< PAR << endl; if(PAR == 0){ // if(myid !=0) { // int commSize; // ierr=MPI_Comm_size(comm,&commSize); // commSize=commSize-1; // int myidpar=myid-1; // int m_loc_fst; // m_loc_fst= m/commSize; // int m_loc; // if( myidpar == commSize-1 && ( m_loc_fst*commSize != m ) ) // m_loc = m-m_loc_fst*( commSize-1 ); // else // m_loc = m_loc_fst; // // int fst_row; // fst_row= myidpar*m_loc_fst; // nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // // // allocation des tableaux // irn_loc = (int*) malloc(sizeof(int)*nz_loc); // jcn_loc = (int*) malloc(sizeof(int)*nz_loc); // a_loc = (Complex*) malloc(sizeof(Complex)* nz_loc); // // int fst_nnz; // fst_nnz = AA.lg[fst_row]; // for(int ii=0; ii < nz_loc; ii++){ // a_loc[ii] = AA.a[fst_nnz+ii]; // jcn_loc[ii] = AA.cl[fst_nnz+ii]+1; // } // for(int ii=fst_row; ii< fst_row+m_loc; ii++){ // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1-fst_nnz] = ii+1; // } // id.nz_loc = nz_loc; // id.irn_loc = irn_loc; // id.jcn_loc = jcn_loc; // id.a_loc = mumps_dc(a_loc); // } // definition de variables int commSize; int m_loc_fst; int m_loc; int fst_row; int *nz_loc_procs; int *fst_nz_procs; int *m_loc_procs; int *fst_row_procs; Complex *tab_a; int *tab_cl; int *tab_lg; int *tab_lg_loc; MPI_Comm_size(comm,&commSize); if( myid !=0){ int commSizemm; int myidpar=myid-1; commSizemm = commSize-1; m_loc_fst= m/commSizemm; if( myidpar == commSizemm-1 && ( m_loc_fst*commSizemm != m ) ) m_loc = m-m_loc_fst*( commSizemm-1 ); else m_loc = m_loc_fst; if(verbosity > 5){ fst_row = myidpar*m_loc_fst; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } } if( myid ==0){ int commSizemm; commSizemm = commSize-1; m_loc_fst= m/commSizemm; fst_row_procs = (int* ) malloc( commSize*sizeof(int) ); m_loc_procs = (int* ) malloc( commSize*sizeof(int) ); fst_nz_procs = (int* ) malloc( commSize*sizeof(int) ); nz_loc_procs = (int* ) malloc ( commSize*sizeof(int) ); fst_row_procs [0] = 0; m_loc_procs [0] = 0; for( int ii= 1; ii 5){ cout << "after scatter " << myid << endl; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } // allocation des tableaux locaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (Complex*) malloc(2*sizeof(double)*nz_loc); tab_lg_loc = (int*) malloc(sizeof(int)*(m_loc) ); MPI_Scatterv( tab_a, nz_loc_procs, fst_nz_procs, MPI_DOUBLE_COMPLEX, a_loc, nz_loc, MPI_DOUBLE_COMPLEX, 0, comm); MPI_Scatterv( tab_cl, nz_loc_procs, fst_nz_procs, MPI_INT, jcn_loc, nz_loc, MPI_INT, 0, comm); MPI_Scatterv( tab_lg, m_loc_procs, fst_row_procs, MPI_INT, tab_lg_loc, m_loc, MPI_INT, 0, comm); int jj=0; for(int ii=0; ii renumerotation if( jcn != NULL ) for(int ii=0; ii1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Factorisation ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if( verbosity){ if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "MUMPS : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { long int starttime,finishtime; long int timeused; //*******************************************************************// // depend pas de la forme de la matrice: distribuer ou assembler Complex *rhs; int job; if(verbosity) starttime = clock(); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // indices des colonnes commence par 1 avec mumps // et 0 dans freefem ==> renumerotation if(jcn != NULL) for(int ii=0; ii renumerotation if(jcn != NULL) for(int ii=0; ii 1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Solving ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " MUMPS : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverMUMPSmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverMUMPS" << endl; return new dSolveMUMPSmpi(*A,ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.sparams, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c, ds.scale_r, ds.scale_c,(MPI_Comm *)ds.commworld); } MatriceMorse::VirtualSolver * BuildSolverMUMPSmpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverMUMPS" << endl; return new zSolveMUMPSmpi(*A,ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.sparams, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c, ds.scale_r, ds.scale_c,(MPI_Comm *)ds.commworld); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; } bool SetMUMPSmpi() { if(verbosity) cout << " SetDefault sparse solver to MUMPSmpi" << endl; DefSparseSolver::solver =BuildSolverMUMPSmpi; DefSparseSolver::solver =BuildSolverMUMPSmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: MUMPS , defaultsolver defaultsolverMUMPS " << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverMUMPSmpi; DefSparseSolver::solver =BuildSolverMUMPSmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoMUMPS","(",new OneOperator0(SetMUMPSmpi)); } freefem++-3.61-1/src/solver/real_pastix_FreeFem.cpp000644 000767 000024 00000052111 13256636774 022334 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // /* 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 */ /* Interface entre freefem++ et pastix */ #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include #include #include #include #include #include // #include // #include // #include // #include // //#include // #include // #include // #include // #include "mpi.h" // #include // #include "pastix.h" // #include "cscd_utils.h" // #include "read_matrix.h" #include #ifdef __cplusplus extern "C" { #endif #include "pastix.h" //#include "cscd_utils.h" #ifdef __cplusplus } #endif //#include "read_matrix.h" #undef memFree_null #define memFree_null(x) {if (x ==NULL) {fprintf(stdout,"%s:%d freeing NULL\n",__FILE__,__LINE__);} free(x); x=NULL;} #define STR_SIZE 256 static pastix_int_t * pastixint(int * ii){ return (pastix_int_t*) (void *) ii;} static pastix_float_t * pastixfloat(double * ii){ return (pastix_float_t*) (void *) ii;} typedef struct pastix_param { pastix_data_t *pastix_data; /*Pointer used by PaStiX to keep information alive between calls */ MPI_Comm comm; /* Communicator used by PaStiX */ pastix_int_t Ncol; /* Size of the Matrix */ pastix_int_t *ia; /* Index of first element of each column in ja and avals */ pastix_int_t *ja; /* Rows of the unknows of the matrix */ pastix_float_t *avals; /* Values of the matrix */ pastix_int_t *perm; /* Permutation used for re-numbering of the unknowns */ pastix_int_t *invp; /* Inverse permutation */ pastix_float_t *rhs; /* Right hand side */ pastix_int_t *iparm; /* Integer parameters */ double *dparm; /* Floating parameters */ } pastix_param_t; void Morse_to_CSC(int m, int n, int nnz, double *a, int *colind, int *rowptr, pastix_float_t **at, pastix_int_t **rowind, pastix_int_t **colptr) { register int i, j, col, relpos; pastix_int_t *marker; /* Allocate storage for another copy of the matrix. */ *at = (pastix_float_t *) malloc(sizeof(pastix_float_t)*nnz); *rowind = (pastix_int_t *) malloc(sizeof(pastix_int_t)*nnz); *colptr = (pastix_int_t *) malloc(sizeof(pastix_int_t)*(n+1)); marker = (pastix_int_t *) malloc(sizeof(pastix_int_t)*n); for (i = 0; i < n; ++i) marker[i] = 0; /* Get counts of each column of A, and set up column pointers */ for (i = 0; i < m; ++i) for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; (*colptr)[0] = 0; for (j = 0; j < n; ++j) { (*colptr)[j+1] = (*colptr)[j] + marker[j]; marker[j] = (*colptr)[j]; } /* Transfer the matrix into the compressed column storage. */ for (i = 0; i < m; ++i) { for (j = rowptr[i]; j < rowptr[i+1]; ++j) { col = colind[j]; relpos = marker[col]; (*rowind)[relpos] = i; (*at)[relpos] = a[j]; ++marker[col]; } } free(marker); } static const int MAX_CHAR_PER_LINE=256; //void read_datafile_pastixff(const string &datafile, pastix_int_t *iparmtab, double *dparmtab){ void read_datafile_pastixff(const string &datafile, int &mpi_flag, pastix_int_t *iparmtab, double *dparmtab){ FILE* m_File; int i = 0; char szbuff[MAX_CHAR_PER_LINE]; char* token; char filename[datafile.size()+1]; strcpy( filename, datafile.c_str()); m_File = fopen(filename,"rt"); if(!m_File) { printf("error in reading filename %s\n",&filename); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"matrix") == 0) ){ printf("freefem++: error in reading matrix parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading matrix parameter for pastix \n"); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if(strcmp(token,"assembled") == 0) mpi_flag = 0; else if(strcmp(token,"distributedglobal") == 0) mpi_flag = 1; else if(strcmp(token,"distributed") == 0) mpi_flag = 2; else{ printf("value of parameter matrix is not correct %s \n", token ); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"iparm") == 0) ){ printf("freefem++: error in reading iparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading iparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); iparmtab[i] = (pastix_int_t)atol(token); i++; } i=0; fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"dparm") == 0) ){ printf("freefem++: error in reading dparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading dparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); dparmtab[i] = atof(token); i++; } fclose(m_File); #ifdef OOC /* if (iparmtab[IPARM_OOC_THREAD] > 1) */ iparmtab[IPARM_OOC_THREAD] = 1; #endif /* On empeche le 2d avec NUMA_ALLOC */ #ifdef NUMA_ALLOC if (iparmtab[IPARM_DISTRIBUTION_LEVEL] != 0) { errorPrint("2D not available with NUMA allocation\n"); exit(-1); } #endif } // ATTENTION :: pastix_float_t // peut tre soit un complex ou un reel cela depend de la maniere dont on a compiler pastix // CAS DOUBLE SEULEMENT class dSolvepastixmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 int paraoption; int myid, mpi_size; int Nrow; int mpi_flag; int init_raff; int thrd_flag; int SYM; string data_option; mutable pastix_int_t iparm[64]; mutable double dparm[64]; mutable pastix_int_t Ncol; mutable pastix_int_t *ia; mutable pastix_int_t *ja; mutable pastix_float_t *avals; mutable pastix_int_t *loc2glob; //char *Type = NULL; //char *RhsType = NULL; mutable pastix_float_t *rhs; mutable pastix_int_t *perm; mutable pastix_int_t *invp; mutable pastix_data_t *pastix_data; public: dSolvepastixmpi(const MatriceMorse &AA, int strategy, double ttgv, double epsilon, double pivot, double pivot_sym, string datafile, KN &pparam_int, KN &pparam_double, KN &pperm_r, KN &pperm_c) : eps(epsilon),epsr(0), tgv(ttgv),tol_pivot_sym(pivot_sym),tol_pivot(pivot), data_option(datafile) { KN_ param_int(pparam_int); KN_ param_double(pparam_double); //int m; //int ierr; struct timeval tv1, tv2; int nnz; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); ia = NULL; ja = NULL; avals = NULL; loc2glob = NULL; rhs = NULL; pastix_data = NULL; // matrix assembled on host MPI_Comm_rank(MPI_COMM_WORLD, &myid); printf("- Rang MPI : %d\n", myid); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); // SYMETRIQUE // MPI_flag need to unselect for non distributed matrix mpi_flag = 0; thrd_flag = 0; // ###################### //pastix_int_t init_raff; fprintf(stdout,"-- INIT PARAMETERS --\n"); // reading iparm from array if(!data_option.empty()){ read_datafile_pastixff(data_option,mpi_flag,iparm,dparm); if(mpi_flag != 0) cerr << "ERROR :: GLOBAT INPUT MATRIX FOR ALL PROCS matrix=assembled" << endl; } else if( !(param_int==NULL) || !(param_double==NULL) ){ if( !(param_int==NULL) ) { cout << "read param_int" << endl; assert(param_int.N() == 64); for(int ii=0; ii<64; ii++) iparm[ii] = param_int[ii]; iparm[IPARM_MODIFY_PARAMETER] = API_YES; } if( !(param_double==NULL) ) { cout << "read param_double" << endl; assert(param_double.N() == 64); for(int ii=0; ii<64; ii++) dparm[ii] = param_double[ii]; } } else{ iparm[IPARM_MODIFY_PARAMETER] = API_NO; cout << "initialize parameter" << endl; } //################################ if( myid==0 ){ Ncol = AA.m; Nrow = AA.n; nnz = AA.nbcoef; // Avant : on ecrit la transpose // AA.cl : indices des colonnes // AA.lg : pointeurs des lignes Morse_to_CSC( AA.n , AA.m, AA.nbcoef, AA.a, AA.cl, AA.lg, &avals, &ja, &ia); // ia : pointeurs des colonnes // ja : indices des lignes cout << "AA.n= "<< AA.n << " AA.m=" << AA.m << " AA.nbcoef=" << AA.nbcoef << endl; for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = ia[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++){ ja[ii] = ja[ii]+1; } MPI_Bcast( &Ncol, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &Nrow, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &nnz, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, MPI_COMM_WORLD ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); } else{ MPI_Bcast( &Ncol, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &Nrow, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &nnz, 1, MPI_INT, 0, MPI_COMM_WORLD ); avals = (pastix_float_t *) malloc( nnz*sizeof(pastix_float_t) ); ia = (pastix_int_t *) malloc( (Ncol+1)*sizeof(pastix_int_t) ); ja = (pastix_int_t *) malloc( nnz*sizeof(pastix_int_t) ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, MPI_COMM_WORLD ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, MPI_COMM_WORLD ); } perm = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); invp = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); rhs = (pastix_float_t *) malloc(Ncol*sizeof(pastix_float_t)); // reading permutation given by the user if(pperm_r) for(int ii=0; ii < Ncol; ii++) perm[ii] = pperm_r[ii]; if(pperm_c) for(int ii=0; ii < Ncol; ii++) invp[ii] = pperm_c[ii]; iparm[IPARM_START_TASK] = API_TASK_INIT; iparm[IPARM_END_TASK] = API_TASK_INIT; iparm[IPARM_SYM] = API_SYM_NO; // Matrix is considered nonsymetric if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; fprintf(stdout,"-- FIN INIT PARAMETERS --\n"); init_raff = iparm[IPARM_ITERMAX]; fflush(stdout); /* Passage en mode verbose */ iparm[IPARM_RHS_MAKING] = API_RHS_B; if( (param_int==NULL) && data_option.empty() ){ iparm[IPARM_MATRIX_VERIFICATION] = API_YES; iparm[IPARM_REFINEMENT] = API_RAF_GMRES; iparm[IPARM_INCOMPLETE] = API_NO; } if( (param_double==NULL) && data_option.empty()){ dparm[DPARM_EPSILON_REFINEMENT] = 1e-12; dparm[DPARM_EPSILON_MAGN_CTRL] = 1e-32; } // cscd_checksym(Ncol, ia, ja, loc2glob, MPI_COMM_WORLD); // if (iparm[IPARM_SYM]==API_SYM_YES) // { // /* Symetric problem */ // /* Build non oriented graph */ // /* build non symmetric csc from symmetric csc */ // /*maillage global*/ // INT *tmpia; // INT *tmpja; // INT tmpn; // cscd_symgraph_int(*n2, *col2, *row2 , NULL, // &tmpn, &tmpia, &tmpja, NULL, // *loc2glob2, pastix_comm, API_YES); // memFree_null(*col2); // *col2 = tmpia; // memFree_null(*row2); // *row2 = tmpja; // *n2 = tmpn; // } SYM = AA.symetrique; cout << "SYM = "<< SYM << endl; // SYMETRIQUE if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Scotch */ fprintf(stdout,"-- Scotch --\n"); fflush(stdout); iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_ORDERING; if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; iparm[IPARM_SYM] = API_SYM_NO; /* Fax */ fprintf(stdout,"-- Fax --\n"); iparm[IPARM_START_TASK] = API_TASK_SYMBFACT; iparm[IPARM_END_TASK] = API_TASK_SYMBFACT; if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Blend */ fprintf(stdout,"-- Blend --\n"); iparm[IPARM_START_TASK] = API_TASK_ANALYSE; iparm[IPARM_END_TASK] = API_TASK_ANALYSE; if( SYM == 1 ){ //iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ //iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Factorisation */ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_NUMFACT; gettimeofday(&tv1, NULL); fprintf(stdout,"-- SOPALIN --\n"); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call factorization : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000); printf("=====================================================\n"); cout << " pastix : time factorization :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { struct timeval tv1, tv2; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); // index for pastix for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]+1; assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]+1; // give value of the second member for(int ii=0; ii < Ncol; ii++){ rhs[ii] = b[ii]; } //fprintf(stdout,"SOLVE STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* updo */ iparm[IPARM_START_TASK] = API_TASK_SOLVE; iparm[IPARM_END_TASK] = API_TASK_SOLVE; iparm[IPARM_RHS_MAKING] = API_RHS_B; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call updown : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); //if(verbosity > 1) // for(int jj=0; jj < Ncol; jj++) //cout << "rhs["<< jj << "]=" << rhs[jj] << endl; //fprintf(stdout,"RAFF STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* raff */ iparm[IPARM_START_TASK] = API_TASK_REFINE; iparm[IPARM_END_TASK] = API_TASK_REFINE; iparm[IPARM_RHS_MAKING] = API_RHS_B; iparm[IPARM_ITERMAX] = init_raff; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call refinement : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol; ii++) x[ii] = rhs[ii]; // index for freefem assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverpastix_real_mpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverpastix_real_mpi" << endl; return new dSolvepastixmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c); } class Init { public: Init(); }; // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; } bool Setpastixmpi() { if(verbosity) cout << " SetDefault sparse solver to pastixmpi" << endl; DefSparseSolver::solver =BuildSolverpastix_real_mpi; //DefSparseSolver::solver =BuildSolverpastix_real_mpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; } Init init; Init::Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pastix, defaultsolver defaultsolverpastix" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverpastix_real_mpi; //DefSparseSolver::solver =BuildSolverpastix_real_mpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("realdefaulttopastix","(",new OneOperator0(Setpastixmpi)); } freefem++-3.61-1/src/Algo/NewtonRaphson.hpp000644 000767 000024 00000005144 13256636774 020616 0ustar00hechtstaff000000 000000 #ifndef NEWTONRAPHSON_HH #define NEWTONRAPHSON_HH #include "Optima.hpp" #include "defs.hpp" /* At the present version, you must use the CubicLS procedure */ // Necessite une "vraie" classe Matrice template class Newt : public Optima { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef typename LS::Mat Mat; typedef list mlist; public: Newt(///pointer to the line-search object. LS * ls, ///Maximum number of iterations int iter, ///minimum accepted gradient at optimum solution Real tol, ///vebose or quiet int verb=0); ~Newt(){;} // the Newt search starting from model0, returns an optimum model Param optimizer(Param& model0); }; template Newt::Newt(LS* p, int it, Real eps, int verb) :Optima(verb) { this->ls=p; this->iterMax = it; this->tol = eps; this->iterNum = 0; } // Ncessite pour la classe MAT: // - une mthode de rsolution de Ax=b template typename Newt::Param Newt::optimizer( Param& model0) { //reset the this->residue history for every new optimizer this->iterNum = 0; if (this->residue != NULL) { delete this->residue; this->residue = new mlist; } // Initial settings for some parameters int n = model0.size(); Vect g0(n); double lambda = 0.025; double descent = 0.; g0= *(this->ls->gradient(model0)); // check the gradient, in case the initial model is the optimal double err = (Real)sqrt((g0,g0)); if (this->isVerbose) cerr << "Initial this->residue : " << err << endl; this->appendResidue(err); // residual if (err < this->tol) { if (this->isVerbose) cerr << "Initial guess was great! \n"; this->isSuccess = 1; return model0; } Vect g1(n); Vect s(n); Param model1(model0); while (this->finalResidue() > this->tol && this->iterNum < this->iterMax) { //searching directions // s = g0/(*this->ls->hessian(model0)); //on rinitialise LU a chaque fois this->ls->hessian(model0)->Solve(s,g0); s = -1.*s; descent = (s,g0); // Cubic Line Search model1 = this->ls->search(model0, s, descent, lambda); g1 = *(this->ls->gradient(model1)); err = (Real)sqrt((g1,g1)); if (this->isVerbose) cerr << "Iteration (" << this->iterNum << ") : "<<"current value of the objective function: " <ls->currentValue() << "\t current this->residue: "<< err << endl; this->appendResidue(err); // residual g0=g1; model0=model1; this->iterNum ++; } return(model1); } #endif freefem++-3.61-1/src/Algo/RosenBrock.hpp000644 000767 000024 00000004540 13256636774 020057 0ustar00hechtstaff000000 000000 #ifndef ROSENBROCK_HH #define ROSENBROCK_HH #include "NRJ.hpp" #include "Param.hpp" //#include "mvvtp.h" //#include "mvblas.h" template class RosenBrock : public tNRJ,KN,Mat,Real> { private: protected: public: //Constructors and Destructors RosenBrock(int); ~RosenBrock(); Real Val(const Param&); KN* Gradient(const Param&); Mat* Hessian(const Param&); }; template RosenBrock::RosenBrock(int n) :tNRJ,KN,Mat,Real>(n) { // On initialise le gradient this->grad= new KN(n); // On initialise le hessien // Si on utlise pas le hessien, il suffit qu'il existe un constructeur // pour le type Mat qui prend un parametre entier. C'est vrai pour les // doubles par exemple... this->hess= new Mat(n); (*this->hess)=0; } template RosenBrock::~RosenBrock() { ; } template Real RosenBrock::Val(const Param& param) { Real ti_1, ti, tt; Real d=0; ti_1=param[0]; for (int i=1; i < this->nparam; i++) { ti = param[i]; tt = 1-ti_1; d += tt*tt; tt=ti-ti_1*ti_1; d += 100*tt*tt; ti_1=ti; } this->val=d; return d; } template KN* RosenBrock::Gradient(const Param& param) { Real ti_1,ti; ti_1=param[0]; ti=param[1]; (*this->grad)[0]=-200*2*ti_1*(ti-ti_1*ti_1)-2*(1-ti_1); for (int i=1; inparam-1; i++){ (*this->grad)[i]=200*(ti-ti_1*ti_1); ti_1=ti; ti=param[i+1]; (*this->grad)[i] += -200*2*ti_1*(ti-ti_1*ti_1)-2*(1-ti_1); } (*this->grad)[this->nparam-1]=200*(ti-ti_1*ti_1); return this->grad; } template Mat* RosenBrock::Hessian(const Param& param) { Real ti_1,ti; ti_1=param[0]; ti=param[1]; (*this->hess)(0,0)=-200*2*(ti-ti_1*ti_1)+200*2*2*ti_1*ti_1+2; (*this->hess)(0,1)=-200*2*ti_1; for (int i=1; inparam-1; i++){ (*this->hess)(i,i)=200; (*this->hess)(i,i-1)=-200*2*ti_1; ti_1=ti; ti=param[i+1]; (*this->hess)(i,i) += -200*2*(ti-ti_1*ti_1)+200*2*2*ti_1*ti_1+2; (*this->hess)(i,i+1)=-200*2*ti_1; } (*this->hess)(this->nparam-1,this->nparam-1)=200; (*this->hess)(this->nparam-1,this->nparam-2)=-200*2*ti_1; return this->hess; } #endif freefem++-3.61-1/src/Algo/lgalgo.cpp000644 000767 000024 00000020636 13256636774 017254 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include "RNM.hpp" #include "MatriceCreuse_tpl.hpp" #include "Mesh3dn.hpp" #include "MeshPoint.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" #include "NRJ.hpp" #include "RosenBrock.hpp" #include "LineSearch.hpp" #include "CubicLS.hpp" #include "BrentLS.hpp" #include "Optima.hpp" #include "BFGS.hpp" //#include "CG.hpp" #include "NewtonRaphson.hpp" //template extern Block *currentblock; typedef double R; class PrintErrorCompileNewtow : public E_F0info { public: typedef double Result; static E_F0 * f(const basicAC_F0 & args) { lgerror("\n\n *** change Newtow in Newton .\n *** Bad name in previous version,\n *** sorry FH.\n\n"); return 0; } static ArrayOfaType typeargs() {return ArrayOfaType(true);} operator aType () const { return atype();} }; class OptimAlgo : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; typedef R REAL; typedef Param PARAM; typedef KN VECT; typedef KNM MAT; typedef VirtualMatrice VMAT; const int cas; class E_LCG: public E_F0mps { public: const int cas; static basicAC_F0::name_and_type name_param[] ; static const int n_name_param =3; Expression nargs[n_name_param]; Expression X; C_F0 inittheparam,theparam,closetheparam; Expression J,dJ,hJ; long arg(int i,Stack stack,long a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} R arg(int i,Stack stack,R a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} class lgNRJ : public tNRJ { private: Stack stack; Expression J,dJ,hJ,theparame; VECT * gg; protected: void setparam( const Param& x ) { KN *p=GetAny *>( (*theparame)(stack) ); ffassert( p->N() == x.N()); *p =x; } public: lgNRJ(Stack s,int n,Expression t,Expression JJ,Expression dJJ,Expression hJJ) : tNRJ(n), stack(s), J(JJ),dJ(dJJ),hJ(hJJ),theparame(t), gg(0) { if(dJ) gg=new VECT(n); } ~lgNRJ() { if(gg) delete gg;} REAL Val(const Param& x) { setparam(x); assert(J); R ret= GetAny( (*J)(stack)); WhereStackOfPtr2Free(stack)->clean(); return ret; } VECT* Gradient(const Param& x) { setparam(x); if ( dJ) { *gg=GetAny( (*dJ)(stack)); WhereStackOfPtr2Free(stack)->clean(); } return gg ; //dJ ? GetAny( (*dJ)(stack)) :0;} } VMAT* Hessian(const Param& x) { setparam(x); if (!hJ) return 0; Matrice_Creuse * M= GetAny *>( (*hJ)(stack)); WhereStackOfPtr2Free(stack)->clean(); assert(M && M->A ); return (VirtualMatrice*) M->A;} }; E_LCG(const basicAC_F0 & args,int cc) : cas(cc) { int nbj= args.size()-1; Block::open(currentblock); // make a new block to X = to(args[nbj]); C_F0 X_n(args[nbj],"n"); // the expression to init the theparam of all inittheparam = currentblock->NewVar("the parameter",atype *>(),X_n); theparam = currentblock->Find("the parameter"); // the expression for the parameter args.SetNameParam(n_name_param,name_param,nargs); const Polymorphic * opJ=0; const Polymorphic * opdJ=0; const Polymorphic * ophJ=0; if (nbj>0) { opJ= dynamic_cast(args[0].LeftValue()); assert(opJ); } if (nbj>1) { opdJ= dynamic_cast(args[1].LeftValue()); assert(opdJ); } if (nbj>2) { ophJ= dynamic_cast(args[2].LeftValue()); assert(ophJ); } J=dJ=hJ=0; J= to(C_F0(opJ,"(",theparam)); if(opdJ) dJ= to(C_F0(opdJ,"(",theparam));// mai2009 (bug????) Modif FH 17102005 (a verifier) to ->to if(ophJ) hJ= to< Matrice_Creuse *>(C_F0(ophJ,"(",theparam)); closetheparam=C_F0((Expression) Block::snewclose(currentblock),atype()) ; // the cleanning block expression /* if (nargs[2]) { const Polymorphic * op= dynamic_cast(nargs[2]); assert(op); C = op->Find("(",ArrayOfaType(atype(),false)); } else C =0; */ } virtual AnyType operator()(Stack stack) const { WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 typedef LineSearch LS; typedef CubicLineSearch CLS; KN * delta =0; R tol=arg(0,stack,1E-6); int itMax=arg(1,stack,100L); int itMaxLine=arg(2,stack,100L); bool verbose=verbosity>3; try { Kn &x = *GetAny((*X)(stack)); const int n=x.N(); //Kn * para = GetAny*>( inittheparam.eval(stack) ) ; // do allocation Param param(x); lgNRJ nrj1(stack,n,theparam,J,dJ,hJ); if (!dJ) delta = new KN(n); CLS ls( & nrj1,itMaxLine,delta); REAL initialNrj = nrj1.getVal(param); Optima *opt=0; if(cas==1) opt=new BFGS((CLS*)&ls,itMax,tol,verbose); else if(cas==2) opt=new Newt((CLS*)&ls,itMax,tol,verbose); else ErrorExec("lgalgo: Case no available Sorry internal bug",cas); param = opt->optimizer(param); REAL finalNrj = nrj1.getVal(param); if(verbosity) cout <1) { cout <<" The number of call to NRJ : "<< nrj1.Appel_Val() << endl; cout <<" The number of call to gradient : "<< nrj1.Appel_Grad() << endl; cout <<" The number of call to hessian : "<< nrj1.Appel_Hess() << endl; } if(verbosity>2) { cout <<"Normalized residue : "; affiche(opt->allResidue()); } if(verbosity) { cout <<" Initial NRJ value : " << initialNrj << endl; cout <<" Final NRJ value : " << finalNrj << endl;} delete opt; /// cout<<"The final optimized parameters : "<clean(); // FH mars 2005 if( delta) delete delta; throw ; } if( delta) delete delta; closetheparam.eval(stack); // clean memory WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 return 0L; //SetAny(0); Modif FH july 2005 } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_LCG(args,cas);} OptimAlgo(int c) : OneOperator(atype(), atype(), atype *>()),cas(c){} OptimAlgo(int c,int cc) : OneOperator(atype(), atype(), atype(), atype *>()),cas(c){} OptimAlgo(int c,int cc,int ccc) : OneOperator(atype(), atype(), atype(), atype(), atype *>()),cas(c){} }; //template basicAC_F0::name_and_type OptimAlgo::E_LCG::name_param[]= { { "eps", &typeid(double) }, { "nbiter",&typeid(long) }, { "nbiterline",&typeid(long)} }; void init_algo(); void init_algo() { Global.Add("BFGS","(",new OptimAlgo(1,1)); // j + dJ Global.Add("Newton","(",new OptimAlgo(2,2,2)); // j + dJ Global.Add("Newtow","(",new OneOperatorCode); // error } //#include "InitFunct.hpp" //static addingInitFunct TheaddingInitFunct(-9,init_algo); freefem++-3.61-1/src/Algo/CubicLS.hpp000644 000767 000024 00000012057 13256636774 017276 0ustar00hechtstaff000000 000000 // Tony : lambda=0.25 ou lambda=0.025 ??? // cf. CG.hpp // // The minimizer along the search direction is returned by the function. // /* CubicLineSearch() class implements the efficient line search procedure described in Dennis and Schbabel's book entitled "Numerical Methods for Unconstrained and Nonlinear Equations. The objective is to perform a unidimensional search for a minimum point along a specified direction in a multidimensional space. */ // This procedure seems to be fairly robust. It has worked for a fairly broad class of // problems from optimization of standard test functons in optimization theory and // to hard geophysical problems as stacking power optimization and amplitude // seismogram inversion #ifndef CUBIC_LINE_SEARCH_HH #define CUBIC_LINE_SEARCH_HH #include "LineSearch.hpp" #include #include template class CubicLineSearch : public LS { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef LS LineSearch; typedef tNRJ NRJ; public: //a constructor with the default delta CubicLineSearch(NRJ* f, int iter); //a constructor with the specified delta CubicLineSearch(NRJ* f, int iter, Vect* delta); /* The parameter $delta$ is not used by the line search itself. Rather it is used in the numerical computation of the derivatives using centered differences. For example the derivative of f(x) at the point x0 would be given by \[f(x0 - delta) - f(x0 + delta) / 2 * delta\] */ ~CubicLineSearch(); //search for the minimum model along a 1-D direction Param search(///initial model for the line search const Param& m0, ///search direction Vect& direction, /// product of search direction and gradient Real descent, ///a parameter double lambda); /* The parameter $lambda$ controls the accuraccy of the line search. $lambda = .25$ is a good choice. The minimizer along the search direction is returned by the function. */ // lambda=0.25 ou lambda=0.025 ??? // cf. CG.hpp }; template CubicLineSearch::CubicLineSearch(NRJ* f, int it) : LS(f) { this->iterMax = it; } template CubicLineSearch::CubicLineSearch(NRJ* f, int it, Vect* interval) : LS(f,interval) { this->iterMax = it; } template CubicLineSearch::~CubicLineSearch() {} // Code for the Cubic Line Search template typename CubicLineSearch::Param CubicLineSearch::search(const Param& current_solution, Vect& p, Real slope, double lambda){ int tst = 0; // useful vars Real alpha2=0, alpha_tmp=0, alpha_prev=0; Real alpha_prev2=0, alpha=0; Real f1=0, f2=0, fprev=0; Real a=0, b=0; Real c=0, cm11=0, cm12=0, cm21=0, cm22=0; Real disc=0; Real new_m=0, old_m=0; Param new_solution(current_solution); cout << " search " << p.max() << endl; assert(p.max() <1e100); old_m = this->nrj->getVal(current_solution); // Evaluation at the current solution this->iterNum = 0; this->iterNum++; // iteration counter alpha = 1.; // updating step new_solution = this->update(current_solution,1,alpha,p); // updating new_m = this->nrj->getVal(new_solution); // Evaluation at the // new solution this->iterNum++; // Implementing Goldstein's test for alpha too small while (new_m < old_m + (1. - lambda)*alpha*slope && this->iterNum< this->iterMax) { alpha *= 3; new_solution = this->update(current_solution,1, alpha, p); new_m = this->nrj->getVal(new_solution); this->iterNum++; } if (this->iterNum == this->iterMax) cerr << "Alpha overflowed! \n"; // Armijo's test for alpha too large alpha_prev = alpha; // H.L. Deng, 6/13/95 while (new_m > old_m + lambda*alpha*slope && this->iterNum < this->iterMax) { alpha2 = alpha * alpha; f1 = new_m - old_m - slope * alpha; if (tst == 0) { alpha_tmp = -slope * alpha2 / (f1 * 2.); // tentative alpha tst = 1; } else { alpha_prev2 = alpha_prev * alpha_prev; f2 = fprev - old_m - alpha_prev * slope; c = 1. / (alpha - alpha_prev); cm11 = 1. / alpha2; cm12 = -1. / alpha_prev2; cm21 = -alpha_prev / alpha2; cm22 = alpha / alpha_prev2; a = c * (cm11 * f1 + cm12 * f2); b = c * (cm21 * f1 + cm22 * f2); disc = b * b - 3. * a * slope; if ((Abs(a) > FLT_MIN) && (disc > FLT_MIN)) alpha_tmp = (-b + sqrt(disc)) / (3. * a); else alpha_tmp = slope * alpha2 / (2. * f1); if (alpha_tmp >= .5 * alpha) alpha_tmp = .5 * alpha; } alpha_prev = alpha; fprev = new_m; if (alpha_tmp < .1 * alpha) alpha *= .1; else alpha = alpha_tmp; new_solution = this->update(current_solution,1, alpha, p); new_m = this->nrj->getVal(new_solution); this->iterNum++; } if (this->iterNum == this->iterMax){ cerr << "Alpha underflowed! \n"; cerr << this->iterMax; } this->value = new_m; this->appendSearchNumber(); return (new_solution); // # of iterations } #endif freefem++-3.61-1/src/Algo/Param.hpp000644 000767 000024 00000010723 13256636774 017050 0ustar00hechtstaff000000 000000 // Class Param // C'est la classe des paramtres par rapport auxquels on optimise // Derive de la classe KN // On pourra ventuellement lui ajouter des contraintes #ifndef PARAM_HH #define PARAM_HH #include using namespace std; #include "defs.hpp" //#include "mvvtp.h" //#include "mvblas.h" // on a besoin du type Vect pour la fonction update template class Param: public KN { private: int ndim; // Ces bornes servent ventuellement dans la mthode update de LineSearch.hpp // C'est une manire d'implmenter le gradient projet... KN* maxParam; KN* minParam; public: Param(); //construct a continuous model with size n Param(int n); //construct a continuous model space with boundary and initial values Param(const KN& maxp, const KN& minp, const KN& initmod); //construct a continuous model space with boundary Param(const KN& maxp, const KN& minp); //construct a continuous model space with initial values Param(const KN& initmod); //operateur de copie Param(const Param& p); virtual ~Param(); Param& operator=(const Param&); KN* modMax() const; KN* modMin() const; void setModMax(const KN& v); void setModMin(const KN& v); //cf. Stroustrup page 612-613 pour l'implmentation de operator<< virtual ostream& toto(ostream&) const; private: // pas de copy }; // Constructors template Param::Param(void) :KN() { // cerr<<"Constructeur par dfaut Param"< Param::Param(int n) :KN(n) { // cerr<<"Constructeur 0 Param"< Param::Param(const KN& maxp, const KN& minp, const KN& initmod) :KN(initmod) { int ndim=initmod.size(); // cerr<<"Constructeur 1 Param"<(ndim); minParam = new KN(ndim); maxParam[0] = maxp; minParam[0] = minp; } template Param::Param(const KN& maxp, const KN& minp) :KN(Min(minp.size(),maxp.size())) { int ndim=Min(minp.size(),maxp.size()); // cerr<<"Constructeur 2 Param"<(ndim); minParam = new KN(ndim); maxParam[0] = maxp; minParam[0] = minp; } template Param::Param(const KN& initmod) :KN(initmod) { // cerr<<"Constructeur 3 Param"< Param::Param(const Param& p) :KN(p) { // cerr<<"Operateur de copie de Param"<(ndim); *maxParam=*(p.maxParam); } if ((p.minParam)==NULL) minParam=NULL; else{ minParam = new KN(ndim); *minParam=*(p.minParam); } } template Param& Param::operator=(const Param& p) { // cerr<<"Operateur = de Param"< & a1= *this; const KN & a2= p; a1=a2; // Operateur de copie de KN int ndim=p.size(); if ((p.maxParam)==NULL) maxParam=NULL; else{ if(maxParam) delete maxParam; maxParam = new KN(ndim); *maxParam=*(p.maxParam); } if ((p.minParam)==NULL) minParam=NULL; else{ if(minParam) delete minParam; minParam = new KN(ndim); *minParam=*(p.minParam); } return (*this); } template Param::~Param() { // cerr<<"Destructeur de Param"< KN* Param::modMax() const { return maxParam; } template KN* Param::modMin() const { return minParam; } template void Param::setModMax(const KN& v) { if (maxParam!=NULL) delete maxParam; maxParam= new KN(v); } template void Param::setModMin(const KN& v) { if (minParam!=NULL) delete minParam; minParam= new KN(v); } //cf. Stroustrup page 612-613 pour l'implmentation de operator<< template ostream& Param::toto (ostream& os) const { for (long i=0;i<(*this).size();i++) os << (*this)[i]<<" "; os< ostream& operator <<(ostream& os, const Param& d) { return d.toto(os); } #endif freefem++-3.61-1/src/Algo/Optima.hpp000644 000767 000024 00000004545 13256636774 017246 0ustar00hechtstaff000000 000000 #ifndef OPTIMA_HH #define OPTIMA_HH #include "NRJ.hpp" #include #include "defs.hpp" #define MAX_IT_OPT 1000 //================== //define the base class for optimization classes // H. Lydia Deng, 03/14/94 //====================== /* This is the base class for general optimization classes. Classes derived from this class inherit features of Optima. This class cannot be instantiated directly. */ // Attention : // pas de copie // pas d'oprateur = template class Optima { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef LS LineSearch; typedef list mlist; protected: // maximum number of iterations int iterMax; int iterNum; // tolerance error // c'est une tolrance sur la norme euclidienne du gradient Real tol; // mlist of residue mlist * residue; // pointer to LS LS * ls; // verbose or quiet int isVerbose; // the flag indicating if the search was a success int isSuccess; // append the new residue to the mlist void appendResidue(Real res); public: Optima(int verb=0); virtual ~Optima(); virtual Param optimizer(Param&) = 0; //Output residues int ifSuccess(); // residue of the last iteration Real finalResidue(); // residue of the first iteration Real firstResidue(); // residues of all iterations mlist allResidue(); // normalized residues of all iterations mlist normResidue(); }; template Optima::Optima(int verbose){ residue = new mlist; isVerbose = verbose; isSuccess = 0; ls = NULL; tol = 0.; iterMax = MAX_IT_OPT; } template Optima::~Optima() { if (residue!=NULL) delete residue; } //Output residues template int Optima::ifSuccess() {return isSuccess;} template typename Optima::Real Optima::finalResidue() {return residue->back();} template typename Optima::Real Optima::firstResidue() {return residue->front();} template typename Optima::mlist Optima::allResidue() {return *residue;} template typename Optima::mlist Optima::normResidue() {return normalize(*residue);} //cf. defs.hpp template void Optima::appendResidue(Real res) { (residue[0]).push_back(res); } #endif freefem++-3.61-1/src/Algo/LineSearch.hpp000644 000767 000024 00000014734 13256636774 020033 0ustar00hechtstaff000000 000000 #ifndef LINE_SEARCH_HH #define LINE_SEARCH_HH #include #include "defs.hpp" #include "NRJ.hpp" #include #include #define MAX_IT_LS 1000 /* This is the base class for one dimensional line search algorithms. Some optimization algorithms need to find the optimimal point on one searching directions. Classes derived from this class inherit features of LineSearch. This class cannot be used directly. */ // Attention : // pas de copie // pas d'oprateur = template class LineSearch { public: typedef R Real; typedef VM VMat; typedef M Mat; typedef P Param; typedef V Vect; typedef tNRJ NRJ; private: //ne sert que si on calcule le gradient de manire numrique //dans ce cas, on lui alloue de la mmoire //sinon, ce n'est qu'un pointeur vers le gradient de nrj Vect* grad; int ref; //ref vaut 1 quand on a cr le gradient de manire numrique void numericalGradient(const Param &); protected: //maxinum number of iterations allowed; int iterMax; //the number iterations so far // rinitialiser dans les classes drives int iterNum; //the history of number of iteration of iteration list* iterHistory; //the value at the minimum along the direction //mis a jour dans les classes derivees Real value; //the delta used for calculating numerical gradient // c'est du meme type que le gradient Vect* step; //pointer to the nrj NRJ * nrj; void appendSearchNumber(); public: //a constructor with pointer to the nrj and //to the step if numerical gradient is computed LineSearch(NRJ* f,Vect* interval = NULL); virtual ~LineSearch(); // point de dpart et direction de descente + des paramtres virtual Param search(const Param&, Vect&, Real, double); //compute the gradient Vector //C'est tjs le linesearch qui on demande le gradient dans la suite Vect* gradient(const Param& m); //C'est tjs le linesearch qui on demande le hessien dans la suite VMat* hessian(const Param& m); //evaluate the nrj; Real evaluate(const Param& m); //number of iterations for all line searches. list allSearchIterations(); //number of iterations in the current line search; int searchIterations(); // value of the objective function for the current Model Real currentValue(); Param update(const Param&,Real, Real, const Vect&) const; }; template LineSearch::LineSearch(NRJ* p, Vect* interval ) { iterMax = MAX_IT_LS; iterNum = 0; nrj = p; step = interval; iterHistory = new list; grad = NULL; ref=0; value=0.; } template LineSearch::~LineSearch(){ if (iterHistory!=NULL) delete iterHistory; if (ref==1 && grad!=NULL) delete grad; if (step!=NULL) delete step; } template void LineSearch::appendSearchNumber() { iterHistory[0].push_back(iterNum); } template list LineSearch::allSearchIterations() { return iterHistory[0];} template int LineSearch::searchIterations() {return iterNum;} template typename LineSearch::Real LineSearch::currentValue() {return value;} template typename LineSearch::Param LineSearch::search(const Param& m,Vect& v,Real alpha, double beta) { cerr << "You need to specify the LineSearch method!"< void LineSearch::numericalGradient(const Param& m) { int n = m.size(); // au premier appel, on initialise le gradient if (grad==NULL){ grad = new Vect(n); ref=1; } Real diffValue, newValue, off; Param m1(m); if (step!=NULL){ for (int i = 0; i < n; i++) { off = step[0][i]; m1[i] -= off; newValue = nrj->getVal(m1); m1[i] += 2*off; diffValue = nrj->getVal(m1); diffValue -= newValue; (*grad)[i] = diffValue/(2*off); m1[i] = m[i]; } } else{ // Par dfaut, on fait un pas de taille relative 10^-3 for (int i = 0; i < n; i++) { off = m[i]/1000; m1[i] -= off; newValue = nrj->getVal(m1); m1[i] += 2*off; diffValue = nrj->getVal(m1); diffValue -= newValue; (*grad)[i] = diffValue/(2*off); m1[i] = m[i]; } } } template typename LineSearch::Vect* LineSearch::gradient(const Param& m) { Vect* g; g=nrj->getGradient(m); if (g==NULL){ cerr<<"Undefined gradient for this NRJ function !"< typename LineSearch::VMat* LineSearch::hessian(const Param& m) { VMat* h; h=nrj->getHessian(m); if (h==NULL){ cerr<<"Hessien is undefined for this NRJ function !"< typename LineSearch::Real LineSearch::evaluate(const Param& m) { return nrj->getVal(m); } // on avance depuis alpha*m, m tant le point actuel dans la direction dmod, de beta // on vrifie qu'on est dans les bornes template typename LineSearch::Param LineSearch::update(const Param& m,Real alpha, Real beta, const Vect& dmod) const { Param newparam(m); long ndim=m.size(); Vect direction(dmod); if (direction.size() != ndim) { cerr << "Size of direction is different from dimensions." << endl; exit(1); } // check to see if the new model is out of the upper bound cout << "update "<< m.min() << " " << m.max() << " " << direction.max() << " " << dmod.max() ; direction = alpha * m + beta * direction; newparam = direction; cout << " ; "<< newparam.min() << " " << newparam.max() << endl; if ((m.modMax() != NULL) && (m.modMin() != NULL)) { for (long i=0; i0) newparam[i] = (*(m.modMax()))[i]; if ((newparam[i]-(*(m.modMin()))[i])<0) newparam[i] = (*(m.modMin()))[i]; } } return newparam; } #endif freefem++-3.61-1/src/Algo/Makefile.am000644 000767 000024 00000000543 13256636774 017332 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. EXTRA_DIST=BFGS.hpp BrentLS.hpp CG.hpp CubicLS.hpp defs.hpp lgalgo.cpp \ LineSearch.hpp NewtonRaphson.hpp NRJ.hpp Optima.hpp Param.hpp \ RosenBrock.hpp freefem++-3.61-1/src/Algo/NRJ.hpp000644 000767 000024 00000004267 13256636774 016447 0ustar00hechtstaff000000 000000 #ifndef NRJ_HH #define NRJ_HH #include "defs.hpp" // Attention : // pas de copie // pas d'oprateur = template class tNRJ{ protected: int nappel_val; int nappel_grad; int nappel_hess; int nparam; Real val; Vect* grad; Mat* hess; public: // Attention : dans le constructeur de l'tNRJ, il faut vraiment // initialiser grad ou hess, si on les utilise... Ce n'est pas // fait ici (parce que l'initialisation dpend trop du type) tNRJ(int); virtual ~tNRJ(); // preciser pour chaque fonction tNRJ virtual Real Val(const Param&) = 0; Real getVal(const Param&); // preciser ventuellement, sinon a rend nul virtual Vect* Gradient(const Param&); Vect* getGradient(const Param&); // preciser ventuellement, sinon a rend nul virtual Mat* Hessian(const Param&); Mat* getHessian(const Param&); int Appel_Val() const {return nappel_val;}; int Appel_Grad() const {return nappel_grad;}; int Appel_Hess() const {return nappel_hess;}; }; template tNRJ::~tNRJ() { if (grad!=NULL) delete grad; if (hess!=NULL) delete hess; } template tNRJ::tNRJ(int n) { nparam=n; nappel_val=0; nappel_grad=0; nappel_hess=0; grad = NULL; hess = NULL; val=0.; } template Real tNRJ::getVal(const Param& p) { nappel_val++; return Val(p); } template Vect* tNRJ::getGradient(const Param& p) { nappel_grad++; return Gradient(p); } template Vect* tNRJ::Gradient(const Param&) { return NULL; } template Mat* tNRJ::getHessian(const Param& p) { nappel_hess++; return Hessian(p); } template Mat* tNRJ::Hessian(const Param&) { return NULL; } #endif freefem++-3.61-1/src/Algo/BrentLS.hpp000644 000767 000024 00000022411 13256636774 017316 0ustar00hechtstaff000000 000000 //====================================================================== // Definition of the BrentLineSearch class // Brent's line search algorithm // author: Wenceslau Gouveia, Adapted from Numerical Recipes in C // Modified to fit into new classes. H. Lydia Deng, 02/21/94, 03/15/94 // Tony : cf. page 301 section 10.2 //======================================================================== // .B BrentLineSearch() // This routine, inpired by the Numerical Recipes book, performs a unidimensional search // for the minimum of the objective function along a specified direction. The minimum is // at first bracket using the Golden search procedure. After bracketing the Brent's // algorithm is used to isolate the minimum to a fractional precision of about the specified // tolerance. // // .SECTION Description // Public Operations // Constructors: // BrentLineSearch (ObjectiveFunction *f, int iter); // Here: // f: Define the objective function // iter: Maximum number of iterations // Methods: // model <> BrentLineSearch::search(Model& model0, Vector& direction, // double tol, double delta) // Here: // model0: Initial model to initiate the bracketing procedure // direction: Vector that defines the direction of the line search // tol: The minimum is within the returned this->value +/- tol // delta: Used in the bracketing procedure. The initial interval // for the bracketing is from 0 to delta * STEP_MAX, where // STEP_MAX is hard coded to 5. // // The sought minimum is returned by the function. // // .SECTION Caveats // This line search was not thoroughly tested. The CubicLineSearch procedure, that requires // certain derivative information on the objective function (that can be provided by numerical // methods) has demonstrated to be a more efficient line search procedure. // Cela me semble louche... cf. les commentaires BIZARRE ! // Ceci dit, le premiers tests semblent OK... #include "defs.hpp" #include #ifndef BRENT_LINE_SEARCH_HH #define BRENT_LINE_SEARCH_HH #include "LineSearch.hpp" #define CGOLD .3819660 #define ZEPS 1.e-10 #define GOLD 1.618034 #define STEP_MAX 5 #define GLIMIT 100. /* BrentLineSearch class was inpired by the Numerical Recipes book, performs an unidimensional search for the minimum of the objective function along a specified direction. The minimum is at first bracket using the Golden search procedure. After bracketing the Brent's algorithm is used to isolate the minimum to a fractional precision of about the specified tolerance. This line search was not thoroughly tested. The CubicLineSearch procedure, that requires certain derivative information on the objective function (that can be provided by numerical methods) has demonstrated to be a more efficient line search procedure. */ template class BrentLineSearch : public LS { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef typename LS::Mat Mat; typedef typename LS::NRJ NRJ; public: BrentLineSearch(NRJ* f, int iter); ~BrentLineSearch(); // Implementation of the Brent Search // search for minimum model along a 1-D direction Param search(///initial model to initiate the bracketing procedure Param& m0, ///the direction of the line search Vect& direction, ///the minimum is within the returned this->value +/- tol Real tol, ///a parameter used in the bracketing procedure double delta); /*The initial interval for the bracketing is from $0$ to $delta \times STEP\_MAX$, where $STEP\_MAX$ is hard coded to $5$. The sought minimum is returned by the function. */ //@ManMemo: search for minimum model along a 1-D direction }; template BrentLineSearch::BrentLineSearch(NRJ * f, int it) : LS(f) { this->iterMax = it; } template BrentLineSearch::~BrentLineSearch() {;} // Code for the BrentBrent line search template typename BrentLineSearch::Param BrentLineSearch::search(Param& model0,Vect& direction, Real tol, double delta) { this->iterNum = 0; KN steps(3); // brackets Vect of_values(3); // OF evaluated inside bracket Real dum; // auxiliary quantity Real r, q, ulim; // auxiliary quantity Real u, fu; // define the new bracket limit // Variables related to Brent's algorithm Real d, fv, fw, fx, p; // auxiliary variables double tol1, tol2, v, w, xm; // auxiliary variables double x, e = 0.,etemp; // auxiliary variables int i; // counter // Ajout Tony d=0; // Sinon, il n'est pas initialise : BIZARRE ! // Beggining of the bracketing stage steps[0] = 0.; steps[1] = STEP_MAX * delta; of_values[0]= this->nrj->getVal(model0); of_values[1] =this->nrj->getVal(update(model0,1,steps[1],direction)); this->iterNum += 2; if (of_values[1] > of_values[0]) { dum = steps[0]; steps[0] = steps[1]; steps[1] = dum; dum = of_values[0]; of_values[0] = of_values[1]; of_values[1] = dum; } steps[2] = steps[1] + GOLD * (steps[1] - steps[0]); of_values[2] = this->nrj->getVal(update(model0,1,steps[2],direction)); this->iterNum++; while (of_values[1] > of_values[2]) { r = (steps[1] - steps[0]) * (of_values[1] - of_values[2]); q = (steps[1] - steps[2]) * (of_values[1] - of_values[0]); u = steps[1] - ((steps[1] - steps[2]) * q - (steps[1] - steps[0]) * r) / (2. * Abs(Max(Abs(q - r), TINY)) / Sgn(q - r)); ulim = steps[1] + GLIMIT * (steps[2] - steps[1]); if ((steps[1] - u) * (u - steps[2]) > 0.) { fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum++; if (fu < of_values[2]) { steps[0] = steps[1]; steps[1] = u; of_values[0] = of_values[1]; of_values[1] = fu; break; } else if (fu > of_values[1]) { steps[2] = u; of_values[2] = fu; break; } u = steps[2] + GOLD * (steps[2] - steps[1]); fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum++; } else if ((steps[2] - u) * (u - ulim) > 0.) { fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum++; if (fu < of_values[2]) { steps[1] = steps[2]; steps[2] = u; u = steps[2] + GOLD * (steps[2] - steps[1]); of_values[1] = of_values[2]; of_values[2] = fu; fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum ++; } } else if ((u - ulim) * (ulim * steps[2]) >= 0.) { u = ulim; fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum ++; } else { u = steps[2] + GOLD * (steps[2] - steps[1]); fu = this->nrj->getVal(update(model0,1,u,direction)); this->iterNum ++; } steps[0] = steps[1]; steps[1] = steps[2]; steps[2] = u; of_values[0] = of_values[1]; of_values[1] = of_values[2]; of_values[2] = fu; } // Sorting STEPS in ascending order for (i = 0; i < 2; i++) { if (steps[0] > steps[i+1]) { dum = steps[0]; steps[0] = steps[i+1]; steps[i+1] = dum; dum = of_values[0]; of_values[0] = of_values[i+1]; of_values[i+1] = dum; } } if (steps[1] > steps[2]) { dum = steps[1]; steps[1] = steps[2]; steps[2] = dum; dum = of_values[1]; of_values[1] = of_values[2]; of_values[2] = dum; } // The line minimization will be performed now using as // bracket the 3 first steps given in vector steps // The algorithm is due to Brent // initializations x = w = v = steps[1]; fw = fv = fx = of_values[1]; for (; this->iterNum <= this->iterMax; this->iterNum++) { xm = .5 * (steps[0] + steps[2]); tol1 = tol * Abs(x) + ZEPS; tol2 = 2.0 * tol1; if (Abs(x - xm) <= (tol2 - .5 * (steps[2] - steps[0]))) { this->value = fx; Param new_model(update(model0,1,x,direction)); return new_model; } // minimum along a line if (Abs(e) > tol1) { r = (x - w) * (fx - fv); q = (x - v) * (fx - fw); p = (x - v) * q - (x - w) * r; q = 2.0 * (q - r); // Tony // ??? ERREUR ??? // dans le numerical recipe, c'est p=-p... // BIZARRE ! if (q > 0.){ cerr<<"BIZARRE BrentLS"<= Abs(.5 * q * etemp) || p <= q * (steps[0] - x) || p >= q * (steps[2] - x)) { // parabolic fit if (x >= xm) e = steps[0] - x; else e = steps[2] - x; d = CGOLD * e; } else { d = p / q; u = x + d; if (u - steps[0] < tol2 || steps[2] - u < tol2) d = Abs(tol1) / Sgn(xm-x); } } else { if (x >= xm) e = steps[0] - x; else e = steps[2] - x; d = CGOLD * e; } if (Abs(d) >= tol1) u = x + d; else u = x + Abs(tol1) / Sgn(d); fu = this->nrj->getVal(update(model0,1,u,direction)); if (fu <= fx) { if (u >= x) steps[0] = x; else steps[2] = x; v = w; w = x; x = u; fv = fw; fw = fx; fx = fu; } else { if (u < x) steps[0] = u; else steps[2] = u; if (fu <= fw || w == x) { v = w; w = u; fv = fw; fw = fu; } else if (fu <= fw || v == x || v == w) { v = u; fv = fu; } } } this->appendSearchNumber(); // cout << " Maximum number of iterations reached " << endl; Param new_model(update(model0,1,x,direction)); this->value = this->nrj->getVal(new_model); return new_model; } #endif freefem++-3.61-1/src/Algo/defs.hpp000644 000767 000024 00000004515 13256636774 016733 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef DEFS_H #define DEFS_H #ifndef GLIB #define GLIB #include #include #include #include #include //#include #include #include #include using namespace std; //#include "mvvtp.h" //#include "mvblas.h" #endif // DEFINE simple constants #ifndef Pi #define Pi (3.141592653589793) #endif #ifndef TINY // sert dans BrentLS et Matrix #define TINY 1.0e-20 #endif #ifndef True #define True (1) #endif #ifndef False #define False (0) #endif #ifndef Yes #define Yes (1) #endif #ifndef No #define No (0) #endif //Define some simple template functions #ifndef Sgn #define Sgn(x) ((x) < 0 ? -1.0 : 1.0) #endif #ifndef Abs #define Abs(x) ((x) < 0 ? -(x) : (x)) #endif #ifndef Max #define Max(x,y) ((x) > (y) ? (x) : (y)) #endif #ifndef Min #define Min(x,y) ((x) < (y) ? (x) : (y)) #endif #ifndef inValidSize #define inValidSize() cerr<<"Warning: incompatible sizes!"< void affiche(list l) { typename list::iterator il; for (il=l.begin();il!=l.end();il++) cout <<(*il)<<" "; cout< list normalize(list l) { list v(l); Type scale = l.front(); typename list::iterator il; if (scale == 0) { cerr << "First element is zero, cannot be normed! \n"; return v; } else { for (il=v.begin();il!=v.end();il++) *il /= scale; return v; } } #endif freefem++-3.61-1/src/Algo/CG.hpp000644 000767 000024 00000014644 13256636774 016307 0ustar00hechtstaff000000 000000 //============================= // Definition of the conjugate gradient class // Non-linear conjugate gradient algorithm // author: Wenceslau Gouveia // modified: H. Lydia Deng, 02/23/94, /03/14/94 //============================= // .NAME ConjugateGradient class // .LIBRARY Base // .HEADER Optimization Algorithms // .INCLUDE defs.hpp // .FILE CG.hpp // .SECTION Description // .B ConjugateGradient() // The conjugate gradient procedure implemented in this object is an extension of // the conjugate gradient used in linear system solving to handle non quadratic // objective functions. Such extensions amount basically to the inclusion of a // line search step and a modification in the computation of the conjugate directions. // Details can be found in the classic (and tough!) book Practical Optimization by // Powell. // // .SECTION Description // Public Operations // Constructors: // ConjugateGradient(LineSearch* ls, int iter, double tol) // Here: // ls: Defines the line search used. At the present version you should use the // CubicLineSearch procedure. // iter: Maximum number of iterations // tol: Minimum accepted module of the gradient at optimum solution // Methods: // Model<>ConjugateGradient::optimizer(Model&) // Here: // model0: Initial model for the conjugate gradient procedure. // // The optimum model is returned by the function. // // .SECTION Caveats // This procedure requires the derivatives of the objective function. At the present version the // COOOL library cannot handle analytic derivatives provided by the user. Here the derivatives // are computed numerically by a centered finite differencing scheme in a automatic fashion. // The hability to support user-provided derivatives will hopefully be // implemented in the near future. #ifndef CONJUGATE_GRADIENT_HH #define CONJUGATE_GRADIENT_HH #include "Optima.hpp" #include "defs.hpp" #include "Param.hpp" // Nonlinear Conjugate Gradient /* This conjugate gradient procedure implemented in this object is an extension of the conjugate gradient used in linear system solving to handle non quadratic objective functions. Such extensions amount basically to the inclusion of a line search step and a modification in the computation of the conjugate directions. Details can be found in the classic (and tough!) book Practical Optimization by Powell. */ template class ConjugateGradient : public Optima { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef LS LineSearch; public: // a constructor ConjugateGradient(///pointer to the line-search object. LS * ls, ///Maximum number of iterations int iter, ///minimum accepted gradient at optimum solution Real tol, ///vebose or quiet int verb=0); /* At the present version, you must use the CubicLineSearch procedure */ // a constructor ~ConjugateGradient(){;} // conjugate gradient search starting from m0, returns an optimum Model Param optimizer(Param& m0); }; template ConjugateGradient::ConjugateGradient(LS * p, int it, Real eps, int verb) : Optima(verb) { ls=p; iterMax = it; tol = eps; iterNum = 0; } // Necessite : // un produit scalaire sur Vect : (u,v) // un produit de Vect par un Real : operator* // un produit de Vect par un Real : operator*= // une diffrence de Vect : operator- template ConjugateGradient::Param ConjugateGradient::optimizer(Param& model0) { //reset the residue history for every new optimizer iterNum = 0; isSuccess = 0; if (residue != NULL) { delete residue; residue = new list; } int n = model0.size(); Param model1(model0); // new model Vect search(n); // search direction Vect g0(n); // old gradient vector Vect g1(n); // new gradient vector double beta; // beta parameter double lambda = .025; // line search parameter double descent = 0.; // descent direction // Beginning iterations g0 = *(ls->gradient(model0)); // check the gradient, in case the initial model is the optimal, Real err = (Real)sqrt((g0,g0)); if (isVerbose) cout << "Initial residue : " << err << endl; appendResidue(err); // residual if (err < tol) { if (isVerbose) cout << "Initial guess was great! \n"; isSuccess = 1; return model0; } // Considering first iteration search = -1. * g0; descent = (search,g0); // On utilise un CubicLineSearch // cerr<<"Line Search"<search(model0, search, descent, lambda); g1 = *(ls->gradient(model1)); // Gradient at new model err = (Real)sqrt((g1,g1)); if (isVerbose) cout << "Iteration (0) : " << "current value of the objective function: " << ls->currentValue() << "\t current residue: "<< err << endl; appendResidue(err); // residual iterNum = 0; Real temp; do { iterNum++; temp = 1./((g0,g0)); beta = ((g1-g0),g1); beta *= temp; // computation Polak & Ribiere search = beta * search - g1; // search direction descent = (search,g1); // descent if (descent > 0.) { if (isVerbose){ cout << "Reset search direction to gradient vector! \n"; } search = -1.*g1; descent = (search,g1); } model0 = model1; g0 = g1; // save the old model and gradient before new search // On utilise un CubicLineSearch // cerr<<"Line Search"<search(model0, search, descent, lambda); // line search g1 = *(ls->gradient(model1)); err = (Real)sqrt((g1,g1)); if (isVerbose) cout << "Iteration (" << iterNum << ") : "<<"current value of the nrj : " <currentValue() << "\t current residue : "<< err << endl; appendResidue(err); // residual } while (finalResidue() > tol && iterNum < iterMax); // stopping criterion if (finalResidue() <= tol) isSuccess = 1; return(model1); // hopefully answer } #endif freefem++-3.61-1/src/Algo/Makefile.in000644 000767 000024 00000042331 13321623167 017325 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/Algo ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = BFGS.hpp BrentLS.hpp CG.hpp CubicLS.hpp defs.hpp lgalgo.cpp \ LineSearch.hpp NewtonRaphson.hpp NRJ.hpp Optima.hpp Param.hpp \ RosenBrock.hpp 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Algo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Algo/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic 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 pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/Algo/BFGS.hpp000644 000767 000024 00000010257 13256636774 016533 0ustar00hechtstaff000000 000000 #ifndef BFGS_HH #define BFGS_HH #include "Optima.hpp" #include "defs.hpp" // BFGS Quasi-Newton Optimization Method /* At the present version, you must use the CubicLineSearch procedure */ // Necessite une "vraie" classe Matrice template class BFGS : public Optima { typedef typename LS::Real Real; typedef typename LS::Param Param; typedef typename LS::Vect Vect; typedef typename LS::VMat VMat; typedef typename LS::Mat Mat; typedef list mlist; public: BFGS(///pointer to the line-search object. LS* ls, ///Maximum number of iterations int iter, ///minimum accepted gradient at optimum solution Real tol, ///vebose or quiet int verb=0); ~BFGS(){;} // the BFGS search starting from model0, returns an optimum model Param optimizer(Param& model0); }; template BFGS::BFGS(LS* p, int it, Real eps, int verb) :Optima(verb) { this->ls=p; this->iterMax = it; this->tol = eps; this->iterNum = 0; } // Ncessite pour la classe MAT: // - un constructeur de matrice avec nbre de lig, nbre de col // - un constructeur de matrice avec la diagonale comme paramtre // - le produit matrice vecteur // - une mthode outProduct qui construit partir de 2 vecteurs u et v la matrice A_{i,j}=u(i)v(j) // - une mthode t() // - un oprateur + // - un oprateur = Real // - un oprateur = Vect template typename BFGS::Param BFGS::optimizer(Param& model0) { //reset the residue history for every new optimizer this->iterNum = 0; if (this->residue != NULL) { delete this->residue; this->residue = new mlist; } // Initial settings for some parameters int n = model0.size(); Vect g0(n); double lambda = 0.025; double descent = 0.; g0= *(this->ls->gradient(model0)); // check the gradient, in case the initial model is the optimal double err = (Real)sqrt((g0,g0)); if (this->isVerbose) cerr << "Initial residue : " << err << endl; this->appendResidue(err); // residual if (err < this->tol) { if (this->isVerbose) cerr << "Initial guess was great! \n"; this->isSuccess = 1; return model0; } //initial identical matrix for estimating inverse of the Hessian //Vect diag(n,1.); Mat H(n,n);H=0;diagonal(H)=1; Real d, dd, scale; Param model1(model0); Vect s(n),gamma(n),delta(n),g1(n); //searching directions s=Real(); s -= H*g0; descent = (s,g0); assert(s.max() <1e100); //cubic line search for a new model model1 = this->ls->search(model0, s, descent, lambda); g1 = *(this->ls->gradient(model1)); err = (Real)sqrt((g1,g1)); if (this->isVerbose) cerr << "Iteration (" << this->iterNum << ") : " <<"current value of the objective function: " <ls->currentValue() << "\t current residue: "<< err << endl; this->appendResidue(err); // residual this->iterNum ++; Mat B(n,n); while (this->finalResidue() > this->tol && this->iterNum < this->iterMax) { gamma = g1 - g0; delta = model1 - model0; //replace the searching direction with temporal storage s = H*gamma; //factor of the denominator dd = (delta,gamma); // Modif TONY // Au dpart, il y avait : if (dd < 0.00000001) // Mais Adel ne fait pas ce test non plus... if (Abs(dd)<1e-20) { // re-initialize the Hessian Matrix // Il faut d'abord le mettre a zero : cf. Matrix.hpp H = 0.; diagonal(H)=1.; } else { assert(dd); d = 1./dd; scale = d*((gamma,s)); scale += 1; scale *= d; // update the first term H += scale*delta*delta.t(); //update the second term H -= d*s*delta.t(); H -= d*delta*s.t(); //store the current model and gradient g0 = g1; model0 = model1; } s=Real(); s -= H*g0; descent = (s,g0); model1 = this->ls->search(model0, s, descent, lambda); g1 = *(this->ls->gradient(model1)); err = (Real)sqrt((g1,g1)); if (this->isVerbose) cerr << "Iteration (" << this->iterNum << ") : "<<"current value of the objective function: " <ls->currentValue() << "\t current residue: "<< err << endl; this->appendResidue(err); // residual this->iterNum ++; } return(model1); } #endif freefem++-3.61-1/src/femlib/mshptg.cpp000644 000767 000024 00000157315 13312446271 017652 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // -*- Mode : c++ -*- // // SUMMARY : mshptg mesh generator ( form mshptg.f / inria / emc2 software) // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // // /* 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 */ // bof bof FH je ne sais pas pourquoi nnnBAMG_LONG_LONG // nov 2005 j'ai corrige les problemes // il y avait un gros bug de le trie // overflow long car on calculais x*x + y*y // pour que cela tienne dans un long long // x*x + y*y < 2^63-1 => x et y < 2^31-1 // --- #include using namespace std; #ifdef BAMG_LONG_LONG #define LONG8 long long #define DLONG8LONG8 1.e17 #define MAXCOOR ((double) 1073741823)// 2^30-1=1073741823. ) #else #define LONG8 long #define DLONG8LONG8 1e9 #define MAXCOOR ((double) 32767. ) #endif #define DET8(a11,a12,a21,a22) ( (LONG8) (a11) * (LONG8) (a22) - (LONG8) (a21)* (LONG8) (a12)) #include #include #include namespace Fem2D { #define i_nint(x) ((long) x >= 0 ? x + 0.5 : x - 0.5) #define amin(a, b) ((a) < (b) ? (a) : (b)) #define amax(a, b) ((a) < (b) ? (b) : (a)) #define aabs(a) ((a) < 0 ? -(a) : (a)) static long nothing = -1073741824L; /***************************************************************************** I. Fabrique une triangulation (de nbsmax sommets maxi.) a partir de: -------------------------------------------------------------------- -cr: tableau de taille 2*nbs (abscisse & ordonnees des points en entree) -arete: tableau de taille 2*nba (depart & arrivee des aretes) (decrire le contour dans le sens direct: domaine a gauche des aretes exterieures) -h: tableau de taille nbs (precision relative aux points en entree) II. Alloue et affecte une structure t de type triangulation: ------------------------------------------------------------ -t.np: nombre de sommets en sortie -t.nt: nombre de triangles en sortie -t.rp[i].x:} abscisse t.rp[i].y:} & ordonnee du ieme point du maillage -t.tr[i][j]: numero du jeme point du ieme triangle du maillage III. Renvoie le type d'erreur: ------------------------------ - 0 : pas d'erreur -(-1): pas assez de memoire - >0 : erreur mshptg8_ mshptg erreurs 1: mshptg := 'le nb de point est < 3 or > que le nb max de point'; 2: mshptg := 'il y des points confondus '; 3: mshptg := 'tout les points sont align»s '; 7: mshptg := 'bug dans l''algorithme pour retrouver la frontiŸre (Internal Bug mshfrt)'; 8: mshptg := 'Une arte a forcer traverse trop de triangles (Internal Bug : mshfr1)'; 9: mshptg := 'la frontiŸre est crois»e '; 10: mshptg := 'il y a un point qui est sur une arte frontiŸre'; 11: mshptg := 'Un sous domaine est reference par aucun triangle '; 20: mshptg := 'mshopt: 3 points confondus (Internal Bug) '; 21: mshptg := 'la pile de mshopt est trop petit (Internal Bug)'; Remarque: penser a liberer les pointeurs t.rp et t.tr!!! --------- un tableau de taille N est indexe de 0 a N-1 les numeros affectes aux points et aux triangles commencent a 0 ******************************************************************************/ /* long MakeTriangulation (triangulation * t, long nbs, long nbsmax, long nba, double *crbdy, double *hbdy, long *arete, int *ngbdy, long *sd, long nbsd, int* flag, int fflag) { int i, j; long err = 0, nbt, nbsold = nbs; long *c = NULL; long *tri = NULL; long *nu = NULL; long *reft = NULL; int *ngg = NULL; double *cr = NULL; double *h = NULL; nbt = 2 * nbsmax; nu = new long[6*nbt]; c = new long[2*nbsmax]; ngg = new int[nbsmax]; tri = new long[(4 * nbsmax + 2 * nbsd)]; reft = new long[nbt]; cr = new double[(2 * nbsmax + 2)]; h = new double[nbsmax]; for (i = 0; i < 2 * nba; i++) arete[i]++; for (i = 0; i < nbs; i++) { ngg[i] = ngbdy[i]; cr[2 * i] = crbdy[2 * i]; cr[2 * i + 1] = crbdy[2 * i + 1]; h[i] = hbdy[i]; } for (i = nbs; i < nbsmax; i++) ngg[i] = 0; mshptg8_ (cr, h, c, nu, &nbs, nbsmax, tri, arete, nba, (long *) sd, nbsd, reft, &nbt, .25, .75, &err); for (i = 0; i < 2 * nba; i++) arete[i]--; if (err) goto L1; if (*flag) { delete [] t->rp;t->rp = NULL; delete [] t->tr;t->tr = NULL; delete [] t->ng;t->ng = NULL; delete [] t->ngt;t->ngt = NULL; } t->rp =new rpoint[nbs]; t->tr = new triangle[nbt]; t->ng = new int[nbs]; t->ngt = new int[nbt]; *flag = 1; t->np = nbs; t->nt = nbt; for (i = 0; i < nbt; i++) { for (j = 0; j < 3; j++) t->tr[i][j] = nu[3 * i + j] - 1; t->ngt[i] = reft[i] - 1; } for (i = 0; i < nbs; i++) { t->rp[i].x = cr[2 * i]; t->rp[i].y = cr[2 * i + 1]; if (i < nbsold) t->ng[i] = ngg[i]; else t->ng[i] = 0; } renum (t); if(!fflag) removeBdyT (t); L1: delete [] nu;nu = NULL; delete [] cr;cr = NULL; delete [] c;c = NULL; delete [] tri;tri = NULL; delete [] reft;reft = NULL; delete [] ngg;ngg = NULL; delete [] h;h = NULL; return err; } int verifietr (double *cr, int ns) { int i; double xh, diameter = 1.F; if (ns == 0) return -1; if (ns > 1) { diameter = 0.F; for (i = 0; i < ns; i++) diameter = amax (diameter, aabs (cr[2 * i] - cr[0]) + aabs (cr[2 * i + 1] - cr[1])); } else diameter = 0.001F; for (i = 0; i < ns; i++) { xh = aabs (cr[2 * i] - cr[2 * ns]) + aabs (cr[2 * i + 1] - cr[2 * ns + 1]); if (xh < 1e-5 * diameter) return i; } return -1; } */ int mshrgl_ (double *c, long *nrfs, long *nbs, long *nu, long *w1, long *w, double omega, long itermx, double eps); int mshopt_ (long *c, long *nu, long *t, long a, long *err); void mshvoi_ (long *nu, long *w1, long *w, long *nbt, long *nbs); int msha1p_ (long *t, long *s, long *c, long *nu, long *reft, long *tete, long *nbt, long *err); int mshtri_ (double *cr, long *c, long *nbs, long *tri, LONG8 *nu, double *trfri, long *err); int mshcxi_ (long *c, long *nu, long *tri, long *nbs, long *tete, long *err); int mshfrt_ (long *c, long *nu, long *nbs, long *arete, long nba, long *sd, long nbsd, long *reft, long *w, long *err); int mshgpt_ (long *c, double *cr, long *nu, double *h, long *reft, long *nbs, long nbsmx, long *nbt, double coef, double puis, double *trfri, long *err); long mshlcl_ (long *c, long *nu, long *tete, long *s); int mshtr1_ (LONG8 *criter, long *record, long *n); int mshcvx_ (long direct, long *c, long *nu, long *pfold, long *err); int mshfr1_ (long *c, long *nu, long *it1, long *ita, long *is1, long *s2, long *err); int mshfr2_ (long *c, long *nu, long *lst, long *nbac, long *t, long *ta, long *ss1, long *ss2, long *err); int mshptg8_ (double *cr, double *h, long *c, long *nu, long *nbs, long nbsmx, long *tri, long *arete, long nba, long *sd, long nbsd, long *reft, long *nbt, double coef, double puis, long *err) { /* System generated locals */ long i_1; /* Local variables */ static long tete, i, j, k, t; static double trfri[4]; static long nbsgrn, nbtgrn; /* ----------------------------------------------------------------------- */ /* but: construire une triangulation a partir d'un ensemble de */ /* points et d'un maillage frontalier */ /* ----------------------------------------------------------------------- */ /* entre : */ /* ------- */ /* cr(2,nbsmx) tableau des coordonnees des nbs points donnes */ /* h (nbsmx) tableau du h local voulu autour de chaque point */ /* donnes */ /* nbs nombre de points donnes */ /* nbsmx nombre de points maximal a cree */ /* si nbs = nbsmx ont ne cree pas de points */ /* si nbs < nbsmx => erreur */ /* arete(2,nba) tableau des aretes du maillage a forcer */ /* exemple :la frontiere */ /* nba le nombre d'aretes du maillage */ /* sd(2,nbsd) tableau definisant les nbsd sous domaine */ /* (reference des triangles gerener) */ /* abs(sd(1,i)) = numero d'une l'arete */ /* si sd(1,i) est positive alors le sous domaine */ /* est a gauche de l'arete sinon il est a droite */ /* sd(2,i) donne le numero du sous doimaine */ /* puis coefficient de generation des points */ /* .1 => on propage plus loin les rafinement */ /* donnes par h */ /* .25 => valeur conseillee */ /* coef coefficient sur le test arret */ /* le valeur conseillee est .75 */ /* remarque le nombre de point genere est en */ /* O(coef**2) */ /* tableaux de travail: */ /* -------------------- */ /* c(2,nbsmx) tableau d'entiers (copie de coordonnees) */ /* tri(ltri) tableau d'entiers */ /* out : */ /* ----- */ /* nbs nombre de points donnes + generes */ /* nbt nombre de triangles generes */ /* cr(1:2,nbs) coordonnees des sommets donnes + generes */ /* nu(1:3,nbt) sommets des triangles (tableau des connections) */ /* telle que les sommets tourne dans le sens direct */ /* reft(1:nbt) numero de sous domaine de chaque triangle */ /* err si err = 0 alors pas de probleme */ /* sinon nbt = 0 et pas de triangulation */ /* dimension des tableaux */ /* ---------------------- */ /* definition des parameters */ /* nbtmx = 2*(nbs-1) , ltri = max(4*nbs+2*nbsd,nba) */ /* long : nu(6*nbtmx) , reft(nbtmx) , c(2*nbsmx) , tri(ltri) */ /* long : arete(2,nba), sd(2,nbsd) */ /* double : cr(2*nbsmx) , h(nbsmx) */ /* ---------------------------------------------------------------------- */ /* programmeur F.Hecht, France */ /* version 1.0 mars 1986 */ /* ----------------------------------------------------------------------- */ /* Parameter adjustments */ --reft; sd -= 3; arete -= 3; --tri; --nu; c -= 3; --h; cr -= 3; /* Function Body */ *err = 0; *nbt = 0; if (*nbs < 3 || nbsmx < *nbs) { *err = 1; printf("mshptg bug in number of points %ld > %ld == max nb points \n",*nbs,nbsmx); return 0; } /* ------------------------- */ /* preparation des donnees */ /* ------------------------- */ mshtri_ (&cr[3], &c[3], nbs, &tri[1], (LONG8*) (void *) &tri[*nbs + 1], trfri, err); if (*err != 0) { return 0; } /* -------------------------------- */ /* maillage de l enveloppe convexe */ /* -------------------------------- */ mshcxi_ (&c[3], &nu[1], &tri[1], nbs, &tete, err); /* ----------------------------------------------------------------------- */ /* definition de tableau nu(1:6,2*nbs-2) */ /* ----------------------------------------------------------------------- */ /* nu(*,ie) definit soit un element ,soit un sommet frontiere */ /* si nu(5:6,ie) = (0,0) alors ie est un sommet frontiere */ /* avec nu(1,ie) = numero du sommet */ /* nu(2,ie) = 8*t + a */ /* ou t est le numero du triangle ayant l'arete */ /* frontiere (a) dont le premier sommet est nu(1,ie) */ /* nu(3,ie) = pointeur dans nu sur sommet frontiere precedent */ /* nu(4,ie) = pointeur dans nu sur sommet frontiere suivant */ /* sinon ie est un element : */ /* nu(1:3,ie) numero des 3 sommets du triangle ie tournant dans */ /* le sens direct */ /* nu(4:6,ie) = (d4,d5,d6) donnee des 3 aretes ai */ /* ai est forme des sommets nu(i-3,ie),nu(mod(i,3)+1,ie) */ /* si di < 0 alors arete i est frontiere et -di est pointeur */ /* sur 1er sommet frontiere de i */ /* sinon arete est interne et di = 8*ta + ata */ /* ou ta est le numero du triangle adjacent a l'arete */ /* et ata est le numero de l'arete dans ta */ /* ------------------------------------------------------------------------ */ if (*err != 0) { return 0; } i_1 = *nbs; for (i = 1; i <= i_1; ++i) { tri[i] = 0; } i = tete; L20: j = nu[(i - 1) * 6 + 4]; tri[nu[(i - 1) * 6 + 1]] = nu[(j - 1) * 6 + 1]; i = j; if (i != tete) { goto L20; } /* ----------------------------- */ /* traitement frontiere */ /* ----------------------------- */ k = 0; mshfrt_ (&c[3], &nu[1], nbs, &arete[3], nba, &sd[3], nbsd, &reft[1], &tri[ 1], err); if (*err != 0) { return 0; } /* ------------------------------------------------------------------- */ /* on a modifie nu les sommets frontiere n'ont plus de sens */ /* ainsi que les pointeurs sur ces elements */ /* ------------------------------------------------------------------- */ nbsgrn = *nbs; mshgpt_ (&c[3], &cr[3], &nu[1], &h[1], &reft[1], &nbsgrn, nbsmx, &nbtgrn, coef, puis, trfri, err); if (*err != 0) { return 0; } /* construction du tableau nu(1:3,1:nbt) */ /* ------------------------------------------ */ *nbt = 0; k = 0; j = 1; i_1 = nbtgrn; for (t = 1; t <= i_1; ++t) { if (nu[j + 5] != 0) { ++(*nbt); reft[*nbt] = reft[t]; for (i = 0; i <= 2; ++i) { ++k; nu[k] = nu[j + i]; } } j += 6; } /* dans nu il y a (s1(t),s2(t),s3(t),t=1,nbt) */ /* ou s1 s2 s3 sont les 3 sommets de t */ /* ------------------------------------------------ */ i_1 = *nbs; for (i = 1; i <= i_1; ++i) { tri[i] = 1; } i_1 = nbsgrn; for (i = *nbs + 1; i <= i_1; ++i) { tri[i] = 0; } mshvoi_ (&nu[1], &tri[nbsgrn + 1], &nu[*nbt * 3 + 1], nbt, &nbsgrn); mshrgl_ (&cr[3], &tri[1], &nbsgrn, &nu[1], &tri[nbsgrn + 1], &nu[*nbt * 3 + 1], 1.4F, 20L, .005F); *nbs = nbsgrn; return 1; } /* mshptg_ */ /* ********************************************************************** */ void mshvoi_ (long *nu, long *w1, long *w, long *nbt, long *nbs) { /* System generated locals */ long i_1; /* Local variables */ static long i, is; /* RECHERCHE DU VOISINAGE */ /* ----------------------- */ /* Parameter adjustments */ --w; --nu; /* Function Body */ i_1 = *nbs; for (i = 1; i <= i_1; ++i) { w1[i] = 0; } i_1 = *nbt * 3; for (i = 1; i <= i_1; ++i) { ++w1[nu[i]]; } w1[0] = 0; i_1 = *nbs; for (i = 1; i <= i_1; ++i) { w1[i] = w1[i - 1] + w1[i]; } i_1 = *nbt * 3; for (i = 1; i <= i_1; ++i) { is = nu[i] - 1; ++w1[is]; w[w1[is]] = i; } for (i = *nbs; i >= 1; --i) { w1[i] = w1[i - 1]; } w1[0] = 0; } /* mshvoi_ */ /* ********************************************************************** */ int mshrgl_ (double *c, long *nrfs, long *nbs, long *nu, long *w1, long *w, double omega, long itermx, double eps) { /* System generated locals */ long i_1, i_2, i_3; double r_1, r_2; /* Local variables */ static double depx, depy; static long iter; static double xmin, ymin, xmax, ymax; static long i, k, i1, i2, ic; static double bx, by, dx; static long is; static double err; /* REGULARISATION PAR MOYENNE BARYCENTRIQUE */ /* ----------------------------------------- */ /* Parameter adjustments */ --w; --nu; --nrfs; c -= 3; /* Function Body */ xmin = c[3]; ymin = c[4]; xmax = c[3]; ymax = c[4]; i_1 = *nbs; for (ic = 1; ic <= i_1; ++ic) { /* Computing MIN */ r_1 = c[(ic << 1) + 1]; xmin = amin (r_1, xmin); /* Computing MIN */ r_1 = c[(ic << 1) + 2]; ymin = amin (r_1, ymin); /* Computing MAX */ r_1 = c[(ic << 1) + 1]; xmax = amax (r_1, xmax); /* Computing MAX */ r_1 = c[(ic << 1) + 2]; ymax = amax (r_1, ymax); } /* Computing MAX */ r_1 = xmax - xmin, r_2 = ymax - ymin; dx = amax (r_1, r_2); i_1 = itermx; for (iter = 1; iter <= i_1; ++iter) { err = (double) 0.; i2 = w1[0]; i_2 = *nbs; for (is = 1; is <= i_2; ++is) { i1 = i2 + 1; i2 = w1[is]; if (i2 >= i1 && nrfs[is] == 0) { bx = (double) 0.; by = (double) 0.; i_3 = i2; for (i = i1; i <= i_3; ++i) { if (w[i] % 3 == 0) { k = w[i] - 2; } else { k = w[i] + 1; } bx += c[(nu[k] << 1) + 1]; by += c[(nu[k] << 1) + 2]; } bx /= i2 - i1 + 1; by /= i2 - i1 + 1; depx = omega * (c[(is << 1) + 1] - bx); depy = omega * (c[(is << 1) + 2] - by); c[(is << 1) + 1] -= depx; c[(is << 1) + 2] -= depy; /* Computing MAX */ r_1 = err, r_2 = aabs (depx), r_1 = amax (r_1, r_2), r_2 = aabs (depy); err = amax (r_1, r_2); } } /* -------------------------------- */ if (err <= eps * dx) { return 0; } } return 1; } /* mshrgl_ */ /* ********************************************************************** */ int mshgpt_ (long *c, double *cr, long *nu, double *h, long *reft, long *nbs, long nbsmx, long *nbt, double coef, double puis, double *trfri, long *err) { /* System generated locals */ long i_1; double r_1, r_2, r_3; double d_1, d_2, d_3, d_4, d_5, d_6, d_7, d_8; /* Local variables */ static double aire; static long tete; static long t; static double x, y; static long itera; static double h1, h2, h3; static long s1, s2, s3; static double hs; static long ix, iy, nbsold; static double det, pui; /* Parameter adjustments */ --trfri; --reft; --h; nu -= 7; cr -= 3; c -= 3; /* Function Body */ pui = puis; *nbt = (*nbs << 1) - 2; if (*nbs >= nbsmx) { /* ADD FH avril 2007 */ i_1 = *nbt; for (t = 1; t <= i_1; ++t) if (nu[t * 6 + 6] != 0) { mshopt_ (&c[3], &nu[7], &t, 4L, err); mshopt_ (&c[3], &nu[7], &t, 5L, err); mshopt_ (&c[3], &nu[7], &t, 6L, err); } /* FIN ADD FH vril 2007 */ return 0; } tete = 0; /* initialisation de la liste des triangles libre */ i_1 = *nbt; for (t = 1; t <= i_1; ++t) { if (nu[t * 6 + 6] == 0) { nu[t * 6 + 1] = tete; tete = t; } } itera = 0; L20: ++itera; nbsold = *nbs; i_1 = *nbt; for (t = 1; t <= i_1; ++t) { if (nu[t * 6 + 6] != 0) { s1 = nu[t * 6 + 1]; s2 = nu[t * 6 + 2]; s3 = nu[t * 6 + 3]; /* calcul de 2 fois l'aire du triangle */ det = (cr[(s2 << 1) + 1] - cr[(s1 << 1) + 1]) * (cr[(s3 << 1) + 2] - cr[(s1 << 1) + 2]) - (cr[(s2 << 1) + 2] - cr[(s1 << 1) + 2]) * (cr[(s3 << 1) + 1] - cr[(s1 << 1) + 1]); aire = det * coef; if (puis > (double) 0.) { d_2 = (double) h[s1]; d_3 = (double) pui; d_4 = (double) h[s2]; d_5 = (double) pui; d_6 = (double) h[s3]; d_7 = (double) pui; d_1 = (pow (d_2, d_3) + pow (d_4, d_5) + pow (d_6, d_7)) / (double) 3.; d_8 = (double) (1.F / pui); hs = (double)pow (d_1, d_8); } else if (puis > (double) -1.) { d_1 = (double) (h[s1] * h[s2] * h[s3]); hs = (double)pow (d_1, 1. / 3); } else if (puis > (double) -2.) { hs = h[s1] * (double) 3. *h[s2] * h[s3] / (h[s1] * h[s2] + h[ s1] * h[s3] + h[s2] * h[s3]); } else { /* Computing 2nd power */ r_1 = (double)sqrt (h[s1] * h[s2]); /* Computing 2nd power */ r_2 = h[s1] * h[s3]; /* Computing 2nd power */ r_3 = h[s2] * h[s3]; hs = (double)sqrt (3.0) * (h[s1] * h[s2] * h[s3] / (r_1 * r_1) + r_2 * r_2 + r_3 * r_3); } if (aire > hs * hs) { h1 = (double) 1.; h2 = (double) 1.; h3 = (double) 1.; x = (cr[(s1 << 1) + 1] * h1 + cr[(s2 << 1) + 1] * h2 + cr[(s3 << 1) + 1] * h3) / (h1 + h2 + h3); y = (cr[(s1 << 1) + 2] * h1 + cr[(s2 << 1) + 2] * h2 + cr[(s3 << 1) + 2] * h3) / (h1 + h2 + h3); r_1 = trfri[1] * (x - trfri[2]); ix = (long) i_nint (r_1); r_1 = trfri[1] * (y - trfri[3]) - trfri[4]; iy = (long) i_nint (r_1); if ((c[(s2 << 1) + 1] - ix) * (c[(s3 << 1) + 2] - iy) - (c[( s2 << 1) + 2] - iy) * (c[(s3 << 1) + 1] - ix) <= 0 || (ix - c[(s1 << 1) + 1]) * (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) - (iy - c[(s1 << 1) + 2]) * (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]) <= 0 || (c[(s2 << 1) + 1] - c[( s1 << 1) + 1]) * (iy - c[(s1 << 1) + 2]) - (c[(s2 << 1) + 2] - c[(s1 << 1) + 2]) * (ix - c[(s1 << 1) + 1]) <= 0) { } else { if (*nbs >= nbsmx) { return 0; } ++(*nbs); c[(*nbs << 1) + 1] = ix; c[(*nbs << 1) + 2] = iy; cr[(*nbs << 1) + 1] = ix / trfri[1] + trfri[2]; cr[(*nbs << 1) + 2] = (iy + trfri[4]) / trfri[1] + trfri[ 3]; h[*nbs] = hs; msha1p_ (&t, nbs, &c[3], &nu[7], &reft[1], &tete, nbt, err); if (*err != 0) { return 0; } } } } } if (nbsold != *nbs) { goto L20; } return 1; } /* mshgpt_ */ /* ********************************************************************** */ int msha1p_ (long *t, long *s, long *c, long *nu, long *reft, long *tete, long *nbt, long *err) { static long t1, t2, t3, ia2, ia3; static long ta2, ta3; // extern int mshopt_(); static long tta; /* Parameter adjustments */ --reft; nu -= 7; c -= 3; /* Function Body */ t1 = *t; if (*tete == 0) { ++(*nbt); t2 = *nbt; } else { t2 = *tete; *tete = nu[*tete * 6 + 1]; } if (*tete == 0) { ++(*nbt); t3 = *nbt; } else { t3 = *tete; *tete = nu[*tete * 6 + 1]; } nu[t2 * 6 + 1] = *s; nu[t2 * 6 + 2] = nu[*t * 6 + 2]; nu[t2 * 6 + 3] = nu[*t * 6 + 3]; nu[t2 * 6 + 4] = (t1 << 3) + 5; nu[t2 * 6 + 5] = nu[*t * 6 + 5]; nu[t2 * 6 + 6] = (t3 << 3) + 5; nu[t3 * 6 + 1] = nu[*t * 6 + 1]; nu[t3 * 6 + 2] = *s; nu[t3 * 6 + 3] = nu[*t * 6 + 3]; nu[t3 * 6 + 4] = (t1 << 3) + 6; nu[t3 * 6 + 5] = (t2 << 3) + 6; nu[t3 * 6 + 6] = nu[*t * 6 + 6]; tta = nu[*t * 6 + 5]; if (tta > 0) { ta2 = tta / 8; ia2 = tta - (ta2 << 3); nu[ia2 + ta2 * 6] = (t2 << 3) + 5; } tta = nu[*t * 6 + 6]; if (tta > 0) { ta3 = tta / 8; ia3 = tta - (ta3 << 3); nu[ia3 + ta3 * 6] = (t3 << 3) + 6; } nu[t1 * 6 + 3] = *s; nu[t1 * 6 + 5] = (t2 << 3) + 4; nu[t1 * 6 + 6] = (t3 << 3) + 4; reft[t2] = reft[*t]; reft[t3] = reft[*t]; mshopt_ (&c[3], &nu[7], &t1, 4L, err); if (*err != 0) { return 0; } mshopt_ (&c[3], &nu[7], &t2, 5L, err); if (*err != 0) { return 0; } mshopt_ (&c[3], &nu[7], &t3, 6L, err); if (*err != 0) { return 0; } return 1; } /* msha1p_ */ /* ********************************************************************** */ long mshlcl_ (long *c, long *nu, long *tete, long *s) { /* System generated locals */ long ret_val; /* Local variables */ static long init; static long x, y, pt, ppt; LONG8 det; /* Parameter adjustments */ nu -= 7; c -= 3; /* Function Body */ x = c[(*s << 1) + 1]; y = c[(*s << 1) + 2]; init = 1; pt = *tete; L10: ppt = pt; pt = nu[pt * 6 + 4]; if (pt != *tete) { det = (LONG8) x * (LONG8) c[(nu[pt * 6 + 1] << 1) + 2] - (LONG8) y * (LONG8) c[(nu[pt * 6 + 1] << 1) + 1]; if (det < 0) { init = 0; goto L10; } else if (init && det == 0) { goto L10; } } ret_val = ppt; return ret_val; } /* mshlcl_ */ /* ********************************************************************** */ int mshtri_ (double *cr, long *c, long *nbs, long *tri, LONG8 *nu, double *trfri, long *err) { /* System generated locals */ long i_1, i_2, i_3; double r_1; /* Local variables */ static long ierr, trik; static double xmin, ymin, xmax, ymax; static long i, j, k, ic, jc; // extern int mshtr1_(); static long ip, xx; static double aa1, aa2; static long iii, tri3; LONG8 det; /* Parameter adjustments */ --trfri; --nu; --tri; c -= 3; cr -= 3; /* Function Body */ ierr = 0; iii = 1; xmin = cr[3]; ymin = cr[4]; xmax = cr[3]; ymax = cr[4]; i_1 = *nbs; for (ic = 1; ic <= i_1; ++ic) { /* Computing MIN */ r_1 = cr[(ic << 1) + 1]; xmin = amin (r_1, xmin); /* Computing MIN */ r_1 = cr[(ic << 1) + 2]; ymin = amin (r_1, ymin); /* Computing MAX */ r_1 = cr[(ic << 1) + 1]; xmax = amax (r_1, xmax); /* Computing MAX */ r_1 = cr[(ic << 1) + 2]; ymax = amax (r_1, ymax); tri[ic] = ic; if (cr[(ic << 1) + 1] < cr[(iii << 1) + 1]) { iii = ic; } } aa1 = MAXCOOR / (xmax - xmin); aa2 = MAXCOOR / (ymax - ymin); aa1 = amin (aa1, aa2); aa2 = aa1 * (cr[(iii << 1) + 2] - ymin); trfri[1] = aa1; trfri[2] = cr[(iii << 1) + 1]; trfri[3] = ymin; trfri[4] = aa2; i_1 = *nbs; for (ic = 1; ic <= i_1; ++ic) { r_1 = aa1 * (cr[(ic << 1) + 1] - cr[(iii << 1) + 1]); c[(ic << 1) + 1] = (long) i_nint (r_1); r_1 = aa1 * (cr[(ic << 1) + 2] - ymin) - aa2; c[(ic << 1) + 2] = (long) i_nint (r_1); /* Computing 2nd power */ i_2 = c[(ic << 1) + 1]; /* Computing 2nd power */ i_3 = c[(ic << 1) + 2]; nu[ic] = (LONG8) i_2 * (LONG8) i_2 + (LONG8) i_3 * (LONG8) i_3; } /* ---------------------------------------------------------- */ mshtr1_ (&nu[1], &tri[1], nbs); ip = 1; xx = nu[ip]; i_1 = *nbs; for (jc = 1; jc <= i_1; ++jc) { if (nu[jc] > xx) { i_2 = jc - ip; mshtr1_ (&nu[ip], &tri[ip], &i_2); i_2 = jc - 2; for (i = ip; i <= i_2; ++i) { if (nu[i] == nu[i + 1]) { ++ierr; if (ierr <10) printf(" The points %ld and %ld are too close \n",tri[i],tri[i+1]); } } xx = nu[jc]; ip = jc; } ic = tri[jc]; nu[jc] = c[(ic << 1) + 2]; } i_1 = *nbs - ip; mshtr1_ (&nu[ip], &tri[ip], &i_1); i_1 = jc - 2; for (i = ip; i <= i_1; ++i) { if (nu[i] == nu[i + 1]) { if (ierr <10) printf(" The points %ld and %ld are to close \n",tri[i],tri[i+1]); ++ierr; } } if (ierr != 0) { *err = 2; printf("mshptg bug 2 \n"); return 0; } k = 2; L50: if (k <= *nbs) { ++k; det = (LONG8) c[(tri[2] << 1) + 1] * (LONG8) c[(tri[k] << 1) + 2] - (LONG8) c[(tri[2] << 1) + 2] * (LONG8) c[(tri[k] << 1) + 1]; if (det == 0) { goto L50; } } else { *err = 3; return 0; } /* k est le premier point non aligne */ trik = tri[k]; for (j = k - 1; j >= 3; --j) { tri[j + 1] = tri[j]; } tri[3] = trik; if (det < 0) { /* on inverse les points 2 3 tries */ tri3 = tri[3]; tri[3] = tri[2]; tri[2] = tri3; } return 1; } /* mshtri_ */ /* ********************************************************************** */ int mshtr1_ (LONG8 *criter, long *record, long *n) { /* System generated locals */ long i_1; /* Local variables */ long i, j, l, r, rec; LONG8 crit; /* trie selon les valeurs de criter croissantes */ /* record suit le reordonnancement */ /* Parameter adjustments */ --record; --criter; /* Function Body */ if (*n <= 1) { return 0; } l = *n / 2 + 1; r = *n; L2: if (l <= 1) { goto L20; } --l; rec = record[l]; crit = criter[l]; goto L3; L20: rec = record[r]; crit = criter[r]; record[r] = record[1]; criter[r] = criter[1]; --r; if (r == 1) { goto L999; } L3: j = l; L4: i = j; j <<= 1; if ((i_1 = j - r) < 0) { goto L5; } else if (i_1 == 0) { goto L6; } else { goto L8; } L5: if (criter[j] < criter[j + 1]) { ++j; } L6: if (crit >= criter[j]) { goto L8; } record[i] = record[j]; criter[i] = criter[j]; goto L4; L8: record[i] = rec; criter[i] = crit; goto L2; L999: record[1] = rec; criter[1] = crit; return 0; } /* mshtr1_ */ /* ********************************************************************** */ int mshcvx_ (long direct, long *c, long *nu, long *pfold, long *err) { static long t, a4, a5, i1, i2, i3, i4, i5, i6, s1, s2, s3, t4, t5, pf, pp, ps; // extern int mshopt_(); static long tt4, tt5, ppf, psf; LONG8 det; /* Parameter adjustments */ nu -= 7; c -= 3; /* Function Body */ if (direct) { pp = 3; ps = 4; i1 = 1; i2 = 3; i3 = 2; i4 = 6; i5 = 5; i6 = 4; } else { pp = 4; ps = 3; i1 = 1; i2 = 2; i3 = 3; i4 = 4; i5 = 5; i6 = 6; } L10: ppf = *pfold; pf = nu[ps + *pfold * 6]; psf = nu[ps + pf * 6]; s1 = nu[ppf * 6 + 1]; s2 = nu[pf * 6 + 1]; s3 = nu[psf * 6 + 1]; det = (LONG8) (c[(s2 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) - (LONG8) (c[(s2 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]); if ((!(direct) && det > 0) || (direct && det < 0)) { /* on ajoute un triangle t et on detruit une arete */ /* ----------------------------------------------- */ if (direct) { tt4 = nu[ppf * 6 + 2]; tt5 = nu[pf * 6 + 2]; } else { tt4 = nu[pf * 6 + 2]; tt5 = nu[psf * 6 + 2]; } t4 = tt4 / 8; t5 = tt5 / 8; a4 = tt4 - (t4 << 3); a5 = tt5 - (t5 << 3); /* destruction de l'arete frontiere en pf */ /* -------------------------------------- */ nu[ps + ppf * 6] = psf; nu[pp + psf * 6] = ppf; /* on remplace l'arete frontiere par l'element genere */ /* --------------------------------------------------- */ t = pf; /* update de l'arete non detruite */ /* ------------------------------ */ if (direct) { nu[ppf * 6 + 2] = (t << 3) + i6; } else { nu[psf * 6 + 2] = (t << 3) + i6; } /* on cree l'element */ /* ----------------- */ nu[i1 + t * 6] = s1; nu[i2 + t * 6] = s2; nu[i3 + t * 6] = s3; nu[i4 + t * 6] = (t4 << 3) + a4; nu[i5 + t * 6] = (t5 << 3) + a5; if (direct) { nu[i6 + t * 6] = -ppf; } else { nu[i6 + t * 6] = -psf; } nu[a4 + t4 * 6] = (t << 3) + i4; nu[a5 + t5 * 6] = (t << 3) + i5; mshopt_ (&c[3], &nu[7], &t5, a5, err); if (*err != 0) { return 0; } goto L10; } return 1; } /* mshcvx_ */ /* ********************************************************************** */ int mshcxi_ (long *c, long *nu, long *tri, long *nbs, long *tete, long *err) { /* System generated locals */ long i_1; /* Local variables */ static long sfree, ttaf, i, j, s, t, pf; // extern long mshlcl_(); // extern int mshcvx_(), mshopt_(); static long iaf, taf, npf, ppf, psf; /* initialisation de la sfree liste dans nu */ /* Parameter adjustments */ --tri; nu -= 7; c -= 3; /* Function Body */ i_1 = *nbs + *nbs - 2; for (i = 1; i <= i_1; ++i) { nu[i * 6 + 1] = i + 1; for (j = 2; j <= 6; ++j) { nu[j + i * 6] = 0; } } nu[(*nbs + *nbs - 2) * 6 + 1] = 0; sfree = 1; /* initialisation du premier triangle */ t = sfree; sfree = nu[sfree * 6 + 1]; /* initialisation de la liste frontiere */ *tete = sfree; pf = sfree; for (i = 1; i <= 3; ++i) { nu[i + t * 6] = tri[i]; nu[i + 3 + t * 6] = -pf; ppf = pf; sfree = nu[pf * 6 + 1]; pf = sfree; if (i == 3) { pf = *tete; } nu[ppf * 6 + 1] = tri[i]; nu[ppf * 6 + 2] = i + 3 + (t << 3); nu[ppf * 6 + 4] = pf; nu[pf * 6 + 3] = ppf; } i_1 = *nbs; for (i = 4; i <= i_1; ++i) { s = tri[i]; pf = mshlcl_ (&c[3], &nu[7], tete, &s); /* creation d'un nouveau triangle et modification de la frontiere */ /* -------------------------------------------------------------- */ t = sfree; sfree = nu[sfree * 6 + 1]; npf = sfree; sfree = nu[sfree * 6 + 1]; ppf = nu[pf * 6 + 3]; psf = nu[pf * 6 + 4]; ttaf = nu[pf * 6 + 2]; taf = ttaf / 8; iaf = ttaf - (taf << 3); /* npf */ /* 1 x s --- */ /* / \ --- */ /* 4 / \ 6 --- vide --- */ /* / t \ --- */ /* 2 / 5 \ 3 --- */ /* ------ --<---x---------x---------x- frontiere--<--- */ /* psf \ iaf / pf --- */ /* \ taf / --- omega --- */ /* \ / --- */ /* \ / --- */ /* x --- */ /* --- */ /* generation de l'element t */ nu[t * 6 + 1] = s; nu[t * 6 + 2] = nu[psf * 6 + 1]; nu[t * 6 + 3] = nu[pf * 6 + 1]; nu[t * 6 + 4] = -npf; nu[t * 6 + 5] = (taf << 3) + iaf; nu[t * 6 + 6] = -pf; nu[iaf + taf * 6] = (t << 3) + 5; /* update de la liste frontiere */ nu[npf * 6 + 4] = psf; nu[pf * 6 + 4] = npf; nu[npf * 6 + 3] = pf; nu[psf * 6 + 3] = npf; nu[npf * 6 + 1] = s; nu[npf * 6 + 2] = (t << 3) + 4; nu[pf * 6 + 2] = (t << 3) + 6; mshopt_ (&c[3], &nu[7], &t, 5L, err); if (*err != 0) { return 0; } mshcvx_ (1, &c[3], &nu[7], &npf, err); if (*err != 0) { return 0; } mshcvx_ (0, &c[3], &nu[7], &npf, err); if (*err != 0) { return 0; } } return 1; } /* mshcxi_ */ /* ********************************************************************** */ int mshopt_ (long *c, long *nu, long *t, long a, long *err) { /* Initialized data */ static long mod3[3] = {2, 3, 1}; /* System generated locals */ long i_1; double d_1; /* Local variables */ static long pile[4096] /* was [2][256] */ ; static double reel1, reel2; static double reel8; static long i, a1, a2, s1, t1, t2, s2, s3, s4, aa, i11, i12, i13, i21, i22, i23, tt; static long tt1; LONG8 cos1, cos2, sin1, sin2, sgn; int kerr21=0; /* Parameter adjustments */ nu -= 7; c -= 3; /* Function Body */ i = 1; pile[(i << 1) - 2] = *t; pile[(i << 1) - 1] = a; L10: if (i > 0) { t1 = pile[(i << 1) - 2]; a1 = pile[(i << 1) - 1]; --i; if (t1 <= 0) { goto L10; } tt1 = nu[a1 + t1 * 6]; if (tt1 <= 0) { goto L10; } t2 = tt1 / 8; a2 = tt1 - (t2 << 3); i11 = a1 - 3; i12 = mod3[i11 - 1]; i13 = mod3[i12 - 1]; i21 = a2 - 3; i22 = mod3[i21 - 1]; i23 = mod3[i22 - 1]; s1 = nu[i13 + t1 * 6]; s2 = nu[i11 + t1 * 6]; s3 = nu[i12 + t1 * 6]; s4 = nu[i23 + t2 * 6]; sin1 = (LONG8) (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[(s2 << 1) + 1] - c[(s1 << 1) + 1]) - (LONG8) (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[(s2 << 1) + 2] - c[(s1 << 1) + 2]); cos1 = (LONG8) (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[(s3 << 1) + 1] - c[(s2 << 1) + 1]) + (LONG8) (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[(s3 << 1) + 2] - c[(s2 << 1) + 2]); if (sin1 == 0 && cos1 == 0) { *err = 20; return 0; } /* b est la cotangente de angle (s1,s3,s2) */ sin2 = (LONG8) (c[(s4 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[(s2 << 1) + 2] - c[(s1 << 1) + 2]) - (LONG8) (c[(s4 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[(s2 << 1) + 1] - c[(s1 << 1) + 1]); // FH correct 6/11/2005 forgotted cast cos2 = (LONG8) (c[(s4 << 1) + 1] - c[(s2 << 1) + 1]) * (LONG8) (c[(s4 << 1) + 1] - c[(s1 << 1) + 1]) + (LONG8) (c[(s4 << 1) + 2] - c[(s2 << 1) + 2]) * (LONG8) (c[(s4 << 1) + 2] - c[(s1 << 1) + 2]); reel1 = (double) cos2 *(double) sin1; reel2 = (double) cos1 *(double) sin2; if (aabs (reel1) + aabs (reel2) >= (double ) DLONG8LONG8) { reel8 = (double) cos2 *(double) sin1 + (double) cos1 *(double) sin2; /* Computing MIN */ d_1 = amax (reel8, -1.); reel8 = amin (d_1, 1.); sgn = (LONG8) reel8; } else { sgn = cos2 * sin1 + cos1 * sin2; } /* Computing MIN */ i_1 = amin(amax (sgn, -1),1); // cout << sgn << " " << i_1 << endl; if ( i_1 * sin1 >= 0) { goto L10; } /* on inverse le quadrilatere */ /* update des sommets */ /* ------------------------- */ nu[i12 + t1 * 6] = s4; nu[i22 + t2 * 6] = s1; /* update des aretes a1,a2 */ /* ------------------------------- */ tt1 = nu[i22 + 3 + t2 * 6]; nu[a1 + t1 * 6] = tt1; if (tt1 > 0) { tt = tt1 / 8; aa = tt1 - (tt << 3); nu[aa + tt * 6] = a1 + (t1 << 3); } else if (tt1 != nothing) { nu[-tt1 * 6 + 2] = a1 + (t1 << 3); } tt1 = nu[i12 + 3 + t1 * 6]; nu[a2 + t2 * 6] = tt1; if (tt1 > 0) { tt = tt1 / 8; aa = tt1 - (tt << 3); nu[aa + tt * 6] = a2 + (t2 << 3); } else if (tt1 != nothing) { nu[-tt1 * 6 + 2] = a2 + (t2 << 3); } nu[i12 + 3 + t1 * 6] = i22 + 3 + (t2 << 3); nu[i22 + 3 + t2 * 6] = i12 + 3 + (t1 << 3); if (i + 4 > 2048) /* Modif F. H june 2015 */ { if(kerr21) cout << " Bizarre mshptg err 21 pile too small (continue) "<< endl; if(kerr21++<10000) goto L10; *err = 21; return 0; } ++i; pile[(i << 1) - 2] = t1; pile[(i << 1) - 1] = a1; ++i; pile[(i << 1) - 2] = t2; pile[(i << 1) - 1] = a2; ++i; pile[(i << 1) - 2] = t1; pile[(i << 1) - 1] = i13 + 3; ++i; pile[(i << 1) - 2] = t2; pile[(i << 1) - 1] = i23 + 3; goto L10; } return 1; } /* mshopt_ */ /* ********************************************************************** */ int mshfrt_ (long *c, long *nu, long *nbs, long *arete, long nba, long *sd, long nbsd, long *reft, long *w, long *err) { /* Initialized data */ static long p3[3] = {2, 3, 1}; /* System generated locals */ long i_1, i_2, i_3; /* Local variables */ static long nbac, ifrt, a, i, t, itera, s1, s2; // extern int mshfr1_(); static long ie, ap, ta, is, nbacpp; static long is1, ss1, s2t, s3t, isd, jsd, nbt, err1; LONG8 det2, det3; /* Parameter adjustments */ --w; --reft; sd -= 3; arete -= 3; nu -= 7; c -= 3; /* Function Body */ if (nba == 0) { return 0; } ifrt = 0; nbt = *nbs + *nbs - 2; i_1 = *nbs; for (i = 1; i <= i_1; ++i) { reft[i] = 0; } i_1 = nba; for (i = 1; i <= i_1; ++i) { reft[arete[(i << 1) + 1]] = nothing; reft[arete[(i << 1) + 2]] = nothing; } nbac = 0; i_1 = nba; for (a = 1; a <= i_1; ++a) { /* Computing MIN */ i_2 = arete[(a << 1) + 1], i_3 = arete[(a << 1) + 2]; s1 = amin (i_2, i_3); /* Computing MAX */ i_2 = arete[(a << 1) + 1], i_3 = arete[(a << 1) + 2]; s2 = amax (i_2, i_3); if (s1 == s2) { ++nbac; } else { i = reft[s1]; L25: if (i != nothing) { /* Computing MAX */ i_2 = arete[(i << 1) + 1], i_3 = arete[(i << 1) + 2]; if (s2 == amax (i_2, i_3)) { ++nbac; } else { i = w[i]; goto L25; } } else { w[a] = reft[s1]; reft[s1] = a; } } } nbacpp = 1; itera = 0; err1 = 0; L50: ++itera; if (err1 != 0) { *err = err1; return 0; } if (nbac < nba) { if (nbacpp == 0) { i_1 = *nbs; for (i = 1; i <= i_1; ++i) { a = reft[i]; L60: if (a > 0) { s1 = arete[(i << 1) + 1]; s2 = arete[(i << 1) + 2]; a = w[a]; goto L60; } } *err = 7; return 0; } /* --------------------------------------------------------------------- */ /* on s'occupe des aretes a forcer */ /* --------------------------------------------------------------------- */ nbacpp = 0; i_1 = nbt; for (ie = 1; ie <= i_1; ++ie) { if (nu[ie * 6 + 5] != 0) { for (is = 1; is <= 3; ++is) { s1 = nu[is + ie * 6]; s2t = nu[p3[is - 1] + ie * 6]; ss1 = amin (s1, s2t); ap = 0; a = reft[ss1]; L80: if (a > 0) { /* Computing MAX */ i_2 = arete[(a << 1) + 1], i_3 = arete[(a << 1) + 2]; s2 = amax (i_2, i_3); t = ie; ta = 0; if (s2 == amax (s1, s2t)) { if (nu[is + 3 + ie * 6] > 0) { ta = nu[is + 3 + ie * 6] / 8; i = nu[is + 3 + ie * 6] - (ta << 3); nu[i + ta * 6] = nothing; } nu[is + 3 + ie * 6] = nothing; goto L100; } ap = a; a = w[a]; goto L80; } if (itera == 1) { goto L110; } ss1 = s1; ap = 0; a = reft[ss1]; L90: if (a > 0) { /* Computing MAX */ i_2 = arete[(a << 1) + 1], i_3 = arete[(a << 1) + 2]; s2 = amax (i_2, i_3); t = ie; ta = 0; /* recherche si l' element coupe l''arete a */ is1 = is; s3t = nu[p3[p3[is - 1] - 1] + t * 6]; det2 = (LONG8) (c[(s2t << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) - (LONG8) (c[(s2t << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]); det3 = (LONG8) (c[(s3t << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) - (LONG8) (c[(s3t << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]); if (det2 > 0 && det3 < 0) { mshfr1_ (&c[3], &nu[7], &t, &ta, &is1, &s2, err); if (*err != 0) { printf(" Error %ld inforce edge %ld = %ld;%ld with vertices %ld %ld \n",*err,a,i_2, i_3, is1,s2 ); return 0; } goto L100; } else if (det2 == 0 && det3 < 0 && reft[s2t] == 0) { err1 = 10; printf(" det = %ld %ld %ld %ld %ld == %ld \n ", (c[(s2t << 1) + 1] - c[(s1 << 1) + 1]), (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) , (c[(s2t << 1) + 2] - c[(s1 << 1) + 2]), (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]) , (c[(s2t << 1) + 1] - c[(s1 << 1) + 1]) * (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) , (c[(s2t << 1) + 2] - c[(s1 << 1) + 2]) * (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]) ); printf("bug 2, mshptg: point %ld is on boundary edge %ld %ld \n",s2t,i_2,i_3); } else if (det2 > 0 && det3 == 0 && reft[s3t] == 0) { err1 = 10; printf(" det = %ld %ld %ld %ld %ld %ld \n ", (c[(s3t << 1) + 1] - c[(s1 << 1) + 1]), (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) , (c[(s3t << 1) + 2] - c[(s1 << 1) + 2]), (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]) , (c[(s3t << 1) + 1] - c[(s1 << 1) + 1]) * (c[( s2 << 1) + 2] - c[(s1 << 1) + 2]) , (c[(s3t << 1) + 2] - c[(s1 << 1) + 2]) * (c[( s2 << 1) + 1] - c[(s1 << 1) + 1]) ); printf("bug 2, mshptg: point %ld is on boundary %ld %ld\n",s3t,i_2,i_3); } ap = a; a = w[a]; goto L90; } goto L110; L100: ++nbacpp; if (ap == 0) { reft[ss1] = w[a]; } else { w[ap] = w[a]; } if (nbac + nbacpp == nba) { goto L130; } L110: ; } } } nbac += nbacpp; goto L50; } L130: /* ----------------------------------------------------------------------- */ /* prise en compte des sous domaines */ /* ----------------------------------------------------------------------- */ /* add FH si pas de nbsd --- jan 2004 */ if (nbsd<0) { i_1 = nbt; for (ie = 1; ie <= i_1; ++ie) { if (nu[ie * 6 + 1] > 0) { nu[ie * 6 + 1] = -nu[ie * 6 + 1]; } reft[ie]=1; } goto L205; // pas triangle retire } if (nbsd == 0) { long i__1 = nbt,nbssd,exter,i__,headt,nst,j; for (t = 1; t <= i__1; ++t) { reft[t] = -1073741824; } nbssd = 0; /* if(impre.gt.1) print *,'nbsd .eq. 0 => recherche de ssd' */ i__1 = nbt; for (t = 1; t <= i__1; ++t) { if (nu[t * 6 + 1] > 0 && nu[t * 6 + 5] != 0) { ++nbssd; exter = 0; i__ = 2; w[i__ - 1] = t; w[i__] = 3; reft[t] = 0; headt = t; nu[t * 6 + 1] = -nu[t * 6 + 1]; nst = 1; /* print *,' ssd ',nbssd */ L131: if (i__ > 0) { ++w[i__]; if (w[i__] <= 6) { ta = nu[w[i__] + w[i__ - 1] * 6]; if (ta <= 0) { if (ta != -1073741824) { exter = 1; } } else if (ta > 0) { ta /= 8; if (nu[ta * 6 + 1] > 0) { /* print *,ta */ nu[ta * 6 + 1] = -nu[ta * 6 + 1]; ++nst; reft[ta] = headt; headt = ta; w[i__ + 1] = ta; w[i__ + 2] = 3; i__ += 2; } } } else { i__ += -2; } goto L131; } if (exter) { --nbssd; i__ = headt; L133: if (i__ > 0) { j = reft[i__]; /* print *,i */ reft[i__] = 0; nu[i__ * 6 + 1] = 0; i__ = j; goto L133; } } else { i__ = headt; L136: if (i__ > 0) { j = reft[i__]; reft[i__] = nbssd; i__ = j; goto L136; } } } } goto L205; } /* fin ajoute FH jan 2004 */ i_1 = *nbs + nbsd + nbsd; for (i = 1; i <= i_1; ++i) { w[i] = 0; } i_1 = nbsd; for (i = 1; i <= i_1; ++i) { a = (i_2 = sd[(i << 1) + 1], aabs (i_2)); /* Computing MIN */ i_2 = arete[(a << 1) + 1], i_3 = arete[(a << 1) + 2]; s1 = amin (i_2, i_3); w[i + i] = w[s1 + nbsd + nbsd]; w[s1 + nbsd + nbsd] = i; } i_1 = nbt; for (t = 1; t <= i_1; ++t) { reft[t] = nothing; if (nu[t * 6 + 6] != 0) { for (i = 1; i <= 3; ++i) { /* Computing MIN */ i_2 = nu[i + t * 6], i_3 = nu[p3[i - 1] + t * 6]; ss1 = amin (i_2, i_3); jsd = nbsd + nbsd + ss1; L160: isd = w[jsd]; if (isd > 0) { a = sd[(isd << 1) + 1]; if (a > 0) { if (nu[i + t * 6] == arete[(a << 1) + 1] && nu[p3[i - 1] + t * 6] == arete[(a << 1) + 2]) { reft[t] = sd[(isd << 1) + 2]; w[isd + isd - 1] = t; w[jsd] = w[isd + isd]; goto L170; } } else if (a < 0) { if (nu[i + t * 6] == arete[(-a << 1) + 2] && nu[p3[i - 1] + t * 6] == arete[(-a << 1) + 1]) { reft[t] = sd[(isd << 1) + 2]; w[isd + isd - 1] = t; w[jsd] = w[isd + isd]; goto L170; } } else { cout << " Err sous domaine " << isd << "ref par d'arete +/- = " << a << " n'est dans aucun triangle " << endl; *err = 11; } jsd = isd + isd; goto L160; } L170: ; } } } i_1 = nbsd; for (isd = 1; isd <= i_1; ++isd) { if (w[isd + isd - 1] == 0) { cout << " Err sous domaine " << isd << "ref par d'arete +/- = " << sd[(isd << 1) + 1] << " n'est dans aucun triangle " << endl; *err = 11; } else { w[isd + isd] = 3; } } if (*err != 0) { return 0; } i = nbsd + nbsd; L200: if (i > 0) { ++w[i]; if (w[i] <= 6) { ta = nu[w[i] + w[i - 1] * 6]; if (ta > 0) { ta /= 8; if (nu[ta * 6 + 1] > 0) { nu[ta * 6 + 1] = -nu[ta * 6 + 1]; if (reft[ta] != reft[w[i - 1]]) { if (reft[ta] != nothing) { } else { reft[ta] = reft[w[i - 1]]; } w[i + 1] = ta; w[i + 2] = 3; i += 2; } } } } else { ta = w[i-1] ; if( nu[ta * 6 + 1]>=0) nu[ta * 6 + 1]= -nu[ta * 6 + 1]; // pour etre sur que le traingle est bien marque i += -2; } goto L200; } L205: i_1 = nbt; for (ie = 1; ie <= i_1; ++ie) { if (nu[ie * 6 + 1] < 0) { nu[ie * 6 + 1] = -nu[ie * 6 + 1]; } else { for (i = 1; i <= 6; ++i) { nu[i + ie * 6] = 0; } } } return 1; } /* mshfrt_ */ /* ********************************************************************** */ int mshfr1_ (long *c, long *nu, long *it1, long *ita, long *is1, long *s2, long *err) { /* Initialized data */ static long p3[5] = {2, 3, 1, 2, 3}; static long nbac, t, x, y, l1, l2, l3, s1, s3; // extern int mshfr2_(); static long la, ta; static long s2t, s3t, lst[768] /* was [3][256] */ ; LONG8 det; /* Parameter adjustments */ nu -= 7; c -= 3; /* Function Body */ t = *it1; s1 = nu[*is1 + t * 6]; x = c[(*s2 << 1) + 1] - c[(s1 << 1) + 1]; y = c[(*s2 << 1) + 2] - c[(s1 << 1) + 2]; nbac = 0; l1 = *is1; l2 = p3[l1 - 1]; l3 = p3[l2 - 1]; s2t = nu[l2 + t * 6]; s3t = nu[l3 + t * 6]; la = l2 + 3; L20: ++nbac; if (nbac > 256) { *err = 8; return 0; } lst[nbac * 3 - 2] = t; lst[nbac * 3 - 1] = la; ta = nu[la + t * 6]; if (ta <= 0) { *err = 9; long sa= nu[ (la+1)%3 + t * 6], sb=nu[(la+2)%3 + t * 6]; printf("mshptg: bug boundary crossing %ld,%ld , %ld %ld \n", s1, *s2 , sa,sb); return 0; } t = ta / 8; la = ta - (t << 3); s3 = nu[p3[la - 3] + t * 6]; if (s3 != *s2) { det = (LONG8) x * (LONG8) (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) - (LONG8) y * (LONG8) (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]); if (det > 0) { la = p3[la - 4] + 3; } else if (det < 0) { la = p3[la - 3] + 3; } else { printf("mshptg: bug the point %ld is on boundary \n", s3 ); *err = 10+s3*10; return 0; } goto L20; } mshfr2_ (&c[3], &nu[7], lst, &nbac, it1, ita, &s1, s2, err); return 0; } /* mshfr1_ */ /* ********************************************************************** */ int mshfr2_ (long *c, long *nu, long *lst, long *nbac, long *t, long *ta, long *ss1, long *ss2, long *err) { /* Initialized data */ static long mod3[3] = {2, 3, 1}; /* System generated locals */ long i_1; /* Local variables */ static long i, x, y, a1, a2, pplst, s1, pslst, ptlst, s2, s3, s4, ttlst, t1, t2, aa, i11, i12, i13, i21, i22, i23, x41, y41, tt; // extern int mshopt_(); static long tt1, aas; LONG8 det1, det2, det3, det4; /* Parameter adjustments */ lst -= 4; nu -= 7; c -= 3; /* Function Body */ x = c[(*ss1 << 1) + 1] - c[(*ss2 << 1) + 1]; y = c[(*ss1 << 1) + 2] - c[(*ss2 << 1) + 2]; i_1 = *nbac - 1; for (i = 1; i <= i_1; ++i) { lst[i * 3 + 1] = i + 1; } lst[*nbac * 3 + 1] = 0; ttlst = 1; L20: ptlst = ttlst; pplst = 0; L30: if (ptlst > 0) { t1 = lst[ptlst * 3 + 2]; a1 = lst[ptlst * 3 + 3]; tt1 = nu[a1 + t1 * 6]; t2 = tt1 / 8; a2 = tt1 - (t2 << 3); i11 = a1 - 3; i12 = mod3[i11 - 1]; i13 = mod3[i12 - 1]; i21 = a2 - 3; i22 = mod3[i21 - 1]; i23 = mod3[i22 - 1]; s1 = nu[i13 + t1 * 6]; s2 = nu[i11 + t1 * 6]; s3 = nu[i12 + t1 * 6]; s4 = nu[i23 + t2 * 6]; x41 = c[(s4 << 1) + 1] - c[(s1 << 1) + 1]; y41 = c[(s4 << 1) + 2] - c[(s1 << 1) + 2]; det2 = (LONG8) (c[(s2 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) y41 - (LONG8) (c[(s2 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) x41; det3 = (LONG8) (c[(s3 << 1) + 1] - c[(s1 << 1) + 1]) * (LONG8) y41 - (LONG8) (c[(s3 << 1) + 2] - c[(s1 << 1) + 2]) * (LONG8) x41; if (det2 > 0 && det3 < 0) { /* le quadrilataire est convexe on le retourne */ /* update des sommets */ /* ------------------------- */ nu[i12 + t1 * 6] = s4; nu[i22 + t2 * 6] = s1; /* update du pointeur suivant */ /* ----------------------------------- */ pslst = lst[ptlst * 3 + 1]; if (pslst > 0) { aas = lst[pslst * 3 + 3]; if (aas == i22 + 3) { lst[pslst * 3 + 2] = t1; lst[pslst * 3 + 3] = i11 + 3; } } /* update des aretes a1,a2 */ /* ------------------------------- */ tt1 = nu[i22 + 3 + t2 * 6]; nu[a1 + t1 * 6] = tt1; if (tt1 > 0) { tt = tt1 / 8; aa = tt1 - (tt << 3); nu[aa + tt * 6] = a1 + (t1 << 3); } else if (tt1 != nothing) { nu[-tt1 * 6 + 2] = a1 + (t1 << 3); } tt1 = nu[i12 + 3 + t1 * 6]; nu[a2 + t2 * 6] = tt1; if (tt1 > 0) { tt = tt1 / 8; aa = tt1 - (tt << 3); nu[aa + tt * 6] = a2 + (t2 << 3); } else if (tt1 != nothing) { nu[-tt1 * 6 + 2] = a2 + (t2 << 3); } nu[i12 + 3 + t1 * 6] = i22 + 3 + (t2 << 3); nu[i22 + 3 + t2 * 6] = i12 + 3 + (t1 << 3); det1 = (LONG8) (c[(s1 << 1) + 1] - c[(*ss1 << 1) + 1]) * (LONG8) y - (LONG8) (c[(s1 << 1) + 2] - c[(*ss1 << 1) + 2]) * (LONG8) x; det4 = (LONG8) (c[(s4 << 1) + 1] - c[(*ss1 << 1) + 1]) * (LONG8) y - (LONG8) (c[(s4 << 1) + 2] - c[(*ss1 << 1) + 2]) * (LONG8) x; if (det1 < 0 && det4 > 0) { /* le sommets s4 est dans omega */ lst[ptlst * 3 + 2] = t2; lst[ptlst * 3 + 3] = i22 + 3; } else if (det1 > 0 && det4 < 0) { /* le sommets s1 est dans omega */ lst[ptlst * 3 + 2] = t1; lst[ptlst * 3 + 3] = i12 + 3; } else { if (pplst == 0) { ttlst = lst[ptlst * 3 + 1]; ptlst = ttlst; } else { ptlst = lst[ptlst * 3 + 1]; lst[pplst * 3 + 1] = ptlst; } goto L30; } } pplst = ptlst; ptlst = lst[ptlst * 3 + 1]; goto L30; } if (ttlst != 0) { goto L20; } nu[i12 + 3 + t1 * 6] = nothing; nu[i22 + 3 + t2 * 6] = nothing; *t = t2; *ta = t1; i_1 = *nbac; for (i = 1; i <= i_1; ++i) { mshopt_ (&c[3], &nu[7], &lst[i * 3 + 2], 4L, err); mshopt_ (&c[3], &nu[7], &lst[i * 3 + 2], 5L, err); mshopt_ (&c[3], &nu[7], &lst[i * 3 + 2], 6L, err); } return 1; } /* mshfr2_ */ } freefem++-3.61-1/src/femlib/GQuadTree.hpp000644 000767 000024 00000017756 13256636774 020222 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : Generic Tree header (binairy, Quad, Oct) // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ namespace Fem2D { #include "R3.hpp" } namespace EF23 { using namespace Fem2D; using Fem2D::R; static const int MaxDeep = 30; typedef int IntQuad; static const IntQuad MaxISize = ( 1L << MaxDeep); static const IntQuad MaxISize1 = MaxISize-1; class Z1 { public: static bool INTER_SEG1d(int a,int b,int x,int y) { return (((y) > (a)) && ((x) <(b)));} int x; Z1():x(0){} Z1(R1 P) : x((int)P.x) {} Z1( int i) : x(i){} Z1(const Z1 &pp,int k,int l): x(pp.x+(( k&1) ? l : 0)) {} void Add(int k,int l) { x+= (( k&1) ? l : 0) ;} Z1(const Z1 &A,const Z1 &B) : x(B.x-A.x){} int Case(int l) const { return ( x & l)? 1 : 0 ;} int norm() const { return abs(x);} void Bound() { x = max(min(x,MaxISize1),0);} bool less(Z1 h) const { return abs(x) (a)) && ((x) <(b)));} int x,y; Z2():x(0),y(0) {} Z2(R2 P) : x((int)P.x),y((int)P.y) {} Z2( int i) : x(i),y(i){} //Z2( int i,int j) : x(i),y(j) {} Z2(const Z2 &pp,int k,int l): x(pp.x+(( k&1) ? l : 0)),y(pp.y+(( k&2) ? l : 0)) {} void Add(int k,int l) { x+= (( k&1) ? l : 0) ; y+= (( k&2) ? l : 0);} Z2(const Z2 &A,const Z2 &B) : x(B.x-A.x),y(B.y-A.y) {} int Case(int l) const { return ( ( y & l) ? (( x & l) ? 3 : 2 ) : ( ( x & l)? 1 : 0 ) ) ;} int norm() const { return Max(abs(x),abs(y));} void Bound() { x = max(min(x,MaxISize1),0); y = max(min(y,MaxISize1),0);} bool less(Z2 h) const { return abs(x) (a)) && ((x) <(b)));} int x,y,z; Z3():x(0),y(0),z(0) {} Z3(R3 P) : x((int)P.x),y((int)P.y),z((int) P.z) {} Z3( int i) : x(i),y(i),z(i){} Z3(const Z3 &pp,int k,int l): x(pp.x+(( k&1) ? l : 0)),y(pp.y+(( k&2) ? l : 0)),z(pp.z+(( k&4) ? l : 0)) {} void Add(int k,int l) { x+= (( k&1) ? l : 0) ; y+= (( k&2) ? l : 0); z+= (( k&4) ? l : 0);} Z3(const Z3 &A,const Z3 &B) : x(B.x-A.x),y(B.y-A.y),z(B.z-A.z) {} void Bound() { x = max(min(x,MaxISize1),0); y = max(min(y,MaxISize1),0); z = max(min(z,MaxISize1),0);} int Case(int l) const {// cout << " case = "<< int((x&l)!=0)+(int((y&l)!=0)<<1) + (int((z&l)!=0)<<2); return int( (x&l)!=0) + ( int((y&l)!=0)<<1 ) + ( int( (z&l)!=0) <<2 ) ;} int norm() const { return Max(abs(x),abs(y),abs(z));} bool less(Z3 h) const { return abs(x) struct Traits_Zd { typedef void Zd;}; template<> struct Traits_Zd { typedef Z1 Zd;}; template<> struct Traits_Zd { typedef Z2 Zd;}; template<> struct Traits_Zd { typedef Z3 Zd;}; template class GTree { typedef typename Vertex::Rd Rd; typedef typename Traits_Zd::Zd Zd; public: static const int d =Rd::d; static const int N = 1 << d; // N=2^(d-1) class QuadTreeBox { public: int n; // if n < 4 => Vertex else => QuadTreeBox; union { QuadTreeBox *b[N]; Vertex * v[N]; }; // void init() { for(int i=0;iSizeOf():0); } }; // end class StorageQuadTreeBox StorageQuadTreeBox * sb; int lenStorageQuadTreeBox; public: QuadTreeBox * root; // Mesh *th; int NbQuadTreeBoxSearch,NbVerticesSearch; int NbQuadTreeBox,NbVertices; Rd cMin,cMax; // box of QuadTree R coef; // Zd RdtoZd(const Rd &P) const {return Zd((Minc(Maxc(P,cMin),cMax)-cMin)*coef);} Zd VtoZd(const Vertex * v) const {return RdtoZd( (const Rd&) *v);} Zd VtoZd(const Vertex & v) const {return RdtoZd( (const Rd&) v);} Rd ZdtoRd(const Zd &I) const { return ( (Rd) I )/coef+cMin;} Vertex * NearestVertex(const Rd & P) { return NearestVertex(RdtoZd(P));} //XtoI(P.x),YtoJ(P.y));} Vertex * NearestVertexWithNormal(const Rd & P); Vertex * NearestVertex(Zd i2); Vertex * ToClose(const Rd & ,R ,Zd ); Vertex * ToClose(const Rd & P,R delta){ int hx = (int) (coef*delta); //if(verbosity > 5 ) cout << "hx=" << hx << " coef=" << coef << endl; return ToClose(P,delta,Zd(hx));} int SizeOf() const {return sizeof(GTree)+sb->SizeOf();} void Add( Vertex & w); QuadTreeBox* NewQuadTreeBox() { ///cout << "NewQuadTreeBox " << sb << " " << sb->bc << " " //<< sb->be << " " <bcbe)) sb=new StorageQuadTreeBox(lenStorageQuadTreeBox,sb); assert(sb && (sb->bc->n == 0)); NbQuadTreeBox++; return sb->bc++; } ~GTree(); GTree(Vertex * v,Rd Pmin,Rd Pmax,int nbv); GTree(); template friend ostream& operator <<(ostream& f, const GTree & qt); }; template const typename Mesh::Element * Find(const Mesh & Th, GTree *quadtree, typename Mesh::Rd P, typename Mesh::RdHat & Phat, bool & outside, const typename Mesh::Element * tstart); } // name space freefem++-3.61-1/src/femlib/mortar.cpp000644 000767 000024 00000020230 13256636774 017655 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2002 // -*- Mode : c++ -*- // // SUMMARY : Mortar model ( not used) // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include #include //#include //using namespace std; //introduces namespace std #include "RNM.hpp" #include "rgraph.hpp" #include "fem.hpp" #include "FQuadTree.hpp" inline int NbOfSubTriangle(int k) { assert(k>0); return k*k; } inline int NbOfSubInternalVertices(int k) { assert(k>0); int r= (k+2)*(k+1)/2; assert(r>=0); return r; } // for the mortar elements Mesh::Mesh(const Mesh & Th,int * split,bool WithMortar) { // routine complique // count the number of elements area=Th.area; BoundaryAdjacencesHead=0; BoundaryAdjacencesLink=0; BoundaryEdgeHeadLink=0; quadtree =0; NbMortars=0; mortars=0; TheAdjacencesLink =0; quadtree =0; bedges=0; neb =0; R2 Pmin,Pmax; Th.BoundingBox(Pmin,Pmax); nt=0; for (int i=0;i0 && split[it]<=64); // cout << " it = " <Add(*pV); nv++; } // end of new vertex vt[j]=number(pV); // triangles[kt].SetVertex(j,pV); } // for(int j=0;j<3;j++) // cout << kt << " " << n << endl; R2 A=vertices[vt[0]]; R2 B=vertices[vt[1]]; R2 C=vertices[vt[2]]; R a = (( B-A)^(C-A))*0.5; if (a>0) triangles[kt] = Triangle(vertices,vt[0],vt[1],vt[2],T.ref); else triangles[kt] = Triangle(vertices,vt[0],vt[2],vt[1],T.ref); } // end loop on all sub triangle } // end cout << " -- Nb of vertices " << nv << endl; cout << " -- Nb of triangle " << nt << endl; cout << " -- Nb of boundary edges " << neb << endl; // if (!WithMortar) { // long nba = neb; // long nbsd = 1; // bofbof // faux just pour un test long *sd; nbsd=1; sd=new long[2*nbsd]; sd[0]=-1; sd[1]=Th[0].ref; long nbs=nv; long nbsmax=nv; long err = 0, nbsold = nbs; long *c = 0; long *tri = 0; long *nu = 0; long *reft = 0; float *cr = 0; float *h = 0; long nbtmax = 2 * nbsmax; long * arete = new long[2*nba]; nu = new long[6*nbtmax]; c = new long[2*nbsmax]; tri = new long[(4 * nbsmax + 2 * nbsd)]; reft = new long[nbtmax]; cr = new float[(2 * nbsmax + 2)]; h = new float[nbsmax]; for(int i=0,k=0; i const int (* const GenericElement::nvface)[3] = 0 ; template<> const int (* const GenericElement::nvedge)[2] = 0 ; template<> const int (* const GenericElement::nvadj)[1] = 0 ; template<> const int (* const GenericElement::nvface)[3] = 0 ; template<> const int (* const GenericElement::nvedge)[2] = nvedgeSeg; //nvedgeTria ; template<> const int (* const GenericElement::nvadj)[1] = nvadjSeg ; template<> const int GenericElement::nitemdim[4] = {2,1,0,0 } ; template<> int GenericMesh::kfind=0; template<> int GenericMesh::kthrough=0; static const int onWhatIsVertex[2][3] = { {1,0,0}, // sommet 0 {0,1,0}}; // sommet 1 template<> const int (* const GenericElement::onWhatBorder)[3] = onWhatIsVertex ; Mesh1::Mesh1(const char * filename) { // read the mesh int nt,nv,nbe; int ok=0;//load(filename); if(ok) { ifstream f(filename); if(!f) {cerr << "Mesh1::Mesh1 Erreur openning " << filename<> nv >> nt >> nbe ; this->set(nv,nt,nbe); if(verbosity) cout << " -- Nb of Vertex " << nv << " " << " Nb of Seg " << nt << " , Nb of border Vertex " << nbe << endl; assert(f.good() && nt && nv) ; for (int i=0;i> this->vertices[i]; assert(f.good()); } mes=0; for (int i=0;it(i).Read1(f,this->vertices,nv); mes += t(i).mesure(); } mesb=0.; for (int i=0;ibe(i).Read1(f,this->vertices,nv); mesb += be(i).mesure(); } } BuildBound(); BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); if(verbosity) cout << " - mesh mesure = " << mes << " border mesure: " << mesb << endl; } } freefem++-3.61-1/src/femlib/splitsimplex.cpp000644 000767 000024 00000026027 13256636774 021120 0ustar00hechtstaff000000 000000 // used by splitsimplex.cpp // ---- build a the simplex decomposition /* template void SplitSimplex(int N,int & nv, R1 *& P, int & nk , int *& K); template void SplitSimplex(int N,int & nv, R2 *& P, int & nk , int *& K); template void SplitSimplex(int N,int & nv, R3 *& P, int & nk , int *& K); $: */ // // // ORIG-DATE: fev 2009 // -*- Mode : c++ -*- // // SUMMARY : Model mesh 2d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include #include #include "ufunction.hpp" using namespace std; namespace Fem2D { #include "R3.hpp" }; using Fem2D::R1; using Fem2D::R2; using Fem2D::R3; extern long verbosity ; #include "splitsimplex.hpp" /* construction an array of sub simplex for plot ... see last template function SplitSimplex(N,nv,P,nk,K); N > 1 -> classical split un N^d sub simplex nv : number of point on */ // d = 1 trivial void SplitSimplex(int N,R1 *P,int *K,int op=0,R1 *AB=0) { assert(N>0); double h = 1./ N; for(int i=0;i<=N;++i) if(AB) P[i+op] = R1(i*h).Bary(AB); else P[i+op] = R1(i*h); for(int i=0;i " << i << " " << j << endl; assert( n == NumSimplex2(i,j)); } inline void invNumSimplex3(int n,int &i,int &j,int &k) { int l= invNumSimplex3(n); //=( i+j+k) invNumSimplex2(n-NumSimplex3(l),j,k); i=l-k-j; // cout << n << " " << l << "-> " << i << " " << j << " " << k <0); int nv = (N+1)*(N+2)/2; double h=1./N; // loop sur les diag i+j = k // num ( i+j,j) lexico croissant for(int l=0;ln) n8[l]=-1; } for (int l=0;l199) { cout << " SplitSimplex " << endl; for (int i=0,l=0;i200) cout << "face i=0" << endl; for (int i=0;i200) cout << "l="<< l/3 << " "<< tri[l-3] <<" "<< tri[l-2] <<" "<< tri[l-1] <<" "<< endl; } // face j=0 if(verbosity>200) cout << "face j=0" << endl; for (int i=0;i200) cout << "l="<< l/3 << " "<< tri[l-3] <<" "<< tri[l-2] <<" "<< tri[l-1] <<" "<< endl; } // face k=0 if(verbosity>200) cout << "face k=0" << endl; for (int i=0;i200) cout << "l="<< l/3 << " "<< tri[l-3] <<" "<< tri[l-2] <<" "<< tri[l-1] <<" "<< endl; } // face i+j+k=1 if(verbosity>200) cout << "dernier face " << endl; for (int k=0;k200) cout << "l="<< l/3 << " "<< tri[l-3] <<" "<< tri[l-2] <<" "<< tri[l-1] <<" "<< endl; } if(verbosity>200) cout << "l= " << l << " ntri=" << ntri << endl; assert( l == ntri); } /* void SplitSimplex(int N,int & nv, R1 *& P, int & nk , int *& K) { typedef R1 Rd; const int d = Rd::d; int cas = (N>0) ? 1 : d+1; N=abs(N); assert(N); int nv1=(N+1); int nk1= N; nv = cas*nv1; nk = cas*nk1; P = new Rd[nv]; K = new int [nk*(d+1)]; if( cas ==1) SplitSimplex( N, P,K) ; else { Rd AB1[2]= { Rd(0),Rd(0.5)}; SplitSimplex( N, P,K,0,AB1) ; Rd AB2[2]= { Rd(0.5),Rd(1)}; SplitSimplex( N, P,K+nk1,nv1,AB2); } } void SplitSimplex(int N,int & nv, R2 *& P, int & nk , int *& K) { typedef R2 Rd; const int d = Rd::d; int cas = (N>0) ? 1 : d+1; assert(N); N=abs(N); int nv1=N*(N+1)/2; int nk1= N*N; nv = cas*nv1; nk = cas*nk1; P = new Rd[nv]; K = new int [nk*(d+1)]; if( cas ==1) SplitSimplex( N, P,K); else { Rd G=Rd::diag(1./(d+1)); R2 Khat[d+1]; for (int i=0;i void SplitSimplex(int N,int & nv, Rd *& P, int & nk , int *& K) { const int d = Rd::d,d1 =d+1; int cas = (N>0) ? 1 : d+1; assert(N); N=abs(N); int nv1=N+1; // nb simplexe int nk1=N; // nb vertices for(int i=2;i<=d;++i) { nk1 *=N; nv1 = (nv1)*(N+i)/i; } nv = cas*nv1; nk = cas*nk1; P = new Rd[nv]; // no bug correct jan 2024 FH (thank to OP) K = new int[nk*d1]; // no bug correct jan 2024 FH (thank to OP) if( cas ==1) SplitSimplex( N, P,K); else { Rd G=Rd::diag(1./(d1)); for(int i=0;i<=d;++i) { Rd Khat[d+1]; for (int j=1;j<=d;++j) Khat[j][j-1]=1;// bug correct jan 2024 FH (thank to OP) Khat[i]=G; SplitSimplex( N, P,K+(nk1*d1)*i,nv1*i,Khat); // FH no recursion here ... } } if(verbosity>99) { cout << "SplitSimplex : nv =" << nv << " nk :" << nk << " " << N << endl ; for(int i=0; i< nv ; ++i) cout << i << " / " << P[i] << endl; for(int k=0,kk=0; k < nk; ++k) { cout << k << " " << kk << " : "; for(int m=0;m(int N,int & nv, R1 *& P, int & nk , int *& K); template void SplitSimplex(int N,int & nv, R2 *& P, int & nk , int *& K); template void SplitSimplex(int N,int & nv, R3 *& P, int & nk , int *& K); /* int main(int argc,const char ** argv) { R3 *P; int *K,nv,nk; int N=2; if(argc>1) N=atoi(argv[1]); SplitSimplex(N,nv,P,nk,K); cout << P << " " << K << endl; cout << N << " nv " << nv << " nk =" << nk << endl; for(int i=0;i #include #include #include "libmesh5.h" #include "ufunction.hpp" #include "error.hpp" #include "RNM.hpp" namespace Fem2D { } #include "Mesh2dn.hpp" #include "Mesh3dn.hpp" #include "rgraph.hpp" #include "fem.hpp" #include "PlotStream.hpp" namespace Fem2D { /* const short int v_tet_face[4][3]= {{3,2,1},{0,2,3},{ 3,1,0},{ 0,1,2}}; const short int a_tet_face[4][3]= {{ 0,1,0},{ 0,2,0},{ 0,3,1},{ 1,2,1}}; const bool sig_tet_face[4][3]= {{ 0,1,0},{ 1,0,1},{ 0,1,0},{ 1,0,1}}; const short int v_tet_edge[6][2]= {{ 1,2},{1,3},{1,4},{2,3},{2,4},{3,4}}; const short int fadj_tet_edge[6][2]= {{4,3},{2,4},{3,2},{4,1},{1,3},{2,1}}; const short int op_tet_edge[6]={ 6, 5, 4, 3, 2, 1}; */ // Attention nvfaceTet donnne les faces les 4 faces de tet telle que la // tel que le tet forme des trois sommet + l'autre sommet soit positif. // donc le produit vectoriel des 2 aretes (0,1) (0,2) donne une normale interieur. // Ok pour les gradients des $\lambda_i$ static const int nvfaceTet[4][3] ={{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}} ;//{ {2,1,3},{0,2,3},{1,0,3},{0,1,2} }; static const int nvedgeTet[6][2] = { {0,1},{0,2},{0,3},{1,2},{1,3},{2,3} }; static const int nvfaceTria[1][3] = { {0,1,2} }; static const int nvedgeTria[3][2] = { {1,2},{2,0},{0,1}}; static const int nvfaceSeg[1][3] = {{-1,-1,1}}; static const int nvedgeSeg[1][2] = { {0,1} }; template<> const int (* const GenericElement::nvface)[3] = nvfaceTria ; template<> const int (* const GenericElement::nvedge)[2] = nvedgeTria ; template<> const int (* const GenericElement::nvadj)[2] = nvedgeTria ; template<> const int GenericElement::nitemdim[4] = {3,3,1,0 } ; static const int onWhatIsEdge3[3][7] = { {0,1,3, 2,0,0, 0}, // edge 0 {3,0,1, 0,2,0, 0}, {1,3,0, 0,0,2, 0} }; template<> const int (* const GenericElement::onWhatBorder)[7] = onWhatIsEdge3 ; template<> const int (* const GenericElement::nvface)[3] = nvfaceTet ; template<> const int (* const GenericElement::nvedge)[2] = nvedgeTet ; template<> const int (* const GenericElement::nvadj)[3] = nvfaceTet ; template<> const int GenericElement::nitemdim[4] = {4,6,4,1 } ; int onWhatIsFace[4][15] ; typedef const int (*const PtrConst15int) [15]; // a pointeur on const arry of 15 int. (to help xcode) // static const int (* const SetonWhatIsFace(int onWhatIsFace[4][15] ,const int nvfaceTet[4][3],const int nvedgeTet[6][2]))[15]; static PtrConst15int SetonWhatIsFace(int onWhatIsFace[4][15] ,const int nvfaceTet[4][3],const int nvedgeTet[6][2]); template<> const int (* const GenericElement::onWhatBorder)[15] = SetonWhatIsFace(onWhatIsFace,nvfaceTet,nvedgeTet) ; template<> int GenericMesh::kfind=0; template<> int GenericMesh::kthrough=0; // const int (* const SetonWhatIsFace(int onWhatIsFace[4][15] ,const int nvfaceTet[4][3],const int nvedgeTet[6][2]))[15] PtrConst15int SetonWhatIsFace(int onWhatIsFace[4][15] ,const int nvfaceTet[4][3],const int nvedgeTet[6][2]) { for(int i=0;i<15;++i) for(int j=0;j<4;++j) onWhatIsFace[j][i]=0; for(int j=0;j<4;++j) for(int i=0;i<3;++i) onWhatIsFace[j][nvfaceTet[j][i]]=1; for(int j=0;j<4;++j) { onWhatIsFace[j][j+4+6]=3; int ff[]={0,0,0,0}; int jo=1+2+3-nvfaceTet[j][0]-nvfaceTet[j][1]-nvfaceTet[j][2]; ff[jo]=1; for(int i=0;i<6;++i) if(ff[nvedgeTet[i][0]]+ff[nvedgeTet[i][1]]==0) onWhatIsFace[j][i+4]=2; } if(0) for(int j=0;j<4;++j) { for(int i=0;i<15;++i) cout << onWhatIsFace[j][i] << " "; cout << endl; } return onWhatIsFace; } void Add(int *p,int n,int o) { for(int i=0;i2) cout << " -- Mesh3: Read On file \"" < 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>2) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(verbosity) cout << " -- Mesh3 : "<=0); // add F. Hecht sep 2009. } // Add by J. Morice 11/10 // compute the hmin in a 3d mesh // Remark: on peut le mettre dans generic mesh // (attention aux boucles sur les arrtes) double Mesh3::hmin() const{ R3 Pinf(1e100,1e100,1e100),Psup(-1e100,-1e100,-1e100); // Extremit de la bote englobante double hmin=1e10; for (int ii=0;ii< this->nv;ii++){ R3 P( vertices[ii].x, vertices[ii].y, vertices[ii].z); Pinf=Minc(P,Pinf); Psup=Maxc(P,Psup); } for (int k=0;knt;k++){ for (int e=0;e<6;e++){ if( this->elements[k].lenEdge(e) < Norme2(Psup-Pinf)/1e9 ) { const Tet & K(this->elements[k]); int iv[4]; for(int jj=0; jj <4; jj++){ iv[jj] = this->operator()(K[jj]); } for (int eh=0;eh<6;eh++){ if(verbosity>2) cout << "tetrahedra: " << k << " edge : " << eh << " lenght "<< this->elements[k].lenEdge(eh) << endl; } if(verbosity>2) cout << " A tetrahedra with a very small edge was created " << endl; return 1; } hmin=min(hmin,this->elements[k].lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } for (int k=0;knbe;k++){ for (int e=0;e<3;e++){ if( this->be(k).lenEdge(e) < Norme2(Psup-Pinf)/1e9 ) { for (int eh=0;eh<3;e++){ cout << "triangles: " << k << " edge : " << eh << " lenght "<< this->be(k).lenEdge(e) << endl; } cout << " A triangle with a very small edges was created " << endl; return 1; } hmin=min(hmin,this->be(k).lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } ffassert(hmin>Norme2(Psup-Pinf)/1e9); return hmin; } // Read a mesh with correct the mesh : // 1) delete multiple points defined // 2) delete points which is not in element or in border element Mesh3::Mesh3(const string filename, const long change) { int ok=load(filename); if(verbosity) { cout << "read mesh ok " << ok << endl; cout << ", nt " << nt << ", nv " << nv << " nbe: = " << nbe << endl; } if(ok) { ifstream f(filename.c_str()); if(!f) { cerr << " -- Mesh3::Mesh3 Erreur openning " << filename<2) cout << " -- Mesh3: Read On file \"" <nt,this-nbe,vvv,tt,bb); delete [] newNumero_Som; } else{ cout << " no need to change the mesh " << endl; } delete [] Numero_Som; } BuildBound(); if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>2) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(verbosity) cout << " -- Mesh3 : "<=0); // add F. Hecht sep 2009. } // Fin Add by J. Morice nov 2010 // Add J. Morice 12/2010 void Mesh3::TrueVertex() { // verification multiple points double hseuil=hmin(); hseuil =hseuil/10; cout << " hseuil = " << hseuil << endl; KN Numero_Som(this->nv); Vertex *vv=new Vertex[this->nv]; int nv_t=0; { R3 Pinf(1e100,1e100,1e100),Psup(-1e100,-1e100,-1e100); for (int ii=0;ii< this->nv;ii++){ R3 P( vertices[ii].x, vertices[ii].y, vertices[ii].z); Pinf=Minc(P,Pinf); Psup=Maxc(P,Psup); } EF23::GTree *gtree = new EF23::GTree(vv,Pinf,Psup,0); // creation of octree for (int ii=0;iinv;ii++){ const R3 r3vi( this->vertices[ii].x, this->vertices[ii].y, this->vertices[ii].z ); const Vertex3 &vi(r3vi); Vertex3 * pvi=gtree->ToClose(vi,hseuil); if(!pvi){ vv[nv_t].x = vi.x; vv[nv_t].y = vi.y; vv[nv_t].z = vi.z; vv[nv_t].lab = this->vertices[ii].lab; // lab mis a zero par default Numero_Som[ii] = nv_t; gtree->Add( vv[nv_t] ); nv_t=nv_t+1; } else{ Numero_Som[ii] = pvi-vv; } } delete gtree; //delete [] vv; } // general case KN takevertex(nv_t,0); for (int k=0; kborderelements[k]); for(int jj=0; jj<3; jj++){ takevertex[ Numero_Som[this->operator()(K[jj])] ] = 1; } } for(int k=0; k< this->nt; k++){ const Element & K(this->elements[k]); for(int jj=0; jj<4; jj++){ takevertex[ Numero_Som[this->operator()(K[jj])] ] = 1; } } int newvertex=0; for(int iv=0; ivnv){ // determination of vertex Vertex *vvv = new Vertex[ newvertex ]; KN newNumero_Som(nv_t); int iii=0; for(int iv=0; iv< nv_t; iv++){ if( takevertex[iv ] == 1 ){ vvv[iii].x = vv[iv].x; vvv[iii].y = vv[iv].y; vvv[iii].z = vv[iv].z; vvv[iii].lab = vv[iv].lab; // lab mis a zero par default newNumero_Som[iv] = iii; iii++; } } ffassert( newvertex== iii ); Element *tt; if(this->nt !=0) tt=new Element[this->nt]; BorderElement *bb = new BorderElement[this->nbe]; Element *ttt=tt; BorderElement *bbb=bb; for (int k=0; knbe; k++) { const BorderElement & K(this->borderelements[k]); int iv[3]; for(int jj=0; jj<3; jj++){ iv[jj] = Numero_Som[this->operator()(K[jj])]; iv[jj] = newNumero_Som[iv[jj]]; } (bbb++)->set(vvv,iv,K.lab); } for(int k=0; k< this->nt; k++){ const Element & K(this->elements[k]); int iv[4]; for(int jj=0; jj<4; jj++){ iv[jj] = Numero_Som[this->operator()(K[jj])]; iv[jj] = newNumero_Som[iv[jj]]; } (ttt++)->set(vvv,iv,K.lab); } cout << " delete vertices + autre " << endl; delete [] vertices; delete [] elements; delete [] borderelements; nv = newvertex; vertices = vvv; elements = tt; borderelements = bb; //&this = new Mesh3(newvertex,this->nt,this-nbe,vvv,tt,bb); delete [] newNumero_Som; } else{ cout << " no need to change the mesh " << endl; } delete [] Numero_Som; BuildBound(); if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>2) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(verbosity) cout << " -- Mesh3 : d "<< 3 << ", n Tet " << nt << ", n Vtx " << nv << " n Bord " << nbe << endl; ffassert(mes>=0); // add F. Hecht sep 2009. } // Fin Add J. Morice 12/2010 void Mesh3::read(istream &f) { // read the mesh int i; // f >> nv >> nt >> neb ; string str; int err=0; while(!f.eof()) { f >> str; //cout << str << endl; if( str== "Vertices") { f >> nv; assert(!this->vertices ); if(verbosity>2) cout << " -- Nb of Vertex " << nv << endl; this->vertices = new Vertex[nv]; for (i=0;i> this->vertices[i]; assert(f.good()); } } else if (str=="Tetrahedra") { f >> nt; assert(this->vertices && !this->elements); this->elements = new Element [nt]; mes=0; assert(this->elements); if(verbosity>2) cout << " -- Nb of Elements " << nt << endl; for (int i=0;it(i).Read1(f,this->vertices,this->nv); if(this->t(i).mesure()<=0) err++; // Modif FH nov 2014 mes += this->t(i).mesure(); } } else if (str=="Triangles") { mesb=0; int kmv=0,ij; f >> nbe; assert(vertices); this->borderelements = new BorderElement[nbe]; if(verbosity>2) cout << " -- Nb of border Triangles " << nbe << endl; for (i=0;ibe(i).Read1(f,this->vertices,this->nv); mesb += this->be(i).mesure(); for(int j=0;j<3;++j) if(!vertices[ij=this->be(i,j)].lab) { vertices[ij].lab=1; kmv++; } } } else if(str[0]=='#') {// on mange la ligne int c; while ( (c=f.get()) != '\n' && c != EOF) //cout << c << endl; ; } } assert( (nt >= 0 || nbe>=0) && nv>0) ; /* done at up level ... BuildBound(); if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } */ if(err!=0) { cerr << " Mesh3::read: sorry bad mesh. Number of negative Tet " << err << endl; this->~Mesh3(); ffassert(0); } } int Mesh3::load(const string & filename) { int bin; int ver,inm,dim; int lf=filename.size()+20; KN fileb(lf),filef(lf); char *data = new char[filename.size()+1]; size_t ssize = filename.size()+1; char *ptr; char *pfile; strncpy( data, filename.c_str(),ssize); ptr = strstr(data,".mesh"); if( !ptr ){ strcpy(filef,filename.c_str()); strcpy(fileb,filef); strcat(filef,".mesh"); strcat(fileb,".meshb"); if( (inm=GmfOpenMesh(pfile=fileb, GmfRead,&ver,&dim)) ) bin=true; else if( (inm=GmfOpenMesh(pfile=filef, GmfRead,&ver,&dim)) ) bin=false; else if(verbosity>5){ cerr << " Erreur ouverture file " << (char *) fileb << " " << (char *) filef <5) cerr << " Erreur ouverture file " << (char *) data << endl; return 1; } } int nv=-1,nt=-1,neb=-1; nv = GmfStatKwd(inm,GmfVertices); nt = GmfStatKwd(inm,GmfTetrahedra); neb= GmfStatKwd(inm,GmfTriangles); this->set(nv,nt,neb); if(verbosity>1) cout << " -- Mesh3(load): "<< (char *) data <<", ver " << ver << ", d "<< dim << ", nt " << nt << ", nv " << nv << " nbe: = " << nbe << endl; if(dim != 3) { cerr << "Err dim == " << dim << " !=3 " < 0) { if(mnlab==0 && mxlab==0 ) { int kmv=0; mesb=0; GmfGotoKwd(inm,GmfTriangles); for(int i=0;ibe(i).set(this->vertices,iv,lab); mesb += this->be(i).mesure(); } if(kmv&& verbosity>1) cout << " Aucun label Hack (FH) ??? => 1 sur les triangle frontiere "<be(i).set(this->vertices,iv,lab); mesb += this->be(i).mesure(); } } } if(nt>0) { /* read mesh tetrahedra */ GmfGotoKwd(inm,GmfTetrahedra); for(int i=0;i0 && iv[0]<=nv && iv[1]>0 && iv[1]<=nv && iv[2]>0 && iv[2]<=nv && iv[3]>0 && iv[3]<=nv); for (int j=0;j<4;j++) iv[j]--; this->elements[i].set(vertices,iv,lab); mes += this->elements[i].mesure(); } } GmfCloseMesh(inm); return 0; // OK } const string Gsbegin="Mesh3::GSave v0",Gsend="end"; void Mesh3::GSave(FILE * ff,int offset) const { PlotStream f(ff); f << Gsbegin ; f << nv << nt << nbe; for (int k=0; kvertices[k]; f << P.x <elements[k]); int i0=this->operator()(K[0])+offset; int i1=this->operator()(K[1])+offset; int i2=this->operator()(K[2])+offset; int i3=this->operator()(K[3])+offset; int lab=K.lab; f << i0 << i1 << i2 << i3 << lab; } } for (int k=0; kborderelements[k]); int i0=this->operator()(K[0])+offset; int i1=this->operator()(K[1])+offset; int i2=this->operator()(K[2])+offset; int lab=K.lab; f << i0 << i1 << i2 << lab; } f << Gsend; } Mesh3::Mesh3(const Serialize &serialized) :GenericMesh (serialized) { BuildBound(); if(verbosity>1) cout << " -- End of serialized: mesure = " << mes << " border mesure " << mesb << endl; if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>1) cout << " -- Mesh3 (serialized), d "<< 3 << ", n Tet " << nt << ", n Vtx " << nv << " n Bord " << nbe << endl; ffassert(mes>=0); // add F. Hecht sep 2009. } Mesh3::Mesh3(FILE *f,int offset) { GRead(f,offset);// remove 1 assert( (nt >= 0 || nbe>=0) && nv>0) ; BuildBound(); if(verbosity>2) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>2) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(verbosity>1) cout << " -- Mesh3 (File *), d "<< 3 << ", n Tet " << nt << ", n Vtx " << nv << " n Bord " << nbe << endl; ffassert(mes>=0); // add F. Hecht sep 2009. } void Mesh3::GRead(FILE * ff,int offset) { PlotStream f(ff); string s; f >> s; ffassert( s== Gsbegin); f >> nv >> nt >> nbe; if(verbosity>2) cout << " GRead : nv " << nv << " " << nt << " " << nbe << endl; this->vertices = new Vertex[nv]; this->elements = new Element [nt]; this->borderelements = new BorderElement[nbe]; for (int k=0; kvertices[k]; f >> P.x >>P.y >> P.z >> P.lab ; } mes=0.; mesb=0.; if(nt != 0) { for (int k=0; kelements[k]); f >> i[0] >> i[1] >> i[2] >> i[3] >> lab; Add(i,4,offset); K.set(this->vertices,i,lab); mes += K.mesure(); } } for (int k=0; kborderelements[k]); f >> i[0] >> i[1] >> i[2] >> lab; Add(i,3,offset); K.set(this->vertices,i,lab); mesb += K.mesure(); } f >> s; ffassert( s== Gsend); } void Mesh3::readmsh(ifstream & f,int offset) { int err=0; f >> nv >> nt >> nbe; if(verbosity>2) cout << " GRead : nv " << nv << " " << nt << " " << nbe << endl; this->vertices = new Vertex[nv]; this->elements = new Element [nt]; this->borderelements = new BorderElement[nbe]; for (int k=0; kvertices[k]; f >> P.x >>P.y >> P.z >> P.lab ; } mes=0.; mesb=0.; if(nt != 0) { for (int k=0; kelements[k]); f >> i[0] >> i[1] >> i[2] >> i[3] >> lab; Add(i,4,offset); K.set(this->vertices,i,lab); mes += K.mesure(); err += K.mesure() <0; } } for (int k=0; kborderelements[k]); f >> i[0] >> i[1] >> i[2] >> lab; Add(i,3,offset); K.set(this->vertices,i,lab); mesb += K.mesure(); } if(err!=0) { cerr << " Mesh3::readmsh : sorry bad mesh. Number of negative Tet " << err << endl; this->~Mesh3(); ffassert(0); } } int Mesh3::Save(const string & filename) const { int ver = GmfFloat, outm; if ( !(outm = GmfOpenMesh(filename.c_str(),GmfWrite,ver,3)) ) { cerr <<" -- Mesh3::Save UNABLE TO OPEN :"<< filename << endl; return(1); } float fx,fy,fz; GmfSetKwd(outm,GmfVertices,this->nv); for (int k=0; kvertices[k]; GmfSetLin(outm,GmfVertices,fx=P.x,fy=P.y,fz=P.z,P.lab); } if(nt != 0){ GmfSetKwd(outm,GmfTetrahedra,nt); for (int k=0; kelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int i2=this->operator()(K[2])+1; int i3=this->operator()(K[3])+1; int lab=K.lab; GmfSetLin(outm,GmfTetrahedra,i0,i1,i2,i3,lab); } } GmfSetKwd(outm,GmfTriangles,nbe); for (int k=0; kborderelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int i2=this->operator()(K[2])+1; int lab=K.lab; GmfSetLin(outm,GmfTriangles,i0,i1,i2,lab); } GmfCloseMesh(outm); return (0); } int Mesh3::SaveSurface(const string & filename) const { int ver = GmfFloat, outm; if ( !(outm = GmfOpenMesh(filename.c_str(),GmfWrite,ver,3)) ) { cerr <<" -- Mesh3::Save UNABLE TO OPEN :"<< filename << endl; return(1); } // Number of Vertex in the surface int *v_num_surf=new int[nv]; int *liste_v_num_surf=new int[nv]; for (int k=0; kborderelements[k]); for(int jj=0; jj<3; jj++){ int i0=this->operator()(K[jj]); if( v_num_surf[i0] == -1 ){ v_num_surf[i0] = nbv_surf; liste_v_num_surf[nbv_surf]= i0; nbv_surf++; } } } float fx,fy,fz; GmfSetKwd(outm,GmfVertices,nbv_surf); for (int k=0; kvertices[k0]; GmfSetLin(outm,GmfVertices,fx=P.x,fy=P.y,fz=P.z,P.lab); } GmfSetKwd(outm,GmfTriangles,nbe); for (int k=0; kborderelements[k]); int i0=v_num_surf[this->operator()(K[0])]+1; int i1=v_num_surf[this->operator()(K[1])]+1; int i2=v_num_surf[this->operator()(K[2])]+1; int lab=K.lab; assert( i0-1 < nbv_surf && i1-1 < nbv_surf && i2-1 < nbv_surf ); assert( 0borderelements[k]); for(int jj=0; jj<3; jj++){ int i0=this->operator()(K[jj]); if( v_num_surf[i0] == -1){ v_num_surf[i0] = nbv_surf; nbv_surf++; } } } // file .points FILE *fpoints = fopen(filename1.c_str(),"w"); fprintf(fpoints,"%i\n",nbv_surf); for (int k=0; kvertices[k]; fprintf(fpoints,"%f %f %f %i\n",P.x,P.y,P.z,P.lab); } fclose(fpoints); // file .faces FILE *ffaces = fopen(filename2.c_str(),"w"); fprintf(ffaces,"%i\n",nbe); for (int k=0; kborderelements[k]); int i0=this->operator()(K[0]); int i1=this->operator()(K[1]); int i2=this->operator()(K[2]); int lab=K.lab; int label0= this->vertices[i0].lab; int label1= this->vertices[i1].lab; int label2= this->vertices[i2].lab; //GmfSetLin(outm,GmfTriangles,i0,i1,i2,lab); int nature=3; int i0v=v_num_surf[i0]+1; int i1v=v_num_surf[i1]+1; int i2v=v_num_surf[i2]+1; assert( i0v-1 < nbv_surf && i1v-1 < nbv_surf && i2v-1 < nbv_surf ); assert( 0elements[i].mesure(); for (int i=0;ibe(i).mesure(); // Add FH to be consitant we all constructor ... July 09 BuildBound(); if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } // end add if(verbosity>1) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; // if(verbosity>1) // cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; assert(mes>=0.); } Mesh3::Mesh3(int nnv, int nnbe, Vertex3 *vv, Triangle3 *bb) { nv = nnv; nbe =nnbe; vertices = vv; borderelements = bb; mes=0.; mesb=0.; for (int i=0;ibe(i).mesure(); // Add FH to be consitant we all constructor ... July 09 BuildBound(); if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } // end add if(verbosity>1) cout << " -- End of Construct mesh3: mesure = " << mes << " border mesure " << mesb << endl; ffassert(mes>=0); // add F. Hecht sep 2009. } void Mesh3::flipSurfaceMesh3(int surface_orientation) { /* inverse the orientation of the surface if necessary*/ /* and control that all surfaces are oriented in the same way*/ int nbflip=0; for (int i=0;inbe;i++) { double mes_triangle3= this->be(i).mesure(); if( surface_orientation*mes_triangle3 < 0){ const Triangle3 &K( this->be(i) ); int iv[3]; iv[0] = this->operator()(K[0]); iv[1] = this->operator()(K[1]); iv[2] = this->operator()(K[2]); int iv_temp=iv[1]; iv[1]=iv[2]; iv[2]=iv_temp; this->be(i).set( this->vertices, iv, K.lab ) ; nbflip++; } } assert(nbflip==0 || nbflip== this->nbe); } int signe_permutation(int i0,int i1,int i2,int i3) { int p=1; if(i0>i1) Exchange(i0,i1), p = -p; if(i0>i2) Exchange(i0,i2), p = -p; if(i0>i3) Exchange(i0,i3), p = -p; if(i1>i2) Exchange(i1,i2), p = -p; if(i1>i3) Exchange(i1,i3), p = -p; if(i2>i3) Exchange(i2,i3), p = -p; return p; } // new version ... int WalkInTetn(const Mesh3 & Th,int it, R3 & Phat,const R3 & U, R & dt, R3 & offset) { int ncas=0 ; const R eps = 1e-12; const R epsb = 1e-10; const R epsedge = 1e-9; // corrected by F.H 23 juin 2015 bool ddd=verbosity>2000; bool ddd9=verbosity>9; bool nomove=true; R lambda[4],dl[4],cl[4]; Phat.toBary(lambda); if(ddd) cout << "\n\t\t\tWT: " << Phat << " : " << lambda[0] << " " <-0.0000001); #endif typedef R3 Rd; const Mesh3::Element & T(Th[it]); const int nve = 4; const Rd Q[nve]={(const R3) T[0],(const R3) T[1],(const R3) T[2],(const R3) T[3]}; Rd P =T(Phat); // cout << " " << u << " " << v ; Rd PF = P + U*dt; Rd PFK= PF; // couleur(15);MoveTo( P); LineTo( PF); R l[nve]; double Det=T.mesure()*6; l[0] = det(PF ,Q[1],Q[2],Q[3]); l[1] = det(Q[0],PF ,Q[2],Q[3]); l[2] = det(Q[0],Q[1],PF ,Q[3]); l[3] = Det - l[0]-l[1]-l[2]; l[0] /= Det; l[1] /= Det; l[2] /= Det; l[3] /= Det; if (l[0]>-eps && l[1]>-eps && l[2]>-eps && l[3]>-eps) { // a fini .... ouf ... dt =0; Phat=R3(l+1); nomove=false; return -1; } // l(Q) = lambda + dl *coef avec Q= P+ U*dt*coef // coef > 0 et segement [PQ] dans K .. et Q \in \partial K // recherche de la face de sortie .. dl[0]= l[0]-lambda[0]; dl[1]= l[1]-lambda[1]; dl[2]= l[2]-lambda[2]; dl[3]= l[3]-lambda[3]; // attention a inf et NaN possible ci FH.. cl[0]= -lambda[0]/dl[0]; cl[1]= -lambda[1]/dl[1]; cl[2]= -lambda[2]/dl[2]; cl[3]= -lambda[3]/dl[3]; // min positif int kf=-1; double cf=1;// 1 min positif < 1. if(cl[0]>0. && cl[0] < cf) cf=cl[kf=0]; // OK NaN or Inf test are wrong in any case .. if(cl[1]>0. && cl[1] < cf) cf=cl[kf=1]; if(cl[2]>0. && cl[2] < cf) cf=cl[kf=2]; if(cl[3]>0. && cl[3] < cf) cf=cl[kf=3]; if(kf>=0) { double cf1 = 1-cf; // point de sortie en temps dt*cf .. ?? l[0]-= dl[0]*cf1; l[1]-= dl[1]*cf1; l[2]-= dl[2]*cf1; l[3]-= dl[3]*cf1; PFK = P + U*(dt*cf); // final point in tet. } // on sort en temp cf*dt if(ddd) cout << "\t\t\t WT " << it << ", " << Phat << ", PFK=" << PFK << " : " << l[0] << " " <=0) // sortie positive .. { // on regarde de les reelement negatif // on ne veut pas des points sur les faces. // car sinon il va y avoir un probleme quand on va projete sur la face // et remettre le point dans le tetraedre. int ko=0,j=0; if (l[0]<=-eps ) neg[k++]=0,ko+=0+j, j+=4;else nng[kn++]=0; if (l[1]<=-eps ) neg[k++]=1,ko+=1+j, j+=4;else nng[kn++]=1; if (l[2]<=-eps ) neg[k++]=2,ko+=2+j, j+=4;else nng[kn++]=2; if (l[3]<=-eps ) neg[k++]=3,ko+=3+j, j+=4;else nng[kn++]=3; //R eps1 = T.mesure() * 1.e-5; if(ddd) cout << "\t\t\t k= " << k << endl; if(k>0) { { R coef1 = 1-cf; nomove= (cf<1e-10); dt = dt*coef1;// temps restant } // on met les points for(int i=0; i= l[p[1]]) && (l[p[1]] >= l[p[2]]) && (l[p[2]] >= l[p[3]]) ); if(ddd) cout << "\t\t\t \t\t -> kk=" << kk << " , l= "<< l[0] << " " <1) { // on bouge la sortie un sortie a pb un peu... if( l[p[1]] > epsedge ) { //sort sur un arete .. varaimant ... // on met le point sur unz face ... l[p[0]]-=epsb; l[p[1]]-=epsb; l[p[2]]+=epsb+epsb; l[p[3]]=0; kk =p[3]; if(ddd9 ) cout << " *** WalkInTetn: on bouge convect le point d'une arete sur un face .... \n"; } else { // sort sur un sommet l[p[0]]-=epsb+epsb; l[p[2]]+=epsb; l[p[3]]=0; kk=p[3]; if(ddd9 ) cout << " *** WalkInTetn: on bouge convect le point d'un sommet sur un face .... \n"; } l[p[0]]=0; l[p[0]]=1. - l[0] - l[1] - l[2] - l[3]; } } } Phat=R3(l+1); if(ddd) cout << "\t\t\t -> "<< dt << " : " << Phat << " K(Phat) ="<< Th[it](Phat) << ", " << kk << endl; return kk; } int WalkInTet(const Mesh3 & Th,int it, R3 & Phat,const R3 & U, R & dt) { const R eps = 1e-8; // corrected by F.H 23 juin 2015 bool ddd=verbosity>2000; bool nomove=true; R lambda[4],dl[4],cl[4]; Phat.toBary(lambda); if(ddd) cout << "\n\t\t\tWT: " << Phat << " : " << lambda[0] << " " <-0.0000001); #endif typedef R3 Rd; const Mesh3::Element & T(Th[it]); const int nve = 4; const Rd Q[nve]={(const R3) T[0],(const R3) T[1],(const R3) T[2],(const R3) T[3]}; Rd P =T(Phat); // cout << " " << u << " " << v ; Rd PF = P + U*dt; Rd PFK= PF; // couleur(15);MoveTo( P); LineTo( PF); R l[nve]; double Det=T.mesure()*6; l[0] = det(PF ,Q[1],Q[2],Q[3]); l[1] = det(Q[0],PF ,Q[2],Q[3]); l[2] = det(Q[0],Q[1],PF ,Q[3]); l[3] = Det - l[0]-l[1]-l[2]; l[0] /= Det; l[1] /= Det; l[2] /= Det; l[3] /= Det; if (l[0]>-eps && l[1]>-eps && l[2]>-eps && l[3]>-eps) { // a fini .... ouf ... dt =0; Phat=R3(l+1); nomove=false; return -1; } // l(Q) = lambda + dl *coef avec Q= P+ U*dt*coef // coef > 0 et segement [PQ] dans K .. et Q \in \partial K // recherche de la face de sortie .. dl[0]= l[0]-lambda[0]; dl[1]= l[1]-lambda[1]; dl[2]= l[2]-lambda[2]; dl[3]= l[3]-lambda[3]; // attention a inf et NaN possible ci FH.. cl[0]= -lambda[0]/dl[0]; cl[1]= -lambda[1]/dl[1]; cl[2]= -lambda[2]/dl[2]; cl[3]= -lambda[3]/dl[3]; // min positif int kf=-1; double cf=1;// 1 min positif < 1. if(cl[0]>0. && cl[0] < cf) cf=cl[kf=0]; // OK NaN or Inf test are wrong in any case .. if(cl[1]>0. && cl[1] < cf) cf=cl[kf=1]; if(cl[2]>0. && cl[2] < cf) cf=cl[kf=2]; if(cl[3]>0. && cl[3] < cf) cf=cl[kf=3]; if(kf>=0) { double cf1 = 1-cf; // point de sortie en temps dt*cf .. ?? l[0]-= dl[0]*cf1; l[1]-= dl[1]*cf1; l[2]-= dl[2]*cf1; l[3]-= dl[3]*cf1; PFK = P + U*(dt*cf); // final point in tet. } // on sort en temp cf*dt if(ddd) cout << "\t\t\t WT " << it << ", " << Phat << ", PFK=" << PFK << " : " << l[0] << " " <=0) // sortie positive .. { // on regarde de les reelement negatif // on ne veut pas des points sur les faces. // car sinon il va y avoir un probleme ans on va projete sur la face // et remettre le point dans le tetraedre. if (l[0]<=-eps ) neg[k++]=0; if (l[1]<=-eps ) neg[k++]=1; if (l[2]<=-eps ) neg[k++]=2; if (l[3]<=-eps ) neg[k++]=3; //R eps1 = T.mesure() * 1.e-5; if(ddd) cout << "\t\t\t k= " << k << endl; if (k>1) // 2 .. 3 face de sortie possible { // regarde sorti interne .. int pos[4]; int kp =0; if (l[0]<0 ) pos[kp++]=0; if (l[1]<0 ) pos[kp++]=1; if (l[2]<0 ) pos[kp++]=2; if (l[3]<0 ) pos[kp++]=3; if(kp>0) kk=pos[randwalk(kp)];// else kk=neg[randwalk(k)]; } else if (k==1) // une face possible de sortie (cas simple) kk = neg[0]; if(kk>=0) { if ( l[kk] ) // on bouge et on arete avant la fin ... { R coef1 = 1-cf; nomove= (cf<1e-6); dt = dt*coef1;// temps restant } if(ddd) cout << "\t\t\t \t\t -> kk=" << kk << " , l= "<< lambda[0] << " " < recherche un point final (environ) if(dx2*dx2*dx2 > Det*Det/4) dt=0; else { dc=0.25; ddt=dt*dc; PF= P + U*ddt; // on avance que d'un 1/4 dt -= ddt; } if(ddd) cout << "\t\t\t PF = " << PF << " " << dt << " ddt = " << ddt << " " << it << " " << &PF< Find P+U*ddt*c "<< it<< " " << " -> "<< Th(K) << " dt = " << dt << " c = " << dc << " outside: "<< outside <<" , PF " << PF << endl; return 4+Th(K); } // on remet le point dans le tet. int jj=0; R lmx=lambda[0]; if (lmx "<< dt << " : " << Phat << " K(Phat) ="<< Th[it](Phat) << ", " << kk << " jj= "<< jj << " "<< lmx << endl; assert(kk<0 || lambda[kk]==0); return kk; } inline int cleanlambda(double *lambda) { const R eps=1e-15; // on remet le point dans le tet. int jj=0,kk=0; R lmx=lambda[0]; if (lmx2000; bool nomove=true; R lambda[4],dl[4],cl[4]; Phat.toBary(lambda); if(ddd) cout << "\n\t\t\tWT: " << Phat << " : " << lambda[0] << " " <-0.0000001); #endif typedef R3 Rd; const Mesh3::Element & T(Th[it]); const int nve = 4; const Rd Q[nve]={(const R3) T[0],(const R3) T[1],(const R3) T[2],(const R3) T[3]}; Rd P =T(Phat); // cout << " " << u << " " << v ; Rd PF = P + U*dt; Rd PFK= PF; // couleur(15);MoveTo( P); LineTo( PF); R l[nve]; double Det=T.mesure()*6; l[0] = det(PF ,Q[1],Q[2],Q[3]); l[1] = det(Q[0],PF ,Q[2],Q[3]); l[2] = det(Q[0],Q[1],PF ,Q[3]); l[3] = Det - l[0]-l[1]-l[2]; l[0] /= Det; l[1] /= Det; l[2] /= Det; l[3] /= Det; if (l[0]>-eps && l[1]>-eps && l[2]>-eps && l[3]>-eps) { // a fini .... ouf ... dt =0; Phat=R3(l+1); nomove=false; return -1; } // l(Q) = lambda + dl *coef avec Q= P+ U*dt*coef // coef > 0 et segement [PQ] dans K .. et Q \in \partial K // recherche de la face de sortie .. dl[0]= l[0]-lambda[0]; dl[1]= l[1]-lambda[1]; dl[2]= l[2]-lambda[2]; dl[3]= l[3]-lambda[3]; // attention a inf et NaN possible ci FH.. cl[0]= -lambda[0]/dl[0]; cl[1]= -lambda[1]/dl[1]; cl[2]= -lambda[2]/dl[2]; cl[3]= -lambda[3]/dl[3]; // min positif int kf=-1; double cf=1;// 1 min positif < 1. if(cl[0]>0. && cl[0] < cf) cf=cl[kf=0]; // OK NaN or Inf test are wrong in any case .. if(cl[1]>0. && cl[1] < cf) cf=cl[kf=1]; if(cl[2]>0. && cl[2] < cf) cf=cl[kf=2]; if(cl[3]>0. && cl[3] < cf) cf=cl[kf=3]; if(kf>=0) { double cf1 = 1-cf; // point de sortie en temps dt*cf .. ?? l[0]-= dl[0]*cf1; l[1]-= dl[1]*cf1; l[2]-= dl[2]*cf1; l[3]-= dl[3]*cf1; // PFK = P + U*(dt*cf); // final point in tet. } // on sort en temp cf*dt dt*=cf; int kk=cleanlambda(lambda); Phat=R3(lambda+1); if(ddd) cout << "\t\t\t -> "<< dt << " : " << Phat << " K(Phat) ="<< Th[it](Phat) << ", " << kk << endl; assert(kk<0 || lambda[kk]==0); return kk; } } // End namespace Fem2D freefem++-3.61-1/src/femlib/P012_3d.cpp000644 000767 000024 00000052275 13256636774 017377 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : P0,P1,P2 lagrange 3D // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include "PkLagrange.hpp" namespace Fem2D { // P0 class TypeOfFE_P0Lagrange3d : public TypeOfFE_Lagrange { public: TypeOfFE_P0Lagrange3d(): TypeOfFE_Lagrange(0) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P0Lagrange3d::operator()(const FElement & K,const R3 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))); R r=0; if (op==0) r = u0; else r=0; return r; } void TypeOfFE_P0Lagrange3d::FB(const What_d whatd,const Mesh & ,const Element & K,const R3 & P,RNMK_ & val) const { assert(val.N() >=1); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = 1; } } // P1 class TypeOfFE_P1Lagrange3d : public TypeOfFE_Lagrange { public: TypeOfFE_P1Lagrange3d(): TypeOfFE_Lagrange(1) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P1Lagrange3d::operator()(const FElement & K,const R3 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))),u3(u(K(3))); R r=0; if (op==0) { R l0=1-PHat.x-PHat.y-PHat.z,l1=PHat.x,l2=PHat.y,l3=PHat.z; r = u0*l0+u1*l1+l2*u2+l3*u3; } else if(op==op_dx || op==op_dy || op==op_dz) // dx => dy thank to Pichon 27/01/2008 (FH) { const Element & T=K.T; R3 D[4]; T.Gradlambda(D); if (op==op_dx) r = D[0].x*u0 + D[1].x*u1 + D[2].x*u2+ D[3].x*u3 ; else if (op==op_dy) r = D[0].y*u0 + D[1].y*u1 + D[2].y*u2+ D[3].y*u3 ; else r = D[0].z*u0 + D[1].z*u1 + D[2].z*u2+ D[3].z*u3 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1Lagrange3d::FB(const What_d whatd,const Mesh & ,const Element & K,const R3 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x,P.y,P.z}; assert(val.N() >=Element::nv); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = l[0]; f0[1] = l[1]; f0[2] = l[2]; f0[3] = l[3]; } if (whatd & Fop_D1) { R3 Dl[4]; K.Gradlambda(Dl); //for(int i=0;i<4;++i) // cout << Dl[i] << endl; if (whatd & Fop_dx) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl[0].x; f0x[1] = Dl[1].x; f0x[2] = Dl[2].x; f0x[3] = Dl[3].x; } if (whatd & Fop_dy) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl[0].y; f0y[1] = Dl[1].y; f0y[2] = Dl[2].y; f0y[3] = Dl[3].y; } if (whatd & Fop_dz) { RN_ f0z(val('.',0,op_dz)); f0z[0] = Dl[0].z; f0z[1] = Dl[1].z; f0z[2] = Dl[2].z; f0z[3] = Dl[3].z; } } // cout << val << endl; } class TypeOfFE_P2Lagrange3d : public TypeOfFE_Lagrange { public: typedef Mesh3 Mesh; typedef GFElement FElement; TypeOfFE_P2Lagrange3d(): TypeOfFE_Lagrange(2) { } void FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const; } ; class TypeOfFE_P1bLagrange3d : public TypeOfFE_Lagrange { public: typedef Mesh3 Mesh; typedef GFElement FElement; TypeOfFE_P1bLagrange3d(): TypeOfFE_Lagrange(-1) { } void FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const; } ; void TypeOfFE_P2Lagrange3d::FB(const What_d whatd,const Mesh & ,const Element & K,const R3 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x,P.y,P.z}; assert(val.N() >=E::nv+E::ne); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); // if (whatd & Fop_D0) { int k=0; for(int i=0;iop_dxy); RN_ fxy(val('.',0,op_dxy)); fxy[0] = 4*Dl0.x*Dl0.y; fxy[1] = 4*Dl1.x*Dl1.y; fxy[2] = 4*Dl2.x*Dl2.y; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } */ } /* R TypeOfFE_P1bLagrange3d::operator()(const FElement & K,const R3 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))),u3(u(K(3))),u4(u(K(4))); R r=0; if (op==0) { R l0=1-PHat.x-PHat.y-PHat.z,l1=PHat.x,l2=PHat.y,l3=PHat.z; R l0123= r = u0*l0+u1*l1+l2*u2+l3*u3; } else if(op==op_dx || op==op_dy || op==op_dz) // dx => dy thank to Pichon 27/01/2008 (FH) { const Element & T=K.T; R3 D[4]; T.Gradlambda(D); if (op==op_dx) r = D[0].x*u0 + D[1].x*u1 + D[2].x*u2+ D[3].x*u3 ; else if (op==op_dy) r = D[0].y*u0 + D[1].y*u1 + D[2].y*u2+ D[3].y*u3 ; else r = D[0].z*u0 + D[1].z*u1 + D[2].z*u2+ D[3].z*u3 ; } // cout << r << "\t"; return r; } */ void TypeOfFE_P1bLagrange3d::FB(const What_d whatd,const Mesh & ,const Element & K,const R3 & P,RNMK_ & val) const { // const Triangle & K(FE.T); const R d1=d+1.; const R d13=d1*d1*d1; const R d14=d13*d1; R ll[]={1.-P.sum(),P.x,P.y,P.z}; R lb4= (ll[0]*ll[1]*ll[2]*ll[3])*d13; // d1^-4 d1^3 = 1/d1 in G R lb=lb4*d1; // 1 in G R l[5]; for(int i=0;i<4;i++) l[i]=ll[i]-lb4; // 1/d1 in G - 1/d1 G =0 l[4]=lb; assert(val.N() >=Element::nv); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = l[0]; f0[1] = l[1]; f0[2] = l[2]; f0[3] = l[3]; f0[4] = l[4]; } if (whatd & Fop_D1) { R3 Dl[4]; K.Gradlambda(Dl); R3 Dlb4 = ( + Dl[0]*(ll[1]*ll[2]*ll[3]) + Dl[1]*(ll[0]*ll[2]*ll[3]) + Dl[2]*(ll[0]*ll[1]*ll[3]) + Dl[3]*(ll[0]*ll[1]*ll[2]) )*d13; //for(int i=0;i<4;++i) // cout << Dl[i] << endl; if (whatd & Fop_dx) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl[0].x-Dlb4.x; f0x[1] = Dl[1].x-Dlb4.x; f0x[2] = Dl[2].x-Dlb4.x; f0x[3] = Dl[3].x-Dlb4.x; f0x[4] = Dlb4.x*d1; } if (whatd & Fop_dy) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl[0].y-Dlb4.y; f0y[1] = Dl[1].y-Dlb4.y; f0y[2] = Dl[2].y-Dlb4.y; f0y[3] = Dl[3].y-Dlb4.y; f0y[4] = Dlb4.y*d1; } if (whatd & Fop_dz) { RN_ f0z(val('.',0,op_dz)); f0z[0] = Dl[0].z-Dlb4.z; f0z[1] = Dl[1].z-Dlb4.z; f0z[2] = Dl[2].z-Dlb4.z; f0z[3] = Dl[3].z-Dlb4.z; f0z[4] = Dlb4.z*d1; } } else if (whatd & Fop_D2) ffassert(0); // a faire ... // cout << val << endl; } class TypeOfFE_RT0_3d : public GTypeOfFE { public: typedef Mesh3 Mesh; typedef Mesh3::Element Element; typedef GFElement FElement; static int dfon[]; static const int d=Mesh::Rd::d; TypeOfFE_RT0_3d(); int edgeface[4][3] ; void FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const; void set(const Mesh & Th,const Element & K,InterpolationMatrix & M,int ocoef,int odf,int *nump ) const; } ; int TypeOfFE_RT0_3d::dfon[]={0,0,1,0}; TypeOfFE_RT0_3d::TypeOfFE_RT0_3d(): GTypeOfFE(dfon,d,1,3*4,4,false,true) { // integration on middle of faces (light ) on each face .. R3 Pt[]= {R3(0.,0.,0.), R3(1.,0.,0.),R3(0.,1.,0.),R3(0.,0.,1.)}; /* for (int i=0;iPtInterpolation[i]=(Pt[Element::nvedge[i][0]]+Pt[Element::nvedge[i][1]])*0.5; */ for (int i=0;iPtInterpolation[i]=(Pt[Element::nvface[i][0]]+Pt[Element::nvface[i][1]]+Pt[Element::nvface[i][2]])/3.; // static const int nvfaceTet[4][3] ={{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}} ;//{ {2,1,3},{0,2,3},{1,0,3},{0,1,2} }; // { {0,1},{0,2},{0,3},{1,2},{1,3},{2,3} }; // 0 1 2 3 4 5 /* { int i=0; for (int f=0;f<4;f++) for (int e=0,i=0;e<6;e++) if ((Element::nvedge[e][0] !=f) && (Element::nvedge[e][1]!=f)) edgeface[f][i++]=e; }*/ { int i=0; for (int f=0;f<4;f++) { // cout << " face : " << f << endl; // for (int p=0;p<3;p++) { int e= f; //edgeface[f][p] ; // cout << " , " << this->PtInterpolation[e]; for (int c=0;c<3;c++,i++) { this->pInterpolation[i]=e; this->cInterpolation[i]=c; this->dofInterpolation[i]=f; this->coefInterpolation[i]=0.; } } //cout << endl; } } } void TypeOfFE_RT0_3d::set(const Mesh & Th,const Element & K,InterpolationMatrix & M ,int ocoef,int odf,int *nump) const { // compute de coef d'interpolation // M.coef int i=ocoef; for (int f=0;f<4;f++) { R3 N=K.N(f);// exterior and ||N|| = 2* area f N *= K.faceOrient(f)/2.; // for (int p=0;p<3;p++) { int e= f; //dgeface[f][p] ; for (int c=0;c<3;c++,i++) { //this->pInterpolation[i]=e; //this->cInterpolation[i]=c; //this->dofInterpolation[i]=f; M.coef[i]=N[c]; } }} // cout << " M.coef :" << M.coef << endl; //ffassert(i==M.ncoef && M.np == 6 ); } void TypeOfFE_RT0_3d::FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const { assert(val.N() >=4); assert(val.M()==3 ); // wi = signe * (x - qi)/ (volume*d) val=0; // cout << " TypeOfFE_RT0_3d "<< Th(K) << " " << Th.nt << " / "< { public: typedef Mesh3 Mesh; typedef Mesh3::Element Element; typedef GFElement FElement; static int dfon[]; static const int d=Mesh::Rd::d; static const GQuadratureFormular QFe; int edgeface[4][3] ; TypeOfFE_Edge0_3d(); void FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const; void set(const Mesh & Th,const Element & K,InterpolationMatrix & M ,int ocoef,int odf,int *nump ) const; } ; int TypeOfFE_Edge0_3d::dfon[]={0,1,0,0}; const GQuadratureFormular TypeOfFE_Edge0_3d::QFe(-1+2*2,2,GaussLegendre(2),true); TypeOfFE_Edge0_3d::TypeOfFE_Edge0_3d(): GTypeOfFE(TypeOfFE_Edge0_3d::dfon,d,1,Element::ne*3*QFe.n,Element::ne*QFe.n,false,true) { assert(QFe.n); // integration on edge use QFe R3 Pt[]= {R3(0.,0.,0.), R3(1.,0.,0.),R3(0.,1.,0.),R3(0.,0.,1.)}; for (int e=0,i=0;ePtInterpolation[i]=Pt[Element::nvedge[e][0]]*x+Pt[Element::nvedge[e][1]]*(1-x); } { int i=0,p=0; for (int e=0;epInterpolation[i]=p; this->cInterpolation[i]=c; this->dofInterpolation[i]=e; this->coefInterpolation[i]=0.; } } } // cout << " ++ TypeOfFE_Edge0_3d():"<< this->PtInterpolation << endl; } void TypeOfFE_Edge0_3d::set(const Mesh & Th,const Element & K,InterpolationMatrix & M ,int ocoef,int odf,int *nump ) const { // compute de coef d'interpolation // M.coef int i=ocoef,p=0; for (int e=0;epInterpolation[i]=p; //this->cInterpolation[i]=c; //this->dofInterpolation[i]=e; M.coef[i]=E[c]*QFe[q].a; } } // ffassert(i==M.ncoef && M.np == p ); } void TypeOfFE_Edge0_3d::FB(const What_d whatd,const Mesh & Th,const Mesh3::Element & K,const Rd &P, RNMK_ & val) const { assert(val.N() >=6); assert(val.M()==3 ); R l[]={1.-P.sum(),P.x,P.y,P.z}; R3 D[4]; K.Gradlambda(D); // wi = signe * (x - qi)/ (volume*d) val=0; // i,j : l1 grad lj - lj grad lj // int_i^j grad lj . t_ij = 1 bool se[]={ K.EdgeOrientation(0), K.EdgeOrientation(1), K.EdgeOrientation(2), K.EdgeOrientation(3), K.EdgeOrientation(4), K.EdgeOrientation(5)}; if (whatd & Fop_D0) { R3 X=K(P); int k=0; for(int i=0;i<6;++i) { int i0=Element::nvedge[i][0],i1=Element::nvedge[i][1]; if( !se[i]) Exchange(i0,i1); R3 wi = l[i0]*D[i1]-l[i1]*D[i0]; val(i,0,op_id) = wi.x ; val(i,1,op_id) = wi.y ; val(i,2,op_id) = wi.z ; // cout << "Edge0 3d "< & P0Lagrange3d(P0_3d); static TypeOfFE_P1Lagrange3d P1_3d; GTypeOfFE & P1Lagrange3d(P1_3d); static TypeOfFE_P2Lagrange3d P2_3d; GTypeOfFE & P2Lagrange3d(P2_3d); static TypeOfFE_P1bLagrange3d P1b_3d; GTypeOfFE & P1bLagrange3d(P1b_3d); static TypeOfFE_RT0_3d RT0_3d; GTypeOfFE & RT03d(RT0_3d); static TypeOfFE_Edge0_3d Edge0_3d; GTypeOfFE & Edge03d(Edge0_3d); template<> GTypeOfFE & DataFE::P0=P0_3d; template<> GTypeOfFE & DataFE::P1=P1_3d; template<> GTypeOfFE & DataFE::P2=P2_3d; } freefem++-3.61-1/src/femlib/RefCounter.hpp000644 000767 000024 00000007176 13256636774 020450 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: 29 fev 2005 // -*- Mode : c++ -*- // // SUMMARY : array modelisation // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef REFCOUNTER_HPP #define REFCOUNTER_HPP #include "showverb.hpp" #include "error.hpp" class RefCounter; class baseCountPointer; // ruse pour utiliser le prive c RefCounter de // pas de syntaxe pour des friends template class baseCountPointer { protected: void add(const RefCounter * c) const; void destroyPtr(const RefCounter * c) const; }; // <> class RefCounter { static RefCounter *tnull; mutable int count; protected: virtual ~RefCounter() {} RefCounter() : count(0) {} public: int destroy() const { if(this!=tnull) {throwassert(count>=0); if ( count--==0) { SHOWVERB( cout << "True destruction of " << this << endl); delete this; return true;} else{ SHOWVERB(cout << " no destruction count=" << count+1 << " " << this << endl); return false;}} else return false;} void increment() const {count++;SHOWVERB( cout << "increment of " << this << " "<< count << endl);} void decrement() const {destroy();}// count--;SHOWVERB( cout << "decrement of " << this << " "<< count << endl);ffassert(count>=0);} friend class baseCountPointer; // private: RefCounter(const RefCounter &) : count(0) {} void operator=(const RefCounter &) { count=0;} }; inline void baseCountPointer::add(const RefCounter * c) const { if (c) c->count++;} inline void baseCountPointer::destroyPtr(const RefCounter * c) const { if (c) c->destroy();} template class CountPointer: private baseCountPointer { T * c; public: CountPointer() : c(0) {} CountPointer( T * a,bool mmaster=false) :c(a) { if(!mmaster) add(c);} CountPointer( T & a) :c(&a) { add(c);} CountPointer(const CountPointer & a) :c(a.c) { add(c);} ~CountPointer() { destroyPtr(c);c=0;} //void destroy() const { destroyPtr(c);} void destroy() { destroyPtr(c);c=0;} operator T * () const { return c;} operator T & () const {return *c;} T& operator*() const {return *c;} T* operator->() const {return c;} bool operator==(const CountPointer & n) const {return n.c ==c;} bool operator!=(const CountPointer & n) const {return n.c !=c;} bool operator!() const { return !c;} void operator=(const CountPointer & n) { if(*this != n) { destroyPtr(c); c=n.c; add(c); }} void operator=( T * t) { if( c != t) { if(c) destroyPtr(c); c=t; add(c); }} // for the compile time void init() {c=0;} // void master(T *t) { destroyPtr(c); c=t;} }; #endif freefem++-3.61-1/src/femlib/P012_2d.cpp000644 000767 000024 00000013634 13256636774 017372 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : P0,P1,P2 lagrange 2D // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include "PkLagrange.hpp" // P0 namespace Fem2D { class TypeOfFE_P0Lagrange2d : public TypeOfFE_Lagrange { public: TypeOfFE_P0Lagrange2d(): TypeOfFE_Lagrange(0) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P0Lagrange2d::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))); R r=0; if (op==0) r = u0; else r=0; return r; } void TypeOfFE_P0Lagrange2d::FB(const What_d whatd,const Mesh & ,const Element & K,const R2 & P,RNMK_ & val) const { assert(val.N() >=1); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = 1; } } // P1 class TypeOfFE_P1Lagrange2d : public TypeOfFE_Lagrange { public: TypeOfFE_P1Lagrange2d(): TypeOfFE_Lagrange(1) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P1Lagrange2d::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r=0; if (op==0) { R l0=1-PHat.x-PHat.y,l1=PHat.x,l2=PHat.y; r = u0*l0+u1*l1+l2*u2; } else if(op==op_dx || op==op_dy ) { const Element & T=K.T; R2 D[3]; T.Gradlambda(D); if (op==op_dx) r = D[0].x*u0 + D[1].x*u1 + D[2].x*u2; else r = D[0].y*u0 + D[1].y*u1 + D[2].y*u2 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1Lagrange2d::FB(const What_d whatd,const Mesh & ,const Element & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x,P.y}; assert(val.N() >=Element::nv); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = l[0]; f0[1] = l[1]; f0[2] = l[2]; } if (whatd & Fop_D1) { R2 Dl[3]; K.Gradlambda(Dl); if (whatd & Fop_dx) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl[0].x; f0x[1] = Dl[1].x; f0x[2] = Dl[2].x; } if (whatd & Fop_dy) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl[0].y; f0y[1] = Dl[1].y; f0y[2] = Dl[2].y; } } } class TypeOfFE_P2Lagrange2d : public TypeOfFE_Lagrange { public: typedef Mesh2 Mesh; typedef GFElement FElement; TypeOfFE_P2Lagrange2d(): TypeOfFE_Lagrange(2) { } void FB(const What_d whatd,const Mesh & Th,const Mesh2::Element & K,const Rd &P, RNMK_ & val) const; } ; void TypeOfFE_P2Lagrange2d::FB(const What_d whatd,const Mesh & ,const Element & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x,P.y}; assert(val.N() >=E::nv+E::ne); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); // if (whatd & Fop_D0) { int k=0; for(int i=0;i & P0Lagrange2d(P0_2d); static TypeOfFE_P1Lagrange2d P1_2d; GTypeOfFE & P1Lagrange2d(P1_2d); static TypeOfFE_P2Lagrange2d P2_2d; GTypeOfFE & P2Lagrange2d(P2_2d); template<> GTypeOfFE & DataFE::P0=P0_2d; template<> GTypeOfFE & DataFE::P1=P1_2d; template<> GTypeOfFE & DataFE::P2=P2_2d; } freefem++-3.61-1/src/femlib/QuadratureFormular.hpp000644 000767 000024 00000016046 13256636774 022215 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : Generic Quadrature Formular // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef _QuadratureFormular_h #define _QuadratureFormular_h #include namespace Fem2D { using namespace std; #include "R3.hpp" //class QuadratureFormular; struct QuadratureWeight { R a; QuadratureWeight(R aa): a(aa){} }; template class GQuadraturePoint: public QuadratureWeight,public Rd { public: typedef GQuadraturePoint QP ; GQuadraturePoint(): QuadratureWeight(0),Rd() {} GQuadraturePoint(R aa, const Rd &xx): QuadratureWeight(aa),Rd(xx) {} GQuadraturePoint(const Rd & xx,R aa): QuadratureWeight(aa),Rd(xx) {} operator R() const {return a;} GQuadraturePoint(R aa,R xx):QuadratureWeight(aa),Rd(xx) {} GQuadraturePoint(R aa,R x,R y):QuadratureWeight(aa),Rd(x,y) {} GQuadraturePoint(R aa,R x,R y,R z):QuadratureWeight(aa),Rd(x,y,z) {} template GQuadraturePoint Bary(RD * K, double mes) { return GQuadraturePoint(this->Rd::Bary(K),a*mes);} }; template class GQuadratureFormular { public: typedef Rdd Rd; typedef GQuadraturePoint QuadraturePoint; typedef GQuadraturePoint QP; int exact; // exact int n; // nombre de point d'integration const int size; // size of the array private: QP *p; // les point d'integration const bool clean; public: // -- les fonctions ------------------ void Verification(); // for verification GQuadratureFormular (int e,int NbOfNodes,QuadraturePoint *pp,bool c=false) :exact(e), n(NbOfNodes),size(n),p(pp),clean(c) {Verification();} GQuadratureFormular (int e,int NbOfNodes,const QuadraturePoint *pp,bool c=false) :exact(e),n(NbOfNodes),p(pp),clean(c) {Verification();} GQuadratureFormular(int ex,QP p0,QP p1,QP p2,QP p3,QP p4) : exact(ex),n(5),size(n),p(new QP[5]),clean(true) { p[0]=p0;p[1]=p1;p[2]=p2;p[3]=p3;p[4]=p4;Verification();} GQuadratureFormular(int ex,QP p0,QP p1,QP p2,QP p3) : exact(ex),n(4),size(n),p(new QP[4]) ,clean(true){ p[0]=p0,p[1]=p1,p[2]=p2;p[3]=p3;Verification();} GQuadratureFormular(int ex,QP p0,QP p1,QP p2) : exact(ex),n(3),size(n),p(new QP[3]),clean(true) { p[0]=p0,p[1]=p1,p[2]=p2;Verification();} GQuadratureFormular(int ex,QP p0,QP p1) : exact(ex),n(2),size(n),p(new QP[2]),clean(true) { p[0]=p0,p[1]=p1;Verification();} GQuadratureFormular(int ex,QP p0) : exact(ex),n(1),size(n),p(new QP[1]),clean(true) { p[0]=p0;Verification();} // bluid a empty GQuadratureFormular GQuadratureFormular(int ssize):exact(0),n(0),size(ssize),p(new QP[size]),clean(true) {} const QP & operator [](int i) const {return p[i];} const QP & operator ()(int i) const {return p[i];} ~GQuadratureFormular() {if(clean) delete [] p;} GQuadratureFormular(const GQuadratureFormular & QF, int mul=1) :exact(QF.exact),n(QF.n),size(QF.size*mul),p(new QP[size]),clean(true){ operator=(QF);} void operator=(const GQuadratureFormular &QF) { assert(size>=QF.n); n = QF.n; for(int i=0;i void AddQFK(const GQuadratureFormular &QF ,Rd *K,double mes,int n0=0) { assert( size >= n0 + QF.n ); n0 += n; n = n0 + QF.n; for(int i=0;i ostream& operator <<(ostream& , const GQuadratureFormular & ) ; template ostream& operator <<(ostream& , GQuadraturePoint & ); typedef GQuadratureFormular QuadratureFormular1d; extern const QuadratureFormular1d QF_GaussLegendre1; extern const QuadratureFormular1d QF_GaussLegendre2; extern const QuadratureFormular1d QF_GaussLegendre3; extern const QuadratureFormular1d QF_GaussLegendre4; extern const QuadratureFormular1d QF_GaussLegendre5; extern const QuadratureFormular1d QF_LumpP1_1D; extern const GQuadratureFormular QuadratureFormular_T_1; extern const GQuadratureFormular QuadratureFormular_T_1lump; extern const GQuadratureFormular QuadratureFormular_T_2; extern const GQuadratureFormular QuadratureFormular_T_5; extern const GQuadratureFormular QuadratureFormular_T_2_4P1; extern const GQuadratureFormular QuadratureFormular_T_7; extern const GQuadratureFormular QuadratureFormular_T_9; extern const GQuadratureFormular QuadratureFormular_Tet_1; extern const GQuadratureFormular QuadratureFormular_Tet_1lump; extern const GQuadratureFormular QuadratureFormular_Tet_2; extern const GQuadratureFormular QuadratureFormular_Tet_5; template GQuadratureFormular * QF_Simplex(int exact); // { return QF_exact,Rd::d+1>(exact);} template void setQF( GQuadratureFormular &FI, const GQuadratureFormular & FI1 , const GQuadratureFormular & FI0 , Rd Q[Rd::d][Rd::d+1], double *cmes, int n) { FI.reset(); for(int i=0; i< n; ++i) if(cmes[i]==1) FI=FI1; else if(cmes[i] > 1e-4) FI.AddQFK(FI1,Q[i],cmes[i]); else if ( cmes[i]> 1e-8 ) FI.AddQFK(FI0,Q[i],cmes[i]); } } namespace Fem2D { typedef GQuadratureFormular QuadratureFormular; typedef GQuadraturePoint QuadraturePoint; typedef GQuadratureFormular QuadratureFormular1d; typedef GQuadraturePoint QuadratureFormular1dPoint; GQuadraturePoint * GaussLegendre(int nn); } #endif freefem++-3.61-1/src/femlib/gibbs.cpp000644 000767 000024 00000076167 13256636774 017463 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include "error.hpp" #include #include #include "RNM.hpp" #include "rgraph.hpp" #include "fem.hpp" using namespace Fem2D; #include "FESpacen.hpp" #include "FESpace.hpp" #define mmax(a,b)(a>b?a:b) #define mmin(a,b)(a= ptvois[record[j] + 1] - ptvois[record[j]]) { goto L8; } record[i] = record[j]; goto L4; L8: record[i] = rec; goto L2; L999: record[1] = rec; return 0; } /* gibbs1_ */ /* Subroutine */ int gibbs2_(integer* n,integer* record,integer* criter) { static integer crit, i, j, l, r, rec; /* trie record selon les valeurs de criter(record(.)) croissantes */ /* Parameter adjustments */ --criter; --record; /* Function Body */ if (*n <= 1) { return 0; } l = *n / 2 + 1; r = *n; L2: if (l <= 1) { goto L20; } --l; rec = record[l]; crit = criter[rec]; goto L3; L20: rec = record[r]; crit = criter[rec]; record[r] = record[1]; --r; if (r == 1) { goto L999; } L3: j = l; L4: i = j; j <<= 1; if (j - r < 0) { goto L5; } else if (j == r) { goto L6; } else { goto L8; } L5: if (criter[record[j]] < criter[record[j + 1]]) { ++j; } L6: if (crit >= criter[record[j]]) { goto L8; } record[i] = record[j]; goto L4; L8: record[i] = rec; goto L2; L999: record[1] = rec; return 0; } /* gibbs2_ */ /* Subroutine */ int gibbsa_(integer* n,integer* ptvois,integer* vois,integer* r,integer* m, integer* nv,integer* nx,integer* ny,integer* nn,integer* w1,integer* w2, integer* pfold,integer* pfnew,integer* impre,integer* nfout) { /* System generated locals */ integer i__1, i__2, i__3, i__4; /* Builtin functions */ /* Local variables */ static integer nbcc, degi, bold, bnew, i, j, k, p, degre, x, y, p1, p2; /* extern Subroutine int gibbs1_();*/ static integer pf; /* extern Subroutine int gibbsb_(), gibbsd_(), gibbst_();*/ static integer nbpass, niveau, pf1, option, old, new_, opt, new1; long pfn1,pfo1,m1e9; m1e9 = 1000000000; /* ----------------------------------------------------------------------- */ /* but: calculer une renumerotation des sommets d'un graphe defini par: */ /* par la methode de gibbs */ /* ----------------------------------------------------------------------- */ /* entree */ /* -------- */ /* n = nb de sommet du graphe */ /* les voisins d'un sommet i ont pour numero : */ /* ( vois(j) , j=ptvois(i),ptvois(i+1)-1 ) */ /* impre parametre d'impression */ /* nfout numero du fichier pour impression */ /* sortie */ /* ------ */ /* r(1:n) tableau donnant la nouvelle numerotation: */ /* r(i) = nouveau numero du sommet i */ /* pfolf = ancien profile */ /* pfnew = nouveau profile */ /* tableau de travail : */ /* -------------------- */ /* m(n) */ /* nv(0:n+n) */ /* nx(n) */ /* ny(n) */ /* nn(0:n) */ /* w1(n) */ /* w2(n) */ /* ----------------------------------------------------------------------- */ /* programmeur f. hecht le 3/02/1987 */ /* ----------------------------------------------------------------------- */ /* tri des voisins d'un sommet du graphe par degre croissant */ /* --------------------------------------------------------------- */ /* Parameter adjustments */ --w2; --w1; --ny; --nx; --m; --r; --vois; --ptvois; /* Function Body */ p2 = ptvois[1] - 1; i__1 = *n; for (i = 1; i <= i__1; ++i) { p1 = p2 + 1; p2 = ptvois[i + 1] - 1; i__2 = p2 - p1 + 1; gibbs1_(&i__2, &vois[p1], &ptvois[1]); /* if(impre.le.-9) then */ /* write (nfout,*) 'les voisin de ',i,'sont: ', (vois(j),j=p1,p 2) */ /* endif */ /* L10: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { r[i] = 0; /* L20: */ } /* boucle sur les composante connexe du graphe */ new_ = 0; nbcc = 0; L30: if (new_ < *n) { ++nbcc; /* recherche d'une racine y (un sommet non numerote) de degree m ini */ y = 0; degre = *n + 1; i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] <= 0) { degi = ptvois[i + 1] - ptvois[i]; if (degi < degre) { degre = degi; y = i; } } /* L40: */ } if (y == 0) { return -3;/* s_stop("fatal erreur gibbs 2 : pb racine", 33L); */ } gibbsd_(&y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); nbpass = 0; L50: ++nbpass; x = y; p = niveau; k = 0; i__1 = nv[p + 1]; for (i = nv[p] + 1; i <= i__1; ++i) { ++k; m[k] = nv[i]; /* L60: */ } gibbs1_(&k, &m[1], &ptvois[1]); i__1 = k; for (i = 1; i <= i__1; ++i) { y = m[i]; gibbsd_(&y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); if (niveau > p) { goto L50; } /* L70: */ } y = m[1]; /* if(impre.lt.0) then */ /* write(nfout,*) */ /* + ' nb de pass pour trouver le pseudo diametre',nbpass */ /* + ,' x=',x,',y=',y,' de la composante connexe ',nbcc */ /* write (nfout,*) ('-',i=1,78) */ /* endif */ /* optimisation de la descendance de la numerotation */ /* ------------------------------------------------- */ gibbsb_(&x, &y, n, &ptvois[1], &vois[1], &nx[1], &ny[1], nv, nn, &m[1] , &w1[1], &w2[1], &r[1], impre, nfout); /* renumerotation de cuthill mac kee avec la meilleur des 4 option s */ /* -------------------------------------------------------------- --- */ pf = 1073741824; option = -2; new1 = new_; for (opt = -2; opt <= 2; ++opt) { new_ = new1; if (opt != 0) { gibbst_(n, &p, nv, nn, &ptvois[1], &vois[1], &m[1], &r[1], & new_, &opt, &pf1, impre, nfout); if (pf1 < pf) { pf = pf1; option = opt; } } /* L80: */ } /* if(impre.ne.0) write (nfout,*) ' on a choisi l''option ', */ /* + option,', new =',new */ new_ = new1; gibbst_(n, &p, nv, nn, &ptvois[1], &vois[1], &m[1], &r[1], &new_, & option, &pf1, impre, nfout); goto L30; } /* if(impre.ne.0) write(nfout,*) */ /* + ' nb de composante connexe du graphe =',nbcc */ /* calcul du profile */ *pfold = 0; *pfnew = 0; pfo1=0; pfn1=0; bnew = 0; bold = 0; i__1 = *n; for (i = 1; i <= i__1; ++i) { old = i; new_ = r[i]; i__2 = ptvois[i + 1] - 1; for (j = ptvois[i]; j <= i__2; ++j) { /* Computing MIN */ i__3 = old, i__4 = vois[j]; old = mmin(i__3,i__4); /* Computing MIN */ i__3 = new_, i__4 = r[vois[j]]; new_ = mmin(i__3,i__4); /* L100: */ } *pfold = *pfold + i - old + 1; /* Computing MAX */ i__2 = bold, i__3 = i - old + 1; bold = mmax(i__2,i__3); *pfnew = *pfnew + r[i] - new_ + 1; /* Computing MAX */ i__2 = bnew, i__3 = r[i] - new_ + 1; bnew = mmax(i__2,i__3); if(*pfold>m1e9) { pfo1+=*pfold/m1e9; *pfold = *pfold%m1e9;} if(*pfnew>m1e9) { pfn1+=*pfnew/m1e9; *pfnew = *pfnew%m1e9;} /* L110: */ } if(pfo1 || pfn1) { // change unit of pf if(pfo1==pfn1) { *pfnew= pfn1*10 + (*pfnew >= *pfold) ; *pfold= pfo1*10 + (*pfnew <= *pfold) ; } else { *pfnew= pfn1 ; *pfold= pfo1; } } /* if(impre.ne.0) then */ /* write(nfout,*)'profile old = ',pfold,', profile new = ',pfnew */ /* write(nfout,*)'1/2 bande old = ',bold ,', 1/2 band new = ',bnew */ /* endif */ return 0; } /* gibbsa_ */ /* Subroutine */ int gibbsb_(integer* x,integer* y,integer* n,integer* ptvois, integer* vois,integer* nx,integer* ny,integer* nv,integer* nn,integer* m, integer* wh,integer* wl,integer* r, integer* , integer* ) { /* System generated locals */ integer i__1, i__2; /* Local variables */ static int flag_; static integer i, j, k, p, s, h0, i1, l0, i2; /* extern Subroutine int gibbs1_(); */ static integer lg; /* extern Subroutine int gibbsd_(), gibbsc_();*/ static integer niveau, mxcanx, mxcany, nbc; /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* ...................................................................... */ /* attention on met la descente optimiser dans r <0 ou nulle */ /* ....................................................................... */ /* Parameter adjustments */ --r; --m; --ny; --nx; --vois; --ptvois; /* Function Body */ gibbsd_(y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); gibbsc_(&ny[1], nv, &niveau, n, &mxcany); gibbsd_(x, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); p = niveau; gibbsc_(&nx[1], nv, &niveau, n, &mxcanx); flag_ = ffalse; i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nx[i] + ny[i] == p) { r[i] = -nx[i]; } else if (nx[i] >= 0) { flag_ = ttrue; r[i] = -1073741824; } else { if (r[i] <= 0) { r[i] = -1073741822; } } /* L20: */ } if (flag_) { /* calcul des composantes connexe du graphe sans les sommets de nn */ /* ------------------------------------------------------------ --- */ j = *n; k = 0; nbc = 0; nv[nbc] = j; L30: ++k; if (k <= *n) { if (r[k] == -1073741824) { /* recherche de la fermeture transitive partant de k */ ++nbc; i = -1; s = k; L40: ++i; wl[i] = ptvois[s]; wh[i] = ptvois[s + 1]; ++j; nv[j] = s; r[s] = -1073741823; L50: if (i >= 0) { if (wl[i] < wh[i]) { s = vois[wl[i]]; ++wl[i]; if (r[s] == -1073741824) { goto L40; } goto L50; } --i; goto L50; } nv[nbc] = j; m[nbc] = nbc; } goto L30; } /* if(impre.lt.0) write(nfout,*) */ /* + ' nb de composante connexe du graphe reduit =',nbc */ /* --------------- fin de construction des composantes connexes------ --- */ /* nv(0)=n */ /* if(impre.le.-10) write(nfout,5555)'nv(0:n+n) = ',(nv(i),i=0, n+n) */ gibbs1_(&nbc, &m[1], nv); /* if(impre.le.-10)write(nfout,5555)'trie m =',(m(i),i=1,nbc) */ i__1 = p; for (i = 0; i <= i__1; ++i) { nn[i] = 0; /* L60: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { j = -r[i]; if (j >= 0 && j <= p) { ++nn[j]; } /* L70: */ } /* boucle sur les composante connexes par ordre croissantes */ /* -------------------------------------------------------- */ for (k = nbc; k >= 1; --k) { i = m[k]; i1 = nv[i - 1] + 1; i2 = nv[i]; lg = i2 - i1 + 1; /* if(impre.le.-7) */ /* + write(nfout,*) k,' composante ',i,',lg=',lg,',i1,i2 =',i1,i2 */ /* if(impre.le.-8) */ /* + write (nfout,5555)' ',(nv(i),i=i1,i2) */ h0 = 0; l0 = 0; i__1 = p; for (j = 0; j <= i__1; ++j) { wh[j] = nn[j]; wl[j] = nn[j]; /* L90: */ } i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; ++wh[nx[s]]; ++wl[p - ny[s]]; /* L100: */ } i__1 = p; for (j = 0; j <= i__1; ++j) { if (wh[j] != nn[j]) { /* Computing MAX */ i__2 = wh[j]; h0 = mmax(i__2,h0); } if (wl[j] != nn[j]) { /* Computing MAX */ i__2 = wl[j]; l0 = mmax(i__2,l0); } /* L110: */ } if (h0 < l0 || (h0 == l0 && mxcanx <= mxcany)) { /* if(impre.le.-2) write(nfout,*) */ /* + ' h0 = ',h0,',l0 = ',l0,' ------- XXXX --------' */ i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; r[s] = -nx[s]; ++nn[-r[s]]; /* L120: */ } } else { /* if (impre.le.-2) write(nfout,*) */ /* + ' h0 = ',h0,',l0 = ',l0,' ------- YYYY --------' */ i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; r[s] = -p + ny[s]; ++nn[-r[s]]; /* L130: */ } } /* L140: */ } } /* on met les nouveaux niveaux de la descendance optimiser dans nn */ /* ----------------------------------------------------------------- */ i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] > 0) { nn[i] = -1; } else if (r[i] == -1073741822) { nn[i] = -2; } else { nn[i] = -r[i]; } /* L150: */ } /* if(impre.le.-10)write (nfout,5555)' nn(i)=',(nn(i),i=1,n) */ /* 5555 format(' -------- ',a,/,5(15x,10(i5)/)) */ return 0;} /* gibbsb_ */ /* Subroutine */ int gibbsc_(integer* nz,integer* nv,integer* niveau,integer* n,integer* mxz) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static integer i, j; /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* Parameter adjustments */ --nz; /* Function Body */ i__1 = *n; for (i = 1; i <= i__1; ++i) { nz[i] = -1; /* L10: */ } *mxz = 0; i__1 = *niveau; for (i = 0; i <= i__1; ++i) { /* Computing MAX */ i__2 = *mxz, i__3 = nv[i + 1] - nv[i]; *mxz = mmax(i__2,i__3); i__2 = nv[i + 1]; for (j = nv[i] + 1; j <= i__2; ++j) { if(nv[j] > *n) printf(" bug in gibbsc_ ##### %ld %ld %ld %ld \n",j,nv[j],i,*niveau ); if(nv[j] <= *n) nz[nv[j]] = i; /* L20: */ } } return 0;} /* gibbsc_ */ /* Subroutine */ int gibbsd_(integer* racine,integer* n,integer* ptvois,integer* vois,integer* nv,integer* r,integer* niveau) { /* System generated locals */ integer i__1, i__2; /* Local variables */ static integer i, k, s, sv, stk, stk1, stk2, nvni=-1; /* ----------------------------------------------------------------------- */ /* but construire la structure des descendant de racine du graphe */ /* ----------------------------------------------------------------------- */ /* sortie : */ /* -------- */ /* nv est la structure des niveaux */ /* les sommets du niveau (i =0,niveau_ sont defini par : */ /* (nv(j),j=nv(i),nv(i+1)-1) */ /* le tableau r(i) n'est modifier que sur les sommets */ /* de la composante connexe du graphe contenant la racine */ /* ----------------------------------------------------------------------- */ /* on demark tout les sommets non remuneroter */ /* -------------------------------------------------- */ /* Parameter adjustments */ --r; --vois; --ptvois; /* Function Body */ i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] < 0) { r[i] = 0; } /* L10: */ } /* initialisation */ stk = *n ;// correct bug FH june 2011 .... nv[0] = stk; stk2 = stk; *niveau = 0; ++stk; nv[stk] = *racine; r[*racine] = -1; L20: if (stk2 < stk) { ++(*niveau); stk1 = stk2 + 1; nvni=nv[*niveau];/* save value */ nv[*niveau] = stk; stk2 = stk; /* print *,' ------- niveau =',niveau,' stk=',stk1,stk2 */ i__1 = stk2; for (k = stk1; k <= i__1; ++k) { s = nv[k]; /* print *,'----------------- s=',s */ i__2 = ptvois[s + 1] - 1; for (i = ptvois[s]; i <= i__2; ++i) { /* pour tout les sommets (sv) voisin */ /* d'un sommet (s) du niveau precedent */ sv = vois[i]; /* print *,' voisin =',sv */ /* si le sommet n'est pas marque on le marque et on l'ajout */ if (r[sv] == 0) { ++stk; nv[stk] = sv; r[sv] = -1; } /* L30: */ } /* L40: */ } goto L20; } // if(nvni>0) nv[*niveau]=nvni; --(*niveau); /* call pnv(' gibbsd ',n,nv,niveau) */ return 0;} /* gibbsd_ */ /* Subroutine */ int gibbst_(integer* n,integer* p,integer* nv,integer* nn,integer* ptvois,integer* vois,integer* m,integer* r,integer* new_,integer* option, integer* pfnew,integer* impre,integer* ) { /* System generated locals */ integer i__1, i__2, i__3, i__4, i__5; /* Local variables */ static integer nbsc, bnew, knew, step, plus, i, j, k, s, debut, i1, i2; /* extern Subroutine int gibbs2_();*/ static integer fin; /* construction de la stucture de niveau dans nv a partir de nn */ /* ------------------------------------------------------------ */ /* Parameter adjustments */ --r; --m; --vois; --ptvois; /* Function Body */ nv[0] = *n; i__1 = *p + 1; for (i = 1; i <= i__1; ++i) { nv[i] = 0; /* L150: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nn[i] >= 0) { ++nv[nn[i] + 1]; } /* L160: */ } i__1 = *p; for (i = 0; i <= i__1; ++i) { nv[i + 1] += nv[i]; /* L170: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nn[i] >= 0) { j = nn[i]; ++nv[j]; nv[nv[j]] = i; } /* L180: */ } for (i = *p; i >= 0; --i) { nv[i + 1] = nv[i]; /* L190: */ } nv[0] = *n; nbsc = nv[*p + 1] - nv[0]; /* --- fin de la construction ------------------------------------ */ if (*option == -2) { i__1 = *impre - 1; } i__1 = *n; for (i = 1; i <= i__1; ++i) { m[i] = *n * 3 + ptvois[i + 1] - ptvois[i]; /* L10: */ } if ((((int)*option) == 1)||(((int)*option) == -1)) { debut = 0; fin = *p; step = 1; } else { debut = *p; fin = 0; step = -1; } i__1 = fin; i__2 = step; for (i = debut; i__2 < 0 ? i >= i__1 : i <= i__1; i += i__2) { i1 = nv[i] + 1; i2 = nv[i + 1]; i__3 = i2 - i1 + 1; gibbs2_(&i__3, &nv[i1], &m[1]); i__3 = i2; for (j = i1; j <= i__3; ++j) { s = nv[j]; i__4 = ptvois[s + 1] - 1; for (k = ptvois[s]; k <= i__4; ++k) { /* Computing MIN */ i__5 = m[vois[k]]; m[vois[k]] = mmin(i__5,j); /* L20: */ } /* L30: */ } /* L40: */ } if (*option > 0) { knew = *new_; plus = 1; } else { knew = *new_ + nbsc + 1; plus = -1; } *new_ += nbsc; /* if(option.gt.0) then */ /* do 60 k = debut , fin , step */ /* do 60 j = nv(k+1),nv(k)+1,-1 */ /* knew = knew + plus */ /* r(nv(j)) = knew */ /* 60 continue */ /* else */ i__2 = fin; i__1 = step; for (k = debut; i__1 < 0 ? k >= i__2 : k <= i__2; k += i__1) { i__3 = nv[k + 1]; for (j = nv[k] + 1; j <= i__3; ++j) { knew += plus; r[nv[j]] = knew; /* L70: */ } } /* endif */ *pfnew = 0; bnew = 0; i__3 = *n; for (i = 1; i <= i__3; ++i) { k = r[i]; if (k > 0) { i__1 = ptvois[i + 1] - 1; for (j = ptvois[i]; j <= i__1; ++j) { if (r[vois[j]] > 0) { /* Computing MIN */ i__2 = k, i__4 = r[vois[j]]; k = mmin(i__2,i__4); } /* L100: */ } *pfnew = *pfnew + r[i] - k + 1; /* Computing MAX */ i__1 = bnew, i__2 = r[i] - k + 1; bnew = mmax(i__1,i__2); } /* L110: */ } /* if(impre.lt.0.or.impre.gt.2) then */ /* write(nfout,*) ' option =',option,', profile =',pfnew */ /* + ,', 1/2 bande =',bnew,', new=',new,', nbss composante=',nbsc */ /* endif */ return 0;} /* gibbst_ */ /* function */ int Mesh::gibbsv (integer* ptvoi, integer* vois,integer* lvois,integer* w,integer* v) { /* System generated locals */ integer i__2; /* Local variables */ integer i, j, k, T, ss, iii, ptv, ptv1; integer nbss = nv , nbt = nt; /*--- Prepare les donees pour gibbsa en construisant ptvoi, vois, lvois - ------------*/ /* in */ /* --- nbnt =3 pour des triangles 2D, */ /* nbt = nb de triangle */ /* nbss = nb de sommets */ /* nsea = numeros de 3 sommets de chaque triangle (me) */ /* out */ /* --- ptvoi, vois, lvois, err */ /* tableaux de travail w, v */ /*----------------------------------------------------------------------- ----------*/ /* Parameter adjustments */ --v; --w; --vois; --ptvoi; /* Function Body */ for (i = 1; i <= nbss; ++i) { w[i] = -1; ptvoi[i] = 0; } ptvoi[nbss + 1] = 0; for (i = 0; i < nbt; ++i) { for (j = 0; j < 3; ++j) { ss = number(triangles[i][j])+1; ++ptvoi[ss + 1]; w[ss] = 0;} } for (i = 1; i <= nbss; ++i) ptvoi[i + 1] += ptvoi[i]; for (i = 0; i < nbt; ++i) { for (j = 0; j < 3; ++j) { ss = number(triangles[i][j])+1; ++ptvoi[ss]; v[ptvoi[ss]] = i; } } ptv1 = 0; iii = 1; for (i = 1; i <= nbss; ++i) { ptv = ptv1 + 1; ptv1 = ptvoi[i]; ptvoi[i] = iii; i__2 = ptv1; for (j = ptv; j <= i__2; ++j) { T = v[j]; for (k = 0; k < 3; ++k) { ss = number(triangles[T][k])+1; /* nsea[k + T * nsea_dim1]; */ if (w[ss] != i) { w[ss] = i; if (iii > *lvois) return 2 ; /* print*,'pas assez de place memoire' */ vois[iii] = ss; ++iii;} } } } ptvoi[nbss + 1] = iii; *lvois = iii - 1; return 0; /* OK */ return 0;} /* gibbsv_ */ int Mesh::renum() /* -------- renumber vertices by gibbs method; updates triangle and edge array in: mesh out: mesh auxiliary arrays: ptvois,vois,r,m,nv,nx,ny,nn,w1,w2,f all of size nv+1 except vois (10(nv+1)) and nv (2(nv+1)) err = -1 : memory alloc pb; err = -3: fatal erreur gibbs 2 : pb racine */ { long pfold, pfnew; long* ptvois=NULL; long* vois=NULL; long* nn =NULL; long* r =NULL; long* m =NULL; long* nnv =NULL; long* nx =NULL; long* ny =NULL; long* w1 =NULL; long* w2=NULL; long nbvoisin = 10*nv; long printint=0, iodev=6; int err=0; ptvois = new long[nv+1]; //(long*)calloc((long)(nv + 1) , sizeof(long)); nn = new long[3*nt]; //(long*)calloc(3 * nt ,sizeof(long)); vois = new long[nbvoisin+10]; //(long*)calloc((long)(nbvoisin + 10) , sizeof(long)); r = new long[nv+1]; //(long*)calloc((long)(nv + 1) , sizeof(long)); if((!ptvois)||(!nn)||(!vois)||(!r)) return -1; err = gibbsv(ptvois,vois,&nbvoisin,r,nn) ; delete [] nn; // free(nn); if(err==0) { m = new long[nv+1]; nn = new long[nv+1]; nnv = new long[(nv+1)<<1]; nx = new long[nv+1]; ny = new long[nv+1]; w1 = new long[nv+1]; w2 = new long[nv+1]; long lnv = nv; err = gibbsa_ (&lnv, ptvois, vois, r, m, nnv, nx, ny, nn, w1, w2, &pfold, &pfnew, &printint, &iodev); delete [] m; delete [] nnv; delete [] nn; delete [] nx; delete [] ny; delete [] w1; delete [] w2; } delete [] vois; delete [] ptvois; if(verbosity>1) cout << " -- Mesh: Gibbs: old skyline = " << pfold << " new skyline = " << pfnew << endl; if (err == 0 && (pfnew <= pfold)) { int i,j; for ( i=0;i=0 && v < nv); BoundaryAdjacencesLink[j2]=BoundaryAdjacencesHead[v]; BoundaryAdjacencesHead[v]=j2; } } for (int it=0;itNodesOfElement==0) return -2; int nv = NbOfNodes; int nt = NbOfElements;// ;Th.nt; long pfold =0, pfnew=0; long* ptvois=NULL; long* vois=NULL; long* nn =NULL; long* r =NULL; long* m =NULL; long* nnv =NULL; long* nx =NULL; long* ny =NULL; long* w1 =NULL; long* w2=NULL; long nbvperelem = 20; // pour le P1 // cout << "gibbs: nbvperelem =" << nbvperelem << endl; long nbvoisin = (nbvperelem)*nv; long printint=0, iodev=6; int err=0; int nnx= SizeToStoreAllNodeofElement(); ptvois = new long[nv+1]; nn = new long[nnx]; vois = new long[nbvoisin+100]; r = new long[nv+1]; if((!ptvois)||(!nn)||(!vois)||(!r)) return -1; err = gibbsv(ptvois,vois,&nbvoisin,r,nn) ; delete [] nn; if(nbvoisin <= nv) // no renumbering if no enought neighbour FH. nov 2017 // thank to beniamin.bogosel@cmap.polytechnique.fr { err=1; if(verbosity>1) cout << " No renumbering ( nbvois " << nbvoisin << " <= " <1) cout << " FESpace:Gibbs: old skyline = " << pfold << " new skyline = " << pfnew << endl; if (err == 0 && (pfnew <= pfold)) { int i; // cout << *this << endl; for ( i=0;irenum(r,nnx); } delete [] r; return err; } /* function */ int FESpace::gibbsv (integer* ptvoi, integer* vois,integer* lvois,integer* w,integer* v) { /* System generated locals */ integer i__2; /* Local variables */ integer i, j, k, T, ss, iii, ptv, ptv1; integer nbss = NbOfNodes , nbt = NbOfElements; integer jj,kk; /*--- Prepare les donees pour gibbsa en construisant ptvoi, vois, lvois - ------------*/ /* in */ /* --- nbnt =3 pour des triangles 2D, */ /* nbt = nb de triangle */ /* nbss = nb de sommets */ /* nsea = numeros de 3 sommets de chaque triangle (me) */ /* out */ /* --- ptvoi, vois, lvois, err */ /* tableaux de travail w, v */ /*----------------------------------------------------------------------- ----------*/ /* Parameter adjustments */ --v; --w; --vois; --ptvoi; /* Function Body */ for (i = 1; i <= nbss; ++i) { w[i] = -1; ptvoi[i] = 0; } ptvoi[nbss + 1] = 0; for (i = 0; i < nbt; ++i) { for (j = 0; j < NbOfNodesInElement(i) ; ++j) { ss = (*this)(i,j) +1; ++ptvoi[ss + 1]; w[ss] = 0;} } for (i = 1; i <= nbss; ++i) ptvoi[i + 1] += ptvoi[i]; for (i = 0; i < nbt; ++i) { for (j = 0,jj= NbOfNodesInElement(i); j 0 && ss <= nbss)) { cout << "bug " << ss << " " << i << " " << j << endl; exit(1); } ++ptvoi[ss]; v[ptvoi[ss]] = i; } } ptv1 = 0; iii = 1; for (i = 1; i <= nbss; ++i) { ptv = ptv1 + 1; ptv1 = ptvoi[i]; ptvoi[i] = iii; i__2 = ptv1; for (j = ptv; j <= i__2; ++j) { T = v[j]; for (k = 0,kk=NbOfNodesInElement(T); k < kk; ++k) { ss = (*this)(T,k) +1;//number(triangles[T][k])+1; /* nsea[k + T * nsea_dim1]; */ if (w[ss] != i) { w[ss] = i; if (iii > *lvois) return 2 ; /* print*,'pas assez de place memoire' */ vois[iii] = ss; ++iii;} } } } ptvoi[nbss + 1] = iii; *lvois = iii - 1; return 0; /* OK */ return 0;} /* gibbsv_ */ /* message d'erreur: *err = 2; print*,'pas assez de place memoire' */ /* message d'erreur: *err = 2; print*,'pas assez de place memoire' */ freefem++-3.61-1/src/femlib/Element_P2h.cpp000644 000767 000024 00000007211 13256636774 020457 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "error.hpp" #include "rgraph.hpp" using namespace std; #include "RNM.hpp" #include "fem.hpp" #include "FESpace.hpp" namespace Fem2D { // ------ P2h Hierarchical (just remove P1 node of the P2 finite element) -------- class TypeOfFE_P2hLagrange : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P2hLagrange(): TypeOfFE(0,1,0,1,Data,4,1,3,3,Pi_h_coef) { const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; for (int i=0;i=3); throwassert(val.M()==1); val=0; // -- if (whatd[op_id]) { RN_ f0(val('.',0,op_id)); f0[0] = 4*l1*l2; // oppose au sommet 0 f0[1] = 4*l0*l2; // oppose au sommet 1 f0[2] = 4*l1*l0; // oppose au sommet 3 } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[1] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[2] = 4*(Dl0.x*l1 + Dl1.x*l0) ; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[1] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[2] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); fxx[0] = 8*Dl1.x*Dl2.x; fxx[1] = 8*Dl0.x*Dl2.x; fxx[2] = 8*Dl0.x*Dl1.x; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); fyy[0] = 8*Dl1.y*Dl2.y; fyy[1] = 8*Dl0.y*Dl2.y; fyy[2] = 8*Dl0.y*Dl1.y; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); fxy[0] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[1] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[2] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } } } // link with FreeFem++ do not work with static library .a // FH so add a extern name to call in init_static_FE (see end of FESpace.cpp) void init_FE_P2h() { }; extern ListOfTFE typefem_P2h; static TypeOfFE_P2hLagrange P2LagrangeP2h; // given the name of the finite element in FreeFem++ ListOfTFE typefem_P2h("P2h", &P2LagrangeP2h); // --- fin -- } // FEM2d namespace freefem++-3.61-1/src/femlib/assertion.hpp000755 000767 000024 00000000432 13256636774 020372 0ustar00hechtstaff000000 000000 #ifndef ASSERTION_HPP_ #define ASSERTION_HPP_ // to compile all assertion //#define ASSERTION // to remove all the assert //#define NDEBUG #ifndef ASSERTION #define ASSERTION(i) ((void ) 0) #else #include #undef ASSERTION #define ASSERTION(i) assert(i) #endif #endif freefem++-3.61-1/src/femlib/InvIntFunc.cpp000644 000767 000024 00000003501 13256636774 020376 0ustar00hechtstaff000000 000000 // used by splitsimplex.cpp // to inverse numering ... // F. Hecht // ORIG-DATE: fev 2009 // -*- Mode : c++ -*- // // SUMMARY : Model mesh 2d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ inline int InvIntFunction(int l) // calcul de inverse de la fonction F { // inverse la function F int i=0,j,k=l; int Fi=F(i),Fj,Fk=F(k); while (1) { j = (i+k)/2; if(j==i) break; Fj=F(j); // cout << i<< j << k << " " << (l < Fj) << " : "; if( l < Fj ) { k=j; Fk=Fj;} else if ( l > Fj ) { i=j; Fi=Fj;} else { i=j;} // cout << " ** " << l << " : " << i<< " "<< j << " "<< k << " : Fi " << Fi << " " << Fj << " "<< Fk << endl; } if( Fk==l) i=k; // cout << " i =" << i << " l= " << l << " in [ " << F(i) << ", " << F(i+1) << "[ " << endl; assert( (F(i) <= l) && (l < F(i+1) ) ); return i; } freefem++-3.61-1/src/femlib/BamgFreeFem.hpp000644 000767 000024 00000004402 13321622623 020436 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Bamglib interface header // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef FREEFEMBAMG_H_ #define FREEFEMBAMG_H_ namespace bamg { extern void (*MeshIstreamErrorHandler)(ios & ); class Triangles; } const Fem2D::Mesh * ReadMeshbamg( string * const & s) ; const Fem2D::Mesh * ReadTriangulate( string * const & s) ; const Fem2D::Mesh * Triangulate( const KN_ & xx,const KN_ & yy) ; const Fem2D::Mesh *bamg2msh( bamg::Triangles* tTh,bool renumbering=false); bamg::Triangles * msh2bamg(const Fem2D::Mesh & Th, double cutoffradian=-1.0,long * reqedgeslab=0,int nreqedgeslab =0) ; bamg::Triangles * msh2bamg(const Fem2D::Mesh & Th,double cutoffradian, int nbdfv, int * ndfv,int nbdfe, int * ndfe, long * reqedgeslab=0,int nreqedgeslab=0); const Fem2D::Mesh * BuildMesh(Stack stack, E_BorderN const * const & b,bool justboundary,int nbvmax=0,bool Requiredboundary=true,KNM *pintern=0,double alea=0); const Fem2D::Mesh * BuildMesh(Stack stack , E_BorderN const * const & b,bool Requiredboundary) ; const Fem2D::Mesh * BuildMeshBorder(Stack stack , E_BorderN const * const & b) ; const Fem2D::Mesh * MoveTheMesh(const Fem2D::Mesh &Th,const KN_ & u,const KN_ &v); const Fem2D::Mesh * buildmeshbamg( string * const & s,int =0); #endif freefem++-3.61-1/src/femlib/MatriceCreuse.hpp000644 000767 000024 00000107056 13321622623 021102 0ustar00hechtstaff000000 000000 #ifndef MatriceCreuse_h_ #define MatriceCreuse_h_ template T Square(const T & r){return r*r;} #ifdef HAVE_LIBUMFPACK_XXXXXXXXXXXXX extern "C" { #ifdef HAVE_UMFPACK_H #include #else #ifdef HAVE_UMFPACK_UMFPACK_H #include #else #ifdef HAVE_BIG_UMFPACK_UMFPACK_H #include #else #ifdef HAVE_UFSPARSE_UMFPACK_H #include #else #ifdef HAVE_SUITESPARSE_UMFPACK_H #include #else // Defaults to a local version of the UMFPACK headers #include "../../download/include/umfpack.h" #endif // HAVE_SUITESPARSE_UMFPACK_H #endif // HAVE_UFSPARSE_UMFPACK_H #endif // HAVE_BIG_UMFPACK_UMFPACK_H #endif // HAVE_UMFPACK_UMFPACK_H #endif // HAVE_UMFPACK_H } #endif #include "RNM.hpp" #include "fem.hpp" #include "FESpace.hpp" #include "DOperator.hpp" #include "QuadratureFormular.hpp" extern double ff_tgv; using Fem2D::Mesh; using Fem2D::FESpace; using Fem2D::FElement; using Fem2D::baseFElement; using Fem2D::FMortar; using Fem2D::TypeOfMortar; using Fem2D::QuadratureFormular; using Fem2D::QuadratureFormular1d; using Fem2D::QuadratureFormular_T_5; using Fem2D::QF_GaussLegendre3; const double EPSILON=1e-20; using Fem2D::onWhatIsEdge; //#define APROGRAMMER(a) {cerr << "A PROGRAMMER " #a << endl; exit (1) ;} #define ERREUR(a,b) {cerr << "ERREUR " #a<< b < class MatriceCreuse; template class MatriceElementaire; template class MatriceElementaireSymetrique; template class MatriceElementairePleine; template class MatriceMorse; template class MatriceProdTensoriel; //template R Square(R x){ return x*x;} template T* docpyornot(bool nocpy,T* p,int n) { T * r=p; if( !nocpy) { // do copy r= new T[n]; ffassert(r); if(p) for(int i=0;i T* docpy(TT* p,int n) { T * r=0; if(p && n) { // do copy r= new T[n]; ffassert(r); for(int i=0;i class MatriceElementaire { public: enum TypeOfMatriceElementaire {Full=1,Symmetric=2}; int lga; // size of array a R* a; // array coef -- int *ni,*nj; // list of df // to build matrice on face or edge ----- int n,m; // n,m number of df const TypeOfMatriceElementaire mtype; KN data; // to store value of basic function const bool onFace ; // true if do int on face or edge with jump (VF or GD : Galerkin Discontinus) // in with case add ... const int lnki,lnkj; // size of the 4 next array int *nik,*nikk; // number of df in element k,kk for VF and GD methode int *njk,*njkk; // number of df in element k,kk for VF and GD methode const int optim; MatriceElementaire(int datasize,int llga ,int *nnj,int * nni,TypeOfMatriceElementaire t=Full,int ooptim=1) : lga(llga),a(new R[lga]), ni(nni),nj(nnj),n(0),m(0),mtype(t),data(datasize), onFace(false),lnki(0),lnkj(0),nik(0),nikk(0),njk(0),njkk(0),optim(ooptim) {} // for discontinous Galerkine method MatriceElementaire(int datasize,int llga,int *nni, int lk, TypeOfMatriceElementaire t=Symmetric, int ooptim=1 ) : lga(llga),a(new R[lga]), ni(nni),nj(nni),n(0),m(0),mtype(t),data(datasize*(lk?2:1)) , onFace(lk!=0), lnki(lk),lnkj(lk), nik(lk? new int[lk*2]:0), nikk(nik+lk), njk(nik), njkk(nik+lk), optim(ooptim) { ffassert(lk>=0);} // for discontinous Galerkine method MatriceElementaire(int datasize,int llga,int *nni,int lki,int *nnj,int lkj, TypeOfMatriceElementaire t=Full,int ooptim=1 ) : lga(llga),a(new R[lga]), ni(nni),nj(nnj),n(0),m(0),mtype(t),data(datasize*(lki+lkj?2:1)) , onFace(lki+lkj), lnki(lki),lnkj(lkj), nik(lki? new int[lki*2]:0), nikk(nik+lki), njk(lkj? new int[lkj*2]:0), njkk(njk+lkj), optim(ooptim) { ffassert(lki>=0);}// non teste ??? .... F. hecht ... virtual ~MatriceElementaire() { if(ni != nj) delete [] nj; delete [] ni; delete [] a; if ( nik) delete[] nik; } virtual R & operator() (int i,int j) =0; virtual void call(int ,int ie,int label,void * data,void *Q=0) =0; // const LinearComb,C_F0> * bilinearform; MatriceElementaire & operator()(int k,int ie,int label,void * s=0,void *B=0) { call(k,ie,label,s,B); return *this;} }; template class MatDataFES { public: typedef FES FESpace; typedef typename FESpace::FElement FElement; typedef typename FESpace::QFElement QFElement; typedef typename FESpace::QFBorderElement QFBorderElement; CountPointer cUh,cVh; const FESpace &Uh; const FESpace &Vh; const QFElement & FIT; const QFBorderElement & FIE; MatDataFES(const FESpace & UUh,const QFElement & fit, const QFBorderElement & fie) :Uh(UUh),Vh(UUh),FIT(fit),FIE(fie) {} MatDataFES(const FESpace & UUh,const FESpace & VVh,const QFElement & fit, const QFBorderElement & fie) :Uh(UUh),Vh(VVh),FIT(fit),FIE(fie) {} }; template class MatriceElementaireFES : public MatDataFES , public MatriceElementaire { public: typedef MatriceElementaire MElm ; using MElm::Full; using MElm::Symmetric; typedef typename MElm::TypeOfMatriceElementaire TypeOfMatriceElementaire; typedef FES FESpace; typedef typename FESpace::FElement FElement; typedef typename FESpace::QFElement QFElement; typedef typename FESpace::QFBorderElement QFBorderElement; MatriceElementaireFES(const FESpace & UUh,const FESpace & VVh,int llga ,int *nnj,int * nni,TypeOfMatriceElementaire t=Full, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) : MatDataFES(UUh,VVh,fit,fie), MatriceElementaire(UUh.esize()+VVh.esize(),llga,nnj,nni,t,optim) {} MatriceElementaireFES(const FESpace & UUh,int llga,int *nni, TypeOfMatriceElementaire t=Symmetric, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) : MatDataFES(UUh,UUh,fit,fie), MatriceElementaire(UUh.esize(),llga,nni,nni,t,optim) {} // for discontinous Galerkine method MatriceElementaireFES(const FESpace & UUh,int llga,int *nni, int lk, TypeOfMatriceElementaire t=Symmetric, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) : MatDataFES(UUh,UUh,fit,fie), MatriceElementaire(UUh.esize(),llga,nni,lk,t,optim) {} MatriceElementaireFES(const FESpace & UUh,const FESpace & VVh,int llga ,int *nnj,int lkj,int * nni,int lki,TypeOfMatriceElementaire t=Full, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) : MatDataFES(UUh,VVh,fit,fie), MatriceElementaire(UUh.esize()+VVh.esize(),llga,nnj,lkj,nni,lki,t,optim) {} ~MatriceElementaireFES() {} const LinearComb,C_F0> * bilinearform; MatriceElementaireFES & operator()(int k,int ie,int label,void * s=0,void *Q=0) { this->call(k,ie,label,s,Q); return *this;} }; template class MatriceElementairePleine:public MatriceElementaireFES { /* --- stockage -- // n = 4 m = 5 // 0 1 2 3 4 // 5 6 7 8 9 // 10 11 12 13 14 // 15 16 17 18 19 ------------------*/ public: typedef FES FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::QFElement QFElement; typedef typename FESpace::QFBorderElement QFBorderElement; typedef typename FESpace::FElement FElement; typedef typename FESpace::Mesh::Rd Rd; R & operator() (int i,int j) {return this->a[i*this->m+j];} // MatPleineElementFunc element; void (* element)(MatriceElementairePleine &,const FElement &,const FElement &, double*,int ie,int label,void *,Rd *) ; void (* faceelement)(MatriceElementairePleine &,const FElement &,const FElement &,const FElement &,const FElement &, double*,int ie,int iee, int label,void *,Rd *) ; void call(int k,int ie,int label,void *,void *B); MatriceElementairePleine & operator()(int k,int ie,int label,void * stack=0,Rd *Q=0) {call(k,ie,label,stack,Q);return *this;} MatriceElementairePleine(const FESpace & VVh, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) :MatriceElementaireFES(VVh, Square(VVh.MaximalNbOfDF()), new int[VVh.MaximalNbOfDF()],this->Full,fit,fie,optim), element(0),faceelement(0) {} // matrice for VF or Galerkin Discontinus MatriceElementairePleine(const FESpace & VVh,bool VF, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) :MatriceElementaireFES(VVh, Square(VVh.MaximalNbOfDF()*2), new int[VVh.MaximalNbOfDF()*2], VF?VVh.MaximalNbOfDF()*2:0, this->Full,fit,fie,optim), element(0),faceelement(0) {} MatriceElementairePleine(const FESpace & UUh,const FESpace & VVh, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) :MatriceElementaireFES(UUh,VVh, UUh.MaximalNbOfDF()*VVh.MaximalNbOfDF(), new int[UUh.MaximalNbOfDF()], new int[VVh.MaximalNbOfDF()],this->Full,fit,fie,optim), element(0),faceelement(0) {} MatriceElementairePleine(const FESpace & UUh,const FESpace & VVh,bool VF, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) :MatriceElementaireFES(UUh,VVh, UUh.MaximalNbOfDF()*VVh.MaximalNbOfDF()*4, new int[UUh.MaximalNbOfDF()*2],VF?UUh.MaximalNbOfDF()*2:0, new int[VVh.MaximalNbOfDF()*2],VF?VVh.MaximalNbOfDF()*2:0,this->Full,fit,fie,optim), element(0),faceelement(0) {} }; template class MatriceElementaireSymetrique:public MatriceElementaireFES { // --- stockage -- // 0 // 1 2 // 3 4 5 // 6 7 8 9 // 10 . . . . // public: typedef FES FESpace; typedef typename FESpace::Mesh Mesh; typedef typename FESpace::QFElement QFElement; typedef typename FESpace::QFBorderElement QFBorderElement; typedef typename FESpace::FElement FElement; typedef typename FESpace::Mesh::Rd Rd; R & operator()(int i,int j) {return j < i ? this->a[(i*(i+1))/2 + j] : this->a[(j*(j+1))/2 + i] ;} void (* element)(MatriceElementaireSymetrique &,const FElement &, double*,int ie,int label,void *,Rd *) ; void (* mortar)(MatriceElementaireSymetrique &,const FMortar &,void *) ; void call(int k,int ie,int label,void * stack,void *B); MatriceElementaireSymetrique(const FESpace & VVh, const QFElement & fit=*QFElement::Default, const QFBorderElement & fie =*QFBorderElement::Default,int optim=1) :MatriceElementaireFES( VVh, int(VVh.MaximalNbOfDF()*(VVh.MaximalNbOfDF()+1)/2), new int[VVh.MaximalNbOfDF()],this->Symmetric, fit,fie,optim), element(0),mortar(0) {} MatriceElementaireSymetrique & operator()(int k,int ie,int label,void * stack=0,Rd *B=0) {this->call(k,ie,label,stack,B);return *this;}; }; template class MatriceProfile; // classe modele pour matrice creuse // --------------------------------- template class MatriceCreuse : public RefCounter,public VirtualMatrice { public: MatriceCreuse(int NbOfDF,int mm,int ddummy) : VirtualMatrice(NbOfDF,mm),n(NbOfDF),m(mm),dummy(ddummy){} MatriceCreuse(int NbOfDF) : VirtualMatrice(NbOfDF),n(NbOfDF),m(NbOfDF),dummy(1){} int n,m,dummy; virtual int size() const =0; virtual MatriceCreuse & operator +=(MatriceElementaire & )=0; virtual void operator=(const R & v) =0; // Mise a zero KN_ & MatMul(KN_ &ax,const KN_ &x) const { ax= R(); addMatMul(x,ax); return ax;} virtual ostream& dump (ostream&) const =0; virtual void Solve(KN_ & x,const KN_ & b) const =0; virtual ~MatriceCreuse(){} virtual R & diag(int i)=0; virtual void SetBC(int i,double tgv)=0; virtual void SetBC(char *wbc,double tgv) { for (int i=0; i *toMatriceMorse(bool transpose=false,bool copy=false) const {return 0;} // not virtual bool addMatTo(R coef,std::map< pair, R> &mij,bool trans=false,int ii00=0,int jj00=0,bool cnj=false,double threshold=0.,const bool keepSym=false)=0; // Add FH april 2005 virtual R pscal(const KN_ & x,const KN_ & y) =0 ; // produit scalaire virtual double psor(KN_ & x,const KN_ & gmin,const KN_ & gmax , double omega) =0; virtual void setdiag(const KN_ & x)=0 ; virtual void getdiag( KN_ & x) const =0 ; // end add virtual int NbCoef() const {return 0;}; virtual void setcoef(const KN_ & x)=0 ; virtual void getcoef( KN_ & x) const =0 ; // Add FH oct 2005 bool ChecknbLine(int nn) const { return n==nn;} bool ChecknbColumn(int mm) const { return m==mm;} virtual R trace() const {ffassert(n==m); R t=R(), *p; for(int i=0; i inline ostream& operator <<(ostream& f,const MatriceCreuse & m) {return m.dump(f);} template KN_ & operator/=(KN_ & x ,const MatriceProfile & a) ; enum FactorizationType { FactorizationNO=0, FactorizationCholeski=1, FactorizationCrout=2, FactorizationLU=3}; template class MatriceProfile:public MatriceCreuse { public: mutable R *L; // lower mutable R *U; // upper mutable R *D; // diagonal int *pL; // profile L int *pU; // profile U mutable FactorizationType typefac; FactorizationType typesolver; ostream& dump (ostream&) const ; MatriceProfile(const int n,const R *a); template MatriceProfile(const FESpace &,bool VF=false); MatriceProfile(int NbOfDF,R* d, R* u, int * pu, R* l, int * pl, FactorizationType tf=FactorizationNO) : MatriceCreuse(NbOfDF),L(l),U(u),D(d),pL(pl),pU(pu), typefac(tf),typesolver(FactorizationNO){} const MatriceProfile t() const {return MatriceProfile(this->n,D,L,pL,U,pU,typefac);} const MatriceProfile lt() const {return MatriceProfile(this->n,0,L,pL,0,0);} const MatriceProfile l() const {return MatriceProfile(this->n,0,0,0,L,pL);} const MatriceProfile d() const {return MatriceProfile(this->n,D,0,0,0,0);} const MatriceProfile ld() const {return MatriceProfile(this->n,D,0,0,L,pL);} const MatriceProfile ldt() const {return MatriceProfile(this->n,D,L,pL,0,0);} const MatriceProfile du() const {return MatriceProfile(this->n,D,U,pU,0,0);} const MatriceProfile u() const {return MatriceProfile(this->n,0,U,pU,0,0);} const MatriceProfile ut() const {return MatriceProfile(this->n,0,0,0,U,pU);} R trace() const {ffassert(this->n==this->m); R t=R(); for(int i=0; in; ++i) t+= D[i]; return t; } void Solve(KN_ &x,const KN_ &b) const { /*if (typefac==0) code faux // FH nov 2006 switch(typefac) { FactorizationCholeski: cholesky() ; break; FactorizationCrout: crout(); break; FactorizationLU: LU(); break; }*/ if (&x != &b) x=b;x/=*this;} int size() const ; void resize(int n,int m) { AFAIRE("MatriceProfile::resize");} // a faire ... add march 2009 FH ~MatriceProfile(); // KN_ operator* (const KN_ & ) const ; void addMatMul(const KN_ &x,KN_ &ax) const; void addMatTransMul(const KN_ &x,KN_ &ax) const ; // { this->t().addMatMul(x,ax);} MatriceCreuse & operator +=(MatriceElementaire &); void operator=(const R & v); // Mise a zero void cholesky(double = EPSILON/8.) const ; // void crout(double = EPSILON/8.) const ; // void LU(double = EPSILON/8.) const ; // R & diag(int i) { return D[i];} void SetBC (int i,double tgv) { if( tgv>=0) D[i]=tgv; else { ffassert(tgv<0); } // to hard .. } R & operator()(int i,int j) { if(i!=j) ffassert(0); return D[i];} // a faire R * pij(int i,int j) const { if(i!=j) ffassert(0); return &D[i];} // a faire Modif FH 31102005 MatriceMorse *toMatriceMorse(bool transpose=false,bool copy=false) const ; template void map(const F & f) { for(int i=0;in;++i) D[i]=f(D[i]); if (L) for(int i=0;in];++i) L[i]=f(L[i]); if (L && (L != U) ) for(int i=0;im];++i) U[i]=f(U[i]); } template MatriceProfile(const MatriceProfile & A) : MatriceCreuse(A.n,A.m,0) { typefac=A.typefac; pL= docpy(A.pL,this->n+1); D = docpy(A.D,this->n); if ( A.pL == A.pU ) pU=pL; else pU= docpy(A.pU,this->m+1); L= docpy(A.L,pL[this->n]); if ( A.L == A.U ) U=L; else U= docpy(A.U,pU[this->m]); } bool addMatTo(R coef,std::map< pair, R> &mij,bool trans=false,int ii00=0,int jj00=0,bool cnj=false,double threshold=0.,const bool keepSym=false); // Add FH april 2005 R pscal(const KN_ & x,const KN_ & y); // produit scalaire double psor(KN_ & x,const KN_ & gmin,const KN_ & gmax , double omega); void setdiag(const KN_ & x) ; void getdiag( KN_ & x) const ; // end add // Add FH oct 2005 int NbCoef() const ; void setcoef(const KN_ & x); void getcoef( KN_ & x) const ; // end add /*---------------------------------------------------------------- D[i] = A[ii] L[k] = A[ij] j < i avec: pL[i]<= k < pL[i+1] et j = pL[i+1]-k U[k] = A[ij] i < j avec: pU[j]<= k < pU[j+1] et i = pU[i+1]-k remarque pL = pU generalement si L = U => la matrice est symetrique ------------------------------------------------------------------- */ private: void operator=(const MatriceProfile & A); }; template class MatriceMorse:public MatriceCreuse { // numebering is no-symmetric // the all line i : // k= lg[i] .. lg[i+1]+1 // j = cl[k] // aij=a[k] // otherwise symmetric case // same but just the LOWER part is store (j <= i) // and aii exist always in symmetric case // ----------------------------------------- public: int nbcoef; bool symetrique; R * a; int * lg; int * cl; public: class VirtualSolver :public RefCounter { friend class MatriceMorse; virtual void Solver(const MatriceMorse &a,KN_ &x,const KN_ &b) const =0; }; MatriceMorse():MatriceCreuse(0),nbcoef(0),symetrique(true),a(0),lg(0),cl(0),solver(0) {}; MatriceMorse(KNM_ & A, double tol) ; MatriceMorse(const int n,const R *a); // :MatriceCreuse(n),solver(0) {} MatriceMorse(istream & f); template explicit MatriceMorse(const FESpace & Uh,bool sym,bool VF=false) :MatriceCreuse(Uh.NbOfDF),solver(0) {Build(Uh,Uh,sym,VF);} template explicit MatriceMorse(const FESpace & Uh,const FESpace & Vh,bool VF=false) :MatriceCreuse(Uh.NbOfDF,Vh.NbOfDF,0),solver(0) {Build(Uh,Vh,false,VF);} template explicit MatriceMorse(const FESpace & Uh,const FESpace & Vh, void (*build)(MatriceMorse *,const FESpace & Uh,const FESpace & Vh,void *data),void *data=0 ) :MatriceCreuse(Uh.NbOfDF,Vh.NbOfDF,0),solver(0) {build(this,Uh,Vh,data); } MatriceMorse(int nn,int mm,int nbc,bool sym,R *aa=0,int *ll=0,int *cc=0,bool dd=false, const VirtualSolver * s=0,bool transpose=false ) :MatriceCreuse(nn,mm,dd && !transpose), nbcoef(nbc), symetrique(sym), // transpose = true => dummy false (new matrix) a(docpyornot(this->dummy,aa,nbc)), lg(docpyornot(this->dummy,ll,nn+1)), cl(docpyornot(this->dummy,cc,nbc)), solver(s) { if(transpose) dotransposition(); }; void Solve(KN_ &x,const KN_ &b) const; int size() const ; void addMatMul(const KN_ &x,KN_ &ax) const; void addMatTransMul(const KN_ &x,KN_ &ax) const; MatriceMorse & operator +=(MatriceElementaire &); void operator=(const R & v) { for (int i=0;i< nbcoef;i++) a[i]=v;} virtual ~MatriceMorse(){ if (!this->dummy) { delete [] a; delete [] cl;delete [] lg;}} ostream& dump(ostream & f) const ; R * pij(int i,int j) const ; R operator()(int i,int j) const {R * p= pij(i,j) ;throwassert(p); return *p;} R & operator()(int i,int j) {R * p= pij(i,j) ;throwassert(p); return *p;} R & diag(int i) {R * p= pij(i,i) ;throwassert(p); return *p;} R trace() const {ffassert(this->n==this->m); R t=R(),*p; for(int i=0; in; ++i) {p=pij(i,i) ;if(p) t+= *p; } return t; } void SetBC (int i,double tgv) { R * p= pij(i,i) ; ffassert(p); if( tgv>=0) *p=tgv; else { ffassert(!symetrique);// for (int k=lg[i];kn; ++i) if(tgv<0) { if( wbc[i] ) { for (int k=lg[i];k= 0 R * p= pij(i,i) ; ffassert(p); *p=tgv; } } void SetSolver(const VirtualSolver & s){solver=&s;} void SetSolverMaster(const VirtualSolver * s){solver.master(s);} bool sym() const {return symetrique;} // Add FH april 2005 R pscal(const KN_ & x,const KN_ & y); // produit scalaire double psor(KN_ & x,const KN_ & gmin,const KN_ & gmax , double omega); void setdiag(const KN_ & x) ; void getdiag( KN_ & x) const ; // end add // Add FH oct 2005 int NbCoef() const ; void setcoef(const KN_ & x); void getcoef( KN_ & x) const ; // end add void resize(int n,int m) ; // add march 2009 ... template MatriceMorse(int nn,int mm, std::map< pair, K> & m, bool sym); template void prod(const MatriceMorse & B, MatriceMorse & AB); MatriceMorse *toMatriceMorse(bool transpose=false,bool copy=false) const { return new MatriceMorse(this->n,this->m,nbcoef,symetrique,a,lg,cl,copy, solver,transpose);} bool addMatTo(R coef,std::map< pair, R> &mij,bool trans=false,int ii00=0,int jj00=0,bool cnj=false,double threshold=0.,const bool keepSym=false); template static RR CastTo(K b){return b;} template MatriceMorse(const MatriceMorse & , R (*f)(K) ); template MatriceMorse(const MatriceMorse & ); private: void dotransposition () ; // do the transposition CountPointer solver; void operator=(const MatriceMorse & ); template void Build(const FESpace & Uh,const FESpace & Vh,bool sym,bool VF=false); }; template class StopGC { public: virtual bool Stop(int iter, R *, R * ){cout << " Stop !!!!!\n"; return false;} }; template// S=StopGC int ConjuguedGradient(const M & A,const P & C,const KN_ &b,KN_ &x,const int nbitermax, double &eps,long kprint=1000000000,S *Stop=0) { // ConjuguedGradient lineare A*x est appele avec des conditions au limites // non-homogene puis homogene pour calculer le gradient if (verbosity>50) kprint=2; if (verbosity>99) cout << A << endl; // throwassert(&x && &b && &A && &C); typedef KN Rn; int n=b.N(); throwassert(n==x.N()); Rn g(n), h(n), Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g = A*x; double xx= RNM::real((x,conj(x))); double epsold=eps; g -= b;// g = Ax-b Cg = C*g; // gradient preconditionne h =-Cg; double g2 = RNM::real((Cg,conj(g))); if (g2 < 1e-30) { if(verbosity>1 || (kprint<100000)) cout << "GC g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } double reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { Ah = A*h; double hAh =RNM::real((h,conj(Ah))); // if (Abs(hAh)<1e-30) ExecError("CG2: Matrix non defined, sorry "); R ro = - RNM::real((g,conj(h)))/ hAh; // ro optimal (produit scalaire usuel) x += ro *h; g += ro *Ah; // plus besoin de Ah, on utilise avec Cg optimisation Cg = C*g; double g2p=g2; g2 = RNM::real((Cg,conj(g))); bool stop = Stop && Stop->Stop(iter,x,g); if ( !(iter%kprint) && iter && (verbosity>3) ) cout << "CG:" <0 ) { // change fo eps converge to fast due to the // penalization of boundary condition. eps = epsold*epsold*g2; if (verbosity>3 || (kprint<3)) cout << "CG converge to fast (pb of BC) restart: " << iter << " ro = " << ro << " ||g||^2 = " << g2 << " <= " << reps2 << " new eps2 =" << eps <1 || (kprint<100000) ) cout << "CG converge: " << iter << " ro = " << ro << " ||g||^2 = " << g2 << endl; return 1;// ok } } double gamma = g2/g2p; h *= gamma; h -= Cg; // h = -Cg * gamma* h } if(verbosity) cout << " GC: method doesn't converge in " << nbitermax << " iteration , xx= " << xx<< endl; return 0; } template// S=StopGC int ConjuguedGradient2(const M & A,const P & C,KN_ &x,const KN_ &b,const int nbitermax, double &eps,long kprint=1000000000,S *Stop=0) { // ConjuguedGradient2 affine A*x = 0 est toujours appele avec les condition aux limites // ------------- // throwassert(&x && &A && &C); typedef KN Rn; int n=x.N(); // if (verbosity>99) kprint=1; R ro=1; Rn g(n),h(n),Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g = A*x; g -= b; Cg = C*g; // gradient preconditionne h =-Cg; R g2 = (Cg,g); if (g2 < 1e-30) { if(verbosity>1 || kprint< 1000000) cout << "GC g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } if (verbosity>5 || (kprint<2)) cout << " 0 GC g^2 =" << g2 << endl; R reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { R rop = ro; x += rop*h; // x+ rop*h , g=Ax (x old) // ((Ah = A*x - b) - g); // Ah -= b; // Ax + rop*Ah = rop*Ah + g = // Ah -= g; // Ah*rop Ah = A*x; Ah -= b; // Ax + rop*Ah = rop*Ah + g = Ah -= g; // Ah*rop R hAh =(h,Ah); if (RNM::norm2(hAh)<1e-60) ExecError("CG2: Matrix is not defined (/0), sorry "); ro = - (g,h)*rop/hAh ; // ro optimal (produit scalaire usuel) if ( ro != ro) ExecError("CG2: Bug : ro is NaN ??? "); x += (ro-rop) *h; g += (ro/rop) *Ah; // plus besoin de Ah, on utilise avec Cg optimisation Cg = C*g; R g2p=g2; g2 = (Cg,g); bool stop = Stop && Stop->Stop(iter,x,g); if ( ( (iter%kprint) == kprint-1) /*&& verbosity >1*/ ) cout << "CG:" < #include #include #include "rgraph.hpp" using namespace std; #include "RNM.hpp" #include "fem.hpp" #include "FESpacen.hpp" #include "FESpace.hpp" extern long verbosity ; namespace Fem2D { int Make(const TypeOfFE ** t,int k,KN & P,KN & I) { typedef TypeOfFE::IPJ IPJ; int n=0,nn=0; for (int i=0;i p(t[i]->P_Pi_h); for (int j=0;j ajout I[nn]=n++; for (int l=0;l detruit break;} } } } return n; // nombre de point commun } KN Makepij_alpha(const TypeOfFE ** t,int k) { // Attention les df est numerote de facon croissant // en faisant une boucle sur les TypeOfFE // comme dans la class TypeOfFESum typedef TypeOfFE::IPJ IPJ; int n=0,m=0; for (int i=0;i< k;i++) { n += t[i]->pij_alpha.N(); m += t[i]->P_Pi_h.N(); } KN ij(n); KN I(m); KN P(m); Make(t,k,P,I); int p0=0,i0=0,N0=0,nn=0; for (int i=0;i< k;i++) { const KN p(t[i]->pij_alpha); for (int j=0;jNbDoF; p0+=t[i]->P_Pi_h.N(); N0+=t[i]->N;} return ij; } KN MakeP_Pi_h(const TypeOfFE **t,int k) { int np=0; for (int i=0;i< k;i++) np += t[i]->P_Pi_h.N(); KN< R2 > yy(np); KN zz(np); int kk=Make(t,k,yy,zz); // cout << " MakeP_Pi_h: " << kk << " from " << np << endl; return yy(SubArray(kk)); } ListOfTFE * ListOfTFE::all ; // list of all object of this type void init_static_FE(); // to correct so probleme with static Library FH aout 2004 // the list of other FE file to force the link ListOfTFE::ListOfTFE (const char * n,TypeOfFE *t) : name(n),tfe(t) { if(!t) assert(t); static int count=0; if (count++==0) all=0; // init of all in dependant of the ordre of the objet file next=all; all=this; // to correct so probleme with static Library FH aout 2004 init_static_FE(); } const TypeOfFE ** Make(const FESpace **l,int k) { const TypeOfFE** p=new const TypeOfFE*[k]; for (int i=0;iTFE[0]; return p; } const TypeOfFE ** Make(const TypeOfFE **l,int k) { const TypeOfFE** p=new const TypeOfFE*[k]; for (int i=0;i Aipj(ipj.N()); KNM Vp(N,PtHat.N()); Pi_h(Aipj); for (int p=0;p Vpp(Vp('.',p)); for (int j=0;j & v) const { int k0=0; for (int i=0;iNbDoF; // ici BUG 28/11/2006 FH int n=teb[i]->pij_alpha.N(); // ici BUG KN_ sv(v(SubArray(n,k0))); teb[i]->Pi_h_alpha(K,sv); k0+= n;} assert(pij_alpha.N()==k0); } ~TypeOfFESum(){ delete [] teb;} } ; class FEProduitConstruct { protected: int k; const TypeOfFE & teb; int * data; int * data1; FEProduitConstruct(int kk,const TypeOfFE &t) ; ~FEProduitConstruct(){delete [] data;} }; class TypeOfFEProduit: protected FEProduitConstruct, public TypeOfFE { public: TypeOfFEProduit(int kk,const TypeOfFE &t): FEProduitConstruct(kk,t),TypeOfFE(t,kk,data,data1) {} void FB(const bool * whatd,const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; virtual void Pi_h_alpha(const baseFElement & K,KN_ & v) const { int nbof=teb.NbDoF; for (int i=0,k0=0;i sv(v(SubArray(nbof,k0))); teb.Pi_h_alpha(K,sv); } } ~TypeOfFEProduit(){} } ; FEProduitConstruct::FEProduitConstruct(int kk,const TypeOfFE &t) :k(kk),teb(t) { int m= teb.NbDoF; KN nn(teb.NbNode); nn=0; // nb de dl par noeud for (int i=0;i m; int i=k,j; while(i--) // on va a l'envert pour avoir comp[i] <=i m[teb[i]]=i; // l'ordre comp est important comp est croissant mais pas de pb. i=k; while(i--) comp[i]=m[teb[i]]; // comp[i] <=i // reservatition des intervalles en espaces int n=0,N=0; for ( j=0;jN;} NN[kk] = N; // reservation des interval en df n=0; for ( j=0;jNbDoF;} DF[kk] = n; // n = nb de DF total // N the fem is in R^N data = new int [n*(5+2) + 3*N]; data1 = data + n*5+N; // april 2006 add 2 array ???? int c=0; // int ki= 0; // recherche des noeuds KN w(7),nn(7); w=0; nn=0; for ( j=0;jNbDoF;i++) nn[teb[j]->DFOnWhat[i]]++; nbn=0; for( j=0;j<7;j++) if (nn[j]) nn[j]=nbn++; else nn[j]=-1; KN dln(7); dln=0; // nn donne numero de noeud sur what for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOnWhat[i]; for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOfNode[i]+dln[teb[j]->DFOnWhat[i]]; for ( i=0;iNbDoF;i++) dln[teb[j]->DFOnWhat[i]]=Max(dln[teb[j]->DFOnWhat[i]],data[cc++]+1); } for ( j=0;jNbDoF;i++) data[c++] = nn[teb[j]->DFOnWhat[i]]; } for ( j=0;jNbDoF;i++) data[c++] = j; // node from of FE for ( j=0;jNbDoF;i++) data[c++] = i; // node from of df in FE // error -- here //in case of [P2,P2],P1 // we expect 0,0,1 and we get 0 1 2 // => wrong BC ???? int xx=0; for (j=0;jN;i++) { data[c] = teb[j]->dim_which_sub_fem[i]+xx; xxx=Max(xxx,data[c]+1); c++; } xx=xxx; } // ou dans la partie miminal element finite atomic int ci=n; int cf=2*n; int cl=cf+N;; int cj=0; int ccc=0; for ( j=0;jnb_sub_fem) for ( i=0;iNbDoF;i++) { int il= teb[j]->fromASubDF[i]; int jl= teb[j]->fromASubFE[i]; data1[ci++]=il; data1[cj++]=ccc+jl; } for (int j=0,ccn=0 ; jNbDoF) for(int k=0;kN;++k) { data1[cf++] = ccn + teb[j]->begin_dfcomp[k]; data1[cl++] = ccn + teb[j]->end_dfcomp[k]; } ffassert(cl==2*n+2*N); ffassert(c== 5*n+N); /* int cc=0; cout << " Data : " << endl; for ( i=0;i<5;i++) { for (j=0;j & u,int componante,int op) const ; } ; /////////////////////////////////////////////////////////////////////////////// // FH pour tester des idee de schema ---- Juin 2005 --- /////////////////////////////////////////////////////////////////////////////// // un VF cell centre class TypeOfFE_P0VF : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P0VF(): TypeOfFE(1,0,0,1,Data,1,1,3,3,Pi_h_coef) { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1) }; for (int i=0;i & u,int componante,int op) const ; } ; int TypeOfFE_P0VF::Data[]={0,1,2, 0,0,0, 0,1,2, 0,0,0, 0,1,2, 0, 0,3}; double TypeOfFE_P0VF::Pi_h_coef[]={1.,1.,1.}; // bofbof a verifier ... R TypeOfFE_P0VF::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r=0; if (op==0) { R l0=0,l1=PHat.x,l2=PHat.y; l1 = l1 * 3. < 1; l2 = l2 * 3. < 1; l0 = 1 - l0 -l2; r = u0*l0+u1*l1+l2*u2; } else { r =0; } // cout << r << "\t"; return r; } void TypeOfFE_P0VF::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); if (whatd[op_id]) { R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; l1 = l1 * 3. < 1; l2 = l2 * 3. < 1; l0 = 1 - l0 -l2; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); f0[0] = l0; f0[1] = l1; f0[2] = l2;} } /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// NEW //////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// class TypeOfFE_P1Bubble : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P1Bubble(): TypeOfFE(1,0,1,1,Data,1,1,4,4,Pi_h_coef) { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1), R2(1./3.,1./3.) }; for (int i=0;i & u,int componante,int op) const ; } ; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// class TypeOfFE_P2Lagrange : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P2Lagrange(): TypeOfFE(1,1,0,1,Data,3,1,6,6,Pi_h_coef) { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1),R2(0.5,0.5),R2(0,0.5),R2(0.5,0) }; for (int i=0;icounter), MaxNbNodePerElement(t->MaxNbNodePerElement), MaxNbDFPerElement(t->MaxNbDFPerElement*k), NodesOfElement(t->NodesOfElement), FirstNodeOfElement(t->FirstNodeOfElement), FirstDfOfNode(0), NbOfElements(t->NbOfElements), NbOfDF(t->NbOfDF*k), NbOfNode(t->NbOfNode), Nproduit(t->Nproduit*k) { throwassert(t==0 || t->FirstDfOfNode==0); (*counter)++; // correction mai 2006 bug in counter incrementation } ConstructDataFElement::ConstructDataFElement (const Mesh &Th,/*int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement*/ const KN & TFEs,const TypeOfMortar *tm, int nbdfv,const int *ndfv,int nbdfe,const int *ndfe) : counter(NewCounter()) { Make(Th,TFEs,/*NbDfOnSommet,NbDfOnEdge,NbDfOnElement,*/ tm,nbdfv,ndfv,nbdfe,ndfe); } ConstructDataFElement::ConstructDataFElement(const FESpace ** l,int k,const KN & TFEs) : counter(NewCounter()) { int NbDfOnSommet=0; int NbDfOnEdge=0; int NbDfOnElement=0; const Mesh & Th(l[0]->Th); for (int i=0;iTFE[0]->NbDfOnVertex; NbDfOnEdge += l[i]->TFE[0]->NbDfOnEdge; NbDfOnElement += l[i]->TFE[0]->NbDfOnElement; ffassert( &Th== &l[i]->Th); ffassert( l[i]->TFE.constant()); } Make(Th,TFEs);//NbDfOnSommet,NbDfOnEdge,NbDfOnElement,0); } void ConstructDataFElement::Make(const Mesh &Th, const KN & TFEs, /*int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement,*/const TypeOfMortar *tm, int nb_dfv,const int *ndfv,int nb_dfe,const int *ndfe) /* pour le condition de periodicit .. nb_dfv : nombre de sommets recolle par periodicit ndfv: numerotation des sommets pour CL de periodicite ndfv[i] = numero du sommet i (iNodeOn(NbNodes); NodeOn=-1; int nb[7]; for (int i=0;i<7;i++) nb[i]=0; int kkk=0; for (int df=0;df=0) assert( NodeOn[node] ==w); else { NodeOn[node]=w; ++kkk; ++nb[w]; }// on vertex 0 } assert(nb[0]==nb[1] && nb[1] == nb[2]); assert(nb[3]==nb[4] && nb[4] == nb[5]); NbNodeonVertex=nb[0]; NbNodeonEdge=nb[3]; NbNodeonElement=nb[6]; assert(kkk==NbNodes); }*/ KN NbDFonNode(NbNodes), NodeIsOn(NbNodes); NbDFonNode=0; for (int df=0;df0, ke=TFE.NbNodeOnEdge>0, kt=TFE.NbNodeOnElement>0; /* Vieux code if(NbDfOnSommet) { nbne+=3; ks=1; ndf=NbDfOnSommet;} if(NbDfOnEdge) { nbne+=3; ke=1; samendf &= !ndf || ndf == NbDfOnEdge; ndf=NbDfOnEdge;} if(NbDfOnElement) { nbne+=1; kt=1; samendf &= !ndf || ndf == NbDfOnElement; ndf=NbDfOnElement;} int NbDFonNode[7],NodeIsOn[7]; { int j=0,k=0; if(ks) { NbDFonNode[j++]=NbDfOnSommet; NbDFonNode[j++]=NbDfOnSommet; NbDFonNode[j++]=NbDfOnSommet;} if(ke) { NbDFonNode[j++]=NbDfOnEdge; NbDFonNode[j++]=NbDfOnEdge; NbDFonNode[j++]=NbDfOnEdge;} if(kt) { NbDFonNode[j++]=NbDfOnElement;} if (ks) {NodeIsOn[k++]=0;NodeIsOn[k++]=1;NodeIsOn[k++]=2;} if (ke) {NodeIsOn[k++]=3;NodeIsOn[k++]=4;NodeIsOn[k++]=5;} if (kt) {NodeIsOn[k++]=6;} throwassert(j == nbne); } */ MaxNbNodePerElement=nbne; // if ( ks && (!ke && ! kt) && (ndfv==0 && ndfe==0)) {nn=Th.nv; NodesOfElement=0; } else { // constuction du tableau NodesOfElement bofbof // computation of the length lne of array NodesOfElement int lne= Th.nt*nbne; if (Th.NbMortars) { samendf= false; NbOfNodeL=Th.NbMortars; ffassert(tm); FirstNodeOfElement = new int[NbOfElements+1]; int k=0,kk=0; for (k=0;kNbOfNodes(Th,Th.mortars[im]); } FirstNodeOfElement[k++]=lne; } NodesOfElement = new int[lne]; for (int i=0;i= 0 && jj >=0 && !(( kk == k ) && ( jj=j ) ) ) { if (k < kk ) kjj = NbNodeonEdge-kj-1; // else kj = NbNodeonEdge-kj-1, kjj = NbNodeonEdge-kj-1; } if (kjj >=0) NodesOfElement[kk*nbne+oe+jj] = nn + ndfe[be]*NbNodeonEdge+ kjj ; // adj NodesOfElement[k*nbne+oe+j] = nn + ndfe[be]*NbNodeonEdge+ kj ; // new } } nn += nb_dfe; } for (int k=0;k=k && jjj == jj); NodesOfElement[kk*nbne+oe+jjj] = nn ; // adj NodesOfElement[i++] = nn++ ; // new } else i++; } for (int jj=0;jjConstructionOfNode(Th,im,NodesOfElement,FirstNodeOfElement,nn); Mortar & M(Th.mortars[im]); NodesOfElement[i++] = nn++; // the first node is the lag. mul. int n=M.NbT(); for (int kk=0;kkNbLagrangeMult(Th,Th.mortars[km]); // On node par int nodemul = NodesOfElement[fk]; // the first node is the lagr. mul. throwassert(FirstDfOfNode[nodemul+1]==-1); FirstDfOfNode[nodemul+1]= ndlmul; NbOfDFL += ndlmul; int nbdle=0; //int nbnm=lk-fk; for (int j=fk;j2) { cout << " FESpace: Nb Of Nodes = " << nn ; if(NbOfNodeL) cout << " Nb of Lagrange Mul Node = " << NbOfNodeL ; cout << " Nb of DF = " << NbOfDF << endl; if(NbOfDFL) { cout << " Nb of Lagrange Mul DF = " << NbOfDFL ; cout << " MaxNbDFPerElement = " << MaxNbDFPerElement ; }; cout << endl; } } FESpace::FESpace(const FESpace & Vh,int k ) : Th(Vh.Th), ptrTFE(new TypeOfFEProduit(k,*Vh.TFE[0])), TFE(1,0,ptrTFE), cdef(Vh.cdef?new ConstructDataFElement(Vh.cdef,k):0), cmesh(Vh.Th), N(Vh.N*k), Nproduit(Vh.Nproduit*k), NbOfDF(Vh.NbOfDF*k), NbOfElements(Vh.NbOfElements), NbOfNodes(Vh.NbOfNodes), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), NodesOfElement(Vh.NodesOfElement), FirstNodeOfElement(Vh.FirstNodeOfElement), FirstDfOfNodeData(cdef?cdef->FirstDfOfNode:0), tom(0), MaxNbNodePerElement(Vh.MaxNbNodePerElement), MaxNbDFPerElement(Vh.MaxNbDFPerElement*k) { // correction mai 2006 no renumbering of existing cdef if(cdef && (Vh.cdef && Vh.cdef->counter != cdef->counter)) { // cout << " remum " << cdef->counter << " != " << Vh.cdef->counter <Nproduit), NbOfDF(cdef->NbOfDF), NbOfElements(cdef->NbOfElements), NbOfNodes(cdef->NbOfNode), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), NodesOfElement(cdef->NodesOfElement), FirstNodeOfElement(cdef->FirstNodeOfElement), FirstDfOfNodeData(cdef->FirstDfOfNode), tom(0) , MaxNbNodePerElement(cdef->MaxNbNodePerElement), MaxNbDFPerElement(cdef->MaxNbDFPerElement) { if(cdef) renum(); Show(); // verification long snbdf=0; for(int i=0;iNbOfDF; if( snbdf !=NbOfDF) cerr << " Problem build of FEspace (2d) (may be : due to periodic Boundary condition missing ) FH " << endl << " The number of DF must be " << snbdf << " and it is " << NbOfDF <Nproduit), NbOfDF(cdef->NbOfDF), NbOfElements(cdef->NbOfElements), NbOfNodes(cdef->NbOfNode), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), NodesOfElement(cdef->NodesOfElement), FirstNodeOfElement(cdef->FirstNodeOfElement), FirstDfOfNodeData(cdef->FirstDfOfNode), tom(0) , MaxNbNodePerElement(cdef->MaxNbNodePerElement), MaxNbDFPerElement(cdef->MaxNbDFPerElement) { if(cdef) renum(); Show(); } FESpace::FESpace(const Mesh & TTh,const TypeOfFE & tef,int nbdfv,const int *ndfv,int nbdfe,const int *ndfe) : Th(TTh), ptrTFE(0), TFE(1,0,&tef), cdef(new ConstructDataFElement(TTh,TFE,0,nbdfv,ndfv,nbdfe,ndfe)), cmesh(TTh), //tef.NbDfOnVertex,tef.NbDfOnEdge,tef.NbDfOnElement,0,nbdfv,ndfv,nbdfe,ndfe)), N(tef.N), Nproduit(cdef->Nproduit), NbOfDF(cdef->NbOfDF), NbOfElements(cdef->NbOfElements), NbOfNodes(cdef->NbOfNode), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), NodesOfElement(cdef->NodesOfElement), FirstNodeOfElement(cdef->FirstNodeOfElement), FirstDfOfNodeData(cdef->FirstDfOfNode), tom(0), MaxNbNodePerElement(cdef->MaxNbNodePerElement), MaxNbDFPerElement(cdef->MaxNbDFPerElement) { if(tef.NbDfOnVertex || tef.NbDfOnEdge) renum(); Show(); } FESpace::~FESpace() { SHOWVERB(cout << " FESpace::~FESpace() " << endl); /* cout << " del FESpace " << this << " " << cdef << " " ; if(cdef) cout << cdef->NodesOfElement << endl; else cout << endl;*/ delete cdef; if(ptrTFE) delete ptrTFE; } FESpace::FESpace(const Mesh & TTh,const TypeOfFE & tef,const TypeOfMortar & tm) : Th(TTh), ptrTFE(0), TFE(1,0,&tef), cdef(new ConstructDataFElement(TTh,TFE,&tm)),//tef.NbDfOnVertex,tef.NbDfOnEdge,tef.NbDfOnElement,&tm)), cmesh(TTh), N(tef.N), Nproduit(1), NbOfDF(cdef->NbOfDF), NbOfElements(cdef->NbOfElements), NbOfNodes(cdef->NbOfNode), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), NodesOfElement(cdef->NodesOfElement), FirstNodeOfElement(cdef->FirstNodeOfElement), FirstDfOfNodeData(cdef->FirstDfOfNode), tom(&tm), MaxNbNodePerElement(cdef->MaxNbNodePerElement), MaxNbDFPerElement(cdef->MaxNbDFPerElement) { // cout << "avant renum ="<< *this <FB(whatd,Th,K,P,v); else v=val(SubArray(DF[j+1]-DF[j],DF[j]),SubArray(NN[j+1]-NN[j],NN[j]),t); } } R TypeOfFE_P1Lagrange::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r=0; if (op==op_id) { R l0=1-PHat.x-PHat.y,l1=PHat.x,l2=PHat.y; r = u0*l0+u1*l1+l2*u2; } else { const Triangle & T=K.T; R2 D0 = T.H(0) , D1 = T.H(1) , D2 = T.H(2) ; if (op==op_dx) r = D0.x*u0 + D1.x*u1 + D2.x*u2 ; else if(op==op_dy) r = D0.y*u0 + D1.y*u1 + D2.y*u2 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd[op_id]) { f0[0] = l0; f0[1] = l1; f0[2] = l2;} if (whatd[op_dx] || whatd[op_dy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } } } /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// NEW ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// void TypeOfFE_P1Bubble::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y, l1=P.x, l2=P.y, lb=l0*l1*l2*9.; if (val.N() <4) throwassert(val.N() >=4); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd[op_id]) { f0[0] = l0-lb; f0[1] = l1-lb; f0[2] = l2-lb; f0[3] = 3.*lb; } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)), Dlb((Dl0*l1*l2+Dl1*l0*l2+Dl2*l0*l1)*9.); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x-Dlb.x; f0x[1] = Dl1.x-Dlb.x; f0x[2] = Dl2.x-Dlb.x; f0x[3] = 3.*Dlb.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y-Dlb.y; f0y[1] = Dl1.y-Dlb.y; f0y[2] = Dl2.y-Dlb.y; f0y[3] = 3.*Dlb.y; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); R lbdxx= 18*((Dl0.x*Dl1.x)*l2+(Dl1.x*Dl2.x)*l0+(Dl2.x*Dl0.x)*l1); fxx[0] = -lbdxx; fxx[1] = -lbdxx; fxx[2] = -lbdxx; fxx[3] = 3*lbdxx; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); R lbdyy= 18*((Dl0.y*Dl1.y)*l2+(Dl1.y*Dl2.y)*l0+(Dl2.y*Dl0.y)*l1); fyy[0] = -lbdyy; fyy[1] = -lbdyy; fyy[2] = -lbdyy; fyy[3] = 3*lbdyy; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); R lbdxy= 9*(Dl0.x*Dl1.y+ Dl0.y*Dl1.x)*l2+(Dl1.x*Dl2.y+Dl1.y*Dl2.x)*l0+(Dl2.x*Dl0.y+Dl2.y*Dl0.x)*l1; fxy[0] = 4*Dl0.x*Dl0.y-lbdxy; fxy[1] = 4*Dl1.x*Dl1.y-lbdxy; fxy[2] = 4*Dl2.x*Dl2.y-lbdxy; fxy[3] = +3*lbdxy; } } } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /* void TypeOfFE_P1Lagrange::FB(const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,0)); RN_ f0x(val('.',0,1)); RN_ f0y(val('.',0,2)); f0[0] = l0; f0[1] = l1; f0[2] = l2; f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } void TypeOfFE_P2Lagrange::FB(const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=6); throwassert(val.M()==1); throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,0)); RN_ f0x(val('.',0,1)); RN_ f0y(val('.',0,2)); // -- f0[0] = l0*(2*l0-1); f0[1] = l1*(2*l1-1); f0[2] = l2*(2*l2-1); f0[3] = 4*l1*l2; // oppose au sommet 0 f0[4] = 4*l0*l2; // oppose au sommet 1 f0[5] = 4*l1*l0; // oppose au sommet 3 f0x[0] = Dl0.x*l4_0; f0x[1] = Dl1.x*l4_1; f0x[2] = Dl2.x*l4_2; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) ; f0y[0] = Dl0.y*l4_0; f0y[1] = Dl1.y*l4_1; f0y[2] = Dl2.y*l4_2; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } */ void TypeOfFE_P2Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=6); throwassert(val.M()==1); // throwassert(val.K()==3 ); val=0; // -- if (whatd[op_id]) { RN_ f0(val('.',0,op_id)); f0[0] = l0*(2*l0-1); f0[1] = l1*(2*l1-1); f0[2] = l2*(2*l2-1); f0[3] = 4*l1*l2; // oppose au sommet 0 f0[4] = 4*l0*l2; // oppose au sommet 1 f0[5] = 4*l1*l0; // oppose au sommet 3 } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x*l4_0; f0x[1] = Dl1.x*l4_1; f0x[2] = Dl2.x*l4_2; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) ; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y*l4_0; f0y[1] = Dl1.y*l4_1; f0y[2] = Dl2.y*l4_2; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); fxx[0] = 4*Dl0.x*Dl0.x; fxx[1] = 4*Dl1.x*Dl1.x; fxx[2] = 4*Dl2.x*Dl2.x; fxx[3] = 8*Dl1.x*Dl2.x; fxx[4] = 8*Dl0.x*Dl2.x; fxx[5] = 8*Dl0.x*Dl1.x; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); fyy[0] = 4*Dl0.y*Dl0.y; fyy[1] = 4*Dl1.y*Dl1.y; fyy[2] = 4*Dl2.y*Dl2.y; fyy[3] = 8*Dl1.y*Dl2.y; fyy[4] = 8*Dl0.y*Dl2.y; fyy[5] = 8*Dl0.y*Dl1.y; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); fxy[0] = 4*Dl0.x*Dl0.y; fxy[1] = 4*Dl1.x*Dl1.y; fxy[2] = 4*Dl2.x*Dl2.y; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } } } void TypeOfFE_P2bLagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y,lb=l0*l1*l2*3.; R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=7); throwassert(val.M()==1); // throwassert(val.K()==3 ); val=0; // -- if (whatd[op_id]) { R lb4=lb*4; RN_ f0(val('.',0,op_id)); f0[0] = l0*(2*l0-1)+lb; f0[1] = l1*(2*l1-1)+lb; f0[2] = l2*(2*l2-1)+lb; f0[3] = 4*l1*l2-lb4; // oppose au sommet 0 f0[4] = 4*l0*l2-lb4; // oppose au sommet 1 f0[5] = 4*l1*l0-lb4; // oppose au sommet 3 f0[6] = 9*lb; } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)), Dlb((Dl0*l1*l2+Dl1*l0*l2+Dl2*l0*l1)*3.), Dlb4(Dlb*4.); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x*l4_0 +Dlb.x; f0x[1] = Dl1.x*l4_1 +Dlb.x; f0x[2] = Dl2.x*l4_2 +Dlb.x; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) -Dlb4.x; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) -Dlb4.x; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) -Dlb4.x; f0x[6] = 9.*Dlb.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y*l4_0 +Dlb.y; f0y[1] = Dl1.y*l4_1 +Dlb.y; f0y[2] = Dl2.y*l4_2 +Dlb.y; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) -Dlb4.y; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) -Dlb4.y; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) -Dlb4.y; f0y[6] = 9*Dlb.y; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); R lbdxx= 6*((Dl0.x*Dl1.x)*l2+(Dl1.x*Dl2.x)*l0+(Dl2.x*Dl0.x)*l1); R lbd4xx= 4*lbdxx; fxx[0] = 4*Dl0.x*Dl0.x + lbdxx; fxx[1] = 4*Dl1.x*Dl1.x + lbdxx;; fxx[2] = 4*Dl2.x*Dl2.x + lbdxx;; fxx[3] = 8*Dl1.x*Dl2.x - lbd4xx; fxx[4] = 8*Dl0.x*Dl2.x - lbd4xx; fxx[5] = 8*Dl0.x*Dl1.x - lbd4xx; fxx[6] = 9*lbdxx; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); R lbdyy= 6*((Dl0.y*Dl1.y)*l2+(Dl1.y*Dl2.y)*l0+(Dl2.y*Dl0.y)*l1); R lbd4yy= lbdyy*4; fyy[0] = 4*Dl0.y*Dl0.y + lbdyy; fyy[1] = 4*Dl1.y*Dl1.y + lbdyy; fyy[2] = 4*Dl2.y*Dl2.y + lbdyy; fyy[3] = 8*Dl1.y*Dl2.y - lbd4yy; fyy[4] = 8*Dl0.y*Dl2.y - lbd4yy; fyy[5] = 8*Dl0.y*Dl1.y - lbd4yy; fyy[6] = 9*lbdyy; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); R lbdxy= 3*(Dl0.x*Dl1.y+ Dl0.y*Dl1.x)*l2+(Dl1.x*Dl2.y+Dl1.y*Dl2.x)*l0+(Dl2.x*Dl0.y+Dl2.y*Dl0.x)*l1; R lbd4xy= lbdxy*4; fxy[0] = 4*Dl0.x*Dl0.y + lbdxy; fxy[1] = 4*Dl1.x*Dl1.y + lbdxy; fxy[2] = 4*Dl2.x*Dl2.y + lbdxy; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x) - lbd4xy; fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x) - lbd4xy; fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x) - lbd4xy; fxy[6] = 9.*lbdxy; } } } /* void TypeOfFE_P1Lagrange::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int j, void * arg) const { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1) }; for (int i=0;i<3;i++) { f(v,K.T(Pt[i]),K,i,Pt[i],arg),val[i]=*(v+j);} } void TypeOfFE_P2Lagrange::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int j, void * arg) const { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1),R2(0.5,0.5),R2(0,0.5),R2(0.5,0) }; for (int i=0;i<6;i++) { f(v,K.T(Pt[i]),K,i,Pt[i],arg),val[i]=*(v+j);} } */ //TypeOfFE P1Lagrange(1,0,0,P1Functions,D2_P1Functions,P1Interpolant,DataP1Lagrange); //TypeOfFE P2Lagrange(1,1,0,P2Functions,D2_P2Functions,P2Interpolant,DataP2Lagrange,3); // case of fine mesh class TypeOfMortarCas1: public TypeOfMortar { friend class FESpace; friend class FMortar; friend class ConstructDataFElement; protected: int NbLagrangeMult(const Mesh &,const Mortar &M) const ; int NbDoF(const Mesh &,const Mortar &M,int i) const { int l(M.NbLeft()),r(M.NbRight()); int n =Max(l,r); int mn=Min(l,r); return (l+r)*(NbDfOnVertex + NbDfOnEdge) + (n+1)*NbDfOnVertex + n*NbDfOnEdge -mn-1; } int NbOfNodes(const Mesh &,const Mortar &M) const // call one time {int l(M.NbLeft()),r(M.NbRight()); return (l+r)*(vertex_is_node+edge_is_node)+1;} int NbDoF(const Mesh &,const Mortar &M) const { int l(M.NbLeft()),r(M.NbRight()); int n =Max(l,r); int mn=Min(l,r); return (l+r)*(NbDfOnVertex + NbDfOnEdge) + (n+1)*NbDfOnVertex + n*NbDfOnEdge -mn-1; } int NodeOfDF(const FESpace &Vh,const Mortar &M,int i) const {ffassert(0);return 0;} int DFOfNode(const FESpace &Vh,const Mortar &M,int i) const {ffassert(0);return 0;} void ConstructionOfNode(const Mesh &Th,int im,int * NodesOfElement,int *FirstNodeOfElement,int &lastnodenumber) const; void ConsTheSubMortar(FMortar & ) const; const int vertex_is_node,edge_is_node; public: TypeOfMortarCas1 (int i,int j): TypeOfMortar(i,j), vertex_is_node(i?1:0),edge_is_node(j?1:0) {}; } MortarCas1P2(1,1) ; const TypeOfMortar & TheMortarCas1P2(MortarCas1P2); void TypeOfMortarCas1::ConstructionOfNode(const Mesh &Th,int im,int * NodesOfElement,int *FirstNodeOfElement,int &lastnodenumber) const { // im mortar number // trop complique on change // const Mortar &M(Th.mortars[im]); int k = Th.nt+im; int kk=FirstNodeOfElement[k]; // begin // lagrange multiplicator one new node NodesOfElement[kk++] = lastnodenumber++; /* int il = M.NbLeft(); int ir = M.NbRight(); int ir1 = ir-1; // left for( int j=0;j=0 && lr >= 0); // throwassert ( ll <=lg && lr <= lg); // cout << "AA , BB = " << AA << "," << BB << endl; // cout << " " << ll << " " << lr << " ll=" << sm.sm[k].left << ", "; if (ll2); return nbmul; } // --- FMortar::FMortar(const FESpace * VVh,int k) : Vh(*VVh), M(Vh.Th.mortars[k-Vh.Th.nt]), p(Vh.PtrFirstNodeOfElement(k)), nbn(Vh.NbOfNodesInElement(k)), N(VVh->N), tom(Vh.tom) { ffassert(k>=Vh.Th.nt && k tom->ConsTheSubMortar(*this);} R TypeOfFE::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R v[10000],vf[1000]; assert(N*3*NbDoF<=10000 && NbDoF <1000 ); KNMK_ fb(v,NbDoF,N,op+1); // the value for basic fonction KN_ fk(vf,NbDoF); for (int i=0;i #include #include "ufunction.hpp" #include "error.hpp" #include "RNM.hpp" #include "libmesh5.h" #include "Mesh2dn.hpp" // for plotStream (a change) #include "Mesh3dn.hpp" #include "rgraph.hpp" #include "fem.hpp" #include "PlotStream.hpp" namespace Fem2D { long verbosity=1; // const R1 R1::KHat[2]={R1(0),R1(1)}; // const R2 R2::KHat[3]={R2(0,0),R2(1,0),R2(0,1)}; // const R3 R3::KHat[4]={R3(0,0,0),R3(1,0,0),R3(0,1,0),R3(0,0,1)}; static const int nvfaceTet[4][3] = { {2,1,3},{0,2,3},{1,0,3},{0,1,2} }; static const int nvedgeTet[6][2] = { {0,1},{0,2},{0,3},{0,1},{1,2},{2,3} }; static const int nvfaceTria[1][3] = { {0,1,2} }; static const int nvedgeTria[3][2] = { {1,2},{2,0},{0,1}}; // tourne de le sens trigo donc Normal ext vect(1,0) ^ perp static const int nvfaceSeg[1][3] = {{-1,-1,1}}; static const int nvedgeSeg[1][2] = { {0,1} }; static const int nvadjSeg[2][1] = { {0},{1} }; template<> const int (* const GenericElement::nvface)[3] = 0 ; template<> const int (* const GenericElement::nvedge)[2] = nvedgeSeg; //nvedgeTria ; template<> const int (* const GenericElement::nvadj)[1] = nvadjSeg ; template<> const int (* const GenericElement::nvface)[3] = nvfaceTria ; template<> const int (* const GenericElement::nvedge)[2] = nvedgeTria ; template<> const int (* const GenericElement::nvadj)[2] = nvedgeTria ; template<> const int GenericElement::nitemdim[4] = {3,3,1,0 } ; static const int onWhatIsEdge2d[3][7] = { {0,1,3, 2,0,0, 0}, // edge 0 {3,0,1, 0,2,0, 0}, {1,3,0, 0,0,2, 0}}; template<> const int (* const GenericElement::onWhatBorder)[7] = onWhatIsEdge2d ; template<> int GenericMesh::kfind=0; template<> int GenericMesh::kthrough=0; Mesh2::Mesh2(const char * filename) { // read the mesh int nt,nv,nbe; int ok=load(filename); if(ok) { ifstream f(filename); if(!f) {cerr << "Mesh2::Mesh2 Erreur openning " << filename<> nv >> nt >> nbe ; this->set(nv,nt,nbe); if(verbosity) cout << " -- Nb of Vertex " << nv << " " << " Nb of Triangles " << nt << " , Nb of border edges " << nbe << endl; assert(f.good() && nt && nv) ; for (int i=0;i> this->vertices[i]; assert(f.good()); } mes=0; for (int i=0;it(i).Read1(f,this->vertices,nv); mes += t(i).mesure(); } mesb=0.; for (int i=0;ibe(i).Read1(f,this->vertices,nv); mesb += be(i).mesure(); } } BuildBound(); BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); if(verbosity) cout << " - mesh mesure = " << mes << " border mesure: " << mesb << endl; } int Mesh2::load(const string & filename) { int bin; int ver,inm,dim; int lf=filename.size()+20; KN fileb(lf),filef(lf); char * pfile; strcpy(filef,filename.c_str()); strcpy(fileb,filef); strcat(filef,".mesh"); strcat(fileb,".meshb"); if( (inm=GmfOpenMesh(pfile=fileb, GmfRead,&ver,&dim)) ) bin=true; else if( (inm=GmfOpenMesh(pfile=filef, GmfRead,&ver,&dim)) ) bin=false; else { cerr << " Erreur ouverture file " << (char *) fileb << " " << (char *) filef << endl; return 1; } int nv,nt,neb; nv = GmfStatKwd(inm,GmfVertices); nt = GmfStatKwd(inm,GmfTriangles); neb=GmfStatKwd(inm,GmfEdges); this->set(nv,nt,neb); if(verbosity) cout << pfile <<": ver " << ver << ", d "<< dim << ", nt " << nt << ", nv " << nv << " nbe: = " << nbe << endl; if(dim != Rd::d) { cerr << "Err dim == " << dim << " != " << Rd::d << endl; return 2; } if( nv<=0 && nt <=0 ) { cerr << " missing data "<< endl; return 3; } int iv[4],lab; float cr[3]; // read vertices GmfGotoKwd(inm,GmfVertices); int mxlab=0; int mnlab=0; for(int i=0;ielements[i].set(this->vertices,iv,lab); mes += this->elements[i].mesure(); } } /* read mesh segement */ mesb=0; GmfGotoKwd(inm,GmfEdges); for(int i=0;i0 && iv[0]<=nv && iv[1]>0 && iv[1]<=nv); for (int j=0;j<2;j++) iv[j]--; this->borderelements[i].set(vertices,iv,lab); mesb += this->borderelements[i].mesure(); } GmfCloseMesh(inm); if(verbosity>1) cout << " mesure : "<< mes << " border mesure : " << mesb<< endl; return(0); // OK } int Mesh2::Save(const string & filename) { int ver = GmfFloat, outm; if ( !(outm = GmfOpenMesh(filename.c_str(),GmfWrite,ver,2)) ) { cerr <<" -- Mesh2::Save UNABLE TO OPEN :"<< filename << endl; return(1); } float fx,fy; GmfSetKwd(outm,GmfVertices,this->nv); for (int k=0; kvertices[k]; GmfSetLin(outm,GmfVertices,fx=P.x,fy=P.y,P.lab); } GmfSetKwd(outm,GmfTriangles,nt); for (int k=0; kelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int i2=this->operator()(K[2])+1; int lab=K.lab; GmfSetLin(outm,GmfTriangles,i0,i1,i2,lab); } GmfSetKwd(outm,GmfEdges,nbe); for (int k=0; kborderelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int lab=K.lab; GmfSetLin(outm,GmfEdges,i0,i1,lab); } GmfCloseMesh(outm); return (0); } const string Gsbegin="Mesh2::GSave v0",Gsend="end"; template void GSave2(FILE * ff,const Mesh & Th) { PlotStream f(ff); f << Gsbegin ; int nbe=Th.nbBrdElmts(); f << Th.nv << Th.nt << nbe; for (int k=0; k(FILE * ff,const Mesh2 & Th) ; template void GSave2(FILE * ff,const Mesh & Th) ; Mesh2::Mesh2(FILE *f) { GRead(f); assert( (nt >= 0 || nbe>=0) && nv>0) ; BuildBound(); if(verbosity>1) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; if(nt > 0){ BuildAdj(); Buildbnormalv(); BuildjElementConteningVertex(); } if(verbosity>1) cout << " -- Mesh2 (File *), d "<< 2 << ", n Tet " << nt << ", n Vtx " << nv << " n Bord " << nbe << endl; } void Mesh2::GRead(FILE * ff) { PlotStream f(ff); string s; f >> s; ffassert( s== Gsbegin); f >> nv >> nt >> nbe; if(verbosity>1) cout << " GRead : nv " << nv << " " << nt << " " << nbe << endl; this->vertices = new Vertex[nv]; this->elements = new Element [nt]; this->borderelements = new BorderElement[nbe]; for (int k=0; kvertices[k]; f >> P.x >>P.y >> P.lab ; } mes=0.; mesb=0.; if(nt != 0) { for (int k=0; kelements[k]); f >> i[0] >> i[1] >> i[2] >> lab; K.set(this->vertices,i,lab); mes += K.mesure(); } } for (int k=0; kborderelements[k]); f >> i[0] >> i[1] >> lab; K.set(this->vertices,i,lab); mesb += K.mesure(); } f >> s; ffassert( s== Gsend); } /* int Mesh2::Popen(const FILE *namestream) { int ver = GmfFloat; int dimp =2; float fx,fy; FILE *popenstream; popenstream = namestream; fprintf(popenstream,"MeshVersionFormatted\n"); fprintf(popenstream,"%i\n",ver); fprintf(popenstream,"Dimension\n"); fprintf(popenstream,"%i\n",dimp); fprintf(popenstream,"Vertices\n"); fprintf(popenstream,"%i\n",this->nv); for (int k=0; kvertices[k]; fx=P.x; fy=P.y; fprintf(popenstream,"%f %f %i\n",fx,fy,P.lab); } fprintf(popenstream,"Triangles\n"); fprintf(popenstream,"%i\n",this->nt); for (int k=0; kelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int i2=this->operator()(K[2])+1; int lab=K.lab; fprintf(popenstream,"%i %i %i %i\n",i0,i1,i2,lab); } fprintf(popenstream,"Edges\n"); for (int k=0; kborderelements[k]); int i0=this->operator()(K[0])+1; int i1=this->operator()(K[1])+1; int lab=K.lab; fprintf(popenstream,"%i %i %i\n",i0,i1,lab); } return (0); } */ Mesh2::Mesh2(int nnv, int nnt, int nnbe, Vertex2 *vv, Triangle2 *tt, BoundaryEdge2 *bb) { nv = nnv; nt = nnt; nbe =nnbe; vertices = vv; elements = tt; borderelements = bb; mes=0.; mesb=0.; for (int i=0;ielements[i].mesure(); for (int i=0;ibe(i).mesure(); //if(nnt !=0){ //BuildBound(); //BuildAdj(); //Buildbnormalv(); //BuildjElementConteningVertex(); //BuildGTree(); //decrement(); //} if(verbosity>1) cout << " -- End of read: mesure = " << mes << " border mesure " << mesb << endl; } } freefem++-3.61-1/src/femlib/FESpacen.cpp000644 000767 000024 00000043702 13256636774 020006 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : Generic Fiinite Element 1d, 2d, 3d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include #include "ufunction.hpp" #include "error.hpp" #include "RNM.hpp" #include "Mesh3dn.hpp" #include "Mesh2dn.hpp" #include "FESpacen.hpp" #include "splitsimplex.hpp" int UniqueffId::count=0; namespace Fem2D { //template int nbdf_d(const int ndfitem[4],const int nd[4]) { const int ndf = ndfitem[0]*nd[0] + ndfitem[1]*nd[1]+ ndfitem[2]*nd[2] + ndfitem[3]*nd[3]; return ndf; } //template int nbnode_d(const int ndfitem[4],const int nd[4]) { // const int nd[]= {Element::nv, Element::ne,Element::nf,Element::nt}; const int ndf = nd[0]*(ndfitem[0]!=0) + nd[1]*(ndfitem[1]!=0)+ nd[2]*(ndfitem[2]!=0) + nd[3]*(ndfitem[3]!=0); return ndf; } //template int *builddata_d(const int ndfitem[4],const int nd[4],int N) { // const int d=Element::Rd::d; // const int nwhat=Element::nitem; // const int nd[]= {Element::nv, Element::ne,Element::nf,Element::nt}; // const int nitem=nd[0]+nd[1]+nd[2]+nd[3]; // cout << " nitem="<< nitem<< endl; const int ndf = nbdf_d(ndfitem,nd); const int nnode=nbnode_d(ndfitem,nd); int lgdata= ndf*5+N; int * data = new int[lgdata]; int p=0; for(int i=0,nw=0;i<=3;++i) for(int j=0;j &teb) { const int k = teb.N(); KN NN(k+1), DF(k+1) , comp(k+1); map< dataTypeOfFE const *,int> m; int i=k,j; while(i--) // on va a l'envert pour avoir comp[i] <=i m[teb[i]]=i; // l'ordre comp est important comp est croissant mais pas de pb. i=k; while(i--) comp[i]=m[teb[i]]; // comp[i] <=i int n=0,N=0; for ( j=0;jN;} NN[k] = N; // reservation des interval en df n=0; for ( j=0;jNbDoF;} DF[k] = n; int NbDoF=0; int dfon[4]={0,0,0,0}; int nbsubdivision=0; int discon=0; for (int i=0;iNbDoF; dfon[0] += teb[i]->ndfonVertex; dfon[1] += teb[i]->ndfonEdge; dfon[2] += teb[i]->ndfonFace; dfon[3] += teb[i]->ndfonVolume; nbsubdivision = max(nbsubdivision,teb[i]->nbsubdivision); discon = discon || teb[i]->discontinue; // bof bof 1 FE discontinue => discontinue } int nwhat=15; // 15 = 4+6+1+1 (nb of support item (what) : vertex, edges, fqces, tet) int ostart=nwhat; int * data0=new int[ostart+7*NbDoF+N]; int * data=data0+ostart; int * data1=data+5*NbDoF; int c=0; KN w(nwhat),nn(nwhat); w=0; nn=0; for ( j=0;jNbDoF;i++) nn[teb[j]->DFOnWhat[i]]++; int nbn=0; for( j=0;j dln(nwhat); dln=0; // nn donne numero de noeud sur what for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOnWhat[i]; for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOfNode[i]+dln[teb[j]->DFOnWhat[i]]; for ( i=0;iNbDoF;i++) dln[teb[j]->DFOnWhat[i]]=Max(dln[teb[j]->DFOnWhat[i]],data[cc++]+1); } for ( j=0;jNbDoF;i++) data[c++] = nn[teb[j]->DFOnWhat[i]]; } for ( j=0;jNbDoF;i++) data[c++] = j; // node from of FE for ( j=0;jNbDoF;i++) data[c++] = i; // node from of df in FE // error -- here //in case of [P2,P2],P1 // we expect 0,0,1 and we get 0 1 2 // => wrong BC ???? c+=2*n; // on saute le deux tableau en plus (cf data1.) int xx=0; for (j=0;jN;i++) { data[c] = teb[j]->dim_which_sub_fem[i]+xx; xxx=Max(xxx,data[c]+1); c++; } xx=xxx; } // ou dans la partie miminal element finite atomic int ci=n; int cj=0; int ccc=0; for ( j=0;jnb_sub_fem) for ( i=0;iNbDoF;i++) { int il= teb[j]->fromASubDF[i]; int jl= teb[j]->fromASubFE[i]; data1[ci++]=il; data1[cj++]=ccc+jl; } int nb_sub_fem=ccc; ffassert(c== 7*n+N); /* int cc=0; cout << " Data : " << endl; for ( i=0;i<5;i++) { for (j=0;j & tef) : data(builddata_d(nitemdim,tef)), dataalloc(data), ndfonVertex(data[0]), ndfonEdge(data[1]), ndfonFace(data[2]), ndfonVolume(data[3]), NbDoF(data[4]), NbNode(data[5]), N(data[6]), nb_sub_fem(data[7]), nbsubdivision(data[8]), discontinue(data[9]), DFOnWhat(data+15+0*NbDoF), DFOfNode(data+15+1*NbDoF), NodeOfDF(data+15+2*NbDoF), fromFE(data+15+3*NbDoF), fromDF(data+15+4*NbDoF), fromASubFE(data+15+5*NbDoF), fromASubDF(data+15+6*NbDoF) , dim_which_sub_fem(data+15+7*NbDoF) {} template void GTypeOfFESum::init(InterpolationMatrix & M,FElement * pK,int odf,int ocomp,int *pp) const { // a faire ..... cas matrix invariante assert(0); } template GTypeOfFESum::GTypeOfFESum(const KN< GTypeOfFE const *> & t) : GTypeOfFE(t), k(t.N()), teb(t), NN(k+1), DF(k+1) , comp(k+1) {Build();} template static KN< GTypeOfFE const *> kn(const GFESpace ** tt,int kk) { KN< GTypeOfFE const *> r(kk); for(int i=0;iTFE[0];ffassert(tt[i]->TFE.constant());} return r; } template static KN< GTypeOfFE const *> kn(const GFESpace & tt,int kk) { return KN< GTypeOfFE const *> (kk,tt.TFE[0]); } template GTypeOfFESum::GTypeOfFESum(const GFESpace ** tt,int kk) : GTypeOfFE(kn(tt,kk)), k(kk), teb(kn(tt,kk)), NN(k+1), DF(k+1) , comp(k+1) {Build();} template GTypeOfFESum::GTypeOfFESum(const GFESpace & tt,int kk) : GTypeOfFE(kn(tt,kk)), k(kk), teb(kn(tt,kk)), NN(k+1), DF(k+1) , comp(k+1) {Build();} template void GTypeOfFESum::Build() { bool debug=verbosity>5;; { const KN< GTypeOfFE const *> & t=teb; map *,int> m; int i=k,j; while(i--) // on va a l'envert pour avoir comp[i] <=i m[teb[i]]=i; // l'ordre comp est important comp est croissant mais pas de pb. i=k; while(i--) comp[i]=m[teb[i]]; // comp[i] <=i // reservatition des intervalles en espaces int n=0,N=0; for ( j=0;jN;} NN[k] = N; // reservation des interval en df n=0; for ( j=0;jNbDoF;} DF[k] = n; } int ii=0; for (int i=0;inb_sub_fem;++j) this->Sub_ToFE[ii++]=teb[i]->Sub_ToFE[j]; } assert(ii==this->nb_sub_fem ); int c=0,c0=0, fcom=0; for (int i=0;inb_sub_fem;i++) { int N=this->Sub_ToFE[i]->N; int ndofi=this->Sub_ToFE[i]->NbDoF; this->first_comp[i]= fcom; this->last_comp[i]= fcom+N; fcom += N; for(int j=0;jbegin_dfcomp[c] = c0 + this->Sub_ToFE[i]->begin_dfcomp[j] ; this->end_dfcomp[c] = c0 + this->Sub_ToFE[i]->end_dfcomp[j] ; c++; } c0+=ndofi; } if(debug) { cout <<" NbDoF : " << this->NbDoF <N;++i) cout << " comp " << i << " ["<begin_dfcomp[i]<<", "<< this->end_dfcomp[i]<< "[\n"; } // construction de l'interpolation . int npi=0; int nci=0; bool var=true; for (int i=0;inb_sub_fem;i++) { npi +=this->Sub_ToFE[i]->NbPtforInterpolation; nci +=this->Sub_ToFE[i]->NbcoefforInterpolation; var = var && this->Sub_ToFE[i]->invariantinterpolationMatrix; } assert(this->NbcoefforInterpolation== nci); this->invariantinterpolationMatrix=var; // this->pInterpolation.init(nci); // this->cInterpolation.init(nci); // this->dofInterpolation.iniy(nci); KN opi(this->nb_sub_fem);// offset numumber point intgartion { map mpt; numPtInterpolation.init(npi); int npp=0,kkk=0; KN Ptt(npi); for (int i=0;inb_sub_fem;i++) { opi[i]=kkk; const GTypeOfFE &ti=*this->Sub_ToFE[i]; for(int p=0;p100) cout << " p= "<< p << " [ " << Ptt[kkk]<< "] , "<< kkk<< " "<< npp<< " " << numPtInterpolation[kkk]<< endl;; } } assert(this->NbPtforInterpolation==0); if(verbosity>5) cout << npp; this->NbPtforInterpolation=npp; this->PtInterpolation.init(npp); for(int i=0;iPtInterpolation[numPtInterpolation[i]]=Ptt[i]; } int oc=0,odof=0; for (int i=0,k=0;inb_sub_fem;i++) { const GTypeOfFE &ti=*this->Sub_ToFE[i]; for(int j=0;jpInterpolation[k] = numPtInterpolation[opi[i]+ti.pInterpolation[j]]; this->cInterpolation[k] = ti.cInterpolation[j]+oc; this->dofInterpolation[k] = ti.dofInterpolation[j]+odof; this->coefInterpolation[k]=ti.coefInterpolation[j]; } oc += ti.N; odof += ti.NbDoF; } if(verbosity>100) cout << " **GTypeOfFESum::Build() " <pInterpolation <N); } template void GTypeOfFESum::set(const Mesh & Th,const Element & K,InterpolationMatrix & M,int oocoef,int oodf,int *nnump ) const { int op=0,oc=0,odof=oodf,ocoef=oocoef; assert(nnump==0); for (int i=0,k=0;inb_sub_fem;i++) { const GTypeOfFE &ti=*this->Sub_ToFE[i]; if(!ti.invariantinterpolationMatrix) ti.set(Th,K,M,ocoef,odof,&numPtInterpolation[op]); oc += ti.N; odof += ti.NbDoF; ocoef += ti.NbcoefforInterpolation; op += ti.NbPtforInterpolation; } if( verbosity > 100) cout << " GTypeOfFESum set "<< this->coefInterpolation << endl; } template GFESpace::GFESpace(const GFESpace & Vh,int kk,int nbequibe,int *equibe) : GFESpacePtrTFE(new GTypeOfFESum(Vh,kk)), DataFENodeDF(Vh.Th.BuildDFNumbering(this->ptrTFE->ndfonVertex,this->ptrTFE->ndfonEdge,this->ptrTFE->ndfonFace,this->ptrTFE->ndfonVolume,nbequibe,equibe)), Th(Vh.Th), TFE(1,0,this->ptrTFE), cmesh(Th), N(TFE[0]->N), Nproduit(kk), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), maxNbPtforInterpolation(TFE[0]->NbPtforInterpolation), maxNbcoefforInterpolation(TFE[0]->NbcoefforInterpolation) { } template GFESpace::GFESpace(const GFESpace ** pVh,int kk,int nbequibe,int *equibe) : GFESpacePtrTFE(new GTypeOfFESum(pVh,kk)), DataFENodeDF((**pVh).Th.BuildDFNumbering(this->ptrTFE->ndfonVertex,this->ptrTFE->ndfonEdge,this->ptrTFE->ndfonFace,this->ptrTFE->ndfonVolume,nbequibe,equibe)), Th((**pVh).Th), TFE(1,0,this->ptrTFE), cmesh(Th), N(TFE[0]->N), Nproduit(FirstDfOfNodeData ? 1 :MaxNbDFPerNode), nb_sub_fem(TFE[0]->nb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), maxNbPtforInterpolation(TFE[0]->NbPtforInterpolation), maxNbcoefforInterpolation(TFE[0]->NbcoefforInterpolation) { long snbdf=0; for(int i=0;iNbOfDF; if( snbdf !=NbOfDF) cerr << " Problem build of GFESpace (3d) (may be : due to periodic Boundary condition missing ) FH " << endl << " The number of DF must be " << snbdf << " and it is " << NbOfDF <Th); } template template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const { const int d = Rd::d; Rd *Ps=0; int *Ks=0; int nsb = TFE[0]->nbsubdivision; int nvsub,nksub; SplitSimplex(nsb, nvsub, Ps, nksub , Ks); ffassert( Psub.unset()); ffassert( Ksub.unset()); Psub.set(Ps,nvsub); Ksub.set(Ks,nksub*(d+1)); lg= nvsub*Th.nt; KN v(lg); for (int k=0,i=0;k(true,v);// to remove the copy. } /* template KN GFESpace::newSaveDraw(const KN_ & U,int composante,int & lg,int & nsb) const { nsb = TFE[0]->nbsubdivision; int nsbv = NbOfSubInternalVertices(nsb,d); lg = nsbv*Th.nt; cout << "newSaveDraw what: nt " << Th.nt << " " << nsbv << " " << lg << endl; KN v(lg); ffassert(v); for (int k=0,i=0;k(true,v);// to remove the copy. } */ // explicite instance.. template class GTypeOfFESum; template class GTypeOfFESum; template class GFESpace; template class GFESpace; template class GFESpace; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; typedef std::complex Complex; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; template KN GFESpace::newSaveDraw(const KN_ & U,int componante,int & lg,KN &Psub,KN &Ksub,int op_U) const ; } freefem++-3.61-1/src/femlib/MeshPoint.hpp000644 000767 000024 00000026065 13312446271 020260 0ustar00hechtstaff000000 000000 #ifndef MeshPoint_hpp_ #define MeshPoint_hpp_ #include //typedef double R; #ifndef LONG_MIN #if 1000000L*1000000L <0L # define LONG_MIN -2147483647 #elif 1000000L*1000000L >0L # define LONG_MIN -9223372036854775807 #endif #endif namespace Fem2D { const int notaregion=INT_MIN; const long lnotaregion=INT_MIN; const int notalabel=INT_MIN; const double doublenotset = -123e100; class MeshPointBase { public: R3 P; R3 PHat; union { const Mesh * Th; const Mesh3 * Th3; }; union{ const Triangle * T; const Tet * T3; }; long region, t,v,f,e,gsens; // triangle,vertex, face or edge long label; R3 N; // if on boundary bool outside; int VF; int d; void set(const R2 &P2,const R2 & P_Hat,const baseFElement & K,int ll,const R2 &NN,int iedge) { P.x=P2.x; P.y=P2.y; P.z=0; PHat.x=P_Hat.x; PHat.y=P_Hat.y; PHat.z=0.; T=&K.T; Th=&K.Vh.Th; region = T->lab; label = ll; v=f=-1; e=iedge; t=(*Th)(T); throwassert( Abs( (NN,NN) -1.0) < 1e-5 ); N.x=NN.x; N.y=NN.y; N.z=0; VF=0; d=2; } void set(const Mesh & aTh,const R2 &P2,const R2 & P_Hat,const Triangle & aK,int ll,const R2 &NN,int iedge,int VFF=0) { P.x=P2.x; P.y=P2.y; P.z=0; PHat.x=P_Hat.x; PHat.y=P_Hat.y; PHat.z=0.; T=&aK; Th=&aTh; region = T->lab; label = ll; v=f=-1; t=(*Th)(T); e=iedge; throwassert( Abs( (NN,NN) -1.0) < 1e-5 ); N.x=NN.x; N.y=NN.y; N.z=0; VF=VFF; d=2; } void set(const R2 &P2,const R2 & P_Hat,const baseFElement & K,int ll) { P.x=P2.x; P.y=P2.y; P.z=0; PHat.x=P_Hat.x; PHat.y=P_Hat.y; PHat.z=0.; T=&K.T; Th=&K.Vh.Th; region = T->lab; label = ll; t=(*Th)(T); v=f=e=-1; N.x=0; N.y=0; N.z=0; VF=0; d=2; } void set(const R2 &P2,const R2 & P_Hat,const baseFElement & K) { P.x=P2.x; P.y=P2.y; P.z=0; PHat.x=P_Hat.x; PHat.y=P_Hat.y; PHat.z=0.; T=&K.T; Th=&K.Vh.Th; region = T->lab; v=f=e=-1; N.x=0; N.y=0; N.z=0; VF=0; int ll[3],kk(0); if ( P_Hat.x<1.e-6) ll[kk++]=1; if ( P_Hat.y<1.e-6) ll[kk++]=2; if ( P_Hat.y+P_Hat.x>0.999999) ll[kk++]=0; if (kk==0) label=0; else if (kk==2) { v = 3-ll[0]-ll[1];// 3 = 0+1+2 sommet oppose label=(*T)[v].lab; } else { e = ll[0]; int i1,i2; Th->VerticesNumberOfEdge(K.T,e,i1,i2); const BoundaryEdge * be=Th->TheBoundaryEdge(i1,i2); label= be ? be->lab : 0; // R2 E(K.T.Edge(ke)); // (R2 &) N = E.perp()/Norme2(E); //cout << "lab =" << label << " " << e << " " << kk << " " << P_Hat // << ": " << K.number << " , " << (R2) P << " " << N << endl; } t=(*Th)(T); d=2; } void set(const Mesh &aTh, const R2 &P2,const R2 & P_Hat,const Triangle & aK,const int ll,bool coutside=false) { P.x=P2.x; P.y=P2.y; P.z=0; PHat.x=P_Hat.x; PHat.y=P_Hat.y; PHat.z=0.; T=&aK; Th=&aTh; region = T->lab; label = ll; t= aTh(aK); // Miss correct Nov. 2012 ... v=f=e=-1; N.x=0; N.y=0; N.z=0; outside=coutside; VF=0; d=2; } void setP(const Mesh * pTh,int tt,int ss) { T=&(*pTh)[tt]; Vertex & V=(*T)[ss]; (R2 &) P= V ; P.z=0; (R2 &) PHat = TriangleHat[ss]; PHat.z=0; Th=pTh; region = T->lab; label = V.lab; t=tt; v=f=e=-1; v=ss; VF=0; d=2; } void change(const R2 & PH,const Triangle & tt,int ll) { T= &tt; (R2 &) PHat = PH; (R2 &) P = (*T)(PH); region = T->lab; label = ll; t=(*Th)(T); v=f=e=-1; VF=0; d=2; } void change(const R3 & PH,const Tet & tt,int ll) { T3= &tt; (R3 &) PHat = PH; (R3 &) P = (*T3)(PH); region = T3->lab; label = ll; t=(*Th)(T); v=f=e=-1; VF=0; d=2; } void unset() { P.x=doublenotset; P.y=doublenotset; P.z=doublenotset; T=0; Th=0; label =notaregion; region = notaregion; VF=0; d=0; } bool isUnset() const { return P.x == doublenotset;} // BofBof void set(R x=0.0,R y=0.0,R z=0.0) { P.x=x; P.y=y; P.z=z; T=0; Th=0; label =0; region = notaregion; t=f=e=v=-1; VF=0; d=0; } // ------- 3D void set(const R3 &P2,const R3 & P_Hat,const baseFElement3 & K,int ll,const R3 &NN,int iface) { P=P2; PHat=P_Hat; T3=&K.T; Th3=&K.Vh.Th; region = T3->lab; label = ll; e=v=-1; f=iface; t=(*Th3)(T3); assert( Abs( (NN,NN) -1.0) < 1e-5 ); N=NN; VF=0; d=3; } void set(const Mesh3 & aTh,const R3 &P2,const R3 & P_Hat,const Tet & aK,int ll,const R3 &NN,int iface,int VFF=0) { P=P2; PHat=P_Hat; T3=&aK; Th3=&aTh; region = T3->lab; label = ll; v=f=-1; t=(*Th3)(T3); v=e=-1; f=iface; assert( Abs( (NN,NN) -1.0) < 1e-5 ); N=NN; VF=VFF; d=3; } void set(const R3 &P2,const R3 & P_Hat,const baseFElement3 & K,int ll) { P=P2; PHat=P_Hat; T3=&K.T; Th3=&K.Vh.Th; region = T3->lab; label = ll; t=(*Th)(T); v=f=e=-1; N.x=0; N.y=0; N.z=0; VF=0; d=3; } void set(const R3 &P2,const R3 & P_Hat,const baseFElement3 & K) { P=P2; PHat=P_Hat; T3=&K.T; Th3=&K.Vh.Th; region = T3->lab; v=f=e=-1; N.x=0; N.y=0; N.z=0; VF=0; int ll[4],kk(0); if ( P_Hat.x<1.e-6) ll[kk++]=1; if ( P_Hat.y<1.e-6) ll[kk++]=2; if ( P_Hat.z<1.e-6) ll[kk++]=3; if ( P_Hat.x+P_Hat.y+P_Hat.z>0.999999) ll[kk++]=0; if (kk==0) label=0; else if (kk==3) { v = 6-ll[0]-ll[1]-ll[2];// 3 = 0+1+2 sommet oppose label=(*T)[v].lab; } else { // on edge //ffassert(0); // a faire /* e = ll[0]; int i1,i2,I3; Th3->VerticesNumberOfEdge(K.T,e,i1,i2); const BoundaryEdge * be=Th3->TheBoundaryEdge(i1,i2); label= be ? be->lab : 0; */ label=-1;// to say } t=(*Th3)(T3); d=3; } void set(const Mesh3 &aTh, const R3 &P2,const R3 & P_Hat,const Tet & aK,const int ll,bool coutside=false) { P=P2; PHat=P_Hat; T3=&aK; Th3=&aTh; region = T3->lab; label = ll; t=(*Th3)(T3); v=f=e=-1; N.x=0; N.y=0; N.z=0; // area=mes; outside=coutside; VF=0; d=3; } void setP(const Mesh3 * pTh,int tt,int ss) { T3=&(*pTh)[tt]; const Mesh3::Vertex & V=(*T3)[ss]; P= V ; PHat = TetHat[ss]; Th3=pTh; region = T3->lab; label = V.lab; t=tt; v=f=e=-1; v=ss; VF=0; d=3; } // -------- }; class MeshPoint : public MeshPointBase { public: MeshPointBase other; void unset() { MeshPointBase::unset(); other.unset();} void set(const R2 &P2,const R2 & P_Hat,const baseFElement & K,int ll,const R2 &NN,int iedge) { MeshPointBase::set(P2,P_Hat,K,ll,NN,iedge); other.unset();} void set(const Mesh & aTh,const R2 &P2,const R2 & P_Hat,const Triangle & aK,int ll,const R2 &NN,int iedge) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,NN,iedge); other.unset();} void set(const Mesh & aTh,const R2 &P2,const R2 & P_Hat,const Triangle & aK,int ll,const R2 &NN,int iedge,int VFF) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,NN,iedge,VFF); other.unset();} void set(const R2 &P2,const R2 & P_Hat,const baseFElement & K) { MeshPointBase::set(P2,P_Hat,K); other.unset(); } void set(const Mesh &aTh, const R2 &P2,const R2 & P_Hat,const Triangle & aK, const int ll,bool coutside=false) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,coutside); other.unset(); } // 3d void set(const R3 &P2,const R3 & P_Hat,const baseFElement3 & K,int ll,const R3 &NN,int iedge) { MeshPointBase::set(P2,P_Hat,K,ll,NN,iedge); other.unset();} void set(const Mesh3 & aTh,const R3 &P2,const R3 & P_Hat,const Tet & aK,int ll,const R3 &NN,int iedge) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,NN,iedge); other.unset();} void set(const Mesh3 & aTh,const R3 &P2,const R3 & P_Hat,const Tet & aK,int ll,const R3 &NN,int iedge,int VFF) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,NN,iedge,VFF); other.unset();} void set(const R3 &P2,const R3 & P_Hat,const baseFElement3 & K) { MeshPointBase::set(P2,P_Hat,K); other.unset(); } void set(const Mesh3 &aTh, const R3 &P2,const R3 & P_Hat,const Tet & aK, const int ll,bool coutside=false) { MeshPointBase::set(aTh,P2,P_Hat,aK,ll,coutside); other.unset(); } // fin 3d void set(R x=0.0,R y=0.0,R z=0.0) { MeshPointBase::set(x,y,z); other.unset();} void change(const R2 & PH,const Triangle & tt,int ll) { MeshPointBase::change(PH,tt,ll); other.unset(); } void change(const R3 & PH,const Tet & tt,int ll) { MeshPointBase::change(PH,tt,ll); other.unset(); } void setP(const Mesh * pTh,int tt,int ss) { MeshPointBase::setP(pTh,tt,ss); other.unset(); } void setP(const Mesh3 * pTh,int tt,int ss) { // 3d MeshPointBase::setP(pTh,tt,ss); other.unset(); } bool operator==(const MeshPoint & mp) const { return T == mp.T && P.x == mp.P.x && P.y == mp.P.y && P.z == mp.P.z ;} bool SetAdj() { if (!(Th && T && t >=0 && e>=0)) return false;// modif if(VF==0) { int ieo=e,to=t,ie=e; t=Th->ElementAdj(t,ie); e=ie; if ( t == to && t >= 0 ) return false; int io0=VerticesOfTriangularEdge[ieo][0]; // int io1=VerticesOfTriangularEdge[ieo][1]; int i0=VerticesOfTriangularEdge[e][0]; int i1=VerticesOfTriangularEdge[e][1]; T= &(*Th)[t]; region = T->lab; R l[3]; l[1]=PHat.x; l[2]=PHat.y; l[0]=1-PHat.x-PHat.y; R le=l[io0]; l[i1]=le; l[i0]=1-le; l[3-i1-i0]=0; PHat.x=l[1]; PHat.y=l[2]; gsens = -gsens; } else { // VF = 1 + VF%2; ffassert(0); // a faire } return true; } }; ostream & operator << ( ostream &,const MeshPoint & ) ; inline static MeshPoint* MeshPointStack(Stack s) {void * p= static_cast(s)[MeshPointStackOffset];throwassert(p); return static_cast( p);} inline static void MeshPointStack(Stack s,MeshPoint* mp) {*static_cast(static_cast(s)) = mp;} #ifdef NEWFFSTACK inline static MeshPoint* MeshPointStack(void * s) {void * p= static_cast(s)[MeshPointStackOffset];throwassert(p); return static_cast( p);} inline static void MeshPointStack( void *s,MeshPoint* mp) {*static_cast(static_cast(s)) = mp;} #endif } #endif freefem++-3.61-1/src/femlib/R1.hpp000644 000767 000024 00000007665 13256636774 016661 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model of $\mathbb{R}^1$ // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef R1_HPP #define R1_HPP #include #include #include typedef double R; // R0 R1, R2 , R3 to be uniforme. // The class R1 class R0 { public: typedef double R; static const int d=0; R0(){} }; class R2; class R3; class R1 { public: typedef double R; static const int d=1; R x; // declaration de membre // les 3 constructeurs --- R1 () :x(0.){} // rappel : x(0) sont initialiser via le constructeur de double R1 (R a):x(a) {} R1 (const R1 & a,const R1 & b):x(b.x-a.x) {} static R1 diag(R a){ return R1(a);} // rappel les operator definis dans une class on un parametre // cache qui est la classe elle meme (*this) // les operateurs affectation // operateur affection (*this) = P est inutil par defaut il fait le travail correctement // les autre operoteur affectations R1 & operator+=(const R1 & P) {x += P.x;return *this;} R1 & operator-=(const R1 & P) {x -= P.x;return *this;} R1 & operator*=(R a) {x *= a;return *this;} R1 & operator/=(R a) {x /= a;return *this;} // operateur binaire + - * , ^ / R1 operator+(const R1 & P)const {return R1(x+P.x);} R1 operator-(const R1 & P)const {return R1(x-P.x);} R operator,(const R1 & P)const {return x*P.x;} // produit scalaire R1 operator*(R c)const {return R1(x*c);} R1 operator/(R c)const {return R1(x/c);} // operateur unaire R1 operator-()const {return R1(-x);} R1 operator+()const {return *this;} // un methode R sum() const { return x;} R * toBary(R * b) const { b[0]=1-x;b[1]=x;return b;} // les operators tableaux // version qui peut modifie la class via l'adresse de x R & operator[](int i){ return (&x)[i];} const R & operator[](int i) const { return (&x)[i];} R norme() const { return std::sqrt(x*x);} R norme2() const { return (x*x);} R1 Bary(R1 P[d+1]) const { return (1-x)*P[0]+x*P[1];} // add FH R1 Bary(const R1 *const *const P ) const { return (1-x)*(*P[0])+x*(*P[1]);} // add FH R2 Bary(R2 P[d+1]) const;// { return (1-x)*P[0]+x*P[1];} // add FH R2 Bary(const R2 *const *const P ) const ;//{ return (1-x)*(*P[0])+x*(*P[1]);} // add FH R3 Bary(R3 P[d+1]) const ;//{ return (1-x)*P[0]+x*P[1];} // add FH R3 Bary(const R3 *const *const P ) const ;//{ return (1-x)*(*P[0])+x*(*P[1]);} // add FH friend R1 operator*(R c,const R1 & P) {return P*c;} friend std::ostream& operator <<(std::ostream& f, const R1 & P ) { f << P.x ; return f; } friend std::istream& operator >>(std::istream& f, R1 & P) { f >> P.x ; return f; } static const R1 KHat[d+1]; }; inline R1 Minc(const R1 & A,const R1 &B){ return R1(min(A.x,B.x));} inline R1 Maxc(const R1 & A,const R1 &B){ return R1(max(A.x,B.x));} inline double Norme_infty(const R1 & A){return std::fabs(A.x);} inline double Norme2_2(const R1 & A){ return A.x*A.x;} inline double Norme2(const R1 & A){ return std::fabs(A.x);} #endif freefem++-3.61-1/src/femlib/CGNL.hpp000644 000767 000024 00000006420 13256636774 017106 0ustar00hechtstaff000000 000000 template R argmin(R rho,const DJ & dJ, KN_ &x,KN_ &h,KN_ &g,KN_ &w) { // Find ro such thah (dJ(x+ro h),h) =0 // remark input: dJ(x)=g int k=0; // g=dJ*x; // pour est sure R ro0=0, ro=rho,ro1=rho,rold=0; R p0= (g,h),p,p1; if(p0>0) { h=-g; p0=(g,h); cout << "Reset searching directions to gradient! (Wow! says F. hecht) \n"; } R ap0=fabs(p0)*0.01; // on arrete quand on a divise par 100. x += (ro-rold)* h; rold=ro; g=dJ*x;// dJ(x,g); p= ( p1 = (g,h) ); if ( verbosity >=50 ) cout << " ro " << ro << " " << p << " rh0= 0 " << p0 << endl; bool loop=true; while (k++<100 && loop) { // calcul du nouveau ro courant if (p0*p1 <0) { // Ok changement de signe R lambda= (-p0/(-p0+p1)); if (lambda>0.8) lambda=0.8; if (lambda<0.2) lambda=0.2; ro = ro1*lambda + (1-lambda)*ro0 ; x += (ro-rold)* h; rold=ro; g=dJ*x;// dJ(x,g); assert(ro>1e-30 && ro < 1e+30); p = (g,h); if ( verbosity >=50 ) cout << " " << ", rho=" << ro << " gh= " << p << "; ro0, gh0 = " << ro0 << " " << p0 << "; ro1, gh1 = " << ro1 << " " << p1 << " " << lambda ; if(fabs(p) <= ap0 || k>100 ) { if ( verbosity >=50 ) cout << endl << endl; return ro; } if(p0*p<0) { p1=p; ro1=ro; if ( verbosity >=50 ) cout << " +\n";} else { p0=p; ro0=ro; if ( verbosity >=50 ) cout <<" -\n";} } else { ro *=2; p0=p1; x += (ro-rold)* h; rold=ro; g=dJ*x;//dJ(x,g); p = (g,h); p1=p; ro1=ro; if ( verbosity >=50 ) cout < int NLCG(const DJ & dJ,const P & C,KN_ &x,const int nbitermax, double &eps,long kprint=1000000000,S *Stop=0) { // ------------- // assert(&x && &dJ && &C); typedef KN Rn; int n=x.N(); R ro=1; Rn g(n),h(n),Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g=dJ*x;// dJ(x,g); Cg = C*g; // gradient preconditionne h =-Cg; R g2 = (Cg,g); if (g2 < 1e-30) { if(kprint>1) cout << "GCNL g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } if (kprint>5 ) cout << " 0 GCNL g^2 =" << g2 << endl; R reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { ro = argmin(ro,dJ,x,h,g,Ah); Cg = C*g; R g2p=g2; g2 = (Cg,g); bool stop = Stop && Stop->Stop(iter,x,g); if ( kprint >1 ) cout << "CGNL:" < KNM_ & KNM_::operator oper (const outProduct_KN_ & u) { // *this oper A* t B K_throwassert (shapei.SameShape(u.a) && shapej.SameShape(u.b) ); long n= N(), m= M(); R * ai(u.a),cc, c= u.c; long stepi=u.a.step; R * bj, *bb(u.b); long stepj=u.b.step; KN_ li((*this)(0,'.')); // first line int stepij= li.step; for (long i=0;i KNM_ & KNM_::operator oper (const ConjKNM_ & u) { K_throwassert( N() == u.N() && M() == u.M() ); for(int i=0;i::operator () (i,j) oper RNM::conj( u(i,j)); return *this; } template template KN_& KN_::operator oper (const F_KN_ & u) { K_throwassert ( u.check(this->N()) ); R * l(v); // first line for (long i=0;i KN_& KN_::operator oper (const SetArray & u) { R * l(v); // first line for (long i=0;i KN_& KN_::operator oper (const Mul_KNM_KN_ & u) { K_throwassert (SameShape(u.A.shapei) && !constant()); R * l(v); KN_ li(u.A(0,'.')); // first line for (long i=0;i KN_& KN_::operator oper (const Mul_KNMh_KN_ & u) { K_throwassert (SameShape(u.A.shapei) && !constant()); R * l(v); KN_ li(u.A(0,'.')); // first line for (long i=0;i KN_& KN_::operator oper (const DotStar_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step),stepb(u.b.step); R * l(v); const_R *aa(u.a), *bb(u.b); for (long i=0;i KN_& KN_::operator oper (const DotSlash_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step),stepb(u.b.step); R * l(v); const_R *aa(u.a), *bb(u.b); for (long i=0;i KN_& KN_::operator oper (const Add_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step),stepb(u.b.step); R * l(v); const_R *aa(u.a), *bb(u.b); for (long i=0;i KN_& KN_::operator oper (const Sub_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step),stepb(u.b.step); R * l(v); const_R *aa(u.a), *bb(u.b); for (long i=0;i KN_& KN_::operator oper (const Mulc_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step); R * l(v); const_R *aa(u.a),bb(u.b) ; for (long i=0;i KN_& KN_::operator oper (const Divc_KN_ & u) { K_throwassert(u.a.N() == N() ); long stepa(u.a.step); R * l(v); const_R *aa(u.a),bb(u.b) ; for (long i=0;i KN_& KN_::operator oper (const Add_Mulc_KN_ & u) { K_throwassert(u.a.N() == N() ); const long stepa(u.a.step),stepb(u.b.step); const R ca(u.ca),cb(u.cb); R * l(v); const R *aa(u.a),*bb(u.b); for (long i=0;i KN_& KN_::operator oper (const if_arth_KN_ & u) { K_throwassert(u.a.N() == N() ); R zero=R(); const long stepa(u.a.step),stepb(u.b.step),stepc(u.c.step); R * l(v); const R *aa(u.a),*bb(u.b),*cc(u.c); for (long i=0;i> class Label { // reference number for the physics friend inline ostream& operator <<(ostream& f,const Label & r ) { f << r.lab ; return f; } friend inline istream& operator >>(istream& f, Label & r ) { f >> r.lab ; return f; } public: int lab; Label(int r=0):lab(r){} bool onGamma() const { return lab;} int operator!() const{return !lab;} bool operator<(const Label & r) const {return lab < r.lab;} bool operator==(const Label & r) const {return lab == r.lab;} bool operator>(const Label & r) const { return lab > r.lab;} }; #endif freefem++-3.61-1/src/femlib/R3.hpp000644 000767 000024 00000012037 13256636774 016650 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model of $\mathbb{R}^3$ // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef R3_HPP #define R3_HPP #include "R1.hpp" #include "R2.hpp" class R3 { public: typedef double R; static const int d=3; R x,y,z; R3 () :x(0),y(0),z(0) {}; R3 (R a,R b,R c):x(a),y(b),z(c) {} R3 (const R * a):x(a[0]),y(a[1]) ,z(a[2]) {} R3 (R2 P2):x(P2.x),y(P2.y),z(0) {} R3 (R2 P2,R zz):x(P2.x),y(P2.y),z(zz) {} R3 (const R3 & A,const R3 & B) :x(B.x-A.x),y(B.y-A.y),z(B.z-A.z) {} static R3 diag(R a){ return R3(a,a,a);} R3 & operator=(const R2 &P2) {x=P2.x;y=P2.y;z=0;return *this;} R3 operator+(const R3 &P)const {return R3(x+P.x,y+P.y,z+P.z);} R3 & operator+=(const R3 &P) {x += P.x;y += P.y;z += P.z;return *this;} R3 operator-(const R3 &P)const {return R3(x-P.x,y-P.y,z-P.z);} R3 & operator-=(const R3 &P) {x -= P.x;y -= P.y;z -= P.z;return *this;} R3 & operator*=(R c) {x *= c;y *= c;z *= c;return *this;} R3 & operator/=(R c) {x /= c;y /= c;z /= c;return *this;} R3 operator-()const {return R3(-x,-y,-z);} R3 operator+()const {return *this;} R operator,(const R3 &P)const {return x*P.x+y*P.y+z*P.z;} // produit scalaire R3 operator^(const R3 &P)const {return R3(y*P.z-z*P.y ,P.x*z-x*P.z, x*P.y-y*P.x);} // produit vectoreil R3 operator*(R c)const {return R3(x*c,y*c,z*c);} R3 operator/(R c)const {return R3(x/c,y/c,z/c);} R & operator[](int i){ return (&x)[i];} const R & operator[](int i) const { return (&x)[i];} friend R3 operator*(R c,const R3 &P) {return P*c;} friend R3 operator/(R c,const R3 &P) {return P/c;} R norme() const { return std::sqrt(x*x+y*y+z*z);} R norme2() const { return (x*x+y*y+z*z);} R sum() const { return x+y+z;} R * toBary(R * b) const { b[0]=1.-x-y-z;b[1]=x;b[2]=y;b[3]=z;return b;} R X() const {return x;} R Y() const {return y;} R Z() const {return z;} R3 Bary(const R3 P[d+1]) const { return (1-x-y-z)*P[0]+x*P[1]+y*P[2]+z*P[3];} // add FH R3 Bary(const R3 **P ) const { return (1-x-y-z)*(*P[0])+x*(*P[1])+y*(*P[2])+z*(*P[3]);} // add FH friend ostream& operator <<(ostream& f, const R3 & P ) { f << P.x << ' ' << P.y << ' ' << P.z ; return f; } friend istream& operator >>(istream& f, R3 & P) { f >> P.x >> P.y >> P.z ; return f; } friend R det( R3 A, R3 B, R3 C) { R s=1.; if(abs(A.x)1e-50) { s *= A.x; A.y /= A.x; A.z /= A.x; B.y -= A.y*B.x ; B.z -= A.z*B.x ; C.y -= A.y*C.x ; C.z -= A.z*C.x ; return s* ( B.y*C.z - B.z*C.y) ; } else return 0. ; } friend R det(const R3 &A,const R3 &B, const R3 &C, const R3 &D) { return det(R3(A,B),R3(A,C),R3(A,D));} static const R3 KHat[d+1]; R2 p2() const { return R2(x,y);} }; inline R3 Minc(const R3 & A,const R3 &B){ return R3(min(A.x,B.x),min(A.y,B.y),min(A.z,B.z));} inline R3 Maxc(const R3 & A,const R3 &B){ return R3(max(A.x,B.x),max(A.y,B.y),max(A.z,B.z));} inline R Norme_infty(const R3 & A){return Max(std::fabs(A.x),std::fabs(A.y),std::fabs(A.z));} inline R Norme2_2(const R3 & A){ return (A,A);} inline R Norme2(const R3 & A){ return sqrt((A,A));} inline R3 R2::Bary(R3 P[d+1]) const { return (1-x-y)*P[0]+x*P[1]+y*P[2];} // add FH inline R3 R2::Bary(const R3 *const *const P ) const { return (1-x-y)*(*P[0])+x*(*P[1])+y*(*P[2]);} // add FH inline R3 R1::Bary(R3 P[d+1]) const { return (1-x)*P[0]+x*P[1];} // add FH inline R3 R1::Bary(const R3 *const *const P ) const { return (1-x)*(*P[0])+x*(*P[1]);} // add FH inline R2 R1::Bary(R2 P[d+1]) const { return (1-x)*P[0]+x*P[1];} // add FH inline R2 R1::Bary(const R2 *const *const P ) const { return (1-x)*(*P[0])+x*(*P[1]);} // add FH struct lessRd { bool operator()(const R1 &s1, const R1 & s2) const { return s1.x < s2.x ; } bool operator()(const R2 &s1, const R2 & s2) const { return s1.x == s2.x ? (s1.y < s2.y) :s1.x < s2.x; } bool operator()(const R3 &s1, const R3 & s2) const { return s1.x == s2.x ? (s1.y == s2.y ? (s1.z < s2.z) :s1.y < s2.y ) :s1.x < s2.x; } }; #endif freefem++-3.61-1/src/femlib/fem.cpp000644 000767 000024 00000163651 13321622623 017114 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ extern long verbosity ; extern long searchMethod; //pichon #include #include #include #include "error.hpp" #include #include //#include //using namespace std; //introduces namespace std #include "RNM.hpp" #include "rgraph.hpp" #include "Serialize.hpp" #include "fem.hpp" #include extern long npichon2d, npichon3d; extern long npichon2d1, npichon3d1; namespace Fem2D { class SubMortar { friend class Mesh; friend ostream & operator<<(ostream & f,const SubMortar & m); R alpha; // angle in radian R2 from,to; int k; // triangle number int i; // edge on triangle int sens; // // int head; public: SubMortar() :alpha(0),k(0),i(0),sens(0){} SubMortar(const Vertex & s,const Vertex & ss,int kk,int ii,int se) : alpha(Theta((R2) ss - s)),from(s),to(ss),k(kk),i(ii),sens(se) {} R len2() const { return Norme2_2(to-from);} R len2(const R2 & A) const{ return (to-from,(A-from));} bool operator<(const SubMortar & b){ return alpha < b.alpha ;} // to sort // bool side(const Triangle &K) {} }; ostream & operator<<(ostream & f,const SubMortar & m) { f << " a=" << m.alpha << " " << m.k << " " << m.i << " " << m.sens << " l^2=" <=0 && v < nv); BoundaryAdjacencesLink[j2]=BoundaryAdjacencesHead[v]; BoundaryAdjacencesHead[v]=j2; } } } void Mesh::ConsAdjacence() { // warning in the paper a mortar is the whole edge of the coarse triangle // here a mortar is a connected componand of he whole edge of the coarse triangle // minus the extremite of mortar // ----------- int NbCollision=0,NbOfEdges=0,NbOfBEdges=0,NbOfMEdges=0; const char MaskEdge[]={1,2,4}; const char AddMortar[]={8,16,32}; // reffecran(); // cadreortho(0.22,0.22,.1); if (neb) BuildBoundaryAdjacences(); area=0; // FH add nov 2010 lenbord=0; // FH add nov 2010 if(TheAdjacencesLink) return; // TheAdjacencesLink = new int[3*nt]; const int NbCode = 2*nv; char * TonBoundary = new char [nt]; // the edge is 1 2 4 AddMortar = 8 { int * Head = new int[NbCode]; // make the list int i,j,k,n,j0,j1; for ( i=0; i=0; n=TheAdjacencesLink[n]) { int jj=n%3,ii=n/3, jj0,jj1; VerticesNumberOfEdge(triangles[ii],jj,jj0,jj1); if(im==Min(jj0,jj1)) // same edge kk++; } if (kk==1) { if(step) bedges[neb].set(vertices,j0,j1,1); neb++; } } } if (step==0) { if (verbosity) cout << " we build " << neb << " boundary edges" << endl; bedges = new BoundaryEdge[neb]; } } BuildBoundaryAdjacences(); } for (int k=0;k=0 && i0 < nv); throwassert(i1 >=0 && i1 < nv); throwassert(i1 != i0) ; int im=Min(i0,i1); BoundaryEdgeHeadLink[i]=-1; int badsens =1; // bad for ( n=Head[i0+i1]; n>=0; n=TheAdjacencesLink[n]) { int jj=n%3,ii=n/3, jj0,jj1; VerticesNumberOfEdge(triangles[ii],jj,jj0,jj1); if(im==Min(jj0,jj1)) // same edge { TonBoundary[n/3] += MaskEdge[n%3]; BoundaryEdgeHeadLink[i]=n; if(i0==jj0) {badsens=0;break;} // add check // FH 01072005 bon cote de l'arete // sinon on regard si cela existe? } } if ( BoundaryEdgeHeadLink[i] <0 && verbosity) cout << " Attention l'arete frontiere " << i << " n'est pas dans le maillage " <=0) // be carefull { int m=*pm,jj=m%3,ii=m/3, jj0,jj1; VerticesNumberOfEdge(triangles[ii],jj,jj0,jj1); if(jm==Min(jj0,jj1)) // same edge { NbAdj++; // remove from the liste *pm=TheAdjacencesLink[m]; TheAdjacencesLink[m]=He; // link to He He = m; } else { NbCollision++; pm=TheAdjacencesLink+*pm; // next } } // make a circular link if (NbAdj>0) { int m=He; while(TheAdjacencesLink[m]>=0) m=TheAdjacencesLink[m]; // find end of list // close the List of common edges TheAdjacencesLink[m] = He; } if (NbAdj >2) { int m=He; do { m=TheAdjacencesLink[m]; } while(TheAdjacencesLink[m]!=He); } if (NbAdj) NbOfEdges++; if(NbAdj==1) { if (! (TonBoundary[i]& MaskEdge[j]) && 0) { NbOfMEdges++; if(verbosity>99) cout << " Edge (" << j0 << " "<< j1 << ") : " << j << " of Triangle " << &T-triangles << " on mortar \n" <<" --- > " << number(T[0]) << " " << number(T[1]) << " " << number(T[2]) << " /" << int(TonBoundary[i])<< "\n" ; TonBoundary[i]+= AddMortar[j]; } else { NbOfBEdges++; } } } } if (verbosity>1 ) { cout << " Nb of Vertices " << nv << " , Nb of Triangles " << nt << endl ; cout << " Nb of edge on user boundary " << neb << " , Nb of edges on true boundary " << NbOfBEdges << endl; if(NbOfMEdges) cout << " Nb of edges on Mortars = " << NbOfMEdges << endl; } delete [] Head; // cleanning memory NbMortars =0; NbMortarsPaper=0; } { // construct the mortar int * linkg = new int [nv]; // to link int * linkd = new int [nv]; // to link int * NextT3= new int[3*nt]; int * headT3= new int[nv]; ffassert( linkg && linkd); for (int i=0;i i is on mortars // make a link for all triangles contening a mortars const int k100=100; SubMortar bmortars[k100]; int k3j=0; for (int k=0;k2) cout << " sizeof datamortars" << kdm << " NbMortars=" << NbMortars << endl; mortars = new Mortar [NbMortars]; datamortars = new int [kdm]; for (int i=0;i=0; p=NextT3[p]) { // for all nonconformitie around sm int k=p/3; int i=p%3; const Triangle & T(triangles[k]); //throwassert( vertices + sm == &T[i]); // for the 2 egdes contening the vertex j of the triangle k for (int jj=0;jj<2;jj++) // 2 edge j contening i { int j = EdgesVertexTriangle[i][jj]; int s0,s1; VerticesNumberOfEdge(T,j,s0,s1); throwassert (s0 == is || s1 == is); if ( TonBoundary[k] & AddMortar[j]) { int ss,sens; if ( s0 == is) { ss=s1;sens=1;} else { ss=s0;sens=-1;} const Vertex & vss( vertices[ss]); bmortars[km++] = SubMortar(S,vss,k,i,sens); throwassert(km=0);// on a mortar ?? for ( p=headT3[sm] ;p>=0; p=NextT3[p]) { k=p/3; i=p%3; const Triangle & T(triangles[k]); // couleur(1);T.Draw(0.3); throwassert( vertices + sm == &T[i]); // for the 2 egdes contening the vertex j of the triangle k j = EdgesVertexTriangle[i][dg]; Vertex &V = T[VerticesOfTriangularEdge[j][dg]]; throwassert( &T[VerticesOfTriangularEdge[j][gd]] == vertices + sm); if ( TonBoundary[k] & AddMortar[j]) { // check the sens and the direction // cout << number(T[VerticesOfTriangularEdge[j][gd]]) << " pv=" // << number(V) << " sm=" << sm << " " << headT3[number(V)] << endl; R2 AV(A,V); lAV = Norme2(AV); avam = (AV,AM); // cout << " --- " << avam << " > " << ll[gd] << " " << Abs((AM.perp(),AV) ) // << " " << ( avam > ll[gd] && Abs((AM.perp(),AV)) < lAV * 1e-6 ) << endl; // go ahead in direction AM if ( (avam > ll[gd]) && Abs((AM.perp(),AV)) < lAV * 1e-6 ) {pV = &V;break;} // ok good } } if ( ! (p>=0 && pV)) throwassert(p>=0 && pV); // PB reach the end without founding if ( ! ( Abs((AM.perp(),A-*pV)) < 1e-5) ) // cout << Abs((AM.perp(),A-*pV)) <<*pV << endl, throwassert( Abs((AM.perp(),A-*pV)) < 1e-5); throwassert(sm != number(pV)); int kkgd= 3*k + j; ll[gd] = avam; // find the SubMortar m of vertex sm // with same sens and direction // for (int s= number(pV);s>=0;s=link[gd][s],nm[gd]++) { // on est sur l'arete kkgd throwassert( s == number(triangles[kkgd/3][VerticesOfTriangularEdge[kkgd%3][dg]])); sgd[gd]=s;// save the last if ( ! ( Abs((AM.perp(),A-vertices[s])) < 1e-5) ) // cout << Abs((AM.perp(),A-vertices[s])) << vertices[s] << endl, throwassert( Abs((AM.perp(),A-vertices[s])) < 1e-5); //cout << " s=" << s << " h=" << headT3[s] << " " << link[gd][s] << " " << link[dg][s] << endl; ; throwassert(kkgd>=0 && kkgd < 3*nt); if (datamortars) { throwassert(datag - datamortars == nm[0] + kdmg); throwassert(datad - datamortars == nm[1] + kdmd + kdmgo ); if (gd == 0) *datag++ = kkgd; // store else *datad++ = kkgd; // } // cout << " ++++ "<< ll[gd] << " > " << ll[dg] << " " << headT3[sgd[dg]] << " " <=0) { for (int pp=headT3[s] ;pp>=0; pp=NextT3[pp],kkk++) { throwassert(number(triangles[pp/3][pp%3]) == s); if( (pp/3)!= (kk/3)) { kkkk++,kkgd=pp - (pp%3) + EdgesVertexTriangle[pp%3][dg]; } } throwassert( kkgd/3 != kk/3); throwassert(kkk==2 && kkkk==1);} } if (ll[gd]>ll[dg] && headT3[sgd[dg]]>=0) //changement de cote gd = dg; throwassert(kkkk++<100); //cout <<" kkkk=" << kkkk << " " << sgd[0] << " " << sgd[1] << endl; } while (sgd[0] != sgd[1]); kdmgaa = Max(kdmgaa,kdmg + nm[0]); kdmdaa = Max(kdmdaa,kdmd + nm[1]); if (is < sgd[0] && headT3[sgd[0]] >=0) { //cout << " Mortars from (on saute) " << is << " to " << sgd[0] << " " << nm[0] << " " << nm[1]<< " " << kdmg << " " << kdmd << endl; if( mortars ) { // restore datag -= nm[0]; datad -= nm[1]; } } else { // cout << " Mortars from " << is << " to " << sgd[0] << " " << nm[0] << " " << nm[1]<< " " << kdmg << " " << kdmd << endl; if(mortars ) { ffassert(NbMortars< onbm); mortars[NbMortars].nleft = nm[0]; mortars[NbMortars].nright = nm[1]; // check for (int i=0;i1 && NbMortars) cout << " Nb Mortars " << NbMortars << /*" " << kdmg << " "<< kdmd <<*/ endl; if (mortars) { // cout << "end " << NbMortars << " g " << kdmg << " d " <4) { cout << " Number of Edges = " << NbOfEdges << endl; cout << " Number of Boundary Edges = " << NbOfBEdges << " neb = " << neb << endl; cout << " Number of Mortars Edges = " << NbOfMEdges << endl; cout << " Nb Of Mortars with Paper Def = " << NbMortarsPaper << " Nb Of Mortars = " << NbMortars; cout << " Euler Number nt- NbOfEdges + nv = " << nt + NbMortars - NbOfEdges + nv << "= Nb of Connected Componant - Nb Of Hole " <> nv >> nt >> neb ; if(verbosity>10) cout << " Nb of Vertex " << nv << " " << " Nb of Triangles " << nt << " Nb of boundary edge " << neb << endl; ffassert(f.good() && nt && nv) ; triangles = new Triangle [nt]; vertices = new Vertex[nv]; bedges = new BoundaryEdge[neb]; area=0; ffassert(triangles && vertices && bedges); for (i=0;i> vertices[i],ffassert(f.good()); for (i=0;i> i0 >> i1 >> i2 >> ir; ffassert(f.good() && i0>0 && i0<=nv && i1>0 && i1<=nv && i2>0 && i2<=nv); triangles[i].set(vertices,i0-1,i1-1,i2-1,ir); area += triangles[i].area;} for (i=0;i> i0 >> i1 >> ir; bedges[i] = BoundaryEdge(vertices,i0-1,i1-1,ir); } if(verbosity) cout << " End of read: area on mesh = " << area <0) { for (int i=0;i=0; nt=0; BuilTriangles(true,removeouside); /* if( ! removeouside) { neb=0; // remove the edge delete [] bedges; bedges=0; } */ ConsAdjacence(); } // cout << " build: Mesh : " << this << endl; } inline int BinaryRand(){ #ifdef RAND_MAX const long HalfRandMax = RAND_MAX/2; return rand() & U,const KN_ & V, R & dt) { const Triangle & T(Th[it]); const R2 Q[3]={(const R2) T[0],(const R2) T[1],(const R2) T[2]}; int i0=Th.number(T[0]); int i1=Th.number(T[1]); int i2=Th.number(T[2]); R u = lambda[0]*U[i0] + lambda[1]*U[i1] + lambda[2]*U[i2]; R v = lambda[0]*V[i0] + lambda[1]*V[i1] + lambda[2]*V[i2]; R2 P = lambda[0]*Q[0] + lambda[1]*Q[1] + lambda[2]*Q[2]; // cout << " " << u << " " << v ; R2 PF = P + R2(u,v)*dt; // couleur(15);MoveTo( P); LineTo( PF); R l[3]; l[0] = Area2(PF ,Q[1],Q[2]); l[1] = Area2(Q[0],PF ,Q[2]); l[2] = Area2(Q[0],Q[1],PF ); R Det = l[0]+l[1]+l[2]; l[0] /= Det; l[1] /= Det; l[2] /= Det; const R eps = 1e-5; int neg[3],k=0; int kk=-1; if (l[0]>-eps && l[1]>-eps && l[2]>-eps) { dt =0; lambda[0] = l[0]; lambda[1] = l[1]; lambda[2] = l[2]; } else { if (l[0]eps1) kk = (j+1)%3; else if (S<-eps1) kk = (j+2)%3; else if (BinaryRand()) kk = (j+1)%3; else kk = (j+2)%3; } else if (k==1) kk = neg[0]; if(kk>=0) { R d=lambda[kk]-l[kk]; throwassert(d); R coef = lambda[kk]/d; R coef1 = 1-coef; dt = dt*coef1; lambda[0] = lambda[0]*coef1 + coef *l[0]; lambda[1] = lambda[1]*coef1 + coef *l[1]; lambda[2] = lambda[2]*coef1 + coef *l[2]; lambda[kk] =0; } } int jj=0; R lmx=lambda[0]; if (lmx0 ? R2( (double) i/ (double)N,(double) j/(double)N) : R2( (double) (N-j)/ (double)N,(double) (N-i)/(double)N); } int numSubTriangle(const int N,const int n,const int l) { // compute the subdivision of a triangle in N*N // N number of sub division // n number of the sub triangle // l vertex of the sub triangle if(N<0) { int j=n%3; return numSubTriangle(-N,n/3,l)*3+j; } throwassert(n < N*N); int i = n % N; int j = n / N; int k = N - i - j; if(k<=0) { if(l==1) i++; else if(l==2) j++; } else if(l==1) j++; else if(l==2) i++; // if ( k <= 0 )cout << " - " << endl; return k >0 ? numSubTVertex(N,i, j) : numSubTVertex(N,N-j,N-i); } int Walk(const Mesh & Th,int& it, R *l, const KN_ & U,const KN_ & V, R dt) { int k=0; int j; while ( (j=WalkInTriangle(Th,it,l,U,V,dt))>=0) { //int jj = j; throwassert( l[j] == 0); R a= l[(j+1)%3], b= l[(j+2)%3]; int itt = Th.ElementAdj(it,j); if(itt==it || itt <0) return -1; it = itt; l[j]=0; l[(j+1)%3] = b; l[(j+2)%3] = a; ffassert(k++<1000); } return it; } const Triangle * Mesh::Find( R2 P, R2 & Phat,bool & outside,const Triangle * tstart) const { int CasePichon=0; int it,j,it00; const Triangle * rett=0; if ( tstart ) it = (*this)(tstart); else { const Vertex * v=quadtree->NearestVertexWithNormal(P); if (!v) { v=quadtree->NearestVertex(P); assert(v); } /* if (verbosity>100) cout << endl << (*this)(v) << *v << " " << Norme2(P-*v) << endl; */ it00=it=Contening(v); } RESTART: // int itdeb=it; // int count=0; // L1: outside=true; //int its=it; int iib=-1;//,iit=-1; R dP=DBL_MAX; R2 PPhat; const Triangle * tt; int k=0,kout=0; kfind++; while (1) { const Triangle & K(triangles[it]); kthrough++; if (k++>=10000) { /* cout << P << endl; reffecran(); Draw(0); triangles[its].Fill(2); DrawMark(P,0.01); rattente(1); */ ffassert(k++<10000); } int kk,n=0,nl[3]; R2 & A(K[0]), & B(K[1]), & C(K[2]); R l[3]={0,0,0}; R area2= K.area*2; R eps = -area2*1e-6; l[0] = Area2(P,B,C); l[1] = Area2(A,P,C); l[2] = area2-l[0]-l[1]; if (l[0] < eps) nl[n++]=0; if (l[1] < eps) nl[n++]=1; if (l[2] < eps) nl[n++]=2; if (n==0) { // interior => return outside=false; Phat=R2(l[1]/area2,l[2]/area2); return &K; } else if (n==1) kk=0; else kk=BinaryRand() ? 1 : 0; j= nl[ kk ]; int itt = ElementAdj(it,j); if(itt!=it && itt >=0) { dP=DBL_MAX; it=itt; continue; } // edge j on border l[j]=0; if ( n==2 ) { kk = 1-kk; j= nl[ kk ]; itt = ElementAdj(it,j); if (itt >=0 && itt != it) // correction FH oct 2009 { dP=DBL_MAX; it=itt; continue; } // on a corner of the mesh l[0]=l[1]=l[2]=0.; l[3-nl[0]-nl[1]]=1.; // correction april 2015 FH Phat=R2(l[1],l[2]); rett=triangles +it; if(searchMethod && outside) goto PICHON; return rett; } // on the border // projection Ortho kout++; int j0=(j+1)%3,i0= &K[j0]-vertices; int j1=(j+2)%3,i1= &K[j1]-vertices; int ii,jj,iii; bool ret=false; R2 AB=R2(K[j0],K[j1]), AP(K[j0],P), BP(K[j1],P); R la= (AB,AP); R lb= -(AB,BP); if(la<0) ii= i0, jj = j0,iii=i1; else if ( lb <0) ii= i1, jj = j1,iii=i0; else // PROJECTION between A,B ret = true; if( ! ret) { // VERIF THE DISTANCE**2 Dicrease R2 Pjj(P,K[jj]); R dd = (Pjj,Pjj); if (dd >= dP ) { Phat=PPhat; // if(kout>1) cout << " @ " << tt-triangles << " " << Phat << " " << outside << endl; rett=tt; if(searchMethod && outside) goto PICHON; return tt; } else { l[0]=l[1]=l[2]=0; l[jj]=1; PPhat.x=l[1]; PPhat.y=l[2]; dP=dd; tt = triangles + it ; } } /* if(kout>1) cout << "Find --- "<< P << " : k=" << k << " la lb " << la << " " << lb << " ii =" << ii << " iii= " << iii << " " << it << " dP= " << dP << " ret = " << ret <1) cout << " # " << it << " " << Phat << " " << outside << endl; rett=triangles +it; if(searchMethod && outside) goto PICHON; return rett; } bool ok=false; // next edge on true boundaryS for (int p=BoundaryAdjacencesHead[ii];p>=0;p=BoundaryAdjacencesLink[p]) { int e=p/2, ie=p%2;// je=2-ie; // cout << number(bedges[e][0]) << " " << number(bedges[e][1]) << endl; if (!bedges[e].in( vertices+iii)) // edge not equal to i0 i1 { ok=true; iib = ii; it= BoundaryElement(e,ie); // next triangle // cout << " ------ " << it << " " << Phatt << endl; break; } } ffassert(ok); } PICHON: // Add dec 2010 ... CasePichon++; if(CasePichon==1) {// hack feb 2016 ..... ??????? // change starting triangle ???? R2 PF=(*rett)(Phat); R2 PP=P + (P-PF); const Vertex * v=quadtree->NearestVertexWithNormal(PP); if (!v) { v=quadtree->NearestVertex(P); assert(v); } /* if (verbosity>100) cout << endl << (*this)(v) << *v << " " << Norme2(P-*v) << endl; */ it=Contening(v); if( it != it00) goto RESTART; } npichon2d++; // Brute force .... bof bof ... double ddp=1e100; int pk=-1; for(int k=0;k return outside=false; Phat=R2(l[1]/area2,l[2]/area2); return &K; } R2 GP(G,P); double lgp2=(GP,GP); if(ddp > lgp2) { ddp=lgp2; pk=k; } } return rett; } int WalkInTriangle(const Mesh & Th,int it, double *lambda, R u, R v, R & dt) { const Triangle & T(Th[it]); const R2 Q[3]={(const R2) T[0],(const R2) T[1],(const R2) T[2]}; // int i0=Th.number(T[0]); // int i1=Th.number(T[1]); // int i2=Th.number(T[2]); R2 P = lambda[0]*Q[0] + lambda[1]*Q[1] + lambda[2]*Q[2]; // cout << " " << u << " " << v ; R2 PF = P + R2(u,v)*dt; // couleur(15);MoveTo( P); LineTo( PF); R l[3]; l[0] = Area2(PF ,Q[1],Q[2]); l[1] = Area2(Q[0],PF ,Q[2]); l[2] = Area2(Q[0],Q[1],PF ); R Det = l[0]+l[1]+l[2]; l[0] /= Det; l[1] /= Det; l[2] /= Det; const R eps = 1e-5; int neg[3],k=0; int kk=-1; if (l[0]>-eps && l[1]>-eps && l[2]>-eps) { dt =0; lambda[0] = l[0]; lambda[1] = l[1]; lambda[2] = l[2]; } else { if (l[0]eps1) kk = (j+1)%3; else if (S<-eps1) kk = (j+2)%3; else if (BinaryRand()) kk = (j+1)%3; else kk = (j+2)%3; } else if (k==1) kk = neg[0]; if(kk>=0) { R d=lambda[kk]-l[kk]; throwassert(d); R coef = lambda[kk]/d; R coef1 = 1-coef; dt = dt*coef1; lambda[0] = lambda[0]*coef1 + coef *l[0]; lambda[1] = lambda[1]*coef1 + coef *l[1]; lambda[2] = lambda[2]*coef1 + coef *l[2]; lambda[kk] =0; } } int jj=0; R lmx=lambda[0]; if (lmx0) return k*k; else if(k<0) return 3*(k*k); ffassert(0); return 0; } int NbOfSubInternalVertices(int kk) { assert(kk); int k=Abs(kk); int r= (k+2)*(k+1)/2; assert(r>=0); return kk<0 ? 3*r : r; } Mesh::Mesh(int nbv,R2 * P) { TheAdjacencesLink=0; BoundaryEdgeHeadLink=0; BoundaryAdjacencesHead=0; BoundaryAdjacencesLink=0; TriangleConteningVertex=0; TriangleConteningVertex=0; dim=2; tet=0; edges=0; ntet=0; ne=0; volume=0; quadtree =0; NbMortars=0; NbMortarsPaper=0; nt=0; mortars=0; TheAdjacencesLink =0; datamortars=0; quadtree =0; bedges=0; neb =0; bnormalv=0; nv=nbv; vertices = new Vertex[nv]; triangles=0; area=0; for (int i=0;i1) cout << " Nb Triangles = " << nbt << endl; triangles = new Triangle[nt]; for(int i=0,k=0;i1000) { cout << vertices[nu[k]-1]<< " " << endl; cout << vertices[nu[k+1]-1]<< " " << endl; cout << vertices[nu[k+2]-1]<< " " << endl; cout << vertices[nu[k]-1]<< " \n\n" << endl; } triangles[i].set(vertices,nu[k]-1,nu[k+1]-1,nu[k+2]-1,reft[i]); area += triangles[i].area; } delete [] arete; delete [] nu; delete [] c; delete [] tri; delete [] reft; delete [] cr; delete [] h; delete [] sd; } Mesh::Mesh(const Mesh & Th,int * split,bool WithMortar,int label) { // routine complique // count the number of elements area=0; //Th.area; lenbord=0; volume=0; BoundaryAdjacencesHead=0; BoundaryAdjacencesLink=0; BoundaryEdgeHeadLink=0; quadtree =0; NbMortars=0; ntet=0; ne=0; dim=2; tet=0; edges=0; mortars=0; TheAdjacencesLink =0; quadtree =0; bedges=0; neb =0; bnormalv=0; R2 Pmin,Pmax; Th.BoundingBox(Pmin,Pmax); nt=0; int nebi=0; // nb arete interne int nbsdd =0; int splitmin=100,splitmax=0; for (int i=0;i2) cout << " - Mesh construct : from " << &Th << " split min " << splitmin << " max " << splitmax << ", recreate " << !noregenereration << " label =" << label << endl; triangles = new Triangle[nt]; assert(triangles); // computation of thee numbers of vertices // on decoupe tous betement // et on recolle le points ensuite // avec le quadtree qui sont sur les aretes ou les sommets // calcul du magorant du nombre de sommets int nvmax= 0;// Th.nv; { //int v; KN setofv(Th.nv,false); for (int i=0;i4) cout << " - nv old " << nvmax << endl; } int nebmax=neb; int nebimax=nebi; int nbsddmax=nbsdd; for (int i=0;i=0 && split[it]<=64); // cout << " it = " < too smal { // to keep the order of old vertices to have no problem in // interpolation on sub grid of RT finite element for example (Feb. 2016 F. Hecht) KN setofv(Th.nv,false); for (int i=0;iToClose(Th(i),seuil); if (pV ==0) { vertices[nv] = Th(i); if(verbosity>99) cout << " old to new: " << i << " -> " << nv << " / " << Th(i) <Add(vertices[nv]); nv++; } } if(verbosity>3) { cout << " --- number of old vertices use: " << nv << endl; cout << " --- number of neb : " << nebmax << endl; } } /* for (int i=0;iToClose(Th[i][j],seuil); if (pV ==0) { // cout << Th(i,j) << " " ; vertices[nv] = Th[i][j]; vertices[nv].normal=0; quadtree->Add(vertices[nv]); nv++;} } // nv = Th.nv; if(verbosity>3) { cout << " -- number of old vertices use: " << nv << endl; cout << " -- number of neb : " << nebmax << endl; } */ bedges = new BoundaryEdge[nebmax]; BoundaryEdge * bedgesi= new BoundaryEdge[nebimax]; // jan 2007 FH int * sdd= new int[Th.nt]; for (int i=0;i=0) n = max(n,split[itt]); // pour les aretes internes (FH juillet 2005) if (!n) continue; if (pbe ) { re = *pbe; if( & (*pbe)[0] == &Th(ie1) ) sens = -sens; // pour les aretes non decoupe avril 2007 // cout << " ### " << ie0 << " " << ie1 << " " << sens << endl; } // cout << " lab = " << re.lab << endl; Vertex *pva= quadtree->NearestVertex(Th(ie0)); Vertex *pvb= quadtree->NearestVertex(Th(ie1)); Vertex *pv0=pva; R2 A(*pva),B(*pvb); R la = 1,lb=0, delta=1.0/n; for (int j=1;j le sens change avril 2007 la-=delta; lb+=delta; assert(nvAdd(*pv1); nv++; assert(nnebToClose(Pj,seuil,true); // if !noregenereration => point du bord du triangle deja genere bool addv = !pV; if(!noregenereration && pV==0) addv = lmin > 1e-5; if ( addv ) { // new vertex // cout << " -- " << nv << " New Vertices " << Pj << " n=" << n << " j=" << j << " " << PTj << endl; if( !(nv < nvmax )) ffassert(nvAdd(*pV); nv++; } // end of new vertex if(noregenereration) { assert(pV); //cout << j << " " << *pV << " " << Pj << " " << number(pV) << " " << Norme2(Pj-*pV) << " " << nv << endl; vt[j]=number(pV); } } // triangles[kt].SetVertex(j,pV); // for(int j=0;j<3;j++) // cout << kt << " " << n << endl; if(noregenereration) { R2 A=vertices[vt[0]]; R2 B=vertices[vt[1]]; R2 C=vertices[vt[2]]; R a = (( B-A)^(C-A))*0.5; if (a>0) triangles[kt].set(vertices,vt[0],vt[1],vt[2],T.lab); else triangles[kt].set(vertices,vt[0],vt[2],vt[1],T.lab); } } // end loop on all sub triangle } // end if (verbosity>3 ) { cout << " - regeneration = " << ! noregenereration <10) { cout << " mshptg8_ " << endl; cout << " nbs =" << nbs << endl; cout << " nba =" << nba << endl; cout << " nbt =" << nbt << endl; cout << " nbsd =" << nbsd << endl; cout << " sommets : " << endl; for(int i=0;i3) cout << " - Nb Triangles = " << nt << " remove triangle in hole :" << nbt - nt <=0) triangles[kt++].set(vertices,nu[k]-1,nu[k+1]-1,nu[k+2]-1,Th[reft[i]].lab); assert(kt==nt); // END Correction FH bug trunc mesh with hole 25032005 + july 2005 delete [] arete; delete [] nu; delete [] c; delete [] tri; delete [] reft; delete [] cr; delete [] h; delete [] sd; } delete [] bedgesi; delete [] sdd; ConsAdjacence(); } const char Mesh::magicmesh[8]="Mesh 2D"; int Mesh::kthrough =0; int Mesh::kfind=0; Mesh::Mesh(const Serialize &serialized) { TriangleConteningVertex =0; BoundaryAdjacencesHead=0; BoundaryAdjacencesLink=0; BoundaryEdgeHeadLink=0; quadtree =0; volume=0; NbMortars=0; dim=0; tet=0; edges=0; ntet=0; ne=0; mortars=0; TheAdjacencesLink =0; nv=0; nt =0; neb=0; triangles=0; vertices=0; bedges=0; area=0; lenbord=0; bnormalv=0; // --- assert(serialized.samewhat(magicmesh)); size_t pp=0;; long long l; serialized.get(pp,l); serialized.get( pp,nt); serialized.get( pp,nv); serialized.get( pp,neb); if (verbosity>2) cout << " mesh serialized : l " << l << " / " << nt << " " << nv << " " << neb << endl; assert ( nt > 0 && nv >0 && neb >=0); triangles = new Triangle [nt]; vertices = new Vertex[nv]; bedges = new BoundaryEdge[neb]; area=0; ffassert(triangles && vertices && bedges); for (int i=0;i2) cout << " End of un serialize: area on mesh = " << area <2) cout << " mesh dSerialized : " << l << " /" << nt << " " << nv << " " << neb << endl; for (int i=0;i2) cout << " number of real boundary edges " << nb << endl; bnormalv= new R2[nb]; R2 *n=bnormalv; for (int k=0;k #include #include #include #include using namespace std; #define const_R R #include inline void Check_Kn(const char * str,const char * file,int line) { cerr << "CHECK_KN: " << str << " in file: " << file << ", line " << line < // version du 21 nov 1999 correction delete // version du 13 nov 1999 // version du 18 mars 99 // F. Hecht // attention les indexations les indexations peuvent changer // puisque que l'on peut prendre la transposer d'une matrice // tableau // mais ils partent de 0 // version corrigee du 15/11/98 // version avec sous tableau --- mars 99 // ------- // remarque du 8 mars 99 FH // class pour prendre des sous-tableau // attention aux PB de continute dans les tableaux // on a supposer que les tableaux multi indices pouvait est vue comme // un tableau continue ce qui est generalement faux quand l'on en // prend un sous tableau // exemple: un tableau 3,5 est numerote comme: // 0 3 6 9 12 // 1 4 7 10 13 // 2 5 8 11 14 // step // indexi n 1 // indexj m n // est le sous tableau 3,3 n'est pas numeroter consecutivement // // Donc la fonction IsVector1() nous dit si un tableau // a un 2 ou 3 indices est ou non consecutif en memoire // // -- ajoute d'une classe VirtualMatrice // pour modeliser le produit matrice vecteur // x = A*v; via des fonctions virtuelle // ---------------------------------- // version du 6 mars 2001 FH // --- initialisation -- // -------------------------------- // version du 9 oct 2001 FH // ajoute de constructeur par defaut d'une vecteur // + set , pour definir le vecteur // ou l'affectation (bof bof) // --------------------- // version sep 2002 // ajoute operateur >> pour KN et KN_ // -------------------- // version april 2003 // ajoute un gestion auto de // la fonction InternalError pour les matriceVirtuel // -------------------- // version jan 2004 // correction pour go ++ // des operateur #= pour les matrices et tenseurs // ---------------------- // version feb 2004 // v(i(:)) = w // i(1:10) // w=u(i(:)) // // version mars 2004 make small correction // in ITAB operator problem if non type R a defi // ------------------- // Modif pour version avec les Complex mai 2004 // (u,v) donne le produit complex utiliser dans le produit matrice vecteur // (u,conj(v)) donne le produit hermitiene pour le gradient conjugue // // -- de fonction dans le cas real // modif for g++ 4.0 and xlc++ mai 2005 // adding some this-> // mars 2007 // correction in operator operation:b -1*c // aout 2007, // correct y = A*x ; when y is unset // correct y += A*x ; when y is unset // re-correct += sep 2007 // add size of the matrix in VirtualMatrix class. // mars 2010 add unset KNM case ... // sept 2014 add 1/v operator ... // ---------------- namespace RNM { inline double conj(const double & x){return x;} inline float conj(const float &x){return x;} inline long conj(const long &x){return x;} inline double real(const double &x){return x;} inline float real(const float &x){return x;} template T real(const complex& v){ return std::real(v);} inline double norm2(const double x){return x*x;} inline float norm2(const float x){return x*x;} template T norm2(const complex& v){ return std::norm(v);} template inline complex conj(const complex& v){ return std::conj(v);} template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} template inline T Abs (const T &a){return a <0 ? -a : a;} template inline void Exchange (T& a,T& b) {T c=a;a=b;b=c;} template inline T Max (const T &a,const T & b,const T & c){return Max(Max(a,b),c);} template inline T Min (const T &a,const T & b,const T & c){return Min(Min(a,b),c);} // specialisation cas complex --- template inline complex Min(const complex &a,complex &b) { return complex(min(a.real(),b.real()),min(a.imag(),b.imag()));} template inline complex Max(const complex &a,const complex &b) { return complex(max(a.real(),b.real()),max(a.imag(),b.imag()));} /*inline complex Min(const complex &a,complex &b) { return complex(Min(real(a),real(b)),Min(imag(a),imag(b)));} inline complex Max(const complex &a,const complex &b) { return complex(Max(real(a),real(b)),Max(imag(a),imag(b)));} */ } // ---- template class KNMK_ ; template class KNM_ ; template class KN_ ; template class TKN_ ; // KN_ Hermitain template class ConjKNM_ ;// take the conj of the matrix. template class notKN_ ; // KN_ not template class notnotKN_ ; // KN_ not not template class KNMK ; template class KNM ; template class KN ; template class conj_KN_ ; template class Add_KN_; template class Sub_KN_; template class Mulc_KN_; // vector b*a_i template class Divc_KN_;// vector b/a_i template class Add_Mulc_KN_; template class Mul_KNM_KN_; template class Mul_KNMh_KN_; template class DotStar_KN_; template class DotSlash_KN_; template class outProduct_KN_; template class if_KN_; template class if_arth_KN_; template class ifnot_KN_; template class KN_ITAB; template class F_KN_; #ifndef ffassert #define ffassert assert #endif // gestion des erreur interne -- #ifndef InternalError typedef void (* TypeofInternalErrorRoutine)(const char *) ; static TypeofInternalErrorRoutine &InternalErrorRoutinePtr() { static TypeofInternalErrorRoutine routine=0; return routine; } static void InternalError(const char * str) { if (InternalErrorRoutinePtr() ) (*InternalErrorRoutinePtr())(str); cerr << str; exit(1); } inline void SetInternalErrorRoutine(TypeofInternalErrorRoutine f) { InternalErrorRoutinePtr()=f; } #endif // -- template struct PplusQ { const P & p;const Q & q; PplusQ(const P & pp,const Q & qq) : p(pp),q(qq){} }; template struct VirtualMatrice { public: int N,M; VirtualMatrice(int nn,int mm): N(nn),M(mm) {} VirtualMatrice(int nn): N(nn),M(nn) {} // y += A x virtual void addMatMul(const KN_ & x, KN_ & y) const =0; virtual void addMatTransMul(const KN_ & , KN_ & ) const { InternalError("VirtualMatrice::addMatTransMul not implemented "); } virtual bool WithSolver() const {return false;} // by default no solver virtual void Solve( KN_ & ,const KN_ & ) const { InternalError("VirtualMatrice::solve not implemented.\n In FeeeFem++ add instruction like set(A, solver= sparsesolver);\n// where A is the current matrix "); } #ifdef VersionFreeFempp virtual bool ChecknbLine (int n) const= 0; virtual bool ChecknbColumn (int m) const =0; #else virtual bool ChecknbLine (int n) const {return true;} virtual bool ChecknbColumn (int m) const {return true;} #endif struct plusAx { const VirtualMatrice * A; const KN_ x; plusAx( const VirtualMatrice * B,const KN_ & y) :A(B),x(y) { if(B) { ffassert(B->ChecknbColumn(y.N())); } } }; plusAx operator*(const KN_ & x) const {return plusAx(this,x);} struct plusAtx { const VirtualMatrice * A; const KN_ x; plusAtx( const VirtualMatrice * B,const KN_ & y) :A(B),x(y) { if(B) { ffassert(B->ChecknbLine(y.N())); } } }; struct solveAxeqb { const VirtualMatrice * A; const KN_ b; solveAxeqb( const VirtualMatrice * B,const KN_ & y) :A(B),b(y) { if(B) { ffassert(B->ChecknbColumn(y.N())); } } }; virtual ~VirtualMatrice(){} }; //template class MatriceCreuseMulKN_; //template class MatriceCreuseDivKN_; class ShapeOfArray; class FromTo{ public: long from,to; FromTo(long i,long j):from(i),to(j) {K_throwassert(i=0);} long end() const { return n*step;} long last() const { return (n-1)*step;} long constant() const { return step==0;} long index(long k) const { K_throwassert( (k>=0) && ( (k =0) && ( (k ostream & operator<<(ostream & f,const KN_ & v) ; template istream & operator>>(istream & f, KN_ & v); template istream & operator>>(istream & f, KN & v); template class SetArray { public: R o,step; long n; explicit SetArray(long nn,R oo=R(),R sstep=R(1)): o(oo),n(nn),step(sstep) {} template SetArray(SetArray sa): o(sa.o),n(sa.n),step(sa.step) {} R operator[](long i) const { return i <= n ? o + R(i)*step : R();} long size() const {return n;} }; /// <> template class KN_: public ShapeOfArray { protected: R *v; public: typedef R K; // type of data long N() const {return n;} bool unset() const { return !v;} void set(R * vv,int nn,int st=1,int nx=-1) {v=vv;n=nn;step=st;next=nx;} void set(KN_ t) {v=t.v;n=t.n;step=t.step;next=t.next;} // FH Add Nov 2016 long size() const{return step?n*step:n;} operator R *() const {return v;} KN_(const KN_ & u) :ShapeOfArray(u),v(u.v){} KN_(const KN_ & U,const SubArray & sa) : ShapeOfArray(U,sa),v(U.v + U.index(sa.start)) {} KN_ operator()(const SubArray & sa) const { return KN_(*this,sa);} // sub array R & operator[](long i) const {return v[index(i)];} R & operator()(long i) const {return v[index(i)];} R & operator[](int i) const {return v[index(i)];} R & operator()(int i) const {return v[index(i)];} R operator,(const KN_ & v) const; // dot product KN_& operator =(const SetArray & u) ; KN_& operator +=(const SetArray & u) ; KN_& operator -=(const SetArray & u) ; KN_& operator *=(const SetArray & u) ; KN_& operator /=(const SetArray & u) ; KN_& operator =(const KN_ & u) ; KN_& operator +=(const KN_ & u) ; KN_& operator -=(const KN_ & u) ; KN_& operator *=(const KN_ & u) ; KN_& operator /=(const KN_ & u) ; KN_& operator = (const_R a) ; KN_& operator +=(const_R a) ; KN_& operator -=(const_R a) ; KN_& operator /=(const_R a) ; KN_& operator *=(const_R a) ; KN_& operator = (R* a) { return operator =(KN_(a,n));} KN_& operator += (R* a) { return operator+=(KN_(a,n));} KN_& operator -= (R* a) { return operator-=(KN_(a,n));} KN_& operator *= (R* a) { return operator*=(KN_(a,n));} KN_& operator /= (R* a) { return operator/=(KN_(a,n));} R min() const ; R max() const ; R sum() const ; double norm() const ; double l2() const ; double l1() const ; double linfty() const ; double lp(double p) const ; template long last(const T &) const; template long first(const T &) const; void map(R (*f)(R )); // apply the f fonction a all element of the array void map(R (*f)(const R& )); // apply the f fonction a all element of the array template void set(R (*f)(const T& ),KN_ & u); // apply the f fonction a all element of the array u KN_& operator =(const DotStar_KN_ & u) ; KN_& operator+=(const DotStar_KN_ & u) ; KN_& operator-=(const DotStar_KN_ & u) ; KN_& operator*=(const DotStar_KN_ & u) ; KN_& operator/=(const DotStar_KN_ & u) ; KN_& operator =(const DotSlash_KN_ & u) ; KN_& operator+=(const DotSlash_KN_ & u) ; KN_& operator-=(const DotSlash_KN_ & u) ; KN_& operator*=(const DotSlash_KN_ & u) ; KN_& operator/=(const DotSlash_KN_ & u) ; KN_& operator =(const if_KN_ & u) ; KN_& operator+=(const if_KN_ & u) ; KN_& operator-=(const if_KN_ & u) ; KN_& operator*=(const if_KN_ & u) ; KN_& operator/=(const if_KN_ & u) ; KN_& operator =(const ifnot_KN_ & u) ; KN_& operator+=(const ifnot_KN_ & u) ; KN_& operator-=(const ifnot_KN_ & u) ; KN_& operator*=(const ifnot_KN_ & u) ; KN_& operator/=(const ifnot_KN_ & u) ; KN_& operator =(const Add_KN_ & u) ; KN_& operator+=(const Add_KN_ & u) ; KN_& operator-=(const Add_KN_ & u) ; KN_& operator*=(const Add_KN_ & u) ; KN_& operator/=(const Add_KN_ & u) ; template KN_& operator = (const KN_ITAB & u); template KN_& operator += (const KN_ITAB & u); template KN_& operator -= (const KN_ITAB & u); template KN_& operator *= (const KN_ITAB & u); template KN_& operator /= (const KN_ITAB & u); KN_ITAB< KN_,const KN_ > operator()(const KN_ &itab) ; KN_ITAB< KN_,const KN_ > operator()(const KN_ &itab) ; KN_ITAB,const KN_ > operator()(const KN_ &itab) const ; KN_ITAB,const KN_ > operator()(const KN_ &itab) const ; KN_& operator =(const Sub_KN_ & u) ; KN_& operator-=(const Sub_KN_ & u) ; KN_& operator+=(const Sub_KN_ & u) ; KN_& operator*=(const Sub_KN_ & u) ; KN_& operator/=(const Sub_KN_ & u) ; KN_& operator =(const Mulc_KN_ & u) ; KN_& operator+=(const Mulc_KN_ & u) ; KN_& operator-=(const Mulc_KN_ & u) ; KN_& operator*=(const Mulc_KN_ & u) ; KN_& operator/=(const Mulc_KN_ & u) ; KN_& operator =(const Divc_KN_ & u) ; KN_& operator+=(const Divc_KN_ & u) ; KN_& operator-=(const Divc_KN_ & u) ; KN_& operator*=(const Divc_KN_ & u) ; KN_& operator/=(const Divc_KN_ & u) ; KN_& operator =(const Add_Mulc_KN_ & u) ; KN_& operator+=(const Add_Mulc_KN_ & u) ; KN_& operator-=(const Add_Mulc_KN_ & u) ; KN_& operator*=(const Add_Mulc_KN_ & u) ; KN_& operator/=(const Add_Mulc_KN_ & u) ; KN_& operator =(const if_arth_KN_ & u) ; KN_& operator+=(const if_arth_KN_ & u) ; KN_& operator-=(const if_arth_KN_ & u) ; KN_& operator*=(const if_arth_KN_ & u) ; KN_& operator/=(const if_arth_KN_ & u) ; KN_& operator =(const Mul_KNM_KN_ & u) ; KN_& operator+=(const Mul_KNM_KN_ & u) ; KN_& operator-=(const Mul_KNM_KN_ & u) ; KN_& operator*=(const Mul_KNM_KN_ & u) ; KN_& operator/=(const Mul_KNM_KN_ & u) ; KN_& operator =(const Mul_KNMh_KN_ & u) ; KN_& operator+=(const Mul_KNMh_KN_ & u) ; KN_& operator-=(const Mul_KNMh_KN_ & u) ; KN_& operator*=(const Mul_KNMh_KN_ & u) ; KN_& operator/=(const Mul_KNMh_KN_ & u) ; // KN_& operator =(const MatriceCreuseMulKN_ & ) ; // KN_& operator +=(const MatriceCreuseMulKN_ & ) ; KN_& operator =(const typename VirtualMatrice::plusAx & Ax) { if(Ax.A) { ffassert(&Ax.x[0] != &this->operator[](0));*this=R(); Ax.A->addMatMul(Ax.x,*this); } return *this;} KN_& operator =(const typename VirtualMatrice::plusAtx & Ax) { if(Ax.A) { ffassert(&Ax.x[0] != &this->operator[](0));*this=R(); Ax.A->addMatTransMul(Ax.x,*this); } return *this;} KN_& operator +=(const typename VirtualMatrice::plusAx & Ax) { if(Ax.A) { ffassert(&Ax.x[0] != &this->operator[](0)); Ax.A->addMatMul(Ax.x,*this); } return *this;} KN_& operator +=(const typename VirtualMatrice::plusAtx & Ax) { if(Ax.A) { ffassert(&Ax.x[0] != &this->operator[](0)); Ax.A->addMatTransMul(Ax.x,*this); } return *this;} KN_& operator =(const typename VirtualMatrice::solveAxeqb & Ab) { if(Ab.A) { ffassert(&Ab.b[0] != &this->operator[](0));*this=R(); Ab.A->Solve(*this,Ab.b); } return *this;} template KN_& operator = (const F_KN_ & u) ; template KN_& operator += (const F_KN_ & u) ; template KN_& operator -= (const F_KN_ & u) ; template KN_& operator /= (const F_KN_ & u) ; template KN_& operator *= (const F_KN_ & u) ; // KN_& operator =(const MatriceCreuseDivKN_ &) ; friend ostream & operator<< (ostream & f,const KN_ & v) ; KN_(R *u,const ShapeOfArray & s):ShapeOfArray(s),v(u){} KN_(R *u,long nn,long s):ShapeOfArray(nn,s),v(u){} KN_(R *u,long nn,long s,long nextt):ShapeOfArray(nn,s,nextt),v(u){} KN_(R *u,long nn):ShapeOfArray(nn),v(u){} TKN_ t() ; // transpose const TKN_ t() const ; // transpose notKN_ operator!() ; // not const notKN_ operator!() const ; // not // operator KN &(); // operator const KN &() const; private: KN_& operator++(){K_throwassert(next>=0);v += next;return *this;} // ++U KN_& operator--(){K_throwassert(next>=0);v -= next;return *this;} // --U KN_ operator++(int ){K_throwassert(next>=0); KN_ old=*this;v = v +next;return old;} // U++ KN_ operator--(int ){K_throwassert(next>=0); KN_ old=*this;v = v -next;return old;} // U++ KN_(const KN_ & u,long offset) :ShapeOfArray(u),v(&u[offset]){} KN_(const KN_ & u,const ShapeOfArray &sh,long startv=0) :ShapeOfArray(sh*u.step),v(&u[startv]){} KN_(const KN_ & u,long nnext,const ShapeOfArray &sh,long startv=0) :ShapeOfArray(sh.n,sh.step*u.step,nnext),v(&u[startv]){ } // friend class KN_; friend class KNM_; friend class KNMK_; friend class KN; friend class KNM; friend class KNMK; }; template class KNM_: public KN_ { public: ShapeOfArray shapei; ShapeOfArray shapej; public: long IsVector1() const { return (shapei.n*shapej.n) == this->n ;} long N() const {return shapei.n;} long M() const {return shapej.n;} long size() const { return shapei.n*shapej.n;} ConjKNM_ h() ; // take the conj for hermian operator const ConjKNM_ h() const ; // take the conj for hermian operator KNM_(R* u,const ShapeOfArray & s, const ShapeOfArray & si, const ShapeOfArray & sj) : KN_(u,s),shapei(si),shapej(sj){} KNM_(R* u,long nn,long mm) : KN_(u,ShapeOfArray(nn*mm)),shapei(nn,1,nn),shapej(mm,nn,1){} KNM_(R* u,long nn,long mm,long s) : KN_(u,ShapeOfArray(nn*mm,s)),shapei(nn,1,nn),shapej(mm,nn,1){} KNM_(KN_ u,long n,long m) : KN_(u,ShapeOfArray(m*n)),shapei(n,1,n),shapej(m,n,1){ } KNM_(const KN_ &u,const ShapeOfArray & si,const ShapeOfArray & sj,long offset=0) : KN_(&u[offset],si.last()+sj.last()+1,u.step),shapei(si),shapej(sj) {K_throwassert( offset>=0 && this->n+ (this->v-(R*)u) <= u.n);} KNM_(const KN_ &u,const ShapeOfArray & si,const ShapeOfArray & sj,long offset,long nnext) : KN_(&u[offset],si.last()+sj.last()+1,u.step,nnext),shapei(si),shapej(sj) {K_throwassert( offset>=0 && this->n+ (this->v-(R*)u) <= u.n);} KNM_(KNM_ U,const SubArray & si,const SubArray & sj) :KN_(U,SubArray(U.ij(si.len1(),sj.len1())+1,U.ij(si.start,sj.start))), shapei(U.shapei,si),shapej(U.shapej,sj){} KNM_(KNM_ U,const SubArray & sa,const SubArray & si,const SubArray & sj) :KN_(U,SubArray(sa)),shapei(U.shapei,si),shapej(U.shapej,sj){} KNM_(const KNM_ & u) :KN_(u),shapei(u.shapei),shapej(u.shapej) {} KNM_ operator()(const SubArray & sa,const SubArray & sb) const { return KNM_(*this,sa,sb);} // sub array long ij(long i,long j) const { return shapei.index(i)+shapej.index(j);} long indexij(long i,long j) const { return this->index(shapei.index(i)+shapej.index(j));} R & operator()(long i,long j) const { return this->v[indexij(i,j)];} R & operator()(int i,int j) const { return this->v[indexij(i,j)];} KN_ operator()(const SubArray & sa,long j) const { return this->operator()(':',j)(sa);} // sub array KN_ operator()(long i,const SubArray & sb) const { return this->operator()(i,':')(sb);} KN_ operator()(const char,long j ) const // une colonne j ('.',j) { return KN_(&this->v[this->index(shapej.index(j))],shapei*this->step);} KN_ operator()(long i ,const char) const // une ligne i (i,'.') { return KN_(&this->v[this->index(shapei.index(i))],shapej*this->step);} KN_ operator()(const char,int j ) const // une colonne j ('.',j) { return KN_(&this->v[this->index(shapej.index(j))],shapei*this->step);} KN_ operator()(int i ,const char) const // une ligne i (i,'.') { return KN_(&this->v[this->index(shapei.index(i))],shapej*this->step);} KN_ operator()(const char,const char) const // tous { return *this;} KNM_ t() const { return KNM_(this->v,*this,shapej,shapei);} // before { return KNM_(*this,shapej,shapei,v);} KNM_& operator =(const KNM_ & u) ; KNM_& operator =(const_R a) ; KNM_& operator+=(const_R a) ; KNM_& operator-=(const_R a) ; KNM_& operator/=(const_R a) ; KNM_& operator*=(const_R a) ; KNM_& operator+=(const KNM_ & u) ; KNM_& operator-=(const KNM_ & u) ; KNM_& operator*=(const KNM_ & u) ; KNM_& operator/=(const KNM_ & u) ; KNM_ &operator =(const outProduct_KN_ &); KNM_ &operator +=(const outProduct_KN_ &); KNM_ &operator -=(const outProduct_KN_ &); KNM_ &operator /=(const outProduct_KN_ &); // bofbof KNM_ &operator *=(const outProduct_KN_ &); // bofbof KNM_ &operator =(const ConjKNM_ &); KNM_ &operator +=(const ConjKNM_ &); KNM_ &operator -=(const ConjKNM_ &); KNM_ &operator /=(const ConjKNM_ &); // bofbof KNM_ &operator *=(const ConjKNM_ &); // bofbof private: KNM_& operator++() {this->v += this->next;return *this;} // ++U KNM_& operator--() {this->v -= this->next;return *this;} // ++U KNM_ operator++(int ){KNM_ old=*this;this->v = this->v +this->next;return old;} // U++ KNM_ operator--(int ){KNM_ old=*this;this->v = this->v -this->next;return old;} // U-- friend class KN_; // friend class KNM_; friend class KNMK_; friend class KN; friend class KNM; friend class KNMK; }; template struct KN_ITAB { KN_ITAB(const T &vv,const I &iindex) : v(vv),index(iindex) {} T v; I index; KN_ITAB & operator=(const T & t); KN_ITAB & operator+=(const T & t); KN_ITAB & operator-=(const T & t); KN_ITAB & operator*=(const T & t); KN_ITAB & operator/=(const T & t); typename T::R & operator[](long i){ return v[index[i]];} const typename T::R & operator[](long i) const { return v[index[i]];} long N() const { return index.N();} }; template KN_ITAB,const KN_ > KN_::operator()(const KN_ &itab) const { return KN_ITAB,const KN_ > (*this,itab);} template KN_ITAB,const KN_ > KN_::operator()(const KN_ &itab) const { return KN_ITAB,const KN_ > (*this,itab);} template KN_ITAB< KN_,const KN_ > KN_::operator()(const KN_ &itab) { return KN_ITAB,const KN_ > (*this,itab);} template KN_ITAB< KN_,const KN_ > KN_::operator()(const KN_ &itab) { return KN_ITAB,const KN_ > (*this,itab);} template struct TKN_:public KN_ { TKN_(const KN_ &x) : KN_(x) {} }; template struct ConjKNM_:public KNM_ { ConjKNM_(const KNM_ &x) : KNM_(x) {} }; template struct notKN_:public KN_ { notKN_(const KN_ &x) : KN_(x) {} notnotKN_ operator!() ; // not const notnotKN_ operator!() const ; // not }; template struct notnotKN_:public KN_ { notnotKN_(const notKN_ &x) : KN_(x) {} notKN_ operator!() ; // notnot const notKN_ operator!() const ; // notnot }; template TKN_ KN_::t() { return *this;} // transpose template ConjKNM_ KNM_::h() { return *this;} // conj of the matrix template const TKN_ KN_::t() const { return *this;} // transpose template const ConjKNM_ KNM_::h() const { return *this;} // conj of the matrix template notKN_ KN_::operator!() { return *this;} // not template const notKN_ KN_::operator!() const { return *this;} // not template notnotKN_ notKN_::operator!() { return *this;} // not template const notnotKN_ notKN_::operator!() const { return *this;} // not template struct outProduct_KN_ { const KN_ a,b; R c; long N() const {return a.N(); } long M() const {return b.N(); } outProduct_KN_(const KN_ & aa, const KN_ &bb,R cc=(R)1) : a(aa),b(bb),c(cc) {} outProduct_KN_(const KN_ * aa, const KN_ &bb,R cc=(R)1) : a(*aa),b(bb),c(cc) {} outProduct_KN_(const KN_ * aa, const KN_ *bb,R cc=(R)1) : a(*aa),b(*bb),c(cc) {} outProduct_KN_(const Mulc_KN_ & aa,const KN_ & bb) : a(aa.a),b(bb),c(aa.b) {} outProduct_KN_ operator * (R cc) { return outProduct_KN_(a,b,c*cc);} }; template struct if_KN_ { const KN_ & a,&b; R c; if_KN_(const KN_ & aa, const KN_ &bb,R cc=1.) : a(aa),b(bb),c(cc) {} if_KN_ operator * (R cc) { return if_KN_(a,b,c*cc);} }; template struct ifnot_KN_ { const KN_ & a,&b; R c; ifnot_KN_(const KN_ & aa, const KN_ &bb,R cc=1.) : a(aa),b(bb),c(cc) {} ifnot_KN_ operator * (R cc) { return ifnot_KN_(a,b,c*cc);} }; template outProduct_KN_ operator*(const KN_ &a,const TKN_ &b) { return outProduct_KN_(a,b);} template ifnot_KN_ operator*(const KN_ &a,const notKN_ &b) { return ifnot_KN_(b,a);} template ifnot_KN_ operator*(const KN_ &a,const notnotKN_ &b) { return if_KN_(b,a);} template ifnot_KN_ operator*(const notKN_ &b,const KN_ &a) { return ifnot_KN_(b,a);} template ifnot_KN_ operator*(const notnotKN_ &b,const KN_ & a) { return if_KN_(b,a);} template R operator*(const TKN_ &a,const KN_ &b) { return (a,b);} template class KNMK_: public KN_ { friend class KNMK; public: ShapeOfArray shapei; ShapeOfArray shapej; ShapeOfArray shapek; public: long IsVector1() const { return (shapei.n*shapej.n*shapek.n) == this->n ;} long N() const {return shapei.n;} long M() const {return shapej.n;} long K() const {return shapek.n;} long size() const { return shapei.n*shapej.n*shapek.n;} KNMK_(const ShapeOfArray & s, const ShapeOfArray & si, const ShapeOfArray & sj, const ShapeOfArray & sk, R * u) : KN_(u,s),shapei(si),shapej(sj),shapek(sk){} KNMK_(R* u,long n,long m,long k) : KN_(u, ShapeOfArray(n*m*k)),shapei(n,1,n),shapej(m,n,1),shapek(k,n*m,n*m){}; // KNMK_(const KN_ & u,long n,long m,long k) // : KN_(ShapeOfArray(n*m*k)),shapei(n,1,n),shapekj(m,n,1),u), // shapek(k,n*m,n*m){}; KNMK_(const KNMK_ &U,const SubArray & si,const SubArray & sj,const SubArray & sk) : KN_(U,SubArray(U.ijk(si.len1(),sj.len1(),sk.len1())+1, U.ijk(si.start,sj.start,sk.start))), shapei(U.shapei,si), shapej(U.shapej,sj), shapek(U.shapek,sk){} KNMK_(const KNMK_ & u) :KN_(u),shapei(u.shapei),shapej(u.shapej),shapek(u.shapek) {} long ijk(long i,long j,long k) const { return shapei.index(i)+shapej.index(j)+shapek.index(k);} long indexijk(long i,long j,long k) const {return this->index(shapei.index(i)+shapej.index(j)+shapek.index(k));} R & operator()(long i,long j,long k) const {return this->v[indexijk(i,j,k)];} R & operator()(int i,int j,int k) const {return this->v[indexijk(i,j,k)];} // pas de tableau suivant KN_ operator()(const char ,long j,long k) const { // le tableau (.,j,k) return KN_(*this,-1,shapei,shapej[j]+shapek[k]);} KN_ operator()(long i,const char ,long k) const { // le tableau (i,.,k) return KN_(*this,-1,shapej,shapei[i]+shapek[k]);} KN_ operator()(long i,long j,const char ) const { // le tableau (i,j,.) return KN_(*this,-1,shapek,shapei[i]+shapej[j]);} KN_ operator()(const char ,int j,int k) const { // le tableau (.,j,k) return KN_(*this,-1,shapei,shapej[j]+shapek[k]);} KN_ operator()(int i,const char ,int k) const { // le tableau (i,.,k) return KN_(*this,-1,shapej,shapei[i]+shapek[k]);} KN_ operator()(int i,int j,const char ) const { // le tableau (i,j,.) return KN_(*this,-1,shapek,shapei[i]+shapej[j]);} // KNM_ operator()(const char ,const char ,long k) const { // le tableau (.,.,k) return KNM_(*this,shapei,shapej,shapek[k],shapek.next);} // step = n*m //attention les suivants ne marche pas KNM_ operator()(const char ,long j,const char ) const { // le tableau (.,j,.) return KNM_(*this,shapei,shapek,shapej[j],-1/*shapej.next*/);} // step = n KNM_ operator()(long i,const char ,const char ) const { // le tableau (i,.,.) return KNM_(*this,shapej,shapek,shapei[i],-1/*shapei.next*/);} // step = 1 KNM_ operator()(const char ,const char ,int k) const { // le tableau (.,.,k) return KNM_(*this,shapei,shapej,shapek[k],shapek.next);} // step = n*m //attention les suivants ne marche pas KNM_ operator()(const char ,int j,const char ) const { // le tableau (.,j,.) return KNM_(*this,shapei,shapek,shapej[j],-1/*shapej.next*/);} // step = n KNM_ operator()(int i,const char ,const char ) const { // le tableau (i,.,.) return KNM_(*this,shapej,shapek,shapei[i],-1/*shapei.next*/);} // step = 1 KNMK_& operator =(const KNMK_ & u) ; KNMK_& operator+=(const KNMK_ & u) ; KNMK_& operator-=(const KNMK_ & u) ; KNMK_& operator/=(const KNMK_ & u) ; KNMK_& operator*=(const KNMK_ & u) ; KNMK_& operator =(const_R a) ; KNMK_& operator+=(const_R a) ; KNMK_& operator-=(const_R a) ; KNMK_& operator/=(const_R a) ; KNMK_& operator*=(const_R a) ; KNMK_ operator()(SubArray si,SubArray sj,SubArray sk) const {return KNMK_(*this,si,sj,sk);} private: // KNMK_& operator++(){v += next;return *this;} // ++U // KNMK_& operator--(){v -= next;return *this;} // --U // KNMK_ operator++(long ){KNMK_ old=*this;v = v +next;return old;} // U++ // KNMK_ operator--(long ){KNMK_ old=*this;v = v -next;return old;} // U-- friend class KNM_; friend class KN_; }; template class KN :public KN_ { public: typedef R K; // explicit KN(const R & u):KN_(new R(uu),1,0) {} KN() : KN_(0,0) {} KN(long nn) : KN_(new R[nn],nn) {} KN(long nn, R * p) : KN_(new R[nn],nn) { KN_::operator=(KN_(p,nn));} KN(long nn,R (*f)(long i) ) : KN_(new R[nn],nn) {for(long i=0;in;i++) this->v[i]=f(i);} KN(long nn,const R & a) : KN_(new R[nn],nn) { KN_::operator=(a);} KN(long nn,long s,const R a) : KN_(new R[nn],nn,s) { KN_::operator=(a);} template KN(const KN_ & s):KN_(new R[s.n],s.n) {for (long i=0;in;i++) this->v[i] = s[i];} template KN(const KN_ & s,R (*f)(S )):KN_(new R[s.n],s.n) {for (long i=0;in;i++) this->v[i] = f(s[i]);} KN(const KN & u):KN_(new R[u.n],u.n) { KN_::operator=(u);} KN(bool ,KN & u):KN_(u) {u.v=0;u.n=0;}// remove copy for return of local KN. // explicit KN(const KN_ & u):KN_(new R[u.n],u.n) // { KN_::operator=(u);} ~KN(){delete [] this->v;} void CheckSet() { if(!(this->n)) {cerr << "Error RNM set array\n";K_throwassert(0); exit(1);}} KN& operator = (R* a) { CheckSet(); return operator =(KN_(a,this->n));} KN& operator += (R* a) { CheckSet(); return operator+=(KN_(a,this->n));} KN& operator -= (R* a) { CheckSet(); return operator-=(KN_(a,this->n));} KN& operator *= (R* a) { CheckSet(); return operator*=(KN_(a,this->n));} KN& operator /= (R* a) { CheckSet(); return operator/=(KN_(a,this->n));} KN& operator =(const SetArray & u) { if(this->unset()) this->set(new R[u.size()],u.size(),0,0); KN_::operator= (u);return *this;} KN& operator +=(const SetArray & u) { if(this->unset()) this->set(new R[u.size()],u.size(),0,0); KN_::operator+= (u);return *this;} KN& operator -=(const SetArray & u) { if(this->unset()) this->set(new R[u.size()],u.size(),0,0); KN_::operator-= (u);return *this;} KN& operator *=(const SetArray & u) { if(this->unset()) this->set(new R[u.size()],u.size(),0,0); KN_::operator*= (u);return *this;} KN& operator /=(const SetArray & u) { if(this->unset()) this->set(new R[u.size()],u.size(),0,0); KN_::operator/= (u);return *this;} KN& operator =(const_R a) { if(this->unset()) this->set(new R[1],1,0,0); KN_::operator= (a);return *this;} KN& operator =(const KN_& a) { if(this->unset()) this->set(new R[a.N()],a.N()); KN_::operator= (a);return *this;} KN& operator =(const KN& a) { if(this->unset()) this->set(new R[a.N()],a.N()); KN_::operator= (a);return *this;} KN& operator =(const Add_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const DotStar_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const if_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const ifnot_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const DotSlash_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const Sub_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const Mulc_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const Divc_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const Add_Mulc_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const if_arth_KN_ & u) { if(this->unset()) this->set(new R[u.a.N()],u.a.N());KN_::operator=(u);return *this;} KN& operator =(const Mul_KNM_KN_ & u) { if(this->unset()) this->set(new R[u.A.N()],u.A.N());KN_::operator=(u);return *this;} KN& operator =(const Mul_KNMh_KN_ & u) { if(this->unset()) this->set(new R[u.A.M()],u.A.M());KN_::operator=(u);return *this;} // KN& operator =(const MatriceCreuseMulKN_ & Ax) // {if(this->unset()) set(new R[Ax.v.N()],Ax.v.N()); KN_::operator=(Ax);return *this;} // KN& operator +=(const MatriceCreuseMulKN_ & Ax) // {if(this->unset()) set(new R[Ax.v.N()],Ax.v.N()); KN_::operator+=(Ax);return *this;} // KN& operator =(const MatriceCreuseDivKN_ & A1x) // { if(this->unset()) set(new R[A1x.v.N()],A1x.v.N());KN_::operator=(A1x);return *this;} // correcton aout 2007 FH add N,M flied in VirtualMatrice KN& operator =(const typename VirtualMatrice::plusAx & Ax) { if(this->unset() && Ax.A && Ax.A->N ) this->set(new R[Ax.A->N],Ax.A->N); if(Ax.A) KN_::operator=(Ax);return *this;} KN& operator =(const typename VirtualMatrice::solveAxeqb & Ab) { if(this->unset()) this->set(new R[Ab.b.N()],Ab.b.N());KN_::operator=(Ab);return *this;} KN& operator +=(const typename VirtualMatrice::plusAx & Ax) { if(this->unset() && Ax.A->N) { this->set(new R[Ax.A->N],Ax.A->N); KN_::operator=(R());} KN_::operator+=(Ax); return *this;} KN& operator =(const typename VirtualMatrice::plusAtx & Ax) { if(this->unset()&&Ax.A->M) this->set(new R[Ax.A->M],Ax.A->M);KN_::operator=(Ax);return *this;} KN& operator +=(const typename VirtualMatrice::plusAtx & Ax) { if(this->unset()&&Ax.A->M) { this->set(new R[Ax.A->M],Ax.A->M); KN_::operator=(R());} KN_::operator+=(Ax); return *this;} // end correcton FH template KN& operator =(const PplusQ & PQ) { *this=PQ.p; *this+=PQ.q;return *this; } template KN& operator +=(const PplusQ & PQ) { *this+=PQ.p; *this+=PQ.q;return *this; } KN& operator -=(const_R a) { KN_::operator-=(a);return *this;} KN& operator -=(const KN_& a) { KN_::operator-= (a);return *this;} KN& operator -=(const Add_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const DotStar_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const DotSlash_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const Sub_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const Mulc_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const Divc_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const Add_Mulc_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const if_arth_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator -=(const Mul_KNM_KN_ & u) { KN_::operator-=(u);return *this;} KN& operator +=(const_R a) { KN_::operator += (a);return *this;} KN& operator += (const KN_& a) { KN_::operator+= (a);return *this;} KN& operator +=(const Add_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const DotStar_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const DotSlash_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const Sub_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const Mulc_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const Divc_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const Add_Mulc_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const if_arth_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator +=(const Mul_KNM_KN_ & u) { KN_::operator+=(u);return *this;} KN& operator/=(const_R a) { KN_::operator/=(a);return *this;} KN& operator /= (const KN_& a) { KN_::operator/= (a);return *this;} KN& operator /=(const Add_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const Sub_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const Mulc_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const Divc_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const Add_Mulc_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const if_arth_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator /=(const Mul_KNM_KN_ & u) { KN_::operator/=(u);return *this;} KN& operator*=(const_R a) { KN_::operator*=(a);return *this;} KN& operator*=(const KN_& a) { KN_::operator*= (a);return *this;} KN& operator *=(const Add_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const Sub_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const Mulc_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const Divc_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const Add_Mulc_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const if_arth_KN_ & u) { KN_::operator*=(u);return *this;} KN& operator *=(const Mul_KNM_KN_ & u) { KN_::operator*=(u);return *this;} template KN& operator = (const KN_ITAB & ui) { KN_::operator =(ui); return *this;} template KN& operator += (const KN_ITAB & ui) { KN_::operator +=(ui); return *this;} template KN& operator -= (const KN_ITAB & ui) { KN_::operator -=(ui); return *this;} template KN& operator *= (const KN_ITAB & ui) { KN_::operator *=(ui); return *this;} template KN& operator /= (const KN_ITAB & ui) { KN_::operator /=(ui); return *this;} // two opertor to cast to an array of constant // operator KN_ & () // { return * (KN_*) this;} // operator KN_ const & () const // { return *(const KN_*) this;} // operator KN & () // { return (KN &) *this;} // operator KN const & () const // { return (const KN& ) *this;} static void fill0(R *v,int n) { if(n && v) for(int i=0;in=nn;this->step=1;this->next=-1;this->v=new R[nn];fill0(this->v,this->n) ;} void init() {this->n=0;this->step=1;this->next=-1;this->v=0;} void init(const KN_ & a){init(a.N()); operator=(a);} void resize(long nn) { if ( nn != this->n) { R *vo=this->v; long no=std::min(this->n,nn), so=this->step; ShapeOfArray::init(nn); this->v=new R[this->n]; // copy if(this->v && vo) for(long i=0,j=0;jv[i]=vo[j]; delete [] vo;} }// mars 2010 void destroy(){/*assert(this->next<0);*/ if(this->next++ ==-1) {delete [] this->v; this->v=0;this->n=0;}}// mars 2010 void increment() {/*assert(this->next<0);*/ this->next--;} }; // Array with 2 indices // --------------------- template class KNM: public KNM_{ public: KNM() :KNM_(0,0,0){} KNM(long nn,long mm) :KNM_(new R[nn*mm],nn,mm){} KNM(const KNM & u) // PB si stepi ou stepj nulle :KNM_(new R[u.size()],u.N(),u.M()) { KN_::operator=(u);} explicit KNM(const KNM_ & u) :KNM_(new R[u.size()],u.N(),u.M()) { KNM_::operator=(u);} ~KNM(){delete [] this->v;} KNM& operator=(const KNM_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator=(u);return *this;} KNM& operator=(const_R a) { if(this->unset()) RNM_FATAL_ERROR(" KNM operator=(double)"); KNM_::operator=(a);return *this;} KNM& operator+=(const_R a) { if(this->unset()) RNM_FATAL_ERROR(" KNM operator+=(double)"); KNM_::operator+=(a);return *this;} KNM& operator-=(const_R a) {if(this->unset()) RNM_FATAL_ERROR(" KNM operator-=(double)"); KNM_::operator-=(a);return *this;} KNM& operator/=(const_R a) {if(this->unset()) RNM_FATAL_ERROR(" KNM operator/=(double)"); KNM_::operator/=(a);return *this;} KNM& operator*=(const_R a) {if(this->unset()) RNM_FATAL_ERROR(" KNM operator*=(double)"); KNM_::operator*=(a);return *this;} KNM& operator+=(const KNM_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator+=(u);return *this;} KNM& operator-=(const KNM_ & u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator-=(u);return *this;} KNM& operator/=(const KNM_ & u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator/=(u);return *this;} KNM& operator*=(const KNM_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator*=(u);return *this;} KNM &operator =(const outProduct_KN_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator =(u);return *this;} KNM &operator +=(const outProduct_KN_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator+=(u);return *this;} KNM &operator -=(const outProduct_KN_ & u) { if(this->unset()) this->init(u.N(),u.M()) ; KNM_::operator-=(u);return *this;} KNM &operator /=(const outProduct_KN_ & u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator/=(u);return *this;} KNM &operator *=(const outProduct_KN_ & u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator*=(u);return *this;} KNM &operator =(const ConjKNM_ &u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator=(u);return *this;} KNM &operator +=(const ConjKNM_ &u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator+=(u);return *this;} KNM &operator -=(const ConjKNM_ &u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator-=(u);return *this;} KNM &operator /=(const ConjKNM_ &u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator/=(u);return *this;} KNM &operator *=(const ConjKNM_ &u) { if(this->unset()) this->init(u.N(),u.M()) ;KNM_::operator*=(u);return *this;} // bofbof // two opertors to cast to un array of constant // operator KNM_ & () // { return * (KNM_*) this;} // operator KNM_ const & () const // { return *(const KNM_*) this;} // operator KNM & () // { return * (KNM*) this;} // operator KNM const & () const // { return *(const KNM*) this;} void init() { // add mars 2010 ... this->n=0;this->step=1;this->next=-1;this->v=0; this->shapei.init(0); this->shapej.init(0);} void init(long nn,long mm) { ShapeOfArray::init(nn*mm); this->shapei.init(nn,1,nn); this->shapej.init(mm,nn,1), this->v=new R[nn*mm];} void resize(long nn,long mm) { long kk=nn*mm; long lso = this->size(); long n = this->shapei.n; long m = this->shapej.n; if( (n !=nn) || ( m != mm)) // correct FH Jav 2012 .. { KNM_ old(*this); long no=std::min(n,nn); long mo=std::min(m,mm); R *vo=this->v; // new mat ShapeOfArray::init(kk); this->v=new R[this->n]; this->shapei.init(nn,1,nn); this->shapej.init(mm,nn,1); if(this->v && vo) // copy (*this)(SubArray(no),SubArray(mo)) = old(SubArray(no),SubArray(mo)); delete []vo; } } void destroy(){/*assert((bool)(this->next<0)); */ if(this->next++ ==-1) {delete [] this->v; this->v=0;this->n=0;}} void increment() {/*assert((bool)(this->next<0)); */ this->next--;} // void destroy(){delete [] this->v;this->n=0 ;} }; // Array with 3 indices // --------------------- template class KNMK: public KNMK_{ public: KNMK(long n,long m,long k) :KNMK_(new R[n*m*k],n,m,k){} explicit KNMK(const KNMK_ & u) :KNMK_(new R[u.size()],u.N(),u.M(),u.K()) { KNMK_::operator=(u);} KNMK(const KNMK & u) :KNMK_(new R[u.size()],u.N(),u.M(),u.K()) { KNMK_::operator=(u);} ~KNMK(){delete [] this->v;} KNMK& operator=(const KNMK_ & u) { KNMK_::operator=(u);return *this;} KNMK& operator=(const_R a) { KNMK_::operator=(a);return *this;} KNMK& operator+=(const_R a) { KNMK_::operator+=(a);return *this;} KNMK& operator-=(const_R a) { KNMK_::operator-=(a);return *this;} KNMK& operator/=(const_R a) { KNMK_::operator/=(a);return *this;} KNMK& operator*=(const_R a) { KNMK_::operator*=(a);return *this;} KNMK& operator+=(const KNMK_ & u) { KNMK_::operator+=(u);return *this;} // ici jd KNMK& operator-=(const KNMK_ & u) { KNMK_::operator-=(u);return *this;} KNMK& operator*=(const KNMK_ & u) { KNMK_::operator*=(u);return *this;} KNMK& operator/=(const KNMK_ & u) { KNMK_::operator/=(u);return *this;} // two opertor to cast to un array of constant // operator KNMK_ & () // { return * (KNMK_*) this;} // operator KNMK_ const & () const // { return *(const KNMK_*) this;} // operator KNMK & () // { return * (KNMK*) this;} // operator KNMK const & () const // { return *(const KNMK*) this;} }; // ------------- optimization --------------------- template class conj_KN_{public: const KN_ & a; conj_KN_(const KN_ & aa) : a(aa){} }; inline const KN_ conj(const KN_ &a){ return a;} inline const KN_ conj(const KN_ &a){ return a;} inline const KN_ conj(const KN_ &a){ return a;} //template conj_KN_ conj(const KN &a){ return a;} template conj_KN_ conj(const KN_ &a){ return a;} template class DotStar_KN_{public: const KN_ a; const KN_ b; DotStar_KN_(const KN_ & aa,const KN_ & bb) : a(aa),b(bb) {} }; template class DotSlash_KN_{public: const KN_ a; const KN_ b; DotSlash_KN_(const KN_ & aa,const KN_ & bb) : a(aa),b(bb) {} }; template class Add_KN_{public: const KN_ a; const KN_ b; Add_KN_(const KN_ & aa,const KN_ & bb) : a(aa),b(bb) { K_throwassert(SameShape(a,b));} }; template class Sub_KN_{public: const KN_ a; const KN_ b; Sub_KN_(const KN_ & aa,const KN_ & bb) : a(aa),b(bb) { K_throwassert(SameShape(a,b));} }; template class Mulc_KN_ { public: const KN_ a; const_R b; Mulc_KN_(const KN_ & aa,const_R bb) : a(aa),b(bb) {} Mulc_KN_(const Mulc_KN_ & aa,const_R bb) : a(aa.a),b(aa.b*bb) {} Mulc_KN_ operator-() const {return Mulc_KN_(a,-b);} outProduct_KN_ operator*(const TKN_ & bb) { return outProduct_KN_(a,bb,b);} }; template class Divc_KN_ { // // vector b/a_i .. public: const KN_ a; const_R b; Divc_KN_(const_R bb,const KN_ & aa) : a(aa),b(bb) {} // Divc_KN_(const Divc_KN_ & aa,const_R bb) : a(aa.a),b(aa.b*bb) {} Divc_KN_ operator-() const {return Divc_KN_(a,-b);} }; template class Add_Mulc_KN_ { public: const KN_ a,b; const R ca,cb; Add_Mulc_KN_(const Mulc_KN_ & aa,const Mulc_KN_ & bb) : a(aa.a),b(bb.a),ca(aa.b),cb(bb.b) { K_throwassert(SameShape(a,b));} Add_Mulc_KN_(const Mulc_KN_ & aa,const KN_ & bb,const R cbb) : a(aa.a),b(bb),ca(aa.b),cb(cbb) { K_throwassert(SameShape(a,b));} Add_Mulc_KN_(const KN_ & aa,const R caa,const KN_ & bb,const R cbb) : a(aa),b(bb),ca(caa),cb(cbb) { K_throwassert(SameShape(a,b));} }; template class if_arth_KN_ { public: const KN_ a,b,c; if_arth_KN_(const KN_ & aa,const KN_ & bb,const KN_ & cc) : a(aa),b(bb),c(cc){ K_throwassert(SameShape(a,b)&&SameShape(a,c));} }; template class Mul_KNM_KN_ { public: const KNM_ &A; const KN_ &b; Mul_KNM_KN_(const KNM_ &aa,const KN_ &bb) : A(aa),b(bb) {K_throwassert(SameShape(A.shapej,b));} }; template class Mul_KNMh_KN_ { public: const KNM_ &A; const KN_ &b; Mul_KNMh_KN_(const KNM_ &aa,const KN_ &bb) : A(aa),b(bb) {K_throwassert(SameShape(A.shapej,b));} Mul_KNMh_KN_(const KNM &aa,const KN_ &bb) : A(aa),b(bb) {K_throwassert(SameShape(A.shapej,b));} }; ostream & operator<<(ostream & f,const ShapeOfArray & s); template ostream & operator<<(ostream & f,const KN_ & v); template ostream & operator<<(ostream & f,const KNM_ & v); template ostream & operator<<(ostream & f,const KNMK_ & v); template inline ostream & operator<<(ostream & f,const KN & v) { return f << (const KN_ &) v;} template inline ostream & operator<<(ostream & f,const KNM & v) { return f << (const KNM_ &) v;} template inline ostream & operator<<(ostream & f,const KNMK & v) { return f << (const KNMK_ &) v;} template inline Add_KN_ operator+(const KN_ &a,const KN_ &b) { return Add_KN_(a,b);} template inline Sub_KN_ operator-(const KN_ &a,const KN_ &b) { return Sub_KN_(a,b);} template inline Mulc_KN_ operator*(const KN_ &a,const R &b) { return Mulc_KN_(a,b);} template inline Mulc_KN_ operator/(const KN_ &a,const R &b) { return Mulc_KN_(a,R(1)/b);} template inline Mulc_KN_ operator*(const R &b,const KN_ &a) { return Mulc_KN_(a,b);} template inline Divc_KN_ operator/(const R &b,const KN_ &a) { return Divc_KN_(b,a);} template inline Mulc_KN_ operator-(const KN_ &a) { return Mulc_KN_(a,R(-1));} template inline Add_Mulc_KN_ operator+(const Mulc_KN_& a,const Mulc_KN_ &b) { return Add_Mulc_KN_(a,b);} template inline Add_Mulc_KN_ operator-(const Mulc_KN_& a,const Mulc_KN_ &b) { return Add_Mulc_KN_(a,b.a,-b.b);} template inline Add_Mulc_KN_ operator+(const Mulc_KN_& a,const KN_ &b) { return Add_Mulc_KN_(a,b,R(1));} template inline Add_Mulc_KN_ operator-(const Mulc_KN_& a,const KN_ &b) { return Add_Mulc_KN_(a,b,R(-1));} template inline Add_Mulc_KN_ operator+(const KN_ & b,const Mulc_KN_& a) { return Add_Mulc_KN_(a,b,R(1));} // modif FH mars 2007 template inline Add_Mulc_KN_ operator-(const KN_ & a,const Mulc_KN_& b) { return Add_Mulc_KN_(a,R(1),b.a,-b.b);}// modif FH mars 2007 template inline Mul_KNM_KN_ operator*(const KNM_ & A,const KN_ & b) { return Mul_KNM_KN_(A,b);} template inline bool SameShape(const ShapeOfArray & a,const Add_Mulc_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const if_arth_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const Add_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const Sub_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const Mulc_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const Divc_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const DotStar_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const DotSlash_KN_ & b) { return SameShape(a,b.a) ;} template inline bool SameShape(const ShapeOfArray & a,const Mul_KNM_KN_ & b) { return a.n==b.A.N() ;} inline bool SameShape(const ShapeOfArray & ,const VirtualMatrice::plusAx & ) { return true ;} // pas de test car la matrice peut etre rectangulaire inline bool SameShape(const ShapeOfArray & ,const VirtualMatrice::plusAtx & ) { return true ;} // pas de test car la matrice peut etre rectangulaire inline bool SameShape(const ShapeOfArray & ,const VirtualMatrice >::plusAx & ) { return true ;} // pas de test car la matrice peut etre rectangulaire inline bool SameShape(const ShapeOfArray & ,const VirtualMatrice >::plusAtx & ) { return true ;} // pas de test car la matrice peut etre rectangulaire inline bool SameShape(const ShapeOfArray & ,const double) { return true;} inline bool SameShape(const ShapeOfArray & ,const complex) { return true;} inline bool SameShape(const ShapeOfArray & ,const complex) { return true;} template inline bool SameShape(KNM& m, const outProduct_KN_& p) { return p.a.N()>=m.N() && m.M()>=p.b.N(); } template inline long SameAdress(const KN_ &a, const KN_ &b) { return &a[0]==&b[0];} // bof -bof //template inline // KN_::operator KN &() { return *(KN *) (void *) this;} //template inline // KN_::operator const KN &() const { return *(const KN *) ( const void *) this;} // operateur y=Ax-b ou y=Ax + b pour le GC template PplusQ< typename VirtualMatrice::plusAx, Mulc_KN_ > operator-(const typename VirtualMatrice::plusAx & A,const KN_ & B) { return PplusQ< typename VirtualMatrice::plusAx, Mulc_KN_ >(A,Mulc_KN_(B,R(-1.)));} template PplusQ< typename VirtualMatrice::plusAx, KN_ > operator+(const typename VirtualMatrice::plusAx & A,const KN_ & B) { return PplusQ< typename VirtualMatrice::plusAx, KN_ >(A,B);} template PplusQ< typename VirtualMatrice::plusAx, Mulc_KN_ > operator-(const typename VirtualMatrice::plusAx & A,const KN & B) { return PplusQ< typename VirtualMatrice::plusAx, Mulc_KN_ >(A,Mulc_KN_(B,R(-1.)));} template PplusQ< typename VirtualMatrice::plusAx, KN_ > operator+(const typename VirtualMatrice::plusAx & A,const KN & B) { return PplusQ< typename VirtualMatrice::plusAx, KN_ >(A,B);} template KN_ diagonal(const KNM & A) { K_throwassert(A.N() == A.M()); return KN_(A,SubArray(A.N(),0,A.N()+1));} // to def inv permutation FH mars 2006 class Inv_KN_long{ public: KN_ t; Inv_KN_long(const KN_ & v) : t(v) {} Inv_KN_long( KN_ const * & v) : t(*v) {} operator const KN_ & () const {return t;} }; // For sparce solve to set array to be consecutif (step==1) if neccessarly template class KN_2Ptr { public: // transfo de KN_ peut etre non concecutif (a.step != 1) en // un tableau concecutif en memoire si necessaire // avec recopie du tableau dans le tableau d'origne a la destruction. KN_ a; const KN_ ca; KN c; // tableau copie si non vide KN_2Ptr(KN_ & vv) : a(vv),ca(vv),c() { assert(a.N()); if (ca.step !=1 ) c=ca;} // copy if non consecutif KN_2Ptr(const KN_ & vv) : a(0,0),ca(vv),c() { assert(ca.N()); if (ca.step !=1 ) c=ca; }// copy if non consecutif operator R *() { return c.unset() ? (R *) ca:(R *) c ;} operator const R *() const { return c.unset() ? (R *) ca:(R *) c ;} ~KN_2Ptr() { if(!a.unset() && !c.unset() ) {a=c; } } // recopy }; // correct march 2015 FH ... // add BB type ... template class F_KN_ { public: A (*f)(BB); KN_ b; long N() const {return b.N();} F_KN_( A (*ff)(BB),const KN_ & aa): f(ff),b(aa) {} A operator[](long i) const { return f(b[i]);} bool check(long n) const { return n <= b.N() || b.constant(); } bool constant() const {return b.constant();} }; template inline bool SameShape(const ShapeOfArray & a,const F_KN_ & b) { return !a.step || b.constant() || a.n == b.N() ;} #include "RNM_tpl.hpp" #ifdef K_throwassert #undef K_throwassert #endif #endif freefem++-3.61-1/src/femlib/R2.hpp000644 000767 000024 00000011376 13256636774 016654 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model of $\mathbb{R}^2$ // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef R2_HPP #define R2_HPP #include #include #include // Definition de la class R2 // sans compilation separe toute les fonctions // sous defini dans ce R2.hpp avec des inline // // definition R (les nombres reals) // remarque la fonction abort est defini dans // #include // The class R2 class R3; class R2 { public: typedef double R; static const int d=2; R x,y; // declaration de membre // les 3 constructeurs --- R2 () :x(0.),y(0.) {} // rappel : x(0), y(0) sont initialiser via le constructeur de double R2 (R a,R b):x(a),y(b) {} R2 (const R * a):x(a[0]),y(a[1]) {} R2 ( R * a):x(a[0]),y(a[1]) {} R2 (const R2 & a,const R2 & b):x(b.x-a.x),y(b.y-a.y) {} static R2 diag(R a){ return R2(a,a);} // le constucteur par defaut est inutile //R2 (const R2 & a) :x(a.x),y(a.y) {} // rappel les operator definis dans une class on un parametre // cache qui est la classe elle meme (*this) // les operateurs affectation // operateur affection (*this) = P est inutil par defaut il fait le travail correctement //R2 & operator=(const R2 & P) {x = P.x;y = P.y;return *this;} // les autre operoteur affectations R2 & operator+=(const R2 & P) {x += P.x;y += P.y;return *this;} R2 & operator-=(const R2 & P) {x -= P.x;y -= P.y;return *this;} R2 & operator*=(R a) {x *= a;y *= a;return *this;} R2 & operator/=(R a) {x /= a;y /= a;return *this;} // operateur binaire + - * , ^ / R2 operator+(const R2 & P)const {return R2(x+P.x,y+P.y);} R2 operator-(const R2 & P)const {return R2(x-P.x,y-P.y);} R operator,(const R2 & P)const {return x*P.x+y*P.y;} // produit scalaire R operator^(const R2 & P)const {return x*P.y-y*P.x;} // produit mixte R2 operator*(R c)const {return R2(x*c,y*c);} R2 operator/(R c)const {return R2(x/c,y/c);} // operateur unaire R2 operator-()const {return R2(-x,-y);} R2 operator+()const {return *this;} // un methode R2 perp() const {return R2(-y,x);} // la perpendiculaire R sum() const { return x+y;} R * toBary(R * b) const { b[0]=1.-x-y;b[1]=x;b[2]=y;return b;} // les operators tableau // version qui peut modifie la class via l'adresse de x ou y R & operator[](int i){ return (&x)[i];} const R & operator[](int i) const { return (&x)[i];} R X() const {return x;} R Y() const {return y;} R Z() const {return 0.;} R norme() const { return std::sqrt(x*x+y*y);} R norme2() const { return (x*x+y*y);} R2 Bary(R2 P[d+1]) const { return (1-x-y)*P[0]+x*P[1]+y*P[2];} // add FH R2 Bary(const R2 *const *const P ) const { return (1-x-y)*(*P[0])+x*(*P[1])+y*(*P[2]);} // add FH R3 Bary(R3 P[d+1]) const ; //{ return (1-x-y)*P[0]+x*P[1]+y*P[2];} // add FH R3 Bary(const R3 *const *const P ) const; // { return (1-x-y)*(*P[0])+x*(*P[1])+y*(*P[2]);} // add FH friend R2 operator*(R c,const R2 & P) {return P*c;} friend R2 perp(const R2 & P) { return R2(-P.y,P.x) ; } //inline R2 Perp(const R2 & P) { return P.perp(); } // autre ecriture de la fonction perp friend R det(const R2 & A,const R2 & B,const R2 &C) { return R2(A,B)^R2(A,C);} friend std::ostream& operator <<(std::ostream& f, const R2 & P ) { f << P.x << ' ' << P.y ; return f; } friend std::istream& operator >>(std::istream& f, R2 & P) { f >> P.x >> P.y ; return f; } static const R2 KHat[d+1]; }; inline R2 Minc(const R2 & A,const R2 &B){ return R2(min(A.x,B.x),min(A.y,B.y));} inline R2 Maxc(const R2 & A,const R2 &B){ return R2(max(A.x,B.x),max(A.y,B.y));} inline double Norme_infty(const R2 & A){return max(std::fabs(A.x),std::fabs(A.y));} inline double Norme2_2(const R2 & A){ return (A,A);} inline double Norme2(const R2 & A){ return sqrt((A,A));} #endif freefem++-3.61-1/src/femlib/gmres.hpp000644 000767 000024 00000011240 13256636774 017474 0ustar00hechtstaff000000 000000 //***************************************************************** // Iterative template routine -- GMRES // // GMRES solves the unsymmetric linear system Ax = b using the // Generalized Minimum Residual method // // GMRES follows the algorithm described on p. 20 of the // SIAM Templates book. // // The return value indicates convergence within max_iter (input) // iterations (0), or no convergence within max_iter iterations (1). // // Upon successful return, output arguments have the following values: // // x -- approximate solution to Ax = b // max_iter -- the number of iterations performed before the // tolerance was reached // tol -- the residual after the final iteration // //***************************************************************** // modif F. hecht to by compatible with RNM.hpp // no dummy vector result // M.solve(xx) => M*(xx) // dot(u,v) => (u,v) // norm(u) => sqrt( (u,u) ) #include template void GeneratePlaneRotation(Real &dx, Real &dy, Real &cs, Real &sn) { if (dy == 0.0) { cs = 1.0; sn = 0.0; } else if (abs(dy) > abs(dx)) { Real temp = dx / dy; sn = 1.0 / sqrt( 1.0 + temp*temp ); cs = temp * sn; } else { Real temp = dy / dx; cs = 1.0 / sqrt( 1.0 + temp*temp ); sn = temp * cs; } } template void ApplyPlaneRotation(Real &dx, Real &dy, Real &cs, Real &sn) { Real temp = cs * dx + sn * dy; dy = -sn * dx + cs * dy; dx = temp; } template < class Matrix, class Vector > void Update(Vector &x, int k, Matrix &h, Vector &s, Vector v[]) { Vector y(s); // Backsolve: for (int i = k; i >= 0; i--) { y(i) /= h(i,i); for (int j = i - 1; j >= 0; j--) y(j) -= h(j,i) * y(i); } for (int j = 0; j <= k; j++) x += v[j] * y(j); } template < class Real > Real abs(Real x) { return (x > 0 ? x : -x); } template < class Operator, class Vector, class Preconditioner, class Matrix, class Real, class CStop > int GMRES(const Operator &A, Vector &x, const Vector &b, const Preconditioner &M, Matrix &H, int &m, int &max_iter, Real &tol,long verbosity, CStop * Stop ) { Real resid; int i, j = 1, k; Vector s(m+1), cs(m+1), sn(m+1), w,r,Ax; r=M*b; Real normb = sqrt((r,r)); Ax=A * x; Ax=b-Ax; r = M*(Ax); Real beta = sqrt((r,r)); if ( abs(normb) < 1.e-30) normb = 1; if ((resid = beta / normb) <= tol) { tol = resid; max_iter = 0; return 0; } Vector *v = new Vector[m+1]; while (j <= max_iter) { v[0] = r / beta; s = 0.0; s(0) = beta; for (i = 0; i < m && j <= max_iter; i++, j++) { w = M*(Ax=A * v[i]); for (k = 0; k <= i; k++) { H(k, i) = (w, v[k]); w -= H(k, i) * v[k]; } H(i+1, i) = sqrt((w,w)); v[i+1] = w / H(i+1, i) ; for (k = 0; k < i; k++) ApplyPlaneRotation(H(k,i), H(k+1,i), cs(k), sn(k)); GeneratePlaneRotation(H(i,i), H(i+1,i), cs(i), sn(i)); ApplyPlaneRotation(H(i,i), H(i+1,i), cs(i), sn(i)); ApplyPlaneRotation(s(i), s(i+1), cs(i), sn(i)); if(verbosity>5 || (verbosity>2 && j%100==0) ) cout << "GMRES: " << j << " " << abs(s(i+1)) << " " << normb << " " << abs(s(i+1)) / normb << " < " << tol << endl; bool stop = Stop && Stop->Stop(i,x,r);// bof ???? if (((resid = abs(s(i+1)) / normb) < tol )|| stop ) { if(verbosity) cout << "GMRES converges: " << j << " " << abs(s(i+1)) << " " << normb << " " << abs(s(i+1)) / normb << " < " << tol << endl; Update(x, i, H, s, v); tol = resid; max_iter = j; delete [] v; return 0; } } Update(x, i - 1, H, s, v);// chanhe FH oct 2010 m -1 -> i -1 (bug max_iter < m) Ax = A*x; Ax = b-Ax; r = M*(Ax); beta = sqrt((r,r)); if(verbosity>4) cout << "GMRES: restart" << j << " " << beta << " " << normb << " " << beta / normb << " < " << tol << endl; if ((resid = beta / normb) < tol) { tol = resid; max_iter = j; delete [] v; return 0; } } if(verbosity) cout << "WARNING: GMRES do not converges: " << j <<"/" << max_iter << ", resid = " << resid << ", tol= " << tol << ", normb "<< normb << endl; tol = resid; delete [] v; return 1; } template < class Operator, class Vector, class Preconditioner, class Matrix, class Real > int GMRES(const Operator &A, Vector &x, const Vector &b, const Preconditioner &M, Matrix &H, int &m, int &max_iter, Real &tol,long verbosity) { return GMRES(A,x,b,M,H,m,max_iter,tol,verbosity,(StopGC *)0); } freefem++-3.61-1/src/femlib/libmesh5.h000644 000767 000024 00000011222 13256636774 017527 0ustar00hechtstaff000000 000000 #ifndef libmesh5_h_ #define libmesh5_h_ /*----------------------------------------------------------*/ /* */ /* LIBMESH V 5.0 */ /* */ /*----------------------------------------------------------*/ /* */ /* Description: handle .meshb file format I/O */ /* Author: Loic MARECHAL */ /* Creation date: feb 16 2007 */ /* Last modification: feb 23 2007 */ /* */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Defines */ /*----------------------------------------------------------*/ #define GmfStrSiz 1024 #define GmfMaxTyp 20 #define GmfMaxKwd 79 #define GmfMshVer 1 #define GmfRead 1 #define GmfWrite 2 #define GmfSca 1 #define GmfVec 2 #define GmfSymMat 3 #define GmfMat 4 #define GmfFloat 1 #define GmfDouble 2 enum GmfKwdCod { GmfReserved1, \ GmfVersionFormatted, \ GmfReserved2, \ GmfDimension, \ GmfVertices, \ GmfEdges, \ GmfTriangles, \ GmfQuadrilaterals, \ GmfTetrahedra, \ GmfPentahedra, \ GmfHexahedra, \ GmfReserved3, \ GmfReserved4, \ GmfCorners, \ GmfRidges, \ GmfRequiredVertices, \ GmfRequiredEdges, \ GmfRequiredTriangles, \ GmfRequiredQuadrilaterals, \ GmfTangentAtEdgeVertices, \ GmfNormalAtVertices, \ GmfNormalAtTriangleVertices, \ GmfNormalAtQuadrilateralVertices, \ GmfAngleOfCornerBound, \ GmfReserved5, \ GmfReserved6, \ GmfReserved7, \ GmfReserved8, \ GmfReserved9, \ GmfReserved10, \ GmfReserved11, \ GmfReserved12, \ GmfReserved13, \ GmfReserved14, \ GmfReserved15, \ GmfReserved16, \ GmfReserved17, \ GmfReserved18, \ GmfReserved19, \ GmfReserved20, \ GmfReserved21, \ GmfReserved22, \ GmfReserved23, \ GmfReserved24, \ GmfReserved25, \ GmfReserved26, \ GmfReserved27, \ GmfReserved28, \ GmfReserved29, \ GmfReserved30, \ GmfBoundingBox, \ GmfReserved31, \ GmfReserved32, \ GmfReserved33, \ GmfEnd, \ GmfReserved34, \ GmfReserved35, \ GmfReserved36, \ GmfReserved37, \ GmfTangents, \ GmfNormals, \ GmfTangentAtVertices, \ GmfSolAtVertices, \ GmfSolAtEdges, \ GmfSolAtTriangles, \ GmfSolAtQuadrilaterals, \ GmfSolAtTetrahedra, \ GmfSolAtPentahedra, \ GmfSolAtHexahedra, \ GmfDSolAtVertices, \ GmfISolAtVertices, \ GmfISolAtEdges, \ GmfISolAtTriangles, \ GmfISolAtQuadrilaterals, \ GmfISolAtTetrahedra, \ GmfISolAtPentahedra, \ GmfISolAtHexahedra, \ GmfIterations, \ GmfTime, \ GmfReserved38 }; /*----------------------------------------------------------*/ /* External procedures */ /*----------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif extern int GmfOpenMesh(const char *, int, ...); extern int GmfCloseMesh(int); extern int GmfStatKwd(int, int, ...); extern int GmfGotoKwd(int, int); extern int GmfSetKwd(int, int, ...); extern int GmfGetLin(int, int, ...); extern int GmfSetLin(int, int, ...); /*----------------------------------------------------------*/ /* Fortran 77 API */ /*----------------------------------------------------------*/ #if defined(F77_NO_UNDER_SCORE) #define call(x) x #else #define call(x) x ## _ #endif int call(gmfopenmeshf77)(char *, int *, int *, int *, int); int call(gmfclosemeshf77)(int *); int call(gmfstatkwdf77)(int *, int *, int *, int *, int *); int call(gmfgotokwdf77)(int *, int *); int call(gmfsetkwdf77)(int *, int *, int *, int *, int *); int call(gmfgetvertex2df77)(int *, float *, float *, int *); int call(gmfgetvertex3df77)(int *, float *, float *, float *, int *); int call(gmfsetvertex2df77)(int *, float *, float *, int *); int call(gmfsetvertex3df77)(int *, float *, float *, float *, int *); int call(gmfgettrianglef77)(int *, int *, int *, int *, int *); int call(gmfsettrianglef77)(int *, int *, int *, int *, int *); int call(gmfgettetrahedronf77)(int *, int *, int *, int *, int *, int *); int call(gmfsettetrahedronf77)(int *, int *, int *, int *, int *, int *); int call(gmfgetedgef77)(int *, int *, int *, int *); int call(gmfsetedgef77)(int *, int *, int *, int *); int call(gmfgetquadrilateralf77)(int *, int *, int *, int *, int *, int *); int call(gmfsetquadrilateralf77)(int *, int *, int *, int *, int *, int *); int call(gmfgethexahedronf77)(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); int call(gmfsethexahedronf77)(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); #ifdef __cplusplus } #endif /*----------------------------------------------------------*/ /* Transmesh private API */ /*----------------------------------------------------------*/ #ifdef TRANSMESH extern char *KwdFmt[ GmfMaxKwd + 1 ][3]; extern int GmfCpyLin(int, int, int); #endif #endif freefem++-3.61-1/src/femlib/ConjuguedGradrientNL.cpp000644 000767 000024 00000006650 13256636774 022400 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: 29 fev 2000 // -*- Mode : c++ -*- // // SUMMARY : array modelisation // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ template R argmin(R rho,const M & dJ,const KN_ &x,KN_ &h,KN_ &g,KN_ &w) { // find ro / (dJ(x+roh),h) =0 // remark input: dJ(x)=g int k=0; R ro0=0, ro=rho,ro1=rho; R p0= (g,h),p,p1; R ap0=Abs(p0)*0.1; // on arret quand on a divise par 10. x += (ro-rold)* h; rold=ro; g =A(x); p= ( p1 = (g,h) ); bool loop=true; while (k++<100 && loop) { // calcul du nouveau ro courant if (p0*p1 <0) { // Ok changement de signe ro = (p0*ro1+p1*ro0)/ (p0+p1); x += (ro-rold)* h; rold=ro; g =A(x); p = (g,h); if ( verbosity >3 ) cout << " ro " << ro << " gh= " << p << "; ro0, gh0 = " << ro0 << " " << p0 << "; ro1, gh1 = " << ro1 << " " << p1 << endl; if(Abs(p) <= ap0 || k>10 ) return ro; if(p0*p<0) { p1=p;ro1=ro;} else {p0=p;ro0=ro;} } else { ro *=2; x += (ro-rold)* h; rold=ro; g =A(x); p = (g,h); p1=p; ro1=ro; } } } template int ConjuguedGradientNL(const M & dJ,const P & C,KN_ &x,const int nbitermax, double &eps,long kprint=1000000000) { // ------------- throwassert(&x && &b && &A && &C); typedef KN Rn; int n=b.N(); if (verbosity>99) kprint=1; throwassert(n==x.N()); R ro=1; Rn g(n),h(n),Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g = dJ(x); Cg = C*g; // gradient preconditionne h =-Cg; R g2 = (Cg,g); if (g2 < 1e-30) { if(verbosity>1) cout << "GCNL g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } if (verbosity>5 ) cout << " 0 GCNL g^2 =" << g2 << endl; R reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { ro = argmin(J,x,h,g,Ah); Cg = C*g; R g2p=g2; g2 = (Cg,g); if ( verbosity >1 ) cout << "CGNL:" < struct SortArray { }; template struct SortArray { T v[1]; SortArray(T *a,int * sens=0) { v[0]=a[0]; if(sens) *sens =1; } SortArray(const T& a0) { v[0]=a0; } SortArray(){} bool operator == (const SortArray & t) const { return v[0] == t.v[0] ;} bool operator<(const SortArray & t) const { return v[0] < t.v[0] ;} size_t hash() const {return (size_t) v[0];} }; template struct SortArray { // using std::swap; T v[2]; SortArray(T *a,int * sens=0) { int s=1; v[0]=a[0]; v[1]=a[1]; if(v[0]>v[1]) s=-s,swap(v[0],v[1]); if(sens) *sens=s; } SortArray(const T& a0,const T &a1) { v[0]=a0; v[1]=a1; if(v[0]>v[1]) swap(v[0],v[1]); } SortArray(){} bool operator == (const SortArray & t) const { return v[0] == t.v[0] && v[1] == t.v[1] ;} bool operator<(const SortArray & t) const { return v[0] != t.v[0] ? v[0] < t.v[0] : v[1] < t.v[1] ;} size_t hash() const {return (size_t) v[0];} }; template struct SortArray { T v[3]; SortArray(T *a,int *sens=0) { int s=1; v[0]=a[0]; v[1]=a[1]; v[2]=a[2]; if(v[0]>v[1]) s=-s,swap(v[0],v[1]); if(v[1]>v[2]) { s=-s,swap(v[1],v[2]); if(v[0]>v[1]) s=-s,swap(v[0],v[1]); ASSERTION(v[0] <= v[1] && v[1] <= v[2] ); } if(sens) *sens=s; } SortArray(){} bool operator == (const SortArray & t) const { return v[0] == t.v[0] && v[1] == t.v[1] && v[2] == t.v[2] ;} bool operator<(const SortArray & t) const { return v[0] != t.v[0] ? v[0] < t.v[0] : ( v[1] != t.v[1] ? v[1] < t.v[1] : v[2] < t.v[2] );} size_t hash() const {return (size_t) v[0];} }; template ostream & operator<<(ostream & f,const SortArray & item) { for (int i=0;i class HashTable { public: struct nKV { size_t next; K k; V v; nKV(){} }; typedef nKV *iterator; size_t n,nx,nk,ncol,nfind; size_t * head; nKV * t; static const size_t endhash= (size_t) -1; HashTable(size_t nnx,size_t nnk) : n(0),nx(nnx),nk(nnk),ncol(0),nfind(0), head(new size_t[nk]),t(new nKV[nx]) { reset();} void reset() { n=0; ncol=0; for (size_t j=0;jv; else return t[add(key,V())].v; } ~HashTable() { if(nfind && verbosity>4) cout << " ~HashTable: Cas moyen : " << (double) ncol/ nfind << endl; delete [] head; delete [] t; } // pas de copie .... private: HashTable(const HashTable&); void operator=(const HashTable&); }; freefem++-3.61-1/src/femlib/RNM_tpl.hpp000644 000767 000024 00000026264 13321622623 017663 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: 29 fev 2000 // -*- Mode : c++ -*- // // SUMMARY : array modelisation // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef RNM_tpl_ #define RNM_tpl_ #include "RNM.hpp" // version du 22 nov 1999 // Voila une debut de class vecteur + matrice // les class avec termine avec un _ ne travail que sur // un pointeur existant => pas de new et delete de pointeur // la class correspondant sans de _ genere les pointeurs // // avec ses classes on peut prendre une ligne // ou une colonne d'une matrice // ----------------------- namespace RNM { template inline double norm(const T & x){return std::norm(x);} inline double norm(double x){return x*x;} inline double norm(float x){return x*x;} inline long norm(long x){return x*x;} inline int norm(int x){return x*x;} } template void MatMul(KNM_ & ab, KNM_ & a, KNM_ & b){ // attention ne marche que si les adresses ne sont pas les memes long N= a.shapei.n; long M= a.shapej.n; K_throwassert(a.shapej.n == a.shapei.n); K_throwassert(a.shapei.n == ab.shapei.n); K_throwassert(b.shapej.n == ab.shapej.n); K_throwassert(b.v != ab.v); K_throwassert(a.v != ab.v); KN_ ai =a(0); for(long i=0;i bj=b[0]; for(long j=0;j ostream & operator<<(ostream & f,const KN_ & v) { //f << " KN_ : " << (ShapeOfArray) v << " " << (const_R *) v << " :\n\t" ; f << v.N() << "\t\n\t" ; const int i10=10; int prec=f.precision(); if(prec istream & operator>>(istream & f, KN_ & v) { int n;char c; f >> n; ffassert(f.good()); ffassert(n==v.N()); while (f.get(c) && (c!='\n' && c!='\r' ) ) ; // eat until control (new line for (int i=0;i> v[i] ; ffassert(f.good());} // modif FH main 2006 return f; } template istream & operator>>(istream & f, KN & v) { int n;char c; f >> n; if (v.unset()) v.init(n); cout << n << " == " << v.N() << endl; ffassert(n==v.N()); while (f.get(c) && (c!='\n' && c!='\r' ) ) ; // eat until control (new line for (int i=0;i> v[i] ; ffassert(f.good());}// modif FH main 2006 return f; } template ostream & operator<<(ostream & f,const KNM_ & v) { //f << " KNM_ "< ostream & operator<<(ostream & f,const KNMK_ & v) { //f << " KNM_" < R KN_::operator,(const KN_ & u) const { K_throwassert(u.n == n); R s=0; R * l(v); R *r(u.v); for (long i=0;i inline R operator,(const KN_ & u,const conj_KN_ & vc) { int n=u.n; K_throwassert(n == vc.a.n); R s=0; R * l(u); R *r(vc.a); int stepl= u.step, stepr=vc.a.step; for (long i=0;i inline R operator,(const conj_KN_ & u,const KN_ & vc) { int n=u.a.n; K_throwassert(n == vc.n); R s=0; R * l(u.a); R *r(vc); int stepl= u.a.step, stepr=vc.step; for (long i=0;i inline R operator,(const KN & u,const conj_KN_ & vc) { return ( (KN_) u,vc);} template inline R operator,(const conj_KN_ & u,const KN & vc) { return ( u, (KN_) vc);} #ifdef HAVE_BLAS extern "C" { typedef struct { double r; double i; } blascomplex; void cblas_zdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu); void cblas_zdotc_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu); } #define BLAS_ddot F77_FUNC_(ddot,DDOT) #define BLAS_zdotu F77_FUNC_(zdotu,ZDOTU) #define BLAS_zdotc F77_FUNC_(zdotc,ZDOTC) #define DCL_DOT(U,DOT) extern "C" U DOT (const int*, const U*, const int*, const U*, const int*); DCL_DOT(double,BLAS_ddot); // XXDCL_DOT(complex,BLAS_zdotu); //XXDCL_DOT(complex,BLAS_zdotc); template<> inline double KN_::operator,(const KN_ & u) const { K_throwassert(u.n == n); double s=0; double * l(v); double *r(u.v); int nr=n,ls = step,rs=u.step; s= BLAS_ddot (&nr,l,&ls,r,&rs) ; return s; } template<> inline complex KN_ >::operator,(const KN_ > & u) const { K_throwassert(u.n == n); complex s=0; complex * l(v); complex *r(u.v); int nr=n,ls = step,rs=u.step; cblas_zdotu_sub(nr,(const void *) l,ls,(const void *) r,rs, (void*) &s); // s= BLAS_zdotu (&nr,l,&ls,r,&rs) ;// non conj return s; } template<> inline complex operator,(const conj_KN_ > & vc,const KN_ > & u) { K_throwassert(u.n == vc.a.n); complex s=0; complex * l(u); complex *r(vc.a); int nr=u.n,ls = u.step,rs=vc.a.step; cblas_zdotc_sub(nr,(const void *) l,ls,(const void *) r,rs, (void*) &s); // s= BLAS_zdotc (&nr,r,&rs,l,&ls) ; return s; } template<> inline complex operator,(const KN_ > & u,const conj_KN_ > & vc) { K_throwassert(u.n == vc.a.n); complex s=0; complex * l(u); complex *r(vc.a); int nr=u.n,ls = u.step,rs=vc.a.step; cblas_zdotc_sub(nr,(const void *) l,ls,(const void *) r,rs, (void*) &s); // s= BLAS_zdotc (&nr,r,&rs,l,&ls) ; return s; } ///////////////////////// #endif template<> inline double operator,(const KN_ & u,const conj_KN_ & vc) { return ( u,vc.a);} template<> inline double operator,(const conj_KN_ & u,const KN_ & vc) { return ( u.a, vc);} template R KN_::min() const { R minv = v[index(0)]; for (long i=1;i R KN_::max() const { R maxv = v[index(0)]; for (long i=1;i R KN_::sum() const { R s = v[index(0)]; for (long i=1;i #include #include "error.hpp" #include #include #include #include "rgraph.hpp" using namespace std; #include "RNM.hpp" #include "fem.hpp" #include "FESpace.hpp" namespace Fem2D { int Make(const TypeOfFE ** t,int k,KN & P,KN & I) { typedef TypeOfFE::IPJ IPJ; int n=0,nn=0; for (int i=0;i p(t[i]->P_Pi_h); for (int j=0;j ajout I[nn]=n++; for (int l=0;l detruit break;} } } } return n; // nombre de point commun } KN Makepij_alpha(const TypeOfFE ** t,int k) { // Attention les df est numerote de facon croissant // en faisant une boucle sur les TypeOfFE // comme dans la class TypeOfFESum typedef TypeOfFE::IPJ IPJ; int n=0,m=0; for (int i=0;i< k;i++) { n += t[i]->pij_alpha.N(); m += t[i]->P_Pi_h.N(); } KN ij(n); KN I(m); KN P(m); Make(t,k,P,I); int p0=0,i0=0,N0=0,nn=0; for (int i=0;i< k;i++) { const KN p(t[i]->pij_alpha); for (int j=0;jNbDoF; p0+=t[i]->P_Pi_h.N(); N0+=t[i]->N;} return ij; } KN MakeP_Pi_h(const TypeOfFE **t,int k) { int np=0; for (int i=0;i< k;i++) np += t[i]->P_Pi_h.N(); KN< R2 > yy(np); KN zz(np); int kk=Make(t,k,yy,zz); // cout << " MakeP_Pi_h: " << kk << " from " << np << endl; return yy(SubArray(kk)); } ListOfTFE * ListOfTFE::all ; // list of all object of this type ListOfTFE::ListOfTFE (const char * n,TypeOfFE *t) : name(n),tfe(t) { if(!t) assert(t); static int count=0; if (count++==0) all=0; // init of all in dependant of the ordre of the objet file next=all; all=this; } const TypeOfFE ** Make(const FESpace **l,int k) { const TypeOfFE** p=new const TypeOfFE*[k]; for (int i=0;iTFE[0]; return p; } const TypeOfFE ** Make(const TypeOfFE **l,int k) { const TypeOfFE** p=new const TypeOfFE*[k]; for (int i=0;i Aipj(ipj.N()); KNM Vp(N,PtHat.N()); Pi_h(Aipj); for (int p=0;p Vpp(Vp('.',p)); for (int j=0;j & v) const { for (int i=0,k0=0;iNbDoF; KN_ sv(v(SubArray(n,k0))); teb[i]->Pi_h_alpha(K,sv); k0+= n;} } ~TypeOfFESum(){ delete [] teb;} } ; class FEProduitConstruct { protected: const TypeOfFE & teb; int k; int * data; FEProduitConstruct(int kk,const TypeOfFE &t) ; ~FEProduitConstruct(){delete [] data;} }; class TypeOfFEProduit: protected FEProduitConstruct, public TypeOfFE { public: TypeOfFEProduit(int kk,const TypeOfFE &t): FEProduitConstruct(kk,t),TypeOfFE(t,kk,data) {} // void FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; void FB(const bool * whatd,const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void D2_FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int, void * arg ) const; virtual void Pi_h_alpha(const baseFElement & K,KN_ & v) const { int nbof=teb.NbDoF; for (int i=0,k0=0;i sv(v(SubArray(nbof,k0))); teb.Pi_h_alpha(K,sv); } } ~TypeOfFEProduit(){} } ; FEProduitConstruct::FEProduitConstruct(int kk,const TypeOfFE &t) :k(kk),teb(t) { int m= teb.NbDoF; KN nn(teb.NbNode); nn=0; // nb de dl par noeud for (int i=0;i m; int i=k,j; while(i--) // on va a l'envert pour avoir comp[i] <=i m[teb[i]]=i; // l'ordre comp est important comp est croissant mais pas de pb. i=k; while(i--) comp[i]=m[teb[i]]; // comp[i] <=i // reservatition des intervalles en espaces int n=0,N=0; for ( j=0;jN;} NN[kk] = N; // reservation des interval en df n=0; for ( j=0;jNbDoF;} DF[kk] = n; // n = nb de DF total // N the fem is in R^N data = new int [n*5 + N]; int c=0; int ki= 0; // recherche des noeuds KN w(7),nn(7); w=0; nn=0; for ( j=0;jNbDoF;i++) nn[teb[j]->DFOnWhat[i]]++; nbn=0; for( j=0;j<7;j++) if (nn[j]) nn[j]=nbn++; else nn[j]=-1; KN dln(7); dln=0; // nn donne numero de noeud sur what for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOnWhat[i]; for ( j=0;jNbDoF;i++) data[c++] = teb[j]->DFOfNode[i]+dln[teb[j]->DFOnWhat[i]]; for ( i=0;iNbDoF;i++) dln[teb[j]->DFOnWhat[i]]=Max(dln[teb[j]->DFOnWhat[i]],data[cc++]+1); } for ( j=0;jNbDoF;i++) data[c++] = nn[teb[j]->DFOnWhat[i]]; } for ( j=0;jNbDoF;i++) data[c++] = j; // node from of FE for ( j=0;jNbDoF;i++) data[c++] = i; // node from of df in FE int xx=0; for (j=0;jN;i++) { data[c] = teb[j]->dim_which_sub_fem[i]+xx; xxx=Max(xxx,data[c]+1); c++; } xx=xxx; } throwassert(c== 5*n+N); /* int cc=0; cout << " Data : " << endl; for ( i=0;i<5;i++) { for (j=0;j & u,int componante,int op) const ; } ; /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// NEW //////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// class TypeOfFE_P1Bubble : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P1Bubble(): TypeOfFE(1,0,1,1,Data,1,1,4,4,Pi_h_coef) { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1), R2(1./3.,1./3.) }; for (int i=0;i & u,int componante,int op) const ; } ; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// class TypeOfFE_P2Lagrange : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P2Lagrange(): TypeOfFE(1,1,0,1,Data,3,1,6,6,Pi_h_coef) { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1),R2(0.5,0.5),R2(0,0.5),R2(0.5,0) }; for (int i=0;icounter), MaxNbNodePerElement(t->MaxNbNodePerElement), MaxNbDFPerElement(t->MaxNbDFPerElement*k), NodesOfElement(t->NodesOfElement), FirstNodeOfElement(t->FirstNodeOfElement), FirstDfOfNode(0), NbOfElements(t->NbOfElements), NbOfDF(t->NbOfDF*k), NbOfNode(t->NbOfNode), Nproduit(t->Nproduit*k) { throwassert(t==0 || t->FirstDfOfNode==0); *counter++; } ConstructDataFElement::ConstructDataFElement (const Mesh &Th,int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement,const TypeOfMortar *tm, int nbdfv,const int *ndfv,int nbdfe,const int *ndfe) : counter(&thecounter),thecounter(0) { Make(Th,NbDfOnSommet,NbDfOnEdge,NbDfOnElement, tm,nbdfv,ndfv,nbdfe,ndfe); } ConstructDataFElement::ConstructDataFElement(const FESpace ** l,int k) : thecounter(0),counter(&thecounter) { int NbDfOnSommet=0; int NbDfOnEdge=0; int NbDfOnElement=0; const Mesh & Th(l[0]->Th); for (int i=0;iTFE[0]->NbDfOnVertex; NbDfOnEdge += l[i]->TFE[0]->NbDfOnEdge; NbDfOnElement += l[i]->TFE[0]->NbDfOnElement; throwassert( &Th== &l[i]->Th); throwassert( l[i]->TFE.constant()); } Make(Th,NbDfOnSommet,NbDfOnEdge,NbDfOnElement,0); } void ConstructDataFElement::Make(const Mesh &Th,int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement,const TypeOfMortar *tm, int nb_dfv,const int *ndfv,int nb_dfe,const int *ndfe) { *counter=0; Nproduit =1; int ndf=0,samendf=1; int nbdfe=3*NbDfOnSommet+3*NbDfOnEdge+NbDfOnElement; int nbne = 0; int nn=0; int firstmul=0; throwassert( tm || Th.NbMortars==0); NbOfElements = Th.nt; // by default // if mortars // int NbOfNodeL=0; NbOfElements += Th.NbMortars; FirstDfOfNode =0; FirstNodeOfElement=0; MaxNbDFPerElement=3*NbDfOnSommet+3*NbDfOnEdge+NbDfOnElement; int ks=0,ke=0,kt=0; if(NbDfOnSommet) { nbne+=3; ks=1; ndf=NbDfOnSommet;} if(NbDfOnEdge) { nbne+=3; ke=1; samendf &= !ndf || ndf == NbDfOnEdge; ndf=NbDfOnEdge;} if(NbDfOnElement) { nbne+=1; kt=1; samendf &= !ndf || ndf == NbDfOnElement; ndf=NbDfOnElement;} int NbDFonNode[7],NodeIsOn[7]; { int j=0,k=0; if(ks) { NbDFonNode[j++]=NbDfOnSommet; NbDFonNode[j++]=NbDfOnSommet; NbDFonNode[j++]=NbDfOnSommet;} if(ke) { NbDFonNode[j++]=NbDfOnEdge; NbDFonNode[j++]=NbDfOnEdge; NbDFonNode[j++]=NbDfOnEdge;} if(kt) { NbDFonNode[j++]=NbDfOnElement;} if (ks) {NodeIsOn[k++]=0;NodeIsOn[k++]=1;NodeIsOn[k++]=2;} if (ke) {NodeIsOn[k++]=3;NodeIsOn[k++]=4;NodeIsOn[k++]=5;} if (kt) {NodeIsOn[k++]=6;} throwassert(j == nbne); } MaxNbNodePerElement=nbne; // if ( ks && (!ke && ! kt) && (ndfv==0 && ndfe==0)) {nn=Th.nv; NodesOfElement=0; } else { // constuction du tableau NodesOfElement bofbof // computation of the length lne of array NodesOfElement int lne= Th.nt*nbne; if (Th.NbMortars) { samendf= false; NbOfNodeL=Th.NbMortars; throwassert(tm); FirstNodeOfElement = new int[NbOfElements+1]; int k=0,kk=0; for (k=0;kNbOfNodes(Th,Th.mortars[im]); } FirstNodeOfElement[k++]=lne; } NodesOfElement = new int[lne]; for (int i=0;i=0 && jj>=0) NodesOfElement[kk*nbne+oe+jj] = nn + ndfe[be] ; // adj NodesOfElement[k*nbne+oe+j] = nn + ndfe[be] ; // new } nn += nb_dfe; } for (int k=0;kConstructionOfNode(Th,im,NodesOfElement,FirstNodeOfElement,nn); Mortar & M(Th.mortars[im]); NodesOfElement[i++] = nn++; // the first node is the lag. mul. int n=M.NbT(); for (int kk=0;kkNbLagrangeMult(Th,Th.mortars[km]); // On node par int nodemul = NodesOfElement[fk]; // the first node is the lagr. mul. throwassert(FirstDfOfNode[nodemul+1]==-1); FirstDfOfNode[nodemul+1]= ndlmul; NbOfDFL += ndlmul; int nbdle=0; int nbnm=lk-fk; for (int j=fk;jnb_sub_fem), dim_which_sub_fem(TFE[0]->dim_which_sub_fem), Th(TTh), NbOfDF(cdef->NbOfDF), NbOfElements(cdef->NbOfElements), NbOfNodes(cdef->NbOfNode), MaxNbNodePerElement(cdef->MaxNbNodePerElement), MaxNbDFPerElement(cdef->MaxNbDFPerElement), NodesOfElement(cdef->NodesOfElement), FirstDfOfNodeData(cdef->FirstDfOfNode), FirstNodeOfElement(cdef->FirstNodeOfElement), tom(&tm) { // cout << "avant renum ="<< *this <D2_FB(Th,K,P,v); else v=val(SubArray(DF[j+1]-DF[j],DF[j]),SubArray(NN[j+1]-NN[j],NN[j]),t); } } */ /* void TypeOfFESum::FB(const Mesh & Th,const Triangle & K,const R2 & P,RNMK_ & val) const { val=0.0; SubArray t(3); for (int i=0;iFB(Th,K,P,v); else v=val(SubArray(DF[j+1]-DF[j],DF[j]),SubArray(NN[j+1]-NN[j],NN[j]),t); } } */ void TypeOfFESum::FB(const bool * whatd,const Mesh & Th,const Triangle & K,const R2 & P,RNMK_ & val) const { val=0.0; SubArray t(val.K()); for (int i=0;iFB(whatd,Th,K,P,v); else v=val(SubArray(DF[j+1]-DF[j],DF[j]),SubArray(NN[j+1]-NN[j],NN[j]),t); } } /* void TypeOfFESum::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int jjj, void * arg) const { for(int i=0;iPi_h(KK,vv,f,v,jjj+NN[i],arg); } // cout << val(SubArray(NbDoF)) << endl; } /* void TypeOfFE_P1Lagrange::D2_FB(const Mesh & ,const Triangle & ,const R2 & ,RNMK_ & val) const { // val=0; } */ /* void TypeOfFE_P2Lagrange::D2_FB(const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // 2 times derivatives for error indicator // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); throwassert(val.N() >=6); throwassert(val.M()==1 ); throwassert(val.K()==3 ); val=0; RN_ fxx(val('.',0,0)); RN_ fxy(val('.',0,1)); RN_ fyy(val('.',0,2)); fxx[0] = 4*Dl0.x*Dl0.x; fxx[1] = 4*Dl1.x*Dl1.x; fxx[2] = 4*Dl2.x*Dl2.x; fxx[3] = 8*Dl1.x*Dl2.x; fxx[4] = 8*Dl0.x*Dl2.x; fxx[5] = 8*Dl0.x*Dl1.x; fyy[0] = 4*Dl0.y*Dl0.y; fyy[1] = 4*Dl1.y*Dl1.y; fyy[2] = 4*Dl2.y*Dl2.y; fyy[3] = 8*Dl1.y*Dl2.y; fyy[4] = 8*Dl0.y*Dl2.y; fyy[5] = 8*Dl0.y*Dl1.y; fxy[0] = 4*Dl0.y*Dl0.y; fxy[1] = 4*Dl1.y*Dl1.y; fxy[2] = 4*Dl2.y*Dl2.y; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } */ R TypeOfFE_P1Lagrange::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r=0; if (op==0) { R l0=1-PHat.x-PHat.y,l1=PHat.x,l2=PHat.y; r = u0*l0+u1*l1+l2*u2; } else { const Triangle & T=K.T; R2 D0 = T.H(0) , D1 = T.H(1) , D2 = T.H(2) ; if (op==1) r = D0.x*u0 + D1.x*u1 + D2.x*u2 ; else r = D0.y*u0 + D1.y*u1 + D2.y*u2 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd[op_id]) { f0[0] = l0; f0[1] = l1; f0[2] = l2;} if (whatd[op_dx] || whatd[op_dy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } } } /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// NEW ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /* void TypeOfFE_P1Bubble::FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const { assert(0); } void TypeOfFE_P1Bubble::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int, void *) const { assert(0); } /* R TypeOfFE_P1Bubble::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { assert(0); } */ void TypeOfFE_P1Bubble::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y, l1=P.x, l2=P.y, lb=l0*l1*l2*9.; if (val.N() <4) throwassert(val.N() >=4); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd[op_id]) { f0[0] = l0-lb; f0[1] = l1-lb; f0[2] = l2-lb; f0[3] = 3.*lb; } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)), Dlb((Dl0*l1*l2+Dl1*l0*l2+Dl2*l0*l1)*9.); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x-Dlb.x; f0x[1] = Dl1.x-Dlb.x; f0x[2] = Dl2.x-Dlb.x; f0x[3] = 3.*Dlb.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y-Dlb.y; f0y[1] = Dl1.y-Dlb.y; f0y[2] = Dl2.y-Dlb.y; f0y[3] = 3.*Dlb.y; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); R lbdxx= 2*((Dl0.x*Dl1.x)*l2+(Dl1.x*Dl2.x)*l0+(Dl2.x*Dl0.x)*l1); fxx[0] = -lbdxx; fxx[1] = -lbdxx; fxx[2] = -lbdxx; fxx[3] = 3*lbdxx; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); R lbdyy= 2*((Dl0.y*Dl1.y)*l2+(Dl1.y*Dl2.y)*l0+(Dl2.y*Dl0.y)*l1); fyy[0] = -lbdyy; fyy[1] = -lbdyy; fyy[2] = -lbdyy; fyy[3] = 3*lbdyy; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); R lbdxy= (Dl0.x*Dl1.y+ Dl0.y*Dl1.x)*l2+(Dl1.x*Dl2.y+Dl1.y*Dl2.x)*l0+(Dl2.x*Dl0.y+Dl2.y*Dl0.x)*l1; fxy[0] = 4*Dl0.x*Dl0.y-9.*(l0-l1-l2); fxy[1] = 4*Dl1.x*Dl1.y-9.*(l0-l1-l2); fxy[2] = 4*Dl2.x*Dl2.y-9.*(l0-l1-l2); fxy[3] = 27.*(l0-l1-l2); } } } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /* void TypeOfFE_P1Lagrange::FB(const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,0)); RN_ f0x(val('.',0,1)); RN_ f0y(val('.',0,2)); f0[0] = l0; f0[1] = l1; f0[2] = l2; f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } void TypeOfFE_P2Lagrange::FB(const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=6); throwassert(val.M()==1); throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,0)); RN_ f0x(val('.',0,1)); RN_ f0y(val('.',0,2)); // -- f0[0] = l0*(2*l0-1); f0[1] = l1*(2*l1-1); f0[2] = l2*(2*l2-1); f0[3] = 4*l1*l2; // oppose au sommet 0 f0[4] = 4*l0*l2; // oppose au sommet 1 f0[5] = 4*l1*l0; // oppose au sommet 3 f0x[0] = Dl0.x*l4_0; f0x[1] = Dl1.x*l4_1; f0x[2] = Dl2.x*l4_2; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) ; f0y[0] = Dl0.y*l4_0; f0y[1] = Dl1.y*l4_1; f0y[2] = Dl2.y*l4_2; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } */ void TypeOfFE_P2Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=6); throwassert(val.M()==1); // throwassert(val.K()==3 ); val=0; // -- if (whatd[op_id]) { RN_ f0(val('.',0,op_id)); f0[0] = l0*(2*l0-1); f0[1] = l1*(2*l1-1); f0[2] = l2*(2*l2-1); f0[3] = 4*l1*l2; // oppose au sommet 0 f0[4] = 4*l0*l2; // oppose au sommet 1 f0[5] = 4*l1*l0; // oppose au sommet 3 } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x*l4_0; f0x[1] = Dl1.x*l4_1; f0x[2] = Dl2.x*l4_2; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) ; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y*l4_0; f0y[1] = Dl1.y*l4_1; f0y[2] = Dl2.y*l4_2; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); fxx[0] = 4*Dl0.x*Dl0.x; fxx[1] = 4*Dl1.x*Dl1.x; fxx[2] = 4*Dl2.x*Dl2.x; fxx[3] = 8*Dl1.x*Dl2.x; fxx[4] = 8*Dl0.x*Dl2.x; fxx[5] = 8*Dl0.x*Dl1.x; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); fyy[0] = 4*Dl0.y*Dl0.y; fyy[1] = 4*Dl1.y*Dl1.y; fyy[2] = 4*Dl2.y*Dl2.y; fyy[3] = 8*Dl1.y*Dl2.y; fyy[4] = 8*Dl0.y*Dl2.y; fyy[5] = 8*Dl0.y*Dl1.y; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); fxy[0] = 4*Dl0.x*Dl0.y; fxy[1] = 4*Dl1.x*Dl1.y; fxy[2] = 4*Dl2.x*Dl2.y; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } } } /* void TypeOfFE_P1Lagrange::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int j, void * arg) const { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1) }; for (int i=0;i<3;i++) { f(v,K.T(Pt[i]),K,i,Pt[i],arg),val[i]=*(v+j);} } void TypeOfFE_P2Lagrange::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int j, void * arg) const { const R2 Pt[] = { R2(0,0), R2(1,0), R2(0,1),R2(0.5,0.5),R2(0,0.5),R2(0.5,0) }; for (int i=0;i<6;i++) { f(v,K.T(Pt[i]),K,i,Pt[i],arg),val[i]=*(v+j);} } */ //TypeOfFE P1Lagrange(1,0,0,P1Functions,D2_P1Functions,P1Interpolant,DataP1Lagrange); //TypeOfFE P2Lagrange(1,1,0,P2Functions,D2_P2Functions,P2Interpolant,DataP2Lagrange,3); // case of fine mesh class TypeOfMortarCas1: public TypeOfMortar { friend class FESpace; friend class FMortar; friend class ConstructDataFElement; protected: int NbLagrangeMult(const Mesh &,const Mortar &M) const ; int NbDoF(const Mesh &,const Mortar &M,int i) const { int l(M.NbLeft()),r(M.NbRight()); int n =Max(l,r); int mn=Min(l,r); return (l+r)*(NbDfOnVertex + NbDfOnEdge) + (n+1)*NbDfOnVertex + n*NbDfOnEdge -mn-1; } int NbOfNodes(const Mesh &,const Mortar &M) const // call one time {int l(M.NbLeft()),r(M.NbRight()); return (l+r)*(vertex_is_node+edge_is_node)+1;} int NbDoF(const Mesh &,const Mortar &M) const { int l(M.NbLeft()),r(M.NbRight()); int n =Max(l,r); int mn=Min(l,r); return (l+r)*(NbDfOnVertex + NbDfOnEdge) + (n+1)*NbDfOnVertex + n*NbDfOnEdge -mn-1; } int NodeOfDF(const FESpace &Vh,const Mortar &M,int i) const {throwassert(0);return 0;} int DFOfNode(const FESpace &Vh,const Mortar &M,int i) const {throwassert(0);return 0;} void ConstructionOfNode(const Mesh &Th,int im,int * NodesOfElement,int *FirstNodeOfElement,int &lastnodenumber) const; void ConsTheSubMortar(FMortar & ) const; const int vertex_is_node,edge_is_node; public: TypeOfMortarCas1 (int i,int j): TypeOfMortar(i,j), vertex_is_node(i?1:0),edge_is_node(j?1:0) {}; } MortarCas1P2(1,1) ; const TypeOfMortar & TheMortarCas1P2(MortarCas1P2); void TypeOfMortarCas1::ConstructionOfNode(const Mesh &Th,int im,int * NodesOfElement,int *FirstNodeOfElement,int &lastnodenumber) const { // im mortar number // trop complique on change const Mortar &M(Th.mortars[im]); int k = Th.nt+im; int kk=FirstNodeOfElement[k]; // begin // lagrange multiplicator one new node NodesOfElement[kk++] = lastnodenumber++; /* int il = M.NbLeft(); int ir = M.NbRight(); int ir1 = ir-1; // left for( int j=0;j=0 && lr >= 0); // throwassert ( ll <=lg && lr <= lg); // cout << "AA , BB = " << AA << "," << BB << endl; // cout << " " << ll << " " << lr << " ll=" << sm.sm[k].left << ", "; if (ll2); return nbmul; } // --- FMortar::FMortar(const FESpace * VVh,int k) : Vh(*VVh), M(Vh.Th.mortars[k-Vh.Th.nt]), N(VVh->N), p(Vh.PtrFirstNodeOfElement(k)), nbn(Vh.NbOfNodesInElement(k)), tom(Vh.tom) { throwassert(k>=Vh.Th.nt && k tom->ConsTheSubMortar(*this);} R TypeOfFE::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const { R v[1000],vf[100]; assert(N*3*NbDoF<=1000 && NbDoF <100 ); KNMK_ fb(v,NbDoF,N,op+1); // the value for basic fonction KN_ fk(vf,NbDoF); for (int i=0;i #include #include "error.hpp" #include #include //#include #include #include using namespace std; #include "RNM.hpp" #include "rgraph.hpp" #include "fem.hpp" using namespace Fem2D; #ifndef NEWQUADTREE // new version ---------- // ---------------------- #ifdef DRAWING void FQuadTree::PlotQuad(I2 pp,long hb) { IMoveTo(pp.x,pp.y); ILineTo(pp.x+hb,pp.y); ILineTo(pp.x+hb,pp.y+hb); ILineTo(pp.x ,pp.y+hb); ILineTo(pp.x ,pp.y); } void FQuadTree::PlotX(I2 p,long hb) { IMoveTo(p.x, p.y); ILineTo(p.x+hb/2,p.y+hb/2); IMoveTo(p.x+hb/2,p.y); ILineTo(p.x ,p.y+hb/2); } void FQuadTree::Draw() { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; I2 pp[MaxDeep]; //long ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; IntQuad hb = MaxISize; if (!root) return ; // long kkk =0; pb[0]= root; pi[0]= root->n>0 ?(int) root->n : 4 ;; pp[0].x=pp[0].y=0;//ii[0]=jj[0]=0; do{ b= pb[l]; while (pi[l]--) { if (b->n>0) // Vertex QuadTreeBox none empty { // for (int k=0;kn;k++) { DrawMark(*b->v[k],0.002); } break; } else // Pointer QuadTreeBox { int lll = pi[l]; QuadTreeBox *b0=b; if ((b=b->b[lll])) { hb >>=1 ; // div by 2 I2 ppp(pp[l],lll,hb); pb[++l]= b; pi[l]= 4; pp[l]=ppp; PlotQuad(pp[l],hb); } else { I2 ppp(pp[l],lll,hb/2); b=b0; PlotX(ppp,hb/2); } } } hb <<= 1; // mul by 2 } while (l--); } #endif Vertex * FQuadTree::NearestVertex(long xi,long yj) { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; I2 pp[ MaxDeep ]; int l=0; // level QuadTreeBox * b; IntQuad h=MaxISize,h0; IntQuad hb = MaxISize; I2 p0(0,0); I2 plus( xin) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = plus.Case(hb2);//(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; p0.Add(k,hb2); hb = hb2; } if ( n0 > 0) { for( int k=0;kv[k]); h0 = I2(i2,plus).norm();//NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k];} NbVerticesSearch++; } return vn; } // general case ----- pb[0]= b; pi[0]=b->n>0 ?(int) b->n : 4 ; pp[0]=p0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; I2 i2 = R2ToI2(b->v[k]); h0 = I2(i2,plus).norm();// NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 I2 ppp(pp[l],k,hb); if ( ppp.interseg(plus,hb,h) )//(INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return vn; } Vertex * FQuadTree::ToClose(const R2 & v,R seuil,long hx,long hy,bool nearest) { I2 H(hx,hy); const I2 p(XtoI(v.x),YtoJ(v.y)); const R2 X(v); R seuil2 = seuil*seuil; // const Metric Mx(v.m); Vertex *pvr =0; // return vertex QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; I2 pp[ MaxDeep ]; // long ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; long h=MaxISize; long hb = MaxISize; //long i0=0,j0=0; I2 p0(0,0); // Vertex *vn=0; if (!root->n) return 0; // empty tree // general case ----- pb[0]= root; pi[0]= root->n>0 ?(int) root->n : 4 ; pp[0]=p0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; Vertex & V(*b->v[k]); I2 i2 = R2ToI2(V); if ( I2(i2,p).less(H) ) { R2 XY(X,V); R dd; if( (dd= (XY,XY) ) < seuil2 ) // LengthInterpole(Mx(XY), b->v[k]->m(XY))) < seuil ) {// cout << dd << " " << XY << " "; if( nearest ) // modif FH { seuil2=dd; pvr = & V; // cout << "\n FQuadTree::ToClose( " << X << " / " << V << " / "<< dd << endl; } else return &V; } } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 I2 ppp(pp[l],k,hb); if (ppp.interseg(p,hb,H)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return pvr; } void FQuadTree::Add( Vertex & w) { QuadTreeBox ** pb , *b; I2 p(XtoI(w.x),YtoJ(w.y)); long l=MaxISize; pb = &root; // cout << pb << " " << &root << endl; while( (b=*pb) && (b->n<0)) { b->n--; l >>= 1; pb = &b->b[p.Case(l)]; } if (b) { if (b->n > 3 && b->v[3] == &w) return; if (b->n > 2 && b->v[2] == &w) return; if (b->n > 1 && b->v[1] == &w) return; if (b->n > 0 && b->v[0] == &w) return; } throwassert(l); while ((b= *pb) && (b->n == 4)) // the QuadTreeBox is full { Vertex *v4[4]; // copy of the QuadTreeBox vertices v4[0]= b->v[0]; v4[1]= b->v[1]; v4[2]= b->v[2]; v4[3]= b->v[3]; b->n = -b->n; // mark is pointer QuadTreeBox b->b[0]=b->b[1]=b->b[2]=b->b[3]=0; // set empty QuadTreeBox ptr l >>= 1; // div the size by 2 for (int k=0;k<4;k++) // for the 4 vertices find the sub QuadTreeBox ij { int ij; QuadTreeBox * bb = b->b[ij=R2ToI2(v4[k]).Case(l)]; if (!bb) bb=b->b[ij]=NewQuadTreeBox(); // alloc the QuadTreeBox // cout << bb << " " << k << " " << ij << endl; bb->v[bb->n++] = v4[k]; } pb = &b->b[p.Case(l)]; } if (!(b = *pb)) b=*pb= NewQuadTreeBox(); // alloc the QuadTreeBox // cout << b << " " << b->n << endl; b->v[b->n++]=&w; // we add the vertex NbVertices++; } FQuadTree::FQuadTree(Vertex * v,R2 Pmin,R2 Pmax,long nbv) : th(0), lenStorageQuadTreeBox(Max(abs(nbv),1000L)), NbQuadTreeBox(0), NbVertices(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), cMin(Pmin-(Pmax-Pmin)/2), cMax(Pmax+(Pmax-Pmin)/2), coef( MaxISize/Norme_infty(cMax-cMin)) { sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); for (long i=0;inv/8+100), th(t), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), NbQuadTreeBox(0), NbVertices(0), cMin(Pmin-(Pmax-Pmin)/2), cMax(Pmax+(Pmax-Pmin)/2), coef( MaxISize/Norme_infty(cMax-cMin)) { if (nbv == -1) nbv = t->nv; sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); // throwassert( MaxISize > MaxICoor); if (t) for (long i=0;ivertices[i]); #ifdef DRAWING1 Draw(); #endif } FQuadTree::FQuadTree(const Mesh* t,long tnv,R2 Pmin,R2 Pmax,long nbv) : lenStorageQuadTreeBox(tnv/8+100), th(t), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), NbQuadTreeBox(0), NbVertices(0), cMin(Pmin-(Pmax-Pmin)/2), cMax(Pmax+(Pmax-Pmin)/2), coef( MaxISize/Norme_infty(cMax-cMin)) { if (nbv == -1) nbv = tnv; sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); // throwassert( MaxISize > MaxICoor); if (t) for (long i=0;ivertices[i]); #ifdef DRAWING1 Draw(); #endif } FQuadTree::FQuadTree() : lenStorageQuadTreeBox(100), th(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), NbQuadTreeBox(0), NbVertices(0), cMin(0,0),cMax(0,0),coef(0) { sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); } FQuadTree::StorageQuadTreeBox::StorageQuadTreeBox(long ll,StorageQuadTreeBox *nn) { len = ll; n = nn; b = new QuadTreeBox[ll]; for (int i = 0; i n) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = plus.Case(hb2);//(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; p0.Add(k,hb2); hb = hb2; } if ( n0 > 0) { for(int k=0;kv[k]; if (v->ninside(P)) { I2 i2 = R2ToI2(v); // try if is in the right sens -- h0 = I2(i2,plus).norm();// h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 n>0 ?(int) b->n : 4 ; pp[0]=p0; h=hb; L1: do { // walk on the tree b= pb[l]; while (pi[l]--) // loop on 4 element of the box { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { Vertex * v=b->v[k]; if (v->ninside(P) ) { NbVerticesSearch++; I2 i2 = R2ToI2(v); // if good sens when try -- h0 = I2(i2,plus).norm();// NORM(iplus,i2.x,jplus,i2.y); if (h0 b[k])) { hb >>=1 ; // div by 2 I2 ppp(pp[l],k,hb); if ( ppp.interseg(plus,hb,h) )//(INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); if (!vn && b != root ) {// cas particulier on repart du sommet on avais rien trouver b=root; hb = MaxISize; p0=I2(0,0); l=0; pb[0]= b; pi[0]= b->n>0 ?(int) b->n : 4 ; pp[0]=I2(0,0); goto L1; } return vn; } #else // nouvelle version a tester #define INTER_SEG(a,b,x,y) (((y) > (a)) && ((x) <(b))) #define ABS(i) ((i)<0 ?-(i) :(i)) #define MAX1(i,j) ((i)>(j) ?(i) :(j)) #define NORM(i1,j1,i2,j2) MAX1(ABS((i1)-(j1)),ABS((i2)-(j2))) #define IJ(i,j,l) ( ( j & l) ? (( i & l) ? 3 : 2 ) :( ( i & l)? 1 : 0 )) #define I_IJ(k,l) (( k&1) ? l : 0) #define J_IJ(k,l) (( k&2) ? l : 0) #ifdef DRAWING // old version ---- void FQuadTree::Draw() { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; long ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; IntQuad hb = MaxISize; if (!root) return ; long kkk =0; pb[0]= root; pi[0]= root->n>0 ?(int) root->n : 4 ;; ii[0]=jj[0]=0; do{ b= pb[l]; while (pi[l]--) { if (b->n>0) // Vertex QuadTreeBox none empty { // for (int k=0;kn;k++) { DrawMark(*b->v[k],0.002); } break; } else // Pointer QuadTreeBox { int lll = pi[l]; QuadTreeBox *b0=b; if ((b=b->b[lll])) { hb >>=1 ; // div by 2 long iii = ii[l]+I_IJ(lll,hb); long jjj = jj[l]+J_IJ(lll,hb); pb[++l]= b; pi[l]= 4; ii[l]= iii; jj[l]= jjj; IMoveTo(ii[l],jj[l]); ILineTo(ii[l]+hb,jj[l]); ILineTo(ii[l]+hb,jj[l]+hb); ILineTo(ii[l] ,jj[l]+hb); ILineTo(ii[l] ,jj[l]); } else { long iii = ii[l]+I_IJ(lll,hb/2); long jjj = jj[l]+J_IJ(lll,hb/2); b=b0; IMoveTo(iii, jjj); ILineTo(iii+hb/2,jjj+hb/2); IMoveTo(iii+hb/2,jjj); ILineTo(iii ,jjj+hb/2); } } } hb <<= 1; // mul by 2 } while (l--); } #endif Vertex * FQuadTree::NearestVertex(long xi,long yj) { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; long ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; IntQuad h=MaxISize,h0; IntQuad hb = MaxISize; long i0=0,j0=0; long iplus( xin) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = IJ(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; i0 += I_IJ(k,hb2); // i orign of QuadTreeBox j0 += J_IJ(k,hb2); // j orign of QuadTreeBox hb = hb2; } if ( n0 > 0) { for( int k=0;kv[k]); h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k];} NbVerticesSearch++; } return vn; } // general case ----- pb[0]= b; pi[0]=b->n>0 ?(int) b->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; I2 i2 = R2ToI2(b->v[k]); h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 long iii = ii[l]+I_IJ(k,hb); long jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return vn; } Vertex * FQuadTree::ToClose(const R2 & v,R seuil,long hx,long hy) { const long i=XtoI(v.x); const long j=YtoJ(v.y); const R2 X(v); R seuil2 = seuil*seuil; // const Metric Mx(v.m); QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; long ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; long h=MaxISize; long hb = MaxISize; long i0=0,j0=0; // Vertex *vn=0; if (!root->n) return 0; // empty tree // general case ----- pb[0]= root; pi[0]= root->n>0 ?(int) root->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; Vertex & V(*b->v[k]); I2 i2 = R2ToI2(V); if ( ABS(i-i2.x) v[k]->m(XY) < seuil ) if( (dd= (XY,XY) ) < seuil ) // LengthInterpole(Mx(XY), b->v[k]->m(XY))) < seuil ) { // cout << CurrentTh->Number(v) << "is To Close " // << CurrentTh->Number( b->v[k]) << " l=" <b[k])) { hb >>=1 ; // div by 2 long iii = ii[l]+I_IJ(k,hb); long jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,i-hx,i+hx) && INTER_SEG(jjj,jjj+hb,j-hy,j+hy)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return 0; } void FQuadTree::Add( Vertex & w) { QuadTreeBox ** pb , *b; long i= XtoI(w.x), j=YtoJ(w.y),l=MaxISize; pb = &root; // cout << pb << " " << &root << endl; while( (b=*pb) && (b->n<0)) { b->n--; l >>= 1; pb = &b->b[IJ(i,j,l)]; } if (b) { if (b->n > 3 && b->v[3] == &w) return; if (b->n > 2 && b->v[2] == &w) return; if (b->n > 1 && b->v[1] == &w) return; if (b->n > 0 && b->v[0] == &w) return; } throwassert(l); while ((b= *pb) && (b->n == 4)) // the QuadTreeBox is full { Vertex *v4[4]; // copy of the QuadTreeBox vertices v4[0]= b->v[0]; v4[1]= b->v[1]; v4[2]= b->v[2]; v4[3]= b->v[3]; b->n = -b->n; // mark is pointer QuadTreeBox b->b[0]=b->b[1]=b->b[2]=b->b[3]=0; // set empty QuadTreeBox ptr l >>= 1; // div the size by 2 for (int k=0;k<4;k++) // for the 4 vertices find the sub QuadTreeBox ij { int ij; QuadTreeBox * bb = b->b[ij=IJ(XtoI(v4[k]->x),YtoJ(v4[k]->y),l)]; if (!bb) bb=b->b[ij]=NewQuadTreeBox(); // alloc the QuadTreeBox // cout << bb << " " << k << " " << ij << endl; bb->v[bb->n++] = v4[k]; } pb = &b->b[IJ(i,j,l)]; } if (!(b = *pb)) b=*pb= NewQuadTreeBox(); // alloc the QuadTreeBox // cout << b << " " << b->n << endl; b->v[b->n++]=&w; // we add the vertex NbVertices++; } FQuadTree::FQuadTree(Mesh * t,R2 Pmin,R2 Pmax,long nbv) : th(t), lenStorageQuadTreeBox(t->nv/8+100), NbQuadTreeBox(0), NbVertices(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), cMin(Pmin-(Pmax-Pmin)/2), cMax(Pmax+(Pmax-Pmin)/2), coef( MaxISize/Norme_infty(cMax-cMin)) { if (nbv == -1) nbv = t->nv; sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); // throwassert( MaxISize > MaxICoor); if (t) for (long i=0;ivertices[i]); #ifdef DRAWING1 Draw(); #endif } FQuadTree::FQuadTree() : th(0), lenStorageQuadTreeBox(100), NbQuadTreeBox(0), NbVertices(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), coef(0),cMin(0,0),cMax(0,0) { sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); } FQuadTree::StorageQuadTreeBox::StorageQuadTreeBox(long ll,StorageQuadTreeBox *nn) { len = ll; n = nn; b = new QuadTreeBox[ll]; for (int i = 0; i n) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = IJ(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; i0 += I_IJ(k,hb2); // i orign of QuadTreeBox j0 += J_IJ(k,hb2); // j orign of QuadTreeBox hb = hb2; } if ( n0 > 0) { for(int k=0;kv[k]; if (v->ninside(P)) { I2 i2 = R2ToI2(v); // try if is in the right sens -- h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 n>0 ?(int) b->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; L1: do { // walk on the tree b= pb[l]; while (pi[l]--) // loop on 4 element of the box { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { Vertex * v=b->v[k]; if (v->ninside(P) ) { NbVerticesSearch++; I2 i2 = R2ToI2(v); // if good sens when try -- h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 b[k])) { hb >>=1 ; // div by 2 long iii = ii[l]+I_IJ(k,hb); long jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); if (!vn && b != root ) {// cas particulier on repart du sommet on avais rien trouver b=root; hb = MaxISize; i0=0; j0=0; l=0; pb[0]= b; pi[0]= b->n>0 ?(int) b->n : 4 ; ii[0]=i0; jj[0]=j0; goto L1; } return vn; } #endif freefem++-3.61-1/src/femlib/CheckPtr.cpp000644 000767 000024 00000043054 13256636774 020065 0ustar00hechtstaff000000 000000 //#define SHOWALLOC //#define NCHECKPTR // BUg with MPI ??? FH /* #if __cplusplus >= 201103L #define PARAM_THROW(i) (i) #define PARAM_NOTHROW(i) (i,nothrow) noexcept #define DCLPARAM_NOTHROW(i) (i,const std::nothrow_t& nothrow_constant) noexcept #define DLDCLPARAM_NOTHROW(i) (i,const std::nothrow_t& nothrow_constant) noexcept #define DCLPARAM_THROW(i) (i) noexcept #else #define PARAM_THROW(i) (i) throw(std::bad_alloc); #define PARAM_NOTHROW(i) (i,nothrow) throw() #define DCLPARAM_NOTHROW(i) (i,const std::nothrow_t& nothrow_constant) throw() #define DLDCLPARAM_NOTHROW(i) (i,const std::nothrow_t& nothrow_constant) throw() #define DCLPARAM_THROW(i) (i) throw(std::bad_alloc) #endif 98: // nothrow void* operator new (std::size_t size) throw (std::bad_alloc); void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) throw(); void operator delete[] (void* ptr) throw(); void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw(); 11: void* operator new (std::size_t size); void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept; p */ #if __APPLE__ #include #else #include #endif static long verbosity; static long StorageUsed() { #if MALLOC_ZONE_SPECIFIC_FLAGS struct mstats mem1; mem1 = mstats(); return mem1.bytes_used; #elif M_MMAP_THRESHOLD struct mallinfo mem1; mem1=mallinfo(); return mem1.uordblks; #else return 0; #endif } #ifndef NCHECKPTR #define DEBUGUNALLOC 1 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include void debugalloc() { } void debugunalloc() { static long count=0; // debugalloc(); count++;} void exitalloc(int i) { static long count=0; count++; exit(1); } // Modif: Juin 2001 for debuging missing delete point // -- THE MACRO // TO SHOW ALL ALLOCATION // #define SHOWALLOC // TO DEBUG ALL UN DELETE POINETUR int UnShowAlloc =1; int ShowAlloc(const char *s,size_t & lg); //inline void *operator new(size_t, void *place) { return place; } static int kerr=0; void * mymalloc(size_t l) { char *p = (char*)malloc(l+16); if (!p) return p; for( int i = 0; i < 8 ; i++) p[i] = 'a'+i,p[i+l+8] = 'z'-i; // put a marque before return (void*) (p+8); } void myfree(char *p,size_t l=0,int nordre=0) { if(p) { p -= 8; int k =0; for( int i = 0; i < 8 ; i++) { if (p[i] != 'a' +i) k++; if(l && (p[i+l+8] != 'z' -i)) k++; } for (size_t i=0;ir) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } class AllocData {public: OneAlloc *a; AllocData * next; AllocData(); ~AllocData(); private: AllocData(const AllocExtern::AllocData&); void operator=(const AllocExtern::AllocData&); }; private: static const long Maxundelptr = 2048; static size_t StorageUsage; static size_t AllocSize ; static size_t MaxUsedSize; static AllocData * AllocHead ; static long NbAlloc; static long NbAllocShow; static long NbPtr; static void * NextFree; static long NbuDelPtr; static long uDelPtr[Maxundelptr]; static bool after_end; static char filename[128]; AllocData * NewAllocData(); OneAlloc *Alloc(); static const int nblastalloc=20; static OneAlloc * LastAlloc[nblastalloc]; public: static bool CheckAlloc ; void * MyNewOperator(size_t ll,bool is_array ); void MyDeleteOperator(void * pp,bool is_array); AllocExtern(); ~AllocExtern(); void init(); int ShowAlloc( const char *s,size_t & lg); bool IsUnDelPtr(long nn) { // dichotomic find long i=0; long j=NbuDelPtr-1; while (i<=j) { long k = (i+j)/2, kn=uDelPtr[k]; if ( nn kn) i = k+1; else return true;} return false; } }; static AllocExtern AllocExternData; size_t AllocExtern::StorageUsage=0; size_t AllocExtern::AllocSize =0; size_t AllocExtern::MaxUsedSize =0; AllocExtern::AllocData * AllocExtern::AllocHead =0; long AllocExtern::NbAlloc =0; long AllocExtern::NbAllocShow=0; long AllocExtern::NbPtr =0; void * AllocExtern::NextFree =0; long AllocExtern::NbuDelPtr =0; long AllocExtern::uDelPtr[Maxundelptr]; bool AllocExtern::after_end =false; bool AllocExtern::CheckAlloc = true; char AllocExtern::filename[128] ="ListOfUnAllocPtr.bin"; AllocExtern::OneAlloc * AllocExtern::LastAlloc[nblastalloc]; AllocExtern::AllocData * AllocExtern::NewAllocData() { AllocExtern::AllocData * ad = (AllocData *) mymalloc(sizeof(AllocData)); ad->a = (OneAlloc*) mymalloc(sizeof(OneAlloc)*N100); for (int i=0;ia[i].l=0,ad->a[i].p=NextFree,NextFree = & ad->a[i]; ad->next = AllocHead; AllocHead = ad; #ifdef SHOWALLOC printf("\t\tCheckPtr: OneAlloc[100] %lx\n",this); #endif return ad; } AllocExtern::OneAlloc * AllocExtern::Alloc() { OneAlloc * f = (OneAlloc *) NextFree; if (!f) AllocHead = NewAllocData(); f =(OneAlloc *) NextFree; if (!f) exitalloc(1); NextFree = f->p; return f; } void * AllocExtern::MyNewOperator(size_t ll,bool is_array) { if(after_end || !CheckAlloc) return malloc(ll); init(); AllocExtern::OneAlloc * a = Alloc(); a->p = mymalloc(ll); a->l = ll+1; // pour les allocation null a->n = ++NbAlloc; a->is_array = is_array; LastAlloc[NbPtr%nblastalloc] = a; NbPtr++; AllocSize += ll; #ifdef DEBUGUNALLOC if ( (IsUnDelPtr(a->n) && (a->n >= DEBUGUNALLOC) )) debugunalloc(); #endif #ifdef SHOWALLOC printf( "\t%d\tCheckPtr: New Alloc %ld %lx when %ld\n ",a->n, ll, a->p, a->n); #endif MaxUsedSize = AllocSize < MaxUsedSize ? MaxUsedSize : AllocSize; if( !ll && !a->p) { if(verbosity>2) { printf("\t\tCheckPtrMem Full Exit(10) New Alloc %ld %p when %ld\n ", ll, a->p, a->n); printf ("\t\tCheckPtr:Max Memory used %10.3f kbytes " , MaxUsedSize/1024. ); printf (" Memory undelete %ld \n" , AllocSize); } exitalloc(1); } return (void*) ((char*)a->p); } void AllocExtern::MyDeleteOperator(void * pp,bool is_array) { if(after_end) { /*free(pp)*/; return;} if( !AllocExtern::CheckAlloc) {free(pp); return;} init(); for( int i=0; i< nblastalloc; ++i) { if( (NbPtr-i) <0) break; int k =(NbPtr-i)%nblastalloc; if (LastAlloc[k] && LastAlloc[k]->l>0 && LastAlloc[k]->p ==pp) { AllocExtern::OneAlloc * pa=LastAlloc[k]; LastAlloc[k]=0; size_t ll = pa->l-1; for (size_t kkk=0;kkkn); #ifdef SHOWALLOC printf("\t%d\tCheckPtr: fast delete Alloc %ld %lx when %ld \n",pa->n,pa->l-1, pa->p, pa->n); #endif AllocSize -= ll; NbPtr--; pa->l=0; pa->p = NextFree; pa->n =0; if (pa->is_array != is_array) printf("\t\tCheckPtr: erreur delete [] \n"); //if( pa->n < NbAllocShow ) debugalloc(); NextFree = & pa->p; return; } } if (AllocHead) { AllocExtern::AllocData *p = AllocHead; int kloop=0; while (p) { for (int i=0;ia[i].l > 0) && (p->a[i].p == pp)) { #ifdef SHOWALLOC printf("\t%d\tCheckPtr: delete Alloc %ld %lx when %ld \n",p->a[i].n,p->a[i].l-1, p->a[i].p, p->a[i].n); #endif size_t ll = p->a[i].l-1; for (size_t kkk=0;kkka[i].n); AllocSize -= ll; NbPtr--; p->a[i].l=0; p->a[i].p = NextFree; p->a[i].n =0; if (p->a[i].is_array != is_array) printf("\t\tCheckPtr: erreur delete [] \n"); //if( p->a[i].n < NbAllocShow ) debugalloc(); NextFree = & p->a[i].p; return;} if(p == p->next || kloop++ > 10000) { printf("\n\n ****CheckPTR Big BUG ??????? loop %d\n",kloop); break; } p = p->next; } if(pp) { printf( "\t\tCheckPtr: delete of bad pointer %p -----------\n",pp); debugalloc(); } } else myfree((char*)pp); } void AllocExtern::init() { static int count=0; if(0== (count++)) { sprintf(filename,"ListOfAllocPtr-%d.bin",(int) sizeof(void*)); StorageUsage=0; AllocSize =0; MaxUsedSize =0; AllocHead =0; NbAlloc =0; NbPtr =0; NextFree =0; NbuDelPtr =0; NbuDelPtr = 0; after_end = false; for(int i=0; i 100000000 && NbuDelPtr <0) { printf("Fatal error in the file %s is wrong (please remove)",filename); exit(1); } fclose(file); } else { // printf("fopen ListOfUnAllocPtr errno = %d\n",errno); } } } AllocExtern::AllocExtern() { init(); } AllocExtern::~AllocExtern() { if(UnShowAlloc==0) return; OneAlloc * list[Maxundelptr]; AllocData * p=AllocHead; int k=0,kk=0; int lln=0; while (p) {int i=N100; while(i--) if (p->a[i].l >0 ) { if ( p->a[i].n >= p->a[i].n) lln = p->a[i].n; if ( p->a[i].n <= NbAllocShow ) k++; else if (kka+i; } p = p->next; } k+=kk; kk=kk < Maxundelptr ? kk : Maxundelptr; HeapSort(list,kk); if(verbosity > 2) for (int i= kk-10<0 ? 0 : kk-10 ;ip,list[i]->l,list[i]->n); } if (kk) { FILE *file=fopen(filename,"wb"); if (file) { NbuDelPtr=kk; for (int i=0;in; fwrite(&NbuDelPtr,sizeof(long),1,file); fwrite(uDelPtr,sizeof(long),NbuDelPtr,file); fclose(file); } } else {} if(verbosity>2) { if(k) printf ("\t\tCheckPtr:Nb of undelete pointer is %d last %d\n",k,lln); printf ("\t\tCheckPtr:Max Memory used %10.3f kbytes " , MaxUsedSize/1024. ); printf (" Memory undelete %ld \n" , AllocSize); } // clean store pointer p=AllocHead; while (p) { myfree((char*)p->a); AllocData * pold = p; p = p->next; myfree((char*)pold); } AllocHead=0; after_end=true; } // ------------------ void * operator new(std::size_t ll,const std::nothrow_t& nothrow_constant) throw() { void * p = AllocExternData.MyNewOperator(ll,false); if (ll && !p) { printf("EXIT BECAUSE MEMORY FULL \n"); exitalloc(1); }; return p;} void * operator new[](std::size_t ll,const std::nothrow_t& nothrow_constant) throw() { void * p = AllocExternData.MyNewOperator(ll,true); if (ll && !p) { printf("EXIT BECAUSE MEMORY FULL \n"); exitalloc(1); }; return p;} void *operator new(std::size_t ll) throw(std::bad_alloc) { void * p = AllocExternData.MyNewOperator(ll,false); if (ll && !p) { printf("THROW BECAUSE MEMORY FULL \n"); std::bad_alloc exception; throw exception; }; return p;} void *operator new[] (std::size_t ll) throw(std::bad_alloc) { void * p = AllocExternData.MyNewOperator(ll,true); if (ll && !p) { printf("THROW BECAUSE MEMORY FULL \n"); std::bad_alloc exception; throw exception; }; return p;} void operator delete(void * pp,const std::nothrow_t& nothrow_constant) throw() { AllocExternData.MyDeleteOperator(pp,false);} void operator delete[] (void * pp,const std::nothrow_t& nothrow_constant) throw() { AllocExternData.MyDeleteOperator(pp,true);} void operator delete(void * pp) throw() { AllocExternData.MyDeleteOperator(pp,false);} void operator delete[](void * pp) throw() { AllocExternData.MyDeleteOperator(pp,true);} int AllocExtern::ShowAlloc(const char *s,size_t & lg) { size_t m =StorageUsage; StorageUsage =StorageUsed(); if (!NbAllocShow) {NbAllocShow=NbAlloc;} if(verbosity > 2) printf ("----------CheckPtr:-----%s------ NbUndelPtr %ld Alloc: %ld NbPtr %ld Mem Usage: %zu diff: %ld\n",s,NbPtr,AllocSize,NbAlloc,StorageUsage,(long)(StorageUsage-m)); lg = AllocSize; return NbPtr; } int ShowAlloc(const char *s,size_t & lg) { return AllocExternData.ShowAlloc(s,lg);} void WithoutCheckPtr(){AllocExtern::CheckAlloc=false;} void WithCheckPtr(){AllocExtern::CheckAlloc=true;} #else #define XXXX #ifdef XXXX #include #include #include #include #include long CheckPtr___nbptr=0; size_t CheckPtr___memoryusage =0; void * operator new(std::size_t size,const std::nothrow_t& nothrow_constant) throw() { CheckPtr___nbptr++; void *p = malloc( size ); if(verbosity > 1000000 ) std::cout << " CheckPtr: new nothrow" << CheckPtr___nbptr << " " << size << " p =" << p < 1000000 ) std::cout << " CheckPtr: new[] nothrow" << CheckPtr___nbptr << " " << size << " p =" << p < 1000000 ) std::cout << " CheckPtr: new throw " << CheckPtr___nbptr << " " << size << " p =" << p < 1000000 ) std::cout << " CheckPtr: new[] throw" << CheckPtr___nbptr << " " << size << " p =" << p < 1000000 ) std::cout << " CheckPtr: free nothrow " << CheckPtr___nbptr-1 << " p =" << p < 1000000 ) std::cout << " CheckPtr: free[] thow" << CheckPtr___nbptr-1 << " p =" << p < 1000000 ) std::cout << " CheckPtr: free throw " << CheckPtr___nbptr-1 << " p =" << p < 1000000 ) std::cout << " CheckPtr: free[] throw " << CheckPtr___nbptr-1 << " p =" << p < 0 && CheckPtr___memoryusage!=0 && m != CheckPtr___memoryusage) printf("CheckPtr: Warning memory leak with malloc = %ld \n ",diff); CheckPtr___memoryusage=m; lg = 0; return CheckPtr___nbptr;} void WithoutCheckPtr(){} void WithCheckPtr(){} int UnShowAlloc =0; #else #include int ShowAlloc(const char *s,size_t & lg) {lg=0; return 0;} int UnShowAlloc =0; void WithoutCheckPtr(){} void WithCheckPtr(){} #endif #endif freefem++-3.61-1/src/femlib/Mesh2dn.hpp000644 000767 000024 00000007570 13256636774 017672 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model mesh 2d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef MESH2DN_HPP_ #define MESH2DN_HPP_ namespace Fem2D { #include "R2.hpp" } #include "GenericMesh.hpp" #include #include using namespace std; namespace Fem2D { typedef GenericVertex Vertex2; struct DataTriangle2 { static const int NbOfVertices =3; static const int NbOfFaces =1; static const int NbOfEdges =3; static const int NT =0; static const int NbOfAdjElem =NbOfVertices; static const int NbOfVertexOnHyperFace =NbOfVertices-1; typedef Vertex2 V; typedef V::Rd Rd ; static R mesure( V * pv[NbOfVertices]) { return det(*pv[0],*pv[1],*pv[2])*0.5; } typedef R2 RdHat; typedef R1 RdHatBord; static RdHat PBord(const int * nvb,const RdHatBord & P) { return RdHat::KHat[nvb[0]]*(1-P.x)+R2::KHat[nvb[1]]*(P.x) ;} // static const int (* const nvface)[3];// = nvfaceTria ; //static const int (* const nvedge)[2];// = nvedgeTrai; }; struct DataSeg2 { static const int NbOfVertices =2; static const int NbOfEdges =1; static const int NbOfFaces =0; static const int NT =0; static const int NbOfAdjElem =NbOfVertices; static const int NbOfVertexOnHyperFace =NbOfVertices-1; typedef Vertex2 V; typedef V::Rd Rd; static R mesure( V * pv[NbOfVertices]) { return R2(*pv[0],*pv[1]).norme(); } typedef R1 RdHat; typedef R0 RdHatBord; static RdHat PBord(const int * nvb,const RdHatBord &P) { return RdHat(*nvb) ;} //static const int (* const nvface)[3];// = nvfaceSeg ; //static const int (* const nvedge)[2];// = nvedgeSeg; }; class Triangle2: public GenericElement { public: Triangle2() {}; // constructor empty for array R2 H(int i) const { ASSERTION(i>=0 && i <3); R2 E=Edge(i);return E.perp()/(2.*this->mesure());} // heigth void Gradlambda(R2 * GradL) const { GradL[1]= H(1); GradL[2]= H(2); GradL[0]=-GradL[1]-GradL[2]; } }; class BoundaryEdge2: public GenericElement { public: BoundaryEdge2() {}; // constructor empty for array }; template void GSave2(FILE * ff,const Mesh & Th) ; class Mesh2 : public GenericMesh { public: Mesh2(const char *); // Mesh2(int nnv, int nnt, int nnbe, Vertex2 *vv, Triangle2 *tt, BoundaryEdge2 *bb); const Element * Find( R2 P, R2 & Phat,bool & outside,const Element * tstart) const; int Save(const string & filename); //int Popen(const FILE *namestream); Mesh2(FILE *f); void GSave(FILE * f) const { return GSave2(f,*this);} void GRead(FILE * f); private: int load(const string & filename); Mesh2(const Mesh2 &); // pas de construction par copie void operator=(const Mesh2 &);// pas affectation par copy }; } #endif freefem++-3.61-1/src/femlib/Makefile.am000644 000767 000024 00000002054 13256636774 017705 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. EXTRA_DIST=BamgFreeFem.cpp BamgFreeFem.hpp CGNL.hpp CheckPtr.cpp \ ConjuguedGradrientNL.cpp DOperator.hpp Drawing.cpp Element_P2h.cpp \ Element_RT.cpp fem3.hpp fem.cpp fem.hpp FESpace.cpp \ FESpace.hpp FESpace-v0.cpp FQuadTree.cpp FQuadTree.hpp gibbs.cpp \ glutdraw.cpp gmres.hpp MatriceCreuse.hpp MatriceCreuse_tpl.hpp \ MeshPoint.hpp mortar.cpp mshptg.cpp QuadratureFormular.cpp \ QuadratureFormular.hpp RefCounter.hpp RNM.hpp RNM_opc.hpp RNM_op.hpp \ RNM_tpl.hpp R1.hpp R2.hpp R3.hpp \ FESpacen.cpp \ FESpacen.hpp \ P012_1d.cpp \ P012_2d.cpp \ P012_3d.cpp \ PkLagrange.hpp \ Mesh1dn.cpp \ Mesh1dn.hpp \ Mesh2dn.cpp \ Mesh2dn.hpp \ Mesh3dn.cpp \ Mesh3dn.hpp \ HashTable.hpp \ Label.hpp \ assertion.hpp \ GenericMesh.hpp \ GQuadTree.hpp \ GQuadTree.cpp \ HeapSort.hpp \ libmesh5.c \ libmesh5.h \ ufunction.hpp \ splitsimplex.cpp InvIntFunc.cpp splitsimplex.hpp freefem++-3.61-1/src/femlib/Drawing.cpp000644 000767 000024 00000046672 13256636774 017766 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include "error.hpp" #include #include #include #include #include "rgraph.hpp" #include "RNM.hpp" #include "fem.hpp" #include "FESpacen.hpp" #include "FESpace.hpp" namespace Fem2D { void NewSetColorTable(int nb,float *colors=0,int nbcolors=0,bool hsv=true); void NewSetColorTable(int nb,float *colors,int nbcolors,bool hsv) { if(colors && nbcolors) SetColorTable1(nb,hsv,nbcolors,colors); else SetColorTable(nb); } int dichotomie(const RN_ &viso,R v) { int i=0,j=viso.N(),k; if (v viso[j-1]) return -1; while (i v) j=k; else i=k; return i; } void plot(long i) { char buf[24]; snprintf(buf,24,"%ld",i); plotstring(buf); } void plot(int i) { char buf[24]; snprintf(buf,24,"%d",i); plotstring(buf); } void plot(double i) { char buf[24]; snprintf(buf,24,"%g",i); plotstring(buf); } void DrawIsoT(const R2 Pt[3],const R ff[3],const RN_ & Viso); void DrawIsoTfill(const R2 Pt[3],const R ff[3],const RN_ & Viso,double rapz); void FillRect(float x0,float y0, float x1, float y1) { float r[8]; r[0]=x0;r[1]=y0; r[2]=x1;r[3]=y0; r[4]=x1;r[5]=y1; r[6]=x0;r[7]=y1; fillpoly(4,r); } void PlotValue(const RN_ & Viso,int k0,const char * cmm) { float xmin,xmax,ymin,ymax; // cout << "PlotValue " << Viso << endl; // int ix,iy; // GetSizeScreen(ix,iy); getcadre(xmin,xmax,ymin,ymax); float dx=(xmax-xmin); float dy=(ymax-ymin); // 10 points // int kk = Max(30,iy/10); float h=GetHeigthFont(); float x0=xmin+dx*0.8; float y= ymin+dy*0.95; // cout << x0 << " " << y << " " << h << endl; y -= k0* h*1.4; couleur(0); FillRect(x0-h*0.5,y-h*(1.4*Viso.N()+0.3),x0+h*9,y+h*1.5); couleur(1); rmoveto(x0+1.2*h,y); plotstring(cmm); y -= h*1.4; for (int i=0;i0) InitDraw(); SetColorTable(16) ; for (int i=0;i0) kk=ArrowSize/100.; R cc = d*0.05; int nsb = nbsubdivision(); int nsb2 = NbOfSubTriangle(nsb); int nbdf=NbDoF(); RN fk(nbdf); RN gk(nbdf); for (int i=0;i cc) uv = uv*(cc/l); MoveTo(P[j]); LineTo(P[j]+uv); if (l>kk) { LineTo(P[j]+uv+dd+dn); MoveTo(P[j]+uv+dd-dn); LineTo(P[j]+uv);} } } } } void DrawIsoT(const R2 Pt[3],const R ff[3],const RN_ & Viso) { R2 PQ[5]; int NbIso = Viso.N(); for(int l=0;l< NbIso;l++) /* loop on the level curves */ { R xf = Viso[l]; int im=0; for(int i=0;i<3;i++) // for the 3 edges { int j = (i+1)%3; R fi=(ff[i]); R fj=(ff[j]); if(((fi<=xf)&&(fj>=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)<=0.1e-10) /* one side must be drawn */ { couleur(l+4); MoveTo(Pt[i]); LineTo(Pt[j]); } else { R xlam=(fi-xf)/(fi-fj); PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } } if (im>=2) /* draw one segment */ { couleur(l+4); MoveTo(PQ[0]); LineTo(PQ[1]); } } } void DrawIsoTfill(const R2 Pt[3],const R ff[3],const RN_ & Viso,double rapz) { R2 PQ[10]; int NbIso = Viso.N(); R eps= (Viso[NbIso-1]-Viso[0])*1e-6; for(int l=1;l< NbIso;l++) // loop on the level curves { R xfb = Viso[l-1]; R xfh = Viso[l]; int im=0; for(int i=0;i<3;i++) // for the 3 edges { int j=(i+1)%3; R fi=(ff[i]); R fj=(ff[j]); R xxfb = xfb; R xxfh = xfh; if (fj=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } xf = xxfh; if(((fi<=xf)&&(fj>=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } if ( xfb-eps <=fj && fj <= xfh+eps) PQ[im++] = Pt[j]; } if (im>2) { float f[20]; int k=0; for (int i=0;i void TBoundaryEdge::Draw() const { couleur(2+(lab%6)); MoveTo(*vertices[0]); LineTo(*vertices[1]); } template void FElement::SaveDraw(const KN_ & U,int composante,R* Usave) const { int nsb = nbsubdivision(); int nsbv = NbOfSubInternalVertices(nsb); int nbdf=NbDoF(); KN fk(nbdf); for (int i=0;i void FElement::SaveDraw(const KN_ & U,const KN_ & V,int iU,int iV,R * Usave) const { int nsb = nbsubdivision(); int nsbv = NbOfSubInternalVertices(nsb); int nbdf=NbDoF(); KN fk(nbdf); KN gk(nbdf); for (int i=0;i KN FESpace::newSaveDraw(const KN_ & U,int composante,int & lg,int & nsb) const { nsb = TFE[0]->nbsubdivision; int nsbv = NbOfSubInternalVertices(nsb); lg = nsbv*Th.nt; if(verbosity>99) cout << " ++ newSaveDraw what: nt " << Th.nt << " " << nsbv << " " << lg << endl; KN v(lg); ffassert(v); for (int k=0,i=0;k(true,v);// to remove the copy. } template KN FESpace::newSaveDraw(const KN_ & U,const KN_ & V,int iU,int iV,int & lg,int & nsb) const { nsb = TFE[0]->nbsubdivision; int nsbv = NbOfSubInternalVertices(nsb)*2; lg = nsbv*Th.nt; KN v(lg); for (int k=0,i=0;k(true,v);// to remove the copy. } typedef complex Complex; template KN FESpace::newSaveDraw(const KN_ & U,const KN_ & V,int iU,int iV,int & lg,int & nsb) const ; template KN FESpace::newSaveDraw(const KN_ & U,int composante,int & lg,int & nsb) const ; template KN FESpace::newSaveDraw(const KN_ & U,const KN_ & V,int iU,int iV,int & lg,int & nsb) const ; template KN FESpace::newSaveDraw(const KN_ & U,int composante,int & lg,int & nsb) const ; void FESpace::Draw(const RN_& U,const RN_ & Viso,int j,float *colors,int nbcolors,bool hsv,bool drawborder) const { showgraphic(); NewSetColorTable(Viso.N()+4,colors,nbcolors,hsv); for (int k=0;k& U,const KN_& V,int j0,int j1,bool bb) const { R2 Pminmax(1e100,-1e100); for (int k=0;k& U,int j0,bool bb) const { R2 Pminmax(1e100,-1e100); for (int k=0;k& U,const RN_ & Viso, R coef,int j0,int j1,float *colors,int nbcolors,bool hsv,bool drawborder,double ArrowSize) const { showgraphic(); NewSetColorTable(Viso.N()+5,colors,nbcolors,hsv); for (int k=0;k& U,const KN_& V,const RN_ & Viso, R coef,int iu,int iv,float *colors,int nbcolors,bool hsv,bool drawborder,double ArrowSize) const { showgraphic(); NewSetColorTable(Viso.N()+5,colors,nbcolors,hsv); for (int k=0;k void TTriangle::Draw(double skrink) const { const TTriangle & K(*this); R2 A(K[0]),B(K[1]),C(K[2]),G((A+B+C)/3.); A = G + (A-G)*skrink; B = G + (B-G)*skrink; C = G + (C-G)*skrink; MoveTo(A); LineTo(B); LineTo(C); LineTo(A); } template void TTriangle::Draw(int edge,double skrink) const { const TTriangle & K(*this); R2 A(K[0]),B(K[1]),C(K[2]),G((A+B+C)/3.); MoveTo(G+(*vertices[(edge+1)%3]-G)*skrink); LineTo(G+(*vertices[(edge+2)%3]-G)*skrink); } template void TTriangle::Draw(double skrink) const; template void TTriangle::Draw(int edge,double skrink) const; template void TTriangle::Fill(int color) const { const TTriangle & K(*this); R2 A(K[0]),B(K[1]),C(K[2]); float p[]={(float)A.x,(float)A.y,(float)B.x,(float)B.y,(float)C.x,(float)C.y}; int c=LaCouleur(); couleur(color); fillpoly(3,p); couleur(c); } void DrawMark(R2 P,R k) { float x0,x1,y0,y1; getcadre(x0,x1,y0,y1); float h= (x1-x0)*(float)k; rmoveto((float)P.x+h,(float)P.y-h); rlineto((float)P.x+h,(float)P.y+h); rlineto((float)P.x-h,(float)P.y+h); rlineto((float)P.x-h,(float)P.y-h); rlineto((float)P.x+h,(float)P.y-h); } Triangle * Mesh::Find(const R2 & P) const { // brute force for (int i=0;i-eps && b >-eps && c >-eps) return triangles + i; } return 0; // outside } template void TMortar::Draw() const { throwassert(Th); for (int i=0;i #include #include #include #include #include #include using namespace std; #include "error.hpp" #include "ufunction.hpp" #include "Mesh3dn.hpp" #include "Mesh2dn.hpp" #include "Mesh1dn.hpp" #include "RNM.hpp" #include "QuadratureFormular.hpp" namespace Fem2D { template class GFESpace; template class GFElement; template class GbaseFElement; template class GTypeOfFE; // numbering of derivative enum operatortype { op_id=0, op_dx=1,op_dy=2, op_dxx=3,op_dyy=4, op_dyx=5,op_dxy=5, op_dz=6, op_dzz=7, op_dzx=8,op_dxz=8, op_dzy=9,op_dyz=9 }; typedef unsigned int What_d; const unsigned int Fop_id= 1<< op_id; const unsigned int Fop_dx= 1<< op_dx; const unsigned int Fop_dy= 1<< op_dy; const unsigned int Fop_dz= 1<< op_dz; const unsigned int Fop_dxx= 1<< op_dxx; const unsigned int Fop_dxy= 1<< op_dxy; const unsigned int Fop_dxz= 1<< op_dxz; const unsigned int Fop_dyx= 1<< op_dyx; const unsigned int Fop_dyy= 1<< op_dyy; const unsigned int Fop_dyz= 1<< op_dyz; const unsigned int Fop_dzx= 1<< op_dzx; const unsigned int Fop_dzy= 1<< op_dzy; const unsigned int Fop_dzz= 1<< op_dzz; const unsigned int Fop_D0 = Fop_id; const unsigned int Fop_D1 = Fop_dx | Fop_dy | Fop_dz; const unsigned int Fop_D2 = Fop_dxx | Fop_dyy | Fop_dzz | Fop_dxy | Fop_dxz | Fop_dyz; const unsigned int Fop_Dall = Fop_D0| Fop_D1| Fop_D2; inline What_d Fwhatd(const operatortype op) { return 1<< op;} const int last_operatortype=10; const bool operatortypeValue[last_operatortype]= {true,false,false,false,false,false,false,false,false,false} ; inline void initwhatd(bool *whatd,int k) { for (int i=0;i RN_; typedef KN RN; typedef KNM_ RNM_; typedef KNMK_ RNMK_; typedef KNMK RNMK; template class GFElement; template class GFESpace; templateclass GTypeOfFE ; class dataTypeOfFE { private: const int * data; const int * dataalloc; public: const int ndfonVertex; const int ndfonEdge; const int ndfonFace; const int ndfonVolume; const int NbDoF; const int NbNode; int N,nb_sub_fem; const int nbsubdivision; // nb of subdivision for plot const bool discontinue; int const * const DFOnWhat; int const * const DFOfNode; // nu du df on Node int const * const NodeOfDF; // nu du node du df int const * const fromFE; // the df come from df of FE int const * const fromDF; // the df come from with FE int const * const fromASubFE; // avril 2006 for CL int const * const fromASubDF; // avril 2006 for CL int const * const dim_which_sub_fem; // from atomic sub FE for CL const int * ndfOn() const { return & ndfonVertex;} dataTypeOfFE(const int *nnitemdim,const int dfon[4],int NN,int nbsubdivisionn,int nb_sub_femm=1,bool discon=true); // pour evite un template // nitemdim : nbitem : si d==2 3,3,1,0 , si d=3: 4,6,4,1 , si d==1 = 2,1,0,0 // dfon : nombre de df par item // NN dataTypeOfFE(const int nitemdim[4],const KN< dataTypeOfFE const *> & tef); virtual ~dataTypeOfFE(){ if(dataalloc) delete [] dataalloc;} }; template class InterpolationMatrix { public: const int N,np,ncoef; bool invariant; int k; KN P; KN coef; KN comp; KN p; KN dofe; template InterpolationMatrix(const GFESpace &Vh); template InterpolationMatrix(const GTypeOfFE & tef); template void set(const GFElement & FK); private: // copie interdit ... InterpolationMatrix(const InterpolationMatrix &); void operator=(const InterpolationMatrix &); }; template ostream & operator<<(ostream& f,const InterpolationMatrix &M) { f<< M.N << " "<< M.k << " "<< M.np << " "<< M.ncoef << endl; f<< " = " << M.P ; f << "coef=" <& U,const KN_& Viso,int j=0,float *colors=0,int nbcolors=0,bool hsv=true,bool drawborder=true) const ; // Draw iso line void Drawfill(const KN_& U,const KN_& Viso,int j=0,double rapz=1,float *colors=0,int nbcolors=0,bool hsv=true,bool drawborder=true) const ; // Draw iso line void Draw(const KN_& U,const KN_ & Viso, R coef,int j0=0,int j1=1,float *colors=0,int nbcolors=0,bool hsv=true,bool drawborder=true) const ; // Arrow void Draw(const KN_& U,const KN_& V,const KN_ & Viso, R coef,int iu=0,int iv=0,float *colors=0,int nbcolors=0,bool hsv=true,bool drawborder=true) const ; // Arrow Rd MinMax(const KN_& U,const KN_& V,int j0,int j1,bool bb=true) const ; Rd MinMax(const KN_& U,int j0, bool bb=true) const ; // void destroy() {RefCounter::destroy();} */ bool isFEMesh() const { return ! NodesOfElement && ( N==1) ;} // to make optim template KN newSaveDraw(const KN_ & U,int composante,int & lg,KN &Psub,KN &Ksub,int op_U=0) const ; private: // for gibbs int gibbsv (long* ptvoi,long* vois,long* lvois,long* w,long* v); }; template inline GbaseFElement::GbaseFElement( const GFESpace &aVh, int k) : Vh(aVh),T(Vh.Th[k]),tfe(aVh.TFE[k]),N(aVh.N),number(k){} template inline GbaseFElement::GbaseFElement(const GbaseFElement & K, const GTypeOfFE & atfe) : Vh(K.Vh),T(K.T),tfe(&atfe),N(Vh.N),number(K.number){} template GFElement::GFElement(const GFESpace * VVh,int k) : GbaseFElement(*VVh,k) , p(this->Vh.PtrFirstNodeOfElement(k)), nb(this->Vh.NbOfNodesInElement(k)) {} template inline int GFElement::operator[](int i) const { return p ? p[i] : ((&this->T[i])-this->Vh.Th.vertices);} template inline int GFElement::operator()(int i,int df) const { return this->Vh.FirstDFOfNode(p ? p[i] : ((&this->T[i])-this->Vh.Th.vertices)) + df;} template inline int GFElement::NbDoF(int i) const { int node =p ? p[i] : ((&this->T[i])-this->Vh.Th.vertices); return this->Vh.LastDFOfNode(node)-this->Vh.FirstDFOfNode(node);} template inline void GFElement::BF(const Rd & P,RNMK_ & val) const { this->tfe->FB(Fop_D0|Fop_D1,this->Vh.Th,this->T,P,val);} template inline void GFElement::BF(const What_d whatd,const Rd & P,RNMK_ & val) const { this->tfe->FB(whatd,this->Vh.Th,this->T,P,val);} //template // inline void GFElement::set(InterpolationMatrix &M) const { this->tfe->set(this->Vh.Th,this->T,&M);} template inline R GFElement::operator()(const Rd & PHat, const KN_ & u,int i,int op) const { return (*this->tfe)(*this,PHat,u,i,op); } template inline complex GFElement::operator()(const RdHat & PHat,const KN_ > & u,int i,int op) const { complex * pu=u; // pointeur du tableau double *pr = static_cast(static_cast(pu)); const KN_ ur(pr,u.n,u.step*2); const KN_ ui(pr+1,u.n,u.step*2); return complex((*this->tfe)(*this,PHat,ur,i,op),(*this->tfe)(*this,PHat,ui,i,op)); } template R GTypeOfFE::operator()(const GFElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const { KNMK fb(NbDoF,N,last_operatortype); // the value for basic fonction KN fk(NbDoF); for (int i=0;i class GTypeOfFESum: public GTypeOfFE { public: typedef GFElement FElement; typedef typename Mesh::Element Element; typedef typename Element::RdHat RdHat; typedef typename Mesh::Rd Rd; const int k; KN *> teb; KN NN,DF,comp,numPtInterpolation; GTypeOfFESum(const KN< GTypeOfFE const *> & t); GTypeOfFESum(const GFESpace **,int kk); GTypeOfFESum(const GFESpace &,int kk); void Build(); // the true constructor void init(InterpolationMatrix & M,FElement * pK=0,int odf=0,int ocomp=0,int *pp=0) const; void set(const Mesh & Th,const Element & K,InterpolationMatrix & M,int ocoef,int odf,int *nump ) const; // no change by deflaut void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, KNMK_ & val) const ; ~GTypeOfFESum(){} } ; template void GTypeOfFESum::FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, KNMK_ & val) const { val=0.0; SubArray t(val.K()); for (int i=0;iFB(whatd,Th,K,P,v); else v=val(SubArray(DF[j+1]-DF[j],DF[j]),SubArray(NN[j+1]-NN[j],NN[j]),t); } } template template InterpolationMatrix::InterpolationMatrix(const GFESpace &Vh) : N(Vh.N),np(Vh.maxNbPtforInterpolation),ncoef(Vh.maxNbcoefforInterpolation), invariant(Vh.TFE.constant() ? Vh.TFE[0]->invariantinterpolationMatrix: false), k(-1), P(np), comp(ncoef), p(ncoef), dofe(ncoef) { Vh.TFE[0]->GTypeOfFE::init(*this,0,0,0,0); } template template InterpolationMatrix::InterpolationMatrix(const GTypeOfFE & tef) : N(tef.N),np(tef.NbPtforInterpolation),ncoef(tef.NbcoefforInterpolation), invariant(tef.invariantinterpolationMatrix), k(-1), P(np), comp(ncoef), p(ncoef), dofe(ncoef) { // virtual void init(InterpolationMatrix & M,FElement * pK=0,int odf=0,int ocomp=0,int *pp=0) const tef.GTypeOfFE::init(*this,0,0,0,0); } template template void InterpolationMatrix::set(const GFElement & FK) { if(k==FK.number) return; k=FK.number; if(invariant) return; FK.set(*this); //assert(invariant); // a faire ... } typedef GTypeOfFE TypeOfFE3; typedef GTypeOfFE TypeOfFE3; typedef GFESpace FESpace3; typedef GFESpace FESpace2; typedef GFElement FElement3; typedef GFElement FElement2; typedef GFElement FElement3; typedef GbaseFElement baseFElement2; typedef GbaseFElement baseFElement3; } #endif freefem++-3.61-1/src/femlib/fem.hpp000644 000767 000024 00000056651 13256636774 017145 0ustar00hechtstaff000000 000000 #ifndef FEM2_H_ #define FEM2_H_ #include #include #include "RefCounter.hpp" #include "Serialize.hpp" // some usefull function //typedef double R; template class KN_; const double Pi = 3.14159265358979323846264338328; /* template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} template inline T Abs (const T &a){return a <0 ? -a : a;} template inline void Exchange (T& a,T& b) {T c=a;a=b;b=c;} template inline T Max (const T &a,const T & b,const T & c){return Max(Max(a,b),c);} template inline T Min (const T &a,const T & b,const T & c){return Min(Min(a,b),c);} */ //#include "ufunction.hpp" #include "ufunction.hpp" #include #include #include // ALH - 21/10/13 - R1.hpp needs cmath and it does include it, but since R1.hpp is only included as part of namespace // Fem2D, we need to make sure that cmath is called as part of the default namespace, otherwise we will get "error: // ‘::acos’ has not been declared" and such. #include // definition R namespace Fem2D { inline double norm(double x){return x*x;} inline float norm(float x){return x*x;} template T norm(const complex &x){return std::norm(x);} // ALH - These include files are located inside the namespace definition on purpose? #include "R1.hpp" #include "R2.hpp" #include "R3.hpp" inline void MoveTo(R2 P) { rmoveto((float) P.x,(float)P.y);} inline void LineTo(R2 P) { rlineto((float)P.x,(float)P.y);} inline R Area2(const R2 A,const R2 B,const R2 C){return (B-A)^(C-A);} inline R Theta(R2 P){ return atan2(P.y,P.x);} /* inline R2 Minc(const R2 & A,const R2& B) { return R2(Min(A.x,B.x),Min(A.y,B.y));} inline R2 Maxc(const R2 & A,const R2& B) { return R2(Max(A.x,B.x),Max(A.y,B.y));} inline R3 Minc(const R3 & A,const R3& B) { return R3(Min(A.x,B.x),Min(A.y,B.y),Min(A.z,B.z));} inline R3 Maxc(const R3 & A,const R3& B) { return R3(Max(A.x,B.x),Max(A.y,B.y),Max(A.z,B.z));} inline R2 Minc(const R2 & A,const R2& B,const R2& C) { return R2(Min(A.x,B.x,C.x),Min(A.y,B.y,C.y));} inline R2 Maxc(const R2 & A,const R2& B,const R2& C) { return R2(Max(A.x,B.x,C.x),Max(A.y,B.y,C.y));} inline R3 Minc(const R3 & A,const R3& B,const R3& C) { return R3(Min(A.x,B.x,C.x),Min(A.y,B.y,C.y),Min(A.z,B.z,C.z));} inline R3 Maxc(const R3 & A,const R3& B,const R3& C) { return R3(Max(A.x,B.x,C.x),Max(A.y,B.y,C.y),Max(A.z,B.z,C.z));} */ // def de numerotation dans un triangles direct sens (trigo) // the edge is oposite of the vertex //// [3] is a edge //#include struct SortedTriplet { static const int empty = -1; int i1,i2,i3; SortedTriplet(int j1,int j2=empty, int j3=empty) : i1(j1), i2(j2),i3(j3) { if(i1> template class TVertex : public Rd,public Label { friend class Mesh; Rd *normal; // pointeur sur la normal exterieur pour filtre les // point de depart public: TVertex() : Rd(),Label(),normal(0){}; TVertex(Rd P,int r=0): Rd(P),Label(r),normal(0){} bool ninside(const Rd & P) const { return normal? (Rd(*this,P),*normal)<=0: true;} void SetNormal(Rd *&n,const Rd & N) { if (normal) { Rd NN=*normal+N; *normal= NN/Norme2(NN); } else *(normal=n++)=N;} Rd Ne() const {return normal ? *normal: Rd();} // void operator=(const TVertex & v) { x=v.x;y=v.y;lab=v.lab;normal=0;} }; typedef TVertex Vertex; template inline ostream& operator <<(ostream& f, const TVertex & v ) { f << (Rd) v << ' ' << (Label) v ; return f; } template inline istream& operator >> (istream& f, TVertex & v ) { f >> (Rd&) v >> (Label&) v ; return f; } class Tetraedre: public Label { public: typedef TVertex Vertex; private: Vertex *vertices[4]; // an array of 3 pointer to vertex public: R volume; Tetraedre(){}; // constructor empty for array static const int NbWhat = 15; // 4+6+4+1 static const int NbV =4; static const int NbE =6; static const int NbF =4; Vertex & operator[](int i) const// to see triangle as a array of vertex {return *vertices[i];} Vertex *& operator()(int i) // to see triangle as a array of vertex {return vertices[i];} Tetraedre(Vertex * v0,int i0,int i1,int i2,int i3,int r,R a=0.0): Label(r) { set(v0,i0,i1,i2,i3,r,a); } void set(Vertex * v0,int i0,int i1,int i2,int i3,int r,R a=0.0) { R3 A=*(vertices[0]=v0+i0); R3 B=*(vertices[1]=v0+i1); R3 C=*(vertices[2]=v0+i2); R3 D=*(vertices[3]=v0+i3); lab = r; volume = a ==0 ? det(R3(A,B),R3(A,C),R3(A,D))/6. : a; throwassert(volume>0);} Vertex & Face(int j,int i) const // Vertex j of ace i {assert(j<=0 && j < 3 && i <=0 && i < 4) ;return *vertices[v_tet_face[i][j] ];} R3 N2areaInternal(int i) const { return R3(*vertices[v_tet_face[i][0]],*vertices[v_tet_face[i][1]]) ^R3(*vertices[v_tet_face[i][0]],*vertices[v_tet_face[i][2]]) ; } R3 n(int i) const // unit exterior normal {R3 Ni=N2areaInternal(i);return Ni/-Norme2(Ni);} R3 H(int i) const // heigth ($\nabla \lambda_i$ {R3 Ni=N2areaInternal(i);return Ni/(3.*volume);} R3 Edge(int i) const // edge i { return (R3) *vertices[v_tet_edge[i][1]]-(R3) *vertices[v_tet_edge[i][0]];} Vertex & Edge(int j,int i) const // Vertex j of edge i {assert(j<=0 && j < 2 && i <=0 && i < 4) ;return *vertices[v_tet_edge[i][j]];} R lenEdge(int i) const {R3 E=Edge(i);return sqrt((E,E));} R h() const { return Max( Max(lenEdge(0),lenEdge(1),lenEdge(2)), Max(lenEdge(3),lenEdge(4),lenEdge(5)) );} void Renum(Vertex *v0, long * r) { for (int i=0;i<4;i++) vertices[i]=v0+r[vertices[i]-v0];} Vertex & VerticeOfEdge(int i,int j) const // vertex j of edge i {return *vertices[v_tet_edge[i][j]];} // vertex j of edge i R EdgeOrientation(int i) const { // return +1 or -1 R Orient[2]={-1.,1.}; return Orient[vertices[v_tet_edge[i][0]] < vertices[v_tet_edge[i][1]] ] ;} void SetVertex(int j,Vertex *v){vertices[j]=v;} R3 operator() (const R3 & P) const{ // local to Global in triangle return (const R3 &) *vertices[0] * (1-P.x-P.y-P.z) + (const R3 &) *vertices[1] * (P.x) + (const R3 &) *vertices[2] * (P.y) ; + (const R3 &) *vertices[3] * (P.z) ;} SortedTriplet what(int i,Vertex *v0,Tetraedre * t0) { if (i<0) ffassert(i>=0); else if (i<4) return SortedTriplet(vertices[i]-v0); else if( (i-=4)<6) return SortedTriplet( &Edge(0,i)-v0, &Edge(1,i)-v0); else if( (i-=6)<4) return SortedTriplet( &Face(0,i)-v0, &Face(1,i)-v0, &Face(2,i)-v0) ; else if(i==0) return SortedTriplet(vertices[0]-v0,this-t0,-2); else ffassert(0); return 0; } private: Tetraedre(const Tetraedre &); // no copy of triangle void operator=(const Tetraedre &); }; template class TTriangle: public Label { public: typedef TVertex Vertex; private: Vertex *vertices[3]; // an array of 3 pointer to vertex public: static const int NbWhat = 7; // 3+3+1 static const int NbV = 3; // 3+3+1 static const int NbE = 3; // R area; TTriangle(){}; // constructor empty for array Vertex & operator[](int i) const// to see triangle as a array of vertex {return *vertices[i];} Vertex *& operator()(int i) // to see triangle as a array of vertex {return vertices[i];} TTriangle(Vertex * v0,int i0,int i1,int i2,int r,R a=0.0): Label(r) { Rd A=*(vertices[0]=v0+i0); Rd B=*(vertices[1]=v0+i1); Rd C=*(vertices[2]=v0+i2); area = a ==0 ? (( B-A)^(C-A))*0.5 : a; throwassert(area>0);} void set(Vertex * v0,int i0,int i1,int i2,int r,R a=0.0) { lab=r; Rd A=*(vertices[0]=v0+i0); Rd B=*(vertices[1]=v0+i1); Rd C=*(vertices[2]=v0+i2); area = a ==0 ? (( B-A)^(C-A))*0.5 : a; ffassert(area>0);} Rd Edge(int i) const // opposite edge vertex i {return (Rd) *vertices[(i+2)%3]-(Rd) *vertices[(i+1)%3];} Vertex & Edge(int j,int i) const // Vertex j of edge i {throwassert(j==0 || j==1 );return *vertices[(i+j+1)%3];} // il y a un problem sur d=3 ici ---- Rd n(int i) const // unit exterior normal {Rd E=Edge(i);return Rd(E.y,-E.x)/Norme2(E);} Rd H(int i) const // heigth ($\nabla \lambda_i$ {Rd E=Edge(i);return Rd(-E.y,E.x)/(2*area);} // ------ R lenEdge(int i) const {Rd E=Edge(i);return sqrt((E,E));} R lenEdge2(int i) const {Rd E=Edge(i);return ((E,E));} R h() const { return sqrt(Max(lenEdge2(0),lenEdge2(1),lenEdge2(2)));} R h_min() const { return sqrt(Min(lenEdge2(0),lenEdge2(1),lenEdge2(2)));} SortedTriplet what(int i,Vertex *v0,TTriangle * t0) { if (i<0) ffassert(i>=0); else if (i<3) return SortedTriplet(vertices[i]-v0); else if( (i-=3)<3) return SortedTriplet( &Edge(i,0)-v0, &Edge(i,1)-v0); else if( i==0 ) return SortedTriplet( vertices[0]-v0, vertices[1]-v0, vertices[2]-v0) ; else ffassert(0); } void Renum(Vertex *v0, long * r) { for (int i=0;i<3;i++) vertices[i]=v0+r[vertices[i]-v0];} Vertex & VerticeOfEdge(int i,int j) const // vertex j of edge i {return *vertices[(i+1+j)%3];} // vertex j of edge i R EdgeOrientation(int i) const { // return +1 or -1 R Orient[2]={-1.,1.}; return Orient[vertices[ (i+1)%3] < vertices[ (i+2)%3] ] ;} bool intersect(Rd P,Rd Q) const { const Rd &A(*vertices[0]); const Rd &B(*vertices[1]); const Rd &C(*vertices[2]); Rd mn(Minc(A,B,C)), mx(Maxc(A,B,C)); assert(P.x < Q.x && P.y < Q.y ); return (mx.x >= P.x) && (mn.x <= Q.x) && (mx.y >= P.y) && (mn.y <= Q.y) ; } // const Vertex & VerticeOfEdge(int i,int j) const {return *vertices[(i+1+j)%3];} void Draw(double shink=1) const; void Fill(int color) const; void Draw(int edge,double shink=1) const; void SetVertex(int j,Vertex *v){vertices[j]=v;} Rd operator() (const Rd & P) const{ // local to Global in triangle return (const Rd &) *vertices[0] * (1-P.x-P.y) + (const Rd &) *vertices[1] * (P.x) + (const Rd &) *vertices[2] * (P.y) ;} private: TTriangle(const TTriangle &); // no copy of triangle void operator=(const TTriangle &); }; typedef TTriangle Triangle; template class TBoundaryEdge: public Label { public: typedef TVertex Vertex; static const int NbWhat = 3; // 3+3+1 static const int NbV = 2; // 3+3+1 static const int NbE = 1; // Vertex *vertices[2]; TBoundaryEdge(Vertex * v0,int i0,int i1,int r): Label(r) { vertices[0]=v0+i0; vertices[1]=v0+i1; } void set(Vertex * v0,int i0,int i1,int r) { lab=r,vertices[0]=v0+i0; vertices[1]=v0+i1; } bool in(const Vertex * pv) const {return pv == vertices[0] || pv == vertices[1];} TBoundaryEdge(){}; // constructor empty for array void Draw() const; Vertex & operator[](int i) const {return *vertices[i];} R length() const { return Norme2(R2(*vertices[0],*vertices[1]));} void Renum(Vertex *v0, long * r) { for (int i=0;i<2;i++) vertices[i]=v0+r[vertices[i]-v0];} SortedTriplet what(int i,Vertex *v0,TBoundaryEdge * t0) { if (i<0) ffassert(i>=0); else if (i<2) return SortedTriplet(vertices[i]-v0); else if( i==0 ) return SortedTriplet( vertices[0]-v0, vertices[1]-v0) ; else ffassert(0); } }; typedef TBoundaryEdge BoundaryEdge; typedef BoundaryEdge Edge; // typedef Tetraedre Tet; // just to play template class TMortar { public: typedef TVertex Vertex; friend class Mesh; friend class ConstructDataFElement; Mesh * Th; int nleft,nright; int *left,*right; TMortar(): Th(0),nleft(0),nright(0),left(0),right(0){} void Draw() const; public: int NbLeft() const{return nleft;} int NbRight() const{return nright;} int TLeft(int i) const { return left[i]/3;} // int NbT() const {return nleft+nright;} int T_e(int i,int & e) const { // return the triangle number + the edge number throwassert(i>=0 && i < nleft+nright); int k= (i Mortar; class FQuadTree; // <> class Mesh: public RefCounter { public: typedef TTriangle Triangle; typedef TTriangle Element; typedef BoundaryEdge BorderElement; typedef TVertex Vertex; typedef R2 Rd; typedef R2 RdHat;// for parametrization typedef Rd::R R; typedef FQuadTree GTree; static const char magicmesh[8] ; int dim; int nt,nv,neb,ne,ntet; R area; R volume; R lenbord; static int kthrough,kfind; FQuadTree *quadtree; Vertex *vertices; Triangle *triangles; BoundaryEdge *bedges; Edge *edges; // edge element Tetraedre * tet; // int nbElmts() const {return nt;} int nbBrdElmts() const {return neb;} int nbVertices() const {return nv;} int NbMortars,NbMortarsPaper; Mortar *mortars; // list of mortar int *datamortars; R2 * bnormalv; // boundary vertex normal //Triangle * adj; Triangle & operator[](int i) const {throwassert(i>=0 && i=0 && i=0;p=BoundaryAdjacencesLink[p]) { if ( !bedges[p2=p/2].in(vertices+j) ) return p2; } return -1;} // Add J. Morice int nTonEdge(int it,int e) const { int k=3*it+e;return k==TheAdjacencesLink[k] ? 1 : 2;} void VerticesNumberOfEdge(const Triangle & T,int j,int & j0,int & j1) const {j0 = number(T[(j+1)%3]),j1= number(T[(j+ 2)%3]);} bool SensOfEdge(const Triangle & T,int j) const { return number(T[(j+1)%3]) =0 && tabk[i]!=it) i++; tabk[i]=TheAdjacencesLink[3*it+1]/3; if(tabk[i] >=0 && tabk[i]!=it) i++; tabk[i]=TheAdjacencesLink[3*it+2]/3; if(tabk[i] >=0 && tabk[i]!=it) i++; return i; } int BoundaryElement(int bbe,int & edgeInT) const { int i= BoundaryEdgeHeadLink[bbe]; edgeInT = i%3; return i/3;} Triangle * Find(const R2 & P) const ; const Triangle * Find(R2 P, R2 & Phat,bool & outside,const Triangle * tstart=0) const ; BoundaryEdge * TheBoundaryEdge(int i,int j) const { int p2; for (int p=BoundaryAdjacencesHead[i];p>=0;p=BoundaryAdjacencesLink[p]) { if ( bedges[p2=p/2].in(vertices+j) ) return bedges+p2; } return 0;} int NumberOfTheBoundaryEdge(int i,int j) const { int p2; for (int p=BoundaryAdjacencesHead[i];p>=0;p=BoundaryAdjacencesLink[p]) { if ( bedges[p2=p/2].in(vertices+j) ) return p2; } return -1;}// Add J. Morice void destroy() const {RefCounter::destroy();} void MakeQuadTree() ; private: void read(const char * filename); void read(ifstream & f,bool bin=false); void BuildBoundaryAdjacences(); void ConsAdjacence(); void Buildbnormalv(); void BuilTriangles(bool empty,bool removeoutside=true); // to construct the adj triangle int *TheAdjacencesLink; int *BoundaryEdgeHeadLink; int *BoundaryAdjacencesHead; int *BoundaryAdjacencesLink; int *TriangleConteningVertex; // <> the copy constructor for Mesh is kept private on purpose Mesh(const Mesh &); void operator=(const Mesh &); }; // 2 routines to compute the caracteristic int WalkInTriangle(const Mesh & Th,int it, double *lambda, const KN_ & U,const KN_ & V, R & dt); int WalkInTriangle(const Mesh & Th,int it, double *lambda, R u, R v, R & dt); int Walk(const Mesh & Th,int & it, R *l, const KN_ & U,const KN_ & V, R dt) ; void DrawMark(R2 P,R k=0.02); template void HeapSort(T *c,long n) { long l,j,r,i; T crit; c--; // on decale de 1 pour que le tableau commence a 1 if( n <= 1) return; l = n/2 + 1; r = n; while (1) { // label 2 if(l <= 1 ) { // label 20 crit = c[r]; c[r--] = c[1]; if ( r == 1 ) { c[1]=crit; return;} } else crit = c[--l]; j=l; while (1) {// label 4 i=j; j=2*j; if (j>r) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } template void HeapSort(T *c,T1 *c1,T2 *c2,long n) { long l,j,r,i; T crit; T1 crit1; T2 crit2; c--;c1--;c2--; // on decale de 1 pour que le tableau commence a 1 if( n <= 1) return; l = n/2 + 1; r = n; while (1) { // label 2 if(l <= 1 ) { // label 20 crit = c[r]; crit1 = c1[r]; crit2 = c2[r]; c2[r] = c2[1]; c1[r] = c1[1]; c[r--] = c[1]; if ( r == 1 ) { c2[1] = crit2, c1[1] = crit1; c[1]=crit; return;} } else {crit = c[--l];crit1=c1[l];crit2=c2[l]; } j=l; while (1) {// label 4 i=j; j=2*j; if (j>r) {c[i]=crit;c1[i]=crit1;c2[i]=crit2;break;} // L8 -> G2 if ((j G2 } } } inline int numSubTVertex(int N,int i,int j) { // i,j coordonne barycentre * N dans l'eleùent de reference. i=i+j; // numerotation / diag // i,j assert(j<=i && 0<= j); return j+i*(i+1)/2; } inline void num1SubTVertex(int N,int l,int & i,int & j) { i= (int) ((-1 + sqrt(1.+8*l))/2); // modif gcc 3.3.3 FH 100109 j = l - i*(i+1)/2; // io=in+j; // in = io-j i=i-j; assert( l == numSubTVertex(N,i,j)); } R2 SubTriangle(const int N,const int n,const int l); int numSubTriangle(const int N,const int n,const int l); int NbOfSubTriangle(const int N); int NbOfSubInternalVertices(int kk); R2 SubInternalVertex(int N,int k); // warning i is in [0, nleft] template inline TVertex & TMortar::VLeft(int i) const { throwassert(i>=0 && i <= nleft); return i< nleft ? (*Th)[TLeft( i )][VerticesOfTriangularEdge[ELeft(i)][0]] : (*Th)[TLeft( i-1)][VerticesOfTriangularEdge[ELeft(i-1)][1]];} template inline TVertex & TMortar::VRight(int i) const { throwassert(i>=0 && i <= nright); return i< nright ? (*Th)[TRight( i )][VerticesOfTriangularEdge[ERight(i)][1]] : (*Th)[TRight( i-1)][VerticesOfTriangularEdge[ERight(i-1)][0]];} void DrawCommentaire(const char *cm,float x=0.1,float y=0.97) ; inline R2 minmax(const R2 & a,const R2 & b) {return R2(Min(a.x,b.x),Max(a.y,b.y));} } using Fem2D::R; #include "FQuadTree.hpp" namespace Fem2D { inline void Mesh::MakeQuadTree() { if (!quadtree) { R2 Pn,Px; BoundingBox(Pn,Px); quadtree=new FQuadTree(this,Pn,Px,nv); } } } #endif freefem++-3.61-1/src/femlib/fem3.hpp000644 000767 000024 00000000011 13256636774 017203 0ustar00hechtstaff000000 000000 to removefreefem++-3.61-1/src/femlib/Element_RT.cpp000644 000767 000024 00000055177 13256636774 020371 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include "error.hpp" #include #include #include #include "rgraph.hpp" using namespace std; #include "RNM.hpp" #include "fem.hpp" #include "FESpace.hpp" namespace Fem2D { class TypeOfFE_RT : public TypeOfFE { public: static int Data[]; TypeOfFE_RT(): TypeOfFE(0,1,0,2,Data,1,1,6,3) {const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; for (int p=0,kk=0;p<3;p++) { P_Pi_h[p]=Pt[p]; for (int j=0;j<2;j++) pij_alpha[kk++]= IPJ(p,p,j); }} // void FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; void FB(const bool * watdd, const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void D2_FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int, void *) const; void Pi_h_alpha(const baseFElement & K,KN_ & v) const ; } ; // on what nu df on node node of df int TypeOfFE_RT::Data[]={3,4,5, 0,0,0, 0,1,2, 0,0,0, 0,1,2, 0,0, 0,0,3,3}; /* void TypeOfFE_RT::D2_FB(const Mesh & ,const Triangle & ,const R2 & ,RNMK_ & val) const { // val=0; }*/ /* void TypeOfFE_RT::FB(const Mesh & Th,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==2 ); throwassert(val.K()==3 ); RN_ f0(val('.',0,0)); RN_ f1(val('.',1,0)); val=0; // RN_ df0(val(0,'.',0)); // RN_ fy(val('.','.',2)); // a_i ([x,y]-c_i) , ou c_i = A,B , C si i= 0,1,2 // int_T a_i div([x,y]-c_i) = 1 // div div([x,y]-c_i) = 2 // donc a_i = 1/(2 area T) R a=1./(2*K.area); R a0= K.EdgeOrientation(0) * a ; R a1= K.EdgeOrientation(1) * a ; R a2= K.EdgeOrientation(2) * a ; // if (Th(K)< 2) cout << Th(K) << " " << A << " " << B << " " << C << "; " << a0 << " " << a1 << " "<< a2 << endl;; // ------------ f0[0] = (P.x-A.x)*a0; f1[0] = (P.y-A.y)*a0; f0[1] = (P.x-B.x)*a1; f1[1] = (P.y-B.y)*a1; f0[2] = (P.x-C.x)*a2; f1[2] = (P.y-C.y)*a2; // ---------------- // ---------------- // BUG dans RT correct FH le 17 sept 2002 // dx [x,y] = [1,0] et non [1,1] // dy [x,y] = [0,1] et non [1,1] // ------------------------------------- val(0,0,1) = a0; val(1,0,1) = a1; val(2,0,1) = a2; val(0,1,2) = a0; val(1,1,2) = a1; val(2,1,2) = a2; } */ void TypeOfFE_RT::FB(const bool *whatd,const Mesh & Th,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); // R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==2 ); // throwassert(val.K()==3 ); val=0; R a=1./(2*K.area); R a0= K.EdgeOrientation(0) * a ; R a1= K.EdgeOrientation(1) * a ; R a2= K.EdgeOrientation(2) * a ; // if (Th(K)< 2) cout << Th(K) << " " << A << " " << B << " " << C << "; " << a0 << " " << a1 << " "<< a2 << endl;; // ------------ if (whatd[op_id]) { assert(val.K()>op_id); RN_ f0(val('.',0,0)); RN_ f1(val('.',1,0)); f0[0] = (P.x-A.x)*a0; f1[0] = (P.y-A.y)*a0; f0[1] = (P.x-B.x)*a1; f1[1] = (P.y-B.y)*a1; f0[2] = (P.x-C.x)*a2; f1[2] = (P.y-C.y)*a2; } // ---------------- // BUG dans RT correct FH le 17 sept 2002 // dx [x,y] = [1,0] et non [1,1] // dy [x,y] = [0,1] et non [1,1] // ------------------------------------- if (whatd[op_dx]) { assert(val.K()>op_dx); val(0,0,op_dx) = a0; val(1,0,op_dx) = a1; val(2,0,op_dx) = a2; } if (whatd[op_dy]) { assert(val.K()>op_dy); val(0,1,op_dy) = a0; val(1,1,op_dy) = a1; val(2,1,op_dy) = a2; } } /* void TypeOfFE_RT::Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int j, void * arg) const { const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; const Triangle & T(K.T); // if (K.number<2) cout << K.number << ": " ; for (int i=0;i<3;i++) { f(v,T(Pt[i]),K,i,Pt[i],arg); R2 E(T.Edge(i)); R signe = T.EdgeOrientation(i) ; val[i]= signe*(v[j]*E.y-v[j+1]*E.x); // if (K.number<2) cout << val[i] << " " ; } // if (K.number<2) cout << endl; } */ void TypeOfFE_RT::Pi_h_alpha(const baseFElement & K,KN_ & v) const { const Triangle & T(K.T); for (int i=0,k=0;i<3;i++) { R2 E(T.Edge(i)); R signe = T.EdgeOrientation(i) ; v[k++]= signe*E.y; v[k++]=-signe*E.x; } } // ------------------- class TypeOfFE_RTmodif : public TypeOfFE { public: static int Data[]; TypeOfFE_RTmodif(): TypeOfFE(0,1,0,2,Data,1,1,6,3) {const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; for (int p=0,kk=0;p<3;p++) { P_Pi_h[p]=Pt[p]; for (int j=0;j<2;j++) pij_alpha[kk++]= IPJ(p,p,j); }} // void FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; void FB(const bool * whatd, const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void D2_FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int, void *) const; void Pi_h_alpha(const baseFElement & K,KN_ & v) const ; } ; // on what nu df on node node of df int TypeOfFE_RTmodif::Data[]={3,4,5, 0,0,0, 0,1,2, 0,0,0, 0,1,2, 0,0, 0,0, 3,3}; void TypeOfFE_RTmodif::FB(const bool * whatd,const Mesh & Th,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); R la=1-PHat.x-PHat.y,lb=PHat.x,lc=PHat.y; R2 Dla(K.H(0)), Dlb(K.H(1)), Dlc(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==2 ); R2 AB(A,B),AC(A,C),BA(B,A),BC(B,C),CA(C,A),CB(C,B); R aa0= 1./(((AB,Dlb) + (AC,Dlc))*K.area); R aa1= 1./(((BA,Dla) + (BC,Dlc))*K.area); R aa2= 1./(((CA,Dla) + (CB,Dlb))*K.area); int i=0; R a0= &K[ (i+1)%3] < &K[ (i+2)%3] ? aa0 : -aa0 ; i=1; R a1= &K[ (i+1)%3] < &K[ (i+2)%3] ? aa1 : -aa1 ; i=2; R a2= &K[ (i+1)%3] < &K[ (i+2)%3] ? aa2 : -aa2 ; // if (Th(K)< 2) cout << Th(K) << " " << A << " " << B << " " << C << "; " << a0 << " " << a1 << " "<< a2 << endl;; R2 Va= AB*(lb*a0) + AC*(lc*a0); R2 Vb= BA*(la*a1) + BC*(lc*a1); R2 Vc= CA*(la*a2) + CB*(lb*a2); R2 Va_x= AB*(Dlb.x*a0) + AC*(Dlc.x*a0); R2 Vb_x= BA*(Dla.x*a1) + BC*(Dlc.x*a1); R2 Vc_x= CA*(Dla.x*a2) + CB*(Dlb.x*a2); R2 Va_y= AB*(Dlb.y*a0) + AC*(Dlc.y*a0); R2 Vb_y= BA*(Dla.y*a1) + BC*(Dlc.y*a1); R2 Vc_y= CA*(Dla.y*a2) + CB*(Dlb.y*a2); if( whatd[op_id]) { RN_ f0(val('.',0,0)); RN_ f1(val('.',1,0)); f0[0] = Va.x; f1[0] = Va.y; f0[1] = Vb.x; f1[1] = Vb.y; f0[2] = Vc.x; f1[2] = Vc.y; } // ---------------- if( whatd[op_dx]) { val(0,0,1) = Va_x.x; val(0,1,1) = Va_x.y; val(1,0,1) = Vb_x.x; val(1,1,1) = Vb_x.y; val(2,0,1) = Vc_x.x; val(2,1,1) = Vc_x.y; } if( whatd[op_dy]) { val(0,0,2) = Va_y.x; val(0,1,2) = Va_y.y; val(1,0,2) = Vb_y.x; val(1,1,2) = Vb_y.y; val(2,0,2) = Vc_y.x; val(2,1,2) = Vc_y.y; } } void TypeOfFE_RTmodif::Pi_h_alpha(const baseFElement & K,KN_ & v) const { const Triangle & T(K.T); for (int i=0,k=0;i<3;i++) { R2 E(T.Edge(i)); R signe = &T[ (i+1)%3] < &T[ (i+2)%3] ? 1.0 : -1.0 ; v[k++]= signe*E.y; v[k++]=-signe*E.x; } } // --------------------- class TypeOfFE_P0 : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P0(): TypeOfFE(0,0,1,1,Data,1,1,1,1,Pi_h_coef){ pij_alpha[0]=IPJ(0,0,0); P_Pi_h[0]=R2(1./3.,1./3.); } void FB(const bool * watdd, const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; }; // on what nu df on node node of df int TypeOfFE_P0::Data[]={6, 0, 0, 0 , 0 ,0, 0, 1 }; double TypeOfFE_P0::Pi_h_coef[]={1.0}; void TypeOfFE_P0::FB(const bool* whatd,const Mesh & ,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); //R l0=1-P.x-P.y,l1=P.x,l2=P.y; R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); throwassert(val.N() >=1); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; if ( whatd[op_id]) val(0,0,0) =1; } // ------ P1 non conforme -------- class TypeOfFE_P1ncLagrange : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P1ncLagrange(): TypeOfFE(0,1,0,1,Data,1,1,3,3,Pi_h_coef) { const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; for (int i=0;i=3); throwassert(val.M()==1 ); val=0; if (whatd[op_id]) { RN_ f0(val('.',0,0)); // f0[0] = double(l0 <= min(l1,l2) ); // arete f0[1] = double(l1 <= min(l0,l2) ); f0[2] = double(l2 <= min(l0,l1) ); } } /* class TypeOfFE_P1Edge : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; TypeOfFE_P1Edge(): TypeOfFE(0,2,0,1,Data,3,1,12,6,Pi_h_coef) { R2 Pt[6] ; int kk=0; for(int i=0;i<3;++i) for(int j=0;i=0) pij_alpha[kk++]= IPJ(i,other[i],0); P_Pi_h[i]=Pt[i]; } } void FB(const bool * whatd, const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; } ; // on what nu df on node node of df int TypeOfFE_ConsEdge::Data[]={3,4,5, 0,0,0, 0,1,2, 0,0,0, 0,1,2, 0, 0,3}; double TypeOfFE_ConsEdge::Pi_h_coef[]={1.,1.,1.}; void TypeOfFE_ConsEdge::FB(const bool * whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); val=0; if (whatd[op_id]) { RN_ f0(val('.',0,0)); // f0[0] = double(l0 <= min(l1,l2) ); // arete f0[1] = double(l1 <= min(l0,l2) ); f0[2] = double(l2 <= min(l0,l1) ); } } */ void TypeOfFE_P1ncLagrange::FB(const bool * whatd,const Mesh & ,const Triangle & K,const R2 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); // l1( cshrink1*(cshrink*((1,0)-G)+G)-G)+G = 1 R l0=1-P.x-P.y,l1=P.x,l2=P.y; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; if (whatd[op_id]) { RN_ f0(val('.',0,0)); f0[0] = 1-l0*2; f0[1] = 1-l1*2; f0[2] = 1-l2*2; } if (whatd[op_dx] || whatd[op_dy] ) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = -Dl0.x*2; f0x[1] = -Dl1.x*2; f0x[2] = -Dl2.x*2; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = -Dl0.y*2; f0y[1] = -Dl1.y*2; f0y[2] = -Dl2.y*2; } } } // The RT orthogonal FE class TypeOfFE_RTortho : public TypeOfFE { public: static int Data[]; TypeOfFE_RTortho(): TypeOfFE(0,1,0,2,Data,1,1,6,3) {const R2 Pt[] = { R2(0.5,0.5), R2(0.0,0.5), R2(0.5,0.0) }; for (int p=0,kk=0;p<3;p++) { P_Pi_h[p]=Pt[p]; for (int j=0;j<2;j++) pij_alpha[kk++]= IPJ(p,p,j); }} void FB(const bool * watdd, const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; void Pi_h_alpha(const baseFElement & K,KN_ & v) const ; } ; // on what nu df on node node of df int TypeOfFE_RTortho::Data[]={3,4,5, 0,0,0, 0,1,2, 0,0,0, 0,1,2, 0,0, 0,0, 3,3}; void TypeOfFE_RTortho::FB(const bool *whatd,const Mesh & Th,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); //R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==2 ); // throwassert(val.K()==3 ); val=0; R a=1./(2*K.area); R a0= K.EdgeOrientation(0) * a ; R a1= K.EdgeOrientation(1) * a ; R a2= K.EdgeOrientation(2) * a ; // if (Th(K)< 2) cout << Th(K) << " " << A << " " << B << " " << C << "; " << a0 << " " << a1 << " "<< a2 << endl;; // ------------ if (whatd[op_id]) { assert(val.K()>op_id); RN_ f0(val('.',0,0)); RN_ f1(val('.',1,0)); f1[0] = (P.x-A.x)*a0; f0[0] = -(P.y-A.y)*a0; f1[1] = (P.x-B.x)*a1; f0[1] = -(P.y-B.y)*a1; f1[2] = (P.x-C.x)*a2; f0[2] = -(P.y-C.y)*a2; } // ---------------- if (whatd[op_dx]) { assert(val.K()>op_dx); val(0,1,op_dx) = a0; val(1,1,op_dx) = a1; val(2,1,op_dx) = a2; } if (whatd[op_dy]) { assert(val.K()>op_dy); val(0,0,op_dy) = -a0; val(1,0,op_dy) = -a1; val(2,0,op_dy) = -a2; } } void TypeOfFE_RTortho::Pi_h_alpha(const baseFElement & K,KN_ & v) const { const Triangle & T(K.T); for (int i=0,k=0;i<3;i++) { R2 E(T.Edge(i)); R signe = &T[ (i+1)%3] < &T[ (i+2)%3] ? 1.0 : -1.0 ; v[k++]= signe*E.x; v[k++]= signe*E.y; } } // ------------------- // ttdc finite element fully discontinue. // ------------------- class TypeOfFE_P1ttdc : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; static const R2 G; static const R cshrink; static const R cshrink1; // (1 -1/3)* static R2 Shrink(const R2& P){ return (P-G)*cshrink+G;} static R2 Shrink1(const R2& P){ return (P-G)*cshrink1+G;} TypeOfFE_P1ttdc(): TypeOfFE(0,0,3,1,Data,1,1,3,3,Pi_h_coef) { const R2 Pt[] = { Shrink(R2(0,0)), Shrink(R2(1,0)), Shrink(R2(0,1)) }; for (int i=0;i & u,int componante,int op) const ; } ; const R2 TypeOfFE_P1ttdc::G(1./3.,1./3.); const R TypeOfFE_P1ttdc::cshrink=1-1e-2; const R TypeOfFE_P1ttdc::cshrink1=1./TypeOfFE_P1ttdc::cshrink; class TypeOfFE_P2ttdc : public TypeOfFE { public: static int Data[]; static double Pi_h_coef[]; static const R2 G; static const R cshrink; static const R cshrink1; static R2 Shrink(const R2& P){ return (P-G)*cshrink+G;} static R2 Shrink1(const R2& P){ return (P-G)*cshrink1+G;} TypeOfFE_P2ttdc(): TypeOfFE(0,0,6,1,Data,3,1,6,6,Pi_h_coef) { const R2 Pt[] = { Shrink(R2(0,0)), Shrink(R2(1,0)), Shrink(R2(0,1)), Shrink(R2(0.5,0.5)),Shrink(R2(0,0.5)),Shrink(R2(0.5,0)) }; for (int i=0;i & u,int componante,int op) const { R2 PHat=Shrink1(P1Hat); R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r=0; if (op==0) { R l0=1-PHat.x-PHat.y,l1=PHat.x,l2=PHat.y; r = u0*l0+u1*l1+l2*u2; } else { const Triangle & T=K.T; R2 D0 = T.H(0)*cshrink1 , D1 = T.H(1)*cshrink1 , D2 = T.H(2)*cshrink1 ; if (op==1) r = D0.x*u0 + D1.x*u1 + D2.x*u2 ; else r = D0.y*u0 + D1.y*u1 + D2.y*u2 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1ttdc::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P1,RNMK_ & val) const { R2 P=Shrink1(P1); // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; if (val.N() <3) throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd[op_id]) { f0[0] = l0; f0[1] = l1; f0[2] = l2;} if (whatd[op_dx] || whatd[op_dy]) { R2 Dl0(K.H(0)*cshrink1), Dl1(K.H(1)*cshrink1), Dl2(K.H(2)*cshrink1); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } } } void TypeOfFE_P2ttdc::FB(const bool *whatd,const Mesh & ,const Triangle & K,const R2 & P1,RNMK_ & val) const { R2 P=Shrink1(P1); // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; R l4_0=(4*l0-1),l4_1=(4*l1-1),l4_2=(4*l2-1); // throwassert(FE.N == 1); throwassert( val.N()>=6); throwassert(val.M()==1); // throwassert(val.K()==3 ); val=0; // -- if (whatd[op_id]) { RN_ f0(val('.',0,op_id)); f0[0] = l0*(2*l0-1); f0[1] = l1*(2*l1-1); f0[2] = l2*(2*l2-1); f0[3] = 4*l1*l2; // oppose au sommet 0 f0[4] = 4*l0*l2; // oppose au sommet 1 f0[5] = 4*l1*l0; // oppose au sommet 3 } if( whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)*cshrink1), Dl1(K.H(1)*cshrink1), Dl2(K.H(2)*cshrink1); if (whatd[op_dx]) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl0.x*l4_0; f0x[1] = Dl1.x*l4_1; f0x[2] = Dl2.x*l4_2; f0x[3] = 4*(Dl1.x*l2 + Dl2.x*l1) ; f0x[4] = 4*(Dl2.x*l0 + Dl0.x*l2) ; f0x[5] = 4*(Dl0.x*l1 + Dl1.x*l0) ; } if (whatd[op_dy]) { RN_ f0y(val('.',0,op_dy)); f0y[0] = Dl0.y*l4_0; f0y[1] = Dl1.y*l4_1; f0y[2] = Dl2.y*l4_2; f0y[3] = 4*(Dl1.y*l2 + Dl2.y*l1) ; f0y[4] = 4*(Dl2.y*l0 + Dl0.y*l2) ; f0y[5] = 4*(Dl0.y*l1 + Dl1.y*l0) ; } if (whatd[op_dxx]) { RN_ fxx(val('.',0,op_dxx)); fxx[0] = 4*Dl0.x*Dl0.x; fxx[1] = 4*Dl1.x*Dl1.x; fxx[2] = 4*Dl2.x*Dl2.x; fxx[3] = 8*Dl1.x*Dl2.x; fxx[4] = 8*Dl0.x*Dl2.x; fxx[5] = 8*Dl0.x*Dl1.x; } if (whatd[op_dyy]) { RN_ fyy(val('.',0,op_dyy)); fyy[0] = 4*Dl0.y*Dl0.y; fyy[1] = 4*Dl1.y*Dl1.y; fyy[2] = 4*Dl2.y*Dl2.y; fyy[3] = 8*Dl1.y*Dl2.y; fyy[4] = 8*Dl0.y*Dl2.y; fyy[5] = 8*Dl0.y*Dl1.y; } if (whatd[op_dxy]) { assert(val.K()>op_dxy); RN_ fxy(val('.',0,op_dxy)); fxy[0] = 4*Dl0.x*Dl0.y; fxy[1] = 4*Dl1.x*Dl1.y; fxy[2] = 4*Dl2.x*Dl2.y; fxy[3] = 4*(Dl1.x*Dl2.y + Dl1.y*Dl2.x); fxy[4] = 4*(Dl0.x*Dl2.y + Dl0.y*Dl2.x); fxy[5] = 4*(Dl0.x*Dl1.y + Dl0.y*Dl1.x); } } } // // end ttdc // ------------------ static TypeOfFE_RTortho The_TypeOfFE_RTortho; static TypeOfFE_RT The_TypeOfFE_RT; static TypeOfFE_P0 The_TypeOfFE_P0; static TypeOfFE_P1ttdc The_TypeOfFE_P1ttdc; static TypeOfFE_P2ttdc The_TypeOfFE_P2ttdc; static TypeOfFE_RTmodif The_TypeOfFE_RTmodif; static TypeOfFE_P1ncLagrange The_TypeOfFE_P1nc; static TypeOfFE_ConsEdge The_TypeOfFE_ConsEdge; // add FH TypeOfFE & RTLagrangeOrtho(The_TypeOfFE_RTortho); TypeOfFE & RTLagrange(The_TypeOfFE_RT); TypeOfFE & RTmodifLagrange(The_TypeOfFE_RTmodif); TypeOfFE & P0Lagrange(The_TypeOfFE_P0); TypeOfFE & P1ncLagrange(The_TypeOfFE_P1nc); TypeOfFE & P1ttdc(The_TypeOfFE_P1ttdc); TypeOfFE & P2ttdc(The_TypeOfFE_P2ttdc); TypeOfFE & P0edge(The_TypeOfFE_ConsEdge); } freefem++-3.61-1/src/femlib/RNM_opc.hpp000644 000767 000024 00000006136 13256636774 017664 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: 29 fev 2000 // -*- Mode : c++ -*- // // SUMMARY : array modelisation // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ template inline KN_& KN_::operator oper (const_R a) { R * l(v); for (long i=0;i inline KNM_ & KNM_::operator oper (const_R a) { if(IsVector1() ) KN_::operator oper (a); else { KN_ lj(operator()('.',0)); // (.,.,O) for (long j=0;j inline KNMK_ & KNMK_::operator oper (const_R a) { if(IsVector1() ) KN_::operator oper (a); else { KNM_ lj(operator()('.','.',0)); // (.,.,O) long j=K(); while(j--) {lj oper a;++lj;} } return *this; } template inline KN_& KN_::operator oper (const KN_ & u) { K_throwassert(u.n == n); R * l(v); const R *r(u); for (long i=0;i inline KNM_ & KNM_::operator oper (const KNM_ & u) { K_throwassert( N() == u.N() && M() == u.M() ); if(IsVector1() && u.IsVector1() && shapei.step == u.shapei.step ) // modif 2011 (thank to Oka) KN_::operator oper(u); // modif FH jan 2004 else { KN_ lj(operator()('.',0)); // (.,O) KN_ uj(u('.',0)); long j=M(); while ( j--) { lj oper uj;++lj;++uj;} } return *this; } template inline KNMK_ & KNMK_::operator oper (const KNMK_ & u) { K_throwassert( N() == u.N() && M() == u.M() && K() == u.K() ); if(IsVector1() && u.IsVector1() && u.N() == N() && shapei.step == u.shapei.step) // modif 2011 (thank to Oka) KN_::operator oper(u); // modif FH 2004 else { K_throwassert( K() == u.K()); KNM_ lj(operator()('.','.',0)); // (.,O) KNM_ uj(u('.','.',0)); long j=K(); while (j--) { lj oper uj;++lj;++uj;} } return *this; } #undef oper freefem++-3.61-1/src/femlib/MatriceCreuse_tpl.hpp000644 000767 000024 00000147456 13256636774 022014 0ustar00hechtstaff000000 000000 #ifndef MatriceCreuse_tpl_ #define MatriceCreuse_tpl_ #ifndef MatriceCreuse_h_ #include "MatriceCreuse.hpp" #include #include #include #include #endif #ifndef __MWERKS__ // test blas // on MacOS9 under MWERKS // cblas_ddot macos-9 is not #ifdef HAVE_CBLAS_H extern "C" { #define FF_VERSION VERSION #undef VERSION #include #undef VERSION #define VERSION VERSION } #define WITHBLAS 1 #elif HAVE_VECLIB_CBLAS_H #include #define WITHBLAS 1 #endif #endif #ifdef WITHBLAS template inline R blas_sdot(const int n,const R *sx,const int incx,const R *sy,const int incy) { R s=R(); if(incx == 1 && incy == 1) for (int k = 0; k< n; k++) s += *sx++ * * sy++; else for (int k = 0; k< n; k++, sx += incx, sy += incy) s += *sx * *sy; return s; } template inline R blas_sdot( int n, R *sx, int incx, R *sy, int incy) { R s=R(); if(incx == 1 && incy == 1) for (int k = 0; k< n; k++) s += *sx++ * * sy++; else for (int k = 0; k< n; k++, sx += incx, sy += incy) s += *sx * *sy; return s; } // OpenBlas PB with constant remove const .... template<> inline float blas_sdot(const int n, float *sx, int incx, float *sy, int incy) { return cblas_sdot(n,sx,incx,sy,incy); } template<> inline double blas_sdot( int n, double *sx, int incx, double *sy, int incy) { return cblas_ddot(n,sx,incx,sy,incy); } #ifdef OPENBLAS_CONFIG_H typedef openblas_complex_double *BLAS_ptr_complex16; #else typedef void *BLAS_ptr_complex16; #endif template<> inline complex blas_sdot( int n, complex *sx, int incx, complex *sy, int incy) { complex s; cblas_zdotu_sub(n,( double *)sx,incx,( double *)sy,incy,(BLAS_ptr_complex16)&s); return s; } //template<> inline complex blas_sdot( int n, complex *sx, int incx, complex *sy, int incy) //{ // complex s; // cblas_cdotu_sub(n,( void *)sx,incx,( void *)sy,incy,(BLAS_ptr_complex8)&s); // return s; //} #endif // end modif FH using Fem2D::HeapSort; using std::numeric_limits; // ----------- template inline int BuildMEK_KK(const int l,int *p,int *pk,int *pkk,const FElement * pKE,const FElement*pKKE) { // routine which find common dof on to adjacent element pKE and pKKE and make the link .. // if pKKE== 0 then no adj element // the idea is find common dof, but this work only if all dot a different // in on elemnt, so we can have a bug // in case of periodic boundary condition .. // not correct ... F.Hecht ... // ----- // routine build les array p, pk,pkk // which return number of df int 2 element pKE an pKKE // max l size of array p, pk, pkk // p[i] is the global number of freedom // pk[i] is is the local number in pKE ( -1 if not in pKE element) // pkk[i] is is the local number in pKKE ( -1 if not in pKKE element) const FElement (*pK[2])={pKE,pKKE}; int ndf=0; // number of dl int * qk=pk, *qkk=pkk; for (int k=0;k<2;k++) if(pK[k]) { if(k) Exchange(qk,qkk); const FElement& FEK=*pK[k]; int nbdf =FEK.NbDoF(); for (int ii=0;ii=0) pkk[k]=pkk[ii]; if (pk[ii]>=0) pk[k]=pk[ii]; assert(pk[k] >=0 && pkk[k]>=0); } else { // copy if(p[k]==p[ii]) bug++; p[++k] =p[ii]; pk[k]=pk[ii]; pkk[k]=pkk[ii]; } ndf=k+1; for(int ii=0;ii void MatriceElementairePleine::call(int k,int ie,int label,void * stack,void *B) { for (int i=0;ilga;i++) this->a[i]=0; if(this->onFace) { throwassert(faceelement); const Mesh &Th(this->Vh.Th); int iie=ie,kk=Th.ElementAdj(k,iie); if(kk==k|| kk<0) kk=-1; if ( &this->Vh == &this->Uh) { FElement Kv(this->Vh[k]); if(kk<0) { // return ; // on saute ???? bof bof this->n=this->m=BuildMEK_KK(this->lnki,this->ni,this->nik,this->nikk,&Kv,0); int n2 =this->m*this->n; for (int i=0;ia[i]=0; faceelement(*this,Kv,Kv,Kv,Kv,this->data,ie,iie,label,stack,reinterpret_cast(B)); } else { FElement KKv(this->Vh[kk]); this->n=this->m=BuildMEK_KK(this->lnki,this->ni,this->nik,this->nikk,&Kv,&KKv); faceelement(*this,Kv,KKv,Kv,KKv,this->data,ie,iie,label,stack,reinterpret_cast(B)); } } else { throwassert(faceelement); const Mesh &Th(this->Vh.Th); int iie=ie,kk=Th.ElementAdj(k,iie); if(kk==k|| kk<0) kk=-1; if ( &this->Vh == &this->Uh) { FElement Kv(this->Vh[k]); FElement Ku(this->Uh[k]); if(kk<0) { // return ; // on saute ???? bof bof this->n=BuildMEK_KK(this->lnki,this->ni,this->nik,this->nikk,&Kv,0); this->m=BuildMEK_KK(this->lnkj,this->nj,this->njk,this->njkk,&Ku,0); int n2 =this->m*this->n; for (int i=0;ia[i]=0; faceelement(*this,Kv,Kv,Kv,Kv,this->data,ie,iie,label,stack,reinterpret_cast(B)); } else { FElement KKv(this->Vh[kk]); FElement KKu(this->Uh[kk]); this->n=BuildMEK_KK(this->lnki,this->ni,this->nik,this->nikk,&Kv,&KKv); this->m=BuildMEK_KK(this->lnkj,this->nj,this->njk,this->njkk,&Ku,&KKu); faceelement(*this,Ku,KKu,Kv,KKv,this->data,ie,iie,label,stack,reinterpret_cast(B)); } } ERREUR("BUG ???? A FAIRE/ TO DO (see F. hecht) ", 0); ffassert(0); // a faire F. Hecht desole } } else { throwassert(element); const FElement&Kv(this->Vh[k]); int nbdf =Kv.NbDoF(); for (int i=0;ini[i] = Kv(i); // copy the numbering this->m=this->n=nbdf; if(this->ni != this->nj) { // const FElement&Ku(this->Uh[k]); int nbdf =Ku.NbDoF(); for (int i=0;inj[i] = Ku(i); // copy the numbering this->m=nbdf; int n2 =this->m*this->n; for (int i=0;ia[i]=0; element(*this,Ku,Kv,this->data,ie,label,stack,reinterpret_cast(B)); } else { int n2 =this->m*this->n; for (int i=0;ia[i]=0; element(*this,Kv,Kv,this->data,ie,label,stack,reinterpret_cast(B)); // call the elementary mat } } } template void MatriceElementaireSymetrique::call(int k,int ie,int label,void * stack,void *B) { // mise a zero de la matrice elementaire, plus sur for (int i=0;ilga;i++) this->a[i]=0; if(this->onFace) { ffassert(0); // a faire } else { if (k< this->Uh.Th.nt) { throwassert(element); const FElement K(this->Uh[k]); int nbdf =K.NbDoF(); for (int i=0;ini[i] = K(i); // copy the numbering this->m=this->n = nbdf; element(*this,K,this->data,ie,label,stack,static_cast(B)); }// call the elementary mat else { ffassert(0); // remove code for the 3d /* throwassert(mortar); { const FMortar K(&(this->Uh),k); int nbdf = K.NbDoF(); for (int i=0;ini[i] = K(i); // copy the numbering this->m=this->n = nbdf; // mise a zero de la matrice elementaire, plus sur mortar(*this,K,stack);} */ } } } template MatriceProfile::~MatriceProfile() { if(!this->dummy) { //cout << " del mat profile " << endl ; if (U && (U !=L)) delete [] U; if (D) delete [] D; if (L) delete [] L; if (pU && (pU != pL)) delete [] pU; if (pL) delete [] pL; //cout << " dl de MatriceProfile " << this << endl; } } template int MatriceProfile::size() const { int s = sizeof(MatriceProfile); if (D) s += this->n*sizeof(R); if (pL) s += this->n*sizeof(int); if (pU && (pU != pL)) s += this->n*sizeof(int); if (L) s += pL[this->n]*sizeof(int); if (U && (U != L)) s += pU[this->n]*sizeof(int); return s; } /* template int MatriceProfile::MatriceProfile(const MatriceProfile & A ) : MatriceCreuse(A.n,A.m,0) { typefac=A.typefac; pL= docpy(A.pL,n+1); D = docpy(A.D,n); if ( A.pL == A.pU ) pU=pL; else pU= docpy(A.pU,m+1); L= docpy(A.L,pL[n]); if ( A.L == A.U ) U=L; else U= docpy(A.U,pU[m]); }*/ template MatriceMorse *MatriceProfile::toMatriceMorse(bool transpose,bool copy) const { // A FAIRE; ffassert(0); // TODO return 0; } inline pair ij_mat(bool trans,int ii00,int jj00,int i,int j) { // warning trans sub matrix and not the block. return trans ? make_pair(j+ii00,i+jj00) : make_pair(i+ii00,j+jj00) ; } template bool MatriceProfile::addMatTo(R coef,std::map< pair, R> &mij,bool trans,int ii00,int jj00,bool cnj,double threshold, const bool keepSym) { double eps0=max(numeric_limits::min(), threshold); if( RNM::norm2(coef)n;i++) if( RNM::norm2(D[i])>eps0) mij[ij_mat(trans,ii00,jj00,i,i)] += coef*(cnj? RNM::conj(D[i]) : D[i]); } else { for(int i=0;in;i++) // no dia => identity dai mij[ij_mat(trans,ii00,jj00,i,i)] += coef; } if (L && pL ) for (kf=pL[0],i=0; in; i++ ) { k=kf; kf=pL[i+1]; for ( j=i-kf+k; keps0) mij[ij_mat(trans,ii00,jj00,i,j)]= coef*(cnj? RNM::conj(L[k]) : L[k]); } if (U && pU) for (kf=pU[0],j=0; jm; j++) { k=kf; kf=pU[j+1]; for ( i=j-kf+k; keps0) mij[ij_mat(trans,ii00,jj00,i,j)]= coef*(cnj? RNM::conj(U[k]) : U[k]); } return L == U ; // symetrique } template MatriceProfile::MatriceProfile(const int nn,const R *a) :MatriceCreuse(nn,nn,0),typefac(FactorizationNO) { int *pf = new int [this->n+1]; int i,j,k; k=0; for (i=0;i<=this->n;k+=i++) { pf[i]=k; // cout << " pf " << i<< " = " << k << endl; } ffassert( pf[this->n]*2 == this->n*(this->n-1)); pU = pf; // pointeur profile U pL = pf; // pointeur profile L U = new R[pf[this->n]]; L = new R[pf[this->n]]; D = new R[this->n]; const R *aij=a; for (i=0;in;i++) for (j=0;jn;j++) if (ji) U[pU[j+1]-j+i] = *aij++; else D[i] = *aij++; } template template MatriceProfile::MatriceProfile(const FESpace & Vh,bool VF) :MatriceCreuse(Vh.NbOfDF,Vh.NbOfDF,0),typefac(FactorizationNO) { // for galerkine discontinue .... // VF : true=> Finite Volume matrices (change the stencil) // VF = false => Finite element // F. Hecht nov 2003 // ----- this->dummy=0; this->n = this->m = Vh.NbOfDF; int i,j,k,ke,ie,mn,jl,iVhk; int itab,tabk[5]; int *pf = new int [this->n+1]; for (i=0;in;i++) pf[i]=0; for (ke=0;ken; for( k=tabk[ie=0]; ie n;i++) {int tmp=l;l += pf[i]; pf[i]=tmp;} pf[this->n] = l; if(verbosity >3) cout << " -- SizeOfSkyline =" < void MatriceProfile::addMatMul(const KN_ &x,KN_ &ax) const {if (x.n!= this->n ) ERREUR(MatriceProfile MatMut(xa,x) ," longueur incompatible x (in) ") ; if (ax.n!= this->n ) ERREUR(MatriceProfile MatMut(xa,x) ," longueur incompatible ax (out)") ; int i,j,k,kf; ffassert(this->n == this->m); if (D) for (i=0;in;i++) ax[i] += D[i]*x[i]; else for (i=0;in;i++) // no dia => identyty dai ax[i] +=x[i]; if (L && pL ) for (kf=pL[0],i=0; in; i++ ) { k=kf; kf=pL[i+1]; for ( j=i-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pL[this->n]); } if (U && pU) for (kf=pU[0],j=0; jm; j++) { k=kf; kf=pU[j+1]; for ( i=j-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pU[this->n]); } } template void MatriceProfile::addMatTransMul(const KN_ &x,KN_ &ax) const {if (x.n!= this->n ) ERREUR(MatriceProfile MatMut(xa,x) ," longueur incompatible x (in) ") ; if (ax.n!= this->n ) ERREUR(MatriceProfile MatMut(xa,x) ," longueur incompatible ax (out)") ; int i,j,k,kf; ffassert(this->n == this->m); if (D) for (i=0;in;i++) ax[i] += RNM::conj(D[i])*x[i]; else for (i=0;in;i++) // no dia => identyty dai ax[i] +=x[i]; if (L && pL ) for (kf=pL[0],i=0; in; i++ ) { k=kf; kf=pL[i+1]; for ( j=i-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pL[this->n]); } if (U && pU) for (kf=pU[0],j=0; jm; j++) { k=kf; kf=pU[j+1]; for ( i=j-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pU[this->n]); } } template void MatriceProfile::operator=(const R & v) { if(v!=R()) { cerr << " Mise a zero d'une matrice MatriceProfile::operator=(R v) uniquement v=" << v << endl; throw(ErrorExec("exit",1)); } typefac = FactorizationNO; delete [] U; delete [] L; delete [] D; U=L=D=0; } template MatriceCreuse & MatriceProfile::operator +=(MatriceElementaire & me) { int il,jl,i,j,k; int * mi=me.ni, *mj=me.nj; if (!D) // matrice vide { D = new R[this->n]; L = pL[this->n] ? new R[pL[this->n]] :0 ; for (i =0;in;i++) D[i] =0; for (k =0;kn];k++) L[k] =0; switch (me.mtype) { case MatriceElementaire::Full : U = pU[this->n] ? new R[pU[this->n]] : 0; for (k =0;kn];k++) U[k] =0; break; case MatriceElementaire::Symmetric : U = L; break; default: cerr << "Big bug type MatriceElementaire unknown" << (int) me.mtype << endl; throw(ErrorExec("exit",1)); break; } } R * al = me.a; switch (me.mtype) { case MatriceElementaire::Full : //throwassert(L !=U); for (il=0; ili) U[ pU[j+1] - (j-i) ] += *al; else D[i] += *al;}} break; case MatriceElementaire::Symmetric : //throwassert(L ==U); for (il=0; ili) U[ pU[j+1] - (j-i) ] += *al++; else D[i] += *al++;}} break; default: cerr << "Big bug type MatriceElementaire unknown" << (int) me.mtype << endl; exit(1); break; } return *this; } template ostream& MatriceProfile::dump (ostream& f) const {f<< " matrix skyline " << this->n << '\t' << this->m << '\t' ; f << " this " << endl; f << " pL = " << pL << " L =" << L << endl << " pU = " << pU << " U =" << U << endl << " D = " << D << endl; if ( (pL == pU) && (U == L) ) if (pL && L) {f << " skyline symmetric " <n;i++) { f << i << " {" << pL[i+1]-pL[i] << "}" <<'\t' ; for (k=pL[i];kn;i++) { f << i ; if (pL && L) { f << " jO=" << i-pL[i+1]+pL[i] << " L= " <<'\t' ; for (k=pL[i];k 1 ; "; if (pU && U) { f << " i0=" << i-pU[i+1]+pU[i] << " U= " <<'\t' ; for (k=pU[i];k void MatriceProfile::cholesky(double eps) const { double eps2=eps*eps; R *ij , *ii , *ik , *jk , xii; int i,j,k; if (L != U) ERREUR(factorise,"Skyline matrix non symmetric"); U = 0; // typefac = FactorizationCholeski; if ( RNM::norm2(D[0]) <= 1.0e-60) ERREUR(cholesky,"pivot (" << 0 << ")= " << D[0] ) D[0] = sqrt(D[0]); ij = L ; // pointeur sur le terme ij de la matrice avec jn;i++) // boucle sur les lignes { ii = L+pL[i+1]; // pointeur sur le terme fin de la ligne +1 => ij < ii; xii = D[i] ; for ( ; ij < ii ; ij++) // pour les j la ligne i { j = i -(ii - ij); k = Max( j - (pL[j+1]-pL[j]) , i-(pL[i+1]-pL[i]) ); ik = ii - (i - k); jk = L + pL[j+1] -(j - k); k = j - k ; R s= -*ij; #ifdef WITHBLAS s += blas_sdot(k,ik,1,jk,1); #else while(k--) s += *ik++ * *jk++; #endif *ij = -s/D[j] ; xii -= *ij * *ij ; } // cout << RNM::norm2(xii) << " " << Max(eps2*RNM::norm2(D[i]),1.0e-60) << " " << sqrt(xii) < void MatriceProfile::crout(double eps) const { R *ij , *ii , *ik , *jk , xii, *dkk; int i,j,k; double eps2=eps*eps; if (L != U) ERREUR(factorise,"Skyline matrix non symmetric"); U = 0; // typefac = FactorizationCrout; ij = L ; // pointeur sur le terme ij de la matrice avec jn;i++) // boucle sur les lignes { ii = L+pL[i+1]; // pointeur sur le terme fin de la ligne +1 => ij < ii; xii = D[i] ; for ( ; ij < ii ; ij++) // pour les j la ligne i { j = i -(ii - ij); k = Max( j - (pL[j+1]-pL[j]) , i-(pL[i+1]-pL[i]) ); ik = ii - (i - k); jk = L + pL[j+1] -(j - k); dkk = D + k; k = j - k ; R s=-*ij; while ( k-- ) s += *ik++ * *jk++ * *dkk++; *ij = -s/ *dkk ; // k = j ici xii -= *ij * *ij * *dkk; } if (RNM::norm2(xii) <= Max(eps2*RNM::norm2(D[i]),1.0e-60)) ERREUR(crout,"pivot (" << i << " )= " << abs(xii)<< " <= " << eps*abs(D[i]) << " eps = " << eps) D[i] = xii; } } template void MatriceProfile::LU(double eps) const { R s,uii; double eps2=eps*eps; int i,j; if (L == U && ( pL[this->n] || pU[this->n] ) ) ERREUR(LU,"matrix LU symmetric"); if(verbosity>3) cout << " -- LU " << endl; typefac=FactorizationLU; for (i=1;in;i++) // boucle sur les sous matrice de rang i { // for L(i,j) j=j0,i-1 int j0 = i-(pL[i+1]-pL[i]); for ( j = j0; j incompatible"); const R *ij ,*ii, *ik, *ki; R *xk,*xi; int i; switch (a.typefac) { case FactorizationNO: if (a.U && a.L) {cerr << "APROGRAMMER (KN_::operator/MatriceProfile)";throw(ErrorExec("exit",2));} if ( a.U && !a.L ) { // matrice triangulaire superieure // cout << " remonter " << (a.D ? "DU" : "U") << endl; ki = a.U + a.pU[n]; i = n; while ( i-- ) { ii = a.U + a.pU[i]; xi= xk = v + i ; if (a.D) *xi /= a.D[i];// pour crout ou LU while ( ki > ii) *--xk -= *--ki * *xi ; } } else if ( !a.U && a.L ) { // matrice triangulaire inferieure // cout << " descente " <<( a.D ? "LD" : "L" ) < ii) ss -= *--ik * *--xk ; if ( a.D) ss /= a.D[i];// pour crout ou LU v[i] = ss ; ii = ij; } } else if (a.D) { // matrice diagonale // cout << " diagonal D" < MatriceMorse::MatriceMorse(istream & f) : MatriceCreuse(0,0,0),nbcoef(0), a(0), lg(0), cl(0), solver(0) { string line; int k=0; while ( isspace(f.peek())) f.get(); while ( f.peek() =='#' ) { line=""; while ( f.good() ) { char c=f.get(); if(c=='\n' || c=='\r') { break;} line += c; } if( f.peek()=='\n' || f.peek()=='\r') f.get(); if(verbosity>9) cout << "Read matrice: "<< k << " :" << line << endl; k++; } f >> this->n >> this->m >> symetrique >>nbcoef; if(verbosity>3) cout << " read mat: " << this->n << " " << this->m << " " << symetrique << " " << nbcoef <n+1](); cl= new int[nbcoef]; a= new R[nbcoef]; ffassert(f.good() && lg && a && cl ); int i,j,i0,j0; i0=-1;j0=2000000000; R aij; int imx=-2000000000, jmx=-2000000000; int imn= 2000000000, jmn= 2000000000; for (int k =0;k> i >> j >> aij; ffassert(f.good() ); i--;j--; imx=max(imx,i); jmx=max(jmx,j); imn=min(imn,i); jmn=min(jmn,j); //cout << i << " " << j << " " << aij << endl; if(i0!=i) {j0=-1;lg[i]=k;} ffassert(i0<=i && j0n; ++i) { if(lg[i + 1] < lg[i]) lg[i + 1] = lg[i]; } ffassert( imx < this->n && jmx < this->m ); ffassert( imn >=0 && jmn >=0); } template ostream& MatriceMorse::dump(ostream & f) const { f << "# Sparse Matrix (Morse) " << endl; f << "# first line: n m (is symmetic) nbcoef \n"; f << "# after for each nonzero coefficient: i j a_ij where (i,j) \\in {1,...,n}x{1,...,m} \n"; f << this->n << " " << this->m << " " << symetrique << " " << nbcoef <n;i++) { // f << i << " : " << lg[i] <<","<< lg[i+1]-1 << " : " ; int ke=lg[i+1]; for (;k inline R* MatriceMorse::pij(int i,int j) const { if (! (in && j< this->m)) throwassert(in && j< this->m); int i0=lg[i]; int i1=lg[i+1]-1; while (i0<=i1) // dichotomie { int im=(i0+i1)/2; if (jcl[im]) i0=im+1; else return a+im; } return 0; } template template void MatriceMorse::Build(const FESpace & Uh,const FESpace & Vh,bool sym,bool VF) { typedef typename FESpace::Mesh Mesh; // for galerkine discontinue .... // VF : true=> Finite Volume matrices (change the stencil) // VF = false => Finite element // F. Hecht nov 2003 // ----- symetrique = sym; this->dummy=false; a=0; lg=0; cl=0; // bool same = &Uh == & Vh; ffassert( &Uh.Th == &Vh.Th); // same Mesh const Mesh & Th(Uh.Th); //int nbt = Th.nt; //int nbv = Th.nv; //int nbm = Th.NbMortars; int nbe = Uh.NbOfElements; int nbn_u = Uh.NbOfNodes; int nbn_v = Vh.NbOfNodes; KN mark(nbn_v); KN pe_u(nbn_u+1+Uh.SizeToStoreAllNodeofElement()); // les element du node i // sont dans pe_u[k] pour k \in [ pe_u[i] , pe_u[i+1] [ pe_u=0; for (int k=0;k4) cout <<" -- MatriceMorse::Build " << kk << " " << nbn_u << " " << Uh.SizeToStoreAllNodeofElement() << " " << nbn_u+1+Uh.SizeToStoreAllNodeofElement() << endl; ffassert(kk== nbn_u+1+Uh.SizeToStoreAllNodeofElement()); for (int k=0;kn+1]; ffassert(lg); for (int step=0;step<2;step++) { int ilg=0; lg[0]=ilg; int kij=0; for (int in=0;in=0 && k < nbe); int njloc = Vh(k); for (int jloc=0;jloc3) cout << " -- MorseMatrix: Nb coef !=0 " << nbcoef << " n =" << this->n << " m = " << this->m << endl; a = new R[nbcoef]; cl = new int [nbcoef];} ffassert( a && cl); for (int i=0;i 999) { cout << " -- MorseMatrix: " << endl; for(int i=0; i< this->n; ++i) { cout << i << " : " ; for(int k=lg[i];k inline void ConjArray( R *v, int n) { for (int i=0;i inline void ConjArray(double *v, int n) {} template<> inline void ConjArray(float *v, int n) {} template void MatriceMorse::dotransposition() { if(symetrique) return; ffassert(this->dummy==false); int *llg= new int[nbcoef]; int *clg= new int[this->m+1]; for (int i=0;in;i++) for (int k=lg[i];km;k++) clg[k]=-1; // build new line end (old column) for(int k=0;km;k++) if (clg[k]==-1) clg[k]=kk; else kk=clg[k]; clg[this->m]=nbcoef; // sort the new column (old line) for(int i=0;im;i++) HeapSort(llg+clg[i],cl+clg[i],a+clg[i],clg[i+1]-clg[i]); delete[] cl; delete[] lg; Exchange(this->n,this->m); cl=llg; lg=clg; ConjArray(a,nbcoef); } template triplet BuildCombMat(std::map< pair, R> & mij,const list *,bool> > &lM,bool trans,int ii00,int jj00,bool cnj=false) { // modif FH feb 2010 cnj => transpose -> conj & trans typedef typename list *,bool> >::const_iterator lconst_iterator; lconst_iterator begin=lM.begin(); lconst_iterator end=lM.end(); lconst_iterator i; // std::map< pair, R> mij; int n=0,m=0; bool sym=true; for(i=begin;i!=end&&sym;i++++) { if(i->second) // M == 0 => zero matrix { MatriceCreuse & M=*i->second; if(!M.sym()) sym = false; } } for(i=begin;i!=end;i++++) { if(i->second) // M == 0 => zero matrix { MatriceCreuse & M=*i->second; bool transpose = i->third != trans; ffassert( &M); R coef=i->first; if(verbosity>3) cout << " BuildCombMat + " << coef << "*" << &M << " " << sym << " t = " << transpose << " " << i->third << endl; // change to max FH dec 2007 to hard to satisfy /* if (n==0)*/ { if(transpose) {m=max(m,M.n); n=max(n,M.m);} else{n=max(M.n,n); m=max(M.m,m);}}// Modif mars 2007 FH /* else { if(transpose) ffassert(n== M.m && m==M.n); else ffassert(n== M.n && m==M.m);}*/ M.addMatTo(coef,mij,transpose,ii00,jj00,transpose&&cnj,0.0,sym); } } int nbcoef=mij.size(); // return new MatriceMorse(n,m,mij,sym); return make_triplet(n,m,sym); } template MatriceMorse * BuildCombMat(const list *,bool> > &lM,bool trans,int ii00,int jj00) { std::map< pair, R> mij; triplet nmsym=BuildCombMat(mij,lM,trans,ii00,jj00); return new MatriceMorse(nmsym.first,nmsym.second,mij,nmsym.third); } template bool MatriceMorse::addMatTo(R coef,std::map< pair, R> &mij,bool trans,int ii00,int jj00,bool cnj,double threshold, const bool keepSym) { double eps0=max(numeric_limits::min(),threshold); int i,j,k; if (symetrique) { for ( i=0;in;i++) for ( k=lg[i];keps0) { mij[ij_mat(trans,ii00,jj00,i,j)] += cij ; if (i!=j&&!keepSym) mij[ij_mat(trans,ii00,jj00,j,i)] += cij; } } } else { for ( i=0;in;i++) for ( k=lg[i];keps0) mij[ij_mat(trans,ii00,jj00,i,j)] += cij; } } return keepSym; } template template MatriceMorse::MatriceMorse(int nn,int mm, std::map< pair, K> & m, bool sym): MatriceCreuse(nn,mm,0), nbcoef(m.size()),symetrique(sym), a(new R[nbcoef]), lg(new int[nn+1]), cl(new int[nbcoef]), solver(0) { int k=0; bool nosym=!sym; typename std::map< pair, R>::iterator iter=m.begin(), mend=m.end(); // remarque lg est croissant Bug trouver par for(int i=0;i<=nn;i++) lg[i]=0; while(iter!=mend) { int i=iter->first.first; int j=iter->first.second; K & aij=iter->second; assert( i < nn && j < mm); if(j<=i || nosym) { cl[k]=j; a[k]=aij; lg[i+1]=++k; } ++iter; } // lg est croissant on bouche les trou for(int i=1;i<=nn;i++) lg[i]=Max(lg[i-1],lg[i]); ffassert(nbcoef==k); } // FH mars 2009 ... template void MatriceMorse::resize(int nn,int mm) { int nc=0; int *nlg=new int[nn+1],*ncl=0; int nm=min(nn,this->n); nc =0; nlg[0]=nc; if (symetrique) { if( nn != mm) AFAIRE("MatriceMorse::resize symetric n!=m"); for (int i=0;im && RNM::norm2(a[k])) ++nc; } nlg[i+1]=nc; } } else { for (int i=0;in && jm && RNM::norm2(a[k])) ++nc ; } nlg[i+1]=nc; } } for(int i=nm+1;i<=nn;++i) nlg[i]=nc; ncl = new int[nc]; R *na=new R[nc]; nc=0; if (symetrique) { if( nn != mm) AFAIRE("MatriceMorse::resize symetric n!=m"); for (int i=0;im && RNM::norm2(a[k])) {na[nc]=a[k]; ncl[nc++]=j;} } } else { for (int i=0;im && RNM::norm2(a[k])) {na[nc]=a[k]; ncl[nc++]=j;} } } delete [] cl; delete [] lg; delete [] a; cl=ncl; lg=nlg; a=na; this->n=nn; this->m=mm; this->N=nn; this->M=mm; this->nbcoef=nc; // cout << nn << " " << mm << " " << KN_(lg,nn+1) << endl; } template template void MatriceMorse::prod(const MatriceMorse & B, MatriceMorse & AB) { // compute the s bool sym=this == & B &&symetrique; int *blg=B.lg; int *bcl=B.cl; ffassert(this->m==B.n); bool delbl= B.symetrique; if (delbl) { int nn=B.n; blg = new int[nn+1]; for (int i=0;i > sij; double eps0=numeric_limits::min(); for (int i=0;in;i++) for (int k=lg[i];k=B.n) continue; // in case of not equal size A.m != B.n for (int kkb=blg[j];kkb j) bjk=B(kz,j); else bjk=B(j,kz); if( RNM::norm2(bjk)>eps0 && (!sym || kz<=i)) sij.insert(make_pair(i,kz)); } } } int nn=this->n; int mm=B.m; int * llg=new int[nn+1]; int * lcl=new int[sij.size()]; RAB * aa = new RAB[sij.size()]; for(int i=0;i<=nn;i++) llg[i]=0; for (set >::iterator iter=sij.begin();iter!=sij.end();++iter) { int i=iter->first; // int j=iter->second; llg[i]++; } for (int i=1;i<=nn;i++) llg[i]+=llg[i-1]; ffassert(llg[this->n]==(long) sij.size()); for (set >::iterator iter=sij.begin();iter!=sij.end();++iter) { int i=iter->first; int j=iter->second; // cout << i << " , " << j << endl; lcl[--llg[i]]=j; } for(int i=0;in;i++) for (int k=lg[i];k=B.n) continue; // in case of not equal size A.m != B.n for (int kb=blg[j];kb j) bjk=B(k,j); else bjk=B(j,k); // cout << i << "," << "," << j << "," << k << " " << aij << " " << bjk << endl; if( RNM::norm2( bjk)> eps0 && (!sym || k<=i)) AB(i,k) += aij*bjk; } } } if (delbl) { delete [] blg; delete [] bcl; } } template void MatriceMorse::addMatMul(const KN_ & x, KN_ & ax) const { int i,j,k; if( ! (this->n==ax.N() && this->m==x.N())) {cerr << " Err MatriceMorse: ax += A x" <n<< " != "<< ax.N() << " ax.n \n"; cerr << " A.m " << this->m<< " != " <n;i++) for (k=lg[i];kn;i++) for (k=lg[i];k void MatriceMorse::addMatTransMul(const KN_ & x, KN_ & ax) const { int i,j,k; ffassert(this->m==ax.N()); ffassert(this->n==x.N()); if (symetrique) { for (i=0;in;i++) for (k=lg[i];kn;i++) for (k=lg[i];k MatriceMorse & MatriceMorse::operator +=(MatriceElementaire & me) { // R zero=R(); int il,jl,i,j; int * mi=me.ni, *mj=me.nj; if ((this->n==0) && (this->m==0)) { // if(verbosity>3) cout << " -- Morse Matrice is empt: let's build it" << endl; ffassert(0); /* this->n=me.Uh.NbOfDF; this->m=me.Vh.NbOfDF; switch (me.mtype) { case MatriceElementaire::Full : Build(me.Uh,me.Vh,false); break; case MatriceElementaire::Symmetric : Build(me.Uh,me.Vh,true); break; default: cerr << "Big bug type MatriceElementaire is unknown" << (int) me.mtype << endl; throw(ErrorExec("exit",1)); break; } */ } R * al = me.a; R * aij; switch (me.mtype) { // modif FH overfloat in array mi and mj => trap on win32 case MatriceElementaire::Full : ffassert(!symetrique); for (il=0; il::Symmetric : ffassert(symetrique); for (il=0; il void MatriceMorse::Solve(KN_ &x,const KN_ &b) const{ if (solver) solver->Solver(*this,x,b); else { cerr << "No Solver defined for this Morse matrix " << endl; throw(ErrorExec("exit",1));} } template double MatriceMorse::psor(KN_ & x,const KN_ & gmin,const KN_ & gmax , double omega) { double err=0; int n=this->n; ffassert(n==this->m); ffassert(n==x.N()); ffassert(n==gmin.N()); ffassert(n==gmax.N()); if (symetrique) { ErrorExec("Error:sorry psor just for no symmetric Morse matrices",1); } else { for (int i=0;in;i++) { R xnew =x[i]; R aii=R(); for (int k=lg[i];k double MatriceProfile::psor(KN_ & x,const KN_ & gmin,const KN_ & gmax , double omega) { double rr=0; ErrorExec("Error:sorry psor just for no symmetric Morse matrices (will do in future FH??? )",2); return rr; } template void MatriceProfile::setdiag(const KN_ & x) { ffassert(D); ffassert( this->n == x.N()); KN_ d(D,this->n) ; d=x; } template void MatriceProfile::getdiag(KN_ & x) const { ffassert(D); ffassert( this->n == x.N()); KN_ d(D,this->n) ; x=d; } template void MatriceMorse::setdiag(const KN_ & x) { ffassert( this->n == this->m&& this->n == x.N()); for (int i=0;in;++i) { R * p= pij(i,i); if(p) *p = x[i]; else ffassert( RNM::norm2(x[i]) < 1e-30);} } template void MatriceMorse::getdiag(KN_ & x) const { ffassert( this->n == this->m && this->n == x.N()); for (int i=0;in;++i) { R * p= pij(i,i); x[i]= p ? *p : R() ; } } template R MatriceMorse::pscal(const KN_ & x,const KN_ & y) { // (x, Ay) R sum=R(); int i,j,k; ffassert(this->n==x.N()); ffassert(this->m==y.N()); if (symetrique) { for (i=0;in;i++) for (k=lg[i];kn;i++) for (k=lg[i];k R MatriceProfile::pscal(const KN_ & x,const KN_ & y) { if (y.n != this->n || x.n != this->n ) ERREUR(MatriceProfile pscal(xa,x) ," longueur incompatible c (out)") ; int i,j,k,kf; R sum = R(); ffassert(this->n == this->m); if (D) for (i=0;in;i++) sum += D[i]*x[i]*y[i]; else for (i=0;in;i++) // no dia => identyty dai sum +=x[i]*y[i]; if (L && pL ) for (kf=pL[0],i=0; in; i++ ) { k=kf; kf=pL[i+1]; for ( j=i-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pL[this->n]); } if (U && pU) for (kf=pU[0],j=0; jm; j++) { k=kf; kf=pU[j+1]; for ( i=j-kf+k; k=0 && i n && j >=0 && j < this->m && k>=0 && k < pU[this->n]); } return sum; } template void MatriceMorse::getcoef(KN_ & x) const { ffassert(x.N()==this->nbcoef); x = KN_(this->a,nbcoef); } template void MatriceMorse::setcoef(const KN_ & x) { ffassert(x.N()==nbcoef); KN_(this->a,nbcoef) = x; } template int MatriceMorse::NbCoef() const { return this->nbcoef; } template void MatriceProfile::getcoef(KN_ & x) const { ffassert(x.N()==this->NbCoef()); int k=0,kk; if (D) { kk=this->n; x(SubArray(kk,k)) = KN_(D,kk); k += kk; } if (L) { kk= pL[this->n]; x(SubArray(kk,k)) = KN_(L,kk); k += kk; } if (U && (U != L)) { kk= pU[this->n]; x(SubArray(kk,k)) = KN_(U,kk); k += kk; } } template void MatriceProfile::setcoef(const KN_ & x) { ffassert(x.N()==this->NbCoef()); int k=0,kk; if (D) { kk=this->n; KN_(D,kk)=x(SubArray(kk,k)) ; k += kk; } if (L) { kk= pL[this->n]; KN_(L,kk)=x(SubArray(kk,k)) ; k += kk; } if (U && (U != L)) { kk= pU[this->n]; KN_(U,kk)=x(SubArray(kk,k)) ; k += kk; } } template int MatriceProfile::NbCoef() const { int s=0; if (D) s += this->n; if (L) s += pL[this->n]; if (U && (U != L)) s += pU[this->n]; return s; } #endif freefem++-3.61-1/src/femlib/HeapSort.hpp000755 000767 000024 00000002440 13256636774 020111 0ustar00hechtstaff000000 000000 template void HeapSort(T *c,long n) { // starting 0... long l,j,r,i; T crit; if( n <= 1) return; l = n/2; r = n-1; while (1) { // label 2 if(l < 1 ) { // label 20 crit = c[r]; c[r--] = c[0]; if ( !r ) { c[0]=crit; return;} } else crit = c[--l]; j=l; while (1) {// label 4 i=j; j=2*j+1; if (j>r) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } template void HeapSort(K *k,T *t,long n) { long l,j,r,i; K kk; T tt; if( n <= 1) return; l = n/2; r = n-1; while (1) { // label 2 if(l < 1 ) { // label 20 kk = k[r]; tt = t[r]; t[r]=t[0],k[r--] = k[0]; if ( !r ) { k[0]=kk;t[0]=tt; return;} } else {kk = k[--l];tt=t[l]; } j=l; while (1) {// label 4 i=j; j=2*j+1; if (j>r) {k[i]=kk;t[i]=tt;break;} // L8 -> G2 if ((j G2 } } } freefem++-3.61-1/src/femlib/glutdraw.cpp000644 000767 000024 00000026762 13256636774 020222 0ustar00hechtstaff000000 000000 #ifdef __APPLE__ #include #else #include #endif // #include pthread_mutex_t mutex, mutexclose; #include #include #include using namespace std; #include #include "error.hpp" #include #include #include #include #include "rgraph.hpp" #include "RNM.hpp" #include "fem.hpp" #include "FESpace.hpp" #include const R pi=4*atan(1.); using namespace std; using namespace Fem2D; typedef KN Rn; class Global { // une petite classe pour stoker toutes les variables globales public: int Width , Height; // taille de l'cran en pixel R rapz; int count; vector lppTh; vector lisoTh; vector lu0; vector lu1; R theta,phi,coef_dist; // coordonne polaire de la camera R dtheta; // vitesse de rotation de la camera R xmin,xmax,ymin,ymax,zmin,zmax; // borne de la scne R xm,ym,zm; // point regarde Global(int height,int width) ; void SetView() const; // define le point de vue void DefaultView(); void MoveXView(R dx,R dx); void MakeListDraw() const ; // construit la list d'affichage void reset() { count++;} } *global ; // la variable global static int xold,yold; void * return_value=0; Global::Global(Mesh & TTh,Rn &ff,int height,int width,R rpz,int nbisovalue) : Th(TTh), f(ff) { nbiso = nbisovalue; Width= width ; Height=height; rapz=rpz; count =0; /* // first compute the mesh bound const Vertex & v0=Th(0); xmin=xmax=v0.x; ymin=ymax=v0.y; zmin = f[0], zmax=f[0]; for (int i=0;i2) { viso = new R[nbiso]; R diso=(zmax-zmin)/(nbiso-1); for (int i=0;izmin; // borne de la fonction R fmax=global->zmax; hsvToRgb(0.99*(f-fmin)/(fmax-fmin),1,1,r,g,b); glColor3f(r,g,b); } void DrawVertex(const R2 & v,R z=0,R rapz=1) { SetColor(z); // la couleur glVertex3f(v.x, v.y, z*rapz); // le sommet } void DrawIsoTfill(const R2 Pt[3],const R ff[3],const R * Viso,int NbIso, R rapz=1) { R2 PQ[10]; R z[10]; R eps= (Viso[NbIso-1]-Viso[0])*1e-6; for(int l=1;l< NbIso;l++) // loop on the level curves { R xfb = Viso[l-1]; R xfh = Viso[l]; assert(xfb < xfh); int im=0; for(int i=0;i<3;i++) // for the 3 edges { int j=(i+1)%3; R fi=(ff[i]); R fj=(ff[j]); R xxfb = xfb; R xxfh = xfh; if (fj=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); z[im] = ff[i] * (1.F-xlam) + ff[j]* xlam; PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } xf = xxfh; if(((fi<=xf)&&(fj>=xf))||((fi>=xf)&&(fj<=xf))) { if (Abs(fi-fj)>=0.1e-20) { R xlam=(fi-xf)/(fi-fj); z[im] = ff[i] * (1.F-xlam) + ff[j]* xlam; PQ[im++] = Pt[i] * (1.F-xlam) + Pt[j]* xlam; } } if ( xfb-eps <=fj && fj <= xfh+eps) z[im]=ff[j],PQ[im++] = Pt[j]; } if (im>2) { glBegin(GL_POLYGON); SetColor((xfb+xfh)/2); for (int i=0;iWidth = width; global->Height = height; global->SetView(); glutPostRedisplay(); } static void Key( unsigned char key, int x, int y ) { switch (key) { case 27: // esc char pthread_mutex_unlock(&mutexclose); pthread_exit(&return_value); break; case '+': global->coef_dist /= 1.2; break; case '-': global->coef_dist *= 1.2; break; case 'g': global->theta += pi/180.; break; case 'd': global->theta -= pi/180.; break; case 'h': global->phi += pi/180.; break; case 'b': global->phi -= pi/180.; break; case 'a': global->dtheta = pi/180.; break; case 's': global->dtheta = 0; break; case '=': global->DefaultView(); break; default: cout << " Key Character " << (int) key << " " << key << endl; } global->SetView(); glutPostRedisplay(); } void Display(void) { Clean(); int n=global->nblist; for (int i=1;i<=n;i++) glCallList(i); glFlush(); glutSwapBuffers(); } static void Idle( void ) { if (global->dtheta) { global->theta += pi/180.; global->SetView(); glutPostRedisplay(); } } static void Mouse( int button,int state,int x,int y ) { // state up or down if (state == GLUT_DOWN) { xold=x,yold=y;return;} // cout << "Mouse " << button<< " " << state << " " << x-xold << " " << y-yold << endl; // x gauche -> droitre // y haut -> bas` global->phi += (y-yold)/(2.*180.); global->theta -= (x-xold)/(2*180.); global->SetView(); glutPostRedisplay(); } static void MotionMouse(int x,int y ) { // cout << " MotionMouse " << " " << x << " " << y << endl; GLuint gtime = glutGet(GLUT_ELAPSED_TIME); // global->phi += (y-yold)/(2.*180.); global->theta -= (x-xold)/(2*180.); xold=x; yold=y; global->SetView(); glutPostRedisplay(); } void SpecialKey(int key, int x, int y) { // cout << " SpecialKey " << key << " " << x << " " << y << " : "; R dx(0),dy(0); switch (key) { case GLUT_KEY_LEFT: dx = -1; break; case GLUT_KEY_RIGHT: dx = +1; break; case GLUT_KEY_DOWN: dy = -1; break; case GLUT_KEY_UP: dy = +1; break; } // calcul du deplacement de xm,ym,zm; // cout << " " << dx << " " << dy << endl; global->MoveXView(dx,dy); global->SetView(); glutPostRedisplay(); } void * glutthread(void *argu) { char ** argv = (char **) ((void**) argu)[1]; int & argc = * (int *) ((void**) argu )[0] ; glutInit(&argc , argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); int Height = 512; int Width = 512; glutInitWindowSize(Width , Height); glutInitWindowPosition(100, 100); string titre = "vue de "; titre += argv[1] ; titre += ", "; titre += argv[2]; glutCreateWindow(titre.c_str()); glutPushWindow(); cout << "mutex lock in glut " << endl; pthread_mutex_lock(&mutex); cout << " .. continue in glut " << endl; assert(global); global->Height=Height; global->Width=Width; global->MakeListDraw(); global->SetView(); pthread_mutex_unlock(&mutex); glEnable(GL_DEPTH_TEST); glutReshapeFunc( Reshape ); // pour changement de fenetre glutKeyboardFunc( Key ); // pour les evenements clavier glutSpecialFunc(SpecialKey); glutMouseFunc(Mouse); // pour les evenements sourie glutMotionFunc(MotionMouse); // les mouvements de la sourie glutDisplayFunc( Display ); // l'affichage glutIdleFunc( Idle ); // l'animation automatique glutMainLoop(); return return_value; } /* void * main1(void *argu) { pthread_mutex_lock(&mutex); char ** argv = (char **) ((void**) argu)[1]; int & argc = * (int *) ((void**) argu )[0] ; if (argc <3) { cerr << " utilisation : " << argv[0] << " meshfile solfile [rap in z ] [nbisovalue] " << endl; return return_value; } global=0; assert(argc>2); R rapz=1; int nbiso=20; if (argc>3) rapz=atof(argv[3]); if (argc>4) nbiso=atoi(argv[4]); cout << " Rap z " << rapz << endl; Mesh Th(argv[1]); Rn f(Th.nv); { ifstream fdat(argv[2]); assert(fdat.good()); fdat >> f; } // pour ferme le fichier (la variable fdat est detruite) // global=new Global(Th,f,100,100,rapz,nbiso); pthread_mutex_unlock(&mutex); cout << " un lock in main " << endl; cout << " wait close " << endl; pthread_mutex_lock(&mutexclose); pthread_mutex_unlock(&mutexclose); cout << " close " << endl; return return_value; } int main(int argc, char** argv) { global=0; pthread_mutex_init(&mutex,NULL); pthread_mutex_init(&mutexclose,NULL); pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutexclose); pthread_t tid; void * argu[2]={ (void *) & argc, (void*) argv}; pthread_create(&tid,NULL,main1,(void *) argu); pthread_mutex_unlock(&mutex); glutthread(argu); void **value_ptr; pthread_join(tid,value_ptr ); return 0; } */ freefem++-3.61-1/src/femlib/FQuadTree.hpp000644 000767 000024 00000011520 13312446271 020160 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** /* 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 */ // AUTHOR: F. Hecht, // ORG : UMPC // E-MAIL : Frederic.Hecht@Inria.fr // // ORIG-DATE: Dec 97 namespace Fem2D { const int MaxDeep = 30; typedef long IntQuad; const IntQuad MaxISize = ( 1L << MaxDeep); #define VERSION_Fem2D_FQuadTree 2 /* in version 2 add bool nearest=false Mai 20128 FH. for inytersect mesh Vertex * ToClose(const R2 & ,R ,long,long,bool nearest=false); */ class Mesh; //typename Vertex; class FQuadTree { public: class I2 { public: static bool INTER_SEG1d(long a,long b,long x,long y) { return (((y) > (a)) && ((x) <(b)));} long x,y; I2() {} I2(long i,long j): x(i),y(j) {} I2(const I2 &pp,long k,long l): x(pp.x+(( k&1) ? l : 0)),y(pp.y+(( k&2) ? l : 0)) {} void Add(long k,long l) { x+= (( k&1) ? l : 0) ; y+= (( k&2) ? l : 0);} I2(const I2 &A,const I2 &B) : x(B.x-A.x),y(B.y-A.y) {} long Case(long l) const { return ( ( y & l) ? (( x & l) ? 3 : 2 ) :( ( x & l)? 1 : 0 ));} long norm() const { return Max(abs(x),abs(y));} bool less(I2 h) const { return abs(x) Vertex else => QuadTreeBox; union { QuadTreeBox *b[4]; Vertex * v[4]; }; }; // end class QuadTreeBox ///////////////// class StorageQuadTreeBox { public: QuadTreeBox *b,*bc,*be; long len; StorageQuadTreeBox *n; // next StorageQuadTreeBox StorageQuadTreeBox(long ,StorageQuadTreeBox * =0); ~StorageQuadTreeBox(); long SizeOf() const { return len*sizeof(QuadTreeBox)+sizeof(StorageQuadTreeBox)+ (n?n->SizeOf():0); } }; // end class StorageQuadTreeBox StorageQuadTreeBox * sb; long lenStorageQuadTreeBox; public: QuadTreeBox * root; const Mesh *th; long NbQuadTreeBoxSearch,NbVerticesSearch; long NbQuadTreeBox,NbVertices; R2 cMin,cMax; // box of QuadTree R coef; // long XtoI(R x) { return (long) ((Max(Min(x,cMax.x),cMin.x)-cMin.x)*coef);} long YtoJ(R y) { return (long) ((Max(Min(y,cMax.y),cMin.y)-cMin.y)*coef);} R ItoX(long i){ return double(i)*coef+cMin.x ;} R ItoY(long j){ return double(j)*coef+cMin.y ;} I2 R2ToI2(const R2 &P) { return I2(XtoI(P.x),YtoJ(P.y));} I2 R2ToI2(const R2 *P) { return I2(XtoI(P->x),YtoJ(P->y));} Vertex * NearestVertex(const R2 & P) { return NearestVertex(XtoI(P.x),YtoJ(P.y));} Vertex * NearestVertexWithNormal(const R2 & P); // { return NearestVertexWithNormal(XtoI(P.x),YtoJ(P.y));} Vertex * NearestVertex(long i,long j); // Vertex * NearestVertexWithNormal(long i,long j); // new version Vertex * ToClose(const R2 & ,R ,long,long,bool nearest=false); Vertex * ToClose(const R2 & P,R delta,bool nearest=false){ long hx = (long) (coef*delta); return ToClose(P,delta,hx,hx,nearest);} long SizeOf() const {return sizeof(FQuadTree)+sb->SizeOf();} #ifdef DRAWING void IMoveTo(long i,long j) { rmoveto(float(i)/coef+cMin.x ,float(j)/coef+cMin.y );} void ILineTo(long i,long j) {rlineto(float(i)/coef+cMin.x ,float(j)/coef+cMin.y );} void Draw(); void PlotQuad(I2 pp,long hb); void PlotX(I2 pp,long hb); #endif void Add( Vertex & w); QuadTreeBox* NewQuadTreeBox() { ///cout << "NewQuadTreeBox " << sb << " " << sb->bc << " " //<< sb->be << " " <bcbe)) sb=new StorageQuadTreeBox(lenStorageQuadTreeBox,sb); throwassert(sb && (sb->bc->n == 0)); NbQuadTreeBox++; return sb->bc++; } ~FQuadTree(); FQuadTree(const Mesh* t,long tnv,R2 Pmin,R2 Pmax,long nbv=-1); FQuadTree(const Mesh * t,R2 Pmin,R2 Pmax,long nbv=-1); FQuadTree(Vertex * v,R2 Pmin,R2 Pmax,long nbv); FQuadTree(); friend ostream& operator <<(ostream& f, const FQuadTree & qt); }; //#undef IJ } // name space freefem++-3.61-1/src/femlib/GQuadTree.cpp000644 000767 000024 00000053132 13256636774 020201 0ustar00hechtstaff000000 000000 // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : Generic Tree (binairy, Quad, Oct) // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include #include #include "error.hpp" #include #include #include #include #include "ufunction.hpp" #include "HeapSort.hpp" using namespace std; #include "GenericMesh.hpp" #include "Mesh1dn.hpp" #include "Mesh2dn.hpp" #include "Mesh3dn.hpp" #include extern long npichon2d, npichon3d; extern long npichon2d1, npichon3d1; namespace EF23 { // new version ---------- // ---------------------- template void OrthoProject(const Rd &P,const Rd &A,const Rd & B,R * l) { Rd AB(A,B),AP(A,P),BP(B,P); R pa=(AB,AP),pb=(AB,BP); // (l0 PA + l1 PB , AB)=0 // l0 pa + l1 pb = 0 // l0 + l1 =1 // l0 (pa - pb) = - pb; l[0] = - pb/(pa-pb); l[1] = 1-l[0]; } template void OrthoProject(const Rd &P,const Rd &A,const Rd &B,const Rd &C,R * l) { Rd AB(A,B),AC(A,C),AP(A,P),BP(B,P),CP(C,P); R2 p0( (AB,AP) , (AC,AP) ); R2 p1( (AB,BP) , (AC,BP) ); R2 p2( (AB,CP) , (AC,CP) ); // sum li pi = 0 // l0 + l1 + l2 = 1 // => R2 O; R d = det(p0,p1,p2); l[0] = det(O ,p1,p2)/ d; l[1] = det(p0,O ,p2)/ d; l[2] = 1. -l[0] -l[1]; // // } template Vertex * GTree::NearestVertex(Zd xyi)//long xi,long yj) { // warning this function return the NearestVertex in the first // none empty box contening the point xyi. // They do not return the true nearest point in classical norm. QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Zd pp[ MaxDeep ]; int l=0; // level QuadTreeBox * b; IntQuad h=MaxISize,h0; IntQuad hb = MaxISize; Zd p0(0,0,0); Zd plus(xyi) ; plus.Bound(); // xin) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = plus.Case(hb2);//(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ){ break; // null box or empty box => break } NbQuadTreeBoxSearch++; b=b0; p0.Add(k,hb2); hb = hb2; } // n0 number of boxes of in b ("b0") if(verbosity>2000) cout << " n0=" << n0 << endl; if ( n0 > 0) { for( int k=0;kv[k]); h0 = Zd(i2,plus).norm(); //NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } NbVerticesSearch++; } return vn; } if(verbosity>2000) cout << " general case : NearVertex" << endl; // general case ----- pb[0]= b; pi[0]=b->n>0 ?(int) b->n : N ; pp[0]=p0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; Zd i2 = VtoZd(b->v[k]); h0 = Zd(i2,plus).norm();// NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 Zd ppp(pp[l],k,hb); if ( ppp.interseg(plus,hb,h) )//(INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : N ; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return vn; } template Vertex * GTree::ToClose(const Rd & v,R seuil,Zd H) { const Rd X(v); const Zd p(RdtoZd(v)); R seuil2 = seuil*seuil; // const Metric Mx(v.m); QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Zd pp[ MaxDeep ]; int l=0; // level QuadTreeBox * b; long h=MaxISize; long hb = MaxISize; Zd p0( 0 ); if (!root->n) return 0; // empty tree // general case ----- pb[0]= root; pi[0]= root->n>0 ?(int) root->n : N ; pp[0]= p0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; //cout << "b" << b << ", k= " << k << endl; //cout << " b->n " << b->n << endl; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; Vertex & V(*b->v[k]); Zd i2 = VtoZd(V); if ( Zd(i2,p).less(H) ) { Rd XY(X,V); R dd; if( (dd= (XY,XY) ) < seuil2 ) // LengthInterpole(Mx(XY), b->v[k]->m(XY))) < seuil ) { return &V; } } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if( (b=b->b[k]) ) { hb >>=1; // div by 2 Zd ppp(pp[l],k,hb); if( ppp.interseg(p,hb,H) ) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : N; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } // fin: while(pi[l]--) hb <<= 1; // mul by 2 } while (l--); return 0; } template void GTree::Add( Vertex & w) { QuadTreeBox ** pb , *b; Zd p(VtoZd(w)); long l=MaxISize; pb = &root; while( (b=*pb) && (b->n<0)) { b->n--; l >>= 1; pb = &b->b[p.Case(l)]; } if (b) { for(int i=N-1;i>=0;--i) if (b->n > i && b->v[i] == &w) { //if( abs(w.x+0.5)<1e-10 ) cout << "if (b->n > i && b->v[i] == &w)" <n == N)) // the QuadTreeBox is full { //if(verbosity > 5) cout << " b = " << b << b->n << " " << l << endl; Vertex *v4[N]; // copy of the QuadTreeBox vertices for(int i=0;iv[i]; b->v[i]=0;} b->n = -b->n; // mark is pointer QuadTreeBox l >>= 1; // div the size by 2 ffassert(l); for (int k=0;kb[ij=VtoZd(v4[k]).Case(l)]; //if(verbosity > 5) cout << "ij= "<< ij << " " << VtoZd(v4[k])<< endl; if (!bb) bb=b->b[ij]=NewQuadTreeBox(); // alloc the QuadTreeBox //if(verbosity > 5) cout << bb << " " << k << " " << ij << endl; bb->v[bb->n++] = v4[k]; } pb = &b->b[p.Case(l)]; } if (!(b = *pb)) { //if(verbosity > 5) cout << "Qbox \n"; b=*pb= NewQuadTreeBox(); // alloc the QuadTreeBox } //if(verbosity > 5) cout << b << " " << b->n << endl; b->v[b->n++]=&w; // we add the vertex NbVertices++; } template GTree::GTree(Vertex * v,Rd Pmin,Rd Pmax,int nbv) : lenStorageQuadTreeBox(nbv/8+100), // th(t), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), NbQuadTreeBox(0), NbVertices(0), cMin(Pmin-(Pmax-Pmin)/2), cMax(Pmax+(Pmax-Pmin)/2), coef( MaxISize/Norme_infty(cMax-cMin)) { if(verbosity>5){ cout << " GTree: box: "<< Pmin << " " << Pmax << " " << cMin << " "<< cMax << " nbv : " << nbv < MaxICoor); if (v) for (long i=0;i GTree::GTree() : lenStorageQuadTreeBox(100), // th(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0), NbQuadTreeBox(0), NbVertices(0), cMin(),cMax(),coef(0) { sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); } template GTree::StorageQuadTreeBox::StorageQuadTreeBox(int ll,StorageQuadTreeBox *nn) { len = ll; n = nn; b = new QuadTreeBox[ll]; for (int i = 0; i GTree::StorageQuadTreeBox::~StorageQuadTreeBox() { //cout << "~StorageQuadTreeBox " << this << " n " << n << " b " << b << endl; if(n) delete n; delete [] b; } template GTree::~GTree() { delete sb; } template ostream& operator <<(ostream& f, const GTree & qt) { f << " the tree " << endl; f << " NbTreeBox = " << qt.NbQuadTreeBox << " Nb Vertices = " << qt.NbVertices << endl; f << " NbTreeBoxSearch " << qt.NbQuadTreeBoxSearch << " NbVerticesSearch " << qt.NbVerticesSearch << endl; f << " SizeOf QuadTree" << qt.SizeOf() << endl; // return dump(f,*qt.root); return f; } template Vertex * GTree::NearestVertexWithNormal(const Rd &P)//(long xi,long yj) { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Zd pp[ MaxDeep]; int l; // level QuadTreeBox * b; IntQuad h=MaxISize,h0; IntQuad hb = MaxISize; Zd p0; Zd plus(RdtoZd(P) );//xin) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) long hb2 = hb >> 1 ; int k = plus.Case(hb2);//(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; p0.Add(k,hb2); hb = hb2; } if ( n0 > 0) { for(int k=0;kv[k]; if (v->ninside(P)) { Zd i2 = VtoZd(v); // try if is in the right sens -- h0 = Zd(i2,plus).norm();// h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 n>0 ?(int) b->n : N ; pp[0]=p0; h=hb; L1: do { // walk on the tree b= pb[l]; while (pi[l]--) // loop on 4 element of the box { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { Vertex * v=b->v[k]; if (v->ninside(P) ) { NbVerticesSearch++; Zd i2 = VtoZd(v); // if good sens when try -- h0 = Zd(i2,plus).norm();// NORM(iplus,i2.x,jplus,i2.y); if (h0 b[k])) { hb >>=1 ; // div by 2 Zd ppp(pp[l],k,hb); if ( ppp.interseg(plus,hb,h) )//(INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : N ; pp[l]=ppp; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); if (!vn && b != root ) {// cas particulier on repart du sommet on avais rien trouver b=root; hb = MaxISize; p0=Zd(); l=0; pb[0]= b; pi[0]= b->n>0 ?(int) b->n : N ; pp[0]=Zd(); goto L1; } return vn; } // static int kfind=0; // static int kthrough=0; inline void CoorBary(const Triangle2 & K,const R2 & P, R *l) { R detK = 2.*K.mesure() ; l[1]=det(K[0],P,K[2])/detK; l[2]=det(K[0],K[1],P)/detK; l[0]=1-l[1]-l[2]; } inline void CoorBary(const Tet & K,const R3 & P, R *l) { R detK = 6.*K.mesure() ; l[1]=det(K[0],P,K[2],K[3])/detK; l[2]=det(K[0],K[1],P,K[3])/detK; l[3]=det(K[0],K[1],K[2],P)/detK; l[0]=1-l[1]-l[2]-l[3]; } // inline int nRand(int n) { // return rand()%n; //avant random()%n; // } inline int find5(int i,int *k,int l) { if(l<5) { for(int j=0;j=k[0] && i<=k[l-1]) { int i0=0,i1=l-1; while(i0<=i1) { int im=(i0+i1)/2; if(ik[im]) i0=im+1; else if(i==k[im]){ return im; } } } return -1; } template const typename Mesh::Element * Find(const Mesh & Th, GTree *quadtree, typename Mesh::Rd P, typename Mesh::RdHat & Phat, bool & outside, const typename Mesh::Element * tstart) { typedef typename Mesh::Element Element; typedef typename Mesh::Vertex Vertex; typedef typename Mesh::Rd Rd; const int nkv=Element::nv; const int d=Rd::d; R dP=DBL_MAX, nddd=0; Rd PPhat,Delta; int k=0; int nReStart = 0; int itstart[100],kstart=0; int it,j,it00; const int mxbord=1000; int kbord[mxbord+1]; int nbord=0; if(searchMethod>1) goto PICHON; if ( tstart ) it00=it = Th(tstart); else if(quadtree) { const Vertex * v=quadtree->NearestVertex(P);// Change Juil 2017 .. /* if (!v) { v=quadtree->NearestVertex(P); assert(v); }*/ ffassert(v); // bug !!!! it00=it=Th.Contening(v); nddd= Norme2(P-*v); if(verbosity>200) cout << " Find: Close : "<< *v << " , " << Th(v) << " dist " << nddd << endl; } else ffassert(0); RESTART: ffassert(kstart<100); itstart[kstart++]=it; if(verbosity>199) cout << " " << nReStart << " tstart= " << tstart << " , it=" << it << " P="<< P << endl; outside=true; Mesh::kfind++; while (1) { //if(verbosity>199) cout << "it " << it < bug // avant: // R eps = -K.mesure()*1e-10; R eps = -1e-10; for(int i=0;i200){ cout << " tet it=" << it ; cout << " K.mesure=" << K.mesure() ; cout << " eps=" << eps << " : " ; for(int i=0;i on test les autre { // 1) existe t'il un adj interne int nn=0,ii; int nadj[d+1],ni[d+1]; for(int i=0;i=0) && find5(itt,kbord,nbord) < 0 ) ni[nn++]=i,nadj[i]=itt; if(verbosity>1000) cout << " nn : "<< nn << endl; if (nn>0) { //j=nadj[nRand(nn)]; j=ni[randwalk(nn)]; it=nadj[j]; dP=DBL_MAX; //cout << "new it= " << it << endl; continue; } } // toutes les faces <0 sont sur le bord. // pour l'instant on s'arte // le point est externe. (mais trop cher pour faire mieux) // on projet le points sur le bord via le coordonne // barycentrique { // a ridge on border (to hard to do the correct stuff) // or a corner just do the projection on lambda R s=0.; for(int i=0;i1000) { cout << " "<< P << " " << n << " l: "; R ss=0; for(int i=0;i199) { Rd pp=Th[it](Phat)-P; cout << " restart find P " << P << " !=" <199) cout << " Restart tet: " << it << " " << P << endl; if(Rd::d==2) npichon2d1++; if(Rd::d==3) npichon3d1++; goto RESTART; } if(searchMethod) goto PICHON; return &Th[it] ; } } PICHON: { if(Rd::d==2) npichon2d++; if(Rd::d==3) npichon3d++; /*==============================PICHON=================*/ // Brute force ** */ R l[4], eps = -1e-6; //pichon double dist_baryC = 0.0, min_dist_baryC = 1e31; long closestTet = -1; l[0]=l[1]=l[2]=l[3]=1; // for d < 3 for(int tet=0;tet= eps) && (l[1] >= eps) && (l[2] >= eps) && (l[3] >= eps) ) { if( verbosity>199) { cout << " #### brute force " << tet << " "<< endl; } outside=false; Phat=Rd(l+1); return &K; } } const Element & K(Th[closestTet]); outside=true; CoorBary(K,P,l); Phat=Rd(l+1); if(verbosity>2) cout << " --vertex:" << P << " NOT in DOMAIN. use closestTet. Phat:" << Phat << endl; return &K; } /*==============================PICHON=================*/ } // Instantiation manuel des templates template class GTree; template class GTree; template class GTree; typedef Mesh3::GMesh GMesh3; typedef Mesh2::GMesh GMesh2; typedef Mesh1::GMesh GMesh1; template const GMesh3::Element * Find(const GMesh3 & Th, GTree< GMesh3::Vertex> *quadtree, GMesh3::Rd P, GMesh3::RdHat & Phat, bool & outside, const GMesh3::Element * tstart); template const GMesh2::Element * Find(const GMesh2 & Th, GTree< GMesh2::Vertex> *quadtree, GMesh2::Rd P, GMesh2::RdHat & Phat, bool & outside, const GMesh2::Element * tstart); /* template const GMesh1::Element * Find(const GMesh1 & Th, GTree< GMesh1::Vertex> *quadtree, GMesh1::Rd P, GMesh1::RdHat & Phat, bool & outside, const GMesh1::Element * tstart); */ } freefem++-3.61-1/src/femlib/Mesh1dn.hpp000644 000767 000024 00000006127 13256636774 017666 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model mesh 1d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef MESH1DN_HPP_ #define MESH1DN_HPP_ namespace Fem2D { #include "R1.hpp" } #include "GenericMesh.hpp" #include using namespace std; namespace Fem2D { typedef GenericVertex Vertex1; struct DataSeg1 { static const int NbOfVertices =2; static const int NbOfFaces =0; static const int NbOfEdges =1; static const int NT =0; static const int NbOfAdjElem =NbOfVertices; static const int NbOfVertexOnHyperFace =NbOfVertices-1; typedef Vertex1 V; typedef V::Rd Rd ; static R mesure( V * pv[NbOfVertices]) { return pv[1]->x-pv[0]->x; } typedef R0 RdHatBord; typedef R1 RdHat; static RdHat PBord(const int * nvb,const RdHatBord & P) { return R1(*nvb) ;} // static const int (* const nvface)[3];// = nvfaceTria ; //static const int (* const nvedge)[2];// = nvedgeTrai; }; struct DataPoint1 { static const int NbOfVertices =1; static const int NbOfEdges =0; static const int NbOfFaces =0; static const int NT =0; static const int NbOfAdjElem =1; static const int NbOfVertexOnHyperFace =1; typedef Vertex1 V; typedef V::Rd Rd; static R mesure( V * pv[NbOfVertices] ) { return 1.; } typedef R0 RdHatBord; typedef R0 RdHat; static RdHat PBord(const int * nvb,const RdHatBord & P) { return R0() ;} }; class Seg1: public GenericElement { public: Seg1() {}; // constructor empty for array R1 H(int i) const { ASSERTION(i>=0 && i <1); return (2-i)/mesure();} // heigth void Gradlambda(R1 * GradL) const { GradL[1]= H(1); GradL[0]=-GradL[1]; } }; class BoundaryPoint1: public GenericElement { public: BoundaryPoint1() {}; // constructor empty for array }; class Mesh1 : public GenericMesh { public: Mesh1(const char *); // const Element * Find( R1 P, R1 & Phat,bool & outside,const Element * tstart) const; private: int load(const string & filename); Mesh1(const Mesh1 &); // pas de construction par copie void operator=(const Mesh1 &);// pas affectation par copy }; } #endif freefem++-3.61-1/src/femlib/GenericMesh.hpp000644 000767 000024 00000150727 13312446271 020546 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model of generic mesh 1d,2d,3d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef GENERICMESH_HPP_ #define GENERICMESH_HPP_ // la regle de programmation 3 extern long verbosity; extern long searchMethod; //pichon #include // Add J. Morice #include "cassert" #include "assertion.hpp" #include #include #include //#include //#include #include "RefCounter.hpp" using namespace ::std; #include "Serialize.hpp" #include "GQuadTree.hpp" // definition R namespace Fem2D { #include "R3.hpp" #include "Label.hpp" #include "HashTable.hpp" inline int randwalk(int ncas) { const long long a = 314125421, b =1, m= 777777; static long xn = 19999999%m; if(ncas <=0) xn=19999999%m; long long xxn = xn; xn = a*xxn%m +1; xn %= m; return (xn*ncas)/m; } const double UnSetMesure=-1e+200; inline int maxdfon(const int *dfon){ return max(max(dfon[0],dfon[1]),max(dfon[2],dfon[3]));} // struct R {}; template struct typeRd {typedef R0 Rd;}; template<> struct typeRd<1> {typedef R1 Rd;}; template<> struct typeRd<2> {typedef R2 Rd;}; template<> struct typeRd<3> {typedef R3 Rd;}; const int NbTypeItemElement = 4; const int TypeVertex =0; const int TypeEdge =1; const int TypeFace =2; const int TypeVolume =3; // add FH ... april 2009 for peroidic Boundary Condition. // gestion of the permutation 1,2,3 // here just user order // NumPerm : number of the permutation // p permutation n= NumPerm(p) // p1 permutation inv n1 = NumPerm(p1) // p1[p[i]]=i // => n1 number of the perm / p[p1[i]] increase <=> i // SetNumPerm: set the permutation form number template inline int NumPerm(int *) {ffassert(0);} template inline int NumPerm1(int *) {ffassert(0);} // num perm inverse template<> inline int NumPerm<1>(int *) { return 0;} template<> inline int NumPerm1<1>(int *) { return 0;} template<> inline int NumPerm<2>(int *p) { return p[0] > p[1] ;} template<> inline int NumPerm1<2>(int *p) { return p[0] > p[1] ;} template<> inline int NumPerm1<3>(int *p) { // signe + depart*2 int k=0,i0=0,i1=1,i2=2,j[3]; if(p[i0]> p[i1]) swap(i0,i1),k +=1; if(p[i1]> p[i2]) swap(i1,i2),k +=1; if(p[i0]> p[i1]) swap(i0,i1),k +=1; assert(p[i0] < p[i1] && p[i1] < p[i2]); // j is inv of i1,i2,i3 j[i0]=0;j[i1]=1;j[i2]=2; return (k%2)+i0*2; // signe + depart*2 } template<> inline int NumPerm<3>(int *p) { // signe + depart*2 int k=0,i0=0,i1=1,i2=2,j[3]; if(p[i0]> p[i1]) swap(i0,i1),k +=1; if(p[i1]> p[i2]) swap(i1,i2),k +=1; if(p[i0]> p[i1]) swap(i0,i1),k +=1; assert(p[i0] < p[i1] && p[i1] < p[i2]); // j is inv of i1,i2,i3 j[i0]=0;j[i1]=1;j[i2]=2; return (k%2)+ ((j[0]+3)%3)*2; // signe + depart*2 } // build de permutation template inline void SetNumPerm(int n,int *p) { ffassert(0); }// a error} template inline void SetNumPerm1(int n,int *p) { ffassert(0); }// a error} template<> inline void SetNumPerm<1>(int ,int *p) { p[0]=0;} // a error} template<> inline void SetNumPerm<2>(int n,int *p) { p[0]=n;p[1]=1-n;} // a error} // build perm inverse template<> inline void SetNumPerm1<1>(int ,int *p) { p[0]=0;} // a error} template<> inline void SetNumPerm1<2>(int n,int *p) { p[0]=n;p[1]=1-n;} // a error} template<> inline void SetNumPerm1<3>(int n,int *p) { int i=n/2, j= n%2 ? 2:1; p[i]=0;p[(i+j)%3]=1;p[(i+j+j)%3]=2; assert( n == NumPerm1<3>(p)); } template<> inline void SetNumPerm<3>(int n,int *p) { int i=n/2, j= n%2 ? 2:1; p[0]=i;p[1]=(i+j)%3;p[2]=(i+j+j)%3; assert( n == NumPerm<3>(p)); } // --- end add periodic class DataFENodeDF { int * nbref; // pointer on common ref counter public: int ndfon[4]; const int NbOfElements; const int NbOfNodes; const int NbOfDF; const int * const NodesOfElement; const int * const FirstDfOfNodeData; const int * const FirstNodeOfElement; // 0 const int MaxNbNodePerElement; const int MaxNbDFPerElement; const int MaxNbDFPerNode; int ndfonVertex()const {return ndfon[0];} int ndfonEdge()const {return ndfon[1];} int ndfonFace()const {return ndfon[2];} int ndfonTet()const {return ndfon[3];} DataFENodeDF(const DataFENodeDF & m) : nbref( m.nbref ) , NbOfElements(m.NbOfElements), NbOfNodes(m.NbOfNodes), NbOfDF(m.NbOfDF), NodesOfElement(m.NodesOfElement), FirstDfOfNodeData(m.FirstDfOfNodeData), FirstNodeOfElement(m.FirstNodeOfElement), MaxNbNodePerElement(m.MaxNbNodePerElement), MaxNbDFPerElement(m.MaxNbDFPerElement) , MaxNbDFPerNode(maxdfon(m.ndfon)) { for(int i=0;i class GenericVertex : public Rn,public Label { template friend class GenericMesh; friend inline ostream& operator <<(ostream& f, const GenericVertex & v ) { f << (const Rn &) v << ' ' << (const Label &) v ; return f; } friend inline istream& operator >> (istream& f, GenericVertex & v ) { f >> (Rn &) v >> (Label &) v ; return f; } Rn *normal; // pointeur sur la normal exterieur pour filtre des points de departs public: typedef Rn Rd; static const int d=Rd::d; GenericVertex() : Rd(),Label(),normal(0) {}; GenericVertex(const Rd & P,int r=0): Rd(P),Label(r),normal(0){} void SetNormal(Rd *&n,const Rd & N) { if (normal) { Rd NN=*normal+N; *normal= NN/NN.norme(); } else *(normal=n++)=N;} Rd Ne() const {return normal ? *normal: Rd();} bool ninside(const Rd & P) const { return normal? (Rd(*this,P),*normal)<=0: true; } private: // pas de copie pour ne pas prendre l'adresse GenericVertex(const GenericVertex &); void operator=(const GenericVertex &); }; inline R1 ExtNormal( GenericVertex *const v[2],int const f[1]) { return f[0]==0 ? R1(-1):R1(1); } inline R2 ExtNormal( GenericVertex *const v[3],int const f[2]) { return R2(*v[f[1]],*v[f[0]]).perp(); } // correct signe N in 3d mai 2009 (FH) inline R3 ExtNormal( GenericVertex *const v[4],int const f[3]) { return R3(*v[f[0]],*v[f[2]])^R3(*v[f[0]],*v[f[1]]) ; } template class GenericElement: public Label { public: typedef typename Data::V Vertex; typedef typename Data::V::Rd Rd; typedef typename Data::RdHat RdHat;// for parametrization typedef typename Data::RdHatBord RdHatBord;// for parametrization typedef typename Rd::R R; static const int nv=Data::NbOfVertices; // nb of vertices static const int ne=Data::NbOfEdges; // nb of edges static const int nf=Data::NbOfFaces; // nb of faces static const int nt=Data::NT; // nb of tets static const int nitem=nv+ne+nf+nt; static const int nva=Data::NbOfVertexOnHyperFace; static const int nea=Data::NbOfAdjElem; static const int d=Rd::d; static const int (* const nvedge)[2] ;// static const int (* const nvface)[3] ;// static const int (* const onWhatBorder)[nitem] ;// static const int (* const nvadj)[nva] ;// static const int nitemdim[4]; // nv,ne,nf,nt // variable prive private: Vertex *vertices[nv]; // an array of 3 pointer to vertex R mes; public: GenericElement() {} const Vertex & operator[](int i) const { ASSERTION(i>=0 && i =0 && i 0); return *this; } void changeOrientation() {swap(vertices[0],vertices[1]);} istream & Read1(istream & f,Vertex * v0,int n) { int iv[nv],ir,err=0; for (int i=0;i> iv[i]; iv[i]--; if ( ! (iv[i]>=0 && iv[i]> ir; if(err || ! f.good() ) { cerr << " Erreur GenericElement::Read1 " << nv << " " << n << " : " ; for (int j=0;j=0 && i f[1]) fo = -fo,Exchange(f[0],f[1]); if(f[1]>f[2]) { fo = -fo,Exchange(f[1],f[2]); if(f[0]>f[1]) fo = -fo,Exchange(f[0],f[1]); } return fo; } int facePermutation(int i) const {// def the permutatution of orient the face int fo =0; const Vertex * f[3]={&at(nvface[i][0]), &at(nvface[i][1]), &at(nvface[i][2])}; if(f[0]>f[1]) fo+=1,Exchange(f[0],f[1]); if(f[1]>f[2]) { fo+=2,Exchange(f[1],f[2]); if(f[0]>f[1]) fo+=4,Exchange(f[0],f[1]); } return fo; } bool EdgeOrientation(int i) const { return &at(nvedge[i][0]) < &at(nvedge[i][1]);} R lenEdge(int i) const {ASSERTION(i>=0 && i <3); Rd E=Edge(i);return sqrt((E,E));} R lenEdge2(int i) const {ASSERTION(i>=0 && i <3); Rd E=Edge(i);return ((E,E));} R mesure() const {return mes;} static int NbNodes(int c) // use the bit i of c to say if node in objet of dim i existe { int c0=(c&1)!=0, c1=(c&2)!=0, c2=(c&4)!=0, c3=(c&8)!=0; return nv*c0 +ne*c1 +nf*c2 + nt*c3 ;} static int NbNodes(const int c[4]) // use the bit i of c to say if node in objet of dim i existe { int c0=(c[0])!=0, c1=(c[1])!=0, c2=(c[2])!=0, c3=(c[3])!=0; return nv*c0 +ne*c1 +nf*c2 + nt*c3 ;} void Renum(Vertex *v0, int * r) { for (int i=0;i inline void PermI2J(const void **I,const void **J,int *S) { ffassert(0); } template<> inline void PermI2J<1>(const void **I,const void **J,int *S) { S[0]=0; } template<> inline void PermI2J<2>(const void **I,const void **J,int *S) { if(I[0]==J[0]) { assert(I[1]==J[1]); S[0]=0;S[1]=1;} else { assert(I[1]==J[0]&&I[0]==J[1]); S[0]=1;S[1]=0;} } template<> inline void PermI2J<3>(const void **I,const void **J,int *S) { if(I[0]==J[0]) S[0]=0; else if(I[0]==J[1]) S[0]=1; else {S[0]=2; assert(I[0]==J[2]) ;} if(I[1]==J[0]) S[1]=0; else if(I[1]==J[1]) S[1]=1; else {S[1]=2; assert(I[1]==J[2]) ; } S[2]=3-S[0]-S[1]; assert(I[2]==J[3-S[0]-S[1]]); } template class GenericMesh : public RefCounter { public: typedef GenericMesh GMesh; typedef T Element; typedef typename V::Rd Rd; typedef typename Rd::R R; typedef V Vertex; typedef B BorderElement; typedef EF23::GTree GTree; typedef typename Element::RdHat RdHat;// for parametrization int nt,nv,nbe; R mes,mesb; //private: V *vertices; T *elements; B *borderelements; Rd * bnormalv; // boundary vertex normal Rd Pmin,Pmax; // // the bound of the domain see BuildBound static const int nea=T::nea; // numbering of adj (4 in Tet, 3 in Tria, 2 in seg) static const int nva=T::nva; // numbering of vertex in Adj element static int kfind,kthrough; // number of search and number of throught element. int *TheAdjacencesLink; // to store the adj link k*nea+i -> k'*nea+i' int *BoundaryElementHeadLink; // int *ElementConteningVertex; GTree *gtree; public: int nbElmts() const {return nt;} int nbBrdElmts() const {return nbe;} int nbVertices() const {return nv;} const T & operator[](int i) const {return elements[CheckT(i)];} const V& operator()(int i) const {return vertices[CheckV(i)];} const B& be(int i) const {return borderelements[CheckBE(i)];} void BoundingBox(Rd &pmin,Rd &pmax) const {pmin=Pmin;pmax=Pmax;} T & t(int i) {return elements[CheckT(i)];} V & v(int i) {return vertices[CheckV(i)];} B & be(int i) {return borderelements[CheckBE(i)];} const T & t(int i) const {return elements[CheckT(i)];} const V & v(int i) const {return vertices[CheckV(i)];} GenericMesh() : nt(0),nv(0),nbe(0), mes(0.),mesb(0.) , vertices(0),elements(0),borderelements(0),bnormalv(0), TheAdjacencesLink(0),BoundaryElementHeadLink(0), ElementConteningVertex(0), gtree(0) {} GenericMesh(const Serialize &serialized) ; void set(int mv,int mt,int mbe) { assert(nt==0 && nv==0 && nbe ==0); nt=mt; nv=mv; nbe=mbe; vertices=new V[nv]; elements= new T[nt]; borderelements = new B[nbe]; assert( nt >=0 && elements); assert( nv >0 && vertices); } int operator()(const T & tt) const {return CheckT(&tt - elements);} int operator()(const T * tt) const {return CheckT(tt - elements);} int operator()(const V & vv) const {return CheckV(&vv - vertices);} int operator()(const V * vv) const{return CheckV(vv - vertices);} int operator()(const B & k) const {return CheckBE(&k - borderelements);} int operator()(const B * k) const{return CheckBE(k - borderelements);} int operator()(int it,int j) const {return operator()(elements[it][j]);}// Nu vertex j of triangle it int be(int it,int j) const {return operator()(borderelements[it][j]);}// Nu vertex j of triangle it int CheckV(int i) const { ASSERTION(i>=0 && i < nv); return i;} int CheckT(int i) const { ASSERTION(i>=0 && i < nt); return i;} int CheckBE(int i) const { ASSERTION(i>=0 && i < nbe); return i;} int Contening(const Vertex * vv) const{ return ElementConteningVertex[ vv - vertices];} void BuildAdj(); void BuildBoundaryElementAdj(); // Add J. Morice function that give the TheAdjacencesSurfaceLink :: Version avec un manifold void BuildBoundaryElementAdj(const int &nbsurf, int* firstDefSurface, int* labelDefSurface, int* senslabelDefSurface); // version avec plusieurs varits // void BuildBoundaryElementAdj_V2(const int &nbsurf, int* firstDefSurface, int* labelDefSurface, int* senslabelDefSurface); // bug inside a retoucher void Buildbnormalv(); void BuildBound(); void BuildjElementConteningVertex(); void BuildGTree() {if(gtree==0) gtree=new GTree(vertices,Pmin,Pmax,nv);} DataFENodeDF BuildDFNumbering(int dfon[NbTypeItemElement],int nbequibe=0,int *equibe=0) const ; DataFENodeDF BuildDFNumbering(int ndfv,int ndfe,int ndff,int ndft,int nbequibe=0,int *equibe=0) const { int dfon[NbTypeItemElement]={ndfv,ndfe,ndff,ndft}; return BuildDFNumbering(dfon,nbequibe,equibe); } int ElementAdj(int k,int &j) const { int p=TheAdjacencesLink[nea*k+j]; if(p>=0) j=p%nea; return p>=0 ? p/nea: -1-j;}// modif FH. to change the code of copule k,kadj on border element.. // correct bug of 23/05/2013 : 1 dof on RT0 3d... int ElementAdj(int k,int &j,Rd& PHat) const { // return the kk the number of adj element k to hyperface j (opposite to vertex j) // out j: is the new hyperface number in element kk. // and // in : Pt is the point on hyperface j on element k on ref element K hat. // remark lb[j]==0 at enter // you get the new point Pt (in on hyperface j on element kk // and lb[j] ==0 at return (j have change). int p=TheAdjacencesLink[nea*k+j]; if(p>=0) { R lb[Rd::d+1];//{1.-PHat.sum(),PHat}; R lbb[Rd::d+1];//{1.-PHat.sum(),PHat}; PHat.toBary(lb); // R1 R2 R3 if(Abs(lb[j])>1e-10) assert(Abs(lb[j])<1e-10); int sigma[T::nva]; const void * nvkj[T::nva], *nvkkjj[T::nva]; int jj=p%nea; int kk=p/nea; Element & K(elements[CheckT(k)]); Element & KK(elements[CheckT(kk)]); Rd Pin=K(PHat); for (int l=0;l(nvkj,nvkkjj,sigma); for (int l=0;l 1e-10 ) { for (int l=0;l<=T::nva;++l) cout << lbb[l] <<" < -- " << lb[l] << endl; for (int l=0;l " << PHat << " jj = " << jj << endl; assert(0); } #endif j=jj; return kk; } return -1;// on border } int GetAllElementAdj(int it,int *tabk) const { // get the tab of all adj element (max ne) // and return the size of the tab int i=0; for(int j=0;j=0 && tabk[i]!=it) i++; } return i; } int BoundaryElement(int bbe,int & ItemInK) const { int i= BoundaryElementHeadLink[bbe]; ItemInK = i%nea; return i/nea;} // Add J. Morice template SortArray itemadjs(const int (* const nu )[N],int k,int i, int *sens) const { int nnv[N]; const B & K(borderelements[CheckBE(k)]); ASSERTION(i>=0 && i (nnv,sens); } SortArray items(int k,int i,int *sens) const { return itemadjs(B::nvadj,k,i,sens); } template SortArray iteme(const int (* const nu )[N],int k,int i,int *psens=0) const { int nnv[N]; const Element & K(elements[CheckT(k)]); ASSERTION(i>=0 && i (nnv,psens); } SortArray itemadj(int k,int i,int *psens=0) const { return iteme(T::nvadj,k,i,psens); } SortArray itembe(int k,int *psens=0) const { int nnv[B::nv]; const B & K(borderelements[CheckBE(k)]); for (int j=0;j(nnv,psens); } // const Element * Find(const Rd & P) const ; const Element * Find(Rd P, RdHat & Phat,bool & outside,const Element * tstart=0) const {return EF23::Find(*this,this->gtree,P,Phat,outside,tstart);} R mesure(){ return mes;} R bordermesure(){ return mesb;} virtual ~GenericMesh() { //cout << "~GenericMesh\n"; delete [] ElementConteningVertex; delete [] TheAdjacencesLink; delete [] BoundaryElementHeadLink; delete [] borderelements; if(nt>0) delete [] elements; delete [] vertices; delete [] bnormalv; if(gtree) delete gtree; ElementConteningVertex=0; TheAdjacencesLink=0; BoundaryElementHeadLink=0; borderelements=0; elements=0; vertices=0; bnormalv=0; gtree=0; nt=(0); nv=(0); nbe=(0); mes=(0.); mesb=(0.); } Serialize serialize() const; private: GenericMesh(const GenericMesh &); // pas de construction par copie void operator=(const GenericMesh &);// pas affectation par copy }; template void GenericMesh::BuildjElementConteningVertex() { const int nkv= T::nv; int lerr[10]; if(!ElementConteningVertex) ElementConteningVertex = new int[nv]; for(int i=0;i void GenericMesh::BuildAdj() { // const int nva = T::nva; // const int nea = T::nea; if(TheAdjacencesLink!=0) return ;// already build ... TheAdjacencesLink = new int[nea*nt]; BoundaryElementHeadLink = new int[nbe]; HashTable,int> h(nea*nt,nv); int nk=0,nba=0; int err=0; if(verbosity>5) cout << " -- BuildAdj:nva=// nea=" << nva << " " << nea << " "<< nbe << endl; for (int k=0;k a(itemadj(k,i,&sens));// warning the face of tet given interieon normal FH. //cout << " ### " << " item(k,i)= " << itemadj(k,i) << " a= " << a << " k " << k << " i " << i << endl; typename HashTable,int>::iterator p= h.find(a); if(!p) { h.add(a,nk); TheAdjacencesLink[nk]=-1; nba++; } else { ASSERTION(p->v>=0); TheAdjacencesLink[nk]=p->v; TheAdjacencesLink[p->v]=nk; p->v=-1-nk; nba--; } ++nk; } int kerr=0,kerrf=0,nbei=0; map,pair > mapfs; int uncorrect =0, nbchangeorient=0; for(int step=0; step<2; ++step) { for (int ke=0;ke a(itembe(ke,&sens)); typename HashTable,int>::iterator p= h.find(a); //cout << k << " ### " << " item(k,i)= " << itembe(k) << " a= " << a << endl; if(!p) { err++; if(err==1) cerr << "Err Border element not in mesh \n"; if (err<10) cerr << " \t " << ke << " " << a << endl; } else { int nk = p->v <0 ? -p->v-1 : p->v; int nkk= TheAdjacencesLink[nk]; if( nkk>=0) { nbei ++; intern=1; // choise le bon .. too get the correct normal int k= nk/nea, e=nk%nea; int kk= nkk/nea, ee=nkk%nea; itemadj(k,e,&s); itemadj(kk,ee,&ss); assert(s && ss && s== -ss); if( sens == s) {swap(nk,nkk);swap(k,kk);} // autre cote // verif sens normal int regk= elements[k].lab; int regkk= elements[kk].lab; if(regk != regkk) { // verif orientation interior normal int sr =1; if(step==0) { if(regk>regkk) mapfs[make_pair(regkk,regk)].second++;// increme le + grand else mapfs[make_pair(regk,regkk)].first++;// increme le + grand } else { // correct the sens of face if(regk>regkk) sr=-1,swap(regk,regkk); // change orientation de du plus petit nombre map,pair >::iterator p= mapfs.find(make_pair(regk,regkk)); int nfk = p->second.first; int nfkk =p->second.second; // event regkk bool change=0; if( (nfk < nfkk) && sr == 1 ) change=1; if( (nfk > nfkk) && sr == -1 ) change=1; if( change) { nbchangeorient++; borderelements[ke].changeOrientation(); if(verbosity>2) cout << " changeOrientation face:"<< ke << endl; swap(nk,nkk); swap(k,kk); } } } } BoundaryElementHeadLink[ke] = nk; int sk; int tt=BoundaryElementHeadLink[ke]/nea; int ee=BoundaryElementHeadLink[ke]%nea; itemadj(tt,ee,&sk); if(!(itemadj(tt,ee)==a)) { if(kerrf< 10) cout << " err face not in element "<< ke << " ==" << tt << " " << ee << endl; kerrf++; } } } for(map,pair >::iterator p=mapfs.begin(); p != mapfs.end(); ++p) { if( p->second.first && p->second.second) { if(verbosity && step==0) cout << " error in orientation of internal face beetwen region " << p->first.first << " , " << p->first.second << " to no zero value " << p->second.first << " " << p->second.second << endl; uncorrect++; } } if(uncorrect==0) break; } if( nbchangeorient && verbosity) cout << " Warning change oriantation of " << nbchangeorient << " faces \n"; if( kerr || kerrf ) { cout << " Erreur in boundary orientation bug in mesh or bug in ff++ " << kerr << " / " <1) { cout << " -- BuildAdj: nb Elememt " << nt << " nb vertices " << nv << endl; cout << " : nb adj = "<< na << " on border " << nba << " nea = " << nea << " nva = " << nva ; if(nea==2) cout << " Const d'Euler: " << nt - na + nv << endl; else cout << endl; } } /* template void GenericMesh::BuildSurface(const int &nb, KN SurfaceDef) { int nbsurf; nbsurf = nb; KN surfa } */ template void GenericMesh::BuildBoundaryElementAdj() { // Return in TheBorderElementAjacencesLink // if exist a link :: sign(nk_link)*(nk_link+1) // else :: sign(nk)*(nk) // assert(TheBoundaryElementAdjacencesLink==0); plus tard int *TheBoundaryElementAdjacencesLink = new int[B::nea*nbe]; HashTable,int> h(B::nea*nbe,nv); int nk=0; int err=0; int sens; cout << "nea/nva" << B::nea << " " << B::nva << endl; for (int k=0;k a(items(k,i,&sens)); typename HashTable,int>::iterator p= h.find(a); if(!p) { h.add(a,nk); TheBoundaryElementAdjacencesLink[nk] = sens*(nk+1) ; // sens; } else { ASSERTION(p->v>=0); if( sens*TheBoundaryElementAdjacencesLink[p->v] > 0 ){ B & K(borderelements[CheckBE(k)]); int firstVertex = operator()(K[B::nvadj[i][0]])+1; int secondVertex = operator()(K[B::nvadj[i][1]])+1; cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << ", is oriented in the same direction in element " << k+1 << " and in element "<< 1+(p->v/B::nea) << endl; err++; assert(err==0); } if( abs(TheBoundaryElementAdjacencesLink[p->v]) != 1+p->v ){ B & K(borderelements[CheckBE(k)]); int firstVertex = operator()(K[B::nvadj[i][0]])+1; int secondVertex = operator()(K[B::nvadj[i][1]])+1; cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << "belong to the three border elements ::" << 1+(p->v)/B::nea <<", "<< k+1 <<" and "<< 1+(abs(TheBoundaryElementAdjacencesLink[p->v])-1)/B::nea << endl; cout << " The Surface contains these edges is not a manifold" << endl; err++; } TheBoundaryElementAdjacencesLink[nk]= TheBoundaryElementAdjacencesLink[p->v]; TheBoundaryElementAdjacencesLink[p->v]= sens*(nk+1); } if( err > 10 ) exit(1); nk++; } assert(err==0); delete [ ] TheBoundaryElementAdjacencesLink; if(verbosity) cout << "number of adjacents edges " << nk << endl; } template void GenericMesh::BuildBoundaryElementAdj(const int &nbsurf, int* firstDefSurface, int* labelDefSurface, int* senslabelDefSurface) { // Return in TheBoundaryElementAdjacences // if exist a link :: sign(nk_link)*(nk_link+1) // else :: sign(nk)*(nk) for(int isurf=0; isurf < nbsurf; isurf++){ //###################################### // Trop operations if ===> a changer int nbe_surf=0; // number in the surface for(int k=0; k,int> h(B::nea*nbe_surf,nv); int nk=0; int err=0; int sens; cout << "nea/nva" << B::nea << " " << B::nva << endl; for (int k=0;k a(items( surf_be[k],i,&sens)); sens=sens*orientation_surf_be[k]; typename HashTable,int>::iterator p= h.find(a); if(!p) { h.add(a,nk); TheBoundaryElementAdjacencesLink[nk]=sens*(nk+1); // nk est un nombre locale depend de la surfaces choisie // element du bord est donne par :: surf_be[nk/3]; // arrete corespondante locale de l'element :: nk%3; } else { ASSERTION(p->v>=0); if( sens*TheBoundaryElementAdjacencesLink[p->v] > 0 ){ B & K(borderelements[CheckBE(surf_be[k])]); int firstVertex = operator()(K[B::nvadj[i][0]])+1; int secondVertex = operator()(K[B::nvadj[i][1]])+1; cout << " The edges, defined by vertex is " << firstVertex << "-" << secondVertex << ", is oriented in the same direction in element " << surf_be[k]+1 << " and in element "<< 1+surf_be[(p->v/B::nea)] << endl; err++; } if( abs(TheBoundaryElementAdjacencesLink[p->v]) != 1+p->v ){ B & K(borderelements[CheckBE(k)]); int firstVertex = operator()(K[B::nvadj[i][0]])+1; int secondVertex = operator()(K[B::nvadj[i][1]])+1; cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << "belong to the three border elements ::" << 1+surf_be[(p->v)/B::nea] <<", "<< surf_be[k]+1 <<" and "<< 1+surf_be[(abs(TheBoundaryElementAdjacencesLink[p->v])-1)/B::nea] << endl; cout << " The "<< isurf+1 << " Surface contains these edges is not a manifold" << endl; err++; assert(err==0); } TheBoundaryElementAdjacencesLink[nk] = TheBoundaryElementAdjacencesLink[p->v];; TheBoundaryElementAdjacencesLink[p->v] = sens*(nk+1); } if( err > 10 ) exit(1); nk++; } assert(err==0); delete [] surf_be; delete [] orientation_surf_be; delete [ ] TheBoundaryElementAdjacencesLink; if(verbosity) cout << "number of adjacents edges " << nk << endl; } } // template // void GenericMesh::BuildBoundaryElementAdj_V2(const int &nbsurf,int *firstDefSurface, int *labelDefSurface, int *senslabelDefSurface) // { // // assert(firstDefSurface.N() == nbsurf+1); // // assert(labelDefSurface.N() == firstDefSurface[nbsurf]); // // assert(senslabelDefSurface.N() == firstDefSurface[nbsurf]); // // determination des labels des surfaces // map maplabel; // int numero_label=0; // for(int ii=0; ii< firstDefSurface[nbsurf]; ii++){ // map::const_iterator imap=maplabel.find( abs(labelDefSurface[ii]) ); // //cout << "K.lab= " << K.lab << endl; // if(imap == maplabel.end()){ // maplabel[ abs(labelDefSurface[ii]) ] = numero_label; // numero_label = numero_label+1; // } // } // int *nbe_label=new int[numero_label]; // for(int ii=0; ii< numero_label; ii++) nbe_label[ii] = 0; // for(int k=0; k::const_iterator imap=maplabel.find( K.lab ); // // if(imap == maplabel.end()){ // // printf("The label %d given for Definition of different surface is not in the border element mesh\n",K.lab); // // exit(1); // // } // // else{ // nbe_label[(*imap).second]++; // // } // } // int all_nbe_label=0; // for(int k=0; k::const_iterator imap=maplabel.find( K.lab ); // assert(imap != maplabel.end()); // organisation_be_label[ debut_nbe_label[(*imap).second] + count_nbe_label[(*imap).second] ] = k ; // count_nbe_label[(*imap).second ]++; // } // for(int ii=0; ii< numero_label; ii++) // assert( count_nbe_label[ii] == nbe_label[ii] ); // delete [] count_nbe_label; // for(int isurf=0; isurf < nbsurf; isurf++){ // int nbe_surf=0; // number in the surface // for( int iii=firstDefSurface[isurf]; iii< firstDefSurface[isurf+1];iii++ ){ // map::const_iterator imap=maplabel.find( abs(labelDefSurface[iii]) ); // nbe_surf=nbe_surf+nbe_label[ (*imap).second ]; // } // // assert(TheBoundaryElementAdjacencesLink==0); plus tard // int *TheBoundaryElementAdjacencesLink = new int[B::nea*nbe_surf]; // HashTable,int> h(B::nea*nbe_surf,nv); // int nk=0; // int err=0; // int sens; // int count_sbe; // int *surf_be = new int[nbe_surf]; // count_sbe=0; // for( int iii=firstDefSurface[isurf]; iii< firstDefSurface[isurf+1];iii++ ){ // map::const_iterator imap=maplabel.find( abs(labelDefSurface[iii]) ); // for( int jjj= debut_nbe_label[(*imap).second]; jjj < debut_nbe_label[(*imap).second+1]; jjj++ ){ // int k=organisation_be_label[jjj]; // surf_be[count_sbe] = k; // count_sbe++; // for (int i=0;i a(items( k,i,&sens)); // sens=sens*senslabelDefSurface[iii]; // typename HashTable,int>::iterator p= h.find(a); // if(!p) // { // h.add(a,nk); // TheBoundaryElementAdjacencesLink[nk] = sens*(nk+1); // } // else // { // ASSERTION(p->v>=0); // if( sens*TheBoundaryElementAdjacencesLink[p->v] > 0){ // B & K(borderelements[CheckBE(k)]); // int firstVertex = operator()(K[B::nvadj[i][0]])+1; // int secondVertex = operator()(K[B::nvadj[i][1]])+1; // cout << " The edges, defined by vertex is " << firstVertex << "-" << secondVertex << ", is oriented in the same direction in element " << k+1 << // " and in element "<< 1+surf_be[(p->v/B::nea)] << endl; // err++; // } // if( abs(TheBoundaryElementAdjacencesLink[p->v]) != 1+p->v ){ // B & K(borderelements[CheckBE(k)]); // int firstVertex = operator()(K[B::nvadj[i][0]])+1; // int secondVertex = operator()(K[B::nvadj[i][1]])+1; // cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << "belong to the three border elements ::" // << 1+surf_be[(p->v)/B::nea] <<", "<< surf_be[k]+1 <<" and "<< 1+surf_be[(abs(TheBoundaryElementAdjacencesLink[p->v])-1)/B::nea] << endl; // cout << " The "<< isurf+1 << " Surface contains these edges is not a manifold" << endl; // err++; // assert(err==0); // } // TheBoundaryElementAdjacencesLink[nk]=TheBoundaryElementAdjacencesLink[p->v]; // TheBoundaryElementAdjacencesLink[p->v]=sens*(nk+1); // } // if( err > 10 ) // exit(1); // nk++; // } // } // } // assert(err==0); // delete [ ] TheBoundaryElementAdjacencesLink; // delete [ ] surf_be; // if(verbosity) cout << "number of adjacents edges " << nk << endl; // } // delete [] organisation_be_label; // delete [] debut_nbe_label; // delete [] nbe_label; // } template DataFENodeDF GenericMesh::BuildDFNumbering(int ndfon[NbTypeItemElement],int nbequibe,int *equibe) const { /* nbequibe nb of borderelement with equi boundary condition for i =0, 2*nbequibe, i+= 2) be0= equibe[i]/8 <=> be1=equibe[i+1] /8 equibe[i]%8 given the permuation p0 compare to sort array. equibe[i+1]%8 given the permuation p1 compare to sort array. the numbering of perumation SetNumPerm(p0,equibe[i+1]%8); SetNumPerm(p1,equibe[i+1]%8); so a level of point with always have: be0[p0[j]] <==> be1[p1[j]] */ const GenericMesh & Th(*this); int nnodeK = T::NbNodes(ndfon); int *p = 0, *pp=0; unsigned int tinfty=std::numeric_limits::max() ; const int nkv= T::nv; const int nkf= T::nf; const int nke= T::ne; const int nkt= T::nt; const int nbev= B::nv; const int nbef= B::nf; const int nbee= B::ne; const int nk[]={nkv,nke,nkf,nkt}; int MaxNbNodePerElement=0; int MaxNbDFPerElement=0; int nbNodes=0; int NbOfDF=0; int n=0; int minndf=100000000; int maxndf=0; int nbnzero=0; for (int dd=0;dd0); const int nkeys=4+6+4+1; assert(nnodeK<= nkeys); if(nodearevertices) { nbNodes=nv; NbOfDF=nbNodes*ndfon[0]; } else { p = new int[nnodeK*nt]; typedef SortArray Key; Key keys[nkeys*2]; int keysdim[nkeys*2]; int of = Th.nv+10;// Modif FH 28/05/2013 int ndim[NbTypeItemElement]={0,0,0,0}; NbOfDF=0; { HashTable h(nnodeK*nt,of+nt); int nbmaxeq = 1+nnodeK*nbequibe; int nbhasheq = nbequibe ? of+nt : 1; HashTable equi(nbmaxeq,nbhasheq); // constuction of item translation for if(verbosity>9) cout << " nb equi be : " << nbequibe << endl; for(int ieq=0,keq=0;keq(pe1,p1); SetNumPerm(pe2,p2); int m=0; for(int i=0;i100) cout << be1<< " " << be2 << " " << v1[i] << " <--> " << v2[i] << " / " << Th(v1[i]) << " <=> " << Th(v2[i]) << endl; } if( ndfon[1] ) for(int i=0;i::iterator pe = if(keys[i0]< keys[i1] ) // not equal ... Add nov. 2014 equi.add(keys[i0],keys[i1]); // if(pe) assert(pe->k == keys[i0]); } } // to find the final equivalent key ... // in change of chaibe of equi key for (int it=0,change=1;change;it++) { change=0; ffassert(it++<100); for (typename HashTable::iterator qe,pe=equi.begin() ; pe != equi.end(); ++pe) { if( verbosity>9999) cout << pe->k << " " << pe->v << endl; ffassert( pe->k < pe->v); qe=equi.find(pe->v); if(qe) { if( verbosity>9999) cout << pe->k << " " << pe->v << " <=> " << qe->k <k < qe->v); pe->v = qe->v; } } if(verbosity>5) cout << " -- BuildDF: iteration in final equivalent " << it << " nb change " << change << endl; } // construction of nodes numbering // ------------ for(int k=0;k::iterator pe= equi.find(ki); if(pe) { ki= pe->v; } typename HashTable::iterator pk= h.find(ki); if(!pk) { pk = h.add(ki,nbNodes++); NbOfDF += ndfon[keysdim[i]]; } if(verbosity>100 && pe ) cout << kio << " -> " << pe->k << " :: " << pk->v << endl; p[n++] = pk->v; ndim[keysdim[i]]++; } } } if(verbosity) { cout << " -- Build Nodes/DF on mesh : n.v. " << nv << ", n. elmt. " << nt << ", n b. elmt. " < void GenericMesh::Buildbnormalv() { const int nkv= T::nv; // const int nkf= T::nf; // const int nke= T::ne; // const int nkt= T::nt; if (bnormalv) {return;} int nb=0; for (int k=0;k4) cout << " number of real boundary element " << nb << endl; bnormalv= new Rd[nb]; Rd *n=bnormalv; for (int k=0;k Serialize GenericMesh::serialize() const { const int nve = T::nv; const int nvbe = B::nv; const int d = Rd::d; long long l=0; l += sizeof(long long); l += 6*sizeof(int); l += nt*(sizeof(int)*(nve + 1)); l += nv*( sizeof(int) + sizeof(double)*d); l += nbe*(sizeof(int)*(nvbe+1)); if(verbosity>3) cout << "Serialize gmesh " << l << " " << nve << " " << nvbe << endl; Serialize serialized(l,GenericMesh_magicmesh); // cout << l << magicmesh << endl; size_t pp=0; serialized.put(pp, l); serialized.put( pp,d); serialized.put( pp,nve); serialized.put( pp,nvbe); serialized.put( pp,nt); serialized.put( pp,nv); serialized.put( pp,nbe); if (verbosity>9) cout << " GenericMesh Serialized : " << l << " " << nt << " " << nv << " " << nbe << endl; for (int i=0;i GenericMesh::GenericMesh(const Serialize &serialized) : nt(0),nv(0),nbe(0), mes(0.),mesb(0.) , vertices(0),elements(0),borderelements(0),bnormalv(0), TheAdjacencesLink(0),BoundaryElementHeadLink(0), ElementConteningVertex(0), gtree(0) { const int nve = T::nv; const int nvbe = B::nv; const int d = Rd::d; int dd,nnve,nnvbe,nnt,nnv,nnbe; long long l=0; size_t pp=0; serialized.get(pp, l); serialized.get( pp,dd); serialized.get( pp,nnve); serialized.get( pp,nnvbe); serialized.get( pp,nnt); serialized.get( pp,nnv); serialized.get( pp,nnbe); ffassert(d==dd && nve == nnve && nvbe == nnvbe); set(nnv,nnt,nnbe); for (int i=0;i static void SetPtPk(Rd *Pt,const int *dfon,int nn) { // P0 P1 et P2 , P1b const int d= E::Rd::d; int k=0; if(dfon[0]) { for(int i=0;i<=d;++i) Pt[k++]=Rd(); for(int i=0;i9) cout << " Pk = " << KN_(Pt,nn)<<"\n"; } // a class of Lagrange Pk finite element template class TypeOfFE_Lagrange: public GTypeOfFE { //typedef typename MMesh Mesh; public: typedef MMesh Mesh; typedef typename Mesh::Element Element; typedef typename Element::Rd Rd; typedef typename Element::RdHat RdHat; static const int d=Rd::d; struct A4 { int dfon[4]; A4(int k) { if(k==0) {// P0 dfon[0]=dfon[1]=dfon[2]=dfon[3]=0; dfon[d]=1; } else if(k==-1) // P1b. add FH March 2009 { dfon[0]=1; dfon[1]=dfon[2]=dfon[3]=0; dfon[d]=1; } else { dfon[0]=1; dfon[1]=max(k-1,0); dfon[2]=d>1?max(k-2,0):0; dfon[3]=d>2?max(k-3,0):0;} if(verbosity>9) cout << "A4 "<< k<< " " <(A4(k),1,k==-1?-1:Max(k,1),k<=2,k==0) { int n=this->NbDoF; if(verbosity>9) cout << "\n +++ P"< (this->PtInterpolation,this->ndfOn(),this->NbDoF); if(verbosity>9) cout << this->PtInterpolation<< endl; for (int i=0;ipInterpolation[i]=i; this->cInterpolation[i]=0; this->dofInterpolation[i]=i; this->coefInterpolation[i]=1.; } } ~TypeOfFE_Lagrange(){ } //cout << "TypeOfFE_Lagrange"<< this->NbDoF< void SplitSimplex(int N,int & nv, Rd *& P, int & nk , int *& K); // Add J. Morice for function trunc. void SplitSurfaceSimplex(int N,int &ntri2, int *&tri); freefem++-3.61-1/src/femlib/P012_1d.cpp000644 000767 000024 00000012324 13256636774 017364 0ustar00hechtstaff000000 000000 // ********** DO NOT REMOVE THIS BANNER ********** // ORIG-DATE: Jan 2008 // -*- Mode : c++ -*- // // SUMMARY : P0,P1,P2 lagrange 1D // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #include "PkLagrange.hpp" namespace Fem2D { // P0 class TypeOfFE_P0Lagrange1d : public TypeOfFE_Lagrange { public: TypeOfFE_P0Lagrange1d(): TypeOfFE_Lagrange(0) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P0Lagrange1d::operator()(const FElement & K,const R1 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))); R r=0; if (op==0) r = u0; else r=0; return r; } void TypeOfFE_P0Lagrange1d::FB(const What_d whatd,const Mesh & ,const Element & K,const R1 & P,RNMK_ & val) const { assert(val.N() >=1); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = 1; } } // P1 class TypeOfFE_P1Lagrange1d : public TypeOfFE_Lagrange { public: TypeOfFE_P1Lagrange1d(): TypeOfFE_Lagrange(1) { } void FB(const What_d whatd,const Mesh & Th,const Element & K,const Rd &P, RNMK_ & val) const; virtual R operator()(const FElement & K,const RdHat & PHat,const KN_ & u,int componante,int op) const ; } ; R TypeOfFE_P1Lagrange1d::operator()(const FElement & K,const R1 & PHat,const KN_ & u,int componante,int op) const { R u0(u(K(0))), u1(u(K(1))); R r=0; if (op==0) { R l0=1-PHat.x,l1=PHat.x; r = u0*l0+u1*l1; } else if(op==op_dx ) { const Element & T=K.T; R1 D[2]; T.Gradlambda(D); r = D[0].x*u0 + D[1].x*u1 ; } // cout << r << "\t"; return r; } void TypeOfFE_P1Lagrange1d::FB(const What_d whatd,const Mesh & ,const Element & K,const R1 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x}; assert(val.N() >=Element::nv); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); if (whatd & Fop_D0) { f0[0] = l[0]; f0[1] = l[1]; } if (whatd & Fop_D1) { R1 Dl[3]; K.Gradlambda(Dl); if (whatd & Fop_dx) { RN_ f0x(val('.',0,op_dx)); f0x[0] = Dl[0].x; f0x[1] = Dl[1].x; } } } class TypeOfFE_P2Lagrange1d : public TypeOfFE_Lagrange { public: typedef Mesh1 Mesh; typedef GFElement FElement; TypeOfFE_P2Lagrange1d(): TypeOfFE_Lagrange(2) { } void FB(const What_d whatd,const Mesh & Th,const Mesh1::Element & K,const Rd &P, RNMK_ & val) const; } ; void TypeOfFE_P2Lagrange1d::FB(const What_d whatd,const Mesh & ,const Element & K,const R1 & P,RNMK_ & val) const { // const Triangle & K(FE.T); R l[]={1.-P.sum(),P.x}; assert(val.N() >=E::nv+E::ne); assert(val.M()==1 ); val=0; RN_ f0(val('.',0,op_id)); // if (whatd & Fop_D0) { int k=0; for(int i=0;i & P0Lagrange1d(P0_1d); static TypeOfFE_P1Lagrange1d P1_1d; GTypeOfFE & P1Lagrange1d(P1_1d); static TypeOfFE_P2Lagrange1d P2_1d; GTypeOfFE & P2Lagrange1d(P2_1d); template<> GTypeOfFE & DataFE::P0=P0_1d; template<> GTypeOfFE & DataFE::P1=P1_1d; template<> GTypeOfFE & DataFE::P2=P2_1d; } freefem++-3.61-1/src/femlib/Mesh3dn.hpp000644 000767 000024 00000012776 13256636774 017677 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model mesh 1d // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef MESH3DN_HPP_ #define MESH3DN_HPP_ #include // definition R #include namespace Fem2D { #include "R3.hpp" } using namespace ::std; #include "GenericMesh.hpp" namespace Fem2D { typedef GenericVertex Vertex3; struct DataTriangle3 { static const int NbOfVertices =3; static const int NbOfEdges =3; static const int NbOfFaces =1; static const int NT =0; static const int NbOfAdjElem =NbOfVertices; static const int NbOfVertexOnHyperFace =NbOfVertices-1; typedef Vertex3 V; typedef V::Rd Rd ; typedef R2 RdHat; typedef R1 RdHatBord; static RdHat PBord(const int * nvb,const RdHatBord &P) { return RdHat::KHat[nvb[0]]*(1-P.x)+R2::KHat[nvb[1]]*(P.x) ;} static R mesure( V * pv[NbOfVertices]) { return (R3(*pv[0],*pv[1])^R3(*pv[0],*pv[2])).norme()*0.5; } }; struct DataTet { static const int NbOfVertices =4; static const int NbOfEdges =6; static const int NbOfFaces =4; static const int NT =1; static const int NbOfAdjElem =NbOfVertices; static const int NbOfVertexOnHyperFace =NbOfVertices-1; typedef Vertex3 V; typedef V::Rd Rd ; static R mesure( V * pv[NbOfVertices]) { R3 AB(*pv[0],*pv[1]); R3 AC(*pv[0],*pv[2]); R3 AD(*pv[0],*pv[3]); return det(AB,AC,AD)/6.; } static const int (* const nvface)[3];// = nvfaceTet; static const int (* const nvedge)[2];// = nvedgeTet; typedef R3 RdHat; typedef R2 RdHatBord; static RdHat PBord(const int * nvb,const RdHatBord& P) { // cout << "PBORD : " << nvb[0] << " " << nvb[1] << nvb[2] << " " << P<< " -> " << RdHat::KHat[nvb[0]]*(1-P.x-P.y)+RdHat::KHat[nvb[1]]*(P.x)+RdHat::KHat[nvb[2]]*(P.y) // << "," << RdHat::KHat[nvb[0]] << "," << RdHat::KHat[nvb[1]] << "," << RdHat::KHat[nvb[2]] < { public: Tet() {}; // constructor empty for array R3 H(int i) const { ASSERTION(i>=0 && i <4); int nvface[4][3]= {{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}}; R3 AB(at(nvface[i][0]),at(nvface[i][1])); R3 AC(at(nvface[i][0]),at(nvface[i][2])); return AB^AC/(6.*this->mesure());} // heigth R3 n(int i) const { ASSERTION(i>=0 && i <4); int nvface[4][3]= {{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}}; R3 AB(at(nvface[i][0]),at(nvface[i][1])); R3 AC(at(nvface[i][0]),at(nvface[i][2])); R3 N=AB^AC; return N/N.norme();} // exterior normal void Gradlambda(R3 * GradL) const { R3 V1(at(0),at(1)); R3 V2(at(0),at(2)); R3 V3(at(0),at(3)); R det1=1./(6.*mesure()); GradL[1]= (V2^V3)*det1; GradL[2]= (V3^V1)*det1; GradL[3]= (V1^V2)*det1; GradL[0]=-GradL[1]-GradL[2]-GradL[3]; } }; class Triangle3: public GenericElement { public: Triangle3() {}; // constructor empty for array Rd Edge(int i) const {ASSERTION(i>=0 && i <3); return Rd(this->at((i+1)%3),this->at((i+2)%3));}// opposite edge vertex i /* Rd H(int i) const { ASSERTION(i>=0 && i <3); Rd E=Edge(i);return E.perp()/(2.*this->mesure());} // heigth void Gradlambda(Rd * GradL) const { GradL[1]= H(1); GradL[2]= H(2); GradL[0]=-GradL[1]-GradL[2]; } */ }; class Mesh3 : public GenericMesh { public: Mesh3(){} Mesh3(const string); Mesh3(const string, const long); // Add J. Morice 11/10 Mesh3(FILE *f,int offset=0); Mesh3(const Serialize &); Mesh3(int nnv, int nnt, int nnbe, Vertex3 *vv, Tet *tt, Triangle3 *bb); Mesh3(int nnv, int nnbe, Vertex3 *vv, Triangle3 *bb); // surface mesh double hmin() const; // Add J. Morice 11/10 void GSave(FILE * f,int offset=0) const ; void GRead(FILE * f,int offset); int Save(const string & filename) const ; int SaveSurface(const string & filename) const ; int SaveSurface(const string & filename1, const string & filename2) const ; void flipSurfaceMesh3(int surface_orientation); void read(istream &); void readmsh(ifstream & f,int offset); void TrueVertex(); ~Mesh3() {SHOWVERB(cout << " %%%% delete Mesh3"<< this << endl) ; } private: int load(const string & filename); Mesh3(const Mesh3 &); // pas de construction par copie void operator=(const Mesh3 &);// pas affectation par copy }; // for the caracteristic method. int WalkInTet(const Mesh3 & Th,int it, R3 & Phat,const R3 & U, R & dt); int WalkInTetn(const Mesh3 & Th,int it, R3 & Phat,const R3 & U, R & dt,R3 &offset); } #endif freefem++-3.61-1/src/femlib/ufunction.hpp000644 000767 000024 00000005210 13256636774 020371 0ustar00hechtstaff000000 000000 // ORIG-DATE: Dec 2007 // -*- Mode : c++ -*- // // SUMMARY : Model of usefull function generic function // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curi, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : frederic.hecht@ann.jussieu.fr // /* 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 */ #ifndef UFUNCTION_HPP_ #define UFUNCTION_HPP_ // some usefull function template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} template inline T Abs (const T &a){return a <0 ? -a : a;} template inline double Norme (const T &a){return sqrt(a*a);} template inline void Exchange (T& a,T& b) {T c=a;a=b;b=c;} template inline T Max (const T &a,const T & b,const T & c){return Max(Max(a,b),c);} template inline T Min (const T &a,const T & b,const T & c){return Min(Min(a,b),c);} template struct Copy { static A * copy(A a[d],B * const b) { for (int i=0;i struct Copy<1,A,B> { static A * copy(A a[1],B * const b ) { a[0]=b[0]; return a; }}; template struct Copy<2,A,B> { static A * copy(A a[2],B * const b) { a[0]=b[0]; a[1]=b[1]; return a; }}; template struct Copy<3,A,B> { static A * copy(A a[3],B * const b) { a[0]=b[0]; a[1]=b[1]; a[2]=b[2]; return a; }}; template struct Copy<4,A,B> { static A * copy(A a[4],B * const b) { a[0]=b[0]; a[1]=b[1]; a[2]=b[2]; a[3]=b[3]; return a; }}; struct UniqueffId { private: static int count ; int id; public: UniqueffId() : id(++count) {} bool operator==(UniqueffId u) const {return id==u.id;} bool operator!=(UniqueffId u) const {return id!=u.id;} void init(){id=++count;} }; #endif freefem++-3.61-1/src/femlib/Makefile.in000644 000767 000024 00000043650 13321623167 017706 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = src/femlib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = BamgFreeFem.cpp BamgFreeFem.hpp CGNL.hpp CheckPtr.cpp \ ConjuguedGradrientNL.cpp DOperator.hpp Drawing.cpp Element_P2h.cpp \ Element_RT.cpp fem3.hpp fem.cpp fem.hpp FESpace.cpp \ FESpace.hpp FESpace-v0.cpp FQuadTree.cpp FQuadTree.hpp gibbs.cpp \ glutdraw.cpp gmres.hpp MatriceCreuse.hpp MatriceCreuse_tpl.hpp \ MeshPoint.hpp mortar.cpp mshptg.cpp QuadratureFormular.cpp \ QuadratureFormular.hpp RefCounter.hpp RNM.hpp RNM_opc.hpp RNM_op.hpp \ RNM_tpl.hpp R1.hpp R2.hpp R3.hpp \ FESpacen.cpp \ FESpacen.hpp \ P012_1d.cpp \ P012_2d.cpp \ P012_3d.cpp \ PkLagrange.hpp \ Mesh1dn.cpp \ Mesh1dn.hpp \ Mesh2dn.cpp \ Mesh2dn.hpp \ Mesh3dn.cpp \ Mesh3dn.hpp \ HashTable.hpp \ Label.hpp \ assertion.hpp \ GenericMesh.hpp \ GQuadTree.hpp \ GQuadTree.cpp \ HeapSort.hpp \ libmesh5.c \ libmesh5.h \ ufunction.hpp \ splitsimplex.cpp InvIntFunc.cpp splitsimplex.hpp 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/femlib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/femlib/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic 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 pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/src/femlib/DOperator.hpp000644 000767 000024 00000041733 13256636774 020270 0ustar00hechtstaff000000 000000 #include // class for 1 linear form // just copy a array // Warning this class are use at compilating time // ---------------------------------------------- using Fem2D::operatortype; using Fem2D::op_id; using Fem2D::op_dx; using Fem2D::op_dy; using Fem2D::op_dz; using Fem2D::last_operatortype; template inline T * NewCopy(const T * const o,int n) { int m=n; T * c = new T [n]; for (int i=0;i inline T * NewCopy(const T * const o,int n,int m) { throwassert(m<=n); T * c = new T [n]; for (int i=0;i struct triplet { typedef T1 first_type; typedef T2 second_type; typedef T3 third_type; T1 first; T2 second; T3 third; triplet() : first(),second(),third() {} triplet(const T1& x, const T2& y, const T3& z) : first(x),second(y), third(z) {} template inline triplet(const triplet& p) : first(p.first),second(p.second),third(p.third) {} }; template inline triplet make_triplet(T1 x, T2 y, T3 z) { return triplet(x, y, z); } template class LinearComb : public E_F0mps { public: typedef I TI; typedef R TR; typedef size_t size_type; typedef pair K; typedef vector array; typedef typename array::const_iterator const_iterator; typedef typename array::iterator iterator; array v; vector where_in_stack_opt; vector mesh_indep_stack_opt; const E_F0_Optimize * optiexp0,*optiexpK; bool isoptimize; LinearComb(): v(), where_in_stack_opt(),mesh_indep_stack_opt(), optiexp0(0),optiexpK(0),isoptimize(false) {} LinearComb(const I& i,const R& r) :v(1), where_in_stack_opt(),mesh_indep_stack_opt(), optiexp0(),optiexpK(),isoptimize(false) { v[0]=make_pair((I)i,(R)r); } LinearComb(const LinearComb &l) :v(l.v), where_in_stack_opt(l.where_in_stack_opt), mesh_indep_stack_opt(l.mesh_indep_stack_opt), optiexp0(l.optiexp0),optiexpK(l.optiexpK),isoptimize(false){} int nbtrue(bool *ok) const { int k=0; for (size_t i=0;i &l) { v=l.v; where_in_stack_opt=l.where_in_stack_opt; mesh_indep_stack_opt=l.mesh_indep_stack_opt; optiexp0=l.optiexp0; optiexpK=l.optiexpK; isoptimize=l.isoptimize; } const I * simple() const { if (v.size()==1) return & v.begin()->first;else return 0;} void add(const I& i,const R &r) { for (iterator k=v.begin();k!=v.end();k++) if (k->first == i) {k->second += r;return ;} v.push_back(make_pair((I)i,(R)r)); } size_type size() const { return v.size();} const K & operator[](size_type i) const { return v[i];} void operator+=(const LinearComb & l) { for (const_iterator k=l.v.begin();k!=l.v.end();k++) { const K & kk(*k); add(kk.first,kk.second);} } void operator*=(const R & r) { for (iterator k=v.begin();k!=v.end();k++) {K & kk(*k); kk.second = kk.second*r;} } void operator/=(const R & r) { for (iterator k=v.begin();k!=v.end();k++) {K & kk(*k); kk.second = kk.second/r; } } AnyType operator()(Stack ) const { return SetAny * >(this);} operator aType () const { return atype();} bool mappable(bool (*f)(const R &)) const { for (const_iterator k=v.begin();k!=v.end();k++) if (!(*f)(k->second)) return false; return true;} void mapping(R (*f)(const R &)) { for (iterator k=v.begin();k!=v.end();k++) k->second=(*f)(k->second) ;} int MaxOp() const { int m=0; for (const_iterator k=v.begin();k!=v.end();k++) m= maxop(m,(k->first)) ; return m;} void DiffOp(KN_ &d) const { assert(d.N() >= last_operatortype); d=false; for (const_iterator k=v.begin();k!=v.end();k++) SetOp(d,k->first); } unsigned int DiffOp(int & lastop) const { unsigned int d=0; lastop=0; for (const_iterator k=v.begin();k!=v.end();k++) d |= GetDiffOp(k->first,lastop); assert(lastop > ll; MapOfE_F0 m; rr.where_in_stack_opt.resize(n); rr.mesh_indep_stack_opt.resize(n); size_type top = b->OffSet(0), topbb=top; // FH. bofbof ??? for (int i=0; iMeshIndependent(); rr.where_in_stack_opt[i]=ee->Optimize(ll, m, top); if (kdump) cout << "\n\t\t"<< i << " " << ri.first << ": " << rr.where_in_stack_opt[i] << endl; } b->OffSet(top-topbb); // int k=ll.size(),k0=0,k1=0; for (int i=0;iMeshIndependent()) k0++; deque > l0(k0),l1(k-k0); k0=0,k1=0; for (int i=0;iMeshIndependent()) { if (kdump) cout << " mi " << ll[i].second << " " << *(ll[i].first) << endl; l0[k0++]=ll[i]; } else { if (kdump) cout << " md " << ll[i].second << " " << *(ll[i].first) << endl; l1[k1++]=ll[i]; } if (k0) rr.optiexp0 = new E_F0_Optimize(l0,m,0); if (k1) rr.optiexpK = new E_F0_Optimize(l1,m,0); rr.isoptimize=true; if (kdump) cout << "LinearCom Optimize k0(mi) = " << k0 << " k1 = " << k1 << "\n\n"< LinearComb operator+(const LinearComb & a,const LinearComb & b) {LinearComb r(a);r+=b;return r;} template LinearComb operator*(const LinearComb & a,const R & b) {LinearComb r(a);r*=b;return r;} template LinearComb operator*(const R & b,const LinearComb & a) {LinearComb r(a);r*=b;return r;} class MGauche :public pair {public: MGauche() {} MGauche(int i,operatortype j) {first = i;second= j;} MGauche(const pair &p) : pair(p){} bool operator==(const MGauche& a) const { return static_cast(first == a.first && second == a.second);} int maxop(int op) const { return Max(op,(int) second);} }; class MDroit :public pair {public: MDroit(){} MDroit(int i,operatortype j) {first = i;second =j;} // first : number of unknow // second : number of operator ( 0 Id, 1 dx, 2 dy) MDroit(const pair &p) : pair(p){} bool operator==(const MDroit& a) const { return static_cast(first == a.first && second == a.second);} }; inline ostream & operator<<(ostream & f,const MDroit & p) { f << p.first <<','< inline ostream & operator<<(ostream & f,const pair &p) { f << p.first <<" "< LinearOperatorG; typedef LinearComb LinearOperatorD; typedef LinearComb,C_F0> BilinearOperator; inline int maxop(int op,const MGauche & v) { return Max(op,(int) v.second);} inline int maxop(int op,const MDroit & v) { return Max(op,(int) v.second);} inline int maxop(int op,const pair & b) { return Max(op,(int) b.first.second,(int) b.second.second );} inline BilinearOperator operator*(const LinearOperatorG & a,const LinearOperatorD & b) { BilinearOperator r; for (LinearOperatorG::const_iterator i=a.v.begin();i!=a.v.end();i++) for (LinearOperatorD::const_iterator j=b.v.begin();j!=b.v.end();j++) { const LinearOperatorG::K vi(*i); const LinearOperatorD::K vj(*j); r.add(make_pair(vi.first,vj.first),vi.second*vj.second); } return r; } inline BilinearOperator operator*(const LinearOperatorD & b,const LinearOperatorG & a) { BilinearOperator r; for (LinearOperatorG::const_iterator i=a.v.begin();i!=a.v.end();i++) for (LinearOperatorD::const_iterator j=b.v.begin();j!=b.v.end();j++) { const LinearOperatorG::K vi(*i); const LinearOperatorD::K vj(*j); r.add(make_pair(vi.first,vj.first),vi.second*vj.second); } return r; } ostream & operator<<(ostream & f,const BilinearOperator & a); inline ostream & operator<<(ostream & f,const BilinearOperator & a) { int k=0; for (BilinearOperator::const_iterator i=a.v.begin();i!=a.v.end();i++) { const BilinearOperator::K vi(*i); const char * www[]={" ","_x ","_y "}; const pair,pair > i1(vi.first); const pair ii(i1.first),jj(i1.second); f << *(const E_F0 *) vi.second << char('u'+ii.first) << www[ii.second] << " " << char('u'+jj.first)<<"'" << www[jj.second] ; if ( (++k%5)==0) f << endl ; else f << " "; } return f; } typedef LinearOperatorD LOperaD; typedef LinearOperatorG LOperaG; typedef BilinearOperator Opera; inline LOperaG DiffG(int i,operatortype j) { return LOperaG(make_pair(i,j),*pOne);} inline LOperaD DiffD(int i,operatortype j) { return LOperaD(make_pair(i,j),*pOne);} inline LOperaG *newU_(int i) { LOperaG * r; r= new LOperaG(make_pair(i,op_id),*pOne); SHOWVERB( cout << "newU_ " << r << endl); return r; } inline LOperaG *newU_x(int i) { return new LOperaG(make_pair(i,op_dx),*pOne);} inline LOperaG *newU_y(int i) { return new LOperaG(make_pair(i,op_dy),*pOne);} inline LOperaD *newV_(int i) { return new LOperaD(make_pair(i,op_id),*pOne);} inline LOperaD *newV_x(int i) { return new LOperaD(make_pair(i,op_dx),*pOne);} inline LOperaD *newV_y(int i) { return new LOperaD(make_pair(i,op_dy),*pOne);} template L * Diff(const L * u,const operatortype & d) { throwassert(u); L * r= new L(*u); for (typename L::iterator i=r->v.begin();i!=r->v.end();i++) { operatortype & dd=i->first.second; if (dd != op_id) { ffassert(0); i->first.second = op_id; } // a faire else { ffassert(i->second.EvaluableWithOutStack());// a faire derivation des fonctions dd = d ; } } return r;} template L * CONJ_op(const L * u) { throwassert(u); L * r= new L(*u); for (typename L::iterator i=r->v.begin();i!=r->v.end();i++) { typename L::TR & cc=i->second; if( cc.right()==atype() ) i->second= C_F0(TheOperators,"\'",cc); } return r;} template int MaxOp(const L * u) { throwassert(u); int op=0; for (typename L::const_iterator i=u->v.begin();i!=u->v.end();i++) op = maxop(op,i->first); return op;} template class CODE_L1 { public: typedef L* Result; typedef L* (*func)(const basicAC_F0 & args) ; static L* f(const basicAC_F0 & args) { return ff(args);} // ff :A-> L* static ArrayOfaType typeargs() {return ArrayOfaType(atype);} }; template class CODE_L_Add { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); const L * b(dynamic_cast((Expression) args[1])); throwassert(a && b ); return new L(*a+*b);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_L_Sub { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); const L * b(dynamic_cast((Expression) args[1])); throwassert(a && b ); L * bb = new L(*pminusOne * *b); return new L(*a+*bb);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_L_Minus { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); throwassert(a && pminusOne ); return new L(*pminusOne * *a);} static ArrayOfaType typeargs() {return ArrayOfaType(atype());} }; template class CODE_L_Plus { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); throwassert(a ); return new L( *a);} static ArrayOfaType typeargs() {return ArrayOfaType(atype());} }; template class CODE_L_Mul { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const A * a(dynamic_cast((Expression) args[0])); const B * b(dynamic_cast((Expression) args[1])); SHOWVERB(cout << " CODE_L_Mul " << a << " " << b << endl); throwassert(a && b ); return new L(*a * *b);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_L_MulRL { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * b(dynamic_cast((Expression) args[1])); if (!b) { cout << " --- " << ((Expression) args[1]) << typeid((Expression) args[1]).name() << endl; throwassert( b ); } return new L(to(args[0]) * *b);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_L_MulLR { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); throwassert( a ); return new L(to(args[1]) * *a);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_L_DivLR { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a(dynamic_cast((Expression) args[0])); throwassert( a ); return new L(C_F0(TheOperators,"/",*pOne,args[1]) * *a);} static ArrayOfaType typeargs() {return ArrayOfaType(atype(),atype());} }; template class CODE_Diff { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a=dynamic_cast((Expression) args[0]) ; throwassert( a ); return Diff(a,op);} static ArrayOfaType typeargs() {return ArrayOfaType(atype());} }; template class CODE_conj { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * a=dynamic_cast((Expression) args[0]) ; throwassert( a ); return CONJ_op(a);} static ArrayOfaType typeargs() {return ArrayOfaType(atype());} }; enum TheCode_VF { Code_Jump=1, Code_Mean=2, Code_OtherSide=3}; template class Code_VF { public: typedef const L* Result; static E_F0 * f(const basicAC_F0 & args) { const L * u=dynamic_cast((Expression) args[0]) ; assert( u ); L * r= new L(*u); for (typename L::iterator i=r->v.begin();i!=r->v.end();i++) { operatortype & dd=i->first.second; assert(dd());} }; freefem++-3.61-1/src/femlib/QuadratureFormular.cpp000644 000767 000024 00000062737 13256636774 022220 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 For 2d hight order formula: Thanks to http://xyz.lanl.gov/format/math.NA/0501496 Mathematics, abstract math.NA/0501496 From: Mark Taylor [view email] Date: Thu, 27 Jan 2005 19:17:37 GMT (27kb) Several new quadrature formulas for polynomial integration in the triangle Authors: Mark A. Taylor, Beth A. Wingate, Len P. Bos Comments: 14 pages, 14 figures, 5 pages of tabulated quadrature points Report-no: SAND2005-0034J For 3d order formula: from: http://www.cs.kuleuven.be/~nines/research/ecf/mtables.html --------------------------------------------------------------------------- | Name : Ronald Cools | | | Prof. Dr. ir. | Address: | | Email : Ronald.Cools@cs.kuleuven.be | Katholieke Universiteit Leuven | | | Department of Computer Science | | http://www.cs.kuleuven.be/~ronald/ | Celestijnenlaan 200 A | | Fax : +(32) 16 32 79 96 | B-3001 HEVERLEE | | Phone : +(32) 16 32 75 62 | BELGIUM | --------------------------------------------------------------------------- */ #include #include #include #include using namespace std; #include "error.hpp" #include "ufunction.hpp" #include "QuadratureFormular.hpp" namespace Fem2D { template QF * QF_exact(int exact,QF * p=0) { exact=max(0,exact); const int N=100; assert(exact=0); static QF ** a=0; if(a==0) { // a = new QF*[N]; assert(a); for(int i=0;i=0 && exact < N); if ( p ) { //cout << endl << " QF " << exact << " " << p->exact << " " << p->n << endl;; for( int i=0;i<=exact;++i) { if( a[i]== 0 || a[i]->n > p->n) a[i]= p; // cout << " QF: on " << ON << " exact P_" << i << " : "<< a[i]->n << endl; } } else p=a[exact]; return p; } template GQuadratureFormular * QF_Simplex(int exact) { return QF_exact,Rd::d+1>(exact); } // explict instantiation template GQuadratureFormular * QF_Simplex(int exact); template GQuadratureFormular * QF_Simplex(int exact); template GQuadratureFormular * QF_Simplex(int exact); template ostream& operator <<(ostream& f,const GQuadraturePoint & p) { f << '{' << (const R) p << '\t' << (const Rd &) p << '}' ; return f;} template ostream& operator <<(ostream& f, const GQuadratureFormular & fi) { f << "nb de point integration " << fi.n << ", adr = " << &f << endl; for (int i=0;i P_QuadratureFormular_T_1[1] = { GQuadraturePoint(1.,R2(1./3.,1./3.)) }; const GQuadratureFormular QuadratureFormular_T_1(1,1,P_QuadratureFormular_T_1); // ---------------------------------------------------------------------- static GQuadraturePoint P_QuadratureFormular_T_1lump[3] = { GQuadraturePoint(1./3.,R2(0.,0.)) , GQuadraturePoint(1./3.,R2(1.,0.)) , GQuadraturePoint(1./3.,R2(0.,1.)) }; GQuadratureFormular const QuadratureFormular_T_1lump(1,3,P_QuadratureFormular_T_1lump); // ---------------------------------------------------------------------- static GQuadraturePoint P_QuadratureFormular_T_2[3] = { GQuadraturePoint(1./3.,R2(0.5,0.5)) , GQuadraturePoint(1./3.,R2(0.0,0.5)) , GQuadraturePoint(1./3.,R2(0.5,0.0)) }; GQuadratureFormular const QuadratureFormular_T_2(2,3,P_QuadratureFormular_T_2); // ---------------------------------------------------------------------- static GQuadraturePoint P_QuadratureFormular_T_2_4P1[9] = { GQuadraturePoint(1./12.,R2(0.25,0.75)) , GQuadraturePoint(1./12.,R2(0.75,0.25)) , GQuadraturePoint(1./12.,R2(0.0,0.25)) , GQuadraturePoint(1./12.,R2(0.0,0.75)) , GQuadraturePoint(1./12.,R2(0.25,0.0)) , GQuadraturePoint(1./12.,R2(0.75,0.0)) , GQuadraturePoint(1./6.,R2(0.25,0.25)) , GQuadraturePoint(1./6.,R2(0.25,0.50)) , GQuadraturePoint(1./6.,R2(0.50,0.25)) }; GQuadratureFormular const QuadratureFormular_T_2_4P1(2,9,P_QuadratureFormular_T_2_4P1); // ---------------------------------------------------------------------- // STROUD page 314 // ----------------------------- const R sqrt15 = 3.87298334620741688517926539978; const R t_T5 =1.E0/3.E0 , A_T5 = 0.225E0; const R r_T5 = (6-sqrt15)/21 , s_T5 = (9+2*sqrt15)/21 , B_T5 = (155-sqrt15)/1200; const R u_T5 = (6+sqrt15)/21 , v_T5 = (9-2*sqrt15)/21 , C_T5 = (155+sqrt15)/1200; // OK cette formule est OK static GQuadraturePoint P_QuadratureFormular_T_5[] = { GQuadraturePoint(A_T5,R2(t_T5,t_T5)), GQuadraturePoint(B_T5,R2(r_T5,r_T5)), GQuadraturePoint(B_T5,R2(r_T5,s_T5)), GQuadraturePoint(B_T5,R2(s_T5,r_T5)), GQuadraturePoint(C_T5,R2(u_T5,u_T5)), GQuadraturePoint(C_T5,R2(u_T5,v_T5)), GQuadraturePoint(C_T5,R2(v_T5,u_T5)) }; const GQuadratureFormular QuadratureFormular_T_5(5,7,P_QuadratureFormular_T_5); // ------------------ //---- // Thanks to http://xyz.lanl.gov/format/math.NA/0501496 /* Mathematics, abstract math.NA/0501496 From: Mark Taylor [view email] Date: Thu, 27 Jan 2005 19:17:37 GMT (27kb) Several new quadrature formulas for polynomial integration in the triangle Authors: Mark A. Taylor, Beth A. Wingate, Len P. Bos Comments: 14 pages, 14 figures, 5 pages of tabulated quadrature points Report-no: SAND2005-0034J */ // ---------------------------------------------------------------------- // awk '/15:/,/21:/ {print "GQuadraturePoint(" $3 "/2," $1"," $2"),"}' coords.txt static GQuadraturePoint P_QuadratureFormular_T_7[] = { GQuadraturePoint(0.0102558174092/2,R2(1.0000000000000,0.0000000000000)), GQuadraturePoint(0.0102558174092/2,R2(0.0000000000000,0.0000000000000)), GQuadraturePoint(0.0102558174092/2,R2(0.0000000000000,1.0000000000000)), GQuadraturePoint(0.1116047046647/2,R2(0.7839656651012,0.0421382841642)), GQuadraturePoint(0.1116047046647/2,R2(0.1738960507345,0.7839656651012)), GQuadraturePoint(0.1116047046647/2,R2(0.1738960507345,0.0421382841642)), GQuadraturePoint(0.1116047046647/2,R2(0.0421382841642,0.1738960507345)), GQuadraturePoint(0.1116047046647/2,R2(0.7839656651012,0.1738960507345)), GQuadraturePoint(0.1116047046647/2,R2(0.0421382841642,0.7839656651012)), GQuadraturePoint(0.1679775595335/2,R2(0.4743880861752,0.4743880861752)), GQuadraturePoint(0.1679775595335/2,R2(0.4743880861752,0.0512238276497)), GQuadraturePoint(0.1679775595335/2,R2(0.0512238276497,0.4743880861752)), GQuadraturePoint(0.2652238803946/2,R2(0.2385615300181,0.5228769399639)), GQuadraturePoint(0.2652238803946/2,R2(0.5228769399639,0.2385615300181)), GQuadraturePoint(0.2652238803946/2,R2(0.2385615300181,0.2385615300181)) }; const GQuadratureFormular QuadratureFormular_T_7(7,15,P_QuadratureFormular_T_7); // awk '/21:/,/28:/ {print "GQuadraturePoint(" $3 "/2," $1"," $2"),"}' coords.txt static GQuadraturePoint P_QuadratureFormular_T_9[] = { GQuadraturePoint(0.0519871420646/2,R2(0.0451890097844,0.0451890097844)), GQuadraturePoint(0.0519871420646/2,R2(0.0451890097844,0.9096219804312)), GQuadraturePoint(0.0519871420646/2,R2(0.9096219804312,0.0451890097844)), GQuadraturePoint(0.0707034101784/2,R2(0.7475124727339,0.0304243617288)), GQuadraturePoint(0.0707034101784/2,R2(0.2220631655373,0.0304243617288)), GQuadraturePoint(0.0707034101784/2,R2(0.7475124727339,0.2220631655373)), GQuadraturePoint(0.0707034101784/2,R2(0.2220631655373,0.7475124727339)), GQuadraturePoint(0.0707034101784/2,R2(0.0304243617288,0.7475124727339)), GQuadraturePoint(0.0707034101784/2,R2(0.0304243617288,0.2220631655373)), GQuadraturePoint(0.0909390760952/2,R2(0.1369912012649,0.2182900709714)), GQuadraturePoint(0.0909390760952/2,R2(0.6447187277637,0.2182900709714)), GQuadraturePoint(0.0909390760952/2,R2(0.1369912012649,0.6447187277637)), GQuadraturePoint(0.0909390760952/2,R2(0.2182900709714,0.6447187277637)), GQuadraturePoint(0.0909390760952/2,R2(0.2182900709714,0.1369912012649)), GQuadraturePoint(0.0909390760952/2,R2(0.6447187277637,0.1369912012649)), GQuadraturePoint(0.1032344051380/2,R2(0.0369603304334,0.4815198347833)), GQuadraturePoint(0.1032344051380/2,R2(0.4815198347833,0.0369603304334)), GQuadraturePoint(0.1032344051380/2,R2(0.4815198347833,0.4815198347833)), GQuadraturePoint(0.1881601469167/2,R2(0.4036039798179,0.1927920403641)), GQuadraturePoint(0.1881601469167/2,R2(0.4036039798179,0.4036039798179)), GQuadraturePoint(0.1881601469167/2,R2(0.1927920403641,0.4036039798179)) }; const GQuadratureFormular QuadratureFormular_T_9(9,21,P_QuadratureFormular_T_9); // Computation of nodes and weights for a Gauss-Legendre quadrature formula // on [0,1] seg. typedef GQuadraturePoint QP1; QP1 * GaussLegendre(int nn) // : exact(nn*2-1),n(nn),p(new Point[nn]) { QP1 *p=new QP1[nn]; int n=nn; double r, r1, p1, p2, p3, dp3; double eps=1e-16; const double pi=3.141592653589793238463;//M_PI; for(int i = 0,ii=n; i <= (n+1)/2-1; i++) { ii-=1; r = cos(pi*(4*i+3)/(4*n+2)); do { p2 = 0; p3 = 1; for(int j = 0; j <= n-1; j++) { p1 = p2; p2 = p3; p3 = ((2*j+1)*r*p2-j*p1)/(j+1); } dp3 = n*(r*p3-p2)/(r*r-1); r1 = r; r = r-p3/dp3; } while(fabs(r-r1)>=eps*(1+fabs(r))*100); p[i].x = 0.5 +r/2; p[ii].x =0.5 -r/2; p[i].a=p[ii].a= 1./((1.-r*r)*dp3*dp3); } // Check(); return p; } /* void QuadratureFormular1d::Check() { QF_exact(exact,this); int err=0; for(int m=0;m<=exact;++m) { R ve = 1./ ( m+1), v=0.; for (int i=0;i 1.e-8) { cout << " erreur QuadratureFormular1d n= " << n << " exact = " << exact << endl; cout << " int x^" <= MaxMsh) ) return(0); MshTab[ ++NmbMsh ] = msh; /* Copy the FilNam into the structure */ if(strlen(FilNam) + 7 >= GmfStrSiz) return(0); strcpy(msh->FilNam, FilNam); /* Store the opening mod (read or write) and guess the filetype (binary or ascii) depending on the extension */ msh->mod = mod; if(strstr(msh->FilNam, ".meshb")) msh->typ |= (Bin | MshFil); else if(strstr(msh->FilNam, ".mesh")) msh->typ |= (Asc | MshFil); else if(strstr(msh->FilNam, ".solb")) msh->typ |= (Bin | SolFil); else if(strstr(msh->FilNam, ".sol")) msh->typ |= (Asc | SolFil); else return(0); /* Open the file in the required mod and initialyse the mesh structure */ if(msh->mod == GmfRead) { /*-----------------------*/ /* OPEN FILE FOR READING */ /*-----------------------*/ va_start(par, mod); PtrVer = va_arg(par, int *); PtrDim = va_arg(par, int *); va_end(par); /* Create the name string and open the file */ if(!(msh->hdl = fopen(msh->FilNam, "rb"))) return(0); /* Read the endian coding tag, the mesh version and the mesh dimension (mandatory kwd) */ if(msh->typ & Bin) { fread((unsigned char *)&msh->cod, WrdSiz, 1, msh->hdl); if( (msh->cod != 1) && (msh->cod != 16777216) ) return(0); ScaWrd(msh, (unsigned char *)&msh->ver); ScaWrd(msh, (unsigned char *)&KwdCod); if(KwdCod != GmfDimension) return(0); ScaWrd(msh, (unsigned char *)&KwdCod); ScaWrd(msh, (unsigned char *)&msh->dim); } else { do { res = fscanf(msh->hdl, "%s", str); }while( (res != EOF) && strcmp(str, "MeshVersionFormatted") ); if(res == EOF) return(0); fscanf(msh->hdl, "%d", &msh->ver); do { res = fscanf(msh->hdl, "%s", str); }while( (res != EOF) && strcmp(str, "Dimension") ); if(res == EOF) return(0); fscanf(msh->hdl, "%d", &msh->dim); } if( (msh->dim != 2) && (msh->dim != 3) ) return(0); (*PtrVer) = msh->ver; (*PtrDim) = msh->dim; /*------------*/ /* KW READING */ /*------------*/ /* Read the list of kw present in the file */ if(!ScaKwdTab(msh)) return(0); } else if(msh->mod == GmfWrite) { /*-----------------------*/ /* OPEN FILE FOR WRITING */ /*-----------------------*/ msh->cod = 1; /* Check if the user provided a valid version number and dimension */ va_start(par, mod); msh->ver = va_arg(par, int); msh->dim = va_arg(par, int); va_end(par); if( (msh->ver != 1) && (msh->ver != 2) ) return(0); if( (msh->dim != 2) && (msh->dim != 3) ) return(0); /* Create the mesh file */ if(!(msh->hdl = fopen(msh->FilNam, "wb"))) return(0); /*------------*/ /* KW WRITING */ /*------------*/ /* Write the mesh version and dimension */ if(msh->typ & Asc) { fprintf(msh->hdl, "%s %d\n\n", KwdFmt[ GmfVersionFormatted ][0], msh->ver); fprintf(msh->hdl, "%s %d\n", KwdFmt[ GmfDimension ][0], msh->dim); } else { RecWrd(msh, (unsigned char *)&msh->cod); RecWrd(msh, (unsigned char *)&msh->ver); GmfSetKwd(NmbMsh, GmfDimension, 0); RecWrd(msh, (unsigned char *)&msh->dim); } } else return(0); return(NmbMsh); } /*----------------------------------------------------------*/ /* Close a meshfile in the right way */ /*----------------------------------------------------------*/ int GmfCloseMesh(int MshIdx) { int ret; GmfMshSct *msh; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; /* In write down the "End" kw in write mode */ if(msh->mod == GmfWrite) { if(msh->typ & Asc) fprintf(msh->hdl, "\n%s\n", KwdFmt[ GmfEnd ][0]); else GmfSetKwd(MshIdx, GmfEnd, 0); } /* Close the file and free the mesh structure */ /* modif FH */ ret=fclose(msh->hdl); free(msh); return ret!=0; } /*----------------------------------------------------------*/ /* Read the number of lines and set the position to this kwd*/ /*----------------------------------------------------------*/ int GmfStatKwd(int MshIdx, int KwdCod, ...) { int i, *PtrNmbTyp, *PtrSolSiz, *TypTab; GmfMshSct *msh; KwdSct *kwd; va_list par; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; if(!kwd->NmbLin) return(0); /* Read further arguments if this kw is a sol */ if(kwd->typ == SolKwd) { va_start(par, KwdCod); PtrNmbTyp = va_arg(par, int *); *PtrNmbTyp = kwd->NmbTyp; PtrSolSiz = va_arg(par, int *); *PtrSolSiz = kwd->SolSiz; TypTab = va_arg(par, int *); for(i=0;iNmbTyp;i++) TypTab[i] = kwd->TypTab[i]; va_end(par); } return(kwd->NmbLin); } /*----------------------------------------------------------*/ /* Set the current file position to a given kwd */ /*----------------------------------------------------------*/ int GmfGotoKwd(int MshIdx, int KwdCod) { GmfMshSct *msh; KwdSct *kwd; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; if(!kwd->NmbLin) return(0); fseek(msh->hdl, kwd->pos, SEEK_SET); return 0; } /*----------------------------------------------------------*/ /* Write the kwd and set the number of lines */ /*----------------------------------------------------------*/ int GmfSetKwd(int MshIdx, int KwdCod, ...) { int i, CurPos, NmbLin=0, NulPos=0, *TypTab; va_list par; GmfMshSct *msh; KwdSct *kwd; if( (MshIdx < 1) || (MshIdx > MaxMsh) ) return(0); msh = MshTab[ MshIdx ]; if( (KwdCod < 1) || (KwdCod > GmfMaxKwd) ) return(0); kwd = &msh->KwdTab[ KwdCod ]; /* Read further arguments if this kw has a header */ if(strlen(KwdFmt[ KwdCod ][1])) { va_start(par, KwdCod); NmbLin = va_arg(par, int); if(!strcmp(KwdFmt[ KwdCod ][2], "sr")) { kwd->NmbTyp = va_arg(par, int); TypTab = va_arg(par, int *); for(i=0;iNmbTyp;i++) kwd->TypTab[i] = TypTab[i]; } va_end(par); } /* Setup the kwd info */ ExpFmt(msh, KwdCod); if(!kwd->typ) return(0); else if(kwd->typ == InfKwd) kwd->NmbLin = 1; else kwd->NmbLin = NmbLin; /* Store the next kwd position in binary file */ if( (msh->typ & Bin) && msh->NexKwdPos ) { CurPos = ftell(msh->hdl); fseek(msh->hdl, msh->NexKwdPos, SEEK_SET); RecWrd(msh, (unsigned char *)&CurPos); fseek(msh->hdl, CurPos, SEEK_SET); } /* Write the header */ if(msh->typ & Asc) { fprintf(msh->hdl, "\n%s\n", KwdFmt[ KwdCod ][0]); if(kwd->typ != InfKwd) fprintf(msh->hdl, "%d\n", kwd->NmbLin); /* In case of solution field, write the extended header */ if(kwd->typ == SolKwd) { fprintf(msh->hdl, "%d ", kwd->NmbTyp); for(i=0;iNmbTyp;i++) fprintf(msh->hdl, "%d ", kwd->TypTab[i]); fprintf(msh->hdl, "\n\n"); } } else { RecWrd(msh, (unsigned char *)&KwdCod); msh->NexKwdPos = ftell(msh->hdl); RecWrd(msh, (unsigned char *)&NulPos); if(kwd->typ != InfKwd) RecWrd(msh, (unsigned char *)&kwd->NmbLin); /* In case of solution field, write the extended header at once */ if(kwd->typ == SolKwd) { RecWrd(msh, (unsigned char *)&kwd->NmbTyp); for(i=0;iNmbTyp;i++) RecWrd(msh, (unsigned char *)&kwd->TypTab[i]); } } return(kwd->NmbLin); } /*----------------------------------------------------------*/ /* Read a full line from the current kwd */ /*----------------------------------------------------------*/ int GmfGetLin(int MshIdx, int KwdCod, ...) { double *DblPtr, *DblSolTab; float *FltPtr, *FltSolTab; int i, j, *IntPtr; va_list par; GmfMshSct *msh = MshTab[ MshIdx ]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Start decoding the arguments */ va_start(par, KwdCod); if(kwd->typ != SolKwd) { if(msh->ver == 1) { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { FltPtr = va_arg(par, float *); fscanf(msh->hdl, "%f", FltPtr); } else { IntPtr = va_arg(par, int *); fscanf(msh->hdl, "%d", IntPtr); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { FltPtr = va_arg(par, float *); ScaWrd(msh, (unsigned char *)FltPtr); } else { IntPtr = va_arg(par, int *); ScaWrd(msh, (unsigned char *)IntPtr); } } } } else { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { DblPtr = va_arg(par, double *); fscanf(msh->hdl, "%lf", DblPtr); } else { IntPtr = va_arg(par, int *); fscanf(msh->hdl, "%d", IntPtr); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { DblPtr = va_arg(par, double *); ScaDblWrd(msh, (unsigned char *)DblPtr); } else { IntPtr = va_arg(par, int *); ScaWrd(msh, (unsigned char *)IntPtr); } } } } } else { if(msh->ver == 1) { FltSolTab = va_arg(par, float *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fscanf(msh->hdl, "%f", &FltSolTab[j]); else for(j=0;jSolSiz;j++) ScaWrd(msh, (unsigned char *)&FltSolTab[j]); } else if(msh->ver == 2) { DblSolTab = va_arg(par, double *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fscanf(msh->hdl, "%lf", &DblSolTab[j]); else for(j=0;jSolSiz;j++) ScaDblWrd(msh, (unsigned char *)&DblSolTab[j]); } } va_end(par); /* return the number of arguments filled */ return(kwd->SolSiz); } /*----------------------------------------------------------*/ /* Write a full line from the current kwd */ /*----------------------------------------------------------*/ int GmfSetLin(int MshIdx, int KwdCod, ...) { double d, *DblSolTab; float f, *FltSolTab; int i, j; va_list par; GmfMshSct *msh = MshTab[ MshIdx ]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Start decoding the arguments */ va_start(par, KwdCod); if(kwd->typ != SolKwd) { if(msh->ver == 1) { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); fprintf(msh->hdl, "%g ", (float)d); } else { j = va_arg(par, int); fprintf(msh->hdl, "%d ", j); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); f = d; RecWrd(msh, (unsigned char *)&f); } else { j = va_arg(par, int); RecWrd(msh, (unsigned char *)&j); } } } } else { if(msh->typ & Asc) { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); fprintf(msh->hdl, "%.15lg ", d); } else { j = va_arg(par, int); fprintf(msh->hdl, "%d ", j); } } } else { for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { d = va_arg(par, double); RecDblWrd(msh, (unsigned char *)&d); } else { j = va_arg(par, int); RecWrd(msh, (unsigned char *)&j); } } } } } else { if(msh->ver == 1) { FltSolTab = va_arg(par, float *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fprintf(msh->hdl, "%g ", FltSolTab[j]); else for(j=0;jSolSiz;j++) RecWrd(msh, (unsigned char *)&FltSolTab[j]); } else if(msh->ver == 2) { DblSolTab = va_arg(par, double *); if(msh->typ & Asc) for(j=0;jSolSiz;j++) fprintf(msh->hdl, "%.15lg ", DblSolTab[j]); else for(j=0;jSolSiz;j++) RecDblWrd(msh, (unsigned char *)&DblSolTab[j]); } } va_end(par); if(msh->typ & Asc) fprintf(msh->hdl, "\n"); /* return the number of arguments filled */ return(kwd->SolSiz); } /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ int GmfCpyLin(int InpIdx, int OutIdx, int KwdCod) { double d; float f; int i, a; GmfMshSct *InpMsh = MshTab[ InpIdx ], *OutMsh = MshTab[ OutIdx ]; KwdSct *kwd = &InpMsh->KwdTab[ KwdCod ]; for(i=0;iSolSiz;i++) { if(kwd->fmt[i] == 'r') { if(InpMsh->ver == 1) { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%f", &f); else ScaWrd(InpMsh, (unsigned char *)&f); d = f; } else { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%lf", &d); else ScaDblWrd(InpMsh, (unsigned char *)&d); f = (float)d; } if(OutMsh->ver == 1) if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%g ", f); else RecWrd(OutMsh, (unsigned char *)&f); else if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%.15g ", d); else RecDblWrd(OutMsh, (unsigned char *)&d); } else { if(InpMsh->typ & Asc) fscanf(InpMsh->hdl, "%d", &a); else ScaWrd(InpMsh, (unsigned char *)&a); if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "%d ", a); else RecWrd(OutMsh, (unsigned char *)&a); } } if(OutMsh->typ & Asc) fprintf(OutMsh->hdl, "\n"); return 0; } /*----------------------------------------------------------*/ /* Find every kw present in a meshfile */ /*----------------------------------------------------------*/ static int ScaKwdTab(GmfMshSct *msh) { int KwdCod, NexPos, CurPos, EndPos; char str[ GmfStrSiz ]; if(msh->typ & Asc) { /* Scan each string in the file until the end */ while(fscanf(msh->hdl, "%s", str) != EOF) { /* Fast test in order to reject quickly the numeric values */ if(isalpha(str[0])) { /* Search which kwd code this string is associated with, then get its header and save the curent position in file (just before the data) */ for(KwdCod=1; KwdCod<= GmfMaxKwd; KwdCod++) if(!strcmp(str, KwdFmt[ KwdCod ][0])) { ScaKwdHdr(msh, KwdCod); break; } } else if(str[0] == '#') while(fgetc(msh->hdl) != '\n'); } } else { /* Get file size */ CurPos = ftell(msh->hdl); fseek(msh->hdl, 0, SEEK_END); EndPos = ftell(msh->hdl); fseek(msh->hdl, CurPos, SEEK_SET); /* Jump through kwd positions in the file */ do { /* Get the kwd code and the next kwd position */ ScaWrd(msh, (unsigned char *)&KwdCod); ScaWrd(msh, (unsigned char *)&NexPos); if(NexPos > EndPos) return(0); /* Check if this kwd belongs to this mesh version */ if( (KwdCod >= 1) && (KwdCod <= GmfMaxKwd) ) ScaKwdHdr(msh, KwdCod); /* Go to the next kwd */ if(NexPos) fseek(msh->hdl, NexPos, SEEK_SET); }while(NexPos && (KwdCod != GmfEnd)); } return(1); } /*----------------------------------------------------------*/ /* Read and setup the keyword's header */ /*----------------------------------------------------------*/ static void ScaKwdHdr(GmfMshSct *msh, int KwdCod) { int i; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; if(!strcmp("i", KwdFmt[ KwdCod ][1])) { if(msh->typ & Asc) fscanf(msh->hdl, "%d", &kwd->NmbLin); else ScaWrd(msh, (unsigned char *)&kwd->NmbLin); } else kwd->NmbLin = 1; if(!strcmp("sr", KwdFmt[ KwdCod ][2])) { if(msh->typ & Asc) { fscanf(msh->hdl, "%d", &kwd->NmbTyp); for(i=0;iNmbTyp;i++) fscanf(msh->hdl, "%d", &kwd->TypTab[i]); } else { ScaWrd(msh, (unsigned char *)&kwd->NmbTyp); for(i=0;iNmbTyp;i++) ScaWrd(msh, (unsigned char *)&kwd->TypTab[i]); } } ExpFmt(msh, KwdCod); kwd->pos = ftell(msh->hdl); } /*----------------------------------------------------------*/ /* Expand the compacted format and compute the line size */ /*----------------------------------------------------------*/ static void ExpFmt(GmfMshSct *msh, int KwdCod) { int i, j, TmpSiz=0; char chr, *InpFmt = KwdFmt[ KwdCod ][2]; KwdSct *kwd = &msh->KwdTab[ KwdCod ]; /* Set the kwd's type */ if(!strlen(KwdFmt[ KwdCod ][1])) kwd->typ = InfKwd; else if(!strcmp(InpFmt, "sr")) kwd->typ = SolKwd; else kwd->typ = RegKwd; /* Get the solution-field's size */ if(kwd->typ == SolKwd) for(i=0;iNmbTyp;i++) switch(kwd->TypTab[i]) { case GmfSca : TmpSiz += 1; break; case GmfVec : TmpSiz += msh->dim; break; case GmfSymMat : TmpSiz += (msh->dim * (msh->dim+1)) / 2; break; case GmfMat : TmpSiz += msh->dim * msh->dim; break; } /* Scan each character from the format string */ i = 0; while(i < strlen(InpFmt)) { chr = InpFmt[ i++ ]; if(chr == 'd') { chr = InpFmt[i++]; for(j=0;jdim;j++) kwd->fmt[ kwd->SolSiz++ ] = chr; } else if(chr == 's') { chr = InpFmt[i++]; for(j=0;jfmt[ kwd->SolSiz++ ] = chr; } else kwd->fmt[ kwd->SolSiz++ ] = chr; } } /*----------------------------------------------------------*/ /* Read a four bytes word in a mesh file */ /*----------------------------------------------------------*/ static void ScaWrd(GmfMshSct *msh, unsigned char *wrd) { unsigned char swp; fread(wrd, WrdSiz, 1, msh->hdl); if(msh->cod == 1) return; swp = wrd[3]; wrd[3] = wrd[0]; wrd[0] = swp; swp = wrd[2]; wrd[2] = wrd[1]; wrd[1] = swp; } /*----------------------------------------------------------*/ /* Read an eight bytes word in a mesh file */ /*----------------------------------------------------------*/ static void ScaDblWrd(GmfMshSct *msh, unsigned char *wrd) { int i; unsigned char swp; fread(wrd, WrdSiz, 2, msh->hdl); if(msh->cod == 1) return; for(i=0;i<4;i++) { swp = wrd[7-i]; wrd[7-i] = wrd[i]; wrd[i] = swp; } } /*----------------------------------------------------------*/ /* Write a four bytes word in a mesh file */ /*----------------------------------------------------------*/ static void RecWrd(GmfMshSct *msh, unsigned char *wrd) { fwrite(wrd, WrdSiz, 1, msh->hdl); } /*----------------------------------------------------------*/ /* Write an eight bytes word in a mesh file */ /*----------------------------------------------------------*/ static void RecDblWrd(GmfMshSct *msh, unsigned char *wrd) { fwrite(wrd, WrdSiz, 2, msh->hdl); } /*----------------------------------------------------------*/ /* Fortran 77 API */ /*----------------------------------------------------------*/ int call(gmfopenmeshf77)(char *FilNam, int *mod, int *ver, int *dim, int StrSiz) { int i; char TmpNam[ GmfStrSiz ]; for(i=0;i #include #include #include #include #include #include "RNM.hpp" using namespace std; #include "Meshio.h" #include "Mesh2.h" #include "QuadTree.h" #include "SetOfE4.h" #include "rgraph.hpp" #include "fem.hpp" #include "AFunction.hpp" #include "BamgFreeFem.hpp" #include "FESpace.hpp" #include "Mesh2dn.hpp" #include "Mesh3dn.hpp" #include "MeshPoint.hpp" #include "PlotStream.hpp" #include const Fem2D::Mesh *bamg2msh( bamg::Triangles* tTh,bool renumbering) { using namespace bamg; bamg::Triangles & th (*tTh); tTh->ReNumberingTheTriangleBySubDomain(!renumbering);// just compress //tTh->NbRef++; Int4 i,j,k=0; int nv = tTh->nbv; int nt = tTh->nbt - tTh->NbOutT; int neb = tTh->nbe; int nbcrakev = 0; tTh->ReMakeTriangleContainingTheVertex(); Fem2D::Triangle * t = new Fem2D::Triangle[nt] ; Fem2D::BoundaryEdge * b_e = new Fem2D::BoundaryEdge[neb]; Fem2D::Vertex vbase; Fem2D::Vertex *vb(&vbase); if (verbosity>5) cout << " -- Before cracking mesh: Nb Triangles = " << nt << " Nb of Vertices " << nv << endl; for ( i=0;i= 0 ) && (i <3)); // turn around the vertex v TriangleAdjacent ta(tbegin,EdgesVertexTriangle[i][0]);// previous edge int k=0; do { int kv = VerticesOfTriangularEdge[ta][1]; k++; Triangle * tt (ta); throwassert( &v == & (* tt)[kv] ); if ( ta.Cracked() ) { // cout << " || " ; if ( kk == 0) tbegin=ta,kkk=0; // begin by a cracked edge => restart if ( kkk ) { kc =1;vv = vb + nv++; kkk = 0; } // new vertex if use kk++; // number of cracked edge view } if ( tt->link ) { // if good triangles store the value int it = th.Number(tt); throwassert(it < nt); //int iiv=vv-vb; t[it](kv) = vv; /* cout << it << " " << kv << " "<< iiv << endl; if (&th(it)[kv] != &th[iiv]) cout << it << " " << kv << " "<< iiv << " != " << th.Number(th(it)[kv]) << endl ; */ kkk++; } else if (kk) { // crack + boundary if ( kkk ) { kc =1;vv = vb + nv++; kkk = 0; } // new vertex if use } ta = Next(ta).Adj(); } while ( (tbegin != ta)); throwassert(k); if (kc) nbcrakev++; } double badvalue=12345e100; Fem2D::Vertex * v = new Fem2D::Vertex[nv]; for(int i=0; i=0 && k < nv); Vertex & thv(th(i)[j]); v[k].x = thv.r.x; v[k].y = thv.r.y; v[k].lab = thv.ref(); // cout << i<< " " << j << " " << k <<" " << v[k].x << " " <2) cout << " -- Nb of craked vertices = " << nbcrakev << " Nb of created vertices " << nv - th.nbv << endl; for (i=0;inbe;i++) { int i0=tTh->Number(tTh->edges[i][0]),i1=tTh->Number(tTh->edges[i][1]); throwassert(i0>=0 && i0 =0 && i1 edges[i].ref); } Int4 *reft = new Int4[tTh->nbt]; //Int4 nbref = long nerr=0; tTh->ConsRefTriangle(reft); for( i=0,k=0;inbt;i++) if(tTh->triangles[i].link) { Fem2D::R2 A(t[k][0]),B(t[k][1]),C(t[k][2]); t[k].area = (( B-A)^(C-A))*0.5 ; nerr += t[k].area <=0; t[k].lab = tTh->subdomains[reft[i]].ref; // a faire throwassert(k == i); k++; } delete [] reft; throwassert ( nt == k); tTh->ReMakeTriangleContainingTheVertex(); if (verbosity) cout << " -- mesh: Nb of Triangles = " << setw(6) << nt << ", Nb of Vertices " << nv << endl; if(nerr) { cerr << "Fatal error: Number of Negative triangles "<< nerr << endl; delete [] v; delete [] t; delete [] b_e; ExecError("bamg2mesh error negative triangle "); } { Fem2D::Mesh *m = new Fem2D::Mesh(nv,nt,neb,v,t,b_e); if (renumbering) m->renum(); m->MakeQuadTree(); return m; } } Fem2D::Mesh *bamg2msh(const bamg::Geometry &Gh) { // ------------------ int nv= Gh.nbv; int neb=Gh.nbe; Fem2D::Triangle * t = 0 ; Fem2D::BoundaryEdge * b_e = new Fem2D::BoundaryEdge[neb]; Fem2D::Vertex *v = new Fem2D::Vertex[nv] ; for (int i=0;iMakeQuadTree(); return m; } // ------------------ } bamg::Triangles * msh2bamg(const Fem2D::Mesh & Th,double cutoffradian,long * reqedgeslab,int nreqedgeslab) { using namespace bamg; Triangles *Tn=new Triangles(Th.nv); Tn->nbv = Th.nv; Tn->nbt = Th.nt; Tn->nbe = Th.neb; Tn->name= new char[strlen("msh2bamg")+1]; strcpy(Tn->name,"msh2bamg"); // Tn->triangles = new Triangle [Tn->nbtx]; throwassert(Tn->triangles); // Tn->vertices = new Vertex [Tn->nbvx]; // Tn->ordre = new (Vertex* [Tn->nbvx]); Tn->edges = new Edge [Th.neb]; Int4 i; Metric Mid(1.); for (i = 0; i < Th.nv; i++) { Tn->vertices[i].r.x = Th(i).x; Tn->vertices[i].r.y = Th(i).y; Tn->vertices[i].m=Mid; Tn->vertices[i].ReferenceNumber = Th(i).lab; } // Int4 i1 [nbt],i2 [nbt],i3 [nbt]; for (i = 0; i < Th.nt; i++) { int i1 = Th(Th[i][0]); int i2 = Th(Th[i][1]); int i3 = Th(Th[i][2]); Tn->triangles[i]= Triangle( Tn,i1 ,i2 ,i3 ); Tn->triangles[i].color = Th[i].lab; } // Real8 cutoffradian = -1; // add code un change boundary part ... frev 2009 JYU FH set labreq; if(nreqedgeslab && verbosity) cout << " label of required edges " ; for (int i=0; i edges[i].v[0] = Tn->vertices + Th(Th.bedges[i][0]); Tn->edges[i].v[1] = Tn->vertices + Th(Th.bedges[i][1]); Tn->edges[i].ref = Th.bedges[i].lab; Tn->edges[i].on = 0; if( labreq.find( Tn->edges[i].ref) != labreq.end()) { k++; Tn->edges[i].on = &paszero; } } if(verbosity)cout << " number of required edges : "<< k << endl; Tn->ConsGeometry(cutoffradian); Tn->Gh.AfterRead(); Tn->SetIntCoor(); Tn->FillHoleInMesh(); return Tn; } bamg::Triangles * msh2bamg(const Fem2D::Mesh & Th,double cutoffradian, int nbdfv, int * ndfv,int nbdfe, int * ndfe, long * reqedgeslab,int nreqedgeslab) { using namespace bamg; Triangles *Tn=new Triangles(Th.nv); KN equiedges(Th.neb); for(int i=0;i kk(Th.neb),kn(Th.neb); kk=0; for(int i=0;i " << dk0 << " " << dk1 << endl; ExecError("bug periodic mesh in ??? "); } equiedges[i]=2*k+sens; } } }; // a faire pour les maillages periodique Tn->nbv = Th.nv; Tn->nbt = Th.nt; Tn->nbe = Th.neb; Tn->name= new char[strlen("msh2bamg")+1]; strcpy(Tn->name,"msh2bamg"); // Tn->triangles = new Triangle [Tn->nbtx]; throwassert(Tn->triangles); // Tn->vertices = new Vertex [Tn->nbvx]; // Tn->ordre = new (Vertex* [Tn->nbvx]); Tn->edges = new Edge [Th.neb]; Int4 i; Metric Mid(1.); for (i = 0; i < Th.nv; i++) { Tn->vertices[i].r.x = Th(i).x; Tn->vertices[i].r.y = Th(i).y; Tn->vertices[i].ReferenceNumber = Th(i).lab; Tn->vertices[i].m=Mid; } // Int4 i1 [nbt],i2 [nbt],i3 [nbt]; for (i = 0; i < Th.nt; i++) { int i1 = Th(Th[i][0]); int i2 = Th(Th[i][1]); int i3 = Th(Th[i][2]); Tn->triangles[i]= Triangle( Tn,i1 ,i2 ,i3 ); Tn->triangles[i].color = Th[i].lab; } // add code un change boundary part ... frev 2009 JYU FH set labreq; if(nreqedgeslab && verbosity) cout << " label of required edges " ; for (int i=0; i edges[i].v[0] = Tn->vertices + Th(Th.bedges[i][0]); Tn->edges[i].v[1] = Tn->vertices + Th(Th.bedges[i][1]); Tn->edges[i].ref = Th.bedges[i].lab; Tn->edges[i].on = 0; if( labreq.find( Tn->edges[i].ref) != labreq.end()) { k++; Tn->edges[i].on = &paszero; } } // Real8 cutoffradian = -1; Tn->ConsGeometry(cutoffradian,equiedges); Tn->Gh.AfterRead(); Tn->SetIntCoor(); Tn->FillHoleInMesh(); return Tn; } extern double genrand_res53(void) ; double NormalDistrib(double sigma) { if( sigma <=0.) return 0.; double rand = genrand_res53() ; const double TWOPI = 3.14159265358979323846264338328*2.; return sigma*sqrt(-2.0*log(rand))*cos(TWOPI*rand); } const Fem2D::Mesh * BuildMesh(Stack stack, E_BorderN const * const & b,bool justboundary,int nbvmax,bool Requiredboundary,KNM *pintern,double alea) { if(alea) Requiredboundary=1; int nbvinter=0; if( pintern) { nbvinter=pintern->N(); if((pintern->M() != 2 ) && ( pintern->M()!=3)) { cout << " point m = " <M()<next) { int nbd = k->NbBorder(stack); for(int index=0; indexNbseg(stack,index))); ; nbvx += n+1; nbe += n; nbsd++; } } Geometry * Gh = new Geometry; if(verbosity>2) cout <<"\t\t" << " Begin: ConstGeometry from nb Border " << nbsd <name=new char [strlen(filename)+1]; strcpy(Gh->name,filename); Real8 Hmin = HUGE_VAL;// the infinie value Int4 hvertices =0; Int4 i,nn,n; //Int4 dim=0; Gh->MaximalAngleOfCorner =30.00*Pi/180.0; Gh->nbv = 0; Gh->nbvx = nbvx; Gh->nbe = nbe; Gh->edges = new GeometricalEdge[Gh->nbe]; bamg::Vertex *vertices = new Vertex[Gh->nbvx];// correction 2009/07/03 double lmin= HUGE_VAL; // generation des points et des lignes i=0; for (E_BorderN const * k=b;k;k=k->next) { int nbd = k->NbBorder(stack); for(int index=0; indexb->xfrom); // a faire double & t = * k->var(stack),tt; double a(k->from(stack)),b(k->to(stack)); long * indx = k->index(stack); if(indx) *indx = index; else ffassert(index==0); n=Max(Abs(k->Nbseg(stack,index)),1L); tt=t=a; double delta = (b-a)/n; for ( nn=0;nn<=n;nn++,i++, tt += delta) { t = tt; if (nn==n) t=b; // to remove roundoff error if( nn >0 && nn < n) { t += NormalDistrib(alea); } // Add F. Hecht Juin 2018 for J-M Sac Epee: jean-marc.sac-epee@univ-lorraine.fr mp.label = k->label(); k->code(stack); // compute x,y, label // cout << " ----- " << i << " " << mp.P.x << " " << mp.P.y << endl; vertices[i].r.x=mp.P.x; vertices[i].r.y=mp.P.y; vertices[i].ReferenceNumber= mp.label; vertices[i].color = i; if (nn>0) { lmin=min(lmin,Norme2_2( vertices[i].r-vertices[i-1].r)); } } } } // add interna point if(pintern) { for(int k=0; kpmin = vertices[0].r; Gh->pmax = vertices[0].r; // recherche des extrema des vertices pmin,pmax for (i=0;ipmin.x = Min(Gh->pmin.x,vertices[i].r.x); Gh->pmin.y = Min(Gh->pmin.y,vertices[i].r.y); Gh->pmax.x = Max(Gh->pmax.x,vertices[i].r.x); Gh->pmax.y = Max(Gh->pmax.y,vertices[i].r.y); } double diameter=Max(Gh->pmax.x-Gh->pmin.x,Gh->pmax.y-Gh->pmin.y); Gh->coefIcoor= (MaxICoor)/diameter; Icoor1 epsI = (Icoor1) (Gh->coefIcoor*eps); ffassert(Gh->coefIcoor >0); if(lmin2) { cout <<"\t\t" << " Geom: min="<< Gh->pmin << "max ="<< Gh->pmax << " hmin = " << Gh->MinimalHmin() << endl; } nbv = 0; { // find common point QuadTree quadtree; Metric Id(1.); for ( i=0;itoI2(vertices[i].r); vertices[i].m = Id; Vertex *v= quadtree.ToClose(vertices[i],eps,epsI,epsI) ; // quadtree.NearestVertex(vertices[i].i.x,vertices[i].i.y); if( v && Norme1(v->r - vertices[i]) < eps ) { vertices[i].color=v->color; } else {quadtree.Add(vertices[i]); vertices[i].color = nbv++;} } /* if (nbvprev-nbv==0) { reffecran(); bamg::R2 O((Gh->pmin+Gh->pmax)/2),D(Gh->pmax-Gh->pmin); cadreortho(O.x,O.y,Max(D.x,D.y)*1.1); xGrafCoef = Gh->coefIcoor; yGrafCoef = Gh->coefIcoor; xGrafOffSet = Gh->pmin.x; yGrafOffSet = Gh->pmin.y; quadtree.Draw(); for (int i=0;i1) cout << " Nb of common points " << nbvprev-nbv <nbvx = nbv; Gh->nbv = nbv; Gh->vertices = new GeometricalVertex[nbv]; throwassert(Gh->nbvx >= Gh->nbv); Gh->nbiv = Gh->nbv; // Int4 k=0; const Direction NoDirOfSearch; // compression of points int kkk; for ( i=0,kkk=0;kkkvertices[i].r.x = vertices[kkk].r.x ; Gh->vertices[i].r.y = vertices[kkk].r.y; //Gh->vertices[i].link = Gh->vertices + i; throwassert(Gh->vertices[i].IsThe()); Gh->vertices[i].ReferenceNumber = vertices[kkk].ReferenceNumber ; Gh->vertices[i].DirOfSearch = NoDirOfSearch; Gh->vertices[i].color =0; Gh->vertices[i].Set(); // vertices[i].SetCorner(); if(Requiredboundary) Gh->vertices[i].SetRequired(); if(Gh->vertices[i].ReferenceNumber < 0) Gh->vertices[i].SetRequired(); i++; } } throwassert(i==nbv); R2 zero2(0,0); if(verbosity>5) cout <<"\t\t" << " Record Edges: Nb of Edge " << Gh->nbe <edges); throwassert (Gh->nbv >0); Real4 *len =0; if (!hvertices) { len = new Real4[Gh->nbv]; for(i=0;inbv;i++) len[i]=0; } int nnn=0; i=0; for (E_BorderN const * k=b;k;k=k->next) { int nbd = k->NbBorder(stack); for(int index=0; indexvar(stack); double a(k->from(stack)),b(k->to(stack)); n=Max(Abs(k->Nbseg(stack,index)),1L); long * indx = (k->index(stack)); if(indx) *indx = index; else ffassert(index==0); double delta = (b-a)/n; t=a+delta/2; for ( nn=0;nnlabel(); k->code(stack); Int4 i1 = vertices[nnn].color, i2 = vertices[++nnn].color; throwassert(i1 >= 0 && i1 < nbv); throwassert(i2 >= 0 && i2 < nbv); Gh->edges[i].ref = mp.label; Gh->edges[i].v[0]= Gh->vertices + i1; Gh->edges[i].v[1]= Gh->vertices + i2; R2 x12 = Gh->vertices[i2].r-Gh->vertices[i1].r; Real8 l12=Norme2(x12); Gh->edges[i].tg[0]=zero2; Gh->edges[i].tg[1]=zero2; Gh->edges[i].SensAdj[0] = Gh->edges[i].SensAdj[1] = -1; Gh->edges[i].Adj[0] = Gh->edges[i].Adj[1] = 0; Gh->edges[i].flag = 0; Gh->edges[i].link=0; if(Requiredboundary) Gh->edges[i].SetRequired(); if (!hvertices) { Gh->vertices[i1].color++; Gh->vertices[i2].color++; len[i1] += l12; len[i2] += l12; } Hmin = Min(Hmin,l12); } nnn++; }} delete [] vertices; vertices=0; throwassert(nnn+nbvinter==nbvprev); throwassert(i==Gh->nbe); // definition the default of the given mesh size if (!hvertices) { bool hvint = pintern ? pintern->M() ==3 : 0; for (i=0;inbv;i++) { if(hvint &&Gh->vertices[i].ReferenceNumber vertices[i].ReferenceNumber-brefintp; Gh->vertices[i].m=Metric( (*pintern)(k ,2L)); Gh->vertices[i].ReferenceNumber = -1; //++ bof bof FH .. } else if (Gh->vertices[i].color > 0) Gh->vertices[i].m= Metric(len[i] /(Real4) Gh->vertices[i].color); else Gh->vertices[i].m= Metric(Hmin); } delete [] len; if(verbosity>3) cout <<"\t\t" << " Geom Hmin " << Hmin << endl; } Gh->NbSubDomains=nbsd; if (Gh->NbSubDomains>0) { Gh->subdomains = new GeometricalSubDomain[ Gh->NbSubDomains]; Int4 i1=0; i=0; for (E_BorderN const * k=b;k;k=k->next) { int nbd = k->NbBorder(stack); for(int index=0; indexNbseg(stack,index); long n= Max(1L,Abs(Nbseg)); Gh->subdomains[i].sens = Nbseg >0 ? 1 : -1; Gh->subdomains[i].edge=Gh->edges + i1; Gh->subdomains[i].ref = i; i1 += n; }} } Gh->NbEquiEdges=0; Gh->NbCrackedEdges=0; const Fem2D::Mesh * m=0; if (justboundary) m=bamg2msh(*Gh); else { Gh->AfterRead(); int nbtx= nbvmax ? nbvmax : (Gh->nbv*Gh->nbv)/9 +1000; if(verbosity> 99) cout << " ** Gh = " << endl << *Gh << endl << " *** " <SetVertexFieldOn(); for( int i=0;inbv;++i) { VertexOnGeom *on=0; if( !(Th->vertices[i].on) ) // we are non on geometry { // move a little the points Th->vertices[i].r.x += NormalDistrib(alea); Th->vertices[i].r.y += NormalDistrib(alea); } } } if(0) { Th->SetVertexFieldOn(); for( int i=0;inbv;++i) { VertexOnGeom *on=0; if( (on =Th->vertices[i].on) ) // we are on geometrie { if(on->abscisse <0) { bamg::GeometricalVertex * gv= on->gv; int iold = Gh->Number(gv); } else {// erreur car un point est sur un arete en non un sommet bamg::GeometricalEdge * ge= on->ge; int eold = Gh->Number(ge); // int iold = Gh->Number( (*ge)[0] ); int jold = Gh->Number( (*ge)[1] ); int s = on->abscisse; // cout << " error bizarre " << ge << endl; } } } } m=bamg2msh(Th,true); } catch(...) { Gh->NbRef=0; delete Gh; if(m) delete m; if(Th) delete Th;// clean memory ??? cout << " catch Err bamg " << endl; throw ; } delete Th; } delete Gh; /* deja fait dans bamg2msh Fem2D::R2 Pn,Px; m->BoundingBox(Pn,Px); m->quadtree=new Fem2D::FQuadTree(m,Pn,Px,m->nv); ---------- */ mp=mps; // m->decrement(); // Add2StackOfPtr2FreeRC(stack,m);// fait au niveau d'apres 07/2008 FH return m; } void E_BorderN::BoundingBox(Stack stack,double &xmin,double & xmax, double & ymin,double & ymax) const { Fem2D::MeshPoint & mp (*Fem2D::MeshPointStack(stack)), mps = mp; for (E_BorderN const * k=this;k;k=k->next) { int nbd = k->NbBorder(stack); for(int index=0; indexb->xfrom); // a faire double & t = * k->var(stack); double a(k->from(stack)),b(k->to(stack)); long * indx = (k->index(stack)); if(indx) *indx = index; else ffassert(index==0); long n=Max(Abs(k->Nbseg(stack,index)),1L); t=a; double delta = (b-a)/n; for (int nn=0;nn<=n;nn++, t += delta) { if (nn==n) t=b; // to remove roundoff error mp.label = k->label(); k->code(stack); // compute x,y, label xmin=Min(xmin,mp.P.x); xmax=Max(xmax,mp.P.x); ymin=Min(ymin,mp.P.y); ymax=Max(ymax,mp.P.y); } }} mp=mps; } void E_BorderN::Plot(Stack stack) const { using Fem2D::R2; Fem2D::MeshPoint & mp (*Fem2D::MeshPointStack(stack)), mps = mp; float x0,x1,y0,y1; getcadre(x0,x1,y0,y1); float h= (x1-x0)*0.01; int nbd=0; for (E_BorderN const * k=this;k;k=k->next) { int nbdr = k->NbBorder(stack); for(int index=0; indexb->xfrom); // a faire double & t = * k->var(stack); double a(k->from(stack)),b(k->to(stack)); long n=Max(Abs(k->Nbseg(stack,index)),1L); long * indx = (k->index(stack)); if(indx) *indx = index; else ffassert(index==0); t=a; double delta = (b-a)/n; R2 P,Po; for (int nn=0;nn<=n;nn++, t += delta) { if (nn==n) t=b; // to remove roundoff error mp.label = k->label(); mp.P.z=0; k->code(stack); // compute x,y, label P=mp.P.p2(); couleur(2+mp.label); if(nn!=0) { LineTo(P); R2 uv(Po,P); double l = Max(sqrt((uv,uv)),1e-20); R2 dd = uv*(-h/l); R2 dn = dd.perp()*0.5; LineTo(P+dd+dn); MoveTo(P+dd-dn); LineTo(P);} else { DrawMark(mp.P.p2(),0.01); MoveTo(mp.P.p2()); } // cout << k->label()<< " " << nn << ", x,y = " << mp.P.x << " , " << mp.P.y << endl; Po=P; } DrawMark(mp.P.p2(),0.01); MoveTo(mp.P.p2()); } } if(verbosity>9) cout << " -- Plot size : " << nbd << " Border \n"; mp=mps; } void E_BorderN::SavePlot(Stack stack,PlotStream & plot ) const { using Fem2D::R2; Fem2D::MeshPoint & mp (*Fem2D::MeshPointStack(stack)), mps = mp; //float x0,x1,y0,y1; //getcadre(x0,x1,y0,y1); //float h= (x1-x0)*0.01; long nbd1=0;// nb of sub border for (E_BorderN const * k=this;k;k=k->next) { int nbdr = k->NbBorder(stack); for(int index=0; indexnext) { int nbdr = k->NbBorder(stack); for(int index=0; indexb->xfrom); // a faire double & t = * k->var(stack); double a(k->from(stack)),b(k->to(stack)); long n=Max(Abs(k->Nbseg(stack,index)),1L); long * indx = (k->index(stack)); if(indx) *indx = index; else ffassert(index==0); t=a; double delta = (b-a)/n; R2 P,Po; plot<< (long) n; for (int nn=0;nn<=n;nn++, t += delta) { if (nn==n) t=b; // to remove roundoff error mp.label = k->label(); mp.P.z=0; k->code(stack); // compute x,y, label P=mp.P.p2(); plot << (long) mp.label <9) cout << " -- Plot size : " << nbd << " Border \n"; mp=mps; } const Fem2D::Mesh * BuildMeshBorder(Stack stack, E_BorderN const * const & b) { return BuildMesh(stack,b,true,0,true); } const Fem2D::Mesh * BuildMesh(Stack stack, E_BorderN const * const & b,bool Requiredboundary) { return BuildMesh(stack,b,false,0,Requiredboundary); } const Fem2D::Mesh * ReadTriangulate( string * const & s) { using namespace Fem2D; KN xy; char c; int nv; for(int step=0;step<2;step++) { nv=0; ifstream f(s->c_str()); if(!f) {cerr <<" Error openning file " << *s << endl; ExecError("Openning file ");} while (f.good()) { R2 P; f >> P ; if (!f.good()) break; if (step) xy[nv]=P; nv++; while (f.get(c) && (c!='\n' && c!='\r' ) ) (void) 0; // eat until control (new line } if (!step && nv ) xy.init(nv); // alloc the array } if(verbosity) cout << " we read " << nv << " coordinates xy "<< endl; Mesh * m=new Mesh(nv,xy); m->MakeQuadTree(); // m->decrement(); // 07/2008 FH auto del ptr // delete s; modif mars 2006 auto del ptr return m; } const Fem2D::Mesh * Triangulate( const KN_ & xx,const KN_ & yy) { using namespace Fem2D; ffassert(xx.N()==yy.N()); int nv=xx.N(); KN xy(nv); for(int i=0;iMakeQuadTree(); // m->decrement(); 07/2008 FH auto del ptr // delete s; modif mars 2006 auto del ptr return m; } const Fem2D::Mesh * ReadMeshbamg( string * const & s) { using bamg::Triangles; Triangles * bTh= new Triangles(s->c_str()); // bTh->inquire(); const Fem2D::Mesh * m=bamg2msh(bTh,false);// no renum delete bTh; // delete s; modif mars 2006 auto del ptr // m->decrement(); 07/2008 FH auto del ptr return m; } const Fem2D::Mesh * buildmeshbamg( string * const & s, int nbvxin) { using bamg::Triangles; using bamg::Geometry; Geometry Gh(s->c_str()); //double hmin = Gh.MinimalHmin(); //double hmax = Gh.MaximalHmax(); int nbvx = nbvxin ? nbvxin : ((Gh.nbv*Gh.nbv)/9 +1000); Triangles * bTh= new Triangles(nbvx,Gh); // bTh->inquire(); const Fem2D::Mesh * m=bamg2msh(bTh,false);// no renum delete bTh; // delete s; modif mars 2006 auto del ptr // m->decrement(); return m; } freefem++-3.61-1/src/femlib/FESpace.hpp000644 000767 000024 00000074421 13256636774 017637 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef FESpace_h_ #define FESpace_h_ #include "FESpacen.hpp" #include namespace Fem2D { class FESpace; class TypeOfFE; /* // numbering of derivative enum operatortype { op_id=0, op_dx=1,op_dy=2, op_dxx=3,op_dyy=4, op_dyx=5,op_dxy=5, op_dz=6, op_dzz=7, op_dzx=8,op_dxz=8, op_dzy=9,op_dyz=9 }; const int last_operatortype=10; inline void initwhatd(bool *whatd,int k) { for (int i=0;i RN_; typedef KN RN; typedef KNM_ RNM_; //typedef KNM RNM; typedef KNMK_ RNMK_; typedef KNMK RNMK; inline int FindIn(int v,int *a,int n) { for (int i=0;i // i = df // j = [0 N[ (ou N est la dim de l'espace d'arrive N=3 // k = 0,1,2 f,fx,fy class FElement; class baseFElement; class FMortar; class TypeOfMortar; // for FE //typedef void (* basicFunction)(const FElement & FE,const R2 &P, RNMK_ & val); typedef void (* InterpolFunction)(R* v, const R2 & P,const baseFElement &,int where,const R2 & Phat, void * arg); //typedef void (*InterpolantFunction)(const FElement & FE,RN_ & val, InterpolFunction f, R* v); // for FM ( Finite Mortar Mortar + interpolation) typedef void (* basicFunctionMortar)(const FMortar & FE,const R2 &P, RNMK_ & val); typedef void (* InterpolFunctionMortar)(R* v, const R2 & P,const Mortar &,int where,const R2 & Phat); typedef void (*InterpolantFunctionMortar)(const FMortar & FE,RN_ & val, InterpolFunctionMortar f, R* v); //void P1Functions(const FElement &FE,const R2 & P,RNMK_ & val); //void P2Functions(const FElement &FE,const R2 & P,RNMK_ & val); class VofScalarFE { R v[3]; public: VofScalarFE() {v[0]=v[1]=v[2]=0;} VofScalarFE(R f,R fx,R fy) {v[0]=f;v[1]=fx;v[2]=fy;} R & operator[](int i){ return v[i];} const R & operator[](int i) const { return v[i];} R f() { return v[0];} R fx() { return v[1];} R fy() { return v[2];} VofScalarFE &operator+=(const VofScalarFE & a) { v[0]+=a.v[0]; v[1]+=a.v[1]; v[2]+=a.v[2];return *this;} }; class ConstructDataFElement { friend class FESpace; //int thecounter; // chang 09/2008 the counter is a pointer because // if you remove before the master the counter become invalide. int * counter; int MaxNbNodePerElement; int MaxNbDFPerElement; int *NodesOfElement; int *FirstNodeOfElement; int *FirstDfOfNode; int NbOfElements; int NbOfDF; int NbOfNode; int Nproduit; ConstructDataFElement(const Mesh &Th,/*int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement,*/ const KN & TFEs,const TypeOfMortar *tm=0, int nbdfv=0,const int *ndfv=0,int nbdfe=0,const int *ndfe=0); ConstructDataFElement(const ConstructDataFElement *,int k); ConstructDataFElement(const FESpace ** l,int k,const KN & TFEs) ; void renum(const long *r,int l) ; ~ConstructDataFElement(); void Make(const Mesh &Th,/*int NbDfOnSommet,int NbDfOnEdge,int NbDfOnElement*/const KN & TFEs,const TypeOfMortar *tm=0, int nbdfv=0,const int *ndfv=0,int nbdfe=0,const int *ndfe=0); private: static int *NewCounter() { int * p=new int; *p=0;return p;}// add the build thecounter. }; template inline int sum(const T ** l,int const T::*p,int n) { int r=0; for (int i=0;i*p; return r; } template inline int max(const T ** l,int const T::*p,int n) { int r=0; for (int i=0;i*p,r); return r; } class TypeOfFE { public: // The FEM is in R^N // The FEM is compose from nb_sub_fem // dim_which_sub_fem[N] give typedef R2 RdHat; // add avril 2009 FH typedef R2 Rd; // add avril 2009 FH friend class FESpace; friend class FElement; friend class FEProduitConstruct; const int NbDoF; const int NbNodeOnVertex, NbNodeOnEdge, NbNodeOnElement; const int NbDfOnVertex, NbDfOnEdge, NbDfOnElement, N,nb_sub_fem; const int NbNode; // remark // virtual void FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const =0; virtual void FB(const bool *,const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const =0; // virtual void D2_FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const=0; // virtual void Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int , void *) const=0; // soit // $(U_pj)_{{j=0,N-1}; {p=0,nbpoint_Pi_h-1}}$ les valeurs de U au point Phat[i]; // p est le numero du point d'integration // j est la composante // l'interpole est defini par // Pi_h u = \sum_k u_k w^k , et u_i = \sum_pj alpha_ipj U_pj // la matrice de alpha_ipj est tres creuse struct IPJ { int i,p,j; // i is DoF, p is Point, j is componante IPJ(int ii=0,int pp=0,int jj=0):i(ii),p(pp),j(jj) {} }; friend KN Makepij_alpha(const TypeOfFE **,int ); friend KN MakeP_Pi_h(const TypeOfFE **,int ); const KN & Ph_ijalpha() const {return pij_alpha;} // la struct de la matrice const KN & Pi_h_R2() const { return P_Pi_h;} // les points virtual void Pi_h_alpha(const baseFElement & K,KN_ & v) const { assert(coef_Pi_h_alpha); v=KN_(coef_Pi_h_alpha,pij_alpha.N());} // ---- const int nbsubdivision; // nb of subdivision for plot int const * const DFOnWhat; // 0,1,2 vertex 3,4,5 edge 6 triangle int const * const DFOfNode; // n\u00c9 du df on Node int const * const NodeOfDF; // int const * const fromFE; // the df come from df of FE int const * const fromDF; // the df come from with FE int const * const dim_which_sub_fem; // from atomic sub FE for CL (size N) KN pij_alpha ; KN P_Pi_h ; double *coef_Pi_h_alpha; KN Sub_ToFE; // List of atomic sub TFE avril 2006 // form Atomic Sub FE int const * const fromASubFE; // avril 2006 for CL int const * const fromASubDF; // avril 2006 for CL int const * const begin_dfcomp; // mai 2008 for optimiation int const * const end_dfcomp; // mai 2008 // if 0 no plot public: TypeOfFE(const TypeOfFE & t,int k,const int * data,const int * data1) : NbDoF(t.NbDoF*k), NbNodeOnVertex(t.NbNodeOnVertex),NbNodeOnEdge(t.NbNodeOnEdge),NbNodeOnElement(t.NbNodeOnElement), NbDfOnVertex(t.NbDfOnVertex*k),NbDfOnEdge(t.NbDfOnEdge*k),NbDfOnElement(t.NbDfOnElement*k), N(t.N*k),nb_sub_fem(t.nb_sub_fem*k), NbNode(t.NbNode), nbsubdivision(t.nbsubdivision), DFOnWhat(data), DFOfNode(data+NbDoF), NodeOfDF(data+2*NbDoF), fromFE(data+3*NbDoF), fromDF(data+4*NbDoF), dim_which_sub_fem(data+5*NbDoF), pij_alpha(t.pij_alpha.N()*k),P_Pi_h(t.P_Pi_h), coef_Pi_h_alpha(0), Sub_ToFE(nb_sub_fem), fromASubFE(data1+0*NbDoF), fromASubDF(data1+1*NbDoF), begin_dfcomp(data1+2*NbDoF), end_dfcomp(data1+2*NbDoF+N) { for(int i=0,kk=0;i=0 && dim_which_sub_fem[N-1]< nb_sub_fem); // Warning the componant is moving first for (int j=0,l=0;jnb_sub_fem;j++) Sub_ToFE[kk++]=t[i]->Sub_ToFE[j]; assert(begin_dfcomp[0]==0 && end_dfcomp[N-1]==NbDoF); Sub_ToFE= this; throwassert(dim_which_sub_fem[N-1]>=0 && dim_which_sub_fem[N-1]< nb_sub_fem);} TypeOfFE(const int i,const int j,const int k,const int NN,const int * data,int nsub,int nbsubfem, int kPi,int npPi,double * coef_Pi_h_a=0) : NbDoF(3*(i+j)+k), NbNodeOnVertex(NbNodebyWhat(data,NbDoF,0)), NbNodeOnEdge(NbNodebyWhat(data,NbDoF,3)), NbNodeOnElement(NbNodebyWhat(data,NbDoF,6)), /* NbDfOnVertex(Count(data,NbDoF,0)), NbDfOnEdge(Count(data,NbDoF,3)), NbDfOnElement(Count(data,NbDoF,6)), */ NbDfOnVertex(i),NbDfOnEdge(j),NbDfOnElement(k),N(NN),nb_sub_fem(nbsubfem), NbNode( (NbDfOnVertex ? 3 :0) + (NbDfOnEdge ? 3 :0 ) +(NbDfOnElement? 1 :0) ), nbsubdivision(nsub), DFOnWhat(data), DFOfNode(data+NbDoF), NodeOfDF(data+2*NbDoF), fromFE(data+3*NbDoF), fromDF(data+4*NbDoF), dim_which_sub_fem(data+5*NbDoF), pij_alpha(kPi),P_Pi_h(npPi), coef_Pi_h_alpha(coef_Pi_h_a), Sub_ToFE(nb_sub_fem), fromASubFE(data+3*NbDoF), fromASubDF(data+4*NbDoF), begin_dfcomp(data+5*NbDoF+N), end_dfcomp(data+5*NbDoF+2*N) { Sub_ToFE= this; assert(begin_dfcomp[0]==0 && end_dfcomp[N-1]==NbDoF); // cout << "TypeOfFE " <=0 && dim_which_sub_fem[N-1]< nb_sub_fem);} TypeOfFE(const int nbdf,const int NN,const int * data,int nsub,int nbsubfem, int kPi,int npPi,double * coef_Pi_h_a=0) : NbDoF(nbdf), NbNodeOnVertex(NbNodebyWhat(data,NbDoF,0)), NbNodeOnEdge(NbNodebyWhat(data,NbDoF,3)), NbNodeOnElement(NbNodebyWhat(data,NbDoF,6)), NbDfOnVertex(Count(data,NbDoF,0)), NbDfOnEdge(Count(data,NbDoF,3)), NbDfOnElement(Count(data,NbDoF,6)), N(NN), nb_sub_fem(nbsubfem), NbNode( (NbDfOnVertex ? 3 :0) + (NbDfOnEdge ? 3 :0 ) +(NbDfOnElement? 1 :0) ), nbsubdivision(nsub), DFOnWhat(data), DFOfNode(data+NbDoF), NodeOfDF(data+2*NbDoF), fromFE(data+3*NbDoF), fromDF(data+4*NbDoF), dim_which_sub_fem(data+5*NbDoF), pij_alpha(kPi),P_Pi_h(npPi), coef_Pi_h_alpha(coef_Pi_h_a), Sub_ToFE(nb_sub_fem) , fromASubFE(data+3*NbDoF), fromASubDF(data+4*NbDoF), begin_dfcomp(data+5*NbDoF+N), end_dfcomp(data+5*NbDoF+2*N) { Sub_ToFE= this; assert(begin_dfcomp[0]==0 && end_dfcomp[N-1]==NbDoF); assert(NbDfOnVertex==Count(data,NbDoF,0)); assert(NbDfOnVertex==Count(data,NbDoF,1)); assert(NbDfOnVertex==Count(data,NbDoF,2)); assert(NbDfOnEdge==Count(data,NbDoF,3)); assert(NbDfOnEdge==Count(data,NbDoF,4)); assert(NbDfOnEdge==Count(data,NbDoF,5)); assert(NbDfOnElement==Count(data,NbDoF,6)); throwassert(dim_which_sub_fem[N-1]>=0 && dim_which_sub_fem[N-1]< nb_sub_fem);} virtual ~TypeOfFE() { } virtual R operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const ; private: static int Count(const int *data,int n,int which) { int kk=0; for (int i=0;iNodesOfElement << endl;else cout << endl; } private: // for gibbs int gibbsv (long* ptvoi,long* vois,long* lvois,long* w,long* v); }; inline baseFElement::baseFElement( const FESpace &aVh, int k) : Vh(aVh),T(Vh.Th[k]),tfe(aVh.TFE[k]),N(aVh.N),number(k){} inline baseFElement::baseFElement(const baseFElement & K, const TypeOfFE & atfe) : Vh(K.Vh),T(K.T),tfe(&atfe),N(Vh.N),number(K.number){} inline FElement::FElement(const FESpace * VVh,int k) : baseFElement(*VVh,k) , p(Vh.PtrFirstNodeOfElement(k)), nb(Vh.NbOfNodesInElement(k)) {} inline int FElement::operator[](int i) const { return p ? p[i] : ((&T[i])-Vh.Th.vertices);} inline int FElement::operator()(int i,int df) const { return Vh.FirstDFOfNode(p ? p[i] : ((&T[i])-Vh.Th.vertices)) + df;} inline int FMortar::operator()(int i,int df) const {throwassert(p); return Vh.FirstDFOfNode(p[i]) + df;} inline int FMortar::operator[](int i) const {throwassert(p); return p[i];} inline int FElement::NbDoF(int i) const { int node =p ? p[i] : ((&T[i])-Vh.Th.vertices); return Vh.LastDFOfNode(node)-Vh.FirstDFOfNode(node);} void SetDefaultIsoValue(const KN_& U,KN_ & Viso); void SetDefaultIsoValue(const KN_& u,const KN_& v,KN_ & Viso); void MoveTo(R2 P); void LineTo(R2 P) ; /* void operator=( KN_ & u,const FElementGlobalToLocal & x) { int n=u.N(); throwassert(n==x.S.NbDoF()); for (int i=0;iNbDoF(Vh.Th,M);} //inline int FMortar::NbOfNodes()const {return } inline int FMortar::NodeOfDF(int i) const { return tom->NodeOfDF(Vh,M,i);} inline int FMortar::DFOfNode(int i) const { return tom->DFOfNode(Vh,M,i);} inline ostream & operator << (ostream & f,const FElement & FE) { f << FE.number << "," <FB(whatdold,Vh.Th,T,P,val);} inline void FElement::BF(const bool * whatd,const R2 & P,RNMK_ & val) const { tfe->FB(whatd,Vh.Th,T,P,val);} //inline void FElement::D2_BF(const R2 & P,RNMK_ & val) const { tfe->D2_FB(Vh.Th,T,P,val);} // ------- extern const TypeOfMortar & TheMortarCas1P2; void PlotValue(const RN_ & Viso,int k0,const char * cmm); // to store all the type of TFE // the problem is the TFE can be define on lot of file.cpp struct ListOfTFE { const char * name; TypeOfFE * tfe; ListOfTFE * next; static ListOfTFE * all ; // list of all object of this type ListOfTFE (const char * n,TypeOfFE *t); }; // to get a unique list of TypeOfFE // local variable of TypeOfFE ListOfTFE & GetListOfTFE() ; inline R FElement::operator()(const R2 & PHat, const KN_ & u,int i,int op) const { return (*tfe)(*this,PHat,u,i,op); } inline complex FElement::operator()(const R2 & PHat,const KN_ > & u,int i,int op) const { complex * pu=u; // pointeur du tableau double *pr = static_cast(static_cast(pu)); const KN_ ur(pr,u.n,u.step*2); const KN_ ui(pr+1,u.n,u.step*2); return complex((*tfe)(*this,PHat,ur,i,op),(*tfe)(*this,PHat,ui,i,op)); } } #endif freefem++-3.61-1/src/mpi/parallelempi-empty.cpp000644 000767 000024 00000000452 13256636774 021507 0ustar00hechtstaff000000 000000 // empty parallele interface if no MPI to build dll // with or without mpi.. //#include "parallelepmi.hpp" extern void (*initparallele)(int &argc, char **& argv) ; extern void (*init_lgparallele)(); extern void (*end_parallele)(); void init_ptr_parallelepmi(); void init_ptr_parallelepmi(){}; freefem++-3.61-1/src/mpi/ff-mpirun.in000755 000767 000024 00000001730 13256636774 017436 0ustar00hechtstaff000000 000000 #!/bin/bash # ./config.status --file=ff-mpirun:ff-mpirun.in mpirun=mpirun dir=`dirname $0` prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" nw=1 if [ -n "@MPIRUN@" ] ;then mpirun="@MPIRUN@" ; fi ffmpi=FreeFem++-mpi if [ -x "$0" -a -x "$dir/$ffmpi" ]; then if [ -n "@WIN32DLLTARGET@" -a -x "$dir/../bin-win32/$ffmpi.exe" ] ; then ffmpi="$dir/../bin-win32/$ffmpi.exe"; else ffmpi="$dir/$ffmpi"; fi fi if [ -d "$bindir" ] ;then export PATH="@bindir@:$PATH" ; fi a[0]="'$mpirun'" j=1; #echo $1 --- while test -n "$1" ; do ((j=$j+1)) #((j1=$j+1)) #echo --- $1 -- $j1 $j case "$1" in "-nw") nw=1;; "-win") nw=0;; *.edp) a[$j]="${ffmpi}"; if [ "$nw" -eq 1 ]; then ((j=$j+1));a[$j]="-nw"; fi ((j=$j+1));a[$j]="$1";; #if[ ! -f "$1" ]; then echo error file no found "$1"; dry=2; fi;; -dry) dry=1;; *) a[$j]="$1";; esac shift done echo "${a[*]}" if [ -n "$dry" ]; then echo which $ffmpi : `which "$ffmpi"`; fi if [ -z "$dry" ]; then eval "${a[*]}"; fi freefem++-3.61-1/src/mpi/Makefile.am000644 000767 000024 00000002025 13256636774 017232 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # change FH mars 2010 for sgi mpiu .... # FFCS - we need to call MPICXX directly because Windows options are too different to be detailed to the FF configuration script. CXX=@MPICXX@ # To create statically linked executables (see configure.ac) CXXLD=$(STATICTOOL) $(CXX) # MPI may not be installed. Checked in configure.ac bin_PROGRAMS=$(MPIPROG) bin_SCRIPTS=$(MPISCRIPT) EXTRA_PROGRAMS=FreeFem++-mpi EXTRA_SCRIPTS=ff-mpirun EXTRA_DIST=ff-mpirun.in # FFCS: visualization stream redirection FreeFem___mpi_SOURCES=../Graphics/sansrgraph.cpp ../lglib/mymain.cpp parallelempi.cpp ../lglib/lg.tab.cpp \ ../fflib/ffapi.cpp FreeFem___mpi_DEPENDENCIES=../fflib/libff.a LDADD=../fflib/libff.a @UMFPACKLIBS@ @ARPACKLIBS@ @BLASLIBS@ @MPI_LIB@ AM_CXXFLAGS=-DPARALLELE AM_CPPFLAGS=-I$(srcdir)/../fflib -I$(srcdir)/../Graphics -I$(srcdir)/../femlib @MPI_INCLUDE@ ff-mpirun:ff-mpirun.in Makefile ../../config.status --file=ff-mpirun:ff-mpirun.in chmod a+x ff-mpirun freefem++-3.61-1/src/mpi/parallelempi.cpp000644 000767 000024 00000305054 13312446271 020341 0ustar00hechtstaff000000 000000 #include #include #include #include #include #include #include #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" // FH: I have move AFunction_ext.hpp to fflib dir. #include "AFunction_ext.hpp" // Add J. Morice for AFunction_ext.hpp #include "ufunction.hpp" using namespace std; #include "rgraph.hpp" #include "RNM.hpp" // after RNM otherwise // trouble with index in RNM (I do no understander FH) #include #include #include #include "fem.hpp" #include "FESpacen.hpp" #include "FESpace.hpp" #include "MatriceCreuse_tpl.hpp" #include "MeshPoint.hpp" #include "Mesh2dn.hpp" #include "Mesh3dn.hpp" #include "Operator.hpp" #include "lex.hpp" #include "libmesh5.h" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" //FFCS redirection #include "../fflib/ffapi.hpp" void ff_atend( void (*atendff)()); #undef MPICH_SKIP_MPICXX #define MPICH_SKIP_MPICXX #undef MPICH_IGNORE_CXX_SEEK #define MPICH_IGNORE_CXX_SEEK #include // Remark on mipich MPI_Comm, MPI_Resquest, MPI_Group, MPI_Op are int // => encapsulation //static long verbosity=1000; template struct fMPI { MPI_type v; operator MPI_type &() {return v;} operator MPI_type *() {return &v;} operator MPI_type () const {return v;} // MPI_type * operator &() {return &v;} void operator=(const MPI_type vv) { v=vv;} fMPI(const MPI_type vv=0) : v(vv){} bool operator!=(MPI_type vv) const {return vv !=v;} bool operator==(MPI_type vv) const {return vv ==v;} }; // the encapsulation for the for MPI type (int on mpich ) typedef fMPI fMPI_Comm; typedef fMPI fMPI_Group; typedef fMPI fMPI_Request; typedef fMPI fMPI_Op; // end of encapsulation .. // to send a sparse matrix we send header, line array ,colmun array, value array. // end afer the fist resquest we need to do allocation. // so in this cas the communacatio is done in // 2 step // 1 the header, // alloc time // 2 the message // a couple request, pointer. // Not use of IPROBE because probelem of wait. class MPIrank; class DoOnWaitMPI_Request ; map ToDoOnWaitMPI_Request; void GetPendingWait() ; template struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_BYTE;}};; template<> struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_LONG;}}; template<> struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_INT;}}; template<> struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_DOUBLE;}}; template<> struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_BYTE;}}; #ifdef HAVE_MPI_DOUBLE_COMPLEX template<> struct MPI_TYPE {static MPI_Datatype TYPE(){return MPI_DOUBLE_COMPLEX;}}; #endif template struct MPI_WHAT {}; template<> struct MPI_WHAT {static const int WHAT=101;}; template<> struct MPI_WHAT {static const int WHAT=102;}; template<> struct MPI_WHAT {static const int WHAT=103;}; template<> struct MPI_WHAT *> {static const int WHAT=104;}; template<> struct MPI_WHAT* > {static const int WHAT=105;}; template<> struct MPI_WHAT* > {static const int WHAT=106;}; template<> struct MPI_WHAT *> {static const int WHAT=107;}; template<> struct MPI_WHAT* > {static const int WHAT=108;}; template<> struct MPI_WHAT* > {static const int WHAT=109;}; template struct MPI_TAG {}; template<> struct MPI_TAG {static const int TAG=5;}; template<> struct MPI_TAG {static const int TAG=4;}; template<> struct MPI_TAG {static const int TAG=6;}; template<> struct MPI_TAG* > {static const int TAG=11;}; template<> struct MPI_TAG* > {static const int TAG=12;}; template<> struct MPI_TAG* > {static const int TAG=13;}; template<> struct MPI_TAG* > {static const int TAG=14;}; template<> struct MPI_TAG* > {static const int TAG=15;}; template<> struct MPI_TAG* > {static const int TAG=16;}; template<> struct MPI_TAG {static const int TAG=1000;}; template<> struct MPI_TAG {static const int TAG=1010;}; template<> struct MPI_TAG {static const int TAG=1000;}; template<> struct MPI_TAG {static const int TAG=1010;}; template<> struct MPI_TAG *> {static const int TAG=1020;}; template<> struct MPI_TAG *> {static const int TAG=1030;}; void f_initparallele(int &, char **&); void f_init_lgparallele(); extern long mpirank ; extern long mpisize ; // for syncro communication MPI_Request * Syncro_block = reinterpret_cast (1); const size_t sizempibuf = 1024*320; template long WSend( R * v,int l,int who,int tag,MPI_Comm comm,MPI_Request *rq) { long ret=0; MPI_Request rq0,*request=&rq0; if(verbosity>100) cout << mpirank<< " send to " << who << " tag " << tag << " " << rq << " " << comm << " syncro "<< (rq == Syncro_block) <::TYPE() , who, tag,comm); else { ret=MPI_Isend((void *) v,l, MPI_TYPE::TYPE() , who, tag,comm,request); *rq=*request; } return ret; } template void CheckContigueKNM(const KNM_ &t) { if( t.step != 1 && !t.IsVector1() ) { cout<< " step= "<< t.step << " size " << t.N() << " " << & t[0] << " " << & t[1] << endl; ExecError("Sorry the array is not contigue (step != 1) "); } } template void CheckContigueKN(const KN_ &t) { if( t.step != 1 && t.N()>1) { cout<< " step= "<< t.step << " size " << t.N() << " " << & t[0] << " " << & t[1] << endl; ExecError("Sorry the array is not contigue (step != 1) "); } } template<> long WSend ( Complex * v,int n,int who,int tag,MPI_Comm comm,MPI_Request *rq) { long ret=0; MPI_Request rq0,*request=&rq0; if(verbosity>100) cout << mpirank<< " send to " << who << " tag " << tag << " " << rq << " " << comm << " syncro "<< (rq == Syncro_block) << endl; if(rq == Syncro_block || rq ==0) { #ifdef HAVE_MPI_DOUBLE_COMPLEX ret=MPI_Send(reinterpret_cast (v) , n, MPI_DOUBLE_COMPLEX, who, tag,comm); #else n *=2; ret= MPI_Send(reinterpret_cast (v), n, MPI_DOUBLE, who, tag,comm); #endif } else { #ifdef HAVE_MPI_DOUBLE_COMPLEX ret=MPI_Isend(reinterpret_cast (v) , n, MPI_DOUBLE_COMPLEX, who, tag,comm,request); #else n *=2; ret=MPI_Isend(reinterpret_cast (v), n, MPI_DOUBLE, who, tag,comm,request); n /= 2; #endif if(rq) *rq=*request; else MPI_Request_free(request); } return ret; } template long WRecv(R * v,int n,int who,int tag,MPI_Comm comm,MPI_Request *rq) { MPI_Status status; if(rq && (rq != Syncro_block)) return MPI_Irecv(reinterpret_cast (v),n, MPI_TYPE::TYPE() , who, tag,comm,rq); else return MPI_Recv(reinterpret_cast (v),n, MPI_TYPE::TYPE() , who, tag,comm,&status); } template<> long WRecv (Complex * v,int n,int who,int tag,MPI_Comm comm,MPI_Request *rq) { MPI_Status status; #ifdef HAVE_MPI_DOUBLE_COMPLEX if(rq && (rq != Syncro_block)) return MPI_Irecv(reinterpret_cast (v), n, MPI_DOUBLE_COMPLEX, who, tag,comm,rq); else return MPI_Recv(reinterpret_cast (v), n, MPI_DOUBLE_COMPLEX, who, tag,comm,&status); #else n *=2; if(rq && (rq != Syncro_block)) return MPI_Irecv(reinterpret_cast (v), n, MPI_DOUBLE, who, tag,comm,rq); else return MPI_Recv(reinterpret_cast (v), n, MPI_DOUBLE, who, tag,comm,&status); #endif } template void WBcast(R * v,int n,int who,MPI_Comm comm) { assert(v && n>0); MPI_Bcast(reinterpret_cast (v), n, MPI_TYPE::TYPE(), who,comm); } template<> void WBcast(Complex * v,int n,int who,MPI_Comm comm) { assert(v && n>0); #ifdef HAVE_MPI_DOUBLE_COMPLEX MPI_Bcast(reinterpret_cast (v), n, MPI_DOUBLE_COMPLEX /*MPI_TYPE::TYPE()*/, who,comm); #else n *=2; MPI_Bcast(reinterpret_cast (v), n, MPI_DOUBLE, who,comm); #endif } struct MPIrank { int who; MPI_Comm comm; MPI_Request *rq; // mutable bool block; MPIrank(int i=0,MPI_Comm com=MPI_COMM_WORLD, MPI_Request *rqq=0) : who(i) , comm(com),rq(rqq) { int n; MPI_Comm_size(comm, &n); // cout <<" who = " << who << " ******** " << n << " "<< ((-2 < who) && (who < n)) << endl; // ffassert( (-2 < who) && (who < n) ); // plant sans raison ... } long Send(double a)const {return WSend(&a, 1, who, MPI_TAG< double >::TAG,comm,rq); } long Send(long a)const {return WSend(&a, 1, who, MPI_TAG< long >::TAG,comm,rq); } long Send(Complex a)const {return WSend(&a, 1, who, MPI_TAG< Complex >::TAG,comm,rq); } long Recv(double & a) const { return WRecv(&a, 1, who, MPI_TAG< double >::TAG ,comm,rq);} long Recv(long & a) const { return WRecv(&a, 1, who, MPI_TAG< long >::TAG ,comm,rq);} long Recv(Complex & a) const { return WRecv(&a, 1, who, MPI_TAG< Complex >::TAG ,comm,rq);} const MPIrank & Bcast(double & a) const {WBcast(&a, 1, who,comm); return *this; } const MPIrank & Bcast(long & a) const {WBcast(&a, 1, who,comm); return *this; } const MPIrank & Bcast(Complex & a) const {WBcast(&a, 1, who,comm); return *this; } template long Recv(KN & a) const { assert(&a); CheckContigueKN(a); if(verbosity>99) cout << " ---- " << who << " >> " << & a << " " << a.N() << " " << a.step << " " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; int n= a.N(); long ll=WRecv((R *) a, n, who, MPI_TAG* >::TAG ,comm,rq); if(verbosity>99) cout << " ++++ " << who << " >> " << & a << " " << a.N() << " " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; ffassert(a.N()==n); return ll; } template long Send(const KN *aa)const { const KN & a=*aa; ffassert(&a); int n= a.N(); CheckContigueKN(*aa); if(verbosity>99) cout << " .... " << who << " >> " << & a << " " << a.N() << " " << a.step<< " " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; return WSend((R *) a,n,who,MPI_TAG* >::TAG,comm,rq); } template const MPIrank & Bcast(const KN &a) const { //const KN & a=*aa; assert(&a); int n= a.N(); CheckContigueKN(a); WBcast((R *) a, n, who,comm); ffassert(a.N()==n); return *this; } // KNM *********************************** Add FH. Nov 2016 template long Recv(KNM & a) const { assert(&a); CheckContigueKNM(a); if(verbosity>99) cout << " ---- " << who << " >> " << & a << " " << a.N() << "x" << a.M() << " " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; int n= a.N()*a.M(); long ll=WRecv((R *) a, n, who, MPI_TAG* >::TAG ,comm,rq); if(verbosity>99) cout << " ++++ " << who << " >> " << & a << " " << a.N() << "x" << a.M()<<" " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; ffassert(a.N()*a.M()==n); return ll; } template long Send(const KNM *aa)const { const KNM & a=*aa; ffassert(&a); int n= a.N()*a.M(); CheckContigueKNM(*aa); if(verbosity>99) cout << " .... " << who << " >> " << & a << " " << a.N() <<"x" << a.M() << " " << a.step<< " " << MPI_TAG* >::TAG <<" from " << mpirank << " "<< (R *) a << endl; return WSend((R *) a,n,who,MPI_TAG* >::TAG,comm,rq); } template const MPIrank & Bcast(const KNM &a) const { //const KN & a=*aa; assert(&a); int n= a.N()*a.M(); CheckContigueKNM(a); WBcast((R *) a, n, who,comm); ffassert(a.N()*a.M()==n); return *this; } // KNM *********************************** const MPIrank & Bcast(Fem2D::Mesh const *& a) const { if(verbosity>100) cout << " MPI Bcast (mesh *) " << a << endl; Serialize *buf=0; long nbsize=0; if( who == mpirank) { buf =new Serialize((*a).serialize()); nbsize = buf->size(); } WBcast( &nbsize, 1, who,comm); if (who != mpirank) buf= new Serialize(nbsize,Fem2D::Mesh::magicmesh); assert(nbsize); if(verbosity>200) cout << " size to bcast : " << nbsize << " mpirank : " << mpirank << endl; WBcast( (char *)(*buf),nbsize, who,comm); if(who != mpirank) { if (a) (*a).decrement(); Fem2D::Mesh *pTh= new Fem2D::Mesh(*buf); Fem2D::R2 Pn,Px; pTh->BoundingBox(Pn,Px); pTh->quadtree=new Fem2D::FQuadTree(pTh,Pn,Px,pTh->nv); a=pTh; } delete buf; return *this; } const MPIrank & Bcast(Fem2D::Mesh3 const *& a) const { if(verbosity>100) cout << " MPI Bcast (const mesh3 *) " << a << endl; Serialize *buf=0; long nbsize=0; if( who == mpirank) { buf =new Serialize((*a).serialize()); nbsize = buf->size(); } WBcast( &nbsize, 1, who,comm); if (who != mpirank) buf= new Serialize(nbsize,Fem2D::GenericMesh_magicmesh); assert(nbsize); if(verbosity>200) cout << " size to bcast : " << nbsize << " mpirank : " << mpirank << endl; WBcast( (char *)(*buf),nbsize, who,comm); if(who != mpirank) { if (a) (*a).decrement(); Fem2D::Mesh3 * aa= new Fem2D::Mesh3(*buf); aa->BuildGTree(); a=aa; } delete buf; return *this; } template const MPIrank & Bcast(Matrice_Creuse & a) const { if(verbosity>100) cout << mpirank << ": MPI Bcast " << who << " (Matrice_Creuse &) " << &a << " " << a.A << endl; MatriceMorse *mA=0; int ldata[4]={0,0,0,0}; if( who == mpirank) { if(a.A) { mA= a.A->toMatriceMorse(); ldata[0]=mA->n; ldata[1]=mA->m; ldata[2]=mA->nbcoef; ldata[3]=mA->symetrique; // cout << mpirank << " ldata " << ldata[0] << " " << ldata[1] <<" " << ldata[2] << " " <(ldata[0],ldata[1],ldata[2],ldata[3]); if(ldata[0]) { // cout << mpirank << " " << who << " lg " << mA->lg << " " << n1 << endl; WBcast( mA->lg,n1, who,comm); //cout << mpirank << " " << who << " cl " << mA->cl << " " << mA->nbcoef << endl; WBcast( mA->cl,mA->nbcoef, who,comm); //cout << mpirank << " " << who << " a " << mA->a << " " << mA->nbcoef << endl; WBcast( mA->a,mA->nbcoef , who,comm); } if( who != mpirank) a.A.master(mA); else delete mA; return *this; } // version asyncrone or syncrone Now 2010 ... template long Send(Matrice_Creuse * const & a) const ; template long Recv(Matrice_Creuse & a) const ; long Send(Fem2D::Mesh const * a) const ; long Send (Fem2D::Mesh3 const * a) const ; long Recv(Fem2D::Mesh const *& a) const; long Recv(Fem2D::Mesh3 const *& a) const; operator int () const { return who;} }; // for MPI_WAIT_resquets (complex MPI asyncrone MPI recv request ) .. class DoOnWaitMPI_Request :public MPIrank { public: bool sync; DoOnWaitMPI_Request( MPIrank mpr) : MPIrank(mpr),sync((rq==0 || rq == Syncro_block)) {} virtual bool Do(MPI_Request *rrq) =0; // false -> end bool DoSR() { // do the Send/Recv Op. bool ret=false; if(verbosity>100) cout << mpirank << " --- Do Send/Recv : " << " " << rq << " " << sync << endl; if(sync) // wait ... { bool c=1; if(verbosity>100) cout << mpirank << " --- Do way : " << c << " " << rq << endl; while (c) { c=Do(rq); if(verbosity>100) cout << mpirank << " --- Do return : " << c << " " << rq << endl; } ret=true;// clean } else ToDoOnWaitMPI_Request[rq]=this; // add request for WAIT .. return ret; } virtual ~DoOnWaitMPI_Request(){} private: DoOnWaitMPI_Request(const DoOnWaitMPI_Request & ); DoOnWaitMPI_Request & operator=( DoOnWaitMPI_Request & ); }; void DoOnWaitMPIRequest(MPI_Request *rq) { if( rq ) { map:: iterator drd = ToDoOnWaitMPI_Request.find(rq) ; if(drd != ToDoOnWaitMPI_Request.end()) { if(verbosity>100) cout << " Do on DoOnWaitMPIRequest " << rq << " " << endl; if( !drd->second->Do(rq) ) { delete drd->second; ToDoOnWaitMPI_Request.erase(drd); // finish ... } } } } void DeSerialize(Serialize * sTh,Fem2D::Mesh const ** ppTh) { if ( *ppTh ) (**ppTh).decrement(); // cout << " ####"<< sTh << endl; Fem2D::Mesh * pTh= new Fem2D::Mesh(*sTh); // cout << " ####\n"; *ppTh=pTh; Fem2D::R2 Pn,Px; pTh->BoundingBox(Pn,Px); pTh->quadtree=new Fem2D::FQuadTree(pTh,Pn,Px,pTh->nv); } void DeSerialize(Serialize * sTh,const Fem2D::Mesh3 ** ppTh) { if ( *ppTh ) (**ppTh).decrement(); Fem2D::Mesh3 * pTh= new Fem2D::Mesh3(*sTh); pTh->BuildGTree(); *ppTh=pTh; } template class RevcWMatd : public DoOnWaitMPI_Request { public: typedef Matrice_Creuse Mat; Matrice_Creuse * pmat; MatriceMorse *mA; int state; int ldata[4]; RevcWMatd(const MPIrank *mpirank,Mat * pm) : DoOnWaitMPI_Request(*mpirank), pmat(pm),mA(0),state(0) { int tag = MPI_TAG* >::TAG; int ll=WRecv( ldata,4, who, tag,comm,rq); ffassert(ll == MPI_SUCCESS); } bool Do(MPI_Request *rrq) { state++; int tag=MPI_TAG::TAG; if(verbosity>100) cout << mpirank << " ---R: ldata " << ldata[0] << " " << ldata[1] <<" " << ldata[2] << " " <(ldata[0],ldata[1],ldata[2],ldata[3]); ll=WRecv( mA->lg,mA->n+1, who, tag+1,comm,rq); break; case 2: ll=WRecv( mA->cl,mA->nbcoef, who, tag+2,comm,rq); break; case 3: ll=WRecv( mA->a,mA->nbcoef, who, tag+3,comm,rq); break; default: pmat->A.master(mA); mA=0; return false; break; } ffassert(ll == MPI_SUCCESS); return true; // OK } ~RevcWMatd() { if(mA) delete mA; } }; template class SendWMatd : public DoOnWaitMPI_Request { public: typedef Matrice_Creuse Mat; Matrice_Creuse * pmat; MatriceMorse *mA; int state; int ldata[4]; SendWMatd(const MPIrank *mpirank,Mat * pm) : DoOnWaitMPI_Request(*mpirank), pmat(pm),mA(0),state(0) { mA=pmat->A->toMatriceMorse(); ldata[0]=mA->n; ldata[1]=mA->m; ldata[2]=mA->nbcoef; ldata[3]=mA->symetrique; int tag = MPI_TAG* >::TAG; int ll=WSend( ldata,4, who, tag,comm,rq); ffassert(ll == MPI_SUCCESS) ; } bool Do(MPI_Request *rrq) { state++; int tag=MPI_TAG::TAG; if(verbosity>100) cout << mpirank << " ---S ldata " << ldata[0] << " " << ldata[1] <<" " << ldata[2] << " " <lg,mA->n+1, who, tag+1,comm,rq); break; case 2: ll=WSend( mA->cl,mA->nbcoef, who, tag+2,comm,rq); break; case 3: ll=WSend( mA->a,mA->nbcoef, who, tag+3,comm,rq); break; default: delete mA; mA=0; return false; break; } ffassert(ll == MPI_SUCCESS); return true; // OK } ~SendWMatd() { if(mA) delete mA; } }; template class RevcWMeshd : public DoOnWaitMPI_Request,Serialize { public: Mesh const ** ppTh; int state; RevcWMeshd(const MPIrank *mpirank,Mesh const ** ppThh) : DoOnWaitMPI_Request(*mpirank),Serialize(sizempibuf,Fem2D::Mesh::magicmesh), ppTh(ppThh),state(0) { // remark the first data in p is the size in long long int tag=MPI_TAG::TAG; if(verbosity>99) cout << " -- RevcWMeshd " << rq << " " << comm << " " << p << endl; int ll=WRecv(p, sizempibuf, who, tag,comm,rq); // wait first part Warning async => not wait. } bool Do(MPI_Request *rrq) { long long lsz; int tag=MPI_TAG::TAG; ffassert(rq == rrq); size_t kk=0; get(kk,lsz); if(verbosity>199) cout << mpirank << " -- lsk = " <0) << " " << rq << " " << comm << endl; if(0==state++ && l1>0 ) // recv first part .. { if(verbosity>100) cout << mpirank << " + Do RevcWMeshd " << lsz <<" " << state << " cont : " << ( l1 > sizempibuf) << " " << rq << " " << l1 << endl; resize(lsz); int ll=WRecv(p+sizempibuf,l1, who, tag+state,comm,rq); return true;// continue .. } else resize(lsz); // we have the all buffer => DeSerialize DeSerialize(this,ppTh); if(verbosity>100) cout << " " << mpirank << " recived from " << who << " serialized " << what << ", l=" << lsz << ", tag=" << tag << " rq = " << rq << " " << *ppTh << endl; return false; // OK } ~RevcWMeshd() {} }; template class SendWMeshd : public DoOnWaitMPI_Request,Serialize { public: const Mesh ** ppTh; int state; SendWMeshd(const MPIrank *mpirank,const Mesh ** ppThh) : DoOnWaitMPI_Request(*mpirank),Serialize((**ppThh).serialize()), ppTh(ppThh),state(0) { { long long lsz; size_t kk=0; get(kk,lsz); ffassert(lsz==lg); // verif } int tag=MPI_TAG::TAG; if(verbosity>100) cout << " -- SendWMeshd " << rq << " " << comm << " " << p << " "<< lg << " "<< " p[]= " << (int) p[0] << (int) p[1] << (int) p[2] << (int) p[3] <::TAG; long l1 = lg -sizempibuf; if(verbosity>100) cout << mpirank << " Do SendWMeshd " << lg <<" " << state << " cont : " << (l1 >0) << " " << rq << " " << comm << endl; if(0==state++ && l1>0 ) // send the second part { int ll=WSend(p+sizempibuf,l1, who, tag+state,comm,rq); return true;// Fini } return false; // OK } ~SendWMeshd() {count()=0;} }; template long MPIrank::Send(Matrice_Creuse * const & a) const { if(0) { if(verbosity>100) cout << " MPI << (Matrice_Creuse *) " << a << endl; ffassert(rq==0 || rq == Syncro_block) ; // int tag = MPI_TAG* >::TAG; MatriceMorse *mA=a->A->toMatriceMorse(); int ldata[4]; ldata[0]=mA->n; ldata[1]=mA->m; ldata[2]=mA->nbcoef; ldata[3]=mA->symetrique; if(verbosity>100) cout << " ldata " << ldata[0] << " " << ldata[1] <<" " << ldata[2] << " " <lg,mA->n+1, who, tag+1,comm,rq); if(ll == MPI_SUCCESS) ll=WSend( mA->cl,mA->nbcoef, who, tag+2,comm,rq); if(ll == MPI_SUCCESS) ll=WSend( mA->a,mA->nbcoef, who, tag+3,comm,rq); delete mA; return ll; } else { SendWMatd *rwm= new SendWMatd(this,a); if( rwm->DoSR() ) delete rwm; return MPI_SUCCESS; } } template long MPIrank::Recv(Matrice_Creuse & a) const { if(0) { if(verbosity>100) cout << " MPI << (Matrice_Creuse ) " << a << endl; ffassert(rq==0 || rq == Syncro_block) ; // int tag = MPI_TAG* >::TAG; int ldata[4]; int ll=0; ll=WRecv( ldata,4, who, tag,comm,rq); MatriceMorse *mA= new MatriceMorse(ldata[0],ldata[1],ldata[2],ldata[3]); if(ll == MPI_SUCCESS) ll=WRecv( mA->lg,mA->n+1, who, tag+1,comm,rq); if(ll == MPI_SUCCESS) ll=WRecv( mA->cl,mA->nbcoef, who, tag+2,comm,rq); if(ll == MPI_SUCCESS) ll=WRecv( mA->a,mA->nbcoef, who, tag+3,comm,rq); a.A.master(mA); return ll; } else { RevcWMatd *rwm= new RevcWMatd(this,&a); if( rwm->DoSR() ) delete rwm; return MPI_SUCCESS; } } long MPIrank::Send(const Fem2D::Mesh * a) const { if(verbosity>100) cout << " MPI << (mesh *) " << a << endl; ffassert(a); SendWMeshd *rwm= new SendWMeshd(this,&a); //cout << " ... "<< endl; if( rwm->DoSR() ) delete rwm; return MPI_SUCCESS; } long MPIrank::Send (const Fem2D::Mesh3 * a) const { if(verbosity>100) cout << " MPI << (mesh3 *) " << a << endl; ffassert(a); SendWMeshd *rwm= new SendWMeshd(this,&a); if( rwm->DoSR() ) delete rwm; return MPI_SUCCESS; } /* long MPIrank::Send(Fem2D::Mesh * a) const { if(verbosity>100) cout << " MPI << (mesh *) " << a << endl; ffassert(a); Serialize buf=(*a).serialize(); buf.mpisend(*this,MPI_TAG::TAG,static_cast(this)); return MPI_SUCCESS; } long MPIrank::Send (Fem2D::Mesh3 * a) const { if(verbosity>100) cout << " MPI << (mesh3 *) " << a << endl; ffassert(a); Serialize buf=(*a).serialize(); buf.mpisend(*this,MPI_TAG::TAG,static_cast(this)); return MPI_SUCCESS; } */ // new version asyncrone ... Now 2010 ... long MPIrank::Recv(const Fem2D::Mesh *& a) const { if(verbosity>100) cout << " MPI >> (mesh *) &" << a << " " << &a << endl; RevcWMeshd *rwm= new RevcWMeshd(this,&a); if( rwm->DoSR() ) delete rwm; if((rq==0 || rq == Syncro_block)) ffassert( a ); return MPI_SUCCESS; } long MPIrank::Recv(const Fem2D::Mesh3 *& a) const { if(verbosity>100) cout << " MPI >> (mesh3 *) &" << a << " " << &a << endl; RevcWMeshd *rwm= new RevcWMeshd(this,&a); if( rwm->DoSR() ) delete rwm; if((rq==0 || rq == Syncro_block)) ffassert( a ); return MPI_SUCCESS; } void Serialize::mpisend(const MPIrank & rank,long tag,const void * vmpirank) { const MPIrank * mpirank=static_cast (vmpirank); MPI_Comm comm=mpirank->comm; MPI_Request *rq=mpirank->rq; ffassert(rq==0 || rq == Syncro_block); char * pp = p-sizeof(long); long countsave=count(); // save count count()=lg; // store length in count long l=lg+sizeof(long); if(verbosity>100) cout << " -- send from " << mpirank << " to " << rank << " serialized " << what << ", l=" << l << ", tag=" << tag << " " << (l < sizempibuf) << endl; if (l <=sizempibuf) WSend(pp,l, rank, tag,comm,rq); else { WSend(pp,sizempibuf, rank, tag,comm,rq); WSend(pp+sizempibuf,l-sizempibuf, rank, tag+1,comm,rq); } if(verbosity>100) cout << " ok send is arrived " << endl; count()=countsave; // restore count } Serialize::Serialize(const MPIrank & rank,const char * wht,long tag,const void * vmpirank) :what(wht) { const MPIrank * mpirank=static_cast (vmpirank); MPI_Comm comm=mpirank->comm; MPI_Request *rq=mpirank->rq; if(verbosity>100) cout << " -- waiting " << mpirank << " from " << rank << " serialized " << what << " tag = " << tag << endl; if(!(rq==0 || rq == Syncro_block)) { ExecError("Not async recv of complex objet! Sorry to hard to code (FH!)."); ffassert(rq==0 || rq == Syncro_block); } char * buf= new char [sizempibuf]; WRecv(buf, sizempibuf, rank, tag,comm,rq); lg = * (long *) (void *) buf; long l=lg+sizeof(long); char * pp= new char[l] ; if ( l <= sizempibuf) memcpy(pp,buf,l); else { memcpy(pp,buf,sizempibuf); WRecv(pp+sizempibuf,l-sizempibuf, rank, tag+1,comm,rq) ; } if(verbosity>100) cout << " " << mpirank << " recived from " << rank << " serialized " << what << ", l=" << l << ", tag=" << tag << endl; delete [] buf; p=pp+sizeof(long); count()=0; } template struct Op_Readmpi : public binary_function { static MPIrank f(MPIrank const & f,A * const & a) { f.Recv(*a); return f; } }; template struct Op_Recvmpi : public binary_function { static MPIrank f(MPIrank const & f,A * const & a) { ffassert(f.rq ==0 || f.rq == Syncro_block); // Block return f.Recv(*a); } }; template struct Op_IRecvmpi : public binary_function { static MPIrank f(MPIrank const & f,A * const & a) { ffassert(f.rq !=0 || f.rq != Syncro_block); // no Block return f.Recv(*a); } }; template struct Op_Writempi : public binary_function { static MPIrank f(MPIrank const & f,A const & a) { f.Send(a); return f; } }; template struct Op_Bcastmpi : public binary_function { static MPIrank f(MPIrank const & f,A * const & a) { f.Bcast(*a); return f; } }; template struct Op_ISendmpi : public binary_function { static MPIrank f(MPIrank const & f,A const & a) { ffassert(f.rq != Syncro_block); return f.Send(a); } }; template struct Op_Sendmpi : public binary_function { static MPIrank f(MPIrank const & f,A const & a) { MPIrank ff(f.who,f.comm,Syncro_block); return ff.Send(a); } }; template struct Op_All2All : public binary_function,KN_,long> { static long f( KN_ const & s, KN_ const &r) { CheckContigueKN(s); CheckContigueKN(r); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = s.N()/mpisizew; ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); return MPI_Alltoall( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; template struct Op_Allgather1 : public binary_function,long> { static long f( R* const & s, KN_ const &r) { MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; CheckContigueKN(r); MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = 1; ffassert(r.N()==mpisizew); return MPI_Allgather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; template struct Op_Allgather : public binary_function,KN_,long> { static long f( KN_ const & s, KN_ const &r) { CheckContigueKN(s); CheckContigueKN(r); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = r.N()/mpisizew; ffassert(r.N()==mpisizew*chunk && chunk == s.N()); return MPI_Allgather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; template struct Op_All2All3 : public ternary_function,KN_,fMPI_Comm,long> { static long f(Stack, KN_ const & s, KN_ const &r,fMPI_Comm const & cmm ) { CheckContigueKN(s); CheckContigueKN(r); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = s.N()/mpisizew; ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); return MPI_Alltoall( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; template struct Op_Allgather3 : public ternary_function,KN_,fMPI_Comm,long> { static long f(Stack, KN_ const & s, KN_ const &r,fMPI_Comm const & cmm) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = r.N()/mpisizew; // bug corrected by J. Morice //ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); ffassert(s.N()==chunk && r.N()==s.N()*mpisizew); return MPI_Allgather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; template struct Op_Allgather13 : public ternary_function,fMPI_Comm,long> { static long f(Stack, R* const & s, KN_ const &r,fMPI_Comm const & cmm) { CheckContigueKN(r); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = 1; // bug corrected by J. Morice //ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); ffassert( r.N()==mpisizew); return MPI_Allgather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(), comm); } }; // Add J. Morice template long Op_All2Allv( KN_ const & s, KN_ const &r, KN_ const &sendcnts, KN_ const &sdispls, KN_ const &recvcnts, KN_ const &rdispls) { CheckContigueKN(s); CheckContigueKN(r); MPI_Comm comm=MPI_COMM_WORLD; int mpirankv=MPI_UNDEFINED; MPI_Comm_rank(comm, &mpirankv); int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ ffassert( sendcnts.N() == sdispls.N() && sendcnts.N() == recvcnts.N() && sendcnts.N() == rdispls.N() && sendcnts.N() == mpisizew ); KN INTsendcnts(sendcnts.N()); KN INTsdispls(sdispls.N()); KN INTrecvcnts(recvcnts.N()); KN INTrdispls(rdispls.N()); for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = sendcnts[ii]; INTsdispls[ii] = sdispls[ii]; INTrecvcnts[ii] = recvcnts[ii]; INTrdispls[ii] = rdispls[ii]; } return MPI_Alltoallv( (void *) (R*) s, INTsendcnts, INTsdispls, MPI_TYPE::TYPE(), (void *) (R*) r, INTrecvcnts, INTrdispls, MPI_TYPE::TYPE(), comm); } template struct Op_Allgatherv : public quad_function,KN_,KN_,KN_,long> { static long f( Stack ,KN_ const & s, KN_ const &r, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); ffassert( recvcount.N() == displs.N() && recvcount.N() == mpisizew); long sum=0; for(int ii=0; ii< recvcount.N(); ii++) sum+=recvcount[ii]; ffassert( sum == r.N() ); KN INTrecvcount(recvcount.N()); KN INTdispls(displs.N()); for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Allgatherv( (void *) (R*) s, s.N(), MPI_TYPE::TYPE(), (void *) (R*) r, INTrecvcount, INTdispls,MPI_TYPE::TYPE(), comm); } }; template long Op_All2All3v(KN_ const & s, KN_ const &r,fMPI_Comm const & cmm, KN_ const &sendcnts, KN_ const &sdispls, KN_ const &recvcnts, KN_ const &rdispls ) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpirankv=MPI_UNDEFINED; MPI_Comm_rank(comm, &mpirankv); int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ ffassert( sendcnts.N() == sdispls.N() && sendcnts.N() == recvcnts.N() && sendcnts.N() == rdispls.N() && sendcnts.N() == mpisizew ); //ffassert(s.N()==sendcnts[mpirankv] && r.N()==recvbuf[mpirankv]); KN INTsendcnts(sendcnts.N()); KN INTsdispls(sdispls.N()); KN INTrecvcnts(recvcnts.N()); KN INTrdispls(rdispls.N()); for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = sendcnts[ii]; INTsdispls[ii] = sdispls[ii]; INTrecvcnts[ii] = recvcnts[ii]; INTrdispls[ii] = rdispls[ii]; } return MPI_Alltoallv( (void *) (R*) s, INTsendcnts, INTsdispls, MPI_TYPE::TYPE(), (void *) (R*) r, INTrecvcnts, INTrdispls, MPI_TYPE::TYPE(), comm); } template long Op_Allgatherv3(KN_ const & s, KN_ const &r,fMPI_Comm const & cmm, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); ffassert( recvcount.N() == displs.N() && recvcount.N() == mpisizew); long sum=0; for(int ii=0; ii< recvcount.N(); ii++) sum+=recvcount[ii]; ffassert( sum == r.N() ); KN INTrecvcount(recvcount.N()); KN INTdispls(displs.N()); for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Allgatherv( (void *) (R*) s, s.N(), MPI_TYPE::TYPE(), (void *) (R*) r, INTrecvcount, INTdispls,MPI_TYPE::TYPE(), comm); } template struct Op_Scatter1 : public ternary_function, R* ,MPIrank,long> { static long f(Stack, KN_ const & s, R* const &r, MPIrank const & root) { CheckContigueKN(s); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); int chunk = 1; // ffassert(s.N()==mpisizew*chunk); return MPI_Scatter( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(),root.who,root.comm); } }; // Fin add J. Morice template struct Op_Scatter3 : public ternary_function,KN_,MPIrank,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root) { CheckContigueKN(r); CheckContigueKN(s); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); int chunk = r.N(); // FH correct jan 2012 ... // ffassert(s.N()==mpisizew*chunk && r.N()==chunk); return MPI_Scatter( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(),root.who,root.comm); } }; // Add J. Morice template //struct Op_Scatterv3 : public penta_function< KN_, KN_, MPIrank, KN_, KN_, long> { long Op_Scatterv3( KN_ const & s, KN_ const &r, MPIrank const & root, KN_ const &sendcnts, KN_ const &displs) { CheckContigueKN(r); CheckContigueKN(s); int mpirankv=MPI_UNDEFINED; if(root.comm != MPI_COMM_NULL) MPI_Comm_rank(root.comm, &mpirankv); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); /* local */ KN INTsendcnts(mpirankv == root.who ? sendcnts.N() : 0); KN INTdispls(mpirankv == root.who ? sendcnts.N() : 0); for(int ii=0; ii< INTsendcnts.N(); ii++){ INTsendcnts[ii]= sendcnts[ii]; INTdispls[ii]= displs[ii]; } return MPI_Scatterv( (void *) (R*) s, INTsendcnts, INTdispls, MPI_TYPE::TYPE(), (void *) (R*) r, r.N(), MPI_TYPE::TYPE(),root.who,root.comm); } // fin J. Morice template inline uint64_t roll64(Z y,int r){uint64_t x=y; r %= 64; return (x< uint64_t CodeIJ(const MatriceMorse * pa) { ffassert( pa ); uint64_t code=pa->n; code ^=roll64(pa->n-pa->m,24); long nnz = pa->nbcoef,n =pa->n,kk=0 ; code ^=roll64(nnz,48); for(long k=0; k<= n;++k) code^=roll64(pa->lg[k],++kk); for(long k=0; k< nnz;++k) code^=roll64(pa->cl[k],++kk); return code; } template struct Op_ReduceMat : public quad_function*,Matrice_Creuse *,MPIrank,fMPI_Op,long> { static long f(Stack, Matrice_Creuse* const & s,Matrice_Creuse* const &r, MPIrank const & root, fMPI_Op const &op) { ffassert( r && s); MatriceCreuse * sA=s->A; MatriceCreuse * rA=r->A; ffassert( sA && rA); MatriceMorse & sM = *dynamic_cast* > (sA); MatriceMorse & rM = *dynamic_cast* > (rA); if( ! rA ) { // build a zero matric copy of sM MatriceMorse *rm=new MatriceMorse(sM.n,sM.m,sM.nbcoef,sM.symetrique,0,sM.lg,sM.cl); *rm=R(); // set the matrix to Zero .. r->A.master(rm); rA=r->A; } ffassert( &sM && &rM); int chunk = sM.nbcoef; ffassert(chunk==rM.nbcoef); uint64_t rcode = CodeIJ(&rM); uint64_t scode = ( &sM != &rM) ? CodeIJ(&sM) : rcode; return MPI_Reduce( (void *) sM.a,(void *) rM.a, chunk , MPI_TYPE::TYPE(),op,root.who,root.comm); } }; template struct Op_AllReduceMat : public quad_function*,Matrice_Creuse *,fMPI_Comm,fMPI_Op,long> { static long f(Stack, Matrice_Creuse* const & s,Matrice_Creuse* const &r, fMPI_Comm const & comm, fMPI_Op const &op) { ffassert( r && s); MatriceCreuse * sA=s->A; MatriceCreuse * rA=r->A; ffassert( &sA ); MatriceMorse & sM = *dynamic_cast* > (sA); ffassert( &sM ); if( ! rA ) { // build a zero matric copy of sM MatriceMorse *rm=new MatriceMorse(sM.n,sM.m,sM.nbcoef,sM.symetrique,0,sM.lg,sM.cl); *rm=R(); // set the matrix to Zero .. r->A.master(rm); rA=r->A; } ffassert( sA && rA); MatriceMorse & rM = *dynamic_cast* > (rA); ffassert( &sM && &rM); int chunk = sM.nbcoef; ffassert(chunk==rM.nbcoef); uint64_t rcode = CodeIJ(&rM); uint64_t scode = ( &sM != &rM) ? CodeIJ(&sM) : rcode; // verif same code ???? // size machine int mpirankw,mpisizew; MPI_Comm_rank(comm, &mpirankw); MPI_Comm_size(comm, &mpisizew); KN allcode(mpisizew); if(mpisizew>1) { int chunk = 1; // ffassert( (myrank != root.who) || (r.N()>=mpisizew*chunk) ); KN code(mpisizew); MPI_Gather( (void *) & scode , chunk, MPI_UNSIGNED_LONG_LONG, (void *) &code[0] , chunk, MPI_UNSIGNED_LONG_LONG, 0 ,comm); int ok=1; if(mpirankw==0) for(int i=1; i::TYPE(),op,comm); } }; template struct Op_Reduce : public quad_function,KN_,MPIrank,fMPI_Op,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root, fMPI_Op const &op) { CheckContigueKN(r); CheckContigueKN(s); int chunk = s.N(); ffassert(chunk==r.N()); return MPI_Reduce( (void *) (R*) s,(void *) (R*) r, chunk , MPI_TYPE::TYPE(),op,root.who,root.comm); } }; template struct Op_AllReduce : public quad_function,KN_,fMPI_Comm,fMPI_Op,long> { static long f(Stack, KN_ const & s, KN_ const &r, fMPI_Comm const & comm,fMPI_Op const &op) { CheckContigueKN(r); CheckContigueKN(s); int chunk = s.N(); ffassert(chunk==r.N()); return MPI_Allreduce( (void *) (R*) s,(void *) (R*) r, chunk , MPI_TYPE::TYPE(),op,comm); } }; template struct Op_AllReduce1 : public quad_function { static long f(Stack, R * const & s, R * const &r, fMPI_Comm const & comm,fMPI_Op const &op) { int chunk = 1; return MPI_Allreduce( (void *) (R*) s,(void *) (R*) r, 1 , MPI_TYPE::TYPE(),op,comm); } }; /* template struct Op_Reducescatter : public quad_function,KN_,fMPI_Comm,fMPI_Op,long> { static long f(Stack, KN_ const & s, KN_ const &r, fMPI_Comm const & comm,fMPI_Op const &op) { int chunk = s.N(); ffassert(chunk==r.N()); // chunk est un tableau ???? MPI_Op oop = reinterpret_cast (op); return MPI_Reduce_scatter( (void *) (R*) s,(void *) (R*) r, chunk , MPI_TYPE::TYPE(),op,comm); } };*/ template struct Op_Reduce1 : public quad_function { static long f(Stack, R* const & s, R* const &r, MPIrank const & root, fMPI_Op const &op) { int chunk = 1; return MPI_Reduce( (void *) (R*) s,(void *) (R*) r, chunk , MPI_TYPE::TYPE(),op,root.who,root.comm); } }; // Add J. Morice template struct Op_Gather1 : public ternary_function,MPIrank,long> { static long f(Stack, R* const & s, KN_ const &r, MPIrank const & root) { int mpisizew,myrank; MPI_Comm_size(root.comm, &mpisizew); MPI_Comm_rank( root.comm, &myrank) ; int chunk = 1; // ffassert( (myrank != root.who) || (r.N()>=mpisizew*chunk) ); return MPI_Gather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(),root.who,root.comm); } }; // Fin Add J. Morice template struct Op_Gather3 : public ternary_function,KN_,MPIrank,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root) { CheckContigueKN(r); CheckContigueKN(s); int mpisizew,myrank; MPI_Comm_size(root.comm, &mpisizew); MPI_Comm_rank(root.comm, &myrank) ; int chunk = s.N(); // cout << myrank << " " << root.who << " " << r.N() << " "<< s.N() << " " << chunk << " " << mpisizew << endl; //ffassert( (myrank != root.who) || (r.N()==mpisizew*chunk) ); return MPI_Gather( (void *) (R*) s, chunk, MPI_TYPE::TYPE(), (void *) (R*) r, chunk, MPI_TYPE::TYPE(),root.who,root.comm); } }; // Add by J. Morice template //struct Op_Gatherv3 : public penta_function,KN_, MPIrank, KN_, KN_, long> { long Op_Gatherv3(KN_ const & s, KN_ const &r, MPIrank const & root, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); int mpirankw; MPI_Comm_rank(root.comm, &mpirankw); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); KN INTrecvcount(mpirankw == root.who ? recvcount.N() : 0); KN INTdispls(mpirankw == root.who ? recvcount.N() : 0); for(int ii=0; ii< INTrecvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Gatherv( (void *) (R*) s, s.N(), MPI_TYPE::TYPE(), (void *) (R*) r, INTrecvcount, INTdispls,MPI_TYPE::TYPE(),root.who,root.comm); } // Fin Add J. Morice // Add J. Morice communications entre processeurs complex template<> struct Op_All2All : public binary_function,KN_,long> { static long f( KN_ const & s, KN_ const &r) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = s.N()/mpisizew; ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Alltoall( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Alltoall( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE, comm); #endif } }; template<> struct Op_Allgather1 : public binary_function,long> { static long f( Complex * const & s, KN_ const &r) { CheckContigueKN(r); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = 1; ffassert( r.N()== mpisizew); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Allgather( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Allgather( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE, comm); #endif } }; template<> struct Op_Allgather : public binary_function,KN_,long> { static long f( KN_ const & s, KN_ const &r) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = r.N()/mpisizew; ffassert( r.N()==chunk*mpisizew && chunk==s.N() ); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Allgather( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Allgather( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE, comm); #endif } }; template<> struct Op_All2All3 : public ternary_function,KN_,fMPI_Comm,long> { static long f(Stack, KN_ const & s, KN_ const &r,fMPI_Comm const & cmm ) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = s.N()/mpisizew; ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Alltoall( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Alltoall( (void *) (Complex*) s, chunk, MPI_DOUBLE, (void *) (Complex*) (r), chunk, MPI_DOUBLE, comm); #endif } }; template<> struct Op_Allgather3 : public ternary_function,KN_,fMPI_Comm,long> { static long f(Stack, KN_ const & s, KN_ const &r,fMPI_Comm const & cmm) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = r.N()/mpisizew; // bug corrected by J. Morice //ffassert(s.N()==mpisizew*chunk && r.N()==s.N()); ffassert(s.N()==chunk && r.N()==s.N()*mpisizew); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Allgather( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Allgather( (void *) (Complex*) (s), chunk, MPI_DOUBLE, (void *) (Complex*) (r), chunk, MPI_DOUBLE, comm); #endif } }; template<> struct Op_Allgather13 : public ternary_function,fMPI_Comm,long> { static long f(Stack, Complex * const & s, KN_ const &r,fMPI_Comm const & cmm) { CheckContigueKN(r); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ int chunk = 1; ffassert( r.N()==mpisizew); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Allgather( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, comm); #else chunk*=2; return MPI_Allgather((void *) (Complex*)(s), chunk, MPI_DOUBLE, (void *) (Complex*) (r), chunk, MPI_DOUBLE, comm); #endif } }; template<> long Op_All2Allv( KN_ const & s, KN_ const &r, KN_ const &sendcnts, KN_ const &sdispls, KN_ const &recvcnts, KN_ const &rdispls) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=MPI_COMM_WORLD; int mpirankv=MPI_UNDEFINED; MPI_Comm_rank(comm, &mpirankv); int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ ffassert( sendcnts.N() == sdispls.N() && sendcnts.N() == recvcnts.N() && sendcnts.N() == rdispls.N() && sendcnts.N() == mpisizew ); KN INTsendcnts(sendcnts.N()); KN INTsdispls(sdispls.N()); KN INTrecvcnts(recvcnts.N()); KN INTrdispls(rdispls.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = sendcnts[ii]; INTsdispls[ii] = sdispls[ii]; INTrecvcnts[ii] = recvcnts[ii]; INTrdispls[ii] = rdispls[ii]; } return MPI_Alltoallv( (void *) (Complex*) s, INTsendcnts, INTsdispls, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, INTrecvcnts, INTrdispls, MPI_DOUBLE_COMPLEX, comm); #else for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = 2*sendcnts[ii]; INTsdispls[ii] = 2*sdispls[ii]; INTrecvcnts[ii] = 2*recvcnts[ii]; INTrdispls[ii] = 2*rdispls[ii]; } return MPI_Alltoallv( reinterpret_cast ( (Complex*) s), INTsendcnts, INTsdispls, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), INTrecvcnts, INTrdispls, MPI_DOUBLE, comm); #endif } template<> struct Op_Allgatherv : public quad_function,KN_,KN_,KN_,long> { static long f( Stack ,KN_ const & s, KN_ const &r, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=MPI_COMM_WORLD; int mpisizew; MPI_Comm_size(comm, &mpisizew); ffassert( recvcount.N() == displs.N() && recvcount.N() == mpisizew); long sum=0; for(int ii=0; ii< recvcount.N(); ii++) sum+=recvcount[ii]; ffassert( sum == r.N() ); KN INTrecvcount(recvcount.N()); KN INTdispls(displs.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Allgatherv( (void *) (Complex*)s, s.N(), MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, INTrecvcount, INTdispls,MPI_DOUBLE_COMPLEX, comm); #else for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= 2*recvcount[ii]; INTdispls[ii]= 2*displs[ii]; } return MPI_Allgatherv( reinterpret_cast ( (Complex*) s), 2*s.N(), MPI_DOUBLE, reinterpret_cast ( (Complex*) r), INTrecvcount, INTdispls,MPI_DOUBLE, comm); #endif } }; template<> long Op_All2All3v(KN_ const & s, KN_ const &r,fMPI_Comm const & cmm, KN_ const &sendcnts, KN_ const &sdispls, KN_ const &recvcnts, KN_ const &rdispls ) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpirankv=MPI_UNDEFINED; MPI_Comm_rank(comm, &mpirankv); int mpisizew; MPI_Comm_size(comm, &mpisizew); /* local */ ffassert( sendcnts.N() == sdispls.N() && sendcnts.N() == recvcnts.N() && sendcnts.N() == rdispls.N() && sendcnts.N() == mpisizew ); //ffassert(s.N()==sendcnts[mpirankv] && r.N()==recvbuf[mpirankv]); KN INTsendcnts(sendcnts.N()); KN INTsdispls(sdispls.N()); KN INTrecvcnts(recvcnts.N()); KN INTrdispls(rdispls.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = sendcnts[ii]; INTsdispls[ii] = sdispls[ii]; INTrecvcnts[ii] = recvcnts[ii]; INTrdispls[ii] = rdispls[ii]; } return MPI_Alltoallv( (void *) (Complex*)s, INTsendcnts, INTsdispls, MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, INTrecvcnts, INTrdispls, MPI_DOUBLE_COMPLEX, comm); #else for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii] = 2*sendcnts[ii]; INTsdispls[ii] = 2*sdispls[ii]; INTrecvcnts[ii] = 2*recvcnts[ii]; INTrdispls[ii] = 2*rdispls[ii]; } return MPI_Alltoallv( reinterpret_cast ( (Complex*) s), INTsendcnts, INTsdispls, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), INTrecvcnts, INTrdispls, MPI_DOUBLE, comm); #endif } template<> long Op_Allgatherv3(KN_ const & s, KN_ const &r,fMPI_Comm const & cmm, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); MPI_Comm comm=cmm; int mpisizew; MPI_Comm_size(comm, &mpisizew); ffassert( recvcount.N() == displs.N() && recvcount.N() == mpisizew); long sum=0; for(int ii=0; ii< recvcount.N(); ii++) sum+=recvcount[ii]; ffassert( sum == r.N() ); KN INTrecvcount(recvcount.N()); KN INTdispls(displs.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Allgatherv( (void *) (Complex*)s, s.N(), MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, INTrecvcount, INTdispls,MPI_DOUBLE_COMPLEX, comm); #else for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= 2*recvcount[ii]; INTdispls[ii]= 2*displs[ii]; } return MPI_Allgatherv( reinterpret_cast ( (Complex*) s), 2*s.N(), MPI_DOUBLE, reinterpret_cast ( (Complex*) r), INTrecvcount, INTdispls,MPI_DOUBLE, comm); #endif } template<> struct Op_Scatter1 : public ternary_function,Complex *,MPIrank,long> { static long f(Stack, KN_ const & s, Complex * const &r, MPIrank const & root) { CheckContigueKN(s); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); int chunk = 1; // ffassert(s.N()==mpisizew*chunk ); fait dans mpi #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Scatter( (void *) (Complex*)s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, chunk, MPI_DOUBLE_COMPLEX,root.who,root.comm); #else chunk*=2; return MPI_Scatter( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE,root.who,root.comm); #endif } }; template<> struct Op_Scatter3 : public ternary_function,KN_,MPIrank,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root) { CheckContigueKN(r); CheckContigueKN(s); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); int chunk = r.N();// correct 2012 FH // ffassert(s.N()==mpisizew*chunk && r.N()==chunk); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Scatter( (void *) (Complex*)s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, chunk, MPI_DOUBLE_COMPLEX,root.who,root.comm); #else chunk*=2; return MPI_Scatter( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE,root.who,root.comm); #endif } }; template<> long Op_Scatterv3( KN_ const & s, KN_ const &r, MPIrank const & root, KN_ const &sendcnts, KN_ const &displs) { CheckContigueKN(r); CheckContigueKN(s); int mpirankv=MPI_UNDEFINED; if(root.comm != MPI_COMM_NULL) MPI_Comm_rank(root.comm, &mpirankv); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); /* local */ // ffassert( sendcnts.N() == displs.N() && sendcnts.N() == mpisizew ); // size control // ffassert( r.N() == sendcnts[mpirankv] ); long sumsize=0; for(int ii=0; ii INTsendcnts(sendcnts.N()); KN INTdispls(displs.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii]= sendcnts[ii]; INTdispls[ii]= displs[ii]; } return MPI_Scatterv( (void *) (Complex*)s, INTsendcnts, INTdispls, MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, r.N(), MPI_DOUBLE_COMPLEX,root.who,root.comm); #else for(int ii=0; ii< sendcnts.N(); ii++){ INTsendcnts[ii]= 2*sendcnts[ii]; INTdispls[ii]= 2*displs[ii]; } return MPI_Scatterv( reinterpret_cast ( (Complex*) s), INTsendcnts, INTdispls, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), 2*r.N(), MPI_DOUBLE,root.who,root.comm); #endif } template<> struct Op_Reduce : public quad_function,KN_,MPIrank,fMPI_Op,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root, fMPI_Op const &op) { CheckContigueKN(r); CheckContigueKN(s); int chunk = s.N(); ffassert(chunk==r.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Reduce( (void *) (Complex*)s,(void *) (Complex*)r, chunk , MPI_DOUBLE_COMPLEX,op,root.who,root.comm); #else chunk*=2; return MPI_Reduce( reinterpret_cast ( (Complex*) s), reinterpret_cast ( (Complex*) r), chunk , MPI_DOUBLE,op,root.who,root.comm); #endif } }; template<> struct Op_AllReduce : public quad_function,KN_,fMPI_Comm,fMPI_Op,long> { static long f(Stack, KN_ const & s, KN_ const &r, fMPI_Comm const & comm,fMPI_Op const &op) { CheckContigueKN(r); CheckContigueKN(s); int chunk = s.N(); ffassert(chunk==r.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Allreduce( (void *) (Complex*)s,(void *) (Complex*)r, chunk , MPI_DOUBLE_COMPLEX,op,comm); #else chunk *=2; return MPI_Allreduce( reinterpret_cast ( (Complex*) s), reinterpret_cast ( (Complex*) r), chunk , MPI_DOUBLE,op,comm); #endif } }; // /* // template<> // struct Op_Reducescatter : public quad_function,KN_,fMPI_Comm,fMPI_Op,long> { // static long f(Stack, KN_ const & s, KN_ const &r, fMPI_Comm const & comm,fMPI_Op const &op) // { // int chunk = s.N(); // ffassert(chunk==r.N()); // // chunk est un tableau ???? // MPI_Op oop = reinterpret_cast (op); // return MPI_Reduce_scatter( (void *) (Complex*)s,(void *) (Complex*)r, chunk , MPI_DOUBLE_COMPLEX,op,comm); // } // };*/ template<> struct Op_Reduce1 : public quad_function { static long f(Stack, Complex* const & s, Complex* const &r, MPIrank const & root, fMPI_Op const &op) { #ifdef HAVE_MPI_DOUBLE_COMPLEX int chunk = 1; return MPI_Reduce( (void *) s, (void *) r, chunk , MPI_DOUBLE_COMPLEX,op,root.who,root.comm); #else int chunk = 2; return MPI_Reduce( reinterpret_cast ( (Complex*) s), reinterpret_cast ( (Complex*) r), chunk , MPI_DOUBLE,op,root.who,root.comm); #endif } }; // Add J. Morice template<> struct Op_Gather1 : public ternary_function,MPIrank,long> { static long f(Stack, Complex * const & s, KN_ const &r, MPIrank const & root) { CheckContigueKN(r); int mpisizew,myrank; MPI_Comm_size(root.comm, &mpisizew); MPI_Comm_rank( root.comm, &myrank) ; int chunk = 1; // ffassert( (myrank != root.who) || (r.N()>=mpisizew*chunk) ); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Gather( (void *) (Complex*) s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*) r, chunk, MPI_DOUBLE_COMPLEX, root.who, root.comm); #else chunk = 2; return MPI_Gather( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE, root.who, root.comm); #endif } }; // Fin Add J. Morice template<> struct Op_Gather3 : public ternary_function,KN_,MPIrank,long> { static long f(Stack, KN_ const & s, KN_ const &r, MPIrank const & root) { CheckContigueKN(r); CheckContigueKN(s); int mpisizew,myrank; MPI_Comm_size(root.comm, &mpisizew); MPI_Comm_rank( root.comm, &myrank) ; int chunk = s.N(); // ffassert( (myrank != root.who) || (r.N()>=mpisizew*chunk) ); #ifdef HAVE_MPI_DOUBLE_COMPLEX return MPI_Gather( (void *) (Complex*)s, chunk, MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, chunk, MPI_DOUBLE_COMPLEX,root.who,root.comm); #else chunk *= 2; return MPI_Gather( reinterpret_cast ( (Complex*) s), chunk, MPI_DOUBLE, reinterpret_cast ( (Complex*) r), chunk, MPI_DOUBLE,root.who,root.comm); #endif } }; template<> //struct Op_Gatherv3 : public penta_function,KN_, MPIrank, KN_, KN_, long> { long Op_Gatherv3(KN_ const & s, KN_ const &r, MPIrank const & root, KN_ const & recvcount, KN_ const & displs) { CheckContigueKN(r); CheckContigueKN(s); int mpirankw; MPI_Comm_rank(root.comm, &mpirankw); int mpisizew; MPI_Comm_size(root.comm, &mpisizew); //ffassert((mpirankw != root.who) || ( recvcount.N() == displs.N() && recvcount.N() == mpisizew)); if( mpirankw == root.who){ long sum=0; for(int ii=0; ii< recvcount.N(); ii++) sum+=recvcount[ii]; ffassert( sum == r.N() ); } KN INTrecvcount(recvcount.N()); KN INTdispls(displs.N()); #ifdef HAVE_MPI_DOUBLE_COMPLEX for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= recvcount[ii]; INTdispls[ii]= displs[ii]; } return MPI_Gatherv( (void *) (Complex*)s, s.N(), MPI_DOUBLE_COMPLEX, (void *) (Complex*)r, INTrecvcount, INTdispls,MPI_DOUBLE_COMPLEX,root.who,root.comm); #else for(int ii=0; ii< recvcount.N(); ii++){ INTrecvcount[ii]= 2*recvcount[ii]; INTdispls[ii]= 2*displs[ii]; } return MPI_Gatherv( reinterpret_cast ( (Complex*) s), 2*s.N(), MPI_DOUBLE, reinterpret_cast ( (Complex*) r), INTrecvcount, INTdispls,MPI_DOUBLE,root.who,root.comm); #endif } // Fin Add J. Morice communication entre complexe MPIrank mpiwho(long i) { return MPIrank(i);} MPIrank mpiwho(long i,fMPI_Comm comm) { return MPIrank(i,comm,Syncro_block);} MPIrank mpiwho(fMPI_Comm comm,long i) { return MPIrank(i,comm,Syncro_block);} MPIrank mpiwhob(long i) { return MPIrank(i);} MPIrank mpiwhob(long i,fMPI_Comm comm) { return MPIrank(i,comm,Syncro_block);} MPIrank mpiwho_(const long &i,const fMPI_Comm &comm,fMPI_Request * const &rq) { return MPIrank(i,comm,*rq);} MPIrank mpiwho_(const long &i,fMPI_Request * const &rq) { return MPIrank(i, MPI_COMM_WORLD ,*rq);} long mpiWait(fMPI_Request * frq) { MPI_Request * rq= *frq; MPI_Status status; long res=MPI_SUCCESS; while(rq && *rq!=MPI_REQUEST_NULL) { res = MPI_Wait(rq,&status); DoOnWaitMPIRequest(rq); } return res; } long mpiBarrier(fMPI_Comm * comm) { return MPI_Barrier(*comm); } long mpiWaitAny(KN* rq) { MPI_Status status; int index; //cout << "mpiWaitAny " <N() << " in " << endl ; do { MPI_Waitany(rq->N(),*rq,&index,&status); DoOnWaitMPIRequest(&(*rq)[index]); } while( (MPI_UNDEFINED!= index) && ((*rq)[index]!=MPI_REQUEST_NULL)); //cout << "mpiWaitAny " <N() << " out " << index << endl ; return index; } MPIrank * set_copympi( MPIrank* const & a,const MPIrank & b){ *a=b;return a;} long mpiSize(fMPI_Comm cmm) { int s=0; // fMPI_Comm_rank(MPI_COMM_WORLD, &s); /* local */ if(cmm != (MPI_Comm) MPI_COMM_NULL) MPI_Comm_size(cmm, &s); /* local */ return s; } long mpiRank(fMPI_Comm cmm) { int s=MPI_UNDEFINED; if(cmm != (MPI_Comm)MPI_COMM_NULL) MPI_Comm_rank(cmm, &s); /* local */ // MPI_Comm_size(MPI_COMM_WORLD, &s); /* local */ return s; } AnyType InitializeGroup(Stack stack,const AnyType &x){ MPI_Group *g=*PGetAny(x); *g=MPI_GROUP_NULL; MPI_Comm_group(MPI_COMM_WORLD, g); return g; } AnyType DeleteGroup(Stack stack,const AnyType &x){ MPI_Group *g=*PGetAny(x); if(g && (*g != MPI_GROUP_NULL))MPI_Group_free(g); return Nothing; } AnyType InitializeComm(Stack stack,const AnyType &x){ MPI_Comm *comm= *PGetAny(x); *comm=MPI_COMM_NULL; MPI_Comm_dup(MPI_COMM_WORLD, comm); return comm; } AnyType DeleteComm(Stack stack,const AnyType &x){ MPI_Comm *comm= *PGetAny(x); if(comm && (*comm != MPI_COMM_NULL && *comm != MPI_COMM_WORLD))// add MPI_COMM_WORLD FH 11/2010 FH MPI_Comm_free(comm); return Nothing; } AnyType InitializeRequest(Stack stack,const AnyType &x){ MPI_Request *comm=*PGetAny(x); *comm=MPI_REQUEST_NULL; return comm; } AnyType DeleteRequest(Stack stack,const AnyType &x){ MPI_Request *comm=*PGetAny(x); if(comm && ( *comm!=MPI_REQUEST_NULL )) MPI_Request_free(comm); return Nothing; } // Hack to Bypass a bug in freefem FH ... template<> class ForEachType: public basicForEachType{public:// correction july 2009..... FH Hoooo.... (Il y a un bug DUR DUR FH ...) ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(MPI_Group),sizeof(MPI_Group),0,0,iv,id,OOnReturn) { } }; template<> class ForEachType: public basicForEachType{public:// coorection july 2009..... FH Hoooo.... (Il y a un bug DUR DUR FH ...) ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(fMPI_Comm),sizeof(fMPI_Comm),0,0,iv,id,OOnReturn) {} }; template<> class ForEachType: public basicForEachType{public:// correction july 2009..... FH Hoooo.... (Il y a un bug DUR DUR FH ...) ForEachType(Function1 iv=0,Function1 id=0,Function1 OOnReturn=0):basicForEachType(typeid(fMPI_Request),sizeof(fMPI_Request),0,0,iv,id,OOnReturn) {} }; // end Hack ... fMPI_Group* def_group( fMPI_Group* const & a,fMPI_Comm * const &comm, KN_ const & b) { MPI_Group group; MPI_Comm_group(*comm,& group); KN ranks(b); MPI_Group_incl(group, ranks.N(),(int *) ranks, *a); MPI_Group_free(&group) ; // ici def a .. // ffassert(0); // A AFAIRE // pour arete le programm return a;} fMPI_Group* def_group( fMPI_Group* const & a, KN_ const & b) { MPI_Group group; MPI_Comm comm=MPI_COMM_WORLD; MPI_Comm_group(comm,& group); KN ranks(b); MPI_Group_incl(group, ranks.N(),(int *) ranks, *a); MPI_Group_free(&group) ; // ici def a .. // ffassert(0); // A AFAIRE // pour arete le programm return a;} fMPI_Group* def_group( fMPI_Group* const & a,fMPI_Comm * const &comm) { MPI_Comm_group(*comm,*a); return a;} fMPI_Comm* def_comm( fMPI_Comm* const & a,fMPI_Group* const & g) { int ok=MPI_Comm_create(MPI_COMM_WORLD,*g,*a); return a; } fMPI_Comm* def_comm( fMPI_Comm* const & a,fMPI_Comm* const & b,fMPI_Group* const & g) { MPI_Comm_create(*b,*g,*a); return a; } fMPI_Group* def_group( fMPI_Group* const & a,fMPI_Group * const & group,KN_ const & b) { KN ranks(b); MPI_Group_incl(*group, ranks.N(), (int *) ranks, *a); // ici def a .. // ffassert(0); // A AFAIRE // pour arete le programm return a; } struct Def_def_Commsplit : public quad_function { static fMPI_Comm * f(Stack,fMPI_Comm* const & a,fMPI_Comm* const & comm,const long &color ,const long &key ) { MPI_Comm_split(*comm,color, key, *a); return a; } }; fMPI_Comm * mpiCommsplit(fMPI_Comm* const & a,const MPIrank &p1,const long &key ) { MPI_Comm_split(p1.comm, p1.who, key, *a); return a; } struct Def_def_Intercommcreate : public quad_function { static fMPI_Comm * f(Stack,fMPI_Comm* const & a, MPIrank const & p1, MPIrank const & p2, long const & tag ) { int err; err=MPI_Intercomm_create(p1.comm, p1.who, p2.comm,p2.who,tag, *a); return a; } }; fMPI_Comm * def_intercommmerge(fMPI_Comm* const & a,fMPI_Comm* const & b, const long & high) { MPI_Intercomm_merge(*b, high, *a); return a; } template AnyType ClearReturnpKK(Stack stack, const AnyType & a) { // a ne faire que pour les variables local au return... // pour l'instant on copie pour fqire mqrche // a repense FH mqi 2009.... KK * m = GetAny(a); // KN *cm=new KN(true, *m); bug quant KN est une variable global // KN *cm=new KN( *m); // on duplique le tableau comme en C++ (dur dur ?????? FH) m->increment(); Add2StackOfPtr2FreeRC(stack,m); if(verbosity>400) cout << "ClearReturnpKK:: increment + Add2StackOfPtr2FreeRC nb ref " << -m->next << endl; return m; } template AnyType ClearReturnpKK_(Stack stack, const AnyType & a) { // il faut faire un copie du tableau KK_ * m = GetAny(a); KK *cm=new KK(*m); Add2StackOfPtr2Free(stack,cm);// detruire la copie if(verbosity>400) cout << "ClearReturnpKK_:: copie Add2StackOfPtr2Free " << endl; return (KK_ *) cm; } template AnyType ClearReturnKK_(Stack stack, const AnyType & a) { // il faut faire un copie du tableau KK_ m = GetAny(a); KK *cm=new KK(m); Add2StackOfPtr2Free(stack,cm);// detruire la copie if(verbosity>400) cout << "ClearReturnKK_:: copie Add2StackOfPtr2Free " << endl; return SetAny(*cm); } //template fMPI_Request*,KN*,long fMPI_Request * get_elementp_( KN * const & a,const long & b){ if( a==0 || b<0 || a->N() <= b) { if(a) cerr << " Out of bound 0 <=" << b << " < " << a->N() << " KN * " << endl; ExecError("Out of bound in operator []");} return reinterpret_cast (&((*a)[b]));}// bofBof ... KN * set_init0( KN * const & a,const long & b) { a->init(b); for(int i=0;i class Quad_Op : public E_F0 { typedef typename T::result_type R; typedef typename T::first_argument_type A; typedef typename T::second_argument_type B; typedef typename T::third_argument_type C; typedef typename T::fourth_argument_type D; typedef typename T::result_type Result; Expression a,b,c,d; public: AnyType operator()(Stack s) const {return SetAny(static_cast(T::f(s, GetAny((*a)(s)) , GetAny((*b)(s)) , GetAny((*c)(s)), GetAny((*d)(s)) )));} Quad_Op(Expression aa,Expression bb,Expression cc,Expression dd) : a(aa),b(bb),c(cc),d(dd) {} bool MeshIndependent() const { return a->MeshIndependent() && b->MeshIndependent() && c->MeshIndependent() && d->MeshIndependent();} }; // Fin add J. Morice void f_end_parallele() { /// FFCS: MPI_Finalize() needs to be called later than this (in /// ffcs/src/server.cpp) ffapi::mpi_finalize(); if(verbosity> 2 || (verbosity>1&&mpirank ==0)) cout << "FreeFem++-mpi finalize correctly .\n" << flush ; else if(verbosity>5) cout << '.' << endl ; } void f_initparallele(int &argc, char **& argv) { /// FFCS: MPI_Init() needs to be called earlier (in ffcs/src/server.cpp) ffapi::mpi_init(argc,argv); int mpirank1,mpisize1; MPI_Comm_rank(MPI_COMM_WORLD, &mpirank1); /* local */ MPI_Comm_size(MPI_COMM_WORLD, &mpisize1); /* local */ mpirank = mpirank1;//MPI::COMM_WORLD.Get_rank(); mpisize =mpisize1;// MPI::COMM_WORLD.Get_size(); if(verbosity> 2 || (verbosity>1&&mpirank ==0)) cout << "initparallele rank " << mpirank << " on " << mpisize << endl; ff_atend(f_end_parallele); // set end MPI // } double ffMPI_Wtime() {return MPI_Wtime();} double ffMPI_Wtick() {return MPI_Wtick();} class splitComm_Op : public E_F0mps { public: Expression comm; Expression p; Expression splitComm; static const int n_name_param = 2; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; splitComm_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : comm(param1), p(param2), splitComm(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; basicAC_F0::name_and_type splitComm_Op::name_param[] = { {"topology", &typeid(long)}, {"exclude", &typeid(bool)} }; class splitComm : public OneOperator { public: splitComm() : OneOperator(atype(), atype(), atype(), atype()) {} E_F0* code(const basicAC_F0& args) const { return new splitComm_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; static inline bool splitCommunicator(const MPI_Comm& in, MPI_Comm& out, const bool& exclude, unsigned short& p, const unsigned short& T) { int size, rank; MPI_Comm_size(in, &size); MPI_Comm_rank(in, &rank); if(p > size / 2 && size > 1) { p = size / 2; if(rank == 0) std::cout << "WARNING -- the number of master processes was set to a value greater than MPI_Comm_size, the value has been reset to " << p << std::endl; } p = std::max(p, static_cast(1)); if(exclude) { MPI_Group oldGroup, newGroup; MPI_Comm_group(in, &oldGroup); int* pm = new int[p]; if(T == 1) for(int i=0;i(size - std::sqrt(std::max(size * size - 2 * size * pm[i - 1] - 2 * area + pm[i - 1] * pm[i - 1], 1.0f)) + 0.5); } else for(unsigned short i = 0; i < p; ++i) pm[i] = i * (size / p); bool excluded = std::binary_search(pm, pm + p, rank); if(excluded) MPI_Group_incl(oldGroup, p, pm, &newGroup); else MPI_Group_excl(oldGroup, p, pm, &newGroup); MPI_Comm_create(in, newGroup, &out); MPI_Group_free(&oldGroup); MPI_Group_free(&newGroup); delete [] pm; return excluded; } else { MPI_Comm_dup(in, &out); return false; } } AnyType splitComm_Op::operator()(Stack stack) const { bool exclude = nargs[1] ? GetAny((*nargs[1])(stack)) : false; MPI_Comm* orig_comm = (MPI_Comm*)GetAny((*comm)(stack)); MPI_Comm* new_comm = (MPI_Comm*)GetAny((*splitComm)(stack)); long* pp = GetAny((*p)(stack)); unsigned short p = *pp; long topology = nargs[0] ? GetAny((*nargs[0])(stack)) : 0; bool excluded = splitCommunicator(*orig_comm, *new_comm, exclude, p, topology); *pp = p; return static_cast(excluded); } void f_init_lgparallele() { if(verbosity && mpirank == 0) cout << "parallelempi "; using namespace Fem2D; Dcl_TypeandPtr(0); Dcl_TypeandPtr(0,0,InitializeGroup,DeleteGroup); Dcl_TypeandPtr(0,0,InitializeComm,DeleteComm); Dcl_Type(); Dcl_TypeandPtr(0,0,InitializeRequest,DeleteRequest); // bof bof ... Dcl_TypeandPtr_ ,KN* > (0,0,0,::Destroy >, ::ClearReturnKK_,KN_ >, ::ClearReturnpKK >); zzzfff->Add("mpiGroup",atype()); zzzfff->Add("mpiComm",atype()); zzzfff->Add("mpiRequest",atype()); map_type_of_map[make_pair(atype(),atype())]=atype*>(); // vector map_type[typeid(MPIrank).name()]->AddCast(new E_F1_funcT(UnRef)); map_type[typeid(fMPI_Group).name()]->AddCast(new E_F1_funcT(UnRef)); map_type[typeid(fMPI_Comm).name()]->AddCast(new E_F1_funcT(UnRef)); map_type[typeid(bool).name()]->AddCast(new OneOperator1(toBool)); map_type[typeid(void*).name()]->AddCast(new OneOperator1(topVoid)); TheOperators->Add("<-", new OneOperator2_(&set_copympi)); // constructor example ... TheOperators->Add("<-", new OneOperator2_ >(&def_group), new OneOperator3_ >(&def_group), new OneOperator3_ >(&def_group), new OneOperator2_(&def_group)); /* fMPI_Comm * mpiCommsplit(fMPI_Comm* const & a,const MPIrank &p1,const long &rk ) fMPI_Comm * def_intercommmerge(fMPI_Comm* const & a,fMPI_Comm* const & b, const long & high) fMPI_Comm * def_Intercommcreate(fMPI_Comm* const & a, MPIrank const & p1, MPIrank const & p2, long const & tag ) quad_function */ TheOperators->Add("<-", new OneOperator2_(&def_comm), new OneOperator3_(&def_comm), new OneOperator3_(&mpiCommsplit), new OneOperator3_(&def_intercommmerge), new OneQuadOperator< Def_def_Intercommcreate, Quad_Op >, new OneQuadOperator< Def_def_Commsplit, Quad_Op > ); /* code edp int[int] procs=[1,2,3]; mpiGroup toto(procs); mpiComm comm(toto); */ Global.Add("processor","(",new OneOperator1(mpiwho)); Global.Add("processor","(",new OneOperator2(mpiwho)); Global.Add("processor","(",new OneOperator2(mpiwho)); Global.Add("processorblock","(",new OneOperator1(mpiwhob)); Global.Add("processorblock","(",new OneOperator2(mpiwhob)); TheOperators->Add(">>", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > , new OneBinaryOperator > > , new OneBinaryOperator > > , new OneBinaryOperator > > , new OneBinaryOperator > , new OneBinaryOperator > , new OneBinaryOperator > > , new OneBinaryOperator > > ); TheOperators->Add(">>", new OneBinaryOperator > > , new OneBinaryOperator > > , new OneBinaryOperator > > ); TheOperators->Add("<<", new OneBinaryOperator >, new OneBinaryOperator >, new OneBinaryOperator > , new OneBinaryOperator * > > , new OneBinaryOperator * > > , new OneBinaryOperator * > > , new OneBinaryOperator > , new OneBinaryOperator > , new OneBinaryOperator * > > , new OneBinaryOperator* > > ); TheOperators->Add("<<", new OneBinaryOperator * > > , new OneBinaryOperator * > > , new OneBinaryOperator * > > ); Global.Add("Send","(", new OneBinaryOperator >); Global.Add("Send","(", new OneBinaryOperator >); Global.Add("Send","(", new OneBinaryOperator >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator >); Global.Add("Send","(", new OneBinaryOperator >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Send","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator >); Global.Add("Isend","(", new OneBinaryOperator >); Global.Add("Isend","(", new OneBinaryOperator >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator >); Global.Add("Isend","(", new OneBinaryOperator >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Isend","(", new OneBinaryOperator *> >); Global.Add("Recv","(", new OneBinaryOperator >); Global.Add("Recv","(", new OneBinaryOperator >); Global.Add("Recv","(", new OneBinaryOperator >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator >); Global.Add("Recv","(", new OneBinaryOperator >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Recv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator >); Global.Add("Irecv","(", new OneBinaryOperator >); Global.Add("Irecv","(", new OneBinaryOperator >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator >); Global.Add("Irecv","(", new OneBinaryOperator >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("Irecv","(", new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator >); Global.Add("broadcast","(",new OneBinaryOperator >); Global.Add("broadcast","(",new OneBinaryOperator >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator >); Global.Add("broadcast","(",new OneBinaryOperator >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("broadcast","(",new OneBinaryOperator > >); Global.Add("mpiAlltoall","(",new OneBinaryOperator >); Global.Add("mpiAlltoall","(",new OneBinaryOperator >); Global.Add("mpiAllgather","(",new OneBinaryOperator >); Global.Add("mpiAllgather","(",new OneBinaryOperator >); Global.Add("mpiAlltoall","(",new OneTernaryOperator3 >); Global.Add("mpiAlltoall","(",new OneTernaryOperator3 >); Global.Add("mpiAllgather","(",new OneTernaryOperator3 >); Global.Add("mpiAllgather","(",new OneTernaryOperator3 >); Global.Add("mpiAllgather","(",new OneBinaryOperator >); // Add J. Morice Global.Add("mpiAllgather","(",new OneBinaryOperator >); // Add J. Morice Global.Add("mpiAllgather","(",new OneTernaryOperator3 >); // Add J. Morice Global.Add("mpiAllgather","(",new OneTernaryOperator3 >);// Add J. Morice Global.Add("mpiScatter","(",new OneTernaryOperator3 >); // Add J. Morice Global.Add("mpiScatter","(",new OneTernaryOperator3 >); // Add J. Morice Global.Add("mpiScatter","(",new OneTernaryOperator3 >); Global.Add("mpiScatter","(",new OneTernaryOperator3 >); Global.Add("mpiGather","(",new OneTernaryOperator3 >); // Add J. Morice Global.Add("mpiGather","(",new OneTernaryOperator3 >); // Add J. Morice Global.Add("mpiGather","(",new OneTernaryOperator3 >); // correction J. Morice Scatter --> Gather Global.Add("mpiGather","(",new OneTernaryOperator3 >); // Add J. Morice communication with vector of different size Global.Add("mpiAlltoallv","(",new OneOperator6_, KN_, KN_, KN_, KN_, KN_ >( Op_All2Allv ) ); Global.Add("mpiAlltoallv","(",new OneOperator6_, KN_, KN_, KN_, KN_, KN_ >( Op_All2Allv ) ); Global.Add("mpiAlltoallv","(",new OneOperator7_, KN_, fMPI_Comm, KN_, KN_, KN_, KN_ >( Op_All2All3v ) ); Global.Add("mpiAlltoallv","(",new OneOperator7_, KN_, fMPI_Comm, KN_, KN_, KN_, KN_ >( Op_All2All3v ) ); Global.Add("mpiAllgatherv","(",new OneQuadOperator, Quad_Op > > ); Global.Add("mpiAllgatherv","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllgatherv","(",new OneOperator5_, KN_, fMPI_Comm, KN_, KN_ >(Op_Allgatherv3< long >) ); Global.Add("mpiAllgatherv","(",new OneOperator5_, KN_, fMPI_Comm, KN_, KN_ >(Op_Allgatherv3< double >) ); Global.Add("mpiScatterv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >(Op_Scatterv3< long >) ); Global.Add("mpiScatterv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >(Op_Scatterv3< double >) ); Global.Add("mpiGatherv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >( Op_Gatherv3< long > ) ); Global.Add("mpiGatherv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >( Op_Gatherv3< double > ) ); // Fin Add J. Morice Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >); // add FH jan 2011 // Global.Add("mpiReduceScatter","(",new OneQuadOperator, Quad_Op > >); // Add J. Morice Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >); // add FH jan 2011 // Global.Add("mpiReduceScatter","(",new OneQuadOperator, Quad_Op > >); // fin Add J. Morice // Add J. Morice :: complex communication between processor Global.Add("mpiAlltoall","(",new OneBinaryOperator >); Global.Add("mpiAllgather","(",new OneBinaryOperator >); Global.Add("mpiAlltoall","(",new OneTernaryOperator3 >); Global.Add("mpiAllgather","(",new OneTernaryOperator3 >); Global.Add("mpiAllgather","(",new OneBinaryOperator >); Global.Add("mpiAllgather","(",new OneTernaryOperator3 >); Global.Add("mpiScatter","(",new OneTernaryOperator3 >); Global.Add("mpiGather","(",new OneTernaryOperator3 >); Global.Add("mpiScatter","(",new OneTernaryOperator3 >); Global.Add("mpiGather","(",new OneTernaryOperator3 >); // Add J. Morice communication with vector of different size Global.Add("mpiAlltoallv","(",new OneOperator6_, KN_, KN_, KN_, KN_, KN_ >( Op_All2Allv ) ); Global.Add("mpiAlltoallv","(",new OneOperator7_, KN_, fMPI_Comm, KN_, KN_, KN_, KN_ >( Op_All2All3v ) ); Global.Add("mpiAllgatherv","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllgatherv","(",new OneOperator5_, KN_, fMPI_Comm, KN_, KN_ >(Op_Allgatherv3< Complex >) ); Global.Add("mpiScatterv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >(Op_Scatterv3< Complex >) ); Global.Add("mpiGatherv","(",new OneOperator5_, KN_, MPIrank, KN_, KN_ >( Op_Gatherv3< Complex > ) ); Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >);// add FH april 2011 Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >);// add FH april 2011 Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >);// add FH april 2011 Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >);// add FH april 2011 Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiReduce","(",new OneQuadOperator, Quad_Op > >); Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >); #ifdef HAVE_MPI_DOUBLE_COMPLEX Global.Add("mpiAllReduce","(",new OneQuadOperator, Quad_Op > >);// add FH jan 2011 #endif // Fin Add J. Morice :: complex communication between processor Global.New("mpirank",CConstant(mpirank)); Global.New("mpisize",CConstant(mpisize)); static long mpiUndefined=MPI_UNDEFINED, mpiAnySource = MPI_ANY_SOURCE,mpiAnyTag=MPI_ANY_TAG ; static fMPI_Comm fmpiWorld=MPI_COMM_WORLD; Global.New("mpiUndefined",CConstant(mpiUndefined)); Global.New("mpiAnySource",CConstant(mpiAnySource)); Global.New("mpiAnyTag",CConstant(mpiAnyTag)); Global.New("mpiCommWorld",CConstant(&fmpiWorld)); // add FH Global.Add("mpiWtime","(",new OneOperator0(ffMPI_Wtime)); Global.Add("mpiWtick","(",new OneOperator0(ffMPI_Wtick)); Global.Add("processor","(",new OneOperator3_(mpiwho_)); Global.Add("processor","(",new OneOperator2_(mpiwho_)); Global.Add("mpiWait","(",new OneOperator1(mpiWait)); Global.Add("mpiWaitAny","(",new OneOperator1*>(mpiWaitAny)); Global.Add("mpiSize","(",new OneOperator1(mpiSize)); Global.Add("mpiRank","(",new OneOperator1(mpiRank)); Global.Add("mpiBarrier","(",new OneOperator1(mpiBarrier)); static fMPI_Op op_max(MPI_MAX); static fMPI_Op op_min(MPI_MIN); static fMPI_Op op_sum(MPI_SUM); static fMPI_Op op_prod(MPI_PROD); static fMPI_Op op_land(MPI_LAND); static fMPI_Op op_lor(MPI_LOR); static fMPI_Op op_lxor(MPI_LXOR); static fMPI_Op op_band(MPI_BAND); static fMPI_Op op_bor(MPI_BOR); static fMPI_Op op_bxor(MPI_BXOR); static fMPI_Op op_maxloc(MPI_MAXLOC); static fMPI_Op op_minloc(MPI_MINLOC); Global.New("mpiMAX",CConstant(op_max)); Global.New("mpiMIN",CConstant(op_min)); Global.New("mpiSUM",CConstant(op_sum)); Global.New("mpiPROD",CConstant(op_prod)); Global.New("mpiLAND",CConstant(op_land)); Global.New("mpiLOR",CConstant(op_lor)); Global.New("mpiLXOR",CConstant(op_lxor)); Global.New("mpiBAND",CConstant(op_band)); Global.New("mpiBXOR",CConstant(op_bxor)); // sur des pair bof bof ... Global.New("mpiMAXLOC",CConstant(op_maxloc)); Global.New("mpiMINLOC",CConstant(op_minloc)); TheOperators->Add("<-", new OneOperator2_ *,KN *,long>(&set_init0) ); atype* >()->Add("[","",new OneOperator2_*,long >(get_elementp_)); Global.Add("splitComm", "(", new splitComm); } // set the 3 ptr extern void (*initparallele)(int &argc, char **& argv) ; extern void (*init_lgparallele)(); //extern void (*end_parallele)(); void init_ptr_parallelepmi(); void init_ptr_parallelepmi(){ initparallele=&f_initparallele ; init_lgparallele=&f_init_lgparallele; //end_parallele=&f_end_parallele; }; freefem++-3.61-1/src/mpi/Makefile.in000644 000767 000024 00000104366 13321623167 017237 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # change FH mars 2010 for sgi mpiu .... # FFCS - we need to call MPICXX directly because Windows options are too different to be detailed to the FF configuration script. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ EXTRA_PROGRAMS = FreeFem++-mpi$(EXEEXT) subdir = src/mpi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_FreeFem___mpi_OBJECTS = sansrgraph.$(OBJEXT) mymain.$(OBJEXT) \ parallelempi.$(OBJEXT) lg.tab.$(OBJEXT) ffapi.$(OBJEXT) FreeFem___mpi_OBJECTS = $(am_FreeFem___mpi_OBJECTS) FreeFem___mpi_LDADD = $(LDADD) 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(FreeFem___mpi_SOURCES) DIST_SOURCES = $(FreeFem___mpi_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @MPICXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # To create statically linked executables (see configure.ac) CXXLD = $(STATICTOOL) $(CXX) # MPI may not be installed. Checked in configure.ac bin_PROGRAMS = $(MPIPROG) bin_SCRIPTS = $(MPISCRIPT) EXTRA_SCRIPTS = ff-mpirun EXTRA_DIST = ff-mpirun.in # FFCS: visualization stream redirection FreeFem___mpi_SOURCES = ../Graphics/sansrgraph.cpp ../lglib/mymain.cpp parallelempi.cpp ../lglib/lg.tab.cpp \ ../fflib/ffapi.cpp FreeFem___mpi_DEPENDENCIES = ../fflib/libff.a LDADD = ../fflib/libff.a @UMFPACKLIBS@ @ARPACKLIBS@ @BLASLIBS@ @MPI_LIB@ AM_CXXFLAGS = -DPARALLELE AM_CPPFLAGS = -I$(srcdir)/../fflib -I$(srcdir)/../Graphics -I$(srcdir)/../femlib @MPI_INCLUDE@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mpi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/mpi/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) FreeFem++-mpi$(EXEEXT): $(FreeFem___mpi_OBJECTS) $(FreeFem___mpi_DEPENDENCIES) $(EXTRA_FreeFem___mpi_DEPENDENCIES) @rm -f FreeFem++-mpi$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(FreeFem___mpi_OBJECTS) $(FreeFem___mpi_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lg.tab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mymain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallelempi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sansrgraph.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` sansrgraph.o: ../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sansrgraph.o -MD -MP -MF $(DEPDIR)/sansrgraph.Tpo -c -o sansrgraph.o `test -f '../Graphics/sansrgraph.cpp' || echo '$(srcdir)/'`../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sansrgraph.Tpo $(DEPDIR)/sansrgraph.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/sansrgraph.cpp' object='sansrgraph.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sansrgraph.o `test -f '../Graphics/sansrgraph.cpp' || echo '$(srcdir)/'`../Graphics/sansrgraph.cpp sansrgraph.obj: ../Graphics/sansrgraph.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sansrgraph.obj -MD -MP -MF $(DEPDIR)/sansrgraph.Tpo -c -o sansrgraph.obj `if test -f '../Graphics/sansrgraph.cpp'; then $(CYGPATH_W) '../Graphics/sansrgraph.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/sansrgraph.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sansrgraph.Tpo $(DEPDIR)/sansrgraph.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../Graphics/sansrgraph.cpp' object='sansrgraph.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sansrgraph.obj `if test -f '../Graphics/sansrgraph.cpp'; then $(CYGPATH_W) '../Graphics/sansrgraph.cpp'; else $(CYGPATH_W) '$(srcdir)/../Graphics/sansrgraph.cpp'; fi` mymain.o: ../lglib/mymain.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mymain.o -MD -MP -MF $(DEPDIR)/mymain.Tpo -c -o mymain.o `test -f '../lglib/mymain.cpp' || echo '$(srcdir)/'`../lglib/mymain.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mymain.Tpo $(DEPDIR)/mymain.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../lglib/mymain.cpp' object='mymain.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mymain.o `test -f '../lglib/mymain.cpp' || echo '$(srcdir)/'`../lglib/mymain.cpp mymain.obj: ../lglib/mymain.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mymain.obj -MD -MP -MF $(DEPDIR)/mymain.Tpo -c -o mymain.obj `if test -f '../lglib/mymain.cpp'; then $(CYGPATH_W) '../lglib/mymain.cpp'; else $(CYGPATH_W) '$(srcdir)/../lglib/mymain.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mymain.Tpo $(DEPDIR)/mymain.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../lglib/mymain.cpp' object='mymain.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mymain.obj `if test -f '../lglib/mymain.cpp'; then $(CYGPATH_W) '../lglib/mymain.cpp'; else $(CYGPATH_W) '$(srcdir)/../lglib/mymain.cpp'; fi` lg.tab.o: ../lglib/lg.tab.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lg.tab.o -MD -MP -MF $(DEPDIR)/lg.tab.Tpo -c -o lg.tab.o `test -f '../lglib/lg.tab.cpp' || echo '$(srcdir)/'`../lglib/lg.tab.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lg.tab.Tpo $(DEPDIR)/lg.tab.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../lglib/lg.tab.cpp' object='lg.tab.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lg.tab.o `test -f '../lglib/lg.tab.cpp' || echo '$(srcdir)/'`../lglib/lg.tab.cpp lg.tab.obj: ../lglib/lg.tab.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lg.tab.obj -MD -MP -MF $(DEPDIR)/lg.tab.Tpo -c -o lg.tab.obj `if test -f '../lglib/lg.tab.cpp'; then $(CYGPATH_W) '../lglib/lg.tab.cpp'; else $(CYGPATH_W) '$(srcdir)/../lglib/lg.tab.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lg.tab.Tpo $(DEPDIR)/lg.tab.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../lglib/lg.tab.cpp' object='lg.tab.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lg.tab.obj `if test -f '../lglib/lg.tab.cpp'; then $(CYGPATH_W) '../lglib/lg.tab.cpp'; else $(CYGPATH_W) '$(srcdir)/../lglib/lg.tab.cpp'; fi` ffapi.o: ../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffapi.o -MD -MP -MF $(DEPDIR)/ffapi.Tpo -c -o ffapi.o `test -f '../fflib/ffapi.cpp' || echo '$(srcdir)/'`../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffapi.Tpo $(DEPDIR)/ffapi.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../fflib/ffapi.cpp' object='ffapi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffapi.o `test -f '../fflib/ffapi.cpp' || echo '$(srcdir)/'`../fflib/ffapi.cpp ffapi.obj: ../fflib/ffapi.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ffapi.obj -MD -MP -MF $(DEPDIR)/ffapi.Tpo -c -o ffapi.obj `if test -f '../fflib/ffapi.cpp'; then $(CYGPATH_W) '../fflib/ffapi.cpp'; else $(CYGPATH_W) '$(srcdir)/../fflib/ffapi.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ffapi.Tpo $(DEPDIR)/ffapi.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../fflib/ffapi.cpp' object='ffapi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ffapi.obj `if test -f '../fflib/ffapi.cpp'; then $(CYGPATH_W) '../fflib/ffapi.cpp'; else $(CYGPATH_W) '$(srcdir)/../fflib/ffapi.cpp'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-binSCRIPTS 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-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS .PRECIOUS: Makefile ff-mpirun:ff-mpirun.in Makefile ../../config.status --file=ff-mpirun:ff-mpirun.in chmod a+x ff-mpirun # 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: freefem++-3.61-1/src/bamglib/Meshgibbs.cpp000644 000767 000024 00000062555 13256636774 020433 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include "vect.h" #define mmax(a,b)(a>b?a:b) #define mmin(a,b)(a= ptvois[record[j] + 1] - ptvois[record[j]]) { goto L8; } record[i] = record[j]; goto L4; L8: record[i] = rec; goto L2; L999: record[1] = rec; return 0; } /* gibbs1_ */ /* Subroutine */ int gibbs2_(integer* n,integer* record,integer* criter) { static integer crit, i, j, l, r, rec; /* trie record selon les valeurs de criter(record(.)) croissantes */ /* Parameter adjustments */ --criter; --record; /* Function Body */ if (*n <= 1) { return 0; } l = *n / 2 + 1; r = *n; L2: if (l <= 1) { goto L20; } --l; rec = record[l]; crit = criter[rec]; goto L3; L20: rec = record[r]; crit = criter[rec]; record[r] = record[1]; --r; if (r == 1) { goto L999; } L3: j = l; L4: i = j; j <<= 1; if (j - r < 0) { goto L5; } else if (j == r) { goto L6; } else { goto L8; } L5: if (criter[record[j]] < criter[record[j + 1]]) { ++j; } L6: if (crit >= criter[record[j]]) { goto L8; } record[i] = record[j]; goto L4; L8: record[i] = rec; goto L2; L999: record[1] = rec; return 0; } /* gibbs2_ */ /* Subroutine */ int gibbsa_(integer* n,integer* ptvois,integer* vois,integer* r,integer* m, integer* nv,integer* nx,integer* ny,integer* nn,integer* w1,integer* w2, integer* pfold,integer* pfnew,integer* impre,integer* nfout) { /* System generated locals */ integer i__1, i__2, i__3, i__4; /* Builtin functions */ /* Subroutine */ int s_stop(); /* Local variables */ static integer nbcc, degi, bold, bnew, i, j, k, p, degre, x, y, p1, p2; /* extern Subroutine int gibbs1_();*/ static integer pf; /* extern Subroutine int gibbsb_(), gibbsd_(), gibbst_();*/ static integer nbpass, niveau, pf1, option, old, new_, opt, new1; /* ----------------------------------------------------------------------- */ /* but: calculer une renumerotation des sommets d'un graphe defini par: */ /* par la methode de gibbs */ /* ----------------------------------------------------------------------- */ /* entree */ /* -------- */ /* n = nb de sommet du graphe */ /* les voisins d'un sommet i ont pour numero : */ /* ( vois(j) , j=ptvois(i),ptvois(i+1)-1 ) */ /* impre parametre d'impression */ /* nfout numero du fichier pour impression */ /* sortie */ /* ------ */ /* r(1:n) tableau donnant la nouvelle numerotation: */ /* r(i) = nouveau numero du sommet i */ /* pfolf = ancien profile */ /* pfnew = nouveau profile */ /* tableau de travail : */ /* -------------------- */ /* m(n) */ /* nv(0:n+n) */ /* nx(n) */ /* ny(n) */ /* nn(0:n) */ /* w1(n) */ /* w2(n) */ /* ----------------------------------------------------------------------- */ /* programmeur f. hecht le 3/02/1987 */ /* ----------------------------------------------------------------------- */ /* tri des voisins d'un sommet du graphe par degre croissant */ /* --------------------------------------------------------------- */ /* Parameter adjustments */ --w2; --w1; --ny; --nx; --m; --r; --vois; --ptvois; /* Function Body */ p2 = ptvois[1] - 1; i__1 = *n; for (i = 1; i <= i__1; ++i) { p1 = p2 + 1; p2 = ptvois[i + 1] - 1; i__2 = p2 - p1 + 1; gibbs1_(&i__2, &vois[p1], &ptvois[1]); /* if(impre.le.-9) then */ /* write (nfout,*) 'les voisin de ',i,'sont: ', (vois(j),j=p1,p 2) */ /* endif */ /* L10: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { r[i] = 0; /* L20: */ } /* boucle sur les composante connexe du graphe */ new_ = 0; nbcc = 0; L30: if (new_ < *n) { ++nbcc; /* recherche d'une racine y (un sommet non numerote) de degree m ini */ y = 0; degre = *n + 1; i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] <= 0) { degi = ptvois[i + 1] - ptvois[i]; if (degi < degre) { degre = degi; y = i; } } /* L40: */ } if (y == 0) { return -3;/* s_stop("fatal erreur gibbs 2 : pb racine", 33L); */ } gibbsd_(&y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); nbpass = 0; L50: ++nbpass; x = y; p = niveau; k = 0; i__1 = nv[p + 1]; for (i = nv[p] + 1; i <= i__1; ++i) { ++k; m[k] = nv[i]; /* L60: */ } gibbs1_(&k, &m[1], &ptvois[1]); i__1 = k; for (i = 1; i <= i__1; ++i) { y = m[i]; gibbsd_(&y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); if (niveau > p) { goto L50; } /* L70: */ } y = m[1]; /* if(impre.lt.0) then */ /* write(nfout,*) */ /* + ' nb de pass pour trouver le pseudo diametre',nbpass */ /* + ,' x=',x,',y=',y,' de la composante connexe ',nbcc */ /* write (nfout,*) ('-',i=1,78) */ /* endif */ /* optimisation de la descendance de la numerotation */ /* ------------------------------------------------- */ gibbsb_(&x, &y, n, &ptvois[1], &vois[1], &nx[1], &ny[1], nv, nn, &m[1] , &w1[1], &w2[1], &r[1], impre, nfout); /* renumerotation de cuthill mac kee avec la meilleur des 4 option s */ /* -------------------------------------------------------------- --- */ pf = 1073741824; option = -2; new1 = new_; for (opt = -2; opt <= 2; ++opt) { new_ = new1; if (opt != 0) { gibbst_(n, &p, nv, nn, &ptvois[1], &vois[1], &m[1], &r[1], & new_, &opt, &pf1, impre, nfout); if (pf1 < pf) { pf = pf1; option = opt; } } /* L80: */ } /* if(impre.ne.0) write (nfout,*) ' on a choisi l''option ', */ /* + option,', new =',new */ new_ = new1; gibbst_(n, &p, nv, nn, &ptvois[1], &vois[1], &m[1], &r[1], &new_, & option, &pf1, impre, nfout); goto L30; } /* if(impre.ne.0) write(nfout,*) */ /* + ' nb de composante connexe du graphe =',nbcc */ /* calcul du profile */ *pfold = 0; *pfnew = 0; bnew = 0; bold = 0; i__1 = *n; for (i = 1; i <= i__1; ++i) { old = i; new_ = r[i]; i__2 = ptvois[i + 1] - 1; for (j = ptvois[i]; j <= i__2; ++j) { /* Computing MIN */ i__3 = old, i__4 = vois[j]; old = mmin(i__3,i__4); /* Computing MIN */ i__3 = new_, i__4 = r[vois[j]]; new_ = mmin(i__3,i__4); /* L100: */ } *pfold = *pfold + i - old + 1; /* Computing MAX */ i__2 = bold, i__3 = i - old + 1; bold = mmax(i__2,i__3); *pfnew = *pfnew + r[i] - new_ + 1; /* Computing MAX */ i__2 = bnew, i__3 = r[i] - new_ + 1; bnew = mmax(i__2,i__3); /* L110: */ } /* if(impre.ne.0) then */ /* write(nfout,*)'profile old = ',pfold,', profile new = ',pfnew */ /* write(nfout,*)'1/2 bande old = ',bold ,', 1/2 band new = ',bnew */ /* endif */ return 0; } /* gibbsa_ */ /* Subroutine */ int gibbsb_(integer* x,integer* y,integer* n,integer* ptvois, integer* vois,integer* nx,integer* ny,integer* nv,integer* nn,integer* m, integer* wh,integer* wl,integer* r, integer* impre, integer* nfout) { /* System generated locals */ integer i__1, i__2; /* Local variables */ static flag_; static integer i, j, k, p, s, h0, i1, l0, i2; /* extern Subroutine int gibbs1_(); */ static integer lg; /* extern Subroutine int gibbsd_(), gibbsc_();*/ static integer niveau, mxcanx, mxcany, nbc; /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* ...................................................................... */ /* attention on met la descente optimiser dans r <0 ou nulle */ /* ....................................................................... */ /* Parameter adjustments */ --r; --m; --ny; --nx; --vois; --ptvois; /* Function Body */ gibbsd_(y, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); gibbsc_(&ny[1], nv, &niveau, n, &mxcany); gibbsd_(x, n, &ptvois[1], &vois[1], nv, &r[1], &niveau); p = niveau; gibbsc_(&nx[1], nv, &niveau, n, &mxcanx); flag_ = ffalse; i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nx[i] + ny[i] == p) { r[i] = -nx[i]; } else if (nx[i] >= 0) { flag_ = ttrue; r[i] = -1073741824; } else { if (r[i] <= 0) { r[i] = -1073741822; } } /* L20: */ } if (flag_) { /* calcul des composantes connexe du graphe sans les sommets de nn */ /* ------------------------------------------------------------ --- */ j = *n; k = 0; nbc = 0; nv[nbc] = j; L30: ++k; if (k <= *n) { if (r[k] == -1073741824) { /* recherche de la fermeture transitive partant de k */ ++nbc; i = -1; s = k; L40: ++i; wl[i] = ptvois[s]; wh[i] = ptvois[s + 1]; ++j; nv[j] = s; r[s] = -1073741823; L50: if (i >= 0) { if (wl[i] < wh[i]) { s = vois[wl[i]]; ++wl[i]; if (r[s] == -1073741824) { goto L40; } goto L50; } --i; goto L50; } nv[nbc] = j; m[nbc] = nbc; } goto L30; } /* if(impre.lt.0) write(nfout,*) */ /* + ' nb de composante connexe du graphe reduit =',nbc */ /* --------------- fin de construction des composantes connexes------ --- */ /* nv(0)=n */ /* if(impre.le.-10) write(nfout,5555)'nv(0:n+n) = ',(nv(i),i=0, n+n) */ gibbs1_(&nbc, &m[1], nv); /* if(impre.le.-10)write(nfout,5555)'trie m =',(m(i),i=1,nbc) */ i__1 = p; for (i = 0; i <= i__1; ++i) { nn[i] = 0; /* L60: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { j = -r[i]; if (j >= 0 && j <= p) { ++nn[j]; } /* L70: */ } /* boucle sur les composante connexes par ordre croissantes */ /* -------------------------------------------------------- */ for (k = nbc; k >= 1; --k) { i = m[k]; i1 = nv[i - 1] + 1; i2 = nv[i]; lg = i2 - i1 + 1; /* if(impre.le.-7) */ /* + write(nfout,*) k,' composante ',i,',lg=',lg,',i1,i2 =',i1,i2 */ /* if(impre.le.-8) */ /* + write (nfout,5555)' ',(nv(i),i=i1,i2) */ h0 = 0; l0 = 0; i__1 = p; for (j = 0; j <= i__1; ++j) { wh[j] = nn[j]; wl[j] = nn[j]; /* L90: */ } i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; ++wh[nx[s]]; ++wl[p - ny[s]]; /* L100: */ } i__1 = p; for (j = 0; j <= i__1; ++j) { if (wh[j] != nn[j]) { /* Computing MAX */ i__2 = wh[j]; h0 = mmax(i__2,h0); } if (wl[j] != nn[j]) { /* Computing MAX */ i__2 = wl[j]; l0 = mmax(i__2,l0); } /* L110: */ } if (h0 < l0 || h0 == l0 && mxcanx <= mxcany) { /* if(impre.le.-2) write(nfout,*) */ /* + ' h0 = ',h0,',l0 = ',l0,' ------- XXXX --------' */ i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; r[s] = -nx[s]; ++nn[-r[s]]; /* L120: */ } } else { /* if (impre.le.-2) write(nfout,*) */ /* + ' h0 = ',h0,',l0 = ',l0,' ------- YYYY --------' */ i__1 = i2; for (i = i1; i <= i__1; ++i) { s = nv[i]; r[s] = -p + ny[s]; ++nn[-r[s]]; /* L130: */ } } /* L140: */ } } /* on met les nouveaux niveaux de la descendance optimiser dans nn */ /* ----------------------------------------------------------------- */ i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] > 0) { nn[i] = -1; } else if (r[i] == -1073741822) { nn[i] = -2; } else { nn[i] = -r[i]; } /* L150: */ } /* if(impre.le.-10)write (nfout,5555)' nn(i)=',(nn(i),i=1,n) */ /* 5555 format(' -------- ',a,/,5(15x,10(i5)/)) */ return 0;} /* gibbsb_ */ /* Subroutine */ int gibbsc_(integer* nz,integer* nv,integer* niveau,integer* n,integer* mxz) { /* System generated locals */ integer i__1, i__2, i__3; /* Local variables */ static integer i, j; /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* Parameter adjustments */ --nz; /* Function Body */ i__1 = *n; for (i = 1; i <= i__1; ++i) { nz[i] = -1; /* L10: */ } *mxz = 0; i__1 = *niveau; for (i = 0; i <= i__1; ++i) { /* Computing MAX */ i__2 = *mxz, i__3 = nv[i + 1] - nv[i]; *mxz = mmax(i__2,i__3); i__2 = nv[i + 1]; for (j = nv[i] + 1; j <= i__2; ++j) { nz[nv[j]] = i; /* L20: */ } } return 0;} /* gibbsc_ */ /* Subroutine */ int gibbsd_(integer* racine,integer* n,integer* ptvois,integer* vois,integer* nv,integer* r,integer* niveau) { /* System generated locals */ integer i__1, i__2; /* Local variables */ static integer i, k, s, sv, stk, stk1, stk2; /* ----------------------------------------------------------------------- */ /* but construire la structure des descendant de racine du graphe */ /* ----------------------------------------------------------------------- */ /* sortie : */ /* -------- */ /* nv est la structure des niveaux */ /* les sommets du niveau (i =0,niveau_ sont defini par : */ /* (nv(j),j=nv(i),nv(i+1)-1) */ /* le tableau r(i) n'est modifier que sur les sommets */ /* de la composante connexe du graphe contenant la racine */ /* ----------------------------------------------------------------------- */ /* on demark tout les sommets non remuneroter */ /* -------------------------------------------------- */ /* Parameter adjustments */ --r; --vois; --ptvois; /* Function Body */ i__1 = *n; for (i = 1; i <= i__1; ++i) { if (r[i] < 0) { r[i] = 0; } /* L10: */ } /* initialisation */ stk = *n - 1; nv[0] = stk; stk2 = stk; *niveau = 0; ++stk; nv[stk] = *racine; r[*racine] = -1; L20: if (stk2 < stk) { ++(*niveau); stk1 = stk2 + 1; nv[*niveau] = stk; stk2 = stk; /* print *,' ------- niveau =',niveau,' stk=',stk1,stk2 */ i__1 = stk2; for (k = stk1; k <= i__1; ++k) { s = nv[k]; /* print *,'----------------- s=',s */ i__2 = ptvois[s + 1] - 1; for (i = ptvois[s]; i <= i__2; ++i) { /* pour tout les sommets (sv) voisin */ /* d'un sommet (s) du niveau precedent */ sv = vois[i]; /* print *,' voisin =',sv */ /* si le sommet n'est pas marque on le marque et on l'ajout */ if (r[sv] == 0) { ++stk; nv[stk] = sv; r[sv] = -1; } /* L30: */ } /* L40: */ } goto L20; } --(*niveau); /* call pnv(' gibbsd ',n,nv,niveau) */ return 0;} /* gibbsd_ */ /* Subroutine */ int gibbst_(integer* n,integer* p,integer* nv,integer* nn,integer* ptvois,integer* vois,integer* m,integer* r,integer* new_,integer* option, integer* pfnew,integer* impre,integer* nfout) { /* System generated locals */ integer i__1, i__2, i__3, i__4, i__5; /* Local variables */ static integer nbsc, bnew, knew, step, plus, i, j, k, s, debut, i1, i2; /* extern Subroutine int gibbs2_();*/ static integer fin; /* construction de la stucture de niveau dans nv a partir de nn */ /* ------------------------------------------------------------ */ /* Parameter adjustments */ --r; --m; --vois; --ptvois; /* Function Body */ nv[0] = *n; i__1 = *p + 1; for (i = 1; i <= i__1; ++i) { nv[i] = 0; /* L150: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nn[i] >= 0) { ++nv[nn[i] + 1]; } /* L160: */ } i__1 = *p; for (i = 0; i <= i__1; ++i) { nv[i + 1] += nv[i]; /* L170: */ } i__1 = *n; for (i = 1; i <= i__1; ++i) { if (nn[i] >= 0) { j = nn[i]; ++nv[j]; nv[nv[j]] = i; } /* L180: */ } for (i = *p; i >= 0; --i) { nv[i + 1] = nv[i]; /* L190: */ } nv[0] = *n; nbsc = nv[*p + 1] - nv[0]; /* --- fin de la construction ------------------------------------ */ if (*option == -2) { i__1 = *impre - 1; } i__1 = *n; for (i = 1; i <= i__1; ++i) { m[i] = *n * 3 + ptvois[i + 1] - ptvois[i]; /* L10: */ } if ((((int)*option) == 1)||(((int)*option) == -1)) { debut = 0; fin = *p; step = 1; } else { debut = *p; fin = 0; step = -1; } i__1 = fin; i__2 = step; for (i = debut; i__2 < 0 ? i >= i__1 : i <= i__1; i += i__2) { i1 = nv[i] + 1; i2 = nv[i + 1]; i__3 = i2 - i1 + 1; gibbs2_(&i__3, &nv[i1], &m[1]); i__3 = i2; for (j = i1; j <= i__3; ++j) { s = nv[j]; i__4 = ptvois[s + 1] - 1; for (k = ptvois[s]; k <= i__4; ++k) { /* Computing MIN */ i__5 = m[vois[k]]; m[vois[k]] = mmin(i__5,j); /* L20: */ } /* L30: */ } /* L40: */ } if (*option > 0) { knew = *new_; plus = 1; } else { knew = *new_ + nbsc + 1; plus = -1; } *new_ += nbsc; /* if(option.gt.0) then */ /* do 60 k = debut , fin , step */ /* do 60 j = nv(k+1),nv(k)+1,-1 */ /* knew = knew + plus */ /* r(nv(j)) = knew */ /* 60 continue */ /* else */ i__2 = fin; i__1 = step; for (k = debut; i__1 < 0 ? k >= i__2 : k <= i__2; k += i__1) { i__3 = nv[k + 1]; for (j = nv[k] + 1; j <= i__3; ++j) { knew += plus; r[nv[j]] = knew; /* L70: */ } } /* endif */ *pfnew = 0; bnew = 0; i__3 = *n; for (i = 1; i <= i__3; ++i) { k = r[i]; if (k > 0) { i__1 = ptvois[i + 1] - 1; for (j = ptvois[i]; j <= i__1; ++j) { if (r[vois[j]] > 0) { /* Computing MIN */ i__2 = k, i__4 = r[vois[j]]; k = mmin(i__2,i__4); } /* L100: */ } *pfnew = *pfnew + r[i] - k + 1; /* Computing MAX */ i__1 = bnew, i__2 = r[i] - k + 1; bnew = mmax(i__1,i__2); } /* L110: */ } /* if(impre.lt.0.or.impre.gt.2) then */ /* write(nfout,*) ' option =',option,', profile =',pfnew */ /* + ,', 1/2 bande =',bnew,', new=',new,', nbss composante=',nbsc */ /* endif */ return 0;} /* gibbst_ */ /* function */ int Triangles::gibbsv (integer* ptvoi, integer* vois,integer* lvois,integer* w,integer* v) { /* System generated locals */ integer i__2; /* Local variables */ integer i, j, k, T, ss, iii, ptv, ptv1; integer nbss = nbv; /*--- Prepare les donees pour gibbsa en construisant ptvoi, vois, lvois - ------------*/ /* in */ /* --- nbnt =3 pour des triangles 2D, */ /* nbt = nb de triangle */ /* nbss = nb de sommets */ /* nsea = numeros de 3 sommets de chaque triangle (me) */ /* out */ /* --- ptvoi, vois, lvois, err */ /* tableaux de travail w, v */ /*----------------------------------------------------------------------- ----------*/ /* Parameter adjustments */ --v; --w; --vois; --ptvoi; long nt = nbt-NbOutT; /* Function Body */ for (i = 1; i <= nbss; ++i) { w[i] = -1; ptvoi[i] = 0; } ptvoi[nbss + 1] = 0; for (i = 0; i < nt; ++i) { assert(triangles[i].link); for (j = 0; j < 3; ++j) { ss = Number(triangles[i][j])+1; ++ptvoi[ss + 1]; w[ss] = 0; } } for (i = 1; i <= nbss; ++i) ptvoi[i + 1] += ptvoi[i]; for (i = 0; i < nt; ++i) if (triangles[i].link) for (j = 0; j < 3; ++j) { ss = Number(triangles[i][j])+1; ++ptvoi[ss]; v[ptvoi[ss]] = i; } ptv1 = 0; iii = 1; for (i = 1; i <= nbss; ++i) { ptv = ptv1 + 1; ptv1 = ptvoi[i]; ptvoi[i] = iii; i__2 = ptv1; for (j = ptv; j <= i__2; ++j) { T = v[j]; for (k = 0; k < 3; ++k) { ss = Number(triangles[T][k])+1; /* nsea[k + T * nsea_dim1]; */ if (w[ss] != i) { w[ss] = i; if (iii > *lvois) return 2 ; /* print*,'pas assez de place memoire' */ vois[iii] = ss; ++iii;} } } } ptvoi[nbss + 1] = iii; *lvois = iii - 1; return 0; /* OK */ return 0;} /* gibbsv_ */ int Triangles::gibbs() /* -------- renumber vertices by gibbs method; updates triangle and edge array in: mesh out: mesh auxiliary arrays: ptvois,vois,r,m,nv,nx,ny,nn,w1,w2,f all of size nv+1 except vois (10(nv+1)) and nv (2(nv+1)) err = -1 : memory alloc pb; err = -3: fatal erreur gibbs 2 : pb racine */ { long nv = nbv; long nt = nbt-NbOutT; long i, j, pfold, pfnew; long* ptvois=NULL; long* vois=NULL; long* nn =NULL; long* r =NULL; long* m =NULL; long* nnv =NULL; long* nx =NULL; long* ny =NULL; long* w1 =NULL; long* w2=NULL; long nbvoisin = 10*nv; long printint=0, iodev=6; int err=0; ptvois = new long[nv+1]; //(long*)calloc((long)(nv + 1) , sizeof(long)); nn = new long[3*nt]; //(long*)calloc(3 * nt ,sizeof(long)); vois = new long[nbvoisin+10]; //(long*)calloc((long)(nbvoisin + 10) , sizeof(long)); r = new long[nv+1]; //(long*)calloc((long)(nv + 1) , sizeof(long)); if((!ptvois)||(!nn)||(!vois)||(!r)) return -1; err = gibbsv(ptvois,vois,&nbvoisin,r,nn) ; delete [] nn; // free(nn); if(err==0) { m = new long[nv+1]; nn = new long[nv+1]; nnv = new long[(nv+1)<<1]; nx = new long[nv+1]; ny = new long[nv+1]; w1 = new long[nv+1]; w2 = new long[nv+1]; long lnv = nv; err = gibbsa_ (&lnv, ptvois, vois, r, m, nnv, nx, ny, nn, w1, w2, &pfold, &pfnew, &printint, &iodev); delete [] m; delete [] nnv; delete [] nn; delete [] nx; delete [] ny; delete [] w1; delete [] w2; } delete [] vois; delete [] ptvois; /* if (err == 0 && (pfnew <= pfold)) { A f(nv); for (i = 0; i < nv; ++i) { f[i].x = v[i].x; f[i].y = v[i].y; f[i].where = v[i].where; } for (i = 0; i < nv; ++i) { v[r[i] - 1].x = f[i].x; v[r[i] - 1].y = f[i].y; v[r[i] - 1].where = f[i].where; } for (j = 0; j < nt; ++j) // updates triangle array for (i = 0; i < 3; i++) t[j].v[i] = &v[r[no(t[j].v[i])] - 1]; for (j = 0; j < ne; ++j) // updates edge array { e[j].in = &v[r[no(e[j].in)] - 1]; e[j].out = &v[r[no(e[j].out)] - 1]; } f.destroy(); if (!NumThinGrid) { NumThinGrid= new int [nv]; for (i=0;i #include #include #include #include using namespace std; #include "Mesh2.h" #include "QuadTree.h" #include "SetOfE4.h" extern bool withrgraphique; namespace bamg { Real4 xGrafCoef,yGrafCoef,xGrafOffSet,yGrafOffSet; R2 GrafPMin,GrafPMax; Real8 Grafh=0; void IMoveTo(long i,long j) { if (!withrgraphique) return; rmoveto(float(i)/xGrafCoef+xGrafOffSet ,float(j)/yGrafCoef+yGrafOffSet );} void ILineTo(long i,long j) { if (!withrgraphique) return; rlineto(float(i)/xGrafCoef+xGrafOffSet ,float(j)/yGrafCoef+yGrafOffSet );} void Triangles::Draw( ) const { if (!withrgraphique) return; showgraphic(); // if (!init) InitDraw(); Int4 i; // for (i=0;ir.x,v[1]->r.x), Max(v[0]->r.y,v[1]->r.y), Min(v[0]->r.x,v[1]->r.x), Max(v[0]->r.y,v[1]->r.y))) { v[0]->MoveTo(); v[1]->LineTo(); R2 M= ((R2) *v[0] + (R2) * v[1])*0.5; Move(M); char VertexDraw_i10[20]; if (i<0) sprintf(VertexDraw_i10,"%p",this); else sprintf(VertexDraw_i10,"%ld",i); if (i>=0) plotstring(&VertexDraw_i10[0]); } } void Vertex::Draw(Int4 i) const { if (!withrgraphique) return; if (CurrentTh && i<0&& i != -2 ) { if (CurrentTh->vertices <= this && this < CurrentTh->vertices + CurrentTh->nbv) i = CurrentTh->Number(this); } if (InPtScreen(r.x,r.y)) { char VertexDraw_i10[20]; if (i<0) sprintf(VertexDraw_i10,"%p",this); else sprintf(VertexDraw_i10,"%ld",i); showgraphic(); // float eps = (MaxICoor/yGrafCoef)/100; DrawMark(r); if (i>=0) plotstring(&VertexDraw_i10[0]); } } void DrawMark(R2 r) { if (!withrgraphique) return; if (InPtScreen(r.x,r.y)) { float eps = Grafh/100; rmoveto(r.x+eps,r.y); rlineto(r.x,r.y+eps); rlineto(r.x-eps,r.y); rlineto(r.x,r.y-eps); rlineto(r.x+eps,r.y);} } void Triangle::Draw(Int4 i ) const { if (!withrgraphique) return; // int cc=LaCouleur(); if (CurrentTh && i<0 && i != -2) { if (CurrentTh->triangles <= this && this < CurrentTh->triangles + CurrentTh->nbt) i = CurrentTh->Number(this); } char i10[20]; if (i<0) sprintf(i10,"%p",this); else sprintf(i10,"%ld",i); showgraphic(); if (ns[0] == 0) { if (InRecScreen(Min(ns[1]->r.x,ns[2]->r.x), Min(ns[1]->r.y,ns[2]->r.y), Max(ns[1]->r.x,ns[2]->r.x), Max(ns[1]->r.y,ns[2]->r.y))) { rmoveto(ns[1]->r.x,ns[1]->r.y); rlineto(ns[2]->r.x,ns[2]->r.y); rmoveto( (ns[1]->r.x + ns[2]->r.x)/2.0 + (ns[1]->r.y - ns[2]->r.y)*0.1, (ns[1]->r.y + ns[2]->r.y)/2.0 - (ns[1]->r.x - ns[2]->r.x)*0.1 ); if(i>=0) plotstring(&i10[0]); }} else if (InRecScreen(Min3(ns[0]->r.x,ns[1]->r.x,ns[2]->r.x), Min3(ns[0]->r.y,ns[1]->r.y,ns[2]->r.y), Max3(ns[0]->r.x,ns[1]->r.x,ns[2]->r.x), Max3(ns[0]->r.y,ns[1]->r.y,ns[2]->r.y))) { { const int i0=0 , j01=EdgesVertexTriangle[i0][1];// j01==2 const int i1=VerticesOfTriangularEdge[j01][1], j12=EdgesVertexTriangle[i1][1];//i1=1,j12=0 const int i2=VerticesOfTriangularEdge[j12][1], j20=EdgesVertexTriangle[i2][1];//i1=2,j20=1 rmoveto(ns[i0]->r.x,ns[i0]->r.y); if(Hidden(j01)) rmoveto(ns[i1]->r.x,ns[i1]->r.y); else rlineto(ns[i1]->r.x,ns[i1]->r.y); if(Hidden(j12)) rmoveto(ns[i2]->r.x,ns[i2]->r.y); else rlineto(ns[i2]->r.x,ns[i2]->r.y); if(Hidden(j20)) rmoveto(ns[i0]->r.x,ns[i0]->r.y); else rlineto(ns[i0]->r.x,ns[i0]->r.y); rmoveto( (ns[0]->r.x + ns[1]->r.x + ns[2]->r.x)/3.0 , (ns[0]->r.y + ns[1]->r.y + ns[2]->r.y)/3.0); } if(i>=0) plotstring(&i10[0]); } // LaCouleur(cc); } void Triangles::InitDraw() const { if (!withrgraphique) return; couleur(1); GrafPMin = vertices[0].r; GrafPMax = vertices[0].r; // recherche des extrema des vertices GrafPMin,GrafPMax Int4 i; for (i=0;i2) cout << "inquire: Nb de Triangle reel = " < draw metric o=> optim around (debug)",i++); Show("t: find triangle contening the point with brute force",i++); Show("e: find the nearest edge of triangle contening the point",i++); Show("C: construct the in-circle in anistrope way",i++); Show("n: show normal for find ",i++); } if (c=='p') openPS(0),PS=1; if (c=='P') closePS(),PS=0; if (c=='B') BTh.inquire(); if ( c=='D') { for(int iter=0;iter < 50;iter++) { int k = 0; for (Int4 icount=0; icount=0) { couleur(2+(reft[i])%6); triangles[i].Draw(reft[i]); couleur(1); } } if (c=='b') { Int4 i; reffecran(); for (i=0;iDraw(Number(tb)); penthickness(1); if(tb->link==0) { double a,b; TriangleAdjacent ta=CloseBoundaryEdgeV2(I,tb,a,b); R2 A = *ta.EdgeVertex(0); R2 B = *ta.EdgeVertex(1); //Triangle * tt = ta; // tt->Draw(Number(tt)); penthickness(5); // ta.EdgeVertex(0)->MoveTo(); // ta.EdgeVertex(1)->LineTo(); DrawMark(A*a+B*b); penthickness(1); } } if (c=='v' || c=='o' || c=='s' ) { couleur(3); if(!setv) ReMakeTriangleContainingTheVertex(); setv=1; R2 XY(x,y),P; Real8 d; Int4 i,j=0; P = XY - vertices[0].r; d = (P,P); for (i=0;iMoveTo(); tta.EdgeVertex(1)->LineTo(); cout << " Edge " << Number(tta.EdgeVertex(0)) << " " << Number(tta.EdgeVertex(1)) << endl; for (Int4 k=0;kr.x,s1->r.y); D2 SA(sa->r.x,sa->r.y); D2 SB(sb->r.x,sb->r.y); D2 AB= SB-SA; D2 MAB2=SB + SA; D2 M1A=(S1 + SA)*0.5; D2 MAB(MAB2.x*0.5,MAB2.y*0.5); D2 A1=S1-SA; D2 D = S1 - SB ; { Metric M=s1->m; D2 ABo = M.Orthogonal(AB); D2 A1o = M.Orthogonal(A1); penthickness(1); Move(MAB); Line(MAB+ABo); Line(MAB-ABo); Move(M1A); Line(M1A+A1o); Line(M1A-A1o); penthickness(3); // (A+B)+ x ABo = (S1+B)/2+ y A1 // ABo x - A1o y = (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x); double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2 cout << " d = " << d << " dd= " << dd << endl; if (Abs(d) > dd*1.e-10) { D2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d)); cout << C << s1->r <r <r << endl; DrawMark(C); cout << M << " l = "<< M(C-S1) << " lnew = 1 == " ; //M.Draw(R2(C.x,C.y)); M=M/M(C-S1); cout << M(C-S1) << M << endl; M.Draw(R2(C.x,C.y)); } } } break; } cout << " fin recherche triangle " << endl; couleur(1); } if (c=='='||c==249) { rd=1; float hx = (GrafPMax.x-GrafPMin.x); float hy = (GrafPMax.y-GrafPMin.y); Grafh = Max(hx,hy)*0.55; cadreortho((GrafPMin.x+GrafPMax.x)*0.5,(GrafPMin.y+GrafPMax.y)*0.55,Grafh); } penthickness(1); if (rd) reffecran(),Draw(); } // cout << endl; delete [] reft; CurrentTh = OldCurrentTh; } void Draw(float x,float y) { if (!withrgraphique) return; if (InPtScreen(x,y)) { float eps = Max(GrafPMax.x-GrafPMin.x,GrafPMax.y-GrafPMin.y)/100; rmoveto(x+eps,y); rlineto(x,y+eps); rlineto(x-eps,y); rlineto(x,y-eps); rlineto(x+eps,y);} } char Getxyc(long &i,long &j) { if (!withrgraphique) return 0; float x,y; char c=::Getxyc(x,y); i = (long)( (x - xGrafOffSet)*xGrafCoef); j = (long)((y - yGrafOffSet)*yGrafCoef); return c; } void Draw(long i,long j) { if (!withrgraphique) return; Draw(((float) i)/xGrafCoef+xGrafOffSet ,((float) j)/yGrafCoef+yGrafOffSet ); } int Triangle::swapDRAW(Int2 a){ int NbUnSwap=0; if(a/4 !=0) {cout << a << "arete lock"<< a <ns[VerticesOfTriangularEdge[a1][0]]; Vertex *sb=t1->ns[VerticesOfTriangularEdge[a1][1]]; Vertex *s1=t1->ns[OppositeVertex[a1]]; Vertex *s2=t2->ns[OppositeVertex[a2]]; #ifdef DEBUG assert ( a >= 0 && a < 3 ); #endif Icoor2 det1=t1->det , det2=t2->det ; Icoor2 detT = det1+det2; Icoor2 detA = Abs(det1) + Abs(det2); Icoor2 detMin = Min(det1,det2); int OnSwap = 0; // si 2 triangle infini (bord) => detT = -2; if (sa == 0) {// les deux triangles sont frontieres det2=bamg::det(s2->i,sb->i,s1->i); OnSwap = det2 >0;} else if (sb == 0) { // les deux triangles sont frontieres det1=bamg::det(s1->i,sa->i,s2->i); OnSwap = det1 >0;} else if(( s1 != 0) && (s2 != 0) ) { det1 = bamg::det(s1->i,sa->i,s2->i); det2 = detT - det1; OnSwap = (Abs(det1) + Abs(det2)) < detA; Icoor2 detMinNew=Min(det1,det2); cout << " detMin = " << detMin << " detMinNew " << detMinNew << endl; if (! OnSwap &&(detMinNew>0)) { OnSwap = detMin ==0; if (! OnSwap) { int kopt = 1; while (1) if(kopt) { // critere de Delaunay pure Real8 xb1 = sb->i.x - s1->i.x, x21 = s2->i.x - s1->i.x, yb1 = sb->i.y - s1->i.y, y21 = s2->i.y - s1->i.y, xba = sb->i.x - sa->i.x, x2a = s2->i.x - sa->i.x, yba = sb->i.y - sa->i.y, y2a = s2->i.y - sa->i.y, cosb12 = xb1*x21 + yb1*y21 , cosba2 = xba*x2a + yba*y2a , sinb12 = det2, sinba2 = t2->det, //zsinba2 = t2->det; // angle b12 > angle ba2 => cotg(angle b12) < cotg(angle ba2) OnSwap = (cosb12 * sinba2) < (cosba2 * sinb12); if(CurrentTh) cout << "swap s1=" << CurrentTh->Number(sa) << " s2=" << CurrentTh->Number(sb) << " t1= " << CurrentTh->Number(t1) << " t2=" << CurrentTh->Number(t2) << " " ; cout << cosb12 << " " << sinba2 << " " << cosba2 << " " << sinb12 << " Onswap = " << OnSwap << endl; break; } else { // critere de Delaunay pure Real8 som; I2 AB=(I2) *sb - (I2) *sa; I2 MAB2=((I2) *sb + (I2) *sa); D2 MAB(MAB2.x*0.5,MAB2.y*0.5); I2 A1=(I2) *s1 - (I2) *sa; I2 D = (I2) * s1 - (I2) * sb ; D2 S2(s2->i.x,s2->i.y); D2 S1(s1->i.x,s1->i.y); D2 SA(sa->i.x,sa->i.y); D2 SB(sb->i.x,sb->i.y); DrawMark(s2->r); DrawMark(s1->r); DrawMark(sa->r); DrawMark(sb->r); { Metric M=s1->m; D2 ABo = M.Orthogonal(SB-SA); D2 A1o = M.Orthogonal(S1-SA); // (A+B)+ x ABo = (S1+B)/2+ y A1 // ABo x - A1o y = (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x); double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2 if (Abs(d) > dd*1.e-3) { D2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d)); cout << "M1 r2 =" << M(C - S2) << " r1 = " << M(C - S1) << "ra = " << M(C - SA) << " rb = " << M(C-SB) ; som = M(C - S2)/M(C - S1); cout << " r1/r2 = " << som << endl; } else {kopt=1;continue;} } { Metric M=s2->m; D2 ABo = M.Orthogonal(SB-SA); D2 A1o = M.Orthogonal(S1-SA); // (A+B)+ x ABo = (S1+B)/2+ y A1 // ABo x - A1o y = (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x); double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2 cout << " d = " << Abs(d) << " dd " << dd << endl; if(Abs(d) > dd*1.e-3) { D2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d)); cout << "M2 r1 =" << M(C - S2) << " r2 = " << M(C - S1) << "ra = " << M(C - SA) << " rb = " << M(C-SB) << " r1/r2 = " << M(C - S2)/M(C - S1) << endl; som += M(C - S2)/M(C - S1); } else {kopt=1;continue;} } { Metric M=sa->m; D2 ABo = M.Orthogonal(SB-SA); D2 A1o = M.Orthogonal(S1-SA); // (A+B)+ x ABo = (S1+B)/2+ y A1 // ABo x - A1o y = (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x); double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2 cout << " d = " << Abs(d) << " dd " << dd << endl; if(Abs(d) > dd*1.e-3) { D2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d)); cout << "M2 r1 =" << M(C - S2) << " r2 = " << M(C - S1) << "ra = " << M(C - SA) << " rb = " << M(C-SB) << " r1/r2 = " << M(C - S2)/M(C - S1) << endl; som += M(C - S2)/M(C - S1); } else {kopt=1;continue;} } { Metric M=sb->m; D2 ABo = M.Orthogonal(SB-SA); D2 A1o = M.Orthogonal(S1-SA); // (A+B)+ x ABo = (S1+B)/2+ y A1 // ABo x - A1o y = (S1+B)/2-(A+B)/2 = (S1-B)/2 = D/2 double dd = Abs(ABo.x*A1o.y)+Abs(ABo.y*A1o.x); double d = (ABo.x*A1o.y - ABo.y*A1o.x)*2; // because D/2 cout << " d = " << Abs(d) << " dd " << dd << endl; if(Abs(d) > dd*1.e-3) { D2 C(MAB+ABo*((D.x*A1o.y - D.y*A1o.x)/d)); cout << "M2 r1 =" << M(C - S2) << " r2 = " << M(C - S1) << "ra = " << M(C - SA) << " rb = " << M(C-SB) << " r1/r2 = " << M(C - S2)/M(C - S1) << endl; som += M(C - S2)/M(C - S1); } else {kopt=1;continue;} } cout << som << endl; OnSwap = som < 4; break; } } // OnSwap } // (! OnSwap &&(det1 > 0) && (det2 > 0) ) } cout << OnSwap << endl; if( OnSwap ) { couleur(0); t1->Draw(); t2->Draw(); bamg::swap(t1,a1,t2,a2,s1,s2,det1,det2); couleur(1); t1->Draw(); t2->Draw(); } else { NbUnSwap ++; t1->SetMarkUnSwap(a1); } return OnSwap; } void GeometricalEdge::Draw(Int4 i) { if (!withrgraphique) return; if (CurrentTh && i<0 && i != -2) { if (CurrentTh->Gh.edges <= this && this < CurrentTh->Gh.edges + CurrentTh->Gh.nbe) i = CurrentTh->Gh.Number((this)); } v[0]->MoveTo(); R2 x,x50; int k=0,k50=0; for (int ii = 0;ii<100;ii++) { x= F( Real4(ii)/100.0); if(ii==50) x50=x,k50=1; if (InPtScreen(x.x,x.y) ) {if(k) rlineto(x.x,x.y); else k=1,rmoveto(x.x,x.y);} } if (InPtScreen(v[1]->r.x,v[1]->r.y)) v[1]->LineTo(); char VertexDraw_i10[20]; if( k50) { if (i<0) sprintf(VertexDraw_i10,"Eg%p",this); else sprintf(VertexDraw_i10,"Eg%ld",i); rmoveto(x50.x,x50.y); plotstring(&VertexDraw_i10[0]); } } void Geometry::InitDraw() const { GrafPMin = vertices[0].r; GrafPMax = vertices[0].r; // recherche des extrema des vertices GrafPMin,GrafPMax Int4 i; for (i=0;i #include #include #include #include #include #include #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD using std::cout; using std::endl; #endif // H5_NO_STD #endif #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; #endif using namespace std; using std::string; using std::vector; typedef long Int4; class WriteHdf5 { private: ofstream hdf5_file; const char * hdf5_filename; Int4 nbofelem; Int4 nbofvertex; Int4 nbvperelem; hid_t file_id; hid_t group_id_data; herr_t status; int dimension; public: WriteHdf5(const char * ffname, Int4 nbelem, Int4 nbvertex); virtual ~WriteHdf5(); void WriteHdf5MeshFile2D(float coordinates[][2], int connec[][3]); void WriteHdf5MeshFile3D(float coordinates[][3], int connec[][4]); void WriteHdf5SolFile2DInit(); void WriteHdf5SolFile2DAddField(string * fieldname, int result_order, int trans_dim, int what_type, float *field); void WriteHdf5SolFile2DFinalize(); void WriteHdf5SolFile3DInit(); void WriteHdf5SolFile3DAddField(string * fieldname, int result_order, int trans_dim, int what_type, float *field); void WriteHdf5SolFile3DFinalize(); }; #endif freefem++-3.61-1/src/bamglib/MeshWrite.cpp000644 000767 000024 00000064374 13256636774 020440 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include "config.h" #include #include #include #include #include "Meshio.h" #include "Mesh2.h" #include "QuadTree.h" #include "SetOfE4.h" #ifdef HAVE_HDF5 //-----------------------------ajout format hdf5-----------------------------// #include "write_xdmf.hpp" #include "write_hdf5.hpp" #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD using std::cout; using std::endl; #endif // H5_NO_STD #endif #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; #endif #endif //-----------------------------ajout format hdf5-----------------------------// namespace bamg { void Triangles::Write(const char * filename,const TypeFileMesh typein ) const { TypeFileMesh type = typein; const char * gsuffix=".gmsh"; int ls=0; int lll = strlen(filename); if (type==AutoMesh) { type = BDMesh; if (!strcmp(filename + lll - (ls=7),".am_fmt")) type = am_fmtMesh; else if (!strcmp(filename + lll - (ls=6),".amdba")) type = amdbaMesh; else if (!strcmp(filename + lll - (ls=3),".am")) type = amMesh; else if (!strcmp(filename + lll - (ls=5),".nopo")) type = NOPOMesh; else if (!strcmp(filename + lll - (ls=4),".msh")) type = mshMesh; //-----------------------------ajout format hdf5-----------------------------// else if (!strcmp(filename + lll - (ls=3),".h5")) type = hdf5Mesh; //-----------------------------ajout format hdf5-----------------------------// else if (!strcmp(filename + lll - (ls=4),".ftq")) type = ftqMesh; else if (!strcmp(filename + lll - (ls=7),".AM_FMT")) type = am_fmtMesh; else if (!strcmp(filename + lll - (ls=6),".AMDBA")) type = amdbaMesh; else if (!strcmp(filename + lll - (ls=3),".AM")) type = amMesh; else if (!strcmp(filename + lll - (ls=5),".NOPO")) type = NOPOMesh; else if (!strcmp(filename + lll - (ls=4),".MSH")) type = mshMesh; else if (!strcmp(filename + lll - (ls=4),".FTQ")) type = ftqMesh; else ls=0; } if (verbosity>1) { cout << " -- Writing the file " << filename << " of type " ; switch (type) { case BDMesh : cout << " BD Mesh " ; break; case NOPOMesh : cout << " NOPO " ; break; case amMesh : cout << " am " ; break; case am_fmtMesh : cout << " am_fmt " ; break; case amdbaMesh : cout << " amdba " ; break; case ftqMesh : cout << " ftq " ; break; case mshMesh : cout << " msh " ; break; //-----------------------------ajout format hdf5-----------------------------// case hdf5Mesh : cout << " h5 " ; break; //-----------------------------ajout format hdf5-----------------------------// default: cerr << endl << " Unkown type mesh file " << (int) type << " for Writing " << filename <5) cout << "end write" << endl; } void Triangles::Write_nop5(OFortranUnFormattedFile * f, Int4 &lnop5,Int4 &nef,Int4 &lgpdn,Int4 ndsr) const { ndsr =0; Int4 * reft = new Int4[nbt]; //Int4 nbInT = ; ConsRefTriangle(reft); Int4 no5l[20]; Int4 i5 = 0; Int4 i,j,k=0,l5; // Int4 ining=0; Int4 imax,imin; lgpdn = 0; nef=0; // construction of a liste linked of edge Edge ** head = new Edge *[nbv]; Edge ** link = new Edge * [nbe]; for (i=0;iref; break; } else e = link[Number(e)]; l5++; } if ( no5l[l5-1] || no5l[l5-2] || no5l[l5-3] ) ining=2; else l5 -= 3; no5l[l5++] = triangles[i][0].ref(); no5l[l5++] = triangles[i][1].ref(); no5l[l5++] = triangles[i][2].ref(); if (ining || no5l[l5-1] || no5l[l5-2] || no5l[l5-3] ) ining= ining ? ining : 3; else l5 -= 3,ining=0; } else if ( &tref; break; } else e = link[Number(e)]; l5++; } if ( no5l[l5-1] || no5l[l5-2] || no5l[l5-3] || no5l[l5-4] ) ining=2; else l5 -= 4; no5l[l5++] = v0->ref(); no5l[l5++] = v1->ref(); no5l[l5++] = v2->ref(); no5l[l5++] = v3->ref(); if (ining || no5l[l5-1] || no5l[l5-2] || no5l[l5-3] || no5l[l5-4] ) ining= ining ? ining : 3; else l5 -= 4; } else l5=0; if (l5) { if (ining) { nef ++; nmae = l5-kining; no5l[kining] = ining; } else l5--; no5l[1]=nmae; // for all ref for (j=kining+1;j 10) { cout << " e[ " << i << " @" << i5 << "]="; for (j=0;j10) cout << " fin write nopo 5 i5=" << i5 << " " << i5*4 << endl; lnop5=i5; lgpdn++; // add 1 delete [] reft; delete [] head; delete [] link; } void Triangles::Write_nopo(ostream &ff) const { Int4 nef=0; Int4 lpgdn=0; Int4 ndsr=0; Int4 i; Int4 ndsd=1; Int4 lnop5=0; OFortranUnFormattedFile f(ff); for (i=0;i=0) { f << Number(triangles[i][0]) +1 << " " ; f << Number(triangles[i][1]) +1 << " " ; f << Number(triangles[i][2]) +1 << " " ; f << endl; } for (i=0;i=0) f << subdomains[reft[i]].ref << (j++%10 == 9 ? '\n' : ' '); f << endl; for (i=0;i=0) { f << Number(triangles[i][0]) +1 ; f << Number(triangles[i][1]) +1 ; f << Number(triangles[i][2]) +1 ; } for (i=0;i=0) f << subdomains[reft[i]].ref; for (i=0;i=0) f << Number(triangles[i][0]) +1 << " " << Number(triangles[i][1]) +1 << " " << Number(triangles[i][2]) +1 << " " << subdomains[reft[i]].ref << endl; for (i=0;i=0) { Connectivity[i][0]=Number(triangles[i][0]); Connectivity[i][1]=Number(triangles[i][1]); Connectivity[i][2]=Number(triangles[i][2]); } } // write hdf5 file WriteHdf5 * Hdf5MeshFile2D = new WriteHdf5(f,nbInT,nbv); Hdf5MeshFile2D->WriteHdf5MeshFile2D(coord, Connectivity); delete Hdf5MeshFile2D; // write xdmf file WriteXdmf * XdmfMeshFile2D = new WriteXdmf(f,nbInT,nbv); XdmfMeshFile2D->WriteXdmfMeshFile2D(); delete XdmfMeshFile2D; delete [] reft; #else cerr << " Sorry no hdf5 on with computer= no Write_hdf5 of" << f << endl; MeshError(9999,this); #endif } //-----------------------------ajout format hdf5-----------------------------// void Triangles::Write_amdba(ostream &f) const { assert(this && nbt); Int4 i,j; Int4 * reft = new Int4[nbt]; Int4 nbInT = ConsRefTriangle(reft); f << nbv << " " << nbInT << endl; cout.precision(12); for (i=0;i=0) f << j++ << " " << Number(triangles[i][0]) +1 << " " << Number(triangles[i][1]) +1 << " " << Number(triangles[i][2]) +1 << " " << subdomains[reft[i]].ref << endl ; f << endl; delete [] reft; } void Triangles::Write(const char * filename) { ofstream f(filename); if (f) { if (name) delete name; name = new char[strlen(filename)+1]; strcpy(name,filename); OnDisk =1; f << *this; } } void Triangles::WriteElements(ostream& f,Int4 * reft ,Int4 nbInT) const { const Triangles & Th= *this; // do triangle and quad if(verbosity>9) cout << " In Triangles::WriteElements " << endl << " Nb of In triangles " << nbInT-Th.NbOfQuad*2 << endl << " Nb of Quadrilaterals " << Th.NbOfQuad << endl << " Nb of in+out+quad triangles " << Th.nbt << " " << nbInT << endl; Int4 k=nbInT-Th.NbOfQuad*2; Int4 num =0; if (k>0) { f << "\nTriangles\n"<< k << endl; for(Int4 i=0;i=0 && !( t.Hidden(0) || t.Hidden(1) || t.Hidden(2) )) { k--; f << Th.Number(t[0])+1 << " " << Th.Number(t[1])+1 << " " << Th.Number(t[2])+1 << " " << Th.subdomains[reft[i]].ref << endl; reft[i] = ++num; } } } if (Th.NbOfQuad>0) { f << "\nQuadrilaterals\n"<OnDisk = 1; Int4 * reft = new Int4[Th.nbt]; Int4 nbInT = Th.ConsRefTriangle(reft); { f << "MeshVersionFormatted 0" < geom in same file f << "\"\"" << endl << endl; f << "# BEGIN of the include geometry file because geometry is not on the disk" << Th.Gh << endl; f << "End" << endl << "# END of the include geometrie file because geometry is not on the disk" << endl ; } } { f.precision(12); f << "\nVertices\n" << Th.nbv <link) // a true triangle { Real8 aa= (Real8) dete[1]/ tb->det, bb= (Real8) dete[2] / tb->det; f << i+1 << " " << Th.BTh.Number(tb)+1 << " " << aa << " " << bb << endl ; } else { double aa,bb,det[3]; TriangleAdjacent ta=CloseBoundaryEdgeV2(I,tb,aa,bb); int k = ta; det[VerticesOfTriangularEdge[k][1]] =aa; det[VerticesOfTriangularEdge[k][0]] = bb; det[OppositeVertex[k]] = 1- aa -bb; Triangle * tb = ta; f << i+1 << Th.BTh.Number(tb)+1 << " " << det[1] << " " << det[2] <1) cout << " -- write geometry in file " << filename << endl; if (name) delete name; name = new char[strlen(filename)+1]; strcpy(name,filename); OnDisk =1; f << *this; } } ostream& operator <<(ostream& f, const Geometry & Gh) { Int4 NbCorner=0; { f << "MeshVersionFormatted 0" < class P2xP2; template class P2 { public: R x,y; P2 () :x(0),y(0) {}; P2 (R a,R b) :x(a),y(b) {} P2 (P2 A,P2 B) : x(B.x-A.x),y(B.y-A.y) {} P2 operator+(const P2 & cc) const {return P2(x+cc.x,y+cc.y);} P2 operator-(const P2 & cc) const {return P2(x-cc.x,y-cc.y);} P2 operator-() const{return P2(-x,-y);} // RR operator*(const P2 & cc) const {return (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} // produit scalaire RR operator,(const P2 & cc) const {return (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} // produit scalaire P2 operator*(R cc) const {return P2(x*cc,y*cc);} // P2 operator*(RR cc) const {return P2((R)(x*cc),(R)(y*cc));} P2 operator/(R cc) const {return P2(x/cc,y/cc);} P2 operator+=(const P2 & cc) {x += cc.x;y += cc.y;return *this;} P2 operator/=(const R r) {x /= r;y /= r;return *this;} P2 operator*=(const R r) {x *= r;y *= r;return *this;} P2 operator-=(const P2 & cc) {x -= cc.x;y -= cc.y;return *this;} // P2 Orthogonal(const P2 r) {return P2(-r.y,r.x);} }; template class P2xP2 { // x ligne 1 y ligne2 friend ostream& operator <<(ostream& f, const P2xP2 & c) { f << '[' << c.x << ',' << c.y << ']' < operator*(P2 c,P2xP2 cc) {return P2(c.x*cc.x.x + c.y*cc.y.x, c.x*cc.x.y + c.y*cc.y.y);} public: P2 x,y; P2xP2 (): x(),y() {} P2xP2 (P2 a,P2 b): x(a),y(b) {} P2xP2 (P2 a,P2 b,P2 c ): x(b-a),y(c-a) {} P2xP2 (R xx,R xy,R yx,R yy) :x(xx,xy),y(yx,yy) {} P2 operator*(const P2 c) const {return P2(x.x*c.x + x.y*c.y, y.x*c.x + y.y*c.y);} P2xP2 operator*(P2xP2 c) const { return P2xP2(x.x*c.x.x + x.y*c.y.x, x.x*c.x.y + x.y*c.y.y, y.x*c.x.x + y.y*c.y.x, y.x*c.x.y + y.y*c.y.y);} RR det() const {return (RR) x.x* (RR) y.y - (RR) x.y * (RR) y.x;} P2xP2 inv() const { RR d = (*this).det(); return P2xP2((R)( y.y /d) ,(R)(-x.y/d),(R)( -y.x/d) ,(R)( x.x/d) ); }; P2xP2 t() {return P2xP2(x.x,y.x,x.y,y.y);} //transposer P2tx() {return P2(x.x,y.x);} P2ty() {return P2(x.y,y.y);} }; //template // transposer //inline P2xP2 t(P2xP2 m) // {return P2xP2(m.x.x,m.y.x,m.x.y,m.y.y);} template inline RR Det(const P2 x,const P2 y) { return (RR) x.x * (RR) y.y - (RR) x.y * (RR) y.x ;} template inline RR Area2 (const P2 a,const P2 b,const P2 c) { return Det(b-a,c-a) ;} template inline R Norme1 (const P2 x) { return (Abs(x.x)+Abs(x.y)) ;} template inline R NormeInfini (const P2 x) { return Max(Abs(x.x),Abs(x.y)) ;} template inline RR Norme2_2 (const P2 x) { return (RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y ;} template inline RR Norme2 (const P2 x) { return sqrt((RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y) ;} template inline P2 Orthogonal (const P2 x) { return P2(-x.y,x.x);} template inline ostream& operator <<(ostream& f, const P2 & c) { f << '[' << c.x << ',' << c.y <<']' < inline P2 Min2(P2 x,P2 y) {return P2(Min(x.x,y.x),Min(x.y,y.y) ;} template inline P2 Max2(P2 x,P2 y) {return P2(Max(x.x,y.x),Max(x.y,y.y) ;} */ } freefem++-3.61-1/src/bamglib/Meshio.h000644 000767 000024 00000015230 13256636774 017405 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include "error.hpp" #include #include #include using namespace std; // PB compilo HP aCC #if defined(__hpux) || defined(__SUNPRO_CC) #define IOS_OPENMODE int #else #define IOS_OPENMODE ios::openmode #endif extern long verbosity ; namespace bamg { extern void (*MeshIstreamErrorHandler)(ios & ); void WriteStr(ostream & out,char * str); double * ReadbbFile(const char * file,long & nbsol,long & lsol,const int dim=2,const int typesol=2); double * ReadBBFile(const char * file,long & nbsol,long & lsol,int *& typesols,const int dim=2,const int typesol=2); // solution at vertex (P1) union Char4orLong { char c[4]; long l;} ; class MeshIstream { public: istream & in ; const char * CurrentFile; // ifstream fin; int LineNumber,LineError,opened; istream & cm ()// mange les blancs et les commentaire { char c; int cmm=0; while ( in.get(c) && ( isspace(c) ? (( ( c=='\n'|| c==char(12) || c==char(15)) && (LineNumber++,cmm=0)),1) : (cmm || (c=='#' && (cmm=1) )) ) ) ((void ) 0); if (in.good()) in.putback(c); return in; } // void rewind(){ fin.clear();fin.seekg(0);} void eol()// go to end of line { char c; while ( in.get(c) && ( c!='\n') && ( c!='\r')) (void) 0; } void ShowIoErr(int ); MeshIstream & err () { if ( ! in.good() ) ShowIoErr(in.rdstate()); return *this; } // MeshIstream(istream & i): in(i),CurrentFile(0),LineNumber(1),LineError(0) {} MeshIstream(const char * file_name) : in(*new ifstream(file_name)),CurrentFile(file_name), LineNumber(1),LineError(0) { if (!in) {cerr << " Error Opening file " << file_name,CurrentFile=0;ShowIoErr(1);} if(verbosity>4) cout << " Openfile : " << file_name << endl;err(); } /* // void close() { if (CurrentFile) { if(verbosity>5) cout << " Closefile: " << CurrentFile << endl; CurrentFile=0;in.close();} } */ int eof(){return in.eof();} ~MeshIstream(){delete ∈} int IsString(const char* s); char * ReadStr(); MeshIstream& operator>>(short& i) { cm() >> i ;return err();} MeshIstream& operator>>(long& i) { cm() >> i ;return err();} MeshIstream& operator>>(int& i) { cm() >> i ;return err();} MeshIstream& operator>>(float& i) { cm() >> i ;return err();} MeshIstream& operator>>(double& i) { cm() >> i ;return err();} MeshIstream& operator>>(char * & i ) { i=ReadStr();return err();} }; // Fortran unformatted file interface ---------- class IFortranUnFormattedFile { // template friend IFortranUnFormattedFile & operator>>(IFortranUnFormattedFile &f,T & l); istream * f; long i,l,n,j,nb_rec; const char * file_name; int to_close; public: IFortranUnFormattedFile(char *name) : f(new ifstream(name)),i(0),l(0),n((long)-sizeof(long)), nb_rec(0),file_name(name), to_close(1) { if(!*f) Error(0);} IFortranUnFormattedFile(MeshIstream & ff) : f(&ff.in),i(0),l(0),n((long)-sizeof(long)),nb_rec(0), file_name(ff.CurrentFile), to_close(0) { if(! *f) Error(0);} ~IFortranUnFormattedFile(); long Record(); long where(){return j-i;} void read4(char *c,int );// for the fortran 77 char4 void read(char * p,const size_t lg); void Error(int); }; class OFortranUnFormattedFile { // template friend OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const T & l); ostream * f; long i,l,n,j,nb_rec; const static char * unkown; const char * file_name; int to_close; public: OFortranUnFormattedFile(const char *name,IOS_OPENMODE mm=ios::trunc) : f(new ofstream(name,mm)),i(0),l(0),n((long) -sizeof(long)),nb_rec(0),file_name(name), to_close(1) { if(!*f) Error(0);} OFortranUnFormattedFile(ostream &ff) : f(&ff),i(0),l(0),n((long) -sizeof(long)),nb_rec(0),file_name(unkown), to_close(0) { if(!*f) Error(0);} ~OFortranUnFormattedFile(); long Record(long ll=0); long where(){return j-i;} void write4(const char *c,int );// for the fortran 77 char4 void write(const char * p,const size_t lg); void Error(int ); }; /// ---------- inline ------------------------- inline void IFortranUnFormattedFile::read(char * p,const size_t lg){ f->read(p,lg); j+=lg; if (j>n) Error(1); else if (!f->good()) Error(2) ; } inline void OFortranUnFormattedFile::write(const char * p,const size_t lg){ f->write(p,lg); j+=lg; if (l && j>n) Error(1); else if (!f->good()) Error(2); } template inline IFortranUnFormattedFile & operator>>(IFortranUnFormattedFile &f,T & l) { f.read((char *) &l,sizeof(l));return f; } /* bug sur sun template inline OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const T & l) { f.write((char *) &l,sizeof(l));return f; } on ex les template */ inline OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const int & l) { f.write((char *) &l,sizeof(l));return f; } inline OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const long & l) { f.write((char *) &l,sizeof(l));return f; } inline OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const double & l) { f.write((char *) &l,sizeof(l));return f; } inline OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const float & l) { f.write((char *) &l,sizeof(l));return f; } inline void OFortranUnFormattedFile::write4(const char *c,int ll) { int i,j; Char4orLong ch4; for ( i=0;i> ch4.l; for (j=0;j<4;j++) *c++= ch4.c[j]; } *c=0;// end of string } } freefem++-3.61-1/src/bamglib/write_xdmf.hpp000644 000767 000024 00000001640 13256636774 020671 0ustar00hechtstaff000000 000000 #ifndef write_xdmf_h_ #define write_xdmf_h_ #include #include #include #include #include using namespace std; using std::string; using std::vector; typedef long Int4; class WriteXdmf { private: const char * WXffname; ofstream xdmf_file; char * Elemtype; Int4 nbofelem; Int4 nbofvertex; Int4 nbvperelem; char * xdmf_filename; int dimension; public: WriteXdmf(const char * ffname, Int4 nbelem, Int4 nbvertex); virtual ~WriteXdmf(); void WriteXdmfMeshFile2D(); void WriteXdmfMeshFile3D(); void WriteXdmfSolFile2DInit(); void WriteXdmfSolFile2DAddField(string * fieldname, int data_type, int result_order, int trans_dim); void WriteXdmfSolFile2DFinalize(); void WriteXdmfSolFile3DInit(); void WriteXdmfSolFile3DAddField(string * fieldname, int data_type, int result_order, int trans_dim); void WriteXdmfSolFile3DFinalize(); }; #endif freefem++-3.61-1/src/bamglib/Metric.h000644 000767 000024 00000017520 13256636774 017410 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef TYPEMETRIX #define TYPEMETRIX MetricAnIso #endif //#include "R2.h" namespace bamg { typedef P2 D2; typedef P2xP2 D2xD2; class MetricAnIso; class MatVVP2x2; class MetricIso; typedef TYPEMETRIX Metric; class MetricIso{ friend class MatVVP2x2; Real4 h; public: MetricIso(Real4 a): h(a){} MetricIso(const MetricAnIso M);// {MatVVP2x2 vp(M);h=1/sqrt(Max(vp.lambda1,vp.lambda2));} MetricIso(Real8 a11,Real8 a21,Real8 a22);// {*this=MetricAnIso(a11,a21,a22));} MetricIso(): h(1) {}; // MetricIso(const Real8 a[3],const MetricIso m0, const MetricIso m1,const MetricIso m2 ) : h(hinterpole ? (a[0]*m0.h+a[1]*m1.h+a[2]*m2.h) : 1/sqrt(a[0]/(m0.h*m0.h)+a[1]/(m1.h*m1.h)+a[2]/(m2.h*m2.h))) {} MetricIso(const Real8 a,const MetricIso ma, const Real8 b,const MetricIso mb) : h(hinterpole ? a*ma.h+b*mb.h :1/sqrt(a/(ma.h*ma.h)+b/(mb.h*mb.h))) {} R2 Orthogonal(const R2 A)const {return R2(-h*A.y,h*A.x);} R2 Orthogonal(const I2 A)const {return R2(-h*A.y,h*A.x);} // D2 Orthogonal(const D2 A)const {return D2(-h*A.y,h*A.x);} Real8 operator()(R2 x) const { return sqrt((x,x))/h;}; Real8 operator()(R2 x,R2 y) const { return ((x,y))/(h*h);}; int IntersectWith(MetricIso M) {int r=0;if (M.h>(istream& f, MatVVP2x2 & c) { f >> c.lambda1 >>c.lambda2 >> c.v.x >> c.v.y ;c.v /= Norme2(c.v); return f; } MatVVP2x2(const MetricAnIso ); MatVVP2x2(const MetricIso M) : lambda1(1/(M.h*M.h)),lambda2(1/(M.h*M.h)),v(1,0) {} Real8 hmin() const {return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));} Real8 hmax() const {return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));} Real8 lmax() const {return bamg::Max3(lambda1,lambda2,1e-30);} Real8 lmin() const {return bamg::Max(bamg::Min(lambda1,lambda2),1e-30);} Real8 Aniso2() const { return lmax()/lmin();} inline void BoundAniso2(const Real8 coef); Real8 Aniso() const { return sqrt( Aniso2());} void BoundAniso(const Real8 c){ BoundAniso2(1/(c*c));} void operator *=(double coef){ lambda1*=coef;lambda2*=coef;} }; inline void MatVVP2x2::BoundAniso2(const Real8 coef) { if (coef<=1.00000000001) if (lambda1 < lambda2) lambda1 = bamg::Max(lambda1,lambda2*coef); else lambda2 = bamg::Max(lambda2,lambda1*coef); else // a verifier if (lambda1 > lambda2) lambda1 = bamg::Min(lambda1,lambda2*coef); else lambda2 = bamg::Min(lambda2,lambda1*coef); } void ReductionSimultanee( MetricAnIso M1, MetricAnIso M2,double & l1,double & l2, D2xD2 & V) ; inline MetricAnIso::MetricAnIso(const MatVVP2x2 M) { // recompose M in: M = V^t lambda V // V = ( v,v^\perp) // where v^\perp = (-v_1,v_0) double v00=M.v.x*M.v.x; double v11=M.v.y*M.v.y; double v01=M.v.x*M.v.y; a11=v00*M.lambda1+v11*M.lambda2; a21=v01*(M.lambda1-M.lambda2); a22=v00*M.lambda2+v11*M.lambda1; } inline void MetricAnIso::Box(Real4 &hx,Real4 &hy) const { Real8 d= a11*a22-a21*a21; hx = sqrt(a22/d); hy = sqrt(a11/d); // cerr << " hx = " << hx << " hy = " << hy << endl; } inline MetricIso::MetricIso(const MetricAnIso M) {MatVVP2x2 vp(M);h=1/sqrt(Max(vp.lambda1,vp.lambda2));} inline MetricIso::MetricIso(Real8 a11,Real8 a21,Real8 a22) {MatVVP2x2 vp(MetricAnIso(a11,a21,a22));h=1/sqrt(Max(vp.lambda1,vp.lambda2));} class SaveMetricInterpole { friend Real8 LengthInterpole(const MetricAnIso ,const MetricAnIso , R2 ); friend Real8 abscisseInterpole(const MetricAnIso ,const MetricAnIso , R2 ,Real8 ,int ); int opt; Real8 lab; Real8 L[1024],S[1024]; }; extern SaveMetricInterpole LastMetricInterpole; // for optimization Real8 LengthInterpole(const MetricAnIso Ma,const MetricAnIso Mb, R2 AB); Real8 abscisseInterpole(const MetricAnIso Ma,const MetricAnIso Mb, R2 AB,Real8 s,int optim=0); inline Real8 LengthInterpole(Real8 la,Real8 lb) { return ( Abs(la - lb) < 1.0e-6*Max3(la,lb,1.0e-20) ) ? (la+lb)/2 : la*lb*log(la/lb)/(la-lb);} inline Real8 abscisseInterpole(Real8 la,Real8 lb,Real8 lab,Real8 s) { return ( Abs(la - lb) <1.0e-6*Max3(la,lb,1.0e-20)) ? s : (exp(s*lab*(la-lb)/(la*lb))-1)*lb/(la-lb);} } freefem++-3.61-1/src/bamglib/meshtype.h000644 000767 000024 00000004702 13256636774 020021 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #ifndef MESHTYPE_H #define MESHTYPE_H #include namespace bamg { template inline T Square (const T &a) { return a*a;} template inline T Min (const T &a,const T &b){return a < b ? a : b;} template inline T Max (const T &a,const T & b){return a > b ? a : b;} template inline T Abs (const T &a){return a <0 ? -a : a;} template inline double Norme (const T &a){return sqrt(a*a);} template inline void Exchange (T& a,T& b) {T c=a;a=b;b=c;} // for pb on microsoft compiler template inline T Max3 (const T &a,const T & b,const T & c){return Max(Max(a,b),c);} template inline T Min3 (const T &a,const T & b,const T & c){return Min(Min(a,b),c);} typedef float Real4; typedef double Real8; typedef short Int1; typedef short Int2; typedef long Int4; #if LONG_BIT > 63 // for alpha and silicon typedef int Icoor1; typedef long Icoor2; const Icoor1 MaxICoor = 1073741823; // 2^30-1 const Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ; #elif defined(BAMG_LONG_LONG) typedef long Icoor1; typedef long long Icoor2; const Icoor1 MaxICoor = 1073741823;// 2^30-1 // not a const due to a bug in hp compiler #define MaxICoor22 2305843004918726658LL //const Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ; #else typedef int Icoor1; typedef double Icoor2; const Icoor1 MaxICoor = 8388608; // 2^23 const Icoor2 MaxICoor22 = Icoor2(2)*Icoor2(MaxICoor) * Icoor2(MaxICoor) ; #endif class Triangles; extern void MeshError(int Err,const Triangles *Th=0) ; } #endif freefem++-3.61-1/src/bamglib/Mesh2.h000644 000767 000024 00000136704 13256636774 017151 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include #include #include #if (defined(unix) || defined(__unix)) && !defined(__AIX) #define SYSTIMES #include #include #endif #ifdef DRAWING #include "rgraph.hpp" #endif extern long verbosity; extern int SHOW; #include "meshtype.h" #include "error.hpp" #include "R2.h" namespace bamg { const double Pi = 3.14159265358979323846264338328; const float fPi = 3.14159265358979323846264338328; class MeshIstream; class OFortranUnFormattedFile; class IFortranUnFormattedFile; extern int hinterpole; typedef P2 I2; inline int BinaryRand(){ #ifdef RAND_MAX const long HalfRandMax = RAND_MAX/2; return rand() R2; typedef P2xP2 I2xI2; typedef P2 R2xR2; } #include "Metric.h" namespace bamg { inline float OppositeAngle(float a) {return a<0 ? fPi + a :a - fPi ;} inline double OppositeAngle(double a) {return a<0 ? Pi + a :a - Pi ;} #ifdef DRAWING extern Real4 xGrafCoef,yGrafCoef,xGrafOffSet,yGrafOffSet; extern R2 GrafPMin,GrafPMax; extern Real8 Grafh; #endif Icoor2 inline det(const I2 &a,const I2 & b,const I2 &c) { Icoor2 bax = b.x - a.x ,bay = b.y - a.y; Icoor2 cax = c.x - a.x ,cay = c.y - a.y; return bax*cay - bay*cax;} // def de numerotation dans un triangles static const Int2 VerticesOfTriangularEdge[3][2] = {{1,2},{2,0},{0,1}}; static const Int2 EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}}; static const Int2 OppositeVertex[3] = {0,1,2}; static const Int2 OppositeEdge[3] = {0,1,2}; static const Int2 NextEdge[3] = {1,2,0}; static const Int2 PreviousEdge[3] = {2,0,1}; static const Int2 NextVertex[3] = {1,2,0}; static const Int2 PreviousVertex[3] = {2,0,1}; Int4 AGoodNumberPrimeWith(Int4 n); // remark all the angle are in radian beetwen [-Pi,Pi] class Geometry; //static Geometry *NULLGeometry=0; class Triangles; class Triangle; class QuadTree; class GeometricalEdge; class VertexOnGeom; class VertexOnEdge; ///////////////////////////////////////////////////////////////////////////////////// const int IsVertexOnGeom = 8; const int IsVertexOnVertex = 16; const int IsVertexOnEdge = 32; ///////////////////////////////////////////////////////////////////////////////////// #ifndef NOTFREEFEM class ErrorMesh : public Error { public: const Triangles *Th; ErrorMesh(const char * Text,int l,const Triangles * TTh=0, const char *t2="") : Error(MESH_ERROR,"Meshing error: ",Text,"\n number : ",l,", ",t2),Th(TTh) {} }; #endif class Direction { // private: Icoor1 dir; public: Direction(): dir(MaxICoor){}; // no direction set Direction(Icoor1 i,Icoor1 j) { Icoor2 n2 = 2*(Abs(i)+Abs(j)); Icoor2 r = MaxICoor* (Icoor2) i; Icoor1 r1 = (Icoor1) (2*(r/ n2)); // odd number dir = (j>0) ? r1 : r1+1; // odd -> j>0 even -> j<0 } int sens( Icoor1 i,Icoor1 j) { int r =1; if (dir!= MaxICoor) { Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y(dir%2?-y1:y1); r = (x*i + y*j) >=0;} return r;} #ifdef DRAWING void Draw() { if (dir!= MaxICoor) { Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y(dir%2?-y1:y1); R2 D(x,y); double eps = Grafh/Norme2(D)/20; D = D*eps; rmoveto(D.x,D.y); } } #endif }; ///////////////////////////////////////////////////////////////////////////////////// class Vertex {public: I2 i; // allow to use i.x, and i.y in long int (beware of scale and centering) R2 r; // allow to use r.x, and r.y in double Metric m; Int4 ReferenceNumber; Direction DirOfSearch; union { Triangle * t; // one triangle which contained the vertex Int4 color; Vertex * to;// use in geometry Vertex to now the Mesh Vertex associed VertexOnGeom * on; // if vint 8; // set with Triangles::SetVertexFieldOn() Vertex * onbv; // if vint == 16 on Background vertex Triangles::SetVertexFieldOnBTh() VertexOnEdge * onbe; // if vint == 32 on Background edge }; Int1 vint; // the vertex number in triangle; varies between 0 and 2 in t operator I2 () const {return i;} // operator de cast operator const R2 & () const {return r;}// operator de cast // operator R2 & () {return r;}// operator de cast Real8 operator()(R2 x) const { return m(x);} operator Metric () const {return m;}// operator de cast Int4 Optim(int = 1,int =0); // Vertex(){} // ~Vertex(){} Real8 Smoothing(Triangles & ,const Triangles & ,Triangle * & ,Real8 =1); int ref() const { return ReferenceNumber;} friend ostream& operator <<(ostream& f, const Vertex & v) {f << "(" << v.i << "," << v.r << MatVVP2x2(v.m) << ")" ; return f;} inline void Set(const Vertex & rec,const Triangles &,Triangles &); #ifdef DRAWING void Draw(Int4 =-1) const ; void MoveTo() const { rmoveto(r.x,r.y); } void LineTo() const { rlineto(r.x,r.y); } #endif }; double QuadQuality(const Vertex &,const Vertex &,const Vertex &,const Vertex &); // extern Vertex *Meshend , *Meshbegin; ///////////////////////////////////////////////////////////////////////////////////// class TriangleAdjacent { friend ostream& operator <<(ostream& f, const TriangleAdjacent & ta) {f << "{" << ta.t << "," << ((int) ta.a) << "}" ; return f;} public: Triangle * t; // le triangle int a; // le numero de l arete TriangleAdjacent(Triangle * tt,int aa): t(tt),a(aa &3) {}; TriangleAdjacent() {}; operator Triangle * () const {return t;} operator Triangle & () const {return *t;} operator int() const {return a;} TriangleAdjacent & operator++() { a= NextEdge[a]; return *this;} TriangleAdjacent operator--() { a= PreviousEdge[a]; return *this;} inline TriangleAdjacent Adj() const ; int swap(); inline void SetAdj2(const TriangleAdjacent& , int =0); inline Vertex * EdgeVertex(const int &) const ; inline Vertex * OppositeVertex() const ; inline Icoor2 & det() const; inline int Locked() const ; inline int GetAllFlag_UnSwap() const ; inline void SetLock(); inline int MarkUnSwap() const; inline void SetMarkUnSwap(); inline void SetCracked(); inline int Cracked() const ; };// end of Vertex class ///////////////////////////////////////////////////////////////////////////////////// class Edge { public: Vertex * v[2]; Int4 ref; GeometricalEdge * on; Vertex & operator[](int i){return *v[i];}; Vertex * operator()(int i){return v[i];}; void ReNumbering(Vertex *vb,Vertex *ve, Int4 *renu) { if (v[0] >=vb && v[0] =vb && v[1] no continuite GeometricalEdge * Adj [2]; int SensAdj[2]; // private: int flag ; public: GeometricalEdge * link; // if Cracked() or Equi() // end of data GeometricalVertex & operator[](int i){return *v[i];}; const GeometricalVertex & operator[](int i) const { return *v[i];}; GeometricalVertex * operator()(int i){return v[i];}; // inline void Set(const Geometry &,Int4,Geometry &); R2 F(Real8 theta) const ; // parametrization of the curve edge Real8 R1tg(Real8 theta,R2 &t) const ; // 1/radius of curvature + tangente int Cracked() const {return flag & 1;} int Dup() const { return flag & 32;} int Equi()const {return flag & 2;} int ReverseEqui()const {return flag & 128;} int TgA()const {return flag &4;} int TgB()const {return flag &8;} int Tg(int i) const{return i==0 ? TgA() : TgB();} int Mark()const {return flag &16;} int Required() { return flag & 64;} void SetCracked() { flag |= 1;} void SetDup() { flag |= 32;} // not a real edge void SetEqui() { flag |= 2;} void SetTgA() { flag|=4;} void SetTgB() { flag|=8;} void SetMark() { flag|=16;} void SetUnMark() { flag &= 1007 /* 1023-16*/;} void SetRequired() { flag |= 64;} void SetReverseEqui() {flag |= 128;} inline void Set(const GeometricalEdge & rec,const Geometry & Th ,Geometry & ThNew); #ifdef DRAWING void Draw(Int4 =-1); #endif }; class Curve {public: GeometricalEdge * be,*ee; // begin et end edge int kb,ke; // begin vetex and end vertex Curve *next; // next curve equi to this bool master; // true => of equi curve point on this curve inline void Set(const Curve & rec,const Geometry & Th ,Geometry & ThNew); Curve() : be(0),ee(0),kb(0),ke(0),next(0),master(true) {} void Reverse() { Exchange(be,ee); Exchange(kb,ke);} // revese the sens of the curse }; ///////////////////////////////////////////////////////////////////////////////////// class Triangle { friend class TriangleAdjacent; friend ostream& operator <<(ostream& f, const Triangle & ta); private: // les arete sont opposes a un sommet Vertex * ns [3]; // 3 vertices if t is triangle, t[i] allowed by access function, (*t)[i] if pointer Triangle * at [3]; // nu triangle adjacent Int1 aa[3]; // les nu des arete dans le triangles (mod 4) public: Icoor2 det; // determinant du triangle (2 fois l aire des vertices entieres) union { Triangle * link ; Int4 color; }; void SetDet() { if(ns[0] && ns[1] && ns[2]) det = bamg::det(*ns[0],*ns[1],*ns[2]); else det = -1; } Triangle() {} Triangle(Triangles *Th,Int4 i,Int4 j,Int4 k); Triangle(Vertex *v0,Vertex *v1,Vertex *v2); 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 =tb && at[0] =tb && at[1] =tb && at[2] =vb && ns[0] =vb && ns[1] =vb && ns[2] at[aatt]=this; tt->aa[aatt]=a + (aa[a] & 60 ) ;}// Copy all the mark } void SetAdj2(Int1 a,Triangle *t,Int1 aat) { at[a]=t;aa[a]=aat; if(t) {t->at[aat]=this;t->aa[aat]=a;} } void SetTriangleContainingTheVertex() { if (ns[0]) (ns[0]->t=this,ns[0]->vint=0); if (ns[1]) (ns[1]->t=this,ns[1]->vint=1); if (ns[2]) (ns[2]->t=this,ns[2]->vint=2); } int swap(Int2 a1,int=0); Int4 Optim(Int2 a,int =0); int Locked(int a)const { return aa[a]&4;} int Hidden(int a)const { return aa[a]&16;} int Cracked(int a) const { return aa[a] & 32;} // for optimisation int GetAllflag(int a){return aa[a] & 1020;} void SetAllFlag(int a,int f){aa[a] = (aa[a] &3) + (1020 & f);} void SetHidden(int a){ Triangle * t = at[a]; if(t) t->aa[aa[a] & 3] |=16; aa[a] |= 16;} void SetCracked(int a){ Triangle * t = at[a]; if(t) t->aa[aa[a] & 3] |=32; aa[a] |= 32;} double QualityQuad(int a,int option=1) const; Triangle * Quadrangle(Vertex * & v0,Vertex * & v1,Vertex * & v2,Vertex * & v3) const ; void SetLocked(int a){ Triangle * t = at[a]; t->aa[aa[a] & 3] |=4; aa[a] |= 4;} void SetMarkUnSwap(int a){ Triangle * t = at[a]; t->aa[aa[a] & 3] |=8; aa[a] |=8 ;} void SetUnMarkUnSwap(int a){ Triangle * t = at[a]; t->aa[aa[a] & 3] &=55; // 23 + 32 aa[a] &=55 ;} #ifdef DEBUG void inline checka(Int1 a); void inline check(); #endif #ifdef DRAWING void Draw(Int4 i=-1) const; int swapDRAW(Int2 a1); #endif }; // end of Triangle class class ListofIntersectionTriangles { ///////////////////////////////////////////////////////////////////////////////////// class IntersectionTriangles { public: Triangle *t; Real8 bary[3]; // use if t != 0 R2 x; Metric m; Real8 s;// abscisse curviline Real8 sp; // len of the previous seg in m Real8 sn;// len of the next seg in m }; ///////////////////////////////////////////////////////////////////////////////////// class SegInterpolation { public: GeometricalEdge * e; Real8 sBegin,sEnd; // abscisse of the seg on edge parameter Real8 lBegin,lEnd; // length abscisse set in ListofIntersectionTriangles::Length int last;// last index in ListofIntersectionTriangles for this Sub seg of edge R2 F(Real8 s){ Real8 c01=lEnd-lBegin, c0=(lEnd-s)/c01, c1=(s-lBegin)/c01; assert(lBegin<= s && s <=lEnd); return e->F(sBegin*c0+sEnd*c1);} }; int MaxSize; // int Size; // Real8 len; // int state; IntersectionTriangles * lIntTria; int NbSeg; int MaxNbSeg; SegInterpolation * lSegsI; public: IntersectionTriangles & operator[](int i) {return lIntTria[i];} operator int&() {return Size;} ListofIntersectionTriangles(int n=256,int m=16) : MaxSize(n), Size(0), len(-1),state(-1),lIntTria(new IntersectionTriangles[n]) , NbSeg(0), MaxNbSeg(m), lSegsI(new SegInterpolation[m]) { if (verbosity>9) cout << " construct ListofIntersectionTriangles" << MaxSize << " " << MaxNbSeg<< endl;}; ~ListofIntersectionTriangles(){ if (lIntTria) delete [] lIntTria,lIntTria=0; if (lSegsI) delete [] lSegsI,lSegsI=0;} void init(){state=0;len=0;Size=0;} int NewItem(Triangle * tt,Real8 d0,Real8 d1,Real8 d2); int NewItem(R2,const Metric & ); void NewSubSeg(GeometricalEdge *e,Real8 s0,Real8 s1) { if (NbSeg>=MaxNbSeg) { int mneo= MaxNbSeg; MaxNbSeg *= 2; if (verbosity>3) cout <<" reshape lSegsI from " << mneo << " to " << MaxNbSeg <3) cout << " ListofIntersectionTriangles ReShape MaxSize " << MaxSize << " -> " << newsize << endl; MaxSize = newsize; delete [] lIntTria;// remove old lIntTria = nw; // copy pointer } void SplitEdge(const Triangles & ,const R2 &,const R2 &,int nbegin=0); Real8 Length(); Int4 NewPoints(Vertex *,Int4 & nbv,Int4 nbvx); }; ///////////////////////////////////////////////////////////////////////////////////// class GeometricalSubDomain { public: GeometricalEdge *edge; int sens; // -1 or 1 Int4 ref; inline void Set(const GeometricalSubDomain &,const Geometry & ,const Geometry &); }; ///////////////////////////////////////////////////////////////////////////////////// class SubDomain { public: Triangle * head; Int4 ref; int sens; // -1 or 1 Edge * edge; // to geometrical inline void Set(const Triangles &,Int4,Triangles &); }; ///////////////////////////////////////////////////////////////////////////////////// class VertexOnGeom { public: Vertex * mv; Real8 abscisse; union{ GeometricalVertex * gv; // if abscisse <0; GeometricalEdge * ge; // if abscisse in [0..1] }; inline void Set(const VertexOnGeom&,const Triangles &,Triangles &); 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 = " <Required():0):0 )) ;} void SetOn(){mv->on=this;mv->vint=IsVertexOnGeom;} friend ostream& operator <<(ostream& f, const VertexOnGeom & vog){ f << vog.abscisse << " " << vog.mv << " " << vog.gv << " ; "; if (vog.abscisse < 0) f << *vog.gv << " ;; " ; // else f << *vog.ge << " ;; " ; return f;} inline void Set(const Triangles &,Int4,Triangles &); }; ///////////////////////////////////////////////////////////////////////////////////// class VertexOnVertex {public: Vertex * v, *bv; VertexOnVertex(Vertex * w,Vertex *bw) :v(w),bv(bw){} VertexOnVertex() {}; inline void Set(const Triangles &,Int4,Triangles &); void SetOnBTh(){v->onbv=bv;v->vint=IsVertexOnVertex;} }; ///////////////////////////////////////////////////////////////////////////////////// class VertexOnEdge {public: Vertex * v; Edge * be; Real8 abcisse; VertexOnEdge( Vertex * w, Edge *bw,Real8 s) :v(w),be(bw),abcisse(s) {} VertexOnEdge(){} inline void Set(const Triangles &,Int4,Triangles &); void SetOnBTh(){v->onbe=this;v->vint=IsVertexOnEdge;} Vertex & operator[](int i) const { return (*be)[i];} operator Real8 () const { return abcisse;} operator Vertex * () const { return v;} operator Edge * () const { return be;} }; inline TriangleAdjacent FindTriangleAdjacent(Edge &E); inline Vertex * TheVertex(Vertex * a); // for remove crak in mesh ///////////////////////////////////////////////////////////////////////////////////// class CrackedEdge { // a small class to store on crack an uncrack information friend class Triangles; friend ostream& operator <<(ostream& f, const Triangles & Th) ; class CrackedTriangle { friend class Triangles; friend class CrackedEdge; friend ostream& operator <<(ostream& f, const Triangles & Th) ; Triangle * t; // edge of triangle t int i; // edge number of in triangle Edge *edge; // the 2 edge Vertex *New[2]; // new vertex number CrackedTriangle() : t(0),i(0),edge(0) { New[0]=New[1]=0;} CrackedTriangle(Edge * a) : t(0),i(0),edge(a) { New[0]=New[1]=0;} void Crack(){ Triangle & T(*t); int i0=VerticesOfTriangularEdge[i][0]; int i1=VerticesOfTriangularEdge[i][0]; assert(New[0] && New[1]); T(i0) = New[0]; T(i1) = New[1];} void UnCrack(){ Triangle & T(*t); int i0=VerticesOfTriangularEdge[i][0]; int i1=VerticesOfTriangularEdge[i][0]; assert(New[0] && New[1]); T(i0) = TheVertex(T(i0)); T(i1) = TheVertex(T(i1));} void Set() { TriangleAdjacent ta ( FindTriangleAdjacent(*edge)); t = ta; i = ta; New[0] = ta.EdgeVertex(0); New[1] = ta.EdgeVertex(1); // warning the ref } }; // end of class CrackedTriangle public: CrackedTriangle a,b; CrackedEdge() :a(),b() {} CrackedEdge(Edge * start, Int4 i,Int4 j) : a(start+i),b(start+j) {}; CrackedEdge(Edge * e0, Edge * e1 ) : a(e0),b(e1) {}; void Crack() { a.Crack(); b.Crack();} void UnCrack() { a.UnCrack(); b.UnCrack();} void Set() { a.Set(), b.Set();} }; ///////////////////////////////////////////////////////////////////////////////////// class Triangles { public: enum TypeFileMesh { AutoMesh=0,BDMesh=1,NOPOMesh=2,amMesh=3,am_fmtMesh=4,amdbaMesh=5, //-----------------------------ajout format hdf5-----------------------------// // ftqMesh=6,mshMesh=7}; ftqMesh=6,mshMesh=7,hdf5Mesh=8}; //-----------------------------ajout format hdf5-----------------------------// int static counter; // to kown the number of mesh in memory int OnDisk; // true if on disk Geometry & Gh; // Geometry Triangles & BTh; // Background Mesh Bth==*this =>no background Int4 NbRef; // counter of ref on the this class if 0 we can delete Int4 nbvx,nbtx; // nombre max de sommets , de triangles Int4 nt,nbv,nbt,nbiv,nbe; // nb of legal triangles, nb of vertex, of triangles, // of initial vertices, of edges with reference, Int4 NbOfQuad; // nb of quadrangle Int4 NbSubDomains; // Int4 NbOutT; // Nb of oudeside triangle Int4 NbOfTriangleSearchFind; Int4 NbOfSwapTriangle; char * name, *identity; Vertex * vertices; // data of vertices des sommets Int4 NbVerticesOnGeomVertex; VertexOnGeom * VerticesOnGeomVertex; Int4 NbVerticesOnGeomEdge; VertexOnGeom * VerticesOnGeomEdge; Int4 NbVertexOnBThVertex; VertexOnVertex *VertexOnBThVertex; Int4 NbVertexOnBThEdge; VertexOnEdge *VertexOnBThEdge; Int4 NbCrackedVertices; Int4 NbCrackedEdges; CrackedEdge *CrackedEdges; R2 pmin,pmax; // extrema Real8 coefIcoor; // coef to integer Icoor1; Triangle * triangles; Edge * edges; QuadTree *quadtree; Vertex ** ordre; SubDomain * subdomains; ListofIntersectionTriangles lIntTria; int warning ; // end of variable Triangles(Int4 i);//:BTh(*this),Gh(*new Geometry()){PreInit(i);} void clear(); ~Triangles() {if(NbRef==0) {clear();NbRef=-1;}} Triangles(const char * ,Real8=-1) ; Triangles(Int4 nbvx,Triangles & BT,int keepBackVertices=1) :Gh(BT.Gh),BTh(BT) { try {GeomToTriangles1(nbvx,keepBackVertices);} catch(...) { this->clear(); throw; } } Triangles(Int4 nbvx,Geometry & G) :Gh(G),BTh(*this){ try { GeomToTriangles0(nbvx);} catch(...) { this->clear(); throw; } } Triangles(Triangles &,Geometry * pGh=0,Triangles* pBTh=0,Int4 nbvxx=0 ); // COPY OPERATEUR // Triangles(Triangles &){ cerr << " BUG call copy opretor of Triangles" << endl;MeshError(111);} Triangles(const Triangles &,const int *flag,const int *bb); // truncature void SetIntCoor(const char * from =0); // void RandomInit(); // void CubeInit(int ,int); Real8 MinimalHmin() const {return 2.0/coefIcoor;} Real8 MaximalHmax() const {return Max(pmax.x-pmin.x,pmax.y-pmin.y);} const Vertex & operator[] (Int4 i) const { return vertices[i];}; Vertex & operator[](Int4 i) { return vertices[i];}; const Triangle & operator() (Int4 i) const { return triangles[i];}; Triangle & operator()(Int4 i) { return triangles[i];}; I2 toI2(const R2 & P) const { return I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );} R2 toR2(const I2 & P) const { return R2( (double) P.x/coefIcoor+pmin.x, (double) P.y/coefIcoor+pmin.y);} void Add( Vertex & s,Triangle * t,Icoor2 * =0) ; void Insert(); // void InsertOld(); void ForceBoundary(); void Heap(); void FindSubDomain(int ); Int4 ConsRefTriangle(Int4 *) const; void ShowHistogram() const; void ShowRegulaty() const; // Add FH avril 2007 // void ConsLinkTriangle(); void ReMakeTriangleContainingTheVertex(); void UnMarkUnSwapTriangle(); void SmoothMetric(Real8 raisonmax) ; void BoundAnisotropy(Real8 anisomax,double hminaniso= 1e-100) ; void MaxSubDivision(Real8 maxsubdiv); void WriteMetric(ostream &,int iso) ; Edge** MakeGeometricalEdgeToEdge(); void SetVertexFieldOn(); void SetVertexFieldOnBTh(); Int4 SplitInternalEdgeWithBorderVertices(); void MakeQuadrangles(double costheta); int SplitElement(int choice); void MakeQuadTree(); void NewPoints( Triangles &,int KeepBackVertex =1 ); Int4 InsertNewPoints(Int4 nbvold,Int4 & NbTSwap) ; void NewPointsOld( Triangles & ); void NewPoints(int KeepBackVertex=1){ NewPoints(*this,KeepBackVertex);} void ReNumberingTheTriangleBySubDomain(bool justcompress=false); void ReNumberingVertex(Int4 * renu); void SmoothingVertex(int =3,Real8=0.3); Metric MetricAt (const R2 &) const; GeometricalEdge * ProjectOnCurve( Edge & AB, Vertex & A, Vertex & B,Real8 theta, Vertex & R,VertexOnEdge & BR,VertexOnGeom & GR); void WriteElements(ostream& f,Int4 * reft ,Int4 nbInT) const; Int4 Number(const Triangle & t) const { return &t - triangles;} Int4 Number(const Triangle * t) const { return t - triangles;} Int4 Number(const Vertex & t) const { return &t - vertices;} Int4 Number(const Vertex * t) const { return t - vertices;} Int4 Number(const Edge & t) const { return &t - edges;} Int4 Number(const Edge * t) const { return t - edges;} Int4 Number2(const Triangle * t) const { // if(t>= triangles && t < triangles + nbt ) return t - triangles; // else return t - OutSidesTriangles; } Vertex * NearestVertex(Icoor1 i,Icoor1 j) ; Triangle * FindTriangleContening(const I2 & ,Icoor2 [3],Triangle *tstart=0) const; void Write(const char * filename,const TypeFileMesh type = AutoMesh) const; void Write_am_fmt(ostream &) const ; void Write_am(ostream &) const ; void Write_ftq(ostream &) const ; void Write_nopo(ostream &) const ; void Write_msh(ostream &) const ; //-----------------------------ajout format hdf5-----------------------------// void Write_hdf5(const char * filename) const ; //-----------------------------ajout format hdf5-----------------------------// void Write_amdba(ostream &) const ; void Read(MeshIstream &,int version,Real8 cutoffradian); void Read_am_fmt(MeshIstream &); void Read_amdba(MeshIstream &); void Read_am(MeshIstream &); void Read_nopo(MeshIstream &); void Read_ftq(MeshIstream &); void Read_msh(MeshIstream &); void ReadMetric(const char * fmetrix,const Real8 hmin,const Real8 hmax,const Real8 coef); void IntersectConsMetric(const double * s,const Int4 nbsol,const int * typsols, const Real8 hmin,const Real8 hmax, const Real8 coef, const Real8 anisomax,const Real8 CutOff=1.e-4,const int NbJacobi=1, const int DoNormalisation=1, const double power=1.0, const int choise=0); void IntersectGeomMetric(const Real8 err,const int iso); int isCracked() const {return NbCrackedVertices != 0;} int Crack(); int UnCrack(); #ifdef DEBUG void inline Check(); #endif #ifdef DRAWING void Draw() const ; void InitDraw() const ; void inquire() ; #endif friend ostream& operator <<(ostream& f, const Triangles & Th); void Write(const char * filename); void ConsGeometry(Real8 =-1.0,int *equiedges=0); // construct a geometry if no geo void FillHoleInMesh() ; int CrackMesh(); private: void GeomToTriangles1(Int4 nbvx,int KeepBackVertices=1);// the real constructor mesh adaption void GeomToTriangles0(Int4 nbvx);// the real constructor mesh generator void PreInit(Int4,char * =0 ); // void Write_nop5(OFortranUnFormattedFile * f, Int4 &lnop5,Int4 &nef,Int4 &lgpdn,Int4 ndsr) const ; }; // End Class Triangles ///////////////////////////////////////////////////////////////////////////////////// class Geometry { public: int OnDisk; Int4 NbRef; // counter of ref on the this class if 0 we can delete char *name; Int4 nbvx,nbtx; // nombre max de sommets , de Geometry Int4 nbv,nbt,nbiv,nbe; // nombre de sommets, de Geometry, de sommets initiaux, Int4 NbSubDomains; // Int4 NbEquiEdges; Int4 NbCrackedEdges; // Int4 nbtf;// de triangle frontiere Int4 NbOfCurves; int empty(){return (nbv ==0) && (nbt==0) && (nbe==0) && (NbSubDomains==0); } GeometricalVertex * vertices; // data of vertices des sommets Triangle * triangles; GeometricalEdge * edges; QuadTree *quadtree; GeometricalSubDomain *subdomains; Curve *curves; ~Geometry(); Geometry(const Geometry & Gh); //Copy Operator Geometry(int nbg,const Geometry ** ag); // intersection operator R2 pmin,pmax; // extrema Real8 coefIcoor; // coef to integer Icoor1; Real8 MaximalAngleOfCorner; // end of data I2 toI2(const R2 & P) const { return I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );} Real8 MinimalHmin() {return 2.0/coefIcoor;} Real8 MaximalHmax() {return Max(pmax.x-pmin.x,pmax.y-pmin.y);} void ReadGeometry(const char * ) ; void ReadGeometry(MeshIstream & ,const char *) ; void EmptyGeometry(); Geometry() {EmptyGeometry();}// empty Geometry void AfterRead(); Geometry(const char * filename) {EmptyGeometry();OnDisk=1;ReadGeometry(filename);AfterRead();} void ReadMetric(const char *,Real8 hmin,Real8 hmax,Real8 coef); const GeometricalVertex & operator[] (Int4 i) const { return vertices[i];}; GeometricalVertex & operator[](Int4 i) { return vertices[i];}; const GeometricalEdge & operator() (Int4 i) const { return edges[i];}; GeometricalEdge & operator()(Int4 i) { return edges[i];}; Int4 Number(const GeometricalVertex & t) const { return &t - vertices;} Int4 Number(const GeometricalVertex * t) const { return t - vertices;} Int4 Number(const GeometricalEdge & t) const { return &t - edges;} Int4 Number(const GeometricalEdge * t) const { return t - edges;} Int4 Number(const Curve * c) const { return c - curves;} void UnMarkEdges() { for (Int4 i=0;i=0) { t = at[a]; // if (t-this<0) return 0; v2 = ns[VerticesOfTriangularEdge[a][0]]; v0 = ns[VerticesOfTriangularEdge[a][1]]; v1 = ns[OppositeEdge[a]]; v3 = t->ns[OppositeEdge[aa[a]&3]]; } } return t; } inline double Triangle::QualityQuad(int a,int option) const { // first do the logique part double q; if (!link || aa[a] &4) q= -1; else { Triangle * t = at[a]; if (t-this<0) q= -1;// because we do 2 times else if (!t->link ) q= -1; else if (aa[0] & 16 || aa[1] & 16 || aa[2] & 16 || t->aa[0] & 16 || t->aa[1] & 16 || t->aa[2] & 16 ) q= -1; else if(option) { const Vertex & v2 = *ns[VerticesOfTriangularEdge[a][0]]; const Vertex & v0 = *ns[VerticesOfTriangularEdge[a][1]]; const Vertex & v1 = *ns[OppositeEdge[a]]; const Vertex & v3 = * t->ns[OppositeEdge[aa[a]&3]]; q = QuadQuality(v0,v1,v2,v3); // do the float part } else q= 1; } return q; } inline void Vertex::Set(const Vertex & rec,const Triangles & ,Triangles & ) { *this = rec; } inline void GeometricalVertex::Set(const GeometricalVertex & rec,const Geometry & ,const Geometry & ) { *this = rec; } inline void Edge::Set(const Triangles & Th ,Int4 i,Triangles & ThNew) { *this = Th.edges[i]; v[0] = ThNew.vertices + Th.Number(v[0]); v[1] = ThNew.vertices + Th.Number(v[1]); if (on) on = ThNew.Gh.edges+Th.Gh.Number(on); if (adj[0]) adj[0] = ThNew.edges + Th.Number(adj[0]); if (adj[1]) adj[1] = ThNew.edges + Th.Number(adj[1]); } inline void GeometricalEdge::Set(const GeometricalEdge & rec,const Geometry & Gh ,Geometry & GhNew) { *this = rec; v[0] = GhNew.vertices + Gh.Number(v[0]); v[1] = GhNew.vertices + Gh.Number(v[1]); if (Adj[0]) Adj[0] = GhNew.edges + Gh.Number(Adj[0]); if (Adj[1]) Adj[1] = GhNew.edges + Gh.Number(Adj[1]); } inline void Curve::Set(const Curve & rec,const Geometry & Gh ,Geometry & GhNew) { *this = rec; be = GhNew.edges + Gh.Number(be); ee = GhNew.edges + Gh.Number(ee); if(next) next= GhNew.curves + Gh.Number(next); } inline void Triangle::Set(const Triangle & rec,const Triangles & Th ,Triangles & ThNew) { *this = rec; if ( ns[0] ) ns[0] = ThNew.vertices + Th.Number(ns[0]); if ( ns[1] ) ns[1] = ThNew.vertices + Th.Number(ns[1]); if ( ns[2] ) ns[2] = ThNew.vertices + Th.Number(ns[2]); if(at[0]) at[0] = ThNew.triangles + Th.Number(at[0]); if(at[1]) at[1] = ThNew.triangles + Th.Number(at[1]); if(at[2]) at[2] = ThNew.triangles + Th.Number(at[2]); if (link >= Th.triangles && link < Th.triangles + Th.nbt) link = ThNew.triangles + Th.Number(link); } inline void VertexOnVertex::Set(const Triangles & Th ,Int4 i,Triangles & ThNew) { *this = Th.VertexOnBThVertex[i]; v = ThNew.vertices + Th.Number(v); } inline void SubDomain::Set(const Triangles & Th ,Int4 i,Triangles & ThNew) { *this = Th.subdomains[i]; assert( head - Th.triangles >=0 && head - Th.triangles < Th.nbt); head = ThNew.triangles + Th.Number(head) ; assert(edge - Th.edges >=0 && edge - Th.edges < Th.nbe); edge = ThNew.edges+ Th.Number(edge); } inline void GeometricalSubDomain::Set(const GeometricalSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew) { *this = rec; edge = Gh.Number(edge) + GhNew.edges; } inline void VertexOnEdge::Set(const Triangles & Th ,Int4 i,Triangles & ThNew) { *this = Th.VertexOnBThEdge[i]; v = ThNew.vertices + Th.Number(v); } inline void VertexOnGeom::Set(const VertexOnGeom & rec,const Triangles & Th ,Triangles & ThNew) { *this = rec; mv = ThNew.vertices + Th.Number(mv); if (gv) { if (abscisse < 0 ) gv = ThNew.Gh.vertices + Th.Gh.Number(gv); else ge = ThNew.Gh.edges + Th.Gh.Number(ge); } } inline Real8 Edge::MetricLength() const { return LengthInterpole(v[0]->m,v[1]->m,v[1]->r - v[0]->r) ; } inline void Triangles::ReMakeTriangleContainingTheVertex() { Int4 i; for ( i=0;iat[a]=ta.t; t->aa[a]=ta.a|l;} if(ta.t) { ta.t->at[ta.a] = t ; ta.t->aa[ta.a] = a| l ; } } inline int TriangleAdjacent::Locked() const { return t->aa[a] &4;} inline int TriangleAdjacent::Cracked() const { return t->aa[a] &32;} inline int TriangleAdjacent::GetAllFlag_UnSwap() const { return t->aa[a] & 1012;} // take all flag except MarkUnSwap inline int TriangleAdjacent::MarkUnSwap() const { return t->aa[a] &8;} inline void TriangleAdjacent::SetLock(){ t->SetLocked(a);} inline void TriangleAdjacent::SetCracked() { t->SetCracked(a);} inline TriangleAdjacent TriangleAdjacent::Adj() const { return t->Adj(a);} inline Vertex * TriangleAdjacent::EdgeVertex(const int & i) const {return t->ns[VerticesOfTriangularEdge[a][i]]; } inline Vertex * TriangleAdjacent::OppositeVertex() const {return t->ns[bamg::OppositeVertex[a]]; } inline Icoor2 & TriangleAdjacent::det() const { return t->det;} inline TriangleAdjacent Adj(const TriangleAdjacent & a) { return a.Adj();} inline TriangleAdjacent Next(const TriangleAdjacent & ta) { return TriangleAdjacent(ta.t,NextEdge[ta.a]);} inline TriangleAdjacent Previous(const TriangleAdjacent & ta) { return TriangleAdjacent(ta.t,PreviousEdge[ta.a]);} inline void Adj(GeometricalEdge * & on,int &i) {int j=i;i=on->SensAdj[i];on=on->Adj[j];} inline Real4 qualite(const Vertex &va,const Vertex &vb,const Vertex &vc) { Real4 ret; I2 ia=va,ib=vb,ic=vc; I2 ab=ib-ia,bc=ic-ib,ac=ic-ia; Icoor2 deta=Det(ab,ac); if (deta <=0) ret = -1; else { Real8 a = sqrt((Real8) (ac,ac)), b = sqrt((Real8) (bc,bc)), c = sqrt((Real8) (ab,ab)), p = a+b+c; Real8 h= Max(Max(a,b),c),ro=deta/p; ret = ro/h;} return ret; } inline Triangle::Triangle(Triangles *Th,Int4 i,Int4 j,Int4 k) { Vertex *v=Th->vertices; Int4 nbv = Th->nbv; assert(i >=0 && j >=0 && k >=0); assert(i < nbv && j < nbv && k < nbv); ns[0]=v+i; ns[1]=v+j; ns[2]=v+k; at[0]=at[1]=at[2]=0; aa[0]=aa[1]=aa[2]=0; det=0; } inline Triangle::Triangle(Vertex *v0,Vertex *v1,Vertex *v2){ ns[0]=v0; ns[1]=v1; ns[2]=v2; at[0]=at[1]=at[2]=0; aa[0]=aa[1]=aa[2]=0; if (v0) det=0; else { det=-1; link=NULL;}; } inline Real4 Triangle::qualite() { return det < 0 ? -1 : bamg::qualite(*ns[0],*ns[1],*ns[2]); } Int4 inline Vertex::Optim(int i,int koption) { Int4 ret=0; if ( t && (vint >= 0 ) && (vint <3) ) { ret = t->Optim(vint,koption); if(!i) { t =0; // for no future optime vint= 0; } } return ret; } Icoor2 inline det(const Vertex & a,const Vertex & b,const Vertex & c) { Icoor2 bax = b.i.x - a.i.x ,bay = b.i.y - a.i.y; Icoor2 cax = c.i.x - a.i.x ,cay = c.i.y - a.i.y; return bax*cay - bay*cax;} void swap(Triangle *t1,Int1 a1, Triangle *t2,Int1 a2, Vertex *s1,Vertex *s2,Icoor2 det1,Icoor2 det2); int inline TriangleAdjacent::swap() { return t->swap(a);} int SwapForForcingEdge(Vertex * & pva ,Vertex * & pvb , TriangleAdjacent & tt1,Icoor2 & dets1, Icoor2 & detsa,Icoor2 & detsb, int & nbswap); int ForceEdge(Vertex &a, Vertex & b,TriangleAdjacent & taret) ; // inline bofbof FH inline TriangleAdjacent FindTriangleAdjacent(Edge &E) { Vertex * a = E.v[0]; Vertex * b = E.v[1]; Triangle * t = a->t; int i = a->vint; TriangleAdjacent ta(t,EdgesVertexTriangle[i][0]); // Previous edge assert(t && i>=0 && i < 3); assert( a == (*t)(i)); int k=0; do { // turn around vertex in direct sens (trigo) k++;assert(k< 20000); // in no crack => ta.EdgeVertex(1) == a otherwise ??? if (ta.EdgeVertex(1) == a && ta.EdgeVertex(0) == b) return ta; // find ta = ta.Adj(); if (ta.EdgeVertex(0) == a && ta.EdgeVertex(1) == b) return ta; // find --ta; } while (t != (Triangle *)ta); assert(0); return TriangleAdjacent(0,0);// error } inline Vertex * TheVertex(Vertex * a) // give a unique vertex with smallest number { // in case on crack in mesh Vertex * r(a), *rr; Triangle * t = a->t; int i = a->vint; TriangleAdjacent ta(t,EdgesVertexTriangle[i][0]); // Previous edge assert(t && i>=0 && i < 3); assert( a == (*t)(i)); int k=0; do { // turn around vertex in direct sens (trigo) k++;assert(k< 20000); // in no crack => ta.EdgeVertex(1) == a if ((rr=ta.EdgeVertex(0)) < r) r = rr; ta = ta.Adj(); if ((rr=ta.EdgeVertex(1)) < r) r =rr; --ta; } while (t != (Triangle*) ta); return r; } inline double CPUtime(){ #ifdef SYSTIMES struct tms buf; if (times(&buf)!=-1) return ((double)buf.tms_utime+(double)buf.tms_stime)/(long) sysconf(_SC_CLK_TCK); else #endif return ((double) clock())/CLOCKS_PER_SEC; } #ifdef DEBUG void inline Triangle::checka(Int1 a) { // verif de la coherence des adjacences de l arete a a = a%4; assert(a < 3 && a >= 0 ); Triangle *t1=this,*t2=at[a]; Int2 a1=a,a2=aa[a]%4; assert(a2 < 3 && a2 >= 0 ); if (t2 && ( ((*t1).ns[VerticesOfTriangularEdge[a1][0]] != (*t2).ns[VerticesOfTriangularEdge[a2][1]]) || ((*t1).ns[VerticesOfTriangularEdge[a1][1]] != (*t2).ns[VerticesOfTriangularEdge[a2][0]]))) { if (CurrentTh) cerr << " In Triangles beetween Triangle " << CurrentTh->Number(t1) << " and " << CurrentTh->Number(t2) << endl; cerr << "---- t1="<< t1 << " " << a1 <<", t2="<< t2 << " " << a2 << endl; cerr <<"t1="<< t1 << " " << a1 << " " << t1->ns[VerticesOfTriangularEdge[a1][0]] << " " << t1->ns[VerticesOfTriangularEdge[a1][1]] <Number(t1->ns[VerticesOfTriangularEdge[a1][0]]) << " " << CurrentTh->Number(t1->ns[VerticesOfTriangularEdge[a1][1]]) <ns[VerticesOfTriangularEdge[a2][0]] << " " << t2->ns[VerticesOfTriangularEdge[a2][1]] <Number(t2->ns[VerticesOfTriangularEdge[a2][0]]) << " " << CurrentTh->Number(t2->ns[VerticesOfTriangularEdge[a2][1]]) <aa[a1]/4 == t2->aa[a2]/4); // lock compatibite } void inline Triangle::check() { Icoor2 det2=0; // cout << " check " << this << endl; int infv=ns[0] ? (( ns[1] ? ( ns[2] ? -1 : 2) : 1 )) : 0; if (det<0) { if (infv<0 ) { if (CurrentTh) cerr << " In Triangles " << CurrentTh->Number(this) << endl; cerr << " det = " << det << " and " << infv << endl; MeshError(5); }} else if (infv>=0 ) { if (CurrentTh) cerr << " In Triangles " << CurrentTh->Number(this) << endl; cerr << " det = " << det << " and " << infv << endl; MeshError(5); } if (det >=0) if( det != (det2=bamg::det(*ns[0],*ns[1],*ns[2]))) { // penthickness(4);Draw(); if (CurrentTh) cerr << " In Triangles" << CurrentTh->Number(this) << endl; cerr << *ns[0] << *ns[1] << " " << *ns[2] << " " << endl; cerr << " Bug in triangle " << this << ":" << det << " != " << det2 << endl; MeshError(5); } checka(0); checka(1); checka(2); // if (ns[0]) assert( ns[0] - Meshbegin >= 0 ); // if (ns[0]) assert( Meshend - ns[0] >= 0 ); // if (ns[1]) assert( ns[1] - Meshbegin >= 0 ); // if (ns[1]) assert( Meshend - ns[1] >= 0 ); // if (ns[2]) assert( ns[2] - Meshbegin >= 0 ); // if (ns[2]) assert( Meshend - ns[2] >= 0 ); assert(ns[0] != ns[2]); assert(ns[1] != ns[2]); assert(ns[0] != ns[1]); } #endif #ifdef DRAWING extern Real4 xGrafCoef,yGrafCoef,xGrafOffSet,yGrafOffSet; // R2 -> I2 transform extern R2 Gpmin,Gpmax; //extern Real8 Gh; // cf routine ILineTo IMoveto extern void IMoveTo(long i,long j); extern void ILineTo(long i,long j); extern char Getxyc(long &i,long &j); extern void Draw(float ,float ); extern void Draw(long ,long ); extern void DrawMark(R2 r); //inline void DrawMark(D2 r) {DrawMark(R2(r.x,r.y));} inline void Move(I2 x) {IMoveTo(x.x,x.y);} inline void Move(R2 x) {rmoveto(x.x,x.y);} //inline void Move(D2 x) {rmoveto(x.x,x.y);} inline void Line(I2 x){ILineTo(x.x,x.y);} inline void Line(R2 x) {rlineto(x.x,x.y);} //inline void Line(D2 x) {rlineto(x.x,x.y);} #endif } freefem++-3.61-1/src/bamglib/SetOfE4.cpp000644 000767 000024 00000004163 13256636774 017730 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include using namespace std; #include "meshtype.h" #include "SetOfE4.h" namespace bamg { SetOfEdges4::SetOfEdges4(Int4 mmx,Int4 nnx) {nx=nnx; nbax=mmx; NbOfEdges = 0; tete= new Int4 [nx]; Int4 i=nx; while (i--) tete[i] = -1;// vide Edges =new Int4Edge[nbax]; } Int4 SetOfEdges4::find(Int4 ii,Int4 jj) { if (tete == 0 ) { cerr <<"SetOfEdges4::find \nplus de tete de liste\n"; MeshError(888);} Int4 n = tete[ Abs( ii ) % nx ]; while (n >= 0) if (ii == Edges[n].i && jj == Edges[n].j) return n; else n = Edges[n].next; return -1; // n'existe pas } Int4 SetOfEdges4::add(Int4 ii,Int4 jj) { if (tete == 0 ) { cerr << "SetOfEdges4::add\n plus de tete de liste \n" << endl; MeshError(888);} Int4 h; Int4 n = tete[ h = Abs( ii ) % nx ]; while (n >= 0) if (ii == Edges[n].i && jj == Edges[n].j) return n; else n = Edges[n].next; if (nbax <=NbOfEdges ) { cerr << " SetOfEdges4::add\noverflow de la pile " << nbax << " " << NbOfEdges << endl; MeshError(888);} Edges[NbOfEdges].i=ii; Edges[NbOfEdges].j=jj; Edges[NbOfEdges].next= tete[h]; tete[h] = NbOfEdges; return NbOfEdges ++; } } // end of namespace bamg freefem++-3.61-1/src/bamglib/MeshGeom.cpp000644 000767 000024 00000113247 13256636774 020227 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ // #define TRACETRIANGLE 3 extern long verbosity ; //#define strcasecmp strcmp #include #include #include #include #include using namespace std; #include "Mesh2.h" #include "QuadTree.h" #include "SetOfE4.h" namespace bamg { void Triangles::ConsGeometry(Real8 cutoffradian,int *equiedges) // construct a geometry if no geo { // if equiedges existe taille nbe // equiedges[i]/2 == i original // equiedges[i]/2 = j => equivalence entre i et j => meme maillage // equiedges[i]%2 : 0 meme sens , 1 pas meme sens // // -------------------------- if (verbosity>1) cout << " -- construction of the geometry from the 2d mesh " << endl; if (nbt<=0 || nbv <=0 ) { MeshError(101);} // construction of the edges // Triangles * OldCurrentTh =CurrentTh; CurrentTh=this; // Int4 NbTold = nbt; // generation of the integer coor // generation of the adjacence of the triangles if (cutoffradian>=0) Gh.MaximalAngleOfCorner = cutoffradian; SetOfEdges4 * edge4= new SetOfEdges4(nbt*3,nbv); Int4 * st = new Int4[nbt*3]; Int4 i,k; int j; if (Gh.name) delete Gh.name; Gh.name = new char [ name ? strlen(name) + 15 : 50 ]; Gh.name[0]=0; strcat(Gh.name,"cons from: "); if (name) strcat(Gh.name,name); else strcat(Gh.name," a mesh with no name"); for (i=0;iaddtrie(Number(edges[i][0]),Number(edges[i][1])); } if (nbe != edge4->nb()) { cerr << " Some Double edge in the mesh, the number is " << nbe << " nbe4=" << edge4->nb() << endl; MeshError(1002); } for (i=0;iaddtrie(Number(triangles[i][VerticesOfTriangularEdge[j][0]]), Number(triangles[i][VerticesOfTriangularEdge[j][1]])); Int4 invisible = triangles[i].Hidden(j); if(st[k]==-1) st[k]=3*i+j; else if(st[k]>=0) { assert( ! triangles[i].TriangleAdj(j) && !triangles[st[k] / 3].TriangleAdj((int) (st[k]%3))); triangles[i].SetAdj2(j,triangles + st[k] / 3,(int) (st[k]%3)); if (invisible) triangles[i].SetHidden(j); if (knb(); // the total number of edges delete edge4; edge4 =0; if(verbosity>5) { if (name) cout << " On Mesh " << name << endl; cout << " - The number of Vertices = " << nbv << endl; cout << " - The number of Triangles = " << nbt << endl; cout << " - The number of given edge = " << nbe << endl; cout << " - The number of all edges = " << nbedges << endl; cout << " - The Euler number = 1-Nb Of Hole = " << nbt-nbedges+nbv << endl; } // check the consistant of edge[].adj and the geometrical required vertex k=0; kk=0; Int4 it; for (i=0;i4) cout << " Construction of the edges " << nbe << endl; for (i=0;i=0) // edge alone { it = st[i]/3; j = (int) (st[i]%3); add=k++; } if (add>=0 && add < nbe) { edges[add].v[0] = &triangles[it][VerticesOfTriangularEdge[j][0]]; edges[add].v[1] = &triangles[it][VerticesOfTriangularEdge[j][1]]; edges[add].on=0; if (iref(),edges[add].v[1]->ref()); // no a good choice } } assert(k==nbe); if (edgessave) delete [] edgessave; } // construction of edges[].adj for (i=0;icolor++; for (i=0;icolor,j0; if(i0<0) edges[i ].adj[ j ]=0; // Add FH Jan 2008 if(i0==-1) v->color=i*2+j; else if (i0>=0) {// i and i0 edge are adjacent by the vertex v j0 = i0%2; i0 = i0/2; assert( v == edges[i0 ].v[j0]); edges[i ].adj[ j ] =edges +i0; edges[i0].adj[ j0] =edges +i ; assert(edges[i0].v[j0] == v); // if(verbosity>8) // cout << " edges adj " << i0 << " "<< j0 << " <--> " << i << " " << j << endl; v->color = -3;} } // now reconstruct the sub domain info assert(!NbSubDomains); NbSubDomains=0; { Int4 it; // find all the sub domain Int4 *colorT = new Int4[nbt]; Triangle *tt,*t; Int4 k; for ( it=0;it0) if( ( j=st[level]++) <3) { t = &triangles[st[level-1]]; tt=t->TriangleAdj((int)j); if ( ! t->Locked(j) && tt && (colorT[jt = Number(tt)] == -1) && ( tt->color==kolor)) { colorT[jt]=NbSubDomains; st[++level]=jt; st[++level]=0; k++; } } else level-=2; if (verbosity>5) cout << " Nb of triangles " << k << " of Subdomain " << NbSubDomains << " " << kolor << endl; NbSubDomains++; } } if (verbosity> 3) cout << " The Number of sub domain = " << NbSubDomains << endl; Int4 isd; subdomains = new SubDomain[NbSubDomains]; for (isd=0;isdcolor != triangles[it].color) && !subdomains[isd=colorT[it]].head) { subdomains[isd].head = triangles+it; subdomains[isd].ref = triangles[it].color; subdomains[isd].sens = j; // hack subdomains[isd].edge = 0; k++; } } assert(k== NbSubDomains); delete [] colorT; } delete [] st; // now make the geometry // 1 compress the vertices Int4 * colorV = new Int4[nbv]; for (i=0;i3) cout << " Nb of vertices = " << Gh.nbv << " Nb of edges = " << Gh.nbe << endl; NbVerticesOnGeomVertex = Gh.nbv; VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex]; NbVerticesOnGeomEdge =0; VerticesOnGeomEdge =0; for (i=0;i6){ int nbr=0; for (i=0;i=0) { int k=Gh.vertices[j].cas; Gh.vertices[j].Set(vertices[i]); // Vertex & v = Gh.vertices[j]; // v = vertices[i]; Gh.vertices[j].color =0; assert(k==Gh.vertices[j].cas); VerticesOnGeomVertex[j] = VertexOnGeom(vertices[i], Gh.vertices[j]); } } edge4= new SetOfEdges4(nbe,nbv); Real4 * len = new Real4[Gh.nbv]; for(i=0;i6){ int nbr=0; for (i=0;i0); Real8 hmin = HUGE_VAL; int kreq=0,kkreq=0; for (i=0;i=0) { if(verbosity>9) cout << " Edges Equi " << i << " <=> " << j << " sens = " << sens << endl; if( sens==0) Gh.edges[i].SetEqui(); else Gh.edges[i].SetReverseEqui(); Gh.edges[i].link= & Gh.edges[j]; //assert(sens==0);// meme sens pour l'instant } } if(requis) { // correction fevr 2009 JYU ... Gh.edges[i].v[0]->SetRequired(); Gh.edges[i].v[1]->SetRequired(); Gh.edges[i].SetRequired(); // fin modif ... kkreq++; } R2 x12 = Gh.vertices[j0].r-Gh.vertices[j1].r; Real8 l12=Norme2(x12); hmin = Min(hmin,l12); Gh.vertices[j1].color++; Gh.vertices[j0].color++; len[j0]+= l12; len[j1] += l12; hmin = Min(hmin,l12); Gh.edges[i].ref = edges[i].ref; k = edge4->addtrie(i0,i1); assert(k == i); } if(verbosity>6){ int nbr=0; for (i=0;iAdj[0]; else if ( (AB,BP) > 0) on = on->Adj[1]; else return on; } return on; } GeometricalEdge* Geometry::ProjectOnCurve(const Edge & e,Real8 s,Vertex &V,VertexOnGeom &GV ) const { Real8 save_s=s; int NbTry=0; retry: s=save_s; GeometricalEdge * on = e.on; assert(on); assert( e[0].on && e[1].on); const Vertex &v0=e[0],&v1=e[1]; V.m = Metric(1.0-s, v0,s, v1); #define MXE__LINE __LINE__+1 const int mxe =100; GeometricalEdge *ge[mxe+1]; int sensge[mxe+1]; Real8 lge[mxe+1]; int bge=mxe/2,tge=bge; ge[bge] = e.on; sensge[bge]=1; R2 V0 = v0,V1=v1,V01=V1-V0; VertexOnGeom vg0= *v0.on, vg1=*v1.on; if(NbTry) cout << "bug: s==== " << s << " e=" << V0 << " " << V1 << endl; // GeometricalEdge * eg0 = e.on,* eg1 = e.on, *eg=NULL; GeometricalEdge * eg0=on, *eg1=on; R2 Ag=(R2) (*on)[0],Bg=(R2)(*on)[1],AB=Bg-Ag; if(NbTry) cout <<" G edge= " << Ag << Bg << endl << " v edge" << V01 << " v geom " << AB << (V01,AB) < V0Ag.V0V1 > 0 || V0Bg.V0V1 >0 // => V1Ag.V0V1 < 0 || V0Bg.V0V1 <0 R2 V0V1 = V1-V0; Real8 cos0A = ((Ag-V0),V0V1); Real8 cos0B = ((Bg-V0),V0V1); Real8 cos1A = ((Ag-V1),V0V1); Real8 cos1B = ((Bg-V1),V0V1); if ( (cos0A < 0 && cos0B <0) || (cos1A> 0 && cos1B >0)) { cerr << " Bug on pointer edge [" << V0 << " , " << V1 << " ] " << " on geometrical edge " << Number(on) << " = [" << Ag << " , " << Bg << " ] " << endl; cerr << cos0A << "> 0 || " << cos0B << " > 0 and "; cerr << cos1A << "< 0 || " << cos1B << " < 0 " << endl; exit (1); } #endif if(NbTry) cout << "bug: edge = " << v0.r << " -> " << v1.r << endl << "sg 0 = " << vg0 << " on = " << Number(on) << ":" << Ag << Bg << "; " << " sg 1= " << vg1 << "--------------------------------------------" << endl; while (eg0 != (GeometricalEdge*) vg0 && (*eg0)(sens0) != (GeometricalVertex*) vg0) { if (bge<=0) { // int kkk; // if (NbTry) cout <<"Read (int) to Show Sioux window", cin >> kkk ; if(NbTry) { cerr << " -- Fatal Error: on the class triangles before call Geometry::ProjectOnCurve" << endl; cerr << " The mesh of the Geometry is to fine: "; cerr << " 1) a mesh edge contening more than "<< mxe/2 << " geometrical edges." << endl; cerr << " 2) code bug : be sure that we call Triangles::SetVertexFieldOn() before " << endl; cerr << " To solve the problem do a coarsening of the geometrical mesh " << endl; cerr << " or change the constant value of mxe in " << __FILE__ << " line " << MXE__LINE << "( dangerous way )" << endl; MeshError(222); } NbTry++; goto retry;} GeometricalEdge* tmpge = eg0; if(NbTry) cout << "bug: --Edge @" << Number(tmpge) << " = "<< Number(eg0) << ":" <Adj[0]) << "," << Number(eg0->Adj[1]) <<"," ; ge[--bge] =eg0 = eg0->Adj[sens0]; assert(bge>=0 && bge <= mxe); sens0 = 1-( sensge[bge] = tmpge->SensAdj[sens0]); if(NbTry) cout << "bug: Edge " << Number(eg0) << " "<< 1-sens0 << " S " << Number((*eg0)[1-sens0]) <<":" << Number(eg0->Adj[0]) << "," << Number(eg0->Adj[1]) <<"," << endl <=mxe ) { cerr << " --Fatal Error: on the class triangles before call Geometry::ProjectOnCurve" << endl; NbTry++; if (NbTry<2) goto retry; cerr << " The mesh of the Geometry is to fine:" ; cerr << " 1) a mesh edge contening more than "<< mxe/2 << " geometrical edges." << endl; cerr << " 2) code bug : be sure that we call Triangles::SetVertexFieldOn() before " << endl; cerr << " To solve the problem do a coarsening of the geometrical mesh " << endl; cerr << " or change the constant value of mxe in " << __FILE__ << " line " << MXE__LINE << "( dangerous way )" << endl; MeshError(223); } GeometricalEdge* tmpge = eg1; if(NbTry) cout << "++Edge @" << tmpge << " = " << Number(eg1) <<"%" << Number(eg1->Adj[0]) << "," << Number(eg1->Adj[1]) <<"," ; ge[++tge] =eg1 = eg1->Adj[sens1]; sensge[tge]= sens1 = 1-tmpge->SensAdj[sens1]; assert(tge>=0 && tge <= mxe); if(NbTry) cout << " Edge " << Number(eg1) << " " << sens1 << " S " <Adj[0]) << "," << Number(eg1->Adj[1]) <<"," <=0 && i <= mxe); BB = (*ge[i])[sensge[i]]; lge[i]=ll += Norme2(AA-BB); // cout << " ll " << i << BB << ll << " " <r - vertices[i]) < eps ) { // link v & vertices[i] // vieille ruse pour recuperer j GeometricalVertex * vg = (GeometricalVertex *) (void *) v; int j = vg-v0g; assert( v == & (Vertex &) vertices[j]); vertices[i].link = vertices + j; k++; } else quadtree.Add(vertices[i]); } if (k) { cout << " Number of distinte vertices " << nbv - k << " Over " << nbv << endl; //if (verbosity>10) { cout << " The duplicate vertex " << endl; for (i=0;i7) for (i=0;ir - edges[i].v[0]->r; Real8 lv10 = Norme2(v10); if(lv10 == 0) { cerr << "The length of " <9) cout << " angle edge " << i <<" " << eangle[i]*180/Pi<< v10<=0) { ord++; Int4 i1= n /2; Int4 j1 = n % 2; Int4 *pn = ev + n; float angle = j1 ? OppositeAngle(eangle[i1]): eangle[i1]; n = *pn; if (angleold > angle) // exch to have : po -> pn -> p exch=1,*pn = *po,*po=*p,*p=n,po = pn; else // to have : po -> p -> pn angleold = angle, po = p,p = pn; } } // end while (exch) if (ord >= 1 ) { /* Int4 n = hv[i]; while ( n >=0) { Int4 i1 = n/2,j1 = n%2; //float a = 180*(j1 ? OppositeAngle(eangle[i1]): eangle[i1])/Pi; n = ev[n]; } */ } if(ord == 2) { // angulare test to find a corner Int4 n1 = hv[i]; Int4 n2 = ev[n1]; Int4 i1 = n1 /2, i2 = n2/2; // edge number Int4 j1 = n1 %2, j2 = n2%2; // vertex in the edge float angle1= j1 ? OppositeAngle(eangle[i1]) : eangle[i1]; float angle2= !j2 ? OppositeAngle(eangle[i2]) : eangle[i2]; float da12 = Abs(angle2-angle1); if(verbosity>9) cout <<" check angle " << i << " " << i1 << " " << i2 << " " << 180*(da12)/Pi << " " << 180*MaximalAngleOfCorner/Pi << vertices[i] << endl; if (( da12 >= MaximalAngleOfCorner ) && (da12 <= 2*Pi -MaximalAngleOfCorner)) { vertices[i].SetCorner() ; if(verbosity>7) cout << " The vertex " << i << " is a corner (angle) " << 180*(da12)/ Pi<< " " << 180*MaximalAngleOfCorner/Pi << endl;} // if the ref a changing then is SetRequired(); if (edges[i1].flag != edges[i2].flag || edges[i1].Required()) { vertices[i].SetRequired(); if(verbosity>7) cout << " The vertex " << i << " is Required the flag change (crack or equi, or require)" << endl;} if (edges[i1].ref != edges[i2].ref) { vertices[i].SetRequired(); if(verbosity>7) cout << " The vertex " << i << " is Required ref" << endl;} } ; if(ord != 2) { vertices[i].SetCorner(); if(verbosity>7) cout << " the vertex " << i << " is a corner ordre = " << ord << endl; } // close the liste around the vertex { Int4 no=-1, ne = hv[i]; while ( ne >=0) ne = ev[no=ne]; if(no>=0) ev[no] = hv[i]; } // now the list around the vertex is circular } // end for (i=0;i " << Number(edges[i1].v[j1]) <10) cout << " edges. Adj " << i1 << " " << j1 << " <--- " << i << " " << jj << endl; } // generation of all the tangente for (i=0;ir -edges[i].v[0]->r; Real8 lAB = Norme2(AB); // length of current edge AB Real8 ltg2[2]; ltg2[0]=0;ltg2[1]=0; for (jj=0;jj<2;jj++) { R2 tg = edges[i].tg[jj]; Real8 ltg = Norme2(tg); // length of tg if(ltg == 0) {// no tg if( ! edges[i].v[jj]->Corner()) { // not a Corner tg = edges[i].v[1-jj]->r - edges[i].Adj[jj]->v[1-edges[i].SensAdj[jj]]->r; ltg = Norme2(tg); tg = tg *(lAB/ltg),ltg=lAB; /* if(edges[i].ref >=4) cout << " tg " << tg.x << " "<< tg.y << " " << edges[i].v[1-jj]->r << edges[i].Adj[jj]->v[1-edges[i].SensAdj[jj]]->r << " y-y = " << edges[i].v[1-jj]->r.y -edges[i].Adj[jj]->v[1-edges[i].SensAdj[jj]]->r.y << endl; */ } //else ;// a Corner with no tangent => nothing to do } // a tg else tg = tg *(lAB/ltg),ltg=lAB; ltg2[jj] = ltg; if ( (tg,AB) < 0) tg = -tg; //if(edges[i].ref >=4) cout << " tg = " << tg << endl; edges[i].tg[jj] = tg; } // for (jj=0;jj<2;jj++) if (ltg2[0]!=0) edges[i].SetTgA(); if (ltg2[1]!=0) edges[i].SetTgB(); } // for (i=0;i7) for (i=0;iSetMark(); nbgem++; e->CurveNumber=NbOfCurves; if(curves) { curves[NbOfCurves].ee=e; curves[NbOfCurves].ke=k1; } GeometricalVertex *b=(*e)(k1); if (a == b || b->Required() ) break; k0 = e->SensAdj[k1];// vertex in next edge e = e->Adj[k1]; // next edge }// for(;;) if(verbosity>10 && curves==0) cout << NbOfCurves <<" curve : nb edges= "<< nee<< endl; NbOfCurves++; if(level) { if(verbosity>4) cout << " Warning: Curve "<< NbOfCurves << " without required vertex " << "so the vertex " << Number(a) << " become required " <SetRequired(); } }} assert(nbgem && nbe); if(step==0) { curves = new Curve[NbOfCurves]; } } for(int i=0;ilink; GeometricalEdge * ee=curves[i].ee, *eqee=ee->link; curves[i].master=true; if(be->Equi() || be->ReverseEqui() ) { assert(eqbe); int nc = eqbe->CurveNumber; GeometricalEdge * bee=curves[nc].be; GeometricalEdge * eee=curves[nc].ee; assert(i!=nc); curves[i].next=curves[nc].next; curves[i].master=false; curves[nc].next=curves+i; int sens =1; if( eqbe != bee ) { assert(eqee == bee);// eq end == begin assert(eqbe == eee);// eq beg == end assert(eqbe == eee); if(be != ee) sens = -1; } else { if( (be==ee) && (curves[i].kb != curves[nc].kb)) sens = -1; } bool reverse =be->ReverseEqui(); //if( sens<0) reverse = !reverse; // remove 9 may 2017 reverse=sens; // FH Correct 9 may 2017 (ReverseEqui is wrong ??? maybe) if(reverse) curves[i].Reverse(); if(verbosity>9) { cout << " -- curve equi /reverse="<< reverse << " sens: " << sens << endl; cout << " curve "<< i << ": "<< Number(be) << " <=> " << Number(eqbe) << " " << be->Equi() << be->ReverseEqui() <<" --> "<< Number(ee) << " <=>" << Number(eqee) << " " << ee->Equi() << ee->ReverseEqui() <Equi() << bee->ReverseEqui() <<" --> "<< Number(eee) << " !" << eee->Equi() << eee->ReverseEqui() <3) cout << " End ReadGeometry: Number of curves in geometry is " << NbOfCurves <4) for(int i=0;ir,B=v[1]->r; Real8 dca,dcb,dcta,dctb; Real8 ddca,ddcb,ddcta,ddctb; // Real8 t1 = 1 -theta; // Real8 t1t1 = t1*t1; Real8 tt = theta*theta; assert( theta >=0); assert( theta <=1); if (TgA()) if (TgB()) // interpolation d'hermite { //cb = theta*theta*(3-2*theta); dcb = 6*theta*(1-theta); ddcb = 6*(1-2*theta); //ca = 1-cb; dca = -dcb; ddca = -ddcb; // cta = (1-theta)*(1-theta)*theta; dcta = (3*theta - 4)*theta + 1; ddcta=6*theta-4; //ctb = (theta-1)*theta*theta ; dctb = 3*tt - 2*theta; ddctb = 6*theta-2; } else { // 1-t*t, t-t*t, t*t Real8 t = theta; // cb = t*t; dcb = 2*t; ddcb = 2; //ca = 1-cb; dca = -dcb; ddca = -2; // cta= t-cb; dcta = 1-dcb; ddcta = -ddcb; // ctb =0; dctb=0; ddctb=0; } else if (TgB()){ Real8 t = 1-theta; //ca = t*t; dca = -2*t; ddca = 2; //cb = 1-ca; dcb = -dca; ddcb = -2; //ctb= -t+ca; dctb = 1+dca; ddctb= ddca; //cta=0; dcta =0; ddcta =0; } else {t=B-A;return 0;} // lagrange P1 R2 d = A*dca + B*dcb + tg[0]* dcta + tg[1] * dctb; R2 dd = A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb; Real8 d2=(d,d); Real8 sd2 = sqrt(d2); t=d; if(d2>1.0e-20) {t/=sd2;return Abs(Det(d,dd))/(d2*sd2);} else return 0; } R2 GeometricalEdge::F(Real8 theta) const // parametrization of the curve edge { R2 A=v[0]->r,B=v[1]->r; Real8 ca,cb,cta,ctb; assert( theta >=-1e-12); assert( theta <=1+1e-12); if (TgA()) if (TgB()) // interpolation d'hermite { cb = theta*theta*(3-2*theta); ca = 1-cb; cta = (1-theta)*(1-theta)*theta; ctb = (theta-1)*theta*theta ; // if(ref==4 || ref==5) // cout << " FFF " << tg[0] << tg[1] << A << B << " => " << A*ca + B*cb + tg[0]* cta + tg[1] * ctb << endl; } else { // 1-t*t, t-t*t, t*t Real8 t = theta; cb = t*t; ca = 1-cb; cta= t-cb; ctb=0; } else if (TgB()){ Real8 t = 1-theta; ca = t*t; cb = 1-ca; ctb= -t+ca; cta=0; } else { ca =(1-theta),cb = theta,cta=ctb=0; // lagrange P1 } return A*ca + B*cb + tg[0]* cta + tg[1] * ctb; } } freefem++-3.61-1/src/bamglib/Makefile.am000644 000767 000024 00000000746 13256636774 020052 0ustar00hechtstaff000000 000000 # Makefile using Automake + Autoconf # ---------------------------------- # $Id$ # This is not compiled as a separate library because its # interconnections with other libraries have not been solved. EXTRA_DIST=Mesh2.cpp Mesh2.h MeshDraw.cpp MeshGeom.cpp Meshgibbs.cpp \ Meshio.cpp Meshio.h MeshQuad.cpp MeshRead.cpp meshtype.h MeshWrite.cpp \ Metric.cpp Metric.h QuadTree.cpp QuadTree.h R2.cpp R2.h SetOfE4.cpp \ SetOfE4.h write_hdf5.cpp write_hdf5.hpp write_xdmf.cpp write_xdmf.hpp freefem++-3.61-1/src/bamglib/Metric.cpp000644 000767 000024 00000100332 13256636774 017735 0ustar00hechtstaff000000 000000 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : // ORG : // AUTHOR : Frederic Hecht // E-MAIL : hecht@ann.jussieu.fr // /* 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 */ #include #include "Meshio.h" #include "Mesh2.h" namespace bamg { inline Real8 det3x3(Real8 A[3] ,Real8 B[3],Real8 C[3]) { return A[0] * ( B[1]*C[2]-B[2]*C[1]) - A[1] * ( B[0]*C[2]-B[2]*C[0]) + A[2] * ( B[0]*C[1]-B[1]*C[0]); } SaveMetricInterpole LastMetricInterpole; void ReductionSimultanee( MetricAnIso M1, MetricAnIso M2,double & l1,double & l2, D2xD2 & V) { double a11=M1.a11,a21=M1.a21,a22=M1.a22; double b11=M2.a11,b21=M2.a21,b22=M2.a22; // M1 v = l M2 v // (M1 - l M2) v =0 // det (M1 - l M2) =0 // det (M1 - l M2) = a l^2 + b l + c; // = (a11 - l * b11) * (a22 - l * b22) - (a21 - l * b21 ) ^2 // const double eps = 1.e-5; const double /*c11 = a11*a11,*/ c21= a21*a21; const double /*d11 = b11*b11,*/ d21= b21*b21; const double a=b11*b22 - d21; const double b=-a11*b22-a22*b11+2*a21*b21; const double c=-c21+a11*a22; const double bb = b*b,ac= a*c; const double delta = bb - 4 * ac; // const double kk=c11+c22+c21+d11+d21+d22; // modif F Hecht feb 1998 // cerr.precision(14); //cerr << bb << " " << ac << " " << bb << " " <0); #endif V=D2xD2(vp1x,vp2x,vp1y,vp2y); } return; } MetricAnIso Intersection(const MetricAnIso M1,const MetricAnIso M2) ; MetricAnIso Intersection(const MetricAnIso M1,const MetricAnIso M2) { D2xD2 M; double l1,l2; ReductionSimultanee(M1,M2,l1,l2,M); R2 v0(M.x.x,M.y.x); R2 v1(M.x.y,M.y.y); D2xD2 M_1(M.inv()); D2xD2 D(Max(M1(v0,v0),M2(v0,v0)),0,0,Max(M1(v1,v1),M2(v1,v1))); D2xD2 Mi(M_1.t()*D*M_1); return MetricAnIso(Mi.x.x,0.5*(Mi.x.y+Mi.y.x),Mi.y.y); } MetricAnIso::MetricAnIso(const Real8 a[3],const MetricAnIso m0, const MetricAnIso m1,const MetricAnIso m2 ) { MetricAnIso mab(a[0]*m0.a11 + a[1]*m1.a11 + a[2]*m2.a11, a[0]*m0.a21 + a[1]*m1.a21 + a[2]*m2.a21, a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22); MatVVP2x2 vab(mab); R2 v1(vab.v.x,vab.v.y); R2 v2(-v1.y,v1.x); Real8 h1 = a[0] / m0(v1) + a[1] / m1(v1) + a[2] / m2(v1); Real8 h2 = a[0] / m0(v2) + a[1] / m1(v2) + a[2] / m2(v2); vab.lambda1 = 1 / (h1*h1); vab.lambda2 = 1 / (h2*h2); *this = vab; } MetricAnIso::MetricAnIso( Real8 a,const MetricAnIso ma, Real8 b,const MetricAnIso mb) { MetricAnIso mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22); MatVVP2x2 vab(mab); R2 v1(vab.v.x,vab.v.y); R2 v2(-v1.y,v1.x); Real8 h1 = a / ma(v1) + b / mb(v1); Real8 h2 = a / ma(v2) + b / mb(v2); vab.lambda1 = 1 / (h1*h1); vab.lambda2 = 1 / (h2*h2); *this = vab; } MatVVP2x2::MatVVP2x2(const MetricAnIso M) { double a11=M.a11,a21=M.a21,a22=M.a22; const double eps = 1.e-5; double c11 = a11*a11, c22 = a22*a22, c21= a21*a21; double b=-a11-a22,c=-c21+a11*a22; double delta = b*b - 4 * c ; double n2=(c11+c22+c21); if ( n2 < 1e-30) lambda1=lambda2=0,v.x=1,v.y=0; else if (delta < eps*n2) { lambda1=lambda2=-b/2, v.x=1,v.y=0; } else { // --- construction de 2 vecteur dans (Im ( A - D(i) Id) ortogonal delta = sqrt(delta); lambda1 = (-b-delta)/2.0,lambda2 = (-b+delta)/2.0; double v0 = a11-lambda1, v1 = a21,v2 = a22 - lambda1; double s0 = v0*v0 + v1*v1, s1 = v1*v1 +v2*v2; if(s1 < s0) s0=sqrt(s0),v.x=v1/s0,v.y=-v0/s0; else s1=sqrt(s1),v.x=v2/s1,v.y=-v1/s1; }; } int MetricAnIso::IntersectWith(const MetricAnIso M2) { //cerr << " - " << *this << M2 << endl; int r=0; MetricAnIso & M1 = *this; D2xD2 M; double l1,l2; ReductionSimultanee(*this,M2,l1,l2,M); // cerr << M << endl; R2 v1(M.x.x,M.y.x); R2 v2(M.x.y,M.y.y); double l11=M1(v1,v1); double l12=M1(v2,v2); double l21=M2(v1,v1); double l22=M2(v2,v2); if ( l11 < l21 ) r=1,l11=l21; if ( l12 < l22 ) r=1,l12=l22; // cerr << r << endl; if (r) { // change D2xD2 M_1(M.inv()); D2xD2 D(l11,0,0,l12); D2xD2 Mi(M_1.t()*D*M_1); a11=Mi.x.x; a21=0.5*(Mi.x.y+Mi.y.x); a22=Mi.y.y; } return r; } void Triangles::IntersectGeomMetric(const Real8 err=1,const int iso=0) { if(verbosity>1) cout << " -- IntersectGeomMetric geometric err=" << err << (iso ? " iso " : " aniso " ) << endl; Real8 ss[2]={0.00001,0.99999}; Real8 errC = 2*sqrt(2*err); Real8 hmax = Gh.MaximalHmax(); Real8 hmin = Gh.MinimalHmin(); Real8 maxaniso = 1e6; assert(hmax>0); SetVertexFieldOn(); if (errC > 1) errC = 1; for (Int4 i=0;iR1tg(s,tg); // cerr << " R = " << 1/Max(R1,1e-20) << tg << " on x " // << V.r << errC/ Max(R1,1e-20) << " hold=" <1.0e-20) { // err relative to the length of the edge ht = Min(Max(errC/R1,hmin),hmax); } Real8 hn = iso? ht : Min(hmax,ht*maxaniso); //cerr << ht << " " << hn << "m=" << edges[i][j].m << endl; assert(ht>0 && hn>0); MatVVP2x2 Vp(1/(ht*ht),1/(hn*hn),tg); //cerr << " : " ; Metric MVp(Vp); // cerr << " : " << MVp << endl; edges[i][j].m.IntersectWith(MVp); //cerr << " . " << endl; } } // the problem is for the vertex on vertex } /* void Triangles::BoundAnisotropy(Real8 anisomax) { if (verbosity > 1) cout << " -- BoundAnisotropy by " << anisomax << endl; Real8 h1=1.e30,h2=1e-30,rx=0; Real8 coef = 1./(anisomax*anisomax); Real8 hn1=1.e30,hn2=1e-30,rnx =1.e-30; for (Int4 i=0;i2) { cout << " input : Hmin = " << sqrt(1/h2) << " Hmax = " << sqrt(1/h1) << " factor of anisotropy max = " << sqrt(rx) << endl; cout << " output: Hmin = " << sqrt(1/hn2) << " Hmax = " << sqrt(1/hn1) << " factor of anisotropy max = " << sqrt(rnx) << endl; } } */ void Triangles::BoundAnisotropy(Real8 anisomax,Real8 hminaniso) { double lminaniso = 1/ (Max(hminaniso*hminaniso,1e-100)); if (verbosity > 1) cout << " -- BoundAnisotropy by " << anisomax << endl; Real8 h1=1.e30,h2=1e-30,rx=0; Real8 coef = 1./(anisomax*anisomax); Real8 hn1=1.e30,hn2=1e-30,rnx =1.e-30; for (Int4 i=0;i2) { cout << " input : Hmin = " << sqrt(1/h2) << " Hmax = " << sqrt(1/h1) << " factor of anisotropy max = " << sqrt(rx) << endl; cout << " output: Hmin = " << sqrt(1/hn2) << " Hmax = " << sqrt(1/hn1) << " factor of anisotropy max = " << sqrt(rnx) << endl; } } void Triangles::IntersectConsMetric(const double * s,const Int4 nbsol,const int * typsols, const Real8 hmin1,const Real8 hmax1,const Real8 coef, const Real8 anisomax ,const Real8 CutOff,const int NbJacobi, const int DoNormalisation,const double power,const int choice) { // the array of solution s is store // sol0,sol1,...,soln on vertex 0 // sol0,sol1,...,soln on vertex 1 // etc. // choise = 0 => H is computed with green formule // otherwise => H is computed from P2 on 4T const int dim = 2; int sizeoftype[] = { 1, dim ,dim * (dim+1) / 2, dim * dim } ; // computation of the nb of field Int4 ntmp = 0; if (typsols) { for (Int4 i=0;i1e-30; Real8 hmin = Max(hmin1,MinimalHmin()); Real8 hmax = Min(hmax1,MaximalHmax()); Real8 coef2 = 1/(coef*coef); if(verbosity>1) { cout << " -- Construction of Metric: Nb of field. " << n << " nbt = " << nbt << " nbv= " << nbv << " coef = " << coef << endl << " hmin = " << hmin << " hmax=" << hmax << " anisomax = " << anisomax << " Nb Jacobi " << NbJacobi << " Power = " << power ; if (RelativeMetric) cout << " RelativeErr with CutOff= " << CutOff << endl; else cout << " Absolute Err" <link) // no adj triangle => edge on boundary OnBoundary[Number(t[VerticesOfTriangularEdge[j][0]])]=1, OnBoundary[Number(t[VerticesOfTriangularEdge[j][1]])]=1, nbb++; } workT[i] = nbb; Mmass[iA] += dett; Mmass[iB] += dett; Mmass[iC] += dett; if((nbb==0)|| !choice) { Mmassxx[iA] += dett; Mmassxx[iB] += dett; Mmassxx[iC] += dett; } } else workT[i]=-1; // for (Int4 kcount=0;kcount2) cout << " Solution " << nusol << " Min = " << smin << " Max = " << smax << " Delta =" << sdelta << " cnorm = " << cnorm << " Nb of fields =" << nbfield << endl; if ( sdelta < 1.0e-10*Max(absmax,1e-20) && (nbfield ==1)) { if (verbosity>2) cout << " Solution " << nusol << " is constant. We skip. " << " Min = " << smin << " Max = " << smax << endl; continue; } double *sf = ss; for (Int4 nufield=0;nufieldlink) { Vertex &v = *ta.OppositeVertex(); R2 V = v; Int4 iV = Number(v); Real8 lA = bamg::Area2(V,B,C)/dd; Real8 lB = bamg::Area2(A,V,C)/dd; Real8 lC = bamg::Area2(A,B,V)/dd; taa[0][j] = lB*lC; taa[1][j] = lC*lA; taa[2][j] = lA*lB; //Real8 xx = V.x-V.y; //Real8 yy = V.x + V.y; //cout << " iv " << ss[iV*n] << " == " << (8*xx*xx+yy*yy) // << " l = " << lA << " " << lB << " " << lC // << " = " << lA+lB+lC << " " << V << " == " << A*lA+B*lB+C*lC << endl; lla = lA,llb=lB,llc=lC,llf=ss[iV*n] ; bb[j] = ss[iV*n] - ( sA*lA + sB*lB + sC*lC ) ; } else { nbb++; taa[0][j]=0; taa[1][j]=0; taa[2][j]=0; taa[j][j]=1; bb[j]=0; } } // resolution of 3x3 lineaire system transpose Real8 det33 = det3x3(taa[0],taa[1],taa[2]); Real8 cBC = det3x3(bb,taa[1],taa[2]); Real8 cCA = det3x3(taa[0],bb,taa[2]); Real8 cAB = det3x3(taa[0],taa[1],bb); assert(det33); // det33=1; // verif // cout << " " << (taa[0][0]*cBC + taa[1][0]*cCA + taa[2][0] * cAB)/det33 << " == " << bb[0] ; // cout << " " << (taa[0][1]*cBC + taa[1][1]*cCA + taa[2][1] * cAB)/det33 << " == " << bb[1]; // cout << " " << (taa[0][2]*cBC + taa[1][2]*cCA + taa[2][2] * cAB)/det33 << " == " << bb[2] // << " -- " ; //cout << lla*sA + llb*sB+llc*sC+ (lla*llb* cAB + llb*llc* cBC + llc*lla*cCA)/det33 // << " == " << llf << endl; // computation of the gradient in the element // H( li*lj) = grad li grad lj + grad lj grad lj // grad li = njk / detT ; with i j k ={A,B,C) Real8 Hxx = cAB * ( nBC.x*nCA.x) + cBC * ( nCA.x*nAB.x) + cCA * (nAB.x*nBC.x); Real8 Hyy = cAB * ( nBC.y*nCA.y) + cBC * ( nCA.y*nAB.y) + cCA * (nAB.y*nBC.y); Real8 Hxy = cAB * ( nBC.y*nCA.x) + cBC * ( nCA.y*nAB.x) + cCA * (nAB.y*nBC.x) + cAB * ( nBC.x*nCA.y) + cBC * ( nCA.x*nAB.y) + cCA * (nAB.x*nBC.y); Real8 coef = 1.0/(3*dd*det33); Real8 coef2 = 2*coef; // cout << " H = " << Hxx << " " << Hyy << " " << Hxy/2 << " coef2 = " << coef2 << endl; Hxx *= coef2; Hyy *= coef2; Hxy *= coef2; //cout << i << " H = " << 3*Hxx/dd << " " << 3*Hyy/dd << " " << 3*Hxy/(dd*2) << " nbb = " << nbb << endl; if(nbb==0) { dxdx[iA] += Hxx; dydy[iA] += Hyy; dxdy[iA] += Hxy; dxdx[iB] += Hxx; dydy[iB] += Hyy; dxdy[iB] += Hxy; dxdx[iC] += Hxx; dydy[iC] += Hyy; dxdy[iC] += Hxy; } } else { // if edge on boundary no contribution => normal = 0 if ( ! tBC || ! tBC->link ) nBC = O; if ( ! tCA || ! tCA->link ) nCA = O; if ( ! tAB || ! tAB->link ) nAB = O; // remark we forgot a 1/2 because // $\\int_{edge} w_i = 1/2 $ if $i$ is in edge // 0 if not // if we don't take the boundary // dxdx[iA] += ( nCA.x + nAB.x ) *Grads.x; dxdx[iA] += ( nCA.x + nAB.x ) *Grads.x; dxdx[iB] += ( nAB.x + nBC.x ) *Grads.x; dxdx[iC] += ( nBC.x + nCA.x ) *Grads.x; // warning optimization (1) the divide by 2 is done on the metrix construction dxdy[iA] += (( nCA.y + nAB.y ) *Grads.x + ( nCA.x + nAB.x ) *Grads.y) ; dxdy[iB] += (( nAB.y + nBC.y ) *Grads.x + ( nAB.x + nBC.x ) *Grads.y) ; dxdy[iC] += (( nBC.y + nCA.y ) *Grads.x + ( nBC.x + nCA.x ) *Grads.y) ; dydy[iA] += ( nCA.y + nAB.y ) *Grads.y; dydy[iB] += ( nAB.y + nBC.y ) *Grads.y; dydy[iC] += ( nBC.y + nCA.y ) *Grads.y; } } // for real all triangles Int4 kk=0; for ( iv=0,k=0 ; iv0) { dxdx[iv] /= 2*Mmassxx[iv]; // warning optimization (1) on term dxdy[iv]*ci/2 dxdy[iv] /= 4*Mmassxx[iv]; dydy[iv] /= 2*Mmassxx[iv]; // Compute the matrix with abs(eigen value) Metric M(dxdx[iv], dxdy[iv], dydy[iv]); MatVVP2x2 Vp(M); //cout <2) { cout << " Field " << nufield << " of solution " << nusol << endl; cout << " before bounding : Hmin = " << sqrt(1/h2) << " Hmax = " << sqrt(1/h1) << " factor of anisotropy max = " << sqrt(rx) << endl; cout << " after bounding : Hmin = " << sqrt(1/hn2) << " Hmax = " << sqrt(1/hn1) << " factor of anisotropy max = " << sqrt(rnx) << endl; } } // end of for all field }// end for all solution delete [] detT; delete [] Mmass; delete [] dxdx; delete [] dxdy; delete [] dydy; delete [] workT; delete [] workV; delete [] Mmassxx; delete [] OnBoundary; } void Triangles::ReadMetric(const char * fmetrix,const Real8 hmin1=1.0e-30,const Real8 hmax1=1.0e30,const Real8 coef=1) { Real8 hmin = Max(hmin1,MinimalHmin()); Real8 hmax = Min(hmax1,MaximalHmax()); MeshIstream f_metrix(fmetrix); Int4 k,j; f_metrix >> k >> j ; if(verbosity>1) cout << " metrix: open " << fmetrix << ", le coef = " << coef << ", hmin = " << hmin << ", hmax = " << hmax << ( (j == 1)? " Iso " : " AnIso " )<< endl; if (k != nbv || !(j == 1 || j == 3)) { cerr << " Error Pb metrix " << k << " <> " << nbv << " or 1 or 3 <> " << j << endl; MeshError(1002); } cout << " j = " << j << endl; // Int4 nberr = 0; for (Int4 iv=0;iv> h ; vertices[iv].m=Metric(Max(hmin,Min(hmax, h*coef))); } else if (j==3) { Real8 a,b,c; f_metrix >> a >> b >> c ; MetricAnIso M(a,b,c); MatVVP2x2 Vp(M/coef); Vp.Maxh(hmin); Vp.Minh(hmax); vertices[iv].m = Vp; } } } void Triangles::WriteMetric(ostream & f,int iso) { if (iso) { f << nbv <<" " << 1 << endl ; for (Int4 iv=0;iv1) cout << " -- Limit the subdivision of a edges in the new mesh by " << maxsubdiv << endl ; // for all the edges // if the len of the edge is to long Int4 it,nbchange=0; Real8 lmax=0; for (it=0;it maxsubdiv2) { R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M Real8 lc = M(AC,AC); D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC; D2xD2 Rt1(Rt.inv()); D2xD2 D(maxsubdiv2,0,0,lc); D2xD2 MM = Rt1*D*Rt1.t(); #ifdef DRAWING1 v0.m.Draw(v0); #endif v0.m = M = MetricAnIso(MM.x.x,MM.y.x,MM.y.y); #ifdef DRAWING1 v0.m.Draw(v0); #endif // cout << " M(AB,AB) = " << M(AB,AB) << " == " << maxsubdiv // << " M(AC,AC) = " << M(AC,AC) << " == " << lc << endl; nbchange++; } M = v1; l = M(AB,AB); lmax = Max(lmax,l); if(l> maxsubdiv2) { R2 AC = M.Orthogonal(AB);// the ortogonal vector of AB in M Real8 lc = M(AC,AC); D2xD2 Rt(AB,AC);// Rt.x = AB , Rt.y = AC; D2xD2 Rt1(Rt.inv()); D2xD2 D(maxsubdiv2,0,0,lc); D2xD2 MM = Rt1*D*Rt1.t(); #ifdef DRAWING1 v1.m.Draw(v1); #endif v1.m = M = MetricAnIso(MM.x.x,MM.y.x,MM.y.y); #ifdef DRAWING1 v1.m.Draw(v1); inquire(); #endif // cout << " M(AB,AB) = " << M(AB,AB) << " == " << maxsubdiv // << " M(AC,AC) = " << M(AC,AC) << " == " << lc << endl; nbchange++; } } } } if(verbosity>3) cout << " Nb of metric change = " << nbchange << " Max of the subdivision of a edges before change = " << sqrt(lmax) << endl; #ifdef DRAWING2 inquire(); #endif } void Triangles::SmoothMetric(Real8 raisonmax) { if(raisonmax<1.1) return; if(verbosity > 1) cout << " -- Triangles::SmoothMetric raisonmax = " << raisonmax << " " <=0&& kk++<100) { kch=0; for (i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) { // pour tous les triangles autour du sommet s // cout << kk << " i = " << i << " " << ip << endl; Triangle * t= vertices[i].t; assert(t); Vertex & vi = vertices[i]; TriangleAdjacent ta(t,EdgesVertexTriangle[vertices[i].vint][0]); Vertex *pvj0 = ta.EdgeVertex(0); while (1) { // cout << i << " " << Number(ta.EdgeVertex(0)) << " " // << Number(ta.EdgeVertex(1)) << " ---> " ; ta=Previous(Adj(ta)); // cout << Number(ta.EdgeVertex(0)) << " " << Number(ta.EdgeVertex(1)) << endl; assert(vertices+i == ta.EdgeVertex(1)); Vertex *pvj = (ta.EdgeVertex(0)); Vertex & vj = *pvj; if ( pvj ) { j= &vj-vertices; assert(j>=0 && j < nbv); R2 Aij = (R2) vj - (R2) vi; Real8 ll = Norme2(Aij); if (0) { Real8 hi = ll/vi.m(Aij); Real8 hj = ll/vj.m(Aij); if(hi < hj) { Real8 dh=(hj-hi)/ll; //cout << " dh = " << dh << endl; if (dh>logseuil) { vj.m.IntersectWith(vi.m/(1 +logseuil*ll/hi)); if(first_np_or_next_t1[j]<0) kch++,first_np_or_next_t1[j]=Head1,Head1=j; } } } else { Real8 li = vi.m(Aij); //Real8 lj = vj.m(Aij); // if ( i == 2 || j == 2) // cout << " inter " << i << " " << j << " " << ((1 +logseuil*li)) << endl; if( vj.m.IntersectWith(vi.m/(1 +logseuil*li)) ) //if( vj.m.IntersectWith(vi.m*(lj/li/(1 +logseuil*lj))) ) if(first_np_or_next_t1[j]<0) // if the metrix change kch++,first_np_or_next_t1[j]=Head1,Head1=j; } } if ( &vj == pvj0 ) break; } } Head0 = Head1; Head1 = -1; Exchange(first_np_or_next_t0,first_np_or_next_t1); if(verbosity>5) cout << " Iteration " << kk << " Nb de vertices with change " << kch << endl; } if(verbosity>2 && verbosity < 5) cout << " Nb of Loop " << kch << endl; delete [] first_np_or_next_t0; delete [] first_np_or_next_t1; } void Geometry::ReadMetric(const char * fmetrix,Real8 hmin=1.0e-30,Real8 hmax=1.0e30,Real8 coef=1) { hmin = Max(hmin,MinimalHmin()); MeshIstream f_metrix(fmetrix); Int4 k,j; f_metrix >> k >> j ; if(verbosity>1) cout << " -- ReadMetric " << fmetrix << ", coef = " << coef << ", hmin = " << hmin << ", hmax = " << hmax << ( (j == 1)? " Iso " : " AnIso " ) << endl; if (k != nbv || !(j == 1 || j == 3)) { cerr << " Error Pb metrix " << k << " <> " << nbv << " or 1 or 3 <> " << j << endl; MeshError(1003);} // Int4 nberr = 0; for (Int4 iv=0;iv> h ; vertices[iv].m=Metric(Max(hmin,Min(hmax, h*coef))); } else if (j==3) { Real8 a,b,c; f_metrix >> a >> b >> c ; MetricAnIso M(a,b,c); MatVVP2x2 Vp(M/coef); Vp.Maxh(hmin); Vp.Minh(hmax); vertices[iv].m = Vp; } } } Real8 LengthInterpole(const MetricAnIso Ma,const MetricAnIso Mb, R2 AB) { Real8 k=1./2.; int level=0; static int kkk=0; static Metric Ms1[32],Ms2[32]; static Real8 lMs1[32],lMs2[32]; static double K[32]; Real8 l=0,sss=0; Ms1[level]=Ma; Ms2[level]=Mb; Real8 sa = Ma(AB); Real8 sb = Mb(AB); lMs1[level]=sa; lMs2[level]=sb; K[level]=k; level++; int i=0; Real8 * L= LastMetricInterpole.L, *S = LastMetricInterpole.S; Real8 sstop = 0.1; // Max(0.6,(sa+sb)/5000); while (level) { level--; Metric M1=Ms1[level]; Metric M2=Ms2[level]; k=K[level]; Real8 s1= lMs1[level]; Real8 s2= lMs2[level]; Real8 s= (s1+s2)*k; // if (level >20 && i < 2030-level) // cout << " level " << level << " " << i << " " << s << " " << k < sstop && level < 30 && i < 500-level ) { Metric Mi(0.5,M1,0.5,M2); Real8 si = Mi(AB); if( Abs((s1+s2)-(si+si)) > s1*0.001) { k=k/2; // we begin by the end to walk in the correct sens from a to b // due to the stack Ms1[level]=Mi; Ms2[level]=M2; lMs1[level]=si; lMs2[level]=s2; K[level]=k; level++; Ms1[level]=M1; Ms2[level]=Mi; lMs1[level]=s1; lMs2[level]=si; K[level]=k; level++; } else L[i]= l += s,S[i]=sss+=k,i++; } else L[i]= l += s,S[i]=sss+=k,i++;//cout << i << " l = " << l << " sss = " << sss << endl; } // warning for optimisation S is in [0:0.5] not in [0:1] assert(i<512); LastMetricInterpole.lab=l; LastMetricInterpole.opt=i; if (i>200 && kkk++<10) cout << "Warning LengthInterpole: ( i = " << i << " l = " << l << " sss " << sss << " ) " << sstop <=L[j]) r=1; else { while (j-i>1) { k= (i+j)/2; if(l<=L[k]) j=k;// l<=L[j] else i=k; // L[i] //#include #include #include #include "Meshio.h" #include "Mesh2.h" #include "QuadTree.h" namespace bamg { #define INTER_SEG(a,b,x,y) (((y) > (a)) && ((x) <(b))) #define ABS(i) ((i)<0 ?-(i) :(i)) #define MAX1(i,j) ((i)>(j) ?(i) :(j)) #define NORM(i1,j1,i2,j2) MAX1(ABS((i1)-(j1)),ABS((i2)-(j2))) #define IJ(i,j,l) ( ( j & l) ? (( i & l) ? 3 : 2 ) :( ( i & l)? 1 : 0 )) #define I_IJ(k,l) (( k&1) ? l : 0) #define J_IJ(k,l) (( k&2) ? l : 0) #ifdef DRAWING void QuadTree::Draw() { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Icoor1 ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; IntQuad hb = MaxISize; if(!root) return; // Int4 kkk =0; pb[0]= root; pi[0]= root->n>0 ?(int) root->n : 4 ; ii[0]=jj[0]=0; do{ b= pb[l]; while (pi[l]--) { if (b->n>0) // Vertex QuadTreeBox none empty { // for (int k=0;kn;k++) { I2 i2 = b->v[k]->i; IMoveTo(i2.x,i2.y+50); ILineTo(i2.x,i2.y-50); IMoveTo(i2.x+50,i2.y); ILineTo(i2.x-50,i2.y); assert(ii[l] <= i2.x); assert(jj[l] <= i2.y); assert(ii[l] +hb > i2.x); assert(jj[l] +hb > i2.y); } break; } else // Pointer QuadTreeBox { int lll = pi[l]; QuadTreeBox *b0=b; if ((b=b->b[lll])) { hb >>=1 ; // div by 2 Icoor1 iii = ii[l]+I_IJ(lll,hb); Icoor1 jjj = jj[l]+J_IJ(lll,hb); pb[++l]= b; pi[l]= 4; ii[l]= iii; jj[l]= jjj; IMoveTo(ii[l],jj[l]); ILineTo(ii[l]+hb,jj[l]); ILineTo(ii[l]+hb,jj[l]+hb); ILineTo(ii[l] ,jj[l]+hb); ILineTo(ii[l] ,jj[l]); } else { Icoor1 iii = ii[l]+I_IJ(lll,hb/2); Icoor1 jjj = jj[l]+J_IJ(lll,hb/2); b=b0; IMoveTo(iii, jjj); ILineTo(iii+hb/2,jjj+hb/2); IMoveTo(iii+hb/2,jjj); ILineTo(iii ,jjj+hb/2); } } } hb <<= 1; // mul by 2 } while (l--); } #endif Vertex * QuadTree::NearestVertex(Icoor1 i,Icoor1 j) { QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Icoor1 ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; IntQuad h=MaxISize,h0; IntQuad hb = MaxISize; Icoor1 i0=0,j0=0; Icoor1 iplus( in) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) Icoor1 hb2 = hb >> 1 ; int k = IJ(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; i0 += I_IJ(k,hb2); // i orign of QuadTreeBox j0 += J_IJ(k,hb2); // j orign of QuadTreeBox hb = hb2; } if ( n0 > 0) { for( int k=0;kv[k]->i; h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k];} NbVerticesSearch++; } return vn; } // general case ----- pb[0]= b; pi[0]=b->n>0 ?(int) b->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; I2 i2 = b->v[k]->i; h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 Icoor1 iii = ii[l]+I_IJ(k,hb); Icoor1 jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return vn; } Vertex * QuadTree::ToClose(Vertex & v,Real8 seuil,Icoor1 hx,Icoor1 hy) { const Icoor1 i=v.i.x; const Icoor1 j=v.i.y; const R2 X(v.r); const Metric Mx(v.m); QuadTreeBox * pb[ MaxDeep ]; int pi[ MaxDeep ]; Icoor1 ii[ MaxDeep ], jj [ MaxDeep]; int l=0; // level QuadTreeBox * b; Icoor1 h=MaxISize; Icoor1 hb = MaxISize; Icoor1 i0=0,j0=0; // Vertex *vn=0; if (!root->n) return 0; // empty tree // general case ----- pb[0]=root; pi[0]=root->n>0 ?(int) root->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; do { b= pb[l]; while (pi[l]--) { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; I2 i2 = b->v[k]->i; if ( ABS(i-i2.x) v[k]->r); Real8 dd; // old code if( Mx(XY) + b->v[k]->m(XY) < seuil ) if( (dd= LengthInterpole(Mx(XY), b->v[k]->m(XY))) < seuil ) { // cout << CurrentTh->Number(v) << "is To Close " // << CurrentTh->Number( b->v[k]) << " l=" <v[k]; } } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 long iii = ii[l]+I_IJ(k,hb); long jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,i-hx,i+hx) && INTER_SEG(jjj,jjj+hb,j-hy,j+hy)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return 0; } void QuadTree::Add( Vertex & w) { QuadTreeBox ** pb , *b; long i=w.i.x, j=w.i.y,l=MaxISize; pb = &root; // cout << pb << " " << &root << endl; while( (b=*pb) && (b->n<0)) { b->n--; l >>= 1; pb = &b->b[IJ(i,j,l)]; } if (b) { if (b->n > 3 && b->v[3] == &w) return; if (b->n > 2 && b->v[2] == &w) return; if (b->n > 1 && b->v[1] == &w) return; if (b->n > 0 && b->v[0] == &w) return; } assert(l); while ((b= *pb) && (b->n == 4)) // the QuadTreeBox is full { Vertex *v4[4]; // copy of the QuadTreeBox vertices v4[0]= b->v[0]; v4[1]= b->v[1]; v4[2]= b->v[2]; v4[3]= b->v[3]; b->n = -b->n; // mark is pointer QuadTreeBox b->b[0]=b->b[1]=b->b[2]=b->b[3]=0; // set empty QuadTreeBox ptr l >>= 1; // div the size by 2 for ( int k=0;k<4;k++) // for the 4 vertices find the sub QuadTreeBox ij { int ij; QuadTreeBox * bb = b->b[ij=IJ(v4[k]->i.x,v4[k]->i.y,l)]; if (!bb) bb=b->b[ij]=NewQuadTreeBox(); // alloc the QuadTreeBox // cout << bb << " " << k << " " << ij << endl; bb->v[bb->n++] = v4[k]; } pb = &b->b[IJ(i,j,l)]; } if (!(b = *pb)) b=*pb= NewQuadTreeBox(); // alloc the QuadTreeBox // cout << b << " " << b->n << endl; b->v[b->n++]=&w; // we add the vertex NbVertices++; } QuadTree::QuadTree(Triangles * t,long nbv) : lenStorageQuadTreeBox(t->nbvx/8+10), th(t), NbQuadTreeBox(0), NbVertices(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0) { if (nbv == -1) nbv = t->nbv; sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); assert( MaxISize > MaxICoor); for (Int4 i=0;ivertices[i]); #ifdef DRAWING1 Draw(); #endif } QuadTree::QuadTree() : lenStorageQuadTreeBox(100), th(0), NbQuadTreeBox(0), NbVertices(0), NbQuadTreeBoxSearch(0), NbVerticesSearch(0) { sb =new StorageQuadTreeBox(lenStorageQuadTreeBox); root=NewQuadTreeBox(); } QuadTree::StorageQuadTreeBox::StorageQuadTreeBox(long ll,StorageQuadTreeBox *nn) { len = ll; n = nn; b = new QuadTreeBox[ll]; for (int i = 0; i n) return vn; // empty tree while( (n0 = b->n) < 0) { // search the non empty // QuadTreeBox containing the point (i,j) Icoor1 hb2 = hb >> 1 ; int k = IJ(iplus,jplus,hb2);// QuadTreeBox number of size hb2 contening i;j QuadTreeBox * b0= b->b[k]; if ( ( b0 == 0) || (b0->n == 0) ) break; // null box or empty => break NbQuadTreeBoxSearch++; b=b0; i0 += I_IJ(k,hb2); // i orign of QuadTreeBox j0 += J_IJ(k,hb2); // j orign of QuadTreeBox hb = hb2; } if ( n0 > 0) { for( int k=0;kv[k]->i; // try if is in the right sens -- h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k];} NbVerticesSearch++; } if (vn) return vn; } // general case ----- // INITIALISATION OF THE HEAP l =0; // level pb[0]= b; pi[0]=b->n>0 ?(int) b->n : 4 ; ii[0]=i0; jj[0]=j0; h=hb; do { // walk on the tree b= pb[l]; while (pi[l]--) // loop on 4 element of the box { int k = pi[l]; if (b->n>0) // Vertex QuadTreeBox none empty { NbVerticesSearch++; I2 i2 = b->v[k]->i; // if good sens when try -- h0 = NORM(iplus,i2.x,jplus,i2.y); if (h0 v[k]; } } else // Pointer QuadTreeBox { QuadTreeBox *b0=b; NbQuadTreeBoxSearch++; if ((b=b->b[k])) { hb >>=1 ; // div by 2 Icoor1 iii = ii[l]+I_IJ(k,hb); Icoor1 jjj = jj[l]+J_IJ(k,hb); if (INTER_SEG(iii,iii+hb,iplus-h,iplus+h) && INTER_SEG(jjj,jjj+hb,jplus-h,jplus+h)) { pb[++l]= b; pi[l]= b->n>0 ?(int) b->n : 4 ; ii[l]= iii; jj[l]= jjj; } else b=b0, hb <<=1 ; } else b=b0; } } hb <<= 1; // mul by 2 } while (l--); return vn; } } // end of namespace bamg freefem++-3.61-1/src/bamglib/write_hdf5.cpp000644 000767 000024 00000046311 13256636774 020560 0ustar00hechtstaff000000 000000 #include "config.h" extern long verbosity; #ifdef HAVE_HDF5 #include "write_hdf5.hpp" using std::max; using std::min; WriteHdf5::WriteHdf5(const char *ffname, Int4 nbelem, Int4 nbvertex) : hdf5_filename(ffname), nbofelem(nbelem), nbofvertex(nbvertex) { //constructeur //creation du fichier hdf5 file_id = H5Fcreate(hdf5_filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); status=0; } WriteHdf5::~WriteHdf5() { } void WriteHdf5::WriteHdf5MeshFile2D(float coordinates[][2], int connec[][3]) { //ecriture du maillage 2D au format hdf5 pour paraview hid_t group_id_connec; hid_t group_id_coord; hid_t dataset_id_coord, dataspace_id_coord; hid_t aid_max_x, aid_min_x, aid_max_y, aid_min_y; hid_t attr_max_x, attr_min_x, attr_max_y, attr_min_y; hid_t dataset_id_elem2node, dataspace_id_elem2node; hid_t dataset_id_nelem, dataspace_id_nelem; hid_t dataset_id_nnode, dataspace_id_nnode; hid_t dataset_id_elemtype, dataspace_id_elemtype; hid_t dataset_id_meshtype, dataspace_id_meshtype; hid_t type_id,type_mesh_id; hsize_t dims_coord[2]; hsize_t dims_x_max[1]; hsize_t dims_x_min[1]; hsize_t dims_y_max[1]; hsize_t dims_y_min[1]; hsize_t dims_elem2node[2]; hsize_t dims_nelem[1]; hsize_t dims_nnode[1]; dims_coord[0] = nbofvertex; dims_coord[1] = 2; dims_x_max[0] = 1; dims_x_min[0] = 1; dims_y_max[0] = 1; dims_y_min[0] = 1; dims_elem2node[0] = nbofelem; dims_elem2node[1] = 3; dims_nelem[0] = 1; dims_nnode[0] = 1; float x_max = coordinates[0][0]; float x_min = coordinates[0][0]; float y_max = coordinates[0][1]; float y_min = coordinates[0][1]; for (int i=0;i type_char(3); vector res_char(2); type_char[0]= "Scalar"; type_char[1]= "Vector"; type_char[2]= "Vector"; res_char[0]= "Cell"; res_char[1]= "Node"; size_t size_datafieldname = fieldname->size() + 1; char * char_datafieldname = new char[size_datafieldname]; strncpy(char_datafieldname, fieldname->c_str(), size_datafieldname); char * char_datafieldname_tot=new char[size_data+size_datafieldname]; strncpy(char_datafieldname_tot, str_data.c_str(), size_data); strncat(char_datafieldname_tot,char_datafieldname,size_data+size_datafieldname); strncpy(data_type, str_float.c_str(), size_str_float); if(result_order==0) { dims_data[0] = nbofelem; } else { dims_data[0] = nbofvertex; } dims_data[1] = trans_dim; //ajout des champs fonction de la dimension de l'element (triangle ou noeud) et du type //de donnees (vecteur, ...) affectees a l'element strncat(data_type, res_char[result_order].c_str(), size_str_float + (res_char[result_order].size()+1)); strncat(data_type, str_underscore.c_str(), size_str_float + (res_char[result_order].size()+1) + size_str_underscore); strncat(data_type, type_char[what_type].c_str(), size_str_float + (res_char[result_order].size()+1) + size_str_underscore + (type_char[what_type].size() + 1)); dataspace_id_data = H5Screate_simple(2, dims_data, NULL); dataset_id_data = H5Dcreate2(file_id, char_datafieldname_tot, H5T_IEEE_F32LE, dataspace_id_data, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dataset_id_data, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, field); type_id = H5Tcopy(H5T_C_S1); status = H5Tset_size(type_id, 17); aid_type = H5Screate(H5S_SCALAR); attr_type = H5Acreate2(dataset_id_data, "TYPE", type_id, aid_type, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(attr_type, type_id, data_type); status = H5Aclose(attr_type); status = H5Sclose(aid_type); status = H5Dclose(dataset_id_data); status = H5Sclose(dataspace_id_data); delete [] char_datafieldname; delete [] char_datafieldname_tot; } void WriteHdf5::WriteHdf5SolFile2DFinalize() { //fermeture du groupe /Data et du fichier hdf5 status = H5Gclose(group_id_data); status = H5Fclose(file_id); if (status != 0) cout << "HDF5 error" << endl; if(verbosity>2) cout << "save hdf5 file solution : " << hdf5_filename <2 vector type_char(3); vector res_char(2); type_char[0]= "Scalar"; type_char[1]= "Vector"; type_char[2]= "Tensor6"; res_char[0]= "Cell"; res_char[1]= "Node"; size_t size_datafieldname = fieldname->size() + 1; char * char_datafieldname = new char[size_datafieldname]; strncpy(char_datafieldname, fieldname->c_str(), size_datafieldname); char * char_datafieldname_tot=new char[size_data+size_datafieldname]; strncpy(char_datafieldname_tot, str_data.c_str(), size_data); strncat(char_datafieldname_tot,char_datafieldname,size_data+size_datafieldname); strncpy(data_type, str_float.c_str(), size_str_float); if(result_order==0) { dims_data[0] = nbofelem; } else { dims_data[0] = nbofvertex; } dims_data[1] = trans_dim; //ajout des champs fonction de la dimension de l'element (tetraedre ou noeud) et du type //de donnees (tenseur de 6 composantes, ...) affectees a l'element strncat(data_type, res_char[result_order].c_str(), size_str_float + (res_char[result_order].size()+1)); strncat(data_type, str_underscore.c_str(), size_str_float + (res_char[result_order].size()+1) + size_str_underscore); strncat(data_type, type_char[what_type].c_str(), size_str_float + (res_char[result_order].size()+1) + size_str_underscore + (type_char[what_type].size() + 1)); dataspace_id_data = H5Screate_simple(2, dims_data, NULL); dataset_id_data = H5Dcreate2(file_id, char_datafieldname_tot, H5T_IEEE_F32LE, dataspace_id_data, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dataset_id_data, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, field); type_id = H5Tcopy(H5T_C_S1); status = H5Tset_size(type_id, 18); aid_type = H5Screate(H5S_SCALAR); attr_type = H5Acreate2(dataset_id_data, "TYPE", type_id, aid_type, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(attr_type, type_id, data_type); status = H5Aclose(attr_type); status = H5Sclose(aid_type); status = H5Dclose(dataset_id_data); status = H5Sclose(dataspace_id_data); delete [] char_datafieldname; delete [] char_datafieldname_tot; } void WriteHdf5::WriteHdf5SolFile3DFinalize() { //fermeture du groupe /Data et du fichier hdf5 status = H5Gclose(group_id_data); status = H5Fclose(file_id); if (status != 0) cout << "HDF5 error" << endl; if(verbosity>2) cout << "save hdf5 file solution : " << hdf5_filename < #include #include #include #include "Meshio.h" #include "Mesh2.h" #include "QuadTree.h" #include "SetOfE4.h" namespace bamg { static const Direction NoDirOfSearch=Direction(); #ifdef __MWERKS__ #pragma global_optimizer on #pragma optimization_level 1 //#pragma inline_depth 0 #endif class DoubleAndInt4 { public: double q; Int4 i3j; int operator<(DoubleAndInt4 a){return q > a.q;} };// to sort by decroissant template inline void HeapSort(T *c,long n) { long l,j,r,i; T crit; c--; // on decale de 1 pour que le tableau commence a 1 if( n <= 1) return; l = n/2 + 1; r = n; while (1) { // label 2 if(l <= 1 ) { // label 20 crit = c[r]; c[r--] = c[1]; if ( r == 1 ) { c[1]=crit; return;} } else crit = c[--l]; j=l; while (1) {// label 4 i=j; j=2*j; if (j>r) {c[i]=crit;break;} // L8 -> G2 if ((j G2 } } } Triangle * swapTest(Triangle *t1,Int2 a); // double QuadQuality(const Vertex & a,const Vertex &b,const Vertex &c,const Vertex &d) { // calcul de 4 angles -- R2 A((R2)a),B((R2)b),C((R2)c),D((R2)d); R2 AB(B-A),BC(C-B),CD(D-C),DA(A-D); // Move(A),Line(B),Line(C),Line(D),Line(A); const Metric & Ma = a; const Metric & Mb = b; const Metric & Mc = c; const Metric & Md = d; double lAB=Norme2(AB); double lBC=Norme2(BC); double lCD=Norme2(CD); double lDA=Norme2(DA); AB /= lAB; BC /= lBC; CD /= lCD; DA /= lDA; // version aniso double cosDAB= Ma(DA,AB)/(Ma(DA)*Ma(AB)),sinDAB= Det(DA,AB); double cosABC= Mb(AB,BC)/(Mb(AB)*Mb(BC)),sinABC= Det(AB,BC); double cosBCD= Mc(BC,CD)/(Mc(BC)*Mc(CD)),sinBCD= Det(BC,CD); double cosCDA= Md(CD,DA)/(Md(CD)*Md(DA)),sinCDA= Det(CD,DA); double sinmin=Min(Min(sinDAB,sinABC),Min(sinBCD,sinCDA)); // cout << A << B << C << D ; // cout << " sinmin " << sinmin << " " << cosDAB << " " << cosABC << " " << cosBCD << " " << cosCDA << endl; // rattente(1); if (sinmin<=0) return sinmin; return 1.0-Max(Max(Abs(cosDAB),Abs(cosABC)),Max(Abs(cosBCD),Abs(cosCDA))); } GeometricalEdge * Triangles::ProjectOnCurve( Edge & BhAB, Vertex & vA, Vertex & vB, Real8 theta, Vertex & R,VertexOnEdge & BR,VertexOnGeom & GR) { void *pA=0,*pB=0; Real8 tA=0,tB=0; R2 A=vA,B=vB; Vertex * pvA=&vA, * pvB=&vB; if (vA.vint == IsVertexOnVertex) { // cout << " Debut vertex = " << BTh.Number(vA.onbv) ; pA=vA.onbv; } else if (vA.vint == IsVertexOnEdge) { pA=vA.onbe->be; tA=vA.onbe->abcisse; // cout << " Debut edge = " << BTh.Number(vA.onbv) << " " << tA ; } else {cerr << "ProjectOnCurve On Vertex " << BTh.Number(vA) << " " << endl; cerr << " forget call to SetVertexFieldOnBTh" << endl; MeshError(-1); } if (vB.vint == IsVertexOnVertex) { // cout << " Fin vertex = " << BTh.Number(vB.onbv) << endl; pB=vB.onbv; } else if(vB.vint == IsVertexOnEdge) { pB=vB.onbe->be; tB=vB.onbe->abcisse; // cout << " Fin edge = " << BTh.Number(vB.onbe->be) << " " << tB ; } else {cerr << "ProjectOnCurve On Vertex " << BTh.Number(vB) << " " << endl; cerr << " forget call to SetVertexFieldOnBTh" << endl; MeshError(-1); } Edge * e = &BhAB; assert( pA && pB && e); // be carefull the back ground edge e is on same geom edge // of the initiale edge def by the 2 vertex A B; assert(e>=BTh.edges && e !IsRequiredVertex if (vA.vint == IsVertexOnEdge) if (tA<=0) assert(! (*vA.onbe->be)[0].on->IsRequiredVertex()); else if (tA>=1) assert(!(*vA.onbe->be)[1].on->IsRequiredVertex()); #endif if( vA.vint == IsVertexOnEdge) { // find the start edge e = vA.onbe->be; } else if (vB.vint == IsVertexOnEdge) { theta = 1-theta; Exchange(tA,tB); Exchange(pA,pB); Exchange(pvA,pvB); Exchange(A,B); e = vB.onbe->be; // cout << " EXCHANGE A et B) " << endl; } else { // do the search by walking assert(0 /* A FAIRE */); } // find the direction of walking with sens of edge and pA,PB; R2 AB=B-A; Real8 cosE01AB = (( (R2) (*e)[1] - (R2) (*e)[0] ) , AB); int kkk=0; int sens = (cosE01AB>0) ? 1 : 0; // Real8 l=0; // length of the edge AB Real8 abscisse = -1; for (int cas=0;cas<2;cas++) {// 2 times algo: // 1 for computing the length l // 2 for find the vertex int iii; Vertex *v0=pvA,*v1; Edge *neee,*eee; Real8 lg =0; // length of the curve Real8 te0; // we suppose take the curve's abcisse // cout << kkk << " e = " << BTh.Number(e) << " v0= " // << BTh.Number(v0) << " v1 = " << BTh.Number((*e)[sens]) << endl; for ( eee=e,iii=sens,te0=tA; eee && ((( void*) eee) != pB) && (( void*) (v1=&((*eee)[iii]))) != pB ; neee = eee->adj[iii],iii = 1-neee->Intersection(*eee),eee = neee,v0=v1,te0=1-iii ) { // cout << kkk << " eee = " << BTh.Number(eee) << " v0= " // << BTh.Number(v0) << " v1 = " << BTh.Number(v1) << endl; assert(kkk++<100); assert(eee); Real8 lg0 = lg; Real8 dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0); lg += dp; if (cas && abscisse <= lg) { // ok we find the geom edge Real8 sss = (abscisse-lg0)/dp; Real8 thetab = te0*(1-sss)+ sss*iii; assert(thetab>=0 && thetab<=1); BR = VertexOnEdge(&R,eee,thetab); // cout << Number(R) << " = " << thetab << " on " << BTh.Number(eee) // << " = " << R << endl; return Gh.ProjectOnCurve(*eee,thetab,R,GR); } } // we find the end if (v1 != pvB) { if (( void*) v1 == pB) tB = iii; Real8 lg0 = lg; assert(eee); v1 = pvB; Real8 dp = LengthInterpole(v0->m,v1->m,(R2) *v1 - (R2) *v0); lg += dp; abscisse = lg*theta; if (abscisse <= lg && abscisse >= lg0 ) // small optimisation we know the lenght because end { // ok we find the geom edge Real8 sss = (abscisse-lg0)/dp; Real8 thetab = te0*(1-sss)+ sss*tB; assert(thetab>=0 && thetab<=1); BR = VertexOnEdge(&R,eee,thetab); // cout << kkk << " eee = " << BTh.Number(eee) << " v0= " // << BTh.Number(v0) << " " << te0 // << " v1 = " << BTh.Number(v1) << " " << tB << endl; //out << Number(R) << " Opt = " << thetab << " on " << BTh.Number(eee) // << " = " << R << endl; return Gh.ProjectOnCurve(*eee,thetab,R,GR); } } abscisse = lg*theta; } cerr << " Big Bug" << endl; MeshError(678); return 0; // just for the compiler } void Triangles::MakeQuadrangles(double costheta) { if (verbosity>2) cout << " -- MakeQuadrangles costheta = " << costheta << endl; if (verbosity>5) cout << " (in) Nb of Quadrilaterals = " << NbOfQuad << " Nb Of Triangles = " << nbt-NbOutT- NbOfQuad*2 << " Nb of outside triangles = " << NbOutT << endl; if (costheta >1) { if (verbosity>5) cout << " do nothing costheta >1 "<< endl; return;} Int4 nbqq = (nbt*3)/2; DoubleAndInt4 *qq = new DoubleAndInt4[nbqq]; Int4 i,ij; int j; Int4 k=0; for (i=0;i=costheta) qq[k++].i3j=i*3+j; // sort qq HeapSort(qq,k); Int4 kk=0; for (ij=0;ij=costheta) triangles[i].SetHidden(j),kk++; } NbOfQuad = kk; if (verbosity>2) { cout << " (out) Nb of Quadrilaterals = " << NbOfQuad << " Nb Of Triangles = " << nbt-NbOutT- NbOfQuad*2 << " Nb of outside triangles = " << NbOutT << endl; } delete [] qq; #ifdef DRAWING2 Draw(); inquire(); #endif } /* Triangles::BThBoundary(Edge e,Real 8) const { // pointeur of the background must be on // Edge be = e.on; } */ int Triangles::SplitElement(int choice) { Direction NoDirOfSearch; const int withBackground = &BTh != this && &BTh; if (verbosity>2) cout << " -- SplitElement " << (choice? " Q->4Q and T->4T " : " Q->4Q or T->3Q " ) << endl;; if (verbosity>5) cout << endl << " (in) Nb of Quadrilaterals = " << NbOfQuad << " Nb Of Triangles = " << nbt-NbOutT- NbOfQuad*2 << " Nb of outside triangles = " << NbOutT << endl; ReNumberingTheTriangleBySubDomain(); #ifdef DRAWING2 Draw(); inquire(); #endif //int nswap =0; const Int4 nfortria( choice ? 4 : 6); if(withBackground) { BTh.SetVertexFieldOn(); SetVertexFieldOnBTh(); } else BTh.SetVertexFieldOn(); Int4 newnbt=0,newnbv=0; Int4 * kedge = 0; Int4 newNbOfQuad=NbOfQuad; Int4 * ksplit= 0, * ksplitarray=0; Int4 kkk=0; int ret =0; if (nbvxfindtrie(Number(v0),Number(v1)); // cout << ":" << ke << "," << !!t.link << " " << &tt ; if (ke<0) // new { if (ta.t) // internal triangles all the boundary { // new internal edges Int4 ii = Number(tt); int jj = ta; kedge[3*i+j]=k;// save the vertex number kedge[3*ii+jj]=k; if (k=40); } // now do the element split newNbOfQuad = 4*NbOfQuad; nbv = k; #ifdef DRAWING2 inquire(); #endif // cout << " Nbv = " << nbv << endl; kkk = nbt; ksplit[-1] = nbt; // look on old true triangles for (i=0;i0); // def the numbering k (edge) i vertex int k0 = ke; int k1 = NextEdge[k0]; int k2 = PreviousEdge[k0]; int i0 = OppositeVertex[k0]; int i1 = OppositeVertex[k1]; int i2 = OppositeVertex[k2]; Triangle &t0=triangles[i]; Vertex * v0=t0(i0); Vertex * v1=t0(i1); Vertex * v2=t0(i2); // cout << "nbmkadj " << nbmkadj << " it=" << i < &a, B *b) {for (int i = 0; i < a.N(); ++i) {b[i] = a[i];}} // Fill a pointer with a KN template static void KnFromPtr (KN &a, B const *b) {for (int i = 0; i < a.N(); ++i) {a[i] = b[i];}}// Fill a KN with a pointer <-- to avoid the use of const_cast static int FindIndex (const KN &irow, const KN &jrow, int i, int j, int kmin, int kmax); }; ffNLP::ffNLP (Rn &x, const Rn &_xl, const Rn &_xu, const Rn &_gl, const Rn &_gu, ScalarFunc *_fitness, VectorFunc *_dfitness, SparseMatFunc *_hessian, VectorFunc *_constraints, SparseMatFunc *_dconstraints): xstart(&x), xl(_xl), xu(_xu), gl(_gl), gu(_gu), final_value(299792458.),// sym(0),unsymind(), fitness(_fitness), dfitness(_dfitness), constraints(_constraints), uz_start(), lz_start(), hessian(_hessian), dconstraints(_dconstraints), mm(-1), nnz_jac(-1), nnz_h(-1), HesStruct(true), JacStruct(false), sigma_start(1.), lambda_start(), x_start(x), checkstruct(1) {} ffNLP::ffNLP (Rn &x, const Rn &_xl, const Rn &_xu, const Rn &_gl, const Rn &_gu, ScalarFunc *_fitness, VectorFunc *_dfitness, SparseMatFunc *_hessian, VectorFunc *_constraints, SparseMatFunc *_dconstraints, int _mm, int _nnz_jac, int _nnz_h): xstart(&x), xl(_xl), xu(_xu), gl(_gl), gu(_gu), hessian(_hessian), final_value(299792458.), // sym(0),unsymind(), fitness(_fitness), dfitness(_dfitness), constraints(_constraints), dconstraints(_dconstraints), uz_start(), lz_start(), mm(_mm), nnz_jac(_nnz_jac), nnz_h(_nnz_h), HesStruct(true), JacStruct(false), sigma_start(1.), lambda_start(), x_start(x), checkstruct(1) {} ffNLP::~ffNLP () { /* * clean(fitness); * clean(dfitness); * clean(constraints); * clean(hessian); * clean(dconstraints); */ } template ffNLP &ffNLP::SetHessianStructure (const KN &I, const KN &J, bool reset) { if (reset) {HesStruct.clear();} HesStruct.AddArrays(I, J); return *this; } template ffNLP &ffNLP::SetJacobianStructure (const KN &I, const KN &J, bool reset) { if (reset) {JacStruct.clear();} JacStruct.AddArrays(I, J); return *this; } ffNLP &ffNLP::BuildMatrixStructures (Level hlvl, Level jlvl, int _mm) { if (jlvl != do_nothing && dconstraints) { if (jlvl == user_defined) {ffassert(JacStruct.size());} else if ((jlvl == one_evaluation || jlvl == basis_analysis) && dconstraints) {JacStruct.AddMatrix(dconstraints->J(x_start));} } if (hlvl != do_nothing && hessian) { if (hlvl == user_defined) {ffassert(HesStruct.size());} else if (hlvl == one_evaluation || !hessian->NLCHPEnabled()) { Rn lms = lambda_start; lms = 1.; HesStruct.AddMatrix(hessian->J(x_start, sigma_start, lms)); } else if (hlvl == basis_analysis) { { Rn lambda(_mm, 0.); HesStruct.AddMatrix(hessian->J(x_start, 1., lambda)); } for (int i = 0; i < _mm; ++i) { Rn lambda(_mm, 0.); lambda[i] = 1.; HesStruct.AddMatrix(hessian->J(x_start, 0., lambda)); lambda[i] = 0.; } } } JacStruct.ToKn(); HesStruct.ToKn(); return *this; } int ffNLP::FindIndex (const KN &irow, const KN &jcol, int i, int j, int kmin, int kmax) { // cout << "Trying to find (" << i << ',' << j << ") in :" << irow << jcol << " - kmin=" << kmin << " and kmax=" << kmax << endl; typedef std::pair Z2; Z2 ij(i, j), ijmin(irow[kmin], jcol[kmin]), ijmax(irow[kmax], jcol[kmax]); if (abs(kmin - kmax) <= 1) { if (ij == ijmin) {return kmin;} else if (ij == ijmax) {return kmax;} else {return -1;} } else { int knew = (kmin + kmax) / 2; Z2 ijnew(irow[knew], jcol[knew]); if (ij <= ijnew) {return FindIndex(irow, jcol, i, j, kmin, knew);} else {return FindIndex(irow, jcol, i, j, knew, kmax);} } } bool ffNLP::get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) { bool ret = true; n = xstart ? xstart->N() : (ret = 0); // set(m,mm,constraints,xstart,ret); // set(nnz_jac_g,nnz_jac,dconstraints,xstart,ret); // set(nnz_h_lag,nnz_h,hessian,xstart,ret); // if(JacStruct.empty() && constraints) BuildMatrixStructures(do_nothing,one_evaluation); // if(HesStruct.empty()) BuildMatrixStructures(one_evaluation,do_nothing); mm = m = constraints ? JacStruct.N() : 0; nnz_jac = nnz_jac_g = constraints ? JacStruct.size() : 0; nnz_h = nnz_h_lag = HesStruct.size(); index_style = TNLP::C_STYLE; return ret; } bool ffNLP::get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) { // cout << "n=" << n << " m=" << m << " mm=" << mm << " g_l.N()=" << gl.N() << " g_u.N()=" << gu.N() << endl; // assert(gl.N()==mm); // assert(gu.N()==mm); KnToPtr(xl, x_l); KnToPtr(xu, x_u); if (mm) {KnToPtr(gl, g_l);} if (mm) {KnToPtr(gu, g_u);} /* DEBUG * cout << "constraints lower bound = ("; * for(int i=0;iN() == n); KnToPtr(*xstart, x); if (init_z) { if (uz_start.N() != n) { if (xu.min() < 1.e19) { cout << "ff-IPOPT warm start : upper simple bounds start multipliers array doesn't have the expected size (" << uz_start.N() << "!=" << n << ")." << endl; cout << " "; if (uz_start.N() == 0) {cout << "maybe because no upper bounds multiplier has been given. " << endl;} cout << " Initializing them to 1..." << endl; } uz_start.resize(n); uz_start = 1.; } if (lz_start.N() != n) { if (xl.max() > -1e19) { cout << "ff-IPOPT warm start : lower simple bounds start multipliers array doesn't have the expected size (" << lz_start.N() << "!=" << n << ")." << endl; cout << " "; if (lz_start.N() == 0) {cout << "maybe because no lower bounds multiplier has been given. " << endl;} cout << " Initializing them to 1..." << endl; } lz_start.resize(n); lz_start = 1.; } KnToPtr(uz_start, z_U); KnToPtr(lz_start, z_L); } if (init_lambda) { if (lambda_start.N() != m) { cout << "ff-IPOPT warm start : constraints start multipliers array doesn't have the expected size (" << lambda_start.N() << "!=" << m << ")." << endl; cout << " "; if (lambda_start.N() == 0) {cout << "maybe because no constraints multiplier has been given. " << endl;} cout << " Initializing them to 1..." << endl; lambda_start.resize(m); lambda_start = 1.; } KnToPtr(lambda_start, lambda); } return true; } bool ffNLP::eval_f (Index n, const Number *x, bool new_x, Number &obj_value) { assert(n == xstart->N()); Rn X(n); KnFromPtr(X, x); obj_value = fitness->J(X); return true; } bool ffNLP::eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) { assert(n == xstart->N()); Rn X(n); KnFromPtr(X, x); Rn _grad_f = dfitness->J(X); KnToPtr(_grad_f, grad_f); return true; } bool ffNLP::eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) { Rn X(n); KnFromPtr(X, x); if (constraints) { Rn _g = constraints->J(X); KnToPtr(_g, g); } return true; } bool ffNLP::eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) { assert(n == xstart->N()); Rn X(n); if (x) {KnFromPtr(X, x);} else {X = *xstart;} if (values == 0) { int k = 0; for (SparseMatStructure::const_iterator i = JacStruct.begin(); i != JacStruct.end(); ++i) { iRow[k] = i->first; jCol[k] = i->second; ++k; } } else if (dconstraints) { Matrice_Creuse *M = dconstraints->J(X); MatriceMorse *MM = dynamic_cast *>(&(*M->A));// ugly! for (int i = 0; i < MM->N; ++i) { for (int k = MM->lg[i]; k < MM->lg[i + 1]; ++k) { if (checkstruct) { int kipopt = FindIndex(JacStruct.Raws(), JacStruct.Cols(), i, MM->cl[k], 0, nele_jac - 1); if (kipopt >= 0) {values[kipopt] = MM->a[k];} } else {values[k] = MM->a[k];} } } } return true; } bool ffNLP::eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values) { Rn X(n), L(m); if (x) {KnFromPtr(X, x);} else {X = *xstart;} if (lambda) {KnFromPtr(L, lambda);} else {L = 0.;} bool NLCHPE = hessian->NLCHPEnabled(); Number _obj_factor = NLCHPE ? 1. : obj_factor; if (values == 0) { int k = 0; for (SparseMatStructure::const_iterator i = HesStruct.begin(); i != HesStruct.end(); ++i) { iRow[k] = i->first; jCol[k] = i->second; ++k; } } else { Matrice_Creuse *M = 0; if (NLCHPE) {M = hessian->J(X, obj_factor, L);} else {M = hessian->J(X);} MatriceMorse *MM = dynamic_cast *>(&(*M->A));// ugly! if (MM) { if (checkstruct) { for (int i = 0; i < MM->N; ++i) { for (int k = MM->lg[i]; k < MM->lg[i + 1]; ++k) { int kipopt = FindIndex(HesStruct.Raws(), HesStruct.Cols(), i, MM->cl[k], 0, nele_hess - 1); if (kipopt >= 0) {values[kipopt] = _obj_factor * (MM->a[k]);} // else values[k] = (hessian->paramof &&hessian->paramlm ? 1. : obj_factor) * (MM->a[k]); } } } else if (!MM->symetrique) { for (int i = 0, kipopt = 0; i < MM->N; ++i) { for (int k = MM->lg[i]; k < MM->lg[i + 1]; ++k) { if (i >= MM->cl[k]) { values[kipopt] = _obj_factor * (MM->a[k]); ++kipopt; } } } } else { for (int i = 0; i < MM->N; ++i) { for (int k = MM->lg[i]; k < MM->lg[i + 1]; ++k) { values[k] = _obj_factor * (MM->a[k]); } } } } } return true; } void ffNLP::finalize_solution (SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) { KnFromPtr(*xstart, x); KnFromPtr(lambda_start, lambda); KnFromPtr(lz_start, z_L); KnFromPtr(uz_start, z_U); final_value = obj_value; } /***************************************************************************************************************************** * Assumptions : these are tags used as template parameters for case specific function wrapping or warning message in the * interface. Some case can be added here (but some class has to be specialized for the new cases) * AssumptionF : undeff --> undefined case (not used) * no_assumption_f --> most general case when the fitness function and all its derivative are coded in the * freefem script with the func keyword (type Polymorphic in c++). These functions * are then wrapped in GeneralFunc objects. * P2_f --> no longer used (it was used for fitness and its gradient defined as func in freefem * script, while the hessian is a constant matrix directly given to the interface, but * it leads to ambiguities). * unavailable_hessian --> fitness function and its gradients coded with func in the ff script, wrapped into * GeneralFunc objects, without second order derivative function. Enables the BFGS * option of IPOPT. * mv_P2_f --> fitness function is a P2 function which will be defined by a [matrix,vector] array. * The functions are passed to the ffNLP object as P2ScalarFunc, P1VectorFunc and * ConstantSparseMatFunc respectively for the fitness function, its gradient and its * hessian (with all vf=1). * quadratic_f --> f is a pure quadratic fonction, defined by a single matrix. Same type as mv_P2_f * for function wrappers with a vf=0 tag. * linear_f --> f is a linear form, defined by a single vector. Same type as mv_P2_f * for function wrappers with a vf=0 tag. * AssumptionG : undeff --> undefined case (not used) * no_assumption_f --> most general case when the constraint functions and all its derivative are coded in * the freefem script with the func keyword (type Polymorphic in c++). These functions * are then wrapped in GeneralFunc objects. * P1_g --> no longer used (it was used for constraints defined as func in freefem script * , while the jacobian is a constant matrix directly given to the interface, but * it leads to ambiguities). * mv_P1_g --> Constraints function is a P1 function which will be defined by a [matrix,vector] * array. The functions are passed to the ffNLP object as P1VectorFunc and * ConstantSparseMatFunc respectively for the constraints and its jacobian (with * all vf=0). * linear_g --> Constraints are linear, defined by a single matrix. Same type as mv_P1_g * for function wrappers with a vf=0 tag. * Case : templatized with a pair of AssumptionF and AssumptionG, is used to build different constructor for the interface * class in order to overload the freefem function which will call IPOPT *****************************************************************************************************************************/ enum AssumptionF {undeff, no_assumption_f, P2_f, unavailable_hessian, mv_P2_f, quadratic_f, linear_f}; enum AssumptionG {undefg, without_constraints, no_assumption_g, P1_g, mv_P1_g, linear_g}; template struct Case { Case () {} static const AssumptionF af = AF; static const AssumptionG ag = AG; }; /***************************************************************************************************************************** * CheckMatrixVectorPair : Small function taking an E_Array and check whether the type of the 2 objects contained in the * array are matrix and vector. Returns false if types are not matrix/vector. * order is modified to know whether the matrix is in first position or not. *****************************************************************************************************************************/ bool CheckMatrixVectorPair (const E_Array *mv, bool &order) { const aType t1 = (*mv)[0].left(), t2 = (*mv)[1].left(); if (NXOR(t1 == atype *>(), t2 == atype *>())) {return false;} else if (NXOR(t1 == atype(), t2 == atype())) {return false;} else { order = (t1 == atype *>()); return true; } } /***************************************************************************************************************************** * The following class offers a polymorphic way to build the function wrappers to pass to the ffNLP object * Each element of the assumption enum define a "FunctionDatas" class in which the constructor and the operator() makes * case specific task. * If some new value in the Assumption enums are to be added, the FitnessFunctionDatas and/or ConstraintFunctionDatas with * the new value as template parameter has to be specialized. * What should the method do is (exemple at the end of the file with already coded cases): * Constructor : define the Expression members using the arguments passed to the IPOPT function in the script * operator() : allocate with appropriate dynamic type the ScalarFunc, VectorFunc, SparseMatFunc pointers, and display some * case dependant errors or warnings (note that there is no ScalarFunc ptr to allocate for constraints) *****************************************************************************************************************************/ class GenericFitnessFunctionDatas { public: static GenericFitnessFunctionDatas *New(AssumptionF, const basicAC_F0 &, Expression const *, const C_F0 &, const C_F0 &, const C_F0 &); bool CompletelyNonLinearConstraints; Expression JJ, GradJ, Hessian; GenericFitnessFunctionDatas (): CompletelyNonLinearConstraints(true), JJ(0), GradJ(0), Hessian(0) {} virtual const AssumptionF A () const {return undeff;} virtual void operator () (Stack, const C_F0 &, const C_F0 &, const C_F0 &, Expression const *, ScalarFunc * &, VectorFunc * &, SparseMatFunc * &, bool) const = 0; // Build the functions virtual ~GenericFitnessFunctionDatas () {} }; template class FitnessFunctionDatas: public GenericFitnessFunctionDatas // not really a template, since most of the methods of all cases have to be specialized { public: FitnessFunctionDatas (const basicAC_F0 &, Expression const *, const C_F0 &, const C_F0 &, const C_F0 &); const AssumptionF A () const {return AF;} void operator () (Stack, const C_F0 &, const C_F0 &, const C_F0 &, Expression const *, ScalarFunc * &, VectorFunc * &, SparseMatFunc * &, bool) const; }; class GenericConstraintFunctionDatas { public: static GenericConstraintFunctionDatas *New(AssumptionG, const basicAC_F0 &, Expression const *, const C_F0 &); Expression Constraints, GradConstraints; GenericConstraintFunctionDatas (): Constraints(0), GradConstraints(0) {} virtual const AssumptionG A () const {return undefg;} virtual const bool WC () const = 0; // with constraints virtual void operator () (Stack, const C_F0 &, Expression const *, VectorFunc * &, SparseMatFunc * &, bool) const = 0; // build the functions` virtual ~GenericConstraintFunctionDatas () {} }; template class ConstraintFunctionDatas: public GenericConstraintFunctionDatas { public: ConstraintFunctionDatas (const basicAC_F0 &, Expression const *, const C_F0 &); const AssumptionG A () const {return AG;} const bool WC () const {return AG != without_constraints;} void operator () (Stack, const C_F0 &, Expression const *, VectorFunc * &, SparseMatFunc * &, bool) const; }; /***************************************************************************************************************************** * OptimIpopt & OptimIpopt::E_Ipopt - The interface class * Do the link beetween freefem and Ipopt *****************************************************************************************************************************/ class OptimIpopt: public OneOperator { public: const AssumptionF AF; const AssumptionG AG; class E_Ipopt: public E_F0mps { private: bool spurious_cases; public: const AssumptionF AF; const AssumptionG AG; const bool WC; std::set unused_name_param; // In some case, some parameter are usless, this is the list of their index in nargs void InitUNP ();// Initialize unusued_name_param at freefem compile time static basicAC_F0::name_and_type name_param []; static const int n_name_param = 29; Expression nargs[n_name_param]; Expression X; mutable Rn lm; C_F0 L_m; C_F0 inittheparam, theparam, closetheparam; C_F0 initobjfact, objfact; GenericFitnessFunctionDatas *fitness_datas; GenericConstraintFunctionDatas *constraints_datas; bool arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} R arg (int i, Stack stack, R a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} Rn_ arg (int i, Stack stack, Rn_ a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} template T Arg (int i, Stack s) const {return GetAny((*nargs[i])(s));} E_Ipopt (const basicAC_F0 &args, AssumptionF af, AssumptionG ag) : lm(), L_m(CPValue(lm)), AF(af), AG(ag), WC(ag != without_constraints), unused_name_param(), spurious_cases(false), fitness_datas(0), constraints_datas(0) { InitUNP(); int nbj = args.size() - 1; Block::open(currentblock); // make a new block to X = to(args[nbj]); C_F0 X_n(args[nbj], "n"); // the expression to init the theparam of all inittheparam = currentblock->NewVar("the parameter", atype *>(), X_n); initobjfact = currentblock->NewVar("objective factor", atype()); // C_F0 initlm = currentblock->NewVar("lagrange multiplier",atype *>(),L_m); theparam = currentblock->Find("the parameter"); // the expression for the parameter objfact = currentblock->Find("objective factor"); args.SetNameParam(n_name_param, name_param, nargs); fitness_datas = GenericFitnessFunctionDatas::New(AF, args, nargs, theparam, objfact, L_m); // Creates links to the freefem objects constraints_datas = GenericConstraintFunctionDatas::New(AG, args, nargs, theparam); // defining the functions spurious_cases = AG == no_assumption_g && (AF == P2_f || AF == mv_P2_f || AF == quadratic_f || AF == linear_f); // closetheparam=currentblock->close(currentblock); // the cleanning block expression closetheparam = C_F0((Expression)Block::snewclose(currentblock), atype()); } ~E_Ipopt () { if (fitness_datas) {delete fitness_datas;} if (constraints_datas) {delete constraints_datas;} } virtual AnyType operator () (Stack stack) const { double cost = nan(""); WhereStackOfPtr2Free(stack) = new StackOfPtr2Free(stack); // FH mars 2005 Rn &x = *GetAny((*X)(stack)); { Expression test(theparam); // in some case the KN object associated to the param is never initialized, leading to failed assertion in KN::destroy Rn *tt = GetAny((*test)(stack)); // this lines prevent this to happen *tt = x; } long n = x.N(); bool warned = false; cout << endl; if (spurious_cases) { cout << "ff-IPOPT Spurious case detected : the hessian is defined as a constant matrix but constraints are given in function form." << endl; cout << "If they are not affine, the optimization is likely to fail. In this case, try one of the following suggestions:" << endl; cout << " - if constraints have computable hessians, use function form for the fitness function and all its derivatives" << endl; cout << " and check the documentation to know how to express the whole lagrangian hessian." << endl; cout << " - if constraints hessians are difficult to obtain, force the BFGS mode using named parameter " << name_param[12].name << '.' << endl; cout << "Do not worry about this message if you know all your constraints has a constant null hessian." << endl << endl; } if (nargs[7]) {cout << "ff-IPOPT : the named parameter autostruct is no longer used in this version of the interface." << endl;} // Detection of mixed case dependant warnings or error for (int i = 0; i < n_name_param; ++i) { if (nargs[i] && unused_name_param.find(i) != unused_name_param.end()) { cout << "ff-IPOPT Warning: named parameter " << name_param[i].name << " is useless for the problem you have set." << endl; warned = true; } } if (nargs[4] && nargs[5] && nargs[7]) { cout << "ff-IPOPT Warning: both " << name_param[4].name << " and " << name_param[5].name << " has been defined, so " << name_param[7].name; cout << " will be ignored." << endl; } if (warned) { if (!WC && AF == unavailable_hessian && nargs[8]) { cout << " ==> " << name_param[8].name << " is useless because there should not be any function returning matrix in your problem," << endl; cout << " (2 functions can only be J and dJ). You may as well have forgotten one function (IPOPT will certainly crash if so)." << endl; } if (AF != no_assumption_f && AF != unavailable_hessian && AG != no_assumption_g && nargs[5]) { cout << " ==> your lagrangian hessian is a constant matrix, so there is no need to specify its structure with " << name_param[5].name << endl; cout << " since it is contained in the matrix object." << endl; } if (AF != no_assumption_f && AF != unavailable_hessian && AG != no_assumption_g && nargs[7]) { cout << " ==> " << name_param[7].name << " will be ignored since all matrices are constants and constraints do not" << endl; cout << " contribute to the hessian, matrix structure determination is trivial." << endl; } if (AF == unavailable_hessian && AG != no_assumption_g && (nargs[7] || nargs[8])) { cout << " ==> " << name_param[7].name << " or " << name_param[8].name << " will be ignored since the only matrix you have passed is constant. " << endl; cout << " Or maybe did you forget to pass a function (IPOPT will certainly crash if so)." << endl; } if (AF != no_assumption_f && AF != unavailable_hessian && AG != no_assumption_g && nargs[8]) { cout << " ==> no need to use " << name_param[8].name << " since all matrices are constant, structures won't change through the algorithm," << endl; cout << " it is automatically set to the default disabling value." << endl; } } long iprint = verbosity; ScalarFunc *ffJ = 0; VectorFunc *ffdJ = 0, *ffC = 0; SparseMatFunc *ffH = 0, *ffdC = 0; (*fitness_datas)(stack, theparam, objfact, L_m, nargs, ffJ, ffdJ, ffH, warned); // Fill the functions (*constraints_datas)(stack, theparam, nargs, ffC, ffdC, warned); Rn xl(n), xu(n), gl(nargs[2] ? Arg(2, stack).N() : 0), gu(nargs[3] ? Arg(3, stack).N() : 0); int mmm = 0; if (WC && (gl.N() + gu.N()) == 0) { cout << "IPOPT Warning : constrained problem without constraints bounds." << endl; mmm = ffC->J(x).N(); } else {mmm = gl.N() > gu.N() ? gl.N() : gu.N();} Rn_ *lag_mul = 0, *l_z = 0, *u_z = 0; // Rn(mmm,1.); // int niter=arg(6,stack,100L); int autostructmode = ffNLP::one_evaluation; bool checkindex = (AF != no_assumption_f && AG != no_assumption_g) ? false : arg(8, stack, true), cberror = false; if (nargs[0]) {xl = Arg(0, stack);} else {xl = -1.e19;} if (nargs[1]) {xu = Arg(1, stack);} else {xu = 1.e19;} if (nargs[2]) {gl = Arg(2, stack);} else {gl.resize(mmm); gl = -1.e19;} if (nargs[3]) {gu = Arg(3, stack);} else {gu.resize(mmm); gu = 1.e19;} const E_Array *ejacstruct = (WC && AF == no_assumption_f && AG == no_assumption_g && nargs[4]) ? dynamic_cast(nargs[4]) : 0, *ehesstruct = (AF == no_assumption_f && nargs[5]) ? dynamic_cast(nargs[5]) : 0; if (nargs[6] && WC) {lag_mul = new Rn_(GetAny((*nargs[6])(stack)));} if (nargs[21]) {l_z = new Rn_(GetAny((*nargs[21])(stack)));} if (nargs[20]) {u_z = new Rn_(GetAny((*nargs[20])(stack)));} SmartPtr optim = new ffNLP(x, xl, xu, gl, gu, ffJ, ffdJ, ffH, ffC, ffdC); ffNLP *_optim = dynamic_cast(&(*optim)); assert(_optim); if (WC && nargs[6]) {_optim->lambda_start = *lag_mul;} else if (WC) { _optim->lambda_start.resize(mmm); _optim->lambda_start = 1.; } _optim->sigma_start = 1.; if (nargs[21] && nargs[0]) {_optim->lz_start = *l_z;} else if (nargs[0]) {_optim->lz_start.resize(xl.N()); _optim->lz_start = 1.;} if (nargs[20] && nargs[1]) {_optim->uz_start = *u_z;} else if (nargs[1]) {_optim->uz_start.resize(xu.N()); _optim->uz_start = 1.;} if (ejacstruct) { if (ejacstruct->nbitem() != 2) {ExecError("\nSorry, we were expecting an array with two componants in structjac=[iraw,jcol]");} if ((*ejacstruct)[0].left() != atype *>()) {CompileError("Sorry, array componants in structjac=[iraw,jcol] must be integer arrays");} if ((*ejacstruct)[1].left() != atype *>()) {CompileError("Sorry, array componants in structjac=[iraw,jcol] must be integer arrays");} Expression raws = (*ejacstruct)[0], cols = (*ejacstruct)[1]; _optim->SetJacobianStructure(*GetAny *>((*raws)(stack)), *GetAny *>((*cols)(stack)), true); } if (ehesstruct) { if (ehesstruct->nbitem() != 2) {ExecError("\nSorry, we were expecting an array with two componants in structhess=[iraw,jcol]");} if ((*ehesstruct)[0].left() != atype *>()) {CompileError("Sorry, array componants in structhess=[iraw,jcol] must be integer arrays");} if ((*ehesstruct)[1].left() != atype *>()) {CompileError("Sorry, array componants in structhess=[iraw,jcol] must be integer arrays");} Expression raws = (*ehesstruct)[0], cols = (*ehesstruct)[1]; _optim->SetHessianStructure(*GetAny *>((*raws)(stack)), *GetAny *>((*cols)(stack)), true); } ffNLP::Level lh = ehesstruct ? ffNLP::user_defined : ffNLP::Level(autostructmode), lj = ejacstruct ? ffNLP::user_defined : ffNLP::Level(autostructmode); if (AF == unavailable_hessian) {lh = ffNLP::do_nothing;} _optim->BuildMatrixStructures(lh, lj, mmm); if (checkindex) {_optim->EnableCheckStruct();} SmartPtr app = new IpoptApplication(); // app->Options()->SetNumericValue("tol", 1e-10); if (nargs[9]) {app->Options()->SetNumericValue("tol", GetAny((*nargs[9])(stack)));} if (nargs[10]) {app->Options()->SetIntegerValue("max_iter", GetAny((*nargs[10])(stack)));} if (nargs[11]) {app->Options()->SetNumericValue("max_cpu_time", GetAny((*nargs[11])(stack)));} bool bfgs = nargs[12] ? GetAny((*nargs[12])(stack)) : false; // app->Options()->SetStringValue("hessian_approximation","limited-memory"); if (AF == unavailable_hessian || bfgs) { if (AF == unavailable_hessian && !bfgs) {cout << "IPOPT Note : No hessian given ==> LBFGS hessian approximation enabled" << endl;} app->Options()->SetStringValue("hessian_approximation", "limited-memory"); } if (nargs[13]) { string derivative_test = *GetAny((*nargs[13])(stack)); app->Options()->SetStringValue("derivative_test", derivative_test.c_str()); } if (nargs[14]) { string options_file = *GetAny((*nargs[14])(stack)); app->Options()->SetStringValue("option_file_name", options_file.c_str()); } if (nargs[15]) {app->Options()->SetIntegerValue("print_level", GetAny((*nargs[15])(stack)));} if (AG == without_constraints || AG == mv_P1_g || AG == linear_g) { app->Options()->SetStringValue("jac_c_constant", "yes"); app->Options()->SetStringValue("jac_d_constant", "yes"); } if (AF == mv_P2_f || AF == quadratic_f || AF == linear_f) {app->Options()->SetStringValue("hessian_constant", "yes");} if (nargs[16]) {app->Options()->SetNumericValue("derivative_test_perturbation", GetAny((*nargs[16])(stack)));} if (nargs[17]) {app->Options()->SetNumericValue("derivative_test_tol", GetAny((*nargs[16])(stack)));} if (nargs[18]) {app->Options()->SetStringValue("fixed_variable_treatment", GetAny((*nargs[18])(stack))->c_str());} if (nargs[19]) { app->Options()->SetStringValue("warm_start_init_point", "yes"); if (WC && !nargs[6]) { cout << "ff-IPOPT Warning : warm start for constrained problem without initial constraints dual variables (" << name_param[6].name << " parameter)." << endl; cout << " ==> Starting with " << name_param[6].name << "=(1,1,...,1)." << endl; } if (nargs[0] && !nargs[21]) { cout << "ff-IPOPT Warning : warm start with simple lower bounds without initial lower bounds dual variables (" << name_param[21].name << " parameter)." << endl; cout << " ==> Starting with " << name_param[21].name << "=(1,1,...,1)." << endl; } if (nargs[1] && !nargs[20]) { cout << "ff-IPOPT Warning : warm start with simple upper bounds without initial upper bounds dual variables (" << name_param[20].name << " parameter)." << endl; cout << " ==> Starting with " << name_param[20].name << "=(1,1,...,1)." << endl; } if (l_z) {_optim->lz_start = *l_z;} if (u_z) {_optim->uz_start = *u_z;} if (lag_mul) {_optim->lambda_start = *lag_mul;} } if (nargs[22]) {app->Options()->SetNumericValue("mu_init", GetAny((*nargs[22])(stack)));} else {app->Options()->SetStringValue("mu_strategy", "adaptive");} if (nargs[23]) {app->Options()->SetNumericValue("mumps_pivtol", GetAny((*nargs[23])(stack)));} if (nargs[24]) {app->Options()->SetNumericValue("bound_relax_factor", GetAny((*nargs[24])(stack)));} if (nargs[25]) {app->Options()->SetStringValue("mu_strategy", GetAny((*nargs[25])(stack))->c_str());} if (nargs[27]) {app->Options()->SetNumericValue("mu_min", GetAny((*nargs[27])(stack)));} if (nargs[28]) {if (!GetAny((*nargs[28])(stack))) {app->Options()->SetStringValue("accept_every_trial_step", "yes");}} // if(nargs[26]) app->Options()->SetNumericValue("obj_scaling_factor",GetAny((*nargs[26])(stack))); if (verbosity > 1) {app->Options()->SetStringValue("print_user_options", "yes");} app->Options()->SetStringValue("output_file", "ipopt.out"); if (AF != no_assumption_f && AF != unavailable_hessian && AG != no_assumption_g) {app->Options()->SetStringValue("mehrotra_algorithm", "yes");} ApplicationReturnStatus status; app->Initialize(); // Ask Ipopt to solve the problem status = app->OptimizeTNLP(optim); if (lag_mul) {*lag_mul = _optim->lambda_start;} if (l_z) {*l_z = _optim->lz_start;} if (u_z) {*u_z = _optim->uz_start;} cost = _optim->final_value; if (nargs[26]) { double *pfv = GetAny((*nargs[26])(stack)); *pfv = cost; } if (verbosity) { if (status == Solve_Succeeded) {printf("\n\n*** Ipopt succeeded \n");} else if (static_cast(status) < 0) {printf("\n\n*** Ipopt failure!\n");} else {printf("\n\n*** Ipopt mixed results.\n");} } clean(lag_mul); clean(l_z); clean(u_z); clean(ffJ); clean(ffdJ); clean(ffH); clean(ffC); clean(ffdC); if (lm) { lm.destroy(); // clean memory of LM } closetheparam.eval(stack); // clean memory WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 return SetAny(static_cast(static_cast(status))); // SetAny(0); Modif FH july 2005 } operator aType () const {return atype();} }; E_F0*code (const basicAC_F0 &args) const {return new E_Ipopt(args, AF, AG);} // Constructors - they define the different prototype of the overloaded IPOPT function reachable in freefem scripts OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype(), atype(), atype *>()), AF(no_assumption_f), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype *>()), AF(no_assumption_f), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype(), atype *>(), atype *>()), AF(no_assumption_f), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype(), atype *>()), AF(no_assumption_f), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype *>(), atype *>()), AF(no_assumption_f), AG(linear_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype(), atype *>(), atype *>()), AF(P2_f), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype *>()), AF(P2_f), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype(), atype(), atype *>()), AF(P2_f), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype(), atype *>()), AF(P2_f), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype *>(), atype *>()), AF(P2_f), AG(linear_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype(), atype *>()), AF(unavailable_hessian), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>()), AF(unavailable_hessian), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype *>(), atype *>()), AF(unavailable_hessian), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype *>()), AF(unavailable_hessian), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype *>()), AF(unavailable_hessian), AG(linear_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype(), atype *>()), AF(mv_P2_f), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype *>()), AF(mv_P2_f), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>(), atype *>()), AF(mv_P2_f), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype(), atype *>()), AF(mv_P2_f), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype(), atype *>(), atype *>()), AF(mv_P2_f), AG(linear_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype(), atype *>()), AF(quadratic_f), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype *>()), AF(quadratic_f), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype *>(), atype *>()), AF(quadratic_f), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype *>()), AF(quadratic_f), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype *>(), atype *>()), AF(quadratic_f), AG(linear_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype(), atype *>()), AF(linear_f), AG(no_assumption_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype *>()), AF(linear_f), AG(without_constraints) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype *>(), atype *>()), AF(linear_f), AG(P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype(), atype *>()), AF(linear_f), AG(mv_P1_g) {} OptimIpopt (Case ): OneOperator(atype(), atype *>(), atype *>(), atype *>()), AF(linear_f), AG(linear_g) {} }; /* * enum AssumptionF {no_assumption_f, P2_f, unavailable_hessian, mv_P2_f, quadratic_f,linear_f}; * enum AssumptionG {without_constraints, no_assumption_g, P1_g, mv_P1_g, linear_g}; */ // Case dependant initialization of unused_name_param // exemple : AF==no_assumption_f && AG==without_constraints ==> no constraint related named parameter should be used (index 2,3,4,6 - first integer is how many are not used) void OptimIpopt::E_Ipopt::InitUNP () { if (AF == no_assumption_f && AG == no_assumption_g) {} // no unused named parameter if (AF == no_assumption_f && AG == without_constraints) {AddElements(unused_name_param, 4, 2, 3, 4, 6);} if (AF == no_assumption_f && AG == P1_g) {AddElements(unused_name_param, 1, 4);} if (AF == no_assumption_f && AG == mv_P1_g) {AddElements(unused_name_param, 1, 4);} if (AF == no_assumption_f && AG == linear_g) {AddElements(unused_name_param, 1, 4);} if (AF == P2_f && AG == P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == P2_f && AG == without_constraints) {AddElements(unused_name_param, 8, 2, 3, 4, 5, 6, 7, 8, 12);} if (AF == P2_f && AG == no_assumption_g) {AddElements(unused_name_param, 1, 5);} if (AF == P2_f && AG == mv_P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == P2_f && AG == linear_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == unavailable_hessian && AG == no_assumption_g) {AddElements(unused_name_param, 1, 5);} if (AF == unavailable_hessian && AG == without_constraints) {AddElements(unused_name_param, 7, 2, 3, 4, 5, 6, 7, 8);} if (AF == unavailable_hessian && AG == P1_g) {AddElements(unused_name_param, 4, 4, 5, 7, 8);} if (AF == unavailable_hessian && AG == mv_P1_g) {AddElements(unused_name_param, 4, 4, 5, 7, 8);} if (AF == unavailable_hessian && AG == linear_g) {AddElements(unused_name_param, 4, 4, 5, 7, 8);} if (AF == mv_P2_f && AG == without_constraints) {AddElements(unused_name_param, 8, 2, 3, 4, 5, 6, 7, 8, 12);} if (AF == mv_P2_f && AG == no_assumption_g) {AddElements(unused_name_param, 1, 5);} if (AF == mv_P2_f && AG == P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == mv_P2_f && AG == mv_P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == mv_P2_f && AG == linear_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == quadratic_f && AG == without_constraints) {AddElements(unused_name_param, 8, 2, 3, 4, 5, 6, 7, 8, 12);} if (AF == quadratic_f && AG == no_assumption_g) {AddElements(unused_name_param, 1, 5);} if (AF == quadratic_f && AG == P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == quadratic_f && AG == mv_P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == quadratic_f && AG == linear_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == linear_f && AG == without_constraints) {AddElements(unused_name_param, 8, 2, 3, 4, 5, 6, 7, 8, 12);} if (AF == linear_f && AG == no_assumption_g) {AddElements(unused_name_param, 1, 5);} if (AF == linear_f && AG == P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == linear_f && AG == mv_P1_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} if (AF == linear_f && AG == linear_g) {AddElements(unused_name_param, 5, 4, 5, 7, 8, 12);} } basicAC_F0::name_and_type OptimIpopt::E_Ipopt::name_param [] = { // DONT CHANGE THE ORDER!!!! If some parameters need to be added, add them after the last one // otherwize warning message of this interface will be a mess {"lb", &typeid(KN_)}, // 0 - lower bound on optimization parameter X {"ub", &typeid(KN_)}, // 1 - upper bound on optimization parameter X {"clb", &typeid(KN_)}, // 2 - constraints lower bounds {"cub", &typeid(KN_)}, // 3 - constraints upper bounds {"structjacc", &typeid(E_Array)}, // 4 - constraints jacobian structure {"structhess", &typeid(E_Array)}, // 5 - lagrangian hessian structure {"lm", &typeid(KN_)}, // 6 - lagrange multiplier (for autostruct or to get their value at the end of the algorithm) {"autostruct", &typeid(long)}, // 7 - automatic structure determination {"checkindex", &typeid(bool)}, // 8 - whether to use the FindIndex function or not {"tol", &typeid(double)}, // 9 - stopping criteria tol {"maxiter", &typeid(long)}, // 10 - stopping criteria : maximum number of iterations {"maxcputime", &typeid(double)},// 11 - stopping criteria : maximum CPU time {"bfgs", &typeid(bool)},// 12 - force the bfgs hessian approximation {"derivativetest", &typeid(string *)}, // 13 - call the derivative checker {"optfile", &typeid(string *)}, // 14 - set the ipopt option file name (default is ipopt.opt) {"printlevel", &typeid(long)}, // 15 - controls IPOPT print level output {"dth", &typeid(double)}, // 16 - perturbation for finite difference derivative test {"dttol", &typeid(double)}, // 17 - relative tolerence for the derivative test error detection {"fixedvar", &typeid(string *)},// 18 - remove the equality simple bounds from problem {"warmstart", &typeid(bool)}, // 19 - do we initialize multipliers with given values {"uz", &typeid(KN_)}, // 20 - simple upper bounds dual variable {"lz", &typeid(KN_)}, // 21 - simple lower bounds dual variable {"muinit", &typeid(double)},// 22 - barrier parameter initialization {"pivtol", &typeid(double)},// 23 - pivot tolerance for the linear solver {"brf", &typeid(double)}, // 24 - bounds relax factor {"mustrategy", &typeid(string *)}, // 25 - strategy for barrier parameter update {"objvalue", &typeid(double *)},// 26 - to get the last objective function value {"mumin", &typeid(double)}, // 27 - minimal value for the barrier parameter {"linesearch", &typeid(bool)} // 28 - use the line search or not (if no, the usual Newton step is kept) // {"osf", &typeid(double) } //26 - objective function scalling factor }; /* class Init { public: * Init(); * }; * * static Init init; */ static void Load_Init () { Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); // Global.Add("IPOPT","(",new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); /*Global.Add("IPOPT","(",new OptimIpopt(Case())); * Global.Add("IPOPT","(",new OptimIpopt(Case())); * Global.Add("IPOPT","(",new OptimIpopt(Case())); * Global.Add("IPOPT","(",new OptimIpopt(Case())); * Global.Add("IPOPT","(",new OptimIpopt(Case()));*/ Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); // Global.Add("IPOPT","(",new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); // Global.Add("IPOPT","(",new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); // Global.Add("IPOPT","(",new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); // Global.Add("IPOPT","(",new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); Global.Add("IPOPT", "(", new OptimIpopt(Case())); } /***************************************************************************************************************************** * Specialization of functions builders' constructor and operator() *****************************************************************************************************************************/ template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() { const Polymorphic *opJ = dynamic_cast(args[0].LeftValue()), *opdJ = dynamic_cast(args[1].LeftValue()), *opH = dynamic_cast(args[2].LeftValue()); ArrayOfaType hprototype2(atype *>(), atype(), atype *>()), hprototype1(atype *>()); JJ = to(C_F0(opJ, "(", theparam)); GradJ = to(C_F0(opdJ, "(", theparam)); if (opH->Find("(", hprototype2)) { CompletelyNonLinearConstraints = true; Hessian = to *>(C_F0(opH, "(", theparam, objfact, L_m)); } else if (opH->Find("(", hprototype1)) { CompletelyNonLinearConstraints = false; // When constraints are affine, lagrange multipliers are not used in the hessian, obj_factor is also hidden to the user Hessian = to *>(C_F0(opH, "(", theparam)); } else {CompileError("Error, wrong hessian function prototype. Must be either (real[int] &) or (real[int] &,real,real[int] &)");} } template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { ffJ = new GeneralFunc(stack, JJ, theparam); ffdJ = new GeneralFunc(stack, GradJ, theparam); if (CompletelyNonLinearConstraints) {ffH = new GeneralSparseMatFunc(stack, Hessian, theparam, objfact, L_m);} else {ffH = new GeneralSparseMatFunc(stack, Hessian, theparam);} } template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() { CompletelyNonLinearConstraints = false; const Polymorphic *opJ = dynamic_cast(args[0].LeftValue()), *opdJ = dynamic_cast(args[1].LeftValue()); JJ = to(C_F0(opJ, "(", theparam)); GradJ = to(C_F0(opdJ, "(", theparam)); Hessian = to *>(args[2]); } template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { if (warned && nargs[5]) { cout << " ==> your lagrangian hessian is a constant matrix, so there is no need to specify its structure with "; cout << OptimIpopt::E_Ipopt::name_param[5].name << endl; cout << " since it is contained in the matrix object." << endl; } ffJ = new GeneralFunc(stack, JJ, theparam); ffdJ = new GeneralFunc(stack, GradJ, theparam); ffH = new ConstantSparseMatFunc(stack, Hessian); } template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() { CompletelyNonLinearConstraints = false; const Polymorphic *opJ = dynamic_cast(args[0].LeftValue()), *opdJ = dynamic_cast(args[1].LeftValue()); JJ = to(C_F0(opJ, "(", theparam)); GradJ = to(C_F0(opdJ, "(", theparam)); } template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { if (warned && nargs[5]) { cout << " ==> no hessian has been given, the LBFGS mode has been enabled, thus making "; cout << OptimIpopt::E_Ipopt::name_param[5].name << " useless. You may also" << endl << " have forgoten a function (IPOPT will certainly crash if so)." << endl; } ffJ = new GeneralFunc(stack, JJ, theparam); ffdJ = new GeneralFunc(stack, GradJ, theparam); ffH = 0; } template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() { const E_Array *M_b = dynamic_cast(args[0].LeftValue()); if (M_b->nbitem() != 2) {CompileError("\nSorry, we were expecting an array with two componants, either [M,b] or [b,M] for the affine constraints expression.");} bool order = true; if (CheckMatrixVectorPair(M_b, order)) { Hessian = to *>((*M_b)[order ? 0 : 1]); GradJ = to((*M_b)[order ? 1 : 0]);// This is gradJ evaluated on x=0 } } template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { if (warned && nargs[5]) { cout << " ==> your lagrangian hessian is a constant matrix, so there is no need to specify its structure with "; cout << OptimIpopt::E_Ipopt::name_param[5].name << endl; cout << " since it is contained in the matrix object." << endl; } ffJ = new P2ScalarFunc(stack, Hessian, GradJ, true); ffdJ = new P1VectorFunc(stack, Hessian, GradJ, true); ffH = new ConstantSparseMatFunc(stack, Hessian); } template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() {Hessian = to *>(args[0]);} template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { if (warned && nargs[5]) { cout << " ==> your lagrangian hessian is a constant matrix, so there is no need to specify its structure with "; cout << OptimIpopt::E_Ipopt::name_param[5].name << endl; cout << " since it is contained in the matrix object." << endl; } ffJ = new P2ScalarFunc(stack, Hessian, 0, true); ffdJ = new P1VectorFunc(stack, Hessian, 0, true); ffH = new ConstantSparseMatFunc(stack, Hessian); } template<> FitnessFunctionDatas::FitnessFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m) : GenericFitnessFunctionDatas() {GradJ = to(args[0]);} template<> void FitnessFunctionDatas::operator () (Stack stack, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &L_m, Expression const *nargs, ScalarFunc * &ffJ, VectorFunc * &ffdJ, SparseMatFunc * &ffH, bool warned) const { if (warned && nargs[5]) { cout << " ==> your lagrangian hessian is a null matrix, so there is no need to specify its structure with "; cout << OptimIpopt::E_Ipopt::name_param[5].name << endl; cout << " since it is empty." << endl; } ffJ = new P2ScalarFunc(stack, 0, GradJ); ffdJ = new P1VectorFunc(stack, 0, GradJ); ffH = 0; } template<> ConstraintFunctionDatas::ConstraintFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) : GenericConstraintFunctionDatas() {} template<> void ConstraintFunctionDatas::operator () (Stack stack, const C_F0 &theparam, Expression const *nargs, VectorFunc * &ffC, SparseMatFunc * &ffdC, bool warned) const { if (warned) { if (nargs[2] || nargs[3]) {cout << " ==> Some constraints bounds have been defined while no constraints function has been passed." << endl;} if (nargs[4]) {cout << " ==> A structure has been provided for the constraints jacobian but there is no constraint function." << endl;} if (nargs[6]) {cout << " ==> Unconstrained problem make the use of " << OptimIpopt::E_Ipopt::name_param[6].name << " pointless (see the documentation for more details)." << endl;} } ffC = 0; ffdC = 0; } template<> ConstraintFunctionDatas::ConstraintFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) : GenericConstraintFunctionDatas() { int nbj = args.size() - 1; const Polymorphic *opG = dynamic_cast(args[nbj - 2].LeftValue()), *opjG = dynamic_cast(args[nbj - 1].LeftValue()); Constraints = to(C_F0(opG, "(", theparam)); GradConstraints = to *>(C_F0(opjG, "(", theparam)); } template<> void ConstraintFunctionDatas::operator () (Stack stack, const C_F0 &theparam, Expression const *nargs, VectorFunc * &ffC, SparseMatFunc * &ffdC, bool) const { ffC = new GeneralFunc(stack, Constraints, theparam); ffdC = new GeneralSparseMatFunc(stack, GradConstraints, theparam); } template<> ConstraintFunctionDatas::ConstraintFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) : GenericConstraintFunctionDatas() { int nbj = args.size() - 1; const Polymorphic *opG = dynamic_cast(args[nbj - 2].LeftValue()); Constraints = to(C_F0(opG, "(", theparam)); GradConstraints = to *>(args[nbj - 1]); } template<> void ConstraintFunctionDatas::operator () (Stack stack, const C_F0 &theparam, Expression const *nargs, VectorFunc * &ffC, SparseMatFunc * &ffdC, bool warned) const { if (warned && nargs[4]) { cout << " ==> your constraints jacobian is a constant matrix, there is no need to specify its structure with " << OptimIpopt::E_Ipopt::name_param[4].name << endl; cout << " since it is contained in the matrix object." << endl; } ffC = new GeneralFunc(stack, Constraints, theparam); ffdC = new ConstantSparseMatFunc(stack, GradConstraints); } template<> ConstraintFunctionDatas::ConstraintFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) : GenericConstraintFunctionDatas() { int nbj = args.size() - 1; const E_Array *M_b = dynamic_cast(args[nbj - 1].LeftValue()); if (M_b->nbitem() != 2) {CompileError("\nSorry, we were expecting an array with two componants, either [M,b] or [b,M] for the affine constraints expression.");} bool order = true; if (CheckMatrixVectorPair(M_b, order)) { GradConstraints = to *>((*M_b)[order ? 0 : 1]); Constraints = to((*M_b)[order ? 1 : 0]); // Constraint on x=0 } else {CompileError("\nWrong types in the constraints [matrix,vector] pair, expecting a sparse matrix and real[int].");} } template<> void ConstraintFunctionDatas::operator () (Stack stack, const C_F0 &theparam, Expression const *nargs, VectorFunc * &ffC, SparseMatFunc * &ffdC, bool warned) const { if (warned && nargs[4]) { cout << " ==> your constraints jacobian is a constant matrix, there is no need to specify its structure with " << OptimIpopt::E_Ipopt::name_param[4].name << endl; cout << " since it is contained in the matrix object." << endl; } ffC = new P1VectorFunc(stack, GradConstraints, Constraints); ffdC = new ConstantSparseMatFunc(stack, GradConstraints); } template<> ConstraintFunctionDatas::ConstraintFunctionDatas (const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) : GenericConstraintFunctionDatas() { int nbj = args.size() - 1; GradConstraints = to *>(args[nbj - 1]); } template<> void ConstraintFunctionDatas::operator () (Stack stack, const C_F0 &theparam, Expression const *nargs, VectorFunc * &ffC, SparseMatFunc * &ffdC, bool warned) const { if (warned && nargs[4]) { cout << " ==> your constraints jacobian is a constant matrix, there is no need to specify its structure with " << OptimIpopt::E_Ipopt::name_param[4].name << endl; cout << " since it is contained in the matrix object." << endl; } ffC = new P1VectorFunc(stack, GradConstraints, 0); ffdC = new ConstantSparseMatFunc(stack, GradConstraints); } GenericFitnessFunctionDatas *GenericFitnessFunctionDatas::New (AssumptionF AF, const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam, const C_F0 &objfact, const C_F0 &lm) { switch (AF) { case no_assumption_f: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; case P2_f: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; case unavailable_hessian: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; case mv_P2_f: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; case quadratic_f: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; case linear_f: return new FitnessFunctionDatas(args, nargs, theparam, objfact, lm); break; default: return 0; break; } } GenericConstraintFunctionDatas *GenericConstraintFunctionDatas::New (AssumptionG AG, const basicAC_F0 &args, Expression const *nargs, const C_F0 &theparam) { switch (AG) { case no_assumption_g: return new ConstraintFunctionDatas(args, nargs, theparam); break; case without_constraints: return new ConstraintFunctionDatas(args, nargs, theparam); break; case P1_g: return new ConstraintFunctionDatas(args, nargs, theparam); break; case mv_P1_g: return new ConstraintFunctionDatas(args, nargs, theparam); break; case linear_g: return new ConstraintFunctionDatas(args, nargs, theparam); break; default: return 0; break; } } /* * enum AssumptionF {undeff,no_assumption_f, P2_f, unavailable_hessian, mv_P2_f, quadratic_f, linear_f}; * enum AssumptionG {undefg,without_constraints, no_assumption_g, P1_g, mv_P1_g, linear_g}; */ LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/mshmet.cpp000644 000767 000024 00000051672 13312446271 020500 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: mshmet libMesh //ff-c++-cpp-dep: // *INDENT-ON* // /* * Thank to the ARN () FF2A3 grant * ref:ANR-07-CIS7-002-01 */ // ./ff-c++ mshmet.cpp -I/Users/morice/Desktop/adaptmesh3d/mshmet.2009.09.16/sources -L/Users/morice/Desktop/adaptmesh3d/mshmet.2009.09.16/objects/i386/ -lmshmet -L/Users/morice/work/postdoc/freefem++prod/src/libMesh/ -lMesh // ./ff-c++ mshmet.cpp -I../download/include/mshmet/ -L../download/lib/mshmet/ -lmshmet -L/Users/morice/work/postdoc/freefem++prod/src/libMesh/ -lMesh #include "ff++.hpp" #include "msh3.hpp" // #define ADAPTLIBRARY // #include "libmesh5.h" #include "mshmetlib.h" #ifdef __cplusplus extern "C" { #endif #include #include /* prototype (re)definitions */ void*M_malloc (size_t size, char *call); void*M_calloc (size_t nelem, size_t elsize, const char *call); void*M_realloc (void *ptr, size_t size, const char *call); void M_free (void *ptr); /* ptototypes : tools */ int M_memLeak (); void M_memDump (); size_t M_memSize (); #ifdef __cplusplus } #endif using namespace Fem2D; using namespace mshmet; typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; // 2d mesh function // Add FH thank to I. Bajc. (iztok.bajc@fmf.uni-lj.si) 03/14 // static void myMSHMET_free (MSHMET_pMesh mesh, MSHMET_pSol sol) { /* free mem */ M_free(mesh->point); if (mesh->nt) {M_free(mesh->tria);} if (mesh->ne) {M_free(mesh->tetra);} M_free(mesh->adja); M_free(mesh); M_free(sol->sol); M_free(sol->met); M_free(sol); } MSHMET_pMesh mesh_to_MSHMET_pMesh (const Mesh &Th) { MSHMET_pMesh meshMSHMET; meshMSHMET = (MSHMET_pMesh)M_calloc(1, sizeof(MSHMET_Mesh), "mesh2"); meshMSHMET->dim = 2; meshMSHMET->np = Th.nv; meshMSHMET->nt = Th.nt; meshMSHMET->ne = 0; meshMSHMET->point = (MSHMET_pPoint)M_calloc(meshMSHMET->np + 1, sizeof(MSHMET_Point), "point"); meshMSHMET->tria = (MSHMET_pTria)M_calloc(meshMSHMET->nt + 1, sizeof(MSHMET_Tria), "tria"); meshMSHMET->adja = (int *)M_calloc(3 * meshMSHMET->nt + 5, sizeof(int), "adja"); int k; MSHMET_pPoint ppt; for (k = 1; k <= meshMSHMET->np; k++) { ppt = &meshMSHMET->point[k]; ppt->c[0] = Th.vertices[k - 1].x; ppt->c[1] = Th.vertices[k - 1].y; ppt->c[2] = 0.; // ppt->mark = Th.vertices[k-1].lab; } MSHMET_pTria ptriangle; MSHMET_pPoint p0, p1, p2; double ux, uy, h1, h2, h3, pe, rins; int i; for (k = 1; k <= meshMSHMET->nt; k++) { const Mesh::Triangle &K(Th.t(k - 1)); ptriangle = &meshMSHMET->tria[k]; ptriangle->v[0] = Th.operator () (K[0]) + 1; ptriangle->v[1] = Th.operator () (K[1]) + 1; ptriangle->v[2] = Th.operator () (K[2]) + 1; // ptriangle->mark = K.lab; for (i = 0; i < 3; i++) { ppt = &meshMSHMET->point[ptriangle->v[i]]; if (!ppt->s) {ppt->s = k;} } p0 = &meshMSHMET->point[ptriangle->v[0]]; p1 = &meshMSHMET->point[ptriangle->v[1]]; p2 = &meshMSHMET->point[ptriangle->v[2]]; ux = p1->c[0] - p0->c[0]; uy = p1->c[1] - p0->c[1]; h1 = sqrt(ux * ux + uy * uy); ux = p2->c[0] - p0->c[0]; uy = p2->c[1] - p0->c[1]; h2 = sqrt(ux * ux + uy * uy); ux = p2->c[0] - p1->c[0]; uy = p2->c[1] - p1->c[1]; h3 = sqrt(ux * ux + uy * uy); /* * pe = 0.5 * (h1 + h2 + h3); * double aire = pe * (pe-h1) * (pe-h2) * (pe-h3); * //aire = sqrt(ptriangle->aire); * //rins = 2.0 * aire / pe; * * //p0->aire += ptriangle->aire; * //p0->rins += rins; * * //p1->aire += ptriangle->aire; * //p1->rins += rins; * * //p2->aire += ptriangle->aire; * //p2->rins += rins; */ } return meshMSHMET; } // 3d mesh function MSHMET_pMesh mesh3_to_MSHMET_pMesh (const Mesh3 &Th3) { MSHMET_pMesh meshMSHMET; meshMSHMET = (MSHMET_pMesh)M_calloc(1, sizeof(MSHMET_Mesh), "Mesh3"); meshMSHMET->dim = 3; meshMSHMET->np = Th3.nv; meshMSHMET->nt = 0; meshMSHMET->ne = Th3.nt; meshMSHMET->point = (MSHMET_pPoint)M_calloc(meshMSHMET->np + 1, sizeof(MSHMET_Point), "point3"); meshMSHMET->tetra = (MSHMET_pTetra)M_calloc(meshMSHMET->ne + 1, sizeof(MSHMET_Tetra), "tetra"); meshMSHMET->adja = (int *)M_calloc(4 * meshMSHMET->ne + 5, sizeof(int), "adja3"); int k; MSHMET_pPoint ppt; for (k = 1; k <= meshMSHMET->np; k++) { ppt = &meshMSHMET->point[k]; ppt->c[0] = Th3.vertices[k - 1].x; ppt->c[1] = Th3.vertices[k - 1].y; ppt->c[2] = Th3.vertices[k - 1].z; // ppt->mark = 0; //Th3.vertices[k-1].lab; } int i; MSHMET_pTetra ptetra; for (k = 1; k <= meshMSHMET->ne; k++) { const Tet &K(Th3.elements[k - 1]); ptetra = &meshMSHMET->tetra[k]; ptetra->v[0] = Th3.operator () (K[0]) + 1; ptetra->v[1] = Th3.operator () (K[1]) + 1; ptetra->v[2] = Th3.operator () (K[2]) + 1; ptetra->v[3] = Th3.operator () (K[3]) + 1; // ptetra->mark = 0;//K.lab; for (i = 0; i < 4; i++) { ppt = &meshMSHMET->point[ptetra->v[i]]; if (meshMSHMET->dim == 3 && !ppt->s) {ppt->s = k;} } } return meshMSHMET; } MSHMET_pSol sol_mshmet (const int &dim, const int &np, const int &type, const int &size, int *typtab, const KN &solutions) { static const int wrapperMetric[6] = {0, 1, 3, 2, 4, 5}; MSHMET_pSol sol; int k, ia, i; sol = (MSHMET_pSol)M_calloc(1, sizeof(MSHMET_Sol), "sol"); sol->ver = 0; sol->np = np; sol->dim = dim; sol->type = type; // nombre de solutions differentes sol->size = size; for (i = 0; i < sol->type; i++) { sol->typtab[i] = typtab[i]; // types des differentes solutions } sol->sol = (double *)M_calloc(sol->np + 1, sol->size * sizeof(double), "sol->sol"); assert(sol->sol); for (k = 1; k <= sol->np; k++) { ia = (k - 1) * sol->size + 1; for (i = 0; i < sol->size; i++) { sol->sol[ia + i] = solutions[(ia - 1) + i]; } } return sol; } void metric_mshmet (MSHMET_pSol sol, MSHMET_Info *info, const KN &metric) { static const int wrapperMetric[6] = {0, 1, 3, 2, 4, 5}; int k, ia, i; cout << " info->iso " << info->iso << endl; if (info->iso == 1) { cout << " info->iso 11 " << info->iso << endl; sol->met = (double *)M_calloc(sol->np + 1, sizeof(double), "sol->met"); assert(sol->met); // isotrope for (k = 1; k <= sol->np; k++) { sol->met[k] = metric[k - 1]; } } else { // anisotropie :: Hessian sol->met = (double *)M_calloc(sol->np + 1, 6 * sizeof(double), "sol->met6"); assert(sol->met); for (k = 1; k <= sol->np; k++) { ia = (k - 1) * 6 + 1; for (i = 0; i < 6; i++) { sol->met[ia + i] = metric[(ia - 1) + wrapperMetric[i]]; } } } } void metric_mshmet_to_ff_metric (MSHMET_pSol sol, MSHMET_Info *info, KN &metric) { static const int invwrapperMetric[6] = {0, 1, 3, 2, 4, 5}; int k, ia, i; if (info->iso == 1) { cout << " info->iso " << " metric " << metric.N() << " " << sol->np << endl; // isotrope for (k = 1; k <= sol->np; k++) { metric[k - 1] = sol->met[k]; // cout << "k " << k << " " << sol->met[k] << endl; } } else { for (k = 1; k <= sol->np; k++) { ia = (k - 1) * 6 + 1; for (i = 0; i < 6; i++) { metric[(ia - 1) + i] = sol->met[ia + invwrapperMetric[i]]; } } } } class mshmet3d_Op: public E_F0mps { public: typedef KN_ Result; Expression eTh; int nbsol; int nbsolsize; int typesol[GmfMaxTyp]; int dim; vector sol; static const int n_name_param = 12; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} int arg (int i, Stack stack, int a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} int arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: mshmet3d_Op (const basicAC_F0 &args): sol(args.size() - 1) { // cout << "mshmet3d"<< endl; args.SetNameParam(n_name_param, name_param, nargs); eTh = to(args[0]); dim = 3; nbsol = args.size() - 1; int ksol = 0; ffassert(nbsol < GmfMaxTyp); for (int i = 1; i < nbsol + 1; i++) { if (args[i].left() == atype()) { const E_Array *a = dynamic_cast(args[i].LeftValue()); ffassert(a); ksol += a->size(); } else { ksol++; } } sol.resize(ksol); // typesol :: 1 sca, 2 vector, 3 symtensor ksol = 0; nbsolsize = 0; for (int i = 1; i < nbsol + 1; i++) { if (args[i].left() == atype()) { const E_Array *a = dynamic_cast(args[i].LeftValue()); ffassert(a); int N = a->size(); nbsolsize = nbsolsize + N; switch (N) { case 3: typesol[i - 1] = 2; for (int j = 0; j < N; j++) { sol[ksol++] = to((*a)[j]); } break; case 6: typesol[i - 1] = 3; for (int j = 0; j < N; j++) { sol[ksol++] = to((*a)[j]); } break; default: CompileError(" 3D solution for mshmest is vector (3 comp) or symetric tensor (6 comp)"); break; } } else { typesol[i - 1] = 1; nbsolsize = nbsolsize + 1; sol[ksol++] = to(args[i]); } } } static ArrayOfaType typeargs () {return ArrayOfaType(atype(), true);} // all type static E_F0*f (const basicAC_F0 &args) {return new mshmet3d_Op(args);} AnyType operator () (Stack stack) const; operator aType () const {return atype >();} }; basicAC_F0::name_and_type mshmet3d_Op::name_param [] = { {"loptions", &typeid(KN_)}, // 0 {"doptions", &typeid(KN_)}, {"metric", &typeid(KN_)}, {"normalization", &typeid(bool)}, {"aniso", &typeid(bool)}, {"levelset", &typeid(bool)},// 5 {"verbosity", &typeid(long)}, {"nbregul", &typeid(long)}, {"hmin", &typeid(double)}, {"hmax", &typeid(double)}, // 9 {"err", &typeid(double)}, // 10 {"width", &typeid(double)} // 11 }; template ostream&dumpp (const T *p, int n, ostream &f) { for (int i = 0; i < n; ++i) { f << p[i] << " "; } return f; } AnyType mshmet3d_Op::operator () (Stack stack) const { // initialisation MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); ffassert(pTh); Mesh3 &Th3 = *pTh; int nv = Th3.nv; int nt = Th3.nt; int nbe = Th3.nbe; KN defaultfopt(4); /* * info->hmin = fopt[0]; // 0.01; * info->hmax = fopt[1]; // 1.0; * info->eps = fopt[2]; // 0.01; * info->width = fopt[3]; // 0.05; */ defaultfopt(0) = 0.01; defaultfopt(1) = 1.0; defaultfopt(2) = 0.01; defaultfopt(3) = 0.00; KN defaultintopt(7); /* * info->nnu = intopt[0]; // 0; * info->iso = intopt[1]; // 1; * info->ls = intopt[2]; // 0; * info->ddebug = intopt[3]; // 0; * info->imprim = intopt[4]; // 10; * info->nlis = intopt[5]; // 0; * info->metric = intopt[6]; // 0; // metric given besoin ??? */ defaultintopt(0) = 1; defaultintopt(1) = 1; defaultintopt(2) = 0; defaultintopt(3) = 0; defaultintopt(4) = verbosity; defaultintopt(5) = 0; defaultintopt(6) = 0; if (nargs[11]) {defaultintopt[2] = 1; defaultfopt[3] = 0;} // level set ... KN intopt(arg(0, stack, defaultintopt)); KN fopt(arg(1, stack, defaultfopt)); KN *pmetric = new KN(Th3.nv); KN &metric = *pmetric; intopt[0] = arg(3, stack, intopt[0] != 0); // normaliz intopt[1] = !arg(4, stack, intopt[1] == 0); // aniso intopt[2] = arg(5, stack, intopt[2] != 0); // levelset intopt[4] = arg(6, stack, intopt[4]); // verbo intopt[5] = arg(7, stack, intopt[5]); // nbregul fopt[0] = arg(8, stack, fopt[0]); // hmin fopt[1] = arg(9, stack, fopt[1]); // hmax fopt[2] = arg(10, stack, fopt[2]); // err fopt[3] = arg(11, stack, fopt[3]); // width if (verbosity > 2) { cout << " -- mshmet : lopt "; dumpp((int *)intopt, intopt.N(), cout) << endl; cout << " : dopt "; dumpp((double *)fopt, fopt.N(), cout) << endl; } metric = 0.; if (intopt.N() != 7) { ExecError(" Size of array of loption are wrong != 7"); } if (fopt.N() != 4) { ExecError(" Size of array of doption are wrong != 4"); } if (intopt[1] == 0) { metric.resize(6 * Th3.nv); metric = 0.; } // definiton d'une metric par default if (nargs[2]) { metric = GetAny >((*nargs[2])(stack)); assert(metric.N() == Th3.nv || metric.N() == 6 * Th3.nv); intopt[6] = 1; if (metric.N() == Th3.nv) {intopt[1] = 1;} if (metric.N() == 6 * Th3.nv) {intopt[1] = 0;} } MSHMET_pMesh mshmetmesh = mesh3_to_MSHMET_pMesh(Th3); int TypTab[nbsol]; for (int ii = 0; ii < nbsol; ii++) { TypTab[ii] = typesol[ii]; } KN tabsol(nbsolsize * nv); tabsol = 0.; { MeshPoint *mp3(MeshPointStack(stack)); KN takemesh(nv); takemesh = false; for (int it = 0; it < nt; it++) { for (int iv = 0; iv < 4; iv++) { int i = Th3(it, iv); if (takemesh[i] == false) { mp3->setP(&Th3, it, iv); for (int ii = 0; ii < nbsolsize; ii++) { tabsol[i * nbsolsize + ii] = GetAny((*sol[ii])(stack)); } takemesh[i] = true; } } } } if (verbosity > 5) { cout << " min/max tabsol: " << tabsol.min() << " " << tabsol.max() << endl; } MSHMET_pSol mshmetsol = sol_mshmet(dim, nv, nbsol, nbsolsize, TypTab, tabsol); if (intopt[1] == 1) { mshmetmesh->info.iso = 1; } else { mshmetmesh->info.iso = 0; } if (nargs[2]) {metric_mshmet(mshmetsol, &mshmetmesh->info, metric);} int res = MSHMET_mshmet(intopt, fopt, mshmetmesh, mshmetsol); if (res > 0) { cout << " problem with mshmet :: error " << res << endl; exit(1); } metric_mshmet_to_ff_metric(mshmetsol, &mshmetmesh->info, metric); // faire les free myMSHMET_free(mshmetmesh, mshmetsol); if (verbosity > 1000) {M_memDump();} Add2StackOfPtr2Free(stack, pmetric); *mp = mps; return SetAny >(metric); } // mshmet2d class mshmet2d_Op: public E_F0mps { public: typedef KN_ Result; Expression eTh; int nbsol; int nbsolsize; int typesol[GmfMaxTyp]; int dim; vector sol; static const int n_name_param = 12; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: mshmet2d_Op (const basicAC_F0 &args): sol(args.size() - 1) { cout << "mshmet2d" << endl; args.SetNameParam(n_name_param, name_param, nargs); eTh = to(args[0]); dim = 3; nbsol = args.size() - 1; int ksol = 0; ffassert(nbsol < GmfMaxTyp); for (int i = 1; i < nbsol + 1; i++) { if (args[i].left() == atype()) { const E_Array *a = dynamic_cast(args[i].LeftValue()); ffassert(a); ksol += a->size(); } else { ksol++; } } sol.resize(ksol); // typesol :: 1 sca, 2 vector, 3 symtensor ksol = 0; nbsolsize = 0; for (int i = 1; i < nbsol + 1; i++) { if (args[i].left() == atype()) { const E_Array *a = dynamic_cast(args[i].LeftValue()); ffassert(a); int N = a->size(); nbsolsize = nbsolsize + N; switch (N) { case 2: typesol[i - 1] = 2; for (int j = 0; j < N; j++) { sol[ksol++] = to((*a)[j]); } break; case 3: typesol[i - 1] = 3; for (int j = 0; j < N; j++) { sol[ksol++] = to((*a)[j]); } break; default: CompileError(" 2D solution for mshmest is vector (2 comp) or symetric tensor (3 comp)"); break; } } else { typesol[i - 1] = 1; nbsolsize = nbsolsize + 1; sol[ksol++] = to(args[i]); } } } static ArrayOfaType typeargs () {return ArrayOfaType(atype(), true);}// all type static E_F0*f (const basicAC_F0 &args) {return new mshmet2d_Op(args);} AnyType operator () (Stack stack) const; operator aType () const {return atype >();} }; basicAC_F0::name_and_type mshmet2d_Op::name_param [] = { {"loptions", &typeid(KN_)}, {"doptions", &typeid(KN_)}, {"metric", &typeid(KN_)} }; AnyType mshmet2d_Op::operator () (Stack stack) const { // initialisation MeshPoint *mp(MeshPointStack(stack)), mps = *mp; const Mesh *pTh = GetAny((*eTh)(stack)); ffassert(pTh); const Mesh &Th = *pTh; int nv = Th.nv; int nt = Th.nt; int nbe = Th.neb; KN defaultfopt(4); /* * info->hmin = fopt[0]; // 0.01; * info->hmax = fopt[1]; // 1.0; * info->eps = fopt[2]; // 0.01; * info->width = fopt[3]; // 0.05; */ defaultfopt(0) = 0.01; defaultfopt(1) = 1.0; defaultfopt(2) = 0.01; defaultfopt(3) = 0.05; KN defaultintopt(7); /* * info->nnu = intopt[0]; // 0; * info->iso = intopt[1]; // 1; * info->ls = intopt[2]; // 0; * info->ddebug = intopt[3]; // 0; * info->imprim = intopt[4]; // 10; * info->nlis = intopt[5]; // 0; * info->metric = intopt[6]; // 0; // metric given besoin ??? */ defaultintopt(0) = 0; defaultintopt(1) = 1; defaultintopt(2) = 0; defaultintopt(3) = 1; defaultintopt(4) = 10; defaultintopt(5) = 0; defaultintopt(6) = 0; KN intopt(arg(0, stack, defaultintopt)); KN fopt(arg(1, stack, defaultfopt)); KN *pmetric = new KN(Th.nv); KN &metric = *pmetric; if (intopt[1] == 1) { metric.resize(6 * Th.nv); metric = 0.; } // definiton d'une metric par default if (nargs[2]) { metric = GetAny >((*nargs[2])(stack)); assert(metric.N() == Th.nv || metric.N() == 6 * Th.nv); intopt[6] = 1; if (metric.N() == Th.nv) {intopt[1] = 1;} if (metric.N() == 6 * Th.nv) {intopt[1] = 0;} } MSHMET_pMesh mshmetmesh = mesh_to_MSHMET_pMesh(Th); int TypTab[nbsol]; for (int ii = 0; ii < nbsol; ii++) { TypTab[ii] = typesol[ii]; } KN tabsol(nbsolsize * nv); tabsol = 0.; { MeshPoint *mp3(MeshPointStack(stack)); KN takemesh(nv); takemesh = false; for (int it = 0; it < nt; it++) { for (int iv = 0; iv < 3; iv++) { int i = Th(it, iv); if (takemesh[i] == false) { mp3->setP(&Th, it, iv); for (int ii = 0; ii < nbsolsize; ii++) { tabsol[i * nbsolsize + ii] = GetAny((*sol[ii])(stack)); } takemesh[i] = true; } } } } MSHMET_pSol mshmetsol = sol_mshmet(dim, nv, nbsol, nbsolsize, TypTab, tabsol); if (intopt[1] == 1) { mshmetmesh->info.iso = 1; } else { mshmetmesh->info.iso = 0; } if (nargs[2]) {metric_mshmet(mshmetsol, &mshmetmesh->info, metric);} int res = MSHMET_mshmet(intopt, fopt, mshmetmesh, mshmetsol); if (res > 0) { cout << " problem with mshmet :: error " << res << endl; exit(1); } metric_mshmet_to_ff_metric(mshmetsol, &mshmetmesh->info, metric); // faire les free myMSHMET_free(mshmetmesh, mshmetsol); *mp = mps; if (verbosity > 1000) {M_memDump();} Add2StackOfPtr2Free(stack, pmetric); return SetAny >(metric); } /* class Init1 { public: * Init1(); * }; * * $1 */ static void Load_Init () { // le constructeur qui ajoute la fonction "splitmesh3" a freefem++ // if (verbosity) if (verbosity) {cout << " load: mshmet " << endl;} Global.Add("mshmet", "(", new OneOperatorCode ); Global.Add("mshmet", "(", new OneOperatorCode ); // Global.Add("mshmet","(",new OneOperatorCode ); } // #define WITH_NO_INIT // #include "msh3.hpp" LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/bfstream.edp000644 000767 000024 00000000567 13312446271 020771 0ustar00hechtstaff000000 000000 load "bfstream" real[int] b(10), bb(1); for (int i = 0; i < b.n; ++i) b[i] = i+pi; cout << " " << b << endl; { ofstream f("bfstreamExample.dt"); f.write(134); f.write(1.346888); f.write(b); } b = 0; { real r; int i; ifstream f("bfstreamExample.dt"); f.read(i); f.read(r); f.read(bb); cout << i << " " << r << endl; cout << bb << endl; //cout << b << endl; } freefem++-3.61-1/examples++-load/waveguide2.edp000644 000767 000024 00000011267 13256636774 021247 0ustar00hechtstaff000000 000000 // (M. Bonazzoli, Nov 2015) load "msh3" load "medit" load "Element_Mixte3d" //for Edge13d //load "P012_3d_Modif" //for Edge13d (my file) // The boundary value problem: // (sigma = 0, here k is the wavenumber) // -k^2*E + curl(curl E) = 0 in Omega // E x n = 0 on x = 0, x = a, y = 0, y = b // Curl(E) x n + i*beta n x (E x n) = Ginc on z = 0 // Curl(E) x n + i*beta n x (E x n) = 0 on z = c // Mesh data int nloc = 4; // number of segments on the smallest dimension real a = 0.00254, b = 0.00127, c = 0.01; // dimensions of the waveguide //real a = 0.00254, b = 0.00127, c = 0.005; // Build the mesh include "cube.idp" int mx, my, mz; // to decide the number of seg in the 3 directions mx = a/min(a,b); my = b/min(a,b); mz = c/min(a,b); int[int] NN = [mx*nloc, my*nloc, mz*nloc]; // the number of seg in the 3 directions int guide = 1, in = 2, out = 3; // labels for the waveguide real [int,int] BB = [[0,a],[0,b],[0,c]]; // bounding box int [int,int] L = [[guide,guide],[guide,guide],[in,out]]; // labels of the 6 parallelipiped faces mesh3 Th = Cube(NN,BB,L); // build the mesh //medit("mesh", Th); // plot the mesh // Sol data real f = 94*10^9; // frequence (I think omega=2*pi*f) real er = 1; // dielectric constant real c0 = 299792458; // speed of light in vacuum real k = 2*pi*f*sqrt(er)/c0; // it's the wavenumber if mu_r=1 int m = 1, n = 0; real beta = sqrt(k^2-(m*pi/a)^2-(n*pi/b)^2); // it comes from the dispersive relation // (we assume E(x,y,z) = Etilde(x,y)*exp(-i*beta*z)) real Z = sqrt(er)*120*pi; // ? real ukb = 1/(k^2-beta^2); func expbz = exp(-1i*beta*z); func ExTE = (1i*k*Z)*ukb*(n*pi)/b*cos(m*pi*x/a)*sin(n*pi*y/b)*expbz; // (ricorda: k*Z = mu*omega) func EyTE = -(1i*k*Z)*ukb*(m*pi)/a*sin(m*pi*x/a)*cos(n*pi*y/b)*expbz; // For the impedance condition at the waveguide entrance: func Gix = +2*1i*beta*ExTE; func Giy = +2*1i*beta*EyTE; func Giz = 0; // the sign here is + and in the variational formulation it is - int2d(Th,in)(Ginc*v) (all is written on the lhs) // Finite element space fespace Nh(Th, Edge23d); // Edge13d: edge finite elements of degree 2 // (I called the space I introduced like this because the Nedelec elements of degree 1 are called Edge03d) Nh [Ex,Ey,Ez], [vx,vy,vz]; // define the vector field and the test function // (edge elements are vector elements and they give a subspace of Hcurl) // Macros macro Curl(ux,uy,uz) [dy(uz)-dz(uy),dz(ux)-dx(uz),dx(uy)-dy(ux)] // EOM macro Nvec(ux,uy,uz) [uy*N.z-uz*N.y,uz*N.x-ux*N.z,ux*N.y-uy*N.x] // EOM //uxN macro Curlabs(ux,uy,uz) [abs(dy(uz)-dz(uy)),abs(dz(ux)-dx(uz)),abs(dx(uy)-dy(ux))] //EOM // Variational formulation of the problem to solve // (sigma = 0, here k is the wavenumber) // -k^2*E + curl(curl E) = 0 in Omega // E x n = 0 on x = 0, x = a, y = 0, y = b // Curl(E) x n + i*beta n x (E x n) = Ginc on z = 0 // Curl(E) x n + i*beta n x (E x n) = 0 on z = c problem waveguide([Ex,Ey,Ez], [vx,vy,vz], solver=sparsesolver) = int3d(Th)(Curl(Ex,Ey,Ez)'*Curl(vx,vy,vz)) - int3d(Th)(k^2*[Ex,Ey,Ez]'*[vx,vy,vz]) + int2d(Th,in,out)(1i*beta*Nvec(Ex,Ey,Ez)'*Nvec(vx,vy,vz)) - int2d(Th,in)([vx,vy,vz]'*[Gix,Giy,Giz]) + on(guide,Ex=0,Ey=0,Ez=0); waveguide; // solve the problem Nh [Eex,Eey,Eez] = [ExTE,EyTE,0]; // the exact solution Nh [Errx,Erry,Errz]; // the error wrt the exact solution [Errx,Erry,Errz] = [Eex,Eey,Eez]-[Ex,Ey,Ez]; // Norm of the exact solution real Hcurlerrsqex, Hcurlerrex, L2errsqex, L2errex; L2errsqex = int3d(Th)(abs(Eex)^2+abs(Eey)^2+abs(Eez)^2); Hcurlerrsqex = int3d(Th)(Curlabs(Eex,Eey,Eez)'*Curlabs(Eex,Eey,Eez))+L2errsqex; Hcurlerrex = sqrt(Hcurlerrsqex); L2errex = sqrt(L2errsqex); cout << "Hcurl norm of the exact solution = " << Hcurlerrex << endl; cout << "L2 of the exact solution = " << L2errex << endl << endl; // Norm of the error real Hcurlerrsq, Hcurlerr, L2errsq, L2err; L2errsq = int3d(Th)(abs(Errx)^2+abs(Erry)^2+abs(Errz)^2); Hcurlerrsq = int3d(Th)(Curlabs(Errx,Erry,Errz)'*Curlabs(Errx,Erry,Errz))+L2errsq; Hcurlerr = sqrt(Hcurlerrsq); L2err = sqrt(L2errsq); cout << "Hcurl norm of the error = " << Hcurlerr << endl; cout << "L2 norm of the error = " << L2err << endl << endl; // Relative errors cout << "relative Hcurl norm of the error = " << Hcurlerr/Hcurlerrex << endl; cout << "relative L2 norm of the error = " << L2err/L2errex << endl << endl; // Plot the real part of the solution medit("real",Th,[real(Ex),real(Ey),real(Ez)]); // in the medit window press h=help, m=data!! freefem++-3.61-1/examples++-load/bilapHCT.edp000644 000767 000024 00000002244 13312446271 020606 0ustar00hechtstaff000000 000000 load "Element_HCT" load "qf11to25" // for tripleQF function // Parameter real f = 1; // Mesh mesh Th = square(40, 40); //mesh definition of Omega // Fespaces fespace Wh(Th, P2); fespace Vh(Th, HCT); // HCT finite element space Vh [u, ux, uy], [v, vx, vy]; // Macro macro bilaplacien(u, v) (dxx(u)*dxx(v) + dyy(u)*dyy(v) + 2.*dxy(u)*dxy(v)) // end of macro // Problem // WARNING: the quadrature formula must be defined on 3 sub triangles // the function tripleQF build this king of formula from classical quadrature QF2 qfHCT5 = tripleQF(qf5pT); solve bilap ([u, ux, uy], [v, vx, vy]) = int2d(Th, qft=qfHCT5)(bilaplacien(u, v)) - int2d(Th)(f*v) + on(1, 2, 3, 4, u=0, ux=0, uy=0) ; // Plot plot(u, cmm="u", wait=1, fill=1); plot(ux, wait=1, cmm="u_x"); plot(uy, wait=1, cmm="u_y"); // Max & Error Wh uu = u; real umax = uu[].max; int err = (abs(umax-0.0012782) > 1e-4); cout << " uu max = " << umax << " ~ 0.0012782, err = " << err << endl; // Plot int n = 100, nn = n+10; real[int] xx(nn), yy(nn); for (int i = 0; i <= n; i++) { xx[i] = real(i)/n; yy[i] = u(0.5, real(i)/n); // value of uh at point (0.5, i/10.) } plot([xx(0:n), yy(0:n)], wait=1); // End assert(err == 0); freefem++-3.61-1/examples++-load/PARDISO.edp000644 000767 000024 00000002126 13256636774 020300 0ustar00hechtstaff000000 000000 load "PARDISO" load "symmetrizeCSR" load "shell" //if(ompgetnumthreads() < 2 & getenv("OMP_NUM_THREAD") =="" ) // ompsetnumthreads(10);// set number of thread for PARDISO .. //cout << " OMP NUM THREAD = " << ompgetnumthreads() << " " << ompgetmaxthreads() << endl;; int[int] l = [1, 1, 2, 2]; mesh Th = square(150, 150, label = l); fespace Vh(Th, P2); Vh u, v; varf lap(u,v) = int2d(Th)(dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th)(v) + on(1, u = 1); real[int] b = lap(0, Vh); matrix A = lap(Vh, Vh); matrix B = A; //lap(Vh, Vh,solver=CG);; symmetrizeCSR(B); verbosity = 2; // If you want, you can pass an array of integer (int[int] t) // for specifying the type of the matrix you want to factorize // // You really should not though, as FreeFem++ will automatically // set the solver to either LU or LDL^T // lparams = t set(A, solver = sparsesolver); set(B, solver = sparsesolver); verbosity = 0; Vh x; x[] = A^-1 * b; plot(Th, x, wait = 1, dim = 3, fill = 1, cmm = "sparsesolver unsymmetric", value = 1); x[] = B^-1 * b; plot(Th, x, wait = 1, dim = 3, fill = 1, cmm = "sparsesolver symmetric", value = 1); freefem++-3.61-1/examples++-load/myfunction.cpp000644 000767 000024 00000006451 13312446271 021371 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // Example C++ function "myfunction", dynamically loaded into "load.edp" #include using namespace Fem2D; double myfunction (Stack stack) { // to get FreeFem++ data MeshPoint &mp = *MeshPointStack(stack); // the struct to get x,y, normal , value double x = mp.P.x; // get the current x value double y = mp.P.y; // get the current y value // cout << "x = " << x << " y=" << y << " " << sin(x)*cos(y) << endl; return sin(x) * cos(y); } // A class build the link with freefem++ // generaly this class are already in AFunction.hpp // but unfortunatly, I have no simple function with no parameter // in freefem++ depending of the mesh, template class OneOperator0s: public OneOperator { // the class to defined a evaluated a new function // It must devive from E_F0 if it is mesh independent // or from E_F0mps if it is mesh dependent class E_F0_F: public E_F0mps { public: typedef R (*func)(Stack stack); func f; // the pointeur to the fnction myfunction E_F0_F (func ff): f(ff) {} // the operator evaluation in freefem++ AnyType operator () (Stack stack) const {return SetAny(f(stack));} }; typedef R (*func)(Stack); func f; public: // the function which build the freefem++ byte code E_F0*code (const basicAC_F0 &) const {return new E_F0_F(f);} // the constructor to say ff is a function without parameter // and returning a R OneOperator0s (func ff): OneOperator(map_type[typeid(R).name()]), f(ff) {} }; double testio (Stack stack) { double x = M_PI; long l = (1 << 9); cout << " test cout " << x << endl; cout << " test cout " << l << endl; cerr << " test cerr " << x << endl; cerr << " test cerr " << l << endl; return 0.; } static void init () { Global.Add("myfunction", "(", new OneOperator0s(myfunction)); Global.Add("testio", "(", new OneOperator0s(testio)); } LOADFUNC(init); freefem++-3.61-1/examples++-load/msh3.cpp000644 000767 000024 00000611670 13312446271 020055 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // /* * Thank to the ARN () FF2A3 grant * ref:ANR-07-CIS7-002-01 */ // FH July 2009 // comment all // Th3_t->BuildBound(); // Th3_t->BuildAdj(); // Th3_t->Buildbnormalv(); // Th3_t->BuildjElementConteningVertex(); // is now in the constructor of Mesh3 to be consistante. // #ifndef WITH_NO_INIT// cf [[WITH_NO_INIT]] #include "ff++.hpp" #endif #include "AFunction_ext.hpp"// [[file:../src/fflib/AFunction_ext.hpp]] // TransfoMesh_v2.cpp using namespace std; // LayerMesh.cpp // buildlayer.cpp // trunc3d.cpp // rajout global #include #include #include #include "msh3.hpp" // [[file:msh3.hpp]] #include "splitsimplex.hpp" // [[file:../src/femlib/splitsimplex.hpp]] #include "renumb.hpp" using namespace Fem2D; int ChangeLab3D (const map &m, int lab); void TestSameVertexMesh3 (const Mesh3 &Th3, const double &hseuil, const R3 &Psup, const R3 &Pinf, int &nv_t, int *Numero_Som) { Vertex3 *v = new Vertex3[Th3.nv]; nv_t = 0; EF23::GTree *gtree = new EF23::GTree(v, Pinf, Psup, 0); // creation of octree for (int ii = 0; ii < Th3.nv; ii++) { const R3 r3vi(Th3.vertices[ii].x, Th3.vertices[ii].y, Th3.vertices[ii].z); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[nv_t].x = vi.x; v[nv_t].y = vi.y; v[nv_t].z = vi.z; v[nv_t].lab = Th3.vertices[ii].lab; // lab mis a zero par default Numero_Som[ii] = nv_t; gtree->Add(v[nv_t]); nv_t = nv_t + 1; } else { Numero_Som[ii] = pvi - v; } } delete gtree; delete [] v; } void TestSameTetrahedraMesh3 (const Mesh3 &Th3, const double &hseuil, const R3 &Psup, const R3 &Pinf, int &nt_t) { Vertex3 *vt = new Vertex3[Th3.nt]; EF23::GTree *gtree_t = new EF23::GTree(vt, Pinf, Psup, 0); nt_t = 0; // creation of octree for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.elements[ii]); int iv[4]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Th3.operator () (K[jj]); } const double Cdg_x = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x + Th3.vertices[iv[3]].x) / 4.; const double Cdg_y = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y + Th3.vertices[iv[3]].y) / 4.; const double Cdg_z = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z + Th3.vertices[iv[3]].z) / 4.; const R3 r3vi(Cdg_x, Cdg_y, Cdg_z); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_t->ToClose(vi, hseuil); if (!pvi) { vt[nt_t].x = vi.x; vt[nt_t].y = vi.y; vt[nt_t].z = vi.z; vt[nt_t].lab = K.lab; // lab mis a zero par default gtree_t->Add(vt[nt_t]); nt_t = nt_t + 1; } } delete gtree_t; delete [] vt; } void TestSameTetrahedraMesh3 (const Mesh3 &Th3, const double &hseuil, const R3 &Psup, const R3 &Pinf, int *Elem_ok, int &nt_t) { Vertex3 *vt = new Vertex3[Th3.nt]; EF23::GTree *gtree_t = new EF23::GTree(vt, Pinf, Psup, 0); nt_t = 0; // creation of octree for (int ii = 0; ii < Th3.nt; ii++) { if (Elem_ok[ii] != 1) {continue;} const Tet &K(Th3.elements[ii]); int iv[4]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Th3.operator () (K[jj]); } const double Cdg_x = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x + Th3.vertices[iv[3]].x) / 4.; const double Cdg_y = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y + Th3.vertices[iv[3]].y) / 4.; const double Cdg_z = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z + Th3.vertices[iv[3]].z) / 4.; const R3 r3vi(Cdg_x, Cdg_y, Cdg_z); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_t->ToClose(vi, hseuil); if (!pvi) { vt[nt_t].x = vi.x; vt[nt_t].y = vi.y; vt[nt_t].z = vi.z; vt[nt_t].lab = K.lab; // lab mis a zero par default gtree_t->Add(vt[nt_t]); nt_t = nt_t + 1; } else { Elem_ok[ii] = 0; } } delete gtree_t; delete [] vt; } void TestSameTriangleMesh3 (const Mesh3 &Th3, const double &hseuil, const R3 &Psup, const R3 &Pinf, int &nbe_t) { Vertex3 *vbe = new Vertex3[Th3.nbe]; EF23::GTree *gtree_be = new EF23::GTree(vbe, Pinf, Psup, 0); nbe_t = 0; // creation of octree for (int ii = 0; ii < Th3.nbe; ii++) { const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th3.operator () (K[jj]); } const double Cdg_x = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x) / 3.; const double Cdg_y = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y) / 3.; const double Cdg_z = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z) / 3.; const R3 r3vi(Cdg_x, Cdg_y, Cdg_z); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_be->ToClose(vi, hseuil); if (!pvi) { vbe[nbe_t].x = vi.x; vbe[nbe_t].y = vi.y; vbe[nbe_t].z = vi.z; vbe[nbe_t].lab = K.lab; // lab mis a zero par default gtree_be->Add(vbe[nbe_t]); nbe_t = nbe_t + 1; } } delete gtree_be; delete [] vbe; } void TestSameTriangleMesh3 (const Mesh3 &Th3, const double &hseuil, const R3 &Psup, const R3 &Pinf, int *Border_ok, int &nbe_t) { Vertex3 *vbe = new Vertex3[Th3.nbe]; EF23::GTree *gtree_be = new EF23::GTree(vbe, Pinf, Psup, 0); nbe_t = 0; // creation of octree for (int ii = 0; ii < Th3.nbe; ii++) { if (Border_ok[ii] != 1) {continue;} const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th3.operator () (K[jj]); } const double Cdg_x = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x) / 3.; const double Cdg_y = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y) / 3.; const double Cdg_z = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z) / 3.; const R3 r3vi(Cdg_x, Cdg_y, Cdg_z); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_be->ToClose(vi, hseuil); if (!pvi) { vbe[nbe_t].x = vi.x; vbe[nbe_t].y = vi.y; vbe[nbe_t].z = vi.z; vbe[nbe_t].lab = K.lab; // lab mis a zero par default gtree_be->Add(vbe[nbe_t]); nbe_t = nbe_t + 1; } else { if (K.lab == vbe[pvi - vbe].lab) {Border_ok[ii] = 0;} } } delete gtree_be; delete [] vbe; } int TestElementMesh3 (const Mesh3 &Th3) { // Test si le maillage à des éléments communs : Sommet, triangle, ... // FH 31/09/2009: Change int* to KN to remove pb of missing free in some case R3 Pinf(1e100, 1e100, 1e100), Psup(-1e100, -1e100, -1e100); // Extremité de la boîte englobante double hmin = 1e10; // longueur minimal des arrêtes double hseuil; KN Numero_Som(Th3.nv); int nv_t, nt_t, nbe_t; // calcul de la boite englobante for (int ii = 0; ii < Th3.nv; ii++) { R3 P(Th3.vertices[ii].x, Th3.vertices[ii].y, Th3.vertices[ii].z); Pinf = Minc(P, Pinf); Psup = Maxc(P, Psup); } // calcul de la longueur minimal des arrêtes for (int k = 0; k < Th3.nt; k++) { for (int e = 0; e < 6; e++) { if (Th3[k].lenEdge(e) < Norme2(Psup - Pinf) / 1e9) { const Tet &K(Th3.elements[k]); int iv[4]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Th3.operator () (K[jj]); } for (int eh = 0; eh < 6; eh++) { cout << "tetrahedra: " << k << " edge : " << eh << " lenght " << Th3[k].lenEdge(eh) << endl; cout << " Tet vertices : " << iv[0] << " " << iv[1] << " " << iv[2] << " " << iv[3] << " " << endl; } cout << " A tetrahedra with a very small edge was created " << endl; return 1; } hmin = min(hmin, Th3[k].lenEdge(e));// calcul de .lenEdge pour un Mesh3 } } for (int k = 0; k < Th3.nbe; k++) { for (int e = 0; e < 3; e++) { if (Th3.be(k).lenEdge(e) < Norme2(Psup - Pinf) / 1e9) { for (int eh = 0; eh < 3; e++) { cout << "triangles: " << k << " edge : " << eh << " lenght " << Th3.be(k).lenEdge(e) << endl; } cout << " A triangle with a very small edges was created " << endl; return 1; } hmin = min(hmin, Th3.be(k).lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } if (verbosity > 1) {cout << " - hmin =" << hmin << " , Bounding Box: " << Pinf << " " << Psup << endl;} ffassert(hmin > Norme2(Psup - Pinf) / 1e9); // determination du nombre de sommets confondus hseuil = hmin / 10.; if (verbosity > 1) {cout << "TestSameVertexMesh3 " << hseuil << " size" << Th3.nv << endl;} TestSameVertexMesh3(Th3, hseuil, Psup, Pinf, nv_t, Numero_Som); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbVertexRecollement " << nv_t << " / " << "NbVertex(anc)" << Th3.nv << endl;} if (nv_t != Th3.nv) { // delete [] Numero_Som; cout << " A vertex was referenced twice or more " << endl; return 1; } /* degenerate element ??? */ KN Elem_ok(Th3.nt); int i_elem = 0; for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.elements[ii]); int iv[4]; Elem_ok[ii] = 1; for (int jj = 0; jj < 4; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; } for (int jj = 0; jj < 4; jj++) { for (int kk = jj + 1; kk < 4; kk++) { if (iv[jj] == iv[kk]) { Elem_ok[ii] = 0; } } } i_elem = i_elem + Elem_ok[ii]; } if (i_elem != Th3.nt) { cout << "There are a false tetrahedra in the mesh" << endl; assert(i_elem == Th3.nt); } KN Border_ok(Th3.nbe); int i_border = 0; for (int ii = 0; ii < Th3.nbe; ii++) { Border_ok[ii] = 1; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] < nv_t); } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { if (iv[jj] == iv[kk]) {Border_ok[ii] = 0;} } } i_border = i_border + Border_ok[ii]; } if (i_border != Th3.nbe) { cout << "There are a false tetrahedra in the mesh" << endl; assert(i_elem == Th3.nt); } /* determination du nombre de tetrahedre confondus */ hseuil = hmin / 10.; hseuil = hseuil / 4.; if (verbosity > 1) {cout << "TestSameTetrahedraMesh3 " << hseuil << " size " << Th3.nt << endl;} TestSameTetrahedraMesh3(Th3, hseuil, Psup, Pinf, Elem_ok, nt_t); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbTetrahedraRecollement " << nt_t << " / " << "NbVertex(anc)" << Th3.nt << endl;} if (nt_t != Th3.nt) { cout << " a tetrahedra was referenced twice or more " << endl; return 1; } /* determination du nombre de triangles confondus */ hseuil = hmin / 10.; hseuil = hseuil / 3.; if (verbosity > 1) {cout << "TestSameTriangleMesh3 " << hseuil << endl;} TestSameTriangleMesh3(Th3, hseuil, Psup, Pinf, Border_ok, nbe_t); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbVertexRecollement " << nbe_t << " / " << "NbVertex(anc)" << Th3.nbe << endl;} if (nbe_t != Th3.nbe) { cout << " a triangle was referenced twice or more " << endl; return 1; } return 0; } Mesh3*TestElementMesh3_patch (const Mesh3 &Th3) { // Test si le maillage à des éléments communs : Sommet, triangle, ... R3 Pinf(1e100, 1e100, 1e100), Psup(-1e100, -1e100, -1e100); // Extremité de la boîte englobante double hmin = 1e10; // longueur minimal des arrêtes double hseuil; int *Numero_Som = new int [Th3.nv]; int nv_t, nt_t, nbe_t; // calcul de la boite englobante for (int ii = 0; ii < Th3.nv; ii++) { R3 P(Th3.vertices[ii].x, Th3.vertices[ii].y, Th3.vertices[ii].z); Pinf = Minc(P, Pinf); Psup = Maxc(P, Psup); } // calcul de la longueur minimal des arrêtes for (int k = 0; k < Th3.nt; k++) { for (int e = 0; e < 6; e++) { if (Th3[k].lenEdge(e) < Norme2(Psup - Pinf) / 1e9) {continue;} hmin = min(hmin, Th3[k].lenEdge(e));// calcul de .lenEdge pour un Mesh3 } } for (int k = 0; k < Th3.nbe; k++) { for (int e = 0; e < 3; e++) { if (Th3[k].lenEdge(e) < Norme2(Psup - Pinf) / 1e9) {continue;} hmin = min(hmin, Th3.be(k).lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } if (verbosity > 1) {cout << " - hmin =" << hmin << " , Bounding Box: " << Pinf << " " << Psup << endl;} ffassert(hmin > Norme2(Psup - Pinf) / 1e9); // determination du nombre de sommets confondus hseuil = hmin / 10.; if (verbosity > 1) {cout << "TestSameVertexMesh3" << endl;} TestSameVertexMesh3(Th3, hseuil, Psup, Pinf, nv_t, Numero_Som); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbVertexRecollement " << nv_t << " / " << "NbVertex(anc)" << Th3.nv << endl;} /* degenerate element ??? */ int *Elem_ok = new int[Th3.nt]; int i_elem = 0; for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.elements[ii]); int iv[4]; Elem_ok[ii] = 1; for (int jj = 0; jj < 4; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; } for (int jj = 0; jj < 4; jj++) { for (int kk = jj + 1; kk < 4; kk++) { if (iv[jj] == iv[kk]) { Elem_ok[ii] = 0; } } } i_elem = i_elem + Elem_ok[ii]; } if (i_elem != Th3.nt) { cout << "There are a false tetrahedra in the mesh" << endl; // assert( i_elem == Th3.nt); } int *Border_ok = new int[Th3.nbe]; int i_border = 0; for (int ii = 0; ii < Th3.nbe; ii++) { Border_ok[ii] = 1; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] < nv_t); } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { if (iv[jj] == iv[kk]) {Border_ok[ii] = 0;} } } i_border = i_border + Border_ok[ii]; } if (i_border != Th3.nbe) { cout << "There are a false tetrahedra in the mesh" << endl; // assert( i_elem == Th3.nt); } /* determination du nombre de tetrahedre confondus */ hseuil = hmin / 10.; hseuil = hseuil / 4.; nt_t = 0; TestSameTetrahedraMesh3(Th3, hseuil, Psup, Pinf, Elem_ok, nt_t); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbVertexRecollement " << nt_t << " / " << "NbVertex(anc)" << Th3.nt << endl;} /* determination du nombre de triangles confondus */ hseuil = hmin / 10.; hseuil = hseuil / 3.; TestSameTriangleMesh3(Th3, hseuil, Psup, Pinf, Border_ok, nbe_t); if (verbosity > 1) {cout << "hseuil=" << hseuil << endl;} if (verbosity > 1) {cout << "NbVertexRecollement " << nbe_t << " / " << "NbVertex(anc)" << Th3.nbe << endl;} Vertex3 *v = new Vertex3[nv_t]; Tet *t = new Tet[nt_t]; Triangle3 *b = new Triangle3[nbe_t]; Tet *tt = t; Triangle3 *bb = b; EF23::GTree *gtree = new EF23::GTree(v, Pinf, Psup, 0); // determination des nouveaux sommets int nbv = 0; hseuil = hmin / 10.; for (int ii = 0; ii < Th3.nv; ii++) { const Vertex3 &vi(Th3.vertices[ii]); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[nbv].x = vi.x; v[nbv].y = vi.y; v[nbv].z = vi.z; v[nbv].lab = vi.lab; gtree->Add(v[nbv++]); } } delete gtree; assert(nbv == nv_t); // determination des nouveaux tetrahedres int nbt = 0; hseuil = hmin / 10.; hseuil = hseuil / 4.; for (int ii = 0; ii < Th3.nt; ii++) { if (Elem_ok[ii] == 0) {continue;} const Tet &K(Th3.elements[ii]); int iv[4]; iv[0] = Numero_Som[Th3.operator () (K[0])]; iv[1] = Numero_Som[Th3.operator () (K[1])]; iv[2] = Numero_Som[Th3.operator () (K[2])]; iv[3] = Numero_Som[Th3.operator () (K[3])]; (tt++)->set(v, iv, K.lab); } assert(nbv == nv_t); // determination des nouveaux trianglesxs int nbbe = 0; hseuil = hmin / 10.; hseuil = hseuil / 4.; for (int ii = 0; ii < Th3.nbe; ii++) { if (Border_ok[ii] == 0) {continue;} const Triangle3 &K(Th3.be(ii)); int iv[3]; iv[0] = Numero_Som[Th3.operator () (K[0])]; iv[1] = Numero_Som[Th3.operator () (K[1])]; iv[2] = Numero_Som[Th3.operator () (K[2])]; (bb++)->set(v, iv, K.lab); } assert(nbbe == nbe_t); delete [] Numero_Som; delete [] Border_ok; delete [] Elem_ok; Mesh3 *Th3_new = new Mesh3(nv_t, nt_t, nbe_t, v, t, b); return Th3_new; } // TransfoMesh_v2.cpp // LayerMesh.cpp // remarque choix 2 est a encore a determiner double zmin_func_mesh (const int choix, const double x, const double y) { switch (choix) { case 0: return 0.; break; case 1: return 0.; break; case 2: return sqrt(pow(x, 2) + pow(y, 2)); break; default: cout << "zmin_func no defined" << endl; return 0.; } } double zmax_func_mesh (const int choix, const double x, const double y) { switch (choix) { case 0: return 1.; break; case 1: return 1.; break; case 2: return 3. + sqrt(pow(x, 2) + pow(y, 2)); break; default: cout << "zmaxfunc no defined" << endl; return 0.; } } int Ni_func_mesh (const int choix, const double x, const double y) { const int multi = 1; int res; switch (choix) { case 0: if (x == 0. && y == 0.) { res = 3; } if (x == 1. && y == 0.) { res = 5; } if (x == 0. && y == 1.) { res = 7; } if (x == 0.5 && y == 0.5) { res = 6; } return res; // return multi; break; case 1: return 2; break; case 2: return int(multi * (3 + sqrt(pow(x, 2) + pow(y, 2)))); break; default: cout << "Ni_func no defined" << endl; return 0; } } void discretisation_max_mesh (const int choix, const Mesh &Th2, int &Nmax) { int Ni; Nmax = 0; /*for(int ii=0; ii < A2D.NbSommet2D;ii++){ * Ni = Ni_func( choix, A2D.CoorSommet2D[ii][0], A2D.CoorSommet2D[ii][1]); * Nmax = max(Ni,Nmax); * } * Nmax=4;*/ for (int ii = 0; ii < Th2.nv; ii++) { const Mesh::Vertex &P = Th2.vertices[ii]; Ni = Ni_func_mesh(choix, P.x, P.y); Nmax = max(Ni, Nmax); } } void tab_zmin_zmax_Ni_mesh (const int choix, const Mesh &Th2, int &Nmax, double *tab_zmin, double *tab_zmax, int *tab_Ni) { Nmax = 0; for (int ii = 0; ii < Th2.nv; ii++) { const Mesh::Vertex &P = Th2.vertices[ii]; tab_Ni[ii] = Ni_func_mesh(choix, P.x, P.y); tab_zmin[ii] = zmin_func_mesh(choix, P.x, P.y); tab_zmax[ii] = zmax_func_mesh(choix, P.x, P.y); Nmax = max(tab_Ni[ii], Nmax); } } /* Fonction permettant de transformer maillage 2D en maillage 3D*/ void Tet_mesh3_mes_neg (Mesh3 &Th3) { int iv[4]; int lab; for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.t(ii)); lab = K.lab; iv[0] = Th3.operator () (K[0]); iv[2] = Th3.operator () (K[1]); iv[1] = Th3.operator () (K[2]); iv[3] = Th3.operator () (K[3]); R3 A(Th3.vertices[iv[0]]); R3 B(Th3.vertices[iv[1]]); R3 C(Th3.vertices[iv[2]]); R3 D(Th3.vertices[iv[3]]); double mes = det(A, B, C, D) / 6.; Th3.t(ii).set(Th3.vertices, iv, lab, mes); } } //= ======================================================================// // Rajout pour s'assurer un unique label pour les vertices //= ======================================================================// void build_layer_map_tetrahedra (const Mesh &Th2, map &maptet) { int numero_label = 0; // cout << "in: buil_layer_map_tetrahedra" << endl; for (int ii = 0; ii < Th2.nt; ii++) { // cout << "ii= " << ii << "Th2.nt=" << Th2.nt <::const_iterator imap = maptet.find(K.lab); // cout << "K.lab= " << K.lab << endl; if (imap == maptet.end()) { maptet[K.lab] = K.lab; // modif FH .. numero_label; numero_label = numero_label + 1; } } // cout << "number of tetraedra label=" << numero_label << endl; } void build_layer_map_triangle (const Mesh &Th2, map &maptrimil, map &maptrizmax, map &maptrizmin) { int numero_label = 0; // cout << "in: buil_layer_map_triangle" << endl; for (int ii = 0; ii < Th2.nt; ii++) { const Mesh::Triangle &K(Th2.t(ii)); map::const_iterator imap = maptrizmax.find(K.lab); if (imap == maptrizmax.end()) { maptrizmax[K.lab] = K.lab; // modif FH jan 2010 numero_label; numero_label = numero_label + 1; } } for (int ii = 0; ii < Th2.nt; ii++) { const Mesh::Triangle &K(Th2.t(ii)); map::const_iterator imap = maptrizmin.find(K.lab); if (imap == maptrizmin.end()) { maptrizmin[K.lab] = K.lab; // modif FH jan 2010 numero_label; numero_label = numero_label + 1; } } for (int ii = 0; ii < Th2.neb; ii++) { const Mesh::BorderElement &K(Th2.be(ii)); map::const_iterator imap = maptrimil.find(K.lab); if (imap == maptrimil.end()) { maptrimil[K.lab] = K.lab; // modif FH jan 2010 numero_label; numero_label = numero_label + 1; } } } void build_layer_map_edge (const Mesh &Th2, map &mapemil, map &mapezmax, map &mapezmin) { int numero_label = 0; for (int ii = 0; ii < Th2.neb; ii++) { const Mesh::BorderElement &K(Th2.be(ii)); map::const_iterator imap1 = mapezmax.find(K.lab); map::const_iterator imap2 = mapemil.find(K.lab); map::const_iterator imap3 = mapezmin.find(K.lab); if (imap1 == mapezmax.end()) { mapezmax[K.lab] = K.lab;// modif FH jan 2010 numero_label; numero_label = numero_label + 1; } if (imap2 == mapemil.end()) { mapemil[K.lab] = K.lab; // modif FH jan 2010 numero_label;numero_label; numero_label = numero_label + 1; } if (imap3 == mapezmin.end()) { mapezmin[K.lab] = K.lab;// modif FH jan 2010 numero_label;numero_label; numero_label = numero_label + 1; } } } Mesh3*build_layer (const Mesh &Th2, const int Nmax, const int *tab_Ni, const double *tab_zmin, const double *tab_zmax, const map &maptet, const map &maptrimil, const map &maptrizmax, const map &maptrizmin, const map &mapemil, const map &mapezmax, const map &mapezmin) { int MajSom, MajElem, MajBord2D; Mesh3 *Th3 = new Mesh3; NbSom3D_NbElem3D_NbBord2D_mesh_product_mesh_tab(Nmax, tab_Ni, Th2, MajSom, MajElem, MajBord2D); if (verbosity > 1) {cout << "MajSom = " << MajSom << " " << "MajElem = " << MajElem << " " << "MajBord2D =" << MajBord2D << endl;} if (verbosity > 1) {cout << "debut : Th3.set(MajSom, MajElem, MajBord2D); " << endl;} Th3->set(MajSom, MajElem, MajBord2D); if (verbosity > 1) {cout << "debut : Som3D_mesh_product_Version_Sommet_mesh_tab( Nmax, tab_Ni, tab_zmin, tab_zmax, Th2, Th3); " << endl;} Som3D_mesh_product_Version_Sommet_mesh_tab(Nmax, tab_Ni, tab_zmin, tab_zmax, Th2, maptet, maptrimil, maptrizmax, maptrizmin, mapemil, mapezmax, mapezmin, *Th3); // Add FH because remove in call function.. Th3->BuildBound(); Th3->BuildAdj(); Th3->Buildbnormalv(); Th3->BuildjElementConteningVertex(); return Th3; } void NbSom3D_NbElem3D_NbBord2D_mesh_product_mesh_tab (const int Nmax, const int *tab_Ni, const Mesh &Th2, int &MajSom, int &MajElem, int &MajBord2D) { int i; MajSom = 0; for (int ii = 0; ii < Th2.nv; ii++) { MajSom = MajSom + (tab_Ni[ii] + 1); assert(tab_Ni[ii] <= Nmax); } MajElem = 0; for (int ii = 0; ii < Th2.nt; ii++) { const Mesh::Triangle &K(Th2.t(ii)); for (int jj = 0; jj < 3; jj++) { // i = A2D.ElemPoint2D[ii][jj]; i = Th2.operator () (K[jj]); MajElem = MajElem + tab_Ni[i]; } } // determination of NbBord2D MajBord2D = 2 * Th2.nt; for (int ii = 0; ii < Th2.neb; ii++) { const Mesh::BorderElement &K(Th2.be(ii)); for (int jj = 0; jj < 2; jj++) { // i = A2D.ElemBord1D[ii][jj]; i = Th2.operator () (K[jj]); MajBord2D = MajBord2D + tab_Ni[i]; assert(tab_Ni[i] <= Nmax); } } // exit(1); } void Som3D_mesh_product_Version_Sommet_mesh_tab (const int Nmax, const int *tab_Ni, const double *tab_zmin, const double *tab_zmax, const Mesh &Th2, const map &maptet, const map &maptrimil, const map &maptrizmax, const map &maptrizmin, const map &mapemil, const map &mapezmax, const map &mapezmin, Mesh3 &Th3) { // intent(in) Nmax,Mesh &A2D // intent(out) Mesh3 &A3D double val_zmin, val_zmax, val_dz; int Ni; int NumSommet; int NumElement; KN tab_NumSommet(Th2.nv + 1); // variable tet int SommetPrisme[6]; // variable creer pour le bord int i_ind1, Ni_ind1; int i_ind2, Ni_ind2; int i_recoll_1pp, i_recoll_2pp; int i_recoll_1, i_recoll_2; // int pas_recoll_1, pas_recoll_2; int type_dec_border; // avec data int i_recoll_jMax, i_recoll_jMaxpp; int cas_decoupage; // , cas_data; int int_decoup[3] = {1, 2, 4}; int Ni_elem[3]; int DiagMax1, DiagMax2; // determination of maximum label for vertices NumSommet = 0; for (int ii = 0; ii < Th2.nv; ii++) { const Mesh::Vertex &P = Th2.vertices[ii]; val_zmin = tab_zmin[ii]; val_zmax = tab_zmax[ii]; Ni = tab_Ni[ii]; // val_dz = (val_zmax - val_zmin)/Ni; if (Ni == 0) { val_dz = 0.; } else { val_dz = (val_zmax - val_zmin) / Ni; // if( abs(val_dz) < 1e-9 ) Ni=0; } tab_NumSommet[ii] = NumSommet; // Numero du premier sommet 3D associé au sommet 2D ii. // cout << "ii, tab_NumSommet[ii]= "<< ii <<" "<< tab_NumSommet[ii] << endl; for (int j = 0; j <= Ni; j++) { // changer Th3.vertices[NumSommet].x = P.x; Th3.vertices[NumSommet].y = P.y; Th3.vertices[NumSommet].z = val_zmin + val_dz * j; Th3.vertices[NumSommet].lab = P.lab; // cas maillage du bas et du haut, on un nouveau label if (j == 0) {Th3.vertices[NumSommet].lab = P.lab;} if (j == Ni) {Th3.vertices[NumSommet].lab = P.lab;} NumSommet = NumSommet + 1; } } tab_NumSommet[Th2.nv] = NumSommet; assert(NumSommet == Th3.nv); /*********************************/ /* new label for edges of cube */ /*********************************/ /* * cout << " new label for edges of cubes " << endl; * for(int ii=0; ii < Th2.neb; ii++){ * const Mesh::BorderElement & K(Th2.be(ii)); * int ib[2]; * ib[0] = Th2.operator()(K[0]); * ib[1] = Th2.operator()(K[1]); * //map:: const_iterator imap; * * for(int kk=0; kk<2;kk++){ * // label zmin * map:: const_iterator imap1; * imap1=mapezmin.find( K.lab ); * * assert( imap1!=mapezmin.end() ); * Th3.vertices[ tab_NumSommet[ib[kk]] ].lab = imap1->second; * * // label zmax * map:: const_iterator imap2; * imap2=mapezmax.find( K.lab ); * assert( imap2!=mapezmax.end() ); * * Th3.vertices[ tab_NumSommet[ ib[kk] ] + tab_Ni[ib[kk]] ].lab = imap2->second; * * // label côté * map:: const_iterator imap3; * imap3=mapemil.find ( K.lab ); * assert( imap3!=mapemil.end() ); * * for(int jj=1; jj < tab_Ni[ib[kk]]; jj++){ * Th3.vertices[ tab_NumSommet[ ib[kk] ] + jj ].lab = imap3->second; * } * } * } */ //= ====================================================================== // creation des bord du maillage 3D a partir du bord 1D et du maillage 2D //= ====================================================================== if (verbosity > 1) {cout << "calcul element du bord " << endl;} // A mettre plus haut int ElemBord; ElemBord = 0; // bord définies en zmax for (int ii = 0; ii < Th2.nt; ii++) { int ijj[3]; const Mesh::Element &K(Th2.t(ii)); int lab; map::const_iterator imap = maptrizmax.find(K.lab); assert(imap != maptrizmax.end()); lab = imap->second; for (int kk = 0; kk < 3; kk++) { ijj[kk] = Th2.operator () (K[kk]); ijj[kk] = tab_NumSommet[ijj[kk] + 1] - 1; } Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ElemBord = ElemBord + 1; } // cout << "bord en zmin" << endl; for (int ii = 0; ii < Th2.nt; ii++) { int ijj[3]; // bjj[3]; const Mesh::Element &K(Th2.t(ii)); int lab; map::const_iterator imap = maptrizmin.find(K.lab); assert(imap != maptrizmin.end()); lab = imap->second; for (int kk = 0; kk < 3; kk++) { ijj[2 - kk] = Th2.operator () (K[kk]); // bjj[2-kk] = ijj[2-kk] ; ijj[2 - kk] = tab_NumSommet[ijj[2 - kk]]; } Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ElemBord = ElemBord + 1; } // cout << "bord sur le cote" << endl; for (int ii = 0; ii < Th2.neb; ii++) { // Th2.neb ?? int ijj[3]; const Mesh::BorderElement &K(Th2.be(ii)); int lab; map::const_iterator imap = maptrimil.find(K.lab); assert(imap != maptrimil.end()); lab = imap->second; int edgebid; int ffbid = Th2.BoundaryElement(ii, edgebid); // ii : number of edge => sortie :: ffbid = numero triangles, edgebid = numero edges int j0bid, j1bid; Th2.VerticesNumberOfEdge(Th2.t(ffbid), edgebid, j0bid, j1bid); // bool ffsens = Th2.SensOfEdge( Th2.t(ffbid), edgebid ); // sens du parcours de la edge correcte ou non /* * if( ffsens == true){ * i_ind1 = Th2.operator()(K[0]); * i_ind2 = Th2.operator()(K[1]); * } * else{ * i_ind1 = Th2.operator()(K[1]); * i_ind2 = Th2.operator()(K[0]); * } * * * printf("value of vertex edge (verticesNumberOfEdge) :: %d--%d \n", j0bid, j1bid ); * printf("value of vertex edge ( Th2.operator() ) :: %d--%d \n", Th2.operator()(K[0]), Th2.operator()(K[1]) ); * printf("value of vertex edge ( bool sens ) :: %d--%d \n", i_ind1, i_ind2 ); */ i_ind1 = j0bid; i_ind2 = j1bid; Ni_ind1 = tab_Ni[i_ind1]; Ni_ind2 = tab_Ni[i_ind2]; assert(Ni_ind1 <= Nmax); assert(Ni_ind2 <= Nmax); for (int jNmax = Nmax - 1; jNmax >= 0; jNmax--) { /* * i_recoll_1pp = int((jNmax+1)*Ni_ind1/Nmax); * i_recoll_2pp = int((jNmax+1)*Ni_ind2/Nmax); * * i_recoll_1 = int(jNmax*Ni_ind1/Nmax); * i_recoll_2 = int(jNmax*Ni_ind2/Nmax); */ i_recoll_1 = int((jNmax + 1) * Ni_ind1 / Nmax); i_recoll_2 = int((jNmax + 1) * Ni_ind2 / Nmax); i_recoll_1pp = int(jNmax * Ni_ind1 / Nmax); i_recoll_2pp = int(jNmax * Ni_ind2 / Nmax); // if( (i_ind1== 11 || i_ind1== 0) && (i_ind2==11 || i_ind2==0) ) { // printf("i_recoll1 %d, i_recoll2 %d\n", i_recoll_1, i_recoll_2); // printf("i_recoll1pp %d, i_recoll2pp %d\n", i_recoll_1pp, i_recoll_2pp); // } /* * * 1 === 2 * | | | | | | 1pp === 2pp | | sens 2D : 1pp => 2pp et 1 => 2 | | type_dec_border = 0 tous les points sont confondus | type_dec_border = 1 les points 1pp et 1 sont differents | type_dec_border = 2 les points 2pp et 2 sont differents | type_dec_border = 3 les points 1pp et 1 et les points 2pp et 2 sont differents | | rappel : 1pp(0) 2pp(1) 2(2) 1(3) | data_dec_border 1 : {3 1 0} | data_dec_border 2 : {2 1 0} | data_dec_border 3 : type1 : { {2 1 0}{0 3 2} } | : type2 : { {3 1 0}{1 3 2} } */ type_dec_border = 0; if (i_recoll_1pp != i_recoll_1) { type_dec_border = type_dec_border + 1; } if (i_recoll_2pp != i_recoll_2) { type_dec_border = type_dec_border + 2; } // if( (i_ind1== 11 || i_ind1== 0) && (i_ind2==11 || i_ind2==0) ) // cout << "type decoupage bord= " << type_dec_border < 0,1,2 ijj[0] = tab_NumSommet[i_ind1] + i_recoll_1pp; ijj[1] = tab_NumSommet[i_ind2] + i_recoll_2pp; ijj[2] = tab_NumSommet[i_ind1] + i_recoll_1; Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ElemBord = ElemBord + 1; break; case 2: // 1pp = 1 // avant 2,1,0 --> 0,1,2 ijj[0] = tab_NumSommet[i_ind1] + i_recoll_1pp; ijj[1] = tab_NumSommet[i_ind2] + i_recoll_2pp; ijj[2] = tab_NumSommet[i_ind2] + i_recoll_2; Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ElemBord = ElemBord + 1; break; case 3: int idl; // determination de la diagonale Max DiagMax1 = max(tab_NumSommet[i_ind1] + i_recoll_1pp, tab_NumSommet[i_ind2] + i_recoll_2); DiagMax2 = max(tab_NumSommet[i_ind2] + i_recoll_2pp, tab_NumSommet[i_ind1] + i_recoll_1); if (DiagMax1 > DiagMax2) { idl = 1; ijj[0] = tab_NumSommet[i_ind1] + i_recoll_1pp; ijj[1] = tab_NumSommet[i_ind2] + i_recoll_2pp; ijj[2] = tab_NumSommet[i_ind2] + i_recoll_2; Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ijj[0] = tab_NumSommet[i_ind2] + i_recoll_2; ijj[1] = tab_NumSommet[i_ind1] + i_recoll_1; ijj[2] = tab_NumSommet[i_ind1] + i_recoll_1pp; Th3.be(ElemBord + 1).set(Th3.vertices, ijj, lab); } else { idl = 2; ijj[0] = tab_NumSommet[i_ind1] + i_recoll_1pp; ijj[1] = tab_NumSommet[i_ind2] + i_recoll_2pp; ijj[2] = tab_NumSommet[i_ind1] + i_recoll_1; Th3.be(ElemBord).set(Th3.vertices, ijj, lab); ijj[0] = tab_NumSommet[i_ind2] + i_recoll_2; ijj[1] = tab_NumSommet[i_ind1] + i_recoll_1; ijj[2] = tab_NumSommet[i_ind2] + i_recoll_2pp; Th3.be(ElemBord + 1).set(Th3.vertices, ijj, lab); } // cout << "idl=" << idl << endl; ElemBord = ElemBord + 2; break; default: break; } } } assert(ElemBord == Th3.nbe); //= ======================================== // Creation + determination tetraedre if (verbosity > 1) {cout << "calcul element tetraedre " << endl;} NumElement = 0; for (int ii = 0; ii < Th2.nt; ii++) { /* * nouvelle numerotation : * ----------------------- * Valeur de cas_deoupage * ----------------------- * 1 : sommet 0 et 3 differents * 2 : sommet 1 et 4 differents * 4 : sommet 2 et 5 differents * ============================ * 3 : sommet 0 et 3 differents + sommet 1 et 4 differents * 5 : sommet 0 et 3 differents + sommet 2 et 5 differents * 6 : sommet 1 et 4 differents + sommet 2 et 5 differents * ============================ * 7 : aucun sommets confondus * * data_tetraedre * ============== * 1: 0++,1++,2++,SomDiff : {0 1 2 3} :: data 1 * 2: 0++,1++,2++,SomDiff : {0 1 2 4} :: data 2 * 4: 0++,1++,2++,SomDiff : {0 1 2 5} :: data 3 * ============== * = deux cas possible depend du sommet le plus grand : Sommet le plus grand est un ++ * = 0++,1++,2++,SomDiffMin || SomDiffMax++, j_SomDiff_py[j_SomEgal][0], j_SomDiff_py[j_SomEgal][1], Som_Egal * 3:a: SommetMax diag 04 {0,1,2,4} {5,4,3,0} :: data 4 * 3:b: SommetMax diag 13 {0,1,2,3} {5,4,3,1} :: data 5 * ============================================= * 5:a: SommetMax diag 05 {0,1,2,5} {5,4,3,0} :: data 6 * 5:b: SommetMax diag 23 {0,1,2,3} {5,4,3,2} :: data 7 * ============================================= * 6:a: SommetMax diag 15 {0,1,2,5} {5,4,3,1} :: data 8 * 6:b: SommetMax diag 24 {0,1,2,4} {5,4,3,2} :: data 9 * ============================================= * 7: aller chercher dans la fonction :: data 10 a data * == voir hecht routine * */ const Mesh::Element &K(Th2.t(ii)); int somv[4]; int K_jj[3]; int lab; map::const_iterator imap = maptet.find(K.lab); assert(imap != maptet.end()); lab = imap->second; // valeur de Nombre de points for (int jj = 0; jj < 3; jj++) { K_jj[jj] = Th2.operator () (K[jj]); Ni_elem[jj] = tab_Ni[K_jj[jj]]; } for (int jNmax = Nmax - 1; jNmax >= 0; jNmax--) { // determination des sommets + cas decoupage cas_decoupage = 0; for (int jj = 0; jj < 3; jj++) { i_recoll_jMax = int((jNmax) * Ni_elem[jj] / Nmax); i_recoll_jMaxpp = int((jNmax + 1) * Ni_elem[jj] / Nmax); SommetPrisme[jj + 3] = tab_NumSommet[K_jj[jj]] + i_recoll_jMaxpp; SommetPrisme[jj] = tab_NumSommet[K_jj[jj]] + i_recoll_jMax; assert(SommetPrisme[jj] <= Th3.nv); assert(SommetPrisme[jj + 3] <= Th3.nv); if (i_recoll_jMax != i_recoll_jMaxpp) {cas_decoupage = cas_decoupage + int_decoup[jj];} } // cout << "cas du decoupage= " << cas_decoupage << endl; switch (cas_decoupage) { case 0: // les points sont tous confondus pas d ajout element : rien a faire break; /* * CAS CREATION D UN TETRAEDRE : cas decoupage 1 2 4 * */ case 1: // On a un tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[3]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); NumElement = NumElement + 1; break; case 2: // On a un tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[4]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); NumElement = NumElement + 1; break; case 4: // On a un tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[5]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); NumElement = NumElement + 1; break; /* * On a une pyramide a base rectangle: decoupe deux tetraedres * cas decoupage 3 5 6 */ case 3: // determination de la diagonale dominante DiagMax1 = max(SommetPrisme[0], SommetPrisme[4]); DiagMax2 = max(SommetPrisme[1], SommetPrisme[3]); // cout << "DiagMax1=" << DiagMax1 << " "<< SommetPrisme[0]<<" " < DiagMax2) { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[4]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[0]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } else { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[3]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[1]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } NumElement = NumElement + 2; break; case 5: // determination de la diagonale dominante DiagMax1 = max(SommetPrisme[0], SommetPrisme[5]); DiagMax2 = max(SommetPrisme[2], SommetPrisme[3]); // cout << "DiagMax1=" << DiagMax1 << " "<< SommetPrisme[0]<<" " < DiagMax2) { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[5]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[0]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } else { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[3]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[2]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } NumElement = NumElement + 2; break; case 6: // determination de la diagonale dominante DiagMax1 = max(SommetPrisme[1], SommetPrisme[5]); DiagMax2 = max(SommetPrisme[2], SommetPrisme[4]); // cout << "DiagMax1=" << DiagMax1 << " "<< SommetPrisme[1]<<" " < DiagMax2) { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[5]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[1]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } else { // ------------------ // premier tetraedre somv[0] = SommetPrisme[0]; somv[1] = SommetPrisme[1]; somv[2] = SommetPrisme[2]; somv[3] = SommetPrisme[4]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[5]; somv[1] = SommetPrisme[4]; somv[2] = SommetPrisme[3]; somv[3] = SommetPrisme[2]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); } NumElement = NumElement + 2; break; case 7: // on a un prisme int nbe; int option = 1; int idl[3]; int nu[12]; DiagMax1 = max(SommetPrisme[0], SommetPrisme[5]); DiagMax2 = max(SommetPrisme[2], SommetPrisme[3]); // determination de idl // idl[0] : choix sommet 0 ou 2 (dpent1 equivalent 1 ou 3) if (DiagMax1 > DiagMax2) { idl[0] = 1; } else { idl[0] = 2; } DiagMax1 = max(SommetPrisme[0], SommetPrisme[4]); DiagMax2 = max(SommetPrisme[1], SommetPrisme[3]); // idl[1] : choix sommet 0 ou 1 (dpent1 equivalent 1 ou 2) if (DiagMax1 > DiagMax2) { idl[1] = 1; } else { idl[1] = 2; } DiagMax1 = max(SommetPrisme[1], SommetPrisme[5]); DiagMax2 = max(SommetPrisme[2], SommetPrisme[4]); // idl[2] : choix sommet 1 ou 2 (dpent1 equivalent 2 ou 3) if (DiagMax1 > DiagMax2) { idl[2] = 1; } else { idl[2] = 2; } // cout << "idl[0] << << idl[1] << << idl[2]" << endl; // cout << idl[0] << " " << idl[1] << " "<< idl[2] << endl; nbe = 0; dpent1_mesh(idl, nu, nbe, option); if (nbe != 3) { cout << nbe << endl; cerr << "probleme dans dpent1_mesh" << endl; } ; // ------------------ // premier tetraedre somv[0] = SommetPrisme[nu[0]]; somv[1] = SommetPrisme[nu[1]]; somv[2] = SommetPrisme[nu[2]]; somv[3] = SommetPrisme[nu[3]]; Th3.elements[NumElement].set(Th3.vertices, somv, lab); // deuxieme tetraedre somv[0] = SommetPrisme[nu[4]]; somv[1] = SommetPrisme[nu[5]]; somv[2] = SommetPrisme[nu[6]]; somv[3] = SommetPrisme[nu[7]]; Th3.elements[NumElement + 1].set(Th3.vertices, somv, lab); // troisieme tetraedre somv[0] = SommetPrisme[nu[8]]; somv[1] = SommetPrisme[nu[9]]; somv[2] = SommetPrisme[nu[10]]; somv[3] = SommetPrisme[nu[11]]; Th3.elements[NumElement + 2].set(Th3.vertices, somv, lab); NumElement = NumElement + 3; break; } } // Au final : les sommers des tetraedres et la conectivité des tetraedres finaux assert(NumElement <= Th3.nt); } } void dpent1_mesh (int idl[3], int nu[12], int &nbe, int &option) { // intent(inout) :: idl // intent(out) :: nu,nbe,option // option ne sert à rien // * version simplifie pour le mailleur par couche 2D 3D // ----------------------------------------------------------------------- // subroutine dpent1 (idl,nu,nbe,option) // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // s.p. dpent1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // but : decoupe un pentaedre en 3 tetreadres suivant la decoupe des 3 // --- faces frontieres a 4 cotes // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // parametres en entre : // idl : parametre de decoupe de face calculer comme ceci : // si idl(i) = 0 alors la face n'est pas decoupee // idl(1)= 1 si la face 1463 est decoupe par l'arete 16 ,sinon 2 // idl(2)= 1 si la face 1254 est decoupe par l'arete 15 ,sinon 2 // idl(3)= 1 si la face 2365 est decoupe par l'arete 26 ,sinon 2 // id = i1 + i2 * 2 + i3 * 4 // parametres en sortie : // nbe : nbe de tetraedre de la decoupe // nbe = 0 => decoup impossible // nbe = 3 => decoup possible le tableau nu est genere // nu(1:4,1:nbe) : tableau de numero des sommet 3 tetraedres dans le // pentaedre // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // programmation : f77 ->c++ subroutine de f. hecht upmc int idp[8]; int i1, i2, i3, i, nbdp, idf, idecou; const int pdd[8] = {1, 0, 2, 3, 4, 5, 0, 6}; int mu[6][12]; const int mu0[12] = {1, 6, 2, 3, 1, 5, 2, 6, 1, 6, 4, 5}; const int mu1[12] = {1, 6, 2, 3, 1, 4, 2, 6, 2, 6, 4, 5}; const int mu2[12] = {1, 4, 2, 3, 2, 6, 3, 4, 2, 6, 4, 5}; const int mu3[12] = {1, 5, 2, 3, 1, 5, 3, 6, 1, 6, 4, 5}; const int mu4[12] = {1, 5, 2, 3, 1, 5, 3, 4, 3, 6, 4, 5}; const int mu5[12] = {1, 4, 2, 3, 2, 5, 3, 4, 3, 6, 4, 5}; for (int jj = 0; jj < 12; jj++) { mu[0][jj] = mu0[jj]; mu[1][jj] = mu1[jj]; mu[2][jj] = mu2[jj]; mu[3][jj] = mu3[jj]; mu[4][jj] = mu4[jj]; mu[5][jj] = mu5[jj]; } // calcul des descoupes possible du pentaedre idf = -1; nbdp = 0; for (i3 = 1; i3 <= 2; i3++) { for (i2 = 1; i2 <= 2; i2++) { for (i1 = 1; i1 <= 2; i1++) { idf = idf + 1; if ((pdd[idf] != 0) && (idl[0] == 0 || idl[0] == i1) && (idl[1] == 0 || idl[1] == i2) && (idl[2] == 0 || idl[2] == i3)) { // nbdp=nbdp+1; idp[nbdp] = idf; nbdp = nbdp + 1; } } } } if (nbdp == 0) { nbe = 0; } else { nbe = 3; idf = idp[0]; idecou = pdd[idf]; /* i=idf; * j=i/4; * i=i-4*j; * idl[2]=j+1; * j=i/2; * idl[1]=j+1; * idl[0]=i-2*j+1; * //cout << "idecou= " << idecou << endl;*/ for (i = 0; i < 12; i++) { nu[i] = mu[idecou - 1][i] - 1; // cout << "i, nu[i] "<< i <<" " << nu[i] << endl; } } } // ----------------------------------------------------------------------- // glumesh3D class listMesh3 { public: list *lth; void init () {lth = new list;} void destroy () {delete lth;} listMesh3 (Stack s, const Mesh3 *th): lth(Add2StackOfPtr2Free(s, new list )) {lth->push_back(th);} listMesh3 (Stack s, const Mesh3 *tha, const Mesh3 *thb): lth(Add2StackOfPtr2Free(s, new list )) {lth->push_back(tha); lth->push_back(thb);} listMesh3 (Stack s, const listMesh3 &l, const Mesh3 *th): lth(Add2StackOfPtr2Free(s, new list(*l.lth))) {lth->push_back(th);} }; Mesh3*GluMesh3 (listMesh3 const &lst) { int flagsurfaceall = 0; int nbt = 0; int nbe = 0; int nbex = 0; int nbv = 0; int nbvx = 0; double hmin = 1e100; R3 Pn(1e100, 1e100, 1e100), Px(-1e100, -1e100, -1e100); const list lth(*lst.lth); const Mesh3 *th0 = 0; int kk = 0; for (list::const_iterator i = lth.begin(); i != lth.end(); i++) { if (!*i) {continue;} kk++; const Mesh3 &Th3(**i); // definis ??? th0 = &Th3; if (verbosity > 1) {cout << " determination of hmin : GluMesh3D + " << Th3.nv << " " << Th3.nt << " " << Th3.nbe << endl;} nbt += Th3.nt; nbvx += Th3.nv; nbex += Th3.nbe; for (int k = 0; k < Th3.nt; k++) { for (int e = 0; e < 6; e++) { hmin = min(hmin, Th3[k].lenEdge(e));// calcul de .lenEdge pour un Mesh3 } } for (int k = 0; k < Th3.nbe; k++) { for (int e = 0; e < 3; e++) { hmin = min(hmin, Th3.be(k).lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } for (int ii = 0; ii < Th3.nv; ii++) { R3 P(Th3.vertices[ii].x, Th3.vertices[ii].y, Th3.vertices[ii].z); Pn = Minc(P, Pn); Px = Maxc(P, Px); } } if (kk == 0) { return 0; // no mesh .... } if (verbosity > 1) {cout << " - hmin =" << hmin << " , Bounding Box: " << Pn << " " << Px << endl;} // probleme memoire Vertex3 *v = new Vertex3[nbvx]; Tet *t; if (nbt != 0) {t = new Tet[nbt];} Tet *tt = t; Triangle3 *b = new Triangle3[nbex]; Triangle3 *bb = b; ffassert(hmin > Norme2(Pn - Px) / 1e9); double hseuil = hmin / 10.; // int *NumSom= new int[nbvx]; // VERSION morice if (verbosity > 1) {cout << " creation of : BuildGTree" << endl;} EF23::GTree *gtree = new EF23::GTree(v, Pn, Px, 0); nbv = 0; // int nbv0=0; for (list::const_iterator i = lth.begin(); i != lth.end(); i++) { if (!*i) {continue;} const Mesh3 &Th3(**i); if (verbosity > 1) {cout << " loop over mesh for create new mesh " << endl;} if (verbosity > 1) {cout << " GluMesh3D + " << Th3.nv << " " << Th3.nt << " " << Th3.nbe << endl;} // nbv0 =+Th3.nv; for (int ii = 0; ii < Th3.nv; ii++) { const Vertex3 &vi(Th3.vertices[ii]); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[nbv].x = vi.x; v[nbv].y = vi.y; v[nbv].z = vi.z; v[nbv].lab = vi.lab; // NumSom[ii+nbv0] = nbv; gtree->Add(v[nbv]); nbv++; } /* * else{ * NumSom[ii+nbv0] = pvi-v; * assert(pvi-v ToClose(K[0], hseuil) - v; iv[1] = gtree->ToClose(K[1], hseuil) - v; iv[2] = gtree->ToClose(K[2], hseuil) - v; iv[3] = gtree->ToClose(K[3], hseuil) - v; (tt++)->set(v, iv, K.lab); } // nbv0 =+Th3.nv; } if (verbosity > 1) {cout << " creation of : BuildGTree for border elements" << endl;} Vertex3 *becog = new Vertex3[nbex]; // Vertex3 becog[nbex]; EF23::GTree *gtree_be = new EF23::GTree(becog, Pn, Px, 0); double hseuil_border = hseuil / 3.; // nbv0=0; for (list::const_iterator i = lth.begin(); i != lth.end(); i++) { if (!*i) {continue;} const Mesh3 &Th3(**i); for (int k = 0; k < Th3.nbe; k++) { const Triangle3 &K(Th3.be(k)); int iv[3]; iv[0] = Th3.operator () (K[0]); iv[1] = Th3.operator () (K[1]); iv[2] = Th3.operator () (K[2]); R cdgx, cdgy, cdgz; cdgx = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x) / 3.; cdgy = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y) / 3.; cdgz = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z) / 3.; const R3 r3vi(cdgx, cdgy, cdgz); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_be->ToClose(vi, hseuil_border); if (!pvi) { becog[nbe].x = vi.x; becog[nbe].y = vi.y; becog[nbe].z = vi.z; becog[nbe].lab = vi.lab; gtree_be->Add(becog[nbe++]); int igluv[3]; igluv[0] = gtree->ToClose(K[0], hseuil) - v;// NumSom[iv[0]+nbv0]; igluv[1] = gtree->ToClose(K[1], hseuil) - v;// NumSom[iv[1]+nbv0]; igluv[2] = gtree->ToClose(K[2], hseuil) - v;// NumSom[iv[2]+nbv0]; (bb++)->set(v, igluv, K.lab); } } // nbv0 =+Th3.nv; } delete gtree; delete gtree_be; delete [] becog; if (verbosity > 2) {cout << " nbv=" << nbv << endl;} if (verbosity > 2) {cout << " nbvx=" << nbvx << endl;} if (verbosity > 2) {cout << " nbt=" << nbt << endl;} if (verbosity > 2) {cout << " nbe=" << nbe << endl;} if (verbosity > 2) {cout << " nbex=" << nbex << endl;} if (verbosity > 1) { cout << " Nb of glu3D point " << nbvx - nbv; cout << " Nb of glu3D Boundary faces " << nbex - nbe << endl; } if (nbt == 0) { Mesh3 *mpq = new Mesh3(nbv, nbe, v, b); if (flagsurfaceall == 1) {mpq->BuildBoundaryElementAdj();} return mpq; } else { Mesh3 *mpq = new Mesh3(nbv, nbt, nbe, v, t, b); /* * mpq->BuildBound(); * if(verbosity > 1) cout << "fin de BuildBound" << endl; * mpq->BuildAdj(); * if(verbosity > 1) cout << "fin de BuildAdj" << endl; * mpq->Buildbnormalv(); * if(verbosity > 1) cout << "fin de Buildnormalv()" << endl; * mpq->BuildjElementConteningVertex(); * if(verbosity > 1) cout << "fin de ConteningVertex()" << endl; */ mpq->BuildGTree(); if (verbosity > 2) {cout << "fin de BuildGTree()" << endl;} // Add2StackOfPtr2FreeRC(stack,mpq); return mpq; } } template struct Op3_addmesh: public binary_function { static RR f (Stack s, const AA &a, const BB &b) {return RR(s, a, b);} }; template struct Op3_setmesh: public binary_function { static RR f (Stack stack, const AA &a, const BB &b) { ffassert(a); const pmesh3 p = GluMesh3(b); if (!INIT && *a) { // Add2StackOfPtr2FreeRC(stack,*a); (**a).destroy(); cout << "destruction du pointeur" << endl; } // Add2StackOfPtr2FreeRC(stack,p); // the pointer is use to set variable so no remove. *a = p; return a; } }; // Movemesh3D class Movemesh3D_Op: public E_F0mps { public: Expression eTh; Expression xx, yy, zz; // Expression lab,reg; static const int n_name_param = 7 + 2; // add FH for cleanning name // "+1" add to reorient tetrahedrons static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, int ii, Stack stack, KN_ a) const { ffassert(!(nargs[i] && nargs[ii])); i = nargs[i] ? i : ii; return nargs[i] ? GetAny >((*nargs[i])(stack)) : a; } double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: /* Movemesh3D_Op(const basicAC_F0 & args,Expression tth) * : eTh(tth), xx(0) , yy(0) , zz(0) * { * args.SetNameParam(n_name_param,name_param,nargs); * const E_Array * a1=0 ; * if(nargs[0]) a1 = dynamic_cast(nargs[0]); * int err =0; * if( nargs[1] && nargs[7] ) * CompileError("uncompatible movemesh3 (Th, region= , reftet= "); * if( nargs[2] && nargs[8] ) * CompileError("uncompatible movemesh3 (Th, label= , refface= "); * * if(a1) { * if(a1->size() !=3) * CompileError("movemesh3 (Th,transfo=[X,Y,Z],) "); * xx=to( (*a1)[0]); * yy=to( (*a1)[1]); * zz=to( (*a1)[2]); * } * }*/ Movemesh3D_Op (const basicAC_F0 &args, Expression tth, Expression xxx = 0, Expression yyy = 0, Expression zzz = 0) : eTh(tth), xx(xxx), yy(yyy), zz(zzz) { args.SetNameParam(n_name_param, name_param, nargs); const E_Array *a1 = 0; if (nargs[0]) {a1 = dynamic_cast(nargs[0]);} int err = 0; if (nargs[1] && nargs[7]) { CompileError("uncompatible movemesh3 (Th, region= , reftet= "); } if (nargs[2] && nargs[8]) { CompileError("uncompatible movemesh3 (Th, label= , refface= "); } if (a1) { if (a1->size() != 3 || xx || yy || zz) { CompileError("movemesh3 (Th,transfo=[X,Y,Z],) "); } xx = to((*a1)[0]); yy = to((*a1)[1]); zz = to((*a1)[2]); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Movemesh3D_Op::name_param [] = { {"transfo", &typeid(E_Array)}, // 0 {"reftet", &typeid(KN_)}, // 1 {"refface", &typeid(KN_)}, {"ptmerge", &typeid(double)}, {"facemerge", &typeid(long)}, {"boolsurface", &typeid(long)}, // 5 {"orientation", &typeid(long)}, {"region", &typeid(KN_)}, // 7 {"label", &typeid(KN_)} // 8 // option a rajouter // facemerge 0,1 + label }; AnyType Movemesh3D_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); ffassert(pTh); Mesh3 &Th = *pTh; Mesh3 *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere if (verbosity > 5) {cout << "before movemesh: Vertex " << nbv << " Tetrahedra " << nbt << " triangles " << nbe << endl;} // lecture des references KN zzempty; KN nrtet(arg(1, 7, stack, zzempty)); KN nrf(arg(2, 8, stack, zzempty)); double precis_mesh(arg(3, stack, 1e-7)); long mergefacemesh(arg(4, stack, 1L)); long flagsurfaceall(arg(5, stack, 0L)); long orientationelement(arg(6, stack, 1L)); // if( nrtet.N() && nrfmid.N() && nrfup.N() && nrfdown.N() ) return m; ffassert(nrtet.N() % 2 == 0); ffassert(nrf.N() % 2 == 0); map mapface; for (int i = 0; i < nrf.N(); i += 2) { if (nrf[i] != nrf[i + 1]) { mapface[nrf[i]] = nrf[i + 1]; } } map maptet; for (int i = 0; i < nrtet.N(); i += 2) { if (nrtet[i] != nrtet[i + 1]) { maptet[nrtet[i]] = nrtet[i + 1]; } } // realisation de la map par default assert((xx) && (yy) && (zz)); KN txx(Th.nv), tyy(Th.nv), tzz(Th.nv); Mesh3 &rTh3 = Th; KN takemesh(Th.nv); MeshPoint *mp3(MeshPointStack(stack)); takemesh = 0; // loop over tetrahedral for (int it = 0; it < Th.nt; ++it) { for (int iv = 0; iv < 4; ++iv) { int i = Th(it, iv); if (takemesh[i] == 0) { mp3->setP(&Th, it, iv); if (xx) {txx[i] = GetAny((*xx)(stack));} else {txx[i] = mp3->P.x;} if (yy) {tyy[i] = GetAny((*yy)(stack));} else {tyy[i] = mp3->P.y;} if (zz) {tzz[i] = GetAny((*zz)(stack));} else {tzz[i] = mp3->P.z;} takemesh[i] = takemesh[i] + 1; } } } // loop over border elements // loop over tetrahedral for (int it = 0; it < Th.nbe; ++it) { const Triangle3 &K(Th.be(it)); int iv[3]; iv[0] = Th.operator () (K[0]); iv[1] = Th.operator () (K[1]); iv[2] = Th.operator () (K[2]); R coordx, coordy, coordz; for (int jj = 0; jj < 3; jj++) { int i = iv[jj]; if (takemesh[i] == 0) { mp3->set(Th.vertices[i].x, Th.vertices[i].y, Th.vertices[i].z); if (xx) {txx[i] = GetAny((*xx)(stack));} if (yy) {tyy[i] = GetAny((*yy)(stack));} if (zz) {tzz[i] = GetAny((*zz)(stack));} takemesh[i] = takemesh[i] + 1; } } } // option (Transfo_Mesh3) :: // border_only = 0, recollement_border=1, point_confondus_ok=0; == > 1900 triangles // border_only = 0, recollement_border=0, point_confondus_ok=0; == > 1980 triangles // border_only = 0, recollement_border=1, point_confondus_ok=1; == > 1820 triangles // border_only = 1, recollement_border=1, point_confondus_ok=0; == > 1900 triangles // border_only = 1, recollement_border=0, point_confondus_ok=0; == > 1980 triangles // border_only = 1, recollement_border=1, point_confondus_ok=1; == > 1820 triangles int border_only = 0;// ne sert a rien !!!!! A enlever int recollement_elem = 0; int recollement_border, point_confondus_ok; if (mergefacemesh == 0) { recollement_border = 0; point_confondus_ok = 0; } if (mergefacemesh == 1) { recollement_border = 1; point_confondus_ok = 0; } if (mergefacemesh == 2) { recollement_border = 1; point_confondus_ok = 1; } Mesh3 *T_Th3 = Transfo_Mesh3(precis_mesh, rTh3, txx, tyy, tzz, border_only, recollement_elem, recollement_border, point_confondus_ok, orientationelement); if ((T_Th3->mes) <= 0 && (T_Th3->nt > 0)) { cerr << " Erreur bad orientation in movemesh add parmetre orientation=,1 mesure=" << T_Th3->mes << endl; ExecError(" movemesh(3d): mesh with neg vol"); } if (nrtet.N() > 0) { for (int i = 0; i < nbt; i++) { const Tet &K(T_Th3->elements[i]); int lab = K.lab; T_Th3->elements[i].lab = ChangeLab3D(maptet, lab); } } // les arete frontieres qui n'ont pas change if (nrf.N() > 0) { for (int i = 0; i < nbe; i++) { const Triangle3 &K(T_Th3->be(i)); int l0, l1 = ChangeLab3D(mapface, l0 = K.lab); T_Th3->be(i).lab = l1; } } if (flagsurfaceall == 1) {T_Th3->BuildBoundaryElementAdj();} T_Th3->BuildGTree(); Add2StackOfPtr2FreeRC(stack, T_Th3); *mp = mps; return T_Th3; } class Movemesh3D: public OneOperator { public: int cas; Movemesh3D (): OneOperator(atype(), atype()), cas(0) {} Movemesh3D (int): OneOperator(atype(), atype(), atype()), cas(1) {} E_F0*code (const basicAC_F0 &args) const { if (cas == 0) { return new Movemesh3D_Op(args, t[0]->CastTo(args[0])); } else if (cas == 1) { const E_Array *a = dynamic_cast(args[1].LeftValue()); ffassert(a); if (a->size() != 3) {CompileError("movemesh(Th,[X,Y,Z],...) need 3 componates in array ", atype());} Expression X = to((*a)[0]); Expression Y = to((*a)[1]); Expression Z = to((*a)[2]); return new Movemesh3D_Op(args, t[0]->CastTo(args[0]), X, Y, Z); } else {return 0;} } }; //// version 3D de change label class SetMesh3D_Op: public E_F0mps { public: Expression a; static const int n_name_param = 2 + 2 + 2 + 2; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const { ffassert(!(nargs[i] && nargs[i + 2])); i = nargs[i] ? i : i + 2; return nargs[i] ? GetAny >((*nargs[i])(stack)) : a; } long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} bool arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: SetMesh3D_Op (const basicAC_F0 &args, Expression aa): a(aa) { args.SetNameParam(n_name_param, name_param, nargs); if (nargs[0] && nargs[2]) { CompileError("uncompatible change(... region= , reftet= "); } if (nargs[1] && nargs[3]) { CompileError("uncompatible change(...label= , refface= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type SetMesh3D_Op::name_param [] = { {"reftet", &typeid(KN_)}, {"refface", &typeid(KN_)}, {"region", &typeid(KN_)}, {"label", &typeid(KN_)}, {"fregion", &typeid(long)}, {"flabel", &typeid(long)}, {"rmlfaces", &typeid(long)}, {"rmInternalFaces", &typeid(bool)} }; // besoin en cas de fichier 2D / fichier 3D int ChangeLab3D (const map &m, int lab) { map::const_iterator i = m.find(lab); if (i != m.end()) { lab = i->second; } return lab; } AnyType SetMesh3D_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*a)(stack)); Mesh3 &Th = *pTh; if (!pTh) {return pTh;} Mesh3 *m = pTh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere // cout << "Number of Vertex="<< nbv << "Number of BorderElement=" << nbe << endl; KN zz; KN nrtet(arg(0, stack, zz)); KN nrface(arg(1, stack, zz)); Expression freg = nargs[4]; Expression flab = nargs[5]; bool rm_faces = nargs[6]; long rmlabfaces(arg(6, stack, 0L)); bool rm_i_faces(arg(7, stack, false)); // cout << " Chnage " << freg << " " << flab << endl; if (nrface.N() <= 0 && nrtet.N() <= 0 && (!freg) && (!flab) && !rmlabfaces && !rm_i_faces) { return m; // modf J.M. oct 2010 } ffassert(nrtet.N() % 2 == 0); ffassert(nrface.N() % 2 == 0); map maptet, mapface; int z00 = false; for (int i = 0; i < nrface.N(); i += 2) { z00 = z00 || (nrface[i] == 0 && nrface[i + 1] == 0); if (nrface[i] != nrface[i + 1]) { mapface[nrface[i]] = nrface[i + 1]; } } for (int i = 0; i < nrtet.N(); i += 2) { maptet[nrtet[i]] = nrtet[i + 1]; } // sert a quoi ??? int nben = 0; for (int i = 0; i < nbe; ++i) { const Triangle3 &K = Th.be(i); int l0, l1 = ChangeLab3D(mapface, l0 = K.lab); nben++; } Vertex3 *v = new Vertex3[nbv]; Tet *t; if (nbt != 0) {t = new Tet[nbt];} Triangle3 *b = new Triangle3[nben]; // generation des nouveaux sommets Vertex3 *vv = v; // copie des anciens sommets (remarque il n'y a pas operateur de copy des sommets) for (int i = 0; i < nbv; i++) { const Vertex3 &V(Th.vertices[i]); vv->x = V.x; vv->y = V.y; vv->z = V.z; vv->lab = V.lab; vv++; } // generation des triangles Tet *tt = t; int lmn = 2000000000; int lmx = -2000000000; int nberr = 0; R3 PtHat(1. / 4., 1. / 4., 1. / 4.); for (int i = 0; i < nbt; i++) { const Tet &K(Th.elements[i]); int iv[4]; // int i0=Th(i,0), i1=Th(i,1),i2=Th(i,2); iv[0] = Th.operator () (K[0]); iv[1] = Th.operator () (K[1]); iv[2] = Th.operator () (K[2]); iv[3] = Th.operator () (K[3]); // les 3 triangles par triangles origines int lab = K.lab; tt->set(v, iv, ChangeLab3D(maptet, lab)); if (freg) { // R3 B(1./4.,1./4.,1./4.); // 27/09/10 : J.Morice error in msh3.cpp mp->set(Th, K(PtHat), PtHat, K, 0); tt->lab = GetAny((*freg)(stack)); lmn = min(lmn, tt->lab); lmx = max(lmx, tt->lab); } tt++; } if (freg && verbosity > 1) {cout << " -- Change : new region number bound : " << lmn << " " << lmx << endl;} // les arete frontieres qui n'ont pas change lmn = 2000000000; lmx = -2000000000; Triangle3 *bb = b; R2 PtHat2(1. / 3., 1. / 3.); int nrmf = 0; for (int i = 0; i < nbe; i++) { const Triangle3 &K(Th.be(i)); int fk, ke = Th.BoundaryElement(i, fk); // element co int fkk, kke = Th.ElementAdj(ke, fkk = fk); // element co bool onborder = (kke == ke) || (kke < 0); const Tet &KE(Th[ke]); R3 B = KE.PBord(fk, PtHat2); int iv[3]; bool rmf = rm_i_faces && !onborder; iv[0] = Th.operator () (K[0]); iv[1] = Th.operator () (K[1]); iv[2] = Th.operator () (K[2]); int l0, l1 = ChangeLab3D(mapface, l0 = K.lab); if (flab) { // R3 B(1./4.,1./4.,1./4.); // 27/09/10 : J.Morice error in msh3.cpp R3 NN = KE.N(fk); double mes = NN.norme(); NN /= mes; mp->set(Th, KE(B), B, KE, K.lab, NN, fk); l1 = GetAny((*flab)(stack)); lmn = min(lmn, bb->lab); lmx = max(lmx, bb->lab); } if (!rmf && rm_faces) { rmf = !onborder && (l1 == rmlabfaces); } if (rmf) { nrmf++; } else { (*bb++).set(v, iv, l1); } } if (nrmf && verbosity > 2) {cout << " change mesh3 : number of removed internal faces " << nrmf << " == " << nbe - (bb - b) << endl;} nben -= nrmf; nbe -= nrmf; assert(nben == bb - b); *mp = mps; if (nbt != 0) { Mesh3 *mpq = new Mesh3(nbv, nbt, nbe, v, t, b); // mpq->BuildBound(); // mpq->BuildAdj(); // mpq->Buildbnormalv(); // mpq->BuildjElementConteningVertex(); mpq->BuildGTree(); // mpq->decrement(); // ?? decrement enlever ??? Add2StackOfPtr2FreeRC(stack, mpq); return mpq; } if (nbt == 0) { Mesh3 *mpq = new Mesh3(nbv, nbe, v, b); // mpq->BuildBound(); Add2StackOfPtr2FreeRC(stack, mpq); return mpq; } Mesh3 *mpq = NULL; return mpq; } class SetMesh3D: public OneOperator { public: typedef const Mesh3 *pmesh3; SetMesh3D (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new SetMesh3D_Op(args, t[0]->CastTo(args[0])); } }; // --------------------------------- // Movemesh2d_3D_surf class Movemesh2D_3D_surf_Op: public E_F0mps { public: Expression eTh; Expression xx, yy, zz; static const int n_name_param = 5 + 1; static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const { return nargs[i] ? GetAny >((*nargs[i])(stack)) : a; } long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: Movemesh2D_3D_surf_Op (const basicAC_F0 &args, Expression tth): eTh(tth), xx(0), yy(0), zz(0) { args.SetNameParam(n_name_param, name_param, nargs); const E_Array *a1 = 0; if (nargs[0]) {a1 = dynamic_cast(nargs[0]);} int err = 0; if (nargs[2] && nargs[5]) { CompileError("uncompatible movemesh23 (Th, label= , refface= "); } if (a1) { if (a1->size() != 3) { CompileError("movemesh23 (Th,transfo=[X,Y,Z],) "); } xx = to((*a1)[0]); yy = to((*a1)[1]); zz = to((*a1)[2]); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Movemesh2D_3D_surf_Op::name_param [] = { {"transfo", &typeid(E_Array)}, {"orientation", &typeid(long)}, {"refface", &typeid(KN_)}, {"ptmerge", &typeid(double)}, {"boolsurface", &typeid(long)}, {"label", &typeid(KN_)} }; AnyType Movemesh2D_3D_surf_Op::operator () (Stack stack) const { const Mesh *pTh = GetAny((*eTh)(stack)); const Mesh &Th = *pTh; const Mesh *m = pTh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.neb; // nombre d'aretes fontiere if (verbosity > 5) { cout << "before movemesh: Vertex Triangle Edge" << nbv << " " << nbt << " " << nbe << endl; } KN zzempty; // int intempty=0; int mesureM(arg(1, stack, 0L)); KN nrface(arg(2, stack, arg(5, stack, zzempty))); double precis_mesh(arg(3, stack, -1.)); long flagsurfaceall(arg(4, stack, -1L)); if (nrface.N() < 0) {return m;} ffassert(nrface.N() % 2 == 0); map mapface; int z00 = false; for (int i = 0; i < nrface.N(); i += 2) { z00 = z00 || (nrface[i] == 0 && nrface[i + 1] == 0); if (nrface[i] != nrface[i + 1]) { mapface[nrface[i]] = nrface[i + 1]; } } int surface_orientation = 1; if (mesureM < 0) { surface_orientation = -1; } KN txx(nbv), tyy(nbv), tzz(nbv); MeshPoint *mp3(MeshPointStack(stack)); { KN takemesh(nbv); takemesh = 0; const Mesh &rTh = Th; for (int it = 0; it < nbt; ++it) { for (int iv = 0; iv < 3; ++iv) { int i = Th(it, iv); if (takemesh[i] == 0) { mp3->setP(&Th, it, iv); if (xx) { txx[i] = GetAny((*xx)(stack)); } if (yy) { tyy[i] = GetAny((*yy)(stack)); } if (zz) { tzz[i] = GetAny((*zz)(stack)); } takemesh[i] = takemesh[i] + 1; } } } } // Mesh3 *Th3; //= new Mesh3; int vertex_out = 1; if (vertex_out == 1) { /* determinate the same vertex */ int border_only = 0; int recollement_border = 1, point_confondus_ok = 0; // faire version de Transfo_Mesh2_tetgen pour ce cas précis. Mesh3 *Th3 = MoveMesh2_func(precis_mesh, Th, txx, tyy, tzz, border_only, recollement_border, point_confondus_ok); // Rajouter fonction flip a l interieure int nbflip = 0; for (int ii = 0; ii < Th3->nbe; ii++) { const Triangle3 &K(Th3->be(ii)); int iv[3]; int lab; double mes_triangle3; iv[0] = Th3->operator () (K[0]); iv[1] = Th3->operator () (K[1]); iv[2] = Th3->operator () (K[2]); map::const_iterator imap; imap = mapface.find(K.lab); if (imap != mapface.end()) { lab = imap->second; } else { lab = K.lab; } Th3->be(ii).set(Th3->vertices, iv, lab); mes_triangle3 = Th3->be(ii).mesure(); if (surface_orientation * mes_triangle3 < 0) { int iv_temp = iv[1]; iv[1] = iv[2]; iv[2] = iv_temp; Th3->be(ii).set(Th3->vertices, iv, lab); nbflip++; } /* autre methode a tester */ /* * Triangle3 Kmes; * Kmes.set( Th3->vertices, iv, lab ) ; * mes_triangle3 = Kmes.mesure(); * if( surface_orientation*mes_triangle3) < 0){ * int iv_temp=iv[1]; * iv[1]=iv[2]; * iv[2]=iv_temp; * } * Th3->be(ii).set( Th3->vertices, iv, lab ) ; */ } assert(nbflip == 0 || nbflip == Th3->nbe); if (flagsurfaceall == 1) {Th3->BuildBoundaryElementAdj();} Add2StackOfPtr2FreeRC(stack, Th3); return Th3; } else if (vertex_out == 0) { // Tet *t = new Tet[1]; Vertex3 *v = new Vertex3[nbv]; Triangle3 *b = new Triangle3[nbe]; // generation des nouveaux sommets Vertex3 *vv = v; // copie des anciens sommets (remarque il n'y a pas operateur de copy des sommets) for (int i = 0; i < nbv; i++) { const Mesh::Vertex &V(Th.vertices[i]); vv->x = txx[i]; vv->y = tyy[i]; vv->z = tzz[i]; vv->lab = V.lab; vv++; } // les arete frontieres qui n'ont pas change Triangle3 *bb = b; for (int i = 0; i < nbt; i++) { const Mesh::Triangle &K(Th.t(i)); int iv[3]; iv[0] = Th.operator () (K[0]); iv[1] = Th.operator () (K[1]); iv[2] = Th.operator () (K[2]); (*bb++).set(v, iv, K.lab); } // Mesh3 *Th3 = new Mesh3(nbv,0,nbt,v,t,b); Mesh3 *Th3 = new Mesh3(nbv, nbt, v, b); int nbflip = 0; for (int i = 0; i < Th3->nbe; i++) { double mes_triangle3 = Th3->be(i).mesure(); if (surface_orientation * mes_triangle3 < 0) { const Triangle3 &K(Th3->be(i)); int iv[3]; iv[0] = Th3->operator () (K[0]); iv[1] = Th3->operator () (K[1]); iv[2] = Th3->operator () (K[2]); int iv_temp = iv[1]; iv[1] = iv[2]; iv[2] = iv_temp; Th3->be(i).set(Th3->vertices, iv, K.lab); nbflip++; } } assert(nbflip == 0 || nbflip == Th3->nbe); if (flagsurfaceall == 1) {Th3->BuildBoundaryElementAdj();} Add2StackOfPtr2FreeRC(stack, Th3); return Th3; } return (Mesh3 *)0; } class Movemesh2D_3D_surf: public OneOperator { public: typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; Movemesh2D_3D_surf (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Movemesh2D_3D_surf_Op(args, t[0]->CastTo(args[0])); // CastTo(args[]); // plus tard } }; /* ancien fichier de TransfoMesh */ Mesh3*Transfo_Mesh3 (const double &precis_mesh, const Mesh3 &Th3, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_element, int &recollement_border, int &point_confondus_ok, int orientation) { // cas besoin memoire important // Mesh3 *T_Th3=new Mesh3; int nv_t, nt_t, nbe_t; int *Numero_Som; int *ind_nv_t; int *ind_nt_t; int *ind_nbe_t; int *label_nt_t; int *label_nbe_t; int i_som, i_elem, i_border; Numero_Som = new int[Th3.nv]; ind_nv_t = new int[Th3.nv]; ind_nt_t = new int[Th3.nt]; ind_nbe_t = new int[Th3.nbe]; label_nt_t = new int[Th3.nt]; label_nbe_t = new int[Th3.nbe]; // cout << "Vertex, Tetrahedra, Border : "< 1) {cout << " debut: SamePointElement " << endl;} SamePointElement(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th3, recollement_element, recollement_border, point_confondus_ok, Numero_Som, ind_nv_t, ind_nt_t, ind_nbe_t, label_nt_t, label_nbe_t, nv_t, nt_t, nbe_t); if (verbosity > 1) {cout << " fin: SamePointElement " << endl;} // set size of Mesh T_Th3 // T_Th3->set(nv_t,nt_t,nbe_t); Vertex3 *v = new Vertex3[nv_t]; Tet *t = new Tet[nt_t]; Tet *tt = t; Triangle3 *b = new Triangle3[nbe_t]; Triangle3 *bb = b; double mes = 0, mesb = 0; if (verbosity > 1) { cout << "Transfo TH3 : Vertex, Tetrahedra, Border : " << "nv_t=" << nv_t << " nt_t=" << nt_t << " nbe_t=" << nbe_t << endl; } // determination of vertex i_som = 0; for (int i = 0; i < nv_t; i++) { int &ii = ind_nv_t[i]; assert(Numero_Som[ii] == i_som); const Vertex3 &K(Th3.vertices[ii]); v[i_som].x = tab_XX[ii]; v[i_som].y = tab_YY[ii]; v[i_som].z = tab_ZZ[ii]; v[i_som].lab = K.lab; i_som = i_som + 1; } assert(i_som == nv_t); // cout << " Transfo volume elements " << endl; // determination of volume elements i_elem = 0; for (int i = 0; i < nt_t; i++) { int &ii = ind_nt_t[i]; // creation of elements const Tet &K(Th3.elements[ii]); int iv[4]; int lab; lab = label_nt_t[i]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] < nv_t); } if (orientation < 0) {swap(iv[1], iv[2]);} (tt)->set(v, iv, lab); mes += tt++->mesure(); i_elem++; } assert(i_elem == nt_t); // cout << " Transfo border elements " << endl; // determination of border elements i_border = 0; for (int i = 0; i < nbe_t; i++) { int &ii = ind_nbe_t[i]; // creation of elements const Triangle3 &K(Th3.be(ii)); int iv[3]; int lab; lab = label_nbe_t[i]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] < nv_t); } if (orientation < 0) {swap(iv[1], iv[2]);} bb->set(v, iv, lab); mesb += bb++->mesure(); i_border = i_border + 1; } assert(i_border == nbe_t); if (mes < 0) { cerr << " E rror of mesh orientation , current orientation = " << orientation << endl; cerr << " volume mesh = " << mes << endl; cerr << " surface border mesh = " << mesb << endl; ErrorExec(" movemesh 3d ", 1); } delete [] Numero_Som; delete [] ind_nv_t; delete [] ind_nt_t; delete [] ind_nbe_t; delete [] label_nt_t; delete [] label_nbe_t; if (nt_t != 0) { Mesh3 *T_Th3 = new Mesh3(nv_t, nt_t, nbe_t, v, t, b); return T_Th3; } else { Mesh3 *T_Th3 = new Mesh3(nv_t, nbe_t, v, b); delete [] t; return T_Th3; } } void SamePointElement (const double &precis_mesh, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const Mesh3 &Th3, int &recollement_element, int &recollement_border, int &point_confondus_ok, int *Numero_Som, int *ind_nv_t, int *ind_nt_t, int *ind_nbe_t, int *label_nt_t, int *label_nbe_t, int &nv_t, int &nt_t, int &nbe_t) { int Elem_ok, Border_ok; double hmin, hmin_elem, hmin_border; R3 bmin, bmax; // int recollement_element=1,recollement_border=1; if (verbosity > 2) {cout << " BuilBound " << endl;} BuildBoundMinDist_th3(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th3, bmin, bmax, hmin); if (verbosity > 2) {cout << " =============================== " << endl;} double bmin3[3], bmax3[3]; bmin3[0] = bmin.x; bmin3[1] = bmin.y; bmin3[2] = bmin.z; bmax3[0] = bmax.x; bmax3[1] = bmax.y; bmax3[2] = bmax.z; if (verbosity > 2) {cout << " OrderVertexTransfo_hcode gtree " << endl;} OrderVertexTransfo_hcode_nv_gtree(Th3.nv, bmin, bmax, hmin, tab_XX, tab_YY, tab_ZZ, Numero_Som, ind_nv_t, nv_t); if (verbosity > 2) {cout << " fin order vertex gtree: nv_t=" << nv_t << endl;} if (verbosity > 2) {cout << " =============================== " << endl;} /* determination de nt_t et de nbe_t*/ int i_elem, i_border; i_elem = 0; for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.elements[ii]); int iv[4]; Elem_ok = 1; for (int jj = 0; jj < 4; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; } for (int jj = 0; jj < 4; jj++) { for (int kk = jj + 1; kk < 4; kk++) { if (iv[jj] == iv[kk]) { Elem_ok = 0; } } } if (Elem_ok == 1) { ind_nt_t[i_elem] = ii; label_nt_t[i_elem] = K.lab; i_elem = i_elem + 1; } } nt_t = i_elem; if (recollement_element == 1) { // int point_confondus_ok_e = 0; if (verbosity > 1) {cout << "debut recollement : nt_t= " << nt_t << endl;} int np, dim = 3; int *ind_np = new int [nt_t]; int *label_t = new int [nt_t]; double **Cdg_t = new double *[nt_t]; for (int i = 0; i < nt_t; i++) { Cdg_t[i] = new double[dim]; } for (int i_elem = 0; i_elem < nt_t; i_elem++) { int &ii = ind_nt_t[i_elem]; const Tet &K(Th3.elements[ii]); int iv[4]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Th3.operator () (K[jj]); } Cdg_t[i_elem][0] = (tab_XX[iv[0]] + tab_XX[iv[1]] + tab_XX[iv[2]] + tab_XX[iv[3]]) / 4.; Cdg_t[i_elem][1] = (tab_YY[iv[0]] + tab_YY[iv[1]] + tab_YY[iv[2]] + tab_YY[iv[3]]) / 4.; Cdg_t[i_elem][2] = (tab_ZZ[iv[0]] + tab_ZZ[iv[1]] + tab_ZZ[iv[2]] + tab_ZZ[iv[3]]) / 4.; label_t[i_elem] = K.lab; } hmin_elem = hmin / 4; // PointCommun_hcode( dim, nt_t, 0, Cdg_t, bmin3, bmax3, hmin_elem, ind_np, np); //ancien PointCommun_hcode_gtree(dim, nt_t, 0, Cdg_t, label_t, bmin, bmax, hmin_elem, ind_np, label_nt_t, np);// nv assert(np <= nt_t); int *ind_nt_t_tmp = new int [np]; for (int i_elem = 0; i_elem < np; i_elem++) { assert(ind_np[i_elem] >= 0 && ind_np[i_elem] <= nt_t); ind_nt_t_tmp[i_elem] = ind_nt_t[ind_np[i_elem]]; } for (int i_elem = 0; i_elem < np; i_elem++) { ind_nt_t[i_elem] = ind_nt_t_tmp[i_elem]; } delete [] ind_np; delete [] label_t; for (int i = 0; i < nt_t; i++) { delete [] Cdg_t[i]; } delete [] Cdg_t; delete [] ind_nt_t_tmp; nt_t = np; if (verbosity > 1) {cout << "fin recollement : nt_t= " << nt_t << endl;} } // determination of border elements i_border = 0; for (int ii = 0; ii < Th3.nbe; ii++) { Border_ok = 1; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] < nv_t); } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { if (iv[jj] == iv[kk]) {Border_ok = 0;} } } if (Border_ok == 1) { ind_nbe_t[i_border] = ii; label_nbe_t[i_border] = K.lab; i_border = i_border + 1; } } nbe_t = i_border; if (recollement_border == 1) { // int point_confondus_ok = 1; if (verbosity > 1) {cout << "debut recollement : nbe_t= " << nbe_t << endl;} int np, dim = 3; int *ind_np = new int [nbe_t]; double **Cdg_be = new double *[nbe_t]; int *label_be = new int [nbe_t]; for (int i = 0; i < nbe_t; i++) { Cdg_be[i] = new double[dim]; } for (int i_border = 0; i_border < nbe_t; i_border++) { int &ii = ind_nbe_t[i_border]; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th3.operator () (K[jj]); } Cdg_be[i_border][0] = (tab_XX[iv[0]] + tab_XX[iv[1]] + tab_XX[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x )/3.; Cdg_be[i_border][1] = (tab_YY[iv[0]] + tab_YY[iv[1]] + tab_YY[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y )/3.; Cdg_be[i_border][2] = (tab_ZZ[iv[0]] + tab_ZZ[iv[1]] + tab_ZZ[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z )/3.; label_be[i_border] = K.lab; } hmin_border = hmin / 3.; if (verbosity > 1) {cout << "hmin_border=" << hmin_border << endl;} if (verbosity > 1) {cout << "appele de PointCommun_hcode := " << point_confondus_ok << endl;} // PointCommun_hcode( dim, nbe_t, point_confondus_ok, Cdg_be, bmin3, bmax3, hmin_border, ind_np, np); PointCommun_hcode_gtree(dim, nbe_t, point_confondus_ok, Cdg_be, label_be, bmin, bmax, hmin_border, ind_np, label_nbe_t, np); if (verbosity > 1) {cout << "fin appele de PointCommun_hcode" << endl;} assert(np <= nbe_t); int *ind_nbe_t_tmp = new int [np]; for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t_tmp[i_border] = ind_nbe_t[ind_np[i_border]]; } for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t[i_border] = ind_nbe_t_tmp[i_border]; } delete [] ind_np; delete [] label_be; for (int i = 0; i < nbe_t; i++) { delete [] Cdg_be[i]; } delete [] Cdg_be; delete [] ind_nbe_t_tmp; nbe_t = np; if (verbosity > 1) {cout << "fin recollement : nbe_t= " << nbe_t << endl;} // Affectation de la nouvelle valeur du label } } // 3D surface Mesh3*Transfo_Mesh3_surf (const double &precis_mesh, const Mesh3 &Th3, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &recollement_border, int &point_confondus_ok) { // cas besoin memoire important // Mesh3 *T_Th3=new Mesh3; int nv_t, nbe_t; int nt_t = 0; int *Numero_Som; int *ind_nv_t; int *ind_nbe_t; int *label_nbe_t; int i_som, i_elem, i_border; assert(Th3.nt == 0); Numero_Som = new int[Th3.nv]; ind_nv_t = new int[Th3.nv]; ind_nbe_t = new int[Th3.nbe]; label_nbe_t = new int[Th3.nbe]; if (verbosity > 1) {cout << "Vertex, Tetrahedra, Border : " << Th3.nv << ", " << Th3.nt << ", " << Th3.nbe << endl;} for (int ii = 0; ii < Th3.nv; ii++) { Numero_Som[ii] = ii; } if (verbosity > 1) {cout << " debut: SamePointElement " << endl;} SamePointElement_surf(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th3, recollement_border, point_confondus_ok, Numero_Som, ind_nv_t, ind_nbe_t, label_nbe_t, nv_t, nbe_t); if (verbosity > 1) {cout << " fin: SamePointElement " << endl;} // set size of Mesh T_Th3 // T_Th3->set(nv_t,nt_t,nbe_t); Vertex3 *v = new Vertex3[nv_t]; // Tet *t; Triangle3 *b = new Triangle3[nbe_t]; Triangle3 *bb = b; if (verbosity > 1) {cout << "Transfo TH3 : Vertex, Tetrahedra, Border : " << "nv_t=" << nv_t << " nt_t=" << nt_t << " nbe_t=" << nbe_t << endl;} // determination of vertex i_som = 0; for (int i = 0; i < nv_t; i++) { int &ii = ind_nv_t[i]; assert(Numero_Som[ii] == i_som); const Vertex3 &K(Th3.vertices[ii]); /* * T_Th3->vertices[i_som].x = tab_XX[ii]; * T_Th3->vertices[i_som].y = tab_YY[ii]; * T_Th3->vertices[i_som].z = tab_ZZ[ii]; * T_Th3->vertices[i_som].lab = K.lab; */ v[i_som].x = tab_XX[ii]; v[i_som].y = tab_YY[ii]; v[i_som].z = tab_ZZ[ii]; v[i_som].lab = K.lab; i_som = i_som + 1; } if (verbosity > 1) {cout << "i_som, nv_t=" << i_som << " " << nv_t << endl;} assert(i_som == nv_t); if (verbosity > 1) {cout << " Transfo border elements " << endl;} // determination of border elements i_border = 0; for (int i = 0; i < nbe_t; i++) { int &ii = ind_nbe_t[i]; // creation of elements const Triangle3 &K(Th3.be(ii)); int iv[3]; int lab; // lab = K.lab; lab = label_nbe_t[i]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; assert(iv[jj] >= 0 && iv[jj] <= nv_t); } // T_Th3->be(i_border).set(T_Th3->vertices, iv, lab); (bb++)->set(v, iv, lab); i_border = i_border + 1; } assert(i_border == nbe_t); delete [] Numero_Som; delete [] ind_nv_t; delete [] ind_nbe_t; delete [] label_nbe_t; // Mesh3* T_Th3 = new Mesh3(nv_t,nt_t,nbe_t,v,t,b); Mesh3 *T_Th3 = new Mesh3(nv_t, nbe_t, v, b); return T_Th3; } void SamePointElement_surf (const double &precis_mesh, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const Mesh3 &Th3, int &recollement_border, int &point_confondus_ok, int *Numero_Som, int *ind_nv_t, int *ind_nbe_t, int *label_nbe_t, int &nv_t, int &nbe_t) { int Elem_ok, Border_ok; double hmin, hmin_elem, hmin_border; R3 bmin, bmax; // int recollement_element=1,recollement_border=1; if (verbosity > 1) {cout << " OrderVertexTransfo_hcode gtree " << endl;} BuildBoundMinDist_th3(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th3, bmin, bmax, hmin); if (verbosity > 1) {cout << " =============================== " << endl;} double bmin3[3], bmax3[3]; bmin3[0] = bmin.x; bmin3[1] = bmin.y; bmin3[2] = bmin.z; bmax3[0] = bmax.x; bmax3[1] = bmax.y; bmax3[2] = bmax.z; /* * cout << " OrderVertexTransfo_hcode " << endl; * OrderVertexTransfo_hcode_nv( Th3.nv, tab_XX, tab_YY, tab_ZZ, bmin3, bmax3, hmin, Numero_Som, ind_nv_t, nv_t ); * cout << "fin order vertex: nv_t=" << nv_t << endl; */ if (verbosity > 1) {cout << " OrderVertexTransfo_hcode gtree " << endl;} OrderVertexTransfo_hcode_nv_gtree(Th3.nv, bmin, bmax, hmin, tab_XX, tab_YY, tab_ZZ, Numero_Som, ind_nv_t, nv_t); if (verbosity > 1) {cout << "fin order vertex gtree: nv_t=" << nv_t << endl;} if (verbosity > 1) {cout << " =============================== " << endl;} /* determination de nt_t et de nbe_t*/ int i_border; // determination of border elements i_border = 0; for (int ii = 0; ii < Th3.nbe; ii++) { Border_ok = 1; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th3.operator () (K[jj])]; } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { if (iv[jj] == iv[kk]) {Border_ok = 0;} } } if (Border_ok == 1) { ind_nbe_t[i_border] = ii; label_nbe_t[i_border] = K.lab; i_border = i_border + 1; } } nbe_t = i_border; if (recollement_border == 1) { // int point_confondus_ok = 1; if (verbosity > 1) {cout << "debut recollement : nbe_t= " << nbe_t << endl;} int np, dim = 3; int *ind_np = new int [nbe_t]; int *label_be = new int [nbe_t]; double **Cdg_be = new double *[nbe_t]; for (int i = 0; i < nbe_t; i++) { Cdg_be[i] = new double[dim]; } for (int i_border = 0; i_border < nbe_t; i_border++) { int &ii = ind_nbe_t[i_border]; const Triangle3 &K(Th3.be(ii)); int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th3.operator () (K[jj]); } Cdg_be[i_border][0] = (tab_XX[iv[0]] + tab_XX[iv[1]] + tab_XX[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x )/3.; Cdg_be[i_border][1] = (tab_YY[iv[0]] + tab_YY[iv[1]] + tab_YY[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y )/3.; Cdg_be[i_border][2] = (tab_ZZ[iv[0]] + tab_ZZ[iv[1]] + tab_ZZ[iv[2]]) / 3.; // ( Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z )/3.; label_be[i_border] = K.lab; } hmin_border = hmin / 3.; if (verbosity > 1) {cout << "hmin_border=" << hmin_border << endl;} if (verbosity > 1) {cout << "appele de PointCommun_hcode := " << point_confondus_ok << endl;} // PointCommun_hcode( dim, nbe_t, point_confondus_ok, Cdg_be, bmin3, bmax3, hmin_border, ind_np, np); PointCommun_hcode_gtree(dim, nbe_t, point_confondus_ok, Cdg_be, label_be, bmin, bmax, hmin_border, ind_np, label_nbe_t, np); if (verbosity > 1) {cout << "fin appele de PointCommun_hcode" << endl;} assert(np <= nbe_t); int *ind_nbe_t_tmp = new int [np]; for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t_tmp[i_border] = ind_nbe_t[ind_np[i_border]]; } for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t[i_border] = ind_nbe_t_tmp[i_border]; } delete [] ind_np; delete [] label_be; delete [] ind_nbe_t_tmp; for (int i = 0; i < nbe_t; i++) { delete [] Cdg_be[i]; } delete [] Cdg_be; nbe_t = np; if (verbosity > 1) {cout << "fin recollement : nbe_t= " << nbe_t << endl;} // Affectation de la nouvelle valeur du label } } void Transfo_Mesh2_map_face (const Mesh &Th2, map &maptri) { int numero_label = 0; for (int ii = 0; ii < Th2.nt; ii++) { const Mesh::Triangle &K(Th2.t(ii)); map::const_iterator imap = maptri.find(K.lab); if (imap == maptri.end()) { maptri[K.lab] = numero_label; numero_label = numero_label + 1; } } } Mesh3*MoveMesh2_func (const double &precis_mesh, const Mesh &Th2, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_border, int &point_confondus_ok) { // Mesh3 *T_Th3= new Mesh3; int nv_t, nt_t, nbe_t; int *Numero_Som; int *ind_nv_t; int *ind_nt_t = 0; int *ind_nbe_t; int *label_nbe_t; // int i_som; Numero_Som = new int[Th2.nv]; ind_nv_t = new int[Th2.nv]; ind_nbe_t = new int[Th2.nt]; label_nbe_t = new int[Th2.nt]; if (verbosity > 5) { cout << "before movemesh::Vertex triangle2 border " << Th2.nv << " " << Th2.nt << " " << Th2.neb << endl; } for (int ii = 0; ii < Th2.nv; ii++) { Numero_Som[ii] = ii; } if (verbosity > 1) {cout << " debut: SamePointElement " << endl;} SamePointElement_Mesh2(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th2, recollement_border, point_confondus_ok, Numero_Som, ind_nv_t, ind_nt_t, ind_nbe_t, label_nbe_t, nv_t, nt_t, nbe_t); if (verbosity > 1) {cout << " fin: SamePointElement " << endl;} cout << "After movemesh::Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl; Vertex3 *v = new Vertex3[nv_t]; Tet *t; Triangle3 *b = new Triangle3[nbe_t]; Triangle3 *bb = b; // T_Th3->set(nv_t,0,nbe_t); for (int nnv = 0; nnv < nv_t; nnv++) { int ii = ind_nv_t[nnv]; assert(Numero_Som[ii] == nnv); const Mesh::Vertex &K = Th2.vertices[ii]; // const Vertex2 & K(Th2.vertices[ii]); //Version Mesh2 /* * T_Th3->vertices[nnv].x = tab_XX[ii]; * T_Th3->vertices[nnv].y = tab_YY[ii]; * T_Th3->vertices[nnv].z = tab_ZZ[ii]; * T_Th3->vertices[nnv].lab = K.lab; */ v[nnv].x = tab_XX[ii]; v[nnv].y = tab_YY[ii]; v[nnv].z = tab_ZZ[ii]; v[nnv].lab = K.lab; } for (int ibe = 0; ibe < nbe_t; ibe++) { int lab; int iv[3]; int ii = ind_nbe_t[ibe]; // creation of elements const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 iv[0] = Numero_Som[Th2.operator () (K[0])]; iv[1] = Numero_Som[Th2.operator () (K[1])]; iv[2] = Numero_Som[Th2.operator () (K[2])]; /* * map< int, int>:: const_iterator imap; * imap = maptri.find(K.lab); // imap= maptri.find( label_nbe_t[ibe] ); * assert( imap != maptri.end()); * lab = imap->second; // K.lab; // before */ // T_Th3->be(ibe).set(T_Th3->vertices,iv,K.lab); (bb++)->set(v, iv, K.lab); } // Mesh3 *T_Th3 = new Mesh3(nv_t,0,nbe_t,v,t,b); Mesh3 *T_Th3 = new Mesh3(nv_t, nbe_t, v, b); delete [] Numero_Som; delete [] ind_nv_t; delete [] ind_nbe_t; delete [] label_nbe_t; return T_Th3; } void SamePointElement_Mesh2 (const double &precis_mesh, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const Mesh &Th2, int &recollement_border, int &point_confondus_ok, int *Numero_Som, int *ind_nv_t, int *ind_nt_t, int *ind_nbe_t, int *label_nbe_t, int &nv_t, int &nt_t, int &nbe_t) { int Border_ok; // int recollement_border=0; R3 bmin, bmax; double hmin, hmin_border; if (verbosity > 1) {cout << "calculus of bound and minimal distance" << endl;} BuildBoundMinDist_th2(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th2, bmin, bmax, hmin); // assertion pour la taille de l octree assert(hmin > Norme2(bmin - bmax) / 1e9); double bmin3[3], bmax3[3]; bmin3[0] = bmin.x; bmin3[1] = bmin.y; bmin3[2] = bmin.z; bmax3[0] = bmax.x; bmax3[1] = bmax.y; bmax3[2] = bmax.z; /* * cout << "debut: OrderVertexTransfo_hcode " < 1) {cout << "fin: OrderVertexTransfo_hcode_gtree " << endl;} /* determination de nt_t et de nbe_t*/ nt_t = 0; int i_border; // determination of border elements i_border = 0; for (int ii = 0; ii < Th2.nt; ii++) { Border_ok = 1; const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); // avant Mesh2 int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Numero_Som[Th2.operator () (K[jj])]; } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { if (iv[jj] == iv[kk]) {Border_ok = 0;} } } if (Border_ok == 1) { ind_nbe_t[i_border] = ii; label_nbe_t[i_border] = K.lab; i_border = i_border + 1; } } nbe_t = i_border; if (recollement_border == 1) { // int point_confondus_ok=1; if (verbosity > 1) {cout << "debut recollement : nbe_t= " << nbe_t << endl;} int np, dim = 3; int *ind_np = new int [nbe_t]; int *label_be = new int [nbe_t]; double **Cdg_be = new double *[nbe_t]; for (int i = 0; i < nbe_t; i++) { Cdg_be[i] = new double[dim]; } for (int i_border = 0; i_border < nbe_t; i_border++) { int &ii = ind_nbe_t[i_border]; const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); // avant Mesh2 int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th2.operator () (K[jj]); } Cdg_be[i_border][0] = (tab_XX[iv[0]] + tab_XX[iv[1]] + tab_XX[iv[2]]) / 3.; Cdg_be[i_border][1] = (tab_YY[iv[0]] + tab_YY[iv[1]] + tab_YY[iv[2]]) / 3.; Cdg_be[i_border][2] = (tab_ZZ[iv[0]] + tab_ZZ[iv[1]] + tab_ZZ[iv[2]]) / 3.; label_be[i_border] = K.lab; } hmin_border = hmin / 3.; if (verbosity > 1) {cout << "points commun " << endl;} // PointCommun_hcode( dim, nbe_t, point_confondus_ok, Cdg_be, bmin3, bmax3, hmin_border, ind_np, np); // ancien PointCommun_hcode_gtree(dim, nbe_t, point_confondus_ok, Cdg_be, label_be, bmin, bmax, hmin_border, ind_np, label_nbe_t, np); // new if (verbosity > 1) {cout << "points commun finis " << endl;} assert(np <= nbe_t); // int *ind_nbe_t_tmp= new int [np]; int ind_nbe_t_tmp[np]; for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t_tmp[i_border] = ind_nbe_t[ind_np[i_border]]; } for (int i_border = 0; i_border < np; i_border++) { ind_nbe_t[i_border] = ind_nbe_t_tmp[i_border]; } delete [] ind_np; //= new int [nbe_t]; delete [] label_be; // = new int [nbe_t ]; for (int i = 0; i < nbe_t; i++) { delete [] Cdg_be[i]; } delete [] Cdg_be; //= new double *[nbe_t]; nbe_t = np; if (verbosity > 1) {cout << "fin recollement : nbe_t= " << nbe_t << endl;} } } //= ===================== // Fin cas 2D //= ===================== // version Mesh2 void BuildBoundMinDist_th2 (const double &precis_mesh, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const Mesh &Th2, R3 &bmin, R3 &bmax, double &hmin) { // determination de la boite englobante // R3 bmin,bmax; double precispt; bmin.x = tab_XX[0]; bmin.y = tab_YY[0]; bmin.z = tab_ZZ[0]; bmax.x = bmin.x; bmax.y = bmin.y; bmax.z = bmin.z; // R3 bmax = new R3(bmin); if (verbosity > 1) {cout << " determination of bmin and bmax" << endl;} for (int ii = 1; ii < Th2.nv; ii++) { bmin.x = min(bmin.x, tab_XX[ii]); bmin.y = min(bmin.y, tab_YY[ii]); bmin.z = min(bmin.z, tab_ZZ[ii]); bmax.x = max(bmax.x, tab_XX[ii]); bmax.y = max(bmax.y, tab_YY[ii]); bmax.z = max(bmax.z, tab_ZZ[ii]); } double longmini_box = 1e10; longmini_box = pow(bmax.x - bmin.x, 2) + pow(bmax.y - bmin.y, 2) + pow(bmax.z - bmin.z, 2); longmini_box = sqrt(longmini_box); // determination de hmin if (precis_mesh < 0) { precispt = longmini_box * 1e-7; } else { precispt = precis_mesh; } hmin = 1e10; for (int ii = 0; ii < Th2.nt; ii++) { const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); double longedge; int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th2.operator () (K[jj]); } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { int &i1 = iv[jj]; int &i2 = iv[kk]; longedge = pow(tab_XX[i1] - tab_XX[i2], 2) + pow(tab_YY[i1] - tab_YY[i2], 2) + pow(tab_ZZ[i1] - tab_ZZ[i2], 2); longedge = sqrt(longedge); // cout << "longedge=" << longedge << endl; if (longedge > precispt) {hmin = min(hmin, longedge);} } } } if (verbosity > 5) {cout << " longmin_box=" << longmini_box << endl;} if (verbosity > 5) {cout << " hmin =" << hmin << endl;} if (verbosity > 5) {cout << " Norme2(bmin-bmax)=" << Norme2(bmin - bmax) << endl;} assert(hmin < longmini_box); // assertion pour la taille de l octree assert(hmin > Norme2(bmin - bmax) / 1e9); /* // ????????? * hmin = 1e10; * for( int ii=0; ii< Th2.nt; ii++){ * const Mesh :: Triangle & K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); * double longedge; * int iv[3]; * for(int jj=0; jj<3; jj++){ * iv[jj] = Th2.operator()(K[jj]) ; * } * * for( int jj=0; jj<3; jj++){ * for( int kk=jj+1; kk<3; kk++){ * int & i1= iv[jj]; * int & i2= iv[kk]; * longedge = pow(tab_XX[i1]-tab_XX[i2],2) + pow(tab_YY[i1]-tab_YY[i2],2) + pow(tab_ZZ[i1]-tab_ZZ[i2],2); + longedge = sqrt(longedge); + //cout << "longedge=" << longedge << endl; + if( longedge > longmini_box*1e-7 ) hmin = min( hmin, longedge); + } + } + } + cout << "longmin_box=" << longmini_box << endl; + cout << "hmin =" << hmin << endl; + cout << "Norme2(bmin-bmax)=" << Norme2(bmin-bmax) << endl; + assert( hmin < longmini_box); + // assertion pour la taille de l octree + assert(hmin>Norme2(bmin-bmax)/1e9); */ } // version Mesh3 void BuildBoundMinDist_th3 (const double &precis_mesh, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const Mesh3 &Th3, R3 &bmin, R3 &bmax, double &hmin) { // determination de la boite englobante // R3 bmin,bmax; double precispt; bmin.x = tab_XX[0]; bmin.y = tab_YY[0]; bmin.z = tab_ZZ[0]; bmax.x = bmin.x; bmax.y = bmin.y; bmax.z = bmin.z; // R3 bmax = new R3(bmin); if (verbosity > 1) {cout << " determination of bmin and bmax" << endl;} for (int ii = 1; ii < Th3.nv; ii++) { bmin.x = min(bmin.x, tab_XX[ii]); bmin.y = min(bmin.y, tab_YY[ii]); bmin.z = min(bmin.z, tab_ZZ[ii]); bmax.x = max(bmax.x, tab_XX[ii]); bmax.y = max(bmax.y, tab_YY[ii]); bmax.z = max(bmax.z, tab_ZZ[ii]); } double longmini_box; // longmini_box = min(bmax.x-bmin.x, bmax.y-bmin.y); // longmini_box = min(longmini_box, bmax.z-bmin.z); longmini_box = pow(bmax.x - bmin.x, 2) + pow(bmax.y - bmin.y, 2) + pow(bmax.z - bmin.z, 2); longmini_box = sqrt(longmini_box); if (verbosity > 1) {cout << " bmin := " << bmin.x << " " << bmin.y << " " << bmin.z << endl;} if (verbosity > 1) {cout << " bmax := " << bmax.x << " " << bmax.y << " " << bmax.z << endl;} if (verbosity > 1) {cout << " box volume :=" << longmini_box << endl;} if (precis_mesh < 0) { precispt = longmini_box * 1e-7; } else { precispt = precis_mesh; } // determination de hmin hmin = 1e10; for (int ii = 0; ii < Th3.nt; ii++) { const Tet &K(Th3.elements[ii]); double longedge; int iv[4]; for (int jj = 0; jj < 4; jj++) { iv[jj] = Th3.operator () (K[jj]); } for (int jj = 0; jj < 4; jj++) { for (int kk = jj + 1; kk < 4; kk++) { int &i1 = iv[jj]; int &i2 = iv[kk]; longedge = pow(tab_XX[i1] - tab_XX[i2], 2) + pow(tab_YY[i1] - tab_YY[i2], 2) + pow(tab_ZZ[i1] - tab_ZZ[i2], 2); longedge = sqrt(longedge); if (longedge > precispt) {hmin = min(hmin, longedge);} } } } if (Th3.nt == 0) { for (int ii = 0; ii < Th3.nbe; ii++) { if (verbosity > 10) {cout << "border " << ii << " hmin =" << hmin << endl;} const Triangle3 &K(Th3.be(ii)); double longedge; int iv[3]; for (int jj = 0; jj < 3; jj++) { iv[jj] = Th3.operator () (K[jj]); } for (int jj = 0; jj < 3; jj++) { for (int kk = jj + 1; kk < 3; kk++) { int &i1 = iv[jj]; int &i2 = iv[kk]; longedge = pow(tab_XX[i1] - tab_XX[i2], 2) + pow(tab_YY[i1] - tab_YY[i2], 2) + pow(tab_ZZ[i1] - tab_ZZ[i2], 2); longedge = sqrt(longedge); if (longedge > precispt) {hmin = min(hmin, longedge);} } } } } if (verbosity > 5) {cout << " longmini_box" << longmini_box << endl;} if (verbosity > 5) {cout << " hmin =" << hmin << endl;} assert(hmin < longmini_box); if (verbosity > 5) {cout << " Norme2(bmin-bmax)=" << Norme2(bmin - bmax) << endl;} // assertion pour la taille de l octree assert(hmin > Norme2(bmin - bmax) / 1e9); } //= ===================== // //= ===================== void OrderVertexTransfo_hcode_nv (const int &tab_nv, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, const double *bmin, const double *bmax, const double hmin, int *Numero_Som, int *ind_nv_t, int &nv_t) { size_t i; size_t j[3]; size_t k[3]; size_t NbCode = 100000; int *tcode; //= new int[NbCode]; int *posv = new int[tab_nv]; double epsilon = hmin / 10.; /* * double epsilon=0.001; * * // determination de boite englobante * double bmin[3],bmax[3]; * * bmin[0] = tab_XX[0]; * bmin[1] = tab_YY[0]; * bmin[2] = tab_ZZ[0]; * * bmax[0] = bmin[0]; * bmax[1] = bmin[1]; * bmax[2] = bmin[2]; * * cout << " determination bmin et bmax" << endl; * * for(int ii=1; ii 4) {cout << " -- numberofpoints " << numberofpoints << endl;} if (verbosity > 4) {cout << " -- taille boite englobante =" << endl;} if (verbosity > 4) { for (int ii = 0; ii < 3; ii++) { cout << "ii=" << ii << " " << bmin[ii] << " " << bmax[ii] << endl; } for (int ii = 0; ii < 3; ii++) { cout << "k[" << ii << "]= " << k[ii] << endl; } } NbCode = min(4 * (k[0] + k[1] + k[2]), NbCode); tcode = new int[NbCode]; /* initialisation des codes */ for (int ii = 0; ii < NbCode; ii++) { tcode[ii] = -1; } for (int ii = 0; ii < tab_nv; ii++) { // boucle dans l autre sens pour assurer l'ordre des elements pour la suite // cout << "vertex ii " << ii << " max : " << tab_nv; j[0] = int((tab_XX[ii] - bmin[0]) / epsilon); j[1] = int((tab_YY[ii] - bmin[1]) / epsilon); j[2] = int((tab_ZZ[ii] - bmin[2]) / epsilon); assert(j[0] <= k[0] && j[0] >= 0); assert(j[1] <= k[1] && j[1] >= 0); assert(j[2] <= k[2] && j[2] >= 0); i = (j[2] * (k[1] + 1) + j[1] * (k[0] + 1) + j[0]); // cout << i << endl; i = i % NbCode; assert(i < NbCode); posv[ii] = tcode[i]; tcode[i] = ii; } if (verbosity > 1) {cout << " boucle numero de Sommet " << endl;} for (int ii = 0; ii < tab_nv; ii++) { Numero_Som[ii] = -1; } if (verbosity > 1) {cout << " determinations des points confondus et numerotation " << endl;} nv_t = 0; for (int icode = 0; icode < NbCode; icode++) { // int ii,jj; double dist; for (int ii = tcode[icode]; ii != -1; ii = posv[ii]) { if (Numero_Som[ii] != -1) {continue;} Numero_Som[ii] = nv_t; for (int jj = posv[ii]; jj != -1; jj = posv[jj]) { if (Numero_Som[jj] != -1) {continue;} dist = pow(tab_XX[jj] - tab_XX[ii], 2) + pow(tab_YY[jj] - tab_YY[ii], 2) + pow(tab_ZZ[jj] - tab_ZZ[ii], 2); if (sqrt(dist) < epsilon) { // point semblable Numero_Som[jj] = Numero_Som[ii]; // cout << "point semblable" << endl; // exit(-1); } } ind_nv_t[nv_t] = ii;// Remarque on donne a nv_t le plus grand nv_t++; // nv_t = nvt+1; } } if (verbosity > 1) {cout << " nv_t = " << nv_t << " / " << "nv_t(anc)" << tab_nv << endl;} assert(nv_t == numberofpoints); delete [] posv; delete [] tcode; } void PointCommun_hcode (const int &dim, const int &NbPoints, const int &point_confondus_ok, double **Coord_Point, const double *bmin, const double *bmax, const double hmin, int *ind_np, int &np) { size_t i; size_t j[dim]; size_t k[dim]; size_t NbCode = 100000; int *tcode; //= new int[NbCode]; int *posv = new int[NbPoints]; int *Numero_Som = new int[NbPoints]; double epsilon = hmin / 10.; /* * double epsilon=0.0001; * double bmin[dim],bmax[dim]; * * for(int jj=0; jj 1); for (int jj = 0; jj < dim; jj++) { k[jj] = int((bmax[jj] - bmin[jj]) / epsilon); } int numberofpoints = 0; int numberofpointsdiff; for (int ii = 0; ii < NbPoints; ii++) { numberofpointsdiff = 0; for (int jj = ii + 1; jj < NbPoints; jj++) { double dist = 0.; for (int kk = 0; kk < 3; kk++) { dist = dist + pow(Coord_Point[jj][kk] - Coord_Point[ii][kk], 2); } if (sqrt(dist) < 1e-10) { numberofpointsdiff = 1; } } if (numberofpointsdiff == 0) {numberofpoints = numberofpoints + 1;} } if (verbosity > 1) {cout << "numberofpoints " << numberofpoints << endl;} NbCode = min(4 * (k[0] + k[1] + k[2]), NbCode); if (verbosity > 1) {cout << "NbCode=" << NbCode << endl;} tcode = new int[NbCode]; /* initialisation des codes */ for (int ii = 0; ii < NbCode; ii++) { tcode[ii] = -1; } for (int ii = 0; ii < NbPoints; ii++) { // boucle dans l autre sens pour assurer l'ordre des elements pour la suite for (int jj = 0; jj < dim; jj++) { j[jj] = int((Coord_Point[ii][jj] - bmin[jj]) / epsilon); } assert(j[0] <= k[0] && j[0] >= 0); assert(j[1] <= k[1] && j[1] >= 0); assert(j[2] <= k[2] && j[2] >= 0); i = j[0]; for (int jj = 1; jj < dim; jj++) { i = i + j[jj] * (k[jj - 1] + 1); } i = i % NbCode; assert(i < NbCode); posv[ii] = tcode[i]; tcode[i] = ii; } for (int ii = 0; ii < NbPoints; ii++) { ind_np[ii] = -1; Numero_Som[ii] = -1; } /* Resolution probleme dans le cas où le maillage se colle */ /* maintenant determinations des points confondus et numerotation*/ switch (point_confondus_ok) { case 0: np = 0; for (int icode = 0; icode < NbCode; icode++) { // int ii,jj; double dist; for (int ii = tcode[icode]; ii != -1; ii = posv[ii]) { if (Numero_Som[ii] != -1) {continue;} // minimum_np=ii; Numero_Som[ii] = np; for (int jj = posv[ii]; jj != -1; jj = posv[jj]) { if (Numero_Som[jj] != -1) {continue;} dist = 0.; for (int kk = 0; kk < dim; kk++) { dist = dist + pow(Coord_Point[jj][kk] - Coord_Point[ii][kk], 2); } if (sqrt(dist) < epsilon) { // point semblable Numero_Som[jj] = Numero_Som[ii]; // minimum_np = min( jj, minimum_np); } } ind_np[np] = ii;// min(ii,minimum_np); // Remarque on donne a np le plus petit element np++; // nv_t = nvt+1; } } break; case 1: int point_multiple; np = 0; for (int icode = 0; icode < NbCode; icode++) { // int ii,jj; double dist; for (int ii = tcode[icode]; ii != -1; ii = posv[ii]) { if (Numero_Som[ii] != -1) {continue;} // minimum_np=ii; Numero_Som[ii] = np; point_multiple = 0; for (int jj = posv[ii]; jj != -1; jj = posv[jj]) { if (Numero_Som[jj] != -1) {continue;} dist = 0.; for (int kk = 0; kk < dim; kk++) { dist = dist + pow(Coord_Point[jj][kk] - Coord_Point[ii][kk], 2); } if (sqrt(dist) < epsilon) { // point semblable Numero_Som[jj] = Numero_Som[ii]; point_multiple = 1; // minimum_np = min( jj, minimum_np); } } if (point_multiple == 0) { ind_np[np] = ii;// min(ii,minimum_np); // Remarque on donne a np le plus petit element np++; // nv_t = nvt+1; } } } break; default: cout << " point_confondus_ok dans fonction PointCommun_hcode vaut 1 ou 0." << endl; exit(-1); } delete [] tcode; delete [] posv; delete [] Numero_Som; } void OrderVertexTransfo_hcode_nv_gtree (const int &tab_nv, const R3 &bmin, const R3 &bmax, const double &hmin, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int *Numero_Som, int *ind_nv_t, int &nv_t) { size_t i; size_t j[3]; size_t k[3]; // parametre interne pour debugger le code int verifnumberofpoints; verifnumberofpoints = 1; // hmin a determiner plus haut assert(hmin > Norme2(bmin - bmax) / 1e9); double hseuil = hmin / 10.; // hseuil = hseuil/10.; Vertex3 *v = new Vertex3[tab_nv]; // Vertex3 v[tab_nv]; EF23::GTree *gtree = new EF23::GTree(v, bmin, bmax, 0); if (verbosity > 2) { cout << " -- taille de la boite " << endl; cout << "\t" << bmin.x << " " << bmin.y << " " << bmin.z << endl; cout << "\t" << bmax.x << " " << bmax.y << " " << bmax.z << endl; } // creation of octree nv_t = 0; for (int ii = 0; ii < tab_nv; ii++) { const R3 r3vi(tab_XX[ii], tab_YY[ii], tab_ZZ[ii]); /*vi.x = tab_XX[ii]; * vi.y = tab_YY[ii]; * vi.z = tab_ZZ[ii];*/ const Vertex3 &vi(r3vi); /*vi.x = tab_XX[ii]; * vi.y = tab_YY[ii]; * vi.z = tab_ZZ[ii];*/ Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[nv_t].x = vi.x; v[nv_t].y = vi.y; v[nv_t].z = vi.z; v[nv_t].lab = vi.lab; // lab mis a zero par default ind_nv_t[nv_t] = ii; Numero_Som[ii] = nv_t; gtree->Add(v[nv_t]); nv_t = nv_t + 1; } else { Numero_Som[ii] = pvi - v; } } delete gtree; delete [] v; if (verbosity > 3) {cout << " hseuil=" << hseuil << endl;} if (verbosity > 3) {cout << " nv_t = " << nv_t << " / " << "nv_t(anc)" << tab_nv << endl;} if (verifnumberofpoints == 1) { int numberofpoints = 0; int numberofpointsdiff; for (int ii = 0; ii < tab_nv; ii++) { numberofpointsdiff = 0; for (int jj = ii + 1; jj < tab_nv; jj++) { double dist = 0.; dist = pow(tab_XX[jj] - tab_XX[ii], 2) + pow(tab_YY[jj] - tab_YY[ii], 2) + pow(tab_ZZ[jj] - tab_ZZ[ii], 2); if (sqrt(dist) < hseuil) { numberofpointsdiff = 1; } } if (numberofpointsdiff == 0) {numberofpoints = numberofpoints + 1;} } if (verbosity > 2) {cout << " -- numberofpoints " << numberofpoints << endl;} // if(verbosity >2) cout << " -- taille boite englobante =" << endl; // assert(nv_t==numberofpoints); } } void PointCommun_hcode_gtree (const int &dim, const int &NbPoints, const int &point_confondus_ok, double **Coord_Point, const int *label_point, const R3 &bmin, const R3 &bmax, const double &hmin, int *ind_np, int *ind_label, int &np) { double hseuil = hmin / 10.; Vertex3 *v = new Vertex3[NbPoints]; // Vertex3 v[NbPoints]; EF23::GTree *gtree = new EF23::GTree(v, bmin, bmax, 0); if (verbosity > 1) {cout << "verif hmin vertex3 GTree switch: " << point_confondus_ok << endl;} int int_point_confondus_ok = point_confondus_ok; if (int_point_confondus_ok == 0) { // accepte les points double np = 0; for (int ii = 0; ii < NbPoints; ii++) { const R3 r3vi(Coord_Point[ii][0], Coord_Point[ii][1], Coord_Point[ii][2]); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[np].x = vi.x; v[np].y = vi.y; v[np].z = vi.z; v[np].lab = vi.lab; // lab mis a zero par default ind_np[np] = ii; ind_label[np] = label_point[ii]; gtree->Add(v[np++]); } else { ind_label[pvi - v] = min(ind_label[pvi - v], label_point[ii]); } } if (verbosity > 1) {cout << "np=" << np << endl;} } if (int_point_confondus_ok == 1) { // accepte les points double sont enleves np = 0; for (int ii = 0; ii < NbPoints; ii++) { const R3 r3vi(Coord_Point[ii][0], Coord_Point[ii][1], Coord_Point[ii][2]); // int label = label_point[ii]; const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[np].x = vi.x; v[np].y = vi.y; v[np].z = vi.z; v[np].lab = vi.lab; // lab mis a zero par default ind_np[np] = ii; ind_label[np] = label_point[ii]; gtree->Add(v[np++]); } else { ind_label[pvi - v] = min(ind_label[pvi - v], label_point[ii]); } } int ind_multiple[np]; for (int ii = 0; ii < np; ii++) { ind_multiple[ii] = -1; } for (int ii = 0; ii < NbPoints; ii++) { const R3 r3vi(Coord_Point[ii][0], Coord_Point[ii][1], Coord_Point[ii][2]); // int label = label_point[ii]; const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree->ToClose(vi, hseuil); ind_multiple[pvi - v] = ind_multiple[pvi - v] + 1; } int jnp; jnp = 0; for (int ii = 0; ii < np; ii++) { if (ind_multiple[ii] == 0) { assert(jnp <= ii); ind_np[jnp] = ind_np[ii]; ind_label[jnp] = ind_label[ii]; jnp++; } } np = jnp; } if (int_point_confondus_ok != 0 && int_point_confondus_ok != 1) { cout << " point_confondus_ok dans fonction PointCommun_hcode vaut 1 ou 0." << endl; exit(1); } delete gtree; delete [] v; /* * int z_verifnumberofpoints; * z_verifnumberofpoints = 0; * if(z_verifnumberofpoints ==1){ * int numberofpoints=0; * int numberofpointsdiff; * for(int ii=0; ii(nargs[0]);} if (nargs[1]) {a2 = dynamic_cast(nargs[1]);} int err = 0; // cout << nargs[0] << " "<< a1 << endl; // cout << nargs[1] << " "<< a2 << endl; if (a1) { if (a1->size() != 2) { CompileError("LayerMesh (Th,n, zbound=[zmin,zmax],) "); } // cout << "lecture de ezmin , ezmax" << endl; ezmin = to((*a1)[0]); ezmax = to((*a1)[1]); } if (a2) { if (a2->size() != 3) { CompileError("LayerMesh (Th,n, transfo=[X,Y,Z],) "); } xx = to((*a2)[0]); yy = to((*a2)[1]); zz = to((*a2)[2]); } if (nargs[3] && nargs[9]) { CompileError("uncompatible buildlayer (Th, region= , reftet= "); } if (nargs[4] && nargs[10]) { CompileError("uncompatible buildlayer (Th, midlabel= , reffacemid= "); } if (nargs[5] && nargs[11]) { CompileError("uncompatible buildlayer (Th, toplabel= , reffaceup= "); } if (nargs[6] && nargs[12]) { CompileError("uncompatible buildlayer (Th, downlabel= , reffacelow= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type BuildLayeMesh_Op::name_param [] = { {"zbound", &typeid(E_Array)}, {"transfo", &typeid(E_Array)}, {"coef", &typeid(double)}, {"reftet", &typeid(KN_)}, // 3 {"reffacemid", &typeid(KN_)}, {"reffaceup", &typeid(KN_)}, {"reffacelow", &typeid(KN_)}, {"facemerge", &typeid(long)}, {"ptmerge", &typeid(double)}, {"region", &typeid(KN_)}, // 9 {"labelmid", &typeid(KN_)}, {"labelup", &typeid(KN_)}, {"labeldown", &typeid(KN_)}, // 12 }; class BuildLayerMesh: public OneOperator { public: BuildLayerMesh (): OneOperator(atype(), atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { if (verbosity > 1) {cout << " je suis dans code(const basicAC_F0 & args) const" << endl;} // cout << "args: " << args << endl; return new BuildLayeMesh_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; /* debut buildlayer.cpp */ class cubeMesh_Op: public E_F0mps { public: Expression nx, ny, nz; Expression xx, yy, zz; static const int n_name_param = 3; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} // int arg(int i,Stack stack,int a ) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} public: cubeMesh_Op (const basicAC_F0 &args, Expression nnx, Expression nny, Expression nnz, Expression transfo = 0) : nx(nnx), ny(nny), nz(nnz), xx(0), yy(0), zz(0) { if (verbosity > 1) {cout << "construction par cubeMesh_Op" << endl;} args.SetNameParam(n_name_param, name_param, nargs); const E_Array *a2 = dynamic_cast(transfo); int err = 0; // cout << nargs[0] << " "<< a1 << endl; // cout << nargs[1] << " "<< a2 << endl; if (a2) { if (a2->size() != 3) { CompileError("cube (n1,n2,n3, [X,Y,Z]) "); } xx = to((*a2)[0]); yy = to((*a2)[1]); zz = to((*a2)[2]); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type cubeMesh_Op::name_param [] = { {"region", &typeid(long)}, // 0 {"label", &typeid(KN_)}, {"flags", &typeid(long)} }; class cubeMesh: public OneOperator { public: int xyz; cubeMesh (): OneOperator(atype(), atype(), atype(), atype()), xyz(0) {} cubeMesh (int): OneOperator(atype(), atype(), atype(), atype(), atype()), xyz(1) {} E_F0*code (const basicAC_F0 &args) const { // cout << "args: " << args << endl; if (xyz) { return new cubeMesh_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } else { return new cubeMesh_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } } }; extern Mesh*Carre_ (int nx, int ny, Expression fx, Expression fy, Stack stack, int flags, KN_ lab, long reg); AnyType cubeMesh_Op::operator () (Stack stack) const { int n1 = (int)GetAny((*nx)(stack)); int n2 = (int)GetAny((*ny)(stack)); int nlayer = (int)GetAny((*nz)(stack)); MeshPoint *mp(MeshPointStack(stack)), mps = *mp; long flags = arg(2, stack, 0L); ; KN label2; long ll3 [] = {1, 2, 3, 4, 5, 6}; KN_ l3_(ll3, 6); KN l3 = arg(1, stack, l3_); ffassert(l3.N() == 6); long region = arg(0, stack, 0L); Mesh *pTh = Carre_(n1, n2, 0, 0, stack, flags, label2, 0L); // WARNING no clean of teh stack in this case (durdur) ffassert(pTh && nlayer > 0); Mesh &Th = *pTh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int neb = Th.neb; // nombre d'aretes fontiere if (verbosity > 2) { cout << " -- cubeMesh_Op input: nv" << nbv << " nt: " << nbt << " nbe " << neb << endl; } KN zmin(nbv), zmax(nbv); KN clayer(nbv); // nombre de layer est nlayer*clayer clayer = 1.; zmin = 0.; zmax = 1.; double maxdz = 1.; if (verbosity > 3) {cout << "lecture valeur des references " << endl;} long rup [] = {0, l3[6 - 1]}, rdown [] = {0, l3[5 - 1]}, r0 [] = {0, region}; long rmid [] = {1, l3[1 - 1], 2, l3[2 - 1], 3, l3[3 - 1], 4, l3[4 - 1]}; // KN_ zzempty; KN_ nrtet(r0, 2); KN_ nrfmid(rmid, 8); KN_ nrfup(rup, 2); KN_ nrfdown(rdown, 2); int point_confondus_ok(0L); double precis_mesh(-1L); // realisation de la map par default map maptet; map maptrimil, maptrizmax, maptrizmin; map mapemil, mapezmax, mapezmin; build_layer_map_tetrahedra(Th, maptet); build_layer_map_triangle(Th, maptrimil, maptrizmax, maptrizmin); build_layer_map_edge(Th, mapemil, mapezmax, mapezmin); // Map utilisateur map::iterator imap; for (int ii = 0; ii < nrtet.N(); ii += 2) { imap = maptet.find(nrtet[ii]); if (imap != maptet.end()) { imap->second = nrtet[ii + 1]; } } for (int ii = 0; ii < nrfmid.N(); ii += 2) { imap = maptrimil.find(nrfmid[ii]); if (imap != maptrimil.end()) { imap->second = nrfmid[ii + 1]; } } for (int ii = 0; ii < nrfup.N(); ii += 2) { imap = maptrizmax.find(nrfup[ii]); if (imap != maptrizmax.end()) { imap->second = nrfup[ii + 1]; } } for (int ii = 0; ii < nrfdown.N(); ii += 2) { imap = maptrizmin.find(nrfdown[ii]); if (imap != maptrizmin.end()) { imap->second = nrfdown[ii + 1]; } } int nebn = 0; KN ni(nbv); double epsz = maxdz * 1e-6; if (verbosity > 9999) {cout << ":: epsz " << epsz << endl;} for (int i = 0; i < nbv; i++) { ni[i] = Max(0, Min(nlayer, (int)lrint(nlayer * clayer[i]))); if (abs(zmin[i] - zmax[i]) < epsz) { ni[i] = 0; // Corr FH aug. 2014... } } if (verbosity > 9999) {cout << " cubeMesh_Op: ni = " << ni << endl;} // triangle for (int it = 0; it < nbt; ++it) { const Mesh::Element &K(Th.t(it)); int i0 = Th.operator () (K[0]); int i1 = Th.operator () (K[1]); int i2 = Th.operator () (K[2]); if (ni[i0] == 0 && ni[i1] == 0 && ni[i2] == 0) { cout << "A tetrahedra with null volume will be created with triangle " << it << " of 2D Mesh " << endl; cout << "stop procedure of buildlayer" << endl; exit(1); } } // cas maillage volumique + surfacique Mesh3 *Th3 = build_layer(Th, nlayer, ni, zmin, zmax, maptet, maptrimil, maptrizmax, maptrizmin, mapemil, mapezmax, mapezmin); // cas maillage surfacique simplement // A construire Jacques + donner le numero des edges que l'on veut pas creer � l'int�rieure delete pTh; if (xx && yy && zz) { // Mesh3 *Th3= build_layer(Th, nlayer, ni, zmin, zmax); KN txx(Th3->nv), tyy(Th3->nv), tzz(Th3->nv); KN takemesh(Th3->nv); // MeshPoint *mp3(MeshPointStack(stack)); takemesh = 0; for (int it = 0; it < Th3->nt; ++it) { for (int iv = 0; iv < 4; ++iv) { int i = (*Th3)(it, iv); if (takemesh[i] == 0) { mp->setP(Th3, it, iv); {txx[i] = GetAny((*xx)(stack)); } {tyy[i] = GetAny((*yy)(stack)); } {tzz[i] = GetAny((*zz)(stack)); } takemesh[i] = takemesh[i] + 1; } } } int border_only = 0; int recollement_elem = 0, recollement_border = 1; if (point_confondus_ok == 2) { recollement_border = 0; point_confondus_ok = 1; } Mesh3 *T_Th3 = Transfo_Mesh3(precis_mesh, *Th3, txx, tyy, tzz, border_only, recollement_elem, recollement_border, point_confondus_ok, 1); delete Th3; Th3 = T_Th3; } Th3->BuildGTree(); // A decommenter if (verbosity > 10) {cout << " Cube %%% " << Th3 << endl;} Add2StackOfPtr2FreeRC(stack, Th3); *mp = mps; return Th3; } AnyType BuildLayeMesh_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh *pTh = GetAny((*eTh)(stack)); int nlayer = (int)GetAny((*enmax)(stack)); ffassert(pTh && nlayer > 0); Mesh &Th = *pTh; Mesh *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int neb = Th.neb; // nombre d'aretes fontiere if (verbosity > 2) { cout << " -- BuildLayeMesh_Op input: nv" << nbv << " nt: " << nbt << " nbe " << neb << endl; } KN zmin(nbv), zmax(nbv); KN clayer(nbv); // nombre de layer est nlayer*clayer clayer = -1; zmin = 0.; zmax = 1.; double maxdz = 0; for (int it = 0; it < nbt; ++it) { for (int iv = 0; iv < 3; ++iv) { int i = Th(it, iv); if (clayer[i] < 0) { mp->setP(&Th, it, iv); // cout << "mp: fait " << endl; if (ezmin) {zmin[i] = GetAny((*ezmin)(stack));} if (ezmax) {zmax[i] = GetAny((*ezmax)(stack));} maxdz = max(maxdz, abs(zmin[i] - zmax[i])); clayer[i] = Max(0., Min(1., arg(2, stack, 1.))); } } } ffassert(clayer.min() >= 0); if (verbosity > 1) {cout << "lecture valeur des references " << endl;} KN zzempty; KN nrtet(arg(3, stack, arg(3 + 6, stack, zzempty))); KN nrfmid(arg(4, stack, arg(4 + 6, stack, zzempty))); KN nrfup(arg(5, stack, arg(5 + 6, stack, zzempty))); KN nrfdown(arg(6, stack, arg(6 + 6, stack, zzempty))); int point_confondus_ok(arg(7, stack, 0L)); double precis_mesh(arg(8, stack, -1L)); // if( nrtet.N() && nrfmid.N() && nrfup.N() && nrfdown.N() ) return m; ffassert(nrtet.N() % 2 == 0); ffassert(nrfmid.N() % 2 == 0); ffassert(nrfup.N() % 2 == 0); ffassert(nrfdown.N() % 2 == 0); // realisation de la map par default map maptet; map maptrimil, maptrizmax, maptrizmin; map mapemil, mapezmax, mapezmin; build_layer_map_tetrahedra(Th, maptet); build_layer_map_triangle(Th, maptrimil, maptrizmax, maptrizmin); build_layer_map_edge(Th, mapemil, mapezmax, mapezmin); // Map utilisateur map::iterator imap; for (int ii = 0; ii < nrtet.N(); ii += 2) { imap = maptet.find(nrtet[ii]); if (imap != maptet.end()) { imap->second = nrtet[ii + 1]; } } for (int ii = 0; ii < nrfmid.N(); ii += 2) { imap = maptrimil.find(nrfmid[ii]); if (imap != maptrimil.end()) { imap->second = nrfmid[ii + 1]; } } for (int ii = 0; ii < nrfup.N(); ii += 2) { imap = maptrizmax.find(nrfup[ii]); if (imap != maptrizmax.end()) { imap->second = nrfup[ii + 1]; } } for (int ii = 0; ii < nrfdown.N(); ii += 2) { imap = maptrizmin.find(nrfdown[ii]); if (imap != maptrizmin.end()) { imap->second = nrfdown[ii + 1]; } } int nebn = 0; KN ni(nbv); double epsz = maxdz * 1e-6; if (verbosity > 9999) {cout << "BuildLayeMesh_Op:: epsz " << epsz << endl;} for (int i = 0; i < nbv; i++) { ni[i] = Max(0, Min(nlayer, (int)lrint(nlayer * clayer[i]))); if (abs(zmin[i] - zmax[i]) < epsz) { ni[i] = 0; // Corr FH aug. 2014... } } if (verbosity > 9999) {cout << " BuildLayeMesh_Op: ni = " << ni << endl;} // triangle for (int it = 0; it < nbt; ++it) { const Mesh::Element &K(Th.t(it)); int i0 = Th.operator () (K[0]); int i1 = Th.operator () (K[1]); int i2 = Th.operator () (K[2]); if (ni[i0] == 0 && ni[i1] == 0 && ni[i2] == 0) { cout << "A tetrahedra with null volume will be created with triangle " << it << " of 2D Mesh " << endl; cout << "stop procedure of buildlayer" << endl; exit(1); } } // cas maillage volumique + surfacique Mesh3 *Th3 = build_layer(Th, nlayer, ni, zmin, zmax, maptet, maptrimil, maptrizmax, maptrizmin, mapemil, mapezmax, mapezmin); // cas maillage surfacique simplement // A construire Jacques + donner le numero des edges que l'on veut pas creer à l'intérieure if (!(xx) && !(yy) && !(zz)) { /* * map< int, int > maptet; * map< int, int > maptrimil, maptrizmax, maptrizmin; * map< int, int > mapemil, mapezmax, mapezmin; * * build_layer_map_tetrahedra( Th, maptet ); * build_layer_map_triangle( Th, maptrimil, maptrizmax, maptrizmin ); * build_layer_map_edge( Th, mapemil, mapezmax, mapezmin ); * * Mesh3 *Th3= build_layer(Th, nlayer, ni, zmin, zmax, maptet, maptrimil, maptrizmax, maptrizmin, mapemil, mapezmax, mapezmin); */ // Th3->BuildBound(); // Th3->BuildAdj(); // Th3->Buildbnormalv(); // Th3->BuildjElementConteningVertex(); Th3->BuildGTree(); // A decommenter Add2StackOfPtr2FreeRC(stack, Th3); *mp = mps; return Th3; } else { // Mesh3 *Th3= build_layer(Th, nlayer, ni, zmin, zmax); KN txx(Th3->nv), tyy(Th3->nv), tzz(Th3->nv); KN takemesh(Th3->nv); // MeshPoint *mp3(MeshPointStack(stack)); takemesh = 0; Mesh3 &rTh3 = *Th3; for (int it = 0; it < Th3->nt; ++it) { for (int iv = 0; iv < 4; ++iv) { int i = (*Th3)(it, iv); if (takemesh[i] == 0) { mp->setP(Th3, it, iv); if (xx) {txx[i] = GetAny((*xx)(stack));} if (yy) {tyy[i] = GetAny((*yy)(stack));} if (zz) {tzz[i] = GetAny((*zz)(stack));} takemesh[i] = takemesh[i] + 1; } } } int border_only = 0; int recollement_elem = 0, recollement_border = 1; if (point_confondus_ok == 2) { recollement_border = 0; point_confondus_ok = 1; } Mesh3 *T_Th3 = Transfo_Mesh3(precis_mesh, rTh3, txx, tyy, tzz, border_only, recollement_elem, recollement_border, point_confondus_ok, 1); // T_Th3->BuildBound(); // T_Th3->BuildAdj(); // T_Th3->Buildbnormalv(); // T_Th3->BuildjElementConteningVertex(); T_Th3->BuildGTree();// A decommenter delete Th3; Add2StackOfPtr2FreeRC(stack, T_Th3); *mp = mps; return T_Th3; } } // function nouveau nom de fonction class Movemesh2D_3D_surf_cout_Op: public E_F0mps { public: Movemesh2D_3D_surf_cout_Op (const basicAC_F0 &args, Expression tth) { CompileError("The keyword movemesh2D3Dsurf is remplaced now by the keyword movemesh23 (see Manual) ::: Moreover, the parameter mesuremesh are denoted now orientation "); } AnyType operator () (Stack stack) const {return 0L;} }; class Movemesh2D_3D_surf_cout: public OneOperator { public: typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; Movemesh2D_3D_surf_cout (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Movemesh2D_3D_surf_cout_Op(args, t[0]->CastTo(args[0])); // CastTo(args[]); // plus tard } }; /***********************************************/ class Movemesh3D_cout_Op: public E_F0mps { public: Movemesh3D_cout_Op (const basicAC_F0 &args, Expression tth) { CompileError("The keyword movemesh3D is remplaced in this new version of freefem++ by the keyword movemesh3 (see manual)"); } AnyType operator () (Stack stack) const {return 0L;} }; class Movemesh3D_cout: public OneOperator { public: typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; Movemesh3D_cout (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Movemesh3D_cout_Op(args, t[0]->CastTo(args[0])); // CastTo(args[]); // plus tard } }; // class DeplacementTab_Op: public E_F0mps { public: Expression eTh; // Expression xx,yy,zz; static const int n_name_param = 6; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: DeplacementTab_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) {// , xx(0) , yy(0) , zz(0) args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type DeplacementTab_Op::name_param [] = { {"deltax", &typeid(KN_)}, {"deltay", &typeid(KN_)}, {"deltaz", &typeid(KN_)}, {"ptmerge", &typeid(double)}, {"facemerge", &typeid(long)}, {"boolsurface", &typeid(long)} }; AnyType DeplacementTab_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); ffassert(pTh); Mesh3 &Th = *pTh; Mesh3 *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere if (verbosity > 5) { cout << "before movemesh: Vertex " << nbv << " Tetrahedra " << nbt << " triangles " << nbe << endl; } // lecture des references KN zzempty; KN dx(arg(0, stack, zzempty)); KN dy(arg(1, stack, zzempty)); KN dz(arg(2, stack, zzempty)); double precis_mesh(arg(3, stack, 1e-7)); ffassert(dx.N() == Th.nv); ffassert(dy.N() == Th.nv); ffassert(dz.N() == Th.nv); // realisation de la map par default KN txx(Th.nv), tyy(Th.nv), tzz(Th.nv); // loop over tetrahedral for (int i = 0; i < Th.nv; ++i) { txx[i] = Th.vertices[i].x + dx[i]; tyy[i] = Th.vertices[i].y + dy[i]; tzz[i] = Th.vertices[i].z + dz[i]; } int border_only = 0; int recollement_elem = 0; int recollement_border, point_confondus_ok; int mergefacemesh(arg(4, stack, 0L)); long flagsurfaceall(arg(5, stack, 1L)); if (mergefacemesh == 0) { recollement_border = 0; point_confondus_ok = 0; } if (mergefacemesh == 1) { recollement_border = 1; point_confondus_ok = 0; } if (mergefacemesh == 2) { recollement_border = 1; point_confondus_ok = 1; } Mesh3 *T_Th3 = Transfo_Mesh3(precis_mesh, Th, txx, tyy, tzz, border_only, recollement_elem, recollement_border, point_confondus_ok, 1); if (nbt != 0) { // T_Th3->BuildBound(); // T_Th3->BuildAdj(); if (flagsurfaceall == 1) {T_Th3->BuildBoundaryElementAdj();} // T_Th3->Buildbnormalv(); // T_Th3->BuildjElementConteningVertex(); T_Th3->BuildGTree(); // T_Th3->decrement(); } else { if (flagsurfaceall == 1) {T_Th3->BuildBoundaryElementAdj();} } Add2StackOfPtr2FreeRC(stack, T_Th3); *mp = mps; return T_Th3; } class DeplacementTab: public OneOperator { public: DeplacementTab (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new DeplacementTab_Op(args, t[0]->CastTo(args[0])); } }; // CheckSurfaceMesh ==> int GetBEManifold (Expression bb, Expression &label, Expression &orient); void GetNumberBEManifold (Expression surf, int &mani_nbe); void GetManifolds (Expression mani, int &nbcmanifold, int * &mani_nbe, Expression * &manifold) { if (mani) { int i, j; const E_Array *a = dynamic_cast(mani); ffassert(a); int n = a->size(); if (verbosity > 1) { cout << " the number of manifold " << n << endl; } nbcmanifold = n;// nombre de manifold définis // manifold = new Expression[n]; mani_nbe = new int[n]; int size = 0; for (i = 0; i < n; i++) { GetNumberBEManifold((*a)[i], mani_nbe[i]); cout << "number of manifold = " << n << "manifold i=" << i << "nb BE label=" << mani_nbe[i] << endl; size = size + mani_nbe[i]; } manifold = new Expression[size * 2]; int count = 0; for (i = 0; i < n; i++) { Expression tmp = (*a)[i]; const E_Array *aa = dynamic_cast(tmp); for (j = 0; j < mani_nbe[i]; j++) { if (GetBEManifold((*aa)[j], manifold[count], manifold[count + 1]) == 0) { CompileError(" a manifold is defined by a pair of [label, orientation ]"); } count = count + 2; } } assert(count == 2 * size); } } void GetNumberBEManifold (Expression surf, int &mani_nbe) { if (surf) { int i, j; if (verbosity > 1) { cout << " -- Manifoldal Condition to do" << endl; } const E_Array *a = dynamic_cast(surf); ffassert(a); mani_nbe = a->size(); } } // void GetManifold( Expression surf, int & mani_nbe, Expression * &manifold) // { // if ( surf ) // { // int i,j; // if( verbosity>1) // cout << " -- Manifoldal Condition to do" << endl; // const E_Array * a= dynamic_cast(surf); // ffassert(a); // int n = a->size()/2; // mani_nbe = n; // if( verbosity>1) // cout << " the number of face label in a manifold " << n << endl; // if( n*2 != a->size() ) // CompileError(" a manifold is defined by a pair of [label, orientation ]"); // manifold = new Expression[n*2]; // for ( i=0,j=0;i(bb); if (a && a->size() == 2) { label = to((*a)[0]); orient = to((*a)[1]); return 1; } else { return 0; } } class CheckManifoldMesh_Op: public E_F0mps { public: Expression eTh; static const int n_name_param = 1; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; int nbmanifold; int *mani_nbe; Expression *manifolds; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: CheckManifoldMesh_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) { args.SetNameParam(n_name_param, name_param, nargs); if (nargs[0]) { GetManifolds(nargs[0], nbmanifold, mani_nbe, manifolds); } else { CompileError("check ::: no definition of manifold"); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type CheckManifoldMesh_Op::name_param [] = { {"manifolds", &typeid(E_Array)} // option a rajouter // facemerge 0,1 + label }; AnyType CheckManifoldMesh_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); int size = 0; KN BeginManifold(nbmanifold + 1); for (int i = 0; i < nbmanifold; i++) { BeginManifold[i] = size; size = size + mani_nbe[i]; } BeginManifold[nbmanifold] = size; KN TabLabelManifold(size), OrientLabelManifold(size); int count = 0; for (int i = 0; i < nbmanifold; i++) { for (int j = 0; j < mani_nbe[i]; j++) { TabLabelManifold[count] = GetAny((*manifolds[2 * count])(stack)); OrientLabelManifold[count] = GetAny((*manifolds[2 * count + 1])(stack)); count++; } } assert(count == size); // int count=0; // for(int ii=0; ii ( (*surface[2*ii+1][2*jj])(stack) ); // OrientLabelVariete [count] = GetAny< long > ( (*surface[2*ii+1][2*jj+1])(stack) ); // count++; // } // } // beginvariete[nbvariete]=count; long resultat = 1; pTh->BuildBoundaryElementAdj(nbmanifold, BeginManifold, TabLabelManifold, OrientLabelManifold); // nbvariete, beginvariete, TabLabelVariete, OrientLabelVariete); cout << "utilisation V2" << endl; *mp = mps; return resultat; } class CheckManifoldMesh: public OneOperator { public: CheckManifoldMesh (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new CheckManifoldMesh_Op(args, t[0]->CastTo(args[0])); } }; Mesh3*truncmesh (const Mesh3 &Th, const long &kksplit, int *split, bool kk, const int newbelabel); struct Op_trunc_mesh3: public OneOperator { typedef const Mesh3 *pmesh3; class Op: public E_F0mps { public: static basicAC_F0::name_and_type name_param []; static const int n_name_param = 5; Expression nargs[n_name_param]; Expression getmesh, bbb; long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} bool arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : 0;} Op (const basicAC_F0 &args, Expression t, Expression b): getmesh(t), bbb(b) {args.SetNameParam(n_name_param, name_param, nargs);} AnyType operator () (Stack s) const; }; E_F0*code (const basicAC_F0 &args) const {return new Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]));} Op_trunc_mesh3 (): OneOperator(atype(), atype(), atype()) {}; }; basicAC_F0::name_and_type Op_trunc_mesh3::Op::name_param[Op_trunc_mesh3::Op::n_name_param] = { {"split", &typeid(long)}, {"label", &typeid(long)}, {"new2old", &typeid(KN *)}, // ajout FH pour P. Jovilet jan 2014 {"old2new", &typeid(KN *)}, // ajout FH pour P. Jovilet jan 2014 {"renum", &typeid(bool)} }; Mesh3*truncmesh (const Mesh3 &Th, const long &kksplit, int *split, bool kk, const int newbelabel) { static const int FaceTriangle[4] = {3, 0, 1, 2};//= {{3,2,1}, {0,2,3},{ 3,1,0},{ 0,1,2}} // computation of number of border elements and vertex without split int nbe = 0, nbei = 0; int nt = 0; int nv = 0; int nvtrunc = 0; int nedge = 0; int nface = 0; double hmin = 1e100; R3 bmin, bmax; int nbeee = 0, nbfi = 0; const int kksplit2 = kksplit * kksplit; const int kksplit3 = kksplit2 * kksplit; int ntsplit = 0; int tagb[4] = {1, 2, 4, 8}; KN tagTonB(Th.nt); tagTonB = 0; for (int ibe = 0; ibe < Th.nbe; ibe++) { int iff; int it = Th.BoundaryElement(ibe, iff); tagTonB[it] |= tagb[iff]; int ifff = iff, itt = Th.ElementAdj(it, ifff); if (itt >= 0 && itt != it) { tagTonB[itt] |= tagb[ifff]; } } for (int i = 0; i < Th.nt; i++) { if (split[i]) { ++ntsplit; // computation of number of tetrahedrons nt = nt + kksplit3; // computation of number of border elements for (int j = 0; j < 4; j++) { int jt = j, it = Th.ElementAdj(i, jt); if ((it == i || it < 0) || !split[it]) { nbeee++;// boundary face ... } else { nbfi++; // internal face count 2 times ... } if (it == i || it < 0) { nbe += kksplit2;// on est sur la frontiere } else if (!split[it]) { nbe += kksplit2;// le voisin ne doit pas etre decoupe } else if ((tagTonB[i] & tagb[j]) != 0 && i < it) { nbei++, nbe += kksplit2;// internal boundary .. } } for (int e = 0; e < 6; e++) { hmin = min(hmin, Th[i].lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } } ffassert(nbfi % 2 == 0); nface = nbeee + nbfi / 2; double hseuil = (hmin / kksplit) / 1000.; if (verbosity > 5) { cout << " number of not intern boundary faces = " << nbeee << ", all faces = " << nbe << ", hseuil=" << hseuil << endl; } /* determination de bmin, bmax et hmin */ KN takevertex(Th.nv, -1); for (int i = 0; i < Th.nt; i++) { if (split[i]) { const Tet &K(Th.elements[i]); for (int ii = 0; ii < 4; ii++) { int iv = Th.operator () (K[ii]); if (takevertex[iv] == -1) { bmin = Minc(Th.vertices[iv], bmin); bmax = Maxc(Th.vertices[iv], bmax); takevertex[iv] = nvtrunc++; } } } } // take same numbering for (int i = 0, k = 0; i < Th.nv; i++) { if (takevertex[i] >= 0) {takevertex[i] = k++;}} if (kksplit > 1) { // compute the number of slip edge ... nedge = 0; HashTable, int> edges(3 * nface, nface); for (int i = 0; i < Th.nt; i++) { if (split[i]) { const Tet &K(Th.elements[i]); for (int e = 0; e < 6; ++e) { int e1 = Th(K[Th[i].nvedge[e][0]]); int e2 = Th(K[Th[i].nvedge[e][1]]); SortArray key(e1, e2); if (!edges.find(key)) { edges.add(key, nedge++); } } } } } if (verbosity > 10) { cout << " -- nvertex " << nvtrunc << ", nedges = " << nedge << ", nfaces = " << nface << " ntet =" << ntsplit << endl << " -- Euler/Poincare constante = " << nvtrunc - nedge + nface - ntsplit << endl; } /* determination des vertex, triangles et tetrahedre obtenue apres splitting dans le Simplex */ int nfacesub = kksplit2; int ntetsub = kksplit3; int nvsub = (kksplit + 1) * (kksplit + 2) * (kksplit + 3) / 6; int ntrisub = 4 * kksplit2; R3 *vertexsub; // [nvsub]; int *tetsub;// [4*ntetsub]; int *trisub;// [4*kksplit*kksplit]; SplitSimplex(kksplit, nvsub, vertexsub, ntetsub, tetsub); SplitSurfaceSimplex(kksplit, ntrisub, trisub); if (verbosity > 3) { cout << " -- trunc (3d) : Th.nv= " << Th.nv << "kksplit=" << kksplit << endl; } int ntnosplit = nt / kksplit3; int nbenosplit = nbe / kksplit2 - nbei; // warning true bounding => remove internal border int nfacenosplit = (4 * ntnosplit + nbenosplit) / 2; nv = ntnosplit * (nvsub - 4 * ((kksplit + 1) * (kksplit + 2) / 2 - 3 * (kksplit - 1) - 3) - 6 * (kksplit - 1) - 4); if (verbosity > 100) {cout << " 1) nv= " << nv << endl;} nv = nv + nfacenosplit * ((kksplit + 1) * (kksplit + 2) / 2 - 3 * (kksplit - 1) - 3); if (verbosity > 100) {cout << " 2) nv= " << nv << endl;} nv = nv + nedge * (kksplit - 1); if (verbosity > 100) {cout << " 3) nv= " << nv << endl;} nv = nv + nvtrunc; if (verbosity > 100) {cout << " 4) nv= " << nv << endl;} int itt = 0; int ie = 0; Vertex3 *v = new Vertex3[nv]; Tet *t = new Tet[nt]; Tet *tt = t; Triangle3 *b = new Triangle3[nbe]; Triangle3 *bb = b; R3 hh = (bmax - bmax) / 10.; EF23::GTree *gtree = new EF23::GTree(v, bmin - hh, bmax + hh, 0); const R3 *pP[4]; int np = 0; // nb of new points .. // first build old point to keep the numbering order for DDM ... for (int i = 0, k = 0; i < Th.nv; i++) { if (takevertex[i] >= 0) { Vertex3 *pvi = gtree->ToClose(Th(i), hseuil); if (!pvi) { (R3 &)v[np] = Th(i); v[np].lab = Th(i).lab; gtree->Add(v[np]); np++; } else {ffassert(0);} } } { KN vertextetsub(nvsub); KN newindex(nvsub); for (int i = 0; i < Th.nt; i++) { if (split[i]) { const Tet &K(Th.elements[i]); for (int ii = 0; ii < 4; ii++) { pP[ii] = &K[ii]; } for (int iv = 0; iv < nvsub; iv++) { (R3 &)vertextetsub[iv] = vertexsub[iv].Bary(pP); } for (int iv = 0; iv < nvsub; iv++) { Vertex3 *pvi = gtree->ToClose(vertextetsub[iv], hseuil); if (!pvi) { (R3 &)v[np] = vertextetsub[iv]; v[np].lab = K.lab; newindex[iv] = np; gtree->Add(v[np]); np++; } else { newindex[iv] = pvi - v; } ffassert(np <= nv); } for (int ii = 0; ii < ntetsub; ii++) { int ivt[4]; for (int jj = 0; jj < 4; jj++) { ivt[jj] = newindex[tetsub[4 * ii + jj]]; assert(tetsub[4 * ii + jj] < nvsub); assert(ivt[jj] < np); } (tt++)->set(v, ivt, K.lab); itt++; assert(itt <= nt); } for (int j = 0; j < 4; j++) { int jt = j, it = Th.ElementAdj(i, jt); if (((tagTonB[i] & tagb[j]) == 0) && !(it == i || it < 0) && !split[it]) { // new border not on boundary int ivb[3]; for (int ii = 0; ii < nfacesub; ii++) { int iface = 3 * FaceTriangle[j] * nfacesub + 3 * ii; for (int jjj = 0; jjj < 3; jjj++) { ivb[jjj] = newindex[trisub[iface + jjj]]; assert(trisub[iface + jjj] < nvsub); assert(ivb[jjj] < np); } (bb++)->set(v, ivb, newbelabel); ie++; } } assert(ie <= nbe); } } } } if (verbosity > 10) { cout << " ++ np=" << np << "== nv=" << nv << endl; } ffassert(np == nv); if (verbosity > 8) { cout << " -- Number of new border face not on Border " << ie << endl; } delete [] vertexsub;// [nvsub]; delete [] tetsub; // [4*ntetsub]; delete [] trisub; // [4*kksplit*kksplit]; // split border elements int nv2Dsub = (kksplit + 1) * (kksplit + 2) / 4; int ntri2Dsub = kksplit2; R2 *vertex2Dsub;// [nvsub]; int *tri2Dsub; // [4*kksplit*kksplit]; SplitSimplex(kksplit, nv2Dsub, vertex2Dsub, ntri2Dsub, tri2Dsub); for (int ibe = 0; ibe < Th.nbe; ibe++) { int iff; int it = Th.BoundaryElement(ibe, iff); int ifff = iff, itt = Th.ElementAdj(it, ifff); if (itt < 0) {itt = it;} if (split[it] == 0 && split[itt] == 0) { continue; // boundary not on one element } const Triangle3 &K(Th.be(ibe)); int ivv[3]; ivv[0] = Th.operator () (K[0]); ivv[1] = Th.operator () (K[1]); ivv[2] = Th.operator () (K[2]); R3 *vertextrisub = new R3[nv2Dsub]; int *newindex = new int[nv2Dsub]; for (int iv = 0; iv < nv2Dsub; iv++) { double alpha = vertex2Dsub[iv].x; double beta = vertex2Dsub[iv].y; vertextrisub[iv].x = (1 - alpha - beta) * Th.vertices[ivv[0]].x + alpha * Th.vertices[ivv[1]].x + beta * Th.vertices[ivv[2]].x; vertextrisub[iv].y = (1 - alpha - beta) * Th.vertices[ivv[0]].y + alpha * Th.vertices[ivv[1]].y + beta * Th.vertices[ivv[2]].y; vertextrisub[iv].z = (1 - alpha - beta) * Th.vertices[ivv[0]].z + alpha * Th.vertices[ivv[1]].z + beta * Th.vertices[ivv[2]].z; } for (int iv = 0; iv < nv2Dsub; iv++) { const Vertex3 &vi(vertextrisub[iv]); Vertex3 *pvi = gtree->ToClose(vi, hseuil); assert(pvi); newindex[iv] = pvi - v; } for (int ii = 0; ii < nfacesub; ii++) { int ivb[3]; for (int jjj = 0; jjj < 3; jjj++) { ivb[jjj] = newindex[tri2Dsub[3 * ii + jjj]]; assert(tri2Dsub[3 * ii + jjj] < nvsub); if (verbosity > 199) {cout << " " << ivb[jjj] << " np:" << np << endl;} assert(ivb[jjj] < np); } (bb++)->set(v, ivb, K.lab); ie++; assert(ie <= nbe); } delete [] vertextrisub; delete [] newindex; } delete [] vertex2Dsub; // [4*ntetsub]; delete [] tri2Dsub; // [4*kksplit*kksplit]; if (verbosity > 99) { cout << "nbofv initial" << Th.nv << endl; cout << "nv=" << nv << " np=" << np << endl; cout << "itt=" << itt << " nt=" << nt << endl; cout << "ie=" << ie << " nbe=" << nbe << endl; } ffassert(nv == np); ffassert(ie == nbe); ffassert(itt == nt); // delete gtree; Mesh3 *Tht = new Mesh3(nv, nt, nbe, v, t, b); Tht->BuildGTree(); // Add JM. Oct 2010 delete gtree; return Tht; } void Renumb (Fem2D::Mesh3 * &pTh) { assert(pTh); const Mesh3 &Th(*pTh); // le maillage d'origne a decoupe using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; int nbv = Th.nv; int nbt = Th.nt; int *xadg = new int[nbv + 1]; int nve = Mesh3::Rd::d + 1; xadg[0] = 0; std::vector adjncy; std::set *adjncyVec = new std::set[nbv](); for (int k = 0; k < nbt; ++k) { const Tet &K = Th[k]; for (int j = 0; j < nve - 1; ++j) { for (int i = j + 1; i < nve; ++i) { adjncyVec[Th.operator () (K[i])].insert(Th.operator () (K[j])); adjncyVec[Th.operator () (K[j])].insert(Th.operator () (K[i])); } } } int cpt = 0; for (int k = 0; k < nbv; ++k) { cpt += adjncyVec[k].size(); xadg[k + 1] = cpt; } adjncy.reserve(xadg[nbv]); for (int k = 0; k < nbv; ++k) { for (std::set::iterator it = adjncyVec[k].begin(); it != adjncyVec[k].end(); ++it) { adjncy.push_back(*it); } } delete [] adjncyVec; // renumb::i4vec_print ( nbt + 1, xadg, " ADJ_ROW:" ); // renumb::adj_print ( nbt, adjncy.size(), xadg,adjncy.data() , " ADJ" ); int bandwidth; if (verbosity > 2) { bandwidth = renumb::adj_bandwidth(nbv, adjncy.size(), xadg, &(adjncy[0])); cout << "\n"; cout << " ADJ bandwidth = " << bandwidth << "\n"; } int *perm = renumb::genrcm(nbv, adjncy.size(), xadg, &(adjncy[0])); int *perm_inv = renumb::perm_inverse3(nbv, perm); if (verbosity > 2) { bandwidth = renumb::adj_perm_bandwidth(nbv, adjncy.size(), xadg, &(adjncy[0]), perm, perm_inv); cout << "\n"; cout << " ADJ bandwidth after RCM permutation = " << bandwidth << "\n"; } delete [] xadg; int nbe = Th.nbe; Vertex3 *v = new Vertex3[nbv]; Tet *t = new Tet[nbt]; Triangle3 *b = new Triangle3[nbe]; Vertex3 *vv = v; for (int i = 0; i < nbv; i++) { const Vertex3 &V = Th(perm[i]); vv->x = V.x; vv->y = V.y; vv->z = V.z; vv->lab = V.lab; vv++; } Tet *tt = t; for (int i = 0; i < nbt; i++) { int i0 = perm_inv[Th(i, 0)], i1 = perm_inv[Th(i, 1)], i2 = perm_inv[Th(i, 2)], i3 = perm_inv[Th(i, 3)]; int ivt[4] = {i0, i1, i2, i3}; (*tt++).set(v, ivt, Th[i].lab); } Triangle3 *bb = b; for (int i = 0; i < nbe; i++) { const Triangle3 &K(Th.be(i)); int ivv[3]; ivv[0] = perm_inv[Th.operator () (K[0])]; ivv[1] = perm_inv[Th.operator () (K[1])]; ivv[2] = perm_inv[Th.operator () (K[2])]; (bb++)->set(v, ivv, K.lab); } delete [] perm_inv; delete [] perm; delete pTh; pTh = new Mesh3(nbv, nbt, nbe, v, t, b); pTh->BuildGTree(); } AnyType Op_trunc_mesh3::Op::operator () (Stack stack) const { Mesh3 *pTh = GetAny((*getmesh)(stack)); Mesh3 &Th = *pTh; long kkksplit = std::max(1L, arg(0, stack, 1L)); long label = arg(1, stack, 2L); KN *pn2o = arg(2, stack); KN *po2n = arg(3, stack); bool renum = arg(4, stack, false); KN split(Th.nt); split = kkksplit; MeshPoint *mp = MeshPointStack(stack), mps = *mp; long kk = 0; long ks = kkksplit * kkksplit * kkksplit; for (int k = 0; k < Th.nt; k++) { const Tet &K(Th.elements[k]); R3 B(1. / 4., 1. / 4., 1. / 4.);// 27/09/10 : J.Morice error in msh3.cpp mp->set(Th, K(B), B, K, 0); if (GetAny((*bbb)(stack))) {kk++;} else {split[k] = 0;} } // *mp=mps; if (verbosity > 1) { cout << " -- Trunc mesh: Nb of Tetrahedrons = " << kk << " label=" << label << endl; } Mesh3 *Tht = truncmesh(Th, kkksplit, split, false, label); if (pn2o) { pn2o->resize(kk * ks); KN &n2o(*pn2o); int l = 0; for (int k = 0; k < Th.nt; ++k) { if (split[k]) { for (int i = 0; i < ks; ++i) { n2o[l++] = k; } } } } if (po2n) { po2n->resize(Th.nt); KN &o2n(*po2n); int l = 0; for (int k = 0; k < Th.nt; ++k) { if (split[k]) { o2n[k] = l; l += ks; } else {o2n[k] = -1;}} } if (renum) {Renumb(Tht);} Add2StackOfPtr2FreeRC(stack, Tht); // 07/2008 FH *mp = mps; return Tht; }; ////////////////// // new functions added by J. Morice 05/10 // -- extractmesh2D // -- extractmesh // -- movemesh32 // projection class ExtractMesh2D_Op: public E_F0mps { public: Expression eTh; static const int n_name_param = 4; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, int j, Stack stack, KN_ a) const { if (nargs[i]) { return GetAny >((*nargs[i])(stack)); } else { return nargs[j] ? GetAny >((*nargs[j])(stack)) : a; } } double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} // long arg(int i,Stack stack,long a ) const{ return nargs[i] ? GetAny< long >( (*nargs[i])(stack) ): a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: ExtractMesh2D_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) { if (verbosity > 1) {cout << "construction par ExtractMesh_Op" << endl;} args.SetNameParam(n_name_param, name_param, nargs); if (nargs[1] && nargs[3]) { CompileError("uncompatible extractmesh (Th, region= , reft= "); } if (nargs[0] && nargs[2]) { CompileError("uncompatible extractmesh (Th, label= , refe= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type ExtractMesh2D_Op::name_param [] = { {"refe", &typeid(KN_)}, {"reft", &typeid(KN_)}, {"label", &typeid(KN_)}, {"region", &typeid(KN_)} }; class ExtractMesh2D: public OneOperator { public: ExtractMesh2D (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new ExtractMesh2D_Op(args, t[0]->CastTo(args[0])); } }; AnyType ExtractMesh2D_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh *pTh = GetAny((*eTh)(stack)); Mesh &Th = *pTh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.neb; // nombre d'aretes fontiere KN zzempty(0); // recuperation des labels pour les surfaces et les elements KN labelface(arg(0, 2, stack, zzempty)); KN labelelement(arg(1, 3, stack, zzempty)); // a trier les tableaux d'entier int nv = 0, nt = 0, ns = 0; int boolsurf = 0; int boolelement = 0; if (nargs[0] || nargs[2]) { boolsurf = 1; } if (nargs[1] || nargs[3]) { boolelement = 1; if (boolsurf == 0) { cerr << "we need edge label to extract the mesh " << " (This will be changed in a new version of freefem++)" << endl; exit(1); } // a prevoir une fonction pour recalculer les differents labels des surfaces } if (boolsurf == 1 && boolelement == 1) { // Volumetric mesh KN takevertex(Th.nv, -1); KN takeelem(Th.nt, 0); KN takebe(Th.neb, 0); int neLab = 0; for (int ie = 0; ie < Th.nt; ie++) { const Mesh::Triangle &K(Th.t(ie)); for (int ii = 0; ii < labelelement.N(); ii++) { if (K.lab == labelelement[ii]) { neLab++; takeelem[ie] = 1; for (int jj = 0; jj < 3; jj++) { if (takevertex[Th.operator () (K[jj])] != -1) {continue;} takevertex[Th.operator () (K[jj])] = nv; nv++; } break; } } } int nbeLab = 0; for (int ibe = 0; ibe < Th.neb; ibe++) { const Mesh::BorderElement &K(Th.be(ibe)); for (int ii = 0; ii < labelface.N(); ii++) { if (K.lab == labelface[ii]) { nbeLab++; takebe[ibe] = 1; for (int jj = 0; jj < 2; jj++) { if (takevertex[Th.operator () (K[jj])] == -1) { cerr << "Volumetric extract mesh: error in the definition of surface mesh " << endl; cerr << "The edges of label " << labelface[ii] << " is not the extract mesh " << endl; } } break; } } } ns = nbeLab; nt = neLab; if (nt == 0) {cerr << " The label of 2D element is not correct :: there is no element" << endl; exit(1);} Mesh::Vertex *v = new Mesh::Vertex[nv]; Mesh::Triangle *t = new Mesh::Triangle[nt]; Mesh::Triangle *tt = t; Mesh::BorderElement *b = new Mesh::BorderElement[ns]; Mesh::BorderElement *bb = b; for (int ii = 0; ii < Th.nv; ii++) { if (takevertex[ii] == -1) {continue;} int iv = takevertex[ii]; assert(iv >= 0 && iv < nv); v[iv].x = Th.vertices[ii].x; v[iv].y = Th.vertices[ii].y; v[iv].lab = Th.vertices[ii].lab; } for (int ie = 0; ie < Th.nt; ie++) { if (takeelem[ie] != 1) {continue;} const Mesh::Triangle &K(Th.t(ie)); int ivv[3]; for (int jj = 0; jj < 3; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (tt++)->set(v, ivv[0], ivv[1], ivv[2], K.lab); } for (int ibe = 0; ibe < Th.neb; ibe++) { if (takebe[ibe] != 1) {continue;} const Mesh::BorderElement &K(Th.be(ibe)); int ivv[2]; for (int jj = 0; jj < 2; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (bb++)->set(v, ivv[0], ivv[1], K.lab); } Mesh *pThnew = new Mesh(nv, nt, ns, v, t, b); // attention aux composantes connexes. // Lorenzo R2 Pn, Px; pThnew->BoundingBox(Pn, Px); if (!pThnew->quadtree) { pThnew->quadtree = new Fem2D::FQuadTree(pTh, Pn, Px, pTh->nv); } // Lorenzo return pThnew; } if (boolsurf == 1 && boolelement == 0) { // case only surface mesh // demander à F. pour la pertinence KN takevertex(Th.nv, -1); KN takebe(Th.neb, 0); int nbeLab = 0; for (int ibe = 0; ibe < Th.neb; ibe++) { const Mesh::BorderElement &K(Th.be(ibe)); for (int ii = 0; ii < labelface.N(); ii++) { if (K.lab == labelface[ii]) { nbeLab++; takebe[ibe] = 1; for (int jj = 0; jj < 2; jj++) { if (takevertex[Th.operator () (K[jj])] != -1) {continue;} takevertex[Th.operator () (K[jj])] = nv; nv++; } break; } } } ns = nbeLab; Mesh::Vertex *v = new Mesh::Vertex[nv]; Mesh::BorderElement *b = new Mesh::BorderElement[ns]; Mesh::BorderElement *bb = b; for (int ii = 0; ii < Th.nv; ii++) { if (takevertex[ii] == -1) {continue;} int iv = takevertex[ii]; assert(iv >= 0 && iv < nv); v[iv].x = Th.vertices[ii].x; v[iv].y = Th.vertices[ii].y; v[iv].lab = Th.vertices[ii].lab; } for (int ibe = 0; ibe < Th.neb; ibe++) { if (takebe[ibe] != 1) {continue;} const Mesh::BorderElement &K(Th.be(ibe)); int ivv[2]; for (int jj = 0; jj < 2; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (bb++)->set(v, ivv[0], ivv[1], K.lab); } Mesh *pThnew = 0; //= new Mesh(nv,ns,v,b); // a definir // attention aux composantes connexes. ffassert(0); return pThnew; } return (Mesh *)0; } ////////////////////////////////// // // // Fin du 2D // // ////////////////////////////////// ////////////////////////////////// // // // Debut du 3D // // /////////////////////////////////////////////////////////// // recuperer une partie du maillage à l'aide des labels class ExtractMesh_Op: public E_F0mps { public: Expression eTh; static const int n_name_param = 4; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, int j, Stack stack, KN_ a) const { if (nargs[i]) { return GetAny >((*nargs[i])(stack)); } else { return nargs[j] ? GetAny >((*nargs[j])(stack)) : a; } } double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: ExtractMesh_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) { if (verbosity > 1) {cout << "construction par ExtractMesh_Op" << endl;} args.SetNameParam(n_name_param, name_param, nargs); if (nargs[1] && nargs[3]) { CompileError("uncompatible extractmesh (Th, region= , reftet= "); } if (nargs[0] && nargs[2]) { CompileError("uncompatible extractmesh (Th, label= , refface= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type ExtractMesh_Op::name_param [] = { {"refface", &typeid(KN_)}, {"reftet", &typeid(KN_)}, {"label", &typeid(KN_)}, {"region", &typeid(KN_)}, }; class ExtractMesh: public OneOperator { public: ExtractMesh (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new ExtractMesh_Op(args, t[0]->CastTo(args[0])); } }; AnyType ExtractMesh_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); Mesh3 &Th = *pTh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere KN zzempty(0); KN labelface(arg(0, 2, stack, zzempty)); KN labelelement(arg(1, 3, stack, zzempty)); // a trier les tableaux d'entier int nv = 0, nt = 0, ns = 0; int boolsurf = 0; int boolelement = 0; if (nargs[0] || nargs[2]) { boolsurf = 1; } if (nargs[1] || nargs[3]) { boolelement = 1; } cout << " labelface.N() " << labelface.N() << endl; for (int ii = 0; ii < labelface.N(); ii++) { cout << ii << " " << labelface[ii] << endl; } cout << " labelelement.N() " << labelelement.N() << endl; for (int ii = 0; ii < labelelement.N(); ii++) { cout << ii << " " << labelelement[ii] << endl; } if (boolsurf == 1 && boolelement == 1) { // case only surface mesh KN takevertex(Th.nv, -1); KN takeelem(Th.nt, 0); KN takebe(Th.nbe, 0); int neLab = 0; for (int ie = 0; ie < Th.nt; ie++) { const Tet &K(Th.elements[ie]); for (int ii = 0; ii < labelelement.N(); ii++) { if (K.lab == labelelement[ii]) { neLab++; takeelem[ie] = 1; for (int jj = 0; jj < 4; jj++) { if (takevertex[Th.operator () (K[jj])] != -1) {continue;} takevertex[Th.operator () (K[jj])] = nv; nv++; } break; } } } int nbeLab = 0; for (int ibe = 0; ibe < Th.nbe; ibe++) { const Triangle3 &K(Th.be(ibe)); for (int ii = 0; ii < labelface.N(); ii++) { if (K.lab == labelface[ii]) { nbeLab++; takebe[ibe] = 1; for (int jj = 0; jj < 3; jj++) { if (takevertex[Th.operator () (K[jj])] == -1) { int iivv = Th.operator () (K[jj]); cerr << "Error(Extract Mesh):: the vertex (" << Th.vertices[iivv].x << ", " << Th.vertices[iivv].y << ", " << Th.vertices[iivv].z << ") is not in the volume mesh" << endl; } // continue; // takevertex[ Th.operator()(K[jj]) ] = nv; // nv++; } break; } } } ns = nbeLab; nt = neLab; cout << nt << " " << ns << endl; if (nt == 0) {cerr << " The label of 3D element is not correct :: there is no element" << endl; exit(1);} Vertex3 *v = new Vertex3[nv]; Tet *t = new Tet[nt]; Tet *tt = t; Triangle3 *b = new Triangle3[ns]; Triangle3 *bb = b; for (int ii = 0; ii < Th.nv; ii++) { if (takevertex[ii] == -1) {continue;} int iv = takevertex[ii]; assert(iv >= 0 && iv < nv); v[iv].x = Th.vertices[ii].x; v[iv].y = Th.vertices[ii].y; v[iv].z = Th.vertices[ii].z; v[iv].lab = Th.vertices[ii].lab; } for (int ie = 0; ie < Th.nt; ie++) { if (takeelem[ie] != 1) {continue;} const Tet &K(Th.elements[ie]); int ivv[4]; for (int jj = 0; jj < 4; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (tt++)->set(v, ivv, K.lab); } for (int ibe = 0; ibe < Th.nbe; ibe++) { if (takebe[ibe] != 1) {continue;} const Triangle3 &K(Th.be(ibe)); int ivv[3]; for (int jj = 0; jj < 3; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (bb++)->set(v, ivv, K.lab); } Mesh3 *pThnew = new Mesh3(nv, nt, ns, v, t, b); // peut etre a définir ??? // attention aux composantes connexes. pThnew->BuildGTree(); // Lorenzo return pThnew; } if (boolsurf == 1 && boolelement == 0) { KN takevertex(Th.nv, -1); for (int iv = 0; iv < Th.nv; iv++) { takevertex[iv] = -1; } KN takebe(Th.nbe, -1); for (int iv = 0; iv < Th.nv; iv++) { takebe[iv] = -1; } int nbeLab = 0; for (int ibe = 0; ibe < Th.nbe; ibe++) { const Triangle3 &K(Th.be(ibe)); for (int ii = 0; ii < labelface.N(); ii++) { if (K.lab == labelface[ii]) { nbeLab++; cout << "takeface" << endl; takebe[ibe] = 1; for (int jj = 0; jj < 3; jj++) { if (takevertex[Th.operator () (K[jj])] != -1) {continue;} takevertex[Th.operator () (K[jj])] = nv; nv++; } // break; } } } ns = nbeLab; Vertex3 *v = new Vertex3[nv]; Triangle3 *b = new Triangle3[ns]; Triangle3 *bb = b; for (int ii = 0; ii < Th.nv; ii++) { if (takevertex[ii] == -1) {continue;} int iv = takevertex[ii]; assert(iv >= 0 && iv < nv); v[iv].x = Th.vertices[ii].x; v[iv].y = Th.vertices[ii].y; v[iv].z = Th.vertices[ii].z; v[iv].lab = Th.vertices[ii].lab; } for (int ibe = 0; ibe < Th.nbe; ibe++) { if (takebe[ibe] != 1) {continue;} const Triangle3 &K(Th.be(ibe)); int ivv[3]; for (int jj = 0; jj < 3; jj++) { ivv[jj] = takevertex[Th.operator () (K[jj])]; } (bb++)->set(v, ivv, K.lab); } cout << " nv" << nv << " ns " << endl; Mesh3 *pThnew = new Mesh3(nv, ns, v, b); pThnew->BuildGTree(); // Lorenzo return pThnew; } Mesh3 *pThnew = NULL; return pThnew; } bool AddLayers (Mesh3 const *const &pTh, KN *const &psupp, long const &nlayer, KN *const &pphi) { ffassert(pTh && psupp && pphi); const int nve = Mesh3::Element::nv; const Mesh3 &Th = *pTh; const int nt = Th.nt; const int nv = Th.nv; KN &supp(*psupp); KN u(nv), s(nt); KN &phi(*pphi); ffassert(supp.N() == nt); // P0 ffassert(phi.N() == nv);// P1 s = supp; phi = 0.; // supp = 0.; // cout << " s " << s << endl; for (int step = 0; step < nlayer; ++step) { u = 0.; for (int k = 0; k < nt; ++k) { for (int i = 0; i < nve; ++i) { u[Th(k, i)] += s[k]; } } for (int v = 0; v < nv; ++v) { u[v] = u[v] > 0.; } // cout << " u " << u << endl; phi += u; s = 0.; for (int k = 0; k < nt; ++k) { for (int i = 0; i < nve; ++i) { s[k] += u[Th(k, i)]; } } for (int k = 0; k < nt; ++k) { s[k] = s[k] > 0.; } supp += s; // cout << " s " << s << endl; } // cout << " phi " << phi << endl; phi *= (1. / nlayer); // supp =s; return true; } Mesh3*GluMesh3tab (KN *const &tab, long const &lab_delete) { int flagsurfaceall = 0; int nbt = 0; int nbe = 0; int nbex = 0; int nbv = 0; int nbvx = 0; double hmin = 1e100; R3 Pn(1e100, 1e100, 1e100), Px(-1e100, -1e100, -1e100); const Mesh3 *th0 = 0; for (int i = 0; i < tab->n; i++) { const Mesh3 &Th3(*tab->operator [] (i)); th0 = &Th3; if (verbosity > 1) {cout << " determination of hmin : GluMesh3D + " << Th3.nv << " " << Th3.nt << " " << Th3.nbe << endl;} nbt += Th3.nt; nbvx += Th3.nv; nbex += Th3.nbe; for (int k = 0; k < Th3.nt; k++) { for (int e = 0; e < 6; e++) { hmin = min(hmin, Th3[k].lenEdge(e));// calcul de .lenEdge pour un Mesh3 } } for (int k = 0; k < Th3.nbe; k++) { for (int e = 0; e < 3; e++) { hmin = min(hmin, Th3.be(k).lenEdge(e)); // calcul de .lenEdge pour un Mesh3 } } for (int ii = 0; ii < Th3.nv; ii++) { R3 P(Th3.vertices[ii].x, Th3.vertices[ii].y, Th3.vertices[ii].z); Pn = Minc(P, Pn); Px = Maxc(P, Px); } } if (verbosity > 1) {cout << " - hmin =" << hmin << " , Bounding Box: " << Pn << " " << Px << endl;} // probleme memoire Vertex3 *v = new Vertex3[nbvx]; Tet *t; if (nbt != 0) {t = new Tet[nbt];} Tet *tt = t; Triangle3 *b = new Triangle3[nbex]; Triangle3 *bb = b; ffassert(hmin > Norme2(Pn - Px) / 1e9); double hseuil = hmin / 10.; // int *NumSom= new int[nbvx]; // VERSION morice if (verbosity > 1) {cout << " creation of : BuildGTree" << endl;} EF23::GTree *gtree = new EF23::GTree(v, Pn, Px, 0); nbv = 0; // int nbv0=0; for (int i = 0; i < tab->n; i++) { const Mesh3 &Th3(*tab->operator [] (i)); if (verbosity > 1) {cout << " loop over mesh for create new mesh " << endl;} if (verbosity > 1) {cout << " GluMesh3D + " << Th3.nv << " " << Th3.nt << " " << Th3.nbe << endl;} // nbv0 =+Th3.nv; for (int ii = 0; ii < Th3.nv; ii++) { const Vertex3 &vi(Th3.vertices[ii]); Vertex3 *pvi = gtree->ToClose(vi, hseuil); if (!pvi) { v[nbv].x = vi.x; v[nbv].y = vi.y; v[nbv].z = vi.z; v[nbv].lab = vi.lab; // NumSom[ii+nbv0] = nbv; gtree->Add(v[nbv]); nbv++; } /* * else{ * NumSom[ii+nbv0] = pvi-v; * assert(pvi-v ToClose(K[0], hseuil) - v; iv[1] = gtree->ToClose(K[1], hseuil) - v; iv[2] = gtree->ToClose(K[2], hseuil) - v; iv[3] = gtree->ToClose(K[3], hseuil) - v; (tt++)->set(v, iv, K.lab); } // nbv0 =+Th3.nv; } if (verbosity > 1) {cout << " creation of : BuildGTree for border elements" << endl;} Vertex3 *becog = new Vertex3[nbex]; // Vertex3 becog[nbex]; EF23::GTree *gtree_be = new EF23::GTree(becog, Pn, Px, 0); double hseuil_border = hseuil / 3; // nbv0=0; for (int i = 0; i < tab->n; i++) { const Mesh3 &Th3(*tab->operator [] (i)); for (int k = 0; k < Th3.nbe; k++) { const Triangle3 &K(Th3.be(k)); if ((K.lab != lab_delete)) {// &&(K.lab != 3)) int iv[3]; iv[0] = Th3.operator () (K[0]); iv[1] = Th3.operator () (K[1]); iv[2] = Th3.operator () (K[2]); R cdgx, cdgy, cdgz; cdgx = (Th3.vertices[iv[0]].x + Th3.vertices[iv[1]].x + Th3.vertices[iv[2]].x) / 3.; cdgy = (Th3.vertices[iv[0]].y + Th3.vertices[iv[1]].y + Th3.vertices[iv[2]].y) / 3.; cdgz = (Th3.vertices[iv[0]].z + Th3.vertices[iv[1]].z + Th3.vertices[iv[2]].z) / 3.; const R3 r3vi(cdgx, cdgy, cdgz); const Vertex3 &vi(r3vi); Vertex3 *pvi = gtree_be->ToClose(vi, hseuil_border); if (!pvi) { becog[nbe].x = vi.x; becog[nbe].y = vi.y; becog[nbe].z = vi.z; becog[nbe].lab = vi.lab; gtree_be->Add(becog[nbe++]); int igluv[3]; igluv[0] = gtree->ToClose(K[0], hseuil) - v;// NumSom[iv[0]+nbv0]; igluv[1] = gtree->ToClose(K[1], hseuil) - v;// NumSom[iv[1]+nbv0]; igluv[2] = gtree->ToClose(K[2], hseuil) - v;// NumSom[iv[2]+nbv0]; (bb++)->set(v, igluv, K.lab); } } } // nbv0 =+Th3.nv; } delete gtree; delete gtree_be; delete [] becog; if (verbosity > 2) {cout << " nbv=" << nbv << endl;} if (verbosity > 2) {cout << " nbvx=" << nbvx << endl;} if (verbosity > 2) {cout << " nbt=" << nbt << endl;} if (verbosity > 2) {cout << " nbe=" << nbe << endl;} if (verbosity > 2) {cout << " nbex=" << nbex << endl;} if (verbosity > 1) { cout << " Nb of glu3D point " << nbvx - nbv; cout << " Nb of glu3D Boundary faces " << nbex - nbe << endl; } if (nbt == 0) { Mesh3 *mpq = new Mesh3(nbv, nbe, v, b); if (flagsurfaceall == 1) {mpq->BuildBoundaryElementAdj();} return mpq; } else { Mesh3 *mpq = new Mesh3(nbv, nbt, nbe, v, t, b); /* * mpq->BuildBound(); * if(verbosity > 1) cout << "fin de BuildBound" << endl; * mpq->BuildAdj(); * if(verbosity > 1) cout << "fin de BuildAdj" << endl; * mpq->Buildbnormalv(); * if(verbosity > 1) cout << "fin de Buildnormalv()" << endl; * mpq->BuildjElementConteningVertex(); * if(verbosity > 1) cout << "fin de ConteningVertex()" << endl; */ mpq->BuildGTree(); if (verbosity > 2) {cout << "fin de BuildGTree()" << endl;} // Add2StackOfPtr2FreeRC(stack,mpq); return mpq; } } struct Op_GluMesh3tab: public OneOperator { typedef const Mesh3 *pmesh3; class Op: public E_F0mps { public: static basicAC_F0::name_and_type name_param []; static const int n_name_param = 1; Expression nargs[n_name_param]; Expression getmeshtab; long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} Op (const basicAC_F0 &args, Expression t): getmeshtab(t) {args.SetNameParam(n_name_param, name_param, nargs);} AnyType operator () (Stack s) const; }; E_F0*code (const basicAC_F0 &args) const {return new Op(args, t[0]->CastTo(args[0]));} Op_GluMesh3tab (): OneOperator(atype(), atype *>()) {}; }; basicAC_F0::name_and_type Op_GluMesh3tab::Op::name_param[Op_GluMesh3tab::Op::n_name_param] = { {"labtodel", &typeid(long)} }; AnyType Op_GluMesh3tab::Op::operator () (Stack stack) const { KN *tab = GetAny *>((*getmeshtab)(stack)); long labtodel = arg(0, stack, LONG_MIN); Mesh3 *Tht = GluMesh3tab(tab, labtodel); Add2StackOfPtr2FreeRC(stack, Tht); return Tht; } long BuildBoundaryElementAdj (const Mesh3 &Th, bool check = 0, KN *pborder = 0) { typedef Mesh3::Element T; typedef Mesh3::Vertex V; typedef Mesh3::BorderElement B; // Return in TheBorderElementAjacencesLink // if exist a link :: sign(nk_link)*(nk_link+1) // else :: sign(nk)*(nk) // assert(TheBoundaryElementAdjacencesLink==0); plus tard int nbe = Th.nbe; int nv = Th.nv; int *TheBoundaryElementAdjacencesLink = new int[B::nea * nbe]; HashTable, int> h(B::nea *nbe, nv); int nk = 0; int err = 0, err3 = 0; int sens; int debug = verbosity > 999; if (verbosity > 9) { cout << "nea/nva" << B::nea << " " << B::nva << endl; } for (int k = 0; k < nbe; ++k) { for (int i = 0; i < B::nea; ++i) { SortArray a(Th.items(k, i, &sens)); HashTable, int>::iterator p = h.find(a); if (!p) { h.add(a, nk); TheBoundaryElementAdjacencesLink[nk] = sens * (nk + 1); // sens; } else { ASSERTION(p->v >= 0); if (sens * TheBoundaryElementAdjacencesLink[p->v] > 0) { const B &K(Th.be(k)); int firstVertex = Th(K[B::nvadj[i][0]]) + 1; int secondVertex = Th(K[B::nvadj[i][1]]) + 1; if (err < 100 && check) { cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << ", is oriented in the same direction in element " << k + 1 << " and in element " << 1 + (p->v / B::nea) << endl; } err++; } if (abs(TheBoundaryElementAdjacencesLink[p->v]) != 1 + p->v) { const B &K(Th.be(k)); int firstVertex = Th(K[B::nvadj[i][0]]) + 1; int secondVertex = Th(K[B::nvadj[i][1]]) + 1; if (err3 < 100 && check) { cout << " The edges defined by vertex is " << firstVertex << "-" << secondVertex << "belong to the three border elements ::" << 1 + (p->v) / B::nea << ", " << k + 1 << " and " << 1 + (abs(TheBoundaryElementAdjacencesLink[p->v]) - 1) / B::nea << endl; cout << " The Surface contains these edges is not a manifold" << endl; } err3++; } TheBoundaryElementAdjacencesLink[nk] = TheBoundaryElementAdjacencesLink[p->v]; TheBoundaryElementAdjacencesLink[p->v] = sens * (nk + 1); } nk++; } } if (err && err3 && check) {ExecError(" The surface mesh in no manifold ");} long nb = 0, mk = 0; int nc = 0; KN nx(nv), ns(nv), mark(nv); nx = -1;// no next mark = mk; // mark { int errv = 0; nk = 0; for (int k = 0; k < nbe; ++k) { for (int i = 0; i < B::nea; ++i) { if (abs(TheBoundaryElementAdjacencesLink[nk]) == nk + 1) { nb++; const B &K(Th.be(k)); int v0 = Th(K[B::nvadj[i][0]]); int v1 = Th(K[B::nvadj[i][1]]); if (nx[v0] >= 0) {errv++;} else {nx[v0] = v1;} if (debug) {cout << v0 << " " << v1 << endl;} } nk++; } } if (errv) { cout << " nb of crossing case " << errv; ExecError(" Boundary of surface crossing ???"); } mk++; for (int i = 0, m = 0; i < nv; ++i) { if (nx[i] >= 0 && mark[i] != mk) { int p = i; ns[nc++] = i; // start while (nx[p] >= 0 && mark[p] != mk) { mark[p] = mk; int pn = nx[p]; if (debug) {cout << p << " -> " << pn << endl;} p = pn; } } } if (verbosity > 3) {cout << " nb curve in boundary of manifold = " << nc << " " << pborder << endl;} if (pborder) { pborder->resize(nb + nc + 1); KN &bd = *pborder; int j = nc + 1; for (int c = 0; c < nc; ++c) { bd[c] = j; int p = ns[c]; mk++; while (nx[p] >= 0 && mark[p] != mk) { mark[p] = mk; int pn = nx[p]; if (debug) {cout << j << " " << p << " -> " << pn << endl;} bd[j++] = p; p = pn; } bd[c + 1] = j; } if (debug) {cout << j << " " << nc << " " << nb << endl;} ffassert(j == nc + 1 + nb); } } delete [] TheBoundaryElementAdjacencesLink; if (verbosity) {cout << "number of adjacents edges " << nk << " nb border edge :" << nb << " " << nc << endl;} return nc; } long ShowBorder (const Mesh3 *pth) { return BuildBoundaryElementAdj(*pth); } long GetBorder (const Mesh3 *pth, KN *pb) { return BuildBoundaryElementAdj(*pth, 0, pb); } // <> because i include this file in tetgen.cpp (very bad) [[file:tetgen.cpp::WITH_NO_INIT]] // ORIG-DATE: September 2017 // -*- Mode : c++ -*% // // SUMMARY : interface avec le logiciel gmsh // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Frederic Hecht // E-MAIL : Frederic Hecht@ann.jussieu.fr // /* * 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 */ // FH July 2017 a cartienne cube // #include "ff++.hpp" using namespace Fem2D; // genere with split-Hexa-simplexe.cpp (Thank to D. Bernardi) const int nbsimplexes = 58; const int simplexes[nbsimplexes][4] = { { /* - 0 */ 5, 3, 6, 7}, { /* - 1 */ 5, 2, 6, 7}, { /* - 2 */ 5, 1, 6, 7}, { /* - 3 */ 5, 0, 6, 7}, { /* - 4 */ 4, 3, 6, 7}, { /* - 5 */ 4, 2, 6, 7}, { /* - 6 */ 4, 1, 6, 7}, { /* - 7 */ 4, 0, 6, 7}, { /* + 8 */ 1, 3, 6, 7}, { /* + 9 */ 0, 3, 6, 7}, { /* + 10 */ 1, 2, 6, 7}, { /* + 11 */ 0, 2, 6, 7}, { /* + 12 */ 3, 4, 5, 7}, { /* + 13 */ 2, 4, 5, 7}, { /* + 14 */ 1, 4, 5, 7}, { /* + 15 */ 0, 4, 5, 7}, { /* - 16 */ 3, 2, 5, 7}, { /* - 17 */ 3, 0, 5, 7}, { /* + 18 */ 1, 2, 5, 7}, { /* - 19 */ 1, 0, 5, 7}, { /* - 20 */ 3, 2, 4, 7}, { /* + 21 */ 1, 3, 4, 7}, { /* + 22 */ 1, 2, 4, 7}, { /* + 23 */ 0, 2, 4, 7}, { /* - 24 */ 1, 0, 4, 7}, { /* - 25 */ 2, 1, 3, 7}, { /* - 26 */ 2, 0, 3, 7}, { /* + 27 */ 0, 1, 3, 7}, { /* + 28 */ 0, 1, 2, 7}, { /* + 29 */ 3, 4, 5, 6}, { /* + 30 */ 2, 4, 5, 6}, { /* + 31 */ 1, 4, 5, 6}, { /* + 32 */ 0, 4, 5, 6}, { /* - 33 */ 3, 2, 5, 6}, { /* - 34 */ 3, 1, 5, 6}, { /* - 35 */ 3, 0, 5, 6}, { /* - 36 */ 2, 0, 5, 6}, { /* - 37 */ 1, 0, 5, 6}, { /* - 38 */ 3, 2, 4, 6}, { /* - 39 */ 3, 0, 4, 6}, { /* + 40 */ 1, 2, 4, 6}, { /* - 41 */ 1, 0, 4, 6}, { /* - 42 */ 2, 1, 3, 6}, { /* - 43 */ 2, 0, 3, 6}, { /* + 44 */ 0, 1, 3, 6}, { /* + 45 */ 0, 1, 2, 6}, { /* + 46 */ 1, 3, 4, 5}, { /* + 47 */ 0, 3, 4, 5}, { /* + 48 */ 1, 2, 4, 5}, { /* + 49 */ 0, 2, 4, 5}, { /* - 50 */ 2, 1, 3, 5}, { /* - 51 */ 2, 0, 3, 5}, { /* + 52 */ 0, 1, 3, 5}, { /* + 53 */ 0, 1, 2, 5}, { /* - 54 */ 2, 1, 3, 4}, { /* - 55 */ 2, 0, 3, 4}, { /* + 56 */ 0, 1, 3, 4}, { /* + 57 */ 0, 1, 2, 4}}; const int nhex_decoupe = 74; const int hex_decoupe[74][7] = {// 74 { /* 1 */ 5, 57, 22, 25, 14, 5, -1}, { /* 2 */ 5, 32, 35, 52, 43, 0, -1}, { /* 1 */ 6, 57, 54, 46, 29, 38, 0}, { /* 2 */ 6, 57, 54, 46, 12, 20, 5}, { /* 3 */ 6, 57, 54, 46, 12, 4, 38}, { /* 4 */ 6, 57, 54, 21, 14, 20, 5}, { /* 5 */ 6, 57, 54, 21, 14, 4, 38}, { /* 6 */ 6, 57, 48, 50, 33, 30, 0}, { /* 7 */ 6, 57, 48, 50, 16, 13, 5}, { /* 8 */ 6, 57, 48, 50, 16, 1, 30}, { /* 9 */ 6, 57, 48, 18, 25, 13, 5}, { /* 10 */ 6, 57, 48, 18, 25, 1, 30}, { /* 11 */ 6, 57, 40, 42, 34, 31, 0}, { /* 12 */ 6, 57, 40, 42, 8, 6, 14}, { /* 13 */ 6, 57, 40, 42, 8, 2, 31}, { /* 14 */ 6, 57, 40, 10, 25, 6, 14}, { /* 15 */ 6, 57, 40, 10, 25, 2, 31}, { /* 16 */ 6, 55, 56, 46, 29, 38, 0}, { /* 17 */ 6, 55, 56, 46, 12, 20, 5}, { /* 18 */ 6, 55, 56, 46, 12, 4, 38}, { /* 19 */ 6, 55, 56, 21, 14, 20, 5}, { /* 20 */ 6, 55, 56, 21, 14, 4, 38}, { /* 21 */ 6, 55, 47, 52, 29, 38, 0}, { /* 22 */ 6, 55, 47, 52, 12, 20, 5}, { /* 23 */ 6, 55, 47, 52, 12, 4, 38}, { /* 24 */ 6, 49, 53, 50, 33, 30, 0}, { /* 25 */ 6, 49, 53, 50, 16, 13, 5}, { /* 26 */ 6, 49, 53, 50, 16, 1, 30}, { /* 27 */ 6, 49, 53, 18, 25, 13, 5}, { /* 28 */ 6, 49, 53, 18, 25, 1, 30}, { /* 29 */ 6, 49, 51, 52, 33, 30, 0}, { /* 30 */ 6, 49, 51, 52, 16, 13, 5}, { /* 31 */ 6, 49, 51, 52, 16, 1, 30}, { /* 32 */ 6, 41, 45, 42, 34, 31, 0}, { /* 33 */ 6, 41, 45, 42, 8, 6, 14}, { /* 34 */ 6, 41, 45, 42, 8, 2, 31}, { /* 35 */ 6, 41, 45, 10, 25, 6, 14}, { /* 36 */ 6, 41, 45, 10, 25, 2, 31}, { /* 37 */ 6, 41, 44, 43, 34, 31, 0}, { /* 38 */ 6, 41, 44, 43, 8, 6, 14}, { /* 39 */ 6, 41, 44, 43, 8, 2, 31}, { /* 40 */ 6, 39, 56, 46, 29, 0, 43}, { /* 41 */ 6, 39, 56, 46, 12, 4, 43}, { /* 42 */ 6, 39, 56, 21, 14, 4, 43}, { /* 43 */ 6, 39, 47, 52, 29, 0, 43}, { /* 44 */ 6, 39, 47, 52, 12, 4, 43}, { /* 45 */ 6, 32, 37, 45, 42, 34, 0}, { /* 46 */ 6, 32, 37, 45, 42, 8, 2}, { /* 47 */ 6, 32, 37, 45, 10, 25, 2}, { /* 48 */ 6, 32, 37, 44, 43, 34, 0}, { /* 49 */ 6, 32, 37, 44, 43, 8, 2}, { /* 50 */ 6, 32, 36, 53, 50, 33, 0}, { /* 51 */ 6, 32, 36, 53, 50, 16, 1}, { /* 52 */ 6, 32, 36, 53, 18, 25, 1}, { /* 53 */ 6, 32, 36, 51, 52, 33, 0}, { /* 54 */ 6, 32, 36, 51, 52, 16, 1}, { /* 55 */ 6, 32, 3, 19, 28, 11, 25}, { /* 56 */ 6, 32, 3, 19, 27, 26, 11}, { /* 57 */ 6, 32, 3, 19, 27, 9, 43}, { /* 58 */ 6, 32, 3, 17, 52, 26, 11}, { /* 59 */ 6, 32, 3, 17, 52, 9, 43}, { /* 60 */ 6, 23, 28, 24, 14, 25, 5}, { /* 61 */ 6, 23, 28, 19, 15, 25, 5}, { /* 62 */ 6, 23, 26, 27, 24, 14, 5}, { /* 63 */ 6, 23, 26, 27, 19, 15, 5}, { /* 64 */ 6, 23, 26, 17, 52, 15, 5}, { /* 65 */ 6, 7, 24, 28, 11, 25, 14}, { /* 66 */ 6, 7, 24, 27, 26, 11, 14}, { /* 67 */ 6, 7, 24, 27, 9, 43, 14}, { /* 68 */ 6, 7, 15, 19, 28, 11, 25}, { /* 69 */ 6, 7, 15, 19, 27, 26, 11}, { /* 70 */ 6, 7, 15, 19, 27, 9, 43}, { /* 71 */ 6, 7, 15, 17, 52, 26, 11}, { /* 72 */ 6, 7, 15, 17, 52, 9, 43}}; class Cube_Op: public E_F0mps { public: Expression filename; static const int n_name_param = 3; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param], enx, eny, enz, xx, yy, zz; public: Cube_Op (const basicAC_F0 &args, Expression nx, Expression ny, Expression nz, Expression transfo = 0) : enx(nx), eny(ny), enz(nz), xx(0), yy(0), zz(0) { args.SetNameParam(n_name_param, name_param, nargs); if (transfo) { const E_Array *a2 = dynamic_cast(transfo); int err = 0; // cout << nargs[0] << " "<< a1 << endl; // cout << nargs[1] << " "<< a2 << endl; if (a2) { if (a2->size() != 3) { CompileError("Cube (n1,n2,n3, [X,Y,Z]) "); } xx = to((*a2)[0]); yy = to((*a2)[1]); zz = to((*a2)[2]); } } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Cube_Op::name_param [] = { {"region", &typeid(long)}, {"label", &typeid(KN_)}, {"flags", &typeid(long)} }; class Cube: public OneOperator { public: int cas; Cube (): OneOperator(atype(), atype(), atype(), atype()), cas(0) {} Cube (int): OneOperator(atype(), atype(), atype(), atype(), atype()), cas(1) {} E_F0*code (const basicAC_F0 &args) const { if (cas == 0) { return new Cube_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } else { return new Cube_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } } }; struct MovePoint { Stack stack; Expression xx, yy, zz; MeshPoint *mp, mps; MovePoint (Stack ss, Expression x, Expression y, Expression z) : stack(ss), xx(x), yy(y), zz(z), mp(MeshPointStack(ss)), mps(*mp) {} ~MovePoint () { *mp = mps;} R3 eval (R3 P) { R3 Q; mp->set(P.x, P.y, P.z); Q.x = GetAny((*xx)(stack)); Q.y = GetAny((*yy)(stack)); Q.z = GetAny((*zz)(stack)); return Q; } }; Mesh3*BuildCube (long nx, long ny, long nz, long region, long *label, long kind, MovePoint *tf = 0) { const int(*const nvface)[3] = Tet::nvface; int debug = verbosity != 0 + verbosity / 10; int codesb[64], kcode[20]; int kstable = 0; if (debug) {cout << " Enter: BuildCube: " << kind << endl;} int code6 = -1; for (int i = 0; i < 64; ++i) { codesb[i] = -1; int d[6]; // for (int b = 0; b < 6; ++b) { d[b] = (i & (1 << b)) != 0; } if (d[0] == d[1] && d[2] == d[3] && d[4] == d[5]) { // stable if (debug > 3) {cout << " code stable " << i << " n " << kstable << endl;} kcode[kstable] = i; codesb[i] = kstable++; } } int df[74]; // decoupe des 6 du cube { int l8[8]; int diag[8] = {0, 0, 0, 1, 0, 1, 1, 0}; int cdiag[8] = {0, 0, 0, 0, 0, 0, 0, 0}, col = 0; for (int c = 0; c < 2; ++c) { for (int b = 0; b < 2; ++b) { for (int a = 0; a < 2; ++a) { l8[a + 2 * b + 4 * c] = 1 * (a == 0) + 2 * (a == 1) + 4 * (b == 0) + 8 * (b == 1) + 16 * (c == 0) + 32 * (c == 1); } } } for (int d = 0; d < nhex_decoupe; ++d) { int dk = 0; int dd[7] = {-1, -1, -1, -1, -1, -1, -1}; for (int kt = 2; kt <= hex_decoupe[d][0]; ++kt) { int k = hex_decoupe[d][kt]; const int *nu = simplexes[k]; for (int f = 0; f < 4; ++f) { // pour le 4 face int b = 0; int nf[3] = {nu[nvface[f][0]], nu[nvface[f][1]], nu[nvface[f][2]]}; int l = l8[nf[0]] & l8[nf[1]] & l8[nf[2]]; for (int k = 0; k < 6; ++k) { if (l == (1 << k)) {// boundary face // arete diagonal => // k = 2*i + j; // i => normal 0,1,2 , j = min , max (0,1) // vecteur i+1 %2 , i+2 %3 int ni = k / 2, j0 = k % 2; int oi = (1 << ni) * j0; int j1 = 1 << (ni + 1) % 3; int j2 = 1 << (ni + 2) % 3; if (j1 > j2) {std::swap(j1, j2);} int i4 [] = {oi, oi + j1, oi + j1 + j2, oi + j2}; // 4 sommet de la face int c1 = ++col, c2 = ++col; cdiag[i4[0]] = cdiag[i4[2]] = c1; // diag 1 cdiag[i4[1]] = cdiag[i4[3]] = c2; // diag 2 for (int e = 0; e < 3; ++e) { int i0 = nf[e], i1 = nf[(e + 1) % 3]; int di; if (cdiag[i0] == cdiag[i1]) { if (cdiag[i0] == c1) { // diag1 pointe vers plus petit numero ... di = 0; } else {// diag2 di = 1; } if (debug > 5) { cout << d << " f " << f << " k " << k << " i =" << i0 << " " << i1 << " fc =" << i4[0] << " " << i4[1] << " " << i4[2] << " " << i4[3] << " J= " << j1 << " " << j2 << " di = " << di << endl; } if (dd[k] < 0) {dd[k] = di;} else {ffassert(dd[k] == di);} } } } } } } int code = 0; for (int i = 0, p = 1; i < 6; ++i, p *= 2) { code += dd[i] * p; } if (code == 0) {code6 = d;} if (codesb[code] >= 0) { kcode[codesb[code]] = d;// save decoupe ok .. } if (debug > 3) {cout << "\t" << d << " " << code << " // " << codesb[code] << endl;} df[d] = code; } } int ntetcube = abs(kind) == 5 ? 5 : 6; if (kind != 6) {code6 = kcode[abs(kind) % kstable];} if (verbosity) {cout << " kind = " << kind << " n tet Cube = " << ntetcube << " / n slip 6 " << code6 << endl;} int nc = (nx) * (ny) * (nz); int nv = (nx + 1) * (ny + 1) * (nz + 1), nt = nc * ntetcube, nbe = 4 * (nx * ny + nx * nz + ny * nz); int nj = nx + 1; int nk = nj * (ny + 1); Vertex3 *vff = new Vertex3[nv]; double x0 = 0, y0 = 0, z0 = 0; double xd = 1. / nx, yd = 1. / ny, zd = 1. / nz; for (int p = 0, k = 0; k <= nz; ++k) { for (int j = 0; j <= ny; ++j) { for (int i = 0; i <= nx; ++i, ++p) { vff[p].x = x0 + xd * i; vff[p].y = y0 + yd * j; vff[p].z = z0 + zd * k; vff[p].lab = 1 * (i == 0) + 2 * (i == nx) + 4 * (j == 0) + 8 * (j == ny) + 16 * (k == 0) + 32 * (k == nz); if (tf) {(R3 &)vff[p] = tf->eval(vff[p]);} if (debug > 9) {cout << p << " : " << vff[p] << endl;} assert(p == i + nj * j + nk * k); } } } Tet *tff = new Tet[nt]; Triangle3 *bff = new Triangle3[nbe]; int ppinit = 0; int nff[6] = {3, 1, 0, 2, 4, 5};// renumbering for face cube int kf = 0, p = 0; for (int k = 0; k < nz; ++k) { for (int j = 0; j < ny; ++j) { for (int i = 0; i < nx; ++i) { int pair = ntetcube == 6 ? code6 : (ppinit + k + j + i) % 2; int n[8]; for (int c = 0; c < 2; ++c) { for (int b = 0; b < 2; ++b) { for (int a = 0; a < 2; ++a) { n[a + 2 * b + 4 * c] = (i + a) + nj * (j + b) + nk * (k + c); } } } if (debug > 9) { cout << " h " << n[0] << " " << n[1] << " " << n[2] << " " << n[3] << " " << n[4] << " " << n[5] << " " << n[6] << " " << n[7] << endl; } for (int d = 0; d < ntetcube; ++d) { int nu[4]; int kt = hex_decoupe[pair][d + 1]; for (int i = 0; i < 4; ++i) { nu[i] = n[simplexes[kt][i]]; assert(nu[i] >= 0 && nu[i] < nv); } tff[p].set(vff, nu, region); if (debug > 4) {cout << " tet = " << p << " " << nu[0] << " " << nu[1] << " " << nu[2] << " " << nu[3] << " / " << kt << " " << tff[p].mesure() << endl;} for (int f = 0; f < 4; ++f) { // pour le 4 face int b = 0; int nf[3] = {nu[nvface[f][0]], nu[nvface[f][1]], nu[nvface[f][2]]}; int l = vff[nf[0]].lab & vff[nf[1]].lab & vff[nf[2]].lab; for (int k = 0; k < 6; ++k) { int lk = 1 << k;// 2^k if (l == lk) { if (debug > 9) {cout << kf << " " << l << " " << k << " :" << nf[0] << " " << nf[1] << " " << nf[2] << " / " << nff[k] << endl;} int lf = label[nff[k]]; bff[kf].set(vff, nf, lf); kf++; } } } p++; } } } } if (verbosity) {cout << " Cube nv=" << nv << " nt=" << nt << " nbe=" << nbe << endl;} assert(nbe == kf); assert(nt = p); if (debug) {cout << " Out: BuildCube" << endl;} return new Mesh3(nv, nt, nbe, vff, tff, bff); } AnyType Cube_Op::operator () (Stack stack) const { long nx, ny, nz, region = 0, label [] = {1, 2, 3, 4, 5, 6}, kind = 6; nx = GetAny((*enx)(stack)); ny = GetAny((*eny)(stack)); nz = GetAny((*enz)(stack)); int renumsurf = 0; if (nargs[0]) {region = GetAny((*nargs[0])(stack));} if (nargs[2]) {kind = GetAny((*nargs[2])(stack));} if (nargs[1]) { KN l = GetAny >((*nargs[1])(stack)); ffassert(l.N() == 6); for (int i = 0; i < 6; ++i) { label[i] = l[i]; } } Mesh3 *Th3_t = 0; if (xx && yy && zz) { MovePoint pf(stack, xx, yy, zz); Th3_t = BuildCube(nx, ny, nz, region, label, kind, &pf); } else { Th3_t = BuildCube(nx, ny, nz, region, label, kind); } Th3_t->BuildGTree(); Add2StackOfPtr2FreeRC(stack, Th3_t); return Th3_t; } #ifndef WITH_NO_INIT // <> static void Load_Init () { Dcl_Type(); typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; if (verbosity > 1 && mpirank == 0) { cout << " load: msh3 " << endl; } TheOperators->Add("+", new OneBinaryOperator_st > ); TheOperators->Add("+", new OneBinaryOperator_st > ); // TheOperators->Add("=",new OneBinaryOperator< Op3_setmesh > ); // TheOperators->Add("<-",new OneBinaryOperator< Op3_setmesh > ); TheOperators->Add("=", new OneBinaryOperator_st > ); TheOperators->Add("<-", new OneBinaryOperator_st > ); Global.Add("change", "(", new SetMesh3D); Global.Add("movemesh23", "(", new Movemesh2D_3D_surf); Global.Add("movemesh2D3Dsurf", "(", new Movemesh2D_3D_surf_cout); Global.Add("movemesh3", "(", new Movemesh3D); Global.Add("movemesh", "(", new Movemesh3D(1)); Global.Add("movemesh3D", "(", new Movemesh3D_cout); Global.Add("deplacement", "(", new DeplacementTab); Global.Add("checkbemesh", "(", new CheckManifoldMesh); Global.Add("buildlayers", "(", new BuildLayerMesh); Global.Add("bcube", "(", new cubeMesh); Global.Add("bcube", "(", new cubeMesh(1)); Global.Add("cube", "(", new Cube); Global.Add("cube", "(", new Cube(1)); Global.Add("trunc", "(", new Op_trunc_mesh3); Global.Add("gluemesh", "(", new Op_GluMesh3tab); Global.Add("extract", "(", new ExtractMesh); Global.Add("extract", "(", new ExtractMesh2D); Global.Add("showborder", "(", new OneOperator1(ShowBorder)); Global.Add("getborder", "(", new OneOperator2 *>(GetBorder)); Global.Add("AddLayers", "(", new OneOperator4_ *, long, KN *>(AddLayers)); typedef const Mesh3 *pmesh3; // Global.Add("trunc","(", new Op_trunc_mesh3); } // <> static loading: calling Load_Init() from a function which is accessible from // [[file:~/ff/src/fflib/load.cpp::static_load_msh3]] void msh3_Load_Init () {Load_Init();} // dynamic loading: calling [[file:../src/fflib/InitFunct.hpp::LOADFUNC]] on [[Load_Init]] LOADFUNC(Load_Init) #endif // [[WITH_NO_INIT]] freefem++-3.61-1/examples++-load/LaplaceP2pnc.edp000644 000767 000024 00000001455 13256636774 021447 0ustar00hechtstaff000000 000000 load "Element_P2pnc" load "Element_P3dc" mesh Th=square(10,10); fespace Vh(Th,P2pnc); // P2+ nc in P FE space cout << " Vh.ndof = "<< Vh.ndof << endl; Vh uh,vh; // unkown and test function. func f=1; // right hand side function func g=0; // boundary condition function varf vLap(uh,vh) = // Definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form - int2d(Th)( f*vh ) // linear form + on(1,2,3,4,uh=g) ; // boundary condition form ; matrix A = vLap(Vh,Vh,solver=UMFPACK); real[int] b= vLap(0,Vh); //cout << A << endl; uh[]=A^-1*b ;// solve the problem plot(uh); // to see the result plot(uh,ps="LaplaceP2pnc.eps",value=true); freefem++-3.61-1/examples++-load/Element_P4.hpp000644 000767 000024 00000004372 13312446271 021137 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... const int TypeOfFE_P4Lagrange::nn[15][4] = { {0, 0, 0, 0}, {1, 1, 1, 1}, {2, 2, 2, 2}, {1, 1, 1, 2}, {1, 1, 2, 2}, {1, 2, 2, 2}, {0, 2, 2, 2}, {0, 0, 2, 2}, {0, 0, 0, 2}, {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 1, 1, 1}, {0, 1, 2, 2}, {0, 1, 1, 2}, {0, 0, 1, 2}} ; const int TypeOfFE_P4Lagrange::aa[15][4] = { {0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 0}, {0, 1, 0, 1}, {0, 0, 1, 2}, {0, 0, 1, 2}, {0, 1, 0, 1}, {0, 1, 2, 0}, {0, 1, 2, 0}, {0, 1, 0, 1}, {0, 0, 1, 2}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 1, 0, 0}} ; const int TypeOfFE_P4Lagrange::ff[15] = {24, 24, 24, 6, 4, 6, 6, 4, 6, 6, 4, 6, 2, 2, 2}; const int TypeOfFE_P4Lagrange::il[15] = {4, 0, 0, 0, 0, 0, 1, 2, 3, 3, 2, 1, 1, 1, 2}; const int TypeOfFE_P4Lagrange::jl[15] = {0, 4, 0, 3, 2, 1, 0, 0, 0, 1, 2, 3, 1, 2, 1}; const int TypeOfFE_P4Lagrange::kl[15] = {0, 0, 4, 1, 2, 3, 3, 2, 1, 0, 0, 0, 2, 1, 1}; freefem++-3.61-1/examples++-load/iohd5-beam-3d.edp000644 000767 000024 00000002414 13256636774 021415 0ustar00hechtstaff000000 000000 load "medit" load "iohdf5" include "cube.idp" load "iovtk" verbosity=2; int[int] Nxyz=[20,5,5]; real [int,int] Bxyz=[[0.,5.],[0.,1.],[0.,1.]]; int [int,int] Lxyz=[[1,2],[2,2],[2,2]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); real E = 21.5e4; real sigma = 0.29; real mu = E/(2*(1+sigma)); real lambda = E*sigma/((1+sigma)*(1-2*sigma)); real gravity = -0.05; fespace Vh(Th,[P1,P1,P1]); Vh [u1,u2,u3], [v1,v2,v3]; cout << "lambda,mu,gravity ="< #include #include #include #include #include "ff++.hpp" #include "AFunction_ext.hpp" void output_matrix_entries( ofstream &fout, const int N, const double *const ccs_val, const int nnzero, const double *const b ) { for(int i = 0; i < nnzero; i++){ fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i]; if((i+1)%4 == 0) fout << std::endl; } if(nnzero%4 != 0) fout << std::endl; for(int i = 0; i < N; i++){ fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i]; if((i+1)%4 == 0) fout << std::endl; } if(N%4 != 0) fout << std::endl; return; } void output_matrix_entries( ofstream &fout, const int N, const complex *const ccs_val, const int nnzero, const complex *const b ) { for(int i = 0; i < nnzero; i++){ fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].real() << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].imag(); if((i+1)%2 == 0) fout << std::endl; } if(nnzero%2 != 0) fout << std::endl; for(int i = 0; i < N; i++){ fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i].real() << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i].imag(); if((i+1)%2 == 0) fout << std::endl; } if(N%2 != 0) fout << std::endl; return; } template long SaveHB(std::string *const &hb_filename, Matrice_Creuse *const &sparse_mat, KN_ const &b, std::string *const &hb_title) { MatriceMorse *A = sparse_mat->A->toMatriceMorse(); const bool isDouble = std::is_floating_point::value; if(!A) return 1; // error // A->M = A->N : size of problem // A->nbcoef : # of non-zero entries in the matrix A // A->a[i] : CRS, entry, 0 <= i < A->nbcoef // A->cl[i] : CRS, column indexes, 0 <= i < A->nbcoef // A->lg[r] : CRS, row starting location, 0 <= r < A->m // A->lg[A->M] : # of non-zero elements ( == A->nbcoef) // b->N() : size // b[i] : i-th element const int N = A->N; const int M = A->M; ffassert( N == M ); std::cout << "SaveHB : # of unknowns = " << N << std::endl; const int nnzero = A->lg[N]; ffassert( nnzero == A->nbcoef ); std::cout << "SaveHB : # of non-zero entries in A = " << nnzero << std::endl; //-------------------------------------------------- // Transpose from CRS to CCS //-------------------------------------------------- int *col_ptr = new int [N+1]; for(int i = 0; i <= N; i++) // initialize col_ptr[i] = 0; for(int i = 0; i < nnzero; i++) // count col_ptr[ A->cl[i]+1 ] += 1; for(int i = 1; i <= N; i++) // accumulate col_ptr[i] += col_ptr[i-1]; int *row_ind = new int [ col_ptr[N] ]; R *ccs_val = new R [ col_ptr[N] ]; int *count = new int [N]; for(int i = 0; i < N; i++) count[i] = 0; for(int i = 0; i < N; i++) for(int ij = A->lg[i]; ij < A->lg[i+1]; ij++){ int c = A->cl[ij]; row_ind[ col_ptr[c] + count[c] ] = i; ccs_val[ col_ptr[c] + count[c] ] = A->a[ij]; count[c] += 1; } delete [] count; // from C index manner to FORTRAN index manner for(int i = 0; i <= N; i++) col_ptr[i]++; for(int i = 0; i < nnzero; i++) row_ind[i]++; //-------------------------------------------------- // File //-------------------------------------------------- std::ofstream fout(hb_filename->c_str()); if(!fout){ std::cerr << "Cannot open the file : " << hb_filename->c_str() << std::endl; std::exit(1); } std::cout << "SaveHB : filename = " << hb_filename->c_str() << std::endl; //-------------------------------------------------- // Header of the HB format //-------------------------------------------------- const int bufsize = 1024; char buf[bufsize]; // Line 1 const int HB_TITLE_LENGTH = 72; memset(buf, '\0', bufsize); strncpy(buf, hb_title->c_str(), HB_TITLE_LENGTH-1); std::cout << "SaveHB : title = " << buf << std::endl; for(int i = 0; i < HB_TITLE_LENGTH - strlen(hb_title->c_str()); i++) strcat(buf, " "); strcat(buf, " KEY"); fout << buf << std::endl; // Line 2 int ptrcrd = (N+1)/8; // #lines for pointers if((N+1)%8 != 0) ptrcrd += 1; int indcrd = nnzero/8; // #lines for row (or variable) indices if(nnzero%8 != 0) indcrd += 1; int valcrd = (isDouble)? nnzero/4: (2*nnzero)/4; // #lines for numerical values if(nnzero%4 != 0) valcrd += 1; int rhscrd = (isDouble)? N/4: (2*N/4); // #lines for right-hand sides if(N%4 != 0) rhscrd += 1; // #data lines excluding header int totcrd = ptrcrd + indcrd + valcrd + rhscrd; sprintf(buf, "%14d%14d%14d%14d%14d", totcrd, ptrcrd, indcrd, valcrd, rhscrd); fout << buf << std::endl; // Line 3 : MXTYPE, NROW, NCOL, NNZERO, NELTVL const int neltvl = 0; // #elemental matrix entries, assembled matrix=0 if( isDouble ) sprintf(buf, "RUA %14d%14d%14d%14d", N, N, nnzero,neltvl); // double else sprintf(buf, "CUA %14d%14d%14d%14d", N, N, nnzero,neltvl); // complex fout << buf << std::endl; // Line 4 // PTRFMT : Format for Pointers // INDFMT : Format for row (or variable) indices // VALFMT : Format for numerical values of coefficient matrix // RHSFMT : Format for numerical values of right-hand side fout << "(8I10) (8I10) (4E20.12) (4E20.12)" << std::endl; // Line 5 // F : Right-hand side type (full storage) // NRHS : #right-hand sides // NRHSIX : #row indices fout<< "F 1 0" << std::endl; //-------------------------------------------------- // Body //-------------------------------------------------- for(int i = 0; i <= N; i++){ fout << setw(10) << col_ptr[i]; if((i+1)%8 == 0) fout << std::endl; } if((N+1)%8 != 0) fout << std::endl; for(int i = 0; i < nnzero; i++){ fout << setw(10) << row_ind[i]; if((i+1)%8 == 0) fout << std::endl; } if(nnzero%8 != 0) fout << std::endl; output_matrix_entries( fout, N, ccs_val, nnzero, b ); fout.close(); delete [] col_ptr; delete [] row_ind; delete [] ccs_val; delete A; return 0; } static void Load_Init () { // le constructeur qui ajoute la fonction "splitmesh3" a freefem++ // if (verbosity) if (verbosity) {cout << " load: SaveHB " << endl;} Global.Add("SaveHB", "(", new OneOperator4_*,KN_,string * >(SaveHB)); Global.Add("SaveHB", "(", new OneOperator4_ >*,KN_< std::complex >,string * >(SaveHB)); } LOADFUNC(Load_Init) //---------------------------------------------------------------------- // End of file //---------------------------------------------------------------------- freefem++-3.61-1/examples++-load/isoline.edp000644 000767 000024 00000003231 13256636774 020637 0ustar00hechtstaff000000 000000 load "isoline" real[int,int] xy(3,1); int[int] be(1); { mesh Th=square(10,10);//,[x*.5,y*0.5]); fespace Vh(Th,P1); Vh u= sqrt(square(x-0.5)+square(y-0.5)); real iso= 0.2 ; real[int] viso=[iso]; plot(u,viso=viso,Th); int nbc= isoline(Th,u,xy,close=1,iso=iso,beginend=be,smoothing=0.1); /* iso = value of the iso to compute close = close the iso line this the border (def. 0). smoothing = nb of smoothing process = smoothing * len curve ^ratio (def. 0.) ratio = (def. 1.) eps = relative eps (see code ??) (def 1e-10 ) beginend = array to get begin end of sub line file = filename remark: sense of the isoline : the upper part is a the left part isoline so here : the minimiun is a 0.5,05 => the curve 1 turn in the clockwise sense */ cout << " nb of the line componant = " << nbc << endl; cout << " n = " << xy.m << endl; // nombre of points cout << "be = " << be << endl; // begin end of the componant // show the lines for( int c=0;c. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "ff++.hpp" #include "AddNewFE.h" // Attention probleme de numerotation des inconnues // ------------------------------------------------- // dans freefem, il y a un noeud par objets sommet, arete, element. // et donc la numerotation des dl dans l'element depend // de l'orientation des aretes // /// --------------------------------------------------------------- namespace Fem2D { static const QuadratureFormular1d &QFE = QF_GaussLegendre3; static const GQuadratureFormular &QFK = QuadratureFormular_T_5; class TypeOfFE_P2pnc: public TypeOfFE { public: static int Data []; // static double Pi_h_coef[]; TypeOfFE_P2pnc (): TypeOfFE(7, 1, Data, 3, 1, 2 * 3 * QFE.n + QFK.n, 3 * QFE.n + QFK.n, 0) { int p = 0, k = 0; // cout << endl; const R2 Ph [] = {R2(0, 0), R2(1, 0), R2(0, 1)}; for (int i = 0; i < 3; i++) { R2 A = Ph[(i + 1) % 3], B = Ph[(i + 2) % 3]; // cout << i<< " AB= " <. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Jacques Morice // Frederic Hecht // E-MAIL : jacques.morice@ann.jussieu.fr // frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // /* * Thank to the ARN () FF2A3 grant * ref:ANR-07-CIS7-002-01 */ /* * calcul demander par F. Hecht */ #ifndef WITH_NO_INIT #include "ff++.hpp" #include "AFunction_ext.hpp" #endif using namespace std; #include #include #include #include #include // #include "msh3.hpp" using namespace Fem2D; // fonction determinant les points d'intersection static int debug = 0; class FINDLOCALMIN_P1_Op: public E_F0mps { public: Expression eTh, eu, er; static const int n_name_param = 2; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} bool arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack, KN *a) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: FINDLOCALMIN_P1_Op (const basicAC_F0 &args, Expression tth, Expression fu, Expression fr) : eTh(tth), eu(fu), er(fr) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type FINDLOCALMIN_P1_Op::name_param [] = { {"eps", &typeid(double)}, {"convex", &typeid(long)} }; class ISOLINE_P1_Op: public E_F0mps { public: Expression eTh, eff, emat, exx, eyy, exy, iso; static const int n_name_param = 7; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack, KN *a) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: ISOLINE_P1_Op (const basicAC_F0 &args, Expression tth, Expression fff, Expression xxx, Expression yyy) : eTh(tth), eff(fff), emat(0), exx(xxx), eyy(yyy), exy(0) { args.SetNameParam(n_name_param, name_param, nargs); } ISOLINE_P1_Op (const basicAC_F0 &args, Expression tth, Expression fff, Expression xxyy) : eTh(tth), eff(fff), emat(0), exx(0), eyy(0), exy(xxyy) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type ISOLINE_P1_Op::name_param [] = { {"iso", &typeid(double)}, {"close", &typeid(long)}, {"smoothing", &typeid(double)}, {"ratio", &typeid(double)}, {"eps", &typeid(double)}, {"beginend", &typeid(KN *)}, {"file", &typeid(string *)} }; int IsoLineK (R2 *P, double *f, R2 *Q, int *i0, int *i1, double eps) { int kv = 0, ke = 0, e = 3; int tv[3], te[3], vk[3]; for (int i = 0; i < 3; ++i) { if (abs(f[i]) <= eps) { e -= tv[kv++] = i; vk[i] = 1; } else { vk[i] = 0; } } if (debug) {cout << " ** " << kv << endl;} if (kv > 1) { // on 2 vertex on the isoline .... if (kv == 2) { if (f[e] > 0.) { int j0 = (e + 1) % 3; int j1 = (e + 2) % 3; te[ke] = e + 3, i0[ke] = j0, i1[ke] = j0, ++ke; te[ke] = e, i0[ke] = j1, i1[ke] = j1, ++ke; // pb d'unicity, need to see the adj triangle ... // return 10+e ; // edge number + 10 } else { return 0; // skip edge ... } } else { return 0; // const funct... } } else {// see internal edge .. for (int e = 0; e < 3; ++e) { int j0 = (e + 1) % 3; int j1 = (e + 2) % 3; if (vk[j0]) { // the intial point on iso line if (0. < f[j1]) { te[ke] = e, i0[ke] = j0, i1[ke] = j0, ++ke; } else { te[ke] = e + 3, i0[ke] = j0, i1[ke] = j0, ++ke; } } else if (vk[j1]) { ; // skip the final point on iso line } else if (f[j0] < 0. && 0. < f[j1]) { // good sens te[ke] = e, i0[ke] = j0, i1[ke] = j1, ++ke; } else if (f[j0] > 0. && 0. > f[j1]) { // inverse sens te[ke] = e + 3, i0[ke] = j1, i1[ke] = j0, ++ke; } } } if (ke == 2) { // the K[i1[0]] , Q[0], Q[1] must be direct ... // the K[i0[1]] , Q[0], Q[1] must be direct ... // Warning no trivail case .. make a plot to see // with is good // the first edge must be if (te[0] < 3) {// oriente the line assert(te[1] >= 3); std::swap(te[0], te[1]); std::swap(i0[0], i0[1]); std::swap(i1[0], i1[1]); if (debug) {cout << " swap " << endl;} } for (int i = 0; i < 2; ++i) { int j0 = i0[i], j1 = i1[i]; if (j0 == j1) { Q[i] = P[j0]; } else { Q[i] = (P[j0] * (f[j1]) - P[j1] * (f[j0])) / (f[j1] - f[j0]); } if (debug) { cout << i << " " << j0 << " " << j1 << " : " << Q[i] << "***" << endl; } } if (debug) { cout << "i0 " << i0[0] << " " << i0[1] << " " << det(P[i1[0]], Q[0], Q[1]) << endl; cout << "i1 " << i1[0] << " " << i1[1] << " " << det(P[i0[1]], Q[1], Q[0]) << endl; cout << "f " << f[0] << " " << f[1] << " " << f[2] << endl; cout << "P " << P[0] << ", " << P[1] << ", " << P[2] << endl; cout << "Q " << Q[0] << ", " << Q[1] << endl; } if (!vk[i1[0]]) { assert(det(P[i1[0]], Q[0], Q[1]) > 0); } if (!vk[i0[1]]) { assert(det(P[i0[1]], Q[1], Q[0]) > 0); } return 2; } // remark, the left of the line is upper . return 0; } int LineBorder (R2 *P, double *f, long close, R2 *Q, int *i1, int *i2, double eps) { int np = 0; if (close) { if (f[0] > -eps) { Q[np] = P[0]; i1[np] = i2[np] = 0, np++; } if (f[0] * f[1] <= -eps * eps) { Q[np] = (P[0] * (f[1]) - P[1] * (f[0])) / (f[1] - f[0]); i1[np] = 0, i2[np] = 1, np++; } if (f[1] > -eps) { Q[np] = P[1]; i1[np] = i2[np] = 1, np++; } } else {} return np; } struct R2_I2 { R2 P; int nx; R2_I2 (R2 A, int nxx = -1): P(A), nx(nxx) {} bool add (int k0, int k1, multimap &L) { if (nx == -1) {nx = k1;} else { if (nx > 0) { // more than 2 seg ... put data in the multi map .. L.insert(make_pair(k0, nx)); L.insert(make_pair(k0, k1)); nx = -2; } else { L.insert(make_pair(k0, k1)); } return false; } return true; } int next (int k0, multimap &L, int rm = 0) { int nxx = -1; if (nx >= 0) { nxx = nx; if (rm) {nx = -2;}} else { typedef multimap::iterator IT; IT f = L.find(k0); if (f == L.end()) { nxx = -1; // } else { nxx = f->second; if (rm) { L.erase(f); } } } return nxx; } int count (int k0, const multimap &L) const { if (nx >= 0) {return 1;} else {return L.count(k0);} } }; // Absact mesh for data on grid .... FH .. int Th_Grid (const KNM_ *g, int k, int ii) { int N = g->N() - 1; int kq = k / 2; // number of the quad int k0 = k % 2; // up or down // (0,0),(1,0),(1,1) Qd <=> (ii !=0, ii==2) // (0,0),(1,1),(0,1) Q2 <=> (ii%2, ii != 0 int I = kq % N + (k0 ? (ii % 2) : (ii != 0)); int J = kq / N + (k0 ? (ii != 0) : (ii == 2)); return J * (N + 1) + I; } R2 V_Grid (const KNM_ *g, int k) { int i = k % g->N(), j = k / g->N(); return R2(i, j); } int EA_Grid (const KNM_ *g, int k, int &e) { int N = g->N() - 1; int kq = k / 2; // number of the quad int k0 = k % 2; // up or down bool intern = k0 ? (e == 0) : (e == 2); if (intern) {e = 2 - e; return 2 * kq + 1 - k0;} ffassert(0); return 0; } struct SMesh { const Mesh *pTh; const KNM_ *g; int nv, nt, neb; int operator () (int k, int i) const {return pTh ? (*pTh)(k, i) : Th_Grid(g, k, i);} R2 operator () (int i) const {return pTh ? (*pTh)(i) : V_Grid(g, i);} int ElementAdj (int k, int &e) {return pTh ? pTh->ElementAdj(k, e) : EA_Grid(g, k, e);} SMesh (const Mesh *PTh): pTh(PTh), g(0), nv(pTh->nv), nt(pTh->nt), neb(pTh->neb) {} SMesh (KNM_ *gg): pTh(0), g(gg), nv(gg->N() * gg->M()), nt((gg->N() - 1) * (gg->M() - 1) * 2), neb((gg->N() + gg->M() - 2) * 2) {} }; :: AnyType FINDLOCALMIN_P1_Op::operator () (Stack stack) const { typedef std::pair KEY; typedef std::priority_queue, std::greater > myPQ; typedef std::priority_queue myPQL; // MeshPoint *mp(MeshPointStack(stack)) , mps=*mp; const Mesh *pTh = GetAny((*eTh)(stack)); ffassert(pTh); const Mesh &Th = *pTh; int ddd1 = verbosity > 9; int ddd0 = verbosity > 2; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles // int nbe=Th.neb; // nombre d'aretes fontiere int convex = arg(1, stack, 0L); double eps = arg(0, stack, 0.); if (verbosity > 2) {cout << " -- findlocalmin: convex = " << convex << " eps= " << eps << endl;} KN rs(nbv); KN *pu = GetAny *>((*eu)(stack)); KN *pr = GetAny *>((*er)(stack)); KN &U(*pu), &R(*pr); if (U.N() != nbv) {ffassert(0);} if (R.N() != nbt) {ffassert(0);} R = -1.;// // 1 recher de min local rs = 1; // voisanage de sommet KN head(nbv), next(3 * nbt); head = -1; for (int p = 0; p < next.N(); ++p) { int j = Th(p / 3, p % 3); next[p] = head[j]; head[j] = p; } KN nbrv(nbv); // nb traingle around vertices nbrv = 0; for (int k = 0; k < nbt; ++k) { const Mesh::Element &K = Th[k]; for (int i = 0; i < 3; ++i) { ++nbrv[Th(K[i])]; int i0 = Th(K[(i + 1) % 3]); int i1 = Th(K[(i + 2) % 3]); if (U[i0] > U[i1]) {rs[i0] = 0;} else if (U[i1] > U[i0]) {rs[i1] = 0;} } } if (ddd0) {cout << "rq nb min = " << rs.sum() << endl;} myPQ lvm; for (int i = 0; i < nbv; ++i) { if (rs[i] == 1) { lvm.push(make_pair(U[i], i)); } } // analyse des minimals locaux KN cv(nbv); cv = 0L; long col = 0; int nmin = 0; KN sm(nbv); R2 Gl[3]; long rkm = 0; // Numero de region while (!lvm.empty()) { KEY tlvm = lvm.top(); lvm.pop(); double Ui = tlvm.first; int i = tlvm.second; if (rs[i] == 1 && nbrv[i] > 0) { ++col; // change the color myPQ pqv; pqv.push(make_pair(Ui, i)); if (ddd1) {cout << " ** " << i << " " << "ui =" << Ui << endl;} double Uvp = Ui; while (!pqv.empty()) { KEY tp = pqv.top(); pqv.pop(); double Uv = tp.first; int iv = tp.second; // if(cv[iv]==col) continue; // cv[iv]=col; if (ddd1) {cout << "\t\t" << iv << " " << Uv << endl;} assert(Uv >= Uvp); // verif piority queue Uvp = Uv; for (int p = head[iv]; p >= 0; p = next[p]) { // lpour les triangle autour de iv int k = p / 3, ik = p % 3, i1 = (ik + 1) % 3, i2 = (ik + 2) % 3; if (R[k] < 0) { // nouveau triangle int j1 = Th(k, i1); int j2 = Th(k, i2); if (Uv <= U[j1] && Uv <= U[j2]) { R[k] = rkm; --nbrv[iv]; --nbrv[j1]; --nbrv[j2]; if (ddd1) {cout << "\t\t\t Add " << k << " " << j1 << " " << U[j1] << " / " << j2 << " " << U[j2] << endl;} if (nbrv[j1] > 0) {pqv.push(make_pair(U[j1], j1));} if (nbrv[j2] > 0) {pqv.push(make_pair(U[j2], j2));} } } } if (convex > 1) {break;} } sm[rkm++] = i; } } if (ddd1) {cout << " R = " << R << endl;} if (verbosity > 2) {cout << " -- FindlocalMin nb min =" << nmin << endl;} sm.resize(rkm); KN *ppr = new KN(sm); return Add2StackOfPtr2Free(stack, ppr); } AnyType ISOLINE_P1_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; KNM *pxy = 0; KN *pxx = 0; KN *pyy = 0; if (exy) { pxy = GetAny *>((*exy)(stack)); } if (exx) { pxx = GetAny *>((*exx)(stack)); } if (eyy) { pyy = GetAny *>((*eyy)(stack)); } // cout << pxx << " " << pyy << " " << pxy << endl; ffassert((pxx || pyy) == !pxy); const Mesh *pTh = GetAny((*eTh)(stack)); ffassert(pTh); SMesh Th(pTh); int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles // int nbe=Th.neb; // nombre d'aretes fontiere long nbc; // value of isoline // int ka=0; double isovalue = arg(0, stack, 0.); long close = arg(1, stack, 1L); double smoothing = arg(2, stack, 0.); double ratio = arg(3, stack, 1.); double epsr = arg(4, stack, 1e-10); KN *pbeginend = arg(5, stack, (KN *) 0); string *file = arg(6, stack, (string *)0); vector P; multimap L; if (verbosity >= 1000) {debug = verbosity / 1000;} else {debug = 0;} map, int> FP; const double unset = -1e-100; KN tff(nbv, unset); // loop over triangle if (pTh) { for (int it = 0; it < Th.nt; ++it) { for (int iv = 0; iv < 3; ++iv) { int i = Th(it, iv); if (tff[i] == unset) { mp->setP(pTh, it, iv); tff[i] = GetAny((*eff)(stack)) - isovalue; } } } } else {ffassert(0);} if (close < 0) { tff = -tff; close = -close; } *mp = mps; // restore the stat of local variable ... double tffmax = tff.max(), tffmin = tff.min(); if (verbosity) { cout << " -- isoline close=" << close << " iso= " << isovalue << " " << epsr << endl << " bound isovalue :" << tffmin << " " << tffmax << endl; } double eps = (tffmax - tffmin) * epsr; if ((tffmax < 0.) || (tffmin > 0.)) {return 0L;} if (epsr < 0) {eps = -epsr;} ostream *fff = 0; if (debug > 9) {fff = new ofstream("g-iso");} for (int k = 0; k < Th.nt; ++k) { int iK[3] = {Th(k, 0), Th(k, 1), Th(k, 2)}; R2 Pk[3] = {Th(iK[0]), Th(iK[1]), Th(iK[2])}; R fk[3] = {tff[iK[0]], tff[iK[1]], tff[iK[2]]}; R2 Qk[6]; int i1[6], i2[6]; int np = IsoLineK(Pk, fk, Qk, i1, i2, eps); if (np == 2) { for (int i = 0; i < np; ++i) { // sort i1,i2 .. i1[i] = iK[i1[i]]; i2[i] = iK[i2[i]]; if (i2[i] < i1[i]) { std::swap(i1[i], i2[i]); } } int p[2]; // point number for (int i = 0; i < 2; ++i) { pair, int>::iterator, bool> ii; pair e(i1[i], i2[i]); ii = FP.insert(make_pair(e, P.size())); if (ii.second) { P.push_back(R2_I2(Qk[i])); } if (debug) {cout << i1[i] << " --- " << i2[i] << " ; " << ii.second << endl;} p[i] = ii.first->second; } // add line k[0], k[1] P[p[0]].add(p[0], p[1], L); if (debug) { cout << " +++ " << Qk[0] << " -> " << Qk[1] << " :: " << p[0] << " -> " << p[1] << endl; } if (fff) {*fff << Qk[0] << "\n" << Qk[1] << "\n" << ((Qk[0] * 0.4 + Qk[1] * .6) + R2(Qk[0], Qk[1]).perp() * .4) << "\n\n";} } } if (fff) {delete fff;} if (close) { if (debug) {cout << " Close path " << endl;} for (int k = 0; k < Th.nt; ++k) { // Triangle &K=Th[k]; for (int e = 0; e < 3; ++e) { int ee, kk = Th.ElementAdj(k, ee = e); if (kk == k || kk < 0) {// true border element edge int iK[2] = {Th(k, (e + 1) % 3), Th(k, (e + 2) % 3)}; R2 Pk[2] = {Th(iK[0]), Th(iK[1])}; R fk[2] = {tff[iK[0]], tff[iK[1]]}; R2 Qk[2]; int i1[2], i2[2]; if (debug) { cout << " LB : " << Pk[0] << ", " << fk[0] << " -> " << Pk[1] << ", " << fk[1] << " : " << iK[0] << " " << iK[1] << endl; } int np = LineBorder(Pk, fk, close, Qk, i1, i2, eps); // cout << np << endl; if (np >= 10) { // full edge int ke = 0; } else if (np == 2) { for (int i = 0; i < 2; ++i) { i1[i] = iK[i1[i]]; i2[i] = iK[i2[i]]; if (i2[i] < i1[i]) { std::swap(i1[i], i2[i]); } } if (debug) { cout << " add : " << Qk[0] << ", " << i1[0] << ',' << i2[0] << " -> " << Qk[1] << ", " << i1[1] << ',' << i2[1] << endl; } int p[2]; // point number for (int i = 0; i < 2; ++i) { pair, int>::iterator, bool> ii; pair ee(i1[i], i2[i]); ii = FP.insert(make_pair(ee, P.size())); if (ii.second) { P.push_back(R2_I2(Qk[i])); } if (debug) {cout << i1[i] << " --- " << i2[i] << " ; " << ii.second << endl;} p[i] = ii.first->second; } // add line k[0], k[1] P[p[0]].add(p[0], p[1], L); if (debug) { cout << " +++ " << Qk[0] << " -> " << Qk[1] << " :: " << p[0] << " -> " << p[1] << endl; } } } } } if (debug) {cout << " End Close path " << endl;} } if (verbosity > 99) { // dump the data base cout << " IsolineP1 " << endl; for (int i = 0; i < P.size(); ++i) { cout << "\t" << i << " : " << P[i].P << " -> " << P[i].nx << endl; } cout << " multmap for execption " << endl; for (multimap::const_iterator i = L.begin(); i != L.end(); ++i) { cout << "\t" << i->first << " -> " << i->second << endl; } cout << " End multmap for execption " << endl; } vector iQ, QQ; // QQ the list of curve int np = P.size(); KN start(np); start = -1; int kkk = 0; for (int i = 0; i < np; ++i) { int nx = P[i].next(i, L, 0); if (nx >= 0) {start[nx] = i;} } vector starting; int iss = 0; for (multimap::const_iterator i = L.begin(); i != L.end(); ++i) { starting.push_back(i->first); start[i->second] = i->first; } for (int i = 0; i < np; ++i) { if (start[i] == -1) { starting.push_back(i); } } while (1) { ffassert(kkk++ < 100000); int kk = 0, k = 0; for (int i = 0; i < np; ++i) { // correction FH 18/9/2012 .... kk += P[i].count(i, L); if (start[i] == -1) { k++; } } if (kk == 0) { break; } int i = -1; if (iss < starting.size()) { start[i = starting[iss++]] = -1; } else { for (int ii = 0; ii < np; ++ii) { if ((start[ii] >= 0)) {i = ii;}} } if (i < 0) {break;} { if (verbosity > 9) { cout << " isolineP1: start curve = " << i << " -> " << P[i].next(i, L, 0); } if (verbosity > 99) { cout << " (" << i << endl; } iQ.push_back(QQ.size()); QQ.push_back(i); start[i] = -2; int i0 = i, i1 = 0, ie = i; while (1) { i1 = P[i0].next(i0, L, 1); if (i1 < 0) {break;} if (start[i1] < 0) { if (verbosity > 99) { cout << " -- " << i1; } QQ.push_back(i1); break; } QQ.push_back(i1); if (verbosity > 99) { cout << " " << i1; } start[i1] = -2; i0 = i1; } /* do in brak if(i1==ie) // close the path .. * { * QQ.push_back(i1); * if(verbosity>99) * cout << " " << i1; * } */ if (verbosity > 99) { cout << ") " << endl; } else if (verbosity > 9) {cout << endl;} iQ.push_back(QQ.size()); } } // sort iQ if (iQ.size() > 2) { vector > > sQ(iQ.size() / 2); for (int i = 0, j = 0; i < iQ.size(); i += 2, ++j) { int i0 = iQ[i]; int i1 = iQ[i + 1]; sQ[j] = make_pair(i0 - i1, make_pair(i0, i1)); } std::sort(sQ.begin(), sQ.end()); for (int i = 0, j = 0; i < iQ.size(); i += 2, ++j) { iQ[i] = sQ[j].second.first; iQ[i + 1] = sQ[j].second.second; } } if (smoothing > 0) { KN P1(QQ.size()), P2(QQ.size()); for (int i = 0; i < QQ.size(); ++i) { P1[i] = P[QQ[i]].P; } // Smoothing the curve double c1 = 1, c0 = 4, ct = 2 * c1 + c0; c1 /= ct; c0 /= ct; for (int i = 0; i < iQ.size(); ) { int i0 = iQ[i++]; int i1 = iQ[i++] - 1; int nbsmoothing = pow((i1 - i0), ratio) * smoothing; if (verbosity > 2) { cout << " curve " << i << " size = " << i1 - i0 << " nbsmoothing = " << nbsmoothing << " " << i0 << " " << i1 << endl; } P2 = P1; for (int step = 0; step < nbsmoothing; ++step) { for (int j = i0 + 1; j < i1; ++j) { P2[j] = c0 * P1[j] + c1 * P1[j - 1] + c1 * P1[j + 1]; } if (QQ[i0] == QQ[i1]) { // close curve int j0 = i0 + 1;// prec int j1 = i1 - 1;// next P2[i0] = P2[i1] = c0 * P1[i0] + c1 * P1[j0] + c1 * P1[j1]; } P1 = P2; } } for (int i = 0; i < QQ.size(); ++i) { P[QQ[i]].P = P1[i]; } } if (pbeginend) { pbeginend->resize(iQ.size()); for (int i = 0; i < iQ.size(); ++i) { (*pbeginend)[i] = iQ[i]; } } if (pxx && pyy) { pxx->resize(QQ.size()); pyy->resize(QQ.size()); for (int i = 0; i < QQ.size(); ++i) { int j = QQ[i]; (*pxx)[i] = P[j].P.x; (*pyy)[i] = P[j].P.y; } } else if (pxy) { pxy->resize(3, QQ.size()); for (int k = 0; k < iQ.size(); k += 2) { int i0 = iQ[k], i1 = iQ[k + 1]; double lg = 0; R2 Po = P[QQ[i0]].P; for (int i = i0; i < i1; ++i) { int j = QQ[i]; (*pxy)(0, i) = P[j].P.x; (*pxy)(1, i) = P[j].P.y; lg += R2(P[j].P, Po).norme(); (*pxy)(2, i) = lg; Po = P[j].P; } } } else {ffassert(0);} nbc = iQ.size() / 2; if (file) { ofstream fqq(file->c_str()); int i = 0, i0, i1, n2 = iQ.size(), k = 0; while (i < n2) { k++; i0 = iQ[i++]; i1 = iQ[i++]; // cout<< i0 << " " << i1 << endl; for (int l = i0; l < i1; ++l) { int j = QQ[l]; fqq << P[j].P.x << " " << P[j].P.y << " " << k << " " << j << endl; } fqq << endl; } } /* * int err=0; * int pe[10]; * for(int i=0;i< P.size();++i) * { * int pb = P[i].count(i,L); * if(pb) * if(err<10) * pe[err++]=i; * else * err++; * } * * if(err>0) * { * for(int i=0;i<10;i++) * cout << " PB point = " << pe[i] << " " << P[pe[i]].P << " odd count = " << P[pe[i]].count(pe[i],L) << endl; * ffassert(0); * } */ // construction des courble return nbc; } class ISOLINE_P1: public OneOperator { public: typedef const Mesh *pmesh; int cas; ISOLINE_P1 (): OneOperator(atype(), atype(), atype(), atype *>(), atype *>()), cas(4) {} ISOLINE_P1 (int): OneOperator(atype(), atype(), atype(), atype *>()), cas(3) {} E_F0*code (const basicAC_F0 &args) const { if (cas == 4) { return new ISOLINE_P1_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } else if (cas == 3) { return new ISOLINE_P1_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } else { ffassert(0);// bug } } }; class FINDLOCALMIN_P1: public OneOperator { public: typedef const Mesh *pmesh; int cas; FINDLOCALMIN_P1 (): OneOperator(atype *>(), atype(), atype *>(), atype *>()), cas(1) {} E_F0*code (const basicAC_F0 &args) const { if (cas == 1) { return new FINDLOCALMIN_P1_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]) ); } else { ffassert(0);// bug } } }; R3*Curve (Stack stack, const KNM_ &b, const long &li0, const long &li1, const double &ss, long *const &pi) { assert(b.N() >= 3); int i0 = li0, i1 = li1, im; if (i0 < 0) {i0 = 0;} if (i1 < 0) {i1 = b.M() - 1;} double lg = b(2, i1); R3 Q; ffassert(lg > 0 && b(2, 0) == 0.); double s = ss * lg; int k = 0, k1 = i1; while (i0 < i1 - 1) { ffassert(k++ < k1); im = (i0 + i1) / 2; if (s < b(2, im)) { i1 = im; } else if (s > b(2, im)) { i0 = im; } else {Q = R3(b(0, im), b(1, im), 0); i0 = i1 = im; break;} } if (i0 < i1) { ffassert(b(2, i0) <= s); ffassert(b(2, i1) >= s); R2 A(b(0, i0), b(1, i0)); R2 B(b(0, i1), b(1, i1)); double l1 = (b(2, i1) - s); double l0 = s - b(2, i0); Q = (l1 * A + l0 * B) / (l1 + l0); } if (pi) {*pi = i0;} R3 *pQ = Add2StackOfPtr2Free(stack, new R3(Q)); // MeshPoint &mp= *MeshPointStack(stack); // the struct to get x,y, normal , value // mp.P.x=Q.x; // get the current x value // mp.P.y=Q.y; // get the current y value return pQ; } R3*Curve (Stack stack, const KNM_ &b, const long &li0, const long &li1, const double &ss) {return Curve(stack, b, li0, li1, ss, 0);} double mesure (Stack stack, const KNM_ &b, const KN_ &be) { double mes = 0; int nbc2 = be.N(); for (int k = 0; k < nbc2; ) { int i0 = be[k++]; int i1 = be[k++]; R2 A(b(0, i0), b(1, i0)); double mk = 0; for (int i = i0 + 1; i < i1; ++i) { R2 B(b(0, i - 1), b(1, i - 1)); R2 C(b(0, i), b(1, i)); mk += det(A, B, C); } if (verbosity > 9) {cout << " mesure: composante " << k / 2 << " mesure " << mk / 2. << endl;} mes += mk; } return mes / 2.; } R3*Curve (Stack stack, const KNM_ &b, const double &ss) { return Curve(stack, b, -1, -1, ss); } template // extend (4th arg.) class E_F_F0F0F0F0F0s_: public E { public: // extend typedef R (*func)(Stack, const A0 &, const A1 &, const A2 &, const A3 &, const A4 &); // extend (4th arg.) func f; Expression a0, a1, a2, a3, a4; // extend E_F_F0F0F0F0F0s_ (func ff, Expression aa0, Expression aa1, Expression aa2, Expression aa3, Expression aa4) // extend : f(ff), a0(aa0), a1(aa1), a2(aa2), a3(aa3), a4(aa4) {} // extend (4th arg.) AnyType operator () (Stack s) const { return SetAny(f(s, GetAny((*a0)(s)), GetAny((*a1)(s)), GetAny((*a2)(s)), GetAny((*a3)(s)), GetAny((*a4)(s)))); } // extend (4th arg.) virtual size_t nbitem () const {return a4->nbitem();} // modif bool MeshIndependent () const {return a0->MeshIndependent() && a1->MeshIndependent() && a2->MeshIndependent() && a3->MeshIndependent() && a4->MeshIndependent();} // extend (4th arg.) }; template > // extend (4th arg.) class OneOperator5s_: public OneOperator { aType r;// return type typedef typename CODE::func func; func f; public: E_F0*code (const basicAC_F0 &args) const { if (args.named_parameter && !args.named_parameter->empty()) { CompileError(" They are used Named parameter "); } return new CODE(f, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4])); } // extend OneOperator5s_ (func ff): // 3->4 OneOperator(map_type[typeid(R).name()], map_type[typeid(A).name()], map_type[typeid(B).name()], map_type[typeid(C).name()], map_type[typeid(D).name()], map_type[typeid(E).name()]),// extens f(ff) {} }; static void finit () { typedef const Mesh *pmesh; Global.Add("isoline", "(", new ISOLINE_P1); Global.Add("isoline", "(", new ISOLINE_P1(1)); Global.Add("Curve", "(", new OneOperator2s_, double>(Curve)); Global.Add("Curve", "(", new OneOperator4s_, long, long, double>(Curve)); Global.Add("Curve", "(", new OneOperator5s_, long, long, double, long *>(Curve)); Global.Add("Area", "(", new OneOperator2s_, KN_ >(mesure)); Global.Add("findalllocalmin", "(", new FINDLOCALMIN_P1); } LOADFUNC(finit);// une variable globale qui serat construite au chargement dynamique freefem++-3.61-1/examples++-load/iohd5-beam-2d.edp000644 000767 000024 00000002614 13256636774 021416 0ustar00hechtstaff000000 000000 // Fluid-structure interaction for a weighting beam sitting on a // square cavity filled with a fluid. load "iohdf5" int bottombeam = 2; border a(t=2,0) { x=0; y=t ;label=1;}; // left beam border b(t=0,10) { x=t; y=0 ;label=bottombeam;}; // bottom of beam border c(t=0,2) { x=10; y=t ;label=1;}; // rigth beam border d(t=0,10) { x=10-t; y=2; label=3;}; // top beam real E = 21.5; real sigma = 0.29; real mu = E/(2*(1+sigma)); real lambda = E*sigma/((1+sigma)*(1-2*sigma)); real gravity = -0.05; mesh th = buildmesh( b(20)+c(5)+d(20)+a(5)); fespace Vh(th,[P1,P1]); Vh [uu,vv], [w,s]; cout << "lambda,mu,gravity ="< seg fault in Ipopt func matrix HJ(real[int]& X) { Vh u; u[]=X; varf vH(v,w) = int2d(Th)( (grad(w)'*grad(v)) / sqrt(1+grad(u)'*grad(u)) - (grad(w)'*grad(u))*(grad(v)'*grad(u)) *(1+grad(u)'*grad(u))^-1.5 ) ; H = vH(Vh,Vh); return H;} varf OnGamma(u,v) = on(1,2,3,4,u=1); Vh OnG; OnG[]=OnGamma(0,Vh,tgv=1); // 1 on Gamma Vh lb = OnG!=0 ? g : -1e19 ; // Vh ub = OnG!=0 ? g : 1e19 ; // Vh u = OnG!=0 ? g : 0 ; // initial guest .. Vh clb = 3-square(10*(square(x-x0)+square(y-y0))); // constraint .. if(constraint) lb = max(lb,clb); int ret; if(bfgs) ret = IPOPT(J,DJ,u[],lb=lb[],ub=ub[],bfgs=1); else ret = IPOPT(J,DJ,HJ,u[],lb=lb[],ub=ub[]); cout << " min = " << J(u[]) << " ~ " << J(ue[]) << " ret = " << ret << endl; plot(u, wait=1); freefem++-3.61-1/examples++-load/ffmaster.c000644 000767 000024 00000005213 13312446271 020440 0ustar00hechtstaff000000 000000 /* * Example of coupling c program and freemfem++ script * with mmap and semaphore * * the c code is : ffmaster.c * the ff++ code is : ffslave.edp * and here FreeFem++ is a slave process * the compile step is * * cc -c libff-mmap-semaphore.c * cc ffmaster.c -o ffmaster libff-mmap-semaphore.o -g #build the freefem++ plugin * ff-c++ -auto ff-mmap-semaphore.cpp # launch # ./ffmaster # # # F. Hecht Feb. 2018 Frederic.Hecht@upmc.fr */ /* * * 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 */ #include "libff-mmap-semaphore.h" #include #include #include ff_Psem sem_ff, sem_c; // the semaphore for mutex /* * Psemaphore smff("ff-slave"); * Psemaphore smc("ff-master"); * Pmmap sharedata("shared-data"); * */ int main (int argc, const char **argv) { int debug = 0; ff_Pmmap shd; double cff, rff; long status; int i; if (argc > 1) {debug = atoi(argv[1]);} ff_mmap_sem_verb = debug; sem_ff = ffsem_malloc(); sem_c = ffsem_malloc(); shd = ffmmap_malloc(); ffsem_init(sem_ff, "ff-slave1", 1); ffsem_init(sem_c, "ff-master1", 1); ffmmap_init(shd, "shared-data", 1024); status = 1; ffmmap_write(shd, &status, sizeof(status), 8); ffmmap_msync(shd, 0, 32); char ff[1024]; sprintf(ff, "FreeFem++ ffslave.edp -nw -ns -v %d&", debug); system(ff); // Lauch FF++ in batch no graphique if (debug) {printf(" cc: before wait\n");} if (debug) {printf(" cc: before wait 0 ff\n");} ffsem_wait(sem_ff); for (i = 0; i < 10; ++i) { printf(" iter : %d \n", i); cff = 10 + i; ffmmap_write(shd, &cff, sizeof(cff), 0); ffsem_post(sem_c); if (debug) {printf(" cc: before wait 2\n");} ffsem_wait(sem_ff); ffmmap_read(shd, &rff, sizeof(rff), 16); printf(" iter = %d rff= %f\n", i, rff); } status = 0; // Fin ffmmap_write(shd, &status, sizeof(status), 8); ffsem_post(sem_c); printf("Fin Master \n"); ffsem_wait(sem_ff); ffsem_del(sem_ff); ffsem_del(sem_c); ffmmap_del(shd); return 0; } freefem++-3.61-1/examples++-load/splitmesh12.cpp000644 000767 000024 00000015114 13312446271 021345 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" using namespace std; #include "rgraph.hpp" #include "RNM.hpp" #include "ff++.hpp" #include "AFunction_ext.hpp"// [[file:../src/fflib/AFunction_ext.hpp]] #include "msh3.hpp" #include #include using namespace Fem2D; static void findPerm (int *ivt, int *pivt, Vertex3 *v) { std::copy(ivt, ivt + 4, pivt); R3 AB(v[ivt[0]], v[ivt[1]]); R3 AC(v[ivt[0]], v[ivt[2]]); R3 AD(v[ivt[0]], v[ivt[3]]); if (det(AB, AC, AD) > 0) { return; } else if (det(AB, AD, AC) > 0) { std::swap(pivt[2], pivt[3]); return; } else if (det(AC, AB, AD) > 0) { std::swap(pivt[1], pivt[2]); return; } } Mesh3 const*SplitMesh12 (Stack stack, Fem2D::Mesh3 const *const &pTh) { assert(pTh); const Mesh3 &Th(*pTh); // le maillage d'origne a decoupe using Fem2D::Triangle; using Fem2D::Vertex; using Fem2D::R2; using Fem2D::BoundaryEdge; using Fem2D::Mesh; int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere // allocation des nouveaux items du maillage int nbnv = 0; for (int k = 0; k < nbt; ++k) { for (int e = 0; e < 4; ++e) { int ee = e; int kk = Th.ElementAdj(k, ee); if (kk > k) { nbnv++; } } } Vertex3 *v = new Vertex3[nbv + nbt + nbe + nbnv]; Tet *t = new Tet[nbt * 12]; Triangle3 *b = new Triangle3[nbe * 3]; // generation des nouveaus sommets Vertex3 *vv = v; // copie des anciens sommets (remarque il n'y a pas operateur de copy des sommets) for (int i = 0; i < nbv; i++) { const Vertex3 &V = Th(i); vv->x = V.x; vv->y = V.y; vv->z = V.z; vv->lab = V.lab; vv++; } // generation des points barycentre de trianngles for (int k = 0; k < nbt; k++) { const Tet &K = Th[k]; R3 G = ((R3)K[0] + K[1] + K[2] + K[3]) / 4.; vv->x = G.x; vv->y = G.y; vv->z = G.z; vv->lab = 0; vv++; } for (int i = 0; i < nbe; i++) { const Triangle3 &K(Th.be(i)); R3 G = ((R3)K[0] + K[1] + K[2]) / 3.; vv->x = G.x; vv->y = G.y; vv->z = G.z; vv->lab = Th.be(i).lab; vv++; } // generation des triangles Tet *tt = t; for (int i = 0; i < nbe; i++) { int ki; int k = Th.BoundaryElement(i, ki); const Triangle3 &K(Th.be(i)); int i0 = Th.operator () (K[0]), i1 = Th.operator () (K[1]), i2 = Th.operator () (K[2]); int ii = nbv + nbt + i; // numero du int jj = nbv + k; // numero du int ivt[4] = {jj, i1, i2, ii}; int pivt[4]; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, K.lab); ivt[0] = i0; ivt[1] = jj; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, K.lab); ivt[1] = i1; ivt[2] = jj; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, K.lab); } const int nvfaceTet[4][3] = { {3, 2, 1}, {0, 2, 3}, {3, 1, 0}, {0, 1, 2}}; for (int k = 0; k < nbt; k++) { for (int e = 0; e < 4; ++e) { int ee = e; int kk = Th.ElementAdj(k, ee); if (kk > k) { const Tet &K = Th[k]; const Tet &KAdj = Th[kk]; { R3 uuu = K[nvfaceTet[e][1]] - K[nvfaceTet[e][0]], vvv = K[nvfaceTet[e][2]] - K[nvfaceTet[e][0]]; R3 n = uuu ^ vvv; Vertex3 dir(v[nbv + k] - v[nbv + kk]); Vertex3 w0(v[nbv + kk] - K[nvfaceTet[e][0]]); double aa = -(n, w0); double bb = (n, dir); double rr = aa / bb; vv->x = v[nbv + kk].x + rr * dir.x; vv->y = v[nbv + kk].y + rr * dir.y; vv->z = v[nbv + kk].z + rr * dir.z; vv->lab = 0; } int i0 = Th.operator () (K[nvfaceTet[e][0]]), i1 = Th.operator () (K[nvfaceTet[e][1]]), i2 = Th.operator () (K[nvfaceTet[e][2]]); for (int ij = 0; ij < 2; ++ij) { int ivt[4] = {ij == 0 ? nbv + k : nbv + kk, i1, i2, static_cast(vv - v)}; int lab = ij == 0 ? K.lab : KAdj.lab; int pivt[4]; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, lab); ivt[1] = ivt[0]; ivt[0] = i0; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, lab); ivt[2] = ivt[1]; ivt[1] = i1; findPerm(ivt, pivt, v); (*tt++).set(v, pivt, lab); } vv++; } } } // les arete frontieres qui n'ont pas change Triangle3 *bb = b; for (int i = 0; i < nbe; i++) { const Triangle3 &K(Th.be(i)); int orig[3]; int ivv[3]; orig[0] = Th.operator () (K[0]); orig[1] = Th.operator () (K[1]); orig[2] = Th.operator () (K[2]); ivv[0] = nbv + nbt + i; ivv[1] = orig[1]; ivv[2] = orig[2]; (bb++)->set(v, ivv, K.lab); ivv[1] = ivv[0]; ivv[0] = orig[0]; (bb++)->set(v, ivv, K.lab); ivv[2] = ivv[1]; ivv[1] = orig[1]; (bb++)->set(v, ivv, K.lab); } // generation de la class Mesh a partir des 3 tableaux : v,t,b { Mesh3 *m = new Mesh3(nbv + nbt + nbe + nbnv, nbt * 12, nbe * 3, v, t, b); m->BuildGTree(); // m->decrement(); Add2StackOfPtr2FreeRC(stack, m); return m; } } // truc pour que la fonction // static void Load_Init() soit appele a moment du chargement dynamique // du fichier // /* class Init { public: * Init(); * }; * * $1 */ static void Load_Init () { // le constructeur qui ajoute la fonction "splitmesh12" a freefem++ if (verbosity > 1) { cout << " load: Split12 " << endl; } Global.Add("splitmesh12", "(", new OneOperator1s_(SplitMesh12)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/addNewType.cpp000644 000767 000024 00000007204 13312446271 021237 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Example C++ function "CppModTemplate" dynamically loaded into "load.edp" // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... #include "ff++.hpp" using namespace Fem2D; // see src/femlib/RNM.hpp class myType { public: string *nom; myType (char *nn) {cout << " nn = " << nn << endl;} double x (double u, double v) const {return u + v;} void init () {cout << " init myTpe \n"; nom = 0;} // initialization of the pointer void destroy () {cout << " destroy de la variable associe \n"; delete nom; nom = 0;} }; class myType_uv { public: myType *mt; double u, v; myType_uv (myType *mmt, double uu, double vv): mt(mmt), u(uu), v(vv) {} }; // le vrai constructeur est la myType*init_MyType (myType *const &a, string *const &s) { a->nom = new string(*s); cout << " build MyType " << *a->nom << endl; return NULL;// return value never used for now (13.1) } myType_uv set_myType_uv (myType *const &mt, const double &u, const double &v) {return myType_uv(mt, u, v);} double get_myType_uv_x (const myType_uv &muv) { return muv.mt->x(muv.u, muv.v); } R3*get_myType_uv_N (const myType_uv &muv) { static R3 r; r = R3(muv.mt->x(muv.u, muv.v), 0., 0.); return &r; } // Add the function name to the freefem++ table /* class Init { public: * Init(); * }; * $1 */ static void Load_Init () { Dcl_Type(InitP, Destroy );// declare deux nouveau type pour freefem++ un pointeur et Dcl_Type(); // Dcl_Type(); // cast d'un ** en * // atype()->AddCast( new E_F1_funcT(UnRef)); zzzfff->Add("myType", atype()); // ajoute le type myType a freefem++ // constructeur d'un type myType dans freefem TheOperators->Add("<-", new OneOperator2_(&init_MyType)); // dans ff++ // myType ff("qsdlqdjlqsjdlkq"); // ajoute la fonction myType* (u,v) cree le type myType_uv // ff(0.1,0.6).x // deux etapes // 1) ff(u,v) -> myType_uv // ajoute la methode x sur myType_uv ff(u,v).x // ajoute des fonction sur myType_uv // 1) atype()->Add("(", "", new OneOperator3_(set_myType_uv)); Add("x", ".", new OneOperator1_(get_myType_uv_x)); Add("N", ".", new OneOperator1_(get_myType_uv_N)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/Element_P1dc1.cpp000644 000767 000024 00000032447 13312446271 021523 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "ff++.hpp" #include "AddNewFE.h" // Attention probleme de numerotation des inconnues // ------------------------------------------------- // dans freefem, il y a un noeud par objets sommet, arete, element. // et donc la numerotation des dl dans l'element depend // de l'orientation des aretes // /// --------------------------------------------------------------- namespace Fem2D { // ------------------- // ttdc1_ finite element fully discontinue. // ------------------- class TypeOfFE_P1ttdc1_: public TypeOfFE { public: static int Data []; static double Pi_h_coef []; static const R2 G; static const R cshrink; static const R cshrink1; // (1 -1/3)* static R2 Shrink (const R2 &P) {return (P - G) * cshrink + G;} static R2 Shrink1 (const R2 &P) {return (P - G) * cshrink1 + G;} TypeOfFE_P1ttdc1_ (): TypeOfFE(0, 0, 3, 1, Data, 1, 1, 3, 3, Pi_h_coef) { const R2 Pt [] = {Shrink(R2(0, 0)), Shrink(R2(1, 0)), Shrink(R2(0, 1))}; for (int i = 0; i < NbDoF; i++) { pij_alpha[i] = IPJ(i, i, 0); P_Pi_h[i] = Pt[i]; // cout << Pt[i] << " " ; } // cout <<" cshrink: " << cshrink << " cshrink1 : "<< cshrink1 < &u, int componante, int op) const; }; const R2 TypeOfFE_P1ttdc1_::G(1. / 3., 1. / 3.); const R TypeOfFE_P1ttdc1_::cshrink = 1; const R TypeOfFE_P1ttdc1_::cshrink1 = 1. / TypeOfFE_P1ttdc1_::cshrink; class TypeOfFE_P2ttdc1_: public TypeOfFE { public: static int Data []; static double Pi_h_coef []; static const R2 G; static const R cshrink; static const R cshrink1; static R2 Shrink (const R2 &P) {return (P - G) * cshrink + G;} static R2 Shrink1 (const R2 &P) {return (P - G) * cshrink1 + G;} TypeOfFE_P2ttdc1_ (): TypeOfFE(0, 0, 6, 1, Data, 3, 1, 6, 6, Pi_h_coef) { const R2 Pt [] = {Shrink(R2(0, 0)), Shrink(R2(1, 0)), Shrink(R2(0, 1)), Shrink(R2(0.5, 0.5)), Shrink(R2(0, 0.5)), Shrink(R2(0.5, 0))}; for (int i = 0; i < NbDoF; i++) { pij_alpha[i] = IPJ(i, i, 0); P_Pi_h[i] = Pt[i]; } } void FB (const bool *whatd, const Mesh &Th, const Triangle &K, const R2 &P, RNMK_ &val) const; }; // on what nu df on node node of df int TypeOfFE_P1ttdc1_::Data [] = {6, 6, 6, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3}; int TypeOfFE_P2ttdc1_::Data [] = {6, 6, 6, 6, 6, 6, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 6}; double TypeOfFE_P1ttdc1_::Pi_h_coef [] = {1., 1., 1.}; double TypeOfFE_P2ttdc1_::Pi_h_coef [] = {1., 1., 1., 1., 1., 1.}; const R2 TypeOfFE_P2ttdc1_::G(1. / 3., 1. / 3.); const R TypeOfFE_P2ttdc1_::cshrink = 1; const R TypeOfFE_P2ttdc1_::cshrink1 = 1. / TypeOfFE_P2ttdc1_::cshrink; R TypeOfFE_P1ttdc1_::operator () (const FElement &K, const R2 &P1Hat, const KN_ &u, int componante, int op) const { R2 PHat = Shrink1(P1Hat); R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))); R r = 0; if (op == 0) { R l0 = 1 - PHat.x - PHat.y, l1 = PHat.x, l2 = PHat.y; r = u0 * l0 + u1 * l1 + l2 * u2; } else { const Triangle &T = K.T; R2 D0 = T.H(0) * cshrink1, D1 = T.H(1) * cshrink1, D2 = T.H(2) * cshrink1; if (op == 1) { r = D0.x * u0 + D1.x * u1 + D2.x * u2; } else { r = D0.y * u0 + D1.y * u1 + D2.y * u2; } } // cout << r << "\t"; return r; } void TypeOfFE_P1ttdc1_::FB (const bool *whatd, const Mesh &, const Triangle &K, const R2 &P1, RNMK_ &val) const { R2 P = Shrink1(P1); // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]), C(K[2]); R l0 = 1 - P.x - P.y, l1 = P.x, l2 = P.y; if (val.N() < 3) { throwassert(val.N() >= 3); } throwassert(val.M() == 1); // throwassert(val.K()==3 ); val = 0; RN_ f0(val('.', 0, op_id)); if (whatd[op_id]) { f0[0] = l0; f0[1] = l1; f0[2] = l2; } if (whatd[op_dx] || whatd[op_dy]) { R2 Dl0(K.H(0) * cshrink1), Dl1(K.H(1) * cshrink1), Dl2(K.H(2) * cshrink1); if (whatd[op_dx]) { RN_ f0x(val('.', 0, op_dx)); f0x[0] = Dl0.x; f0x[1] = Dl1.x; f0x[2] = Dl2.x; } if (whatd[op_dy]) { RN_ f0y(val('.', 0, op_dy)); f0y[0] = Dl0.y; f0y[1] = Dl1.y; f0y[2] = Dl2.y; } } } void TypeOfFE_P2ttdc1_::FB (const bool *whatd, const Mesh &, const Triangle &K, const R2 &P1, RNMK_ &val) const { R2 P = Shrink1(P1); // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]), C(K[2]); R l0 = 1 - P.x - P.y, l1 = P.x, l2 = P.y; R l4_0 = (4 * l0 - 1), l4_1 = (4 * l1 - 1), l4_2 = (4 * l2 - 1); // throwassert(FE.N == 1); throwassert(val.N() >= 6); throwassert(val.M() == 1); // throwassert(val.K()==3 ); val = 0; // -- if (whatd[op_id]) { RN_ f0(val('.', 0, op_id)); f0[0] = l0 * (2 * l0 - 1); f0[1] = l1 * (2 * l1 - 1); f0[2] = l2 * (2 * l2 - 1); f0[3] = 4 * l1 * l2;// oppose au sommet 0 f0[4] = 4 * l0 * l2;// oppose au sommet 1 f0[5] = 4 * l1 * l0;// oppose au sommet 3 } if (whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0) * cshrink1), Dl1(K.H(1) * cshrink1), Dl2(K.H(2) * cshrink1); if (whatd[op_dx]) { RN_ f0x(val('.', 0, op_dx)); f0x[0] = Dl0.x * l4_0; f0x[1] = Dl1.x * l4_1; f0x[2] = Dl2.x * l4_2; f0x[3] = 4 * (Dl1.x * l2 + Dl2.x * l1); f0x[4] = 4 * (Dl2.x * l0 + Dl0.x * l2); f0x[5] = 4 * (Dl0.x * l1 + Dl1.x * l0); } if (whatd[op_dy]) { RN_ f0y(val('.', 0, op_dy)); f0y[0] = Dl0.y * l4_0; f0y[1] = Dl1.y * l4_1; f0y[2] = Dl2.y * l4_2; f0y[3] = 4 * (Dl1.y * l2 + Dl2.y * l1); f0y[4] = 4 * (Dl2.y * l0 + Dl0.y * l2); f0y[5] = 4 * (Dl0.y * l1 + Dl1.y * l0); } if (whatd[op_dxx]) { RN_ fxx(val('.', 0, op_dxx)); fxx[0] = 4 * Dl0.x * Dl0.x; fxx[1] = 4 * Dl1.x * Dl1.x; fxx[2] = 4 * Dl2.x * Dl2.x; fxx[3] = 8 * Dl1.x * Dl2.x; fxx[4] = 8 * Dl0.x * Dl2.x; fxx[5] = 8 * Dl0.x * Dl1.x; } if (whatd[op_dyy]) { RN_ fyy(val('.', 0, op_dyy)); fyy[0] = 4 * Dl0.y * Dl0.y; fyy[1] = 4 * Dl1.y * Dl1.y; fyy[2] = 4 * Dl2.y * Dl2.y; fyy[3] = 8 * Dl1.y * Dl2.y; fyy[4] = 8 * Dl0.y * Dl2.y; fyy[5] = 8 * Dl0.y * Dl1.y; } if (whatd[op_dxy]) { assert(val.K() > op_dxy); RN_ fxy(val('.', 0, op_dxy)); fxy[0] = 4 * Dl0.x * Dl0.y; fxy[1] = 4 * Dl1.x * Dl1.y; fxy[2] = 4 * Dl2.x * Dl2.y; fxy[3] = 4 * (Dl1.x * Dl2.y + Dl1.y * Dl2.x); fxy[4] = 4 * (Dl0.x * Dl2.y + Dl0.y * Dl2.x); fxy[5] = 4 * (Dl0.x * Dl1.y + Dl0.y * Dl1.x); } } } // // end ttdc1_ // ------------------ static void SetPtPkDC (R3 *Pt, int kk, int nn, R cc = 1) { // P0 P1 et P2 , P1b const int d = 3; int n = 0; double dK = kk; double cc1 = 1 - cc;// const R3 G = R3::diag(1. / (d + 1));// barycenter for (int i = 0; i <= kk; ++i) { for (int j = 0; j <= kk - i; ++j) { for (int k = 0; k <= kk - i - j; ++k) { int l = kk - i - j - k; ffassert(l >= 0 && l <= kk); Pt[n++] = R3(k / dK, j / dK, i / dK) * cc + G * cc1; } } } ffassert(n == nn); if (verbosity > 9) { cout << " Pkdc = " << KN_(Pt, nn) << "\n"; } } class TypeOfFE_LagrangeDC3d: public GTypeOfFE { // typedef typename MMesh Mesh; public: typedef Mesh3 Mesh; typedef Mesh::Element Element; typedef Element::Rd Rd; typedef Element::RdHat RdHat; static const int d = Rd::d; const R cshrink; const R cshrink1; static const Rd G; // (1 -1/3)* Rd Shrink (const Rd &P) const {return (P - G) * cshrink + G;} Rd Shrink1 (const Rd &P) const {return (P - G) * cshrink1 + G;} const int k; struct A4 { int dfon[4]; A4 (int k) { // (k+3)(k+2)(k+1) / 6 // d== 3 int ndf = (d == 3) ? ((k + 3) * (k + 2) * (k + 1) / 6) : ((d == 2) ? ((k + 2) * (k + 1) / 2) : k + 1); dfon[0] = dfon[1] = dfon[2] = dfon[3] = 0; dfon[d] = ndf; if (verbosity > 9) { cout << "A4 " << k << " " << dfon[0] << dfon[1] << dfon[2] << dfon[3] << endl; } } operator const int * () const {return dfon;} }; RdHat *Pt; TypeOfFE_LagrangeDC3d (int kk, R cc): // dfon ,N,nsub(graphique) , const mat interpolation , discontinuous GTypeOfFE(A4(kk), 1, Max(kk, 1), true, true), cshrink(cc), cshrink1(1. / cc), k(kk) { int n = this->NbDoF; if (verbosity > 9) { cout << "\n +++ Pdc" << k << " : ndof : " << n << endl; } SetPtPkDC(this->PtInterpolation, k, this->NbDoF, cc); if (verbosity > 9) {cout << this->PtInterpolation << endl;} { for (int i = 0; i < n; i++) { this->pInterpolation[i] = i; this->cInterpolation[i] = 0; this->dofInterpolation[i] = i; this->coefInterpolation[i] = 1.; } } /* * inv de a M1 + b Id = a1 M1 + b1 Id ( M1 : mat / m_ij =1 ) * M*M = (d+1) M => * b1 = 1/b * a1 = -b / ((d+1)a+1) */ } ~TypeOfFE_LagrangeDC3d () {}// cout << "TypeOfFE_LagrangeDC3d"<< this->NbDoF< &u, int componante, int op) const; private: TypeOfFE_LagrangeDC3d (const TypeOfFE_LagrangeDC3d &); void operator = (const TypeOfFE_LagrangeDC3d &); }; void TypeOfFE_LagrangeDC3d::FB (const What_d whatd, const Mesh &Th, const Element &K, const Rd &P1, RNMK_ &val) const { // const Triangle & K(FE.T); R3 P = this->Shrink1(P1); R l [] = {1. - P.sum(), P.x, P.y, P.z}; assert(val.N() >= Element::nv); assert(val.M() == 1); val = 0; RN_ f0(val('.', 0, op_id)); if (whatd & Fop_D0) { f0[0] = l[0]; f0[1] = l[1]; f0[2] = l[2]; f0[3] = l[3]; } if (whatd & Fop_D1) { R3 Dl[4]; K.Gradlambda(Dl); for (int i = 0; i < 4; ++i) { Dl[i] *= cshrink1; } // for(int i=0;i<4;++i) // cout << Dl[i] << endl; if (whatd & Fop_dx) { RN_ f0x(val('.', 0, op_dx)); f0x[0] = Dl[0].x; f0x[1] = Dl[1].x; f0x[2] = Dl[2].x; f0x[3] = Dl[3].x; } if (whatd & Fop_dy) { RN_ f0y(val('.', 0, op_dy)); f0y[0] = Dl[0].y; f0y[1] = Dl[1].y; f0y[2] = Dl[2].y; f0y[3] = Dl[3].y; } if (whatd & Fop_dz) { RN_ f0z(val('.', 0, op_dz)); f0z[0] = Dl[0].z; f0z[1] = Dl[1].z; f0z[2] = Dl[2].z; f0z[3] = Dl[3].z; } } // cout << val << endl; } R TypeOfFE_LagrangeDC3d::operator () (const FElement &K, const R3 &PHat1, const KN_ &u, int componante, int op) const { R3 PHat = Shrink1(PHat1); R r = 0; if (k == 1) { R u0(u(K(0))), u1(u(K(1))), u2(u(K(2))), u3(u(K(3))); if (op == 0) { R l[4]; PHat.toBary(l); r = u0 * l[0] + u1 * l[1] + l[2] * u2 + l[3] * u3; } else if (op == op_dx || op == op_dy || op == op_dz) { const Element &T = K.T; R3 D[4]; T.Gradlambda(D); for (int i = 0; i < 4; ++i) { D[i] *= cshrink1; } if (op == op_dx) { r = D[0].x * u0 + D[1].x * u1 + D[2].x * u2 + D[3].x * u3; } else if (op == op_dy) { r = D[0].y * u0 + D[1].y * u1 + D[2].y * u2 + D[3].y * u3; } else { r = D[0].z * u0 + D[1].z * u1 + D[2].z * u2 + D[3].z * u3; } } } else { ffassert(0);// to do .. } return r; } const R3 TypeOfFE_LagrangeDC3d::G(1. / 4., 1. / 4., 1. / 4.); } // FEM2d namespace static void finit () { // link with FreeFem++ static TypeOfFE_P1ttdc1_ P1dc1LagrangeP1dc1; static TypeOfFE_P2ttdc1_ P2dc1LagrangeP2dc1; static TypeOfFE_LagrangeDC3d TypeOfFE_LagrangeDC3dtt(1, 0.999); static TypeOfFE_LagrangeDC3d TypeOfFE_LagrangeDC3dtt1(1, 1.); // a static variable to add the finite element to freefem++ static AddNewFE P1dcLagrange("P1dc1", &P1dc1LagrangeP1dc1); static AddNewFE P2dcLagrange("P2dc1", &P2dc1LagrangeP2dc1); static AddNewFE3 P1dttLagrange3d("P1dc3d", &TypeOfFE_LagrangeDC3dtt, "P1dc"); static AddNewFE3 P1dttLagrange3d1("P1dc3d1", &TypeOfFE_LagrangeDC3dtt1); } LOADFUNC(finit) // --- fin -- freefem++-3.61-1/examples++-load/PARDISO.cpp000644 000767 000024 00000020433 13312446271 020273 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : PARDISO interface // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Pierre Jolivet // E-MAIL : pierre.joliver@enseeiht.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: mkl //ff-c++-cpp-dep: // *INDENT-ON* // // #include #include #include #include #if 0 #include #else extern "C" { extern int omp_get_max_threads (void); extern int omp_get_num_threads (void); extern void omp_set_num_threads (int); } #endif #include "rgraph.hpp" #include "AFunction.hpp" #include "MatriceCreuse.hpp" #include "dmatrix.hpp" template struct PARDISO_STRUC_TRAIT {typedef void R; static const int unSYM = 0; static const int SYM = 0;}; template<> struct PARDISO_STRUC_TRAIT {typedef double R; static const int unSYM = 11; static const int SYM = 2;}; template<> struct PARDISO_STRUC_TRAIT {typedef Complex R; static const int unSYM = 13; static const int SYM = -4;}; void mkl_csrcsc (MKL_INT *job, MKL_INT *n, Complex *Acsr, MKL_INT *AJ0, MKL_INT *AI0, Complex *Acsc, MKL_INT *AJ1, MKL_INT *AI1, MKL_INT *info) {mkl_zcsrcsc(job, n, reinterpret_cast(Acsr), AJ0, AI0, reinterpret_cast(Acsc), AJ1, AI1, info);} void mkl_csrcsc (MKL_INT *job, MKL_INT *n, double *Acsr, MKL_INT *AJ0, MKL_INT *AI0, double *Acsc, MKL_INT *AJ1, MKL_INT *AI1, MKL_INT *info) {mkl_dcsrcsc(job, n, Acsr, AJ0, AI0, Acsc, AJ1, AI1, info);} template class SolverPardiso: public MatriceMorse::VirtualSolver { private: mutable void *_pt[64]; mutable MKL_INT _mtype; mutable MKL_INT _iparm[64]; mutable MatriceMorse *ptA; MKL_INT *_I; MKL_INT *_J; public: typedef typename PARDISO_STRUC_TRAIT::R MR; SolverPardiso (const MatriceMorse &A, KN ¶m_int, KN ¶m_double) { ptA = (MatriceMorse *)(&A); MKL_INT phase, error, msglvl; MR ddum; R *_C; if (A.symetrique) { _mtype = PARDISO_STRUC_TRAIT::SYM; } else { if (param_int) { _mtype = param_int[0]; } else { _mtype = PARDISO_STRUC_TRAIT::unSYM; } } for (unsigned short i = 0; i < 64; ++i) { _iparm[i] = 0; _pt[i] = NULL; } _iparm[0] = 1; /* No solver default */ _iparm[1] = 3; /* Fill-in reordering from METIS */ _iparm[2] = 1; _iparm[3] = 0; /* No iterative-direct algorithm */ _iparm[4] = 0; /* No user fill-in reducing permutation */ _iparm[5] = 0; /* Write solution into rhs */ _iparm[6] = 0; /* Not in use */ _iparm[7] = 0; /* Max numbers of iterative refinement steps */ _iparm[8] = 0; /* Not in use */ _iparm[9] = 13; /* Perturb the pivot elements with 1E-13 */ _iparm[10] = 1; /* Use nonsymmetric permutation and scaling MPS */ _iparm[11] = 0; /* Not in use */ _iparm[12] = 0; /* Maximum weighted matching algorithm is switched-off (default for symmetric). Try _iparm[12] = 1 in case of inappropriate accuracy */ _iparm[13] = 0; /* Output: Number of perturbed pivots */ _iparm[14] = 0; /* Not in use */ _iparm[15] = 0; /* Not in use */ _iparm[16] = 0; /* Not in use */ _iparm[17] = -1;/* Output: Number of nonzeros in the factor LU */ _iparm[18] = -1;/* Output: Mflops for LU factorization */ _iparm[19] = 0; /* Output: Numbers of CG Iterations */ _iparm[34] = 1; msglvl = 0; /* Print statistical information in file */ if (verbosity > 1) { msglvl = 1; } error = 0; /* Initialize error flag */ phase = 12; MKL_INT one = 1; MKL_INT n = A.n; if (_mtype != 2) { _I = A.lg; _J = A.cl; _C = A.a; } else { if (A.symetrique) { int job[6] = {0, 0, 0, 0, 0, 1}; _I = new MKL_INT[n + 1]; _J = new MKL_INT[A.nbcoef]; _C = new R[A.nbcoef]; mkl_csrcsc(job, &n, reinterpret_cast(A.a), A.cl, A.lg, reinterpret_cast(_C), _J, _I, &error); } else { _I = new MKL_INT[n + 1]; _J = new MKL_INT[n + (A.nbcoef - n) / 2]; _C = new R[n + (A.nbcoef - n) / 2]; trimCSR(n, _I, A.lg, _J, A.cl, _C, A.a); } } PARDISO(_pt, &one, &one, &_mtype, &phase, &n, reinterpret_cast(_C), _I, _J, &one, &one, _iparm, &msglvl, &ddum, &ddum, &error); if (_C != A.a) { delete [] _C; } }; void Solver (const MatriceMorse &A, KN_ &x, const KN_ &b) const { MKL_INT one = 1; MKL_INT msglvl = 0; if (verbosity > 1) { msglvl = 1; } MKL_INT error = 0; MKL_INT phase = 33; MR ddum; MKL_INT n = A.n; PARDISO(_pt, &one, &one, &_mtype, &phase, &n, &ddum, _I, _J, &one, &one, _iparm, &msglvl, reinterpret_cast((R *)b), reinterpret_cast((R *)x), &error); }; ~SolverPardiso () { MKL_INT phase = -1; MKL_INT one = 1; MKL_INT msglvl = 0; MKL_INT error; MR ddum; MKL_INT idum; MKL_INT n = ptA->n; PARDISO(_pt, &one, &one, &_mtype, &phase, &n, &ddum, &idum, &idum, &one, &one, _iparm, &msglvl, &ddum, &ddum, &error); if (_mtype == 2) { if (_I) { delete [] _I; } if (_J) { delete [] _J; } } }; }; template typename MatriceMorse::VirtualSolver*buildSolver (DCL_ARG_SPARSE_SOLVER(R, A)) { return new SolverPardiso(*A, ds.lparams, ds.dparams); } extern TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue; bool SetPARDISO () { if (verbosity > 1) { cout << " SetDefault sparse solver to MUMPS" << endl; } DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return 0; } /* class Init { * public: * Init(); * }; * * * * $1 */ static long ffompgetnumthreads () {return omp_get_num_threads();} static long ffompgetmaxthreads () {return omp_get_max_threads();} static long ffompsetnumthreads (long n) {omp_set_num_threads(n); return n;} static void Load_Init () { // }static void initPARDISO() // { if (verbosity > 1) { cout << "\n Add: PARDISO: defaultsolver defaultsolverPARDISO" << endl; } TypeSolveMat::defaultvalue = TypeSolveMat::SparseSolver; DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; if (!Global.Find("defaulttoPARDISO").NotNull()) { Global.Add("defaulttoPARDISO", "(", new OneOperator0(SetPARDISO)); } if (!Global.Find("ompsetnumthreads").NotNull()) { Global.Add("ompsetnumthreads", "(", new OneOperator1(ffompsetnumthreads)); } if (!Global.Find("ompgetnumthreads").NotNull()) { Global.Add("ompgetnumthreads", "(", new OneOperator0(ffompgetnumthreads)); } if (!Global.Find("ompgetmaxthreads").NotNull()) { Global.Add("ompgetmaxthreads", "(", new OneOperator0(ffompgetmaxthreads)); } } // LOADFUNC(initPARDISO); LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/pcm.cpp000644 000767 000024 00000016316 13312446271 017756 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Methods for the PCM class // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Dion Crannitch // Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // /* * Author: Dion Crannitch (adapted from Dave Mason's complexMap class) * Last Modified : 22 June 1999 * Last Modified: 20 Oct. 2009 (F. Hecht, Frederic.Hecht@upmc.fr) for g++ v4 * change ENDIANESS interface * add missing read max value in file * add const in char * declaration for g++-4. * change 32 in 4 for the size of float . */ #include #include #include #include // #include "bytesex.h" #include #include "pcm.hpp" #include using namespace std; #define BINARY_IN ios::binary | ios::in #define BINARY_OUT ios::binary | ios::out #define TOKEN_SIZE 100 PCM::PCM (int w, int h) { width = w; height = h; pixels = w * h; max = 0.0; image = new pcm_complex[pixels]; } PCM::PCM (const char *filename) : image(0) { Load(filename); } void PCM::CalcMax () { unsigned long p; float i, r, m; max = m = 0.0; for (p = 0; p < pixels; p++) { r = image[p].r; i = image[p].i; m = r * r + i * i; if (m > max) {max = m;} } max = sqrt(max); } void PCM::Set (int x, int y, pcm_complex c) { if ((x >= 0) && (y >= 0) && (x < width) && (y < height)) { image[(y * width) + x] = c; } } pcm_complex *PCM::Get (int x, int y) { if ((x >= 0) && (y >= 0) && (x < width) && (y < height)) { return &image[(y * width) + x]; } else { return NULL; } } PCM::~PCM () { delete [] image; } // fatal error function - print error message then exit void fatal_error (const char *mesg) { fprintf(stderr, "%s\nFatal error - exitting\n", mesg); exit(0); } /* For compatibility between systems, the floats in PCM files are * always saved as little endian. Therefore on big endian platforms, * they must be converted during load and save procedures. */ // change float from BIG_ENDIAN to LITTLE_ENDIAN and vice versa void swap_float_endian (float *number) { if (sizeof(float) != 4) { fatal_error("PCM -> sizeof(float) != 4.\nProgram cannot continue - exiting."); } float in = *number; float out; ((char *)&out)[0] = ((char *)&in)[3]; ((char *)&out)[1] = ((char *)&in)[2]; ((char *)&out)[2] = ((char *)&in)[1]; ((char *)&out)[3] = ((char *)&in)[0]; *number = out; } // dummy function void do_nothing (float *number) { // do nothing } // get a token from the input stream void extract_token (ifstream &input_stream, char *token, int max_size) { int count = 0; char ch; // skip any whitespace or comments do { input_stream.read((char *)&ch, sizeof(char)); // if we've hit a comment char then read till the next "\n" if (ch == '#') { while (ch != '\n') { input_stream.read((char *)&ch, sizeof(char *)); } } } while (ch == ' ' || ch == '\t' || ch == '\n'); // copy data into 'token' do { if (count >= max_size - 1) {fatal_error("extract_token -> token too large");} token[count++] = ch; input_stream.read((char *)&ch, sizeof(char)); } while (ch != ' ' && ch != '\t' && ch != '\n' && ch != '.'); input_stream.putback(ch); token[count] = '\0'; } void PCM::Load (const char *filename) { char token[TOKEN_SIZE]; ifstream input_stream(filename, BINARY_IN); if (!input_stream) {fatal_error("PCM::Load -> file not found.");} // check magic number extract_token(input_stream, token, TOKEN_SIZE); if (strcmp(token, "PC") != 0) { fprintf(stderr, "Magic number \"%s\" != PC\n", token); fatal_error("PCM::Load -> bad magic number"); } // get dimensions extract_token(input_stream, token, TOKEN_SIZE); width = atoi(token); extract_token(input_stream, token, TOKEN_SIZE); height = atoi(token); extract_token(input_stream, token, TOKEN_SIZE); max = atof(token); cout << " pcm : " << width << "x" << height << " max :" << max << endl; // Reallocate memory, if necessary. unsigned long p = (long)(width * height); if (p != pixels) { pixels = p; if (image) { delete [] image; image = NULL; } } if (!image) {image = new pcm_complex[pixels];} // skip max cols extract_token(input_stream, token, TOKEN_SIZE); char ch; input_stream.read((char *)&ch, sizeof(char)); // if machine is big endian then we need to convert floats from little endian void (*endian_filter)(float *); int i4 = 1; char zero_is_little_endian = *((static_cast((void *)&i4)) + 3); if (zero_is_little_endian == 0) { endian_filter = (void (*)(float *))do_nothing; } else { endian_filter = (void (*)(float *))swap_float_endian; } // read data for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { pcm_complex c; input_stream.read((char *)(void *)&c.r, sizeof(c.r)); input_stream.read((char *)(void *)&c.i, sizeof(c.i)); if (x < 0 && y < 0) { cout << x << y << " " << c.r << " " << c.i << endl; } endian_filter(&c.r); endian_filter(&c.i); Set(x, y, c); } } input_stream.close(); } void PCM::Save (const char *filename) { ofstream output_stream(filename, BINARY_OUT); if (!output_stream) {fatal_error("PCM::Save -> error creating file.");} // find the maximum vector magnitude CalcMax(); char header[100]; sprintf(header, "PC\n%d %d\n%f\n", width, height, max); output_stream.write(header, strlen(header)); void (*endian_filter)(float *); int i4 = 1; char zero_is_little_endian = *((static_cast((void *)&i4)) + 3); if (zero_is_little_endian == 0) { endian_filter = (void (*)(float *))do_nothing; } else { endian_filter = (void (*)(float *))swap_float_endian; } // write data pcm_complex *c; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { c = Get(x, y); if (c) { endian_filter(&(c->r)); endian_filter(&(c->i)); output_stream.write((const char *)(const void *)&(c->r), sizeof(c->r)); output_stream.write((const char *)(const void *)&(c->i), sizeof(c->i)); } } } output_stream.close(); } freefem++-3.61-1/examples++-load/VarIneq2.edp000644 000767 000024 00000007705 13256636774 020636 0ustar00hechtstaff000000 000000 load "ff-NLopt" //A brief script to demonstrate how to use the freefemm interfaced nlopt routines //The problem consist in solving a simple variational inequality using one of the //optimization algorithm of nlopt. We restart the algorithlm a few times agter //performing some mesh adaptation to get a more precise output. int kas = 3; // choose of the algo ... int NN = 10; mesh Th = square(NN,NN); func f1=1.; func f2=-1.; func g1=0.; func g2=0.1; int iter=0; int nadapt=2; real starttol=1e-6,bctol=6.e-12; fespace Vh(Th,P1); Vh oldu1,oldu2; for(int al=0;al. */ /****************************************************************************/ // SUMMARY : CMA-ES for non-linear function minimization // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Nikolaus Hansen // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // /* --- Changes : --- * 03/03/21: argument const double *rgFunVal of * cmaes_ReestimateDistribution() was treated incorrectly. * 03/03/29: restart via cmaes_resume_distribution() implemented. * 03/03/30: Always max std dev / largest axis is printed first. * 03/08/30: Damping is adjusted for large mueff. * 03/10/30: Damping is adjusted for large mueff always. * 04/04/22: Cumulation time and damping for step size adjusted. * No iniphase but conditional update of pc. * 05/03/15: in ccov-setting mucov replaced by mueff. * 05/10/05: revise comment on resampling in example.c * 05/10/13: output of "coorstddev" changed from sigma * C[i][i] * to correct sigma * sqrt(C[i][i]). * 05/11/09: Numerical problems are not anymore handled by increasing * sigma, but lead to satisfy a stopping criterion in * cmaes_Test(). * 05/11/09: Update of eigensystem and test for numerical problems * moved right before sampling. * 06/02/24: Non-ansi array definitions replaced (thanks to Marc * Toussaint). * 06/02/25: Overflow in time measurement for runs longer than * 2100 seconds. This could lead to stalling the * covariance matrix update for long periods. * Time measurement completely rewritten. * 06/02/26: Included population size lambda as parameter to * cmaes_init (thanks to MT). * 06/02/26: Allow no initial reading/writing of parameters via * "non" and "writeonly" keywords for input parameter * filename in cmaes_init. * 06/02/27: Optimized code regarding time spent in updating the * covariance matrix in function Adapt_C2(). * 07/08/03: clean up and implementation of an exhaustive test * of the eigendecomposition (via #ifdef for now) * 07/08/04: writing of output improved * 07/08/xx: termination criteria revised and more added, * damp replaced by damps=damp*cs, documentation improved. * Interface significantly changed, evaluateSample function * and therefore the function pointer argument removed. * Renaming of functions in accordance with Java code. * Clean up of parameter names, mainly in accordance with * Matlab conventions. Most termination criteria can be * changed online now. Many more small changes, but not in * the core procedure. * 07/10/29: ReSampleSingle() got a better interface. ReSampleSingle() * is now ReSampleSingle_old only for backward * compatibility. Also fixed incorrect documentation. The new * function SampleSingleInto() has an interface similar to * the old ReSampleSingle(), but is not really necessary. * 07/11/20: bug: stopMaxIter did not translate into the correct default * value but into -1 as default. This lead to a too large * damps and the termination test became true from the first * iteration. (Thanks to Michael Calonder) * 07/11/20: new default stopTolFunHist = 1e-13; (instead of zero) * 08/09/26: initial diagonal covariance matrix in code, but not * yet in interface * 08/09/27: diagonalCovarianceMatrix option in initials.par provided * 08/10/17: uncertainty handling implemented in example3.c. * PerturbSolutionInto() provides the optional small * perturbations before reevaluation. * 10/10/16: TestForTermination changed such that diagonalCovarianceMatrix * option now yields linear time behavior * * Wish List * * o as writing time is measure for all files at once, the display * cannot be independently written to a file via signals.par, while * this would be desirable. * * o clean up sorting of eigenvalues and vectors which is done repeatedly. * * o either use cmaes_Get() in cmaes_WriteToFilePtr(): revise the * cmaes_write that all keywords available with get and getptr are * recognized. Also revise the keywords, keeping backward * compatibility. (not only) for this it would be useful to find a * way how cmaes_Get() signals an unrecognized keyword. For GetPtr * it can return NULL. * * o or break cmaes_Get() into single getter functions, being a nicer * interface, and compile instead of runtime error, and faster. For * file signals.par it does not help. * * o writing data depending on timing in a smarter way, e.g. using 10% * of all time. First find out whether clock() is useful for measuring * disc writing time and then timings_t class can be utilized. * For very large dimension the default of 1 seconds waiting might * be too small. * * o allow modification of best solution depending on delivered f(xmean) * * o re-write input and output procedures */ #include /* sqrt() */ #include /* size_t */ #include /* NULL, free */ #include /* strlen() */ #include /* sprintf(), NULL? */ #include "cmaes_interface.h"/* via cmaes.h */ /* --------------------------------------------------------- */ /* ------------------- Declarations ------------------------ */ /* --------------------------------------------------------- */ /* ------------------- External Visibly -------------------- */ /* see cmaes_interface.h for those, not listed here */ long random_init (random_t *, long unsigned seed /* 0==clock */); void random_exit (random_t *); double random_Gauss (random_t *); /* (0,1)-normally distributed */ double random_Uniform (random_t *); long random_Start (random_t *, long unsigned seed /* 0==1 */); void timings_init (timings_t *timing); void timings_start (timings_t *timing); /* fields totaltime and tictoctime */ double timings_update (timings_t *timing); void timings_tic (timings_t *timing); double timings_toc (timings_t *timing); void readpara_init (readpara_t *, int dim, int seed, const double *xstart, const double *sigma, int lambda, const char *filename); void readpara_exit (readpara_t *); void readpara_ReadFromFile (readpara_t *, const char *szFileName); void readpara_SupplementDefaults (readpara_t *); void readpara_SetWeights (readpara_t *, const char *mode); void readpara_WriteToFile (readpara_t *, const char *filenamedest, const char *parafilesource); double const*cmaes_SetMean (cmaes_t *, const double *xmean); double*cmaes_PerturbSolutionInto (cmaes_t *t, double *xout, double const *xin, double eps); void cmaes_WriteToFile (cmaes_t *, const char *key, const char *name); void cmaes_WriteToFileAW (cmaes_t *t, const char *key, const char *name, const char *append); void cmaes_WriteToFilePtr (cmaes_t *, const char *key, FILE *fp); void cmaes_ReadFromFilePtr (cmaes_t *, FILE *fp); void cmaes_FATAL (char const *s1, char const *s2, char const *s3, char const *s4); /* ------------------- Locally visibly ----------------------- */ static char*getTimeStr (void); static void TestMinStdDevs (cmaes_t *); /* static void WriteMaxErrorInfo( cmaes_t *); */ static void Eigen (int N, double **C, double *diag, double **Q, double *rgtmp); static int Check_Eigen (int N, double **C, double *diag, double **Q); static void QLalgo2 (int n, double *d, double *e, double **V); static void Householder2 (int n, double **V, double *d, double *e); static void Adapt_C2 (cmaes_t *t, int hsig); static void FATAL (char const *sz1, char const *s2, char const *s3, char const *s4); static void ERRORMESSAGE (char const *sz1, char const *s2, char const *s3, char const *s4); static void Sorted_index (const double *rgFunVal, int *index, int n); static int SignOfDiff (const void *d1, const void *d2); static double douSquare (double); static double rgdouMax (const double *rgd, int len); static double rgdouMin (const double *rgd, int len); static double douMax (double d1, double d2); static double douMin (double d1, double d2); static int intMin (int i, int j); static int MaxIdx (const double *rgd, int len); static int MinIdx (const double *rgd, int len); static double myhypot (double a, double b); static double*new_double (int n); static void*new_void (int n, size_t size); /* --------------------------------------------------------- */ /* ---------------- Functions: cmaes_t --------------------- */ /* --------------------------------------------------------- */ static char * getTimeStr (void) { time_t tm = time(0); static char s[33]; /* get time */ strncpy(s, ctime(&tm), 24); /* TODO: hopefully we read something useful */ s[24] = '\0'; /* cut the \n */ return s; } char * cmaes_SayHello (cmaes_t *t) { /* write initial message */ sprintf(t->sOutString, "(%d,%d)-CMA-ES(mu_eff=%.1f), Ver=\"%s\", dimension=%d, diagonalIterations=%ld, randomSeed=%d (%s)", t->sp.mu, t->sp.lambda, t->sp.mueff, t->version, t->sp.N, (long)t->sp.diagonalCov, t->sp.seed, getTimeStr()); return t->sOutString; } double * cmaes_init (cmaes_t *t, /* "this" */ int dimension, double *inxstart, double *inrgstddev, /* initial stds */ long int inseed, int lambda, const char *input_parameter_filename) { int i, j, N; double dtest, trace; t->version = "3.11.00.beta"; readpara_init(&t->sp, dimension, inseed, inxstart, inrgstddev, lambda, input_parameter_filename); t->sp.seed = random_init(&t->rand, (long unsigned int)t->sp.seed); N = t->sp.N;/* for convenience */ /* initialization */ for (i = 0, trace = 0.; i < N; ++i) { trace += t->sp.rgInitialStds[i] * t->sp.rgInitialStds[i]; } t->sigma = sqrt(trace / N); /* t->sp.mueff/(0.2*t->sp.mueff+sqrt(N)) * sqrt(trace/N); */ t->chiN = sqrt((double)N) * (1. - 1. / (4. * N) + 1. / (21. * N * N)); t->flgEigensysIsUptodate = 1; t->flgCheckEigen = 0; t->genOfEigensysUpdate = 0; timings_init(&t->eigenTimings); t->flgIniphase = 0; /* do not use iniphase, hsig does the job now */ t->flgresumedone = 0; t->flgStop = 0; for (dtest = 1.; dtest && dtest < 1.1 * dtest; dtest *= 2.) { if (dtest == dtest + 1.) { break; } } t->dMaxSignifKond = dtest / 1000.; /* not sure whether this is really save, 100 does not work well enough */ t->gen = 0; t->countevals = 0; t->state = 0; t->dLastMinEWgroesserNull = 1.0; t->printtime = t->writetime = t->firstwritetime = t->firstprinttime = 0; t->rgpc = new_double(N); t->rgps = new_double(N); t->rgdTmp = new_double(N + 1); t->rgBDz = new_double(N); t->rgxmean = new_double(N + 2); t->rgxmean[0] = N; ++t->rgxmean; t->rgxold = new_double(N + 2); t->rgxold[0] = N; ++t->rgxold; t->rgxbestever = new_double(N + 3); t->rgxbestever[0] = N; ++t->rgxbestever; t->rgout = new_double(N + 2); t->rgout[0] = N; ++t->rgout; t->rgD = new_double(N); t->C = (double **)new_void(N, sizeof(double *)); t->B = (double **)new_void(N, sizeof(double *)); t->publicFitness = new_double(t->sp.lambda); t->rgFuncValue = new_double(t->sp.lambda + 1); t->rgFuncValue[0] = t->sp.lambda; ++t->rgFuncValue; t->arFuncValueHist = new_double(10 + (int)ceil(3. * 10. * N / t->sp.lambda) + 1); t->arFuncValueHist[0] = (double)(10 + (int)ceil(3. * 10. * N / t->sp.lambda)); t->arFuncValueHist++; for (i = 0; i < N; ++i) { t->C[i] = new_double(i + 1); t->B[i] = new_double(N); } t->index = (int *)new_void(t->sp.lambda, sizeof(int)); for (i = 0; i < t->sp.lambda; ++i) { t->index[i] = i;/* should not be necessary */ } t->rgrgx = (double **)new_void(t->sp.lambda, sizeof(double *)); for (i = 0; i < t->sp.lambda; ++i) { t->rgrgx[i] = new_double(N + 2); t->rgrgx[i][0] = N; t->rgrgx[i]++; } /* Initialize newed space */ for (i = 0; i < N; ++i) { for (j = 0; j < i; ++j) { t->C[i][j] = t->B[i][j] = t->B[j][i] = 0.; } } for (i = 0; i < N; ++i) { t->B[i][i] = 1.; t->C[i][i] = t->rgD[i] = t->sp.rgInitialStds[i] * sqrt(N / trace); t->C[i][i] *= t->C[i][i]; t->rgpc[i] = t->rgps[i] = 0.; } t->minEW = rgdouMin(t->rgD, N); t->minEW = t->minEW * t->minEW; t->maxEW = rgdouMax(t->rgD, N); t->maxEW = t->maxEW * t->maxEW; t->maxdiagC = t->C[0][0]; for (i = 1; i < N; ++i) { if (t->maxdiagC < t->C[i][i]) { t->maxdiagC = t->C[i][i]; } } t->mindiagC = t->C[0][0]; for (i = 1; i < N; ++i) { if (t->mindiagC > t->C[i][i]) { t->mindiagC = t->C[i][i]; } } /* set xmean */ for (i = 0; i < N; ++i) { t->rgxmean[i] = t->rgxold[i] = t->sp.xstart[i]; } /* use in case xstart as typicalX */ if (t->sp.typicalXcase) { for (i = 0; i < N; ++i) { t->rgxmean[i] += t->sigma * t->rgD[i] * random_Gauss(&t->rand); } } if (strcmp(t->sp.resumefile, "_no_") != 0) { cmaes_resume_distribution(t, t->sp.resumefile); } return t->publicFitness; } /* cmaes_init() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void cmaes_resume_distribution (cmaes_t *t, char *filename) { int i, j, res, n; double d; FILE *fp = fopen(filename, "r"); if (fp == 0) { ERRORMESSAGE("cmaes_resume_distribution(): could not open '", filename, "'", 0); return; } /* count number of "resume" entries */ i = 0; res = 0; while (1) { if ((res = fscanf(fp, " resume %lg", &d)) == EOF) { break; } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { i += 1; } } /* go to last "resume" entry */ n = i; i = 0; res = 0; rewind(fp); while (i < n) { if ((res = fscanf(fp, " resume %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): Unexpected error, bug", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { ++i; } } if (d != t->sp.N) { FATAL("cmaes_resume_distribution(): Dimension numbers do not match", 0, 0, 0); } /* find next "xmean" entry */ while (1) { if ((res = fscanf(fp, " xmean %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): 'xmean' not found", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { break; } } /* read xmean */ t->rgxmean[0] = d; res = 1; for (i = 1; i < t->sp.N; ++i) { res += fscanf(fp, " %lg", &t->rgxmean[i]); } if (res != t->sp.N) { FATAL("cmaes_resume_distribution(): xmean: dimensions differ", 0, 0, 0); } /* find next "path for sigma" entry */ while (1) { if ((res = fscanf(fp, " path for sigma %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): 'path for sigma' not found", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { break; } } /* read ps */ t->rgps[0] = d; res = 1; for (i = 1; i < t->sp.N; ++i) { res += fscanf(fp, " %lg", &t->rgps[i]); } if (res != t->sp.N) { FATAL("cmaes_resume_distribution(): ps: dimensions differ", 0, 0, 0); } /* find next "path for C" entry */ while (1) { if ((res = fscanf(fp, " path for C %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): 'path for C' not found", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { break; } } /* read pc */ t->rgpc[0] = d; res = 1; for (i = 1; i < t->sp.N; ++i) { res += fscanf(fp, " %lg", &t->rgpc[i]); } if (res != t->sp.N) { FATAL("cmaes_resume_distribution(): pc: dimensions differ", 0, 0, 0); } /* find next "sigma" entry */ while (1) { if ((res = fscanf(fp, " sigma %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): 'sigma' not found", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { break; } } t->sigma = d; /* find next entry "covariance matrix" */ while (1) { if ((res = fscanf(fp, " covariance matrix %lg", &d)) == EOF) { FATAL("cmaes_resume_distribution(): 'covariance matrix' not found", 0, 0, 0); } else if (res == 0) { fscanf(fp, " %*s"); } else if (res > 0) { break; } } /* read C */ t->C[0][0] = d; res = 1; for (i = 1; i < t->sp.N; ++i) { for (j = 0; j <= i; ++j) { res += fscanf(fp, " %lg", &t->C[i][j]); } } if (res != (t->sp.N * t->sp.N + t->sp.N) / 2) { FATAL("cmaes_resume_distribution(): C: dimensions differ", 0, 0, 0); } t->flgIniphase = 0; t->flgEigensysIsUptodate = 0; t->flgresumedone = 1; cmaes_UpdateEigensystem(t, 1); } /* cmaes_resume_distribution() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void cmaes_exit (cmaes_t *t) { int i, N = t->sp.N; t->state = -1; /* not really useful at the moment */ free(t->rgpc); free(t->rgps); free(t->rgdTmp); free(t->rgBDz); free(--t->rgxmean); free(--t->rgxold); free(--t->rgxbestever); free(--t->rgout); free(t->rgD); for (i = 0; i < N; ++i) { free(t->C[i]); free(t->B[i]); } for (i = 0; i < t->sp.lambda; ++i) { free(--t->rgrgx[i]); } free(t->rgrgx); free(t->C); free(t->B); free(t->index); free(t->publicFitness); free(--t->rgFuncValue); free(--t->arFuncValueHist); random_exit(&t->rand); readpara_exit(&t->sp); } /* cmaes_exit() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double const * cmaes_SetMean (cmaes_t *t, const double *xmean) { /* * Distribution mean could be changed before SamplePopulation(). * This might lead to unexpected behaviour if done repeatedly. */ int i, N = t->sp.N; if (t->state >= 1 && t->state < 3) { FATAL("cmaes_SetMean: mean cannot be set inbetween the calls of ", "SamplePopulation and UpdateDistribution", 0, 0); } if (xmean != 0 && xmean != t->rgxmean) { for (i = 0; i < N; ++i) { t->rgxmean[i] = xmean[i]; } } else { xmean = t->rgxmean; } return xmean; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double *const * cmaes_SamplePopulation (cmaes_t *t) { int iNk, i, j, N = t->sp.N; int flgdiag = ((t->sp.diagonalCov == 1) || (t->sp.diagonalCov >= t->gen)); double sum; double const *xmean = t->rgxmean; /* cmaes_SetMean(t, xmean); * xmean could be changed at this point */ /* calculate eigensystem */ if (!t->flgEigensysIsUptodate) { if (!flgdiag) { cmaes_UpdateEigensystem(t, 0); } else { for (i = 0; i < N; ++i) { t->rgD[i] = sqrt(t->C[i][i]); } t->minEW = douSquare(rgdouMin(t->rgD, N)); t->maxEW = douSquare(rgdouMax(t->rgD, N)); t->flgEigensysIsUptodate = 1; timings_start(&t->eigenTimings); } } /* treat minimal standard deviations and numeric problems */ TestMinStdDevs(t); for (iNk = 0; iNk < t->sp.lambda; ++iNk) { /* generate scaled random vector (D * z) */ for (i = 0; i < N; ++i) { if (flgdiag) { t->rgrgx[iNk][i] = xmean[i] + t->sigma * t->rgD[i] * random_Gauss(&t->rand); } else { t->rgdTmp[i] = t->rgD[i] * random_Gauss(&t->rand); } } if (!flgdiag) { /* add mutation (sigma * B * (D*z)) */ for (i = 0; i < N; ++i) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } t->rgrgx[iNk][i] = xmean[i] + t->sigma * sum; } } } if (t->state == 3 || t->gen == 0) { ++t->gen; } t->state = 1; return t->rgrgx; } /* SamplePopulation() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double const * cmaes_ReSampleSingle_old (cmaes_t *t, double *rgx) { int i, j, N = t->sp.N; double sum; if (rgx == 0) { FATAL("cmaes_ReSampleSingle(): Missing input double *x", 0, 0, 0); } for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i] * random_Gauss(&t->rand); } /* add mutation (sigma * B * (D*z)) */ for (i = 0; i < N; ++i) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } rgx[i] = t->rgxmean[i] + t->sigma * sum; } return rgx; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double *const * cmaes_ReSampleSingle (cmaes_t *t, int iindex) { int i, j, N = t->sp.N; double *rgx; double sum; static char s[99]; if (iindex < 0 || iindex >= t->sp.lambda) { sprintf(s, "index==%d must be between 0 and %d", iindex, t->sp.lambda); FATAL("cmaes_ReSampleSingle(): Population member ", s, 0, 0); } rgx = t->rgrgx[iindex]; for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i] * random_Gauss(&t->rand); } /* add mutation (sigma * B * (D*z)) */ for (i = 0; i < N; ++i) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } rgx[i] = t->rgxmean[i] + t->sigma * sum; } return t->rgrgx; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double * cmaes_SampleSingleInto (cmaes_t *t, double *rgx) { int i, j, N = t->sp.N; double sum; if (rgx == 0) { rgx = new_double(N); } for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i] * random_Gauss(&t->rand); } /* add mutation (sigma * B * (D*z)) */ for (i = 0; i < N; ++i) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } rgx[i] = t->rgxmean[i] + t->sigma * sum; } return rgx; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double * cmaes_PerturbSolutionInto (cmaes_t *t, double *rgx, double const *xmean, double eps) { int i, j, N = t->sp.N; double sum; if (rgx == 0) { rgx = new_double(N); } if (xmean == 0) { FATAL("cmaes_PerturbSolutionInto(): xmean was not given", 0, 0, 0); } for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i] * random_Gauss(&t->rand); } /* add mutation (sigma * B * (D*z)) */ for (i = 0; i < N; ++i) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } rgx[i] = xmean[i] + eps * t->sigma * sum; } return rgx; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ double * cmaes_UpdateDistribution (cmaes_t *t, const double *rgFunVal) { int i, j, iNk, hsig, N = t->sp.N; int flgdiag = ((t->sp.diagonalCov == 1) || (t->sp.diagonalCov >= t->gen)); double sum; double psxps; if (t->state == 3) { FATAL("cmaes_UpdateDistribution(): You need to call \n", "SamplePopulation() before update can take place.", 0, 0); } if (rgFunVal == 0) { FATAL("cmaes_UpdateDistribution(): ", "Fitness function value array input is missing.", 0, 0); } if (t->state == 1) {/* function values are delivered here */ t->countevals += t->sp.lambda; } else { ERRORMESSAGE("cmaes_UpdateDistribution(): unexpected state", 0, 0, 0); } /* assign function values */ for (i = 0; i < t->sp.lambda; ++i) { t->rgrgx[i][N] = t->rgFuncValue[i] = rgFunVal[i]; } /* Generate index */ Sorted_index(rgFunVal, t->index, t->sp.lambda); /* Test if function values are identical, escape flat fitness */ if (t->rgFuncValue[t->index[0]] == t->rgFuncValue[t->index[(int)t->sp.lambda / 2]]) { t->sigma *= exp(0.2 + t->sp.cs / t->sp.damps); ERRORMESSAGE("Warning: sigma increased due to equal function values\n", " Reconsider the formulation of the objective function", 0, 0); } /* update function value history */ for (i = (int)*(t->arFuncValueHist - 1) - 1; i > 0; --i) { /* for(i = t->arFuncValueHist[-1]-1; i > 0; --i) */ t->arFuncValueHist[i] = t->arFuncValueHist[i - 1]; } t->arFuncValueHist[0] = rgFunVal[t->index[0]]; /* update xbestever */ if (t->rgxbestever[N] > t->rgrgx[t->index[0]][N] || t->gen == 1) { for (i = 0; i <= N; ++i) { t->rgxbestever[i] = t->rgrgx[t->index[0]][i]; t->rgxbestever[N + 1] = t->countevals; } } /* calculate xmean and rgBDz~N(0,C) */ for (i = 0; i < N; ++i) { t->rgxold[i] = t->rgxmean[i]; t->rgxmean[i] = 0.; for (iNk = 0; iNk < t->sp.mu; ++iNk) { t->rgxmean[i] += t->sp.weights[iNk] * t->rgrgx[t->index[iNk]][i]; } t->rgBDz[i] = sqrt(t->sp.mueff) * (t->rgxmean[i] - t->rgxold[i]) / t->sigma; } /* calculate z := D^(-1) * B^(-1) * rgBDz into rgdTmp */ for (i = 0; i < N; ++i) { if (!flgdiag) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[j][i] * t->rgBDz[j]; } } else { sum = t->rgBDz[i]; } t->rgdTmp[i] = sum / t->rgD[i]; } /* TODO?: check length of t->rgdTmp and set an upper limit, e.g. 6 stds */ /* in case of manipulation of arx, * this can prevent an increase of sigma by several orders of magnitude * within one step; a five-fold increase in one step can still happen. */ /* * for (j = 0, sum = 0.; j < N; ++j) * sum += t->rgdTmp[j] * t->rgdTmp[j]; * if (sqrt(sum) > chiN + 6. * sqrt(0.5)) { * rgdTmp length should be set to upper bound and hsig should become zero * } */ /* cumulation for sigma (ps) using B*z */ for (i = 0; i < N; ++i) { if (!flgdiag) { for (j = 0, sum = 0.; j < N; ++j) { sum += t->B[i][j] * t->rgdTmp[j]; } } else { sum = t->rgdTmp[i]; } t->rgps[i] = (1. - t->sp.cs) * t->rgps[i] + sqrt(t->sp.cs * (2. - t->sp.cs)) * sum; } /* calculate norm(ps)^2 */ for (i = 0, psxps = 0.; i < N; ++i) { psxps += t->rgps[i] * t->rgps[i]; } /* cumulation for covariance matrix (pc) using B*D*z~N(0,C) */ hsig = sqrt(psxps) / sqrt(1. - pow(1. - t->sp.cs, 2 * t->gen)) / t->chiN < 1.4 + 2. / (N + 1); for (i = 0; i < N; ++i) { t->rgpc[i] = (1. - t->sp.ccumcov) * t->rgpc[i] + hsig * sqrt(t->sp.ccumcov * (2. - t->sp.ccumcov)) * t->rgBDz[i]; } /* stop initial phase */ if (t->flgIniphase && t->gen > douMin(1 / t->sp.cs, 1 + N / t->sp.mucov)) { if (psxps / t->sp.damps / (1. - pow((1. - t->sp.cs), t->gen)) < N * 1.05) { t->flgIniphase = 0; } } #if 0 /* remove momentum in ps, if ps is large and fitness is getting worse */ /* This is obsolete due to hsig and harmful in a dynamic environment */ if (psxps / N > 1.5 + 10. * sqrt(2. / N) && t->arFuncValueHist[0] > t->arFuncValueHist[1] && t->arFuncValueHist[0] > t->arFuncValueHist[2]) { double tfac = sqrt((1 + douMax(0, log(psxps / N))) * N / psxps); for (i = 0; i < N; ++i) { t->rgps[i] *= tfac; } psxps *= tfac * tfac; } #endif /* update of C */ Adapt_C2(t, hsig); /* Adapt_C(t); not used anymore */ #if 0 if (t->sp.ccov != 0. && t->flgIniphase == 0) { int k; t->flgEigensysIsUptodate = 0; /* update covariance matrix */ for (i = 0; i < N; ++i) { for (j = 0; j <= i; ++j) { t->C[i][j] = (1 - t->sp.ccov) * t->C[i][j] + t->sp.ccov * (1. / t->sp.mucov) * (t->rgpc[i] * t->rgpc[j] + (1 - hsig) * t->sp.ccumcov * (2. - t->sp.ccumcov) * t->C[i][j]); for (k = 0; k < t->sp.mu; ++k) {/* additional rank mu update */ t->C[i][j] += t->sp.ccov * (1 - 1. / t->sp.mucov) * t->sp.weights[k] * (t->rgrgx[t->index[k]][i] - t->rgxold[i]) * (t->rgrgx[t->index[k]][j] - t->rgxold[j]) / t->sigma / t->sigma; } } } } #endif /* update of sigma */ t->sigma *= exp(((sqrt(psxps) / t->chiN) - 1.) * t->sp.cs / t->sp.damps); t->state = 3; return t->rgxmean; } /* cmaes_UpdateDistribution() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ static void Adapt_C2 (cmaes_t *t, int hsig) { int i, j, k, N = t->sp.N; int flgdiag = ((t->sp.diagonalCov == 1) || (t->sp.diagonalCov >= t->gen)); if (t->sp.ccov != 0. && t->flgIniphase == 0) { /* definitions for speeding up inner-most loop */ double ccov1 = douMin(t->sp.ccov * (1. / t->sp.mucov) * (flgdiag ? (N + 1.5) / 3. : 1.), 1.); double ccovmu = douMin(t->sp.ccov * (1 - 1. / t->sp.mucov) * (flgdiag ? (N + 1.5) / 3. : 1.), 1. - ccov1); double sigmasquare = t->sigma * t->sigma; t->flgEigensysIsUptodate = 0; /* update covariance matrix */ for (i = 0; i < N; ++i) { for (j = flgdiag ? i : 0; j <= i; ++j) { t->C[i][j] = (1 - ccov1 - ccovmu) * t->C[i][j] + ccov1 * (t->rgpc[i] * t->rgpc[j] + (1 - hsig) * t->sp.ccumcov * (2. - t->sp.ccumcov) * t->C[i][j]); for (k = 0; k < t->sp.mu; ++k) {/* additional rank mu update */ t->C[i][j] += ccovmu * t->sp.weights[k] * (t->rgrgx[t->index[k]][i] - t->rgxold[i]) * (t->rgrgx[t->index[k]][j] - t->rgxold[j]) / sigmasquare; } } } /* update maximal and minimal diagonal value */ t->maxdiagC = t->mindiagC = t->C[0][0]; for (i = 1; i < N; ++i) { if (t->maxdiagC < t->C[i][i]) { t->maxdiagC = t->C[i][i]; } else if (t->mindiagC > t->C[i][i]) { t->mindiagC = t->C[i][i]; } } } /* if ccov... */ } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ static void TestMinStdDevs (cmaes_t *t) { /* increases sigma */ int i, N = t->sp.N; if (t->sp.rgDiffMinChange == 0) { return; } for (i = 0; i < N; ++i) { while (t->sigma * sqrt(t->C[i][i]) < t->sp.rgDiffMinChange[i]) { t->sigma *= exp(0.05 + t->sp.cs / t->sp.damps); } } } /* cmaes_TestMinStdDevs() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void cmaes_WriteToFile (cmaes_t *t, const char *key, const char *name) { cmaes_WriteToFileAW(t, key, name, "a"); /* default is append */ } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void cmaes_WriteToFileAW (cmaes_t *t, const char *key, const char *name, const char *appendwrite) { const char *s = "tmpcmaes.dat"; FILE *fp; if (name == 0) { name = s; } fp = fopen(name, appendwrite); if (fp == 0) { ERRORMESSAGE("cmaes_WriteToFile(): could not open '", name, "' with flag ", appendwrite); return; } if (appendwrite[0] == 'w') { /* write a header line, very rudimentary */ fprintf(fp, "%% # %s (randomSeed=%d, %s)\n", key, t->sp.seed, getTimeStr()); } else if (t->gen > 0 || strncmp(name, "outcmaesfit", 11) != 0) { cmaes_WriteToFilePtr(t, key, fp); /* do not write fitness for gen==0 */ } fclose(fp); } /* WriteToFile */ /* --------------------------------------------------------- */ void cmaes_WriteToFilePtr (cmaes_t *t, const char *key, FILE *fp) { /* this hack reads key words from input key for data to be written to * a file, see file signals.par as input file. The length of the keys * is mostly fixed, see key += number in the code! If the key phrase * does not match the expectation the output might be strange. for * cmaes_t *t == 0 it solely prints key as a header line. Input key * must be zero terminated. */ int i, k, N = (t ? t->sp.N : 0); char const *keyend, *keystart; const char *s = "few"; if (key == 0) { key = s; } keystart = key; /* for debugging purpose */ keyend = key + strlen(key); while (key < keyend) { if (strncmp(key, "axisratio", 9) == 0) { fprintf(fp, "%.2e", sqrt(t->maxEW / t->minEW)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "idxminSD", 8) == 0) { int mini = 0; for (i = N - 1; i > 0; --i) { if (t->mindiagC == t->C[i][i]) { mini = i; } } fprintf(fp, "%d", mini + 1); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "idxmaxSD", 8) == 0) { int maxi = 0; for (i = N - 1; i > 0; --i) { if (t->maxdiagC == t->C[i][i]) { maxi = i; } } fprintf(fp, "%d", maxi + 1); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } /* new coordinate system == all eigenvectors */ if (strncmp(key, "B", 1) == 0) { /* int j, index[N]; */ int j, *iindex = (int *)(new_void(N, sizeof(int))); /* MT */ Sorted_index(t->rgD, iindex, N);/* should not be necessary, see end of QLalgo2 */ /* One eigenvector per row, sorted: largest eigenvalue first */ for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { fprintf(fp, "%g%c", t->B[j][iindex[N - 1 - i]], (j == N - 1) ? '\n' : '\t'); } } ++key; free(iindex); /* MT */ } /* covariance matrix */ if (strncmp(key, "C", 1) == 0) { int j; for (i = 0; i < N; ++i) { for (j = 0; j <= i; ++j) { fprintf(fp, "%g%c", t->C[i][j], (j == i) ? '\n' : '\t'); } } ++key; } /* (processor) time (used) since begin of execution */ if (strncmp(key, "clock", 4) == 0) { timings_update(&t->eigenTimings); fprintf(fp, "%.1f %.1f", t->eigenTimings.totaltotaltime, t->eigenTimings.tictoctime); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } /* ratio between largest and smallest standard deviation */ if (strncmp(key, "stddevratio", 11) == 0) { /* std dev in coordinate axes */ fprintf(fp, "%g", sqrt(t->maxdiagC / t->mindiagC)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } /* standard deviations in coordinate directions (sigma*sqrt(C[i,i])) */ if (strncmp(key, "coorstddev", 10) == 0 || strncmp(key, "stddev", 6) == 0) {/* std dev in coordinate axes */ for (i = 0; i < N; ++i) { fprintf(fp, "%s%g", (i == 0) ? "" : "\t", t->sigma * sqrt(t->C[i][i])); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } /* diagonal of D == roots of eigenvalues, sorted */ if (strncmp(key, "diag(D)", 7) == 0) { for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i]; } qsort(t->rgdTmp, (unsigned)N, sizeof(double), &SignOfDiff); /* superfluous */ for (i = 0; i < N; ++i) { fprintf(fp, "%s%g", (i == 0) ? "" : "\t", t->rgdTmp[i]); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "dim", 3) == 0) { fprintf(fp, "%d", N); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "eval", 4) == 0) { fprintf(fp, "%.0f", t->countevals); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "few(diag(D))", 12) == 0) {/* between four and six axes */ int add = (int)(0.5 + (N + 1.) / 5.); for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i]; } qsort(t->rgdTmp, (unsigned)N, sizeof(double), &SignOfDiff); for (i = 0; i < N - 1; i += add) { /* print always largest */ fprintf(fp, "%s%g", (i == 0) ? "" : "\t", t->rgdTmp[N - 1 - i]); } fprintf(fp, "\t%g\n", t->rgdTmp[0]);/* and smallest */ break; /* number of printed values is not determined */ } if (strncmp(key, "fewinfo", 7) == 0) { fprintf(fp, " Iter Fevals Function Value Sigma "); fprintf(fp, "MaxCoorDev MinCoorDev AxisRatio MinDii Time in eig\n"); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } } if (strncmp(key, "few", 3) == 0) { fprintf(fp, " %4.0f ", t->gen); fprintf(fp, " %5.0f ", t->countevals); fprintf(fp, "%.15e", t->rgFuncValue[t->index[0]]); fprintf(fp, " %.2e %.2e %.2e", t->sigma, t->sigma * sqrt(t->maxdiagC), t->sigma * sqrt(t->mindiagC)); fprintf(fp, " %.2e %.2e", sqrt(t->maxEW / t->minEW), sqrt(t->minEW)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "funval", 6) == 0 || strncmp(key, "fitness", 6) == 0) { fprintf(fp, "%.15e", t->rgFuncValue[t->index[0]]); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "fbestever", 9) == 0) { fprintf(fp, "%.15e", t->rgxbestever[N]);/* f-value */ while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "fmedian", 7) == 0) { fprintf(fp, "%.15e", t->rgFuncValue[t->index[(int)(t->sp.lambda / 2)]]); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "fworst", 6) == 0) { fprintf(fp, "%.15e", t->rgFuncValue[t->index[t->sp.lambda - 1]]); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "arfunval", 8) == 0 || strncmp(key, "arfitness", 8) == 0) { for (i = 0; i < N; ++i) { fprintf(fp, "%s%.10e", (i == 0) ? "" : "\t", t->rgFuncValue[t->index[i]]); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "gen", 3) == 0) { fprintf(fp, "%.0f", t->gen); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "iter", 4) == 0) { fprintf(fp, "%.0f", t->gen); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "sigma", 5) == 0) { fprintf(fp, "%.4e", t->sigma); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "minSD", 5) == 0) {/* minimal standard deviation */ fprintf(fp, "%.4e", sqrt(t->mindiagC)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "maxSD", 5) == 0) { fprintf(fp, "%.4e", sqrt(t->maxdiagC)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "mindii", 6) == 0) { fprintf(fp, "%.4e", sqrt(t->minEW)); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "0", 1) == 0) { fprintf(fp, "0"); ++key; fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "lambda", 6) == 0) { fprintf(fp, "%d", t->sp.lambda); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "N", 1) == 0) { fprintf(fp, "%d", N); ++key; fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "resume", 6) == 0) { fprintf(fp, "\n# resume %d\n", N); fprintf(fp, "xmean\n"); cmaes_WriteToFilePtr(t, "xmean", fp); fprintf(fp, "path for sigma\n"); for (i = 0; i < N; ++i) { fprintf(fp, "%g%s", t->rgps[i], (i == N - 1) ? "\n" : "\t"); } fprintf(fp, "path for C\n"); for (i = 0; i < N; ++i) { fprintf(fp, "%g%s", t->rgpc[i], (i == N - 1) ? "\n" : "\t"); } fprintf(fp, "sigma %g\n", t->sigma); /* note than B and D might not be up-to-date */ fprintf(fp, "covariance matrix\n"); cmaes_WriteToFilePtr(t, "C", fp); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } } if (strncmp(key, "xbest", 5) == 0) {/* best x in recent generation */ for (i = 0; i < N; ++i) { fprintf(fp, "%s%g", (i == 0) ? "" : "\t", t->rgrgx[t->index[0]][i]); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "xmean", 5) == 0) { for (i = 0; i < N; ++i) { fprintf(fp, "%s%g", (i == 0) ? "" : "\t", t->rgxmean[i]); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } fprintf(fp, "%c", (*key == '+') ? '\t' : '\n'); } if (strncmp(key, "all", 3) == 0) { time_t ti = time(0); fprintf(fp, "\n# --------- %s\n", asctime(localtime(&ti))); fprintf(fp, " N %d\n", N); fprintf(fp, " seed %d\n", t->sp.seed); fprintf(fp, "function evaluations %.0f\n", t->countevals); fprintf(fp, "elapsed (CPU) time [s] %.2f\n", t->eigenTimings.totaltotaltime); fprintf(fp, "function value f(x)=%g\n", t->rgrgx[t->index[0]][N]); fprintf(fp, "maximal standard deviation %g\n", t->sigma * sqrt(t->maxdiagC)); fprintf(fp, "minimal standard deviation %g\n", t->sigma * sqrt(t->mindiagC)); fprintf(fp, "sigma %g\n", t->sigma); fprintf(fp, "axisratio %g\n", rgdouMax(t->rgD, N) / rgdouMin(t->rgD, N)); fprintf(fp, "xbestever found after %.0f evaluations, function value %g\n", t->rgxbestever[N + 1], t->rgxbestever[N]); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->rgxbestever[i], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "xbest (of last generation, function value %g)\n", t->rgrgx[t->index[0]][N]); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->rgrgx[t->index[0]][i], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "xmean \n"); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->rgxmean[i], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "Standard deviation of coordinate axes (sigma*sqrt(diag(C)))\n"); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->sigma * sqrt(t->C[i][i]), (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "Main axis lengths of mutation ellipsoid (sigma*diag(D))\n"); for (i = 0; i < N; ++i) { t->rgdTmp[i] = t->rgD[i]; } qsort(t->rgdTmp, (unsigned)N, sizeof(double), &SignOfDiff); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->sigma * t->rgdTmp[N - 1 - i], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "Longest axis (b_i where d_ii=max(diag(D))\n"); k = MaxIdx(t->rgD, N); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->B[i][k], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } fprintf(fp, "Shortest axis (b_i where d_ii=max(diag(D))\n"); k = MinIdx(t->rgD, N); for (i = 0; i < N; ++i) { fprintf(fp, " %12g%c", t->B[i][k], (i % 5 == 4 || i == N - 1) ? '\n' : ' '); } while (*key != '+' && *key != '\0' && key < keyend) { ++key; } } /* "all" */ #if 0 /* could become generic part */ s0 = key; d = cmaes_Get(t, key); /* TODO find way to detect whether key was found */ if (key == s0) {/* this does not work, is always true */ /* write out stuff, problem: only generic format is available */ /* move in key until "+" or end */ } #endif if (*key == '\0') { break; } else if (*key != '+') { /* last key was not recognized */ ERRORMESSAGE("cmaes_t:WriteToFilePtr(): unrecognized key '", key, "'", 0); while (*key != '+' && *key != '\0' && key < keyend) { ++key; } } while (*key == '+') { ++key; } } /* while key < keyend */ if (key > keyend) { FATAL("cmaes_t:WriteToFilePtr(): BUG regarding key sequence", 0, 0, 0); } } /* WriteToFilePtr */ /* --------------------------------------------------------- */ double cmaes_Get (cmaes_t *t, char const *s) { int N = t->sp.N; if (strncmp(s, "axisratio", 5) == 0) { /* between lengths of longest and shortest principal axis of the distribution ellipsoid */ return rgdouMax(t->rgD, N) / rgdouMin(t->rgD, N); } else if (strncmp(s, "eval", 4) == 0) {/* number of function evaluations */ return t->countevals; } else if (strncmp(s, "fctvalue", 6) == 0 || strncmp(s, "funcvalue", 6) == 0 || strncmp(s, "funvalue", 6) == 0 || strncmp(s, "fitness", 3) == 0) { /* recent best function value */ return t->rgFuncValue[t->index[0]]; } else if (strncmp(s, "fbestever", 7) == 0) { /* ever best function value */ return t->rgxbestever[N]; } else if (strncmp(s, "generation", 3) == 0 || strncmp(s, "iteration", 4) == 0) { return t->gen; } else if (strncmp(s, "maxeval", 4) == 0 || strncmp(s, "MaxFunEvals", 8) == 0 || strncmp(s, "stopMaxFunEvals", 12) == 0) { /* maximal number of function evaluations */ return t->sp.stopMaxFunEvals; } else if (strncmp(s, "maxgen", 4) == 0 || strncmp(s, "MaxIter", 7) == 0 || strncmp(s, "stopMaxIter", 11) == 0) { /* maximal number of generations */ return ceil(t->sp.stopMaxIter); } else if (strncmp(s, "maxaxislength", 5) == 0) { /* sigma * max(diag(D)) */ return t->sigma * sqrt(t->maxEW); } else if (strncmp(s, "minaxislength", 5) == 0) { /* sigma * min(diag(D)) */ return t->sigma * sqrt(t->minEW); } else if (strncmp(s, "maxstddev", 4) == 0) { /* sigma * sqrt(max(diag(C))) */ return t->sigma * sqrt(t->maxdiagC); } else if (strncmp(s, "minstddev", 4) == 0) { /* sigma * sqrt(min(diag(C))) */ return t->sigma * sqrt(t->mindiagC); } else if (strncmp(s, "N", 1) == 0 || strcmp(s, "n") == 0 || strncmp(s, "dimension", 3) == 0) { return N; } else if (strncmp(s, "lambda", 3) == 0 || strncmp(s, "samplesize", 8) == 0 || strncmp(s, "popsize", 7) == 0) { /* sample size, offspring population size */ return t->sp.lambda; } else if (strncmp(s, "sigma", 3) == 0) { return t->sigma; } FATAL("cmaes_Get(cmaes_t, char const * s): No match found for s='", s, "'", 0); return 0; } /* cmaes_Get() */ /* --------------------------------------------------------- */ double * cmaes_GetInto (cmaes_t *t, char const *s, double *res) { int i, N = t->sp.N; double const *res0 = cmaes_GetPtr(t, s); if (res == 0) { res = new_double(N); } for (i = 0; i < N; ++i) { res[i] = res0[i]; } return res; } /* --------------------------------------------------------- */ double * cmaes_GetNew (cmaes_t *t, char const *s) { return cmaes_GetInto(t, s, 0); } /* --------------------------------------------------------- */ const double * cmaes_GetPtr (cmaes_t *t, char const *s) { int i, N = t->sp.N; /* diagonal of covariance matrix */ if (strncmp(s, "diag(C)", 7) == 0) { for (i = 0; i < N; ++i) { t->rgout[i] = t->C[i][i]; } return t->rgout; } /* diagonal of axis lengths matrix */ else if (strncmp(s, "diag(D)", 7) == 0) { return t->rgD; } /* vector of standard deviations sigma*sqrt(diag(C)) */ else if (strncmp(s, "stddev", 3) == 0) { for (i = 0; i < N; ++i) { t->rgout[i] = t->sigma * sqrt(t->C[i][i]); } return t->rgout; } /* bestever solution seen so far */ else if (strncmp(s, "xbestever", 7) == 0) { return t->rgxbestever; } /* recent best solution of the recent population */ else if (strncmp(s, "xbest", 5) == 0) { return t->rgrgx[t->index[0]]; } /* mean of the recent distribution */ else if (strncmp(s, "xmean", 1) == 0) { return t->rgxmean; } return 0; } /* --------------------------------------------------------- */ /* tests stopping criteria * returns a string of satisfied stopping criterion for each line * otherwise 0 */ const char * cmaes_TestForTermination (cmaes_t *t) { double range, fac; int iAchse, iKoo; int flgdiag = ((t->sp.diagonalCov == 1) || (t->sp.diagonalCov >= t->gen)); static char sTestOutString[3024]; char *cp = sTestOutString; int i, cTemp, N = t->sp.N; cp[0] = '\0'; /* function value reached */ if ((t->gen > 1 || t->state > 1) && t->sp.stStopFitness.flg && t->rgFuncValue[t->index[0]] <= t->sp.stStopFitness.val) { cp += sprintf(cp, "Fitness: function value %7.2e <= stopFitness (%7.2e)\n", t->rgFuncValue[t->index[0]], t->sp.stStopFitness.val); } /* TolFun */ range = douMax(rgdouMax(t->arFuncValueHist, (int)douMin(t->gen, *(t->arFuncValueHist - 1))), rgdouMax(t->rgFuncValue, t->sp.lambda)) - douMin(rgdouMin(t->arFuncValueHist, (int)douMin(t->gen, *(t->arFuncValueHist - 1))), rgdouMin(t->rgFuncValue, t->sp.lambda)); if (t->gen > 0 && range <= t->sp.stopTolFun) { cp += sprintf(cp, "TolFun: function value differences %7.2e < stopTolFun=%7.2e\n", range, t->sp.stopTolFun); } /* TolFunHist */ if (t->gen > *(t->arFuncValueHist - 1)) { range = rgdouMax(t->arFuncValueHist, (int)*(t->arFuncValueHist - 1)) - rgdouMin(t->arFuncValueHist, (int)*(t->arFuncValueHist - 1)); if (range <= t->sp.stopTolFunHist) { cp += sprintf(cp, "TolFunHist: history of function value changes %7.2e stopTolFunHist=%7.2e", range, t->sp.stopTolFunHist); } } /* TolX */ for (i = 0, cTemp = 0; i < N; ++i) { cTemp += (t->sigma * sqrt(t->C[i][i]) < t->sp.stopTolX) ? 1 : 0; cTemp += (t->sigma * t->rgpc[i] < t->sp.stopTolX) ? 1 : 0; } if (cTemp == 2 * N) { cp += sprintf(cp, "TolX: object variable changes below %7.2e \n", t->sp.stopTolX); } /* TolUpX */ for (i = 0; i < N; ++i) { if (t->sigma * sqrt(t->C[i][i]) > t->sp.stopTolUpXFactor * t->sp.rgInitialStds[i]) { break; } } if (i < N) { cp += sprintf(cp, "TolUpX: standard deviation increased by more than %7.2e, larger initial standard deviation recommended \n", t->sp.stopTolUpXFactor); } /* Condition of C greater than dMaxSignifKond */ if (t->maxEW >= t->minEW * t->dMaxSignifKond) { cp += sprintf(cp, "ConditionNumber: maximal condition number %7.2e reached. maxEW=%7.2e,minEW=%7.2e,maxdiagC=%7.2e,mindiagC=%7.2e\n", t->dMaxSignifKond, t->maxEW, t->minEW, t->maxdiagC, t->mindiagC); } /* if */ /* Principal axis i has no effect on xmean, ie. * x == x + 0.1 * sigma * rgD[i] * B[i] */ if (!flgdiag) { for (iAchse = 0; iAchse < N; ++iAchse) { fac = 0.1 * t->sigma * t->rgD[iAchse]; for (iKoo = 0; iKoo < N; ++iKoo) { if (t->rgxmean[iKoo] != t->rgxmean[iKoo] + fac * t->B[iKoo][iAchse]) { break; } } if (iKoo == N) { /* t->sigma *= exp(0.2+t->sp.cs/t->sp.damps); */ cp += sprintf(cp, "NoEffectAxis: standard deviation 0.1*%7.2e in principal axis %d without effect\n", fac / 0.1, iAchse); break; } /* if (iKoo == N) */ } /* for iAchse */ } /* if flgdiag */ /* Component of xmean is not changed anymore */ for (iKoo = 0; iKoo < N; ++iKoo) { if (t->rgxmean[iKoo] == t->rgxmean[iKoo] + 0.2 * t->sigma * sqrt(t->C[iKoo][iKoo])) { /* t->C[iKoo][iKoo] *= (1 + t->sp.ccov); */ /* flg = 1; */ cp += sprintf(cp, "NoEffectCoordinate: standard deviation 0.2*%7.2e in coordinate %d without effect\n", t->sigma * sqrt(t->C[iKoo][iKoo]), iKoo); break; } } /* for iKoo */ /* if (flg) t->sigma *= exp(0.05+t->sp.cs/t->sp.damps); */ if (t->countevals >= t->sp.stopMaxFunEvals) { cp += sprintf(cp, "MaxFunEvals: conducted function evaluations %.0f >= %g\n", t->countevals, t->sp.stopMaxFunEvals); } if (t->gen >= t->sp.stopMaxIter) { cp += sprintf(cp, "MaxIter: number of iterations %.0f >= %g\n", t->gen, t->sp.stopMaxIter); } if (t->flgStop) { cp += sprintf(cp, "Manual: stop signal read\n"); } #if 0 else if (0) { for (i = 0, cTemp = 0; i < N; ++i) { cTemp += (sigma * sqrt(C[i][i]) < stopdx) ? 1 : 0; cTemp += (sigma * rgpc[i] < stopdx) ? 1 : 0; } if (cTemp == 2 * N) { flgStop = 1; } } #endif if (cp - sTestOutString > 320) { ERRORMESSAGE("Bug in cmaes_t:Test(): sTestOutString too short", 0, 0, 0); } if (cp != sTestOutString) { return sTestOutString; } return 0; } /* cmaes_Test() */ /* --------------------------------------------------------- */ void cmaes_ReadSignals (cmaes_t *t, char const *filename) { const char *s = "signals.par"; FILE *fp; if (filename == 0) { filename = s; } fp = fopen(filename, "r"); if (fp == 0) { return; } cmaes_ReadFromFilePtr(t, fp); fclose(fp); } /* --------------------------------------------------------- */ void cmaes_ReadFromFilePtr (cmaes_t *t, FILE *fp) { /* reading commands e.g. from signals.par file */ const char *keys[15]; char s[199], sin1[99], sin2[129], sin3[99], sin4[99]; int ikey, ckeys, nb; double d; static int flglockprint = 0; static int flglockwrite = 0; static long countiterlastwritten; static long maxdiffitertowrite; /* to prevent long gaps at the beginning */ int flgprinted = 0; int flgwritten = 0; double deltaprinttime = time(0) - t->printtime; /* using clock instead might not be a good */ double deltawritetime = time(0) - t->writetime; /* idea as disc time is not CPU time? */ double deltaprinttimefirst = t->firstprinttime ? time(0) - t->firstprinttime : 0; /* time is in seconds!? */ double deltawritetimefirst = t->firstwritetime ? time(0) - t->firstwritetime : 0; if (countiterlastwritten > t->gen) {/* probably restarted */ maxdiffitertowrite = 0; countiterlastwritten = 0; } keys[0] = " stop%98s %98s"; /* s=="now" or eg "MaxIter+" %lg"-number */ /* works with and without space */ keys[1] = " print %98s %98s"; /* s==keyword for WriteFile */ keys[2] = " write %98s %128s %98s"; /* s1==keyword, s2==filename */ keys[3] = " check%98s %98s"; keys[4] = " maxTimeFractionForEigendecompostion %98s"; ckeys = 5; strcpy(sin2, "tmpcmaes.dat"); if (cmaes_TestForTermination(t)) { deltaprinttime = time(0); /* forces printing */ deltawritetime = time(0); } while (fgets(s, sizeof(s), fp) != 0) { if (s[0] == '#' || s[0] == '%') { /* skip comments */ continue; } sin1[0] = sin2[0] = sin3[0] = sin4[0] = '\0'; for (ikey = 0; ikey < ckeys; ++ikey) { if ((nb = sscanf(s, keys[ikey], sin1, sin2, sin3, sin4)) >= 1) { switch (ikey) { case 0: /* "stop", reads "stop now" or eg. stopMaxIter */ if (strncmp(sin1, "now", 3) == 0) { t->flgStop = 1; } else if (strncmp(sin1, "MaxFunEvals", 11) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopMaxFunEvals = d; } } else if (strncmp(sin1, "MaxIter", 4) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopMaxIter = d; } } else if (strncmp(sin1, "Fitness", 7) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stStopFitness.flg = 1; t->sp.stStopFitness.val = d; } } else if (strncmp(sin1, "TolFunHist", 10) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopTolFunHist = d; } } else if (strncmp(sin1, "TolFun", 6) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopTolFun = d; } } else if (strncmp(sin1, "TolX", 4) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopTolX = d; } } else if (strncmp(sin1, "TolUpXFactor", 4) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { t->sp.stopTolUpXFactor = d; } } break; case 1: /* "print" */ d = 1; /* default */ if (sscanf(sin2, "%lg", &d) < 1 && deltaprinttimefirst < 1) { d = 0; /* default at first time */ } if (deltaprinttime >= d && !flglockprint) { cmaes_WriteToFilePtr(t, sin1, stdout); flgprinted = 1; } if (d < 0) { flglockprint += 2; } break; case 2: /* "write" */ /* write header, before first generation */ if (t->countevals < t->sp.lambda && t->flgresumedone == 0) { cmaes_WriteToFileAW(t, sin1, sin2, "w");/* overwrite */ } d = 0.9;/* default is one with smooth increment of gaps */ if (sscanf(sin3, "%lg", &d) < 1 && deltawritetimefirst < 2) { d = 0; /* default is zero for the first second */ } if (d < 0) { flglockwrite += 2; } if (!flglockwrite) { if (deltawritetime >= d) { cmaes_WriteToFile(t, sin1, sin2); flgwritten = 1; } else if (d < 1 && t->gen - countiterlastwritten > maxdiffitertowrite) { cmaes_WriteToFile(t, sin1, sin2); flgwritten = 1; } } break; case 3: /* check, checkeigen 1 or check eigen 1 */ if (strncmp(sin1, "eigen", 5) == 0) { if (sscanf(sin2, " %lg", &d) == 1) { if (d > 0) { t->flgCheckEigen = 1; } else { t->flgCheckEigen = 0; } } else { t->flgCheckEigen = 0; } } break; case 4: /* maxTimeFractionForEigendecompostion */ if (sscanf(sin1, " %lg", &d) == 1) { t->sp.updateCmode.maxtime = d; } break; default: break; } break; /* for ikey */ } /* if line contains keyword */ } /* for each keyword */ } /* while not EOF of signals.par */ if (t->writetime == 0) { t->firstwritetime = time(0); } if (t->printtime == 0) { t->firstprinttime = time(0); } if (flgprinted) { t->printtime = time(0); } if (flgwritten) { t->writetime = time(0); if (t->gen - countiterlastwritten > maxdiffitertowrite) { ++maxdiffitertowrite; /* smooth prolongation of writing gaps/intervals */ } countiterlastwritten = (long int)t->gen; } --flglockprint; --flglockwrite; flglockprint = (flglockprint > 0) ? 1 : 0; flglockwrite = (flglockwrite > 0) ? 1 : 0; } /* cmaes_ReadFromFilePtr */ /* ========================================================= */ static int Check_Eigen (int N, double **C, double *diag, double **Q) { /* * exhaustive test of the output of the eigendecomposition * needs O(n^3) operations * * writes to error file * returns number of detected inaccuracies */ /* compute Q diag Q^T and Q Q^T to check */ int i, j, k, res = 0; double cc, dd; static char s[324]; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { for (cc = 0., dd = 0., k = 0; k < N; ++k) { cc += diag[k] * Q[i][k] * Q[j][k]; dd += Q[i][k] * Q[j][k]; } /* check here, is the normalization the right one? */ if (fabs(cc - C[i > j ? i : j][i > j ? j : i]) / sqrt(C[i][i] * C[j][j]) > 1e-10 && fabs(cc - C[i > j ? i : j][i > j ? j : i]) > 3e-14) { sprintf(s, "%d %d: %.17e %.17e, %e", i, j, cc, C[i > j ? i : j][i > j ? j : i], cc - C[i > j ? i : j][i > j ? j : i]); ERRORMESSAGE("cmaes_t:Eigen(): imprecise result detected ", s, 0, 0); ++res; } if (fabs(dd - (i == j)) > 1e-10) { sprintf(s, "%d %d %.17e ", i, j, dd); ERRORMESSAGE("cmaes_t:Eigen(): imprecise result detected (Q not orthog.)", s, 0, 0); ++res; } } } return res; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void cmaes_UpdateEigensystem (cmaes_t *t, int flgforce) { int i, N = t->sp.N; timings_update(&t->eigenTimings); if (flgforce == 0) { if (t->flgEigensysIsUptodate == 1) { return; } /* return on modulo generation number */ if (t->sp.updateCmode.flgalways == 0/* not implemented, always ==0 */ && t->gen < t->genOfEigensysUpdate + t->sp.updateCmode.modulo) { return; } /* return on time percentage */ if (t->sp.updateCmode.maxtime < 1.00 && t->eigenTimings.tictoctime > t->sp.updateCmode.maxtime * t->eigenTimings.totaltime && t->eigenTimings.tictoctime > 0.0002) { return; } } timings_tic(&t->eigenTimings); Eigen(N, t->C, t->rgD, t->B, t->rgdTmp); timings_toc(&t->eigenTimings); /* find largest and smallest eigenvalue, they are supposed to be sorted anyway */ t->minEW = rgdouMin(t->rgD, N); t->maxEW = rgdouMax(t->rgD, N); if (t->flgCheckEigen) { /* needs O(n^3)! writes, in case, error message in error file */ i = Check_Eigen(N, t->C, t->rgD, t->B); } #if 0 /* Limit Condition of C to dMaxSignifKond+1 */ if (t->maxEW > t->minEW * t->dMaxSignifKond) { ERRORMESSAGE("Warning: Condition number of covariance matrix at upper limit.", " Consider a rescaling or redesign of the objective function. ", "", ""); printf("\nWarning: Condition number of covariance matrix at upper limit\n"); tmp = t->maxEW / t->dMaxSignifKond - t->minEW; tmp = t->maxEW / t->dMaxSignifKond; t->minEW += tmp; for (i = 0; i < N; ++i) { t->C[i][i] += tmp; t->rgD[i] += tmp; } } /* if */ t->dLastMinEWgroesserNull = minEW; #endif for (i = 0; i < N; ++i) { t->rgD[i] = sqrt(t->rgD[i]); } t->flgEigensysIsUptodate = 1; t->genOfEigensysUpdate = t->gen; return; } /* cmaes_UpdateEigensystem() */ /* ========================================================= */ static void Eigen (int N, double **C, double *diag, double **Q, double *rgtmp) { /* * Calculating eigenvalues and vectors. * Input: * N: dimension. * C: symmetric (1:N)xN-matrix, solely used to copy data to Q * niter: number of maximal iterations for QL-Algorithm. * rgtmp: N+1-dimensional vector for temporal use. * Output: * diag: N eigenvalues. * Q: Columns are normalized eigenvectors. */ int i, j; if (rgtmp == 0) { /* was OK in former versions */ FATAL("cmaes_t:Eigen(): input parameter double *rgtmp must be non-0", 0, 0, 0); } /* copy C to Q */ if (C != Q) { for (i = 0; i < N; ++i) { for (j = 0; j <= i; ++j) { Q[i][j] = Q[j][i] = C[i][j]; } } } #if 0 Householder(N, Q, diag, rgtmp); QLalgo(N, diag, Q, 30 * N, rgtmp + 1); #else Householder2(N, Q, diag, rgtmp); QLalgo2(N, diag, rgtmp, Q); #endif } /* ========================================================= */ static void QLalgo2 (int n, double *d, double *e, double **V) { /* * -> n : Dimension. * -> d : Diagonale of tridiagonal matrix. * -> e[1..n-1] : off-diagonal, output from Householder * -> V : matrix output von Householder * <- d : eigenvalues * <- e : garbage? * <- V : basis of eigenvectors, according to d * * Symmetric tridiagonal QL algorithm, iterative * Computes the eigensystem from a tridiagonal matrix in roughtly 3N^3 operations * * code adapted from Java JAMA package, function tql2. */ int i, k, l, m; double f = 0.0; double tst1 = 0.0; double eps = 2.22e-16; /* Math.pow(2.0,-52.0); == 2.22e-16 */ /* shift input e */ for (i = 1; i < n; i++) { e[i - 1] = e[i]; } e[n - 1] = 0.0; /* never changed again */ for (l = 0; l < n; l++) { /* Find small subdiagonal element */ if (tst1 < fabs(d[l]) + fabs(e[l])) { tst1 = fabs(d[l]) + fabs(e[l]); } m = l; while (m < n) { if (fabs(e[m]) <= eps * tst1) { /* if (fabs(e[m]) + fabs(d[m]+d[m+1]) == fabs(d[m]+d[m+1])) { */ break; } m++; } /* If m == l, d[l] is an eigenvalue, */ /* otherwise, iterate. */ if (m > l) {/* TODO: check the case m == n, should be rejected here!? */ int iter = 0; do {/* while (fabs(e[l]) > eps*tst1); */ double dl1, h; double g = d[l]; double p = (d[l + 1] - g) / (2.0 * e[l]); double r = myhypot(p, 1.); iter = iter + 1;/* Could check iteration count here */ /* Compute implicit shift */ if (p < 0) { r = -r; } d[l] = e[l] / (p + r); d[l + 1] = e[l] * (p + r); dl1 = d[l + 1]; h = g - d[l]; for (i = l + 2; i < n; i++) { d[i] -= h; } f = f + h; /* Implicit QL transformation. */ p = d[m]; { double c = 1.0; double c2 = c; double c3 = c; double el1 = e[l + 1]; double s = 0.0; double s2 = 0.0; for (i = m - 1; i >= l; i--) { c3 = c2; c2 = c; s2 = s; g = c * e[i]; h = c * p; r = myhypot(p, e[i]); e[i + 1] = s * r; s = e[i] / r; c = p / r; p = c * d[i] - s * g; d[i + 1] = h + s * (c * g + s * d[i]); /* Accumulate transformation. */ for (k = 0; k < n; k++) { h = V[k][i + 1]; V[k][i + 1] = s * V[k][i] + c * h; V[k][i] = c * V[k][i] - s * h; } } p = -s * s2 * c3 * el1 * e[l] / dl1; e[l] = s * p; d[l] = c * p; } /* Check for convergence. */ } while (fabs(e[l]) > eps * tst1); } d[l] = d[l] + f; e[l] = 0.0; } /* Sort eigenvalues and corresponding vectors. */ #if 1 /* TODO: really needed here? So far not, but practical and only O(n^2) */ { int j; double p; for (i = 0; i < n - 1; i++) { k = i; p = d[i]; for (j = i + 1; j < n; j++) { if (d[j] < p) { k = j; p = d[j]; } } if (k != i) { d[k] = d[i]; d[i] = p; for (j = 0; j < n; j++) { p = V[j][i]; V[j][i] = V[j][k]; V[j][k] = p; } } } } #endif } /* QLalgo2 */ /* ========================================================= */ static void Householder2 (int n, double **V, double *d, double *e) { /* * Householder transformation of a symmetric matrix V into tridiagonal form. * -> n : dimension * -> V : symmetric nxn-matrix * <- V : orthogonal transformation matrix: * tridiag matrix == V * V_in * V^t * <- d : diagonal * <- e[0..n-1] : off diagonal (elements 1..n-1) * * code slightly adapted from the Java JAMA package, function private tred2() * */ int i, j, k; for (j = 0; j < n; j++) { d[j] = V[n - 1][j]; } /* Householder reduction to tridiagonal form */ for (i = n - 1; i > 0; i--) { /* Scale to avoid under/overflow */ double scale = 0.0; double h = 0.0; for (k = 0; k < i; k++) { scale = scale + fabs(d[k]); } if (scale == 0.0) { e[i] = d[i - 1]; for (j = 0; j < i; j++) { d[j] = V[i - 1][j]; V[i][j] = 0.0; V[j][i] = 0.0; } } else { /* Generate Householder vector */ double f, g, hh; for (k = 0; k < i; k++) { d[k] /= scale; h += d[k] * d[k]; } f = d[i - 1]; g = sqrt(h); if (f > 0) { g = -g; } e[i] = scale * g; h = h - f * g; d[i - 1] = f - g; for (j = 0; j < i; j++) { e[j] = 0.0; } /* Apply similarity transformation to remaining columns */ for (j = 0; j < i; j++) { f = d[j]; V[j][i] = f; g = e[j] + V[j][j] * f; for (k = j + 1; k <= i - 1; k++) { g += V[k][j] * d[k]; e[k] += V[k][j] * f; } e[j] = g; } f = 0.0; for (j = 0; j < i; j++) { e[j] /= h; f += e[j] * d[j]; } hh = f / (h + h); for (j = 0; j < i; j++) { e[j] -= hh * d[j]; } for (j = 0; j < i; j++) { f = d[j]; g = e[j]; for (k = j; k <= i - 1; k++) { V[k][j] -= (f * e[k] + g * d[k]); } d[j] = V[i - 1][j]; V[i][j] = 0.0; } } d[i] = h; } /* Accumulate transformations */ for (i = 0; i < n - 1; i++) { double h; V[n - 1][i] = V[i][i]; V[i][i] = 1.0; h = d[i + 1]; if (h != 0.0) { for (k = 0; k <= i; k++) { d[k] = V[k][i + 1] / h; } for (j = 0; j <= i; j++) { double g = 0.0; for (k = 0; k <= i; k++) { g += V[k][i + 1] * V[k][j]; } for (k = 0; k <= i; k++) { V[k][j] -= g * d[k]; } } } for (k = 0; k <= i; k++) { V[k][i + 1] = 0.0; } } for (j = 0; j < n; j++) { d[j] = V[n - 1][j]; V[n - 1][j] = 0.0; } V[n - 1][n - 1] = 1.0; e[0] = 0.0; } /* Housholder() */ #if 0 /* ========================================================= */ static void WriteMaxErrorInfo (cmaes_t *t) { int i, j, N = t->sp.N; char *s = (char *)new_void(200 + 30 * (N + 2), sizeof(char)); s[0] = '\0'; sprintf(s + strlen(s), "\nKomplett-Info\n"); sprintf(s + strlen(s), " Gen %20.12g\n", t->gen); sprintf(s + strlen(s), " Dimension %d\n", N); sprintf(s + strlen(s), " sigma %e\n", t->sigma); sprintf(s + strlen(s), " lastminEW %e\n", t->dLastMinEWgroesserNull); sprintf(s + strlen(s), " maxKond %e\n\n", t->dMaxSignifKond); sprintf(s + strlen(s), " x-Vektor rgD Basis...\n"); ERRORMESSAGE(s, 0, 0, 0); s[0] = '\0'; for (i = 0; i < N; ++i) { sprintf(s + strlen(s), " %20.12e", t->rgxmean[i]); sprintf(s + strlen(s), " %10.4e", t->rgD[i]); for (j = 0; j < N; ++j) { sprintf(s + strlen(s), " %10.2e", t->B[i][j]); } ERRORMESSAGE(s, 0, 0, 0); s[0] = '\0'; } ERRORMESSAGE("\n", 0, 0, 0); free(s); } /* WriteMaxErrorInfo() */ #endif /* --------------------------------------------------------- */ /* --------------- Functions: timings_t -------------------- */ /* --------------------------------------------------------- */ /* timings_t measures overall time and times between calls * of tic and toc. For small time spans (up to 1000 seconds) * CPU time via clock() is used. For large time spans the * fall-back to elapsed time from time() is used. * timings_update() must be called often enough to prevent * the fallback. */ /* --------------------------------------------------------- */ void timings_init (timings_t *t) { t->totaltotaltime = 0; timings_start(t); } void timings_start (timings_t *t) { t->totaltime = 0; t->tictoctime = 0; t->lasttictoctime = 0; t->istic = 0; t->lastclock = clock(); t->lasttime = time(0); t->lastdiff = 0; t->tictoczwischensumme = 0; t->isstarted = 1; } double timings_update (timings_t *t) { /* returns time between last call of timings_*() and now, * should better return totaltime or tictoctime? */ double diffc, difft; clock_t lc = t->lastclock; /* measure CPU in 1e-6s */ time_t lt = t->lasttime;/* measure time in s */ if (t->isstarted != 1) { FATAL("timings_started() must be called before using timings... functions", 0, 0, 0); } t->lastclock = clock(); /* measures at most 2147 seconds, where 1s = 1e6 CLOCKS_PER_SEC */ t->lasttime = time(0); diffc = (double)(t->lastclock - lc) / CLOCKS_PER_SEC; /* is presumably in [-21??, 21??] */ difft = difftime(t->lasttime, lt); /* is presumably an integer */ t->lastdiff = difft;/* on the "save" side */ /* use diffc clock measurement if appropriate */ if (diffc > 0 && difft < 1000) { t->lastdiff = diffc; } if (t->lastdiff < 0) { FATAL("BUG in time measurement", 0, 0, 0); } t->totaltime += t->lastdiff; t->totaltotaltime += t->lastdiff; if (t->istic) { t->tictoczwischensumme += t->lastdiff; t->tictoctime += t->lastdiff; } return t->lastdiff; } void timings_tic (timings_t *t) { if (t->istic) { /* message not necessary ? */ ERRORMESSAGE("Warning: timings_tic called twice without toc", 0, 0, 0); return; } timings_update(t); t->istic = 1; } double timings_toc (timings_t *t) { if (!t->istic) { ERRORMESSAGE("Warning: timings_toc called without tic", 0, 0, 0); return -1; } timings_update(t); t->lasttictoctime = t->tictoczwischensumme; t->tictoczwischensumme = 0; t->istic = 0; return t->lasttictoctime; } /* --------------------------------------------------------- */ /* ---------------- Functions: random_t -------------------- */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ /* X_1 exakt : 0.79788456) */ /* chi_eins simuliert : 0.798xx (seed -3) */ /* +-0.001 */ /* --------------------------------------------------------- */ /* * Gauss() liefert normalverteilte Zufallszahlen * bei vorgegebenem seed. */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ long random_init (random_t *t, long unsigned inseed) { clock_t cloc = clock(); t->flgstored = 0; t->rgrand = (long *)new_void(32, sizeof(long)); if (inseed < 1) { while ((long)(cloc - clock()) == 0) { ; /* TODO: remove this for time critical applications? */ } inseed = (long unsigned)abs((long)(100L * time(0) + clock())); } return random_Start(t, inseed); } void random_exit (random_t *t) { free(t->rgrand); } /* --------------------------------------------------------- */ long random_Start (random_t *t, long unsigned inseed) { long tmp; int i; t->flgstored = 0; t->startseed = inseed; if (inseed < 1) { inseed = 1; } t->aktseed = inseed; for (i = 39; i >= 0; --i) { tmp = t->aktseed / 127773; t->aktseed = 16807 * (t->aktseed - tmp * 127773) - 2836 * tmp; if (t->aktseed < 0) {t->aktseed += 2147483647;} if (i < 32) { t->rgrand[i] = t->aktseed; } } t->aktrand = t->rgrand[0]; return inseed; } /* --------------------------------------------------------- */ double random_Gauss (random_t *t) { double x1, x2, rquad, fac; if (t->flgstored) { t->flgstored = 0; return t->hold; } do { x1 = 2.0 * random_Uniform(t) - 1.0; x2 = 2.0 * random_Uniform(t) - 1.0; rquad = x1 * x1 + x2 * x2; } while (rquad >= 1 || rquad <= 0); fac = sqrt(-2.0 * log(rquad) / rquad); t->flgstored = 1; t->hold = fac * x1; return fac * x2; } /* --------------------------------------------------------- */ double random_Uniform (random_t *t) { long tmp; tmp = t->aktseed / 127773; t->aktseed = 16807 * (t->aktseed - tmp * 127773) - 2836 * tmp; if (t->aktseed < 0) { t->aktseed += 2147483647; } tmp = t->aktrand / 67108865; t->aktrand = t->rgrand[tmp]; t->rgrand[tmp] = t->aktseed; return (double)(t->aktrand) / (2.147483647e9); } static char * szCat (const char *sz1, const char *sz2, const char *sz3, const char *sz4); /* --------------------------------------------------------- */ /* -------------- Functions: readpara_t -------------------- */ /* --------------------------------------------------------- */ void readpara_init (readpara_t *t, int dim, int inseed, const double *inxstart, const double *inrgsigma, int lambda, const char *filename) { int i, N; t->rgsformat = static_cast(new_void(55, sizeof(char *))); t->rgpadr = static_cast(new_void(55, sizeof(void *))); t->rgskeyar = static_cast(new_void(11, sizeof(char *))); t->rgp2adr = static_cast(new_void(11, sizeof(double **))); t->weigkey = static_cast(new_void(7, sizeof(char))); /* All scalars: */ i = 0; t->rgsformat[i] = " N %d"; t->rgpadr[i++] = (void *)&t->N; t->rgsformat[i] = " seed %d"; t->rgpadr[i++] = (void *)&t->seed; t->rgsformat[i] = " stopMaxFunEvals %lg"; t->rgpadr[i++] = (void *)&t->stopMaxFunEvals; t->rgsformat[i] = " stopMaxIter %lg"; t->rgpadr[i++] = (void *)&t->stopMaxIter; t->rgsformat[i] = " stopFitness %lg"; t->rgpadr[i++] = (void *)&t->stStopFitness.val; t->rgsformat[i] = " stopTolFun %lg"; t->rgpadr[i++] = (void *)&t->stopTolFun; t->rgsformat[i] = " stopTolFunHist %lg"; t->rgpadr[i++] = (void *)&t->stopTolFunHist; t->rgsformat[i] = " stopTolX %lg"; t->rgpadr[i++] = (void *)&t->stopTolX; t->rgsformat[i] = " stopTolUpXFactor %lg"; t->rgpadr[i++] = (void *)&t->stopTolUpXFactor; t->rgsformat[i] = " lambda %d"; t->rgpadr[i++] = (void *)&t->lambda; t->rgsformat[i] = " mu %d"; t->rgpadr[i++] = (void *)&t->mu; t->rgsformat[i] = " weights %5s"; t->rgpadr[i++] = (void *)t->weigkey; t->rgsformat[i] = " fac*cs %lg"; t->rgpadr[i++] = (void *)&t->cs; t->rgsformat[i] = " fac*damps %lg"; t->rgpadr[i++] = (void *)&t->damps; t->rgsformat[i] = " ccumcov %lg"; t->rgpadr[i++] = (void *)&t->ccumcov; t->rgsformat[i] = " mucov %lg"; t->rgpadr[i++] = (void *)&t->mucov; t->rgsformat[i] = " fac*ccov %lg"; t->rgpadr[i++] = (void *)&t->ccov; t->rgsformat[i] = " diagonalCovarianceMatrix %lg"; t->rgpadr[i++] = (void *)&t->diagonalCov; t->rgsformat[i] = " updatecov %lg"; t->rgpadr[i++] = (void *)&t->updateCmode.modulo; t->rgsformat[i] = " maxTimeFractionForEigendecompostion %lg"; t->rgpadr[i++] = (void *)&t->updateCmode.maxtime; t->rgsformat[i] = " resume %59s"; t->rgpadr[i++] = (void *)t->resumefile; t->rgsformat[i] = " fac*maxFunEvals %lg"; t->rgpadr[i++] = (void *)&t->facmaxeval; t->rgsformat[i] = " fac*updatecov %lg"; t->rgpadr[i++] = (void *)&t->facupdateCmode; t->n1para = i; t->n1outpara = i - 2; /* disregard last parameters in WriteToFile() */ /* arrays */ i = 0; t->rgskeyar[i] = " typicalX %d"; t->rgp2adr[i++] = &t->typicalX; t->rgskeyar[i] = " initialX %d"; t->rgp2adr[i++] = &t->xstart; t->rgskeyar[i] = " initialStandardDeviations %d"; t->rgp2adr[i++] = &t->rgInitialStds; t->rgskeyar[i] = " diffMinChange %d"; t->rgp2adr[i++] = &t->rgDiffMinChange; t->n2para = i; t->N = dim; t->seed = (unsigned)inseed; t->xstart = 0; t->typicalX = 0; t->typicalXcase = 0; t->rgInitialStds = 0; t->rgDiffMinChange = 0; t->stopMaxFunEvals = -1; t->stopMaxIter = -1; t->facmaxeval = 1; t->stStopFitness.flg = -1; t->stopTolFun = 1e-12; t->stopTolFunHist = 1e-13; t->stopTolX = 0;/* 1e-11*insigma would also be reasonable */ t->stopTolUpXFactor = 1e3; t->lambda = lambda; t->mu = -1; t->mucov = -1; t->weights = 0; strcpy(t->weigkey, "log"); t->cs = -1; t->ccumcov = -1; t->damps = -1; t->ccov = -1; t->diagonalCov = 0; /* default is 0, but this might change in future, see below */ t->updateCmode.modulo = -1; t->updateCmode.maxtime = -1; t->updateCmode.flgalways = 0; t->facupdateCmode = 1; strcpy(t->resumefile, "_no_"); if (strcmp(filename, "non") != 0 && strcmp(filename, "writeonly") != 0) { readpara_ReadFromFile(t, filename); } if (t->N <= 0) { t->N = dim; } N = t->N; if (N == 0) { FATAL("readpara_readpara_t(): problem dimension N undefined.\n", " (no default value available).", 0, 0); } if (t->xstart == 0 && inxstart == 0 && t->typicalX == 0) { ERRORMESSAGE("Warning: initialX undefined. typicalX = 0.5...0.5 used.", "", "", ""); printf("\nWarning: initialX undefined. typicalX = 0.5...0.5 used.\n"); } if (t->rgInitialStds == 0 && inrgsigma == 0) { /* FATAL("initialStandardDeviations undefined","","",""); */ ERRORMESSAGE("Warning: initialStandardDeviations undefined. 0.3...0.3 used.", "", "", ""); printf("\nWarning: initialStandardDeviations. 0.3...0.3 used.\n"); } if (t->xstart == 0) { t->xstart = new_double(N); /* put inxstart into xstart */ if (inxstart != 0) { for (i = 0; i < N; ++i) { t->xstart[i] = inxstart[i]; } } /* otherwise use typicalX or default */ else { t->typicalXcase = 1; for (i = 0; i < N; ++i) { t->xstart[i] = (t->typicalX == 0) ? 0.5 : t->typicalX[i]; } } } /* xstart == 0 */ if (t->rgInitialStds == 0) { t->rgInitialStds = new_double(N); for (i = 0; i < N; ++i) { t->rgInitialStds[i] = (inrgsigma == 0) ? 0.3 : inrgsigma[i]; } } readpara_SupplementDefaults(t); if (strcmp(filename, "non") != 0) { readpara_WriteToFile(t, "actparcmaes.par", filename); } } /* readpara_init */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void readpara_exit (readpara_t *t) { if (t->xstart != 0) { /* not really necessary */ free(t->xstart); } if (t->typicalX != 0) { free(t->typicalX); } if (t->rgInitialStds != 0) { free(t->rgInitialStds); } if (t->rgDiffMinChange != 0) { free(t->rgDiffMinChange); } if (t->weights != 0) { free(t->weights); } free(t->rgsformat); free(t->rgpadr); free(t->rgskeyar); free(t->rgp2adr); free(t->weigkey); } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void readpara_ReadFromFile (readpara_t *t, const char *filename) { char s[1000]; const char *ss = "initials.par"; int ipara, i; int size; FILE *fp; if (filename == 0) { filename = ss; } fp = fopen(filename, "r"); if (fp == 0) { ERRORMESSAGE("cmaes_ReadFromFile(): could not open '", filename, "'", 0); return; } for (ipara = 0; ipara < t->n1para; ++ipara) { rewind(fp); while (fgets(s, sizeof(s), fp) != 0) { /* skip comments */ if (s[0] == '#' || s[0] == '%') { continue; } if (sscanf(s, t->rgsformat[ipara], t->rgpadr[ipara]) == 1) { if (strncmp(t->rgsformat[ipara], " stopFitness ", 13) == 0) { t->stStopFitness.flg = 1; } break; } } } /* for */ if (t->N <= 0) { FATAL("readpara_ReadFromFile(): No valid dimension N", 0, 0, 0); } for (ipara = 0; ipara < t->n2para; ++ipara) { rewind(fp); while (fgets(s, sizeof(s), fp) != 0) { /* read one line */ /* skip comments */ if (s[0] == '#' || s[0] == '%') { continue; } if (sscanf(s, t->rgskeyar[ipara], &size) == 1) {/* size==number of values to be read */ if (size > 0) { *t->rgp2adr[ipara] = new_double(t->N); for (i = 0; i < size && i < t->N; ++i) {/* start reading next line */ if (fscanf(fp, " %lf", &(*t->rgp2adr[ipara])[i]) != 1) { break; } } if (i < size && i < t->N) { ERRORMESSAGE("readpara_ReadFromFile ", filename, ": ", 0); FATAL("'", t->rgskeyar[ipara], "' not enough values found.\n", " Remove all comments between numbers."); } for (; i < t->N; ++i) { /* recycle */ (*t->rgp2adr[ipara])[i] = (*t->rgp2adr[ipara])[i % size]; } } } } } /* for */ fclose(fp); return; } /* readpara_ReadFromFile() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void readpara_WriteToFile (readpara_t *t, const char *filenamedest, const char *filenamesource) { int ipara, i; size_t len; time_t ti = time(0); FILE *fp = fopen(filenamedest, "a"); if (fp == 0) { ERRORMESSAGE("cmaes_WriteToFile(): could not open '", filenamedest, "'", 0); return; } fprintf(fp, "\n# Read from %s at %s\n", filenamesource, asctime(localtime(&ti))); /* == ctime() */ for (ipara = 0; ipara < 1; ++ipara) { fprintf(fp, t->rgsformat[ipara], *(int *)t->rgpadr[ipara]); fprintf(fp, "\n"); } for (ipara = 0; ipara < t->n2para; ++ipara) { if (*t->rgp2adr[ipara] == 0) { continue; } fprintf(fp, t->rgskeyar[ipara], t->N); fprintf(fp, "\n"); for (i = 0; i < t->N; ++i) { fprintf(fp, "%7.3g%c", (*t->rgp2adr[ipara])[i], (i % 5 == 4) ? '\n' : ' '); } fprintf(fp, "\n"); } for (ipara = 1; ipara < t->n1outpara; ++ipara) { if (strncmp(t->rgsformat[ipara], " stopFitness ", 13) == 0) { if (t->stStopFitness.flg == 0) { fprintf(fp, " stopFitness\n"); continue; } } len = strlen(t->rgsformat[ipara]); if (t->rgsformat[ipara][len - 1] == 'd') { /* read integer */ fprintf(fp, t->rgsformat[ipara], *(int *)t->rgpadr[ipara]); } else if (t->rgsformat[ipara][len - 1] == 's') { /* read string */ fprintf(fp, t->rgsformat[ipara], (char *)t->rgpadr[ipara]); } else { if (strncmp(" fac*", t->rgsformat[ipara], 5) == 0) { fprintf(fp, " "); fprintf(fp, t->rgsformat[ipara] + 5, *(double *)t->rgpadr[ipara]); } else { fprintf(fp, t->rgsformat[ipara], *(double *)t->rgpadr[ipara]); } } fprintf(fp, "\n"); } /* for */ fprintf(fp, "\n"); fclose(fp); } /* readpara_WriteToFile() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void readpara_SupplementDefaults (readpara_t *t) { double t1, t2; int N = t->N; clock_t cloc = clock(); if (t->seed < 1) { while ((int)(cloc - clock()) == 0) { ; /* TODO: remove this for time critical applications!? */ } t->seed = (unsigned int)abs((long)(100L * time(0) + clock())); } if (t->stStopFitness.flg == -1) { t->stStopFitness.flg = 0; } if (t->lambda < 2) { t->lambda = 4 + (int)(3 * log((double)N)); } if (t->mu == -1) { t->mu = t->lambda / 2; readpara_SetWeights(t, t->weigkey); } if (t->weights == 0) { readpara_SetWeights(t, t->weigkey); } if (t->cs > 0) {/* factor was read */ t->cs *= (t->mueff + 2.) / (N + t->mueff + 3.); } if (t->cs <= 0 || t->cs >= 1) { t->cs = (t->mueff + 2.) / (N + t->mueff + 3.); } if (t->ccumcov <= 0 || t->ccumcov > 1) { t->ccumcov = 4. / (N + 4); } if (t->mucov < 1) { t->mucov = t->mueff; } t1 = 2. / ((N + 1.4142) * (N + 1.4142)); t2 = (2. * t->mueff - 1.) / ((N + 2.) * (N + 2.) + t->mueff); t2 = (t2 > 1) ? 1 : t2; t2 = (1. / t->mucov) * t1 + (1. - 1. / t->mucov) * t2; if (t->ccov >= 0) { /* ccov holds the read factor */ t->ccov *= t2; } if (t->ccov < 0 || t->ccov > 1) { /* set default in case */ t->ccov = t2; } if (t->diagonalCov == -1) { t->diagonalCov = 2 + 100. * N / sqrt((double)t->lambda); } if (t->stopMaxFunEvals == -1) { /* may depend on ccov in near future */ t->stopMaxFunEvals = t->facmaxeval * 900 * (N + 3) * (N + 3); } else { t->stopMaxFunEvals *= t->facmaxeval; } if (t->stopMaxIter == -1) { t->stopMaxIter = ceil((double)(t->stopMaxFunEvals / t->lambda)); } if (t->damps < 0) { t->damps = 1; /* otherwise a factor was read */ } t->damps = t->damps * (1 + 2 * douMax(0., sqrt((t->mueff - 1.) / (N + 1.)) - 1)) /* basic factor */ * douMax(0.3, 1. - /* modify for short runs */ (double)N / (1e-6 + douMin(t->stopMaxIter, t->stopMaxFunEvals / t->lambda))) + t->cs; /* minor increment */ if (t->updateCmode.modulo < 0) { t->updateCmode.modulo = 1. / t->ccov / (double)(N) / 10.; } t->updateCmode.modulo *= t->facupdateCmode; if (t->updateCmode.maxtime < 0) { t->updateCmode.maxtime = 0.20; /* maximal 20% of CPU-time */ } } /* readpara_SupplementDefaults() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ void readpara_SetWeights (readpara_t *t, const char *mode) { double s1, s2; int i; if (t->weights != 0) { free(t->weights); } t->weights = new_double(t->mu); if (strcmp(mode, "lin") == 0) { for (i = 0; i < t->mu; ++i) { t->weights[i] = t->mu - i; } } else if (strncmp(mode, "equal", 3) == 0) { for (i = 0; i < t->mu; ++i) { t->weights[i] = 1; } } else if (strcmp(mode, "log") == 0) { for (i = 0; i < t->mu; ++i) { t->weights[i] = log(t->mu + 1.) - log(i + 1.); } } else { for (i = 0; i < t->mu; ++i) { t->weights[i] = log(t->mu + 1.) - log(i + 1.); } } /* normalize weights vector and set mueff */ for (i = 0, s1 = 0, s2 = 0; i < t->mu; ++i) { s1 += t->weights[i]; s2 += t->weights[i] * t->weights[i]; } t->mueff = s1 * s1 / s2; for (i = 0; i < t->mu; ++i) { t->weights[i] /= s1; } if (t->mu < 1 || t->mu > t->lambda || (t->mu == t->lambda && t->weights[0] == t->weights[t->mu - 1])) { FATAL("readpara_SetWeights(): invalid setting of mu or lambda", 0, 0, 0); } } /* readpara_SetWeights() */ /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ static double douSquare (double d) { return d * d; } static int intMin (int i, int j) { return i < j ? i : j; } static double douMax (double i, double j) { return i > j ? i : j; } static double douMin (double i, double j) { return i < j ? i : j; } static double rgdouMax (const double *rgd, int len) { int i; double max = rgd[0]; for (i = 1; i < len; ++i) { max = (max < rgd[i]) ? rgd[i] : max; } return max; } static double rgdouMin (const double *rgd, int len) { int i; double min = rgd[0]; for (i = 1; i < len; ++i) { min = (min > rgd[i]) ? rgd[i] : min; } return min; } static int MaxIdx (const double *rgd, int len) { int i, res; for (i = 1, res = 0; i < len; ++i) { if (rgd[i] > rgd[res]) { res = i; } } return res; } static int MinIdx (const double *rgd, int len) { int i, res; for (i = 1, res = 0; i < len; ++i) { if (rgd[i] < rgd[res]) { res = i; } } return res; } static double myhypot (double a, double b) { /* sqrt(a^2 + b^2) numerically stable. */ double r = 0; if (fabs(a) > fabs(b)) { r = b / a; r = fabs(a) * sqrt(1 + r * r); } else if (b != 0) { r = a / b; r = fabs(b) * sqrt(1 + r * r); } return r; } static int SignOfDiff (const void *d1, const void *d2) { return *((double *)d1) > *((double *)d2) ? 1 : -1; } #if 1 /* dirty index sort */ static void Sorted_index (const double *rgFunVal, int *iindex, int n) { int i, j; for (i = 1, iindex[0] = 0; i < n; ++i) { for (j = i; j > 0; --j) { if (rgFunVal[iindex[j - 1]] < rgFunVal[i]) { break; } iindex[j] = iindex[j - 1]; /* shift up */ } iindex[j] = i; /* insert i */ } } #endif static void*new_void (int n, size_t size) { static char s[70]; void *p = calloc((unsigned)n, size); if (p == 0) { sprintf(s, "new_void(): calloc(%ld,%ld) failed", (long)n, (long)size); FATAL(s, 0, 0, 0); } return p; } double * cmaes_NewDouble (int n) { return new_double(n); } static double*new_double (int n) { static char s[170]; double *p = (double *)calloc((unsigned)n, sizeof(double)); if (p == 0) { sprintf(s, "new_double(): calloc(%ld,%ld) failed", (long)n, (long)sizeof(double)); FATAL(s, 0, 0, 0); } return p; } /* --------------------------------------------------------- */ /* --------------------------------------------------------- */ /* ========================================================= */ void cmaes_FATAL (char const *s1, char const *s2, char const *s3, char const *s4) { time_t t = time(0); ERRORMESSAGE(s1, s2, s3, s4); ERRORMESSAGE("*** Exiting cmaes_t ***", 0, 0, 0); printf("\n -- %s %s\n", asctime(localtime(&t)), s2 ? szCat(s1, s2, s3, s4) : s1); printf(" *** CMA-ES ABORTED, see errcmaes.err *** \n"); fflush(stdout); exit(1); } /* ========================================================= */ static void FATAL (char const *s1, char const *s2, char const *s3, char const *s4) { cmaes_FATAL(s1, s2, s3, s4); } /* ========================================================= */ void ERRORMESSAGE (char const *s1, char const *s2, char const *s3, char const *s4) { #if 1 /* static char szBuf[700]; desirable but needs additional input argument * sprintf(szBuf, "%f:%f", gen, gen*lambda); */ time_t t = time(0); FILE *fp = fopen("errcmaes.err", "a"); if (!fp) { printf("\nFATAL ERROR: %s\n", s2 ? szCat(s1, s2, s3, s4) : s1); printf("cmaes_t could not open file 'errcmaes.err'."); printf("\n *** CMA-ES ABORTED *** "); fflush(stdout); exit(1); } fprintf(fp, "\n -- %s %s\n", asctime(localtime(&t)), s2 ? szCat(s1, s2, s3, s4) : s1); fclose(fp); #endif } /* ========================================================= */ char*szCat (const char *sz1, const char *sz2, const char *sz3, const char *sz4) { static char szBuf[700]; if (!sz1) { FATAL("szCat() : Invalid Arguments", 0, 0, 0); } strncpy((char *)szBuf, sz1, (unsigned)intMin((int)strlen(sz1), 698)); szBuf[intMin((int)strlen(sz1), 698)] = '\0'; if (sz2) { strncat((char *)szBuf, sz2, (unsigned)intMin((int)strlen(sz2) + 1, 698 - (int)strlen((char const *)szBuf))); } if (sz3) { strncat((char *)szBuf, sz3, (unsigned)intMin((int)strlen(sz3) + 1, 698 - (int)strlen((char const *)szBuf))); } if (sz4) { strncat((char *)szBuf, sz4, (unsigned)intMin((int)strlen(sz4) + 1, 698 - (int)strlen((char const *)szBuf))); } return (char *)szBuf; } freefem++-3.61-1/examples++-load/Element_P3dc.hpp000644 000767 000024 00000003765 13312446271 021452 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... const int TypeOfFE_P3dcLagrange::nn[10][3] = { {0, 0, 0}, {1, 1, 1}, {2, 2, 2}, {1, 1, 2}, {1, 2, 2}, {0, 2, 2}, {0, 0, 2}, {0, 0, 1}, {0, 1, 1}, {0, 1, 2}} ; const int TypeOfFE_P3dcLagrange::aa[10][3] = { {0, 1, 2}, {0, 1, 2}, {0, 1, 2}, {0, 1, 0}, {0, 0, 1}, {0, 0, 1}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {0, 0, 0}} ; const int TypeOfFE_P3dcLagrange::ff[10] = {6, 6, 6, 2, 2, 2, 2, 2, 2, 1}; const int TypeOfFE_P3dcLagrange::il[10] = {3, 0, 0, 0, 0, 1, 2, 2, 1, 1}; const int TypeOfFE_P3dcLagrange::jl[10] = {0, 3, 0, 2, 1, 0, 0, 1, 2, 1}; const int TypeOfFE_P3dcLagrange::kl[10] = {0, 0, 3, 1, 2, 2, 1, 0, 0, 1}; freefem++-3.61-1/examples++-load/testFE-PkEdge.edp000644 000767 000024 00000003316 13256636774 021530 0ustar00hechtstaff000000 000000 load "Element_PkEdge" // a macro the compute numerical derivative macro DD(f,hx,hy) ( (f(x1+hx,y1+hy)-f(x1-hx,y1-hy))/(2*(hx+hy))) // mesh Th=square(1,1,flags=0,[10*(x+y/3),10*(y-x/3)]); Th=square(1,1,flags=0 ); plot(Th,wait=1); //savemesh(Th,"Th.msh"); real x1=0.4,y1=0.4;//10*(x+y/3),y1=10*(y-x/3), real h=1e-5 ; int it1=Th(x1,y1).nuTriangle; // FFCS: store reference value real regtest; macro Check(PkEdge) { cout << " Test Finite Element " <. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // to compile: ff-c++ bstream.cpp // WARNING: do not compile under windows #include "ff++.hpp" #include #include template class Stream_b { public: Stream_b (T *ff): f(ff) {} Stream_b (T **ff): f(*ff) {ffassert(f);} Stream_b (const Stream_b &io): f(io.f) {} T *f; }; template Stream_b pto_stream_b (T **f) {return Stream_b(f);} template Stream_b to_stream_b (T *f) {return Stream_b(f);} template istream*Read (Stream_b const &io, T *const &data) { io.f->read(reinterpret_cast(data), sizeof(*data)); return io.f; } template istream*Read (Stream_b const &io, KN *const &data) { long n; io.f->read(reinterpret_cast(&n), sizeof(long)); cout << " read n =" << n << " " << n * sizeof(sizeof(T)) << " " << endl; if (n != data->N()) {data->resize(n);} T *p = *data; io.f->read(reinterpret_cast(p), n * sizeof(T)); return io.f; } template ostream*Write (Stream_b const &io, KN *const &data) { T *p = *data; long n = data->N(); cout << " write n =" << n << " " << n * sizeof(T) << " " << p << endl; io.f->write(reinterpret_cast(&n), sizeof(long)); io.f->write(reinterpret_cast(p), n * sizeof(T)); return io.f; } template ostream*Write (Stream_b const &io, T *const &data) { io.f->write(reinterpret_cast(data), sizeof(*data)); return io.f; } template ostream*Write (Stream_b const &io, T const &data) { io.f->write(reinterpret_cast(&data), sizeof(data)); return io.f; } template void initK () { typedef Stream_b OB; typedef Stream_b IB; Add("(", "", new OneOperator2_(Read)); Add("(", "", new OneOperator2_(Write)); Add("(", "", new OneOperator2_(Write)); Add("(", "", new OneOperator2_ *>(Read)); Add("(", "", new OneOperator2_ *>(Write)); } static void inittt () { typedef Stream_b OB; typedef Stream_b IB; Dcl_Type(); Dcl_Type(); Add("read", ".", new OneOperator1(pto_stream_b )); Add("write", ".", new OneOperator1(pto_stream_b )); initK(); initK(); initK >(); /* * Add("(","",new OneOperator2_(Read)); * Add("(","",new OneOperator2_(Write)); * Add("(","",new OneOperator2_(Write)); */ } LOADFUNC(inittt); freefem++-3.61-1/examples++-load/mshmet.edp000644 000767 000024 00000000121 13256636774 020465 0ustar00hechtstaff000000 000000 cout << " remove example see ../examples++-3d/Laplace-Adapt-3d.edp \n" < [Ex,Ey,Ez], [vx,vy,vz]; // define the vector field and the test function // (edge elements are vector elements and they give a subspace of Hcurl) // Macros macro Curl(ux,uy,uz) [dy(uz)-dz(uy),dz(ux)-dx(uz),dx(uy)-dy(ux)] // EOM macro Nvec(ux,uy,uz) [uy*N.z-uz*N.y,uz*N.x-ux*N.z,ux*N.y-uy*N.x] // EOM //uxN macro Curlabs(ux,uy,uz) [abs(dy(uz)-dz(uy)),abs(dz(ux)-dx(uz)),abs(dx(uy)-dy(ux))] //EOM // Variational formulation of the problem to solve // (sigma = 0, here k is the wavenumber) // -k^2*E + curl(curl E) = 0 in Omega // E x n = 0 on x = 0, x = a, y = 0, y = b // Curl(E) x n + i*beta n x (E x n) = Ginc on z = 0 // Curl(E) x n + i*beta n x (E x n) = 0 on z = c problem waveguide([Ex,Ey,Ez], [vx,vy,vz], solver=sparsesolver) = int3d(Th)(Curl(Ex,Ey,Ez)'*Curl(vx,vy,vz)) - int3d(Th)(k^2*[Ex,Ey,Ez]'*[vx,vy,vz]) + int2d(Th,in,out)(1i*beta*Nvec(Ex,Ey,Ez)'*Nvec(vx,vy,vz)) - int2d(Th,in)([vx,vy,vz]'*[Gix,Giy,Giz]) + on(guide,Ex=0,Ey=0,Ez=0); waveguide; // solve the problem Nh [Eex,Eey,Eez] = [ExTE,EyTE,0]; // the exact solution Nh [Errx,Erry,Errz]; // the error wrt the exact solution [Errx,Erry,Errz] = [Eex,Eey,Eez]-[Ex,Ey,Ez]; // Norm of the exact solution real Hcurlerrsqex, Hcurlerrex, L2errsqex, L2errex; L2errsqex = int3d(Th)(abs(Eex)^2+abs(Eey)^2+abs(Eez)^2); Hcurlerrsqex = int3d(Th)(Curlabs(Eex,Eey,Eez)'*Curlabs(Eex,Eey,Eez))+L2errsqex; Hcurlerrex = sqrt(Hcurlerrsqex); L2errex = sqrt(L2errsqex); cout << "Hcurl norm of the exact solution = " << Hcurlerrex << endl; cout << "L2 of the exact solution = " << L2errex << endl << endl; // Norm of the error real Hcurlerrsq, Hcurlerr, L2errsq, L2err; L2errsq = int3d(Th)(abs(Errx)^2+abs(Erry)^2+abs(Errz)^2); Hcurlerrsq = int3d(Th)(Curlabs(Errx,Erry,Errz)'*Curlabs(Errx,Erry,Errz))+L2errsq; Hcurlerr = sqrt(Hcurlerrsq); L2err = sqrt(L2errsq); cout << "Hcurl norm of the error = " << Hcurlerr << endl; cout << "L2 norm of the error = " << L2err << endl << endl; // Relative errors cout << "relative Hcurl norm of the error = " << Hcurlerr/Hcurlerrex << endl; cout << "relative L2 norm of the error = " << L2err/L2errex << endl << endl; // Plot the real part of the solution medit("real",Th,[real(Ex),real(Ey),real(Ez)]); // in the medit window press h=help, m=data!! freefem++-3.61-1/examples++-load/lg.pgm000644 000767 000024 00000175637 13256636774 017636 0ustar00hechtstaff000000 000000 P5 322 200 255 gdquznzrfvm}jgdahokb``gjgbmrab^bp{v}q~uhwywqh}sieqqibuxktzsjvy~aqnjlnnpptvxwxugptnslnqsvtpn|wy}~}}vxx}{|p|of^k~jsopehlmvvxy~y{ryyhwrtnlspsjga`_Y]aek_UNns}zwxefh_wmnulgffeqe[^bkgfoib`ehuu|yv~pvj~~{o^WO^lfgs}pzrt|wvxdnsomppmmslmoy||~{lyqonnsklnio{x|{v{~{~||z~t|w~|rhpwtliieqpiwutkpu{mceljqpnlzksx~wfx~}unenac`[[iwb_U\w~yhiibeniihgc``af]_gegduh`afhy~|vkxo~rkqpuRYnjtwtxxoop~wmimlqrnoqnlro}~~pqsqpoottptr|||}s~{|{{z}}v}yqkhmnkef{vkj|~jghgdcdjccbtrntxx}}~zrqjb^_wyjhec^]cy{se_t{nhlfmkljglebbe`]itgbdclantog\hn}v}d_ixxbkpwkgnz|~rxvmjvpsoimsuxxvtqotz|~|hqrjmu}{wvzwvz}xvv~{}~xvjbfepjfdnykqlevjhsimiausgdjtgq}ii|x}|riqnag~tdga]\]iyulnfbhjimgghfa^dbvi^efc]akn|nm^aihpp{`oWU^rtld`liq~ggpt|x{vnq~utqnkkpwyxtzsy{~rfrslsytxvszyvwv{xvwort|rjn|nfnikqjdbgpb_e~vnmylvvfjzl|~nddgbbdj~ffc]`^mh|tzqeoghflfikihdfb\^gxb^jjccbjn}zkxe\adbwqVmhq{wyltk}|m^ohhn}}{{qrkhmljhpvvzv|~~mrnjuxzyq}~~~rpv~wut|zyu{|kolbaek`bac^kuoh{z}t{~}oedb{zts~|sxpnygizojeggbjaekkonh]mpnf]]hijjkffhicb_`gek^\gfiipyqty{c\bviZkYysqhsspl{jokyuvz~{odpokkpqxrrzyywpqsr~u~svptwpnww~|~{orvqtjned_]l{qpvkda{syx}uo~oggfrktqyw{svynatodefpj]_swxaa[\X~xsllh`NG[rjhgfafgdcgjgee^dbejo}zn}zkl^]apxiurwjor~szllwlllpx{rvvu|hnpssosw||vyt}{}{prtzwtqxolvwprvs~x{rzzzsmm_Xu}mtoxecmsmq}tityoebhuw~iuzlbr~g_jvijdkgw_\X^VwxcomL\cWu|nghegdd`emkcbd]bijhy|hZ[_l|xrlpls~{q|xocrsokmxwnpwys~mtppuuw{~yt{}~}|tn{~ux~nkl|~yuow}rv{ufic|vrnsyvrbq}osyulnwzedtofjhk\g_XYaV{|}rYUI`noiliidadllhe^]]dnnmk^^h~zsikntkfj}}rwvmegq|pjz~ptqovwouttx|u{zslrvwy~}z{uxzmukw|tvkkpfvk}|vy~}ol{z{pkopu~o|~\R]tlk`aejeevx_]g[vsfnV}{w{onlihgdfifi`_\\ckq{uckollgilfbfhgw}xpzzmflhxlo{}wsnfrnovywtuzvxnry~{ztt}|r}|{uyvz~~x~}uehsuzvz~o}|niojqck}ZT|uan|jbl_]lljlpfw{qgtkhpjkmjedegedf_c`]gfqsp\bqtWK`]nfgunlxvls}walmo{{vpnkplrvxpoxvyrq~}~xmkk{}soqy~uw|zx{wyw~|~ze}ka]n{zcixnbv^asgv}azbop^bj}ynjijhfhjbcabb\cicnpW`txi\g~m~nvlhjtkqljjq|rkmnrurqtzpnzzww~xyuxtnpmrxvpss|ppnvuy~~~utryomxzyrki~u}tey}b]o`^`cYagjxvohpn^EJnywjkllilkebd`_cdhjtbaxjnokliqvskljkxvgpoy|xsrjltvutljvnr|zp}|y}~}wnokntljdnvkmmruwv~{{||~srv~~z}~y~iewwgjsz|w{{ezila{zs_]baYXjgyw~zlzcfj_cPlmcklgihlkcefehleqx|ved|eejejlnowqkmopygpqoiruomlolnnprstuytt|z{|{~qoqqlojemrggkos{|}|yzwttramzv~{du~{qlcpmbweY_gfaqtglrmzubhc^Xeifgjheheeelibornpz``tb\Vdjejkwieix~ij{yxkjmnpnsgkpkjnvuz|xv~|}|}~~o~~uxuqsomiltsqsqqt||{zz{||zvvzzxlyf_k~rnrx{obod_wl{w{th{`cfdcfkqjgdgd`bfegkhjoqp~|dbzvkZN\WYmglszymkoqmgnrphhmlgojklqqpnpzvvyv||~~}}x~xz~yqppvpmlrxuwwvsx}{|w}}uqwv~~uw}|~sni`d]dr~wrwntpzg`ylmlot}obgkchjjwghgecbaggjlmnnqv_bkzaaa[_Kd|ptwprplwygcosqddgokjkkhtjmjsxwsnnv}}|xz{|}tqmnnrswtzyqox~~yo|vkrz{}}{xx}{||~vrnghhnyrpx~{dh}e|wv`cphfklbdaafda`efhjhmvuqyd^qsohl_qn{wr{qny}vffloqbdgmligiimtvgkmpsqnorv{pz~{|~|wtqppx|x|yqv~~~z|zz{rov{w{}|~|wsiuvthr~gutdf_jb_eaokecdacaadjgiihop||g[bghlxkjbjgo{xotxyjfy{xmkvpfddhmecdihkjgdpnimrqnvxxzv~z~w{|z{suussvz|}}zy{~ysnu{vwu{~z|{zz|s}h|gi{w|iilggwtfnwztnjmdVd`^`fhhd`dhjgeeiprk~r_edUgopq`XTg~}potspz{mlmmdejilfipojmjjpmmgu|ptmyxuzst|u{}}{|}x{rrnqstx}|t{|xrz}vy}{~z~npzw{qzeztzu{ujcbowvxuk{xefql^_ogjd_cmeiefvssxse^dcfoqf``fǞrr}v{vswqlnrxodgeklhmrrnmpjkink|usqzpz|s{ww}~sqkqvt{|}{z||}|{{ru||q|z}jsyykissxuhj{~ty|~pcavo}}nҰcfivddbdgf`fdifepxzzhabht`s|haasǝxpu|tznhext|hqprmuronmprimnhkqtqqv~}vyy}zx|}popst|uml}wxrz{qqx{{{|||{rtvyyuiiy~ns}se|vy{|~ktfyz|urcjݸc]accbdddgcdchihrwszd`\_cbZzhS`y`v}uxwx}{{oiklspqyps}vnpqmlpnokdljgorum}uv|yz{{xwsprsz~jrvtspurqnqtsvo~{xv}}ywvywz{|~}}~z{jrvpnfv{{zzs|s{vyknyswzb[fƩȧ^\ebcddgkgdkheims}~{djcSOZ|jk}vttu}}upgvmpsckj~slolnntyilptostqw|~~ty}|zz}}utpttlkiqjt|u}{x~}}zm|y{u|{ps|v|~{~xuvlmnujc`klafxwpn`[rIJ`UdbcljklkoomdmteMyxw}t{xjtuqgotx{uibptjjijiw{suvsprt}{p}yvv~zsx}~|ytrsuwyqlfoqwu{~~||z}zuz}{x~y~urngfw|}qledcgdihojikhhc_]^^Z:[gdjihjpmklrt{~|ui[Tttxyojfeqoipsv{vsnrprjjpptr~x~wwtzt~|svx|y{~}~~u}~v}yr|ufhp|{~{rzuxxx|ler|~sx}vzqnrrozrhfhjge_XWZ\{n}w~bWmllfijhpmup}c0Fmy\cqtptoutuslgipshh}~|wsrspjgvsos}~|}wvx{}|}ot{}yy~xgr|e~{M5HI:f|uxtpjlooqqvz|rwxnoneae}}m{|}yxoqztxwpcbffie_a`mo}yjzdwskfhinntxz`+7}tgogllllckknupihkfrjmdry}wtrvyos|mnknx~xx||tz~yuz{w}{vI.13/2Gvy>,+-++.Ysv|qlkmlt{~}nvl~~XQifrp}suo|ujkibbmsuigdbdhqfrqquxyhopmrzsyt=(8pyxdEO`gnrnxmwvzqqjhdl{ahbwnrju{vqinjjlr}|||z~x~||{|~riw}zvxsvR-,,-../4b|`M8+++,+++-c~yowtr{{{w}xyorx|von3jngqlyozyk~sckia\acmsoxpjlejipnyyaszoji}pc-&.wwhcNnzsrvt|~|tpkkgindhvrswprpttwgknjksyvx~|whmryvzvijK,,+,,,../O}}<.++*+++*+**3LGStmtvunqx{~vqzkn?:{}en~|nqu|ujhr_^ljvvbw}uoclupk`tvnhmxzX)'8unLqh{qtutu}ssjihm~t~jeelxnqursnpryxn}nklp{yzjt|yuy}y{xilpltovr\1++,+,,,,,-Ksijmw{{S++++++++++**)***,Yuxxx{}|yo|{vozykt5iz~tmwrskqgip{xtmq|abttn||jeolflztpdn|{lnqkntSC[exaGdggsurxuw|wvvvkemp~||qjgifkwt|syx|wytkjpnkkmiqypvxurwppsr8.--++,+,,+++/-++-.1.,**++++++**))()**,.9Zntqp{~z{{|gna?oux~~x~mh|wnzwjhyv|ldetz{ylno`hmsvppxs|pjypqyuhp{WVgzrnznqsuvpeecfvozrytw|rosolmlt}oeeoxl~}}xglmxz~[9/.--++,+,,++++))))+++,****++++**)(((**+**/?[++;bxd_]iXoo{}yiokcsyowt{pkv}}|kqsmjnptt~~bc[^]beek}hkhgpy}yjO]T`ǖ{pvvljsy|secc~qpspurv{|p{rknvylquwn~ossr{^<1//..,++,+,,++++++*****+****++))))((((***+)))+)))+.*++,+,2NX`Ym||}}~qx|qqpbder~iu~wom}zsqeeslkfr}ghqslpgc}pkr|ralwۮ}ytowtljlspehm}puqdezp}{zqw}u|rojo~wt}mo~}xryouzd431//..,,,,,,,**++************++))((((((**++))))((***)*+++*+*,+-5Ocew}y~vdclk}~kyjljnz}um}s}g^dnwpp{vwxhawxgil{x|Dz{fZ{~x}unkmqkknvbcvwzhjgm|vrxtopsrpoln{uxjr}qvw|tyu{}8200/0..,,,,,,,++++++++**********)(((((((****)((((())))))))*+*+**++--Nnh~|hsv{qgnr}zz{movzfkheollml{rsynsrimlqww}{{~oqqjop~mqvnxjrgqvvppmfmov}rs}yxnkr}~r{~}y}20.../-.,,,,,,,++++,,,,**********)(((((((****)((((()))))))))****+**)++.5T~ts}n|~wxukvns~ū}ns|vlzm|`lrupnmmeozctmWs}nal~zvyuphikqu}wmfmrzlr}plwg~}vt~vriquq}u{}p1/...,+,,,,+,+,,+++,,,,********))(((((((())))(((((())))))))))))))))))*+++;t~uyyuwspzwwssx~qvq{|~}lp|{wjfkoghiqujon]^INVi}~~zxlmo|sdowfprmrssxuzx{qypojyt{|wwhdekpp~z|zwyszaR_V;//.,,++,,,,+,+,,+,,,,,,********)((((((((((((((((((()))))))))))))))))))))**3g|x|u~u}t|y|t|}sfhzzi}{svjimqxyw~ea–`djc|yzmifoyiopjlmwiqpzuqvpwrns~wuefknws}|zwu{]333110/.-.++,,,,+,+,,+++++++****++))))))(((((((((((())))))))))))))))(((()))))))*1jwvslwyzzsyyo~~u{naemoebj{xigelnt|wk|t߱|ztmlqffjogkmnmumpz|mxz~}mpos}|uldhmpnisyu~{wQ4112000/-,--*,,,,,,,,,,+++*+*****++))))))(((((((((((())))))))))))))))((((*********0Vww}v||s}r}{u|~{|mjpswyjgys{sywfhpocjnxxoxњvuu{wx}snnjqdeidttrxzonc{}xyockustoolflpnktw}}x}81000/0/.-,-,*++++++++,,+++*+***+)+*))**))(((((((((((())))))))))))))))((((*+++++++*),D{qT9C>Iyz~{v~~kgfq}wmwuq|kn~mlugfp{dpx~~|d^͑|xs~ytvtt~ymcihkw{owjt|x}wypqxywmptmgioququ{~|wl2/......--,.,+++++++++,,+++*+***+)+)))*+))(((((((((((())))))))))))))))(((())*****)*+++:@DA-))**1Y~}öuxr~y|jmt}z}txvpunovvhpz~}w{yku|Pi{uqrssqqksuegjefn|vsphqgqqrtopvn|}{~zzklgiv|~b/--.-.----+,,+*****+++++++******+)****+*))))))))))))))))))))))))))))))))))(())*+)())**++*+*)((**,\p|{t|yznwwvzqxv~mw~]pvpihpiijemjadkvcbwfv|yuvortxtvyssz|{kdlxw~|}{x~{}MGE.,-,,-----,,++*****+*+++++******)*+,**+)))))))))))))))))))))))))))))))))))(((()))(((***))))(((*++,S~~}~~z~s}uzuwpk|z}x}us}cuͺ|fibtmsj~i`gr{benenvsrrlkmnppolr~zolmmzvv{}}~}{>.1.-,,*+,--.,++++*****+*+++++*******+,,*)*()()))))))))())))))))))))))))))))))(((((((((()))((((((())*++S~~||svxpn|t~|rsqi{{iu~z{}kkkxvpim{pdv|puzqqw~noplss|{t|vlig~{zy||~sP-./-++,++,--.,++++*****+*+++++********+++))()()))))))))())))))))))))))))))))))((((((((((((((((((((())*)*9dz~xrntqz}zzsm{r}tq{mgknyw{tzllnzqqtyylnlv}rx}|~wwlx~}yy~xdB1.-/-+++,+++--,++,+++++++++++++++++++++++++***))))))'())((()))))))))(((())))(((((((((((((((((((((((((((())*,?g{tpl{éyvq~yp|hhkoxmvt|~q}nhzvrlogoiilt|vxuryzyz~ztqzy~{cUC71--,+,-,+,,+,...++++,++++++++++++++++++,,++****++))))))&())((()))))))))(((())))(((((((((((((((((((((((((((((()))+<[utkltq~ϭzov|{}|qjw~{lijl|sp|wshv|}yxjnrjmklfccmp}pruy|v~z~}rwyv~}|tE/--,-,++,++,++,,++...,+++,++++++++++++++++++,,++****++))))))(())('()((()))))(((())))((((((((((((((((((((((((((((((((**+,./-/:Vv~~~}}ss|r{rv}}|~||mlnsihejnylnss{xtw~vvfwy{vnrjylkjsw||z|zz{|v~{|~wnI?;Mwwt~~|qy~vx}t~|vt{|}rek~xqoyyvrntwnrurwvt~}nvy|{u|{w~|}{N15-+,++,,+*,++@w}~^-,+****+,+++++++****++++++,+++,,,,+)++++++++++++,,,,+***+++))(())))))))))(''&())))))))))))))))))(((())))))))))))((((((((()))(((((*++,-.010724T~uruv}zv~}mvxv{|~{uxqz{}egempp{}}tusy|ppuqlqxyzvzz{~{{~sz{z~}uf<+**)+++++*))+++,2HKR@0,++*****++++++++****++++++++++++,,,*++++++,*+++++++++*+**++))(())))))(()('''&(('))))))))))))))))(((())))))))))))((((((((())))***)*++*+../.../9qmos}|y~}}uu{ptgoxzwx|rv{riqohbap}nu{uqvysiq}rxxtuvtxyu~}vt~}~}w@,++*)*++*+)))*+++*+*,,,,+++****++++++++************++++,,,++++++++)++++++++**+)*++))))))))))(()('''&((&))))))))))))))))(((())))))))))))((((((((())))*****++*+,-------cvss}||uy{{orbso{}stus|rrqr}~iodt}xndm{trswsws~fw{z{~|zjz|y}}{{}}z~]++*+****))))))*+,+*+++,+,++*************))**++++++++++++++++++++))*())++****+++*))*)))))(()))(())(')''''((()())))))))(()))))))))))()((((()))((((())**+++**++++,+++++--Wtqgw|~|}ztrru{{qypykupy|zyprumi{qpm~~{xr`c`oxmomn}}{w{wxu]ykslnv}~|y}zy|x}~|}t<*+******))))))++,,,,,,,,+++*************()******++++++++++++++++)))())++****++++))))))))((()(((()('*(&''''()())))))))(()))))))))))()((((()))((((()*++++++++++++++++++,/AVcmq}{~}}}y}sw|~ptsmts{ssunlnx}{tozxqtgkignwc|u{~}u|u`znU{zy~z}{{|}~~p;+)+++*+*)))))))+**++++++++++**********)*)(())))))))))++++++++++**)))())++****++++)())))))((()'((()(()('(((''(()))))))))))))))))))((()((''()))((((()*+++++++++++++++++++0214=V{{uxqn{v{|}wsnint}wmnagflitpmh{~higjmtxgu{mmipthFY{w~{vxuz}N.*******+*)))))))+**+++++++*++**********)((((((()(())))++++++++++(())))))++****++++*())))(())))&'('()()''(((&''()))))))))))))))))))((()('&'()))((((()*++++++++++*++++++,-343346exz{~rkmsmpqj{~t|ijr|yulgbfvtgqx}~mfcd_\lhfyolyuhiPV~~}zx{}~zy~v~xH++******))*))))))))))*+++++++++++++*****)((())))()))))))+++++*++))(()())))+++**++++*)()))((())))''''&)))'((((''''))))))))'()))))))))((((''(())))((((()))*++++++*++++++++,.354665Jrx}|kvj{qzwzwsl^^iz|im|ugkhkkpihpuyqmbda\OWtymY|svrꬋus}}|}{}~~||w~zz}}_:***++****)(**))))))))))+++++++++++++++++*(((())))))))))))+++++)++)))))())))+++)+++++))())()))))))('''''()(''('''(')))))))('())))))))))))''&()))))((((()))*++++++)++++++++,-3546658S|~n|niyz{qjnzyjavm\jjnrfhkjqko{~}~ubejg]eĚxkly{z~}z||~{t9*)(()*****(())))))))))))+++++++++++++++++*(((()))))))))())****+*)))))))())**+++*+++++**)))()))))))'&''(&())'((''((()((()))'&((()))))))))''(&()((()((((())**++++++*++++++++,,05686765hukwy~znlyxytjdqt}wedo}ykfanwbnynmnmplis{vvkmki}ngxp`dm鲃~y|z|}{~vx|k.(((((*****(((())))))))))++++++++++++++****(((()))))))))())))))++)))))))())++**+++++++++*))))))))))''''''())(()''(())((()))(')('*)))))))(''(&()))))((((()*+++++*++**+++*+-+,-.49;;;53=3155Oy}wlx~|vxkoopobdkgyjow}rypuqmlqtvppiooy}wxtb_Zaijɛvxvr||z~~|v{vu|m5(((('()))))))))))))(((())+++++++++++++++++*)))))))))))))())))))++))(()))(()))(())))+++++*))))))))))((('&()))()))'()))(''('()))(')'(((('(('((&'())))((((()**+++++-,**+**,-,,,/157=;9210.-,./M~}~t{{nqyixunihcu|rjZjomvqhp{ousxxl{urwyؾܱȽͿu~s}~}}{|x{yizv{x>)(((('')))))))))))))(((())+++++++++++++++++*))))))))))))))))))))++))(((())()))))))))****++))))))))))((()('())))))(()((('&(('(()('(&'('(''(()('()))))(((((*+**+++,.-**++,././//04697610/-,..07o}{u|}}qpqoylirmnhk|z~^Sequlnkystouxl_hu[{ĽƤx}~~|wx|{{yy}uwxx}zA))((((''())))))))))))(((()))))*+*)*+++++****)))))))))))))))))))))))))('(())(****)))))+,++*)))))))))))(()))(())))))())'&''&&)('')(&&&&'''&')'())**)))**))))*++++*+,.,**++-00/1431223440..,+-./18IY{vqnuv|o{x}qggqlcfrs^jhjdrnpx~~otoxrj`^g||zzvu⶚ƹӅxyz}}|y{}~~{zr~{~Z+*)((((((())))))))))))(((())))))+*))+++++*))))))))))))))))))))))))))()*()))))++++))))(+,+*))))))))))))(((())))))))))))'''''')('')(''''''''()()***+***+******,.-,+++.,*+,,/23343220./22/..,+-..0101GI@6;j}|zrpmiksrqrtxbe{m|hhesxovz~dtl~sha`srÏȡ葳{wvtz}~~z~yz{~}y||L,)))(((('(''())))'())))))()***)))**))+++++*))))))))))))))(())(())))))((*)))**+++**)))))*,,+))**)())))))(((()))))))())))))('())(())(((((((((()**++++++++*))*++-..+*+,,,++--03571/.//..21...-,../230125433:ewurrkihlifh_^lepwwzwv}{r}swqiqt|letxخǮ躰ᴉ|x{|wu}|zuvu}{{T2*))))(())'('()))))&())))**()****))()))+++++*))))))))))))))''))''))))))))))))+++++))))))))*.,*****(((()))(((())))('(()))))(((()))))))))))))))))*++***++++)((*,-...+,+,+--,,,.1340.----/30..//././3421233332;lwk{zvgmgo}sspnwuyhsq}tĪĘ}}ԫ{ɕ|wz|~yw{{yzz{twwula.))*)))(()*(('&'())('())))))()**))))(())*****)))))))))))))()(())'''()))())))))*****)))))))(*-.,+++*)*))))))))()***))(())))((((())))))))))))))))))*+***++++*))*+././--,++**,++-/10/.++,,.1.../0/../34211221228prvmyxxwv}|x}|vveuis}ݿ˱|ȗٱ~|w|uz}}l|{{y|~|z}v{zo.+)))((()))()(''''()))))))))((()**(())))))))))))))))))))))))()))))('&()))))))))))))))))))))))+,.,+**+++*))))**)(*+++**)())))))))))))))))))))))))()(*+***++++*****--././-,,+*+,++-0.//++++,//../00//14322101111>tvv{v~{zyxvyufa}qylroo~|}{hx{y}{v~x}}zvy{~~wa*(*'((()*))()'&'))))))))))))((()))(())))))))))))))))))))))))()))(()(&()))*))))))))))))))))))(*,,+***++,***))***)))**++*))))))))))))))))))))))))*****+++++++++***+...000.-.-+*,,-.-,--+**+,/.../01//1442332210//IR+')**))(*++++++*))))))))))((((((((())))))))++,0567885557741/-+++,.,7omvvxu{|qb^iqsrrq}qonrqqsoqnviTqǨuxzurwxz|z}|rz}w}~~}{q+'&%&&&&&&&'&''((*++++**)*****)))))(()())+++++*))))))))))))))))))))())('(,LimnxpV/*(()())))(((*))*+**)**)**+-2468GUV_n{vx~wdXOKMWt~~xmiqpwzyyoiR60+))))++++++)()))))))))((((((((())))))))**+.2469966666632/-,,-/,7uvwtzz~{tffhegplnpk~iljiio{tls|Δzy{u~}z{||y~}~~~}|yb&&&%'''(&'&(()((((*+++*)((*+*+)))))())())+++++*))))))))))))))))))))())(0Mrzsyjz~vF*)))))))(((((**,1;Y[QMPflhwy|~|{zurkjfsutuifijmg]\J20*+++*)()))))))))((((((((()))))))()*+-.0486334346552/--../M~zu~}urhdU]h`dgkkglrimksysqrxw♄|y}}}}~{xyw}vvz@)&&&%'(('%&'()*)((')***)(((*+**)((((())()*+++++*)()))))))))))))))))())9_nx}]0))))()))+13?Xhwwvnptvyzz|~}wrlhiv}pv|lskjtwwtswwA*++*)())))))))))(((((((())(()))()*+,-./32/000014741/...>u~}rzrrla^^ggj`^pbo}jrlkkzpq}vkvw᫞|lsy|||}w}yxkSZq|me(&&&'(((('&'()*+**))((()((())**))(((())))*++++++*)()))))))))))))))))(*Du||~rB,+**->Sbsuwyx|z|zy|z{zvuneh~wpxqlyjiquwz{tZE.))()(((()))))))))(((()))))))))'*+-..0/-,-///23320..4v}xngY^dcdkgth`r~qnHKczwpcmur|kȠy~}}v{}|zww|vI:++:Md:&%&%&''((('('(***++***)(((((())))(((()))))***+++*)())))))))))))))((((K~~z{mOLZlz~~}y|~}|}wvrutknwxxudwurnimuzz}pG;+*))((((((())))(((())(())))*()*,..--.---../0221.07uwqic^Y]aba[csdpc7X}wkjtzxqs䞬~~~{yy{~ww|l5*())'&(&&&&%'(()(('&&'((((())((((***)))))(((())))))))+++*))))))))))))))))(((7|~xxw~z~y{|~yt{{{vswyuoonjix||sckyox|ujswyzx{}yH-)())()(())))(((()))))))),**+-.--,-6-.-26864213PrurbVTWY^]UVlj{~ZXwrsxxitxr~{ww}xxzvrxr0&('((&&%%%&&&''(()))**+*****+***+*(((())))((()))))((()****))()))))()))))))((*Bq~}{uvsnx{twyytkjlu|rg~jeqzqvwziY:+,8DH+))))(((()))))))(8:--.;CVafjNHGoqvk\NMwp}~~wskb_[V\P[u{kgsmljzxsmsxqyv{~x{v{~y|ys|vxmfs|Z(((((('&&&&&&'&'(()++++****************+*))))))))))((()******(())))()))))))()*?|~~||{|wvpqxx|sizvx{{ysqoxzsst}{rtpqoiks~|}wxywnstT/)*)))((()))))*+G_\Qftxsrtut||vo|u}}{v{m`imb_Z^fikuk}vuv|v{ld|}{v~}}ywz}ys}{{{yugoP,'''(''&&&&&&''''(()**++***********+++,+))))))))))))((()******))))()()))))))()*F~|{y||zxrsxwxy{y}zy~|xtsihorsz|tp~~}vhmuvrqfilqhkklflxnrlsrsz{hPE+())(())))++*;pmqs|wyt}yu{{}x|{k`X_deW]hgz}yguzp{ypuwп{v~~wyvz|u{}}~~{p/&&&'('&&&&&&'''((((()*++************++**))))))))))))((()********))())))))))))),Iy~yyv{}|xvwsw~~w|znmtyv|{{|wv|vxgol\[hni^\_ig^d^hxwwqijrnsrw}z~~x[A*()(+-8F7++7ylrshb~v}{~z~udec]\OBmluv{|p}sz~tuphǶ}~|vwy|yx|m5&'%&''&%%&&&&'((((''()*+***+++++++++++*))))))))))))))()))*+*+++**))())))))))))*-Z~{{}~{~~~~yvz{qidah|xmhgdq{Ygbbn_QW_^]^enlykejknprx|{wux}|ysfN?NYkvzr[Ohzpsy~zwoy{~~oZgahdLfoqswvw^]|jrè|t{ҷڦz~~~y~q|}|x~|{{g,'&&&&&&&&&&&&'('''(''))*+*))**++++***++)))))))))))))))))+**+++,++*))))))))))))*+3u||yg_egz~y~~tcqxdlfcnp^mgaheqcuwdHQ^mmrv}ywpqstv}~vy~}{{~ywv~|stzlXcbd[\orlpigghmhkzm}pʕrzz}~{zxqy}~R&%%&&&%%%&&%&''('&'(''()**)(()**++++++++**)))))))))))))))***+++,,++)))))))))))*)1e}~}kwpnkq|}|xtxmhki~wvx|yrolwyg\\irasrtopxmjfhvxw}||}z~}uw}xoqv||_[abXMiqifgZb|sffc~s|t{紤ẫ~v|y|||oqmoywy3%&&&%&&&%&&%'((('&'(((()))(((*))))****++++*))))))))))))))))++++,,,++*))))))))++7R{{|zx~}||edkmt|ulkiiokwq{zulbRdqpkihouvvyrp~febo~w||zy}~|y~btsv~qo^]a[Mepknlgp{xqpgh|fzn̩Ŝu}~wxzx{y}pywuq{>&%&&&&&%%%&&%''''&&&''('(('((0WT183,1,+****)))))))))))))))))**+++,,++*)))(()),1[vtnqszwz|}|yvs~mm_dtymhgifgpp}|ahkmf``cm}c^ezzzyvwzz}zw||p{{~~b^a[E`shdkmkh{unrvs׭㪄~wmlzy|{rqrxt~xy{|{t}vE&&'&$&'%%$$&&%&&&&&&&%&('(*3O`f}s~vft]1*))))))))))))))))(((())++-.,********.D_nz}oeluyyz}|n}y~mb`Ywtechlovsz|~wwnZ}{`hg~qolyysvtptttr~x}}yv|{kYb]Mall]b`tlc^i{{nxyz镍xrsmmw}xyv{w{wznv|srssiA&%$%$$&&%%$%&&%&&'&%&&&')=Q[hy~m8))))))))))))))))(((())+++--,*++++3Ml{{w|yompx}z}}}~xedeb~u]brn_k|seurk}|v}z{vlrujqqlh]egrwssy~~rq|q_`XF]ki`^f^gzxk[chvxluoz{ory~~zxvns~uxz}{zwvk.%&%$$%%&%%%$%&&&&'('&&&%(Ax}}=)())))))))))))))(((())+++-..+,,0Jtyz|twqsz~{{u|qb^p}xnz|eZx}sls~yzbgzqofijfji`cUVgkchrsyxu}y~t}z^b^H\gbZ`wnedsl{pxywӼ唧{tvy~wyyyv{wv{yquxzpy~E$%&%$$%%%$$%%%&&&&'(('%%+O|x}ux}~:)())))))))))))))((()))*+*...-1Io}{xz|~{yuu{}ovs~|{}{w~zd{~{mupohvzdgkhgh]\YlWbd`Z_jllpgfvxuwkicYggXVmsi{yoDZ{˔ݛhxuv|~}{p~~QDz{ttvvytwyrx|zsy~_0$&&%%$%%$#$%%%&&&&&'(''@o~{|U))))))))))))))))((()*+)+,,-7Tozy}t|vutrv|}}~x}syuyxvw~{ltxxvpXi~{s\b^abnd^nj_\^YdUhh]Zkxuz|{vse}wd\geo~qawkr񤋌zqyzqxy7-uxtvxsv{|ww3%&%%%$$$%%$$%%%%%%&'((*J{|}{~{n+))))())))))))))(()0MFHQMF]x}|}vw{||yzt~spnszkoqq~xxyda~u{~}yo]XRXXekYWYk`\`bbdtw~tx{~ruSciftsevz|tܞpqyx\-Qt~{y|vy~y}}C'&&%#%$##&&%$%&&&%%())*U||v{{|G()))())))))))))((*d}~~}~xy}|y{y~|{rfri|uyfulpqty}{fsrvprspfVRWjrdhgqu}r~xmu|~bbnd]~kxhqqytwj{dlx~}G^}wzyy~~|}}q*%%&%$%$#$&&$$&%&&&&()*Lzzpz{6)))())))))))))))H|}{{z||}~}{yb]V__bc]vr~nlspS`X`_SAYdHhk~wh~u{zymjv~~rsqqlktskxj|zu}w|tqio}a}p{{{}s{{}F&&&&&&&&$$%&$$&%&&&&),I{}~~F*()))))))))))*)5{|~{}|z}{|~{y|tyhYaifgscqf|hlthM]eamYAdbtwyyt|v~{ltxzw~rr~yv{s]qxrqutivnpmWlu{}}|xn{x{R'%&&&&&&&$%&&$%&%&%''+Z~|}z{}~i.((()))))))))+5f|{z~xt}}zxy|zztnrwooirv|ywyrthhr[Twomw{s|xsv}pu|{|}ry|~|o^eszu{nabfwsyzy{||~}z~ux}~w|2&%&&&&&&&$$%&%&&&&%()*g~y{}|w|Z/))))))))))4kw}}y}|}}|yvy}po~{}~nrxqkoklxvmvt{sdYjn`e}ozjgk|jqgqz}mgmsi_gv|sz{{r{~~o_alwy{tb]byypu|vjfu{{||}~}|s}z1%&&%$%&&&%&&%$%&&&&(((k~zz{|xta8,)()()))*`y{{rtyxwzr{ytprgjfZcijn[^c_b_ohhot}kgjstfl~ssnnvoZpaqnxxssqrhdhq|~}|v|}{losquzyc_[zzswkw~wc[~}~}z{{|~~|}u-&&&$$%&&&&&&$#$&&&'*);z{zwx|~}w}z|srR3)*)())?}yx{x|~}s~~y{{u}sfjsh_YV[`b_V\\]dswgaa`ecjx~hcuidgx{xgv~vpyf]WW`kivv{zxnc~~t}mbdfwmqa_k{|}}uz}{xt~{ytxszw,&&&$$$&&&&$%$#%&&&')*\x{~v{zxyyxy}{~z|{vwws[7,(),h{~~}w{u~owty|~z{rrxkmer|yTX\acSTdehczgb_di~vflk{zp{vssre]mz}wytqsv|zsd~~gbjoya]a]\{v~xwsy|{w|{~{vrv~~~['&%&$$$&&&&$&%&&&(''(=vuyzxxwwzyz}|wz|~~|zxbEI[~}z}}}zsrprsvw|wpn|jgjndr~rtqf]_jqt{o|s|sjdkxwsmuz{y{~~ok{hlsp|YY\Xny}{xv|~~rv|~}v{}{}}i,&&%&&&%&&&''&&'%$)&'6m}uxz{wyyx|{}}ywx|}}z}}~z|}|{qy~wlorzwxvw|wz~xwxprw~pu}wfY\cejy||lE:?\~{|}z|ln}uuzxijXSZetztsyz}|u}{~xxty{~z]&&&&&&&&&&&''$'%&&(&*lz|}yyyx{y|{zvyy}~~~|{w{||{}v|}}oeyuzywysyuhxw|vwsuwᲑ|tkv{slecnjxyepo{pgkbc^Tdvzwtq~~{|{yyzy}~zP&&%%&&&&&&&''%&%'('(R}~xsruxyz{|~|z{}~~~|ogmpvyurstwvy|}|wwt|mnqΨԳzbly{`hhsymj{|smfijbWytyx{zzz|{}y|A&&&%&&&&&&&&&%%&(((6x~}|uvuz~{|zz{sqx~}sj^^eigmoov|yyyu|{p{}xxemt}Ģp|vxu~zzy^utyushgdbRts}~z|}wv{wyxt~sr~k'&&&%&&&&&&&&&&&'*+*i~}|sxwx~~}wwn|}so}~ulf]Zhkehqlovww~xyyxsuxztsrtxvv{m_j{uvȷæ~~d{z~}vnE{|umkcd]RUi~z}xr}y|xww||{~{N'&&&&&&&&&&&'('&(*1Tv~}{zyyy{st~||ouv}zwvdVYidjklx}wvqsottyxtgeggkmqm|txvim{~rl԰~qgmx|{n|qkj^SWq~xy~~}|ntwxw|}|~z|3%%&&&&&&&&&&''()*,]v}{xz~~{zwss~tyru|y}kdakvtpxylxwgmdgrmytrl}wvt{rpgoyn[_mmgyynn}|xxy~|mrg^nwu}w~{~x~|{wvww~zr~}|}i'%%&&&&&&&&&''')**+_|{yyxyy{z|}}yyxrsw{uZi[jwuqtqps}kuyfgig}|ig{}}wnypv}jw]bdnzhe|{rlhmx~{xtwy|z|u}stiitx}x|~{|}~|rwzvy}~~y{@'&&&&%%&%&&&'((**),I~~y~yxw{{}w|zz}uzwmrwmt~w{oc]c^oqrrs~}xy{ov~{cejigdpzuwnvcis[V^qxvsziyxsc__chhtbjjpx{ywzryvtkp|y~~y|~zsxwvuv~~{~}wW'%%&&&$$%#&&&&'))*+-`|z|yuyx~}|x~|ust{z}uuytsqxoowyov}~uql``g^cko{~yywvqktxpb]`^ccfqgkp}qerUU_}~hbso[r|rhYa\]elrum`gdY_csxvz~ntutwst|{~on}~u|yyw|~}}y|yxj3&%%%%&$%%$&&&&')(+-:uz{tzy{|xtpq~vnuxzrr~wnlnqop|upy||~ppeeja[mnow||{|yppx{oy{|ytg_`]mtihmp|rmpTZkyrqnueT}xkbfs{~snbl^^fo|o{stqz}wuv|~xytwyz}y^.'%%%%$'&&&&&&%&')*,,Yzyy~w}{{zvrrsrqvy{vozxwyvsskhrrs|xrz~yzoe_[\r|oossux{rwmnz{m}}sstosnqtel{yw{~zrSZn~]lv`Rrrxmiw|nleibh_q{u{z~vyt{r~yq}||y|y~}ykqx{{|g)&%%%$%$'&&&%&&%&')*+6qx~z~|yvwtrwnu|z{ssrsxzsqoqouzsz~smz}lha^ywpjjv{p}tojnjp}~zyxtuuw}hlaavnpss{u`Sk|ifWjmV}z|r|kpzuncexru~~{{~}}{~pky}~~z~x~}|}qqwrqtxz~x{~}}>&&&%%$%&&&&%%%&'(()*+Rz{yw{ywyxuwuwzxuvrsorutvvvszwhvdd`ao~noo}rupsuthz~xxyxvfg||dtczd`ozzsdjzye\botu|xh|ignjjpyw}{{|of`g{r{}yp{ztwwqoltw{||~P%%&&%%$%%%%%%%%&'(((*>yzw|wwzxxyvvxyuzvwwuqptxzxwqvzuoqtecfam{nzyw}`nmz|}s~ph`y|wo}pjjdknyusT\r|wmsruq|wcxixn}~zzymfx{|ron|{{rgffap}x}x~|zqqtrspux~~|z}u.&&&&&$$%%%#$%&&&&'(.Gm~ynv|zorzytry~|z|~xzvtsrxq~xuuvwrhidehhw{sy}o[_enzqoonvx}ytjk{zwwulob_oz|zz~xzocPWqqrq}zu{{jkziv||{vwz~v~tpqokmiixy~z}{xqigitxv{z}}{yy~M'&&%&%$$%$$$$%&&&&'8mwv|pynwy~{|}|wsr||rowt|~{z{unuxxnzzut{kdpyfee{|p~{wswulfd]aboe``dhvxwrodwmn{n\Zc`gv}wjs|wns}rc^R_ukvzztidptnutw|goosr~z|~}iempthZv}|{sqojjcf|uy~{}{yqmkmwz|xlzzy|p)&&&&&%$$$$$%#$$%%&(0pvyy}ypqsy{zt}u{uqsponmxz}}|tlhememwzzkx|s|rc]V_^\pl`bbaegxzrektjdkcqjUafguyi[^ngcci`V]ffon{uyq]}ovll{uolxqp}uvzzki^kqlnvyoi~swy~{pqsmmmheglzy|}v}q{{z{vssqpxvwvoy}h4&%%&%%%$$$$$%$$%%%&(/vxzxwssrrs~~|~ypoorqozspptoshkl_jz^ixwusrukuW`^ORSdx]]fptqzky~l[W\WYpjizy}|yUYZWTUQ`ZWU_V\pwjz~vvsoizirha~~pwynajwsmpqao|y~ipw}losplmuwyyyy~umt}{}}xkmxwww{|v~|~}O)%&%&&%%$$$$$$$$%%%%&&2uyxutrtvw~{tuwsjksun~uvutxkgdjsqmf{}}hqogbfTaqxzrlx}h|uhe`bmkzxvv|~tpSpj^TM]bSZfgfhdqvxnujwrk\bmWulgzpznicas~~v~pu}ygfipqzm~vvqv}zosvxursvuwvky{}}yy|.%&&%%%%$$$$$$$%%%&&&')a~~yrtzsqq~~}xnquljphsty}tst}rfhmkk~vquhebY`pofhvux{|wpicd{ds~{v]a{h\bx~jlcg_oqp~uz{|yrsxvn\zqUYtvyd^i}uzo|yfknxpv}{|s{qliny{vrx~u}|ymohv~xtstxyyh{~yzu)&&&&%$%$$$$$%#&&&((&'D}xx}vtwwsvxv{{}~qpporinhsy~umlcwzmodnqoss~sqpmxvmomc_qvvrfjiq|si||jaiakux`i{i]cw{~kkmi}vyug{wnnxsjhrYYio}jepoyqv|zum~mwwkm{|wyz~{lnp}~}~}y|xxwuw}{xstx}sy{|{1%&&%%%$$$$$$%$%%%&'))j{xwutyrtx{x{z{z~ysqunrrunnw~{syq}v{qemhwworjoxztkkjgyvlxgla`pkjxwjdf]eǫ~z{tryqeq}}t}||wywbb~s}wo~zyhdarta^hlpkpopsji|vgihx|~~~y|[{{pmf`}{~~z{}qwytsw~zwz{}{y|z:&&%$$%#$%$$$$&%%%%%&E|qt~~wtvvtzyutz}~{|{zyppqmuvsoyw}nbwdvoxrygisylfbbbpgq{mxg{htuukdcVhz|xuaw|mlmooeiyzuzmvyu{vs}h^WX]{~d~tw}klseZj^akx{uvci{z|kdc\~{||}{ty{|dlzz}~ru~~{|y`-%&#%%#$$%$$$%&''&'0Uztmz}u{vuwvsuvy}~~xx}so|qrrkpuww~knxtggvtvvpynrjgkcl}j}omtl[W_ixzu|oogz~smla\|pxwo]a_ggiu}teiopt{qaYoh_frqzw}ty}irytngel{w{wty~{sy|zxw{}~{yvC($%#%%$$$%%%%&&'((0lz||y~|{zzwwvxqtuy{|{}x~{vu|vttq}qurzynfty|lv~qovv}}qgeu|geq}lxpn[Rfyy{yyv}jh|zjwof]Szoieruyznton~yw|tn[it]^bwvxzy}iz}||||zmhkq~y~{y{rzz~~xw{~}}y~vo+'%#%'&$$$%%%%%%&')Zzzuwpx~}~wyxtv{utwy}{~|y|}t|pwwom}|yqixzszoqxyudtqgYbph_zuir|u|n\s|tsdbQc~lfbjv{{wpvxoefg}urynlt_jl]Zgttvw~~yh{spwz}}|xww~xu{~{xvxx}~sl.&&$%'%###$%%%%$&%<{y~~}{xyoz|}{yvvx{vxw{|tt|y}}xsw|{qupplfr~|}vo|kbdunZbu{rjo{seybkyo~fXXu}xviRiswobohl`m\bdft}b[Zbvmvyx}x`heme^miz|{}~y}V|vuwy~~}|l}{}||||}|qy}~yyzv{~{uJ%''$%&%%%%$%%$%%0q~vwv~}z|x~zywzzzy{}|~~}ysyz}|||snjen{}|}|~ja`fjoy}}lYebslfrr~wbkq~sywjWal}qnv}x^tv}|lfugaxszmyi[gtmcg~_j\elnmtz{wjyswevsa\|wxoxz{unx|}w{z~xtswz}x|}|~zt|{h)%&&&&&%&%#%$#%&Mw|~{{{yzz}{y~}~~}vrw}}mlkcxo«}zdi^ahk|ru~~fV\kj}hkkr|uitvojszdlkYflz}rrxyn]X`vz_\dwrn]``dmgp}pactsspvupiiXbqr~~t|{~rpnu{}~uuoiy~}|tiy|~}~~y{xkvxu,%&&&&&%&&$%$%'-o~{{zzzw{~~~|}{|{~~~{|~|y{zpnrnkips}jag`btuttzzhW^kkpnanzvu}wgZXjt`cj^i|u|{jh_[ablwvaYl{w\X`Z^hmqt{ypnmmxv{}eajwv{}v~z~z{nqtv{y||llaZg~pttzxzyt|wxg&&&%&&&&&&&&&%'\|}{w|muz|sx~~|~|}~}~y|~|v|tiqxkmpnjgysƕ|ͼ}y|cgjdd~~taRwmpudyn`_qx~vt|h\XUgsm[XYcv}vdccgxr^XY]X[dW`xge]kpxsYX_cnktppvyhxxrpsufassyzvt}|{v}yxv~zcQ`xy}|w~~zxvtw|~?%%&%&&&&&&&%&%Mzz~{}r}vv{}~||}}z{vrmikqoskeolb}qϢzqkhbbibwlWfu}f`lpodqwvyss]ahkpxfYYT`~u{lbj{xmXaYe]Y\_hywnx]tfx{karv^jm{{s}rqhhovtwwyrjx}|xxv|m]JUo}w~{{j}rtz|t{~w'&%%%%%&&&$%&'4vzz~v|v~|~z|}}}puqkjoptitdj~qquxcfjz~amsqjY]^nwkr}zyqiehrbevle`fo{|sup~tcedtjcofb_ij{hnksoi\`n_ur]_aajqquur{tpw|}vc|wmr~wx}z{y|s~ymM\_j~pmzz~z{{e&&%$%%%&&&(-6'%&%$$$%%$&%*g~{yyy|xwx}||{~{}|yrvyzvzwvx|v~n|shegojmi{zy}uzwozjmgcvw~cenvi[gs~yrpsxyl\k|zsnryxbdzqt^sy|wz`gce{mbjpl{|}dqstu~tsuutcTXicpnidkY~}o{tk|lkjerw~z~zwmy{zwnz}u}tdPMU[Yk}u|~}~@$&&%$$$%$%&',kxx~t|wz|z|u}~zyx{wvxxzwysbh_hfryrz{zulojobcctvѳiivl]kx{np|ƙl]{swuiu{~kivpahrvxh]b\bwxz{x|pdfmnk{u|auwr}zv|n`sij}rwgs~lqclknxmev}z}~uxx~t{zxzuyvyvdYX[Xfik|}|~~}}n)&&%$$$%&'((>}x~}}v|z{wyx|zy{}y{|vuo}yldcdu}smfe{zoexhmpznxpv|~}Ʊyviuvymymjupj[hovwywgdf_ae~~kW\ep}zjtsipfz{}~~tt_ghcyuӵvmlz|ytq}|z|}yz|zrxvxwuquxtmZ\qcjtx}x~|d'%%%$$$%&'('Rw||~z{rv~{ux{}}y{zyy{{|tkktvvpmkgdv~gg`fre^m~ojjÆx~yØltxzw{twwxhfj}sszs}ncmenpktxffo`]xrsĤ{zfh^Y`moz|lys|~uhdlsrreqeZk΢txtyx{{z}}q}sy{w{oikn}zwy}sq|}y|S&%&$#$$%&&&(35>Kr|zxssz~~ysz~y}yz}{oxxntvsyx|zw}ilc`dm{wuou~umtwtfylԲ}|svv~sbdyy~k@ltimtws|`c\aeogdYZrcthru~{okkxuwyj~uymjfhaqzy`\ecex|{syrh`jl_VZYZagrlkv~|||urYyp~}~{{uyrmqmbc`VD;8Wtyz{~}}{yvwv|}}z}{z|ttxvlwwweab[r}vtkxoot}zsl|ݖ~rmjtn|}dsy~}uskmmȬvvnZZhnikaZVgpjqvpwpjlslh|||ztpr|~wsqjlzw}p_bf]izxlkzy{yb\^kwbV\Y_hjuuXm~y}vw||}}wwal~h}lrsu\ZWJIMGajpxuz}|}~~zwz||y|{|wz{yzz}wlorz}f`\^opmqn|{urv{|w|񳍆wxhgevmesw{spmw|{gTYYufg_bmyxautwzyjjdev{}|tx}{yrwvml{ub_`dhr|qnjaim~sg[[mzwf_][bxv|^e}kwsx~y{bdcj||m~pnsvk^[bk_]\a`gddoyumu}z{|~v|}z~~{{{}zw~}tuyca^nqpkxv~z~zz垆xwml㴣exweknzwthr{rvf]UU]in{n~{~zofrrr~~g]eyv}}vzyzonfflprkt}syjbadnzx{sy~wzlbd`iubd`_Z]|sc~}uvy|l\}~}xxi~qyodiihhleml`fabcrqrqvwwyxy}z|}y|~tu|q{}u}|pqpk`\^xlnj}wzx|nry|{terwərsjōsimryy}xkikd_hledi|y~vnmu~xrff|ztwqaee\ohgXJJcia`^uh|lgurtumeys`Xa`_^jcsjiefkflty|yUquatyzulojqnvgniksu|{vqwurwz}y|~|}}z{wwzkryy~~~~zwwgposjebxkxyxz|kz}|zotϠ}~yy̸fsxicywlkfgjnsvrgvrxo[grs|~gnwxpoN8:BNXUTFMuf_`_gpzvj\ngv}sktzzidtog_fk\dj|pquys~p{|pa}~z{jizyzt}~z|rkojehfgmts}|yxxvrvsxsxyyz}|woryrkqu}x{}}||qwqxnbfuy|tzjnokm~{krrmqǷ|pmnƤ{w~r`hsjlkbeg_fcl{wtq[fcxxl|wrx|ngegXULJMWatswstfkr}{tdforss~oi}whefkggaoe[fvslsvsz|sn~qEV`y|{|xWvxxkyz~~x~mpebjljpppvrw|wutzrqlnz{}z~|xvqttkntz}y}|y~~okv`mzxvspw~qqwxkq}yڴ|qfbt|y||`d_ootfho}{~dl_^liwyk}}{xld\XLRWUSafly~qi\cttl|whr{|ʙtqy~nshagdux]`h_^eox{|yzzt|}{z}z||yf^jw|||~x{velexpowrvvuzw|yv|pnsvv{uzvspqslcjp~|xz|rsz|jme}ysnurqxxyvn{|yoh|ڗxrjbuhqʉ{u`]jdqmpq~|}p\|f}jkt~l~|p}nb[OPW^hsllrq~yw{~zjbkahn{zhk|Ůwurmaflkmn]dux{nlr~~|~{z}zz|y|z~sqgmhvqnzzyvruz}zx{|zypsqsosonwongjqx}}|}z{zq}yqfry{x|}xsurqyp|~ƃ}xltx}{l׏zgWVakgoqfeoeszyyfaqn{}wr{hUTTafmckvu{}||zwu~}o~ثr~wcokibwinx~yzx{f`pz|}zw~~|y|vzrpobmvtxruxvy{{|}xz{vwvttz}x~{ssqv|~}{no~uyr||xwmm}|}yu|Σz~tdVc{zfpkW^ifľyxpjch~~wl^lzmjkef|w~|u}zܧytzyxv{z\ejie_Zco~|qc[j^]u{}yy~u}y}|yxwwlgjywuv~r~syz{|}~xzywwuzz~~w||~~|}ur{ut}{~wsmtȸ}|z~sptؽyr]_odbW]uup|ixtǏ}mea^iu}w~zuq~kbdqcqr}xut{ٱ~z~mt껸uv}h{veSaedo_`gs{}}vZZZiW_vv}|n~~}|ux}tuw{xoomzwo~{uu{{{}}|y}v{svx}~zxvv{}usjuy{vtu~yy|vo{{|wz~jei}vuor{rsj^\wqlfYwxstqz|}~ffdabpy~yznlibffk~~~~|tzp~|xqcxlWUfinqaYfwuw~u]Xfeh_ik~yuyzpopvsy}x}~|z{{xvxryotr{uy|uoz|vy}|}{vyvruz|{xrvrvutz~n|uvbhqrsx~tyuq~r|}{jn˝rgfgjgqek{DZohnii}xzrjyponop{z{uq|zicb`x|uw||{pzwsiu}ݹsj_wmYYeosgVZaz|`Rfhznkfcuwqy|tnpvwyrww|}}{u~|xurt|uzz~xt|uz{tyt}zo}}zlxr~msnvx|ruwm~vszxz~n~~{{rjj~jf_Y^`ozz~qƚyhozzu}koef}pxlgsn{{lpv~i_lz|ưq_smeWRblc^efevxxROhuxslso}u{~oxlsx|rvy}|}z}z{xyvz{z}kvtr~}szooo~u~~zuxiuvx{p~utzy{prm}omuplz}p}||zx~|}uhorj|{fgwwoغ~zɢȲyjqx|z{ilwdspyu`wz}yqispst`W]lw~y˯ybp`^^^gqstpqomzuse|yyhY^koi}w}snyzox{xtx~z~z|~~|}|{yvz~tod|y{kvsuto{|w|}y{}}o~}yuu|xzxz~}ilsxnis~ig~mfhtr{z}}gllnujwíŽƠ}ps}pdp|xwy{yzqurh_QVc]jslabrkqztr̫}ujyoal\_dgqz}yzztyy{~w}muhfs}zyyunxqqy{{~~~~zz~y~}~z~{rpouvolvttwzy}zysxzqm~v~{y~wv}xw~xlssorp~mzqdbgdv{zlken}»̥Ӷq\ijre]\ou}ovxz{qy|nmibU`hZ^wzd[h]o}t泟wyypfv~wjmtcqorwww|yscn]k][rmpt{|umow~z|x{~{}|~{~wtu}|}}z{u}~_vwu~z{vpjhxqqx{pz|tzukqplnpvk}}l_bz}qjlħ嶚Хgk~kcika[a^bnqusu{|{xh\_`bipYismnxjw~涖}eohdv|htfpuoxseg{|{gmjou`~yXfVnwomw~}w}||x}}zy}w}|vst~|~||}|~yvheq|t~wxv{y|z{|sq{vigsq}mmis}z||~uko|xıȧŇrl{wtbb^bjz{vqifonzpq`Yartrx}peu|ƨ}~|u`\hqvrsmlnkt~zxfhhir`d}fYws{}}ky{|w{~|}~spvz{}~}}zi^dku~}sv|}}v|yw}{ntvtdl|x}sbmnr}go{~yrklw{qnҾȡĝuytmӕobcmqwn^`rxwuqrmYknqzqzwxμ}x}fVgmhfosd}psttnncifme~{yzyohex~|x|~y{yz~zx{~|~vp|~|s_Qju|}y~t|~|uhjl~}}inywunlyxe]ij⮤s΋tc`bu{b`bruyvxmfV`e{}uwʻqx~|mb[p_XagtoqirtgOe{zsr{|o]kom~}{|z}wv{~{w|~|}}{z{~xm\ao{z~zy{|~mnfpjwfrϗz{slo{~qoqȿëȻޜuptwέ|vblws^Ygotpldj}ƾ×z~~şȒs{~{i[emchZaksmppoq{iyKKr~jfvvmaZfmkw{|xt}~{xz~}z{}~|eh{ty{yt{z|}}{ychm|{}tigl}y}yxy~{dljdno~l㺝r㦞i~ru«sns{e]WmyzynhkyØw{ss|yp|mrWj]arYTbrkqspsscaguuqyyyj[RRcmqx}y|xzy{w|}m~~{z|x|p}ygTwyw}yt{{zqhrtv~ylyrtx|~utx}|vkihjn^`Wi֧l{ͮ}e}Óxxegnss~qxrcaizxwxk{{{}n^Zh]a`qadv~w]gm}PTȺodROZljsy~x|u}{uyyn~z|x~|x|~m~~|[Olyw{{ww~z|zlarythu{vzv{jju}ur{{gkc]sr|tڴqvuot}tapnhzsynupoѶȽշȰs|}uxjYdhV^p{vhqx~qs@UR\Ȗ|zqzcOOTgggrvw{toysuw|p}}ysr}vsyiL^yrtt{~{v|ilwq|{xut|x{yetm|}lkvqx|~m~{v`fxv~jilXmș|rnz|}wqw{ȫѱհy{~~vzhu~\badnppvvn}~x|}vdicǹukol|zi|jQRYUfacgsrwfreefem++-3.61-1/examples++-load/load.link.in000755 000767 000024 00000022731 13256636774 020717 0ustar00hechtstaff000000 000000 #!/bin/sh # Create a loadable object from a C++ function defined in a .cpp file # $Id$ thecommand="$0" dircommand=`dirname "$0"` FFVERSION='@VERSION@' FFCXXFLAGS='@CXXFLAGS@ @CPPFLAGS@' FFFFLAGS='@FFLAGS@' FFFLIBS='@FLIBS@' FFCXX11FLAGS='@CXX11FLAGS@' INCFF= if [ "@ENABLE_FFCS@" != "yes" ] ;then ffcs=0; else ffcs=1;fi if [ -z "$CXX" ] ; then CXX='@CXX@' ; fi if [ -z "$MPICXX" ] ; then MPICXX="@MPICXX@" ; fi if [ -z "$MPI_LIB" ] ; then MPI_LIB="@MPI_LIB@" ; fi if [ -z "$F77" ] ; then F77="@F77@" ; fi if [ "$CXX" = '@'CXX'@' ] ; then CXX=""; fi if [ "$MPICXX" = '@'MPICXX'@' ] ; then MPICXX=""; fi if [ "$F77" = '@'F77'@' ] ; then F77=""; fi if [ "$FFCXXFLAGS" = '@'CXXFLAGS'@' ] ; then FFCXXFLAGS=""; fi if [ "$FFFFLAGS" = '@'FFLAGS'@' ] ; then FFFFLAGS=""; fi if [ "$FFFLIBS" = '@'FLIBS'@' ] ; then FFFLIBS=""; fi if [ "$FFVERSION" = '@'VERSION'@' ] ; then FFVERSION=""; fi if [ -z "$INCFF" ] ; then if [ -f "@INCFF@/ff++.hpp" ] ; then INCFF="-I@INCFF@" elif [ -f "${dircommand}/include/ff++.hpp" ]; then INCFF="-I${dircommand}/include" elif [ -f ../examples++-load/include/ff++.hpp ]; then INCFF="-I../examples++-load/include" elif [ -f "FFAPPLI_INC/ff++.hpp" ] ; then INCFF="-IFFAPPLI_INC" elif [ -f '@ff_prefix_dir@/include/ff++.hpp' ] ; then INCFF='-I@ff_prefix_dir@/include' else ff=`which freefem++.exe`; ffinc=`dirname "$ff"`/examples++-load/include if [ -f "$ffinc/ff++.hpp" ]; then INCFF=-I"'$ffinc'"; else echo " erreur PB include freefem++ directory " ; exit 1; fi fi fi do="yes" DEBUG="" CONLY="false" uu=`uname -s` INC="" LIBS="" DLL="" bin="." out="" files="" fileso="" OTHER=""; WIN32=""; case "$uu" in CYGWIN*|MINGW*) if [ -z "@WIN32DLLTARGET@" ] ; then onwin32=1; uu="cygwin-version"; else onwin32=1; uu="win32"; # pure windows fi WIN32="win32-" wff=`which FreeFem++.exe` dff=`dirname "$wff"` if [ "$bin" = "." -a -f ../src/bin-win32/libff.dll ]; then bin=../src/bin-win32 elif [ -f "$dff/libff.dll" ]; then # modif for install on cygwin bin="$dff" elif [ "$bin" = "." -a -f ../libff.dll ]; then bin=.. elif [ "$bin" = "." -a -f ../../libff.dll ]; then bin=../.. fi;; esac autodep="" withmpi="" args="" while [ $# -ne 0 ] ; do argsp=$args args="$args '$1'" case "$1" in -[h?]*) echo usage $0 "[-n] [-g] [-win32] [-l libfile] [-I includedir] files" echo " -auto : build automaticaly the dependance (in test FH) " echo " -n : do nothing just print" echo " -g : compile with -g option add remove optimisation" echo " -c : compile only" echo " -mpi: with mpi" echo " -nompi: without $MPI_LIB links " echo " -O* : compile with -O* option" echo " -cygwin: compile for cygwin/win32 OS (Window XP, ...)" echo " -win32: compile for win32 OS (Window XP, ...) default under cygwin" echo " -l files add files to the ld process (link)" echo " -I dir add dir in include seach dir for compilation" echo " -b dir to change the default install dir " echo " -dll file add dll and this file copie in the install dir" echo " -o outputfile without suffix" echo " file.{cpp,cp,cxx,c,f,F}" exit 0; ;; F77=*) F77=`echo $1|sed 's/[A-Z0-9]*=//'` ;; CXX=*) CXX=`echo $1|sed 's/[A-Z0-9]*=//'` ;; MPICXX=*) MPICXX=`echo $1|sed 's/[A-Z0-9]*=//'`;withmpi=yes ;; F77=*) F77=`echo $1|sed 's/[A-Z0-9]*=//'` ;; CXXFLAGS=*) CXXFLAGS=`echo $1|sed 's/[A-Z0-9]*=//'` ;; FFLAGS=*) FFLAGS=`echo $1|sed 's/[A-Z0-9]*=//'` ;; MPI_LIB=*) MPI_LIB=`echo $1|sed 's/[A-Z0-9]*=//'` ;; -std=*) CXXFLAGS="$1 $CXXFLAGS" ;; -auto) autodep=yes;args=$argsp;; -mpi) withmpi=yes;; -nompi) MPI_LIB='';withmpi='';; -n) do="no";; -g) DEBUG="$DEBUG $1"; FFCXXFLAGS=`echo $FFCXXFLAGS| sed -e 's/-O[0-9]*//g' -e 's/-DNDEBUG//g' ` ;; -c) CONLY=yes;; -O*) DEBUG="$DEBUG $1";; -cygwin) onwin32=1; uu="cygwin-version";; -win32) onwin32=1; uu="win32";; -b) bin=$2 ; shift;; -I*) INC="$INC '$1'";; -D*) INC="$INC '$1'";; -dll) DLL="$DLL '$2'";shift;; -[Ll]*) LIBS="$LIBS '$1'" ;; # FFCS - 27/10/11 - need quotes for MPICH libraries in 'Program Files' under Windows *.a) LIBS="$LIBS $1" ;; *.so) LIBS="$LIBS $1" ;; *.dll) if [ -f "$1" ] ; then LIBS="$LIBS '$1'" elif [ -f "$bin/$1" ] ; then LIBS="$LIBS '$bin/$1'" else echo " erreur file not found $1" ; exit 1; fi;; -Wl*) LIBS="$LIBS $1" ;; *.cpp) files="$files '$1'"; o=`basename "$1" .cpp` ; fileso="$fileso '$o.o'"; args=$argsp;; *.cp) files="$files '$1'"; o=`basename "$1" .cp` ; fileso="$fileso '$o.o'"; args=$argsp;; *.cxx) files="$files '$1'"; o=`basename "$1" .cxx` ; fileso="$fileso '$o.o'"; args=$argsp;; *.c) files="$files '$1'"; o=`basename "$1" .c` ; fileso="$fileso '$o.o'"; args=$argsp;; *.f) ffiles="$ffiles '$1'"; o=`basename "$1" .f` ; fileso="$fileso '$o.o'";; *.F) ffiles="$ffiles '$1'"; o=`basename "$1" .F` ; fileso="$fileso '$o.o'";; *.o) fileso="$fileso '$1'"; o=`basename "$1" .o` ;; -o) out="$2"; shift;; *) OTHER="$OTHER $1";; esac shift done # remove old file... FH sep 2013.. SUF=@DYLIB_SUFFIX@ if [ -n "$autodep" ] ; then # echo "$thecommand" $args `eval "'$dircommand/ff-get-dep'" -ff $files` argsdep=`eval "'$dircommand/ff-get-dep'" -ff $files` error=`echo "$argsdep"| grep ERROR` if [ -n "$error" ] ; then echo " WARNING in auto dependance seach ( missing plugin $2) . sorry : $error " # FFCS - 28/11/11 - we need to stop compiling as soon as there is an error because we want a fixed set of features in # FFCS # return a error when FFCS enable .. FH. echo " -- $error " >>Missing-plugins-@DYLIB_SUFFIX@.log exit $ffcs; fi echo eval "$thecommand" $args $argsdep eval "$thecommand" $args $argsdep # FFCS needs an error exit code to make sure that all libraries are correctly compiled exit $?; fi if [ -n "$onwin32" -a ! -f "$bin/libff.dll" ] ; then echo " Error the file libff.dll must be exist in '$bin' the install directory," echo " to link on windows OS " echo " Use the parameter -b to set the correct install directory " exit 1; fi if [ -z "$out" ] ; then out=$o ; fi; if [ -f "$out.$SUF" ] ; then rm $out.$SUF ; fi # Default compiler if [ -z "$CXX" ];then CXX=g++ ; fi if [ -n "$withmpi" ]; then CXX=$MPICXX;fi test "$withmpi" = "yes" && WMPI_LIB="$MPI_LIB" # build a mpi version of the plugin if the plugin do exist un mpi dir # and if the mpi version exist and if OWMPI="" test -d ../examples++-mpi -a -n "$MPI_LIB" -a "$withmpi" != "yes" -a ! -f "../examples++-mpi/$out.cpp" && OWMPI="../examples++-mpi/$out.$SUF" test -f "$OWMPI" -a -n "$OWMPI" && rm "$OWMPI" INC="$INCFF $INC" SHARED="-shared" case "$WIN32$uu" in Darwin*) # echo "export MACOSX_DEPLOYMENT_TARGET=10.3" # export MACOSX_DEPLOYMENT_TARGET=10.4 # SUF=dylib SHARED="-bundle -undefined dynamic_lookup" ;; win32-CYGWIN*|win32-win32) echo " Window without cygwin " WMPI_LIB='' b="$bin" LIBS=" '$b/libff.dll' $LIBS $DLL" # FFCS - 17/10/12 - --unresolved-symbols=ignore-all is not understood by the current mingw64 compilers SHARED="-shared -Wl,--enable-auto-import" # FFCS - 17/10/12 - -mno-cygwin is not understood by the current mingw64 compilers ###FLAGS=' -mno-cygwin ' # SUF=dll ;; win32-cygwin-version) echo " cygwin-version " WMPI_LIB='' b=$bin FLAGS=' ' LIBS="'$b/libff.dll' $LIBS $DLL" # SUF=dll ;; FreeBSD|NetBSD) SHARED="-shared" FLAGS='-fPIC';; # 64 bit Linux needs -fPIC (ALH) SunOS) SHARED="-shared" FLAGS='-fPIC';; # 64 bit Linux needs -fPIC (ALH) Linux) FLAGS='-fPIC' SHARED="-shared " ;; *) echo "sorry unknown achitecture "`uname` exit 1;; esac #FLAGS="$FLAGS $DEBUG $FFCXXFLAGS" # change F. H Version 3.17 FLAGS="$FLAGS $DEBUG" if [ -n "$ffiles$files$fileso" ] ; then if [ -n "$WIN32" -a ! -f "$bin/libff.dll" ]; then echo " Sorry, no freefem .dll file (libff.dll) in $bin dir " echo " try with -b dir-path where the file libff.dll exist" exit 1; fi if [ "$files" ] ;then echo $CXX -c $FLAGS $CXXFLAGS $FFCXXFLAGS $INC $PIC $files if [ $do = yes ] ; then eval $CXX -c $INC $FLAGS $CXXFLAGS $FFCXXFLAGS $PIC $files ret=$?; if [ $ret -ne 0 ] ; then exit $ret ;fi fi echo fi if [ "$ffiles" ] ;then echo $F77 -c $FLAGS $FFLAGS $FFFFLAGS $INC $PIC $ffiles LIBS="$FFFLIBS $LIBS" if [ $do = yes ] ; then eval $F77 -c $INC $FFLAGS $FLAGS $FFFFLAGS $PIC $ffiles ret=$?; if [ $ret -ne 0 ] ; then exit $ret ;fi fi echo fi if [ "$CONLY" != yes ]; then echo $CXX $SHARED $FLAGS $CXXFLAGS $FFCXXFLAGS $fileso -o $out.$SUF $LIBS $DLL $OTHER $WMPI_LIB if [ $do = yes ] ; then eval $CXX $SHARED $FLAGS $CXXFLAGS $FFCXXFLAGS $fileso -o $out.$SUF $LIBS $DLL $OTHER $WMPI_LIB ret=$?; if [ $ret -ne 0 ] ; then exit $ret ;fi fi echo if [ "$bin" != "." ]; then echo cp $out.$SUF $bin test $do = yes && cp $out.$SUF "$bin" fi if [ -n "$DLL" ] ; then echo cp $DLL $bin test $do = yes && cp $DLL "$bin" fi if [ -n "$OWMPI" ] ; then echo $CXX $SHARED $FLAGS $CXXFLAGS $FFCXXFLAGS $fileso -o $OWMPI $LIBS $DLL $OTHER $MPI_LIB if [ $do = yes ] ; then eval $CXX $SHARED $FLAGS $CXXFLAGS $FFCXXFLAGS $fileso -o $OWMPI $LIBS $DLL $OTHER $MPI_LIB ret=$?; if [ $ret -ne 0 ] ; then exit $ret ;fi fi echo fi fi fi freefem++-3.61-1/examples++-load/Element_P3.hpp000644 000767 000024 00000003751 13312446271 021136 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... const int TypeOfFE_P3Lagrange::nn[10][3] = { {0, 0, 0}, {1, 1, 1}, {2, 2, 2}, {1, 1, 2}, {1, 2, 2}, {0, 2, 2}, {0, 0, 2}, {0, 0, 1}, {0, 1, 1}, {0, 1, 2}} ; const int TypeOfFE_P3Lagrange::aa[10][3] = { {0, 1, 2}, {0, 1, 2}, {0, 1, 2}, {0, 1, 0}, {0, 0, 1}, {0, 0, 1}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {0, 0, 0}} ; const int TypeOfFE_P3Lagrange::ff[10] = {6, 6, 6, 2, 2, 2, 2, 2, 2, 1}; const int TypeOfFE_P3Lagrange::il[10] = {3, 0, 0, 0, 0, 1, 2, 2, 1, 1}; const int TypeOfFE_P3Lagrange::jl[10] = {0, 3, 0, 2, 1, 0, 0, 1, 2, 1}; const int TypeOfFE_P3Lagrange::kl[10] = {0, 0, 3, 1, 2, 2, 1, 0, 0, 1}; freefem++-3.61-1/examples++-load/pcm2rnm.cpp000644 000767 000024 00000007142 13312446271 020552 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Tools to read ppm file // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: pcm.cpp // *INDENT-ON* // /* use in freefem++ edp * see : * real[int,int] ff1("tt.pmm"); // read image and set to an array. * real[int] ff(ff1.nx*ff1.ny); * ff=ff1; */ // tools to read ppm file /* use in freefem++ edp file: * ----------------------------- * complex[int,int] cc(1,1); * readpcm("tt.pcm",cc); // read the flow image and set to un complex matrix array. * or * real[int,int] u(1,1),v(1,1); * readpcm("tt.pcm",u,v); // read the flow image and set to 2 real matrix array. */ #include "pcm.hpp" #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" using namespace std; #include "RNM.hpp" #include long read1 (const long &, const long &) { return 1; } KNM*read_pcm (string *filename, KNM *p) { PCM pcm(filename->c_str()); p->resize(pcm.width, pcm.height); pcm_complex *pc = pcm.image; for (int j = 0; j < pcm.height; ++j) { for (int i = 0; i < pcm.width; ++i, pc++) { (*p)(i, j) = Complex(pc->r, pc->i); } } return p; } long read_pcm (string *const &filename, KNM *const &u, KNM *const &v) { PCM pcm(filename->c_str()); cout << " pcm " << filename->c_str() << " : " << pcm.width << " x " << pcm.height << endl; u->resize(pcm.width, pcm.height); v->resize(pcm.width, pcm.height); pcm_complex *pc; float x1 = -1e+30, x2 = -1e+30; for (int j = 0; j < pcm.height; ++j) { for (int i = 0; i < pcm.width; ++i) { pc = pcm.Get(i, j); if (pc) { (*u)(i, j) = pc->r; (*v)(i, j) = pc->i; x1 = max(x1, pc->r); x2 = max(x2, pc->i); if (i < 0 && j < 0) { cout << i << " " << j << " " << pc->r << " " << pc->i << endl; } } } } cout << " max uv : " << x1 << " " << x2 << endl; return pcm.width * pcm.height; } /* class Init { public: * Init(); * }; * * $1 */ static void Load_Init () { cout << " load: init pcm2rmn " << endl; Global.Add("readpcm", "(", new OneOperator2 *, string *, KNM *>(&read_pcm), new OneOperator3_ *, KNM *>(&read_pcm) ); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/VTK_writer.cpp000644 000767 000024 00000024414 13312446271 021235 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Cedric Ody // E-MAIL : cedric.listes@gmail.com // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // from the work of Sala Lorenzo (Dxwriter) #include "mode_open.hpp" #include #include #include #include using namespace std; #include "ff++.hpp" using namespace Fem2D; class VtkWriter { struct tsinfo { int imesh; //!< index of the mesh std::string name; std::vector vecistant; }; private: std::vector _vecmesh; // std::vector _vecofts; std::string _nameoffile; /*! This string contains the name of data file with \\ where there's a \ in the path*/ std::string _nameofdatafile; //! files containing the data and the timeseries std::ofstream _ofdata; public: VtkWriter () {std::cout << "Constructor of VtkWriter" << endl;} void openfiles (const std::string &s) { _nameoffile = s; std::string tmp = s + ".vtu"; std::cout << tmp << " "; _ofdata.open(tmp.c_str(), std::ios_base::out); _nameofdatafile = ""; for (int i = 0; i < tmp.length(); ++i) { if (tmp.at(i) == '\\') { _nameofdatafile.append(1, '\\'); } _nameofdatafile.append(1, tmp.at(i)); } } void addmesh (const Fem2D::Mesh *mesh) { const Fem2D::Mesh &Th(*mesh); _vecmesh.push_back(mesh); _ofdata.flags(std::ios_base::scientific); _ofdata.precision(15); _ofdata << "" << std::endl; _ofdata << ""; _ofdata << std::endl; _ofdata << ""; _ofdata << std::endl; _ofdata << ""; _ofdata << std::endl; _ofdata << "" << std::endl; _ofdata << ""; _ofdata << std::endl; for (int k = 0; k < Th.nv; ++k) {_ofdata << Th(k).x << " " << Th(k).y << " " << 0.0 << std::endl;} _ofdata << "" << std::endl; _ofdata << "" << std::endl; _ofdata << "" << std::endl; _ofdata << ""; _ofdata << std::endl; for (int i = 0; i < Th.nt; ++i) { for (int j = 0; j < 3; j++) {_ofdata << Th(i, j) << " ";}} _ofdata << std::endl; _ofdata << "" << std::endl; _ofdata << ""; _ofdata << std::endl; for (int i = 0; i < Th.nt; ++i) {_ofdata << 3 + 3 * (i) << " ";} _ofdata << std::endl; _ofdata << "" << std::endl; _ofdata << ""; _ofdata << std::endl; for (int i = 0; i < Th.nt; ++i) {_ofdata << 5 << " ";} _ofdata << std::endl; _ofdata << "" << std::endl; _ofdata << "" << std::endl; _ofdata << "" << endl; } double checkprecision (double val) { double tmp; if (val >= 0.) tmp = max(0., val); else tmp = min(0., val); return tmp; } /*!Add a field*/ void addscalar (const string &nameoffield, const Fem2D::Mesh *mesh, const KN &val) { _ofdata.flags(std::ios_base::scientific); _ofdata.precision(15); _ofdata << ""; _ofdata << std::endl; for (int i = 0; i < val.size(); ++i) {_ofdata << checkprecision(val[i]) << std::endl;} _ofdata << "" << std::endl; _ofdata.flush(); } /*!Add a field*/ void addvector (const string &nameoffield, const Fem2D::Mesh *mesh, const KN &val, const KN &val2) { _ofdata.flags(std::ios_base::scientific); _ofdata.precision(15); _ofdata << ""; _ofdata << std::endl; for (int i = 0; i < val.size(); ++i) {_ofdata << checkprecision(val[i]) << " " << checkprecision(val2[i]) << " " << 0.0 << std::endl;} _ofdata << "" << std::endl; _ofdata.flush(); } /*!Get the mesh associated with the series nameofts*/ const Fem2D::Mesh*getmeshts (const string &nameofts) { return _vecmesh[0]; } void init () { new(this) VtkWriter(); } void destroy () { if (_ofdata.is_open()) { _ofdata << "" << endl; _ofdata << "" << endl; _ofdata << "" << endl; _ofdata << "" << endl; _ofdata << "" << endl; _ofdata << "" << endl; _ofdata.close(); } } }; // End of class class Vtkwritesol_Op: public E_F0mps { public: typedef long Result; Expression edx; Expression ename; //!< name of time series or field Expression et; //!< time long what; // 1 scalar, 2 vector, 3 symtensor long nbfloat; // 1 scalar, n vector (3D), n symtensor(3D) Expression evct, evct2; public: Vtkwritesol_Op (const basicAC_F0 &args): what(0), nbfloat(0) { evct = 0; evct2 = 0; int nbofsol; int ddim = 2; // There's no named parameter args.SetNameParam(); if (args.size() != 3) { CompileError("Vtkwritesol accepts only 4 parameters"); } if (BCastTo(args[0])) {edx = CastTo(args[0]);} if (BCastTo(args[1])) {ename = CastTo(args[1]);} if (args[2].left() == atype()) { what = 1; nbfloat = 1; evct = to(args[2]); } else if (args[2].left() == atype()) { what = 1; nbfloat = 1; evct = to(args[2]); } else if (BCastTo(args[2])) { what = 1; nbfloat = 1; evct = to(args[2]); } else if (args[2].left() == atype()) { std::cout << "Until now only scalar solution" << std::endl; int i = 2; const E_Array *a0 = dynamic_cast(args[i].LeftValue()); if (a0->size() == ddim) { // vector solution what = 2; nbfloat = a0->size(); evct = to((*a0)[0]); evct2 = to((*a0)[1]); } cout << "Passed Until now only scalar solution" << std::endl; } else { CompileError("savesol in 2D: Sorry no way to save this kind of data"); } } // all type static ArrayOfaType typeargs () {return ArrayOfaType(atype(), atype(), true);} static E_F0*f (const basicAC_F0 &args) {return new Vtkwritesol_Op(args);} AnyType operator () (Stack stack) const; }; // end of class AnyType Vtkwritesol_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; VtkWriter &dx = *(GetAny((*edx)(stack))); string &name = *(GetAny((*ename)(stack))); // double t=GetAny((*et)(stack)); const Mesh &Th = *(dx.getmeshts(name)); int nt = Th.nt; int nv = Th.nv; int nbsol = nv; long longdefault = 0; KN valsol(nbsol); valsol = 0.; KN takemesh(nbsol); takemesh = 0; MeshPoint *mp3(MeshPointStack(stack)); for (int it = 0; it < nt; it++) { for (int iv = 0; iv < 3; iv++) { int i = Th(it, iv); mp3->setP(&Th, it, iv); valsol[i] = valsol[i] + GetAny((*evct)(stack)); ++takemesh[i]; } } for (int i = 0; i < nbsol; i++) { valsol[i] /= takemesh[i]; } // Writes valsol on the file file if (what == 1) {dx.addscalar(name, &Th, valsol);} if (what == 2) { KN valsol2(nbsol); valsol2 = 0.; KN takemesh(nbsol); takemesh = 0; MeshPoint *mp3(MeshPointStack(stack)); for (int it = 0; it < nt; it++) { for (int iv = 0; iv < 3; iv++) { int i = Th(it, iv); mp3->setP(&Th, it, iv); valsol2[i] = valsol2[i] + GetAny((*evct2)(stack)); ++takemesh[i]; } } for (int i = 0; i < nbsol; i++) { valsol2[i] /= takemesh[i]; } // Writes valsol on the file file dx.addvector(name, &Th, valsol, valsol2); } return longdefault; } // le vrai constructeur est la VtkWriter*init_VtkWriter (VtkWriter *const &a, string *const &s) { std::cout << "start init_VtkWriter" << std::endl; a->init(); a->openfiles(*s); std::cout << "end init_VtkWriter" << std::endl; return a; } void*call_addmesh (VtkWriter *const &mt, const Fem2D::Mesh *const &pTh) { mt->addmesh(pTh); return NULL; } // Add the function name to the freefem++ table /* class Init * { * public: * Init(); * }; * * $1 */ static void Load_Init () { Dcl_Type(InitP, Destroy ); // declare deux nouveau type pour freefem++ un pointeur et zzzfff->Add("VtkWriter", atype()); // ajoute le type myType a freefem++ // constructeur d'un type myType dans freefem TheOperators->Add("<-", new OneOperator2_(&init_VtkWriter)); Global.Add("Vtkaddmesh", "(", new OneOperator2_(call_addmesh)); Global.Add("Vtkaddscalar", "(", new OneOperatorCode ); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/BernardiRaugel.cpp000644 000767 000024 00000022173 13312446271 022063 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Bernardi Raugel finite element // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // RELATED FILES: // VALIDATION: test_P2BR.edp // EXAMPLE: NS_P2BR_P0.edp // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include #include "AddNewFE.h" namespace Fem2D { /*! * The P2BR finite element: the Bernardi Raugel Finite Element * See Bernardi, C., Raugel, G.: Analysis of some finite elements for the Stokes problem. Math. Comp. 44, 71-79 (1985) * It is a 2d coupled finite element * The Polynomial space is P1^2 + 3 normals bubbles edges function (P_2) * The degree of freedom is 6 values of the 2 components at the 3 vertices and the 3 flux on the 3 edges * So 9 degrees of freedom and N = 2 */ class TypeOfFE_P2BRLagrange: public TypeOfFE { public: static int Data []; TypeOfFE_P2BRLagrange (): TypeOfFE( 6 + 3 + 0, // Number of degrees of freedom 2, // Dimension N Data, // Data array 4, // Number of subdivisions for plotting 1, // Number of sub finite element 6 + 3 * (2 + 2),// Number kPi of coefficients to build the interpolation 9, // number nPi of integration points to build the interpolation 0 // Array to store the coefficient alpha_k to build the interpolator ) { const double gauss1 = (1. - sqrt(1. / 3.)) / 2; const double gauss2 = 1. - gauss1; const R2 Pt [] = {R2(0, 0), R2(1, 0), R2(0, 1)}; // For the 3 vertices: 6 coefficents int kk = 0; for (int p = 0; p < 3; p++) { P_Pi_h[p] = Pt[p]; pij_alpha[kk] = IPJ(kk, p, 0); ++kk; pij_alpha[kk] = IPJ(kk, p, 1); ++kk; } // Integration point on edge e int p = 3; for (int e = 0; e < 3; ++e) { R2 A = Pt[VerticesOfTriangularEdge[e][0]]; R2 B = Pt[VerticesOfTriangularEdge[e][1]]; P_Pi_h[p] = A * gauss1 + B * gauss2; pij_alpha[kk++] = IPJ(6 + e, p, 0); // coef = 0.5 * l_e * ne_x * sge pij_alpha[kk++] = IPJ(6 + e, p, 1); // coef = 0.5 * l_e * ne_y * sge p++; P_Pi_h[p] = A * gauss2 + B * gauss1; pij_alpha[kk++] = IPJ(6 + e, p, 0); // coef = 0.5 * l_e * ne_x * sge pij_alpha[kk++] = IPJ(6 + e, p, 1); // coef = 0.5 * l_e * ne_y * sge p++; } assert(P_Pi_h.N() == p); assert(pij_alpha.N() == kk); } void FB (const bool *whatd, const Mesh &Th, const Triangle &K, const R2 &P, RNMK_ &val) const; void Pi_h_alpha (const baseFElement &K, KN_ &v) const; }; // Data array int TypeOfFE_P2BRLagrange::Data [] = { 0, 0, 1, 1, 2, 2, 3, 4, 5, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 9, 9 }; // Define alpha_k void TypeOfFE_P2BRLagrange::Pi_h_alpha (const baseFElement &K, KN_ &v) const { const Triangle &T(K.T); int k = 0; // Coefficents for the 3 vertices time the 2 components for (int i = 0; i < 6; i++) { v[k++] = 1; } // Integration on edges for (int i = 0; i < 3; i++) { R2 N(T.Edge(i).perp()); N *= T.EdgeOrientation(i) * 0.5; v[k++] = N.x; v[k++] = N.y; v[k++] = N.x; v[k++] = N.y; } } // Shape function void TypeOfFE_P2BRLagrange::FB (const bool *whatd, const Mesh &, const Triangle &K, const R2 &P, RNMK_ &val) const { R2 A(K[0]), B(K[1]), C(K[2]); R l0 = 1 - P.x - P.y, l1 = P.x, l2 = P.y; R l4_0 = (4 * l0 - 1), l4_1 = (4 * l1 - 1), l4_2 = (4 * l2 - 1); // int_e_1 l0*l0 = |e_1|/3 and int_e_1 l0*l1 = |e_1|/6 // to get the flux = 1 R2 E[3] = {K.Edge(0), K.Edge(1), K.Edge(2)}; double l2E[3] = {(E[0], E[0]), (E[1], E[1]), (E[2], E[2])}; // double lE[3] = {sqrt(l2E[0]), sqrt(l2E[1]), sqrt(l2E[2])}; double sgE[3] = {K.EdgeOrientation(0), K.EdgeOrientation(1), K.EdgeOrientation(2)}; R2 cN[3] = { E[0].perp() * (6. * sgE[0] / l2E[0]), E[1].perp() * (6. * sgE[1] / l2E[1]), E[2].perp() * (6. * sgE[2] / l2E[2]) }; val = 0; throwassert(val.N() >= 9); throwassert(val.M() == 2); val = 0; if (whatd[op_id]) { RN_ f0(val('.', 0, op_id)); RN_ f1(val('.', 1, op_id)); f1[1] = f0[0] = l0; f1[3] = f0[2] = l1; f1[5] = f0[4] = l2; f0[6] = cN[0].x * l1 * l2; // opposite to the vertex 0 f0[7] = cN[1].x * l0 * l2; // opposite to the vertex 1 f0[8] = cN[2].x * l1 * l0; // opposite to the vertex 2 f1[6] = cN[0].y * l1 * l2; // opposite to the vertex 0 f1[7] = cN[1].y * l0 * l2; // opposite to the vertex 1 f1[8] = cN[2].y * l1 * l0; // opposite to the vertex 2 } if (whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (whatd[op_dx]) { RN_ f0x(val('.', 0, op_dx)); RN_ f1x(val('.', 1, op_dx)); f1x[1] = f0x[0] = Dl0.x; f1x[3] = f0x[2] = Dl1.x; f1x[5] = f0x[4] = Dl2.x; f0x[6] = cN[0].x * (Dl1.x * l2 + Dl2.x * l1); f0x[7] = cN[1].x * (Dl2.x * l0 + Dl0.x * l2); f0x[8] = cN[2].x * (Dl0.x * l1 + Dl1.x * l0); f1x[6] = cN[0].y * (Dl1.x * l2 + Dl2.x * l1); f1x[7] = cN[1].y * (Dl2.x * l0 + Dl0.x * l2); f1x[8] = cN[2].y * (Dl0.x * l1 + Dl1.x * l0); } if (whatd[op_dy]) { RN_ f0y(val('.', 0, op_dy)); RN_ f1y(val('.', 1, op_dy)); f1y[1] = f0y[0] = Dl0.y; f1y[3] = f0y[2] = Dl1.y; f1y[5] = f0y[4] = Dl2.y; f0y[6] = cN[0].x * (Dl1.y * l2 + Dl2.y * l1); f0y[7] = cN[1].x * (Dl2.y * l0 + Dl0.y * l2); f0y[8] = cN[2].x * (Dl0.y * l1 + Dl1.y * l0); f1y[6] = cN[0].y * (Dl1.y * l2 + Dl2.y * l1); f1y[7] = cN[1].y * (Dl2.y * l0 + Dl0.y * l2); f1y[8] = cN[2].y * (Dl0.y * l1 + Dl1.y * l0); } if (whatd[op_dxx]) { RN_ f0xx(val('.', 0, op_dxx)); RN_ f1xx(val('.', 1, op_dxx)); f0xx[6] = 2 * cN[0].x * Dl1.x * Dl2.x; f0xx[7] = 2 * cN[1].x * Dl0.x * Dl2.x; f0xx[8] = 2 * cN[2].x * Dl0.x * Dl1.x; f1xx[6] = 2 * cN[0].y * Dl1.x * Dl2.x; f1xx[7] = 2 * cN[1].y * Dl0.x * Dl2.x; f1xx[8] = 2 * cN[2].y * Dl0.x * Dl1.x; } if (whatd[op_dyy]) { RN_ f0yy(val('.', 0, op_dyy)); RN_ f1yy(val('.', 1, op_dyy)); f0yy[6] = 2 * cN[0].x * Dl1.y * Dl2.y; f0yy[7] = 2 * cN[1].x * Dl0.y * Dl2.y; f0yy[8] = 2 * cN[2].x * Dl0.y * Dl1.y; f1yy[6] = 2 * cN[0].y * Dl1.y * Dl2.y; f1yy[7] = 2 * cN[1].y * Dl0.y * Dl2.y; f1yy[8] = 2 * cN[2].y * Dl0.y * Dl1.y; } if (whatd[op_dxy]) { assert(val.K() > op_dxy); RN_ f0xy(val('.', 0, op_dxy)); RN_ f1xy(val('.', 1, op_dxy)); f0xy[6] = cN[0].x * (Dl1.x * Dl2.y + Dl1.y * Dl2.x); f0xy[7] = cN[1].x * (Dl0.x * Dl2.y + Dl0.y * Dl2.x); f0xy[8] = cN[2].x * (Dl0.x * Dl1.y + Dl0.y * Dl1.x); f1xy[6] = cN[0].y * (Dl1.x * Dl2.y + Dl1.y * Dl2.x); f1xy[7] = cN[1].y * (Dl0.x * Dl2.y + Dl0.y * Dl2.x); f1xy[8] = cN[2].y * (Dl0.x * Dl1.y + Dl0.y * Dl1.x); } } // Now, remove the flux part on 6 first DOF // w_i = w_i - a_i w_{k_i} - b_i w_{l_i} { int k[6] = {6 + 1, 6 + 1, 6 + 2, 6 + 2, 6 + 0, 6 + 0}; int l[6] = {6 + 2, 6 + 2, 6 + 0, 6 + 0, 6 + 1, 6 + 1}; R2 eN[3] = { E[0].perp() * (0.5 * sgE[0]), E[1].perp() * (0.5 * sgE[1]), E[2].perp() * (0.5 * sgE[2]) }; double a[6] = {eN[1].x, eN[1].y, eN[2].x, eN[2].y, eN[0].x, eN[0].y}; double b[6] = {eN[2].x, eN[2].y, eN[0].x, eN[0].y, eN[1].x, eN[1].y}; int nop = 0; int vop[last_operatortype]; for (int j = 0; j < last_operatortype; j++) { if (whatd[j]) { vop[nop++] = j; } } for (int i = 0; i < 6; ++i) { for (int jj = 0; jj < nop; ++jj) { int j = vop[jj]; val(i, 0, j) -= a[i] * val(k[i], 0, j) + b[i] * val(l[i], 0, j); val(i, 1, j) -= a[i] * val(k[i], 1, j) + b[i] * val(l[i], 1, j); } } } } // Add the finite element to the FreeFem++ table // a static variable to define the finite element static TypeOfFE_P2BRLagrange P2LagrangeP2BR; // now, adding FE in FreeFem++ table static AddNewFE P2BR("P2BR", &P2LagrangeP2BR); } // end FEM2d namespace freefem++-3.61-1/examples++-load/renumb.hpp000644 000767 000024 00000072062 13312446271 020474 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... #ifndef RENUMB_HPP #define RENUMB_HPP // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 08 March 2013 // // Author: // // John Burkardt // # include # include # include # include # include # include # include namespace renumb { void i4vec_print (int n, int a [], string title); void adj_print (int node_num, int adj_num, int adj_row [], int adj [], string title); void adj_print_some (int node_num, int node_lo, int node_hi, int adj_num, int adj_row [], int adj [], string title); int adj_bandwidth (int node_num, int adj_num, int adj_row [], int adj []); int adj_perm_bandwidth (int node_num, int adj_num, int adj_row [], int adj [], int perm [], int perm_inv []); int*genrcm (int node_num, int adj_num, int adj_row [], int adj []); void rcm (int root, int adj_num, int adj_row [], int adj [], int mask [], int perm [], int *iccsze, int node_num); void root_find (int *root, int adj_num, int adj_row [], int adj [], int mask [], int *level_num, int level_row [], int level [], int node_num); void i4vec_reverse (int n, int a []); void level_set (int root, int adj_num, int adj_row [], int adj [], int mask [], int *level_num, int level_row [], int level [], int node_num); void degree (int root, int adj_num, int adj_row [], int adj [], int mask [], int deg [], int *iccsze, int ls [], int node_num); int*perm_inverse3 (int n, int perm []); void i4vec_print (int n, int a [], string title) { // ****************************************************************************80 // // Purpose: // // I4VEC_PRINT prints an I4VEC. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 25 February 2003 // // Author: // // John Burkardt // // Parameters: // // Input, int N, the number of components of the vector. // // Input, int A[N], the vector to be printed. // // Input, string TITLE, a title. // int i; cout << "\n"; cout << title << "\n"; cout << "\n"; for (i = 0; i < n; i++) { cout << " " << setw(8) << i << " " << setw(8) << a[i] << "\n"; } return; } void adj_print (int node_num, int adj_num, int adj_row [], int adj [], string title) { // ****************************************************************************80 // // Purpose: // // ADJ_PRINT prints adjacency information. // // Discussion: // // The list has the form: // // Row Nonzeros // // 1 2 5 9 // 2 7 8 9 15 78 79 81 86 91 99 // 100 103 // 3 48 49 53 // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 18 December 2002 // // Author: // // John Burkardt // // Parameters: // // Input, int NODE_NUM, the number of nodes. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1], organizes the adjacency entries // into rows. The entries for row I are in entries ADJ_ROW(I) // through ADJ_ROW(I+1)-1. // // Input, int ADJ[ADJ_NUM], the adjacency structure, which contains, // for each row, the column indices of the nonzero entries. // // Input, string TITLE, a title. // adj_print_some(node_num, 0, node_num - 1, adj_num, adj_row, adj, title); return; } int adj_bandwidth (int node_num, int adj_num, int adj_row [], int adj []) { // ****************************************************************************80 // // Purpose: // // ADJ_BANDWIDTH computes the bandwidth of an adjacency matrix. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 03 January 2007 // // Author: // // John Burkardt // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int NODE_NUM, the number of nodes. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Output, int ADJ_BANDWIDTH, the bandwidth of the adjacency // matrix. // int band_hi; int band_lo; int col; int i; int j; int value; band_lo = 0; band_hi = 0; for (i = 0; i < node_num; i++) { for (j = adj_row[i]; j <= adj_row[i + 1] - 1; j++) { col = adj[j]; band_lo = std::max(band_lo, i - col); band_hi = std::max(band_hi, col - i); } } value = band_lo + 1 + band_hi; return value; } int adj_perm_bandwidth (int node_num, int adj_num, int adj_row [], int adj [], int perm [], int perm_inv []) { // ****************************************************************************80 // // Purpose: // // ADJ_PERM_BANDWIDTH computes the bandwidth of a permuted adjacency matrix. // // Discussion: // // The matrix is defined by the adjacency information and a permutation. // // The routine also computes the bandwidth and the size of the envelope. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 05 January 2007 // // Author: // // John Burkardt // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int NODE_NUM, the number of nodes. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Input, int PERM[NODE_NUM], PERM_INV(NODE_NUM), the permutation // and inverse permutation. // // Output, int ADJ_PERM_BANDWIDTH, the bandwidth of the permuted // adjacency matrix. // int band_hi; int band_lo; int bandwidth; int col; int i; int j; band_lo = 0; band_hi = 0; for (i = 0; i < node_num; i++) { for (j = adj_row[perm[i]]; j <= adj_row[perm[i] + 1] - 1; j++) { col = perm_inv[adj[j]]; band_lo = std::max(band_lo, i - col); band_hi = std::max(band_hi, col - i); } } bandwidth = band_lo + 1 + band_hi; return bandwidth; } int*genrcm (int node_num, int adj_num, int adj_row [], int adj []) { // ****************************************************************************80 // // Purpose: // // GENRCM finds the reverse Cuthill-Mckee ordering for a general graph. // // Discussion: // // For each connected component in the graph, the routine obtains // an ordering by calling RCM. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 14 May 2011 // // Author: // // Original FORTRAN77 version by Alan George, Joseph Liu. // C++ version by John Burkardt. // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int NODE_NUM, the number of nodes. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Output, int GENRCM[NODE_NUM], the RCM ordering. // // Local Parameters: // // Local, int LEVEL_ROW[NODE_NUM+1], the index vector for a level // structure. The level structure is stored in the currently unused // spaces in the permutation vector PERM. // // Local, int MASK[NODE_NUM], marks variables that have been numbered. // int i; int iccsze; int level_num; int *level_row; int *mask; int num; int *perm; int root; // // Assuming the input dat is 0 based, add 1 to ADJ_ROW and ADJ, // because GENRCM uses 1-based indexing! // for (i = 0; i < node_num + 1; i++) { adj_row[i] = adj_row[i] + 1; } for (i = 0; i < adj_num; i++) { adj[i] = adj[i] + 1; } perm = new int[node_num]; level_row = new int[node_num + 1]; mask = new int[node_num]; for (i = 0; i < node_num; i++) { mask[i] = 1; } num = 1; for (i = 0; i < node_num; i++) { // // For each masked connected component... // if (mask[i] != 0) { root = i + 1; // // Find a pseudo-peripheral node ROOT. The level structure found by // ROOT_FIND is stored starting at PERM(NUM). // root_find(&root, adj_num, adj_row, adj, mask, &level_num, level_row, perm + num - 1, node_num); // // RCM orders the component using ROOT as the starting node. // rcm(root, adj_num, adj_row, adj, mask, perm + num - 1, &iccsze, node_num); num = num + iccsze; } // // We can stop once every node is in one of the connected components. // if (node_num < num) { break; } } delete [] level_row; delete [] mask; // // PERM is computed as a 1-based vector. // Rewrite it as a 0-based vector. // for (i = 0; i < node_num; i++) { perm[i] = perm[i] - 1; } // // Subtract 1 from ADJ_ROW and ADJ because GENRCM used 1-based indexing! // for (i = 0; i < node_num + 1; i++) { adj_row[i] = adj_row[i] - 1; } for (i = 0; i < adj_num; i++) { adj[i] = adj[i] - 1; } return perm; } void adj_print_some (int node_num, int node_lo, int node_hi, int adj_num, int adj_row [], int adj [], string title) { // ****************************************************************************80 // // Purpose: // // ADJ_PRINT_SOME prints some adjacency information. // // Discussion: // // The list has the form: // // Row Nonzeros // // 1 2 5 9 // 2 7 8 9 15 78 79 81 86 91 99 // 100 103 // 3 48 49 53 // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 04 January 2007 // // Author: // // John Burkardt // // Parameters: // // Input, int NODE_NUM, the number of nodes. // // Input, int NODE_LO, NODE_HI, the first and last nodes for // which the adjacency information is to be printed. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1], organizes the adjacency entries // into rows. The entries for row I are in entries ADJ_ROW(I) // through ADJ_ROW(I+1)-1. // // Input, int ADJ[ADJ_NUM], the adjacency structure, which contains, // for each row, the column indices of the nonzero entries. // // Input, string TITLE, a title to be printed. // int i; int j; int jhi; int jlo; int jmax; int jmin; cout << "\n"; cout << title << "\n"; cout << " Sparse adjacency structure:\n"; cout << "\n"; cout << " Number of nodes = " << node_num << "\n"; ; cout << " Number of adjacencies = " << adj_num << "\n"; cout << "\n"; cout << " Node Min Max Nonzeros \n"; cout << "\n"; for (i = node_lo; i <= node_hi; i++) { jmin = adj_row[i]; jmax = adj_row[i + 1] - 1; if (jmax < jmin) { cout << " " << setw(4) << i << " " << setw(4) << jmin << " " << setw(4) << jmax << "\n"; } else { for (jlo = jmin; jlo <= jmax; jlo = jlo + 5) { jhi = std::min(jlo + 4, jmax); if (jlo == jmin) { cout << " " << setw(4) << i << " " << setw(4) << jmin << " " << setw(4) << jmax << " "; for (j = jlo; j <= jhi; j++) { cout << setw(8) << adj[j]; } cout << "\n"; } else { cout << " "; for (j = jlo; j <= jhi; j++) { cout << setw(8) << adj[j]; } cout << "\n"; } } } } return; } void rcm (int root, int adj_num, int adj_row [], int adj [], int mask [], int perm [], int *iccsze, int node_num) { // ****************************************************************************80 // // Purpose: // // RCM renumbers a connected component by the reverse Cuthill McKee algorithm. // // Discussion: // // The connected component is specified by a node ROOT and a mask. // The numbering starts at the root node. // // An outline of the algorithm is as follows: // // X(1) = ROOT. // // for ( I = 1 to N-1) // Find all unlabeled neighbors of X(I), // assign them the next available labels, in order of increasing degree. // // When done, reverse the ordering. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 05 January 2007 // // Author: // // Original FORTRAN77 version by Alan George, Joseph Liu. // C++ version by John Burkardt. // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int ROOT, the node that defines the connected component. // It is used as the starting point for the RCM ordering. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW(NODE_NUM+1). Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ(ADJ_NUM), the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Input/output, int MASK(NODE_NUM), a mask for the nodes. Only // those nodes with nonzero input mask values are considered by the // routine. The nodes numbered by RCM will have their mask values // set to zero. // // Output, int PERM(NODE_NUM), the RCM ordering. // // Output, int ICCSZE, the size of the connected component // that has been numbered. // // Input, int NODE_NUM, the number of nodes. // // Local Parameters: // // Workspace, int DEG[NODE_NUM], a temporary vector used to hold // the degree of the nodes in the section graph specified by mask and root. // int *deg; int fnbr; int i; int j; int jstop; int jstrt; int k; int l; int lbegin; int lnbr; int lperm; int lvlend; int nbr; int node; // // Find the degrees of the nodes in the component specified by MASK and ROOT. // deg = new int[node_num]; degree(root, adj_num, adj_row, adj, mask, deg, iccsze, perm, node_num); mask[root - 1] = 0; if (*iccsze <= 1) { delete [] deg; return; } lvlend = 0; lnbr = 1; // // LBEGIN and LVLEND point to the beginning and // the end of the current level respectively. // while (lvlend < lnbr) { lbegin = lvlend + 1; lvlend = lnbr; for (i = lbegin; i <= lvlend; i++) { // // For each node in the current level... // node = perm[i - 1]; jstrt = adj_row[node - 1]; jstop = adj_row[node] - 1; // // Find the unnumbered neighbors of NODE. // // FNBR and LNBR point to the first and last neighbors // of the current node in PERM. // fnbr = lnbr + 1; for (j = jstrt; j <= jstop; j++) { nbr = adj[j - 1]; if (mask[nbr - 1] != 0) { lnbr = lnbr + 1; mask[nbr - 1] = 0; perm[lnbr - 1] = nbr; } } // // If no neighbors, skip to next node in this level. // if (lnbr <= fnbr) { continue; } // // Sort the neighbors of NODE in increasing order by degree. // Linear insertion is used. // k = fnbr; while (k < lnbr) { l = k; k = k + 1; nbr = perm[k - 1]; while (fnbr < l) { lperm = perm[l - 1]; if (deg[lperm - 1] <= deg[nbr - 1]) { break; } perm[l] = lperm; l = l - 1; } perm[l] = nbr; } } } // // We now have the Cuthill-McKee ordering. Reverse it. // i4vec_reverse(*iccsze, perm); delete [] deg; return; } void root_find (int *root, int adj_num, int adj_row [], int adj [], int mask [], int *level_num, int level_row [], int level [], int node_num) { // ****************************************************************************80 // // Purpose: // // ROOT_FIND finds a pseudo-peripheral node. // // Discussion: // // The diameter of a graph is the maximum distance (number of edges) // between any two nodes of the graph. // // The eccentricity of a node is the maximum distance between that // node and any other node of the graph. // // A peripheral node is a node whose eccentricity equals the // diameter of the graph. // // A pseudo-peripheral node is an approximation to a peripheral node; // it may be a peripheral node, but all we know is that we tried our // best. // // The routine is given a graph, and seeks pseudo-peripheral nodes, // using a modified version of the scheme of Gibbs, Poole and // Stockmeyer. It determines such a node for the section subgraph // specified by MASK and ROOT. // // The routine also determines the level structure associated with // the given pseudo-peripheral node; that is, how far each node // is from the pseudo-peripheral node. The level structure is // returned as a list of nodes LS, and pointers to the beginning // of the list of nodes that are at a distance of 0, 1, 2, ..., // NODE_NUM-1 from the pseudo-peripheral node. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 05 January 2007 // // Author: // // Original FORTRAN77 version by Alan George, Joseph Liu. // C++ version by John Burkardt. // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Norman Gibbs, William Poole, Paul Stockmeyer, // An Algorithm for Reducing the Bandwidth and Profile of a Sparse Matrix, // SIAM Journal on Numerical Analysis, // Volume 13, pages 236-250, 1976. // // Norman Gibbs, // Algorithm 509: A Hybrid Profile Reduction Algorithm, // ACM Transactions on Mathematical Software, // Volume 2, pages 378-387, 1976. // // Parameters: // // Input/output, int *ROOT. On input, ROOT is a node in the // the component of the graph for which a pseudo-peripheral node is // sought. On output, ROOT is the pseudo-peripheral node obtained. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Input, int MASK[NODE_NUM], specifies a section subgraph. Nodes // for which MASK is zero are ignored by FNROOT. // // Output, int *LEVEL_NUM, is the number of levels in the level structure // rooted at the node ROOT. // // Output, int LEVEL_ROW(NODE_NUM+1), LEVEL(NODE_NUM), the // level structure array pair containing the level structure found. // // Input, int NODE_NUM, the number of nodes. // int iccsze; int j; int jstrt; int k; int kstop; int kstrt; int level_num2; int mindeg; int nabor; int ndeg; int node; // // Determine the level structure rooted at ROOT. // level_set(*root, adj_num, adj_row, adj, mask, level_num, level_row, level, node_num); // // Count the number of nodes in this level structure. // iccsze = level_row[*level_num] - 1; // // Extreme case: // A complete graph has a level set of only a single level. // Every node is equally good (or bad). // if (*level_num == 1) { return; } // // Extreme case: // A "line graph" 0--0--0--0--0 has every node in its only level. // By chance, we've stumbled on the ideal root. // if (*level_num == iccsze) { return; } // // Pick any node from the last level that has minimum degree // as the starting point to generate a new level set. // for (;; ) { mindeg = iccsze; jstrt = level_row[*level_num - 1]; *root = level[jstrt - 1]; if (jstrt < iccsze) { for (j = jstrt; j <= iccsze; j++) { node = level[j - 1]; ndeg = 0; kstrt = adj_row[node - 1]; kstop = adj_row[node] - 1; for (k = kstrt; k <= kstop; k++) { nabor = adj[k - 1]; if (0 < mask[nabor - 1]) { ndeg = ndeg + 1; } } if (ndeg < mindeg) { *root = node; mindeg = ndeg; } } } // // Generate the rooted level structure associated with this node. // level_set(*root, adj_num, adj_row, adj, mask, &level_num2, level_row, level, node_num); // // If the number of levels did not increase, accept the new ROOT. // if (level_num2 <= *level_num) { break; } *level_num = level_num2; // // In the unlikely case that ROOT is one endpoint of a line graph, // we can exit now. // if (iccsze <= *level_num) { break; } } return; } void i4vec_reverse (int n, int a []) { // ****************************************************************************80 // // Purpose: // // I4VEC_REVERSE reverses the elements of an I4VEC. // // Example: // // Input: // // N = 5, // A = ( 11, 12, 13, 14, 15 ). // // Output: // // A = ( 15, 14, 13, 12, 11 ). // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 22 September 2005 // // Author: // // John Burkardt // // Parameters: // // Input, int N, the number of entries in the array. // // Input/output, int A(N), the array to be reversed. // int i; int j; for (i = 0; i < n / 2; i++) { j = a[i]; a[i] = a[n - 1 - i]; a[n - 1 - i] = j; } return; } void level_set (int root, int adj_num, int adj_row [], int adj [], int mask [], int *level_num, int level_row [], int level [], int node_num) { // ****************************************************************************80 // // Purpose: // // LEVEL_SET generates the connected level structure rooted at a given node. // // Discussion: // // Only nodes for which MASK is nonzero will be considered. // // The root node chosen by the user is assigned level 1, and masked. // All (unmasked) nodes reachable from a node in level 1 are // assigned level 2 and masked. The process continues until there // are no unmasked nodes adjacent to any node in the current level. // The number of levels may vary between 2 and NODE_NUM. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 05 January 2007 // // Author: // // Original FORTRAN77 version by Alan George, Joseph Liu. // C++ version by John Burkardt. // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int ROOT, the node at which the level structure // is to be rooted. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Input/output, int MASK[NODE_NUM]. On input, only nodes with nonzero // MASK are to be processed. On output, those nodes which were included // in the level set have MASK set to 1. // // Output, int *LEVEL_NUM, the number of levels in the level // structure. ROOT is in level 1. The neighbors of ROOT // are in level 2, and so on. // // Output, int LEVEL_ROW[NODE_NUM+1], LEVEL[NODE_NUM], the rooted // level structure. // // Input, int NODE_NUM, the number of nodes. // int i; int iccsze; int j; int jstop; int jstrt; int lbegin; int lvlend; int lvsize; int nbr; int node; mask[root - 1] = 0; level[0] = root; *level_num = 0; lvlend = 0; iccsze = 1; // // LBEGIN is the pointer to the beginning of the current level, and // LVLEND points to the end of this level. // for (;; ) { lbegin = lvlend + 1; lvlend = iccsze; *level_num = *level_num + 1; level_row[*level_num - 1] = lbegin; // // Generate the next level by finding all the masked neighbors of nodes // in the current level. // for (i = lbegin; i <= lvlend; i++) { node = level[i - 1]; jstrt = adj_row[node - 1]; jstop = adj_row[node] - 1; for (j = jstrt; j <= jstop; j++) { nbr = adj[j - 1]; if (mask[nbr - 1] != 0) { iccsze = iccsze + 1; level[iccsze - 1] = nbr; mask[nbr - 1] = 0; } } } // // Compute the current level width (the number of nodes encountered.) // If it is positive, generate the next level. // lvsize = iccsze - lvlend; if (lvsize <= 0) { break; } } level_row[*level_num] = lvlend + 1; // // Reset MASK to 1 for the nodes in the level structure. // for (i = 0; i < iccsze; i++) { mask[level[i] - 1] = 1; } return; } void degree (int root, int adj_num, int adj_row [], int adj [], int mask [], int deg [], int *iccsze, int ls [], int node_num) { // ****************************************************************************80 // // Purpose: // // DEGREE computes the degrees of the nodes in the connected component. // // Discussion: // // The connected component is specified by MASK and ROOT. // Nodes for which MASK is zero are ignored. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 05 January 2007 // // Author: // // Original FORTRAN77 version by Alan George, Joseph Liu. // C++ version by John Burkardt. // // Reference: // // Alan George, Joseph Liu, // Computer Solution of Large Sparse Positive Definite Systems, // Prentice Hall, 1981. // // Parameters: // // Input, int ROOT, the node that defines the connected component. // // Input, int ADJ_NUM, the number of adjacency entries. // // Input, int ADJ_ROW[NODE_NUM+1]. Information about row I is stored // in entries ADJ_ROW(I) through ADJ_ROW(I+1)-1 of ADJ. // // Input, int ADJ[ADJ_NUM], the adjacency structure. // For each row, it contains the column indices of the nonzero entries. // // Input, int MASK[NODE_NUM], is nonzero for those nodes which are // to be considered. // // Output, int DEG[NODE_NUM], contains, for each node in the connected // component, its degree. // // Output, int *ICCSIZE, the number of nodes in the connected component. // // Output, int LS[NODE_NUM], stores in entries 1 through ICCSIZE the nodes // in the connected component, starting with ROOT, and proceeding // by levels. // // Input, int NODE_NUM, the number of nodes. // int i; int ideg; int j; int jstop; int jstrt; int lbegin; int lvlend; int lvsize; int nbr; int node; // // The sign of ADJ_ROW(I) is used to indicate if node I has been considered. // ls[0] = root; adj_row[root - 1] = -adj_row[root - 1]; lvlend = 0; *iccsze = 1; // // LBEGIN is the pointer to the beginning of the current level, and // LVLEND points to the end of this level. // for (;; ) { lbegin = lvlend + 1; lvlend = *iccsze; // // Find the degrees of nodes in the current level, // and at the same time, generate the next level. // for (i = lbegin; i <= lvlend; i++) { node = ls[i - 1]; jstrt = -adj_row[node - 1]; jstop = abs(adj_row[node]) - 1; ideg = 0; for (j = jstrt; j <= jstop; j++) { nbr = adj[j - 1]; if (mask[nbr - 1] != 0) { ideg = ideg + 1; if (0 <= adj_row[nbr - 1]) { adj_row[nbr - 1] = -adj_row[nbr - 1]; *iccsze = *iccsze + 1; ls[*iccsze - 1] = nbr; } } } deg[node - 1] = ideg; } // // Compute the current level width. // lvsize = *iccsze - lvlend; // // If the current level width is nonzero, generate another level. // if (lvsize == 0) { break; } } // // Reset ADJ_ROW to its correct sign and return. // for (i = 0; i < *iccsze; i++) { node = ls[i] - 1; adj_row[node] = -adj_row[node]; } return; } int*perm_inverse3 (int n, int perm []) { // ****************************************************************************80 // // Purpose: // // PERM_INVERSE3 produces the inverse of a given permutation. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 14 May 2011 // // Author: // // John Burkardt // // Parameters: // // Input, int N, the number of items permuted. // // Input, int PERM[N], a permutation. // // Output, int PERM_INVERSE3[N], the inverse permutation. // int i; int *perm_inv; perm_inv = new int[n]; for (i = 0; i < n; i++) { perm_inv[perm[i]] = i; } return perm_inv; } } #endif freefem++-3.61-1/examples++-load/distance.cpp000644 000767 000024 00000050542 13312446271 020770 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Signed distance function // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #ifndef WITH_NO_INIT #include "ff++.hpp" #include "AFunction_ext.hpp" #endif using namespace std; #include #include #include #include #include #include // #include "msh3.hpp" static int debug = 0, debug1 = 0; using namespace Fem2D; template Rd zero (double a, const Rd &A, double b, const Rd &B) {// zero affine double la = b / (b - a), lb = a / (a - b); return la * A + lb * B; } template double distmin (const Rd &A, const Rd &B, const Rd &Q) { double d = 0; Rd AB(A, B), AQ(A, Q); double ab2 = (AB, AB); double lc = (AQ, AB) / ab2; Rd CQ = AQ - lc * AB; // ( CQ , AB) = 0 Rd C = A + lc * AB; // or Q - CQ if (lc < 0) {d = Norme2(AQ);} else if (lc > 1.) {d = Norme2(Rd(B, Q));} else {d = Norme2(CQ);} if (verbosity > 9999) { cout << " distmin: d =" << d << " /" << lc << " :: " << A << " " << B << " " << Q << " C" << C << endl; } return d; } template double distmin (const Rd &A, const Rd &B, const Rd &Q, double aq, double bq) { double d = 0; Rd AB(A, B), AQ(A, Q); double ab2 = (AB, AB); double lp = (AQ, AB) / ab2; Rd PQ = AQ - lp * AB; // ( PQ , AB) = 0 // Rd P = A + lp*AB;// or Q - PQ if (lp < 0) {d = aq;} else if (lp > 1.) {d = bq;} else {d = Norme2(PQ);} if (verbosity > 9999) { cout << " distmin:AB/Q: d =" << d << " /" << lp << " :: A " << A << " B " << B << " Q " << Q << " P " << (A + lp * AB) << endl; } return d; } template double distmin (const Rd &A, double a, const Rd &B, double b, const Rd &Q, double aq, double bq) { // compule the min_P in [A,B] of p + || PQ || // where p = affine interpolation of a,b on [A,B] // P = (1-l) A + l B ; p = (1-l) a + l b for l in [0,1] double dmin = min(a + aq, b + bq); double ab = b - a; Rd AB(A, B), AQ(A, Q); double ab2 = (AB, AB); Rd H = ab * AB / ab2; // H = d p/ dP double h2 = (H, H); int cas = 0; if (h2 < 1) { cas = 1; double lc = (AQ, AB) / ab2; Rd CQ = AQ - lc * AB; // ( CQ , AB) = 0 Rd C = A + lc * AB; // or Q - CQ assert(abs((CQ, AB)) < 1e-6); double r2 = (CQ, CQ) / ab2; double lpm = lc + copysign(sqrt(r2 * h2 / (1 - h2)), -ab); // lpm in [0,1] if (verbosity > 999) { Rd M = A + lpm * AB; cout << " lgm " << lpm << " r= " << sqrt(r2) << " M= " << M << " Q =" << Q << " ::" << a + lpm * ab << " " << ab << endl; } lpm = max(0., min(1., lpm)); if (lpm > 0. && lpm < 1) { cas = 2; Rd M = A + lpm * AB, MQ(M, Q); dmin = a + lpm * ab + sqrt((MQ, MQ)); /* // check ???? min .... * lpm += 0.001; * MQ=Rd(A +lpm*AB,Q); * double dmin1 = a + lpm*ab + sqrt((MQ,MQ)); * lpm -= 0.002; * MQ=Rd(A +lpm*AB,Q); * double dmin2 = a + lpm*ab + sqrt((MQ,MQ)); * if(verbosity>99) cout << " ### "<< dmin1 << " " << dmin << " " << dmin2 << " " << endl; * ffassert(dmin1 >= dmin1&& dmin2 >= dmin ); */ } } if (verbosity > 99) { cout << " distmin/ AaBaQ " << A << " " << a << " / " << B << " " << b << " / " << Q << " / dmin= " << dmin << " cas =" << cas << endl; } return dmin; } double distmin (const R3 &A, double a, const R3 &B, double b, const R3 &C, double c, const R3 &Q, double aq, double bq, double cq) { // let fA the affine function on ABC const int in = 1; int cas = 0, flat = 0; double dmin = min(min(a + aq, b + bq), c + cq); R3 AB(A, B), AC(A, C), AQ(A, Q); double ab2 = (AB, AB), acab = (AC, AB), ac2 = (AC, AC); double aqab = (AQ, AB), aqac = (AQ, AC); // b ab2 + c acab = aqab // b acab + c ac2 = aqac double pdet = ab2 * ac2 - acab * acab; double pb = (aqab * ac2 - aqac * acab) / pdet; double pc = (ab2 * aqac - aqab * acab) / pdet; double pa = 1 - pb - pc; R3 P = pa * A + pb * B + pc * C;// proj of Q on plan ABC. R3 PQ(P, Q); // PG = grad(fA) double fab = b - a, fac = c - a; if (abs(fab) + abs(fac) < 1e-16) { // const function fA (flat) flat = 1; if (a >= 0. && b >= 0. && c >= 0.) { dmin = a + Norme2(PQ); cas = in; } } else { // Calcul de d FA / dP = R3 AZ = fab * AC - fac * AB; // fA in constant on line AZ R3 AG = AZ ^ PQ;// otho of AZ in ABC : // AG = gb AB + gc AC ; double agab = (AG, AB), agac = (AG, AC); double gab = (agab * ac2 - agac * acab) / pdet; double gac = (ab2 * agac - agab * acab) / pdet; R3 AGG = gab * AB + gac * AC; ffassert(Norme2(AGG - AG) < 1e-6); // verif .. double fag = fab * gab + fac * gac; R3 H = AG / fag; double r2 = (PQ, PQ); double h2 = (H, H); double lpm = -sqrt(r2 * h2 / (1 - h2)); double gb = gab / fag; double gc = gac / fag; double ga = -gb - gc; double am = pa + lpm * ga, bm = pb + lpm * gb, cm = pc + lpm * gc; if (am >= 0 && bm >= 0 && cm > 0.) { R3 M = am * A + bm * B + cm * C; R3 QM(Q, M); dmin = am * a + bm * b + cm * c + Norme2(QM); cas = in; if (debug1) { // verif . { double df1 = ga * a + gb * b + gc * c; cout << "df1 " << df1 << " " << fag << endl; ffassert(abs(df1 - 1) < 1e-6); ffassert(abs((H, PQ)) < 1e-6); ffassert(abs((AZ, PQ)) < 1e-6); ffassert(abs((AG, PQ)) < 1e-6); } { am += 0.001, bm -= 0.001; R3 M = am * A + bm * B + cm * C, QM(Q, M); double dmin1 = am * a + bm * b + cm * c + Norme2(QM); ffassert(dmin <= dmin1); } { bm += 0.001, cm -= 0.001; R3 M = am * A + bm * B + cm * C, QM(Q, M); double dmin2 = am * a + bm * b + cm * c + Norme2(QM); ffassert(dmin <= dmin2); } } } } if (cas != in) { if (flat) { // externe => test 3 bord ... double dminab = a + distmin(A, B, Q, aq, bq); double dminac = a + distmin(A, C, Q, aq, cq); double dminbc = a + distmin(B, C, Q, bq, cq); dmin = min(min(dminab, dminac), min(dminbc, dmin)); } else {// externe => test 3 bord ... double dminab = distmin(A, a, B, b, Q, aq, bq); double dminac = distmin(A, a, C, c, Q, aq, cq); double dminbc = distmin(B, b, C, c, Q, bq, cq); dmin = min(min(dminab, dminac), min(dminbc, dmin)); } } if (debug) { cout << " AaBbCc/q " << dmin << " " << cas << flat << endl; } return dmin; } double distmin (const R3 &A, double a, const R3 &B, double b, const R3 &C, double c, const R3 &Q) { R3 AQ(A, Q), BQ(B, Q), CQ(C, Q); double aq = Norme2(AQ), bq = Norme2(BQ), cq = Norme2(CQ); return distmin(A, a, B, b, C, c, Q, aq, bq, cq); } template double distmin (const Rd &A, double a, const Rd &B, double b, const Rd &Q) { double aq = Norme2(Rd(A, Q)); double bq = Norme2(Rd(B, Q)); return distmin(A, a, B, b, Q, aq, bq); } double distmin (const R3 &A, const R3 &B, const R3 &C, const R3 &Q) { double d = 0; R3 AB(A, B), AC(A, C), AQ(A, Q); double ab2 = (AB, AB), acab = (AC, AB), ac2 = (AC, AC); double aqab = (AQ, AB), aqac = (AQ, AC); // b ab2 + c acab = aqab // b acab + c ac2 = aqac double det = ab2 * ac2 - acab * acab; double b = (aqab * ac2 - aqac * acab) / det; double c = (ab2 * aqac - aqab * acab) / det; double a = 1 - b - c; R3 P = a * A + b * B + c * C; // proj of Q on plan ABC. if (debug) { cout << " distmin ABC/q " << a << " " << b << " " << c << endl; } R3 PQ(P, Q); assert(abs((PQ, AB)) < 1e-7); assert(abs((PQ, AC)) < 1e-7); if (a >= 0. && b >= 0. && c >= 0.) { d = Norme2(PQ); } else { double d1 = distmin(A, B, Q); double d2 = distmin(B, C, Q); double d3 = distmin(C, A, Q); d = min(min(d1, d2), d3); } return d; } typedef Mesh3::Element Tet; int DistanceIso0 (const Tet &K, double *f, double *fK) { int ret = 1; // fk value f const double eps = 1e-16; R3 P[10]; int np = 0; if (abs(f[0]) < eps) {f[0] = 0.; P[np++] = K[0];} if (abs(f[1]) < eps) {f[1] = 0.; P[np++] = K[1];} if (abs(f[2]) < eps) {f[2] = 0.; P[np++] = K[2];} if (abs(f[3]) < eps) {f[3] = 0.; P[np++] = K[3];} for (int e = 0; e < 6; ++e) { int i1 = Tet::nvedge[e][0]; int i2 = Tet::nvedge[e][1]; if ((f[i1] < 0. && f[i2] > 0.) or (f[i1] > 0. && f[i2] < 0.)) { P[np++] = zero(f[i1], K[i1], f[i2], K[i2]); } } if (np && debug) { cout << " np " << np << " " << P[0] << " " << P[1] << " :: " << f[0] << " " << f[1] << " " << f[2] << " " << f[3] << endl; } if (np == 0) {ret = 0;} else if (np == 1) { for (int j = 0; j < 4; ++j) { fK[j] = Norme2(R3(P[0], K[j])); } } else if (np == 2) { for (int j = 0; j < 4; ++j) { fK[j] = distmin(P[0], P[1], (R3)K[j]); } } else if (np == 3 || np == 4) { for (int j = 0; j < 4; ++j) { fK[j] = distmin(P[0], P[1], P[2], (R3)K[j]); } } else { fK[0] = fK[1] = fK[2] = fK[3] = 0.; // } if (debug) { cout << ret << " 3d DistanceIso0 " << np << " " << fK[0] << " " << fK[1] << fK[2] << " " << fK[3] << endl; } return ret; } int DistanceIso0 (const Triangle &K, double *f, double *fK) { // fk value f const double eps = 1e-16; R2 P[6]; int np = 0; if (abs(f[0]) < eps) {f[0] = 0.;} if (abs(f[1]) < eps) {f[1] = 0.;} if (abs(f[2]) < eps) {f[2] = 0.;} int ke[6]; for (int e = 0; e < 3; ++e) { int i1 = (e + 1) % 3; int i2 = (e + 2) % 3; if (f[i1] == 0) { ke[np] = i1, P[np++] = K[i1]; } else if ((f[i1] < 0. && f[i2] > 0.) or (f[i1] > 0. && f[i2] < 0.)) { ke[np] = e; P[np++] = zero(f[i1], K[i1], f[i2], K[i2]); } } if (np && debug) { cout << " np " << np << " " << P[0] << " " << P[1] << " :: " << f[0] << " " << f[1] << " " << f[2] << endl; } if (np == 0) {return 0;} else if (np == 1) { for (int j = 0; j < 3; ++j) { fK[j] = Norme2(R2(P[0], K[j])); } } else if (np == 2) { for (int j = 0; j < 3; ++j) { fK[j] = distmin(P[0], P[1], (R2)K[j]); } } else { fK[0] = fK[1] = fK[2] = 0.; // } if (debug) {cout << np << " DistanceIso0 np=" << " " << fK[0] << " " << fK[1] << " " << fK[2] << endl;} return np; } double CheckDist (double a, double b) { for (int i = 0; i < 30; ++i) { double a = 1, b = 1.1, c = 1.5; R3 A(-0.5, 0.001, 0.002), B(0.5, -0.001, 0.0001), C(0.0001, 1., -0.0003), Q(i * 0.1, 0.001, 1.); double d = distmin(A, a, B, b, C, c, Q); cout << " d = " << i << " == " << d << endl; } return 0; } // fonction determinant les points d'intersection class Distance2d_Op: public E_F0mps { public: Expression eTh, eff, exx; static const int n_name_param = 1; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack, KN *a) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: Distance2d_Op (const basicAC_F0 &args, Expression tth, Expression fff, Expression xxx) : eTh(tth), eff(fff), exx(xxx) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Distance2d_Op::name_param [] = { {"distmax", &typeid(double)} }; pair Add (const Mesh &Th, int kk, int ee, double *fv) { const Triangle &K = Th[kk]; int a = (ee + 1) % 3; int b = (ee + 2) % 3; int q = ee; int ia = Th(kk, a), ib = Th(kk, b), iq = Th(kk, q); double fq = distmin(K[a], fv[ia], K[b], fv[ib], K[q]); if (debug) {cout << iq << " ** add " << kk << " " << ee << " ; " << fq << " :: " << fv[ia] << " " << fv[ib] << " || " << fv[iq] << endl;} return pair(fq, kk * 3 + ee); } pair Add (const Mesh3 &Th, int kk, int ee, double *fv) { typedef Mesh3::Element Tet; const Tet &K = Th[kk]; int a = Tet::nvface[ee][0]; int b = Tet::nvface[ee][1]; int c = Tet::nvface[ee][2]; int q = ee; int ia = Th(kk, a), ib = Th(kk, b), ic = Th(kk, c), iq = Th(kk, q); double fq = distmin(K[a], fv[ia], K[b], fv[ib], K[c], fv[ic], K[q]); if (debug) { cout << " ** add " << kk << " " << ee << " ; " << fq << " :: " << fv[ia] << " " << fv[ib] << " " << fv[ic] << " || " << fv[iq] << endl; } return pair(fq, kk * 4 + ee); } int DistanceIso0 (const Mesh &Th, int k, double *f, double *fv) { typedef Mesh::Element Elem; const int nbve = 3; const Elem &K = Th[k]; int iK[nbve] = {Th(k, 0), Th(k, 1), Th(k, 2)}; R fk[nbve] = {f[iK[0]], f[iK[1]], f[iK[2]]}; // cut here .. double FK[nbve] = {fv[iK[0]], fv[iK[1]], fv[iK[2]]}; int cas = DistanceIso0(K, fk, FK); if (cas > 1) { // OK iso cut triangle // fv[iK[0]] = min(fv[iK[0]], FK[0]); fv[iK[1]] = min(fv[iK[1]], FK[1]); fv[iK[2]] = min(fv[iK[2]], FK[2]); if (debug) { cout << " DistanceIso0 set K" << cas << " " << iK[0] << " " << iK[1] << " " << iK[2] << " " << fv[iK[0]] << " " << fv[iK[1]] << " " << fv[iK[2]] << endl; } } return cas > 1; } int DistanceIso0 (const Mesh3 &Th, int k, double *f, double *fv) { typedef Mesh3::Element Elem; const int nbve = 4; const Elem &K = Th[k]; int iK[nbve] = {Th(k, 0), Th(k, 1), Th(k, 2), Th(k, 3)}; R fk[nbve] = {f[iK[0]], f[iK[1]], f[iK[2]], f[iK[3]]}; // cut here .. double FK[nbve] = {fv[iK[0]], fv[iK[1]], fv[iK[2]], fv[iK[3]]}; int cas = DistanceIso0(K, fk, FK); if (cas > 0) { // OK iso cut triangle // fv[iK[0]] = min(fv[iK[0]], FK[0]); fv[iK[1]] = min(fv[iK[1]], FK[1]); fv[iK[2]] = min(fv[iK[2]], FK[2]); fv[iK[3]] = min(fv[iK[3]], FK[3]); } return cas; } template AnyType Distance (Stack stack, const Mesh *pTh, Expression eff, KN *pxx, double dmax) { typedef typename Mesh::Element Elem; const int nbve = Mesh::Rd::d + 1; debug = 0; if (verbosity > 99) {debug = 1;} // #define mmm min double unset = -std::numeric_limits::max(); double distinf = std::numeric_limits::max(); double distneginf = std::numeric_limits::min(); MeshPoint *mp(MeshPointStack(stack)), mps = *mp; double isovalue = 0.; ffassert(pTh); const Mesh &Th(*pTh); long nbv = Th.nv; // nombre de sommet long nbt = Th.nt; // nombre de triangles // long nbe=Th.neb; // nombre d'aretes fontiere // ffassert(0); typedef KN Rn; typedef KN Zn; typedef pair KEY; // Distance max , vertex i/triangle k= 3*k+i if (verbosity > 2) {cout << " distance max = " << dmax << " nt =" << nbt << endl;} Rn tK(nbt), tV(nbv), f(nbv); pxx->resize(nbv); Rn &fv = *pxx; Zn mK(nbt); mK = 0L; f = unset; fv = distinf; typedef std::priority_queue, std::greater > myPQ; myPQ pqs; vector markT(Th.nt, 1); for (int it = 0; it < Th.nt; ++it) { for (int iv = 0; iv < nbve; ++iv) { int i = Th(it, iv); if (f[i] == unset) { mp->setP(pTh, it, iv); f[i] = GetAny((*eff)(stack)) - isovalue; } } } // find Elem cut by f = 0 // generation of inital data // Pk[3],Gk[3]; long err = 0, nt0 = 0; for (long k = 0; k < Th.nt; ++k) { int cas = DistanceIso0(Th, k, f, fv); if (cas) { ++nt0; markT[k] = 0; } // init } for (long k = 0; k < Th.nt; ++k) { if (markT[k] == 0) { for (int e = 0; e < nbve; ++e) { int ee = e, kk = Th.ElementAdj(k, ee); if (kk >= 0 && (markT[kk] != 0)) { pqs.push(Add(Th, kk, ee, fv)); } } } } // if (verbosity > 3) { cout << " Distance: nb elemets in queue after init" << pqs.size() << " / nb set " << nt0 << endl; } double fm; while (!pqs.empty()) { KEY t = pqs.top(); pqs.pop(); fm = t.first; if (fm > dmax) { break; } int e = t.second % nbve; int k = t.second / nbve; int iq = Th(k, e); if (debug) { cout << iq << " " << fm << " -- k=" << k << " e=" << e << " fv:" << fv[iq] << " / " << markT[k] << endl; } if (markT[k] != 0) {// already done, skeep markT[k] = 0; fv[iq] = min(fm, fv[iq]); for (int e = 0; e < nbve; ++e) { int ee = e, kk = Th.ElementAdj(k, ee); if (kk >= 0 && (markT[kk] != 0)) { pqs.push(Add(Th, kk, ee, fv)); } } } } // clean err = 0; for (int i = 0; i < nbv; ++i) { if (fv[i] == distinf) {fv[i] = dmax; err++;} fv[i] = copysign(fv[i], f[i]); } if (err && fm < dmax) { if (verbosity) {cout << " Distance 2d : we miss some point " << err << endl;} } return err; } AnyType Distance2d_Op::operator () (Stack stack) const { double distinf = std::numeric_limits::max(); double dmax = arg(0, stack, distinf); KN *pxx = 0; pxx = GetAny *>((*exx)(stack)); const Mesh *pTh = GetAny((*eTh)(stack)); return Distance(stack, pTh, eff, pxx, dmax); } class Distance3d_Op: public E_F0mps { public: Expression eTh, eff, exx; static const int n_name_param = 1; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack, KN *a) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: Distance3d_Op (const basicAC_F0 &args, Expression tth, Expression fff, Expression xxx) : eTh(tth), eff(fff), exx(xxx) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Distance3d_Op::name_param [] = { {"distmax", &typeid(double)} }; inline double max (double a, double b, double c) {return max(max(a, b), c);} inline double min (double a, double b, double c) {return min(min(a, b), c);} AnyType Distance3d_Op::operator () (Stack stack) const { double distinf = std::numeric_limits::max(); double dmax = arg(0, stack, distinf); KN *pxx = 0; pxx = GetAny *>((*exx)(stack)); const Mesh3 *pTh = GetAny((*eTh)(stack)); return Distance(stack, pTh, eff, pxx, dmax); } class Distance2d_P1: public OneOperator { public: typedef const Mesh *pmesh; Distance2d_P1 (): OneOperator(atype(), atype(), atype(), atype *>()) {} E_F0*code (const basicAC_F0 &args) const { return new Distance2d_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]) ); } }; class Distance3d_P1: public OneOperator { public: typedef const Mesh3 *pmesh3; Distance3d_P1 (): OneOperator(atype(), atype(), atype(), atype *>()) {} E_F0*code (const basicAC_F0 &args) const { return new Distance3d_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]) ); } }; static void finit () { typedef const Mesh *pmesh; typedef const Mesh3 *pmesh3; Global.Add("distance", "(", new Distance2d_P1); Global.Add("distance", "(", new Distance3d_P1); Global.Add("checkdist", "(", new OneOperator2(CheckDist)); } LOADFUNC(finit);// une variable globale qui serat construite au chargement dynamique freefem++-3.61-1/examples++-load/SaveHB_README000644 000767 000024 00000006124 13321622623 020534 0ustar00hechtstaff000000 000000 ---------------------------------------------------------------------- SaveHB Dynamic Loading Module for FreeFem++ Hiroshi Fujiwara, fujiwara (ATMARK) acs.i.kyoto-u.ac.jp ---------------------------------------------------------------------- ---------------------------------------------------------------------- 1. What is this? ---------------------------------------------------------------------- The module SaveHB.cpp is an implementation for FreeFem++ to save a system of linear equations into a text file in Harwell-Boeing format. The Harwell-Boeing format is a file format to store a system of linear equations with Compressed Column Storage (CCS), which is used in, e.g., Matrix Market (http://math.nist.gov/MatrixMarket) IML++(http://math.nist.gov/iml++) ---------------------------------------------------------------------- 2. Build ---------------------------------------------------------------------- (1) Edit Makefile; Set the appropriate directory, where FreeFem++ was installed, into FREEFEMROOT variable according to your environment. (2) Execute make. Then SaveHB.so (Linux, Solaris), or SaveHB.dylib (MacOSX) is generated. Remark: Windows OS has not been checked. ---------------------------------------------------------------------- 3. Test ---------------------------------------------------------------------- (1) Place 'SaveHB.so' and 'sample.edp' in the same directory, and execute $ FreeFem++-nw sample.edp Then you will get a new file 'sample.hb' there. (2) Compare 'sample.hb' with 'sample.hb.correct'. (3) If you get errors such as ------------------------------ load error : SaveHB fail : ------------------------------ set the directory where SaveHB.so is located to the environment variable FF_LOADPATH. For example, $ FF_LOADPATH="./" FreeFem++-nw sample.edp (in bash/zsh) $ setenv FF_LOADPATH="./" (in csh/tcsh) $ FreeFem++-nw sample.edp ---------------------------------------------------------------------- 4. Usage and Return value ---------------------------------------------------------------------- long SaveHB( HB_filename, A, b, HB_title ); (1) HB_filename : string, filename for output Harwell-Boeing format (2) A : coefficient matrix (3) b : right-hand side vector (4) HB_title : string, title of the file stored in HB file format It returns 0 if success, and returns 1 otherwise. ---------------------------------------------------------------------- 5. Examples ---------------------------------------------------------------------- ------------------------------ Real Version ------------------------------ matrix A = ...; real[int] rhs = ...; load "SaveHB" SaveHB("filename.hb", A, rhs, "Title of HB file"); ------------------------------ Complex Version ------------------------------ matrix A = ...; complex[int] rhs = ...; load "SaveHB" SaveHB("filename.hb", A, rhs, "Title of HB file"); ------------------------------ ---------------------------------------------------------------------- End of file ---------------------------------------------------------------------- freefem++-3.61-1/examples++-load/IpoptVI.edp000644 000767 000024 00000001306 13277333327 020517 0ustar00hechtstaff000000 000000 // Solver - Delta u = f , u < g et u = 0 on Gamma load "ff-Ipopt"; int nn=20; mesh Th=square(nn,nn); fespace Vh(Th,P2); func f = 1.; //rhs function real r=0.03,s=0.1; //some parameters for g func g = r - r/2*exp(-0.5*(square(x-0.5)+square(y-0.5))/square(s)); macro Grad(u) [dx(u),dy(u)]// varf vP(u,v) = int2d(Th)(Grad(u)'*Grad(v)) - int2d(Th)(f*v); matrix A = vP(Vh,Vh,solver=CG); real[int] b = vP(0,Vh); // Warning the boundary condition are given with lb and ub on border // equal value ... Vh u=0; Vh lb=-1.e19; varf vGamma(u,v) = on(1,2,3,4,u=1); real[int] onGamma=vGamma(0,Vh); Vh ub=g; ub[] = onGamma ? 0. : ub[]; lb[] = onGamma ? 0. : lb[]; IPOPT([A,b],u[],lb=lb[],ub=ub[]); plot(u,wait=1); freefem++-3.61-1/examples++-load/metis.cpp000644 000767 000024 00000013615 13312446271 020317 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: metis //ff-c++-cpp-dep: // *INDENT-ON* // #include #include typedef KNM *pRnm; typedef KN *pRn; typedef string *pstring; extern "C" { #include } #ifdef METIS_VER_MAJOR // METIS_PartMeshDual(&ne, &nn, elmnts, &etype, &numflag, &nparts, &edgecut, epart, npart); extern "C" { real_t libmetis__ComputeElementBalance (idx_t ne, idx_t nparts, idx_t *where); } #else typedef idxtype idx_t; #endif template KN*partmetis (Stack s, KN *const &part, Mesh *const &pTh, long const &lparts) { ffassert(pTh); const Mesh &Th(*pTh); idx_t nt = Th.nt, nv = Th.nv; idx_t nve = Mesh::Rd::d + 1; KN eptr(nt + 1), elmnts(nve * nt), epart(nt), npart(nv); for (idx_t k = 0, i = 0; k < nt; ++k) { eptr[k] = i; for (idx_t j = 0; j < nve; j++) { elmnts[i++] = Th(k, j); } eptr[k + 1] = i; } idx_t numflag = 0; idx_t nparts = lparts; idx_t edgecut; idx_t etype = nve - 2; // triangle or tet . change FH fevr 2010 idx_t ncommon = 1; #ifdef METIS_VER_MAJOR if (NO == 0) { METIS_PartMeshNodal(&nt, &nv, eptr, (idx_t *)elmnts, 0, 0, &nparts, 0, 0, &edgecut, (idx_t *)epart, (idx_t *)npart); } else { METIS_PartMeshDual(&nt, &nv, eptr, (idx_t *)elmnts, 0, 0, &ncommon, &nparts, 0, 0, &edgecut, (idx_t *)epart, (idx_t *)npart); } if (verbosity) { printf(" --metisOA: %d-way Edge-Cut: %7d, Balance: %5.2f Nodal=0/Dual %d\n", nparts, nve, libmetis__ComputeElementBalance(nt, nparts, epart), NO); } #else if (NO == 0) { METIS_PartMeshNodal(&nt, &nv, elmnts, &etype, &numflag, &nparts, &edgecut, epart, npart); } else { METIS_PartMeshDual(&nt, &nv, elmnts, &etype, &numflag, &nparts, &edgecut, epart, npart); } if (verbosity) { printf(" --metis: %d-way Edge-Cut: %7d, Balance: %5.2f Nodal=0/Dual %d\n", nparts, nve, ComputeElementBalance(nt, nparts, epart), NO); } #endif part->resize(nt); *part = epart; return part; } KN*partmetisd (Stack s, KN *const &part, Mesh *const &pTh, long const &lparts) { ffassert(pTh); const Mesh &Th(*pTh); idx_t nt = Th.nt, nv = Th.nv; idx_t nve = Mesh::Element::NbV; KN elmnts(nve * nt), epart(nt), npart(nv); for (idx_t k = 0, i = 0; k < nt; ++k) { for (idx_t j = 0; j < nve; j++) { elmnts[i++] = Th(k, j); } } idx_t numflag = 0; idx_t nparts = lparts; idx_t edgecut; idx_t etype = nve - 2; // triangle #ifdef METIS_VER_MAJOR printf(" %d-way Edge-Cut: %7d, Balance: %5.2f\n", nparts, nve, libmetis__ComputeElementBalance(nt, nparts, epart)); #else printf(" %d-way Edge-Cut: %7d, Balance: %5.2f\n", nparts, nve, ComputeElementBalance(nt, nparts, epart)); #endif part->resize(nt); *part = epart; return part; } /* class Init { public: * Init(); * }; * // E_F_StackF0F0 * * $1 */ static void Load_Init () { if (verbosity && mpirank == 0) #ifdef METIS_VER_MAJOR {cout << " lood: init metis (v " << METIS_VER_MAJOR << " )\n";} #else {cout << " lood: init metis (v 4 )\n";} #endif Global.Add("metisnodal", "(", new OneOperator3_ *, KN *, const Mesh *, long, E_F_stackF0F0F0_ *, KN *, const Mesh *, long> >(&partmetis )); Global.Add("metisdual", "(", new OneOperator3_ *, KN *, const Mesh *, long, E_F_stackF0F0F0_ *, KN *, const Mesh *, long> >(&partmetis )); Global.Add("metisnodal", "(", new OneOperator3_ *, KN *, const Mesh3 *, long, E_F_stackF0F0F0_ *, KN *, const Mesh3 *, long> >(&partmetis )); Global.Add("metisdual", "(", new OneOperator3_ *, KN *, const Mesh3 *, long, E_F_stackF0F0F0_ *, KN *, const Mesh3 *, long> >(&partmetis )); Global.Add("metisnodal", "(", new OneOperator3_ *, KN *, const Mesh *, long, E_F_stackF0F0F0_ *, KN *, const Mesh *, long> >(&partmetis )); Global.Add("metisdual", "(", new OneOperator3_ *, KN *, const Mesh *, long, E_F_stackF0F0F0_ *, KN *, const Mesh *, long> >(&partmetis )); Global.Add("metisnodal", "(", new OneOperator3_ *, KN *, const Mesh3 *, long, E_F_stackF0F0F0_ *, KN *, const Mesh3 *, long> >(&partmetis )); Global.Add("metisdual", "(", new OneOperator3_ *, KN *, const Mesh3 *, long, E_F_stackF0F0F0_ *, KN *, const Mesh3 *, long> >(&partmetis )); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/MetricKuate.edp000644 000767 000024 00000006734 13256636774 021425 0ustar00hechtstaff000000 000000 load "MetricKuate" mesh Th=square(5,5,[(x-0.5)*2,(y-0.5)*2]); real x0,y0;// pour definir l'err forme n lineare en x0,y0 real coef =1; fespace Vh(Th,P1); fespace Wh(Th,P2); fespace Ph(Th,P0); real c=10; func f = tanh(c * (sin( (5 * y)) - (2 * x))) + (y * x * x) + pow( y, 3);; func fxxx = 0.16e2 * pow(0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1), 0.2e1) * pow(c, 0.3e1) - 0.32e2 * pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * pow(c, 0.3e1); func fxxy = -0.40e2 * pow(0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1), 0.2e1) * pow(c, 0.3e1) * cos( (5 * y)) + 0.80e2 * pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * pow(c, 0.3e1) * cos( (5 * y)) + 0.2e1; func fxyy = 0.100e3 * pow(0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1), 0.2e1) * pow(c, 0.3e1) * pow(cos( (5 * y)), 0.2e1) - 0.200e3 * pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * pow(c, 0.3e1) * pow(cos( (5 * y)), 0.2e1) - 0.100e3 * tanh(c * (sin( (5 * y)) - (2 * x))) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * c * c * sin( (5 * y)); func fyyy = -0.250e3 * pow(0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1), 0.2e1) * pow(c, 0.3e1) * pow(cos( (5 * y)), 0.3e1) + 0.500e3 * pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * pow(c, 0.3e1) * pow(cos( (5 * y)), 0.3e1) + 0.750e3 * tanh(c * (sin( (5 * y)) - (2 * x))) * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * c * c * cos( (5 * y)) * sin( (5 * y)) - 0.125e3 * (0.1e1 - pow(tanh(c * (sin( (5 * y)) - (2 * x))), 0.2e1)) * c * cos( (5 * y)) + 0.6e1; /* real p=20; real p3=p-3, p321=p*(p-1)*(p-2); func f= x^p + y^p; func fxxx = p321*x; func fyyy = p321*y; func fxxy=0.; func fxyy=0.; */ func err=(fxxx*x0*x0*x0+3*fxxy*x0*x0*y0+3*fxyy*x0*y0*y0+fyyy*y0*y0*y0 )*coef; for(int i=1;i<4;i++) { Vh m11,m12,m22; coef = 1; Wh f2=f; MetricKuate(Th,200,0.0001,3,err,[m11[],m12[],m22[]],[x0,y0]); // plot(m11,m22,wait=1,cmm="mmmm"); real cc=10; Th=adaptmesh(Th,cc*m11,cc*m12,cc*m22,IsMetric=1,inquire=1,hmin=0.00001,nbvx=1000000); cout << m11[].max << " " << m12[].max << " " << m22[].max << endl; plot(Th,wait=1,ps="Th.eps"); plot(f2,wait=1); Ph eh = (abs(f2-f)); Ph leh= log10(eh); real[int] viso=[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1]; plot(leh,fill=1,wait=1,viso=viso,value=1,ps="leh.eps"); cout << i << " .... " << eh[].min << " "<< eh[].max << " "<< eh[].sum/eh[].n << " " << int2d(Th)(eh)/Th.area << " " << Th.nt << " " << Th.nv << endl; } Th=square(5,5,[(x-0.5)*2,(y-0.5)*2]); // FFCS - regression tests real regtest; real cerr= 0.005*(0.000961606/0.000582183)^0.66; for(int i=1;i<4;i++) { Vh m11,m12,m22; coef = 1; Wh f2=f; real cc=10; Th=adaptmesh(Th,f,err=cerr,inquire=1,hmin=0.00001,nbvx=1000000); cout << m11[].max << " " << m12[].max << " " << m22[].max << endl; plot(Th,wait=1,ps="Th2.eps"); plot(f2,wait=1); Ph eh = (abs(f2-f)); Ph leh= log10(eh); real[int] viso=[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1]; plot(leh,fill=1,wait=1,viso=viso,value=1,ps="leh2.eps"); cout << i << " .... " << eh[].min << " "<< eh[].max << " "<< eh[].sum/eh[].n << " " << int2d(Th)(eh)/Th.area << " " << Th.nt << " " << Th.nv << endl; regtest=eh[]'*eh[];//' } freefem++-3.61-1/examples++-load/regtests.m4000644 000767 000024 00000001225 13256636774 020606 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ include(../regtests.m4) // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. ONETEST(load,uh[].max,0.0001) ONETEST(testFE) ONETEST(testFEMorley) ONETEST(funcTemplate) ONETEST( LapDG3) ONETEST( LapDG4) ONETEST( LaplaceP3) ONETEST( LaplaceP4) ONETEST( bilapMorley) ONETEST( plot-fb-P3) ONETEST( plot-fb-P3dc) ONETEST( plot-fb-P4) ONETEST( plot-fb-P4dc) ONETEST( splitmesh3) ONETEST( splitmesh6) ONETEST( testFE-PkEdge) ONETEST( testFE) ONETEST( testFEMorley) freefem++-3.61-1/examples++-load/IpoptMinSurfVol.edp000644 000767 000024 00000015057 13256636774 022266 0ustar00hechtstaff000000 000000 // this exemple is buggus in some case ... // strange ... FH. , S Auliac (will be correct in test ???) // remove the test (no loop) int nadapt=0;// 3 is teh previous value.. load "msh3"; load "medit"; load "ff-Ipopt"; real alpha=0.9; int np=30; mesh Th = square(2*np,np,[2*pi*x,pi*y]); // FFCS regression reference value real regtest; fespace Vh(Th,P1,periodic=[[2,y],[4,y]/*,[1,x],[3,x]*/]); /* * Initial shape definition * outside of the mesh adaptation loop to initialize with the previous optimial shape found on further iterations */ Vh startshape=5;//+0.5*(cos(10*x)*sin(10*y)*sin(y)); //uz,lz,lm : dual variables storage for the warmstart Vh uz=1.,lz=1.; real[int] lm=[1]; for(int kkk=0;kkk. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: tetgen //ff-c++-cpp-dep: // *INDENT-ON* // /* * Thank to the ARN () FF2A3 grant * ref:ANR-07-CIS7-002-01 */ // FH July 2009 // comment all // Th3_t->BuildBound(); // Th3_t->BuildAdj(); // Th3_t->Buildbnormalv(); // Th3_t->BuildjElementConteningVertex(); // is now in the constructor of Mesh3 to be consistante. // #include "ff++.hpp" #include "msh3.hpp" #define TETLIBRARY #include "tetgen.h" using namespace Fem2D; /* * // function to return inside point in a volume mesh * // A rajouter par la suite // * void insidepoint( const Mesh3 &Th3 * */ // subroutine use for tetegen call typedef const Mesh3 *pmesh3; void mesh3_tetgenio_out (const tetgenio &out, Mesh3 &Th3); void mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, Mesh3 &Th3); void mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, const int &label_face, Mesh3 &Th3); Mesh3*mesh3_tetgenio_out (const tetgenio &out); Mesh3*mesh3_tetgenio_out (const tetgenio &out, const int &label_tet); Mesh3*mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, const int &label_face); Mesh3*Convexhull_3Dpoints (char *switch_tetgen, const int &nv_t, const double *Xcoord, const double *Ycoord, const double *Zcoord, const int &label_tet); Mesh3*RemplissageSurf3D_tetgen (char *switch_tetgen, const Mesh3 &Th3, const int &label_tet); Mesh3*RemplissageSurf3D_tetgen_new (char *switch_tetgen, const Mesh3 &Th3, const int &label_tet, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl); Mesh3*Transfo_Mesh2_tetgen (const double &precis_mesh, char *switch_tetgen, const Mesh &Th2, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_border, int &point_confondus_ok, const int &label_tet, const map &maptri); Mesh3*Transfo_Mesh2_tetgen_new (const double &precis_mesh, char *switch_tetgen, const Mesh &Th2, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_border, int &point_confondus_ok, const int &label_tet, const map &maptri, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl); Mesh3*ReconstructionRefine_tetgen (char *switch_tetgen, const Mesh3 &Th3, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl, const double *tsizevol); class Build2D3D_Op: public E_F0mps { public: Expression eTh; Expression xx, yy, zz; static const int n_name_param = 13 + 2; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: Build2D3D_Op (const basicAC_F0 &args, Expression tth) : eTh(tth), xx(0), yy(0), zz(0) { if (verbosity) {cout << "construction par BuilLayeMesh_Op" << endl;} args.SetNameParam(n_name_param, name_param, nargs); const E_Array *a1 = 0; if (nargs[0]) {a1 = dynamic_cast(nargs[0]);} int err = 0; if (a1) { if (a1->size() != 3) { CompileError("Build2D3D (Th,transfo=[X,Y,Z],) "); } xx = to((*a1)[0]); yy = to((*a1)[1]); zz = to((*a1)[2]); } if (nargs[2] && nargs[13]) { CompileError("uncompatible movemesh3 (Th, region= , reftet= "); } if (nargs[3] && nargs[14]) { CompileError("uncompatible movemesh3 (Th, label= , refface= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Build2D3D_Op::name_param [] = { {"transfo", &typeid(E_Array)}, // 0 {"switch", &typeid(string *)}, {"reftet", &typeid(long)}, // 2 {"refface", &typeid(KN_)},// 3 {"facemerge", &typeid(long)}, {"ptmerge", &typeid(double)}, // nouvelle variable {"nbofholes", &typeid(long)}, // 6 {"holelist", &typeid(KN_)}, {"nbofregions", &typeid(long)}, {"regionlist", &typeid(KN_)}, {"nboffacetcl", &typeid(long)}, {"facetcl", &typeid(KN_)}, // 11 // mesure mesh {"mesuremesh", &typeid(long)}, {"region", &typeid(long)}, // 13 {"label", &typeid(KN_)} // 14 }; class Build2D3D: public OneOperator { public: Build2D3D (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Build2D3D_Op(args, t[0]->CastTo(args[0])); } }; AnyType Build2D3D_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh *pTh = GetAny((*eTh)(stack)); ffassert(pTh); Mesh &Th = *pTh; Mesh *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int neb = Th.neb; // nombre d'aretes fontiere if (verbosity) {cout << " Vertex Triangle Border " << nbv << " " << nbt << " " << neb << endl;} if (verbosity > 1) {cout << " ======================= " << endl;} if (verbosity > 1) {cout << " == Build2D_3D_Op==" << endl;} KN zzempty; string stringempty = string("pqaAAYCQ"); string *switch_tet = (arg(1, stack, &stringempty)); int label_tet(arg(2, stack, arg(13, stack, 0L))); KN nrf(arg(3, stack, arg(14, stack, zzempty))); int point_confondus_ok(arg(4, stack, 0L)); double precis_mesh(arg(5, stack, -1.)); // new parameters KN zdzempty; int nbhole(arg(6, stack, 0L)); KN tabhole(arg(7, stack, zdzempty)); int nbregion(arg(8, stack, 0L)); KN tabregion(arg(9, stack, zdzempty)); int nbfacecl(arg(10, stack, 0L)); KN tabfacecl(arg(11, stack, zdzempty)); if (nbhole && nbhole * 3 != tabhole.N()) {ExecError(" nbhole and holes are incompatibale ");} if (!nbhole) { nbhole = tabhole.N() / 3; // modif FH dec 2010... } // mesuremesh parameters int mesureM(arg(12, stack, 1L)); int surface_orientation = 1; if (mesureM < 0) { surface_orientation = -1; } if (nbregion == 0) {nbregion = tabregion.N() / 5;} if (nbhole == 0) {nbhole = tabhole.N() / 3;} if (nbfacecl == 0) {nbfacecl = tabfacecl.N() / 2;} // assertion au niveau de la taille ffassert(tabhole.N() == 3 * nbhole); ffassert(tabregion.N() == 5 * nbregion); ffassert(tabfacecl.N() == 2 * nbfacecl); //= =================================== // How to change string* into char* //= =================================== cout << "string" << switch_tet << endl; size_t size_switch_tet = switch_tet->size() + 1; char *switch_tetgen = new char[size_switch_tet]; strncpy(switch_tetgen, switch_tet->c_str(), size_switch_tet); cout << "switch_tetgen=" << switch_tetgen << endl; // exit(1); ffassert(nrf.N() % 2 == 0); map mapf; for (int i = 0; i < nrf.N(); i += 2) { if (nrf[i] != nrf[i + 1]) { mapf[nrf[i]] = nrf[i + 1]; } } map mapfme; Transfo_Mesh2_map_face(Th, mapfme); // Map utilisateur map::iterator imap; for (int ii = 0; ii < nrf.N(); ii += 2) { imap = mapfme.find(nrf[ii]); if (imap != mapfme.end()) { imap->second = nrf[ii + 1]; } } // KN txx(nbv), tyy(nbv), tzz(nbv); // KN takemesh(nbv); double *txx = new double[nbv]; double *tyy = new double[nbv]; double *tzz = new double[nbv]; int *takemesh = new int[nbv]; MeshPoint *mp3(MeshPointStack(stack)); for (int ii = 0; ii < nbv; ii++) { takemesh[ii] = 0; } Mesh &rTh = Th; for (int it = 0; it < nbt; ++it) { for (int iv = 0; iv < 3; ++iv) { int i = Th(it, iv); if (takemesh[i] == 0) { mp3->setP(&Th, it, iv); if (xx) { txx[i] = GetAny((*xx)(stack)); } if (yy) { tyy[i] = GetAny((*yy)(stack)); } if (zz) { tzz[i] = GetAny((*zz)(stack)); } takemesh[i] = takemesh[i] + 1; } } } delete [] takemesh; int border_only = 0; int recollement_border = 1; /* * Mesh3 *Th3=Transfo_Mesh2_tetgen( precis_mesh, switch_tetgen, Th, txx, tyy, tzz, border_only, * recollement_border, point_confondus_ok, label_tet, mapfme); */ Mesh3 *Th3_tmp = MoveMesh2_func(precis_mesh, Th, txx, tyy, tzz, border_only, recollement_border, point_confondus_ok); /* delete array */ delete [] txx; delete [] tyy; delete [] tzz; /* check orientation of the mesh and flip if necessary*/ Th3_tmp->flipSurfaceMesh3(surface_orientation); int addcheckorientation = 0; if (addcheckorientation == 1) { if (verbosity > 0) { cout << "check :: orientation des surfaces" << endl; } Th3_tmp->BuildBoundaryElementAdj(); if (verbosity > 0) { cout << "fin check :: orientation des surfaces" << endl; } } /* set label of surface Th3_tmp */ for (int ii = 0; ii < Th3_tmp->nbe; ii++) { const Triangle3 &K(Th3_tmp->be(ii)); int iv[3]; int lab; iv[0] = Th3_tmp->operator () (K[0]); iv[1] = Th3_tmp->operator () (K[1]); iv[2] = Th3_tmp->operator () (K[2]); map::const_iterator imap; imap = mapfme.find(K.lab); if (imap != mapfme.end()) { lab = imap->second; } else { lab = K.lab; } Th3_tmp->be(ii).set(Th3_tmp->vertices, iv, lab); } /* mesh domains with tetgen */ Mesh3 *Th3 = RemplissageSurf3D_tetgen_new(switch_tetgen, *Th3_tmp, label_tet, nbhole, tabhole, nbregion, tabregion, nbfacecl, tabfacecl); /* * Mesh3 *Th3=Transfo_Mesh2_tetgen_new( precis_mesh, switch_tetgen, Th, txx, tyy, tzz, border_only, * recollement_border, point_confondus_ok, label_tet, mapfme, * nbhole, tabhole, nbregion, tabregion, nbfacecl,tabfacecl); * */ delete Th3_tmp; // Th3->BuildBound(); // Th3->BuildAdj(); // Th3->Buildbnormalv(); // Th3->BuildjElementConteningVertex(); Th3->BuildGTree(); // Th3->decrement(); Add2StackOfPtr2FreeRC(stack, Th3); delete [] switch_tetgen; *mp = mps; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return Th3; } // Fonction pour tetgen // new parameter void mesh3_tetgenio_out (const tetgenio &out, Mesh3 &Th3) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); // new parameter if (out.numberoftetrahedronattributes != 1) { cout << "out.numberoftetrahedronattributes" << out.numberoftetrahedronattributes << endl; } i = 0; for (int nnv = 0; nnv < Th3.nv; nnv++) { Th3.vertices[nnv].x = out.pointlist[i]; Th3.vertices[nnv].y = out.pointlist[i + 1]; Th3.vertices[nnv].z = out.pointlist[i + 2]; Th3.vertices[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } i = 0; for (int nnt = 0; nnt < Th3.nt; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; // lab = label_tet; for (int jj = 0; jj < 4; jj++) { assert(iv[jj] >= 0 && iv[jj] < Th3.nv); } // cout << "nnt= " << nnt << " " << lab << " " << out.tetrahedronattributelist[nnt] << endl; lab = out.tetrahedronattributelist[nnt]; // cout << "nnt= " << lab << " " << out.tetrahedronattributelist[nnt] << endl; Th3.elements[nnt].set(Th3.vertices, iv, lab); i = i + 4; } for (int ibe = 0; ibe < Th3.nbe; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; for (int jj = 0; jj < 3; jj++) { if (iv[jj] >= Th3.nv || iv[jj] < 0) {cout << "iv[jj]=" << iv[jj] << " triangle" << ibe << endl;} assert(iv[jj] >= 0 && iv[jj] < Th3.nv); } Th3.be(ibe).set(Th3.vertices, iv, out.trifacemarkerlist[ibe]); } /* * if( out.numberoftetrahedronattributes != 1 ){ * cout << "out.numberoftetrahedronattributes" << out.numberoftetrahedronattributes << endl; * exit(1); * } */ } void mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, Mesh3 &Th3) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); i = 0; for (int nnv = 0; nnv < Th3.nv; nnv++) { Th3.vertices[nnv].x = out.pointlist[i]; Th3.vertices[nnv].y = out.pointlist[i + 1]; Th3.vertices[nnv].z = out.pointlist[i + 2]; Th3.vertices[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } i = 0; for (int nnt = 0; nnt < Th3.nt; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; lab = label_tet; // lab = out.tetrahedronmarkerlist[nnt]; Th3.elements[nnt].set(Th3.vertices, iv, lab); i = i + 4; } for (int ibe = 0; ibe < Th3.nbe; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; Th3.be(ibe).set(Th3.vertices, iv, out.trifacemarkerlist[ibe]); } } void mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, const int &label_face, Mesh3 &Th3) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); i = 0; for (int nnv = 0; nnv < Th3.nv; nnv++) { Th3.vertices[nnv].x = out.pointlist[i]; Th3.vertices[nnv].y = out.pointlist[i + 1]; Th3.vertices[nnv].z = out.pointlist[i + 2]; Th3.vertices[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } i = 0; for (int nnt = 0; nnt < Th3.nt; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; lab = label_tet; // lab = out.tetrahedronmarkerlist[nnt]; Th3.elements[nnt].set(Th3.vertices, iv, lab); i = i + 4; } if (verbosity) {cout << &out.trifacemarkerlist << endl;} for (int ibe = 0; ibe < Th3.nbe; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; Th3.be(ibe).set(Th3.vertices, iv, label_face); } } // verison Mesh3 * Mesh3*mesh3_tetgenio_out (const tetgenio &out) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } // Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); // new parameter if (out.numberoftetrahedronattributes != 1) { cout << "out.numberoftetrahedronattributes" << out.numberoftetrahedronattributes << endl; } Vertex3 *v = new Vertex3[out.numberofpoints]; Tet *t = new Tet[out.numberoftetrahedra]; Tet *tt = t; Triangle3 *b = new Triangle3[out.numberoftrifaces]; Triangle3 *bb = b; i = 0; for (int nnv = 0; nnv < out.numberofpoints; nnv++) { v[nnv].x = out.pointlist[i]; v[nnv].y = out.pointlist[i + 1]; v[nnv].z = out.pointlist[i + 2]; v[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } // test pour la distance minimale entre les points // { // double dist,dist1; // dist = 1000000000000.; // for(int nnv=0; nnv" < 1e-10 ) cout << v[nnv] << " " << v[nnv1] << endl; // } // } // } // cout << "dist entre les points du maillage tetgen" << dist << endl; // } i = 0; for (int nnt = 0; nnt < out.numberoftetrahedra; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; // lab = label_tet; for (int jj = 0; jj < 4; jj++) { assert(iv[jj] >= 0 && iv[jj] < out.numberofpoints); } // cout << "nnt= " << nnt << " " << lab << " " << out.tetrahedronattributelist[nnt] << endl; lab = out.tetrahedronattributelist[nnt]; // cout << "nnt= " << lab << " " << out.tetrahedronattributelist[nnt] << endl; // Th3.elements[nnt].set( Th3.vertices, iv, lab); (*tt++).set(v, iv, lab); i = i + 4; } for (int ibe = 0; ibe < out.numberoftrifaces; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; for (int jj = 0; jj < 3; jj++) { if (iv[jj] >= out.numberofpoints || iv[jj] < 0) {cout << "iv[jj]=" << iv[jj] << " triangle" << ibe << endl;} assert(iv[jj] >= 0 && iv[jj] < out.numberofpoints); } // Th3.be(ibe).set( Th3.vertices, iv, out.trifacemarkerlist[ibe]); (*bb++).set(v, iv, out.trifacemarkerlist[ibe]); } Mesh3 *T_TH3 = new Mesh3(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces, v, t, b); cout << "FreeFem++: Check mesh given by tetgen" << endl; // return T_TH3; if (TestElementMesh3(*T_TH3) != 1) { return T_TH3; } else { // Mesh3 *T2_TH3 = TestElementMesh3_patch( *T_TH3 ); // return T2_TH3; exit(1); } } Mesh3*mesh3_tetgenio_out (const tetgenio &out, const int &label_tet) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } // Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); Vertex3 *v = new Vertex3[out.numberofpoints]; Tet *t = new Tet[out.numberoftetrahedra]; Tet *tt = t; Triangle3 *b = new Triangle3[out.numberoftrifaces]; Triangle3 *bb = b; i = 0; for (int nnv = 0; nnv < out.numberofpoints; nnv++) { v[nnv].x = out.pointlist[i]; v[nnv].y = out.pointlist[i + 1]; v[nnv].z = out.pointlist[i + 2]; v[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } i = 0; for (int nnt = 0; nnt < out.numberoftetrahedra; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; lab = label_tet; // lab = out.tetrahedronmarkerlist[nnt]; // Th3.elements[nnt].set( Th3.vertices, iv, lab); (*tt++).set(v, iv, lab); i = i + 4; } for (int ibe = 0; ibe < out.numberoftrifaces; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; // Th3.be(ibe).set( Th3.vertices, iv, out.trifacemarkerlist[ibe]); (*bb++).set(v, iv, out.trifacemarkerlist[ibe]); } Mesh3 *T_TH3 = new Mesh3(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces, v, t, b); // return T_TH3; cout << "FreeFem++: Check mesh given by tetgen" << endl; if (TestElementMesh3(*T_TH3) != 1) { return T_TH3; } else { // cout << "patch pour tetgen " << endl; // Mesh3 *T2_TH3 = TestElementMesh3_patch( *T_TH3 ); // return T2_TH3; exit(1); } } Mesh3*mesh3_tetgenio_out (const tetgenio &out, const int &label_tet, const int &label_face) { int i; // All indices start from 1. if (out.firstnumber != 1) { cout << " probleme ???" << endl; exit(1); } if (out.numberoffacets != 0) { cout << "tetgen: faces non triangulaire" << endl; exit(1); } if (out.numberofcorners != 4) { cout << "tetgen: element subparametric of order 2" << endl; exit(1); } if (verbosity) { cout << "Th3 :: Vertex Element Border :: " << out.numberofpoints << " " << out.numberoftetrahedra << " " << out.numberoftrifaces << endl; } // Th3.set(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces); Vertex3 *v = new Vertex3[out.numberofpoints]; Tet *t = new Tet[out.numberoftetrahedra]; Tet *tt = t; Triangle3 *b = new Triangle3[out.numberoftrifaces]; Triangle3 *bb = b; i = 0; for (int nnv = 0; nnv < out.numberofpoints; nnv++) { v[nnv].x = out.pointlist[i]; v[nnv].y = out.pointlist[i + 1]; v[nnv].z = out.pointlist[i + 2]; v[nnv].lab = out.pointmarkerlist[nnv]; i = i + 3; } i = 0; for (int nnt = 0; nnt < out.numberoftetrahedra; nnt++) { int iv[4], lab; iv[0] = out.tetrahedronlist[i] - 1; iv[1] = out.tetrahedronlist[i + 1] - 1; iv[2] = out.tetrahedronlist[i + 2] - 1; iv[3] = out.tetrahedronlist[i + 3] - 1; lab = label_tet; // lab = out.tetrahedronmarkerlist[nnt]; // Th3.elements[nnt].set( Th3.vertices, iv, lab); (*tt++).set(v, iv, lab); i = i + 4; } if (verbosity) {cout << &out.trifacemarkerlist << endl;} for (int ibe = 0; ibe < out.numberoftrifaces; ibe++) { int iv[3]; iv[0] = out.trifacelist[3 * ibe] - 1; iv[1] = out.trifacelist[3 * ibe + 1] - 1; iv[2] = out.trifacelist[3 * ibe + 2] - 1; // Th3.be(ibe).set( Th3.vertices, iv, label_face); (*bb++).set(v, iv, label_face); } Mesh3 *T_TH3 = new Mesh3(out.numberofpoints, out.numberoftetrahedra, out.numberoftrifaces, v, t, b); if (TestElementMesh3(*T_TH3) != 1) { return T_TH3; } else { exit(1); // Mesh3 *T2_TH3 = TestElementMesh3_patch( *T_TH3 ); // return T2_TH3; } } Mesh3*Convexhull_3Dpoints (char *switch_tetgen, const int &nv_t, const double *Xcoord, const double *Ycoord, const double *Zcoord, const int &label_tet, const int &label_face) { // Mesh3 *T_Th3= new Mesh3; tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity > 3) { cout << " tetgenio: vertex " << endl; } int itet, jtet; in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Xcoord[nnv]; in.pointlist[itet + 1] = Ycoord[nnv]; in.pointlist[itet + 2] = Zcoord[nnv]; in.pointmarkerlist[nnv] = 0; itet = itet + 3; } assert(itet == in.numberofpoints * 3); in.numberoffacets = 0; if (verbosity > 1) {cout << "tetgen: before tetrahedralize( , &in, &out): switch=" << switch_tetgen << endl;} tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 1) {cout << "tetgen: finish tetrahedralize( , &in, &out);" << endl;} // mesh3_tetgenio_out( out, label_tet, label_face,*T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out, label_tet, label_face); if (verbosity > 1) {cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl;} if (verbosity > 1) {cout << "FreeFem++: End check mesh given by tetgen" << endl;} return T_Th3; } Mesh3*RemplissageSurf3D_tetgen (char *switch_tetgen, const Mesh3 &Th3, const int &label_tet) { // Mesh3 *T_Th3= new Mesh3; assert(Th3.nt == 0); int nv_t = Th3.nv; int nt_t = Th3.nt; int nbe_t = Th3.nbe; if (verbosity) {cout << "3D RemplissageSurf3D:: Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Th3.vertices[nnv].x; in.pointlist[itet + 1] = Th3.vertices[nnv].y; in.pointlist[itet + 2] = Th3.vertices[nnv].z; in.pointmarkerlist[nnv] = Th3.vertices[nnv].lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); if (verbosity) {cout << " tetgenio: facet " << endl;} // Version avec des facettes in.numberoffacets = nbe_t; in.facetlist = new tetgenio::facet[in.numberoffacets]; in.facetmarkerlist = new int[in.numberoffacets]; for (int ibe = 0; ibe < nbe_t; ibe++) { tetgenio::facet *f; tetgenio::polygon *p; f = &in.facetlist[ibe]; f->numberofpolygons = 1; f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; f->numberofholes = 0; f->holelist = NULL; p = &f->polygonlist[0]; p->numberofvertices = 3; p->vertexlist = new int[3]; // creation of elements const Triangle3 &K(Th3.be(ibe));// const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 p->vertexlist[0] = Th3.operator () (K[0]) + 1; p->vertexlist[1] = Th3.operator () (K[1]) + 1; p->vertexlist[2] = Th3.operator () (K[2]) + 1; for (int kkk = 0; kkk < 3; kkk++) { assert(p->vertexlist[kkk] <= in.numberofpoints && p->vertexlist[kkk] > 0); } in.facetmarkerlist[ibe] = K.lab; } if (verbosity > 1) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 1) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } // mesh3_tetgenio_out( out, label_tet, *T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out, label_tet); if (verbosity > 1) { cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } Mesh3*RemplissageSurf3D_tetgen_new (char *switch_tetgen, const Mesh3 &Th3, const int &label_tet, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl) { // Mesh3 *T_Th3= new Mesh3; assert(Th3.nt == 0); int nv_t = Th3.nv; int nt_t = Th3.nt; int nbe_t = Th3.nbe; if (verbosity) {cout << "3D RemplissageSurf3D:: Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Th3.vertices[nnv].x; in.pointlist[itet + 1] = Th3.vertices[nnv].y; in.pointlist[itet + 2] = Th3.vertices[nnv].z; in.pointmarkerlist[nnv] = Th3.vertices[nnv].lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); if (verbosity) {cout << " tetgenio: facet " << endl;} // Version avec des facettes in.numberoffacets = nbe_t; in.facetlist = new tetgenio::facet[in.numberoffacets]; in.facetmarkerlist = new int[in.numberoffacets]; for (int ibe = 0; ibe < nbe_t; ibe++) { tetgenio::facet *f; tetgenio::polygon *p; f = &in.facetlist[ibe]; f->numberofpolygons = 1; f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; f->numberofholes = 0; f->holelist = NULL; p = &f->polygonlist[0]; p->numberofvertices = 3; p->vertexlist = new int[3]; // creation of elements const Triangle3 &K(Th3.be(ibe));// const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 p->vertexlist[0] = Th3.operator () (K[0]) + 1; p->vertexlist[1] = Th3.operator () (K[1]) + 1; p->vertexlist[2] = Th3.operator () (K[2]) + 1; for (int kkk = 0; kkk < 3; kkk++) { assert(p->vertexlist[kkk] <= in.numberofpoints && p->vertexlist[kkk] > 0); } in.facetmarkerlist[ibe] = K.lab; } // mise a jour des nouvelles variables in.numberofholes = nbhole; in.holelist = new REAL[3 * nbhole]; for (int ii = 0; ii < 3 * in.numberofholes; ii++) { in.holelist[ii] = tabhole[ii]; } in.numberofregions = nbregion; in.regionlist = new REAL[5 * nbregion]; for (int ii = 0; ii < 5 * in.numberofregions; ii++) { in.regionlist[ii] = tabregion[ii]; } in.numberoffacetconstraints = nbfacecl; in.facetconstraintlist = new REAL[2 * in.numberoffacetconstraints]; for (int ii = 0; ii < 2 * in.numberoffacetconstraints; ii++) { in.facetconstraintlist[ii + 1] = tabfacecl[ii + 1]; } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; cout << "numberof regions " << in.numberofregions << endl; cout << "numberof hole " << in.numberofholes << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 0) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } // mesh3_tetgenio_out( out, *T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out); if (verbosity > 0) { cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } Mesh3*RemplissageSurf3D_tetgen_new (char *switch_tetgen, const Mesh3 &Th3, const int &label_tet, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl, const int &nbinside, const double *InsidePoint, const int &sizeofmetric, const double *metric) { // Mesh3 *T_Th3= new Mesh3; assert(Th3.nt == 0); int nv_t = Th3.nv; int nt_t = Th3.nt; int nbe_t = Th3.nbe; if (verbosity) {cout << "3D RemplissageSurf3D:: Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; tetgenio addin; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Th3.vertices[nnv].x; in.pointlist[itet + 1] = Th3.vertices[nnv].y; in.pointlist[itet + 2] = Th3.vertices[nnv].z; in.pointmarkerlist[nnv] = Th3.vertices[nnv].lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); // Add inside point if (nbinside) { cout << "nbinside=" << nbinside << endl; addin.firstnumber = 1; addin.numberofpoints = nbinside; addin.pointlist = new REAL[3 * nbinside]; addin.pointmarkerlist = new int[addin.numberofpoints]; for (int nnv = 0; nnv < 3 * nbinside; nnv++) { addin.pointlist[nnv] = InsidePoint[nnv]; } for (int nnv = 0; nnv < nbinside; nnv++) { addin.pointmarkerlist[nnv] = 111; } } // Add metric if (sizeofmetric) { cout << "sizeofmetric=" << sizeofmetric << endl; in.numberofpointmtrs = sizeofmetric; in.pointmtrlist = new REAL[in.numberofpointmtrs * in.numberofpoints]; for (int nnv = 0; nnv < in.numberofpointmtrs * in.numberofpoints; nnv++) { in.pointmtrlist[nnv] = metric[nnv]; } } if (verbosity) {cout << " tetgenio: facet " << endl;} // Version avec des facettes in.numberoffacets = nbe_t; in.facetlist = new tetgenio::facet[in.numberoffacets]; in.facetmarkerlist = new int[in.numberoffacets]; for (int ibe = 0; ibe < nbe_t; ibe++) { tetgenio::facet *f; tetgenio::polygon *p; f = &in.facetlist[ibe]; f->numberofpolygons = 1; f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; f->numberofholes = 0; f->holelist = NULL; p = &f->polygonlist[0]; p->numberofvertices = 3; p->vertexlist = new int[3]; // creation of elements const Triangle3 &K(Th3.be(ibe));// const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 p->vertexlist[0] = Th3.operator () (K[0]) + 1; p->vertexlist[1] = Th3.operator () (K[1]) + 1; p->vertexlist[2] = Th3.operator () (K[2]) + 1; for (int kkk = 0; kkk < 3; kkk++) { assert(p->vertexlist[kkk] <= in.numberofpoints && p->vertexlist[kkk] > 0); } in.facetmarkerlist[ibe] = K.lab; } // mise a jour des nouvelles variables in.numberofholes = nbhole; in.holelist = new REAL[3 * nbhole]; for (int ii = 0; ii < 3 * in.numberofholes; ii++) { in.holelist[ii] = tabhole[ii]; } in.numberofregions = nbregion; in.regionlist = new REAL[5 * nbregion]; for (int ii = 0; ii < 5 * in.numberofregions; ii++) { in.regionlist[ii] = tabregion[ii]; } in.numberoffacetconstraints = nbfacecl; in.facetconstraintlist = new REAL[2 * in.numberoffacetconstraints]; for (int ii = 0; ii < 2 * in.numberoffacetconstraints; ii++) { in.facetconstraintlist[ii + 1] = tabfacecl[ii + 1]; } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; cout << "numberof regions " << in.numberofregions << endl; cout << "numberof hole " << in.numberofholes << endl; } tetrahedralize(switch_tetgen, &in, &out, &addin); if (verbosity > 0) {cout << "tetgen: after tetrahedralize( , &in, &out);" << endl;} // mesh3_tetgenio_out( out, *T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out); if (verbosity > 0) { cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } Mesh3*Transfo_Mesh2_tetgen (const double &precis_mesh, char *switch_tetgen, const Mesh &Th2, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_border, int &point_confondus_ok, const int &label_tet, const map &maptri) { // Mesh3 *T_Th3= new Mesh3; int nv_t, nt_t, nbe_t; int *Numero_Som; int *ind_nv_t; int *ind_nt_t; int *ind_nbe_t; int *label_nbe_t; // int i_som; Numero_Som = new int[Th2.nv]; ind_nv_t = new int[Th2.nv]; ind_nbe_t = new int[Th2.nt]; label_nbe_t = new int[Th2.nt]; if (verbosity) {cout << "2D: Mesh::Vertex triangle2 border " << Th2.nv << " " << Th2.nt << " " << Th2.neb << endl;} for (int ii = 0; ii < Th2.nv; ii++) { Numero_Som[ii] = ii; } if (verbosity) {cout << " debut: SamePointElement " << endl;} SamePointElement_Mesh2(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th2, recollement_border, point_confondus_ok, Numero_Som, ind_nv_t, ind_nt_t, ind_nbe_t, label_nbe_t, nv_t, nt_t, nbe_t); if (verbosity) {cout << " fin: SamePointElement " << endl;} if (verbosity) {cout << "2D transfo: Mesh::Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { int &ii = ind_nv_t[nnv]; // cout << "nnv , ii =" << nnv << " " << ii << endl; // cout << "tab_XX[ii], tab_YY[ii], tab_ZZ[ii]=" << tab_XX[ii] << " "<< tab_YY[ii] << " "<< tab_ZZ[ii] << endl; assert(Numero_Som[ii] == nnv); const Mesh::Vertex &K = Th2.vertices[ii]; // const Mesh::Vertex & K(Th2.vertices[ii]); //Version Mesh2 in.pointlist[itet] = tab_XX[ii]; in.pointlist[itet + 1] = tab_YY[ii]; in.pointlist[itet + 2] = tab_ZZ[ii]; in.pointmarkerlist[nnv] = K.lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); if (verbosity) {cout << " tetgenio: facet " << endl;} // Version avec des facettes in.numberoffacets = nbe_t; in.facetlist = new tetgenio::facet[in.numberoffacets]; in.facetmarkerlist = new int[in.numberoffacets]; for (int ibe = 0; ibe < nbe_t; ibe++) { tetgenio::facet *f; tetgenio::polygon *p; f = &in.facetlist[ibe]; f->numberofpolygons = 1; f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; f->numberofholes = 0; f->holelist = NULL; p = &f->polygonlist[0]; p->numberofvertices = 3; p->vertexlist = new int[3]; int &ii = ind_nbe_t[ibe]; // creation of elements const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 p->vertexlist[0] = Numero_Som[Th2.operator () (K[0])] + 1; p->vertexlist[1] = Numero_Som[Th2.operator () (K[1])] + 1; p->vertexlist[2] = Numero_Som[Th2.operator () (K[2])] + 1; for (int kkk = 0; kkk < 3; kkk++) { assert(p->vertexlist[kkk] <= in.numberofpoints && p->vertexlist[kkk] > 0); } map::const_iterator imap; imap = maptri.find(K.lab); // imap= maptri.find( label_nbe_t[ibe] ); assert(imap != maptri.end()); in.facetmarkerlist[ibe] = imap->second; // K.lab; // before } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 0) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } // mesh3_tetgenio_out( out, label_tet, *T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out, label_tet); cout << " Finish Mesh3 :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; delete [] Numero_Som; delete [] ind_nv_t; delete [] ind_nbe_t; delete [] label_nbe_t; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } Mesh3*Transfo_Mesh2_tetgen_new (const double &precis_mesh, char *switch_tetgen, const Mesh &Th2, const double *tab_XX, const double *tab_YY, const double *tab_ZZ, int &border_only, int &recollement_border, int &point_confondus_ok, const int &label_tet, const map &maptri, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl) { // Mesh3 *T_Th3= new Mesh3; int nv_t, nt_t, nbe_t; int *Numero_Som; int *ind_nv_t; int *ind_nt_t; int *ind_nbe_t; int *label_nbe_t; // int i_som; Numero_Som = new int[Th2.nv]; ind_nv_t = new int[Th2.nv]; ind_nbe_t = new int[Th2.nt]; label_nbe_t = new int[Th2.nt]; if (verbosity) {cout << "2D: Mesh::Vertex triangle2 border " << Th2.nv << " " << Th2.nt << " " << Th2.neb << endl;} for (int ii = 0; ii < Th2.nv; ii++) { Numero_Som[ii] = ii; } if (verbosity) {cout << " debut: SamePointElement " << endl;} SamePointElement_Mesh2(precis_mesh, tab_XX, tab_YY, tab_ZZ, Th2, recollement_border, point_confondus_ok, Numero_Som, ind_nv_t, ind_nt_t, ind_nbe_t, label_nbe_t, nv_t, nt_t, nbe_t); if (verbosity) {cout << " fin: SamePointElement " << endl;} if (verbosity) {cout << "2D transfo: Mesh::Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { int &ii = ind_nv_t[nnv]; // cout << "nnv , ii =" << nnv << " " << ii << endl; // cout << "tab_XX[ii], tab_YY[ii], tab_ZZ[ii]=" << tab_XX[ii] << " "<< tab_YY[ii] << " "<< tab_ZZ[ii] << endl; assert(Numero_Som[ii] == nnv); const Mesh::Vertex &K = Th2.vertices[ii]; // const Mesh::Vertex & K(Th2.vertices[ii]); //Version Mesh2 in.pointlist[itet] = tab_XX[ii]; in.pointlist[itet + 1] = tab_YY[ii]; in.pointlist[itet + 2] = tab_ZZ[ii]; in.pointmarkerlist[nnv] = K.lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); if (verbosity) {cout << " tetgenio: facet " << endl;} // Version avec des facettes in.numberoffacets = nbe_t; in.facetlist = new tetgenio::facet[in.numberoffacets]; in.facetmarkerlist = new int[in.numberoffacets]; for (int ibe = 0; ibe < nbe_t; ibe++) { tetgenio::facet *f; tetgenio::polygon *p; f = &in.facetlist[ibe]; f->numberofpolygons = 1; f->polygonlist = new tetgenio::polygon[f->numberofpolygons]; f->numberofholes = 0; f->holelist = NULL; p = &f->polygonlist[0]; p->numberofvertices = 3; p->vertexlist = new int[3]; int &ii = ind_nbe_t[ibe]; // creation of elements const Mesh::Triangle &K(Th2.t(ii)); // const Triangle2 & K(Th2.elements[ii]); // Version Mesh2 p->vertexlist[0] = Numero_Som[Th2.operator () (K[0])] + 1; p->vertexlist[1] = Numero_Som[Th2.operator () (K[1])] + 1; p->vertexlist[2] = Numero_Som[Th2.operator () (K[2])] + 1; for (int kkk = 0; kkk < 3; kkk++) { assert(p->vertexlist[kkk] <= in.numberofpoints && p->vertexlist[kkk] > 0); } map::const_iterator imap; imap = maptri.find(K.lab); // imap= maptri.find( label_nbe_t[ibe] ); assert(imap != maptri.end()); in.facetmarkerlist[ibe] = imap->second; // K.lab; // before } // mise a jour des nouvelles variables in.numberofholes = nbhole; in.holelist = new REAL[3 * nbhole]; for (int ii = 0; ii < 3 * in.numberofholes; ii++) { in.holelist[ii] = tabhole[ii]; } in.numberofregions = nbregion; in.regionlist = new REAL[5 * nbregion]; for (int ii = 0; ii < 5 * in.numberofregions; ii++) { in.regionlist[ii] = tabregion[ii]; } in.numberoffacetconstraints = nbfacecl; in.facetconstraintlist = new REAL[2 * in.numberoffacetconstraints]; for (int ii = 0; ii < 2 * in.numberoffacetconstraints; ii++) { in.facetconstraintlist[ii + 1] = tabfacecl[ii + 1]; } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 0) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } // mesh3_tetgenio_out( out, *T_Th3); Mesh3 *T_Th3 = mesh3_tetgenio_out(out); if (verbosity > 0) { cout << " Finish Mesh3 :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; } delete [] Numero_Som; delete [] ind_nv_t; delete [] ind_nbe_t; delete [] label_nbe_t; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } // Fonction Refine avec tetgen Mesh3*ReconstructionRefine_tetgen (char *switch_tetgen, const Mesh3 &Th3, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl, const double *tsizevol) { // verif option refine int i; assert(Th3.nt != 0); { size_t testr, testp; int lenswitch; const char *test_tetgen = switch_tetgen; testr = strcspn(test_tetgen, "r"); testp = strcspn(test_tetgen, "p"); if (testr == strlen(test_tetgen)) { cout << "The option 'r' of tetgen is not used" << endl; exit(1); } testp = strcspn(test_tetgen, "p"); if (testp != strlen(test_tetgen)) { cout << "With TetGen :: the option 'p' is not possible to use with option 'r' " << endl; exit(1); } } int nv_t = Th3.nv; int nt_t = Th3.nt; int nbe_t = Th3.nbe; if (verbosity) {cout << "3D RemplissageSurf3D:: Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Th3.vertices[nnv].x; in.pointlist[itet + 1] = Th3.vertices[nnv].y; in.pointlist[itet + 2] = Th3.vertices[nnv].z; in.pointmarkerlist[nnv] = Th3.vertices[nnv].lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); // Tetrahedrons if (verbosity) {cout << "tetrahedrons" << endl;} in.numberofcorners = 4; in.numberoftetrahedra = Th3.nt; in.tetrahedronlist = new int[in.numberofcorners * in.numberoftetrahedra]; in.numberoftetrahedronattributes = 1; in.tetrahedronattributelist = new REAL[in.numberoftetrahedronattributes * in.numberoftetrahedra]; in.tetrahedronvolumelist = new REAL[in.numberoftetrahedra]; i = 0; for (int nnt = 0; nnt < Th3.nt; nnt++) { const Tet &K(Th3.elements[nnt]); in.tetrahedronlist[i] = Th3.operator () (K[0]) + 1; in.tetrahedronlist[i + 1] = Th3.operator () (K[1]) + 1; in.tetrahedronlist[i + 2] = Th3.operator () (K[2]) + 1; in.tetrahedronlist[i + 3] = Th3.operator () (K[3]) + 1; in.tetrahedronvolumelist[nnt] = tsizevol[nnt]; in.tetrahedronattributelist[nnt] = K.lab; i = i + 4; } if (verbosity) {cout << "lecture des facettes" << endl;} in.numberoftrifaces = Th3.nbe; in.trifacelist = new int[3 * in.numberoftrifaces]; in.trifacemarkerlist = new int[in.numberoftrifaces]; for (int ibe = 0; ibe < Th3.nbe; ibe++) { const Triangle3 &K(Th3.be(ibe)); in.trifacelist[3 * ibe] = Th3.operator () (K[0]) + 1; in.trifacelist[3 * ibe + 1] = Th3.operator () (K[1]) + 1; in.trifacelist[3 * ibe + 2] = Th3.operator () (K[2]) + 1; in.trifacemarkerlist[ibe] = K.lab; } // mise a jour des nouvelles variables in.numberofholes = nbhole; in.holelist = new REAL[3 * nbhole]; for (int ii = 0; ii < 3 * in.numberofholes; ii++) { in.holelist[ii] = tabhole[ii]; if (verbosity) {cout << "in.holelist[ii]=" << in.holelist[ii] << endl;} } in.numberofregions = nbregion; in.regionlist = new REAL[5 * nbregion]; for (int ii = 0; ii < 5 * in.numberofregions; ii++) { in.regionlist[ii] = tabregion[ii]; if (verbosity) {cout << "in.regionlist[ii]=" << in.regionlist[ii] << endl;} } in.numberoffacetconstraints = nbfacecl; in.facetconstraintlist = new REAL[2 * in.numberoffacetconstraints]; for (int ii = 0; ii < 2 * in.numberoffacetconstraints; ii++) { in.facetconstraintlist[ii + 1] = tabfacecl[ii + 1]; } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; cout << "numberof regions " << in.numberofregions << endl; cout << "numberof hole " << in.numberofholes << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 0) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } Mesh3 *T_Th3 = mesh3_tetgenio_out(out); if (verbosity > 0) { cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } // Fonction Refine avec tetgen � l'aide d'une metrique Mesh3*ReconstructionRefine_tetgen (char *switch_tetgen, const Mesh3 &Th3, const int &nbhole, const double *tabhole, const int &nbregion, const double *tabregion, const int &nbfacecl, const double *tabfacecl, const double *tsizevol, const int &sizeofmetric, const double *metric) { // verif option refine int i; assert(Th3.nt != 0); { size_t testr, testp; int lenswitch; const char *test_tetgen = switch_tetgen; testr = strcspn(test_tetgen, "r"); testp = strcspn(test_tetgen, "p"); if (testr == strlen(test_tetgen)) { cout << "The option 'r' of tetgen is not used" << endl; exit(1); } testp = strcspn(test_tetgen, "p"); if (testp != strlen(test_tetgen)) { cout << "With TetGen :: the option 'p' is not possible to use with option 'r' " << endl; exit(1); } } int nv_t = Th3.nv; int nt_t = Th3.nt; int nbe_t = Th3.nbe; if (verbosity) {cout << "3D RemplissageSurf3D:: Vertex triangle2 border " << nv_t << " " << nt_t << " " << nbe_t << endl;} // Creation des tableau de tetgen tetgenio in, out; // tetgenio::facet *f; // tetgenio::polygon *p; if (verbosity) {cout << " tetgenio: vertex " << endl;} int itet, jtet; // All indices start from 1. in.firstnumber = 1; in.numberofpoints = nv_t; in.pointlist = new REAL[in.numberofpoints * 3]; in.pointmarkerlist = new int[in.numberofpoints]; itet = 0; jtet = 0; for (int nnv = 0; nnv < nv_t; nnv++) { in.pointlist[itet] = Th3.vertices[nnv].x; in.pointlist[itet + 1] = Th3.vertices[nnv].y; in.pointlist[itet + 2] = Th3.vertices[nnv].z; in.pointmarkerlist[nnv] = Th3.vertices[nnv].lab; itet = itet + 3; } assert(itet == in.numberofpoints * 3); if (verbosity) { cout << "sizeofmetric=" << sizeofmetric << endl; } in.numberofpointmtrs = sizeofmetric; in.pointmtrlist = new REAL[in.numberofpointmtrs * in.numberofpoints]; for (int nnv = 0; nnv < in.numberofpointmtrs * in.numberofpoints; nnv++) { in.pointmtrlist[nnv] = metric[nnv]; } // Tetrahedrons if (verbosity) {cout << "tetrahedrons" << endl;} in.numberofcorners = 4; in.numberoftetrahedra = Th3.nt; in.tetrahedronlist = new int[in.numberofcorners * in.numberoftetrahedra]; in.numberoftetrahedronattributes = 1; in.tetrahedronattributelist = new REAL[in.numberoftetrahedronattributes * in.numberoftetrahedra]; in.tetrahedronvolumelist = new REAL[in.numberoftetrahedra]; i = 0; for (int nnt = 0; nnt < Th3.nt; nnt++) { const Tet &K(Th3.elements[nnt]); in.tetrahedronlist[i] = Th3.operator () (K[0]) + 1; in.tetrahedronlist[i + 1] = Th3.operator () (K[1]) + 1; in.tetrahedronlist[i + 2] = Th3.operator () (K[2]) + 1; in.tetrahedronlist[i + 3] = Th3.operator () (K[3]) + 1; in.tetrahedronvolumelist[nnt] = tsizevol[nnt]; in.tetrahedronattributelist[nnt] = K.lab; i = i + 4; } if (verbosity) {cout << "lecture des facettes" << endl;} in.numberoftrifaces = Th3.nbe; in.trifacelist = new int[3 * in.numberoftrifaces]; in.trifacemarkerlist = new int[in.numberoftrifaces]; for (int ibe = 0; ibe < Th3.nbe; ibe++) { const Triangle3 &K(Th3.be(ibe)); in.trifacelist[3 * ibe] = Th3.operator () (K[0]) + 1; in.trifacelist[3 * ibe + 1] = Th3.operator () (K[1]) + 1; in.trifacelist[3 * ibe + 2] = Th3.operator () (K[2]) + 1; in.trifacemarkerlist[ibe] = K.lab; } // mise a jour des nouvelles variables in.numberofholes = nbhole; in.holelist = new REAL[3 * nbhole]; for (int ii = 0; ii < 3 * in.numberofholes; ii++) { in.holelist[ii] = tabhole[ii]; if (verbosity) {cout << "in.holelist[ii]=" << in.holelist[ii] << endl;} } in.numberofregions = nbregion; in.regionlist = new REAL[5 * nbregion]; for (int ii = 0; ii < 5 * in.numberofregions; ii++) { in.regionlist[ii] = tabregion[ii]; if (verbosity) {cout << "in.regionlist[ii]=" << in.regionlist[ii] << endl;} } in.numberoffacetconstraints = nbfacecl; in.facetconstraintlist = new REAL[2 * in.numberoffacetconstraints]; for (int ii = 0; ii < 2 * in.numberoffacetconstraints; ii++) { in.facetconstraintlist[ii + 1] = tabfacecl[ii + 1]; } if (verbosity > 0) { cout << "tetgen: before tetrahedralize( , &in, &out);" << endl; cout << "numberof regions " << in.numberofregions << endl; cout << "numberof hole " << in.numberofholes << endl; } tetrahedralize(switch_tetgen, &in, &out); if (verbosity > 0) { cout << "tetgen: after tetrahedralize( , &in, &out);" << endl; } Mesh3 *T_Th3 = mesh3_tetgenio_out(out); if (verbosity > 0) { cout << " Finish Mesh3 tetgen :: Vertex, Element, Border" << T_Th3->nv << " " << T_Th3->nt << " " << T_Th3->nbe << endl; cout << "FreeFem++: End check mesh given by tetgen" << endl; } return T_Th3; } // declaration pour FreeFem++ class Remplissage_Op: public E_F0mps { public: // typedef pmesh3 Result; Expression eTh; // Surface mesh // ==================== // This parameter allow to add inside points of this initial volume mesh Expression eVolTh; bool bVol; // ==================== static const int n_name_param = 9 + 2 + 1 + 1; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: Remplissage_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) { if (verbosity > 1) {cout << "Remplissage du bord" << endl;} args.SetNameParam(n_name_param, name_param, nargs); if (nargs[2] && nargs[9]) { CompileError("uncompatible movemesh3 (Th, region= , reftet= "); } if (nargs[3] && nargs[10]) { CompileError("uncompatible movemesh3 (Th, label= , refface= "); } bVol = false; /* * if( BCastTo(args[1]) ){ * eVolTh = CastTo(args[1]); * bVol=true; * } * else{ * bVol=false; * } */ } Remplissage_Op (const basicAC_F0 &args, Expression tth, Expression vth) : eTh(tth), eVolTh(vth) { if (verbosity > 1) {cout << "Remplissage du bord" << endl;} args.SetNameParam(n_name_param, name_param, nargs); if (nargs[2] && nargs[9]) { CompileError("uncompatible movemesh3 (Th, region= , reftet= "); } if (nargs[3] && nargs[10]) { CompileError("uncompatible movemesh3 (Th, label= , refface= "); } bVol = true; } /* * static ArrayOfaType typeargs() { return ArrayOfaType( atype(),true ); }// all type * static E_F0 * f(const basicAC_F0 & args) { return new Remplissage_Op(args);} * operator aType () const { return atype();} */ AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type Remplissage_Op::name_param [] = { {"switch", &typeid(string *)}, {"reftet", &typeid(long)}, // 1 {"refface", &typeid(KN_)},// 2 // new parmameters {"nbofholes", &typeid(long)}, {"holelist", &typeid(KN_)}, {"nbofregions", &typeid(long)}, {"regionlist", &typeid(KN_)}, {"nboffacetcl", &typeid(long)}, {"facetcl", &typeid(KN_)}, {"region", &typeid(long)}, // 9 {"label", &typeid(KN_)}, // 10 {"addpointlist", &typeid(KN_)}, // 11 {"metric", &typeid(KN_)} }; class Remplissage: public OneOperator { public: Remplissage (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Remplissage_Op(args, t[0]->CastTo(args[0])); } }; class RemplissageAddPoint: public OneOperator { public: RemplissageAddPoint (): OneOperator(atype(), atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new Remplissage_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; AnyType Remplissage_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); ffassert(pTh); Mesh3 &Th = *pTh; Mesh3 *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere cout << "Tetgen : Vertex Triangle Border " << nbv << " " << nbt << " nbe " << nbe << endl; KN zzempty; // int intempty=0; string stringempty = string("pqaAAYQC"); string *switch_tet(arg(0, stack, &stringempty)); int label_tet(arg(1, stack, arg(9, stack, 0L))); KN nrf(arg(2, stack, arg(10, stack, zzempty))); // new parameters KN zdzempty; int nbhole(arg(3, stack, 0L)); KN tabhole(arg(4, stack, zdzempty)); int nbregion(arg(5, stack, 0L)); KN tabregion(arg(6, stack, zdzempty)); int nbfacecl(arg(7, stack, 0L)); KN tabfacecl(arg(8, stack, zdzempty)); // parameter inside point // need to add "i" to the switch KN InsidePoint(arg(11, stack, zdzempty)); // Add inside point in the volume mesh generated by tetgen // need to add "m" to the switch KN metric(arg(12, stack, zdzempty));// Add metric for tetgen //= ======================== // Add a metric int sizeofmetric = metric.N() / Th.nv; if (nargs[12]) { cout << " size of the metric " << metric.N() / Th.nv << endl; assert((metric.N() / Th.nv) * Th.nv == metric.N()); } // fin add a metric //= ========================= //= ========================= // Add inside points if (nargs[11]) { assert(((InsidePoint.N() / 3) * 3) == InsidePoint.N()); } // case with a inside meshes if (bVol) { // Inside point is given by a mesh Mesh3 *pvolTh = GetAny((*eVolTh)(stack)); Mesh3 &volTh = *pvolTh; KN takevertex(volTh.nv); takevertex = 1; // determination of vertices in the border for (int ibe = 0; ibe < volTh.nbe; ibe++) { const Triangle3 &K(volTh.be(ibe)); takevertex[volTh.operator () (K[0])] = 0; takevertex[volTh.operator () (K[1])] = 0; takevertex[volTh.operator () (K[2])] = 0; } int nvInside = 0; // number of vertices inside the volume mesh for (int iv = 0; iv < volTh.nv; iv++) { if (takevertex[iv] == 1) { nvInside++; } } InsidePoint.resize(3 * nvInside); int loopnv = 0; for (int iv = 0; iv < volTh.nv; iv++) { if (takevertex[iv] == 1) { InsidePoint[loopnv] = volTh.vertices[iv].x; InsidePoint[loopnv + 1] = volTh.vertices[iv].y; InsidePoint[loopnv + 2] = volTh.vertices[iv].z; loopnv = loopnv + 3; } } assert(loopnv / 3 == nvInside); } if (!bVol && !nargs[11]) {assert(InsidePoint.N() == 0);} // fin add inisde point //= ======================== if (nbregion == 0) {nbregion = tabregion.N() / 5;} if (nbhole == 0) {nbhole = tabhole.N() / 3;} if (nbfacecl == 0) {nbfacecl = tabfacecl.N() / 2;} // assertion au niveau de la taille ffassert(tabhole.N() == 3 * nbhole); ffassert(tabregion.N() == 5 * nbregion); ffassert(tabfacecl.N() == 2 * nbfacecl); //= =================================== // How to change string* into char* //= =================================== cout << "string" << *switch_tet << endl; size_t size_switch_tet = switch_tet->size() + 1; char *switch_tetgen = new char[size_switch_tet]; strncpy(switch_tetgen, switch_tet->c_str(), size_switch_tet); cout << "char" << switch_tetgen << endl; ffassert(nrf.N() % 2 == 0); map mapf; for (int i = 0; i < nrf.N(); i += 2) { if (nrf[i] != nrf[i + 1]) { mapf[nrf[i]] = nrf[i + 1]; } } if (verbosity > 1) {cout << "tetgen:" << "nbhole=" << nbhole << "nbregion=" << nbregion << endl;} /* * int addcheckorientation=0; * if( addcheckorientation==1 ){ * cout << "check :: orientation des surfaces" << endl; * Th.BuildBoundaryElementAdj(); * cout << "fin check :: orientation des surfaces" << endl; * } */ int nbinside = InsidePoint.N() / 3; Mesh3 *Th3 = 0; if (nargs[11] || nargs[12] || bVol) { Th3 = RemplissageSurf3D_tetgen_new(switch_tetgen, Th, label_tet, nbhole, tabhole, nbregion, tabregion, nbfacecl, tabfacecl, nbinside, InsidePoint, sizeofmetric, metric); // delete multiple vertex Th3->TrueVertex(); } else { Th3 = RemplissageSurf3D_tetgen_new(switch_tetgen, Th, label_tet, nbhole, tabhole, nbregion, tabregion, nbfacecl, tabfacecl); } if (verbosity > 0) { cout << "finish tetgen " << endl; } // changement de label if (nrf.N() > 0) { if (verbosity > 0) { cout << "changement de label" << endl; } for (int ii = 0; ii < Th3->nbe; ii++) { const Triangle3 &K(Th3->be(ii)); int lab; int iv[3]; iv[0] = Th3->operator () (K[0]); iv[1] = Th3->operator () (K[1]); iv[2] = Th3->operator () (K[2]); map::const_iterator imap; imap = mapf.find(K.lab); if (imap != mapf.end()) { lab = imap->second; } else { lab = K.lab; } Th3->be(ii).set(Th3->vertices, iv, lab); } } if (verbosity > 0) { cout << "action sur le maillage" << endl; } // Th3->BuildBound(); // Th3->BuildAdj(); // Th3->Buildbnormalv(); // Th3->BuildjElementConteningVertex(); Th3->BuildGTree(); // Th3->decrement(); Add2StackOfPtr2FreeRC(stack, Th3); *mp = mps; delete [] switch_tetgen; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return Th3; } // Refine et Recontruction class ReconstructionRefine_Op: public E_F0mps { public: Expression eTh; static const int n_name_param = 10 + 2 + 1; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: ReconstructionRefine_Op (const basicAC_F0 &args, Expression tth) : eTh(tth) { if (verbosity > 1) {cout << "ReconstructionRefine du bord" << endl;} args.SetNameParam(n_name_param, name_param, nargs); if (nargs[2] && nargs[10]) { CompileError("uncompatible ... (Th, region= , reftet= "); } if (nargs[3] && nargs[11]) { CompileError("uncompatible ... (Th, label= , refface= "); } } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type ReconstructionRefine_Op::name_param [] = { {"switch", &typeid(string *)}, {"reftet", &typeid(KN_)}, {"refface", &typeid(KN_)}, // new parmameters {"nbofholes", &typeid(long)}, {"holelist", &typeid(KN_)}, {"nbofregions", &typeid(long)}, {"regionlist", &typeid(KN_)}, {"nboffacetcl", &typeid(long)}, {"facetcl", &typeid(KN_)}, {"sizeofvolume", &typeid(double)}, {"region", &typeid(KN_)}, // 10 {"label", &typeid(KN_)}, // 11 {"metric", &typeid(KN_)}// 12 // parameter for tetgen }; class ReconstructionRefine: public OneOperator { public: ReconstructionRefine (): OneOperator(atype(), atype()) {} E_F0*code (const basicAC_F0 &args) const { return new ReconstructionRefine_Op(args, t[0]->CastTo(args[0])); } }; AnyType ReconstructionRefine_Op::operator () (Stack stack) const { MeshPoint *mp(MeshPointStack(stack)), mps = *mp; Mesh3 *pTh = GetAny((*eTh)(stack)); // double msvol= GetAny((*maxvol)(stack)); ffassert(pTh); Mesh3 &Th = *pTh; Mesh3 *m = pTh; // question a quoi sert *m ?? int nbv = Th.nv;// nombre de sommet int nbt = Th.nt;// nombre de triangles int nbe = Th.nbe; // nombre d'aretes fontiere if (verbosity > 0) { cout << "refine tetgen: Vertex Triangle Border " << nbv << " " << nbt << " " << nbe << endl; } KN zzempty; // int intempty=0; string stringempty = string("rqaAAYQC"); string *switch_tet(arg(0, stack, &stringempty)); KN nrtet(arg(1, stack, arg(10, stack, zzempty))); KN nrf(arg(2, stack, arg(11, stack, zzempty))); // new parameters KN zdzempty; int nbhole(arg(3, stack, 0L)); KN tabhole(arg(4, stack, zdzempty)); int nbregion(arg(5, stack, 0L)); KN tabregion(arg(6, stack, zdzempty)); int nbfacecl(arg(7, stack, 0L)); KN tabfacecl(arg(8, stack, zdzempty)); KN metric(arg(12, stack, zdzempty));// Add metric for tetgen //= ======================== // Add a metric int sizeofmetric = metric.N() / Th.nv; if (nargs[12]) { cout << " size of the metric " << metric.N() / Th.nv << endl; assert((metric.N() / Th.nv) * Th.nv == metric.N()); } // fin add a metric //= ========================= if (nbregion == 0) {nbregion = tabregion.N() / 5;} if (nbhole == 0) {nbhole = tabhole.N() / 3;} if (nbfacecl == 0) {nbfacecl = tabfacecl.N() / 2;} // assertion au niveau de la taille ffassert(tabhole.N() == 3 * nbhole); ffassert(tabregion.N() == 5 * nbregion); ffassert(tabfacecl.N() == 2 * nbfacecl); //= =================================== // How to change string* into char* //= =================================== size_t size_switch_tet = switch_tet->size() + 1; char *switch_tetgen = new char[size_switch_tet]; strncpy(switch_tetgen, switch_tet->c_str(), size_switch_tet); ffassert(nrf.N() % 2 == 0); map mapf; for (int i = 0; i < nrf.N(); i += 2) { if (nrf[i] != nrf[i + 1]) { mapf[nrf[i]] = nrf[i + 1]; } } ffassert(nrtet.N() % 2 == 0); map maptet; for (int i = 0; i < nrtet.N(); i += 2) { if (nrtet[i] != nrtet[i + 1]) { maptet[nrtet[i]] = nrtet[i + 1]; } } KN tsizevol(nbt); MeshPoint *mp3(MeshPointStack(stack)); R3 Cdg_hat = R3(1. / 4., 1. / 4., 1. / 4.); for (int it = 0; it < nbt; it++) { Tet &K(Th.elements[it]); mp3->set(Th, K(Cdg_hat), Cdg_hat, K, K.lab); if (nargs[9]) { tsizevol[it] = GetAny((*nargs[9])(stack)); } else if (tabregion.N() == 0) { for (int i = 0; i < nbregion; i++) { if (K.lab == tabregion[3 + 5 * i]) { tsizevol[it] = tabregion[4 + 5 * i]; } } } else { tsizevol[it] = K.mesure(); } } if (verbosity > 0) { cout << "Before reconstruction:" << " nbhole=" << nbhole << " nbregion=" << nbregion << endl; } Mesh3 *Th3 = 0; int RefineMethod = -1; if (nargs[9]) { RefineMethod = 1; } if (nargs[12]) { RefineMethod = 0; } // Add parameter "perhaps' with add a metric which defined sizeofvolume if (RefineMethod == 1) { Th3 = ReconstructionRefine_tetgen(switch_tetgen, Th, nbhole, tabhole, nbregion, tabregion, nbfacecl, tabfacecl, tsizevol); } else if (RefineMethod == 0) { Th3 = ReconstructionRefine_tetgen(switch_tetgen, Th, nbhole, tabhole, nbregion, tabregion, nbfacecl, tabfacecl, tsizevol, sizeofmetric, metric); } else { cerr << " We can't refine the initial mesh with tetgen. No sizeofvolume or metric is given " << endl; exit(1); } if (verbosity > 0) { cout << "finish reconstruction " << endl; } // changement de label 1 if (nrtet.N() > 0) { for (int ii = 0; ii < Th3->nt; ii++) { const Tet &K(Th3->elements[ii]); int lab; int iv[4]; iv[0] = Th3->operator () (K[0]); iv[1] = Th3->operator () (K[1]); iv[2] = Th3->operator () (K[2]); iv[3] = Th3->operator () (K[3]); map::const_iterator imap; imap = maptet.find(K.lab); if (imap != maptet.end()) { lab = imap->second; } else { lab = K.lab; } Th3->elements[ii].set(Th3->vertices, iv, lab); } } if (nrf.N() > 0) { for (int ii = 0; ii < Th3->nbe; ii++) { const Triangle3 &K(Th3->be(ii)); int lab; int iv[3]; iv[0] = Th3->operator () (K[0]); iv[1] = Th3->operator () (K[1]); iv[2] = Th3->operator () (K[2]); map::const_iterator imap; imap = mapf.find(K.lab); if (imap != mapf.end()) { lab = imap->second; } else { lab = K.lab; } Th3->be(ii).set(Th3->vertices, iv, lab); } } // cout << "fin du changement de label " << endl; // Th3->BuildBound(); // Th3->BuildAdj(); // Th3->Buildbnormalv(); // Th3->BuildjElementConteningVertex(); Th3->BuildGTree(); // Th3->decrement(); Add2StackOfPtr2FreeRC(stack, Th3); delete [] switch_tetgen; *mp = mps; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return Th3; } // ConvexHull3D_tetg_Op /* * class ConvexHull3D_tetg_Op : public E_F0mps * { * public: * Expression numofpts; * Expression xx,yy,zz; * static const int n_name_param =5; // * static basicAC_F0::name_and_type name_param[] ; * Expression nargs[n_name_param]; * * KN_ arg(int i,Stack stack,KN_ a ) const * { return nargs[i] ? GetAny >( (*nargs[i])(stack) ): a;} * KN_ arg(int i,Stack stack,KN_ a ) const * { return nargs[i] ? GetAny >( (*nargs[i])(stack) ): a;} * double arg(int i,Stack stack,double a ) const{ return nargs[i] ? GetAny< double >( (*nargs[i])(stack) ): a;} * long arg(int i,Stack stack, long a ) const{ return nargs[i] ? GetAny< long >( (*nargs[i])(stack) ): a;} * string* arg(int i,Stack stack, string* a ) const{ return nargs[i] ? GetAny< string* >( (*nargs[i])(stack) ): a;} * * public: * ConvexHull3D_tetg_Op(const basicAC_F0 & args, Expression nop, * Expression ffxx, Expression ffyy, Expression ffzz ) * : numofpts(nop), xx(ffxx), yy(ffyy), zz(ffzz) * { * if(verbosity) cout << "Convex Hull with TetGen" << endl; * args.SetNameParam(n_name_param,name_param,nargs); * if( nargs[2] && nargs[3] ) * CompileError("uncompatible ... (Th, region= , reftet= "); * if( nargs[3] && nargs[4] ) * CompileError("uncompatible ... (Th, label= , refface= "); * * } * * AnyType operator()(Stack stack) const ; * }; * * * basicAC_F0::name_and_type ConvexHull3D_tetg_Op::name_param[]= { * { "switch", &typeid(string*)}, * { "reftet", &typeid(long)}, * { "refface", &typeid(long)}, * { "region", &typeid(long)}, * { "label", &typeid(long)} * }; * * class ConvexHull3D_tetg : public OneOperator { public: * ConvexHull3D_tetg() : OneOperator( atype(), atype(), * atype< KN_ >(), atype< KN_ >(), atype< KN_ >() ) {} * * E_F0 * code(const basicAC_F0 & args) const * { * return new ConvexHull3D_tetg_Op( args,t[0]->CastTo(args[0]), * t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]) ); * } * }; * * AnyType ConvexHull3D_tetg_Op::operator()(Stack stack) const * { * int nbv = (int) GetAny((*numofpts)(stack)); * KN cxx(nbv),cyy(nbv),czz(nbv); * * cxx = GetAny< KN > ((*xx)(stack)); * cyy = GetAny< KN > ((*yy)(stack)); * czz = GetAny< KN > ((*zz)(stack)); * * * assert( cxx.N() == nbv ); * assert( cyy.N() == nbv ); * assert( czz.N() == nbv ); * * KN zzempty; * //int intempty=0; * string stringempty= string("qaAAQC"); * string* switch_tet(arg(0,stack,&stringempty)); * int label_tet(arg(1,stack,arg(3,stack,0L))); * int label_face(arg(2,stack,arg(4,stack,1L))); * * //==================================== * // How to change string* into char* * //==================================== * size_t size_switch_tet = switch_tet->size()+1; * char* switch_tetgen =new char[size_switch_tet]; * strncpy(switch_tetgen, switch_tet->c_str(), size_switch_tet); * //====================================== * * Mesh3 *Th3 = Convexhull_3Dpoints ( switch_tetgen, nbv, cxx, cyy, czz, label_tet, label_face ); * * // Th3->BuildBound(); * // Th3->BuildAdj(); * // Th3->Buildbnormalv(); * // Th3->BuildjElementConteningVertex(); * Th3->BuildGTree(); * //Th3->decrement(); * Add2StackOfPtr2FreeRC(stack,Th3); * * delete [] switch_tetgen; * cout << "FreeFem++: End check mesh given by tetgen" << endl; * return Th3; * } */ // ConvexHull3D_tetg_file_Op class ConvexHull3D_tetg_file_Op: public E_F0mps { public: Expression filename; Expression xx, yy, zz; static const int n_name_param = 5; // static basicAC_F0::name_and_type name_param []; Expression nargs[n_name_param]; KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} KN_ arg (int i, Stack stack, KN_ a) const {return nargs[i] ? GetAny >((*nargs[i])(stack)) : a;} double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} string*arg (int i, Stack stack, string *a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} public: ConvexHull3D_tetg_file_Op (const basicAC_F0 &args, Expression zfilename) : filename(zfilename), xx(0), yy(0), zz(0) { if (verbosity) {cout << "Convex Hull with TetGen" << endl;} args.SetNameParam(n_name_param, name_param, nargs); } ConvexHull3D_tetg_file_Op (const basicAC_F0 &args, Expression xxx, Expression yyy, Expression zzz) : filename(0), xx(xxx), yy(yyy), zz(zzz) { if (verbosity) {cout << "Convex Hull with TetGen" << endl;} args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator () (Stack stack) const; }; basicAC_F0::name_and_type ConvexHull3D_tetg_file_Op::name_param [] = { {"switch", &typeid(string *)}, {"reftet", &typeid(long)}, {"refface", &typeid(long)}, {"region", &typeid(long)}, {"label", &typeid(long)} }; class ConvexHull3D_tetg_file: public OneOperator { public: int cas; ConvexHull3D_tetg_file (): OneOperator(atype(), atype()), cas(0) {} ConvexHull3D_tetg_file (int i): OneOperator(atype(), atype >(), atype >(), atype >()), cas(1) {} E_F0*code (const basicAC_F0 &args) const { if (cas == 0) { return new ConvexHull3D_tetg_file_Op(args, t[0]->CastTo(args[0])); } else { return new ConvexHull3D_tetg_file_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } } }; AnyType ConvexHull3D_tetg_file_Op::operator () (Stack stack) const { int nbv = 1; KN cxx(nbv), cyy(nbv), czz(nbv); if (filename) { string *pointsfile = GetAny((*filename)(stack)); // lecture du fichier contenant les points int nbv; // int lec; ifstream fp(pointsfile->c_str()); if (!fp) { cerr << " -- tetgconvexhull : Erreur openning " << pointsfile << endl; exit(1); } if (verbosity > 1) { cout << " -- tetgconvexhull: Read On file \"" << pointsfile << "\"" << endl; } fp >> nbv; if (verbosity > 1) { cout << " -- Nb of Points " << nbv << endl; } cxx.resize(nbv); cyy.resize(nbv); czz.resize(nbv); for (int lec = 0; lec < nbv; lec++) { fp >> cxx[lec] >> cyy[lec] >> czz[lec]; } ffassert(fp.good()); fp.close(); } else { KN_ c_xx = GetAny >((*xx)(stack)), c_yy = GetAny >((*yy)(stack)), c_zz = GetAny >((*zz)(stack)); nbv = c_xx.N(); ffassert(nbv == c_yy.N() && nbv == c_zz.N()); cxx.resize(nbv); cyy.resize(nbv); czz.resize(nbv); cxx = c_xx; cyy = c_yy; czz = c_zz; } if (verbosity > 1) { cout << " bound x " << cxx.min() << " " << cxx.max() << " y " << cyy.min() << " " << cyy.max() << " z " << czz.min() << " " << czz.max() << endl; } // if( lec !=nbv ) { // cerr << " -- tetgconvexhull : Erreur Reading File " << pointsfile < zzempty; // int intempty=0; string stringempty = string("fe"); if (verbosity < 1) {stringempty += "Q";} string *switch_tet(arg(0, stack, &stringempty)); int label_tet(arg(1, stack, arg(3, stack, 0L))); int label_face(arg(2, stack, arg(4, stack, 1L))); //= =================================== // How to change string* into char* //= =================================== size_t size_switch_tet = switch_tet->size() + 1; char *switch_tetgen = new char[size_switch_tet]; strncpy(switch_tetgen, switch_tet->c_str(), size_switch_tet); //= ===================================== Mesh3 *Th3 = new Mesh3; Th3 = Convexhull_3Dpoints(switch_tetgen, nbv, cxx, cyy, czz, label_tet, label_face); // Th3->BuildBound(); // Th3->BuildAdj(); // Th3->Buildbnormalv(); // Th3->BuildjElementConteningVertex(); Th3->BuildGTree(); // Th3->decrement(); Add2StackOfPtr2FreeRC(stack, Th3); delete [] switch_tetgen; if (verbosity > 0) { cout << "FreeFem++: End check mesh given by tetgen" << endl; } return Th3; } /* class Init1 { public: * Init1(); * }; * * $1 */ static void Load_Init () { // le constructeur qui ajoute la fonction "splitmesh3" a freefem++ // if (verbosity) if (verbosity && (mpirank == 0)) {cout << " load: tetgen " << endl;} Global.Add("tetgconvexhull", "(", new ConvexHull3D_tetg_file); Global.Add("tetgconvexhull", "(", new ConvexHull3D_tetg_file(1)); Global.Add("tetgtransfo", "(", new Build2D3D); Global.Add("tetg", "(", new Remplissage); Global.Add("tetg", "(", new RemplissageAddPoint); Global.Add("tetgreconstruction", "(", new ReconstructionRefine); } // because i include this file in tetgen.cpp (very bad) FH // a will correct this in next version ... // <> [[file:msh3.cpp::WITH_NO_INIT]] #define WITH_NO_INIT #include "msh3.cpp" LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/Element_P4dc.hpp000644 000767 000024 00000004406 13312446271 021444 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... const int TypeOfFE_P4dcLagrange::nn[15][4] = { {0, 0, 0, 0}, {1, 1, 1, 1}, {2, 2, 2, 2}, {1, 1, 1, 2}, {1, 1, 2, 2}, {1, 2, 2, 2}, {0, 2, 2, 2}, {0, 0, 2, 2}, {0, 0, 0, 2}, {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 1, 1, 1}, {0, 1, 2, 2}, {0, 1, 1, 2}, {0, 0, 1, 2}} ; const int TypeOfFE_P4dcLagrange::aa[15][4] = { {0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 0}, {0, 1, 0, 1}, {0, 0, 1, 2}, {0, 0, 1, 2}, {0, 1, 0, 1}, {0, 1, 2, 0}, {0, 1, 2, 0}, {0, 1, 0, 1}, {0, 0, 1, 2}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 1, 0, 0}} ; const int TypeOfFE_P4dcLagrange::ff[15] = {24, 24, 24, 6, 4, 6, 6, 4, 6, 6, 4, 6, 2, 2, 2}; const int TypeOfFE_P4dcLagrange::il[15] = {4, 0, 0, 0, 0, 0, 1, 2, 3, 3, 2, 1, 1, 1, 2}; const int TypeOfFE_P4dcLagrange::jl[15] = {0, 4, 0, 3, 2, 1, 0, 0, 0, 1, 2, 3, 1, 2, 1}; const int TypeOfFE_P4dcLagrange::kl[15] = {0, 0, 4, 1, 2, 3, 3, 2, 1, 0, 0, 0, 2, 1, 1}; freefem++-3.61-1/examples++-load/exactpartition.edp000644 000767 000024 00000001131 13256636774 022230 0ustar00hechtstaff000000 000000 load "exactpartition" load "msh3" mesh Th=square(10,10); mesh3 Th3=buildlayers(Th,10); fespace Vh(Th,P1); fespace Vh3(Th3,P1); int n=10; Vh[int] p(n); Vh3[int] p3(n); real[int][int] pp(n); for(int i=0; i long symmetrizeCSR (Matrice_Creuse *const &A) { MatriceMorse *mA = static_cast *>(&(*A->A)); if (!mA->symetrique) { mA->symetrique = true; std::vector cl; std::vector a; a.reserve(mA->nbcoef); cl.reserve(mA->nbcoef); unsigned int save = mA->lg[0]; for (unsigned int i = 0; i < mA->n; ++i) { for (unsigned int j = save; j < mA->lg[i + 1]; ++j) { int col = mA->cl[j]; if (col <= i) { T val = mA->a[j]; if (abs(val) > 1e-14) { a.push_back(val); cl.push_back(col); } } else { break; } } save = mA->lg[i + 1]; mA->lg[i + 1] = cl.size(); } delete [] mA->cl; delete [] mA->a; int *col = new int[cl.size()]; T *val = new T[cl.size()]; for (unsigned int i = 0; i < cl.size(); ++i) { col[i] = cl[i]; val[i] = a[i]; } mA->cl = col; mA->a = val; mA->nbcoef = cl.size(); } return 1L; } static void Load_Init () { Global.Add("symmetrizeCSR", "(", new OneOperator1_ *>(symmetrizeCSR )); Global.Add("symmetrizeCSR", "(", new OneOperator1_ > *>(symmetrizeCSR > )); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/bmo.edp000644 000767 000024 00000001347 13256636774 017760 0ustar00hechtstaff000000 000000 load "./lgbmo" int n=2; real[int] X(n),DX(n); real[int] X0(n); for(int i=0;i. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... #ifdef __cplusplus extern "C" { #endif typedef unsigned char ubyte; #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) enum imgtyp {DEFAULT=0, P2, P3, P4, P5, P6, GREY, RGB, RED, GREEN, BLUE, COLOR}; typedef struct { short sizeX, sizeY; ubyte *data; } PPMimage; typedef PPMimage *pPPMimage; /* prototypes */ PPMimage*loadPPM (const char *imgname, ubyte *type, ubyte quiet); int savePPM (const char *imgname, pPPMimage img, int typimg); pPPMimage diffImg (pPPMimage bits, pPPMimage img, ubyte ityp); #ifdef __cplusplus } #endif freefem++-3.61-1/examples++-load/gsl.edp000644 000767 000024 00000004034 13256636774 017764 0ustar00hechtstaff000000 000000 include "gsl.idp" // FFCS - avoid using P2 and P3 which already define something very precise real [int] p2=[ 2,-3,1]; real [int] p3=[ 8,-10,1,1]; real [int] X(3); complex[int] Z(4); real [int] Q4=[ -1,0,0,0,1]; gslpolysolvequadratic(p2,X); cout << X[0] << " " << X[1] << endl; gslpolysolvecubic(p3,X); cout << X[0] << " " << X[1] << " " << X[2] << endl; gslpolycomplexsolve(Q4,Z); cout << Z[0] << " " << Z[1] << " " << Z[2] << " " << Z[3] < VALUE AT BOUND ... FH OCT 2015 cout << dspline(1,0) << " == " << spline(-1) << " " << spline(100) << " == "<< dspline(1,dspline.m-1) << endl; cout << " err = " << err << endl; plot([xx,yy],[xx,zz],cmm= "err = " + err); assert(err < 0.3);freefem++-3.61-1/examples++-load/schwarz-nm.edp000644 000767 000024 00000010007 13256636774 021265 0ustar00hechtstaff000000 000000 bool withmetis=0; bool RAS=0; int sizeoverlaps=2; // size off overlap int nn=2,mm=2; func bool AddLayers(mesh & Th,real[int] &ssd,int n,real[int] &unssd) { // build a continuous function uussd (P1) : // ssd in the caracteristics function on the input sub domain. // such that : // unssd = 1 when ssd =1; // add n layer of element (size of the overlap) // and unssd = 0 ouside of this layer ... // --------------------------------- fespace Vh(Th,P1); fespace Ph(Th,P0); Ph s; assert(ssd.n==Ph.ndof); assert(unssd.n==Vh.ndof); unssd=0; s[]= ssd; // plot(s,wait=1,fill=1); Vh u; varf vM(u,v)=int2d(Th,qforder=1)(u*v/area); matrix M=vM(Ph,Vh); for(int i=0;i.1; // plot(u,wait=1); unssd+= u[]; s[]= M'*u[];//'; s = s >0.1; } unssd /= (n); u[]=unssd; ssd=s[]; return true; } int withplot=3; mesh Th=square(50,50); int[int] chlab=[1,1 ,2,1 ,3,1 ,4,1 ]; Th=change(Th,refe=chlab); int npart= nn*mm; fespace Ph(Th,P0); fespace Vh(Th,P1); Ph part; Vh sun=0,unssd=0; Ph xx=x,yy=y,nupp; part = int(xx*nn)*mm + int(yy*mm); //plot(part,wait=1); if(withmetis) { load "metis"; int[int] nupart(Th.nt); metisdual(nupart,Th,npart); for(int i=0;i1) plot(part,fill=1,cmm="dual",wait=1); mesh[int] aTh(npart); mesh Thi=Th; fespace Vhi(Thi,P1); Vhi[int] au(npart),pun(npart); matrix[int] Rih(npart); matrix[int] Dih(npart); matrix[int] aA(npart); Vhi[int] auntgv(npart); Vhi[int] rhsi(npart); for(int i=0;i0,label=10,split=1); Rih[i]=interpolate(Vhi,Vh,inside=1); // Vh -> Vhi if(RAS) { suppi= abs(part-i)<0.1; varf vSuppi(u,v)=int2d(Th,qforder=1)(suppi*v/area); unssd[]= vSuppi(0,Vh); unssd = unssd>0.; if(withplot>19) plot(unssd,wait=1); } pun[i][]=Rih[i]*unssd[]; sun[] += Rih[i]'*pun[i][];//'; if(withplot>9) plot(part,aTh[i],fill=1,wait=1); } plot(sun,wait=1,dim=3,fill=1); for(int i=0;i8) plot(pun[i],wait=1); } // verif partition of unite macro Grad(u) [dx(u),dy(u)]//EOM sun=0; for(int i=0;i5) plot(sun,fill=1,wait=1); cout << sun[].max << " " << sun[].min<< endl; // verification of the partition of the unite. assert( 1.-1e-9 <= sun[].min && 1.+1e-9 >= sun[].max); // FFCS: reference value for regression tests Vh ref; int nitermax=1000; { Vh un=0; for(int iter=0;iter. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // Example C++ function "add random function ", dynamically loaded into "load.edp" // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "config.h" #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" #include #include #include #include // FFCS: random() and srandom() do not seem to be available in MinGW #ifdef _WIN32 #define random rand #define srandom srand #endif unsigned long good_seed () { unsigned long random_seed, random_seed_a, random_seed_b; std::ifstream file("/dev/random", std::ios::binary); if (file.is_open()) { unsigned long memblock[10]; size_t size = sizeof(int); file.read((char *)(void *)memblock, size); file.close(); random_seed_a = memblock[0]; } // end if else { random_seed_a = 0; } random_seed_b = std::time(0); random_seed = random_seed_a xor random_seed_b; if (verbosity > 1) { cout << " good_seed =" << random_seed << endl; } return random_seed; } // end good_seed() template class OneOperator_0: public OneOperator { class E_F0_F: public E_F0mps { public: typedef R (*func)(); func f; E_F0_F (func ff): f(ff) {} AnyType operator () (Stack) const {return SetAny(f());} operator aType () const {return atype();}}; typedef R (*func)(); func f; public: E_F0*code (const basicAC_F0 &) const {return new E_F0_F(f);} OneOperator_0 (func ff): OneOperator(map_type[typeid(R).name()]), f(ff) {} }; // FFCS: rand() wants an int on Win32 and Win64, so we need to have a new function "long ffrandom()" to create the OneOperator // object which requires longs (and the MinGW compiler (g++ 4.5) refuses to compile if OneOperator and the underlying function do // not have the same type). FFCS patched this source with "long ffrandom(){return random();}" but FF now comes with // "genrand_int31()". #ifdef _WIN32 void init_by_array (unsigned long init_key [], int key_length); long genrand_int31 (void); void init_genrand (unsigned long); // hach for window ... F. HEcht long ffsrandom (long s) {init_genrand((unsigned int)s); return 0;} long ffrandom () {return genrand_int31();} long ffsrandomdev () { init_genrand(good_seed()); return 0; } #else long ffsrandom (long s) {srandom((unsigned int)s); return 0;} long ffrandom () {return random();} long ffsrandomdev () { #ifdef HAVE_SRANDOMDEV srandomdev(); #else srandom(good_seed()); #endif return 0; } #endif static void init () { Global.Add("srandomdev", "(", new OneOperator_0(ffsrandomdev)); Global.Add("srandom", "(", new OneOperator1(ffsrandom)); Global.Add("random", "(", new OneOperator_0(ffrandom)); } LOADFUNC(init); /* These real versions are due to Isaku Wada, 2002/01/09 added */ freefem++-3.61-1/examples++-load/testFE-P2pnc.edp000644 000767 000024 00000002561 13256636774 021354 0ustar00hechtstaff000000 000000 load "Element_P3dc" load "Element_P2pnc" func real cc(real aa) {real a=aa; if(abs(a)<1e-10) a=0; return a;} int[int] ne1=[1,2,0]; int[int] ne2=[2,0,1]; // the ref triangle int[int] ll=[2,0,0,1]; mesh Th=square(1,1,flags=2,label=ll); Th = trunc(Th,x<0.5,label=0); //Th = movemesh(Th,[x+0.1*y,y-0.2*x]); //Th = movemesh(Th,[x*2,y*2]); mesh Thg = trunc(Th,1,split=2,label=-1); plot(Th, wait=1); int it0=0; fespace Lh(Th,P1); Lh[int] l(3); l[0][][0]=1; l[1][][1]=1; l[2][][2]=1; fespace Wh(Th,P3dc); fespace Vh(Th,P2pnc); Vh u,v; for (int j=0;j " << i << " : " ; u=0; u[][i]=1; for(int k=0; k<3;k++) { int i1= (k+1)%3, i2=(k+2)%3; cout << cc(int1d(Th,k)(u*l[i1]/lenEdge)) << " " << cc(int1d(Th,k)(u*l[i2]/lenEdge)) << " "; } cout << cc(int2d(Th)( u/area)) << endl; //plot(u,wait=1); v=u; for (int j=0;j. */ /****************************************************************************/ // SUMMARY : CMA-ES for non-linear function minimization // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Nikolaus Hansen // E-MAIL : ... #ifndef NH_cmaes_h /* only include ones */ #define NH_cmaes_h #include typedef struct /* random_t * sets up a pseudo random number generator instance */ { /* Variables for Uniform() */ long int startseed; long int aktseed; long int aktrand; long int *rgrand; /* Variables for Gauss() */ short flgstored; double hold; } random_t; typedef struct /* timings_t * time measurement, used to time eigendecomposition */ { /* for outside use */ double totaltime; /* zeroed by calling re-calling timings_start */ double totaltotaltime; double tictoctime; double lasttictoctime; /* local fields */ clock_t lastclock; time_t lasttime; clock_t ticclock; time_t tictime; short istic; short isstarted; double lastdiff; double tictoczwischensumme; } timings_t; typedef struct /* readpara_t * collects all parameters, in particular those that are read from * a file before to start. This should split in future? */ { /* input parameter */ int N; /* problem dimension, must stay constant */ unsigned int seed; double *xstart; double *typicalX; int typicalXcase; double *rgInitialStds; double *rgDiffMinChange; /* termination parameters */ double stopMaxFunEvals; double facmaxeval; double stopMaxIter; struct {int flg; double val; } stStopFitness; double stopTolFun; double stopTolFunHist; double stopTolX; double stopTolUpXFactor; /* internal evolution strategy parameters */ int lambda; /* -> mu, <- N */ int mu; /* -> weights, (lambda) */ double mucov, mueff;/* <- weights */ double *weights;/* <- mu, -> mueff, mucov, ccov */ double damps; /* <- cs, maxeval, lambda */ double cs; /* -> damps, <- N */ double ccumcov; /* <- N */ double ccov;/* <- mucov, <- N */ double diagonalCov; /* number of initial iterations */ struct {int flgalways; double modulo; double maxtime; } updateCmode; double facupdateCmode; /* supplementary variables */ char *weigkey; char resumefile[99]; const char **rgsformat; void **rgpadr; const char **rgskeyar; double ***rgp2adr; int n1para, n1outpara; int n2para; } readpara_t; typedef struct /* cmaes_t * CMA-ES "object" */ { const char *version; readpara_t sp; random_t rand; /* random number generator */ double sigma; /* step size */ double *rgxmean;/* mean x vector, "parent" */ double *rgxbestever; double **rgrgx; /* range of x-vectors, lambda offspring */ int *index; /* sorting index of sample pop. */ double *arFuncValueHist; short flgIniphase; /* not really in use anymore */ short flgStop; double chiN; double **C; /* lower triangular matrix: i>=j for C[i][j] */ double **B; /* matrix with normalize eigenvectors in columns */ double *rgD;/* axis lengths */ double *rgpc; double *rgps; double *rgxold; double *rgout; double *rgBDz; /* for B*D*z */ double *rgdTmp; /* temporary (random) vector used in different places */ double *rgFuncValue; double *publicFitness; /* returned by cmaes_init() */ double gen; /* Generation number */ double countevals; double state; /* 1 == sampled, 2 == not in use anymore, 3 == updated */ double maxdiagC;/* repeatedly used for output */ double mindiagC; double maxEW; double minEW; char sOutString[330]; /* 4x80 */ short flgEigensysIsUptodate; short flgCheckEigen;/* control via signals.par */ double genOfEigensysUpdate; timings_t eigenTimings; double dMaxSignifKond; double dLastMinEWgroesserNull; short flgresumedone; time_t printtime; time_t writetime; /* ideally should keep track for each output file */ time_t firstwritetime; time_t firstprinttime; } cmaes_t; #endif freefem++-3.61-1/examples++-load/tetgencube.edp000644 000767 000024 00000004605 13256636774 021330 0ustar00hechtstaff000000 000000 // file tetgencube.edp load "msh3" load "tetgen" load "medit" real x0,x1,y0,y1; x0=1.; x1=2.; y0=0.; y1=2*pi; mesh Thsq1 = square(5,35,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func ZZ1min = 0; func ZZ1max = 1.5; func XX1 = x; func YY1 = y; int[int] ref31h = [0,12]; int[int] ref31b = [0,11]; mesh3 Th31h = movemesh23(Thsq1,transfo=[XX1,YY1,ZZ1max],label=ref31h,orientation=1); mesh3 Th31b = movemesh23(Thsq1,transfo=[XX1,YY1,ZZ1min],label=ref31b,orientation=-1); //medit("haut",Th31h); //medit("bas",Th31b); ///////////////////////////////// x0=1.; x1=2.; y0=0.; y1=1.5; mesh Thsq2 = square(5,8,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func ZZ2 = y; func XX2 = x; func YY2min = 0.; func YY2max = 2*pi; int[int] ref32h = [0,13]; int[int] ref32b = [0,14]; mesh3 Th32h = movemesh23(Thsq2,transfo=[XX2,YY2max,ZZ2],label=ref32h,orientation=-1); mesh3 Th32b = movemesh23(Thsq2,transfo=[XX2,YY2min,ZZ2],label=ref32b,orientation=1); ///////////////////////////////// x0=0.; x1=2*pi; y0=0.; y1=1.5; mesh Thsq3 = square(35,8,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func XX3min = 1.; func XX3max = 2.; func YY3 = x; func ZZ3 = y; int[int] ref33h = [0,15]; int[int] ref33b = [0,16]; mesh3 Th33h = movemesh23(Thsq3,transfo=[XX3max,YY3,ZZ3],label=ref33h,orientation=1); mesh3 Th33b = movemesh23(Thsq3,transfo=[XX3min,YY3,ZZ3],label=ref33b,orientation=-1); //////////////////////////////// mesh3 Th33 = Th31h+Th31b+Th32h+Th32b+Th33h+Th33b; // "gluing" surface meshs to obtain the surface of cube //medit("glumesh",Th33); savemesh(Th33,"Th33.mesh"); // build a mesh of a axis parallel box with TetGen //real[int] domaine = [1.5,pi,0.75,145,0.001]; //mesh3 Thfinal = tetg(Th33,switch="pqaAAYYQ",nbofregions=1,regionlist=domaine); // Tetrahelize the interior of the cube with tetgen //medit("tetg",Thfinal); //savemesh(Thfinal,"Thfinal.mesh"); // build a mesh of a half cylindrical shell of interior radius 1. and exterior radius 2 and heigh 1.5 func mv2x = x*cos(y); func mv2y = x*sin(y); func mv2z = z; //mesh3 Thmv2 = movemesh3(Thfinal, transfo=[mv2x,mv2y,mv2z]); //savemesh(Thmv2,"halfcylindricalshell.mesh"); verbosity=2; mesh3 Thmv2surf = movemesh(Th33, [mv2x,mv2y,mv2z], facemerge=0); cout << "\b\b Thmv2surf.measure=" << Thmv2surf.measure << endl; cout << " Thmv2surf.bordermeasure=" << Thmv2surf.bordermeasure << endl; medit("maiAllagesurf",Thmv2surf,wait=1); //savemesh(Thmv2surf,"maillagesurfacecylindre.mesh"); //medit("maillageplein",Thmv2); freefem++-3.61-1/examples++-load/qf11to25.cpp000644 000767 000024 00000752623 13312446271 020471 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include #include #include #include #include "error.hpp" #include "AFunction.hpp" using namespace std; #include "RNM.hpp" #include "rgraph.hpp" #include "fem.hpp" #include "QuadratureFormular.hpp" using namespace Fem2D; /* awk -F[ t=:]* -f tt.awk coords.txt >QF.cpp * * /integration/ { if(ii) {print "};" * print "const QuadratureFormular QuadratureFormular_T_" ii "(3," ii " ," N ",P_QuadratureFormular_T_" ii ");" * print "" * print "" * };ii=$3;N=$5; * print "static const QuadraturePoint P_QuadratureFormular_T_" $3 "[] = {";} * !/integration/ {print "QuadraturePoint(" $4 "/2," $2"," $3"),"} * END {print "};"; * print "const QuadratureFormular QuadratureFormular_T_" ii "(3," ii " ," N ",P_QuadratureFormular_T_" ii ");" * print "" * print "" * } */ /* * static const QuadraturePoint P_QuadratureFormular_T_2[] = { * QuadraturePoint(0.6666666666667/2,0.1666666666667,0.6666666666667), * QuadraturePoint(0.6666666666667/2,0.6666666666667,0.1666666666667), * QuadraturePoint(0.6666666666667/2,0.1666666666667,0.1666666666667), * }; * const QuadratureFormular QuadratureFormular_T_2(3,2 ,3,P_QuadratureFormular_T_2); * * * static const QuadraturePoint P_QuadratureFormular_T_4[] = { * QuadraturePoint(0.2199034873106/2,0.0915762135098,0.0915762135098), * QuadraturePoint(0.2199034873106/2,0.8168475729805,0.0915762135098), * QuadraturePoint(0.2199034873106/2,0.0915762135098,0.8168475729805), * QuadraturePoint(0.4467631793560/2,0.1081030181681,0.4459484909160), * QuadraturePoint(0.4467631793560/2,0.4459484909160,0.1081030181681), * QuadraturePoint(0.4467631793560/2,0.4459484909160,0.4459484909160), * }; * const QuadratureFormular QuadratureFormular_T_4(3,4 ,6,P_QuadratureFormular_T_4); * * * static const QuadraturePoint P_QuadratureFormular_T_5[] = { * QuadraturePoint(0.0262712099504/2,0.0000000000000,1.0000000000000), * QuadraturePoint(0.0262716612068/2,1.0000000000000,0.0000000000000), * QuadraturePoint(0.0274163947600/2,0.0000000000000,0.0000000000000), * QuadraturePoint(0.2348383865823/2,0.2673273531185,0.6728199218710), * QuadraturePoint(0.2348412238268/2,0.6728175529461,0.2673288599482), * QuadraturePoint(0.2480251793114/2,0.0649236350054,0.6716530111494), * QuadraturePoint(0.2480304922521/2,0.6716498539042,0.0649251690029), * QuadraturePoint(0.2518604605529/2,0.0654032456800,0.2693789366453), * QuadraturePoint(0.2518660533658/2,0.2693767069140,0.0654054874919), * QuadraturePoint(0.4505789381914/2,0.3386738503896,0.3386799893027), * }; * const QuadratureFormular QuadratureFormular_T_5(3,5 ,10,P_QuadratureFormular_T_5); * * * static const QuadraturePoint P_QuadratureFormular_T_7[] = { * QuadraturePoint(0.0102558174092/2,1.0000000000000,0.0000000000000), * QuadraturePoint(0.0102558174092/2,0.0000000000000,0.0000000000000), * QuadraturePoint(0.0102558174092/2,0.0000000000000,1.0000000000000), * QuadraturePoint(0.1116047046647/2,0.7839656651012,0.0421382841642), * QuadraturePoint(0.1116047046647/2,0.1738960507345,0.7839656651012), * QuadraturePoint(0.1116047046647/2,0.1738960507345,0.0421382841642), * QuadraturePoint(0.1116047046647/2,0.0421382841642,0.1738960507345), * QuadraturePoint(0.1116047046647/2,0.7839656651012,0.1738960507345), * QuadraturePoint(0.1116047046647/2,0.0421382841642,0.7839656651012), * QuadraturePoint(0.1679775595335/2,0.4743880861752,0.4743880861752), * QuadraturePoint(0.1679775595335/2,0.4743880861752,0.0512238276497), * QuadraturePoint(0.1679775595335/2,0.0512238276497,0.4743880861752), * QuadraturePoint(0.2652238803946/2,0.2385615300181,0.5228769399639), * QuadraturePoint(0.2652238803946/2,0.5228769399639,0.2385615300181), * QuadraturePoint(0.2652238803946/2,0.2385615300181,0.2385615300181), * }; * const QuadratureFormular QuadratureFormular_T_7(3,7 ,15,P_QuadratureFormular_T_7); * * * static const QuadraturePoint P_QuadratureFormular_T_9[] = { * QuadraturePoint(0.0519871420646/2,0.0451890097844,0.0451890097844), * QuadraturePoint(0.0519871420646/2,0.0451890097844,0.9096219804312), * QuadraturePoint(0.0519871420646/2,0.9096219804312,0.0451890097844), * QuadraturePoint(0.0707034101784/2,0.7475124727339,0.0304243617288), * QuadraturePoint(0.0707034101784/2,0.2220631655373,0.0304243617288), * QuadraturePoint(0.0707034101784/2,0.7475124727339,0.2220631655373), * QuadraturePoint(0.0707034101784/2,0.2220631655373,0.7475124727339), * QuadraturePoint(0.0707034101784/2,0.0304243617288,0.7475124727339), * QuadraturePoint(0.0707034101784/2,0.0304243617288,0.2220631655373), * QuadraturePoint(0.0909390760952/2,0.1369912012649,0.2182900709714), * QuadraturePoint(0.0909390760952/2,0.6447187277637,0.2182900709714), * QuadraturePoint(0.0909390760952/2,0.1369912012649,0.6447187277637), * QuadraturePoint(0.0909390760952/2,0.2182900709714,0.6447187277637), * QuadraturePoint(0.0909390760952/2,0.2182900709714,0.1369912012649), * QuadraturePoint(0.0909390760952/2,0.6447187277637,0.1369912012649), * QuadraturePoint(0.1032344051380/2,0.0369603304334,0.4815198347833), * QuadraturePoint(0.1032344051380/2,0.4815198347833,0.0369603304334), * QuadraturePoint(0.1032344051380/2,0.4815198347833,0.4815198347833), * QuadraturePoint(0.1881601469167/2,0.4036039798179,0.1927920403641), * QuadraturePoint(0.1881601469167/2,0.4036039798179,0.4036039798179), * QuadraturePoint(0.1881601469167/2,0.1927920403641,0.4036039798179), * }; * const QuadratureFormular QuadratureFormular_T_9(3,9 ,21,P_QuadratureFormular_T_9); */ static QuadraturePoint P_QuadratureFormular_T_11 [] = { QuadraturePoint(0.0114082494033 / 2, 0.0000000000000, 0.9451704450174), QuadraturePoint(0.0114082494033 / 2, 0.9451704450173, 0.0000000000000), QuadraturePoint(0.0132691285720 / 2, 0.9289002405719, 0.0685505797224), QuadraturePoint(0.0132691285720 / 2, 0.0685505797224, 0.9289002405717), QuadraturePoint(0.0155865773350 / 2, 0.0243268355615, 0.0243268355616), QuadraturePoint(0.0408274780428 / 2, 0.1279662835335, 0.0277838749488), QuadraturePoint(0.0408274780429 / 2, 0.0277838749488, 0.1279662835337), QuadraturePoint(0.0579849665116 / 2, 0.0287083428360, 0.7498347588657), QuadraturePoint(0.0579849665116 / 2, 0.7498347588656, 0.0287083428360), QuadraturePoint(0.0601385247663 / 2, 0.7228007909707, 0.2497602062385), QuadraturePoint(0.0601385247663 / 2, 0.2497602062386, 0.7228007909707), QuadraturePoint(0.0625273888433 / 2, 0.0865562992839, 0.8325513856997), QuadraturePoint(0.0625273888433 / 2, 0.8325513856998, 0.0865562992839), QuadraturePoint(0.0639684321504 / 2, 0.3061619157672, 0.0303526617491), QuadraturePoint(0.0639684321504 / 2, 0.0303526617491, 0.3061619157675), QuadraturePoint(0.0661325872161 / 2, 0.4868610595047, 0.4868610595047), QuadraturePoint(0.0668503236820 / 2, 0.6657904293017, 0.1765456154219), QuadraturePoint(0.0668503236821 / 2, 0.1765456154221, 0.6657904293016), QuadraturePoint(0.0686904305977 / 2, 0.0293121007360, 0.5295657488669), QuadraturePoint(0.0686904305977 / 2, 0.5295657488667, 0.0293121007360), QuadraturePoint(0.1002717543859 / 2, 0.1444673824391, 0.1444673824391), QuadraturePoint(0.1143136784099 / 2, 0.3299740111411, 0.5361815729050), QuadraturePoint(0.1143136784099 / 2, 0.5361815729052, 0.3299740111409), QuadraturePoint(0.1223648146752 / 2, 0.5511507516862, 0.1437790861923), QuadraturePoint(0.1223648146752 / 2, 0.1437790861923, 0.5511507516862), QuadraturePoint(0.1394422334178 / 2, 0.3348066587327, 0.1529619437161), QuadraturePoint(0.1394422334178 / 2, 0.1529619437161, 0.3348066587327), QuadraturePoint(0.1744377829182 / 2, 0.3430183498147, 0.3430183498147), }; const QuadratureFormular QuadratureFormular_T_11(11, 28, P_QuadratureFormular_T_11); static QuadraturePoint P_QuadratureFormular_T_13 [] = { QuadraturePoint(0.0166240998757 / 2, 0.0242935351590, 0.9493059293846), QuadraturePoint(0.0166811699778 / 2, 0.0265193427722, 0.0242695130640), QuadraturePoint(0.0166830569067 / 2, 0.9492126023551, 0.0265067966437), QuadraturePoint(0.0175680870083 / 2, 0.0033775763749, 0.4767316412363), QuadraturePoint(0.0184474661845 / 2, 0.4757672298101, 0.5198921829102), QuadraturePoint(0.0197942410188 / 2, 0.5190783193471, 0.0055912706202), QuadraturePoint(0.0203540395855 / 2, 0.8616839745321, 0.0133996048618), QuadraturePoint(0.0206852863940 / 2, 0.1249209759926, 0.8613054321334), QuadraturePoint(0.0208271366086 / 2, 0.0138565453861, 0.1247733717358), QuadraturePoint(0.0317819778279 / 2, 0.0211887064222, 0.8438438351223), QuadraturePoint(0.0320472035241 / 2, 0.8432296787219, 0.1354563645830), QuadraturePoint(0.0320607681146 / 2, 0.1354231797865, 0.0213482820656), QuadraturePoint(0.0430765959183 / 2, 0.3088853510679, 0.0221919663014), QuadraturePoint(0.0438473415339 / 2, 0.6685057595169, 0.3089012879389), QuadraturePoint(0.0439209672733 / 2, 0.0226545012557, 0.6691709943321), QuadraturePoint(0.0479951923691 / 2, 0.2808515408772, 0.6924718155106), QuadraturePoint(0.0483806260733 / 2, 0.6922446749051, 0.0268723345026), QuadraturePoint(0.0484867423375 / 2, 0.0268617447119, 0.2810093973222), QuadraturePoint(0.0556964488024 / 2, 0.1141778485470, 0.7973581413586), QuadraturePoint(0.0561026364356 / 2, 0.7974807922061, 0.0879806508791), QuadraturePoint(0.0565190123693 / 2, 0.0892807293894, 0.1145020561128), QuadraturePoint(0.0689289890670 / 2, 0.1052487892455, 0.6686904119922), QuadraturePoint(0.0717213336089 / 2, 0.6663022280740, 0.2275051631832), QuadraturePoint(0.0727453920976 / 2, 0.2307803737547, 0.1054572561221), QuadraturePoint(0.0788807336737 / 2, 0.1705059157540, 0.5174064398658), QuadraturePoint(0.0810114345512 / 2, 0.5086593973043, 0.3170523855209), QuadraturePoint(0.0825725299055 / 2, 0.3141823862281, 0.1810706361659), QuadraturePoint(0.0842044567330 / 2, 0.4617460817864, 0.4678594539804), QuadraturePoint(0.0843585533305 / 2, 0.0693087496081, 0.4622856042085), QuadraturePoint(0.0851969868488 / 2, 0.4651955259268, 0.0724357805669), QuadraturePoint(0.0902845328052 / 2, 0.2578625857893, 0.6131395039177), QuadraturePoint(0.0914283143485 / 2, 0.6112627766779, 0.1300360834609), QuadraturePoint(0.0916279065409 / 2, 0.1305182135934, 0.2581713828884), QuadraturePoint(0.1025573374896 / 2, 0.4281437991828, 0.2362005969817), QuadraturePoint(0.1033159661413 / 2, 0.3356995783730, 0.4311026308588), QuadraturePoint(0.1035854367193 / 2, 0.2305424298836, 0.3456013949376), }; const QuadratureFormular QuadratureFormular_T_13(13, 36, P_QuadratureFormular_T_13); static QuadraturePoint P_QuadratureFormular_T_14 [] = { QuadraturePoint(0.0010616711990 / 2, 0.0000000000000, 1.0000000000000), QuadraturePoint(0.0010616711990 / 2, 1.0000000000000, 0.0000000000000), QuadraturePoint(0.0010616711990 / 2, 0.0000000000000, 0.0000000000000), QuadraturePoint(0.0131460236101 / 2, 0.0573330873026, 0.0151382269814), QuadraturePoint(0.0131460236101 / 2, 0.0573330873026, 0.9275286857160), QuadraturePoint(0.0131460236101 / 2, 0.9275286857160, 0.0573330873026), QuadraturePoint(0.0131460236101 / 2, 0.0151382269814, 0.0573330873026), QuadraturePoint(0.0131460236101 / 2, 0.9275286857160, 0.0151382269814), QuadraturePoint(0.0131460236101 / 2, 0.0151382269814, 0.9275286857160), QuadraturePoint(0.0242881926949 / 2, 0.8159625040711, 0.1659719969565), QuadraturePoint(0.0242881926949 / 2, 0.8159625040711, 0.0180654989724), QuadraturePoint(0.0242881926949 / 2, 0.1659719969565, 0.8159625040711), QuadraturePoint(0.0242881926949 / 2, 0.0180654989724, 0.8159625040711), QuadraturePoint(0.0242881926949 / 2, 0.1659719969565, 0.0180654989724), QuadraturePoint(0.0242881926949 / 2, 0.0180654989724, 0.1659719969565), QuadraturePoint(0.0316799866332 / 2, 0.3165475556378, 0.0186886898773), QuadraturePoint(0.0316799866332 / 2, 0.6647637544849, 0.0186886898773), QuadraturePoint(0.0316799866332 / 2, 0.0186886898773, 0.6647637544849), QuadraturePoint(0.0316799866332 / 2, 0.0186886898773, 0.3165475556378), QuadraturePoint(0.0316799866332 / 2, 0.3165475556378, 0.6647637544849), QuadraturePoint(0.0316799866332 / 2, 0.6647637544849, 0.3165475556378), QuadraturePoint(0.0349317947036 / 2, 0.0192662192492, 0.4903668903754), QuadraturePoint(0.0349317947036 / 2, 0.4903668903754, 0.0192662192492), QuadraturePoint(0.0349317947036 / 2, 0.4903668903754, 0.4903668903754), QuadraturePoint(0.0383664533945 / 2, 0.0875134669581, 0.8249730660837), QuadraturePoint(0.0383664533945 / 2, 0.0875134669581, 0.0875134669581), QuadraturePoint(0.0383664533945 / 2, 0.8249730660837, 0.0875134669581), QuadraturePoint(0.0578369491210 / 2, 0.0935526036219, 0.2079865423167), QuadraturePoint(0.0578369491210 / 2, 0.0935526036219, 0.6984608540613), QuadraturePoint(0.0578369491210 / 2, 0.2079865423167, 0.0935526036219), QuadraturePoint(0.0578369491210 / 2, 0.6984608540613, 0.0935526036219), QuadraturePoint(0.0578369491210 / 2, 0.6984608540613, 0.2079865423167), QuadraturePoint(0.0578369491210 / 2, 0.2079865423167, 0.6984608540613), QuadraturePoint(0.0725821687394 / 2, 0.0974892983467, 0.5380088595149), QuadraturePoint(0.0725821687394 / 2, 0.3645018421383, 0.0974892983467), QuadraturePoint(0.0725821687394 / 2, 0.5380088595149, 0.0974892983467), QuadraturePoint(0.0725821687394 / 2, 0.5380088595149, 0.3645018421383), QuadraturePoint(0.0725821687394 / 2, 0.3645018421383, 0.5380088595149), QuadraturePoint(0.0725821687394 / 2, 0.0974892983467, 0.3645018421383), QuadraturePoint(0.0897856524107 / 2, 0.2217145894873, 0.5565708210253), QuadraturePoint(0.0897856524107 / 2, 0.5565708210253, 0.2217145894873), QuadraturePoint(0.0897856524107 / 2, 0.2217145894873, 0.2217145894873), QuadraturePoint(0.1034544533617 / 2, 0.3860471669296, 0.2279056661408), QuadraturePoint(0.1034544533617 / 2, 0.2279056661408, 0.3860471669296), QuadraturePoint(0.1034544533617 / 2, 0.3860471669296, 0.3860471669296), }; const QuadratureFormular QuadratureFormular_T_14(14, 45, P_QuadratureFormular_T_14); static QuadraturePoint P_QuadratureFormular_T_16 [] = { QuadraturePoint(0.0006202599851 / 2, 1.0000000000000, 0.0000000000000), QuadraturePoint(0.0006315174712 / 2, 0.0000000000000, 1.0000000000000), QuadraturePoint(0.0007086601559 / 2, 0.0000000000000, 0.0000000000000), QuadraturePoint(0.0055163716168 / 2, 0.9398863583577, 0.0049848744634), QuadraturePoint(0.0062692407656 / 2, 0.0543806683058, 0.9386405618617), QuadraturePoint(0.0078531408826 / 2, 0.0093940049164, 0.0526424462697), QuadraturePoint(0.0094551483864 / 2, 0.0164345086362, 0.9469035517351), QuadraturePoint(0.0097824511271 / 2, 0.9469487269862, 0.0363373677167), QuadraturePoint(0.0099861643489 / 2, 0.0426604005768, 0.0151224541799), QuadraturePoint(0.0137553818816 / 2, 0.0122269495439, 0.8693773510664), QuadraturePoint(0.0140979178040 / 2, 0.8673696521047, 0.1204917285774), QuadraturePoint(0.0149646864337 / 2, 0.8456744021389, 0.0157763967870), QuadraturePoint(0.0156097503612 / 2, 0.1395759632103, 0.8448120870375), QuadraturePoint(0.0157683693348 / 2, 0.1317821743231, 0.0135009605584), QuadraturePoint(0.0175794546383 / 2, 0.0157955126300, 0.1455274938536), QuadraturePoint(0.0204113840270 / 2, 0.7365462884436, 0.0155697540908), QuadraturePoint(0.0209562878616 / 2, 0.0139688430330, 0.7379836894450), QuadraturePoint(0.0210713412998 / 2, 0.2547895186039, 0.7297615689771), QuadraturePoint(0.0217646760202 / 2, 0.7316386522555, 0.2543076683315), QuadraturePoint(0.0222288408699 / 2, 0.0157253728951, 0.2696239795791), QuadraturePoint(0.0224186693682 / 2, 0.2662302843647, 0.0144783956308), QuadraturePoint(0.0230122616993 / 2, 0.8673504065214, 0.0591679410400), QuadraturePoint(0.0236813902500 / 2, 0.0741493666957, 0.8634782575061), QuadraturePoint(0.0257464643368 / 2, 0.0159285948360, 0.4191238955238), QuadraturePoint(0.0257956801608 / 2, 0.0156061028068, 0.5809222921146), QuadraturePoint(0.0258072327610 / 2, 0.5910094817484, 0.0159251452651), QuadraturePoint(0.0260343232059 / 2, 0.4034771496889, 0.5806700368104), QuadraturePoint(0.0265768141609 / 2, 0.5694745628526, 0.4149495146302), QuadraturePoint(0.0265784761831 / 2, 0.0678493700650, 0.0761218678591), QuadraturePoint(0.0267532329238 / 2, 0.4265968590272, 0.0157509692312), QuadraturePoint(0.0375787806641 / 2, 0.0670982507890, 0.7741898312421), QuadraturePoint(0.0383065894195 / 2, 0.7528310231480, 0.0819119495639), QuadraturePoint(0.0384849695025 / 2, 0.7753727783557, 0.1577128457292), QuadraturePoint(0.0389619825852 / 2, 0.1689073157787, 0.7503943099742), QuadraturePoint(0.0394604111547 / 2, 0.1687335832919, 0.0708311507268), QuadraturePoint(0.0412364778098 / 2, 0.0821244708436, 0.1762996626771), QuadraturePoint(0.0512872438483 / 2, 0.6288705363345, 0.0807744953317), QuadraturePoint(0.0516405641935 / 2, 0.0811413015266, 0.3054373589776), QuadraturePoint(0.0518230042269 / 2, 0.2969112065080, 0.6227485988871), QuadraturePoint(0.0528527988181 / 2, 0.0767542314171, 0.6247247149546), QuadraturePoint(0.0538505573027 / 2, 0.6223022333845, 0.3011485821166), QuadraturePoint(0.0541895329319 / 2, 0.3103786288051, 0.0779098365079), QuadraturePoint(0.0584737146444 / 2, 0.0819218215187, 0.4603633038351), QuadraturePoint(0.0592863168363 / 2, 0.4717022665013, 0.0821554006797), QuadraturePoint(0.0594358276749 / 2, 0.4546603415250, 0.4637565033890), QuadraturePoint(0.0631800255863 / 2, 0.1701091339237, 0.6422277808188), QuadraturePoint(0.0632926845153 / 2, 0.6406004329487, 0.1898293537256), QuadraturePoint(0.0640707361772 / 2, 0.1912267583717, 0.1739955685343), QuadraturePoint(0.0812040595918 / 2, 0.1885315767070, 0.4798914070406), QuadraturePoint(0.0814437513530 / 2, 0.4772929957691, 0.3348356598119), QuadraturePoint(0.0814679201241 / 2, 0.3126974621760, 0.4957972197259), QuadraturePoint(0.0815050548084 / 2, 0.4961225945946, 0.1927553668904), QuadraturePoint(0.0815164664939 / 2, 0.1928805312867, 0.3161015807261), QuadraturePoint(0.0816931059623 / 2, 0.3360041453816, 0.1894892801290), QuadraturePoint(0.0923218334531 / 2, 0.3337280550848, 0.3343571021811), }; const QuadratureFormular QuadratureFormular_T_16(16, 55, P_QuadratureFormular_T_16); static QuadraturePoint P_QuadratureFormular_T_18 [] = { QuadraturePoint(0.0025165756986 / 2, 0.0116731059668, 0.9812565951289), QuadraturePoint(0.0025273452007 / 2, 0.9810030858388, 0.0071462504863), QuadraturePoint(0.0033269295333 / 2, 0.0106966317092, 0.0115153933376), QuadraturePoint(0.0081503492125 / 2, 0.9382476983551, 0.0495570591341), QuadraturePoint(0.0086135525742 / 2, 0.0126627518417, 0.9370123620615), QuadraturePoint(0.0087786746179 / 2, 0.0598109409984, 0.0121364578922), QuadraturePoint(0.0097099585562 / 2, 0.0137363297927, 0.0612783625597), QuadraturePoint(0.0102466211915 / 2, 0.9229527959405, 0.0141128270602), QuadraturePoint(0.0108397688341 / 2, 0.0633107354993, 0.9220197291727), QuadraturePoint(0.0129385390176 / 2, 0.0117265100335, 0.1500520475229), QuadraturePoint(0.0136339823583 / 2, 0.1554720587323, 0.8325147121589), QuadraturePoint(0.0138477328147 / 2, 0.8343293888982, 0.0125228158759), QuadraturePoint(0.0139421540105 / 2, 0.8501638031957, 0.1371997508736), QuadraturePoint(0.0144121399968 / 2, 0.0128816350522, 0.8477627063479), QuadraturePoint(0.0153703455534 / 2, 0.1510801608959, 0.0136526924039), QuadraturePoint(0.0162489802253 / 2, 0.0101917879217, 0.5770438618345), QuadraturePoint(0.0169718304280 / 2, 0.2813372399303, 0.7066853759623), QuadraturePoint(0.0170088532421 / 2, 0.7124374628501, 0.0124569780990), QuadraturePoint(0.0170953520675 / 2, 0.2763025250863, 0.0121741311386), QuadraturePoint(0.0173888854559 / 2, 0.0109658368561, 0.4194306712466), QuadraturePoint(0.0174543962439 / 2, 0.4289110517884, 0.5599616067469), QuadraturePoint(0.0178406757287 / 2, 0.4215420555115, 0.0116475994785), QuadraturePoint(0.0178446863879 / 2, 0.5711258590444, 0.0118218313989), QuadraturePoint(0.0179046337552 / 2, 0.5826868270511, 0.4057889581177), QuadraturePoint(0.0181259756201 / 2, 0.0130567806713, 0.2725023750868), QuadraturePoint(0.0184784838882 / 2, 0.0130760400964, 0.7224712523233), QuadraturePoint(0.0185793564371 / 2, 0.7263437062407, 0.2602984019251), QuadraturePoint(0.0203217151777 / 2, 0.0687230068637, 0.0631417277210), QuadraturePoint(0.0213771661809 / 2, 0.8652302101529, 0.0720611837338), QuadraturePoint(0.0231916854098 / 2, 0.0648599071037, 0.8590433543910), QuadraturePoint(0.0274426710859 / 2, 0.1483494943362, 0.7888788352240), QuadraturePoint(0.0290301922340 / 2, 0.0624359898396, 0.1493935499354), QuadraturePoint(0.0294522738505 / 2, 0.7871369011735, 0.0656382042757), QuadraturePoint(0.0299436251629 / 2, 0.0519104921610, 0.5255635695605), QuadraturePoint(0.0307026948119 / 2, 0.1543129927444, 0.0716383926917), QuadraturePoint(0.0325263365863 / 2, 0.2617842745603, 0.0621479485288), QuadraturePoint(0.0327884208506 / 2, 0.7667257872813, 0.1658211554831), QuadraturePoint(0.0331234675192 / 2, 0.2582103676627, 0.6800119766139), QuadraturePoint(0.0346167526875 / 2, 0.0679065925147, 0.7571515437782), QuadraturePoint(0.0347081373976 / 2, 0.5293578274804, 0.4121503841107), QuadraturePoint(0.0347372049404 / 2, 0.0666036150484, 0.2612513087886), QuadraturePoint(0.0348528762454 / 2, 0.0585675461899, 0.3902236114535), QuadraturePoint(0.0348601561186 / 2, 0.0644535360411, 0.6373626559761), QuadraturePoint(0.0355471569975 / 2, 0.6748138429151, 0.0637583342061), QuadraturePoint(0.0360182996383 / 2, 0.3914602310369, 0.5503238090563), QuadraturePoint(0.0362926285843 / 2, 0.6487701492307, 0.2836728360263), QuadraturePoint(0.0381897702083 / 2, 0.3946498220408, 0.0605175522554), QuadraturePoint(0.0392252800118 / 2, 0.5390137151933, 0.0611990176936), QuadraturePoint(0.0482710125888 / 2, 0.1627895082785, 0.6861322141035), QuadraturePoint(0.0489912121566 / 2, 0.6812436322641, 0.1567968345899), QuadraturePoint(0.0497220833872 / 2, 0.1542832878020, 0.1667512624020), QuadraturePoint(0.0507065736986 / 2, 0.2522727750445, 0.2504803933395), QuadraturePoint(0.0509771994043 / 2, 0.2547981532407, 0.4994090649043), QuadraturePoint(0.0521360063667 / 2, 0.1485580549194, 0.5756023096087), QuadraturePoint(0.0523460874925 / 2, 0.2930239606436, 0.5656897354162), QuadraturePoint(0.0524440683552 / 2, 0.2808991272310, 0.1437921574248), QuadraturePoint(0.0527459644823 / 2, 0.4820989592971, 0.2518557535865), QuadraturePoint(0.0529449063728 / 2, 0.5641878245444, 0.1462966743153), QuadraturePoint(0.0542395594501 / 2, 0.1307699644344, 0.4489577586117), QuadraturePoint(0.0543470203419 / 2, 0.1479692221948, 0.3001174386829), QuadraturePoint(0.0547100548639 / 2, 0.5638684222946, 0.2813772089298), QuadraturePoint(0.0557288345913 / 2, 0.4361157428790, 0.4252053446420), QuadraturePoint(0.0577734264233 / 2, 0.3603263935285, 0.2599190004889), QuadraturePoint(0.0585393781623 / 2, 0.4224188334674, 0.1453238443303), QuadraturePoint(0.0609039250680 / 2, 0.3719001833052, 0.3780122703567), QuadraturePoint(0.0637273964449 / 2, 0.2413645006928, 0.3847563284940), }; const QuadratureFormular QuadratureFormular_T_18(18, 66, P_QuadratureFormular_T_18); static QuadraturePoint P_QuadratureFormular_T_20 [] = { QuadraturePoint(0.0021744545399 / 2, 0.0089411337112, 0.0086983293702), QuadraturePoint(0.0028987135265 / 2, 0.9792622629807, 0.0102644133744), QuadraturePoint(0.0030846029337 / 2, 0.0105475382112, 0.9785514202515), QuadraturePoint(0.0034401633104 / 2, 0.0023777061947, 0.0636551098604), QuadraturePoint(0.0041898472012 / 2, 0.0630425115795, 0.0041506347509), QuadraturePoint(0.0044738051498 / 2, 0.9308422496730, 0.0048053482263), QuadraturePoint(0.0047054420814 / 2, 0.0629076555490, 0.9316790069481), QuadraturePoint(0.0048867935750 / 2, 0.9315962246381, 0.0626264881801), QuadraturePoint(0.0051927643369 / 2, 0.0061951689415, 0.9293587058564), QuadraturePoint(0.0074073058981 / 2, 0.0287125819237, 0.0310202122997), QuadraturePoint(0.0079755410301 / 2, 0.9293844478305, 0.0342152968219), QuadraturePoint(0.0083550522910 / 2, 0.0375457566621, 0.9257868884669), QuadraturePoint(0.0096166660864 / 2, 0.0086895739064, 0.1584971251510), QuadraturePoint(0.0096318257850 / 2, 0.1547597053965, 0.8363606657688), QuadraturePoint(0.0098577460758 / 2, 0.8331025294185, 0.0089257244824), QuadraturePoint(0.0102657880301 / 2, 0.8374231073526, 0.1529167304078), QuadraturePoint(0.0103188103111 / 2, 0.1559362505234, 0.0094966240058), QuadraturePoint(0.0106291001630 / 2, 0.0098599642095, 0.8342211493596), QuadraturePoint(0.0106881306895 / 2, 0.4055873733289, 0.0074389302008), QuadraturePoint(0.0106969021010 / 2, 0.5964727898618, 0.3956330809311), QuadraturePoint(0.0109026461714 / 2, 0.0080747800416, 0.4031319425903), QuadraturePoint(0.0109899783575 / 2, 0.0075073977721, 0.5851609594681), QuadraturePoint(0.0113423055229 / 2, 0.3936764519237, 0.5974896592899), QuadraturePoint(0.0120535642930 / 2, 0.5846530726212, 0.0087250464968), QuadraturePoint(0.0139619193821 / 2, 0.4870804112120, 0.0202129229912), QuadraturePoint(0.0141147991536 / 2, 0.2683512811785, 0.7202340088668), QuadraturePoint(0.0141930347046 / 2, 0.7223956288748, 0.2662399366456), QuadraturePoint(0.0144212676268 / 2, 0.2716826742357, 0.0112882698808), QuadraturePoint(0.0144704346855 / 2, 0.0112580842046, 0.7169695963325), QuadraturePoint(0.0144949769872 / 2, 0.0115034734370, 0.2740067110166), QuadraturePoint(0.0145386775694 / 2, 0.7140525900564, 0.0113511560497), QuadraturePoint(0.0145964190926 / 2, 0.4902871053112, 0.4936491841468), QuadraturePoint(0.0147314578466 / 2, 0.0201423425209, 0.4832573459601), QuadraturePoint(0.0167463963304 / 2, 0.0361107464859, 0.0935679501582), QuadraturePoint(0.0168955500458 / 2, 0.8607998819851, 0.0397379067075), QuadraturePoint(0.0169422662884 / 2, 0.1005891526001, 0.8586343419352), QuadraturePoint(0.0173070172095 / 2, 0.0918740717058, 0.0395513001973), QuadraturePoint(0.0174524546493 / 2, 0.8604888296191, 0.0966224057079), QuadraturePoint(0.0177217222159 / 2, 0.0439842178673, 0.8561886349107), QuadraturePoint(0.0282824024023 / 2, 0.2011017606735, 0.7449115835626), QuadraturePoint(0.0284996712488 / 2, 0.7449993726263, 0.0536865638166), QuadraturePoint(0.0285005646539 / 2, 0.0532186641310, 0.1963754275935), QuadraturePoint(0.0300647223478 / 2, 0.7453984647401, 0.1982065805550), QuadraturePoint(0.0302031277082 / 2, 0.1957289932876, 0.0555713833156), QuadraturePoint(0.0303987136077 / 2, 0.1092532057988, 0.6100036182413), QuadraturePoint(0.0305668796074 / 2, 0.0567625702001, 0.7409121894959), QuadraturePoint(0.0306067413002 / 2, 0.0483837933475, 0.6075135660978), QuadraturePoint(0.0309330068201 / 2, 0.1080612809760, 0.1122081510437), QuadraturePoint(0.0309773820835 / 2, 0.6185605900991, 0.2698753703035), QuadraturePoint(0.0313146250545 / 2, 0.7721296013497, 0.1114117395333), QuadraturePoint(0.0313573493392 / 2, 0.6115734801133, 0.3389367677931), QuadraturePoint(0.0314320469287 / 2, 0.3381326103376, 0.0494693938787), QuadraturePoint(0.0315182143894 / 2, 0.1173084128254, 0.7696451309795), QuadraturePoint(0.0324248137985 / 2, 0.2674551260596, 0.1115718808154), QuadraturePoint(0.0347512152386 / 2, 0.6542100160026, 0.1906548314700), QuadraturePoint(0.0350393454927 / 2, 0.0538297481158, 0.3358616826849), QuadraturePoint(0.0350717420310 / 2, 0.1848840324117, 0.1551831523851), QuadraturePoint(0.0352129215334 / 2, 0.3376267104744, 0.6081402596294), QuadraturePoint(0.0352615504981 / 2, 0.6067102034499, 0.0542632795598), QuadraturePoint(0.0366403220343 / 2, 0.4612614085496, 0.0688176670722), QuadraturePoint(0.0367733107670 / 2, 0.1525465365671, 0.6510240845749), QuadraturePoint(0.0371675662937 / 2, 0.0700582543543, 0.4661904392742), QuadraturePoint(0.0373371571606 / 2, 0.4704201379032, 0.4634826455353), QuadraturePoint(0.0403973346588 / 2, 0.1216461693746, 0.2381494875516), QuadraturePoint(0.0413580040638 / 2, 0.6371404052702, 0.1238399384513), QuadraturePoint(0.0421957791870 / 2, 0.2379904515119, 0.6370216452326), QuadraturePoint(0.0495451004037 / 2, 0.1483929857177, 0.4894188577780), QuadraturePoint(0.0500419261141 / 2, 0.3598069571550, 0.1452880866253), QuadraturePoint(0.0505794587115 / 2, 0.4941441055095, 0.3610216383818), QuadraturePoint(0.0520037210188 / 2, 0.1440630687981, 0.3513508341887), QuadraturePoint(0.0521533567886 / 2, 0.5019764440004, 0.1435491663293), QuadraturePoint(0.0524899152358 / 2, 0.3555423834298, 0.5016491599502), QuadraturePoint(0.0599159762516 / 2, 0.2443439540771, 0.2406052129104), QuadraturePoint(0.0599609997426 / 2, 0.2437064989342, 0.5109017277055), QuadraturePoint(0.0599915272129 / 2, 0.5122200807321, 0.2452737973543), QuadraturePoint(0.0634133183449 / 2, 0.2526038315178, 0.3700319555094), QuadraturePoint(0.0635311861108 / 2, 0.3759895652851, 0.2505406611631), QuadraturePoint(0.0637206605672 / 2, 0.3729077987144, 0.3753750277549), }; const QuadratureFormular QuadratureFormular_T_20(20, 78, P_QuadratureFormular_T_20); static QuadraturePoint P_QuadratureFormular_T_21 [] = { QuadraturePoint(0.0006704436439 / 2, 0.0035524391922, 0.0035524391922), QuadraturePoint(0.0006704436439 / 2, 0.0035524391922, 0.9928951216156), QuadraturePoint(0.0006704436439 / 2, 0.9928951216156, 0.0035524391922), QuadraturePoint(0.0045472608074 / 2, 0.9553548273730, 0.0087898929093), QuadraturePoint(0.0045472608074 / 2, 0.0358552797177, 0.0087898929093), QuadraturePoint(0.0045472608074 / 2, 0.9553548273730, 0.0358552797177), QuadraturePoint(0.0045472608074 / 2, 0.0087898929093, 0.0358552797177), QuadraturePoint(0.0045472608074 / 2, 0.0087898929093, 0.9553548273730), QuadraturePoint(0.0045472608074 / 2, 0.0358552797177, 0.9553548273730), QuadraturePoint(0.0052077585320 / 2, 0.8865264879047, 0.1082329745017), QuadraturePoint(0.0052077585320 / 2, 0.8865264879047, 0.0052405375935), QuadraturePoint(0.0052077585320 / 2, 0.0052405375935, 0.1082329745017), QuadraturePoint(0.0052077585320 / 2, 0.0052405375935, 0.8865264879047), QuadraturePoint(0.0052077585320 / 2, 0.1082329745017, 0.8865264879047), QuadraturePoint(0.0052077585320 / 2, 0.1082329745017, 0.0052405375935), QuadraturePoint(0.0065435432887 / 2, 0.0466397432150, 0.9067205135700), QuadraturePoint(0.0065435432887 / 2, 0.0466397432150, 0.0466397432150), QuadraturePoint(0.0065435432887 / 2, 0.9067205135700, 0.0466397432150), QuadraturePoint(0.0092737841533 / 2, 0.2075720456946, 0.0082759241284), QuadraturePoint(0.0092737841533 / 2, 0.2075720456946, 0.7841520301770), QuadraturePoint(0.0092737841533 / 2, 0.7841520301770, 0.2075720456946), QuadraturePoint(0.0092737841533 / 2, 0.0082759241284, 0.7841520301770), QuadraturePoint(0.0092737841533 / 2, 0.0082759241284, 0.2075720456946), QuadraturePoint(0.0092737841533 / 2, 0.7841520301770, 0.0082759241284), QuadraturePoint(0.0095937782623 / 2, 0.0858119489725, 0.0314836947701), QuadraturePoint(0.0095937782623 / 2, 0.8827043562574, 0.0314836947701), QuadraturePoint(0.0095937782623 / 2, 0.0314836947701, 0.0858119489725), QuadraturePoint(0.0095937782623 / 2, 0.0858119489725, 0.8827043562574), QuadraturePoint(0.0095937782623 / 2, 0.8827043562574, 0.0858119489725), QuadraturePoint(0.0095937782623 / 2, 0.0314836947701, 0.8827043562574), QuadraturePoint(0.0114247809167 / 2, 0.6688778233826, 0.0095150760625), QuadraturePoint(0.0114247809167 / 2, 0.0095150760625, 0.3216071005550), QuadraturePoint(0.0114247809167 / 2, 0.0095150760625, 0.6688778233826), QuadraturePoint(0.0114247809167 / 2, 0.6688778233826, 0.3216071005550), QuadraturePoint(0.0114247809167 / 2, 0.3216071005550, 0.6688778233826), QuadraturePoint(0.0114247809167 / 2, 0.3216071005550, 0.0095150760625), QuadraturePoint(0.0117216964174 / 2, 0.4379999543113, 0.0099859785681), QuadraturePoint(0.0117216964174 / 2, 0.0099859785681, 0.5520140671206), QuadraturePoint(0.0117216964174 / 2, 0.4379999543113, 0.5520140671206), QuadraturePoint(0.0117216964174 / 2, 0.0099859785681, 0.4379999543113), QuadraturePoint(0.0117216964174 / 2, 0.5520140671206, 0.4379999543113), QuadraturePoint(0.0117216964174 / 2, 0.5520140671206, 0.0099859785681), QuadraturePoint(0.0188197155232 / 2, 0.7974931072148, 0.0405093994119), QuadraturePoint(0.0188197155232 / 2, 0.0405093994119, 0.1619974933734), QuadraturePoint(0.0188197155232 / 2, 0.0405093994119, 0.7974931072148), QuadraturePoint(0.0188197155232 / 2, 0.1619974933734, 0.7974931072148), QuadraturePoint(0.0188197155232 / 2, 0.7974931072148, 0.1619974933734), QuadraturePoint(0.0188197155232 / 2, 0.1619974933734, 0.0405093994119), QuadraturePoint(0.0235260980271 / 2, 0.3864215551955, 0.3864215551955), QuadraturePoint(0.0235260980271 / 2, 0.3864215551955, 0.2271568896090), QuadraturePoint(0.0235260980271 / 2, 0.2271568896090, 0.3864215551955), QuadraturePoint(0.0235571466151 / 2, 0.8090129379329, 0.0954935310336), QuadraturePoint(0.0235571466151 / 2, 0.0954935310336, 0.8090129379329), QuadraturePoint(0.0235571466151 / 2, 0.0954935310336, 0.0954935310336), QuadraturePoint(0.0268246207430 / 2, 0.2745425238718, 0.0479840480721), QuadraturePoint(0.0268246207430 / 2, 0.0479840480721, 0.6774734280561), QuadraturePoint(0.0268246207430 / 2, 0.6774734280561, 0.0479840480721), QuadraturePoint(0.0268246207430 / 2, 0.6774734280561, 0.2745425238718), QuadraturePoint(0.0268246207430 / 2, 0.2745425238718, 0.6774734280561), QuadraturePoint(0.0268246207430 / 2, 0.0479840480721, 0.2745425238718), QuadraturePoint(0.0314289776779 / 2, 0.4053472446667, 0.5429849622344), QuadraturePoint(0.0314289776779 / 2, 0.0516677930989, 0.4053472446667), QuadraturePoint(0.0314289776779 / 2, 0.4053472446667, 0.0516677930989), QuadraturePoint(0.0314289776779 / 2, 0.5429849622344, 0.0516677930989), QuadraturePoint(0.0314289776779 / 2, 0.0516677930989, 0.5429849622344), QuadraturePoint(0.0314289776779 / 2, 0.5429849622344, 0.4053472446667), QuadraturePoint(0.0337196192159 / 2, 0.1877738615539, 0.1068148267588), QuadraturePoint(0.0337196192159 / 2, 0.7054113116872, 0.1877738615539), QuadraturePoint(0.0337196192159 / 2, 0.7054113116872, 0.1068148267588), QuadraturePoint(0.0337196192159 / 2, 0.1068148267588, 0.7054113116872), QuadraturePoint(0.0337196192159 / 2, 0.1877738615539, 0.7054113116872), QuadraturePoint(0.0337196192159 / 2, 0.1068148267588, 0.1877738615539), QuadraturePoint(0.0427745294213 / 2, 0.1195059712009, 0.3057122990643), QuadraturePoint(0.0427745294213 / 2, 0.1195059712009, 0.5747817297348), QuadraturePoint(0.0427745294213 / 2, 0.5747817297348, 0.1195059712009), QuadraturePoint(0.0427745294213 / 2, 0.5747817297348, 0.3057122990643), QuadraturePoint(0.0427745294213 / 2, 0.3057122990643, 0.5747817297348), QuadraturePoint(0.0427745294213 / 2, 0.3057122990643, 0.1195059712009), QuadraturePoint(0.0441138932737 / 2, 0.5981245743363, 0.2009377128319), QuadraturePoint(0.0441138932737 / 2, 0.2009377128319, 0.5981245743363), QuadraturePoint(0.0441138932737 / 2, 0.2009377128319, 0.2009377128319), QuadraturePoint(0.0461469594684 / 2, 0.2160775200005, 0.3121360256673), QuadraturePoint(0.0461469594684 / 2, 0.3121360256673, 0.2160775200005), QuadraturePoint(0.0461469594684 / 2, 0.2160775200005, 0.4717864543321), QuadraturePoint(0.0461469594684 / 2, 0.3121360256673, 0.4717864543321), QuadraturePoint(0.0461469594684 / 2, 0.4717864543321, 0.3121360256673), QuadraturePoint(0.0461469594684 / 2, 0.4717864543321, 0.2160775200005), QuadraturePoint(0.0469152468624 / 2, 0.4376579903849, 0.4376579903849), QuadraturePoint(0.0469152468624 / 2, 0.4376579903849, 0.1246840192303), QuadraturePoint(0.0469152468624 / 2, 0.1246840192303, 0.4376579903849), QuadraturePoint(0.0551199980347 / 2, 0.3333333333333, 0.3333333333333), }; const QuadratureFormular QuadratureFormular_T_21(21, 91, P_QuadratureFormular_T_21); static QuadraturePoint P_QuadratureFormular_T_23 [] = { QuadraturePoint(0.0006438298261 / 2, 0.0087809303836, 0.9903676436772), QuadraturePoint(0.0006438413076 / 2, 0.9903675314220, 0.0087809216232), QuadraturePoint(0.0010134735710 / 2, 0.0027029276450, 0.0335914404439), QuadraturePoint(0.0010134752576 / 2, 0.0335909214524, 0.0027028946710), QuadraturePoint(0.0019679929935 / 2, 0.0091675068606, 0.0091676353051), QuadraturePoint(0.0033467313784 / 2, 0.9675568182558, 0.0084737176656), QuadraturePoint(0.0033467339208 / 2, 0.0084737200688, 0.9675569435345), QuadraturePoint(0.0042873323375 / 2, 0.0078781948792, 0.0676784943862), QuadraturePoint(0.0042873459885 / 2, 0.0676785477700, 0.0078781659291), QuadraturePoint(0.0043003801372 / 2, 0.9470266955047, 0.0442974541187), QuadraturePoint(0.0043003849098 / 2, 0.0442974755680, 0.9470266676487), QuadraturePoint(0.0056934629205 / 2, 0.9144243214882, 0.0081735455132), QuadraturePoint(0.0056934640134 / 2, 0.0081735424459, 0.9144244234031), QuadraturePoint(0.0061643868015 / 2, 0.2497452292741, 0.3833232434720), QuadraturePoint(0.0061644756418 / 2, 0.3833232646055, 0.2497451268005), QuadraturePoint(0.0062014513591 / 2, 0.8876850353557, 0.1035328809446), QuadraturePoint(0.0062014531952 / 2, 0.1035329228297, 0.8876849931840), QuadraturePoint(0.0069636330294 / 2, 0.0077255923618, 0.1403190991974), QuadraturePoint(0.0069636331842 / 2, 0.1403192425107, 0.0077255934624), QuadraturePoint(0.0075066257720 / 2, 0.8104591009652, 0.1809642523926), QuadraturePoint(0.0075066264565 / 2, 0.1809643003717, 0.8104590515334), QuadraturePoint(0.0079074768339 / 2, 0.8330767948684, 0.0083010939677), QuadraturePoint(0.0079074772485 / 2, 0.0083010907126, 0.8330768545392), QuadraturePoint(0.0080353344623 / 2, 0.0348407706147, 0.0348406969482), QuadraturePoint(0.0087963441074 / 2, 0.2740287679608, 0.7173981847948), QuadraturePoint(0.0087963448112 / 2, 0.7173982224778, 0.2740287304386), QuadraturePoint(0.0091304195716 / 2, 0.2394976858234, 0.0081859182262), QuadraturePoint(0.0091304213611 / 2, 0.0081859185845, 0.2394975566677), QuadraturePoint(0.0092821748751 / 2, 0.0068836152075, 0.4843740892687), QuadraturePoint(0.0092821815662 / 2, 0.4843741485699, 0.0068836232949), QuadraturePoint(0.0094499806178 / 2, 0.4960767772741, 0.4960767529507), QuadraturePoint(0.0094627468484 / 2, 0.6112936776245, 0.3804323691239), QuadraturePoint(0.0094627485294 / 2, 0.3804323980345, 0.6112936466533), QuadraturePoint(0.0095555772285 / 2, 0.7303890713524, 0.0083987179701), QuadraturePoint(0.0095555792843 / 2, 0.0083987168639, 0.7303890895407), QuadraturePoint(0.0096138842488 / 2, 0.6128525675612, 0.0075475979695), QuadraturePoint(0.0096138846826 / 2, 0.0075475961037, 0.6128525484582), QuadraturePoint(0.0099991524212 / 2, 0.0079525316513, 0.3559773826721), QuadraturePoint(0.0099991551850 / 2, 0.3559774870460, 0.0079525358502), QuadraturePoint(0.0100301319277 / 2, 0.9110236977966, 0.0437233665345), QuadraturePoint(0.0100301346636 / 2, 0.0437233605166, 0.9110236807446), QuadraturePoint(0.0124936676185 / 2, 0.0388480061835, 0.0967030908282), QuadraturePoint(0.0124936726125 / 2, 0.0967032117936, 0.0388479942386), QuadraturePoint(0.0140197309137 / 2, 0.0873226911312, 0.0873226620391), QuadraturePoint(0.0143336216896 / 2, 0.0421445202084, 0.8485617789108), QuadraturePoint(0.0143336272125 / 2, 0.8485617974961, 0.0421445420915), QuadraturePoint(0.0153604142740 / 2, 0.8477921333864, 0.1067435942472), QuadraturePoint(0.0153604183425 / 2, 0.1067435889398, 0.8477921328146), QuadraturePoint(0.0184523825614 / 2, 0.1833966521991, 0.0416340521608), QuadraturePoint(0.0184523863146 / 2, 0.0416340541167, 0.1833965196930), QuadraturePoint(0.0195833983573 / 2, 0.7611632251560, 0.1941599202852), QuadraturePoint(0.0195834019994 / 2, 0.1941599254144, 0.7611632153938), QuadraturePoint(0.0197632751342 / 2, 0.7579378747173, 0.0439826608586), QuadraturePoint(0.0197632766677 / 2, 0.0439826512395, 0.7579378242308), QuadraturePoint(0.0198806391019 / 2, 0.0369760535918, 0.5363186076436), QuadraturePoint(0.0198806485776 / 2, 0.5363187134342, 0.0369760780935), QuadraturePoint(0.0207181838484 / 2, 0.1001256948921, 0.7912267093545), QuadraturePoint(0.0207181934893 / 2, 0.7912266693524, 0.1001257554673), QuadraturePoint(0.0208943071440 / 2, 0.0379866714177, 0.4157413128558), QuadraturePoint(0.0208943251956 / 2, 0.4157414028965, 0.0379867061535), QuadraturePoint(0.0214864573885 / 2, 0.6507106491463, 0.0420141226713), QuadraturePoint(0.0214864586007 / 2, 0.0420141133438, 0.6507105645084), QuadraturePoint(0.0222218133036 / 2, 0.0425548444254, 0.2920626023484), QuadraturePoint(0.0222218160203 / 2, 0.2920627107240, 0.0425548546753), QuadraturePoint(0.0223345305455 / 2, 0.5389729538180, 0.4193031469005), QuadraturePoint(0.0223345378739 / 2, 0.4193031828489, 0.5389729093610), QuadraturePoint(0.0224758924946 / 2, 0.6549472009700, 0.3007352636162), QuadraturePoint(0.0224758980440 / 2, 0.3007352790917, 0.6549471812731), QuadraturePoint(0.0229701395845 / 2, 0.3752400771585, 0.3453980130752), QuadraturePoint(0.0229703394438 / 2, 0.3453980282786, 0.3752400695673), QuadraturePoint(0.0232798376102 / 2, 0.0994532168761, 0.1598308695187), QuadraturePoint(0.0232798427506 / 2, 0.1598309359585, 0.0994531960132), QuadraturePoint(0.0269483199647 / 2, 0.1797326661667, 0.7124585430924), QuadraturePoint(0.0269483307107 / 2, 0.7124584461943, 0.1797327722240), QuadraturePoint(0.0280438758010 / 2, 0.1066065678636, 0.7001701784175), QuadraturePoint(0.0280438764607 / 2, 0.7001701904096, 0.1066065855677), QuadraturePoint(0.0287526270172 / 2, 0.0993303629801, 0.6065647984796), QuadraturePoint(0.0287526387271 / 2, 0.6065648052521, 0.0993303896769), QuadraturePoint(0.0298980829063 / 2, 0.1023223542704, 0.2533381579528), QuadraturePoint(0.0298980922759 / 2, 0.2533382324938, 0.1023223826189), QuadraturePoint(0.0309004358516 / 2, 0.6166226715217, 0.2769502060575), QuadraturePoint(0.0309004385956 / 2, 0.2769500693109, 0.6166227900624), QuadraturePoint(0.0314031017088 / 2, 0.0904184571873, 0.4981522637001), QuadraturePoint(0.0314031073955 / 2, 0.4981522767248, 0.0904185045149), QuadraturePoint(0.0319191553024 / 2, 0.0928231860168, 0.3738418516908), QuadraturePoint(0.0319191668378 / 2, 0.3738418699229, 0.0928232584790), QuadraturePoint(0.0321429924062 / 2, 0.2521678840407, 0.2521680925697), QuadraturePoint(0.0330395601388 / 2, 0.5087500218708, 0.3905580544330), QuadraturePoint(0.0330395631829 / 2, 0.3905579116731, 0.5087501437661), QuadraturePoint(0.0356169095589 / 2, 0.1706141469096, 0.5266738039554), QuadraturePoint(0.0356169276054 / 2, 0.5266737761312, 0.1706142257537), QuadraturePoint(0.0365741189998 / 2, 0.3487581527629, 0.2588055084886), QuadraturePoint(0.0365741515204 / 2, 0.2588053596017, 0.3487583491703), QuadraturePoint(0.0365977646990 / 2, 0.1696614558053, 0.3013522183964), QuadraturePoint(0.0365978053889 / 2, 0.3013521806875, 0.1696615963219), QuadraturePoint(0.0369945680114 / 2, 0.2580202409759, 0.4584741774478), QuadraturePoint(0.0369945775059 / 2, 0.4584740860198, 0.2580203819011), QuadraturePoint(0.0374053623787 / 2, 0.1848898683498, 0.1848898704551), QuadraturePoint(0.0375550258317 / 2, 0.6130740338465, 0.1921611994069), QuadraturePoint(0.0375550312530 / 2, 0.1921611750994, 0.6130740398389), QuadraturePoint(0.0388887693486 / 2, 0.4180541160599, 0.1650613336416), QuadraturePoint(0.0388887708342 / 2, 0.1650612642036, 0.4180541199244), QuadraturePoint(0.0392705643548 / 2, 0.5159205739625, 0.2982719005229), QuadraturePoint(0.0392705802517 / 2, 0.2982718935750, 0.5159205534362), QuadraturePoint(0.0398766879831 / 2, 0.4098894602340, 0.4098894317792), }; const QuadratureFormular QuadratureFormular_T_23(23, 105, P_QuadratureFormular_T_23); static QuadraturePoint P_QuadratureFormular_T_25 [] = { QuadraturePoint(0.0014873417859 / 2, 0.0082881595033, 0.9848202768869), QuadraturePoint(0.0014889035262 / 2, 0.4618422030241, 0.5381577969759), QuadraturePoint(0.0015005944380 / 2, 0.0071066441239, 0.0080842361390), QuadraturePoint(0.0015059208313 / 2, 0.9847613141699, 0.0070015755134), QuadraturePoint(0.0015318868715 / 2, 0.5374447869049, 0.4625552130951), QuadraturePoint(0.0023032634487 / 2, 0.0000000000000, 0.4887676880140), QuadraturePoint(0.0023649067042 / 2, 0.4914131929361, 0.0000000000000), QuadraturePoint(0.0028751143611 / 2, 0.0070345937020, 0.9574158053697), QuadraturePoint(0.0029862488735 / 2, 0.9564734714228, 0.0364655449485), QuadraturePoint(0.0030384162737 / 2, 0.0370198792045, 0.0070908577166), QuadraturePoint(0.0032092459688 / 2, 0.1024124542747, 0.8936125594937), QuadraturePoint(0.0037029598435 / 2, 0.5928065811509, 0.0049451705600), QuadraturePoint(0.0037407186035 / 2, 0.0050948422371, 0.0996676659189), QuadraturePoint(0.0038452543223 / 2, 0.0081562023689, 0.0415561148784), QuadraturePoint(0.0038670778668 / 2, 0.0424936107568, 0.9494865260352), QuadraturePoint(0.0039192555178 / 2, 0.9495543500844, 0.0081794507292), QuadraturePoint(0.0039573282688 / 2, 0.8932787471239, 0.0053224326262), QuadraturePoint(0.0044032251724 / 2, 0.0069317612927, 0.9065401020433), QuadraturePoint(0.0045907108173 / 2, 0.9035839030665, 0.0894771171077), QuadraturePoint(0.0047023669435 / 2, 0.0905665738209, 0.0070525342005), QuadraturePoint(0.0050014843818 / 2, 0.0083929332787, 0.6663179931111), QuadraturePoint(0.0052387830156 / 2, 0.6261245686071, 0.0092197583153), QuadraturePoint(0.0054422104092 / 2, 0.0062801592979, 0.8335207460527), QuadraturePoint(0.0056931248912 / 2, 0.8272539257367, 0.1665134939330), QuadraturePoint(0.0059107422989 / 2, 0.0062005875353, 0.7424693255229), QuadraturePoint(0.0059687967687 / 2, 0.1676900311185, 0.0065717743528), QuadraturePoint(0.0067262190287 / 2, 0.7199353069567, 0.0064354534962), QuadraturePoint(0.0068307848624 / 2, 0.2749740090237, 0.7185296120719), QuadraturePoint(0.0069531259112 / 2, 0.0079257582005, 0.1766411374714), QuadraturePoint(0.0072460270642 / 2, 0.0069981220752, 0.2704767254004), QuadraturePoint(0.0072728189613 / 2, 0.8125248773263, 0.0082299533210), QuadraturePoint(0.0073008930847 / 2, 0.0073536969970, 0.5934167875453), QuadraturePoint(0.0073604666776 / 2, 0.7283665935411, 0.2648817553752), QuadraturePoint(0.0074119923255 / 2, 0.1800642304565, 0.8115848976682), QuadraturePoint(0.0074892214336 / 2, 0.2658102467762, 0.0068553525429), QuadraturePoint(0.0078604067260 / 2, 0.0070892364520, 0.3757632659744), QuadraturePoint(0.0078621726423 / 2, 0.3774054302043, 0.6148573533757), QuadraturePoint(0.0080506361066 / 2, 0.0369649608668, 0.9210792302893), QuadraturePoint(0.0081442860473 / 2, 0.9203194109805, 0.0426025082114), QuadraturePoint(0.0081478804152 / 2, 0.0425477806431, 0.0372689941794), QuadraturePoint(0.0092444146612 / 2, 0.6191278394983, 0.3724055713809), QuadraturePoint(0.0094674635165 / 2, 0.3762697209178, 0.0081436422011), QuadraturePoint(0.0097132210137 / 2, 0.0956111149690, 0.8771098372601), QuadraturePoint(0.0099753581151 / 2, 0.0302473410377, 0.0943858903393), QuadraturePoint(0.0103367803673 / 2, 0.8739905691754, 0.0313198990883), QuadraturePoint(0.0112263277166 / 2, 0.8604133734958, 0.1049019782046), QuadraturePoint(0.0114309118745 / 2, 0.0347307852352, 0.8609856462886), QuadraturePoint(0.0115550567487 / 2, 0.1043606608343, 0.0357152881004), QuadraturePoint(0.0135575856957 / 2, 0.7797622824754, 0.1872318199265), QuadraturePoint(0.0135984962900 / 2, 0.0185865164256, 0.4834397678794), QuadraturePoint(0.0137754813837 / 2, 0.0324585286618, 0.7783474916042), QuadraturePoint(0.0137961015942 / 2, 0.8371293901157, 0.0804060570156), QuadraturePoint(0.0138408839904 / 2, 0.0836602075315, 0.8421414817051), QuadraturePoint(0.0140634019977 / 2, 0.0784070242501, 0.0849927089145), QuadraturePoint(0.0140991451009 / 2, 0.4929238648458, 0.4892855914710), QuadraturePoint(0.0142004111991 / 2, 0.1870637584073, 0.0345210858281), QuadraturePoint(0.0144518424517 / 2, 0.4892636967025, 0.0190774755077), QuadraturePoint(0.0150245979639 / 2, 0.0401982618372, 0.1691143187109), QuadraturePoint(0.0152817804122 / 2, 0.7894259278865, 0.0412206731484), QuadraturePoint(0.0155550724169 / 2, 0.1686260456429, 0.7894860640585), QuadraturePoint(0.0164570886000 / 2, 0.3750901913174, 0.5895318272013), QuadraturePoint(0.0165275759573 / 2, 0.0356362876880, 0.3681256217699), QuadraturePoint(0.0166847554451 / 2, 0.5887548164804, 0.0359968962541), QuadraturePoint(0.0167409312985 / 2, 0.0373308082182, 0.6790704673533), QuadraturePoint(0.0168674663361 / 2, 0.2820769993374, 0.0373639992361), QuadraturePoint(0.0168882230165 / 2, 0.6819277603320, 0.2803330345725), QuadraturePoint(0.0172087112691 / 2, 0.0374938324382, 0.2634016180014), QuadraturePoint(0.0174681068264 / 2, 0.6984079204127, 0.0364154673322), QuadraturePoint(0.0176663899614 / 2, 0.2654390894079, 0.6980717436193), QuadraturePoint(0.0182967621475 / 2, 0.1429848440800, 0.7612254618453), QuadraturePoint(0.0183576852459 / 2, 0.7623554007647, 0.0943741220275), QuadraturePoint(0.0186392569521 / 2, 0.0934222022749, 0.1479799836832), QuadraturePoint(0.0189781060590 / 2, 0.5759004479923, 0.3821329641698), QuadraturePoint(0.0191847922578 / 2, 0.3822427332525, 0.0426716362301), QuadraturePoint(0.0194080442044 / 2, 0.0411414081675, 0.5718082874432), QuadraturePoint(0.0194720072193 / 2, 0.0802462538379, 0.7702204382042), QuadraturePoint(0.0200855080495 / 2, 0.7625229819410, 0.1559420577362), QuadraturePoint(0.0201673909332 / 2, 0.1524941445131, 0.0842965421322), QuadraturePoint(0.0221742162761 / 2, 0.0622159195833, 0.4538181318873), QuadraturePoint(0.0229702440508 / 2, 0.1109539036076, 0.4586014071171), QuadraturePoint(0.0233465117399 / 2, 0.4575627212057, 0.4795313560210), QuadraturePoint(0.0234883135338 / 2, 0.4322865136374, 0.1230591237472), QuadraturePoint(0.0240682099018 / 2, 0.5865002850241, 0.0834119779793), QuadraturePoint(0.0240910792953 / 2, 0.0869359250818, 0.6755677013351), QuadraturePoint(0.0245677049481 / 2, 0.0929594906936, 0.2326500892727), QuadraturePoint(0.0246536315719 / 2, 0.6661932141454, 0.2448294007406), QuadraturePoint(0.0246756530052 / 2, 0.4780306362227, 0.0661749044835), QuadraturePoint(0.0249704602710 / 2, 0.4372215294577, 0.4442145585244), QuadraturePoint(0.0250026544082 / 2, 0.6779224504669, 0.0929096534577), QuadraturePoint(0.0250490869426 / 2, 0.2423431255660, 0.0889793655129), QuadraturePoint(0.0250936250125 / 2, 0.2288925420305, 0.6780053081672), QuadraturePoint(0.0251482076226 / 2, 0.3315065049959, 0.5847381559741), QuadraturePoint(0.0255010290447 / 2, 0.3424200526607, 0.5139245722736), QuadraturePoint(0.0256544511979 / 2, 0.0862630046475, 0.3340976249234), QuadraturePoint(0.0257974750630 / 2, 0.5113188946635, 0.1380154720554), QuadraturePoint(0.0270007753993 / 2, 0.1538977841001, 0.6788062619562), QuadraturePoint(0.0274431536844 / 2, 0.6779951348472, 0.1663358925269), QuadraturePoint(0.0277072401488 / 2, 0.1664600469411, 0.1582214504849), QuadraturePoint(0.0278284415364 / 2, 0.0950910318888, 0.5666590332543), QuadraturePoint(0.0287207381105 / 2, 0.3436048136712, 0.0978960873457), QuadraturePoint(0.0288826834956 / 2, 0.5560417025366, 0.3468917820947), QuadraturePoint(0.0293302729759 / 2, 0.1452404029513, 0.3599534491052), QuadraturePoint(0.0318902879557 / 2, 0.1619685156238, 0.5810131373330), QuadraturePoint(0.0319083660286 / 2, 0.5800164844262, 0.2560674640672), QuadraturePoint(0.0320938960329 / 2, 0.2450201223288, 0.5881469552102), QuadraturePoint(0.0321618608780 / 2, 0.2557621891794, 0.1652244065047), QuadraturePoint(0.0322424127534 / 2, 0.2205239985511, 0.3496507466106), QuadraturePoint(0.0327072446421 / 2, 0.4940183111285, 0.2549448448453), QuadraturePoint(0.0329946316695 / 2, 0.2531570689798, 0.2543369115017), QuadraturePoint(0.0331828096025 / 2, 0.5846891116357, 0.1666603916479), QuadraturePoint(0.0334857162651 / 2, 0.1660333602278, 0.2523240191705), QuadraturePoint(0.0335468472792 / 2, 0.2505426292461, 0.4959007627528), QuadraturePoint(0.0337049042988 / 2, 0.3519336802182, 0.1805380367800), QuadraturePoint(0.0340361462767 / 2, 0.3502668835419, 0.4358582329881), QuadraturePoint(0.0342465235323 / 2, 0.4400892485512, 0.2120576104941), QuadraturePoint(0.0345528817251 / 2, 0.4680855471546, 0.3552681570774), QuadraturePoint(0.0356782875703 / 2, 0.1770237763947, 0.4670352922266), QuadraturePoint(0.0364656225016 / 2, 0.3900920779501, 0.3323152819300), QuadraturePoint(0.0365172708706 / 2, 0.2805847774120, 0.3898041176680), QuadraturePoint(0.0371924811018 / 2, 0.3361523347440, 0.2778500044356), }; const QuadratureFormular QuadratureFormular_T_25(25, 120, P_QuadratureFormular_T_25); template const GQuadratureFormular*BuilQFd (const long &nex, const KNM_ &qf) { ffassert(qf.M() == Rd::d + 1); int np = qf.N(); GQuadraturePoint *pq = new GQuadraturePoint[np]; for (int i = 0; i < np; ++i) { pq[i].a = qf(i, 0); for (int j = 0; j < Rd::d; ++j) { pq[i][j] = qf(i, j + 1); } // cout << i << " " << pq[i].a << " " << (const Rd&) pq[i] << " " << qf(':',i) << endl; } return new GQuadratureFormular(nex, np, pq, true); } template T*CCopy (T *pr, T p) { *pr = p; return pr; } template const GQuadratureFormular**pBuilQFd (const GQuadratureFormular **const &pr, const long &nex, const KNM_ &qf) { // cout << "pBuilQFd " << pr << " " << *pr << endl; ffassert(pr); *pr = BuilQFd(nex, qf); return pr; } // to add new FreeFem++ type ... typedef GQuadraturePoint PQP3; typedef GQuadratureFormular PQF3; // QUAD QUAD_3D_P1_ = { 1 4 PQP3 QF_TET_P1 [] = { PQP3(R3(0.25, 0.25, 0.25), 1.), // 0 0 }; PQF3 const QuadratureFormular_Tet_P1(1, 1, QF_TET_P1); // QUAD QUAD_3D_P2_ = { 4 16 PQP3 QF_TET_P2 [] = { PQP3(R3(.13819660112501051517954131656343619, .13819660112501051517954131656343619, .13819660112501051517954131656343619), .25),// 0 0 PQP3(R3(1. - 3. * (.13819660112501051517954131656343619), .13819660112501051517954131656343619, .13819660112501051517954131656343619), .25),// 1 4 PQP3(R3(.13819660112501051517954131656343619, 1. - 3. * (.13819660112501051517954131656343619), .13819660112501051517954131656343619), .25),// 2 8 PQP3(R3(.13819660112501051517954131656343619, .13819660112501051517954131656343619, 1. - 3. * (.13819660112501051517954131656343619)), .25),// 3 12 }; PQF3 const QuadratureFormular_Tet_P2(2, 4, QF_TET_P2); // QUAD QUAD_3D_P3_ = { 8 32 PQP3 QF_TET_P3 [] = { PQP3(R3(.32805469671142664733580581998119743, .32805469671142664733580581998119743, .32805469671142664733580581998119743), .13852796651186214232361769837564129), // 0 0 PQP3(R3(1. - 3. * (.32805469671142664733580581998119743), .32805469671142664733580581998119743, .32805469671142664733580581998119743), .13852796651186214232361769837564129), // 1 4 PQP3(R3(.32805469671142664733580581998119743, 1. - 3. * (.32805469671142664733580581998119743), .32805469671142664733580581998119743), .13852796651186214232361769837564129), // 2 8 PQP3(R3(.32805469671142664733580581998119743, .32805469671142664733580581998119743, 1. - 3. * (.32805469671142664733580581998119743)), .13852796651186214232361769837564129), // 3 12 PQP3(R3(.10695227393293068277170204157061650, .10695227393293068277170204157061650, .10695227393293068277170204157061650), .11147203348813785767638230162435871), // 4 16 PQP3(R3(1. - 3. * (.10695227393293068277170204157061650), .10695227393293068277170204157061650, .10695227393293068277170204157061650), .11147203348813785767638230162435871), // 5 20 PQP3(R3(.10695227393293068277170204157061650, 1. - 3. * (.10695227393293068277170204157061650), .10695227393293068277170204157061650), .11147203348813785767638230162435871), // 6 24 PQP3(R3(.10695227393293068277170204157061650, .10695227393293068277170204157061650, 1. - 3. * (.10695227393293068277170204157061650)), .11147203348813785767638230162435871), // 7 28 }; PQF3 const QuadratureFormular_Tet_P3(3, 8, QF_TET_P3); // QUAD QUAD_3D_P4_ = { 14 56 PQP3 QF_TET_P4 [] = { PQP3(R3(.09273525031089122628655892066032137, .09273525031089122628655892066032137, .09273525031089122628655892066032137), .07349304311636194934358694586367885), // 0 0 PQP3(R3(1. - 3. * (.09273525031089122628655892066032137), .09273525031089122628655892066032137, .09273525031089122628655892066032137), .07349304311636194934358694586367885), // 1 4 PQP3(R3(.09273525031089122628655892066032137, 1. - 3. * (.09273525031089122628655892066032137), .09273525031089122628655892066032137), .07349304311636194934358694586367885), // 2 8 PQP3(R3(.09273525031089122628655892066032137, .09273525031089122628655892066032137, 1. - 3. * (.09273525031089122628655892066032137)), .07349304311636194934358694586367885), // 3 12 PQP3(R3(.31088591926330060975814749494040332, .31088591926330060975814749494040332, .31088591926330060975814749494040332), .11268792571801585036501492847638892), // 4 16 PQP3(R3(1. - 3. * (.31088591926330060975814749494040332), .31088591926330060975814749494040332, .31088591926330060975814749494040332), .11268792571801585036501492847638892), // 5 20 PQP3(R3(.31088591926330060975814749494040332, 1. - 3. * (.31088591926330060975814749494040332), .31088591926330060975814749494040332), .11268792571801585036501492847638892), // 6 24 PQP3(R3(.31088591926330060975814749494040332, .31088591926330060975814749494040332, 1. - 3. * (.31088591926330060975814749494040332)), .11268792571801585036501492847638892), // 7 28 PQP3(R3(.04550370412564965000000000000000000, .5 - (.04550370412564965000000000000000000), .5 - (.04550370412564965000000000000000000)), .04254602077708146686093208377328816), // 8 32 PQP3(R3(.5 - (.04550370412564965000000000000000000), .04550370412564965000000000000000000, .5 - (.04550370412564965000000000000000000)), .04254602077708146686093208377328816), // 9 36 PQP3(R3(.5 - (.04550370412564965000000000000000000), .5 - (.04550370412564965000000000000000000), .04550370412564965000000000000000000), .04254602077708146686093208377328816), // 10 40 PQP3(R3(.04550370412564965000000000000000000, .5 - (.04550370412564965000000000000000000), .04550370412564965000000000000000000), .04254602077708146686093208377328816),// 11 44 PQP3(R3(.04550370412564965000000000000000000, .04550370412564965000000000000000000, .5 - (.04550370412564965000000000000000000)), .04254602077708146686093208377328816),// 12 48 PQP3(R3(.5 - (.04550370412564965000000000000000000), .04550370412564965000000000000000000, .04550370412564965000000000000000000), .04254602077708146686093208377328816),// 13 52 }; PQF3 const QuadratureFormular_Tet_P4(4, 14, QF_TET_P4); // QUAD QUAD_3D_P5_ = { 14 56 PQP3 QF_TET_P5 [] = { PQP3(R3(.31088591926330060979734573376345783, .31088591926330060979734573376345783, .31088591926330060979734573376345783), .11268792571801585079918565233328633), // 0 0 PQP3(R3(1. - 3. * (.31088591926330060979734573376345783), .31088591926330060979734573376345783, .31088591926330060979734573376345783), .11268792571801585079918565233328633), // 1 4 PQP3(R3(.31088591926330060979734573376345783, 1. - 3. * (.31088591926330060979734573376345783), .31088591926330060979734573376345783), .11268792571801585079918565233328633), // 2 8 PQP3(R3(.31088591926330060979734573376345783, .31088591926330060979734573376345783, 1. - 3. * (.31088591926330060979734573376345783)), .11268792571801585079918565233328633), // 3 12 PQP3(R3(.09273525031089122640232391373703061, .09273525031089122640232391373703061, .09273525031089122640232391373703061), .07349304311636194954371020548632750), // 4 16 PQP3(R3(1. - 3. * (.09273525031089122640232391373703061), .09273525031089122640232391373703061, .09273525031089122640232391373703061), .07349304311636194954371020548632750), // 5 20 PQP3(R3(.09273525031089122640232391373703061, 1. - 3. * (.09273525031089122640232391373703061), .09273525031089122640232391373703061), .07349304311636194954371020548632750), // 6 24 PQP3(R3(.09273525031089122640232391373703061, .09273525031089122640232391373703061, 1. - 3. * (.09273525031089122640232391373703061)), .07349304311636194954371020548632750), // 7 28 PQP3(R3(.04550370412564964949188052627933943, .5 - (.04550370412564964949188052627933943), .5 - (.04550370412564964949188052627933943)), .04254602077708146643806942812025744), // 8 32 PQP3(R3(.5 - (.04550370412564964949188052627933943), .04550370412564964949188052627933943, .5 - (.04550370412564964949188052627933943)), .04254602077708146643806942812025744), // 9 36 PQP3(R3(.5 - (.04550370412564964949188052627933943), .5 - (.04550370412564964949188052627933943), .04550370412564964949188052627933943), .04254602077708146643806942812025744), // 10 40 PQP3(R3(.04550370412564964949188052627933943, .5 - (.04550370412564964949188052627933943), .04550370412564964949188052627933943), .04254602077708146643806942812025744),// 11 44 PQP3(R3(.04550370412564964949188052627933943, .04550370412564964949188052627933943, .5 - (.04550370412564964949188052627933943)), .04254602077708146643806942812025744),// 12 48 PQP3(R3(.5 - (.04550370412564964949188052627933943), .04550370412564964949188052627933943, .04550370412564964949188052627933943), .04254602077708146643806942812025744),// 13 52 }; PQF3 const QuadratureFormular_Tet_P5(5, 14, QF_TET_P5); // QUAD QUAD_3D_P6_ = { 24 96 PQP3 QF_TET_P6 [] = { PQP3(R3(.21460287125915202928883921938628499, .21460287125915202928883921938628499, .21460287125915202928883921938628499), .03992275025816749209969062755747998), // 0 0 PQP3(R3(1. - 3. * (.21460287125915202928883921938628499), .21460287125915202928883921938628499, .21460287125915202928883921938628499), .03992275025816749209969062755747998), // 1 4 PQP3(R3(.21460287125915202928883921938628499, 1. - 3. * (.21460287125915202928883921938628499), .21460287125915202928883921938628499), .03992275025816749209969062755747998), // 2 8 PQP3(R3(.21460287125915202928883921938628499, .21460287125915202928883921938628499, 1. - 3. * (.21460287125915202928883921938628499)), .03992275025816749209969062755747998), // 3 12 PQP3(R3(.04067395853461135311557944895641006, .04067395853461135311557944895641006, .04067395853461135311557944895641006), .01007721105532064294801323744593686), // 4 16 PQP3(R3(1. - 3. * (.04067395853461135311557944895641006), .04067395853461135311557944895641006, .04067395853461135311557944895641006), .01007721105532064294801323744593686), // 5 20 PQP3(R3(.04067395853461135311557944895641006, 1. - 3. * (.04067395853461135311557944895641006), .04067395853461135311557944895641006), .01007721105532064294801323744593686), // 6 24 PQP3(R3(.04067395853461135311557944895641006, .04067395853461135311557944895641006, 1. - 3. * (.04067395853461135311557944895641006)), .01007721105532064294801323744593686), // 7 28 PQP3(R3(.32233789014227551034399447076249213, .32233789014227551034399447076249213, .32233789014227551034399447076249213), .05535718154365472209515327785372602), // 8 32 PQP3(R3(1. - 3. * (.32233789014227551034399447076249213), .32233789014227551034399447076249213, .32233789014227551034399447076249213), .05535718154365472209515327785372602), // 9 36 PQP3(R3(.32233789014227551034399447076249213, 1. - 3. * (.32233789014227551034399447076249213), .32233789014227551034399447076249213), .05535718154365472209515327785372602), // 10 40 PQP3(R3(.32233789014227551034399447076249213, .32233789014227551034399447076249213, 1. - 3. * (.32233789014227551034399447076249213)), .05535718154365472209515327785372602), // 11 44 PQP3(R3(.06366100187501752529923552760572698, .60300566479164914136743113906093969, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969)), 27. / 560.),// 12 48 PQP3(R3(.06366100187501752529923552760572698, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .60300566479164914136743113906093969), 27. / 560.),// 13 52 PQP3(R3(.60300566479164914136743113906093969, .06366100187501752529923552760572698, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969)), 27. / 560.),// 14 56 PQP3(R3(.60300566479164914136743113906093969, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .06366100187501752529923552760572698), 27. / 560.),// 15 60 PQP3(R3(1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .06366100187501752529923552760572698, .60300566479164914136743113906093969), 27. / 560.),// 16 64 PQP3(R3(1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .60300566479164914136743113906093969, .06366100187501752529923552760572698), 27. / 560.),// 17 68 PQP3(R3(.06366100187501752529923552760572698, .06366100187501752529923552760572698, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969)), 27. / 560.),// 18 72 PQP3(R3(.06366100187501752529923552760572698, 1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .06366100187501752529923552760572698), 27. / 560.),// 19 76 PQP3(R3(1. - (.06366100187501752529923552760572698) - (.06366100187501752529923552760572698) - (.60300566479164914136743113906093969), .06366100187501752529923552760572698, .06366100187501752529923552760572698), 27. / 560.),// 20 80 PQP3(R3(.06366100187501752529923552760572698, .06366100187501752529923552760572698, .60300566479164914136743113906093969), 27. / 560.), // 21 84 PQP3(R3(.06366100187501752529923552760572698, .60300566479164914136743113906093969, .06366100187501752529923552760572698), 27. / 560.), // 22 88 PQP3(R3(.60300566479164914136743113906093969, .06366100187501752529923552760572698, .06366100187501752529923552760572698), 27. / 560.), // 23 92 }; PQF3 const QuadratureFormular_Tet_P6(6, 24, QF_TET_P6); // QUAD QUAD_3D_P7_ = { 35 140 PQP3 QF_TET_P7 [] = { PQP3(R3(0.25, 0.25, 0.25), .09548528946413084886057843611722638), // 0 0 PQP3(R3(.31570114977820279942342999959331149, .31570114977820279942342999959331149, .31570114977820279942342999959331149), .04232958120996702907628617079854674), // 1 4 PQP3(R3(1. - 3. * (.31570114977820279942342999959331149), .31570114977820279942342999959331149, .31570114977820279942342999959331149), .04232958120996702907628617079854674), // 2 8 PQP3(R3(.31570114977820279942342999959331149, 1. - 3. * (.31570114977820279942342999959331149), .31570114977820279942342999959331149), .04232958120996702907628617079854674), // 3 12 PQP3(R3(.31570114977820279942342999959331149, .31570114977820279942342999959331149, 1. - 3. * (.31570114977820279942342999959331149)), .04232958120996702907628617079854674), // 4 16 PQP3(R3(.05048982259839636876305382298656247, .5 - (.05048982259839636876305382298656247), .5 - (.05048982259839636876305382298656247)), .03189692783285757993427482408294246), // 5 20 PQP3(R3(.5 - (.05048982259839636876305382298656247), .05048982259839636876305382298656247, .5 - (.05048982259839636876305382298656247)), .03189692783285757993427482408294246), // 6 24 PQP3(R3(.5 - (.05048982259839636876305382298656247), .5 - (.05048982259839636876305382298656247), .05048982259839636876305382298656247), .03189692783285757993427482408294246), // 7 28 PQP3(R3(.05048982259839636876305382298656247, .5 - (.05048982259839636876305382298656247), .05048982259839636876305382298656247), .03189692783285757993427482408294246),// 8 32 PQP3(R3(.05048982259839636876305382298656247, .05048982259839636876305382298656247, .5 - (.05048982259839636876305382298656247)), .03189692783285757993427482408294246),// 9 36 PQP3(R3(.5 - (.05048982259839636876305382298656247), .05048982259839636876305382298656247, .05048982259839636876305382298656247), .03189692783285757993427482408294246),// 10 40 PQP3(R3(.18883383102600104773643110385458576, .57517163758700002348324157702230752, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752)), .03720713072833462136961556119148112), // 11 44 PQP3(R3(.18883383102600104773643110385458576, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .57517163758700002348324157702230752), .03720713072833462136961556119148112), // 12 48 PQP3(R3(.57517163758700002348324157702230752, .18883383102600104773643110385458576, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752)), .03720713072833462136961556119148112), // 13 52 PQP3(R3(.57517163758700002348324157702230752, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 14 56 PQP3(R3(1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .18883383102600104773643110385458576, .57517163758700002348324157702230752), .03720713072833462136961556119148112), // 15 60 PQP3(R3(1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .57517163758700002348324157702230752, .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 16 64 PQP3(R3(.18883383102600104773643110385458576, .18883383102600104773643110385458576, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752)), .03720713072833462136961556119148112), // 17 68 PQP3(R3(.18883383102600104773643110385458576, 1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 18 72 PQP3(R3(1. - (.18883383102600104773643110385458576) - (.18883383102600104773643110385458576) - (.57517163758700002348324157702230752), .18883383102600104773643110385458576, .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 19 76 PQP3(R3(.18883383102600104773643110385458576, .18883383102600104773643110385458576, .57517163758700002348324157702230752), .03720713072833462136961556119148112), // 20 80 PQP3(R3(.18883383102600104773643110385458576, .57517163758700002348324157702230752, .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 21 84 PQP3(R3(.57517163758700002348324157702230752, .18883383102600104773643110385458576, .18883383102600104773643110385458576), .03720713072833462136961556119148112), // 22 88 PQP3(R3(.02126547254148324598883610149981994, .81083024109854856111810537984823239, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239)), .00811077082990334156610343349109654), // 23 92 PQP3(R3(.02126547254148324598883610149981994, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .81083024109854856111810537984823239), .00811077082990334156610343349109654), // 24 96 PQP3(R3(.81083024109854856111810537984823239, .02126547254148324598883610149981994, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239)), .00811077082990334156610343349109654), // 25 100 PQP3(R3(.81083024109854856111810537984823239, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 26 104 PQP3(R3(1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .02126547254148324598883610149981994, .81083024109854856111810537984823239), .00811077082990334156610343349109654), // 27 108 PQP3(R3(1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .81083024109854856111810537984823239, .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 28 112 PQP3(R3(.02126547254148324598883610149981994, .02126547254148324598883610149981994, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239)), .00811077082990334156610343349109654), // 29 116 PQP3(R3(.02126547254148324598883610149981994, 1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 30 120 PQP3(R3(1. - (.02126547254148324598883610149981994) - (.02126547254148324598883610149981994) - (.81083024109854856111810537984823239), .02126547254148324598883610149981994, .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 31 124 PQP3(R3(.02126547254148324598883610149981994, .02126547254148324598883610149981994, .81083024109854856111810537984823239), .00811077082990334156610343349109654), // 32 128 PQP3(R3(.02126547254148324598883610149981994, .81083024109854856111810537984823239, .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 33 132 PQP3(R3(.81083024109854856111810537984823239, .02126547254148324598883610149981994, .02126547254148324598883610149981994), .00811077082990334156610343349109654), // 34 136 }; PQF3 const QuadratureFormular_Tet_P7(7, 35, QF_TET_P7); // QUAD QUAD_3D_P8_ = { 46 184 PQP3 QF_TET_P8 [] = { PQP3(R3(.03967542307038990126507132953938949, .03967542307038990126507132953938949, .03967542307038990126507132953938949), .00639714777990232132145142033517302), // 0 0 PQP3(R3(1. - 3. * (.03967542307038990126507132953938949), .03967542307038990126507132953938949, .03967542307038990126507132953938949), .00639714777990232132145142033517302), // 1 4 PQP3(R3(.03967542307038990126507132953938949, 1. - 3. * (.03967542307038990126507132953938949), .03967542307038990126507132953938949), .00639714777990232132145142033517302), // 2 8 PQP3(R3(.03967542307038990126507132953938949, .03967542307038990126507132953938949, 1. - 3. * (.03967542307038990126507132953938949)), .00639714777990232132145142033517302), // 3 12 PQP3(R3(.31448780069809631378416056269714830, .31448780069809631378416056269714830, .31448780069809631378416056269714830), .04019044802096617248816115847981783), // 4 16 PQP3(R3(1. - 3. * (.31448780069809631378416056269714830), .31448780069809631378416056269714830, .31448780069809631378416056269714830), .04019044802096617248816115847981783), // 5 20 PQP3(R3(.31448780069809631378416056269714830, 1. - 3. * (.31448780069809631378416056269714830), .31448780069809631378416056269714830), .04019044802096617248816115847981783), // 6 24 PQP3(R3(.31448780069809631378416056269714830, .31448780069809631378416056269714830, 1. - 3. * (.31448780069809631378416056269714830)), .04019044802096617248816115847981783), // 7 28 PQP3(R3(.10198669306270330000000000000000000, .10198669306270330000000000000000000, .10198669306270330000000000000000000), .02430797550477032117486910877192260), // 8 32 PQP3(R3(1. - 3. * (.10198669306270330000000000000000000), .10198669306270330000000000000000000, .10198669306270330000000000000000000), .02430797550477032117486910877192260), // 9 36 PQP3(R3(.10198669306270330000000000000000000, 1. - 3. * (.10198669306270330000000000000000000), .10198669306270330000000000000000000), .02430797550477032117486910877192260), // 10 40 PQP3(R3(.10198669306270330000000000000000000, .10198669306270330000000000000000000, 1. - 3. * (.10198669306270330000000000000000000)), .02430797550477032117486910877192260), // 11 44 PQP3(R3(.18420369694919151227594641734890918, .18420369694919151227594641734890918, .18420369694919151227594641734890918), .05485889241369744046692412399039144), // 12 48 PQP3(R3(1. - 3. * (.18420369694919151227594641734890918), .18420369694919151227594641734890918, .18420369694919151227594641734890918), .05485889241369744046692412399039144), // 13 52 PQP3(R3(.18420369694919151227594641734890918, 1. - 3. * (.18420369694919151227594641734890918), .18420369694919151227594641734890918), .05485889241369744046692412399039144), // 14 56 PQP3(R3(.18420369694919151227594641734890918, .18420369694919151227594641734890918, 1. - 3. * (.18420369694919151227594641734890918)), .05485889241369744046692412399039144), // 15 60 PQP3(R3(.06343628775453989240514123870189827, .5 - (.06343628775453989240514123870189827), .5 - (.06343628775453989240514123870189827)), .03571961223409918246495096899661762), // 16 64 PQP3(R3(.5 - (.06343628775453989240514123870189827), .06343628775453989240514123870189827, .5 - (.06343628775453989240514123870189827)), .03571961223409918246495096899661762), // 17 68 PQP3(R3(.5 - (.06343628775453989240514123870189827), .5 - (.06343628775453989240514123870189827), .06343628775453989240514123870189827), .03571961223409918246495096899661762), // 18 72 PQP3(R3(.06343628775453989240514123870189827, .5 - (.06343628775453989240514123870189827), .06343628775453989240514123870189827), .03571961223409918246495096899661762),// 19 76 PQP3(R3(.06343628775453989240514123870189827, .06343628775453989240514123870189827, .5 - (.06343628775453989240514123870189827)), .03571961223409918246495096899661762),// 20 80 PQP3(R3(.5 - (.06343628775453989240514123870189827), .06343628775453989240514123870189827, .06343628775453989240514123870189827), .03571961223409918246495096899661762),// 21 84 PQP3(R3(.02169016206772800480266248262493018, .71993192203946593588943495335273478, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478)), .00718319069785253940945110521980376), // 22 88 PQP3(R3(.02169016206772800480266248262493018, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .71993192203946593588943495335273478), .00718319069785253940945110521980376), // 23 92 PQP3(R3(.71993192203946593588943495335273478, .02169016206772800480266248262493018, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478)), .00718319069785253940945110521980376), // 24 96 PQP3(R3(.71993192203946593588943495335273478, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 25 100 PQP3(R3(1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .02169016206772800480266248262493018, .71993192203946593588943495335273478), .00718319069785253940945110521980376), // 26 104 PQP3(R3(1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .71993192203946593588943495335273478, .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 27 108 PQP3(R3(.02169016206772800480266248262493018, .02169016206772800480266248262493018, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478)), .00718319069785253940945110521980376), // 28 112 PQP3(R3(.02169016206772800480266248262493018, 1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 29 116 PQP3(R3(1. - (.02169016206772800480266248262493018) - (.02169016206772800480266248262493018) - (.71993192203946593588943495335273478), .02169016206772800480266248262493018, .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 30 120 PQP3(R3(.02169016206772800480266248262493018, .02169016206772800480266248262493018, .71993192203946593588943495335273478), .00718319069785253940945110521980376), // 31 124 PQP3(R3(.02169016206772800480266248262493018, .71993192203946593588943495335273478, .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 32 128 PQP3(R3(.71993192203946593588943495335273478, .02169016206772800480266248262493018, .02169016206772800480266248262493018), .00718319069785253940945110521980376), // 33 132 PQP3(R3(.20448008063679571424133557487274534, .58057719012880922417539817139062041, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041)), .01637218194531911754093813975611913), // 34 136 PQP3(R3(.20448008063679571424133557487274534, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .58057719012880922417539817139062041), .01637218194531911754093813975611913), // 35 140 PQP3(R3(.58057719012880922417539817139062041, .20448008063679571424133557487274534, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041)), .01637218194531911754093813975611913), // 36 144 PQP3(R3(.58057719012880922417539817139062041, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 37 148 PQP3(R3(1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .20448008063679571424133557487274534, .58057719012880922417539817139062041), .01637218194531911754093813975611913), // 38 152 PQP3(R3(1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .58057719012880922417539817139062041, .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 39 156 PQP3(R3(.20448008063679571424133557487274534, .20448008063679571424133557487274534, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041)), .01637218194531911754093813975611913), // 40 160 PQP3(R3(.20448008063679571424133557487274534, 1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 41 164 PQP3(R3(1. - (.20448008063679571424133557487274534) - (.20448008063679571424133557487274534) - (.58057719012880922417539817139062041), .20448008063679571424133557487274534, .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 42 168 PQP3(R3(.20448008063679571424133557487274534, .20448008063679571424133557487274534, .58057719012880922417539817139062041), .01637218194531911754093813975611913), // 43 172 PQP3(R3(.20448008063679571424133557487274534, .58057719012880922417539817139062041, .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 44 176 PQP3(R3(.58057719012880922417539817139062041, .20448008063679571424133557487274534, .20448008063679571424133557487274534), .01637218194531911754093813975611913), // 45 180 }; PQF3 const QuadratureFormular_Tet_P8(8, 46, QF_TET_P8); // QUAD QUAD_3D_P9_ = { 59 236 PQP3 QF_TET_P9 [] = { PQP3(R3(0.25, 0.25, 0.25), .05489853459364812686895885032391298), // 0 0 PQP3(R3(.03785502061999503609086515586175707, .03785502061999503609086515586175707, .03785502061999503609086515586175707), .00421825735654367356185795185819147), // 1 4 PQP3(R3(1. - 3. * (.03785502061999503609086515586175707), .03785502061999503609086515586175707, .03785502061999503609086515586175707), .00421825735654367356185795185819147), // 2 8 PQP3(R3(.03785502061999503609086515586175707, 1. - 3. * (.03785502061999503609086515586175707), .03785502061999503609086515586175707), .00421825735654367356185795185819147), // 3 12 PQP3(R3(.03785502061999503609086515586175707, .03785502061999503609086515586175707, 1. - 3. * (.03785502061999503609086515586175707)), .00421825735654367356185795185819147), // 4 16 PQP3(R3(.16954439965012220000000000000000000, .16954439965012220000000000000000000, .16954439965012220000000000000000000), .02348412311384798927791501022996111), // 5 20 PQP3(R3(1. - 3. * (.16954439965012220000000000000000000), .16954439965012220000000000000000000, .16954439965012220000000000000000000), .02348412311384798927791501022996111), // 6 24 PQP3(R3(.16954439965012220000000000000000000, 1. - 3. * (.16954439965012220000000000000000000), .16954439965012220000000000000000000), .02348412311384798927791501022996111), // 7 28 PQP3(R3(.16954439965012220000000000000000000, .16954439965012220000000000000000000, 1. - 3. * (.16954439965012220000000000000000000)), .02348412311384798927791501022996111), // 8 32 PQP3(R3(.05484140424416689000000000000000000, .05484140424416689000000000000000000, .05484140424416689000000000000000000), .00421283454980389148648831814037819), // 9 36 PQP3(R3(1. - 3. * (.05484140424416689000000000000000000), .05484140424416689000000000000000000, .05484140424416689000000000000000000), .00421283454980389148648831814037819), // 10 40 PQP3(R3(.05484140424416689000000000000000000, 1. - 3. * (.05484140424416689000000000000000000), .05484140424416689000000000000000000), .00421283454980389148648831814037819), // 11 44 PQP3(R3(.05484140424416689000000000000000000, .05484140424416689000000000000000000, 1. - 3. * (.05484140424416689000000000000000000)), .00421283454980389148648831814037819), // 12 48 PQP3(R3(.32229717190921058836777748445908171, .32229717190921058836777748445908171, .32229717190921058836777748445908171), .02994712640542812769203037546126163), // 13 52 PQP3(R3(1. - 3. * (.32229717190921058836777748445908171), .32229717190921058836777748445908171, .32229717190921058836777748445908171), .02994712640542812769203037546126163), // 14 56 PQP3(R3(.32229717190921058836777748445908171, 1. - 3. * (.32229717190921058836777748445908171), .32229717190921058836777748445908171), .02994712640542812769203037546126163), // 15 60 PQP3(R3(.32229717190921058836777748445908171, .32229717190921058836777748445908171, 1. - 3. * (.32229717190921058836777748445908171)), .02994712640542812769203037546126163), // 16 64 PQP3(R3(.10961777508972033704050355954365052, .5 - (.10961777508972033704050355954365052), .5 - (.10961777508972033704050355954365052)), .03695441750679136335292416138761121), // 17 68 PQP3(R3(.5 - (.10961777508972033704050355954365052), .10961777508972033704050355954365052, .5 - (.10961777508972033704050355954365052)), .03695441750679136335292416138761121), // 18 72 PQP3(R3(.5 - (.10961777508972033704050355954365052), .5 - (.10961777508972033704050355954365052), .10961777508972033704050355954365052), .03695441750679136335292416138761121), // 19 76 PQP3(R3(.10961777508972033704050355954365052, .5 - (.10961777508972033704050355954365052), .10961777508972033704050355954365052), .03695441750679136335292416138761121),// 20 80 PQP3(R3(.10961777508972033704050355954365052, .10961777508972033704050355954365052, .5 - (.10961777508972033704050355954365052)), .03695441750679136335292416138761121),// 21 84 PQP3(R3(.5 - (.10961777508972033704050355954365052), .10961777508972033704050355954365052, .10961777508972033704050355954365052), .03695441750679136335292416138761121),// 22 88 PQP3(R3(.45915766038590539763886410168178216, .08004485927247373376034330857923567, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567)), .00817349224171051348425319650294732), // 23 92 PQP3(R3(.45915766038590539763886410168178216, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .08004485927247373376034330857923567), .00817349224171051348425319650294732), // 24 96 PQP3(R3(.08004485927247373376034330857923567, .45915766038590539763886410168178216, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567)), .00817349224171051348425319650294732), // 25 100 PQP3(R3(.08004485927247373376034330857923567, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 26 104 PQP3(R3(1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .45915766038590539763886410168178216, .08004485927247373376034330857923567), .00817349224171051348425319650294732), // 27 108 PQP3(R3(1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .08004485927247373376034330857923567, .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 28 112 PQP3(R3(.45915766038590539763886410168178216, .45915766038590539763886410168178216, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567)), .00817349224171051348425319650294732), // 29 116 PQP3(R3(.45915766038590539763886410168178216, 1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 30 120 PQP3(R3(1. - (.45915766038590539763886410168178216) - (.45915766038590539763886410168178216) - (.08004485927247373376034330857923567), .45915766038590539763886410168178216, .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 31 124 PQP3(R3(.45915766038590539763886410168178216, .45915766038590539763886410168178216, .08004485927247373376034330857923567), .00817349224171051348425319650294732), // 32 128 PQP3(R3(.45915766038590539763886410168178216, .08004485927247373376034330857923567, .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 33 132 PQP3(R3(.08004485927247373376034330857923567, .45915766038590539763886410168178216, .45915766038590539763886410168178216), .00817349224171051348425319650294732), // 34 136 PQP3(R3(.03296694775357210169727386483414899, .71879584022434055051132299796383374, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374)), .00987978656102278957913113314297149), // 35 140 PQP3(R3(.03296694775357210169727386483414899, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .71879584022434055051132299796383374), .00987978656102278957913113314297149), // 36 144 PQP3(R3(.71879584022434055051132299796383374, .03296694775357210169727386483414899, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374)), .00987978656102278957913113314297149), // 37 148 PQP3(R3(.71879584022434055051132299796383374, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 38 152 PQP3(R3(1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .03296694775357210169727386483414899, .71879584022434055051132299796383374), .00987978656102278957913113314297149), // 39 156 PQP3(R3(1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .71879584022434055051132299796383374, .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 40 160 PQP3(R3(.03296694775357210169727386483414899, .03296694775357210169727386483414899, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374)), .00987978656102278957913113314297149), // 41 164 PQP3(R3(.03296694775357210169727386483414899, 1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 42 168 PQP3(R3(1. - (.03296694775357210169727386483414899) - (.03296694775357210169727386483414899) - (.71879584022434055051132299796383374), .03296694775357210169727386483414899, .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 43 172 PQP3(R3(.03296694775357210169727386483414899, .03296694775357210169727386483414899, .71879584022434055051132299796383374), .00987978656102278957913113314297149), // 44 176 PQP3(R3(.03296694775357210169727386483414899, .71879584022434055051132299796383374, .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 45 180 PQP3(R3(.71879584022434055051132299796383374, .03296694775357210169727386483414899, .03296694775357210169727386483414899), .00987978656102278957913113314297149), // 46 184 PQP3(R3(.18174359672117481549870278661377760, .60023700739524674102301240348069459, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459)), .02160718741919244401497646690335203), // 47 188 PQP3(R3(.18174359672117481549870278661377760, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .60023700739524674102301240348069459), .02160718741919244401497646690335203), // 48 192 PQP3(R3(.60023700739524674102301240348069459, .18174359672117481549870278661377760, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459)), .02160718741919244401497646690335203), // 49 196 PQP3(R3(.60023700739524674102301240348069459, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 50 200 PQP3(R3(1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .18174359672117481549870278661377760, .60023700739524674102301240348069459), .02160718741919244401497646690335203), // 51 204 PQP3(R3(1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .60023700739524674102301240348069459, .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 52 208 PQP3(R3(.18174359672117481549870278661377760, .18174359672117481549870278661377760, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459)), .02160718741919244401497646690335203), // 53 212 PQP3(R3(.18174359672117481549870278661377760, 1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 54 216 PQP3(R3(1. - (.18174359672117481549870278661377760) - (.18174359672117481549870278661377760) - (.60023700739524674102301240348069459), .18174359672117481549870278661377760, .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 55 220 PQP3(R3(.18174359672117481549870278661377760, .18174359672117481549870278661377760, .60023700739524674102301240348069459), .02160718741919244401497646690335203), // 56 224 PQP3(R3(.18174359672117481549870278661377760, .60023700739524674102301240348069459, .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 57 228 PQP3(R3(.60023700739524674102301240348069459, .18174359672117481549870278661377760, .18174359672117481549870278661377760), .02160718741919244401497646690335203), // 58 232 }; PQF3 const QuadratureFormular_Tet_P9(9, 59, QF_TET_P9); // QUAD QUAD_3D_P10_ = { 79 316 PQP3 QF_TET_P10 [] = { PQP3(R3(0.25, 0.25, 0.25), .04574189830483037077884770618329337), // 0 0 PQP3(R3(.11425191803006935688146412277598412, .11425191803006935688146412277598412, .11425191803006935688146412277598412), .01092727610912416907498417206565671), // 1 4 PQP3(R3(1. - 3. * (.11425191803006935688146412277598412), .11425191803006935688146412277598412, .11425191803006935688146412277598412), .01092727610912416907498417206565671), // 2 8 PQP3(R3(.11425191803006935688146412277598412, 1. - 3. * (.11425191803006935688146412277598412), .11425191803006935688146412277598412), .01092727610912416907498417206565671), // 3 12 PQP3(R3(.11425191803006935688146412277598412, .11425191803006935688146412277598412, 1. - 3. * (.11425191803006935688146412277598412)), .01092727610912416907498417206565671), // 4 16 PQP3(R3(.01063790234539248531264164411274776, .01063790234539248531264164411274776, .01063790234539248531264164411274776), .00055352334192264689534558564012282), // 5 20 PQP3(R3(1. - 3. * (.01063790234539248531264164411274776), .01063790234539248531264164411274776, .01063790234539248531264164411274776), .00055352334192264689534558564012282), // 6 24 PQP3(R3(.01063790234539248531264164411274776, 1. - 3. * (.01063790234539248531264164411274776), .01063790234539248531264164411274776), .00055352334192264689534558564012282), // 7 28 PQP3(R3(.01063790234539248531264164411274776, .01063790234539248531264164411274776, 1. - 3. * (.01063790234539248531264164411274776)), .00055352334192264689534558564012282), // 8 32 PQP3(R3(.31274070833535645859816704980806110, .31274070833535645859816704980806110, .31274070833535645859816704980806110), .02569337913913269580782688316792080), // 9 36 PQP3(R3(1. - 3. * (.31274070833535645859816704980806110), .31274070833535645859816704980806110, .31274070833535645859816704980806110), .02569337913913269580782688316792080), // 10 40 PQP3(R3(.31274070833535645859816704980806110, 1. - 3. * (.31274070833535645859816704980806110), .31274070833535645859816704980806110), .02569337913913269580782688316792080), // 11 44 PQP3(R3(.31274070833535645859816704980806110, .31274070833535645859816704980806110, 1. - 3. * (.31274070833535645859816704980806110)), .02569337913913269580782688316792080), // 12 48 PQP3(R3(.01631296303281644000000000000000000, .5 - (.01631296303281644000000000000000000), .5 - (.01631296303281644000000000000000000)), .00055387649657283109312967562590035), // 13 52 PQP3(R3(.5 - (.01631296303281644000000000000000000), .01631296303281644000000000000000000, .5 - (.01631296303281644000000000000000000)), .00055387649657283109312967562590035), // 14 56 PQP3(R3(.5 - (.01631296303281644000000000000000000), .5 - (.01631296303281644000000000000000000), .01631296303281644000000000000000000), .00055387649657283109312967562590035), // 15 60 PQP3(R3(.01631296303281644000000000000000000, .5 - (.01631296303281644000000000000000000), .01631296303281644000000000000000000), .00055387649657283109312967562590035),// 16 64 PQP3(R3(.01631296303281644000000000000000000, .01631296303281644000000000000000000, .5 - (.01631296303281644000000000000000000)), .00055387649657283109312967562590035),// 17 68 PQP3(R3(.5 - (.01631296303281644000000000000000000), .01631296303281644000000000000000000, .01631296303281644000000000000000000), .00055387649657283109312967562590035),// 18 72 PQP3(R3(.03430622963180452385835196582344460, .59830121060139461905983787517050400, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400)), .01044842402938294329072628200105773), // 19 76 PQP3(R3(.03430622963180452385835196582344460, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .59830121060139461905983787517050400), .01044842402938294329072628200105773), // 20 80 PQP3(R3(.59830121060139461905983787517050400, .03430622963180452385835196582344460, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400)), .01044842402938294329072628200105773), // 21 84 PQP3(R3(.59830121060139461905983787517050400, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 22 88 PQP3(R3(1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .03430622963180452385835196582344460, .59830121060139461905983787517050400), .01044842402938294329072628200105773), // 23 92 PQP3(R3(1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .59830121060139461905983787517050400, .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 24 96 PQP3(R3(.03430622963180452385835196582344460, .03430622963180452385835196582344460, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400)), .01044842402938294329072628200105773), // 25 100 PQP3(R3(.03430622963180452385835196582344460, 1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 26 104 PQP3(R3(1. - (.03430622963180452385835196582344460) - (.03430622963180452385835196582344460) - (.59830121060139461905983787517050400), .03430622963180452385835196582344460, .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 27 108 PQP3(R3(.03430622963180452385835196582344460, .03430622963180452385835196582344460, .59830121060139461905983787517050400), .01044842402938294329072628200105773), // 28 112 PQP3(R3(.03430622963180452385835196582344460, .59830121060139461905983787517050400, .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 29 116 PQP3(R3(.59830121060139461905983787517050400, .03430622963180452385835196582344460, .03430622963180452385835196582344460), .01044842402938294329072628200105773), // 30 120 PQP3(R3(.12346418534551115945916818783743644, .47120066204746310257913700590727081, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081)), .02513844602651287118280517785487423), // 31 124 PQP3(R3(.12346418534551115945916818783743644, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .47120066204746310257913700590727081), .02513844602651287118280517785487423), // 32 128 PQP3(R3(.47120066204746310257913700590727081, .12346418534551115945916818783743644, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081)), .02513844602651287118280517785487423), // 33 132 PQP3(R3(.47120066204746310257913700590727081, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 34 136 PQP3(R3(1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .12346418534551115945916818783743644, .47120066204746310257913700590727081), .02513844602651287118280517785487423), // 35 140 PQP3(R3(1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .47120066204746310257913700590727081, .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 36 144 PQP3(R3(.12346418534551115945916818783743644, .12346418534551115945916818783743644, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081)), .02513844602651287118280517785487423), // 37 148 PQP3(R3(.12346418534551115945916818783743644, 1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 38 152 PQP3(R3(1. - (.12346418534551115945916818783743644) - (.12346418534551115945916818783743644) - (.47120066204746310257913700590727081), .12346418534551115945916818783743644, .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 39 156 PQP3(R3(.12346418534551115945916818783743644, .12346418534551115945916818783743644, .47120066204746310257913700590727081), .02513844602651287118280517785487423), // 40 160 PQP3(R3(.12346418534551115945916818783743644, .47120066204746310257913700590727081, .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 41 164 PQP3(R3(.47120066204746310257913700590727081, .12346418534551115945916818783743644, .12346418534551115945916818783743644), .02513844602651287118280517785487423), // 42 168 PQP3(R3(.40991962933181117418479812480531207, .16546413290740130923509687990363569, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569)), .01178620679249594711782155323755017), // 43 172 PQP3(R3(.40991962933181117418479812480531207, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .16546413290740130923509687990363569), .01178620679249594711782155323755017), // 44 176 PQP3(R3(.16546413290740130923509687990363569, .40991962933181117418479812480531207, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569)), .01178620679249594711782155323755017), // 45 180 PQP3(R3(.16546413290740130923509687990363569, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 46 184 PQP3(R3(1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .40991962933181117418479812480531207, .16546413290740130923509687990363569), .01178620679249594711782155323755017), // 47 188 PQP3(R3(1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .16546413290740130923509687990363569, .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 48 192 PQP3(R3(.40991962933181117418479812480531207, .40991962933181117418479812480531207, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569)), .01178620679249594711782155323755017), // 49 196 PQP3(R3(.40991962933181117418479812480531207, 1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 50 200 PQP3(R3(1. - (.40991962933181117418479812480531207) - (.40991962933181117418479812480531207) - (.16546413290740130923509687990363569), .40991962933181117418479812480531207, .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 51 204 PQP3(R3(.40991962933181117418479812480531207, .40991962933181117418479812480531207, .16546413290740130923509687990363569), .01178620679249594711782155323755017), // 52 208 PQP3(R3(.40991962933181117418479812480531207, .16546413290740130923509687990363569, .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 53 212 PQP3(R3(.16546413290740130923509687990363569, .40991962933181117418479812480531207, .40991962933181117418479812480531207), .01178620679249594711782155323755017), // 54 216 PQP3(R3(.17397243903011716743177479785668929, .62916375300275643773181882027844514, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514)), .01332022473886650471019828463616468), // 55 220 PQP3(R3(.17397243903011716743177479785668929, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .62916375300275643773181882027844514), .01332022473886650471019828463616468), // 56 224 PQP3(R3(.62916375300275643773181882027844514, .17397243903011716743177479785668929, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514)), .01332022473886650471019828463616468), // 57 228 PQP3(R3(.62916375300275643773181882027844514, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 58 232 PQP3(R3(1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .17397243903011716743177479785668929, .62916375300275643773181882027844514), .01332022473886650471019828463616468), // 59 236 PQP3(R3(1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .62916375300275643773181882027844514, .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 60 240 PQP3(R3(.17397243903011716743177479785668929, .17397243903011716743177479785668929, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514)), .01332022473886650471019828463616468), // 61 244 PQP3(R3(.17397243903011716743177479785668929, 1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 62 248 PQP3(R3(1. - (.17397243903011716743177479785668929) - (.17397243903011716743177479785668929) - (.62916375300275643773181882027844514), .17397243903011716743177479785668929, .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 63 252 PQP3(R3(.17397243903011716743177479785668929, .17397243903011716743177479785668929, .62916375300275643773181882027844514), .01332022473886650471019828463616468), // 64 256 PQP3(R3(.17397243903011716743177479785668929, .62916375300275643773181882027844514, .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 65 260 PQP3(R3(.62916375300275643773181882027844514, .17397243903011716743177479785668929, .17397243903011716743177479785668929), .01332022473886650471019828463616468), // 66 264 PQP3(R3(.03002157005631784150255786784038011, .81213056814351208262160080755918730, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730)), .00615987577565961666092767531756180), // 67 268 PQP3(R3(.03002157005631784150255786784038011, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .81213056814351208262160080755918730), .00615987577565961666092767531756180), // 68 272 PQP3(R3(.81213056814351208262160080755918730, .03002157005631784150255786784038011, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730)), .00615987577565961666092767531756180), // 69 276 PQP3(R3(.81213056814351208262160080755918730, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 70 280 PQP3(R3(1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .03002157005631784150255786784038011, .81213056814351208262160080755918730), .00615987577565961666092767531756180), // 71 284 PQP3(R3(1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .81213056814351208262160080755918730, .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 72 288 PQP3(R3(.03002157005631784150255786784038011, .03002157005631784150255786784038011, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730)), .00615987577565961666092767531756180), // 73 292 PQP3(R3(.03002157005631784150255786784038011, 1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 74 296 PQP3(R3(1. - (.03002157005631784150255786784038011) - (.03002157005631784150255786784038011) - (.81213056814351208262160080755918730), .03002157005631784150255786784038011, .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 75 300 PQP3(R3(.03002157005631784150255786784038011, .03002157005631784150255786784038011, .81213056814351208262160080755918730), .00615987577565961666092767531756180), // 76 304 PQP3(R3(.03002157005631784150255786784038011, .81213056814351208262160080755918730, .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 77 308 PQP3(R3(.81213056814351208262160080755918730, .03002157005631784150255786784038011, .03002157005631784150255786784038011), .00615987577565961666092767531756180), // 78 312 }; PQF3 const QuadratureFormular_Tet_P10(10, 79, QF_TET_P10); // QUAD QUAD_3D_P11_ = { 96 384 PQP3 QF_TET_P11 [] = { PQP3(R3(.12460560449278830000000000000000000, .12460560449278830000000000000000000, .12460560449278830000000000000000000), .01612698613577620369120244222737879), // 0 0 PQP3(R3(1. - 3. * (.12460560449278830000000000000000000), .12460560449278830000000000000000000, .12460560449278830000000000000000000), .01612698613577620369120244222737879), // 1 4 PQP3(R3(.12460560449278830000000000000000000, 1. - 3. * (.12460560449278830000000000000000000), .12460560449278830000000000000000000), .01612698613577620369120244222737879), // 2 8 PQP3(R3(.12460560449278830000000000000000000, .12460560449278830000000000000000000, 1. - 3. * (.12460560449278830000000000000000000)), .01612698613577620369120244222737879), // 3 12 PQP3(R3(.02609630765687464746851542316261877, .02609630765687464746851542316261877, .02609630765687464746851542316261877), .00178872341812357138976990346996962), // 4 16 PQP3(R3(1. - 3. * (.02609630765687464746851542316261877), .02609630765687464746851542316261877, .02609630765687464746851542316261877), .00178872341812357138976990346996962), // 5 20 PQP3(R3(.02609630765687464746851542316261877, 1. - 3. * (.02609630765687464746851542316261877), .02609630765687464746851542316261877), .00178872341812357138976990346996962), // 6 24 PQP3(R3(.02609630765687464746851542316261877, .02609630765687464746851542316261877, 1. - 3. * (.02609630765687464746851542316261877)), .00178872341812357138976990346996962), // 7 28 PQP3(R3(.07193883255798884087330011042809557, .07193883255798884087330011042809557, .07193883255798884087330011042809557), .00847529348343123401863799968389086), // 8 32 PQP3(R3(1. - 3. * (.07193883255798884087330011042809557), .07193883255798884087330011042809557, .07193883255798884087330011042809557), .00847529348343123401863799968389086), // 9 36 PQP3(R3(.07193883255798884087330011042809557, 1. - 3. * (.07193883255798884087330011042809557), .07193883255798884087330011042809557), .00847529348343123401863799968389086), // 10 40 PQP3(R3(.07193883255798884087330011042809557, .07193883255798884087330011042809557, 1. - 3. * (.07193883255798884087330011042809557)), .00847529348343123401863799968389086), // 11 44 PQP3(R3(.32611122454203676937273102302894204, .32611122454203676937273102302894204, .32611122454203676937273102302894204), .01238021263944669050859562763135516), // 12 48 PQP3(R3(1. - 3. * (.32611122454203676937273102302894204), .32611122454203676937273102302894204, .32611122454203676937273102302894204), .01238021263944669050859562763135516), // 13 52 PQP3(R3(.32611122454203676937273102302894204, 1. - 3. * (.32611122454203676937273102302894204), .32611122454203676937273102302894204), .01238021263944669050859562763135516), // 14 56 PQP3(R3(.32611122454203676937273102302894204, .32611122454203676937273102302894204, 1. - 3. * (.32611122454203676937273102302894204)), .01238021263944669050859562763135516), // 15 60 PQP3(R3(.29405882789858127213310307732130217, .29405882789858127213310307732130217, .29405882789858127213310307732130217), .02205586697199415746140963638568037), // 16 64 PQP3(R3(1. - 3. * (.29405882789858127213310307732130217), .29405882789858127213310307732130217, .29405882789858127213310307732130217), .02205586697199415746140963638568037), // 17 68 PQP3(R3(.29405882789858127213310307732130217, 1. - 3. * (.29405882789858127213310307732130217), .29405882789858127213310307732130217), .02205586697199415746140963638568037), // 18 72 PQP3(R3(.29405882789858127213310307732130217, .29405882789858127213310307732130217, 1. - 3. * (.29405882789858127213310307732130217)), .02205586697199415746140963638568037), // 19 76 PQP3(R3(.19271399104965490000000000000000000, .19271399104965490000000000000000000, .19271399104965490000000000000000000), .02295765467664274421265594265203307), // 20 80 PQP3(R3(1. - 3. * (.19271399104965490000000000000000000), .19271399104965490000000000000000000, .19271399104965490000000000000000000), .02295765467664274421265594265203307), // 21 84 PQP3(R3(.19271399104965490000000000000000000, 1. - 3. * (.19271399104965490000000000000000000), .19271399104965490000000000000000000), .02295765467664274421265594265203307), // 22 88 PQP3(R3(.19271399104965490000000000000000000, .19271399104965490000000000000000000, 1. - 3. * (.19271399104965490000000000000000000)), .02295765467664274421265594265203307), // 23 92 PQP3(R3(.00047127204692773946587837159205225, .5 - (.00047127204692773946587837159205225), .5 - (.00047127204692773946587837159205225)), .00120553827014535727045055662252294), // 24 96 PQP3(R3(.5 - (.00047127204692773946587837159205225), .00047127204692773946587837159205225, .5 - (.00047127204692773946587837159205225)), .00120553827014535727045055662252294), // 25 100 PQP3(R3(.5 - (.00047127204692773946587837159205225), .5 - (.00047127204692773946587837159205225), .00047127204692773946587837159205225), .00120553827014535727045055662252294), // 26 104 PQP3(R3(.00047127204692773946587837159205225, .5 - (.00047127204692773946587837159205225), .00047127204692773946587837159205225), .00120553827014535727045055662252294),// 27 108 PQP3(R3(.00047127204692773946587837159205225, .00047127204692773946587837159205225, .5 - (.00047127204692773946587837159205225)), .00120553827014535727045055662252294),// 28 112 PQP3(R3(.5 - (.00047127204692773946587837159205225), .00047127204692773946587837159205225, .00047127204692773946587837159205225), .00120553827014535727045055662252294),// 29 116 PQP3(R3(.10321360207480949336085123341390539, .5 - (.10321360207480949336085123341390539), .5 - (.10321360207480949336085123341390539)), .02479381575164443454447803302296997), // 30 120 PQP3(R3(.5 - (.10321360207480949336085123341390539), .10321360207480949336085123341390539, .5 - (.10321360207480949336085123341390539)), .02479381575164443454447803302296997), // 31 124 PQP3(R3(.5 - (.10321360207480949336085123341390539), .5 - (.10321360207480949336085123341390539), .10321360207480949336085123341390539), .02479381575164443454447803302296997), // 32 128 PQP3(R3(.10321360207480949336085123341390539, .5 - (.10321360207480949336085123341390539), .10321360207480949336085123341390539), .02479381575164443454447803302296997),// 33 132 PQP3(R3(.10321360207480949336085123341390539, .10321360207480949336085123341390539, .5 - (.10321360207480949336085123341390539)), .02479381575164443454447803302296997),// 34 136 PQP3(R3(.5 - (.10321360207480949336085123341390539), .10321360207480949336085123341390539, .10321360207480949336085123341390539), .02479381575164443454447803302296997),// 35 140 PQP3(R3(.04349989920159741251267172033621503, .63045319723555591476353398203997141, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141)), .01203878836480353606935457416590660), // 36 144 PQP3(R3(.04349989920159741251267172033621503, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .63045319723555591476353398203997141), .01203878836480353606935457416590660), // 37 148 PQP3(R3(.63045319723555591476353398203997141, .04349989920159741251267172033621503, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141)), .01203878836480353606935457416590660), // 38 152 PQP3(R3(.63045319723555591476353398203997141, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 39 156 PQP3(R3(1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .04349989920159741251267172033621503, .63045319723555591476353398203997141), .01203878836480353606935457416590660), // 40 160 PQP3(R3(1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .63045319723555591476353398203997141, .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 41 164 PQP3(R3(.04349989920159741251267172033621503, .04349989920159741251267172033621503, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141)), .01203878836480353606935457416590660), // 42 168 PQP3(R3(.04349989920159741251267172033621503, 1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 43 172 PQP3(R3(1. - (.04349989920159741251267172033621503) - (.04349989920159741251267172033621503) - (.63045319723555591476353398203997141), .04349989920159741251267172033621503, .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 44 176 PQP3(R3(.04349989920159741251267172033621503, .04349989920159741251267172033621503, .63045319723555591476353398203997141), .01203878836480353606935457416590660), // 45 180 PQP3(R3(.04349989920159741251267172033621503, .63045319723555591476353398203997141, .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 46 184 PQP3(R3(.63045319723555591476353398203997141, .04349989920159741251267172033621503, .04349989920159741251267172033621503), .01203878836480353606935457416590660), // 47 188 PQP3(R3(.01414839289422299290755441603794058, .82491678632147090000000000000000000, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000)), .00189370204498242146248858917618493), // 48 192 PQP3(R3(.01414839289422299290755441603794058, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .82491678632147090000000000000000000), .00189370204498242146248858917618493), // 49 196 PQP3(R3(.82491678632147090000000000000000000, .01414839289422299290755441603794058, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000)), .00189370204498242146248858917618493), // 50 200 PQP3(R3(.82491678632147090000000000000000000, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 51 204 PQP3(R3(1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .01414839289422299290755441603794058, .82491678632147090000000000000000000), .00189370204498242146248858917618493), // 52 208 PQP3(R3(1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .82491678632147090000000000000000000, .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 53 212 PQP3(R3(.01414839289422299290755441603794058, .01414839289422299290755441603794058, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000)), .00189370204498242146248858917618493), // 54 216 PQP3(R3(.01414839289422299290755441603794058, 1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 55 220 PQP3(R3(1. - (.01414839289422299290755441603794058) - (.01414839289422299290755441603794058) - (.82491678632147090000000000000000000), .01414839289422299290755441603794058, .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 56 224 PQP3(R3(.01414839289422299290755441603794058, .01414839289422299290755441603794058, .82491678632147090000000000000000000), .00189370204498242146248858917618493), // 57 228 PQP3(R3(.01414839289422299290755441603794058, .82491678632147090000000000000000000, .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 58 232 PQP3(R3(.82491678632147090000000000000000000, .01414839289422299290755441603794058, .01414839289422299290755441603794058), .00189370204498242146248858917618493), // 59 236 PQP3(R3(.21646077368258425486341884576246642, .52711130286496480000000000000000000, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000)), .01838752922255814184581020943433469), // 60 240 PQP3(R3(.21646077368258425486341884576246642, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .52711130286496480000000000000000000), .01838752922255814184581020943433469), // 61 244 PQP3(R3(.52711130286496480000000000000000000, .21646077368258425486341884576246642, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000)), .01838752922255814184581020943433469), // 62 248 PQP3(R3(.52711130286496480000000000000000000, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 63 252 PQP3(R3(1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .21646077368258425486341884576246642, .52711130286496480000000000000000000), .01838752922255814184581020943433469), // 64 256 PQP3(R3(1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .52711130286496480000000000000000000, .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 65 260 PQP3(R3(.21646077368258425486341884576246642, .21646077368258425486341884576246642, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000)), .01838752922255814184581020943433469), // 66 264 PQP3(R3(.21646077368258425486341884576246642, 1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 67 268 PQP3(R3(1. - (.21646077368258425486341884576246642) - (.21646077368258425486341884576246642) - (.52711130286496480000000000000000000), .21646077368258425486341884576246642, .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 68 272 PQP3(R3(.21646077368258425486341884576246642, .21646077368258425486341884576246642, .52711130286496480000000000000000000), .01838752922255814184581020943433469), // 69 276 PQP3(R3(.21646077368258425486341884576246642, .52711130286496480000000000000000000, .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 70 280 PQP3(R3(.52711130286496480000000000000000000, .21646077368258425486341884576246642, .21646077368258425486341884576246642), .01838752922255814184581020943433469), // 71 284 PQP3(R3(.13301884366834711587538262083530116, .73318551371398651551736762818473584, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584)), .00375249249801662461193260176157591), // 72 288 PQP3(R3(.13301884366834711587538262083530116, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .73318551371398651551736762818473584), .00375249249801662461193260176157591), // 73 292 PQP3(R3(.73318551371398651551736762818473584, .13301884366834711587538262083530116, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584)), .00375249249801662461193260176157591), // 74 296 PQP3(R3(.73318551371398651551736762818473584, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 75 300 PQP3(R3(1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .13301884366834711587538262083530116, .73318551371398651551736762818473584), .00375249249801662461193260176157591), // 76 304 PQP3(R3(1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .73318551371398651551736762818473584, .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 77 308 PQP3(R3(.13301884366834711587538262083530116, .13301884366834711587538262083530116, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584)), .00375249249801662461193260176157591), // 78 312 PQP3(R3(.13301884366834711587538262083530116, 1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 79 316 PQP3(R3(1. - (.13301884366834711587538262083530116) - (.13301884366834711587538262083530116) - (.73318551371398651551736762818473584), .13301884366834711587538262083530116, .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 80 320 PQP3(R3(.13301884366834711587538262083530116, .13301884366834711587538262083530116, .73318551371398651551736762818473584), .00375249249801662461193260176157591), // 81 324 PQP3(R3(.13301884366834711587538262083530116, .73318551371398651551736762818473584, .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 82 328 PQP3(R3(.73318551371398651551736762818473584, .13301884366834711587538262083530116, .13301884366834711587538262083530116), .00375249249801662461193260176157591), // 83 332 PQP3(R3(.44054756810613723082959230959880706, .11506799584377921703650823955291194, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194)), .00633289841693951300885921328914879), // 84 336 PQP3(R3(.44054756810613723082959230959880706, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .11506799584377921703650823955291194), .00633289841693951300885921328914879), // 85 340 PQP3(R3(.11506799584377921703650823955291194, .44054756810613723082959230959880706, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194)), .00633289841693951300885921328914879), // 86 344 PQP3(R3(.11506799584377921703650823955291194, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 87 348 PQP3(R3(1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .44054756810613723082959230959880706, .11506799584377921703650823955291194), .00633289841693951300885921328914879), // 88 352 PQP3(R3(1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .11506799584377921703650823955291194, .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 89 356 PQP3(R3(.44054756810613723082959230959880706, .44054756810613723082959230959880706, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194)), .00633289841693951300885921328914879), // 90 360 PQP3(R3(.44054756810613723082959230959880706, 1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 91 364 PQP3(R3(1. - (.44054756810613723082959230959880706) - (.44054756810613723082959230959880706) - (.11506799584377921703650823955291194), .44054756810613723082959230959880706, .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 92 368 PQP3(R3(.44054756810613723082959230959880706, .44054756810613723082959230959880706, .11506799584377921703650823955291194), .00633289841693951300885921328914879), // 93 372 PQP3(R3(.44054756810613723082959230959880706, .11506799584377921703650823955291194, .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 94 376 PQP3(R3(.11506799584377921703650823955291194, .44054756810613723082959230959880706, .44054756810613723082959230959880706), .00633289841693951300885921328914879), // 95 380 }; PQF3 const QuadratureFormular_Tet_P11(11, 96, QF_TET_P11); // QUAD QUAD_3D_P12_ = { 127 508 PQP3 QF_TET_P12 [] = { PQP3(R3(0.25, 0.25, 0.25), .02340581914868067999082580773836836), // 0 0 PQP3(R3(.19318721110347230000000000000000000, .19318721110347230000000000000000000, .19318721110347230000000000000000000), .00484469946470415656870798306091558), // 1 4 PQP3(R3(1. - 3. * (.19318721110347230000000000000000000), .19318721110347230000000000000000000, .19318721110347230000000000000000000), .00484469946470415656870798306091558), // 2 8 PQP3(R3(.19318721110347230000000000000000000, 1. - 3. * (.19318721110347230000000000000000000), .19318721110347230000000000000000000), .00484469946470415656870798306091558), // 3 12 PQP3(R3(.19318721110347230000000000000000000, .19318721110347230000000000000000000, 1. - 3. * (.19318721110347230000000000000000000)), .00484469946470415656870798306091558), // 4 16 PQP3(R3(.01811701371436566878506928822499717, .01811701371436566878506928822499717, .01811701371436566878506928822499717), .00079865303812732982185563521014343), // 5 20 PQP3(R3(1. - 3. * (.01811701371436566878506928822499717), .01811701371436566878506928822499717, .01811701371436566878506928822499717), .00079865303812732982185563521014343), // 6 24 PQP3(R3(.01811701371436566878506928822499717, 1. - 3. * (.01811701371436566878506928822499717), .01811701371436566878506928822499717), .00079865303812732982185563521014343), // 7 28 PQP3(R3(.01811701371436566878506928822499717, .01811701371436566878506928822499717, 1. - 3. * (.01811701371436566878506928822499717)), .00079865303812732982185563521014343), // 8 32 PQP3(R3(.10700751831426066518406159227423033, .10700751831426066518406159227423033, .10700751831426066518406159227423033), .01311872008808756207964488505025527), // 9 36 PQP3(R3(1. - 3. * (.10700751831426066518406159227423033), .10700751831426066518406159227423033, .10700751831426066518406159227423033), .01311872008808756207964488505025527), // 10 40 PQP3(R3(.10700751831426066518406159227423033, 1. - 3. * (.10700751831426066518406159227423033), .10700751831426066518406159227423033), .01311872008808756207964488505025527), // 11 44 PQP3(R3(.10700751831426066518406159227423033, .10700751831426066518406159227423033, 1. - 3. * (.10700751831426066518406159227423033)), .01311872008808756207964488505025527), // 12 48 PQP3(R3(.29936173715970702940603127680004538, .29936173715970702940603127680004538, .29936173715970702940603127680004538), .02352182961292765917274505054313770), // 13 52 PQP3(R3(1. - 3. * (.29936173715970702940603127680004538), .29936173715970702940603127680004538, .29936173715970702940603127680004538), .02352182961292765917274505054313770), // 14 56 PQP3(R3(.29936173715970702940603127680004538, 1. - 3. * (.29936173715970702940603127680004538), .29936173715970702940603127680004538), .02352182961292765917274505054313770), // 15 60 PQP3(R3(.29936173715970702940603127680004538, .29936173715970702940603127680004538, 1. - 3. * (.29936173715970702940603127680004538)), .02352182961292765917274505054313770), // 16 64 PQP3(R3(.33333033333333333042835213613025030, .33333033333333333042835213613025030, .33333033333333333042835213613025030), .00210860882494149803857437048649497), // 17 68 PQP3(R3(1. - 3. * (.33333033333333333042835213613025030), .33333033333333333042835213613025030, .33333033333333333042835213613025030), .00210860882494149803857437048649497), // 18 72 PQP3(R3(.33333033333333333042835213613025030, 1. - 3. * (.33333033333333333042835213613025030), .33333033333333333042835213613025030), .00210860882494149803857437048649497), // 19 76 PQP3(R3(.33333033333333333042835213613025030, .33333033333333333042835213613025030, 1. - 3. * (.33333033333333333042835213613025030)), .00210860882494149803857437048649497), // 20 80 PQP3(R3(.16575369007421640000000000000000000, .16575369007421640000000000000000000, .16575369007421640000000000000000000), .00047839298963616600187228601742259), // 21 84 PQP3(R3(1. - 3. * (.16575369007421640000000000000000000), .16575369007421640000000000000000000, .16575369007421640000000000000000000), .00047839298963616600187228601742259), // 22 88 PQP3(R3(.16575369007421640000000000000000000, 1. - 3. * (.16575369007421640000000000000000000), .16575369007421640000000000000000000), .00047839298963616600187228601742259), // 23 92 PQP3(R3(.16575369007421640000000000000000000, .16575369007421640000000000000000000, 1. - 3. * (.16575369007421640000000000000000000)), .00047839298963616600187228601742259), // 24 96 PQP3(R3(.04009986052352575650366980228640728, .5 - (.04009986052352575650366980228640728), .5 - (.04009986052352575650366980228640728)), .00204546234216855322941711800170502), // 25 100 PQP3(R3(.5 - (.04009986052352575650366980228640728), .04009986052352575650366980228640728, .5 - (.04009986052352575650366980228640728)), .00204546234216855322941711800170502), // 26 104 PQP3(R3(.5 - (.04009986052352575650366980228640728), .5 - (.04009986052352575650366980228640728), .04009986052352575650366980228640728), .00204546234216855322941711800170502), // 27 108 PQP3(R3(.04009986052352575650366980228640728, .5 - (.04009986052352575650366980228640728), .04009986052352575650366980228640728), .00204546234216855322941711800170502),// 28 112 PQP3(R3(.04009986052352575650366980228640728, .04009986052352575650366980228640728, .5 - (.04009986052352575650366980228640728)), .00204546234216855322941711800170502),// 29 116 PQP3(R3(.5 - (.04009986052352575650366980228640728), .04009986052352575650366980228640728, .04009986052352575650366980228640728), .00204546234216855322941711800170502),// 30 120 PQP3(R3(.01951844463761131301132122485607343, .59982639757597731668263005976738196, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196)), .00334576331671817115245418532677178), // 31 124 PQP3(R3(.01951844463761131301132122485607343, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .59982639757597731668263005976738196), .00334576331671817115245418532677178), // 32 128 PQP3(R3(.59982639757597731668263005976738196, .01951844463761131301132122485607343, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196)), .00334576331671817115245418532677178), // 33 132 PQP3(R3(.59982639757597731668263005976738196, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 34 136 PQP3(R3(1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .01951844463761131301132122485607343, .59982639757597731668263005976738196), .00334576331671817115245418532677178), // 35 140 PQP3(R3(1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .59982639757597731668263005976738196, .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 36 144 PQP3(R3(.01951844463761131301132122485607343, .01951844463761131301132122485607343, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196)), .00334576331671817115245418532677178), // 37 148 PQP3(R3(.01951844463761131301132122485607343, 1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 38 152 PQP3(R3(1. - (.01951844463761131301132122485607343) - (.01951844463761131301132122485607343) - (.59982639757597731668263005976738196), .01951844463761131301132122485607343, .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 39 156 PQP3(R3(.01951844463761131301132122485607343, .01951844463761131301132122485607343, .59982639757597731668263005976738196), .00334576331671817115245418532677178), // 40 160 PQP3(R3(.01951844463761131301132122485607343, .59982639757597731668263005976738196, .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 41 164 PQP3(R3(.59982639757597731668263005976738196, .01951844463761131301132122485607343, .01951844463761131301132122485607343), .00334576331671817115245418532677178), // 42 168 PQP3(R3(.24970741896308715787490891769354198, .47400425629911050000000000000000000, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000)), .01181044822479275264785338274950585), // 43 172 PQP3(R3(.24970741896308715787490891769354198, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .47400425629911050000000000000000000), .01181044822479275264785338274950585), // 44 176 PQP3(R3(.47400425629911050000000000000000000, .24970741896308715787490891769354198, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000)), .01181044822479275264785338274950585), // 45 180 PQP3(R3(.47400425629911050000000000000000000, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 46 184 PQP3(R3(1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .24970741896308715787490891769354198, .47400425629911050000000000000000000), .01181044822479275264785338274950585), // 47 188 PQP3(R3(1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .47400425629911050000000000000000000, .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 48 192 PQP3(R3(.24970741896308715787490891769354198, .24970741896308715787490891769354198, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000)), .01181044822479275264785338274950585), // 49 196 PQP3(R3(.24970741896308715787490891769354198, 1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 50 200 PQP3(R3(1. - (.24970741896308715787490891769354198) - (.24970741896308715787490891769354198) - (.47400425629911050000000000000000000), .24970741896308715787490891769354198, .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 51 204 PQP3(R3(.24970741896308715787490891769354198, .24970741896308715787490891769354198, .47400425629911050000000000000000000), .01181044822479275264785338274950585), // 52 208 PQP3(R3(.24970741896308715787490891769354198, .47400425629911050000000000000000000, .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 53 212 PQP3(R3(.47400425629911050000000000000000000, .24970741896308715787490891769354198, .24970741896308715787490891769354198), .01181044822479275264785338274950585), // 54 216 PQP3(R3(.07674205857869954726322831328843659, .83056291375422969598432041821082569, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569)), .00290156990282342152841364375092118), // 55 220 PQP3(R3(.07674205857869954726322831328843659, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .83056291375422969598432041821082569), .00290156990282342152841364375092118), // 56 224 PQP3(R3(.83056291375422969598432041821082569, .07674205857869954726322831328843659, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569)), .00290156990282342152841364375092118), // 57 228 PQP3(R3(.83056291375422969598432041821082569, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 58 232 PQP3(R3(1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .07674205857869954726322831328843659, .83056291375422969598432041821082569), .00290156990282342152841364375092118), // 59 236 PQP3(R3(1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .83056291375422969598432041821082569, .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 60 240 PQP3(R3(.07674205857869954726322831328843659, .07674205857869954726322831328843659, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569)), .00290156990282342152841364375092118), // 61 244 PQP3(R3(.07674205857869954726322831328843659, 1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 62 248 PQP3(R3(1. - (.07674205857869954726322831328843659) - (.07674205857869954726322831328843659) - (.83056291375422969598432041821082569), .07674205857869954726322831328843659, .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 63 252 PQP3(R3(.07674205857869954726322831328843659, .07674205857869954726322831328843659, .83056291375422969598432041821082569), .00290156990282342152841364375092118), // 64 256 PQP3(R3(.07674205857869954726322831328843659, .83056291375422969598432041821082569, .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 65 260 PQP3(R3(.83056291375422969598432041821082569, .07674205857869954726322831328843659, .07674205857869954726322831328843659), .00290156990282342152841364375092118), // 66 264 PQP3(R3(.43011409627915217536723647418133112, .02265922072588833582931396831630072, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072)), .00949250645501753676094846901252898), // 67 268 PQP3(R3(.43011409627915217536723647418133112, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .02265922072588833582931396831630072), .00949250645501753676094846901252898), // 68 272 PQP3(R3(.02265922072588833582931396831630072, .43011409627915217536723647418133112, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072)), .00949250645501753676094846901252898), // 69 276 PQP3(R3(.02265922072588833582931396831630072, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 70 280 PQP3(R3(1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .43011409627915217536723647418133112, .02265922072588833582931396831630072), .00949250645501753676094846901252898), // 71 284 PQP3(R3(1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .02265922072588833582931396831630072, .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 72 288 PQP3(R3(.43011409627915217536723647418133112, .43011409627915217536723647418133112, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072)), .00949250645501753676094846901252898), // 73 292 PQP3(R3(.43011409627915217536723647418133112, 1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 74 296 PQP3(R3(1. - (.43011409627915217536723647418133112) - (.43011409627915217536723647418133112) - (.02265922072588833582931396831630072), .43011409627915217536723647418133112, .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 75 300 PQP3(R3(.43011409627915217536723647418133112, .43011409627915217536723647418133112, .02265922072588833582931396831630072), .00949250645501753676094846901252898), // 76 304 PQP3(R3(.43011409627915217536723647418133112, .02265922072588833582931396831630072, .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 77 308 PQP3(R3(.02265922072588833582931396831630072, .43011409627915217536723647418133112, .43011409627915217536723647418133112), .00949250645501753676094846901252898), // 78 312 PQP3(R3(.12197854304894211937147375564906792, .47765370899783134571567376444973682, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682)), .02094018358085748583183796760479700), // 79 316 PQP3(R3(.12197854304894211937147375564906792, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .47765370899783134571567376444973682), .02094018358085748583183796760479700), // 80 320 PQP3(R3(.47765370899783134571567376444973682, .12197854304894211937147375564906792, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682)), .02094018358085748583183796760479700), // 81 324 PQP3(R3(.47765370899783134571567376444973682, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 82 328 PQP3(R3(1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .12197854304894211937147375564906792, .47765370899783134571567376444973682), .02094018358085748583183796760479700), // 83 332 PQP3(R3(1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .47765370899783134571567376444973682, .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 84 336 PQP3(R3(.12197854304894211937147375564906792, .12197854304894211937147375564906792, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682)), .02094018358085748583183796760479700), // 85 340 PQP3(R3(.12197854304894211937147375564906792, 1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 86 344 PQP3(R3(1. - (.12197854304894211937147375564906792) - (.12197854304894211937147375564906792) - (.47765370899783134571567376444973682), .12197854304894211937147375564906792, .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 87 348 PQP3(R3(.12197854304894211937147375564906792, .12197854304894211937147375564906792, .47765370899783134571567376444973682), .02094018358085748583183796760479700), // 88 352 PQP3(R3(.12197854304894211937147375564906792, .47765370899783134571567376444973682, .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 89 356 PQP3(R3(.47765370899783134571567376444973682, .12197854304894211937147375564906792, .12197854304894211937147375564906792), .02094018358085748583183796760479700), // 90 360 PQP3(R3(.01480482319031682427540691439704854, .81083799468092699988474915243749073, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073)), .00171435866337409051521874943702732), // 91 364 PQP3(R3(.01480482319031682427540691439704854, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .81083799468092699988474915243749073), .00171435866337409051521874943702732), // 92 368 PQP3(R3(.81083799468092699988474915243749073, .01480482319031682427540691439704854, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073)), .00171435866337409051521874943702732), // 93 372 PQP3(R3(.81083799468092699988474915243749073, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 94 376 PQP3(R3(1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .01480482319031682427540691439704854, .81083799468092699988474915243749073), .00171435866337409051521874943702732), // 95 380 PQP3(R3(1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .81083799468092699988474915243749073, .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 96 384 PQP3(R3(.01480482319031682427540691439704854, .01480482319031682427540691439704854, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073)), .00171435866337409051521874943702732), // 97 388 PQP3(R3(.01480482319031682427540691439704854, 1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 98 392 PQP3(R3(1. - (.01480482319031682427540691439704854) - (.01480482319031682427540691439704854) - (.81083799468092699988474915243749073), .01480482319031682427540691439704854, .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 99 396 PQP3(R3(.01480482319031682427540691439704854, .01480482319031682427540691439704854, .81083799468092699988474915243749073), .00171435866337409051521874943702732), // 100 400 PQP3(R3(.01480482319031682427540691439704854, .81083799468092699988474915243749073, .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 101 404 PQP3(R3(.81083799468092699988474915243749073, .01480482319031682427540691439704854, .01480482319031682427540691439704854), .00171435866337409051521874943702732), // 102 408 PQP3(R3(.22646235632397177636617160407210034, .02251830769546778956654013747639605, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 103 412 PQP3(R3(.22646235632397177636617160407210034, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 104 416 PQP3(R3(.02251830769546778956654013747639605, .22646235632397177636617160407210034, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 105 420 PQP3(R3(.02251830769546778956654013747639605, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 106 424 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .22646235632397177636617160407210034, .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 107 428 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .02251830769546778956654013747639605, .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 108 432 PQP3(R3(.65250697573013212016385330106711095, .02251830769546778956654013747639605, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 109 436 PQP3(R3(.65250697573013212016385330106711095, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 110 440 PQP3(R3(.02251830769546778956654013747639605, .65250697573013212016385330106711095, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 111 444 PQP3(R3(.02251830769546778956654013747639605, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 112 448 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .65250697573013212016385330106711095, .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 113 452 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .02251830769546778956654013747639605, .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 114 456 PQP3(R3(.65250697573013212016385330106711095, .22646235632397177636617160407210034, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 115 460 PQP3(R3(.65250697573013212016385330106711095, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 116 464 PQP3(R3(.22646235632397177636617160407210034, .65250697573013212016385330106711095, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605)), .00759915954173370886076474450830409), // 117 468 PQP3(R3(.22646235632397177636617160407210034, 1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 118 472 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .65250697573013212016385330106711095, .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 119 476 PQP3(R3(1. - (.65250697573013212016385330106711095) - (.22646235632397177636617160407210034) - (.02251830769546778956654013747639605), .22646235632397177636617160407210034, .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 120 480 PQP3(R3(.65250697573013212016385330106711095, .22646235632397177636617160407210034, .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 121 484 PQP3(R3(.65250697573013212016385330106711095, .02251830769546778956654013747639605, .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 122 488 PQP3(R3(.22646235632397177636617160407210034, .65250697573013212016385330106711095, .02251830769546778956654013747639605), .00759915954173370886076474450830409), // 123 492 PQP3(R3(.22646235632397177636617160407210034, .02251830769546778956654013747639605, .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 124 496 PQP3(R3(.02251830769546778956654013747639605, .65250697573013212016385330106711095, .22646235632397177636617160407210034), .00759915954173370886076474450830409), // 125 500 PQP3(R3(.02251830769546778956654013747639605, .22646235632397177636617160407210034, .65250697573013212016385330106711095), .00759915954173370886076474450830409), // 126 504 }; PQF3 const QuadratureFormular_Tet_P12(12, 127, QF_TET_P12); // QUAD QUAD_3D_P13_ = { 149 596 PQP3 QF_TET_P13 [] = { PQP3(R3(0.25, 0.25, 0.25), .02191579945212728678229670892998658), // 0 0 PQP3(R3(.09935339765028269917868020572165369, .09935339765028269917868020572165369, .09935339765028269917868020572165369), .00809592740005652573580359966615063), // 1 4 PQP3(R3(1. - 3. * (.09935339765028269917868020572165369), .09935339765028269917868020572165369, .09935339765028269917868020572165369), .00809592740005652573580359966615063), // 2 8 PQP3(R3(.09935339765028269917868020572165369, 1. - 3. * (.09935339765028269917868020572165369), .09935339765028269917868020572165369), .00809592740005652573580359966615063), // 3 12 PQP3(R3(.09935339765028269917868020572165369, .09935339765028269917868020572165369, 1. - 3. * (.09935339765028269917868020572165369)), .00809592740005652573580359966615063), // 4 16 PQP3(R3(.02361873260499568532036302265004401, .02361873260499568532036302265004401, .02361873260499568532036302265004401), .00130319185047278813746994806952476), // 5 20 PQP3(R3(1. - 3. * (.02361873260499568532036302265004401), .02361873260499568532036302265004401, .02361873260499568532036302265004401), .00130319185047278813746994806952476), // 6 24 PQP3(R3(.02361873260499568532036302265004401, 1. - 3. * (.02361873260499568532036302265004401), .02361873260499568532036302265004401), .00130319185047278813746994806952476), // 7 28 PQP3(R3(.02361873260499568532036302265004401, .02361873260499568532036302265004401, 1. - 3. * (.02361873260499568532036302265004401)), .00130319185047278813746994806952476), // 8 32 PQP3(R3(.30089166537572662790706731844610997, .30089166537572662790706731844610997, .30089166537572662790706731844610997), .01996610676014222116016391561580003), // 9 36 PQP3(R3(1. - 3. * (.30089166537572662790706731844610997), .30089166537572662790706731844610997, .30089166537572662790706731844610997), .01996610676014222116016391561580003), // 10 40 PQP3(R3(.30089166537572662790706731844610997, 1. - 3. * (.30089166537572662790706731844610997), .30089166537572662790706731844610997), .01996610676014222116016391561580003), // 11 44 PQP3(R3(.30089166537572662790706731844610997, .30089166537572662790706731844610997, 1. - 3. * (.30089166537572662790706731844610997)), .01996610676014222116016391561580003), // 12 48 PQP3(R3(.18156624280757148139366685840064601, .18156624280757148139366685840064601, .18156624280757148139366685840064601), .02125705756007566772097136088386650), // 13 52 PQP3(R3(1. - 3. * (.18156624280757148139366685840064601), .18156624280757148139366685840064601, .18156624280757148139366685840064601), .02125705756007566772097136088386650), // 14 56 PQP3(R3(.18156624280757148139366685840064601, 1. - 3. * (.18156624280757148139366685840064601), .18156624280757148139366685840064601), .02125705756007566772097136088386650), // 15 60 PQP3(R3(.18156624280757148139366685840064601, .18156624280757148139366685840064601, 1. - 3. * (.18156624280757148139366685840064601)), .02125705756007566772097136088386650), // 16 64 PQP3(R3(.00428160639152879988718710754508354, .5 - (.00428160639152879988718710754508354), .5 - (.00428160639152879988718710754508354)), .00077331890737182713690269661719116), // 17 68 PQP3(R3(.5 - (.00428160639152879988718710754508354), .00428160639152879988718710754508354, .5 - (.00428160639152879988718710754508354)), .00077331890737182713690269661719116), // 18 72 PQP3(R3(.5 - (.00428160639152879988718710754508354), .5 - (.00428160639152879988718710754508354), .00428160639152879988718710754508354), .00077331890737182713690269661719116), // 19 76 PQP3(R3(.00428160639152879988718710754508354, .5 - (.00428160639152879988718710754508354), .00428160639152879988718710754508354), .00077331890737182713690269661719116),// 20 80 PQP3(R3(.00428160639152879988718710754508354, .00428160639152879988718710754508354, .5 - (.00428160639152879988718710754508354)), .00077331890737182713690269661719116),// 21 84 PQP3(R3(.5 - (.00428160639152879988718710754508354), .00428160639152879988718710754508354, .00428160639152879988718710754508354), .00077331890737182713690269661719116),// 22 88 PQP3(R3(.12290357421888442998582785890620434, .5 - (.12290357421888442998582785890620434), .5 - (.12290357421888442998582785890620434)), .01755491389570430512641028370006205), // 23 92 PQP3(R3(.5 - (.12290357421888442998582785890620434), .12290357421888442998582785890620434, .5 - (.12290357421888442998582785890620434)), .01755491389570430512641028370006205), // 24 96 PQP3(R3(.5 - (.12290357421888442998582785890620434), .5 - (.12290357421888442998582785890620434), .12290357421888442998582785890620434), .01755491389570430512641028370006205), // 25 100 PQP3(R3(.12290357421888442998582785890620434, .5 - (.12290357421888442998582785890620434), .12290357421888442998582785890620434), .01755491389570430512641028370006205),// 26 104 PQP3(R3(.12290357421888442998582785890620434, .12290357421888442998582785890620434, .5 - (.12290357421888442998582785890620434)), .01755491389570430512641028370006205),// 27 108 PQP3(R3(.5 - (.12290357421888442998582785890620434), .12290357421888442998582785890620434, .12290357421888442998582785890620434), .01755491389570430512641028370006205),// 28 112 PQP3(R3(.28318219770202728236417353077594322, .43037955664247500440987356786807501, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501)), .00213830361001659899343287397434178), // 29 116 PQP3(R3(.28318219770202728236417353077594322, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .43037955664247500440987356786807501), .00213830361001659899343287397434178), // 30 120 PQP3(R3(.43037955664247500440987356786807501, .28318219770202728236417353077594322, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501)), .00213830361001659899343287397434178), // 31 124 PQP3(R3(.43037955664247500440987356786807501, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 32 128 PQP3(R3(1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .28318219770202728236417353077594322, .43037955664247500440987356786807501), .00213830361001659899343287397434178), // 33 132 PQP3(R3(1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .43037955664247500440987356786807501, .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 34 136 PQP3(R3(.28318219770202728236417353077594322, .28318219770202728236417353077594322, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501)), .00213830361001659899343287397434178), // 35 140 PQP3(R3(.28318219770202728236417353077594322, 1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 36 144 PQP3(R3(1. - (.28318219770202728236417353077594322) - (.28318219770202728236417353077594322) - (.43037955664247500440987356786807501), .28318219770202728236417353077594322, .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 37 148 PQP3(R3(.28318219770202728236417353077594322, .28318219770202728236417353077594322, .43037955664247500440987356786807501), .00213830361001659899343287397434178), // 38 152 PQP3(R3(.28318219770202728236417353077594322, .43037955664247500440987356786807501, .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 39 156 PQP3(R3(.43037955664247500440987356786807501, .28318219770202728236417353077594322, .28318219770202728236417353077594322), .00213830361001659899343287397434178), // 40 160 PQP3(R3(.02239485904524970717572425710098278, .83488749018470024820940398932904512, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512)), .00256560169283338620814651902766716), // 41 164 PQP3(R3(.02239485904524970717572425710098278, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .83488749018470024820940398932904512), .00256560169283338620814651902766716), // 42 168 PQP3(R3(.83488749018470024820940398932904512, .02239485904524970717572425710098278, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512)), .00256560169283338620814651902766716), // 43 172 PQP3(R3(.83488749018470024820940398932904512, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 44 176 PQP3(R3(1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .02239485904524970717572425710098278, .83488749018470024820940398932904512), .00256560169283338620814651902766716), // 45 180 PQP3(R3(1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .83488749018470024820940398932904512, .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 46 184 PQP3(R3(.02239485904524970717572425710098278, .02239485904524970717572425710098278, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512)), .00256560169283338620814651902766716), // 47 188 PQP3(R3(.02239485904524970717572425710098278, 1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 48 192 PQP3(R3(1. - (.02239485904524970717572425710098278) - (.02239485904524970717572425710098278) - (.83488749018470024820940398932904512), .02239485904524970717572425710098278, .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 49 196 PQP3(R3(.02239485904524970717572425710098278, .02239485904524970717572425710098278, .83488749018470024820940398932904512), .00256560169283338620814651902766716), // 50 200 PQP3(R3(.02239485904524970717572425710098278, .83488749018470024820940398932904512, .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 51 204 PQP3(R3(.83488749018470024820940398932904512, .02239485904524970717572425710098278, .02239485904524970717572425710098278), .00256560169283338620814651902766716), // 52 208 PQP3(R3(.02191788402113435132324662419880111, .67691762094326571059673391273529166, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166)), .00338953948455728203040932651810398), // 53 212 PQP3(R3(.02191788402113435132324662419880111, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .67691762094326571059673391273529166), .00338953948455728203040932651810398), // 54 216 PQP3(R3(.67691762094326571059673391273529166, .02191788402113435132324662419880111, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166)), .00338953948455728203040932651810398), // 55 220 PQP3(R3(.67691762094326571059673391273529166, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 56 224 PQP3(R3(1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .02191788402113435132324662419880111, .67691762094326571059673391273529166), .00338953948455728203040932651810398), // 57 228 PQP3(R3(1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .67691762094326571059673391273529166, .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 58 232 PQP3(R3(.02191788402113435132324662419880111, .02191788402113435132324662419880111, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166)), .00338953948455728203040932651810398), // 59 236 PQP3(R3(.02191788402113435132324662419880111, 1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 60 240 PQP3(R3(1. - (.02191788402113435132324662419880111) - (.02191788402113435132324662419880111) - (.67691762094326571059673391273529166), .02191788402113435132324662419880111, .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 61 244 PQP3(R3(.02191788402113435132324662419880111, .02191788402113435132324662419880111, .67691762094326571059673391273529166), .00338953948455728203040932651810398), // 62 248 PQP3(R3(.02191788402113435132324662419880111, .67691762094326571059673391273529166, .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 63 252 PQP3(R3(.67691762094326571059673391273529166, .02191788402113435132324662419880111, .02191788402113435132324662419880111), .00338953948455728203040932651810398), // 64 256 PQP3(R3(.21481417044274656673534260788169227, .52280311286258745560867693994038579, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579)), .01135828330503278417235563981454793), // 65 260 PQP3(R3(.21481417044274656673534260788169227, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .52280311286258745560867693994038579), .01135828330503278417235563981454793), // 66 264 PQP3(R3(.52280311286258745560867693994038579, .21481417044274656673534260788169227, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579)), .01135828330503278417235563981454793), // 67 268 PQP3(R3(.52280311286258745560867693994038579, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 68 272 PQP3(R3(1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .21481417044274656673534260788169227, .52280311286258745560867693994038579), .01135828330503278417235563981454793), // 69 276 PQP3(R3(1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .52280311286258745560867693994038579, .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 70 280 PQP3(R3(.21481417044274656673534260788169227, .21481417044274656673534260788169227, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579)), .01135828330503278417235563981454793), // 71 284 PQP3(R3(.21481417044274656673534260788169227, 1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 72 288 PQP3(R3(1. - (.21481417044274656673534260788169227) - (.21481417044274656673534260788169227) - (.52280311286258745560867693994038579), .21481417044274656673534260788169227, .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 73 292 PQP3(R3(.21481417044274656673534260788169227, .21481417044274656673534260788169227, .52280311286258745560867693994038579), .01135828330503278417235563981454793), // 74 296 PQP3(R3(.21481417044274656673534260788169227, .52280311286258745560867693994038579, .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 75 300 PQP3(R3(.52280311286258745560867693994038579, .21481417044274656673534260788169227, .21481417044274656673534260788169227), .01135828330503278417235563981454793), // 76 304 PQP3(R3(.08000490008644308882018405418010744, .24689045570275147370034631014113188, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188)), .01103203882197761043040360052454856), // 77 308 PQP3(R3(.08000490008644308882018405418010744, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .24689045570275147370034631014113188), .01103203882197761043040360052454856), // 78 312 PQP3(R3(.24689045570275147370034631014113188, .08000490008644308882018405418010744, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188)), .01103203882197761043040360052454856), // 79 316 PQP3(R3(.24689045570275147370034631014113188, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 80 320 PQP3(R3(1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .08000490008644308882018405418010744, .24689045570275147370034631014113188), .01103203882197761043040360052454856), // 81 324 PQP3(R3(1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .24689045570275147370034631014113188, .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 82 328 PQP3(R3(.08000490008644308882018405418010744, .08000490008644308882018405418010744, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188)), .01103203882197761043040360052454856), // 83 332 PQP3(R3(.08000490008644308882018405418010744, 1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 84 336 PQP3(R3(1. - (.08000490008644308882018405418010744) - (.08000490008644308882018405418010744) - (.24689045570275147370034631014113188), .08000490008644308882018405418010744, .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 85 340 PQP3(R3(.08000490008644308882018405418010744, .08000490008644308882018405418010744, .24689045570275147370034631014113188), .01103203882197761043040360052454856), // 86 344 PQP3(R3(.08000490008644308882018405418010744, .24689045570275147370034631014113188, .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 87 348 PQP3(R3(.24689045570275147370034631014113188, .08000490008644308882018405418010744, .08000490008644308882018405418010744), .01103203882197761043040360052454856), // 88 352 PQP3(R3(.11579466150271899371721034492503850, .74997281767443310000000000000000000, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000)), .00457602573785952356043458354199517), // 89 356 PQP3(R3(.11579466150271899371721034492503850, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .74997281767443310000000000000000000), .00457602573785952356043458354199517), // 90 360 PQP3(R3(.74997281767443310000000000000000000, .11579466150271899371721034492503850, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000)), .00457602573785952356043458354199517), // 91 364 PQP3(R3(.74997281767443310000000000000000000, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 92 368 PQP3(R3(1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .11579466150271899371721034492503850, .74997281767443310000000000000000000), .00457602573785952356043458354199517), // 93 372 PQP3(R3(1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .74997281767443310000000000000000000, .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 94 376 PQP3(R3(.11579466150271899371721034492503850, .11579466150271899371721034492503850, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000)), .00457602573785952356043458354199517), // 95 380 PQP3(R3(.11579466150271899371721034492503850, 1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 96 384 PQP3(R3(1. - (.11579466150271899371721034492503850) - (.11579466150271899371721034492503850) - (.74997281767443310000000000000000000), .11579466150271899371721034492503850, .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 97 388 PQP3(R3(.11579466150271899371721034492503850, .11579466150271899371721034492503850, .74997281767443310000000000000000000), .00457602573785952356043458354199517), // 98 392 PQP3(R3(.11579466150271899371721034492503850, .74997281767443310000000000000000000, .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 99 396 PQP3(R3(.74997281767443310000000000000000000, .11579466150271899371721034492503850, .11579466150271899371721034492503850), .00457602573785952356043458354199517), // 100 400 PQP3(R3(.39129315347000474438672195978809687, .18835457382799180000000000000000000, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000)), .00827343104220868129752243222682095), // 101 404 PQP3(R3(.39129315347000474438672195978809687, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .18835457382799180000000000000000000), .00827343104220868129752243222682095), // 102 408 PQP3(R3(.18835457382799180000000000000000000, .39129315347000474438672195978809687, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000)), .00827343104220868129752243222682095), // 103 412 PQP3(R3(.18835457382799180000000000000000000, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 104 416 PQP3(R3(1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .39129315347000474438672195978809687, .18835457382799180000000000000000000), .00827343104220868129752243222682095), // 105 420 PQP3(R3(1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .18835457382799180000000000000000000, .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 106 424 PQP3(R3(.39129315347000474438672195978809687, .39129315347000474438672195978809687, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000)), .00827343104220868129752243222682095), // 107 428 PQP3(R3(.39129315347000474438672195978809687, 1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 108 432 PQP3(R3(1. - (.39129315347000474438672195978809687) - (.39129315347000474438672195978809687) - (.18835457382799180000000000000000000), .39129315347000474438672195978809687, .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 109 436 PQP3(R3(.39129315347000474438672195978809687, .39129315347000474438672195978809687, .18835457382799180000000000000000000), .00827343104220868129752243222682095), // 110 440 PQP3(R3(.39129315347000474438672195978809687, .18835457382799180000000000000000000, .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 111 444 PQP3(R3(.18835457382799180000000000000000000, .39129315347000474438672195978809687, .39129315347000474438672195978809687), .00827343104220868129752243222682095), // 112 448 PQP3(R3(.45315745821242834581317282468854978, .02202033169457796534173826092007299, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299)), .00586641165391940007076312979369247), // 113 452 PQP3(R3(.45315745821242834581317282468854978, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .02202033169457796534173826092007299), .00586641165391940007076312979369247), // 114 456 PQP3(R3(.02202033169457796534173826092007299, .45315745821242834581317282468854978, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299)), .00586641165391940007076312979369247), // 115 460 PQP3(R3(.02202033169457796534173826092007299, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 116 464 PQP3(R3(1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .45315745821242834581317282468854978, .02202033169457796534173826092007299), .00586641165391940007076312979369247), // 117 468 PQP3(R3(1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .02202033169457796534173826092007299, .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 118 472 PQP3(R3(.45315745821242834581317282468854978, .45315745821242834581317282468854978, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299)), .00586641165391940007076312979369247), // 119 476 PQP3(R3(.45315745821242834581317282468854978, 1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 120 480 PQP3(R3(1. - (.45315745821242834581317282468854978) - (.45315745821242834581317282468854978) - (.02202033169457796534173826092007299), .45315745821242834581317282468854978, .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 121 484 PQP3(R3(.45315745821242834581317282468854978, .45315745821242834581317282468854978, .02202033169457796534173826092007299), .00586641165391940007076312979369247), // 122 488 PQP3(R3(.45315745821242834581317282468854978, .02202033169457796534173826092007299, .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 123 492 PQP3(R3(.02202033169457796534173826092007299, .45315745821242834581317282468854978, .45315745821242834581317282468854978), .00586641165391940007076312979369247), // 124 496 PQP3(R3(.60775441245653315696274741541102470, .00561877924700169073874366184065955, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 125 500 PQP3(R3(.60775441245653315696274741541102470, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 126 504 PQP3(R3(.00561877924700169073874366184065955, .60775441245653315696274741541102470, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 127 508 PQP3(R3(.00561877924700169073874366184065955, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 128 512 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .60775441245653315696274741541102470, .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 129 516 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .00561877924700169073874366184065955, .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 130 520 PQP3(R3(.27324999892429634023602493512400674, .00561877924700169073874366184065955, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 131 524 PQP3(R3(.27324999892429634023602493512400674, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 132 528 PQP3(R3(.00561877924700169073874366184065955, .27324999892429634023602493512400674, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 133 532 PQP3(R3(.00561877924700169073874366184065955, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 134 536 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .27324999892429634023602493512400674, .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 135 540 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .00561877924700169073874366184065955, .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 136 544 PQP3(R3(.27324999892429634023602493512400674, .60775441245653315696274741541102470, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 137 548 PQP3(R3(.27324999892429634023602493512400674, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 138 552 PQP3(R3(.60775441245653315696274741541102470, .27324999892429634023602493512400674, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955)), .00313458521939849614410720196518793), // 139 556 PQP3(R3(.60775441245653315696274741541102470, 1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 140 560 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .27324999892429634023602493512400674, .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 141 564 PQP3(R3(1. - (.27324999892429634023602493512400674) - (.60775441245653315696274741541102470) - (.00561877924700169073874366184065955), .60775441245653315696274741541102470, .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 142 568 PQP3(R3(.27324999892429634023602493512400674, .60775441245653315696274741541102470, .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 143 572 PQP3(R3(.27324999892429634023602493512400674, .00561877924700169073874366184065955, .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 144 576 PQP3(R3(.60775441245653315696274741541102470, .27324999892429634023602493512400674, .00561877924700169073874366184065955), .00313458521939849614410720196518793), // 145 580 PQP3(R3(.60775441245653315696274741541102470, .00561877924700169073874366184065955, .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 146 584 PQP3(R3(.00561877924700169073874366184065955, .27324999892429634023602493512400674, .60775441245653315696274741541102470), .00313458521939849614410720196518793), // 147 588 PQP3(R3(.00561877924700169073874366184065955, .60775441245653315696274741541102470, .27324999892429634023602493512400674), .00313458521939849614410720196518793), // 148 592 }; PQF3 const QuadratureFormular_Tet_P13(13, 149, QF_TET_P13); // QUAD QUAD_3D_P14_ = { 194 776 PQP3 QF_TET_P14 [] = { PQP3(R3(.12703434587701869604797950660749487, .12703434587701869604797950660749487, .12703434587701869604797950660749487), .00898427322254918127543126682598773), // 0 0 PQP3(R3(1. - 3. * (.12703434587701869604797950660749487), .12703434587701869604797950660749487, .12703434587701869604797950660749487), .00898427322254918127543126682598773), // 1 4 PQP3(R3(.12703434587701869604797950660749487, 1. - 3. * (.12703434587701869604797950660749487), .12703434587701869604797950660749487), .00898427322254918127543126682598773), // 2 8 PQP3(R3(.12703434587701869604797950660749487, .12703434587701869604797950660749487, 1. - 3. * (.12703434587701869604797950660749487)), .00898427322254918127543126682598773), // 3 12 PQP3(R3(.03716308713428675181759859706979325, .03716308713428675181759859706979325, .03716308713428675181759859706979325), .00235414897468188299910869230818368), // 4 16 PQP3(R3(1. - 3. * (.03716308713428675181759859706979325), .03716308713428675181759859706979325, .03716308713428675181759859706979325), .00235414897468188299910869230818368), // 5 20 PQP3(R3(.03716308713428675181759859706979325, 1. - 3. * (.03716308713428675181759859706979325), .03716308713428675181759859706979325), .00235414897468188299910869230818368), // 6 24 PQP3(R3(.03716308713428675181759859706979325, .03716308713428675181759859706979325, 1. - 3. * (.03716308713428675181759859706979325)), .00235414897468188299910869230818368), // 7 28 PQP3(R3(.30931161817607732544635505822019770, .30931161817607732544635505822019770, .30931161817607732544635505822019770), .00733553866836377016223467789336265), // 8 32 PQP3(R3(1. - 3. * (.30931161817607732544635505822019770), .30931161817607732544635505822019770, .30931161817607732544635505822019770), .00733553866836377016223467789336265), // 9 36 PQP3(R3(.30931161817607732544635505822019770, 1. - 3. * (.30931161817607732544635505822019770), .30931161817607732544635505822019770), .00733553866836377016223467789336265), // 10 40 PQP3(R3(.30931161817607732544635505822019770, .30931161817607732544635505822019770, 1. - 3. * (.30931161817607732544635505822019770)), .00733553866836377016223467789336265), // 11 44 PQP3(R3(.07778813507287403019691221965639750, .07778813507287403019691221965639750, .07778813507287403019691221965639750), .00360629336228634011530354432318077), // 12 48 PQP3(R3(1. - 3. * (.07778813507287403019691221965639750), .07778813507287403019691221965639750, .07778813507287403019691221965639750), .00360629336228634011530354432318077), // 13 52 PQP3(R3(.07778813507287403019691221965639750, 1. - 3. * (.07778813507287403019691221965639750), .07778813507287403019691221965639750), .00360629336228634011530354432318077), // 14 56 PQP3(R3(.07778813507287403019691221965639750, .07778813507287403019691221965639750, 1. - 3. * (.07778813507287403019691221965639750)), .00360629336228634011530354432318077), // 15 60 PQP3(R3(.01187611663683786502091234677477106, .01187611663683786502091234677477106, .01187611663683786502091234677477106), .00022796656022189240650071390651338), // 16 64 PQP3(R3(1. - 3. * (.01187611663683786502091234677477106), .01187611663683786502091234677477106, .01187611663683786502091234677477106), .00022796656022189240650071390651338), // 17 68 PQP3(R3(.01187611663683786502091234677477106, 1. - 3. * (.01187611663683786502091234677477106), .01187611663683786502091234677477106), .00022796656022189240650071390651338), // 18 72 PQP3(R3(.01187611663683786502091234677477106, .01187611663683786502091234677477106, 1. - 3. * (.01187611663683786502091234677477106)), .00022796656022189240650071390651338), // 19 76 PQP3(R3(.02371189715571358237825633505545476, .5 - (.02371189715571358237825633505545476), .5 - (.02371189715571358237825633505545476)), .00425068731230945391542573203967906), // 20 80 PQP3(R3(.5 - (.02371189715571358237825633505545476), .02371189715571358237825633505545476, .5 - (.02371189715571358237825633505545476)), .00425068731230945391542573203967906), // 21 84 PQP3(R3(.5 - (.02371189715571358237825633505545476), .5 - (.02371189715571358237825633505545476), .02371189715571358237825633505545476), .00425068731230945391542573203967906), // 22 88 PQP3(R3(.02371189715571358237825633505545476, .5 - (.02371189715571358237825633505545476), .02371189715571358237825633505545476), .00425068731230945391542573203967906),// 23 92 PQP3(R3(.02371189715571358237825633505545476, .02371189715571358237825633505545476, .5 - (.02371189715571358237825633505545476)), .00425068731230945391542573203967906),// 24 96 PQP3(R3(.5 - (.02371189715571358237825633505545476), .02371189715571358237825633505545476, .02371189715571358237825633505545476), .00425068731230945391542573203967906),// 25 100 PQP3(R3(.04551422172971295738029708158398140, .73884882267833978290969755547076243, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243)), .00502229674184657212637707578731437), // 26 104 PQP3(R3(.04551422172971295738029708158398140, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .73884882267833978290969755547076243), .00502229674184657212637707578731437), // 27 108 PQP3(R3(.73884882267833978290969755547076243, .04551422172971295738029708158398140, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243)), .00502229674184657212637707578731437), // 28 112 PQP3(R3(.73884882267833978290969755547076243, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 29 116 PQP3(R3(1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .04551422172971295738029708158398140, .73884882267833978290969755547076243), .00502229674184657212637707578731437), // 30 120 PQP3(R3(1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .73884882267833978290969755547076243, .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 31 124 PQP3(R3(.04551422172971295738029708158398140, .04551422172971295738029708158398140, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243)), .00502229674184657212637707578731437), // 32 128 PQP3(R3(.04551422172971295738029708158398140, 1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 33 132 PQP3(R3(1. - (.04551422172971295738029708158398140) - (.04551422172971295738029708158398140) - (.73884882267833978290969755547076243), .04551422172971295738029708158398140, .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 34 136 PQP3(R3(.04551422172971295738029708158398140, .04551422172971295738029708158398140, .73884882267833978290969755547076243), .00502229674184657212637707578731437), // 35 140 PQP3(R3(.04551422172971295738029708158398140, .73884882267833978290969755547076243, .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 36 144 PQP3(R3(.73884882267833978290969755547076243, .04551422172971295738029708158398140, .04551422172971295738029708158398140), .00502229674184657212637707578731437), // 37 148 PQP3(R3(.19457055431059420000000000000000000, .36138202354403612356128050094846106, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106)), .00664105199619194276141547967835717), // 38 152 PQP3(R3(.19457055431059420000000000000000000, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .36138202354403612356128050094846106), .00664105199619194276141547967835717), // 39 156 PQP3(R3(.36138202354403612356128050094846106, .19457055431059420000000000000000000, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106)), .00664105199619194276141547967835717), // 40 160 PQP3(R3(.36138202354403612356128050094846106, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 41 164 PQP3(R3(1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .19457055431059420000000000000000000, .36138202354403612356128050094846106), .00664105199619194276141547967835717), // 42 168 PQP3(R3(1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .36138202354403612356128050094846106, .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 43 172 PQP3(R3(.19457055431059420000000000000000000, .19457055431059420000000000000000000, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106)), .00664105199619194276141547967835717), // 44 176 PQP3(R3(.19457055431059420000000000000000000, 1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 45 180 PQP3(R3(1. - (.19457055431059420000000000000000000) - (.19457055431059420000000000000000000) - (.36138202354403612356128050094846106), .19457055431059420000000000000000000, .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 46 184 PQP3(R3(.19457055431059420000000000000000000, .19457055431059420000000000000000000, .36138202354403612356128050094846106), .00664105199619194276141547967835717), // 47 188 PQP3(R3(.19457055431059420000000000000000000, .36138202354403612356128050094846106, .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 48 192 PQP3(R3(.36138202354403612356128050094846106, .19457055431059420000000000000000000, .19457055431059420000000000000000000), .00664105199619194276141547967835717), // 49 196 PQP3(R3(.42158193164647035846631052119479790, .13481021809330111977392354242291205, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205)), .00648663075652078221084713724389357), // 50 200 PQP3(R3(.42158193164647035846631052119479790, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .13481021809330111977392354242291205), .00648663075652078221084713724389357), // 51 204 PQP3(R3(.13481021809330111977392354242291205, .42158193164647035846631052119479790, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205)), .00648663075652078221084713724389357), // 52 208 PQP3(R3(.13481021809330111977392354242291205, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 53 212 PQP3(R3(1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .42158193164647035846631052119479790, .13481021809330111977392354242291205), .00648663075652078221084713724389357), // 54 216 PQP3(R3(1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .13481021809330111977392354242291205, .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 55 220 PQP3(R3(.42158193164647035846631052119479790, .42158193164647035846631052119479790, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205)), .00648663075652078221084713724389357), // 56 224 PQP3(R3(.42158193164647035846631052119479790, 1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 57 228 PQP3(R3(1. - (.42158193164647035846631052119479790) - (.42158193164647035846631052119479790) - (.13481021809330111977392354242291205), .42158193164647035846631052119479790, .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 58 232 PQP3(R3(.42158193164647035846631052119479790, .42158193164647035846631052119479790, .13481021809330111977392354242291205), .00648663075652078221084713724389357), // 59 236 PQP3(R3(.42158193164647035846631052119479790, .13481021809330111977392354242291205, .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 60 240 PQP3(R3(.13481021809330111977392354242291205, .42158193164647035846631052119479790, .42158193164647035846631052119479790), .00648663075652078221084713724389357), // 61 244 PQP3(R3(.36227661803202431683389679069549247, .09100846759454444774082592541447308, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308)), .01084924609520658118048627917429636), // 62 248 PQP3(R3(.36227661803202431683389679069549247, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .09100846759454444774082592541447308), .01084924609520658118048627917429636), // 63 252 PQP3(R3(.09100846759454444774082592541447308, .36227661803202431683389679069549247, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308)), .01084924609520658118048627917429636), // 64 256 PQP3(R3(.09100846759454444774082592541447308, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 65 260 PQP3(R3(1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .36227661803202431683389679069549247, .09100846759454444774082592541447308), .01084924609520658118048627917429636), // 66 264 PQP3(R3(1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .09100846759454444774082592541447308, .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 67 268 PQP3(R3(.36227661803202431683389679069549247, .36227661803202431683389679069549247, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308)), .01084924609520658118048627917429636), // 68 272 PQP3(R3(.36227661803202431683389679069549247, 1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 69 276 PQP3(R3(1. - (.36227661803202431683389679069549247) - (.36227661803202431683389679069549247) - (.09100846759454444774082592541447308), .36227661803202431683389679069549247, .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 70 280 PQP3(R3(.36227661803202431683389679069549247, .36227661803202431683389679069549247, .09100846759454444774082592541447308), .01084924609520658118048627917429636), // 71 284 PQP3(R3(.36227661803202431683389679069549247, .09100846759454444774082592541447308, .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 72 288 PQP3(R3(.09100846759454444774082592541447308, .36227661803202431683389679069549247, .36227661803202431683389679069549247), .01084924609520658118048627917429636), // 73 292 PQP3(R3(.26662003783461096351186917353420086, .45135951603290056428206454329600320, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320)), .00698225572400728567899793615355807), // 74 296 PQP3(R3(.26662003783461096351186917353420086, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .45135951603290056428206454329600320), .00698225572400728567899793615355807), // 75 300 PQP3(R3(.45135951603290056428206454329600320, .26662003783461096351186917353420086, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320)), .00698225572400728567899793615355807), // 76 304 PQP3(R3(.45135951603290056428206454329600320, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 77 308 PQP3(R3(1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .26662003783461096351186917353420086, .45135951603290056428206454329600320), .00698225572400728567899793615355807), // 78 312 PQP3(R3(1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .45135951603290056428206454329600320, .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 79 316 PQP3(R3(.26662003783461096351186917353420086, .26662003783461096351186917353420086, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320)), .00698225572400728567899793615355807), // 80 320 PQP3(R3(.26662003783461096351186917353420086, 1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 81 324 PQP3(R3(1. - (.26662003783461096351186917353420086) - (.26662003783461096351186917353420086) - (.45135951603290056428206454329600320), .26662003783461096351186917353420086, .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 82 328 PQP3(R3(.26662003783461096351186917353420086, .26662003783461096351186917353420086, .45135951603290056428206454329600320), .00698225572400728567899793615355807), // 83 332 PQP3(R3(.26662003783461096351186917353420086, .45135951603290056428206454329600320, .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 84 336 PQP3(R3(.45135951603290056428206454329600320, .26662003783461096351186917353420086, .26662003783461096351186917353420086), .00698225572400728567899793615355807), // 85 340 PQP3(R3(.07870367664603755989163074150395650, .53854007868617855365162509332690316, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316)), .01057643198113441258335538488635301), // 86 344 PQP3(R3(.07870367664603755989163074150395650, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .53854007868617855365162509332690316), .01057643198113441258335538488635301), // 87 348 PQP3(R3(.53854007868617855365162509332690316, .07870367664603755989163074150395650, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316)), .01057643198113441258335538488635301), // 88 352 PQP3(R3(.53854007868617855365162509332690316, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 89 356 PQP3(R3(1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .07870367664603755989163074150395650, .53854007868617855365162509332690316), .01057643198113441258335538488635301), // 90 360 PQP3(R3(1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .53854007868617855365162509332690316, .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 91 364 PQP3(R3(.07870367664603755989163074150395650, .07870367664603755989163074150395650, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316)), .01057643198113441258335538488635301), // 92 368 PQP3(R3(.07870367664603755989163074150395650, 1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 93 372 PQP3(R3(1. - (.07870367664603755989163074150395650) - (.07870367664603755989163074150395650) - (.53854007868617855365162509332690316), .07870367664603755989163074150395650, .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 94 376 PQP3(R3(.07870367664603755989163074150395650, .07870367664603755989163074150395650, .53854007868617855365162509332690316), .01057643198113441258335538488635301), // 95 380 PQP3(R3(.07870367664603755989163074150395650, .53854007868617855365162509332690316, .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 96 384 PQP3(R3(.53854007868617855365162509332690316, .07870367664603755989163074150395650, .07870367664603755989163074150395650), .01057643198113441258335538488635301), // 97 388 PQP3(R3(.01462604843949452202375023818416595, .68140642280720592407050422036244765, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765)), .00172517387494940531214061228255136), // 98 392 PQP3(R3(.01462604843949452202375023818416595, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .68140642280720592407050422036244765), .00172517387494940531214061228255136), // 99 396 PQP3(R3(.68140642280720592407050422036244765, .01462604843949452202375023818416595, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765)), .00172517387494940531214061228255136), // 100 400 PQP3(R3(.68140642280720592407050422036244765, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 101 404 PQP3(R3(1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .01462604843949452202375023818416595, .68140642280720592407050422036244765), .00172517387494940531214061228255136), // 102 408 PQP3(R3(1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .68140642280720592407050422036244765, .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 103 412 PQP3(R3(.01462604843949452202375023818416595, .01462604843949452202375023818416595, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765)), .00172517387494940531214061228255136), // 104 416 PQP3(R3(.01462604843949452202375023818416595, 1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 105 420 PQP3(R3(1. - (.01462604843949452202375023818416595) - (.01462604843949452202375023818416595) - (.68140642280720592407050422036244765), .01462604843949452202375023818416595, .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 106 424 PQP3(R3(.01462604843949452202375023818416595, .01462604843949452202375023818416595, .68140642280720592407050422036244765), .00172517387494940531214061228255136), // 107 428 PQP3(R3(.01462604843949452202375023818416595, .68140642280720592407050422036244765, .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 108 432 PQP3(R3(.68140642280720592407050422036244765, .01462604843949452202375023818416595, .01462604843949452202375023818416595), .00172517387494940531214061228255136), // 109 436 PQP3(R3(.20755902173331721318141636044536441, .49641284136813420000000000000000000, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000)), .01064026039260234415487304925754523), // 110 440 PQP3(R3(.20755902173331721318141636044536441, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .49641284136813420000000000000000000), .01064026039260234415487304925754523), // 111 444 PQP3(R3(.49641284136813420000000000000000000, .20755902173331721318141636044536441, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000)), .01064026039260234415487304925754523), // 112 448 PQP3(R3(.49641284136813420000000000000000000, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 113 452 PQP3(R3(1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .20755902173331721318141636044536441, .49641284136813420000000000000000000), .01064026039260234415487304925754523), // 114 456 PQP3(R3(1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .49641284136813420000000000000000000, .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 115 460 PQP3(R3(.20755902173331721318141636044536441, .20755902173331721318141636044536441, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000)), .01064026039260234415487304925754523), // 116 464 PQP3(R3(.20755902173331721318141636044536441, 1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 117 468 PQP3(R3(1. - (.20755902173331721318141636044536441) - (.20755902173331721318141636044536441) - (.49641284136813420000000000000000000), .20755902173331721318141636044536441, .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 118 472 PQP3(R3(.20755902173331721318141636044536441, .20755902173331721318141636044536441, .49641284136813420000000000000000000), .01064026039260234415487304925754523), // 119 476 PQP3(R3(.20755902173331721318141636044536441, .49641284136813420000000000000000000, .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 120 480 PQP3(R3(.49641284136813420000000000000000000, .20755902173331721318141636044536441, .20755902173331721318141636044536441), .01064026039260234415487304925754523), // 121 484 PQP3(R3(.00317672566580133046838579859910808, .88571644680187933415518991697343211, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211)), .00031627239419231128593612508289817), // 122 488 PQP3(R3(.00317672566580133046838579859910808, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .88571644680187933415518991697343211), .00031627239419231128593612508289817), // 123 492 PQP3(R3(.88571644680187933415518991697343211, .00317672566580133046838579859910808, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211)), .00031627239419231128593612508289817), // 124 496 PQP3(R3(.88571644680187933415518991697343211, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 125 500 PQP3(R3(1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .00317672566580133046838579859910808, .88571644680187933415518991697343211), .00031627239419231128593612508289817), // 126 504 PQP3(R3(1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .88571644680187933415518991697343211, .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 127 508 PQP3(R3(.00317672566580133046838579859910808, .00317672566580133046838579859910808, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211)), .00031627239419231128593612508289817), // 128 512 PQP3(R3(.00317672566580133046838579859910808, 1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 129 516 PQP3(R3(1. - (.00317672566580133046838579859910808) - (.00317672566580133046838579859910808) - (.88571644680187933415518991697343211), .00317672566580133046838579859910808, .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 130 520 PQP3(R3(.00317672566580133046838579859910808, .00317672566580133046838579859910808, .88571644680187933415518991697343211), .00031627239419231128593612508289817), // 131 524 PQP3(R3(.00317672566580133046838579859910808, .88571644680187933415518991697343211, .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 132 528 PQP3(R3(.88571644680187933415518991697343211, .00317672566580133046838579859910808, .00317672566580133046838579859910808), .00031627239419231128593612508289817), // 133 532 PQP3(R3(.16634658949265576428233847556684871, .64221464654291632524678940601354742, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742)), .00676212093730203740266276007684025), // 134 536 PQP3(R3(.16634658949265576428233847556684871, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .64221464654291632524678940601354742), .00676212093730203740266276007684025), // 135 540 PQP3(R3(.64221464654291632524678940601354742, .16634658949265576428233847556684871, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742)), .00676212093730203740266276007684025), // 136 544 PQP3(R3(.64221464654291632524678940601354742, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 137 548 PQP3(R3(1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .16634658949265576428233847556684871, .64221464654291632524678940601354742), .00676212093730203740266276007684025), // 138 552 PQP3(R3(1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .64221464654291632524678940601354742, .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 139 556 PQP3(R3(.16634658949265576428233847556684871, .16634658949265576428233847556684871, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742)), .00676212093730203740266276007684025), // 140 560 PQP3(R3(.16634658949265576428233847556684871, 1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 141 564 PQP3(R3(1. - (.16634658949265576428233847556684871) - (.16634658949265576428233847556684871) - (.64221464654291632524678940601354742), .16634658949265576428233847556684871, .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 142 568 PQP3(R3(.16634658949265576428233847556684871, .16634658949265576428233847556684871, .64221464654291632524678940601354742), .00676212093730203740266276007684025), // 143 572 PQP3(R3(.16634658949265576428233847556684871, .64221464654291632524678940601354742, .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 144 576 PQP3(R3(.64221464654291632524678940601354742, .16634658949265576428233847556684871, .16634658949265576428233847556684871), .00676212093730203740266276007684025), // 145 580 PQP3(R3(.30344194369885264264500117734906354, .00772105989990930297678960227638472, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 146 584 PQP3(R3(.30344194369885264264500117734906354, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 147 588 PQP3(R3(.00772105989990930297678960227638472, .30344194369885264264500117734906354, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 148 592 PQP3(R3(.00772105989990930297678960227638472, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 149 596 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .30344194369885264264500117734906354, .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 150 600 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .00772105989990930297678960227638472, .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 151 604 PQP3(R3(.59698804897542365623933181080626979, .00772105989990930297678960227638472, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 152 608 PQP3(R3(.59698804897542365623933181080626979, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 153 612 PQP3(R3(.00772105989990930297678960227638472, .59698804897542365623933181080626979, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 154 616 PQP3(R3(.00772105989990930297678960227638472, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 155 620 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .59698804897542365623933181080626979, .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 156 624 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .00772105989990930297678960227638472, .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 157 628 PQP3(R3(.59698804897542365623933181080626979, .30344194369885264264500117734906354, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 158 632 PQP3(R3(.59698804897542365623933181080626979, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 159 636 PQP3(R3(.30344194369885264264500117734906354, .59698804897542365623933181080626979, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472)), .00293371746826111669254642316791922), // 160 640 PQP3(R3(.30344194369885264264500117734906354, 1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 161 644 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .59698804897542365623933181080626979, .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 162 648 PQP3(R3(1. - (.59698804897542365623933181080626979) - (.30344194369885264264500117734906354) - (.00772105989990930297678960227638472), .30344194369885264264500117734906354, .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 163 652 PQP3(R3(.59698804897542365623933181080626979, .30344194369885264264500117734906354, .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 164 656 PQP3(R3(.59698804897542365623933181080626979, .00772105989990930297678960227638472, .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 165 660 PQP3(R3(.30344194369885264264500117734906354, .59698804897542365623933181080626979, .00772105989990930297678960227638472), .00293371746826111669254642316791922), // 166 664 PQP3(R3(.30344194369885264264500117734906354, .00772105989990930297678960227638472, .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 167 668 PQP3(R3(.00772105989990930297678960227638472, .59698804897542365623933181080626979, .30344194369885264264500117734906354), .00293371746826111669254642316791922), // 168 672 PQP3(R3(.00772105989990930297678960227638472, .30344194369885264264500117734906354, .59698804897542365623933181080626979), .00293371746826111669254642316791922), // 169 676 PQP3(R3(.06021328978843793059084645285790579, .12582571438467239382589793638340901, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 170 680 PQP3(R3(.06021328978843793059084645285790579, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 171 684 PQP3(R3(.12582571438467239382589793638340901, .06021328978843793059084645285790579, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 172 688 PQP3(R3(.12582571438467239382589793638340901, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 173 692 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .06021328978843793059084645285790579, .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 174 696 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .12582571438467239382589793638340901, .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 175 700 PQP3(R3(.81379652801439184798325669233364806, .12582571438467239382589793638340901, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 176 704 PQP3(R3(.81379652801439184798325669233364806, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 177 708 PQP3(R3(.12582571438467239382589793638340901, .81379652801439184798325669233364806, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 178 712 PQP3(R3(.12582571438467239382589793638340901, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 179 716 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .81379652801439184798325669233364806, .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 180 720 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .12582571438467239382589793638340901, .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 181 724 PQP3(R3(.81379652801439184798325669233364806, .06021328978843793059084645285790579, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 182 728 PQP3(R3(.81379652801439184798325669233364806, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 183 732 PQP3(R3(.06021328978843793059084645285790579, .81379652801439184798325669233364806, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901)), .00091803679200083798695474146748587), // 184 736 PQP3(R3(.06021328978843793059084645285790579, 1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 185 740 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .81379652801439184798325669233364806, .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 186 744 PQP3(R3(1. - (.81379652801439184798325669233364806) - (.06021328978843793059084645285790579) - (.12582571438467239382589793638340901), .06021328978843793059084645285790579, .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 187 748 PQP3(R3(.81379652801439184798325669233364806, .06021328978843793059084645285790579, .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 188 752 PQP3(R3(.81379652801439184798325669233364806, .12582571438467239382589793638340901, .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 189 756 PQP3(R3(.06021328978843793059084645285790579, .81379652801439184798325669233364806, .12582571438467239382589793638340901), .00091803679200083798695474146748587), // 190 760 PQP3(R3(.06021328978843793059084645285790579, .12582571438467239382589793638340901, .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 191 764 PQP3(R3(.12582571438467239382589793638340901, .81379652801439184798325669233364806, .06021328978843793059084645285790579), .00091803679200083798695474146748587), // 192 768 PQP3(R3(.12582571438467239382589793638340901, .06021328978843793059084645285790579, .81379652801439184798325669233364806), .00091803679200083798695474146748587), // 193 772 }; PQF3 const QuadratureFormular_Tet_P14(14, 194, QF_TET_P14); const GQuadratureFormular*tripleQF (Stack stack, const GQuadratureFormular *const &pqf) { const GQuadratureFormular &qf = *pqf; int np = qf.n * 3; GQuadraturePoint *pq = new GQuadraturePoint[np]; for (int i = 0; i < np; ++i) { int j = i % 3, k = i / 3; const GQuadraturePoint &Pk = qf[k]; double x = Pk.x, y = Pk.y, z = 1 - x - y; if (j == 0) {x /= 3; y += x;} else if (j == 1) {y /= 3; x += y;} else {z /= 3; x += z; y += z;} pq[i].a = Pk.a / 3; pq[i].x = x; pq[i].y = y; } GQuadratureFormular *q = new GQuadratureFormular(qf.exact, np, pq, true); Add2StackOfPtr2Free(stack, q); return q; } template const GQuadratureFormular**cloneQF (const GQuadratureFormular **const &pr, GQuadratureFormular const *const &qf) { // cout << "pBuilQFd " << pr << " " << *pr << endl; ffassert(pr); int np = qf->n; GQuadraturePoint *pq = new GQuadraturePoint[np]; for (int i = 0; i < np; ++i) { pq[i] = (*qf)[i]; } *pr = new GQuadratureFormular(qf->exact, np, pq, true); return pr; } #include "lex.hpp" extern mylex *zzzfff; static void Load_Init () { /* * grep QuadratureFormular QF.cpp|grep ^const|awk -F"[_(]" '{print "Global.New(@qf" $3 "pT@,CConstant(&QuadratureFormular_T_"$3"));"}'|sed -e 's/@/"/g' */ Global.New("qf11pT", CConstant(&QuadratureFormular_T_11)); Global.New("qf13pT", CConstant(&QuadratureFormular_T_13)); Global.New("qf14pT", CConstant(&QuadratureFormular_T_14)); Global.New("qf16pT", CConstant(&QuadratureFormular_T_16)); Global.New("qf18pT", CConstant(&QuadratureFormular_T_18)); Global.New("qf20pT", CConstant(&QuadratureFormular_T_20)); Global.New("qf21pT", CConstant(&QuadratureFormular_T_21)); Global.New("qf23pT", CConstant(&QuadratureFormular_T_23)); Global.New("qf25pT", CConstant(&QuadratureFormular_T_25)); Global.New("qf11pE", CConstant(new QuadratureFormular1d(-1 + 2 * 11, 11, GaussLegendre(11), true))); Global.New("qf12pE", CConstant(new QuadratureFormular1d(-1 + 2 * 12, 12, GaussLegendre(12), true))); Global.New("qf13pE", CConstant(new QuadratureFormular1d(-1 + 2 * 13, 13, GaussLegendre(13), true))); Global.Add("QF1d", "(", new OneOperator2_ *, long, KNM_ >(BuilQFd )); Global.Add("QF2d", "(", new OneOperator2_ *, long, KNM_ >(BuilQFd )); Global.Add("QF3d", "(", new OneOperator2_ *, long, KNM_ >(BuilQFd )); Dcl_Type **>(::InitializePtr *>, ::DeletePtr *> ); Dcl_Type **>(::InitializePtr *>, ::DeletePtr *> ); Dcl_Type **>(::InitializePtr *>, ::DeletePtr *> ); zzzfff->Add("QF1", atype **>()); zzzfff->Add("QF2", atype **>()); zzzfff->Add("QF3", atype **>()); TheOperators->Add("<-", new OneOperator3_ **, const GQuadratureFormular **, long, KNM_ >(pBuilQFd ), new OneOperator3_ **, const GQuadratureFormular **, long, KNM_ >(pBuilQFd ), new OneOperator3_ **, const GQuadratureFormular **, long, KNM_ >(pBuilQFd ), new OneOperator2_ **, const GQuadratureFormular **, const GQuadratureFormular *>(cloneQF ), new OneOperator2_ **, const GQuadratureFormular **, const GQuadratureFormular *>(cloneQF ), new OneOperator2_ **, const GQuadratureFormular **, const GQuadratureFormular *>(cloneQF ) ); // cast ** -> * map_type[typeid(const GQuadratureFormular *).name()]->AddCast(new E_F1_funcT *, const GQuadratureFormular **>(UnRef *> )); map_type[typeid(const GQuadratureFormular *).name()]->AddCast(new E_F1_funcT *, const GQuadratureFormular **>(UnRef *> )); map_type[typeid(const GQuadratureFormular *).name()]->AddCast(new E_F1_funcT *, const GQuadratureFormular **>(UnRef *> )); // new quadrature formular for tet from ... /* * % Reference: * % @article{liu2009set, * % title={{A SET OF SYMMETRIC QUADRATURE RULES ON TRIANGLES AND TETRAHEDRA}}, * % author={Zhang.L. and Cui, T. and Liu,H.}, * % journal={Journal of computational Mathematics * % number={001}, * % pages={89--96}, * % issn={0254-9409}, * % year={2009} * % } * */ Global.New("qfVp1", CConstant *>(&QuadratureFormular_Tet_P1)); Global.New("qfVp2", CConstant *>(&QuadratureFormular_Tet_P2)); Global.New("qfVp3", CConstant *>(&QuadratureFormular_Tet_P3)); Global.New("qfVp4", CConstant *>(&QuadratureFormular_Tet_P4)); Global.New("qfVp5", CConstant *>(&QuadratureFormular_Tet_P5)); Global.New("qfVp6", CConstant *>(&QuadratureFormular_Tet_P6)); Global.New("qfVp7", CConstant *>(&QuadratureFormular_Tet_P7)); Global.New("qfVp8", CConstant *>(&QuadratureFormular_Tet_P8)); Global.New("qfVp9", CConstant *>(&QuadratureFormular_Tet_P9)); Global.New("qfVp10", CConstant *>(&QuadratureFormular_Tet_P10)); Global.New("qfVp11", CConstant *>(&QuadratureFormular_Tet_P11)); Global.New("qfVp12", CConstant *>(&QuadratureFormular_Tet_P12)); Global.New("qfVp13", CConstant *>(&QuadratureFormular_Tet_P13)); Global.New("qfVp14", CConstant *>(&QuadratureFormular_Tet_P14)); // Global.Add("tripleQF", "(", new OneOperator1s_ *, const GQuadratureFormular *>(tripleQF)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/Geometry.hpp000644 000767 000024 00000031226 13312446271 020774 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : DelaunayFlip // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Jean-Marie Mirebeau // E-MAIL : jean-marie.mirebeau@math.u-psud.fr #ifndef GEOMETRY #define GEOMETRY #include #include "RZ.h" #include "SortedList.h" using namespace std; /**************** Vertex ******************/ class Vertex: public R2 { // heritage is perhaps not totally justified here, but... sym2 m; int gen; // friend int main(int argc, const char * argv[]); //for Debug purposes public: Vertex (): R2(), m() {}; Vertex (R2 u, int Gen, sym2 metric = sym2()): R2(u), gen(Gen), m(metric) {} Vertex (R2 u, int Gen, const Metric2 &metric): R2(u), gen(Gen), m(metric(u)) {} const sym2&getm () const {return m;} int getGen () const {return gen;} sym3 homogeneousDistance () const {const R2 a(*this); const R2 ma = m * a; const double ama = a.scal(ma); return sym3(m.xx, m.yy, ama, m.xy, -ma.y, -ma.x);} double dist2 (const R2 &P) const {return m.norm2(*this - P);} }; /*inline ostream& operator<<(ostream &f, const Vertex &u){f<next;} bool cut (Vertex const *start, Vertex const *end, Edge *oldSister, Tab &EdgeAllocator, Tab &VertexAllocator, const Metric2 &metric, vector &aligned); // friend int main(int argc, const char * argv[]); //for Debug purposes #ifdef _FLAGGED_BOUNDARY_ int onBoundary_; #endif public: Edge (): u(NULL), v(NULL), next(NULL), sister(NULL) {}; #ifdef _FLAGGED_BOUNDARY_ Edge (Vertex const *U, Vertex const *V, Edge *S, Edge *N, int OnBoundary_ = 0): u(U), v(V), sister(S), next(N), onBoundary_(OnBoundary_) {}; int onBoundary () const {return onBoundary_;} // {if(sister!=NULL) return 0; if(onBoundary_>0) return onBoundary_; return 10;} #else Edge (Vertex const *U, Vertex const *V, Edge *S, Edge *N): u(U), v(V), next(N), sister(S) {}; bool onBoundary () const {return sister == NULL;} #endif inline bool flipable () const; inline double flipGain () const;// gain brought by a flip in terms of square cosine inline bool flip (); inline bool flip (Edge *affected[4]); inline bool flip_resolve (); Vertex const*getu () const {return u;} Vertex const*getv () const {return v;} R2 vec () const {return *v - *u;} // R2(v->x - u->x, v->y - u->y) // R2 midPoint(){return R2((v->x + u->x)/2, (v->y + u->y)/2);} // R2 bary() const {if(sister==NULL) return (*u+*v)/2; return (*u +*v +*next->v +*sister->next->v)/4;} bool isRepresentative () const {return (sister == NULL) || (u->x < v->x) || (u->x == v->x && u->y < v->y);} Edge*representative () {return isRepresentative() ? this : sister;} bool isRepresentative3 () const {R2 v = vec(); return v < next->vec() && v < prev()->vec();} bool isRepresentative3 (Vertex const *triangle[3]) const {triangle[0] = u; triangle[1] = v; triangle[2] = next->v; return isRepresentative3();} enum refinement_priority {selected_edge_first, newest_vertex_first, euclidean_longest_edge_first}; Edge*which_first (refinement_priority priority); // refine splits the edge and returns a pointer to the other half of the splitted edge //bool newestVertexFirst=true Edge*refine (Tab &EdgeAllocator, Tab &VertexAllocator, const Metric2 &metric, refinement_priority priority); // splits associated triangle if larger than size h/sqrt(smallEigenVal) (metric taken at the worst point on the triangle). Non recursive. bool hRefine3 (double h, Tab &EdgeAllocator, Tab &VertexAllocator, const Metric2 &metric, refinement_priority priority); // splits the edge if its length in the metric (taken at the worst point on the edge) is larger than h. Edge*hRefine2 (double h, Tab &EdgeAllocator, Tab &VertexAllocator, const Metric2 &metric, safe_vector *recursive = NULL, bool exaggerate = false); bool check () const; Edge*getNext () const {return next;} Edge*getSister () const {return sister;} bool cut (Vertex const *start, Vertex const *end, Tab &EdgeAllocator, Tab &VertexAllocator, const Metric2 &metric, vector &aligned); Vertex*intersect (Vertex const *start, Vertex const *end, Tab &VertexAllocator, const Metric2 &metric); }; inline ostream &operator << (ostream &f, const Edge &e) {f << R2(*(e.getu())) << " " << R2(*(e.getv())); return f;} inline ostream_math operator << (ostream_math f, const Edge &e) { if (f.format == Mathematica) {f << "{" << R2(*(e.getu())) << "," << R2(*(e.getv())) << "}";} else { f.os << e; } return f; } inline bool Edge::check () const { if (u == NULL || v == NULL) {cout << "Edge::check : Invalid extremities";} else if (u == v) {cout << "Edge::check : identical extremities";} else if (next == NULL || next->next == NULL) {cout << "Edge::check : Missing edge connections";} else if (next->next->next != this) {cout << "Edge::check : not a triangle";} else if (next->u != v) {cout << "Edge::check : invalid next edge (next->u!=v)";} else if (sister != NULL && sister->u != v) {cout << "Edge::check : invalid sister edge";} // else if(sister!=NULL && refinable && !sister->refinable) cout<<"Edge::check : flag refinable inconsistent with sister edge"<vec()) < 0) {cout << "Edge::check : trigonometric order not respected";} #ifdef _FLAGGED_BOUNDARY_ else if (sister == NULL && onBoundary_ == 0) {cout << "Edge::check : Interior edge without sister !" << endl;} #endif else {return true;} coutMath << " " << *this << *next << *next->next << endl; return false; } inline bool Edge::flipable () const { return !onBoundary() && det(sister->prev()->vec(), next->vec()) > 0 && det(prev()->vec(), sister->next->vec()) > 0; } inline double Edge::flipGain () const { // edge is assumed to be flipable, hence angles are flip increases minimum angle. if (!flipable()) {return 0;} Vertex const *s = next->v; Vertex const *t = sister->next->v; const R2 uv = *v - *u, st = *t - *s, vs = *s - *v, su = *u - *s, ut = *t - *u, tv = *v - *t; const sym2 &mu = u->getm(), &mv = v->getm(), ms = s->getm(), mt = t->getm(); return min(min(min(-ms.cos(st, vs), ms.cos(st, su)), min(mt.cos(st, ut), -mt.cos(st, tv))), min(-mu.cos(su, ut), -mv.cos(tv, vs))) - min(min(min(-mu.cos(uv, su), mu.cos(uv, ut)), min(mv.cos(uv, tv), -mv.cos(uv, vs))), min(-ms.cos(vs, su), -mt.cos(ut, tv))); // max(max(mu.cos2(uv,su), mu.cos2(uv,ut)), max(mv.cos2(uv,tv), mv.cos2(uv,vs))) - // max(max(ms.cos2(st,vs), ms.cos2(st,su)), max(mt.cos2(st,ut), mt.cos2(st,tv))); } inline bool Edge::flip () { if (sister == NULL) { return false; // triangle inversion is unchecked } Edge *e = this, *f = sister; Edge *ep = prev(), *fp = sister->prev(); Vertex const *u = ep->u; Vertex const *v = fp->u; e->u = u; e->v = v; f->u = v; f->v = u; e->next->next = e; f->next->next = f; ep->next = f->next; fp->next = e->next; e->next = fp; f->next = ep; return true; } inline bool Edge::flip (Edge *affected[4]) {// representatives of affected edges if (flip()) { affected[0] = next->representative(); affected[1] = prev()->representative(); affected[2] = sister->next->representative(); affected[3] = sister->prev()->representative(); return true; } return false; } inline bool Edge::flip_resolve () { if (flipGain() <= 0) {return false;} Edge *affected[4]; flip(affected); for (int i = 0; i < 4; i++) { affected[i]->flip_resolve(); } return true; } /****************************************************/ class Triangulation { Tab vertices; Tab edges; friend int main (int argc, const char *argv []);// for Debug purposes public: const Metric2 &metric; const Tab&getVertices () {return vertices;} const Tab&getEdges () {return edges;} int nv () const {return vertices.card();} int ne_oriented () const {return edges.card();} int nt () const {return ne_oriented() / 3;} Triangulation (int N, const Metric2 &Metric); // basic NxN square triangulation // Triangulation(const Tab &Vertices, const Tab &Edges, sym2 (*Metric)(const R2&)=NULL, double Lip=5): vertices(Vertices), edges(Edges), metric(Metric), lip(Lip) {if(!check()) cout << "Invalid triangulation !" << endl; movie_init();} //pointer mismatch #ifdef FF___HPP_ Triangulation (const Fem2D::Mesh &Th, const Metric2 &Metric); #endif void Delaunay_ordered (const vector &toExclude); void Delaunay_ordered () {vector toExclude; toExclude.resize(ne_oriented()); Delaunay_ordered(toExclude);} void Delaunay_unordered () {for (int i = 0; i < ne_oriented(); ++i) {edges[i].flip_resolve();}} int Connectivity (Tab &connectivity) const { int counter = 0; for (int i = 0; i < ne_oriented(); ++i) { if (edges[i].isRepresentative()) { connectivity[counter++] = Z2(vertices.index(edges[i].getu()), vertices.index(edges[i].getv())); } } return nt();// number of triangles } // Refines triangles isotropically, based on the small eigenvalue of the metric. void hRefine (double h = 1, Edge::refinement_priority priority = Edge::euclidean_longest_edge_first) { if (h <= 0) { return; } for (int i = 0; i < ne_oriented(); ++i) { if (edges[i].hRefine3(h, edges, vertices, metric, priority)) { movie_frame(); } } } void hRefineQA (double h = 1, unsigned int flag = 0, Edge::refinement_priority priority = Edge::euclidean_longest_edge_first); enum hRefineQA_opt {hRQA_finalRefine=1, hRQA_exportIntermediateData=2, hRQA_noIsoRef=4}; // Affects only the position, not the metric void moveMesh (R2 (*vec)(const R2 &), double amplification = 1) {for (int i = 0; i < nv(); i++) {vertices[i] += vec(vertices[i]) * amplification;}} bool check () const { bool passed = true; for (int i = 0; i < edges.card(); i++) {passed = passed && edges[i].check();} return passed; } void export_to_FreeFem (const char *filename) const; Fem2D::Mesh*export_to_Mesh () const; void export_to_Mathematica (const char *filename) const {ofstream data_out; data_out.open(filename); data_out << Mathematica << edges; data_out.close();} void export_to_Mathematica_Metric (const char *filename) const {ofstream data_out; data_out.open(filename); data_out << Mathematica << vertices; data_out.close();} void export_to (Format_Math format, const char *filename) const {if (format == Mathematica) {export_to_Mathematica(filename);} else {export_to_FreeFem(filename);}} // movie functionality string movie_name; Format_Math movie_format; mutable int movie_frame_number; void movie_frame () const { if (movie_name.size() == 0) { return; } export_to(movie_format, movie_frame_name().c_str()); } private: void movie_init () {movie_name = ""; movie_frame_number = 0; movie_format = Mathematica;} string movie_frame_name () const; }; #endif freefem++-3.61-1/examples++-load/shell.edp000644 000767 000024 00000000731 13256636774 020306 0ustar00hechtstaff000000 000000 load "shell" Directory c="."; while(1) { string n=readdir(c); if( n != "") cout << n << " " << isdir(n) << endl; else break; } cout << " login " << getenv("LOGIN") << endl; setenv("FF_TOTO","toto"); setenv("FF_TOTO","toto"); cout << " FF_TOTO " << getenv("FF_TOTO") << endl; string pwd=getenv("PWD"); verbosity=3; cout << " FILE: " <. */ /****************************************************************************/ // SUMMARY : Implementation of P1-P0 FVM-FEM // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // compile and link with ./load.link mat\_dervieux.cpp #include using namespace std; #include "cfloat" #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" // #include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "Mesh3dn.hpp" #include "MeshPoint.hpp" #include "lgfem.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" /* #include #include #include * using namespace std; #include "error.hpp" #include "AFunction.hpp" #include "rgraph.hpp" #include "RNM.hpp" * // remove problem of include #undef HAVE_LIBUMFPACK #undef HAVE_CADNA #include "MatriceCreuse_tpl.hpp" #include "MeshPoint.hpp" #include "lgfem.hpp" #include "lgmesh.hpp" #include "lgmesh3.hpp" #include "lgsolver.hpp" #include "problem.hpp" */ class MatrixUpWind0: public E_F0mps { public: typedef Matrice_Creuse *Result; Expression emat, expTh, expc, expu1, expu2; MatrixUpWind0 (const basicAC_F0 &args) { args.SetNameParam(); emat = args[0]; // the matrix expression expTh = to(args[1]); // a the expression to get the mesh expc = CastTo(args[2]); // the expression to get c (must be a double) // a array expression [ a, b] const E_Array *a = dynamic_cast((Expression)args[3]); if (a->size() != 2) {CompileError("syntax: MatrixUpWind0(Th,rhi,[u1,u2])");} int err = 0; expu1 = CastTo((*a)[0]);// fist exp of the array (must be a double) expu2 = CastTo((*a)[1]);// second exp of the array (must be a double) } ~MatrixUpWind0 () {} static ArrayOfaType typeargs () { return ArrayOfaType(atype *>(), atype(), atype(), atype()); } static E_F0*f (const basicAC_F0 &args) {return new MatrixUpWind0(args);} AnyType operator () (Stack s) const; }; int fvmP1P0 (double q[3][2], double u[2], double c[3], double a[3][3], double where[3]) { // computes matrix a on a triangle for the Dervieux FVM for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = 0; } } for (int i = 0; i < 3; i++) { int ip = (i + 1) % 3, ipp = (ip + 1) % 3; double unL = -((q[ip][1] + q[i][1] - 2 * q[ipp][1]) * u[0] - (q[ip][0] + q[i][0] - 2 * q[ipp][0]) * u[1]) / 6; if (unL > 0) {a[i][i] += unL; a[ip][i] -= unL;} else {a[i][ip] += unL; a[ip][ip] -= unL;} if (where[i] && where[ip]) {// this is a boundary edge unL = ((q[ip][1] - q[i][1]) * u[0] - (q[ip][0] - q[i][0]) * u[1]) / 2; if (unL > 0) {a[i][i] += unL; a[ip][ip] += unL;} } } return 1; } // the evaluation routine AnyType MatrixUpWind0::operator () (Stack stack) const { Matrice_Creuse *sparce_mat = GetAny *>((*emat)(stack)); MatriceMorse *amorse = 0; MeshPoint *mp(MeshPointStack(stack)), mps = *mp; const Mesh *pTh = GetAny((*expTh)(stack)); ffassert(pTh); const Mesh &Th(*pTh); { map, R> Aij; KN cc(Th.nv); double infini = DBL_MAX; cc = infini; for (int it = 0; it < Th.nt; it++) { for (int iv = 0; iv < 3; iv++) { int i = Th(it, iv); if (cc[i] == infini) { // if nuset the set mp->setP(&Th, it, iv); cc[i] = GetAny((*expc)(stack)); } } } for (int k = 0; k < Th.nt; k++) { const Triangle &K(Th[k]); const Vertex &A(K[0]), &B(K[1]), &C(K[2]); R2 Pt(1. / 3., 1. / 3.); R u[2]; MeshPointStack(stack)->set(Th, K(Pt), Pt, K, K.lab); u[0] = GetAny((*expu1)(stack)); u[1] = GetAny((*expu2)(stack)); int ii[3] = {Th(A), Th(B), Th(C)}; double q[3][2] = { {A.x, A.y}, {B.x, B.y}, {C.x, C.y}}; // coordinates of 3 vertices (input) double c[3] = {cc[ii[0]], cc[ii[1]], cc[ii[2]]}; double a[3][3], where[3] = {(double)A.lab, (double)B.lab, (double)C.lab}; if (fvmP1P0(q, u, c, a, where)) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (fabs(a[i][j]) >= 1e-30) { Aij[make_pair(ii[i], ii[j])] += a[i][j]; } } } } } amorse = new MatriceMorse(Th.nv, Th.nv, Aij, false); } sparce_mat->Uh = UniqueffId(); sparce_mat->Vh = UniqueffId(); sparce_mat->A.master(amorse); sparce_mat->typemat = (amorse->n == amorse->m) ? TypeSolveMat(TypeSolveMat::GMRES) : TypeSolveMat(TypeSolveMat::NONESQUARE);// none square matrice (morse) *mp = mps; if (verbosity > 3) {cout << " End Build MatrixUpWind : " << endl;} return sparce_mat; } /* class Init { public: * Init(); * }; * $1 */ static void Load_Init () { cout << " lood: init Mat Chacon " << endl; Global.Add("MatUpWind1", "(", new OneOperatorCode()); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/MetricPk.cpp000644 000767 000024 00000046411 13312446271 020714 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // compile and link with ff-c++ metric_Pk.cpp // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include #include #include using namespace std; #include "ff++.hpp" using namespace Fem2D; #include // typedef std::vector::iterator Rptr; // typedef std::vector::const_iterator const_Rptr; // template inline A * to_ptr(std::vector::iterator it){return &*it;} // template inline const A * to_ptr(std::vector::const_iterator it){return &*it;} #include "TensorK.hpp" // the main class class MetricPk: public E_F0mps { public: static basicAC_F0::name_and_type name_param []; static const int n_name_param = 10; Expression nargs[n_name_param]; // stocker les argunments nommes typedef KN_ Result; Expression expTh; Expression expu; MetricPk (const basicAC_F0 &args) { args.SetNameParam(n_name_param, name_param, nargs); // les arguments nommes expTh = to(args[0]); // a the expression to get the mesh expu = to(args[1]); // a the expression to get the mesh /* * exphmin= to(args[2]); // a the expression to get the mesh * exphmax= to(args[3]); // a the expression to get the mesh * experr= to(args[4]); // a the expression to get the mesh * // a array expression [ a, b] * const E_Array * ma= dynamic_cast((Expression) args[5]); * const E_Array * mp= dynamic_cast((Expression) args[6]); * if (ma->size() != 3) CompileError("syntax: MetricKuate(Th,np,o,err,[m11,m12,m22],[xx,yy])"); * if (mp->size() != 2) CompileError("syntax: MetricKuate(Th,np,o,err,[m11,m12,m22],[xx,yy])"); * int err =0; * m11= CastTo * >((*ma)[0]); // fist exp of the array (must be a double) * m12= CastTo * >((*ma)[1]); // second exp of the array (must be a double) * m22= CastTo * >((*ma)[2]); // second exp of the array (must be a double) * px= CastTo((*mp)[0]); // fist exp of the array (must be a double) * py= CastTo((*mp)[1]); // second exp of the array (must be a double) */ } double arg (int i, Stack stack, double a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} bool arg (int i, Stack stack, bool a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} KN*arg (int i, Stack stack, KN *a) const {return nargs[i] ? GetAny *>((*nargs[i])(stack)) : a;} ~MetricPk () {} static ArrayOfaType typeargs () { return ArrayOfaType( atype(), atype()); ; } static E_F0*f (const basicAC_F0 &args) {return new MetricPk(args);} AnyType operator () (Stack s) const;// la vraie fonction qui fait faire le boulot }; basicAC_F0::name_and_type MetricPk::name_param[MetricPk::n_name_param] = { {"kDeg", &typeid(long)}, {"rDeg", &typeid(long)}, {"iterJacobiDeriv", &typeid(long)}, {"iterJacobiMetric", &typeid(long)}, {"Derivatives", &typeid(KN *)}, {"rmax", &typeid(double)}, {"mass", &typeid(double)}, {"TriangulationType", &typeid(long)}, {"MetricType", &typeid(long)}, {"pExp", &typeid(double)} }; AnyType MetricPk::operator () (Stack stack) const { /************* r�cup�ration des arguments ****************/ const long k_deg = arg(0, stack, 2L); // Finite element of degree k_deg will be used for approximation. const long m_deg = k_deg + 1; // Derivatives of degree m_deg = k_deg+1 will be estimated. const long m_dim = m_deg + 1; // The description of these derivatives requires m_dim = m_deg+1 coefficients. const long nDOFt = ((k_deg + 1) * (k_deg + 2)) / 2; // Number of Lagrange points on each triangle. const long r_deg = arg(1, stack, 1L); // The function is approximated in the W^r,p Sobolev semi-norm. const double p_exp = arg(9, stack, 2.); const long iterJacobiDeriv = arg(2, stack, 3L); // The derivatives are slightly smoothed before use. const long iterJacobiMetric = arg(3, stack, 3L);// The riemannian metric is slightly smoothed before being returned. const double rmax = arg(5, stack, 1.); // Not used yet. (Lower bound for the metric) const double mass = arg(6, stack, 1000.); // Mass of the metric returned, i.e. mass = int sqrt(det M). // In practice, bamg produces a mesh with nt=2*mass elements. const TensorK::triangulation_type ttype = TensorK::triangulation_type(arg(7, stack, long(0))); // Type of triangulation on which approx will be done. const TensorK::which_matrix wmat = TensorK::which_matrix(arg(8, stack, long(1))); // Type of metric. Do not change. TensorK tk(m_deg, r_deg, ttype, wmat, p_exp); cout << "Approximation of " << r_deg << "th derivatives using finite elements of degree " << k_deg << ", in the L^" << p_exp << " norm.\n"; cout << "Triangulation type : " << ttype << "; Graded=0, Quasi_Acute(refined)=1, Quasi_Acute_Unrefined=2, Quasi_Acute_Proved(refined)=3" << endl; // cout << "Metric type : " << wmat << "M0_alone=0, M1_alone=1, M0_M1_weighted_sum=2" << endl; const Mesh *pTh = GetAny((*expTh)(stack)); ffassert(pTh); const Mesh &Th = *pTh; /************ initialisations ***************/ // the metric const int nv = Th.nv; KN *pMetric = new KN(nv * 3); KN &metric = *pMetric; metric = 0.; if (!tk.is_valid) { cout << "Error : Unsupported parameters for MetricPk!\n"; Add2StackOfPtr2Free(stack, pMetric); return SetAny >(metric); // identically zero metric is returned in case of error } // Lagrange points. const R2 QLagrange[5][15] = { {R2(1. / 3., 1. / 3.)}, // k_deg=0, barycenter. {R2(0, 0), R2(1, 0), R2(0, 1)}, {R2(0, 0), R2(1, 0), R2(0, 1), R2(0.5, 0.5), R2(0, 0.5), R2(0.5, 0)}, {R2(0, 0), R2(1, 0), R2(0, 1), R2(2. / 3., 1. / 3.), R2(1. / 3., 2. / 3.), R2(0, 2. / 3.), R2(0, 1. / 3.), R2(1. / 3., 0), R2(2. / 3., 0), R2(1 / 3., 1 / 3.)}, {R2(0, 0), R2(1, 0), R2(0, 1), R2(3. / 4., 1. / 4.), R2(1. / 2., 1. / 2.), R2(1. / 4., 3. / 4.), R2(0., 3. / 4.), R2(0., 1. / 2.), R2(0., 1. / 4.), R2(1. / 4., 0), R2(1. / 2., 0), R2(3. / 4., 0), R2(1. / 4., 1. / 2.), R2(1. / 2., 1. / 4.), R2(1. / 4., 1. / 4.)} }; std::vector aires; aires.resize(nv); // area of the "cell" surrounding a point std::vector Deriv; Deriv.resize(m_dim * nv); // estimate of the derivatives at a point std::vector DOFt; DOFt.resize(nDOFt); // degrees of freedom on a triangle // le bord // Th.ElementAdj(k,ie); renvoie k', �crase ie par ie'; // is frontiere k' <0 ou k'==k // Seg // BoundaryElement (+r�cent) // Th.nbe ou Th.neb // Th.be(i) Th.be(i)[0] ou Th.be(i)[1] std::vector nextv; nextv.resize(nv); fill(nextv.begin(), nextv.end(), -1); for (int i = 0; i < Th.nt; ++i) { for (int ie = 0; ie < 3; ++ie) { int iee = ie; const int j = Th.ElementAdj(i, iee); if (j == i || j < 0) { nextv[Th(i, (ie + 1) % 3)] = Th(i, (ie + 2) % 3); // nextv[Th(i,(ie+1)%3)]=Th(i,(ie+2)%3); } } } // cout << "next point on boundary\n"; for(int i=0; iset(Point.x, Point.y); DOFt[dof] = GetAny((*expu)(stack)); } double f[m_deg];// contains the derivatives of order switch (m_deg) { case 2: { // accolades n�cessaires pour d�clarer des variables dans un case double f[2]; tk.getDerivatives(DOFt, invHauteur, f); // f={fx,fy} for (int j = 0; j < 3; ++j) { const int s = Th(i, j); // le sommet j du triangle i Deriv[m_dim * s + 0] += aire * f[0] * invHauteur[j].x; // contribution � l'estimation des d�riv�es secondes. Deriv[m_dim * s + 1] += aire * (f[0] * invHauteur[j].y / 2. + f[1] * invHauteur[j].x / 2.); Deriv[m_dim * s + 2] += aire * f[1] * invHauteur[j].y; aires[s] += aire; } break; } case 3: { double f[3]; tk.getDerivatives(DOFt, invHauteur, f); // f={fxx,fxy,fyy} for (int j = 0; j < 3; ++j) { const int s = Th(i, j); Deriv[m_dim * s + 0] += aire * f[0] * invHauteur[j].x; // contribution � l'estimation des d�riv�es troisi�mes. Deriv[m_dim * s + 1] += aire * (f[0] * invHauteur[j].y / 3. + f[1] * invHauteur[j].x * 2. / 3.); Deriv[m_dim * s + 2] += aire * (f[2] * invHauteur[j].x / 3. + f[1] * invHauteur[j].y * 2. / 3.); Deriv[m_dim * s + 3] += aire * f[2] * invHauteur[j].y; aires[s] += aire; } break; } case 4: { double f[4]; tk.getDerivatives(DOFt, invHauteur, f); // f={fxxx,fxxy,fxyy,fyyy} for (int j = 0; j < 3; ++j) { const int s = Th(i, j); Deriv[m_dim * s + 0] += f[0] * invHauteur[j].x * aire; // contribution � l'estimation des d�riv�es quatri�mes. Deriv[m_dim * s + 1] += (f[0] * invHauteur[j].y / 4. + f[1] * invHauteur[j].x * 3. / 4.) * aire; Deriv[m_dim * s + 2] += (f[1] * invHauteur[j].y / 2. + f[2] * invHauteur[j].x / 2.) * aire; Deriv[m_dim * s + 3] += (f[2] * invHauteur[j].y * 3. / 4. + f[3] * invHauteur[j].x / 4.) * aire; Deriv[m_dim * s + 4] += f[3] * invHauteur[j].y * aire; aires[s] += aire; } break; } case 5: { double f[5]; tk.getDerivatives(DOFt, invHauteur, f); // f={fxxxx,fxxxy,fxxyy,fxyyy,fyyyy} for (int j = 0; j < 3; ++j) { const int s = Th(i, j); Deriv[m_dim * s + 0] += f[0] * invHauteur[j].x * aire; // contribution � l'estimation des d�riv�es quatri�mes. Deriv[m_dim * s + 1] += (f[0] * invHauteur[j].y / 5. + f[1] * invHauteur[j].x * 4. / 5.) * aire; Deriv[m_dim * s + 2] += (f[1] * invHauteur[j].y * 2. / 5. + f[2] * invHauteur[j].x * 3. / 5.) * aire; Deriv[m_dim * s + 3] += (f[2] * invHauteur[j].y * 3. / 5. + f[3] * invHauteur[j].x * 2. / 5.) * aire; Deriv[m_dim * s + 4] += (f[3] * invHauteur[j].y * 4. / 5. + f[4] * invHauteur[j].x / 5.) * aire; Deriv[m_dim * s + 5] += f[4] * invHauteur[j].y * aire; aires[s] += aire; } } // case m_deg==5 } // switch m_deg } // for i triangle for (int i = 0; i < nv; ++i) { for (int j = 0; j < m_dim; ++j) { Deriv[m_dim * i + j] *= 3 / aires[i]; } } // Estimating derivatives on the boundary by averaging neighboring estimates in the interior. // First the graph distance to the interior is estimated, using Dijkstra's algorithm. { multimap connectivity;// this is probably already computed by FreeFem. Where ? vector > dist; // (distance,number) set computed; for (int i = 0; i < Th.nt; ++i) { // Obtaining the connectivity const int u = Th(i, 0), v = Th(i, 1), w = Th(i, 2); if (nextv[u] == -1 && nextv[v] == -1 && nextv[w] == -1) { continue; // attention is restricted to the boundary. } connectivity.insert(pair(u, v)); connectivity.insert(pair(v, u)); connectivity.insert(pair(v, w)); connectivity.insert(pair(w, v)); connectivity.insert(pair(w, u)); connectivity.insert(pair(u, w)); if (nextv[u] == -1 && computed.insert(u).second == true) {dist.push_back(pair(u, 0));} if (nextv[v] == -1 && computed.insert(v).second == true) {dist.push_back(pair(v, 0));} if (nextv[w] == -1 && computed.insert(w).second == true) {dist.push_back(pair(w, 0));} } for (int i = 0; i < dist.size(); ++i) { // Dijkstra's algorithm. const int u = dist[i].first; const int du = dist[i].second; computed.insert(u); const pair::iterator, multimap::iterator> ret = connectivity.equal_range(u); for (multimap::iterator it = ret.first; it != ret.second; ++it) { const int v = it->second; if (computed.insert(v).second) {dist.push_back(pair(v, du + 1));} } } map dist_sorted; dist_sorted.insert(dist.begin(), dist.end()); for (int i = 0; i < dist.size(); ++i) { const int u = dist[i].first; const int du = dist[i].second; if (du == 0) {continue;} const pair::iterator, multimap::iterator> neighbors = connectivity.equal_range(u); int closer_neighbors = 0; for (multimap::iterator it = neighbors.first; it != neighbors.second; ++it) { const int v = it->second; const int dv = dist_sorted.find(v)->second; if (du != dv + 1) {continue;} closer_neighbors++; for (int k = 0; k < m_dim; ++k) { Deriv[m_dim * u + k] += Deriv[m_dim * v + k]; } } for (int k = 0; k < m_dim; ++k) { Deriv[m_dim * u + k] /= closer_neighbors; } } } // Averaging derivatives std::vector cardNeighbors; cardNeighbors.resize(nv); for (int i = 0; i < Th.nt; ++i) { for (int j = 0; j < 3; ++j) { cardNeighbors[Th(i, j)] += 3; } } { std::vector DerivNew; DerivNew.resize(m_dim * nv); for (int r = 0; r < iterJacobiDeriv; ++r) { fill(DerivNew.begin(), DerivNew.end(), 0); for (int i = 0; i < Th.nt; ++i) { const int u = Th(i, 0); const int v = Th(i, 1); const int w = Th(i, 2); for (int k = 0; k < m_dim; ++k) { const R sum = Deriv[m_dim * u + k] + Deriv[m_dim * v + k] + Deriv[m_dim * w + k]; DerivNew[m_dim * u + k] += sum; DerivNew[m_dim * v + k] += sum; DerivNew[m_dim * w + k] += sum; } // for k } // for i triangles for (int i = 0; i < nv; ++i) { for (int k = 0; k < m_dim; ++k) { Deriv[m_dim * i + k] = DerivNew[m_dim * i + k] / cardNeighbors[i]; } } } } // Exporting the derivatives, if required KN *pDerivRes = arg(4, stack, (KN *) 0); if (pDerivRes) { ffassert(pDerivRes->N() == m_dim * nv); KN &DerivRes = *pDerivRes; for (int i = 0; i < m_dim * nv; ++i) { DerivRes[i] = Deriv[i]; } } /**************** Computing the "L^infinity homogeneous" metric ************/ std::vector ih_metric; ih_metric.resize(3 * nv); for (int i = 0; i < nv; ++i) { tk.getM(&Deriv[m_dim * i], &ih_metric[3 * i]); } // Jacobi iterations // the power -1/2 of the metrics, which is homogenous to a distance, is averaged. // cout << "!!!!!!!!!! HELLO !!!!!!!!!!!\n"; // for(int i=0; i ih_metricNew; ih_metricNew.resize(3 * nv); for (int r = 0; r < iterJacobiMetric; ++r) { fill(ih_metricNew.begin(), ih_metricNew.end(), 0); for (int i = 0; i < Th.nt; ++i) { const int u = Th(i, 0); const int v = Th(i, 1); const int w = Th(i, 2); for (int k = 0; k < 3; ++k) { const R sum = ih_metric[3 * u + k] + ih_metric[3 * v + k] + ih_metric[3 * w + k]; ih_metricNew[3 * u + k] += sum; ih_metricNew[3 * v + k] += sum; ih_metricNew[3 * w + k] += sum; } // for k } // for i triangles for (int i = 0; i < nv; ++i) { for (int k = 0; k < 3; ++k) { ih_metric[3 * i + k] = ih_metricNew[3 * i + k] / cardNeighbors[i]; } } } for (int i = 0; i < nv; ++i) { TensorK::PowSym(&ih_metric[3 * i], -2); } } /**************** Multiplicator to obtain prescribed mass and to balance errors ****************/ // Note : future versions could include hmin and hmax parameters. { const long d_dim = 2; // Space Dimension : 2 // M : Metric for the L^p norm, M_0 metric for the L^infty norm const R alpha = -1. / ((m_deg - r_deg) * p_exp + d_dim);// M = (det M_0)^alpha M_0 const R beta = (m_deg - r_deg) * p_exp / (((m_deg - r_deg) * p_exp + d_dim) * 2.); // integrate sqrt(det M) = integrate (det M_0)^beta; beta = (alpha*d_dim+1)/2. // const R tau = 2./(m_deg-r_deg+1); for (int i = 0; i < nv; ++i) { aires[i] /= 3; } R totalArea = 0; for (int i = 0; i < nv; ++i) { totalArea += aires[i]; } // cout << "totalArea : " << totalArea << "\n"; R totalMass = 0; for (int i = 0; i < nv; ++i) { totalMass += aires[i] * pow(TensorK::det(&ih_metric[3 * i]), beta); // Eigen[i][0]*Eigen[i][1] } const R gamma = pow(mass / totalMass, 1. / (beta * d_dim)); // gamma satisfies integrate (det (gamma M_0) )^beta = mass for (int i = 0; i < nv; ++i) { const R lambda = gamma * pow(square(gamma) * TensorK::det(&ih_metric[3 * i]), alpha); // Eigen[i][0]*Eigen[i][1] for (int j = 0; j < 3; ++j) { metric[3 * i + j] = lambda * ih_metric[3 * i + j]; } } R obtainedMass = 0; for (int i = 0; i < nv; ++i) { obtainedMass += aires[i] * sqrt(TensorK::det(metric + 3 * i)); } cout << "Desired Mass : " << mass << "; obtained mass " << obtainedMass << endl; } Add2StackOfPtr2Free(stack, pMetric); return SetAny >(metric); /* //example by F.Hecht * for( int k=0;kset(Pi.x,Pi.y); * R uP= GetAny((*expu)(stack)); * cout << Pi << " " << uP << endl; * if(i<3) * { int s= Th(k,i); // le sommet i du triangle k. * metric[3*s+0] =uP; * metric[3*s+1] =uP+1; * metric[3*s+2] =uP+3; * } * * } * } */ } /* class Init { public: * Init(); * }; * Init init;*/ static void Load_Init () { cout << "\n -- lood: init MetricPk\n"; Global.Add("MetricPk", "(", new OneOperatorCode()); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/IpoptLap.edp000644 000767 000024 00000005564 13256636774 020740 0ustar00hechtstaff000000 000000 load "ff-Ipopt"; int NN=10; mesh Th = square(NN,NN); fespace Vh(Th,P1); func f=1; func g=0; varf Poiss(u,v) = int2d(Th)(0.5*dx(u)*dx(v) + 0.5*dy(u)*dy(v)) - int2d(Th)(v*f); varf dPoiss(u,v) = int2d(Th)(dx(u)*dx(v) + dy(u)*dy(v)) ; matrix A = Poiss(Vh,Vh); matrix dA = dPoiss(Vh,Vh); real[int] b = Poiss(0,Vh); varf Bord(u,v) = int1d(Th,1,2,3,4)(0.5*u*v) - int1d(Th,1,2,3,4)(v*g); varf dBord(u,v) = int1d(Th,1,2,3,4)(u*v); real intg2 = int1d(Th,1,2,3,4)(0.5*g*g); matrix M = dBord(Vh,Vh); real[int] bc= Bord(0,Vh); //cout << M << endl; //matrix M = Bord(Vh,Vh); int iter=0; func real J(real[int] &X) { Vh u; u[]=X; real[int] Au = A*X; Au += b; real res = X '* Au; plot(u,dim=3,fill=1,cmm="res = "+res+" - iter="+(iter++)); return res; } int nj=0; func real[int] dJ(real[int] &X) { real[int] Au = dA*X; //Au *= 2.; Au += b; return Au; } int nh=0; matrix MH; func matrix HJ(real[int] &X,real objfact,real[int] &lm) { int[int] ia(0),ja(0),ic(0),jc(0); real[int] ca(0),cc(0); [ia,ja,ca] = dA; [ic,jc,cc] = M; ca *= (objfact ? objfact : 0.0001); cc *= (lm[0] ? lm[0] : 0.0001); matrix odA = [ia,ja,ca]; matrix lmM = [ic,jc,cc]; MH = odA + lmM; return MH; } //func matrix HJ(real[int] &X) {return dA;} //out << dA << end; int nc=0; func real[int] C(real[int] &X) { real[int] res=M*X; res *= 0.5; res += bc; real result = X '* res; result += intg2; real[int] rrr = [result]; return rrr; } int ndc=0; matrix MdC; for(int i=0;i1.1-'#',29ACWrrlle|Zy|vdJ?GLEAGQPF:21,!!"*1?=DSormh`bl}v[K>TA=7MOCH;60)""'/92ETmypZ`n^u`^][G,7AHNIH=3-&%"!(/;8Plvzk`sbWxuqqi<)(5GHPKA?4*%$%#),Kexn^qm^azf8%)6EJLKJB:2,-01$ !/M[eecpslegsC059@@CJFBC=565:*$((36=PYondpqlhiuxti|`dpvk^JGIGBBDFDD<9;.-+9Io[\WSYRJKFVOjzfg\kY~zeMLFA@=A?B;2>.,"-9~u^ZLRM59;AJAL]{t}vdnbhUzRQJECBB?<8,:94# jW@>.)//76?>DRuo|zT^jO}dTLJC?DA>;+7>3wokjf`[]M<21" #&)6CCA]}ow\ssc`^R|jTLCBIHDB67=-"zwqofWQ8/-''*>@4>ktntQ`sdN\=r~mUMORNPQ?>8,+,*n\G9.,%&%%" .405RvuyfbdfZMHIy_Z_d\\I;;>9128sZNBB@:0&# ! ';2=MuzWab[\SC4q|xr_mrmUF79>J<67||`UVQDFJ=1++*"('1$LUYciXT?59{qktj[@;60P94, }i]]dYTA?60.+'-)'"PoQI\`LJB<,]zdb[;+95K8.gmkkOQIIJ69/0& GUPsSMJI764^iX3,8<02.qffYWFMQE?672$%*( &2MyiKEJ20-2\nXPWB=C5!$$izxXUeg`ME:6+-)'&%#!!!2NfUK>900.*b|ykkjL;=;11vcP>OYl\ZPXd?D<4*+(-))!$L\_D>4--/5hj]UCAJv]GA7K:$&)-!&f{|}~}ythxнOIQ^T8/*!&+%   );9?N>'1;=1&I;4D<-$,+* * .1p{{|~}||}{q}jDVaLcek`Q0++%$"".TLG\C,,OQ<(FNFG3--A.,$)5%F~}|x}zv|}{yuW@K]h}rZK;0)(&%!&  %`kPU=?/CwYwB\+4i@AP3:6, W[/+!+e[Kz}}~~|}~}|y}~zpat~jfg`hbXW\YB3HXD53*)+4ZGAJUrAA(E~8@>531&9/'#-UpYC~}}|~|}{{y~~|}x{}}sqbakgXjmnhdM\VHAAZC53.(%'!)%(7Onf=7X^10&P[02(/>6[7"#!)~~~~{~~|~}}{{z{y}|}um]Wgtblqt}zpdaONSe~PO@:1++)-..+(*$&/:AbyU?2>?8:;@:8:3,"!!  $),IBkeTH+A&5)(#0-&..38Ch}xmy~mP|{}~~||~~~~{{|w~w{oY\c]dz|yojЌrh`bKQCFING?::0/($&&&(*'"%!%#" !)BaUJZ88*!!% *&)&08958692,'3,')$)%&&&&"&"'('%&QKEBH')$ !&/20+9Ojzpey{z}~z}~}~z{vra[bhpx}py{bSVGd}ǥdep`YIGA@?94/1.---*,&'$#('$%(#"(FCK=<(!  !+.+06Oubf~z|~qtw|}zz~{rnh_kirw|owmWQVTRMhv˜n{aULJFE9A6625111.)*(((&++,+*&"%7;E;4.(  ! !&532-*Qwlh~zz|~}xlgfrzx~~~w}~~}ud]alzskm}s^XEEUTPWaml[fvз{aUFD@BG;=F,34422/--.-11-,/*0.-)''34H=0('   *6127=ch}{~xy}|}znbYVfstw||{~{z}vtg_bhmpsxgMDGOQLIT\]eg͹j^O@7JR5<237764223412620.1232*-&):/5]*)   $/5;=:aym}z~~x|x{lVPKNrdgu}zzz{zzn`_ad}nwoPUVSXPOdgjsv|}iJnm^WJE?93=;EK=>969?A:69868<85721,-1//-3381O/*($     +>@A,Vrwv~~x}}z||}~}}~}y~}`VLH:XY[g|~{vx{|yxZd`bwsjWY]^`Z^hnfi^nnkfUYazjKKLI:;>63mrcqwt}rwq{||}{}~~}~~~y~||~}zfRDDFDSM`uxmpvtnTL^znVCLcef`ok]`_eb_YvCI@ADIHGJGNWXSIDJEJ@DB<6655952/23;858;82-$/5?/%#    &;8<::2)$-6.$!8       6G4=GnkG8M]`QEbh[{p|}{}}|y}{|w|}w[@7AHJEJGEE@?;=:1-(% "(1      ,T;GXvdOSIC>URJK@=:<\itf}m~}{uy||z{~z~}~~{~~h=-%*(&",21LvsqˬvwwYZSQXTblvnx|ujbeX\QMOIF;>>>A=FLGFKFGC>;<73/+'% "#9       BH^R[uywgGBKDBMCFIF;6:j`h{mv~}x|{y}w~{}{~tD0)*&(26Lddg~l]aW\[`q}zjebYS]ZOIGEAEABCADCB><>9<:314.)*'' 0      '#+DM]Mgky~vbG4?COMdssywih|~~~}{yywwszx}d;.&%,(-5::/331110,./.'##   +/:LTV`elqonmaS@?DAEHA>9=;;>DKWjsu_ucj~}}z|xu{~|x~}gze>3*'0/09<[U~ʜ̞wrk]nu|~wukf`^WYV]ZMMMJEB376652231/3'&"       -(9DMFOZhnqmijTHEFDDFQA<8234;GOgjmad|nduuw}~ywuwxv{xw{~~veduiJ9,)0.7<@S`Ƥѿжddmmsz{oh_]XWZ[\PQTOLLF?=95715-$'     '15KXrƵлаÕaXSp{zph~tjd\VPTXPYWQQVS`TOONPKD>@?<6412-#      .:<;,+:JFCIKOAF:BCDMSM>81&#$.1+97ATudZtwy}}{{~|{|yyy{vsu~~w}tr^iy|{qaP5ekc~w{[A8612.4;G\yǮϮl^glpusnpuoliaUUTSZYY[WWTVSQRLNRJHEC>?:6-/.'!     #9><2*/<;<:BE7>>=@ELRNG;-$(,3279DVx`Wion~{{{|yvwts{xyx~y||vbXi}yursaHTs_wyx^M;8<535:Njɴȥ°hpmsqmntlhb\ZPUVW`Y]VWQVVUQPGGGFDKF@;5./,)$     8>>93)289309,97;>>ITVO@1**/07B<;:8-*-0-+155-66>JPMM=8567<;4512..) +:AYq~wy{vzsuxwuwwwqx}}}||zhZXL*-37,,+2I\\KQZ`|xyxwwxwyvxsw{y}~}xyrsjZD'=2((734;6,=@5+2Whg]YNIm⽮ʚ{idprjdfhx^WPTSOIP]gnmqk^\OIEFGHDBNE@9.,("!#!"$   ! 3411.*'*&!"$()-9,+'4>40+.,79A74277UdfPLE`yssyyxuvxstuvyx|x|{{~~~}txsl^F4;:2'*.:70,',A7!"8qa^ZW]||dfjofb`dfaWTSPONMX_vmsd]RPKDIHMOHO=<8/+%#!!!    .;840'""* '(/**",71.-/+17:82056JROGMTdzquylnqpyvxyzzx}}v~z|x|}}uvrbP299I0-59?1/-*530,2_]^_\i˲ڶˎnuqha]Y[edTOQQPMPUgtxthYT[SOQUWXOK8<2-)$# "  #1<;7+(!" &($!"11..+-,0,1,+656CDBRTgruktquuqusytzzzx{{~|yxp~y~vjbD28A126?HB93!*3@>iQV\dxᬧʫvsjc]RWXec[TONJNRbw|xhb^`[XSUYVNHA92.&%!    "%9;76+##"! $%*,/-)**,,''473>>=GMU\avpwwxuust}~wx{y|y{}rr\ID@;9;:A:<: !!)4CbMXSjʹֻqjhTTTWX\ZVPJIKPYgr{j`jcZ\TPSQJA?91-,* !! #  "!".410."(" """&'%"$(*$+1169;87GN@Sk{oxsxvy~~{~zxzzwunaWJ??@>?:24 !)*6/)*"# !   "$12520.&#" $'##$')$3179BG:DKCSfowwux~|y}zyzywrldYI=AD@:4)(! -1--8MWi˴͸ʾкÎvdbbZ\WX]\PHIMPU_dkuiega[ZYVOJFA550%& !"  #,676452.*-( %'+("#%(+/55:EE6<76410.0(..>J}ټ»ųee\Z[]VVZDFIQW_fouldaba^\WNJD@:..&!!!  $ # " (788331-+.,'+(%"$%*+11,0990):EParmtty}xz~y~yttustrvzfQGDAB:;5;7:*:44/-D}ؽ}kkfaa_XSTQIHNWcgp|pc[Zbh\YRGB=6.'%#!!$ $ %%$# #&16912,/,-/,$  !'%$(()+*++1--.5;DKVljttyz{}ztvlssrpx{_LJJIA;69;@C8B9>>?DĪĪzkjiba\XUUNJGNTgea}bZUU\bXRID:4.$%&$#$!   "&%$'%"$$'392/.&-+.0-"  !"#%$&'"(,&*+/47=<=R[txkx{zwwzwzwqrsn_JALEB45;;<@LNELOQNƸmfagV\XUXRGCIS^dvk[VRV^bZS?73+'&!!# #!!!   $%%"#'$!&!*6<2.,#&*,,'    "%',&,1897JSjmow}mwxx~{}{yz|tvrojUMNJD7,><=?>F@EJ^Zly~|xxzca]\Z]Z]YNEBFPZdjp]TV]^^UE;674-%'  !$"$"&#,*)&,,:>9-(&%!$&&! $&#!!'+39;;H]_njimquzr{|}rywyy{xzongMQCG=4&:E?77==?HPal¿{z}|yx}{~r_]\V[XXWVOGDEKRWbxq_WZ__TM<<99-//$(   "%$',.*&,6@=6,,*% "" $,#""'373=@CGbefijmpt~}{x{ysu}yyqj^>FGG<2/)574*3;EDI[p}ʺz~stukt~s][VVT\WVSME<7?CR^mqi][]b\MGC=:7.-*'"""!!!#$&'"..++8=91+*+* &('),0.AONR_glhjifjqz{~z|zy}{wvttnvinbKCIIA55116+.3:?97:AQay{~̯Ͽ֣wfa\WVVW`XRF913089Yz|hupfQGB61/**%)!!&% $" !"!  !,0/--)!$32771*&)  $ $6[^ZRF[bhhfghhuy~}}wwz{yutw^LFBE<876255-67[\bSY`flfdigiy}wjUD7:;9881-12(6V[scgbhdmkllex{y|zxyzpXB/276773,1/#+38mvK5::d{<:03:43/$$! )4<62*))&$'(&% #!  !$''!##&)'!#!%""&,5-+*&)+0<>93.-/./%#""')$   #GKha=VM;4860Odjmjeiekhjk9882AWkoy}|uw{~~|yyy{]=?B<2,*43336;=~~ajYyibowV4())"#"# ' %#"$&*5:4,)%+0.=SYTF<24,*$#! %$%'&$## $ "&&&(&43,-*-+2;EA464301$"'#% %!9NRiaATU?8353499;?Uuq{ڧuRF+& #"$   #$'.&%"*(.0151+*)%   !')*()&%#%"$# #*%#++0/.+(,!+25;83("-#%"&1DIUQqg7BO:8M[X`cefdchijjif.33.2%-10CKcosnmmszxxyqx||{zxzw~~rcJCGB7767;B:6XV`kA"$   "),FJ:3.,(((+*%!      %&'%%'%%!"!$%(&(&*.1-/'&/''1/26    &:0&=GIOMRG:=<96CJRSabjchihdije),+-%)),.2:@\d]Tcsr{nrbl{tnntxvv{{ukcOBNG=>;73788nwajşǪZ 17573.)**(,#'W)  "!"       %&&!&(((%'(***,//20*(*!%(0/**# ), ,03&#=@@@>1-683012::JUN]ag^X[cgh$(%%#"+(--/?PONJ]dg_TR]{aVLcjd[skigaVFEMNH>G8447Fu{}ywɕz# !:2!'042,)''() vF2(*+&0-+242'+## $%&&&$&$ ,),-!-.220)*&$+,&'1$*& #"-+!03.)#$)91/+- /7KLJSUYUQW]WQ$&" "#(+'*=EB=IRULKECaP8DYY\WMTPLQNDIKSH:>;85:_nrerǷ$!!    :#2>942( %(-$"w#   )-+.) #$"&$!"#%! -0+4#//4423(&!!*.+,-3-0'$*,$($&",)"" %$4,-31+/:MHJPPTGMJ?FC"!"")'"*C<@88BD>>9@2;DF=9IE>97=B?>FNE==;98>qWҢ3,!      3#17855)'!!059!)     %,84$ #"$#$#%%&3/3%/11632+&"*76.,+4753-,,$ $%#%!+0"--/&1;H=DDF5;HC>@E#!"!&$"'5@C>2:=B6:239??845<6+618]ʹiuF-1#    &3346+&+1#      &,&!$ %"$%!!(631**0373/0((&,9@<<>;88=:::@&("%'*"!%0;=@5.>IL5C1@DG<(.427>@>>>IGG;8<DJFE<63.-/159;1+,+*5>;=AADTXPGCJOJ>3:@JDDJKIOF9::??Ec)")|%+#" $*V_MK?+%      .6!&""#783/(0334/2/&*0=>:651.*)+(+'## ',)('(*&%$.332/3<>FPEA@AHE=>H>997:9==:@DMKSPBDE@B>81#      +6&$ #3.2,'00)0++,!(/8;;891-))-'%*&"" !&$!&&,46;AG?=GIB9?D=H>:86885;ILNG;AA;86647,0::99@GA25,^~{>;\wp+3+-)+*  $68354*7FHJC=>B;*'006./220,7@?/7Dhy <'/Wytxbs-410'(!(,('*)&"     =2!%! +$(,+/(5B=94461+**-1023+$!%%''57::?AVYc]QLF;6937><42128:B=<52A;101.)'#'00110*-+% ! %'-0)'*/.,4=E\ihaUIAA:AD<;4/05=CA>732A>=<;0/...137.1=BFD?869>HJPW;x2*Oh~m&  *"*'9151+$#&!      $=" ', F-&0+'#367=BB=8,,+"$*&-,-01-15.%! "&02052*,*'/<5kzvq\M<@GVPGB>7=?FKDF;.11893>B2+&235;=:>;=@:=<=3;BEHI~|?4ovט2 %)0TgncM<1'""       %>C7:$8>3)0,!!%.6;BND<5-+*&'&&')(--19<10,-'#$)(+0558;;47,,&!3GT|`7>DMXMZCLOMLKMIF;-)4711:7&-9<=C89:8552==;8313;DtxU$7Ҡyo;* %%&'0unZH=1$"    &-**4/!!E<1*-*# '**8@?C942.'$()+)&%'(0469:772*)':.(2258867:7236)-Ik|538:AJKNNWNI<9LB:**330,0574;9=D;973/2178622-+-9fWOEE㖫ɹW=&  #'(1?StĜwZK;/&!"      "(&*/(2.&$(.5::?60-*'!!'+*'%&*15&    &(#5IªoZF:4(#       ,&#  /*.)* #**).00+')*$&"$(!$)&&-3>A>6:>?.,010463535412/1/79@JMV[XZZP+*(%).,12-,12120/.*2/+""(,;7./-*1-'$$%*#)--*&-35seKTPɡrcF0   !,$7Qɲv[@6($"      ")"!%# )*/2+( '$*('.**')*'.)+#$&%(*1;<75BF;0(+1/720303,-,* /536/2)&4=Zĭ{gM=,(#       ,&&)0 '++)*0('$ "&)+(#')( "',/7;7($$"!$('.151.461.6B7/(-./%!" *2229<;BI>A>" $&')+"" %#'!%'&%'%""0=72*&(' )-"%)(.?=JG>m6)w`MŸrikmpwxlejb[XS^k¥zjZF/&#!"!        "$-'1)%$'()-&#-21#$$ %+"(60('(# ##!(99-21-/,*/102(! !+,-00*$*.7C81?6(IfI5'5+)./*0470005.)(# #&(.*&!!##   #"#&!%"5/&'/.,*(�&$$#!#+&"11'"&'" !"#,/&((%*-.051.$'+,:;5.-21O^YajjLiyxia=1+,4/(*$66369866''122/5:CNWYdSV`Wtb[ŤǰvhTa[VUNHC;=4414i~wph]XOE5'#$%&     )"%*$!'+)+-*/*,'$$(,%!##!# &$#&,.*$#)*$$'*/153/($)2HSR[Z\X[[]bRiū˵zo_WVQJF?<640-.7R|qd_UPB6,%!#&)(%     %#'*#'.4,/'*#&$ +/% &,#$"!!*'(#!#$$(*'1551/+(!!##"",8ERaVH>525evy{njmfZ<1,3I@3,012448:BLVPUJVRLEEIJNRFHAap]Pt£{rcYQIF>9722.*).=nh[SK?2+"'))%##   !  '+&# +/#)&%"%!))#$$"!"$"&' "&&!$)"!%'(+33742,(!"# &(&(4:CGTZTG<79GKajrnf\QHB@20&32+&%)+2,)17EKGGLGFGE?AKKH<8/gZMż~qcWQG>:554,+)%"0Und\SH<0( "$')*'$(   $&&,- '')%'#$"&).&$"&$%!"&(,+&%)$/1(##!&()1-//-%'&&%% &,/7@KLGZWKCD@FQWcbbWPIE?B4;,-+&%+,62,):H7>CKLECBCDJPJIBjWQ–qiXPE>9/752*($'(?r]VND8.$$#%((*'" &++%##&*%$"#"')- &&&)'( *-.*2.!+*%&+*% !$'+*+*"'"(&!%#$*4:JMYDKI9DDFBOZ^WeW5>><522//. )-=/,5=<,1=FKFHHGLNLNNT$o[O¯qdZPFA;5463/*""(&cm[SKA1) !#%#)*'%#!!'*,) "&# "$",/*)'&#..-.13218,'" +*!&(%#!&#%$ !")4??JF7>:BIC:CLSNOJ?2:8=2+,+&#'.2+,*6<3%*2EJILNIUUMOZTeVj{~tgaPHB85220*'#$!$;~}b\OB>0$! "#$%(*+'%*$ ""  "  )-*( !%" *022-*,01/126<880*'#*+%+$# !!' $-69MITTQDC?:=90%$%"&()*--35.6DDQR_Q_aZ]^SѠqzĝug\XKB>415-*$"!#%(SƵg[RMA60$$ !!#'+-*)14*))%#%" !! ,..* !#%$! (2899-)&,262155:72-*$-.&(%"!!$5846.'((:8631043+-'*+**)'%) "1666SVbPECA>?668:63'*))((*#$"/94(--!)6CHOPQHXc(tl]RI?<878,&!"#*Mqwzk]NKD=750./.)'% #++,.2=E<JJC>2)'#)($&$%321++/+,0Pc]XKAIwn!vn[QG=>;5,(# "$#(/-.- &(BV^TMKE??==;9686321.,(!""$(/203343/(+&" "&$&%"$$%"&($"&"*,*$&7(+*))"""#3-054:1-"&'+(*!  &(1/.!1-"! 2/069D>B=5-%!#" 3853*'+-1JcVVLJOzuu0!scYLC>>92'  $'&-4bp9(+( &?MIEF@?=?=;7712402.'""%/-01200/-'((('(''(''$%&&($%) "&,.(J=),))') "(/'-0(122)$ ((-3$"%&#+*.$),.+$ $!*0,437:<871,&$( "!$!*08640'0(*:ILNRMZp|vn_QH>>;6/ " #$#./zh9+&%>BCA@ABA94* ! (*)##.01210.//,-(+*))'**+*&*'''&$$ )++$G:"&'')(!!(+*'(')-.,(4' ,36?2-,%"&&%,/' '# 3*)0./1-/APEG1('$ " +2+0-(#.( -7AEKEXr~0ŻthVJD>:8-!!""%'*+oîwC-$+<;@<>>8-$'+1321200.0./,,*-(+,-,*),)'%&'**'H7"!!$"()/)!''(/.-482/3:7?243+)&)''#$1*-+(+,,,qte{ #$435-&%*$$.46F8Ejvp={peWJC?72(!$&&+),lϫp;&,246:3#+31643323.-.'./0*/-/+,,,+))%(***).+"%'$9=+"('&)+/236:9AC>6==:BN1FF>/+)5//+.1+71,& #!"1-% $-'$%  8AjLFTsfnkejqtvpntpsrorjkvzeOXWjgcbcfancd]Mdeehpfd`1xjXGF<51.$"'+.101J`bljWsmphck`][KC1# #&*1/'" %/558766652022100253-1++,--)()" !# .>=2+00137*&" #-%#!#%0$$(*"'   5?KJB8]ljhinmqmqrsvqrrrnmkbQ;E@SUX_bde\^x{[M?exoYNCA76-,,).23/5;@cihif\Z[XSWT]RK?1*()53FzsaNFA:110.+-230989^hgacYUSQLNOXPJB504937BAE;0*%' %##""!" "%##!$$!!!%+05:44:8545677102..1,++,,,.*(/-% !%(.& "651/$##!#*/%$!" !$+79,.1133/,% %#! 8DcY@BiytrXQPUXVMNbxv|zz{qE@?:;===5HR`gkYYs\\\\odlMB:62v`MB:6120-102//004CNMIGKE@E=;=DDBB9179749=;4/.+*,))*'$##$%$&'&((%$!$#.38877843479752301.,,,+/.+)* -. '##%$'%! -22-,%#&)+"!##%/:3!&,/2855(%"$ ! :W[B68T|tWNSTWXQYdx|{}}xfED@6;>;:9.1*%'#&, !"%.2. '7371-%! !)!4ZwS22SxZSPSXWRQ[z}z>IF>9<;==NBWgf]YpZ^KGbRL=82 )*zqaVJC=:411-+)'.0-$-'('$$'%&&"$&(,3633723321532590310./,*/+.1,-++###%.0863745754664202/.1.,,,+(,$ ((,-(",)%"),832/(#%%!!%*&$!"%.35/('#('$7\h=*e\PRVTRUY\zvrOJE9<<>;?P=QZhfaoS\CAcXO><1"'lriUQKRK:72.)).227AHVnaY>N;67)$"%"%$%)#$%'#&+*)+//1441314-+,,.1-'%!"&-455558997645122/210--*,*$  &.9( **("%-4/(662.'#'+,,! $%&!"'-/76(%-.)%!#&%'>dlG0rcSQMFNRU[wnk\CFEF>=?B?dAC74* -R{klW[[YNA800&).34RšqF9,%!! !$&(+02/4230/+-./++$$$$(/3455744452321-00.-./*,,# ',+$.)*(09<% 8@8.+)!-203)'$*'$+39943-+.$"#%*1338tw[/sjPSG2HEX[qf@ACALKHBIHBPSY\g[QRET8DeK=2-+/ )4scVbeXPB9.-),44H{p`aB+'"!"'**/100/.+)++*%"%&+,226545462312/21/-/-./-,$ #'-"&&1.*"#*065-! 5@E40.)&++,,*$%+*?=:(+*2-''++286A|mGTqsWIDS_hnw]K@KLLPNMSFXYc^gYOTGGA9b`{W06-& (wpfhg_PF93*)(2Gĩuhc_\S<%"##)*((-+*'(%&%&,00//1276753230+121-..,/-+%*3!(1.,) #(,4+.-"/4>@80+*+)/'#$-=;1+-/.0-+'$/12Ak{u\Jh|~}oocMIMW`ZuuvYPPTUXPXWXVVZ^_\Z]U6DGE[bv26<4,{rmjiaTD91+,-BvnxleZV<* !$&&&'&%$&,302123723442//1-..)/0.+,( 10 !*20--+'&+-),=6%)4;>:5.-))*&&!#2511,,/0)(* $%'DJPXY[VOZ^`UOLNMKMNMKLS[[`]XZ]Z[bd]Y^dWWYRU]OPY\_botH?E@$ ^szqk`RA6/-/;f~^SRT]ZLMH@/(!!! !!&&&((-1,313553../1/0//-..-/-.,++('-001/1%&/2))/3(*.1>A82*%!& $'$/05*+03+##%!!SUY`dd_NR`^_TSVZWXVW^Y`abdaa_`^`ac`b^e^QX\]sjca_alkMC7;5 =yvyul[UD811/Az~yhW?:8=B=;<74/*&%$"#"#!"$ !!# !  $#"++,22131333401.00/2-.1---,02 -'+0.-27) -4-**0+)5HI?=:4'(!% "(/*+24-(%$__elmnkbcindeebgf_W[]fbjkhf_^_bb\gabhjkU^_Vlljfa\^WdQH;6?$y{tiaTD6001JyvthkaR@5+'./1.,,).%/(''&&$+&'!!#% "! !$%)+.1121/11321200//0.0/1./.,,<',/-+33.*.014,2)1;IHB899-))%$#%%#((*/6,-)" mbrrrqtomssjggja]ZSHUV`eeXa`Y`be]fgicfdbecdhoqga]XTWVF@:=A tz{upaQD;0.8ftk`YOLNC*/'%*'(),)(**&'*)*+,*%& %%$""# !%&+)',-/00,/322210121/000.-03,&"$(-220*/---1//29BA;6153' %$+!#&'&$"$!#'()-2!noprsvwvwunihd[_`^]SUTSXZ``WZf`b`^_``\_Ycgeckhb[XSNKFJDBIkK{{xueZHH;GSy{td\UMIF=5-*'%&$#'%&'(+'&*(++-+'))-)' "$$#%++1023344/0010/01221001-0.   -36/+)+,+81,069<;3183*%('#!!&(,%! "#%))&#//2-$tjonqtprttlkigfdc__``Z\]U_]VW[\b]ZUX[X\]bcab_V]_`^dTQOXRVe=&||vl]UTXcq|sqc[UM?>90+&%%$&#%%*)(')/*/-*)+.'&''%"  $&(*(//.34315-0.212/22/2156/1* "&-%)/-(,482+*,43:=<:0&)%#"&$"+!$"##("'.8/&&qrmnty{zwzuvoiiha]ZM[eihcW[^Z]WY^WVY\Y]_ib]_]_]gga`eb`gdc_] y~}wnd`cgi|ssf`YM<>7/+'%'(&&&$'%$(()-+/*+-*+**)(&$$"" &(++*21-33112/0/.01033036404-   !$ %*0--+0;94)"'-,1/77,++"&%#$ !"#$#""/2,(%msty|~{~}|xnlaXXUNUgnsmngd_dcab\Y^hmlrc`[Y_hpiffhkmnrpgh"Q}xwoupnnwwnf[NEC6/+)('% #" "##&*'),,+,)**(&*)%#$" #&)')+-213644321010/2436/24754/ +&"!'-+ (,43/+&,1/22510--0(%!""!!$#!+/'' ||{~{|xxxrifb_[XSLObmtwqzyxuvwywv{{u{gcY[slpkonssntvtrJ #{{~vswvvvod\MI@=0)-,$&$$"#&()()%+-.,**)(&($% !#" &).(.013646560230//3160234513) +**($#)/%/%($-1/-01251/*-.1,-(&##"$"#~}||z}xwofjdhjifafepwv{x{}wzwwvpaPUGDSbbnqrwswyy~vw u~~~wy}|qdXTMJ@;3/)*' %!"$!&(()+*,()%*'%(%$!"$$%,(.00121033.201321532144210"  +*,1)$)+.2.*))261376.--***('""*&%%(!{rpwtlwxs^mxyxqlnghlzvphig]TOJF6=Ncmswuw}w{~?z|~khRWHDB..&(!&$&#%$(''+()**&$%%#$!%$!$-./122.011.//1021052/42531. '50/,%(&'+.('&-:1521)'/.*)(!"#%'&#"%}~~yzzdQGlytq]b_YZ\u{{|xwhsrqhkc^djvxt{{zv|yIö~udhZI3)-!&#&!$'&(*'))('&$#$ !&),+///25/0311///.23433054285+ !,301)'#!$&:7:2-'),*+&# $!#}xzoMNIUcbUDDPN@CXbx{|}}}xvxzvuw}|x}~qww mԽٸ|r_ZREA1)&$#"# "'$*(*'%"'&&##" ())-000220/201,00212445444232) '130*"!"!"./1/-/2+ )',((#,0/,#$!&$!w{z~zpqssIKJLJ?<855?FLM1dz}}|v{yzvy|w{}q{AоȯudbTUJ@;/($ $'%%$&(&#"%&#'&%%'((+//140.03/20//444812641344#"&160/(%&$!,40)*)-/,-)'##'//1, %&%! !nsvu~}{tux{{rkdWX`}lTCLMB@10/3GPZN[|~z~xvrqusx{}y}~xD}Ѣtqf`RNF=52,)"&#$#"#('%&&%&$$$%(%%+*//00/./00101456555121521! "*2;51,'$"$&$&87--+/421+'(73-(!#$&(#"" zuy|~uu`_ia]_]RBN\gsYUV\I?/33DJKUl~yx~kpkikpusvrqzsomκmlWROGD:40-)%! "!!%#$%"###%)'!,(-,,2-1..00/33563426405755+ $.163+.&%%(%) -.63210@%(*"$.+-*((#&+!"" |}|}zcONHSSDHOPNRWREPHQWTRIMPGGCO\}~}}~yz}|~uni]XP`[eeXYMWY`! Cs±ɩ|fSOELCA9BBEIHGNEB<=@>AJDEEH@ITt}ywnnfidYVYT=LJHNQ\[QyrhdTHJIA:80*('& !""!&'#&#'#**+).--.-./046037021/436451% '*)$"(!&&.43)&! +45."#&%&&#&&".26=/()-/,+ !|x|jZPJ@:89==>?@A<=C@DLC?@;DJHIBB>ADYvq}}}zqmqklwokgjfbaZVWR[b83y{{o_cRRGA=>82))*%&!  ! """$#')&$(*),,--/.////2014224412/13223- $)!""$&$'2.)%"+78./.%&''(-/% '..-(").-',#!#||aJG;;88864;=<742=AFJFBECJLNMJI@23CUU]beldXT]GIOWY]ghv|utxwuZxz|wpmmVZRGB9;<8-',("'"!!"!""#"&%&%&+)*),--0/0/100242121600/04231$"  !#)('*52+/+%(&*).0%!&###&+ " %'zsxdRE92.172.74>@9>KOMEA1/68ACWPENZb^KHFALEMSTcw|zv}2 R~x|~~smhbVPFHA?9:?6+"+'!%$%"$###$$$'+'*,,+,/2-//1320535142501//3333,#  "!# #!"'$# ,<4/,')((!*,*% " )&$!ZYubFC1/*/21)8@DEDEHAA=HGCDB846<7@HJMQXXUOPKJKIGMRTH`aY^]f^"rv|}}vrjb^\SNFHB@;994,(%&''%%$!""$#"&%(**+**-,-26.20003523221300-00211." ### ! !# %(/!&*99.112140% %#!)")H38A@>8ABD@?IIPKMRUWVZXPOPPPJQJJKNQK5z}xj{y{~}z~||ywnheXYXPJA@>:774/-*(*)$"$'&'$'''&(*+,+-/../300.0./02230420/.,,.22-)   %%# +)+01.//2500," *#&$&#"!1 $!:9<9=>759;;;>>?;CCA80124;::73367::@ERRLLSZZVUQX[[\`YPQNLQMHBGQM?FGxwuotu|z}}txqoi^[VSRHF>>957645..,.,,***')(&+()*+/..-01136063/024455611,.+-..10)$ #/")%"&&+++(.5/*)+ $0*!',0)&)-7("%$;:598?9.8978:AD@>@@53-35@B>?51/~yvzxuxyz}}}vmnpje__OVHI@>;48834330...-,+--,-&*()-/21/.035574164535856212..,,,00,"! "!!$!#%&))6:3.)# ! +%.-(+24-"'1/(%" 11149;8467237=@9:?95+.28=L>?AC:BOKNX_\][VE>=;?RTNML?BIM]kM8;T]pZLv{ukpx~}~zwpkihi\QULLKD<=996456464241120.0./,,+2//16107848724567776432---,0++2-( ) %"#*/688:5,&#""$!+/2255,'/-..0)%$" 3398>8;8876,-<@>;:744+=?LHB<>GGJQQTYXXIbUE941.8C>GE;5MV_gd;9M]ikXg||vssuqgz|wkgc[aVPOPJJIDCB?8=>6:9987644241232/113445878::7967574573010.+-(.++)-#"*(' " %)269;5>0+&(#!#%+023-'*-$(-%$$#<>;9789:;47534.,,,,)(*($(29 ""$#$&+368=B=40*)$%(!*.)&&.&!#$ # HKNIHF2,00/08<@A=BD?<6D?81851;GF:KCKL]IKI>:@>LTKPPbTia]NMHJZLHA>AA>@95:69<:98420-,+,+)'+%!:: ('+'!"($'15==>:83)/+)(&&),/(%+,*%%#RRU[RKC9./-2:A?9CHAA=<<@:9<=4?DD2ECIOPAI@<=<<>@?@><:=??CCEB?;0>>=>;:56/-**(*)$(%",L'>80.)$!3 ',./49B;63:660*',+02--+&))##VUb``_IFE8;<;A@58<5>dS>=AG7==H@G>CHMD?FFB85CKOHOTSM@B86KH46I<'CNR4.f{vttswsnlnlpyyxwidb^[ZUR[^ZY\WQTULG?GIBB?AEEEDBB@?BGCFBF<FJ99F:GQcLAHP6:AB5862-,+)+''($# "% ),%,31'*-2(((37=@553422)&()%"&$#"  \`g`^c\SFL@KEHKKGMRQSFOQYdZ:EGN]SILEA@@=77>CFFAB906;30,))2[EAETbhEAoz}|yttmkje[[ffohfnfdhe^^]_^ba]]^\`YYUQLMQPSQNPMIJIJGHCB@A@=8834,,++(*)$&#  "64**44/*$++$)%'889/20--&'&..*$,)) QXWPJJTREE;DEDPJFNRTPFERS^aJLUaa\KA>65:=9=BDF;;<9/,+*"('(>VD7ACOGf8o~zxvvrolb]SSW_jj`d^cacbc`_]`a`b``b_]VQQTTPQSJKHJHLFCE@@=<<;7.*/,*#(*'!! #d.+26:9> /0!(14-()'&#*2+-7-" '  BIEGD?GCBDNLHGMKOJ@AFNSUTS^WU?MJ7:>HBDEFDD=<80+*((&!.??9/7>8>EAe}{wsroolaZ[^]`]e[^_hbbed`_abdgfbefa\\VWTLNHGHHJHHDAF?C?=:641/,*)(()% "bV4$3640)#" $#"%')##'*+,49%!" DORF=7H;EAEC=CKGHDDFGJFCBGOPTMJPEIRX==<;;DGBCB>;71,-,,Ġ/0582172N|}spsnhc\]Z\[T]^_\]a`abfbeecbc^^Z[YYQRSOOJKIKIFGDFGCC<<72.0*'**(%% " cb[D*-25-#$)"#%"'' %+'/65 )KYVVD639?7CLK@A;67;=@C:655+/-.&!%22351.256;:7}}|tosnic]a_^a]_X[_a^cg`YbbeX_Z]YWVVVQPLPFMFJEJ?CDDIE<=87*,- ++#" !!`_dYZ>791##$(&#!$ +& $)*'(& !!)0+  .!QPLF>7-:;92?>=288C8>?<;11/2//0301-'("&9@0;RSV;;4*.+%/*~ooojghgidhmfebccdcfgcehefia\^ZWQSTPQQKLMIFCDCBEB>9600.00/))*(# &$!  EW\YZYX[Q #!"-2.&+'&"%%#(%,-*-2G!$'/3,00'*..0# 67:82+)8;4;0120/-.248;8168:::78;:0./,)).3/004.*)AB.,;L>8DAE;2-$'$",5spmjd^ifiijggedcegjkmioigfgb[][UZURQROMOJFBC>BC>;411//0/.*(+%$!!'!  KVXXZZ[VaT,# #!#)--++(*"#!$+*,*!!!*((,'%*/31!,)0.))0783..,.+*++-479842669<44322+0,%',--,+./,1EA12@I?>=<=4)*(#!"(%ǿxrlikfijdfiehfa`lkkdlkljkhcacgc`[UVTMMOKGHGCDFC>752.,/0/'&%(#$#!!"  KW\RVVYW^__@(! %!&!$(/0,)&%#"!'()$ !(**&" */1-! *(&-$))1/1-))'#$(+()588=<;H>4-(-*()+&$%**,/+$/5>@:14@A99:;561-*+1./!tsgjghdgehidjfkilrmnljjggf[hef]e^ZVTOKLGMHJF>@@924/--,,-+'#'#$%$    RWV]TWXTb^W[UA+!"# 4&*-"*(,!"&-%$(,,%$% %'.-,%(/*&++'&&!'-03/.<6732/20-.06; ,ĺ}qnoehfcdhgimmnlropqmlljdaca``_aYYVRQNNNGG?9;:+10//00(()! !&!    0V\[^dfbde^ZXXYXZM-#&#%"$$+%$"*. ( %!' " ""&&"!%%#%!!$)+)(%%,-02--:,*0(+6:/!'+-11*-19><549<:55520-//+/3?;0s¹|qvgecihjfkjnppxuiknmlgihdd`cZ]WVUXTOKIBD>9544413/00-,+&$%$  @SXR\a_^fraa[WXYYUVO2!(&&&"1"! !&!',)"" (&%(!" $"#)-/.2/,6OA:6DX80500-10#&'/259.-49:35=@9594471344207=3n̺wihgjggikfhmnijeolgijefddb]\\Z]VTSNKGA;=::73220,/*---)*) "  !WS\\b^ZaabUY\ZYZZYY[YE-0/( " ! $*&! "%0-'$!##$# $'.1113>D0?KNY8633-+32,),3269530==;63DA7=89F8<:6.93:_Ǻ}phcgfijhhfkminplmlhigidea]]aYTSQKEFEA;<9;62622.,(--**"! !  AU[^^^^_c`^][\X[YZ^\_]]]N61!$#%&,.''$'%!!"#+-50179?<@RONA:66,154'*032?;4)5?@/697>CL?KOT[k~yhc[difgkihgimkpjihedc`\^\\ZUSSOJEAA??9::6320./+-,,$'  #%"   +La_^Y]__]Z]]]\]YZ\\Z][\[]aK7$% &*%'((" $,3, #$''.4734:EETOcK=@;922694:80;@IqֲvnlbadjjghhjjkiipfegfdYb^[ZWYSPIJHC=B:<8:725541-.+-&$ !$"!!) EZ]^\b]`\YZX[YZXZ[]^\Ya`^^^`dL' !#&!4858CF;/#!,='$(3466649I\\QSKB@C>A::;97Z糬ypnibagbhgilhikhhebda`a`\XUORPMLDFC?B>>:;:87333.-*)"# !!! <% NTXY_\^c_XYWYY[Z[\Z\]\]_^^^__d[F   LMNFKHJGE?A;Q4#-6=27;5AF^STRQVXDI?LVs|lkd]V`dhefigkbkeddbc]\ZVQQMMNNIGDC?@@><7;;84651+)%#! ! ##"$!(A? JPW`a]\\VNWRVVX[]_Z[][_bb^___`aVfA"  !$NPSQTILEOXQTNPD83>28:?>:553/'% #!$$$ #"%DL IQXYa[VWXSZXXXZ\[aW]\\`bab`aab_bd]Y> 2,! %NOPTSPGHNQVWQdUOZE<+<3KXZF^Ugpwvqhfdcadeecdmfde^db`YXSRUOLLKHHEFEC>AA?><<<=83-+&'$'%%% %'"0CODHSW_a\UYWV[[\_`^`\]a^ad^`_ceddafbjah_7"((*%TIMRSRSNNPSY[^TIQMI>CDRWZ[O[êtpfeb^ccbiggebb`_^XWPQOONNKHIIICCBD?B?A=820''&('(()'!%$:IXZ< %FO\]ZZ[WZZ\W\``^b`a_`cbdbcdbdedcffecejV+"$# BEDLRNSPOST_aeSSTaZNXX_\agwάzrea`_c^]ifee^_X\XVQSSRPNKIIKH?EDAC@AACF>=420,($')())'('!;LZUZ 5Jc]\ZZ^Z\\b___b`c``bbeeheffggbgfjigfecegG  )BCCKVLMIOYXYac^ZW]bbbfidбxoja\`addeca`baXXYYSTQPPLJNIGEDDCBJCDBCA981.+*(+(*(*(''($"BXY^]S CK_kY[SU׻lcbbcefjfbb``^XYVVWXTTQORMPTSNMJHID<@;774211/0--(#+0)!$"!B`egjec^Y\ CIQZ\db^dcbcfeffgjhpmloonknopoomnoolmikillflmlglZ&%=.%'(-0=:567>?:CBDCMVladhʳujdecdbk\ebb]_^^VZXWWUUVRQSPRMMHCC@A?A8553405/1.+)/-#"""-W_hjmihecXU  :EMY\aeefhffjjhliloiopllprkpkommsrpqqqqrnmmsqlpmjnkH%1.%,:576><=913<<68-7==:;2?@:;BMb]ouлqlcigigphoclhhgee`\[YRPLLJIFDDIFD?B=;=;57203914030"&''!*SfjqktuqojjcX =GT[cdekgkokpnkoplpqqoqrssttststtvxuvsuuyyvntoqprsoqniP5,&"%"",IQWbLDFMNQF@G:;@FH>EH@8:\[VoŪ}ylhggohjnmomoghab_^`SVQOMLIEHKCEEECA@7>:658857756.&!'*))C]qswwxyyukjj_3 AMU]efkpdljkpruuusrwnsvuutwvu}{zwxxwuuy{~|wyxyvrvususooiW= ''.-29FJ<;CD?<9:9:966:533+ (.*4Rpr~y{y}~zupldN 0 .I`\echmostrqqqsvrvwsvvrvzzxw{{{xzuz|{x}||zyyyvvqsyqoqL2/5@452=DH=Fe~QORI77ACIKP8NOWQOUqkҽ{oheca_^_a__ba\XXXSUSPOSPEGFHJFDAD@A>:8:6869<874/+)-%@byu|}zxyqhU8 '=< HW\lloqmqstwtswts{y||z{zxyz{y{}}y}|~~}}||{vwpprptYG?3;.9EVZZZ\[UNF<-=@>HF:WVSUNTi˹vkb[]\\_]\^Z\[\[ZUQ]NONPNMGHIIGEKAA=;56:96:=:883),./5Pnz{pel_? @K?" 4Yjloqqsqtyw|xuy}y|z{x{{|~}}|~~~~z|zzyxvurpsdGGbeZhfeiOTF<721<>JJ=BW][Zbe^Ϻxh`VWWUVWV]\T][\VVSTLLMMIMHIJIGGB>>><=;5<<<;984+/0.5f~|tc8`mF 7='(Vfnnswvxxy|{|z}zz}}~~~~|~zyvsqtrcZeqqfZJF72'&A=DH<999:40/;j}syy<,5DC0_tljqq|{~~{zzwuuvvmlF<1&/(4.04DCGTZ˾hfbYVTTOURSPOKMHKOMKKOLOPNPSNMJIHEFA?<9:84.2;P|~yoxK2(CU?^~{~y{wyxwtqXF51#EC/08=FR˺zqnok^UUTPRSPRPNLSHHJJJLQMPNPNOMJKGHEB?<6:8866Gn~~|yZ)28QKf|}||yzzwurm@=6!U]U88]h`~rkl``gVSRRQPTSQIKHKGFJKMNRPPQSSULHGC@>>;;9:54_|}}^6CP^F`}~ys{xwvnxJ*(VebSFq_½m_]b_SWSQUQRPMMLMJMJHNMWVTTUUPQQLIDA><9=<53O}~oKc@d@Y|}~{{{{yusuxF-#Xa__fw`ɺ|rkeb\QRRSKNNKMLLJKKRQNRRWTSQUQJIGCA>?>?9HdpXBAd9d|z|xxwuxN-ZQZ\\[ʼ{rorn^YXUQQNOROKNKKW[`RUXXVRQTRLLHDA@A=5`gJB9WEk֮z}zwzxx{;OHTTTW̾{qhdcX]_YYSUUXOW[frkZYRZYTSSHMJDG=:Kf?>@dT`ᵝ|~{|yyxuzJJQ\jDztgb]i`[a^]d]`cewƫn_`\WRUWIII@Mm\I:OY:_ͩ~{{y{xvvvJTUOiƷvkdnf`ijimnvμ_\^XQQPTKj`GEDmU_簘}|zzzzyuRR_mkиvhc]gdefmlxȳzkbab^`ø^GBMhTWΦ}~~{}|xzywNUKhӵti_`a\pvw½uur^kmE;@obO~{yyyK[jfŹqgd_itͪvcԻwHBA{P@k⮔~~~|}zvVHUmƿŽpfomnu|د~\A)GYRdOJlج~~{x~x~Wc]gͼyrisowмշi<(0BSVt\T|Û|~z|vzz|Sn`ֽœtkiv̰ҳ`G>DG}dW^齙}{x~}ao[ƸyvtHZEbx]\԰}|||ytiuǺux̰gW;X{fKƦ~~zypggū|JBOtw\Ƿ~~{dcǼìGNObm]q˺~~z}bhd\_P_tnǭ}[ae²ѻpTKhٻ~|\Zn辶bd͌ONco缭䵌ב֫ӿĔњ¿٘˧viZѧ{pyyˡƆѸͥ޷ҹ԰Ԑʯ֞ۈЭ˳iʻΫy߳ӭ׺vƦƝgےںĄܛ~n밖h|䶐op̈́꬜{{}o򬒟军ն|n󸣷XpoúѽqµõҺz윔Ʋ|ڶ¼ҩӃɺǹְ֠ļ¼ڣiБlʹͿȻ`᭭oUÿνƽء~nɿ¿cjp˿ǹ慪οȾ»«ȸfreefem++-3.61-1/examples++-load/MUMPS.cpp000644 000767 000024 00000022243 13312446271 020074 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // E-MAIL : frederic.hecht@sorbonne-universite.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: mumps_seq blas libseq fc pthread //ff-c++-cpp-dep: // *INDENT-ON* // // F. Hecht december 2011 // ---------------------------- // file to add MUMPS sequentiel interface for sparce linear solver with dynamic load. #include using namespace std; #include "ff++.hpp" #include "mumps_seq/mpi.h" #include "dmumps_c.h" #include "zmumps_c.h" const int JOB_INIT = -1; const int JOB_END = -2; const int JOB_ANA_FAC = 4; const int JOB_SOLVE = 3; const int USE_COMM_WORLD = -987654; template struct MUMPS_STRUC_TRAIT {typedef void MUMPS; typedef void R;}; template<> struct MUMPS_STRUC_TRAIT {typedef DMUMPS_STRUC_C MUMPS; typedef double R;}; template<> struct MUMPS_STRUC_TRAIT {typedef ZMUMPS_STRUC_C MUMPS; typedef ZMUMPS_COMPLEX R;}; void mumps_c (DMUMPS_STRUC_C *id) {dmumps_c(id);} void mumps_c (ZMUMPS_STRUC_C *id) {zmumps_c(id);} template class SolveMUMPS_seq: public MatriceMorse::VirtualSolver { public: // typedef double R; double eps; mutable double epsr; double tgv; typedef typename MUMPS_STRUC_TRAIT::R MR; mutable typename MUMPS_STRUC_TRAIT::MUMPS id; KN *rinfog; KN *infog; int&ICNTL (int i) const {return id.icntl[i - 1];} double&CNTL (int i) const {return id.cntl[i - 1];} int&INFO (int i) const {return id.info[i - 1];} double&RINFO (int i) const {return id.rinfo[i - 1];} int&INFOG (int i) const {return id.infog[i - 1];} double&RINFOG (int i) const {return id.rinfog[i - 1];} void SetVerb (int i = verbosity) const { if (verbosity < 5) { ICNTL(1) = 6; ICNTL(3) = 0; ICNTL(4) = 0; } else { ICNTL(1) = 6; ICNTL(2) = 0; ICNTL(3) = 6; ICNTL(4) = 0; if (verbosity < 10) {ICNTL(4) = 1;} else if (verbosity < 15) {ICNTL(4) = 1;} else if (verbosity < 20) {ICNTL(4) = 2;} else if (verbosity < 25) {ICNTL(4) = 3;} else {ICNTL(4) = 4;} } // cout << ICNTL(1) << " " << ICNTL(2) << " "<< ICNTL(3) << " "<< ICNTL(4) << endl; } void Check (const char *msg = "mumps_seq") const { if (INFO(1) != 0) { cout << " Erreur Mumps number " << INFO(1) << endl; cout << " Fatal Erreur " << msg << endl; Clean(); id.job = JOB_END; mumps_c(&id); /* Terminate instance */ /*int ierr = */MPI_Finalize(); ErrorExec(msg, INFO(1)); } } SolveMUMPS_seq (const MatriceMorse &A, int strategy, double ttgv, double epsilon = 1e-6, double pivot = -1., double pivot_sym = -1., KN *rinfogg = 0, KN *infogg = 0): eps(epsilon), epsr(0), tgv(ttgv), rinfog(rinfogg), infog(infogg) { int myid = 0; // int ierr = 0; int argc = 0; char **argv = 0; ; /*ierr = */MPI_Init(&argc, &argv); /*ierr = */MPI_Comm_rank(MPI_COMM_WORLD, &myid); id.job = JOB_INIT; id.par = 1; id.sym = A.sym(); id.comm_fortran = USE_COMM_WORLD; mumps_c(&id); SetVerb(); ICNTL(5) = 0; // input matrix type ICNTL(7) = 7; // NUMBERING ... ICNTL(9) = 1; // 1: A x = b, !1 : tA x = b ICNTL(18) = 0; id.nrhs = 0;// int n = A.n; int nz = A.nbcoef; ffassert(A.n == A.m); int *irn = new int[nz]; int *jcn = new int[nz]; R *a = new R[nz]; for (int i = 0; i < n; ++i) { for (int k = A.lg[i]; k < A.lg[i + 1]; ++k) { irn[k] = i + 1; jcn[k] = A.cl[k] + 1; a[k] = A.a[k]; } } id.n = n; id.nz = nz; id.irn = irn; id.jcn = jcn; id.a = (MR *)(void *)a; id.rhs = 0; id.job = JOB_ANA_FAC; // performs the analysis. and performs the factorization. mumps_c(&id); Check("MUMPS_seq analayse and Factorize"); if (verbosity > 3) { cout << " -- MUMPS LU n= " << n << ", peak Mem: " << INFOG(22) << " Mb" << " sym: " << id.sym << endl; } if (rinfog) { // copy rinfog if (rinfog->N() < 40) {rinfog->resize(40);} for (int i = 0; i < 40; ++i) { (*rinfog)[i] = RINFOG(i + 1); } } if (infog) { // copy ginfo if (infog->N() < 40) {infog->resize(40);} for (int i = 0; i < 40; ++i) { (*infog)[i] = INFOG(i + 1); } } } void Solver (const MatriceMorse &A, KN_ &x, const KN_ &b) const { ffassert(&x[0] != &b[0]); epsr = (eps < 0) ? (epsr > 0 ? -epsr : -eps) : eps; ffassert(A.ChecknbLine(id.n) && id.n == x.N() && A.ChecknbColumn(id.n)); // convert array in long ... if (verbosity > 2) { cout << " -- MUMPS solve, peak Mem : " << INFOG(22) << " Mb, n = " << id.n << " sym =" << id.sym << endl; } id.nrhs = 1; x = b; id.rhs = (MR *)(void *)(R *)x; SetVerb(); id.job = JOB_SOLVE; // performs the analysis. and performs the factorization. mumps_c(&id); Check("MUMPS_seq Solve"); if (verbosity > 3) { cout << " b min max " << b.min() << " " << b.max() << endl; } if (verbosity > 1) {cout << " x min max " << x.min() << " " << x.max() << endl;} // add to get info from MUMPS in freefem++ nov 2015 FH. if (rinfog) { // copy rinfog if (rinfog->N() < 40) {rinfog->resize(40);} for (int i = 0; i < 40; ++i) { (*rinfog)[i] = RINFOG(i + 1); } } if (infog) { // copy ginfo if (infog->N() < 40) {infog->resize(40);} for (int i = 0; i < 40; ++i) { (*infog)[i] = INFOG(i + 1); } } } void Clean () const { if (verbosity > 10) { cout << "~SolveMUMPS_seq:" << this << endl; } delete [] id.irn; delete [] id.jcn; delete [] id.a; SetVerb(); } ~SolveMUMPS_seq () { Clean(); id.job = JOB_END; mumps_c(&id); /* Terminate instance */ /*int ierr = */MPI_Finalize(); } void addMatMul (const KN_ &x, KN_ &Ax) const { ffassert(x.N() == Ax.N()); Ax += (const MatriceMorse &)(*this) * x; } }; inline MatriceMorse::VirtualSolver * BuildSolverIMUMPSseq (DCL_ARG_SPARSE_SOLVER(double, A)) { if (verbosity > 3) { cout << " BuildSolverMUMPSseq" << endl; } return new SolveMUMPS_seq(*A, ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.rinfo, ds.info); } inline MatriceMorse::VirtualSolver * BuildSolverIMUMPSseq (DCL_ARG_SPARSE_SOLVER(Complex, A)) { if (verbosity > 3) { cout << " BuildSolverMUMPSseq" << endl; } return new SolveMUMPS_seq(*A, ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.rinfo, ds.info); } // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_R; ; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue = TypeSolveMat::defaultvalue; bool SetMUMPS_seq () { if (verbosity > 1) { cout << " SetDefault sparse solver to MUMPSseq" << endl; } DefSparseSolver::solver = BuildSolverIMUMPSseq; DefSparseSolver::solver = BuildSolverIMUMPSseq; DefSparseSolverSym::solver = BuildSolverIMUMPSseq; DefSparseSolverSym::solver = BuildSolverIMUMPSseq; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return true; } static void init22 () { SparseMatSolver_R = DefSparseSolver::solver; SparseMatSolver_C = DefSparseSolver::solver; SparseMatSolverSym_R = DefSparseSolverSym::solver; SparseMatSolverSym_C = DefSparseSolverSym::solver; if (verbosity > 1) { cout << "\n Add: MUMPS_seq: defaultsolver defaultsolverMUMPS_seq" << endl; } TypeSolveMat::defaultvalue = TypeSolveMat::SparseSolver; DefSparseSolver::solver = BuildSolverIMUMPSseq; DefSparseSolver::solver = BuildSolverIMUMPSseq; if (!Global.Find("defaulttoMUMPSseq").NotNull()) { Global.Add("defaulttoMUMPSseq", "(", new OneOperator0(SetMUMPS_seq)); } } LOADFUNC(init22); freefem++-3.61-1/examples++-load/Element_P1bl.cpp000644 000767 000024 00000013751 13312446271 021446 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "PkLagrange.hpp" #include "ff++.hpp" #include "AddNewFE.h" // using namespace std; namespace Fem2D { class TypeOfFE_P1Bubble2: public TypeOfFE { public: static int Data []; static double Pi_h_coef []; TypeOfFE_P1Bubble2 (): TypeOfFE(1, 0, 1, 1, Data, 1, 1, 4, 4, Pi_h_coef) { const R2 Pt [] = {R2(0, 0), R2(1, 0), R2(0, 1), R2(1. / 3., 1. / 3.)}; for (int i = 0; i < NbDoF; i++) { pij_alpha[i] = IPJ(i, i, 0); P_Pi_h[i] = Pt[i]; } } // void FB(const Mesh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; void FB (const bool *whatd, const Mesh &Th, const Triangle &K, const R2 &P, RNMK_ &val) const; // void D2_FB(const Me∂Seriaƒƒƒƒƒsh & Th,const Triangle & K,const R2 &P, RNMK_ & val) const; // void Pi_h(const baseFElement & K,RN_ & val, InterpolFunction f, R* v,int, void *) const; // virtual R operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const ; }; int TypeOfFE_P1Bubble2::Data [] = {0, 1, 2, 6, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 4}; double TypeOfFE_P1Bubble2::Pi_h_coef [] = {1., 1., 1., 1.}; void TypeOfFE_P1Bubble2::FB (const bool *whatd, const Mesh &, const Triangle &K, const R2 &P, RNMK_ &val) const { // const Triangle & K(FE.T); R2 A(K[0]), B(K[1]), C(K[2]); R l [] = {1 - P.x - P.y, P.x, P.y}; // lb=l0*l1*l2*9.; int i0 = 0; if (l[1] < l[i0]) {i0 = 1;} if (l[2] < l[i0]) {i0 = 2;} int i1 = (i0 + 1) % 3, i2 = (i0 + 2) % 3; R2 G[3] = {K.H(0), K.H(1), K.H(2)}; double l0[3] = {l[i0] * 3, l[i1] - l[i0], l[i2] - l[i0]}; R2 G0[3] = {G[i0] * 3, G[i1] - G[i0], G[i2] - G[i0]}; if (val.N() < 4) { throwassert(val.N() >= 4); } throwassert(val.M() == 1); // throwassert(val.K()==3 ); val = 0; RN_ f0(val('.', 0, op_id)); if (whatd[op_id]) { f0[3] = l0[0]; f0[i1] = l0[1]; f0[i2] = l0[2]; } if (whatd[op_dx] || whatd[op_dy] || whatd[op_dxx] || whatd[op_dyy] || whatd[op_dxy]) { if (whatd[op_dx]) { RN_ f0x(val('.', 0, op_dx)); f0x[3] = G0[0].x; f0x[i1] = G0[1].x; f0x[i2] = G0[2].x; } if (whatd[op_dy]) { RN_ f0y(val('.', 0, op_dy)); f0y[3] = G0[0].y; f0y[i1] = G0[1].y; f0y[i2] = G0[2].y; } } } // Version 3D class TypeOfFE_P1blLagrange3d: public TypeOfFE_Lagrange { public: typedef Mesh3 Mesh; typedef GFElement FElement; TypeOfFE_P1blLagrange3d (): TypeOfFE_Lagrange(-1) {} void FB (const What_d whatd, const Mesh &Th, const Mesh3::Element &K, const Rd &P, RNMK_ &val) const; }; void TypeOfFE_P1blLagrange3d::FB (const What_d whatd, const Mesh &, const Element &K, const R3 &P, RNMK_ &val) const { R l [] = {1. - P.sum(), P.x, P.y, P.z}; const R d1 = d + 1.; const R d13 = d1 * d1 * d1; const R d14 = d13 * d1; int i0 = 0; if (l[1] < l[i0]) {i0 = 1;} if (l[2] < l[i0]) {i0 = 2;} int i1 = (i0 + 1) % 4, i2 = (i0 + 2) % 4, i3 = (i0 + 3) % 4; double l0[4] = {l[i0] * 4, l[i1] - l[i0], l[i2] - l[i0], l[i3] - l[i0]}; assert(val.N() >= Element::nv); assert(val.M() == 1); val = 0; RN_ f0(val('.', 0, op_id)); if (whatd & Fop_D0) { f0[4] = l0[0]; f0[i1] = l0[1]; f0[i2] = l0[2]; f0[i3] = l0[3]; } if (whatd & Fop_D1) { R3 G[4]; K.Gradlambda(G); R3 G0[4] = {G[i0] * 4, G[i1] - G[i0], G[i2] - G[i0], G[i3] - G[i0]}; if (whatd & Fop_dx) { RN_ f0x(val('.', 0, op_dx)); f0x[4] = G0[0].x; f0x[i1] = G0[1].x; f0x[i2] = G0[2].x; f0x[i3] = G0[3].x; } if (whatd & Fop_dy) { RN_ f0y(val('.', 0, op_dy)); f0y[4] = G0[0].y; f0y[i1] = G0[1].y; f0y[i2] = G0[2].y; f0y[i3] = G0[3].y; } if (whatd & Fop_dz) { RN_ f0z(val('.', 0, op_dz)); f0z[4] = G0[0].z; f0z[i1] = G0[1].z; f0z[i2] = G0[2].z; f0z[i3] = G0[3].z; } } } static TypeOfFE_P1blLagrange3d P1blLagrange3d; // GTypeOfFE &GP1blLagrange3d(P1blLagrange3d); // static AddNewFE3 TypeOfFE_Edge1_3d("P1bl3d", &GP1blLagrange3d); // // link with FreeFem++ static TypeOfFE_P1Bubble2 P1Bulle2; // a static variable to add the finite element to freefem++ static AddNewFE stP1Bulle2("P1bl", &P1Bulle2); } // FEM2d namespace /* * double expert( double x) { * cout << " expert " << x << endl; * return 42.; * } * * double expert( double *x) { * x=42; * cout << " expert " << *x << endl; * return 42.; * } * void static init(){ * // warning with choose of priority * Global.Add("expert","(",new OneOperator1(expert,1)); * Global.Add("expert","(",new OneOperator1(expert,2)); * } * * LOADFUNC(init); */ freefem++-3.61-1/examples++-load/tetgenholeregion_rugby.edp000644 000767 000024 00000005262 13256636774 023755 0ustar00hechtstaff000000 000000 // file tetgenholeregion_rugby.edp load "msh3" load "tetgen" load "medit" verbosity=2; // Test 1 // data of rugby ball real Ra=2.; real Rb=2.; real Rc=1.; mesh Th=square(10,20,[x*pi-pi/2,2*y*pi]); // $]\frac{-pi}{2},\frac{-pi}{2}[\times]0,2\pi[ $ // a parametrization of a ellipsoid func f1 = Ra*cos(x)*cos(y); func f2 = Rb*cos(x)*sin(y); func f3 = Rc*sin(x); // partiel derivative of the parametrization DF func f1x=Ra*sin(x)*cos(y); func f1y=-Ra*cos(x)*sin(y); func f2x=-Rb*sin(x)*sin(y); func f2y=Rb*cos(x)*cos(y); func f3x=Rc*cos(x); func f3y=0; // $ M = DF^t DF $ func m11=f1x^2+f2x^2+f3x^2; func m21=f1x*f1y+f2x*f2y+f3x*f3y; func m22=f1y^2+f2y^2+f3y^2; func perio=[[4,y],[2,y],[1,x],[3,x]]; real hh=0.1; real vv= 1/square(hh); verbosity=2; Th=adaptmesh(Th,m11*vv,m21*vv,m22*vv,IsMetric=1,periodic=perio); Th=adaptmesh(Th,m11*vv,m21*vv,m22*vv,IsMetric=1,periodic=perio); plot(Th,wait=1); verbosity=2; // construction of the surface of prolate ellipsoide real Rmin = 1.; func f1min = Rmin*f1; func f2min = Rmin*f2; func f3min = Rmin*f3; cout << "=====================" << endl; cout << "=====================" << endl; mesh3 Th3sph=movemesh23(Th,transfo=[f1min,f2min,f3min],orientation=1); cout << "=====================" << endl; cout << "=====================" << endl; real Rmax = 2.; func f1max = Rmax*f1; func f2max = Rmax*f2; func f3max = Rmax*f3; cout << "=====================" << endl; cout << "=====================" << endl; mesh3 Th3sph2=movemesh23(Th,transfo=[f1max,f2max,f3max],orientation=-1); cout << "=====================" << endl; cout << "=====================" << endl; cout << "addition" << endl; mesh3 Th3=Th3sph+Th3sph2; savemesh(Th3sph,"ellipsoide.mesh"); real[int] domain2 = [1.5*Ra,0.,0.,145,0.001,0.,0.,0.,18,0.001]; cout << "==============================" << endl; cout << " tetgen call without hole " << endl; cout << "==============================" << endl; mesh3 Th3fin=tetg(Th3,switch="paAAYYCCV",nbofregions=2,regionlist=domain2); cout << "=============================" << endl; cout << "finish: tetgen call without hole" << endl; cout << "=============================" << endl; savemesh(Th3fin,"spherewithtworegion.mesh"); medit("maillagetwo",Th3fin); real[int] hole = [0.,0.,0.]; real[int] domain = [1.5*Ra,0.,0.,53,0.001]; cout << "=============================" << endl; cout << " tetgen call with hole " << endl; cout << "=============================" << endl; mesh3 Th3finhole=tetg(Th3,switch="paAAYCCV",nbofholes=1,holelist=hole,nbofregions=1,regionlist=domain); cout << "=============================" << endl; cout << "finish: tetgen call with hole " << endl; cout << "=============================" << endl; savemesh(Th3finhole,"spherewithahole.mesh"); freefem++-3.61-1/examples++-load/APk-MetricPk.edp000644 000767 000024 00000002035 13256636774 021365 0ustar00hechtstaff000000 000000 load "MetricPk" mesh Th=square(3,3,[x,y]); fespace Metric(Th,[P1,P1,P1]); Metric [m11,m12,m22]; //fespace Deriv(Th,[P1,P1,P1]); //Deriv [D1,D2,D3]; //m11[]=MetricPk(Th,(x^2+100*y^2)/2,kDeg=1,rDeg=1,Derivatives=D1[]); fespace Deriv(Th,[P1,P1,P1,P1]); Deriv [D1,D2,D3,D4]; //m11[]=MetricPk(Th,(x^3+2*3*x^2*y+3*3*x*y^2+4*y^3)/6,kDeg=2,rDeg=1,Derivatives=D1[]); m11[]=MetricPk(Th,(x^3/100+y^3)/6,kDeg=2,rDeg=1,Derivatives=D1[]); //fespace Deriv(Th,[P1,P1,P1,P1,P1]); //Deriv [D1,D2,D3,D4,D5]; //m11[]=MetricPk(Th,(x^4+2*4*x^3*y+3*6*x^2*y^2+4*4*x*y^3+5*y^4)/24,kDeg=3,rDeg=1,Derivatives=D1[]); //m11[]=MetricPk(Th,(x^3+2*3*x^2*y+3*3*x*y^2+4*y^3)/6,kDeg=3,rDeg=1,Derivatives=D1[]); //fespace Deriv(Th,[P1,P1,P1,P1,P1,P1]); //Deriv [D1,D2,D3,D4,D5,D6]; //m11[]=MetricPk(Th,(x^5+2*5*x^4*y+3*10*x^3*y^2+4*10*x^2*y^3+5*5*x*y^4+6*y^5)/120,kDeg=4,rDeg=1,Derivatives=D1[]); //m11[]=MetricPk(Th,(x^4+2*4*x^3*y+3*6*x^2*y^2+4*4*x*y^3+5*y^4)/24,kDeg=4,rDeg=1,Derivatives=D1[]); //plot(m11,m12,m22,dim=3,wait=1); cout << m11[] << endl; cout << D1[] << endl; freefem++-3.61-1/examples++-load/testFE_P2BR.edp000644 000767 000024 00000002276 13312446271 021144 0ustar00hechtstaff000000 000000 load "BernardiRaugel" // Parameters real x1 = 0.7; real y1 = 0.9; real h = 1e-7; // Mesh mesh Th = square(1, 1, [10*(x+y/3), 10*(y-x/3)]); // Macro //a macro to compute numerical derivative macro DD(f, hx, hy) ((f(x1+hx, y1+hy) - f(x1-hx, y1-hy))/(2*(hx+hy))) // // Fespace fespace Vh(Th, P2BR); Vh [a1, a2], [b1, b2], [c1, c2]; for (int i = 0; i < Vh.ndofK; ++i) cout << i << " " << Vh(0,i) << endl; // Test P2BR int it1 = Th(x1, y1).nuTriangle; for (int i = 0; i < Vh.ndofK; ++i){ a1[] = 0; int j = Vh(it1, i); a1[][j] = 1; plot([a1, a2], wait=true); [b1, b2] = [a1, a2]; //do the interpolation c1[] = a1[] - b1[]; cout << " ---------" << i << " " << c1[].max << " " << c1[].min << endl; cout << " a = " << a1[] << endl; cout << " b = " << b1[] << endl; assert(c1[].max < 1e-9 && c1[].min > -1e-9); //check if the interpolation is correct //check the derivative and numerical derivative cout << " dx(a1)(x1, y1) = " << dx(a1)(x1, y1) << " == " << DD(a1, h, 0) << endl; assert( abs(dx(a1)(x1, y1) - DD(a1, h, 0) ) < 1e-5); assert( abs(dx(a2)(x1, y1) - DD(a2, h, 0) ) < 1e-5); assert( abs(dy(a1)(x1, y1) - DD(a1, 0, h) ) < 1e-5); assert( abs(dy(a2)(x1, y1) - DD(a2, 0, h) ) < 1e-5); } freefem++-3.61-1/examples++-load/shell.cpp000644 000767 000024 00000020110 13312446271 020271 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // Example C++ function "myfunction", dynamically loaded into "load.edp" #include #include #include #include #include #ifdef _WIN32 #include #endif #ifdef _WIN32 const char sepdir = '\\'; #else const char sepdir = '/'; #endif // extern const char * prognamearg; // extern const char * edpfilenamearg; // #include using namespace Fem2D; long ff_chdir (string *c) {return chdir(c->c_str());} long ff_rmdir (string *c) {return rmdir(c->c_str());} long ff_unlink (string *c) {return unlink(c->c_str());} #ifndef _WIN32 long ff_mkdir (string *c, long mm) {mode_t m = mm; cout << " mkdir " << *c << "mode =" << m << endl; return mkdir(c->c_str(), m);} #endif long ff_chmod (string *c, long mm) {mode_t m = mm; cout << " mkdir " << *c << "mode =" << m << endl; return chmod(c->c_str(), m);} long ff_mkdir (string *c) { mode_t m = 07777; #ifdef _WIN32 return mkdir(c->c_str()); #else return mkdir(c->c_str(), m); #endif } long ff_stat (string *c) { struct stat buff; return stat(c->c_str(), &buff); } long ff_isdir (string *c) { struct stat buff; if (0 == stat(c->c_str(), &buff)) { return (buff.st_mode & S_IFDIR) ? 1 : 0; } else { return -1; // err } } DIR**OpenDir (DIR **pp, string *n) { *pp = opendir(n->c_str()); return pp; } string*ReadDir (Stack s, DIR **const &dirpp) { if (*dirpp) { struct dirent *dp = readdir(*dirpp); if (dp) { return Add2StackOfPtr2Free(s, new string(dp->d_name)); } } return Add2StackOfPtr2Free(s, new string("")); } inline AnyType CloseDir (Stack, const AnyType &x) { DIR **dirpp = PGetAny

(x); if (*dirpp) {(void)closedir(*dirpp);} *dirpp = 0; return Nothing; } #ifdef _WIN32 string*ffgetenv (Stack s, string *const &k) { const int LEN = 4096; char envv[LEN]; GetEnvironmentVariable(k->c_str(), envv, LEN); return Add2StackOfPtr2Free(s, new string(envv)); } long ffsetenv (string *const &k, string *const &v) { char *vv = strcpy((char *)malloc(v->size() + 2), v->c_str()); char *kk = strcpy((char *)malloc(k->size() + 2), k->c_str()); SetEnvironmentVariable(vv, kk); return SetEnvironmentVariable(vv, kk); } long ffunsetenv (string *const &k) { SetEnvironmentVariable(k->c_str(), 0); return 0; } #else string*ffgetenv (Stack s, string *const &k) { const char *env = getenv(k->c_str()); if (!env) {env = "";} return Add2StackOfPtr2Free(s, new string(env)); } long ffsetenv (string *const &k, string *const &v) { char *vv = strcpy((char *)malloc(v->size() + 2), v->c_str()); char *kk = strcpy((char *)malloc(k->size() + 2), k->c_str()); long r = setenv(vv, kk, 1); return r; } long ffunsetenv (string *const &k) { long r = unsetenv(k->c_str()); return r; } #endif string dirname (const string *ppath) { const string &path = *ppath; int i, l = path.length(); for (i = l - 1; i >= 0; i--) { if (path[i] == sepdir) {break;}} if (i == 0) {return ".";} else if (i == 1) {return "/";} else {return path.substr(0, i - 1);} } string basename (const string *ppath) { const string &path = *ppath; int i, l = path.length(); for (i = l - 1; i >= 0; i--) { if (path[i] == sepdir) {i++; break;}} if (i < 0) {i = 0;} return path.substr(i); } string*ff_dirname (Stack s, string *const &path) { return Add2StackOfPtr2Free(s, new string(dirname(path))); } string*ff_basename (Stack s, string *const &path) { return Add2StackOfPtr2Free(s, new string(basename(path))); } long copyfile (string *const &filecp, string *const &target) { int tagetisdir = ff_isdir(target); string filein = *filecp; string filetarget = *target; if (verbosity > 9) { cout << " cpfile :" << filein << "-> " << filetarget << " " << tagetisdir << endl; } if (tagetisdir == 1) { int i, l = filein.length(); for (i = l - 1; i >= 0; i--) { if (filein[i] == sepdir) {break;}} if (i < 0) {i = 0;} // cout << filein << " " << i << " " << l << endl; filetarget += sepdir; filetarget += filein.substr(i); } FILE *source = fopen(filein.c_str(), "rb"); FILE *dest = fopen(filetarget.c_str(), "wb"); if (verbosity > 1) { cout << " cpfile :" << filein << "-> " << filetarget << endl; } if (!source && !dest) { cout << " erreur copy file form " << endl; cout << " file in : " << filein << " " << source << endl; cout << " file taget : " << filetarget << " " << dest << endl; ffassert(0); return -1; // erreur } char buf[BUFSIZ]; size_t size; while ((size = fread(buf, 1, BUFSIZ, source))) { fwrite(buf, 1, size, dest); } fclose(source); fclose(dest); return 0; } extern mylex *zzzfff; static void init () { Dcl_Type(0, CloseDir, 0); zzzfff->Add("Directory", atype()); TheOperators->Add("<-", new OneOperator2(OpenDir)); Global.Add("readdir", "(", new OneOperator1s_(ReadDir)); Global.New("modeRWXu long", CConstant(0700)); Global.New("modeRWXg long", CConstant(070)); Global.New("modeRWXo long", CConstant(07)); Global.New("modeRu long", CConstant(0400)); Global.New("modeRg long", CConstant(040)); Global.New("modeRo long", CConstant(04)); Global.New("modeWu long", CConstant(0200)); Global.New("modeWg long", CConstant(020)); Global.New("modeWo long", CConstant(02)); Global.New("modeXu long", CConstant(0100)); Global.New("modeXg long", CConstant(010)); Global.New("modeXo long", CConstant(01)); Global.Add("unlink", "(", new OneOperator1(ff_unlink)); Global.Add("rmdir", "(", new OneOperator1(ff_rmdir)); Global.Add("cddir", "(", new OneOperator1(ff_chdir)); Global.Add("chdir", "(", new OneOperator1(ff_chdir)); Global.Add("basename", "(", new OneOperator1s_(ff_basename)); Global.Add("dirname", "(", new OneOperator1s_(ff_dirname)); #ifndef _WIN32 Global.Add("mkdir", "(", new OneOperator2(ff_mkdir)); #endif Global.Add("chmod", "(", new OneOperator2(ff_chmod)); Global.Add("mkdir", "(", new OneOperator1(ff_mkdir)); Global.Add("cpfile", "(", new OneOperator2_(copyfile)); Global.Add("stat", "(", new OneOperator1(ff_stat)); Global.Add("isdir", "(", new OneOperator1(ff_isdir)); Global.Add("getenv", "(", new OneOperator1s_(ffgetenv)); Global.Add("setenv", "(", new OneOperator2_(ffsetenv)); Global.Add("unsetenv", "(", new OneOperator1_(ffunsetenv)); // static string edpfilenameargstr=edpfilenamearg; // Global.New("edpfilenamearg",CConstant(&edpfilenameargstr)); } LOADFUNC(init); freefem++-3.61-1/examples++-load/bilapMorley.edp000644 000767 000024 00000001675 13312446271 021446 0ustar00hechtstaff000000 000000 load "Morley" // Parameter real f = 1; // Mesh mesh Th = square(40, 40); //mesh definition of Omega // Fespaces fespace Wh(Th, P2); fespace Vh(Th, P2Morley); // HCT finite element space Vh [u, ux, uy], [v, vx, vy]; // Macro macro bilaplacien(u, v) (dxx(u)*dxx(v) + dyy(u)*dyy(v) + 2.*dxy(u)*dxy(v)) // end of macro // Problem solve bilap ([u, ux, uy], [v, vx, vy]) = int2d(Th)(bilaplacien(u, v)) - int2d(Th)(f*v) + on(1, 2, 3, 4, u=0, ux=0, uy=0) ; // Plot plot(u, cmm="u", wait=1, fill=1); plot(ux, wait=1, cmm="u_x"); plot(uy, wait=1, cmm="u_y"); // Max & Error Wh uu = u; real umax = uu[].max; int err = (abs(umax-0.0012782) > 1e-4); cout << " uu max = " << umax << " ~ 0.0012782, err = " << err << endl; // Plot int n = 100, nn = n+10; real[int] xx(nn), yy(nn); for (int i = 0; i <= n; i++) { xx[i] = real(i)/n; yy[i] = u(0.5, real(i)/n); // value of uh at point (0.5, i/10.) } plot([xx(0:n), yy(0:n)], wait=1); // End assert(err == 0); freefem++-3.61-1/examples++-load/LaplaceP3.edp000644 000767 000024 00000001217 13256636774 020743 0ustar00hechtstaff000000 000000 load "Element_P3" mesh Th=square(10,10); fespace Vh(Th,P3); // P1 FE space Vh uh,vh; // unkown and test function. func f=1; // right hand side function func g=0; // boundary condition function problem laplace(uh,vh) = // Definion of the problem int2d(Th,qft=qf7pT)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form - int2d(Th,qft=qf7pT)( f*vh ) // linear form + on(1,2,3,4,uh=g) ; // boundary condition form laplace; // solve the problem plot(uh); // to see the result plot(uh,ps="LaplaceP3.eps",value=true); freefem++-3.61-1/examples++-load/include.tar.gz000644 000767 000024 00000003562 13256636774 021264 0ustar00hechtstaff000000 000000 oU[o6`M(Q붋i5nZd(PR&e7Q"a &yxhzX`!iz_\81c9┤$I҄(8K!CLlx_ݯ+?뿤z}1?8/v_*.ʲ+oCSB6盶w%D{30ߟ٫Co~h9@wjmBgJ+©S?DHx'~zo,%'D'}݆1KoH7]U8lϷ?%kl[-K phD㿼/\i+ M _#!2pU??\dZ %Zav!RTok[:i!3_?K":񇉆X"[_y4l _y׷^0tg)_sQ!?&I?n bgGmDH͖74CW ?ڿ=} %i@4ONyy۲"4D WYn]M_yLydADџ"f,OD9#q<7S Wd_?@J[%C#bFokUa\/9oZ0#Hly.Yc::3)sJpD %k:ax?!__,)_e8j[u޳U(?IV $p+\j[ G-60KG4'ab?$׭4_0oDo9S CIJ$#kOW:'cH/]iZDV5PoXyŶ7&[)O_2?RlD)NpO?RVuCf?u@?=5-L9_^6_w3`o(A2v/V?Ɵ)OZɈ5k06}-^qFߺ"$kVU `NhwVKC<^dϨ}/@J?C}L_Is/@J7P.YvbL?U)o] ?/?ȡ!vt?%k?DSo>4G?%eLHOP&@J?Ro+ ?A2JZ ?=Gsy6\PV!Bokwb:?o^ /DS{kY;!fخOS"$k~#:O"$k?WAx/D/W]!BTup~z[Ok>c` ,X` ,7z;freefem++-3.61-1/examples++-load/Makefile.in000644 000767 000024 00000241027 13321623167 020540 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ EXTRA_PROGRAMS = ffmaster$(EXEEXT) subdir = examples++-load ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) ffmaster_SOURCES = ffmaster.c ffmaster_OBJECTS = ffmaster.$(OBJEXT) ffmaster_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = ffmaster.c DIST_SOURCES = ffmaster.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/test-driver README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ 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 NS_P2BR_P0.edp PARDISO.edp SuperLU.edp \ VarIneq2.edp bilapMorley.edp bmo.edp buildlayermesh.edp \ checkglumeshcube.edp cmaes-VarIneq.edp cmaes-oven.edp \ convect_dervieux.edp convectchacon-3d.edp convectchacon.edp \ convexehull3d.edp dfft.edp ffnewuoa.edp ffrandom.edp \ funcTemplate.edp glumesh3D.edp gsl.edp ilut.edp isoline.edp \ lame-TD-NSS.edp lap-solvers.edp lapack.edp layer.edp load.edp \ meditddm.edp metis.edp mshmet.edp myType.edp myfunction2.edp \ pipe.edp plot-fb-P3.edp plot-fb-P3dc.edp plot-fb-P4.edp \ plot-fb-P4dc.edp plotfb.edp ppm2rnm.edp provadxw.edp ref.edp \ refinesphere.edp schwarz-nm.edp scotch.edp shell.edp \ splitedges.edp splitmesh3.edp splitmesh6.edp \ test-ElementMixte.edp testFE-P3.edp testFE-P3dc.edp \ testFE-P4.edp testFE-P4dc.edp testFE-PkEdge.edp \ testFE_P2BR.edp testFEMorley.edp tetgencube.edp \ tetgenholeregion_rugby.edp thresholdings.edp ttestio.edp \ bfstream.edp bilapP3-hct-like.edp ClosePoints.edp cube.edp \ bilapHCT.edp testFEHCT.edp Stokes-surface-tension-axi.edp \ Element_QF.edp distance.edp distance2.edp distance3.edp \ testdist.edp testp1dcnc.edp testFE-P2Bulle3.edp LaplaceRT2.edp \ LaplaceP2pnc.edp testFE-P2pnc.edp LaplaceP3-3d.edp \ LaplaceRT13d.edp SaveHB_sample.edp SaveHB_sample_z.edp # all test can fail must but clean ???? FH... XFAIL_TESTS = $(TESTS) LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw EXTRA_DIST = $(TESTS) all.edp makeref.edp regtests.edp \ ff-get-dep.in ff-get-dep.awk ff-pkg-download.in load.link.in include.tar.gz \ BernardiRaugel.cpp Morley.cpp dfft.cpp \ funcTemplate.cpp mat_dervieux.cpp mat_psi.cpp myfunction.cpp \ mat_dervieux.cpp funcTemplate.cpp \ regtests.m4 addNewType.cpp \ qf11to25.cpp Element_P3.cpp Element_P3.hpp Element_P4.cpp Element_P4.hpp \ Element_P3dc.cpp Element_P3dc.hpp Element_P4dc.cpp Element_P4dc.hpp \ Element_PkEdge.cpp \ SuperLu.cpp \ NewSolver.cpp \ splitmesh3.cpp splitmesh6.cpp \ splitmesh4.cpp splitmesh12.cpp \ README_SuperLU \ tetgen.cpp\ msh3.cpp msh3.hpp\ ffrandom.cpp \ medit.cpp \ bmo.cpp lgbmo.cpp bmo.hpp \ fflapack.cpp lapack.cpp clapack.h \ fig.pgm lg.pgm ppm2rnm.cpp ppmimg.h \ DxWriter.cpp metis.cpp pcm.cpp pcm.hpp pcm2rnm.cpp \ UMFPACK64.cpp iovtk.cpp gmsh.cpp MetricKuate.cpp \ ffnewuoa.cpp newuoa.f Element_P1dc1.cpp ilut.cpp \ freeyams.cpp mmg3d-v4.0.cpp mshmet.cpp \ BinaryIO.cpp gsl.cpp gsl.awk ff_gsl_awk.hpp gsl.idp isolineP1.cpp isoline.cpp lg.pgm \ thresholdings.cpp \ VTK_writer_3d.cpp VTK_writer.cpp splitedges.cpp \ Element_Mixte.cpp \ Element_Mixte3d.cpp \ myfunction2.cpp \ cmaes.cpp \ cmaes.h cmaes_interface.h ff-cmaes.cpp \ ff-NLopt.cpp \ MetricPk.cpp GeometryQA.cpp FreeFemQA.cpp BasicMath.h TensorK.hpp Geometry.hpp \ RZ.h SortedList.h ExampleMetrics.h \ cube.msh \ MUMPS_seq.cpp \ MUMPS.cpp \ ff-Ipopt.cpp \ scotch.cpp shell.cpp \ pipe.cpp pstream.h \ symmetrizeCSR.cpp \ 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 \ ClosePoints.cpp aniso.cpp Element_HCT.cpp Curvature.cpp waveguide.edp waveguide2.edp Element_P1bl.cpp \ Element_QF.cpp distance.edp distance2.edp distance3.edp g.gmesh distance.cpp testdist.edp \ Element_P1ncdc.cpp testp1dcnc.edp \ renumb.hpp Element_P2bulle3.cpp Element_P2pnc.cpp \ libff-mmap-semaphore.c ffmaster.c libff-mmap-semaphore.h ff-mmap-semaphore.cpp fortan_master.f90 \ SaveHB.cpp SaveHB_sample.edp SaveHB_README SaveHB_sample_z.edp LIST_COMPILE = myfunction.$(DYLIB_SUFFIX) BernardiRaugel.$(DYLIB_SUFFIX) \ Morley.$(DYLIB_SUFFIX) funcTemplate.$(DYLIB_SUFFIX) addNewType.$(DYLIB_SUFFIX) \ qf11to25.$(DYLIB_SUFFIX) Element_P3.$(DYLIB_SUFFIX) Element_P4.$(DYLIB_SUFFIX) \ Element_P3dc.$(DYLIB_SUFFIX) Element_P4dc.$(DYLIB_SUFFIX) \ Element_PkEdge.$(DYLIB_SUFFIX) msh3.$(DYLIB_SUFFIX) \ splitmesh3.$(DYLIB_SUFFIX) splitmesh6.$(DYLIB_SUFFIX) \ splitmesh4.$(DYLIB_SUFFIX) splitmesh12.$(DYLIB_SUFFIX) \ ffrandom.$(DYLIB_SUFFIX) \ medit.$(DYLIB_SUFFIX) \ mat_dervieux.$(DYLIB_SUFFIX) lgbmo.$(DYLIB_SUFFIX) mat_psi.$(DYLIB_SUFFIX)\ ppm2rnm.$(DYLIB_SUFFIX) DxWriter.$(DYLIB_SUFFIX) \ pcm2rnm.$(DYLIB_SUFFIX) $(DYLIB_OTHER_COMPILE) \ iovtk.$(DYLIB_SUFFIX) gmsh.$(DYLIB_SUFFIX) MetricKuate.$(DYLIB_SUFFIX) \ Element_P1dc1.$(DYLIB_SUFFIX) BinaryIO.$(DYLIB_SUFFIX) \ isolineP1.$(DYLIB_SUFFIX) isoline.$(DYLIB_SUFFIX) thresholdings.$(DYLIB_SUFFIX) \ VTK_writer_3d.$(DYLIB_SUFFIX) VTK_writer.$(DYLIB_SUFFIX) \ splitedges.$(DYLIB_SUFFIX) Element_Mixte.$(DYLIB_SUFFIX) Element_Mixte3d.$(DYLIB_SUFFIX) \ myfunction2.$(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) ClosePoints.$(DYLIB_SUFFIX) \ Element_HCT.$(DYLIB_SUFFIX) Curvature.$(DYLIB_SUFFIX) Element_P1bl.$(DYLIB_SUFFIX) \ Element_QF.$(DYLIB_SUFFIX) distance.$(DYLIB_SUFFIX) Element_P1ncdc.$(DYLIB_SUFFIX) \ Element_P2bulle3.$(DYLIB_SUFFIX) \ Element_P2pnc.$(DYLIB_SUFFIX) SaveHB.$(DYLIB_SUFFIX) # FFCS - some libraries are skipped because the corresponding tool is deactivated. LIST_COMPILE_PKG = @TOOL_DYLIB_tetgen@ @TOOL_DYLIB_superlu4@ dfft.$(DYLIB_SUFFIX) \ @TOOL_DYLIB_umfpack@ NewSolver.$(DYLIB_SUFFIX) @TOOL_DYLIB_lapack@ \ ffnewuoa.$(DYLIB_SUFFIX) @TOOL_DYLIB_gmm@ @TOOL_DYLIB_yams@ @TOOL_DYLIB_mmg3d@ @TOOL_DYLIB_mshmet@ \ @TOOL_DYLIB_gsl@ @TOOL_DYLIB_mumps_seq@ @TOOL_DYLIB_ipopt@ @TOOL_DYLIB_nlopt@ ff-cmaes.$(DYLIB_SUFFIX) \ @TOOL_DYLIB_scotch@ @TOOL_DYLIB_parmetis@ @TOOL_DYLIB_pardiso@ @TOOL_DYLIB_MMAP@ bin_PROGRAMS = @BIN_ffmaster@ # FFCS - 26/10/11 - Unpacking include.tar.gz is very often buggy under Cygwin (softlinks are randomly replaced with # empty files without any access right). So just replace the whole thing with a plain copy. allheaders = ../src/fflib/AddNewFE.h ../src/fflib/AFunction_ext.hpp ../src/fflib/AFunction.hpp ../src/fflib/AnyType.hpp \ ../src/fflib/array_init.hpp ../src/fflib/array_resize.hpp ../src/fflib/array_tlp.hpp \ ../src/femlib/assertion.hpp ../src/femlib/BamgFreeFem.hpp ../src/Algo/BFGS.hpp ../src/Algo/BrentLS.hpp \ ../src/Algo/CG.hpp ../src/femlib/CGNL.hpp ../src/fflib/CodeAlloc.hpp ../config.h ../config-wrapper.h \ ../src/Algo/CubicLS.hpp ../src/Algo/defs.hpp ../src/femlib/DOperator.hpp ../src/libMesh/eigenv.h \ ../src/fflib/endian.hpp ../src/fflib/environment.hpp ../src/fflib/error.hpp ../src/femlib/fem3.hpp \ ../src/femlib/fem.hpp ../src/femlib/FESpace.hpp ../src/femlib/FESpacen.hpp ../src/fflib/ff++.hpp \ ../src/fflib/ffstack.hpp ../src/femlib/FQuadTree.hpp ../src/femlib/GenericMesh.hpp \ ../src/Graphics/getprog-unix.hpp ../src/Graphics/glrgraph.hpp ../src/femlib/gmres.hpp \ ../src/femlib/GQuadTree.hpp ../src/femlib/HashTable.hpp ../src/femlib/HeapSort.hpp ../src/fflib/InitFunct.hpp \ ../src/fflib/ffapi.hpp ../src/femlib/Label.hpp ../src/fflib/lex.hpp ../src/fflib/lgfem.hpp \ ../src/fflib/lgmesh3.hpp ../src/fflib/lgsolver.hpp ../src/lglib/lg.tab.hpp ../src/femlib/libmesh5.h \ ../src/Algo/LineSearch.hpp ../src/femlib/MatriceCreuse.hpp ../src/femlib/MatriceCreuse_tpl.hpp \ ../src/femlib/Mesh1dn.hpp ../src/femlib/Mesh2dn.hpp ../src/bamglib/Mesh2.h ../src/femlib/Mesh3dn.hpp \ ../src/bamglib/Meshio.h ../src/femlib/MeshPoint.hpp ../src/bamglib/meshtype.h ../src/bamglib/Metric.h \ ../src/Graphics/mode_open.hpp ../src/Algo/NewtonRaphson.hpp ../src/Algo/NRJ.hpp ../src/fflib/Operator.hpp \ ../src/Algo/Optima.hpp ../src/Algo/Param.hpp ../src/femlib/PkLagrange.hpp ../src/fflib/PlotStream.hpp \ ../src/fflib/problem.hpp ../src/femlib/QuadratureFormular.hpp ../src/bamglib/QuadTree.h ../src/femlib/R1.hpp \ ../src/bamglib/R2.h ../src/femlib/R2.hpp ../src/femlib/R3.hpp ../src/femlib/RefCounter.hpp \ ../src/Graphics/rgraph.hpp ../src/femlib/RNM.hpp ../src/femlib/RNM_opc.hpp ../src/femlib/RNM_op.hpp \ ../src/femlib/RNM_tpl.hpp ../src/Algo/RosenBrock.hpp ../src/fflib/Serialize.hpp ../src/bamglib/SetOfE4.h \ ../src/fflib/showverb.hpp ../src/femlib/splitsimplex.hpp ../src/fflib/String.hpp \ ../src/fflib/strversionnumber.hpp ../src/fflib/throwassert.hpp ../src/femlib/ufunction.hpp \ ../src/fflib/versionnumber.hpp ../src/bamglib/write_hdf5.hpp ../src/bamglib/write_xdmf.hpp \ ../src/fflib/P1IsoValue.hpp all: all-am .SUFFIXES: .SUFFIXES: .$(DYLIB_SUFFIX) .c .cpp .log .o .obj .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-load/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-load/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffmaster.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? APk-AdaptEpsDeltaPk.edp.log: APk-AdaptEpsDeltaPk.edp @p='APk-AdaptEpsDeltaPk.edp'; \ b='APk-AdaptEpsDeltaPk.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) APk-ExplicitPkTest.edp.log: APk-ExplicitPkTest.edp @p='APk-ExplicitPkTest.edp'; \ b='APk-ExplicitPkTest.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) APk-FreeFemQA.edp.log: APk-FreeFemQA.edp @p='APk-FreeFemQA.edp'; \ b='APk-FreeFemQA.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) APk-MetricPk.edp.log: APk-MetricPk.edp @p='APk-MetricPk.edp'; \ b='APk-MetricPk.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) IPOTest.edp.log: IPOTest.edp @p='IPOTest.edp'; \ b='IPOTest.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) IpOptMinSurf.edp.log: IpOptMinSurf.edp @p='IpOptMinSurf.edp'; \ b='IpOptMinSurf.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) IpoptLap.edp.log: IpoptLap.edp @p='IpoptLap.edp'; \ b='IpoptLap.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) IpoptMinSurfVol.edp.log: IpoptMinSurfVol.edp @p='IpoptMinSurfVol.edp'; \ b='IpoptMinSurfVol.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) IpoptVI.edp.log: IpoptVI.edp @p='IpoptVI.edp'; \ b='IpoptVI.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) IpoptVI2.edp.log: IpoptVI2.edp @p='IpoptVI2.edp'; \ b='IpoptVI2.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) LapDG3.edp.log: LapDG3.edp @p='LapDG3.edp'; \ b='LapDG3.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) LapDG4.edp.log: LapDG4.edp @p='LapDG4.edp'; \ b='LapDG4.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) LapLNewSolver.edp.log: LapLNewSolver.edp @p='LapLNewSolver.edp'; \ b='LapLNewSolver.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) LapMUMPS_seq.edp.log: LapMUMPS_seq.edp @p='LapMUMPS_seq.edp'; \ b='LapMUMPS_seq.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) LapNewSolver.edp.log: LapNewSolver.edp @p='LapNewSolver.edp'; \ b='LapNewSolver.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) LapUmfpack64.edp.log: LapUmfpack64.edp @p='LapUmfpack64.edp'; \ b='LapUmfpack64.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) LaplaceP3.edp.log: LaplaceP3.edp @p='LaplaceP3.edp'; \ b='LaplaceP3.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) LaplaceP4.edp.log: LaplaceP4.edp @p='LaplaceP4.edp'; \ b='LaplaceP4.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) LaplaceRT1.edp.log: LaplaceRT1.edp @p='LaplaceRT1.edp'; \ b='LaplaceRT1.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) Leman-mesh.edp.log: Leman-mesh.edp @p='Leman-mesh.edp'; \ b='Leman-mesh.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) MetricKuate.edp.log: MetricKuate.edp @p='MetricKuate.edp'; \ b='MetricKuate.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) NS_P2BR_P0.edp.log: NS_P2BR_P0.edp @p='NS_P2BR_P0.edp'; \ b='NS_P2BR_P0.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) PARDISO.edp.log: PARDISO.edp @p='PARDISO.edp'; \ b='PARDISO.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) SuperLU.edp.log: SuperLU.edp @p='SuperLU.edp'; \ b='SuperLU.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) VarIneq2.edp.log: VarIneq2.edp @p='VarIneq2.edp'; \ b='VarIneq2.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) bilapMorley.edp.log: bilapMorley.edp @p='bilapMorley.edp'; \ b='bilapMorley.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) bmo.edp.log: bmo.edp @p='bmo.edp'; \ b='bmo.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) buildlayermesh.edp.log: buildlayermesh.edp @p='buildlayermesh.edp'; \ b='buildlayermesh.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) checkglumeshcube.edp.log: checkglumeshcube.edp @p='checkglumeshcube.edp'; \ b='checkglumeshcube.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) cmaes-VarIneq.edp.log: cmaes-VarIneq.edp @p='cmaes-VarIneq.edp'; \ b='cmaes-VarIneq.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) cmaes-oven.edp.log: cmaes-oven.edp @p='cmaes-oven.edp'; \ b='cmaes-oven.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) convect_dervieux.edp.log: convect_dervieux.edp @p='convect_dervieux.edp'; \ b='convect_dervieux.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) convectchacon-3d.edp.log: convectchacon-3d.edp @p='convectchacon-3d.edp'; \ b='convectchacon-3d.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) convectchacon.edp.log: convectchacon.edp @p='convectchacon.edp'; \ b='convectchacon.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) convexehull3d.edp.log: convexehull3d.edp @p='convexehull3d.edp'; \ b='convexehull3d.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) dfft.edp.log: dfft.edp @p='dfft.edp'; \ b='dfft.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) ffnewuoa.edp.log: ffnewuoa.edp @p='ffnewuoa.edp'; \ b='ffnewuoa.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) ffrandom.edp.log: ffrandom.edp @p='ffrandom.edp'; \ b='ffrandom.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) funcTemplate.edp.log: funcTemplate.edp @p='funcTemplate.edp'; \ b='funcTemplate.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) glumesh3D.edp.log: glumesh3D.edp @p='glumesh3D.edp'; \ b='glumesh3D.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) gsl.edp.log: gsl.edp @p='gsl.edp'; \ b='gsl.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) ilut.edp.log: ilut.edp @p='ilut.edp'; \ b='ilut.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) isoline.edp.log: isoline.edp @p='isoline.edp'; \ b='isoline.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) lame-TD-NSS.edp.log: lame-TD-NSS.edp @p='lame-TD-NSS.edp'; \ b='lame-TD-NSS.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) lap-solvers.edp.log: lap-solvers.edp @p='lap-solvers.edp'; \ b='lap-solvers.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) lapack.edp.log: lapack.edp @p='lapack.edp'; \ b='lapack.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) layer.edp.log: layer.edp @p='layer.edp'; \ b='layer.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) load.edp.log: load.edp @p='load.edp'; \ b='load.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) meditddm.edp.log: meditddm.edp @p='meditddm.edp'; \ b='meditddm.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) metis.edp.log: metis.edp @p='metis.edp'; \ b='metis.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) mshmet.edp.log: mshmet.edp @p='mshmet.edp'; \ b='mshmet.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) myType.edp.log: myType.edp @p='myType.edp'; \ b='myType.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) myfunction2.edp.log: myfunction2.edp @p='myfunction2.edp'; \ b='myfunction2.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) pipe.edp.log: pipe.edp @p='pipe.edp'; \ b='pipe.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) plot-fb-P3.edp.log: plot-fb-P3.edp @p='plot-fb-P3.edp'; \ b='plot-fb-P3.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) plot-fb-P3dc.edp.log: plot-fb-P3dc.edp @p='plot-fb-P3dc.edp'; \ b='plot-fb-P3dc.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) plot-fb-P4.edp.log: plot-fb-P4.edp @p='plot-fb-P4.edp'; \ b='plot-fb-P4.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) plot-fb-P4dc.edp.log: plot-fb-P4dc.edp @p='plot-fb-P4dc.edp'; \ b='plot-fb-P4dc.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) plotfb.edp.log: plotfb.edp @p='plotfb.edp'; \ b='plotfb.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) ppm2rnm.edp.log: ppm2rnm.edp @p='ppm2rnm.edp'; \ b='ppm2rnm.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) provadxw.edp.log: provadxw.edp @p='provadxw.edp'; \ b='provadxw.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) ref.edp.log: ref.edp @p='ref.edp'; \ b='ref.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) refinesphere.edp.log: refinesphere.edp @p='refinesphere.edp'; \ b='refinesphere.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) schwarz-nm.edp.log: schwarz-nm.edp @p='schwarz-nm.edp'; \ b='schwarz-nm.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) scotch.edp.log: scotch.edp @p='scotch.edp'; \ b='scotch.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) shell.edp.log: shell.edp @p='shell.edp'; \ b='shell.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) splitedges.edp.log: splitedges.edp @p='splitedges.edp'; \ b='splitedges.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) splitmesh3.edp.log: splitmesh3.edp @p='splitmesh3.edp'; \ b='splitmesh3.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) splitmesh6.edp.log: splitmesh6.edp @p='splitmesh6.edp'; \ b='splitmesh6.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-ElementMixte.edp.log: test-ElementMixte.edp @p='test-ElementMixte.edp'; \ b='test-ElementMixte.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) testFE-P3.edp.log: testFE-P3.edp @p='testFE-P3.edp'; \ b='testFE-P3.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) testFE-P3dc.edp.log: testFE-P3dc.edp @p='testFE-P3dc.edp'; \ b='testFE-P3dc.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) testFE-P4.edp.log: testFE-P4.edp @p='testFE-P4.edp'; \ b='testFE-P4.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) testFE-P4dc.edp.log: testFE-P4dc.edp @p='testFE-P4dc.edp'; \ b='testFE-P4dc.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) testFE-PkEdge.edp.log: testFE-PkEdge.edp @p='testFE-PkEdge.edp'; \ b='testFE-PkEdge.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) testFE_P2BR.edp.log: testFE_P2BR.edp @p='testFE_P2BR.edp'; \ b='testFE_P2BR.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) testFEMorley.edp.log: testFEMorley.edp @p='testFEMorley.edp'; \ b='testFEMorley.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) tetgencube.edp.log: tetgencube.edp @p='tetgencube.edp'; \ b='tetgencube.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) tetgenholeregion_rugby.edp.log: tetgenholeregion_rugby.edp @p='tetgenholeregion_rugby.edp'; \ b='tetgenholeregion_rugby.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) thresholdings.edp.log: thresholdings.edp @p='thresholdings.edp'; \ b='thresholdings.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) ttestio.edp.log: ttestio.edp @p='ttestio.edp'; \ b='ttestio.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) bfstream.edp.log: bfstream.edp @p='bfstream.edp'; \ b='bfstream.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) bilapP3-hct-like.edp.log: bilapP3-hct-like.edp @p='bilapP3-hct-like.edp'; \ b='bilapP3-hct-like.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) 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) cube.edp.log: cube.edp @p='cube.edp'; \ b='cube.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) bilapHCT.edp.log: bilapHCT.edp @p='bilapHCT.edp'; \ b='bilapHCT.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) testFEHCT.edp.log: testFEHCT.edp @p='testFEHCT.edp'; \ b='testFEHCT.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) Stokes-surface-tension-axi.edp.log: Stokes-surface-tension-axi.edp @p='Stokes-surface-tension-axi.edp'; \ b='Stokes-surface-tension-axi.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) Element_QF.edp.log: Element_QF.edp @p='Element_QF.edp'; \ b='Element_QF.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) distance.edp.log: distance.edp @p='distance.edp'; \ b='distance.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) distance2.edp.log: distance2.edp @p='distance2.edp'; \ b='distance2.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) distance3.edp.log: distance3.edp @p='distance3.edp'; \ b='distance3.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) testdist.edp.log: testdist.edp @p='testdist.edp'; \ b='testdist.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) testp1dcnc.edp.log: testp1dcnc.edp @p='testp1dcnc.edp'; \ b='testp1dcnc.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) testFE-P2Bulle3.edp.log: testFE-P2Bulle3.edp @p='testFE-P2Bulle3.edp'; \ b='testFE-P2Bulle3.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) LaplaceRT2.edp.log: LaplaceRT2.edp @p='LaplaceRT2.edp'; \ b='LaplaceRT2.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) LaplaceP2pnc.edp.log: LaplaceP2pnc.edp @p='LaplaceP2pnc.edp'; \ b='LaplaceP2pnc.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) testFE-P2pnc.edp.log: testFE-P2pnc.edp @p='testFE-P2pnc.edp'; \ b='testFE-P2pnc.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) LaplaceP3-3d.edp.log: LaplaceP3-3d.edp @p='LaplaceP3-3d.edp'; \ b='LaplaceP3-3d.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) LaplaceRT13d.edp.log: LaplaceRT13d.edp @p='LaplaceRT13d.edp'; \ b='LaplaceRT13d.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) SaveHB_sample.edp.log: SaveHB_sample.edp @p='SaveHB_sample.edp'; \ b='SaveHB_sample.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) SaveHB_sample_z.edp.log: SaveHB_sample_z.edp @p='SaveHB_sample_z.edp'; \ b='SaveHB_sample_z.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) all-local installdirs: for dir in "$(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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-binPROGRAMS clean-generic clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic 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-exec-local 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-compile mostlyclean-generic pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: Makefile all-local: @LOAD_COMPILE@ # FFCS parallel make: some targets need to be built first, sequentially load_compile: ff-c++ WHERE_LIBRARY-download include.done freefem++.pref # # max_load -@rm "Missing-plugins-$(DYLIB_SUFFIX).log" 2>/dev/null || true $(MAKE) $(AM_MAKEFLAGS) $(LIST_COMPILE) $(LIST_COMPILE_PKG) @if test -f Missing-plugins-$(DYLIB_SUFFIX).log ; then cat Missing-plugins-$(DYLIB_SUFFIX).log; fi; exit 0 @echo Warning missing plugin: `for i in $(LIST_COMPILE) $(LIST_COMPILE_PKG); do if test ! -s $i ; then j=1; echo "$i," ;fi; done` echo " finish build list $(DYLIB_SUFFIX)" .cpp.$(DYLIB_SUFFIX): ff-c++ ./ff-c++ -auto $< @ENABLE_FFCS_TRUE@include.done: $(allheaders) @ENABLE_FFCS_TRUE@ -rm -rf include @ENABLE_FFCS_TRUE@ mkdir -p include @ENABLE_FFCS_TRUE@ cp $^ include @ENABLE_FFCS_TRUE@ touch $@ @ENABLE_FFCS_FALSE@include.done: $(allheaders) @ENABLE_FFCS_FALSE@ -rm -rf include @ENABLE_FFCS_FALSE@ mkdir -p include @ENABLE_FFCS_FALSE@ for i in $(allheaders); do ln -s ../$$i include/. ; done @ENABLE_FFCS_FALSE@ touch $@ clean-local:: -rm -r include -rm include.done Ref: makeref.edp ../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp all-local: all.edp regtests.edp load_compile # FFCS - 27/2/13 - remove dependency on Makefile to avoid recompiling everything everytime something is changed in the # configuration step all.edp: @test -f ../src/bin-win32/FreeFem++.exe && ffpp=../src/bin-win32/FreeFem++.exe || ffpp=../src/nw/FreeFem++; \ (echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;"; \ for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \ if $$ffpp -ns -jc -v 0 $$i 1>/dev/null 2>/dev/null ; then \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ else \ echo ' cout << "--------- error compile file : '$$i' ---------------------------------------------" << endl;'; \ fi; done) > $@ @awk '/error compile/ {print "Error freefem++ file ," $$6}' $@ # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp # FFCS - 27/2/13 - remove dependency on Makefile to avoid recompiling everything everytime something is changed in the # configuration step $(LIST_COMPILE):ff-c++ include.done clean-local:: -rm *.o *.$(DYLIB_SUFFIX) load.link WHERE_LIBRARY-download ff-get-dep ff-c++ ff-pkg-download \ $(LIST_COMPILE) $(LIST_COMPILE_PKG) regtests.edp makeref.edp -rm -rf include include.done ff-c++:load.link.in load.link WHERE_LIBRARY-download ff-get-dep ../config.status ../config.status --file=ff-c++:load.link.in chmod a+x ff-c++ load.link:load.link.in ../config.status ../config.status --file=load.link:load.link.in chmod a+x load.link ff-pkg-download:ff-pkg-download.in ../config.status ../config.status --file=$@:$@.in chmod a+x $@ cp $@ ../download/bin ff-get-dep:ff-get-dep.in ../config.status ../config.status --file=$@:$@.in chmod a+x $@ -if [ -d ../download/bin ] ;then cp $@ ../download/bin; fi WHERE_LIBRARY-download:ff-pkg-download FORCE WHERE_LIBRARY-config WHERE_LIBRARY @./ff-pkg-download >$@-new @diff $@-new $@ || (cp $@-new $@ ;touch WHERE_LIBRARY) WHERE_LIBRARY: touch $@ FORCE: ; freefem++.pref: echo loadpath = \"./\" >freefem++.pref echo includepath += \"../examples++-3d/\" >freefem++.pref install-exec-local:: load_compile WHERE_LIBRARY $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib test -n "$(MPIPROG)" && $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib/mpi || true $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/etc $(INSTALL_DATA) clapack.h ppmimg.h bmo.hpp msh3.hpp pcm.hpp include/* $(DESTDIR)$(ff_prefix_dir)/include $(INSTALL) -m 555 $(LIST_COMPILE) $(DESTDIR)$(ff_prefix_dir)/lib $(INSTALL) -m 555 ff-get-dep.awk WHERE_LIBRARY-config WHERE_LIBRARY $(DESTDIR)$(ff_prefix_dir)/lib for i in WHERE_LIBRARY-config WHERE_LIBRARY WHERE_LIBRARY-download; do \ sed <$$i >$(DESTDIR)$(ff_prefix_dir)/lib/$$i 's#$(abs_top_builddir)/download#$(ff_prefix_dir)#' ;\ done echo loadpath += \"./\" >$(DESTDIR)$(ff_prefix_dir)/etc/freefem++.pref echo loadpath += \"$(ff_prefix_dir)/lib\" >>$(DESTDIR)$(ff_prefix_dir)/etc/freefem++.pref echo includepath += \"$(ff_prefix_dir)/idp\" >>$(DESTDIR)$(ff_prefix_dir)/etc/freefem++.pref $(INSTALL_SCRIPT) ff-c++ $(DESTDIR)${bindir} $(INSTALL_SCRIPT) ff-pkg-download $(DESTDIR)${bindir} $(INSTALL_SCRIPT) ff-get-dep $(DESTDIR)${bindir} -for i in $(LIST_COMPILE_PKG); do \ if [ -f $$i ] ; then $(INSTALL) -m 555 $$i $(DESTDIR)$(ff_prefix_dir)/lib; fi; done - if [ -n "$(MPIPROG)" ] ; then \ for i in $(LIST_COMPILE_PKG) $(LIST_COMPILE); do \ if [ -f ../examples++-mpi/$$i ] ; then \ $(INSTALL) -m 555 ../examples++-mpi/$$i $(DESTDIR)$(ff_prefix_dir)/lib/mpi; \ else echo missing install mpi version ??? ../examples++-mpi/$$i ;\ fi; \ done ; \ fi ffmaster: libff-mmap-semaphore.o ffmaster.c libff-mmap-semaphore.h $(CC) $(CFLAGS) ffmaster.c libff-mmap-semaphore.o -o ffmaster $(LIBSPTHREAD) libff-mmap-semaphore.o ff-mmap-semaphore.$(DYLIB_SUFFIX):include.done ff-mmap-semaphore.cpp libff-mmap-semaphore.c libff-mmap-semaphore.h ff-c++ ./ff-c++ -auto ff-mmap-semaphore.cpp clean-local:: -rm *.fg *.eps *~ *.ps *.mesh *.mesh.gmsh ListOfAllocPtr-8.bin ffglut*.ppm Th.o.meshb Th3.d.meshb dep.sol.meshbgh \ ipopt.out mmg.out xxxx ThFF.txt TriQA.txt cavidadTT.txt mass.txt xy.txt \ ThFF_Metric.txt TriQA_Metric.txt datanc.txt u100m8.txt \ TTh.sol Th.o.sol Th3.sol dep.o.sol dep.sol gradient.sol hessien.sol pippo.data pippo.dx testsavemedit.solb med.gp bidule.vtk disque.vtk g-iso # FFCS: add tags for files that are not specified to automake by a SOURCE directive (this tags file is automatically # taken into account by automake when it sees it). TAGS: etags *.?pp # 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: freefem++-3.61-1/examples++-load/Element_HCT.cpp000644 000767 000024 00000033016 13312446271 021262 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : HCT finite element // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Frederic Hecht // Hanen Narje // E-MAIL : frederic.hecht@sorbonne-universite.fr // ferchichihanen@gmail.com // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // Reference // Sur l'implementation des elements finis de Hsieh-Clough-Tocher complet et reduit // https://hal.inria.fr/file/index/docid/76557/filename/RR-0004.pdf // Related files: // to check and validate: testFEHCT.edp // to get a real example: bilapHCT.edp #include "ff++.hpp" #include "AddNewFE.h" // #include "problem.hpp" namespace Fem2D { // ------ class TypeOfFE_HCT: public TypeOfFE { public: static int Data []; // double Pi_h_coef[]; TypeOfFE_HCT (): TypeOfFE(12, 3,// hack u, u_x, u_y for interpolation Data, 2, 1, 9 + 6,// nb coef to build interpolation 6,// np point to build interpolation 0) { // const double gauss1 = (1. - sqrt(1. / 3.)) / 2; // const double gauss2 = 1. - gauss1; const R2 Pt [] = {R2(0, 0), R2(1, 0), R2(0, 1), R2(0.5, 0.5), R2(0, 0.5), R2(0.5, 0)}; // for the 3 vertices 3 coef => 9 coef .. int kk = 0; for (int p = 0; p < 3; p++) { P_Pi_h[p] = Pt[p]; pij_alpha[kk] = IPJ(kk, p, 0); kk++; // VALUE pij_alpha[kk] = IPJ(kk, p, 1); kk++; // DX pij_alpha[kk] = IPJ(kk, p, 2); kk++; // DY } // for int p = 3; for (int e = 0; e < 3; ++e) { // point d'integration sur l'arete e P_Pi_h[p] = Pt[p]; // cout <<"\n" << p << " -- " << P_Pi_h[p] << " :: " << A << " " << B << endl; pij_alpha[kk++] = IPJ(9 + e, p, 1); // coef = ne_x * sge pij_alpha[kk++] = IPJ(9 + e, p, 2); // coef = ne_y * sge p++; } assert(P_Pi_h.N() == p); assert(pij_alpha.N() == kk); } void FB (const bool *whatd, const Mesh &Th, const Triangle &K, const R2 &P, RNMK_ &val) const; void Pi_h_alpha (const baseFElement &K, KN_ &v) const; // R operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const; }; /* * R TypeOfFE_HCT::operator()(const FElement & K,const R2 & PHat,const KN_ & u,int componante,int op) const * { * R v[10000],vf[1000]; * assert(N*3*NbDoF<=10000 && NbDoF <1000 ); * KNMK_ fb(v,NbDoF,N,op+1); // the value for basic fonction * KN_ fk(vf,NbDoF); * for (int i=0;i &v) const { const Triangle &T(K.T); int k = 0; // coef pour les 3 sommets fois le 3 composantes for (int i = 0; i < 9; i++) { v[k++] = 1; } // integration sur les aretes for (int i = 0; i < 3; i++) { R2 N(T.Edge(i).perp()); N *= T.EdgeOrientation(i) / N.norme(); v[k++] = N.x; v[k++] = N.y; } // cout << " v =" << v << endl; ffassert(v.N() == k); } void set2zero (double *p, int k) { for (int i = 0; i < k; ++i) { p[i] = 0.; } } #define P3(a, b, c) a *b *c // #define P3aaa(a) a*a*a // #define P3abb(a,b) a*b*b // #define P3aaax(a) 3*a*a*a##x // #define P3aaaxy(a) 6*a*a##x*a##y #define P3abcx(x, a, b, c) a ## x *b *c + a * b ## x * c + a * b * c ## x #define P3abcxy(x, y, a, b, c) a ## x *b ## y *c + a ## y * b ## x * c + a ## y * b * c ## x + a ## x * b * c ## y + a * b ## x * c ## y + a * b ## y * c ## x #define P3abcxyz(x, y, z, a, b, c) a ## x *b ## y *c ## z + a ## y * b ## x * c ## z + a ## y * b ## z * c ## x + a ## x * b ## z * c ## y + a ## z * b ## x * c ## y + a ## z * b ## y * c ## x // #define P3abbx(x,a,b) a##x*b*b+2*a*b*b##x // #define P3abbxy(x,y,a,b) 2*a##x*b##y*b + 2*a##y*b*b##x + 2*a*b##y*b##x #define P3X(a, b, c) P3abcx(x, a, b, c) #define P3Y(a, b, c) P3abcx(y, a, b, c) #define P3XY(a, b, c) P3abcxy(x, y, a, b, c) #define P3XX(a, b, c) P3abcxy(x, x, a, b, c) #define P3YY(a, b, c) P3abcxy(y, y, a, b, c) #define P3XXX(a, b, c) P3abcxyz(x, x, x, a, b, c) #define P3YYY(a, b, c) P3abcxyz(y, y, y, a, b, c) #define P3XXY(a, b, c) P3abcxyz(x, x, y, a, b, c) #define P3XYY(a, b, c) P3abcxyz(x, y, y, a, b, c) #define LL10(P3) {P3(li, li, li), P3(li1, li1, li1), P3(li2, li2, li2), \ P3(li, li, li2), P3(li, li, li1), \ P3(li1, li1, li), P3(li1, li1, li2), \ P3(li2, li2, li1), P3(li2, li2, li), \ P3(li, li1, li2)} \ void TypeOfFE_HCT::FB (const bool *whatd, const Mesh &, const Triangle &K, const R2 &P, RNMK_ &val) const { typedef double R; double area = K.area; int Nop = val.K(); // cout << "Nop = " << Nop << " " << whatd[op_id] << whatd[op_dx] << whatd[op_dy] << whatd[op_dxx] << whatd[op_dxy] << whatd[op_dyy]<< endl; R2 A(K[0]), B(K[1]), C(K[2]); R l[3] = {1 - P.x - P.y, P.x, P.y}; R2 Dl[3] = {K.H(0), K.H(1), K.H(2)}; R2 E[3] = {K.Edge(0), K.Edge(1), K.Edge(2)}; R lg2[3] = {E[0].norme2(), E[1].norme2(), E[2].norme2()}; R lg[3] = {sqrt(lg2[0]), sqrt(lg2[1]), sqrt(lg2[2])}; R eta[3] = {(lg2[2] - lg2[1]) / lg2[0], (lg2[0] - lg2[2]) / lg2[1], (lg2[1] - lg2[0]) / lg2[2]}; // double l2E[3]={ (E[0],E[0]), (E[1],E[1]), (E[2],E[2]) }; // double lE[3]={ sqrt(l2E[0]), sqrt(l2E[1]), sqrt(l2E[2]) }; double sgE[3] = {K.EdgeOrientation(0), K.EdgeOrientation(1), K.EdgeOrientation(2)}; // $ w_{3+i} = ccc[i] * ( li-2*li*li) $ // donc $ D(w_i) = ccc[i] (1-2*li) Dl[i] $ // we must have $$ int_{e_i} dn(w_{3+j) ) = \delta_{ij} $ // $int_e_i dn(w_{3+i} ) = ccc[i] (Dl[i],Ne[i]) = 1 $ // $ ccc[i] = 1/ (Dl[i],Ne[i]) $ /* * R2 Ne[3]= { * E[0].perp() *sgE[0], * E[1].perp() *sgE[1], * E[2].perp() *sgE[2] * };*/ val = 0; throwassert(val.N() >= 6); throwassert(val.M() == 3); int i0 = 0; if (l[1] < l[i0]) {i0 = 1;} if (l[2] < l[i0]) {i0 = 2;} int i1 = (i0 + 1) % 3, i2 = (i0 + 2) % 3; // cout << " NMK= "< op_dxx) { val('.', 1, op_dxx) = NAN; val('.', 2, op_dxx) = NAN; } if (Nop > op_dyy) { val('.', 1, op_dyy) = NAN; val('.', 2, op_dyy) = NAN; } if (Nop > op_dxy) { val('.', 1, op_dxy) = NAN; val('.', 2, op_dxy) = NAN; } } // a static variable to add the finite element to freefem++ static TypeOfFE_HCT Lagrange_HCT; static AddNewFE FE_HCT("HCT", &Lagrange_HCT); } // FEM2d namespace // --- fin -- freefem++-3.61-1/examples++-load/glumesh3D.edp000644 000767 000024 00000002311 13256636774 021026 0ustar00hechtstaff000000 000000 load "msh3" real x0=-1.,x1=-0.5; real y0=-0.5,y1=0.5; mesh Th1=square(5,8,[x0+(x1-x0)*x,y0+(y1-y0)*y]); x0=-0.5; x1=-0.1; y0=-1; y1=1; mesh Th2=square(10,16,[x0+(x1-x0)*x,y0+(y1-y0)*y]); int[int] r1=[2,0], r2=[4,0]; Th1=change(Th1,label=r1); Th2=change(Th2,label=r2); plot( Th1, Th2, wait=1 ); verbosity=2; cout << "================" << endl; cout << " gluing mesh " << endl; mesh Th2D=Th1+Th2; cout << "Vertex, Triangle, Border " << Th2D.nv << " "<< Th2D.nt << " " << endl; //plot( Th2D, wait=1 ); savemesh( Th2D, "glu2D.mesh"); func zmin=0.; func zmax=1.; int MaxLayer=10; mesh3 Th31=buildlayers(Th1,MaxLayer,zbound=[zmin,zmax]); savemesh( Th31, "bl31.mesh"); mesh3 Th32=buildlayers(Th2,MaxLayer,zbound=[zmin,zmax]); savemesh( Th32, "bl32.mesh"); mesh3 Tht=Th31+Th32; savemesh( Tht, "glu3D.mesh"); cout << "Vertex, Tet, Triangle " << Tht.nv << " "<< Tht.nt << " " << Tht.nbe << endl; cout << "area border = " << int2d(Tht)(1.) << endl; verbosity =3; Tht = change(Tht,rmInternalFaces=1); cout << "area border = " << int2d(Tht)(1.) <. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "libff-mmap-semaphore.h" #include #include #include #ifdef __cplusplus extern "C" { #endif long ff_mmap_sem_verb = 1; void (*libf_HandleError)(const char *, int err) = 0; static char*newstringcpy (const char *nm) { char *p = (char *)malloc(strlen(nm) + 1); strcpy(p, nm); return p; } static char*newstringcpyadds (const char *nm) { char *p = (char *)malloc(strlen(nm) + 2); if (nm[0] != '/') { /* add / */ strcpy(p, "/"); strcat(p, nm); } else { strcpy(p, nm); } return p; } void ffDoError (const char *msg, int err) { if (libf_HandleError) {(*libf_HandleError)(msg, err);} printf(" Error libff-mmap-semaphore: %s Err: %d\n", msg, err); exit(1); } void ffsem_destroy (ff_Psem p) { if (ff_mmap_sem_verb > 9) {printf(" ** ffsem_destroy %s unlink: %d\n", p->nm, p->creat);} int err = 0; if (p->creat) {err = sem_unlink(p->nm);} if (err == -1) {perror("ff/sem: sem_unlink");} if (p->sem) {err = sem_close(p->sem);} if (err == -1) {perror("ff/sem: sem_close");} if (p->nm) {free((void *)p->nm);} p->nm = 0; p->sem = 0; } void ffsem_destroy_ (long *p) { ffsem_destroy(*(ff_Psem *)p); } void ffsem_init0 (ff_Psem p) { p->sem = 0; p->nm = 0; p->creat = 0; } void ffsem_init0_ (long *p) { ffsem_init0(*(ff_Psem *)p); } ff_Psem ffsem_malloc () { ff_Psem p = (ff_Psem)malloc(sizeof(struct FF_P_sem)); p->sem = 0; p->nm = 0; p->creat = 0; return p; } void ffsem_del (ff_Psem p) { ffsem_destroy(p); free(p); } void ffsem_del_ (long *p) { ffsem_del(*(ff_Psem *)p); } void ffsem_init (ff_Psem p, const char *nm, int crea) { p->creat = crea; p->nm = newstringcpyadds(nm); if (crea) { unlink(p->nm); p->sem = sem_open(p->nm, O_CREAT, 0660, 0); } else { p->sem = sem_open(p->nm, 0, 0, 0); } if (p->sem == SEM_FAILED) { p->sem = 0; printf(" err sem open %s \n", p->nm); perror("sem_open"); ffsem_destroy(p); ffDoError("Error sem_open", 1001); } } void ffsem_init_ (long *pp, const char *nm, int *crea, int lennm) { ff_Psem *p = (ff_Psem *)pp; *p = ffsem_malloc(); ffsem_init(*p, nm, *crea); } long ffsem_post (ff_Psem p) { int err = sem_post(p->sem); if (err == -1) { perror("ff/sem: sem_post"); ffDoError("sem_post", 1002); } return err; } void ffsem_post_ (long *p, long *ret) { *ret = ffsem_post(*(ff_Psem *)p); } long ffsem_wait (ff_Psem p) { int err = sem_wait(p->sem); if (err == -1) { perror("ff/sem: sem_wait"); ffDoError("sem_post", 1003); } return err; } void ffsem_wait_ (long *p, long *ret) { *ret = ffsem_wait(*(ff_Psem *)p); } long ffsem_trywait (ff_Psem p) { int err = sem_trywait(p->sem); if (err == -1) { perror("ff/sem: sem_trywait"); ffDoError("sem_post", 1004); } return err; } void ffsem_trywait_ (long *p, long *ret) { *ret = ffsem_trywait(*(ff_Psem *)p); } ff_Pmmap ffmmap_malloc () { ff_Pmmap p = (ff_Pmmap)malloc(sizeof(struct FF_P_mmap)); ffmmap_init0(p); return p; } void ffmmap_del (ff_Pmmap p) { ffmmap_destroy(p); free(p); } void ffmmap_del_ (long *p) { ffmmap_del(*(ff_Pmmap *)p); } void ffmmap_destroy (ff_Pmmap p) { if (ff_mmap_sem_verb > 9) {printf(" ** ffmmap_destroy %s len: %lu new: %d\n", p->nm, (unsigned long)p->len, p->isnew);} if (p->map && munmap(p->map, p->len) == -1) { printf(" **Error munmap %s %zu\n", p->nm, p->len); perror("munmap"); ffDoError("munmap", 1005); } if (p->fd > 0) {close(p->fd);} if (p->isnew) {unlink(p->nm);} if (p->nm) {free((void *)p->nm);} p->len = 0; p->fd = 0; p->nm = 0; } void ffmmap_destroy_ (long *p) { ffmmap_destroy(*(ff_Pmmap *)p); } void ffmmap_init0 (ff_Pmmap p) { p->len = 0; p->nm = 0; p->fd = 0; p->map = 0; p->isnew = 0; } void ffmmap_init0_ (long *p) { ffmmap_init0(*(ff_Pmmap *)p); } long ffmmap_msync (ff_Pmmap p, long off, long ln) { if (ln == 0) { ln = p->len - off; // } return msync((char *)p->map + off, ln, MS_SYNC); } void ffmmap_msync_ (long *p, int *off, int *ln, long *ret) { *ret = ffmmap_msync(*(ff_Pmmap *)p, *off, *ln); } void ffmmap_init (ff_Pmmap p, const char *nm, long len) { void *addr = 0; p->len = len; p->nm = newstringcpy(nm); // shm_unlink p->map = 0; p->fd = open(p->nm, O_RDWR | O_CREAT, (mode_t)0666); if (p->fd == -1) { printf(" Error opening file mmap %s len = %zu \n", p->nm, p->len); perror("open"); ffmmap_destroy(p); ffDoError("opening mmap", 2001); } off_t size = lseek(p->fd, 0, SEEK_END); // seek to end of file p->isnew = (size == 0); printf(" len %ld size %lld \n", len, size); if (size < len) { if (ftruncate(p->fd, len) == -1) { perror("ftruncate"); printf("Error ftrucated the file %s len = %zu \n", p->nm, p->len); ffmmap_destroy(p); ffDoError("Error ftrucated ", 2002); } } else { p->len = size; } p->map = mmap(addr, p->len, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, p->fd, 0); if (p->map == MAP_FAILED) { p->map = 0; printf("Error mmapping the file %s len = %zu\n", p->nm, p->len); ffDoError("Error mmapping ", 2003); } } void ffmmap_init_ (long *pp, const char *nm, int *len, int lennm) { ff_Pmmap *p = (ff_Pmmap *)pp; *p = ffmmap_malloc(); ffmmap_init(*p, nm, *len); } long ffmmap_read (ff_Pmmap p, void *pt, size_t ln, long off) { if (off < 0 || off + ln > p->len) { printf("Fatal Error: ffmmap_read ff mmap out of bound len = %zu < %lu + %ld \n", p->len, (unsigned long)ln, off); ffDoError(" Error out of bound ", 2004); } void *pk = (char *)p->map + off; memcpy(pt, pk, ln); long *pp = (long *)pt; if (ff_mmap_sem_verb > 9) {printf(" R %ld %ld %lu %p\n", *pp, off, (unsigned long)ln, pk);} return ln; } void ffmmap_read_ (long *p, void *pt, int *ln, int *off, long *ret) { *ret = ffmmap_read(*(ff_Pmmap *)p, pt, *ln, *off); printf("ffmmap_read_ %ld %f %d\n", *(long *)pt, *(double *)pt, *off); } long ffmmap_write (ff_Pmmap p, void *pt, size_t ln, long off) { if (off < 0 || off + ln > p->len) { printf("Fatal Error: ffmmap_write ff mmap out of bound len = %zu < %lu + %ld \n", p->len, (unsigned long)ln, off); ffDoError(" Error out of bound ", 2005); } void *pk = (char *)p->map + off; memcpy(pk, pt, ln); long *pp = (long *)pk; if (ff_mmap_sem_verb > 9) {printf(" W %ld %ld %lu %p\n", *pp, off, (unsigned int)ln, pk);} return ln; } void ffmmap_write_ (long *p, void *pt, int *ln, int *off, long *ret) { printf("ffmmap_write_ %ld %f %d \n", *(long *)pt, *(double *)pt, *off); *ret = ffmmap_write(*(ff_Pmmap *)p, pt, *ln, *off); } #ifdef __cplusplus } #endif freefem++-3.61-1/examples++-load/provadxw.edp000644 000767 000024 00000000430 13256636774 021045 0ustar00hechtstaff000000 000000 // test of DxWriter from Sala Lorenzo. load "DxWriter" mesh Th=square(5,5); DxWriter ff("pippo"); Dxaddmesh(ff, Th); Dxaddtimeseries(ff, "Vx",Th); fespace Vh(Th, P1); real t=1.0; Vh vx=x*y*t; Dxaddsol2ts(ff,"Vx",t, vx); t=2.0; vx=x*y*t; Dxaddsol2ts(ff,"Vx",t, vx); cout<<"Hello";freefem++-3.61-1/examples++-load/ch.pts000644 000767 000024 00000011306 13256636774 017627 0ustar00hechtstaff000000 000000 160 95.91494000000001 70.24874 19.99927 95.45166999999999 78.0317 19.99927 88.64861000000001 72.35452 19.99927 95.91494000000001 70.24874 .0 88.64861000000001 72.35452 .0 95.45166999999999 78.0317 .0 101.609 73.69660000000001 19.99927 101.609 73.69660000000001 .0 102.3193 64.70634 19.99927 110.7396 73.23895 19.99927 102.3193 64.70634 .0 110.7396 73.23895 .0 111.6493 63.57484 19.99927 111.6493 63.57484 .0 103.681 83.57972 19.99927 103.681 83.57972 .0 114.881 84.66911 19.99927 114.881 84.66911 .0 88.66826 43.20776 14.99875 100.9997 42.99999 14.99875 100.9997 42.99999 19.99927 88.66826 43.20776 19.99927 96.14236 53.88265 19.99927 88.66826 43.20776 7.999145 100.9997 42.99999 7.999145 88.66826 43.20776 .0 100.9997 42.99999 .0 96.14236 53.88265 .0 84.49039000000001 53.74788000000001 19.99927 84.49039000000001 53.74788000000001 .0 88.10390999999999 82.75706 19.99927 88.10390999999999 82.75706 .0 79.39442 77.52911 19.99927 79.39442 77.52911 .0 82.32566 87.46838 19.99927 82.32566 87.46838 .0 88.00002000000001 94.99863999999999 19.99927 88.00002000000001 94.99863999999999 .0 81.42439 94.15633 19.99927 74.65782 88.72342999999999 19.99927 81.42439 94.15633 .0 74.65782 88.72342999999999 .0 77.99899000000001 99.99916000000001 19.99927 77.99899000000001 99.99916000000001 .0 81.28679999999999 64.85234 19.99927 81.28679999999999 64.85234 .0 71.0415 68.59220000000001 19.99927 71.0415 68.59220000000001 .0 69.66011 78.88523999999999 19.99927 59.64223 74.05317999999999 19.99927 59.64223 74.05317999999999 .0 69.66011 78.88523999999999 .0 63.99978 61.49994 14.99875 63.99978 52.56022 14.99875 63.99978 52.56022 19.99927 63.99978 61.49994 19.99927 72.19266 55.38196 19.99927 63.99978 61.49994 7.999145 63.99978 52.56022 7.999145 63.99978 61.49994 .0 63.99978 52.56022 .0 72.19266 55.38196 .0 120.2493 94.99863999999999 14.99875 109.4986 94.99863999999999 14.99875 109.4986 94.99863999999999 19.99927 120.2493 94.99863999999999 19.99927 120.2493 94.99863999999999 7.999145 109.4986 94.99863999999999 7.999145 120.2493 94.99863999999999 .0 109.4986 94.99863999999999 .0 124.7388 84.97795 19.99927 124.7388 84.97795 .0 131.0 74.19918 14.99875 131.0 84.59892 14.99875 131.0 84.59892 19.99927 131.0 74.19918 19.99927 131.0 74.19918 7.999145 131.0 84.59892 7.999145 131.0 74.19918 .0 131.0 84.59892 .0 120.3813 76.59695999999999 19.99927 120.3813 76.59695999999999 .0 68.25064999999999 97.50031 14.99875 58.49949000000001 94.99863999999999 14.99875 58.49949000000001 94.99863999999999 19.99927 68.25064999999999 97.50031 19.99927 63.59267 86.34530999999999 19.99927 68.25064999999999 97.50031 7.999145 58.49949000000001 94.99863999999999 7.999145 68.25064999999999 97.50031 .0 58.49949000000001 94.99863999999999 .0 63.59267 86.34530999999999 .0 94.80028000000001 86.72153 19.99927 94.80028000000001 86.72153 .0 120.6199 66.43869 19.99927 116.0012 57.99874 19.99927 120.6199 66.43869 .0 116.0012 57.99874 .0 91.54334 63.0891 19.99927 91.54334 63.0891 .0 108.4991 55.99123000000001 19.99927 108.4991 55.99123000000001 .0 76.33401999999999 43.41272 19.99927 76.33401999999999 43.41272 .0 63.99978 43.62049 14.99875 63.99978 43.62049 19.99927 63.99978 43.62049 7.999145 63.99978 43.62049 .0 76.33401999999999 43.41272 14.99875 76.33401999999999 43.41272 7.999145 98.75071999999999 94.99863999999999 14.99875 88.00002000000001 94.99863999999999 14.99875 98.75071999999999 94.99863999999999 19.99927 98.75071999999999 94.99863999999999 7.999145 88.00002000000001 94.99863999999999 7.999145 98.75071999999999 94.99863999999999 .0 131.0 94.99863999999999 14.99875 131.0 94.99863999999999 19.99927 131.0 94.99863999999999 7.999145 131.0 94.99863999999999 .0 84.11697 99.73524000000001 14.99875 77.99899000000001 99.99916000000001 14.99875 84.11697 99.73524000000001 19.99927 84.11697 99.73524000000001 7.999145 77.99899000000001 99.99916000000001 7.999145 84.11697 99.73524000000001 .0 59.64223 74.05317999999999 14.99875 59.64223 74.05317999999999 7.999145 50.87939 84.04298000000001 19.99927 50.87939 84.04298000000001 .0 131.0 42.99999 14.99875 131.0 53.39972 14.99875 131.0 53.39972 19.99927 131.0 42.99999 19.99927 123.5006 55.99123000000001 19.99927 123.5006 55.99123000000001 14.99875 131.0 42.99999 7.999145 131.0 53.39972 7.999145 123.5006 55.99123000000001 7.999145 131.0 42.99999 .0 131.0 53.39972 .0 123.5006 55.99123000000001 .0 131.0 63.79945 19.99927 131.0 63.79945 .0 131.0 63.79945 14.99875 131.0 63.79945 7.999145 116.0012 57.99874 14.99875 116.0012 57.99874 7.999145 48.75115 92.49979 14.99875 48.75115 92.49979 19.99927 48.75115 92.49979 7.999145 48.75115 92.49979 .0 50.87939 84.04298000000001 14.99875 50.87939 84.04298000000001 7.999145 39.0 90.00093 14.99875 39.0 90.00093 19.99927 39.0 90.00093 7.999145 39.0 90.00093 .0 108.4991 55.99123000000001 14.99875 108.4991 55.99123000000001 7.999145 freefem++-3.61-1/examples++-load/ffrandom.edp000644 000767 000024 00000000507 13256636774 020774 0ustar00hechtstaff000000 000000 load "ffrandom" srandomdev(); // warning under window this // change the seed by randinit(random()) ) so all // freefem++ random function are change.. cout << random() << endl; cout << random() << endl; cout << random() << endl; srandom(10); cout << random() << endl; cout << random() << endl; cout << random() << endl; freefem++-3.61-1/examples++-load/cube.edp000644 000767 000024 00000003370 13256636774 020117 0ustar00hechtstaff000000 000000 // august 2015 add load "msh3" // DEF LABEL unit CUBE before transformation // 6 face plan label are: // y = 0 ) label 1, // x = 1 ) label 2, // y = 1 ) label 3, // x = 0 ) label 4, // z = 0 ) label 5, // z = 1 ) label 6. // the region numbering is 0 by default. { real[int,int] mm= [ [0.5,0.0,0.5], [1.0,0.5,0.5], [0.5,1.0,0.5], [0.0,0.5,0.5], [0.5,0.5,0.0], [0.5,0.5,1.0] ]; int[int] l6=[1,2,3,4,5,6]; mesh3 Th=cube(2,2,2); //[x*4,y*1+0.1*sin(4*pi*x)]); for (int i=1; i< 7; ++i) { real s = int2d(Th,i)(1.); real mx = int2d(Th,i)(x); real my = int2d(Th,i)(y); real mz = int2d(Th,i)(z); cout<< i << " " << s << " "<< mx << " " << my << " " << mz << endl; int j=i-1; real err= abs(mx-mm(j,0)) + abs(my-mm(j,1)) + abs(mz-mm(j,2)) ; assert(err< 0.1); } } int[int] l6=[37,42,45,40,25,57]; int r11=11; mesh3 Th=cube(4,5,6,[x*2-1,y*2-1,z*2-1],label=l6,flags =3,region=r11); cout << " volume " << Th.measure << ", border area "<< Th.bordermeasure < face min 0 , face max 2 , no face 1 cout <<" label="<< i << " s " << s << " " << ix << iy << iz << " : " << ii << endl; if( i != ii ) err++; } } real volr11 = int3d(Th,r11)(1.) ; cout << " vol region " << 11 << ": " << volr11 << endl; if( (volr11 - Th.measure )>1e-8) err++; plot(Th,fill=0); cout << " nb err= " << err < a S + b tr(S) Id */ [ [ a + b , 0 , 0 ,b ], [ 0 , a , 0 ,0 ], [ 0 , 0 , a ,0 ], [ b , 0 , 0 , a+ b ] ] // func A = BItr(twomu,lambda) ; func A1 = BItr(mu1,lambda1) ; real gravity = -9.81*rho; macro Strain(u) [dx(u#1),(dy(u#1)+dx(u#2))/2,(dy(u#1)+dx(u#2))/2,dy(u#2)] //EOM macro Strain2(s) [s#11, s#12, s#12, s#22] //EOM macro S(s) [s#11,s#12,s#22]// macro U(u) [u#1,u#2] // macro dn(u) (U(u)'*[N.x,N.y]) //') macro dnn(s) ( [N.x,N.y]' * [[ s#11,s#12] , [s#12, s#22] ] *[N.x,N.y]) //') fespace Wh(Th,[P2,P2]); fespace Sh(Th,TDNNS1); fespace Vh(Th,BDM1Ortho); Sh S(s),S(t); Vh U(u),U(v);; Wh U(w),U(ww); solve Lame2([s11,s12,s22,u1,u2],[t11,t12,t22,v1,v2])= int2d(Th)( Strain2(s)'*(A1*Strain2(t)) //' - Strain(u)'*Strain2(t) //' - Strain(v)'*Strain2(s) //' // + 1e-6*(u1*v2+u2*v2) ) + intalledges(Th)( dnn(t)*dn(u) + dnn(s)*dn(v) ) // - int1d(Th,4) ( 0*dnn(t) ) // here 0 <=> U_d .n * dnn(t) + int2d(Th) ( gravity*v2) //-int2d(Th,1,2,3) ( dNtau(t). v.tau) +on(1,2,3,s11=0,s12=0,s22=0) +on(4,u1=0,u2=0); solve Lame1([w1,w2],[ww1,ww2])= int2d(Th)( Strain(w)'*(A*Strain(ww)) //' ) -int2d(Th)(gravity*ww2) +on(4,w1=0,w2=0); plot([w1,w2], wait=1); plot([u1,u2], wait=1); real errl2 = sqrt(int2d(Th)( square(w1-u1) + square(w2-w2))); cout << " errL2 = " << errl2 << endl; freefem++-3.61-1/examples++-load/test-ElementMixte.edp000644 000767 000024 00000013643 13256636774 022562 0ustar00hechtstaff000000 000000 load "Element_P4" load "Element_Mixte" load "Element_PkEdge" macro DD(f,hx,hy) ( (f(x1+hx,y1+hy)-f(x1-hx,y1-hy))/(2*(hx+hy))) // macro dn(f) ( N.x*dx(f)+N.y*dy(f)) // macro ccn(f) ( N.x*f#1+N.y*f#2) // macro cctau(f) ( -N.y*f#1+N.x*f#2) // macro dnn(f) ( N.x*N.x*f#11+2.*N.y*N.x*f#12+ N.y*N.y*f#22) // mesh Th=square(1,1,flags=1);//,[10*(x+y/3),10*(y-x/3)]); Th=trunc(Th,(x+y)<1.1);plot(Th,wait=1); Th=movemesh(Th,[0.1*(x+y/3),0.1*(y-x/3)]); Th=movemesh(Th,[0.1*(x),0.1*(y)]); real x1=0.7,y1=0.9, h=1e-6; int it1=Th(x1,y1).nuTriangle; fespace Zh(Th,P1dc); Zh f11= 1, f12=0, f22=0; fespace Vh(Th,TDNNS1); cout << Vh.ndof << endl; cout << Vh.ndofK << endl; fespace Eh(Th,P0edge); fespace Ehdc(Th,P0edgedc); fespace P3h(Th,[P0,P0,P0]); Eh edges; macro SS(a) [a#11,a#12,a#22] // P3h SS(pp); Vh SS(a),SS(b),SS(c); varf vFlux([ax11,ax12,ax22],[e]) = intalledges(Th,qforder=1)( dnn(a)*e*lenEdge); edges=x; cout << " x = " << edges[]<< endl; edges=y; cout << " y = " << edges[]<< endl; real gx=1./3., gy(1./3); for(int j=0; j G " << Vh(0,i) << endl; macro diff(err,dd,c,a,s) { real ddd = int2d(Th) (square( dd(a)-dd(c))) ; cout << " ddd " << s << " : " <1e-10) err++ ;} // int err=0; for (int i=0;i 1e-10) {err1++; cout << j<< " " << i << " err disc " << ddcc << endl; Eh0 eee; eee[]=veeee(0,Eh0); plot(eee,cmm=" jump ",fill=1,wait=1); mesh Tg=trunc(Th,1,split=5); fespace WWh(Tg,P2dc); WWh gu1=u1,gu2=u2; plot([gu1,gu2],wait=1,cmm=" dof "+j+" K=0 ");} w1[][i]-=1; if(w1[].linfty > 1e-10) { w1[][i]+=1;cout << j << " " << i << " diff = " << w1[] << endl;} cout << " ||w - (\delta_ij)_j= || " << w1[].linfty << endl; assert( w1[].linfty < 1e-10); NewMacro diff2(op) int2d(Th)(square(op(u1)-op(U1))+square(op(u2)-op(U2))) EndMacro assert( diff2( 0+ )) ; assert( diff2(dx)) ; assert( diff2(dy)) ; } assert(err1==0); Th=square(5,5,[10*(x+y/3),10*(y-x/3)]); V(u)=[0,0]; V(w)=[0,0]; func p1=2+x+y*2; func uu1 = 1+xx*p1; func uu2 = 2+yy*p1; [u1,u2] = [uu1 ,uu2]; cout << int2d(Th)( square(uu1-u1) )/ Th.area << endl; cout << int2d(Th)( square(uu2-u2) )/Th.area << endl; plot([u1,u2],wait=1); for( int i=0;i. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Sylvain Auliac // E-MAIL : auliac@ann.jussieu.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: cmaes.cpp // *INDENT-ON* // /* * This is a freefem interface of the Hansen's CMA-ES C optimizer. * The class CMAES is a quick C++ interface for the contents of the C files * then follow the real FreeFem++ stuff. */ #include using namespace std; #include "ff++.hpp" #include "cmaes_interface.h" class CMAES // Abstract class, because the fitness function prototype may differ from users to users { public: // typedef double (*FFT)(double const *); //Fitness Function Type CMAES (): pop(0), fitvals(0), evo() {} CMAES (int d, double *xstart, double *stddev, long seed, int lambda, const char *ipf = "initials.par"): pop(0), fitvals(0), evo() { fitvals = init(d, xstart, stddev, seed, lambda, ipf); cout << SayHello() << endl; } virtual ~CMAES () {exit();} void resume_distribution (char *filename) {return cmaes_resume_distribution(&evo, filename);} double *const *&SamplePopulation () {return pop = cmaes_SamplePopulation(&evo);} double*UpdateDistribution () {return cmaes_UpdateDistribution(&evo, fitvals);} const char*TestForTermination () const {return cmaes_TestForTermination(&evo);} double *const *&ReSampleSingle (int index) {return pop = cmaes_ReSampleSingle(&evo, index);} double const*ReSampleSingle_old (double *rgx) {return cmaes_ReSampleSingle_old(&evo, rgx);} void UpdateEigensystem (int flgforce) {return cmaes_UpdateEigensystem(&evo, flgforce);} virtual void PopEval () = 0; // {for(int i=0;i(cmaes_GetPtr(&evo, "diag(C)"));} double*diagD () const {return const_cast(cmaes_GetPtr(&evo, "diag(D)"));} double*stddev () const {return const_cast(cmaes_GetPtr(&evo, "stddev"));} double*xbestever () const {return const_cast(cmaes_GetPtr(&evo, "xbestever"));} double*xbest () const {return const_cast(cmaes_GetPtr(&evo, "xbest"));} double*xmean () const {return const_cast(cmaes_GetPtr(&evo, "xmean"));} void ReadSignals (char const *filename) const {cmaes_ReadSignals(&evo, filename);} char*SayHello () const {return cmaes_SayHello(&evo);} void WriteToFile (char const *keyword, char const *output_filename) const {cmaes_WriteToFile(&evo, keyword, output_filename);} virtual double *operator () () { // ReadSignals("signals.par"); while (!TestForTermination()) { SamplePopulation(); PopEval(); UpdateDistribution(); // ReadSignals("signals.par"); } cout << "Stop : " << TestForTermination() << endl; return xmean(); } cmaes_t&optimizer () {return evo;} protected: double *const *pop; double *fitvals; private: void exit () {cmaes_exit(&evo);} double *&init (int dimension, double *xstart, double *stddev, long seed, int lambda, const char *input_parameter_filename) {return fitvals = cmaes_init(&evo, dimension, xstart, stddev, seed, lambda, input_parameter_filename);} mutable cmaes_t evo; }; /* * Now comes the FreeFem ++ part : */ extern Block *currentblock; typedef double R; class OptimCMA_ES: public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; const int cas; class ffcalfunc // to call the freefem function .. J { public: Stack stack; Expression JJ, theparame; ffcalfunc (Stack s, Expression JJJ, Expression epar): stack(s), JJ(JJJ), theparame(epar) {} double J (Kn_ x) const { KN *p = GetAny *>((*theparame)(stack)); *p = x; double ret = GetAny((*JJ)(stack)); WhereStackOfPtr2Free(stack)->clean(); return ret; } }; class CMA_ES: public CMAES { public: typedef KN Rn; typedef KN_ Rn_; CMA_ES (): CMAES(), x(0), fit(0) {} /*CMA_ES(ffcalfunc &_ff,int d,Rn &xstart,double *stddev,long seed,int lambda) * : CMAES(d,xstart.n ? xstart:0,stddev,seed,lambda,"non"),x(&xstart),fit(&_ff) {} * CMA_ES(ffcalfunc &_ff,int d,Rn &xstart,const Rn &stddev,long seed,int lambda) * : CMAES(d,xstart.n ? xstart:0,stddev,seed,lambda,"non"),x(&xstart),fit(&_ff) {}*/ CMA_ES (ffcalfunc &_ff, Rn &xstart, const Rn &stddev, long seed, int lambda) : CMAES(xstart.n, xstart, stddev, seed, lambda, "non"), x(&xstart), fit(&_ff) {} CMA_ES (ffcalfunc &_ff, Rn &xstart, const Rn &stddev, long seed, int lambda, const string &ipf) : CMAES(xstart.n, xstart, stddev, seed, lambda, ipf.c_str()), x(&xstart), fit(&_ff) {} void PopEval () {for (int i = 0; i < popsize(); ++i) {Rn_ popi(pop[i], dimension()); fitvals[i] = fit->J(popi);}} double *operator () () {return *x = Rn(x->n, CMAES::operator () ());} private: ffcalfunc *fit; Rn *x; }; class E_CMA_ES: public E_F0mps { public: const int cas; static basicAC_F0::name_and_type name_param []; static const int n_name_param = 11; Expression nargs[n_name_param]; Expression X; C_F0 inittheparam, theparam, closetheparam; Expression JJ; long arg (int i, Stack stack, long a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} R arg (int i, Stack stack, R a) const {return nargs[i] ? GetAny((*nargs[i])(stack)) : a;} E_CMA_ES (const basicAC_F0 &args, int cc): cas(cc) { int nbj = args.size() - 1; Block::open(currentblock); // make a new block to X = to(args[nbj]); C_F0 X_n(args[nbj], "n"); // the expression to init the theparam of all inittheparam = currentblock->NewVar("the parameter", atype *>(), X_n); theparam = currentblock->Find("the parameter"); // the expression for the parameter args.SetNameParam(n_name_param, name_param, nargs); const Polymorphic *opJ = 0; if (nbj > 0) { opJ = dynamic_cast(args[0].LeftValue()); assert(opJ); } JJ = to(C_F0(opJ, "(", theparam)); closetheparam = C_F0((Expression)Block::snewclose(currentblock), atype()); // closetheparam=currentblock->close(currentblock); // the cleanning block expression } virtual AnyType operator () (Stack stack) const { double cost = 1e100; WhereStackOfPtr2Free(stack) = new StackOfPtr2Free(stack); // FH mars 2005 Kn &x = *GetAny((*X)(stack)); long n = x.N(); long seed = arg(0, stack, 0L); // The seed for random numbers generation double initialStdDev = arg(1, stack, 0.3); // Initial standard deviation KN iSD(n, 1.); iSD *= initialStdDev; KN initialStdDevs(nargs[2] ? GetAny >((*nargs[2])(stack)) : (KN_)iSD); // cout << "dans le dylib :" << initialStdDevs << endl; double stopTolFun = arg(3, stack, 1.E-12); double stopTolFunHist = arg(4, stack, 0.); double stopTolX = arg(5, stack, 0.); double stopTolUpXFactor = arg(6, stack, 1.E3); long popsize = arg(7, stack, 4 + (long)floor(3 * log(n))); // long mu = arg(8,stack,popsize/2); string pipf = nargs[10] ? *GetAny((*nargs[10])(stack)) : string(""); long iprint = verbosity; ffcalfunc ffJ(stack, JJ, theparam); CMA_ES *optim = 0; if (pipf.size() > 0) { cout << "input file : " << pipf << endl; optim = new CMA_ES(ffJ, x, initialStdDevs, seed, popsize, pipf); } else { cout << "no input file " << endl; optim = new CMA_ES(ffJ, x, initialStdDevs, seed, popsize); long meval = arg(8, stack, static_cast(optim->maxeval())); long mgen = arg(9, stack, static_cast(optim->maxgen())); optim->optimizer().sp.stopTolFun = stopTolFun; optim->optimizer().sp.stopTolFunHist = stopTolFunHist; optim->optimizer().sp.stopTolX = stopTolX; optim->optimizer().sp.stopTolUpXFactor = stopTolUpXFactor; optim->optimizer().sp.stopMaxFunEvals = meval; optim->optimizer().sp.stopMaxIter = mgen; } (*optim)(); cost = optim->fitness(); x = KN_(optim->xbestever(), optim->dimension()); cout << "Number of fitness evalution(s) : " << optim->eval() << endl; closetheparam.eval(stack); // clean memory if (optim) {delete optim; optim = 0;} WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 return cost;// SetAny(0); Modif FH july 2005 } operator aType () const {return atype();} }; E_F0*code (const basicAC_F0 &args) const {return new E_CMA_ES(args, cas);} OptimCMA_ES (int c): OneOperator(atype(), atype(), atype *>()), cas(c) {} }; basicAC_F0::name_and_type OptimCMA_ES::E_CMA_ES::name_param [] = { {"seed", &typeid(long)}, {"initialStdDev", &typeid(double)}, {"initialStdDevs", &typeid(KN_)}, {"stopTolFun", &typeid(double)}, {"stopTolFunHist", &typeid(double)}, {"stopTolX", &typeid(double)}, {"stopTolUpXFactor", &typeid(double)}, {"popsize", &typeid(long)}, {"stopMaxFunEval", &typeid(long)}, {"stopMaxIter", &typeid(long)}, {"paramFile", &typeid(string *)} // {"mu", &typeid(long) } }; /* class Init { public: * Init(); * }; * * $1 */ static void Load_Init () { Global.Add("cmaes", "(", new OptimCMA_ES(1)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/gsl.cpp000644 000767 000024 00000046347 13312446271 017773 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // Example C++ function "myfunction", dynamically loaded into "load.edp" // *INDENT-OFF* // //ff-c++-LIBRARY-dep: gsl //ff-c++-cpp-dep: // *INDENT-ON* // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ff_gsl_awk.hpp" #include "gsl/gsl_version.h" struct GSLInterpolation { gsl_interp_accel *acc; gsl_spline *spline; double *xy; size_t n; const gsl_interp_type *splinetype; void init () {spline = 0; acc = 0; n = 0, xy = 0;} GSLInterpolation (): acc(0), spline(0), n(0), xy(0) {} void init (const KN_ &x, const KN_ &f, bool INIT = false, long cas = 0) { typedef const gsl_interp_type *cgsl_interpp; #if (GSL_MAJOR_VERSION < 2) static const cgsl_interpp gsl_interp_steffen = gsl_interp_cspline; #endif static cgsl_interpp interp [] = {gsl_interp_cspline, gsl_interp_akima, gsl_interp_steffen, gsl_interp_linear, gsl_interp_polynomial, gsl_interp_cspline_periodic, gsl_interp_akima_periodic}; if (INIT) {destroy();} ffassert(x.N() == f.N()); n = x.N(); splinetype = interp[cas]; xy = new double[n * 2]; for (long k = 0; k < n; ++k) { xy[k] = x[k]; xy[k + n] = f[k]; } spline = gsl_spline_alloc(splinetype, n); gsl_spline_init(spline, xy, xy + n, n); } void init (const KNM_ &kxy, bool INIT = false, long cas = 0) { init(kxy(0, ':'), kxy(1, ':'), INIT, cas); } void init (GSLInterpolation *g, bool INIT = false) { if (INIT) {destroy();} n = g->n; xy = new double[n * 2]; splinetype = g->splinetype; for (int i = 0; i < 2 * n; ++i) { xy[i] = g->xy[i]; } spline = gsl_spline_alloc(splinetype, n); gsl_spline_init(spline, xy, xy + n, n); } double bb (double xi) const {return max(min(xi, xy[n - 1]), xy[0]);} double eval (double xi) {return gsl_spline_eval(spline, bb(xi), acc);} double deval (double xi) {return gsl_spline_eval_deriv(spline, bb(xi), acc);} double ddeval (double xi) {return gsl_spline_eval_deriv2(spline, bb(xi), acc);} void destroy () { if (spline) {gsl_spline_free(spline);} if (acc) {gsl_interp_accel_free(acc);} if (xy) {delete [] xy;} init(); } ~GSLInterpolation () {destroy();} private:// no copy operator GSLInterpolation (const GSLInterpolation &); void operator = (const GSLInterpolation &); }; struct dGSLInterpolation { GSLInterpolation *p; dGSLInterpolation (GSLInterpolation *pp): p(pp) {} }; struct ddGSLInterpolation {GSLInterpolation *p; ddGSLInterpolation (GSLInterpolation *pp): p(pp) {} }; dGSLInterpolation dGSLInterpolationedef (GSLInterpolation *p) {return dGSLInterpolation(p);} ddGSLInterpolation ddGSLInterpolationedef (GSLInterpolation *p) {return ddGSLInterpolation(p);} GSLInterpolation*init_GSLInterpolation (GSLInterpolation *const &gi, KNM_ const &a) { gi->init(a, true); return gi; } GSLInterpolation*init_GSLInterpolation (GSLInterpolation *const &gi, KN_ const &a, KN_ const &b) { gi->init(a, b, true); return gi; } GSLInterpolation*init_GSLInterpolation (GSLInterpolation *const &gi, long const &cas, KNM_ const &a) { gi->init(a, true, cas); return gi; } GSLInterpolation*init_GSLInterpolation (GSLInterpolation *const &gi, long const &cas, KN_ const &a, KN_ const &b) { gi->init(a, b, true, cas); return gi; } GSLInterpolation*set_GSLInterpolation (GSLInterpolation *const &gi, KNM_ const &a) { gi->init(a, false); return gi; } GSLInterpolation*set_GSLInterpolation (GSLInterpolation *const &gi, GSLInterpolation *const &gj) { gi->init(gj, false); return gi; } GSLInterpolation*set_GSLInterpolation (GSLInterpolation *const &gi, KN_ const &a, KN_ const &b) { gi->init(a, b, false); return gi; } GSLInterpolation*set_GSLInterpolation (GSLInterpolation *const &gi, long const &cas, KNM_ const &a) { gi->init(a, false, cas); return gi; } GSLInterpolation*set_GSLInterpolation (GSLInterpolation *const &gi, long const &cas, KN_ const &a, KN_ const &b) { gi->init(a, b, false, cas); return gi; } double GSLInterpolationeval (GSLInterpolation *gi, double x) { return gi->eval(x); } double dGSLInterpolationeval (dGSLInterpolation gi, double x) { return gi.p->deval(x); } double ddGSLInterpolationeval (ddGSLInterpolation gi, double x) { return gi.p->ddeval(x); } long gslpolysolvequadratic (KN_ a, KN_ x) { ffassert(a.N() > 2 && x.N() > 1); return gsl_poly_solve_quadratic(a[2], a[1], a[0], &(x[0]), &(x[1])); } long gslpolysolvecubic (KN_ a, KN_ x) { ffassert(a.N() > 2 && x.N() > 2); return gsl_poly_solve_cubic(a[2], a[1], a[0], &(x[0]), &(x[1]), &(x[2])); } long gslpolycomplexsolve (KN_ a, KN_ x) { int n = a.N(); ffassert(n - 1 <= x.N()); KN z(n * 2); gsl_poly_complex_workspace *w = gsl_poly_complex_workspace_alloc(n); int ok = gsl_poly_complex_solve(&a[0], n, w, &z[0]); gsl_poly_complex_workspace_free(w); for (long i = 0; i < n - 1; i++) { x[i] = Complex(z[2 * i], z[2 * i + 1]); } return ok; } // Ramdom part.. AnyType init_GSLInterpolation (Stack, const AnyType &x) { GSLInterpolation *p = PGetAny(x); p->init(); return x; } AnyType delete_GSLInterpolation (Stack, const AnyType &x) { GSLInterpolation *p = PGetAny(x); p->destroy(); return x; } AnyType init_gsl_rng (Stack, const AnyType &x) { gsl_rng **pp = PGetAny(x); *pp = gsl_rng_alloc(gsl_rng_default); return x; }; AnyType delete_gsl_rng (Stack, const AnyType &x) { gsl_rng **pp = PGetAny(x); if (*pp) {gsl_rng_free(*pp);} *pp = 0; return Nothing; }; gsl_rng**init_gsl_rng_type (gsl_rng **pp, const gsl_rng_type *g) { *pp = gsl_rng_alloc(g); return pp; } gsl_rng**set_gsl_rng_type (gsl_rng **pp, const gsl_rng_type *g) { if (*pp) {gsl_rng_free(*pp);} *pp = gsl_rng_alloc(g); return pp; } gsl_rng**set_gsl_cpy (gsl_rng **pp, gsl_rng **gg) { if (*pp) {gsl_rng_free(*pp);} *pp = gsl_rng_clone(*gg); return pp; } double gslrnguniform (gsl_rng **pr) {return gsl_rng_uniform(*pr);} double gslrnguniformpos (gsl_rng **pr) {return gsl_rng_uniform_pos(*pr);} long gsl_rng_get (gsl_rng **pr) {return gsl_rng_get(*pr);} long gsl_rng_min (gsl_rng **pr) {return gsl_rng_min(*pr);} long gsl_rng_max (gsl_rng **pr) {return gsl_rng_max(*pr);} long gsl_rng_set (gsl_rng **pr, long s) {gsl_rng_set(*pr, s); return 0;} string*gsl_name (Stack s, const gsl_rng_type *const &pr) {return Add2StackOfPtr2Free(s, new string((*pr).name));} long ngslrng = 0; long gslabort = 1; static const gsl_rng_type **gsl_rngpp; const gsl_rng_type*gslrngtype (long i) { ffassert(i >= 0 && i < ngslrng); return gsl_rngpp[i]; } extern "C" { void ffhandler (const char *reason, const char *file, int line, int gsl_errno); } void ffhandler (const char *reason, const char *file, int line, int gsl_errno) { cerr << "\n GSL Error = " << reason << " in " << file << " at " << line << " err= " << gsl_errno << endl; if (gslabort) {ExecError("Gsl errorhandler");} } /* class Init { public: * Init(); * }; * $1 */ using namespace Fem2D; static void Load_Init () { Global.Add("gslpolysolvequadratic", "(", new OneOperator2, KN_ >(gslpolysolvequadratic)); Global.Add("gslpolysolvecubic", "(", new OneOperator2, KN_ >(gslpolysolvecubic)); Global.Add("gslpolycomplexsolve", "(", new OneOperator2, KN_ >(gslpolycomplexsolve)); /* spline gsl and June 2013 */ /* * Dcl_Type(::InitializePtr,::DeletePtr); * zzzfff->Add("gslbspline",atype()); * TheOperators->Add("<-", * new OneOperator3_ >(pBuilQFd), */ // a faire ... interface randon of gsl ... gsl_rng_env_setup(); gsl_rngpp = gsl_rng_types_setup(); for (long i = 0; gsl_rngpp[i]; ) { ngslrng = ++i; } Dcl_Type(init_gsl_rng, delete_gsl_rng); Dcl_Type(init_GSLInterpolation, delete_GSLInterpolation); Dcl_Type(); Dcl_Type(); Dcl_Type(); // gsl_rng_type Global.New("ngslrng", CConstant(ngslrng)); // // all gsl random generator .???? . /* * Global.New("gslrngborosh13",CConstant(gsl_rng_borosh13)); * Global.New("gslrngcoveyou",CConstant(gsl_rng_coveyou)); * Global.New("gslrngcmrg",CConstant(gsl_rng_cmrg)); * Global.New("gslrngfishman18",CConstant(gsl_rng_fishman18)); * Global.New("gslrngfishman20",CConstant(gsl_rng_fishman20)); * Global.New("gslrngfishman2x",CConstant(gsl_rng_fishman2x)); * Global.New("gslrnggfsr4",CConstant(gsl_rng_gfsr4)); * Global.New("gslrngknuthran",CConstant(gsl_rng_knuthran)); * Global.New("gslrngknuthran2",CConstant(gsl_rng_knuthran2)); * Global.New("gslrngknuthran2002",CConstant(gsl_rng_knuthran2002)); * Global.New("gslrnglecuyer21",CConstant(gsl_rng_lecuyer21)); * Global.New("gslrngminstd",CConstant(gsl_rng_minstd)); * Global.New("gslrngmrg",CConstant(gsl_rng_mrg)); * Global.New("gslrngmt19937",CConstant(gsl_rng_mt19937)); * Global.New("gslrngmt199371999",CConstant(gsl_rng_mt19937_1999)); * Global.New("gslrngmt199371998",CConstant(gsl_rng_mt19937_1998)); * Global.New("gslrngr250",CConstant(gsl_rng_r250)); * Global.New("gslrngran0",CConstant(gsl_rng_ran0)); * Global.New("gslrngran1",CConstant(gsl_rng_ran1)); * Global.New("gslrngran2",CConstant(gsl_rng_ran2)); * Global.New("gslrngran3",CConstant(gsl_rng_ran3)); * Global.New("gslrngrand",CConstant(gsl_rng_rand)); * Global.New("gslrngrand48",CConstant(gsl_rng_rand48)); * Global.New("gslrngrandom128bsd",CConstant(gsl_rng_random128_bsd)); * Global.New("gslrngrandom128glibc2",CConstant(gsl_rng_random128_glibc2)); * Global.New("gslrngrandom128libc5",CConstant(gsl_rng_random128_libc5)); * Global.New("gslrngrandom256bsd",CConstant(gsl_rng_random256_bsd)); * Global.New("gslrngrandom256glibc2",CConstant(gsl_rng_random256_glibc2)); * Global.New("gslrngrandom256libc5",CConstant(gsl_rng_random256_libc5)); * Global.New("gslrngrandom32bsd",CConstant(gsl_rng_random32_bsd)); * Global.New("gslrngrandom32glibc2",CConstant(gsl_rng_random32_glibc2)); * Global.New("gslrngrandom32libc5",CConstant(gsl_rng_random32_libc5)); * Global.New("gslrngrandom64bsd",CConstant(gsl_rng_random64_bsd)); * Global.New("gslrngrandom64glibc2",CConstant(gsl_rng_random64_glibc2)); * Global.New("gslrngrandom64libc5",CConstant(gsl_rng_random64_libc5)); * Global.New("gslrngrandom8bsd",CConstant(gsl_rng_random8_bsd)); * Global.New("gslrngrandom8glibc2",CConstant(gsl_rng_random8_glibc2)); * Global.New("gslrngrandom8libc5",CConstant(gsl_rng_random8_libc5)); * Global.New("gslrngrandombsd",CConstant(gsl_rng_random_bsd)); * Global.New("gslrngrandomglibc2",CConstant(gsl_rng_random_glibc2)); * Global.New("gslrngrandomlibc5",CConstant(gsl_rng_random_libc5)); * Global.New("gslrngrandu",CConstant(gsl_rng_randu)); * Global.New("gslrngranf",CConstant(gsl_rng_ranf)); * Global.New("gslrngranlux",CConstant(gsl_rng_ranlux)); * Global.New("gslrngranlux389",CConstant(gsl_rng_ranlux389)); * Global.New("gslrngranlxd1",CConstant(gsl_rng_ranlxd1)); * Global.New("gslrngranlxd2",CConstant(gsl_rng_ranlxd2)); * Global.New("gslrngranlxs0",CConstant(gsl_rng_ranlxs0)); * Global.New("gslrngranlxs1",CConstant(gsl_rng_ranlxs1)); * Global.New("gslrngranlxs2",CConstant(gsl_rng_ranlxs2)); * Global.New("gslrngranmar",CConstant(gsl_rng_ranmar)); * Global.New("gslrngslatec",CConstant(gsl_rng_slatec)); * Global.New("gslrngtaus",CConstant(gsl_rng_taus)); * Global.New("gslrngtaus2",CConstant(gsl_rng_taus2)); * Global.New("gslrngtaus113",CConstant(gsl_rng_taus113)); * Global.New("gslrngtransputer",CConstant(gsl_rng_transputer)); * Global.New("gslrngtt800",CConstant(gsl_rng_tt800)); * Global.New("gslrnguni",CConstant(gsl_rng_uni)); * Global.New("gslrnguni32",CConstant(gsl_rng_uni32)); * Global.New("gslrngvax",CConstant(gsl_rng_vax)); * Global.New("gslrngwaterman14",CConstant(gsl_rng_waterman14)); * Global.New("gslrngzuf",CConstant(gsl_rng_zuf)); * Global.New("gslrngdefault",CConstant(gsl_rng_default)); */ zzzfff->Add("gslrng", atype()); zzzfff->Add("gslspline", atype()); TheOperators->Add("<-", new OneOperator2(init_gsl_rng_type)); TheOperators->Add("<-", new OneOperator2_ >(init_GSLInterpolation)); TheOperators->Add("=", new OneOperator2_ >(set_GSLInterpolation)); TheOperators->Add("=", new OneOperator2_(set_GSLInterpolation)); TheOperators->Add("<-", new OneOperator3_, KN_ >(init_GSLInterpolation)); TheOperators->Add("<-", new OneOperator3_ >(init_GSLInterpolation)); TheOperators->Add("<-", new OneOperator4_, KN_ >(init_GSLInterpolation)); Add("(", "", new OneOperator2(GSLInterpolationeval)); Add("d", ".", new OneOperator1(dGSLInterpolationedef)); Add("dd", ".", new OneOperator1(ddGSLInterpolationedef)); Add("(", "", new OneOperator2(dGSLInterpolationeval)); Add("(", "", new OneOperator2(ddGSLInterpolationeval)); TheOperators->Add("=", new OneOperator2(set_gsl_rng_type)); TheOperators->Add("=", new OneOperator2(set_gsl_cpy)); // map_type[typeid(gsl_rng *).name()]->AddCast( new E_F1_funcT(UnRef) ); // map_type[typeid(gsl_rng *).name()]->AddCast( new E_F1_funcT(UnRef) ); Global.Add("gslrnguniform", "(", new OneOperator1(gslrnguniform)); Global.Add("gslrnguniformpos", "(", new OneOperator1(gslrnguniformpos)); Global.Add("gslname", "(", new OneOperator1s_(gsl_name)); Global.Add("gslrngget", "(", new OneOperator1(gsl_rng_get)); Global.Add("gslrngmin", "(", new OneOperator1(gsl_rng_min)); Global.Add("gslrngmax", "(", new OneOperator1(gsl_rng_max)); Global.Add("gslrngset", "(", new OneOperator2(gsl_rng_set)); Global.Add("gslrngtype", "(", new OneOperator1(gslrngtype)); init_gsl_sf(); gslabort = 1; Global.New("gslabortonerror", CConstant(&gslabort)); // static cgsl_interpp interp[] = {gsl_interp_cspline,gsl_interp_akima,gsl_interp_steffen,gsl_interp_linear,gsl_interp_polynomial,gsl_interp_cspline_periodic,gsl_interp_akima_periodic}; // type of spline of gsl ????? Global.New("gslinterpcspline", CConstant(0)); Global.New("gslinterpakima", CConstant(1)); Global.New("gslinterpsteffen", CConstant(2)); Global.New("gslinterplinear", CConstant(3)); Global.New("gslinterppolynomial", CConstant(4)); Global.New("gslinterpcsplineperiodic", CConstant(5)); Global.New("gslinterpakimaperiodic", CConstant(6)); gsl_set_error_handler(ffhandler); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/fortan_master.f90000644 000767 000024 00000001751 13312446271 021654 0ustar00hechtstaff000000 000000 program main integer*8 :: sem_ff, sem_fo, shd, status, ret double precision :: cff, rff integer :: i call ffsem_init(sem_ff,'ff-slave1'//achar(0),1) call ffsem_init(sem_fo,'ff-master1'//achar(0),1) call ffmmap_init(shd,'shared-data'//achar(0),1024) status=1 call system('FreeFem++ ffslave.edp -nw -ns &') call ffmmap_write(shd, status, 8, 8,ret) call ffmmap_msync(shd,0,32,ret) call ffsem_wait(sem_ff,ret) do i=1,10 cff=10+i call ffmmap_write(shd, cff, 8, 0,ret) write(*,*) 'bb ffsem_post' call ffsem_post(sem_fo,ret) write(*,*) 'bb ffsem_wait' call ffsem_wait(sem_ff,ret) call ffmmap_read(shd, rff, 8, 16,ret) write(*,*) 'iter',i,rff enddo status =0 call ffmmap_write(shd, status, 8, 8,ret) call ffsem_post(sem_fo,ret) write(*,*) 'Fin Master' call ffsem_wait(sem_ff,ret) write(*,*) 'Fin Freefem dans master' call ffsem_del(sem_ff) call ffsem_del(sem_fo) call ffmmap_del(shd) end freefem++-3.61-1/examples++-load/Leman-mesh.edp000644 000767 000024 00000002474 13256636774 021173 0ustar00hechtstaff000000 000000 load "ppm2rnm" load "isoline" string leman="lg.pgm"; real AreaLac = 580.03; // $Km^2$ real hsize= 5; real[int,int] Curves(3,1); int[int] be(1); int nc;// nb of curve { real[int,int] ff1(leman); // read image and set to an rect. array int nx = ff1.n, ny=ff1.m; // grey value beetween 0 to 1 (dark) // build a Cartesian mesh such that the origne is qt the right place. mesh Th=square(nx-1,ny-1,[(nx-1)*(x),(ny-1)*(1-y)]); // warning the numbering is of the vertices (x,y) is // given by $ i = x/nx + nx* y/ny $ fespace Vh(Th,P1); Vh f1; f1[]=ff1; // transforme array in finite element function. plot(f1,wait=1); nc=isoline(Th,f1,iso=0.25,close=1,Curves,beginend=be,smoothing=.1,ratio=0.5); verbosity=1; } // the longuest isoline int ic0=be(0), ic1=be(1)-1; plot([Curves(0,ic0:ic1),Curves(1,ic0:ic1)], wait=1); int NC= Curves(2,ic1)/hsize; real xl = Curves(0,ic0:ic1).max-5; real yl = Curves(1,ic0:ic1).min+5; border G(t=0,1) { P=Curve(Curves,ic0,ic1,t); label= 1 + (x>xl)*2 + (y. */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include #include #include #include #include using namespace std; #include "RNM.hpp" #include "bmo.hpp" int irand_ (int i) { #ifdef _WIN32 srand(i); return rand(); #else srandom(i); return random(); #endif } static /* Subroutine */ double xrandme (integer ii) { #ifdef _WIN32 static double xrd2, xrd3, xrd4, xrd5, xrd6; /* System generated locals */ int i__1, i__2, i__3, i__4; double d__1; double xilim = 2147483648.; xrd2 = (d__1 = irand_(ii) / xilim, abs(d__1)); i__1 = irand_(ii); xrd3 = (d__1 = irand_(i__1) / xilim, abs(d__1)); i__2 = irand_(ii); i__1 = irand_(i__2); xrd4 = (d__1 = irand_(i__1) / xilim, abs(d__1)); i__3 = irand_(ii); i__2 = irand_(i__3); i__1 = irand_(i__2); xrd5 = (d__1 = irand_(i__1) / xilim, abs(d__1)); i__4 = irand_(ii); i__3 = irand_(i__4); i__2 = irand_(i__3); i__1 = irand_(i__2); xrd6 = (d__1 = irand_(i__1) / xilim, abs(d__1)); double xx = (xrd2 + xrd3 + xrd4 + xrd5 + xrd6) / 5.; #else // srandom(ii); long r = random(); // r = random(); //TODO why twice? const unsigned long rmax = (1UL << 31) - 1; double xx = (double)r / (double)rmax; #endif // cout << " \t\t\trand = " << xx << " " << ii << endl; return xx; } static istream&Eat2LN (istream &f) { int c; while ((c = f.get()) != '\n') {cout << char(c); assert(f.good());} cout << endl; return f; } double BijanMO::main (Vect &xx, Vect &xxmin, Vect &xxmax) { /* Local variables */ double costsave; integer irestart; double f, costsave0, f0; Vect v(ndim), v0(ndim), x1(ndim), hgc(ndim), fpx(ndim), fpx0(ndim), temp(ndim), xmin(ndim), xmax(ndim), xsave(ndim), vinit(ndim), xsave0(ndim); double rho; double rho0; double rho00; integer iter1; double gnorm; integer iterbvp, itersom; double irestart2; ncstr = 0; nbeval = 0; nbevalp = 0; // init .. ffassert(ndim == xx.N()); ffassert(ndim == xxmin.N()); ffassert(ndim == xxmax.N()); vinit = xx; xmin = xxmin; xmax = xxmax; finit = func(vinit); if (debug) { cout << " ndim = " << ndim << endl; } f = finit; f0 = finit; xopt1 = xoptg = vinit; if (finit < epsij) { cstropt = cstr; fseulopt = fseul; goto L9101; } epsij *= finit; if (debug) { cout << " F = " << finit << endl; } if (ncstr > 0) { if (debug) { cout << " CSTR = "; for (int i = 0; i < ncstr; ++i) { cout << cstr[i] << " "; } cout << endl; } } if (debug) { cout << finit << " " << 1. << " " << xoptg[0] << " " << xoptg[1] << " /J/ " << endl; } /* cccccccccccccccccccccccccccccccccccccccccccccccccccccc */ /* x open(2,file='hist.J',status='unknown') */ /* x open(3,file='hist.JC',status='unknown') */ /* x write(3,999) fseul,(cstr(ii),ii=1,ncstr) */ /* x write(2,*) finit,1.,xoptg(1),xoptg(2) */ /* x close(2) */ itersom = 0; costsaveming = finit; irestart2 = 1; // cout << " ------ " << nbrestart << " " << nbext1 << " " << nbbvp << endl; for (irestart = 1; irestart <= nbrestart; ++irestart) { xsave = vinit; irestart2 *= 2; rho00 = rho000 / irestart2; double iter2 = 1; for (iter1 = 1; iter1 <= nbext1; ++iter1) { costsavemin = finit; v = xsave; iter2 *= 2; rho0 = rho00 / iter2; double iterbvp2 = 1; for (iterbvp = 1; iterbvp <= nbbvp; ++iterbvp) { iterbvp2 *= 2; ++itersom; x1 = v; rho = rho0 / iterbvp2; if (debug > 4) { cout << "MM " << irestart << " " << iter1 << " " << iterbvp << " " << rho << " ------------------------------ \n"; } gradopt(x1, fpx, temp, rho, f, gnorm, fpx0, hgc); if (costsaveming < epsij) { break; } if (iterbvp >= 2) { tir(v, fpx); } else { rand(v); } v0 = v; f0 = f; } if (debug) { cout.precision(15); cout << " F = " << costsavemin << " FM = " << costsaveming << endl; } if (costsaveming < epsij) { goto L9101; } costsave = f; if (iter1 >= 2) { tir(v, fpx); } else { rand(v); } costsave0 = costsave; xsave0 = xsave; } } L9101: result(xoptg, vinit); cout << "-------------------------------------------\n"; cout.precision(15); cout << " FM = " << costsaveming << " nb eval J : " << nbeval << " nbevalp : " << nbevalp << endl; if (ncstr > 0) { cout << "-------------------------------------------\n"; cout << "F seul = " << fseulopt << endl; cout << "-------------------------------------------\n"; cout << " CSTR = "; for (int i = 0; i < ncstr; ++i) { cout << cstropt[i] << " "; } cout << endl; cout << "-------------------------------------------\n"; if (ndim < 20) { cout << " x = "; for (int i = 0; i < ndim; ++i) { cout << xoptg[i] << " "; } } cout << "-------------------------------------------\n"; } xx = xoptg; return fseulopt; } void BijanMO::tir (Vect &v, Vect &fpx) { double fp = funcapp(v, fpx); for (int i = 0; i < ndim; ++i) { double vi = v[i], x0 = xmin[i], x1 = xmax[i], fpxi = -fpx[i]; fpxi = min(fpxi, (x1 - vi) * 0.95); fpxi = max(fpxi, (x0 - vi) * 0.95); vi = max(min(vi + fpxi, x1), x0); v[i] = vi; fpx[i] = fpxi; } } void BijanMO::rand (Vect &v) { if (diagrand) { double xrdran = xrandme(nbeval + nbevalp); for (int ii = 0; ii < ndim; ++ii) { v(ii) = xmin(ii) + xrdran * (xmax(ii) - xmin(ii)); v(ii) = max(min(v(ii), xmax(ii)), xmin(ii)); } } else { for (int ii = 0; ii < ndim; ++ii) { double xrdran = xrandme(nbeval + nbevalp); v(ii) = xmin(ii) + xrdran * (xmax(ii) - xmin(ii)); v(ii) = max(min(v(ii), xmax(ii)), xmin(ii)); } } } int BijanMO::gradopt (Vect &x1, Vect &fpx, Vect &temp, double &rho, double &f, double &gnorm, Vect &fpx0, Vect &hgc) { /* Local variables */ integer ii; integer igc, igr; double xmod, xmod0, gamgc; double xmodd, xnorm, gnorm0 = 0.; /* Function Body */ f = func(x1); igc = typealgo; // 1 => CG , other : descent hgc = 0.; for (igr = 1; igr <= nbgrad; ++igr) { xnorm = 0.; fpx0 = fpx; xnorm = fpx.norm(); nbeval = -nbeval; funcp(x1, fpx, f); nbeval = -nbeval; gamgc = 0.; if (igc == 1 && igr >= 2 && xnorm > 1e-10) { for (ii = 0; ii < ndim; ++ii) { gamgc += (fpx[ii] - fpx0[ii]) * fpx[ii] / xnorm; } } for (ii = 0; ii < ndim; ++ii) { hgc(ii) = fpx(ii) + gamgc * hgc(ii); } if (debug > 5) { cout << "\t\t\t" << rho << " " << hgc(0) << " " << hgc(1) << "\n"; } f = ropt_dicho(x1, temp, rho, hgc, f); xmod = 0.; xmodd = 0.; for (ii = 0; ii < ndim; ++ii) { double x0 = x1(ii); x1(ii) = x1(ii) - rho * hgc(ii); x1(ii) = min(x1(ii), xmax(ii)); x1(ii) = max(x1(ii), xmin(ii)); xmod = xmod + abs(x1(ii) - x0); xmodd = xmodd + abs(x1(ii)); } if (igr == 1) { xmod0 = xmod; } f = func(x1); gnorm = fpx.l2(); if (igr == 1) {gnorm0 = gnorm;} if (gnorm0 < 1e-6) { return 0; } gnorm /= gnorm0; if (histpath) { ofstream fhist(histpath->c_str(), ios::app); fhist.precision(16); fhist << f << " " << gnorm * gnorm0 << " "; int n1 = min(ndim, 10); for (int i = 0; i < n1; ++i) { fhist << x1[i] << " "; } } if (histcpath) { ofstream fhist(histcpath->c_str(), ios::app); fhist.precision(16); fhist << fseul << endl; for (int i = 0; i < ncstr; ++i) { fhist << cstr[i] << (i % 4 ? '\n' : '\t') << '\t'; } } if (debug > 2) { cout << "\t\t\t " << f << " " << gnorm * gnorm0 << " " << x1[0] << " " << x1[1] << " /J/ " << endl; } /* x open(2,file='hist.J',access='append') */ /* x write(2,*) f,gnorm*gnorm0,x1(1),x1(2) */ /* x close(2) */ /* x write(3,999) fseul,(cstr(ii),ii=1,ncstr) */ if (f < costsaveming) { costsaveming = f; gnormsave = gnorm; cstropt = cstr; fseulopt = fseul; xoptg = x1; } if (f < costsavemin) { costsavemin = f; xopt1 = x1; } if (f < epsij) { break; } if (gnorm < 1e-6 || gnorm * gnorm0 < 1e-6) { break; } /* if(gnorm.lt.1.e-2.or.gnorm*gnorm0.lt.1.e-6.or.xmod/xmodd.lt.epsloc */ /* 1 .or.xmod/xmod0.lt.epsloc) goto 888 */ } if (debug > 3) {// cout << "\t\t\t opt: rho = " << rho << " F = " << f << endl; } return 0; } double BijanMO::ropt_dicho (Vect x, Vect temp, double &ro, Vect g, double ccout) { integer j, l; double s, fm, sd, sn, pr; static double fmin[3] = {0, 0, 0}; integer numi; double romin[3]; integer numimax; /* Function Body */ numi = 0; numimax = 5; L240: romin[0] = ro * .5; romin[1] = ro; romin[2] = ro * 2.; l = 0; L300: fmin[l] = fun(x, temp, g, romin[l]); ++l; ++numi; if (l == 1 & fmin[0] > ccout) { ro *= .5; /* ****** test d'arret */ if (abs(ro) < 1e-5 || numi > numimax) {goto L500;} goto L240; } L360: if (l < 2) {goto L300;} if (fmin[0] < fmin[1]) {goto L380;} L370: if (l < 3) {goto L300;} if (fmin[1] <= fmin[2]) {goto L450;} else {goto L420;} L380: l = 3; romin[2] = romin[1]; fmin[2] = fmin[1]; romin[1] = romin[0]; fmin[1] = fmin[0]; romin[0] *= .5; ++numi; fmin[0] = fun(x, temp, g, romin[0]); goto L360; L420: romin[0] = romin[1]; fmin[0] = fmin[1]; romin[1] = romin[2]; fmin[1] = fmin[2]; romin[2] *= 2.; ++numi; fmin[2] = fun(x, temp, g, romin[2]); goto L370; L450: ro = romin[1]; if (abs(fmin[1] - fmin[2]) * 2 / (fmin[1] + fmin[2]) < 1e-4 || numi > numimax) { goto L500; } /* ****** calcul de ro interpole */ sn = 0.; sd = 0.; for (int i = 0; i < 3; ++i) { s = 0.; pr = 1.; for (j = 0; j < 3; ++j) { if (i != j) { s += romin[j]; pr *= romin[i] - romin[j]; } } sn += fmin[i] * s / pr; sd += fmin[i] / pr; } ro = sn / sd / 2.; if (debug > 5) { cout << "\t\t\t\tro int = " << ro << " " << l << endl; } L500: fm = fun(x, temp, g, ro); ccout = fm; if (fm > fmin[1]) { ro = romin[1]; ccout = fmin[1]; } if (debug > 4) { cout << "\t\t\t\tdicho : " << ro << " " << ccout << " " << l << endl; } return ccout; } /* ropt_dicho__ */ double BijanMO::fun (Vect &x, Vect &temp, Vect &g, double ro) { for (int ii = 0; ii < ndim; ++ii) { temp[ii] = x[ii] - ro * g[ii]; temp[ii] = max(min(temp[ii], xmax[ii]), xmin[ii]); } if (debug > 5) { cout << " ro = " << ro << endl; } return func(temp); } void BijanMO::funcp (Vect &x, Vect &fpx, double f) { /* Local variables */ double fp, x00; /* Function Body */ nbevalp = nbevalp + 1; double *ok = DJ(x, fpx); if (!ok) { for (int ii = 0; ii < ndim; ++ii) { x00 = x[ii]; double epsifd = max(min(abs(x00) * epsfd, 100 * epsfd), epsfd / 100.); if (x00 + epsifd <= xmax[ii]) { x[ii] = x00 + epsifd; fp = func(x); } else { x[ii] = x00 - epsifd; fp = func(x); epsifd = -epsifd; } fpx[ii] = (fp - f) / epsifd; x[ii] = x00; } } } double BijanMO::funcapp (Vect &x, Vect &fpx) { /* Local variables */ integer kk; double diffucarte; integer nbevalsave; double diffucarte0; integer kkk; double xcoef, fapp; /* Function Body */ nbevalsave = min(nbeval, nbsol); diffucarte0 = 100.; diffucarte = diffucarte0; double itest2 = 1.; for (int itest = 0; itest <= 5; ++itest) { itest2 *= 2; fapp = 0.; fpx = 0.; xcoef = 0.; for (kk = 0; kk < nbevalsave; ++kk) { double d = 0.; for (kkk = 0; kkk < ndim; ++kkk) { double dd = (x[kkk] - xfeval(kk, kkk)) / (xmax[kkk] - xmin[kkk]); d += dd * dd; } double vloc = exp(-d * diffucarte); fapp += feval[kk] * vloc; for (kkk = 0; kkk < ndim; ++kkk) { double xcc = (x[kkk] - xfeval(kk, kkk)) / (xmax[kkk] - xmin[kkk]); fpx[kkk] -= diffucarte * 2 * xcc * vloc; } xcoef += vloc; } if (xcoef > 1e-6) { fapp /= xcoef; fpx /= xcoef; break; } else { diffucarte = diffucarte0 / itest2; } } if (debug > 3) { cout << " fapp = " << fapp << " " << nbeval << x[0] << " " << x[1] << endl; } return fapp; } freefem++-3.61-1/examples++-load/g.gmesh000644 000767 000024 00000036546 13256636774 017775 0ustar00hechtstaff000000 000000 MeshVersionFormatted 0 Dimension 2 Vertices 566 -1.55 0.6 0 -1.55 0.58 0 -1.55 0.5600001 0 -1.55 0.5400001 0 -1.55 0.5200001 0 -1.55 0.5 0 -1.529897 0.5 0 -1.509794 0.5 0 -1.489691 0.5 0 -1.469588 0.5 0 -1.449484 0.5 0 -1.429381 0.5 0 -1.409278 0.5 0 -1.389175 0.5 0 -1.369072 0.5 0 -1.348969 0.5 0 -1.328866 0.5 0 -1.308763 0.5 0 -1.28866 0.5 0 -1.268557 0.5 0 -1.248453 0.5 0 -1.22835 0.5 0 -1.208247 0.5 0 -1.188144 0.5 0 -1.168041 0.5 0 -1.147938 0.5 0 -1.127835 0.5 0 -1.107732 0.5 0 -1.087629 0.5 0 -1.067526 0.5 0 -1.047423 0.5 0 -1.027319 0.5 0 -1.007216 0.5 0 -0.9871132 0.5 0 -0.9670101 0.5 0 -0.946907 0.5 0 -0.9268039 0.5 0 -0.9067008 0.5 0 -0.8865978 0.5 0 -0.8664947 0.5 0 -0.8463916 0.5 0 -0.8262885 0.5 0 -0.8061854 0.5 0 -0.7860823 0.5 0 -0.7659792 0.5 0 -0.7458761 0.5 0 -0.725773 0.5 0 -0.7056699 0.5 0 -0.6855668 0.5 0 -0.6654637 0.5 0 -0.6453606 0.5 0 -0.6252575 0.5 0 -0.6051544 0.5 0 -0.5850513 0.5 0 -0.5649482 0.5 0 -0.5448451 0.5 0 -0.524742 0.5 0 -0.5046389 0.5 0 -0.4845358 0.5 0 -0.4644327 0.5 0 -0.4443296 0.5 0 -0.4242265 0.5 0 -0.4041234 0.5 0 -0.3840203 0.5 0 -0.3639172 0.5 0 -0.3438141 0.5 0 -0.323711 0.5 0 -0.3036079 0.5 0 -0.2835048 0.5 0 -0.2634017 0.5 0 -0.2432986 0.5 0 -0.2231956 0.5 0 -0.2030925 0.5 0 -0.1829894 0.5 0 -0.1628863 0.5 0 -0.1427832 0.5 0 -0.1226801 0.5 0 -0.102577 0.5 0 -0.0824739 0.5 0 -0.06237081 0.5 0 -0.04226772 0.5 0 -0.02216463 0.5 0 -0.002061535 0.5 0 0.01804156 0.5 0 0.03814465 0.5 0 0.05824774 0.5 0 0.07835083 0.5 0 0.09845392 0.5 0 0.118557 0.5 0 0.1386601 0.5 0 0.1587632 0.5 0 0.1788663 0.5 0 0.1989694 0.5 0 0.2190725 0.5 0 0.2391756 0.5 0 0.2592787 0.5 0 0.2793818 0.5 0 0.2994849 0.5 0 0.319588 0.5 0 0.3396911 0.5 0 0.3597942 0.5 0 0.3798973 0.5 0 0.4 0.5 0 0.57 0.67 0 0.57 0.6903342 0 0.57 0.7106684 0 0.57 0.7310026 0 0.57 0.7513368 0 0.57 0.7716709 0 0.57 0.7920051 0 0.57 0.8123393 0 0.57 0.8326735 0 0.57 0.8530077 0 0.57 0.8733419 0 0.57 0.893676 0 0.57 0.9140102 0 0.57 0.9343444 0 0.57 0.9546786 0 0.57 0.9750128 0 0.57 0.995347 0 0.57 1.015681 0 0.57 1.036015 0 0.57 1.05635 0 0.57 1.076684 0 0.57 1.097018 0 0.57 1.117352 0 0.57 1.137687 0 0.57 1.158021 0 0.57 1.178355 0 0.5863901 1.189971 0 0.6025437 1.201914 0 0.618454 1.214179 0 0.6341149 1.226761 0 0.6495197 1.239655 0 0.6646625 1.252856 0 0.6795371 1.266359 0 0.6941373 1.280157 0 0.7084575 1.294247 0 0.7224917 1.30862 0 0.7362344 1.323273 0 0.74968 1.338199 0 0.762823 1.353393 0 0.7756581 1.368847 0 0.7881802 1.384555 0 0.8003842 1.400513 0 0.8122653 1.416712 0 0.8238185 1.433146 0 0.8350392 1.44981 0 0.8459229 1.466695 0 0.8564653 1.483795 0 0.866662 1.501104 0 0.876509 1.518615 0 0.8860022 1.536319 0 0.8951379 1.554211 0 0.9039123 1.572282 0 0.9123219 1.590526 0 0.9203633 1.608936 0 0.9280334 1.627503 0 0.9353288 1.64622 0 0.9422468 1.665081 0 0.9487845 1.684076 0 0.9549394 1.703199 0 0.9607089 1.722442 0 0.9660906 1.741797 0 0.9710824 1.761256 0 0.9756824 1.780811 0 0.9798886 1.800455 0 0.9836993 1.820179 0 0.9871131 1.839976 0 0.9901285 1.859837 0 0.9927443 1.879755 0 0.9949595 1.899722 0 0.9967731 1.919729 0 0.9981844 1.939768 0 0.999193 1.959832 0 0.9997982 1.979912 0 1 2 0 0.5000001 0.67 0 0.5000001 0.6901728 0 0.5000001 0.7103456 0 0.5000001 0.7305185 0 0.5000001 0.7506913 0 0.5000001 0.7708641 0 0.5000001 0.791037 0 0.5000001 0.8112098 0 0.5000001 0.8313826 0 0.5000001 0.8515555 0 0.5000001 0.8717283 0 0.5000001 0.8919011 0 0.5000001 0.912074 0 0.5000001 0.9322468 0 0.5000001 0.9524196 0 0.5000001 0.9725925 0 0.5000001 0.9927653 0 0.5000001 1.012938 0 0.5000001 1.033111 0 0.5000001 1.053284 0 0.5000001 1.073457 0 0.5000001 1.093629 0 0.5000001 1.113802 0 0.5000003 1.133975 0 -0.5 0.6 0 -0.4797826 0.6 0 -0.4595652 0.6 0 -0.4393478 0.6 0 -0.4191304 0.6 0 -0.3989131 0.6 0 -0.3786957 0.6 0 -0.3584783 0.6 0 -0.3382609 0.6 0 -0.3180435 0.6 0 -0.2978261 0.6 0 -0.2776087 0.6 0 -0.2573913 0.6 0 -0.2371739 0.6 0 -0.2169566 0.6 0 -0.1967392 0.6 0 -0.1765218 0.6 0 -0.1563044 0.6 0 -0.136087 0.6 0 -0.1158696 0.6 0 -0.09565222 0.6 0 -0.07543483 0.6 0 -0.05521744 0.6 0 -0.03500005 0.6 0 -0.01478266 0.6 0 0.005434737 0.6 0 0.02565213 0.6 0 0.04586952 0.6 0 0.06608692 0.6 0 0.08630431 0.6 0 0.1065217 0.6 0 0.1267391 0.6 0 0.1469565 0.6 0 0.1671739 0.6 0 0.1873913 0.6 0 0.2076086 0.6 0 0.227826 0.6 0 0.2480434 0.6 0 0.2682608 0.6 0 0.2884782 0.6 0 0.3086956 0.6 0 0.328913 0.6 0 0.3491304 0.6 0 0.3693478 0.6 0 0.3895651 0.6 0 0.4097825 0.6 0 0.4300001 0.6 0 -0.5 0.6205375 0 -0.5 0.641075 0 -0.5 0.6616125 0 -0.5 0.68215 0 -0.5 0.7026875 0 -0.5 0.723225 0 -0.5 0.7437625 0 -0.5 0.7643 0 -0.5 0.7848375 0 -0.5 0.805375 0 -0.5 0.8259125 0 -0.5 0.84645 0 -0.5 0.8669875 0 -0.5 0.887525 0 -0.5 0.9080625 0 -0.5 0.9286 0 -0.5 0.9491374 0 -0.5 0.9696749 0 -0.5 0.9902124 0 -0.5 1.01075 0 -0.5 1.031287 0 -0.5 1.051825 0 -0.5 1.072362 0 -0.5 1.0929 0 -0.5 1.113437 0 -0.5 1.133975 0 -0.55 1.164835 0 -0.55 1.144663 0 -0.55 1.12449 0 -0.55 1.104317 0 -0.55 1.084145 0 -0.55 1.063972 0 -0.55 1.043799 0 -0.55 1.023626 0 -0.55 1.003454 0 -0.55 0.983281 0 -0.55 0.9631083 0 -0.55 0.9429356 0 -0.55 0.9227629 0 -0.55 0.9025902 0 -0.55 0.8824174 0 -0.55 0.8622447 0 -0.55 0.842072 0 -0.55 0.8218993 0 -0.55 0.8017266 0 -0.55 0.7815539 0 -0.55 0.7613811 0 -0.55 0.7412084 0 -0.55 0.7210357 0 -0.55 0.700863 0 -0.55 0.6806903 0 -0.55 0.6605176 0 -0.55 0.6403449 0 -0.55 0.6201721 0 -0.55 0.6 0 -0.5704082 0.6 0 -0.5908163 0.6 0 -0.6112245 0.6 0 -0.6316326 0.6 0 -0.6520408 0.6 0 -0.6724489 0.6 0 -0.6928571 0.6 0 -0.7132652 0.6 0 -0.7336734 0.6 0 -0.7540815 0.6 0 -0.7744897 0.6 0 -0.7948979 0.6 0 -0.815306 0.6 0 -0.8357142 0.6 0 -0.8561223 0.6 0 -0.8765305 0.6 0 -0.8969386 0.6 0 -0.9173468 0.6 0 -0.9377549 0.6 0 -0.9581631 0.6 0 -0.9785712 0.6 0 -0.9989794 0.6 0 -1.019388 0.6 0 -1.039796 0.6 0 -1.060204 0.6 0 -1.080612 0.6 0 -1.10102 0.6 0 -1.121428 0.6 0 -1.141837 0.6 0 -1.162245 0.6 0 -1.182653 0.6 0 -1.203061 0.6 0 -1.223469 0.6 0 -1.243877 0.6 0 -1.264285 0.6 0 -1.284694 0.6 0 -1.305102 0.6 0 -1.32551 0.6 0 -1.345918 0.6 0 -1.366326 0.6 0 -1.386734 0.6 0 -1.407143 0.6 0 -1.427551 0.6 0 -1.447959 0.6 0 -1.468367 0.6 0 -1.488775 0.6 0 -1.509183 0.6 0 -1.529591 0.6 0 -0.4824594 1.124082 0 -0.4647232 1.114544 0 -0.4467984 1.105365 0 -0.4286925 1.09655 0 -0.4104128 1.0881 0 -0.3919666 1.080021 0 -0.3733614 1.072314 0 -0.3546048 1.064984 0 -0.3357045 1.058033 0 -0.3166679 1.051463 0 -0.297503 1.045279 0 -0.2782174 1.039482 0 -0.258819 1.034074 0 -0.2393156 1.029058 0 -0.2197152 1.024436 0 -0.2000256 1.020209 0 -0.180255 1.01638 0 -0.1604112 1.01295 0 -0.1405024 1.00992 0 -0.1205366 1.007291 0 -0.100522 1.005065 0 -0.08046653 1.003243 0 -0.06037846 1.001824 0 -0.0402659 1.000811 0 -0.02013699 1.000203 0 9.620562e-08 0.9999999 0 0.02013718 1.000203 0 0.04026609 1.000811 0 0.06037868 1.001824 0 0.08046678 1.003243 0 0.1005222 1.005065 0 0.1205369 1.007291 0 0.1405028 1.00992 0 0.1604116 1.01295 0 0.1802554 1.01638 0 0.2000261 1.020209 0 0.2197156 1.024436 0 0.2393161 1.029058 0 0.2588195 1.034074 0 0.2782179 1.039482 0 0.2975036 1.045279 0 0.3166685 1.051464 0 0.3357051 1.058033 0 0.3546055 1.064984 0 0.3733621 1.072314 0 0.3919672 1.080021 0 0.4104134 1.0881 0 0.4286932 1.09655 0 0.4467992 1.105366 0 0.4647238 1.114544 0 0.48246 1.124082 0 -1 2 0 -0.9997966 1.979829 0 -0.9991863 1.959667 0 -0.9981694 1.939521 0 -0.9967465 1.919399 0 -0.9949179 1.89931 0 -0.9926845 1.879263 0 -0.9900472 1.859264 0 -0.987007 1.839323 0 -0.9835652 1.819447 0 -0.9797232 1.799644 0 -0.9754826 1.779923 0 -0.970845 1.760292 0 -0.9658124 1.740758 0 -0.9603868 1.72133 0 -0.9545705 1.702015 0 -0.9483657 1.682821 0 -0.941775 1.663756 0 -0.9348011 1.644828 0 -0.9274469 1.626045 0 -0.9197152 1.607414 0 -0.9116094 1.588942 0 -0.9031326 1.570638 0 -0.8942883 1.552509 0 -0.8850802 1.534561 0 -0.8755118 1.516803 0 -0.8655873 1.499242 0 -0.8553105 1.481884 0 -0.8446857 1.464737 0 -0.8337172 1.447808 0 -0.8224095 1.431104 0 -0.8107671 1.414631 0 -0.7987948 1.398396 0 -0.7864975 1.382406 0 -0.7738801 1.366668 0 -0.7609479 1.351187 0 -0.7477061 1.33597 0 -0.7341599 1.321023 0 -0.7203151 1.306353 0 -0.7061772 1.291965 0 -0.6917519 1.277865 0 -0.6770452 1.264059 0 -0.6620629 1.250552 0 -0.6468113 1.23735 0 -0.6312965 1.224458 0 -0.6155248 1.211882 0 -0.5995026 1.199627 0 -0.5832366 1.187698 0 -0.5667331 1.176099 0 0.98 2 0 0.96 2 0 0.9400001 2 0 0.9200001 2 0 0.9000001 2 0 0.8800001 2 0 0.8600001 2 0 0.8400002 2 0 0.8200002 2 0 0.8000002 2 0 0.7800002 2 0 0.7600002 2 0 0.7400002 2 0 0.7200003 2 0 0.7000003 2 0 0.6800003 2 0 0.6600003 2 0 0.6400003 2 0 0.6200004 2 0 0.6000004 2 0 0.5800004 2 0 0.5600004 2 0 0.5400004 2 0 0.5200005 2 0 0.5000005 2 0 0.4800005 2 0 0.4600005 2 0 0.4400004 2 0 0.4200004 2 0 0.4000004 2 0 0.3800004 2 0 0.3600004 2 0 0.3400004 2 0 0.3200004 2 0 0.3000004 2 0 0.2800004 2 0 0.2600003 2 0 0.2400004 2 0 0.2200004 2 0 0.2000004 2 0 0.1800004 2 0 0.1600004 2 0 0.1400004 2 0 0.1200004 2 0 0.1000004 2 0 0.08000039 2 0 0.06000039 2 0 0.04000039 2 0 0.02000039 2 0 3.874302e-07 2 0 -0.01999961 2 0 -0.03999961 2 0 -0.05999961 2 0 -0.07999961 2 0 -0.09999961 2 0 -0.1199996 2 0 -0.1399996 2 0 -0.1599996 2 0 -0.1799996 2 0 -0.1999996 2 0 -0.2199996 2 0 -0.2399996 2 0 -0.2599996 2 0 -0.2799996 2 0 -0.2999996 2 0 -0.3199996 2 0 -0.3399996 2 0 -0.3599996 2 0 -0.3799996 2 0 -0.3999996 2 0 -0.4199997 2 0 -0.4399997 2 0 -0.4599997 2 0 -0.4799997 2 0 -0.4999997 2 0 -0.5199997 2 0 -0.5399997 2 0 -0.5599996 2 0 -0.5799996 2 0 -0.5999996 2 0 -0.6199996 2 0 -0.6399996 2 0 -0.6599995 2 0 -0.6799995 2 0 -0.6999995 2 0 -0.7199995 2 0 -0.7399995 2 0 -0.7599995 2 0 -0.7799994 2 0 -0.7999994 2 0 -0.8199994 2 0 -0.8399994 2 0 -0.8599994 2 0 -0.8799993 2 0 -0.8999993 2 0 -0.9199993 2 0 -0.9399993 2 0 -0.9599993 2 0 -0.9799992 2 0 0.4516312 0.603426 0 0.471145 0.6133688 0 0.4866312 0.628855 0 0.496574 0.6483688 0 0.4204912 0.5012395 0 0.4406836 0.5049399 0 0.4602828 0.5110472 0 0.4790029 0.5194725 0 0.496571 0.5300928 0 0.5127308 0.5427532 0 0.5272468 0.5572692 0 0.5399073 0.573429 0 0.5505275 0.5909971 0 0.5589527 0.6097172 0 0.5650601 0.6293164 0 0.5687605 0.6495088 0 Edges 566 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 0 7 8 0 8 9 0 9 10 0 10 11 0 11 12 0 12 13 0 13 14 0 14 15 0 15 16 0 16 17 0 17 18 0 18 19 0 19 20 0 20 21 0 21 22 0 22 23 0 23 24 0 24 25 0 25 26 0 26 27 0 27 28 0 28 29 0 29 30 0 30 31 0 31 32 0 32 33 0 33 34 0 34 35 0 35 36 0 36 37 0 37 38 0 38 39 0 39 40 0 40 41 0 41 42 0 42 43 0 43 44 0 44 45 0 45 46 0 46 47 0 47 48 0 48 49 0 49 50 0 50 51 0 51 52 0 52 53 0 53 54 0 54 55 0 55 56 0 56 57 0 57 58 0 58 59 0 59 60 0 60 61 0 61 62 0 62 63 0 63 64 0 64 65 0 65 66 0 66 67 0 67 68 0 68 69 0 69 70 0 70 71 0 71 72 0 72 73 0 73 74 0 74 75 0 75 76 0 76 77 0 77 78 0 78 79 0 79 80 0 80 81 0 81 82 0 82 83 0 83 84 0 84 85 0 85 86 0 86 87 0 87 88 0 88 89 0 89 90 0 90 91 0 91 92 0 92 93 0 93 94 0 94 95 0 95 96 0 96 97 0 97 98 0 98 99 0 99 100 0 100 101 0 101 102 0 102 103 0 104 105 0 105 106 0 106 107 0 107 108 0 108 109 0 109 110 0 110 111 0 111 112 0 112 113 0 113 114 0 114 115 0 115 116 0 116 117 0 117 118 0 118 119 0 119 120 0 120 121 0 121 122 0 122 123 0 123 124 0 124 125 0 125 126 0 126 127 0 127 128 0 128 129 0 129 130 0 130 131 0 131 132 0 132 133 0 133 134 0 134 135 0 135 136 0 136 137 0 137 138 0 138 139 0 139 140 0 140 141 0 141 142 0 142 143 0 143 144 0 144 145 0 145 146 0 146 147 0 147 148 0 148 149 0 149 150 0 150 151 0 151 152 0 152 153 0 153 154 0 154 155 0 155 156 0 156 157 0 157 158 0 158 159 0 159 160 0 160 161 0 161 162 0 162 163 0 163 164 0 164 165 0 165 166 0 166 167 0 167 168 0 168 169 0 169 170 0 170 171 0 171 172 0 172 173 0 173 174 0 174 175 0 175 176 0 176 177 0 179 178 0 180 179 0 181 180 0 182 181 0 183 182 0 184 183 0 185 184 0 186 185 0 187 186 0 188 187 0 189 188 0 190 189 0 191 190 0 192 191 0 193 192 0 194 193 0 195 194 0 196 195 0 197 196 0 198 197 0 199 198 0 200 199 0 201 200 0 203 202 0 204 203 0 205 204 0 206 205 0 207 206 0 208 207 0 209 208 0 210 209 0 211 210 0 212 211 0 213 212 0 214 213 0 215 214 0 216 215 0 217 216 0 218 217 0 219 218 0 220 219 0 221 220 0 222 221 0 223 222 0 224 223 0 225 224 0 226 225 0 227 226 0 228 227 0 229 228 0 230 229 0 231 230 0 232 231 0 233 232 0 234 233 0 235 234 0 236 235 0 237 236 0 238 237 0 239 238 0 240 239 0 241 240 0 242 241 0 243 242 0 244 243 0 245 244 0 246 245 0 247 246 0 248 247 0 202 249 0 249 250 0 250 251 0 251 252 0 252 253 0 253 254 0 254 255 0 255 256 0 256 257 0 257 258 0 258 259 0 259 260 0 260 261 0 261 262 0 262 263 0 263 264 0 264 265 0 265 266 0 266 267 0 267 268 0 268 269 0 269 270 0 270 271 0 271 272 0 272 273 0 273 274 0 275 276 0 276 277 0 277 278 0 278 279 0 279 280 0 280 281 0 281 282 0 282 283 0 283 284 0 284 285 0 285 286 0 286 287 0 287 288 0 288 289 0 289 290 0 290 291 0 291 292 0 292 293 0 293 294 0 294 295 0 295 296 0 296 297 0 297 298 0 298 299 0 299 300 0 300 301 0 301 302 0 302 303 0 303 304 0 304 305 0 305 306 0 306 307 0 307 308 0 308 309 0 309 310 0 310 311 0 311 312 0 312 313 0 313 314 0 314 315 0 315 316 0 316 317 0 317 318 0 318 319 0 319 320 0 320 321 0 321 322 0 322 323 0 323 324 0 324 325 0 325 326 0 326 327 0 327 328 0 328 329 0 329 330 0 330 331 0 331 332 0 332 333 0 333 334 0 334 335 0 335 336 0 336 337 0 337 338 0 338 339 0 339 340 0 340 341 0 341 342 0 342 343 0 343 344 0 344 345 0 345 346 0 346 347 0 347 348 0 348 349 0 349 350 0 350 351 0 351 1 0 274 352 0 352 353 0 353 354 0 354 355 0 355 356 0 356 357 0 357 358 0 358 359 0 359 360 0 360 361 0 361 362 0 362 363 0 363 364 0 364 365 0 365 366 0 366 367 0 367 368 0 368 369 0 369 370 0 370 371 0 371 372 0 372 373 0 373 374 0 374 375 0 375 376 0 376 377 0 377 378 0 378 379 0 379 380 0 380 381 0 381 382 0 382 383 0 383 384 0 384 385 0 385 386 0 386 387 0 387 388 0 388 389 0 389 390 0 390 391 0 391 392 0 392 393 0 393 394 0 394 395 0 395 396 0 396 397 0 397 398 0 398 399 0 399 400 0 400 401 0 401 402 0 402 201 0 403 404 0 404 405 0 405 406 0 406 407 0 407 408 0 408 409 0 409 410 0 410 411 0 411 412 0 412 413 0 413 414 0 414 415 0 415 416 0 416 417 0 417 418 0 418 419 0 419 420 0 420 421 0 421 422 0 422 423 0 423 424 0 424 425 0 425 426 0 426 427 0 427 428 0 428 429 0 429 430 0 430 431 0 431 432 0 432 433 0 433 434 0 434 435 0 435 436 0 436 437 0 437 438 0 438 439 0 439 440 0 440 441 0 441 442 0 442 443 0 443 444 0 444 445 0 445 446 0 446 447 0 447 448 0 448 449 0 449 450 0 450 451 0 451 275 0 177 452 2 452 453 2 453 454 2 454 455 2 455 456 2 456 457 2 457 458 2 458 459 2 459 460 2 460 461 2 461 462 2 462 463 2 463 464 2 464 465 2 465 466 2 466 467 2 467 468 2 468 469 2 469 470 2 470 471 2 471 472 2 472 473 2 473 474 2 474 475 2 475 476 2 476 477 2 477 478 2 478 479 2 479 480 2 480 481 2 481 482 2 482 483 2 483 484 2 484 485 2 485 486 2 486 487 2 487 488 2 488 489 2 489 490 2 490 491 2 491 492 2 492 493 2 493 494 2 494 495 2 495 496 2 496 497 2 497 498 2 498 499 2 499 500 2 500 501 2 501 502 2 502 503 2 503 504 2 504 505 2 505 506 2 506 507 2 507 508 2 508 509 2 509 510 2 510 511 2 511 512 2 512 513 2 513 514 2 514 515 2 515 516 2 516 517 2 517 518 2 518 519 2 519 520 2 520 521 2 521 522 2 522 523 2 523 524 2 524 525 2 525 526 2 526 527 2 527 528 2 528 529 2 529 530 2 530 531 2 531 532 2 532 533 2 533 534 2 534 535 2 535 536 2 536 537 2 537 538 2 538 539 2 539 540 2 540 541 2 541 542 2 542 543 2 543 544 2 544 545 2 545 546 2 546 547 2 547 548 2 548 549 2 549 550 2 550 403 2 551 248 0 552 551 0 553 552 0 554 553 0 178 554 0 103 555 0 555 556 0 556 557 0 557 558 0 558 559 0 559 560 0 560 561 0 561 562 0 562 563 0 563 564 0 564 565 0 565 566 0 566 104 0 AngleOfCornerBound 10 Corners 14 1 6 129 177 201 202 274 275 303 403 551 552 553 554 RequiredVertices 14 1 6 129 177 201 202 274 275 303 403 551 552 553 554 SubDomainFromGeom 1 2 1 1 0 freefem++-3.61-1/examples++-load/ppm2rnm.cpp000644 000767 000024 00000022414 13312446271 020566 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Tools to read ppm file // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // tools to read ppm file /* use in freefem++ edp * see : * real[int,int] ff1("tt.pmm"); // read image and set to an array. * real[int] ff(ff1.nx*ff1.ny); * ff=ff1; */ #include #include using namespace std; #include "error.hpp" #include "AFunction.hpp" using namespace std; #include "RNM.hpp" #include typedef KNM *pRnm; typedef KN *pRn; typedef string *pstring; #include "ppmimg.h" #ifdef __cplusplus extern "C" { #endif PPMimage*loadPPM (const char *imgname, ubyte *type, ubyte quiet) { pPPMimage result; FILE *fp; int i, k, typimg, ret, r, g, b, s, maxval, bitsize; const char *ptr; char c, buff[1024], data[256]; /* search for image */ fprintf(stdout, " Loading image: %s\n", imgname); ptr = strstr(imgname, ".ppm"); strcpy(data, imgname); if (!ptr) { ptr = strstr(imgname, ".pgm"); if (!ptr) {strcat(data, ".ppm");} fp = fopen(data, "rb"); } else { fp = fopen(data, "rb"); } if (!fp) { fprintf(stderr, " ## UNABLE TO OPEN FILE %s.\n", data); return 0; } if (!quiet) { fprintf(stdout, " opening %s\n", data); } if (!fgets(buff, sizeof(buff), fp)) { fprintf(stderr, " ## INVALID HEADER.\n"); return 0; } /* check header file */ if (buff[0] != 'P') { fprintf(stderr, " ## INVALID IMAGE FORMAT (MUST BE 'PX').\n"); return 0; } switch (buff[1]) { case '2': typimg = P2; break; case '3': typimg = P3; break; case '4': typimg = P4; break; case '5': typimg = P5; break; case '6': typimg = P6; break; default: fprintf(stderr, " ## INVALID IMAGE FORMAT (MUST BE 'PX').\n"); return 0; } /* allocate memory to store imagee */ result = (PPMimage *)malloc(sizeof(PPMimage)); assert(result); do { ret = fscanf(fp, "%s", buff); if (ret == EOF) {break;} /* check and strip comments */ if (buff[0] == '#') { do { c = getc(fp); } while (c != '\n'); } else {break;} } while (1); /* read columns + lines */ ret = sscanf(buff, "%d", &s); result->sizeX = (short)s; ret += fscanf(fp, "%d", &s); result->sizeY = (short)s; if (ret != 2) { fprintf(stderr, " ## ERROR LOADING IMAGE.\n"); free(result); return 0; } if (fscanf(fp, "%d", &maxval) != 1) { fprintf(stderr, " ## INVALID IMAGE SIZE.\n"); free(result); return 0; } /* strip line */ while (fgetc(fp) != '\n') {;} /* size based on type */ if (typimg == P2 || typimg == P5 || typimg == P4) { bitsize = result->sizeX * result->sizeY; } else { bitsize = 3 * result->sizeX * result->sizeY; } if (!quiet) { fprintf(stdout, " image size: %dx%d %d bytes\n", result->sizeX, result->sizeY, bitsize); } result->data = (ubyte *)malloc(1 + bitsize * sizeof(ubyte)); assert(result->data); /* read data file */ switch (typimg) { case P2:/* ascii file (grey) */ case P3:/* ascii file (color) */ for (i = 0; i < bitsize; i++) { int rr = fscanf(fp, "%d", &r); result->data[i] = (ubyte)r; } break; case P5:/* binary file (grey) */ case P6:/* binary file (color) */ ret = fread(result->data, sizeof(ubyte), bitsize, fp); if (ret != bitsize) { fprintf(stderr, " ## ERROR LOADING IMAGE.\n"); free(result->data); free(result); return 0; } break; } fclose(fp); if (*type == DEFAULT) { if (typimg == P2 || typimg == P5) { *type = GREY; } else { *type = COLOR; } } /* convert to grey levels */ else if (*type == GREY && (typimg == P3 || typimg == P6)) { fprintf(stdout, " converting to grey levels\n"); for (i = 0, k = 0; i < bitsize; i += 3, k++) { r = (int)result->data[i]; g = (int)result->data[i + 1]; b = (int)result->data[i + 2]; result->data[k] = (ubyte)(0.3 * r + 0.59 * g + 0.11 * b); } result->data = (ubyte *)realloc(result->data, sizeof(ubyte) * bitsize / 3 + 1); } return result; } int savePPM (const char *imgname, pPPMimage img, int typimg) { FILE *out; int i, c, bitsize; /* open file */ out = fopen(imgname, "w"); if (!out) { fprintf(stderr, " ## UNABLE TO OPEN FILE %s.\n", imgname); return 0; } /* write out image file */ bitsize = img->sizeX * img->sizeY; switch (typimg) { case P2: fprintf(out, "P2\n"); fprintf(out, "# CREATOR: QIZIP Version 1, Rev. 2/2003, (c) INRIA\n"); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); c = 0; for (i = 0; i < img->sizeX * img->sizeY; i++) { fprintf(out, "%3d ", (int)img->data[i]); if (++c == 17) { c = 0; fprintf(out, "\n"); } } fprintf(out, "\n"); break; case P5: fprintf(out, "P5\n"); fprintf(out, "# CREATOR: QIZIP Version 1, Rev. 2/2003, (c) INRIA\n"); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); fwrite(img->data, sizeof(ubyte), bitsize, out); break; case P6: fprintf(out, "P6\n"); fprintf(out, "# CREATOR: QIZIP Version 1, Rev. 2/2003, (c) INRIA\n"); fprintf(out, "%d %d\n", img->sizeX, img->sizeY); fprintf(out, "255\n"); fwrite(img->data, sizeof(ubyte), 3 * bitsize, out); break; } fclose(out); return 1; } /* compute difference image */ pPPMimage diffImg (pPPMimage bits, pPPMimage img, ubyte itype) { pPPMimage dif; double psnr, dd; int i, bitsize, dmax; fprintf(stdout, " Difference image\n"); bitsize = (int)bits->sizeX * bits->sizeY; if (itype == COLOR) {bitsize *= 3;} dif = (PPMimage *)malloc(sizeof(PPMimage)); if (!dif) { fprintf(stderr, " Sorry, not enough memory. Bye.\n"); return 0; } dif->sizeX = bits->sizeX; dif->sizeY = bits->sizeY; dif->data = (ubyte *)malloc(bitsize * sizeof(ubyte)); if (!dif->data) { fprintf(stderr, " Sorry, not enough memory. Bye.\n"); free(dif); return 0; } dmax = 0; psnr = 0.0f; for (i = 0; i < bitsize; i++) { dd = abs((int)(bits->data[i] - img->data[i])); dmax = max(dmax, dd); psnr += (double)dd * dd; dif->data[i] = (ubyte)(255 - dd); } if (psnr == 0.0f) {fprintf(stderr, " PSNR problem!");} else { psnr = 65025.0f / psnr; psnr = 10.0 * log10(bitsize * psnr); } fprintf(stdout, " PSNR = %.2f dmax = %d\n", psnr, dmax); return dif; } #ifdef __cplusplus } #endif pRnm read_image (pRnm const &a, const pstring &b) { ubyte type, quiet = 1; PPMimage *image = loadPPM(b->c_str(), &type, quiet); if (!image) { std::cerr << " error loadPPM image " << *b << endl; CompileError("error loadPPM image "); return a; } if (verbosity) { cout << " size of image : " << image->sizeX << " x " << image->sizeY << " type =" << (int)type << endl; } int n = image->sizeX; int m = image->sizeY; a->init(n, m); ubyte *dd = image->data; // cout << (double) dd[0] / 256. << " " // << (double) dd[250] / 256. << " " // << (double) dd[500] / 256. << "\n " // ; int k = 0; double *mm = *a; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { *mm++ = (double)dd[k++] / 256.; } } KN_ aa = *a; // cout << aa[0] << " "<< aa[250] << "" << aa[500] << endl; assert(k == n * m); free(image->data); free(image); return a; } pRn seta (pRn const &a, const pRnm &b) { *a = *b; KN_ aa = *a; // cout << aa[0] << " "<< aa[250] << "" << aa[500] << endl; return a; } /* class Init { public: * Init(); * }; * * $1 */ template AnyType MyCast (Stack, const AnyType &b) { KNM *bb = GetAny *>(b); ffassert(bb->IsVector1()); return b; } static void Load_Init () { cout << " lood: init ppm2rmn " << endl; TheOperators->Add("<-", new OneOperator2_ *, KNM *, string *>(&read_image) ); TheOperators->Add("=", new OneOperator2_ *, KN *, KNM *>(seta) ); // autocast KNM *-> KN (no) /* * map_type[typeid(KN* ).name()]->AddCast( * new E_F1_funcT*,KNM*>(MyCast * )); */ } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/LaplaceRT13d.edp000644 000767 000024 00000003113 13256636774 021313 0ustar00hechtstaff000000 000000 load "Element_Mixte3d" load "msh3" load "Element_P1dc1" /* Solving the following Poisson problem Find $p$, such that; $ - \Delta p = f $ on $\Omega$, $ dp / dn = (g1d,g2d). n $ on $\Gamma_{123}$ $ p = gd $ on $\Gamma_{1}$ with de Mixte finite element formulation Find $p\in L^2(\Omega) and $u\in H(div) $ such than u - Grad p = 0 - div u = f $ u. n = (g1d,g2d). n $ on $\Gamma_{123}$ $ p = gd $ on $\Gamma_{1}$ the variationnel form is: $\forall v\in H(div)$; $v.n = 0$ on $\Gamma_{4}\} $: $ \int_\Omega u v + p div v -\int_{\Gamma_{123}} gd* v.n = 0 $ $\forall q\in L^2$: $ -\int_\Omega q div u = \int_Omega f q $ and $ u.n = (g1n,g2n).n$ on $\Gamma_4$ */ int nn=8; mesh3 Th=cube(nn,nn,nn); fespace Wh(Th,P1); fespace Vh(Th,RT13d); fespace Ph(Th,P1dc3d); func gd = 0.; func g1n = 1.; func g2n = 1.; func g3n = 1.; func f = 1.; Vh [u1,u2,u3],[v1,v2,v3]; Ph p,q; Wh pp,qq; problem laplaceMixte([u1,u2,u3,p],[v1,v2,v3,q],solver=UMFPACK,eps=1.0e-10,tgv=1e30,dimKrylov=150) = int3d(Th)( p*q*0e-10+ u1*v1 + u2*v2 + u3*v3 + p*(dx(v1)+dy(v2)+dz(v3)) + (dx(u1)+dy(u2)+dz(u3))*q ) + int3d(Th) ( f*q) - int2d(Th,1,2,3,4,5,6)( gd*(v1*N.x +v2*N.y+ v3*N.z)) // int on gamma // + on(4,u1=g1n,u2=g2n,u3=g3n) ; macro grad(u) [dx(u),dy(u),dz(u)]// solve LapP1(pp,qq) = int3d(Th)(grad(pp)'*grad(qq)) - int3d(Th)(f*qq) +on(1,2,3,4,5,6,pp=gd); laplaceMixte; real err = int3d(Th)(abs(pp-p)); cout << "err =" << err << " max "<< pp[].max << " " << p[].max << endl; plot(p,wait=1,ps="laRTp.eps",value=true); assert(err < 0.005); freefem++-3.61-1/examples++-load/ff-AiryBiry.cpp000644 000767 000024 00000010511 13312446271 021311 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... #include #include using namespace std; double airy (double x, long df) { double f, y, a, b, s; int p; double u = .258819403792807, v = .355028053887817; if (x <= 1.7 && x >= -6.9) { y = x * x * x / 9.; if (df) { a = 2. / 3.; b = -a; v *= x * x / 2.; u = -u; } else { b = 1. / 3.; a = -b; u *= -x; } for (p = 1, f = u + v;; ++p) { a += 1.; b += 1.; v *= y / (p * a); u *= y / (p * b); s = u + v; f += s; if (fabs(s) < 1.e-14) {break;} } } else { s = 1. / sqrt(v = 3.14159265358979); y = fabs(x); if (df) {s *= pow(y, .25);} else {s /= pow(y, .25);} y *= 2. * sqrt(y) / 3.; if (x > 0.) { a = 12. / pow(y, .333); p = a * a; if (df) {a = -7. / 36.;} else {a = 5. / 36.;} b = 2. * (p + y); f = 1.; u = x = 0.; s *= exp(-y) / 2.; for (; p > 0; --p, b -= 2.) { y = (b * f - (p + 1) * x) / (p - 1 + a / p); x = f; f = y; u += f; } if (df) {f *= -s / u;} else {f *= s / u;} } else { x = y - v / 4.; y *= 2.; b = .5; f = s; v = 0.; if (df) {a = 2. / 3.;} else {a = 1. / 3.;} for (p = 1; (u = fabs(s)) > 1.e-14; ++p, b += 1.) { s *= (a + b) * (a - b) / (p * y); if (fabs(s) >= u) {break;} if (!(p & 1)) { s = -s; f += s; } else {v += s;} } if (df) {f = f * sin(x) + v * cos(x);} else {f = f * cos(x) - v * sin(x);} } } return f; } double biry (double x, long df) { double f, y, a, b, s; int p; double u = .258819403792807, v = .355028053887817; if (x <= 7.6 && x >= -6.9) { y = x * x * x / 9.; if (df) {b = -(a = 2. / 3.); u *= (f = sqrt(3.)); v *= f * x * x / 2.;} else {a = -(b = 1. / 3.); v *= (f = sqrt(3.)); u *= f * x;} for (p = 1, f = u + v;; ++p) { v *= y / (p * (a += 1.)); u *= y / (p * (b += 1.)); f += (s = u + v); if (fabs(s) < 1.e-14 * (1. + fabs(f))) {break;}} } else { s = 1. / sqrt(v = 3.14159265358979); y = fabs(x); if (df) {s *= pow(y, .25);} else {s /= pow(y, .25);} y *= 2. * sqrt(y) / 3.; b = .5; if (df) {a = 2. / 3.;} else {a = 1. / 3.;} if (x > 0.) { s *= exp(y); f = s; y *= -2.; for (p = 1; (u = fabs(s)) > 1.e-14; ++p, b += 1.) { s *= (a + b) * (a - b) / (p * y); if (fabs(s) >= u) { break; } f += s; } } else { x = y - v / 4.; y *= 2.; f = s; v = 0.; for (p = 1; (u = fabs(s)) > 1.e-14; ++p, b += 1.) { s *= (a + b) * (a - b) / (p * y); if (fabs(s) >= u) {break;} if (!(p & 1)) {s = -s; f += s;} else {v += s;}} if (df) {f = f * cos(x) - v * sin(x);} else {f = -(f * sin(x) + v * cos(x));} } } return f; } #include "ff++.hpp" static void InitFF () { Global.Add("airy", "(", new OneOperator2(airy)); Global.Add("biry", "(", new OneOperator2(biry)); } LOADFUNC(InitFF) freefem++-3.61-1/examples++-load/myfunction2.cpp000644 000767 000024 00000003762 13312446271 021455 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // // Example C++ function "myfunction", dynamically loaded into "load.edp" #include using namespace Fem2D; double myf (string *s) { cout << *s << endl; return 0.; } double f (const double &x) {return x * x + 1;} // Hack to do something at initialisation time // to add the name myfunction to the freefem++ table /* class Init { public: * Init(); * }; * $1 */ static void Load_Init () { Global.Add("Why", "(", new OneOperator1(myf)); Global.Add("f", "(", new OneOperator1_(f)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/exactpartition.cpp000644 000767 000024 00000007310 13312446271 022227 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : Remove the upper part of a CSR if the supplied matrix is not symmetric // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : Pierre Jolivet // E-MAIL : pierre.jolivet@enseeiht.fr // *INDENT-OFF* // //ff-c++-LIBRARY-dep: //ff-c++-cpp-dep: // *INDENT-ON* // #include "ff++.hpp" long exactpartition (int n, int m, double **v, long *J) { int kkerr = 0; long N = (1 << 30); cout << " exactpartition " << n << " " << m << " N =" << N << endl; for (int i = 0; i < m; ++i) { long s = 0, j0 = N; for (int j = 0; j < n; ++j) { if (v[j]) { int jj = J[j]; double w = v[j][i]; long lw = lrint(w * N); if (lw && jj < j0) { j0 = j; // prco le plus petit non nulle } v[j][i] = (double)lw; s += lw; } } ffassert(s && j0 < N); // sum = 1 double ss = 0; for (int j = 0; j < n; ++j) { if (v[j]) { double w = v[j][i] / s; long lw = lrint(w * N); double we = (double)lw / (double)N; v[j][i] = we; ss += we; } } double err = ss - 1.; assert(fabs(err) * N < 10); // bofbof ???? FH. v[j0][i] -= err; // verif .. ss = 0; for (int j = 0; j < n; ++j) { if (v[j]) {ss += v[j][i];}} kkerr += (ss != 1.); } ffassert(kkerr == 0); return 0; } long exactpartition (FEbaseArrayKn *const &p, KN *const &pj) { int n = p->N, m = 0; double **v = new double *[n]; int kerr = 0; for (int i = 0; i < n; ++i) { KN *vi = p->get(i); int mi = vi ? vi->N() : 0; if (m == 0) {m = mi;} else if (m != mi) {kerr++;} v[i] = *vi; } ffassert(kerr == 0); ffassert(pj->N() >= n); exactpartition(n, m, v, *pj); delete [] v; return 0; } long exactpartition (KN > *const &p, KN *const &pj) { int n = p->N(), m = 0; double **v = new double *[n]; int kerr = 0; for (int i = 0; i < n; ++i) { KN_ vi = (*p)(i); int mi = vi ? vi.N() : 0; if (m == 0) {m = mi;} else if (m != mi) {kerr++;} if (mi == 0) {v[i] = 0;} else {v[i] = vi;} } ffassert(kerr == 0); ffassert(pj->N() >= n); exactpartition(n, m, v, *pj); delete [] v; return 0; } static void Load_Init () { // to be sure to have unique add if (!Global.Find("exactpartition").NotNull()) { Global.Add("exactpartition", "(", new OneOperator2_ *, KN *>(exactpartition)); // KN > Global.Add("exactpartition", "(", new OneOperator2_ > *, KN *>(exactpartition)); } } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-load/fflapack.cpp000644 000767 000024 00000123257 13312446271 020751 0ustar00hechtstaff000000 000000 /****************************************************************************/ /* 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 3 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, see . */ /****************************************************************************/ // SUMMARY : ... // LICENSE : LGPLv3 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHORS : ... // E-MAIL : ... // *INDENT-OFF* // //ff-c++-LIBRARY-dep: lapack blas //ff-c++-cpp-dep: // *INDENT-ON* // #include "ff++.hpp" #include "RNM.hpp" #include "AFunction_ext.hpp"// Extension of "AFunction.hpp" to deal with more than 3 parameters function using namespace std; #ifdef __LP64__ typedef int intblas; typedef int integer; #else typedef long intblas; typedef long integer; #endif typedef integer logical; typedef float LAPACK_real; typedef double doublereal; typedef logical (*L_fp)(); typedef integer ftnlen; typedef complex LAPACK_complex; typedef complex doublecomplex; typedef void VOID; #define complex LAPACK_complex #define real LAPACK_real #include "clapack.h" #undef real #undef complex long lapack_inv (KNM *A) { intblas n = A->N(); intblas m = A->M(); double *a = &(*A)(0, 0); intblas info; intblas lda = n; KN ipiv(n); intblas lw = 10 * n; KN w(lw); ffassert(n == m); dgetrf_(&n, &n, a, &lda, ipiv, &info); if (info) {return info;} dgetri_(&n, a, &lda, ipiv, w, &lw, &info); return info; } long lapack_inv (KNM *A) { intblas n = A->N(); intblas m = A->M(); Complex *a = &(*A)(0, 0); intblas info; intblas lda = n; KN ipiv(n); intblas lw = 10 * n; KN w(lw); ffassert(n == m); zgetrf_(&n, &n, a, &lda, ipiv, &info); if (info) {return info;} zgetri_(&n, a, &lda, ipiv, w, &lw, &info); return info; } // (computation of the eigenvalues and right eigenvectors of a real nonsymmetric matrix) long lapack_dgeev (KNM *const &A, KN *const &vp, KNM *const &vectp) { /* * SUBROUTINE DGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, WORK, LWORK, INFO ) * JOBVL (input) CHARACTER*1 * = 'N': left eigenvectors of A are not computed; * = 'V': left eigenvectors of A are computed. * * JOBVR (input) CHARACTER*1 * = 'N': right eigenvectors of A are not computed; * = 'V': right eigenvectors of A are computed. * * N (input) INTEGER * The order of the matrix A. N >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA,N) * On entry, the N-by-N matrix A. * On exit, A has been overwritten. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,N). * * WR (output) DOUBLE PRECISION array, dimension (N) * WI (output) DOUBLE PRECISION array, dimension (N) * WR and WI contain the real and imaginary parts, * respectively, of the computed eigenvalues. Complex * conjugate pairs of eigenvalues appear consecutively * with the eigenvalue having the positive imaginary part * first. * * VL (output) DOUBLE PRECISION array, dimension (LDVL,N) * If JOBVL = 'V', the left eigenvectors u(j) are stored one * after another in the columns of VL, in the same order * as their eigenvalues. * If JOBVL = 'N', VL is not referenced. * If the j-th eigenvalue is real, then u(j) = VL(:,j), * the j-th column of VL. * If the j-th and (j+1)-st eigenvalues form a complex * conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and * u(j+1) = VL(:,j) - i*VL(:,j+1). * * LDVL (input) INTEGER * The leading dimension of the array VL. LDVL >= 1; if * JOBVL = 'V', LDVL >= N. * * VR (output) DOUBLE PRECISION array, dimension (LDVR,N) * If JOBVR = 'V', the right eigenvectors v(j) are stored one * after another in the columns of VR, in the same order * as their eigenvalues. * If JOBVR = 'N', VR is not referenced. * If the j-th eigenvalue is real, then v(j) = VR(:,j), * the j-th column of VR. * If the j-th and (j+1)-st eigenvalues form a complex * conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and * v(j+1) = VR(:,j) - i*VR(:,j+1). * * LDVR (input) INTEGER * The leading dimension of the array VR. LDVR >= 1; if * JOBVR = 'V', LDVR >= N. * * WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK. * * LWORK (input) INTEGER * The dimension of the array WORK. LWORK >= max(1,3*N), and * if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N. For good * performance, LWORK must generally be larger. * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the WORK array, returns * this value as the first entry of the WORK array, and no error * message related to LWORK is issued by XERBLA. * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value. * > 0: if INFO = i, the QR algorithm failed to compute all the * eigenvalues, and no eigenvectors have been computed; * elements i+1:N of WR and WI contain eigenvalues which * have converged. */ intblas n = A->N(); ffassert(A->M() == n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); ffassert(vp->N() >= n); KN wr(n), wi(n), w(1); KNM mat(*A), vr(n, n), vl(n, n); intblas info, lw = -1; char JOBVL = 'N', JOBVR = 'V'; dgeev_(&JOBVL, &JOBVR, &n, mat, &n, wr, wi, vl, &n, vr, &n, w, &lw, &info); lw = w[0]; w.resize(lw); // cout << mat << endl; dgeev_(&JOBVL, &JOBVR, &n, mat, &n, wr, wi, vl, &n, vr, &n, w, &lw, &info); // cout << wr << endl; // cout << wi << endl; if (info < 0) { cout << " dgeev: the " << info << "-th argument had an illegal value." << endl; (*vp) = Complex(); (*vectp) = Complex(); } else if (info > 0) { cout << " dgeev: the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed." << endl; (*vp) = Complex(); (*vectp) = Complex(); } else if (info == 0) { for (int i = 0; i < n; ++i) { (*vp)[i] = Complex(wr[i], wi[i]); if (verbosity > 2) { cout << " dgeev: vp " << i << " : " << (*vp)[i] << endl; } if (wi[i] == 0) { for (int j = 0; j < n; ++j) { (*vectp)(j, i) = vr(j, i); } } else if (wi[i] > 0) { for (int j = 0; j < n; ++j) { (*vectp)(j, i) = Complex(vr(j, i), vr(j, i + 1)); } } else if (wi[i] < 0) { for (int j = 0; j < n; ++j) { (*vectp)(j, i) = Complex(vr(j, i - 1), -vr(j, i)); } } if (verbosity > 5) { cout << " dgeev: " << (*vectp)(':', i) << endl; } } } return info; } // (computation of the eigenvalues and right eigenvectors of a complex nonsymmetric matrix) long lapack_zgeev (KNM *const &A, KN *const &vp, KNM *const &vectp) { intblas nvp = 0, zero = 0; intblas n = A->N(); ffassert(A->M() == n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); ffassert(vp->N() >= n); KN w(n); KNM vr(n, n), vl(n, n); KNM mat(*A); intblas info, lw = -1; KN wk(1); KN rwk(2 * n); char N = 'N', V = 'V'; lw = -1;// to get opt size value zgeev_(&N, &V, &n, mat, &n, w, vl, &n, vr, &n, wk, &lw, rwk, &info); // cout << lw << " " << wk[0] << " " << info << endl; lw = wk[0].real(); wk.resize(lw); zgeev_(&N, &V, &n, mat, &n, w, vl, &n, vr, &n, wk, &lw, rwk, &info); if (info) { cout << " info = " << info << endl; } if (!info) { int k = 0; for (int i = 0; i < n; ++i) { (*vp)[i] = w[i]; if (verbosity > 2) { cout << " zgeev: vp " << i << " : " << (*vp)[i] << endl; } // for(int j=0;j 5) { cout << " zgeev : " << (*vectp)(':', i) << endl; } } } else { nvp = 0; (*vp) = Complex(); (*vectp) = Complex(); } return nvp; } // Generalized eigenvalue problems // DGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices // double real version long lapack_dggev (KNM *const &A, KNM *const &B, KN *const &vpa, KN *const &vpb, KNM *const &vectp) { intblas nvp = 0, zero = 0; intblas n = A->N(); ffassert(A->M() == n); ffassert(B->M() == n); ffassert(B->N() == n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); ffassert(vpa->N() >= n); ffassert(vpb->N() >= n); KN war(n), wai(n), wb(n), vr(n * n), vl(n * n); KNM matA(*A); KNM matB(*B); intblas info, lw = -1; KN w(1); // VL: By default, we compute the right eigenvectors char VL = 'N', VR = 'V'; dggev_(&VL, &VR, &n, matA, &n, matB, &n, war, wai, wb, vl, &n, vr, &n, w, &lw, &info); lw = w[0]; w.resize(lw); dggev_(&VL, &VR, &n, matA, &n, matB, &n, war, wai, wb, vl, &n, vr, &n, w, &lw, &info); if (info) { cout << " info = " << info << endl; } if (!info) { int k = 0; for (int i = 0; i < n; ++i) { (*vpa)[i] = Complex(war[i], wai[i]); (*vpb)[i] = wb[i]; if (verbosity > 2) { cout << " dggev: vp " << i << " : " << (*vpa)[i] << " ; " << (*vpb)[i] << endl; } if (wai[i] == 0) { for (int j = 0; j < n; ++j) { (*vectp)(j, i) = vr[k++]; } } else if (wai[i] > 0) { int ki = k + n; for (int j = 0; j < n; ++j) { (*vectp)(j, i) = Complex(vr[k++], vr[ki++]); } } else { int kr = k - n; for (int j = 0; j < n; ++j) { (*vectp)(j, i) = Complex(vr[kr++], -vr[k++]); } } if (verbosity > 5) { cout << " dggev : " << (*vectp)(':', i) << endl; } } } else { nvp = 0; (*vpa) = Complex(); (*vectp) = Complex(); } return nvp; } // Generalized eigenvalue problems // DGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices // double complex version long lapack_zggev (KNM *const &A, KNM *const &B, KN *const &vpa, KN *const &vpb, KNM *const &vectp) { // subroutine ZGGEV ( // 1 character JOBVL, // 2 character JOBVR, // 3 integer N, // 4 complex*16, dimension( lda, * ) A, // 5 integer LDA, // 6 complex*16, dimension( ldb, * ) B, // 7 integer LDB, // 8 complex*16, dimension( * ) ALPHA, // 9 complex*16, dimension( * ) BETA, // 10 complex*16, dimension( ldvl, * ) VL, // 11 integer LDVL, // 12 complex*16, dimension( ldvr, * ) VR, // 13 integerLDVR, // 14 complex*16, dimension( * ) WORK, // 15 integer LWORK, // 16 double precision, dimension( * ) RWORK, // 17 integer INFO) intblas nvp = 0, zero = 0; intblas n = A->N(); ffassert(A->M() == n); ffassert(B->M() == n); ffassert(B->N() == n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); ffassert(vpa->N() >= n); ffassert(vpb->N() >= n); KNM matA(*A); KNM matB(*B); KNM vl(1, 1); intblas info, lw = -1; KN w(1); KN wr(8 * n); // VL: By default, we compute the right eigenvectors char VL = 'N', VR = 'V'; zggev_(&VL, &VR, &n, matA, &n, matB, &n, *vpa, *vpb, vl, &n, *vectp, &n, w, &lw, wr, &info); lw = w[0].real(); w.resize(lw); zggev_(&VL, &VR, &n, matA, &n, matB, &n, *vpa, *vpb, vl, &n, *vectp, &n, w, &lw, wr, &info); if (info) { cout << " info = " << info << endl; nvp = 0; } else {} return nvp; } // Generalized eigenvalue problems // ZHEGV computes all the eigenvalues, and optionally, the eigenvectors // of a complex generalized Hermitian-definite eigenproblem, of the form // A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. // Here A and B are assumed to be Hermitian and B is also // positive definite. long lapack_zhegv (KNM *const &A, KNM *const &B, KN *const &vp, KNM *const &vectp) { // subroutine ZHEGV ( // 1 integer ITYPE, // 2 character JOBZ, // 3 character UPLO, // 4 integer N, // 5 complex*16, dimension( lda, * ) A, // 6 integer LDA, // 7 complex*16, dimension( ldb, * ) B, // 8 integer LDB, // 9 double precision, dimension( * ) W, // 10 complex*16, dimension( * ) WORK, // 11 integer LWORK, // 12 double precision, dimension( * ) RWORK, // 13 integer INFO) intblas nvp = 0, zero = 0; intblas n = A->N(); ffassert(A->M() == n); ffassert(B->M() == n); ffassert(B->N() == n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); ffassert(vp->N() >= n); KNM matA(*A); KNM matB(*B); KNM vl(1, 1); intblas info, lw = -1; KN w(1); KN wr(max(1, int(3 * n - 2))); intblas itype = 1; // generalized eigenvalue problem Ax = lambda Bx // VL: By default, we compute the eigenvectors and use the upper triangles of A and B char JOBZ = 'V', UPLO = 'U'; zhegv_(&itype, &JOBZ, &UPLO, &n, matA, &n, matB, &n, *vp, w, &lw, wr, &info); lw = w[0].real(); w.resize(lw); zhegv_(&itype, &JOBZ, &UPLO, &n, matA, &n, matB, &n, *vp, w, &lw, wr, &info); if (info) { cout << " info = " << info << endl; nvp = 0; } else { *vectp = matA; } return nvp; } // GL, 05/10/2011 (computation of all the eigenvalues and the eigenvectors of a real generalized symmetric-definite eigenproblem, of the form A*x=(lambda)*B*x) long lapack_dsygvd (KNM *const &A, KNM *const &B, KN *const &vp, KNM *const &vectp) { /* * SUBROUTINE DSYGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, LWORK, IWORK, LIWORK, INFO ) * ITYPE (input) INTEGER * Specifies the problem type to be solved: * = 1: A*x = (lambda)*B*x * = 2: A*B*x = (lambda)*x * = 3: B*A*x = (lambda)*x * * JOBZ (input) CHARACTER*1 * = 'N': Compute eigenvalues only; * = 'V': Compute eigenvalues and eigenvectors. * * UPLO (input) CHARACTER*1 * = 'U': Upper triangles of A and B are stored; * = 'L': Lower triangles of A and B are stored. * * N (input) INTEGER * The order of the matrices A and B. N >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA, N) * On entry, the symmetric matrix A. If UPLO = 'U', the * leading N-by-N upper triangular part of A contains the * upper triangular part of the matrix A. If UPLO = 'L', * the leading N-by-N lower triangular part of A contains * the lower triangular part of the matrix A. * * On exit, if JOBZ = 'V', then if INFO = 0, A contains the * matrix Z of eigenvectors. The eigenvectors are normalized * as follows: * if ITYPE = 1 or 2, Z**T*B*Z = I; * if ITYPE = 3, Z**T*inv(B)*Z = I. * If JOBZ = 'N', then on exit the upper triangle (if UPLO='U') * or the lower triangle (if UPLO='L') of A, including the * diagonal, is destroyed. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,N). * * B (input/output) DOUBLE PRECISION array, dimension (LDB, N) * On entry, the symmetric matrix B. If UPLO = 'U', the * leading N-by-N upper triangular part of B contains the * upper triangular part of the matrix B. If UPLO = 'L', * the leading N-by-N lower triangular part of B contains * the lower triangular part of the matrix B. * * On exit, if INFO <= N, the part of B containing the matrix is * overwritten by the triangular factor U or L from the Cholesky * factorization B = U**T*U or B = L*L**T. * * LDB (input) INTEGER * The leading dimension of the array B. LDB >= max(1,N). * * W (output) DOUBLE PRECISION array, dimension (N) * If INFO = 0, the eigenvalues in ascending order. * * WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK. * * LWORK (input) INTEGER * The dimension of the array WORK. * If N <= 1, LWORK >= 1. * If JOBZ = 'N' and N > 1, LWORK >= 2*N+1. * If JOBZ = 'V' and N > 1, LWORK >= 1 + 6*N + 2*N**2. * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal sizes of the WORK and IWORK * arrays, returns these values as the first entries of the WORK * and IWORK arrays, and no error message related to LWORK or * LIWORK is issued by XERBLA. * * IWORK (workspace/output) INTEGER array, dimension (MAX(1,LIWORK)) * On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. * * LIWORK (input) INTEGER * The dimension of the array IWORK. * If N <= 1, LIWORK >= 1. * If JOBZ = 'N' and N > 1, LIWORK >= 1. * If JOBZ = 'V' and N > 1, LIWORK >= 3 + 5*N. * * If LIWORK = -1, then a workspace query is assumed; the * routine only calculates the optimal sizes of the WORK and * IWORK arrays, returns these values as the first entries of * the WORK and IWORK arrays, and no error message related to * LWORK or LIWORK is issued by XERBLA. * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: DPOTRF or DSYEVD returned an error code: * <= N: if INFO = i and JOBZ = 'N', then the algorithm * failed to converge; i off-diagonal elements of an * intermediate tridiagonal form did not converge to * zero; * if INFO = i and JOBZ = 'V', then the algorithm * failed to compute an eigenvalue while working on * the submatrix lying in rows and columns INFO/(N+1) * through mod(INFO,N+1); * > N: if INFO = N + i, for 1 <= i <= N, then the leading * minor of order i of B is not positive definite. * The factorization of B could not be completed and * no eigenvalues or eigenvectors were computed. */ intblas n = A->N(); ffassert(A->M() == n); ffassert(B->M() == n); ffassert(B->N() == n); ffassert(vp->N() >= n); ffassert(vectp->M() >= n); ffassert(vectp->N() >= n); KN war(n), wai(n), wb(n), vr(n * n), vl(n * n); KNM matA(*A), matB(*B); intblas itype = 1, info, lw = -1; KN w(1); KN iw(1); char JOBZ = 'V', UPLO = 'U'; dsygvd_(&itype, &JOBZ, &UPLO, &n, matA, &n, matB, &n, *vp, w, &lw, iw, &lw, &info); lw = w[0]; w.resize(lw); iw.resize(lw); dsygvd_(&itype, &JOBZ, &UPLO, &n, matA, &n, matB, &n, *vp, w, &lw, iw, &lw, &info); if (info < 0) { cout << " dsygvd: the " << info << "-th argument had an illegal value." << endl; } else if (info > 0) { cout << " dsygvd: DPOTRF or DSYEVD returned an error code." << endl; } else if (info == 0) { for (int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { (*vectp)(j, i) = matA(j, i); } } } } return info; } // GL,27/09/2011 (singular value decomposition of a rectangular real matrix) long lapack_dgesdd (KNM *const &A, KNM *const &U, KN *const &S, KNM *const &V) { /* * SUBROUTINE DGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, IWORK, INFO ) * JOBZ (input) CHARACTER*1 * Specifies options for computing all or part of the matrix U: * = 'A': all M columns of U and all N rows of V**T are * returned in the arrays U and VT; * = 'S': the first min(M,N) columns of U and the first * min(M,N) rows of V**T are returned in the arrays U * and VT; * = 'O': If M >= N, the first N columns of U are overwritten * on the array A and all rows of V**T are returned in * the array VT; * otherwise, all columns of U are returned in the * array U and the first M rows of V**T are overwritten * in the array A; * = 'N': no columns of U or rows of V**T are computed. * * M (input) INTEGER * The number of rows of the input matrix A. M >= 0. * * N (input) INTEGER * The number of columns of the input matrix A. N >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA,N) * On entry, the M-by-N matrix A. * On exit, * if JOBZ = 'O', A is overwritten with the first N columns * of U (the left singular vectors, stored * columnwise) if M >= N; * A is overwritten with the first M rows * of V**T (the right singular vectors, stored * rowwise) otherwise. * if JOBZ .ne. 'O', the contents of A are destroyed. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,M). * * S (output) DOUBLE PRECISION array, dimension (min(M,N)) * The singular values of A, sorted so that S(i) >= S(i+1). * * U (output) DOUBLE PRECISION array, dimension (LDU,UCOL) * UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N; * UCOL = min(M,N) if JOBZ = 'S'. * If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the M-by-M * orthogonal matrix U; * if JOBZ = 'S', U contains the first min(M,N) columns of U * (the left singular vectors, stored columnwise); * if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced. * * LDU (input) INTEGER * The leading dimension of the array U. LDU >= 1; if * JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M. * * VT (output) DOUBLE PRECISION array, dimension (LDVT,N) * If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the * N-by-N orthogonal matrix V**T; * if JOBZ = 'S', VT contains the first min(M,N) rows of * V**T (the right singular vectors, stored rowwise); * if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced. * * LDVT (input) INTEGER * The leading dimension of the array VT. LDVT >= 1; if * JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N; * if JOBZ = 'S', LDVT >= min(M,N). * * WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK; * * LWORK (input) INTEGER * The dimension of the array WORK. LWORK >= 1. * If JOBZ = 'N', * LWORK >= 3*min(M,N) + max(max(M,N),7*min(M,N)). * If JOBZ = 'O', * LWORK >= 3*min(M,N) + * max(max(M,N),5*min(M,N)*min(M,N)+4*min(M,N)). * If JOBZ = 'S' or 'A' * LWORK >= 3*min(M,N) + * max(max(M,N),4*min(M,N)*min(M,N)+4*min(M,N)). * For good performance, LWORK should generally be larger. * If LWORK = -1 but other input arguments are legal, WORK(1) * returns the optimal LWORK. * * IWORK (workspace) INTEGER array, dimension (8*min(M,N)) * * INFO (output) INTEGER * = 0: successful exit. * < 0: if INFO = -i, the i-th argument had an illegal value. * > 0: DBDSDC did not converge, updating process failed. */ intblas n = A->N(); intblas m = A->M(); U->resize(n, n); S->resize(min(n, m)); V->resize(m, m); KNM VT(m, m); KN iw(8 * min(n, m)); intblas info, lw = -1; KN w(1); char JOBZ = 'A'; dgesdd_(&JOBZ, &n, &m, *A, &n, *S, *U, &n, VT, &m, w, &lw, iw, &info); lw = w[0]; w.resize(lw); dgesdd_(&JOBZ, &n, &m, *A, &n, *S, *U, &n, VT, &m, w, &lw, iw, &info); if (info < 0) { cout << " dgesdd: the " << info << "-th argument had an illegal value." << endl; } else if (info > 0) { cout << " dgesdd: DBDSDC did not converge, updating process failed." << endl; } else if (info == 0) { for (int i = 0; i < m; ++i) { for (int j = 0; j < m; ++j) { (*V)(i, j) = VT(j, i); } } } return info; } // GL,28/09/2011 (computation of the eigenvalues and eigenvectors of a real symmetric matrix) long lapack_dsyev (KNM *const &A, KN *const &vp, KNM *const &vectp) { /* * SUBROUTINE DSYEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO ) * JOBZ (input) CHARACTER*1 * = 'N': Compute eigenvalues only; * = 'V': Compute eigenvalues and eigenvectors. * * UPLO (input) CHARACTER*1 * = 'U': Upper triangle of A is stored; * = 'L': Lower triangle of A is stored. * * N (input) INTEGER * The order of the matrix A. N >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA, N) * On entry, the symmetric matrix A. If UPLO = 'U', the * leading N-by-N upper triangular part of A contains the * upper triangular part of the matrix A. If UPLO = 'L', * the leading N-by-N lower triangular part of A contains * the lower triangular part of the matrix A. * On exit, if JOBZ = 'V', then if INFO = 0, A contains the * orthonormal eigenvectors of the matrix A. * If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') * or the upper triangle (if UPLO='U') of A, including the * diagonal, is destroyed. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,N). * * W (output) DOUBLE PRECISION array, dimension (N) * If INFO = 0, the eigenvalues in ascending order. * * WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK. * * LWORK (input) INTEGER * The length of the array WORK. LWORK >= max(1,3*N-1). * For optimal efficiency, LWORK >= (NB+2)*N, * where NB is the blocksize for DSYTRD returned by ILAENV. * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the WORK array, returns * this value as the first entry of the WORK array, and no error * message related to LWORK is issued by XERBLA. * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, the algorithm failed to converge; i * off-diagonal elements of an intermediate tridiagonal * form did not converge to zero. */ intblas n = A->N(); ffassert(A->M() == n); ffassert(vectp->N() == n); ffassert(vectp->M() == n); ffassert(vp->N() == n); KNM mat(*A); intblas info, lw = -1; KN w(1); char JOBZ = 'V', UPLO = 'U'; dsyev_(&JOBZ, &UPLO, &n, mat, &n, *vp, w, &lw, &info); lw = w[0]; w.resize(lw); dsyev_(&JOBZ, &UPLO, &n, mat, &n, *vp, w, &lw, &info); if (info < 0) { cout << " dsyev: the " << info << "-th argument had an illegal value." << endl; } else if (info > 0) { cout << " dsyev: the algorithm failed to converge." << endl; } else if (info == 0) { *vectp = mat; } return info; } // VL,17/11/2016 (computation of the eigenvalues and eigenvectors of a complex Hermitian symmetric matrix) long lapack_zheev (KNM *const &A, KN *const &vp, KNM *const &vectp) { /* * subroutine ZHEEV (character JOBZ, * character UPLO, * integer N, * complex*16, dimension( lda, * ) A, * integer LDA, * double precision, dimension( * ) W, * complex*16, dimension( * ) WORK, * integer LWORK, * double precision, dimension( * ) RWORK, * integer INFO) * ZHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices */ intblas n = A->N(); ffassert(A->M() == n); ffassert(vectp->N() == n); ffassert(vectp->M() == n); ffassert(vp->N() == n); KNM mat(*A); intblas info, lw = -1; KN w(1); KN rw(max(1, int(3 * n - 2))); char JOBZ = 'V', UPLO = 'U'; zheev_(&JOBZ, &UPLO, &n, mat, &n, *vp, w, &lw, rw, &info); lw = w[0].real(); w.resize(lw); zheev_(&JOBZ, &UPLO, &n, mat, &n, *vp, w, &lw, rw, &info); if (info < 0) { cout << " zheev: the " << info << "-th argument had an illegal value." << endl; } else if (info > 0) { cout << " zheev: the algorithm failed to converge." << endl; } else if (info == 0) { *vectp = mat; } return info; } template class Inverse { public: T t; Inverse (T v) : t(v) {} template Inverse (TT v): t(v) {} template Inverse (TT *v): t(*v) {} operator const T & () const {return t;}}; template class Mult { public: T a; bool ta; T b; bool tb; Mult (T aa, T bb) : a(aa), b(bb), ta(0), tb(0) {} // Transpose< Mult (Transpose aa, T bb) : a(aa), b(bb), ta(1), tb(0) {} Mult (Transpose aa, Transpose bb) : a(aa), b(bb), ta(1), tb(1) {} Mult (T aa, Transpose bb) : a(aa), b(bb), ta(1), tb(1) {} }; template class OneBinaryOperatorRNM_inv: public OneOperator { public: OneBinaryOperatorRNM_inv () : OneOperator(atype *> >(), atype *>(), atype()) {} E_F0*code (const basicAC_F0 &args) const { Expression p = args[1]; if (!p->EvaluableWithOutStack()) { bool bb = p->EvaluableWithOutStack(); cout << " Error exposant ??? " << bb << " " << *p << endl; CompileError(" A^p, The p must be a constant == -1, sorry"); } long pv = GetAny((*p)(0)); if (pv != -1) { char buf[100]; sprintf(buf, " A^%ld, The pow must be == -1, sorry", pv); CompileError(buf); } return new E_F_F0 *>, KNM *>(Build *>, KNM *>, t[0]->CastTo(args[0])); } }; template KNM*Solve (KNM *a, Inverse *> b) { /* * SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO ) * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0. * * NRHS (input) INTEGER * The number of right hand sides, i.e., the number of columns * of the matrix B. NRHS >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA,N) * On entry, the N-by-N coefficient matrix A. * On exit, the factors L and U from the factorization * A = P*L*U; the unit diagonal elements of L are not stored. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,N). * * IPIV (output) INTEGER array, dimension (N) * The pivot indices that define the permutation matrix P; * row i of the matrix was interchanged with row IPIV(i). * * B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) * On entry, the N-by-NRHS matrix of right hand side matrix B. * On exit, if INFO = 0, the N-by-NRHS solution matrix X. * * LDB (input) INTEGER * The leading dimension of the array B. LDB >= max(1,N). * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, U(i,i) is exactly zero. The factorization * has been completed, but the factor U is exactly * singular, so the solution could not be computed. * */ typedef double R; integer info; KNM B(*b); integer n = B.N(); KN p(n); ffassert(B.M() == n); if (INIT) { a->init(n, n); } else { a->resize(n, n); } *a = 0.; for (int i = 0; i < n; ++i) { (*a)(i, i) = (R)1; } ; dgesv_(&n, &n, B, &n, p, *a, &n, &info); if (info) {cerr << " error: dgesv_ " << info << endl;} return a; } // Template interface inline int gemm (char *transa, char *transb, integer *m, integer * n, integer *k, double *alpha, double *a, integer *lda, double *b, integer *ldb, double *beta, double *c, integer *ldc) { return dgemm_(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc); } inline int gemm (char *transa, char *transb, integer *m, integer * n, integer *k, Complex *alpha, Complex *a, integer *lda, Complex *b, integer *ldb, Complex *beta, Complex *c, integer *ldc) { return zgemm_(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc); } template KNM*mult (KNM *a, const KNM_ &A, const KNM_ &B) { // C=A*B R alpha = 1., beta = R(ibeta); char tA, tB; if (init) {a->init();} intblas N = A.N(); intblas M = B.M(); intblas K = A.M(); KNM &C = *a; C.resize(N, M); ffassert(K == B.N()); R *A00 = &A(0, 0), *A10 = &A(1, 0), *A01 = &A(0, 1); R *B00 = &B(0, 0), *B10 = &B(1, 0), *B01 = &B(0, 1); R *C00 = &C(0, 0), *C10 = &C(1, 0), *C01 = &C(0, 1); intblas lsa = A10 - A00, lsb = B10 - B00, lsc = C10 - C00; intblas lda = A01 - A00, ldb = B01 - B00, ldc = C01 - C00; if (verbosity > 10) { cout << " N:" << N << " " << M << " " << K << endl; cout << lsa << " " << lsb << " " << lsc << " init " << init << endl; cout << lda << " " << ldb << " " << ldc << endl; } tA = (lda == 1 && N != 1) ? 'T' : 'N'; // N,K tB = (ldb == 1 && K != 1) ? 'T' : 'N'; // K,M if (lda == 1) {lda = lsa;} if (ldb == 1) {ldb = lsb;} if (beta == 0.) { C = R(); } #ifdef XXXXXXXXXXXXXX for (int i = 0; i < N; ++i) { for (int j = 0; j < M; ++j) { for (int k = 0; k < K; ++k) { C(i, j) += A(i, k) * B(k, j); } } } #else gemm(&tB, &tA, &N, &M, &K, &alpha, A00, &lda, B00, &ldb, &beta, C00, &ldc); #endif return a; /* * The Fortran interface for these procedures are: * SUBROUTINE xGEMM ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC ) * where TRANSA and TRANSB determines if the matrices A and B are to be transposed. * M is the number of rows in matrix A and C. N is the number of columns in matrix B and C. * K is the number of columns in matrix A and rows in matrix B. * LDA, LDB and LDC specifies the size of the first dimension of the matrices, as laid out in memory; * meaning the memory distance between the start of each row/column, depending on the memory structure (Dongarra et al. 1990). */ } template KNM*mult (KNM *a, Mult *> bc) { if ((bc.ta == 0) && (bc.tb == 0)) { return mult(a, *bc.a, *bc.b); } else if ((bc.ta == 1) && (bc.tb == 0)) { return mult(a, bc.a->t(), *bc.b); } else if ((bc.ta == 0) && (bc.tb == 1)) { return mult(a, *bc.a, bc.b->t()); } else if ((bc.ta == 1) && (bc.tb == 1)) { return mult(a, bc.a->t(), bc.b->t()); } else { // should never happen return NULL; } } template KNM*SolveC (KNM *a, Inverse *> b) { /* * SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO ) * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0. * * NRHS (input) INTEGER * The number of right hand sides, i.e., the number of columns * of the matrix B. NRHS >= 0. * * A (input/output) DOUBLE PRECISION array, dimension (LDA,N) * On entry, the N-by-N coefficient matrix A. * On exit, the factors L and U from the factorization * A = P*L*U; the unit diagonal elements of L are not stored. * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,N). * * IPIV (output) INTEGER array, dimension (N) * The pivot indices that define the permutation matrix P; * row i of the matrix was interchanged with row IPIV(i). * * B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) * On entry, the N-by-NRHS matrix of right hand side matrix B. * On exit, if INFO = 0, the N-by-NRHS solution matrix X. * * LDB (input) INTEGER * The leading dimension of the array B. LDB >= max(1,N). * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, U(i,i) is exactly zero. The factorization * has been completed, but the factor U is exactly * singular, so the solution could not be computed. * */ typedef Complex R; integer info; KNM B(*b); integer n = B.N(); KN p(n); ffassert(B.M() == n); if (INIT) { a->init(n, n); } else { a->resize(n, n); } *a = 0.; for (int i = 0; i < n; ++i) { (*a)(i, i) = (R)1; } ; zgesv_(&n, &n, (R *)B, &n, p, (R *)*a, &n, &info); if (info) {cerr << " error: zgesv_ " << info << endl;} return a; } template R Build2 (A a, B b) { return R(a, b); } static void Load_Init () { // le constructeur qui ajoute la fonction "splitmesh3" a freefem++ if (map_type.find(typeid(Inverse *>).name()) == map_type.end()) { if (verbosity) { cout << " Add lapack interface ..."; } Dcl_Type *> >(); Dcl_Type *> >(); Dcl_Type *> >(); Dcl_Type *> >(); TheOperators->Add("^", new OneBinaryOperatorRNM_inv()); TheOperators->Add("*", new OneOperator2 *>, KNM *, KNM *>(Build2)); TheOperators->Add("*", new OneOperator2 *>, KNM *, KNM *>(Build2)); TheOperators->Add("^", new OneBinaryOperatorRNM_inv()); TheOperators->Add("=", new OneOperator2 *, KNM *, Inverse *> >(Solve<0> )); TheOperators->Add("=", new OneOperator2 *, KNM *, Inverse *> >(SolveC<0> )); TheOperators->Add("<-", new OneOperator2 *, KNM *, Inverse *> >(Solve<1> )); TheOperators->Add("<-", new OneOperator2 *, KNM *, Inverse *> >(SolveC<1> )); TheOperators->Add("=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("+=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("+=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("-=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("-=", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("<-", new OneOperator2 *, KNM *, Mult *> >(mult )); TheOperators->Add("<-", new OneOperator2 *, KNM *, Mult *> >(mult )); Global.Add("inv", "(", new OneOperator1 *>(lapack_inv)); Global.Add("inv", "(", new OneOperator1 *>(lapack_inv)); Global.Add("dgeev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_dgeev)); Global.Add("zgeev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_zgeev)); // add FH Global.Add("geev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_dgeev)); Global.Add("geev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_zgeev)); Global.Add("dggev", "(", new OneOperator5_ *, KNM *, KN *, KN *, KNM *>(lapack_dggev)); Global.Add("zggev", "(", new OneOperator5_ *, KNM *, KN *, KN *, KNM *>(lapack_zggev)); Global.Add("dsygvd", "(", new OneOperator4_ *, KNM *, KN *, KNM *>(lapack_dsygvd)); Global.Add("dgesdd", "(", new OneOperator4_ *, KNM *, KN *, KNM *>(lapack_dgesdd)); Global.Add("zhegv", "(", new OneOperator4_ *, KNM *, KN *, KNM *>(lapack_zhegv)); Global.Add("dsyev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_dsyev)); Global.Add("zheev", "(", new OneOperator3_ *, KN *, KNM *>(lapack_zheev)); } else if (verbosity) { cout << "( load: lapack <=> fflapack , skeep ) "; } } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/NSCaraCyl.edp000644 000767 000024 00000022042 13256636774 020623 0ustar00hechtstaff000000 000000 // NBPROC 4 // PARAM -cas 2 -n 20 -ndt 50 // usage : // ff-mpirun -np 8 NSNewtonCyl-100-mpi.edp -cas 2 -n 20 -ndt 50 /* args can are: -ns no output of script -cas 1|2|3 case of benchmark or Reynorl integer) -n nbseg nb of seg on input edge .. -ndt ndt nb time step par period -nNewton nNx number of of iteration in Newtow loop. -gp gnuplot .. -T final time */ // Author: F. Hecht .. // jan 2012 Stationnary imcompressible Navier Stokes Equation with Newton method. // a round a 2d Cylinder // Benchmark // http://www.mathematik.tu-dortmund.de/lsiii/cms/papers/SchaeferTurek1996.pdf // // Thank to Macarena Gómez Mármol // need version 3.20-2 **** for pipe pluging // otherwise remove line with pgnuplot // corresponding to gnuplot visualization // -------------------------------------------------- include "getARGV.idp" include "getARGV.idp" load "MUMPS" load "shell" load "scotch" load "pipe" int cas = getARGV("-cas",2);; // 1, 2 or 3 .. int n=getARGV("-n",15); // mesh size ... int ndt=getARGV("-ndt",25); int schema = 2; // order 1 bool gplt = usedARGV("-gp")>=0 && (mpirank==0) && (cas!=1) ; // real Tend = getARGV("-T",2);; bool save=0; real cpu0=mpiWtime() ; string data="./dd";//"2D-"+cas+"-"+n; if(mpirank==0) mkdir(data); string fgnup =data+"/fld2-"+cas+".gp"; string fdata = data+"/sol-cas-"; string fTh = data+"/Th-"+cas+".msh"; pstream pgnuplot( gplt ? "gnuplot": "cat" ); // parameter ... real D=0.1; real H=0.41; int ncurl=20; real[int] colorhsv=[ // color hsv model 3./6., 1 , 0.5, // dark cyan 3./6., 1 , 1, // cyan 4./6., 1 , 1, // blue 5./6., 1 , 1, // magenta 1, 1. , 1, // red 1, 0.5 , 1 // light red ]; real[int] vcurl( ncurl*2+1); { int n = vcurl.n; real d = 100; real c = 1.3 ; real ccc=0,cc = d/(1- c^(ncurl+1))/ (1-c) ; vcurl[ncurl]=0; for( int i =1 ; i <= ncurl;++i) { ccc += cc; cc *= c ; // cout << i << " " << ncurl-i << " " << ncurl+i << endl; vcurl[ncurl-i] = -ccc; vcurl[ncurl+i] = ccc; } cout << vcurl << endl; } real cx0 = 0.2, cy0 = 0.2; // center of cyl. real xa = 0.15, ya=0.2, xe = 0.25,ye =0.2;// point for pressure.. //Definición del dominio border fr1(t=0,2.2){x=t; y=0; label=1;} border fr2(t=0,H){x=2.2; y=t; label=2;} border fr3(t=2.2,0){x=t; y=H; label=1;} border fr4(t=H,0){x=0; y=t; label=1;} border fr5(t=2*pi,0){x=cx0+D*sin(t)/2; y=cy0+D*cos(t)/2; label=3;} //plot(fr1(n)+fr2(n)+fr3(n)+fr4(n)+fr5(n)); mesh Th; if(mpirank==0) { Th=buildmesh(fr1(5*n)+fr2(n)+fr3(5*n)+fr4(n)+fr5(-n*3)); int[int] nupart(Th.nt); nupart=0; if(mpisize>1) scotch(nupart, Th, mpisize); Th=change(Th,fregion= nupart[nuTriangle]); savemesh(Th,fTh); plot(Th,wait=0); } broadcast(processor(0),Th); // partition of the mesh ... // for computation of the Strouhal number include "func-max.idp" real hsize = D*pi/n; // size of the mesh ???? // bounding box for the plot func bb=[[0,H/4],[H*2,3*H/4]]; // operator macro Grad(u1,u2) [ dx(u1),dy(u1), dx(u2),dy(u2)]// macro Eps(u1,u2) [ dx(u1),(dy(u1)+dx(u2))*0.5,(dy(u1)+dx(u2))*0.5,dy(u2)]// macro UgradV(u1,u2,v1,v2) [ [u1,u2]'*[dx(v1),dy(v1)] , [u1,u2]'*[dx(v2),dy(v2)] ]// macro div(u1,u2) (dx(u1)+dy(u2))// // FE Space fespace Xh(Th,P2);fespace Mh(Th,P1); fespace Wh(Th,[P2,P2,P1]); fespace Rh(Th,P1dc); Wh [u1,u2,p]; Wh [up1,up2,pp]; Wh [upp1,upp2,ppp]; Wh [vx1,vx2,vxp]; Wh [vy1,vy2,vyp]; varf von3x([u1,u2,p],[v1,v2,q]) = on(3 ,u1= 1); varf von3y([u1,u2,p],[v1,v2,q]) = on(3 ,u2= 1); vx1[]= von3x(0,Wh,tgv=1); vy1[]= von3y(0,Wh,tgv=1); real coefv =1, vtheta=0; real Um= 1.5;// max volicite case 2,3 (Rey 100) if( cas>3) { Um = cas*1.5/100.; cas =2; } func Ub = Um*2./3.; real nu = 1e-3; real mu = 2*nu; // Formulation in Eps : Eps func Rey = Ub*D/nu; func ccdrag = 2./ square(Ub) /D ; func ccfreq = D/Ub; real freq = 0.3/ccfreq; // frequence theorique // initial guess.. u1[]=0; real T=0; // current time // velocity BC .. func coefV = (cas<3)? 1 : sin(pi*min(T/8.,1.)); func U1 = 4.*Um*y*(H-y)/(H*H) * coefv ; func U2 = 0 ; // stop test for Newton real eps=1e-8*Um; // choise of time step .. int mdt = rint(Tend*freq*ndt); real dt = Tend/mdt;// ntd pas de temps pas periode real CFL = Um*dt/hsize; if(mpirank==0) cout << " dt =" << dt << " CFL = " << CFL << endl; verbosity=0; // BDF2 schema order 2 in time ... real[int] beta=[1.5, -2., +0.5]; if(schema ==1) beta=[1,-1,0]; // Euler implicit + ruse OP real[int] ab=1./dt*beta ; if(cas ==1) { // static case Um = 0.3; Tend=0; ab=0; // no time .. } // init.. int iter=0; if(mpirank==0) { ofstream f(fgnup);// clean the file .. } varf GStokesl([du1,du2,dp],[v1,v2,q]) = int2d(Th,mpirank) ( ab[0]*[du1,du2]'*[v1,v2] + mu*(Eps(du1,du2)'*Eps(v1,v2) ) - div(du1,du2)*q - div(v1,v2)*dp - 1e-8*dp*q // stabilization term ) + on(1,3,du1=0,du2=0) + on(2,du2=0) ; varf GStokesl0([du1,du2,dp],[v1,v2,q]) = int2d(Th,mpirank) ( ab[0]*[du1,du2]'*[v1,v2] + mu*(Eps(du1,du2)'*Eps(v1,v2) ) - div(du1,du2)*q - div(v1,v2)*dp - 1e-8*dp*q // stabilization term ) ; varf Vconvect([du1,du2,dp],[v1,v2,q]) = -int2d(Th,mpirank) ( ab[1]* ( [v1,v2]'* [ convect([u1,u2],-dt,up1), convect([u1,u2],-dt,up2) ] ) + ab[2]* ( [v1,v2]'* [ convect([u1,u2],-dt*2,upp1), convect([u1,u2],-dt*2,upp2) ] ) ); varf Vconvect1([du1,du2,dp],[v1,v2,q]) = -int2d(Th,mpirank) ( ab[1]* ( [v1,v2]'* [ convect([u1,u2],-dt,up1), convect([u1,u2],-dt,up2) ] ) ); varf VBC([u1,u2,p],[v1,v2,q]) = on(1,u1=U1,u2=U2); real[int] bcl=VBC(0,Wh); real[int] bl(Wh.ndof),b(Wh.ndof),bcv(Wh.ndof); matrix A,A0; A=GStokesl(Wh,Wh,solver=GMRES); //sparsesolver,master=-1); //mpiAllReduce(Al,A,mpiCommWorld,mpiSUM); A0=GStokesl0(Wh,Wh,solver=GMRES); //mpiAllReduce(A0,A,mpiCommWorld,mpiSUM); set(A,solver=sparsesolver,master=-1); Wh [w1,w2,wp]; // loop in time if need .. cout << "Stort\n"; real CPU0=mpiWtime(); while(1) { real err=0; T += dt; iter++; real co = coefv; coefv = coefV;// coef in velocty .. if( co != coefv ) bcl=VBC(0,Wh); upp1[]=up1[]; up1[]=u1[]; if(schema>1) { u1[] *=2; u1[] -= upp1[]; } if( ab[2]) bcv = Vconvect(0,Wh); else bcv = Vconvect1(0,Wh); bl = bcv; bl += bcl; { //mpiAllReduce(bl,b,mpiCommWorld,mpiSUM); w1[]=A^-1*bl; u1[] = w1[]; if(mpirank==0) cout << T << "\t " << n << " rey =" << Rey << " U1 max = " << u1[].max <<" " ; } //if( schema==1) //{ u1[] *= 2; u1[] -= up1[]; } if(cas==1) { plot([u1,u2],p, coef = 0.02/u1[].max, bb=bb,wait=1, cmm=" cas 1 "); } b = A0*w1[]; b += bcv; real cdrag = -(b'*vx1[]) ; real clift = b'*vy1[] ; real drag,lift,Cd,Cl,Ta; mpiAllReduce(clift,lift,mpiCommWorld,mpiSUM); mpiAllReduce(cdrag,drag,mpiCommWorld,mpiSUM); if ( iter > 2) { Cd = ccdrag*drag; Cl = ccdrag*lift; } // end of compute the Drag and lift Coef Ta = T/ccfreq; // The adimensional time .. real Deltap = p(xa,ya) - p(xe,ye) ; // the Deltap real strouhal = AddStrouhal(iter,Ta,Cl); AddMaxO2(Cd,iter,mxdrag,mxdragi); AddMaxO2(Cl,iter,mxlift,mxlifti); real Cdx = mxdrag.max, Clx = mxlift.max; if(mpirank==0) { { ofstream f(fgnup,append); f << T << " " << drag << " " << lift << " " << Ta << " " << Cd << " " << Cl << " " << Deltap <<" " << mpiWtime()-cpu0 << " " << iter << " " << strouhal << endl; } real Td = max((int(Ta)-20),0); // period = 3 en Ta if(cas==3) Td=0; if(gplt) { pgnuplot << "set title \"Rey = " +Rey + ", Strouhal= "+strouhal+", T = " + T + ", cas = " + cas << ", Cara CFL : "+CFL+"\";\n"; pgnuplot << "plot ["+Td+":] \""+fgnup+"\" u 4:5 w l t \"Cd\", \""+fgnup +"\" u 4:6 w l t \"Cl\","+Cdx+", "+ Clx << endl; flush(pgnuplot); } } // plot curl of the flow preetty ... Rh curlu = -dy(u1)+ dx(u2); plot(curlu,viso=vcurl, fill=1,hsv=colorhsv, // bb=bb, coef=0.01/Um,cmm = " T = " + T+" / "+Tend+" s + "); upp1[] = up1[] -u1[]; upp2[] = up2[] -u2[]; real CPU = mpiWtime()-CPU0; CPU0=mpiWtime(); real errt = upp1[].linfty + upp2[].linfty; if(mpirank==0) cout << " errt = " << errt<< " T = " << T << " Strouhal " << strouhal <<" Cdx= " << Cdx<< " Clx = " << Clx << " " << CPU << "s" <Tend*1.0000001) break; // stop after final time .. } freefem++-3.61-1/examples++-mpi/essai-com.edp000644 000767 000024 00000001575 13256636774 020734 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 verbosity=100; cout << " rank = " << mpirank << " " << " size " << mpisize << endl; if ( mpisize > 1) if( mpirank==0) { cout << " send to 1 " << endl; processor(1) << 123456; } else if (mpirank==1) { int k; processor(0) >> k; cout << " recived " << k << endl; } int l= mpirank+100; cout << " l == " << l << " broadcast l from 0 mpirank = " << mpirank << endl; broadcast(processor(0),l); cout << " l == " << l << " mpirank ="<< mpirank << endl; matrix A; if( mpirank==0) A=[[1+1i,1i],[0,2-1i]]; broadcast(processor(0),A); if (mpirank==1) { A=A+A; processor(0) << A; } else if(mpirank==0) processor(1) >> A; cout << " mpirank = " << " A = " << A << endl; cout << " " << norm(A(1,1) - 2-1i) << endl; int[int] procs=[1,4,8]; mpiGroup group(procs); freefem++-3.61-1/examples++-mpi/DDM-Schwarz-Lap-3d.edp000644 000767 000024 00000007067 13256636774 022117 0ustar00hechtstaff000000 000000 // NBPROC 10 // ff-mpirun -np 4 DDM-Schwarz-Lap-3d.edp -glut ffglut -n 11 -k 1 -d 1 -ns -gmres 1 /* a first true parallele example fisrt freefem++ Ok up to 200 proc for a Poisson equation.. See the Doc for full explaiantion F Hecht Dec. 2010. ------------------- argument: -glut ffglut : to see graphicaly the process -n N: set the mesh cube split NxNxN -d D: set debug flag D must be one for mpiplot -k K: to refined by K all elemnt -ns: reomove script dump -gmres 0 : use iterative schwarz algo. 1 : Algo GMRES on residu of schwarz algo. 2 : DDM GMRES 3 : DDM GMRES with coarse grid preconditionner (Good one) */ load "MPICG" load "medit" load "metis" include "getARGV.idp" include "DDM-Schwarz-macro.idp" //include "AddLayer3d.idp" include "DDM-funcs-v2.idp" include "cube.idp" include "MPIplot.idp" searchMethod=0; // more safe seach algo (warning can be very expensive in case lot of ouside point) // 0 by default assert(version >=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",1); int nloc = getARGV("-n",20); string sff=getARGV("-p",""); int gmres=getARGV("-gmres",3); int tsolver = getARGV("-ts",int(CG)); int nC = getARGV("-N" ,max(nloc/10,5)); int sizeoverlaps=1; // size of overlap bool RAS=1; if(mpirank==0 && verbosity) cout << " vdebug: " << vdebug << " kspilt "<< ksplit << " nloc "<< nloc << " sff "<< sff <<"."<< endl; string sPk="P2-3gd"; func Pk=P2; int Pknbcomp=1; func bool plotMPIall(mesh3 &Th,real[int] & u,string cm) { if(vdebug) PLOTMPIALL(mesh3,Pk, Th, u,{ cmm=cm,nbiso=4,fill=1,dim=3,value=1}); return 1;} mpiComm comm(mpiCommWorld,0,0);// trick : make a no split mpiWorld int ipart= mpiRank(comm); // current partition number if(ipart==0) cout << " Final N=" << ksplit*nloc << " nloc =" << nloc << " split =" << ksplit << endl; int[int] l111=[1,1,1,1]; settt int[int,int] LL=[[1,1],[1,1],[1,1]]; real[int,int] BB=[[0,1],[0,1],[0,1]]; int[int] NN=[nloc,nloc,nloc]; int[int] NNC=[nC,nC,nC]; settt mesh3 Thg=Cube(NN,BB,LL); mesh3 ThC=Cube(NNC,BB,LL); fespace VhC(ThC,P1); // of the coarse problem.. BuildPartitioning(sizeoverlaps,mesh3,Thg,Thi,aThij,RAS,pii,jpart,comm,vdebug) if(ksplit>1) { for(int jp=0;jp #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include #include #include #include #include #include "pastix_int_complex.h" #undef memFree_null #define memFree_null(x) {if (x ==NULL) {fprintf(stdout,"%s:%d freeing NULL\n",__FILE__,__LINE__);} free(x); x=NULL;} #define STR_SIZE 256 static pastix_int_t * pastixint(int * ii){ return (pastix_int_t*) (void *) ii;} static pastix_float_t * pastixfloat(Complex * ii){ return (pastix_float_t*) (void *) ii;} typedef struct pastix_param { pastix_data_t *pastix_data; /*Pointer used by PaStiX to keep information alive between calls */ MPI_Comm comm; /* Communicator used by PaStiX */ pastix_int_t Ncol; /* Size of the Matrix */ pastix_int_t *ia; /* Index of first element of each column in ja and avals */ pastix_int_t *ja; /* Rows of the unknows of the matrix */ pastix_float_t *avals; /* Values of the matrix */ pastix_int_t *perm; /* Permutation used for re-numbering of the unknowns */ pastix_int_t *invp; /* Inverse permutation */ pastix_float_t *rhs; /* Right hand side */ pastix_int_t *iparm; /* Integer parameters */ double *dparm; /* Floating parameters */ } pastix_param_t; void Morse_to_CSC(int m, int n, int nnz, Complex *a, int *colind, int *rowptr, pastix_float_t **at, pastix_int_t **rowind, pastix_int_t **colptr) { register int i, j, col, relpos; pastix_int_t *marker; /* Allocate storage for another copy of the matrix. */ *at = (pastix_float_t *) malloc(sizeof(pastix_float_t)*nnz); *rowind = (pastix_int_t *) malloc(sizeof(pastix_int_t)*nnz); *colptr = (pastix_int_t *) malloc(sizeof(pastix_int_t)*(n+1)); marker = (pastix_int_t *) malloc(sizeof(pastix_int_t)*n); for (i = 0; i < n; ++i) marker[i] = 0; /* Get counts of each column of A, and set up column pointers */ for (i = 0; i < m; ++i) for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; (*colptr)[0] = 0; for (j = 0; j < n; ++j) { (*colptr)[j+1] = (*colptr)[j] + marker[j]; marker[j] = (*colptr)[j]; } /* Transfer the matrix into the compressed column storage. */ for (i = 0; i < m; ++i) { for (j = rowptr[i]; j < rowptr[i+1]; ++j) { col = colind[j]; relpos = marker[col]; (*rowind)[relpos] = i; (*at)[relpos] = a[j]; ++marker[col]; } } free(marker); } static const int MAX_CHAR_PER_LINE=256; //void read_datafile_pastixff(const string &datafile, pastix_int_t *iparmtab, double *dparmtab){ void read_datafile_pastixff(const string &datafile, int &mpi_flag, pastix_int_t *iparmtab, double *dparmtab){ FILE* m_File; int i = 0; char szbuff[MAX_CHAR_PER_LINE]; char* token; char filename[datafile.size()+1]; strcpy( filename, datafile.c_str()); m_File = fopen(filename,"rt"); if(!m_File) { printf("error in reading filename %s\n",filename); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"matrix") == 0) ){ printf("freefem++: error in reading matrix parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading matrix parameter for pastix \n"); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if(strcmp(token,"assembled") == 0) mpi_flag = 0; else if(strcmp(token,"distributedglobal") == 0) mpi_flag = 1; else if(strcmp(token,"distributed") == 0) mpi_flag = 2; else{ printf("value of parameter matrix is not correct %s \n", token ); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"iparm") == 0) ){ printf("freefem++: error in reading iparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading iparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); iparmtab[i] = (pastix_int_t)atol(token); i++; } i=0; fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"dparm") == 0) ){ printf("freefem++: error in reading dparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading dparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); dparmtab[i] = atof(token); i++; } fclose(m_File); #ifdef OOC /* if (iparmtab[IPARM_OOC_THREAD] > 1) */ iparmtab[IPARM_OOC_THREAD] = 1; #endif /* On empeche le 2d avec NUMA_ALLOC */ #ifdef NUMA_ALLOC if (iparmtab[IPARM_DISTRIBUTION_LEVEL] != 0) { errorPrint("2D not available with NUMA allocation\n"); exit(-1); } #endif } // ATTENTION :: pastix_float_t // peut tre soit un complex ou un reel cela depend de la maniere dont on a compiler pastix // CAS COMPLEX SEULEMENT class zSolvepastixmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 int paraoption; int myid, mpi_size; int Nrow; int mpi_flag; int init_raff; int thrd_flag; int SYM; string data_option; mutable pastix_int_t iparm[64]; mutable double dparm[64]; mutable pastix_int_t Ncol; mutable pastix_int_t *ia; mutable pastix_int_t *ja; mutable pastix_float_t *avals; mutable pastix_int_t *loc2glob; //char *Type = NULL; //char *RhsType = NULL; mutable pastix_float_t *rhs; mutable pastix_int_t *perm; mutable pastix_int_t *invp; mutable pastix_data_t *pastix_data; MPI_Comm commworld ; public: zSolvepastixmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN &pperm_c,void * ccommworld) : eps(epsilon),epsr(0), tgv(ttgv),tol_pivot_sym(pivot_sym),tol_pivot(pivot), data_option(datafile) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; //KN_ param_int(pparam_int); //KN_ param_double(pparam_double); //int m; //int ierr; struct timeval tv1, tv2; int nnz; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); ia = NULL; ja = NULL; avals = NULL; loc2glob = NULL; rhs = NULL; pastix_data = NULL; // matrix assembled on host MPI_Comm_rank(commworld, &myid); printf("- Rang MPI : %d\n", myid); MPI_Comm_size(commworld, &mpi_size); // SYMETRIQUE // MPI_flag need to unselect for non distributed matrix mpi_flag = 0; thrd_flag = 0; // ###################### //pastix_int_t init_raff; fprintf(stdout,"-- INIT PARAMETERS --\n"); // reading iparm from array if(!data_option.empty()){ read_datafile_pastixff(data_option,mpi_flag,iparm,dparm); if(mpi_flag != 0) cerr << "ERROR :: GLOBAT INPUT MATRIX FOR ALL PROCS matrix=assembled" << endl; } else if( !(param_int==NULL) || !(param_double==NULL)){ if( ! (param_int==NULL) ) { cout << "internal param_int" << endl; assert(param_int.N() == 64); for(int ii=0; ii<64; ii++) iparm[ii] = param_int[ii]; iparm[IPARM_MODIFY_PARAMETER] = API_YES; } if( !(param_double==NULL) ) { cout << "internal param_double" << endl; assert(param_double.N() == 64); for(int ii=0; ii<64; ii++) dparm[ii] = param_double[ii]; } } else{ iparm[IPARM_MODIFY_PARAMETER] = API_NO; cout << "initialize default parameter" << endl; } //################################ if(myid == 0){ Ncol = AA.m; Nrow = AA.n; nnz = AA.nbcoef; // Avant : on ecrit la transpose // AA.cl : indices des colonnes // AA.lg : pointeurs des lignes Morse_to_CSC( AA.n , AA.m, AA.nbcoef, AA.a, AA.cl, AA.lg, &avals, &ja, &ia); // ia : pointeurs des colonnes // ja : indices des lignes cout << "AA.n= "<< AA.n << " AA.m=" << AA.m << " AA.nbcoef=" << AA.nbcoef << endl; for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = ia[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++){ ja[ii] = ja[ii]+1; } MPI_Bcast( &Ncol, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &Nrow, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &nnz, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, commworld ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, commworld ); } else{ MPI_Bcast( &Ncol, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &Nrow, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &nnz, 1, MPI_PASTIX_INT, 0, commworld ); avals = (pastix_float_t *) malloc( nnz*sizeof(pastix_float_t) ); ia = (pastix_int_t *) malloc( (Ncol+1)*sizeof(pastix_int_t) ); ja = (pastix_int_t *) malloc( nnz*sizeof(pastix_int_t) ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, commworld ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, commworld ); } perm = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); invp = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); rhs = (pastix_float_t *) malloc(Ncol*sizeof(pastix_float_t)); // reading permutation given by the user if(pperm_r) for(int ii=0; ii < Ncol; ii++) perm[ii] = pperm_r[ii]; if(pperm_c) for(int ii=0; ii < Ncol; ii++) invp[ii] = pperm_c[ii]; iparm[IPARM_START_TASK] = API_TASK_INIT; iparm[IPARM_END_TASK] = API_TASK_INIT; iparm[IPARM_SYM] = API_SYM_NO; // Matrix is considered nonsymetric if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; fprintf(stdout,"-- FIN INIT PARAMETERS --\n"); init_raff = iparm[IPARM_ITERMAX]; cout << "init_raff=" << init_raff << endl; fflush(stdout); /* Passage en mode verbose */ iparm[IPARM_RHS_MAKING] = API_RHS_B; if( (param_int==NULL) && data_option.empty() ){ iparm[IPARM_MATRIX_VERIFICATION] = API_YES; iparm[IPARM_REFINEMENT] = API_RAF_GMRES; iparm[IPARM_INCOMPLETE] = API_NO; } if( (param_double==NULL) && data_option.empty()){ dparm[DPARM_EPSILON_REFINEMENT] = 1e-12; dparm[DPARM_EPSILON_MAGN_CTRL] = 1e-32; } // cscd_checksym(Ncol, ia, ja, loc2glob, commworld); // if (iparm[IPARM_SYM]==API_SYM_YES) // { // /* Symetric problem */ // /* Build non oriented graph */ // /* build non symmetric csc from symmetric csc */ // /*maillage global*/ // INT *tmpia; // INT *tmpja; // INT tmpn; // cscd_symgraph_int(*n2, *col2, *row2 , NULL, // &tmpn, &tmpia, &tmpja, NULL, // *loc2glob2, pastix_comm, API_YES); // memFree_null(*col2); // *col2 = tmpia; // memFree_null(*row2); // *row2 = tmpja; // *n2 = tmpn; // } SYM = AA.symetrique; cout << "SYM = "<< SYM << endl; // SYMETRIQUE if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Scotch */ fprintf(stdout,"-- Scotch --\n"); fflush(stdout); iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_ORDERING; if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; iparm[IPARM_SYM] = API_SYM_NO; /* Fax */ fprintf(stdout,"-- Fax --\n"); iparm[IPARM_START_TASK] = API_TASK_SYMBFACT; iparm[IPARM_END_TASK] = API_TASK_SYMBFACT; if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Blend */ fprintf(stdout,"-- Blend --\n"); iparm[IPARM_START_TASK] = API_TASK_ANALYSE; iparm[IPARM_END_TASK] = API_TASK_ANALYSE; if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Factorisation */ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_NUMFACT; gettimeofday(&tv1, NULL); fprintf(stdout,"-- SOPALIN --\n"); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call factorization : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; //for(int ii=0; ii < ia[Ncol]-1; ii++) // ja[ii] = ja[ii]-1; if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time factorization :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { struct timeval tv1, tv2; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); // index for pastix for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]+1; for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]+1; // give value of the second member for(int ii=0; ii < Ncol; ii++){ rhs[ii] = b[ii]; } //fprintf(stdout,"SOLVE STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* updo */ iparm[IPARM_START_TASK] = API_TASK_SOLVE; iparm[IPARM_END_TASK] = API_TASK_SOLVE; iparm[IPARM_RHS_MAKING] = API_RHS_B; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call updown : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); if(verbosity > 1) for(int jj=0; jj < Ncol; jj++) cout << "rhs["<< jj << "]=" << rhs[jj] << endl; //fprintf(stdout,"RAFF STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* raff */ iparm[IPARM_START_TASK] = API_TASK_REFINE; iparm[IPARM_END_TASK] = API_TASK_REFINE; iparm[IPARM_RHS_MAKING] = API_RHS_B; iparm[IPARM_ITERMAX] = init_raff; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call refinement : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol; ii++) x[ii] = rhs[ii]; // index for freefem for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; //for(int ii=0; ii < ia[Ncol]-1; ii++) // ja[ii] = ja[ii]-1; if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverpastix_complex_mpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverpastix_complex_mpi" << endl; return new zSolvepastixmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c,ds.commworld); } /* class Init { public: Init(); };*/ // the 2 default sparse solver double and complex //DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; //DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool Setpastixmpi() { if(verbosity) cout << " SetDefault sparse solver to pastixmpi" << endl; //DefSparseSolver::solver =BuildSolverpastix_complex_mpi; DefSparseSolver::solver =BuildSolverpastix_complex_mpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { //SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pastix, defaultsolver defaultsolverpastix" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; //DefSparseSolver::solver =BuildSolverpastix_complex_mpi; DefSparseSolver::solver =BuildSolverpastix_complex_mpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("complexdefaulttopastix","(",new OneOperator0(Setpastixmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/func-max.idp000644 000767 000024 00000004320 13256636774 020565 0ustar00hechtstaff000000 000000 int nbmaxS=0,nbmax; real[int,int] Strouhal(2,100), Strouhal3(3,3); real[int] mxdrag(4), mxdragi(3); real[int] mxlift(4), mxlifti(3); func real t1MaxO2(real c0,real c1,real c2) { return (1./2.)*(c0-c2)/(c0-2.*c1+c2); } func real MaxO2(real c0,real c1,real c2) { return -(1./8)*(c0^2-8.*c0*c1-2.*c0*c2-8.*c2*c1+16.*c1^2+c2^2)/(c0-2.*c1+c2); } func real AddMaxO2(real Cd,int i,real[int] &Maxd,real[int] & Maxdi) { assert(Maxdi.n ==3 && Maxd.n > 3); if( i <=1) // init ... { Maxdi = -1e100; Maxd = -1e100; Maxd[0] =-1000; } Maxdi[i%3] = Cd; if( Maxdi.min > -1e50) { int i0=(i+1)%3, i1=(i+2)%3, i2=(i)%3; if( (Maxdi[i0] < Maxdi[i1]) & (Maxdi[i1] > Maxdi[i2]) ) { // new max int j = Maxd[0]+1+1000; Maxd[j] = MaxO2(Maxdi[i0],Maxdi[i1],Maxdi[i2]); Maxd[0] = j%(Maxd.n-1)-1000; if(mpirank==0 && verbosity>5) cout << " max " << " " << Cd << " " << i << " " << j << " " << Maxd[j] << i0 << " " << i1 << " " << i2 << " " << Maxdi[i0] << " " << Maxdi[i1] << " "<< Maxdi[i2] << endl; } } } func real AddStrouhal(int i,real t,real v) { real s=-1; int i3 = i%3; Strouhal3(0,i3)= t; Strouhal3(1,i3)= v; if( i>10) { int i2 = (i-1)%3; int i1 = (i-2)%3; if(Strouhal3(1,i1) < Strouhal3(1,i2) & Strouhal3(1,i2) > Strouhal3(1,i3) ) { real dt = t- Strouhal3(0,i2); real t2 = Strouhal3(0,i2); int ii = nbmaxS%Strouhal.m; real tm = t2+dt*t1MaxO2(Strouhal3(1,i1),Strouhal3(1,i2),Strouhal3(1,i3)); real fm = MaxO2(Strouhal3(1,i1),Strouhal3(1,i2),Strouhal3(1,i3)); Strouhal(0,ii) =tm; Strouhal(1,ii) =fm; ++nbmaxS; // if(mpirank==0) cout << ii << " " << " " << Strouhal3(0,i1) << " < " << Strouhal3(0,i2) << " > " << Strouhal3(0,i3) << endl; } } if(nbmaxS > 3) { int ii = (nbmaxS-1)%Strouhal.m; int jj = (nbmaxS-4)%Strouhal.m; real per = (Strouhal(0,ii)-Strouhal(0,jj))/3.; // if(mpirank==0) cout << "zzzz " << ii << " " << jj << " " << per << endl; s= 1/per; } return s; } freefem++-3.61-1/examples++-mpi/DDM-Schwarz-macro.idp000644 000767 000024 00000027375 13256636774 022210 0ustar00hechtstaff000000 000000 // MPIGMRSmacro.idp file.. version 0.1 // include in MPIGMRES.edp file .. // Frederic Hecht 2010 // LGPL licence // Author Frederic.Hecht@upmc.fr // ------------------------------- // macro to def // send-recv message // ----------------------------------- /******************************************************************/ func real maxM(matrix & A) { int[int] I(1),J(1); real[int] C(1); [I,J,C] =A; return C.max ; } /******************************************************************/ macro InitU(n,Vh,Th,aTh,U) Vh[int] U(n); for(int j=0;j> Ri[j]; } // EOM /******************************************************************/ macro CheckUV(comm,jpart,Si,Ri) { int n= jpart.n; int[int] rn(n),sn(n),in(n); for (int j=0;j> rn[j]; for (int j=0;j> in[j]; int err=0; for (int j=0;j " << in[j] << " " << err << endl; } assert(err==0); }//EOM /******************************************************************/ macro SendRecvUV(comm,jpart,Si,Ri) { int n= jpart.n; mpiRequest[int] rq(n); for (int j=0;j> Ri[j][];*/ for (int j=0;j1 && ipart==0) metisdual(part[],Thg,npart); broadcast(processor(0,comm),part[]); } /* build ... */ if(vdebug>10&& mpirank==0 && !NoGraphicWindow) plot(part,fill=1,cmm="dual",wait=1); /* overlapping partition */ Vhi unssd; int nnn = sizeoverlaps*2;/* to be sure exact in thii */ { int[int] n2o(1); Phg suppi= abs(part-ipart)<0.1; /* boolean function 1 in the subdomain 0 elswhere */ Thin=trunc(Thg,suppi>0,label=10,renum=false); /* non-overlapping mesh, interfaces have label 10 */ AddLayers(Thg,suppi[],nnn,unssd[]); /* see above ! suppi and unssd are modified */ unssd[] *= nnn; /* to put value nnn a 0 */ /* build a local mesh of thii such that all compuation of the unit partition are */ /* exact in thii */ Thii=trunc(Thg,unssd> 0.001 ,label=10,new2old=n2o,renum=false); /* overlapping mesh, interfaces have label 10 */ unssd= unssd;/* put on Thii*/ real[int] p=part[]; part=0.; part[]=p(n2o); real nnn0 = nnn - sizeoverlaps + 0.001 ; Thi=trunc(Thii,unssd>nnn0 ,label=10,renum=false); /* overlapping mesh, interfaces have label 10 */ } settt int npij=npart; Vhi[int] pij(npij);/* local partition of unit + pii */ { /* construction of the partition of the unit, let phi_i P1 FE function 1 on Thin and zero ouside of Thi and positive the partition is build with $$ p_i = phi_i/ \sum phi_i to build the partition of one domain i we nned to find all j such that supp(phi_j) \cap supp(phi_j) is not empty <=> int phi_j */ { /* find all j mes (supp(p_j) \cap supp(p_i)) >0 */ /* compute all phi_j on Thii */ /* remark supp p_i include in Thi */ /* */ fespace Phii(Thii,P0); fespace Vhii(Thii,P1); Vhi sumphi=0; jpart=0; njpart=0; if(ipart==0) cout <<" sizeoverlaps=" << sizeoverlaps << " " << " nnn = " << nnn<< endl; if(dplot1) plot(unssd,wait=1,cmm=" bbbb"); pii= max(unssd-sizeoverlaps,0.)/sizeoverlaps; if(RAS) pii[]=pii[] ? 1. : 0.; if(dplot1) plot(pii,wait=1,cmm=" 0000 max="+pii[].max); sumphi[] += pii[]; if(dplot1) plot(sumphi,wait=1,cmm=" summ 0000"); Vhii phii=0; real epsmes=1e-10*Thii.mesure; /*cout << " epsmes = " << epsmes < 0.5) { AddLayers(Thii,suppii[],sizeoverlaps,phii[]); if(RAS) { phii[]=phii[] ? 1. : 0.; if(dplot1) plot(phii,wait=1,cmm=" RAS ij"); } assert(phii[].min >= -1e-10); real interij = int#mesh(Thi)( phii); if(interij>epsmes) { pij[njpart]=abs(phii); if(vdebug1>2) cout << " ***** " << int#mesh(Thi)(real(pij[njpart])<0) << " " <2) cout << " sum min " < 1.-1e-6 && sumphi[].max< 1.+1e-6); /* verification */ }}/* (Thii is remove here) */ /* end of the construction of the local partition of the unity ... */ /* on Thi ... */ /* ----------------------------------------------------------------- */ if(mpiRank(comm)==0) cout << " *** end build partition " << endl; /* computation of number of intersection .. */ /* ------------------------------------------ */ /* here pii and the pij is the locate partition of the unite on */ /* Thi ( mesh with overlap ).... */ /*Thi=splitmesh(Thi,2); */ if(dplot1 ) { plot(Thi,pii,wait=1); for(int j=0;j we have to recive */ /* data on intersection of the support of pij[0] and pij[j] */ settt aThij.resize(njpart); /* construction of the mesh intersect i,j part */ for(int jp=0;jp1e-6,label=10,renum=false); /* mesh of the supp of pij */ } if(mpiRank(comm)==0) cout << " *** end build mesh intersection " << endl; // EOM macro defPk1(i,j) i j // macro defPk2(i,j) [i j,i#1 j]// macro defPk3(i,j) [i j,i#1 j,i#2 j]// macro defPk4(i,j) [i j,i#1 j,i#2 j,i#3 j]// macro defPk5(i,j) [i j,i#1 j,i#2 j,i#3 j, i#4 j]// macro Times1(i) i // macro Times2(i) [i,i]// macro Times3(i) [i,i,i]// macro Times4(i) [i,i,i,i]// macro Times5(i) [i,i,i,i,i]// macro InitUdef(n,Vh,Th,aTh,U,N) Vh[int] defPk#N(U,)(n); for(int j=0;j99)savemesh(Thij,"Th-"+j+"--"+ipart+".mesh"); int [int] U2Vdata=[0]; matrix I = interpolate(Whij,Whi,U2Vc=U2Vdata); /* Whji <- Whi */ sMj[jp] = I*Pii; /* Whi -> s Whij */ rMj[jp] = interpolate(Whij,Whi,t=1,U2Vc=U2Vdata); /* Whji -> Whi */ if(vdebug>10) { {Whi defPk#N(uuu,)=Times#N(1); Whij defPk#N(vvv,)=Times#N(-1); cout << vvv[].n <<"+=" << I.n << "x" << I.m << "*" << uuu[].n << endl; vvv[]+=I*uuu[]; cout << jp << " %%% " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);} {Whi defPk#N(uuu,)=Times#N(1); Whij defPk#N(vvv,)=Times#N(-1) ; vvv[]+=rMj[jp]'*uuu[]; cout << jp << " ### " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);}} }} if(ipart==0) cout << " *** end build transfert matrix " << endl; settt /* alloc array of send and recv data .. */ InitUdef(jpart.n,Whij,Thij,aThij,Usend,N) /* initU(n,Vh,Th,aTh,U) */ InitUdef(jpart.n,Whij,Thij,aThij,Vrecv,N) /* ... */ if(ipart==0) cout << " *** end init data for send/revc " << endl; // /******************************************************************/ macro BuildTransferMat(ipart,mesh,Pk,N,U2V,Thi,Whi,Whij,Thij,aThij,Usend,Vrecv,jpart,vdebug) BuildTransferMat2(ipart,mesh,Pk,N,U2V,Thi,Whi,Whij,Thij,aThij,Usend,Vrecv,jpart,Pii,vdebug) // /******************************************************************/ /******************************************************************/ // usage uplot is allu or [allu,allu1] : macro PLOTMPIALLU(mesh,Pk,defPk, Th, u, uplot, plotparm) { int ver=verbosity; verbosity=2; if(NoGraphicWindow==0) { if(mpirank==0) { mesh Thi=Th; mesh[int] ath(mpisize); fespace Xh(Thi,Pk); Xh[int] defPk(allu,)(mpisize); allu[0][]=u; ath[0]=Th; mpiRequest[int] rq(mpisize); for(int i= 1; i using namespace std; #include "ff++.hpp" #include "mpi.h" #include "cmaes_interface.h" template struct MPI_TYPE {}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_LONG;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_INT;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_DOUBLE;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_BYTE;}}; class CMAES //Abstract class, because the fitness function prototype may differ from users to users { public: //typedef double (*FFT)(double const *); //Fitness Function Type CMAES() : pop(0),fitvals(0),evo() {} CMAES(int d,double *xstart,double *stddev,long seed,int lambda,const char *ipf="initials.par") : pop(0),fitvals(0),evo() { fitvals = init(d,xstart,stddev,seed,lambda,ipf); cout << SayHello() << endl; } virtual ~CMAES() {exit();} void resume_distribution(char *filename) {return cmaes_resume_distribution(&evo, filename);} double * const * & SamplePopulation() {return pop = cmaes_SamplePopulation(&evo);} double * UpdateDistribution() {return cmaes_UpdateDistribution(&evo,fitvals);} const char * TestForTermination() const {return cmaes_TestForTermination(&evo);} double * const * & ReSampleSingle(int index) {return pop = cmaes_ReSampleSingle(&evo,index);} double const * ReSampleSingle_old(double *rgx) {return cmaes_ReSampleSingle_old(&evo,rgx);} void UpdateEigensystem(int flgforce) {return cmaes_UpdateEigensystem(&evo, flgforce);} virtual void PopEval() =0; //{for(int i=0;i(cmaes_GetPtr(&evo,"diag(C)"));} double * diagD() const {return const_cast(cmaes_GetPtr(&evo,"diag(D)"));} double * stddev() const {return const_cast(cmaes_GetPtr(&evo,"stddev"));} double * xbestever() const {return const_cast(cmaes_GetPtr(&evo,"xbestever"));} double * xbest() const {return const_cast(cmaes_GetPtr(&evo,"xbest"));} double * xmean() const {return const_cast(cmaes_GetPtr(&evo,"xmean"));} void ReadSignals(char const * filename) const {cmaes_ReadSignals(&evo,filename);} char * SayHello() const {return cmaes_SayHello(&evo);} void WriteToFile(char const * keyword,char const * output_filename) const {cmaes_WriteToFile(&evo,keyword,output_filename);} virtual double * operator() () { //ReadSignals("signals.par"); while(!TestForTermination()) { SamplePopulation(); PopEval(); UpdateDistribution(); //ReadSignals("signals.par"); } cout << "Stop : " << TestForTermination() << endl; return xmean(); } cmaes_t& optimizer() {return evo;} protected: double * const * pop; double * fitvals; double*& init(int dimension,double *xstart,double *stddev,long seed,int lambda,const char *input_parameter_filename) {return fitvals = cmaes_init(&evo,dimension,xstart,stddev,seed,lambda,input_parameter_filename);} private: void exit() {cmaes_exit(&evo);} mutable cmaes_t evo; }; /* Now comes the FreeFem ++ part : */ extern Block *currentblock; typedef double R; class OptimCMA_ES : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; const int cas; class ffcalfunc // to call the freefem function .. J { public: Stack stack; Expression JJ,theparame; mutable int counter; ffcalfunc(Stack s,Expression JJJ,Expression epar) : stack(s),JJ(JJJ), theparame(epar), counter(0) {} double J(Kn_ x) const { ++counter; KN *p=GetAny *>( (*theparame)(stack) ); *p=x; double ret= GetAny( (*JJ)(stack)); WhereStackOfPtr2Free(stack)->clean(); return ret; } }; class CMA_ES_MPI : public CMAES { public: typedef KN Rn; typedef KN_ Rn_; //CMA_ES_MPI() : CMAES(),x(0),fit(0) {} /*CMA_ES(ffcalfunc &_ff,int d,Rn &xstart,double *stddev,long seed,int lambda) : CMAES(d,xstart.n ? xstart:0,stddev,seed,lambda,"non"),x(&xstart),fit(&_ff) {} CMA_ES(ffcalfunc &_ff,int d,Rn &xstart,const Rn &stddev,long seed,int lambda) : CMAES(d,xstart.n ? xstart:0,stddev,seed,lambda,"non"),x(&xstart),fit(&_ff) {}*/ CMA_ES_MPI(ffcalfunc &_ff,Rn &xstart,const Rn &stddev,long seed,int lambda,MPI_Comm *_com) : CMAES(),x(0),fit(&_ff),com(_com),myid(0),nproc(1),my_number_of_fitness_eval(0),index(0) { MPI_Comm_size(*com,&nproc); MPI_Comm_rank(*com,&myid); x = &xstart; init(x->n,xstart.n ? xstart:0,stddev,seed,lambda,"non"); my_number_of_fitness_eval = (lambda/nproc) + (myid < (lambda%nproc) ? 1:0); index = new int[nproc]; for(int i=0;i0 ? index[i-1]+inofe : 0; } if(myid==0) cout << SayHello() << endl; } CMA_ES_MPI(ffcalfunc &_ff,Rn &xstart,const Rn &stddev,long seed,int lambda,MPI_Comm *_com,const char *ifname) : CMAES(),x(0),fit(&_ff),com(_com),myid(0),nproc(1),my_number_of_fitness_eval(0),index(0) { MPI_Comm_size(*com,&nproc); MPI_Comm_rank(*com,&myid); x = &xstart; init(x->n,xstart.n ? xstart:0,stddev,seed,lambda,ifname); my_number_of_fitness_eval = (lambda/nproc) + (myid < (lambda%nproc) ? 1:0); index = new int[nproc]; for(int i=0;i0 ? index[i-1]+inofe : 0; } if(myid==0) cout << SayHello() << endl; } ~CMA_ES_MPI() { if(index) delete [] index; index=0; } void PopEval() { //cout << endl << "***** in popeval myid = " << myid << "*****" << endl; for(int i=0;iJ(popi); } } double * operator() () { while(!TestForTermination()) { MPI_Barrier(*com); SamplePopulation();//Every proc samples its own population... but only the one from proc 0 is used. Fortunately, this is a quick computation regarding the time spent on fitness function evaluation for(int i=0;i( (*nargs[i])(stack) ): a;} R arg(int i,Stack stack,R a) const{ return nargs[i] ? GetAny( (*nargs[i])(stack) ): a;} E_CMA_ES(const basicAC_F0 & args,int cc) : cas(cc) { int nbj= args.size()-1; Block::open(currentblock); // make a new block to X = to(args[nbj]); C_F0 X_n(args[nbj],"n"); // the expression to init the theparam of all inittheparam = currentblock->NewVar("the parameter",atype *>(),X_n); theparam = currentblock->Find("the parameter"); // the expression for the parameter args.SetNameParam(n_name_param,name_param,nargs); const Polymorphic * opJ=0; if (nbj>0) { opJ= dynamic_cast(args[0].LeftValue()); assert(opJ); } JJ= to(C_F0(opJ,"(",theparam)); closetheparam=C_F0((Expression) Block::snewclose(currentblock),atype()) ; //closetheparam=currentblock->close(currentblock); // the cleanning block expression } virtual AnyType operator()(Stack stack) const { double cost = 1e100; WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 Kn &x = *GetAny((*X)(stack)); long n=x.N(); long seed = arg(0,stack,0L); //The seed for random numbers generation double initialStdDev = arg(1,stack,0.3); //Initial standard deviation KN iSD(n,1.); iSD *= initialStdDev; KN initialStdDevs(nargs[2] ? GetAny >((*nargs[2])(stack)) : (KN_)iSD); //cout << "dans le dylib :" << initialStdDevs << endl; double stopTolFun = arg(3,stack,1.E-12); double stopTolFunHist = arg(4,stack,0.); double stopTolX = arg(5,stack,0.); double stopTolUpXFactor = arg(6,stack,1.E3); long popsize = arg(7,stack,4 + (long) floor(3*log(n))); pcommworld vcommworld=0; if (nargs[8]) vcommworld = GetAny((*nargs[8])(stack)); MPI_Comm mpiCommWorld = MPI_COMM_WORLD; MPI_Comm * commworld= vcommworld ? (MPI_Comm *) vcommworld : & mpiCommWorld ; //long mu = arg(8,stack,popsize/2); long iprint = verbosity; ffcalfunc ffJ(stack,JJ,theparam); //cout << endl << "ATTENTION : " << *commworld << endl; int myid=0,nproc=1; MPI_Comm_size(*commworld,&nproc); MPI_Comm_rank(*commworld,&myid); //cout << endl << "nbr de proc : " << nproc << " -- myid=" << myid << " -- world id=" << wr << endl; CMA_ES_MPI *optim=0; if(nargs[9]) optim = new CMA_ES_MPI(ffJ,x,initialStdDevs,seed,popsize,commworld,(GetAny((*nargs[9])(stack)))->c_str()); else optim = new CMA_ES_MPI(ffJ,x,initialStdDevs,seed,popsize,commworld); if(!nargs[9]) { optim->optimizer().sp.stopTolFun = stopTolFun; optim->optimizer().sp.stopTolFunHist = stopTolFunHist; optim->optimizer().sp.stopTolX = stopTolX; optim->optimizer().sp.stopTolUpXFactor = stopTolUpXFactor; long meval = arg(10,stack,static_cast(optim->maxeval())); long mgen = arg(11,stack,static_cast(optim->maxgen())); optim->optimizer().sp.stopMaxFunEvals = meval; optim->optimizer().sp.stopMaxIter = mgen; } (*optim)(); cost = optim->fitness(); x = KN_(optim->xbestever(),optim->dimension()); delete optim; closetheparam.eval(stack); // clean memory WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 return cost; //SetAny(0); Modif FH july 2005 } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const {return new E_CMA_ES(args,cas);} OptimCMA_ES(int c) : OneOperator(atype(),atype(),atype *>()),cas(c){} }; basicAC_F0::name_and_type OptimCMA_ES::E_CMA_ES::name_param[]= { {"seed", &typeid(long) }, {"initialStdDev", &typeid(double) }, {"initialStdDevs", &typeid(KN_) }, {"stopTolFun", &typeid(double) }, {"stopTolFunHist", &typeid(double) }, {"stopTolX", &typeid(double) }, {"stopTolUpXFactor",&typeid(double) }, {"popsize", &typeid(long) }, {"comm", &typeid(pcommworld)}, {"paramFile", &typeid(string*) }, {"stopMaxFunEval", &typeid(long) }, {"stopMaxIter", &typeid(long) } //{"mu", &typeid(long) } }; /* --FH: class Init { public: Init(); };*/ static void Load_Init() { Global.Add("cmaesMPI","(",new OptimCMA_ES(1)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/testsolver_dsuperlu_dist.edp000644 000767 000024 00000003223 13256636774 024224 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "dSuperLU_DIST" // FFCS - reference value for regressions tests real regtest; // read parameter for superlu from file verbosity=2; { matrix A = [[ 1e16, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1e16, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); // xb(4),bbb(4); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver,datafilename="ffsuperlu_dist_fileparam.txt"); cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } } // read parameter for superlu from string and verbosity=2; { matrix A = [[ 1e16, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1e16, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); // xb(4),bbb(4); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver,sparams="nprow=2,npcol=1,matrix=distributedglobal,ColPerm=MMD_AT_PLUS_A"); cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; regtest=di.l2; } } freefem++-3.61-1/examples++-mpi/Stokes-v3-matrix-superludist.edp000644 000767 000024 00000005473 13256636774 024536 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "real_SuperLU_DIST_FreeFem" real ttgv=-1; string ssparams="nprow=1, npcol="+mpisize; int nn=12; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); //medit("c10x10x10",Th); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; Uh u1,u2,u3; Uh v1,v2,v3; Ph p,q; //VVh [uu1,uu2,uu3,up]; real timeI=clock(); real time1=clock(); varf vlaplace1(u1,v1) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) ) + on(2,u1=fup) + on(1,u1=0); //' for emacs varf vlaplacenull(u2,v2) = int3d(Th,qforder=3)( Grad(u2)'*Grad(v2) ) + on(2,u2=0) + on(1,u2=0); //' for emacs varf vdx(u1,q) = int3d(Th,qforder=3)( -dx(u1)*q ); varf vdy(u2,q) = int3d(Th,qforder=3)( -dy(u2)*q ); varf vdz(u3,q) = int3d(Th,qforder=3)( -dz(u3)*q ); varf vmass(p,q) = int3d(Th,qforder=3)( 1e-10*p*q ); matrix M = vmass(Ph,Ph,tgv=ttgv); matrix L1 = vlaplace1(Uh,Uh,tgv=ttgv); matrix Lnull = vlaplacenull(Uh,Uh); matrix Bx = vdx(Uh,Ph); matrix By = vdy(Uh,Ph); matrix Bz = vdz(Uh,Ph); matrix A = [ [ L1, 0, 0, Bx' ], [ 0, Lnull, 0, By' ], [ 0, 0, Lnull, Bz' ], [ Bx, By, Bz, M ] ]; //' for emacs time1=clock()-time1; real time2=clock(); real[int] b(VVh.ndof); real[int] xx(VVh.ndof); { real[int] b1 = vlaplace1(0,Uh); real[int] b2 = vlaplacenull(0,Uh); for(int ii=0; ii #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include #include #include #include #include // #include // #include // #include // #include // //#include // #include // #include // #include // #include "mpi.h" // #include // #include "pastix.h" // #include "cscd_utils.h" // #include "read_matrix.h" #include extern "C"{ #include "pastix.h" } //#include "cscd_utils.h" //#include "read_matrix.h" #undef memFree_null #define memFree_null(x) {if (x ==NULL) {fprintf(stdout,"%s:%d freeing NULL\n",__FILE__,__LINE__);} free(x); x=NULL;} #define STR_SIZE 256 static pastix_int_t * pastixint(int * ii){ return (pastix_int_t*) (void *) ii;} static pastix_float_t * pastixfloat(double * ii){ return (pastix_float_t*) (void *) ii;} typedef struct pastix_param { pastix_data_t *pastix_data; /*Pointer used by PaStiX to keep information alive between calls */ MPI_Comm comm; /* Communicator used by PaStiX */ pastix_int_t Ncol; /* Size of the Matrix */ pastix_int_t *ia; /* Index of first element of each column in ja and avals */ pastix_int_t *ja; /* Rows of the unknows of the matrix */ pastix_float_t *avals; /* Values of the matrix */ pastix_int_t *perm; /* Permutation used for re-numbering of the unknowns */ pastix_int_t *invp; /* Inverse permutation */ pastix_float_t *rhs; /* Right hand side */ pastix_int_t *iparm; /* Integer parameters */ double *dparm; /* Floating parameters */ } pastix_param_t; void Morse_to_CSC(int m, int n, int nnz, double *a, int *colind, int *rowptr, pastix_float_t **at, pastix_int_t **rowind, pastix_int_t **colptr) { register int i, j, col, relpos; pastix_int_t *marker; /* Allocate storage for another copy of the matrix. */ *at = (pastix_float_t *) malloc(sizeof(pastix_float_t)*nnz); *rowind = (pastix_int_t *) malloc(sizeof(pastix_int_t)*nnz); *colptr = (pastix_int_t *) malloc(sizeof(pastix_int_t)*(n+1)); marker = (pastix_int_t *) malloc(sizeof(pastix_int_t)*n); for (i = 0; i < n; ++i) marker[i] = 0; /* Get counts of each column of A, and set up column pointers */ for (i = 0; i < m; ++i) for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; (*colptr)[0] = 0; for (j = 0; j < n; ++j) { (*colptr)[j+1] = (*colptr)[j] + marker[j]; marker[j] = (*colptr)[j]; } /* Transfer the matrix into the compressed column storage. */ for (i = 0; i < m; ++i) { for (j = rowptr[i]; j < rowptr[i+1]; ++j) { col = colind[j]; relpos = marker[col]; (*rowind)[relpos] = i; (*at)[relpos] = a[j]; ++marker[col]; } } free(marker); } static const int MAX_CHAR_PER_LINE=256; void read_datafile_pastixff(const string &datafile, pastix_int_t *iparmtab, double *dparmtab){ FILE* m_File; int i = 0; char szbuff[MAX_CHAR_PER_LINE]; char* token; char filename[datafile.size()+1]; strcpy( filename, datafile.c_str()); m_File = fopen(filename,"rt"); if(!m_File) { printf("error in reading filename %s\n",&filename); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"iparm") == 0) ){ printf("freefem++: error in reading iparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading iparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); iparmtab[i] = (pastix_int_t)atol(token); i++; } i=0; fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"dparm") == 0) ){ printf("freefem++: error in reading dparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading dparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); dparmtab[i] = atof(token); i++; } fclose(m_File); #ifdef OOC /* if (iparmtab[IPARM_OOC_THREAD] > 1) */ iparmtab[IPARM_OOC_THREAD] = 1; #endif /* On empeche le 2d avec NUMA_ALLOC */ #ifdef NUMA_ALLOC if (iparmtab[IPARM_DISTRIBUTION_LEVEL] != 0) { errorPrint("2D not available with NUMA allocation\n"); exit(-1); } #endif } // ATTENTION :: pastix_float_t // peut tre soit un complex ou un reel cela depend de la maniere dont on a compiler pastix // CAS DOUBLE SEULEMENT class dSolvepastixmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 int paraoption; int myid, mpi_size; int Nrow; int mpi_flag; int init_raff; int thrd_flag; int SYM; string data_option; mutable pastix_int_t iparm[64]; mutable double dparm[64]; mutable pastix_int_t Ncol; mutable pastix_int_t *ia; mutable pastix_int_t *ja; mutable pastix_float_t *avals; mutable pastix_int_t *loc2glob; //char *Type = NULL; //char *RhsType = NULL; mutable pastix_float_t *rhs; mutable pastix_int_t *perm; mutable pastix_int_t *invp; mutable pastix_data_t *pastix_data; public: dSolvepastixmpi(const MatriceMorse &AA, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN &pperm_c) : data_option(datafile) { //int m; //int ierr; struct timeval tv1, tv2; ia = NULL; ja = NULL; avals = NULL; loc2glob = NULL; rhs = NULL; pastix_data = NULL; // matrix assembled on host MPI_Comm_rank(MPI_COMM_WORLD, &myid); printf("- Rang MPI : %d\n", myid); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); // SYMETRIQUE mpi_flag = 0; thrd_flag = 0; Ncol = AA.m; Nrow = AA.n; // Avant : on ecrit la transpose /* ia = (pastix_int_t *) malloc( (Ncol+1)*sizeof(pastix_int_t)); for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = AA.lg[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); ja = (pastix_int_t *) malloc((ia[Ncol]-1)*sizeof(pastix_int_t)); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = AA.cl[ii]+1; if( sizeof(pastix_float_t) == sizeof(double) ){ avals = (pastix_float_t *) malloc( (ia[Ncol]-1)*sizeof(pastix_float_t)); for(int ii=0; ii < ia[Ncol]-1; ii++) avals[ii] = AA.a[ii]; } */ // AA.cl : indices des colonnes // AA.lg : pointeurs des lignes Morse_to_CSC( AA.n , AA.m, AA.nbcoef, AA.a, AA.cl, AA.lg, &avals, &ja, &ia); // ia : pointeurs des colonnes // ja : indices des lignes cout << "AA.n= "<< AA.n << " AA.m=" << AA.m << " AA.nbcoef=" << AA.nbcoef << endl; for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = ia[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++){ ja[ii] = ja[ii]+1; } perm = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); invp = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); rhs = (pastix_float_t *) malloc(Ncol*sizeof(pastix_float_t)); // reading permutation given by the user if(pperm_r) for(int ii=0; ii < Ncol; ii++) perm[ii] = pperm_r[ii]; if(pperm_c) for(int ii=0; ii < Ncol; ii++) invp[ii] = pperm_c[ii]; // CAS DE LA MATRICE NON DISTRIBUER pastix_int_t init_raff; fprintf(stdout,"-- INIT PARAMETERS --\n"); // reading iparm from array if(!data_option.empty()) read_datafile_pastixff(data_option,iparm,dparm); else if(param_int || param_double){ if( param_int ) { cout << "read param_int" << endl; assert(param_int.N() == 64); for(int ii=0; ii<64; ii++) iparm[ii] = param_int[ii]; iparm[IPARM_MODIFY_PARAMETER] = API_YES; } if( param_double ) { cout << "read param_double" << endl; assert(param_double.N() == 64); for(int ii=0; ii<64; ii++) dparm[ii] = param_double[ii]; } } else{ iparm[IPARM_MODIFY_PARAMETER] = API_NO; cout << "initialize parameter" << endl; } iparm[IPARM_START_TASK] = API_TASK_INIT; iparm[IPARM_END_TASK] = API_TASK_INIT; iparm[IPARM_SYM] = API_SYM_NO; // Matrix is considered nonsymetric pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); fprintf(stdout,"-- FIN INIT PARAMETERS --\n"); init_raff = iparm[IPARM_ITERMAX]; fflush(stdout); /* Passage en mode verbose */ iparm[IPARM_RHS_MAKING] = API_RHS_B; if( !param_int && data_option.empty() ){ iparm[IPARM_MATRIX_VERIFICATION] = API_YES; iparm[IPARM_REFINEMENT] = API_RAF_GMRES; iparm[IPARM_INCOMPLETE] = API_NO; } if( !param_double && data_option.empty()){ dparm[DPARM_EPSILON_REFINEMENT] = 1e-12; dparm[DPARM_EPSILON_MAGN_CTRL] = 1e-32; } SYM = AA.symetrique; cout << "SYM = "<< SYM << endl; // SYMETRIQUE if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; //iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; //iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Scotch */ fprintf(stdout,"-- Scotch --\n"); fflush(stdout); iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_ORDERING; pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); /* Fax */ fprintf(stdout,"-- Fax --\n"); iparm[IPARM_START_TASK] = API_TASK_SYMBFACT; iparm[IPARM_END_TASK] = API_TASK_SYMBFACT; pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); /* Blend */ fprintf(stdout,"-- Blend --\n"); iparm[IPARM_START_TASK] = API_TASK_ANALYSE; iparm[IPARM_END_TASK] = API_TASK_ANALYSE; pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); if( SYM == 1 ){ //iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ //iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Factorisation */ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_NUMFACT; gettimeofday(&tv1, NULL); fprintf(stdout,"-- SOPALIN --\n"); pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call factorization : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { struct timeval tv1, tv2; // index for pastix for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]+1; for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]+1; // give value of the second member for(int ii=0; ii < Ncol; ii++) rhs[ii] = b[ii]; //fprintf(stdout,"SOLVE STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* updo */ iparm[IPARM_START_TASK] = API_TASK_SOLVE; iparm[IPARM_END_TASK] = API_TASK_SOLVE; iparm[IPARM_RHS_MAKING] = API_RHS_B; gettimeofday(&tv1, NULL); pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call updown : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); //for(int jj=0; jj < Ncol; jj++) // cout << "rhs["<< jj << "]=" << rhs[jj] << endl; //fprintf(stdout,"RAFF STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* raff */ iparm[IPARM_START_TASK] = API_TASK_REFINE; iparm[IPARM_END_TASK] = API_TASK_REFINE; //iparm[IPARM_RHS_MAKING] = API_RHS_B; iparm[IPARM_ITERMAX] = init_raff; gettimeofday(&tv1, NULL); pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call refinement : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol; ii++) x[ii] = rhs[ii]; // index for freefem for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; } ~dSolvepastixmpi(){ /* mem free */ iparm[IPARM_START_TASK] = API_TASK_CLEAN; iparm[IPARM_END_TASK] = API_TASK_CLEAN; pastix(&pastix_data, MPI_COMM_WORLD, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); if( sizeof(pastix_int_t) != sizeof(int) ) { memFree_null(ia); memFree_null(ja); } /* Free mem no longer necessary */ memFree_null(rhs); } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverpastixmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverpastixmpi" << endl; return new dSolvepastixmpi(*A,ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool Setpastixmpi() { if(verbosity) cout << " SetDefault sparse solver to pastixmpi" << endl; DefSparseSolver::solver =BuildSolverpastixmpi; //DefSparseSolver::solver =BuildSolverpastixmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pastixmpi, defaultsolver defaultsolverpastixmpi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverpastixmpi; //DefSparseSolver::solver =BuildSolverpastixmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttopastixmpi","(",new OneOperator0(Setpastixmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/hypre_FreeFem.cpp000644 000767 000024 00000160740 13256636774 021606 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : INRIA Saclay // AUTHOR : Guy Atenekeng // E-MAIL : Guy_Antoine_Atenekeng_Kahou@lri.fr // //ff-c++-LIBRARY-dep: hypre metis blas mpi //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 */ // FFCS: add requirement for MPI //ff-c++-LIBRARY-dep: hypre mpi //ff-c++-cpp-dep: // add F.Hecht ... oct 2010 #define HYPRE_TIMING // .. end add #include #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #ifdef __cplusplus extern "C" { #include "metis.h" #endif #ifdef __cplusplus } #endif #include #include #include #ifdef MPI_WTIME_IS_GLOBAL #undef MPI_WTIME_IS_GLOBAL #endif #define MPI_WTIME_IS_GLOBAL 1 #define STATS #include "_hypre_utilities.h" #include "HYPRE.h" #include "HYPRE_krylov.h" #include "HYPRE_IJ_mv.h" #include "HYPRE_parcsr_ls.h" #include "_hypre_parcsr_mv.h" #include "fortran_matrix.h" #include "HYPRE_lobpcg.h" #include "interpreter.h" #include "multivector.h" #include "HYPRE_MatvecFunctions.h" #include "HYPRE_parcsr_int.h" #define CHECK_ZERO #define MCW MPI_COMM_WORLD #define BUFLEN 100 #define SCALE 0 #ifdef SUN /* * It uses the system call gethrtime(3C), which is accurate to * nanoseconds. */ #include double dwalltime() { return ( (double)gethrtime() / 1e9 ); } #else #ifndef NO_TIMER #include #include #include #include #endif #ifndef CLK_TCK #define CLK_TCK 60 #endif double dwalltime() { #ifdef NO_TIMER /* no sys/times.h on _WIN32 */ double tmp; tmp = 0.0; #else struct tms use; double tmp; times(&use); tmp = use.tms_utime; tmp += use.tms_stime; #endif return (double)(tmp) / CLK_TCK; } #endif int roscal(int n, int job,int nrm, double *AAv, int *p, int *pr, double * scaletmpr , int *ierr) { /*--------------------------------------------------------------------- | | This routine scales each row of mata so that the norm is 1. | |---------------------------------------------------------------------- | on entry: | mata = the matrix (in SparRow form) | nrm = type of norm | 0 (\infty), 1 or 2 | | on return | diag = diag[j] = 1/norm(row[j]) | | 0 --> normal return | j --> row j is a zero row |--------------------------------------------------------------------*/ /* local variables */ int i, k; double scal; for (i=0; i scal) scal = fabs(AAv[k]); } else if (nrm == 1) { for (k=pr[i]; k normal return | j --> column j is a zero column |--------------------------------------------------------------------*/ /* local variables */ int i, j, k; double *kr; int *ki; for (i=0; i scaletmpc[p[k]]) scaletmpc[p[k]] = fabs(AAv[k]); } } else if (nrm == 1) { for (k=pr[i]; kilower=rk*(n/size); ilower=(A_loc)->ilower; (A_loc)->iupper=(rk+1)*(n/size)-1; if(rk==size-1) (A_loc)->iupper=(A_loc)->iupper+n%size; iupper=(A_loc)->iupper; (A_loc)->n_loc=n_loc; if( !((A_loc)->ptr=(int *)malloc((n_loc+1)*sizeof(int))) ) {printf("%s","Malloc fails for ptr \n"); exit(1);} if( !((A_loc)->rows=(int *)malloc((n_loc)*sizeof(int))) ) {printf("%s","Malloc fails for rows \n");exit(1);} if( !((A_loc)->ncols=(int *)malloc((n_loc)*sizeof(int))) ) {printf("%s","Malloc fails for ncols \n");exit(1);} //Change global Input matrix (A) to local (A_loc) on each process if(type==0){ //Matrix A is in CSR format //Gets local nnz i1=(A_loc)->ilower; i2=(A_loc)->iupper; (A_loc)->ilower=i1; (A_loc)->iupper=i2; nnz_loc=0; for(i=i1;i<=i2;i++){ nnz_loc+=ptr[i+1]-ptr[i]; } //Allocate memory for local matrix if( !((A_loc)->id_cols=(int *)malloc(nnz_loc*sizeof(int))) ) {printf("%s","Malloc fails for id_cols \n");exit(1);} if( !((A_loc)->vals=(double *)malloc(nnz_loc*sizeof(double))) ) {printf("%s","Malloc fails for vals"); exit(1);} //Transfer the corresponding values from global to local relpos=0; //int ncols; //count number of elements in each row for(i=i1;i<=i2;i++){ (A_loc)->rows[i-i1]=i; (A_loc)->ptr[i-i1]=relpos; ncols=relpos; for(j=ptr[i];jid_cols[relpos]=id_rows[j]; (A_loc)->vals[relpos]=vals[j]; relpos++; } (A_loc)->ncols[i-i1]=relpos-ncols; } //cout << "taille des sous domaines" << nnz_loc << endl; } else{ //matrix A is in CSC format marker= (int *)calloc(n, sizeof(int)); //count number of elements in each row for(i=0; iptr[0]=0; //set up the beginning of each row for(i=0; iptr[i+1] = (A_loc)->ptr[i] + marker[i+ilower]; (A_loc)->id_cols[relpos]=id_rows[j]; (A_loc)->vals[relpos]=vals[j]; relpos++; } (A_loc)->ncols[i-ilower]=relpos-ncols; } return 0; } class hypreParam { //Solveur and preconditionner public: char solver[BUFLEN]; char precon[BUFLEN]; //BoomerAMG parameter int amg_coarsentype ; /* Falgout coarsening */ int amg_relaxtype; /* hybrid Gauss-Seidel or SOR */ int amg_interptype; /* default*/ int amg_maxlevels; int amg_numsweeps; /*default*/ double amg_strongthreshold;/*suitable for 3D Laplace Operator*/ double amg_truncfactor; int amg_prntlevel; /* print setup info */ double amg_tol; //BoomerAMG Tolerance int amg_maxiter; int scale; int gsmg_sample, measure_type,cycle_type; int solv_stopcrit ; double trunc_factor; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) int smooth_type; int smooth_numlevels; int smooth_numsweeps; double pilut_droptol; double pilut_maxnz; int schwarz_overlap; int schwarz_variant; int schwarz_domaintype; //parasails parameter int sai_max_levels ; double sai_threshold ; double sai_filter ; int sai_sym ; int sai_log ; int VERBOSE; /***************************HYPRE_BOOMERAMG***********************/ double strong_threshold; int * num_grid_sweeps; int * grid_relax_type; int * grid_relax_points; double * relax_weight; double * omega; //Solver parameter (used for GMRES , PCG or BiCGStab) double solv_tol ; int solv_maxiter; int solv_kdim; int solv_log; int solv_prntlevel; int precond_id, solver_id,matrix_id,solver_type; int smooth_num_levels,smooth_num_sweeps,max_levels,Two_Norm; int domain_type, num_functions,variant,overlap,nonzeros_to_keep; double max_row_sum,drop_tol; int *dof_func; int pcg_max_its,rrow_size,Rel_change; int dscg_max_its,coarsen_type,hybrid,k_dim,num_sweep; int pmax_iter; double cf_tol,tol,pc_tol; double schwarz_rlx_weight; /*For timing*/ int timing; public : hypreParam(const KN ¶m_int, const KN ¶m_double) { amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=0.0; //BoomerAMG Tolerance amg_maxiter=20; gsmg_sample=1; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) smooth_type=6; smooth_numlevels=3; smooth_numsweeps=1; pilut_droptol=1.0e-4; pilut_maxnz=100; schwarz_overlap=10; schwarz_variant=2; schwarz_domaintype=2; //parasails parameter sai_max_levels = 1; sai_threshold = 0.1; sai_filter = 0.1; sai_sym =0; sai_log = 1; int i; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-11; solv_maxiter = 1000; solv_kdim =40; solv_log = 0; solv_prntlevel = 2; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; pmax_iter=30; rrow_size=1000; solv_stopcrit=1; amg_interptype =6; gsmg_sample =5; amg_coarsentype =6; measure_type =1;amg_strongthreshold=0.25; trunc_factor=1e-2; amg_maxiter=20; cycle_type=1; smooth_num_levels=3; smooth_num_sweeps=1; max_levels=25; hybrid=1; k_dim = 5; smooth_type = 6; num_functions = 1; smooth_num_levels = 3; smooth_num_sweeps = 2; num_sweep = 1; variant = 0; overlap = 10; domain_type = 2; nonzeros_to_keep = 1000; tol = 1.e-8; pc_tol = 0.; drop_tol = -1.; max_row_sum = 0.9; schwarz_rlx_weight = 1.; sai_threshold = 0.1; sai_filter = 0.1; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } max_row_sum=0.9; schwarz_rlx_weight=1.; variant=0; num_functions=1; overlap=10; domain_type= 2; if(param_int.N()>0) {if((param_int[0]>=0)&&(param_int[0]<=9)) solver_id=param_int[0]; else solver_id=1;} //GMRES as solver if((solver_id!=4)&&(solver_id!=5)){ if(param_int.N()>1) {if((param_int[1]>=0)&&(param_int[1]<=9)) precond_id=param_int[1]; else precond_id=0;}//BOOMER AMG } if(param_int.N()>2) {if(param_int[2]>0) solv_maxiter = param_int[2];else solv_maxiter=1000;} if(param_int.N()>3) {if(param_int[3]>0) solv_kdim =param_int[3];else solv_kdim=40;} if(param_int.N()>4) {if(param_int[4]>=0) solv_prntlevel = param_int[4];} if(param_int.N()>5) {if(param_int[5]>=0) solv_log = param_int[5];} if(param_int.N()>6) {if(param_int[6]>=0) solv_stopcrit = param_int[6];} if(param_double.N()>0) {if(param_double[0]>0) solv_tol = param_double[0];} switch(precond_id) { case 0 : //Preconditionner AMG if(param_int.N()>7) {if(param_int[7]>=0) amg_interptype =param_int[7];} if(param_int.N()>8) {if(param_int[8]>=0) gsmg_sample =param_int[8];} if(param_int.N()>9) {if(param_int[9]>=0) amg_coarsentype =param_int[9];} if(param_int.N()>10) {if(param_int[10]>=0) measure_type =param_int[10];} if(param_double.N()>1) {if(param_double[1]>0) amg_strongthreshold = param_double[1];} if(param_double.N()>2) {if(param_double[2]>0) trunc_factor = param_double[2];} //if(param_int.N()>11) {if(param_int[11]>0) amg_maxiter=param_int[11];} if(param_int.N()>11) {if(param_int[11]>0) cycle_type=param_int[11];} if(param_int.N()>12) {if(param_int[12]>0) smooth_type=param_int[12];} if(param_int.N()>13) {if(param_int[13]>0) smooth_num_levels=param_int[13];} if(param_int.N()>14) {if(param_int[14]>0) smooth_num_sweeps=param_int[14];} if(param_int.N()>15) {if(param_int[15]>0) max_levels = param_int[15];} relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } if(param_double.N()>3) {if(param_double[3]>0) max_row_sum = param_double[3];else max_row_sum=0.9;} else max_row_sum=0.9; if(param_double.N()>4) {if(param_double[4]>0) schwarz_rlx_weight = param_double[4];else schwarz_rlx_weight=1.;} else schwarz_rlx_weight=1.; if(param_int.N()>16) {if(param_int[16]>0) variant = param_int[16];else variant=3;} else variant=3; if(param_int.N()>17) {if(param_int[17]>0) num_functions = param_int[17];else num_functions=1;} else num_functions=1; if(param_int.N()>18) {if(param_int[18]>0) overlap = param_int[18];else overlap=10;} else overlap=10; if(param_int.N()>19) {if(param_int[19]>0) domain_type = param_int[19]; else domain_type= 2;} else domain_type= 2; break; case 1: //Preconditionner PILUT if(param_double.N()>1) {if(param_double[1]>0) drop_tol = param_double[1]; else drop_tol=1e-5;} else drop_tol=1e-5; if(param_int.N()>7) {if(param_int[7]>0) nonzeros_to_keep = param_int[7]; else nonzeros_to_keep=1000;} else nonzeros_to_keep=1000; if(param_int.N()>8) {if(param_int[8]>0) pmax_iter = param_int[8];} if(param_int.N()>9) {if(param_int[9]>0) rrow_size = param_int[9];} break; case 2://Preconditionner ParaSails if(param_double.N()>1) {if(param_double[1]>0) sai_filter = param_double[1];else sai_filter=0.1;} else sai_filter=0.1; if(param_double.N()>2) {if(param_double[2]>0) sai_threshold = param_double[2];else sai_threshold=0.1;} else sai_threshold=0.1; if(param_int.N()>7) {if(param_int[7]>0) max_levels = param_int[7];else max_levels=1;} else max_levels=1; if(param_int.N()>8) {if(param_int[8]>0) sai_sym =param_int[8];else sai_sym=0;} else sai_sym=0; break; case 3: //Preconditionner Schwarz if(param_double.N()>1) {if(param_double[1]>0) schwarz_rlx_weight = param_double[1];schwarz_rlx_weight=1;} else schwarz_rlx_weight=1.; if(param_int.N()>7) {if(param_int[7]>0) variant = param_int[7];else variant=1;} else variant=1; if(param_int.N()>8) {if(param_int[8]>0) overlap = param_int[8];else overlap=1;} else overlap=1; if(param_int.N()>9) {if(param_int[9]>0) domain_type = param_int[9];else domain_type=3;} else domain_type=3; break; default: break; } } if(solver_id==4) // Solver AMG_HYBRID { if(param_double.N()>1) {if(param_double[1]>=0) amg_tol =param_double[1];else amg_tol=1e-9;} else amg_tol=1e-9; if(param_double.N()>2) {if(param_double[2]>=0) cf_tol =param_double[2];else cf_tol= 1e-3;} else cf_tol= 1e-3; if(param_int.N()>1) {if(param_int[1]>=0) solver_type =param_int[1];else solver_type=1;} else solver_type=1; if(param_int.N()>2) {if(param_int[2]>0) dscg_max_its=param_int[2];else dscg_max_its=1000;} else dscg_max_its=1000; if(param_int.N()>3) {if(param_int[3]>0) pcg_max_its=param_int[3];else pcg_max_its=200;} else pcg_max_its=200; if(param_int.N()>4) {if(param_int[4]>0) coarsen_type=param_int[4]; else coarsen_type=6;} else coarsen_type=6; if(param_double.N()>3) {if(param_double[3]>0) strong_threshold = param_double[3]; else strong_threshold=1e-3;} else strong_threshold=1e-3; if(param_double.N()>4) {if(param_double[4]>0) trunc_factor = param_double[4]; else trunc_factor=1e-2;} else trunc_factor=1e-2; if(param_int.N()>5) {if(param_int[5]>0) max_levels = param_int[5]; else max_levels=25;} else max_levels=25; if(param_double.N()>5) {if(param_double[5]>0) max_row_sum = param_double[5];else max_row_sum=0.9;} else max_row_sum=0.9; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } } if(solver_id==3) { if(param_int.N()>7) {if(param_int[7]>=0) Two_Norm =param_int[7];else Two_Norm=2;} else Two_Norm=2; if(param_int.N()>8) {if(param_int[8]>=0) Rel_change =param_int[8];else Rel_change=1;} else Rel_change=1; } if(solver_id==5) //Solver AMG { if(param_int.N()>7) {if(param_int[7]>=0) amg_interptype =param_int[7];} if(param_int.N()>8) {if(param_int[8]>=0) gsmg_sample =param_int[8];} if(param_int.N()>9) {if(param_int[9]>=0) amg_coarsentype =param_int[9];} if(param_int.N()>10) {if(param_int[10]>=0) measure_type =param_int[10];} if(param_double.N()>2) {if(param_double[2]>0) amg_strongthreshold = param_double[2];} if(param_double.N()>3) {if(param_double[3]>0) trunc_factor = param_double[3];} if(param_int.N()>11) {if(param_int[11]>0) amg_maxiter=param_int[11];} if(param_int.N()>12) {if(param_int[12]>0) cycle_type=param_int[12];} if(param_int.N()>13) {if(param_int[13]>0) smooth_type=param_int[13];} if(param_int.N()>14) {if(param_int[14]>0) smooth_num_levels=param_int[14];} if(param_int.N()>15) {if(param_int[15]>0) smooth_num_sweeps=param_int[15];} if(param_int.N()>16) {if(param_int[16]>0) max_levels = param_int[16];} relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } if(param_double.N()>4) {if(param_double[4]>0) max_row_sum = param_double[4];else max_row_sum=1e-1;} else max_row_sum=1e-1; if(param_double.N()>5) {if(param_double[5]>0) schwarz_rlx_weight = param_double[5];else schwarz_rlx_weight=1.;} else schwarz_rlx_weight=1.; if(param_int.N()>17) {if(param_int[17]>0) variant = param_int[17];else variant=1;} else variant=1; if(param_int.N()>19) {if(param_int[18]>0) num_functions = param_int[18];else num_functions=5;} else num_functions=5; if(param_int.N()>20) {if(param_int[19]>0) overlap = param_int[19];else overlap=1;} else overlap=1; if(param_int.N()>21) {if(param_int[20]>0) domain_type = param_int[20];else domain_type= 1;} else domain_type= 1; } if(param_int.N()>22) {if(param_int[22]>0) VERBOSE = param_int[22];} if(param_int.N()>23) {if(param_int[23]>0) scale = param_int[23]; else scale=1;} else scale=1; if(param_int.N()>24) {if(param_int[24]>0) timing = param_int[24]; else timing=1;} else timing=1; } public : hypreParam() { int i; amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=1e-7; //BoomerAMG Tolerance amg_maxiter=1; gsmg_sample=1; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-11; solv_maxiter = 1000; solv_kdim =40; solv_log = 0; solv_prntlevel = 2; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; pmax_iter=30; rrow_size=1000; amg_interptype =0; gsmg_sample =1; amg_coarsentype =6; measure_type =1;amg_strongthreshold=0.25; trunc_factor=1e-2; amg_maxiter=20; cycle_type=1; smooth_type=6; smooth_num_levels=0; smooth_num_sweeps=2; max_levels=25; relax_weight = hypre_CTAlloc(double, max_levels); omega = hypre_CTAlloc(double, max_levels); for (i=0; i < max_levels; i++) { relax_weight[i] = 1.; omega[i] = 1.; } max_row_sum=0.9; schwarz_rlx_weight=1.; variant=0; num_functions=1; overlap=10; domain_type= 0; } public : hypreParam(char * fileparameter, MPI_Comm comm) { FILE *f; char buf[BUFLEN]; int num; int rk, size; MPI_Comm_rank(comm,&rk); MPI_Comm_size(comm, &size); amg_coarsentype =6; /* Falgout coarsening */ amg_relaxtype =3; /* hybrid Gauss-Seidel or SOR */ amg_interptype=0; /* default*/ amg_maxlevels=25; amg_numsweeps=1; /*default*/ amg_strongthreshold = 0.25;/*suitable for 3D Laplace Operator*/ amg_truncfactor=0.3; amg_prntlevel =1; /* print setup info */ amg_tol=0.0; //BoomerAMG Tolerance amg_maxiter=20; //More complex smoothers (Schwarz methods, Pilut, Parasails, Euclid) smooth_type=6; smooth_numlevels=3; smooth_numsweeps=1; pilut_droptol=1.0e-4; pilut_maxnz=100; schwarz_overlap=10; schwarz_variant=2; schwarz_domaintype=2; //parasails parameter sai_max_levels = 1; sai_threshold = 0.1; sai_filter = 0.05; sai_sym =0; sai_log = 1; //Solver parameter (used for GMRES or BiCGStab) solv_tol = 1.0e-30; solv_maxiter = 80; solv_kdim =40; // int solv_stopcrit = 1; //only for BiCGSTAB solv_log = 0; solv_prntlevel = 0; precond_id=0;//BOOMER AMG solver_id=1; //GMRES as solver VERBOSE=0; scale=1; if(fileparameter==NULL) { if(rk==0) printf("%s","Set default parameter because you not precise the parameter file \n \n"); solver_id=1; //GMRES as solver precond_id=0;//BOOMER AMG } else if( (f=fopen(fileparameter,"r") )==NULL) { if(rk==0)printf("%s","Set default parameter because your parameter file not exist \n \n"); solver_id=1; //GMRES as solver precond_id=0;//BOOMER AMG } else { if(rk==0) printf("%s%s%s","Read parameter from file ", fileparameter, "\n \n"); num =0; while(fgets(buf, BUFLEN, f) != NULL) { switch(num) { case 0: sscanf(buf, "%s", solver); break; case 1: sscanf(buf, "%d", &solver_id); break; case 2: sscanf(buf, "%lf", &solv_tol); break; case 3: sscanf(buf, "%d", &solv_maxiter); break; case 4: sscanf(buf, "%d", &solv_prntlevel); break; case 5: sscanf(buf, "%d", &solv_log); if(solver_id!=1) {fgets(buf, BUFLEN, f);num++;} break; case 6: sscanf(buf, "%d", &solv_kdim); break; case 7: sscanf(buf, "%s", precon); break; case 8: sscanf(buf, "%d", &precond_id); if(precond_id==2) //The parameter of preconditionner is inside file { fclose(f); exit(1); } break; case 9: if(precond_id==0) sscanf(buf, "%d", &amg_coarsentype); if(precond_id==1) sscanf(buf, "%lf", &sai_threshold); break; case 10: if(precond_id==0) sscanf(buf, "%d", &amg_prntlevel); if(precond_id==1) sscanf(buf, "%d", &sai_max_levels); break; case 11: if(precond_id==0) sscanf(buf, "%d", &amg_interptype); if(precond_id==1) sscanf(buf, "%lf", &sai_filter); break; case 12: if(precond_id==0) sscanf(buf, "%d", &amg_maxlevels); if(precond_id==1) case 17: sscanf(buf, "%d", &amg_prntlevel); break; case 18: sscanf(buf, "%lf", &amg_tol); break; case 19: sscanf(buf, "%d", &amg_maxiter); break; case 20: sscanf(buf, "%d", &scale); break; default: break; } num++; } if(fclose(f)==EOF) printf("%s","Error while closing the file \n"); else printf("%s","File is well close \n"); } } }; class HypreSolver : public MatriceMorse::VirtualSolver { mutable HYPRE_IJMatrix ij_A; mutable HYPRE_IJVector ij_B; mutable HYPRE_IJVector ij_X; mutable HYPRE_ParCSRMatrix par_A; mutable HYPRE_ParVector par_B; mutable HYPRE_ParVector par_X; void *object; HYPRE_ParCSRMatrix parcsr_A; string data_option; mutable int time_index,time_index1; mutable HYPRE_Solver solver; mutable HYPRE_Solver precond; mutable hypreParam *param; mutable double *scaletmpr, *scaletmpc; mutable int rk,size; int jlower, jupper; int ilower, iupper; mutable int num_iter; mutable double final_res_norm; mutable double tgv,eps,tol_pivot,tol_pivot_sym,epsr; sparse_mat_loc A_loc; mutable int *iwork, *maptmp, *mapptr, *iwork1,*riord; mutable int n_loc,n,VERBOSE; mutable MPI_Comm comm; mutable int pcg_num_its,dscg_num_its; public: HypreSolver(const MatriceMorse &AA,string datafile, KN ¶m_int, KN ¶m_double, MPI_Comm * mpicommw ) { int i,j,ierrr; if(mpicommw==NULL){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /*****INITIALIZE MPI ENVIRONMENT*****/ ierrr = MPI_Comm_rank(comm, &rk); ierrr = MPI_Comm_size(comm, &size); if(((param_double!=NULL)||(param_int!=NULL))&&(datafile.empty())) { if(rk==0) cout << "#########PARAMETERS ARE SET INSIDE A VECTOR###"<< endl; param=new hypreParam(param_int,param_double); } if((datafile.empty())&&((param_int==NULL)&&(param_double==NULL))) { if(rk==0) cout << "###########DEFAULT PARAMETERS WILL BE SET#######"<< endl; param= new hypreParam(); } if((!datafile.empty())&&((param_int==NULL)&&(param_double==NULL))) { if(rk==0) cout << "#########PARAMETERS ARE INSIDE A FILE#########"<< endl; char *p; p=new char[datafile.length()+1]; strcpy(p,datafile.c_str()); param= new hypreParam(p,comm); } /*################################################### USING HYPRE ####################################################*/ int n,nnz, *pr, *p,ierr; double * AAv; n=AA.n; nnz=AA.nbcoef; /*################################################## COPY ENTRY MATRIX ##################################################*/ if(param->timing){ time_index = hypre_InitializeTiming("MATRIX DISTRIBUTION"); hypre_BeginTiming(time_index); } pr= new int[n+1];p= new int[nnz]; AAv=new double[nnz]; for(i=0;iscale) { job = 1; /*-- compute 1-norm */ tmp = 2; /*-- compute 2-norm */ scaletmpr=new double[n]; scaletmpc=new double[n]; roscal(n,job,tmp,AAv,p,pr,scaletmpr,&ierr); if (ierr) fprintf(stderr, "ERROR: IN ROSCAL, IERR = %d\n", ierr); /*------- scale the RHS according to row scaling coefficients */ coscal(n,job,tmp,AAv,p,pr,scaletmpc,&ierr); if (ierr) fprintf(stderr, "ERROR : IN COSCAL, IERR = %d\n", ierr); } /*--- end of branch on scaling */ /************************************************************* Distribute input matrix into local structures *************************************************************/ int type=0,wgtflag=0, numflag=0, volume; //0=CSR; 1=CSC int option[5]; option[0]=0; riord=(int *)malloc(sizeof(int)*n); if(riord==NULL){if(rk==0) printf("%s","IN PARTITION , MEMORY ALLOCATION FAILED \n");exit(1);} /************************USE METIS FOR DATA DISTRIBUTION**************************/ if(size>1) METIS_PartGraphKway(&n, pr, p, NULL, NULL, &wgtflag, &numflag,&size, option, &volume, riord); else if(size==1){ for (i=0; itiming){ hypre_EndTiming(time_index); hypre_PrintTiming("IJ Matrix Setup", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } /************************************************************* Create preconditioner Setup and Use solver **************************************************************/ param->timing=1; switch(param->solver_id){ case 0 : //BiCGStab solver HYPRE_ParCSRBiCGSTABCreate(comm, &solver); HYPRE_ParCSRBiCGSTABSetTol(solver, param->solv_tol); HYPRE_ParCSRBiCGSTABSetMaxIter(solver, param->solv_maxiter); //HYPRE_ParCSRBiCGSTABSetStopCrit(solver, solv_stopcrit); HYPRE_ParCSRBiCGSTABSetPrintLevel(solver, param->solv_prntlevel); HYPRE_ParCSRBiCGSTABSetLogging(solver, param->solv_log); //Set Preconditioner switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner if(rk==0) printf("SOLVER: BOOMERAMG-BiCGSTAB\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_BiCGSTABSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 4: /*use diagonal scaling as preconditioner*/ if(rk==0) printf("SOLVER: DS-BiCGSTAB\n"); precond=NULL; HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScale, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScaleSetup, precond); break; case 1: /*Use PILUT as preconditioner*/ if(rk==0) printf("SOLVER: PILUT-BiCGSTAB\n"); ierr=HYPRE_ParCSRPilutCreate(comm,&precond); if(ierr) printf("ERROR: PILUT-BiCGSTAB\n"); if(param->drop_tol>=0) HYPRE_ParCSRPilutSetDropTolerance(precond,param->drop_tol); if(param->nonzeros_to_keep>=0) HYPRE_ParCSRPilutSetFactorRowSize(precond,param->nonzeros_to_keep); HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-BicGSTAB\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-BicGSTAB\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_ParCSRBiCGSTABSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-PCG \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_BiCGSTABSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, precond); break; default: break; } break; case 2:/*USE PCG AS SOLVER*/ HYPRE_ParCSRPCGCreate(comm, &solver); HYPRE_ParCSRPCGSetTol(solver, param->solv_tol); HYPRE_PCGSetMaxIter(solver, param->solv_maxiter); HYPRE_PCGSetPrintLevel(solver, param->solv_prntlevel); HYPRE_PCGSetTwoNorm(solver, param->Two_Norm); HYPRE_PCGSetRelChange(solver,param->Rel_change); HYPRE_PCGGetPrecond(solver,&precond); switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner in PCG if(rk==0) printf("SOLVER: AMG-PCG\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-PCG\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-PCG\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-PCG \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_PCGSetPrecond(solver, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, precond); break; default: break; } break; case 5: if(rk==0) printf("SOLVER: AMG \n"); HYPRE_BoomerAMGCreate(&solver); HYPRE_BoomerAMGSetInterpType(solver, param->amg_interptype); HYPRE_BoomerAMGSetNumSamples(solver, param->gsmg_sample); HYPRE_BoomerAMGSetTol(solver, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(solver, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(solver,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(solver, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(solver,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(solver, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(solver,param->cycle_type); HYPRE_BoomerAMGSetRelaxWeight(solver,param->relax_weight); HYPRE_BoomerAMGSetOmega(solver,param->omega); HYPRE_BoomerAMGSetSmoothType(solver,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(solver,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(solver,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(solver,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(solver,param->max_row_sum); HYPRE_BoomerAMGSetVariant(solver, param->variant); // HYPRE_BoomerAMGSetNumFunctions(solver, param->num_functions); //HYPRE_BoomerAMGSetSchwarzRlxWeight(solver,param->schwarz_rlx_weight); HYPRE_BoomerAMGSetOverlap(solver, param->overlap); HYPRE_BoomerAMGSetVariant(solver, param->domain_type); /* if(param->num_functions>1) HYPRE_BoomerAMGSetDofFunc(solver,param->dof_func);*/ break; case 4: if(rk==0) printf("SOLVER: AMG_HYBRID \n"); HYPRE_ParCSRHybridCreate(&solver); HYPRE_ParCSRHybridSetTol(solver, param->amg_tol); HYPRE_ParCSRHybridSetCoarsenType(solver,param->coarsen_type); HYPRE_ParCSRHybridSetStrongThreshold(solver, param->strong_threshold); HYPRE_ParCSRHybridSetTruncFactor(solver,param->trunc_factor); HYPRE_ParCSRHybridSetDSCGMaxIter(solver,param->dscg_max_its); HYPRE_ParCSRHybridSetPCGMaxIter(solver,param->pcg_max_its); HYPRE_ParCSRHybridSetConvergenceTol(solver, param->cf_tol); HYPRE_ParCSRHybridSetSolverType(solver, param->solver_type); HYPRE_ParCSRHybridSetRelaxWeight(solver,param->relax_weight); HYPRE_ParCSRHybridSetOmega(solver,param->omega); HYPRE_ParCSRHybridSetMaxLevels(solver,param->max_levels); HYPRE_ParCSRHybridSetMaxRowSum(solver,param->max_row_sum); break; case 1:/*GMRES AS SOLVER*/ HYPRE_ParCSRFlexGMRESCreate (comm, &solver); HYPRE_ParCSRFlexGMRESSetPrintLevel(solver,VERBOSE); HYPRE_ParCSRFlexGMRESSetKDim(solver,param->solv_kdim); HYPRE_ParCSRFlexGMRESSetMaxIter(solver, param->solv_maxiter ); HYPRE_ParCSRFlexGMRESSetTol(solver,param->solv_tol ); HYPRE_FlexGMRESSetLogging(solver, param->solv_log); HYPRE_ParCSRGMRESSetPrintLevel(solver,param->solv_prntlevel); //Set Preconditioner switch (param->precond_id){ case 0 : //set BoomerAMG as preconditioner if(rk==0) printf("SOLVER: AMG-GMRES\n"); HYPRE_BoomerAMGCreate(&precond); HYPRE_BoomerAMGSetInterpType(precond, param->amg_interptype); // HYPRE_BoomerAMGSetTol(precond, param->amg_tol); HYPRE_BoomerAMGSetCoarsenType(precond, param->amg_coarsentype); HYPRE_BoomerAMGSetMeasureType(precond,param-> measure_type); HYPRE_BoomerAMGSetStrongThreshold(precond, param->amg_strongthreshold); HYPRE_BoomerAMGSetTruncFactor(precond,param->trunc_factor); HYPRE_BoomerAMGSetMaxIter(precond, param->amg_maxiter); HYPRE_BoomerAMGSetCycleType(precond,param->cycle_type); HYPRE_BoomerAMGSetSmoothType(precond,param->smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(precond,param->smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(precond,param->smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(precond,param->max_levels); HYPRE_BoomerAMGSetMaxRowSum(precond,param->max_row_sum); HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSetup, precond); break; case 4: /*use diagonal scaling as preconditioner*/ if(rk==0) printf("SOLVER: DS-GMRES\n"); precond = NULL; HYPRE_ParCSRFlexGMRESSetPrecond (solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScale, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRDiagScaleSetup, precond); break; case 1: /*Use PILUT as preconditioner*/ if(rk==0) printf("SOLVER: PILUT-GMRES\n"); ierr=HYPRE_ParCSRPilutCreate(comm,&precond); HYPRE_ParCSRPilutSetMaxIter(precond,param->pmax_iter); if(param->drop_tol>=0) HYPRE_ParCSRPilutSetDropTolerance(precond,param->drop_tol); if(param->nonzeros_to_keep>=0) HYPRE_ParCSRPilutSetFactorRowSize(precond,param->nonzeros_to_keep); if(ierr) printf("ERROR: PILUT-GMRES \n"); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParCSRPilutSetup, precond); break; case 3: if(rk==0) printf("SOLVER: Schwarz-GMRES \n"); HYPRE_SchwarzCreate(&precond); HYPRE_SchwarzSetVariant(precond,param->variant); HYPRE_SchwarzSetOverlap(precond,param->overlap); HYPRE_SchwarzSetDomainType(precond,param->domain_type); //HYPRE_SchwarzSetRelaxWeight(precond,param->schwarz_rlx_weight); /*HYPRE_BoomerAMGSetOverlap(precond, param->overlap); HYPRE_BoomerAMGSetVariant(precond, param->variant); HYPRE_BoomerAMGSetDomainType(precond, param->domain_type);*/ HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_SchwarzSolve, (HYPRE_PtrToParSolverFcn) HYPRE_SchwarzSetup, precond); break; case 2: if(rk==0) printf("SOLVER: ParaSails-GMRES\n"); ierr=HYPRE_ParaSailsCreate(comm,&precond); if(ierr) printf("ERROR: ParaSails-GMRES\n"); HYPRE_ParaSailsSetParams(precond,param->sai_threshold,param->max_levels); HYPRE_ParaSailsSetFilter(precond,param->sai_filter); HYPRE_ParaSailsSetSym(precond,param->sai_sym); HYPRE_ParCSRFlexGMRESSetPrecond(solver, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSolve, (HYPRE_PtrToParSolverFcn) HYPRE_ParaSailsSetup, precond); break; } default: break; } } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; int i, i1,i2; int *row,*row1; double * b_loc,*X_loc,*rhs,*xx; n=AA.n; rhs= (double *)malloc(sizeof(double)*n); xx= (double *)malloc(sizeof(double)*n); x= (double *)malloc(sizeof(double)*n); i1=ilower; i2=iupper; double t2,t1; for(i=0;iscale) for(i = 0; i < n; i++) rhs[i] *= scaletmpr[i]; b_loc=(double *)malloc(n_loc*sizeof(double)); X_loc=(double *)malloc(n_loc*sizeof(double)); row=(int *)malloc(n_loc*sizeof(int)); row1=(int *)malloc(n_loc*sizeof(int)); for(i=i1;i <=i2; i++){ // node = maptmp[i]; b_loc[i-i1]=rhs[i]; X_loc[i-i1]=0.0; //Initial Guest row[i-i1]=i; //used to get results later row1[i-i1]=i; } int ierr=0; HYPRE_IJVectorCreate(comm, ilower, iupper, &ij_B); HYPRE_IJVectorCreate(comm, ilower, iupper, &ij_X); HYPRE_IJVectorSetObjectType(ij_B, HYPRE_PARCSR); HYPRE_IJVectorSetObjectType(ij_X, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_B); HYPRE_IJVectorInitialize(ij_X); HYPRE_IJVectorSetValues(ij_B, n_loc, row, b_loc); HYPRE_IJVectorSetValues(ij_X, n_loc, row, X_loc); HYPRE_IJVectorAssemble(ij_B); HYPRE_IJVectorAssemble(ij_X); ierr=HYPRE_IJVectorGetObject(ij_B, (void **) &par_B); ierr=HYPRE_IJVectorGetObject(ij_X, (void **) &par_X); switch (param->solver_id){ case 0 : //BICGSTAB solver if(param->timing){ time_index1 = hypre_InitializeTiming("BiCGSTAB SETUP"); hypre_BeginTiming(time_index1); } HYPRE_ParCSRBiCGSTABSetup (solver, par_A, par_B, par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("BiCGSTAB SETUP TIME", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR BICGSTAB Solver"); hypre_BeginTiming(time_index1);} HYPRE_ParCSRBiCGSTABSolve (solver, par_A, par_B, par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("SOLVE PHASE TIMES", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRBiCGSTABGetNumIterations(solver, &num_iter); HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm(solver, &final_res_norm); //HYPRE_ParCSRBiCGSTABDestroy(solver); break; case 1 : //GMRES Solver if(param->timing){ time_index1 = hypre_InitializeTiming("GMRES SETUP"); hypre_BeginTiming(time_index1); } HYPRE_FlexGMRESSetup(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR GMRES Solver"); hypre_BeginTiming(time_index1); } HYPRE_FlexGMRESSolve(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_GMRESGetNumIterations(solver, &num_iter); HYPRE_GMRESGetFinalRelativeResidualNorm(solver, &final_res_norm); //HYPRE_ParCSRGMRESDestroy(solver); break; case 2 : //PCG if(param->timing){ time_index1 = hypre_InitializeTiming("PCG SETUP"); hypre_BeginTiming(time_index1); } HYPRE_PCGSetup(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR PCG Solve"); hypre_BeginTiming(time_index1);} HYPRE_PCGSolve(solver, (HYPRE_Matrix)par_A, (HYPRE_Vector)par_B, (HYPRE_Vector)par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRPCGGetNumIterations(solver,&dscg_num_its); HYPRE_ParCSRPCGGetFinalRelativeResidualNorm(solver,&final_res_norm); break; case 4: if(param->timing){ time_index1 = hypre_InitializeTiming("HYBRID SETUP"); hypre_BeginTiming(time_index1); } HYPRE_ParCSRHybridSetup(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index); hypre_PrintTiming("SETUP PHASE TIME", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } if(param->timing){ time_index1 = hypre_InitializeTiming("ParCSR Hybrid Solve"); hypre_BeginTiming(time_index1);} HYPRE_ParCSRHybridSolve(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} HYPRE_ParCSRHybridGetNumIterations(solver,&num_iter); HYPRE_ParCSRHybridGetPCGNumIterations(solver,&pcg_num_its); HYPRE_ParCSRHybridGetDSCGNumIterations(solver,&dscg_num_its); HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(solver,&final_res_norm); if(rk==0){ printf("\n"); printf("Iterations = %d\n", num_iter); printf("PCG_Iterations = %d\n", pcg_num_its); printf("DSCG_Iterations = %d\n", dscg_num_its); printf("Final Relative Residual Norm = %e\n", final_res_norm); printf("\n"); } break; case 5: if(param->timing){ time_index1 = hypre_InitializeTiming("BoomerAMG SETUP"); hypre_BeginTiming(time_index1); } HYPRE_BoomerAMGSetup(solver,par_A, par_B,par_X); if(param->timing){ time_index1 = hypre_InitializeTiming("BoomerAMG SETUP Solve"); hypre_BeginTiming(time_index1);} HYPRE_BoomerAMGSolve(solver,par_A,par_B,par_X); if(param->timing){ hypre_EndTiming(time_index1); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index1); hypre_ClearTiming();} break; default : break; } /*Reconstruction of vector*/ delete [] iwork1; delete []mapptr; iwork1=new int[size+1]; mapptr=new int[size+1]; int disp=0; for(i=0;iscale) x[i]=x[i]*scaletmpc[i];} if(verbosity==0) { MPI_Barrier(comm); t2 = dwalltime(); t2=t2-t1; MPI_Reduce(&t2, &t1, 1, MPI_DOUBLE, MPI_MAX, 0,comm); MPI_Bcast(&t1, 1, MPI_DOUBLE,0,comm); if(rk==0){printf("%s%18.6g%s","TIME FOR SOLVING ", fabs(t1) ,"\n \n"); printf("%s%18.6g%s","RELATIVE RESIDU ", final_res_norm ,"\n \n"); printf("%s%d%s","NUMBER OF ITERATION ", num_iter ," \n \n"); } } if(X_loc!=NULL) free(X_loc); if(rhs!=NULL) free(rhs); if(xx!=NULL) free(xx); if(b_loc!=NULL) free(b_loc); if(row!=NULL) free(row); if(iwork1!=NULL) delete [] iwork1; if(mapptr!=NULL) delete [] mapptr; } ~HypreSolver() { if(verbosity){ cout << "~HypreSolver():" << endl; HYPRE_IJMatrixDestroy(ij_A); HYPRE_IJVectorDestroy(ij_B); HYPRE_IJVectorDestroy(ij_X); switch (param->solver_id){ case 0 : //BICGSTAB solver HYPRE_ParCSRBiCGSTABDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; case 4: HYPRE_ParCSRPilutDestroy(precond); break; default: break; } break; case 1 : //GMRES Solver HYPRE_ParCSRFlexGMRESDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; case 4: HYPRE_ParCSRPilutDestroy(precond); break; default: break; } break; case 3 : //PCG HYPRE_ParCSRPCGDestroy(solver); switch(param->precond_id){ case 0: HYPRE_BoomerAMGDestroy(precond); break; case 5: HYPRE_ParaSailsDestroy(precond); break; case 6: HYPRE_SchwarzDestroy(precond); break; default: break; } break; case 4: //AMG-Hybrid HYPRE_ParCSRHybridDestroy(solver); break; case 5: //AMG HYPRE_BoomerAMGDestroy(solver); break; default : break; } } } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; inline MatriceMorse::VirtualSolver * BuildHypreSolver(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverHypre>" << endl; return new HypreSolver(*A,ds.data_filename, ds.lparams, ds.dparams,(MPI_Comm *)ds.commworld); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return 1; } bool SetHypreSolver() { if(verbosity>1) cout << " SetDefault sparse solver to Hyprempi" << endl; DefSparseSolver::solver =BuildHypreSolver; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return 1; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Hyprempi, defaultsolver defaultsolverHyprempi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildHypreSolver; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoHyprempi","(",new OneOperator0(SetHypreSolver)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/Stokes-v2-matrix-mumps.edp000644 000767 000024 00000004650 13256636774 023307 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "MUMPS_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int nn=15; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); //medit("c10x10x10",Th); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; Uh u1,u2,u3; Uh v1,v2,v3; Ph p,q; real timeI=clock(); real time1=clock(); //VVh [uu1,uu2,uu3,up]; varf vlaplace([u1,u2,u3],[v1,v2,v3]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) ) + on(2,u1=fup,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; //' varf vdiv([u1,u2,u3],[q])=int3d(Th,qforder=3)(- div(u1,u2,u3)*q ); varf vdivT([q],[u1,u2,u3])=int3d(Th,qforder=3)(- div(u1,u2,u3)*q ); varf vmass(p,q) = int3d(Th,qforder=3)( 1e-10*p*q ); matrix M=vmass(Ph,Ph); matrix L=vlaplace(UUh,UUh,tgv=ttgv); matrix B=vdiv(UUh,Ph); matrix BT=vdivT(Ph,UUh); matrix A = [ [ L, BT ], //' [ B, M ]]; time1=clock()-time1; real timeF=clock(); set(A,solver=sparsesolver,sparams=ssparams); timeF=clock()-timeF; real time2=clock(); real[int] b(VVh.ndof); real[int] xx(VVh.ndof); { real[int] b1 = vlaplace(0,UUh); for(int ii=0; ii 1e-6) nerr++; if(abs(ev[i]-eev[i]) > 1e-1) nerr++; cout << " ---- " << i<< " " << ev[i] << " == " << eev[i] << " err= " << err << " --- "<size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; case 15: // matrix printf("parameter matrix \n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("value of parameter matrix is not correct %s \n", tictac ); } break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_options_freefem(string *string_option, superlu_options_t *options, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE, SLU_SINGLE, SLU_DOUBLE, SLU_EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //static const char* compMemType_t[] = {"LUSUP", "UCOL", "LSUB", "USUB",0}; //static const char* compstack_end_t[] = {"HEAD", "TAIL",0}; //static const char* compLU_space_t[] = {"SYSTEM", "USER",0}; static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","DiagScale","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); cout << "data=" << data << endl; char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2=tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; // case 13 nprow // case 14 npcol case 15: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } // void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ // static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", // "DiagPivotThresh","IterRefine","Trans", // "ReplaceTinyPivot","SolveInitialized", // "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; // char data[string_option->size()+1]; // strcpy( data, string_option->c_str()); // char *tictac; // char *tictac2; // tictac = strtok(data," =,\t\n"); // while(tictac != NULL){ // int id_option = s_(tictac, comp); // tictac2 = tictac; // tictac = strtok(NULL," =,\t\n"); // int val_options; // printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); // switch (id_option) // { // case 13: // nprow // *nprow = atoi(tictac); // break; // case 14: // npcol // *npcol = atoi(tictac); // break; // case 15: // matrix // printf("parameter matrix \n"); // if(strcmp(tictac,"assembled") == 0) // *matrixdist = 0; // else if(strcmp(tictac,"distributedglobal") == 0) // *matrixdist = 1; // else if(strcmp(tictac,"distributed") == 0) // *matrixdist = 2; // else{ // printf("value of parameter matrix is not correct %s \n", tictac ); // } // break; // default: // Equivalent of case default // if(id_option == 0) // { // printf("parameter is not valid for superlu_dist %s \n", tictac2 ); // exit(1); // } // break; // } // tictac = strtok(NULL," =,\t\n"); // } // } void read_options_superlu_datafile(string *data_option, superlu_options_t *options, int_t *nprow, int_t *npcol, int *matrixdist, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE, SLU_SINGLE, SLU_DOUBLE, SLU_EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //int_t ffnprow,ffnpcol; //int matrixdist; char datafile[data_option->size()+1]; strcpy( datafile, data_option->c_str()); FILE* pfile= fopen( datafile,"rt"); char data[256]; char *tictac; fgets(data,256,pfile); cout << "data=" << data << endl; tictac = strtok(data," /!#\t\n"); *nprow = (int) atol(tictac); if(verbosity) printf("nprow=%d\n",*nprow); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); *npcol = (int) atol(tictac); if(verbosity) printf("npcol=%d\n",*npcol); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("matrix input %s for superlu_dist is not correct\n", tictac ); exit(1); } int id_option=0; while( !feof(pfile) && id_option<12){ fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); id_option++; int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; case 13: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0 && id_option > 13) { printf("Error in reading data file for superlu_dist %s\n",datafile); exit(1); } break; } } fclose(pfile); } freefem++-3.61-1/examples++-mpi/generaldefs.h000755 000767 000024 00000005142 13256636774 021007 0ustar00hechtstaff000000 000000 #if defined(AIX) #define wreadmtc wreadmtc #define userread userread #define nod2dom nod2dom #define roscal roscal #define coscal coscal #define csrcsc csrcsc #define aplb aplb #define expnddom expnddom #elif defined(BGL) #define wreadmtc wreadmtc #define userread userread #define nod2dom nod2dom #define roscal roscal #define coscal coscal #define csrcsc csrcsc #define aplb aplb #define expnddom expnddom #elif defined(LINUX) #define wreadmtc wreadmtc_ #define userread userread_ #define nod2dom nod2dom_ #define roscal roscal_ #define coscal coscal_ #define csrcsc csrcsc_ #define aplb aplb_ #define expnddom expnddom_ #elif defined(CRAY) #define wreadmtc WREADMTC #define userread USERREAD #define nod2dom NOD2DOM #define roscal ROSCAL #define coscal COSCAL #define csrcsc CSRCSC #define aplb APLB #define expnddom EXPNDDOM #else #define wreadmtc wreadmtc_ #define userread userread_ #define nod2dom nod2dom_ #define roscal roscal_ #define coscal coscal_ #define csrcsc csrcsc_ #define aplb aplb_ #define expnddom expnddom_ #endif /* for outer and inner functions */ extern void setpar(char *filename, char *matrix, int *iov, int *scale, int *unsym, int *method, PrePar prepar, IterPar ipar, DistMatrix dm) ; int assignprecon( char *precon_str, DistMatrix dm); void set_def_params(PrePar prepar, IterPar ipar) ; extern void userread(char *fname, int *len, int *job, int *n, int *nnz, double *a, int *ja, int *ia, int *nrhs, double *rhs, int *ierr); extern void wreadmtc(int *nmax, int *nzmax, int *job, char *fname,int *len, double *a, int *ja, int *ia, double *rhs, int *nrhs, char *guesol, int *nrow, int *ncol, int *nnz, char *title, char *key, char *type, int *ierr) ; extern void nod2dom(int *n, int *ndom, int *nodes, int *pointer, int *map, int *mapsize, int *ier); extern void roscal(int *n, int *job, int *nrm, double *a, int *ja, int *ia, double *diag, double *b, int *jb, int *ib, int *ierr); extern void coscal(int *n, int *job, int *nrm, double *a, int *ja, int *ia, double *diag, double *b, int *jb, int *ib, int *ierr); extern void csrcsc(int *n, int *job, int *ipos, double *a, int *ja, int *ia, double *ao, int *jao, int *iao); extern void aplb(int *nrow, int *ncol, int *job, double *a, int *ja, int *ia, double *b, int *jb, int *ib, double *c, int *jc, int *ic, int *nnzmax, int *iw, int *ierr); extern void expnddom(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); /*-----------------------------------------------------------------------*/ freefem++-3.61-1/examples++-mpi/chaleur3D-hips.edp000644 000767 000024 00000000415 13256636774 021617 0ustar00hechtstaff000000 000000 // NBPROC 5 // bug with 4 proc very strange (Debug in progress) //ff-mpirun -np 4 chaleur3D-mumps.edp -glut ffglut -n 20 -op 1 -dt 0.01 -niter 10 load "hips_FreeFem" real ttgv=1e10; string ssparams="";//"nprow=1, npcol="+mpisize; verbosity=4; include "Heat3d.idp" freefem++-3.61-1/examples++-mpi/Heat3d.idp000644 000767 000024 00000006133 13256636774 020163 0ustar00hechtstaff000000 000000 load "msh3" load "medit" include "getARGV.idp" func f= 1. ; // right hand side function func g=0.; ; // boundary condition function func u0= 0; real dt=getARGV("-dt",0.01); int nn=getARGV("-n",10); int imax=getARGV("-niter",10); int op=getARGV("-op",1); int pplot=getARGV("-plot",0); mesh Th2D=square(nn,nn); int[int] refm=[1,1,2,1,3,1,4,1]; int[int] refu=[0,1]; mesh3 Th=buildlayers(Th2D,nn,zbound=[0.,1.],labelmid=refm,labelup=refu,labeldown=refu); // to slip integral on each processor // set a region number of a processor number real ccc = mpisize/real(Th.nt) ; if(op) Th=change(Th,fregion= min(mpisize-1,int(nuTriangle* ccc+1e-10))); else Th=change(Th,fregion=0); int reg= op ? mpirank : 0; // end of trick cout << " *** Th: vol " << Th.mesure << " " << int3d(Th,reg)(1.) << endl; fespace Vh(Th,P2) ; // P1 FE space Vh uh=u0 ; // unkown and test function. real temps=clock(); real time1,time2,time6; time1=clock(); // compute only on region number = processor number varf vlaplace(uh,vh) = // definition de problem int3d(Th,reg)( uh*vh+ dt*(dx(uh)*dx(vh) + dy(uh)*dy(vh)+ dz(uh)*dz(vh)) ) // bil. form + int3d(Th,reg)( dt*vh*f) + on(1,uh=g) ; varf vmasse(u,v) = int3d(Th,reg)(u*v); varf von1(uh,vh) = on(1,uh=1) ; matrix AA = vlaplace(Vh,Vh,tgv=ttgv) ; time1=clock()-time1; // reduce the matrice to get the full matrice // warning the tgv number is now mpisize*tgv for B.C. matrix A; time6=clock(); if(op) mpiAllReduce(AA,A,mpiCommWorld,mpiSUM); else A=AA; time6 = clock()-time6; time2=clock(); set(A,solver=sparsesolver,tgv=ttgv,sparams=ssparams) ; // factorize time2=clock()-time2; real time3=clock(); matrix M = vmasse(Vh,Vh); time3=clock()-time3; real [int] b(A.n),bb(A.n) ; real[int] bcl= vlaplace(0,Vh,tgv=ttgv) ; // The B.C vector real[int] Gamma = von1(0,Vh,tgv=1); // real time4=0,time5=0; for(int i=0 ;i1e10 && vi[nn-1] < 1e10); vi.resize(nn); Ii.resize(nn); for(int i=0;i> NN; assert( nn == NN) ; // II.resize(NN); processor(1-rank,comm) <>II; //cout << Ii << endl; real Ihioo=0; try { Ihioo= Ihi(Vh.ndof-1,Ii[nn-1]); } catch(...) {;}; int[int] I(0:Vh.ndof-1); Ihi = Ihi(I,Ii); assert(Ihi(Vh.ndof-1,nn-1) == Ihioo); // cout << rank << " Ihi = "<< Ihi << " ---- " << endl; dhi=1; vi=1; dhi += Ihi*vi; real[int] one(dhi);one=1.; dhi = one ./ dhi; cout << dhi << endl; } real[int] tosend(NN),torecv(nn); real tgv=1e3; macro Grad(u) [dx(u),dy(u)] // varf va(u,v)=int2d(Th)(u*v+Grad(u)'*Grad(v)) - int2d(Th)( x*v ) -int1d(Th,1)( N.x*v) ; ;//'); matrix A=va(Vh,Vh,tgv=tgv); real[int] b=va(0,Vh,tgv=tgv); int kiter=0; func real[int] projC(real[int] &u) { verbosity=0; processor(1-rank,comm) << (tosend = u(II)); processor(1-rank,comm) >> torecv; //cout << "to send " << tosend << endl; u += Ihi*torecv; // u = u .* dhi; Vh uu; uu[]=u; // cout << kiter++ << " " << mpirank << " --- " << uu(1,0.5) << endl; return u; } func real[int] projD(real[int] &u) { verbosity=0; processor(1-rank,comm) << (tosend = u(II)); processor(1-rank,comm) >> torecv; u += Ihi*torecv; u = u .* dhi; Vh uu; uu[]=u; // cout << kiter++ << " " << mpirank << " --- " << uu(1,0.5) << endl; return u; } func bool Plot(real[int] & uu) { Vh u; u[]=uu; Vhi ui; if(rank==0) { processor(1,comm) >> ui[]; plot(u,ui,wait=1); } else processor(0,comm) << u[]; return true; } func real[int] DJJ(real[int] &v) { verbosity=0; // Plot(v); v = projD(v); real[int] u=A*v; u += b; u = projC(u); verbosity=1; return u; // return }; func real[int] matId(real[int] &u) { verbosity=0; u =projD(u); verbosity=1; return u;}; Vh u=0; u=0; verbosity=1; MPIAffineCG(DJJ,u[],eps=1.e-4,nbiter=200,precon=matId,comm=comm); projD(u[]); Plot(u[]); if(rank==0) { fespace Vhh(Thh,P1); Vhh uuu,vvv; // u = x , dn(x) = N.x solve PPPP(uuu,vvv) = int2d(Thh)(uuu*vvv+Grad(uuu)'*Grad(vvv)) - int2d(Thh)( x*vvv ) -int1d(Thh,1)( N.x*vvv) ; //'); cout << " err = " << int2d(Th)( square(uuu-u)) << " " << int2d(Thh)( square(uuu-x)) << endl; // savemesh(Thh,"/tmp/Thh.msh"); } } } freefem++-3.61-1/examples++-mpi/Stokes-v2-matrix-superludist.edp000644 000767 000024 00000004653 13256636774 024534 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "msh3" load "medit" load "real_SuperLU_DIST_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int nn=10; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); //medit("c10x10x10",Th); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; Uh u1,u2,u3; Uh v1,v2,v3; Ph p,q; real timeI=clock(); real time1=clock(); //VVh [uu1,uu2,uu3,up]; varf vlaplace([u1,u2,u3],[v1,v2,v3]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) ) + on(2,u1=fup,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; //' varf vdiv([u1,u2,u3],[q])=int3d(Th,qforder=3)(- div(u1,u2,u3)*q ); varf vdivT([q],[u1,u2,u3])=int3d(Th,qforder=3)(- div(u1,u2,u3)*q ); varf vmass(p,q) = int3d(Th,qforder=3)( 1e-10*p*q ); matrix M=vmass(Ph,Ph); matrix L=vlaplace(UUh,UUh,tgv=ttgv); matrix B=vdiv(UUh,Ph); matrix BT=vdivT(Ph,UUh); matrix A = [ [ L, BT ], //' [ B, M ]]; time1=clock()-time1; real timeF=clock(); set(A,solver=sparsesolver,sparams=ssparams); timeF=clock()-timeF; real time2=clock(); real[int] b(VVh.ndof); real[int] xx(VVh.ndof); { real[int] b1 = vlaplace(0,UUh); for(int ii=0; ii> Ri[j]; } // EOM macro CheckUV(comm,jpart,Si,Ri) { int ipart=mpiRank(comm); int n= jpart.n; int[int] rn(n),sn(n),in(n); for (int j=0;j> rn[j]; for (int j=0;j> in[j]; int err=0; for (int j=0;j " << in[j] << " " << err << endl; } assert(err==0); }//EOM macro SendRecvUV(comm,jpart,Si,Ri) { int n= jpart.n; mpiRequest[int] rq(n); for (int j=0;j> Ri[j][];*/ for (int j=0;j #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "superlu_ddefs.h" #include "ffsuperludistoption.hpp" template struct SuperLUmpiDISTDriver { }; template <> struct SuperLUmpiDISTDriver { /* Driver routines */ static Dtype_t R_SLU_T() { return SLU_D;} static void pgssvx(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, SOLVEstruct_t *p9, double *p10, SuperLUStat_t *p11, int *p12) { pdgssvx( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12 ); } static void pgssvx_ABglobal(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, double *p9, SuperLUStat_t *p10, int *p11) { pdgssvx_ABglobal( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11); } static void Print_CompRowLoc_Matrix_dist(SuperMatrix *p1) { dPrint_CompRowLoc_Matrix_dist(p1); } static void Create_CompCol_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, Stype_t p8, Dtype_t p9, Mtype_t p10) { dCreate_CompCol_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); } static void Create_CompRowLoc_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, int_t p5, int_t p6, double *p7, int_t *p8, int_t *p9, Stype_t p10, Dtype_t p11, Mtype_t p12) { dCreate_CompRowLoc_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12); } static void CompRow_to_CompCol_dist(int_t p1, int_t p2, int_t p3, double *p4, int_t *p5, int_t *p6, double **p7, int_t **p8, int_t **p9) { dCompRow_to_CompCol_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9 ); } static void Create_Dense_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, double *p4, int_t p5, Stype_t p6, Dtype_t p7, Mtype_t p8) { dCreate_Dense_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8 ); } static void Create_SuperNode_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, int_t *p8, int_t *p9, int_t *p10, Stype_t p11, Dtype_t p12, Mtype_t p13) { dCreate_SuperNode_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10, p11,p12,p13); } }; template class SolveSuperLUmpi : public MatriceMorse::VirtualSolver, public SuperLUmpiDISTDriver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 //mutable char equed[1]; //yes_no_t equil; mutable SuperMatrix A; NCformat *Astore; //NCformat *Ustore; //SCformat *Lstore; mutable superlu_options_t options; mutable mem_usage_t mem_usage; mutable ScalePermstruct_t ScalePermstruct; mutable LUstruct_t LUstruct; mutable SOLVEstruct_t SOLVEstruct; mutable gridinfo_t grid; string string_option; string data_option; R *a; int *asub, *xa; int_t m, n, nnz; // rajout pour // int_t nprow,npcol; /* process rows and process columns*/ int matrixdist; // type of distributed matrix MPI_Comm commworld ; static const int assembled =0; static const int distributedglobal =1; static const int distributed =2; int iam; public: SolveSuperLUmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, string param_char, KN &pperm_r, KN &pperm_c,void * ccommworld=0) : eps(epsilon),epsr(0), tgv(ttgv),string_option(param_char),data_option(datafile), tol_pivot_sym(pivot_sym),tol_pivot(pivot) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; int rank; MPI_Comm_rank(commworld, &rank); R* B; //R* X; SuperLUStat_t stat; int info, ldb, nrhs=0; int i; double* berr; //int iam; // Add for distributed matrix int_t m_loc, m_loc_fst, fst_row, nnz_loc, fst_nnz; R *aloc; int *asubloc, *xaloc; // End Add for distributed matrix A.Store=0; int status; // time variables long int starttime,finishtime; long int timeused; // rajout debug int myid; if(verbosity) starttime = clock(); /* Defaults */ nrhs = 0; /* lecture de nprow and npcol */ // Cas max deux procs nprow = 1; npcol = 1; matrixdist=0; if(!data_option.empty()) read_nprow_npcol_matrixdist_superlu_datafile(&data_option, &nprow, &npcol, &matrixdist); if(!string_option.empty()) read_nprow_npcol_freefem( &string_option, &nprow, &npcol, &matrixdist); /* ------------------------------------------------------------ INITIALIZE THE SUPERLU PROCESS GRID. ------------------------------------------------------------*/ if( (verbosity>1) && (rank ==0)) cout << "Real superlu_gridinit" << " " << commworld << " " << ccommworld <= nprow * npcol ){ printf("this process is not used in superlu %d \n",iam); } else { /* set the default options */ set_default_options_dist(&options); DiagScale_t optionDiagScale; if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); if(!data_option.empty()) read_options_superlu_datafile(&data_option,&options,&nprow, &npcol, &matrixdist,&optionDiagScale); // matrix to procs and vectors if( matrixdist == assembled ){ if(!iam){ if(verbosity>5) { cout << "iam=" << iam << " " ; printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); } /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; assert( AA.lg[n] == nnz ); if(verbosity>5) printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* transform Row to Col */ // cela coute cher comme fonction // //dallocateA_dist(n, nnz, &a, &asub, &xa); //dCompRow_to_CompCol_dist(m,n,nnz,arow,asubrow,xarow,&a,&asub,&xa); dCompRow_to_CompCol_dist(m,n,nnz,AA.a,AA.cl,AA.lg,&a,&asub,&xa); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } else{ /* printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); if(verbosity>6) cout << "Debut: Create_CompCol_Matrix_dist" <" required by g++ 4.7 this->Create_CompCol_Matrix_dist(&A, m, n, nnz, a, asub, xa, SLU_NC, R_SLU, SLU_GE); if(verbosity>6) cout << "Fin: Create_CompCol_Matrix_dist" <2 && rank ==0) printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, nnz); /* Initialize ScalePermstruct and LUstruct. */ ScalePermstructInit(m, n, &ScalePermstruct); if( !(pperm_r==NULL) || !(pperm_c==NULL) ) ScalePermstruct.DiagScale=optionDiagScale; if( !(pperm_r==NULL) ) for(int ii=0; ii::pgssvx_ABglobal(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info); if(verbosity>2 && rank ==0) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } //########################################################## // // matrix distributed with matrix global given // //########################################################## else if( matrixdist == distributedglobal) { if(!iam){ if(verbosity>2) printf("\tProcess grid\t%d X %d iam=%d \n", grid.nprow, grid.npcol,iam); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; a=AA.a; asub=AA.cl; xa=AA.lg; xa[n] = nnz; if(verbosity>6) printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( AA.cl, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.lg, n+1, mpi_int_t, 0, grid.comm ); } else{ if(verbosity>6)printf("\tProcess grid\t%d X %d iam=%d \n", grid.nprow, grid.npcol,iam); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } /* Compute the number of rows to be distributed to local process */ m_loc = m / (grid.nprow * grid.npcol); m_loc_fst = m_loc; /* When m / procs is not an integer */ if ((m_loc * grid.nprow * grid.npcol) != m) { /*m_loc = m_loc+1; m_loc_fst = m_loc;*/ if (iam == (grid.nprow * grid.npcol - 1)) /* last proc. gets all*/ m_loc = m - m_loc * (grid.nprow * grid.npcol - 1); } fst_row = iam * m_loc_fst; nnz_loc = xa[fst_row+m_loc]-xa[fst_row]; xaloc = (int_t*) intMalloc_dist(m_loc+1); for(int ii=0; ii < m_loc; ii++){ xaloc[ii] = xa[fst_row+ii]-xa[fst_row]; } xaloc[m_loc]=nnz_loc; fst_nnz = xa[fst_row]; aloc = (double*) doubleMalloc_dist(nnz_loc); asubloc = (int_t*) intMalloc_dist(nnz_loc); for(int ii=0; ii < nnz_loc; ii++){ aloc[ii] = a[fst_nnz+ii]; asubloc[ii] = asub[fst_nnz+ii]; } if( iam ){ SUPERLU_FREE( a ); SUPERLU_FREE( asub ); SUPERLU_FREE( xa ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); if(verbosity>6) cout << "Debut: Create_CompRowCol_Matrix_dist" <6) cout << "Fin: Create_CompRowCol_Matrix_dist" <2 && rank ==0) printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, nnz); /* set the default options */ //set_default_options_dist(&options); //DiagScale_t optionDiagScale; //if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); m=A.nrow; n=A.ncol; //printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, nnz); /* Initialize ScalePermstruct and LUstruct. */ ScalePermstructInit(m, n, &ScalePermstruct); if(pperm_r || pperm_c ) ScalePermstruct.DiagScale=optionDiagScale; if(pperm_r) for(int ii=0; ii::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info); if(verbosity >1 && rank ==0) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity > 2 ) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } SUPERLU_FREE( B ); options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ nrhs=1; SUPERLU_FREE(berr); if(iam==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); if(verbosity>1) { printf("=====================================================\n"); cout << "SuperLU_DIST : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { R* B; SuperLUStat_t stat; //int iam; int info=0, ldb=m, nrhs=1; int i; double* berr; double ferr; double rpg, rcond; int_t m_loc,m_loc_fst,fst_row; // time variable long int starttime,finishtime; long int timeused; if( iam < nprow*npcol){ if(verbosity) starttime = clock(); if(n != m) exit(1); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); nrhs= 1; //iam = grid.iam; //if( iam < nprow*npcol){ /* Initialize the statistics variables. */ PStatInit(&stat); /* cas matrix assembled */ if( matrixdist == assembled ){ if( !(B = doubleMalloc_dist(m*nrhs)) ){ printf("probleme d allocation\n"); exit(1); } for(int ii=0; ii::pgssvx_ABglobal (&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info ); if(verbosity>3) printf("Triangular solve: dgssvx() returns info %d\n", info); if(verbosity) PStatPrint(&options, &stat, &grid); for(int ii=0; ii2) cout << " x min max " << x.min() << " " <::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info ); if(verbosity>3) printf("Triangular solve: dgssvx() returns info %d\n", info); if ( !(xtemp = doubleMalloc_dist(AA.n)) ){ printf("probleme d allocation de xtemp\n"); exit(1); } int disp[nprow*npcol]; MPI_Allgather(&fst_row, 1, MPI_INT, disp, 1, MPI_INT, grid.comm); int recv[nprow*npcol]; MPI_Allgather(&m_loc, 1, MPI_INT, recv, 1, MPI_INT, grid.comm); MPI_Allgatherv(B, m_loc, MPI_DOUBLE, xtemp, recv, disp, MPI_DOUBLE, grid.comm); for(int ii= 0; ii< AA.n ; ii++) x[ii] = xtemp[ii]; if(verbosity) cout << " x min max " << x.min() << " " <1) { printf("=====================================================\n"); cout << "SuperLu_DIST: time solve step :: " << timeused << " ms" <4) cout << "~SolveSuperLUmpi double:" << endl; if( matrixdist == assembled) { //if( A.Store) Destroy_CompCol_Matrix_dist(&A); //if( L.Store && U.Store ) { Destroy_LU(n, &grid, &LUstruct); ScalePermstructFree(&ScalePermstruct); LUstructFree(&LUstruct); //} if ( options.SolveInitialized ) { dSolveFinalize(&options, &SOLVEstruct); } } else if( matrixdist == distributedglobal) { Destroy_CompRowLoc_Matrix_dist(&A); Destroy_LU(n, &grid, &LUstruct); ScalePermstructFree(&ScalePermstruct); LUstructFree(&LUstruct); if ( options.SolveInitialized ) { dSolveFinalize(&options, &SOLVEstruct); } } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } } printf("Real superlu_gridexit(&grid), %d\n",iam); superlu_gridexit(&grid); } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverSuperLUmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverSuperLUmpi" << endl; return new SolveSuperLUmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.sparams, ds.perm_r, ds.perm_c, ds.commworld); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool SetSuperLUmpi() { if(verbosity) cout << " SetDefault sparse solver to SuperLUmpi double" << endl; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Real SuperLUdist, defaultsolver defaultsolverSuperLUdist" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("realdefaulttoSuperLUdist","(",new OneOperator0(SetSuperLUmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/LaplaceRT-3d-matrix-superludist.edp000644 000767 000024 00000016403 13256636774 025046 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 /* $ - \Delta p = f $ on $\Omega$, $ dp / dn = (g1d,g2d). n $ on $\Gamma_{1}$ $ p = gd $ on $\Gamma_{2}$ with de Mixte finite element formulation Find $p\in L^2(\Omega) $ and $u\in H(div) $ such than $$ u - Grad p = 0 $$ $$ - div u = f $$ $$ u. n = (g1d,g2d). n \mbox{ on } \Gamma_{2}$$ $$ p = gd \mbox{ on }\Gamma_{1}$$ the variationnel form is: $\forall v\in H(div)$; $v.n = 0$ on $\Gamma_{2} $: $ \int_\Omega u v + p div v -\int_{\Gamma_{1}} gd* v.n = 0 $ $\forall q\in L^2$: $ +\int_\Omega q div u = -\int_Omega f q $ and $ u.n = (g1n,g2n).n$ on $\Gamma_2$ */ load "medit" load "real_SuperLU_DIST_FreeFem" include "cube.idp" real ttgv = 1e30; string ssparams ="nprow=1, npcol="+mpisize; //int[int] Nxyz=[18,18,18]; int[int] Nxyz=[8,8,8]; real [int,int] Bxyz=[[0,1],[0,1],[0,1]]; int [int,int] Lxyz=[[1,1],[1,1],[2,1]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); fespace Vh(Th,P1); fespace Rh(Th,RT03d); fespace Nh(Th,Edge03d);// Nedelec Finite element. fespace Ph(Th,P0); func gd = 1.; func g1n = 2.; func g2n = 3.; func g3n = 4.; func f = 1.; Rh [u1,u2,u3],[v1,v2,v3]; Nh [e1,e2,e3]; [u1,u2,u3]=[1+100*x,2+100*y,3+100*z]; // a + b ^ x = /* b1 x a1 + b2*z - b3*y b2 ^ y = a2 - b1*z + b3*x b3 z a3 + b1*y - b2*x */ real b1=30,b2=10,b3=20; func ex1=100+b2*z-b3*y; func ex1x=0.; func ex1y=-b3+0; func ex1z=b2+0; func ex2=200.- b1*z + b3*x ; func ex2x= b3 +0; func ex2y= 0. ; func ex2z= -b1 +0; func ex3=300.+b1*y - b2*x ; func ex3x= -b2 +0; func ex3y= b1 +0; func ex3z= 0. ; [e1,e2,e3]=[ex1,ex2,ex3]; int k=Th(.1,.2,.3).nuTriangle ; cout << " u = " << u1(.1,.2,.3) << " " << u2(.1,.2,.3) << " " << u3(.1,.2,.3) << endl; cout << " dx u = " << dx(u1)(.1,.2,.3) << " " << dy(u2)(.1,.2,.3) << " " << dz(u3)(.1,.2,.3) << endl; cout << " e = " << e1(.1,.2,.3) << " " << e2(.1,.2,.3) << " " << e3(.1,.2,.3) << endl; cout << " ex = " << ex1(.1,.2,.3) << " " << ex2(.1,.2,.3) << " " << ex3(.1,.2,.3) << endl; cout << " dx,dy,dz e1x= " << ex1x(.1,.2,.3) << " " << ex1y(.1,.2,.3) << " " << ex1z(.1,.2,.3) << endl; cout << " dx,dy,dz e2x= " << ex2x(.1,.2,.3) << " " << ex2y(.1,.2,.3) << " " << ex2z(.1,.2,.3) << endl; cout << " dx,dy,dz e3x= " << ex3x(.1,.2,.3) << " " << ex3y(.1,.2,.3) << " " << ex3z(.1,.2,.3) << endl; cout << " dx,dy,dz e1 = " << dx(e1)(.1,.2,.3) << " " << dy(e1)(.1,.2,.3) << " " << dz(e1)(.1,.2,.3) << endl; cout << " dx,dy,dz e2 = " << dx(e2)(.1,.2,.3) << " " << dy(e2)(.1,.2,.3) << " " << dz(e2)(.1,.2,.3) << endl; cout << " dx,dy,dz e3 = " << dx(e3)(.1,.2,.3) << " " << dy(e3)(.1,.2,.3) << " " << dz(e3)(.1,.2,.3) << endl; cout << " k = " << k << endl; cout << Rh(k,0) << " " < using namespace std; #include "ff++.hpp" #include "CGNL.hpp" //#include "gmres.hpp" template int NLCG(const DJ & dJ,const P & C,KN_ &x,const int nbitermax, double &eps,long kprint,MPI_Comm * ) { // ------------- assert(&x && &dJ && &C); typedef KN Rn; int n=x.N(); R ro=1; Rn g(n),h(n),Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g=dJ*x;// dJ(x,g); Cg = C*g; // gradient preconditionne h =-Cg; R g2 = (Cg,g); if (g2 < 1e-30) { if(kprint>1) cout << "GCNL g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } if (kprint>5 ) cout << " 0 GCNL g^2 =" << g2 << endl; R reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { ro = argmin(ro,dJ,x,h,g,Ah); Cg = C*g; R g2p=g2; g2 = (Cg,g); if ( kprint < nbitermax ) cout << "CGNL:" < struct MPI_TYPE {}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_LONG;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_INT;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_DOUBLE;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_BYTE;}}; template R ReduceSum1(R s,MPI_Comm * comm) { R r=0; // nt MPI_Allreduce( void *sendbuf, void *recbuf, int count, // MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) MPI_Allreduce( &s, &r, 1 ,MPI_TYPE::TYPE(), MPI_SUM, *comm ); return r; } template int ConjuguedGradient2(const M & A,const P & C,KN_ &x,const KN_ &b,const int nbitermax, double &eps,long kprint,MPI_Comm * commworld) { // ConjuguedGradient2 affine A*x = 0 est toujours appele avec les condition aux limites // ------------- throwassert(&x && &A && &C); typedef KN Rn; int n=x.N(); // if (verbosity>99) kprint=1; R ro=1; Rn g(n),h(n),Ah(n), & Cg(Ah); // on utilise Ah pour stocke Cg g = A*x; g -= b; Cg = C*g; // gradient preconditionne h =-Cg; R g2 = ReduceSum1((Cg,g),commworld); if (g2 < 1e-30) { if(kprint<=nbitermax) cout << "GC g^2 =" << g2 << " < 1.e-30 Nothing to do " << endl; return 2; } if (kprint<5 ) cout << " 0 GC g^2 =" << g2 << endl; R reps2 =eps >0 ? eps*eps*g2 : -eps; // epsilon relatif eps = reps2; for (int iter=0;iter<=nbitermax;iter++) { R rop = ro; x += rop*h; // x+ rop*h , g=Ax (x old) // ((Ah = A*x - b) - g); // Ah -= b; // Ax + rop*Ah = rop*Ah + g = // Ah -= g; // Ah*rop Ah = A*x; Ah -= b; // Ax + rop*Ah = rop*Ah + g = Ah -= g; // Ah*rop R hAh =ReduceSum1((h,Ah),commworld); R gh = ReduceSum1((g,h),commworld); if (RNM::norm2(hAh)<1e-100) ExecError("CG2: Matrix is not defined (/0), sorry "); ro = -gh*rop/hAh ; // ro optimal (produit scalaire usuel) x += (ro-rop) *h; g += (ro/rop) *Ah; // plus besoin de Ah, on utilise avec Cg optimisation Cg = C*g; R g2p=g2; g2 = ReduceSum1((Cg,g),commworld); if ( ( (iter%kprint) == kprint-1) ) cout << "CG:" <4) cout << "GMRES: restart" << j << " " << beta << " " << normb << " " << beta / normb << " < " << tol << endl; if ((resid = beta / normb) < tol) { tol = resid; max_iter = j; delete [] v; return 0; } } if(verbosity) cout << "WARNING: GMRES do not converges: " << j <<"/" << max_iter << ", resid = " << resid << ", tol= " << tol << ", normb "<< normb << endl; tol = resid; delete [] v; return 1; } template class MPILinearCG : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; const int cas,CG; class MatF_O: VirtualMatrice { public: Stack stack; mutable Kn x; C_F0 c_x; Kn *b; Expression mat1,mat; typedef typename VirtualMatrice::plusAx plusAx; MatF_O(int n,Stack stk,const OneOperator * op,Kn *bb=0) : VirtualMatrice(n),stack(stk), x(n),c_x(CPValue(x)),b(bb), mat1(op->code(basicAC_F0_wa(c_x))), mat( CastTo(C_F0(mat1,(aType)*op))) { //ffassert(atype() ==(aType) *op); // WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 } ~MatF_O() { // cout << " del MatF_O mat " << endl; if(mat1 != mat) delete mat; delete mat1; // cout << " del MatF_Ocx ..." << endl; Expression zzz = c_x; // cout << " zzz "<< zzz << endl; delete zzz; // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 } void addMatMul(const Kn_ & xx, Kn_ & Ax) const { ffassert(xx.N()==Ax.N()); x =xx; Ax += GetAny((*mat)(stack)); if(b && &Ax!=b) Ax += *b; // Ax -b => add b (not in cas of init. b c.a.d &Ax == b WhereStackOfPtr2Free(stack)->clean(); } plusAx operator*(const Kn & x) const {return plusAx(this,x);} virtual bool ChecknbLine(int n) const { return true;} virtual bool ChecknbColumn(int m) const { return true;} }; class E_LCG: public E_F0mps { public: const int cas;// <0 => Nolinear const int CG; static const int n_name_param=7; static basicAC_F0::name_and_type name_param[] ; Expression nargs[n_name_param]; const OneOperator *A, *C; Expression X,B; E_LCG(const basicAC_F0 & args,int cc,int gc) :cas(cc),CG(gc) { args.SetNameParam(n_name_param,name_param,nargs); { const Polymorphic * op= dynamic_cast(args[0].LeftValue()); ffassert(op); A = op->Find("(",ArrayOfaType(atype(),false)); } if (nargs[2]) { const Polymorphic * op= dynamic_cast(nargs[2]); ffassert(op); C = op->Find("(",ArrayOfaType(atype(),false)); } else C =0; X = to(args[1]); if (args.size()>2) B = to(args[2]); else B=0; } virtual AnyType operator()(Stack stack) const { int ret=-1; // WhereStackOfPtr2Free(stack)=new StackOfPtr2Free(stack);// FH mars 2005 try { Kn &x = *GetAny((*X)(stack)); int n=x.N(); double eps = 1.0e-6; int nbitermax= 100; long verb = verbosity; pcommworld vcommworld=0; long dKrylov=50; if (nargs[0]) eps= GetAny((*nargs[0])(stack)); if (nargs[1]) nbitermax = GetAny((*nargs[1])(stack)); if (nargs[3]) eps= *GetAny((*nargs[3])(stack)); if (nargs[4]) vcommworld = GetAny((*nargs[4])(stack)); if (nargs[5]) dKrylov= GetAny((*nargs[5])(stack)); if (nargs[6]) verb=Abs(GetAny((*nargs[6])(stack))); long gcverb=51L-Min(Abs(verb),50L); if(verb==0) gcverb = 1000000000;// no print MPI_Comm mpiCommWorld = MPI_COMM_WORLD; MPI_Comm * commworld= vcommworld ? (MPI_Comm *) vcommworld: & mpiCommWorld ; KN bzero(B?1:n); // const array zero bzero=R(); KN *bb=&bzero; if (B) { Kn &b = *GetAny((*B)(stack)); R p = (b,b); if (p) { // ExecError("Sorry MPILinearCG work only with nul right hand side, so put the right hand in the function"); } bb = &b; } KN * bbgmres =0; if ( !B && !CG) bbgmres=bb; // none zero if gmres without B MatF_O AA(n,stack,A,bbgmres); if(bbgmres ){ AA.addMatMul(*bbgmres,*bbgmres); // *bbgmres= AA* *bbgmres; // Ok Ax == b -> not translation of b . *bbgmres = - *bbgmres; if(verbosity>1) cout << " ** GMRES set b = -A(0); : max=" << bbgmres->max() << " " << bbgmres->min()<(n),x,nbitermax,eps, gcverb ,commworld); } else if (C) { MatF_O CC(n,stack,C); ret = ConjuguedGradient2(AA,CC,x,*bb,nbitermax,eps, gcverb ,commworld);} else ret = ConjuguedGradient2(AA,MatriceIdentite(n),x,*bb,nbitermax,eps, gcverb ,commworld); } else {// GMRES KNM H(dKrylov+1,dKrylov+1); int k=dKrylov;//,nn=n; if (cas<0) { ErrorExec("NL GMRES: to do! sorry ",1); /* if (C) { MatF_O CC(n,stack,C); ret = NLGMRES(AA,CC,x,nbitermax,eps, 51L-Min(Abs(verbosity),50L) );} else ret = NLGMRES(AA,MatriceIdentite(n),x,nbitermax,eps, 51L-Min(Abs(verbosity),50L)); ConjuguedGradient */ } else { if (C) { MatF_O CC(n,stack,C); ret=GMRES_MPI(AA,(KN &)x, *bb,CC,H,k,nbitermax,eps,commworld,verb);} else ret=GMRES_MPI(AA,(KN &)x, *bb,MatriceIdentite(n),H,k,nbitermax,eps,commworld,verb); } } if( nargs[3]) *GetAny((*nargs[3])(stack)) = -(eps); } catch(...) { // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 throw; } // WhereStackOfPtr2Free(stack)->clean(); // FH mars 2005 return SetAny(ret); } operator aType () const { return atype();} }; E_F0 * code(const basicAC_F0 & args) const { return new E_LCG(args,cas,CG);} MPILinearCG() : OneOperator(atype(), atype(), atype *>(),atype *>()),cas(2),CG(1){} MPILinearCG(int cc,int CGG) : OneOperator(atype(), atype(), atype *>(),atype *>()),cas(cc),CG(CGG){} MPILinearCG(int cc,int CGG,int ) : OneOperator(atype(), atype(), atype *>()),cas(cc),CG(CGG){} MPILinearCG(int cc) : OneOperator(atype(), atype(), atype *>()),cas(cc),CG(1){} }; template basicAC_F0::name_and_type MPILinearCG::E_LCG::name_param[]= { { "eps", &typeid(double) }, { "nbiter",&typeid(long) }, { "precon",&typeid(Polymorphic*)}, { "veps" , &typeid(double*) }, { "comm", &typeid(pcommworld)} , { "dimKrylov", &typeid(long) }, { "verbosity", &typeid(long) } }; /* --FH: class Init { public: Init(); }; LOADINIT(Init); */ static void Load_Init() { Global.Add("MPILinearCG","(",new MPILinearCG()); // old form with rhs (must be zer Global.Add("MPIAffineCG","(",new MPILinearCG(1)); // without right handsize Global.Add("MPILinearGMRES","(",new MPILinearCG(0,0)); // with right handsize Global.Add("MPIAffineGMRES","(",new MPILinearCG(0,0,0)); // with right handsize Global.Add("MPINLCG","(",new MPILinearCG(-1)); // without right handsize } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/schwarz-2d.edp000644 000767 000024 00000003135 13256636774 021032 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 if ( mpisize != 2 ) { cout << " sorry number of processeur !=2 " << endl; exit(1);} verbosity=1; real pi=4*atan(1); int inside = 2; int outside = 1; border a(t=1,2){x=t;y=0;label=outside;}; border b(t=0,1){x=2;y=t;label=outside;}; border c(t=2,0){x=t ;y=1;label=outside;}; border d(t=1,0){x = 1-t; y = t;label=inside;}; border e(t=0, pi/2){ x= cos(t); y = sin(t);label=inside;}; border e1(t=pi/2, 2*pi){ x= cos(t); y = sin(t);label=outside;}; int n=40; mesh th,TH; if (mpirank == 0) { th = buildmesh( a(5*n) + b(5*n) + c(10*n) + d(5*n)); cout << " end th " << endl; // processor(1) << th ; // processor(1) >> TH; } else { TH = buildmesh ( e(5*n) + e1(25*n) ); cout << " end TH " << endl; // processor(0) << TH ; // processor(0) >> th; } broadcast(processor(0),th); broadcast(processor(1),TH); fespace vh(th,P1); fespace VH(TH,P1); vh u=0,v; VH U,V; int i=0; problem PB(U,V,init=i,solver=Cholesky) = int2d(TH)( dx(U)*dx(V)+dy(U)*dy(V) ) + int2d(TH)( -V) + on(inside,U = u) + on(outside,U= 0 ) ; problem pb(u,v,init=i,solver=Cholesky) = int2d(th)( dx(u)*dx(v)+dy(u)*dy(v) ) + int2d(th)( -v) + on(inside ,u = U) + on(outside,u = 0 ) ; for ( i=0 ;i< 10; i++) { cout << mpirank << " looP " << i << endl; if (mpirank == 0) { PB; processor(1) << U[]; processor(1) >> u[]; } else { pb; processor(0) >> U[]; processor(0) << u[]; } // if (mpirank==0) // plot(U,u,wait=true,ps="Uu"+i+".eps"); }; mpiBarrier(mpiCommWorld);// missing FH. Jan/2016 if (mpirank==0) plot(U,u,ps="Uu.eps"); freefem++-3.61-1/examples++-mpi/Stokes-v1-matrix-superludist.edp000644 000767 000024 00000003451 13256636774 024526 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "real_SuperLU_DIST_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int nn=8; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; VVh [u1,u2,u3,p]; VVh [v1,v2,v3,q]; real timeI=clock(); real time1=clock(); varf vStokes([u1,u2,u3,p],[v1,v2,v3,q]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) //' for emacs - div(u1,u2,u3)*q - div(v1,v2,v3)*p + 1e-10*q*p ) + on(2,u1=fup,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; matrix MStokes=vStokes(VVh,VVh,tgv=ttgv); time1=clock()-time1; real timeF=clock(); set(MStokes,solver=sparsesolver,tgv=ttgv,sparams=ssparams); timeF=clock()-timeF; real time2=clock(); real[int] b=vStokes(0,VVh); time2=clock()-time2; real time3=clock(); u1[] = MStokes^-1*b; time3=clock()-time3; timeI=clock()-timeI; cout << "============= CPU TIME ============" << endl; cout << " matrix " << time1 << endl; cout << " Fact " << timeF << endl; cout << " second member " << time2 << endl; cout << " solve " << time3 << endl; cout << " ------------" << endl; cout << " all " << timeI << endl; cout << "============= CPU TIME ============" << endl; //if(mpirank==0)medit("UV2 PV2",Th,[u1,u2,u3],p); freefem++-3.61-1/examples++-mpi/chaleur3D-superludist.edp000644 000767 000024 00000000342 13256636774 023236 0ustar00hechtstaff000000 000000 // other // NBPROC 2 // ff-mpirun -np 4 chaleur3D-superludist.edp -glut ffglut -n 20 -op 1 -dt 0.01 -niter 10 load "real_SuperLU_DIST_FreeFem" real ttgv=-1; string ssparams="nprow=1, npcol="+mpisize; include "Heat3d.idp"freefem++-3.61-1/examples++-mpi/LaplaceRT-3d-matrix-pastix.edp000644 000767 000024 00000015615 13256636774 023777 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 /* $ - \Delta p = f $ on $\Omega$, $ dp / dn = (g1d,g2d). n $ on $\Gamma_{1}$ $ p = gd $ on $\Gamma_{2}$ with de Mixte finite element formulation Find $p\in L^2(\Omega) $ and $u\in H(div) $ such than $$ u - Grad p = 0 $$ $$ - div u = f $$ $$ u. n = (g1d,g2d). n \mbox{ on } \Gamma_{2}$$ $$ p = gd \mbox{ on }\Gamma_{1}$$ the variationnel form is: $\forall v\in H(div)$; $v.n = 0$ on $\Gamma_{2} $: $ \int_\Omega u v + p div v -\int_{\Gamma_{1}} gd* v.n = 0 $ $\forall q\in L^2$: $ +\int_\Omega q div u = -\int_Omega f q $ and $ u.n = (g1n,g2n).n$ on $\Gamma_2$ */ load "medit" load "real_pastix_FreeFem" include "cube.idp" real ttgv = 1e10; string ssparams ="nprow=1, npcol="+mpisize; int[int] Nxyz=[12,12,12]; real [int,int] Bxyz=[[0,1],[0,1],[0,1]]; int [int,int] Lxyz=[[1,1],[1,1],[2,1]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); fespace Vh(Th,P1); fespace Rh(Th,RT03d); fespace Nh(Th,Edge03d);// Nedelec Finite element. fespace Ph(Th,P0); func gd = 1.; func g1n = 2.; func g2n = 3.; func g3n = 4.; func f = 1.; Rh [u1,u2,u3],[v1,v2,v3]; Nh [e1,e2,e3]; [u1,u2,u3]=[1+100*x,2+100*y,3+100*z]; // a + b ^ x = /* b1 x a1 + b2*z - b3*y b2 ^ y = a2 - b1*z + b3*x b3 z a3 + b1*y - b2*x */ real b1=30,b2=10,b3=20; func ex1=100+b2*z-b3*y; func ex1x=0.; func ex1y=-b3+0; func ex1z=b2+0; func ex2=200.- b1*z + b3*x ; func ex2x= b3 +0; func ex2y= 0. ; func ex2z= -b1 +0; func ex3=300.+b1*y - b2*x ; func ex3x= -b2 +0; func ex3y= b1 +0; func ex3z= 0. ; [e1,e2,e3]=[ex1,ex2,ex3]; int k=Th(.1,.2,.3).nuTriangle ; cout << " u = " << u1(.1,.2,.3) << " " << u2(.1,.2,.3) << " " << u3(.1,.2,.3) << endl; cout << " dx u = " << dx(u1)(.1,.2,.3) << " " << dy(u2)(.1,.2,.3) << " " << dz(u3)(.1,.2,.3) << endl; cout << " e = " << e1(.1,.2,.3) << " " << e2(.1,.2,.3) << " " << e3(.1,.2,.3) << endl; cout << " ex = " << ex1(.1,.2,.3) << " " << ex2(.1,.2,.3) << " " << ex3(.1,.2,.3) << endl; cout << " dx,dy,dz e1x= " << ex1x(.1,.2,.3) << " " << ex1y(.1,.2,.3) << " " << ex1z(.1,.2,.3) << endl; cout << " dx,dy,dz e2x= " << ex2x(.1,.2,.3) << " " << ex2y(.1,.2,.3) << " " << ex2z(.1,.2,.3) << endl; cout << " dx,dy,dz e3x= " << ex3x(.1,.2,.3) << " " << ex3y(.1,.2,.3) << " " << ex3z(.1,.2,.3) << endl; cout << " dx,dy,dz e1 = " << dx(e1)(.1,.2,.3) << " " << dy(e1)(.1,.2,.3) << " " << dz(e1)(.1,.2,.3) << endl; cout << " dx,dy,dz e2 = " << dx(e2)(.1,.2,.3) << " " << dy(e2)(.1,.2,.3) << " " << dz(e2)(.1,.2,.3) << endl; cout << " dx,dy,dz e3 = " << dx(e3)(.1,.2,.3) << " " << dy(e3)(.1,.2,.3) << " " << dz(e3)(.1,.2,.3) << endl; cout << " k = " << k << endl; cout << Rh(k,0) << " " < // /* 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 */ #include #include #include #include struct step { public: step(int x, int y) : x(x), y(y) { } int operator()() { return x += y; } private: int x, y; }; template static void CSR2COO(unsigned int n, int* compressedI, int* uncompressedI) { if(S == 'U') { for(int i = n - 1; i > -1; --i) { if(M == 'F') std::fill(uncompressedI + compressedI[i] - 1, uncompressedI + compressedI[i + 1] - 1, i + 1); else std::fill(uncompressedI + compressedI[i], uncompressedI + compressedI[i + 1], i + 1); } } else if(S == 'L') { for(int i = 1; i < n; ++i) { if(M == 'F') std::fill(uncompressedI + compressedI[i] - i - 1, uncompressedI + compressedI[i + 1] - i - 1, i + 1); else std::fill(uncompressedI + compressedI[i] - i, uncompressedI + compressedI[i + 1] - i - 1, i + 1); } } }; template static unsigned int trimCSR(unsigned int n, int* trimmedI, int* untrimmedI, int* trimmedJ, int* untrimmedJ, Scalar* trimmedC, Scalar* untrimmedC) { unsigned int upper = 0; for(unsigned int i = 0; i < n - WithDiagonal; ++i) { trimmedI[i] = upper + (N == 'F'); int* jIndex = lower_bound(untrimmedJ + untrimmedI[i], untrimmedJ + untrimmedI[i + 1], i + !WithDiagonal); unsigned int j = untrimmedI[i] + jIndex - (untrimmedJ + untrimmedI[i]); if(N == 'F') { for(unsigned int k = j; k < untrimmedI[i + 1]; ++k) trimmedJ[upper + k - j] = untrimmedJ[k] + 1; } else std::copy(untrimmedJ + j, untrimmedJ + untrimmedI[i + 1], trimmedJ + upper); std::copy(untrimmedC + j, untrimmedC + untrimmedI[i + 1], trimmedC + upper); upper += untrimmedI[i + 1] - j; } if(WithDiagonal) { trimmedI[n - 1] = upper + (N == 'F'); trimmedI[n] = trimmedI[n - 1] + 1; trimmedJ[upper] = n - (N == 'C'); trimmedC[upper] = untrimmedC[untrimmedI[n] - 1]; return trimmedI[n]; } else { trimmedI[n] = trimmedI[n - 1]; return trimmedI[n + 1]; } }; freefem++-3.61-1/examples++-mpi/mortar-msh.idp000644 000767 000024 00000002341 13256636774 021141 0ustar00hechtstaff000000 000000 // --- begin meshes building -------------- real[int] theta(nbsd+1),cost(nbsd),sint(nbsd); for (int i=0;ifreefem++.pref echo 'includepath = "../examples++-3d/"' >>freefem++.pref echo 'includepath += "../examples++-tutorial/"' >>freefem++.pref # echo loadpath += \"./\" >>freefem++.pref # force the build for freefem++.pref FH.. DDM-Schwarz-Lame-2d.edp:freefem++.pref # FFCS - cleaning is useful sometimes clean-local:: -rm $(LIST_COMPILE) -rm *.$(OBJEXT) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/examples++-mpi/testsolver_pastix.edp000644 000767 000024 00000013442 13256636774 022652 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "real_pastix_FreeFem" load "complex_pastix_FreeFem" verbosity=1; //################################# //# real arithmetic //################################# // reading parameter of pastix from data file { matrix A = [[ 100, 1, 0, 10], [ 1, 100, 2, 0 ], [ 0, 2, 100, 3 ], [ 10, 0, 3, 100 ]]; real[int] xx = [ 1,2,3,4], x(4), b(4), di(4); // xb(4),bbb(4); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; if(mpirank==0) cout << "A="<< A << endl; set(A,solver=sparsesolver,datafilename="ffpastix_iparm_dparm.txt"); cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } if(mpirank==1){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } if(mpirank==0) cout << "A="<< A << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; } // definition of pastix parameter iparm and dparm in this file // These parameters must be given to lparams and dparams respectively { matrix A = [[ 1e16, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1e16, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; int[int] iparm(64); real[int] dparm(64); if(mpirank == 0){ // read iparm and dparm from data file with processor 0 ifstream datapastix("ffpastix_iparm_dparm.txt"); string line; getline(datapastix,line); cout << " line= "<< line << endl; getline(datapastix,line); cout << " line= "<< line << endl; getline(datapastix,line); cout << " line= "<< line << endl; for(int iii=0; iii<64;iii++){ datapastix >> iparm[iii]; // read iii+2 lines of the file ffpastix_iparm_dparm.txt getline(datapastix,line); } getline(datapastix,line); cout << " line= "<< line << endl; for(int iii=0; iii<64;iii++){ datapastix >> dparm[iii]; // read iii+66 lines of the file ffpastix_iparm_dparm.txt getline(datapastix,line); } } broadcast(processor(0),iparm); // broadcast iparm to the other processor broadcast(processor(0),dparm); // broadcast dparm to the other processor if(mpirank ==0){ cout << "iparm=" << iparm << endl; cout << "dparm =" << dparm << endl; } set(A,solver=sparsesolver,lparams=iparm,dparams=dparm); // set to pastix solver the parameter iparm and dparm if(mpirank) cout << "solving solution" << endl; x = A^-1*b; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } if(mpirank==1){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } } //################################# //# complex arithmetic //################################# // read parameter for pastix from data file { // Resolution with complex pastix int N=40; complex[int,int] AA(N,N); AA=0.+0i; for(int ii=1;ii A; A = AA; complex[int] xx(N), x(N), b(N),b1(N), di(N); for(int j=0;j A1; A1 = AB; complex[int] xx(N), x(N), b(N),b1(N), di(N); for(int j=0;j IGNORE index : IPARM_MC64 (IN) 0 # Refinement only index : IPARM_ONLY_RAFF (IN) 0 # Indicate if the cscd has been redistributed after blend index : IPARM_CSCD_CORRECT (IN) 0 # Number of iterations performed in refinement index : IPARM_NBITER (OUT) 0 # Trace format (see Trace modes) index : IPARM_TRACEFMT (IN) 1 # Specify if the given graph is distributed or not index : IPARM_GRAPHDIST (IN) 5 # Amalgamation level index : IPARM_AMALGAMATION_LEVEL (IN) 0 # Choose ordering index : IPARM_ORDERING (IN) 1 # Use default ordering parameters with scotch or metis index : IPARM_DEFAULT_ORDERING (IN) 120 # Ordering switch level (see Scotch User's Guide) index : IPARM_ORDERING_SWITCH_LEVEL (IN) 0 # Ordering cmin parameter (see Scotch User's Guide) index : IPARM_ORDERING_CMIN (IN) 100000 # Ordering cmax parameter (see Scotch User's Guide) index : IPARM_ORDERING_CMAX (IN) 8 # Ordering frat parameter (see Scotch User's Guide) index : IPARM_ORDERING_FRAT (IN) 0 # Static pivoting index : IPARM_STATIC_PIVOTING (OUT) 0 # Metis pfactor index : IPARM_METIS_PFACTOR (IN) 0 # Number of Non Zeros in initial matrix index : IPARM_NNZEROS (OUT) 0 # Number of Non Zeros in the factorized matrix index : IPARM_ALLOCATED_TERMS (OUT) 0 # Baseval used for the matrix index : IPARM_BASEVAL (IN) 60 # Minimum blocksize index : IPARM_MIN_BLOCKSIZE (OUT) 120 # Maximum blocksize index : IPARM_MAX_BLOCKSIZE (OUT) 0 # unused index : 27 0 # unused index : 28 0 # unused index : 29 1 # Factorization mode (see Factorization modes) index : IPARM_FACTORIZATION (IN) 0 # unused index : 31 0 # Number of CPU per SMP node index : IPARM_CPU_BY_NODE (IN) 1 # Thread binding mode (see Thread binding modes) index : IPARM_BINDTHRD (IN) 1 # Number of thread per MPI process index : IPARM_THREAD_NBR (IN) 0 # Distribution level IGNORE index : IPARM_DISTRIBUTION_LEVEL (IN) 1 # Level of fill for incomplete factorization index : IPARM_LEVEL_OF_FILL (IN) 0 # IO strategy (see Check-points modes) index : IPARM_IO_STRATEGY (IN) 1 # Right-hand-side making (see Rhight-hand-side modes) index : IPARM_RHS_MAKING (IN) 0 # Refinement type (see Refinement modes) index : IPARM_REFINEMENT (IN) 0 # Symmetric matrix mode (see Symmetric modes) index : IPARM_SYM (IN) 0 # Incomplete factorization index : IPARM_INCOMPLETE (IN) 0 # ABS (Automatic Blocksize Splitting) index : IPARM_ABS (IN) 0 # ESP (Enhanced Sparse Parallelism) index : IPARM_ESP (IN) 25 # GMRES restart parameter index : IPARM_GMRES_IM (IN) 0 # Free user CSC index : IPARM_FREE_CSCUSER (IN) 0 # Free internal CSC (Use only without call to Refin. step) index : IPARM_FREE_CSCPASTIX (IN) 2000 # Out of core memory limit (Mo) index : IPARM_OOC_LIMIT (IN) 1 # Out of core thread number IGNORE index : IPARM_OOC_THREAD (IN) 0 # Out of core run ID IGNORE index : IPARM_OOC_ID (OUT) 0 # Number of SMP node used IGNORE index : IPARM_NB_SMP_NODE_USED (IN) 0 # Threaded communication mode (see Communication modes) index : IPARM_THREAD_COMM_MODE (IN) 1 # Number of thread(s) for communication index : IPARM_NB_THREAD_COMM (IN) 0 # Initialize matrix coefficients (for test only) IGNORE index : IPARM_FILL_MATRIX (IN) 0 # Return the inertia (symmetric matrix without pivoting) index : IPARM_INERTIA (OUT) 0 # Return the NUMBER OF TASKS GENERATED BY ESP index : IPARM_ESP_NBTASKS (OUT) 0 # unused index : 56 0 # unused index : 57 0 # unused index : 58 0 # unused index : 59 0 # unused index : 60 0 # unused index : 61 0 # unused index : 62 0 # Return value index : IPARM_ERROR_NUMBER (OUT) dparm 0 # unused index : 0 0 # unused index : 1 0 # unused index : 2 0 # unused index : 3 0 # unused index : 4 1e-12 # Epsilon for refinement index : 5 (IN) 0 # Relative backward error index : 6 (OUT) 0 # unused index : 7 0 # unused index : 8 0 # unused index : 9 1e-31 # Epsilon for magnitude control index : 10 (IN) 0 # unused index : 11 0 # unused index : 12 0 # unused index : 13 0 # unused index : 14 0 # unused index : 15 0 # unused index : 16 0 # unused index : 17 0 # Analize time index : 18 (OUT) 0 # Predicted factorization time index : 19 (OUT) 0 # Factorization time index : 20 (OUT) 0 # Solving time index : 21 (OUT) 0 # Factorization flops index : 22 (OUT) 0 # Solving flops index : 23 (OUT) 0 # Refinement time index : 24 (OUT) 0 # unused index : 25 0 # unused index : 26 0 # unused index : 27 0 # unused index : 28 0 # unused index : 29 0 # unused index : 30 0 # unused index : 31 0 # unused index : 32 0 # unused index : 33 0 # unused index : 34 0 # unused index : 35 0 # unused index : 36 0 # unused index : 37 0 # unused index : 38 0 # unused index : 39 0 # unused index : 40 0 # unused index : 41 0 # unused index : 42 0 # unused index : 43 0 # unused index : 44 0 # unused index : 45 0 # unused index : 46 0 # unused index : 47 0 # unused index : 48 0 # unused index : 49 0 # unused index : 50 0 # unused index : 51 0 # unused index : 52 0 # unused index : 53 0 # unused index : 54 0 # unused index : 55 0 # unused index : 56 0 # unused index : 57 0 # unused index : 58 0 # unused index : 59 0 # unused index : 60 0 # unused index : 61 0 # unused index : 62 0 # unused index : 63 freefem++-3.61-1/examples++-mpi/regtests.sh000755 000767 000024 00000000750 13256636774 020553 0ustar00hechtstaff000000 000000 #!/bin/sh # Testing procedure for MPI version of FreeFem++ # $Id$ NPROCS=2 REGEDP=essai.edp ../regtests.sh if test $? != 0 then exit 1 fi NPROCS=2 REGEDP=schwarz.edp ../regtests.sh if test $? != 0 then exit 1 fi NPROCS=2 REGEDP=schwarz-b.edp ../regtests.sh if test $? != 0 then exit 1 fi NPROCS=2 REGEDP=schwarz-c.edp ../regtests.sh if test $? != 0 then exit 1 fi NPROCS=4 REGEDP=mortar-DN-4-mpi.edp ../regtests.sh if test $? != 0 then exit 1 fi freefem++-3.61-1/examples++-mpi/Stokes-v1-matrix-pastix.edp000644 000767 000024 00000003450 13256636774 023452 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "real_pastix_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int nn=10; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; VVh [u1,u2,u3,p]; VVh [v1,v2,v3,q]; real timeI=clock(); real time1=clock(); varf vStokes([u1,u2,u3,p],[v1,v2,v3,q]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) //' for emacs - div(u1,u2,u3)*q - div(v1,v2,v3)*p + 1e-10*q*p ) + on(2,u1=fup,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; matrix MStokes=vStokes(VVh,VVh,tgv=ttgv); time1=clock()-time1; real timeF=clock(); set(MStokes,solver=sparsesolver,tgv=ttgv,sparams=ssparams); timeF=clock()-timeF; real time2=clock(); real[int] b=vStokes(0,VVh); time2=clock()-time2; real time3=clock(); u1[] = MStokes^-1*b; time3=clock()-time3; timeI=clock()-timeI; cout << "============= CPU TIME ============" << endl; cout << " matrix " << time1 << endl; cout << " Fact " << timeF << endl; cout << " second member " << time2 << endl; cout << " solve " << time3 << endl; cout << " ------------" << endl; cout << " all " << timeI << endl; cout << "============= CPU TIME ============" << endl; //if(mpirank==0) medit("UV2 PV2",Th,[u1,u2,u3],p); freefem++-3.61-1/examples++-mpi/DDM-Schwarz-Lame-3d.edp000644 000767 000024 00000010303 13256636774 022244 0ustar00hechtstaff000000 000000 // NBPROC 10 // ff-mpirun -np 4 DDM-Schwarz-Lap-3d.edp -glut ffglut -n 11 -k 1 -d 1 -ns -gmres 1 /* a first true parallele example fisrt freefem++ Ok up to 200 proc for a Poisson equation.. See the Doc for full explaiantion F Hecht Dec. 2010. ------------------- usage : ff-mpirun [mpi parameter] MPIGMRES2d.edp [-glut ffglut] [-n N] [-k K] [-d D] [-ns] [-gmres [0|1] argument: -glut ffglut : to see graphicaly the process -n N: set the mesh cube split NxNxN -d D: set debug flag D must be one for mpiplot -k K: to refined by K all elemnt -ns: reomove script dump -gmres 0 : use iterative schwarz algo. 1 : Algo GMRES on residu of schwarz algo. 2 : DDM GMRES 3 : DDM GMRES with coarse grid preconditionner (Good one) */ load "MPICG" load "medit" load "metis" include "getARGV.idp" include "DDM-Schwarz-macro.idp" //include "AddLayer3d.idp" include "DDM-funcs-v2.idp" include "cube.idp" searchMethod=0; // more safe seach algo (warning can be very expensive in case lot of ouside point) // 0 by default assert(version >=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",1); int nloc = getARGV("-n",5); string sff=getARGV("-p",""); int gmres=getARGV("-gmres",3); int nC = getARGV("-N" ,max(nloc/10,5)); int sizeoverlaps=1; // size of overlap bool RAS=1; if(mpirank==0 && verbosity) cout << " vdebug: " << vdebug << " kspilt "<< ksplit << " nloc "<< nloc << " sff "<< sff <<"."<< endl; string sPk="P2-Lame-3gd"; func Pk=[P2,P2,P2]; func bool plotMPIall(mesh3 &Th,real[int] & u,string cm) {if(vdebug) PLOTMPIALLU(mesh3,Pk, defPk3, Th, u, allu2, { cmm=cm,nbiso=20,fill=1,dim=3,value=1}); return 1;} mpiComm comm(mpiCommWorld,0,0);// trick : make a no split mpiWorld int ipart= mpiRank(comm); // current partition number if(ipart==0) cout << " Final N=" << ksplit*nloc << " nloc =" << nloc << " split =" << ksplit << endl; int[int] l111=[1,1,1,1]; settt int[int,int] LL=[[1,1],[2,1],[1,1]]; real[int,int] BB=[[0,1],[0,5],[0,1]]; int[int] NN=[nloc,nloc*5,nloc]; int[int] NNC=[nC,nC*5,nC]; settt mesh3 Thg=Cube(NN,BB,LL); mesh3 ThC=Cube(NNC,BB,LL); fespace VhC(ThC,[P1,P1,P1]); // of the coarse problem.. BuildPartitioning(sizeoverlaps,mesh3,Thg,Thi,aThij,RAS,pii,jpart,comm,vdebug) if(ksplit>1) { for(int jp=0;jp #include #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "superlu_zdefs.h" #include "ffsuperludistoption.hpp" template struct SuperLUmpiDISTDriver { }; template <> struct SuperLUmpiDISTDriver { /* Driver routines */ /* Driver routines */ static Dtype_t R_SLU_T() { return SLU_Z;} static doublecomplex *dc(Complex *p) { return (doublecomplex *) (void *) p;} static doublecomplex **dc(Complex **p) { return (doublecomplex **) (void *) p;} // Remplacement doublecomplex par Complex static void pgssvx(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, Complex *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, SOLVEstruct_t *p9, double *p10, SuperLUStat_t *p11, int *p12) { pzgssvx( p1,p2,p3, dc(p4),p5,p6,p7,p8,p9,p10,p11,p12 ); } static void pgssvx_ABglobal(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, Complex *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, double *p9, SuperLUStat_t *p10, int *p11) { pzgssvx_ABglobal( p1,p2,p3, dc(p4),p5,p6,p7,p8,p9,p10,p11 ); } static void Create_CompCol_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, Complex *p5, int_t *p6, int_t *p7, Stype_t p8, Dtype_t p9, Mtype_t p10) { zCreate_CompCol_Matrix_dist( p1,p2,p3, p4,dc(p5),p6,p7,p8,p9,p10 ); } static void Create_CompRowLoc_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, int_t p5, int_t p6, Complex *p7, int_t *p8, int_t *p9, Stype_t p10, Dtype_t p11, Mtype_t p12) { zCreate_CompRowLoc_Matrix_dist( p1,p2,p3, p4,p5,p6,dc(p7),p8,p9,p10,p11,p12 ); } static void CompRow_to_CompCol_dist(int_t p1, int_t p2, int_t p3, Complex *p4, int_t *p5, int_t *p6, Complex **p7, int_t **p8, int_t **p9) { zCompRow_to_CompCol_dist( p1,p2,p3, dc(p4),p5,p6,dc(p7),p8,p9 ); } static void Create_Dense_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, Complex *p4, int_t p5, Stype_t p6, Dtype_t p7,Mtype_t p8) { zCreate_Dense_Matrix_dist( p1,p2,p3, dc(p4),p5,p6,p7,p8 ); } static void Create_SuperNode_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, Complex *p5, int_t *p6, int_t *p7, int_t *p8, int_t *p9, int_t *p10, Stype_t p11, Dtype_t p12, Mtype_t p13) { zCreate_SuperNode_Matrix_dist( p1,p2,p3, p4,dc(p5),p6,p7,p8,p9,p10,p11,p12,p13 ); } static void Print_CompRowLoc_Matrix_dist(SuperMatrix *p1) { zPrint_CompRowLoc_Matrix_dist(p1); } }; template class ZSolveSuperLUmpi : public MatriceMorse::VirtualSolver, public SuperLUmpiDISTDriver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 //mutable char equed[1]; //yes_no_t equil; mutable SuperMatrix A; NCformat *Astore; //NCformat *Ustore; //SCformat *Lstore; mutable superlu_options_t options; mutable mem_usage_t mem_usage; mutable ScalePermstruct_t ScalePermstruct; mutable LUstruct_t LUstruct; mutable SOLVEstruct_t SOLVEstruct; mutable gridinfo_t grid; string string_option; string data_option; R *a; int *asub, *xa; int_t m, n, nnz; // rajout pour // int_t nprow,npcol; /* process rows and process columns*/ int matrixdist; // type of distributed matrix MPI_Comm commworld ; static const int assembled =0; static const int distributedglobal =1; static const int distributed =2; public: ZSolveSuperLUmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string datafile, string param_char, KN &pperm_r, KN &pperm_c, void * ccommworld ) : eps(epsilon),epsr(0), tgv(ttgv),string_option(param_char),data_option(datafile), tol_pivot_sym(pivot_sym),tol_pivot(pivot) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; R* B; //R* X; SuperLUStat_t stat; int info, ldb, nrhs=0; int i; double* berr; int iam; // Add for distributed matrix int_t m_loc, m_loc_fst, fst_row, nnz_loc, fst_nnz; R *aloc; int *asubloc, *xaloc; // End Add for distributed matrix // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); A.Store=0; /* Defaults */ nrhs = 0; /* lecture de nprow and npcol */ // Cas max deux procs nprow = 1; MPI_Comm_size(commworld,&npcol); matrixdist=0; /* set the default options */ set_default_options_dist(&options); DiagScale_t optionDiagScale; //if(verbosity > 10) print_options_dist(&options); if(!string_option.empty()) read_nprow_npcol_freefem( &string_option, &nprow, &npcol, &matrixdist); if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); if(!data_option.empty()) read_options_superlu_datafile(&data_option,&options,&nprow, &npcol, &matrixdist,&optionDiagScale); //if(verbosity > 10) print_options_dist(&options); /* ------------------------------------------------------------ INITIALIZE THE SUPERLU PROCESS GRID. ------------------------------------------------------------*/ cout << "Complex superlu_gridinit " << commworld << " "<< ccommworld << " : " << nprow << "X" << npcol <= nprow * npcol ){ //superlu_gridexit(&grid); printf("this process is not used in superlu %d \n",iam); } else { // matrix to procs and vectors if( matrixdist == assembled ){ if(!iam){ cout << "iam=" << iam << endl; printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; assert( AA.lg[n] == nnz ); printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* transform Row to Col */ // cela coute cher comme fonction // // dallocateA_dist(n, nnz, &a, &asub, &xa); // dCompRow_to_CompCol_dist(m,n,nnz,arow,asubrow,xarow,&a,&asub,&xa); // FFCS - "this->" required by g++ 4.7 this->CompRow_to_CompCol_dist(m,n,nnz,AA.a,AA.cl,AA.lg,&a,&asub,&xa); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } else{ /* printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ // FFCS - "this->" required by g++ 4.7 zallocateA_dist(n, nnz, this->dc(&a), &asub, &xa); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompCol_Matrix_dist" <" required by g++ 4.7 this->Create_CompCol_Matrix_dist(&A, m, n, nnz, a, asub, xa, SLU_NC, R_SLU, SLU_GE); cout << "Fin: Create_CompCol_Matrix_dist" <::pgssvx_ABglobal(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } //########################################################## // // matrix distributed with matrix global given // //########################################################## else if( matrixdist == distributedglobal) { if(!iam){ printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; a=AA.a; asub=AA.cl; xa=AA.lg; xa[n] = nnz; printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( AA.cl, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.lg, n+1, mpi_int_t, 0, grid.comm ); } else { printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ // FFCS - "this->" required by g++ 4.7 zallocateA_dist(n, nnz, this->dc(&a), &asub, &xa); MPI_Bcast( a, nnz, SuperLU_MPI_DOUBLE_COMPLEX, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } /* Compute the number of rows to be distributed to local process */ m_loc = m / (grid.nprow * grid.npcol); m_loc_fst = m_loc; /* When m / procs is not an integer */ if ((m_loc * grid.nprow * grid.npcol) != m) { /*m_loc = m_loc+1; m_loc_fst = m_loc;*/ if (iam == (grid.nprow * grid.npcol - 1)) /* last proc. gets all*/ m_loc = m - m_loc * (grid.nprow * grid.npcol - 1); } fst_row = iam * m_loc_fst; nnz_loc = xa[fst_row+m_loc]-xa[fst_row]; // FFCS - "this->" required by g++ 4.7 zallocateA_dist(m_loc, nnz_loc, this->dc(&aloc), &asubloc, &xaloc); //xaloc = (int_t*) intMalloc_dist(m_loc+1); for(int ii=0; ii < m_loc; ii++){ xaloc[ii] = xa[fst_row+ii]-xa[fst_row]; } xaloc[m_loc]=nnz_loc; fst_nnz = xa[fst_row]; //aloc = new R[nnz_loc]; //aloc = (Complex*) doubleMalloc_dist(nnz_loc); //asubloc = (int_t*) intMalloc_dist(nnz_loc); for(int ii=0; ii < nnz_loc; ii++){ aloc[ii] = a[fst_nnz+ii]; asubloc[ii] = asub[fst_nnz+ii]; } if( iam ){ SUPERLU_FREE( a ); SUPERLU_FREE( asub ); SUPERLU_FREE( xa ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); if(verbosity) cout << "Debut: Create_CompRowCol_Matrix_dist" <" required by g++ 4.7 if(verbosity) this->Create_CompRowLoc_Matrix_dist(&A, m, n, nnz_loc, m_loc, fst_row, aloc, asubloc, xaloc, SLU_NR_loc, R_SLU, SLU_GE); cout << "Fin: Create_CompRowCol_Matrix_dist" <::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } delete [] B; options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ nrhs=1; SUPERLU_FREE(berr); if(iam==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "SuperLU_DIST : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { R* B; SuperLUStat_t stat; int iam; int info=0, ldb=m, nrhs=1; int i; double* berr; double ferr; double rpg, rcond; int_t m_loc,m_loc_fst,fst_row; // time variables long int starttime,finishtime; long int timeused; iam = grid.iam; if( iam < nprow*npcol){ if(verbosity) starttime = clock(); if(n != m) exit(1); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); nrhs= 1; /* Initialize the statistics variables. */ PStatInit(&stat); /* cas matrix assembled */ if( matrixdist == assembled ){ if( !(B = new R[m*nrhs] ) ){ printf("probleme d allocation\n"); exit(1); } for(int ii=0; ii::pgssvx_ABglobal (&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if(verbosity) PStatPrint(&options, &stat, &grid); for(int ii=0; ii::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if ( !(xtemp = new R[AA.n]) ){ printf("probleme d allocation de xtemp\n"); exit(1); } int disp[nprow*npcol]; MPI_Allgather(&fst_row, 1, MPI_INT, disp, 1, MPI_INT, grid.comm); int recv[nprow*npcol]; MPI_Allgather(&m_loc, 1, MPI_INT, recv, 1, MPI_INT, grid.comm); MPI_Allgatherv(B, m_loc, SuperLU_MPI_DOUBLE_COMPLEX, xtemp, recv, disp, SuperLU_MPI_DOUBLE_COMPLEX, grid.comm); for(int ii= 0; ii< AA.n ; ii++) x[ii] = xtemp[ii]; if(verbosity) cout << " x min max " << x.min() << " " < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverSuperLUmpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverSuperLUmpi" << endl; return new ZSolveSuperLUmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.sparams, ds.perm_r, ds.perm_c, ds.commworld); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex //DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; //DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool SetSuperLUmpi() { if(verbosity) cout << " SetDefault sparse solver to SuperLUmpi double" << endl; //DefSparseSolver::solver =BuildSolverSuperLUmpi; DefSparseSolver::solver =BuildSolverSuperLUmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { //SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Complex SuperLU_DIST, defaultsolver defaultsolverSuperLUdist" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; //DefSparseSolver::solver =BuildSolverSuperLUmpi; DefSparseSolver::solver =BuildSolverSuperLUmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("complexdefaulttoSuperLUdist","(",new OneOperator0(SetSuperLUmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/essai.edp000644 000767 000024 00000007442 13256636774 020157 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 verbosity=2; cout << " rank = " << mpirank << " " << " size " << mpisize << endl; cout << " rank = " << mpiRank(mpiCommWorld) << " " << " size " << mpiSize(mpiCommWorld) << endl; if(mpisize>4) { int[int] procs=[1,4]; mpiGroup gpr(procs); cout << " before ... " << mpirank << endl; mpiComm comm(gpr); cout << " after ... " << mpirank << " in : " << bool(comm) << " rank " << mpiRank(comm) << " / " << mpiSize(comm) <=2) { if( mpirank==0) { cout << mpirank << " send to 1 " << endl; processor(1) << 123456; // unblock send } else if (mpirank==1) { int k; processor(0) >> k; // block recv cout << " recived " << k << endl; } { // UnBlock communication mpiRequest rq; if( mpirank==0) { Isend(processor(1,rq),16.); mpiWait(rq);// Send } else if (mpirank==1) { real k; Irecv(processor(0,rq),k); mpiWait(rq);// Recv assert(k==16.);// verif.. } } { // Block Communication if( mpirank==0) Send(processor(1),16.); else if (mpirank==1) { real k; Recv(processor(0),k); assert(k==16.);// verif.. } } } int l= mpirank+100; cout << " l == " << l << " broadcast l from 0 mpirank = " << mpirank << endl; broadcast(processor(0),l); cout << " l == " << l << " mpirank ="<< mpirank << endl; { matrix A; if( mpirank==0) A=[[1+1i,1i],[0,2-1i]]; broadcast(processor(0),A); if (mpirank==1) { A=A+A; processor(0) << A; } else if (mpirank==0) processor(1) >> A; cout << " mpirank = " << mpirank << " A = " << endl; cout << A << endl; cout << " " << norm(A(1,1) - 2-1i) << endl; } // asyncronous send/recv messages.... mpiRequest rr; real[int] vv(mpirank*mpisize:mpirank*mpisize+mpisize-1),ww(mpisize); processor(0,rr) << vv; if(mpirank==0) { mpiRequest[int] rq(mpisize); cout << " --- in ++ " <> ww; cout << " --- out ++ " <> ww; cout << " case " << i << " " << ww[0] << endl ; } } mpiAlltoall(vv,ww); cout << " all2all " << mpirank << " : " ; for(int i=0;i " ; for(int i=0;i> ICNTL[iii]; getline(ff,line); } } broadcast(processor(0),ICNTL); // Given data of MUMPS solver in array lparams(SYM,PAR,ICNTL) // There is no symmetric storage for a matrix associated with a sparse solver. // Therefore, the matrix will be considered unsymmetric for parallel sparse solver even if symmetric. // This fact will be change in new version of FreeFem++ { int SYM = 0; int PAR = 1; matrix A = [[ 40, 0, 45, 0, 0], [ 0, 12, 0, 0 , 0], [ 0, 0, 40, 0, 0], [ 12, 0, 0, 22, 0], [ 0, 0, 20, 0., 22]]; // construction of integer parameter for MUMPS int[int] MumpsLParams(42); MumpsLParams[0] = SYM; MumpsLParams[1] = PAR; for(int ii=0; ii< 40; ii++) MumpsLParams[ii+2] = ICNTL[ii]; // ICNTL begin with index 0 here real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); b=A*xx; if(mpirank ==0) cout << "xx=" << xx << endl; set(A,solver=sparsesolver,lparams=MumpsLParams); // We take the default value for CNTL MUMPS parameter if(mpirank ==0) cout << "solving solution" << endl; x = A^-1*b; if(mpirank ==0) cout << "b=" << b << endl; if(mpirank ==0) cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } } // FFCS - reference value for regression tests real regtest; // Read parameter of MUMPS solver in file ffmumps_fileparam.txt { matrix A = [[ 40, 0, 45, 0, 0], [ 0, 12, 0, 0 , 0], [ 0, 0, 40, 0, 0], [ 12, 0, 0, 22, 0], [ 0, 0, 20, 0., 22]]; real[int] xx = [ 1,32,45,7000,2], x(5), b(5), di(5); // xb(4),bbb(4); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver,datafilename="ffmumps_fileparam.txt"); cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; regtest=di.l2; } } freefem++-3.61-1/examples++-mpi/parms_FreeFem.cpp000644 000767 000024 00000103371 13256636774 021576 0ustar00hechtstaff000000 000000 // ORIG-DATE: 04/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : INRIA FUTUR // AUTHOR : Guy Atenekeng // E-MAIL : Guy_Antoine_Atenekeng_Kahou@lri.fr // // ALH - need reference to MPI to have the proper include for mpi.h on MacOS10.8 //ff-c++-LIBRARY-dep: parms scotchmetis scotch blas mpifc fc mpi pthread //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 */ #include #include using namespace std; #define MCW MPI_COMM_WORLD #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" /* Explain here what foobar does */ #ifdef __cplusplus extern "C" { #endif #include "psparslib.h" #include "generaldefs.h" #ifdef __cplusplus } #endif extern "C" { // ALH - 24/7/13 - we need to include metis/defs.h explicitely // because pARMS also contains an include file called defs.h and // both include directories are specified on the command line to // compile this file. Without this only one defs.h would be // included, the one from the first package specified above on the // line [[LIBRARY-dep]] typedef int SCOTCH_Num ; // #include "../download/include/metis/defs.h" #include "metis.h" } #ifdef _WIN32 // ALH - this activates the Windows DLL default export mechanism __declspec(dllexport) int not_used; // ALH - 24/7/13 - instanciate some global symbols which are not found by default in MS MPI Fortran libraries MPI_Fint* _imp__MPI_F_STATUS_IGNORE; MPI_Fint* _imp__MPI_F_STATUSES_IGNORE; #endif #include #include #include #define BUFLEN 100 #define NORHS 0 #define BUFLEN 100 //This functions come from pARMS package and consist to scale matrix class parm_param { public: mutable PrePar prepar; mutable IterPar ipar; mutable int sol_type; mutable int iov,scale, unsymm,method; mutable int solver; mutable int VERBOSE; public: parm_param(){ PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); /*---------------------------------------------------------------------- * * This function sets some default parameters just to get started with * * pARMS. There are two arrays which define the parameters in pARMS. * * Because ther\ e are so many methods, the number of parameters may seem * * overwhelming.. However\ , not all are used. For example when add_ilut * * is used only two parameters are r\ equired which are the drop * * tolerance and the max fill per row.. This function s\ ets everything * * so that all the methods can be safely tested. YS - * * * *------------------------------------------------------------------------*/ int i; /*------------------------------------------------------------------------*/ for (i=1; i<18; i++) ipar->ipar[i] = 0; /* parameters to be set for the solver -- not all of these are used -- depending on the method selected - */ /* parameters associated with various accelerators (inner/outer) */ ipar->ipar[0] = 3; /* nlev in arms when used */ ipar->ipar[1] = 20; /* block size in arms when used */ ipar->ipar[5] = 30; /* Outer iteration Krylov subs. dimension */ ipar->ipar[6] = 200; /* Max. outer iterations */ ipar->ipar[3] = 3; /* Inner iteration Krylov subs. dimension */ ipar->ipar[4] = 3; /* Max. inner iterations */ ipar->pgfpar[0] = 0.01; /* tolerance for inner iteration when used */ ipar->pgfpar[1] = 1.e-10;/* tolerance for outer iteration */ /* preconditioning parameters */ prepar->tolind = 0.1; /* tolerance used for diag dom. filtration alg.*/ prepar->lfil[0] = 20; /* lfil0 (ilut, iluk, and arms) */ prepar->lfil[4] = 20; /* lfil for Schur complement const. */ prepar->lfil[5] = 20; /* lfil for Schur complement const. */ prepar->droptol[0]=.001; /* droptol0 (ilut, iluk, and arms) */ prepar->droptol[4]=.001; /* droptol for Schur complement const. */ prepar->droptol[5]=.001; /* droptol for Schur complement const. */ prepar->mc = 1; /* multicoloring or not in ILU when used */ //Integer parameter iov=0; scale=1; unsymm=1; method= 2; VERBOSE=0; /*no statistic infos has print*/ /*VERBOSE=1 Only informations on convergence will be print*/ /*VERBOSE=2 Only informations on time will be print*/ solver=0; memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); for (i=1; i<4; i++) { prepar->droptol[i] = prepar->droptol[0]; prepar->lfil[i] = prepar->lfil[0]; } prepar->lfil[6] = prepar->lfil[5]; ipar->in_iters = 0; /*-------------------- done */ } public: parm_param(const KN ¶m_int, const KN ¶m_double) { int i; PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); for (i=1; i<18; i++) ipar->ipar[i] = 0; if(param_int.N()>0){if((param_int[0]<0)||(param_int[0]>2)) {printf("%s","WRONG SOLVER INDEX WE SET DEFAULT ONE \n"); solver=0; } else solver=param_int[0];}else solver=0; if(param_int.N()>1){if((param_int[1]<0)||(param_int[1]>13)) {printf("%s","WRONG INDEX FOR PRECONDITIONER, WE SET DEFAULT ONE \n"); method=2; } else if((param_int[1]>=0)||(param_int[1]<=13)) method=param_int[1];}else method=2; if(param_int.N()>2){if(param_int[2]>0) ipar->ipar[5]=param_int[2]; else ipar->ipar[5]=30;} else ipar->ipar[5]=30; /* Outer iteration Krylov subs. dimension */ if(param_int.N()>3){if(param_int[3]>0) ipar->ipar[6]=param_int[3]; else ipar->ipar[6]=1000;} else ipar->ipar[6]=1000; /* Max. outer iterations */ if((method==3)||(method==7)||(method==11)) {if(param_int.N()>4) {if(param_int[4]>0) ipar->ipar[0]=param_int[4]; else ipar->ipar[0]=3;} else ipar->ipar[0]=3; } /* nlev in arms when used */ if(param_int.N()>5){ if(param_int[5]>0) ipar->ipar[3]=param_int[5]; else ipar->ipar[3]=3;} else ipar->ipar[3]=3; /* Inner iteration Krylov subs. dimension */ if(param_int.N()>6){if(param_int[6]>0) ipar->ipar[4]=param_int[6]; else ipar->ipar[4]=3;} else ipar->ipar[4]=3; /* Max. inner iterations */ if(param_int.N()>7){if(param_int[7]>=0) unsymm=param_int[7]; else unsymm=0;} else unsymm=0; if(param_int.N()>8) {if(param_int[8]>=0) iov=param_int[8]; else iov=0;} else iov=0; if(param_int.N()>9) {if(param_int[9]>0) scale=param_int[9]; else scale=1;}else scale=1; if(param_int.N()>10){if(param_int[10]>0) ipar->ipar[1]=param_int[10]; else ipar->ipar[1]=20; }else ipar->ipar[1]=20; if(param_int.N()>11){if(param_int[11]>0) prepar->lfil[0]=param_int[11]; else prepar->lfil[0]=20;} else prepar->lfil[0]=20; /* lfil0(ilut, iluk, and arms) */ if(param_int.N()>12){if(param_int[12]>0) prepar->lfil[4]=param_int[12]; else prepar->lfil[4]=20;} else prepar->lfil[4]=20; /* lfil for Schur complement const. */ if(param_int.N()>13){if(param_int[13]>0) prepar->lfil[5]=param_int[13]; else prepar->lfil[5]=20;} else prepar->lfil[5]=20; /* lfil for Schur complement const. */ if(param_int.N()>14){if(param_int[14]>0) prepar->mc=param_int[14]; else prepar->mc=1; } else prepar->mc=1; if(param_int.N()>15){if(param_int[15]>0) ipar->in_iters=param_int[15]; else ipar->in_iters=0; } else ipar->in_iters=0; if(param_int.N()>16){if(param_int[16]>0) VERBOSE=param_int[16]; else VERBOSE=0; }else VERBOSE=0; if(param_double.N()>0){if(param_double[0]>0) ipar->pgfpar[1]=param_double[0]; else ipar->pgfpar[1]=1.e-08;} ipar->pgfpar[1]=1.e-08; /* tolerance for outer iteration */ if(param_double.N()>1){if(param_double[1]>0) ipar->pgfpar[0]=param_double[1]; else ipar->pgfpar[0]=0.01;} else ipar->pgfpar[0]=0.01; /* tolerance for inner iteration when used */ if(param_double.N()>2) {if(param_double[2]>0) prepar->tolind = param_double[2]; else prepar->tolind=0.1;} else prepar->tolind=0.1; /* tolerance used for diag dom. filtration alg.*/ if(param_double.N()>3){if(param_double[3]>0) prepar->droptol[0]=param_double[3]; else prepar->droptol[0]=.001;} else prepar->droptol[0]=.001; /* droptol0 (ilut, iluk, and arms) */ if(param_double.N()>4) {if(param_double[4]>0) prepar->droptol[4]=param_double[4]; else prepar->droptol[4]=.001;} else prepar->droptol[4]=.001; /* droptol for Schur complement const. */ if(param_double.N()>5){if(param_double[5]>0) prepar->droptol[5]=param_double[5]; else prepar->droptol[5]=.001;} else prepar->droptol[5]=.001; /* droptol for Schur complement const. */ memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); for (i=1; i<4; i++) { prepar->droptol[i] = prepar->droptol[0]; prepar->lfil[i] = prepar->lfil[0]; } prepar->lfil[6] = prepar->lfil[5]; } public: parm_param(string datafile,DistMatrix dm) { FILE *fp; char buf[BUFLEN], meth_buf[BUFLEN]; int num; PARMS_malloc(prepar,1,_PrePar); PARMS_malloc(ipar,1,_IterPar); parm_param(); char * filename=new char[datafile.length()+1]; strcpy(filename,datafile.c_str()); /* read parameters for preconditioner and iteration from file 'filename' */ /* ---- start modification by MS */ if( (fp = fopen(filename, "r")) == NULL ){ fprintf(stderr, "Cannot open file inputs\n"); PARMS_Final();exit(1); } for (num=0; num< 18; num++) ipar->ipar[num] = 0; num = 1; while(fgets(buf, BUFLEN, fp) != NULL) { switch(num) { case 1: /* solver */ sscanf(buf, "%d", &solver); if((solver!=0)&&(solver!=1)&&(solver!=2)) {printf("%s","WRONG SOLVER INDEX, WE SET DEFAULT ONE \n"); solver=0;} break; case 2: /* preconditionner */ sscanf(buf,"%s",meth_buf); method = assignprecon(meth_buf, dm); if((method<0)||(method>13)) {printf("%s","WRONG INDEX FOR PRECONDITIONER, WE SET DEFAULT ONE \n"); method=2; } break; case 3: /* im (Outer Krylov subs dim) */ sscanf(buf,"%d",&ipar->ipar[5]); break; case 4: /* im (Outer Krylov subs dim) */ sscanf(buf,"%d",&ipar->ipar[6]); break; case 5: /* outer tol */ sscanf(buf,"%lf",&ipar->pgfpar[1]); break; case 6: /* inner tol */ sscanf(buf,"%lf",&ipar->pgfpar[0]); break; case 7: /* unsym */ sscanf(buf, "%d", &unsymm); break; case 8: /* inim (inned Krylov subs dim) */ sscanf(buf, "%d", &ipar->ipar[3]); break; case 9: /* Max. inner iterations */ sscanf(buf,"%d",&ipar->ipar[4]); break; case 10: /* nlev */ sscanf(buf, "%d", &iov); break; case 11: /* scale */ sscanf(buf,"%d",&scale); break; case 12: /* For printing result */ sscanf(buf, "%d", &VERBOSE); break; case 13: /* lfil0 (ilut, iluk, and arms) */ sscanf(buf, "%d", &prepar->lfil[0]); break; case 14: /* lfil 4 (schur construction) */ sscanf(buf, "%d", &prepar->lfil[4]); break; case 15: /* lfil 5 (ILUT for Schur) */ sscanf(buf, "%d", &prepar->lfil[5]); break; case 16: /* bsize */ sscanf(buf,"%d",&ipar->ipar[1]); break; case 17: /* tolerance used for diag dom. filtration alg.*/ sscanf(buf,"%lf",&prepar->tolind); break; case 18: /*droptol (0) -- simliar to lfil0*/ sscanf(buf, "%lf", &prepar->droptol[0]); break; case 19: /*droptol (4) -- simliar to lfil4*/ sscanf(buf, "%lf", &prepar->droptol[4]); break; case 20: /*droptol (5) -- simliar to lfil5*/ sscanf(buf, "%lf", &prepar->droptol[5]); break; case 21: /* multicoloring or not */ sscanf(buf, "%d", &prepar->mc); break; default: break; } num++; } fclose(fp); memcpy(prepar->ipar, ipar->ipar, sizeof(int)*18); prepar->droptol[1] = prepar->droptol[2] = prepar->droptol[3] = prepar->droptol[0]; prepar->droptol[6] = prepar->droptol[5]; prepar->lfil[1] = prepar->lfil[2] = prepar->lfil[3] = prepar->lfil[0]; prepar->lfil[6] = prepar->lfil[5]; ipar->in_iters = 0; free(filename); } ~parm_param(){ free(prepar); free(ipar); } }; int assignprecon( char *precon_str, DistMatrix dm) { /*------------------------------------------------------------------ create preconditioner handler * precon -- preconditioning handler * add_ilu0 -- additive schwarz preconditioner with ilu0 as local preconditioner * add_ilut -- additive schwarz preconditioner with ilut as local preconditioner * add_iluk -- additive schwarz preconditioner with iluk as local preconditioner * add_arms -- additive schwarz preconditioner with arms as local preconditioner * lsch_ilu0 -- schur complement preconditioner with ilu0 as local preconditioner * lsch_ilut -- schur complement preconditioner with ilut as local preconditioner * lsch_iluk -- schur complement preconditioner with iluk as local preconditioner * lsch_arms -- schur complement preconditioner with arms as local preconditioner * sch_gilu0 -- parallel ilu0 preconditioner * sch_sgs -- Schur-Symmetric GS preconditioner *------------------------------------------------------------------*/ /* set the method label for preconditioning and parameter for inner iteration -- actual labels (int) are defined in SRC/ARMS/data.h */ int ierr, method; ierr = 0; method=0; if(!strcmp(precon_str, "add_ilu0")) method = add_ilu0; else if(!strcmp(precon_str, "add_ilut")) method = add_ilut; else if(!strcmp(precon_str, "add_iluk")) method = add_iluk; else if(!strcmp(precon_str, "add_arms")) method = add_arms; else if(!strcmp(precon_str, "lsch_ilu0")) method = lsch_ilu0; else if(!strcmp(precon_str, "lsch_ilut")) method = lsch_ilut; else if(!strcmp(precon_str, "lsch_iluk")) method = lsch_iluk; else if(!strcmp(precon_str, "lsch_arms")) method = lsch_arms; else if(!strcmp(precon_str, "rsch_ilu0")) method = rsch_ilu0; else if(!strcmp(precon_str, "rsch_ilut")) method = rsch_ilut; else if(!strcmp(precon_str, "rsch_iluk")) method = rsch_iluk; else if(!strcmp(precon_str, "rsch_arms")) method = rsch_arms; else if(!strcmp(precon_str, "sch_sgs")) method = sch_sgs; else if(!strcmp(precon_str, "sch_gilu0")) method = sch_gilu0; else ierr = 1; char pcrM[40]; strcpy(pcrM,"invalid choice for the preconditioner \n"); if (ErrHand(ierr, dm, pcrM)) exit(1) ; return method;cout << "Cette resolution semble prendre du temps" << endl; } #define minint(a, b) ( (a) < (b) ? (a) : (b) ) #define maxint(a, b) ( (a) > (b) ? (a) : (b) ) #define max(a, b) ( (a) > (b) ? (a) : (b) ) #define min(a, b) ( a < b ? (a) : (b) ) #define fabsmin(a, b) ( fabs(a) < fabs(b) ? (a) : (b) ) #define fabsmax(a, b) ( fabs(a) > fabs(b) ? (a) : (b) ) class dSolvePARMS : public MatriceMorse::VirtualSolver { char mat_domain[BUFLEN]; int *riord; mutable int n, nnz, nloc; int iov, scale, unsymm, method,solver,VERBOSE; string data_option; int rk, size; mutable double *rhs1, res; //double t1, t2, t3, t4; double *u, *v; int job,i1,i2; mutable DistMatrix dm; //distributed matrix object mutable PrePar prepar; mutable PreCon precon; //structure for preconditioner mutable IterPar ipar; //structure for iteration mutable int * maptmp1, *mapptr1; double eps, tol_pivot_sym,tgv, tol_pivot,epsr; mutable double t1,t2,t3,t4; mutable char * meth[14]; mutable int *maptmp, *mapptr,*iwork1,*iwork; mutable double *scaletmpr, *scaletmpc; mutable MPI_Comm comm; char *p; //Constructor construct the distribute matrix and also preconditionner public: dSolvePARMS(const MatriceMorse &AA,string datafile, KN ¶m_int, KN ¶m_double, MPI_Comm * mpicommw) { int n,i,job,nnz,ierr,tmp; int *ptr2,*id_rows2; double *vals2; double *AAv; int *p, *pr; int j, node; /* Initialize PARMSARSLIB environment */ if(mpicommw==NULL){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; // comm=MPI_COMM_WORLD; ierr = MPI_Comm_rank(comm, &rk); ierr = MPI_Comm_size(comm, &size); parm_param * pp; /*Differents preconditionners use*/ meth[0]=(char *)malloc(sizeof(char)*9); strcpy(meth[0],"add_ilu0"); meth[1]=(char *)malloc(sizeof(char)*9); strcpy(meth[1],"add_ilut"); meth[2]=(char *)malloc(sizeof(char)*9); strcpy(meth[2],"add_iluk"); meth[3]=(char *)malloc(sizeof(char)*9); strcpy(meth[3],"add_arms"); // FFCS - fixed "buffer overflow" warning by JHunt meth[4]=(char *)malloc(sizeof(char)*10); strcpy(meth[4],"lsch_ilu0"); meth[5]=(char *)malloc(sizeof(char)*10); strcpy(meth[5],"lsch_ilut"); meth[6]=(char *)malloc(sizeof(char)*10); strcpy(meth[6],"lsch_iluk"); meth[7]=(char *)malloc(sizeof(char)*10); strcpy(meth[7],"lsch_arms"); meth[8]=(char *)malloc(sizeof(char)*10); strcpy(meth[8],"rsch_ilu0"); meth[9]=(char *)malloc(sizeof(char)*10); strcpy(meth[9],"rsch_ilut"); meth[10]=(char *)malloc(sizeof(char)*10); strcpy(meth[10],"rsch_iluk"); meth[11]=(char *)malloc(sizeof(char)*10); strcpy(meth[11],"rsch_arms"); meth[12]=(char *)malloc(sizeof(char)*10); strcpy(meth[12],"sch_gilu0"); meth[13]=(char *)malloc(sizeof(char)*8); strcpy(meth[13],"sch_sgs"); /*storage format of the matrix*/ char pcrM[4]; strcpy(pcrM,"csr"); /*- Create Distributed Matrix dm in CSR format */ CreateMat(&dm, pcrM); dm->comm->mpi_comm=comm;dm->comm->myproc=rk; dm->comm->npro=size; /*------ Create PrePar /iterPar pointer */ /*---- parameters for preconditioning and iteration*/ if((datafile.empty())&&(param_double==NULL)&&(param_int==NULL)){ if(dm->comm->myproc==0) printf("%s","We are going to set default parameters because user did not specify any one \n \n "); parm_param * pp= new parm_param(); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method= assignprecon(meth[pp->method], dm); prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if(((param_double!=NULL)||(param_int!=NULL))&&(datafile.empty())) { if(dm->comm->myproc==0) printf("%s","User have set parameter inside vector of parameter \n"); parm_param * pp= new parm_param(param_int, param_double); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method= assignprecon(meth[pp->method], dm); prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if((!datafile.empty())&&((param_double==NULL)&&(param_int==NULL))) { if(dm->comm->myproc==0) printf("%s","User have set parameter inside file of parameter \n"); parm_param * pp= new parm_param(datafile, dm); iov=pp->iov; scale=pp->scale; unsymm=pp->unsymm; method=pp->method; prepar=pp->prepar; ipar=pp->ipar; VERBOSE=pp->VERBOSE; solver=pp->solver; } if(((solver==1)||(solver==2))&&((method!=0)||(method!=4))) { if(dm->comm->myproc==0) printf("%s%s%s", "WE NOT GARANTI THE PRECONDITIONNER WILL WORK BECAUSE ACCELARATOR ", meth[method] ," NO NEED INNER ITERATION \n"); //MPI_Finalize(); } if((dm->comm->myproc==0)&&(VERBOSE>=0)){ printf("###########################################\n"); printf("######### CALLING PARMS PACKAGE ###########\n"); if(solver==0) printf("########### SOLVER : FGMRES #######\n"); if(solver==1) printf("########### SOLVER : BiCGStab #######\n"); if(solver==2) printf("########### SOLVER : DGMRES #######\n"); printf("%s%s%s","########### PRECONDITIONNER : ", meth[method], "\n" ); printf("###########################################\n"); } /*----from zero-based to 1-based before calling pARMS routine----*/ n=AA.n; nnz=AA.nbcoef; PARMS_malloc(pr,n+1,int) ; PARMS_malloc(p,nnz,int) ; PARMS_malloc(AAv,nnz,double) ; for(i=0;i1){ METIS_PartGraphVKway(&n, pr, p, NULL, NULL, &wgtflag, &numflag,&size, option, &volume, riord); } else if(size==1){ for (i=0; ipgfpar[0] == 0.0){ if (rk == 0) fprintf(stderr, "Error: Tolerance for inner solver\n"); ierr = 1; } if (ipar->ipar[3] == 0){ if (rk == 0) fprintf(stderr, "Error: Krylov subspace size for inner solver\n"); ierr = 1; } if (ipar->ipar[4] == 0){ if (rk == 0) fprintf(stderr, "Error: Maximum number of inner iterations\n"); ierr = 1; } if (ierr == 1){ if (rk == 0) fprintf(stderr,"should be nonzero to invoke the Schur Complement iteration\n "); PARMS_Final(); exit(1); } } /*----- create preconditioner */ if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t1 = dwalltime();} ierr = CreatePrec(dm,&precon,method,prepar,ipar); if(VERBOSE==3) { MPI_Barrier(dm->comm->mpi_comm); t2 = dwalltime(); t2 = fabs(t2-t1); double tmax=0.0; MPI_Reduce(&t2, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0,dm->comm->mpi_comm); MPI_Bcast(&tmax, 1, MPI_INT,0,dm->comm->mpi_comm); t2=tmax; } /*----- check for errors in preconditioning construction, quit if any */ if (ierr != 0) fprintf(stderr, "Fatal Error (ierr = %d) in preconditioner construction on processor %d\nExiting...\n", ierr, rk); ierr = ierr*ierr; int tmp_ierr=0; MPI_Allreduce(&ierr, &tmp_ierr, 1, MPI_INT, MPI_SUM, dm->comm->mpi_comm); if ( tmp_ierr > 0 ){ /* delete distributed local matrix */ DeleteMat(&dm); /* delete distributed local vector */ free(prepar); free(ipar); free(pp); /* exit PARMS and MPI environment */ PARMS_Final(); exit(1); } } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { /* Vec structure rhs -- right hand side, sol -- solution, xsol -- exact solution */ Vec sol, rhs; int i,comt,node; int * poloc; double res1; double dnnz_pre, dgprec_nnz; nnz=AA.nbcoef; CreateVec(&rhs); CreateVec(&sol); n=AA.n; double * rhsb=(double *)malloc(sizeof(double)*n); for(i=0;ivec, nloc, double); PARMS_malloc(poloc, nloc, int); comt=0; if(scale) { for(i = 0; i < n; i++) rhsb[i] *= scaletmpr[i]; } for(i=i1;i<=i2;i++) { node = maptmp1[i-1];poloc[comt]=node-1; rhs->vec[comt]=rhsb[node-1];comt++; } /*----Iteration count-------------------------------------*/ ipar->in_iters=0; ipar->iters=0; /*--- Permute RHS according to result of setup routine ---*/ setuprhs(rhs); /*------- populate the initial guess with values */ VecSetVal(sol,0.0); /*------- calculate the norm of the residual on input */ res1 = ResiNorm2(dm, sol, rhs); if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t3 = dwalltime(); } double dgnnz; if(VERBOSE==3){ dnnz_pre = precon->nnz_pre; dgnnz = (double)nnz; dgprec_nnz=0; MPI_Reduce(&dgprec_nnz, &dnnz_pre, 1, MPI_DOUBLE, MPI_SUM, 0, dm->comm->mpi_comm); } if(rk == 0) { printf("Total NNZ(PreCon) / (NNZ*npro) = %6.2f\n",dgprec_nnz/dgnnz); } if(solver==0) fgmresd(dm,precon,ipar,rhs,sol); if(solver==1) dgmresd(dm,precon,ipar,rhs,sol); if(solver==2) bcgstabd(dm,precon,ipar,rhs,sol); res = ResiNorm2(dm, sol, rhs); if(VERBOSE==3){ MPI_Barrier(dm->comm->mpi_comm); t4 = dwalltime(); t4 = fabs(t4-t3); double tmax=0; MPI_Reduce(&t4, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0,dm->comm->mpi_comm); MPI_Bcast(&tmax, 1, MPI_DOUBLE,0,dm->comm->mpi_comm); t4=tmax; } /*----find the norm of the solution error */ i=1; t3 = -1.0; int j; for (i=0; inode[i]-1; /* get the global node corresponding to node i*/ poloc[i]=j; } if (scale){ /*--------- apply permutations to scaletmp */ for (i=0; inode[i]-1; /* get the global node corresponding to node i*/ sol->vec[i] = sol->vec[i]*scaletmpc[j]; /*---- find the residual of the computed solution */ } } /*----- compute the relative error of computed solution */ if((dm->comm->myproc == 0)&&(VERBOSE==3)) { fprintf(stdout,"################ SOLVER STATISTICS ####################\n"); fprintf(stdout, "OUTER ITERATIONS COUNT IS %d\n", ipar->iters); fprintf(stdout, "INNER ITERATION COUNT IS %d\n", ipar->in_iters); fprintf(stdout, "THE TOTAL TIME IS %16.8f\n", t2+t4); fprintf(stdout, "THE TIME FOR CREATING PRECONDITIONER IS %16.8f\n", t2); fprintf(stdout, "THE TIME FOR SOLVING PROCESS is %16.8f\n", t4); fprintf(stdout, "The 2-NORM OF THE RELATIVE RESIDUAL IS %16.8g\n", res/res1); } if((dm->comm->myproc == 0)&&(VERBOSE==2)) { fprintf(stdout, "THE TOTAL TIME IS %16.8f\n", t2+t4); fprintf(stdout, "THE TIME FOR CREATING PRECONDITIONER IS %16.8f\n", t2); fprintf(stdout, "THE TIME FOR SOLVING PROCESS is %16.8f\n", t4); } if((dm->comm->myproc == 0)&&(VERBOSE==1)) { fprintf(stdout, "OUTER ITERATIONS COUNT IS %d\n", ipar->iters); fprintf(stdout, "INNER ITERATION COUNT IS %d\n", ipar->in_iters); fprintf(stdout, "The 2-NORM OF THE RELATIVE RESIDUAL IS %16.8g\n", res/res1); } double * xx= (double *)malloc(sizeof(double)*n); comt=0; for(i=0;icomm->npro;i++) mapptr[i]--; int *displs, *perm; PARMS_malloc(displs, nloc, int);PARMS_malloc(perm, n, int); MPI_Gatherv(&(sol->vec[0]), nloc, MPI_DOUBLE, &(xx[0]), iwork, mapptr , MPI_DOUBLE, 0,comm ); MPI_Gatherv(&(poloc[0]), nloc, MPI_INT, &(perm[0]), iwork, mapptr , MPI_INT, 0,comm ); MPI_Bcast(perm,AA.n,MPI_INT,0, comm); int *invp=(int *)malloc(sizeof(int)*n); for(i=0;icomm->myproc==0){for(i=0;icomm->npro;i++) mapptr[i]++; /*Delete use vectors*/ DeleteVec(&sol); DeleteVec(&rhs); free(xx); //This should be in Destructor free(perm); free(invp); } ~dSolvePARMS() { if(VERBOSE==3){ cout << "~SolvePARMS:" << endl; free(mapptr); DeletePrec(precon); free(scaletmpc); free(scaletmpr); /*---- Delete distributed local matrix */ DeleteMat(&dm); /*---- Delete distributed local vector */ free(prepar); free(ipar); /*Delete matrix and right hand side*/ } //PARMS_Final(); } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; inline MatriceMorse::VirtualSolver * BuilddSolvePARMS(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverMUMPSmpi" << endl; return new dSolvePARMS(*A,ds.data_filename, ds.lparams, ds.dparams,(MPI_Comm *)ds.commworld); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return TRUE; } bool SetdSolvePARMS() { if(verbosity>1) cout << " SetDefault sparse solver to PARMS" << endl; DefSparseSolver::solver =BuilddSolvePARMS; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return TRUE; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pARMSmpi, defaultsolver defaultsolverpARMSmpi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuilddSolvePARMS; //DefSparseSolver::solver =BuildSolverMUMPSmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttopARMSmpi","(",new OneOperator0(SetdSolvePARMS)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/beam-3d-matrix-pastix.edp000644 000767 000024 00000004274 13256636774 023073 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "medit" load "real_pastix_FreeFem" include "cube.idp" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int[int] Nxyz=[40,8,8]; real [int,int] Bxyz=[[0.,5.],[0.,1.],[0.,1.]]; int [int,int] Lxyz=[[1,1],[2,2],[2,2]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); real E = 21.5e4; real sigma = 0.29; real mu = E/(2*(1+sigma)); real lambda = E*sigma/((1+sigma)*(1-2*sigma)); real gravity = -0.05; fespace Vh(Th,[P2,P2,P2]); //fespace Vh(Th,[P1,P1,P1]); Vh [u1,u2,u3], [v1,v2,v3]; cout << "lambda,mu,gravity ="< I ~ - C1AC2A +C1A +C2A New Prec P= C1+C2 - C1AC2 = C1(I- A C2) +C2 ( C1(I- A C2) +C2 ) Uo V = - C2*Uo .... */ real[int] V(U.n); prefix#CoarseSolve(V,U,comm); V = -V; /* -C2*Uo */ U += Ai*V; /* U = (I-A C2) Uo */ real[int] b= onG10 ? 0. : U; U = Ai^-1*b; /* ( C1( I -A C2) Uo */ V = U -V; /**/ prefix#Update(V,U); return U; } /*-----------------*/ /*-----------------*/ /*-----------------*/ func real[int] prefix#PDJC2(real[int]& U) /* bogus ???? */ { /* Precon C1= precon Coarse C2 precon Precon Idea : F. Nataf. 0 ~ (I C1A)(I-C2A) => I ~ - C1AC2A +C1A +C2A New Prec P= C1+C2 - C1AC2 = C1(I- A C2) +C2 ( C1(I- A C2) +C2 ) Uo V = - C2*Uo .... V = - C2 Uo W = Uo + A V V + C1 W */ real[int] V(U.n); real[int] b= onG10 ? 0. : U; V = Ai^-1*b; b=U; V = -V; prefix#Update(V,U); U += Ai*V; prefix#CoarseSolve(U,b,comm); V = U -V; prefix#Update(V,U); return U; } /*-----------------*/ /*-----------------*/ /*-----------------*/ func real[int] prefix#DJ0(real[int]& U) { ++prefix#kiter; real[int] V(U.n); real[int] b= onG10 .* U; b = onG10 ? b : Bi ; V = Ai^-1*b; prefix#Update(V,U); V -= U; return V; } /*-----------------*/ /*-----------------*/ /*-----------------*/ func bool prefix#CheckUpdate() { /* verification.....*/ Whi defPk#Pknbcomp(u,) =Times#Pknbcomp(1),defPk#Pknbcomp(v,); prefix#Update(u[],v[]); u[]-=v[]; if(mpirank==0) cout << "CheckUpdate " << u[].linfty << endl; if(u[].linfty>1e-6) plot(u,cmm="bug ????"); assert( u[].linfty<1e-6); return 1; } func bool prefix#Saveff(string sff,real epss,int ksplit,int nloc,int sizeoverlaps) { if(sff != "") { ofstream ff(sff+".txt",append); cout << " ++++ " ; cout << mpirank <<"/" << mpisize << " k=" << ksplit << " n= " << nloc << " " << sizeoverlaps << " it= " << prefix#kiter ; for (int i=1; i=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",1); int nloc = getARGV("-n",10); string sff=getARGV("-p",""); int gmres=getARGV("-gmres",3); int nC = getARGV("-N" ,max(nloc/10,5)); int sizeoverlaps=1; // size of overlap bool RAS=1; // select kind of of $\pi_i$ if(mpirank==0 && verbosity) cout << " vdebug: " << vdebug << " kspilt "<< ksplit << " nloc "<< nloc << " sff "<< sff <<"."<< endl; string sPk="P2-Lame-2gd"; func Pk=[P2,P2]; func bool plotMPIall(mesh &Th,real[int] & u,string cm) {if(vdebug) PLOTMPIALLU(mesh,Pk, defPk2, Th, u, allu1, { cmm=cm,nbiso=10,fill=1,dim=3,value=1}); return 1;} mpiComm comm(mpiCommWorld,0,0);// trick : make a no split mpiWorld int ipart= mpiRank(comm); // current partition number if(ipart==0) cout << " Final N=" << ksplit*nloc << " nloc =" << nloc << " split =" << ksplit << endl; int[int] l111=[2,2,2,1]; settt mesh Thg=square(nloc*4,nloc,[x*4,y],label=l111); mesh ThC=square(nC*4,nC,[x*4,y],label=l111);// Coarse Mesh fespace VhC(ThC,[P1,P1]); // of the coarse problem.. BuildPartitioning(sizeoverlaps,mesh,Thg,Thi,aThij,RAS,pii,jpart,comm,vdebug) if(ksplit>1) { for(int jp=0;jp #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" #include "MatriceCreuse_tpl.hpp" #ifndef MPI_SUCCESS #define MPI_SUCCESS #endif extern "C" { typedef int SCOTCH_Num ; void METIS_PartGraphKway(const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); #include "hips.h" //#include "metis.h" } #include #include #include #define BUFLEN 200 #define MCW MPI_COMM_WORLD int roscal(int n, int job,int nrm, double *AAv, int *p, int *pr, double * scaletmpr , int *ierr) { /*--------------------------------------------------------------------- | | This routine scales each row of mata so that the norm is 1. | |---------------------------------------------------------------------- | on entry: | mata = the matrix (in SparRow form) | nrm = type of norm | 0 (\infty), 1 or 2 | | on return | diag = diag[j] = 1/norm(row[j]) | | 0 --> normal return | j --> row j is a zero row |--------------------------------------------------------------------*/ /* local variables */ int i, k; double scal; for (i=0; i scal) scal = fabs(AAv[k]); } else if (nrm == 1) { for (k=pr[i]; k normal return | j --> column j is a zero column |--------------------------------------------------------------------*/ /* local variables */ int i, j, k; double *kr; int *ki; for (i=0; i scaletmpc[p[k]]) scaletmpc[p[k]] = fabs(AAv[k]); } } else if (nrm == 1) { for (k=pr[i]; k param_int,KN param_double) { char buf[BUFLEN]; int num,in_val; double val; FILE *fp; char * filename=new char[datafile.length()+1]; strcpy(filename,datafile.c_str()); int i; for(i=0;i<16;i++) param_int[i]=-1; for(i=0;i<9;i++) param_double[i]=-1.0; /* read parameters for preconditioner and iteration from file 'filename' */ /* ---- start modification by MS */ if( (fp = fopen(filename, "r")) == NULL ){ fprintf(stderr, "Cannot open file inputs\n"); exit(1); } num = 0; while(fgets(buf, BUFLEN, fp) != NULL) { if(num<=15) {sscanf(buf, "%d", &in_val); param_int[num]=in_val;} else {sscanf(buf, "%lf", &val); param_double[num]=val;} num++; } fclose(fp); } class HipsSolver : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 string data_option; mutable INTS master;// MPI_Comm comm; mutable INTS id, i, j; mutable INTS *unknownlist; mutable double *x; mutable INTS ln; mutable INTS ierr; mutable INTS n,nnz,nnzl; mutable double * a; mutable INTS *ia, *ja; mutable int *pp; int loc_size,pbegin, pend; INTS domsize, nproc,proc_id; mutable int sym_pattern, sym_matrix; KN param_int; KN param_double; mutable double *scaletmpr, *scaletmpc; mutable int *mapptr,*maptmp,*iwork,*riord,*iwork1,scale; mutable int *pr, *p; mutable double * AAv; private: static const int MaxIds=100; static int Ids[MaxIds]; static int GetId() { static bool Initialized=false; if(!Initialized) { Initialized=true; if(verbosity>2) cout << " Hips HIPS_Initialize " << MaxIds <8) cout << " find HipsSoler : id = " << i << "/" << MaxIds << endl; return i; } cerr<< " All id of Hips are busy " << MaxIds << " try to store less matrix or change MaxIds (FH.) in " << endl; ffassert(0); return -1; } public: static void Def_iopt(long * param_intd) { param_intd[0]= HIPS_ITERATIVE ; // HIPS_STRA param_intd[1]= 0 ; // HIPS_KRYLOV_METHOD param_intd[2]= 1000 ; // HIPS_ITMAX param_intd[3]= 40 ; // HIPS_KRYLOV_RESTART param_intd[4]= 1 ; // HIPS_SYMMETRIC param_intd[5]= 1 ; // HIPS_GRAPH_SYM param_intd[6]= 0 ; // HIPS_PARTITION_TYPE param_intd[7]= 2 ; // HIPS_LOCALLY param_intd[8]= 0 ; // HIPS_FORTRAN_NUMBERING param_intd[9]= 1 ; // HIPS_SCALE param_intd[10]= 1 ; // HIPS_REORDER param_intd[11]= 1 ; // HIPS_DOF param_intd[12]= 2 ; // HIPS_SCALENBR param_intd[13]= max(0L,verbosity-2) ; // HIPS_VERBOSE param_intd[14]= 2 ; // HIPS_DOMSIZE param_intd[15]= 2 ; // HIPS_SCHUR_METHOD param_intd[16]= 2 ; // HIPS_ITMAX_SCHUR } static void Def_dopt(double *d) { d[0]= 1e-09 ; // HIPS_PREC d[1]= 0.005 ; // HIPS_DROPTOL0 d[2]= 0.005 ; // HIPS_DROPTOL1 d[3]= 0.005 ; // HIPS_DROPTOLE d[4]= 0.005 ; // HIPS_AMALG d[5]= 0.005 ; // HIPS_DROPSCHUR } public: HipsSolver(const MatriceMorse &AA,double eeps,string datafile, const KN ¶m_int1, const KN ¶m_double1,int mmaster, MPI_Comm * mpicommw ) : eps(eeps),data_option(datafile) ,param_int(17), param_double(6),id(GetId()) { master=mmaster; if(mpicommw==0) comm=MPI_COMM_WORLD; else comm= *mpicommw; MPI_Comm_rank(comm, &proc_id); MPI_Comm_size(comm, &nproc); if(proc_id==0 || verbosity>2) cout << " Hips Comm " << proc_id<< " / "<< nproc << endl; Def_iopt(param_int); Def_dopt(param_double); static int dopt_wrapper[6] = { HIPS_PREC , HIPS_DROPTOL0 , HIPS_DROPTOL1 , HIPS_DROPTOLE , HIPS_AMALG , HIPS_DROPSCHUR }; static int iopt_wrapper[17] = { -1,// DEf STRATEGIC not in H HIPS_KRYLOV_METHOD , HIPS_ITMAX, HIPS_KRYLOV_RESTART, HIPS_SYMMETRIC, HIPS_GRAPH_SYM, HIPS_PARTITION_TYPE, HIPS_LOCALLY, HIPS_FORTRAN_NUMBERING, HIPS_SCALE, HIPS_REORDER, HIPS_DOF, HIPS_SCALENBR, HIPS_VERBOSE, HIPS_DOMSIZE, HIPS_SCHUR_METHOD, HIPS_ITMAX_SCHUR } ; int ic,sym=AA.symetrique ,symm=AA.symetrique; if(!data_option.empty()) parm_param(datafile,param_int,param_double); else { for(int i=0;i< min(param_int.N(),param_int1.N()); ++i) if(param_int1[i]>-1) param_int[i]=param_int1[i]; for(int i=0;i< min(param_double.N(),param_double1.N()); ++i) if(param_double1[i]>-0.9999) param_double[i]=param_double1[i]; } // force param value ... param_int[0]=max(min(param_int[0],2L),0L); param_int[5]= sym; param_int[4]= symm; if(eps>0 &&( param_double1.N() ==0 || param_double1[0]<0) ) param_double[0]= eps; else eps = param_double[0]; ic = param_int[0]; scale=param_int[9]; if(verbosity>3 && proc_id==0 ) { cout << " Hips INT opts " << param_int << endl; cout << " Hips REAL opts " << param_double << endl; } HIPS_SetDefaultOptions(id, param_int[0] ); for(int i=1;i=0) HIPS_SetOptionINT(id,iopt_wrapper[i],param_int[i] ); for(int i=0;i=0.)HIPS_SetOptionREAL(id,dopt_wrapper[i],param_double[i] ); if(!data_option.empty()) parm_param(datafile,param_int,param_double); HIPS_SetCommunicator(id,comm); n=AA.n; nnz=AA.nbcoef; int ierr; /* pr= new int[n+1]; p= new int[nnz]; AAv=new double[nnz]; for(int i=0;i1){ METIS_PartGraphKway(&n, AA.lg, AA.cl, NULL, NULL, &wgtflag, &numflag,&nproc, option, &volume, riord); } else if(nproc==1){ for (int i=0; i 5) cout << " Hips : proc " << proc_id << " / nzz = " << nnzz << " / nzzg " << nnz << endl; for(int i=0;i100) cout << " " << proc_id << " a( " << i << ", " < 1 && proc_id==0 ) cout << " Hips " << id << ", Res = " <=0); if( (verbosity>3 && proc_id==0 ) ||(verbosity>9) ) cout << " ~Hips_Solver S:" << id << endl; // HIPS_SetOptionINT(id,HIPS_DISABLE_PRECOND,0); // HIPS_ExitOnError(ierr); ierr = HIPS_Clean(id); HIPS_ExitOnError(ierr); delete [] iwork1; delete [] mapptr; delete [] iwork; delete [] maptmp; if(id>0 && id< MaxIds) Ids[id]=-2; id=-2; } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } private:// no copy HipsSolver(const HipsSolver &); HipsSolver & operator=(const HipsSolver &); }; // CLASS HipsSolver int HipsSolver::Ids[HipsSolver::MaxIds]; inline MatriceMorse::VirtualSolver * BuildSolverHipsSolvermpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverSuperLU" << endl; return new HipsSolver(*A,ds.epsilon,ds.data_filename, ds.lparams, ds.dparams,ds.master,(MPI_Comm *)ds.commworld); } /* --FH: class Init { public: Init(); }; */ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity>1) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return 1; } bool HipsDefaults(KN* piop,KN * pdop) { if(piop) { piop->resize(17); HipsSolver::Def_iopt(*piop); } if(pdop) { pdop->resize(6); HipsSolver::Def_dopt(*pdop); } return true; } bool SetHipsSolver() { if(verbosity>1) cout << " SetDefault sparse solver to Hips" << endl; DefSparseSolver::solver =BuildSolverHipsSolvermpi; //DefSparseSolver::solver =BuildSolverHipsSolvermpi; TypeSolveMat::defaultvalue =TypeSolveMatdefaultvalue; return 1; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: Hips, defaultsolver defaultsolverHips" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverHipsSolvermpi; // DefSparseSolver::solver =BuildSolverHipsSolver; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoHips","(",new OneOperator0(SetHipsSolver)); if(! Global.Find("HipsDefaults").NotNull() ) Global.Add("HipsDefaults","(",new OneOperator2*,KN *>(HipsDefaults)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/ffsuperludistoption.hpp000644 000767 000024 00000042715 13256636774 023224 0ustar00hechtstaff000000 000000 // read options for superlu in freefem++ int s_(char* str, const char* cmp[]) { int i = 0; while( cmp[i] != 0){ if( strcmp(str, cmp[i]) == 0){ //cout << *str << " return" << i << endl; return i+1 ; } i++; } //cout << *str << " return 0" << endl; return 0; } void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol){ static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2 = tictac; tictac = strtok(NULL," =,\t\n"); int val_options; if(verbosity>4) printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); switch (id_option) { case 13: // nprow *nprow = atoi(tictac); break; case 14: // npcol *npcol = atoi(tictac); break; case 15: // matrix if(verbosity>4) printf("parameter matrix \n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ if(verbosity>4)printf("value of parameter matrix is not correct %s \n", tictac ); } break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2 ); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } void read_options_freefem(string *string_option, superlu_options_t *options, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE,SLU_SINGLE, SLU_DOUBLE, SLU_EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //static const char* compMemType_t[] = {"LUSUP", "UCOL", "LSUB", "USUB",0}; //static const char* compstack_end_t[] = {"HEAD", "TAIL",0}; //static const char* compLU_space_t[] = {"SYSTEM", "USER",0}; static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", "DiagPivotThresh","IterRefine","Trans", "ReplaceTinyPivot","SolveInitialized", "RefineInitialized","PrintStat","nprow","npcol","DiagScale","matrix",0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); if(verbosity>4) cout << "data=" << data << endl; char *tictac; char *tictac2; tictac = strtok(data," =,\t\n"); while(tictac != NULL){ int id_option = s_(tictac, comp); tictac2=tictac; tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; // case 13 nprow // case 14 npcol case 15: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0) { printf("parameter is not valid for superlu_dist %s \n", tictac2); exit(1); } break; } tictac = strtok(NULL," =,\t\n"); } } // void read_nprow_npcol_freefem(string *string_option, int *nprow, int *npcol, int *matrixdist){ // static const char* comp[] = {"Fact","Equil","ParSymbFact","ColPerm","RowPerm", // "DiagPivotThresh","IterRefine","Trans", // "ReplaceTinyPivot","SolveInitialized", // "RefineInitialized","PrintStat","nprow","npcol","matrix",0}; // char data[string_option->size()+1]; // strcpy( data, string_option->c_str()); // char *tictac; // char *tictac2; // tictac = strtok(data," =,\t\n"); // while(tictac != NULL){ // int id_option = s_(tictac, comp); // tictac2 = tictac; // tictac = strtok(NULL," =,\t\n"); // int val_options; // printf("param %s = value %s , id_option %d\n",tictac2,tictac,id_option); // switch (id_option) // { // case 13: // nprow // *nprow = atoi(tictac); // break; // case 14: // npcol // *npcol = atoi(tictac); // break; // case 15: // matrix // printf("parameter matrix \n"); // if(strcmp(tictac,"assembled") == 0) // *matrixdist = 0; // else if(strcmp(tictac,"distributedglobal") == 0) // *matrixdist = 1; // else if(strcmp(tictac,"distributed") == 0) // *matrixdist = 2; // else{ // printf("value of parameter matrix is not correct %s \n", tictac ); // } // break; // default: // Equivalent of case default // if(id_option == 0) // { // printf("parameter is not valid for superlu_dist %s \n", tictac2 ); // exit(1); // } // break; // } // tictac = strtok(NULL," =,\t\n"); // } // } void read_nprow_npcol_matrixdist_superlu_datafile(string *data_option, int_t *nprow, int_t *npcol, int *matrixdist){ char datafile[data_option->size()+1]; strcpy( datafile, data_option->c_str()); FILE* pfile= fopen( datafile,"rt"); char data[256]; char *tictac; fgets(data,256,pfile); if(verbosity>4) cout << "data=" << data << endl; tictac = strtok(data," /!#\t\n"); *nprow = (int) atol(tictac); if(verbosity>1) printf("nprow=%d\n",*nprow); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); *npcol = (int) atol(tictac); if(verbosity>1) printf("npcol=%d\n",*npcol); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("matrix input %s for superlu_dist is not correct\n", tictac ); exit(1); } fclose(pfile); } void read_options_superlu_datafile(string *data_option, superlu_options_t *options, int_t *nprow, int_t *npcol, int *matrixdist, DiagScale_t *diag){ static const yes_no_t enumyes_no_t[2] = {NO, YES}; static const fact_t enumfact_t[4] = {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED}; static const colperm_t enumcolperm_t[6] = {NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A,PARMETIS, MY_PERMC}; static const rowperm_t enumrowperm_t[3] = {NOROWPERM, LargeDiag, MY_PERMR}; static const DiagScale_t enumDiagScale_t[4] = {NOEQUIL, ROW, COL, BOTH}; static const trans_t enumtrans_t[3] = {NOTRANS, TRANS, CONJ}; static const IterRefine_t enumIterRefine_t[4] = {NOREFINE, SLU_SINGLE, SLU_DOUBLE, SLU_EXTRA}; //static const MemType enumMemType_t[4] = {LUSUP, UCOL, LSUB, USUB}; //static const stack_end_t enumstack_end_t[2] = {HEAD, TAIL}; //static const LU_space_t enumLU_space_t[2] = {SYSTEM, USER}; static const char* compyes_no_t[] = {"NO", "YES",0}; static const char* compfact_t[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; static const char* comprowperm_t[] = {"NOROWPERM", "LargeDiag", "MY_PERMR",0}; static const char* compcolperm_t[] = {"NATURAL", "MMD_AT_PLUS_A", "MMD_ATA", "METIS_AT_PLUS_A", "PARMETIS", "MY_PERMC",0}; static const char* compDiagScale_t[] = {"NOEQUIL", "ROW", "COL", "BOTH",0}; static const char* comptrans_t[] = {"NOTRANS", "TRANS", "CONJ",0}; static const char* compIterRefine_t[] = {"NOREFINE", "SINGLE", "DOUBLE", "EXTRA",0}; //int_t ffnprow,ffnpcol; //int matrixdist; char datafile[data_option->size()+1]; strcpy( datafile, data_option->c_str()); FILE* pfile= fopen( datafile,"rt"); char data[256]; char *tictac; fgets(data,256,pfile); if(verbosity>4) cout << "data=" << data << endl; tictac = strtok(data," /!#\t\n"); *nprow = (int) atol(tictac); if(verbosity) printf("nprow=%d\n",*nprow); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); *npcol = (int) atol(tictac); if(verbosity) printf("npcol=%d\n",*npcol); fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); if(strcmp(tictac,"assembled") == 0) *matrixdist = 0; else if(strcmp(tictac,"distributedglobal") == 0) *matrixdist = 1; else if(strcmp(tictac,"distributed") == 0) *matrixdist = 2; else{ printf("matrix input %s for superlu_dist is not correct\n", tictac ); exit(1); } int id_option=0; while( !feof(pfile) && id_option<12){ fgets(data,256,pfile); tictac = strtok(data," /!#\t\n"); id_option++; int val_options; switch (id_option) { case 1 : // Fact //char* comp1[] = {"DOFACT", "SamePattern", "SamePattern_SameRowPerm", "FACTORED",0}; val_options= s_(tictac,compfact_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Fact"); exit(1); } options->Fact = enumfact_t[val_options-1]; break; case 2: // Equil //char* comp2[] = {"NO", "YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Equil"); exit(1); } options->Equil = enumyes_no_t[val_options-1]; break; case 3: // ParSymbFact //char* comp3[] = {"NATURAL", "MMD_ATA", "MMD_AT_PLUS_A", "COLAMD", "MY_PERMC", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ParSymbFact = enumyes_no_t[val_options-1]; break; case 4: // ColPerm val_options= s_(tictac,compcolperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->ColPerm = enumcolperm_t[val_options-1]; break; case 5: // RowPerm val_options= s_(tictac,comprowperm_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->RowPerm = enumrowperm_t[val_options-1]; break; case 6: // DiagPivotThresh options->DiagPivotThresh= strtod(tictac,&tictac); break; case 7: // IterRefine val_options= s_(tictac,compIterRefine_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ColPerm"); exit(1); } options->IterRefine = enumIterRefine_t[val_options-1]; break; case 8: // Trans //char* comp5[] = {"NOTRANS", "TRANS", "CONJ", 0}; val_options= s_(tictac, comptrans_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","Trans"); exit(1); } options->Trans = enumtrans_t[val_options-1]; break; case 9: // ReplaceTinyPivot //char* comp7[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","SymmetricMode"); exit(1); } options->ReplaceTinyPivot= enumyes_no_t[val_options-1]; break; case 10: // SolveInitialized //char* comp8[] = {"NO","YES", 0}; val_options= s_(tictac,compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PivotGrowth"); exit(1); } options->SolveInitialized = enumyes_no_t[val_options-1]; break; case 11: // RefineInitialized //char* comp9[] = {"NO","YES", 0}; val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","ConditionNumber"); exit(1); } options->RefineInitialized = enumyes_no_t[val_options-1]; break; case 12: // PrintStat val_options= s_(tictac, compyes_no_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } options->PrintStat = enumyes_no_t[val_options-1]; break; case 13: // DiagScale_t val_options= s_(tictac, compDiagScale_t); if( val_options == 0){ printf("value given for SuperLU for options %s is not correct\n","PrintStat"); exit(1); } *diag = enumDiagScale_t[val_options-1]; break; default: // Equivalent of case default if(id_option == 0 && id_option > 13) { printf("Error in reading data file for superlu_dist %s\n",datafile); exit(1); } break; } } fclose(pfile); } freefem++-3.61-1/examples++-mpi/DDM-Schwarz-Stokes-2d.edp000644 000767 000024 00000010703 13256636774 022641 0ustar00hechtstaff000000 000000 // NBPROC 2 // ff-mpirun -np 4 DDM-Schwarz-Stokes-2d.edp -glut ffglut -n 11 -k 1 -d 1 -ns -gmres 1 /* a first true parallele example fisrt freefem++ Ok up to 200 proc for a Poisson equation.. See the Doc for full explaiantion F Hecht Dec. 2010. ------------------- usage : ff-mpirun [mpi parameter] DDM-Schwarz-Stokes-2d.edp [-glut ffglut] [-n N] [-k K] [-d D] [-ns] [-gmres [0|1] argument: -glut ffglut : to see graphicaly the process -n N: set the mesh cube split NxNxN -d D: set debug flag D must be one for mpiplot -k K: to refined by K all elemnt -ns: reomove script dump -gmres 0 : use iterative schwarz algo. 1 : Algo GMRES on residu of schwarz algo. 2 : DDM GMRES 3 : DDM GMRES with coarse grid preconditionner (Good one) */ load "MPICG" load "medit" load "metis" include "getARGV.idp" include "DDM-Schwarz-macro.idp" //include "AddLayer2d.idp" include "DDM-funcs-v2.idp" searchMethod=0; // more safe seach algo (warning can be very expensive in case lot of ouside point) // 0 by default assert(version >=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",1); int nloc = getARGV("-n",10); string sff=getARGV("-p",""); int gmres=getARGV("-gmres",0); int nC = getARGV("-N" ,max(nloc/10,5)); bool RAS=1; int sizeoverlaps=1; // size of overlap if(mpirank==0 && verbosity) cout << " vdebug: " << vdebug << " kspilt "<< ksplit << " nloc "<< nloc << " sff "<< sff <<"."<< endl; string sPk="P2-Stokes-2gd"; func Pk=[P2,P2,P1]; //int Pknbcomp=3; func bool plotMPIall(mesh &Th,real[int] & u,string cm) {if(vdebug) PLOTMPIALLU(mesh,Pk, defPk3, Th, u, allu1, { cmm=cm,nbiso=10,fill=1,dim=3,value=1}); return 1;} func bool plotMPIallp(mesh &Th,real[int] & u,string cm) {if(vdebug) PLOTMPIALLU(mesh,Pk, defPk3, Th, u, allu2, { cmm=cm,nbiso=10,fill=1,dim=3,value=1}); return 1;} mpiComm comm(mpiCommWorld,0,0);// trick : make a no split mpiWorld int ipart= mpiRank(comm); // current partition number if(ipart==0) cout << " Final N=" << ksplit*nloc << " nloc =" << nloc << " split =" << ksplit << endl; int[int] l111=[1,1,2,1]; settt mesh Thg=square(nloc,nloc,[x,y],label=l111); mesh ThC=square(nC,nC,[x,y],label=l111);// Coarse Mesh fespace VhC(ThC,[P2,P2,P1]); // of the coarse problem.. BuildPartitioning(sizeoverlaps,mesh,Thg,Thi,aThij,RAS,pii,jpart,comm,vdebug) if(ksplit>1) { for(int jp=0;jp /* 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 */ //ff-c++-LIBRARY-dep: mpi parmetis //ff-c++-cpp-dep: #include #include #include template class ParMETIS_Op : public E_F0mps { public: Expression part; Expression pTh; Expression lparts; static const int n_name_param = 2; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; ParMETIS_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : part(param1), pTh(param2), lparts(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type ParMETIS_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"worker", &typeid(long)} }; template class ParMETIS : public OneOperator { public: ParMETIS() : OneOperator(atype(), atype*>(), atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new ParMETIS_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType ParMETIS_Op::operator()(Stack stack) const { KN* ptKN = GetAny*>((*part)(stack)); idx_t nparts = GetAny((*lparts)(stack)); Type* pt = *ptKN; long n = ptKN->n; idx_t* ptInt = reinterpret_cast(pt); std::fill_n(ptInt, n, 0); MPI_Comm comm = nargs[0] ? *((MPI_Comm*)GetAny((*nargs[0])(stack))) : MPI_COMM_WORLD; int worker = nargs[1] ? GetAny((*nargs[1])(stack)) : 0; MPI_Comm workComm = comm; if(worker == 0) MPI_Comm_size(comm, &worker); else { int size; MPI_Comm_size(comm, &size); worker = std::min(size, worker); MPI_Group worldGroup, workGroup; MPI_Comm_group(workComm, &worldGroup); int ranges[1][3]; ranges[0][0] = 0; ranges[0][1] = worker - 1; ranges[0][2] = 1; MPI_Group_range_incl(worldGroup, 1, ranges, &workGroup); MPI_Comm_create(comm, workGroup, &workComm); MPI_Group_free(&worldGroup); } int rank; MPI_Comm_rank(comm, &rank); if(rank < worker) { idx_t* vtxdist = new idx_t[worker + 1]; vtxdist[0] = 0; for(int i = 1; i < worker; ++i) vtxdist[i] = vtxdist[i - 1] + n / worker; vtxdist[worker] = n; int loc = vtxdist[rank + 1] - vtxdist[rank]; idx_t* xadg = new idx_t[loc + 1]; const Mesh& Th(*GetAny((*pTh)(stack))); idx_t nv = Th.nv; idx_t nve = Mesh::Rd::d + 1; std::vector adjncy; adjncy.reserve(loc * nve); xadg[0] = 0; for(idx_t k = vtxdist[rank]; k < vtxdist[rank + 1]; ++k) { for(idx_t j = 0; j < nve; ++j) { idx_t l = j; idx_t m = Th.ElementAdj(k, l); if(k != m && m > 0) adjncy.push_back(m); } xadg[k + 1 - vtxdist[rank]] = adjncy.size(); } #if 0 for(int i = 0; i < worker; ++i) { MPI_Barrier(workComm); if(i == rank) { for(int j = 0; j < worker + 1; ++j) { std::cout << vtxdist[j] << " "; } std::cout << std::endl; for(int j = 0; j < loc + 1; ++j) { std::cout << xadg[j] << " "; } std::cout << std::endl; for(int j = 0; j < adjncy.size(); ++j) { std::cout << adjncy[j] << " "; } std::cout << std::endl; } MPI_Barrier(workComm); } #endif idx_t wgtflag = 0; idx_t ncon = 1; idx_t edgecut; real_t* tpwgts = new real_t[nparts]; for(int i = 0; i < nparts; ++i) tpwgts[i] = 1.0 / static_cast(nparts); real_t ubvec = 1.05; idx_t* part = ptInt + vtxdist[rank]; ParMETIS_V3_PartKway(vtxdist, xadg, adjncy.data(), NULL, NULL, &wgtflag, &wgtflag, &ncon, &nparts, tpwgts, &ubvec, &wgtflag, &edgecut, part, &workComm); delete [] tpwgts; delete [] xadg; delete [] vtxdist; } MPI_Allreduce(MPI_IN_PLACE, ptInt, n, MPI_INT, MPI_SUM, comm); for(int i = n; i-- > 0; ) pt[i] = ptInt[i]; if(nargs[1] && workComm != MPI_COMM_NULL) MPI_Comm_free(&workComm); return 0L; } static void Load_Init() { Global.Add("parmetis", "(", new ParMETIS); Global.Add("parmetis", "(", new ParMETIS); Global.Add("parmetis", "(", new ParMETIS); Global.Add("parmetis", "(", new ParMETIS); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/DDM-Schwarz-Lap-2dd.edp000644 000767 000024 00000006776 13256636774 022270 0ustar00hechtstaff000000 000000 // NBPROC 10 /* a first true parallele example fisrt freefem++ Ok up to 200 proc for a Poisson equation.. See the Doc for full explaiantion F Hecht Dec. 2010. ------------------- usage : ff-mpirun [mpi parameter] DDM-Schwarz-Lap-2dd.edp [-glut ffglut] [-n N] [-k K] [-d D] [-ns] [-gmres [0|1] argument: -glut ffglut : to see graphicaly the process -n N: set the mesh cube split NxNxN -d D: set debug flag D must be one for mpiplot -k K: to refined by K all elemnt -ns: reomove script dump -gmres 0 : use iterative schwarz algo. 1 : Algo GMRES on residu of schwarz algo. 2 : DDM GMRES 3 : DDM GMRES with coarse grid preconditionner (Good one) */ load "MPICG" load "medit" load "metis" include "getARGV.idp" include "MPIplot.idp" include "DDM-Schwarz-macro.idp" //include "AddLayer2d.idp" include "DDM-funcs-v2.idp" searchMethod=0; // more safe seach algo (warning can be very expensive in case lot of ouside point) // 0 by default assert(version >=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",1); int nloc = getARGV("-n",10); string sff=getARGV("-p",""); int gmres=getARGV("-gmres",3); int nC = getARGV("-N" ,max(nloc/10,5)); int sizeoverlaps=getARGV("-overlap" ,1); ; // size of overlap bool RAS=getARGV("-RAS",1); // Global Variable .. if(mpirank==0 && verbosity) cout << " vdebug: " << vdebug << " kspilt "<< ksplit << " nloc "<< nloc << " sff "<< sff <<"."<< endl; string sPk="P2-2gd"; func Pk=P2; func bool plotMPIall(mesh &Th,real[int] & u,string cm) {if(vdebug) PLOTMPIALL(mesh,Pk, Th, u,{ cmm=cm,nbiso=20,fill=1,dim=3,value=1}); return 1;} mpiComm comm(mpiCommWorld,0,0);// trick : make a no split mpiWorld int iiipart= mpiRank(comm); // current partition number if(iiipart==0) cout << " Final N=" << ksplit*nloc << " nloc =" << nloc << " split =" << ksplit << endl; int[int] l111=[1,2,2,2]; settt mesh Thg=square(nloc,nloc*5,[x,5*y],label=l111); mesh ThC=square(nC,nC*5,[x,5*y],label=l111);// Caarse Mesh fespace VhC(ThC,P1); // of the coarse problem.. BuildPartitioning(sizeoverlaps,mesh,Thg,Thi,aThij,RAS,pii,jpart,comm,vdebug) if(ksplit>1) { for(int jp=0;jp> u[]; } else { pb; processor(0) << u[]; processor(0) >> U[]; } if (mpirank==0) plot(U,u,wait=1,fill=1); if(mpirank==0) { real ERR= int3d(TH)( square(U-u)*CHI*chi) ; cout << " ERR= " << ERR<< endl; } else { real err= int3d(th)( square(U-u)*CHI*chi) ; cout << " err= " << err<< endl; } }; if (mpirank==0) plot(U,u,ps="Uu.eps",fill=1); freefem++-3.61-1/examples++-mpi/chaleur3D-mumps.edp000644 000767 000024 00000000307 13256636774 022015 0ustar00hechtstaff000000 000000 // NBPROC 4 //ff-mpirun -np 4 chaleur3D-mumps.edp -glut ffglut -n 20 -op 1 -dt 0.01 -niter 10 load "MUMPS_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; include "Heat3d.idp" freefem++-3.61-1/examples++-mpi/ffsuperlu_dist_fileparam.txt000644 000767 000024 00000002006 13256636774 024167 0ustar00hechtstaff000000 000000 2 /* nprow : integer value */ 1 /* npcol : integer value */ distributedglobal /* matrix input : assembled, distributedglobal, distributed */ DOFACT /* Fact : DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED */ NO /* Equil : NO, YES */ YES /* ParSymbFact : NO, YES */ METIS_AT_PLUS_A /* ColPerm : NATURAL, MMD_AT_PLUS_A, MMD_ATA, METIS_AT_PLUS_A, PARMETIS, MY_PERMC */ LargeDiag /* RowPerm : NOROWPERM, LargeDiag, MY_PERMR */ 1.0 /* DiagPivotThresh : real value */ NOREFINE /* IterRefine : NOREFINE, SINGLE, DOUBLE, EXTRA */ NOTRANS /* Trans : NOTRANS, TRANS, CONJ*/ NO /* ReplaceTinyPivot : NO, YES*/ NO /* SolveInitialized : NO, YES*/ NO /* RefineInitialized : NO, YES*/ NO /* PrintStat : NO, YES*/ NOEQUIL /* DiagScale : NOEQUIL, ROW, COL, BOTH*/ freefem++-3.61-1/examples++-mpi/Stokes-v3-matrix-pastix.edp000644 000767 000024 00000005551 13256636774 023460 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "real_pastix_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; int nn=12; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); //medit("c10x10x10",Th); fespace VVh(Th,[P2,P2,P2,P1]); fespace UUh(Th,[P2,P2,P2]); fespace Uh(Th,P2); fespace Ph(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM func fup = (1-x)*(x)*y*(1-y)*16; Uh u1,u2,u3; Uh v1,v2,v3; Ph p,q; //VVh [uu1,uu2,uu3,up]; real timeI=clock(); real time1=clock(); varf vlaplace1(u1,v1) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) ) + on(2,u1=fup) + on(1,u1=0); //' for emacs varf vlaplacenull(u2,v2) = int3d(Th,qforder=3)( Grad(u2)'*Grad(v2) ) + on(2,u2=0) + on(1,u2=0); //' for emacs varf vdx(u1,q) = int3d(Th,qforder=3)( -dx(u1)*q ); varf vdy(u2,q) = int3d(Th,qforder=3)( -dy(u2)*q ); varf vdz(u3,q) = int3d(Th,qforder=3)( -dz(u3)*q ); varf vmass(p,q) = int3d(Th,qforder=3)( 1e-10*p*q ); matrix M = vmass(Ph,Ph,tgv=ttgv); matrix L1 = vlaplace1(Uh,Uh,tgv=ttgv); matrix Lnull = vlaplacenull(Uh,Uh); matrix Bx = vdx(Uh,Ph); matrix By = vdy(Uh,Ph); matrix Bz = vdz(Uh,Ph); matrix A = [ [ L1, 0, 0, Bx' ], [ 0, Lnull, 0, By' ], [ 0, 0, Lnull, Bz' ], [ Bx, By, Bz, M ] ]; //' for emacs time1=clock()-time1; real time2=clock(); real[int] b(VVh.ndof); real[int] xx(VVh.ndof); { real[int] b1 = vlaplace1(0,Uh); real[int] b2 = vlaplacenull(0,Uh); for(int ii=0; ii #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include "superlu_ddefs.h" #include "ffsuperludistoption-1.hpp" template struct SuperLUmpiDISTDriver { }; template <> struct SuperLUmpiDISTDriver { /* Driver routines */ static Dtype_t R_SLU_T() { return SLU_D;} static void pgssvx(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, SOLVEstruct_t *p9, double *p10, SuperLUStat_t *p11, int *p12) { pdgssvx( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12 ); } static void pgssvx_ABglobal(superlu_options_t *p1, SuperMatrix *p2, ScalePermstruct_t *p3, double *p4, int p5, int p6, gridinfo_t *p7, LUstruct_t *p8, double *p9, SuperLUStat_t *p10, int *p11) { pdgssvx_ABglobal( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11); } static void Print_CompRowLoc_Matrix_dist(SuperMatrix *p1) { dPrint_CompRowLoc_Matrix_dist(p1); } static void Create_CompCol_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, Stype_t p8, Dtype_t p9, Mtype_t p10) { dCreate_CompCol_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); } static void Create_CompRowLoc_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, int_t p5, int_t p6, double *p7, int_t *p8, int_t *p9, Stype_t p10, Dtype_t p11, Mtype_t p12) { dCreate_CompRowLoc_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12); } static void CompRow_to_CompCol_dist(int_t p1, int_t p2, int_t p3, double *p4, int_t *p5, int_t *p6, double **p7, int_t **p8, int_t **p9) { dCompRow_to_CompCol_dist( p1,p2,p3,p4,p5,p6,p7,p8,p9 ); } static void Create_Dense_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, double *p4, int_t p5, Stype_t p6, Dtype_t p7, Mtype_t p8) { dCreate_Dense_Matrix_dist( p1,p2,p3,p4,p5,p6,p7,p8 ); } static void Create_SuperNode_Matrix_dist(SuperMatrix *p1, int_t p2, int_t p3, int_t p4, double *p5, int_t *p6, int_t *p7, int_t *p8, int_t *p9, int_t *p10, Stype_t p11, Dtype_t p12, Mtype_t p13) { dCreate_SuperNode_Matrix_dist(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10, p11,p12,p13); } }; template class SolveSuperLUmpi : public MatriceMorse::VirtualSolver, public SuperLUmpiDISTDriver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 //mutable char equed[1]; //yes_no_t equil; mutable SuperMatrix A; NCformat *Astore; //NCformat *Ustore; //SCformat *Lstore; mutable superlu_options_t options; mutable mem_usage_t mem_usage; mutable ScalePermstruct_t ScalePermstruct; mutable LUstruct_t LUstruct; mutable SOLVEstruct_t SOLVEstruct; mutable gridinfo_t grid; string string_option; string data_option; R *a; int *asub, *xa; int_t m, n, nnz; // rajout pour // int_t nprow,npcol; /* process rows and process columns*/ int matrixdist; // type of distributed matrix static const int assembled =0; static const int distributedglobal =1; static const int distributed =2; public: SolveSuperLUmpi(const MatriceMorse &AA,string datafile, string param_char, KN &pperm_r, KN &pperm_c, MPI_Comm * mpicommw) : string_option(param_char),data_option(datafile) { R* B; //R* X; SuperLUStat_t stat; int info, ldb, nrhs=0; int i; double* berr; int iam; // Add for distributed matrix int_t m_loc, m_loc_fst, fst_row, nnz_loc, fst_nnz; R *aloc; int *asubloc, *xaloc; // End Add for distributed matrix A.Store=0; int status; /* Defaults */ nrhs = 0; /* lecture de nprow and npcol */ // Cas max deux procs nprow = 1; npcol = 1; matrixdist=0; /* set the default options */ set_default_options_dist(&options); DiagScale_t optionDiagScale; //if(verbosity > 10) print_options_dist(&options); if(!string_option.empty()) read_nprow_npcol_freefem( &string_option, &nprow, &npcol, &matrixdist); if(!string_option.empty()) read_options_freefem(&string_option,&options,&optionDiagScale); if(!data_option.empty()) read_options_superlu_datafile(&data_option,&options,&nprow, &npcol, &matrixdist,&optionDiagScale); //if(verbosity > 10) print_options_dist(&options); /* ------------------------------------------------------------ INITIALIZE THE SUPERLU PROCESS GRID. ------------------------------------------------------------*/ cout << "superlu_gridinit" <= nprow * npcol ){ //superlu_gridexit(&grid); printf("this process is not used in superlu %d \n",iam); } else { // matrix to procs and vectors if( matrixdist == assembled ){ if(!iam){ cout << "iam=" << iam << endl; printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; assert( AA.lg[n] == nnz ); printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* transform Row to Col */ // cela coute cher comme fonction // //dallocateA_dist(n, nnz, &a, &asub, &xa); //dCompRow_to_CompCol_dist(m,n,nnz,arow,asubrow,xarow,&a,&asub,&xa); dCompRow_to_CompCol_dist(m,n,nnz,AA.a,AA.cl,AA.lg,&a,&asub,&xa); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } else{ /* printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); int infobcast=MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompCol_Matrix_dist" <" required by g++ 4.7 this->Create_CompCol_Matrix_dist(&A, m, n, nnz, a, asub, xa, SLU_NC, R_SLU, SLU_GE); cout << "Fin: Create_CompCol_Matrix_dist" <::pgssvx_ABglobal(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } //########################################################## // // matrix distributed with matrix global given // //########################################################## else if( matrixdist == distributedglobal) { if(!iam){ printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* create the matrix for superlu_dist */ n=AA.n; m=AA.m; nnz=AA.nbcoef; a=AA.a; asub=AA.cl; xa=AA.lg; xa[n] = nnz; printf("\tDimension\t%dx%d\t # nonzeros %d\n", m, n, nnz); /* Broadcast matrix A to the other PEs. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( AA.cl, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( AA.lg, n+1, mpi_int_t, 0, grid.comm ); } else{ printf("\tProcess grid\t%d X %d\n", grid.nprow, grid.npcol); /* Receive matrix A from PE 0. */ MPI_Bcast( &m, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &n, 1, mpi_int_t, 0, grid.comm ); MPI_Bcast( &nnz, 1, mpi_int_t, 0, grid.comm ); /* Allocate storage for compressed column representation. */ dallocateA_dist(n, nnz, &a, &asub, &xa); MPI_Bcast( a, nnz, MPI_DOUBLE, 0, grid.comm ); MPI_Bcast( asub, nnz, mpi_int_t, 0, grid.comm ); MPI_Bcast( xa, n+1, mpi_int_t, 0, grid.comm ); } /* Compute the number of rows to be distributed to local process */ m_loc = m / (grid.nprow * grid.npcol); m_loc_fst = m_loc; /* When m / procs is not an integer */ if ((m_loc * grid.nprow * grid.npcol) != m) { /*m_loc = m_loc+1; m_loc_fst = m_loc;*/ if (iam == (grid.nprow * grid.npcol - 1)) /* last proc. gets all*/ m_loc = m - m_loc * (grid.nprow * grid.npcol - 1); } fst_row = iam * m_loc_fst; nnz_loc = xa[fst_row+m_loc]-xa[fst_row]; xaloc = (int_t*) intMalloc_dist(m_loc+1); for(int ii=0; ii < m_loc; ii++){ xaloc[ii] = xa[fst_row+ii]-xa[fst_row]; } xaloc[m_loc]=nnz_loc; fst_nnz = xa[fst_row]; aloc = (double*) doubleMalloc_dist(nnz_loc); asubloc = (int_t*) intMalloc_dist(nnz_loc); for(int ii=0; ii < nnz_loc; ii++){ aloc[ii] = a[fst_nnz+ii]; asubloc[ii] = asub[fst_nnz+ii]; } Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); cout << "Debut: Create_CompRowCol_Matrix_dist" <::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info); if(verbosity) printf("LU factorization: pdgssvx()/p returns info %d\n", info); if ( verbosity) PStatPrint(&options,&stat,&grid); PStatFree(&stat); } else if( matrixdist == distributed) { printf("in construction\n"); exit(1); } else{ printf("matrix choice for SuperLU_DIST is assembled, distributedglobal and distributed \n"); exit(1); } SUPERLU_FREE( B ); options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ nrhs=1; SUPERLU_FREE(berr); } } void Solver(const MatriceMorse &AA,KN_ &x,const KN_ &b) const { R* B; SuperLUStat_t stat; int iam; int info=0, ldb=m, nrhs=1; int i; double* berr; double ferr; double rpg, rcond; int_t m_loc,m_loc_fst,fst_row; if(n != m) exit(1); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; Dtype_t R_SLU = SuperLUmpiDISTDriver::R_SLU_T(); nrhs= 1; /* Initialize the statistics variables. */ PStatInit(&stat); iam = grid.iam; if( iam < nprow*npcol){ /* cas matrix assembled */ if( matrixdist == assembled ){ if( !(B = doubleMalloc_dist(m*nrhs)) ){ printf("probleme d allocation\n"); exit(1); } for(int ii=0; ii::pgssvx_ABglobal (&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if(verbosity) PStatPrint(&options, &stat, &grid); for(int ii=0; ii::pgssvx(&options, &A, &ScalePermstruct, B, ldb, nrhs, &grid, &LUstruct, &SOLVEstruct, berr, &stat, &info ); if(verbosity) printf("Triangular solve: dgssvx() returns info %d\n", info); if ( !(xtemp = doubleMalloc_dist(AA.n)) ){ printf("probleme d allocation de xtemp\n"); exit(1); } int disp[nprow*npcol]; MPI_Allgather(&fst_row, 1, MPI_INT, disp, 1, MPI_INT, grid.comm); int recv[nprow*npcol]; MPI_Allgather(&m_loc, 1, MPI_INT, recv, 1, MPI_INT, grid.comm); MPI_Allgatherv(B, m_loc, MPI_DOUBLE, xtemp, recv, disp, MPI_DOUBLE, grid.comm); for(int ii= 0; ii< AA.n ; ii++) x[ii] = xtemp[ii]; if(verbosity) cout << " x min max " << x.min() << " " < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverSuperLUmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverSuperLUmpi" << endl; return new SolveSuperLUmpi(*A,ds.data_filename, ds.sparams, ds.perm_r, ds.perm_c,static_cast(ds.commworld)); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool SetSuperLUmpi() { if(verbosity) cout << " SetDefault sparse solver to SuperLUmpi double" << endl; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: SuperLUmpi, defaultsolver defaultsolverSuperLUmpi" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverSuperLUmpi; //DefSparseSolver::solver =BuildSolverSuperLUmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("defaulttoSuperLUmpi","(",new OneOperator0(SetSuperLUmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/chaleur3D-hypre.edp000644 000767 000024 00000005265 13256636774 022013 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 // other load "msh3" load "medit" load "hypre_FreeFem" real ttgv=1e10; string ssparams="nprow=1, npcol="+mpisize; func bool GetNoBC(matrix & A,real[int] & in) { // def a array in such what // on unkwnon i // in[i] = 1 if no boundary condition // in[i] = 0 if boundary condition in = A.diag ; // take the daig of the matrix real tgv = in.max ; for(int i=0 ;i=3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",3); int nloc = getARGV("-n",10); string sff=getARGV("-p,",""); int gmres=getARGV("-gmres",2); bool dplot=getARGV("-dp",0); int nC = getARGV("-N" ,max(nloc/10,4)); if(mpirank==0 && verbosity) { cout << "ARGV : "; for(int i=0;i0,label=10); // non-overlapping mesh, interfaces have label 10 int nnn = sizeoverlaps*2;// to be sure AddLayers(Thg,suppi[],nnn,unssd[]); // see above ! suppi and unssd are modified unssd[] *= nnn; // to put value nnn a 0 real nnn0 = nnn - sizeoverlaps + 0.001 ; Thi=trunc(Thg,unssd>nnn0 ,label=10); // overlapping mesh, interfaces have label 10 settt fespace Vhi(Thi,P1); int npij=npart; Vhi[int] pij(npij);// local partition of unit + pii Vhi pii; real nnn1= + 0.001 ; { /* construction of the partition of the unit, let phi_i P1 FE function 1 on Thin and zero ouside of Thi and positive the partition is build with $$ p_i = phi_i/ \sum phi_i to build the partition of one domain i we nned to find all j such that supp(phi_j) \cap supp(phi_j) is not empty <=> int phi_j */ // build a local mesh of thii such that all compuation of the unit partition are // exact in thii mesh Thii=trunc(Thg,unssd>nnn1 ,label=10); // overlapping mesh, interfaces have label 10 { // find all j mes (supp(p_j) \cap supp(p_i)) >0 // compute all phi_j on Thii // remark supp p_i include in Thi // fespace Phii(Thii,P0); fespace Vhii(Thii,P1); Vhi sumphi=0; jpart=0; njpart=0; int nlayer=RAS?1:sizeoverlaps; if(ipart==0) cout <<" nlayer=" << nlayer << endl; pii= max(unssd-nnn+nlayer,0.)/nlayer; if(dplot) plot(pii,wait=1,cmm=" 0000"); sumphi[] += pii[]; if(dplot) plot(sumphi,wait=1,cmm=" summ 0000"); Vhii phii=0; real epsmes=1e-10*Thii.area; for (int i=0;i 0.5) { AddLayers(Thii,suppii[],nlayer,phii[]); assert(phii[].min >=0); real interij = int2d(Thi)( phii); if(interij>epsmes) { pij[njpart]=abs(phii); if(vdebug>2) cout << " ***** " << int2d(Thi)(real(pij[njpart])<0) << " " <2) cout << " sum min " < 1.-1e-6 && sumphi[].max< 1.+1e-6); // verification }}// (Thii is remove here) // end of the construction of the local partition of the unity ... // on Thi ... // ----------------------------------------------------------------- if(ipart==0) cout << " *** end build partition " << endl; // computation of number of intersection .. // ------------------------------------------ // here pii and the pij is the locate partition of the unite on // Thi ( mesh with overlap ).... //Thi=splitmesh(Thi,2); if(dplot ) { plot(Thi,wait=1); for(int j=0;j we have to recive // data on intersection of the support of pij[0] and pij[j] settt if(vdebug) plotMPIall(Thi,pii[],"pi_i"); mesh[int] aThij(njpart); matrix Pii; matrix[int] sMj(njpart); // M of send to j matrix[int] rMj(njpart); // M to recv from j fespace Whi(Thi,Pk); mesh Thij=Thi; fespace Whij(Thij,Pk);// // construction of the mesh intersect i,j part for(int jp=0;jp1e-6,label=10); // mesh of the supp of pij for(int jp=0;jp s Whij rMj[jp] = interpolate(Whij,Whi,t=1); // Whji -> Whi if(vdebug>10) { {Whi uuu=1;Whij vvv=-1; vvv[]+=I*uuu[]; cout << jp << " %%% " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);} {Whi uuu=1;Whij vvv=-1; vvv[]+=rMj[jp]'*uuu[]; cout << jp << " ### " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);}} }} if(ipart==0) cout << " *** end build transfert matrix " << endl; // alloc array of send and recv data .. InitU(njpart,Whij,Thij,aThij,Usend) // initU(n,Vh,Th,aTh,U) InitU(njpart,Whij,Thij,aThij,Vrecv) // ... if(ipart==0) cout << " *** end init data for send/revc " << endl; Whi ui,vi; func bool Update(real[int] &ui, real[int] &vi) { for(int j=0;j I ~ - C1AC2A +C1A +C2A // New Prec P= C1+C2 - C1AC2 = C1(I- A C2) +C2 // ( C1(I- A C2) +C2 ) Uo // V = - C2*Uo // .... real[int] V(U.n); CoarseSolve(V,U,comm); V = -V; // -C2*Uo U += Ai*V; // U = (I-A C2) Uo real[int] b= onG10 ? 0. : U; U = Ai^-1*b; // ( C1( I -A C2) Uo V = U -V; // Update(V,U); return U; } func real[int] DJ0(real[int]& U) { ++kiter; real[int] V(U.n); real[int] b= onG .* U; b = onG ? b : Bi ; V = Ai^-1*b; Update(V,U); V -= U; return V; } Whi u=0,v; { // verification..... Whi u=1,v; Update(u[],v[]); u[]-=v[]; assert( u[].linfty<1e-6); } settt u[]=vBC(0,Whi,tgv=1); // set u with tge BC value ... real epss=1e-6; int rgmres=0; if(gmres==1) { rgmres=MPIAffineGMRES(DJ0,u[],veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); real[int] b= onG .* u[]; b = onG ? b : Bi ; v[] = Ai^-1*b; Update(v[],u[]); } else if(gmres==2) rgmres= MPILinearGMRES(DJ,precon=PDJ,u[],Bi,veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); else if(gmres==3) rgmres= MPILinearGMRES(DJ,precon=PDJC,u[],Bi,veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); else // algo Shwarz for demo ... for(int iter=0;iter <10; ++iter) { real[int] b= onG .* u[]; b = onG ? b : Bi ; v[] = Ai^-1*b; Update(v[],u[]); if(vdebug) plotMPIall(Thi,u[],"u-"+iter); v[] -= u[]; real err = v[].linfty; real umax = u[].max; real[int] aa=[err,umax], bb(2); mpiAllReduce(aa,bb,comm,mpiMAX); real errg = bb[0]; real umaxg = bb[1]; if(ipart==0) cout << ipart << " err = " << errg << " u. max " << umaxg << endl; if(errg< 1e-5) break; } if(vdebug) plotMPIall(Thi,u[],"u-final"); settt real errg =1,umaxg; { real umax = u[].max,umaxg; real[int] aa=[umax], bb(1); mpiAllReduce(aa,bb,comm,mpiMAX); errg=bb[0]; if(ipart==0) cout << " umax global = " << bb[0] << " Wtime = " << (ttt[ittt-1]-ttt[ittt-2]) << " s " << " " << kiter << endl; } if(sff != "") { ofstream ff(sff+".txt",append); cout << " ++++ " ; cout << mpirank <<"/" << mpisize << " k=" << ksplit << " n= " << nloc << " " << sizeoverlaps << " it= " << kiter ; for (int i=1; i=0;--i) if(ARGV[i]==after) { ret=++i; break;} if(ARGV.n0) d=strtol(ARGV[k]); return d; } func real getARGV(int n,real default) { real d=default; int k=usedARGV(n); if(k>0) d=strtod(ARGV[k]); return d; } func string getARGV(int n,string default) { string d=default; int k=usedARGV(n); if(k>0) d=ARGV[k]; return d; } func int getARGV(string after,int default) { int d=default; int k=usedARGV(after); if(k>0) d=strtol(ARGV[k]); return d; } func real getARGV(string after,real default) { real d=default; int k=usedARGV(after); if(k>0) d=strtod(ARGV[k]); return d; } func string getARGV(string after,string default) { string d=default; int k=usedARGV(after); if(k>0) d=ARGV[k]; return d; } /* cout << getARGV(1,100) << endl; cout << getARGV(2,200.) << endl; cout << getARGV(3,"300.000") << endl; cout << getARGV("-n"," xxx") << endl; */ ENDIFMACROfreefem++-3.61-1/examples++-mpi/MUMPS_FreeFem.cpp000644 000767 000024 00000212022 13312446271 021327 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // //ff-c++-LIBRARY-dep:mumps ptscotch scotch metis parmetis scalapack blas mpifc fc mpi pthread //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 */ #include #include using namespace std; #ifdef _WIN32 // ALH - this activates the Windows DLL default export mechanism __declspec(dllexport) int not_used; // FFCS - 23/4/13 - instanciate some global symbols which are not found by default in MS MPI Fortran libraries MPI_Fint* _imp__MPI_F_STATUS_IGNORE; MPI_Fint* _imp__MPI_F_STATUSES_IGNORE; #endif #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include "dmumps_c.h" #include "zmumps_c.h" // read options for MUMPS in freefem++ int s_(char* str, const char* cmp[]) { int i = 0; while( cmp[i] != 0){ if( strcmp(str, cmp[i]) == 0){ //cout << *str << " return" << i << endl; return i+1 ; } i++; } //cout << *str << " return 0" << endl; return 0; } void read_options_freefem(string *string_option, int *SYM, int *PAR){ static const char* comp[] = {"SYM", "PAR", 0}; char data[string_option->size()+1]; strcpy( data, string_option->c_str()); cout << "data=" << data << endl; char * tictac; tictac = strtok(data," =,\t\n"); cout << "tictac=" << data << endl; while(tictac != NULL){ int id_option = s_(tictac, comp); tictac = strtok(NULL," =,\t\n"); int val_options; switch (id_option) { case 1 : // SYM *SYM = atoi(tictac); // strtol ??? if(*SYM != 0 && *SYM !=1) cout << "SYM must be equal to 1 or 0 for MUMPS" << endl; break; case 2: // PAR *PAR = atoi(tictac); if(*PAR != 0 && *PAR !=1) cout << "PAR must be equal to 1 or 0" << endl; //strtol ??? break; case 0: // Equivalent of case default break; } tictac = strtok(NULL," =,\t\n"); } } class dSolveMUMPSmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 mutable MPI_Comm comm; double *a; int *irn, *jcn; int n, m, nz; // parameter MUMPS KN_ perm_r; /* row permutations from partial pivoting */ KN_ perm_c; KN_ scale_r; KN_ scale_c; string string_option; string data_option; int SYM; int PAR; int myid; // distribuer int nz_loc; int *jcn_loc, *irn_loc; double *a_loc; static const int JOB_INIT=-1; static const int JOB_END=-2; static const int USE_COMM_WORLD= -987654; // variable reel mutable DMUMPS_STRUC_C id; #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ #define CNTL(I) cntl[(I)-1] /* macro s.t. indices match documentation */ #define RINFOG(I) rinfog[(I)-1] /* macro s.t. indices match documentation */ #define INFOG(I) infog[(I)-1] /* macro s.t. indices match documentation */ public: dSolveMUMPSmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string param_string, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN &pperm_c, KN &pscale_r,KN &pscale_c, MPI_Comm * mpicommw ) : eps(epsilon),epsr(0), tgv(ttgv), string_option(param_string), data_option(datafile), perm_r(pperm_r), perm_c(pperm_c), tol_pivot_sym(pivot_sym),tol_pivot(pivot), scale_r(pscale_r), scale_c(pscale_c) { long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); int dataint[40]; double datadouble[15]; int ierr; if(mpicommw==0){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ ierr = MPI_Comm_rank(comm, &myid); if( myid ==0){ n = AA.n; m = AA.m; nz = AA.nbcoef; MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } else{ MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } if( !(param_int==NULL) ) assert( param_int.N() == 42); if( !(param_double==NULL) ) assert( param_double.N() == 15); if(perm_r) assert( perm_r.N() == n); if(perm_c) assert( perm_c.N() == m); if(scale_r) assert( scale_r.N() == n); if(scale_c) assert( scale_c.N() == m); if( n != m ) cerr << "only square matrix are supported by MUMPS" << endl; // initialisation par defaut SYM=0; PAR=1; /* if(!string_option.empty()) { if(myid==0){ cout << "read string option" <2) cout << " MUMPS_FreeFem init parameter :: PAR & SYM " << PAR << " " << SYM << endl; dmumps_c(&id); if(verbosity>10) cout << "fin init parameter" << endl; /* set parameter of mumps */ if( !(param_int == NULL) || !(param_double == NULL) ){ if(!data_option.empty()){ printf("MUMPS ERROR: parameters are given on the file %s and in the array lparams and dparams => double definition of parameters.",data_option.c_str()); exit(1); } if( !(param_int == NULL) ){ cout << "internal parameter" << endl; for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = param_int[ii+2]; } else{ // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } if( !(param_double == NULL) ){ cout << "internal parameter" << endl; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = param_double[ii]; } } else if(!data_option.empty()){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = dataint[ii]; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = datadouble[ii]; } else{ // parameter by default if(verbosity>10) cout << "default parameter" << endl; id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } // uniquement donner au host if(myid==0) { if( !(perm_r==NULL) && id.ICNTL(7)==1){ for(int ii=0; ii id.ICNTL(5) = 0; \n"); id.ICNTL(5) = 0; exit(1); } if (myid == 0) { id.n = n; id.nz =nz; //id.irn=irn; id.jcn=jcn; //id.a = a; //id.rhs = rhs; } if( id.ICNTL(18) == 0) { // CASE:: NON DISTRIBUTED MATRIX if (myid == 0) { // nouveau a=AA.a; // ATTENTION // AA.cl :: indice des colonnes (exacte) et AA.lg :: indice des lignes // index of row and colummn by 1 jcn = AA.cl; for(int ii=0; ii 1) cout <<"id.ICNTL(18) = 1 || id.ICNTL(18) == 2 "<< endl; // ATTENTION // AA.cl :: indice des colonnes (exacte) et AA.lg :: indice des lignes // index of row and column by 1 if (myid == 0) { // new host process jcn = AA.cl; for(int ii=0; ii 0){ id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } if( myid == 0){ //free( irn_loc ); //free( jcn_loc ); //free( a_loc ); free( nz_loc_procs ); free( fst_nz_procs ); free( irn_g ); free( jcn_g ); free( a_g ); } } if( PAR == 1 ){ int *nz_loc_procs; int *fst_nz_procs; int *irn_g; int *jcn_g; double *a_g; int commSize; MPI_Comm_size(comm,&commSize); if(myid==0){ // allocation des differents tableaux nz_loc_procs = (int*) malloc ( commSize*sizeof(int) ); for(int ii=0; ii pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } } if(PAR == 1){ //============================== // besoin de irn, jcn, AA.a //============================== int commSize; ierr=MPI_Comm_size(comm,&commSize); int m_loc_fst = m/commSize; int m_loc; if( myid == commSize-1 && ( m_loc_fst*commSize != m ) ) m_loc = m-m_loc_fst*( commSize-1 ); else m_loc = m_loc_fst; int fst_row= myid*m_loc_fst; nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // allocation des tableaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (double*) malloc(sizeof(double)*nz_loc); int fst_nnz = AA.lg[fst_row]; for(int ii=0; ii < nz_loc; ii++){ a_loc[ii] = AA.a[fst_nnz+ii]; jcn_loc[ii] = AA.cl[fst_nnz+ii]; // jcn=AA.cl a ete augmenter de 1 avant => pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = a_loc; } /* Call the MUMPS package. */ // Factorisation id.job=2; dmumps_c(&id); } } if( id.ICNTL(18) == 3 ) { // indices et colonnes de la matrice // // Cas Matrice parallele :: // // ======================== // // // Cas stockage Morse parallele // m_loc = AA.m_loc; // Nombre de lignes prise en compte // nz_loc = AA.nbcoef_loc; // Nombre de coefficients non nulles // // indice des colonnes // jcn_loc = AA.cl_loc; // indices des colonnes dans la matrice locale // // if( !(irn_loc = (int*) malloc(sizeof(int)*nz_loc)) ){ // printf("problem allocation jcn "); // exit(1); // } // assert(AA.lg_loc[nrow_loc] == nz_loc); // for(int ii=0; ii< nrow_loc; ii++) // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1] = ii+1; // // a_loc=AA.a_loc; // // Pas de matrice parallele ==> utilisation astuce de SuperLU // Matrice :: distribution bloc continue de lignes :: voir SuperLU // Attention :: performance ??? // //================== // // pour un proc : // // a: AA.a[fstow] , ..., AA.a[fstrow+nz_loc-1] // // jcn: AA.cl[fstrow] , ..., AA.cl[fstrow+nz_loc-1] // // irn: AA.lg[fstrow] , ..., AA.lg[fstrow+m_loc] // //================== // // apres reception : // // irn_reel: // // int jj=0, // // do ii=0,m_loc-1 // // do ii1=irn_donnee[ii],irn_donnee[ii+1]-1 // // irn_reel[jj] = fst_row+ii+1; // // jj++ // // end do // // end do // //================= cout <<"id.ICNTL(18) = 3, PAR="<< PAR << endl; if(PAR == 0){ // if(myid != 0) { // int commSize; // ierr=MPI_Comm_size(comm,&commSize); // commSize=commSize-1; // int myidpar=myid-1; // int m_loc_fst; // m_loc_fst= m/commSize; // int m_loc; // if( myidpar == commSize-1 && ( m_loc_fst*commSize != m ) ) // m_loc = m-m_loc_fst*( commSize-1 ); // else // m_loc = m_loc_fst; // int fst_row; // fst_row= myidpar*m_loc_fst; // nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // // allocation des tableaux // irn_loc = (int*) malloc(sizeof(int)*nz_loc); // jcn_loc = (int*) malloc(sizeof(int)*nz_loc); // a_loc = (double*) malloc(sizeof(double)* nz_loc); // int fst_nnz; // fst_nnz = AA.lg[fst_row]; // for(int ii=0; ii < nz_loc; ii++){ // a_loc[ii] = AA.a[fst_nnz+ii]; // jcn_loc[ii] = AA.cl[fst_nnz+ii]+1; // } // for(int ii=fst_row; ii< fst_row+m_loc; ii++){ // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1-fst_nnz] = ii+1; // } // id.nz_loc = nz_loc; // id.irn_loc = irn_loc; // id.jcn_loc = jcn_loc; // id.a_loc = a_loc; // } // definition de variables int commSize; int m_loc_fst; int m_loc; int fst_row; int *nz_loc_procs; int *fst_nz_procs; int *m_loc_procs; int *fst_row_procs; double *tab_a; int *tab_cl; int *tab_lg; int *tab_lg_loc; MPI_Comm_size(comm,&commSize); if( myid !=0){ int commSizemm; int myidpar=myid-1; commSizemm = commSize-1; m_loc_fst= m/commSizemm; if( myidpar == commSizemm-1 && ( m_loc_fst*commSizemm != m ) ) m_loc = m-m_loc_fst*( commSizemm-1 ); else m_loc = m_loc_fst; if(verbosity > 5){ fst_row = myidpar*m_loc_fst; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } } if( myid ==0){ int commSizemm; commSizemm = commSize-1; m_loc_fst= m/commSizemm; fst_row_procs = (int* ) malloc( commSize*sizeof(int) ); m_loc_procs = (int* ) malloc( commSize*sizeof(int) ); fst_nz_procs = (int* ) malloc( commSize*sizeof(int) ); nz_loc_procs = (int* ) malloc ( commSize*sizeof(int) ); fst_row_procs [0] = 0; m_loc_procs [0] = 0; for( int ii= 1; ii 5){ cout << "after scatter " << myid << endl; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } // allocation des tableaux locaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (double*) malloc(sizeof(double)*nz_loc); tab_lg_loc = (int*) malloc(sizeof(int)*(m_loc) ); MPI_Scatterv( tab_a, nz_loc_procs, fst_nz_procs, MPI_DOUBLE, a_loc, nz_loc, MPI_DOUBLE, 0, comm); MPI_Scatterv( tab_cl, nz_loc_procs, fst_nz_procs, MPI_INT, jcn_loc, nz_loc, MPI_INT, 0, comm); MPI_Scatterv( tab_lg, m_loc_procs, fst_row_procs, MPI_INT, tab_lg_loc, m_loc, MPI_INT, 0, comm); int jj=0; for(int ii=0; ii &AA,KN_ &x,const KN_ &b) const { long int starttime,finishtime; long int timeused; ///////////////////////////// double *rhs; int job; if(verbosity) starttime = clock(); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // indices des colonnes commence par 1 avec mumps // et 0 dans freefem ==> renumerotation if(jcn != NULL) for(int ii=0; ii renumerotation if(jcn != NULL) for(int ii=0; ii1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Solving ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if( verbosity ){ if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "MUMPS : time solve step :: " << timeused << " ms, Mem usage " << id.INFOG(16) << "Mb \n"; printf("=====================================================\n"); } } } ~dSolveMUMPSmpi() { if(verbosity>10) cout << "~SolveMUMPS S:" << endl; id.job=JOB_END; dmumps_c(&id); /* Terminate instance */ if( irn != NULL){ free(irn); irn=NULL; } /* free(jcn_loc); free(irn_loc); free(a_loc); */ } void addMatMul(const KN_ & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; static mumps_double_complex *mumps_dc(Complex *p) { return (mumps_double_complex *) (void *) p;} static Complex *inv_mumps_dc(mumps_double_complex *p) { return (Complex *) (void *) p;} class zSolveMUMPSmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 mutable MPI_Comm comm; Complex *a; int *irn, *jcn; int n, m, nz; // parameter MUMPS KN perm_r; /* row permutations from partial pivoting */ KN perm_c; KN scale_r; KN scale_c; string string_option; string data_option; int SYM; int PAR; int myid; // distribuer int nz_loc; int *jcn_loc, *irn_loc; Complex *a_loc; static const int JOB_INIT=-1; static const int JOB_END=-2; static const int USE_COMM_WORLD= -987654; // variable complex mutable ZMUMPS_STRUC_C id; /* variable d'informations */ #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ #define CNTL(I) cntl[(I)-1] /* macro s.t. indices match documentation */ #define RINFOG(I) rinfog[(I)-1] /* macro s.t. indices match documentation */ #define INFOG(I) infog[(I)-1] /* macro s.t. indices match documentation */ public: zSolveMUMPSmpi(const MatriceMorse &AA,int strategy,double ttgv, double epsilon, double pivot,double pivot_sym, string param_string, string datafile, KN ¶m_int, KN ¶m_double, KN &pperm_r, KN_ &pperm_c, KN &pscale_r,KN &pscale_c, MPI_Comm * mpicommw) : eps(epsilon),epsr(0), tgv(ttgv), string_option(param_string), data_option(datafile), perm_r(pperm_r), perm_c(pperm_c), tol_pivot_sym(pivot_sym),tol_pivot(pivot), scale_r(pscale_r), scale_c(pscale_c) { long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); int dataint[40]; double datadouble[15]; int ierr; if(mpicommw==0){ comm=MPI_COMM_WORLD; } else comm= *mpicommw; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ ierr = MPI_Comm_rank(comm, &myid); if( myid ==0){ n = AA.n; m = AA.m; nz = AA.nbcoef; MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } else{ MPI_Bcast( &n, 1, MPI_INT, 0, comm ); MPI_Bcast( &m, 1, MPI_INT, 0, comm ); MPI_Bcast( &nz, 1, MPI_INT, 0, comm ); } if( !(param_int==NULL) ) assert( param_int.N() == 42); if( !(param_double==NULL) ) assert( param_double.N() == 15); if(pperm_r) assert( perm_r.N() == n); if(pscale_r) assert( scale_r.N() == n+m ); if(pscale_c) assert( scale_c.N() == n+m ); if( n != m ) cerr << "only square matrix are supported by MUMPS" << endl; /* ------------------------------------------------------------ INITIALIZE THE MUMPS PROCESS GRID. ------------------------------------------------------------*/ // initialisation par defaut SYM=0; PAR=1; // if(!string_option.empty()) // { // read_options_freefem(&string_option,&SYM,&PAR); // } if( !(param_int==NULL) ){ SYM = param_int[0]; PAR = param_int[1]; } else if(!data_option.empty()) { if(myid==0){ char * retfile= new char[data_option.size()+1]; strcpy(retfile, (&data_option)->c_str()); printf("read data from file %s\n", retfile); FILE *pFile=fopen(retfile,"rt"); int i_data=0; int d_data=0.; char data[256]; char *tictac; fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); SYM = atoi(tictac); fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); PAR = atoi(tictac); while( !feof(pFile) && i_data < 40){ fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); dataint[i_data] = (int)atol(tictac); i_data++; } assert(i_data == 40); while( !feof(pFile) && d_data < 15){ fgets(data,256,pFile); tictac = strtok(data," /!#\t\n"); datadouble[d_data] = (double)atof(tictac); d_data++; } assert(d_data == 15); fclose(pFile); delete [] retfile; MPI_Bcast( &SYM, 1, MPI_INT, 0, comm ); MPI_Bcast( &PAR, 1, MPI_INT, 0, comm ); MPI_Bcast( dataint, 40, MPI_INT, 0, comm ); MPI_Bcast( datadouble, 15, MPI_DOUBLE, 0, comm ); } else{ MPI_Bcast( &SYM, 1, MPI_INT, 0, comm ); MPI_Bcast( &PAR, 1, MPI_INT, 0, comm ); MPI_Bcast( dataint, 40, MPI_INT, 0, comm ); MPI_Bcast( datadouble, 15, MPI_DOUBLE, 0, comm ); } } /* Initialize a MUMPS instance. Use comm */ id.job=JOB_INIT; id.par=PAR; id.sym=SYM; id.comm_fortran=(MUMPS_INT) MPI_Comm_c2f(comm); zmumps_c(&id); /* set parameter of mumps */ if( !(param_int==NULL) || !(param_double==NULL) ){ if(!data_option.empty()){ printf("read option before with the file %s\n",data_option.c_str()); exit(1); } if( !(param_int==NULL) ){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = param_int[ii+2]; } else // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; if( !(param_double==NULL) ) for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = param_double[ii]; } else if(!data_option.empty()){ for(int ii=0; ii<40; ii++) id.ICNTL(ii+1) = dataint[ii]; for(int ii=0; ii<15; ii++) id.CNTL(ii+1) = datadouble[ii]; } else{ // parameter by default id.ICNTL(1)=-1; id.ICNTL(2)=-1; id.ICNTL(3)=-1; id.ICNTL(4)=0; } // uniquement donner au host if(myid==0){ if( !(perm_r==NULL) && id.ICNTL(7)==1){ for(int ii=0; ii pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = mumps_dc(a_loc); } } if(PAR == 1){ int commSize; ierr=MPI_Comm_size(comm,&commSize); int m_loc_fst = m/commSize; int m_loc; if( myid == commSize-1 && ( m_loc_fst*commSize != m ) ) m_loc = m-m_loc_fst*( commSize-1 ); else m_loc = m_loc_fst; int fst_row= myid*m_loc_fst; nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // allocation des tableaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (Complex*) malloc(sizeof(Complex)*nz_loc); int fst_nnz = AA.lg[fst_row]; for(int ii=0; ii < nz_loc; ii++){ a_loc[ii] = AA.a[fst_nnz+ii]; jcn_loc[ii] = AA.cl[fst_nnz+ii]; // jcn=AA.cl a ete augmenter de 1 avant => pas ajouter 1 } for(int ii=fst_row; ii< fst_row+m_loc; ii++){ for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) irn_loc[ii1-fst_nnz] = ii+1; } id.nz_loc = nz_loc; id.irn_loc = irn_loc; id.jcn_loc = jcn_loc; id.a_loc = mumps_dc(a_loc); } /* Call the MUMPS package. */ // Factorisation id.job=2; zmumps_c(&id); } } if( id.ICNTL(18) == 3 ) { // indices et colonnes de la matrice // // Cas Matrice parallele :: // // ======================== // // // Cas stockage Morse parallele // m_loc = AA.m_loc; // Nombre de lignes prise en compte // nz_loc = AA.nbcoef_loc; // Nombre de coefficients non nulles // // indice des colonnes // jcn_loc = AA.cl_loc; // indices des colonnes dans la matrice locale // // if( !(irn_loc = (int*) malloc(sizeof(int)*nz_loc)) ){ // printf("problem allocation jcn "); // exit(1); // } // assert(AA.lg_loc[nrow_loc] == nz_loc); // for(int ii=0; ii< nrow_loc; ii++) // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1] = ii+1; // // a_loc=AA.a_loc; // // Pas de matrice parallele ==> utilisation astuce de SuperLU // Matrice :: distribution bloc continue de lignes :: voir SuperLU // Attention :: performance ??? cout <<"id.ICNTL(18) = 3, PAR="<< PAR << endl; if(PAR == 0){ // if(myid !=0) { // int commSize; // ierr=MPI_Comm_size(comm,&commSize); // commSize=commSize-1; // int myidpar=myid-1; // int m_loc_fst; // m_loc_fst= m/commSize; // int m_loc; // if( myidpar == commSize-1 && ( m_loc_fst*commSize != m ) ) // m_loc = m-m_loc_fst*( commSize-1 ); // else // m_loc = m_loc_fst; // // int fst_row; // fst_row= myidpar*m_loc_fst; // nz_loc = AA.lg[fst_row+m_loc]-AA.lg[fst_row]; // // // allocation des tableaux // irn_loc = (int*) malloc(sizeof(int)*nz_loc); // jcn_loc = (int*) malloc(sizeof(int)*nz_loc); // a_loc = (Complex*) malloc(sizeof(Complex)* nz_loc); // // int fst_nnz; // fst_nnz = AA.lg[fst_row]; // for(int ii=0; ii < nz_loc; ii++){ // a_loc[ii] = AA.a[fst_nnz+ii]; // jcn_loc[ii] = AA.cl[fst_nnz+ii]+1; // } // for(int ii=fst_row; ii< fst_row+m_loc; ii++){ // for(int ii1=AA.lg[ii]; ii1 < AA.lg[ii+1]; ii1++ ) // irn_loc[ii1-fst_nnz] = ii+1; // } // id.nz_loc = nz_loc; // id.irn_loc = irn_loc; // id.jcn_loc = jcn_loc; // id.a_loc = mumps_dc(a_loc); // } // definition de variables int commSize; int m_loc_fst; int m_loc; int fst_row; int *nz_loc_procs; int *fst_nz_procs; int *m_loc_procs; int *fst_row_procs; Complex *tab_a; int *tab_cl; int *tab_lg; int *tab_lg_loc; MPI_Comm_size(comm,&commSize); if( myid !=0){ int commSizemm; int myidpar=myid-1; commSizemm = commSize-1; m_loc_fst= m/commSizemm; if( myidpar == commSizemm-1 && ( m_loc_fst*commSizemm != m ) ) m_loc = m-m_loc_fst*( commSizemm-1 ); else m_loc = m_loc_fst; if(verbosity > 5){ fst_row = myidpar*m_loc_fst; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } } if( myid ==0){ int commSizemm; commSizemm = commSize-1; m_loc_fst= m/commSizemm; fst_row_procs = (int* ) malloc( commSize*sizeof(int) ); m_loc_procs = (int* ) malloc( commSize*sizeof(int) ); fst_nz_procs = (int* ) malloc( commSize*sizeof(int) ); nz_loc_procs = (int* ) malloc ( commSize*sizeof(int) ); fst_row_procs [0] = 0; m_loc_procs [0] = 0; for( int ii= 1; ii 5){ cout << "after scatter " << myid << endl; cout << " myid = " << myid << endl; cout <<" m_loc = " << m_loc << endl; cout <<" fst_row = " << fst_row << endl; } // allocation des tableaux locaux irn_loc = (int*) malloc(sizeof(int)*nz_loc); jcn_loc = (int*) malloc(sizeof(int)*nz_loc); a_loc = (Complex*) malloc(2*sizeof(double)*nz_loc); tab_lg_loc = (int*) malloc(sizeof(int)*(m_loc) ); MPI_Scatterv( tab_a, nz_loc_procs, fst_nz_procs, MPI_DOUBLE_COMPLEX, a_loc, nz_loc, MPI_DOUBLE_COMPLEX, 0, comm); MPI_Scatterv( tab_cl, nz_loc_procs, fst_nz_procs, MPI_INT, jcn_loc, nz_loc, MPI_INT, 0, comm); MPI_Scatterv( tab_lg, m_loc_procs, fst_row_procs, MPI_INT, tab_lg_loc, m_loc, MPI_INT, 0, comm); int jj=0; for(int ii=0; ii renumerotation if( jcn != NULL ) for(int ii=0; ii1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Factorisation ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if( verbosity){ if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << "MUMPS : time factorisation :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { long int starttime,finishtime; long int timeused; //*******************************************************************// // depend pas de la forme de la matrice: distribuer ou assembler Complex *rhs; int job; if(verbosity) starttime = clock(); ffassert ( &x[0] != &b[0]); epsr = (eps < 0) ? (epsr >0 ? -epsr : -eps ) : eps ; // indices des colonnes commence par 1 avec mumps // et 0 dans freefem ==> renumerotation if(jcn != NULL) for(int ii=0; ii renumerotation if(jcn != NULL) for(int ii=0; ii 1){ /* information given by mumps*/ int Rinfo=20; int Sinfo=40; // in Freefem++ we give only global information if(myid == 0){ printf("Global Output Information of MUMPS: RINFOG and INFOG \n"); printf("============= After Solving ==================\n"); for(int ii=0; ii< Rinfo; ii++) printf( "RINFOG[%d]= %f \n", ii, id.RINFOG(ii+1) ); printf("=====================================================\n"); for(int ii=0; ii< Sinfo; ii++) printf( "INFOG[%d]= %d \n", ii, id.INFOG(ii+1) ); printf("=====================================================\n"); } } if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " MUMPS : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverMUMPSmpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverMUMPS" << endl; return new dSolveMUMPSmpi(*A,ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.sparams, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c, ds.scale_r, ds.scale_c,(MPI_Comm *)ds.commworld); } MatriceMorse::VirtualSolver * BuildSolverMUMPSmpi(DCL_ARG_SPARSE_SOLVER(Complex,A)) { if(verbosity>9) cout << " BuildSolverMUMPS" << endl; return new zSolveMUMPSmpi(*A,ds.strategy, ds.tgv, ds.epsilon, ds.tol_pivot, ds.tol_pivot_sym, ds.sparams, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c, ds.scale_r, ds.scale_c,(MPI_Comm *)ds.commworld); } /* class Init { public: Init(); };*/ // the 2 default sparse solver double and complex static DefSparseSolver::SparseMatSolver SparseMatSolver_R ; static DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver static TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool SetMUMPSmpi() { if(verbosity) cout << " SetDefault sparse solver to MUMPSmpi" << endl; DefSparseSolver::solver =BuildSolverMUMPSmpi; DefSparseSolver::solver =BuildSolverMUMPSmpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } //LOADINIT(Init); static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: MUMPS , defaultsolver defaultsolverMUMPS " << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverMUMPSmpi; DefSparseSolver::solver =BuildSolverMUMPSmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); if(! Global.Find("defaulttoMUMPS").NotNull() ) Global.Add("defaulttoMUMPS","(",new OneOperator0(SetMUMPSmpi)); } void ffinit() { SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: MUMPS , defaultsolver defaultsolverMUMPS " << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverMUMPSmpi; DefSparseSolver::solver =BuildSolverMUMPSmpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); if(! Global.Find("defaulttoMUMPS").NotNull() ) Global.Add("defaulttoMUMPS","(",new OneOperator0(SetMUMPSmpi)); } #include "InitFunct.hpp" addingInitFunct FFinit(100,ffinit,"MUMPS_FreeFem"); LOADFUNC(Load_Init); freefem++-3.61-1/examples++-mpi/real_pastix_FreeFem.cpp000644 000767 000024 00000052761 13256636774 022775 0ustar00hechtstaff000000 000000 // ORIG-DATE: 02/2009 // -*- Mode : c++ -*- // // SUMMARY : // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : Jacques Morice // E-MAIL : jacques.morice@ann.jussieu.fr // //ff-c++-LIBRARY-dep: double_pastix blas parmetis metis scotch mpi fc //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 */ /* Interface entre freefem++ et pastix */ #include #include using namespace std; #include "rgraph.hpp" #include "error.hpp" #include "AFunction.hpp" //#include "lex.hpp" #include "MatriceCreuse_tpl.hpp" #include #include #include #include #include #include #include #include // #include // #include // #include // #include // //#include // #include // #include // #include // #include "mpi.h" // #include // #include "pastix.h" // #include "cscd_utils.h" // #include "read_matrix.h" #include #ifdef __cplusplus extern "C" { #endif #include "pastix.h" //#include "cscd_utils.h" #ifdef __cplusplus } #endif //#include "read_matrix.h" #undef memFree_null #define memFree_null(x) {if (x ==NULL) {fprintf(stdout,"%s:%d freeing NULL\n",__FILE__,__LINE__);} free(x); x=NULL;} #define STR_SIZE 256 static pastix_int_t * pastixint(int * ii){ return (pastix_int_t*) (void *) ii;} static pastix_float_t * pastixfloat(double * ii){ return (pastix_float_t*) (void *) ii;} typedef struct pastix_param { pastix_data_t *pastix_data; /*Pointer used by PaStiX to keep information alive between calls */ MPI_Comm comm; /* Communicator used by PaStiX */ pastix_int_t Ncol; /* Size of the Matrix */ pastix_int_t *ia; /* Index of first element of each column in ja and avals */ pastix_int_t *ja; /* Rows of the unknows of the matrix */ pastix_float_t *avals; /* Values of the matrix */ pastix_int_t *perm; /* Permutation used for re-numbering of the unknowns */ pastix_int_t *invp; /* Inverse permutation */ pastix_float_t *rhs; /* Right hand side */ pastix_int_t *iparm; /* Integer parameters */ double *dparm; /* Floating parameters */ } pastix_param_t; void Morse_to_CSC(int m, int n, int nnz, double *a, int *colind, int *rowptr, pastix_float_t **at, pastix_int_t **rowind, pastix_int_t **colptr) { register int i, j, col, relpos; pastix_int_t *marker; /* Allocate storage for another copy of the matrix. */ *at = (pastix_float_t *) malloc(sizeof(pastix_float_t)*nnz); *rowind = (pastix_int_t *) malloc(sizeof(pastix_int_t)*nnz); *colptr = (pastix_int_t *) malloc(sizeof(pastix_int_t)*(n+1)); marker = (pastix_int_t *) malloc(sizeof(pastix_int_t)*n); for (i = 0; i < n; ++i) marker[i] = 0; /* Get counts of each column of A, and set up column pointers */ for (i = 0; i < m; ++i) for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; (*colptr)[0] = 0; for (j = 0; j < n; ++j) { (*colptr)[j+1] = (*colptr)[j] + marker[j]; marker[j] = (*colptr)[j]; } /* Transfer the matrix into the compressed column storage. */ for (i = 0; i < m; ++i) { for (j = rowptr[i]; j < rowptr[i+1]; ++j) { col = colind[j]; relpos = marker[col]; (*rowind)[relpos] = i; (*at)[relpos] = a[j]; ++marker[col]; } } free(marker); } static const int MAX_CHAR_PER_LINE=256; //void read_datafile_pastixff(const string &datafile, pastix_int_t *iparmtab, double *dparmtab){ void read_datafile_pastixff(const string &datafile, int &mpi_flag, pastix_int_t *iparmtab, double *dparmtab){ FILE* m_File; int i = 0; char szbuff[MAX_CHAR_PER_LINE]; char* token; char filename[datafile.size()+1]; strcpy( filename, datafile.c_str()); m_File = fopen(filename,"rt"); if(!m_File) { printf("error in reading filename %s\n",filename); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"matrix") == 0) ){ printf("freefem++: error in reading matrix parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading matrix parameter for pastix \n"); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if(strcmp(token,"assembled") == 0) mpi_flag = 0; else if(strcmp(token,"distributedglobal") == 0) mpi_flag = 1; else if(strcmp(token,"distributed") == 0) mpi_flag = 2; else{ printf("value of parameter matrix is not correct %s \n", token ); } fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"iparm") == 0) ){ printf("freefem++: error in reading iparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading iparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); iparmtab[i] = (pastix_int_t)atol(token); i++; } i=0; fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); if( !(strcmp(token,"dparm") == 0) ){ printf("freefem++: error in reading dparm parameter for pastix (see strcuture of ffpastix_iparm_dparm.txt) \n"); exit(1); } else{ printf("freefem++: reading dparm parameter for pastix \n"); } while(!feof(m_File) && i < 64) { fgets(szbuff,MAX_CHAR_PER_LINE,m_File); token = strtok(szbuff," /#!\t\n"); dparmtab[i] = atof(token); i++; } fclose(m_File); #ifdef OOC /* if (iparmtab[IPARM_OOC_THREAD] > 1) */ iparmtab[IPARM_OOC_THREAD] = 1; #endif /* On empeche le 2d avec NUMA_ALLOC */ #ifdef NUMA_ALLOC if (iparmtab[IPARM_DISTRIBUTION_LEVEL] != 0) { errorPrint("2D not available with NUMA allocation\n"); exit(-1); } #endif } // ATTENTION :: pastix_float_t // peut tre soit un complex ou un reel cela depend de la maniere dont on a compiler pastix // CAS DOUBLE SEULEMENT class dSolvepastixmpi : public MatriceMorse::VirtualSolver { double eps; mutable double epsr; double tgv; double tol_pivot_sym,tol_pivot; //Add 31 oct 2005 int paraoption; int myid, mpi_size; int Nrow; int mpi_flag; int init_raff; int thrd_flag; int SYM; string data_option; mutable pastix_int_t iparm[64]; mutable double dparm[64]; mutable pastix_int_t Ncol; mutable pastix_int_t *ia; mutable pastix_int_t *ja; mutable pastix_float_t *avals; mutable pastix_int_t *loc2glob; //char *Type = NULL; //char *RhsType = NULL; mutable pastix_float_t *rhs; mutable pastix_int_t *perm; mutable pastix_int_t *invp; mutable pastix_data_t *pastix_data; MPI_Comm commworld ; public: dSolvepastixmpi(const MatriceMorse &AA, int strategy, double ttgv, double epsilon, double pivot, double pivot_sym, string datafile, KN &pparam_int, KN &pparam_double, KN &pperm_r, KN &pperm_c,void * ccommworld ) : eps(epsilon),epsr(0), tgv(ttgv),tol_pivot_sym(pivot_sym),tol_pivot(pivot), data_option(datafile) { commworld = ccommworld ? *static_cast( ccommworld) : MPI_COMM_WORLD; KN_ param_int(pparam_int); KN_ param_double(pparam_double); //int m; //int ierr; struct timeval tv1, tv2; int nnz; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); ia = NULL; ja = NULL; avals = NULL; loc2glob = NULL; rhs = NULL; pastix_data = NULL; // matrix assembled on host MPI_Comm_rank(commworld, &myid); printf("- Rang MPI : %d\n", myid); MPI_Comm_size(commworld, &mpi_size); // SYMETRIQUE // MPI_flag need to unselect for non distributed matrix mpi_flag = 0; thrd_flag = 0; // ###################### //pastix_int_t init_raff; fprintf(stdout,"-- INIT PARAMETERS --\n"); // reading iparm from array if(!data_option.empty()){ read_datafile_pastixff(data_option,mpi_flag,iparm,dparm); if(mpi_flag != 0) cerr << "ERROR :: GLOBAT INPUT MATRIX FOR ALL PROCS matrix=assembled" << endl; } else if( !(param_int==NULL) || !(param_double==NULL) ){ if( !(param_int==NULL) ) { cout << "read param_int" << endl; assert(param_int.N() == 64); for(int ii=0; ii<64; ii++) iparm[ii] = param_int[ii]; iparm[IPARM_MODIFY_PARAMETER] = API_YES; } if( !(param_double==NULL) ) { cout << "read param_double" << endl; assert(param_double.N() == 64); for(int ii=0; ii<64; ii++) dparm[ii] = param_double[ii]; } } else{ iparm[IPARM_MODIFY_PARAMETER] = API_NO; cout << "initialize parameter" << endl; } //################################ if( myid==0 ){ Ncol = AA.m; Nrow = AA.n; nnz = AA.nbcoef; // Avant : on ecrit la transpose // AA.cl : indices des colonnes // AA.lg : pointeurs des lignes Morse_to_CSC( AA.n , AA.m, AA.nbcoef, AA.a, AA.cl, AA.lg, &avals, &ja, &ia); // ia : pointeurs des colonnes // ja : indices des lignes if(verbosity) cout << "AA.n= "<< AA.n << " AA.m=" << AA.m << " AA.nbcoef=" << AA.nbcoef << endl; for(int ii=0; ii < Ncol+1; ii++){ ia[ii] = ia[ii]+1; } assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++){ ja[ii] = ja[ii]+1; } //cout << " put " << Ncol << " " << Nrow << " " << nnz << endl; MPI_Bcast( &Ncol, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &Nrow, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &nnz, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, commworld ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, commworld ); } else{ MPI_Bcast( &Ncol, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &Nrow, 1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( &nnz, 1, MPI_PASTIX_INT, 0, commworld ); //cout << " get " << Ncol << " " << Nrow << " " << nnz << endl; avals = (pastix_float_t *) malloc( nnz*sizeof(pastix_float_t) ); ia = (pastix_int_t *) malloc( (Ncol+1)*sizeof(pastix_int_t) ); ja = (pastix_int_t *) malloc( nnz*sizeof(pastix_int_t) ); MPI_Bcast( avals, nnz, MPI_PASTIX_FLOAT, 0, commworld ); MPI_Bcast( ia, Ncol+1, MPI_PASTIX_INT, 0, commworld ); MPI_Bcast( ja, nnz, MPI_PASTIX_INT, 0, commworld ); } //cout << " " << Ncol << " " << endl; perm = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); invp = (pastix_int_t *) malloc(Ncol*sizeof(pastix_int_t)); rhs = (pastix_float_t *) malloc(Ncol*sizeof(pastix_float_t)); // reading permutation given by the user if(pperm_r) for(int ii=0; ii < Ncol; ii++) perm[ii] = pperm_r[ii]; if(pperm_c) for(int ii=0; ii < Ncol; ii++) invp[ii] = pperm_c[ii]; iparm[IPARM_START_TASK] = API_TASK_INIT; iparm[IPARM_END_TASK] = API_TASK_INIT; iparm[IPARM_SYM] = API_SYM_NO; // Matrix is considered nonsymetric if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; fprintf(stdout,"-- FIN INIT PARAMETERS --\n"); init_raff = iparm[IPARM_ITERMAX]; fflush(stdout); /* Passage en mode verbose */ iparm[IPARM_RHS_MAKING] = API_RHS_B; if( (param_int==NULL) && data_option.empty() ){ iparm[IPARM_MATRIX_VERIFICATION] = API_YES; iparm[IPARM_REFINEMENT] = API_RAF_GMRES; iparm[IPARM_INCOMPLETE] = API_NO; } if( (param_double==NULL) && data_option.empty()){ dparm[DPARM_EPSILON_REFINEMENT] = 1e-12; dparm[DPARM_EPSILON_MAGN_CTRL] = 1e-32; } // cscd_checksym(Ncol, ia, ja, loc2glob, commworld); // if (iparm[IPARM_SYM]==API_SYM_YES) // { // /* Symetric problem */ // /* Build non oriented graph */ // /* build non symmetric csc from symmetric csc */ // /*maillage global*/ // INT *tmpia; // INT *tmpja; // INT tmpn; // cscd_symgraph_int(*n2, *col2, *row2 , NULL, // &tmpn, &tmpia, &tmpja, NULL, // *loc2glob2, pastix_comm, API_YES); // memFree_null(*col2); // *col2 = tmpia; // memFree_null(*row2); // *row2 = tmpja; // *n2 = tmpn; // } SYM = AA.symetrique; cout << "SYM = "<< SYM << endl; // SYMETRIQUE if( SYM == 1 ){ iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } /* Scotch */ fprintf(stdout,"-- Scotch --\n"); fflush(stdout); iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_ORDERING; if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; iparm[IPARM_SYM] = API_SYM_NO; /* Fax */ fprintf(stdout,"-- Fax --\n"); iparm[IPARM_START_TASK] = API_TASK_SYMBFACT; iparm[IPARM_END_TASK] = API_TASK_SYMBFACT; if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Blend */ fprintf(stdout,"-- Blend --\n"); iparm[IPARM_START_TASK] = API_TASK_ANALYSE; iparm[IPARM_END_TASK] = API_TASK_ANALYSE; if( SYM == 1 ){ //iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } if( SYM == 0 ){ //iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; /* Factorisation */ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_NUMFACT; gettimeofday(&tv1, NULL); fprintf(stdout,"-- SOPALIN --\n"); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call factorization : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000); printf("=====================================================\n"); cout << " pastix : time factorization :: " << timeused << " ms" < &AA,KN_ &x,const KN_ &b) const { struct timeval tv1, tv2; // time variables long int starttime,finishtime; long int timeused; if(verbosity) starttime = clock(); // index for pastix for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]+1; assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]+1; // give value of the second member for(int ii=0; ii < Ncol; ii++){ rhs[ii] = b[ii]; } //fprintf(stdout,"SOLVE STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* updo */ iparm[IPARM_START_TASK] = API_TASK_SOLVE; iparm[IPARM_END_TASK] = API_TASK_SOLVE; iparm[IPARM_RHS_MAKING] = API_RHS_B; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call updown : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); //if(verbosity > 1) // for(int jj=0; jj < Ncol; jj++) //cout << "rhs["<< jj << "]=" << rhs[jj] << endl; //fprintf(stdout,"RAFF STEP %ld (in FACTORIZE STEP %ld)\n",(long)ii,(long)jj); /* raff */ iparm[IPARM_START_TASK] = API_TASK_REFINE; iparm[IPARM_END_TASK] = API_TASK_REFINE; iparm[IPARM_RHS_MAKING] = API_RHS_B; iparm[IPARM_ITERMAX] = init_raff; gettimeofday(&tv1, NULL); if(mpi_flag == 0) pastix(&pastix_data, commworld, Ncol,ia,ja,avals,perm,invp,rhs,1,iparm,dparm); else cerr << "error :: mpi_flag = 0 for calling pastix" << endl; gettimeofday(&tv2, NULL); fprintf(stdout,"Time to call refinement : %ld usec\n", (long)((tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec)); for(int ii=0; ii < Ncol; ii++) x[ii] = rhs[ii]; // index for freefem assert( ia[Ncol]-1 == AA.nbcoef ); for(int ii=0; ii < ia[Ncol]-1; ii++) ja[ii] = ja[ii]-1; for(int ii=0; ii < Ncol+1; ii++) ia[ii] = ia[ii]-1; if(verbosity) if(myid==0){ finishtime = clock(); timeused= (finishtime-starttime)/(1000 ); printf("=====================================================\n"); cout << " pastix : time solve :: " << timeused << " ms" < & x, KN_ & Ax) const { ffassert(x.N()==Ax.N()); Ax += (const MatriceMorse &) (*this) * x; } }; MatriceMorse::VirtualSolver * BuildSolverpastix_real_mpi(DCL_ARG_SPARSE_SOLVER(double,A)) { if(verbosity>9) cout << " BuildSolverpastix_real_mpi" << endl; return new dSolvepastixmpi(*A,ds.strategy,ds.tgv,ds.epsilon,ds.tol_pivot,ds.tol_pivot_sym, ds.data_filename, ds.lparams, ds.dparams, ds.perm_r, ds.perm_c, ds.commworld); } /* --FH: class Init { public: Init(); };*/ // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; //DefSparseSolver::SparseMatSolver SparseMatSolver_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetDefault() { if(verbosity) cout << " SetDefault sparse to default" << endl; DefSparseSolver::solver =SparseMatSolver_R; //DefSparseSolver::solver =SparseMatSolver_C; TypeSolveMat::defaultvalue =TypeSolveMat::SparseSolver; return false; } bool Setpastixmpi() { if(verbosity) cout << " SetDefault sparse solver to pastixmpi" << endl; DefSparseSolver::solver =BuildSolverpastix_real_mpi; //DefSparseSolver::solver =BuildSolverpastix_real_mpi; TypeSolveMat::defaultvalue = TypeSolveMatdefaultvalue; return false; } static void Load_Init() { SparseMatSolver_R= DefSparseSolver::solver; //SparseMatSolver_C= DefSparseSolver::solver; if(verbosity>1) cout << "\n Add: pastix, defaultsolver defaultsolverpastix" << endl; TypeSolveMat::defaultvalue=TypeSolveMat::SparseSolver; DefSparseSolver::solver =BuildSolverpastix_real_mpi; //DefSparseSolver::solver =BuildSolverpastix_real_mpi; if(! Global.Find("defaultsolver").NotNull() ) Global.Add("defaultsolver","(",new OneOperator0(SetDefault)); Global.Add("realdefaulttopastix","(",new OneOperator0(Setpastixmpi)); } LOADFUNC(Load_Init) freefem++-3.61-1/examples++-mpi/cmaes-mpi-VarIneq.edp000644 000767 000024 00000004407 13256636774 022267 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "mpi-cmaes" int NN = 10; mesh Th = square(NN,NN); func f1=1.; func f2=-1.; func g1=0.; func g2=0.1; int iter=0; int nadapt=1; real starttol=1e-10,bctol=6.e-12; fespace Vh(Th,P1); Vh ou1,ou2; real pena=1000; for(int al=0;al=2.23); if ( mpisize != 4 ) { cout << " sorry number of processeur !=4 " << endl; exit(1); } // Mortar (4 sub domain) // with matrix -et Precon Conjugade Gradient -- // Neuman -> Dirichlet . // ------------------------------- func f=1+x+y; real g=1; int withprecon=1; macro Grad(u) [ dx(u), dy(u) ] // int nbsd=4; macro Psd(U) U[0],U[1],U[2],U[3] // int labext= nbsd+1; real meshsize=0.03; real meshsizem=meshsize*1.5; bool noconforme=0; mesh Tha,Thm,Thmm; int [int] regsd(4); if(mpirank==0) { mesh Thacopy; //hack to dcl Tha ouside of mortar-msh.idp { include "mortar-msh.idp" Thacopy=Tha; regsd=regi; } Tha=Thacopy; cout << "mortar : " << endl; Thm=Tha; Thm=adaptmesh(Thm,meshsizem,IsMetric=1,thetamax=60); Thm=emptymesh(Thm); Thmm=Thm; Thmm=trunc(Thm,split=4,1); // for fine integration Thmm=emptymesh(Thmm); plot(Thm,wait=0,ps="mortar-Thm.eps"); } // send meshes verbosity=1; broadcast(processor(0),Tha); broadcast(processor(0),Thm); broadcast(processor(0),Thmm); broadcast(processor(0),regsd); // build sub domaine mesh : mesh Thi=trunc(Tha,region==regsd[mpirank],split=1);// les sous domaines if(noconforme) Thi=adaptmesh(Thi,meshsize*(1+0.1*mpirank),IsMetric=1,nbvx=100000,thetamax=60);// les sous domaines fespace Lh(Thm,P1); fespace RTh(Thm,[P0edge,P0edge]); RTh [Nmx,Nmy]; // ne marche pas car la normal // n'est definie que une un bord varf vNN([ux,uy],[nx,ny]) = int1d(Thm,1)(( nx*N.x + ny*N.y)/lenEdge); Nmx[]= vNN(0,RTh); // les joint P0 sur le squelette // ----- \int [q] l + \int[p] m Lh lh=0,rhsl=0; fespace Vhi(Thi,P1); fespace Ehi(Thi,P0); matrix Asd,Csd,PAsd,PIsd,PJsd; Vhi usd,vsd,rhssd, pusd,bcsd; Ehi epssd; real tgv=1e30; varf cci([l],[u]) = int1d(Thmm,1,qforder=3)(l*u*epssd); varf vepsi(u,v)= int1d(Thi,1,qforder=10)( (Nmx*N.x + Nmy*N.y)*v/lenEdge); varf vLapMi([ui],[vi],tgv=tgv) = int2d(Thi)( Grad(ui)'*Grad(vi) ) // + int1d(Thi,1,qfe=qf1pElump)(alpha*ui*vi) + int2d(Thi) (f*vi) + on(labext,ui=g); varf vPLapMi([ui],[vi],tgv=tgv) = int2d(Thi)( Grad(ui)'*Grad(vi) ) // + int1d(Thi,1,qfe=qf1pElump)(alphap*ui*vi) + on(labext,1,ui=0); ; varf vrhsMi(ui,vi) = on(labext,ui=g); usd=0; vsd=0; epssd[]= vepsi(0,Ehi); epssd = -real(epssd <-0.00001) + real(epssd >0.00001); Csd = cci(Lh,Vhi); Asd = vLapMi(Vhi,Vhi,solver=UMFPACK); PAsd = vPLapMi(Vhi,Vhi,solver=UMFPACK); matrix IVL=interpolate(Vhi,Lh,inside=1); // v = IVL*l varf vonext(u,v)=on(labext,u=1); varf von1(u,v)=on(1,u=1); real[int] onext=vonext(0,Vhi); real[int] on1=von1(0,Vhi); on1= on1 ? 1 : 0; on1 = onext ? 0 : on1; // remove df of ext matrix I1(on1);// matrix tgv $i\in Gamma_1 \ Gamma_e $ , 0 otherwise PIsd= I1*IVL;// remove of line not on $Gamma_1 \ Gamma_e $ // so PIsd*l = tgv * Interpole l on $Gamma_1 \ Gamma_e $ I1.diag=on1; matrix AA=I1*Asd;// remove line not on lab 1 PJsd= IVL'*AA; rhssd[]=vLapMi(0,Vhi); varf vML(u,v) = int2d(Thm)(u*v*1e-10)+int1d(Thm,1)(u*v); matrix ML=vML(Lh,Lh); lh[]=0; int itera=0; varf vbc(u,v) = int1d(Thm,labext)(v); real[int] lbc(Lh.ndof),lbc0(Lh.ndof); lbc=vbc(0,Lh); lbc = lbc ? 0 : 1 ; int what; // to choose which funct call 1 SkPb 2:PSkPb, 3:end // the preconditionner func real[int] PSkPb(real[int] &l) { if(withprecon) { if(mpirank==0) { what=2; broadcast(processor(0),what); // get from SkBk routine } if(what!=2) return l; int verb=verbosity; verbosity=0; itera++; real[int] ll= ML^-1*l; broadcast(processor(0),ll); ll= lbc .* ll; ll *= tgv; pusd[] = PAsd^-1*(vsd[]= PIsd* ll); ll = PJsd*pusd[]; if(mpirank==0) { for (int i=1;i<4;++i) { processor(i) >> l; ll += l; } l = ML^-1*ll; l= lbc .* l; } else processor(0) << ll; verbosity=verb; } return l ; }; func real[int] SkPb(real[int] &l) { int verb=verbosity; verbosity=0; itera++; if(mpirank==0 && what!=3) what=1; broadcast(processor(0),what); if(what==2) return PSkPb(l); else if (what !=1) return l; broadcast(processor(0),l); vsd[] = rhssd[]; vsd[] += Csd* l; usd[] = Asd^-1*vsd[]; l = Csd'*usd[]; l= lbc .* l; if(mpirank==0) { real[int] ll(l.n); for (int i=1;i<4;++i) { processor(i) >> ll; l += ll; } } else processor(0) << l; verbosity=verb; return l ; }; if(mpirank==0) { verbosity=100; lh[]=0; LinearCG(SkPb,lh[],eps=1.e-5,nbiter=100,precon=PSkPb); what=3; SkPb(lh[]); } else while(what!=3) SkPb(lh[]); plot(usd,bb=[[-1,-1],[1,1]],ps="mortar-"+mpirank+".eps"); cout << "Fin CG " << mpirank << endl; /* Brochet:examples++-mpi hecht$ (grep -vh showpage mortar-?.eps;echo showpage) > mortar.eps Brochet:examples++-mpi hecht$ gv mortar.eps */ freefem++-3.61-1/examples++-mpi/MUMPS.cpp000644 000767 000024 00000030146 13312446271 017743 0ustar00hechtstaff000000 000000 // SUMMARY : simpler MUMPS interface // USAGE : LGPL // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE // AUTHOR : P. Jolivet // E-MAIL : Pierre Jolivet // //ff-c++-LIBRARY-dep: mumps parmetis ptscotch scotch scalapack blas mpifc fc mpi pthread //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 */ #include #include "rgraph.hpp" #include "AFunction.hpp" // FFCS - 23/4/13 - instanciate some global symbols which are not found by default in MS MPI Fortran libraries #ifdef _WIN32 __declspec(dllexport) int toto; MPI_Fint* _imp__MPI_F_STATUS_IGNORE; MPI_Fint* _imp__MPI_F_STATUSES_IGNORE; #endif #include "MatriceCreuse.hpp" #include "dmatrix.hpp" #include #include #define JOB_INIT -1 #define JOB_END -2 #define USE_COMM_WORLD -987654 //#define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ //#define INFOG(I) infog[(I)-1] /* macro s.t. indices match documentation */ //#define INFO(I) info[(I)-1] /* macro s.t. indices match documentation */ template struct MUMPS_STRUC_TRAIT {typedef void MUMPS; typedef void R; }; template<> struct MUMPS_STRUC_TRAIT {typedef DMUMPS_STRUC_C MUMPS; typedef double R;}; template<> struct MUMPS_STRUC_TRAIT {typedef ZMUMPS_STRUC_C MUMPS; typedef ZMUMPS_COMPLEX R;}; void mumps_c(DMUMPS_STRUC_C *id) { dmumps_c(id);} void mumps_c(ZMUMPS_STRUC_C *id) { zmumps_c(id);} template struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_BYTE;}};; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_LONG;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_INT;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_DOUBLE;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_BYTE;}}; template<> struct MPI_TYPE {static const MPI_Datatype TYPE(){return MPI_DOUBLE_COMPLEX;}}; static std::string analysis[] = {"AMD", "", "AMF", "SCOTCH", "PORD", "METIS", "QAMD", "automatic sequential", "automatic parallel", "PT-SCOTCH", "ParMetis"}; template class SolverMumps : public MatriceMorse::VirtualSolver { private: mutable typename MUMPS_STRUC_TRAIT::MUMPS * _id; //mutable DMUMPS_STRUC_C* _id; mutable unsigned char _strategy; bool distributed; MPI_Comm comm; int mpirank; KN * rinfog; KN * infog; public: int & ICNTL(int i) const { return _id->icntl[i-1];} double & CNTL(int i) const { return _id->cntl[i-1];} int & INFO(int i) const { return _id->info[i-1];} double & RINFO(int i) const { return _id->rinfo[i-1];} int & INFOG(int i) const { return _id->infog[i-1];} double & RINFOG(int i) const { return _id->rinfog[i-1];} void SetVerb(int i=verbosity) const { if( verbosity < 5) { ICNTL(1)=6; ICNTL(3)=0; ICNTL(4)=0; } else { ICNTL(1)=6; ICNTL(2)=0; ICNTL(3)=6; ICNTL(4)=0; if(verbosity < 10) ICNTL(4)=1; else if(verbosity < 15) ICNTL(4)=1; else if(verbosity < 20) ICNTL(4)=2; else if(verbosity < 25) ICNTL(4)=3; else ICNTL(4)=4; } //cout << ICNTL(1) << " " << ICNTL(2) << " "<< ICNTL(3) << " "<< ICNTL(4) << endl; } typedef typename MUMPS_STRUC_TRAIT::R MR; SolverMumps(const MatriceMorse &A, KN ¶m_int, KN ¶m_R, MPI_Comm* pcomm,int strategy=3,int matrank=0,KN *rinfogg=0 ,KN *infogg=0) :_id(new typename MUMPS_STRUC_TRAIT::MUMPS ),comm( pcomm ? *pcomm :MPI_COMM_WORLD ), distributed(matrank<0), rinfog(rinfogg),infog(infogg) { if(pcomm) MPI_Comm_dup(comm,&comm); MPI_Comm_rank(comm, &mpirank); int master = mpirank==matrank; _id->job = JOB_INIT; _id->par = 1; _id->comm_fortran = MPI_Comm_c2f(comm); _id->sym = A.symetrique; _strategy = strategy; mumps_c(_id); int* I = 0; int* J = 0; R * C = 0; long nnz=0; if( distributed || (mpirank == matrank) ) { if(verbosity>5 ) cout << " MUMPS "<sym == 0) { nnz = A.nbcoef; I = new int[A.nbcoef]; CSR2COO<'C', 'U'>(A.n, A.lg, I); C = A.a; J = A.cl; for(unsigned int i = 0; i < A.nbcoef; ++i) ++J[i]; } else { if(A.symetrique) { nnz = A.nbcoef; I = new int[A.nbcoef]; J = new int[A.nbcoef]; C = new R[A.nbcoef]; for(unsigned int i = 0; i < A.n; ++i) C[i] = A.a[A.lg[i + 1] - 1]; std::generate(I, I + A.n, step(0, 1)); CSR2COO<'C', 'L'>(A.n, A.lg, I + A.n); std::copy(I, I + A.n, J); for(unsigned int i = 1; i < A.n; ++i) { for(unsigned int j = A.lg[i]; j < A.lg[i + 1] - 1; ++j) { J[A.n + j - i] = A.cl[j] + 1; C[A.n + j - i] = A.a[j]; } } } else { nnz = A.n + (A.nbcoef - A.n) / 2; I = new int[A.n + (A.nbcoef - A.n) / 2]; J = new int[A.n + (A.nbcoef - A.n) / 2]; C = new R[A.n + (A.nbcoef - A.n) / 2]; trimCSR(A.n, I + A.n, A.lg, J + A.n, A.cl, C + A.n, A.a); for(unsigned int i = 0; i < A.n - 1; ++i) C[i] = A.a[A.lg[i + 1] - (I[i + 1 + A.n] - I[i + A.n]) - 1]; C[A.n - 1] = A.a[A.nbcoef - 1]; std::generate(I, I + A.n, step(0, 1)); CSR2COO<'F', 'U'>(A.n - 1, I + A.n, I + A.n); std::copy(I, I + A.n, J); } } _id->n = A.n; if(!distributed) { _id->nz=nnz; _id->a =reinterpret_cast( C); _id->irn = I; _id->jcn = J; } else { _id->nz_loc=nnz; _id->a_loc =reinterpret_cast( C); _id->irn_loc = I; _id->jcn_loc = J; } } else { // no matrix ... _id->nz=0; _id->a =0; _id->irn = 0;; _id->jcn = 0; } _id->nrhs = 1; ICNTL(1) = 0; ICNTL(2) = 0; ICNTL(3) = verbosity > 1 ? 6 : 0; ICNTL(4) = 0; // verbose level ICNTL(5) = 0; // assembled format if(_strategy > 0 && _strategy < 9 && _strategy != 2) { ICNTL(28) = 1; // 1: sequential analysis ICNTL(7) = _strategy - 1; // 0: AMD } // 1: // 2: AMF // 3: SCOTCH // 4: PORD // 5: METIS // 6: QAMD // 7: automatic else { ICNTL(28) = 1; ICNTL(7) = 7; } if(_strategy > 8 && _strategy < 12) { ICNTL(28) = 2; // 2: parallel analysis ICNTL(29) = _strategy - 9; // 0: automatic } // 1: PT-STOCH // 2: ParMetis ICNTL(9) = 1; ICNTL(11) = 0; // verbose level ICNTL(18) = distributed ? 3: 0; // centralized matrix input if !distributed ICNTL(20) = 0; // dense RHS ICNTL(14) = 30; // percentage increase in the estimated working space _id->job = 4; mumps_c(_id); if(INFOG(1) != 0 && verbosity>1) std::cout << "BUG MUMPS, INFOG(1) = " << INFOG(1) << " distributed: " << distributed << " master " << matrank << std::endl; if(I) { if(_id->sym == 0) { for(unsigned int i = 0; i < A.nbcoef; ++i) --J[i]; } else { delete [] C; delete [] J; } delete [] I; } if( rinfog) { // copy rinfog if(rinfog->N() <40) rinfog->resize(40); for(int i=0; i<40;++i) (*rinfog)[i]=RINFOG(i+1); } if( infog) { // copy ginfo if(infog->N() <40) infog->resize(40); for(int i=0; i<40;++i) (*infog)[i]=INFOG(i+1); } }; void Solver(const MatriceMorse &A, KN_ &x, const KN_ &b) const { if(verbosity>6) cout << " Solver MUMPS mpi " << distributed << endl; ICNTL(20) = 0; // dense RHS ICNTL(21) = 0; // centralized dense solution if(distributed) { MPI_Reduce( (void *) (R*) b,(void *) (R*) x , x.N() , MPI_TYPE::TYPE(),MPI_SUM,0,comm); } else if(mpirank==0) x = b; ICNTL(3) = verbosity > 1 ? 6 : 0; _id->rhs = reinterpret_cast((R*) x); _id->job = 3; mumps_c(_id); if(distributed) { MPI_Bcast(reinterpret_cast ( (R*) x), x.N(), MPI_TYPE::TYPE(), 0,comm); } if( rinfog) { // copy rinfog if(rinfog->N() <40) rinfog->resize(40); for(int i=0; i<40;++i) (*rinfog)[i]=RINFOG(i+1); } if( infog) { // copy ginfo if(infog->N() <40) infog->resize(40); for(int i=0; i<40;++i) (*infog)[i]=INFOG(i+1); } }; ~SolverMumps() { if(_id) { _id->job = JOB_END; mumps_c(_id); delete _id; } if(comm != MPI_COMM_WORLD) MPI_Comm_free(&comm); }; }; template typename MatriceMorse::VirtualSolver* buildSolver(DCL_ARG_SPARSE_SOLVER(R, A)) {// gestion de la star MPI_Comm cw = MPI_COMM_WORLD, * pcw= (MPI_Comm*) ds.commworld; if(!pcw) pcw = & cw; int mpirank ; MPI_Comm_rank(*pcw, &mpirank); int strategy = ds.strategy,matrank=0; if(Data_Sparse_Solver_version()>0 ) matrank=ds.master; if( !strategy && ds.lparams.N() > 0) strategy = ds.lparams[0]; if(ds.lparams.N()>1) matrank = ds.lparams[1];// <0 => distri mat .. if( ! strategy) strategy=3; int mat = mpirank == matrank || matrank < 0; if(A) return new SolverMumps(*A, ds.lparams, ds.dparams, pcw,strategy,matrank,ds.rinfo,ds.info); else ffassert(0); return new SolverMumps(*A, ds.lparams, ds.dparams, pcw,strategy,matrank,ds.rinfo,ds.info); } // the 2 default sparse solver double and complex DefSparseSolver::SparseMatSolver SparseMatSolver_R ; ; DefSparseSolver::SparseMatSolver SparseMatSolver_C; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_R ; ; DefSparseSolverSym::SparseMatSolver SparseMatSolverSym_C; // the default probleme solver TypeSolveMat::TSolveMat TypeSolveMatdefaultvalue=TypeSolveMat::defaultvalue; bool SetMUMPS() { if(verbosity>1) cout << " SetDefault sparse solver to MUMPS (mpi) " << endl; DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; TypeSolveMat::defaultvalue =TypeSolveMatdefaultvalue; return true; } void initMUMPS() { if(verbosity && mpirank==0) cout << "\n MUMPS (mpi) "<< endl; SparseMatSolver_R= DefSparseSolver::solver; SparseMatSolver_C= DefSparseSolver::solver; SparseMatSolverSym_R= DefSparseSolverSym::solver; SparseMatSolverSym_C= DefSparseSolverSym::solver; if(verbosity>1) cout << "\n Add: MUMPS(mpi): defaultsolver defaultsolverMUMPS_" << endl; DefSparseSolver::solver = buildSolver; DefSparseSolver::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; DefSparseSolverSym::solver = buildSolver; TypeSolveMat::defaultvalue =TypeSolveMatdefaultvalue; if(! Global.Find("defaulttoMUMPS").NotNull() ) Global.Add("defaulttoMUMPS","(",new OneOperator0(SetMUMPS)); } LOADFUNC(initMUMPS); freefem++-3.61-1/examples++-mpi/Laplace3d-hips.edp000644 000767 000024 00000005404 13256636774 021600 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 /* Warning in before version 3.2-1 the nomarl are interal normal after the signe is correct and now the noral was exterior normal. */ verbosity=2; load "msh3" load "hips_FreeFem" int[int] iparm(16); real[int] dparm(6); iparm=-1; dparm=-1; /* the sol trap if we use... iparm[0]=1; // use iterative solver 0 => trap why ???? FH ..... iparm[1]=0; // PCG as Krylov method iparm[4]=1; // Matrix are symmetric iparm[5]=1; // Pattern are also symmetric iparm[9]=0; // Scale matrix dparm[0]=1e-13; // Tolerance to convergence dparm[1]=5e-4; // Threshold in ILUT dparm[2]=5e-4; // Threshold for Schur preconditionner dparm[4]=1e-2; // drop tol dparm[5]=1e-2; // drop tol */ int nn=10; mesh Th2=square(nn,nn,region=0); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); fespace Vh(Th,P2); func ue = 2*x*x + 3*y*y + 4*z*z + 5*x*y+6*x*z+1; func uex= 4*x+ 5*y+6*z; func uey= 6*y + 5*x; func uez= 8*z +6*x; func f= -18. ; Vh uhe = ue; // cout << " uhe min: " << uhe[].min << " max:" << uhe[].max << endl; Vh u,v; macro Grad3(u) [dx(u),dy(u),dz(u)] // EOM /* problem Lapl3d(u,v) = int3d(Th)(Grad3(v)' *Grad3(u)) //') for emacs + int2d(Th,2)(u*v) - int3d(Th)(f*v) - int2d(Th,2) ( ue*v + (uex*N.x +uey*N.y +uez*N.z)*v ) + on(1,u=ue); Lapl3d; */ varf Lapl3d(u,v) = int3d(Th)(Grad3(v)' *Grad3(u)) //') for emacs + int2d(Th,2)(u*v) + int3d(Th)(f*v) + int2d(Th,2) ( ue*v + (uex*N.x +uey*N.y +uez*N.z)*v ) + on(1,u=ue); matrix A = Lapl3d(Vh,Vh,tgv=-1);// to remove line this BC. cout << A.n << " " << A.m << " " << A.nbcoef << endl; verbosity=4; set(A,solver=sparsesolver,dparams=dparm, lparams=iparm); cout <> U[]; real err0,err1; err0 = int1d(Th[mpirank],interior)(square(U-u)) ; // send err0 to the other proc, receive in err1 processor(1-mpirank)<>err1; real err= sqrt(err0+err1); cout <<" err = " << err << " err0 = " << err0 << ", err1 = " << err1 << endl; if(err<1e-3) break; }; if (mpirank==0) plot(u,U,ps="uU.eps"); freefem++-3.61-1/examples++-mpi/MUMPS.edp000644 000767 000024 00000004371 13256636774 017752 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "MUMPS" load "symmetrizeCSR" int[int] l = [1, 1, 2, 2]; mesh Th = square(150, 150, label = l); int master = 0; // no choose see MUMPS doc sect 4.3 if(mpirank != master) // no need to store the matrix on ranks other than 0 Th = square(1, 1, label = l); fespace Vh(Th, P2); real[int] rinfo(40); int[int] info(40); varf lap(u,v) = int2d(Th)(dx(u)*dx(v) + dy(u)*dy(v) - 100*u*v) + int2d(Th)(v) + on(1, u = 1); real[int] b = lap(0, Vh); matrix A,B; //if( mpirank==master) // => trap pb of size in A^-1 * b; { // def only on master .. A = lap(Vh, Vh); B = A; symmetrizeCSR(B); } verbosity = 2; // If you want, you can pass an array of integer (int[int] t) // for specifying the ordering you want to use // 1 : AMD // 3 : AMF // 4 : SCOTCH // 5 : PORD // 6 : METIS // 7 : QAMD // 10 : PT-SCOTCH // 11 : ParMETIS // // You can also set on which MPI rank the matrix is defined // as the current interface only supports centralized matrices // // Example : // If one wants to use SCOTCH with a matrix stored on mpirank == 0 // int[int] t(2); t(0) = 4; t(1) = 1; // set(A, solver = sparsesolver, lparams = t); set(A, solver = sparsesolver,master=master); set(B, solver = sparsesolver,master=master,rinfo=rinfo,info=info); if(mpirank==master) for(int i=0; i<40;++i) { cout << "mumps: info B" << i+1 << " = " << info[i] << " , / r " << rinfo[i] <&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-mpi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = DDM-Schwarz-Lame-2d.edp DDM-Schwarz-Lame-3d.edp DDM-Schwarz-Lap-2dd.edp DDM-Schwarz-Lap-3d.edp \ DDM-Schwarz-Stokes-2d.edp LaplaceRT-3d-matrix-mumps.edp MPICGLap.edp MPIGMRES2D.edp MPIGMRES3D.edp MUMPS.edp \ NSI3d-carac-mumps.edp NSI3d-carac.edp Stokes-v1-matrix-mumps.edp Stokes-v1-matrix-superludist.edp \ Stokes-v2-matrix-mumps.edp Stokes-v3-matrix-mumps.edp VG.edp beam-3d-matrix-superludist.edp \ cavityNewtow-MUMPS.edp chaleur3D-hips.edp chaleur3D-mumps.edp chaleur3D-superludist.edp cmaes-mpi-VarIneq.edp \ essai.edp mortar-DN-4-mpi.edp testsolver_MUMPS.edp testsolver_SuperLU_DIST.edp parmetis.edp parmetis-3d.edp \ LapMPIEigenValue.edp XFAIL_TESTS = $(TESTS) LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPPMPI) FLAGS_FFPP="-np 4 -nw" SKIP=$(SKIP_TESTS_MPI) LIST_IDP = DDM-Schwarz-macro.idp MPIGMRESmacro.idp getARGV.idp \ DDM-funcs-v2.idp MPIplot.idp mortar-msh.idp Heat3d.idp func-max.idp EXTRA_DIST = *.edp *.idp regtests.sh \ MPICG.cpp \ MUMPS_FreeFem.cpp \ complex_SuperLU_DIST_FreeFem.cpp \ complex_pastix_FreeFem.cpp \ dSuperLU_DIST.cpp \ ffsuperludistoption-1.hpp \ ffsuperludistoption.hpp \ generaldefs.h \ hips_FreeFem.cpp \ hypre_FreeFem.cpp \ interfacepastix.cpp \ parms_FreeFem.cpp \ real_SuperLU_DIST_FreeFem.cpp \ real_pastix_FreeFem.cpp mpi-cmaes.cpp \ ffmumps_fileparam.txt ffpastix_iparm_dparm.txt ffsuperlu_dist_fileparam.txt \ MUMPS.cpp parmetis.cpp \ MUMPS.edp dmatrix.hpp ffmumps_fileparam.txt ffpastix_iparm_dparm.txt ffsuperlu_dist_fileparam.txt # FFCS - list modified to disable some downloaded tools depending on the platform (see # [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be # deactivated). LIST_COMPILE = @TOOL_DYLIB_mumps@ @TOOL_DYLIB_hips@ @TOOL_DYLIB_superludist@ @TOOL_DYLIB_pastix@ MPICG.$(DYLIB_SUFFIX) \ @TOOL_DYLIB_parms@ mpi-cmaes.$(DYLIB_SUFFIX) parmetis.$(DYLIB_SUFFIX) all: all-am .SUFFIXES: .SUFFIXES: .$(DYLIB_SUFFIX) .cpp .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-mpi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-mpi/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? DDM-Schwarz-Lame-2d.edp.log: DDM-Schwarz-Lame-2d.edp @p='DDM-Schwarz-Lame-2d.edp'; \ b='DDM-Schwarz-Lame-2d.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) DDM-Schwarz-Lame-3d.edp.log: DDM-Schwarz-Lame-3d.edp @p='DDM-Schwarz-Lame-3d.edp'; \ b='DDM-Schwarz-Lame-3d.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) DDM-Schwarz-Lap-2dd.edp.log: DDM-Schwarz-Lap-2dd.edp @p='DDM-Schwarz-Lap-2dd.edp'; \ b='DDM-Schwarz-Lap-2dd.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) DDM-Schwarz-Lap-3d.edp.log: DDM-Schwarz-Lap-3d.edp @p='DDM-Schwarz-Lap-3d.edp'; \ b='DDM-Schwarz-Lap-3d.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) DDM-Schwarz-Stokes-2d.edp.log: DDM-Schwarz-Stokes-2d.edp @p='DDM-Schwarz-Stokes-2d.edp'; \ b='DDM-Schwarz-Stokes-2d.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) LaplaceRT-3d-matrix-mumps.edp.log: LaplaceRT-3d-matrix-mumps.edp @p='LaplaceRT-3d-matrix-mumps.edp'; \ b='LaplaceRT-3d-matrix-mumps.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) MPICGLap.edp.log: MPICGLap.edp @p='MPICGLap.edp'; \ b='MPICGLap.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) MPIGMRES2D.edp.log: MPIGMRES2D.edp @p='MPIGMRES2D.edp'; \ b='MPIGMRES2D.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) MPIGMRES3D.edp.log: MPIGMRES3D.edp @p='MPIGMRES3D.edp'; \ b='MPIGMRES3D.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) MUMPS.edp.log: MUMPS.edp @p='MUMPS.edp'; \ b='MUMPS.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) NSI3d-carac-mumps.edp.log: NSI3d-carac-mumps.edp @p='NSI3d-carac-mumps.edp'; \ b='NSI3d-carac-mumps.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) NSI3d-carac.edp.log: NSI3d-carac.edp @p='NSI3d-carac.edp'; \ b='NSI3d-carac.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) Stokes-v1-matrix-mumps.edp.log: Stokes-v1-matrix-mumps.edp @p='Stokes-v1-matrix-mumps.edp'; \ b='Stokes-v1-matrix-mumps.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) Stokes-v1-matrix-superludist.edp.log: Stokes-v1-matrix-superludist.edp @p='Stokes-v1-matrix-superludist.edp'; \ b='Stokes-v1-matrix-superludist.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) Stokes-v2-matrix-mumps.edp.log: Stokes-v2-matrix-mumps.edp @p='Stokes-v2-matrix-mumps.edp'; \ b='Stokes-v2-matrix-mumps.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) Stokes-v3-matrix-mumps.edp.log: Stokes-v3-matrix-mumps.edp @p='Stokes-v3-matrix-mumps.edp'; \ b='Stokes-v3-matrix-mumps.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) VG.edp.log: VG.edp @p='VG.edp'; \ b='VG.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) beam-3d-matrix-superludist.edp.log: beam-3d-matrix-superludist.edp @p='beam-3d-matrix-superludist.edp'; \ b='beam-3d-matrix-superludist.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) cavityNewtow-MUMPS.edp.log: cavityNewtow-MUMPS.edp @p='cavityNewtow-MUMPS.edp'; \ b='cavityNewtow-MUMPS.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) chaleur3D-hips.edp.log: chaleur3D-hips.edp @p='chaleur3D-hips.edp'; \ b='chaleur3D-hips.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) chaleur3D-mumps.edp.log: chaleur3D-mumps.edp @p='chaleur3D-mumps.edp'; \ b='chaleur3D-mumps.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) chaleur3D-superludist.edp.log: chaleur3D-superludist.edp @p='chaleur3D-superludist.edp'; \ b='chaleur3D-superludist.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) cmaes-mpi-VarIneq.edp.log: cmaes-mpi-VarIneq.edp @p='cmaes-mpi-VarIneq.edp'; \ b='cmaes-mpi-VarIneq.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) essai.edp.log: essai.edp @p='essai.edp'; \ b='essai.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) mortar-DN-4-mpi.edp.log: mortar-DN-4-mpi.edp @p='mortar-DN-4-mpi.edp'; \ b='mortar-DN-4-mpi.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) testsolver_MUMPS.edp.log: testsolver_MUMPS.edp @p='testsolver_MUMPS.edp'; \ b='testsolver_MUMPS.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) testsolver_SuperLU_DIST.edp.log: testsolver_SuperLU_DIST.edp @p='testsolver_SuperLU_DIST.edp'; \ b='testsolver_SuperLU_DIST.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) parmetis.edp.log: parmetis.edp @p='parmetis.edp'; \ b='parmetis.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) parmetis-3d.edp.log: parmetis-3d.edp @p='parmetis-3d.edp'; \ b='parmetis-3d.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) LapMPIEigenValue.edp.log: LapMPIEigenValue.edp @p='LapMPIEigenValue.edp'; \ b='LapMPIEigenValue.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic clean-local cscopelist-am ctags-am distclean \ distclean-generic 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-exec-local \ 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 pdf pdf-am ps ps-am recheck \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # FFCS - do not set loadpath to be able to run an external version of FF on the examples in this directory with # [[../../mkffref]] @FFCS_MPIOK_TRUE@all-local:$(LIST_COMPILE) @FFCS_MPIOK_TRUE@ @echo Warning missing mpi plugin: `for i in $(LIST_COMPILE); do if test ! -s $i ; then j=1; echo "$i," ;fi; done` @FFCS_MPIOK_TRUE@ echo "finish compile load mpi solver !" @FFCS_MPIOK_FALSE@all-local: .cpp.$(DYLIB_SUFFIX): ../examples++-load/ff-c++ ../examples++-load/WHERE_LIBRARY-download # FFCS needs an error exit code to make sure that all libraries are correctly compiled # # FFCS on Windows inserts all MPI options (include, lib, ...) in the $MPICXX compiler script, instead of "$CXX $MPI_xxx", # but it needs '-mpi' to do that # ### -../examples++-load/ff-c++ -auto $< ../examples++-load/ff-c++ -auto -mpi $< install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib/mpi $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/etc $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp -for i in $(LIST_COMPILE); do \ if [ -f $$i ] ; then $(INSTALL) -m 555 $$i $(DESTDIR)$(ff_prefix_dir)/lib/mpi; fi; done $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp freefem++.pref:Makefile echo 'loadpath = "./;../examples++-load/"' >freefem++.pref echo 'includepath = "../examples++-3d/"' >>freefem++.pref echo 'includepath += "../examples++-tutorial/"' >>freefem++.pref # echo loadpath += \"./\" >>freefem++.pref # force the build for freefem++.pref FH.. DDM-Schwarz-Lame-2d.edp:freefem++.pref # FFCS - cleaning is useful sometimes clean-local:: -rm $(LIST_COMPILE) -rm *.$(OBJEXT) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # 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: freefem++-3.61-1/examples++-mpi/MPIGMRES3D.edp000644 000767 000024 00000031513 13256636774 020461 0ustar00hechtstaff000000 000000 // NBPROC 10 // ff-mpirun -np 4 MPIGMRES2D.edp -glut ffglut -n 11 -k 1 -d 1 -ns -gmres 1 /* a first true parallele example fisrt freefem++ Ok up to 200 proc for a Poisson equation.. See the Doc for full explaiantion F Hecht Dec. 2010. ------------------- usage : ff-mpirun [mpi parameter] MPIGMRES3d.edp [-glut ffglut] [-n N] [-k K] [-d D] [-ns] [-gmres [0|1|2|3] argument: -glut ffglut : to see graphicaly the process -n N: set the mesh3 cube split NxNxN -d D: set debug flag D must be one for mpiplot -k K: to refined by K all elemnt -ns: reomove script dump -gmres 0 : use iterative schwarz algo. 1 : Algo GMRES on residu of schwarz algo. 2 : DDM GMRES 3 : DDM GMRES with coarse grid preconditionner (Good one) */ load "MPICG" load "medit" load "metis" include "getARGV.idp" include "MPIplot.idp" include "MPIGMRESmacro.idp" //include "AddLayer3d.idp" include "cube.idp" searchMethod=1; // more safe seach algo (warning can be very expensive in case lot of ouside point) assert(version >3.11); real[int] ttt(10);int ittt=0; macro settt {ttt[ittt++]=mpiWtime();}// verbosity=getARGV("-vv",0); int vdebug=getARGV("-d",1); int ksplit=getARGV("-k",2); int nloc = getARGV("-n",10); string sff=getARGV("-p,",""); int gmres=getARGV("-gmres",3); bool dplot=getARGV("-dp",0); int nC = getARGV("-N" ,max(nloc/10,4)); if(mpirank==0 && verbosity) { cout << "ARGV : "; for(int i=0;i0,label=10); // non-overlapping mesh3, interfaces have label 10 int nnn = sizeoverlaps*2;// to be sure AddLayers(Thg,suppi[],nnn,unssd[]); // see above ! suppi and unssd are modified unssd[] *= nnn; // to put value nnn a 0 real nnn0 = nnn - sizeoverlaps + 0.001 ; Thi=trunc(Thg,unssd>nnn0 ,label=10); // overlapping mesh3, interfaces have label 10 settt fespace Vhi(Thi,P1); int npij=npart; Vhi[int] pij(npij);// local partition of unit + pii Vhi pii; real nnn1= + 0.001 ; { /* construction of the partition of the unit, let phi_i P1 FE function 1 on Thin and zero ouside of Thi and positive the partition is build with $$ p_i = phi_i/ \sum phi_i to build the partition of one domain i we nned to find all j such that supp(phi_j) \cap supp(phi_j) is not empty <=> int phi_j */ // build a local mesh3 of thii such that all compuation of the unit partition are // exact in thii mesh3 Thii=trunc(Thg,unssd>nnn1 ,label=10); // overlapping mesh3, interfaces have label 10 { // find all j mes (supp(p_j) \cap supp(p_i)) >0 // compute all phi_j on Thii // remark supp p_i include in Thi // fespace Phii(Thii,P0); fespace Vhii(Thii,P1); Vhi sumphi=0; jpart=0; njpart=0; int nlayer=RAS?1:sizeoverlaps; if(ipart==0) cout <<" nlayer=" << nlayer << endl; pii= max(unssd-nnn+nlayer,0.)/nlayer; if(dplot) plot(pii,wait=1,cmm=" 0000"); sumphi[] += pii[]; if(dplot) plot(sumphi,wait=1,cmm=" summ 0000"); Vhii phii=0; real epsmes=1e-10*Thii.measure; for (int i=0;i 0.5) { AddLayers(Thii,suppii[],nlayer,phii[]); assert(phii[].min >=0); real interij = int3d(Thi)( phii); if(interij>epsmes) { pij[njpart]=abs(phii); if(vdebug>2) cout << " ***** " << int3d(Thi)(real(pij[njpart])<0) << " " < 1.-1e-6 && sumphi[].max< 1.+1e-6); // verification }}// (Thii is remove here) // end of the construction of the local partition of the unity ... // on Thi ... // ----------------------------------------------------------------- if(ipart==0) cout << " *** end build partition " << endl; // computation of number of intersection .. // ------------------------------------------ // here pii and the pij is the locate partition of the unite on // Thi ( mesh3 with overlap ).... //Thi=splitmesh(Thi,2); if(dplot ) { plot(Thi,wait=1); for(int j=0;j we have to recive // data on intersection of the support of pij[0] and pij[j] settt plotMPIall(Thi,pii[],"pi_i"); mesh3[int] aThij(njpart); matrix Pii; matrix[int] sMj(njpart); // M of send to j matrix[int] rMj(njpart); // M to recv from j fespace Whi(Thi,Pk); mesh3 Thij=Thi; fespace Whij(Thij,Pk);// // construction of the mesh3 intersect i,j part for(int jp=0;jp1e-6,label=10); // mesh3 of the supp of pij for(int jp=0;jp s Whij rMj[jp] = interpolate(Whij,Whi,t=1); // Whji -> Whi if(vdebug>10) { {Whi uuu=1;Whij vvv=-1; vvv[]+=I*uuu[]; cout << jp << " %%% " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);} {Whi uuu=1;Whij vvv=-1; vvv[]+=rMj[jp]'*uuu[]; cout << jp << " ### " << vvv[].linfty << endl; assert(vvv[].linfty < 1e-6);}} }} if(ipart==0) cout << " *** end build transfert matrix " << endl; // alloc array of send and recv data .. InitU(njpart,Whij,Thij,aThij,Usend) // initU(n,Vh,Th,aTh,U) InitU(njpart,Whij,Thij,aThij,Vrecv) // ... if(ipart==0) cout << " *** end init data for send/revc " << endl; Whi ui,vi; func bool Update(real[int] &ui, real[int] &vi) { for(int j=0;j I ~ - C1AC2A +C1A +C2A // New Prec P= C1+C2 - C1AC2 = C1(I- A C2) +C2 // ( C1(I- A C2) +C2 ) Uo // V = - C2*Uo // .... real[int] V(U.n); CoarseSolve(V,U,comm); V = -V; // -C2*Uo U += Ai*V; // U = (I-A C2) Uo real[int] b= onG10 ? 0. : U; U = Ai^-1*b; // ( C1( I -A C2) Uo V = U -V; // Update(V,U); return U; } func real[int] DJ0(real[int]& U) { ++kiter; real[int] V(U.n); real[int] b= onG .* U; b = onG ? b : Bi ; V = Ai^-1*b; Update(V,U); V -= U; return V; } Whi u=0,v; { // verification..... Whi u=1,v; Update(u[],v[]); u[]-=v[]; assert( u[].linfty<1e-6); } settt u[]=vBC(0,Whi,tgv=1); // set u with tge BC value ... real epss=1e-6; int rgmres=0; if(gmres==1) { rgmres=MPIAffineGMRES(DJ0,u[],veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); real[int] b= onG .* u[]; b = onG ? b : Bi ; v[] = Ai^-1*b; Update(v[],u[]); } else if(gmres==2) rgmres= MPILinearGMRES(DJ,precon=PDJ,u[],Bi,veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); else if(gmres==3) rgmres= MPILinearGMRES(DJ,precon=PDJC,u[],Bi,veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50); else // algo Shwarz for demo ... for(int iter=0;iter <10; ++iter) { real[int] b= onG .* u[]; b = onG ? b : Bi ; v[] = Ai^-1*b; Update(v[],u[]); if(vdebug) plotMPIall(Thi,u[],"u-"+iter); v[] -= u[]; real err = v[].linfty; real umax = u[].max; real[int] aa=[err,umax], bb(2); mpiAllReduce(aa,bb,comm,mpiMAX); real errg = bb[0]; real umaxg = bb[1]; if(ipart==0) cout << ipart << " err = " << errg << " u. max " << umaxg << endl; if(errg< 1e-5) break; } if(vdebug) plotMPIall(Thi,u[],"u-final"); settt real errg =1,umaxg; { real umax = u[].max,umaxg; real[int] aa=[umax], bb(1); mpiAllReduce(aa,bb,comm,mpiMAX); errg=bb[0]; if(ipart==0) cout << " umax global = " << bb[0] << " Wtime = " << (ttt[ittt-1]-ttt[ittt-2]) << " s " << " " << kiter << endl; } if(sff != "") { ofstream ff(sff+".txt",append); cout << " ++++ " ; cout << mpirank <<"/" << mpisize << " k=" << ksplit << " n= " << nloc << " " << sizeoverlaps << " it= " << kiter ; for (int i=1; i8000) lerr=0.01; if(re>10000) lerr=0.005; for(int step=0;step<2;step++) { if( mpirank==0) { Th=change(Th,fregion=1); Th=adaptmesh(Th,[u1,u2],p,err=lerr,nbvx=100000); Th=change(Th,fregion=nuTriangle%mpisize); } broadcast(processor(0),Th); //plot(Th,wait=0); [u1,u2,p]=[u1,u2,p]; [up1,up2,pp]=[up1,up2,pp]; for (i=0;i<=20;i++) { nu =1./re; up1[]=u1[]; real[int] b = vNS(0,XXMh); matrix Ans=vDNS(XXMh,XXMh,tgv=ttgv); set(Ans,solver=sparsesolver,master=-1); real[int] w = Ans^-1*b; u1[] -= w; if( mpirank==0) cout << step << " iter = "<< i << " " << w.l2 << " rey = " << re << endl; if(w.l2<1e-6) break; // uu1=u1;uu2=u2; //plot(coef=0.2,cmm=" [u1,u2] et p ",p,[uu1,uu2]); } ; } uu1=u1;uu2=u2; streamlines; if( mpirank==0) plot(coef=0.2,cmm="rey="+re+" [u1,u2] et psi ",psi,[uu1,uu2],wait=0,nbiso=20,ps="cavity-"+re+".ps"); } freefem++-3.61-1/examples++-mpi/testsolver_SuperLU_DIST.edp000644 000767 000024 00000011416 13256636774 023523 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "real_SuperLU_DIST_FreeFem" load "complex_SuperLU_DIST_FreeFem" assert(mpisize>=2); int[int] procs=[0,1]; mpiGroup gpr(procs); mpiComm comm(gpr); // FFCS - reference value for regression tests real regtest; if ( bool(comm)) { ///////////////////////////// // real arithmetics case ///////////////////////////// // read parameter for SuperLU\_DIST from file verbosity=1; { matrix A = [[ 1e16, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1e16, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver,datafilename="ffsuperlu_dist_fileparam.txt",commworld=comm); cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } } // give parameter for superlu in this file with string parameter (sparams) { matrix A = [[ 1e16, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1e16, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver,sparams="nprow=2,npcol=1,matrix=distributedglobal,ColPerm=MMD_AT_PLUS_A",commworld=comm); // option selected for SuperLU_DIST // nprow= 2, npcol = 1 // matrix = distributedglobal // ParSymbFact = NO, ColPerm = MMD_AT_PLUS_A, RowPerm = LargeDiag // DiagPivotThresh = 1.0, DiagScale = NOEQUIL // ReplaceTinyPivot = NO, SolveInitialized = NO, RefineInitialized = NO // IterRefine = NOREFINE cout << "solving solution" << endl; x = A^-1*b; cout << "b=" << b << endl; cout << "x=" << endl; cout << x << endl; di = xx-x; if(mpirank==0){ cout << "x-xx="<< endl; cout << "Linf "<< di.linfty << " L2 " << di.l2 << endl; } b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; } ///////////////////////////// // complex arithmetics case ///////////////////////////// // read parameter for SuperLU\_DIST from file if (1) { // Resolution avec SuperLU_DIST COMPLEX int N=40; complex[int,int] AA(N,N); AA=0.+0i; for(int ii=1;ii A; A = AA; complex[int] xx(N), x(N), b(N),b1(N), di(N); for(int j=0;j A; A = AA; complex[int] xx(N), x(N), b(N),b1(N), di(N); for(int j=0;j$file" or die; print FILE $contents; close FILE; } # Local Variables: # mode:cperl # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/build/orgindex000755 000767 000024 00000010321 13256636774 016464 0ustar00hechtstaff000000 000000 #!/usr/bin/perl # Build an index of all Emacs org-mode hyperlinks # ====================================================================== # Written by Antoine Le Hyaric # http://www.ljll.math.upmc.fr/lehyaric # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Build an index of all Emacs org-mode hyperlinks" default=0 freefem perl start=22/10/2013 upmc written use strict; use warnings; use threads; use threads::shared; use Path::Class; # relative() use File::Basename; # dirname() use Cwd; # getcwd() # Scan all files in the FF directory tree my $pwd=getcwd(); my %anchors; share %anchors; my @q; share @q; my $dir=''; my @ignore=`cat .hgignore`; foreach my $f(`find . -type f`){push @q,$f} # core count inspired from [[file:../../../alh/perl/System.ph::nbcores]] sub nbcores{ my $n=1; if(-e "/proc/cpuinfo"){$n=`grep 'processor.*:' /proc/cpuinfo|wc -l`} # linux elsif(-x "/usr/sbin/sysctl"){$n=`sysctl -n hw.ncpu`} # macos elsif(defined $ENV{NUMBER_OF_PROCESSORS}){$n=$ENV{NUMBER_OF_PROCESSORS}} # windows return $n; } # start as many threads as possible my @threads; for(my $i=0;$icreate(\&scanfiles)} foreach(@threads){$_->join()} sub scanfiles{ while(defined(my $f=pop @q)){ # relative path name is required for the index to be operational on any user machine $f=~s/^\.\///; chomp $f; my $frel=file($f)->relative($pwd); # files to skip because of .hgignore my $found=0; foreach my $r(@ignore){ chomp $r; if($f=~/$r/){ $found=1; last; } } next if $found; # files to skip for other reasons next if $f=~/\.(bmp|png|jpg|eps|pdf|tar|gz|zip|tgz)$/; # not text next if $f=~/\.hg\//; # not text next if $f=~/examples\+\+-load\/include\//; # duplicated text # make sure that we don't leave absolute paths in the hyperlinks because these would not work on other machines my $cref=`cat $f`; my $c=$cref; while($cref=~m/\[\[file:([^:\]]+)(.*)\]\]/g){ # hyperlink potentially containing an absolute path my $labs=$1; if($labs=~/^~\//){ # set HOME value my $labshome=$labs; $labshome=~s/^~/$ENV{HOME}/; # change absolute path to relative in file contents my $lrel=file($labshome)->relative(dirname($f)); my $labsqm=quotemeta($labs); $c=~s/\[\[file:$labsqm/\[\[file:$lrel/g; } } # update file if some paths were changed if($c ne $cref){ print "Changed hyperlink paths to relative in $f\n"; open FILE,">$f" or die; print FILE $c; close FILE; } # find name anchors in file contents while($c=~m/<<([^<> ,{}]+)>>/g){$anchors{$1}.=" [[file:${frel}::$1][$frel]]"} } } # print out all existing hyperlink anchors print "\n"; open OUT,">index.org" or die; print OUT "# -*- mode:org;coding:utf-8 -*-\n"; print OUT "# Hyperlinks into the FreeFem++ source, built with [[file:build/orgindex]]\n"; print OUT "# (do not modify this file manually: update the source files and run [[file:build/orgindex]] again)\n"; print OUT "\n"; foreach(sort {uc($a) cmp uc($b)} keys %anchors){ print OUT "$_"; my $padding=25; if(length($_)<$padding){print OUT " "x($padding-length($_))} print OUT "$anchors{$_}\n"; } close OUT; # Local Variables: # mode:cperl # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/build/download000755 000767 000024 00000005150 13256636774 016460 0ustar00hechtstaff000000 000000 #!/bin/bash -xe # # Download a file by whatever means available # # ====================================================================== # Antoine Le Hyaric (1,2) # 1- CNRS, UMR 7598, Laboratoire Jacques-Louis Lions, F-75005, Paris, France # 2- Sorbonne Universités, UPMC Univ Paris 06, UMR 7598, Laboratoire Jacques-Louis Lions, F-75005, Paris, France # ====================================================================== # 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 # ====================================================================== # [[shell:header\alh 'download']] (cf [[file:~/alh/bin/headeralh]]) # emacs-keywords brief="Download a file by whatever means available" default=0 freefem shellxe start=21/10/10 upmc # $1=url # $2=local name # $3=BAD_CERT if the SSL certificate of the web server is wrong if test -x /usr/bin/wget || test -x /usr/bin/wget.exe || test -x /opt/local/bin/wget then opts= if test "$3" = BAD_CERT then opts=--no-check-certificate fi # [[man:wget]] we could use no-verbose to avoid mixing several wget outputs together when called concurrently in # [[file:../download/getall]], but then nothing moves while the download goes on, and the user may think that it's # stuck. wget "$1" --timeout=30 --tries=2 --output-document="$2" $opts ret=$? elif test -x /usr/bin/curl then curl -L "$1" --output "$2" ret=$? elif test -x /usr/bin/GET then GET "$1" > "$2" ret=$? else echo FF download: No way to download files from the web echo FF download: Please install wget or curl or GET exit 1 fi if test "$ret" -eq 0 then case `file $2` in *zip*) exit 0 ;; *) echo " incorrect file type => removing " $2; rm $2; exit 1 ;; esac fi echo "Error download $2" exit $ret # Local Variables: # mode:shell-script # ispell-local-dictionary:"british" # coding:utf-8 # eval:(flyspell-prog-mode) # eval:(outline-minor-mode) # End: # LocalWords: emacs freefem++-3.61-1/build/ff-md5000755 000767 000024 00000003150 13256636774 015725 0ustar00hechtstaff000000 000000 #!/usr/bin/perl # Download third-party packages independently of FF configuration (request from FH) # ====================================================================== # Written by Antoine Le Hyaric # http://www.ljll.math.upmc.fr/lehyaric # Laboratoire Jacques-Louis Lions # Universit Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Download third-party packages independently of FF configuration (request from FH)" default=0 freefem perl start=21/10/2013 upmc written use Digest::MD5 qw(md5_hex); # [[http://perldoc.perl.org/Digest/MD5.html]] ($ff,$mm) =@ARGV; if( ! -e "$ff") {exit 2; } $hh=md5_hex(`cat $ff`); # print "ff=$ff, hh= $hh == $mm, \n"; if ( "$hh" == "$mm") {exit 0;} else {exit 1;} freefem++-3.61-1/build/links2files000755 000767 000024 00000004622 13256636774 017101 0ustar00hechtstaff000000 000000 #!/usr/bin/perl # ====================================================================== # Written by Antoine Le Hyaric # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh freefem perl start=7/10/10 upmc use strict; # if a file is a soft link, just convert it into a real file. I know this is dangerous if the file the link points to # changes, but I don't have many choices to make the MinGW compilers work (they do not understand Cygwin softlinks). traverse(<*>); sub traverse{ foreach my $arg(@_){ # 4/12/10: under cygwin, "find" seems to have random problems (the file system lags behind when doing many file # moves in quick succession?), so just replace it with a local recursive subroutine. if(-d $arg){ print "links2files: traversing $arg...\n"; traverse(<$arg/*>); next; } # do not use readlink -f because it does not exist on Mac. Result is in $org my $org; my $nextorg=$arg; do{ $org=$nextorg; $nextorg=`readlink $org`; }while($nextorg ne ''); if(-l $arg){ chomp $org; if(-e $org){ print "links2files: $arg -> $org\n"; unlink $arg; system "cp $org $arg"; # sometimes on Cygwin the resulting file is of size zero and not readable by anyone? And then if we try again it # works fine! die "$arg is of size 0" unless -s $arg; } } } } # Local Variables: # mode:cperl # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/examples++-3d/ref.edp000644 000767 000024 00000000031 13256636774 017333 0ustar00hechtstaff000000 000000 real REF3dXLeman=196.33; freefem++-3.61-1/examples++-3d/meditddm.edp000644 000767 000024 00000003501 13256636774 020353 0ustar00hechtstaff000000 000000 // meditddm.edp load "medit" /******************************************** Initial Problem: Resolution of the following EDP: $- \Delta u = f$ on $\Omega =\{ (x,y) | 1 \leq sqrt(x^2+y^2) \geq 2}$ $- \Delta u = f1$ on $\Omega_{1} =\{ (x,y) | 0.5 \leq sqrt(x^2+y^2) \geq 1.}$ $u = 1$ on $\Gamma$ + Null Neumman condition on $\Gamma_{1}$ and on $\Gamma_{2}$ We find the solution $u$ in solving two EDP defined on domain $\Omega$ and $\Omega_{1}$ This solution is vizualize with ffmedit *********************************************/ verbosity=3; border Gamma(t=0,2*pi){x=cos(t); y=sin(t); label=1;}; border Gamma1(t=0,2*pi){x=2*cos(t); y=2*sin(t); label=2;}; border Gamma2(t=0,2*pi){x=0.5*cos(t); y=0.5*sin(t); label=3;}; // construction of mesh of domain $\Omega$ mesh Th=buildmesh(Gamma1(40)+Gamma(-40)); fespace Vh(Th,P2); func f=sqrt(x*x+y*y); Vh us,v; macro Grad2(us) [dx(us),dy(us)] // EOM problem Lap2dOmega(us,v,init=false)=int2d(Th)(Grad2(v)' *Grad2(us)) - int2d(Th)(f*v)+on(Gamma,us=1) ; // Resolution of EDP defined on the domain $\Omega$ // $- \Delta u = f$ on $\Omega$ // $u = 1$ on $\Gamma // + Null Neumann condition on $\Gamma_{1}$ Lap2dOmega; // construction of mesh of domain $\Omega1 =\{ (x,y) | 0.5 \leq sqrt(x^2+y^2) \geq 1.}$ mesh Th1=buildmesh(Gamma(40)+Gamma2(-40)); fespace Vh1(Th1,P2); func f1=10*sqrt(x*x+y*y); Vh1 u1,v1; macro Grad21(u1) [dx(u1),dy(u1)] // EOM problem Lap2dOmega1(u1,v1,init=false)=int2d(Th1)(Grad21(v1)' *Grad21(u1)) - int2d(Th1)(f1*v1)+on(Gamma,u1=1) ; // Resolution of EDP defined on the domain $\Omega_{1}$ // $- \Delta u = f1$ on $\Omega_{1}$ // $u = 1$ on $\Gamma$ // + Null Neumann condition on $\Gamma_{2}$ Lap2dOmega1; // vizualisation of solution of the initial problem medit("solution",Th,us,Th1,u1,order=1,meditff="ffmedit",save="testsavemedit.solb",wait=1); freefem++-3.61-1/examples++-3d/fallingspheres.edp000644 000767 000024 00000002576 13256636774 021605 0ustar00hechtstaff000000 000000 // test of mmg3d for move objets in a mesh ... load "msh3" load "tetgen" load "medit" load "mmg3d-v4.0" include "MeshSurface.idp" // build mesh of a box (311) wit 2 holes (300,310) real hs = 0.8; int[int] N=[4/hs,8/hs,11.5/hs]; real [int,int] B=[[-2,2],[-2,6],[-10,1.5]]; int [int,int] L=[[311,311],[311,311],[311,311]]; mesh3 ThH = SurfaceHex(N,B,L,1); mesh3 ThSg =Sphere(1,hs,300,-1); // "gluing" surface meshs to tolat boundary meshes mesh3 ThSd =Sphere(1,hs,310,-1); ThSd=movemesh(ThSd,[x,4+y,z]); mesh3 ThHS=ThH+ThSg+ThSd; medit("ThHS", ThHS); real voltet=(hs^3)/6.; cout << " voltet = " << voltet << endl; real[int] domaine = [0,0,-4,1,voltet]; real [int] holes=[0,0,0,0,4,0]; mesh3 Th = tetg(ThHS,switch="pqaAAYYQ",regionlist=domaine,holelist=holes); medit("Box-With-two-Ball",Th); // End build mesh // int[int] opt=[9,0,64,0,0,3]; // options of mmg3d see freeem++ doc real[int] vit=[0,0,-0.3]; func zero = 0.; func dep = vit[2]; fespace Vh(Th,P1); macro Grad(u) [dx(u),dy(u),dz(u)] // Vh uh,vh; // to compute the displacemnt field problem Lap(uh,vh,solver=CG) = int3d(Th)(Grad(uh)'*Grad(vh)) //') for emacs + on(310,300,uh=dep) +on(311,uh=0.); for(int it=0; it<29; it++){ cout<<" ITERATION "<3.4-1 // --------- new stuff ----------------- int k=0,l=1,e=1; Th.nbe ; // return the number of boundary element \hfilll Th.be(k); // return the boundary element k $\in \{0,...,Th.nbe-1\}$ \hfilll Th.be(k)[l]; // return the vertices l $\in \{0,1\}$ of boundary element k \hfilll Th.be(k).Element ; // return the tet contening the boundary element k \hfilll Th.be(k).whoinElement ; // return the egde number of triangle contening the boundary element k \hfilll Th[k].adj(e) ; // return adjacent tet to k by face e, and change the value of e to \hfilll // the corresponding face in the adjacent tet Th[k] == Th[k].adj(e) ;// non adjacent tet return the same Th[k] != Th[k].adj(e) ;// true adjacent tet cout << " print mesh connectivity " << endl; int nbelement = Th.nt; for (int k=0;k " << int(Th[k].adj((ee=e))) << " " << ee << " adj: " << ( Th[k].adj((ee=e)) != Th[k]) << endl; } // note : if k == int(Th[k].adj(ee=e)) not adjacent element int nbboundaryelement = Th.nbe; Th.be; for (int k=0;k.1; // plot(u,wait=1); unssd+= u[]; s[]= M'*u[];//'; s = s >0.1; } unssd /= (n); u[]=unssd; ssd=s[]; return true; } int withplot=3; include "cube.idp" int[int] NN=[25,25,25]; // the number of step in each direction real [int,int] BB=[[0,1],[0,1],[0,1]]; // bounding box int [int,int] L=[[1,1],[1,1],[1,1]]; // the label of the 6 face left,right, // front, back, down, right mesh3 Th=Cube(NN,BB,L); int npart= nnx*nny*nnz; fespace Ph(Th,P0); fespace Vh(Th,P1); Ph part; Vh sun=0,unssd=0; Ph xx=x,yy=y,zz=z,nupp; //part = int(xx*nnx)*nny + int(yy*nny); part = int(xx*nnx)*nny*nnz + int(yy*nny)*nnz + int(zz*nnz); //plot(part,wait=1); if(withmetis) { load "metis"; int[int] nupart(Th.nt); metisdual(nupart,Th,npart); for(int i=0;i1) plot(part,fill=1,cmm="dual",wait=1); mesh3[int] aTh(npart); mesh3 Thi=Th; fespace Vhi(Thi,P1); Vhi[int] au(npart),pun(npart); matrix[int] Rih(npart); matrix[int] Dih(npart); matrix[int] aA(npart); Vhi[int] auntgv(npart); Vhi[int] rhsi(npart); for(int i=0;i0,label=10,split=1); Rih[i]=interpolate(Vhi,Vh,inside=1); // Vh -> Vhi if(RAS) { suppi= abs(part-i)<0.1; varf vSuppi(u,v)=int3d(Th,qforder=1)(suppi*v/volume); unssd[]= vSuppi(0,Vh); unssd = unssd>0.; if(withplot>19) plot(unssd,wait=1); } pun[i][]=Rih[i]*unssd[]; sun[] += Rih[i]'*pun[i][];//'; if(withplot>9) plot(part,aTh[i],fill=1,wait=1); } real[int] viso=[0,0.1,0.2,0.3]; plot(sun,wait=1,dim=3,fill=1,viso=viso); for(int i=0;i8) plot(pun[i],wait=1); } // verif partition of unite macro Grad(u) [dx(u),dy(u),dz(u)]//EOM sun=0; for(int i=0;i5) plot(sun,fill=1,wait=1); cout << sun[].max << " " << sun[].min<< endl; // verification of the partition of the unite. assert( 1.-1e-9 <= sun[].min && 1.+1e-9 >= sun[].max); int nitermax=1000; { Vh un=0; for(int iter=0;iter 0.2); } //EOF Verif(x,1) Verif(y,2) Verif(z,3) assert(err==0); freefem++-3.61-1/examples++-3d/regtests.edp000644 000767 000024 00000002120 13256636774 020420 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ // Regression tests // ---------------- // The tests are checked against reference values by "make check" in // each examples subdirectory // "ref.edp" contains all reference values and may be rebuilt with // "make Ref" // $Id$ // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. NoUseOfWait=true; int verbosityy=verbosity; include "ref.edp"; // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. cout << "--------- file : 3d-Leman.edp -----------------" << endl; verbosity=verbosityy; { include "3d-Leman.edp"; real TEST3dXLeman=vregtest; cout<<"3d-Leman reference value = "< $@ # To create a new set of reference values in "ref.edp" Ref: makeref.edp freefem++.pref export FF_LOADPATH=../examples++-load/.;../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref 3d-Leman.edp:freefem++.pref install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: freefem++-3.61-1/examples++-3d/LaplaceRT-3d.edp000644 000767 000024 00000013424 13256636774 020704 0ustar00hechtstaff000000 000000 /* $ - \Delta p = f $ on $\Omega$, $ dp / dn = (g1d,g2d). n $ on $\Gamma_{1}$ $ p = gd $ on $\Gamma_{2}$ with de Mixte finite element formulation Find $p\in L^2(\Omega) $ and $u\in H(div) $ such than $$ u - Grad p = 0 $$ $$ - div u = f $$ $$ u. n = (g1d,g2d). n \mbox{ on } \Gamma_{2}$$ $$ p = gd \mbox{ on }\Gamma_{1}$$ the variationnel form is: $\forall v\in H(div)$; $v.n = 0$ on $\Gamma_{2} $: $ \int_\Omega u v + p div v -\int_{\Gamma_{1}} gd* v.n = 0 $ $\forall q\in L^2$: $ +\int_\Omega q div u = -\int_Omega f q $ and $ u.n = (g1n,g2n).n$ on $\Gamma_2$ */ include "cube.idp" int[int] Nxyz=[10,10,10]; real [int,int] Bxyz=[[0,1],[0,1],[0,1]]; int [int,int] Lxyz=[[1,1],[1,1],[2,1]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); fespace Vh(Th,P1); fespace Rh(Th,RT03d); fespace Nh(Th,Edge03d);// Nedelec Finite element. fespace Ph(Th,P0); func gd = 1.; func g1n = 2.; func g2n = 3.; func g3n = 4.; func f = 1.; Rh [u1,u2,u3],[v1,v2,v3]; Nh [e1,e2,e3]; [u1,u2,u3]=[1+100*x,2+100*y,3+100*z]; // a + b ^ x = /* b1 x a1 + b2*z - b3*y b2 ^ y = a2 - b1*z + b3*x b3 z a3 + b1*y - b2*x */ real b1=30,b2=10,b3=20; func ex1=100+b2*z-b3*y; func ex1x=0.; func ex1y=-b3+0; func ex1z=b2+0; func ex2=200.- b1*z + b3*x ; func ex2x= b3 +0; func ex2y= 0. ; func ex2z= -b1 +0; func ex3=300.+b1*y - b2*x ; func ex3x= -b2 +0; func ex3y= b1 +0; func ex3z= 0. ; [e1,e2,e3]=[ex1,ex2,ex3]; int k=Th(.1,.2,.3).nuTriangle ; cout << " u = " << u1(.1,.2,.3) << " " << u2(.1,.2,.3) << " " << u3(.1,.2,.3) << endl; cout << " dx u = " << dx(u1)(.1,.2,.3) << " " << dy(u2)(.1,.2,.3) << " " << dz(u3)(.1,.2,.3) << endl; cout << " e = " << e1(.1,.2,.3) << " " << e2(.1,.2,.3) << " " << e3(.1,.2,.3) << endl; cout << " ex = " << ex1(.1,.2,.3) << " " << ex2(.1,.2,.3) << " " << ex3(.1,.2,.3) << endl; cout << " dx,dy,dz e1x= " << ex1x(.1,.2,.3) << " " << ex1y(.1,.2,.3) << " " << ex1z(.1,.2,.3) << endl; cout << " dx,dy,dz e2x= " << ex2x(.1,.2,.3) << " " << ex2y(.1,.2,.3) << " " << ex2z(.1,.2,.3) << endl; cout << " dx,dy,dz e3x= " << ex3x(.1,.2,.3) << " " << ex3y(.1,.2,.3) << " " << ex3z(.1,.2,.3) << endl; cout << " dx,dy,dz e1 = " << dx(e1)(.1,.2,.3) << " " << dy(e1)(.1,.2,.3) << " " << dz(e1)(.1,.2,.3) << endl; cout << " dx,dy,dz e2 = " << dx(e2)(.1,.2,.3) << " " << dy(e2)(.1,.2,.3) << " " << dz(e2)(.1,.2,.3) << endl; cout << " dx,dy,dz e3 = " << dx(e3)(.1,.2,.3) << " " << dy(e3)(.1,.2,.3) << " " << dz(e3)(.1,.2,.3) << endl; cout << " k = " << k << endl; cout << Rh(k,0) << " " <1.e-10,split=1,label=135); medit("Lac",wait=1,Th); plot(Th); // FFCS: testing 3d plots medit("LacTruncated",Th3,wait=1); plot(Th3); // FFCS: testing 3d plots freefem++-3.61-1/examples++-3d/cone.edp000644 000767 000024 00000001544 13256636774 017515 0ustar00hechtstaff000000 000000 // example to build a mesh a cone load "msh3" load "medit" // cone using buildlayers with a triangle real RR=1,HH=1; border Taxe(t=0,HH){x=t;y=0;label=0;}; border Hypo(t=1,0){x=HH*t;y=RR*t;label=1;}; border Vert(t=0,RR){x=HH;y=t;label=2;}; int nn=10; real h= 1./nn; mesh Th2=buildmesh( Taxe(HH*nn)+ Hypo(sqrt(HH*HH+RR*RR)*nn) + Vert(RR*nn) ) ; plot(Th2,wait=1); //medit("circle",ThT); int MaxLayersT=(int(2*pi*RR/h)/4)*4; func zminT = 0; func zmaxT = 2*pi; func fx= y*cos(z);// / max( abs(cos(z) ), abs(sin(z))); func fy= y*sin(z);// / max( abs(cos(z) ), abs(sin(z))); func fz= x; int[int] r1T=[0,0], r2T=[0,0,2,2]; int[int] r4T=[0,2]; mesh3 Th3T=buildlayers(Th2,coef= max(.01,y/max(x,0.4) ), MaxLayersT,zbound=[zminT,zmaxT],transfo=[fx,fy,fz],facemerge=1, region=r1T, labelmid=r2T); medit("cone",Th3T,wait=1); // FFCS: testing 3d plots plot(Th3T,cmm="cone"); freefem++-3.61-1/examples++-3d/regtests.m4000644 000767 000024 00000000470 13256636774 020176 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ include(../regtests.m4) // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. ONETEST(3d-Leman,vregtest,0.1) freefem++-3.61-1/examples++-3d/dodecaedre01.mesh000644 000767 000024 00000061312 13256636774 021174 0ustar00hechtstaff000000 000000 MeshVersionFormatted 1 # Mesh generated by nb2mesh (INRIA) Dimension 3 # Set of mesh vertices Vertices 216 0.491123 0.356822 0.794654 0 -0.187592 0.57735 0.794654 0 -0.607062 9.31409e-17 0.794654 0 -0.187592 -0.57735 0.794654 0 0.491123 -0.356822 0.794654 0 0.187592 0.57735 -0.794654 0 -0.491123 0.356822 -0.794654 0 -0.491123 -0.356822 -0.794654 0 0.187592 -0.57735 -0.794654 0 0.607062 -4.65705e-17 -0.794654 0 0.794654 0.57735 0.187592 0 0.303531 0.934172 -0.187592 0 -0.303531 0.934172 0.187592 0 -0.794654 0.57735 -0.187592 0 -0.982247 1.39711e-16 0.187592 0 -0.794654 -0.57735 -0.187592 0 -0.303531 -0.934172 0.187592 0 0.303531 -0.934172 -0.187592 0 0.794654 -0.57735 0.187592 0 0.982247 -4.65705e-17 -0.187592 0 -2.79423e-17 0 1 0 -2.79423e-17 2.79423e-17 -1 0 0.276393 0.850651 0.447214 0 -0.723607 0.525731 0.447214 0 -0.723607 -0.525731 0.447214 0 0.276393 -0.850651 0.447214 0 0.894427 -5.58846e-17 0.447214 0 -0.276393 0.850651 -0.447214 0 -0.894427 6.98557e-17 -0.447214 0 -0.276393 -0.850651 -0.447214 0 0.723607 -0.525731 -0.447214 0 0.723607 0.525731 -0.447214 0 0.25923 -0.188342 0.947274 0 0.525731 -5.94228e-17 0.850651 0 0.25923 0.188342 0.947274 0 0.0990171 0.304743 -0.947274 0 0.425325 0.309017 -0.850651 0 0.320426 -9.83253e-18 -0.947274 0 0.0468717 0.753743 0.655496 0 0.16246 0.5 0.850651 0 0.405119 0.637341 0.655496 0 -0.702368 0.277497 0.655496 0 -0.425325 0.309017 0.850651 0 -0.480959 0.58224 0.655496 0 -0.480959 -0.58224 0.655496 0 -0.425325 -0.309017 0.850651 0 -0.702368 -0.277497 0.655496 0 0.405119 -0.637341 0.655496 0 0.16246 -0.5 0.850651 0 0.0468717 -0.753743 0.655496 0 0.731336 0.188342 0.655496 0 0.731336 -0.188342 0.655496 0 -0.0468717 0.753743 -0.655496 0 -0.16246 0.5 -0.850651 0 -0.405119 0.637341 -0.655496 0 -0.731336 0.188342 -0.655496 0 -0.525731 8.91342e-17 -0.850651 0 -0.731336 -0.188342 -0.655496 0 -0.405119 -0.637341 -0.655496 0 -0.16246 -0.5 -0.850651 0 -0.0468717 -0.753743 -0.655496 0 0.480959 -0.58224 -0.655496 0 0.425325 -0.309017 -0.850651 0 0.702368 -0.277497 -0.655496 0 0.702368 0.277497 -0.655496 0 0.480959 0.58224 -0.655496 0 -0.0990171 0.304743 0.947274 0 -0.320426 4.91626e-17 0.947274 0 -0.0990171 -0.304743 0.947274 0 0.0990171 -0.304743 -0.947274 0 -0.25923 -0.188342 -0.947274 0 -0.25923 0.188342 -0.947274 0 0.688191 0.5 0.525731 0 0.565332 0.753743 0.33507 0 0.587785 0.809017 -1.48557e-17 0 0.306102 0.942084 0.137036 0 8.91342e-17 1 0 0 -0.0143242 0.942084 0.33507 0 -0.262866 0.809017 0.525731 0 -0.542155 0.770582 0.33507 0 -0.587785 0.809017 0 0 -0.801385 0.58224 0.137036 0 -0.951057 0.309017 0 0 -0.900402 0.277497 0.33507 0 -0.850651 1.2463e-16 0.525731 0 -0.900402 -0.277497 0.33507 0 -0.951057 -0.309017 1.48557e-17 0 -0.801385 -0.58224 0.137036 0 -0.587785 -0.809017 1.48557e-17 0 -0.542155 -0.770582 0.33507 0 -0.262866 -0.809017 0.525731 0 -0.0143242 -0.942084 0.33507 0 -1.78268e-16 -1 0 0 0.306102 -0.942084 0.137036 0 0.587785 -0.809017 0 0 0.565332 -0.753743 0.33507 0 0.688191 -0.5 0.525731 0 0.891549 -0.304743 0.33507 0 0.951057 -0.309017 0 0 0.990566 -5.40789e-17 0.137036 0 0.951057 0.309017 -1.48557e-17 0 0.891549 0.304743 0.33507 0 -0.688191 0.5 -0.525731 0 -0.565332 0.753743 -0.33507 0 -0.306102 0.942084 -0.137036 0 0.0143242 0.942084 -0.33507 0 0.262866 0.809017 -0.525731 0 -0.688191 -0.5 -0.525731 0 -0.891549 -0.304743 -0.33507 0 -0.990566 1.10616e-16 -0.137036 0 -0.891549 0.304743 -0.33507 0 0.262866 -0.809017 -0.525731 0 0.0143242 -0.942084 -0.33507 0 -0.306102 -0.942084 -0.137036 0 -0.565332 -0.753743 -0.33507 0 0.850651 -4.98521e-17 -0.525731 0 0.900402 -0.277497 -0.33507 0 0.801385 -0.58224 -0.137036 0 0.542155 -0.770582 -0.33507 0 0.542155 0.770582 -0.33507 0 0.801385 0.58224 -0.137036 0 0.900402 0.277497 -0.33507 0 -0.641066 0.180621 -0.121104 0 -0.289149 0.338185 0.123889 0 -0.53285 0.493571 -0.1668 0 -0.657109 0.289176 0.105955 0 -0.660539 0.140781 -0.339313 0 0.236469 0.702297 -0.119761 0 0.293479 0.664326 0.253992 0 0.177505 0.363349 -0.0220877 0 -0.13669 0.666735 0.148585 0 -0.077289 0.624594 -0.105375 0 0.490099 0.439095 -0.389076 0 0.572485 0.513847 0.00158281 0 -0.0147537 -0.301166 0.00573164 0 0.027261 -0.609388 -0.0368522 0 -0.210932 -0.44583 0.274374 0 -0.187906 -0.469788 -0.121119 0 -0.264179 0.00110005 -0.0686397 0 0.139429 -0.176865 0.141747 0 0.137993 0.0397672 -0.0474711 0 0.0549939 -0.277568 0.38053 0 -0.31332 -0.205816 0.246979 0 -0.470354 -0.172651 -0.0444443 0 -0.512056 -0.451171 0.0222751 0 -0.63543 -0.27962 0.191868 0 -0.485376 -0.459615 0.361165 0 -0.377691 -0.632462 -0.145148 0 0.195227 0.497143 0.558163 0 0.471638 0.295428 0.498678 0 -0.0767607 0.422523 0.42746 0 -0.0133728 0.314914 0.699076 0 0.210462 0.199609 0.658993 0 0.29383 0.428373 0.283453 0 -0.751395 -0.148984 -0.116319 0 -0.440269 -0.0800457 -0.444693 0 0.168272 0.0650597 -0.364626 0 0.129559 -0.219634 -0.638505 0 0.463777 -0.0623083 -0.361699 0 0.343182 -0.330995 -0.364227 0 0.493658 -0.143422 -0.586334 0 0.411319 0.125283 -0.636386 0 0.264237 -0.384147 -0.612663 0 0.501592 0.206461 -0.358475 0 0.0132368 0.307451 -0.300997 0 -0.0152879 0.569786 -0.430361 0 0.768744 -0.0853962 0.0302352 0 0.703096 -0.0195892 -0.265073 0 0.66767 -0.0937254 0.365578 0 0.624914 0.135741 0.228425 0 0.43053 -0.191743 0.280203 0 0.628446 -0.397168 0.176134 0 -0.294394 -0.562508 -0.388368 0 0.541027 -0.233274 -0.0637026 0 0.24393 0.432938 -0.480573 0 -0.0108428 0.352749 -0.652537 0 -0.345747 0.285932 -0.306576 0 -0.462044 0.0270721 0.201178 0 -0.74082 0.00772943 0.147783 0 -0.0988376 -0.0884954 -0.304341 0 -0.536653 -0.327598 -0.375823 0 -0.254917 -0.700613 0.152166 0 0.0579332 0.0669963 0.312854 0 -0.313188 0.627651 -0.209244 0 -0.413966 0.58379 0.136803 0 0.491904 -0.0087985 0.549865 0 0.0023627 -0.55211 0.524977 0 0.289635 -0.414128 0.643574 0 0.178419 -0.180643 0.644293 0 -0.609006 0.0150692 0.405833 0 -0.510316 0.242031 0.42591 0 0.317525 0.133964 0.182226 0 0.48528 0.243879 -0.00862047 0 0.614023 0.390478 0.226698 0 0.274736 -0.399844 -0.0376275 0 -0.125503 0.319529 -0.117781 0 0.0874565 -0.359885 -0.278676 0 0.690974 0.253499 -0.13669 0 0.313572 -0.578924 0.300802 0 -0.371471 0.262212 -0.608757 0 -0.0594493 0.658146 0.400466 0 -0.182072 -0.407708 0.600325 0 -0.30708 -0.124887 0.675407 0 -0.260489 0.127059 0.594044 0 0.0510777 -0.6298 -0.374388 0 -0.072537 -0.384745 -0.477982 0 0.389971 -0.550182 -0.266139 0 0.598158 -0.329966 -0.383532 0 0.0625799 -0.651979 0.186025 0 0.431474 -0.619128 -0.00192976 0 -0.0958472 -0.00188602 0.654796 0 -0.171146 -0.117364 -0.711793 0 -0.268558 -0.406826 -0.616475 0 -0.326231 0.520121 0.384798 0 -0.105999 0.124624 -0.618196 0 0.152665 0.0433483 -0.681703 0 # Set of Triangles Triangles 240 33 34 35 0 36 37 38 0 39 40 41 0 42 43 44 0 45 46 47 0 48 49 50 0 51 34 52 0 53 54 55 0 56 57 58 0 59 60 61 0 62 63 64 0 65 37 66 0 35 40 67 0 67 43 68 0 68 46 69 0 69 49 33 0 38 63 70 0 70 60 71 0 71 57 72 0 72 54 36 0 41 73 74 0 74 75 76 0 76 77 78 0 78 79 39 0 44 79 80 0 80 81 82 0 82 83 84 0 84 85 42 0 47 85 86 0 86 87 88 0 88 89 90 0 90 91 45 0 50 91 92 0 92 93 94 0 94 95 96 0 96 97 48 0 52 97 98 0 98 99 100 0 100 101 102 0 102 73 51 0 55 103 104 0 104 81 105 0 105 77 106 0 106 107 53 0 58 108 109 0 109 87 110 0 110 83 111 0 111 103 56 0 61 112 113 0 113 93 114 0 114 89 115 0 115 108 59 0 64 116 117 0 117 99 118 0 118 95 119 0 119 112 62 0 66 107 120 0 120 75 121 0 121 101 122 0 122 116 65 0 21 33 35 0 5 34 33 0 1 35 34 0 22 36 38 0 6 37 36 0 10 38 37 0 23 39 41 0 2 40 39 0 1 41 40 0 24 42 44 0 3 43 42 0 2 44 43 0 25 45 47 0 4 46 45 0 3 47 46 0 26 48 50 0 5 49 48 0 4 50 49 0 27 51 52 0 1 34 51 0 5 52 34 0 28 53 55 0 6 54 53 0 7 55 54 0 29 56 58 0 7 57 56 0 8 58 57 0 30 59 61 0 8 60 59 0 9 61 60 0 31 62 64 0 9 63 62 0 10 64 63 0 32 65 66 0 10 37 65 0 6 66 37 0 21 35 67 0 1 40 35 0 2 67 40 0 21 67 68 0 2 43 67 0 3 68 43 0 21 68 69 0 3 46 68 0 4 69 46 0 21 69 33 0 4 49 69 0 5 33 49 0 22 38 70 0 10 63 38 0 9 70 63 0 22 70 71 0 9 60 70 0 8 71 60 0 22 71 72 0 8 57 71 0 7 72 57 0 22 72 36 0 7 54 72 0 6 36 54 0 23 41 74 0 1 73 41 0 11 74 73 0 23 74 76 0 11 75 74 0 12 76 75 0 23 76 78 0 12 77 76 0 13 78 77 0 23 78 39 0 13 79 78 0 2 39 79 0 24 44 80 0 2 79 44 0 13 80 79 0 24 80 82 0 13 81 80 0 14 82 81 0 24 82 84 0 14 83 82 0 15 84 83 0 24 84 42 0 15 85 84 0 3 42 85 0 25 47 86 0 3 85 47 0 15 86 85 0 25 86 88 0 15 87 86 0 16 88 87 0 25 88 90 0 16 89 88 0 17 90 89 0 25 90 45 0 17 91 90 0 4 45 91 0 26 50 92 0 4 91 50 0 17 92 91 0 26 92 94 0 17 93 92 0 18 94 93 0 26 94 96 0 18 95 94 0 19 96 95 0 26 96 48 0 19 97 96 0 5 48 97 0 27 52 98 0 5 97 52 0 19 98 97 0 27 98 100 0 19 99 98 0 20 100 99 0 27 100 102 0 20 101 100 0 11 102 101 0 27 102 51 0 11 73 102 0 1 51 73 0 28 55 104 0 7 103 55 0 14 104 103 0 28 104 105 0 14 81 104 0 13 105 81 0 28 105 106 0 13 77 105 0 12 106 77 0 28 106 53 0 12 107 106 0 6 53 107 0 29 58 109 0 8 108 58 0 16 109 108 0 29 109 110 0 16 87 109 0 15 110 87 0 29 110 111 0 15 83 110 0 14 111 83 0 29 111 56 0 14 103 111 0 7 56 103 0 30 61 113 0 9 112 61 0 18 113 112 0 30 113 114 0 18 93 113 0 17 114 93 0 30 114 115 0 17 89 114 0 16 115 89 0 30 115 59 0 16 108 115 0 8 59 108 0 31 64 117 0 10 116 64 0 20 117 116 0 31 117 118 0 20 99 117 0 19 118 99 0 31 118 119 0 19 95 118 0 18 119 95 0 31 119 62 0 18 112 119 0 9 62 112 0 32 66 120 0 6 107 66 0 12 120 107 0 32 120 121 0 12 75 120 0 11 121 75 0 32 121 122 0 11 101 121 0 20 122 101 0 32 122 65 0 20 116 122 0 10 65 116 0 # Set of tetrahedra Tetrahedra 867 123 124 125 126 0 127 83 111 110 0 14 83 111 127 0 123 125 14 126 0 128 76 129 75 0 128 130 131 132 0 128 133 107 120 0 128 134 120 75 0 135 136 137 138 0 135 139 140 141 0 135 142 140 143 0 135 139 144 143 0 145 146 87 88 0 145 147 88 90 0 145 148 89 16 0 149 150 41 1 0 149 151 152 39 0 149 153 151 154 0 123 127 155 110 0 103 125 14 127 0 109 156 127 155 0 109 127 110 155 0 157 158 159 160 0 127 109 29 58 0 127 56 156 58 0 161 116 162 159 0 161 38 162 10 0 161 160 158 163 0 161 62 163 63 0 130 141 157 164 0 130 141 165 157 0 128 166 106 107 0 128 131 130 129 0 128 132 77 106 0 167 117 168 20 0 167 169 170 171 0 167 172 169 171 0 173 61 30 59 0 167 98 169 172 0 167 168 117 174 0 167 100 169 98 0 128 132 131 77 0 65 164 133 162 0 162 164 133 175 0 128 133 175 107 0 128 165 132 166 0 175 166 107 6 0 175 176 6 37 0 143 135 138 144 0 123 177 139 156 0 144 139 178 143 0 144 179 155 146 0 144 180 181 156 0 145 146 144 155 0 145 147 90 182 0 143 139 178 183 0 139 141 183 140 0 135 140 139 143 0 145 146 147 143 0 138 180 181 144 0 166 55 28 53 0 123 179 110 155 0 83 123 127 14 0 184 166 177 55 0 184 81 125 185 0 184 125 124 185 0 126 82 84 24 0 184 125 55 177 0 169 170 27 100 0 169 51 186 52 0 169 51 170 186 0 142 187 188 189 0 179 190 191 84 0 179 85 190 84 0 179 126 83 84 0 179 146 86 87 0 179 86 190 85 0 179 146 87 155 0 179 190 178 191 0 192 183 186 150 0 192 141 174 140 0 130 192 183 141 0 130 192 154 183 0 192 183 150 154 0 193 170 194 154 0 170 192 154 193 0 130 192 141 193 0 141 140 195 174 0 130 141 196 165 0 141 196 165 180 0 165 157 175 130 0 192 174 141 193 0 141 164 193 159 0 183 141 124 130 0 192 183 140 171 0 128 130 165 175 0 135 139 141 180 0 135 197 138 180 0 139 141 180 196 0 157 197 160 141 0 141 159 193 174 0 158 9 60 70 0 198 194 193 170 0 167 198 20 168 0 198 194 134 193 0 198 133 134 121 0 198 32 133 121 0 198 168 193 164 0 198 168 122 20 0 184 132 105 131 0 128 129 77 131 0 128 132 106 166 0 132 106 166 28 0 185 184 131 124 0 124 132 130 196 0 171 199 172 97 0 184 104 125 81 0 125 126 124 185 0 123 177 125 124 0 125 82 126 185 0 127 103 177 200 0 125 55 177 103 0 184 55 125 104 0 123 127 125 177 0 123 126 14 83 0 123 144 178 179 0 123 139 124 178 0 127 125 177 103 0 136 93 18 94 0 192 174 193 170 0 130 183 154 151 0 123 144 139 178 0 141 124 130 196 0 139 124 196 177 0 135 141 195 197 0 145 181 148 16 0 146 147 25 88 0 144 146 143 178 0 168 20 117 116 0 145 87 155 16 0 161 163 158 63 0 145 182 138 137 0 144 135 138 180 0 129 201 23 78 0 129 134 75 74 0 194 154 74 134 0 153 35 21 33 0 128 77 129 76 0 128 130 134 129 0 128 129 134 75 0 128 130 132 165 0 130 129 154 134 0 145 182 90 89 0 147 91 137 202 0 147 182 91 90 0 143 202 147 137 0 143 147 203 190 0 130 133 134 193 0 198 164 32 122 0 65 66 37 133 0 133 164 65 32 0 133 134 121 120 0 203 202 69 46 0 203 190 47 3 0 3 204 68 203 0 205 112 18 113 0 197 157 160 158 0 205 163 206 197 0 182 17 114 93 0 197 160 195 207 0 197 136 207 195 0 197 158 206 180 0 197 138 205 136 0 197 206 138 180 0 208 168 117 116 0 208 168 159 174 0 208 174 118 117 0 160 62 161 208 0 208 207 174 160 0 163 160 62 161 0 208 62 207 160 0 145 138 182 148 0 182 114 148 136 0 145 147 182 137 0 89 182 114 148 0 136 93 209 182 0 145 181 138 148 0 147 182 137 91 0 182 137 187 209 0 182 137 91 187 0 91 182 187 92 0 210 209 195 136 0 210 174 207 195 0 210 207 118 119 0 210 18 136 207 0 210 207 119 18 0 134 74 194 11 0 130 154 129 131 0 128 130 175 133 0 130 133 193 164 0 129 131 78 77 0 129 154 74 41 0 167 198 170 101 0 198 133 32 164 0 167 174 117 99 0 161 159 208 116 0 208 168 116 159 0 168 116 164 122 0 199 172 97 96 0 141 180 165 157 0 135 143 137 142 0 183 153 151 211 0 183 204 211 151 0 124 183 204 178 0 60 206 212 213 0 206 181 138 180 0 163 160 197 205 0 141 197 160 195 0 206 213 61 173 0 168 193 164 159 0 198 168 164 122 0 167 168 174 193 0 164 116 159 162 0 129 41 74 23 0 141 164 159 157 0 204 214 151 124 0 143 203 211 204 0 204 43 152 151 0 204 67 211 152 0 204 152 43 67 0 203 204 68 211 0 3 191 43 204 0 204 151 152 211 0 149 151 39 201 0 151 152 39 2 0 214 201 2 151 0 211 189 21 69 0 130 183 151 124 0 151 124 214 131 0 149 150 1 153 0 149 151 201 154 0 130 124 151 131 0 175 162 164 157 0 130 141 164 193 0 199 48 96 97 0 165 180 215 157 0 165 176 215 177 0 206 205 138 173 0 128 166 175 165 0 132 184 166 165 0 130 134 154 193 0 213 8 108 181 0 145 146 155 87 0 206 173 181 213 0 181 148 115 173 0 181 156 58 109 0 181 8 108 58 0 145 144 181 155 0 181 115 148 16 0 181 155 109 16 0 181 155 156 109 0 200 215 177 156 0 169 186 171 97 0 156 212 215 180 0 170 51 27 102 0 144 181 155 156 0 127 156 200 177 0 162 10 38 37 0 156 155 123 127 0 145 137 143 147 0 146 25 147 47 0 123 144 179 155 0 179 146 190 86 0 179 126 84 191 0 204 190 191 178 0 42 190 84 191 0 190 191 42 3 0 145 144 138 181 0 145 143 137 138 0 182 136 148 138 0 146 147 143 190 0 145 182 89 148 0 47 203 46 147 0 147 202 45 91 0 192 183 171 186 0 183 211 142 189 0 198 101 134 194 0 164 157 162 159 0 133 66 37 175 0 175 176 37 216 0 198 134 101 121 0 167 170 193 174 0 171 174 172 195 0 171 188 142 199 0 183 171 189 142 0 146 47 190 86 0 206 156 181 180 0 182 137 209 136 0 139 141 124 183 0 148 205 138 136 0 148 205 30 173 0 181 173 115 108 0 148 115 173 30 0 215 22 216 212 0 165 177 215 180 0 215 200 177 176 0 215 157 180 216 0 158 216 212 180 0 213 8 60 59 0 213 59 173 108 0 197 206 205 138 0 213 212 71 8 0 213 212 60 71 0 213 173 59 61 0 183 154 153 150 0 177 196 165 184 0 131 124 132 130 0 170 194 102 101 0 170 51 150 186 0 170 102 150 51 0 167 171 174 172 0 167 171 170 174 0 168 193 159 174 0 169 170 171 186 0 167 101 170 100 0 210 199 172 195 0 210 174 195 172 0 139 141 196 124 0 134 194 101 11 0 123 83 179 126 0 146 47 147 190 0 145 144 143 138 0 123 156 127 177 0 144 179 146 178 0 209 136 94 93 0 93 209 182 92 0 210 209 199 195 0 140 209 199 142 0 187 26 92 209 0 50 187 26 92 0 123 126 179 178 0 210 118 19 95 0 126 191 24 84 0 179 126 191 178 0 203 204 190 3 0 147 203 46 202 0 143 203 204 190 0 139 143 140 183 0 211 142 189 202 0 146 143 178 190 0 203 211 69 202 0 178 183 204 143 0 149 154 41 150 0 149 23 201 39 0 152 153 40 35 0 204 124 191 214 0 149 153 154 150 0 151 201 2 39 0 169 97 171 172 0 2 214 151 43 0 143 142 183 211 0 181 16 108 115 0 182 187 92 209 0 215 177 156 180 0 143 190 204 178 0 148 136 114 205 0 135 140 142 209 0 145 144 146 143 0 123 126 178 124 0 128 134 133 120 0 140 171 195 174 0 130 154 192 193 0 140 171 183 142 0 197 157 158 180 0 165 166 176 177 0 128 175 166 107 0 192 186 171 170 0 130 196 132 165 0 159 160 174 141 0 151 154 131 201 0 204 124 178 191 0 143 147 202 203 0 184 185 105 81 0 126 185 24 191 0 149 23 129 201 0 165 184 166 177 0 169 52 27 51 0 161 116 208 64 0 62 112 207 160 0 141 157 197 180 0 158 160 197 163 0 199 48 188 187 0 210 96 199 94 0 210 209 136 94 0 135 209 136 195 0 184 196 124 177 0 131 79 201 78 0 13 214 80 185 0 129 131 201 78 0 184 132 124 196 0 131 185 13 105 0 184 185 131 105 0 43 214 151 204 0 183 189 171 186 0 42 3 191 43 0 149 41 129 23 0 79 214 201 2 0 149 152 40 39 0 211 68 21 67 0 161 63 64 62 0 136 114 205 113 0 143 211 183 204 0 179 190 146 178 0 135 136 197 195 0 171 199 195 172 0 210 172 199 96 0 210 209 94 199 0 172 97 19 98 0 208 160 174 159 0 140 209 195 199 0 158 159 160 161 0 160 141 159 157 0 160 174 141 195 0 161 64 208 62 0 210 174 172 118 0 154 170 194 150 0 134 75 121 120 0 135 137 209 142 0 167 193 198 168 0 199 142 187 188 0 143 142 211 202 0 202 187 189 49 0 130 175 133 164 0 134 193 194 154 0 132 105 131 77 0 166 176 53 6 0 184 132 166 28 0 184 166 55 28 0 149 201 129 154 0 125 14 126 82 0 184 131 124 132 0 200 7 54 72 0 139 156 177 180 0 8 156 181 213 0 156 212 8 57 0 202 147 45 46 0 185 131 13 214 0 123 124 139 177 0 139 196 180 177 0 112 163 160 62 0 167 172 99 98 0 207 174 118 208 0 70 158 9 63 0 158 9 63 163 0 161 38 216 162 0 157 216 159 158 0 161 208 159 160 0 180 139 144 135 0 210 207 174 118 0 206 158 9 60 0 184 196 165 132 0 216 159 158 161 0 215 157 216 176 0 123 110 179 83 0 181 138 148 173 0 206 212 156 180 0 182 136 93 114 0 153 34 35 33 0 208 168 174 117 0 183 211 189 153 0 182 138 137 136 0 145 155 181 16 0 171 5 189 188 0 150 73 1 51 0 199 187 26 48 0 188 189 33 5 0 188 189 49 33 0 186 171 5 189 0 189 171 188 142 0 188 187 49 189 0 192 170 150 186 0 185 214 80 24 0 165 157 215 176 0 185 214 24 191 0 211 69 202 189 0 124 214 185 191 0 204 190 3 191 0 186 52 97 169 0 28 132 105 184 0 127 125 14 123 0 208 118 207 31 0 169 172 98 97 0 198 170 101 194 0 164 162 65 116 0 10 161 116 162 0 79 214 80 13 0 140 171 199 195 0 174 172 118 99 0 210 172 96 19 0 126 24 185 82 0 203 69 211 68 0 151 152 211 153 0 161 158 216 38 0 158 212 22 70 0 158 212 70 60 0 126 124 185 191 0 176 37 216 36 0 215 200 176 72 0 166 53 176 55 0 153 189 33 21 0 176 72 200 54 0 216 162 38 37 0 202 187 49 4 0 175 162 157 216 0 175 176 166 6 0 160 112 207 205 0 167 170 198 193 0 156 56 200 57 0 206 180 158 212 0 158 38 22 216 0 216 158 212 22 0 211 152 67 21 0 140 171 142 199 0 135 180 141 197 0 150 186 1 153 0 215 36 176 216 0 206 9 205 61 0 174 160 207 195 0 186 153 189 34 0 175 133 66 107 0 198 134 133 193 0 157 162 159 216 0 147 203 190 47 0 199 97 188 48 0 211 153 21 189 0 154 74 134 129 0 124 214 131 185 0 133 32 120 121 0 135 209 137 136 0 70 158 38 22 0 123 144 156 139 0 144 156 155 123 0 215 72 176 36 0 57 200 215 72 0 156 200 215 57 0 15 110 179 87 0 209 94 199 26 0 179 15 83 110 0 179 84 15 85 0 14 127 111 103 0 128 12 107 106 0 216 212 180 215 0 133 107 120 66 0 128 12 75 120 0 194 11 73 102 0 208 116 117 64 0 162 10 37 65 0 161 63 10 64 0 206 60 9 61 0 212 71 8 57 0 213 108 8 59 0 200 54 7 55 0 200 57 7 72 0 200 103 7 56 0 202 69 4 49 0 203 3 46 68 0 190 3 85 47 0 152 39 2 40 0 214 43 2 44 0 176 6 54 53 0 179 85 15 86 0 177 55 176 200 0 189 33 5 34 0 134 11 101 121 0 164 116 65 122 0 170 101 102 100 0 143 211 203 202 0 135 137 143 138 0 68 204 67 211 0 126 82 14 83 0 194 11 74 73 0 166 53 28 106 0 126 124 191 178 0 154 150 73 41 0 213 8 71 60 0 175 6 107 66 0 179 15 87 86 0 200 7 103 55 0 206 138 181 173 0 127 200 56 103 0 127 111 56 29 0 167 99 20 100 0 208 31 117 118 0 175 133 162 37 0 187 4 91 50 0 185 82 24 80 0 167 20 99 117 0 182 17 91 90 0 184 81 105 104 0 202 4 46 45 0 29 109 127 110 0 177 55 200 103 0 192 141 140 183 0 183 204 151 124 0 176 54 55 53 0 203 46 3 47 0 211 68 69 21 0 137 209 142 187 0 46 147 45 47 0 202 46 4 69 0 176 36 6 37 0 216 37 38 36 0 183 139 178 124 0 198 121 122 32 0 215 57 212 156 0 164 122 65 32 0 198 133 164 193 0 148 30 114 115 0 136 113 93 114 0 126 83 84 82 0 125 103 104 55 0 184 124 125 177 0 58 156 127 109 0 58 156 181 8 0 162 10 65 116 0 210 19 96 95 0 137 202 91 187 0 210 95 96 94 0 147 47 25 45 0 190 86 47 85 0 145 16 88 87 0 201 39 78 79 0 129 77 78 76 0 125 14 82 81 0 175 37 6 66 0 204 68 67 43 0 204 43 214 191 0 186 34 5 52 0 197 160 207 205 0 153 33 189 34 0 37 133 162 65 0 133 66 32 65 0 162 159 216 161 0 161 158 38 63 0 157 175 130 164 0 150 192 154 170 0 167 98 99 100 0 183 186 153 189 0 175 176 165 166 0 212 70 71 22 0 158 60 206 212 0 186 189 5 34 0 5 52 97 186 0 208 31 62 64 0 186 153 34 1 0 129 76 78 23 0 191 24 84 42 0 150 102 194 73 0 210 119 118 95 0 167 170 169 100 0 148 114 89 115 0 153 35 34 1 0 127 58 29 56 0 181 109 58 108 0 156 57 58 56 0 168 122 20 116 0 149 41 39 40 0 31 208 62 207 0 156 57 8 58 0 128 12 120 107 0 140 143 142 183 0 184 104 28 55 0 128 12 106 77 0 169 98 100 27 0 187 48 50 26 0 187 91 92 50 0 187 50 48 49 0 167 174 99 172 0 188 5 33 49 0 169 27 170 51 0 215 216 22 36 0 125 14 81 104 0 146 86 88 25 0 72 57 212 215 0 147 90 25 88 0 43 3 204 68 0 147 90 91 45 0 215 212 72 22 0 167 198 101 20 0 157 180 216 158 0 188 5 48 97 0 214 80 24 44 0 191 24 42 44 0 154 74 41 73 0 208 64 117 31 0 149 1 41 40 0 150 41 1 73 0 131 13 78 77 0 131 201 79 214 0 175 216 37 162 0 175 216 157 176 0 132 77 106 105 0 176 54 36 72 0 207 18 112 119 0 174 99 118 117 0 152 67 35 40 0 131 78 13 79 0 167 100 20 101 0 216 22 36 38 0 168 159 164 116 0 134 75 11 121 0 133 66 120 32 0 151 131 214 201 0 171 199 97 188 0 214 131 13 79 0 206 213 181 156 0 163 9 63 62 0 166 106 107 53 0 198 121 101 122 0 207 62 31 119 0 156 212 213 8 0 181 108 213 173 0 206 213 60 61 0 173 30 115 59 0 209 26 199 187 0 206 163 205 9 0 173 108 59 115 0 156 139 144 180 0 17 89 182 114 0 125 185 81 82 0 205 30 61 113 0 127 111 29 110 0 134 11 75 74 0 155 87 110 109 0 179 15 84 83 0 143 202 137 142 0 200 7 57 56 0 146 88 86 87 0 145 88 16 89 0 181 108 16 109 0 170 27 100 102 0 128 75 12 76 0 185 80 81 82 0 184 104 105 28 0 214 80 44 79 0 202 91 187 4 0 206 213 156 212 0 169 27 52 98 0 146 86 25 47 0 171 188 97 5 0 169 97 98 52 0 215 36 22 72 0 183 186 150 153 0 210 136 195 207 0 110 179 87 155 0 172 99 19 118 0 209 93 94 92 0 205 113 61 112 0 142 202 187 189 0 210 94 18 95 0 192 170 171 174 0 207 62 119 112 0 128 130 133 134 0 209 199 142 187 0 188 49 187 48 0 202 49 189 69 0 148 138 205 173 0 197 207 136 205 0 135 141 140 195 0 145 89 90 88 0 137 187 142 202 0 190 85 3 42 0 136 113 205 18 0 210 94 136 18 0 183 154 151 153 0 205 163 160 112 0 192 140 174 171 0 135 197 136 138 0 209 26 92 94 0 155 16 87 109 0 170 150 102 194 0 106 28 132 105 0 85 42 190 84 0 131 105 13 77 0 172 19 99 98 0 161 10 63 38 0 202 4 45 91 0 182 92 17 93 0 214 2 79 44 0 210 172 19 118 0 163 112 9 62 0 149 152 151 153 0 198 20 122 101 0 172 19 97 96 0 210 95 18 119 0 205 173 61 30 0 201 78 39 23 0 148 30 205 114 0 163 112 205 9 0 186 51 1 34 0 205 207 18 112 0 136 205 207 18 0 166 6 53 107 0 199 96 48 26 0 199 94 96 26 0 212 22 71 72 0 127 103 56 111 0 206 205 173 61 0 135 195 140 209 0 97 186 171 5 0 206 163 9 158 0 197 163 206 158 0 175 157 165 176 0 149 40 153 1 0 150 186 51 1 0 189 69 49 33 0 149 40 152 153 0 128 76 12 77 0 154 73 194 74 0 130 131 151 154 0 176 6 36 54 0 153 1 40 35 0 154 150 194 73 0 152 2 67 40 0 152 67 21 35 0 201 79 2 39 0 212 70 60 71 0 213 60 61 59 0 149 154 129 41 0 205 61 9 112 0 205 114 30 113 0 182 91 17 92 0 148 89 16 115 0 125 14 104 103 0 166 176 177 55 0 158 63 70 38 0 127 200 156 56 0 161 64 10 116 0 187 49 4 50 0 149 39 41 23 0 189 21 69 33 0 212 57 72 71 0 136 18 93 113 0 176 200 55 54 0 151 43 152 2 0 196 165 180 177 0 150 73 51 102 0 129 154 201 131 0 145 147 146 88 0 182 17 90 89 0 214 44 191 43 0 207 31 118 119 0 129 74 75 76 0 191 44 42 43 0 203 46 69 68 0 152 2 43 67 0 152 153 35 21 0 129 76 23 74 0 110 123 127 83 0 186 52 51 34 0 211 152 21 153 0 188 48 5 49 0 185 13 81 80 0 214 191 44 24 0 194 11 102 101 0 185 13 105 81 0 147 45 25 90 0 End freefem++-3.61-1/examples++-3d/Lac.edp000644 000767 000024 00000000730 13256636774 017264 0ustar00hechtstaff000000 000000 load "msh3" load "medit" int nn=10; border cc(t=0,2*pi){x=cos(t);y=sin(t);label=1;} mesh Th2= buildmesh(cc(100)); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; func zmin= 2-sqrt(4-(x*x+y*y)); func zmax= 2-sqrt(3.); mesh3 Th=buildlayers(Th2,nn, coef= (zmax-zmin)/zmax , zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); medit("Lac",Th,wait=1); // FFCS: testing 3d plots plot(Th,cmm="Lac"); freefem++-3.61-1/examples++-3d/Laplace3d.edp000644 000767 000024 00000003205 13256636774 020355 0ustar00hechtstaff000000 000000 /* Warning in before version 3.2-1 the nomarl are interal normal after the signe is correct and now the noral was exterior normal. */ verbosity=2; load "msh3" int nn=20; mesh Th2=square(nn,nn,region=0); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); fespace Vh(Th,P2); func ue = 2*x*x + 3*y*y + 4*z*z + 5*x*y+6*x*z+1; func uex= 4*x+ 5*y+6*z; func uey= 6*y + 5*x; func uez= 8*z +6*x; func f= -18. ; Vh uhe = ue; // cout << " uhe min: " << uhe[].min << " max:" << uhe[].max << endl; Vh u,v; macro Grad3(u) [dx(u),dy(u),dz(u)] // EOM problem Lap3d(u,v,solver=CG) = int3d(Th)(Grad3(v)' *Grad3(u)) //') for emacs + int2d(Th,2)(u*v) - int3d(Th)(f*v) - int2d(Th,2) ( ue*v + (uex*N.x +uey*N.y +uez*N.z)*v ) + on(1,u=ue); Lap3d; cout << " u min:: " << u[]. min << " max: " << u[].max << endl; real err= int3d(Th)( square(u-ue) ); real aa1= int3d(Th,qfV=qfV1)(u) ; real aa2= int3d(Th,qfV=qfV1lump)(u) ; cout << " aa1 = " << aa1 << endl; cout << " aa2 = " << aa2 << endl; cout << int3d(Th)(1.) << " = " << Th.measure << endl; cout << int3d(Th,qfV=qfV1)(1.) << " = " << Th.measure << endl; cout << int3d(Th,qfV=qfV1lump)(1.) << " = " << Th.measure << endl; Vh d= ue-u; cout << " err = " << err << " diff l^\intfy = " << d[].linfty << endl; real aire2=int2d(Th,2)(1.); // bug correct in version 3.0-4 cout << " aire2 = " << aire2 << endl; func uuu= 2.+x; cout << uuu(1,1,1) << endl; assert( abs(aire2-1.) < 1e-6); plot(u,wait=1); assert( err < 1e-6); freefem++-3.61-1/examples++-3d/EqPoisson.edp000644 000767 000024 00000001550 13256636774 020506 0ustar00hechtstaff000000 000000 load "msh3" load "medit" func f=2*((0.1+(((x/3))*(x-1)*(x-1)/1+x/100))^(1/3.)-(0.1)^(1/3.)); real yf=f(1.2,0); border up(t=1.2,0.){ x=t;y=f;label=0;} border axe2(t=0.2,1.15) { x=t;y=0;label=0;} border hole(t=pi,0) { x= 0.15 + 0.05*cos(t);y= 0.05*sin(t); label=1;} border axe1(t=0,0.1) { x=t;y=0;label=0;} border queue(t=0,1) { x= 1.15 + 0.05*t; y = yf*t; label =0;} int np= 100; func bord= up(np)+axe1(np/10)+hole(np/10)+axe2(8*np/10)+ queue(np/10); plot( bord); mesh Th2=buildmesh(bord); plot(Th2,wait=1); int[int] l23=[0,0,1,1]; mesh3 Th=buildlayers(Th2,coef= max(.15,y/max(f,0.05)), 50 ,zbound=[0,2*pi] ,transfo=[x,y*cos(z),y*sin(z)],facemerge=1,labelmid=l23); macro Grad(u) [dx(u),dy(u),dz(u)] // fespace Vh(Th,P1); Vh u,v; solve Poisson(u,v) = int3d(Th)( Grad(u)'*Grad(v) ) - int3d(Th)( v) + on(1,u=1); plot(u,wait=1,nbiso=20,value=1); medit("u",Th,u,wait=1); freefem++-3.61-1/examples++-3d/tetgencube.edp000644 000767 000024 00000004372 13256636774 020720 0ustar00hechtstaff000000 000000 // file tetgencube.edp load "msh3" load "tetgen" load "medit" real x0,x1,y0,y1; x0=1.; x1=2.; y0=0.; y1=2*pi; mesh Thsq1 = square(5,35,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func ZZ1min = 0; func ZZ1max = 1.5; func XX1 = x; func YY1 = y; int[int] ref31h = [0,12]; int[int] ref31b = [0,11]; mesh3 Th31h = movemesh23(Thsq1,transfo=[XX1,YY1,ZZ1max],label=ref31h,orientation=1); mesh3 Th31b = movemesh23(Thsq1,transfo=[XX1,YY1,ZZ1min],label=ref31b,orientation=-1); ///////////////////////////////// x0=1.; x1=2.; y0=0.; y1=1.5; mesh Thsq2 = square(5,8,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func ZZ2 = y; func XX2 = x; func YY2min = 0.; func YY2max = 2*pi; int[int] ref32h = [0,13]; int[int] ref32b = [0,14]; mesh3 Th32h = movemesh23(Thsq2,transfo=[XX2,YY2max,ZZ2],label=ref32h,orientation=-1); mesh3 Th32b = movemesh23(Thsq2,transfo=[XX2,YY2min,ZZ2],label=ref32b,orientation=1); ///////////////////////////////// x0=0.; x1=2*pi; y0=0.; y1=1.5; mesh Thsq3 = square(35,8,[x0+(x1-x0)*x,y0+(y1-y0)*y]); func XX3min = 1.; func XX3max = 2.; func YY3 = x; func ZZ3 = y; int[int] ref33h = [0,15]; int[int] ref33b = [0,16]; mesh3 Th33h = movemesh23(Thsq3,transfo=[XX3max,YY3,ZZ3],label=ref33h,orientation=1); mesh3 Th33b = movemesh23(Thsq3,transfo=[XX3min,YY3,ZZ3],label=ref33b,orientation=-1); //////////////////////////////// mesh3 Th33 = Th31h+Th31b+Th32h+Th32b+Th33h+Th33b; // "gluing" surface meshs to obtain the surface of cube //medit("glumesh",Th33); savemesh(Th33,"Th33.mesh"); // build a mesh of a axis parallel box with TetGen //real[int] domaine = [1.5,pi,0.75,145,0.001]; //mesh3 Thfinal = tetg(Th33,switch="pqaAAYYQ",nbofregions=1,regionlist=domaine); // Tetrahelize the interior of the cube with tetgen //medit("tetg",Thfinal); //savemesh(Thfinal,"Thfinal.mesh"); // build a mesh of a half cylindrical shell of interior radius 1. and exterior radius 2 and heigh 1.5 func mv2x = x*cos(y); func mv2y = x*sin(y); func mv2z = z; //mesh3 Thmv2 = movemesh3(Thfinal, transfo=[mv2x,mv2y,mv2z]); //savemesh(Thmv2,"halfcylindricalshell.mesh"); //verbosity=2; mesh3 Thmv2surf = movemesh(Th33,[mv2x,mv2y,mv2z], facemerge=0); medit("maillagesurf",Thmv2surf,wait=1); //savemesh(Thmv2surf,"maillagesurfacecylindre.mesh"); //medit("maillageplein",Thmv2); // FFCS: testing 3d plots plot(Thmv2surf); freefem++-3.61-1/examples++-3d/Stokes.edp000644 000767 000024 00000002254 13256636774 020040 0ustar00hechtstaff000000 000000 load "msh3" load "medit" int nn=3; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); medit("c10x10x10",Th,wait=1); // FFCS: testing 3d plots plot(Th); fespace VVh(Th,[P2,P2,P2,P1]); fespace Vh(Th,P23d); macro Grad(u) [dx(u),dy(u),dz(u)]// EOM macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM VVh [u1,u2,u3,p]; VVh [v1,v2,v3,q]; func fup = (1-x)*(x)*y*(1-y)*16; solve vStokes([u1,u2,u3,p],[v1,v2,v3,q]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) //)'; - div(u1,u2,u3)*q - div(v1,v2,v3)*p + 1e-10*q*p ) + on(2,u1=fup,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; plot(p,wait=1, nbiso=5); // a 3d plot of iso pressure. plot([u1,u2,u3] ,wait=1, nbiso=5); // a 3d plot of iso pressure. // to see the 10 cup plan in 2d for(int i=1;i<10;i++) { real yy=i/10.; ux= u1(x,yy,y); uz= u3(x,yy,y); p2= p(x,yy,y); plot([ux,uz],p2,cmm=" cut y = "+yy,wait= 1); } // FFCS: testing 3d plots plot(u1); plot(u2); plot(u3); plot(p); freefem++-3.61-1/examples++-3d/cube-period.edp000644 000767 000024 00000003776 13256636774 021000 0ustar00hechtstaff000000 000000 load "msh3" int nn=10;; mesh Th2=square(nn,nn,region=0); fespace Vh2(Th2,P2); // // label face numbering // 1 : ( x == xmin) 2 : ( x == xmax) // 3 : ( y == ymin) 4 : ( y == ymax) // 5 : ( z == zmin) 6 : ( z == zmax) // --- int[int] rup=[0,5], rdown=[0,6], rmid=[4,1,2,2, 1,3 ,3,4]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], // region=r1, labelmid=rmid, reffaceup = rup, reffacelow = rdown); cout << "Th : nv = " << Th.nv << " nt =" << Th.nt << endl; savemesh(Th,"Th.mesh"); verbosity=10; // the Finite element space with full periodic condition in 3 axes fespace Vh(Th,P2,periodic=[[1,y,z],[2,y,z],[3,x,z],[4,x,z],[5,x,y],[6,x,y]]); verbosity=2; // a code to build some verification .... fespace Vhh(Th,P2); int[int] num(Vhh.ndof); num=-1; int er=0; for(int k=0;k int n2 = n1-1; // int nnn=n2*n2*n2; int nnn1=n1*n1*n1; cout << " ndf pare= " << Vh.ndof << " " << nnn << endl; cout << " ndf = " << Vhh.ndof << " " << nnn1 << endl; assert(er==0 && nnn == Vh.ndof && nnn1 == Vhh.ndof); // some verification ... Vh u,v,uu; real x0=2*pi/3,y0=2*pi/4,z0=2*pi*2/3; func ue= sin(2*pi*x+x0)*sin(2*pi*y+y0)*sin(2*pi*z+z0); real cc= -3*(2*pi)^2 ; func f = -cc*ue; uu=ue; macro Grad(u) [dx(u),dy(u),dz(u)] //; solve P(u,v,solver=CG)= int3d(Th)(Grad(u)'*Grad(v)) - int3d(Th)(f*v); //') ; cout << "Err L2 = " << sqrt(int3d(Th)( square(u-uu)) ) << endl; // FFCS: add 3D view ///Vh2 u0=u(x,y,0); ///Vh2 u1=u(x,y,1); ///plot(u0,u1,wait=1); plot(u,nbiso=10); freefem++-3.61-1/examples++-3d/intlevelset3d.edp000644 000767 000024 00000005644 13256636774 021363 0ustar00hechtstaff000000 000000 load "medit" include "cube.idp" real surfS1 = 4*pi; real volS1 =surfS1/3.; int nn= 16; int[int] Nxyz=[nn,nn,nn]; real [int,int] Bxyz=[[-2.,2.],[-2.,2.],[-2.,2.]]; int [int,int] Lxyz=[[1,1],[1,1],[1,1]]; mesh3 Th=Cube(Nxyz,Bxyz,Lxyz); int err=0; real eps = 0.5; func r = sqrt(x*x +y*y+z*z); real lc ; verbosity=3; lc = int2d(Th,levelset=r-1.)(1.) ; cout << " area of the level set = " << lc << " = surfS1 " << surfS1 ; cout << ", Ok = " << (abs(lc-surfS1) < eps) << endl; if( abs(lc-surfS1) > eps) err++; fespace Vh(Th,P1); // test linear and bilinear ... varf vl(u,v) = int2d(Th,levelset=r-1.)(v) + int2d(Th,levelset=r-1.)(u*v); real[int] vv=vl(0,Vh); cout << " area of the level set (varf linear ) = " << (lc=vv.sum) << "= surfS1 " << surfS1 ; cout << ", Ok = " << (abs(lc-surfS1) < eps) << endl; if( abs(lc-surfS1) > eps) err++; real[int] one(Vh.ndof); one=1.; matrix VV=vl(Vh,Vh); // matrix with levelset vv = VV*one; cout << " area of the level set (varf bilinear same) = " << (lc=vv.sum) << "= surfS1 " << surfS1; cout << ", Ok = " << (abs(lc-surfS1) < eps) << endl;; if( abs(lc-surfS1) > eps) err++; // just for test a idea approximation of int of negative part of levelset // to we just change the measure of the element not the quadrature point { // test new stuff for level set ... macro grad(u) [dx(u),dy(u),dz(u)] // Vh u,v; solve Pxx(u,v) = int3d(Th) ( grad(u)'*grad(v)*1e-8 ) + int3d(Th, levelset= 1-r) ( grad(u)'*grad(v) ) + on(1,u=0) + int3d(Th, levelset= 1-r) ( 1*v); plot(u,wait=1); varf vxx(u,v) = int3d(Th, levelset= 1-r) ( u*v ) + int3d(Th, levelset= 1-r) ( 1*v); matrix XX=vxx(Vh,Vh); real[int] xx=vxx(0,Vh); real vol1= int3d(Th, levelset= 1-r)(1.); cout << " vol1 = " << vol1 << " ~= " << Th.measure - volS1 << endl; err += (abs(vol1-(Th.measure - volS1)) > eps); cout << " xx.sum = " << xx.sum << " == " << vol1 < 1e-8); real[int] yy(Vh.ndof); yy=1; xx= XX*yy; cout << " XX.sum = " << xx.sum << " == " << vol1 << endl; err += (abs(vol1-xx.sum) > 1e-8); } if(0) {// test on diff mesh3 not wet implemented (FH frev 2014) mesh3 Th1=Cube(Nxyz,Bxyz,Lxyz); mesh3 Th2=Cube(Nxyz,Bxyz,Lxyz); fespace Vh1(Th1,P1); fespace Vh2(Th2,P1); varf vl(u,v) = int2d(Th,levelset=r-1.)(v) + int2d(Th,levelset=r-1.)(u*v); real[int] vv=vl(0,Vh2); cout << " area of the level set (varf linear diff ) = " << (lc=vv.sum) << "= surfS1 " << surfS1 ; cout << ", Ok = " << (abs(lc-surfS1) < eps) << endl; if( abs(lc-surfS1) > eps) err++; real[int] one(Vh1.ndof); one=1.; // sorry not implemented to day ... FH //verbosity=10000; matrix VV=vl(Vh1,Vh2); // no build of matrix with levelset vv = VV*one; cout << " area of the level set (varf bilinear diff ) = " << (lc=vv.sum) << "= surfS1 " << surfS1; cout << ", Ok = " << (abs(lc-surfS1) < eps) << endl;; if( abs(lc-surfS1) > eps) err++; } cout << " Nb err " << err << endl; assert(err==0); freefem++-3.61-1/examples++-3d/cylinder-3d.edp000644 000767 000024 00000000677 13256636774 020714 0ustar00hechtstaff000000 000000 load "msh3"// buildlayer load "medit"// buildlayer border C(t=0,2*pi) { x = cos(t); y=sin(t); label=1;} mesh Baseh = buildmesh(C(20)); plot(Baseh,wait=1); int[int] rup=[0,1], rdown=[0,2], rmid=[1,3]; func zmin= 1; func zmax= 10; int nlayer=100; mesh3 Th=buildlayers(Baseh,nlayer, coef= 1., zbound=[zmin,zmax], labelmid=rmid, reffaceup = rup, reffacelow = rdown); medit("Cyl",Th,wait=1); // FFCS: testing 3d plots plot(Th,cmm="Cyl"); freefem++-3.61-1/examples++-3d/Makefile.in000644 000767 000024 00000125117 13321623167 020130 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-3d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = 3d-Leman.edp ArrayFE-3d.edp EqPoisson.edp Lac.edp Laplace-Adapt-3d.edp Laplace-Adapt-aniso-3d.edp Laplace3d.edp LaplaceRT-3d.edp NSI3d-carac.edp NSI3d.edp Period-Poisson-cube-ballon.edp Poisson-cube-ballon.edp Poisson.edp Poisson3d.edp Stokes.edp TruncLac.edp beam-3d.edp cone.edp convect-3d.edp cube-period.edp cylinder-3d.edp cylinder.edp fallingspheres.edp first.edp meditddm.edp p.edp periodic-3d.edp pyramide.edp refinesphere.edp schwarz-nm-3d.edp sphere2.edp sphere6.edp tetgencube.edp tetgenholeregion.edp intlevelset3d.edp XFAIL_TESTS = Laplace-Adapt-aniso-3d.edp fallingspheres.edp Laplace-Adapt-3d.edp Period-Poisson-cube-ballon.edp Poisson-cube-ballon.edp cylinder.edp refinesphere.edp tetgencube.edp tetgenholeregion.edp Poisson3d.edp schwarz-nm-3d.edp LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw LIST_IDP = MeshSurface.idp cube.idp EXTRA_DIST = *.edp all.edp regtests.edp regtests.m4 ref.edp dodecaedre01.mesh \ lac-leman-v4.msh $(LIST_IDP) all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-3d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-3d/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? 3d-Leman.edp.log: 3d-Leman.edp @p='3d-Leman.edp'; \ b='3d-Leman.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) ArrayFE-3d.edp.log: ArrayFE-3d.edp @p='ArrayFE-3d.edp'; \ b='ArrayFE-3d.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) EqPoisson.edp.log: EqPoisson.edp @p='EqPoisson.edp'; \ b='EqPoisson.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) Lac.edp.log: Lac.edp @p='Lac.edp'; \ b='Lac.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) Laplace-Adapt-3d.edp.log: Laplace-Adapt-3d.edp @p='Laplace-Adapt-3d.edp'; \ b='Laplace-Adapt-3d.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) Laplace-Adapt-aniso-3d.edp.log: Laplace-Adapt-aniso-3d.edp @p='Laplace-Adapt-aniso-3d.edp'; \ b='Laplace-Adapt-aniso-3d.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) Laplace3d.edp.log: Laplace3d.edp @p='Laplace3d.edp'; \ b='Laplace3d.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) LaplaceRT-3d.edp.log: LaplaceRT-3d.edp @p='LaplaceRT-3d.edp'; \ b='LaplaceRT-3d.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) NSI3d-carac.edp.log: NSI3d-carac.edp @p='NSI3d-carac.edp'; \ b='NSI3d-carac.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) NSI3d.edp.log: NSI3d.edp @p='NSI3d.edp'; \ b='NSI3d.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) Period-Poisson-cube-ballon.edp.log: Period-Poisson-cube-ballon.edp @p='Period-Poisson-cube-ballon.edp'; \ b='Period-Poisson-cube-ballon.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) Poisson-cube-ballon.edp.log: Poisson-cube-ballon.edp @p='Poisson-cube-ballon.edp'; \ b='Poisson-cube-ballon.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) Poisson.edp.log: Poisson.edp @p='Poisson.edp'; \ b='Poisson.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) Poisson3d.edp.log: Poisson3d.edp @p='Poisson3d.edp'; \ b='Poisson3d.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) Stokes.edp.log: Stokes.edp @p='Stokes.edp'; \ b='Stokes.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) TruncLac.edp.log: TruncLac.edp @p='TruncLac.edp'; \ b='TruncLac.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) beam-3d.edp.log: beam-3d.edp @p='beam-3d.edp'; \ b='beam-3d.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) cone.edp.log: cone.edp @p='cone.edp'; \ b='cone.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) convect-3d.edp.log: convect-3d.edp @p='convect-3d.edp'; \ b='convect-3d.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) cube-period.edp.log: cube-period.edp @p='cube-period.edp'; \ b='cube-period.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) cylinder-3d.edp.log: cylinder-3d.edp @p='cylinder-3d.edp'; \ b='cylinder-3d.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) cylinder.edp.log: cylinder.edp @p='cylinder.edp'; \ b='cylinder.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) fallingspheres.edp.log: fallingspheres.edp @p='fallingspheres.edp'; \ b='fallingspheres.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) first.edp.log: first.edp @p='first.edp'; \ b='first.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) meditddm.edp.log: meditddm.edp @p='meditddm.edp'; \ b='meditddm.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) p.edp.log: p.edp @p='p.edp'; \ b='p.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) periodic-3d.edp.log: periodic-3d.edp @p='periodic-3d.edp'; \ b='periodic-3d.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) pyramide.edp.log: pyramide.edp @p='pyramide.edp'; \ b='pyramide.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) refinesphere.edp.log: refinesphere.edp @p='refinesphere.edp'; \ b='refinesphere.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) schwarz-nm-3d.edp.log: schwarz-nm-3d.edp @p='schwarz-nm-3d.edp'; \ b='schwarz-nm-3d.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) sphere2.edp.log: sphere2.edp @p='sphere2.edp'; \ b='sphere2.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) sphere6.edp.log: sphere6.edp @p='sphere6.edp'; \ b='sphere6.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) tetgencube.edp.log: tetgencube.edp @p='tetgencube.edp'; \ b='tetgencube.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) tetgenholeregion.edp.log: tetgenholeregion.edp @p='tetgenholeregion.edp'; \ b='tetgenholeregion.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) intlevelset3d.edp.log: intlevelset3d.edp @p='intlevelset3d.edp'; \ b='intlevelset3d.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic cscopelist-am ctags-am distclean \ distclean-generic 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-exec-local \ 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 pdf pdf-am ps ps-am recheck \ tags-am uninstall uninstall-am .PRECIOUS: Makefile all-local: all.edp regtests.edp freefem++.pref 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 \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;searchMethod=0;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << " mem leak = " < $@ # To create a new set of reference values in "ref.edp" Ref: makeref.edp freefem++.pref export FF_LOADPATH=../examples++-load/.;../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref 3d-Leman.edp:freefem++.pref install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: # 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: freefem++-3.61-1/examples++-3d/sphereincube.edp000644 000767 000024 00000001475 13256636774 021250 0ustar00hechtstaff000000 000000 verbosity=1; load "msh3" load "tetgen" load "medit" include "MeshSurface.idp" real hs = 0.1; // mesh size real Lex=1,Lin =0.5; int nLex = 2*Lex/hs; int[int] Nex=[nLex,nLex,nLex]; real [int,int] Bex=[[-Lex,Lex],[-Lex,Lex],[-Lex,Lex]]; int [int,int] Lbex=[[1,1],[1,1],[1,1]] ; int Ls=2 ; //////////////////////////////// mesh3 ThHS = SurfaceHex(Nex,Bex,Lbex,1)+Sphere(Lin,hs,Ls,1); // "gluing" surface meshs to total boundary meshes real voltet=(hs^3)/6.; cout << " voltet = " << voltet << endl; real[int] domaine = [0,0,0,2,voltet,0,0,(Lex+Lin)/2,1,voltet]; mesh3 Th = tetg(ThHS,switch="pqaAYY",regionlist=domaine); Th= trunc(Th,region==1); // Tetrahelize the interior of the cube with tetgen medit("tetg",Th,wait=1); savemesh(Th,"Th.mesh"); freefem++-3.61-1/examples++-3d/3d-Leman.edp000644 000767 000024 00000002476 13256636774 020136 0ustar00hechtstaff000000 000000 load "msh3" load "medit" int nn=10; // a pententiel flow on a lac .. // a first freefem++ 3d example // ------ not to bad ...... verbosity=3; mesh Th2("lac-leman-v4.msh"); fespace Vh2(Th2,P1); Vh2 deep; { Vh2 v; macro Grad(u) [dx(u),dy(u)] // solve P(deep,v)= int2d(Th2)(Grad(deep)'*Grad(v))+int2d(Th2)(v) +on(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,deep=-1); deep = deep*5/abs(deep[].min); plot(deep,wait=1); } Vh2 ux,uz,p2; int[int] rup=[0,200], rdown=[0,100],rmid(17*2); for(int i=0;i> reylnods; assert(reylnods>1 && reylnods < 100000); up1=0; up2=0; func g=(x)*(1-x)*4; Vh p=0,q; real alpha=0; real nu=1; int i=0,iter=0; real dt=0; real sig = 2*classique-1; varf vNS([u1,u2,p],[v1,v2,q]) = int2d(Th)( alpha*( u1*v1 + u2*v2) + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + p*q*(0.000001) - p*dx(v1) - p*dy(v2) - dx(u1)*q - dy(u2)*q ) + int2d(Th) ( sig*(-alpha*convect([up1,up2],-dt,up1)*v1 -alpha*convect([up1,up2],-dt,up2)*v2 ) ) + on(3,u1=g,u2=0) + on(1,2,4,u1=0,u2=0) ; solve NS ([u1,u2,p],[v1,v2,q],solver=UMFPACK,init=i,save="toto") = vNS; cout << "-- n " << p[].n << " stokes " << endl; cout << "-- u1 : " << u1[].min << " " << u1[].max << endl; cout << "-- u2 : " << u2[].min << " " << u2[].max << endl; cout << "-- p : " << p[].min << " " << p[].max << endl; //plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="StokesP2P1.eps",value=1,wait=1); dt = 0.1; int nbiter = 2; real coefdt = 0.25^(1./nbiter); real coefcut = 0.25^(1./nbiter) , cut=0.01; real tol=0.5,coeftol = 0.25^(1./nbiter); nu=1./reylnods; Wh [uu1,uu2,pp]; Wh [vv1,vv2,qq]; Wh [f1,f2,fp]; for (iter=1;iter<=nbiter;iter++) { cout << " dt = " << dt << " ------------------------ sig ="<< sig << endl; alpha=1/dt; for (i=0;i<=1;i++) { up1=u1; up2=u2; matrix A=vNS(Wh,Wh,solver=UMFPACK); // set(A,solver=UMFPACK); // set a solver verbosity=3; if(classique) { //NS; solve NS1 ([uu1,uu2,pp],[vv1,vv2,qq],solver=UMFPACK,init=i,save="toto") = vNS; } else { f1[] = vNS(0,Wh); { ofstream tt("tt.matrix"); tt << A << endl; } { ofstream tt("tt.b"); tt << f1[] << endl; } uu1[] = A^-1*f1[]; } verbosity=1; u1=uu1; u2=uu2; p = pp; cout << "-- n " << p[].n << endl; cout << "-- u1 : " << u1[].min << " " << u1[].max << endl; cout << "-- u2 : " << u2[].min << " " << u2[].max << endl; cout << "-- p : " << p[].min << " " << p[].max << endl; if ( !(i % 10)) plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="plotNS_"+iter+"_"+i+".eps"); cout << "CPU " << clock()-s0 << "s " << endl; } if (iter>= nbiter) break; Th=adaptmesh(Th,[dx(u1),dy(u1),dx(u1),dy(u2)], abserror=0,cutoff=cut,err=tol, inquire=0,ratio=1.5,hmin=1./1000); plot(Th,ps="ThNS.eps"); dt = dt*coefdt; tol = tol *coeftol; cut = cut *coefcut; } cout << "CPU " << clock()-s0 << "s " << endl; freefem++-3.61-1/examples++-bug/Makefile.am000644 000767 000024 00000000031 13256636774 020370 0ustar00hechtstaff000000 000000 # $Id$ EXTRA_DIST=*.edp freefem++-3.61-1/examples++-bug/bug-arg-string.edp000644 000767 000024 00000001343 13256636774 021665 0ustar00hechtstaff000000 000000 // bug string macro parameter version < 1.41 // bug in string parameter version before <2.5 // ----------------- macro tyty(uu) uu// cout << tyty("toto") << endl; // other bug un func parameter no correct func string write(string fn,real[int] & u) { cout <<"write : " << fn << " u = "<< u << endl; // delete 2 times before version 2.5 return fn; } func string write1(string fn,real[int] & u) { cout << "write 1 " << fn << " u = " << u << endl; string toto=fn; ; return toto+"dfsdf"; } real[int] u(3); u=1; string tt=tyty("toto1"+1+" -- 77"); string t1="0123456789";// write(tt,u); string t2= write1(t1,u)+write1(tt,u); cout << " t2 = " << t2 << endl;freefem++-3.61-1/examples++-bug/SegmentationFault.edp000644 000767 000024 00000004224 13256636774 022467 0ustar00hechtstaff000000 000000 //////////////////////////////////// // Optimisation d'une 'grue' // // volume constant // // avec un maillage sous-jacent // // qu'on adpate a x^2 et y ^2 mais avec une // erreur constante // // plante de temps a autre (depend de niter !!!) //////////////////////////////////// // Nom du fichier de sauvegarde string sauve="grue"; // nombre d'itrations int niter=1; //nombre de sauvegardes du maillage (1)*(x<4); func cuty =(y>1)*(x<4); //dfinition des bords de la forme //label = // 1:Condition de Dirichlet // 2:Condition Libre // 3:Condition de Neuman non nulles border a1(t=8,9) {x=5; y=t;label=3;}; // logement de la charge border b(t=5,0) {x=t; y=9;label=2;}; // haut de la grue border c1(t=1.5,5) {x=t; y=8;label=2;}; //bras de la grue border d2(t=9,0) {x=-0.5+0.5/9*t; y=t;label=2;}; //cote gauche de la grue border d1(t=0,8) {x=0.5+t/8; y=t;label=2;} //cote droit de la grue border e(t=-0.5,0.5) {x=t; y=0;label=1;}; //base de la grue // forces appliques func g1=0; func g2=-1; // coefficients de Young et de Lam real lambda=12; real mu=6; // coefficients de Lam du matriau cout <<"lambda,mu ="<R2 Wh [F1,F2]; //def de l'inconnu et des fonct tests F1 = 1; // il y a un bug ici car dans un element fini vectoriel // il est impossible defini juste une composante // il faut faire: cout << F1(0.5, 0.6) << endl; cout << F2(0.5, 0.6) << endl; cout << F1(0.5, 0.6); [F1,F2]=[1,2]; cout << " -- F1 " << F1(0.5, 0.6) << endl; cout << " -- F2 " << F2(0.5, 0.6) << endl;freefem++-3.61-1/examples++-bug/zArithmetic_bug1.edp000644 000767 000024 00000002714 13256636774 022241 0ustar00hechtstaff000000 000000 // +=====================================================================+ // | Un bug en arithmetique complexe. | // +---------------------------------------------------------------------+ // | 01/09/02 : Les tableaux de complexes ne sont pas dispos | // | 11/09/03, V1.34 | // | variable du contexte sont ecrasees c'est le cas de j | // | | // +=====================================================================+ complex z1, z2, j ; real ReZ, ImZ ; j = 0 + 1i ; cout << "j = " << j <<" attendu : i" << endl ; cout << "trace 1 de j = " << j << endl ; ReZ = 4.5 ; ImZ = 6.7 ; cout << "ReZ = " << ReZ << " attendu : 4.5 " << endl ; cout << "ImZ = " << ImZ << " attendu : 6.7 " << endl ; cout << "trace 2 de j = " << j << endl ; cout << "Voila, j est ecrase par 0 + (ReZ) i !" << endl ; cout << endl ; cout << "Le meme Pb pour les reels ? " << endl ; real r1, r2, jR ; jR = 2 ; cout << "jR = " << jR <<" attendu : 2" << endl ; cout << "trace 1 de jR = " << jR << endl ; ReZ = 4.5 ; ImZ = 6.7 ; cout << "ReZ = " << ReZ << " attendu : 4.5 " << endl ; cout << "ImZ = " << ImZ << " attendu : 6.7 " << endl ; cout << "trace 2 de jR = " << jR << endl ; cout << "NON jR n'est pas ecrase" << endl ; cout << endl ; freefem++-3.61-1/examples++-bug/bugf.edp000644 000767 000024 00000000435 13256636774 017761 0ustar00hechtstaff000000 000000 // routine // bug before version 1.27 pb passage d'argument func int myfunction(real a1) { int i=a1*a1/1; return i; }; func real myfunction(real a,real b) { real z =myfunction(a)+b; return z; }; // appele cout << myfunction(1.0,3.) << " " << myfunction(1,3) << endl; freefem++-3.61-1/examples++-bug/bugv1.18.edp000644 000767 000024 00000000251 13256636774 020305 0ustar00hechtstaff000000 000000 // bug correct in version 1.19 cout << ( 10. < 2 ) << endl; cout << ( 10. < 2. ) << endl; mesh Th=square(5,5); fespace Xh(Th,P2); Xh v; v=label; plot(v,value=1,wait=1); freefem++-3.61-1/examples++-bug/Makefile.in000644 000767 000024 00000041640 13321623167 020375 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-bug ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = *.edp 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-bug/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-bug/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic 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 pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/examples++-hpddm/diffusion-3d.edp000644 000767 000024 00000011540 13256636774 021646 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u), dz(u)]// EOM // three-dimensional gradient func Pk = P1; // finite element space string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-3d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } int[int] LL = [1,2, 1,2, 1,1]; meshN ThBorder, Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = cube(getARGV("-global", 10), getARGV("-global", 10), getARGV("-global", 10), [x, y, z], label = LL); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(u, v) = intN(ThAugmented)(grad(u)' * grad(v)) + intN(ThAugmented)(v) + on(1, u = 1.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = cube(1, 1, 1, [x, y, z]); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_schwarz_method ras -hpddm_schwarz_coarse_correction deflated -hpddm_geneo_nu 10"); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized(u, v) = intN(Th)(grad(u)' * grad(v)) + intN1(Th, fakeInterface)(transmission * (u * v)) + on(1, u = 1.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(u, v) = intN(Th)(grad(u)' * grad(v)) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/laplace-2d-spherical-harmonics-SLEPc.edp000644 000767 000024 00000022256 13256636774 026123 0ustar00hechtstaff000000 000000 // This codes shows how to solve an eigenvalue problems // in different coordinate systems. The example here is // the Laplace equation in spherical coordinates, in the // [theta,phi] plane. Solutions are the spherical harmonics. // the [theta,phi] plane is a 2d domain, using SLEPc. // // Here, we consider the problem in spherical coordinates // \theta \in [0,\pi] and \phi \in [0,2\pi], for a fixed // radius: -\nabla^2 u = E u // // The eigenspectrum is : // E_n = n(n+1) ; deg(n) = 2n+1 // // Usage : // mpirun -np 4 FreeFem++-mpi -wg laplace-2d-spherical-harmonics-SLEPc.edp \ // -split 1 -npts 400 -nev 15 -sigma 0.0 // // Authors: Julien Garaud // Pierre Jolivet /***************************************/ /* Geometry parameters */ /***************************************/ int[int] Labels = [1,2,3,4]; // labels : bottom, right, top, left sides int[int] labPeriodic = [Labels[0],Labels[2]]; /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc" // PETSc plugin load "SLEPc" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM macro Pk() P1, periodic=[[Labels[0],x],[Labels[2],x]]//EOM /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 800) ; // Number of points on the perimeter // int nEV = getARGV("-nev" , 5) ; // Number of eigenvalues real sigma = getARGV("-sigma", 0.0) ; // Shift // real radius = getARGV("-radius",1.0); // Radius of the sphere /***************************************/ /* Verbosity and passed options */ /***************************************/ if(verbosity > 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- laplace-2d-spherical-harmonics-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << endl << "********************************************" << endl << " nb of eigenvalues = " << nEV << endl << " value of the shift = " << sigma << endl << "********************************************" << endl << " Radius of the sphere = " << radius << endl << "********************************************" << endl << endl; } /***************************************/ /* ############################### */ /***************************************/ meshN Th = square(1, 1); // Local mesh int[int] arrayIntersection; // Rank of neighborings subdomains int[int][int] restrictionIntersection(0); // Local-to-neighbors renumbering real[int] D; // Partition of unity /***************************************/ /* Finite Element space */ /***************************************/ // Definition of the finite element space on the domain Th // P1 are the first order Lagrange elements fespace Vh(Th, Pk); // local finite element space /***************************************/ /* ############## */ /***************************************/ { // Construction of the rectangular domain int Thetapts = int(Npts/6.0); // pts on the x-axis sides int Phipts = int(Npts/3.0); // pts on the y-axis sides meshN ThBorder, ThGlobal ; ThGlobal = square(Thetapts,Phipts,[x*pi,2.0*pi*y],label=Labels); // ..... buildPeriodic(Th, // The local mesh ThBorder, // The interface mesh ThGlobal, // The global mesh 10, // Fake interface s, // Refinement factor 1, // overlap D, // partition of unity arrayIntersection, // ranks of neighboring subdomains restrictionIntersection, // local-to-neighbors renumbering Vh, // The local Finite Element space Pk, // FE-space mpiCommWorld, // Communicator false, // excluded labPeriodic // Array of labels for periodic boundaries ); } /***********************************************************************/ /* Coordinate dependant differential operators */ /***********************************************************************/ /* Spherical coordinates in the (theta,phi)-plane */ /* */ /* r --> not used */ /* theta --> x in [0,pi] */ /* phi --> y in [0,2*pi] */ /* */ /* Jacobian determinant on the half-plane */ /* The det(J) = r^2*sin(theta) --> r^2*sin(x) */ /* */ macro Jac()( radius^2*sin(x) ) // End Of Macro /* */ ;; /* The Jacobian */ /* */ /* The gradiant operator in spherical coordinates */ /* */ /* d/dr */ /* grad = 1/r*d/dtheta -> 1/radius*d/dx */ /* 1/(r*sin(theta))*d/dphi -> */ /* 1/(radius*sin(x)*d/dy */ /* */ macro Grad(u) [dx(u)/radius,dy(u)/(radius*sin(x))] // End Of Macro /* */ ;; /* The Gradient operator */ macro Lap(u,v) ( Grad(u)'*Grad(v)) //') // End Of Macro /* */ ;; /* The Laplace operator */ /* */ /* */ /***********************************************************************/ /***************************************/ /* Problem parameters */ /***************************************/ /***************************************/ /* Problem definition */ /***************************************/ varf vA(uh,vh)= intN(Th) // Definion of the problem (Jac*(Lap(uh,vh)-sigma*uh*vh ))// Bilinear form ; varf vB(uh,vh)= intN(Th) // Definion of the problem ( Jac*uh*vh ) // Bilinear form ; matrix A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D); dmatrix DistB(DistA, B); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -eps_target "+ sigma + // Shift value " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_gen_hermitian" // The problem is symmetric ; int k = deigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(u, v) = intN(ThAugmented)(grad(u)' * grad(v)) + intN(ThAugmented)(v) + on(1, u = 1.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = cube(1, 1, 1, [x, y, z]); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_schwarz_coarse_correction deflated -hpddm_geneo_nu 10"); int solver = getOption("schwarz_method"); if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods varf vPbNoPen(u, v) = intN(Th)(grad(u)' * grad(v)) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen); } Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/laplace-2d-torus-SLEPc.edp000644 000767 000024 00000022337 13256636774 023344 0ustar00hechtstaff000000 000000 // This codes shows how to solve an eigenvalue problems // in different coordinate systems. The example here is // the Laplace equation on a toroidal surface embedded // in R3. The cartesian coordinates on the torus read // x = (r1+r2*cos(u))*cos(v) // y = (r1+r2*cos(u))*sin(v) // z = r2*sin(v) // with r1>r2 the major and minor radii and u,v \in [0,2\pi] // The toroidal surface thus maps to a square domain of // side 2\pi and periodic boundary conditions in both // coordinates. // // Laplace-Beltrami on a torus, using SLEPc. // // Is the eigenspectrum known analytically? // // Usage : // mpirun -np 4 FreeFem++-mpi -wg laplace-2d-torus-SLEPc.edp \ // -split 1 -npts 400 -nev 15 -sigma 0.0 // // Authors: Julien Garaud // Pierre Jolivet /***************************************/ /* Geometry parameters */ /***************************************/ int[int] Labels = [1,2,3,4]; // labels : bottom, right, top, left sides int[int] labPeriodic = [Labels[0],Labels[2],Labels[1],Labels[3]]; /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc" // PETSc plugin load "SLEPc" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM macro Pk() P1, periodic=[[Labels[0],x],[Labels[2],x],[Labels[1],y],[Labels[3],y]]//EOM /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 800) ; // Number of points on the perimeter // int nEV = getARGV("-nev" , 5) ; // Number of eigenvalues real sigma = getARGV("-sigma", 0.0) ; // Shift // real r1 = getARGV("-r1",2.0); // Large radius of the torus real r2 = getARGV("-r2",1.0); // Small radius of the torus if (r1<=r2){if(!mpirank) cout << "Error r1 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- laplace-2d-torus-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << endl << "********************************************" << endl << " nb of eigenvalues = " << nEV << endl << " value of the shift = " << sigma << endl << "********************************************" << endl << " Large radius of the torus = " << r1 << endl << " Small radius of the torus = " << r2 << endl << "********************************************" << endl << endl; } /***************************************/ /* ############################### */ /***************************************/ meshN Th = square(1, 1); // Local mesh int[int] arrayIntersection; // Rank of neighborings subdomains int[int][int] restrictionIntersection(0); // Local-to-neighbors renumbering real[int] D; // Partition of unity /***************************************/ /* Finite Element space */ /***************************************/ // Definition of the finite element space on the domain Th // P1 are the first order Lagrange elements fespace Vh(Th, Pk); // local finite element space /***************************************/ /* ############## */ /***************************************/ { // Construction of the rectangular domain int Thetapts = int(0.25*Npts); // pts on the x-axis sides int Phipts = int(0.25*Npts); // pts on the y-axis sides meshN ThBorder, ThGlobal ; ThGlobal = square(Thetapts,Phipts,[2.0*x*pi,2.0*pi*y],label=Labels); // ..... buildPeriodic(Th, // The local mesh ThBorder, // The interface mesh ThGlobal, // The global mesh 10, // Fake interface s, // Refinement factor 1, // overlap D, // partition of unity arrayIntersection, // ranks of neighboring subdomains restrictionIntersection, // local-to-neighbors renumbering Vh, // The local Finite Element space Pk, // FE-space mpiCommWorld, // Communicator false, // excluded labPeriodic // Array of labels for periodic boundaries ); } /***********************************************************************/ /* Coordinate dependant differential operators */ /***********************************************************************/ /* Parametric coordinates in the (u,v)-plane */ /* */ /* u --> x in [0,2*pi] */ /* v --> y in [0,2*pi] */ /* */ /* Jacobian determinant on the bi-periodic square */ /* The det(J) = r2*(r1+r2*cos(u)) --> r2(r1+r2*cos(x)) */ /* */ macro Jac()( r2*(r1+r2*cos(x)) ) // End Of Macro /* */ ;; /* The Jacobian */ /* */ /* The gradiant operator on the induced toroidal surface */ /* */ /* grad = 1/r2*d/du -> 1/r2*d/dx */ /* 1/(r1+r2*cos(u))*d/dv -> 1/(r1+r2*cos(x)*d/dy */ /* */ macro Grad(u) [dx(u)/r2,dy(u)/(r1+r2*cos(x))] // End Of Macro /* */ ;; /* The Gradient operator */ macro Lap(u,v) ( Grad(u)'*Grad(v)) //') // End Of Macro /* */ ;; /* The Laplace-Beltrami operator on the induced surface */ /* */ /***********************************************************************/ /***************************************/ /* Problem parameters */ /***************************************/ /***************************************/ /* Problem definition */ /***************************************/ varf vA(uh,vh)= intN(Th) // Definion of the problem (Jac*(Lap(uh,vh)-sigma*uh*vh ))// Bilinear form ; varf vB(uh,vh)= intN(Th) // Definion of the problem ( Jac*uh*vh ) // Bilinear form ; matrix A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D); dmatrix DistB(DistA, B); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -eps_target "+ sigma + // Shift value " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_gen_hermitian" // The problem is symmetric ; int k = deigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-2d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThBorder, ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40)); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } varf vPb(u, v) = intN(Th)(grad(u)' * grad(v)) + intN(Th)(v) + on(1, u = 0.0); matrix Mat = vPb(Wh, Wh); real[int] rhs = vPb(0, Wh); dmatrix A(Mat, arrayIntersection, restrictionIntersection, D); set(A, sparams = "-ksp_view"); Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err = A * u[]; // global matrix-vector product real[int] transpose = A' * u[]; err -= rhs; for(int i = 0; i < D.n; ++i) if(abs(D[i] - 1.0) > 1e-6) err[i] = 0.0; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) Wh def(Rb)[1]; Rb[0] = 1; set(A, sparams = "-pc_type gamg -ksp_type gmres -ksp_max_it 200", nearnullspace = Rb); u[] = 0.0; u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/elasticity-3d-PETSc.edp000644 000767 000024 00000006366 13256636774 022760 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), dz(u#C), (dz(u#B) + dy(u#C)) / Sqrt, (dz(u) + dx(u#C)) / Sqrt, (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B) + dz(u#C))// EOM func Pk = [P1, P1, P1]; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - elasticity-3d-PETSc.edp - input parameters: refinement factor = " << s << endl; } int[int] LL = [2,3, 2,1, 2,2]; meshN ThBorder, Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThBorder, ThGlobal = cube(10 * getARGV("-global", 5), getARGV("-global", 5), getARGV("-global", 5), [10 * x, y, z], label = LL); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } real f = -9000.0; real strain = 100.0; real Young = 1.0e8; real poisson = 0.45; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); varf vPb(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(Th)(f * vC) + on(1, u = 0.0, uB = 0.0, uC = 0.0); matrix Mat = vPb(Wh, Wh); real[int] rhs = vPb(0, Wh); dmatrix A(Mat, arrayIntersection, restrictionIntersection, D, bs = 3); set(A, sparams = "-ksp_view -ksp_max_it 1000"); Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; for(int i = 0; i < D.n; ++i) if(abs(D[i] - 1.0) > 1e-6) err[i] = 0.0; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) real alpha = 1.0; meshN ThMoved = movemesh3(Th, transfo = [x + alpha * u, y + alpha * uB, z + alpha * uC]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) Wh def(Rb)[6]; [Rb[0], RbB[0], RbC[0]] = [1, 0, 0]; [Rb[1], RbB[1], RbC[1]] = [0, 1, 0]; [Rb[2], RbB[2], RbC[2]] = [0, 0, 1]; [Rb[3], RbB[3], RbC[3]] = [y, -x, 0]; [Rb[4], RbB[4], RbC[4]] = [-z, 0, x]; [Rb[5], RbB[5], RbC[5]] = [0, z, -y]; set(A, sparams = "-pc_type gamg -ksp_type gmres -ksp_max_it 200 -pc_gamg_threshold 0.01", nearnullspace = Rb); [u, uB, uC] = init(0.0); u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) alpha = 1.0; ThMoved = movemesh3(Th, transfo = [x + alpha * u, y + alpha * uB, z + alpha * uC]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/schrodinger-1d-square-well-SLEPc.edp000644 000767 000024 00000021232 13256636774 025327 0ustar00hechtstaff000000 000000 // This codes shows how to calculate the eigenvalue spectrum of // the Schrodinger operator with square potential of finite depth // and width, on a psuedo-1d domain, using SLEPc. // // Here, we consider the problem of a 1d quantum harmonic oscillator: // -0.5 \nabla^2 u + V(x)* u = E u // since this is an hermitian operator, its eigenvalues E are real // The eigenspectrum is not known in general. Yet it features few // qualitative properties: // - the lowest excitations (eigenstates with the lowest eigenvalues) // are bound-states (the eigenstate is localized in the well since // it asymptotically goes to zero as a exponential) // and they are quantized (discrete eigenvalues) // - states with higher energies (when the eigenvalue is larger than // the depth of the potential well) are called diffusion states. // they are not localized (oscillating functions). This part of // the spectrum is also called radiative spectrum. // In principle, this is a continuous spectrum. // // for the default values of the potential well, there are 5 bound-states // before entering the diffusion spectrum. // // See e.g. : // - Complement H-I in Quantum mechanics Vol. 1 by C. Cohen-Tannoudji, B. Diu, F. Laloe // - Landau & Lifshitz, Volume 3 : (Quantum Mechanics) Chap. III-22 // // Usage : // mpirun -np 4 FreeFem++-mpi -wg schrodinger-1d-square-well-SLEPc.edp \ // -split 1 -npts 400 -nev 10 -sigma 0.0 // // Authors: Julien Garaud // Pierre Jolivet /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc" // PETSc plugin load "SLEPc" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM func Pk = P1; // Finite-element space /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 400) ; // Number of points on the perimeter real Lx = getARGV("-lx" , 80.0); // Dimension of the domain real Ly = getARGV("-ly" , 1) ; // Dimension of the domain // int nEV = getARGV("-nev" , 10) ; // Number of eigenvalues real sigma = getARGV("-sigma", 0.0) ; // Shift // real width = getARGV("-width",10.0) ; // Width of the square well real depth = getARGV("-depth", 2.0) ; // Depth of the square well /***************************************/ /* Verbosity and passed options */ /***************************************/ if(verbosity > 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- schrodinger-1d-square-well-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << " Domain size [Lx,Ly] = ["< A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D, clean = true); dmatrix DistB(DistA, B, clean = true); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -eps_target "+ sigma + // Shift value " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_gen_hermitian" // The problem is symmetric ; int k = deigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- schrodinger-2d-harmonic-oscillator-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << " Domain size [Lx,Ly] = ["< A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D); dmatrix DistB(DistA, B); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -eps_target "+ sigma + // Shift value " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_gen_hermitian" // The problem is symmetric ; int k = deigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i struct _n_User; template using User = _n_User*; template static PetscErrorCode MatMult_User(Mat A, Vec x, Vec y); template::value || !std::is_same::value>::type* = nullptr> void copy(K* pt, PetscInt n, PetscScalar* xr, PetscScalar* xi) { } template::value && std::is_same::value>::type* = nullptr> void copy(K* pt, PetscInt n, PetscScalar* xr, PetscScalar* xi) { for(int i = 0; i < n; ++i) pt[i] = K(xr[i], xi[i]); } template::value || !std::is_same::value>::type* = nullptr> void assign(K* pt, PetscScalar& kr, PetscScalar& ki) { *pt = kr; } template::value && std::is_same::value>::type* = nullptr> void assign(K* pt, PetscScalar& kr, PetscScalar& ki) { *pt = K(kr, ki); } template::value && std::is_same>::value)>::type* = nullptr> void distributedVec(unsigned int* num, unsigned int first, unsigned int last, K* const in, PetscScalar* pt, unsigned int n) { } template::value && std::is_same>::value)>::type* = nullptr> void distributedVec(unsigned int* num, unsigned int first, unsigned int last, K* const in, PetscScalar* pt, unsigned int n) { HPDDM::Subdomain::template distributedVec<0>(num, first, last, in, pt, n, 1); } template class eigensolver : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; class MatF_O : public VirtualMatrice { public: Stack stack; mutable Kn x; C_F0 c_x; Expression mat1, mat; typedef typename VirtualMatrice::plusAx plusAx; MatF_O(int n, Stack stk, const OneOperator* op) : VirtualMatrice(n), stack(stk), x(n), c_x(CPValue(x)), mat1(op ? op->code(basicAC_F0_wa(c_x)) : 0), mat(op ? CastTo(C_F0(mat1, (aType)*op)) : 0) { } ~MatF_O() { if(mat1 != mat) delete mat; delete mat1; Expression zzz = c_x; delete zzz; } void addMatMul(const Kn_& xx, Kn_& Ax) const { ffassert(xx.N() == Ax.N()); x = xx; Ax += GetAny((*mat)(stack)); WhereStackOfPtr2Free(stack)->clean(); } plusAx operator*(const Kn& x) const { return plusAx(this, x); } bool ChecknbLine(int) const { return true; } bool ChecknbColumn(int) const { return true; } }; const int c; class E_eigensolver : public E_F0mps { public: Expression A; Expression B; const OneOperator* codeA; const int c; static const int n_name_param = 9; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; E_eigensolver(const basicAC_F0& args, int d) : A(0), B(0), codeA(0), c(d) { args.SetNameParam(n_name_param, name_param, nargs); A = to(args[0]); if(c == 1) { const Polymorphic* op = dynamic_cast(args[1].LeftValue()); ffassert(op); codeA = op->Find("(", ArrayOfaType(atype*>(), false)); } else { B = to(args[1]); } } AnyType operator()(Stack stack) const; operator aType() const { return atype(); } }; E_F0* code(const basicAC_F0 & args) const { return new E_eigensolver(args, c); } eigensolver() : OneOperator(atype(), atype(), atype()), c(0) { } eigensolver(int) : OneOperator(atype(), atype(), atype()), c(1) { } }; template basicAC_F0::name_and_type eigensolver::E_eigensolver::name_param[] = { {"sparams", &typeid(std::string*)}, {"prefix", &typeid(std::string*)}, {"values", &typeid(KN*)}, {"vectors", &typeid(FEbaseArrayKn*)}, {"array", &typeid(KNM*)}, {"fields", &typeid(KN*)}, {"names", &typeid(KN*)}, {"schurPreconditioner", &typeid(KN>*)}, {"schurList", &typeid(KN*)} }; template struct _n_User { typename eigensolver::MatF_O* mat; }; template AnyType eigensolver::E_eigensolver::operator()(Stack stack) const { if(A && (B || codeA)) { Type* ptA = GetAny((*A)(stack)); if(ptA->_petsc) { EPS eps; EPSCreate(PETSC_COMM_WORLD, &eps); Mat S; User user = nullptr; if(!codeA) { Type* ptB = GetAny((*B)(stack)); EPSSetOperators(eps, ptA->_petsc, ptB->_A ? ptB->_petsc : NULL); } else { PetscInt bs; MatGetBlockSize(ptA->_petsc, &bs); PetscInt m, M; MatGetLocalSize(ptA->_petsc, &m, NULL); MatGetSize(ptA->_petsc, &M, NULL); PetscNew(&user); user->mat = new eigensolver::MatF_O(m * bs, stack, codeA); MatCreateShell(PETSC_COMM_WORLD, ptA->_last - ptA->_first, ptA->_last - ptA->_first, M, M, user, &S); MatShellSetOperation(S, MATOP_MULT, (void (*)(void))MatMult_User); EPSSetOperators(eps, S, NULL); } std::string* options = nargs[0] ? GetAny((*nargs[0])(stack)) : NULL; bool fieldsplit = PETSc::insertOptions(options); if(nargs[1]) EPSSetOptionsPrefix(eps, GetAny((*nargs[1])(stack))->c_str()); EPSSetFromOptions(eps); if(fieldsplit) { KN* fields = nargs[5] ? GetAny*>((*nargs[5])(stack)) : 0; KN* names = nargs[6] ? GetAny*>((*nargs[6])(stack)) : 0; KN>* mS = nargs[7] ? GetAny>*>((*nargs[7])(stack)) : 0; KN* pL = nargs[8] ? GetAny*>((*nargs[8])(stack)) : 0; if(fields && names) { ST st; KSP ksp; PC pc; EPSGetST(eps, &st); STGetKSP(st, &ksp); KSPSetOperators(ksp, ptA->_petsc, ptA->_petsc); setFieldSplitPC(ptA, ksp, fields, names, mS, pL); EPSSetUp(eps); if(!ptA->_S.empty()) { KSPGetPC(ksp, &pc); PCSetUp(pc); setCompositePC(ptA, pc); } } } FEbaseArrayKn* eigenvectors = nargs[3] ? GetAny*>((*nargs[3])(stack)) : nullptr; Vec* basis = nullptr; PetscInt n = 0; if(eigenvectors && eigenvectors->N > 0 && eigenvectors->get(0) && eigenvectors->get(0)->n > 0) { n = eigenvectors->N; basis = new Vec[n]; for(int i = 0; i < n; ++i) { MatCreateVecs(ptA->_petsc, &basis[i], NULL); PetscScalar* pt; VecGetArray(basis[i], &pt); if(!(std::is_same::value && std::is_same>::value)) distributedVec(ptA->_num, ptA->_first, ptA->_last, static_cast(*(eigenvectors->get(i))), pt, eigenvectors->get(i)->n); VecRestoreArray(basis[i], &pt); } } eigenvectors->resize(0); if(n) EPSSetInitialSpace(eps, n, basis); EPSSolve(eps); for(int i = 0; i < n; ++i) VecDestroy(&basis[i]); delete [] basis; PetscInt nconv; EPSGetConverged(eps, &nconv); if(nconv > 0 && (nargs[2] || nargs[3])) { KN* eigenvalues = nargs[2] ? GetAny*>((*nargs[2])(stack)) : nullptr; KNM* array = nargs[4] ? GetAny*>((*nargs[4])(stack)) : nullptr; if(eigenvalues) eigenvalues->resize(nconv); if(eigenvectors) eigenvectors->resize(nconv); if(array) array->resize(ptA->_A->getDof(), nconv); Vec xr, xi; PetscInt n; if(eigenvectors || array) { MatCreateVecs(ptA->_petsc, PETSC_NULL, &xr); MatCreateVecs(ptA->_petsc, PETSC_NULL, &xi); VecGetLocalSize(xr, &n); } for(PetscInt i = 0; i < nconv; ++i) { PetscScalar kr, ki; EPSGetEigenpair(eps, i, &kr, &ki, (eigenvectors || array) ? xr : NULL, (eigenvectors || array) && std::is_same::value && std::is_same>::value ? xi : NULL); if(eigenvectors || array) { PetscScalar* tmpr; PetscScalar* tmpi; VecGetArray(xr, &tmpr); K* pt; if(std::is_same::value && std::is_same>::value) { VecGetArray(xi, &tmpi); pt = new K[n]; copy(pt, n, tmpr, tmpi); } else pt = reinterpret_cast(tmpr); KN cpy(ptA->_A->getDof()); cpy = K(0.0); HPDDM::Subdomain::template distributedVec<1>(ptA->_num, ptA->_first, ptA->_last, static_cast(cpy), pt, cpy.n, 1); ptA->_A->HPDDM::template Subdomain::exchange(static_cast(cpy)); if(eigenvectors) eigenvectors->set(i, cpy); if(array) (*array)(':', i) = cpy; if(std::is_same::value && std::is_same>::value) delete [] pt; else VecRestoreArray(xi, &tmpi); VecRestoreArray(xr, &tmpr); } if(eigenvalues) { if(sizeof(PetscScalar) == sizeof(K)) (*eigenvalues)[i] = kr; else assign(static_cast(*eigenvalues + i), kr, ki); } } if(eigenvectors || array) { VecDestroy(&xr); VecDestroy(&xi); } } if(user) { MatDestroy(&S); delete user->mat; PetscFree(user); } EPSDestroy(&eps); return static_cast(nconv); } else return 0L; } else return 0L; } template static PetscErrorCode MatMult_User(Mat A, Vec x, Vec y) { User user; const PetscScalar* in; PetscScalar* out; PetscErrorCode ierr; PetscFunctionBegin; ierr = MatShellGetContext(A, &user); CHKERRQ(ierr); typename SLEPc::eigensolver::MatF_O* mat = reinterpret_cast::MatF_O*>(user->mat); VecGetArrayRead(x, &in); VecGetArray(y, &out); KN_ xx(const_cast(in), mat->N); KN_ yy(out, mat->N); yy = *mat * xx; VecRestoreArray(y, &out); VecRestoreArrayRead(x, &in); PetscFunctionReturn(0); } void finalizeSLEPc() { PETSC_COMM_WORLD = MPI_COMM_WORLD; SlepcFinalize(); } template::value>::type* = nullptr> void addSLEPc() { Global.Add("deigensolver", "(", new SLEPc::eigensolver>, double>()); Global.Add("deigensolver", "(", new SLEPc::eigensolver>, double>(1)); } template::value>::type* = nullptr> void addSLEPc() { } } static void Init() { // to load only once aType t; int r; #ifdef WITH_slepccomplex const char * mmmm= "Petsc Slepc complex"; #else const char * mmmm= "Petsc Slepc real"; #endif if(!zzzfff->InMotClef(mmmm,t,r)) { #ifdef PETScandSLEPc Init_PETSc(); #endif int argc = pkarg->n; char** argv = new char*[argc]; for(int i = 0; i < argc; ++i) argv[i] = const_cast((*(*pkarg)[i].getap())->c_str()); PetscBool isInitialized; PetscInitialized(&isInitialized); if(!isInitialized && mpirank == 0) std::cout << "PetscInitialize has not been called, do not forget to load PETSc before loading SLEPc" << std::endl; SlepcInitialize(&argc, &argv, 0, ""); delete [] argv; ff_atend(SLEPc::finalizeSLEPc); SLEPc::addSLEPc(); Global.Add("zeigensolver", "(", new SLEPc::eigensolver>, std::complex>()); Global.Add("zeigensolver", "(", new SLEPc::eigensolver>, std::complex>(1)); if(verbosity>1)cout << "*** End:: load PETSc & SELPc "<< typeid(PetscScalar).name() <<"\n\n"<Add(mmmm, atype()); } else { if(verbosity>1)cout << "*** reload and skip load PETSc & SELPc "<< typeid(PetscScalar).name() <<"\n\n"< 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-2d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40)); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(u, v) = intN(ThAugmented)(grad(u)' * grad(v)) + intN(ThAugmented)(v) + on(1, u = 1.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = square(1, 1); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_schwarz_method ras -hpddm_schwarz_coarse_correction deflated -hpddm_geneo_nu 10"); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized(u, v) = intN(Th)(grad(u)' * grad(v)) + intN1(Th, fakeInterface)(transmission * (u * v)) + on(1, u = 1.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(u, v) = intN(Th)(grad(u)' * grad(v)) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; real[int] err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/diffusion-2d-PETSc-complex.edp000644 000767 000024 00000004204 13256636774 024225 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc-complex" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient func Pk = P1; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-2d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThBorder, ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40)); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } varf vPb(u, v) = intN(Th)(1i*grad(u)' * grad(v)) + intN(Th)(v) + on(1, u = 0.0); matrix Mat = vPb(Wh, Wh); complex[int] rhs = vPb(0, Wh); zmatrix A(Mat, arrayIntersection, restrictionIntersection, D); set(A, sparams = "-ksp_view"); Wh def(u); // local solution u[] = A^-1 * rhs; complex[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; for(int i = 0; i < D.n; ++i) if(abs(D[i] - 1.0) > 1e-6) err[i] = 0.0; plotMPI(Th, u[], "Global solution", Pk, def, complex, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, complex, 3, 1) Wh def(Rb)[1]; Rb[0] = 1; set(A, sparams = "-pc_type lu -ksp_type gmres -ksp_max_it 200", nearnullspace = Rb); u[] = 0.0; u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, complex, 3, 1) freefem++-3.61-1/examples++-hpddm/stokes-2d-PETSc.edp000644 000767 000024 00000004112 13256636774 022100 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient real Sqrt = sqrt(2.); macro epsilon(u)[dx(u), dy(u#B), (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B))// EOM func Pk = [P2, P2, P1]; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - stokes-2d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThBorder, ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40), [x, y]); // global mesh ThGlobal = trunc(ThGlobal, (x < 0.5) || (y < 0.5), label = 5); Th = movemesh(ThGlobal, [-x, y]); ThGlobal = ThGlobal + Th; build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } varf vPb([u, uB, p], [v, vB, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(1, 3, 5, u = 0, uB = 0) + on(2, u = y*(0.5-y), uB = 0); matrix K = vPb(Wh, Wh); real[int] rhs = vPb(0, Wh); dmatrix Mat(K, arrayIntersection, restrictionIntersection, D, bs = 1); set(Mat, sparams = "-pc_type lu -pc_factor_mat_solver_package mumps"); Wh def(b); b[] = Mat^-1 * rhs; plotMPI(Th, b[], "Global solution PETSc", Pk, def, real, 3, 1); freefem++-3.61-1/examples++-hpddm/stokes-3d.edp000644 000767 000024 00000012423 13256636774 021171 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C, i#D]// EOM// vector field definition macro init(i)[i, i, i, i]// EOM // vector field initialization macro grad(u)[dx(u), dy(u), dz(u)]//// two-dimensional gradient real Sqrt = sqrt(2.); macro div(u)(dx(u) + dy(u#B) + dz(u#C))// EOM func Pk = [P2, P2, P2, P1]; // finite element space string deflation = getARGV("-deflation", "geneo-2"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - stokes-3d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = buildlayers(square(1, 1), 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { mesh ThGlobal2d = square(getARGV("-global", 12), getARGV("-global", 12), [x, y]); // global mesh ThGlobal2d = trunc(ThGlobal2d, (x <= 0.5) || (y <= 0.5), label = 5); ThGlobal2d = trunc(ThGlobal2d, (y >= 0.25) || (x >= 0.25), label = 5); mesh Th2d = movemesh(ThGlobal2d, [-x, y]); ThGlobal2d = ThGlobal2d + Th2d; meshN ThGlobal = buildlayers(ThGlobal2d, getARGV("-global", 12) / 2, zbound = [0, 0.4]); build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb([u, uB, uC, p], [v, vB, vC, q]) = intN(ThAugmented)(grad(u)' * grad(v) + grad(uB)' * grad(vB) + grad(uC)' * grad(vC) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(0, 1, 3, 5, u = 0, uB = 0, uC = 0) + on(2, u = 1000*y*(0.5-y)*z*(0.4-z), uB = 0, uC = 0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs, eps = -1); } ThBorder = buildlayers(square(1, 1), 1); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_local_operators_not_spd -hpddm_mkl_pardiso_iparm_13 1 --hpddm_schwarz_method oras -hpddm_schwarz_coarse_correction deflated -hpddm_geneo_nu 5"); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized([u, uB, uC, p], [v, vB, vC, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) + grad(uC)' * grad(vC) - div(u) * q - div(v) * p + 1e-10 * p * q) + intN1(Th, fakeInterface)(transmission * ([u, uB, uC]' * [v, vB, vC])) + on(0, 1, 3, 5, u = 0, uB = 0, uC = 0) + on(2, u = y*(0.5-y), uB = 0, uC = 0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen([u, uB, uC, p], [v, vB, vC, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) + grad(uC)' * grad(vC) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(0, 1, 3, 5, u = 0, uB = 0, uC = 0) + on(2, u = y*(0.5-y), uB = 0, uC = 0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/elasticity-3d.edp000644 000767 000024 00000013702 13256636774 022034 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D macro vectorialfe()P1// EOM include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization /*# DiffMacros #*/ real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), dz(u#C), (dz(u#B) + dy(u#C)) / Sqrt, (dz(u) + dx(u#C)) / Sqrt, (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B) + dz(u#C))// EOM /*# DiffMacrosEnd #*/ func Pk = [vectorialfe, vectorialfe, vectorialfe]; // finite element space /*# DDMoptions #*/ string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); /*# DDMoptionsEnd #*/ if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - elasticity-3d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } int[int] LL = [2,3, 2,1, 2,2]; meshN ThBorder, Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space /*# SchwarzMethod #*/ int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = cube(10 * getARGV("-global", 5), getARGV("-global", 5), getARGV("-global", 5), [10 * x, y, z], label = LL); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded, 3) } real f = -9000.0; real strain = 100.0; real Young = 2.0e11; // steel real poisson = 0.35; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(def(u), def(v)) = intN(ThAugmented)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(ThAugmented)(f * vC) + on(1, u = 0.0, uB = 0.0, uC = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = cube(1, 1, 1, [x, y, z]); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); /*# SchwarzMethodEnd #*/ /*# OsmTwolevel #*/ set(A, sparams = "-hpddm_schwarz_method ras -hpddm_schwarz_coarse_correction balanced -hpddm_variant right -hpddm_verbosity 1 -hpddm_geneo_nu 10"); /*# OsmTwolevelEnd #*/ matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = 2 * kZero * mu * (2 * mu + lambda) / (lambda + 3 * mu); varf vOptimized(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN1(Th, fakeInterface)(transmission * (def(u)' * def(v))) + on(1, u = 0.0, uB = 0.0, uC = 0.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + on(1, u = 0.0, uB = 0.0, uC = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } /*# SolvePlot #*/ Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) real alpha = 2000.0; meshN ThMoved = movemesh3(Th, transfo = [x + alpha * u, y + alpha * uB, z + alpha * uC]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) /*# SolvePlotEnd #*/ freefem++-3.61-1/examples++-hpddm/elasticity-3d-simple.edp000644 000767 000024 00000006546 13256636774 023333 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), dz(u#C), (dz(u#B) + dy(u#C)) / Sqrt, (dz(u) + dx(u#C)) / Sqrt, (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B) + dz(u#C))// EOM func Pk = [P1, P1, P1]; // finite element space int overlap = getARGV("-overlap", 2); // geometric overlap between subdomains int s = getARGV("-split", 1); // refinement factor int[int] LL = [2,3, 2,1, 2,2]; meshN ThBorder, Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = cube(6 * getARGV("-global", 5), getARGV("-global", 5), getARGV("-global", 5), [6 * x, y, z], label = LL); build(Th, ThBorder, ThGlobal, 10, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld , false) } real f = -9000.0; real strain = 100.0; real Young = 2.0e11; real poisson = 0.35; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); int dirichlet = 1; real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(def(u), def(v)) = intN(ThAugmented)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(ThAugmented)(f * vC) + on(dirichlet, u = 0.0, uB = 0.0, uC = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = cube(1, 1, 1, [x, y, z]); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_schwarz_coarse_correction balanced -hpddm_geneo_nu 6"); int solver = getOption("schwarz_method"); if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods varf vPbNoPen(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + on(dirichlet, u = 0.0, uB = 0.0, uC = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen); } Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) real alpha = 20000.0; meshN ThMoved = movemesh3(Th, transfo = [x + alpha * u, y + alpha * uB, z + alpha * uC]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/diffusion-2d-substructuring-withPartitioning.edp000644 000767 000024 00000006503 13256636774 030312 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 assert(mpisize == 4); load "hpddm_substructuring" // HPDDM plugin macro dimension()2// EOM // 2D or 3D include "macro_ddm_substructuring.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient macro BC(u, val)u = val// EOM // Dirichlet boundary conditions func Pk = P1; // finite element space int labNeumann = getARGV("-labNeumann", 2); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-2d-substructuring.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering int[int] interfaceNb; // int[int] labDirichlet = [1, 3]; { int[int] l = [2, 1, 3, 2]; meshN ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40), label = l); // global mesh fespace Ph(ThGlobal, P0); Ph part; part = (x > 0.5 && y > 0.5 ? 3 : (x > 0.5 ? 2 : (y < 0.5 ? 1 : 0))); buildSubstructuringWithPartitioning(Th, interfaceNb, ThGlobal, part[], 10, labDirichlet, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, Pk, BC, comm, excluded) } func f = 10; varf vPb(u, v) = intN(Th)(grad(u)' * grad(v)) + intN(Th)(f * v) + on(labDirichlet, u = 1.0); matrix Mat = vPb(Wh, Wh, solver = CG); // local operator real[int] rhs = vPb(0, Wh); // local right-hand side dbdd A(Mat, arrayIntersection, restrictionIntersection, communicator = comm); // this can be replaced by dfeti bool adaptive = isSetOption("geneo_nu") || isSetOption("geneo_threshold"); dpair ret; if(mpisize == 1) renumber(A, Mat, interfaceNb, effort = rhs); else { if(excluded) attachCoarseOperator(mpiCommWorld, A); else { Wh[int] def(Rb)(0); real[int] float(Wh.ndof); varf floatingPb(def(u), def(v)) = on(labDirichlet, BC(u, 1.0)); float = floatingPb(0, Wh); if(float.max < 0.9 && !adaptive) { Rb.resize(1); Rb[0][] = 1; } if(getARGV("-hpddm_substructuring_scaling", 0) != 2) renumber(A, Mat, interfaceNb, R = Rb, effort = rhs); else { Wh def(mu) = 1.0; renumber(A, Mat, interfaceNb, R = Rb, effort = rhs, rho = mu[]); } attachCoarseOperator(mpiCommWorld, A, R = Rb, ret = ret); } } Wh def(u) = 0.0; // local solution if(mpisize == mpiSize(comm)) u[] = A^-1 * rhs; else DDM(A, u[], rhs, excluded = excluded); if(!excluded) originalNumbering(A, u[], interfaceNb); plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) statistics(A); freefem++-3.61-1/examples++-hpddm/PETSc.cpp000644 000767 000024 00000000341 13256636774 020301 0ustar00hechtstaff000000 000000 //ff-c++-LIBRARY-dep: cxx11 hpddm petsc [slepc] [mumps parmetis ptscotch scotch scalapack|umfpack] [mkl|blas] mpi //ff-c++-cpp-dep: #define PETScandSLEPc 1 #include "PETSc-code.hpp" #include "SLEPc-code.hpp" LOADFUNC(Init) freefem++-3.61-1/examples++-hpddm/helmholtz-2d.edp000644 000767 000024 00000012230 13256636774 021662 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient func Pk = P1; // finite element space string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - helmholtz-2d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40)); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } func real wedge(real a, real b) { if(y < 0.4 + 0.1 * 0.75 * x) return 2.0; else if(y < 0.8 - 0.2 * 0.75 * x) return 1.5; else return 3.0; } real omega = 2 * pi * 5; func f = 80 * 100 * s * exp(-20 * 100 * s * ((x-0.5)^2 + (y-0.25)^2)); complex[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; fespace PhAugmented(ThAugmented, P0); PhAugmented val = wedge(x, y); PhAugmented k = omega / val; varf vPb(u, v) = intN(ThAugmented)(-k^2 * u * v + (grad(u)' * grad(v))) + intN1(ThAugmented, 2)(1i * k * u * v) + intN(ThAugmented)(f * v) + on(1, u = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); complex[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = square(1, 1); zschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); matrix Opt; // local operator with optimized boundary conditions zpair ret; { int solver = getOption("schwarz_method"); fespace Ph(Th, P0); Ph val = wedge(x, y); Ph k = omega / val; if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods varf vOptimized(u, v) = intN(Th)(-k^2 * u * v + (grad(u)' * grad(v))) + intN1(Th, 2)(1i * k * u * v) + intN(Th)(f * v) + intN1(Th, fakeInterface)(1i * k * u * v) + on(1, u = 0.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(u, v) = intN(Th)(-k^2 * u * v + (grad(u)' * grad(v))) + intN1(Th, 2)(1i * k * u * v) + intN(Th)(f * v) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; complex[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, complex, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, complex, 3, 1) freefem++-3.61-1/examples++-hpddm/PETSc-code.hpp000644 000767 000024 00000161142 13321622623 021202 0ustar00hechtstaff000000 000000 #include "petsc.h" #include "PETSc.hpp" typedef PETSc::DistributedCSR> Dmat; typedef PETSc::DistributedCSR> DmatR; typedef PETSc::DistributedCSR> DmatC; typedef PETSc::DistributedCSR> Dbddc; typedef PETSc::DistributedCSR> DbddcR; typedef PETSc::DistributedCSR> DbddcC; namespace PETSc { template::value>::type* = nullptr> void initPETScStructure(HpddmType* ptA, MatriceMorse* mA, PetscInt bs, PetscBool symmetric, KN::value, double, long>::type>* ptD, KN* rhs) { double timing = MPI_Wtime(); PetscInt global; if(ptD) { ptA->_A->initialize(*ptD); unsigned int g; ptA->_A->distributedNumbering(ptA->_num, ptA->_first, ptA->_last, g); global = g; if(verbosity > 0 && mpirank == 0) cout << " --- global numbering created (in " << MPI_Wtime() - timing << ")" << endl; } else global = PETSC_DECIDE; timing = MPI_Wtime(); int* ia = nullptr; int* ja = nullptr; PetscScalar* c = nullptr; bool free = ptA->_A->distributedCSR(ptA->_num, ptA->_first, ptA->_last, ia, ja, c); MatCreate(PETSC_COMM_WORLD, &(ptA->_petsc)); if(bs > 1) MatSetBlockSize(ptA->_petsc, bs); MatSetSizes(ptA->_petsc, ptA->_last - ptA->_first, ptA->_last - ptA->_first, global, global); MatSetType(ptA->_petsc, MATMPIAIJ); MatMPIAIJSetPreallocationCSR(ptA->_petsc, ia, ja, c); MatSetOption(ptA->_petsc, MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); MatSetOption(ptA->_petsc, MAT_SYMMETRIC, symmetric); if(free) { delete [] ia; delete [] ja; delete [] c; } ptA->_A->setBuffer(); if(verbosity > 0 && mpirank == 0) cout << " --- global CSR created (in " << MPI_Wtime() - timing << ")" << endl; if(rhs) ptA->_A->exchange(*rhs); } template::value>::type* = nullptr> void initPETScStructure(HpddmType* ptA, MatriceMorse* mA, PetscInt& bs, PetscBool symmetric, KN::value, double, long>::type>* ptD, KN* rhs) { const HPDDM::MatrixCSR* M = ptA->_A->getMatrix(); if(!M->_sym) cout << "Please assemble a symmetric CSR" << endl; double timing = MPI_Wtime(); ptA->_A->template renumber(STL(*ptD), nullptr); unsigned int global; ptA->_A->distributedNumbering(ptA->_num, ptA->_first, ptA->_last, global); if(verbosity > 0 && mpirank == 0) cout << " --- global numbering created (in " << MPI_Wtime() - timing << ")" << endl; timing = MPI_Wtime(); PetscInt* indices; PetscMalloc(sizeof(PetscInt) * M->_n / bs, &indices); for(unsigned int i = 0; i < M->_n; i += bs) indices[i / bs] = ptA->_num[i] / bs; ISLocalToGlobalMapping rmap; ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, bs, M->_n / bs, indices, PETSC_OWN_POINTER, &rmap); MatCreateIS(PETSC_COMM_WORLD, bs, PETSC_DECIDE, PETSC_DECIDE, global, global, rmap, NULL, &(ptA->_petsc)); Mat local; MatISGetLocalMat(ptA->_petsc, &local); MatSetType(local, MATSEQSBAIJ); std::vector>> transpose(M->_n); for(int i = 0; i < transpose.size(); ++i) for(int j = M->_ia[i]; j < M->_ia[i + 1]; ++j) { transpose[M->_ja[j]].emplace_back(i, M->_a[j]); if(bs > 1 && (i - M->_ja[j] <= (i % bs)) && M->_ja[j] != i) transpose[i].emplace_back(M->_ja[j], M->_a[j]); } int nnz = 0; for(int i = 0; i < transpose.size(); ++i) { std::sort(transpose[i].begin(), transpose[i].end(), [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); nnz += transpose[i].size(); } int* ia = new int[M->_n / bs + 1]; int* ja = new int[nnz / (bs * bs)]; PetscScalar* a = new PetscScalar[nnz]; ia[0] = 0; for(int i = 0; i < transpose.size(); ++i) { for(int j = 0; j < transpose[i].size(); ++j) { if(i % bs == 0 && j % bs == 0) ja[ia[i / bs] + j / bs] = transpose[i][j].first / bs; a[ia[i / bs] * (bs * bs) + j % bs + (j / bs) * (bs * bs) + (i % bs) * bs] = transpose[i][j].second; } if(i % bs == 0) ia[i / bs + 1] = ia[i / bs] + transpose[i].size() / bs; } MatSeqSBAIJSetPreallocationCSR(local, bs, ia, ja, a); MatSetOption(ptA->_petsc, MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); MatSetOption(ptA->_petsc, MAT_SYMMETRIC, symmetric); MatAssemblyBegin(ptA->_petsc, MAT_FINAL_ASSEMBLY); MatAssemblyEnd(ptA->_petsc, MAT_FINAL_ASSEMBLY); delete [] a; delete [] ja; delete [] ia; IS to, from; PetscInt nr; Vec rglobal; ISLocalToGlobalMappingGetSize(rmap, &nr); ISCreateStride(PETSC_COMM_SELF, nr, 0, 1, &to); ISLocalToGlobalMappingApplyIS(rmap, to, &from); MatCreateVecs(ptA->_petsc, &rglobal, NULL); Vec isVec; VecCreate(PETSC_COMM_SELF, &isVec); VecSetType(isVec, VECMPI); VecSetSizes(isVec, PETSC_DECIDE, nr); VecScatterCreate(rglobal, from, isVec, to, &(ptA->_scatter)); VecDestroy(&isVec); VecDestroy(&rglobal); ISDestroy(&from); ISDestroy(&to); // ISLocalToGlobalMappingView(rmap, PETSC_VIEWER_STDOUT_WORLD); ISLocalToGlobalMappingDestroy(&rmap); if(verbosity > 0 && mpirank == 0) cout << " --- global CSR created (in " << MPI_Wtime() - timing << ")" << endl; } template long globalNumbering(Type* const& A, KN* const& numbering) { if(A) { numbering->resize(A->_A->getMatrix()->_n); if(A->_num) for(int i = 0; i < numbering->n; ++i) numbering->operator[](i) = A->_num[i]; } return 0L; } template class changeOperator_Op : public E_F0mps { public: Expression A; Expression B; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; changeOperator_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), B(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type changeOperator_Op::name_param[] = { {"restriction", &typeid(Matrice_Creuse*)} }; template class changeOperator : public OneOperator { public: changeOperator() : OneOperator(atype(), atype(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new changeOperator_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType changeOperator_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); Matrice_Creuse* mat = GetAny*>((*B)(stack)); if(ptA && mat) { MatriceMorse* mN = nullptr; if(mat->A) mN = static_cast*>(&*(mat->A)); if(mN) { Matrice_Creuse* pList = nargs[0] ? GetAny*>((*nargs[0])(stack)) : 0; HPDDM::MatrixCSR* dL = nullptr; if(pList && pList->A) { MatriceMorse* mList = static_cast*>(&*(pList->A)); if(mList->n == mList->nbcoef - 1 && std::abs(mList->a[mList->nbcoef - 1]) < 1.0e-12) { mList->lg[mList->n] -= 1; mList->nbcoef -= 1; } ffassert(mList->n == mList->nbcoef); ffassert(mList->m == mN->n); dL = new HPDDM::MatrixCSR(mList->n, mN->n, mList->n, mList->lg, mList->cl, false); } HPDDM::MatrixCSR* dM = new HPDDM::MatrixCSR(mN->n, mN->m, mN->nbcoef, mN->a, mN->lg, mN->cl, mN->symetrique); HPDDM::MatrixCSR* dN; if(!dL) dN = dM; else { unsigned int* perm = new unsigned int[dM->_n](); for(unsigned int i = 0; i < dL->_n; ++i) perm[dL->_ja[i]] = i + 1; dN = new HPDDM::MatrixCSR(dM, dL, perm); delete [] perm; delete dM; } if(ptA->_A) ptA->_A->setMatrix(dN); int* ia = nullptr; int* ja = nullptr; PetscScalar* c = nullptr; if(ptA->_ksp) KSPSetOperators(ptA->_ksp, NULL, NULL); bool free = true; if(!ptA->_ksp) free = HPDDM::template Subdomain::distributedCSR(ptA->_num, ptA->_first, ptA->_last, ia, ja, c, dN, ptA->_num + dN->_n); else free = ptA->_A->distributedCSR(ptA->_num, ptA->_first, ptA->_last, ia, ja, c); MatZeroEntries(ptA->_petsc); for(PetscInt i = 0; i < ptA->_last - ptA->_first; ++i) { PetscInt row = ptA->_first + i; MatSetValues(ptA->_petsc, 1, &row, ia[i + 1] - ia[i], reinterpret_cast(ja + ia[i]), c + ia[i], INSERT_VALUES); } if(free) { delete [] ia; delete [] ja; delete [] c; } } MatAssemblyBegin(ptA->_petsc, MAT_FINAL_ASSEMBLY); MatAssemblyEnd(ptA->_petsc, MAT_FINAL_ASSEMBLY); if(ptA->_ksp) { KSPSetOperators(ptA->_ksp, ptA->_petsc, ptA->_petsc); if(std::is_same::value && !ptA->_S.empty()) { KSPSetFromOptions(ptA->_ksp); KSPSetUp(ptA->_ksp); PC pc; KSPGetPC(ptA->_ksp, &pc); PCType type; PCGetType(pc, &type); PetscBool isFieldSplit; PetscStrcmp(type, PCFIELDSPLIT, &isFieldSplit); if(isFieldSplit) { setCompositePC(ptA, pc); } } } } return 0L; } template long originalNumbering(Type* const& A, KN* const& in, KN* const& interface) { if(A) A->_A->originalNumbering(STL(*interface), *in); return 0L; } void finalizePETSc() { PETSC_COMM_WORLD = MPI_COMM_WORLD; PetscBool isFinalized; PetscFinalized(&isFinalized); if(!isFinalized) PetscFinalize(); } template long initEmptyCSR(Type* const&) { return 0L; } template class initCSRfromDMatrix_Op : public E_F0mps { public: Expression A; Expression B; Expression K; static const int n_name_param = 3; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initCSRfromDMatrix_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), B(param2), K(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initCSRfromDMatrix_Op::name_param[] = { {"rhs", &typeid(KN*)}, {"clean", &typeid(bool)}, {"symmetric", &typeid(bool)}, }; template class initCSRfromDMatrix : public OneOperator { public: initCSRfromDMatrix() : OneOperator(atype*>(), atype*>(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new initCSRfromDMatrix_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType initCSRfromDMatrix_Op::operator()(Stack stack) const { DistributedCSR* ptA = GetAny*>((*A)(stack)); DistributedCSR* ptB = GetAny*>((*B)(stack)); Matrice_Creuse* ptK = GetAny*>((*K)(stack)); if(ptB->_A && ptK->A) { ptA->_A = new HpddmType(static_cast&>(*ptB->_A)); MatriceMorse* mA = static_cast*>(&(*ptK->A)); HPDDM::MatrixCSR* dA = new HPDDM::MatrixCSR(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); ptA->_A->setMatrix(dA); ptA->_num = new unsigned int[mA->n]; std::copy_n(ptB->_num, dA->_n, ptA->_num); ptA->_first = ptB->_first; ptA->_last = ptB->_last; PetscInt bs; MatGetBlockSize(ptB->_petsc, &bs); KN* rhs = nargs[0] ? GetAny*>((*nargs[0])(stack)) : nullptr; initPETScStructure(ptA, mA, bs, nargs[2] ? (GetAny((*nargs[2])(stack)) ? PETSC_TRUE : PETSC_FALSE) : PETSC_FALSE, static_cast*>(nullptr), rhs); KSPCreate(PETSC_COMM_WORLD, &(ptA->_ksp)); KSPSetOperators(ptA->_ksp, ptA->_petsc, ptA->_petsc); } bool clean = nargs[1] && GetAny((*nargs[1])(stack)); if(clean) ptK->destroy(); return ptA; } template class initRectangularCSRfromDMatrix_Op : public E_F0mps { public: Expression A; Expression B; Expression C; Expression K; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initRectangularCSRfromDMatrix_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : A(param1), B(param2), C(param3), K(param4) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initRectangularCSRfromDMatrix_Op::name_param[] = { {"clean", &typeid(bool)}, }; template class initRectangularCSRfromDMatrix : public OneOperator { public: initRectangularCSRfromDMatrix() : OneOperator(atype*>(), atype*>(), atype*>(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new initRectangularCSRfromDMatrix_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } }; template AnyType initRectangularCSRfromDMatrix_Op::operator()(Stack stack) const { DistributedCSR* ptA = GetAny*>((*A)(stack)); DistributedCSR* ptB = GetAny*>((*B)(stack)); DistributedCSR* ptC = GetAny*>((*C)(stack)); Matrice_Creuse* ptK = GetAny*>((*K)(stack)); if(ptB->_A && ptC->_A) { ptA->_first = ptB->_first; ptA->_last = ptB->_last; ptA->_cfirst = ptC->_first; ptA->_clast = ptC->_last; PetscInt bs; MatGetBlockSize(ptB->_petsc, &bs); int* ia = nullptr; int* ja = nullptr; PetscScalar* c = nullptr; bool free = true; MatCreate(PETSC_COMM_WORLD, &(ptA->_petsc)); if(bs > 1) MatSetBlockSize(ptA->_petsc, bs); MatSetSizes(ptA->_petsc, ptB->_last - ptB->_first, ptC->_last - ptC->_first, PETSC_DECIDE, PETSC_DECIDE); MatSetType(ptA->_petsc, MATMPIAIJ); if(ptK->A) { MatriceMorse* mA = static_cast*>(&(*ptK->A)); HPDDM::MatrixCSR dA = HPDDM::MatrixCSR(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); ptA->_num = new unsigned int[mA->n + mA->m]; ptA->_cnum = ptA->_num + mA->n; std::copy_n(ptB->_num, mA->n, ptA->_num); std::copy_n(ptC->_num, mA->m, ptA->_cnum); free = HPDDM::template Subdomain::distributedCSR(ptA->_num, ptA->_first, ptA->_last, ia, ja, c, &dA, ptA->_num + mA->n); } else { ia = new int[ptB->_last - ptB->_first + 1](); } MatMPIAIJSetPreallocationCSR(ptA->_petsc, ia, ja, c); if(free) { delete [] ia; delete [] ja; delete [] c; } MatSetOption(ptA->_petsc, MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); ptA->_exchange = new HPDDM::template Subdomain*[2]; ptA->_exchange[0] = new HPDDM::template Subdomain(*ptB->_A); ptA->_exchange[0]->setBuffer(); ptA->_exchange[1] = new HPDDM::template Subdomain(*ptC->_A); ptA->_exchange[1]->setBuffer(); } bool clean = nargs[0] && GetAny((*nargs[0])(stack)); if(clean) ptK->destroy(); return ptA; } template class initCSRfromMatrix_Op : public E_F0mps { public: Expression A; Expression K; Expression size; static const int n_name_param = 6; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initCSRfromMatrix_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), K(param2), size(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initCSRfromMatrix_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"bs", &typeid(long)}, {"symmetric", &typeid(bool)}, {"clean", &typeid(bool)}, {"bsr", &typeid(bool)}, {"prune", &typeid(bool)} }; template class initCSRfromMatrix : public OneOperator { public: initCSRfromMatrix() : OneOperator(atype*>(), atype*>(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new initCSRfromMatrix_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType initCSRfromMatrix_Op::operator()(Stack stack) const { if(nargs[0]) PETSC_COMM_WORLD = *static_cast(GetAny((*nargs[0])(stack))); DistributedCSR* ptA = GetAny*>((*A)(stack)); Matrice_Creuse* ptK = GetAny*>((*K)(stack)); KN* ptSize = GetAny*>((*size)(stack)); MatriceMorse* mK = static_cast*>(&(*(ptK->A))); PetscInt bs = nargs[1] ? GetAny((*nargs[1])(stack)) : 1; MatCreate(PETSC_COMM_WORLD, &(ptA->_petsc)); if(bs > 1) MatSetBlockSize(ptA->_petsc, bs); bool bsr = nargs[4] && GetAny((*nargs[4])(stack)); bool prune = bsr ? (nargs[5] && GetAny((*nargs[5])(stack))) : false; if(prune) { ptA->_S.resize(1); MatCreate(PETSC_COMM_WORLD, &ptA->_S[0]); } if(mpisize > 1) { ffassert(ptSize->n >= 3 + mK->n); ptA->_first = ptSize->operator()(0); ptA->_last = ptSize->operator()(1); MatSetSizes(ptA->_petsc, mK->n * (bsr ? bs : 1), mK->n * (bsr ? bs : 1), ptSize->operator()(2) * (bsr ? bs : 1), ptSize->operator()(2) * (bsr ? bs : 1)); if(prune) MatSetSizes(ptA->_S[0], mK->n * bs, mK->n * bs, ptSize->operator()(2) * bs, ptSize->operator()(2) * bs); ptA->_num = new unsigned int[ptSize->n - 3]; for(int i = 3; i < ptSize->n; ++i) ptA->_num[i - 3] = ptSize->operator()(i); } else { ptA->_first = 0; ptA->_last = mK->n; ptA->_num = nullptr; MatSetSizes(ptA->_petsc, mK->n * (bsr ? bs : 1), mK->n * (bsr ? bs : 1), mK->n * (bsr ? bs : 1), mK->n * (bsr ? bs : 1)); if(prune) MatSetSizes(ptA->_S[0], mK->n * bs, mK->n * bs, mK->n * bs, mK->n * bs); } bool clean = nargs[3] && GetAny((*nargs[3])(stack)); if(clean) ptSize->resize(0); MatSetType(ptA->_petsc, bsr ? MATMPIBAIJ : MATMPIAIJ); if(bsr) MatMPIBAIJSetPreallocationCSR(ptA->_petsc, bs, mK->lg, mK->cl, mK->a); else MatMPIAIJSetPreallocationCSR(ptA->_petsc, mK->lg, mK->cl, mK->a); if(prune) { MatSetType(ptA->_S[0], MATMPIAIJ); int* pI = new int[mK->n * bs + 1]; int* pJ = new int[mK->nbcoef * bs]; PetscScalar* pC = new PetscScalar[mK->nbcoef * bs]; for(int i = 0; i < mK->n; ++i) { for(int k = 0; k < bs; ++k) { for(int j = mK->lg[i]; j < mK->lg[i + 1]; ++j) { pJ[j - mK->lg[i] + bs * mK->lg[i] + k * (mK->lg[i + 1] - mK->lg[i])] = mK->cl[j] * bs + k; pC[j - mK->lg[i] + bs * mK->lg[i] + k * (mK->lg[i + 1] - mK->lg[i])] = mK->a[j * bs * bs + k * bs + k]; } pI[i * bs + k] = mK->lg[i] * bs + k * (mK->lg[i + 1] - mK->lg[i]); } } pI[mK->n * bs] = mK->nbcoef * bs; MatMPIAIJSetPreallocationCSR(ptA->_S[0], pI, pJ, pC); delete [] pC; delete [] pJ; delete [] pI; } if(clean) ptK->destroy(); MatSetOption(ptA->_petsc, MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); if(nargs[2]) MatSetOption(ptA->_petsc, MAT_SYMMETRIC, GetAny((*nargs[2])(stack)) ? PETSC_TRUE : PETSC_FALSE); KSPCreate(PETSC_COMM_WORLD, &(ptA->_ksp)); #ifdef PETSC_HAVE_MKL_SPARSE_OPTIMIZE if(0 && prune && bsr) MatConvert(ptA->_petsc, MATMPIBAIJMKL, MAT_INPLACE_MATRIX, &(ptA->_petsc)); #endif KSPSetOperators(ptA->_ksp, ptA->_petsc, prune ? ptA->_S[0] : ptA->_petsc); return ptA; } template class initCSRfromArray_Op : public E_F0mps { public: Expression A; Expression K; static const int n_name_param = 5; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initCSRfromArray_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), K(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initCSRfromArray_Op::name_param[] = { {"columns", &typeid(KN*)}, {"communicator", &typeid(pcommworld)}, {"bs", &typeid(long)}, {"symmetric", &typeid(bool)}, {"clean", &typeid(bool)} }; template class initCSRfromArray : public OneOperator { public: initCSRfromArray() : OneOperator(atype*>(), atype*>(), atype>*>()) { } E_F0* code(const basicAC_F0& args) const { return new initCSRfromArray_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType initCSRfromArray_Op::operator()(Stack stack) const { if(nargs[1]) PETSC_COMM_WORLD = *static_cast(GetAny((*nargs[1])(stack))); int size; MPI_Comm_size(PETSC_COMM_WORLD, &size); DistributedCSR* ptA = GetAny*>((*A)(stack)); KN>* ptK = GetAny>*>((*K)(stack)); KN* ptJ = nargs[0] ? GetAny*>((*nargs[0])(stack)) : nullptr; if(!ptJ || ptJ->n == ptK->n) { double timing = MPI_Wtime(); std::vector> v; if(ptJ) { v.reserve(ptJ->n); for(int i = 0; i < ptJ->n; ++i) v.emplace_back(std::make_pair(ptJ->operator[](i), i)); std::sort(v.begin(), v.end()); } PetscInt bs = nargs[2] ? GetAny((*nargs[2])(stack)) : 1; int rank; MPI_Comm_rank(PETSC_COMM_WORLD, &rank); int* dims = new int[size](); std::vector>::const_iterator it = std::lower_bound(v.cbegin(), v.cend(), std::make_pair(rank, 0), [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); int n = 0; if(!ptJ) { dims[rank] = ptK->operator[](mpisize / ptK->n > 1 ? 0 : rank).M(); n = ptK->operator[](mpisize / ptK->n > 1 ? 0 : rank).N(); } else if(it->first == rank) { dims[rank] = ptK->operator[](it->second).M(); n = ptK->operator[](it->second).N(); } MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, dims, 1, MPI_INT, PETSC_COMM_WORLD); if(ptJ) size = v.size(); else size = ptK->n; int* ia = new int[n + 1]; for(int i = 0; i < n + 1; ++i) { ia[i] = 0; for(int k = 0; k < size; ++k) { MatriceMorse *mA = static_cast*>(&(*(ptK->operator[](k)).A)); if(i < mA->n + 1) ia[i] += mA->lg[i]; } } int* ja = new int[ia[n]]; PetscScalar* c = new PetscScalar[ia[n]]; int nnz = 0; int offset = (ptJ ? std::accumulate(dims, dims + v.begin()->first, 0) : 0); for(int i = 0; i < n; ++i) { int backup = offset; for(int k = 0; k < size; ++k) { MatriceMorse *mA = static_cast*>(&(*(ptK->operator[](ptJ ? v[k].second : k)).A)); if(i < mA->n) { int j = mA->lg[i]; for( ; j < mA->lg[i + 1] && mA->cl[j] < dims[ptJ ? v[k].first : k]; ++j) ja[nnz + j - mA->lg[i]] = mA->cl[j] + offset; std::copy_n(mA->a + mA->lg[i], j - mA->lg[i], c + nnz); nnz += j - mA->lg[i]; if(k < (ptJ ? v.size() : size) - 1) offset += (ptJ ? std::accumulate(dims + v[k].first, dims + v[k + 1].first, 0) : dims[k]); } } offset = backup; } delete [] dims; MatCreate(PETSC_COMM_WORLD, &(ptA->_petsc)); if(bs > 1) MatSetBlockSize(ptA->_petsc, bs); if(!ptJ && (mpisize / ptK->n > 1)) MatSetSizes(ptA->_petsc, n, n, PETSC_DECIDE, PETSC_DECIDE); else MatSetSizes(ptA->_petsc, n, ptK->operator[](ptJ ? it->second : rank).M(), PETSC_DECIDE, PETSC_DECIDE); ptA->_first = 0; ptA->_last = n; bool clean = nargs[4] && GetAny((*nargs[4])(stack)); if(clean) { int* cl = nullptr; int* lg = nullptr; PetscScalar* a = nullptr; for(int k = 0; k < size; ++k) { MatriceMorse *mA = static_cast*>(&(*(ptK->operator[](ptJ ? v[k].second : k)).A)); if(k == 0) { cl = mA->cl; lg = mA->lg; a = mA->a; } else { if(mA->cl == cl) mA->cl = nullptr; if(mA->lg == lg) mA->lg = nullptr; if(mA->a == a) mA->a = nullptr; } } ptK->resize(0); } MatSetType(ptA->_petsc, MATMPIAIJ); MatMPIAIJSetPreallocationCSR(ptA->_petsc, ia, ja, c); delete [] ia; delete [] ja; delete [] c; MatSetOption(ptA->_petsc, MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); if(nargs[3]) MatSetOption(ptA->_petsc, MAT_SYMMETRIC, GetAny((*nargs[3])(stack)) ? PETSC_TRUE : PETSC_FALSE); if(verbosity > 0 && mpirank == 0) cout << " --- global CSR created (in " << MPI_Wtime() - timing << ")" << endl; timing = MPI_Wtime(); KSPCreate(PETSC_COMM_WORLD, &(ptA->_ksp)); KSPSetOperators(ptA->_ksp, ptA->_petsc, ptA->_petsc); } return ptA; } template class initCSR_Op : public E_F0mps { public: Expression A; Expression K; Expression O; Expression R; Expression D; static const int n_name_param = 6; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initCSR_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4, Expression param5) : A(param1), K(param2), O(param3), R(param4), D(param5) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initCSR_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"bs", &typeid(long)}, {"rhs", &typeid(KN*)}, {"clean", &typeid(bool)}, {"symmetric", &typeid(bool)}, {"restriction", &typeid(Matrice_Creuse*)} }; template class initCSR : public OneOperator { public: initCSR() : OneOperator(atype*>(), atype*>(), atype*>(), atype*>(), atype>*>(), atype>::value, double, long>::type>*>()) { } E_F0* code(const basicAC_F0& args) const { return new initCSR_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3]), t[4]->CastTo(args[4])); } }; template AnyType initCSR_Op::operator()(Stack stack) const { DistributedCSR* ptA = GetAny*>((*A)(stack)); KN>* ptR = GetAny>*>((*R)(stack)); KN* ptO = GetAny*>((*O)(stack)); KN>::value, double, long>::type>* ptD = GetAny>::value, double, long>::type>*>((*D)(stack)); PetscInt bs = nargs[1] ? GetAny((*nargs[1])(stack)) : 1; MatriceMorse *mA = static_cast*>(&(*GetAny*>((*K)(stack))->A)); MPI_Comm* comm = nargs[0] ? (MPI_Comm*)GetAny((*nargs[0])(stack)) : 0; KN* rhs = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; ptA->_A = new HpddmType; if(comm) PETSC_COMM_WORLD = *comm; if(ptO && mA) { HPDDM::MatrixCSR* dA = new HPDDM::MatrixCSR(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); Matrice_Creuse* pList = nargs[5] ? GetAny*>((*nargs[5])(stack)) : 0; HPDDM::MatrixCSR* dL = nullptr; if(std::is_same>::value && pList) { int n = 0; ptA->_exchange = new HPDDM::template Subdomain*[2](); ptA->_exchange[0] = new HPDDM::template Subdomain(); ptA->_exchange[0]->initialize(dA, STL(*ptO), *ptR, comm); ptA->_exchange[0]->setBuffer(); if(pList->A) { MatriceMorse* mList = static_cast*>(&*(pList->A)); if(mList->n == mList->nbcoef - 1 && std::abs(mList->a[mList->nbcoef - 1]) < 1.0e-12) { mList->lg[mList->n] -= 1; mList->nbcoef -= 1; } ffassert(mList->n == mList->nbcoef); ffassert(mList->m == mA->n); n = mList->n; dL = new HPDDM::MatrixCSR(n, mA->n, n, mList->lg, mList->cl, false); double* D = new double[n]; for(int i = 0; i < n; ++i) D[i] = ptD->operator[](mList->cl[i]); ptD->resize(n); for(int i = 0; i < n; ++i) ptD->operator[](i) = D[i]; delete [] D; } else { dL = new HPDDM::MatrixCSR(0, mA->n, 0, nullptr, nullptr, false); ptD->destroy(); } } ptA->_A->HPDDM::template Subdomain::initialize(dA, STL(*ptO), *ptR, comm, dL); delete dL; ptA->_num = new unsigned int[ptA->_A->getMatrix()->_n]; initPETScStructure(ptA, mA, bs, nargs[4] ? (GetAny((*nargs[4])(stack)) ? PETSC_TRUE : PETSC_FALSE) : PETSC_FALSE, ptD, rhs); if(!std::is_same>::value) mA->lg = ptA->_A->getMatrix()->_ia; KSPCreate(PETSC_COMM_WORLD, &(ptA->_ksp)); KSPSetOperators(ptA->_ksp, ptA->_petsc, ptA->_petsc); bool clean = nargs[3] && GetAny((*nargs[3])(stack)); if(clean) { ptO->resize(0); ptR->resize(0); GetAny*>((*K)(stack))->destroy(); } } return ptA; } template class setOptions_Op : public E_F0mps { public: Expression A; static const int n_name_param = 7; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; setOptions_Op(const basicAC_F0& args, Expression param1) : A(param1) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type setOptions_Op::name_param[] = { {"sparams", &typeid(std::string*)}, {"nearnullspace", &typeid(FEbaseArrayKn*)}, {"fields", &typeid(KN*)}, {"names", &typeid(KN*)}, {"prefix", &typeid(std::string*)}, {"schurPreconditioner", &typeid(KN>*)}, {"schurList", &typeid(KN*)} }; template class setOptions : public OneOperator { public: setOptions() : OneOperator(atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new setOptions_Op(args, t[0]->CastTo(args[0])); } }; template AnyType setOptions_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); std::string* options = nargs[0] ? GetAny((*nargs[0])(stack)) : NULL; bool fieldsplit = PETSc::insertOptions(options); if(std::is_same::value && fieldsplit) { KN* fields = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; KN* names = nargs[3] ? GetAny*>((*nargs[3])(stack)) : 0; KN>* mS = nargs[5] ? GetAny>*>((*nargs[5])(stack)) : 0; KN* pL = nargs[6] ? GetAny*>((*nargs[6])(stack)) : 0; setFieldSplitPC(ptA, ptA->_ksp, fields, names, mS, pL); } if(std::is_same::value) { FEbaseArrayKn* ptNS = nargs[1] ? GetAny*>((*nargs[1])(stack)) : 0; int dim = ptNS ? ptNS->N : 0; if(dim) { Vec x; MatCreateVecs(ptA->_petsc, &x, NULL); Vec* ns; VecDuplicateVecs(x, dim, &ns); for(unsigned short i = 0; i < dim; ++i) { PetscScalar* x; VecGetArray(ns[i], &x); HPDDM::Subdomain::template distributedVec<0>(ptA->_num, ptA->_first, ptA->_last, static_cast(*(ptNS->get(i))), x, ptNS->get(i)->n); VecRestoreArray(ns[i], &x); } PetscScalar* dots = new PetscScalar[dim]; for(unsigned short i = 0; i < dim; ++i) { if(i > 0) { VecMDot(ns[i], i, ns, dots); for(int j = 0; j < i; ++j) dots[j] *= -1.0; VecMAXPY(ns[i], i, dots, ns); } VecNormalize(ns[i], NULL); } delete [] dots; MatNullSpace sp; MatNullSpaceCreate(PETSC_COMM_WORLD, PETSC_FALSE, dim, ns, &sp); MatSetNearNullSpace(ptA->_petsc, sp); MatNullSpaceDestroy(&sp); if(ns) VecDestroyVecs(dim, &ns); delete [] ns; } } if(nargs[4]) KSPSetOptionsPrefix(ptA->_ksp, GetAny((*nargs[4])(stack))->c_str()); KSPSetFromOptions(ptA->_ksp); KSPSetUp(ptA->_ksp); if(std::is_same::value && nargs[2] && nargs[5] && nargs[6]) { PC pc; KSPGetPC(ptA->_ksp, &pc); setCompositePC(ptA, pc); } return 0L; } template class IterativeMethod_Op : public E_F0mps { public: Expression A; Expression rhs; Expression x; static const int n_name_param = 2; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; IterativeMethod_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), rhs(param2), x(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type IterativeMethod_Op::name_param[] = { {"sparams", &typeid(std::string*)}, {"prefix", &typeid(std::string*)} }; template class IterativeMethod : public OneOperator { public: IterativeMethod() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new IterativeMethod_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType IterativeMethod_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); KN* ptRhs = GetAny*>((*rhs)(stack)); KN* ptX = GetAny*>((*x)(stack)); std::string* options = nargs[0] ? GetAny((*nargs[0])(stack)) : NULL; std::string* prefix = nargs[1] ? GetAny((*nargs[1])(stack)) : NULL; PetscInt bs; MatType type; MatGetType(ptA->_petsc, &type); PetscBool isNotBlock; PetscStrcmp(type, MATMPIAIJ, &isNotBlock); if(isNotBlock) bs = 1; else MatGetBlockSize(ptA->_petsc, &bs); HPDDM::PETScOperator op(ptA->_ksp, ptA->_last - ptA->_first, bs); if(prefix) op.setPrefix(*prefix); HPDDM::Option& opt = *HPDDM::Option::get(); if(options) { opt.parse(*options, mpirank == 0); if(mpirank != 0) opt.remove("verbosity"); } Vec x, y; MatCreateVecs(ptA->_petsc, &x, &y); PetscScalar* ptr_x; VecGetArray(x, &ptr_x); HPDDM::Subdomain::template distributedVec<0>(ptA->_num, ptA->_first, ptA->_last, static_cast(*ptRhs), ptr_x, ptRhs->n / bs, bs); PetscScalar* ptr_y; VecGetArray(y, &ptr_y); std::fill_n(ptr_y, op._n, 0.0); HPDDM::IterativeMethod::solve(op, ptr_x, ptr_y, 1, PETSC_COMM_WORLD); VecRestoreArray(x, &ptr_x); HPDDM::Subdomain::template distributedVec<1>(ptA->_num, ptA->_first, ptA->_last, static_cast(*ptX), ptr_y, ptX->n / bs, bs); VecRestoreArray(y, &ptr_y); VecDestroy(&y); if(ptA->_A) ptA->_A->HPDDM::template Subdomain::exchange(static_cast(*ptX)); return 0L; } template class changeNumbering_Op : public E_F0mps { public: Expression A; Expression in; Expression out; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; changeNumbering_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), in(param2), out(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type changeNumbering_Op::name_param[] = { {"inverse", &typeid(bool)}, }; template class changeNumbering : public OneOperator { public: changeNumbering() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new changeNumbering_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template void changeNumbering_func(Type* ptA, KN* ptIn, KN* ptOut, bool inverse) { if(ptA && ptA->_last - ptA->_first) { PetscInt bs; MatType type; MatGetType(ptA->_petsc, &type); PetscBool isNotBlock; PetscStrcmp(type, MATMPIAIJ, &isNotBlock); if(isNotBlock) bs = 1; else MatGetBlockSize(ptA->_petsc, &bs); PetscInt m; MatGetLocalSize(ptA->_petsc, &m, NULL); PetscScalar* out; if(!inverse) { ffassert(ptIn->n == ptA->_A->getMatrix()->_n); ptOut->resize(m * bs); out = static_cast(*ptOut); HPDDM::Subdomain::template distributedVec<0>(ptA->_num, ptA->_first, ptA->_last, static_cast(*ptIn), out, ptIn->n / bs, bs); } else { ffassert(ptOut->n == bs * m); ptIn->resize(ptA->_A->getMatrix()->_n); *ptIn = PetscScalar(); out = static_cast(*ptOut); HPDDM::Subdomain::template distributedVec<1>(ptA->_num, ptA->_first, ptA->_last, static_cast(*ptIn), out, ptIn->n / bs, bs); } } } template AnyType changeNumbering_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); KN* ptIn = GetAny*>((*in)(stack)); KN* ptOut = GetAny*>((*out)(stack)); bool inverse = nargs[0] && GetAny((*nargs[0])(stack)); changeNumbering_func(ptA, ptIn, ptOut, inverse); return 0L; } template long MatMult(Type* const& A, KN* const& in, KN* const& out) { if(A) { Vec x, y; PetscInt size; if(N == 'T') { MatCreateVecs(A->_petsc, &y, &x); VecGetLocalSize(x, &size); ffassert(in->n == size); VecGetLocalSize(y, &size); VecPlaceArray(x, *in); out->resize(size); VecPlaceArray(y, *out); MatMultTranspose(A->_petsc, x, y); } else { MatCreateVecs(A->_petsc, &x, &y); VecGetLocalSize(x, &size); ffassert(in->n == size); VecGetLocalSize(y, &size); VecPlaceArray(x, *in); out->resize(size); VecPlaceArray(y, *out); MatMult(A->_petsc, x, y); } VecResetArray(y); VecResetArray(x); VecDestroy(&y); VecDestroy(&x); } return 0L; } template long KSPSolve(Type* const& A, KN* const& in, KN* const& out) { if(A) { Vec x, y; MatCreateVecs(A->_petsc, &x, &y); PetscInt size; VecGetLocalSize(y, &size); ffassert(in->n == size); if(out->n != size) { out->resize(size); *out = PetscScalar(); } VecPlaceArray(x, *in); VecPlaceArray(y, *out); KSPSolve(A->_ksp, x, y); VecResetArray(y); VecResetArray(x); VecDestroy(&y); VecDestroy(&x); } return 0L; } template class augmentation_Op : public E_F0mps { public: Expression A; Expression B; static const int n_name_param = 3; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; augmentation_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), B(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type augmentation_Op::name_param[] = { {"P", &typeid(Type*)}, {"alpha", &typeid(PetscScalar)}, {"pattern", &typeid(long)} }; template class augmentation : public OneOperator { public: augmentation() : OneOperator(atype(), atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new augmentation_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType augmentation_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); Type* ptB = GetAny((*B)(stack)); Type* ptR = nargs[0] ? GetAny((*nargs[0])(stack)) : nullptr; PetscScalar alpha = nargs[1] ? GetAny((*nargs[1])(stack)) : PetscScalar(1.0); long pattern = nargs[2] ? GetAny((*nargs[2])(stack)) : 0; if(ptA->_petsc && ptB->_petsc) { if(!ptR || !ptR->_petsc) { MatAXPY(ptA->_petsc, alpha, ptB->_petsc, MatStructure(pattern)); } else { Mat C; MatPtAP(ptB->_petsc, ptR->_petsc, MAT_INITIAL_MATRIX, PETSC_DEFAULT, &C); MatAXPY(ptA->_petsc, alpha, C, MatStructure(pattern)); MatDestroy(&C); } } else if(ptA->_petsc && ptR && ptR->_petsc) { Mat C; MatTransposeMatMult(ptR->_petsc, ptR->_petsc, MAT_INITIAL_MATRIX, PETSC_DEFAULT, &C); MatAXPY(ptA->_petsc, alpha, C, MatStructure(pattern)); MatDestroy(&C); } return 0L; } template class InvPETSc { static_assert(std::is_same::value, "Wrong types"); public: const T t; const U u; InvPETSc(T v, U w) : t(v), u(w) {} void solve(U out) const { Vec x, y; double timing = MPI_Wtime(); MatCreateVecs((*t)._petsc, &x, &y); PetscScalar* ptr; PetscInt bs; MatType type; MatGetType((*t)._petsc, &type); PetscBool isNotBlock; PetscStrcmp(type, MATMPIAIJ, &isNotBlock); if(isNotBlock) bs = 1; else MatGetBlockSize((*t)._petsc, &bs); if(std::is_same_A)>::type, HpSchwarz>::value) { VecGetArray(x, &ptr); HPDDM::Subdomain::template distributedVec<0>((*t)._num, (*t)._first, (*t)._last, static_cast(*u), ptr, u->n / bs, bs); VecRestoreArray(x, &ptr); if(t.A->_A) std::fill_n(static_cast(*out), out->n, 0.0); } else { PetscScalar zero = 0.0; VecSet(x, zero); #if 0 Mat_IS* is = (Mat_IS*)(*t)._petsc->data; VecGetArray(is->y, &ptr); std::copy_n(static_cast(*u), (*t)._A->getMatrix()->_n, ptr); VecRestoreArray(is->y, &ptr); VecScatterBegin(is->rctx,is->y,x,ADD_VALUES,SCATTER_REVERSE); VecScatterEnd(is->rctx,is->y,x,ADD_VALUES,SCATTER_REVERSE); #else Vec isVec; VecCreateMPIWithArray(PETSC_COMM_SELF, bs, (*t)._A->getMatrix()->_n, (*t)._A->getMatrix()->_n, static_cast(*u), &isVec); VecScatterBegin((*t)._scatter, isVec, x, ADD_VALUES, SCATTER_REVERSE); VecScatterEnd((*t)._scatter, isVec, x, ADD_VALUES, SCATTER_REVERSE); VecDestroy(&isVec); #endif } timing = MPI_Wtime(); KSPSolve((*t)._ksp, x, y); if(verbosity > 0 && mpirank == 0) cout << " --- system solved with PETSc (in " << MPI_Wtime() - timing << ")" << endl; if(std::is_same_A)>::type, HpSchwarz>::value) { VecGetArray(y, &ptr); HPDDM::Subdomain::template distributedVec<1>((*t)._num, (*t)._first, (*t)._last, static_cast(*out), ptr, out->n / bs, bs); VecRestoreArray(y, &ptr); } else { #if 0 Mat_IS* is = (Mat_IS*)(*t)._petsc->data; VecScatterBegin(is->rctx,y,is->y,INSERT_VALUES,SCATTER_FORWARD); VecScatterEnd(is->rctx,y,is->y,INSERT_VALUES,SCATTER_FORWARD); VecGetArray(is->y, &ptr); std::copy_n(ptr, (*t)._A->getMatrix()->_n, (PetscScalar*)*out); VecRestoreArray(is->y, &ptr); #else Vec isVec; VecCreateMPIWithArray(PETSC_COMM_SELF, bs, (*t)._A->getMatrix()->_n, (*t)._A->getMatrix()->_n, static_cast(*out), &isVec); VecScatterBegin((*t)._scatter, y, isVec, INSERT_VALUES, SCATTER_FORWARD); VecScatterEnd((*t)._scatter, y, isVec, INSERT_VALUES, SCATTER_FORWARD); VecDestroy(&isVec); #endif } VecDestroy(&x); VecDestroy(&y); if(std::is_same_A)>::type, HpSchwarz>::value && t.A->_A) (*t)._A->HPDDM::template Subdomain::exchange(*out); }; static U init(U Ax, InvPETSc A) { A.solve(Ax); return Ax; } }; template class ProdPETSc { static_assert(std::is_same::value, "Wrong types"); public: const T t; const U u; ProdPETSc(T v, U w) : t(v), u(w) {} void prod(U out) const { if((*t)._petsc) { Vec x, y; PetscScalar* ptr; if(N == 'N') MatCreateVecs((*t)._petsc, &x, &y); else MatCreateVecs((*t)._petsc, &y, &x); VecGetArray(x, &ptr); PetscInt bs; MatType type; MatGetType((*t)._petsc, &type); PetscBool isNotBlock; PetscStrcmp(type, MATMPIAIJ, &isNotBlock); if(isNotBlock) bs = 1; else MatGetBlockSize((*t)._petsc, &bs); if(!t->_cnum || N == 'T') { if(t->_num) HPDDM::Subdomain::template distributedVec<0>(t->_num, t->_first, t->_last, static_cast(*u), ptr, u->n / bs, bs); } else HPDDM::Subdomain::template distributedVec<0>(t->_cnum, t->_cfirst, t->_clast, static_cast(*u), ptr, u->n / bs, bs); VecRestoreArray(x, &ptr); if(N == 'T') MatMultTranspose(t->_petsc, x, y); else MatMult(t->_petsc, x, y); VecGetArray(y, &ptr); if(!t->_A) std::fill_n(static_cast(*out), out->n, 0.0); if(!t->_cnum || N == 'N') { if(t->_num) HPDDM::Subdomain::template distributedVec<1>(t->_num, t->_first, t->_last, static_cast(*out), ptr, out->n / bs, bs); } else HPDDM::Subdomain::template distributedVec<1>(t->_cnum, t->_cfirst, t->_clast, static_cast(*out), ptr, out->n / bs, bs); if(t->_A) (*t)._A->HPDDM::template Subdomain::exchange(*out); else if(t->_exchange) { if(N == 'N') (*t)._exchange[0]->exchange(*out); else (*t)._exchange[1]->exchange(*out); } VecRestoreArray(y, &ptr); VecDestroy(&y); } } static U mv(U Ax, ProdPETSc A) { *Ax = K(); A.prod(Ax); return Ax; } static U init(U Ax, ProdPETSc A) { PetscInt n, m; MatGetSize(A.t->_petsc, &n, &m); ffassert(n == m); Ax->init(A.u->n); return mv(Ax, A); } }; } template bool CheckPetscMatrix(Type* ptA) { ffassert(ptA); PetscValidHeaderSpecific(ptA->_petsc, MAT_CLASSID, 2); return true; } template inline bool exist_type() { map::iterator ir = map_type.find(typeid(T).name()); return ir != map_type.end(); } static void Init_PETSc() { if(verbosity > 1 && mpirank == 0) { cout << " PETSc ( " << typeid(PetscScalar).name() << " )" << endl; } int argc = pkarg->n; char** argv = new char*[argc]; for(int i = 0; i < argc; ++i) argv[i] = const_cast((*(*pkarg)[i].getap())->c_str()); PetscInitialize(&argc, &argv, 0, ""); if(argc > 1) { HPDDM::Option& opt = *HPDDM::Option::get(); opt.parse(argc - 1, argv + 1, mpirank == 0); if(mpirank != 0) opt.remove("verbosity"); } delete [] argv; KSPRegister("hpddm", HPDDM::KSPCreate_HPDDM); ff_atend(PETSc::finalizePETSc); if(!exist_type()) { Dcl_Type(Initialize, Delete); zzzfff->Add("dmatrix", atype()); } if(!exist_type()) { Dcl_Type(Initialize, Delete); zzzfff->Add("zmatrix", atype()); } if(!exist_type()) { Dcl_Type(Initialize, Delete); zzzfff->Add("dbddc", atype()); } if(!exist_type()) { Dcl_Type(Initialize, Delete); zzzfff->Add("zbddc", atype()); } map_type_of_map[make_pair(atype(),atype())] = atype(); map_type_of_map[make_pair(atype(),atype())] = atype(); map_type_of_map[make_pair(atype(),atype())] = atype(); map_type_of_map[make_pair(atype(),atype())] = atype(); TheOperators->Add("<-", new OneOperator1_(PETSc::initEmptyCSR)); if(std::is_same::value) { TheOperators->Add("<-", new PETSc::initCSR>); TheOperators->Add("<-", new PETSc::initCSRfromArray>); TheOperators->Add("<-", new PETSc::initCSRfromMatrix>); TheOperators->Add("<-", new PETSc::initCSRfromDMatrix>); TheOperators->Add("<-", new PETSc::initRectangularCSRfromDMatrix>); } Global.Add("set", "(", new PETSc::setOptions()); addProd, PetscScalar, 'N'>(); addProd, PetscScalar, 'T'>(); addInv, PetscScalar>(); TheOperators->Add("<-", new OneOperator1_(PETSc::initEmptyCSR)); TheOperators->Add("<-", new PETSc::initCSR>); Global.Add("exchange", "(", new exchangeIn); Global.Add("exchange", "(", new exchangeInOut); Global.Add("changeNumbering", "(", new PETSc::changeNumbering); Global.Add("MatMult", "(", new OneOperator3_*, KN*>(PETSc::MatMult<'N'>)); Global.Add("MatMultTranspose", "(", new OneOperator3_*, KN*>(PETSc::MatMult<'T'>)); Global.Add("KSPSolve", "(", new OneOperator3_*, KN*>(PETSc::KSPSolve)); Global.Add("augmentation", "(", new PETSc::augmentation); Global.Add("globalNumbering", "(", new OneOperator2_*>(PETSc::globalNumbering)); Global.Add("globalNumbering", "(", new OneOperator2_*>(PETSc::globalNumbering)); Global.Add("changeOperator", "(", new PETSc::changeOperator); Global.Add("IterativeMethod", "(", new PETSc::IterativeMethod); Global.Add("originalNumbering", "(", new OneOperator3_*, KN*>(PETSc::originalNumbering)); Global.Add("set", "(", new PETSc::setOptions()); addInv, PetscScalar>(); Init_Common(); Global.Add("check", "(", new OneOperator1(CheckPetscMatrix)); } #ifndef PETScandSLEPc LOADFUNC(Init_PETSc) #endif freefem++-3.61-1/examples++-hpddm/elasticity-2d.edp000644 000767 000024 00000012614 13256636774 022034 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D macro vectorialfe()P2// EOM include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B]// EOM // vector field definition macro init(i)[i, i]// EOM // vector field initialization real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B))// EOM func Pk = [vectorialfe, vectorialfe]; // finite element space string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - elasticity-2d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { int[int] l = [2, 1, 2, 2]; meshN ThGlobal = square(2 * getARGV("-global", 10), getARGV("-global", 10), [2 * x, y], label = l); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded, 2) } real f = -90000.0; real strain = 100.0; real Young = 1.0e8; real poisson = 0.45; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(def(u), def(v)) = intN(ThAugmented)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(ThAugmented)(f * vB) + on(1, u = 0.0, uB = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs); } ThBorder = square(1, 1); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = 2 * kZero * mu * (2 * mu + lambda) / (lambda + 3 * mu); varf vOptimized(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN1(Th, fakeInterface)(transmission * (def(u)' * def(v))) + on(1, u = 0.0, uB = 0.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + on(1, u = 0.0, uB = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) real alpha = 1.0e+1; meshN ThMoved = movemesh(Th, [x + alpha * u, y + alpha * uB]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/stokes-2d.edp000644 000767 000024 00000011634 13256636774 021173 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient real Sqrt = sqrt(2.); macro epsilon(u)[dx(u), dy(u#B), (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B))// EOM func Pk = [P2, P2, P1]; // finite element space string deflation = getARGV("-deflation", "geneo-2"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - stokes-2d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = square(getARGV("-global", 30), getARGV("-global", 30), [x, y]); // global mesh ThGlobal = trunc(ThGlobal, (x < 0.5) || (y < 0.5), label = 5); Th = movemesh(ThGlobal, [-x, y]); ThGlobal = ThGlobal + Th; build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb([u, uB, p], [v, vB, q]) = intN(ThAugmented)(grad(u)' * grad(v) + grad(uB)' * grad(vB) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(1, 3, 5, u = 0, uB = 0) + on(2, u = y*(0.5-y), uB = 0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented); real[int] rhsFull = vPb(0, WhAugmented); matrix R = interpolate(Wh, WhAugmented); renumbering(Mat, R, rhsFull, rhs, eps = -1); } ThBorder = square(1, 1); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); set(A, sparams = "-hpddm_local_operators_not_spd -hpddm_mkl_pardiso_iparm_13 1 -hpddm_schwarz_method oras -hpddm_schwarz_coarse_correction deflated -hpddm_geneo_nu 5"); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized([u, uB, p], [v, vB, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) - div(u) * q - div(v) * p + 1e-10 * p * q) + intN1(Th, fakeInterface)(transmission * ([u, uB]' * [v, vB])) + on(1, 3, 5, u = 0, uB = 0) + on(2, u = y*(0.5-y), uB = 0); Opt = vOptimized(Wh, Wh); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen([u, uB, p], [v, vB, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(1, 3, 5, u = 0, uB = 0) + on(2, u = y*(0.5-y), uB = 0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } Wh def(u); // local solution if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], rhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/Makefile.am000644 000767 000024 00000010620 13256636774 020714 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc TESTS= diffusion-2d-PETSc.edp diffusion-2d-PETSc-complex.edp diffusion-3d-PETSc.edp elasticity-2d-PETSc.edp elasticity-3d-PETSc.edp heat-2d-PETSc.edp heat-3d.edp \ diffusion-2d.edp diffusion-3d.edp elasticity-2d.edp elasticity-3d.edp heat-2d.edp helmholtz-2d.edp maxwell-3d.edp \ diffusion-3d-simple.edp elasticity-3d-simple.edp \ stokes-2d-PETSc.edp stokes-3d-PETSc.edp stokes-3d.edp stokes-2d.edp diffusion-2d-substructuring.edp elasticity-2d-substructuring.edp \ laplace-2d-SLEPc.edp laplace-complex-2d-SLEPc.edp diffusion-2d-substructuring-withPartitioning.edp iterative.edp \ laplace-2d-spherical-harmonics-SLEPc.edp schrodinger-1d-harmonic-oscillator-SLEPc.edp schrodinger-2d-harmonic-oscillator-SLEPc.edp \ laplace-2d-torus-SLEPc.edp schrodinger-1d-square-well-SLEPc.edp withPartitioning.edp XFAIL_TESTS=$(TESTS) LOG_DRIVER=$(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT=TEST_FFPP=$(TEST_FFPPMPI) FLAGS_FFPP="-np 4 -nw" SKIP=$(SKIP_TESTS_MPI) LIST_IDP= macro_ddm.idp macro_ddm_substructuring.idp EXTRA_DIST= $(TESTS) $(LIST_IDP) PETSc.cpp PETSc-complex.cpp PETSc-code.hpp common.hpp hpddm.cpp hpddm_substructuring.cpp SLEPc.cpp SLEPc-complex.cpp SLEPc-code.hpp PETSc.hpp # FFCS - list modified to disable some downloaded tools depending on the platform (see # [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be # deactivated). LIST_COMPILE=@TOOL_DYLIB_hpddm@ if FFCS_MPIOK # FFCS - do not set loadpath to be able to run an external version of FF on the examples in this directory with # [[../../mkffref]] all-local:$(LIST_COMPILE) freefem++.pref @echo Warning missing mpi plugin: `for i in $(LIST_COMPILE); do if test ! -s $i ; then j=1; echo "$i," ;fi; done` echo "finish compile load hpddm solver !" else all-local: endif .cpp.$(DYLIB_SUFFIX): ../examples++-load/ff-c++ ../examples++-load/WHERE_LIBRARY-download ../examples++-load/WHERE_LIBRARY-config # FFCS needs an error exit code to make sure that all libraries are correctly compiled # # FFCS on Windows inserts all MPI options (include, lib, ...) in the $MPICXX compiler script, instead of "$CXX $MPI_xxx", # but it needs '-mpi' to do that # ### -../examples++-load/ff-c++ -auto $< ../examples++-load/ff-c++ -auto -mpi $< install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib/mpi $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/etc -for i in $(LIST_COMPILE); do \ if [ -f $$i ] ; then $(INSTALL) -m 555 $$i $(DESTDIR)$(ff_prefix_dir)/lib/mpi; fi; done $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp freefem++.pref:Makefile echo loadpath = \"../examples++-mpi/\" >freefem++.pref echo loadpath += \"../examples++-load/\" >>freefem++.pref echo includepath = \"../examples++-mpi/\" >>freefem++.pref echo includepath += \"../examples++-3d/\" >>freefem++.pref echo includepath += \"../examples++-tutorial/\" >>freefem++.pref echo loadpath += \"./\" >>freefem++.pref # force the build for freefem++.pref FH.. (do not works 2016) #$(TEST) :freefem++.pref # FFCS - cleaning is useful sometimes clean-local:: -rm $(LIST_COMPILE) -rm *.$(OBJEXT) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/examples++-hpddm/elasticity-2d-PETSc.edp000644 000767 000024 00000005604 13256636774 022751 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B]// EOM // vector field definition macro init(i)[i, i]// EOM // vector field initialization real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B))// EOM func Pk = [P2, P2]; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - elasticity-2d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { int[int] l = [2, 1, 2, 2]; meshN ThBorder, ThGlobal = square(2 * getARGV("-global", 10), getARGV("-global", 10), [2 * x, y], label = l); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } real f = -90000.0; real strain = 100.0; real Young = 1.0e8; real poisson = 0.45; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); varf vPb(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(Th)(f * vB) + on(1, u = 0.0, uB = 0.0); matrix Mat = vPb(Wh, Wh); real[int] rhs = vPb(0, Wh); dmatrix A(Mat, arrayIntersection, restrictionIntersection, D, bs = 2); set(A, sparams = "-ksp_view"); Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; for(int i = 0; i < D.n; ++i) if(abs(D[i] - 1.0) > 1e-6) err[i] = 0.0; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) real alpha = 1.0e+1; meshN ThMoved = movemesh(Th, [x + alpha * u, y + alpha * uB]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) Wh def(Rb)[3]; [Rb[0], RbB[0]] = [1, 0]; [Rb[1], RbB[1]] = [0, 1]; [Rb[2], RbB[2]] = [y, -x]; set(A, sparams = "-pc_type gamg -ksp_type gmres -ksp_max_it 200", nearnullspace = Rb); [u, uB] = init(0.0); u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) alpha = 1.0e+1; ThMoved = movemesh(Th, [x + alpha * u, y + alpha * uB]); u[] = mpirank; plotMPI(ThMoved, u[], "Global moved solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/PETSc-complex.cpp000644 000767 000024 00000000357 13256636774 021755 0ustar00hechtstaff000000 000000 //ff-c++-LIBRARY-dep: cxx11 hpddm petsccomplex [slepccomplex] [mumps parmetis ptscotch scotch scalapack|umfpack] [mkl|blas] mpi //ff-c++-cpp-dep: #define PETScandSLEPc 1 #include "PETSc-code.hpp" #include "SLEPc-code.hpp" LOADFUNC(Init) freefem++-3.61-1/examples++-hpddm/heat-3d.edp000644 000767 000024 00000012371 13256636774 020604 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u), dz(u)]// EOM // three-dimensional gradient func Pk = P2; // finite element space string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor real dt = getARGV("-dt", 0.01); // time step int iMax = getARGV("-iMax", 10); // number of iterations mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - heat-3d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } int[int] LL = [1,2, 1,1, 1,1]; meshN ThBorder, Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThGlobal = cube(getARGV("-global", 10), getARGV("-global", 10), getARGV("-global", 10), [x, y, z], label = LL); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator matrix M; // local mass matrix { // local weak form meshN ThAugmented = Th + ThBorder; varf vPb(u, v) = intN(ThAugmented)(u * v + dt * (grad(u)' * grad(v))) + intN(ThAugmented)(dt * v) + on(1, u = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); varf vPbM(u, v) = intN(ThAugmented)(u * v); M = vPbM(WhAugmented, WhAugmented); renumbering(M, R, rhsFull, rhs); renumbering(Mat, R, rhsFull, rhs); } ThBorder = cube(1, 1, 1, [x, y, z]); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized(u, v) = intN(Th)(u * v + dt * (grad(u)' * grad(v))) + intN1(Th, fakeInterface)(transmission * (u * v)) + on(1, u = 0.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(u, v) = intN(Th)(u * v + dt * (grad(u)' * grad(v))) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } /*# SolvePlot #*/ set(A, sparams = "-hpddm_reuse_preconditioner=1"); Wh def(u) = init(0.0); // local solution for(int i = 0; i < iMax; ++i) { real[int] newRhs(rhs.n); dmv(A, M, u[], newRhs); // newRhs = M * u[] newRhs += rhs; if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], newRhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * newRhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 0) } /*# SolvePlotEnd #*/ freefem++-3.61-1/examples++-hpddm/PETSc.hpp000644 000767 000024 00000022043 13321622623 020266 0ustar00hechtstaff000000 000000 #ifndef PETSC_HPP_ #define PETSC_HPP_ #if PETSC_VERSION_LT(3,7,0) #define FFPetscOptionsInsert(a,b,c) PetscOptionsInsert(a,b,c) #else #define FFPetscOptionsInsert(a,b,c) PetscOptionsInsert(NULL,a,b,c) #endif #if PETSC_VERSION_LT(3,6,0) #define MatCreateVecs MatGetVecs #endif #define HPDDM_SCHWARZ 0 #define HPDDM_FETI 0 #define HPDDM_BDD 0 #define HPDDM_PETSC 1 #include "common.hpp" namespace PETSc { template class DistributedCSR { public: HpddmType* _A; Mat _petsc; std::vector _S; VecScatter _scatter; KSP _ksp; HPDDM::Subdomain** _exchange; unsigned int* _num; unsigned int _first; unsigned int _last; unsigned int* _cnum; unsigned int _cfirst; unsigned int _clast; DistributedCSR() : _A(), _petsc(), _ksp(), _exchange(), _num(), _first(), _last(), _cnum(), _cfirst(), _clast() { _S.clear(); } ~DistributedCSR() { MatDestroy(&_petsc); for(int i = 0; i < _S.size(); ++i) MatDestroy(&_S[i]); KSPDestroy(&_ksp); if(_exchange) { _exchange[0]->clearBuffer(); delete _exchange[0]; if(_exchange[1]) { _exchange[1]->clearBuffer(); delete _exchange[1]; } delete [] _exchange; } if(_A) { if(!std::is_same>::value) VecScatterDestroy(&_scatter); else _A->clearBuffer(); delete _A; _A = nullptr; } delete [] _num; _num = nullptr; } }; template>::value>::type* = nullptr> void globalMapping(HpddmType* const& A, unsigned int*& num, unsigned int& start, unsigned int& end, unsigned int& global, unsigned int* const list) { num = new unsigned int[A->getMatrix()->_n]; A->template globalMapping<'C'>(num, num + A->getMatrix()->_n, start, end, global, A->getScaling(), list); } template>::value>::type* = nullptr> void globalMapping(HpddmType* const& A, unsigned int* const& num, unsigned int& start, unsigned int& end, unsigned int& global, unsigned int* const list) { } template void setFieldSplitPC(Type* ptA, KSP ksp, KN* const& fields, KN* const& names, KN>* const& mT, KN* const& pL) { if(fields) { PC pc; KSPGetPC(ksp, &pc); PCSetType(pc, PCFIELDSPLIT); unsigned short* local = new unsigned short[fields->n + ptA->_last - ptA->_first](); for(int i = 0; i < fields->n; ++i) local[i] = std::round(fields->operator[](i)); unsigned short nb = fields->n > 0 ? *std::max_element(local, local + fields->n) : 0; MPI_Allreduce(MPI_IN_PLACE, &nb, 1, MPI_UNSIGNED_SHORT, MPI_MAX, PETSC_COMM_WORLD); local += fields->n; if(fields->n) HPDDM::Subdomain::template distributedVec<0>(ptA->_num, ptA->_first, ptA->_last, local - fields->n, local, fields->n); unsigned long* counts = new unsigned long[nb](); for(unsigned int i = 0; i < ptA->_last - ptA->_first; ++i) if(local[i]) ++counts[local[i] - 1]; PetscInt* idx = new PetscInt[*std::max_element(counts, counts + nb)]; for(unsigned short j = 0; j < nb; ++j) { IS is; unsigned short* pt = local; for(unsigned int i = 0; i < counts[j]; ++pt) { if(*pt == j + 1) idx[i++] = ptA->_first + std::distance(local, pt); } ISCreateGeneral(PETSC_COMM_WORLD, counts[j], idx, PETSC_COPY_VALUES, &is); PCFieldSplitSetIS(pc, names && j < names->size() ? (*(names->operator[](j))).c_str() : NULL, is); ISDestroy(&is); } if(mT && mT->n > 0 && pL) { int *is, *js; PetscScalar *s; unsigned int* re = new unsigned int[pL->n]; unsigned int nbSchur = 1; for(int i = 0; i < pL->n; ++i) re[i] = ((*pL)[i]) ? nbSchur++ : 0; nbSchur--; unsigned int* num; unsigned int start, end, global; ptA->_A->clearBuffer(); globalMapping(ptA->_A, num, start, end, global, re); delete [] re; re = new unsigned int[2 * nbSchur]; unsigned int* numSchur = re + nbSchur; for(int i = 0, j = 0; i < pL->n; ++i) { if((*pL)[i]) { *numSchur++ = num[i]; re[static_cast((*pL)[i]) - 1] = j++; } } numSchur -= nbSchur; delete [] num; ptA->_S.resize(mT->n); for(int k = 0; k < mT->n; ++k) { MatriceMorse* mS = static_cast*>(&(*(mT->operator[](k)).A)); std::vector>> tmp(mS->n); for(int i = 0; i < mS->n; ++i) { unsigned int row = re[i]; tmp[row].reserve(mS->lg[i + 1] - mS->lg[i]); for(int j = mS->lg[i]; j < mS->lg[i + 1]; ++j) tmp[row].emplace_back(re[mS->cl[j]], mS->a[j]); std::sort(tmp[row].begin(), tmp[row].end(), [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); } is = new int[mS->n + 1]; js = new int[mS->nbcoef]; s = new PetscScalar[mS->nbcoef]; is[0] = 0; for(int i = 0; i < mS->n; ++i) { for(int j = 0; j < tmp[i].size(); ++j) { *js++ = tmp[i][j].first; *s++ = tmp[i][j].second; } is[i + 1] = is[i] + tmp[i].size(); } js -= mS->nbcoef; s -= mS->nbcoef; int* ia, *ja; PetscScalar* c; ia = ja = nullptr; c = nullptr; HPDDM::MatrixCSR* dN = new HPDDM::MatrixCSR(mS->n, mS->m, mS->nbcoef, s, is, js, mS->symetrique, true); bool free = ptA->_A->HPDDM::template Subdomain::distributedCSR(numSchur, start, end, ia, ja, c, dN); MatCreate(PETSC_COMM_WORLD, &ptA->_S[k]); MatSetSizes(ptA->_S[k], end - start, end - start, global, global); MatSetType(ptA->_S[k], MATMPIAIJ); MatMPIAIJSetPreallocationCSR(ptA->_S[k], ia, ja, c); MatSetOption(ptA->_S[k], MAT_NO_OFF_PROC_ENTRIES, PETSC_TRUE); if(free) { delete [] ia; delete [] ja; delete [] c; } delete dN; } delete [] re; ptA->_A->setBuffer(); } delete [] idx; delete [] counts; local -= fields->n; delete [] local; } } template void setCompositePC(Type* A, PC pc) { PetscInt nsplits; KSP* subksp; PCFieldSplitGetSubKSP(pc, &nsplits, &subksp); if(A->_S.size() == 1) KSPSetOperators(subksp[nsplits - 1], A->_S[0], A->_S[0]); else { PC pcS; KSPGetPC(subksp[nsplits - 1], &pcS); for(int i = 0; i < A->_S.size(); ++i) PCCompositeAddPC(pcS, PCNONE); PCSetUp(pcS); for(int i = 0; i < A->_S.size(); ++i) { PC subpc; PCCompositeGetPC(pcS, i, &subpc); PCSetOperators(subpc, A->_S[i], A->_S[i]); PCSetFromOptions(subpc); } } PetscFree(subksp); } bool insertOptions(std::string* const& options) { bool fieldsplit = false; if(options) { std::vector elems; std::stringstream ss(*options); std::string item; while (std::getline(ss, item, ' ')) elems.push_back(item); int argc = elems.size() + 1; char** data = new char*[argc]; data[0] = new char[options->size() + argc](); data[1] = data[0] + 1; for(int i = 0; i < argc - 1; ++i) { if(i > 0) data[i + 1] = data[i] + elems[i - 1].size() + 1; strcpy(data[i + 1], elems[i].c_str()); if(!fieldsplit) fieldsplit = (elems[i].compare("fieldsplit") == 0); } FFPetscOptionsInsert(&argc, &data, NULL); delete [] *data; delete [] data; } return fieldsplit; } } #endif freefem++-3.61-1/examples++-hpddm/stokes-3d-PETSc.edp000644 000767 000024 00000004472 13256636774 022112 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)[i, i#B, i#C, i#D]// EOM// vector field definition macro init(i)[i, i, i, i]// EOM // vector field initialization macro grad(u)[dx(u), dy(u), dz(u)]//// two-dimensional gradient real Sqrt = sqrt(2.); macro div(u)(dx(u) + dy(u#B) + dz(u#C))// EOM func Pk = [P2, P2, P2, P1]; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - stokes-3d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = buildlayers(square(1, 1), 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { mesh ThGlobal2d = square(getARGV("-global", 12), getARGV("-global", 12), [x, y]); // global mesh ThGlobal2d = trunc(ThGlobal2d, (x <= 0.5) || (y <= 0.5), label = 5); ThGlobal2d = trunc(ThGlobal2d, (y >= 0.25) || (x >= 0.25), label = 5); mesh Th2d = movemesh(ThGlobal2d, [-x, y]); ThGlobal2d = ThGlobal2d + Th2d; meshN ThBorder, ThGlobal = buildlayers(ThGlobal2d, getARGV("-global", 12) / 2, zbound = [0, 0.4]); build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } varf vPb([u, uB, uC, p], [v, vB, vC, q]) = intN(Th)(grad(u)' * grad(v) + grad(uB)' * grad(vB) + grad(uC)' * grad(vC) - div(u) * q - div(v) * p + 1e-10 * p * q) + on(0, 1, 3, 5, u = 0, uB = 0, uC = 0) + on(2, u = 1000*y*(0.5-y)*z*(0.4-z), uB = 0, uC = 0); matrix A = vPb(Wh, Wh, tgv = -1); real[int] rhs = vPb(0, Wh, tgv = -1); dmatrix Mat(A, arrayIntersection, restrictionIntersection, D, bs = 1); set(Mat, sparams = "-pc_type lu -pc_factor_mat_solver_package mumps"); Wh def(b); b[] = Mat^-1 * rhs; plotMPI(Th, b[], "Global solution PETSc", Pk, def, real, 3, 1); freefem++-3.61-1/examples++-hpddm/heat-2d.edp000644 000767 000024 00000012331 13256636774 020577 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient func Pk = P2; // finite element space string deflation = getARGV("-deflation", "geneo"); // coarse space construction int overlap = getARGV("-overlap", 1); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor real dt = getARGV("-dt", 0.1); // time step real mu = 0.01; int iMax = getARGV("-iMax", 10); // number of iterations mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - heat-2d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } meshN ThBorder, Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { int[int] l = [1, 1, 1, 1]; meshN ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40), label = l); // global mesh build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, comm, excluded) } real[int] rhs; // local right-hand side matrix Mat; // local operator matrix M; // local mass matrix { // local weak form meshN ThAugmented = Th + ThBorder; fespace Ph(ThAugmented, P0); Ph f = x < 0.25 ? 1.0e+3 : 1.0e-3; varf vPb(u, v) = intN(ThAugmented)(u * v + dt * (grad(u)' * grad(v))) + intN(ThAugmented)(dt * f * v) + on(1, u = 0.0); fespace WhAugmented(ThAugmented, Pk); Mat = vPb(WhAugmented, WhAugmented, tgv = -1); real[int] rhsFull = vPb(0, WhAugmented, tgv = -1); matrix R = interpolate(Wh, WhAugmented); varf vPbM(u, v) = intN(ThAugmented)(u * v); M = vPbM(WhAugmented, WhAugmented); renumbering(M, R, rhsFull, rhs); renumbering(Mat, R, rhsFull, rhs); } ThBorder = square(1, 1); dschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D); matrix Opt; // local operator with optimized boundary conditions dpair ret; { int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods fespace Ph(Th, P0); real kZero = getARGV("-kZero", 10.0); Ph transmission = kZero; varf vOptimized(u, v) = intN(Th)(u * v + dt * (grad(u)' * grad(v))) + intN1(Th, fakeInterface)(transmission * (u * v)) + on(1, u = 0.0); Opt = vOptimized(Wh, Wh, tgv = -1); } if(mpisize > 1 && isSetOption("schwarz_coarse_correction")) { // two-level Schwarz methods if(excluded) attachCoarseOperator(mpiCommWorld, A/*, A = noPen, B = overlapRestriction, threshold = 2. * h[].max / diam*/); else { varf vPbNoPen(u, v) = intN(Th)(u * v + dt * (grad(u)' * grad(v))) + on(1, u = 0.0); matrix noPen = vPbNoPen(Wh, Wh, solver = CG); if(deflation == "geneo") // standard GenEO, no need for RHS -> deduced from LHS (Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen/*, threshold = 2. * h[].max / diam,*/, ret = ret); else if(deflation == "dtn") { varf vMass(def(u), def(v)) = intN1(Th, fakeInterface)(u * v); matrix massMatrix = vMass(Wh, Wh, solver = CG); attachCoarseOperator(mpiCommWorld, A, A = noPen, B = massMatrix, pattern = Opt/*, threshold = k,*/, ret = ret); } else if(deflation == "geneo-2") // GenEO-2 for optimized Schwarz methods, need for RHS (LHS is still Neumann matrix) attachCoarseOperator(mpiCommWorld, A, A = noPen, B = Opt, pattern = Opt/*, threshold = 2. * h[].max / diam,*/, ret = ret); } } } set(A, sparams = "-hpddm_reuse_preconditioner=1"); Wh def(u) = init(0.0); // local solution for(int i = 0; i < iMax; ++i) { real[int] newRhs(rhs.n); dmv(A, M, u[], newRhs); newRhs += rhs; if(Opt.n > 0) // optimized Schwarz methods DDM(A, u[], newRhs, excluded = excluded, ret = ret, O = Opt); else u[] = A^-1 * newRhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 0) } freefem++-3.61-1/examples++-hpddm/laplace-2d-SLEPc.edp000644 000767 000024 00000015632 13256636774 022172 0ustar00hechtstaff000000 000000 // This codes shows how to calculate the eigenvalue spectrum of // the Laplace operator on a 2d square domain, using SLEPc. // // Usage : // mpirun -np 4 FreeFem++-mpi -wg laplace-2d-SLEPc.edp \ // -split 1 -npts 400 -nev 10 -sigma 0.0 // // Authors: Julien Garaud // Pierre Jolivet /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc" // PETSc plugin load "SLEPc" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM func Pk = P1; // Finite-element space /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 200) ; // Number of points on the perimeter real Lx = getARGV("-lx" , pi) ; // Dimension of the domain real Ly = getARGV("-ly" , pi) ; // Dimension of the domain // int nEV = getARGV("-nev" , 10) ; // Number of eigenvalues real sigma = getARGV("-sigma", 0.0) ; // Shift /***************************************/ /* Verbosity and passed options */ /***************************************/ if(verbosity > 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- laplace-2d-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << " Domain size [Lx,Ly] = ["< A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D, clean = true); dmatrix DistB(DistA, B, clean = true); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors cout << " Before Check " < Temp; for(int i=0;i class initDDM_Op : public E_F0mps { public: Expression A; Expression Mat; Expression o; Expression R; static const int n_name_param = 4; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initDDM_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : A(param1), Mat(param2), o(param3), R(param4) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initDDM_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"scaling", &typeid(KN>*)}, {"deflation", &typeid(FEbaseArrayKn*)}, {"prefix", &typeid(string*)} }; template class initDDM : public OneOperator { public: initDDM() : OneOperator(atype(), atype(), atype*>(), atype*>(), atype>*>()) { } E_F0* code(const basicAC_F0& args) const { return new initDDM_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } }; template AnyType initDDM_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); Matrice_Creuse* pA = GetAny*>((*Mat)(stack)); MatriceMorse* mA = pA->A ? static_cast*>(&(*pA->A)) : nullptr; KN* ptO = GetAny*>((*o)(stack)); KN>* ptR = GetAny>*>((*R)(stack)); if(ptO) ptA->HPDDM::template Subdomain::initialize(mA ? new HPDDM::MatrixCSR(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique) : 0, STL(*ptO), *ptR, nargs[0] ? (MPI_Comm*)GetAny((*nargs[0])(stack)) : 0); FEbaseArrayKn* deflation = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; if(deflation && deflation->N > 0 && !ptA->getVectors()) { K** ev = new K*[deflation->N]; *ev = new K[deflation->N * deflation->get(0)->n]; for(int i = 0; i < deflation->N; ++i) { ev[i] = *ev + i * deflation->get(0)->n; std::copy(&(*deflation->get(i))[0], &(*deflation->get(i))[deflation->get(i)->n], ev[i]); } ptA->setVectors(ev); ptA->Type::super::initialize(deflation->N); } if(nargs[1]) ptA->initialize(*GetAny>*>((*nargs[1])(stack))); else std::cerr << "Something is really wrong here !" << std::endl; if(nargs[3]) ptA->setPrefix(*(GetAny((*nargs[3])(stack)))); return ptA; } template class attachCoarseOperator_Op : public E_F0mps { public: Expression comm; Expression A; static const int n_name_param = 6; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; attachCoarseOperator_Op(const basicAC_F0& args, Expression param1, Expression param2) : comm(param1), A(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type attachCoarseOperator_Op::name_param[] = { {"A", &typeid(Matrice_Creuse*)}, {"B", &typeid(Matrice_Creuse*)}, {"pattern", &typeid(Matrice_Creuse*)}, {"threshold", &typeid(HPDDM::underlying_type)}, {"timing", &typeid(KN*)}, {"ret", &typeid(Pair*)} }; template class attachCoarseOperator : public OneOperator { public: attachCoarseOperator() : OneOperator(atype(), atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new attachCoarseOperator_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType attachCoarseOperator_Op::operator()(Stack stack) const { pcommworld ptComm = GetAny((*comm)(stack)); MPI_Comm comm = *(MPI_Comm*)ptComm; Type* ptA = GetAny((*A)(stack)); MatriceMorse* mA = nargs[0] ? static_cast*>(&(*GetAny*>((*nargs[0])(stack))->A)) : 0; Pair* pair = nargs[5] ? GetAny*>((*nargs[5])(stack)) : 0; HPDDM::Option& opt = *HPDDM::Option::get(); KN* timing = nargs[4] ? GetAny*>((*nargs[4])(stack)) : 0; std::pair* ret = nullptr; if(mA) { long nbSolver = 0; std::vector*> vecAIJ; if(mA) { HPDDM::MatrixCSR dA(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); MatriceMorse* mB = nargs[1] ? static_cast*>(&(*GetAny*>((*nargs[1])(stack))->A)) : nullptr; MatriceMorse* mP = nargs[2] && opt.any_of("schwarz_method", { 1, 2, 4 }) ? static_cast*>(&(*GetAny*>((*nargs[2])(stack))->A)) : nullptr; if(dA._n == dA._m) { if(timing) { // tic timing->resize(timing->n + 1); (*timing)[timing->n - 1] = MPI_Wtime(); } const HPDDM::MatrixCSR* const dP = mP ? new HPDDM::MatrixCSR(mP->n, mP->m, mP->nbcoef, mP->a, mP->lg, mP->cl, mP->symetrique) : nullptr; if(mB) { HPDDM::MatrixCSR dB(mB->n, mB->m, mB->nbcoef, mB->a, mB->lg, mB->cl, mB->symetrique); ptA->template solveGEVP(&dA, &dB, dP); } else ptA->template solveGEVP(&dA, nullptr, dP); mA->nbcoef = dA._nnz; mA->a = dA._a; mA->lg = dA._ia; mA->cl = dA._ja; delete dP; if(timing) { // toc (*timing)[timing->n - 1] = MPI_Wtime() - (*timing)[timing->n - 1]; } } else { vecAIJ.emplace_back(&dA); nbSolver = 101; } } else { ptA->template interaction(vecAIJ); std::sort(vecAIJ.begin(), vecAIJ.end(), [](const HPDDM::MatrixCSR* lhs, const HPDDM::MatrixCSR* rhs) { return lhs->_m > rhs->_m; }); nbSolver = 100; } if(nbSolver != 0) { ptA->callNumfact(); if(!vecAIJ.empty()) { int dof = ptA->getDof(); HPDDM::Eigensolver solver(dof); const HPDDM::MatrixCSR& first = *vecAIJ.front(); unsigned short nu = std::min(opt.template val("geneo_nu", 20), static_cast(first._m)); K** ev = new K*[nu]; *ev = new K[nu * dof]; for(int i = 0; i < nu; ++i) ev[i] = *ev + i * dof; ptA->setVectors(ev); ptA->Type::super::initialize(nu); int info; int lwork = -1; { K wkopt; HPDDM::Lapack::gesdd("S", &dof, &first._m, nullptr, &dof, nullptr, nullptr, &dof, nullptr, &first._m, &wkopt, &lwork, nullptr, nullptr, &info); } K* a; HPDDM::underlying_type* values; if(!std::is_same>::value) { a = new K[first._m * (2 * dof + first._m) + lwork]; values = new HPDDM::underlying_type[nu + first._m + std::max(1, first._m * std::max(5 * first._m + 7, 2 * dof + 2 * first._m + 1))]; } else { a = new K[first._m * (2 * dof + first._m + 1) + lwork + nu]; values = reinterpret_cast*>(a + first._m * (2 * dof + first._m) + lwork); } int* pos = new int[nu + 8 * first._m]; std::fill(pos, pos + nu, 0); std::fill(values, values + nu, 0.0); for(const HPDDM::MatrixCSR* A : vecAIJ) { K* u = a + dof * A->_m; K* vt = u + dof * A->_m; K* work = vt + A->_m * A->_m; HPDDM::underlying_type* s = values + nu; HPDDM::underlying_type* rwork = s + A->_m; std::fill(a, a + A->_m * dof, K(0.0)); for(int i = 0; i < dof; ++i) for(int j = A->_ia[i]; j < A->_ia[i + 1]; ++j) a[i + A->_ja[j] * dof] = A->_a[j]; ptA->Type::super::callSolve(a, A->_m); HPDDM::Lapack::gesdd("S", &dof, &(A->_m), a, &dof, s, u, &dof, vt, &(A->_m), work, &lwork, rwork, pos + nu, &info); for(unsigned int i = 0, j = 0, k = 0; k < nu; ++k) { if(s[i] > values[j]) pos[k] = ++i; else pos[k] = -(++j); } for(unsigned int i = nu - 1; i > 0; ) { if(pos[i] < 0) { unsigned int j = i; while(j > 0 && pos[j - 1] < 0) --j; std::copy_backward(values - pos[j] - 1, values - pos[i], values + i + 1); std::copy_backward(ev[-pos[j] - 1], ev[-pos[i] - 1] + dof, ev[i] + dof); i = std::max(j, 1u) - 1; } else --i; } for(unsigned int i = 0; i < nu; ) { if(pos[i] > 0) { unsigned int j = i; while(j < nu - 1 && pos[j + 1] > 0) ++j; std::copy(s + pos[i] - 1, s + pos[j], values + i); std::copy(u + (pos[i] - 1) * dof, u + pos[j] * dof, ev[i]); i = j + 1; } else ++i; } } delete [] pos; if(!std::is_same>::value) delete [] values; delete [] a; ptA->Type::super::initialize(nu); if(nbSolver == 100) std::for_each(vecAIJ.begin(), vecAIJ.end(), std::default_delete>()); opt["geneo_nu"] = nu; } else ptA->Type::super::initialize(0); } MPI_Barrier(comm); if(timing) { // tic timing->resize(timing->n + 1); (*timing)[timing->n - 1] = MPI_Wtime(); } if(ptA->exclusion(comm)) { if(pair) pair->p = ptA->template buildTwo<1>(comm); else ret = ptA->template buildTwo<1>(comm); } else { if(pair) pair->p = ptA->template buildTwo<0>(comm); else ret = ptA->template buildTwo<0>(comm); } if(timing) { // toc (*timing)[timing->n - 1] = MPI_Wtime() - (*timing)[timing->n - 1]; } } else { MPI_Barrier(comm); if(!ptA->getVectors()) ret = ptA->template buildTwo<2>(comm); else if(ptA->exclusion(comm)) ret = ptA->template buildTwo<1>(comm); else ret = ptA->template buildTwo<0>(comm); } if(ret) delete ret; return 0L; } template class solveDDM_Op : public E_F0mps { public: Expression A; Expression x; Expression rhs; static const int n_name_param = 9; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; solveDDM_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), x(param2), rhs(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type solveDDM_Op::name_param[] = { {"eps", &typeid(HPDDM::underlying_type)}, {"dim", &typeid(long)}, {"iter", &typeid(long)}, {"timing", &typeid(KN*)}, {"excluded", &typeid(bool)}, {"ret", &typeid(Pair*)}, {"O", &typeid(Matrice_Creuse*)}, {"solver", &typeid(long)}, {"communicator", &typeid(pcommworld)} }; template class solveDDM : public OneOperator { public: solveDDM() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new solveDDM_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType solveDDM_Op::operator()(Stack stack) const { KN* ptX = GetAny*>((*x)(stack)); KN* ptRHS = GetAny*>((*rhs)(stack)); Type* ptA = GetAny((*A)(stack)); if(ptX->n != ptRHS->n || ptRHS->n < ptA->getDof()) return 0L; HPDDM::Option& opt = *HPDDM::Option::get(); const std::string& prefix = ptA->prefix(); HPDDM::underlying_type eps = nargs[0] ? GetAny>((*nargs[0])(stack)) : -1.0; if(nargs[0]) std::cerr << "Please do not use the legacy option \"-eps\", set instead \"-hpddm_tol\", cf. \"-hpddm_help\"" << std::endl; if(std::abs(eps + 1.0) > 1.0e-6) opt[prefix + "tol"] = eps; int dim = nargs[1] ? GetAny((*nargs[1])(stack)) : -1; if(nargs[1]) std::cerr << "Please do not use the legacy option \"-dim\", set instead \"-hpddm_gmres_restart\", cf. \"-hpddm_help\"" << std::endl; if(dim != -1) opt[prefix + "gmres_restart"] = dim; int iter = nargs[2] ? GetAny((*nargs[2])(stack)) : -1; if(nargs[2]) std::cerr << "Please do not use the legacy option \"-iter\", set instead \"-hpddm_max_it\", cf. \"-hpddm_help\"" << std::endl; if(iter != -1) opt[prefix + "max_it"] = iter; if(nargs[7]) std::cerr << "Please do not use the legacy option \"-solver\", set instead \"-hpddm_schwarz_method\" and \"-hpddm_schwarz_coarse_correction\", cf. \"-hpddm_help\"" << std::endl; KN* timing = nargs[3] ? GetAny*>((*nargs[3])(stack)) : 0; Pair* pair = nargs[5] ? GetAny*>((*nargs[5])(stack)) : 0; if(opt.set(prefix + "schwarz_coarse_correction") && pair) if(pair->p) { int flag; MPI_Test(&(pair->p->first), &flag, MPI_STATUS_IGNORE); } MatriceMorse* mA = nargs[6] ? static_cast*>(&(*GetAny*>((*nargs[6])(stack))->A)) : 0; unsigned short mu = ptX->n / ptA->getDof(); MPI_Allreduce(MPI_IN_PLACE, &mu, 1, MPI_UNSIGNED_SHORT, MPI_MAX, ptA->getCommunicator()); const HPDDM::MatrixCSR* A = ptA->getMatrix(); bool alreadyRenumbered = false; if(HPDDM::Wrapper::I == 'F' && SUBDOMAIN::_numbering == 'F' && mu > 1) { alreadyRenumbered = true; std::for_each(A->_ia, A->_ia + A->_n + 1, [](int& i) { ++i; }); std::for_each(A->_ja, A->_ja + A->_nnz, [](int& i) { ++i; }); } if(timing) { // tic timing->resize(timing->n + 1); (*timing)[timing->n - 1] = MPI_Wtime(); } if(mpisize > 1 && (mA && opt.any_of(prefix + "schwarz_method", { 1, 2, 4 }))) { HPDDM::MatrixCSR dA(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); ptA->callNumfact(&dA); } else { if(!alreadyRenumbered) ptA->callNumfact(); #ifndef SUITESPARSESUB else ptA->template callNumfact<'F'>(); #endif } if(timing) { // toc (*timing)[timing->n - 1] = MPI_Wtime() - (*timing)[timing->n - 1]; } if(HPDDM::Wrapper::I == 'F' && SUBDOMAIN::_numbering == 'C' && mu > 1) { std::for_each(A->_ia, A->_ia + A->_n + 1, [](int& i) { ++i; }); std::for_each(A->_ja, A->_ja + A->_nnz, [](int& i) { ++i; }); } bool excluded = nargs[4] && GetAny((*nargs[4])(stack)); if(excluded) opt[prefix + "master_exclude"]; if(pair) if(pair->p) { MPI_Wait(&(pair->p->first), MPI_STATUS_IGNORE); delete [] pair->p->second; pair->destroy(); pair = nullptr; } MPI_Comm comm = nargs[8] ? *(MPI_Comm*)GetAny((*nargs[8])(stack)) : MPI_COMM_WORLD; int rank; MPI_Comm_rank(ptA->getCommunicator(), &rank); if(rank != mpirank || rank != 0) { opt.remove("verbosity"); if(prefix.size() > 0) opt.remove(prefix + "verbosity"); } MPI_Barrier(comm); double timer = MPI_Wtime(); if(timing) { // tic timing->resize(timing->n + 1); (*timing)[timing->n - 1] = timer; } if(!excluded) HPDDM::IterativeMethod::solve(*ptA, (K*)*ptRHS, (K*)*ptX, mu, comm); else HPDDM::IterativeMethod::solve(*ptA, (K*)nullptr, (K*)nullptr, mu, comm); timer = MPI_Wtime() - timer; if(timing) { // toc (*timing)[timing->n - 1] = timer; } if(!excluded && verbosity > 0 && rank == 0) std::cout << std::scientific << " --- system solved (in " << timer << ")" << std::endl; if(HPDDM::Wrapper::I == 'F' && mu > 1) { std::for_each(A->_ja, A->_ja + A->_nnz, [](int& i) { --i; }); std::for_each(A->_ia, A->_ia + A->_n + 1, [](int& i) { --i; }); } return 0L; } template class changeOperator_Op : public E_F0mps { public: Expression A; Expression mat; static const int n_name_param = 0; static basicAC_F0::name_and_type name_param[]; changeOperator_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), mat(param2) { args.SetNameParam(n_name_param, name_param, nullptr); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type changeOperator_Op::name_param[] = { }; template class changeOperator : public OneOperator { public: changeOperator() : OneOperator(atype(), atype(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new changeOperator_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType changeOperator_Op::operator()(Stack stack) const { MatriceMorse* mN = static_cast*>(&(*GetAny*>((*mat)(stack))->A)); HPDDM::MatrixCSR* dN = new HPDDM::MatrixCSR(mN->n, mN->m, mN->nbcoef, mN->a, mN->lg, mN->cl, mN->symetrique); Type* ptA = GetAny((*A)(stack)); ptA->setMatrix(dN); return 0L; } template class set_Op : public E_F0mps { public: Expression A; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; set_Op(const basicAC_F0& args, Expression param) : A(param) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type set_Op::name_param[] = { {"sparams", &typeid(string*)} }; template class set : public OneOperator { public: set() : OneOperator(atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new set_Op(args, t[0]->CastTo(args[0])); } }; template AnyType set_Op::operator()(Stack stack) const { if(nargs[0]) HPDDM::Option::get()->parse(*(GetAny((*nargs[0])(stack)))); return 0L; } template class distributedMV_Op : public E_F0mps { public: Expression A; Expression Mat; Expression in; Expression out; static const int n_name_param = 0; static basicAC_F0::name_and_type name_param[]; distributedMV_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : A(param1), Mat(param2), in(param3), out(param4) { args.SetNameParam(n_name_param, name_param, nullptr); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type distributedMV_Op::name_param[] = { }; template class distributedMV : public OneOperator { public: distributedMV() : OneOperator(atype(), atype(), atype*>(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new distributedMV_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } }; template AnyType distributedMV_Op::operator()(Stack stack) const { Type* pA = GetAny((*A)(stack)); KN* pin = GetAny*>((*in)(stack)); KN* pout = GetAny*>((*out)(stack)); pout->resize(pin->n); unsigned short mu = pin->n / pA->getDof(); MatriceMorse* mA = static_cast*>(&(*GetAny*>((*Mat)(stack))->A)); HPDDM::MatrixCSR dA(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique); bool allocate = pA->setBuffer(); pA->GMV((K*)*pin, (K*)*pout, mu, &dA); pA->clearBuffer(allocate); return 0L; } template class ProdSchwarz { public: const T t; const U u; ProdSchwarz(T v, U w) : t(v), u(w) {} void prod(U x) const { bool allocate = t->setBuffer(); t->GMV(*(this->u), *x); t->clearBuffer(allocate); }; static U mv(U Ax, ProdSchwarz A) { *Ax = K(); A.prod(Ax); return Ax; } static U init(U Ax, ProdSchwarz A) { Ax->init(A.u->n); return mv(Ax, A); } }; template class InvSchwarz { public: const T t; const U u; InvSchwarz(T v, U w) : t(v), u(w) {} void solve(U out) const { if(out->n != u->n || u->n < (*t).getDof()) return; unsigned short mu = u->n / (*t).getDof(); MPI_Allreduce(MPI_IN_PLACE, &mu, 1, MPI_UNSIGNED_SHORT, MPI_MAX, (*t).getCommunicator()); const HPDDM::MatrixCSR* A = (*t).getMatrix(); bool alreadyRenumbered = false; if(HPDDM::Wrapper::I == 'F' && SUBDOMAIN::_numbering == 'F' && mu > 1) { alreadyRenumbered = true; std::for_each(A->_ia, A->_ia + A->_n + 1, [](int& i) { ++i; }); std::for_each(A->_ja, A->_ja + A->_nnz, [](int& i) { ++i; }); } if(!alreadyRenumbered) (*t).callNumfact(); #ifndef SUITESPARSESUB else (*t).template callNumfact<'F'>(); #endif if(HPDDM::Wrapper::I == 'F' && SUBDOMAIN::_numbering == 'C' && mu > 1) { std::for_each(A->_ia, A->_ia + A->_n + 1, [](int& i) { ++i; }); std::for_each(A->_ja, A->_ja + A->_nnz, [](int& i) { ++i; }); } if(mpirank != 0) HPDDM::Option::get()->remove((*t).prefix("verbosity")); HPDDM::IterativeMethod::solve(*t, (K*)*u, (K*)*out, mu, MPI_COMM_WORLD); } static U init(U Ax, InvSchwarz A) { A.solve(Ax); return Ax; } }; template class IterativeMethod : public OneOperator { public: typedef KN Kn; typedef KN_ Kn_; class MatF_O : VirtualMatrice { public: Stack stack; mutable Kn x; C_F0 c_x; Expression mat1, mat; typedef typename VirtualMatrice::plusAx plusAx; MatF_O(int n, Stack stk, const OneOperator* op) : VirtualMatrice(n), stack(stk), x(n), c_x(CPValue(x)), mat1(op ? op->code(basicAC_F0_wa(c_x)) : 0), mat(op ? CastTo(C_F0(mat1, (aType)*op)) : 0) { } ~MatF_O() { if(mat1 != mat) delete mat; delete mat1; Expression zzz = c_x; delete zzz; } void addMatMul(const Kn_& xx, Kn_& Ax) const { ffassert(xx.N() == Ax.N()); x = xx; Ax += GetAny((*mat)(stack)); WhereStackOfPtr2Free(stack)->clean(); } void mv(const R* const in, const int& n, R* const out) const { KN_ xx((R*)in, n); KN_ yy(out, n); yy = R(); yy = plusAx(this, xx); } bool ChecknbLine(int) const { return true; } bool ChecknbColumn(int) const { return true; } }; class Operator : public HPDDM::EmptyOperator { public: MatF_O& mat; MatF_O& prec; Operator(MatF_O& m, MatF_O& p) : mat(m), prec(p), HPDDM::EmptyOperator(m.x.N()) { } void GMV(const R* const in, R* const out, const int& mu = 1) const { mat.mv(in, HPDDM::EmptyOperator::_n, out); } template void apply(const R* const in, R* const out, const unsigned short& mu = 1, R* = nullptr, const unsigned short& = 0) const { if(prec.mat) prec.mv(in, HPDDM::EmptyOperator::_n, out); else std::copy_n(in, HPDDM::EmptyOperator::_n, out); } }; class E_LCG : public E_F0mps { public: static const int n_name_param = 4; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; const OneOperator *A, *C; Expression X, B; E_LCG(const basicAC_F0& args) { args.SetNameParam(n_name_param, name_param, nargs); { const Polymorphic* op = dynamic_cast(args[0].LeftValue()); ffassert(op); A = op->Find("(", ArrayOfaType(atype(), false)); } if(nargs[0]) { const Polymorphic* op = dynamic_cast(nargs[0]); ffassert(op); C = op->Find("(", ArrayOfaType(atype(), false)); } else C = 0; X = to(args[1]); B = to(args[2]); } virtual AnyType operator()(Stack stack) const { int ret = -1; try { Kn& x = *GetAny((*X)(stack)); int n = x.N(); MPI_Comm comm = nargs[3] ? *(MPI_Comm*)GetAny((*nargs[3])(stack)) : MPI_COMM_WORLD; Kn& b = *GetAny((*B)(stack)); MatF_O AA(n, stack, A); MatF_O PP(n, stack, C); Operator Op(AA, PP); if(nargs[1]) Op.setPrefix(*(GetAny((*nargs[1])(stack)))); if(nargs[2]) HPDDM::Option::get()->parse(*(GetAny((*nargs[2])(stack)))); ret = HPDDM::IterativeMethod::solve(Op, (R*)b, (R*)x, 1, comm); } catch(...) { throw; } return SetAny(ret); } operator aType() const { return atype(); } }; E_F0* code(const basicAC_F0& args) const { return new E_LCG(args); } IterativeMethod() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } }; template basicAC_F0::name_and_type IterativeMethod::E_LCG::name_param[] = { {"precon", &typeid(Polymorphic*)}, {"prefix", &typeid(string*)}, {"sparams", &typeid(string*)}, {"comm", &typeid(pcommworld)} }; template class Type, class K, char S> void add() { Dcl_Type*>(Initialize>, Delete>); TheOperators->Add("<-", new initDDM, K>); Global.Add("attachCoarseOperator", "(", new attachCoarseOperator, K>); Global.Add("DDM", "(", new solveDDM, K>); Global.Add("changeOperator", "(", new changeOperator, K>); Global.Add("set", "(", new set, K>); addProd, ProdSchwarz, KN, K>(); addInv, InvSchwarz, KN, K>(); Global.Add("dmv", "(", new distributedMV, K>); Global.Add("destroyRecycling", "(", new OneOperator1_*>(destroyRecycling, K>)); Global.Add("statistics", "(", new OneOperator1_*>(statistics>)); Global.Add("exchange", "(", new exchangeIn, K>); Global.Add("exchange", "(", new exchangeInOut, K>); Global.Add("IterativeMethod","(",new IterativeMethod()); } } static void Init_Schwarz() { Init_Common(); #if defined(DSUITESPARSE) || defined(DHYPRE) const char ds = 'G'; #else const char ds = 'S'; #endif const char zs = 'G'; Schwarz::add(); zzzfff->Add("dschwarz", atype*>()); #ifndef DHYPRE // Schwarz::add(); // zzzfff->Add("sschwarz", atype*>()); Schwarz::add, zs>(); zzzfff->Add("zschwarz", atype, zs>*>()); // Schwarz::add, zs>(); // zzzfff->Add("cschwarz", atype, zs>*>()); #endif aType t; int r; if(!zzzfff->InMotClef("dpair", t, r)) { // Dcl_Type*>(InitP>, Destroy>); // zzzfff->Add("spair", atype*>()); Dcl_Type*>(InitP>, Destroy>); zzzfff->Add("dpair", atype*>()); // Dcl_Type>*>(InitP>>, Destroy>>); // zzzfff->Add("cpair", atype>*>()); Dcl_Type>*>(InitP>>, Destroy>>); zzzfff->Add("zpair", atype>*>()); } } LOADFUNC(Init_Schwarz) freefem++-3.61-1/examples++-hpddm/diffusion-3d-PETSc.edp000644 000767 000024 00000004335 13256636774 022566 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "PETSc" // PETSc plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u), dz(u)]// EOM // three-dimensional gradient func Pk = P1; // finite element space int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-3d-PETSc.edp - input parameters: refinement factor = " << s << endl; } int[int] LL = [1,2, 1,2, 1,1]; meshN Th = cube(1, 1, 1, [x, y, z]); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { meshN ThBorder, ThGlobal = cube(getARGV("-global", 10), getARGV("-global", 10), getARGV("-global", 10), [x, y, z], label = LL); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } varf vPb(u, v) = intN(Th)(grad(u)' * grad(v)) + intN(Th)(v) + on(1, u = 0.0); matrix Mat = vPb(Wh, Wh); real[int] rhs = vPb(0, Wh); dmatrix A(Mat, arrayIntersection, restrictionIntersection, D); set(A, sparams = "-ksp_view"); Wh def(u); // local solution u[] = A^-1 * rhs; real[int] err(u[].n); err = A * u[]; // global matrix-vector product err -= rhs; for(int i = 0; i < D.n; ++i) if(abs(D[i] - 1.0) > 1e-6) err[i] = 0.0; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) plotMPI(Th, err, "Global residual", Pk, def, real, 3, 1) Wh def(Rb)[1]; Rb[0] = 1; set(A, sparams = "-pc_type gamg -ksp_type gmres -ksp_max_it 200", nearnullspace = Rb); u[] = 0.0; u[] = A^-1 * rhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/laplace-complex-2d-SLEPc.edp000644 000767 000024 00000015425 13256636774 023637 0ustar00hechtstaff000000 000000 // This codes shows how to calculate the eigenvalue spectrum of // the Laplace operator on a 2d square domain, using SLEPc. // // Usage : // mpirun -np 4 FreeFem++-mpi -wg lplace-complex-2d-SLEPc.edp \ // -split 1 -npts 400 -nev 10 // // Authors: Julien Garaud // Pierre Jolivet /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc-complex" // PETSc plugin load "SLEPc-complex" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM func Pk = P1; // Finite-element space /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 200) ; // Number of points on the perimeter real Lx = getARGV("-lx" , pi) ; // Dimension of the domain real Ly = getARGV("-ly" , pi) ; // Dimension of the domain // int nEV = getARGV("-nev" , 10) ; // Number of eigenvalues /***************************************/ /* Verbosity and passed options */ /***************************************/ if(verbosity > 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- laplace-complex-2d-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << " Domain size [Lx,Ly] = ["< A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D, clean = true); dmatrix DistB(DistA, B, clean = true); /***************************************/ /* Problem resolution */ /***************************************/ complex[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_pos_gen_non_hermitian" // The problem is symmetric ; int k = zeigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - heat-2d-PETSc.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; // partition of unity { int[int] l = [1, 1, 1, 1]; meshN ThBorder, ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40), label = l); // global mesh build(Th, ThBorder, ThGlobal, 10, s, 1, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, false) } real[int] rhs(Wh.ndof); // local right-hand side matrix Mat; // local operator matrix M; // local mass matrix { // local weak form fespace Ph(Th, P0); Ph f = x < 0.25 ? 1.0e+3 : 1.0e-3; varf vPb(u, v) = intN(Th)(u * v + dt * (grad(u)' * grad(v))) + intN(Th)(dt * f * v) + on(1, u = 0.0); Mat = vPb(Wh, Wh, tgv = -1); rhs = vPb(0, Wh, tgv = -1); varf vPbM(u, v) = intN(Th)(u * v); M = vPbM(Wh, Wh); } dmatrix A(Mat, arrayIntersection, restrictionIntersection, D); set(A, sparams = "-ksp_view"); Wh def(u) = init(0.0); // local solution for(int i = 0; i < iMax; ++i) { real[int] newRhs(rhs.n); newRhs = M * u[]; newRhs += rhs; u[] = A^-1 * newRhs; plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 0) } freefem++-3.61-1/examples++-hpddm/hpddm_substructuring.cpp000644 000767 000024 00000062313 13312446271 023631 0ustar00hechtstaff000000 000000 //ff-c++-LIBRARY-dep: cxx11 hpddm [umfpack|mumps parmetis ptscotch scotch scalapack] [mkl|blas] mpi pthread mpifc fc //ff-c++-cpp-dep: #define HPDDM_SCHWARZ 0 #define HPDDM_FETI 1 #define HPDDM_BDD 1 #include "common.hpp" namespace Substructuring { class Skeleton_Op : public E_F0mps { public: Expression interface; Expression index; Expression restriction; Expression outInterface; static const int n_name_param = 3; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; Skeleton_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : interface(param1), index(param2), restriction(param3), outInterface(param4) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; basicAC_F0::name_and_type Skeleton_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"interface", &typeid(KN*)}, {"redundancy", &typeid(bool)} }; class Skeleton : public OneOperator { public: Skeleton() : OneOperator(atype(), atype*>(), atype*>(), atype >*>(), atype >*>()) {} E_F0* code(const basicAC_F0& args) const { return new Skeleton_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } }; AnyType Skeleton_Op::operator()(Stack stack) const { KN* in = GetAny*>((*interface)(stack)); KN >* out = GetAny >*>((*outInterface)(stack)); KN* arrayNeighbor = GetAny*>((*index)(stack)); KN >* interpolation = GetAny >*>((*restriction)(stack)); MPI_Comm* comm = nargs[0] ? (MPI_Comm*)GetAny((*nargs[0])(stack)) : 0; unsigned short n = arrayNeighbor->n; MPI_Request* rq = new MPI_Request[2 * n]; std::vector send(n); std::vector recv(n); unsigned short neighborAfter = 0; if(out->n != n) out->resize(n); for(unsigned short i = 0; i < n; ++i) { MatriceMorse* pt = static_cast*>(&(*interpolation->operator[](i).A)); send[i] = new unsigned char[pt->n]; recv[i] = new unsigned char[pt->n]; unsigned int dest = arrayNeighbor->operator[](i); if(dest < mpirank) { unsigned int col = 0; for(unsigned int j = 0; j < pt->n; ++j) { if(pt->lg[j + 1] != pt->lg[j]) { if(std::abs(in->operator[](pt->cl[col++]) - 1.0) < 0.1) send[i][j] = '1'; else send[i][j] = '0'; } else send[i][j] = '0'; } MPI_Isend(send[i], pt->n, MPI_UNSIGNED_CHAR, dest, 0, *comm, rq + i); ++neighborAfter; } else MPI_Irecv(recv[i], pt->n, MPI_UNSIGNED_CHAR, dest, 0, *comm, rq + i); } for(unsigned short i = 0; i < neighborAfter; ++i) { MatriceMorse* pt = static_cast*>(&(*interpolation->operator[](i).A)); // cout << mpirank << " receives from " << arrayNeighbor->operator[](i) << ", " << pt->n << "." << endl; MPI_Irecv(recv[i], pt->n, MPI_UNSIGNED_CHAR, arrayNeighbor->operator[](i), 0, *comm, rq + n + i); } for(unsigned short i = neighborAfter; i < n; ++i) { int index; MPI_Waitany(n - neighborAfter, rq + neighborAfter, &index, MPI_STATUS_IGNORE); unsigned short dest = neighborAfter + index; MatriceMorse* pt = static_cast*>(&(*interpolation->operator[](dest).A)); KN& resOut = out->operator[](dest); resOut.resize(pt->nbcoef); unsigned int nnz = 0; unsigned int col = 0; for(unsigned int j = 0; j < pt->n; ++j) { if(pt->lg[j + 1] != pt->lg[j]) { if(std::abs(in->operator[](pt->cl[col]) - 1.0) < 0.1 && recv[dest][j] == '1') { send[dest][j] = '1'; resOut[(int)nnz++] = pt->cl[col++]; } else { ++col; send[dest][j] = '0'; } } else send[dest][j] = '0'; } // cout << mpirank << " sends to " << arrayNeighbor->operator[](dest) << ", " << pt->n << "." << endl; MPI_Isend(send[dest], pt->n, MPI_UNSIGNED_CHAR, arrayNeighbor->operator[](dest), 0, *comm, rq + n + dest); resOut.resize(nnz); } for(unsigned short i = 0; i < neighborAfter; ++i) { int index; MPI_Waitany(neighborAfter, rq + n, &index, MPI_STATUS_IGNORE); KN& resOut = out->operator[](index); MatriceMorse* pt = static_cast*>(&(*interpolation->operator[](index).A)); resOut.resize(pt->nbcoef); unsigned int nnz = 0; unsigned int col = 0; for(unsigned int j = 0; j < pt->n; ++j) { if(recv[index][j] == '1') { if(pt->lg[j + 1] != pt->lg[j]) resOut[(int)nnz++] = pt->cl[col++]; } else if(pt->lg[j + 1] != pt->lg[j]) ++col; } resOut.resize(nnz); } MPI_Waitall(neighborAfter, rq, MPI_STATUSES_IGNORE); MPI_Waitall(n - neighborAfter, rq + n + neighborAfter, MPI_STATUSES_IGNORE); for(unsigned short i = 0; i < n; ++i) { delete [] recv[i]; delete [] send[i]; // cout << mpirank << " <=> " << arrayNeighbor->operator[](i) << " : " << out->operator[](i).n << endl; } delete [] rq; KN* interfaceNb = nargs[1] ? GetAny* >((*nargs[1])(stack)) : (KN*) 0; if(interfaceNb) { std::vector vec; vec.reserve(in->n); for(int i = 0; i < in->n; ++i) { if(in->operator[](i) != 0.0) vec.emplace_back(i); } std::sort(vec.begin(), vec.end()); if(interfaceNb->n != vec.size()) interfaceNb->resize(vec.size()); for( signed int i = 0; i < vec.size(); ++i) interfaceNb->operator[](i) = vec[i]; for(unsigned short i = 0; i < n; ++i) { KN& res = out->operator[](i); for( signed int j = 0; j < res.n; ++j) { std::vector::const_iterator idx = std::lower_bound(vec.cbegin(), vec.cend(), (unsigned int)res[j]); if(idx == vec.cend() || res[j] < *idx) { std::cout << "Problem !" << std::endl; res[j] = -1; } else res[j] = std::distance(vec.cbegin(), idx); } } bool redundancy = nargs[2] ? GetAny((*nargs[2])(stack)) : 1; if(!redundancy) { std::vector >* array = new std::vector >[interfaceNb->n]; for(unsigned short i = 0; i < n; ++i) { KN& res = out->operator[](i); for( signed int j = 0; j < res.n; ++j) array[res[j]].push_back(std::make_pair(i, res[j])); } for(unsigned int i = 0; i < interfaceNb->n; ++i) { if(array[i].size() > 1) { if(mpirank > arrayNeighbor->operator[](array[i].back().first)) array[i].erase(array[i].begin()); else if(mpirank < arrayNeighbor->operator[](array[i].front().first)) array[i].pop_back(); } else if (array[i].size() < 1) std::cout << "Problem !" << std::endl; } std::vector* copy = new std::vector[n]; for(unsigned short i = 0; i < n; ++i) copy[i].reserve(out->operator[](i).n); for(unsigned int i = 0; i < interfaceNb->n; ++i) { for(std::vector >::const_iterator it = array[i].cbegin(); it != array[i].cend(); ++it) { copy[it->first].push_back(it->second); } } for(unsigned short i = 0; i < n; ++i) { unsigned int sizeVec = copy[i].size(); if(sizeVec != out->operator[](i).n) { out->operator[](i).resize(sizeVec); long* pt = (static_cast >(out->operator[](i))); std::reverse_copy(copy[i].begin(), copy[i].end(), pt); } } delete [] copy; delete [] array; } } return 0L; } template class initDDM_Op : public E_F0mps { public: Expression A; Expression Mat; Expression o; Expression R; static const int n_name_param = 2; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; initDDM_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3, Expression param4) : A(param1), Mat(param2), o(param3), R(param4) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type initDDM_Op::name_param[] = { {"communicator", &typeid(pcommworld)}, {"deflation", &typeid(FEbaseArrayKn*)}, }; template class initDDM : public OneOperator { public: initDDM() : OneOperator(atype(), atype(), atype*>(), atype*>(), atype>*>()) { } E_F0* code(const basicAC_F0& args) const { return new initDDM_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2]), t[3]->CastTo(args[3])); } }; template AnyType initDDM_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); Matrice_Creuse* pA = GetAny*>((*Mat)(stack)); MatriceMorse* mA = pA->A ? static_cast*>(&(*pA->A)) : nullptr; KN* ptO = GetAny*>((*o)(stack)); KN>* ptR = GetAny>*>((*R)(stack)); if(ptO) ptA->HPDDM::template Subdomain::initialize(mA ? new HPDDM::MatrixCSR(mA->n, mA->m, mA->nbcoef, mA->a, mA->lg, mA->cl, mA->symetrique) : 0, STL(*ptO), *ptR, nargs[0] ? (MPI_Comm*)GetAny((*nargs[0])(stack)) : 0); FEbaseArrayKn* deflation = nargs[1] ? GetAny*>((*nargs[1])(stack)) : 0; if(deflation && deflation->N > 0 && !ptA->getVectors()) { K** ev = new K*[deflation->N]; *ev = new K[deflation->N * deflation->get(0)->n]; for(int i = 0; i < deflation->N; ++i) { ev[i] = *ev + i * deflation->get(0)->n; std::copy(&(*deflation->get(i))[0], &(*deflation->get(i))[deflation->get(i)->n], ev[i]); } ptA->setVectors(ev); ptA->Type::super::super::initialize(deflation->N); } return ptA; } template class attachCoarseOperator_Op : public E_F0mps { public: Expression comm; Expression A; static const int n_name_param = 4; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; attachCoarseOperator_Op(const basicAC_F0& args, Expression param1, Expression param2) : comm(param1), A(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type attachCoarseOperator_Op::name_param[] = { {"R", &typeid(FEbaseArrayKn*)}, {"threshold", &typeid(HPDDM::underlying_type)}, {"timing", &typeid(KN*)}, {"ret", &typeid(Pair*)} }; template class attachCoarseOperator : public OneOperator { public: attachCoarseOperator() : OneOperator(atype(), atype(), atype()) { } E_F0* code(const basicAC_F0& args) const { return new attachCoarseOperator_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType attachCoarseOperator_Op::operator()(Stack stack) const { pcommworld ptComm = GetAny((*comm)(stack)); MPI_Comm comm = *(MPI_Comm*)ptComm; Type* ptA = GetAny((*A)(stack)); FEbaseArrayKn* R = nargs[0] ? GetAny*>((*nargs[0])(stack)) : 0; Pair* pair = nargs[3] ? GetAny*>((*nargs[3])(stack)) : 0; unsigned short nu = R ? static_cast(R->N) : 0; HPDDM::Option& opt = *HPDDM::Option::get(); HPDDM::underlying_type threshold = opt.val("geneo_threshold", 0.0); KN* timing = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; std::pair* ret = nullptr; bool adaptive = opt.set("geneo_nu") || threshold > 0.0; if(!adaptive) ptA->setDeficiency(nu); double t = MPI_Wtime(); if(R) { if(adaptive) ptA->computeSchurComplement(); ptA->callNumfactPreconditioner(); if(timing) (*timing)[3] = MPI_Wtime() - t; if(adaptive) { if(opt.set("geneo_nu")) nu = opt["geneo_nu"]; #if defined(MUMPSSUB) || defined(PASTIXSUB) || defined(MKL_PARDISOSUB) t = MPI_Wtime(); ptA->solveGEVP(); if(timing) (*timing)[5] = MPI_Wtime() - t; #else cout << "Please change your solver" << endl; #endif } if(!R && !ptA->getVectors()) cout << "Problem !" << endl; R->resize(0); MPI_Barrier(MPI_COMM_WORLD); if(timing) t = MPI_Wtime(); if(ptA->exclusion(comm)) { if(pair) pair->p = ptA->template buildTwo<1>(comm); else ret = ptA->template buildTwo<1>(comm); } else { if(pair) pair->p = ptA->template buildTwo<0>(comm); else ret = ptA->template buildTwo<0>(comm); } if(timing) (*timing)[4] = MPI_Wtime() - t; if(pair) if(pair->p) { int flag; MPI_Test(&(pair->p->first), &flag, MPI_STATUS_IGNORE); } t = MPI_Wtime(); ptA->callNumfact(); } else { MPI_Barrier(MPI_COMM_WORLD); ret = ptA->template buildTwo<2>(comm); } if(timing) (*timing)[2] = MPI_Wtime() - t; if(ret) delete ret; if(pair) if(pair->p) { if(timing) t = MPI_Wtime(); MPI_Wait(&(pair->p->first), MPI_STATUS_IGNORE); if(timing) (*timing)[timing->n - 1] = MPI_Wtime() - t; delete [] pair->p->second; pair->destroy(); pair = nullptr; } return 0L; } template class solveDDM_Op : public E_F0mps { public: Expression A; Expression x; Expression rhs; static const int n_name_param = 5; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; solveDDM_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), x(param2), rhs(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type solveDDM_Op::name_param[] = { {"eps", &typeid(HPDDM::underlying_type)}, {"iter", &typeid(long)}, {"timing", &typeid(KN*)}, {"excluded", &typeid(bool)}, {"ret", &typeid(Pair*)} }; template class solveDDM : public OneOperator { public: solveDDM() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new solveDDM_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType solveDDM_Op::operator()(Stack stack) const { KN* ptX = GetAny*>((*x)(stack)); KN* ptRHS = GetAny*>((*rhs)(stack)); Type* ptA = GetAny((*A)(stack)); if(ptX->n != ptRHS->n) return 0L; HPDDM::Option& opt = *HPDDM::Option::get(); HPDDM::underlying_type eps = nargs[0] ? GetAny>((*nargs[0])(stack)) : -1.0; if(nargs[0]) std::cerr << "Please do not use the legacy option \"-eps\", set instead \"-hpddm_tol\", cf. \"-hpddm_help\"" << std::endl; if(std::abs(eps + 1.0) > 1.0e-6) opt["tol"] = eps; int iter = nargs[1] ? GetAny((*nargs[1])(stack)) : -1; if(iter != -1) opt["max_it"] = iter; KN* timing = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; bool excluded = nargs[3] && GetAny((*nargs[3])(stack)); if(excluded) opt["master_exclude"]; double timer = MPI_Wtime(); if(mpisize == 1) { ptA->computeSchurComplement(); ptA->callNumfactPreconditioner(); if(timing) (*timing)[3] = MPI_Wtime() - timer; timer = MPI_Wtime(); ptA->callNumfact(); if(timing) (*timing)[2] = MPI_Wtime() - timer; } MPI_Barrier(MPI_COMM_WORLD); if(!excluded && timing && mpisize > 1) (*timing)[timing->n - 1] += MPI_Wtime() - timer; timer = MPI_Wtime(); int rank; MPI_Comm_rank(ptA->getCommunicator(), &rank); if(rank != mpirank || rank != 0) opt.remove("verbosity"); timer = MPI_Wtime(); if(!excluded) HPDDM::IterativeMethod::solve(*ptA, (K*)*ptRHS, (K*)*ptX, 1, MPI_COMM_WORLD); else HPDDM::IterativeMethod::solve(*ptA, (K*)nullptr, (K*)nullptr, 1, MPI_COMM_WORLD); timer = MPI_Wtime() - timer; if(!excluded && verbosity > 0 && rank == 0) std::cout << scientific << " --- system solved (in " << timer << ")" << std::endl; return 0L; } template class renumber_Op : public E_F0mps { public: Expression A; Expression Mat; Expression interface; static const int n_name_param = 4; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; renumber_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), Mat(param2), interface(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type renumber_Op::name_param[] = { {"R", &typeid(FEbaseArrayKn*)}, {"effort", &typeid(KN*)}, {"rho", &typeid(KN*)}, {"timing", &typeid(KN*)} }; template class renumber : public OneOperator { public: renumber() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new renumber_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType renumber_Op::operator()(Stack stack) const { Type* ptA = GetAny((*A)(stack)); KN* ptInterface = GetAny*>((*interface)(stack)); FEbaseArrayKn* deflation = nargs[0] ? GetAny*>((*nargs[0])(stack)) : 0; KN* ptEffort = nargs[1] ? GetAny*>((*nargs[1])(stack)) : 0; KN* rho = nargs[2] ? GetAny*>((*nargs[2])(stack)) : 0; KN* timing = nargs[3] ? GetAny*>((*nargs[3])(stack)) : 0; double t = MPI_Wtime(); K** ev; if(deflation && deflation->N > 0) { ev = new K*[deflation->N]; *ev = new K[deflation->N * deflation->get(0)->n]; for(int i = 0; i < deflation->N; ++i) { ev[i] = *ev + i * deflation->get(0)->n; std::copy(static_cast(*(deflation->get(i))), static_cast(*(deflation->get(i))) + deflation->get(i)->n, ev[i]); } ptA->setVectors(ev); ptA->Type::super::super::initialize(deflation->N); } ptA->renumber(STL(*ptInterface), ptEffort ? static_cast(*ptEffort) : nullptr); MatriceMorse* mA = static_cast*>(&(*GetAny*>((*Mat)(stack))->A)); if(mA) { const HPDDM::MatrixCSR* dA = ptA->getMatrix(); mA->lg = dA->_ia; } HPDDM::Option& opt = *HPDDM::Option::get(); char scaling = opt.val("substructuring_scaling", 0); if(scaling == 2 && rho) { ptA->renumber(STL(*ptInterface), *rho); ptA->buildScaling(scaling, *rho); } else ptA->buildScaling(scaling); if(timing) { (*timing)[1] = MPI_Wtime() - t; t = MPI_Wtime(); } if(deflation && deflation->N > 0) for(int i = 0; i < deflation->N; ++i) std::copy(ev[i], ev[i] + deflation->get(i)->n, static_cast(*(deflation->get(i)))); return 0L; } template long nbMult(Type* const& A) { return A->getMult(); } template double nbDof(Type* const& A) { return static_cast(A->getAllDof()); } template long originalNumbering(Type* const& A, KN* const& in, KN* const& interface) { A->originalNumbering(STL(*interface), *in); return 0; } template class InvSubstructuring { public: const T t; const U u; InvSubstructuring(T v, U w) : t(v), u(w) {} void solve(U out) const { if(out->n != u->n) return; if(mpisize == 1) { (*t).computeSchurComplement(); (*t).callNumfactPreconditioner(); (*t).callNumfact(); } HPDDM::Option& opt = *HPDDM::Option::get(); if(mpirank != 0) opt.remove("verbosity"); HPDDM::IterativeMethod::solve(*t, (K*)*u, (K*)*out, 1, MPI_COMM_WORLD); } static U init(U Ax, InvSubstructuring A) { A.solve(Ax); return Ax; } }; template class Type, class K, char S> void add() { Dcl_Type*>(Initialize>, Delete>); TheOperators->Add("<-", new initDDM, K>); Global.Add("attachCoarseOperator", "(", new attachCoarseOperator, K>); Global.Add("DDM", "(", new solveDDM, K>); Global.Add("renumber", "(", new renumber, K>); Global.Add("nbDof", "(", new OneOperator1_*>(nbDof)); Global.Add("nbMult", "(", new OneOperator1_*>(nbMult)); Global.Add("originalNumbering", "(", new OneOperator3_*, KN*, KN*>(originalNumbering)); addInv, InvSubstructuring, KN, K>(); Global.Add("statistics", "(", new OneOperator1_*>(statistics>)); Global.Add("exchange", "(", new exchangeInOut, K>); } } template using HpFetiPrec = HpFeti; static void Init_Substructuring() { Init_Common(); Global.Add("buildSkeleton", "(", new Substructuring::Skeleton); #if defined(DSUITESPARSE) || defined(DHYPRE) const char ds = 'G'; #else const char ds = 'S'; #endif const char zs = 'G'; Substructuring::add(); zzzfff->Add("dbdd", atype*>()); #ifndef DHYPRE // Substructuring::add(); // zzzfff->Add("sbdd", atype*>()); Substructuring::add, zs>(); zzzfff->Add("zbdd", atype, zs>*>()); // Substructuring::add, zs>(); // zzzfff->Add("cbdd", atype, zs>*>()); #endif Substructuring::add(); zzzfff->Add("dfeti", atype*>()); #ifndef DHYPRE // Substructuring::add(); // zzzfff->Add("sfeti", atype*>()); Substructuring::add, zs>(); zzzfff->Add("zfeti", atype, zs>*>()); // Substructuring::add, zs>(); // zzzfff->Add("cfeti", atype, zs>*>()); #endif aType t; int r; if(!zzzfff->InMotClef("dpair", t, r)) { // Dcl_Type*>(InitP>, Destroy>); // zzzfff->Add("spair", atype*>()); Dcl_Type*>(InitP>, Destroy>); zzzfff->Add("dpair", atype*>()); // Dcl_Type>*>(InitP>>, Destroy>>); // zzzfff->Add("cpair", atype>*>()); Dcl_Type>*>(InitP>>, Destroy>>); zzzfff->Add("zpair", atype>*>()); } } LOADFUNC(Init_Substructuring) freefem++-3.61-1/examples++-hpddm/elasticity-2d-substructuring.edp000644 000767 000024 00000007504 13256636774 025137 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm_substructuring" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm_substructuring.idp" // additional DDM functions macro def(i)[i, i#B]// EOM // vector field definition macro init(i)[i, i]// EOM // vector field initialization real Sqrt = sqrt(2.0); macro epsilon(u)[dx(u), dy(u#B), (dy(u) + dx(u#B)) / Sqrt]// EOM macro div(u)(dx(u) + dy(u#B))// EOM macro BC(u, val)u = val, u#B = val// EOM // Dirichlet boundary conditions func Pk = [P2, P2]; // finite element space int labNeumann = getARGV("-labNeumann", 2); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - elasticity-2d-substructuring.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering int[int] interfaceNb; // { int[int] l = [2, 1, 2, 2]; meshN ThGlobal = square(2 * getARGV("-global", 10), getARGV("-global", 10), [2 * x, y], label = l); // global mesh buildSubstructuring(Th, interfaceNb, ThGlobal, 10, 1, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, Pk, BC, comm, excluded) } real f = -90000.0; real strain = 100.0; real Young = 1.0e8; real poisson = 0.45; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); varf vPb(def(u), def(v)) = intN(Th)(lambda * div(u) * div(v) + 2.0 * mu * (epsilon(u)' * epsilon(v))) + intN(Th)(f * vB) + on(1, u = 0.0, uB = 0.0); matrix Mat = vPb(Wh, Wh, solver = CG); // local operator real[int] rhs = vPb(0, Wh); // local right-hand side dbdd A(Mat, arrayIntersection, restrictionIntersection, communicator = comm); // this can be replaced by dfeti bool adaptive = isSetOption("geneo_nu") || isSetOption("geneo_threshold"); dpair ret; if(mpisize == 1) renumber(A, Mat, interfaceNb, effort = rhs); else { if(excluded) attachCoarseOperator(mpiCommWorld, A); else { Wh[int] def(Rb)(0); real[int] float(Wh.ndof); varf floatingPb(def(u), def(v)) = on(1, BC(u, 1.0)); float = floatingPb(0, Wh); if(float.max < 0.9 && !adaptive) { Rb.resize(3); [Rb[0], RbB[0]] = [1, 0]; [Rb[1], RbB[1]] = [0, 1]; [Rb[2], RbB[2]] = [y, -x]; } if(getARGV("-hpddm_substructuring_scaling", 0) != 2) renumber(A, Mat, interfaceNb, R = Rb, effort = rhs); else { real strain = 100.0; real Young = 1.0e8; real poisson = 0.45; real tmp = 1.0 + poisson; real mu = Young / (2.0 * tmp); real lambda = Young * poisson / (tmp * (1.0 - 2.0 * poisson)); Wh def(muFunc) = mu; renumber(A, Mat, interfaceNb, R = Rb, effort = rhs, rho = muFunc[]); } attachCoarseOperator(mpiCommWorld, A, R = Rb, ret = ret); } } Wh def(u); // local solution if(mpisize == mpiSize(comm)) u[] = A^-1 * rhs; else DDM(A, u[], rhs, excluded = excluded); if(!excluded) originalNumbering(A, u[], interfaceNb); plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/SLEPc-complex.cpp000644 000767 000024 00000000407 13256636774 021741 0ustar00hechtstaff000000 000000 //ff-c++-LIBRARY-dep: cxx11 hpddm petsccomplex slepccomplex [mumps parmetis ptscotch scotch scalapack|umfpack] [mkl|blas] mpi //ff-c++-cpp-dep: #define WITH_slepccomplex #define PETScandSLEPc 1 #include "PETSc-code.hpp" #include "SLEPc-code.hpp" LOADFUNC(Init) freefem++-3.61-1/examples++-hpddm/maxwell-3d.edp000644 000767 000024 00000007662 13256636774 021343 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D load "Element_Mixte3d" include "macro_ddm.idp" include "cube.idp" macro def(i)[i, i#y, i#z]// EOM // vector field definition macro init(i)[i, i, i]// EOM // vector field initialization macro defPart(u)u// EOM // partition of unity definition macro initPart(u)u// EOM // partition of unity initialization macro Curl(ux, uy, uz)[dy(uz)-dz(uy), dz(ux)-dx(uz), dx(uy)-dy(ux)]// EOM macro CrossN(ux, uy, uz)[uy*N.z-uz*N.y, uz*N.x-ux*N.z, ux*N.y-uy*N.x]// EOM macro Curlabs(ux, uy, uz)[abs(dy(uz)-dz(uy)), abs(dz(ux)-dx(uz)), abs(dx(uy)-dy(ux))]// EOM func Pk = Edge03d; func PkPart = Edge03ds0; int Dirichlet = 1, Robin = 2; int overlap = getARGV("-overlap", 2); // geometric overlap between subdomains int fakeInterface = getARGV("-interface", 10); // interface between subdomains int s = getARGV("-split", 1); // refinement factor if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - maxwell-3d.edp - input parameters: refinement factor = " << s << " - overlap = " << overlap << endl; } int [int,int] LL = [[1,2], [3,4], [5,6]]; real[int, int] BB = [[0,1], [0,1], [0,1]]; int[int] NN = [getARGV("-global", 10), getARGV("-global", 10), getARGV("-global", 10)]; int[int] CC = [1, 1, 1]; meshN ThGlobal = Cube(NN, BB, LL); func k = 6 * pi; int[int] chlab = [1, Robin, 2, Robin, 3, Robin, 4, Robin, 5, Robin, 6, Robin]; ThGlobal = change(ThGlobal, refface = chlab); meshN ThBackup = ThGlobal; meshN Th = Cube(CC, BB, LL); fespace Wh(Th, Pk); meshN ThBorder; int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering real[int] D; { buildEdge(Th, ThBorder, ThGlobal, 10, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, Pk, mpiCommWorld, 0, PkPart, defPart, initPart) ThGlobal = Cube(CC, BB, LL); } matrix Mat; matrix Opt; complex[int] rhs(Wh.ndof); { meshN ThAugmented = Th + ThBorder; ThBorder = Cube(CC, BB, LL); fespace WhAugmented(ThAugmented, Pk); varf vPb([Ex,Ey,Ez],[vx,vy,vz]) = intN(ThAugmented)(Curl(vx,vy,vz)'*Curl(Ex,Ey,Ez)) - intN(ThAugmented)(k^2*[vx,vy,vz]'*[Ex,Ey,Ez]) - intN1(ThAugmented, Robin)(1i*k*CrossN(vx,vy,vz)'*CrossN(Ex,Ey,Ez)) + on(Dirichlet, Ex=0, Ey=0, Ez=0); Mat = vPb(WhAugmented, WhAugmented, solver=GMRES); func f = exp(-((x-0.5)^2+(y-0.5)^2+(z-0.5)^2)*60); varf vPbRhs([Ex,Ey,Ez],[vx,vy,vz]) = - intN(ThAugmented)([vx,vy,vz]'*[0,0,f]) + on(Dirichlet, Ex=0,Ey=0,Ez=0); if(mpisize > 1) { complex[int] rhsFull(WhAugmented.ndof); rhsFull = vPbRhs(0, WhAugmented); matrix R = interpolate(Wh, WhAugmented); R.thresholding(1.0e-10); renumbering(Mat, R, rhsFull, rhs); } else rhs = vPbRhs(0, WhAugmented); } zschwarz A(Mat, arrayIntersection, restrictionIntersection, scaling = D, communicator = mpiCommWorld); set(A, sparams = "-hpddm_schwarz_method oras"); complex[int] nEx(Wh.ndof); nEx = 0.0; int solver = getOption("schwarz_method"); if(solver == 1 || solver == 2 || solver == 4) { // optimized Schwarz methods varf vPbOpt([Ex,Ey,Ez],[vx,vy,vz]) = intN(Th)(Curl(vx,vy,vz)'*Curl(Ex,Ey,Ez)) - intN(Th)(k^2*[vx,vy,vz]'*[Ex,Ey,Ez]) - intN1(Th, Robin)(1i*k*CrossN(vx,vy,vz)'*CrossN(Ex,Ey,Ez)) - intN1(Th, fakeInterface)(1i*k*CrossN(vx,vy,vz)'*CrossN(Ex,Ey,Ez)) + on(Dirichlet, Ex=0, Ey=0, Ez=0); Opt = vPbOpt(Wh, Wh); } DDM(A, nEx, rhs, O = Opt); Wh def(sol); sol[] = nEx; medit("Global solution", Th, [real(sol), real(soly), real(solz)]); freefem++-3.61-1/examples++-hpddm/common.hpp000644 000767 000024 00000031022 13321622623 020635 0ustar00hechtstaff000000 000000 #ifndef _COMMON_ #define _COMMON_ #include #include #include #include #ifdef WITH_mkl #define HPDDM_MKL 1 #define MKL_Complex8 std::complex #define MKL_Complex16 std::complex #include #endif #if HPDDM_SCHWARZ || HPDDM_FETI || HPDDM_BDD #ifdef WITH_mkl #define MKL_PARDISOSUB #elif defined(WITH_mumps) #define MUMPSSUB #else #define SUITESPARSESUB #endif #ifdef WITH_mumps #define DMUMPS #else #define DSUITESPARSE #endif #define MU_ARPACK #endif #define HPDDM_NUMBERING 'C' #undef CBLAS_H #include template class STL { T* const _it; const int _size; public: STL(const KN& v) : _it(v), _size(v.size()) { }; int size() const { return _size; } T* begin() const { return _it; } T* end() const { return _it + _size; } bool empty() const { return _size <= 0; } T& operator[](std::size_t idx) { return _it[idx]; } const T& operator[](std::size_t idx) const { return _it[idx]; } T& back() { return _it[_size - 1]; } const T& back() const { return _it[_size - 1]; } }; template class Pair { public: Pair() : p() { }; std::pair* p; void init() { } void destroy() { delete p; p = nullptr; } }; template R Build(A a, B b) { return R(a, b); } template class OneBinaryOperatorInv : public OneOperator { public: OneBinaryOperatorInv() : OneOperator(atype(), atype(), atype()) { } E_F0* code(const basicAC_F0 & args) const { Expression p = args[1]; if(!p->EvaluableWithOutStack()) CompileError("A^p, The p must be a constant == -1, sorry"); long pv = GetAny((*p)(NullStack)); if(pv != -1) { char buf[100]; sprintf(buf, "A^%ld, The pow must be == -1, sorry", pv); CompileError(buf); } return new E_F_F0(Build, t[0]->CastTo(args[0])); } }; template class Inv, class V, class K = double> void addInv() { class OpInv { public: Op* A; OpInv(Op* B) : A(B) { assert(A); } operator Op& () const { return *A; } operator Op* () const { return A; } }; Dcl_Type(); Dcl_Type>(); TheOperators->Add("^", new OneBinaryOperatorInv()); TheOperators->Add("*", new OneOperator2, OpInv, V*>(Build)); TheOperators->Add("=", new OneOperator2>(Inv::init)); } template class Prod, class V, class K = double, char N = 'N'> void addProd() { Dcl_Type>(); if(N == 'T') { class OpTrans { public: Op* A; OpTrans(Op* B) : A(B) { assert(A); } operator Op& () const { return *A; } operator Op* () const { return A; } }; Dcl_Type(); TheOperators->Add("\'", new OneOperator1(Build)); TheOperators->Add("*", new OneOperator2, OpTrans, V*>(Build)); } else { TheOperators->Add("*", new OneOperator2, Op*, V*>(Build)); } TheOperators->Add("=", new OneOperator2>(Prod::mv)); TheOperators->Add("<-", new OneOperator2>(Prod::init)); } extern KN* pkarg; template::value == 1>::type* = nullptr> void scaledExchange(Type* const& pA, K* pin, unsigned short mu, bool allocate) { if(allocate) pA->template scaledExchange(pin, mu); else pA->template scaledExchange(pin, mu); } template::value != 1>::type* = nullptr> void scaledExchange(Type* const& pA, K* pin, unsigned short mu, bool allocate) { } template void exchange_dispatched(Type* const& pA, KN* pin, bool scaled) { if(pA) { unsigned short mu = pA->getDof() ? pin->n / pA->getDof() : 1; const auto& map = pA->getMap(); bool allocate = map.size() > 0 && pA->getBuffer()[0] == nullptr ? pA->setBuffer() : false; if(scaled) scaledExchange(pA, static_cast(*pin), mu, false); else pA->HPDDM::template Subdomain::exchange(static_cast(*pin), mu); pA->clearBuffer(allocate); } } template::value != 0>::type* = nullptr> void exchange(Type* const& pA, KN* pin, bool scaled) { exchange_dispatched(pA, pin, scaled); } template::value == 0>::type* = nullptr> void exchange(Type* const& pA, KN* pin, bool scaled) { if(pA) exchange_dispatched(pA->_A, pin, scaled); } template::value != 0>::type* = nullptr> void exchange_restriction(Type* const&, KN*, KN*, MatriceMorse*) { } namespace PETSc { template void changeNumbering_func(Type*, KN*, KN*, bool); } template::value == 0>::type* = nullptr> void exchange_restriction(Type* const& pA, KN* pin, KN* pout, MatriceMorse* mR) { if(pA->_exchange && !pA->_exchange[1]) { ffassert((!mR && pA->_exchange[0]->getDof() == pout->n) || (mR && mR->n == pin->n && mR->m == pout->n)); PETSc::changeNumbering_func(pA, pin, pout, false); PETSc::changeNumbering_func(pA, pin, pout, true); pout->resize(pA->_exchange[0]->getDof()); *pout = K(); if(mR) { for(int i = 0; i < mR->n; ++i) { for(int j = mR->lg[i]; j < mR->lg[i + 1]; ++j) pout->operator[](mR->cl[j]) += mR->a[j] * pin->operator[](i); } } exchange_dispatched(pA->_exchange[0], pout, false); } } template class exchangeIn_Op : public E_F0mps { public: Expression A; Expression in; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; exchangeIn_Op(const basicAC_F0& args, Expression param1, Expression param2) : A(param1), in(param2) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type exchangeIn_Op::name_param[] = { {"scaled", &typeid(bool)} }; template class exchangeIn : public OneOperator { public: exchangeIn() : OneOperator(atype(), atype(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new exchangeIn_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1])); } }; template AnyType exchangeIn_Op::operator()(Stack stack) const { Type* pA = GetAny((*A)(stack)); KN* pin = GetAny*>((*in)(stack)); bool scaled = nargs[0] && GetAny((*nargs[0])(stack)); exchange(pA, pin, scaled); return 0L; } template class exchangeInOut_Op : public E_F0mps { public: Expression A; Expression in; Expression out; static const int n_name_param = 2; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; exchangeInOut_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), in(param2), out(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type exchangeInOut_Op::name_param[] = { {"scaled", &typeid(bool)}, {"restriction", &typeid(Matrice_Creuse*)} }; template class exchangeInOut : public OneOperator { public: exchangeInOut() : OneOperator(atype(), atype(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new exchangeInOut_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template AnyType exchangeInOut_Op::operator()(Stack stack) const { Type* pA = GetAny((*A)(stack)); KN* pin = GetAny*>((*in)(stack)); KN* pout = GetAny*>((*out)(stack)); bool scaled = nargs[0] && GetAny((*nargs[0])(stack)); Matrice_Creuse* pR = nargs[1] ? GetAny*>((*nargs[1])(stack)) : nullptr; MatriceMorse* mR = pR ? static_cast*>(&(*pR->A)) : nullptr; if(pR) { ffassert(!scaled); exchange_restriction(pA, pin, pout, mR); } else if(pin->n == pout->n) { *pout = *pin; exchange(pA, pout, scaled); } return 0L; } double getOpt(string* const& ss) { return HPDDM::Option::get()->val(*ss); } bool isSetOpt(string* const& ss) { return HPDDM::Option::get()->set(*ss); } template bool destroyRecycling(Type* const& Op) { HPDDM::Recycling::get()->destroy(Op->prefix()); return false; } template bool statistics(Type* const& Op) { Op->statistics(); return false; } template class distributedDot_Op : public E_F0mps { public: Expression A; Expression in; Expression out; static const int n_name_param = 1; static basicAC_F0::name_and_type name_param[]; Expression nargs[n_name_param]; distributedDot_Op(const basicAC_F0& args, Expression param1, Expression param2, Expression param3) : A(param1), in(param2), out(param3) { args.SetNameParam(n_name_param, name_param, nargs); } AnyType operator()(Stack stack) const; }; template basicAC_F0::name_and_type distributedDot_Op::name_param[] = { {"communicator", &typeid(pcommworld)} }; template class distributedDot : public OneOperator { public: distributedDot() : OneOperator(atype(), atype*>(), atype*>(), atype*>()) { } E_F0* code(const basicAC_F0& args) const { return new distributedDot_Op(args, t[0]->CastTo(args[0]), t[1]->CastTo(args[1]), t[2]->CastTo(args[2])); } }; template::value>::type* = nullptr> inline K prod(K u, double d, K v) { return std::conj(u) * d * v; } template::value>::type* = nullptr> inline K prod(K u, double d, K v) { return u * d * v; } template AnyType distributedDot_Op::operator()(Stack stack) const { KN* pA = GetAny*>((*A)(stack)); KN* pin = GetAny*>((*in)(stack)); KN* pout = GetAny*>((*out)(stack)); MPI_Comm* comm = nargs[0] ? (MPI_Comm*)GetAny((*nargs[0])(stack)) : 0; K dot = K(); for(int i = 0; i < pin->n; ++i) dot += prod(pin->operator[](i), pA->operator[](i), pout->operator[](i)); MPI_Allreduce(MPI_IN_PLACE, &dot, 1, HPDDM::Wrapper::mpi_type(), MPI_SUM, comm ? *((MPI_Comm*)comm) : MPI_COMM_WORLD); return SetAny(dot); } static void Init_Common() { if(!Global.Find("dscalprod").NotNull()) { #if HPDDM_SCHWARZ || HPDDM_FETI || HPDDM_BDD aType t; int r; if(!zzzfff->InMotClef("dpair", t, r)) { Global.Add("getOption", "(", new OneOperator1_(getOpt)); Global.Add("isSetOption", "(", new OneOperator1_(isSetOpt)); int argc = pkarg->n; const char** argv = new const char*[argc]; for(int i = 0; i < argc; ++i) argv[i] = (*((*pkarg)[i].getap()))->data(); HPDDM::Option::get()->parse(argc, argv, mpirank == 0); delete [] argv; } #endif Global.Add("dscalprod", "(", new distributedDot); Global.Add("dscalprod", "(", new distributedDot>); } } #endif // _COMMON_ freefem++-3.61-1/examples++-hpddm/SLEPc.cpp000644 000767 000024 00000000362 13256636774 020274 0ustar00hechtstaff000000 000000 //ff-c++-LIBRARY-dep: cxx11 hpddm petsc slepc [mumps parmetis ptscotch scotch scalapack|umfpack] [mkl|blas] mpi //ff-c++-cpp-dep: #define WITH_slepc #define PETScandSLEPc 1 #include "PETSc-code.hpp" #include "SLEPc-code.hpp" LOADFUNC(Init) freefem++-3.61-1/examples++-hpddm/diffusion-2d-substructuring.edp000644 000767 000024 00000006324 13256636774 024752 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 4 script.edp // NBPROC 4 load "hpddm_substructuring" // HPDDM plugin macro partitioner()metis// EOM // metis, scotch, or parmetis macro dimension()2// EOM // 2D or 3D include "macro_ddm_substructuring.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro grad(u)[dx(u), dy(u)]// EOM // two-dimensional gradient macro BC(u, val)u = val// EOM // Dirichlet boundary conditions func Pk = P1; // finite element space int labNeumann = getARGV("-labNeumann", 2); // interface between subdomains int s = getARGV("-split", 1); // refinement factor mpiComm comm; int p = getARGV("-hpddm_master_p", 1); bool excluded = splitComm(mpiCommWorld, p, comm, topology = getARGV("-hpddm_master_topology", 0), exclude = (usedARGV("-hpddm_master_exclude") != -1)); if(verbosity > 0 && mpirank == 0) { cout << " --- " << mpirank << "/" << mpisize; cout << " - diffusion-2d-substructuring.edp - input parameters: refinement factor = " << s << endl; } meshN Th = square(1, 1); fespace Wh(Th, Pk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersection(0); // local-to-neighbors renumbering int[int] interfaceNb; // int[int] labDirichlet = [1, 3]; { int[int] l = [2, 1, 3, 2]; meshN ThGlobal = square(getARGV("-global", 40), getARGV("-global", 40), label = l); // global mesh buildSubstructuring(Th, interfaceNb, ThGlobal, 10, labDirichlet, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, Pk, BC, comm, excluded) } func f = 10; varf vPb(u, v) = intN(Th)(grad(u)' * grad(v)) + intN(Th)(f * v) + on(labDirichlet, u = 1.0); matrix Mat = vPb(Wh, Wh, solver = CG); // local operator real[int] rhs = vPb(0, Wh); // local right-hand side dbdd A(Mat, arrayIntersection, restrictionIntersection, communicator = comm); // this can be replaced by dfeti bool adaptive = isSetOption("geneo_nu") || isSetOption("geneo_threshold"); dpair ret; if(mpisize == 1) renumber(A, Mat, interfaceNb, effort = rhs); else { if(excluded) attachCoarseOperator(mpiCommWorld, A); else { Wh[int] def(Rb)(0); real[int] float(Wh.ndof); varf floatingPb(def(u), def(v)) = on(labDirichlet, BC(u, 1.0)); float = floatingPb(0, Wh); if(float.max < 0.9 && !adaptive) { Rb.resize(1); Rb[0][] = 1; } if(getARGV("-hpddm_substructuring_scaling", 0) != 2) renumber(A, Mat, interfaceNb, R = Rb, effort = rhs); else { Wh def(mu) = 1.0; renumber(A, Mat, interfaceNb, R = Rb, effort = rhs, rho = mu[]); } attachCoarseOperator(mpiCommWorld, A, R = Rb, ret = ret); } } Wh def(u) = 0.0; // local solution if(mpisize == mpiSize(comm)) u[] = A^-1 * rhs; else DDM(A, u[], rhs, excluded = excluded); if(!excluded) originalNumbering(A, u[], interfaceNb); plotMPI(Th, u[], "Global solution", Pk, def, real, 3, 1) freefem++-3.61-1/examples++-hpddm/macro_ddm_substructuring.idp000644 000767 000024 00000012715 13256636774 024475 0ustar00hechtstaff000000 000000 include "macro_ddm.idp" macro partitionSubstructuring(meshName, interfaceNb, globalName, PhGlobal, part, s, ndofSkeleton, BC, comm, fakeInterface, labDirichlet) meshName = trunc(globalName, abs(part - mpiRank(comm)) < 0.1, label = fakeInterface); { fespace PhLocal(meshName, P0); PhLocal overshoot = hTriangle; real max = 4.0 * overshoot[].max; bbN(meshName, max, globalName) } fespace VhGlobal(globalName, P1); PhGlobal supp = abs(part - mpiRank(comm)) < 0.1; VhGlobal suppSmooth; AddLayers(globalName, supp[], 2, suppSmooth[]); { meshN neighbors = trunc(globalName, suppSmooth > 0.001); fespace Oh(neighbors, P0); Oh partOverlap = part; Unique(partOverlap[], arrayIntersection, remove = mpiRank(comm)); } VhGlobal[int] partitionIntersection(arrayIntersection.n); if(s > 1) { globalName = trunc(globalName, suppSmooth > 0.001, split = s, label = fakeInterface); supp = abs(part - mpiRank(comm)) < 0.1; suppSmooth = 0; AddLayers(globalName, supp[], 2, suppSmooth[]); meshName = trunc(meshName, 1, split = s); } globalName = trunc(globalName, suppSmooth > 0.501, label = fakeInterface); real eps = intN(globalName)(1.0); real[int] epsTab(arrayIntersection.n); mpiRequest[int] rq(2 * arrayIntersection.n); for(int j = 0; j < arrayIntersection.n; ++j) Irecv(processor(arrayIntersection[j], comm, rq[j]), epsTab[j]); for(int j = 0; j < arrayIntersection.n; ++j) Isend(processor(arrayIntersection[j], comm, rq[arrayIntersection.n + j]), eps); VhGlobal phi = 0; part = part; int numberIntersection = 0; for(int k = 0; k < 2 * arrayIntersection.n; ++k) mpiWaitAny(rq); for(int i = 0; i < arrayIntersection.n; ++i) { PhGlobal suppPartition = abs(arrayIntersection[i] - part) < 0.1; AddLayers(globalName, suppPartition[], 1, phi[]); real intersection = intN(globalName)(phi) / min(eps, epsTab[i]); if(intersection > 1.0e-6) { partitionIntersection[numberIntersection] = phi; arrayIntersection[numberIntersection++] = arrayIntersection[i]; } } if(numberIntersection != arrayIntersection.n) arrayIntersection.resize(numberIntersection); Wh def(interface); varf vPbInterface(def(u), def(v)) = on(fakeInterface, BC(u, 1.0)) + on(labDirichlet, BC(u, 0.0)); interface[] = vPbInterface(0, Wh, tgv = 1); matrix[int] R(arrayIntersection.n); for(int i = 0; i < arrayIntersection.n; ++i) { meshN meshIntersection = trunc(globalName, (part == mpiRank(comm) || part == arrayIntersection[i]) && partitionIntersection[i] > 1e-6, label = fakeInterface); fespace WhIntersection(meshIntersection, Pk); R[i] = interpolate(WhIntersection, Wh, inside = 1); } buildSkeleton(interface[], arrayIntersection, R, ndofSkeleton, interface = interfaceNb, redundancy = getARGV("-redundancy", 1), communicator = comm);// EOM macro buildSubstructuringWithPartitioning(Th, interfaceNb, ThGlobal, userPartitioning, fakeInterface, labDirichlet, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, P, BC, comm, excluded) { real timing = mpiWtime(); if(mpisize > 1 && !excluded) { fespace PhGlobal(ThGlobal, P0); PhGlobal partGlobal; if(userPartitioning.n != PhGlobal.ndof) { if(mpiRank(comm) == 0) { if(verbosity > 0) cout.scientific << " --- global mesh of " << ThGlobal.nt << " elements (prior to refinement) partitioned with " << Stringification(partitioner); timing = mpiWtime(); partitionerSeq(partGlobal[], ThGlobal, mpiSize(comm)); } partitionerPar(partGlobal[], ThGlobal, comm, mpiSize(comm)); if(mpiRank(comm) == 0 && verbosity > 0) cout.scientific << " (in " << mpiWtime() - timing << ")" << endl; timing = mpiWtime(); } else { partGlobal[] = userPartitioning; broadcast(processor(0, comm), partGlobal[]); } partitionSubstructuring(Th, interfaceNb, ThGlobal, PhGlobal, partGlobal, s, restrictionIntersection, BC, comm, fakeInterface, labDirichlet) } else if(mpisize == 1) { Th = ThGlobal; Wh def(interface); varf vPbInterface(def(u), def(v)) = on(labNeumann, BC(u, 1.0)) + on(labDirichlet, BC(u, 0.0)); interface[] = vPbInterface(0, Wh, tgv = 1); interfaceNb.resize(Wh.ndof); int j = 0; for(int i = 0; i < Wh.ndof; ++i) { if(interface[][i] > 0.9) interfaceNb[j++] = i; } interfaceNb.resize(j); } mpiBarrier(mpiCommWorld); if(verbosity > 0 && mpirank == 0) cout.scientific << " --- partition of unity built (in " << mpiWtime() - timing << ")" << endl; }// EOM macro buildSubstructuring(Th, interfaceNb, ThGlobal, fakeInterface, labDirichlet, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, P, BC, comm, excluded) { real[int] emptyArray(0); buildSubstructuringWithPartitioning(Th, interfaceNb, ThGlobal, emptyArray, fakeInterface, labDirichlet, labNeumann, s, arrayIntersection, restrictionIntersection, Wh, P, BC, comm, excluded) }// EOM freefem++-3.61-1/examples++-hpddm/Makefile.in000644 000767 000024 00000132074 13321623167 020716 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-hpddm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = diffusion-2d-PETSc.edp diffusion-2d-PETSc-complex.edp diffusion-3d-PETSc.edp elasticity-2d-PETSc.edp elasticity-3d-PETSc.edp heat-2d-PETSc.edp heat-3d.edp \ diffusion-2d.edp diffusion-3d.edp elasticity-2d.edp elasticity-3d.edp heat-2d.edp helmholtz-2d.edp maxwell-3d.edp \ diffusion-3d-simple.edp elasticity-3d-simple.edp \ stokes-2d-PETSc.edp stokes-3d-PETSc.edp stokes-3d.edp stokes-2d.edp diffusion-2d-substructuring.edp elasticity-2d-substructuring.edp \ laplace-2d-SLEPc.edp laplace-complex-2d-SLEPc.edp diffusion-2d-substructuring-withPartitioning.edp iterative.edp \ laplace-2d-spherical-harmonics-SLEPc.edp schrodinger-1d-harmonic-oscillator-SLEPc.edp schrodinger-2d-harmonic-oscillator-SLEPc.edp \ laplace-2d-torus-SLEPc.edp schrodinger-1d-square-well-SLEPc.edp withPartitioning.edp XFAIL_TESTS = $(TESTS) LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPPMPI) FLAGS_FFPP="-np 4 -nw" SKIP=$(SKIP_TESTS_MPI) LIST_IDP = macro_ddm.idp macro_ddm_substructuring.idp EXTRA_DIST = $(TESTS) $(LIST_IDP) PETSc.cpp PETSc-complex.cpp PETSc-code.hpp common.hpp hpddm.cpp hpddm_substructuring.cpp SLEPc.cpp SLEPc-complex.cpp SLEPc-code.hpp PETSc.hpp # FFCS - list modified to disable some downloaded tools depending on the platform (see # [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be # deactivated). LIST_COMPILE = @TOOL_DYLIB_hpddm@ all: all-am .SUFFIXES: .SUFFIXES: .$(DYLIB_SUFFIX) .cpp .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-hpddm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-hpddm/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? diffusion-2d-PETSc.edp.log: diffusion-2d-PETSc.edp @p='diffusion-2d-PETSc.edp'; \ b='diffusion-2d-PETSc.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) diffusion-2d-PETSc-complex.edp.log: diffusion-2d-PETSc-complex.edp @p='diffusion-2d-PETSc-complex.edp'; \ b='diffusion-2d-PETSc-complex.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) diffusion-3d-PETSc.edp.log: diffusion-3d-PETSc.edp @p='diffusion-3d-PETSc.edp'; \ b='diffusion-3d-PETSc.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) elasticity-2d-PETSc.edp.log: elasticity-2d-PETSc.edp @p='elasticity-2d-PETSc.edp'; \ b='elasticity-2d-PETSc.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) elasticity-3d-PETSc.edp.log: elasticity-3d-PETSc.edp @p='elasticity-3d-PETSc.edp'; \ b='elasticity-3d-PETSc.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) heat-2d-PETSc.edp.log: heat-2d-PETSc.edp @p='heat-2d-PETSc.edp'; \ b='heat-2d-PETSc.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) heat-3d.edp.log: heat-3d.edp @p='heat-3d.edp'; \ b='heat-3d.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) diffusion-2d.edp.log: diffusion-2d.edp @p='diffusion-2d.edp'; \ b='diffusion-2d.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) diffusion-3d.edp.log: diffusion-3d.edp @p='diffusion-3d.edp'; \ b='diffusion-3d.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) elasticity-2d.edp.log: elasticity-2d.edp @p='elasticity-2d.edp'; \ b='elasticity-2d.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) elasticity-3d.edp.log: elasticity-3d.edp @p='elasticity-3d.edp'; \ b='elasticity-3d.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) heat-2d.edp.log: heat-2d.edp @p='heat-2d.edp'; \ b='heat-2d.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) helmholtz-2d.edp.log: helmholtz-2d.edp @p='helmholtz-2d.edp'; \ b='helmholtz-2d.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) maxwell-3d.edp.log: maxwell-3d.edp @p='maxwell-3d.edp'; \ b='maxwell-3d.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) diffusion-3d-simple.edp.log: diffusion-3d-simple.edp @p='diffusion-3d-simple.edp'; \ b='diffusion-3d-simple.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) elasticity-3d-simple.edp.log: elasticity-3d-simple.edp @p='elasticity-3d-simple.edp'; \ b='elasticity-3d-simple.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) stokes-2d-PETSc.edp.log: stokes-2d-PETSc.edp @p='stokes-2d-PETSc.edp'; \ b='stokes-2d-PETSc.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) stokes-3d-PETSc.edp.log: stokes-3d-PETSc.edp @p='stokes-3d-PETSc.edp'; \ b='stokes-3d-PETSc.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) stokes-3d.edp.log: stokes-3d.edp @p='stokes-3d.edp'; \ b='stokes-3d.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) stokes-2d.edp.log: stokes-2d.edp @p='stokes-2d.edp'; \ b='stokes-2d.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) diffusion-2d-substructuring.edp.log: diffusion-2d-substructuring.edp @p='diffusion-2d-substructuring.edp'; \ b='diffusion-2d-substructuring.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) elasticity-2d-substructuring.edp.log: elasticity-2d-substructuring.edp @p='elasticity-2d-substructuring.edp'; \ b='elasticity-2d-substructuring.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) laplace-2d-SLEPc.edp.log: laplace-2d-SLEPc.edp @p='laplace-2d-SLEPc.edp'; \ b='laplace-2d-SLEPc.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) laplace-complex-2d-SLEPc.edp.log: laplace-complex-2d-SLEPc.edp @p='laplace-complex-2d-SLEPc.edp'; \ b='laplace-complex-2d-SLEPc.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) diffusion-2d-substructuring-withPartitioning.edp.log: diffusion-2d-substructuring-withPartitioning.edp @p='diffusion-2d-substructuring-withPartitioning.edp'; \ b='diffusion-2d-substructuring-withPartitioning.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) iterative.edp.log: iterative.edp @p='iterative.edp'; \ b='iterative.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) laplace-2d-spherical-harmonics-SLEPc.edp.log: laplace-2d-spherical-harmonics-SLEPc.edp @p='laplace-2d-spherical-harmonics-SLEPc.edp'; \ b='laplace-2d-spherical-harmonics-SLEPc.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) schrodinger-1d-harmonic-oscillator-SLEPc.edp.log: schrodinger-1d-harmonic-oscillator-SLEPc.edp @p='schrodinger-1d-harmonic-oscillator-SLEPc.edp'; \ b='schrodinger-1d-harmonic-oscillator-SLEPc.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) schrodinger-2d-harmonic-oscillator-SLEPc.edp.log: schrodinger-2d-harmonic-oscillator-SLEPc.edp @p='schrodinger-2d-harmonic-oscillator-SLEPc.edp'; \ b='schrodinger-2d-harmonic-oscillator-SLEPc.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) laplace-2d-torus-SLEPc.edp.log: laplace-2d-torus-SLEPc.edp @p='laplace-2d-torus-SLEPc.edp'; \ b='laplace-2d-torus-SLEPc.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) schrodinger-1d-square-well-SLEPc.edp.log: schrodinger-1d-square-well-SLEPc.edp @p='schrodinger-1d-square-well-SLEPc.edp'; \ b='schrodinger-1d-square-well-SLEPc.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) withPartitioning.edp.log: withPartitioning.edp @p='withPartitioning.edp'; \ b='withPartitioning.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic clean-local cscopelist-am ctags-am distclean \ distclean-generic 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-exec-local \ 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 pdf pdf-am ps ps-am recheck \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # FFCS - do not set loadpath to be able to run an external version of FF on the examples in this directory with # [[../../mkffref]] @FFCS_MPIOK_TRUE@all-local:$(LIST_COMPILE) freefem++.pref @FFCS_MPIOK_TRUE@ @echo Warning missing mpi plugin: `for i in $(LIST_COMPILE); do if test ! -s $i ; then j=1; echo "$i," ;fi; done` @FFCS_MPIOK_TRUE@ echo "finish compile load hpddm solver !" @FFCS_MPIOK_FALSE@all-local: .cpp.$(DYLIB_SUFFIX): ../examples++-load/ff-c++ ../examples++-load/WHERE_LIBRARY-download ../examples++-load/WHERE_LIBRARY-config # FFCS needs an error exit code to make sure that all libraries are correctly compiled # # FFCS on Windows inserts all MPI options (include, lib, ...) in the $MPICXX compiler script, instead of "$CXX $MPI_xxx", # but it needs '-mpi' to do that # ### -../examples++-load/ff-c++ -auto $< ../examples++-load/ff-c++ -auto -mpi $< install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib/mpi $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/etc -for i in $(LIST_COMPILE); do \ if [ -f $$i ] ; then $(INSTALL) -m 555 $$i $(DESTDIR)$(ff_prefix_dir)/lib/mpi; fi; done $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp freefem++.pref:Makefile echo loadpath = \"../examples++-mpi/\" >freefem++.pref echo loadpath += \"../examples++-load/\" >>freefem++.pref echo includepath = \"../examples++-mpi/\" >>freefem++.pref echo includepath += \"../examples++-3d/\" >>freefem++.pref echo includepath += \"../examples++-tutorial/\" >>freefem++.pref echo loadpath += \"./\" >>freefem++.pref # force the build for freefem++.pref FH.. (do not works 2016) #$(TEST) :freefem++.pref # FFCS - cleaning is useful sometimes clean-local:: -rm $(LIST_COMPILE) -rm *.$(OBJEXT) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # 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: freefem++-3.61-1/examples++-hpddm/macro_ddm.idp000644 000767 000024 00000062520 13321622623 021266 0ustar00hechtstaff000000 000000 load "thresholdings" include "getARGV.idp" IFMACRO(!partitioner) macro partitioner()metis// EOM ENDIFMACRO IFMACRO(partitioner,metis) load "metis" macro partitionerSeq(part, Th, size)metisdual(part, Th, size)// EOM macro partitionerPar(part, Th, comm, size)broadcast(processor(0, comm), part)// EOM ENDIFMACRO IFMACRO(partitioner,scotch) load "scotch" macro partitionerSeq(part, Th, size)scotch(part, Th, size)// EOM macro partitionerPar(part, Th, comm, size)broadcast(processor(0, comm), part)// EOM ENDIFMACRO IFMACRO(partitioner,parmetis) load "parmetis" macro partitionerSeq(part, Th, size)// EOM macro partitionerPar(part, Th, comm, size)parmetis(part, Th, size, communicator = comm, worker = getARGV("-parmetis_worker", 1))// EOM ENDIFMACRO IFMACRO(!partitionerSeq) cout << "The macro 'partitioner' must be set to 'metis', 'scotch', or 'parmetis'" << endl; exit(1); ENDIFMACRO IFMACRO(!dimension) cout << "The macro 'dimension' must be defined" << endl; exit(1); ENDIFMACRO IFMACRO(dimension,2) macro meshN()mesh// EOM // two-dimensional problem macro bbN()bb2// EOM // two-dimensional bounding box macro intN()int2d// EOM // two-dimensional integral macro intN1()int1d// EOM // one-dimensional integral macro readmeshN()readmesh// EOM // two-dimensional problem ENDIFMACRO IFMACRO(dimension,3) load "msh3" macro meshN()mesh3// EOM // three-dimensional problem macro bbN()bb3// EOM // three-dimensional bounding box macro intN()int3d// EOM // three-dimensional integral macro intN1()int2d// EOM // two-dimensional integral macro readmeshN()readmesh3// EOM // three-dimensional problem ENDIFMACRO IFMACRO(!meshN) cout << "The macro 'dimension' must be set to '2' or '3'" << endl; exit(1); ENDIFMACRO searchMethod = 1; macro bb2(boundingMesh, overshoot, ThGlobal) real[int] bb(4); boundingbox(bb, boundingMesh); bb(0) -= overshoot; bb(1) += overshoot; bb(2) -= overshoot; bb(3) += overshoot; ThGlobal = trunc(ThGlobal, (x >= bb(0) && x <= bb(1) && y >= bb(2) && y <= bb(3)));// EOM macro bb3(boundingMesh, overshoot, ThGlobal) real[int] bb(6); boundingbox(bb, boundingMesh); bb(0) -= overshoot; bb(1) += overshoot; bb(2) -= overshoot; bb(3) += overshoot; bb(4) -= overshoot; bb(5) += overshoot; ThGlobal = trunc(ThGlobal, (x >= bb(0) && x <= bb(1) && y >= bb(2) && y <= bb(3) && z >= bb(4) && z <= bb(5)));// EOM macro plotMPI(Th, u, legend, Pk, def, K, d, w) if(mpirank == 0) { meshN ThCurrent = Th; meshN[int] meshTab(mpisize); fespace Xh(ThCurrent, Pk); Xh[int] def(uTab)(mpisize); uTab[0][] = u; meshTab[0] = Th; mpiRequest[int] rq(mpisize - 1); for(int i = 1; i < mpisize; ++i) Irecv(processor(i, mpiCommWorld, rq[i - 1]), meshTab[i]); for(int i = 1; i < mpisize; ++i) mpiWaitAny(rq); for(int i = 1; i < mpisize; ++i) { ThCurrent = meshTab[i]; Irecv(processor(i, mpiCommWorld, rq[i - 1]), uTab[i][]); } for(int i = 1; i < mpisize; ++i) mpiWaitAny(rq); plot(uTab, wait = w, nbiso = 40, fill = 1, value = 1, dim = d, cmm = legend); } else { mpiRequest[int] rq(2); Isend(processor(0, rq[0]), Th); Isend(processor(0, rq[1]), u); mpiWait(rq[0]); mpiWait(rq[1]); }// EOM macro plotMPIeach(Th, u, legend, Pk, def, K, d, w) if(mpirank == 0) { meshN ThCurrent = Th; meshN[int] meshTab(mpisize); fespace Xh(ThCurrent, Pk); Xh[int] def(uTab)(mpisize); uTab[0][] = u; meshTab[0] = Th; mpiRequest[int] rq(mpisize - 1); for(int i = 1; i < mpisize; ++i) Irecv(processor(i, mpiCommWorld, rq[i - 1]), meshTab[i]); for(int i = 1; i < mpisize; ++i) mpiWaitAny(rq); for(int i = 1; i < mpisize; ++i) { ThCurrent = meshTab[i]; Irecv(processor(i, mpiCommWorld, rq[i - 1]), uTab[i][]); } for(int i = 1; i < mpisize; ++i) mpiWaitAny(rq); for(int i = 0; i < mpisize; ++i) plot(uTab[i], wait = w, nbiso = 40, fill = 1, value = 1, dim = d, cmm = legend); } else { mpiRequest[int] rq(2); Isend(processor(0, rq[0]), Th); Isend(processor(0, rq[1]), u); mpiWait(rq[0]); mpiWait(rq[1]); }// EOM macro export(name, mesh, sol, fforder, comm) load "iovtk" savevtk(name + "_" + mpiRank(comm) + "_" + mpiSize(comm) + ".vtu", mesh, sol, order = fforder); if(mpiRank(comm) == 0) { ofstream pvd(name + "_" + mpiSize(comm) + ".pvd"); pvd << "\n"; pvd << "\n"; pvd << " \n"; for(int i = 0; i < mpiSize(comm); ++i) { pvd << " \n"; } pvd << " \n"; pvd << "\n"; } // EOM macro exportBegin(name, comm) load "iovtk" if(mpiRank(comm) == 0) { ofstream pvd(name + "_" + mpiSize(comm) + ".pvd"); pvd << "\n"; pvd << "\n"; pvd << " \n"; } // EOM macro exportTimeStep(name, mesh, sol, fforder, ts, comm) savevtk(name + "_" + int(ts) + "_" + mpiRank(comm) + "_" + mpiSize(comm) + ".vtu", mesh, sol, order = fforder); if(mpiRank(comm) == 0) { ofstream pvd(name + "_" + mpiSize(comm) + ".pvd", append); for(int ijk = 0; ijk < mpiSize(comm); ++ijk) { pvd << " \n"; } } // EOM macro exportEnd(name, comm) if(mpiRank(comm) == 0) { ofstream pvd(name + "_" + mpiSize(comm) + ".pvd", append); pvd << " \n"; pvd << "\n"; } // EOM macro partition(meshName, borderName, globalName, PhGlobal, VhGlobal, part, rank, size, s, overlap, D, Wh, P, arrayIntersection, restrictionIntersection, comm, fakeInterface, PkPart, defPart, initPart, bs) meshName = trunc(globalName, abs(part - rank) < 0.1, label = fakeInterface); mpiBarrier(comm); real timerPartition = mpiWtime(); { fespace PhLocal(meshName, P0); PhLocal overshoot = hTriangle; real max = 4.0 * overlap * overshoot[].max; bbN(meshName, max, globalName) } PhGlobal supp = abs(part - rank) < 0.1; VhGlobal suppSmooth; AddLayers(globalName, supp[], 2 * overlap, suppSmooth[]); { meshN neighbors = trunc(globalName, suppSmooth > 0.001); fespace Oh(neighbors, P0); Oh partOverlap = part; Unique(partOverlap[], arrayIntersection, remove = rank); } fespace VhLocal(meshName, P1); VhLocal[int] partitionIntersection(arrayIntersection.n); if(s > 1) { globalName = trunc(globalName, suppSmooth > 0.001, split = s); supp = abs(part - rank) < 0.1; suppSmooth = 0; AddLayers(globalName, supp[], 2 * overlap, suppSmooth[]); } globalName = trunc(globalName, suppSmooth > 0.001, label = 9999); real eps = intN(globalName)(1.0); real[int] epsTab(arrayIntersection.n); mpiRequest[int] rq(2 * arrayIntersection.n); if(mpiSize(comm) == size) { for(int j = 0; j < arrayIntersection.n; ++j) Irecv(processor(arrayIntersection[j], comm, rq[j]), epsTab[j]); for(int j = 0; j < arrayIntersection.n; ++j) Isend(processor(arrayIntersection[j], comm, rq[arrayIntersection.n + j]), eps); } else epsTab = 1.0e+30; supp = supp; suppSmooth = suppSmooth; meshName = trunc(globalName, suppSmooth > 0.501, label = fakeInterface); if(!removeZeros && (fakeInterface != -111111 || overlap != -1)) { if(suppSmooth[].min < 0.501) borderName = trunc(globalName, (suppSmooth > (overlap - 0.999) / (2 * overlap)) && (suppSmooth < 0.501), label = (abs(fakeInterface) + 1) * 100); } VhLocal khi = max(2 * suppSmooth - 1.0, 0.0); VhLocal sum = khi; VhGlobal phi = 0; part = part; int numberIntersection = 0; for(int k = 0; k < 2 * arrayIntersection.n; ++k) mpiWaitAny(rq); for(int i = 0; i < arrayIntersection.n; ++i) { PhGlobal suppPartition = abs(arrayIntersection[i] - part) < 0.1; AddLayers(globalName, suppPartition[], overlap, phi[]); if(min(eps, epsTab[i]) > 0.0) { real intersection = intN(globalName)(phi) / min(eps, epsTab[i]); if(intersection > 1.0e-6) { partitionIntersection[numberIntersection] = phi; if(!trueRestrict) sum[] += partitionIntersection[numberIntersection][]; arrayIntersection[numberIntersection++] = arrayIntersection[i]; } } } if(numberIntersection != arrayIntersection.n) arrayIntersection.resize(numberIntersection); restrictionIntersection.resize(numberIntersection); meshN[int] meshIntersection(numberIntersection); IFMACRO(vectorialfe) fespace singleComponentWh(meshName, vectorialfe); ENDIFMACRO for(int i = 0; i < numberIntersection; ++i) { meshIntersection[i] = trunc(meshName, partitionIntersection[i] > 1.0e-6, label = 9999); if(!removeZeros) { IFMACRO(vectorialfe) fespace WhIntersection(meshIntersection[i], vectorialfe); matrix R = interpolate(WhIntersection, singleComponentWh); ENDIFMACRO IFMACRO(!vectorialfe) fespace WhIntersection(meshIntersection[i], P); matrix R = interpolate(WhIntersection, Wh); ENDIFMACRO R.thresholding(1.0e-10); real[int] C; int[int] I; [I, restrictionIntersection[i], C] = R; restrictionIntersection[i].resize(R.nbcoef); } } partitionIntersection.resize(0); fespace WhPart(meshName, PkPart); WhPart defPart(func2vec); if(trueRestrict) { khi = abs(part - rank) < 0.1; VhLocal sigma = part; for(int i = 0; i < numberIntersection; ++i) { if(rank < arrayIntersection[i]) { for(int j = 0; j < VhLocal.ndof; ++j) { if(khi[][j] > 0.9 && abs(sigma[][j] - arrayIntersection[i]) < 0.1) khi[][j] = 0.0; } } } if(mpiSize(comm) == size && removeZeros) { meshN ThIntersection; fespace PhIntersection(ThIntersection, P0); PhIntersection[int] recv(numberIntersection); PhIntersection[int] send(numberIntersection); mpiRequest[int] rq(2 * numberIntersection); for(int i = 0; i < numberIntersection; ++i) { ThIntersection = meshIntersection[i]; Irecv(processor(arrayIntersection[i], comm, rq[i]), recv[i][]); send[i] = khi; Isend(processor(arrayIntersection[i], comm, rq[numberIntersection + i]), send[i][]); } meshName = trunc(meshName, khi > 1.0e-6, label = 9999); khi = khi; int[int] skip(0); for(int k = 0; k < 2 * numberIntersection; ++k) { int i = mpiWaitAny(rq); if(i < numberIntersection) { ThIntersection = meshIntersection[i]; PhIntersection intersection = send[i] > 1.0e-6 && recv[i] > 1.0e-6; if(intersection[].l2 > 1.0e-6) meshIntersection[i] = trunc(meshIntersection[i], intersection > 1.0e-6, label = 9999); else { skip.resize(skip.n + 1); skip[skip.n - 1] = i; } } } skip.sort; restrictionIntersection.resize(numberIntersection - skip.n); int j = 0; for(int i = 0; i < numberIntersection; ++i) { bool skipped = false; if(j < skip.n) { if(skip[j] == i) { ++j; skipped = true; } } if(!skipped) { IFMACRO(vectorialfe) fespace WhIntersection(meshIntersection[i], vectorialfe); matrix R = interpolate(WhIntersection, singleComponentWh); ENDIFMACRO IFMACRO(!vectorialfe) fespace WhIntersection(meshIntersection[i], P); matrix R = interpolate(WhIntersection, Wh); ENDIFMACRO R.thresholding(1.0e-10); real[int] C; int[int] I; [I, restrictionIntersection[i - j], C] = R; restrictionIntersection[i - j].resize(R.nbcoef); arrayIntersection[i - j] = arrayIntersection[i]; } } numberIntersection -= skip.n; arrayIntersection.resize(numberIntersection); if(fakeInterface != -111111 || overlap != -1) { PhGlobal suppPartition = khi > 0.1; AddLayers(globalName, suppPartition[], 1, phi[]); borderName = trunc(globalName, phi > 0.001 && phi < 0.501, label = (abs(fakeInterface) + 1) * 100); } } } else khi[] = khi[] ./= sum[]; IFMACRO(vectorialfe) if(bs > 1) for(int i = 0; i < numberIntersection; ++i) { int n = restrictionIntersection[i].n; restrictionIntersection[i].resize(n * bs); for(int j = n - 1; j != -1; --j) for(int k = bs - 1; k != -1; --k) restrictionIntersection[i][j * bs + k] = restrictionIntersection[i][j] * bs + k; } ENDIFMACRO defPart(func2vec) = initPart(khi); D.resize(Wh.ndof); D = func2vec[]; if(trueRestrict && ((WhPart.ndof % meshName.nt) == 0)) { defPart(func2vec) = initPart(abs(part - rank) < 0.1); D = func2vec[]; } // EOM macro buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, labPeriodic, userPartitioning, bs) { real timing = mpiWtime(); if(mpisize > 1 && !excluded) { fespace PhGlobal(ThGlobal, P0); fespace VhGlobal(ThGlobal, P1); PhGlobal partGlobal; if(userPartitioning.n != PhGlobal.ndof || labPeriodic.n > 0) { timing = mpiWtime(); meshN ThGlobalPeriodic; if(labPeriodic.n > 0) { VhGlobal marker; for(int i = 0; i < labPeriodic.n; ++i) { varf vMarker(u, v) = on(labPeriodic[i], u = 1.0); marker[] += vMarker(0, VhGlobal, tgv = -1); } PhGlobal partPeriodic = marker > 0.1; while(1) { AddLayers(ThGlobal, partPeriodic[], 1 + overlap, marker[]); partPeriodic = marker > 0.001; ThGlobalPeriodic = trunc(ThGlobal, partPeriodic < 0.999); if(ThGlobal.nt / real(ThGlobalPeriodic.nt) > mpisize / real(mpisize - 1)) break; } } if(mpiRank(comm) == 0) { if(verbosity > 0) cout.scientific << " --- global mesh of " << ThGlobal.nt << " elements (prior to refinement) partitioned with " << Stringification(partitioner); if(labPeriodic.n > 0) { fespace PhPeriodic(ThGlobalPeriodic, P0); PhPeriodic partPeriodic; if(mpiSize(comm) > 2) { partitionerSeq(partPeriodic[], ThGlobalPeriodic, mpiSize(comm) - 1); partPeriodic[] += 1.0; } else partPeriodic[] = 1.0; partGlobal = partPeriodic; } else partitionerSeq(partGlobal[], ThGlobal, mpiSize(comm)); } if(labPeriodic.n > 0 && Stringification(partitioner) != "metis" && Stringification(partitioner) != "scotch") { fespace PhPeriodic(ThGlobalPeriodic, P0); PhPeriodic partPeriodic; if(mpiSize(comm) > 2) { partitionerPar(partPeriodic[], ThGlobalPeriodic, comm, mpiSize(comm) - 1); partPeriodic[] += 1.0; } else partPeriodic[] = 1.0; partGlobal = partPeriodic; } else partitionerPar(partGlobal[], ThGlobal, comm, mpiSize(comm)); if(mpiRank(comm) == 0 && verbosity > 0) cout.scientific << " (in " << mpiWtime() - timing << ")" << endl; timing = mpiWtime(); } else { partGlobal[] = userPartitioning; broadcast(processor(0, comm), partGlobal[]); } IFMACRO(!trueRestrict) bool trueRestrict = usedARGV("-true_restrict") != -1; ENDIFMACRO IFMACRO(!removeZeros) bool removeZeros = trueRestrict && overlap == 1 && usedARGV("-remove_zeros") != -1; ENDIFMACRO partition(Th, ThBorder, ThGlobal, PhGlobal, VhGlobal, partGlobal, mpiRank(comm), mpiSize(comm), s, overlap, D, Wh, P, arrayIntersection, restrictionIntersection, comm, fakeInterface, PkPart, defPart, initPart, bs) } else if(mpisize == 1) { Th = ThGlobal; D.resize(Wh.ndof); D = 1.0; } mpiBarrier(mpiCommWorld); if(verbosity > 0 && mpirank == 0) cout.scientific << " --- partition of unity built (in " << mpiWtime() - timing << ")" << endl; }// EOM IFMACRO(vectorialfe) macro buildEdge(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, bs) { int[int] emptyArray(0); real[int] emptyRealArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, emptyRealArray, bs) }// EOM macro buildEdgeWithPartitioning(Th, ThBorder, ThGlobal, part, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, bs) { int[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, part, bs) }// EOM macro buildWithPartitioning(Th, ThBorder, ThGlobal, part, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, bs) { int[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, part, bs) }// EOM macro build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, bs) { int[int] emptyArray(0); real[int] emptyRealArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, emptyRealArray, bs) }// EOM macro buildPeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, labPeriodic, bs) { real[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, labPeriodic, emptyArray, bs) }// EOM macro buildEdgeWithPartitioningPETSc(Th, ThGlobal, part, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm, PkPart, defPart, initPart, bs) { int[int] emptyArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, part, bs) }// EOM macro buildWithPartitioningPETSc(Th, ThGlobal, part, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm, bs) { int[int] emptyArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, part, bs) }// EOM macro buildPETSc(Th, ThGlobal, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm, bs) { int[int] emptyArray(0); real[int] emptyRealArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, emptyRealArray, bs) }// EOM ENDIFMACRO IFMACRO(!vectorialfe) macro buildEdge(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart) { int[int] emptyArray(0); real[int] emptyRealArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, emptyRealArray, 1) }// EOM macro buildEdgeWithPartitioning(Th, ThBorder, ThGlobal, part, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart) { int[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, part, 1) }// EOM macro buildWithPartitioning(Th, ThBorder, ThGlobal, part, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded) { int[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, part, 1) }// EOM macro build(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded) { int[int] emptyArray(0); real[int] emptyRealArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, emptyRealArray, 1) }// EOM macro buildPeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, labPeriodic) { real[int] emptyArray(0); buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, labPeriodic, emptyArray, 1) }// EOM macro buildEdgeWithPartitioningPETSc(Th, ThGlobal, part, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm, PkPart, defPart, initPart) { int[int] emptyArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, PkPart, defPart, initPart, emptyArray, part, 1) }// EOM macro buildWithPartitioningPETSc(Th, ThGlobal, part, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm) { int[int] emptyArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, part, 1) }// EOM macro buildPETSc(Th, ThGlobal, s, D, arrayIntersection, restrictionIntersection, Wh, P, comm) { int[int] emptyArray(0); real[int] emptyRealArray(0); meshN ThBorder; int fakeInterface = -111111; int overlap = 1; bool excluded = false; buildEdgePeriodic(Th, ThBorder, ThGlobal, fakeInterface, s, overlap, D, arrayIntersection, restrictionIntersection, Wh, P, comm, excluded, P, def, init, emptyArray, emptyRealArray, 1) }// EOM ENDIFMACRO freefem++-3.61-1/examples++-hpddm/withPartitioning.edp000644 000767 000024 00000003601 13256636774 022716 0ustar00hechtstaff000000 000000 // run with MPI: ff-mpirun -np 2 script.edp // NBPROC 2 macro partitioner()scotch// EOM // metis, scotch, or parmetis macro dimension()3// EOM // 2D or 3D include "macro_ddm.idp" // additional DDM functions macro def(i)i// EOM // scalar field definition macro init(i)i// EOM // scalar field initialization macro def2(i)[i, i#B]// EOM macro init2(i)[i, i]// EOM func Pk = P1; // finite element space func Zk = [P1, P2]; // finite element space meshN Th = cube(1, 1, 1); fespace Wh(Th, Pk); // local finite element space fespace Qh(Th, Zk); // local finite element space int[int] arrayIntersection; // ranks of neighboring subdomains int[int][int] restrictionIntersectionP(0); // local-to-neighbors renumbering int[int][int] restrictionIntersectionZ(0); // local-to-neighbors renumbering real[int] DP; // partition of unity real[int] DZ; // partition of unity { int[int] l = [1, 1, 1, 1]; meshN ThBorder, ThGlobal = cube(getARGV("-global", 5), getARGV("-global", 5), getARGV("-global", 5)); // global mesh fespace Ph(ThGlobal, P0); real[int] part(Ph.ndof); if(mpirank == 0) partitionerSeq(part, ThGlobal, mpisize); buildWithPartitioning(Th, ThBorder, ThGlobal, part, 11111, 1, 1, DP, arrayIntersection, restrictionIntersectionZ, Wh, Pk, mpiCommWorld, false); ThGlobal = cube(getARGV("-global", 5), getARGV("-global", 5), getARGV("-global", 5)); // need to reload the global mesh because it is destroyed in ''build*'' buildEdgeWithPartitioning(Th, ThBorder, ThGlobal, part, 22222, 1, 1, DZ, arrayIntersection, restrictionIntersectionP, Qh, Zk, mpiCommWorld, false, Zk, def2, init2); ThBorder = cube(1, 1, 1); } freefem++-3.61-1/examples++-hpddm/schrodinger-1d-harmonic-oscillator-SLEPc.edp000644 000767 000024 00000016777 13256636774 027061 0ustar00hechtstaff000000 000000 // This codes shows how to calculate the eigenvalue spectrum of // the Schrodinger operator with quadratic potential (the // Quantum Harmonic Oscillator) on a psuedo-1d domain, using SLEPc. // // Here, we consider the problem of a 1d quantum harmonic oscillator: // -0.5 \nabla^2 u + 0.5*x^2* u = E u // since this is an hermitian operator, its eigenvalues E are real // The eigenspectrum is the set half integrers : // E_n = n+1/2 (n \in N) // // See e.g. : // - Chap. I in Quantum mechanics Vol. 1 by C. Cohen-Tannoudji, B. Diu, F. Laloe // - Landau & Lifshitz, Volume 3 : (Quantum Mechanics) Chap. III-23 // // Usage : // mpirun -np 4 FreeFem++-mpi -wg schrodinger-1d-harmonic-oscillator-SLEPc.edp \ // -split 1 -npts 1600 -nev 15 -sigma 0.0 // // Authors: Julien Garaud // Pierre Jolivet /**************************************/ /* Load PETSc & SLEPc macros */ /**************************************/ load "PETSc" // PETSc plugin load "SLEPc" // SLEPc plugin macro partitioner()metis// End Of Macro // metis, scotch, or parmetis macro dimension( )2// End Of Macro // 2D or 3D include "macro_ddm.idp" // Additional DDM functions macro def(i)i// EOM macro init(i)i// EOM func Pk = P1; // Finite-element space /***************************************/ /* Options for distributed solver */ /***************************************/ int s = getARGV("-split", 1) ; // Refinement factor // int Npts = getARGV("-npts" , 800) ; // Number of points on the perimeter real Lx = getARGV("-lx" , 40.0); // Dimension of the domain real Ly = getARGV("-ly" , 1) ; // Dimension of the domain // int nEV = getARGV("-nev" , 5) ; // Number of eigenvalues real sigma = getARGV("-sigma", 0.0) ; // Shift /***************************************/ /* Verbosity and passed options */ /***************************************/ if(verbosity > 0 && mpirank == 0) { cout << "********************************************" << endl << " --- " << mpirank << "/" << mpisize << "- schrodinger-1d-harmonic-oscillator-SLEPc.edp " << endl << "********************************************" << endl << "- input parameters: " << endl << " refinement factor = " << s << endl << "********************************************" << endl << " nb of pts on perimeter = " << Npts << " Domain size [Lx,Ly] = ["< A = vA(Vh,Vh); matrix B = vB(Vh,Vh); /***************************************/ /* Build distributed matrices */ /***************************************/ dmatrix DistA(A, arrayIntersection, restrictionIntersection, D, clean = true); dmatrix DistB(DistA, B, clean = true); /***************************************/ /* Problem resolution */ /***************************************/ real[int] EigenVAL(0); // array to store eigenvalues Vh[int] def(EigenVEC)(1); // array to store eigenvectors string ssparams = // Parameters for the distributed EigenValue solver " -eps_nev " + nEV + // Number of eigenvalues " -eps_type krylovschur" + " -eps_target "+ sigma + // Shift value " -st_type sinvert " + " -st_pc_type lu " + " -st_pc_factor_mat_solver_package mumps" + " -eps_view" + " -eps_gen_hermitian" // The problem is symmetric ; int k = deigensolver (DistA, // matrix OP = A − sigma*B DistB, // vectors = EigenVEC, // Array to store the FEM-EigenFunctions values = EigenVAL, // Array to store the EigenValues sparams = ssparams // Parameters for the distributed EigenValue solver ); k=min(k,nEV); // some time the number of converged eigen value // can be greater than nev; /***************************************/ /* View the solution */ /***************************************/ Vh Temp; for(int i=0;i> # PKGCOMMON_PACKTITLE corresponds to package names in [[file:getall]] download:: ../getall -o $(PKGCOMMON_PACKTITLE) -a $(PKGCOMMON_PACKAGES):download ## regle qui force le telecharmeent a l'install je vide F. H compilepkg:: # <> install::compilepkg # <> reinstall::compilepkg clean-local:: veryclean::clean -rm $(PKGCOMMON_PACKAGES) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/arpack/000755 000767 000024 00000000000 13321644110 016643 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/yams/000755 000767 000024 00000000000 13321644110 016353 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/AUTHORS000644 000767 000024 00000000547 13256636774 016510 0ustar00hechtstaff000000 000000 Library mmg3d, Authors: -- Dobrzynski Ccile -- Frey Pascal This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The licence will be CeCILL-C (see http://www.cecill.info/ for more detail.) freefem++-3.61-1/download/ff-petsc/000755 000767 000024 00000000000 13321644110 017111 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/headers-sparsesolver.inc000644 000767 000024 00000011351 13256636774 022267 0ustar00hechtstaff000000 000000 # BLAS #FFBLASINCLUDE = -I/Users/morice/librairie/PATCHVECLIB/ #FFBLASDIRLIBS = #FFBLASLIB = -L/Users/morice/librairie/PATCHVECLIB/ -lwrapperdotblas -framework veclib #FFBLASLIB2 = -lblas # LAPACK #FFLAPACKDIRLIBS = #FFLAPACKLIB = -framework veclib #FFLAPACKLIB2 = -llapack # MPI #FFMPIDIR = /Users/morice/librairie/openmpi-gcc-gfortran-4.4/ #FFMPIINCLUDE = -I/Users/morice/librairie/openmpi-gcc-gfortran-4.4/include/ #FFMPILIB = -L/Users/morice/librairie/openmpi-gcc-gfortran-4.4/lib/ -lmpi -lmpi_cxx -lopen-pal -lopen-rte -lotf -lvt #FFMPIDIRLIBS = /Users/morice/librairie/openmpi-gcc-gfortran-4.4/lib/ #FFMPILIB2 = mpi mpi_cxx open-pal open-rte otf vt # INT #pastix FFVERSIONINT = _long FFCTYPESINT = -DFORCE_LONG -DLONG #scotch FFINTSCOTCH = -DLONG #hips :: -DINTSIZE32, -DINTSIZE64 ou default FFINTHIPS = # particularite # FFLIBOTHERSMUMPS = -framework Carbon -framework AppKit #blasdef :: FFBLASDEF = -DUSE_VENDOR_BLAS #### parameter for blacs #### # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" FFDEFBSTOP = FFDEFCOMBTOP = # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- FFSENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- FFBUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. # TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- FFTRANSCOMM = -DUseMpi2 # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- FFWHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- FFSYSERRORS = freefem++-3.61-1/download/nlopt/000755 000767 000024 00000000000 13321644110 016536 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/metis/000755 000767 000024 00000000000 13321644110 016523 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/blacs/000755 000767 000024 00000000000 13321644110 016466 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/superlu/000755 000767 000024 00000000000 13321644110 017101 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/scotch/000755 000767 000024 00000000000 13321644110 016665 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/mmg3d/000755 000767 000024 00000000000 13321644110 016411 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/parms/000755 000767 000024 00000000000 13321644110 016524 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/ipopt/000755 000767 000024 00000000000 13321644110 016535 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/parmetis/000755 000767 000024 00000000000 13321644110 017226 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/f2c/000755 000767 000024 00000000000 13321644110 016054 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/Makefile.am000755 000767 000024 00000014705 13256636774 017500 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- # $Id: Makefile.am,v 1.16 2010/05/06 21:20:38 hecht Exp $ SUBDIRS=blas arpack umfpack EXTRA_DIST= \ ./nlopt/Make.inc ./nlopt/Makefile \ ./blacs/BLACS.patch \ ./blacs/BLACS_gridinit_.c-return-values.patch \ ./blacs/Bmake-blacs.inc \ ./blacs/Makefile \ ./f2c/Makefile \ ./f2c/Makefile-MacOs \ ./f2c/f2c.h-int \ ./f2c/fort77.sed \ ./f2c/tt.f \ ./fftw/Makefile.am \ ./fftw/Makefile.in \ ./gmm/Makefile \ ./gmm/cxxflags \ ./headers-sparsesolver.inc \ ./hips/Makefile \ ./hips/SRC_SPKIT_makefile \ ./hips/hips-1.2b-rc4.patch \ ./hips/makefile-hips.inc \ ./hypre/Makefile \ ./hypre/ff-flags.inc \ ./metis/Makefile \ ./metis/Makefile-metis.in \ ./metis/patch-metis \ ./metis/metis-4.0_main_return.patch \ ./mmg3d/Makefile \ ./mmg3d/patch-mmg3dv4.diff \ ./mshmet/Makefile \ ./mshmet/Makefile-mshmet.inc \ ./mshmet/mshmet.2011.03.06.patch \ ./mshmet/mshmet.2012.04.25_i586.patch \ ./mshmet/mshmetlib-internal.h \ ./mshmet/mshmetlib.c \ ./mshmet/mshmetlib.h \ ./mumps/Makefile \ ./mumps-seq/Makefile-mumps-5.0.2.inc \ ./mumps-seq/Makefile \ ./mumps/Makefile-mumps-5.0.2.inc \ ./parmetis/Makefile-parmetis.in \ ./parmetis/makefile \ ./parmetis/parmetis-4.0.3.patch \ ./parms/Makefile \ ./parms/makefile-parms.in \ ./pastix/Makefile \ ./pastix/config-pastix-complex.in \ ./pastix/config-pastix-real.in \ ./pastix/pastix_release_2200-blend.patch \ ./pastix/patch-pastix_long_complex.h \ ./pastix//all_macros.diff \ ./scalapack/Makefile \ ./scalapack/SLmake-scalapack.inc \ ./scotch/Makefile \ ./scotch/Makefile-scotch.inc \ ./scotch/Makefile.patch \ ./scotch/scotch_6.0.3.patch \ ./scotch/scotch_6.0.4.patch \ ./superlu/Makefile \ ./superlu/make.inc \ ./superludist/Makefile \ ./superludist/make-superlu.inc \ ./superludist/superludist_2.3.patch \ ./superludist/superludist_3.0-printf.patch \ ./superludist/superludist_3.0-cast_warning.patch \ ./superludist/superludist_3.0-return_values.patch \ ./superludist/superludist_3.0-operation_undefined.patch \ ./tetgen/Makefile \ ./tetgen/tetgen1.4.2.patch \ ./tetgen/patches.win64 \ ./yams/Makefile \ ./yams/freeyams.2012.02.05.patch \ ./yams/freeyams.2012.02.05-return-values.patch \ ./yams/makefile-yams.inc \ ./yams/yamslib.c \ ./yams/yamslib.h \ ./yams/yamslib_internal.h \ ipopt/Makefile \ ipopt/Makefile.inc.in \ ipopt/patch-IpBlas \ ff-petsc/Makefile \ ff-petsc/Makefile-PETSc.inc \ ff-petsc/Makefile.complex \ ff-petsc/patch-slepc-3.7.4 \ getall # FFCS: See [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be deactivated # <> blacs is included in scalapack 2.0.2 MPI_SOFT= scalapack @TOOL_COMPILE_superludist@ @TOOL_COMPILE_mumps@ \ @TOOL_COMPILE_pastix@ @TOOL_COMPILE_hips@ \ @TOOL_COMPILE_parms@ LIST_SOFT=@TOOL_COMPILE_tetgen@ @TOOL_COMPILE_parmetis@ @TOOL_COMPILE_superlu4@ fftw \ @TOOL_COMPILE_scotch@ @TOOL_COMPILE_mshmet@ \ @TOOL_COMPILE_yams@ @TOOL_COMPILE_mmg3d@ @TOOL_COMPILE_gmm@ \ @TOOL_COMPILE_nlopt@ @TOOL_COMPILE_mumps_seq@ \ @TOOL_COMPILE_ipopt@ all-recursive: bin lib include pkg lib: mkdir lib bin: mkdir bin include: mkdir include pkg: mkdir pkg # ALH - /download/yams and /download/mshmet need /src/libMesh/libmesh.a but /src is compiled after /download, so we # need to compile it now lib/libMesh.a:lib include cd ../src/libMesh && $(MAKE) $(AM_MAKEFLAGS) test -f ../src/libMesh/libMesh.a mkdir -p include/libMesh cp ../src/libMesh/*h include/libMesh echo libMesh LD -L@DIR@/lib -lMesh > lib/WHERE.libMesh echo libMesh INCLUDE -I@DIR@/include/libMesh >> lib/WHERE.libMesh cp ../src/libMesh/libMesh.a lib/libMesh.a all-local:bin lib include lib/libMesh.a pkg $(DOWNLOADCOMPILE) install-other install-other: tag-install-other tag-install-other: if test -n "$(TOOL_COMPILE_hpddm)" ; then $(MAKE) install-hpddm; else true; fi touch tag-install-other WHERE-OTHER: lib/WHERE.hpddm WHERE-LD: tag-compile-pkg WHERE-OTHER touch ../examples++-load/WHERE_LIBRARY-config ../examples++-load/WHERE_LIBRARY grep LD ../examples++-load/WHERE_LIBRARY ../examples++-load/WHERE_LIBRARY-config >WHERE-LD install-hpddm: ./getall if test -n "$(TOOL_COMPILE_hpddm)"; then ./getall -o hpddm -a; $(MAKE) include/hpddm/done.tag lib/WHERE.hpddm; else true;fi reinstall-hpddm:./getall -rm lib/WHERE.hpddm -rm ./pkg/hpddm.zip -rm -rf include/hpddm -test -n "$(TOOL_COMPILE_hpddm)" && $(MAKE) install-hpddm || true include/hpddm/done.tag:./pkg/hpddm.zip -if test -f ./pkg/hpddm.zip ; then \ cd include;rm -rf hpddm hpddm-*; unzip ../pkg/hpddm.zip ; mv hpddm-* hpddm ; touch hpddm/done.tag; \ else true; fi lib/WHERE.hpddm: ./getall if test -d include/hpddm/include ; then \ echo hpddm LD -L@DIR@/lib > $@ ;\ echo hpddm INCLUDE -I@DIR@/include/hpddm/include >> $@ ;\ elif test -d include/hpddm/src ; then \ echo hpddm LD -L@DIR@/lib > $@ ;\ echo hpddm INCLUDE -I@DIR@/include/hpddm/src >> $@ ;\ else true; fi # FFCS: need to stop at the first error to make sure that all libraries are correctly compiled compile-dir: @echo "\n\n ****** $(COMPILEDIR) ****** \n\n"; @if [ 0 -eq `egrep ':$(COMPILEDIR) *LD' WHERE-LD | wc -l` ] ;then \ cd $(COMPILEDIR) && $(MAKE) $(DIRTARGET) ; \ else \ echo $(COMPILEDIR) is in WHERE- files ;\ fi compile-pkg: tag-compile-pkg WHERE-LD # FFCS: need to stop at the first error to make sure that all libraries are correctly compiled tag-compile-pkg: bin lib include pkg FORCE @if [ -n "$(WGET)" ] ; then \ for d in $(LIST_SOFT) ; do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1;done ;\ if [ -n "$(MPICC)" ] ; then \ for d in $(MPI_SOFT) ; do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1; done;\ fi;fi $(MAKE) install-hpddm touch tag-compile-pkg FORCE: re-install: $(MAKE) compile-pkg DIRTARGET=install WHERE: $(MAKE) compile-pkg DIRTARGET=WHERE install-exec-local: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/bin $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include cp -rp lib $(DESTDIR)$(ff_prefix_dir) cp -rp include $(DESTDIR)$(ff_prefix_dir) cp -rp bin $(DESTDIR)$(ff_prefix_dir) clean-local: -rm -rf tag-* include lib bin -mkdir include lib bin -rm */FAIT */FAIRE # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) for d in $(LIST_SOFT) $(MPI_SOFT) ; do $(MAKE) clean -C $$d ; done freefem++-3.61-1/download/tetgen/000755 000767 000024 00000000000 13321644110 016670 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/hips/000755 000767 000024 00000000000 13321644110 016345 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/mshmet/000755 000767 000024 00000000000 13321644110 016677 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/superludist/000755 000767 000024 00000000000 13321644110 017765 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/hypre/000755 000767 000024 00000000000 13321644110 016531 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/mumps-seq/000755 000767 000024 00000000000 13321644110 017331 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/fftw/000755 000767 000024 00000000000 13321644110 016350 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/mumps/000755 000767 000024 00000000000 13321644110 016543 5ustar00hechtstaff000000 000000 freefem++-3.61-1/download/getall000755 000767 000024 00000031711 13321622623 016610 0ustar00hechtstaff000000 000000 #!/usr/bin/perl ############################################################################ # 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 3 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, see . # ############################################################################ # SUMMARY : Download third-party packages independently of FF configuration # LICENSE : LGPLv3 # ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE # AUTHORS : Antoine Le Hyaric # E-MAIL : http://www.ljll.math.upmc.fr/lehyaric use strict; use Getopt::Std; use Digest::MD5 qw(md5_hex); # [[http://perldoc.perl.org/Digest/MD5.html]] # This download script needs to be able to work on platforms that do not have threads (eg Mingw). my $can_use_threads=eval 'use threads;use threads::shared;1'; my %opts; getopts('afho:',\%opts); if($opts{h}){ print <create(\&downloadone,$_)} foreach(@threads){$_->join()} } else{ foreach(@downloads){downloadone($_)} } if($errors ne ''){ print "\n$errors"; exit 1; } sub download{ my($title,$url,$lic,$pkg,$md5,$opts)=@_; # skip packages that have not been requested explicitely return if($only && !defined $packs{$title}); # skip packages that are already present if(-f "pkg/$pkg" && !$opts{f}){ my $md5check=md5_hex(`cat pkg/$pkg`); if( ( $md5 eq "none") || ($md5check eq $md5)){ print "$title $pkg done\n"; return; } else { print "$title $pkg md5 change => reget \n"; } } # we do not store the answers to these questions. To repeat the same downloads without manual input, options "-a" and # "-o names" are provided. if(!$opts{a}){ print "$title: please check the licence at $lic. Do you want to download $url? (yN)\n"; my $ans=uc ; chomp $ans; return if $ans ne 'Y'; } # uses [[file:../build/download]] push @downloads,"$url,pkg/$pkg,$md5,$opts"; } sub downloadone{ my($url,$pkg,$md5,$opts)=split(/,/,$_[0]); my $cmd="../build/download $url $pkg $opts"; print "$cmd\n"; system $cmd; if($?){ print "Download failed from $url\n"; my $url="http://www.freefem.org/ff++/$pkg"; my $cmd="../build/download $url $pkg $opts"; print "Try other site: $url\n"; system $cmd; if($?){ print "Download failed from $url\n"; my $url="http://104.46.50.187/$pkg"; my $cmd="../build/download $url $pkg $opts"; print "Try other site: $url\n"; system $cmd; if ($?){ $errors.="ERROR: $cmd FAILED\n" } } } # check if resulting package contents are valid my $md5check=md5_hex(`cat $pkg`); if( ( $md5 ne "none") && ($md5check ne $md5)){$errors.="ERROR: INVALID MD5 for $pkg $md5check\n"} } # Backup #download('METIS','http://www.netlib.org/linalg/metis-4.0.tar.gz','http://www.netlib.org/linalg/','metis-4.0.tar.gz', # '0aa546419ff7ef50bd86ce1ec7f727c7'); #download('ParMETIS','http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/OLD/ParMetis-3.1.1.tar.gz', # 'http://glaros.dtc.umn.edu/gkhome/views/metis','ParMetis-3.1.1.tar.gz','57318dbaddff2c3d1ef820cff0bf87b0'); # http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz #download('MUMPS','http://graal.ens-lyon.fr/MUMPS/MUMPS_4.10.0.tar.gz', # 'http://graal.ens-lyon.fr/MUMPS/','MUMPS_4.10.0.tar.gz','959e9981b606cd574f713b8422ef0d9f'); #download('MUMPS','http://graal.ens-lyon.fr/MUMPS/MUMPS_5.0.0.tar.gz', # 'http://graal.ens-lyon.fr/MUMPS/','MUMPS_5.0.0.tar.gz','3c6aeab847e9d775ca160194a9db2b75'); #download('MUMPS','http://graal.ens-lyon.fr/MUMPS/MUMPS_5.0.1.tar.gz', # 'http://graal.ens-lyon.fr/MUMPS/','MUMPS_5.0.1.tar.gz','b477573fdcc87babe861f62316833db0'); # ALH - 6/1/14 - web certificate for gforge.inria.fr is rejected # ALH - 6/1/14 - web certificate for gforge.inria.fr is rejected #https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz #download('Scotch','https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz', # 'https://gforge.inria.fr/projects/scotch/','scotch_6.0.3.tar.gz','10b0cc0f184de2de99859eafaca83cfc', # 'BAD_CERT'); # download('SuiteSparse','http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-4.3.1.tar.gz', # 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/','SuiteSparse-4.3.1.tar.gz', # 'f8f26a3b1c7f82444c0db0b375215287'); # reput version 4.4.4 of umpfack pb of install under windows ... F. H. # 'http://faculty.cse.tamu.edu/davis/SuiteSparse/','SuiteSparse-4.5.5.tar.gz', # '0a5b38af0016f009409a9606d2f1b555') ; #download('SuperLU','http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz', # 'http://crd-legacy.lbl.gov/~xiaoye/SuperLU/','superlu_4.3.tar.gz','b72c6309f25e9660133007b82621ba7c'); # PB SuperLU_DIST with version 5.2.1 -> return to verison 3.0 # DO F. HECHT but no time #download('SuperLU_DIST','http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_5.2.1.tar.gz', # 'http://crd-legacy.lbl.gov/~xiaoye/SuperLU/','superlu_dist_5.2.1.tar.gz','af857778ffeb04aea02aa4843e6e8e1d'); # http://www.tetgen.org/1.5/src/tetgen1.5.1-beta1.tar.gz #download('TetGen','http://wias-berlin.de/software/tetgen/files/tetgen1.4.3.tar.gz', # 'http://wias-berlin.de/software/tetgen/','tetgen1.4.3.tar.gz','d6a4bcdde2ac804f7ec66c29dcb63c18'); ## got back to version 3.8 (for slepc and petc ) #download('PETSc','http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.9.0.tar.gz', # 'http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/','petsc-lite-3.9.0.tar.gz','6958049cafdbb7586c50e09b54e6fce9'); freefem++-3.61-1/download/Makefile.in000644 000767 000024 00000073214 13321623166 017466 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Downloading and compiling extra libraries # ----------------------------------------- # $Id: Makefile.am,v 1.16 2010/05/06 21:20:38 hecht Exp $ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = download ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ AUTHORS DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = blas arpack umfpack EXTRA_DIST = \ ./nlopt/Make.inc ./nlopt/Makefile \ ./blacs/BLACS.patch \ ./blacs/BLACS_gridinit_.c-return-values.patch \ ./blacs/Bmake-blacs.inc \ ./blacs/Makefile \ ./f2c/Makefile \ ./f2c/Makefile-MacOs \ ./f2c/f2c.h-int \ ./f2c/fort77.sed \ ./f2c/tt.f \ ./fftw/Makefile.am \ ./fftw/Makefile.in \ ./gmm/Makefile \ ./gmm/cxxflags \ ./headers-sparsesolver.inc \ ./hips/Makefile \ ./hips/SRC_SPKIT_makefile \ ./hips/hips-1.2b-rc4.patch \ ./hips/makefile-hips.inc \ ./hypre/Makefile \ ./hypre/ff-flags.inc \ ./metis/Makefile \ ./metis/Makefile-metis.in \ ./metis/patch-metis \ ./metis/metis-4.0_main_return.patch \ ./mmg3d/Makefile \ ./mmg3d/patch-mmg3dv4.diff \ ./mshmet/Makefile \ ./mshmet/Makefile-mshmet.inc \ ./mshmet/mshmet.2011.03.06.patch \ ./mshmet/mshmet.2012.04.25_i586.patch \ ./mshmet/mshmetlib-internal.h \ ./mshmet/mshmetlib.c \ ./mshmet/mshmetlib.h \ ./mumps/Makefile \ ./mumps-seq/Makefile-mumps-5.0.2.inc \ ./mumps-seq/Makefile \ ./mumps/Makefile-mumps-5.0.2.inc \ ./parmetis/Makefile-parmetis.in \ ./parmetis/makefile \ ./parmetis/parmetis-4.0.3.patch \ ./parms/Makefile \ ./parms/makefile-parms.in \ ./pastix/Makefile \ ./pastix/config-pastix-complex.in \ ./pastix/config-pastix-real.in \ ./pastix/pastix_release_2200-blend.patch \ ./pastix/patch-pastix_long_complex.h \ ./pastix//all_macros.diff \ ./scalapack/Makefile \ ./scalapack/SLmake-scalapack.inc \ ./scotch/Makefile \ ./scotch/Makefile-scotch.inc \ ./scotch/Makefile.patch \ ./scotch/scotch_6.0.3.patch \ ./scotch/scotch_6.0.4.patch \ ./superlu/Makefile \ ./superlu/make.inc \ ./superludist/Makefile \ ./superludist/make-superlu.inc \ ./superludist/superludist_2.3.patch \ ./superludist/superludist_3.0-printf.patch \ ./superludist/superludist_3.0-cast_warning.patch \ ./superludist/superludist_3.0-return_values.patch \ ./superludist/superludist_3.0-operation_undefined.patch \ ./tetgen/Makefile \ ./tetgen/tetgen1.4.2.patch \ ./tetgen/patches.win64 \ ./yams/Makefile \ ./yams/freeyams.2012.02.05.patch \ ./yams/freeyams.2012.02.05-return-values.patch \ ./yams/makefile-yams.inc \ ./yams/yamslib.c \ ./yams/yamslib.h \ ./yams/yamslib_internal.h \ ipopt/Makefile \ ipopt/Makefile.inc.in \ ipopt/patch-IpBlas \ ff-petsc/Makefile \ ff-petsc/Makefile-PETSc.inc \ ff-petsc/Makefile.complex \ ff-petsc/patch-slepc-3.7.4 \ getall # FFCS: See [[file:../../../configure.ac::tools_problems_all_platforms]] for reasons why some tools may be deactivated # <> blacs is included in scalapack 2.0.2 MPI_SOFT = scalapack @TOOL_COMPILE_superludist@ @TOOL_COMPILE_mumps@ \ @TOOL_COMPILE_pastix@ @TOOL_COMPILE_hips@ \ @TOOL_COMPILE_parms@ LIST_SOFT = @TOOL_COMPILE_tetgen@ @TOOL_COMPILE_parmetis@ @TOOL_COMPILE_superlu4@ fftw \ @TOOL_COMPILE_scotch@ @TOOL_COMPILE_mshmet@ \ @TOOL_COMPILE_yams@ @TOOL_COMPILE_mmg3d@ @TOOL_COMPILE_gmm@ \ @TOOL_COMPILE_nlopt@ @TOOL_COMPILE_mumps_seq@ \ @TOOL_COMPILE_ipopt@ 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu download/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu download/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 $(am__aclocal_m4_deps): # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ check check-am clean clean-generic clean-local cscopelist-am \ ctags ctags-am distclean distclean-generic 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-exec-local \ 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 pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile all-recursive: bin lib include pkg lib: mkdir lib bin: mkdir bin include: mkdir include pkg: mkdir pkg # ALH - /download/yams and /download/mshmet need /src/libMesh/libmesh.a but /src is compiled after /download, so we # need to compile it now lib/libMesh.a:lib include cd ../src/libMesh && $(MAKE) $(AM_MAKEFLAGS) test -f ../src/libMesh/libMesh.a mkdir -p include/libMesh cp ../src/libMesh/*h include/libMesh echo libMesh LD -L@DIR@/lib -lMesh > lib/WHERE.libMesh echo libMesh INCLUDE -I@DIR@/include/libMesh >> lib/WHERE.libMesh cp ../src/libMesh/libMesh.a lib/libMesh.a all-local:bin lib include lib/libMesh.a pkg $(DOWNLOADCOMPILE) install-other install-other: tag-install-other tag-install-other: if test -n "$(TOOL_COMPILE_hpddm)" ; then $(MAKE) install-hpddm; else true; fi touch tag-install-other WHERE-OTHER: lib/WHERE.hpddm WHERE-LD: tag-compile-pkg WHERE-OTHER touch ../examples++-load/WHERE_LIBRARY-config ../examples++-load/WHERE_LIBRARY grep LD ../examples++-load/WHERE_LIBRARY ../examples++-load/WHERE_LIBRARY-config >WHERE-LD install-hpddm: ./getall if test -n "$(TOOL_COMPILE_hpddm)"; then ./getall -o hpddm -a; $(MAKE) include/hpddm/done.tag lib/WHERE.hpddm; else true;fi reinstall-hpddm:./getall -rm lib/WHERE.hpddm -rm ./pkg/hpddm.zip -rm -rf include/hpddm -test -n "$(TOOL_COMPILE_hpddm)" && $(MAKE) install-hpddm || true include/hpddm/done.tag:./pkg/hpddm.zip -if test -f ./pkg/hpddm.zip ; then \ cd include;rm -rf hpddm hpddm-*; unzip ../pkg/hpddm.zip ; mv hpddm-* hpddm ; touch hpddm/done.tag; \ else true; fi lib/WHERE.hpddm: ./getall if test -d include/hpddm/include ; then \ echo hpddm LD -L@DIR@/lib > $@ ;\ echo hpddm INCLUDE -I@DIR@/include/hpddm/include >> $@ ;\ elif test -d include/hpddm/src ; then \ echo hpddm LD -L@DIR@/lib > $@ ;\ echo hpddm INCLUDE -I@DIR@/include/hpddm/src >> $@ ;\ else true; fi # FFCS: need to stop at the first error to make sure that all libraries are correctly compiled compile-dir: @echo "\n\n ****** $(COMPILEDIR) ****** \n\n"; @if [ 0 -eq `egrep ':$(COMPILEDIR) *LD' WHERE-LD | wc -l` ] ;then \ cd $(COMPILEDIR) && $(MAKE) $(DIRTARGET) ; \ else \ echo $(COMPILEDIR) is in WHERE- files ;\ fi compile-pkg: tag-compile-pkg WHERE-LD # FFCS: need to stop at the first error to make sure that all libraries are correctly compiled tag-compile-pkg: bin lib include pkg FORCE @if [ -n "$(WGET)" ] ; then \ for d in $(LIST_SOFT) ; do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1;done ;\ if [ -n "$(MPICC)" ] ; then \ for d in $(MPI_SOFT) ; do $(MAKE) compile-dir COMPILEDIR=$$d || exit 1; done;\ fi;fi $(MAKE) install-hpddm touch tag-compile-pkg FORCE: re-install: $(MAKE) compile-pkg DIRTARGET=install WHERE: $(MAKE) compile-pkg DIRTARGET=WHERE install-exec-local: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/lib $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/bin $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/include cp -rp lib $(DESTDIR)$(ff_prefix_dir) cp -rp include $(DESTDIR)$(ff_prefix_dir) cp -rp bin $(DESTDIR)$(ff_prefix_dir) clean-local: -rm -rf tag-* include lib bin -mkdir include lib bin -rm */FAIT */FAIRE # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) for d in $(LIST_SOFT) $(MPI_SOFT) ; do $(MAKE) clean -C $$d ; done # 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: freefem++-3.61-1/download/mumps/Makefile000644 000767 000024 00000006024 13256636774 020235 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc include Makefile.inc all-local: mumps # Downloading and compiling mumps # ------------------------------- DIRPKG=../pkg SRCDIR=MUMPS_$(VERSION) PACKAGE1=$(DIRPKG)/MUMPS_$(VERSION).tar.gz VERSION=5.0.2 mumps:../lib/WHERE.mumps $(SRCDIR)/FAIT: $(SRCDIR)/tag-tar cp Makefile.inc $(SRCDIR) # # ALH - 'd' and 'z' versions need to be made sequentially # cd $(SRCDIR);make d cd $(SRCDIR);make z touch $@ # ALH - WHERE was not built properly during a full compile from a clean source. This goal has been rewritten to solve # this issue. ../lib/WHERE.mumps:install.done echo mumps LD -L@DIR@/lib -ldmumpsFREEFEM -lzmumpsFREEFEM -lmumps_commonFREEFEM -lpordFREEFEM $(LIBSPTHREAD) > $@ echo mumps INCLUDE -I@DIR@/include >> $@ install.done:$(SRCDIR)/FAIT -mkdir -p ../include/libseq cp $(SRCDIR)/include/*.h ../include/ cp $(SRCDIR)/libseq/*.h ../include/libseq -mkdir -p ../lib cp $(SRCDIR)/lib/*.a ../lib/ cp $(SRCDIR)/libseq/libmpiseqFREEFEM.a ../lib/ touch $@ FAIRE-$(VERSION):WHERE touch FAIRE-$(VERSION) # ALH - "make d" and "make z" need to be done sequentially $(SRCDIR)/FAIT:$(SRCDIR)/tag-tar Makefile.inc cp Makefile.inc $(SRCDIR) cd $(SRCDIR) && $(MAKE) d cd $(SRCDIR) && $(MAKE) z touch $@ Makefile.inc:../../config.status Makefile Makefile-mumps-$(VERSION).inc ../../config.status --file="Makefile.inc:Makefile-mumps-$(VERSION).inc" $(SRCDIR)/tag-tar:$(PACKAGE1) tar xvzf $(PACKAGE1) #patch -d MUMPS_$(VERSION) -p 1 < MUMPS_$(VERSION).patch touch $(SRCDIR)/tag-tar clean:clean-local clean-local: #FH -cd $(SRCDIR) && $(MAKE) clean -C $(SRCDIR) -rm Makefile.inc FAIRE* ../lib/WHERE.mumps -rm -rf ../include/*mumps* -rm -rf ../lib/lib*mumpsFREEFEM* ../lib/libpordFREEFEM.a ../lib/libmpiseqFREEFEM.a -rm -rf $(SRCDIR) # -rm $(PACKAGE1) -rm config.log *.done # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/mumps/Makefile-mumps-5.0.2.inc000644 000767 000024 00000013544 13256636774 022611 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ DOWNLOADFF= $(abs_top_builddir)/download # # This file is part of MUMPS 5.0.1, built on Tue May 10 12:56:32 UTC 2011 # ################################################################################ # # Makefile.inc.generic # # This defines some parameters dependent on your platform; you should # look for the approriate file in the directory ./Make.inc/ and copy it # into a file called Makefile.inc. For example, from the MUMPS root # directory, use # "cp Make.inc/Makefile.inc.generic ./Makefile.inc" # (see the main README file for details) # # If you do not find any suitable Makefile in Makefile.inc, use this file: # "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according # to the comments given below. If you manage to build MUMPS on a new platform, # and think that this could be useful to others, you may want to send us # the corresponding Makefile.inc file. # ################################################################################ ######################################################################## #Begin orderings # # NOTE that PORD is distributed within MUMPS by default. If you would like to # use other orderings, you need to obtain the corresponding package and modify # the variables below accordingly. # For example, to have Metis available within MUMPS: # 1/ download Metis and compile it # 2/ uncomment (suppress # in first column) lines # starting with LMETISDIR, LMETIS # 3/ add -Dmetis in line ORDERINGSF # ORDERINGSF = -Dpord -Dmetis # 4/ Compile and install MUMPS # make clean; make (to clean up previous installation) # # Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 5.1 and later) orderings are now available for MUMPS. # SCOTCHDIR = $(DOWNLOADFF)/ ISCOTCH = -I$(SCOTCHDIR)/include/scotch # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dptscotch in the ORDERINGSF variable below) #LSCOTCH = -L$(SCOTCHDIR)/lib/scotch/ -lesmumps -lscotch -lscotcherr LSCOTCH = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr LPORDDIR = $(topdir)/PORD/lib/ IPORD = -I$(topdir)/PORD/include/ LPORD = -L$(LPORDDIR) -lpord LMETISDIR = $(DOWNLOADFF) #IMETIS = # Metis doesn't need include files (Fortran interface avail.) # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dparmetis in the ORDERINGSF variable below) LMETIS = #-L$(LMETISDIR)/lib -lparmetis -lmetis # The following variables will be used in the compilation process. # Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively. ORDERINGSF = -Dscotch -Dpord #ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis #ORDERINGSF = -Dpord ORDERINGSC = $(ORDERINGSF) LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) IORDERINGSF = $(ISCOTCH) IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) #End orderings ######################################################################## # DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC... # PLAT : use it to add a default suffix to the generated libraries PLAT = FREEFEM # Library extension, + C and Fortran "-o" option # may be different under Windows LIBEXT = .a OUTC = -o OUTF = -o # RM : remove files RM = /bin/rm -f # CC : C compiler CC = @CC@ # FC : Fortran 90 compiler FC = @FC@ # FL : Fortran linker FL = @FC@ # AR : Archive object in a library # keep a space at the end if options have to be separated from lib name AR = @AR@ @ARFLAGS@ # RANLIB : generate index of an archive file # (optionnal use "RANLIB = echo" in case of problem) RANLIB = @RANLIB@ #RANLIB = echo # SCALAP should define the SCALAPACK and BLACS libraries. SCALAPDIR = $(DOWNLOADFF)/lib/scalapack/ SCALAP = $(FFBLASLIB) -L$(SCALAPDIR) -lscalapack -L$(DOWNLOADFF)/lib/blacs/ -lblacs_MPI-$(PLAT)-0 -lblacsF77init_MPI-$(PLAT)-0 -lblacsCinit_MPI-$(PLAT)-0 # INCLUDE DIRECTORY FOR MPI INCPAR = $(FFMPIINCLUDE) # LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI LIBPAR = $(SCALAP) $(FFMPILIB) # The parallel version is not concerned by the next two lines. # They are related to the sequential library provided by MUMPS, # to use instead of ScaLAPACK and MPI. INCSEQ = -I$(topdir)/libseq LIBSEQ = -L$(topdir)/libseq -lmpiseq # DEFINE HERE YOUR BLAS LIBRARY LIBBLAS = @BLASLIBS@ # DEFINE YOUR PTHREAD LIBRARY LIBOTHERS = @LIBSPTHREAD@ @FLIBS@ $(FFLIBOTHERSMUMPS) LIBSPTHREAD = @LIBSPTHREAD@ # FORTRAN/C COMPATIBILITY: # Use: # -DAdd_ if your Fortran compiler adds an underscore at the end # of symbols, # -DAdd__ if your Fortran compiler adds 2 underscores, # # -DUPPER if your Fortran compiler uses uppercase symbols # # leave empty if your Fortran compiler does not change the symbols. # CDEFS = @CFLAGSF77@ #COMPILER OPTIONS # FFCS - 23/4/13 - -fno-range-check required on MinGW to compile with # Microsoft MPI. mpif.h contains INTEGER MPI_FLOAT_INT / PARAMETER # (MPI_FLOAT_INT=z'8c000000') which requires this. OPTF = -O @FFLAGS@ @MPI_INCLUDE@ @NO_RANGE_CHECK@ OPTC = -O -I. @CFLAGS@ @MPI_INCLUDE@ OPTL = -O @FFLAGS@ @MPI_LIBFC@ # CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION. #Sequential: #INCS = $(INCSEQ) #LIBS = $(LIBSEQ) #LIBSEQNEEDED = libseqneeded #Parallel: INCS = $(INCPAR) LIBS = $(LIBPAR) LIBSEQNEEDED = libseqneeded WGET = @WGET@freefem++-3.61-1/download/fftw/Makefile.am000644 000767 000024 00000002252 13256636774 020435 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- all-local: $(DOWNLOAD_FFTW) # Downloading and compiling FFTW # ------------------------------ # FFTW information FFTW_VERSION=3.3.2 SRCDIR=fftw-$(FFTW_VERSION) PACKAGE=fftw-$(FFTW_VERSION).tar.gz SERVER=http://www.fftw.org THIS=fftw3 fftw: $(SRCDIR)/FAIT WHERE $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT $(SRCDIR)/FAIT-1:../pkg/$(PACKAGE) tar xvzf ../pkg/$(PACKAGE) touch $(SRCDIR)/FAIT-1 ../pkg/$(PACKAGE): -mkdir ../pkg cd ../pkg;@WGET@ -N $(SERVER)/$(PACKAGE) WHERE:$(SRCDIR)/FAIT -if [ $(SRCDIR)/FAIT ] ; then \ echo $(THIS) LD -L@DIR@/lib -l$(THIS) >../lib/WHERE.$(THIS) ;\ echo $(THIS) INCLUDE -I@DIR@/include >> ../lib/WHERE.$(THIS) ;\ fi clean-local: -rm -rf fftw-* -rm ../include/fftw3.f ../include/fftw3.f03 ../include/fftw3.h ../include/fftw3l.f03 ../include/fftw3q.f03 \ ../lib/libfftw3.a ../lib/libfftw3.la freefem++-3.61-1/download/fftw/Makefile.in000644 000767 000024 00000044121 13321623167 020430 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Downloading and compiling extra libraries # ----------------------------------------- VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = download/fftw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = fftw-$(FFTW_VERSION).tar.gz PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Downloading and compiling FFTW # ------------------------------ # FFTW information FFTW_VERSION = 3.3.2 SRCDIR = fftw-$(FFTW_VERSION) SERVER = http://www.fftw.org THIS = fftw3 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu download/fftw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu download/fftw/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ 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 pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile all-local: $(DOWNLOAD_FFTW) fftw: $(SRCDIR)/FAIT WHERE $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT $(SRCDIR)/FAIT-1:../pkg/$(PACKAGE) tar xvzf ../pkg/$(PACKAGE) touch $(SRCDIR)/FAIT-1 ../pkg/$(PACKAGE): -mkdir ../pkg cd ../pkg;@WGET@ -N $(SERVER)/$(PACKAGE) WHERE:$(SRCDIR)/FAIT -if [ $(SRCDIR)/FAIT ] ; then \ echo $(THIS) LD -L@DIR@/lib -l$(THIS) >../lib/WHERE.$(THIS) ;\ echo $(THIS) INCLUDE -I@DIR@/include >> ../lib/WHERE.$(THIS) ;\ fi clean-local: -rm -rf fftw-* -rm ../include/fftw3.f ../include/fftw3.f03 ../include/fftw3.h ../include/fftw3l.f03 ../include/fftw3q.f03 \ ../lib/libfftw3.a ../lib/libfftw3.la # 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: freefem++-3.61-1/download/mumps-seq/Makefile000644 000767 000024 00000005771 13256636774 021033 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc # Downloading and compiling extra libraries # ----------------------------------------- include Makefile.inc all-local: mumps mumps:../lib/WHERE.mumpsseq # Downloading and compiling mumps # ------------------------------- DIRPKG=../pkg SRCDIR=MUMPS_$(VERSION) PACKAGE1=$(DIRPKG)/MUMPS_$(VERSION).tar.gz INSTALL=../.. VERSION=5.0.2 # FFCS - install and WHERE need to be done sequentially, even in parallel builds ../lib/WHERE.mumpsseq: install.done echo mumps_seq LD -L@DIR@/lib -ldmumpsFREEFEM-SEQ -lzmumpsFREEFEM-SEQ -lmumps_commonFREEFEM-SEQ \ -lpordFREEFEM-SEQ $(LIBSPTHREAD) > ../lib/WHERE.mumpsseq echo mumps_seq INCLUDE -I@DIR@/include/mumps_seq >> ../lib/WHERE.mumpsseq echo libseq LD -L@DIR@/lib -lmpiseqFREEFEM-SEQ >>../lib/WHERE.mumpsseq echo libseq INCLUDE -I@DIR@/include -I@DIR@/include/mumps_seq >> ../lib/WHERE.mumpsseq install.done: $(SRCDIR)/FAIT -mkdir -p ../include/mumps_seq cp $(SRCDIR)/include/*.h ../include/mumps_seq cp $(SRCDIR)/libseq/*.h ../include/mumps_seq -mkdir -p ../lib cp $(SRCDIR)/lib/*.a ../lib/ cp $(SRCDIR)/libseq/libmpiseqFREEFEM-SEQ.a ../lib/ touch $@ $(SRCDIR)/FAIT:Makefile.inc cp Makefile.inc $(SRCDIR) # # FFCS - 22/5/12 - Mumps has difficulties compiling d & z in parallel # cd $(SRCDIR) && $(MAKE) d cd $(SRCDIR) && $(MAKE) z touch $@ Makefile.inc: ../../config.status Makefile Makefile-mumps-$(VERSION).inc $(SRCDIR)/tag-tar ../../config.status --file="Makefile.inc:Makefile-mumps-$(VERSION).inc" $(SRCDIR)/tag-tar:$(PACKAGE1) tar xvzf $(PACKAGE1) touch $@ $(PACKAGE1): ../getall -o MUMPS -a clean: -rm Makefile.inc FAIRE* *~ -rm -rf ../include/*mumps* -rm -rf ../lib/lib*mumps*SEQ* ../lib/libpord*SEQ.a ../lib/libmpiseq*SEQ.a ../lib/WHERE.mumpsseq -rm -rf $(SRCDIR) -rm *.done config.log # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/mumps-seq/Makefile-mumps-5.0.2.inc000644 000767 000024 00000013366 13256636774 023401 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ DOWNLOADFF= $(abs_top_builddir)/download # # This file is part of MUMPS 4.10.0, built on Tue May 10 12:56:32 UTC 2011 # ################################################################################ # # Makefile.inc.generic # # This defines some parameters dependent on your platform; you should # look for the approriate file in the directory ./Make.inc/ and copy it # into a file called Makefile.inc. For example, from the MUMPS root # directory, use # "cp Make.inc/Makefile.inc.generic ./Makefile.inc" # (see the main README file for details) # # If you do not find any suitable Makefile in Makefile.inc, use this file: # "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according # to the comments given below. If you manage to build MUMPS on a new platform, # and think that this could be useful to others, you may want to send us # the corresponding Makefile.inc file. # ################################################################################ ######################################################################## #Begin orderings # # NOTE that PORD is distributed within MUMPS by default. If you would like to # use other orderings, you need to obtain the corresponding package and modify # the variables below accordingly. # For example, to have Metis available within MUMPS: # 1/ download Metis and compile it # 2/ uncomment (suppress # in first column) lines # starting with LMETISDIR, LMETIS # 3/ add -Dmetis in line ORDERINGSF # ORDERINGSF = -Dpord -Dmetis # 4/ Compile and install MUMPS # make clean; make (to clean up previous installation) # # Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 5.1 and later) orderings are now available for MUMPS. # SCOTCHDIR = $(DOWNLOADFF)/ ISCOTCH = #-I$(SCOTCHDIR)/include/scotch # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dptscotch in the ORDERINGSF variable below) #LSCOTCH = -L$(SCOTCHDIR)/lib/scotch/ -lesmumps -lscotch -lscotcherr LSCOTCH = #-L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr LPORDDIR = $(topdir)/PORD/lib/ IPORD = -I$(topdir)/PORD/include/ LPORD = -L$(LPORDDIR) -lpord LMETISDIR = $(DOWNLOADFF) #IMETIS = # Metis doesn't need include files (Fortran interface avail.) # You have to choose one among the following two lines depending on # the type of analysis you want to perform. If you want to perform only # sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF # variable below); for both parallel and sequential analysis choose the second # line (remember to add -Dparmetis in the ORDERINGSF variable below) LMETIS = # -L$(LMETISDIR)/lib -lparmetis -lmetis # The following variables will be used in the compilation process. # Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively. #ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis ORDERINGSF = -Dpord ORDERINGSC = $(ORDERINGSF) LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) IORDERINGSF = $(ISCOTCH) IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) #End orderings ######################################################################## # DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC... # PLAT : use it to add a default suffix to the generated libraries PLAT = FREEFEM-SEQ # Library extension, + C and Fortran "-o" option # may be different under Windows LIBEXT = .a OUTC = -o OUTF = -o # RM : remove files RM = /bin/rm -f # CC : C compiler CC = @CC@ # FC : Fortran 90 compiler FC = @FC@ # FL : Fortran linker FL = @FC@ # AR : Archive object in a library # keep a space at the end if options have to be separated from lib name AR = @AR@ @ARFLAGS@ # RANLIB : generate index of an archive file # (optionnal use "RANLIB = echo" in case of problem) RANLIB = @RANLIB@ #RANLIB = echo # SCALAP should define the SCALAPACK and BLACS libraries. #SCALAPDIR = $(DOWNLOADFF)/lib/scalapack/ #SCALAP = $(FFBLASLIB) -L$(SCALAPDIR) -lscalapack -L$(DOWNLOADFF)/lib/blacs/ -lblacs_MPI-$(PLAT)-0 -lblacsF77init_MPI-$(PLAT)-0 -lblacsCinit_MPI-$(PLAT)-0 # INCLUDE DIRECTORY FOR MPI #INCPAR = $(FFMPIINCLUDE) # LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI LIBPAR = #$(SCALAP) $(FFMPILIB) # The parallel version is not concerned by the next two lines. # They are related to the sequential library provided by MUMPS, # to use instead of ScaLAPACK and MPI.l INCSEQ = -I$(DOWNLOADFF)/mumps-seq/MUMPS_5.0.2/libseq LIBSEQ = -L$(DOWNLOADFF)//mumps-seq/MUMPS_5.0.2/libseq -lmpiseq$(PLAT) # DEFINE HERE YOUR BLAS LIBRARY LIBBLAS = @BLASLIBS@ # DEFINE YOUR PTHREAD LIBRARY LIBOTHERS = @LIBSPTHREAD@ @FLIBS@ $(FFLIBOTHERSMUMPS) LIBSPTHREAD = @LIBSPTHREAD@ # FORTRAN/C COMPATIBILITY: # Use: # -DAdd_ if your Fortran compiler adds an underscore at the end # of symbols, # -DAdd__ if your Fortran compiler adds 2 underscores, # # -DUPPER if your Fortran compiler uses uppercase symbols # # leave empty if your Fortran compiler does not change the symbols. # CDEFS = @CFLAGSF77@ #COMPILER OPTIONS OPTF = -O @FFLAGS@ OPTC = -O -I. @CFLAGS@ OPTL = -O @FFLAGS@ # CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION. #Sequential: INCS = $(INCSEQ) LIBS = $(LIBSEQ) LIBSEQNEEDED = libseqneeded #Parallel: #INCS = $(INCPAR) #LIBS = $(LIBPAR) #LIBSEQNEEDED = libseqneeded WGET = @WGET@ # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/hypre/Makefile000644 000767 000024 00000005055 13256636774 020226 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- # $Id$ include ../headers-sparsesolver.inc include ff-flags # Downloading and compiling hypre # ------------------------------ DIRPKG=../pkg SRCDIR=hypre-$(HYPRE_VERSION) PACKAGE=$(DIRPKG)/hypre-$(HYPRE_VERSION).tar.gz SERVER=https://computation.llnl.gov/casc/hypre/download PKGDIR=../pkg HYPRE_VERSION=2.4.0b INSTALL=../.. SRCDIR2=hypre\-$(HYPRE_VERSION) hypre: FAIT$(WIN32DLLTARGET) FAITwin32-dll-target: echo "On Pure Win32 (to hard to compile) " FAIT: $(MAKE) FAIRE WHERE touch FAIT #====== # # # Remark :: To test hypre examples we need to set parameter # --with-blas-lib-dirs= --with-blas-libs= # --with-lapack-lib-dirs --with-lapack-lib #====== FAIRE: $(SRCDIR)/FAIT $(SRCDIR)/FAIT:$(SRCDIR) cd $(SRCDIR)/src && ./configure CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CC) -E" CXXFLAGS="$(CXXFLAGS)" F77="$(F77)" FFLAGS="$(FFLAGS)" FLIBS="$(FLIBS)" LDFLAGS="$(LDFLAGS)" --with-MPI-include="$(FFMPIDIR)" --with-MPI-lib-dirs="$(FFMPIDIRLIBS)" --with-MPI-libs="$(FFMPILIB2)" --prefix="${abs_top_builddir}/download" --includedir="${abs_top_builddir}/download"/include/hypre --libdir="${abs_top_builddir}/download"/lib/hypre --with-lapack-libs="$(LAPACKLIBS)" --with-blas-libs="$(BLASLIBS)" # --with-lapack --with-blas #// to add lapack to test # the following line is to avoid compilation of local blas and local lapack of hypre # begin patch # cd $(SRCDIR)/src/config/; mv Makefile.config Makefile-tmp.config; # sed -e 's;${abs_top_builddir}/download/hypre/${SRCDIR}/src/lapack; ;'\ # <$(SRCDIR)/src/config/Makefile-tmp.config\ # >$(SRCDIR)/src/config/Makefile.config # cd $(SRCDIR)/src/config/; mv Makefile.config Makefile-tmp.config; # sed -e 's;${abs_top_builddir}/download/hypre/${SRCDIR}/src/blas; ;'\ # <$(SRCDIR)/src/config/Makefile-tmp.config\ # >$(SRCDIR)/src/config/Makefile.config # # end patch cd $(SRCDIR)/src && $(MAKE) cd $(SRCDIR)/src && $(MAKE) install touch $(SRCDIR)/FAIT install: cd $(SRCDIR)/src && $(MAKE) install WHERE: if [ -f $(SRCDIR)/FAIT ] ; then \ echo hypre LD -L@DIR@/lib/hypre -lHYPRE >$(SRCDIR)/$(INSTALL)/lib/WHERE.hypre ;\ echo hypre INCLUDE -I@DIR@/include/hypre >> $(SRCDIR)/$(INSTALL)/lib/WHERE.hypre ;\ fi $(SRCDIR): $(PACKAGE) tar xvzf $(PACKAGE) touch $(SRCDIR) $(PACKAGE): -mkdir $(DIRPKG) cd $(PKGDIR); $(WGET) $(SERVER)/`basename $(PACKAGE)` clean: clean-local clean-local: -rm -rf $(SRCDIR) FAIT -rm ff-flags FAIT ff-flags: ../Makefile ff-flags.inc ../../config.status --file="ff-flags:ff-flags.inc" freefem++-3.61-1/download/hypre/ff-flags.inc000644 000767 000024 00000001153 13256636774 020741 0ustar00hechtstaff000000 000000 abs_top_builddir = @abs_top_builddir@ CXX = @CXX@ MPICXX = @MPICXX@ ac_ct_CXX = @ac_ct_CXX@ CC = @CC@ MPICC = @MPICC@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ FLIBS = @FLIBS@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ FCFLAGS = @FCFLAGS@ FFMETIS_CFLAGS = @FFMETIS_CFLAGS@ X_CFLAGS = @X_CFLAGS@ CFLAGSF77 = @CFLAGSF77@ F77 = @F77@ MPIF77 = @MPIF77@ ac_ct_F77 = @ac_ct_F77@ FFLAGS = @FFLAGS@ LDFLAGS = @LDFLAGS@ STD_LDFLAGS = @STD_LDFLAGS@ FLIBS = @FLIBS@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ FFMPIDIRLIBS = @MPI_LIB_DIRS@ FFMPIDIR = @MPI_INC_DIR@ FFMPILIB2 = @MPI_LIB@ BLASLIBS = @BLASLIBS@ LAPACKLIBS = @LAPACKLIBS@ freefem++-3.61-1/download/superludist/superludist_3.0-printf.patch000644 000767 000024 00000001030 13256636774 025273 0ustar00hechtstaff000000 000000 --- ./SuperLU_DIST_3.0/SRC/xerbla.c.orig 2013-02-13 12:21:04.893027330 +0000 +++ ./SuperLU_DIST_3.0/SRC/xerbla.c 2013-02-13 12:21:22.677028381 +0000 @@ -9,6 +9,7 @@ */ #include "Cnames.h" +#include /* Subroutine */ /*! \brief --- ./SuperLU_DIST_3.0/SRC/memory.c.orig 2011-09-06 02:16:34.000000000 +0200 +++ ./SuperLU_DIST_3.0/SRC/memory.c 2015-06-09 08:29:57.000000000 +0200 @@ -36,7 +36,7 @@ { /*fprintf(stderr, msg); fflush(stderr);*/ - printf(msg); + printf("%s",msg); exit (-1); } freefem++-3.61-1/download/superludist/superludist_3.0-return_values.patch000644 000767 000024 00000011316 13256636774 026677 0ustar00hechtstaff000000 000000 Only in SuperLU_DIST_3.0/SRC: 1 diff -ur SuperLU_DIST_3.0.orig/SRC/dutil.c SuperLU_DIST_3.0/SRC/dutil.c --- SuperLU_DIST_3.0.orig/SRC/dutil.c 2011-09-06 00:16:34.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/dutil.c 2013-02-13 17:40:36.696123287 +0000 @@ -185,6 +185,8 @@ if ( (dp = (double *) Astore->nzval) != NULL ) PrintDouble5("nzval", nnz_loc, dp); printf("==== end CompRowLoc matrix\n"); + + return 0; } int file_dPrint_CompRowLoc_Matrix_dist(FILE *fp, SuperMatrix *A) @@ -205,6 +207,8 @@ if ( (dp = (double *) Astore->nzval) != NULL ) file_PrintDouble5(fp, "nzval", nnz_loc, dp); fprintf(fp, "==== end CompRowLoc matrix\n"); + + return 0; } void @@ -355,6 +359,8 @@ fprintf(fp, "%14e", x[i]); } fprintf(fp, "\n"); + + return 0; } /*! \brief Print the blocks in the factored matrix L. @@ -461,6 +467,8 @@ file_PrintInt10(fp, "ptr_ind_torecv", procs+1, gsmv_comm->ptr_ind_torecv); file_PrintInt10(fp, "SendCounts", procs, gsmv_comm->SendCounts); file_PrintInt10(fp, "RecvCounts", procs, gsmv_comm->RecvCounts); + + return 0; } Binary files SuperLU_DIST_3.0.orig/SRC/dutil.o and SuperLU_DIST_3.0/SRC/dutil.o differ diff -ur SuperLU_DIST_3.0.orig/SRC/pddistribute.c SuperLU_DIST_3.0/SRC/pddistribute.c --- SuperLU_DIST_3.0.orig/SRC/pddistribute.c 2011-09-06 00:16:34.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/pddistribute.c 2013-02-13 17:44:50.198138179 +0000 @@ -304,6 +304,8 @@ CHECK_MALLOC(iam, "Exit dReDistribute_A()"); #endif + return 0; + } /* dReDistribute_A */ float Binary files SuperLU_DIST_3.0.orig/SRC/pddistribute.o and SuperLU_DIST_3.0/SRC/pddistribute.o differ diff -ur SuperLU_DIST_3.0.orig/SRC/psymbfact.c SuperLU_DIST_3.0/SRC/psymbfact.c --- SuperLU_DIST_3.0.orig/SRC/psymbfact.c 2011-09-06 00:16:34.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/psymbfact.c 2013-02-13 17:47:47.931004764 +0000 @@ -2267,6 +2267,8 @@ for (i = fstVtx_toUpd; i < nvtcs_toUpd; i++) marker[i] = 0; + + return 0; } static int_t @@ -4005,6 +4007,8 @@ if (newelts_U) SUPERLU_FREE (newelts_U); if (PS->szDnsSep < mem_dnsCS) PS->szDnsSep = mem_dnsCS; + + return 0; } /*! \brief @@ -4534,6 +4538,8 @@ if (request_snd != NULL) SUPERLU_FREE (request_snd); if (request_rcv != NULL) SUPERLU_FREE (request_rcv); if (status != NULL) SUPERLU_FREE (status); + + return 0; } static void Binary files SuperLU_DIST_3.0.orig/SRC/psymbfact.o and SuperLU_DIST_3.0/SRC/psymbfact.o differ diff -ur SuperLU_DIST_3.0.orig/SRC/pzdistribute.c SuperLU_DIST_3.0/SRC/pzdistribute.c --- SuperLU_DIST_3.0.orig/SRC/pzdistribute.c 2011-09-06 00:16:34.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/pzdistribute.c 2013-02-13 17:53:06.269023492 +0000 @@ -303,6 +303,7 @@ CHECK_MALLOC(iam, "Exit zReDistribute_A()"); #endif + return 0; } /* zReDistribute_A */ float Binary files SuperLU_DIST_3.0.orig/SRC/pzdistribute.o and SuperLU_DIST_3.0/SRC/pzdistribute.o differ diff -ur SuperLU_DIST_3.0.orig/SRC/util.c SuperLU_DIST_3.0/SRC/util.c --- SuperLU_DIST_3.0.orig/SRC/util.c 2011-10-11 21:14:16.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/util.c 2013-02-13 17:54:31.042028470 +0000 @@ -490,6 +490,7 @@ gstrs_comm->ptr_to_ibuf = ptr_to_ibuf; gstrs_comm->ptr_to_dbuf = ptr_to_ibuf + procs; + return 0; } /* PXGSTRS_INIT */ @@ -763,6 +764,8 @@ fprintf(fp, "%6d", x[i]); } fprintf(fp, "\n"); + + return 0; } int_t Binary files SuperLU_DIST_3.0.orig/SRC/util.o and SuperLU_DIST_3.0/SRC/util.o differ diff -ur SuperLU_DIST_3.0.orig/SRC/zutil.c SuperLU_DIST_3.0/SRC/zutil.c --- SuperLU_DIST_3.0.orig/SRC/zutil.c 2011-09-06 00:16:34.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/zutil.c 2013-02-13 17:56:24.618035143 +0000 @@ -184,6 +184,8 @@ if ( (dp = (doublecomplex *) Astore->nzval) != NULL ) PrintDoublecomplex("nzval", nnz_loc, dp); printf("==== end CompRowLoc matrix\n"); + + return 0; } int file_zPrint_CompRowLoc_Matrix_dist(FILE *fp, SuperMatrix *A) @@ -204,6 +206,8 @@ if ( (dp = (doublecomplex *) Astore->nzval) != NULL ) file_PrintDoublecomplex(fp, "nzval", nnz_loc, dp); fprintf(fp, "==== end CompRowLoc matrix\n"); + + return 0; } void @@ -351,6 +355,8 @@ fprintf(fp, "%10s:\tReal\tImag\n", name); for (i = 0; i < len; ++i) fprintf(fp, "\t%d\t%.4f\t%.4f\n", i, x[i].r, x[i].i); + + return 0; } /*! \brief Print the blocks in the factored matrix L. @@ -457,6 +463,8 @@ file_PrintInt10(fp, "ptr_ind_torecv", procs+1, gsmv_comm->ptr_ind_torecv); file_PrintInt10(fp, "SendCounts", procs, gsmv_comm->SendCounts); file_PrintInt10(fp, "RecvCounts", procs, gsmv_comm->RecvCounts); + + return 0; } Binary files SuperLU_DIST_3.0.orig/SRC/zutil.o and SuperLU_DIST_3.0/SRC/zutil.o differ freefem++-3.61-1/download/superludist/Makefile000644 000767 000024 00000005426 13256636774 021464 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- all-local: superludist # Downloading and compiling SuperLU DIST # ------------------------------ # SUPERLU information #http://crd.lbl.gov/~xiaoye/SuperLU/superlu_3.1.tar.gz #http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_3.0.tar.gz DIRPKG=../pkg SRCDIR=SuperLU_DIST_3.0 PACKAGE=superlu_dist_3.0.tar.gz PACKAGE_PATH=$(DIRPKG)/$(PACKAGE) SERVER=http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ INSTALL=../.. SUPERLU_DIST_VERSION=3.0 DISTSUPERLULIB=../$(INSTALL)/lib/libsuperlu_dist_3.0.a SPLD_PATCHS=superludist_2.3.patch superludist_3.0-printf.patch superludist_3.0-cast_warning.patch superludist_3.0-return_values.patch superludist_3.0-operation_undefined.patch ## WGET=wget include make.inc superludist: FAIT # FFCS: more dependencies for parallel builds FAIT:$(SRCDIR)/tags-tar $(MAKE) FAIRE install WHERE touch FAIT FAIRE: $(SRCDIR)/SRC/$(DSUPERLULIB) touch FAIRE make.inc: ../../config.status Makefile grep 'abs_top_builddir *=' ../Makefile >> dirflags cat dirflags make-superlu.inc > make-superlu-tmp.inc rm dirflags ../../config.status --file="make.inc:make-superlu-tmp.inc" case 'uname' in *CYGWIN_) cp make.inc Makefile.inn; sed "s/COPTIONS =/COPTIONS = -D__VC__/" Makefile.in; rm Makefile.inn ;; esac rm make-superlu-tmp.inc # FFCS: we need an error if make breaks $(SRCDIR)/SRC/$(DSUPERLULIB): $(SRCDIR)/tags-tar cp make.inc $(SRCDIR)/make.inc cd $(SRCDIR)/SRC && $(MAKE) # FFCS: we need more dependencies for parallel builds install:$(SRCDIR)/SRC/$(DSUPERLULIB) mkdir -p $(SRCDIR)/$(INSTALL)/include/superludist cp $(SRCDIR)/SRC/*.h $(SRCDIR)/$(INSTALL)/include/superludist WHERE: echo superlu_dist LD -L@DIR@/lib -lsuperlu_dist_3.0 >$(SRCDIR)/$(INSTALL)/lib/WHERE.superlu_dist echo superlu_dist INCLUDE -I@DIR@/include/superludist >> $(SRCDIR)/$(INSTALL)/lib/WHERE.superlu_dist $(SRCDIR)/tags-tar: $(PACKAGE_PATH) $(SPLD_PATCHS) tar xvzf $(PACKAGE_PATH) cd $(SRCDIR)/SRC/; patch -p1 < ../../superludist_2.3.patch cd $(SRCDIR)/SRC/; patch -p3 < ../../superludist_3.0-printf.patch cd $(SRCDIR)/SRC/; patch -p2 < ../../superludist_3.0-cast_warning.patch cd $(SRCDIR)/SRC/; patch -p2 < ../../superludist_3.0-return_values.patch cd $(SRCDIR)/SRC/; patch -p2 < ../../superludist_3.0-operation_undefined.patch touch $(SRCDIR)/tags-tar $(PACKAGE_PATH): ../getall -o SuperLU_DIST -a # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) clean: -rm -rf SuperLU_DIST* -rm ../include/superludist/*.h -rm -r ../include/superludist/ -rm -r ../lib/libsuperlu_dist*.a -rm -r make.inc -rm -rf FAIT FAIRE freefem++-3.61-1/download/superludist/superludist_3.0-operation_undefined.patch000644 000767 000024 00000001321 13256636774 030015 0ustar00hechtstaff000000 000000 --- SuperLU_DIST_3.0/SRC/util.c.orig 2013-02-20 10:23:45.674505816 +0000 +++ SuperLU_DIST_3.0/SRC/util.c 2013-02-20 10:24:09.001507187 +0000 @@ -662,8 +662,8 @@ do { ++(*num_diag_procs); - i = (++i) % nprow; - j = (++j) % npcol; + i = (i + 1) % nprow; + j = (j + 1) % npcol; pkk = PNUM( i, j, grid ); } while ( pkk != 0 ); /* Until wrap back to process 0 */ if ( !(*diag_procs = intMalloc_dist(*num_diag_procs)) ) @@ -673,8 +673,8 @@ for (i = j = k = 0; k < *num_diag_procs; ++k) { pkk = PNUM( i, j, grid ); (*diag_procs)[k] = pkk; - i = (++i) % nprow; - j = (++j) % npcol; + i = (i + 1) % nprow; + j = (j + 1) % npcol; } for (k = 0; k < nsupers; ++k) { knsupc = SuperSize( k ); freefem++-3.61-1/download/superludist/make-superlu.inc000644 000767 000024 00000002757 13256636774 023135 0ustar00hechtstaff000000 000000 # FFCS - let "make clean" work even if include file is not found -include $(abs_top_builddir)/download/headers-sparsesolver.inc ############################################# # FLAGS :: FREEFEM TO COMPILE SUPERLU_DIST # DSUPERLULIB = $(abs_top_builddir)/download/lib/libsuperlu_dist_3.0.a BLASDEF = $(FFBLASDEF) BLASLIB = @BLASLIBS@ # # The archiver and the flag(s) to use when building archive (library) # If your system has no ranlib, set RANLIB = echo. # ARCH = @AR@ ARCHFLAGS = @ARFLAGS@ RANLIB = @RANLIB@ ############################################################################ # C compiler setup CC = @MPICC@ # CFLAGS should be set to be the C flags that include optimization # FFCS - problem with some return statements on MacOS # FFCS - -I MPI_INC_DIR required on MacOS 10.8 MacPorts+OpenMPI CFLAGS = -Wreturn-type @CFLAGS@ -I'@MPI_INC_DIR@' # NOOPTS should be set to be the C flags that turn off any optimization NOOPTS = @CNOFLAGS@ ############################################################################ # FORTRAN compiler setup FORTRAN = @F77@ FFLAGS = @FFLAGS@ ############################################################################ LOADER = @CXX@ LOADOPTS = ############################################################################ # C preprocessor defs for compilation (-DNoChange, -DAdd_, or -DUpCase) # # Need follow the convention of how C calls a Fortran routine. # CDEFS = @CFLAGSF77@ WGET =@WGET@ freefem++-3.61-1/download/superludist/superludist_2.3.patch000644 000767 000024 00000002140 13256636774 024000 0ustar00hechtstaff000000 000000 diff -ur SuperLU_DIST_2.3/SRC/Makefile SuperLU_DIST_2.3-okk/Makefile --- SuperLU_DIST_2.3/SRC/Makefile 2008-09-13 17:13:18.000000000 +0200 +++ SuperLU_DIST_2.3-okk/Makefile 2010-02-16 08:24:45.000000000 +0100 @@ -51,6 +51,8 @@ ZSLUSRC = dcomplex.o zlangs.o zgsequ.o zlaqgs.o zutil.o \ zmemory.o zmyblas2.o dmemory.o zsp_blas2.o zsp_blas3.o +#ZSLUSRCdemory= dmemory.o + # # Routines for double precision parallel SuperLU # DPLUSRC = dldperm.o ddistribute.o pdgstrf.o pdgstrs_Bglobal.o @@ -69,7 +71,7 @@ pzgsequ.o pzlaqgs.o pzgsrfs.o pzgsmv.o pzgstrs_lsum.o \ pzsymbfact_distdata.o -all: double complex16 +all: doublecomplex16 double: $(DSLUSRC) $(DPLUSRC) $(ALLAUX) $(LAAUX) $(ARCH) $(ARCHFLAGS) $(DSUPERLULIB) \ @@ -81,6 +83,10 @@ $(ZSLUSRC) $(ZPLUSRC) $(ALLAUX) $(LAAUX) $(RANLIB) $(DSUPERLULIB) +doublecomplex16: $(DSLUSRC) $(DPLUSRC) $(ZSLUSRC) $(ZPLUSRC) $(ALLAUX) $(LAAUX) + $(ARCH) $(ARCHFLAGS) $(DSUPERLULIB) \ + $(DSLUSRC) $(DPLUSRC) $(ZSLUSRC) $(ZPLUSRC) $(ALLAUX) $(LAAUX) + $(RANLIB) $(DSUPERLULIB) ################################## # Do not optimize these routines # freefem++-3.61-1/download/superludist/superludist_3.0-cast_warning.patch000644 000767 000024 00000002176 13256636774 026464 0ustar00hechtstaff000000 000000 diff -ur SuperLU_DIST_3.0.orig/SRC/pdgstrf.c SuperLU_DIST_3.0/SRC/pdgstrf.c --- SuperLU_DIST_3.0.orig/SRC/pdgstrf.c 2011-10-11 20:45:40.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/pdgstrf.c 2013-02-13 12:51:45.691434748 +0000 @@ -2597,7 +2597,7 @@ MPI_Isend(ublk_ptr, u_diag_cnt, MPI_DOUBLE, pr, tag, comm, U_diag_blk_send_req + pr); } - U_diag_blk_send_req[krow] = 1; /* flag outstanding Isend */ + U_diag_blk_send_req[krow] = (MPI_Request) 1; /* flag outstanding Isend */ } } else { /* non-diagonal process */ Only in SuperLU_DIST_3.0/SRC: pdgstrf.o diff -ur SuperLU_DIST_3.0.orig/SRC/pzgstrf.c SuperLU_DIST_3.0/SRC/pzgstrf.c --- SuperLU_DIST_3.0.orig/SRC/pzgstrf.c 2011-10-11 20:45:40.000000000 +0000 +++ SuperLU_DIST_3.0/SRC/pzgstrf.c 2013-02-13 12:54:00.212442635 +0000 @@ -2543,7 +2543,7 @@ MPI_Isend(ublk_ptr, u_diag_cnt, SuperLU_MPI_DOUBLE_COMPLEX, pr, tag, comm, U_diag_blk_send_req + pr); } - U_diag_blk_send_req[krow] = 1; /* flag outstanding Isend */ + U_diag_blk_send_req[krow] = (MPI_Request) 1; /* flag outstanding Isend */ } } else { /* non-diagonal process */ freefem++-3.61-1/download/mshmet/mshmetlib.c000644 000767 000024 00000021403 13256636774 021057 0ustar00hechtstaff000000 000000 /* mshmetlib.c mshmetlib(int option, ...) to use mshmet via a library * compute metric based on hessian * j.morice LJLL 2010 * Copyright (c) LJLL, 2010. */ #include "mshmet.h" #include "compil.date" extern long verbosity; char idir[5] = {0,1,2,0,1}; mytime mshmet_ctim[TIMEMAX]; int (*boulep)(pMesh ,int ,int ,int *); int (*hashel)(pMesh ); int (*gradLS)(pMesh ,pSol ,int ,int ); int (*hessLS)(pMesh ,pSol ,int ,int ); int (*avgval)(pMesh ,pSol ,int ); int (*clsval)(pMesh ,pSol ,int ); int (*nrmhes)(pMesh ,pSol ,int ); int (*redsim)(double *,double *,double *); int (*defmet)(pMesh ,pSol ,int ); double (*getSol)(pSol ,int ,int ); int (*metrLS)(pMesh mesh,pSol ); int (*lissag)(pMesh ,pSol , int ,int ); static void mshmet_excfun(int sigid) { fprintf(stdout,"\n Unexpected error:"); fflush(stdout); switch(sigid) { case SIGABRT: fprintf(stdout," Abnormal stop\n"); exit(1); case SIGFPE: fprintf(stdout," Floating-point exception\n"); exit(1); case SIGILL: fprintf(stdout," Illegal instruction\n"); exit(1); case SIGSEGV: fprintf(stdout," Segmentation fault\n"); exit(1); case SIGTERM: case SIGINT: //fprintf(stdout," Program killed\n"); exit(1); fprintf(stdout," Abnormal end\n"); exit(1); } exit(1); } /* static void usage(char *prog) { fprintf(stdout,"\n usage: %s filein[.mesh] [solin[.sol]] [fileout.sol] -eps x -hmin y -hmax z -v -iso -norm\n",prog); fprintf(stdout,"\n** Generic options :\n"); fprintf(stdout,"-d Turn on debug mode\n"); fprintf(stdout,"-h Print this message\n"); fprintf(stdout,"-ls Build levelset metric\n"); fprintf(stdout,"-v [n] Tune level of verbosity\n"); fprintf(stdout,"-m file Use metric file\n"); fprintf(stdout,"\n** Specific options : \n"); fprintf(stdout," -eps : tolerance\n"); fprintf(stdout," -hmin: min size\n"); fprintf(stdout," -hmax: max size\n"); fprintf(stdout," -iso : isotropic\n"); fprintf(stdout," -w : relative width for LS (0name); ptr = strstr(data,".sol"); if ( ptr ) *ptr = '\0'; strcat(data,".mhes"); in = fopen(data,"r"); if ( !in ) { strcpy(data,"DEFAULT.hmet"); in = fopen(data,"r"); if ( !in ) { if ( mesh->info.imprim < 0 ) fprintf(stdout," %%%% DEFAULT VALUES (%g %g %g)\n", mesh->info.eps,mesh->info.hmin,mesh->info.hmax); return(1); } } fprintf(stdout," %%%% %s FOUND\n",data); while ( !feof(in) ) { ret = fscanf(in,"%s",key); if ( !ret || feof(in) ) break; for (i=0; iinfo.hmin = dummy; } else if ( !strcmp(key,"hmax") ) { fscanf(in,"%f",&dummy); mesh->info.hmax = dummy; } else if ( !strcmp(key,"eps") ) { fscanf(in,"%f",&dummy); mesh->info.eps = dummy; } else if ( !strcmp(key,"iso") ) { mesh->info.iso = 1; } else if ( !strcmp(key,"norm") ) { fscanf(in,"%d",&mesh->info.nnu); } else if ( key[0] == '#' ) { fgets(key,255,in); } else fprintf(stderr," unrecognized keyword : %s\n",key); } fclose(in); return(1); } */ static void mshmet_stats(pMesh mesh,pSol sol) { fprintf(stdout," NUMBER OF GIVEN VERTICES %8d\n",mesh->np); if ( mesh->nt ) fprintf(stdout," NUMBER OF GIVEN TRIANGLES %8d\n",mesh->nt); if ( mesh->ne ) fprintf(stdout," NUMBER OF GIVEN TETRAHEDRA %8d\n",mesh->ne); fprintf(stdout," NUMBER OF GIVEN DATA %8d\n",sol->np); } static void mshmet_endcod() { double ttot,ttim[TIMEMAX]; int k,call[TIMEMAX]; chrono(OFF,&mshmet_ctim[0]); for (k=0; k 0.01 ) { fprintf(stdout,"\n -- CPU REQUIREMENTS\n"); fprintf(stdout," in/out %8.2f %% %3d. calls, %7.2f sec/call\n", 100.*ttim[1]/ttim[0],call[1],ttim[1]/(float)call[1]); fprintf(stdout," analysis %8.2f %% %3d. calls, %7.2f sec/call\n", 100.*ttim[2]/ttim[0],call[2],ttim[2]/(float)call[2]); fprintf(stdout," metric %8.2f %% %3d. calls, %7.2f sec/call\n", 100.*ttim[3]/ttim[0],call[3],ttim[3]/(float)call[3]); fprintf(stdout," total %8.2f %% %3d. calls, %7.2f sec/call\n", 100.*ttot/ttim[0],call[0],ttot/(float)call[0]); } fprintf(stdout,"\n ELAPSED TIME %.2f SEC. (%.2f)\n",ttim[0],ttot); } /* set function pointers */ /* set function pointers */ void MSHMET_setfunc(pMesh mesh) { if ( mesh->dim == 2 ) { boulep = boulep_2d; hashel = hashel_2d; gradLS = gradLS_2d; hessLS = hessLS_2d; getSol = getSol_2d; avgval = avgval_2d; clsval = clsval_2d; nrmhes = nrmhes_2d; defmet = defmet_2d; redsim = redsim_2d; metrLS = metrLS_2d; lissag = lissag_2d; } else { if ( mesh->ne > 0 ) { /* 3d */ boulep = boulep_3d; hashel = hashel_3d; gradLS = gradLS_3d; hessLS = hessLS_3d; getSol = getSol_3d; avgval = avgval_3d; clsval = clsval_3d; nrmhes = nrmhes_3d; defmet = defmet_3d; redsim = redsim_3d; metrLS = metrLS_3d; lissag = lissag_3d; } else { /* surface mesh */ boulep = boulep_2d; hashel = hashel_2d; lissag = lissag_2d; avgval = avgval_3d; clsval = clsval_3d; nrmhes = nrmhes_3d; getSol = getSol_3d; redsim = redsim_3d; gradLS = gradLS_s; hessLS = hessLS_s; defmet = defmet_s; metrLS = metrLS_3d; } } } int MSHMET_mshmet(int intopt[7], double fopt[4], pMesh mesh, pSol sol){ Info *info; fprintf(stdout," -- MSHMET, Release %s (%s) \n",MS_VER,MS_REL); fprintf(stdout," %s\n",MS_CPY); fprintf(stdout," %s\n",COMPIL); /* trap exceptions */ signal(SIGABRT,mshmet_excfun); signal(SIGFPE,mshmet_excfun); signal(SIGILL,mshmet_excfun); signal(SIGSEGV,mshmet_excfun); signal(SIGTERM,mshmet_excfun); signal(SIGINT,mshmet_excfun); //atexit(mshmet_endcod); tminit(mshmet_ctim,TIMEMAX); chrono(ON,&mshmet_ctim[0]); chrono(ON,&mshmet_ctim[1]); /* default */ info = &mesh->info; info->hmin = (float) fopt[0]; // 0.01; info->hmax = (float) fopt[1]; // 1.0; info->eps = (float) fopt[2]; // 0.01; info->width = (float) fopt[3]; // 0.05; info->nnu = intopt[0]; // 0; info->iso = intopt[1]; // 0; info->ls = intopt[2]; // 0; info->ddebug = intopt[3]; // 0; info->imprim = intopt[4]; // 10; info->nlis = intopt[5]; // 0; info->bin = 1; // pas besoin c'est pour le fichier info->nsol = -1; //-1; // pas besoin ==> on peut prendre plusieurs solutions en meme temps ??? info->metric = intopt[6]; // 0; // metric given besoin ??? MSHMET_setfunc(mesh); chrono(OFF,&mshmet_ctim[1]); if ( mesh->info.imprim ) mshmet_stats(mesh,sol); fprintf(stdout," -- DATA READING COMPLETED. %.2f sec.\n",gttime(mshmet_ctim[1])); fprintf(stdout,"\n %s\n MODULE MSHMET-LJLL : %s (%s)\n %s\n", MS_STR,MS_VER,MS_REL,MS_STR); /* analysis */ chrono(ON,&mshmet_ctim[2]); if ( mesh->info.imprim ) fprintf(stdout,"\n -- PHASE 1 : ANALYSIS\n"); if ( abs(mesh->info.imprim) > 4 ) { fprintf(stdout," ** SETTING ADJACENCIES\n"); fflush(stdout); } if ( !scaleMesh(mesh,sol) ) return(1); if ( !hashel(mesh) ) exit(1); chrono(OFF,&mshmet_ctim[2]); if ( mesh->info.imprim ) fprintf(stdout," -- PHASE 1 COMPLETED. %.2f sec.\n",gttime(mshmet_ctim[2])); /* metric */ chrono(ON,&mshmet_ctim[3]); if ( mesh->info.imprim ) fprintf(stdout,"\n -- PHASE 2 : METRIC\n"); if ( !mshme1(mesh,sol) ) exit(1); chrono(OFF,&mshmet_ctim[3]); if ( mesh->info.imprim ) fprintf(stdout," -- PHASE 2 COMPLETED. %.2f sec.\n",gttime(mshmet_ctim[3])); fprintf(stdout,"\n %s\n END OF MODULE MSHMET \n %s\n",MS_STR,MS_STR); /* sol->outn="zzzz"; if ( !saveMet(sol,&mesh->info,sol->outn) ) exit(1); */ if ( mesh->info.imprim ) mshmet_endcod(); fprintf(stdout,"\n %s\n END OF MODULE MSHMET \n %s\n",MS_STR,MS_STR); if ( mesh->info.imprim < -4 || mesh->info.ddebug ) M_memDump(); return(0); } freefem++-3.61-1/download/mshmet/Makefile000755 000767 000024 00000005563 13256636774 020403 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- all-local: mshmet include ff-flags # Downloading and compiling mshmet # ------------------------------- # DIRPKG= ../pkg SRCDIR= ./mshmet$(mshmet_VERSION) #-$(mshmet_VERSION) PACKAGE=$(DIRPKG)/mshmet$(mshmet_VERSION).tgz SERVER=http://www.ann.jussieu.fr/~frey/ftp/archives/ INSTALL=../.. mshmet_VERSION=.2012.04.25 FAIRE=$(SRCDIR)/FAIRE # ---------------------- # mshmetlib MSHMET_DIR = $(abs_top_builddir)/download/mshmet/mshmet$(mshmet_VERSION) MSHMET_SRCDIRNOLIB = $(MSHMET_DIR)/sources MSHMET_SRCDIR = $(MSHMET_DIR)/sourceslib MSHMET_OBJDIR = $(MSHMET_DIR)/objects mshmet: $(FAIRE) $(FAIRE):$(SRCDIR)/FAIT $(MAKE) WHERE $(SRCDIR)/$(INSTALL) touch $(FAIRE) $(SRCDIR)/FAIT:$(SRCDIR)/tag-tar cd $(MSHMET_DIR); $(MAKE) touch $(SRCDIR)/FAIT # FFCS - libMesh is also required by yams, so we move all the rules to [[file:../../../Makefile.am]] install:$(SRCDIR)/FAIT cp $(MSHMET_SRCDIR)/mshmetlib.h $(SRCDIR)/$(INSTALL)/include/mshmetlib.h cp $(MSHMET_OBJDIR)/libmshmet.a $(SRCDIR)/$(INSTALL)/lib/libmshmet.a # FFCS - simplify makefile structure for automatic rebuilds WHERE:install echo mshmet LD -L@DIR@/lib -lmshmet >$(SRCDIR)/$(INSTALL)/lib/WHERE.mshmet echo mshmet INCLUDE -I@DIR@/include>> $(SRCDIR)/$(INSTALL)/lib/WHERE.mshmet $(SRCDIR)/tag-tar: $(PACKAGE) mshmetlib-internal.h mshmetlib.c mshmetlib.h -mkdir mshmet$(mshmet_VERSION) cd mshmet$(mshmet_VERSION); tar xvzf ../$(PACKAGE) -mkdir $(MSHMET_SRCDIR) cp $(MSHMET_SRCDIRNOLIB)/*.c $(MSHMET_SRCDIRNOLIB)/*.h $(MSHMET_SRCDIR) cp $(MSHMET_SRCDIRNOLIB)/compil.date $(MSHMET_SRCDIR) cp mshmetlib-internal.h mshmetlib.c mshmetlib.h $(MSHMET_SRCDIR)/ cp ../../src/libMesh/chrono.h $(MSHMET_SRCDIR) rm $(MSHMET_SRCDIR)/mshmet.c rm $(MSHMET_SRCDIR)/chrono.c cp ../../src/libMesh/eigenv.c $(MSHMET_SRCDIR) cp Makefile-mshmet.inc $(MSHMET_DIR)/makefile cd $(MSHMET_SRCDIR); patch -p2 < ../../mshmet.2011.03.06.patch # # Patch for i586 developed by John Hunt (14/2/13) # cd $(MSHMET_SRCDIR); patch -p2 < ../../mshmet.2012.04.25_i586.patch touch $(SRCDIR)/tag-tar $(PACKAGE): ../getall -o mshmet -a clean: -rm ff-flags # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) -rm -rf mshmet.????.??.?? -rm FAIT $(FAIRE) ff-flags: ../Makefile grep 'abs_top_builddir *=' ../Makefile >> ff-flags grep 'CC *=' ../Makefile >> ff-flags grep 'CFLAGS *=' ../Makefile >> ff-flags grep 'LDFLAGS *=' ../Makefile >> ff-flags grep 'AR *=' ../Makefile >> ff-flags grep 'ARFLAGS *=' ../Makefile >> ff-flags grep 'RANLIB *=' ../Makefile >> ff-flags grep 'WGET *=' ../Makefile >> ff-flags grep 'mshmet_VERSION *=' ./Makefile >> ff-flags .PHONY: $(SRCDIR)/$(INSTALL) freefem++-3.61-1/download/mshmet/mshmet.2011.03.06.patch000644 000767 000024 00000004041 13256636774 022273 0ustar00hechtstaff000000 000000 --- mshmet.2011.03.06/sources/mshmet.h 2011-02-11 19:41:49.000000000 +0100 +++ mshmet.2011.03.06/sourceslib/mshmet.h 2011-11-16 22:04:20.000000000 +0100 @@ -33,7 +33,7 @@ #define MS_MAX(a,b) ( ((a) < (b)) ? (b) : (a) ) #define MS_MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) -char idir[5]; +extern char idir[5]; typedef struct { double c[3]; @@ -135,17 +135,17 @@ pHash hashEdge_3d(pMesh mesh); pHash hashEdge_2d(pMesh mesh); -int (*boulep)(pMesh ,int ,int ,int *); -int (*hashel)(pMesh ); -int (*gradLS)(pMesh ,pSol ,int ,int ); -int (*hessLS)(pMesh ,pSol ,int ,int ); -int (*avgval)(pMesh ,pSol ,int ); -int (*clsval)(pMesh ,pSol ,int ); -int (*nrmhes)(pMesh ,pSol ,int ); -int (*redsim)(double *,double *,double *); -int (*defmet)(pMesh ,pSol ,int ); -double (*getSol)(pSol ,int ,int ); -int (*metrLS)(pMesh mesh,pSol ); -int (*lissag)(pMesh ,pSol , int ,int ); +extern int (*boulep)(pMesh ,int ,int ,int *); +extern int (*hashel)(pMesh ); +extern int (*gradLS)(pMesh ,pSol ,int ,int ); +extern int (*hessLS)(pMesh ,pSol ,int ,int ); +extern int (*avgval)(pMesh ,pSol ,int ); +extern int (*clsval)(pMesh ,pSol ,int ); +extern int (*nrmhes)(pMesh ,pSol ,int ); +extern int (*redsim)(double *,double *,double *); +extern int (*defmet)(pMesh ,pSol ,int ); +extern double (*getSol)(pSol ,int ,int ); +extern int (*metrLS)(pMesh mesh,pSol ); +extern int (*lissag)(pMesh ,pSol , int ,int ); #endif --- mshmet.2012.04.25/sources/lplib3.c 2013-04-10 11:53:17.000000000 +0200 +++ mshmet.2012.04.25/sourceslib/lplib3.c 2013-04-10 11:54:49.000000000 +0200 @@ -30,7 +30,10 @@ #include #include #include "lplib3.h" - +#ifdef __FreeBSD__ +#include +#include +#endif /*----------------------------------------------------------*/ /* Defines */ @@ -1250,6 +1253,7 @@ * NPROC environment variable (BSD/OS, CrayOS) * sysctl hw.ncpu or kern.smp.cpus */ + int ncpu; if (pmc_init() == 0 && (ncpu = pmc_ncpu()) != -1) maxthreads = ncpu; else freefem++-3.61-1/download/mshmet/Makefile-mshmet.inc000644 000767 000024 00000002253 13256636774 022434 0ustar00hechtstaff000000 000000 include ../ff-flags MSHMETDIR = $(abs_top_builddir)/download/mshmet/mshmet$(mshmet_VERSION) # working dirs EXEDIR = #$(MSHMETDIR)/executable SRCDIR = $(MSHMETDIR)/sourceslib OBJDIR = $(MSHMETDIR)/objects/$(ARCHI) ARCDIR = $(MSHMETDIR)/archives DIRDIR = $(EXEDIR) $(OBJDIR) $(ARCDIR) VPATH = $(SRCDIR) INCDIR = -I$(MSHMETDIR)/sourceslib/ -I$(abs_top_builddir)/src/libMesh/ LDLDIR = -L$(abs_top_builddir)/src/libMesh/ -lMesh # objects list src = $(wildcard $(SRCDIR)/*.c) header = $(wildcard $(SRCDIR)/*.h) objs = $(patsubst $(SRCDIR)%,$(OBJDIR)%,$(src:.c=.o)) prog = mshmet lib = $(OBJDIR)/libmshmet.a #.SILENT: $(OBJDIR)/%.o: $(SRCDIR)/%.c $(CC) $(OPT64) $(INCDIR) $(CFLAGS) -DSERIAL -c $< -o $@ $(EXEDIR)/$(prog):$(DIRDIR) $(objs) echo "#define COMPIL " '"' `date` '"' > $(SRCDIR)/compil.date #$(CC) -c $(CFLAGS) $(INCDIR) $(SRCDIR)/mshmet.c -o $(OBJDIR)/mshmet.o #$(CC) $(LDFLAGS) $(OPT64) $(LDLDIR) $(objs) -o $@ -lm $(AR) $(ARFLAGS) $(lib) $(objs) $(RANLIB) $(lib) $(objs):$(header) $(DIRDIR): @[ -d $@ ] || mkdir $@ clean: -rm $(objs) $(EXEDIR)/$(prog) tar:$(DIRDIR) tar czf $(ARCDIR)/$(prog).`date +"%Y.%m.%d"`.tgz sources makefile target: $(EXEDIR)/$(prog) freefem++-3.61-1/download/mshmet/mshmetlib.h000644 000767 000024 00000003604 13256636774 021067 0ustar00hechtstaff000000 000000 typedef struct { /* double aire,rins; double c[3]; int s,nv,mark; unsigned char b,h; */ double c[3]; int s,nv,mark; unsigned char b,h; } MSHMET_Point; typedef MSHMET_Point * MSHMET_pPoint; typedef struct { int v[3]; int mark; /* double aire; int v[3]; int mark;*/ } MSHMET_Tria; typedef MSHMET_Tria * MSHMET_pTria; typedef struct { int v[4]; int mark; } MSHMET_Tetra; typedef MSHMET_Tetra * MSHMET_pTetra; typedef struct { double delta; double min[3],max[3]; float eps,hmin,hmax,width,ani,hgrad,map; int nnu,nsol,nlis; char imprim,ddebug,iso,bin,metric,ls; /* double delta; double min[3],max[3]; float eps,hmin,hmax,width; int nnu,nsol,nlis; char imprim,ddebug,iso,bin,metric,ls; */ } MSHMET_Info; typedef struct { /* int np,nt,ne,ver,dim; int *adja,mark; char *name,*mname; MSHMET_pPoint point; MSHMET_pTria tria; MSHMET_pTetra tetra; MSHMET_Info info; */ int np,nt,ne,ver,dim; int *adja,mark; char *name,*mname; MSHMET_pPoint point; MSHMET_pTria tria; MSHMET_pTetra tetra; MSHMET_Info info; } MSHMET_Mesh; typedef MSHMET_Mesh * MSHMET_pMesh; typedef struct { int np,ver,dim,type,size,typtab[GmfMaxTyp]; double *sol,*met,*hes,*grd,*nn,umin,umax; char *name,*outn,*mapname; /* version 2.0 int np,ver,dim,type,size,typtab[GmfMaxTyp]; double *sol,*met,umin,umax; char *name,*outn; */ } MSHMET_Sol; typedef MSHMET_Sol * MSHMET_pSol; typedef struct { double grd[3]; double hes[6]; } MSHMET_Deriv; typedef MSHMET_Deriv * MSHMET_pDeriv; #ifdef __cplusplus namespace mshmet{ extern "C" { #endif int MSHMET_mshmet(int intopt[7], double fopt[4], MSHMET_pMesh mesh, MSHMET_pSol sol); #ifdef __cplusplus }} #endif freefem++-3.61-1/download/mshmet/mshmet.2012.04.25_i586.patch000644 000767 000024 00000000517 13256636774 023055 0ustar00hechtstaff000000 000000 --- mshmet.2012.04.25/sourceslib/libmesh5.c.orig 2013-02-12 17:47:00.093678985 +0000 +++ mshmet.2012.04.25/sourceslib/libmesh5.c 2013-02-12 17:48:27.083684096 +0000 @@ -1381,7 +1381,7 @@ int IntVal; long pos; - if(msh->ver >= 3) + if ( (msh->ver >= 3) && (sizeof(long) == 8) ) ScaDblWrd(msh, (unsigned char*)&pos); else { freefem++-3.61-1/download/mshmet/mshmetlib-internal.h000644 000767 000024 00000000564 13256636774 022703 0ustar00hechtstaff000000 000000 typedef MSHMET_Point Point; typedef MSHMET_Tetra Tetra; typedef MSHMET_Tria Tria; typedef MSHMET_Mesh Mesh; typedef MSHMET_Sol Sol; typedef MSHMET_Deriv Deriv; typedef MSHMET_pPoint pPoint; typedef MSHMET_pTetra pTetra; typedef MSHMET_pDeriv pDeriv; typedef MSHMET_pTria pTria; typedef MSHMET_Info Info; typedef MSHMET_pMesh pMesh; typedef MSHMET_pSol pSol; freefem++-3.61-1/download/hips/Makefile000644 000767 000024 00000021754 13256636774 020046 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- # $Id: Makefile,v 1.2 2010/03/31 08:50:56 hecht Exp $ include makefile.inc all-local: hips # Downloading and compiling HIPS # ------------------------------ # http://hips.gforge.inria.fr/release/hips-1.2b-rc4.tar.gz # Hips information DIRPKG=../pkg SRCDIR=hips-$(hips_VERSION) PACKAGE=$(DIRPKG)/hips-$(hips_VERSION).tar.gz SERVER=http://hips.gforge.inria.fr/release/ INSTALL=../.. hips_VERSION=1.2b-rc4 # rappel :: SRC= $(wildcard *.c) ==> permet de chopper tout les points *.c d'un repertoire # OBJ = $(SRC:.c=.o) # ==> implique *.o dans les repertoire pour recuperer SRCPhidalCommon = $(SRCDIR)/SRC/PHIDAL/COMMON ObjPhidalCommon = $(SRCPhidalCommon)/*.o SRCPhidalOrdering = $(SRCDIR)/SRC/PHIDAL/ORDERING ObjPhidalOrdering = $(SRCPhidalOrdering)/*.o SRCPhidalSequential = $(SRCDIR)/SRC/PHIDAL/SEQUENTIAL ObjPhidalSequential = $(SRCPhidalSequential)/*.o SRCDBMATRIX = $(SRCDIR)/SRC/BLOCK/DBMATRIX/ ObjBlockDBMATRIX = $(SRCDIR)/SRC/BLOCK/DBMATRIX/amalgamate.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix2PhidalMatrix.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_Build.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_Copy.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_FACTO2.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_FACTO.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_FACTOu.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_func.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_GEMM.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_GEMM_N.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_GEMMu.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MatVec2.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MatVec.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MLILUPrec.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MLIutil.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_PrecSolve.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_SEQ.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_Setup.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_SetupHID.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_solve2.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_solve.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_TRSM.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_LL.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RL.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RL_DROP.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_func.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_pic.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_SchurProd.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/db_struct.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/dumpDBMatrix.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_SymbolMatrix.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/PHIDAL_SymbolMatrix.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/print.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/SF_Direct.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/size.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MLICCPrec.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix2PhidalMatrix_drop.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd_PH_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_SetupHID.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MLICCPrec.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMATRIX_MLILUPrec.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_LL.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_LLu.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_FACTO.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix_FACTO2u.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RL.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RLu.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RL_DROP.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBPrec_FACTO_TRSM_GEMM_RL_DROPu.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd_DB_PH.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd_PH_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd_DB_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_PCG_DB_PH.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_PCG_PH_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_PCG_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/HIPS_PCG_DB_DB.o \ $(SRCDIR)/SRC/BLOCK/DBMATRIX/DBMatrix2PhidalMatrix_drop.o SRCBlockSOLVMATRIX = $(SRCDIR)/SRC/BLOCK/SOLVMATRIX ObjBlockSOLVMATRIX = $(SRCBlockSOLVMATRIX)/*.o SRCBlockSOLVMATRIX2 = $(SRCDIR)/SRC/BLOCK/SOLVMATRIX2 ObjBlockSOLVMATRIX2 = $(SRCBlockSOLVMATRIX2)/*.o #/SRC/IO; ObjIO = $(SRCDIR)/SRC/IO/*.o #/SRC/PHIDAL/PARALLEL SRCPhidalParallel = $(SRCDIR)/SRC/PHIDAL/PARALLEL ObjPhidalParallel = $(SRCPhidalParallel)/*.o #SRC/BLOCK/PARALLEL ObjBlockParallel = $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_func.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_Build.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_Setup.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_Copy.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDISTRMATRIX_SEQ.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDISTRMATRIX_MLICCPrec.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDISTRMATRIX_MLILUPrec.o $(SRCDIR)/SRC/BLOCK/PARALLEL/db_parallel_struct.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBcomm.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix2PhidalDistrMatrix.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDISTRMATRIX_PrecSolve.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_solve.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_ICCT.o $(SRCDIR)/SRC/BLOCK/PARALLEL/CellDBDistr.o $(SRCDIR)/SRC/BLOCK/PARALLEL/VS_RowDiv.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrFgmresd_PH_DB.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrFgmresd_DB_PH.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrFgmresd_DB.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrFgmresd_DB_DB.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_SchurProd.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_SetupHID.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrPCG_PH_DB.o $(SRCDIR)/SRC/BLOCK/PARALLEL/HIPS_DistrPCG_DB_PH.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_func.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_FACTO.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_FACTOu.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_LL.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_RL.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_RL_DROP.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_LLu.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_RLu.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_FACTO_TRSM_GEMM_RL_DROPu.o \ $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrPrec_func2.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDistrMatrix_solve_sub.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBcomm2.o $(SRCDIR)/SRC/BLOCK/PARALLEL/DBDISTRMATRIX_MatVec2.o #SRC/HIPS_WRAPPER ObjHIPS_WRAPPER= $(SRCDIR)/SRC/HIPS_WRAPPER/*.o #SRC/BLAS ObjBLAS= $(SRCDIR)/SRC/BLAS/zsymv.o $(SRCDIR)/SRC/BLAS/csymv.o #SRC/SPKIT pas besoin ObjSPKIT= $(SRCDIR)/SRC/SPKIT/skitfc.o $(SRCDIR)/SRC/SPKIT/skitf.o # definition of obj for librairies OBJLIBHIPSSEQUENTIAL = $(ObjPhidalCommon) $(ObjPhidalOrdering) $(ObjPhidalSequential) $(ObjBlockDBMATRIX) $(ObjBlockSOLVMATRIX) $(ObjBlockSOLVMATRIX2) $(ObjHIPS_WRAPPER) $(ObjBLAS) OBJLIBHIPS = $(ObjPhidalCommon) $(ObjPhidalOrdering) $(ObjPhidalSequential) $(ObjBlockDBMATRIX) $(ObjBlockSOLVMATRIX) $(ObjBlockSOLVMATRIX2) $(ObjPhidalParallel) $(ObjBlockParallel) $(ObjHIPS_WRAPPER) $(ObjBLAS) OBJLIBIO = $(ObjIO) ifndef FC OBJLIBSPKIT = else OBJLIBSPKIT = $(ObjSPKIT) endif hips: FAIRE # FFCS: more dependencies for parallel builds FAIT:$(SRCDIR)/tag-ff++ $(MAKE) .. WHERE touch FAIT FAIRE: FAIT makefile.inc: ../Makefile ../../config.status makefile-hips.inc Makefile ../../config.status --file="makefile.inc:makefile-hips.inc" install:.. ..: $(SRCDIR)/tag-ff++ cp makefile.inc $(SRCDIR) cd $(SRCDIR); $(MAKE) -rm $(SRCDIR)/LIB/*.a $(AR) $(ARFLAGS) $(SRCDIR)/LIB/libhips.a $(OBJLIBHIPS) $(RANLIB) $(SRCDIR)/LIB/libhips.a $(AR) $(ARFLAGS) $(SRCDIR)/LIB/libhipssequential.a $(OBJLIBHIPSSEQUENTIAL) $(RANLIB) $(SRCDIR)/LIB/libhipssequential.a $(AR) $(ARFLAGS) $(SRCDIR)/LIB/libio.a $(OBJLIBIO) $(RANLIB) $(SRCDIR)/LIB/libio.a if [ -n "$(OBJLIBSPKIT)" ] ; then \ $(AR) $(ARFLAGS) $(SRCDIR)/LIB/libspkit.a $(OBJLIBSPKIT) ;\ $(RANLIB) $(SRCDIR)/LIB/libspkit.a;\ fi mkdir -p ../include/hips cp $(SRCDIR)/LIB/*.h ../include/hips/ mkdir -p ../lib/hips cp $(SRCDIR)/LIB/*.a ../lib/hips WHERE: echo hips LD -L@DIR@/lib/hips -lio -lhips >../lib/WHERE.hips echo hips INCLUDE -I@DIR@/include/hips>> ../lib/WHERE.hips echo hipssequential LD -L@DIR@/lib/hips -lio -lhipssequential >>../lib/WHERE.hips echo hipssequential INCLUDE -I@DIR@/include/hips >> ../lib/WHERE.hips $(SRCDIR)/tag-ff++: $(PACKAGE) tar xvzf $(PACKAGE) cd $(SRCDIR); patch -p1 <../hips-1.2b-rc4.patch # cd $(SRCDIR)/SRC/INCLUDE/; patch -p1 < ../../../hips-1.2b-rc4-1.patch; # cd $(SRCDIR)/SRC/IO/; patch -p1 < ../../../hips-1.2b-rc4-2.patch; # cd $(SRCDIR); for d in SRC/INCLUDE SRC/IO SRC/SPKIT TESTS/PARALLEL; do \ # cp $$d/makefile $$d/makefile.orig; \ # sed 's/\$$(CC).*-E/$$(CPP) $$(CFLAGS) $$(CC_OPT)/' >$$d/makefile <$$d/makefile.orig;\ # done # cp SRC_SPKIT_makefile $(SRCDIR)/SRC/SPKIT/makefile touch $(SRCDIR)/tag-ff++ $(PACKAGE): ../getall -o Hips -a # FFCS: avoid loops when SRCDIR does not exist clean-local: -cd $(SRCDIR) && $(MAKE) clean -C $(SRCDIR) rm makefile.inc -rm ../WHERE/hips -rm ../lib/hips/* -rm -rf ../lib/hips/ -rm ../include/hips/* -rm -rf ../include/hips/ -rm -rf $(SRCDIR) -rm FAIT clean: clean-local .PHONY:..freefem++-3.61-1/download/hips/hips-1.2b-rc4.patch000644 000767 000024 00000013070 13256636774 021510 0ustar00hechtstaff000000 000000 diff -ur hips-1.2b-rc4/SRC/INCLUDE/hips.h hips-1.2b-rc4-okk/SRC/INCLUDE/hips.h --- hips-1.2b-rc4/SRC/INCLUDE/hips.h 2009-06-21 23:12:59.000000000 +0200 +++ hips-1.2b-rc4-okk/SRC/INCLUDE/hips.h 2010-06-17 10:42:14.000000000 +0200 @@ -122,6 +122,7 @@ #ifndef HIPS_H #define HIPS_H #include +#include #include "type.h" #ifdef INTL diff -ur hips-1.2b-rc4/SRC/INCLUDE/makefile hips-1.2b-rc4-okk/SRC/INCLUDE/makefile --- hips-1.2b-rc4/SRC/INCLUDE/makefile 2009-03-09 13:34:49.000000000 +0100 +++ hips-1.2b-rc4-okk/SRC/INCLUDE/makefile 2010-06-17 10:42:14.000000000 +0200 @@ -7,7 +7,7 @@ $(CP) -f hips.inc $(HIPS_DIR)/LIB/ hips.inc: hips_interface.F90 - $(CC) $(CC_OPT) -E hips_interface.F90 > hips.inc + $(CPP) $(CFLAGS) $(CC_OPT) hips_interface.F90 > hips.inc .h: $(CP) -f $< $(HIPS_DIR)/LIB/ Only in hips-1.2b-rc4-okk/SRC/INCLUDE: makefile.orig diff -ur hips-1.2b-rc4/SRC/INCLUDE/queue.h hips-1.2b-rc4-okk/SRC/INCLUDE/queue.h --- hips-1.2b-rc4/SRC/INCLUDE/queue.h 2009-06-21 23:12:57.000000000 +0200 +++ hips-1.2b-rc4-okk/SRC/INCLUDE/queue.h 2010-06-25 08:21:50.000000000 +0200 @@ -98,7 +98,7 @@ } Heap; -#define static +/*#define static*/ int Heap_Init (Heap *, dim_t size); void Heap_Exit (Heap *); diff -ur hips-1.2b-rc4/SRC/IO/io_hb.c hips-1.2b-rc4-okk/SRC/IO/io_hb.c --- hips-1.2b-rc4/SRC/IO/io_hb.c 2009-05-11 15:59:33.000000000 +0200 +++ hips-1.2b-rc4-okk/SRC/IO/io_hb.c 2010-06-17 10:42:14.000000000 +0200 @@ -222,7 +222,11 @@ #include #include #include +#ifdef __APPLE__ +#include +#else #include +#endif #include /** macros FSCANF and FGETS **/ diff -ur hips-1.2b-rc4/SRC/IO/io_hb.h hips-1.2b-rc4-okk/SRC/IO/io_hb.h --- hips-1.2b-rc4/SRC/IO/io_hb.h 2009-02-23 23:59:03.000000000 +0100 +++ hips-1.2b-rc4-okk/SRC/IO/io_hb.h 2010-06-17 10:42:14.000000000 +0200 @@ -5,7 +5,11 @@ #include #include +#ifdef __APPLE__ +#include +#else #include +#endif #ifdef __cplusplus extern "C" { #endif diff -ur hips-1.2b-rc4/SRC/IO/io_mm.c hips-1.2b-rc4-okk/SRC/IO/io_mm.c --- hips-1.2b-rc4/SRC/IO/io_mm.c 2009-05-11 15:59:33.000000000 +0200 +++ hips-1.2b-rc4-okk/SRC/IO/io_mm.c 2010-06-17 10:42:14.000000000 +0200 @@ -11,7 +11,11 @@ #include #include +#ifdef __APPLE__ +#include +#else #include +#endif #include diff -ur hips-1.2b-rc4/SRC/IO/makefile hips-1.2b-rc4-okk/SRC/IO/makefile --- hips-1.2b-rc4/SRC/IO/makefile 2009-03-19 18:13:16.000000000 +0100 +++ hips-1.2b-rc4-okk/SRC/IO/makefile 2010-06-17 10:42:14.000000000 +0200 @@ -17,7 +17,7 @@ $(AR) $(ARFLAGS) $(LIBIOMM) $(OBJ) uread.f90: template-uread.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E $< > $@ + $(CPP) $(CFLAGS) $(CC_OPT) $< > $@ %.o: %.c $(CC) $(CC_OPT) $< -c -o $@ Only in hips-1.2b-rc4-okk/SRC/IO: makefile.orig diff -ur hips-1.2b-rc4/SRC/SPKIT/makefile hips-1.2b-rc4-okk/SRC/SPKIT/makefile --- hips-1.2b-rc4/SRC/SPKIT/makefile 2009-03-19 18:13:16.000000000 +0100 +++ hips-1.2b-rc4-okk/SRC/SPKIT/makefile 2010-06-17 10:42:14.000000000 +0200 @@ -6,6 +6,7 @@ OBJ = $(TMP:.f90=.o) else OBJ = + AR = echo do nothing : ar endif default: $(OBJ) @@ -15,10 +16,10 @@ $(FC) $(FC_OPT) $< -c -o $@ skitfc.f90: template-skitfc.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E $< > $@ + $(CPP) $(CFLAGS) $(CC_OPT) $< > $@ skitf.f90: template-skitf.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E $< > $@ + $(CPP) $(CFLAGS) $(CC_OPT) $< > $@ clean: rm -f $(TMP) *.o *.ex* *core ./extras/core* out* \#* *~ Only in hips-1.2b-rc4-okk/SRC/SPKIT: makefile.orig diff -ur hips-1.2b-rc4/TESTS/PARALLEL/makefile hips-1.2b-rc4-okk/TESTS/PARALLEL/makefile --- hips-1.2b-rc4/TESTS/PARALLEL/makefile 2009-04-30 10:24:48.000000000 +0200 +++ hips-1.2b-rc4-okk/TESTS/PARALLEL/makefile 2010-06-17 10:42:14.000000000 +0200 @@ -41,17 +41,17 @@ $(MPICC) $(MPICC_OPT) $< -c -o $@ testHIPS1-Fortran.f90 : ../../SRC/INCLUDE/hips.inc templateHIPS1-Fortran.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E templateHIPS1-Fortran.F90 > testHIPS1-Fortran.f90 + $(CPP) $(CFLAGS) $(CC_OPT) templateHIPS1-Fortran.F90 > testHIPS1-Fortran.f90 testHIPS2-Fortran.f90 : ../../SRC/INCLUDE/hips.inc templateHIPS2-Fortran.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E templateHIPS2-Fortran.F90 > testHIPS2-Fortran.f90 + $(CPP) $(CFLAGS) $(CC_OPT) templateHIPS2-Fortran.F90 > testHIPS2-Fortran.f90 testHIPS3-Fortran.f90 : ../../SRC/INCLUDE/hips.inc templateHIPS3-Fortran.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E templateHIPS3-Fortran.F90 > testHIPS3-Fortran.f90 + $(CPP) $(CFLAGS) $(CC_OPT) templateHIPS3-Fortran.F90 > testHIPS3-Fortran.f90 testHIPS-Laplace1-Fortran.f90 : ../../SRC/INCLUDE/hips.inc templateHIPS-Laplace1-Fortran.F90 - $(CC) $(CFLAGS) $(CC_OPT) -E templateHIPS-Laplace1-Fortran.F90 > testHIPS-Laplace1-Fortran.f90 + $(CPP) $(CFLAGS) $(CC_OPT) templateHIPS-Laplace1-Fortran.F90 > testHIPS-Laplace1-Fortran.f90 testHIPS1-Fortran.o: testHIPS1-Fortran.f90 $(LIBHIPS) $(MPIFC) $(MPIFC_OPT) $< -c -o $@ Only in hips-1.2b-rc4-okk/TESTS/PARALLEL: makefile.orig Only in hips-1.2b-rc4-okk: makefile.inc Only in hips-1.2b-rc4-okk: tag-ff++ diff -ur hips-1.2b-rc4/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd.c~ hips-1.2b-rc4/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd.c --- hips-1.2b-rc4/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd.c~ 2009-06-21 23:13:12.000000000 +0200 +++ hips-1.2b-rc4/SRC/BLOCK/DBMATRIX/HIPS_Fgmresd.c 2012-09-04 10:08:08.000000000 +0200 @@ -80,7 +80,7 @@ assert(incx == incy); for(i=0; i $@ skitf.f90: template-skitf.F90 $(CPP) $(CFLAGS) $(CC_OPT) $< > $@ clean: rm -f $(TMP) *.o *.ex* *core ./extras/core* out* \#* *~ freefem++-3.61-1/download/tetgen/Makefile000755 000767 000024 00000004725 13256636774 020373 0ustar00hechtstaff000000 000000 # and compiling extra libraries # ----------------------------------------- include cxxflags all-local: tetgen # Downloading and compiling Tetgen # ------------------------------ # Tetgen information DIRPKG=../pkg tetgen_VERSION=1.5.1-beta1 SRCDIR=tetgen$(tetgen_VERSION) PACKAGE=$(DIRPKG)/tetgen$(tetgen_VERSION).tar.gz # FFCS - 6/11/12 - curl is not able to follow redirections from http://tetgen.org/files #SERVER=http://wias-berlin.de/software/tetgen/files INSTALL=../.. tetgen: FAIRE FAIRE:install.done $(SRCDIR)/FAIT cxxflags WHERE.done touch FAIRE # ALH - FFCS - 18/12/8 - need '-fPIC' on Linux64 because the .a will be used in a .so (by examples++-load/tetgen.cpp). # FFCS - 30/11/10 - need ranlib on Win64. The PATH is setup so that mingw/ranlib is called $(SRCDIR)/FAIT: $(SRCDIR)/tags cxxflags cd $(SRCDIR);$(CXX) $(CXXFLAGS) -O3 -fPIC -DSELF_CHECK -DNDEBUG -DTETLIBRARY -c tetgen.cxx cd $(SRCDIR);$(CXX) $(CXXFLAGS) -O0 -fPIC -DSELF_CHECK -DNDEBUG -DTETLIBRARY -c predicates.cxx touch $(SRCDIR)/FAIT WHERE:WHERE.done WHERE.done: $(SRCDIR)/FAIT echo tetgen LD -L@DIR@/lib -ltet >$(SRCDIR)/$(INSTALL)/lib/WHERE.tetgen echo tetgen INCLUDE -I@DIR@/include >> $(SRCDIR)/$(INSTALL)/lib/WHERE.tetgen touch $@ clean-local:: -rm WHERE.done # FFCS - avoid remaking install every time install.done:$(SRCDIR)/FAIT cd $(SRCDIR);$(AR) $(ARFLAGS) $(INSTALL)/lib/libtet.a tetgen.o predicates.o ranlib $(SRCDIR)/$(INSTALL)/lib/libtet.a cp $(SRCDIR)/tetgen.h $(SRCDIR)/$(INSTALL)/include touch $@ clean-local:: -rm install.done $(SRCDIR)/tags: $(PACKAGE) gunzip -c $(PACKAGE)|tar zxvf - # FFCS: needs to patch tetgen because mingw64 has 4-byte longs # cd tetgen1.4.3 && patch -u -p1 < ../patches.win64 touch $(SRCDIR)/tags # cd tetgen1.4.2;patch -p1 <../tetgen1.4.2.patch $(PACKAGE): ../getall -o TetGen -a clean-local:: -rm -rf tetgen1.?.* FAIT FAIRE clean: -rm $(SRCDIR)/$(INSTALL)/lib/libtet.a -rm $(SRCDIR)/$(INSTALL)/include/tetgen.h -rm FAIT *.done -rm -rf tetgen1.4.? cxxflags: ../Makefile Makefile grep 'CXX *=' ../Makefile >cxxflags grep 'CC *=' ../Makefile >>cxxflags # FFCS - 10/5/12 - bug under Windows if -O3 is specified tetgen never returns. It could also be the case under # Ubuntu. All optimisation options are removed for safety. grep 'CXXFLAGS *=' ../Makefile | sed 's/ -O[0-9]* / /g' >>cxxflags grep 'WGET *=' ../Makefile >>cxxflags grep 'AR *=' ../Makefile >>cxxflags grep 'ARFLAGS *=' ../Makefile >>cxxflags .PHONY:$(SRCDIR)/$(INSTALL)freefem++-3.61-1/download/tetgen/tetgen1.4.2.patch000644 000767 000024 00000003630 13256636774 021614 0ustar00hechtstaff000000 000000 diff -ur tetgen1.4.2/tetgen.cxx tetgen1.4.2-okk/tetgen.cxx --- tetgen1.4.2/tetgen.cxx 2007-04-16 16:45:11.000000000 +0200 +++ tetgen1.4.2-okk/tetgen.cxx 2009-05-25 10:37:19.000000000 +0200 @@ -3506,7 +3506,7 @@ // // /////////////////////////////////////////////////////////////////////////////// -void tetgenmesh::set_compfunc(char* str, int* itbytes, compfunc* pcomp) +void tetgenmesh::set_compfunc(const char* str, int* itbytes, compfunc* pcomp) { // First figure out whether it is a pointer or not. if (str[strlen(str) - 1] == '*') { @@ -25978,6 +25978,7 @@ } delete [] oldtetlist; delete [] newtetlist; + delete [] newpt; // Add by J. Morice for FreeFem++ (missing delete) Nov 2008 // Clear work lists. newsegshlist->clear(); spinshlist->clear(); diff -ur tetgen1.4.2/tetgen.h tetgen1.4.2-okk/tetgen.h --- tetgen1.4.2/tetgen.h 2007-04-16 16:45:13.000000000 +0200 +++ tetgen1.4.2-okk/tetgen.h 2009-05-25 10:37:41.000000000 +0200 @@ -980,7 +980,7 @@ // The function used to determine the size of primitive data types and // set the corresponding predefined linear order functions for them. - static void set_compfunc(char* str, int* itembytes, compfunc* pcomp); + static void set_compfunc(const char* str, int* itembytes, compfunc* pcomp); /////////////////////////////////////////////////////////////////////////////// // // @@ -1021,7 +1021,7 @@ list(int itbytes, compfunc pcomp, int mitems = 256, int exsize = 128) { listinit(itbytes, pcomp, mitems, exsize); } - list(char* str, int mitems = 256, int exsize = 128) { + list(const char* str, int mitems = 256, int exsize = 128) { set_compfunc(str, &itembytes, &comp); listinit(itembytes, comp, mitems, exsize); } freefem++-3.61-1/download/tetgen/patches.win64000644 000767 000024 00000012127 13256636774 021243 0ustar00hechtstaff000000 000000 # -*- mode:diff;coding:raw-text; -*- diff -u -p1 /home/alh/tmp/tetgen1.4.3/tetgen.cxx tetgen1.4.3/tetgen.cxx --- /home/alh/tmp/tetgen1.4.3/tetgen.cxx 2009-12-13 22:21:08.000000000 +0100 +++ tetgen1.4.3/tetgen.cxx 2010-11-24 15:47:44.253943800 +0100 @@ -4844,3 +4844,3 @@ void tetgenmesh::dummyinit(int tetwords, { - unsigned long alignptr; + unsigned FFCSLONG alignptr; @@ -4850,3 +4850,3 @@ void tetgenmesh::dummyinit(int tetwords, // Align 'dummytet' on a 'tetrahedrons->alignbytes'-byte boundary. - alignptr = (unsigned long) dummytetbase; + alignptr = (unsigned FFCSLONG) dummytetbase; dummytet = (tetrahedron *) @@ -4875,3 +4875,3 @@ void tetgenmesh::dummyinit(int tetwords, // Align 'dummysh' on a 'subfaces->alignbytes'-byte boundary. - alignptr = (unsigned long) dummyshbase; + alignptr = (unsigned FFCSLONG) dummyshbase; dummysh = (shellface *) @@ -15082,3 +15082,3 @@ void tetgenmesh::btree_insert(point inse point *ptary; - long arylen; // The array lenhgth is saved in ptary[0]. + FFCSLONG arylen; // The array lenhgth is saved in ptary[0]. @@ -15087,3 +15087,3 @@ void tetgenmesh::btree_insert(point inse // Get the current array length. - arylen = (long) ptary[0]; + arylen = (FFCSLONG) ptary[0]; // Insert the point into the node. @@ -15106,3 +15106,3 @@ void tetgenmesh::btree_search(point inse int ptsamples, ptidx; - long arylen; + FFCSLONG arylen; int i; @@ -15112,3 +15112,3 @@ void tetgenmesh::btree_search(point inse // Get the current array length. - arylen = (long) ptary[0]; + arylen = (FFCSLONG) ptary[0]; @@ -15165,3 +15165,3 @@ void tetgenmesh::ordervertices(point* ve point *ptary; - long arylen; + FFCSLONG arylen; int index, i, j; @@ -15186,3 +15186,3 @@ void tetgenmesh::ordervertices(point* ve ptary = *jpptary; - arylen = (long) ptary[0]; + arylen = (FFCSLONG) ptary[0]; for (j = 2; j <= arylen; j++) { // Skip the first point. @@ -21031,3 +21031,3 @@ bool tetgenmesh::delaunizecavity(arraypo printf(" Queue a subface x%lx (%d, %d, %d).\n", - (unsigned long) checksh.sh, pointmark(sorg(checksh)), + (unsigned FFCSLONG) checksh.sh, pointmark(sorg(checksh)), pointmark(sdest(checksh)), pointmark(sapex(checksh))); @@ -21081,3 +21081,3 @@ bool tetgenmesh::delaunizecavity(arraypo printf(" Queue a subface x%lx (%d, %d, %d).\n", - (unsigned long) checksh.sh, pointmark(sorg(checksh)), + (unsigned FFCSLONG) checksh.sh, pointmark(sorg(checksh)), pointmark(sdest(checksh)), pointmark(sapex(checksh))); @@ -23474,3 +23474,3 @@ bool tetgenmesh::carvecavity(list* newte printf(" Intet x%lx %d (%d, %d, %d, %d) is iversed.\n", - (unsigned long) intet.tet, intet.loc, pointmark(pa), + (unsigned FFCSLONG) intet.tet, intet.loc, pointmark(pa), pointmark(pb), pointmark(pc), pointmark(oppo(intet))); @@ -23544,3 +23544,3 @@ bool tetgenmesh::carvecavity(list* newte pointmark(org(neightet)), pointmark(dest(neightet)), - pointmark(apex(neightet)), (unsigned long) auxsh.sh); + pointmark(apex(neightet)), (unsigned FFCSLONG) auxsh.sh); printf(" p:draw_tet(%d, %d, %d, %d) -- in\n", @@ -33711,5 +33711,5 @@ int tetgenmesh::checksegments() printf(" Tet: x%lx (%d, %d, %d, %d) - Seg: x%lx (%d, %d).\n", - (unsigned long) tetloop.tet, pointmark(org(tetloop)), + (unsigned FFCSLONG) tetloop.tet, pointmark(org(tetloop)), pointmark(dest(tetloop)), pointmark(apex(tetloop)), - pointmark(oppo(tetloop)), (unsigned long) sseg.sh, + pointmark(oppo(tetloop)), (unsigned FFCSLONG) sseg.sh, pointmark(pa), pointmark(pb)); @@ -33725,3 +33725,3 @@ int tetgenmesh::checksegments() printf(" Tet: x%lx (%d, %d, %d, %d) - ", - (unsigned long) tetloop.tet, pointmark(org(tetloop)), + (unsigned FFCSLONG) tetloop.tet, pointmark(org(tetloop)), pointmark(dest(tetloop)), pointmark(apex(tetloop)), @@ -33729,3 +33729,3 @@ int tetgenmesh::checksegments() if (checkseg.sh != NULL) { - printf("Seg x%lx (%d, %d).\n", (unsigned long) checkseg.sh, + printf("Seg x%lx (%d, %d).\n", (unsigned FFCSLONG) checkseg.sh, pointmark(sorg(checkseg)), pointmark(sdest(checkseg))); diff -u -p1 /home/alh/tmp/tetgen1.4.3/tetgen.h tetgen1.4.3/tetgen.h --- /home/alh/tmp/tetgen1.4.3/tetgen.h 2009-12-13 22:20:33.000000000 +0100 +++ tetgen1.4.3/tetgen.h 2010-11-24 15:43:52.687137100 +0100 @@ -3318,5 +3318,12 @@ inline bool tetgenmesh::isfacehasedge(fa +// FFCS: mingw64 compiler refuses to convert 8-byte pointers to 4-byte longs +#ifdef WIN64 +#define FFCSLONG long long +#else +#define FFCSLONG long +#endif + inline bool tetgenmesh::issymexist(triface* t) { tetrahedron *ptr = (tetrahedron *) - ((unsigned long)(t->tet[t->loc]) & ~(unsigned long)7l); + ((unsigned FFCSLONG)(t->tet[t->loc]) & ~(unsigned FFCSLONG)7l); return ptr != dummytet; freefem++-3.61-1/download/f2c/Makefile000644 000767 000024 00000005743 13256636774 017555 0ustar00hechtstaff000000 000000 DIRPKG=../pkg LISTINST= ../bin/f2c ../bin/fort77 ../include/f2c.h ../lib/libf2c.a DIRINSTALL=/usr/local F2C_TAR=$(DIRPKG)/f2c.tar all:compile $(F2C_TAR): mkdir -p $(DIRPKG) $(WGET) # wget --passive-ftp ftp://netlib.bell-labs.com/netlib/f2c.tar curl http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/f2c -o "$(DIRPKG)/f2c.tar" f2c:$(F2C_TAR) f2c.h-int tar xvf $(F2C_TAR) gunzip -rf f2c/* gunzip -rf f2c/*/* cd f2c;unzip -d libf2c libf2c.zip for i in `find . -name f2c.h`; do cp f2c.h-int $$i; done f2c/libf2c/makefile: Makefile egrep -v 'ld -r|mv [$$]' f2c/libf2c/makefile compile:f2c f2c/libf2c/makefile cd f2c/src; make -f makefile.u f2c cd f2c/libf2c; make compile-10.4:f2c Makefile-MacOs cd f2c/src; make -f makefile.u f2c cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.4 compile-10.5:f2c Makefile-MacOs cd f2c/src; make -f makefile.u f2c cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.5 compile-10.6:f2c Makefile-MacOs cd f2c/src; make -f makefile.u f2c cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.6 install: ../lib ../include ../bin ../bin/fort77 ../bin/mpifort77 -mkdir ../bin cp f2c/src/f2c ../bin/. cp f2c/src/f2c.h ../include cp f2c/libf2c/libf2c.a ../lib ../bin/fort77 tt.f rm a.out install-10.4: compile-10.4 sudo make install-sudo make install install-10.5: compile-10.5 sudo make install-sudo make install install-10.6: compile-10.6 sudo make install-sudo make install install-sudo: $(DIRINSTALL)/bin/fort77 $(DIRINSTALL)/bin/mpifort77 mkdir -p $(DIRINSTALL)/bin $(DIRINSTALL)/include $(DIRINSTALL)/lib cp f2c/src/f2c $(DIRINSTALL)/bin; cp f2c/src/f2c.h $(DIRINSTALL)/include; cp f2c/libf2c/libf2c.a $(DIRINSTALL)/lib $(DIRINSTALL)/bin/fort77 tt.f rm a.out ../bin/fort77: fort77.sed Makefile dd="`pwd`/.." ; \ sed -e "s;@CC@;$(CC);"g \ -e "s;@INC@;-I$$dd/include;g" \ -e "s;@LLIBDIR@;-L$$dd/lib;g" \ -e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >../bin/fort77 chmod a+x ../bin/fort77 ../bin/mpifort77: fort77.sed Makefile dd="`pwd`/.." ; \ sed -e "s;@CC@;mpicc;"g \ -e "s;@INC@;-I$$dd/include;g" \ -e "s;@LLIBDIR@;-L$$dd/lib;g" \ -e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >../bin/fort77 chmod a+x ../bin/fort77 $(DIRINSTALL)/bin/fort77: fort77.sed Makefile dd="$(DIRINSTALL)/" ; \ sed -e "s;@CC@;$(CC);"g \ -e "s;@INC@;-I$$dd/include;g" \ -e "s;@LLIBDIR@;-L$$dd/lib;g" \ -e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >$(DIRINSTALL)/bin/fort77 chmod a+x $(DIRINSTALL)/bin/fort77 $(DIRINSTALL)/bin/mpifort77: fort77.sed Makefile dd="$(DIRINSTALL)/" ; \ sed -e "s;@CC@;mpicc;"g \ -e "s;@INC@;-I$$dd/include;g" \ -e "s;@LLIBDIR@;-L$$dd/lib;g" \ -e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >$(DIRINSTALL)/bin/fort77 chmod a+x $(DIRINSTALL)/bin/fort77 ../bin: mkdir ../bin ../lib: mkdir ../lib ../include: mkdir ../include clean-local: -rm -rf f2c *~ a.out clean:clean-local veryclean: clean -rm $(LISTINST) $(F2C_TAR) freefem++-3.61-1/download/f2c/Makefile-MacOs000644 000767 000024 00000016566 13256636774 020562 0ustar00hechtstaff000000 000000 # Unix makefile: see README. # For C++, first "make hadd". # If your compiler does not recognize ANSI C, add # -DKR_headers # to the CFLAGS = line below. # On Sun and other BSD systems that do not provide an ANSI sprintf, add # -DUSE_STRLEN # to the CFLAGS = line below. # On Linux systems, add # -DNON_UNIX_STDIO # to the CFLAGS = line below. For libf2c.so under Linux, also add # -fPIC # to the CFLAGS = line below. .SUFFIXES: .c .o CC = cc SHELL = /bin/sh ifeq (10.4,$(OS)) CC=gcc-4.0 LIST_ARCH=-arch ppc -arch i386 -arch ppc64 -arch x86_64 SDK=/Developer/SDKs/MacOSX10.4u.sdk endif ifeq (10.5,$(OS)) LIST_ARCH=-arch ppc -arch i386 -arch x86_64 -arch ppc64 SDK=/Developer/SDKs/MacOSX10.5.sdk endif ifeq (10.6,$(OS)) LIST_ARCH= -arch i386 -arch x86_64 SDK=/Developer/SDKs/MacOSX10.6.sdk endif CFLAGS = -O -isysroot $(SDK) $(LIST_ARCH) -mmacosx-version-min=$(OS) -DNO_My_ctype LDFLAGS=-Wl,-syslibroot,$(SDK) $(LIST_ARCH) AR=libtool -static -o LIBDIR=/usr/local/lib # compile, then strip unnecessary symbols .c.o: $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c ## Under Solaris (and other systems that do not understand ld -x), ## omit -x in the ld line above. ## If your system does not have the ld command, comment out ## or remove both the ld and mv lines above. MISC = f77vers.o i77vers.o main.o s_rnge.o abort_.o exit_.o getarg_.o iargc_.o\ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\ d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\ d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\ d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\ d_sqrt.o d_tan.o d_tanh.o INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o\ lbitbits.o lbitshft.o HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o EFL = ef1asc_.o ef1cmc_.o CHAR = f77_aloc.o s_cat.o s_cmp.o s_copy.o I77 = backspac.o close.o dfe.o dolio.o due.o endfile.o err.o\ fmt.o fmtlib.o ftell_.o iio.o ilnw.o inquire.o lread.o lwrite.o\ open.o rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o\ typesize.o uio.o util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o QINT = pow_qq.o qbitbits.o qbitshft.o ftell64_.o TIME = dtime_.o etime_.o # If you get an error compiling dtime_.c or etime_.c, try adding # -DUSE_CLOCK to the CFLAGS assignment above; if that does not work, # omit $(TIME) from OFILES = assignment below. # To get signed zeros in write statements on IEEE-arithmetic systems, # add -DSIGNED_ZEROS to the CFLAGS assignment below and add signbit.o # to the end of the OFILES = assignment below. # For INTEGER*8 support (which requires system-dependent adjustments to # f2c.h), add $(QINT) to the OFILES = assignment below... OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(I77) $(TIME) all: f2c.h signal1.h sysdep1.h libf2c.a libf2c.a: $(OFILES) libtool -static -o libf2c.a $(OFILES) ## Shared-library variant: the following rule works on Linux ## systems. Details are system-dependent. Under Linux, -fPIC ## must appear in the CFLAGS assignment when making libf2c.so. ## Under Solaris, use -Kpic in CFLAGS and use "ld -G" instead ## of "cc -shared". libf2c.so: $(OFILES) libtool -dynamic -o libf2c.dylib $(OFILES) # cc -shared -o libf2c.so $(OFILES) ### If your system lacks ranlib, you don't need it; see README. f77vers.o: f77vers.c $(CC) -c f77vers.c i77vers.o: i77vers.c $(CC) -c i77vers.c # To get an "f2c.h" for use with "f2c -C++", first "make hadd" hadd: f2c.h0 f2ch.add cat f2c.h0 f2ch.add >f2c.h # For use with "f2c" and "f2c -A": f2c.h: f2c.h0 cp f2c.h0 f2c.h # You may need to adjust signal1.h and sysdep1.h suitably for your system... signal1.h: signal1.h0 cp signal1.h0 signal1.h sysdep1.h: sysdep1.h0 cp sysdep1.h0 sysdep1.h # If your system lacks onexit() and you are not using an # ANSI C compiler, then you should uncomment the following # two lines (for compiling main.o): #main.o: main.c # $(CC) -c -DNO_ONEXIT -DSkip_f2c_Undefs main.c # On at least some Sun systems, it is more appropriate to # uncomment the following two lines: #main.o: main.c # $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c install: libf2c.a cp -p libf2c.a $(LIBDIR) #-ranlib $(LIBDIR)/libf2c.a clean: rm -f libf2c.a *.o arith.h signal1.h sysdep1.h backspac.o: fio.h close.o: fio.h dfe.o: fio.h dfe.o: fmt.h due.o: fio.h endfile.o: fio.h rawio.h err.o: fio.h rawio.h fmt.o: fio.h fmt.o: fmt.h iio.o: fio.h iio.o: fmt.h ilnw.o: fio.h ilnw.o: lio.h inquire.o: fio.h lread.o: fio.h lread.o: fmt.h lread.o: lio.h lread.o: fp.h lwrite.o: fio.h lwrite.o: fmt.h lwrite.o: lio.h open.o: fio.h rawio.h rdfmt.o: fio.h rdfmt.o: fmt.h rdfmt.o: fp.h rewind.o: fio.h rsfe.o: fio.h rsfe.o: fmt.h rsli.o: fio.h rsli.o: lio.h rsne.o: fio.h rsne.o: lio.h sfe.o: fio.h signbit.o: arith.h sue.o: fio.h uio.o: fio.h uninit.o: arith.h util.o: fio.h wref.o: fio.h wref.o: fmt.h wref.o: fp.h wrtfmt.o: fio.h wrtfmt.o: fmt.h wsfe.o: fio.h wsfe.o: fmt.h wsle.o: fio.h wsle.o: fmt.h wsle.o: lio.h wsne.o: fio.h wsne.o: lio.h xwsne.o: fio.h xwsne.o: lio.h xwsne.o: fmt.h arith.h: arithchk.c $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm ./a.out >arith.h rm -f a.out arithchk.o check: xsum Notice README abort_.c arithchk.c backspac.c c_abs.c c_cos.c \ c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c close.c comptry.bat \ d_abs.c d_acos.c d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c \ d_dim.c d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c \ d_nint.c d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c \ d_tanh.c derf_.c derfc_.c dfe.c dolio.c dtime_.c due.c ef1asc_.c \ ef1cmc_.c endfile.c erf_.c erfc_.c err.c etime_.c exit_.c f2c.h0 \ f2ch.add f77_aloc.c f77vers.c fio.h fmt.c fmt.h fmtlib.c \ fp.h ftell_.c ftell64_.c \ getarg_.c getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c \ h_mod.c h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c \ i77vers.c i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c \ i_nint.c i_sign.c iargc_.c iio.c ilnw.c inquire.c l_ge.c l_gt.c \ l_le.c l_lt.c lbitbits.c lbitshft.c libf2c.lbc libf2c.sy lio.h \ lread.c lwrite.c main.c makefile.sy makefile.u makefile.vc \ makefile.wat math.hvc mkfile.plan9 open.c pow_ci.c pow_dd.c \ pow_di.c pow_hh.c pow_ii.c pow_qq.c pow_ri.c pow_zi.c pow_zz.c \ qbitbits.c qbitshft.c r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c \ r_cnjg.c r_cos.c r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c \ r_log.c r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c \ r_tan.c r_tanh.c rawio.h rdfmt.c rewind.c rsfe.c rsli.c rsne.c \ s_cat.c s_cmp.c s_copy.c s_paus.c s_rnge.c s_stop.c scomptry.bat sfe.c \ sig_die.c signal1.h0 signal_.c signbit.c sue.c sysdep1.h0 system_.c \ typesize.c \ uio.c uninit.c util.c wref.c wrtfmt.c wsfe.c wsle.c wsne.c xwsne.c \ z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c >xsum1.out cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out freefem++-3.61-1/download/f2c/f2c.h-int000644 000767 000024 00000011151 13256636774 017516 0ustar00hechtstaff000000 000000 /* f2c.h -- Standard Fortran to C header file */ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ #ifndef F2C_INCLUDE #define F2C_INCLUDE /* set integer to int not to long */ typedef int integer; typedef unsigned int uinteger; typedef int logical; typedef char *address; typedef short int shortint; typedef float real; typedef double doublereal; typedef struct { real r, i; } complex; typedef struct { doublereal r, i; } doublecomplex; typedef short int shortlogical; typedef char logical1; typedef char integer1; #ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ typedef long long longint; /* system-dependent */ typedef unsigned long long ulongint; /* system-dependent */ #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) #endif #define TRUE_ (1) #define FALSE_ (0) /* Extern is for use with -E */ #ifndef Extern #define Extern extern #endif /* I/O stuff */ #ifdef f2c_i2 /* for -i2 */ typedef short flag; typedef short ftnlen; typedef short ftnint; #else typedef long int flag; typedef long int ftnlen; typedef long int ftnint; #endif /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /* inquire */ typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; #define VOID void union Multitype { /* for multiple entry points */ integer1 g; shortint h; integer i; /* longint j; */ real r; doublereal d; complex c; doublecomplex z; }; typedef union Multitype Multitype; /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ struct Vardesc { /* for Namelist */ char *name; char *addr; ftnlen *dims; int type; }; typedef struct Vardesc Vardesc; struct Namelist { char *name; Vardesc **vars; int nvars; }; typedef struct Namelist Namelist; #define abs(x) ((x) >= 0 ? (x) : -(x)) #define dabs(x) (doublereal)abs(x) #define min(a,b) ((a) <= (b) ? (a) : (b)) #define max(a,b) ((a) >= (b) ? (a) : (b)) #define dmin(a,b) (doublereal)min(a,b) #define dmax(a,b) (doublereal)max(a,b) #define bit_test(a,b) ((a) >> (b) & 1) #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) /* procedure parameter types for -A and -C++ */ #define F2C_proc_par_types 1 #ifdef __cplusplus typedef int /* Unknown procedure type */ (*U_fp)(...); typedef shortint (*J_fp)(...); typedef integer (*I_fp)(...); typedef real (*R_fp)(...); typedef doublereal (*D_fp)(...), (*E_fp)(...); typedef /* Complex */ VOID (*C_fp)(...); typedef /* Double Complex */ VOID (*Z_fp)(...); typedef logical (*L_fp)(...); typedef shortlogical (*K_fp)(...); typedef /* Character */ VOID (*H_fp)(...); typedef /* Subroutine */ int (*S_fp)(...); #else typedef int /* Unknown procedure type */ (*U_fp)(); typedef shortint (*J_fp)(); typedef integer (*I_fp)(); typedef real (*R_fp)(); typedef doublereal (*D_fp)(), (*E_fp)(); typedef /* Complex */ VOID (*C_fp)(); typedef /* Double Complex */ VOID (*Z_fp)(); typedef logical (*L_fp)(); typedef shortlogical (*K_fp)(); typedef /* Character */ VOID (*H_fp)(); typedef /* Subroutine */ int (*S_fp)(); #endif /* E_fp is for real functions when -R is not specified */ typedef VOID C_f; /* complex function */ typedef VOID H_f; /* character function */ typedef VOID Z_f; /* double complex function */ typedef doublereal E_f; /* real function with -R not specified */ /* undef any lower-case symbols that your C compiler predefines, e.g.: */ #ifndef Skip_f2c_Undefs #undef cray #undef gcos #undef mc68010 #undef mc68020 #undef mips #undef pdp11 #undef sgi #undef sparc #undef sun #undef sun2 #undef sun3 #undef sun4 #undef u370 #undef u3b #undef u3b2 #undef u3b5 #undef unix #undef vax #endif #endif freefem++-3.61-1/download/f2c/fort77.sed000644 000767 000024 00000017312 13256636774 017735 0ustar00hechtstaff000000 000000 #! /usr/bin/perl -w # fort77 (compiler driver) script for f2c # For use with gcc under Linux # This code is in the public domain; use at your own risk. # Parse options $version = "1.14a"; $nnflag = '-Nn802'; $tmpdir = $ENV{'TMPDIR'} || '/tmp'; $cpp = 0; $fast_math = 1; $debug = 0; $debugcmd = ""; push(@includes, "@INC@"); # Loop over all options; pull all options from @ARGV and put all # arguments into @argv. This is needed because, apparently, UNIX # compilers acceppt options anywhere on the command line. while ($_ = $ARGV[0]) { shift; if (!/^-/) { if (/\.P$/) { push(@pfiles, $_); } else { push(@argv, $_); } next; } # First, the f2c options. if (/^-[CUuaEhRrz]$/ || /^-I[24]$/ || /^-onetrip$/ || /^-![clPR]$/ || /^-ext$/ || /^-!bs$/ || /^-W[1-9][0-9]*$/ || /^-w8$/ || /^-w66$/ || /^-r8$/ || /^-N[^n][0-9]+$/) { push (@fopts, $_); } elsif (/^-Nn[0-9]+$/) { $nnflag = $_; } # Prototype flags for f2c elsif (/^-Ps?/) { $extract_prototypes ++; push (@fopts, $_); } # Does somebody want to run the preprocessor? elsif (/^-cpp$/) { $cpp++; } # These are common to both f2c and gcc elsif (/^-w$/) { push(@fopts, $_); push(@copts, $_); } # This is for the linker, too... elsif (/^-g$/) { push(@fopts, $_); push(@copts, $_); push(@lopts, $_); $debug ++; } # Special options for the different subprocesses: f for f2c step, # p for (separate) preprocessing, c for C compiler, l for linker. # a is also passed to the C compiler. elsif (/^-Wf,/) { push(@fopts, &parsewx($_)); } elsif (/-Wp,/) { push(@cppopts, &parsewx($_)); } elsif (/-W[ca],/) { push(@copts, &parsewx($_)); } elsif (/-Wl,/) { push(@lopts,&parsewx($_)); } # gcc only options # too many -f and -W options to list them all... # First, let's see wether somebody wants to adhere to the C standard # in Fortran. elsif (/^-fnofast-math$/) { $fast_math = 0; } elsif (/^-m64$/) { push(@copts, $_); push(@lopts, $_); } elsif (/^-m32$/) { push(@copts, $_); push(@lopts, $_); } # The '-f' option to f2c... elsif (/^-f$/) { push(@fopts, $_); } elsif (/^-[fWUAm]/ || /^-[Ex]$/ || /^-pipe$/ ) { push(@copts, $_); } # Includes and outputs... elsif (/^-I$/) { (@ARGV > 0) || die "$0: Missing argument to \"$_\"\n"; push(@includes, "-I".shift); } elsif (/^-I./) { push(@includes, $_); } elsif (/^-o$/) { (@ARGV > 0) || die "$0: Missing argument to \"$_\"\n"; $output = shift; } elsif (/^-o(.*)/) { $output = $1; } # Optimization elsif (/^-O/) { push(@copts, $_); push(@lopts, $_); $optimize ++; } # Options for both C compiler and linker elsif (/^-[Og]/ || /^-p$/ || /^-pg$/) { push(@copts, $_); push(@lopts, $_); } elsif (/^-[bV]$/ ) { (@ARGV > 0) || die "$0 : Missing argument to \"$_\"\n"; $arg = shift; push(@copts, $_, $arg); push(@lopts, $_, $arg); } elsif (/^-[bV]./ ) { push(@copts, $_); push(@lopts, $_); } # Linker only options elsif (/^-[lL]$/) { push(@lopts, $_); (@ARGV > 0) || die "$0: Missing argument to \"$_\"\n"; $_ = shift; push(@lopts, $_); } elsif (/^-[lL]./ || /^-nostartfiles$/ || /^-static$/ || /^-shared$/ || /^-symbolic$/) { push(@lopts, $_); } elsif (/^-[cS]$/) { $compile_only = $_; } elsif (/^-D/) { push(@cppopts, $_); } # Are we verbose? elsif (/^-v$/) { $verbose ++; } # Does somebody want to keep the C files around? elsif (/^-k$/) { $keep_c ++; } else { die "$0: Illegal option: $_\n"; } } push(@fopts,$nnflag); push(@copts,'-ffast-math') if $optimize && $fast_math; push(@cppopts,@includes); push(@fopts,@includes,"-I."); push(@fopts, @pfiles); if ($verbose) { print STDERR "$0: fort77 Version $version\n"; if ($verbose > 1) { push(@copts,"-v"); push(@lopts,"-v"); push(@cppopts,"-v"); } } @ARGV = @argv; if ($compile_only && $output && (@ARGV>1)) { warn "$0: Warning: $compile_only and -o with mutiple files, ignoring -o\n"; $output = ""; } die "$0: No input files specified\n" unless @ARGV; while ($_ = $ARGV[0]) { shift; $ffile = ""; $cfile = ""; $lfile = ""; $basefile = ""; if (/\.[fF]$/) { $ffile = $_; $basefile = $ffile; } elsif (/\.[cCisSm]$/ || /\.cc$/ || /\.cxx$/) { $cfile = $_; $basefile = $_; } else { push(@lfiles, $_); } if ($ffile) { &check_file_read($ffile); if ($keep_c) { $cfile = ($ffile =~ /([^\/]*\.).$/)[0] . "c"; } else { $seq ++; $cfile = "$tmpdir/fort77-$$-$seq.c"; } if ($debug) { $debugcmd = ' | /usr/bin/perl -p -e \'s/^(#line.*)""/$1"' . $ffile . '"/\' ' } if ($cpp || ($ffile =~ /\.F$/)) { # Backslashes at the end of comment lines confuse cpp... $pipe = "| /lib/cpp -traditional " . join(' ',@cppopts) . " | @f2c@ " . join(' ',@fopts) . $debugcmd . " > $cfile"; print STDERR "$0: Running \"$pipe\"" if $verbose; open(F2C,$pipe); open (FFILE, "$ffile") || die ("$0: Cannot open $ffile: $_\n"); while () { s/([cC*].*)\\$/$1/; print F2C $_; } close(FFILE); close(F2C); $retcode = $? / 256; } else { $retcode = &mysystem("@f2c@ ". join (" ",@fopts). " < ". $ffile . $debugcmd . " > $cfile")/256; } if ($retcode && !$keep_c) { print STDERR "$0: unlinking $cfile\n" if $verbose; unlink $cfile; die "$0: aborting compilation\n"; } # Separate the prototypes out from the C files. if ($extract_prototypes) { $pfile = ($basefile =~ /([^\/]*\.).$/)[0] . "P"; open(CFILE, "$cfile") || die ("$0: Cannot open $cfile\n"); # *wdh* while (($line = ) && while (defined($line = ) && ($line !~ '#ifdef P_R_O_T_O_T_Y_P_E_S\n')) { print $line; } if ($_) { open(PFILE, ">$pfile") || die ("$0: Cannot open $pfile\n"); # *wdh* while (($line = ) && ($line !~ '#endif')) { while (defined($line = ) && ($line !~ '#endif')) { print PFILE $line; } close(PFILE); } close(CFILE); } } # C compilation step. if ($cfile) { # *wdh* @command = ("cc",@cppopts,@copts); @command = ("@CC@",@cppopts,@copts); if ($compile_only && $output) { push(@command,'-o',$output,$compile_only); } elsif ((!$compile_only) || ($compile_only eq '-c')) { $lfile = ($basefile =~ /([^\/]*\.).$/)[0] . "o"; push(@command, '-c', '-o', $lfile); } elsif ($compile_only eq '-S') { $sfile = ($basefile =~ /([^\/]*\.).$/)[0] . "s"; push(@command, '-S', '-o', $sfile); } push(@command,$cfile); $retcode = &mysystem(@command)/256; if ($retcode) { die "$0: aborting compilation\n"; } if ($ffile && !$keep_c) { print STDERR "$0: unlinking $cfile\n" if $verbose; unlink $cfile; } if ($lfile) { push (@gener_lfiles, $lfile); push(@lfiles, $lfile); $lfile = ""; } } push (@lfiles, $lfile) if $lfile; } exit if $compile_only; push (@output, "-o", $output) if $output; $retcode = &mysystem("@CC@", @output, @lfiles, @lopts, "@LLIBDIR@","-lf2c", "-lm" ); if (@gener_lfiles) { print STDERR "$0: unlinking ",join(',',@gener_lfiles),"\n" if $verbose; unlink (@gener_lfiles); } exit $retcode; # Basically a system call, except that we want to be verbose if # necessary. sub mysystem { local (@args) = @_; if (@args == 1) { print STDERR "$0: Running \"$args[0]\"\n" if $verbose; system($args[0]); } else { print STDERR "$0: Running \"",join(' ',@args),"\"\n" if $verbose; system(@args); } } sub parsewx { local ($str) = @_; local(@tmp) = split(/,/,$str); shift(@tmp); return @tmp; } sub check_file_read { local ($name) = @_; open (TESTFILE,"$name") || die "Cannot open $name: $!\n"; close(TESTFILE); } freefem++-3.61-1/download/f2c/tt.f000644 000767 000024 00000000063 13256636774 016701 0ustar00hechtstaff000000 000000 program tt print *,"dgfgdfg" end freefem++-3.61-1/download/parmetis/Makefile-parmetis.in000644 000767 000024 00000001367 13256636774 023154 0ustar00hechtstaff000000 000000 # Which compiler to use CC = @CC@ LD= @CC@ # What optimization level to use OPTFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@ MPI_INCLUDE=@MPI_INCLUDE@ MPI_LIBC=@MPI_LIBC@ MPIRUN=@MPIRUN@ # What options to be used by the compiler # FFCS - add path to mpi.h (required for MacOS 10.8 + MacPorts OpenMPI) COPTIONS = -DHAVE_CONFIG_H -I. -I../../../.. -I'@MPI_INC_DIR@' @FFMETIS_CFLAGS@ #-D_MSC_VER # What options to be used by the loader LDOPTIONS = @LDFLAGS@ XTRALIBS= @MPI_LIBC@ # What archiving to use AR = @AR@ @ARFLAGS@ # What to use for indexing the archive RANLIB = @RANLIB@ #RANLIB = ar -ts #RANLIB = WGET = @WGET@ # hack to set -DUSE_GKREGEX if no regex.h => FF_HAVE_REGEX_H=0 USE_GKREGEX0=-DUSE_GKREGEX FLAGS_REGEX_H=$(USE_GKREGEX@FF_HAVE_REGEX_H@) freefem++-3.61-1/download/parmetis/makefile000755 000767 000024 00000015264 13256636774 020771 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- include Makefile.in all-local: parmetis # Downloading and compiling Tetgen # ------------------------------ # http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.tar.gz # Parmetis information DIRPKG=../pkg SRCDIR=parmetis-$(parmetis_VERSION) PACKAGE=$(DIRPKG)/ParMetis-$(parmetis_VERSION).tar.gz SERVER=http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis INSTALL=../.. parmetis_VERSION=4.0.3 parmetis: FAIRE test -z "$(MPIRUN)" ||$(MAKE) FAIRE-mpi $(SRCDIR)/FAIT: $(MAKE) install.done test -z "$(MPIRUN)" ||$(MAKE) $(SRCDIR)/FAIT-mpi -test -z "$(MPIRUN)" && rm $(SRCDIR)/FAIT-mpi touch $(SRCDIR)/FAIT $(SRCDIR)/FAIT-mpi: make install-mpi.done touch $(SRCDIR)/FAIT-mpi install.done:$(SRCDIR)/tag-compile -mkdir -p ../include/parmetis -mkdir -p ../lib/parmetis #test -z "$(MPIRUN)" || cp $(SRCDIR)/libparmetis.a ../lib/parmetis cp $(SRCDIR)/libmetis.a ../lib/parmetis cp $(SRCDIR)/include/*.h ../include/parmetis cp $(SRCDIR)/metis/include/*.h ../include/parmetis touch $@ install-mpi.done:$(SRCDIR)/tag-compile-mpi cp $(SRCDIR)/libparmetis.a ../lib/parmetis touch $@ FAIRE: $(SRCDIR)/FAIT $(MAKE) WHERE test -z "$(MPIRUN)" || $(MAKE) WHERE-mpi touch FAIRE FAIRE-mpi: $(SRCDIR)/FAIT-mpi $(MAKE) WHERE-mpi touch FAIRE-mpi METISCFLAGS=$(FLAGS_REGEX_H) $(CFLAGS) -I../GKlib -I../include -I. -D__thread= PMETISCFLAGS=$(MPI_INCLUDE) $(FLAGS_REGEX_H) $(CFLAGS) -I../metis/GKlib -I../metis/include -I../include -I. -D__thread= $(SRCDIR)/tag-compile: $(SRCDIR)/tags make -C $(SRCDIR)/metis/libmetis $(OBJS_METIS) "CC=$(CC)" "CFLAGS=$(METISCFLAGS)" make -C $(SRCDIR)/metis/GKlib $(OBJS_GK) "CC=$(CC)" CFLAGS="$(METISCFLAGS) -Dmetis_EXPORTS" # test -z "$(MPIRUN)" || make -C $(SRCDIR)/libparmetis $(OBJS_PARMETIS) "CC=$(CC)" "CFLAGS=$(PMETISCFLAGS)" -mkdir $(SRCDIR)/lib cd $(SRCDIR); $(AR) libmetis.a metis/libmetis/*.o metis/GKlib/*.o # test -z "$(MPIRUN)" ||(cd $(SRCDIR); $(AR) libparmetis.a libparmetis/*.o ) touch $(SRCDIR)/tag-compile $(SRCDIR)/tag-compile-mpi: $(SRCDIR)/tags make -C $(SRCDIR)/libparmetis $(OBJS_PARMETIS) "CC=$(CC)" "CFLAGS=$(PMETISCFLAGS)" -mkdir $(SRCDIR)/lib # cd $(SRCDIR); $(AR) libmetis.a metis/libmetis/*.o metis/GKlib/*.o (cd $(SRCDIR); $(AR) libparmetis.a libparmetis/*.o ) touch $(SRCDIR)/tag-compile-mpi WHERE: install.done -if [ -f $(SRCDIR)/FAIT ] ; then \ echo metis LD -L@DIR@/lib/parmetis -lmetis >$(SRCDIR)/$(INSTALL)/lib/WHERE.metis ;\ echo metis INCLUDE -I@DIR@/include/parmetis >> $(SRCDIR)/$(INSTALL)/lib/WHERE.metis ;\ fi WHERE-mpi: install-mpi.done -if [ -f $(SRCDIR)/FAIT-mpi ] ; then \ echo parmetis LD -L@DIR@/lib/parmetis -lparmetis -lmetis >$(SRCDIR)/$(INSTALL)/lib/WHERE.parmetis ;\ echo parmetis INCLUDE -I@DIR@/include/parmetis >> $(SRCDIR)/$(INSTALL)/lib/WHERE.parmetis ;\ fi OBJS_METIS=auxapi.o coarsen.o fm.o graph.o kwayrefine.o minconn.o options.o separator.o timing.o \ balance.o compress.o fortran.o initpart.o mcutil.o mincover.o parmetis.o sfm.o util.o \ bucketsort.o contig.o frename.o kmetis.o mesh.o mmd.o pmetis.o srefine.o wspace.o \ checkgraph.o debug.o gklib.o kwayfm.o meshpart.o ometis.o refine.o stat.o OBJS_GK=b64.o error.o fs.o graph.o itemsets.o omp.o random.o sort.o tokenizer.o \ blas.o evaluate.o getopt.o htable.o mcore.o pdb.o rw.o string.o util.o \ csr.o fkvkselect.o gkregex.o io.o memory.o pqueue.o seq.o timers.o OBJS_PARMETIS=akwayfm.o diffutil.o initpart.o move.o renumber.o wave.o \ ametis.o frename.o kmetis.o msetup.o rmetis.o weird.o \ balancemylink.o gkmetis.o kwayrefine.o node_refine.o selectq.o wspace.o \ comm.o gkmpi.o match.o ometis.o serial.o xyzpart.o \ csrmatch.o graph.o mdiffusion.o pspases.o stat.o \ ctrl.o initbalance.o mesh.o redomylink.o timer.o \ debug.o initmsection.o mmetis.o remap.o util.o # FFCS: patch is necessary for metis 4.0, but not for 4.0.3 $(SRCDIR)/tags: $(PACKAGE) tar xvzf $(PACKAGE) patch -p1 ../include/parmetis/metis.h # # FFCS - 23/5/12 - cannot keep name libmetis.a because it is identical to the library created by # [[file:../metis/Makefile]] and library path mechanisms at link time pick one for the other on MinGW. mv $(SRCDIR)/$(INSTALL)/lib/parmetis/libmetis.a $(SRCDIR)/$(INSTALL)/lib/parmetis/libmetis.a # -cd $(SRCDIR)/Programs && make touch $@ # FFCS - simpler makefile WHERE.done:install.done echo parmetis LD -L@DIR@/lib/parmetis -lparmetis -lmetis >$(SRCDIR)/$(INSTALL)/lib/WHERE.parmetis ; echo parmetis INCLUDE -I@DIR@/include/parmetis >> $(SRCDIR)/$(INSTALL)/lib/WHERE.parmetis ; touch $@ Makefile.in: ../../config.status Makefile-parmetis.in ../../config.status --file="Makefile.in:Makefile-parmetis.in" $(SRCDIR)/tags-old: $(PACKAGE) tar xvzf $(PACKAGE) mv $(SRCDIR)/Programs/Makefile $(SRCDIR)/Programs/Makefile-orig sed -e 's;BINDIR = .*$$;BINDIR = ../$(INSTALL)/bin;' \ -e 's;../libparmetis.a;../$(INSTALL)/lib/parmetis/libparmetis.a;' \ -e 's;../libmetis.a;../$(INSTALL)/lib/parmetis/libmetis.a;' \ -e 's;-L[.][.];-L../$(INSTALL)/lib/parmetis;' \ <$(SRCDIR)/Programs/Makefile-orig \ >$(SRCDIR)/Programs/Makefile mv $(SRCDIR)/ParMETISLib/Makefile $(SRCDIR)/ParMETISLib/Makefile-orig sed -e 's;../libparmetis.a;../$(INSTALL)/lib/parmetis/libparmetis.a;' \ -e 's;../libmetis.a;../$(INSTALL)/lib/parmetis/libmetis.a;' \ <$(SRCDIR)/ParMETISLib/Makefile-orig \ >$(SRCDIR)/ParMETISLib/Makefile mv $(SRCDIR)/METISLib/Makefile $(SRCDIR)/METISLib/Makefile-orig sed -e 's;../libparmetis.a;../$(INSTALL)/lib/parmetis/libparmetis.a;' \ -e 's;../libmetis.a;../$(INSTALL)/lib/parmetis/libmetis.a;' \ <$(SRCDIR)/METISLib/Makefile-orig \ >$(SRCDIR)/METISLib/Makefile touch $(SRCDIR)/tags $(PACKAGE): ../getall -o ParMETIS -a # FFCS - 23/5/12 - corrected bug in removing .a from ../lib clean: -cd $(SRCDIR) && $(MAKE) realclean -C $(SRCDIR) -rm Makefile.in $(SRCDIR)/tags -rm -rf ../lib/parmetis -rm -rf ../include/parmetis # -rm -rf ../include/metis -rm -rf $(SRCDIR) -rm *.done -rm FAIRE* WHERE* freefem++-3.61-1/download/parmetis/parmetis-4.0.3.patch000644 000767 000024 00000002327 13256636774 022567 0ustar00hechtstaff000000 000000 --- a/parmetis-4.0.3/metis/GKlib/gk_arch.h 2015-03-12 18:55:30.000000000 +0100 +++ b/parmetis-4.0.3/metis/GKlib/gk_arch.h 2015-03-12 20:27:25.000000000 +0100 @@ -41,7 +41,9 @@ #endif #include #include - #include +#ifndef __WIN32__ + #include +#endif #include #endif --- a/parmetis-4.0.3/metis/GKlib/gk_getopt.h 2013-03-30 17:24:50.000000000 +0100 +++ b/parmetis-4.0.3/metis/GKlib/gk_getopt.h 2015-03-26 14:26:48.000000000 +0100 @@ -52,11 +52,11 @@ /* Function prototypes */ -extern int gk_getopt(int __argc, char **__argv, char *__shortopts); -extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts, - struct gk_option *__longopts, int *__longind); -extern int gk_getopt_long_only (int __argc, char **__argv, - char *__shortopts, struct gk_option *__longopts, int *__longind); +extern int gk_getopt(int argc, char **argv, char *shortopts); +extern int gk_getopt_long(int argc, char **argv, char *shortopts, + struct gk_option *longopts, int *longind); +extern int gk_getopt_long_only (int argc, char **argv, + char *shortopts, struct gk_option *longopts, int *longind); freefem++-3.61-1/download/ipopt/Makefile.inc.in000644 000767 000024 00000000703 13256636774 021402 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ DOWNLOADFF= $(abs_top_builddir)/download CC = @CC@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ FC = @FC@ FCFLAGS = @FCFLAGS@ LIBBLAS = @BLASLIBS@ LIBLAPACK =@LAPACKLIBS@ WGET=@WGET@ CXXCPP=@CXXCPP@ host_os = @host_os@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ # <> ALH - 6/1/14 - Ipopt fails to guess FLIBS correctly on Windows+Cygwin+Mingw64 FLIBS=@FLIBS@ freefem++-3.61-1/download/ipopt/Makefile000755 000767 000024 00000005351 13312446271 020214 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- include Makefile.inc all-local: Ipopt # Downloading and compiling mumps # ------------------------------ DIR=$(DOWNLOADFF)/ipopt DIRPKG=../pkg SRCDIR=Ipopt-$(VERSION) PACKAGE=$(DIRPKG)/Ipopt-$(VERSION).tgz INSTALL=../.. VERSION=3.12.4 # 3.10.2 URL=http://www.coin-or.org/download/source/Ipopt FHSL=#$(DIRPKG)/ddeps.f $(DIRPKG)/ma27ad.f $(DIRPKG)/mc19d.f WHERE_MUMPSSEQ=$(wildcard ../lib/WHERE.mumpsseq) ifeq ($(WHERE_MUMPSSEQ),) LIBMUMPS=-ldmumps_seq -lzmumps_seq -lmumps_common_seq -lpord_seq -lmpiseq_seq INCMUMPS=/usr/include/mumps_seq else LIBMUMPS=-L$(DOWNLOADFF)/lib -ldmumpsFREEFEM-SEQ -lzmumpsFREEFEM-SEQ -lmumps_commonFREEFEM-SEQ -lpordFREEFEM-SEQ -lmpiseqFREEFEM-SEQ INCMUMPS=$(DOWNLOADFF)/include/mumps_seq endif #/Ipopt-3.10.2.tgz Ipopt: $(SRCDIR)/FAIRE # --enable-static --disable-shared # ALH - 6/1/14 - We need to specify FLIBS explicitely because Ipopt # fails to guess FLIBS correctly on Windows+Cygwin+Mingw64, see [[file:Makefile.inc.in::FLIBS]] $(SRCDIR)/FAIT: $(SRCDIR)/tag-tar # FFCS - disable dependency tracking like in FFCS itself for MinGW compilation (problem with backslashes, see # [[file:../../../../configure.ac::enable_dependency_tracking]]) cd $(SRCDIR) ; \ ./configure --disable-dependency-tracking \ --disable-shared --enable-static \ --with-mumps='$(LIBMUMPS)' \ --without-hsl \ --with-mumps-incdir='$(INCMUMPS)' \ CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS) -I$(INCMUMPS)' \ CC='$(CC)' CFLAGS='$(CFLAGS) -I$(INCMUMPS)' \ F77='$(FC)' FFLAGS='$(FCFLAGS)' \ FLIBS='$(FLIBS)' \ CXXCPP='$(CXXCPP)' CPP='$(CXXCPP)' \ --with-blas='$(LIBBLAS)' --with-lapack='$(LIBLAPACK)' --prefix='$(DOWNLOADFF)' -rm -rf ../include/coin touch $(SRCDIR)/FAIT # FFCS - avoid remaking install every time install.done: Makefile $(SRCDIR)/FAIT $(MAKE) -C $(SRCDIR) install touch $@ clean-local:: -rm *.done # FFCS - install and WHERE need to be sequential WHERE.done: install.done Makefile echo ipopt LD -L@DIR@/lib -lipopt >$(SRCDIR)/$(INSTALL)/lib/WHERE.Ipopt; echo ipopt INCLUDE -I@DIR@/include >> $(SRCDIR)/$(INSTALL)/lib/WHERE.Ipopt ; touch $@ Makefile.inc: ../../config.status --file="Makefile.inc:Makefile.inc.in" # FFCS - install and WHERE need to be sequential $(SRCDIR)/FAIRE: install.done WHERE.done touch $@ $(SRCDIR)/$(INSTALL): $(SRCDIR)/tag-tar $(SRCDIR)/tag-tar:$(PACKAGE) $(FHSL) tar xvzf $(PACKAGE) # patch -p0 // Prototypes for the BLAS routines extern "C" { @@ -57,6 +57,7 @@ int transa_len, int diag_len); } + namespace Ipopt { #ifndef HAVE_CBLAS @@ -65,8 +66,13 @@ Index incY) { ipfint n=size, INCX=incX, INCY=incY; - - return F77_FUNC(ddot,DDOT)(&n, x, &INCX, y, &INCY); + + Number s=0; + if( incX && incY ) s= F77_FUNC(ddot,DDOT)(&n, x, &INCX, y, &INCY) ; + else + for (int i=0,ix=0,iy=0; i Makefile.in; rm Makefile.inn ;; esac $(SRCDIR)/$(INSTALL): $(SRCDIR) cp Makefile.in $(SRCDIR)/makefile.in cd $(SRCDIR); $(MAKE) ./LIB/libparms$(DBG).a mkdir -p ../include/parms cp $(SRCDIR)/INCLUDE/*.h ../include/parms/ cp $(SRCDIR)/LIB/*.a ../lib/ $(SRCDIR): $(PACKAGE) tar xvzf $(PACKAGE) touch $(SRCDIR) $(PACKAGE): ../getall -o pARMS -a clean: -make cleanall -C $(SRCDIR)/src -rm Makefile.in ../lib/WHERE.parms -rm ../lib/libparms.* -rm -rf ../include/parms -rm -rf $(SRCDIR) # # FFCS - make sure that all directories are cleaned. This is especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) # -rm -rf pARMS_* -rm config.log # -rm $(PACKAGE) WHERE: echo parms LD -L@DIR@/lib -lparms$(DBG) >../lib/WHERE.parms echo parms INCLUDE -I@DIR@/include/parms >> ../lib/WHERE.parms .PHONY:$(SRCDIR)/$(INSTALL) freefem++-3.61-1/download/parms/makefile-parms.in000644 000767 000024 00000003401 13256636774 021777 0ustar00hechtstaff000000 000000 abs_top_builddir = @abs_top_builddir@ WGET=@WGET@ # FFCS - let "make clean" work even if include file is not found -include $(abs_top_builddir)/download/headers-sparsesolver.inc # path for this directory PARMS_ROOT = $(abs_top_builddir)/download/parms/pARMS_2.2 # name used for architecture ARCH = LINUX DARCH = -D$(ARCH) # variable to declare optimization level # use '-g' to create libparms for debugging purposes DBG = -O3 # to make pARMS name compatible with other linear algebra software # such as PETSc, assign DCHNAME as: DCHNAME = -DPETSC DCHNAME = # archive command AR = @AR@ #ar ARFLAGS = @ARFLAGS@ #cr #==================================================================== #==================================================================== # Options for a generic LINUX configuration ################################# CC = @MPICC@ # FFCS - "-I MPI_INC_DIR" required on MacOS 10.8 MacPorts+OpenMPI CFLAGS = $(DBG) $(DARCH) $(DCHNAME) @CFLAGS@ -I "@MPI_INC_DIR@" INCLUDE_METIS = #-I METIS_HOME = #-L/Users/morice/work/ParMetis-3.1.1/ -lparmetis -lmetis # fortran compiler / linker FC = @MPIFC@ # ALH - add no-range-check for Windows (hexadecimal parameter constants like # [[file:c:/cygwin/home/alh/ffcs/rel/mingw/mpif.h::PARAMETER MPI_SHORT_INT z 8c000003]] # are rejected without this. See [[file:../../configure.ac::NO_RANGE_CHECK]] FFLAGS = $(DBG) $(DARCH) @FFLAGS@ @NO_RANGE_CHECK@ # the directory of MPI library. for example -L/usr/local/mpich/lib LFLAGS_MPI = $(FFMPIINCLUDE) # the mpi library LIBS_MPI = $(FFMPILIB) # the directory of BLAS LFLAGS_BLAS = $(FFBLASINCLUDE) # the BLAS library LIBS_BLAS = $(FFBLASLIB) @LIBSPTHREAD@ #LINKER LINKER = $(FC) #LINK OPTION LINK_OPT = #-nofor_main pour ifort compiler freefem++-3.61-1/download/mmg3d/Makefile000644 000767 000024 00000007266 13256636774 020114 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- all-local: mmg3d include ff-flags # Downloading and compiling mmg3d # ------------------------------- # DIRPKG= ../pkg SRCDIR= ./mmg3d4 PACKAGE=$(DIRPKG)/mmg3d4.0.tgz INSTALL=.. mmg3d_VERSION= # mmg3d pas sur internet LIBMMG3D=$(INSTALL)/lib/libmmg3d-v4.a OPT=4 # size of the PKG file ( this file change See Cecile.) FFCS - 19/2/13 - the test for the file size (`stat -f "%z" file`) # is not portable from MacOS, so just leave it out in FFCS (SIZEPKG is still useful to force a remake when the package # changes) SIZEPKG=158547 OBJS= analar.o chkmsh.o hash.o memory.o optcte.o outqua.o simu44.o swap44.o zaldy.o \ analarcutting.o chrono.o heap.o mmg3d1.o optlap.o pattern.o simu56.o swap56.o \ baryct.o colpoi.o inout.o mmg3d4.o optlen.o quality.o simu68.o swap68.o \ boulep.o coquil.o length.o mmg3d9.o optlentet.o queue.o simu710.o swap710.o \ bucket.o cutelt.o librnbg.o movevertex.o optra4.o ratio.o solmap.o swapar.o \ delaunay.o locate.o optbdry.o opttet.o scalem.o spledg.o swaptet.o \ cenrad.o eigenv.o matrix.o optcoq.o opttyp.o simu23.o swap23.o typelt.o OBJSNOP = cendel.o swapar.o # FFCS - simplify Makefile structure mmg3d:WHERE.done mmg3d4/FAIT-4.done:tag-tar-$(SIZEPKG) echo "#define COMPIL " '"' `date` '"' > ./mmg3d4/build/sources/compil.date cd mmg3d4/build/sources/; $(MAKE) CC='$(CC)' CFLAGS='$(CNOFLAGS) -g' $(OBJSNOP) cd mmg3d4/build/sources/; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -g' $(OBJS) cd mmg3d4/build/sources/mmg3dmain; $(CC) -c $(CFLAGS) mmg3d.c -I.. $(AR) $(ARFLAGS) $(LIBMMG3D) mmg3d4/build/sources/*.o mmg3d4/build/sources/mmg3dmain/mmg3d.o # # FFCS - ranlib required on Windows 7 64 bits # $(RANLIB) $(LIBMMG3D) -$(CC) $(CNOFLAGS) mmg3d4/build/sources/mmg3dmain/mmg3d.o mmg3d4/build/sources/*.o -o ../bin/mmg3d $(STD_LIBS) touch mmg3d4/FAIT-4.done # FFCS - simplify Makefile structure install-4.done:mmg3d4/FAIT-4.done -mkdir ../include/mmg3d-v4/ cp mmg3d4/build/sources/*.h ../include/mmg3d-v4/ touch $@ clean:: -rm install-4.done mmg3d-4:$(PACKAGE) install:install-4.done WHERE.done # FFCS - keep simplest makefile structure for automatic recompilations WHERE.done: install-4.done echo mmg3d-v4 LD -L@DIR@/lib -lmmg3d-v4 >../lib/WHERE.mmg3d ; echo mmg3d-v4 INCLUDE -I@DIR@/include/mmg3d-v4>> ../lib/WHERE.mmg3d ; echo build WHERE ./lib/WHERE.mmg3d ; touch $@ clean:: -rm WHERE.done FAIRE: mmg3d4/FAIT-4.done install-4.done # FFCS - keep it simple tag-tar-$(SIZEPKG): $(PACKAGE) patch-mmg3dv4.diff -rm -rf mmg3d4 tar xvzf $(PACKAGE) touch mmg3d4/build/sources/dataff.h # # ALH - clean-up all CR/LF to make patching more successful # ../../build/cleancrlf mmg3d4 # cd mmg3d4;patch -p1 <../patch-mmg3dv4.diff cat mmg3d4/build/sources/mmg3dConfig.h touch tag-tar-$(SIZEPKG) # cp makefile-mmg3d.inc $(SRCDIR)/makefile $(PACKAGE): ../getall -o MMG3D -a clean:: -rm ff-flags # # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) # -rm -r mmg3d4 -rm FAIT* mmg* flags-* tag-tar* #FH -rm $(PACKAGE) ff-flags: ../Makefile Makefile grep 'abs_top_builddir *=' ../Makefile > ff-flags grep 'CC *=' ../Makefile >> ff-flags grep 'CFLAGS *=' ../Makefile >> ff-flags grep 'LDFLAGS *=' ../Makefile >> ff-flags grep 'AR *=' ../Makefile >> ff-flags grep 'ARFLAGS *=' ../Makefile >> ff-flags grep 'RANLIB *=' ../Makefile >> ff-flags grep 'WGET *=' ../Makefile >> ff-flags grep 'STD_LIBS *=' ../Makefile >> ff-flags grep 'CNOFLAGS *=' ../Makefile >> ff-flags .PHONY:$(SRCDIR)/$(INSTALL)freefem++-3.61-1/download/mmg3d/patch-mmg3dv4.diff000644 000767 000024 00000314237 13256636774 021663 0ustar00hechtstaff000000 000000 >diff -r -u mmg3d4/build/sources/analarcutting.c mmg3d4-new/build/sources/analarcutting.c --- mmg3d4/build/sources/analarcutting.c 2012-12-19 16:05:32.000000000 +0100 +++ mmg3d4-new/build/sources/analarcutting.c 2013-01-18 16:33:45.000000000 +0100 @@ -307,7 +307,7 @@ printf("6 cut : %8d\n",n6); printf("---------------------------\n"); */ if ( !na ) return(na); -#warning check memory allocation + // #warning check memory allocation //printf("%d cut init --- nb tet %d\n",na,mesh->ne); return(na); diff -r -u mmg3d4/build/sources/cutelt.c mmg3d4-new/build/sources/cutelt.c --- mmg3d4/build/sources/cutelt.c 2012-12-19 16:05:32.000000000 +0100 +++ mmg3d4-new/build/sources/cutelt.c 2013-01-18 16:35:41.000000000 +0100 @@ -305,8 +305,7 @@ // } // return(1); // } -int ddebug=0; - +extern int ddebug; int MMG_decouphex(pMesh mesh, pHedge hed,int k,int* p,int ref) { pTetra pt; int i,nu1,nu2; diff -r -u mmg3d4/build/sources/dataff.h mmg3d4-new/build/sources/dataff.h --- mmg3d4/build/sources/dataff.h 2013-01-18 21:52:48.000000000 +0100 +++ mmg3d4-new/build/sources/dataff.h 2013-01-18 18:50:04.000000000 +0100 @@ -0,0 +1,60 @@ +/* + * dataff.h + * + * + * Created by Fr\E9d\E9ric Hecht on 19/06/11. + * Copyright 2011 UPMC. All rights reserved. + * + + */ + +enum ff_data_type { + ff_id_vertex =0, + ff_id_seg =1, + ff_id_tria=2, + ff_id_tet =3, + + ff_id_prism =5, + ff_id_hex =6, + ff_id_quad =7, + ff_id_corner=8 +} ; + + +typedef struct DataFF +{ + const char * meshname; + const char * movename; + const char * solname; + int imprim; + int memory; + int np; // nb of vertices in/out + int typesol; // 1 iso , 6 : m11; m12,m13,m22,m23,m33 + void * mesh; + double * sol; /* metric :size typesol*np */ + double * mov; /* displac. size :3*np */ + void (*set_mesh)(void *dataff,int *data,int ldata); + void (*end_mesh)(void *dataff); + void (*set_v)(void *dataff,int i,double *xyz,int lab); + void (*set_elmt)(void *dataff,int ff_id,int i,int *k,int lab); + void (*get_mesh)(void *dataff,int *data,int ldata); + void (*get_v3)(void *dataff,int i,double *xyz,int *lab); + void (*get_elmt)(void *dataff,int ff_id,int i,int *k,int *lab); +} DataFF; + +#ifdef __cplusplus +extern "C" { +#endif + int mainmmg3d(int argc,char *argv[],DataFF *dataff); + +#ifdef __cplusplus +} +#endif +/* + m11 = met[0] + m12 = met[1] + m13 = met[2] + m22 = met[3] + m23 = met[4] + m33 = met[5] +*/ diff -r -u mmg3d4/build/sources/delaunay.c mmg3d4-new/build/sources/delaunay.c --- mmg3d4/build/sources/delaunay.c 2012-12-19 16:05:32.000000000 +0100 +++ mmg3d4-new/build/sources/delaunay.c 2013-01-18 16:32:41.000000000 +0100 @@ -728,7 +728,7 @@ if ( ppt->tag & M_UNUSED ) return(0); tref = mesh->tetra[list->tetra[1]/6].ref; -#warning remove this test + // #warning remove this test for (k=1; k<=lon; k++) if(tref!=mesh->tetra[list->tetra[k]/6].ref) printf("pbs coquil %d %d tet %d\n",tref,mesh->tetra[list->tetra[k]/6].ref,list->tetra[k]/6); diff -r -u mmg3d4/build/sources/libmmg3d.h mmg3d4-new/build/sources/libmmg3d.h --- mmg3d4/build/sources/libmmg3d.h 2012-12-19 16:05:36.000000000 +0100 +++ mmg3d4-new/build/sources/libmmg3d.h 2013-01-18 16:32:41.000000000 +0100 @@ -118,12 +118,12 @@ typedef MMG_Sol * MMG_pSol; /* inout */ -int MMG_loadMesh(MMG_pMesh ,char *); -int MMG_loadSol(MMG_pSol ,char *,int ); -int MMG_loadVect(MMG_pMesh ,char *,int ); -int MMG_saveMesh(MMG_pMesh ,char *); -int MMG_saveSol(MMG_pMesh ,MMG_pSol ,char *); -int MMG_saveVect(MMG_pMesh ,char *); +int MMG_loadMesh(MMG_pMesh ,char *,void *); +int MMG_loadSol(MMG_pSol ,char *,int ,void *); +int MMG_loadVect(MMG_pMesh ,char *,int ,void *); +int MMG_saveMesh(MMG_pMesh ,char *,void *); +int MMG_saveSol(MMG_pMesh ,MMG_pSol ,char *,void *); +int MMG_saveVect(MMG_pMesh ,char *,void *); #ifdef __cplusplus namespace mmg3d{ diff -r -u mmg3d4/build/sources/mesh.h mmg3d4-new/build/sources/mesh.h --- mmg3d4/build/sources/mesh.h 2012-12-19 16:05:36.000000000 +0100 +++ mmg3d4-new/build/sources/mesh.h 2013-01-18 16:32:41.000000000 +0100 @@ -405,17 +405,17 @@ /* function pointers */ typedef int (*MMG_Swap)(pMesh ,pSol ,pList ); -MMG_Swap MMG_swpptr; -double (*MMG_length)(double *,double *,double *,double *); -double (*MMG_caltet)(pMesh ,pSol ,int ); -double (*MMG_calte1)(pMesh ,pSol ,int ); -int (*MMG_caltet2)(pMesh ,pSol ,int ,int ,double ,double *); -int (*MMG_cavity)(pMesh ,pSol ,int ,int ,pList ,int ); -int (*MMG_buckin)(pMesh ,pSol ,pBucket ,int ); -int (*MMG_optlen)(pMesh ,pSol ,double ,int ); -int (*MMG_interp)(double *,double *,double *,double ); -int (*MMG_optlentet)(pMesh ,pSol ,pQueue ,double ,int ,int ); -int (*MMG_movevertex)(pMesh ,pSol ,int ,int ); +extern MMG_Swap MMG_swpptr; +extern double (*MMG_length)(double *,double *,double *,double *); +extern double (*MMG_caltet)(pMesh ,pSol ,int ); +extern double (*MMG_calte1)(pMesh ,pSol ,int ); +extern int (*MMG_caltet2)(pMesh ,pSol ,int ,int ,double ,double *); +extern int (*MMG_cavity)(pMesh ,pSol ,int ,int ,pList ,int ); +extern int (*MMG_buckin)(pMesh ,pSol ,pBucket ,int ); +extern int (*MMG_optlen)(pMesh ,pSol ,double ,int ); +extern int (*MMG_interp)(double *,double *,double *,double ); +extern int (*MMG_optlentet)(pMesh ,pSol ,pQueue ,double ,int ,int ); +extern int (*MMG_movevertex)(pMesh ,pSol ,int ,int ); #endif diff -r -u mmg3d4/build/sources/mmg3d4.c mmg3d4-new/build/sources/mmg3d4.c --- mmg3d4/build/sources/mmg3d4.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/mmg3d4.c 2013-01-18 18:28:05.000000000 +0100 @@ -3,32 +3,32 @@ Co-auteurs : Cecile Dobrzynski et Pascal Frey. Propriétaires :IPB - UPMC -INRIA. -Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, +Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, diffusé sous les termes et conditions de la licence publique générale de GNU -Version 3 ou toute version ultérieure. +Version 3 ou toute version ultérieure. Ce fichier est une partie de MMG3D. MMG3D est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la licence publique générale de GNU Version 3 ou toute version ultérieure. -MMG3D est distribué dans l'espoir qu'il sera utile, mais SANS -AUCUNE GARANTIE ; sans même garantie de valeur marchande. +MMG3D est distribué dans l'espoir qu'il sera utile, mais SANS +AUCUNE GARANTIE ; sans même garantie de valeur marchande. Voir la licence publique générale de GNU pour plus de détails. -MMG3D est diffusé en espérant qu’il sera utile, -mais SANS AUCUNE GARANTIE, ni explicite ni implicite, -y compris les garanties de commercialisation ou -d’adaptation dans un but spécifique. +MMG3D est diffusé en espérant qu’il sera utile, +mais SANS AUCUNE GARANTIE, ni explicite ni implicite, +y compris les garanties de commercialisation ou +d’adaptation dans un but spécifique. Reportez-vous à la licence publique générale de GNU pour plus de détails. -Vous devez avoir reçu une copie de la licence publique générale de GNU -en même temps que ce document. +Vous devez avoir reçu une copie de la licence publique générale de GNU +en même temps que ce document. Si ce n’est pas le cas, aller voir . /**************************************************************************** Initial software: MMG3D Version 4.0 Co-authors: Cecile Dobrzynski et Pascal Frey. Owners: IPB - UPMC -INRIA. -Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, -spread under the terms and conditions of the license GNU General Public License +Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, +spread under the terms and conditions of the license GNU General Public License as published Version 3, or (at your option) any later version. This file is part of MMG3D @@ -41,26 +41,26 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with MMG3D. If not, see . +along with MMG3D. If not, see . ****************************************************************************/ #include "mesh.h" -int MMG_npuiss,MMG_nvol,MMG_npres; -int MMG_nlen,MMG_ncal,MMG_ntopo,MMG_nex; -int MMG_npuisstot,MMG_nvoltot,MMG_nprestot; -int MMG_npdtot; -int MMG_nplen,MMG_npref,MMG_bouffe; +extern int MMG_npuiss,MMG_nvol,MMG_npres; +extern int MMG_nlen,MMG_ncal,MMG_ntopo,MMG_nex; +extern int MMG_npuisstot,MMG_nvoltot,MMG_nprestot; +extern int MMG_npdtot; +extern int MMG_nplen,MMG_npref,MMG_bouffe; int ddebug; int MMG_mmg3d4(pMesh mesh,pSol sol,int *alert) { Hedge hash; - pBucket bucket; + pBucket bucket; double declic; - int base,na,nd,ns,nna,nnd,nns,dd,it,nf,maxtou; - double lmoy,LLLONG; - int k; - pTetra pt; + int base,na,nd,ns,nna,nnd,nns,dd,it,nf,maxtou; + double lmoy,LLLONG; + int k; + pTetra pt; if ( abs(mesh->info.imprim) > 3 ) fprintf(stdout," ** SIZE OPTIMIZATION\n"); if ( mesh->info.imprim < 0 ) { @@ -73,82 +73,82 @@ maxtou = 10; nna = nns = nnd = 0; it = 0; - declic = 3. / ALPHAD; + declic = 3. / ALPHAD; lmoy = 10.; LLLONG = 1.5; - + nna = 10; - do { - na = nd = ns = 0; + do { + na = nd = ns = 0; if(0) ddebug = 1; else ddebug = 0; - + if(it && !(it%2) ) { bucket = MMG_newBucket(mesh,M_MAX(mesh->info.bucksiz,BUCKSIZ)); if ( !bucket ) return(0); - //MMG_saveMesh(mesh,"avtana.mesh"); - MMG_analar(mesh,sol,bucket,&na,&nd,&nf,alert); - //MMG_saveMesh(mesh,"apresana.mesh"); - if ( abs(mesh->info.imprim) > 5 ) - fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); - - M_free(bucket->head); - M_free(bucket->link); - M_free(bucket); - + //MMG_saveMesh(mesh,"avtana.mesh",0); + MMG_analar(mesh,sol,bucket,&na,&nd,&nf,alert); + //MMG_saveMesh(mesh,"apresana.mesh",0); + if ( abs(mesh->info.imprim) > 5 ) + fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); + + M_free(bucket->head); + M_free(bucket->link); + M_free(bucket); + } else { - ++mesh->flag; + ++mesh->flag; } - //printf("IT %d $$$$$$$$$$$ LLLONG %9.3f\n",it,LLLONG); - nna = nns = nnd = 0; - + //printf("IT %d $$$$$$$$$$$ LLLONG %9.3f\n",it,LLLONG); + nna = nns = nnd = 0; + /*splitting*/ if ( !mesh->info.noinsert && (!*alert) ) { /* store points on edges */ if ( !MMG_zaldy4(&hash,mesh->np) ) { - if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM.\n"); - *alert = 2; - break; + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM.\n"); + *alert = 2; + break; } - nna = MMG_analarcutting(mesh,sol,&hash,alert,&lmoy,LLLONG); + nna = MMG_analarcutting(mesh,sol,&hash,alert,&lmoy,LLLONG); if ( abs(mesh->info.imprim) > 5 ) { printf("lmoy %9.5f\n",lmoy); } /*puts("--------------------------------------"); - puts("--------------------------------------"); - puts("--------------------------------------"); - */ + puts("--------------------------------------"); + puts("--------------------------------------"); + */ if ( *alert ) { - fprintf(stdout," \n\n ** UNABLE TO CUT (analarcutting)\n"); - fprintf(stdout," ** RETRY WITH -m > %6d \n\n",mesh->info.memory); - MMG_saveMesh(mesh,"crash.mesh"); - MMG_saveSol(mesh,sol,"crash.sol"); - exit(0); + fprintf(stdout," \n\n ** UNABLE TO CUT (analarcutting)\n"); + fprintf(stdout," ** RETRY WITH -m > %6d \n\n",mesh->info.memory); + MMG_saveMesh(mesh,"crash.mesh",0); + MMG_saveSol(mesh,sol,"crash.sol",0); + exit(0); } - M_free(hash.item); + M_free(hash.item); } - else if ( *alert ) nna = 0; - /* adjacencies */ + else if ( *alert ) nna = 0; + /* adjacencies */ if ( nna /*|| it == (maxtou-1)*/ ) { mesh->nt = 0; if ( !MMG_hashTetra(mesh) ) return(0); if ( !MMG_markBdry(mesh) ) return(0); } - // printf("chkmsh\n"); - // MMG_unscaleMesh(mesh,sol); - // MMG_saveMesh(mesh,"chk.mesh"); + // printf("chkmsh\n"); + // MMG_unscaleMesh(mesh,sol); + // MMG_saveMesh(mesh,"chk.mesh",0); //MMG_chkmsh(mesh,1,-1); - //if(it==1)exit(0); - /* delaunization */ - if ( !mesh->info.noswap && (nna || na) ) { + //if(it==1)exit(0); + /* delaunization */ + if ( !mesh->info.noswap && (nna || na) ) { nns = MMG_cendel(mesh,sol,declic,base); } /* deletion */ /*if ( 0 && nna ) { nnd = MMG_colvert(mesh,sol,base); - } */ + } */ if ( nna+nnd+nns && abs(mesh->info.imprim) > 3 ) fprintf(stdout," %7d INSERTED %7d REMOVED %7d FLIPPED\n",nna+na,nnd+nd,nns); - + } while ( na+nd+nns+nna+nnd > 0 && ++it < maxtou && lmoy > 1.3); @@ -161,80 +161,80 @@ MMG_prilen(mesh,sol); } - //return(1); - //MMG_saveMesh(mesh,"aprescut.mesh"); - fprintf(stdout," ---\n"); - + //return(1); + //MMG_saveMesh(mesh,"aprescut.mesh",0); + fprintf(stdout," ---\n"); + /*analyze standard*/ - base = mesh->flag; - *alert = 0; + base = mesh->flag; + *alert = 0; - nna = 0; - nnd = 0; - nf = 0; - it = 0; - maxtou = 100; - MMG_npdtot=0; - MMG_npuisstot=0; - MMG_nprestot=0; - MMG_nvoltot=0; - - /* 2. field points */ - if ( mesh->info.imprim < -4 ) { - MMG_prilen(mesh,sol); - fprintf(stdout," -- FIELD POINTS\n"); - } - - /* create filter */ - bucket = MMG_newBucket(mesh,M_MAX(mesh->info.bucksiz,BUCKSIZ)); - if ( !bucket ) return(0); - - do { - MMG_analar(mesh,sol,bucket,&na,&nd,&nf,alert); - nna += na; - nnd += nd; - if ( *alert ) { - if ( nd < 1000 ) break; - else *alert = 0; - } - if ( it > 5 ) { - dd = abs(nd-na); - if ( dd < 5 || dd < 0.05*nd ) break; - else if ( it > 12 && nd >= na ) break; - } - if ( na+nd && abs(mesh->info.imprim) > 3 ) - fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); - // MMG_saveMesh(mesh,"chk.mesh"); - // //if(it==1) exit(0); - } - while ( na+nd > 0 && ++it < maxtou ); - - if ( nna+nnd && abs(mesh->info.imprim) < 3 ) { - fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); - } - - if(MMG_npdtot>0) { - fprintf(stdout," REJECTED : %5d\n",MMG_npdtot); - fprintf(stdout," VOL : %6.2f %% %5d \n", - 100*(MMG_nvoltot/(float) - MMG_npdtot),MMG_nvoltot); - fprintf(stdout," PUISS : %6.2f %% %5d \n", - 100*(MMG_npuisstot/(float) MMG_npdtot),MMG_npuisstot); - fprintf(stdout," PROCHE : %6.2f %% %5d \n", - 100*(MMG_nprestot/(float) MMG_npuisstot),MMG_nprestot); + nna = 0; + nnd = 0; + nf = 0; + it = 0; + maxtou = 100; MMG_npdtot=0; MMG_npuisstot=0; + MMG_nprestot=0; MMG_nvoltot=0; - } - if ( mesh->info.imprim < 0 ) { - MMG_outqua(mesh,sol); - MMG_prilen(mesh,sol); - } - M_free(bucket->head); - M_free(bucket->link); - M_free(bucket); + /* 2. field points */ + if ( mesh->info.imprim < -4 ) { + MMG_prilen(mesh,sol); + fprintf(stdout," -- FIELD POINTS\n"); + } + + /* create filter */ + bucket = MMG_newBucket(mesh,M_MAX(mesh->info.bucksiz,BUCKSIZ)); + if ( !bucket ) return(0); + + do { + MMG_analar(mesh,sol,bucket,&na,&nd,&nf,alert); + nna += na; + nnd += nd; + if ( *alert ) { + if ( nd < 1000 ) break; + else *alert = 0; + } + if ( it > 5 ) { + dd = abs(nd-na); + if ( dd < 5 || dd < 0.05*nd ) break; + else if ( it > 12 && nd >= na ) break; + } + if ( na+nd && abs(mesh->info.imprim) > 3 ) + fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); + // MMG_saveMesh(mesh,"chk.mesh",0); + // //if(it==1) exit(0); + } + while ( na+nd > 0 && ++it < maxtou ); + + if ( nna+nnd && abs(mesh->info.imprim) < 3 ) { + fprintf(stdout," %7d INSERTED %7d REMOVED %7d FILTERED\n",na,nd,nf); + } + + if(MMG_npdtot>0) { + fprintf(stdout," REJECTED : %5d\n",MMG_npdtot); + fprintf(stdout," VOL : %6.2f %% %5d \n", + 100*(MMG_nvoltot/(float) + MMG_npdtot),MMG_nvoltot); + fprintf(stdout," PUISS : %6.2f %% %5d \n", + 100*(MMG_npuisstot/(float) MMG_npdtot),MMG_npuisstot); + fprintf(stdout," PROCHE : %6.2f %% %5d \n", + 100*(MMG_nprestot/(float) MMG_npuisstot),MMG_nprestot); + MMG_npdtot=0; + MMG_npuisstot=0; + MMG_nvoltot=0; + } + if ( mesh->info.imprim < 0 ) { + MMG_outqua(mesh,sol); + MMG_prilen(mesh,sol); + } + M_free(bucket->head); + M_free(bucket->link); + M_free(bucket); + return(1); } diff -r -u mmg3d4/build/sources/mmg3dConfig.h mmg3d4-new/build/sources/mmg3dConfig.h --- mmg3d4/build/sources/mmg3dConfig.h 2012-12-19 16:05:36.000000000 +0100 +++ mmg3d4-new/build/sources/mmg3dConfig.h 2013-01-18 16:32:41.000000000 +0100 @@ -2,4 +2,4 @@ #define Tutorial_VERSION_MAJOR #define Tutorial_VERSION_MINOR -#define USE_SCOTCH +/* #undef USE_SCOTCH */ diff -r -u mmg3d4/build/sources/mmg3dlib/mmg3dlib.c mmg3d4-new/build/sources/mmg3dlib/mmg3dlib.c --- mmg3d4/build/sources/mmg3dlib/mmg3dlib.c 2012-12-19 16:06:03.000000000 +0100 +++ mmg3d4-new/build/sources/mmg3dlib/mmg3dlib.c 2013-01-18 16:32:41.000000000 +0100 @@ -385,7 +385,7 @@ if ( !MMG_hashTetra(mesh) ) return(1); if ( !MMG_markBdry(mesh) ) return(1); if (abs(mesh->info.option)==10) { - MMG_saveMesh(mesh,"tetra.mesh"); + MMG_saveMesh(mesh,"tetra.mesh",0); return(0); } if ( !sol->np) { @@ -431,7 +431,7 @@ if ( abs(info->option) == 9 ) { if(!MMG_mmg3d9(mesh,sol,&alert)) { if ( !MMG_unscaleMesh(mesh,sol) ) return(1); - MMG_saveMesh(mesh,"errormoving.mesh"); + MMG_saveMesh(mesh,"errormoving.mesh",0); //MMG_saveSol(mesh,sol,mesh->outf); return(1); } diff -r -u mmg3d4/build/sources/optlen.c mmg3d4-new/build/sources/optlen.c --- mmg3d4/build/sources/optlen.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/optlen.c 2013-01-18 16:32:41.000000000 +0100 @@ -48,7 +48,7 @@ #define HQCOEF 0.9 #define HCRIT 0.98 -double MMG_rao(pMesh mesh,int k,int inm); +double MMG_rao(pMesh mesh,int k,FILE* ); int MMG_optlen_ani(pMesh mesh,pSol sol,double declic,int base) { pTetra pt,pt1; pPoint ppa,ppb; diff -r -u mmg3d4/build/sources/pattern.c mmg3d4-new/build/sources/pattern.c --- mmg3d4/build/sources/pattern.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/pattern.c 2013-01-18 18:41:02.000000000 +0100 @@ -47,7 +47,7 @@ unsigned char MMG_arfa[3][4] = { {2,0,1,3}, {1,2,0,3}, {0,1,2,3} }; -extern int MMG_permar[10][4]; +extern int MMG_permar[12][4]; extern int MMG_pointar[64][2]; extern int ddebug; //insert ip on ia-ib diff -r -u mmg3d4/build/sources/quality.c mmg3d4-new/build/sources/quality.c --- mmg3d4/build/sources/quality.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/quality.c 2013-01-18 16:32:41.000000000 +0100 @@ -46,7 +46,7 @@ #include "mesh.h" -double MMG_rao(pMesh mesh,int k,int inm); +double MMG_rao(pMesh mesh,int k,FILE* inm) ; double MMG_caltetrao(pMesh mesh,pSol sol,int iel) { return(MMG_rao(mesh,iel,0)); } diff -r -u mmg3d4/build/sources/ratio.c mmg3d4-new/build/sources/ratio.c --- mmg3d4/build/sources/ratio.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/ratio.c 2013-01-18 16:32:41.000000000 +0100 @@ -365,7 +365,7 @@ fprintf(stdout," ELEMENT %d (%d) %d %d %d %d\n", iel,ielreal,pt->v[0],pt->v[1],pt->v[2],pt->v[3]); - if ( abs(mesh->info.imprim) < 5 ) return; + if ( abs(mesh->info.imprim) < 5 ) return (1) ; fprintf(stdout,"\n HISTOGRAMM\n"); for (k=1; k<9; k++) { diff -r -u mmg3d4/build/sources/sproto.h mmg3d4-new/build/sources/sproto.h --- mmg3d4/build/sources/sproto.h 2012-12-19 16:05:36.000000000 +0100 +++ mmg3d4-new/build/sources/sproto.h 2013-01-18 16:32:41.000000000 +0100 @@ -67,13 +67,13 @@ int MMG_inEdge(pHedge ,int *,int *,int *); int MMG_markBdry(pMesh ); -/* inout */ -int MMG_loadMesh(pMesh ,char *); -int MMG_loadSol(pSol ,char *,int ); -int MMG_loadVect(pMesh ,char *,int ); -int MMG_saveMesh(pMesh ,char *); -int MMG_saveSol(pMesh ,pSol ,char *); -int MMG_saveVect(pMesh ,char *); +/* inout add param F.H. june 2011 (dataff) */ +int MMG_loadMesh(pMesh ,char *,void *); +int MMG_loadSol(pSol ,char *,int ,void *); +int MMG_loadVect(pMesh ,char *,int ,void *); +int MMG_saveMesh(pMesh ,char *,void *); +int MMG_saveSol(pMesh ,pSol ,char *,void *); +int MMG_saveVect(pMesh ,char *,void *); int MMG_loctet(pMesh ,int ,int ,double *,double *); int MMG_computeMetric(pMesh ,pSol ,int ,double * ); diff -r -u mmg3d4/build/sources/swapar.c mmg3d4-new/build/sources/swapar.c --- mmg3d4/build/sources/swapar.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-new/build/sources/swapar.c 2013-01-18 18:43:38.000000000 +0100 @@ -1,106 +1,107 @@ -/**************************************************************************** -Logiciel initial: MMG3D Version 4.0 -Co-auteurs : Cecile Dobrzynski et Pascal Frey. -Propriétaires :IPB - UPMC -INRIA. - -Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, -diffusé sous les termes et conditions de la licence publique générale de GNU -Version 3 ou toute version ultérieure. - -Ce fichier est une partie de MMG3D. -MMG3D est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier -suivant les termes de la licence publique générale de GNU -Version 3 ou toute version ultérieure. -MMG3D est distribué dans l'espoir qu'il sera utile, mais SANS -AUCUNE GARANTIE ; sans même garantie de valeur marchande. -Voir la licence publique générale de GNU pour plus de détails. -MMG3D est diffusé en espérant qu’il sera utile, -mais SANS AUCUNE GARANTIE, ni explicite ni implicite, -y compris les garanties de commercialisation ou -d’adaptation dans un but spécifique. -Reportez-vous à la licence publique générale de GNU pour plus de détails. -Vous devez avoir reçu une copie de la licence publique générale de GNU -en même temps que ce document. -Si ce n’est pas le cas, aller voir . -/**************************************************************************** -Initial software: MMG3D Version 4.0 -Co-authors: Cecile Dobrzynski et Pascal Frey. -Owners: IPB - UPMC -INRIA. - -Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, -spread under the terms and conditions of the license GNU General Public License -as published Version 3, or (at your option) any later version. - -This file is part of MMG3D -MMG3D is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. -MMG3D is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with MMG3D. If not, see . -****************************************************************************/ -#include "mesh.h" - -int MMG_swapar(pMesh mesh,pSol sol,pQueue q,List *list,int lon,double crit,double declic) { - pTetra pt; - int i,l,jel,ncas,ddebug,iadr; - - MMG_swpptr = 0; - ncas = 0; - if ( !MMG_getnElt(mesh,10) ) return(-1); - if(0 && list->tetra[1]/6==2352) ddebug=1; - else ddebug=0; - - switch(lon) { - case 3: - ncas = MMG_simu32(mesh,sol,list,crit); - break; - case 4: - ncas = MMG_simu44(mesh,sol,list,crit); - break; - case 5: - ncas = MMG_simu56(mesh,sol,list,crit); - break; - case 6: - ncas = MMG_simu68(mesh,sol,list,crit); - break; - case 7: - ncas = MMG_simu710(mesh,sol,list,crit); - break; - default: - return(0); - } - if(ddebug) printf("on fait swap %d\n",ncas); - if ( ncas && MMG_swpptr ) { - if(ddebug) MMG_saveMesh(mesh,"avt.mesh"); - for (l=1; l<=lon; l++) { - jel = list->tetra[l]/6; - pt = &mesh->tetra[jel]; - if(ddebug) { - printf("tet %d : %d %d %d %d -- %d %d %d %d %d %d\n",jel,pt->v[0],pt->v[1],pt->v[2],pt->v[3], - pt->bdryinfo[0],pt->bdryinfo[1],pt->bdryinfo[2],pt->bdryinfo[3],pt->bdryinfo[4],pt->bdryinfo[5]); - - } - MMG_kiudel(q,jel); - } - lon = MMG_swpptr(mesh,sol,list); - assert(lon); - if(!lon) return(0); - - for (l=1; l<=lon; l++) { - jel = list->tetra[l]; - pt = &mesh->tetra[jel]; - if ( pt->qual >= declic ) MMG_kiuput(q,jel); - for (i=0; i<4; i++) mesh->point[pt->v[i]].flag = mesh->flag; - - } - if(ddebug) {MMG_saveMesh(mesh,"sw.mesh"); exit(0);} - return(1); - } - - return(0); -} +/**************************************************************************** +Logiciel initial: MMG3D Version 4.0 +Co-auteurs : Cecile Dobrzynski et Pascal Frey. +Propriétaires :IPB - UPMC -INRIA. + +Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, +diffusé sous les termes et conditions de la licence publique générale de GNU +Version 3 ou toute version ultérieure. + +Ce fichier est une partie de MMG3D. +MMG3D est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier +suivant les termes de la licence publique générale de GNU +Version 3 ou toute version ultérieure. +MMG3D est distribué dans l'espoir qu'il sera utile, mais SANS +AUCUNE GARANTIE ; sans même garantie de valeur marchande. +Voir la licence publique générale de GNU pour plus de détails. +MMG3D est diffusé en espérant qu’il sera utile, +mais SANS AUCUNE GARANTIE, ni explicite ni implicite, +y compris les garanties de commercialisation ou +d’adaptation dans un but spécifique. +Reportez-vous à la licence publique générale de GNU pour plus de détails. +Vous devez avoir reçu une copie de la licence publique générale de GNU +en même temps que ce document. +Si ce n’est pas le cas, aller voir . +/**************************************************************************** +Initial software: MMG3D Version 4.0 +Co-authors: Cecile Dobrzynski et Pascal Frey. +Owners: IPB - UPMC -INRIA. + +Copyright © 2004-2005-2006-2007-2008-2009-2010-2011, +spread under the terms and conditions of the license GNU General Public License +as published Version 3, or (at your option) any later version. + +This file is part of MMG3D +MMG3D is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. +MMG3D is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with MMG3D. If not, see . +****************************************************************************/ +#include "mesh.h" + +int MMG_swapar(pMesh mesh,pSol sol,pQueue q,List *list,int lon,double crit,double declic) { + pTetra pt; + int i,l,jel,ncas,ddebug,iadr; + + MMG_swpptr = 0; + ncas = 0; + if ( !MMG_getnElt(mesh,10) ) return(-1); + if(0 && list->tetra[1]/6==2352) ddebug=1; + else ddebug=0; + + switch(lon) { + case 3: + ncas = MMG_simu32(mesh,sol,list,crit); + break; + case 4: + ncas = MMG_simu44(mesh,sol,list,crit); + break; + case 5: + ncas = MMG_simu56(mesh,sol,list,crit); + break; + case 6: + ncas = MMG_simu68(mesh,sol,list,crit); + break; + case 7: + ncas = MMG_simu710(mesh,sol,list,crit); + break; + default: + return(0); + } + if(ddebug) printf("on fait swap %d\n",ncas); + if ( ncas && MMG_swpptr ) { + if(ddebug) MMG_saveMesh(mesh,"avt.mesh",0); + for (l=1; l<=lon; l++) { + jel = list->tetra[l]/6; + pt = &mesh->tetra[jel]; + if(ddebug) { + printf("tet %d : %d %d %d %d -- %d %d %d %d %d %d\n",jel,pt->v[0],pt->v[1],pt->v[2],pt->v[3], + pt->bdryinfo[0],pt->bdryinfo[1],pt->bdryinfo[2],pt->bdryinfo[3],pt->bdryinfo[4],pt->bdryinfo[5]); + + } + MMG_kiudel(q,jel); + } + lon = MMG_swpptr(mesh,sol,list); + assert(lon); + if(!lon) return(0); + + for (l=1; l<=lon; l++) { + jel = list->tetra[l]; + pt = &mesh->tetra[jel]; + if ( pt->qual >= declic ) MMG_kiuput(q,jel); + for (i=0; i<4; i++) mesh->point[pt->v[i]].flag = mesh->flag; + + } + if(ddebug) {MMG_saveMesh(mesh,"sw.mesh",0); exit(0);} + return(1); + } + + return(0); +} + diff -u mmg3d4/build/sources/inout.c mmg3d4-ok/build/sources/inout.c --- mmg3d4/build/sources/inout.c 2012-12-19 16:05:32.000000000 +0100 +++ mmg3d4-ok/build/sources/inout.c 2013-07-11 11:43:47.000000000 +0200 @@ -44,6 +44,7 @@ along with MMG3D. If not, see . ****************************************************************************/ #include "mesh.h" +#include "dataff.h" extern short MMG_imprim; @@ -100,35 +101,467 @@ return(out); } + +int MMG_loadMeshff(pMesh mesh,char *filename,DataFF *dataff) { + + + Hedge hed,hed2; + pPoint ppt; + pTetra pt; + pTria pt1; + int i,j,k; + int nhex=0, npris=0, netmp=0,nq=0, pp[10] , ned=0, ncor=0; + int p0,p1,p2,p3,p4,p5,p6,ref ; + int data[10],ldata=10; + dataff->get_mesh(dataff,data,10); + mesh->np = data[ff_id_vertex]; + ned = data[ff_id_seg]; + mesh->nt = data[ff_id_tria]; + mesh->ne = data[ff_id_tet]; + netmp=mesh->ne; + nhex=data[ff_id_hex]; + npris=data[ff_id_prism]; + nq=data[ff_id_quad]; + ncor= data[ff_id_corner]; + + if( nhex || npris) { + printf("mmg3d ff interface , hex or prism NOT SUPPORTED to day (sorry FH) \n"); + goto L0; + } + + mesh->ncor = 0; + mesh->ver =1; + if ( abs(mesh->info.option)==10 ) { + fprintf(stdout," -- READING %8d HEXA %8d PRISMS\n",nhex,npris); + if(!mesh->ne) netmp = 0; + mesh->ne += 6*nhex + 3*npris; + } + + if ( abs(mesh->info.imprim) > 5 ) + fprintf(stdout," -- READING DATA for ff interface "); + + if ( !mesh->np || !mesh->ne ) { + fprintf(stdout," ** MISSING DATA yy\n"); + goto L0; ; + } + if ( !MMG_zaldy(mesh) ) goto L0; + + /* read mesh vertices */ + mesh->npfixe = mesh->np; + + for (k=1; k<=mesh->np; k++) { + ppt = &mesh->point[k]; + dataff->get_v3(dataff,k,ppt->c,&ppt->ref); + ppt->tag = M_UNUSED; + } + + /* read mesh triangles */ + mesh->ntfixe = mesh->nt; + + for (k=1; k<=mesh->nt; k++) { + pt1 = &mesh->tria[k]; + dataff->get_elmt(dataff,ff_id_tria,k,pt1->v,&pt1->ref); + + } + + + + /* read mesh quads (option 10)*/ + if(abs(mesh->info.option)==10) { + fprintf(stdout," QUADS READING %d\n",nq); + mesh->ntfixe += 4*nq; + for (k=1; k<=nq; k++) { + dataff->get_elmt(dataff, ff_id_quad ,k,pp,&ref); + + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = pp[0]; + pt1->v[1] = pp[1]; + pt1->v[2] = pp[2]; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = pp[0]; + pt1->v[1] = pp[2]; + pt1->v[2] = pp[3]; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = pp[0]; + pt1->v[1] = pp[1]; + pt1->v[2] = pp[3]; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = pp[1]; + pt1->v[1] = pp[2]; + pt1->v[2] = pp[3]; + pt1->ref = ref; + + } + } + + /*read and store edges*/ + if (ned) { + if ( !MMG_zaldy4(&hed,ned) ) { + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : EDGES IGNORED\n"); + ned = 0; + } + mesh->ned = ned; + + for (k=1; k<=ned; k++) { + dataff->get_elmt(dataff, ff_id_seg ,k,pp,&ref); + + if(MMG_edgePut(&hed,pp[0],pp[1],2)>1) { + fprintf(stdout," ## WARNING DOUBLE EDGE : %d %d\n",pp[0],pp[1]); + } + } + } + + /* read mesh tetrahedra */ + mesh->nefixe = mesh->ne; + + + for (k=1; k<=netmp; k++) { + pt = &mesh->tetra[k]; + dataff->get_elmt(dataff,ff_id_tet,k,pt->v,&ref); + pt->ref = ref;//0;//ref ; + for(i=0 ; i<4 ; i++) + pt->bdryref[i] = -1; + + if (ned) { int nu1,nu2; + for(i=0 ; i<6 ; i++) { + nu1 = pt->v[MMG_iare[i][0]]; + nu2 = pt->v[MMG_iare[i][1]]; + pt->bdryinfo[i] = MMG_edgePoint(&hed,nu1,nu2); + } + + } else { + for(i=0 ; i<6 ; i++) + pt->bdryinfo[i] = 0; + } + } + if (ned) M_free(hed.item); + + /*read corners*/ + if (ncor) { + + mesh->ncor = ncor; + for (k=1; k<=ncor; k++) { + dataff->get_elmt(dataff,ff_id_corner,k,&ref,0); + + ppt = &mesh->point[ref]; + ppt->geom = M_CORNER; + } + } +#ifdef XXXXXXXXXXXXXXX + if ( abs(mesh->info.option)==10 ) { + if(bin) { + printf("NOT SUPPORTED\n"); + exit(0); + } + if ( !MMG_zaldy4(&hed2,3*npris+6*nhex) ) { + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : PRISM IGNORED\n"); + npris = 0; + nhex = 0; + } + + /*read hexa and transform to tetra*/ + rewind(inm); + fseek(inm,posnhex,SEEK_SET); + for (k=1; k<=nhex; k++) { + fscanf(inm,"%d %d %d %d %d %d %d %d %d",&p0,&p1,&p2,&p3,&p4,&p5,&p6,&p7,&ref); + //fscanf(inm,"%d %d %d %d %d %d %d %d %d",&p0,&p4,&p2,&p1,&p3,&p5,&p6,&p7,&ref); + //printf("hex %d : %d %d %d %d %d %d %d %d\n",k,p0,p1,p2,p3,p4,p5,p6,p7); + MMG_cuthex(mesh,&hed2,netmp+(k-1)*6,p0,p1,p2,p3,p4,p5,p6,p7,ref); + } + + /*read prism and transform to tetra + ---> compatibility pbs ==> hash edge and switch case*/ + rewind(inm); + fseek(inm,posnpris,SEEK_SET); + nimp = 0; + ne = netmp+6*nhex; + for (k=1; k<=npris; k++) { + fscanf(inm,"%d %d %d %d %d %d %d",&p0,&p1,&p2,&p3,&p4,&p5,&ref); + if(!MMG_cutprism(mesh,&hed2,ne,p0,p1,p2,p3,p4,p5,ref)) + { + if(mesh->info.imprim < 0 ) fprintf(stdout,"DECOMPOSITION PRISM INVALID \n\n"); + mesh->ne += 5; + ne += 8; + nimp++; + continue; + } + ne += 3; + } + if(abs(mesh->info.imprim) > 3 )fprintf(stdout," %d INVALID DECOMPOSITION\n\n",nimp); + } +#endif + if ( abs(mesh->info.imprim) > 3 ) { + fprintf(stdout," NUMBER OF GIVEN VERTICES %8d\n",mesh->npfixe); + if ( mesh->ntfixe ) + fprintf(stdout," NUMBER OF GIVEN TRIANGLES %8d\n",mesh->ntfixe); + fprintf(stdout," NUMBER OF GIVEN TETRAHEDRA %8d\n",mesh->nefixe); + if ( ncor ) + fprintf(stdout," NUMBER OF GIVEN CORNERS %8d\n",ncor); + if ( ned ) + fprintf(stdout," NUMBER OF GIVEN EDGES %8d\n",ned); + } + // MMG_saveMesh(mesh,"XXXXX.mesh",0); + dataff->mesh=0; // used + return 1; +L0: + dataff->mesh=0;// used + return 1; +} + +int MMG_loadSolff(pSol sol,char *filename,int npmax,DataFF *dataff) { + + double tmp , *dsol ; + int binch,bdim,iswp; + int k,i,isol,type,bin,dim,btyp,bpos; + long posnp; + char *ptr,data[128],chaine[128]; + if( ! dataff->sol){ + fprintf(stdout," ** MISSING DATA metrix ff \n"); + return(1); + } + dsol = dataff->sol; + dataff->sol=0;// used + + + btyp = (dataff->typesol== 6) ? 3: dataff->typesol ; + sol->np= dataff->np; + + if ( !sol->np ) { + fprintf(stdout," ** MISSING DATA zz\n"); + return(1); + } + + if ( btyp!= 1 && btyp!=3 ) { + fprintf(stdout," ** DATA IGNORED (ff) btyp=%d\n",btyp); + sol->np = 0; + return(1); + } + + sol->offset = (btyp==1) ? 1 : 6; + + if ( abs(MMG_imprim) > 5 ) + fprintf(stdout," -- READING DATA FILE(ff) %s\n",data); + + if ( !sol->np ) { + fprintf(stdout," ** MISSING DATA no metrix \n"); + return(0); + } + sol->npfixe = sol->np; + sol->npmax = npmax; + if ( !MMG_zaldy3(sol) ) return(0); + + /* read mesh solutions */ + sol->npfixe = sol->np; + + for (k=1; k<=sol->np; k++) { + isol = (k-1) * sol->offset + 1; + for (i=0; ioffset; i++) + sol->met[isol + i] = *dsol++; + + } + + if ( abs(MMG_imprim) > 3 ) + fprintf(stdout," NUMBER OF GIVEN DATA %8d\n",sol->npfixe); + + + return(1); + +} +/* load solution (metric) */ +int MMG_loadVectff(pMesh mesh,char *filename,int npmax,DataFF *dataff) { + + + pDispl pd; + int binch,bdim,iswp; + int k,i,type,bin,dim,btyp,bpos,iadr; + long posnp; + char *ptr,data[128],chaine[128]; + double *fsol = dataff->mov; + dataff->mov=0;// used + + pd = mesh->disp; + pd->np =mesh->np ; + + if ( !pd->np || !fsol ) { + fprintf(stdout," ** MISSING DATA dep ff %d %p\n",pd->np, fsol); + return(0); + } + + + if ( abs(mesh->info.imprim) > 5 ) + fprintf(stdout," -- COPY DATA form ff interface %s\n",data); + + /* read mesh solutions */ + for (k=1; k<=pd->np; k++) { + iadr = (k - 1) * 3 + 1; + + for (i=0; i<3; i++) { + pd->mv[iadr + i] = *fsol++; + } + } + + + + if ( abs(mesh->info.imprim) > 3 ) + fprintf(stdout," NUMBER OF GIVEN DATA %8d\n",pd->np); + return(1); + + +} +int MMG_saveMeshff(pMesh mesh,char *filename,DataFF *dataff) { + + pPoint ppt; + pTetra pt; + pTria pt1; + int j,k,np,nc,k0; + int data[10],ldata=10; + int kn[10]; + np = 0; + nc = 0; + // compress vertex ... fist case ... + for (k=1; k<=mesh->np; k++) { + ppt = &mesh->point[k]; + if ( ppt->tag & M_UNUSED ) continue; + ppt->tmp = ++np; + /* if ( ppt->geom & M_CORNER ) cor[nc++] = ppt->tmp; */ + } + + /* seacrch vertex not in tet ???? */ + { + int kk=0,npp=np; + for (k=1; k<=mesh->np; k++) + { + ppt = &mesh->point[k]; + if ((ppt->tag & M_UNUSED )) ppt->tmp =-2; + else ppt->tmp =-1; + + } + for ( k=1; k<=mesh->ne; k++) + { + pt = &mesh->tetra[k]; + if ( !pt->v[0] ) continue; + k0++; + for(j=0;j<4;++j) + mesh->point[pt->v[j]].tmp=0; + } + np=0; + for (k=1; k<=mesh->np; k++) + { + ppt = &mesh->point[k]; + + if ( ppt->tmp ==0) + ppt->tmp = ++np; + else + { + + if (ppt->tmp==-1) + { + kk++; + ppt->tag |= M_UNUSED; + } + ppt->tmp=0; + } + } + if(kk) printf(" mmg3d: Strange nb of point %d not in tet is not zero (correct by FH)!\n" , kk); + + } + + mesh->nt=0; + if(! MMG_markBdry(mesh)) + mesh->nt=0; + data[ff_id_vertex]=np ; + //data[ff_id_seg]=ned ; + data[ff_id_tria]=mesh->nt ; + int ne=0; + for ( k=1; k<=mesh->ne; k++) + { + pt = &mesh->tetra[k]; + if ( !pt->v[0] ) continue; + ne++; + } + + data[ff_id_tet]=ne ; + printf(" mmg3d: nbp = %d, nb tet %d\n",np,ne); + //data[ff_id_hex]=nhex; + //data[ff_id_prism]=npris; + //data[ff_id_quad]=nq; + // data[ff_id_corner]=ncor; + + dataff->set_mesh(dataff,data,10); + + + for ( k=1; k<=mesh->np; k++) + { + ppt = &mesh->point[k]; + if ( ! ppt->tmp ) continue; + dataff->set_v(dataff, ppt->tmp,ppt->c,ppt->ref); + } + + + for (k=1; k<=mesh->nt; k++) + { + pt1 = &mesh->tria[k]; + for(j=0;j<3;++j) + kn[j] = mesh->point[pt1->v[j]].tmp; + dataff->set_elmt(dataff,ff_id_tria,k,kn,pt1->ref); + + } + k0=0; + for ( k=1; k<=mesh->ne; k++) + { + + pt = &mesh->tetra[k]; + if ( !pt->v[0] ) continue; + k0++; + for(j=0;j<4;++j) + kn[j] = mesh->point[pt->v[j]].tmp; + dataff->set_elmt(dataff,ff_id_tet,k0,kn,pt->ref); + + } + dataff->end_mesh(dataff); + return 1; +} +int MMG_saveSolff (pMesh mesh,pSol sol,char *filename,DataFF *dataff) { + return 1; +} +/*save the node speed : coornew-coorold/dt*/ +int MMG_saveVectff(pMesh mesh,char *filename,DataFF *dataff) { + return 1; +} /* read mesh data */ -int MMG_loadMesh(pMesh mesh,char *filename) { +int MMG_loadMesh(pMesh mesh,char *filename,void *dataff) { FILE* inm; Hedge hed,hed2; pPoint ppt; pTetra pt; pHexa ph,listhexa; pTria pt1; - int k,dim,ref,bin,bpos,i,tmp; - int *adjahex; + int k,dim,ref,bin,bpos,i,tmp; + int *adjahex; long posnp,posnt,posne,posnhex,posnpris,posncor,posned,posnq; char *ptr,data[128],chaine[128]; int nhex,npris,netmp,ncor,ned,nq; - int p0,p1,p2,p3,p4,p5,p6,p7; - int binch,bdim,iswp,nu1,nu2,nimp,ne,nbado; - float fc; - double volhex,volref; + int p0,p1,p2,p3,p4,p5,p6,p7; + int binch,bdim,iswp,nu1,nu2,nimp,ne,nbado; + float fc; + double volhex,volref; int iadr,reorient; - + if(dataff) + return MMG_loadMeshff( mesh,filename,(DataFF*) dataff); + posnp = posnt = posne = posnhex = posnpris = 0; netmp = ncor = ned = 0; bin = 0; iswp = 0; - mesh->np = mesh->nt = mesh->ne = mesh->ncor = 0; + mesh->np = mesh->nt = mesh->ne = mesh->ncor = 0; npris = nhex = nq = 0; - + strcpy(data,filename); - ptr = strstr(data,".mesh"); + ptr = strstr(data,".mesh"); if ( !ptr ) { strcat(data,".meshb"); if( !(inm = fopen(data,"rb")) ) { @@ -136,8 +569,8 @@ *ptr = '\0'; strcat(data,".mesh"); if( !(inm = fopen(data,"r")) ) { - fprintf(stderr," ** %s NOT FOUND.\n",data); - return(0); + fprintf(stderr," ** %s NOT FOUND.\n",data); + return(0); } } else { bin = 1; @@ -147,194 +580,194 @@ ptr = strstr(data,".meshb"); if( !ptr ) { if( !(inm = fopen(data,"r")) ) { - fprintf(stderr," ** %s NOT FOUND.\n",data); - return(0); - } + fprintf(stderr," ** %s NOT FOUND.\n",data); + return(0); + } } else { bin = 1; if( !(inm = fopen(data,"rb")) ) { - fprintf(stderr," ** %s NOT FOUND.\n",data); - return(0); + fprintf(stderr," ** %s NOT FOUND.\n",data); + return(0); } - - } + + } } fprintf(stdout," %%%% %s OPENED\n",data); if (!bin) { - strcpy(chaine,"D"); - while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { + strcpy(chaine,"D"); + while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { if(!strncmp(chaine,"MeshVersionFormatted",strlen("MeshVersionFormatted"))) { - fscanf(inm,"%d",&mesh->ver); - continue; + fscanf(inm,"%d",&mesh->ver); + continue; } else if(!strncmp(chaine,"Dimension",strlen("Dimension"))) { - fscanf(inm,"%d",&dim); - if(dim!=3) { - fprintf(stdout,"BAD DIMENSION : %d\n",dim); - return(0); - } - continue; + fscanf(inm,"%d",&dim); + if(dim!=3) { + fprintf(stdout,"BAD DIMENSION : %d\n",dim); + return(0); + } + continue; } else if(!strncmp(chaine,"Vertices",strlen("Vertices"))) { - fscanf(inm,"%d",&mesh->np); - posnp = ftell(inm); - continue; + fscanf(inm,"%d",&mesh->np); + posnp = ftell(inm); + continue; } else if(!strncmp(chaine,"Triangles",strlen("Triangles"))) { - fscanf(inm,"%d",&mesh->nt); - posnt = ftell(inm); - continue; + fscanf(inm,"%d",&mesh->nt); + posnt = ftell(inm); + continue; } else if(!strncmp(chaine,"Tetrahedra",strlen("Tetrahedra"))) { - fscanf(inm,"%d",&mesh->ne); - netmp = mesh->ne; - posne = ftell(inm); - continue; - } else if(!strncmp(chaine,"Hexahedra",strlen("Hexahedra"))) { - assert(abs(mesh->info.option)==10); - fscanf(inm,"%d",&nhex); - //nhex=0; - posnhex = ftell(inm); - continue; - } else if(!strncmp(chaine,"Pentahedra",strlen("Pentahedra"))) { - assert(abs(mesh->info.option)==10); - fscanf(inm,"%d",&npris); - //npris=0; - posnpris = ftell(inm); - continue; - } else if(!strncmp(chaine,"Corners",strlen("Corners"))) { - fscanf(inm,"%d",&ncor); - posncor = ftell(inm); - continue; - } else if(!strncmp(chaine,"Edges",strlen("Edges"))) { - fscanf(inm,"%d",&ned); - posned = ftell(inm); - continue; - } else if(abs(mesh->info.option)==10 && !strncmp(chaine,"Quadrilaterals",strlen("Quadrilaterals"))) { - fscanf(inm,"%d",&nq); - posnq = ftell(inm); - continue; - } - } + fscanf(inm,"%d",&mesh->ne); + netmp = mesh->ne; + posne = ftell(inm); + continue; + } else if(!strncmp(chaine,"Hexahedra",strlen("Hexahedra"))) { + assert(abs(mesh->info.option)==10); + fscanf(inm,"%d",&nhex); + //nhex=0; + posnhex = ftell(inm); + continue; + } else if(!strncmp(chaine,"Pentahedra",strlen("Pentahedra"))) { + assert(abs(mesh->info.option)==10); + fscanf(inm,"%d",&npris); + //npris=0; + posnpris = ftell(inm); + continue; + } else if(!strncmp(chaine,"Corners",strlen("Corners"))) { + fscanf(inm,"%d",&ncor); + posncor = ftell(inm); + continue; + } else if(!strncmp(chaine,"Edges",strlen("Edges"))) { + fscanf(inm,"%d",&ned); + posned = ftell(inm); + continue; + } else if(abs(mesh->info.option)==10 && !strncmp(chaine,"Quadrilaterals",strlen("Quadrilaterals"))) { + fscanf(inm,"%d",&nq); + posnq = ftell(inm); + continue; + } + } } else { bdim = 0; fread(&mesh->ver,sw,1,inm); - iswp=0; - if(mesh->ver==16777216) - iswp=1; + iswp=0; + if(mesh->ver==16777216) + iswp=1; else if(mesh->ver!=1) { fprintf(stdout,"BAD FILE ENCODING\n"); - } - fread(&mesh->ver,sw,1,inm); - if(iswp) mesh->ver = MMG_swapbin(mesh->ver); - while(fread(&binch,sw,1,inm)!=0 && binch!=54 ) { - if(iswp) binch=MMG_swapbin(binch); - if(binch==54) break; + } + fread(&mesh->ver,sw,1,inm); + if(iswp) mesh->ver = MMG_swapbin(mesh->ver); + while(fread(&binch,sw,1,inm)!=0 && binch!=54 ) { + if(iswp) binch=MMG_swapbin(binch); + if(binch==54) break; if(!bdim && binch==3) { //Dimension - fread(&bdim,sw,1,inm); //NulPos=>20 - if(iswp) bdim=MMG_swapbin(bdim); - fread(&bdim,sw,1,inm); - if(iswp) bdim=MMG_swapbin(bdim); - if(bdim!=3) { - fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); - exit(0); - return(1); - } - continue; + fread(&bdim,sw,1,inm); //NulPos=>20 + if(iswp) bdim=MMG_swapbin(bdim); + fread(&bdim,sw,1,inm); + if(iswp) bdim=MMG_swapbin(bdim); + if(bdim!=3) { + fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); + exit(0); + return(1); + } + continue; } else if(!mesh->np && binch==4) { //Vertices - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&mesh->np,sw,1,inm); - if(iswp) mesh->np=MMG_swapbin(mesh->np); - posnp = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&mesh->np,sw,1,inm); + if(iswp) mesh->np=MMG_swapbin(mesh->np); + posnp = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; } else if(!mesh->nt && binch==6) {//Triangles - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&mesh->nt,sw,1,inm); - if(iswp) mesh->nt=MMG_swapbin(mesh->nt); - posnt = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else if(!mesh->ne && binch==8) { - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&mesh->ne,sw,1,inm); - if(iswp) mesh->ne=MMG_swapbin(mesh->ne); - netmp = mesh->ne; - posne = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else if(!nhex && binch==10) { - assert(abs(mesh->info.option)==10); - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&nhex,sw,1,inm); - if(iswp) nhex=MMG_swapbin(nhex); - posnhex = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else if(!npris && binch==9) { - assert(abs(mesh->info.option)==10); - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&npris,sw,1,inm); - if(iswp) npris=MMG_swapbin(npris); - posnpris = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else if(!ncor && binch==13) { - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&ncor,sw,1,inm); - if(iswp) ncor=MMG_swapbin(ncor); - posncor = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else if(!ned && binch==5) { //Edges - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - fread(&ned,sw,1,inm); - if(iswp) ned=MMG_swapbin(ned); - posned = ftell(inm); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - continue; - } else { - //printf("on traite ? %d\n",binch); - fread(&bpos,sw,1,inm); //NulPos - if(iswp) bpos=MMG_swapbin(bpos); - //printf("on avance... Nulpos %d\n",bpos); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - } - } - + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&mesh->nt,sw,1,inm); + if(iswp) mesh->nt=MMG_swapbin(mesh->nt); + posnt = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else if(!mesh->ne && binch==8) { + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&mesh->ne,sw,1,inm); + if(iswp) mesh->ne=MMG_swapbin(mesh->ne); + netmp = mesh->ne; + posne = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else if(!nhex && binch==10) { + assert(abs(mesh->info.option)==10); + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&nhex,sw,1,inm); + if(iswp) nhex=MMG_swapbin(nhex); + posnhex = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else if(!npris && binch==9) { + assert(abs(mesh->info.option)==10); + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&npris,sw,1,inm); + if(iswp) npris=MMG_swapbin(npris); + posnpris = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else if(!ncor && binch==13) { + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&ncor,sw,1,inm); + if(iswp) ncor=MMG_swapbin(ncor); + posncor = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else if(!ned && binch==5) { //Edges + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + fread(&ned,sw,1,inm); + if(iswp) ned=MMG_swapbin(ned); + posned = ftell(inm); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + continue; + } else { + //printf("on traite ? %d\n",binch); + fread(&bpos,sw,1,inm); //NulPos + if(iswp) bpos=MMG_swapbin(bpos); + //printf("on avance... Nulpos %d\n",bpos); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + } + } + } if ( abs(mesh->info.option)==10 ) { - fprintf(stdout," -- READING %8d HEXA %8d PRISMS\n",nhex,npris); - if(!mesh->ne) netmp = 0; - mesh->ne += 6*nhex + 3*npris; + fprintf(stdout," -- READING %8d HEXA %8d PRISMS\n",nhex,npris); + if(!mesh->ne) netmp = 0; + mesh->ne += 6*nhex + 3*npris; } if ( abs(mesh->info.imprim) > 5 ) fprintf(stdout," -- READING DATA FILE %s\n",data); if ( !mesh->np || !mesh->ne ) { - fprintf(stdout," ** MISSING DATA\n"); + fprintf(stdout," ** MISSING DAT qqA\n"); return(0); } - if(abs(mesh->info.option)==10) { //allocation + if(abs(mesh->info.option)==10) { //allocation listhexa = (pHexa)M_calloc(nhex+1,sizeof(Hexa),"allochexa"); - assert(listhexa); - adjahex = (int*)M_calloc(6*nhex+7,sizeof(int),"allocadjhexa"); - assert(adjahex); - } + assert(listhexa); + adjahex = (int*)M_calloc(6*nhex+7,sizeof(int),"allocadjhexa"); + assert(adjahex); + } if ( !MMG_zaldy(mesh) ) return(0); /* read mesh vertices */ mesh->npfixe = mesh->np; @@ -342,35 +775,35 @@ fseek(inm,posnp,SEEK_SET); for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; - if (mesh->ver < 2) { /*float*/ + if (mesh->ver < 2) { /*float*/ if (!bin) { - for (i=0 ; i<3 ; i++) { - fscanf(inm,"%f",&fc); - ppt->c[i] = (double) fc; - } - fscanf(inm,"%d",&ppt->ref); + for (i=0 ; i<3 ; i++) { + fscanf(inm,"%f",&fc); + ppt->c[i] = (double) fc; + } + fscanf(inm,"%d",&ppt->ref); } else { - for (i=0 ; i<3 ; i++) { - fread(&fc,sw,1,inm); - if(iswp) fc=MMG_swapf(fc); - ppt->c[i] = (double) fc; - } - fread(&ppt->ref,sw,1,inm); - if(iswp) ppt->ref=MMG_swapbin(ppt->ref); + for (i=0 ; i<3 ; i++) { + fread(&fc,sw,1,inm); + if(iswp) fc=MMG_swapf(fc); + ppt->c[i] = (double) fc; + } + fread(&ppt->ref,sw,1,inm); + if(iswp) ppt->ref=MMG_swapbin(ppt->ref); } } else { - if (!bin) - fscanf(inm,"%lf %lf %lf %d",&ppt->c[0],&ppt->c[1],&ppt->c[2],&ppt->ref); + if (!bin) + fscanf(inm,"%lf %lf %lf %d",&ppt->c[0],&ppt->c[1],&ppt->c[2],&ppt->ref); else { - for (i=0 ; i<3 ; i++) { - fread(&ppt->c[i],sd,1,inm); - if(iswp) ppt->c[i]=MMG_swapd(ppt->c[i]); - } - fread(&ppt->ref,sw,1,inm); - if(iswp) ppt->ref=MMG_swapbin(ppt->ref); - } - } - ppt->tag = M_UNUSED; + for (i=0 ; i<3 ; i++) { + fread(&ppt->c[i],sd,1,inm); + if(iswp) ppt->c[i]=MMG_swapd(ppt->c[i]); + } + fread(&ppt->ref,sw,1,inm); + if(iswp) ppt->ref=MMG_swapbin(ppt->ref); + } + } + ppt->tag = M_UNUSED; } /* read mesh triangles */ @@ -378,227 +811,226 @@ rewind(inm); fseek(inm,posnt,SEEK_SET); for (k=1; k<=mesh->nt; k++) { - pt1 = &mesh->tria[k]; + pt1 = &mesh->tria[k]; if (!bin) fscanf(inm,"%d %d %d %d",&pt1->v[0],&pt1->v[1],&pt1->v[2],&pt1->ref); else { - for (i=0 ; i<3 ; i++) { - fread(&pt1->v[i],sw,1,inm); - if(iswp) pt1->v[i]=MMG_swapbin(pt1->v[i]); - } - fread(&pt1->ref,sw,1,inm); - if(iswp) pt1->ref=MMG_swapbin(pt1->ref); - } - } - /* read mesh quads (option 10)*/ - if(abs(mesh->info.option)==10) { - fprintf(stdout," QUADS READING %d\n",nq); + for (i=0 ; i<3 ; i++) { + fread(&pt1->v[i],sw,1,inm); + if(iswp) pt1->v[i]=MMG_swapbin(pt1->v[i]); + } + fread(&pt1->ref,sw,1,inm); + if(iswp) pt1->ref=MMG_swapbin(pt1->ref); + } + } + /* read mesh quads (option 10)*/ + if(abs(mesh->info.option)==10) { + fprintf(stdout," QUADS READING %d\n",nq); mesh->ntfixe += 4*nq; rewind(inm); fseek(inm,posnq,SEEK_SET); for (k=1; k<=nq; k++) { if (!bin) - fscanf(inm,"%d %d %d %d %d",&p0,&p1,&p2,&p3,&ref); + fscanf(inm,"%d %d %d %d %d",&p0,&p1,&p2,&p3,&ref); else { - fread(&p0,sw,1,inm); - if(iswp) p0=MMG_swapbin(p0); - fread(&p1,sw,1,inm); - if(iswp) p1=MMG_swapbin(p1); - fread(&p2,sw,1,inm); - if(iswp) p2=MMG_swapbin(p2); - fread(&p3,sw,1,inm); - if(iswp) p3=MMG_swapbin(p3); - fread(&pt1->ref,sw,1,inm); - if(iswp) ref=MMG_swapbin(ref); - } + fread(&p0,sw,1,inm); + if(iswp) p0=MMG_swapbin(p0); + fread(&p1,sw,1,inm); + if(iswp) p1=MMG_swapbin(p1); + fread(&p2,sw,1,inm); + if(iswp) p2=MMG_swapbin(p2); + fread(&p3,sw,1,inm); + if(iswp) p3=MMG_swapbin(p3); + fread(&pt1->ref,sw,1,inm); + if(iswp) ref=MMG_swapbin(ref); + } /*creation of 4 triangles per quads because we don't know how hexa will be cut*/ - pt1 = &mesh->tria[++mesh->nt]; - pt1->v[0] = p0; - pt1->v[1] = p1; - pt1->v[2] = p2; - pt1->ref = ref; - pt1 = &mesh->tria[++mesh->nt]; - pt1->v[0] = p0; - pt1->v[1] = p2; - pt1->v[2] = p3; - pt1->ref = ref; - pt1 = &mesh->tria[++mesh->nt]; - pt1->v[0] = p0; - pt1->v[1] = p1; - pt1->v[2] = p3; - pt1->ref = ref; - pt1 = &mesh->tria[++mesh->nt]; - pt1->v[0] = p1; - pt1->v[1] = p2; - pt1->v[2] = p3; - pt1->ref = ref; - - } - } - /*read and store edges*/ - if (ned) { - if ( !MMG_zaldy4(&hed,ned) ) { - if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : EDGES IGNORED\n"); - ned = 0; - } - mesh->ned = ned; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = p0; + pt1->v[1] = p1; + pt1->v[2] = p2; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = p0; + pt1->v[1] = p2; + pt1->v[2] = p3; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = p0; + pt1->v[1] = p1; + pt1->v[2] = p3; + pt1->ref = ref; + pt1 = &mesh->tria[++mesh->nt]; + pt1->v[0] = p1; + pt1->v[1] = p2; + pt1->v[2] = p3; + pt1->ref = ref; + + } + } + /*read and store edges*/ + if (ned) { + if ( !MMG_zaldy4(&hed,ned) ) { + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : EDGES IGNORED\n"); + ned = 0; + } + mesh->ned = ned; rewind(inm); - fseek(inm,posned,SEEK_SET); - for (k=1; k<=ned; k++) { + fseek(inm,posned,SEEK_SET); + for (k=1; k<=ned; k++) { if (!bin) - fscanf(inm,"%d %d %d",&nu1,&nu2,&ref); + fscanf(inm,"%d %d %d",&nu1,&nu2,&ref); else { - fread(&nu1,sw,1,inm); - if(iswp) nu1=MMG_swapbin(nu1); - fread(&nu2,sw,1,inm); - if(iswp) nu2=MMG_swapbin(nu2); - fread(&ref,sw,1,inm); - if(iswp) ref=MMG_swapbin(ref); - } - if(MMG_edgePut(&hed,nu1,nu2,2)>1) { - fprintf(stdout," ## WARNING DOUBLE EDGE : %d %d\n",nu1,nu2); - } - mesh->point[nu1].geom = M_RIDGE_GEO; - mesh->point[nu2].geom = M_RIDGE_GEO; + fread(&nu1,sw,1,inm); + if(iswp) nu1=MMG_swapbin(nu1); + fread(&nu2,sw,1,inm); + if(iswp) nu2=MMG_swapbin(nu2); + fread(&ref,sw,1,inm); + if(iswp) ref=MMG_swapbin(ref); + } + if(MMG_edgePut(&hed,nu1,nu2,2)>1) { + fprintf(stdout," ## WARNING DOUBLE EDGE : %d %d\n",nu1,nu2); + } + mesh->point[nu1].geom = M_RIDGE_GEO; + mesh->point[nu2].geom = M_RIDGE_GEO; } } /* read mesh tetrahedra */ mesh->nefixe = mesh->ne; rewind(inm); - fseek(inm,posne,SEEK_SET); - reorient = 0; - for (k=1; k<=netmp; k++) { + fseek(inm,posne,SEEK_SET); + reorient = 0; + for (k=1; k<=netmp; k++) { pt = &mesh->tetra[k]; - if (!bin) - fscanf(inm,"%d %d %d %d %d",&pt->v[0],&pt->v[1],&pt->v[2],&pt->v[3],&ref); - else { - - for (i=0 ; i<4 ; i++) { - fread(&pt->v[i],sw,1,inm); - if(iswp) pt->v[i]=MMG_swapbin(pt->v[i]); - } - fread(&ref,sw,1,inm); - if(iswp) ref=MMG_swapbin(ref); - } + if (!bin) + fscanf(inm,"%d %d %d %d %d",&pt->v[0],&pt->v[1],&pt->v[2],&pt->v[3],&ref); + else { + + for (i=0 ; i<4 ; i++) { + fread(&pt->v[i],sw,1,inm); + if(iswp) pt->v[i]=MMG_swapbin(pt->v[i]); + } + fread(&ref,sw,1,inm); + if(iswp) ref=MMG_swapbin(ref); + } pt->ref = ref;//0;//ref ; /*check orientation*/ - volref = MMG_voltet(mesh,k); - if(volref < 0) { - reorient++; - tmp = pt->v[2]; - pt->v[2] = pt->v[3]; - pt->v[3] = tmp; - } - + volref = MMG_voltet(mesh,k); + if(volref < 0) { + if(!reorient) { + fprintf(stdout,"\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n"); + fprintf(stdout," BAD ORIENTATION : vol < 0 -- Some tetra will be reoriented\n"); + fprintf(stdout," $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n\n"); + reorient = 1; + } + tmp = pt->v[2]; + pt->v[2] = pt->v[3]; + pt->v[3] = tmp; + } + for(i=0 ; i<4 ; i++) - pt->bdryref[i] = -1; - - if (ned) { - for(i=0 ; i<6 ; i++) { - nu1 = pt->v[MMG_iare[i][0]]; - nu2 = pt->v[MMG_iare[i][1]]; - pt->bdryinfo[i] = MMG_edgePoint(&hed,nu1,nu2); - } - - } else { - for(i=0 ; i<6 ; i++) - pt->bdryinfo[i] = 0; - } + pt->bdryref[i] = -1; + + if (ned) { + for(i=0 ; i<6 ; i++) { + nu1 = pt->v[MMG_iare[i][0]]; + nu2 = pt->v[MMG_iare[i][1]]; + pt->bdryinfo[i] = MMG_edgePoint(&hed,nu1,nu2); + } + + } else { + for(i=0 ; i<6 ; i++) + pt->bdryinfo[i] = 0; + } } - if(reorient) { - fprintf(stdout,"\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n"); - fprintf(stdout," BAD ORIENTATION : vol < 0 -- %8d tetra reoriented\n",reorient); - fprintf(stdout," $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n\n"); - reorient = 1; - } - if (ned) M_free(hed.item); + if (ned) M_free(hed.item); - /*read corners*/ + /*read corners*/ if (ncor) { rewind(inm); - fseek(inm,posncor,SEEK_SET); + fseek(inm,posncor,SEEK_SET); mesh->ncor = ncor; - for (k=1; k<=ncor; k++) { + for (k=1; k<=ncor; k++) { if (!bin) - fscanf(inm,"%d",&ref); + fscanf(inm,"%d",&ref); else { - fread(&ref,sw,1,inm); - if(iswp) ref=MMG_swapbin(ref); - } + fread(&ref,sw,1,inm); + if(iswp) ref=MMG_swapbin(ref); + } ppt = &mesh->point[ref]; - ppt->geom = M_CORNER; - } + ppt->geom = M_CORNER; + } } - - - if ( abs(mesh->info.option)==10 ) { + + + if ( abs(mesh->info.option)==10 ) { if(bin) { printf("NOT SUPPORTED\n"); exit(0); - } - if ( !MMG_zaldy4(&hed2,3*npris+6*nhex) ) { - if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : PRISM IGNORED\n"); - npris = 0; - nhex = 0; - } + } + if ( !MMG_zaldy4(&hed2,3*npris+6*nhex) ) { + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : PRISM IGNORED\n"); + npris = 0; + nhex = 0; + } /*read hexa and transform to tetra*/ rewind(inm); - fseek(inm,posnhex,SEEK_SET); - nbado = 0; + fseek(inm,posnhex,SEEK_SET); + nbado = 0; for (k=1; k<=nhex; k++) { - ph = &listhexa[k]; - fscanf(inm,"%d %d %d %d %d %d %d %d %d",&ph->v[0],&ph->v[1],&ph->v[2],&ph->v[3],&ph->v[4],&ph->v[5],&ph->v[6],&ph->v[7],&ph->ref); - //fscanf(inm,"%d %d %d %d %d %d %d %d %d",&p0,&p4,&p2,&p1,&p3,&p5,&p6,&p7,&ref); - //printf("hex %d : %d %d %d %d %d %d %d %d\n",k,p0,p1,p2,p3,p4,p5,p6,p7); + ph = &listhexa[k]; + fscanf(inm,"%d %d %d %d %d %d %d %d %d",&ph->v[0],&ph->v[1],&ph->v[2],&ph->v[3],&ph->v[4],&ph->v[5],&ph->v[6],&ph->v[7],&ph->ref); + //fscanf(inm,"%d %d %d %d %d %d %d %d %d",&p0,&p4,&p2,&p1,&p3,&p5,&p6,&p7,&ref); + //printf("hex %d : %d %d %d %d %d %d %d %d\n",k,p0,p1,p2,p3,p4,p5,p6,p7); //check orientability of the hexahedra : vol of tet p0 p1 p3 p4 - volhex = MMG_quickvol(mesh->point[ph->v[0]].c,mesh->point[ph->v[1]].c,mesh->point[ph->v[2]].c,mesh->point[ph->v[3]].c); - if(k==1) { - volref = volhex; - //printf("vol %e\n",volref); - } - else { - if(volref*volhex < 0) { - fprintf(stdout,"BAD ORIENTATION OF HEXAHEDRON %d : %d %d %d %d %d %d %d %d\n",k,p0,p1,p2,p3,p4,p5,p6,p7); - nbado++; - tmp = ph->v[3]; - ph->v[3] = ph->v[1]; - ph->v[1] = tmp; - tmp = ph->v[5]; - ph->v[5] = ph->v[7]; - ph->v[7] = tmp; - } - } - // MMG_cuthex(mesh,&hed2,netmp+(k-1)*6,ph->v[0],ph->v[1],ph->v[2],ph->v[3],ph->v[4],ph->v[5],ph->v[6],ph->v[7],ph->ref); - } - fprintf(stdout,"%8d HEXA REORIENTED\n",nbado); + volhex = MMG_quickvol(mesh->point[ph->v[0]].c,mesh->point[ph->v[1]].c,mesh->point[ph->v[2]].c,mesh->point[ph->v[3]].c); + if(k==1) { + volref = volhex; + //printf("vol %e\n",volref); + } + else { + if(volref*volhex < 0) { + fprintf(stdout,"BAD ORIENTATION OF HEXAHEDRON %d : %d %d %d %d %d %d %d %d\n",k,p0,p1,p2,p3,p4,p5,p6,p7); + nbado++; + tmp = ph->v[3]; + ph->v[3] = ph->v[1]; + ph->v[1] = tmp; + tmp = ph->v[5]; + ph->v[5] = ph->v[7]; + ph->v[7] = tmp; + } + } + // MMG_cuthex(mesh,&hed2,netmp+(k-1)*6,ph->v[0],ph->v[1],ph->v[2],ph->v[3],ph->v[4],ph->v[5],ph->v[6],ph->v[7],ph->ref); + } + fprintf(stdout,"%8d HEXA REORIENTED\n",nbado); - if(!MMG_hashHexa(listhexa,adjahex,nhex)) return(0); - MMG_cuthex(mesh,&hed2,listhexa,adjahex,nhex,netmp); + if(!MMG_hashHexa(listhexa,adjahex,nhex)) return(0); + MMG_cuthex(mesh,&hed2,listhexa,adjahex,nhex,netmp); /*read prism and transform to tetra - ---> compatibility pbs ==> hash edge and switch case*/ + ---> compatibility pbs ==> hash edge and switch case*/ rewind(inm); - fseek(inm,posnpris,SEEK_SET); - nimp = 0; - ne = netmp+6*nhex; + fseek(inm,posnpris,SEEK_SET); + nimp = 0; + ne = netmp+6*nhex; for (k=1; k<=npris; k++) { - fscanf(inm,"%d %d %d %d %d %d %d",&p0,&p1,&p2,&p3,&p4,&p5,&ref); - if(!MMG_cutprism(mesh,&hed2,ne,p0,p1,p2,p3,p4,p5,ref)) - { - if(mesh->info.imprim < 0 ) fprintf(stdout,"DECOMPOSITION PRISM INVALID \n\n"); - mesh->ne += 5; - ne += 8; - nimp++; - continue; - } - ne += 3; + fscanf(inm,"%d %d %d %d %d %d %d",&p0,&p1,&p2,&p3,&p4,&p5,&ref); + if(!MMG_cutprism(mesh,&hed2,ne,p0,p1,p2,p3,p4,p5,ref)) + { + if(mesh->info.imprim < 0 ) fprintf(stdout,"DECOMPOSITION PRISM INVALID \n\n"); + mesh->ne += 5; + ne += 8; + nimp++; + continue; + } + ne += 3; } - if(abs(mesh->info.imprim) > 3 )fprintf(stdout," %d INVALID DECOMPOSITION\n\n",nimp); + if(abs(mesh->info.imprim) > 3 )fprintf(stdout," %d INVALID DECOMPOSITION\n\n",nimp); } - + if ( abs(mesh->info.imprim) > 3 && abs(mesh->info.option)!=10 ) { fprintf(stdout," NUMBER OF GIVEN VERTICES %8d\n",mesh->npfixe); if ( mesh->ntfixe ) @@ -609,24 +1041,26 @@ if ( ned ) fprintf(stdout," NUMBER OF GIVEN EDGES %8d\n",ned); } - fclose(inm); - return(1); + fclose(inm); + return(1); } /* load solution (metric) */ -int MMG_loadSol(pSol sol,char *filename,int npmax) { - FILE *inm; +int MMG_loadSol(pSol sol,char *filename,int npmax,void *dataff) { + FILE *inm; float fsol; - double tmp; + double tmp; int binch,bdim,iswp; int k,i,isol,type,bin,dim,btyp,bpos; long posnp; char *ptr,data[128],chaine[128]; - - posnp = 0; + if(dataff) + return MMG_loadSolff( sol,filename,npmax,(DataFF*) dataff); + + posnp = 0; bin = 0; - iswp = 0; + iswp = 0; strcpy(data,filename); ptr = strstr(data,".mesh"); @@ -645,94 +1079,94 @@ } fprintf(stdout," %%%% %s OPENED\n",data); - - if(!bin) { + + if(!bin) { strcpy(chaine,"DDD"); - while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { + while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { if(!strncmp(chaine,"Dimension",strlen("Dimension"))) { - fscanf(inm,"%d",&dim); - if(dim!=3) { - fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); - return(1); - } - continue; + fscanf(inm,"%d",&dim); + if(dim!=3) { + fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); + return(1); + } + continue; } else if(!strncmp(chaine,"SolAtVertices",strlen("SolAtVertices"))) { - fscanf(inm,"%d",&sol->np); - fscanf(inm,"%d",&type); - if(type!=1) { - fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); - return(1); - } - fscanf(inm,"%d",&btyp); - posnp = ftell(inm); - break; - } - } - } else { - fread(&binch,sw,1,inm); - iswp=0; - if(binch==16777216) iswp=1; + fscanf(inm,"%d",&sol->np); + fscanf(inm,"%d",&type); + if(type!=1) { + fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); + return(1); + } + fscanf(inm,"%d",&btyp); + posnp = ftell(inm); + break; + } + } + } else { + fread(&binch,sw,1,inm); + iswp=0; + if(binch==16777216) iswp=1; else if(binch!=1) { fprintf(stdout,"BAD FILE ENCODING\n"); - } - fread(&sol->ver,sw,1,inm); - if(iswp) sol->ver = MMG_swapbin(sol->ver); + } + fread(&sol->ver,sw,1,inm); + if(iswp) sol->ver = MMG_swapbin(sol->ver); while(fread(&binch,sw,1,inm)!=EOF && binch!=54 ) { - if(iswp) binch=MMG_swapbin(binch); - if(binch==54) break; + if(iswp) binch=MMG_swapbin(binch); + if(binch==54) break; if(binch==3) { //Dimension - fread(&bdim,sw,1,inm); //NulPos=>20 - if(iswp) bdim=MMG_swapbin(bdim); - fread(&bdim,sw,1,inm); - if(iswp) bdim=MMG_swapbin(bdim); - if(bdim!=3) { - fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); - exit(0); - return(1); - } - continue; + fread(&bdim,sw,1,inm); //NulPos=>20 + if(iswp) bdim=MMG_swapbin(bdim); + fread(&bdim,sw,1,inm); + if(iswp) bdim=MMG_swapbin(bdim); + if(bdim!=3) { + fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); + exit(0); + return(1); + } + continue; } else if(binch==62) { //SolAtVertices - fread(&binch,sw,1,inm); //NulPos - if(iswp) binch=MMG_swapbin(binch); - fread(&sol->np,sw,1,inm); - if(iswp) sol->np=MMG_swapbin(sol->np); - fread(&binch,sw,1,inm); //nb sol - if(iswp) binch=MMG_swapbin(binch); - if(binch!=1) { - fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); - return(1); - } - fread(&btyp,sw,1,inm); //typsol - if(iswp) btyp=MMG_swapbin(btyp); - posnp = ftell(inm); - break; + fread(&binch,sw,1,inm); //NulPos + if(iswp) binch=MMG_swapbin(binch); + fread(&sol->np,sw,1,inm); + if(iswp) sol->np=MMG_swapbin(sol->np); + fread(&binch,sw,1,inm); //nb sol + if(iswp) binch=MMG_swapbin(binch); + if(binch!=1) { + fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); + return(1); + } + fread(&btyp,sw,1,inm); //typsol + if(iswp) btyp=MMG_swapbin(btyp); + posnp = ftell(inm); + break; } else { - fread(&bpos,sw,1,inm); //Pos - if(iswp) bpos=MMG_swapbin(bpos); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - } - } - - } + fread(&bpos,sw,1,inm); //Pos + if(iswp) bpos=MMG_swapbin(bpos); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + } + } + + } if ( !sol->np ) { - fprintf(stdout," ** MISSING DATA\n"); + fprintf(stdout," ** MISSING DATA ss\n"); return(1); } if ( btyp!= 1 && btyp!=3 ) { - fprintf(stdout," ** DATA IGNORED\n"); + fprintf(stdout," ** DATA IGNORED %d\n",btyp); sol->np = 0; return(1); } - + sol->offset = (btyp==1) ? 1 : 6; if ( abs(MMG_imprim) > 5 ) fprintf(stdout," -- READING DATA FILE %s\n",data); if ( !sol->np ) { - fprintf(stdout," ** MISSING DATA\n"); + fprintf(stdout," ** MISSING DATA xx\n"); return(0); } sol->npfixe = sol->np; @@ -742,31 +1176,31 @@ /* read mesh solutions */ sol->npfixe = sol->np; rewind(inm); - fseek(inm,posnp,SEEK_SET); + fseek(inm,posnp,SEEK_SET); for (k=1; k<=sol->np; k++) { isol = (k-1) * sol->offset + 1; - if (sol->ver == 1) { + if (sol->ver == 1) { for (i=0; ioffset; i++) { - if(!bin){ - fscanf(inm,"%f",&fsol); - sol->met[isol + i] = (double) fsol; - } else { - fread(&fsol,sw,1,inm); - if(iswp) fsol=MMG_swapf(fsol); - sol->met[isol + i] = (double) fsol; - } - } + if(!bin){ + fscanf(inm,"%f",&fsol); + sol->met[isol + i] = (double) fsol; + } else { + fread(&fsol,sw,1,inm); + if(iswp) fsol=MMG_swapf(fsol); + sol->met[isol + i] = (double) fsol; + } + } } else { for (i=0; ioffset; i++) { - if(!bin){ - fscanf(inm,"%lf",&sol->met[isol + i]); + if(!bin){ + fscanf(inm,"%lf",&sol->met[isol + i]); - } else { - fread(&sol->met[isol + i],sd,1,inm); - if(iswp) sol->met[isol + i]=MMG_swapd(sol->met[isol + i]); - } - } - } + } else { + fread(&sol->met[isol + i],sd,1,inm); + if(iswp) sol->met[isol + i]=MMG_swapd(sol->met[isol + i]); + } + } + } /* MMG_swap data */ if ( sol->offset == 6 ) { tmp = sol->met[isol + 2]; @@ -778,13 +1212,13 @@ if ( abs(MMG_imprim) > 3 ) fprintf(stdout," NUMBER OF GIVEN DATA %8d\n",sol->npfixe); - fclose(inm); - return(1); + fclose(inm); + return(1); } -int MMG_loadVect(pMesh mesh,char *filename,int npmax) { - FILE *inm; +int MMG_loadVect(pMesh mesh,char *filename,int npmax,void *dataff) { + FILE *inm; pDispl pd; float fsol; int binch,bdim,iswp; @@ -792,10 +1226,13 @@ long posnp; char *ptr,data[128],chaine[128]; - pd = mesh->disp; + if(dataff) + return MMG_loadVectff( mesh, filename,npmax,(DataFF*) dataff); - posnp = 0; - bin = 0; + pd = mesh->disp; + + posnp = 0; + bin = 0; iswp = 0; strcpy(data,filename); @@ -815,76 +1252,76 @@ } fprintf(stdout," %%%% %s OPENED\n",data); - - if(!bin) { + + if(!bin) { strcpy(chaine,"DDD"); - while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { + while(fscanf(inm,"%s",&chaine[0])!=EOF && strncmp(chaine,"End",strlen("End")) ) { if(!strncmp(chaine,"Dimension",strlen("Dimension"))) { - fscanf(inm,"%d",&dim); - if(dim!=3) { - fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); - return(1); - } - continue; + fscanf(inm,"%d",&dim); + if(dim!=3) { + fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); + return(1); + } + continue; } else if(!strncmp(chaine,"SolAtVertices",strlen("SolAtVertices"))) { - fscanf(inm,"%d",&pd->np); - fscanf(inm,"%d",&type); - if(type!=1) { - fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); - return(1); - } - fscanf(inm,"%d",&btyp); - posnp = ftell(inm); - break; - } - } - } else { - fread(&pd->ver,sw,1,inm); - iswp=0; - if(pd->ver==16777216) iswp=1; + fscanf(inm,"%d",&pd->np); + fscanf(inm,"%d",&type); + if(type!=1) { + fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); + return(1); + } + fscanf(inm,"%d",&btyp); + posnp = ftell(inm); + break; + } + } + } else { + fread(&pd->ver,sw,1,inm); + iswp=0; + if(pd->ver==16777216) iswp=1; else if(pd->ver!=1) { fprintf(stdout,"BAD FILE ENCODING\n"); - } - fread(&pd->ver,sw,1,inm); - if(iswp) pd->ver = MMG_swapbin(pd->ver); + } + fread(&pd->ver,sw,1,inm); + if(iswp) pd->ver = MMG_swapbin(pd->ver); while(fread(&binch,sw,1,inm)!=EOF && binch!=54 ) { - if(iswp) binch=MMG_swapbin(binch); - if(binch==54) break; + if(iswp) binch=MMG_swapbin(binch); + if(binch==54) break; if(binch==3) { //Dimension - fread(&bdim,sw,1,inm); //Pos=>20 - if(iswp) bdim=MMG_swapbin(bdim); - fread(&bdim,sw,1,inm); - if(iswp) bdim=MMG_swapbin(bdim); - if(bdim!=3) { - fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); - exit(0); - return(1); - } - continue; + fread(&bdim,sw,1,inm); //Pos=>20 + if(iswp) bdim=MMG_swapbin(bdim); + fread(&bdim,sw,1,inm); + if(iswp) bdim=MMG_swapbin(bdim); + if(bdim!=3) { + fprintf(stdout,"BAD SOL DIMENSION : %d\n",dim); + exit(0); + return(1); + } + continue; } else if(binch==62) { //SolAtVertices - fread(&binch,sw,1,inm); //Pos - if(iswp) binch=MMG_swapbin(binch); - fread(&pd->np,sw,1,inm); - if(iswp) pd->np=MMG_swapbin(pd->np); - fread(&binch,sw,1,inm); //nb sol - if(iswp) binch=MMG_swapbin(binch); - if(binch!=1) { - fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); - return(1); - } - fread(&btyp,sw,1,inm); //typsol - if(iswp) btyp=MMG_swapbin(btyp); - posnp = ftell(inm); - break; + fread(&binch,sw,1,inm); //Pos + if(iswp) binch=MMG_swapbin(binch); + fread(&pd->np,sw,1,inm); + if(iswp) pd->np=MMG_swapbin(pd->np); + fread(&binch,sw,1,inm); //nb sol + if(iswp) binch=MMG_swapbin(binch); + if(binch!=1) { + fprintf(stdout,"SEVERAL SOLUTION => IGNORED : %d\n",type); + return(1); + } + fread(&btyp,sw,1,inm); //typsol + if(iswp) btyp=MMG_swapbin(btyp); + posnp = ftell(inm); + break; } else { - fread(&bpos,sw,1,inm); //Pos - if(iswp) bpos=MMG_swapbin(bpos); - rewind(inm); - fseek(inm,bpos,SEEK_SET); - } - } - - } + fread(&bpos,sw,1,inm); //Pos + if(iswp) bpos=MMG_swapbin(bpos); + rewind(inm); + fseek(inm,bpos,SEEK_SET); + } + } + + } if ( !pd->np ) { fprintf(stdout," ** MISSING DATA\n"); return(0); @@ -895,7 +1332,7 @@ } if ( btyp != 2 ) { - fprintf(stdout," ** DATA IGNORED\n"); + fprintf(stdout," ** DATA IGNORED %d !=2\n",btyp); return(0); } @@ -907,47 +1344,50 @@ fseek(inm,posnp,SEEK_SET); for (k=1; k<=pd->np; k++) { iadr = (k - 1) * 3 + 1; - if (pd->ver < 2) { + if (pd->ver < 2) { for (i=0; i<3; i++) { - if(!bin){ - fscanf(inm,"%f",&fsol); - pd->mv[iadr + i] = (double) fsol; - } else { - fread(&fsol,sw,1,inm); - if(iswp) fsol=MMG_swapf(fsol); - pd->mv[iadr + i] = (double) fsol; - } - } + if(!bin){ + fscanf(inm,"%f",&fsol); + pd->mv[iadr + i] = (double) fsol; + } else { + fread(&fsol,sw,1,inm); + if(iswp) fsol=MMG_swapf(fsol); + pd->mv[iadr + i] = (double) fsol; + } + } } else { for (i=0; i<3; i++) { - if(!bin){ - fscanf(inm,"%lf",&pd->mv[iadr + i]); - } else { - fread(&pd->mv[iadr + i],sd,1,inm); - if(iswp) pd->mv[iadr + i]=MMG_swapd(pd->mv[iadr + i]); - } - } - } + if(!bin){ + fscanf(inm,"%lf",&pd->mv[iadr + i]); + } else { + fread(&pd->mv[iadr + i],sd,1,inm); + if(iswp) pd->mv[iadr + i]=MMG_swapd(pd->mv[iadr + i]); + } + } + } } if ( abs(mesh->info.imprim) > 3 ) fprintf(stdout," NUMBER OF GIVEN DATA %8d\n",pd->np); - fclose(inm); + fclose(inm); return(1); } /* save mesh to disk */ -int MMG_saveMesh(pMesh mesh,char *filename) { - FILE* inm; - Hedge hed; +int MMG_saveMesh(pMesh mesh,char *filename,void *dataff) { + FILE* inm; + Hedge hed; pPoint ppt; pTria pt1; pTetra pt; int i,k,np,ne,nc,ned,*cor,*ed,ref,bin,bpos; - char *ptr,data[128],chaine[128]; + char *ptr,data[128],chaine[128]; int binch,nu1,nu2; + if(dataff) + return MMG_saveMeshff( mesh, filename,(DataFF*) dataff); + mesh->ver = 2; //double precision bin = 0; strcpy(data,filename); @@ -959,28 +1399,28 @@ *ptr = '\0'; strcat(data,".mesh"); if( !(inm = fopen(data,"w")) ) { - fprintf(stderr," ** UNABLE TO OPEN %s.\n",data); - return(0); + fprintf(stderr," ** UNABLE TO OPEN %s.\n",data); + return(0); } } else { - bin = 1; + bin = 1; } } - else { + else { ptr = strstr(data,".meshb"); if( ptr ) bin = 1; if( !(inm = fopen(data,"w")) ) { fprintf(stderr," ** UNABLE TO OPEN %s.\n",data); return(0); - } + } } fprintf(stdout," %%%% %s OPENED\n",data); /*entete fichier*/ if(!bin) { - strcpy(&chaine[0],"MeshVersionFormatted 2\n"); + strcpy(&chaine[0],"MeshVersionFormatted 2\n"); fprintf(inm,"%s",chaine); - strcpy(&chaine[0],"\n\nDimension 3\n"); + strcpy(&chaine[0],"\n\nDimension 3\n"); fprintf(inm,"%s ",chaine); } else { binch = 1; //MeshVersionFormatted @@ -993,33 +1433,38 @@ fwrite(&bpos,sw,1,inm); binch = 3; fwrite(&binch,sw,1,inm); - + } /* compact vertices */ - if(mesh->ncor) { + if(mesh->ncor) { cor = (int*) M_calloc(mesh->ncor,sizeof(int),"MMG_savemesh"); - assert(cor); + assert(cor); } - if(mesh->ned) { - if ( !MMG_zaldy4(&hed,mesh->ned) ) { - if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : EXPORT EDGES IGNORED\n"); - mesh->ned = 0; - } + if(mesh->ned) { + if ( !MMG_zaldy4(&hed,mesh->ned) ) { + if ( mesh->info.ddebug ) fprintf(stdout," ## MEMORY ALLOCATION PROBLEM : EXPORT EDGES IGNORED\n"); + mesh->ned = 0; + } ed = (int*)M_calloc(2*mesh->ned,sizeof(int),"MMG_savemesh"); - assert(ed); + assert(ed); } - np = 0; + np = 0; nc = 0; for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; - if ( ppt->tag & M_UNUSED ) continue; - ppt->tmp = ++np; + if ( ppt->tag & M_UNUSED ) continue; + ppt->tmp = ++np; if ( ppt->geom & M_CORNER ) cor[nc++] = ppt->tmp; + } + //assert(mesh->ncor==nc); + if(mesh->ncor!=nc) { + fprintf(stdout,"WARNING: some corners have been added or deleted\n"); + mesh->ncor = nc; } - assert(mesh->ncor==nc); + if(!bin) { - strcpy(&chaine[0],"\n\nVertices\n"); + strcpy(&chaine[0],"\n\nVertices\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d\n",np); } else { @@ -1027,27 +1472,27 @@ fwrite(&binch,sw,1,inm); bpos += 12+(1+3*mesh->ver)*4*np; //NullPos fwrite(&bpos,sw,1,inm); - fwrite(&np,sw,1,inm); + fwrite(&np,sw,1,inm); } for(k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; - if ( ppt->tag & M_UNUSED ) continue; - //if(ppt->tmp==52453) printf("point %d --> %d\n",ppt->tmp,k); + if ( ppt->tag & M_UNUSED ) continue; + //if(ppt->tmp==52453) printf("point %d --> %d\n",ppt->tmp,k); if(!bin) { fprintf(inm,"%.15lg %.15lg %.15lg %d\n",ppt->c[0],ppt->c[1],ppt->c[2],ppt->ref); } else { - fwrite((unsigned char*)&ppt->c[0],sd,1,inm); - fwrite((unsigned char*)&ppt->c[1],sd,1,inm); - fwrite((unsigned char*)&ppt->c[2],sd,1,inm); - fwrite((unsigned char*)&ppt->ref,sw,1,inm); + fwrite((unsigned char*)&ppt->c[0],sd,1,inm); + fwrite((unsigned char*)&ppt->c[1],sd,1,inm); + fwrite((unsigned char*)&ppt->c[2],sd,1,inm); + fwrite((unsigned char*)&ppt->ref,sw,1,inm); } } - /* rebuild triangles tabular and write triangles */ + /* rebuild triangles tabular and write triangles */ mesh->nt = 0; if(MMG_markBdry(mesh)) { if(!bin) { - strcpy(&chaine[0],"\n\nTriangles\n"); + strcpy(&chaine[0],"\n\nTriangles\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d \n",mesh->nt); } else { @@ -1055,49 +1500,48 @@ fwrite(&binch,sw,1,inm); bpos += 12+16*mesh->nt; //Pos fwrite(&bpos,sw,1,inm); - fwrite(&mesh->nt,sw,1,inm); + fwrite(&mesh->nt,sw,1,inm); } for (k=1; k<=mesh->nt; k++) { pt1 = &mesh->tria[k]; - ref = pt1->ref; + ref = pt1->ref; if(!bin) { - //if(ref==0) printf("tr %d bad ref!!\n",k); - fprintf(inm,"%d %d %d %d\n",mesh->point[pt1->v[0]].tmp,mesh->point[pt1->v[1]].tmp - ,mesh->point[pt1->v[2]].tmp,ref); + fprintf(inm,"%d %d %d %d\n",mesh->point[pt1->v[0]].tmp,mesh->point[pt1->v[1]].tmp + ,mesh->point[pt1->v[2]].tmp,ref); } else { - fwrite(&mesh->point[pt1->v[0]].tmp,sw,1,inm); - fwrite(&mesh->point[pt1->v[1]].tmp,sw,1,inm); - fwrite(&mesh->point[pt1->v[2]].tmp,sw,1,inm); - fwrite(&ref,sw,1,inm); + fwrite(&mesh->point[pt1->v[0]].tmp,sw,1,inm); + fwrite(&mesh->point[pt1->v[1]].tmp,sw,1,inm); + fwrite(&mesh->point[pt1->v[2]].tmp,sw,1,inm); + fwrite(&ref,sw,1,inm); } } - } - + } + /* write tetrahedra */ - ne = 0; - ned = 0; - //printf("avt %d\n",mesh->ned); + ne = 0; + ned = 0; + //printf("avt %d\n",mesh->ned); for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; - if ( !pt->v[0] ) continue; - if(mesh->ned) { - for (i=0 ; i<6 ; i++) { - if (pt->bdryinfo[i]) { - nu1 = pt->v[MMG_iare[i][0]]; - nu2 = pt->v[MMG_iare[i][1]]; - if (MMG_edgePut(&hed,nu1,nu2,2)<=1) { - ed[2*ned] = (mesh->point[nu1]).tmp; - ed[2*ned + 1] = (mesh->point[nu2]).tmp; - ned++; - } - } - } - } - ne++; + if ( !pt->v[0] ) continue; + if(mesh->ned) { + for (i=0 ; i<6 ; i++) { + if (pt->bdryinfo[i]) { + nu1 = pt->v[MMG_iare[i][0]]; + nu2 = pt->v[MMG_iare[i][1]]; + if (MMG_edgePut(&hed,nu1,nu2,2)<=1) { + ed[2*ned] = (mesh->point[nu1]).tmp; + ed[2*ned + 1] = (mesh->point[nu2]).tmp; + ned++; + } + } + } + } + ne++; } - //printf("ned %d\n",ned); + //printf("ned %d\n",ned); if(!bin) { - strcpy(&chaine[0],"\n\nTetrahedra\n"); + strcpy(&chaine[0],"\n\nTetrahedra\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d\n",ne); } else { @@ -1105,29 +1549,29 @@ fwrite(&binch,sw,1,inm); bpos += 12 + 20*ne;//Pos fwrite(&bpos,sw,1,inm); - fwrite((unsigned char*)&ne,sw,1,inm); - } - ne=0; + fwrite((unsigned char*)&ne,sw,1,inm); + } + ne=0; for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; - if ( !pt->v[0] ) continue; - ne++; - ref = pt->ref; + if ( !pt->v[0] ) continue; + ne++; + ref = pt->ref; if(!bin) { fprintf(inm,"%d %d %d %d %d\n",mesh->point[pt->v[0]].tmp,mesh->point[pt->v[1]].tmp - ,mesh->point[pt->v[2]].tmp,mesh->point[pt->v[3]].tmp,ref); + ,mesh->point[pt->v[2]].tmp,mesh->point[pt->v[3]].tmp,ref); } else { - fwrite(&mesh->point[pt->v[0]].tmp,sw,1,inm); - fwrite(&mesh->point[pt->v[1]].tmp,sw,1,inm); - fwrite(&mesh->point[pt->v[2]].tmp,sw,1,inm); - fwrite(&mesh->point[pt->v[3]].tmp,sw,1,inm); - fwrite(&ref,sw,1,inm); + fwrite(&mesh->point[pt->v[0]].tmp,sw,1,inm); + fwrite(&mesh->point[pt->v[1]].tmp,sw,1,inm); + fwrite(&mesh->point[pt->v[2]].tmp,sw,1,inm); + fwrite(&mesh->point[pt->v[3]].tmp,sw,1,inm); + fwrite(&ref,sw,1,inm); } - } - + } + if(mesh->ned) { if(!bin) { - strcpy(&chaine[0],"\n\nEdges\n"); + strcpy(&chaine[0],"\n\nEdges\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d\n",ned); } else { @@ -1135,50 +1579,50 @@ fwrite(&binch,sw,1,inm); bpos += 12 + 3*4*ned;//Pos fwrite(&bpos,sw,1,inm); - fwrite((unsigned char*)&ned,sw,1,inm); - } - for (k=0; kncor); } else { binch = 13; //Corners fwrite(&binch,sw,1,inm); - bpos += 12 + 4*mesh->ncor;//Pos + bpos += 12 + 4*mesh->ncor;//Pos fwrite(&bpos,sw,1,inm); - fwrite((unsigned char*)&mesh->ncor,sw,1,inm); + fwrite((unsigned char*)&mesh->ncor,sw,1,inm); } for (k=0; kncor; k++) { if(!bin) { fprintf(inm,"%d \n",cor[k]); } else { - fwrite(&cor[k],sw,1,inm); + fwrite(&cor[k],sw,1,inm); } - } + } /*fin fichier*/ if(!bin) { - strcpy(&chaine[0],"\n\nEnd\n"); + strcpy(&chaine[0],"\n\nEnd\n"); fprintf(inm,"%s",chaine); } else { binch = 54; //End fwrite(&binch,sw,1,inm); } - fclose(inm); + fclose(inm); if(mesh->ncor) M_free(cor); if ( mesh->info.imprim ) { fprintf(stdout," NUMBER OF GIVEN VERTICES %8d\n",mesh->npfixe); @@ -1193,20 +1637,22 @@ if ( mesh->ned ) fprintf(stdout," TOTAL NUMBER OF EDGES %8d\n",ned); } - //if(ned!=mesh->ned) exit(0); + //if(ned!=mesh->ned) exit(0); return(1); } -int MMG_saveSol(pMesh mesh,pSol sol,char *filename) { +int MMG_saveSol(pMesh mesh,pSol sol,char *filename,void *dataff) { FILE* inm; pPoint ppt; float fsol; double tmp; int i,k,nbl,isol,bin,bpos,typ; - char *ptr,data[128],chaine[128]; + char *ptr,data[128],chaine[128]; int binch; + if(dataff) + return MMG_saveSolff( mesh, sol, filename,(DataFF*) dataff); if ( !sol->np ) return(1); bin = 1; @@ -1219,24 +1665,24 @@ *ptr = '\0'; bin = 0; } else { - ptr = strstr(data,".solb"); - if ( ptr ) { - *ptr = '\0'; - bin = 1; + ptr = strstr(data,".solb"); + if ( ptr ) { + *ptr = '\0'; + bin = 1; } else { - ptr = strstr(data,".sol"); - if ( ptr ) { - *ptr = '\0'; - bin = 0; - } - } - } + ptr = strstr(data,".sol"); + if ( ptr ) { + *ptr = '\0'; + bin = 0; + } + } + } } - if ( bin ) + if ( bin ) strcat(data,".solb"); else strcat(data,".sol"); - + sol->ver = 2; if( bin && !(inm = fopen(data,"wb")) ) { fprintf(stderr," ** UNABLE TO OPEN %s.\n",data); @@ -1251,9 +1697,9 @@ /*entete fichier*/ if(!bin) { - strcpy(&chaine[0],"MeshVersionFormatted 2\n"); + strcpy(&chaine[0],"MeshVersionFormatted 2\n"); fprintf(inm,"%s",chaine); - strcpy(&chaine[0],"\n\nDimension 3\n"); + strcpy(&chaine[0],"\n\nDimension 3\n"); fprintf(inm,"%s ",chaine); } else { binch = 1; //MeshVersionFormatted @@ -1266,19 +1712,19 @@ fwrite(&bpos,sw,1,inm); binch = 3; fwrite(&binch,sw,1,inm); - + } switch(sol->offset) { case 1: - typ = 1; - break; + typ = 1; + break; case 6: - typ = 3; + typ = 3; break; default: - fprintf(stdout," ** DATA IGNORED\n"); + fprintf(stdout," ** DATA IGNORED not 1 ou 6 == %d\n",sol->offset); return(0); } @@ -1287,11 +1733,11 @@ for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; if ( ppt->tag & M_UNUSED ) continue; - nbl++; + nbl++; } - + if(!bin) { - strcpy(&chaine[0],"\n\nSolAtVertices\n"); + strcpy(&chaine[0],"\n\nSolAtVertices\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d\n",nbl); fprintf(inm,"%d %d\n",1,typ); @@ -1300,7 +1746,7 @@ fwrite(&binch,sw,1,inm); bpos += 20+(sol->offset*sol->ver)*4*nbl; //Pos fwrite(&bpos,sw,1,inm); - fwrite(&nbl,sw,1,inm); + fwrite(&nbl,sw,1,inm); binch = 1; //nb sol fwrite(&binch,sw,1,inm); binch = typ; //typ sol @@ -1317,34 +1763,34 @@ sol->met[isol + 3] = tmp; } if (sol->ver < 2) { - if(!bin) { - for (i=0; ioffset; i++) { - fsol = (float) sol->met[isol + i]; - fprintf(inm,"%f ",fsol); - } - fprintf(inm,"\n"); + if(!bin) { + for (i=0; ioffset; i++) { + fsol = (float) sol->met[isol + i]; + fprintf(inm,"%f ",fsol); + } + fprintf(inm,"\n"); } else { - for (i=0; ioffset; i++) { - fsol = (float) sol->met[isol + i]; - fwrite(&fsol,sw,1,inm); - } + for (i=0; ioffset; i++) { + fsol = (float) sol->met[isol + i]; + fwrite(&fsol,sw,1,inm); + } } } else { - if(!bin) { - for (i=0; ioffset; i++) - fprintf(inm,"%.15lg ",sol->met[isol + i]); - fprintf(inm,"\n"); + if(!bin) { + for (i=0; ioffset; i++) + fprintf(inm,"%.15lg ",sol->met[isol + i]); + fprintf(inm,"\n"); } else { - for (i=0; ioffset; i++) - fwrite(&sol->met[isol + i],sd,1,inm); + for (i=0; ioffset; i++) + fwrite(&sol->met[isol + i],sd,1,inm); } - + } } - + /*fin fichier*/ if(!bin) { - strcpy(&chaine[0],"\n\nEnd\n"); + strcpy(&chaine[0],"\n\nEnd\n"); fprintf(inm,"%s",chaine); } else { binch = 54; //End @@ -1355,14 +1801,16 @@ } /*save the node speed : coornew-coorold/dt*/ -int MMG_saveVect(pMesh mesh,char *filename) { - FILE* inm; +int MMG_saveVect(pMesh mesh,char *filename,void *dataff) { + FILE* inm; pDispl pd; pPoint ppt; double dsol,dd; int i,k,nbl,bin,bpos,typ; - char *ptr,data[128],chaine[128]; + char *ptr,data[128],chaine[128]; unsigned char binch; + if(dataff) + return MMG_saveVectff( mesh, filename,(DataFF*) dataff); pd = mesh->disp; pd->ver = 2; @@ -1378,7 +1826,7 @@ bin = 0; } } - if ( bin ) + if ( bin ) strcat(data,".o.solb"); else strcat(data,".o.sol"); @@ -1395,9 +1843,9 @@ /*entete fichier*/ if(!bin) { - strcpy(&chaine[0],"MeshVersionFormatted 2\n"); + strcpy(&chaine[0],"MeshVersionFormatted 2\n"); fprintf(inm,"%s",chaine); - strcpy(&chaine[0],"\n\nDimension 3\n"); + strcpy(&chaine[0],"\n\nDimension 3\n"); fprintf(inm,"%s ",chaine); } else { binch = 1; //MeshVersionFormatted @@ -1410,20 +1858,20 @@ fwrite(&bpos,sw,1,inm); binch = 3; fwrite(&binch,sw,1,inm); - + } - typ = 2; + typ = 2; /* write data */ nbl = 0; for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; if ( ppt->tag & M_UNUSED ) continue; - nbl++; + nbl++; } - + if(!bin) { - strcpy(&chaine[0],"\n\nSolAtVertices\n"); + strcpy(&chaine[0],"\n\nSolAtVertices\n"); fprintf(inm,"%s",chaine); fprintf(inm,"%d\n",nbl); fprintf(inm,"%d %d\n",1,typ); @@ -1432,34 +1880,34 @@ fwrite(&binch,sw,1,inm); bpos += 20+(3*pd->ver)*4*nbl; //Pos fwrite(&bpos,sw,1,inm); - fwrite(&nbl,sw,1,inm); + fwrite(&nbl,sw,1,inm); binch = 1; //nb sol fwrite(&binch,sw,1,inm); binch = typ; //typ sol fwrite(&binch,sw,1,inm); - } - - - dd = mesh->info.delta / (double)PRECI; + } + + + dd = mesh->info.delta / (double)PRECI; fprintf(stdout," DT %e\n",mesh->info.dt); for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; - if ( ppt->tag & M_UNUSED ) continue; + if ( ppt->tag & M_UNUSED ) continue; for (i=0 ; i<3 ; i++) { - dsol = (ppt->c[i] - mesh->disp->cold[3*(k-1) + 1 + i]* dd - mesh->info.min[i])/mesh->info.dt; - if(!bin) { - fprintf(inm,"%.15lg ",dsol); + dsol = (ppt->c[i] - mesh->disp->cold[3*(k-1) + 1 + i]* dd - mesh->info.min[i])/mesh->info.dt; + if(!bin) { + fprintf(inm,"%.15lg ",dsol); } else { - fwrite(&dsol,sd,1,inm); + fwrite(&dsol,sd,1,inm); } } - if (!bin) fprintf(inm,"\n"); + if (!bin) fprintf(inm,"\n"); } - - + + /*fin fichier*/ if(!bin) { - strcpy(&chaine[0],"\n\nEnd\n"); + strcpy(&chaine[0],"\n\nEnd\n"); fprintf(inm,"%s",chaine); } else { binch = 54; //End --- mmg3d4/build/sources/mmg3d9.c 2012-12-19 16:05:33.000000000 +0100 +++ mmg3d4-nnew/build/sources/mmg3d9.c 2014-03-05 18:37:03.000000000 +0100 @@ -382,7 +382,7 @@ fprintf(stdout," ** MOVING MESH\n"); /*alloc et init metold*/ - sol->metold = (double*)M_calloc(sol->npmax+1,sol->offset*sizeof(double),"MMG_mmg3d9"); + if(!sol->metold) sol->metold = (double*)M_calloc(sol->npmax+1,sol->offset*sizeof(double),"MMG_mmg3d9"); assert(sol->metold); mesh->disp->cold = (double*)M_calloc(3*(mesh->npmax + 1),sizeof(double),"MMG_mmg3d9"); assert(mesh->disp->cold); --- mmg3d4/build/sources/mmg3dmain/mmg3d.c 2012-12-19 16:05:53.000000000 +0100 +++ mmg3d4-new/build/sources/mmg3dmain/mmg3d.c 2014-04-22 16:37:41.000000000 +0200 @@ -46,7 +46,7 @@ #include "compil.date" #include "mesh.h" #include "eigenv.h" - +#include "dataff.h" TIM_mytime MMG_ctim[TIMEMAX]; short MMG_imprim; @@ -310,7 +310,8 @@ strcpy(sol->name,mesh->name); } if ( mesh->outf == NULL ) { - mesh->outf = (char *)calloc(128,sizeof(char)); + static char stbub [256]; + mesh->outf = stbub; /*(char *)calloc(128,sizeof(char)); */ assert(mesh->outf); strcpy(mesh->outf,mesh->name); ptr = strstr(mesh->outf,".mesh"); @@ -397,6 +398,7 @@ 100.*ttot/ttim[0],call[0],ttot/(float)call[0]); } fprintf(stdout,"\n ELAPSED TIME %.2f SEC. (%.2f)\n",ttim[0],ttot); + fflush(stdout); } @@ -433,8 +435,7 @@ return(1); } - -int main(int argc,char *argv[]) { +int mainmmg3d(int argc,char *argv[],DataFF *dataff) { pMesh mesh; pSol sol; Info *info; @@ -442,7 +443,7 @@ int k,iadr,i,jj,kk,ii; double lambda[3],v[3][3],*mold,*m,declic,maxLES,calLES; fprintf(stdout," -- MMG3d, Release %s (%s) \n",M_VER,M_REL); - fprintf(stdout," Copyright (c) LJLL/IMB, 2010\n"); + fprintf(stdout," Copyright (c) LJLL/IMB, 2014\n"); fprintf(stdout," %s\n",COMPIL); signal(SIGABRT,excfun); @@ -451,7 +452,7 @@ signal(SIGSEGV,excfun); signal(SIGTERM,excfun); signal(SIGINT,excfun); - atexit(endcod); + if(dataff==0) atexit(endcod); TIM_tminit(MMG_ctim,TIMEMAX); TIM_chrono(ON,&MMG_ctim[0]); @@ -479,15 +480,27 @@ info->dt = 1.; info->bdry = 0; info->optles = 0; - + /* modif F. Hecht ..*/ + if(dataff) + { + mesh->name=dataff->meshname; + mesh->move=dataff->movename; + sol->name=dataff->solname; + /* printf(" #### %p %p %p --- \n",mesh->name,mesh->move,sol->name); */ + info->imprim=dataff->imprim; + info->memory=dataff->memory; + } + /* end modf */ if ( !parsar(argc,argv,mesh,sol) ) return(1); MMG_imprim = info->imprim; /* load data */ if ( MMG_imprim ) fprintf(stdout,"\n -- INPUT DATA\n"); TIM_chrono(ON,&MMG_ctim[1]); - if ( !MMG_loadMesh(mesh,mesh->name) ) return(1); - if ( !MMG_loadSol(sol,sol->name,mesh->npmax) ) return(1); + /* modif FH. for interface with ff++ add dataff param */ + if ( !MMG_loadMesh(mesh,mesh->name,dataff) ) return(1); + if ( !MMG_loadSol(sol,sol->name,mesh->npmax,dataff ) ) return(1); + if ( sol->np && sol->np != mesh->np ) { fprintf(stdout," ## WARNING: WRONG SOLUTION NUMBER. IGNORED\n"); sol->np = 0; @@ -495,7 +508,7 @@ if ( !parsop(mesh) ) return(1); - if ( abs(info->option) == 9 && !MMG_loadVect(mesh,mesh->move,mesh->np) ) return(0); + if ( abs(info->option) == 9 && !MMG_loadVect(mesh,mesh->move,mesh->np,dataff) ) return(0); if ( !MMG_setfunc(sol->offset) ) return(1); if ( !MMG_scaleMesh(mesh,sol) ) return(1); @@ -527,7 +540,7 @@ if ( !MMG_hashTetra(mesh) ) return(1); if ( !MMG_markBdry(mesh) ) return(1); if (abs(mesh->info.option)==10) { - MMG_saveMesh(mesh,"tetra.mesh"); + MMG_saveMesh(mesh,"tetra.mesh",dataff); return(0); } @@ -571,8 +584,8 @@ if ( abs(info->option) == 9 ) { if(!MMG_mmg3d9(mesh,sol,&alert)) { if ( !MMG_unscaleMesh(mesh,sol) ) return(1); - MMG_saveMesh(mesh,mesh->outf); - MMG_saveSol(mesh,sol,mesh->outf); + MMG_saveMesh(mesh,mesh->outf,dataff); + MMG_saveSol(mesh,sol,mesh->outf,dataff); return(1); } /*puts("appel 1"); @@ -678,18 +691,18 @@ fprintf(stdout,"\n ## WARNING: INCOMPLETE MESH %d , %d\n", mesh->np,mesh->ne); - if ( MMG_imprim ) fprintf(stdout,"\n -- WRITING DATA FILE %s\n",mesh->outf); + if ( MMG_imprim && !dataff) fprintf(stdout,"\n -- WRITING DATA FILE %s\n",mesh->outf); TIM_chrono(ON,&MMG_ctim[1]); if ( !MMG_unscaleMesh(mesh,sol) ) return(1); - MMG_saveMesh(mesh,mesh->outf); + MMG_saveMesh(mesh,mesh->outf,dataff); if ( info->option == 9 ) { - MMG_saveSol(mesh,sol,mesh->outf); - MMG_saveVect(mesh,mesh->move); + MMG_saveSol(mesh,sol,mesh->outf,dataff); + MMG_saveVect(mesh,mesh->move,dataff); } else - MMG_saveSol(mesh,sol,mesh->outf); + MMG_saveSol(mesh,sol,mesh->outf,dataff); TIM_chrono(OFF,&MMG_ctim[1]); - if ( MMG_imprim ) fprintf(stdout," -- WRITING COMPLETED\n"); + if ( MMG_imprim && !dataff) fprintf(stdout," -- WRITING COMPLETED\n"); /* free mem */ M_free(mesh->point); @@ -697,14 +710,42 @@ M_free(mesh->tetra); /*la desallocation de ce pointeur plante dans certains cas...*/ M_free(mesh->adja); + /* free FH thank to Iztok Bajc */ + /* if( mesh->outf ) free( mesh->outf ); */ + if(sol->metold ) M_free(sol->metold ); + if(mesh->disp->cold ) M_free(mesh->disp->cold); + /* ---- */ M_free(mesh->disp->alpha); M_free(mesh->disp->mv); M_free(mesh->disp); - if ( sol->npfixe ) M_free(sol->met); + if ( sol->met ) M_free(sol->met); M_free(sol); if ( MMG_imprim < -4 || info->ddebug ) M_memDump(); M_free(mesh); + if(MMG_imprim && dataff ) endcod(); + if( M_memLeak() > 1000) + { + M_memDump(); + } return(0); } + +int main(int argc,char *argv[]) { + return mainmmg3d( argc,argv,0); +} +/* + def + */ + MMG_Swap MMG_swpptr; + double (*MMG_length)(double *,double *,double *,double *); + double (*MMG_caltet)(pMesh ,pSol ,int ); + double (*MMG_calte1)(pMesh ,pSol ,int ); + int (*MMG_caltet2)(pMesh ,pSol ,int ,int ,double ,double *); + int (*MMG_cavity)(pMesh ,pSol ,int ,int ,pList ,int ); + int (*MMG_buckin)(pMesh ,pSol ,pBucket ,int ); + int (*MMG_optlen)(pMesh ,pSol ,double ,int ); + int (*MMG_interp)(double *,double *,double *,double ); + int (*MMG_optlentet)(pMesh ,pSol ,pQueue ,double ,int ,int ); + int (*MMG_movevertex)(pMesh ,pSol ,int ,int ); --- mmg3d4/build/sources/eigenv.c 2012-12-19 16:05:32.000000000 +0100 +++ mmg3d4-new/build/sources/eigenv.c 2016-01-28 12:10:07.000000000 +0100 @@ -48,7 +48,7 @@ #include /* seeking 1.e-05 accuracy */ -#define EPSD 1.e-15 +#define EPSD 1.e-12 #define EPSD2 1.e-10 #define EPS6 5.e-06 #define EPS 1.e-06 freefem++-3.61-1/download/scotch/Makefile.patch000644 000767 000024 00000001114 13256636774 021450 0ustar00hechtstaff000000 000000 diff -ur scotch_5.1_esmumps/src/esmumps/Makefile scotch-okk/Makefile --- scotch_5.1_esmumps/src/esmumps/Makefile 2009-04-27 11:22:08.000000000 +0200 +++ scotch-okk/Makefile 2012-05-09 10:00:46.765713788 +0200 @@ -44,7 +44,7 @@ $(CC) $(CFLAGS) -I$(includedir) -c $(<) -o $(@) %$(EXE) : %.c - $(CC) $(CFLAGS) -I$(includedir) $(<) -o $(@) -L$(libdir) $(LDFLAGS) -L. -l$(ESMUMPSLIB) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit + $(CC) $(CFLAGS) -I$(includedir) $(<) -o $(@) -L$(libdir) -L. -l$(ESMUMPSLIB) -l$(SCOTCHLIB) -l$(SCOTCHLIB)errexit $(LDFLAGS) ## ## Project rules. freefem++-3.61-1/download/scotch/Makefile000644 000767 000024 00000011073 13256636774 020357 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc # Downloading and compiling extra libraries # ----------------------------------------- include Makefile.inc all-local: scotch # Downloading and compiling scotch # ------------------------------- # https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.4.tar.gz # http://gforge.inria.fr/frs/download.php/23391/scotch_5.1.7_esmumps.tar.gz # Scotch information DIRPKG=../pkg SRCDIR=scotch_$(scotch_VERSION) PACKAGE=$(DIRPKG)/scotch_$(scotch_VERSION_LOCAL).tar.gz SERVER=https://gforge.inria.fr/frs/download.php/file/34099 #https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.4.tar.gz #https://gforge.inria.fr/frs/download.php/23391 INSTALL=../.. scotch_VERSION=6.0.4 scotch_VERSION_LOCAL=6.0.4 # trick to no in MPI on NOT .. NOTESTMPI= test -z "$(CCP)" scotch: FAIRE $(SRCDIR)/AFAIRE: $(MAKE) install $(NOTESTMPI) || $(MAKE) install-mpi FAIRE: $(SRCDIR)/FAIT $(MAKE) WHERE $(NOTESTMPI) || $(MAKE) WHERE-mpi touch FAIRE Makefile.inc: ../../config.status Makefile-scotch.inc Makefile ../../config.status --file="Makefile.inc:Makefile-scotch.inc" # DCOMMON_TIMING_OLD # FFCS - 16/1/13 - what was "$(CCP)" used for? $(SRCDIR)/FAIT: $(SRCDIR) Makefile.inc cp Makefile.inc $(SRCDIR)/src cd $(SRCDIR)/src && $(MAKE) scotch esmumps touch $(SRCDIR)/FAIT $(SRCDIR)/FAIT-mpi: $(SRCDIR) Makefile.inc cp Makefile.inc $(SRCDIR)/src cd $(SRCDIR)/src && $(MAKE) -j1 ptscotch ptesmumps touch $(SRCDIR)/FAIT-mpi install:$(SRCDIR)/FAIT mkdir -p $(SRCDIR)/$(INSTALL)/include/scotch cp $(SRCDIR)/include/*.h $(SRCDIR)/$(INSTALL)/include/scotch/ cp $(SRCDIR)/lib/*.a $(SRCDIR)/$(INSTALL)/lib/ install-mpi:$(SRCDIR)/FAIT-mpi mkdir -p $(SRCDIR)/$(INSTALL)/include/scotch cp $(SRCDIR)/include/*.h $(SRCDIR)/$(INSTALL)/include/scotch/ cp $(SRCDIR)/lib/*.a $(SRCDIR)/$(INSTALL)/lib/ # ALH - 16/1/13 - simplifying make rules WHERE:$(SRCDIR)/FAIT $(MAKE) install -rm $(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotch LD -L@DIR@/lib -lesmumps -lscotch -lscotcherr >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotchmetis LD -L@DIR@/lib -lscotchmetis >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotch INCLUDE -I@DIR@/include/scotch >> $(SRCDIR)/$(INSTALL)/lib/WHERE.scotch WHERE-mpi:$(SRCDIR)/FAIT-mpi $(MAKE) install-mpi -rm $(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo ptscotch LD -L@DIR@/lib -lesmumps -lptscotch -lptscotcherr >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo ptscotchparmetis LD -L@DIR@/lib -lesmumps -lptscotchparmetis >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo ptscotch INCLUDE -I@DIR@/include/scotch >> $(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotch LD -L@DIR@/lib -lesmumps -lscotch -lscotcherr >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotchmetis LD -L@DIR@/lib -lscotchmetis >>$(SRCDIR)/$(INSTALL)/lib/WHERE.scotch echo scotch INCLUDE -I@DIR@/include/scotch >> $(SRCDIR)/$(INSTALL)/lib/WHERE.scotch $(SRCDIR): $(PACKAGE) tar xvzf $(PACKAGE) patch -p1 $(SRCDIR)/$(INSTALL)/lib/WHERE.superlu echo superlu4 INCLUDE -I@DIR@/include >> $(SRCDIR)/$(INSTALL)/lib/WHERE.superlu $(SRCDIR)/$(INSTALL): mkdir $(SRCDIR)/$(INSTALL) $(SRCDIR): $(PACKAGE_PATH) tar xvzf $(PACKAGE_PATH) touch $(SRCDIR) $(PACKAGE_PATH): ../getall -o SuperLU -a # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) clean: -rm -rf SuperLU_* ff-FLAGS -rm -rf FAIT FAIRE # ALH - FFCS - 18/5/9 - FHecht says he forgot to add -fPIC for 64 bit platforms, so I add it myself here. ff-FLAGS: ../Makefile Makefile grep '^CXX *=' ../Makefile >>$@ grep '^CC *=' ../Makefile >>$@ grep '^CFLAGS *=' ../Makefile|sed 's/$$/ -fPIC/' >>$@ grep '^BLAS[A-Z ]*=' ../Makefile|grep = >>$@ grep '^AR *=' ../Makefile|grep = >>$@ grep '^ARFLAGS *=' ../Makefile|grep = >>$@ grep '^RANLIB *=' ../Makefile|grep = >>$@ grep '^WGET *=' ../Makefile|grep = >>$@ freefem++-3.61-1/download/blacs/Makefile000644 000767 000024 00000005322 13256636774 020160 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- # $Id$ include Bmake.inc all-local: blacs # Downloading and compiling BLACS # ------------------------------ # http://www.netlib.org/blacs/ # Hips information DIRPKG=../pkg SRCDIR=BLACS PACKAGE1=$(DIRPKG)/mpiblacs.tgz PACKAGE2=$(DIRPKG)/mpiblacs-patch03.tgz PACKAGE3=$(DIRPKG)/blacstester.tgz SERVER=http://www.netlib.org/blacs/ INSTALL=../.. SYSERRORS = blacs:FAIRE FAIRE:$(SRCDIR)/FAIT $(MAKE) WHERE touch FAIRE Bmake.inc: ../../config.status Makefile Bmake-blacs.inc ../../config.status --file="Bmake.inc1:Bmake-blacs.inc" sed s/-DAdd__/-Df77IsF2C/ Bmake.inc rm Bmake.inc1 # FFCS: make sure that this makefile fails if the BLACS do not compile. But run links2files when the compilation fails because of # a symbolic link (under Windows). Repeat it only by hand to avoid infinite loops! $(SRCDIR)/FAIT: $(SRCDIR) # cd $(SRCDIR)/INSTALL/;$(MAKE) xintface xsyserrors xcmpi_sane xfmpi_sane xtc_CsameF77 xtc_UseMpich -cd $(SRCDIR) && $(MAKE) mpi ../../../../build/links2files -cd $(SRCDIR) && $(MAKE) mpi ../../../../build/links2files cd $(SRCDIR) && $(MAKE) mpi touch $(SRCDIR)/FAIT WHERE: -if [ -f $(SRCDIR)/FAIT ] ; then \ make install; \ echo blacs LD -L@DIR@/lib/blacs -lblacs_MPI-FREEFEM-0 -lblacsF77init_MPI-FREEFEM-0 -lblacsCinit_MPI-FREEFEM-0 -lblacs_MPI-FREEFEM-0 >$(SRCDIR)/$(INSTALL)/lib/WHERE.blacs ;\ fi install: $(SRCDIR)/FAIT mkdir -p $(SRCDIR)/$(INSTALL)/lib/blacs cp $(SRCDIR)/LIB/*.a $(SRCDIR)/$(INSTALL)/lib/blacs/ # FFCS: some files in the untarred archives are symbolic links that need to be converted for MinGW compilers $(SRCDIR): $(PACKAGE1) $(PACKAGE2) $(PACKAGE3) gunzip -c $(PACKAGE1) | tar xvf - gunzip -c $(PACKAGE2) | tar xvf - gunzip -c $(PACKAGE3) | tar xvf - patch -p0 < BLACS_gridinit_.c-return-values.patch cd $(SRCDIR)/SRC/MPI; patch -p1 < ../../../BLACS.patch cp Bmake.inc $(SRCDIR) mv $(SRCDIR)/SRC/MPI/Makefile $(SRCDIR)/SRC/MPI/Makefile.tmp sed -e 's;\.C;\.oo;g' -e 's@: $$(MPIINCdir)/mpif.h@:@' \ < $(SRCDIR)/SRC/MPI/Makefile.tmp \ > $(SRCDIR)/SRC/MPI/Makefile ../../../../build/links2files touch $(SRCDIR) $(PACKAGE1): -mkdir $(DIRPKG) cd $(DIRPKG);$(WGET) $(SERVER)/`basename $(PACKAGE1)` $(PACKAGE2): -mkdir $(DIRPKG) cd $(DIRPKG);$(WGET) $(SERVER)/`basename $(PACKAGE2)` $(PACKAGE3): -mkdir $(DIRPKG) cd $(DIRPKG);$(WGET) $(SERVER)/`basename $(PACKAGE3)` # FFCS: only run make clean if cd to SRCDIR worked, otherwise this is an infinite loop. clean-local: -cd $(SRCDIR)/SRC/MPI && $(MAKE) clean -C $(SRCDIR)/SRC/MPI -rm Bmake.inc FAIRE -rm $(SRCDIR)/$(INSTALL)/lib/blacs/*.a -rm -rf $(SRCDIR) clean: clean-local .PHONY:$(SRCDIR)/$(INSTALL) compile installfreefem++-3.61-1/download/blacs/BLACS_gridinit_.c-return-values.patch000644 000767 000024 00000000512 13256636774 025444 0ustar00hechtstaff000000 000000 --- ./BLACS/SRC/MPI/blacs_gridinit_.c.orig 2013-01-27 12:42:38.712531484 +0000 +++ ./BLACS/SRC/MPI/blacs_gridinit_.c 2013-01-27 12:49:32.411131896 +0000 @@ -35,4 +35,9 @@ blacs_gridmap_(ConTxt, tmpgrid, nprow, nprow, npcol); #endif free(tmpgrid); +#if (INTFACE == C_CALL) + return 0; +#else + return NULL; +#endif } freefem++-3.61-1/download/blacs/BLACS.patch000644 000767 000024 00000002261 13256636774 020364 0ustar00hechtstaff000000 000000 diff -ur BLACS/SRC/MPI/Makefile BLACS-okk/Makefile --- BLACS/SRC/MPI/Makefile 2010-02-16 13:29:39.000000000 +0100 +++ BLACS-okk/Makefile 2010-02-16 13:24:56.000000000 +0100 @@ -86,7 +86,8 @@ rm -f $(BLACSFINIT) $(BLACSCINIT) make $(BLACSFINIT) make $(BLACSCINIT) - $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(Fintobj) $(Cintobj) + cp INTERNAL/*.o . + $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(internal) $(Fintobj) $(Cintobj) $(RANLIB) $(BLACSLIB) $(BLACSFINIT) : @@ -110,7 +111,7 @@ ( cd INTERNAL ; $(MAKE) -f ../Makefile I_int "dlvl=$(BTOPdir)" ) I_int : Bdef.h Bconfig.h $(internal) - $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(internal) + #$(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(internal) Bdef.h : ../Bdef.h rm -f Bdef.h @@ -196,9 +196,10 @@ bi_f77_mpi_testall.o : mpif.h bi_f77_mpi_testall.f $(F77) -c $(F77FLAGS) $*.f -mpif.h : $(MPIINCdir)/mpif.h +# FFCS: watch out for spaces and links under Windows. Also, make dependencies cannot contain spaces. +mpif.h : rm -f mpif.h - ln -s $(MPIINCdir)/mpif.h mpif.h + cp $(MPIINCdir)/mpif.h mpif.h # ------------------------------------------------------------------------ # We move C .o files to .C so that we can use the portable suffix rule for freefem++-3.61-1/download/blacs/Bmake-blacs.inc000644 000767 000024 00000027320 13256636774 021316 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ include $(abs_top_builddir)/download/headers-sparsesolver.inc #============================================================================= #====================== SECTION 0: FREEFEM++ ================================ #============================================================================= # The following macros specify the executable to download BLACS #============================================================================= WGET = @WGET@ #============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(abs_top_builddir)/download/blacs/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = FREEFEM # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/libblacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/libblacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/libblacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = $(FFMPIDIR) MPIdev = MPIplat = # FFCS: Windows path to MPICH2 contains spaces, but FF configure --with-mpipath option should not contain quotes # because FF configure adds quotes when defining MPI_LIB MPILIBdir = '@MPI_LIB_DIRS@' MPIINCdir = '@MPI_INC_DIR@' MPILIB = @MPI_LIB@ # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = @CFLAGSF77@ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" DEFBSTOP = $(FFDEFBSTOP) DEFCOMBTOP = $(FFDEFCOMBTOP) # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = $(FFSENDIS) # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = $(FFBUFF) # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. # TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- TRANSCOMM = $(FFTRANSCOMM) # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = $(FFWHATMPI) # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = $(FFSYSERRORS) # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = @MPIF77@ #--prefix /Users/morice/librairie/openmpi-gcc-gfortran-4.4/ F77NO_OPTFLAGS = @FNOFLAGS@ F77FLAGS = @FFLAGS@ F77LOADER = $(F77) F77LOADFLAGS = @FFLAGS@ @LDFLAGS@ CC = @MPICC@ #--prefix /Users/morice/librairie/openmpi-gcc-gfortran-4.4/ CCFLAGS = @CFLAGS@ #-fnested-functions CCLOADER = $(CC) CCLOADFLAGS = @LDFLAGS@ # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = @AR@ #ar ARCHFLAGS = @ARFLAGS@ #rs RANLIB = @RANLIB@ #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= freefem++-3.61-1/download/metis/Makefile000644 000767 000024 00000006617 13256636774 020225 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- include Makefile.in all-local: metis # Downloading and compiling Tetgen # ------------------------------ # http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-4.0.tar.gz # Metis information DIRPKG=../pkg SRCDIR=metis-$(metis_VERSION) PACKAGE=$(DIRPKG)/metis-$(metis_VERSION).tar.gz SERVER=http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis #//http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD INSTALL=../.. # FFCS - 14/11/11 - version 4.0.3 is not available from netlib anymore metis_VERSION=5.1.0 metis: FAIRE $(SRCDIR)/FAIT: $(MAKE) install touch $(SRCDIR)/FAIT install:$(SRCDIR)/tag-compile # cd $(SRCDIR)/Programs ;$(MAKE) # cd $(SRCDIR) ; $(MAKE) -C install -mkdir -p ../include/metis -mkdir -p ../lib/metis cp $(SRCDIR)/libmetis.a ../lib/metis cp $(SRCDIR)/include/*.h ../include/metis FAIRE: $(SRCDIR)/FAIT $(MAKE) WHERE touch FAIRE Makefile.in: ../../config.status Makefile-metis.in ../../config.status --file="Makefile.in:Makefile-metis.in" $(SRCDIR)/tag-compile: $(SRCDIR)/tags #cd $(SRCDIR)/libmetis ; make -C $(SRCDIR)/libmetis $(OBJS) 'CC=$(CC)' CFLAGS='$(CFLAGS) -I../GKlib -I../include -I.' make -C $(SRCDIR)/GKlib $(OBJS_GK) 'CC=$(CC)' CFLAGS='$(CFLAGS) -I../GKlib -I../include -I. -Dmetis_EXPORTS' mkdir $(SRCDIR)/lib cd $(SRCDIR); $(AR) libmetis.a libmetis/*.o GKlib/*.o touch $(SRCDIR)/tag-compile WHERE: -if [ -f $(SRCDIR)/FAIT ] ; then \ echo metis LD -L@DIR@/lib/metis -lmetis >$(SRCDIR)/$(INSTALL)/lib/WHERE.metis ;\ echo metis INCLUDE -I@DIR@/include/metis >> $(SRCDIR)/$(INSTALL)/lib/WHERE.metis ;\ fi OBJS=auxapi.o coarsen.o fm.o graph.o kwayrefine.o minconn.o options.o separator.o timing.o \ balance.o compress.o fortran.o initpart.o mcutil.o mincover.o parmetis.o sfm.o util.o \ bucketsort.o contig.o frename.o kmetis.o mesh.o mmd.o pmetis.o srefine.o wspace.o \ checkgraph.o debug.o gklib.o kwayfm.o meshpart.o ometis.o refine.o stat.o OBJS_GK=b64.o error.o fs.o graph.o itemsets.o omp.o random.o sort.o tokenizer.o \ blas.o evaluate.o getopt.o htable.o mcore.o pdb.o rw.o string.o util.o \ csr.o fkvkselect.o gkregex.o io.o memory.o pqueue.o seq.o timers.o # FFCS: patch is necessary for metis 4.0, but not for 4.0.3 $(SRCDIR)/tags: $(PACKAGE) tar xvzf $(PACKAGE) touch $(SRCDIR)/tags $(SRCDIR)/tags-4.0: $(PACKAGE) tar xvzf $(PACKAGE) patch -p0 $(SRCDIR)/Programs/Makefile mv $(SRCDIR)/Lib/Makefile $(SRCDIR)/Lib/Makefile-orig sed -e 's;../libmetis.a;../$(INSTALL)/lib/metis/libmetis.a;' \ <$(SRCDIR)/Lib/Makefile-orig \ >$(SRCDIR)/Lib/Makefile touch $(SRCDIR)/tags $(PACKAGE): ../getall -o METIS -a clean-local: -cd $(SRCDIR) && $(MAKE) realclean -C $(SRCDIR) -rm -rf metis-4.0 config.log -rm -rf ../lib/metis ../lib/WHERE.metis -rm -rf ../include/metis -rm -rf $(SRCDIR) -rm FAIRE FAIT # FFCS - 23/5/12 - $(SRCDIR)/$(INSTALL) is meaningless if $(SRCDIR) does not exist clean: clean-local -rm ../lib/metis/libmetis.a -rm ../lib/include/metis.h -rm -rf $(SRCDIR) -rm FAIRE FAIT freefem++-3.61-1/download/metis/patch-metis000644 000767 000024 00000000467 13256636774 020723 0ustar00hechtstaff000000 000000 --- metis-4.0/Lib/rename.h 2009-09-22 18:28:35.000000000 +0200 +++ metis-4.0/Lib/rename.h-ok 2009-09-22 18:28:47.000000000 +0200 @@ -410,7 +410,7 @@ #define RandomPermute __RandomPermute #define ispow2 __ispow2 #define InitRandom __InitRandom -#define log2 __log2 +#define log2 metis_log2 freefem++-3.61-1/download/metis/metis-4.0_main_return.patch000644 000767 000024 00000012076 13256636774 023625 0ustar00hechtstaff000000 000000 --- metis-4.0/Programs/kmetis.c.orig 2013-01-26 21:01:39.898052768 +0000 +++ metis-4.0/Programs/kmetis.c 2013-01-26 21:01:52.186053491 +0000 @@ -19,7 +19,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, nparts, options[10]; idxtype *part; @@ -100,6 +100,8 @@ GKfree(&graph.xadj, &graph.adjncy, &graph.vwgt, &graph.adjwgt, &part, LTERM); + + return 0; } --- metis-4.0/Programs/pmetis.c.orig 2013-01-26 22:42:46.375724925 +0000 +++ metis-4.0/Programs/pmetis.c 2013-01-26 22:43:33.744727711 +0000 @@ -19,7 +19,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, nparts, options[10]; idxtype *part; @@ -100,6 +100,8 @@ GKfree(&graph.xadj, &graph.adjncy, &graph.vwgt, &graph.adjwgt, &part, LTERM); + + return 0; } --- ./metis-4.0/Programs/graphchk.c.orig 2013-01-26 23:00:11.167253583 +0000 +++ ./metis-4.0/Programs/graphchk.c 2013-01-26 23:00:38.003255160 +0000 @@ -19,7 +19,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { GraphType graph; char filename[256]; @@ -53,6 +53,8 @@ GKfree(&graph.xadj, &graph.adjncy, &graph.vwgt, &graph.adjwgt, LTERM); + + return 0; } --- ./metis-4.0/Programs/mesh2dual.c.orig 2013-01-26 23:02:14.677260844 +0000 +++ ./metis-4.0/Programs/mesh2dual.c 2013-01-26 23:02:45.081262631 +0000 @@ -20,7 +20,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, j, ne, nn, etype, numflag=0; idxtype *elmnts, *xadj, *adjncy; @@ -67,6 +67,7 @@ GKfree(&elmnts, &xadj, &adjncy, LTERM); + return 0; } --- ./metis-4.0/Programs/mesh2nodal.c.orig 2013-01-26 23:03:35.671265601 +0000 +++ ./metis-4.0/Programs/mesh2nodal.c 2013-01-26 23:03:59.234266985 +0000 @@ -20,7 +20,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, j, ne, nn, etype, numflag=0; idxtype *elmnts, *xadj, *adjncy; @@ -67,6 +67,7 @@ GKfree(&elmnts, &xadj, &adjncy, LTERM); + return 0; } --- ./metis-4.0/Programs/oemetis.c.orig 2013-01-26 23:04:51.689270079 +0000 +++ ./metis-4.0/Programs/oemetis.c 2013-01-26 23:05:15.686271479 +0000 @@ -19,7 +19,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, options[10]; idxtype *perm, *iperm; @@ -90,6 +90,8 @@ GKfree(&graph.xadj, &graph.adjncy, &perm, &iperm, LTERM); + + return 0; } --- ./metis-4.0/Programs/onmetis.c.orig 2013-01-26 23:06:04.908274368 +0000 +++ ./metis-4.0/Programs/onmetis.c 2013-01-26 23:06:26.011275618 +0000 @@ -19,7 +19,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, options[10]; idxtype *perm, *iperm; @@ -90,6 +90,8 @@ GKfree(&graph.xadj, &graph.adjncy, &perm, &iperm, LTERM); + + return 0; } --- ./metis-4.0/Programs/partdmesh.c.orig 2013-01-26 23:07:09.315278152 +0000 +++ ./metis-4.0/Programs/partdmesh.c 2013-01-26 23:07:33.761279588 +0000 @@ -20,7 +20,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, j, ne, nn, etype, numflag=0, nparts, edgecut; idxtype *elmnts, *epart, *npart; @@ -88,6 +88,7 @@ GKfree(&elmnts, &epart, &npart, LTERM); + return 0; } --- ./metis-4.0/Programs/partnmesh.c.orig 2013-01-26 23:09:04.858284939 +0000 +++ ./metis-4.0/Programs/partnmesh.c 2013-01-26 23:09:45.701287342 +0000 @@ -20,7 +20,7 @@ /************************************************************************* * Let the game begin **************************************************************************/ -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, j, ne, nn, etype, numflag=0, nparts, edgecut; idxtype *elmnts, *epart, *npart; @@ -88,6 +88,7 @@ GKfree(&elmnts, &epart, &npart, LTERM); + return 0; } freefem++-3.61-1/download/metis/Makefile-metis.in000644 000767 000024 00000000651 13256636774 021741 0ustar00hechtstaff000000 000000 # Which compiler to use CC = @CC@ # What optimization level to use OPTFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@ # What options to be used by the compiler COPTIONS = @FFMETIS_CFLAGS@ # What options to be used by the loader LDOPTIONS = @LDFLAGS@ # What archiving to use AR = @AR@ @ARFLAGS@ # What to use for indexing the archive RANLIB = @RANLIB@ #RANLIB = ar -ts #RANLIB = WGET = @WGET@ EXEEXT = @EXEEXT@ VERNUM = @EXEEXT@freefem++-3.61-1/download/nlopt/Make.inc000644 000767 000024 00000000165 13256636774 020140 0ustar00hechtstaff000000 000000 FFDOWNLOAD=@abs_builddir@/download CC=@CC@ CXX=@CXX@ WGET=@WGET@ CXXFLAGS=@CXXFLAGS@ CFLAGS=@CFLAGS@ CXXCPP=@CXXCPP@ freefem++-3.61-1/download/nlopt/Makefile000644 000767 000024 00000003006 13256636774 020225 0ustar00hechtstaff000000 000000 URL="http://ab-initio.mit.edu/nlopt/nlopt-2.2.4.tar.gz" SRCDIR=nlopt-2.2.4 TARGZ=../pkg/$(SRCDIR).tar.gz -include Make.defs all: FAIRE FAIRE: ../pkg $(SRCDIR)/FAIT $(SRCDIR)/FAIT: $(TARGZ) tar zxvf $(TARGZ) # # FFCS - 30/11/11 - "--disable-dependency-tracking": dependencies pose problem on mixed Cygwin/MinGW setups # because of slashes and backslashes # # FFCS - 22/10/12 - Fred - "--without-octave": patch for one machine that has octave installed on it: building of # nlopt fails because it wants to install the octave components. Not a bad idea in general but probably not when # building ffcs. # #remove c++11 flags for windfows FH .. cxxflags=`echo $(CXXFLAGS) |sed -e 's/[-]std=c[+][+]11//g'` ; \ cd $(SRCDIR) && ./configure --disable-dependency-tracking --with-cxx --prefix="$(FFDOWNLOAD)" CXX="$(CXX)" \ CXXFLAGS="$(CXXFLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$$cxxflag" "--without-threadlocal" "--without-octave" # # FFCS - 30/11/11 - we need to know when the building process breaks # cd $(SRCDIR) && $(MAKE) install touch $(SRCDIR)/FAIT $(MAKE) WHERE ../pkg: mkdir $@ $(TARGZ): ../getall -o NLopt -a clean-local: rm -rf $(SRCDIR) Make.defs rm -f ../lib/libnlopt_cxx* ../lib/WHERE.nlopt rm -f ../include/nlopt* clean:clean-local WHERE: -if [ -f $(SRCDIR)/FAIT ] ; then \ echo nlopt LD -L@DIR@/lib -lnlopt_cxx >../lib/WHERE.nlopt ;\ echo nlopt INCLUDE -I@DIR@/include >> ../lib/WHERE.nlopt ;\ fi Make.defs: ../../config.status Makefile Make.inc ../../config.status --file="Make.defs:Make.inc" freefem++-3.61-1/download/ff-petsc/Makefile-PETSc.inc000644 000767 000024 00000001363 13256636774 022270 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ CC=@CC@ # FC : Fortran 90 compiler FC=@FC@ BLASLIBS = @BLASLIBS@ LAPACKLIBS=@LAPACKLIBS@ # Use: # -DAdd_ if your Fortran compiler adds an underscore at the end # of symbols, # -DAdd__ if your Fortran compiler adds 2 underscores, # # -DUPPER if your Fortran compiler uses uppercase symbols # # leave empty if your Fortran compiler does not change the symbols. # CFLAGS=@CFLAGS@ FCFLAGS=@FCFLAGS@ CFLAGSF77=@CFLAGSF77@ MPI_INCLUDE=@MPI_INCLUDE@ MPI_INC_DIR=@MPI_INC_DIR@ MPI_LIB=@MPI_LIB@ MPI_LIBC=@MPI_LIBC@ MPI_LIBFC=@MPI_LIBFC@ MPI_LIB_DIRS=@MPI_LIB_DIRS@ MPICC=@MPICC@ MPICXX=@MPICXX@ MPIF77=@MPIF77@ MPIFC=@MPIFC@ MPIPROG=@MPIPROG@ MPIRUN=@MPIRUN@ MPISCRIPT=@MPISCRIPT@ prefix=@prefix@ freefem++-3.61-1/download/ff-petsc/Makefile000644 000767 000024 00000026416 13312446271 020572 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc include Makefile.inc W_SUDO:=$(SHELL mkdir -p "$(DESTDIR)$(prefix)/ff-petsc" && test -w "$(DESTDIR)$(prefix)/ff-petsc" || echo sudo) W_SUDO1=$(SHELL ls ) all-local: @echo " # To build petsc and slepc do $ make petsc-slepc" @echo " # warning you have no write acces in $(DESTDIR)$(prefix)/ff-petsc" @echo " # need sudo if '$(W_SUDO)' == 'sudo' .." $(W_SUDO1) @echo " # run under root " @echo " # or create / add acces to $(DESTDIR)$(prefix)/ff-petsc " @echo " # do for examples:" @echo " sudo chmod a+rxw $(DESTDIR)$(prefix)/ff-petsc" @echo " make petsc-slepc " # Downloading and compiling mumps # ------------------------------- DIRPKG=../pkg VERSION=3.9.2 VERSION_SLEPC=3.9.1 # http://slepc.upv.es/download/download.php?filename=slepc-3.7.4.tar.gz PACKAGE=../pkg/petsc-lite-$(VERSION).tar.gz PACKAGE_SLEPC=../pkg/slepc-$(VERSION_SLEPC).tar.gz SRCDIR=petsc-$(VERSION) SRCDIR_SLEPC=slepc-$(VERSION_SLEPC) MPI_DIR:=$(shell dirname $(MPI_INC_DIR)) W_MPICC:=$(strip $(shell which mpicc)) ifeq ($(MPICC),$(W_MPICC)) WITH_MPI_DIR= else WITH_MPI_DIR=--with-mpi-dir='$(MPI_DIR)' endif DIR_INSTALL_REAL:=$(prefix)/ff-petsc/real DIR_INSTALL_COMPLEX:=$(prefix)/ff-petsc/complex PETSC_DIR:=$(PWD)/$(SRCDIR) SLEPC_DIR:=$(PWD)/$(SRCDIR_SLEPC) petsc-slepc: Makefile.inc dir-install WHERE-all dir-install: Makefile.inc -$(SUDO) mkdir -p $(DESTDIR)$(DIR_INSTALL_REAL) -$(SUDO) mkdir -p $(DESTDIR)$(DIR_INSTALL_COMPLEX) @if test -w "$(DESTDIR)$(DIR_INSTALL_REAL)" -a -w "$(DESTDIR)$(DIR_INSTALL_COMPLEX)" ; then echo "no need of sudo"; echo > do-sudo; \ else \ echo no write access in $(DESTDIR)$(DIR_INSTALL_REAL) and $(DESTDIR)$(DIR_INSTALL_COMPLEX); \ echo " do: make petsc-slepc SUDO=sudo "; \ echo " or add write access to 2 directory "; \ echo sudo >do-sudo; \ fi PETSc-real: @if [ -n "$(MPI_INCLUDE)" ]; then $(MAKE) WHERE ;\ else echo " -- No Petc , no MPI"; fi PETSc-complex: @if [ -n "$(MPI_INCLUDE)" ]; then $(MAKE) -f Makefile.complex WHERE-complex ;\ else echo " -- No Petc , no MPI, no Petsc real"; fi WHERE:../lib/WHERE.PETSc ../lib/WHERE.SLEPc ../lib/WHERE.PETSc:$(SRCDIR)/tag-install-real -mkdir ../lib echo 'petsc LD -Wl,-rpath,"$(DIR_INSTALL_REAL)/lib" -L"$(DIR_INSTALL_REAL)/lib" -lpetsc' > $@ echo 'petsc INCLUDE -I"$(DIR_INSTALL_REAL)/include"' >> $@ SLEPc-real: @if [ -n "$(MPI_INCLUDE)" ]; then $(MAKE) ../lib/WHERE.SLEPc ;\ else echo " -- No Petc , no MPI"; fi SLEPc-complex: @if [ -n "$(MPI_INCLUDE)" ]; then $(MAKE) -f Makefile.complex ../lib/WHERE.SLEPc-complex ;\ else echo " -- No Petc , no MPI"; fi $(SRCDIR)/tag-make-real:$(SRCDIR)/tag-conf-real cd $(SRCDIR) && $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-real all touch $@ $(SRCDIR)/tag-install-real :$(SRCDIR)/tag-make-real cd $(SRCDIR) && $(SUDO) $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-real install touch $@ Makefile.inc:../../config.status Makefile Makefile-PETSc.inc ../../config.status --file="Makefile.inc:Makefile-PETSc.inc" $(SRCDIR)/tag-conf-real:$(SRCDIR)/tag-tar cd $(SRCDIR) && python2 ./configure \ --prefix=$(DIR_INSTALL_REAL) \ --with-ssl=0 ---with-x=0 \ '--with-scalar-type=real' \ $(WITH_MPI_DIR) \ --with-blas-lapack-lib='$(LAPACKLIBS) $(BLASLIBS)' \ --download-scalapack --download-metis --download-ptscotch \ --download-mumps --download-ml --download-hypre --download-parmetis \ --download-superlu --download-suitesparse --download-fftw \ PETSC_ARCH=ff-real test -f $(SRCDIR)/ff-real/lib/petsc/conf/petscvariables touch $@ Make-petsc-download.mk:$(SRCDIR)/tag-install-real $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables egrep 'SCALAPACK_|METIS_|MUMPS_|SUPERLU_|FFTW_|PTSCOTCH_|SUITESPARSE_' $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables | sed 's/-I/ /g'|sort >$@ ifdef MUMPS_LIB # version COMPLEX ..... $(SRCDIR)/tag-conf-complex:$(SRCDIR)/tag-tar Make-petsc-download.mk cd $(SRCDIR) && python2 ./configure \ --prefix=''$(DIR_INSTALL_COMPLEX)'' \ '--with-scalar-type=complex' \ --with-ssl=0 ---with-x=0 \ $(WITH_MPI_DIR) \ --with-blas-lapack-lib='$(LAPACKLIBS) $(BLASLIBS)' \ --with-scalapack-include='$(SCALAPACK_INCLUDE)' --with-scalapack-lib='$(SCALAPACK_LIB)' \ --with-metis-include='$(METIS_INCLUDE)' --with-metis-lib='$(METIS_LIB)' \ --with-ptscotch-include='$(PTSCOTCH_INCLUDE)' --with-ptscotch-lib='$(PTSCOTCH_LIB)' \ --with-suitesparse-include='$(SUITESPARSE_INCLUDE)' --with-suitesparse-lib='$(SUITESPARSE_LIB)' \ --with-mumps-include='$(MUMPS_INCLUDE)' --with-mumps-lib='$(MUMPS_LIB)' \ --with-parmetis-include='$(PARMETIS_INCLUDE)' --with-parmetis-lib='$(PARMETIS_LIB)' \ --with-fftw-include='$(FFTW_INCLUDE)' --with-fftw-lib='$(FFTW_LIB)' \ PETSC_ARCH=ff-complex test -f $(SRCDIR)/ff-complex/lib/petsc/conf/petscvariables touch $@ $(SRCDIR)/tag-make-complex:$(SRCDIR)/tag-conf-complex Make-petsc-download.mk cd $(SRCDIR) && $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-complex all touch $@ $(SRCDIR)/tag-install-complex :$(SRCDIR)/tag-make-complex cd $(SRCDIR) && $(SUDO) $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-complex install touch $@ WHERE-complex:../lib/WHERE.PETSc-complex ../lib/WHERE.SLEPc-complex ../lib/WHERE.PETSc-complex:$(SRCDIR)/tag-install-complex -mkdir ../lib echo 'petsccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lpetsc' > $@ echo 'petsccomplex INCLUDE -I"$(DIR_INSTALL_COMPLEX)/include"' >> $@ ../lib/WHERE.SLEPc-complex:$(SRCDIR_SLEPC)/tag-install-complex -mkdir ../lib echo 'slepccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lslepc' > $@ echo 'slepccomplex INCLUDE -I"$(DIR_INSTALL_COMPLEX)/include"' >> $@ ## need include include Make-petsc-download.mk WHERE-all:Makefile WHERE-complex WHERE echo scalapack LD $(SCALAPACK_LIB) >$@ echo scalapack INCLUDE -I$(CALAPACK_INCLUDE) >>$@ echo metis LD $(METIS_LIB) >>$@ echo metis INCLUDE -I$(METIS_INCLUDE) >>$@ echo mumps LD $(MUMPS_LIB) >>$@ echo mumps INCLUDE -I$(MUMPS_INCLUDE) >>$@ echo superlu LD $(SUPERLU_LIB) >>$@ echo superlu INCLUDE -I$(SUPERLU_INCLUDE) >>$@ echo fftw LD $(FFTW_LIB) >>$@ echo fftw INCLUDE -I$(FFTW_INCLUDE) >>$@ echo ptscotch LD $(PTSCOTCH_LIB) >>$@ echo ptscotch INCLUDE -I$(PTSCOTCH_INCLUDE) >>$@ echo parmetis LD $(PARMETIS_LIB)>>$@ echo parmetis INCLUDE -I$(PARMETIS_INCLUDE)>>$@ echo 'petsc LD -Wl,-rpath,"$(DIR_INSTALL_REAL)/lib" -L"$(DIR_INSTALL_REAL)/lib" -lpetsc' >> $@ echo 'petsc INCLUDE -I"$(DIR_INSTALL_REAL)/include"' >> $@ echo 'petsccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lpetsc' >> $@ echo 'petsccomplex INCLUDE -I"$(DIR_INSTALL_COMPLEX)/include"' >> $@ echo 'slepc LD -Wl,-rpath,"$(DIR_INSTALL_REAL)/lib" -L"$(DIR_INSTALL_REAL)/lib" -lslepc' >> $@ echo 'slepc INCLUDE -I"$(DIR_INSTALL_REAL)/include"' >> $@ echo 'slepccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lslepc' >> $@ echo 'slepccomplex INCLUDE -I"$(DIR_INSTALL_COMPLEX)/include"' >> $@ $(SRCDIR_SLEPC)/tag-conf-complex:$(SRCDIR_SLEPC)/tag-tar export PETSC_DIR=$(DIR_INSTALL_COMPLEX) ; \ export SLEPC_DIR=$(SLEPC_DIR) ; \ cd $(SRCDIR_SLEPC) && python2 ./configure --prefix=$(DIR_INSTALL_COMPLEX) touch $@ $(SRCDIR_SLEPC)/tag-make-complex:$(SRCDIR_SLEPC)/tag-conf-complex cd $(SRCDIR_SLEPC) && make SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_COMPLEX) touch $@ $(SRCDIR_SLEPC)/tag-install-complex :$(SRCDIR_SLEPC)/tag-make-complex cd $(SRCDIR_SLEPC) && $(SUDO) make install SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_COMPLEX) touch $@ ../lib/WHERE.SLEPc-complex:$(SRCDIR_SLEPC)/tag-install-complex -mkdir ../lib echo 'slepccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lslepc' > $@ echo 'slepccomplex INCLUDE -I"$(DIR_INSTALL_COMPLEX)/include"' >> $@ else WHERE-all:Makefile Make-petsc-download.mk $(MAKE) -f Makefile.complex $@ endif $(SRCDIR)/tag-tar:$(PACKAGE) tar xvzf $(PACKAGE) touch $@ $(SRCDIR_SLEPC)/tag-tar:$(PACKAGE_SLEPC) rm -rf $(SRCDIR_SLEPC) tar xvzf $(PACKAGE_SLEPC) #mv `tar tfz $(PACKAGE_SLEPC) | head -1` $(SRCDIR_SLEPC) #cd $(SRCDIR_SLEPC);patch -p1 <../patch-slepc-3.8.3 touch $@ $(PACKAGE): ../getall -o PETSc -a $(PACKAGE_SLEPC): ../getall -o SLEPc -a $(SRCDIR_SLEPC)/tag-conf-real:$(SRCDIR_SLEPC)/tag-tar export PETSC_DIR=$(DIR_INSTALL_REAL) ; \ export SLEPC_DIR=$(SLEPC_DIR) ; \ cd $(SRCDIR_SLEPC) && python2 ./configure --prefix=$(DIR_INSTALL_REAL) touch $@ $(SRCDIR_SLEPC)/tag-make-real:$(SRCDIR_SLEPC)/tag-conf-real cd $(SRCDIR_SLEPC) && make SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_REAL) touch $@ $(SRCDIR_SLEPC)/tag-install-real :$(SRCDIR_SLEPC)/tag-make-real cd $(SRCDIR_SLEPC) && $(SUDO) make install SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_REAL) touch $@ ../lib/WHERE.SLEPc:$(SRCDIR_SLEPC)/tag-install-real -mkdir ../lib echo 'slepc LD -Wl,-rpath,"$(DIR_INSTALL_REAL)/lib" -L"$(DIR_INSTALL_REAL)/lib" -lslepc' > $@ echo 'slepc INCLUDE -I"$(DIR_INSTALL_REAL)/include"' >> $@ clean:clean-local clean-local: -cd $(SRCDIR) && $(MAKE) clean -C $(SRCDIR) -rm Makefile.inc FAIRE* ../lib/WHERE.PETSc* ../lib/WHERE.SLEPc* -rm -rf ../include/*PETSc* -rm -rf ../lib/lib*PETSc* -rm -rf $(SRCDIR) -rm -rf $(prefix)/ff-petsc # -rm $(PACKAGE1) -rm WHERE-all config.log *.done -if test -d $(prefix)/ff-petsc ; then echo " try of remove of $(prefix)/ff-petsc under sudo .."; sudo rm -rf $(prefix)/ff-petsc ; fi -rm do-sudo echo: @echo " with_dir_mpi #$(W_MPICC)# #$(MPICC)# ::: #$(WITH_MPI_DIR)# " @echo SUDO: $(SUDO) @echo MPI_DIR: $(MPI_DIR) @echo " dir install real :" $(DIR_INSTALL_REAL) @echo " dir install complex :" $(DIR_INSTALL_COMPLEX) @echo " do-sudo auto ???" $(SHELL cat o-sudo) install-destdir: cd $(SRCDIR) && $(SUDO) $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-real install DESTDIR=$(DESTDIR) cd $(SRCDIR) && $(SUDO) $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=ff-complex install DESTDIR=$(DESTDIR) cd $(SRCDIR_SLEPC) && $(SUDO) make install SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_COMPLEX) DESTDIR=$(DESTDIR) cd $(SRCDIR_SLEPC) && $(SUDO) make install SLEPC_DIR=$(SLEPC_DIR) PETSC_DIR=$(DIR_INSTALL_REAL) DESTDIR=$(DESTDIR) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/ff-petsc/patch-slepc-3.7.4000644 000767 000024 00000001472 13256636774 021742 0ustar00hechtstaff000000 000000 --- old/slepc-3.7.4/include/slepc/private/bvimpl.h 2017-05-17 10:28:01.000000000 +0200 +++ new/slepc-3.7.4/include/slepc/private/bvimpl.h 2017-06-20 18:20:25.000000000 +0200 @@ -123,7 +123,7 @@ ierr = PetscInfo(bv,"Zero norm, either the vector is zero or a semi-inner product is being used\n");CHKERRQ(ierr); } #if defined(PETSC_USE_COMPLEX) - if (PetscAbsReal(PetscImaginaryPart(alpha))/absal>PETSC_MACHINE_EPSILON) SETERRQ(PetscObjectComm((PetscObject)bv),1,"The inner product is not well defined: nonzero imaginary part"); + if (PetscAbsReal(PetscImaginaryPart(alpha))/absal>PETSC_MACHINE_EPSILON*1000.) SETERRQ(PetscObjectComm((PetscObject)bv),1,"The inner product is not well defined: nonzero imaginary part"); #endif if (bv->indef) { *res = (realp<0.0)? -PetscSqrtReal(-realp): PetscSqrtReal(realp); freefem++-3.61-1/download/ff-petsc/Makefile.complex000644 000767 000024 00000000060 13256636774 022243 0ustar00hechtstaff000000 000000 include Make-petsc-download.mk include Makefilefreefem++-3.61-1/download/yams/yamslib.c000644 000767 000024 00000035444 13256636774 020221 0ustar00hechtstaff000000 000000 #define __YAMSLIB #include #include #include #include #include #include "yams.h" #include "defines.h" #include "sproto.h" extern long verbosity; /* globals (see globals.h) */ Error yerr; Info info; Options opts; pHashtable hash; mytime ctim[TIMEMAX]; long nhmax,hnext,hsize; int out,idir[5] = {0,1,2,0,1},idirq[7] = {0,1,2,3,0,1,2}; short imprim; ubyte ddebug; ubyte ecp; static void yams_excfun(int sigid) { switch(sigid){ case SIGFPE: fprintf(stderr," ## FP EXCEPTION. STOP\n"); break; case SIGILL: fprintf(stderr," ## ILLEGAL INSTRUCTION. STOP\n"); break; case SIGSEGV: fprintf(stderr," ## SEGMENTATION FAULT. STOP\n"); break; case SIGABRT: case SIGTERM: case SIGINT: fprintf(stderr," ## ABNORMAL END. STOP\n"); break; } out = 0; exit(1); } static void yams_endcod() { chrono(OFF,&ctim[0]); chrono(OFF,&ctim[1]); E_dump(); if ( out <= 0 ) { prierr(WAR,8002); fprintf(stdout,"\n ELAPSED TIME %.2f SEC.\n",gttime(ctim[0])); } } static void yams_inival(){ /* initialize data */ E_put("inival"); info.dmin = (double)FLT_MAX; info.dmax = (double)FLT_MIN; info.xmin = info.ymin = info.zmin = (double)FLT_MAX; info.xmax = info.ymax = info.zmax = (double)-FLT_MAX/2.; info.nedg = info.nrid = info.ndang = 0; info.ncoi = info.nreq = info.nvus = 0; info.cc = info.flip = 0; info.nulp = info.nulf = info.nuln = 0; info.qpire = 0; info.manifold = TRUE; /* set default values for options */ opts.hmin = -2.0; opts.hmax = -2.0; opts.shock = 1.3; /* default mesh gradation */ opts.eps = 0.01; /* geometric approximation */ opts.iso = 0.0; opts.declic = 1.0 / BETAC; opts.lambda = -1.0; opts.mu = -1.0; opts.ridge = cos(RIDG*M_PI/180.); opts.geom = cos(GEOM*M_PI/180.); opts.walton = COS45DEG; /* Walton limitation */ opts.bande = -2; /* default = 1 unit */ opts.degrad = QUALCOE; /* quality degradation */ opts.ctrl = REL | ISO; opts.iter = -1; opts.check = 1; opts.alpha = sqrt(opts.eps*(2.0-opts.eps)); opts.gap = 1 - opts.eps; opts.minnp = -1; opts.alpha = sqrt(opts.eps*(2.0-opts.eps)); opts.gap = 1.0 - opts.eps; E_pop(); } void yams_printval() { if(verbosity<1) return; /* set default values for options */ printf("-- freeyams options value \n"); printf(" - hmin %f\n",opts.hmin); printf(" - hmax %f\n",opts.hmax); printf(" - kmin %f\n",opts.kmin); printf(" - kmax %f\n",opts.kmax); printf(" - eps %f\n",opts.eps); printf(" - iso %f\n",opts.iso); printf(" - alpha %f\n", opts.alpha ); printf(" - gap %f\n", opts.gap ); printf(" - degrad %f\n", opts.degrad); printf(" - ridge %f\n", opts.ridge); printf(" - geom %f\n", opts.geom); printf(" - shock %f\n",opts.shock); printf(" - bande %f\n", opts.bande ); printf(" - walton %f\n", opts.walton); printf(" - declic %f\n", opts.declic); printf(" - lambda %f\n",opts.lambda); printf(" - mu %f\n",opts.mu); printf(" - ctrl %d\n", opts.ctrl ); printf(" - iter %d\n", opts.iter ); printf(" - choix %d\n", opts.choix ); printf(" - minnp %d\n", opts.minnp ); printf(" - check %X\n", (unsigned char) opts.check); printf(" - ptmult %X\n", (unsigned char) opts.ptmult); printf(" - noreff %X\n", (unsigned char) opts.noreff); printf(" - ffem %X\n", (unsigned char) opts.ffem ); } int yams_main(pSurfMesh sm, int intopt[23], double fopt[14], int infondang, int infocc ) { hash=NULL; float declic; float ridge=RIDG; int option,absopt,ret,memory,corr; int choix; short phase; int k; /* trap exceptions */ signal(SIGABRT,yams_excfun); signal(SIGFPE,yams_excfun); signal(SIGILL,yams_excfun); signal(SIGSEGV,yams_excfun); signal(SIGTERM,yams_excfun); signal(SIGINT,yams_excfun); //atexit(yams_endcod); /* init time and calls */ tminit(ctim,TIMEMAX); chrono(ON,&ctim[0]); /* assign default values */ yerr.lerror = FALSE; yerr.coderr = 0; phase = 0; ret = TRUE; out = -1; memory = -1; imprim = -99; option = -99; choix = option; ddebug = FALSE; declic = 0.009; ecp = 0; // assigne option and surfacemesh /* setting defaults */ sm->infile = NULL; sm->outfile = NULL; sm->type = M_SMOOTH | M_QUERY | M_DETECT | M_BINARY | M_OUTPUT; yams_inival(); for (k=1; k<=sm->npfixe; k++) { pPoint ppt = &sm->point[k]; /* find extrema coordinates */ if ( ppt->c[0] < info.xmin ) info.xmin = ppt->c[0]; if ( ppt->c[0] > info.xmax ) info.xmax = ppt->c[0]; if ( ppt->c[1] < info.ymin ) info.ymin = ppt->c[1]; if ( ppt->c[1] > info.ymax ) info.ymax = ppt->c[1]; if ( ppt->c[2] < info.zmin ) info.zmin = ppt->c[2]; if ( ppt->c[2] > info.zmax ) info.zmax = ppt->c[2]; } // info nuln et nulp info.nuln = 0; for (k=1; k<=sm->nvfixe; k++) { pGeomSupp g0 = &sm->geom[ k ]; double dd = g0->vn[0]*g0->vn[0] + g0->vn[1]*g0->vn[1] + g0->vn[2]*g0->vn[2]; if ( dd < 0.0 ) info.nuln++; } info.nulp = 0; /* mark used vertices */ for (k=1; k<=sm->nefixe; k++) { pTriangle pt1 = &sm->tria[k]; int i; if ( pt1->v[0] ) for (i=0; i<3; i++) { pPoint ppt = &sm->point[pt1->v[i]]; ppt->tag &= ~M_UNUSED; } } /* count unused vertices */ for (k=1; k<=sm->npfixe; k++) { pPoint ppt; ppt = &sm->point[k]; if ( ppt->tag & M_UNUSED ) info.nulp++; } /* get decimation parameters */ opts.noreff = 0; opts.ffem = 1; opts.ptmult = 0; /* intopt : 0 !! anisotropie 1 !! ecp 2 !! extended out put file 3 !! FE correction 4 !! Formatted (ascii) output file 5 !! save metric file 6 !! msh2 7 !! Split multiple connected points 8 !! memory 9 !! connected component 10 !! vrml 11 !! imprim 12 !! nm : Create point on straight edge (no mapping) 13 !! nc : No validity check during smoothing (opt. 9) 14 !! np : Specify number of points desired 15 !! nit : Nb Iter 16 !! nq : Output quads 17 !! nr : No ridge detection 18 !! ns : No point smoothing 19 !! no : No output file 20 !! ref : Ignore face references // rajouter lors de l'ouverture du fichiers yams 21 !! absolute : opts.ctrl &= ~REL; 22 !! set optim option fopt : 0 !! iso 1 !! eps 2 // pas de valeur 3 !! opts.lambda 4 !! opts.mu 5 // pas de valeur 6 !! hgrad :: opts.shock 7 !! hmin :: opts.hmin 8 !! hmax :: opts.hmax // rajouter lors de l'ouverture du fichiers yams 9 !! tolerance :: opts.bande 10 !! degrad :: opts.degrad 11 !! declic :: opts.declic 12 !! walton :: opts.walton = cos(dummy/180.0*M_PI); 13 !! ridge :: opts.ridge */ if( intopt[0] == 1) opts.ctrl ^= ISO; opts.iso = fopt[0]; if( intopt[1] == 1 ) { ecp = 1; sm->type &= ~M_BINARY; } opts.eps = fopt[1]; if( intopt[2] == 1 ) sm->type |= M_EXTEND; if( intopt[3] == 1 ) opts.ffem = 0; if( intopt[4] == 1 ) sm->type &= ~M_BINARY; if( intopt[5] == 1 ) sm->type |= M_METRIC; if( intopt[6] == 1 ){ sm->type |= M_MSH2; sm->type &= ~M_BINARY; sm->type &= ~M_EXTEND; } if( intopt[7] == 1 ){ opts.ptmult = 1; } memory = intopt[8]; sm->connex = intopt[9]; // a initialiser -1 par dfault if( intopt[10] == 1 ){ sm->type |= M_VRML; sm->type &= ~M_BINARY; sm->type &= ~M_EXTEND; } imprim = intopt[11]; // parsar -n if( intopt[12] == 1 ) sm->type &= ~M_QUERY; if( intopt[13] == 1 ) opts.check = 0; opts.minnp = intopt[14]; opts.iter = intopt[15]; if(verbosity>9) printf(" type = %d %d \n", sm->type,intopt[17]); if( intopt[16] == 1 ) sm->type |= M_QUADS; if( intopt[17] == 1 ) sm->type &= ~M_DETECT; if( intopt[18] == 1 ) sm->type &= ~M_SMOOTH; //if( intopt[19] == 1 ) sm->type &= ~M_OUTPUT; if(verbosity>9) printf(" type = %d %d \n", sm->type,intopt[17]); sm->type &= ~M_OUTPUT; // parsar -r if( intopt[20] == 1 ) opts.noreff = 1; // parsar -l opts.lambda = fopt[3]; opts.mu = fopt[4]; // parsar -O option = intopt[22]; choix = intopt[22]; // parsar -h opts.shock = fopt[6]; opts.hmin = fopt[7]; opts.hmax = fopt[8]; // fin parsar opts.choix = option; // yams0 /* check option */ if ( (option) > 0 ) sm->type |= M_ENRICH; else memory = -1; /* if ( (abs(*choix) > 4) && !(sm->type & M_QUADS) ) sm->type &= ~M_SMOOTH; */ if ( !(opts.ctrl & ISO) && (abs(option) != 1) && (abs(option) != 6) ) opts.ctrl ^= ISO; if ( imprim ) fprintf(stdout," -- INPUT DATA\n"); chrono(ON,&ctim[5]); opts.bande = fopt[9]; opts.degrad = fopt[10]; if( intopt[21] == 1) opts.ctrl &= ~REL; // parsop check /* check parameters consistency */ ridge = fopt[13]; if ( (ridge < 0.0) || !(sm->type & M_DETECT) ) opts.ridge = -1.0; else opts.ridge = cos(ridge*M_PI / 180.0); opts.degrad = min(opts.degrad,1.0); opts.degrad = max(opts.degrad,0.001); /* bound values */ opts.alpha = sqrt(opts.eps * (2.-opts.eps)); opts.gap = 1.0 - opts.eps; if ( opts.walton < COS45DEG ) opts.walton = COS45DEG; // end assignement mesh and options //int bb = loadSol(sm,sm->infile); //sm->nmfixe = bb ? sm->npfixe : 0; absopt = abs(option); chrono(OFF,&ctim[5]); if ( imprim ) { fprintf(stdout," NUMBER OF GIVEN VERTICES %8d\n",sm->npfixe); fprintf(stdout," NUMBER OF GIVEN TRIANGLES %8d\n",sm->nefixe); fprintf(stdout," -- DATA READING COMPLETED. %.2f sec.\n", gttime(ctim[5])); if ( imprim < -4 ) priopt(choix); } if ( imprim ) yams_printval(); /* set adjacencies */ chrono(ON,&ctim[1]); chrono(ON,&ctim[2]); ret = tabvo2(sm,declic); chrono(OFF,&ctim[2]); if ( !ret ) { prierr(ERR,yerr.coderr); exit(1); } /* print surface quality */ if ( imprim ) { if ( opts.ctrl & ISO ) priqua(sm); else if ( sm->metric ) priqua_a(sm); primsg(0000); if ( abs(imprim) > 1 ) { yerr.inderr[0] = sm->npmax; yerr.inderr[1] = sm->nemax; primsg(0002); } } /* pre-processing stage */ yerr.inderr[0] = ++phase; out = 0; if ( abs(imprim) > 1 ) primsg(1000); chrono(ON,&ctim[2]); corr = sm->type & M_DETECT ? 1 : 0; if ( !setvoi(sm,corr) ) exit(1); if ( !ptmult(sm) ) exit(1); if ( absopt < 6 ) { declic = 0.038; declic = opts.ctrl & ISO ? 1e-6 : 1.e-8; if ( !sident(sm,corr) ) exit(1); if ( !delnul(sm,declic) ) exit(1); if ( !optedg(sm) ) exit(1); } if ( sm->type & M_DETECT && !sident(sm,1) ) exit(1); /* smoothing */ if ( absopt == 9 ) { if ( !noshrk(sm,opts.check) ) exit(1); //if ( !hilbert(sm) ) exit(1); //if ( !denois(sm) ) exit(1); } else { if ( opts.iter < 0 ) opts.iter = 5; if ( absopt < 5 ) { if ( !norpoi(sm,0,corr) ) exit(1); if ( !tgepoi(sm,0,corr) ) exit(1); } } chrono(OFF,&ctim[2]); yerr.inderr[0] = phase; yerr.cooerr[0] = gttime(ctim[2]); if ( abs(imprim) > 1 ) { primsg(1001); if ( imprim < -4 ) { bilan(sm); prigap(sm); } } if(verbosity>9) { printf("absopt= %d\n", absopt); printf("imprim= %d\n", imprim); printf("sm->np %d\n", sm->np); printf("sm->dim %d\n", sm->dim); } /* surface remeshing */ yerr.inderr[0] = ++phase; if ( absopt && absopt <= 6 ) { if ( abs(imprim) > 1 ) primsg(1000); chrono(ON,&ctim[4]); /* geometry enrichment */ if ( option > 0 ) { chrono(ON,&ctim[6]); if ( option == 4 ) ret = yams4(sm); else if ( option == 6 ) ret = yams6(sm); else ret = yams3(sm); chrono(OFF,&ctim[6]); if ( !ret ) exit(1); } /* surface simplification */ if ( absopt == 1 ) ret = yams1(sm); else if ( absopt == 2 ) { if ( opts.minnp < 0 ) ret = yams2(sm); else ret = yams22(sm); } else if ( absopt == 5 && sm->type & M_METRIC ) ret = calmet(sm); chrono(OFF,&ctim[4]); if ( !ret ) exit(1); yerr.inderr[0] = phase; yerr.cooerr[0] = gttime(ctim[4]); if ( abs(imprim) > 1 ) { primsg(1001); if ( imprim < -4 ) { if ( opts.ctrl & ISO ) priqua(sm); else priqua_a(sm); prilen(sm); } } } /* mesh optimization */ yerr.inderr[0] = ++phase; if ( absopt < 4 && absopt != 2 && yerr.coderr != 4000 ) { if ( abs(imprim) > 1 ) primsg(1000); chrono(ON,&ctim[3]); if ( sm->type & M_SMOOTH && yerr.coderr != 4000 ) { ret = optra4(sm,option); if ( !ret ) exit(1); } if ( absopt < 2 && opts.ffem && !optfem(sm) ) exit(1); chrono(OFF,&ctim[3]); yerr.inderr[0] = phase; yerr.cooerr[0] = gttime(ctim[3]); if ( abs(imprim) > 1 ) primsg(1001); } /* convert to quads (09-2003) */ if ( sm->type & M_QUADS ) { yerr.inderr[0] = ++phase; if ( abs(imprim) > 1 ) primsg(1000); chrono(ON,&ctim[4]); if ( !yamsq(sm) ) exit(1); yerr.inderr[0] = phase; yerr.cooerr[0] = gttime(ctim[4]); if ( abs(imprim) > 1 ) primsg(1001); } chrono(OFF,&ctim[1]); /* evaluation histograms */ if ( abs(imprim) > 1 && absopt < 10 ) { if ( sm->type & M_QUADS ) outqua_q(sm); else { if ( absopt == 1 ) prilen(sm); if ( opts.ctrl & ISO ) outqua(sm); else { outqua_a(sm); outqua1_a(sm); } if ( sm->connex && info.cc > 1 ) rchsub(sm); } } if ( abs(imprim) > 1 ) primsg(0001); /* write resulting mesh */ // pertinence freefem++ ??? J. Morice if ( sm->type & M_OUTPUT ) { chrono(ON,&ctim[5]); out = yams8(sm,sm->outfile,absopt); chrono(OFF,&ctim[5]); } else { if ( imprim ) priout(sm); out=1; } if ( imprim ) yams_printval(); /* print CPU requirements */ chrono(OFF,&ctim[0]); if ( imprim ) { if ( imprim < 0 ) primem(sm->npmax); pritim(sm,option); } if ( imprim ) yams_endcod(); M_free(hash); hash=NULL; /* check for mem leaks */ if ( imprim < 0 && M_memLeak() ) M_memDump(); #ifdef DISTRIB /* free token */ if ( !IsKeyCodeProtected(keycode) ) free_token(&token); #endif infondang = info.ndang; infocc = info.cc; return(0); } // add FH 03/14 ... void yams_free(pSurfMesh sm) { /* release allocated memory */ M_free(sm->point); M_free(sm->tria); M_free(sm->geom); M_free(sm->tgte); if ( sm->metric ) M_free(sm->metric); if ( sm->edge ) M_free(sm->edge); M_free(sm); } freefem++-3.61-1/download/yams/Makefile000644 000767 000024 00000006263 13256636774 020052 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- # $Id$ all-local: yams include ff-flags # Downloading and compiling yams # ------------------------------- # DIRPKG= ../pkg SRCDIR= ./freeyams$(yams_VERSION) #-$(yams_VERSION) PACKAGE=$(DIRPKG)/freeyams$(yams_VERSION).tgz SERVER=http://www.ann.jussieu.fr/~frey/ftp/archives/ INSTALL=../.. yams_VERSION=.2012.02.05 # ---------------------- # yamslib YAMS_DIR = $(abs_top_builddir)/download/yams/$(SRCDIR) YAMS_SRCDIRNOLIB = $(YAMS_DIR)/sources YAMS_SRCDIR = $(YAMS_DIR)/sourceslib YAMS_OBJDIR = $(YAMS_DIR)/objects yams: FAIRE # FFCS - make sure that PATCH is done sequentially otherwise its error messages are drowned into other meaningless # parallel compilation messages FAIRE: $(SRCDIR)/PATCH yamslib_internal.h yamslib.c yamslib.h ../Makefile $(MAKE) install WHERE touch FAIRE $(SRCDIR)/FAIT: $(SRCDIR)/PATCH yamslib_internal.h yamslib.c yamslib.h cp yamslib_internal.h yamslib.c yamslib.h $(YAMS_SRCDIR)/ cp makefile-yams.inc $(YAMS_DIR)/makefile cd $(YAMS_DIR); make touch $(SRCDIR)/FAIT install: $(SRCDIR)/FAIT sed s/defines.h/freeyams_defines.h/ <$(YAMS_SRCDIR)/yamslib.h >../include/freeyamslib.h cp $(YAMS_SRCDIR)/defines.h ../include/freeyams_defines.h -mkdir ../lib cp $(YAMS_OBJDIR)/libyams.a ../lib/libfreeyams.a # FFCS - WHERE is made to depend on FAIT otherwise it may be built in parallel and not be activated because FAIT is not # there yet WHERE: $(SRCDIR)/FAIT echo freeyams LD -L@DIR@/lib -lfreeyams >$(SRCDIR)/$(INSTALL)/lib/WHERE.freeyams ; echo freeyams INCLUDE -I@DIR@/include>> $(SRCDIR)/$(INSTALL)/lib/WHERE.freeyams ; $(SRCDIR)/PATCH: $(PACKAGE) -mkdir -p $(SRCDIR) cd $(SRCDIR); tar xvzf ../$(PACKAGE) -mkdir $(YAMS_SRCDIR) cp $(YAMS_SRCDIRNOLIB)/*.c $(YAMS_SRCDIRNOLIB)/*.h $(YAMS_SRCDIR) rm $(YAMS_SRCDIR)/memory.c cp $(YAMS_SRCDIRNOLIB)/compil.date $(YAMS_SRCDIR) cd $(YAMS_SRCDIR) && \ patch -p2 < ../../freeyams$(yams_VERSION).patch && \ patch -p2 < ../../freeyams$(yams_VERSION)-return-values.patch mv $(YAMS_SRCDIR)/yams.c $(YAMS_SRCDIR)/.. touch $(SRCDIR)/PATCH $(PACKAGE): ../getall -o freeYams -a # FFCS: only run make clean if cd to SRCDIR worked, otherwise this is infinite loop. clean-local: -rm FAIRE FAIT $(SRCDIR)/FAIT -cd $(YAMS_DIR) && $(MAKE) -C $(YAMS_DIR) clean -rm $(YAMS_OBJDIR)/libyams.a # FFCS -simplifying all paths clean: clean-local -rm ff-flags -rm $(SRCDIR)/$(INSTALL)/lib/libfreeyams.a -rm $(SRCDIR)/$(INSTALL)/include/*freeyams*.h -rm $(SRCDIR)/$(INSTALL)/lib/WHERE.freeyams -rm ../lib/libfreeyams.a -rm ../include/*freeyams*.h -rm ../lib/WHERE.freeyams -rm -rf $(YAMS_DIR) -rm -rf $(SRCDIR) #FH -rm $(PACKAGE) -rm FAIT FAIRE ff-flags: ../Makefile Makefile grep 'abs_top_builddir *=' ../Makefile > ff-flags grep 'CC *=' ../Makefile >> ff-flags grep 'CFLAGS *=' ../Makefile >> ff-flags grep 'LDFLAGS *=' ../Makefile >> ff-flags grep 'AR *=' ../Makefile >> ff-flags grep 'ARFLAGS *=' ../Makefile >> ff-flags grep 'RANLIB *=' ../Makefile >> ff-flags grep 'yams_VERSION *=' ./Makefile >> ff-flags grep 'WGET *=' ../Makefile >> ff-flags grep 'LIBS *=' ../Makefile >> ff-flags .PHONY: $(SRCDIR)/$(INSTALL) freefem++-3.61-1/download/yams/freeyams.2012.02.05.patch000644 000767 000024 00000031273 13256636774 022273 0ustar00hechtstaff000000 000000 diff -ru freeyams.2011.09.23/sourceslib/blinde.c freeyams.2011.09.23-orig/sourceslib/blinde.c --- freeyams.2011.09.23/sourceslib/blinde.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/blinde.c 2011-11-16 09:59:50.000000000 +0100 @@ -36,7 +36,7 @@ ida = id[0]*10 + id[1]; /*printf("date = %d %d %d\n",iy,im,ida); */ if ( YMD(iy,im,ida) > YMD(MAX_YEAR,MAX_MONTH,MAX_DAY) ) { - fprintf(stdout," -- YAMS (LJLL), Version %s (%s)\n",VERSION,RELEASE); + fprintf(stdout," -- YAMS (LJLL), Version %s (%s)\n",YAMS_VERSION,RELEASE); fprintf(stdout," Copyright (C) LJLL, 1999-2006.\n\n"); fprintf(stdout," ## Expiration date reached. Sorry.\n"); fprintf(stdout," Please contact the author.\n"); diff -ru freeyams.2011.09.23/sourceslib/defines.h freeyams.2011.09.23-orig/sourceslib/defines.h --- freeyams.2011.09.23/sourceslib/defines.h 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/defines.h 2011-11-16 09:59:50.000000000 +0100 @@ -18,7 +18,7 @@ /* current version */ #define DEFAULT_FILE "DEFAULT.yams" #define RELEASE "oct, 2006" -#define VERSION "2.4 b" +#define YAMS_VERSION "2.4 b" #define COPYRIGHT "Copyright (C) LJLL, 1999-2006" #define REL 1 diff -ru freeyams.2011.09.23/sourceslib/extern.h freeyams.2011.09.23-orig/sourceslib/extern.h --- freeyams.2011.09.23/sourceslib/extern.h 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/extern.h 2011-11-16 09:59:50.000000000 +0100 @@ -4,6 +4,7 @@ #ifndef __YAMS +#ifndef __YAMSLIB extern Error yerr; extern Info info; extern Options opts; @@ -14,7 +15,7 @@ extern short imprim; extern ubyte ddebug; #endif - +#endif #ifdef __cplusplus } diff -ru freeyams.2011.09.23/sourceslib/inout.c freeyams.2011.09.23-orig/sourceslib/inout.c --- freeyams.2011.09.23/sourceslib/inout.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/inout.c 2011-11-16 09:59:50.000000000 +0100 @@ -581,7 +581,7 @@ ppt->tag |= M_UNUSED; ppt->flag = ppt->color = 0; } - + printf("sm->connex %d\n",sm->connex); if ( sm->connex > 0 ) { for (k=1; k<=sm->ne; k++) { pt1 = &sm->tria[k]; @@ -679,8 +679,8 @@ natv++; if ( ppt->tag & M_CORNER ) tatv++; } - if ( !gs->new ) gs->new = ++nn; - if ( !gt->new ) gt->new = ++nt; + if ( !gs->newnum ) gs->newnum = ++nn; + if ( !gt->newnum ) gt->newnum = ++nt; if ( !pt1->edg[i] && pt1->tag[i] == M_NOTAG ) continue; else if ( pt1->adj[i] && (k > pt1->adj[i]) ) continue; nedge++; @@ -864,12 +864,12 @@ nn = nbl = 0; for (k=1; k<=sm->nvmax; k++) { gs = &sm->geom[k]; - if ( gs->new > 0 ) { + if ( gs->newnum > 0 ) { iadr = nbl * 3; tabf[iadr+0] = gs->vn[0]; tabf[iadr+1] = gs->vn[1]; tabf[iadr+2] = gs->vn[2]; - gs->new = ++nn; + gs->newnum = ++nn; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_Normals, nbl, tabf); @@ -890,7 +890,7 @@ iadr = nbl * 2; gs = &sm->geom[pt1->vn[i]]; tabi[iadr+0] = ppt->tmp; - tabi[iadr+1] = gs->new; + tabi[iadr+1] = gs->newnum; ppt->flag = 1; ++nbl; if ( nbl == NMAX ) { @@ -916,7 +916,7 @@ iadr = nbl * 3; tabi[iadr+0] = nn; tabi[iadr+1] = i+1; - tabi[iadr+2] = gs->new; + tabi[iadr+2] = gs->newnum; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_NormalAtTriangleVertices, nbl, tabi); @@ -931,12 +931,12 @@ nt = nbl = 0; for (k=1; k<=sm->ntmax; k++) { gt = &sm->tgte[k]; - if ( gt->new > 0 ) { + if ( gt->newnum > 0 ) { iadr = nbl * 3; tabf[iadr+0] = gt->t[0]; tabf[iadr+1] = gt->t[1]; tabf[iadr+2] = gt->t[2]; - gt->new = ++nt; + gt->newnum = ++nt; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_Tangents, nbl, tabf); @@ -956,7 +956,7 @@ iadr = nbl * 2; gt = &sm->tgte[ppt->tge]; tabi[iadr+0] = ppt->tmp; - tabi[iadr+1] = gt->new; + tabi[iadr+1] = gt->newnum; ppt->flag = 1; ++nbl; if ( nbl == NMAX ) { @@ -1105,8 +1105,8 @@ natv++; if ( ppt->tag & M_CORNER ) tatv++; } - if ( !gs->new ) gs->new = ++nn; - if ( !gt->new ) gt->new = ++nq; + if ( !gs->newnum ) gs->newnum = ++nn; + if ( !gt->newnum ) gt->newnum = ++nq; if ( !pq1->edg[i] && pq1->tag[i] == M_NOTAG ) continue; else if ( pq1->adj[i] && (k > pq1->adj[i]) ) continue; nedge++; @@ -1263,12 +1263,12 @@ nn = nbl = 0; for (k=1; k<=sm->nvmax; k++) { gs = &sm->geom[k]; - if ( gs->new > 0 ) { + if ( gs->newnum > 0 ) { iadr = nbl * 3; tabf[iadr+0] = gs->vn[0]; tabf[iadr+1] = gs->vn[1]; tabf[iadr+2] = gs->vn[2]; - gs->new = ++nn; + gs->newnum = ++nn; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_Normals, nbl, tabf); @@ -1289,7 +1289,7 @@ iadr = nbl * 2; gs = &sm->geom[pq1->vn[i]]; tabi[iadr+0] = ppt->tmp; - tabi[iadr+1] = gs->new; + tabi[iadr+1] = gs->newnum; ppt->flag = 1; ++nbl; if ( nbl == NMAX ) { @@ -1315,7 +1315,7 @@ iadr = nbl * 3; tabi[iadr+0] = nn; tabi[iadr+1] = i+1; - tabi[iadr+2] = gs->new; + tabi[iadr+2] = gs->newnum; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_NormalAtQuadrilateralVertices, nbl, tabi); @@ -1330,12 +1330,12 @@ nq = nbl = 0; for (k=1; k<=sm->ntmax; k++) { gt = &sm->tgte[k]; - if ( gt->new > 0 ) { + if ( gt->newnum > 0 ) { iadr = nbl * 3; tabf[iadr+0] = gt->t[0]; tabf[iadr+1] = gt->t[1]; tabf[iadr+2] = gt->t[2]; - gt->new = ++nq; + gt->newnum = ++nq; ++nbl; if ( nbl == NMAX ) { LM_write_field(&ms, LM_Tangents, nbl, tabf); @@ -1355,7 +1355,7 @@ iadr = nbl * 2; gt = &sm->tgte[ppt->tge]; tabi[iadr+0] = ppt->tmp; - tabi[iadr+1] = gt->new; + tabi[iadr+1] = gt->newnum; ppt->flag = 1; ++nbl; if ( nbl == NMAX ) { @@ -1524,8 +1524,8 @@ /* adjust sizes */ if ( opts.hmin < 0.0 ) opts.hmin = max(opts.hmin,hmin); - if ( opts.hmax < 0.0 ) - opts.hmax = max(opts.hmax,hmax); + if ( opts.hmax < 0.0 ) + opts.hmax = max(opts.hmax,hmax); E_pop(); return(1); Only in freeyams.2011.09.23-orig/sourceslib: inout.c.orig diff -ru freeyams.2011.09.23/sourceslib/parsop.c freeyams.2011.09.23-orig/sourceslib/parsop.c --- freeyams.2011.09.23/sourceslib/parsop.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/parsop.c 2011-11-16 09:59:50.000000000 +0100 @@ -16,7 +16,7 @@ } /* create standard parameter file */ - fprintf(out,"# Generated by YAMS %s\n",VERSION); + fprintf(out,"# Generated by YAMS %s\n",YAMS_VERSION); fprintf(out,"# Uncomment next if absolute unit desired\n"); fprintf(out,"#Absolute\n"); Only in freeyams.2011.09.23-orig/sourceslib: parsop.c.orig diff -ru freeyams.2011.09.23/sourceslib/primsg.c freeyams.2011.09.23-orig/sourceslib/primsg.c --- freeyams.2011.09.23/sourceslib/primsg.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/primsg.c 2011-11-16 09:59:50.000000000 +0100 @@ -18,10 +18,10 @@ case 0000: if ( opts.ctrl & ISO ) fprintf(stdout,"\n %s\n MODULE YAMS-LJLL : %s\n %s\n", - STR,VERSION,STR); + STR,YAMS_VERSION,STR); else fprintf(stdout,"\n %s\n MODULE YAMS-LJLL (ANISO) : %s\n %s\n", - STR,VERSION,STR); + STR,YAMS_VERSION,STR); return; case 0001: fprintf(stdout,"\n %s\n END OF MODULE YAMS\n %s\n\n",STR,STR); diff -ru freeyams.2011.09.23/sourceslib/surf.h freeyams.2011.09.23-orig/sourceslib/surf.h --- freeyams.2011.09.23/sourceslib/surf.h 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/surf.h 2011-11-16 09:59:50.000000000 +0100 @@ -64,13 +64,13 @@ typedef struct geomsupp { float vn[3]; /* array of vertex normals */ float gap; /* local gap value */ - int new; /* pointer to new number */ + int newnum; /* pointer to new number */ } GeomSupp; typedef GeomSupp * pGeomSupp; typedef struct geomtge { float t[3]; - int new; + int newnum; } Geomtge; typedef Geomtge * pGeomtge; diff -ru freeyams.2011.09.23/sourceslib/yams.c freeyams.2011.09.23-orig/sourceslib/yams.c --- freeyams.2011.09.23/sourceslib/yams.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/yams.c 2011-11-16 09:59:50.000000000 +0100 @@ -24,6 +24,7 @@ ubyte ddebug; ubyte ecp; +long verbosity; static void excfun(int sigid) { fprintf(stdout,"\n Unexpected error:"); fflush(stdout); Only in freeyams.2011.09.23-orig/sourceslib: yams.c.orig diff -ru freeyams.2011.09.23/sourceslib/yams.h freeyams.2011.09.23-orig/sourceslib/yams.h --- freeyams.2011.09.23/sourceslib/yams.h 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/yams.h 2011-11-16 09:59:50.000000000 +0100 @@ -6,12 +6,17 @@ #include #include "chrono.h" -#include "edge.h" -#include "error.h" -#include "hash.h" -#include "stack.h" -#include "info.h" #include "memory.h" -#include "option.h" -#include "surf.h" + +//#include "edge.h" +//#include "error.h" +//#include "hash.h" +//#include "stack.h" +//#include "info.h" +//#include "memory.h" +//#include "option.h" +//#include "surf.h" + +#include "yamslib.h" +#include "yamslib_internal.h" #include "global.h" diff -ru freeyams.2011.09.23/sourceslib/yams0.c freeyams.2011.09.23-orig/sourceslib/yams0.c --- freeyams.2011.09.23/sourceslib/yams0.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/yams0.c 2011-11-16 09:59:50.000000000 +0100 @@ -24,7 +24,7 @@ if ( imprim ) { if ( ecp ) fprintf(stdout," ## Version: Ecole Centrale de Paris ##\n\n"); - fprintf(stdout," -- YAMS (LJLL) Version %s (%s)\n",VERSION,RELEASE); + fprintf(stdout," -- YAMS (LJLL) Version %s (%s)\n",YAMS_VERSION,RELEASE); fprintf(stdout," %s.\n",COPYRIGHT); fprintf(stdout," compiled: %s.\n\n",COMPIL); } diff -ru freeyams.2011.09.23/sourceslib/zaldy1.c freeyams.2011.09.23-orig/sourceslib/zaldy1.c --- freeyams.2011.09.23/sourceslib/zaldy1.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/zaldy1.c 2011-11-16 09:59:50.000000000 +0100 @@ -45,13 +45,20 @@ } } else { + int bytes = sizeof(Point) \ + + sizeof(Metric) \ + + 2 * sizeof(Triangle) \ + + 1.5 * sizeof(GeomSupp) \ + + 0.2 * sizeof(Geomtge) \ + + 3.7 * sizeof(Hashtable); + /* int bytes = sizeof(struct spoint) \ + sizeof(struct metric) \ + 2 * sizeof(struct striangle) \ + 1.5 * sizeof(struct geomsupp) \ + 0.2 * sizeof(struct geomtge) \ + 3.7 * sizeof(struct shashtab); - + */ sm->npmax = (int)((double)memory / bytes * million); sm->npmax = max(sm->npmax,npmax); sm->nemax = max(2 * sm->npmax,nemax); diff -ru freeyams.2011.09.23/sourceslib/zaldy3.c freeyams.2011.09.23-orig/sourceslib/zaldy3.c --- freeyams.2011.09.23/sourceslib/zaldy3.c 2011-11-16 11:06:08.000000000 +0100 +++ freeyams.2011.09.23-orig/sourceslib/zaldy3.c 2011-11-16 09:59:50.000000000 +0100 @@ -34,7 +34,7 @@ for (j=sm->nvmax; jgeom[j].vn[0] = sm->geom[j].vn[1] = sm->geom[j].vn[2] = 0.; sm->geom[j].gap = 1.; - sm->geom[j].new = 0; + sm->geom[j].newnum = 0; } sm->nvmax = nvsize; yerr.inderr[0] = sm->nvmax; diff -u freeyams.2012.02.05/sourceslib/outqua_a.c freeyams.2011.09.23-orig/sourceslib/outqua_a.c --- freeyams.2012.02.05/sourceslib/outqua_a.c 2009-05-13 21:00:03.000000000 +0200 +++ freeyams.2011.09.23-orig/sourceslib/outqua_a.c 2012-09-04 08:51:04.000000000 +0200 @@ -219,7 +219,7 @@ pt = &mesh->tria[iel]; fprintf(stdout," WORST ELEMENT %d (%d) %d %d %d\n",iel,ielr,pt->v[0],pt->v[1],pt->v[2]); - if ( abs(imprim) < 5 ) return; + if ( abs(imprim) < 5 ) return (1) ; fprintf(stdout,"\n HISTOGRAMM\n"); imax = min(9,(int)(10.*rapmax)); --- freeyams.2012.02.05/sourceslib/eigenv.c 2016-01-28 11:47:05.000000000 +0100 +++ freeyams.2012.02.05-orig/sources/eigenv.c 2012-02-04 12:58:11.000000000 +0100 @@ -3,7 +3,7 @@ #include /* seeking 1.e-05 accuracy */ +#define EPSD 1.e-12 -#define EPSD 1.e-15 #define EPSD2 1.e-200 #define EPS6 5.e-06 #define EPS 1.e-06 freefem++-3.61-1/download/yams/makefile-yams.inc000644 000767 000024 00000002521 13256636774 021622 0ustar00hechtstaff000000 000000 include ../ff-flags # working dirs YAMS2DIR =$(abs_top_builddir)/download/yams/freeyams$(yams_VERSION) EXEDIR = $(abs_top_builddir)/download/bin SRCDIR = $(YAMS2DIR)/sourceslib OBJDIR = $(YAMS2DIR)/objects ARCDIR = $(YAMS2DIR)/archives DIRDIR = $(EXEDIR) $(OBJDIR) $(ARCDIR) INCDIR = -I$(YAMS2DIR)/sourcesnew -I$(abs_top_builddir)/src/libMesh/ LDLDIR = -L$(abs_top_builddir)/download/lib -lMesh VPATH = $(SRCDIR) # objects list src = $(wildcard $(SRCDIR)/*.c) header = $(wildcard $(SRCDIR)/*.h) objs = $(patsubst $(SRCDIR)%,$(OBJDIR)%,$(src:.c=.o)) prog = yams2 lib = $(OBJDIR)/libyams.a #.SILENT: $(OBJDIR)/%.o: $(SRCDIR)/%.c $(CC) $(OPT64) $(INCDIR) $(CFLAGS) -c $< -o $@ $(EXEDIR)/$(prog):$(DIRDIR) $(objs) echo "#define COMPIL " '"' `date` '"' > $(SRCDIR)/compil.date $(CC) -c $(CFLAGS) $(INCDIR) $(SRCDIR)/yams0.c -o $(OBJDIR)/yams0.o -I../../../src/libMesh/ $(CC) -c $(CFLAGS) $(INCDIR) $(SRCDIR)/../yams.c -I$(SRCDIR) -o $(OBJDIR)/yams.o -I../../../src/libMesh/ $(AR) $(ARFLAGS) $(lib) $(objs) $(CC) $(LDFLAGS) $(OPT64) $(LDLDIR) $(OBJDIR)/yams.o -o $@ $(lib) -lm -L../../../src/libMesh/ -lMesh $(LIBS) $(RANLIB) $(lib) $(objs):$(header) $(DIRDIR): @[ -d $@ ] || mkdir $@ clean: -rm $(objs) $(EXEDIR)/$(prog) tar:$(DIRDIR) tar czf $(ARCDIR)/$(prog).`date +"%Y.%m.%d"`.tgz sources makefile target: $(EXEDIR)/$(prog)freefem++-3.61-1/download/yams/freeyams.2012.02.05-return-values.patch000644 000767 000024 00000000346 13256636774 025102 0ustar00hechtstaff000000 000000 --- freeyams.2012.02.05/sourceslib/debug.c.orig 2013-01-27 14:24:38.489115910 +0000 +++ freeyams.2012.02.05/sourceslib/debug.c 2013-01-27 14:25:24.156118592 +0000 @@ -178,7 +178,7 @@ } } } - + return 0; } freefem++-3.61-1/download/yams/yamslib.h000644 000767 000024 00000012741 13256636774 020221 0ustar00hechtstaff000000 000000 #ifdef __cplusplus extern "C" { #endif /* Edge: Structure used to store specified mesh edges */ typedef struct yams_sedge { int p1,p2; int ref; int tag; } yams_Edge; typedef yams_Edge * yams_pEdge; #ifndef ERR #define ERR 1 #define WAR 2 #define MSG 3 #endif typedef struct yams_error { double cooerr[6]; int inderr[6]; int lerror; int coderr; } yams_Error; #include "defines.h" /* HashTable: hash table structure for mesh edges */ typedef struct yams_shashtab { int min; /* min(a,b) */ int nxt; /* next edge */ int elt; int ind; } yams_Hashtable; typedef yams_Hashtable * yams_pHashtable; typedef struct yams_sstack { int *t; int in,out,cur; } yams_Stack; typedef yams_Stack * yams_pStack; typedef struct yams_sinfo { double xmin,ymin,zmin,xmax,ymax,zmax; /* bounding box */ double delta; double dmin,dmax; /* edge lengths */ float qworst; int meshtype,cc,flip; long nulp,nulf,nuln; /* not used */ int qpire; int nedg,nrid,ncoi,nreq,nvus; int nafixe,nvrequis,ndang; int manifold; } yams_Info; typedef struct yams_soptions { float hmin,hmax; /* desired sizes */ float kmin,kmax; /* curvature min,max*/ float eps,iso; /* max. tolerance, isovalue */ float alpha,gap; /* max values allow.*/ float degrad; /* max degrad. qual */ float ridge; /* cosine ridge ang */ float geom; float shock; /* mesh gradation */ float bande; /* bandwidth */ float walton; /* angle limitation */ float declic; float lambda,mu; /* for smoothing */ int ctrl; /* absolute values */ int minnp; short iter,choix; unsigned char ptmult,noreff,ffem,check; } yams_Options; #ifndef ubyte typedef unsigned char ubyte; #endif /* Point: Structure that defines a vertex in a mesh. */ typedef struct yams_spoint { float c[3]; /* coordinates */ float size; /* calculated size */ int tge; /* tangent at ridge */ short color; int ref; int tmp; ubyte tag; /* vertex type */ ubyte geom; ubyte flag; } yams_Point; typedef yams_Point * yams_pPoint; /* Triangle: Structure that defines a triangle in a mesh. */ typedef struct yams_striangle { float n[3]; /* face normal */ float dish; /* distance to surface */ float qual; /* triangle quality */ int v[3]; /* array of vertex indices */ int adj[3]; /* array of adjacent trias */ int vn[3]; /* array of vertex normals */ int edg[3]; int nxt; int ref; short cc; ubyte voy[3]; /* array of voyeur vertices */ ubyte flag1; ubyte tag[3]; /* array of edge classes */ ubyte flag2; } yams_Triangle; typedef yams_Triangle * yams_pTriangle; typedef struct yams_squad { float qual; float n[3]; int v[4]; int adj[4]; int ref,edg[4],vn[4]; short cc; ubyte flag1,flag2; ubyte voy[4]; ubyte tag[4]; } yams_Quad; typedef yams_Quad * yams_pQuad; typedef struct { int v[4]; int ref; } yams_Tetra; typedef yams_Tetra * yams_pTetra; typedef struct yams_geomsupp { float vn[3]; /* array of vertex normals */ float gap; /* local gap value */ int newnum; /* pointer to new number */ } yams_GeomSupp; typedef yams_GeomSupp * yams_pGeomSupp; typedef struct yams_geomtge { float t[3]; int newnum; } yams_Geomtge; typedef yams_Geomtge * yams_pGeomtge; typedef struct yams_metric { float k1,k2; float m[6]; /* anisotropic metric */ } yams_Metric; typedef yams_Metric * yams_pMetric; /* SurfMesh: Structure that defines a mesh. */ typedef struct yams_smesh { int dim; /* mesh dimension (2,3) */ int type; int connex; /* # connected component */ int np,npfixe,npmax; /* number of vertices */ int ne,nefixe,nemax; /* number of triangles */ int nq,ntet; /* quads, ntets */ int nv,nvfixe,nvmax; /* number of vertex normals */ int nafixe,nmfixe; int nt,ntfixe,ntmax; /* vertex tgtes */ int mark; /* coloring... */ int ipil; char *infile; char *outfile; yams_pPoint point; /* array of vertices */ yams_pTriangle tria; /* array of triangles */ yams_pTetra tetra; yams_pQuad quad; yams_pGeomSupp geom; /* pointer to geometric info */ yams_pGeomtge tgte; /* pointer to tge at ridge */ yams_pMetric metric; /* local metric at vertex */ yams_pEdge edge; } yams_SurfMesh; typedef yams_SurfMesh * yams_pSurfMesh; #ifdef __cplusplus namespace yams{ #endif int yams_main(yams_pSurfMesh sm, int intopt[23], double fopt[14], int infondang, int infocc ); int zaldy1(int nemax,int npmax,int nvmax,int memory,yams_pSurfMesh sm,int choix); int zaldy2(int npmax); int zaldy3(yams_pSurfMesh ,int code); void yams_free(yams_pSurfMesh sm); // Add FH 03/14 #ifdef __cplusplus } #endif #ifdef __cplusplus } #endif freefem++-3.61-1/download/yams/yamslib_internal.h000644 000767 000024 00000002266 13256636774 022116 0ustar00hechtstaff000000 000000 /* typedef struct yams_sedge sedge; typedef struct yams_error error; typedef struct yams_shashtable shashtable; typedef struct yams_sstack sstack; typedef struct yams_sinfo sinfo; typedef struct yams_soptions soptions; typedef struct yams_spoint spoint; typedef struct yams_striangle striangle; typedef struct yams_squad squad; typedef struct yams_geomtge geomtge; typedef struct yams_geomsupp geomsupp; typedef struct yams_metric metric; typedef struct yams_smesh smesh; */ typedef yams_Edge Edge; typedef yams_Error Error; typedef yams_Hashtable Hashtable; typedef yams_Stack Stack; typedef yams_Info Info; typedef yams_Options Options; typedef yams_Point Point; typedef yams_Triangle Triangle; typedef yams_Quad Quad; typedef yams_Tetra Tetra; typedef yams_Geomtge Geomtge; typedef yams_GeomSupp GeomSupp; typedef yams_Metric Metric; typedef yams_SurfMesh SurfMesh; typedef yams_pEdge pEdge; typedef yams_pHashtable pHashtable; typedef yams_pStack pStack; typedef yams_pPoint pPoint; typedef yams_pTriangle pTriangle; typedef yams_pQuad pQuad; typedef yams_pTetra pTetra; typedef yams_pGeomtge pGeomtge; typedef yams_pGeomSupp pGeomSupp; typedef yams_pMetric pMetric; typedef yams_pSurfMesh pSurfMesh; freefem++-3.61-1/download/arpack/Makefile.am000644 000767 000024 00000010631 13312446271 020710 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=04/06/04 upmc brief="Makefile for downloaded ARPACK" all-local:$(DOWNLOAD_ARPACK) EXTRA_DIST=ARmake.m4 arpack-patch-lapack.tar.gz veclib_zdotc.f veclib_cdotc.f PKGCOMMON_PACKTITLE=ARPACK include ../common.mak # nothing specific to do for [[file:../common.mak::reinstall]] reinstall::install # Downloading and compiling ARPACK # -------------------------------- # set in configure #ARPACKLIB=ARPACK/libarpack_ff++.a DIRPKG=../pkg ARPACK96_TAR_GZ=$(DIRPKG)/arpack96.tar.gz PATCH_TAR_GZ=$(DIRPKG)/patch.tar.gz PKGCOMMON_PACKAGES=$(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ) # FFCS: need to add $(RANLIB) under mingw64 to avoid "archive has no index" error compilepkg::$(ARPACKLIB) ARPACK/ARmake.inc:ARPACK/ARmake.incnew if diff -q ARPACK/ARmake.incnew ARPACK/ARmake.inc ; then echo No Modif skip compile of arpack ; else cp ARPACK/ARmake.incnew ARPACK/ARmake.inc; fi $(ARPACKLIB):ARPACK/ARmake.inc case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_zdotc.f -o ARPACK/SRC/veclib_zdotc.o ;; esac; case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_cdotc.f -o ARPACK/SRC/veclib_cdotc.o ;; esac; mkdir -p ../include ../lib if [ -n '@FF_LAPACKdir@' ] ; then \ $(F77) -c `echo $(FFLAGS)\ |sed -e s/-O.\*\ // ` ARPACK/LAPACK/dlamch.f -o ARPACK/LAPACK/dlamch.o; \ fi; \ cd ARPACK && $(MAKE) lib if test -n '@FF_LAPACKdir@' ; then \ $(AR) $(ARFLAGS) $(LAPACK_arpack_LIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ARPACK/LAPACK/*.o ;\ $(RANLIB) $(LAPACK_arpack_LIB) ;\ else \ $(AR) $(ARFLAGS) $(ARPACKLIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ;\ fi ARPACK/ARmake.incnew: $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ) ARmake.m4 Makefile -rm -rf ARPACK gunzip -c $(ARPACK96_TAR_GZ) | tar xf - gunzip -c $(PATCH_TAR_GZ) | tar xf - gunzip -c arpack-patch-lapack.tar.gz | tar xf - case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) \ for i in ARPACK/LAPACK/zlatrs.f ARPACK/LAPACK/ztrsyl.f ARPACK/SRC/zgetv0.f ARPACK/SRC/znaitr.f ARPACK/SRC/znaup2.f ARPACK/SRC/zneupd.f;\ do mv $$i $$i.cpy; sed -e 's/ZDOTC/ZZDOTC/' -e 's/zdotc/zzdotc/' <$$i.cpy >$$i;rm $$i.cpy; \ done; \ for i in ARPACK/LAPACK/clatrs.f ARPACK/LAPACK/ctrsyl.f ARPACK/SRC/cgetv0.f ARPACK/SRC/cnaitr.f ARPACK/SRC/cnaup2.f ARPACK/SRC/cneupd.f;\ do mv $$i $$i.cpy; sed -e 's/CDOTC/CCDOTC/' -e 's/cdotc/ccdotc/' <$$i.cpy >$$i;rm $$i.cpy; \ done; \ esac for i in ARPACK/SRC/*.f ; do \ mv $$i $$i.cpy; sed -e 's/, second/, secnd2/' -e 's/call *second/call secnd2/' <$$i.cpy >$$i;rm $$i.cpy; done for i in ARPACK/UTIL/second.f; do \ mv $$i $$i.cpy; cat $$i.cpy| sed 's/ SECOND *(/ secnd2(/'|grep -v EXTERNAL >$$i;rm $$i.cpy; done m4 -DFF_BLASLIB="$(BLASLIB)" \ -DFF_ARPACKLIB="$(ARPACKLIB)" \ -DFF_LAPACK_arpack_LIB="$(LAPACK_arpack_LIB)" \ -DFF_FC="@F77@" \ -DFF_FFLAGS="@FFLAGS@" \ -DFF_LAPACKdir='@FF_LAPACKdir@' \ -DFF_LDFLAGS="@LDFLAGS@" \ -DFF_HOME=`pwd`/ARPACK \ -DFF_SECOND="@FF_SECOND@" \ -DFF_AR="@AR@" \ -DFF_ARFLAGS="@ARFLAGS@" \ -DFF_RANLIB="@RANLIB@" \ ARmake.m4 >ARPACK/ARmake.incnew $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ):download # ../getall -o ARPACK -a clean-local:: -rm -r ARPACK ../lib/libarpack.a # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/arpack/veclib_cdotc.f000644 000767 000024 00000001610 13256636774 021460 0ustar00hechtstaff000000 000000 complex function ccdotc(n,zx,incx,zy,incy) c c forms the dot product of a vector. c jack dongarra, 3/11/78. c modified 12/3/93, array(1) declarations changed to array(*) c complex zx(*),zy(*),ztemp integer i,incx,incy,ix,iy,n ztemp = (0.0d0,0.0d0) ccdotc = (0.0d0,0.0d0) if(n.le.0)return if(incx.eq.1.and.incy.eq.1)go to 20 c c code for unequal increments or equal increments c not equal to 1 c ix = 1 iy = 1 if(incx.lt.0)ix = (-n+1)*incx + 1 if(incy.lt.0)iy = (-n+1)*incy + 1 do 10 i = 1,n ztemp = ztemp + cconjg(zx(ix))*zy(iy) ix = ix + incx iy = iy + incy 10 continue ccdotc = ztemp return c c code for both increments equal to 1 c 20 do 30 i = 1,n ztemp = ztemp + sconjg(zx(i))*zy(i) 30 continue ccdotc = ztemp return end freefem++-3.61-1/download/arpack/veclib_zdotc.f000644 000767 000024 00000001626 13256636774 021516 0ustar00hechtstaff000000 000000 double complex function zzdotc(n,zx,incx,zy,incy) c c forms the dot product of a vector. c jack dongarra, 3/11/78. c modified 12/3/93, array(1) declarations changed to array(*) c double complex zx(*),zy(*),ztemp integer i,incx,incy,ix,iy,n ztemp = (0.0d0,0.0d0) zzdotc = (0.0d0,0.0d0) if(n.le.0)return if(incx.eq.1.and.incy.eq.1)go to 20 c c code for unequal increments or equal increments c not equal to 1 c ix = 1 iy = 1 if(incx.lt.0)ix = (-n+1)*incx + 1 if(incy.lt.0)iy = (-n+1)*incy + 1 do 10 i = 1,n ztemp = ztemp + dconjg(zx(ix))*zy(iy) ix = ix + incx iy = iy + incy 10 continue zzdotc = ztemp return c c code for both increments equal to 1 c 20 do 30 i = 1,n ztemp = ztemp + dconjg(zx(i))*zy(i) 30 continue zzdotc = ztemp return end freefem++-3.61-1/download/arpack/arpack-patch-lapack.tar.gz000644 000767 000024 00000002204 13256636774 023607 0ustar00hechtstaff000000 000000 k@Earpack-patch-lapack.tarV]s8_q!k\HNֳPLU`3M^iu%]{t9j:b?8:'aض;a(=ʟۚL:Y08nZdRA9@mőy$cZ8Z;3Ko/ӵ7;wKgY `0B7@0 )d"0I CL9q_tHgqҔ1݌F]=iMo`!]+fIi,SL N <*pGn4qpr~x*){la,C.΃u [@f;u,8k!O~3ɔsO9dN{`˴UɯEM38 <{'Bˌ Fr}LfjimjV/2ѯP[dmû Y_U+C,K_ 7y0nxqjuv.*wz@e4 g7h1`>8NP֣g3NEs:; l~_` QBvX'I@c(j)d,(+zq0gQ(ፖz lϰϐZvs(N7xv~vL?Ēh_; (DAF4S-'η@o!_k|/OWPPPPPPPPPPPPPP 74Z(freefem++-3.61-1/download/arpack/Makefile.in000644 000767 000024 00000056304 13321623166 020730 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=04/06/04 upmc brief="Makefile for downloaded ARPACK" # Common make rules for all downloaded packages (request from FH) # ====================================================================== # Written by Antoine Le Hyaric # http://www.ljll.math.upmc.fr/lehyaric # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Common make rules for all downloaded packages (request from FH)" default=0 freefem make start=06/11/2013 upmc written # Common goals for all packages: # download compile install reinstall clean veryclean # <> VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = download/arpack ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/../common.mak $(srcdir)/Makefile.in \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ARmake.m4 arpack-patch-lapack.tar.gz veclib_zdotc.f veclib_cdotc.f PKGCOMMON_PACKTITLE = ARPACK # Downloading and compiling ARPACK # -------------------------------- # set in configure #ARPACKLIB=ARPACK/libarpack_ff++.a DIRPKG = ../pkg ARPACK96_TAR_GZ = $(DIRPKG)/arpack96.tar.gz PATCH_TAR_GZ = $(DIRPKG)/patch.tar.gz PKGCOMMON_PACKAGES = $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../common.mak $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu download/arpack/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu download/arpack/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; $(srcdir)/../common.mak $(am__empty): $(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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ 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 pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile all-local:$(DOWNLOAD_ARPACK) # PKGCOMMON_PACKTITLE corresponds to package names in [[file:getall]] download:: ../getall -o $(PKGCOMMON_PACKTITLE) -a $(PKGCOMMON_PACKAGES):download compilepkg:: # <> install::compilepkg # <> reinstall::compilepkg clean-local:: veryclean::clean -rm $(PKGCOMMON_PACKAGES) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # nothing specific to do for [[file:../common.mak::reinstall]] reinstall::install # FFCS: need to add $(RANLIB) under mingw64 to avoid "archive has no index" error compilepkg::$(ARPACKLIB) ARPACK/ARmake.inc:ARPACK/ARmake.incnew if diff -q ARPACK/ARmake.incnew ARPACK/ARmake.inc ; then echo No Modif skip compile of arpack ; else cp ARPACK/ARmake.incnew ARPACK/ARmake.inc; fi $(ARPACKLIB):ARPACK/ARmake.inc case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_zdotc.f -o ARPACK/SRC/veclib_zdotc.o ;; esac; case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) $(F77) -c $(FFLAGS) veclib_cdotc.f -o ARPACK/SRC/veclib_cdotc.o ;; esac; mkdir -p ../include ../lib if [ -n '@FF_LAPACKdir@' ] ; then \ $(F77) -c `echo $(FFLAGS)\ |sed -e s/-O.\*\ // ` ARPACK/LAPACK/dlamch.f -o ARPACK/LAPACK/dlamch.o; \ fi; \ cd ARPACK && $(MAKE) lib if test -n '@FF_LAPACKdir@' ; then \ $(AR) $(ARFLAGS) $(LAPACK_arpack_LIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ARPACK/LAPACK/*.o ;\ $(RANLIB) $(LAPACK_arpack_LIB) ;\ else \ $(AR) $(ARFLAGS) $(ARPACKLIB) ARPACK/SRC/*.o ARPACK/UTIL/*.o ;\ fi ARPACK/ARmake.incnew: $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ) ARmake.m4 Makefile -rm -rf ARPACK gunzip -c $(ARPACK96_TAR_GZ) | tar xf - gunzip -c $(PATCH_TAR_GZ) | tar xf - gunzip -c arpack-patch-lapack.tar.gz | tar xf - case '$(BLASLIBS)' in *vecLib*|*Accelerate*|*mkl*) \ for i in ARPACK/LAPACK/zlatrs.f ARPACK/LAPACK/ztrsyl.f ARPACK/SRC/zgetv0.f ARPACK/SRC/znaitr.f ARPACK/SRC/znaup2.f ARPACK/SRC/zneupd.f;\ do mv $$i $$i.cpy; sed -e 's/ZDOTC/ZZDOTC/' -e 's/zdotc/zzdotc/' <$$i.cpy >$$i;rm $$i.cpy; \ done; \ for i in ARPACK/LAPACK/clatrs.f ARPACK/LAPACK/ctrsyl.f ARPACK/SRC/cgetv0.f ARPACK/SRC/cnaitr.f ARPACK/SRC/cnaup2.f ARPACK/SRC/cneupd.f;\ do mv $$i $$i.cpy; sed -e 's/CDOTC/CCDOTC/' -e 's/cdotc/ccdotc/' <$$i.cpy >$$i;rm $$i.cpy; \ done; \ esac for i in ARPACK/SRC/*.f ; do \ mv $$i $$i.cpy; sed -e 's/, second/, secnd2/' -e 's/call *second/call secnd2/' <$$i.cpy >$$i;rm $$i.cpy; done for i in ARPACK/UTIL/second.f; do \ mv $$i $$i.cpy; cat $$i.cpy| sed 's/ SECOND *(/ secnd2(/'|grep -v EXTERNAL >$$i;rm $$i.cpy; done m4 -DFF_BLASLIB="$(BLASLIB)" \ -DFF_ARPACKLIB="$(ARPACKLIB)" \ -DFF_LAPACK_arpack_LIB="$(LAPACK_arpack_LIB)" \ -DFF_FC="@F77@" \ -DFF_FFLAGS="@FFLAGS@" \ -DFF_LAPACKdir='@FF_LAPACKdir@' \ -DFF_LDFLAGS="@LDFLAGS@" \ -DFF_HOME=`pwd`/ARPACK \ -DFF_SECOND="@FF_SECOND@" \ -DFF_AR="@AR@" \ -DFF_ARFLAGS="@ARFLAGS@" \ -DFF_RANLIB="@RANLIB@" \ ARmake.m4 >ARPACK/ARmake.incnew $(ARPACK96_TAR_GZ) $(PATCH_TAR_GZ):download # ../getall -o ARPACK -a clean-local:: -rm -r ARPACK ../lib/libarpack.a # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # 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: freefem++-3.61-1/download/arpack/ARmake.m4000644 000767 000024 00000007563 13256636774 020310 0ustar00hechtstaff000000 000000 # ARPACK ARmake.inc modified for FreeFem++ # $Id$ ########################################################################### # # Program: ARPACK # # Module: ARmake.inc # # Purpose: Top-level Definitions # # Creation date: February 22, 1996 # # Modified: # # Send bug reports, comments or suggestions to arpack@caam.rice.edu # ############################################################################ # # %---------------------------------% # | SECTION 1: PATHS AND LIBRARIES | # %---------------------------------% # # # %--------------------------------------% # | You should change the definition of | # | home if ARPACK is built some place | # | other than your home directory. | # %--------------------------------------% # home = FF_HOME # # %--------------------------------------% # | The platform identifier to suffix to | # | the end of library names | # %--------------------------------------% # PLAT = ff++ # # %------------------------------------------------------% # | The directories to find the various pieces of ARPACK | # %------------------------------------------------------% # BLASdir = $(home)/BLAS LAPACKdir = $(home)/LAPACK UTILdir = $(home)/UTIL SRCdir = $(home)/SRC # #DIRS = $(BLASdir) $(LAPACKdir) $(UTILdir) $(SRCdir) # # %-------------------------------------------------------------------% # | Comment out the previous line and uncomment the following | # | if you already have the BLAS and LAPACK installed on your system. | # | NOTE: ARPACK assumes the use of LAPACK version 2 codes. | # %-------------------------------------------------------------------% # DIRS = FF_LAPACKdir $(UTILdir) $(SRCdir) # # %---------------------------------------------------% # | The name of the libraries to be created/linked to | # %---------------------------------------------------% # ARPACKLIB = FF_ARPACKLIB LAPACKLIB = FF_LAPACKLIB BLASLIB = FF_BLASLIB # ALIBS = $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB) # # # %---------------------------------------------------------% # | SECTION 2: COMPILERS | # | | # | The following macros specify compilers, linker/loaders, | # | the archiver, and their options. You need to make sure | # | these are correct for your system. | # %---------------------------------------------------------% # # # %------------------------------% # | Make our own suffixes' list. | # %------------------------------% # .SUFFIXES: .SUFFIXES: .f .o # # %------------------% # | Default command. | # %------------------% # .DEFAULT: @$(ECHO) "Unknown target $@, try: make help" # # %-------------------------------------------% # | Command to build .o files from .f files. | # %-------------------------------------------% # .f.o: @$(ECHO) Making $@ from $< @$(FC) -c $(FFLAGS) $< # # %-----------------------------------------% # | Various compilation programs and flags. | # | You need to make sure these are correct | # | for your system. | # %-----------------------------------------% # FC = FF_FC FFLAGS = FF_FFLAGS LDFLAGS = FF_LDFLAGS SECOND_O = FF_SECOND CD = cd ECHO = echo LN = ln LNFLAGS = -s MAKE = make RM = rm RMFLAGS = -f SHELL = /bin/sh # # %----------------------------------------------------------------% # | The archiver and the flag(s) to use when building an archive | # | (library). Also the ranlib routine. If your system has no | # | ranlib, set RANLIB = touch. | # %----------------------------------------------------------------% # AR = FF_AR ARFLAGS = FF_ARFLAGS RANLIB = FF_RANLIB # # %----------------------------------% # | This is the general help target. | # %----------------------------------% # help: @$(ECHO) "usage: make ?" freefem++-3.61-1/download/umfpack/SuiteSparse_config.mk.in000644 000767 000024 00000034716 13256636774 023625 0ustar00hechtstaff000000 000000 #=============================================================================== # SuiteSparse_config.mk: common configuration file for the SuiteSparse #=============================================================================== # This file contains all configuration settings for all packages authored or # co-authored by Tim Davis: # # Package Version Description # ------- ------- ----------- # AMD 1.2 or later approximate minimum degree ordering # COLAMD 2.4 or later column approximate minimum degree ordering # CCOLAMD 1.0 or later constrained column approximate minimum degree ordering # CAMD any constrained approximate minimum degree ordering # UMFPACK 4.5 or later sparse LU factorization, with the BLAS # CHOLMOD any sparse Cholesky factorization, update/downdate # KLU 0.8 or later sparse LU factorization, BLAS-free # BTF 0.8 or later permutation to block triangular form # LDL 1.2 or later concise sparse LDL' # CXSparse any extended version of CSparse (int/long, real/complex) # SuiteSparseQR any sparse QR factorization # RBio 2.0 or later read/write sparse matrices in Rutherford-Boeing format # # By design, this file is NOT included in the CSparse makefile. # That package is fully stand-alone. CSparse is primarily for teaching; # production code should use CXSparse. # # The SuiteSparse_config directory and the above packages should all appear in # a single directory, in order for the Makefile's within each package to find # this file. # # To enable an option of the form "# OPTION = ...", edit this file and # delete the "#" in the first column of the option you wish to use. # # The use of METIS 4.0.1 is optional. To exclude METIS, you must compile with # CHOLMOD_CONFIG set to -DNPARTITION. See below for details. However, if you # do not have a metis-4.0 directory inside the SuiteSparse directory, the # */Makefile's that optionally rely on METIS will automatically detect this # and compile without METIS. #------------------------------------------------------------------------------ # Generic configuration #------------------------------------------------------------------------------ # Using standard definitions from the make environment, typically: # # CC cc C compiler # CXX g++ C++ compiler # CFLAGS [ ] flags for C and C++ compiler # CPPFLAGS [ ] flags for C and C++ compiler # TARGET_ARCH [ ] target architecture # FFLAGS [ ] flags for Fortran compiler # RM rm -f delete a file # AR ar create a static *.a library archive # ARFLAGS rv flags for ar # MAKE make make itself (sometimes called gmake) # # You can redefine them here, but by default they are used from the # default make environment. # C and C++ compiler flags. The first three are standard for *.c and *.cpp # Add -DNTIMER if you do use any timing routines (otherwise -lrt is required). # CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER # ranlib, and ar, for generating libraries. If you don't need ranlib, # just change it to RANLAB = echo AR = @AR@ RANLIB = @RANLIB@ ARFLAGS =@ARFLAGS@ ARCHIVE = $(AR) $(ARFLAGS) # copy and delete a file CP = cp -f MV = mv -f # Fortran compiler (not required for 'make' or 'make library') F77 = gfortran F77FLAGS = $(FFLAGS) -O F77LIB = # C and Fortran libraries. Remove -lrt if you don't have it. LIB = -lm # Using the following requires CF = ... -DNTIMER on POSIX C systems. # LIB = -lm # For "make install" INSTALL_LIB = @abs_srcdir@/download//lib INSTALL_INCLUDE = @abs_srcdir@/download/include # Which version of MAKE you are using (default is "make") # MAKE = make # MAKE = gmake #------------------------------------------------------------------------------ # BLAS and LAPACK configuration: #------------------------------------------------------------------------------ # UMFPACK and CHOLMOD both require the BLAS. CHOLMOD also requires LAPACK. # See Kazushige Goto's BLAS at http://www.cs.utexas.edu/users/flame/goto/ or # http://www.tacc.utexas.edu/~kgoto/ for the best BLAS to use with CHOLMOD. # LAPACK is at http://www.netlib.org/lapack/ . You can use the standard # Fortran LAPACK along with Goto's BLAS to obtain very good performance. # CHOLMOD gets a peak numeric factorization rate of 3.6 Gflops on a 3.2 GHz # Pentium 4 (512K cache, 4GB main memory) with the Goto BLAS, and 6 Gflops # on a 2.5Ghz dual-core AMD Opteron. # These settings will probably not work, since there is no fixed convention for # naming the BLAS and LAPACK library (*.a or *.so) files. # This is probably slow ... it might connect to the Standard Reference BLAS: BLAS = @BLASLIBS@ LAPACK = @LAPACKLIBS@ # NOTE: this next option for the "Goto BLAS" has nothing to do with a "goto" # statement. Rather, the Goto BLAS is written by Dr. Kazushige Goto. # Using the Goto BLAS: # BLAS = -lgoto -lgfortran -lgfortranbegin # BLAS = -lgoto2 -lgfortran -lgfortranbegin -lpthread # Using non-optimized versions: # BLAS = -lblas_plain -lgfortran -lgfortranbegin # LAPACK = -llapack_plain # BLAS = -lblas_plain -lgfortran -lgfortranbegin # LAPACK = -llapack # The BLAS might not contain xerbla, an error-handling routine for LAPACK and # the BLAS. Also, the standard xerbla requires the Fortran I/O library, and # stops the application program if an error occurs. A C version of xerbla # distributed with this software (SuiteSparse_config/xerbla/libcerbla.a) # includes a Fortran-callable xerbla routine that prints nothing and does not # stop the application program. This is optional. # XERBLA = ../../SuiteSparse_config/xerbla/libcerbla.a # If you wish to use the XERBLA in LAPACK and/or the BLAS instead, # use this option: XERBLA = # If you wish to use the Fortran SuiteSparse_config/xerbla/xerbla.f instead, # use this: # XERBLA = ../../SuiteSparse_config/xerbla/libxerbla.a #------------------------------------------------------------------------------ # GPU configuration for CHOLMOD, using the CUDA BLAS #------------------------------------------------------------------------------ # no cuda GPU_BLAS_PATH = GPU_CONFIG = # with cuda BLAS acceleration for CHOLMOD # GPU_BLAS_PATH=/usr/local/cuda # GPU_CONFIG=-DGPU_BLAS -I$(GPU_BLAS_PATH)/include #------------------------------------------------------------------------------ # METIS, optionally used by CHOLMOD #------------------------------------------------------------------------------ # If you do not have METIS, or do not wish to use it in CHOLMOD, you must # compile CHOLMOD with the -DNPARTITION flag. # The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc. # You may wish to use an absolute path. METIS is optional. Compile # CHOLMOD with -DNPARTITION if you do not wish to use METIS. METIS_PATH = ../../metis-4.0 METIS = ../../metis-4.0/libmetis.a #------------------------------------------------------------------------------ # UMFPACK configuration: #------------------------------------------------------------------------------ # Configuration flags for UMFPACK. See UMFPACK/Source/umf_config.h for details. # # -DNBLAS do not use the BLAS. UMFPACK will be very slow. # -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by # LAPACK and the BLAS (defaults to 'int') # -DNSUNPERF do not use the Sun Perf. Library (default is use it on Solaris) # -DNRECIPROCAL do not multiply by the reciprocal # -DNO_DIVIDE_BY_ZERO do not divide by zero # -DNCHOLMOD do not use CHOLMOD as a ordering method. If -DNCHOLMOD is # included in UMFPACK_CONFIG, then UMFPACK does not rely on # CHOLMOD, CAMD, CCOLAMD, COLAMD, and METIS. UMFPACK_CONFIG = # uncomment this line to compile UMFPACK without CHOLMOD: # UMFPACK_CONFIG = -DNCHOLMOD #------------------------------------------------------------------------------ # CHOLMOD configuration #------------------------------------------------------------------------------ # CHOLMOD Library Modules, which appear in libcholmod.a: # Core requires: none # Check requires: Core # Cholesky requires: Core, AMD, COLAMD. optional: Partition, Supernodal # MatrixOps requires: Core # Modify requires: Core # Partition requires: Core, CCOLAMD, METIS. optional: Cholesky # Supernodal requires: Core, BLAS, LAPACK # # CHOLMOD test/demo Modules (all are GNU GPL, do not appear in libcholmod.a): # Tcov requires: Core, Check, Cholesky, MatrixOps, Modify, Supernodal # optional: Partition # Valgrind same as Tcov # Demo requires: Core, Check, Cholesky, MatrixOps, Supernodal # optional: Partition # # Configuration flags: # -DNCHECK do not include the Check module. License GNU LGPL # -DNCHOLESKY do not include the Cholesky module. License GNU LGPL # -DNPARTITION do not include the Partition module. License GNU LGPL # also do not include METIS. # -DNGPL do not include any GNU GPL Modules in the CHOLMOD library: # -DNMATRIXOPS do not include the MatrixOps module. License GNU GPL # -DNMODIFY do not include the Modify module. License GNU GPL # -DNSUPERNODAL do not include the Supernodal module. License GNU GPL # # -DNPRINT do not print anything. # -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by # LAPACK and the BLAS (defaults to 'int') # -DNSUNPERF for Solaris only. If defined, do not use the Sun # Performance Library CHOLMOD_CONFIG = -DNPARTITION -DNGPL $(GPU_CONFIG) # uncomment this line to compile CHOLMOD without METIS: # CHOLMOD_CONFIG = -DNPARTITION #------------------------------------------------------------------------------ # SuiteSparseQR configuration: #------------------------------------------------------------------------------ # The SuiteSparseQR library can be compiled with the following options: # # -DNPARTITION do not include the CHOLMOD partition module # -DNEXPERT do not include the functions in SuiteSparseQR_expert.cpp # -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB) # default, without timing, without TBB: SPQR_CONFIG = # with TBB: # SPQR_CONFIG = -DHAVE_TBB # This is needed for IBM AIX: (but not for and C codes, just C++) # SPQR_CONFIG = -DBLAS_NO_UNDERSCORE # with TBB, you must select this: # TBB = -ltbb # without TBB: TBB = #------------------------------------------------------------------------------ # Linux #------------------------------------------------------------------------------ # Using default compilers: CC = @CC@ CFLAGS = @CFLAGS@ # CF = $(CFLAGS) -O3 -fexceptions # alternatives: # CF = $(CFLAGS) -g -fexceptions \ -Wall -W -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi \ -funit-at-a-time # CF = $(CFLAGS) -O3 -fexceptions \ -Wall -W -Werror -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi # CF = $(CFLAGS) -O3 -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE # CF = $(CFLAGS) -O3 # CF = $(CFLAGS) -O3 -g -fexceptions # CF = $(CFLAGS) -g -fexceptions \ -Wall -W -Wshadow \ -Wredundant-decls -Wdisabled-optimization -ansi # consider: # -fforce-addr -fmove-all-movables -freduce-all-givs -ftsp-ordering # -frename-registers -ffast-math -funroll-loops # Using the Goto BLAS: # BLAS = -lgoto -lfrtbegin -lg2c $(XERBLA) -lpthread # Using Intel's icc and ifort compilers: # (does not work for mexFunctions unless you add a mexopts.sh file) # F77 = ifort # CC = icc # CF = $(CFLAGS) -O3 -xN -vec_report=0 # CF = $(CFLAGS) -g # 64bit: # F77FLAGS = -O -m64 # CF = $(CFLAGS) -O3 -fexceptions -m64 # BLAS = -lgoto64 -lfrtbegin -lg2c -lpthread $(XERBLA) # LAPACK = -llapack64 # SUSE Linux 10.1, AMD Opteron, with GOTO Blas # F77 = gfortran # BLAS = -lgoto_opteron64 -lgfortran # SUSE Linux 10.1, Intel Pentium, with GOTO Blas # F77 = gfortran # BLAS = -lgoto -lgfortran #------------------------------------------------------------------------------ # Mac #------------------------------------------------------------------------------ # As recommended by macports, http://suitesparse.darwinports.com/ # I've tested them myself on Mac OSX 10.6.1 and 10.6.8 (Snow Leopard), # on my MacBook Air, and they work fine. # F77 = gfortran # CF = $(CFLAGS) -O3 -fno-common -fexceptions -DNTIMER # BLAS = -framework Accelerate # LAPACK = -framework Accelerate # LIB = -lm #------------------------------------------------------------------------------ # Solaris #------------------------------------------------------------------------------ # 32-bit # CF = $(CFLAGS) -KPIC -dalign -xc99=%none -Xc -xlibmieee -xO5 -xlibmil -m32 # 64-bit # CF = $(CFLAGS) -fast -KPIC -xc99=%none -xlibmieee -xlibmil -m64 -Xc # FFLAGS = -fast -KPIC -dalign -xlibmil -m64 # The Sun Performance Library includes both LAPACK and the BLAS: # BLAS = -xlic_lib=sunperf # LAPACK = #------------------------------------------------------------------------------ # Compaq Alpha #------------------------------------------------------------------------------ # 64-bit mode only # CF = $(CFLAGS) -O2 -std1 # BLAS = -ldxml # LAPACK = #------------------------------------------------------------------------------ # IBM RS 6000 #------------------------------------------------------------------------------ # BLAS = -lessl # LAPACK = # 32-bit mode: # CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -qproto # F77FLAGS = -O4 -qipa -qmaxmem=16384 # 64-bit mode: # CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -q64 -qproto # F77FLAGS = -O4 -qipa -qmaxmem=16384 -q64 #------------------------------------------------------------------------------ # SGI IRIX #------------------------------------------------------------------------------ # BLAS = -lscsl # LAPACK = # 32-bit mode # CF = $(CFLAGS) -O # 64-bit mode (32 bit int's and 64-bit long's): # CF = $(CFLAGS) -64 # F77FLAGS = -64 # SGI doesn't have ranlib # RANLIB = echo #------------------------------------------------------------------------------ # AMD Opteron (64 bit) #------------------------------------------------------------------------------ # BLAS = -lgoto_opteron64 -lg2c # LAPACK = -llapack_opteron64 # SUSE Linux 10.1, AMD Opteron # F77 = gfortran # BLAS = -lgoto_opteron64 -lgfortran # LAPACK = -llapack_opteron64 #------------------------------------------------------------------------------ # remove object files and profile output #------------------------------------------------------------------------------ CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d *.gcda *.gcno freefem++-3.61-1/download/umfpack/Makefile.am000644 000767 000024 00000015337 13256636774 021125 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries for Umfpack # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Downloading and compiling extra libraries for Umfpack" default=0 freefem make multipleauthors start=04/06/04 upmc # see [[file:../../configure.ac::DOWNLOAD_UMFPACK]] all-local: $(DOWNLOAD_UMFPACK) EXTRA_DIST= SuiteSparse_config.mk.in # Downloading and compiling UMFPACK # --------------------------------- DIRPKG=../pkg SUITESPARSE_TGZ=$(DIRPKG)/SuiteSparse-4.4.4.tar.gz UMFPACKLIB=../lib/libumfpack.a AMDLIB=../lib/libamd.a CAMDLIB=../lib/libcamd.a CHOLMODLIB=../lib/libcholmod.a COLAMDLIB=../lib/libcolamd.a SUITESPARSECONFIGLIB=../lib/libsuitesparseconfig.a # ALH - 4/9/13 - parallel make crashes ("pipe from processes is a directory"?). make sure that everything is run # sequentially umfpack: $(MAKE) MAKEFLAGS= $(AMDLIB) $(MAKE) MAKEFLAGS= $(UMFPACKLIB) $(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) # # ALH - 19/9/13 - cholmod part built sequentially # $(MAKE) MAKEFLAGS= $(CAMDLIB) $(MAKE) MAKEFLAGS= $(COLAMDLIB) $(MAKE) MAKEFLAGS= $(AMDLIB) $(MAKE) MAKEFLAGS= $(CHOLMODLIB) $(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) # FFCS: SuiteSparse/*/Source are not able to compile in parallel from scratch ("pipe from processes is a # directory"?). But specifying "make -j 1" is not enough (another error pops up). Use "$(MAKE) MAKEFLAGS=" instead # (using "make MAKEFLAGS=" still produces an error on Cygwin). $(SUITESPARSECONFIGLIB): SuiteSparse/FF cd SuiteSparse/SuiteSparse_config && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include cp SuiteSparse/SuiteSparse_config/libsuitesparseconfig.a ../lib/libsuitesparseconfig.a $(RANLIB) ../lib/libsuitesparseconfig.a $(UMFPACKLIB): SuiteSparse/FF cd SuiteSparse/UMFPACK/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/UMFPACK/Include/*.h ../include cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include cp SuiteSparse/UMFPACK/Lib/libumfpack.a ../lib/libumfpack.a $(RANLIB) ../lib/libumfpack.a $(AMDLIB): SuiteSparse/FF cd SuiteSparse/AMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/AMD/Include/*.h ../include cp SuiteSparse/AMD/Lib/libamd.a ../lib/libamd.a $(RANLIB) ../lib/libamd.a $(CAMDLIB): SuiteSparse/FF cd SuiteSparse/CAMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/CAMD/Include/*.h ../include cp SuiteSparse/CAMD/Lib/libcamd.a ../lib/libcamd.a $(RANLIB) ../lib/libcamd.a $(CHOLMODLIB): SuiteSparse/FF cd SuiteSparse/CHOLMOD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/CHOLMOD/Include/*.h ../include cp SuiteSparse/CHOLMOD/Lib/libcholmod.a ../lib/libcholmod.a $(RANLIB) ../lib/libcholmod.a $(COLAMDLIB): SuiteSparse/FF cd SuiteSparse/COLAMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/COLAMD/Include/*.h ../include cp SuiteSparse/COLAMD/Lib/libcolamd.a ../lib/libcolamd.a $(RANLIB) ../lib/libcolamd.a UMFPACKv4.4: tar xzf UMFPACKv4.4.tar.gz # The 'lib' goal is replaced with 'libb' to avoid problems with the existing 'Lib' subdirectory on case-insensitive file # systems the lib depend of the Makefile to force the reconstruction if the parameter change UMFPACKv4.4/AMD/Makefile2 UMFPACKv4.4/UMFPACK/Makefile2: UMFPACKv4.4 sed 's/lib:/libb:/' < UMFPACKv4.4/UMFPACK/`basename $@ 2` >$@ SuiteSparse/DATE:$(SUITESPARSE_TGZ) tar zxvf $(SUITESPARSE_TGZ) touch SuiteSparse/DATE SuiteSparse/FF:SuiteSparse/DATE SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk touch SuiteSparse/FF SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk:SuiteSparse/DATE Makefile SuiteSparse_config.mk.in ../../config.status --file="SuiteSparse_config.mk:SuiteSparse_config.mk.in" -if diff SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk 2>&1 >/dev/null; then \ echo " same flags => no recompilation ! " ; \ else \ echo " recompile umfpack (some flags change) => clean umfpack colmod amd " ;\ mkdir -p SuiteSparse/SuiteSparse_config ;\ cp SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk ; \ (cd SuiteSparse/UMFPACK && make clean); \ (cd SuiteSparse/CHOLMOD && make clean); \ (cd SuiteSparse/COLAMD && make clean); \ (cd SuiteSparse/CAMD && make clean); \ (cd SuiteSparse/CAMD && make clean); \ (cd SuiteSparse/AMD && make clean); \ find . -name '*.exe'|xargs rm; \ fi; touch SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk UMFPACK_Make.m4: Makefile UMFPACKv4.4 m4 -DFF_CC="$(CC)" \ -DFF_CFLAGS="@CPPFLAGS@ @CFLAGS@ @BLASINC@" \ -DFF_LIB="@BLASLIB@ @LIBS@" \ -DFF_CONFIG="@FF_UMFPACK_CONFIG@" \ UMFPACK_Make.m4 >Make.include -if diff Make.include UMFPACKv4.4/UMFPACK/Make/Make.include 2>&1 >/dev/null; then \ echo " same flags => no recompilation ! " ; \ else \ echo " recompile umfpack (some flags change) => clean umfpack" ;\ cp Make.include UMFPACKv4.4/UMFPACK/Make/Make.include; \ cd UMFPACKv4.4/UMFPACK && make clean; \ find . -name '*.exe'|xargs rm; \ fi; UMFPACKv4.4.tar.gz: @WGET@ -N http://www.cise.ufl.edu/research/sparse/umfpack/v4.4/UMFPACKv4.4.tar.gz $(SUITESPARSE_TGZ): ../getall -o SuiteSparse -a clean-local: -rm $(AMDLIB) $(CAMDLIB) $(CHOLMODLIB) $(COLAMDLIB) $(SUITESPARSECONFIGLIB) -rm ../include/amd*.h -rm ../include/umfpack*.h -rm ../include/colmod*.h -rm ../include/camd*.h -rm ../include/amd*.h -rm ../include/SuiteSparse_config.h -rm -rf UMFPACKv4.?.tar.gz UMFPACKv4.? -rm SuiteSparse*gz -rm -rf SuiteSparse # -rm ../pkg/SuiteSparse-* -rm SuiteSparse_config.mk # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/umfpack/Makefile.in000644 000767 000024 00000057251 13321623167 021120 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Downloading and compiling extra libraries for Umfpack # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Downloading and compiling extra libraries for Umfpack" default=0 freefem make multipleauthors start=04/06/04 upmc VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = download/umfpack ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = SuiteSparse_config.mk.in # Downloading and compiling UMFPACK # --------------------------------- DIRPKG = ../pkg SUITESPARSE_TGZ = $(DIRPKG)/SuiteSparse-4.4.4.tar.gz UMFPACKLIB = ../lib/libumfpack.a AMDLIB = ../lib/libamd.a CAMDLIB = ../lib/libcamd.a CHOLMODLIB = ../lib/libcholmod.a COLAMDLIB = ../lib/libcolamd.a SUITESPARSECONFIGLIB = ../lib/libsuitesparseconfig.a 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu download/umfpack/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu download/umfpack/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ 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 pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # see [[file:../../configure.ac::DOWNLOAD_UMFPACK]] all-local: $(DOWNLOAD_UMFPACK) # ALH - 4/9/13 - parallel make crashes ("pipe from processes is a directory"?). make sure that everything is run # sequentially umfpack: $(MAKE) MAKEFLAGS= $(AMDLIB) $(MAKE) MAKEFLAGS= $(UMFPACKLIB) $(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) # # ALH - 19/9/13 - cholmod part built sequentially # $(MAKE) MAKEFLAGS= $(CAMDLIB) $(MAKE) MAKEFLAGS= $(COLAMDLIB) $(MAKE) MAKEFLAGS= $(AMDLIB) $(MAKE) MAKEFLAGS= $(CHOLMODLIB) $(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) # FFCS: SuiteSparse/*/Source are not able to compile in parallel from scratch ("pipe from processes is a # directory"?). But specifying "make -j 1" is not enough (another error pops up). Use "$(MAKE) MAKEFLAGS=" instead # (using "make MAKEFLAGS=" still produces an error on Cygwin). $(SUITESPARSECONFIGLIB): SuiteSparse/FF cd SuiteSparse/SuiteSparse_config && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include cp SuiteSparse/SuiteSparse_config/libsuitesparseconfig.a ../lib/libsuitesparseconfig.a $(RANLIB) ../lib/libsuitesparseconfig.a $(UMFPACKLIB): SuiteSparse/FF cd SuiteSparse/UMFPACK/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/UMFPACK/Include/*.h ../include cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include cp SuiteSparse/UMFPACK/Lib/libumfpack.a ../lib/libumfpack.a $(RANLIB) ../lib/libumfpack.a $(AMDLIB): SuiteSparse/FF cd SuiteSparse/AMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/AMD/Include/*.h ../include cp SuiteSparse/AMD/Lib/libamd.a ../lib/libamd.a $(RANLIB) ../lib/libamd.a $(CAMDLIB): SuiteSparse/FF cd SuiteSparse/CAMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/CAMD/Include/*.h ../include cp SuiteSparse/CAMD/Lib/libcamd.a ../lib/libcamd.a $(RANLIB) ../lib/libcamd.a $(CHOLMODLIB): SuiteSparse/FF cd SuiteSparse/CHOLMOD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/CHOLMOD/Include/*.h ../include cp SuiteSparse/CHOLMOD/Lib/libcholmod.a ../lib/libcholmod.a $(RANLIB) ../lib/libcholmod.a $(COLAMDLIB): SuiteSparse/FF cd SuiteSparse/COLAMD/Lib && $(MAKE) MAKEFLAGS= mkdir -p ../include ../lib cp -f SuiteSparse/COLAMD/Include/*.h ../include cp SuiteSparse/COLAMD/Lib/libcolamd.a ../lib/libcolamd.a $(RANLIB) ../lib/libcolamd.a UMFPACKv4.4: tar xzf UMFPACKv4.4.tar.gz # The 'lib' goal is replaced with 'libb' to avoid problems with the existing 'Lib' subdirectory on case-insensitive file # systems the lib depend of the Makefile to force the reconstruction if the parameter change UMFPACKv4.4/AMD/Makefile2 UMFPACKv4.4/UMFPACK/Makefile2: UMFPACKv4.4 sed 's/lib:/libb:/' < UMFPACKv4.4/UMFPACK/`basename $@ 2` >$@ SuiteSparse/DATE:$(SUITESPARSE_TGZ) tar zxvf $(SUITESPARSE_TGZ) touch SuiteSparse/DATE SuiteSparse/FF:SuiteSparse/DATE SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk touch SuiteSparse/FF SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk:SuiteSparse/DATE Makefile SuiteSparse_config.mk.in ../../config.status --file="SuiteSparse_config.mk:SuiteSparse_config.mk.in" -if diff SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk 2>&1 >/dev/null; then \ echo " same flags => no recompilation ! " ; \ else \ echo " recompile umfpack (some flags change) => clean umfpack colmod amd " ;\ mkdir -p SuiteSparse/SuiteSparse_config ;\ cp SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk ; \ (cd SuiteSparse/UMFPACK && make clean); \ (cd SuiteSparse/CHOLMOD && make clean); \ (cd SuiteSparse/COLAMD && make clean); \ (cd SuiteSparse/CAMD && make clean); \ (cd SuiteSparse/CAMD && make clean); \ (cd SuiteSparse/AMD && make clean); \ find . -name '*.exe'|xargs rm; \ fi; touch SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk UMFPACK_Make.m4: Makefile UMFPACKv4.4 m4 -DFF_CC="$(CC)" \ -DFF_CFLAGS="@CPPFLAGS@ @CFLAGS@ @BLASINC@" \ -DFF_LIB="@BLASLIB@ @LIBS@" \ -DFF_CONFIG="@FF_UMFPACK_CONFIG@" \ UMFPACK_Make.m4 >Make.include -if diff Make.include UMFPACKv4.4/UMFPACK/Make/Make.include 2>&1 >/dev/null; then \ echo " same flags => no recompilation ! " ; \ else \ echo " recompile umfpack (some flags change) => clean umfpack" ;\ cp Make.include UMFPACKv4.4/UMFPACK/Make/Make.include; \ cd UMFPACKv4.4/UMFPACK && make clean; \ find . -name '*.exe'|xargs rm; \ fi; UMFPACKv4.4.tar.gz: @WGET@ -N http://www.cise.ufl.edu/research/sparse/umfpack/v4.4/UMFPACKv4.4.tar.gz $(SUITESPARSE_TGZ): ../getall -o SuiteSparse -a clean-local: -rm $(AMDLIB) $(CAMDLIB) $(CHOLMODLIB) $(COLAMDLIB) $(SUITESPARSECONFIGLIB) -rm ../include/amd*.h -rm ../include/umfpack*.h -rm ../include/colmod*.h -rm ../include/camd*.h -rm ../include/amd*.h -rm ../include/SuiteSparse_config.h -rm -rf UMFPACKv4.?.tar.gz UMFPACKv4.? -rm SuiteSparse*gz -rm -rf SuiteSparse # -rm ../pkg/SuiteSparse-* -rm SuiteSparse_config.mk # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # 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: freefem++-3.61-1/download/blas/Makefile.am000644 000767 000024 00000025617 13256636774 020422 0ustar00hechtstaff000000 000000 # Downloading and compiling extra BLAS libraries # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Downloading and compiling extra BLAS libraries" default=0 freefem make multipleauthors start=04/06/04 upmc DIRPKG=../pkg BLAS_TGZ=$(DIRPKG)/blas-3.7.1.tgz CBLAS_TGZ=$(DIRPKG)/cblas.tgz PKGCOMMON_PACKTITLE=BLAS PKGCOMMON_PACKAGES=$(BLAS_TGZ) $(CBLAS_TGZ) ../pkg/OpenBLAS.tar.gz include ../common.mak EXTRA_DIST= \ openblas.patches # Downloading and compiling the Generic Blas # ------------------------------------------ noinst_LIBRARIES=@DOWNLOADED_BLAS@ ##compile::$(noinst_LIBRARIES) EXTRA_LIBRARIES=libf77blas.a libcblas.a pkgcompile::@DOWNLOADED_BLAS@ # List of files to compile (do not list them in *_SOURCES to prevent them from being included in distributions). F77BLAS_SOURCES=BLAS/caxpy.f BLAS/crotg.f BLAS/dcopy.f BLAS/dsymv.f BLAS/lsame.f BLAS/sspmv.f BLAS/zaxpy.f BLAS/zhpr2.f \ BLAS/ccopy.f BLAS/cscal.f BLAS/ddot.f BLAS/dsyr2.f BLAS/sasum.f BLAS/sspr2.f BLAS/zcopy.f BLAS/zhpr.f BLAS/cdotc.f \ BLAS/csrot.f BLAS/dgbmv.f BLAS/dsyr2k.f BLAS/saxpy.f BLAS/sspr.f BLAS/zdotc.f BLAS/zrotg.f BLAS/cdotu.f BLAS/csscal.f \ BLAS/dgemm.f BLAS/dsyr.f BLAS/scasum.f BLAS/sswap.f BLAS/zdotu.f BLAS/zscal.f BLAS/cgbmv.f BLAS/cswap.f BLAS/dgemv.f \ BLAS/dsyrk.f BLAS/scnrm2.f BLAS/ssymm.f BLAS/zdrot.f BLAS/zswap.f BLAS/cgemm.f BLAS/csymm.f BLAS/dger.f BLAS/dtbmv.f \ BLAS/scopy.f BLAS/ssymv.f BLAS/zdscal.f BLAS/zsymm.f BLAS/cgemv.f BLAS/csyr2k.f BLAS/dnrm2.f BLAS/dtbsv.f BLAS/sdot.f \ BLAS/ssyr2.f BLAS/zgbmv.f BLAS/zsyr2k.f BLAS/cgerc.f BLAS/csyrk.f BLAS/drot.f BLAS/dtpmv.f BLAS/sdsdot.f BLAS/ssyr2k.f \ BLAS/zgemm.f BLAS/zsyrk.f BLAS/cgeru.f BLAS/ctbmv.f BLAS/drotg.f BLAS/dtpsv.f BLAS/sgbmv.f BLAS/ssyr.f BLAS/zgemv.f \ BLAS/ztbmv.f BLAS/chbmv.f BLAS/ctbsv.f BLAS/drotm.f BLAS/dtrmm.f BLAS/sgemm.f BLAS/ssyrk.f BLAS/zgerc.f BLAS/ztbsv.f \ BLAS/chemm.f BLAS/ctpmv.f BLAS/drotmg.f BLAS/dtrmv.f BLAS/sgemv.f BLAS/stbmv.f BLAS/zgeru.f BLAS/ztpmv.f BLAS/chemv.f \ BLAS/ctpsv.f BLAS/dsbmv.f BLAS/dtrsm.f BLAS/sger.f BLAS/stbsv.f BLAS/zhbmv.f BLAS/ztpsv.f BLAS/cher2.f BLAS/ctrmm.f \ BLAS/dscal.f BLAS/dtrsv.f BLAS/snrm2.f BLAS/stpmv.f BLAS/zhemm.f BLAS/ztrmm.f BLAS/cher2k.f BLAS/ctrmv.f BLAS/dsdot.f \ BLAS/dzasum.f BLAS/srot.f BLAS/stpsv.f BLAS/zhemv.f BLAS/ztrmv.f BLAS/cher.f BLAS/ctrsm.f BLAS/dspmv.f BLAS/dznrm2.f \ BLAS/srotg.f BLAS/strmm.f BLAS/zher2.f BLAS/ztrsm.f BLAS/cherk.f BLAS/ctrsv.f BLAS/dspr2.f BLAS/icamax.f BLAS/srotm.f \ BLAS/strmv.f BLAS/zher2k.f BLAS/ztrsv.f BLAS/chpmv.f BLAS/dasum.f BLAS/dspr.f BLAS/idamax.f BLAS/srotmg.f BLAS/strsm.f \ BLAS/zher.f BLAS/chpr2.f BLAS/daxpy.f BLAS/dswap.f BLAS/isamax.f BLAS/ssbmv.f BLAS/strsv.f BLAS/zherk.f BLAS/chpr.f \ BLAS/dcabs1.f BLAS/dsymm.f BLAS/izamax.f BLAS/sscal.f blas_xerbla.f BLAS/zhpmv.f CBLAS_SOURCES=CBLAS/src/cblas_caxpy.c CBLAS/src/cblas_drot.c CBLAS/src/cblas_sgemm.c CBLAS/src/cblas_zher2.c \ CBLAS/src/cblas_ccopy.c CBLAS/src/cblas_drotg.c CBLAS/src/cblas_sgemv.c CBLAS/src/cblas_zher2k.c \ CBLAS/src/cblas_cdotc_sub.c CBLAS/src/cblas_drotm.c CBLAS/src/cblas_sger.c CBLAS/src/cblas_zher.c \ CBLAS/src/cblas_cdotu_sub.c CBLAS/src/cblas_drotmg.c CBLAS/src/cblas_snrm2.c CBLAS/src/cblas_zherk.c \ CBLAS/src/cblas_cgbmv.c CBLAS/src/cblas_dsbmv.c CBLAS/src/cblas_srot.c CBLAS/src/cblas_zhpmv.c CBLAS/src/cblas_cgemm.c \ CBLAS/src/cblas_dscal.c CBLAS/src/cblas_srotg.c CBLAS/src/cblas_zhpr2.c CBLAS/src/cblas_cgemv.c CBLAS/src/cblas_dsdot.c \ CBLAS/src/cblas_srotm.c CBLAS/src/cblas_zhpr.c CBLAS/src/cblas_cgerc.c CBLAS/src/cblas_dspmv.c CBLAS/src/cblas_srotmg.c \ CBLAS/src/cblas_zscal.c CBLAS/src/cblas_cgeru.c CBLAS/src/cblas_dspr2.c CBLAS/src/cblas_ssbmv.c CBLAS/src/cblas_zswap.c \ CBLAS/src/cblas_chbmv.c CBLAS/src/cblas_dspr.c CBLAS/src/cblas_sscal.c CBLAS/src/cblas_zsymm.c CBLAS/src/cblas_chemm.c \ CBLAS/src/cblas_dswap.c CBLAS/src/cblas_sspmv.c CBLAS/src/cblas_zsyr2k.c CBLAS/src/cblas_chemv.c \ CBLAS/src/cblas_dsymm.c CBLAS/src/cblas_sspr2.c CBLAS/src/cblas_zsyrk.c CBLAS/src/cblas_cher2.c CBLAS/src/cblas_dsymv.c \ CBLAS/src/cblas_sspr.c CBLAS/src/cblas_ztbmv.c CBLAS/src/cblas_cher2k.c CBLAS/src/cblas_dsyr2.c CBLAS/src/cblas_sswap.c \ CBLAS/src/cblas_ztbsv.c CBLAS/src/cblas_cher.c CBLAS/src/cblas_dsyr2k.c CBLAS/src/cblas_ssymm.c CBLAS/src/cblas_ztpmv.c \ CBLAS/src/cblas_cherk.c CBLAS/src/cblas_dsyr.c CBLAS/src/cblas_ssymv.c CBLAS/src/cblas_ztpsv.c CBLAS/src/cblas_chpmv.c \ CBLAS/src/cblas_dsyrk.c CBLAS/src/cblas_ssyr2.c CBLAS/src/cblas_ztrmm.c CBLAS/src/cblas_chpr2.c CBLAS/src/cblas_dtbmv.c \ CBLAS/src/cblas_ssyr2k.c CBLAS/src/cblas_ztrmv.c CBLAS/src/cblas_chpr.c CBLAS/src/cblas_dtbsv.c CBLAS/src/cblas_ssyr.c \ CBLAS/src/cblas_ztrsm.c CBLAS/src/cblas_cscal.c CBLAS/src/cblas_dtpmv.c CBLAS/src/cblas_ssyrk.c CBLAS/src/cblas_ztrsv.c \ CBLAS/src/cblas_csscal.c CBLAS/src/cblas_dtpsv.c CBLAS/src/cblas_stbmv.c CBLAS/src/cdotcsub.f CBLAS/src/cblas_cswap.c \ CBLAS/src/cblas_dtrmm.c CBLAS/src/cblas_stbsv.c CBLAS/src/cdotusub.f CBLAS/src/cblas_csymm.c CBLAS/src/cblas_dtrmv.c \ CBLAS/src/cblas_stpmv.c CBLAS/src/dasumsub.f CBLAS/src/cblas_csyr2k.c CBLAS/src/cblas_dtrsm.c CBLAS/src/cblas_stpsv.c \ CBLAS/src/ddotsub.f CBLAS/src/cblas_csyrk.c CBLAS/src/cblas_dtrsv.c CBLAS/src/cblas_strmm.c CBLAS/src/dnrm2sub.f \ CBLAS/src/cblas_ctbmv.c CBLAS/src/cblas_dzasum.c CBLAS/src/cblas_strmv.c CBLAS/src/dsdotsub.f CBLAS/src/cblas_ctbsv.c \ CBLAS/src/cblas_dznrm2.c CBLAS/src/cblas_strsm.c CBLAS/src/dzasumsub.f CBLAS/src/cblas_ctpmv.c CBLAS/src/cblas_f77.h \ CBLAS/src/cblas_strsv.c CBLAS/src/dznrm2sub.f CBLAS/src/cblas_ctpsv.c CBLAS/src/cblas_globals.c \ CBLAS/src/cblas_xerbla.c CBLAS/src/icamaxsub.f CBLAS/src/cblas_ctrmm.c CBLAS/src/cblas.h CBLAS/src/cblas_zaxpy.c \ CBLAS/src/idamaxsub.f CBLAS/src/cblas_ctrmv.c CBLAS/src/cblas_icamax.c CBLAS/src/cblas_zcopy.c CBLAS/src/isamaxsub.f \ CBLAS/src/cblas_ctrsm.c CBLAS/src/cblas_idamax.c CBLAS/src/cblas_zdotc_sub.c CBLAS/src/izamaxsub.f \ CBLAS/src/cblas_ctrsv.c CBLAS/src/cblas_isamax.c CBLAS/src/cblas_zdotu_sub.c CBLAS/src/Makefile CBLAS/src/cblas_dasum.c \ CBLAS/src/cblas_izamax.c CBLAS/src/cblas_zdscal.c CBLAS/src/sasumsub.f CBLAS/src/cblas_daxpy.c CBLAS/src/cblas_sasum.c \ CBLAS/src/cblas_zgbmv.c CBLAS/src/scasumsub.f CBLAS/src/cblas_dcopy.c CBLAS/src/cblas_saxpy.c CBLAS/src/cblas_zgemm.c \ CBLAS/src/scnrm2sub.f CBLAS/src/cblas_ddot.c CBLAS/src/cblas_scasum.c CBLAS/src/cblas_zgemv.c CBLAS/src/sdotsub.f \ CBLAS/src/cblas_dgbmv.c CBLAS/src/cblas_scnrm2.c CBLAS/src/cblas_zgerc.c CBLAS/src/sdsdotsub.f CBLAS/src/cblas_dgemm.c \ CBLAS/src/cblas_scopy.c CBLAS/src/cblas_zgeru.c CBLAS/src/snrm2sub.f CBLAS/src/cblas_dgemv.c CBLAS/src/cblas_sdot.c \ CBLAS/src/cblas_zhbmv.c CBLAS/src/xerbla.c CBLAS/src/cblas_dger.c CBLAS/src/cblas_sdsdot.c CBLAS/src/cblas_zhemm.c \ CBLAS/src/zdotcsub.f CBLAS/src/cblas_dnrm2.c CBLAS/src/cblas_sgbmv.c CBLAS/src/cblas_zhemv.c CBLAS/src/zdotusub.f nodist_libf77blas_a_SOURCES=$(F77BLAS_SOURCES) nodist_libcblas_a_SOURCES=$(CBLAS_SOURCES) BUILT_SOURCES=@DOWNLOADED_BLAS_BUILT_SOURCES@ # -ICBLAS/include to find cblas.h libcblas_a_CFLAGS=-DADD_ -ICBLAS/include # "xerbla" exists in both BLAS and CBLAS. So we need to rename it to obtain two different object files. BLAS:BLAS/fait BLAS/fait:$(BLAS_TGZ) mkdir -p ../include ../lib pxerbla=`tar tf $(BLAS_TGZ) | grep xerbla.f`; \ dirblas=`dirname $$pxerbla` ;\ case $$dirblas in \ BLAS) tar xvzf $(BLAS_TGZ) ;; \ BLAS-*) tar xvzf $(BLAS_TGZ) ; mv $$dirblas BLAS ;; \ .) mkdir -p BLAS; tar xvzf $(BLAS_TGZ) -c BLAS;; \ esac cp BLAS/xerbla.f blas_xerbla.f touch BLAS/fait $(F77BLAS_SOURCES): BLAS CBLAS:CBLAS/fait CBLAS/fait: $(CBLAS_TGZ) tar xvzf $(CBLAS_TGZ) cp CBLAS/include/*.h CBLAS/src touch CBLAS/fait $(CBLAS_SOURCES): CBLAS/fait clean-local:: -rm -r BLAS CBLAS blas_xerbla.f # <> ALH - 18/9/13 - Downloading and building the OpenBLAS # ------------------------------------------------------------------ # to activate this, see [[file:../../configure.ac::OpenBLAS]] all-local::@COMPILE_OPENBLAS@ pkgcompile::@COMPILE_OPENBLAS@ generic: openblas:install.done ../lib/WHERE.blas # The library may sometimes have a complex name with version number, just copy it into a standard location ../lib/WHERE.blas:install.done echo blas LD -L@DIR@/lib -lopenblas $(FLIBS)> $@ echo blas INCLUDE -I@DIR@/include >> $@ echo blaslapack LD -L@DIR@/lib -lopenblas $(FLIBS) > $@ echo blaslapack INCLUDE -I@DIR@/include >> $@ if FFCS_WINDOWS # links2files is required for the MinGW compiler to understand where to find the library contents under Cygwin links.done:openblas.done cd OpenBLAS && ../../../build/links2files touch $@ install.done:links.done cp OpenBLAS/libopenblas.a ../lib cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ CC=${CC} FC=${FC} NO_SHARED=1 DDYNAMIC_ARCH=1 PREFIX=../.. install touch $@ else install.done:openblas.done cp OpenBLAS/libopenblas.a ../lib cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ CC=${CC} FC=${FC} DYNAMIC_ARCH=1 NO_SHARED=1 PREFIX=../.. install touch $@ endif clean:: -rm ../lib/libopenblas.a openblas.done:openpatches.done # # DYNAMIC_ARCH=1 allows the Openblas to run fast on all the processor architectures that the FFCS users may have # test -d ../lib || mkdir ../lib cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ "CC=$(CC)" "FC=$(FC)" DYNAMIC_ARCH=1 NO_SHARED=1 "FLIBS=$(FLIBS)" libs netlib touch $@ # The OpenBLAS directory is updated during the compilation, so the patching step should not depend on the directory date openpatches.done:opendownload.done tar xvzf ../pkg/OpenBLAS.tar.gz # # ALH - 7/1/14 - The tar directory has changed names # mv xianyi-OpenBLAS-* OpenBLAS patch -u -p1 < openblas.patches touch $@ clean:: -rm *.done -rm -r OpenBLAS download::opendownload.done opendownload.done: ../getall -o OpenBLAS -a touch $@ # ALH - 6/11/13 - Since OpenBLAS is quite long to compile and it does not change very often, it's only cleaned as part of the specific # target 'veryclean'. veryclean:: -rm -r *.done OpenBLAS xianyi-OpenBLAS-* # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: freefem++-3.61-1/download/blas/openblas.patches000644 000767 000024 00000006547 13256636774 021543 0ustar00hechtstaff000000 000000 # -*- mode:diff;coding:raw-text; -*- diff -r -u ref/OpenBLAS/c_check OpenBLAS/c_check --- ref/OpenBLAS/c_check 2010-01-28 20:26:25.000000000 +0100 +++ OpenBLAS/c_check 2012-06-05 15:17:47.877934400 +0200 @@ -22,15 +22,16 @@ $cross_suffix = ""; -if ($ARGV[0] =~ /(.*)(-[.\d]+)/) { - if ($1 =~ /(.*-)(.*)/) { - $cross_suffix = $1; - } -} else { - if ($ARGV[0] =~ /(.*-)(.*)/) { - $cross_suffix = $1; - } -} +# FFCS - this test is broken when using full paths with dashes for compilers +#if ($ARGV[0] =~ /(.*)(-[.\d]+)/) { +# if ($1 =~ /(.*-)(.*)/) { +# $cross_suffix = $1; +# } +#} else { +# if ($ARGV[0] =~ /(.*-)(.*)/) { +# $cross_suffix = $1; +# } +#} $compiler = ""; $compiler = PGI if ($data =~ /COMPILER_PGI/); --- ref/OpenBLAS/Makefile.install 2017-02-23 17:40:19.000000000 +0100 +++ OpenBLAS/Makefile.install 2017-02-23 18:28:48.000000000 +0100 @@ -2,7 +2,7 @@ export GOTOBLAS_MAKEFILE = 1 -include $(TOPDIR)/Makefile.conf_last include ./Makefile.system - +install=../../../install-sh PREFIX ?= /opt/OpenBLAS OPENBLAS_INCLUDE_DIR := $(PREFIX)/include @@ -44,16 +44,16 @@ ifndef NO_LAPACKE @echo Copying LAPACKE header files to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) - @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke.h - @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_config.h - @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_mangling_with_flags.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_mangling.h - @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h + @-$(install) -m 644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke.h + @-$(install) -m 644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_config.h + @-$(install) -m 644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_mangling_with_flags.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_mangling.h + @-$(install) -m 644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h endif #for install static library ifndef NO_STATIC @echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) - @install -pm644 $(LIBNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) + @$(install) -m 644 $(LIBNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \ ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX) endif @@ -61,7 +61,7 @@ ifndef NO_SHARED @echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ifeq ($(OSNAME), Linux) - @install -pm755 $(LIBSONAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) + @$(install) -m755 $(LIBSONAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \ ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \ ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION) @@ -78,7 +78,7 @@ endif ifeq ($(OSNAME), Darwin) @-cp $(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) - @-install_name_tool -id $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) + @-$(install)_name_tool -id $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \ ln -fs $(LIBDYNNAME) $(LIBPREFIX).dylib endif freefem++-3.61-1/download/blas/Makefile.in000644 000767 000024 00001457733 13321623167 020425 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # Downloading and compiling extra BLAS libraries # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Downloading and compiling extra BLAS libraries" default=0 freefem make multipleauthors start=04/06/04 upmc # Common make rules for all downloaded packages (request from FH) # ====================================================================== # Written by Antoine Le Hyaric # http://www.ljll.math.upmc.fr/lehyaric # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # ====================================================================== # 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 # ====================================================================== # headeralh brief="Common make rules for all downloaded packages (request from FH)" default=0 freefem make start=06/11/2013 upmc written # Common goals for all packages: # download compile install reinstall clean veryclean # <> VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = download/blas ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libcblas_a_AR = $(AR) $(ARFLAGS) libcblas_a_LIBADD = am__objects_1 = libcblas_a-cblas_caxpy.$(OBJEXT) \ libcblas_a-cblas_drot.$(OBJEXT) \ libcblas_a-cblas_sgemm.$(OBJEXT) \ libcblas_a-cblas_zher2.$(OBJEXT) \ libcblas_a-cblas_ccopy.$(OBJEXT) \ libcblas_a-cblas_drotg.$(OBJEXT) \ libcblas_a-cblas_sgemv.$(OBJEXT) \ libcblas_a-cblas_zher2k.$(OBJEXT) \ libcblas_a-cblas_cdotc_sub.$(OBJEXT) \ libcblas_a-cblas_drotm.$(OBJEXT) \ libcblas_a-cblas_sger.$(OBJEXT) \ libcblas_a-cblas_zher.$(OBJEXT) \ libcblas_a-cblas_cdotu_sub.$(OBJEXT) \ libcblas_a-cblas_drotmg.$(OBJEXT) \ libcblas_a-cblas_snrm2.$(OBJEXT) \ libcblas_a-cblas_zherk.$(OBJEXT) \ libcblas_a-cblas_cgbmv.$(OBJEXT) \ libcblas_a-cblas_dsbmv.$(OBJEXT) \ libcblas_a-cblas_srot.$(OBJEXT) \ libcblas_a-cblas_zhpmv.$(OBJEXT) \ libcblas_a-cblas_cgemm.$(OBJEXT) \ libcblas_a-cblas_dscal.$(OBJEXT) \ libcblas_a-cblas_srotg.$(OBJEXT) \ libcblas_a-cblas_zhpr2.$(OBJEXT) \ libcblas_a-cblas_cgemv.$(OBJEXT) \ libcblas_a-cblas_dsdot.$(OBJEXT) \ libcblas_a-cblas_srotm.$(OBJEXT) \ libcblas_a-cblas_zhpr.$(OBJEXT) \ libcblas_a-cblas_cgerc.$(OBJEXT) \ libcblas_a-cblas_dspmv.$(OBJEXT) \ libcblas_a-cblas_srotmg.$(OBJEXT) \ libcblas_a-cblas_zscal.$(OBJEXT) \ libcblas_a-cblas_cgeru.$(OBJEXT) \ libcblas_a-cblas_dspr2.$(OBJEXT) \ libcblas_a-cblas_ssbmv.$(OBJEXT) \ libcblas_a-cblas_zswap.$(OBJEXT) \ libcblas_a-cblas_chbmv.$(OBJEXT) \ libcblas_a-cblas_dspr.$(OBJEXT) \ libcblas_a-cblas_sscal.$(OBJEXT) \ libcblas_a-cblas_zsymm.$(OBJEXT) \ libcblas_a-cblas_chemm.$(OBJEXT) \ libcblas_a-cblas_dswap.$(OBJEXT) \ libcblas_a-cblas_sspmv.$(OBJEXT) \ libcblas_a-cblas_zsyr2k.$(OBJEXT) \ libcblas_a-cblas_chemv.$(OBJEXT) \ libcblas_a-cblas_dsymm.$(OBJEXT) \ libcblas_a-cblas_sspr2.$(OBJEXT) \ libcblas_a-cblas_zsyrk.$(OBJEXT) \ libcblas_a-cblas_cher2.$(OBJEXT) \ libcblas_a-cblas_dsymv.$(OBJEXT) \ libcblas_a-cblas_sspr.$(OBJEXT) \ libcblas_a-cblas_ztbmv.$(OBJEXT) \ libcblas_a-cblas_cher2k.$(OBJEXT) \ libcblas_a-cblas_dsyr2.$(OBJEXT) \ libcblas_a-cblas_sswap.$(OBJEXT) \ libcblas_a-cblas_ztbsv.$(OBJEXT) \ libcblas_a-cblas_cher.$(OBJEXT) \ libcblas_a-cblas_dsyr2k.$(OBJEXT) \ libcblas_a-cblas_ssymm.$(OBJEXT) \ libcblas_a-cblas_ztpmv.$(OBJEXT) \ libcblas_a-cblas_cherk.$(OBJEXT) \ libcblas_a-cblas_dsyr.$(OBJEXT) \ libcblas_a-cblas_ssymv.$(OBJEXT) \ libcblas_a-cblas_ztpsv.$(OBJEXT) \ libcblas_a-cblas_chpmv.$(OBJEXT) \ libcblas_a-cblas_dsyrk.$(OBJEXT) \ libcblas_a-cblas_ssyr2.$(OBJEXT) \ libcblas_a-cblas_ztrmm.$(OBJEXT) \ libcblas_a-cblas_chpr2.$(OBJEXT) \ libcblas_a-cblas_dtbmv.$(OBJEXT) \ libcblas_a-cblas_ssyr2k.$(OBJEXT) \ libcblas_a-cblas_ztrmv.$(OBJEXT) \ libcblas_a-cblas_chpr.$(OBJEXT) \ libcblas_a-cblas_dtbsv.$(OBJEXT) \ libcblas_a-cblas_ssyr.$(OBJEXT) \ libcblas_a-cblas_ztrsm.$(OBJEXT) \ libcblas_a-cblas_cscal.$(OBJEXT) \ libcblas_a-cblas_dtpmv.$(OBJEXT) \ libcblas_a-cblas_ssyrk.$(OBJEXT) \ libcblas_a-cblas_ztrsv.$(OBJEXT) \ libcblas_a-cblas_csscal.$(OBJEXT) \ libcblas_a-cblas_dtpsv.$(OBJEXT) \ libcblas_a-cblas_stbmv.$(OBJEXT) cdotcsub.$(OBJEXT) \ libcblas_a-cblas_cswap.$(OBJEXT) \ libcblas_a-cblas_dtrmm.$(OBJEXT) \ libcblas_a-cblas_stbsv.$(OBJEXT) cdotusub.$(OBJEXT) \ libcblas_a-cblas_csymm.$(OBJEXT) \ libcblas_a-cblas_dtrmv.$(OBJEXT) \ libcblas_a-cblas_stpmv.$(OBJEXT) dasumsub.$(OBJEXT) \ libcblas_a-cblas_csyr2k.$(OBJEXT) \ libcblas_a-cblas_dtrsm.$(OBJEXT) \ libcblas_a-cblas_stpsv.$(OBJEXT) ddotsub.$(OBJEXT) \ libcblas_a-cblas_csyrk.$(OBJEXT) \ libcblas_a-cblas_dtrsv.$(OBJEXT) \ libcblas_a-cblas_strmm.$(OBJEXT) dnrm2sub.$(OBJEXT) \ libcblas_a-cblas_ctbmv.$(OBJEXT) \ libcblas_a-cblas_dzasum.$(OBJEXT) \ libcblas_a-cblas_strmv.$(OBJEXT) dsdotsub.$(OBJEXT) \ libcblas_a-cblas_ctbsv.$(OBJEXT) \ libcblas_a-cblas_dznrm2.$(OBJEXT) \ libcblas_a-cblas_strsm.$(OBJEXT) dzasumsub.$(OBJEXT) \ libcblas_a-cblas_ctpmv.$(OBJEXT) \ libcblas_a-cblas_strsv.$(OBJEXT) dznrm2sub.$(OBJEXT) \ libcblas_a-cblas_ctpsv.$(OBJEXT) \ libcblas_a-cblas_globals.$(OBJEXT) \ libcblas_a-cblas_xerbla.$(OBJEXT) icamaxsub.$(OBJEXT) \ libcblas_a-cblas_ctrmm.$(OBJEXT) \ libcblas_a-cblas_zaxpy.$(OBJEXT) idamaxsub.$(OBJEXT) \ libcblas_a-cblas_ctrmv.$(OBJEXT) \ libcblas_a-cblas_icamax.$(OBJEXT) \ libcblas_a-cblas_zcopy.$(OBJEXT) isamaxsub.$(OBJEXT) \ libcblas_a-cblas_ctrsm.$(OBJEXT) \ libcblas_a-cblas_idamax.$(OBJEXT) \ libcblas_a-cblas_zdotc_sub.$(OBJEXT) izamaxsub.$(OBJEXT) \ libcblas_a-cblas_ctrsv.$(OBJEXT) \ libcblas_a-cblas_isamax.$(OBJEXT) \ libcblas_a-cblas_zdotu_sub.$(OBJEXT) \ libcblas_a-cblas_dasum.$(OBJEXT) \ libcblas_a-cblas_izamax.$(OBJEXT) \ libcblas_a-cblas_zdscal.$(OBJEXT) sasumsub.$(OBJEXT) \ libcblas_a-cblas_daxpy.$(OBJEXT) \ libcblas_a-cblas_sasum.$(OBJEXT) \ libcblas_a-cblas_zgbmv.$(OBJEXT) scasumsub.$(OBJEXT) \ libcblas_a-cblas_dcopy.$(OBJEXT) \ libcblas_a-cblas_saxpy.$(OBJEXT) \ libcblas_a-cblas_zgemm.$(OBJEXT) scnrm2sub.$(OBJEXT) \ libcblas_a-cblas_ddot.$(OBJEXT) \ libcblas_a-cblas_scasum.$(OBJEXT) \ libcblas_a-cblas_zgemv.$(OBJEXT) sdotsub.$(OBJEXT) \ libcblas_a-cblas_dgbmv.$(OBJEXT) \ libcblas_a-cblas_scnrm2.$(OBJEXT) \ libcblas_a-cblas_zgerc.$(OBJEXT) sdsdotsub.$(OBJEXT) \ libcblas_a-cblas_dgemm.$(OBJEXT) \ libcblas_a-cblas_scopy.$(OBJEXT) \ libcblas_a-cblas_zgeru.$(OBJEXT) snrm2sub.$(OBJEXT) \ libcblas_a-cblas_dgemv.$(OBJEXT) \ libcblas_a-cblas_sdot.$(OBJEXT) \ libcblas_a-cblas_zhbmv.$(OBJEXT) libcblas_a-xerbla.$(OBJEXT) \ libcblas_a-cblas_dger.$(OBJEXT) \ libcblas_a-cblas_sdsdot.$(OBJEXT) \ libcblas_a-cblas_zhemm.$(OBJEXT) zdotcsub.$(OBJEXT) \ libcblas_a-cblas_dnrm2.$(OBJEXT) \ libcblas_a-cblas_sgbmv.$(OBJEXT) \ libcblas_a-cblas_zhemv.$(OBJEXT) zdotusub.$(OBJEXT) nodist_libcblas_a_OBJECTS = $(am__objects_1) libcblas_a_OBJECTS = $(nodist_libcblas_a_OBJECTS) libf77blas_a_AR = $(AR) $(ARFLAGS) libf77blas_a_LIBADD = am__objects_2 = caxpy.$(OBJEXT) crotg.$(OBJEXT) dcopy.$(OBJEXT) \ dsymv.$(OBJEXT) lsame.$(OBJEXT) sspmv.$(OBJEXT) \ zaxpy.$(OBJEXT) zhpr2.$(OBJEXT) ccopy.$(OBJEXT) \ cscal.$(OBJEXT) ddot.$(OBJEXT) dsyr2.$(OBJEXT) sasum.$(OBJEXT) \ sspr2.$(OBJEXT) zcopy.$(OBJEXT) zhpr.$(OBJEXT) cdotc.$(OBJEXT) \ csrot.$(OBJEXT) dgbmv.$(OBJEXT) dsyr2k.$(OBJEXT) \ saxpy.$(OBJEXT) sspr.$(OBJEXT) zdotc.$(OBJEXT) zrotg.$(OBJEXT) \ cdotu.$(OBJEXT) csscal.$(OBJEXT) dgemm.$(OBJEXT) \ dsyr.$(OBJEXT) scasum.$(OBJEXT) sswap.$(OBJEXT) \ zdotu.$(OBJEXT) zscal.$(OBJEXT) cgbmv.$(OBJEXT) \ cswap.$(OBJEXT) dgemv.$(OBJEXT) dsyrk.$(OBJEXT) \ scnrm2.$(OBJEXT) ssymm.$(OBJEXT) zdrot.$(OBJEXT) \ zswap.$(OBJEXT) cgemm.$(OBJEXT) csymm.$(OBJEXT) dger.$(OBJEXT) \ dtbmv.$(OBJEXT) scopy.$(OBJEXT) ssymv.$(OBJEXT) \ zdscal.$(OBJEXT) zsymm.$(OBJEXT) cgemv.$(OBJEXT) \ csyr2k.$(OBJEXT) dnrm2.$(OBJEXT) dtbsv.$(OBJEXT) \ sdot.$(OBJEXT) ssyr2.$(OBJEXT) zgbmv.$(OBJEXT) \ zsyr2k.$(OBJEXT) cgerc.$(OBJEXT) csyrk.$(OBJEXT) \ drot.$(OBJEXT) dtpmv.$(OBJEXT) sdsdot.$(OBJEXT) \ ssyr2k.$(OBJEXT) zgemm.$(OBJEXT) zsyrk.$(OBJEXT) \ cgeru.$(OBJEXT) ctbmv.$(OBJEXT) drotg.$(OBJEXT) \ dtpsv.$(OBJEXT) sgbmv.$(OBJEXT) ssyr.$(OBJEXT) zgemv.$(OBJEXT) \ ztbmv.$(OBJEXT) chbmv.$(OBJEXT) ctbsv.$(OBJEXT) \ drotm.$(OBJEXT) dtrmm.$(OBJEXT) sgemm.$(OBJEXT) \ ssyrk.$(OBJEXT) zgerc.$(OBJEXT) ztbsv.$(OBJEXT) \ chemm.$(OBJEXT) ctpmv.$(OBJEXT) drotmg.$(OBJEXT) \ dtrmv.$(OBJEXT) sgemv.$(OBJEXT) stbmv.$(OBJEXT) \ zgeru.$(OBJEXT) ztpmv.$(OBJEXT) chemv.$(OBJEXT) \ ctpsv.$(OBJEXT) dsbmv.$(OBJEXT) dtrsm.$(OBJEXT) sger.$(OBJEXT) \ stbsv.$(OBJEXT) zhbmv.$(OBJEXT) ztpsv.$(OBJEXT) \ cher2.$(OBJEXT) ctrmm.$(OBJEXT) dscal.$(OBJEXT) \ dtrsv.$(OBJEXT) snrm2.$(OBJEXT) stpmv.$(OBJEXT) \ zhemm.$(OBJEXT) ztrmm.$(OBJEXT) cher2k.$(OBJEXT) \ ctrmv.$(OBJEXT) dsdot.$(OBJEXT) dzasum.$(OBJEXT) \ srot.$(OBJEXT) stpsv.$(OBJEXT) zhemv.$(OBJEXT) ztrmv.$(OBJEXT) \ cher.$(OBJEXT) ctrsm.$(OBJEXT) dspmv.$(OBJEXT) \ dznrm2.$(OBJEXT) srotg.$(OBJEXT) strmm.$(OBJEXT) \ zher2.$(OBJEXT) ztrsm.$(OBJEXT) cherk.$(OBJEXT) \ ctrsv.$(OBJEXT) dspr2.$(OBJEXT) icamax.$(OBJEXT) \ srotm.$(OBJEXT) strmv.$(OBJEXT) zher2k.$(OBJEXT) \ ztrsv.$(OBJEXT) chpmv.$(OBJEXT) dasum.$(OBJEXT) dspr.$(OBJEXT) \ idamax.$(OBJEXT) srotmg.$(OBJEXT) strsm.$(OBJEXT) \ zher.$(OBJEXT) chpr2.$(OBJEXT) daxpy.$(OBJEXT) dswap.$(OBJEXT) \ isamax.$(OBJEXT) ssbmv.$(OBJEXT) strsv.$(OBJEXT) \ zherk.$(OBJEXT) chpr.$(OBJEXT) dcabs1.$(OBJEXT) \ dsymm.$(OBJEXT) izamax.$(OBJEXT) sscal.$(OBJEXT) \ blas_xerbla.$(OBJEXT) zhpmv.$(OBJEXT) nodist_libf77blas_a_OBJECTS = $(am__objects_2) libf77blas_a_OBJECTS = $(nodist_libf77blas_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) AM_V_F77 = $(am__v_F77_@AM_V@) am__v_F77_ = $(am__v_F77_@AM_DEFAULT_V@) am__v_F77_0 = @echo " F77 " $@; am__v_F77_1 = F77LD = $(F77) F77LINK = $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_F77LD = $(am__v_F77LD_@AM_V@) am__v_F77LD_ = $(am__v_F77LD_@AM_DEFAULT_V@) am__v_F77LD_0 = @echo " F77LD " $@; am__v_F77LD_1 = SOURCES = $(nodist_libcblas_a_SOURCES) $(nodist_libf77blas_a_SOURCES) DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/../common.mak $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DIRPKG = ../pkg BLAS_TGZ = $(DIRPKG)/blas-3.7.1.tgz CBLAS_TGZ = $(DIRPKG)/cblas.tgz PKGCOMMON_PACKTITLE = BLAS PKGCOMMON_PACKAGES = $(BLAS_TGZ) $(CBLAS_TGZ) ../pkg/OpenBLAS.tar.gz EXTRA_DIST = \ openblas.patches # Downloading and compiling the Generic Blas # ------------------------------------------ noinst_LIBRARIES = @DOWNLOADED_BLAS@ EXTRA_LIBRARIES = libf77blas.a libcblas.a # List of files to compile (do not list them in *_SOURCES to prevent them from being included in distributions). F77BLAS_SOURCES = BLAS/caxpy.f BLAS/crotg.f BLAS/dcopy.f BLAS/dsymv.f BLAS/lsame.f BLAS/sspmv.f BLAS/zaxpy.f BLAS/zhpr2.f \ BLAS/ccopy.f BLAS/cscal.f BLAS/ddot.f BLAS/dsyr2.f BLAS/sasum.f BLAS/sspr2.f BLAS/zcopy.f BLAS/zhpr.f BLAS/cdotc.f \ BLAS/csrot.f BLAS/dgbmv.f BLAS/dsyr2k.f BLAS/saxpy.f BLAS/sspr.f BLAS/zdotc.f BLAS/zrotg.f BLAS/cdotu.f BLAS/csscal.f \ BLAS/dgemm.f BLAS/dsyr.f BLAS/scasum.f BLAS/sswap.f BLAS/zdotu.f BLAS/zscal.f BLAS/cgbmv.f BLAS/cswap.f BLAS/dgemv.f \ BLAS/dsyrk.f BLAS/scnrm2.f BLAS/ssymm.f BLAS/zdrot.f BLAS/zswap.f BLAS/cgemm.f BLAS/csymm.f BLAS/dger.f BLAS/dtbmv.f \ BLAS/scopy.f BLAS/ssymv.f BLAS/zdscal.f BLAS/zsymm.f BLAS/cgemv.f BLAS/csyr2k.f BLAS/dnrm2.f BLAS/dtbsv.f BLAS/sdot.f \ BLAS/ssyr2.f BLAS/zgbmv.f BLAS/zsyr2k.f BLAS/cgerc.f BLAS/csyrk.f BLAS/drot.f BLAS/dtpmv.f BLAS/sdsdot.f BLAS/ssyr2k.f \ BLAS/zgemm.f BLAS/zsyrk.f BLAS/cgeru.f BLAS/ctbmv.f BLAS/drotg.f BLAS/dtpsv.f BLAS/sgbmv.f BLAS/ssyr.f BLAS/zgemv.f \ BLAS/ztbmv.f BLAS/chbmv.f BLAS/ctbsv.f BLAS/drotm.f BLAS/dtrmm.f BLAS/sgemm.f BLAS/ssyrk.f BLAS/zgerc.f BLAS/ztbsv.f \ BLAS/chemm.f BLAS/ctpmv.f BLAS/drotmg.f BLAS/dtrmv.f BLAS/sgemv.f BLAS/stbmv.f BLAS/zgeru.f BLAS/ztpmv.f BLAS/chemv.f \ BLAS/ctpsv.f BLAS/dsbmv.f BLAS/dtrsm.f BLAS/sger.f BLAS/stbsv.f BLAS/zhbmv.f BLAS/ztpsv.f BLAS/cher2.f BLAS/ctrmm.f \ BLAS/dscal.f BLAS/dtrsv.f BLAS/snrm2.f BLAS/stpmv.f BLAS/zhemm.f BLAS/ztrmm.f BLAS/cher2k.f BLAS/ctrmv.f BLAS/dsdot.f \ BLAS/dzasum.f BLAS/srot.f BLAS/stpsv.f BLAS/zhemv.f BLAS/ztrmv.f BLAS/cher.f BLAS/ctrsm.f BLAS/dspmv.f BLAS/dznrm2.f \ BLAS/srotg.f BLAS/strmm.f BLAS/zher2.f BLAS/ztrsm.f BLAS/cherk.f BLAS/ctrsv.f BLAS/dspr2.f BLAS/icamax.f BLAS/srotm.f \ BLAS/strmv.f BLAS/zher2k.f BLAS/ztrsv.f BLAS/chpmv.f BLAS/dasum.f BLAS/dspr.f BLAS/idamax.f BLAS/srotmg.f BLAS/strsm.f \ BLAS/zher.f BLAS/chpr2.f BLAS/daxpy.f BLAS/dswap.f BLAS/isamax.f BLAS/ssbmv.f BLAS/strsv.f BLAS/zherk.f BLAS/chpr.f \ BLAS/dcabs1.f BLAS/dsymm.f BLAS/izamax.f BLAS/sscal.f blas_xerbla.f BLAS/zhpmv.f CBLAS_SOURCES = CBLAS/src/cblas_caxpy.c CBLAS/src/cblas_drot.c CBLAS/src/cblas_sgemm.c CBLAS/src/cblas_zher2.c \ CBLAS/src/cblas_ccopy.c CBLAS/src/cblas_drotg.c CBLAS/src/cblas_sgemv.c CBLAS/src/cblas_zher2k.c \ CBLAS/src/cblas_cdotc_sub.c CBLAS/src/cblas_drotm.c CBLAS/src/cblas_sger.c CBLAS/src/cblas_zher.c \ CBLAS/src/cblas_cdotu_sub.c CBLAS/src/cblas_drotmg.c CBLAS/src/cblas_snrm2.c CBLAS/src/cblas_zherk.c \ CBLAS/src/cblas_cgbmv.c CBLAS/src/cblas_dsbmv.c CBLAS/src/cblas_srot.c CBLAS/src/cblas_zhpmv.c CBLAS/src/cblas_cgemm.c \ CBLAS/src/cblas_dscal.c CBLAS/src/cblas_srotg.c CBLAS/src/cblas_zhpr2.c CBLAS/src/cblas_cgemv.c CBLAS/src/cblas_dsdot.c \ CBLAS/src/cblas_srotm.c CBLAS/src/cblas_zhpr.c CBLAS/src/cblas_cgerc.c CBLAS/src/cblas_dspmv.c CBLAS/src/cblas_srotmg.c \ CBLAS/src/cblas_zscal.c CBLAS/src/cblas_cgeru.c CBLAS/src/cblas_dspr2.c CBLAS/src/cblas_ssbmv.c CBLAS/src/cblas_zswap.c \ CBLAS/src/cblas_chbmv.c CBLAS/src/cblas_dspr.c CBLAS/src/cblas_sscal.c CBLAS/src/cblas_zsymm.c CBLAS/src/cblas_chemm.c \ CBLAS/src/cblas_dswap.c CBLAS/src/cblas_sspmv.c CBLAS/src/cblas_zsyr2k.c CBLAS/src/cblas_chemv.c \ CBLAS/src/cblas_dsymm.c CBLAS/src/cblas_sspr2.c CBLAS/src/cblas_zsyrk.c CBLAS/src/cblas_cher2.c CBLAS/src/cblas_dsymv.c \ CBLAS/src/cblas_sspr.c CBLAS/src/cblas_ztbmv.c CBLAS/src/cblas_cher2k.c CBLAS/src/cblas_dsyr2.c CBLAS/src/cblas_sswap.c \ CBLAS/src/cblas_ztbsv.c CBLAS/src/cblas_cher.c CBLAS/src/cblas_dsyr2k.c CBLAS/src/cblas_ssymm.c CBLAS/src/cblas_ztpmv.c \ CBLAS/src/cblas_cherk.c CBLAS/src/cblas_dsyr.c CBLAS/src/cblas_ssymv.c CBLAS/src/cblas_ztpsv.c CBLAS/src/cblas_chpmv.c \ CBLAS/src/cblas_dsyrk.c CBLAS/src/cblas_ssyr2.c CBLAS/src/cblas_ztrmm.c CBLAS/src/cblas_chpr2.c CBLAS/src/cblas_dtbmv.c \ CBLAS/src/cblas_ssyr2k.c CBLAS/src/cblas_ztrmv.c CBLAS/src/cblas_chpr.c CBLAS/src/cblas_dtbsv.c CBLAS/src/cblas_ssyr.c \ CBLAS/src/cblas_ztrsm.c CBLAS/src/cblas_cscal.c CBLAS/src/cblas_dtpmv.c CBLAS/src/cblas_ssyrk.c CBLAS/src/cblas_ztrsv.c \ CBLAS/src/cblas_csscal.c CBLAS/src/cblas_dtpsv.c CBLAS/src/cblas_stbmv.c CBLAS/src/cdotcsub.f CBLAS/src/cblas_cswap.c \ CBLAS/src/cblas_dtrmm.c CBLAS/src/cblas_stbsv.c CBLAS/src/cdotusub.f CBLAS/src/cblas_csymm.c CBLAS/src/cblas_dtrmv.c \ CBLAS/src/cblas_stpmv.c CBLAS/src/dasumsub.f CBLAS/src/cblas_csyr2k.c CBLAS/src/cblas_dtrsm.c CBLAS/src/cblas_stpsv.c \ CBLAS/src/ddotsub.f CBLAS/src/cblas_csyrk.c CBLAS/src/cblas_dtrsv.c CBLAS/src/cblas_strmm.c CBLAS/src/dnrm2sub.f \ CBLAS/src/cblas_ctbmv.c CBLAS/src/cblas_dzasum.c CBLAS/src/cblas_strmv.c CBLAS/src/dsdotsub.f CBLAS/src/cblas_ctbsv.c \ CBLAS/src/cblas_dznrm2.c CBLAS/src/cblas_strsm.c CBLAS/src/dzasumsub.f CBLAS/src/cblas_ctpmv.c CBLAS/src/cblas_f77.h \ CBLAS/src/cblas_strsv.c CBLAS/src/dznrm2sub.f CBLAS/src/cblas_ctpsv.c CBLAS/src/cblas_globals.c \ CBLAS/src/cblas_xerbla.c CBLAS/src/icamaxsub.f CBLAS/src/cblas_ctrmm.c CBLAS/src/cblas.h CBLAS/src/cblas_zaxpy.c \ CBLAS/src/idamaxsub.f CBLAS/src/cblas_ctrmv.c CBLAS/src/cblas_icamax.c CBLAS/src/cblas_zcopy.c CBLAS/src/isamaxsub.f \ CBLAS/src/cblas_ctrsm.c CBLAS/src/cblas_idamax.c CBLAS/src/cblas_zdotc_sub.c CBLAS/src/izamaxsub.f \ CBLAS/src/cblas_ctrsv.c CBLAS/src/cblas_isamax.c CBLAS/src/cblas_zdotu_sub.c CBLAS/src/Makefile CBLAS/src/cblas_dasum.c \ CBLAS/src/cblas_izamax.c CBLAS/src/cblas_zdscal.c CBLAS/src/sasumsub.f CBLAS/src/cblas_daxpy.c CBLAS/src/cblas_sasum.c \ CBLAS/src/cblas_zgbmv.c CBLAS/src/scasumsub.f CBLAS/src/cblas_dcopy.c CBLAS/src/cblas_saxpy.c CBLAS/src/cblas_zgemm.c \ CBLAS/src/scnrm2sub.f CBLAS/src/cblas_ddot.c CBLAS/src/cblas_scasum.c CBLAS/src/cblas_zgemv.c CBLAS/src/sdotsub.f \ CBLAS/src/cblas_dgbmv.c CBLAS/src/cblas_scnrm2.c CBLAS/src/cblas_zgerc.c CBLAS/src/sdsdotsub.f CBLAS/src/cblas_dgemm.c \ CBLAS/src/cblas_scopy.c CBLAS/src/cblas_zgeru.c CBLAS/src/snrm2sub.f CBLAS/src/cblas_dgemv.c CBLAS/src/cblas_sdot.c \ CBLAS/src/cblas_zhbmv.c CBLAS/src/xerbla.c CBLAS/src/cblas_dger.c CBLAS/src/cblas_sdsdot.c CBLAS/src/cblas_zhemm.c \ CBLAS/src/zdotcsub.f CBLAS/src/cblas_dnrm2.c CBLAS/src/cblas_sgbmv.c CBLAS/src/cblas_zhemv.c CBLAS/src/zdotusub.f nodist_libf77blas_a_SOURCES = $(F77BLAS_SOURCES) nodist_libcblas_a_SOURCES = $(CBLAS_SOURCES) BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ # -ICBLAS/include to find cblas.h libcblas_a_CFLAGS = -DADD_ -ICBLAS/include all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .f .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../common.mak $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu download/blas/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu download/blas/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; $(srcdir)/../common.mak $(am__empty): $(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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcblas.a: $(libcblas_a_OBJECTS) $(libcblas_a_DEPENDENCIES) $(EXTRA_libcblas_a_DEPENDENCIES) $(AM_V_at)-rm -f libcblas.a $(AM_V_AR)$(libcblas_a_AR) libcblas.a $(libcblas_a_OBJECTS) $(libcblas_a_LIBADD) $(AM_V_at)$(RANLIB) libcblas.a libf77blas.a: $(libf77blas_a_OBJECTS) $(libf77blas_a_DEPENDENCIES) $(EXTRA_libf77blas_a_DEPENDENCIES) $(AM_V_at)-rm -f libf77blas.a $(AM_V_AR)$(libf77blas_a_AR) libf77blas.a $(libf77blas_a_OBJECTS) $(libf77blas_a_LIBADD) $(AM_V_at)$(RANLIB) libf77blas.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_caxpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ccopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cdotc_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cdotu_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cgbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cgemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cgemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cgerc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cgeru.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cher.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cher2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cher2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cherk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chpr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_chpr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_csscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_cswap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_csymm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_csyr2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_csyrk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctbsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctpsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctrmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctrmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctrsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ctrsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dasum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_daxpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ddot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dgbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dgemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dgemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dnrm2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_drot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_drotg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_drotm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_drotmg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsdot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dspmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dspr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dspr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dswap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsymm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsymv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsyr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsyr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsyr2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dsyrk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtbsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtpsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtrmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtrmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtrsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dtrsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dzasum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_dznrm2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_globals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_icamax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_idamax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_isamax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_izamax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sasum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_saxpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_scasum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_scnrm2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_scopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sdot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sdsdot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sgbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sgemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sgemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_snrm2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_srot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_srotg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_srotm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_srotmg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sspmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sspr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sspr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_sswap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssymm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssymv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssyr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssyr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssyr2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ssyrk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_stbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_stbsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_stpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_stpsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_strmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_strmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_strsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_strsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_xerbla.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zaxpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zdotc_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zdotu_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zdscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zgbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zgemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zgemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zgerc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zgeru.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhemm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhemv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zher.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zher2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zher2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zherk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhpr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zhpr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zswap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zsymm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zsyr2k.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_zsyrk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztbmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztbsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztpmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztpsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztrmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztrmv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztrsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-cblas_ztrsv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcblas_a-xerbla.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libcblas_a-cblas_caxpy.o: CBLAS/src/cblas_caxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_caxpy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_caxpy.Tpo -c -o libcblas_a-cblas_caxpy.o `test -f 'CBLAS/src/cblas_caxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_caxpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_caxpy.Tpo $(DEPDIR)/libcblas_a-cblas_caxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_caxpy.c' object='libcblas_a-cblas_caxpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_caxpy.o `test -f 'CBLAS/src/cblas_caxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_caxpy.c libcblas_a-cblas_caxpy.obj: CBLAS/src/cblas_caxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_caxpy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_caxpy.Tpo -c -o libcblas_a-cblas_caxpy.obj `if test -f 'CBLAS/src/cblas_caxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_caxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_caxpy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_caxpy.Tpo $(DEPDIR)/libcblas_a-cblas_caxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_caxpy.c' object='libcblas_a-cblas_caxpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_caxpy.obj `if test -f 'CBLAS/src/cblas_caxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_caxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_caxpy.c'; fi` libcblas_a-cblas_drot.o: CBLAS/src/cblas_drot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drot.Tpo -c -o libcblas_a-cblas_drot.o `test -f 'CBLAS/src/cblas_drot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drot.Tpo $(DEPDIR)/libcblas_a-cblas_drot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drot.c' object='libcblas_a-cblas_drot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drot.o `test -f 'CBLAS/src/cblas_drot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drot.c libcblas_a-cblas_drot.obj: CBLAS/src/cblas_drot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drot.Tpo -c -o libcblas_a-cblas_drot.obj `if test -f 'CBLAS/src/cblas_drot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drot.Tpo $(DEPDIR)/libcblas_a-cblas_drot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drot.c' object='libcblas_a-cblas_drot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drot.obj `if test -f 'CBLAS/src/cblas_drot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drot.c'; fi` libcblas_a-cblas_sgemm.o: CBLAS/src/cblas_sgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgemm.Tpo -c -o libcblas_a-cblas_sgemm.o `test -f 'CBLAS/src/cblas_sgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgemm.Tpo $(DEPDIR)/libcblas_a-cblas_sgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgemm.c' object='libcblas_a-cblas_sgemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgemm.o `test -f 'CBLAS/src/cblas_sgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgemm.c libcblas_a-cblas_sgemm.obj: CBLAS/src/cblas_sgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgemm.Tpo -c -o libcblas_a-cblas_sgemm.obj `if test -f 'CBLAS/src/cblas_sgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgemm.Tpo $(DEPDIR)/libcblas_a-cblas_sgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgemm.c' object='libcblas_a-cblas_sgemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgemm.obj `if test -f 'CBLAS/src/cblas_sgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgemm.c'; fi` libcblas_a-cblas_zher2.o: CBLAS/src/cblas_zher2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher2.Tpo -c -o libcblas_a-cblas_zher2.o `test -f 'CBLAS/src/cblas_zher2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher2.Tpo $(DEPDIR)/libcblas_a-cblas_zher2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher2.c' object='libcblas_a-cblas_zher2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher2.o `test -f 'CBLAS/src/cblas_zher2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher2.c libcblas_a-cblas_zher2.obj: CBLAS/src/cblas_zher2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher2.Tpo -c -o libcblas_a-cblas_zher2.obj `if test -f 'CBLAS/src/cblas_zher2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher2.Tpo $(DEPDIR)/libcblas_a-cblas_zher2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher2.c' object='libcblas_a-cblas_zher2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher2.obj `if test -f 'CBLAS/src/cblas_zher2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher2.c'; fi` libcblas_a-cblas_ccopy.o: CBLAS/src/cblas_ccopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ccopy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ccopy.Tpo -c -o libcblas_a-cblas_ccopy.o `test -f 'CBLAS/src/cblas_ccopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ccopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ccopy.Tpo $(DEPDIR)/libcblas_a-cblas_ccopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ccopy.c' object='libcblas_a-cblas_ccopy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ccopy.o `test -f 'CBLAS/src/cblas_ccopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ccopy.c libcblas_a-cblas_ccopy.obj: CBLAS/src/cblas_ccopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ccopy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ccopy.Tpo -c -o libcblas_a-cblas_ccopy.obj `if test -f 'CBLAS/src/cblas_ccopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ccopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ccopy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ccopy.Tpo $(DEPDIR)/libcblas_a-cblas_ccopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ccopy.c' object='libcblas_a-cblas_ccopy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ccopy.obj `if test -f 'CBLAS/src/cblas_ccopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ccopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ccopy.c'; fi` libcblas_a-cblas_drotg.o: CBLAS/src/cblas_drotg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotg.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotg.Tpo -c -o libcblas_a-cblas_drotg.o `test -f 'CBLAS/src/cblas_drotg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotg.Tpo $(DEPDIR)/libcblas_a-cblas_drotg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotg.c' object='libcblas_a-cblas_drotg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotg.o `test -f 'CBLAS/src/cblas_drotg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotg.c libcblas_a-cblas_drotg.obj: CBLAS/src/cblas_drotg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotg.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotg.Tpo -c -o libcblas_a-cblas_drotg.obj `if test -f 'CBLAS/src/cblas_drotg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotg.Tpo $(DEPDIR)/libcblas_a-cblas_drotg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotg.c' object='libcblas_a-cblas_drotg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotg.obj `if test -f 'CBLAS/src/cblas_drotg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotg.c'; fi` libcblas_a-cblas_sgemv.o: CBLAS/src/cblas_sgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgemv.Tpo -c -o libcblas_a-cblas_sgemv.o `test -f 'CBLAS/src/cblas_sgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgemv.Tpo $(DEPDIR)/libcblas_a-cblas_sgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgemv.c' object='libcblas_a-cblas_sgemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgemv.o `test -f 'CBLAS/src/cblas_sgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgemv.c libcblas_a-cblas_sgemv.obj: CBLAS/src/cblas_sgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgemv.Tpo -c -o libcblas_a-cblas_sgemv.obj `if test -f 'CBLAS/src/cblas_sgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgemv.Tpo $(DEPDIR)/libcblas_a-cblas_sgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgemv.c' object='libcblas_a-cblas_sgemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgemv.obj `if test -f 'CBLAS/src/cblas_sgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgemv.c'; fi` libcblas_a-cblas_zher2k.o: CBLAS/src/cblas_zher2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher2k.Tpo -c -o libcblas_a-cblas_zher2k.o `test -f 'CBLAS/src/cblas_zher2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher2k.Tpo $(DEPDIR)/libcblas_a-cblas_zher2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher2k.c' object='libcblas_a-cblas_zher2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher2k.o `test -f 'CBLAS/src/cblas_zher2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher2k.c libcblas_a-cblas_zher2k.obj: CBLAS/src/cblas_zher2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher2k.Tpo -c -o libcblas_a-cblas_zher2k.obj `if test -f 'CBLAS/src/cblas_zher2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher2k.Tpo $(DEPDIR)/libcblas_a-cblas_zher2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher2k.c' object='libcblas_a-cblas_zher2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher2k.obj `if test -f 'CBLAS/src/cblas_zher2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher2k.c'; fi` libcblas_a-cblas_cdotc_sub.o: CBLAS/src/cblas_cdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cdotc_sub.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Tpo -c -o libcblas_a-cblas_cdotc_sub.o `test -f 'CBLAS/src/cblas_cdotc_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Tpo $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cdotc_sub.c' object='libcblas_a-cblas_cdotc_sub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cdotc_sub.o `test -f 'CBLAS/src/cblas_cdotc_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cdotc_sub.c libcblas_a-cblas_cdotc_sub.obj: CBLAS/src/cblas_cdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cdotc_sub.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Tpo -c -o libcblas_a-cblas_cdotc_sub.obj `if test -f 'CBLAS/src/cblas_cdotc_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cdotc_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cdotc_sub.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Tpo $(DEPDIR)/libcblas_a-cblas_cdotc_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cdotc_sub.c' object='libcblas_a-cblas_cdotc_sub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cdotc_sub.obj `if test -f 'CBLAS/src/cblas_cdotc_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cdotc_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cdotc_sub.c'; fi` libcblas_a-cblas_drotm.o: CBLAS/src/cblas_drotm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotm.Tpo -c -o libcblas_a-cblas_drotm.o `test -f 'CBLAS/src/cblas_drotm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotm.Tpo $(DEPDIR)/libcblas_a-cblas_drotm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotm.c' object='libcblas_a-cblas_drotm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotm.o `test -f 'CBLAS/src/cblas_drotm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotm.c libcblas_a-cblas_drotm.obj: CBLAS/src/cblas_drotm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotm.Tpo -c -o libcblas_a-cblas_drotm.obj `if test -f 'CBLAS/src/cblas_drotm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotm.Tpo $(DEPDIR)/libcblas_a-cblas_drotm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotm.c' object='libcblas_a-cblas_drotm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotm.obj `if test -f 'CBLAS/src/cblas_drotm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotm.c'; fi` libcblas_a-cblas_sger.o: CBLAS/src/cblas_sger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sger.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sger.Tpo -c -o libcblas_a-cblas_sger.o `test -f 'CBLAS/src/cblas_sger.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sger.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sger.Tpo $(DEPDIR)/libcblas_a-cblas_sger.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sger.c' object='libcblas_a-cblas_sger.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sger.o `test -f 'CBLAS/src/cblas_sger.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sger.c libcblas_a-cblas_sger.obj: CBLAS/src/cblas_sger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sger.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sger.Tpo -c -o libcblas_a-cblas_sger.obj `if test -f 'CBLAS/src/cblas_sger.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sger.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sger.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sger.Tpo $(DEPDIR)/libcblas_a-cblas_sger.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sger.c' object='libcblas_a-cblas_sger.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sger.obj `if test -f 'CBLAS/src/cblas_sger.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sger.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sger.c'; fi` libcblas_a-cblas_zher.o: CBLAS/src/cblas_zher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher.Tpo -c -o libcblas_a-cblas_zher.o `test -f 'CBLAS/src/cblas_zher.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher.Tpo $(DEPDIR)/libcblas_a-cblas_zher.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher.c' object='libcblas_a-cblas_zher.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher.o `test -f 'CBLAS/src/cblas_zher.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zher.c libcblas_a-cblas_zher.obj: CBLAS/src/cblas_zher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zher.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zher.Tpo -c -o libcblas_a-cblas_zher.obj `if test -f 'CBLAS/src/cblas_zher.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zher.Tpo $(DEPDIR)/libcblas_a-cblas_zher.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zher.c' object='libcblas_a-cblas_zher.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zher.obj `if test -f 'CBLAS/src/cblas_zher.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zher.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zher.c'; fi` libcblas_a-cblas_cdotu_sub.o: CBLAS/src/cblas_cdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cdotu_sub.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Tpo -c -o libcblas_a-cblas_cdotu_sub.o `test -f 'CBLAS/src/cblas_cdotu_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Tpo $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cdotu_sub.c' object='libcblas_a-cblas_cdotu_sub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cdotu_sub.o `test -f 'CBLAS/src/cblas_cdotu_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cdotu_sub.c libcblas_a-cblas_cdotu_sub.obj: CBLAS/src/cblas_cdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cdotu_sub.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Tpo -c -o libcblas_a-cblas_cdotu_sub.obj `if test -f 'CBLAS/src/cblas_cdotu_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cdotu_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cdotu_sub.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Tpo $(DEPDIR)/libcblas_a-cblas_cdotu_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cdotu_sub.c' object='libcblas_a-cblas_cdotu_sub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cdotu_sub.obj `if test -f 'CBLAS/src/cblas_cdotu_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cdotu_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cdotu_sub.c'; fi` libcblas_a-cblas_drotmg.o: CBLAS/src/cblas_drotmg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotmg.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotmg.Tpo -c -o libcblas_a-cblas_drotmg.o `test -f 'CBLAS/src/cblas_drotmg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotmg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotmg.Tpo $(DEPDIR)/libcblas_a-cblas_drotmg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotmg.c' object='libcblas_a-cblas_drotmg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotmg.o `test -f 'CBLAS/src/cblas_drotmg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_drotmg.c libcblas_a-cblas_drotmg.obj: CBLAS/src/cblas_drotmg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_drotmg.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_drotmg.Tpo -c -o libcblas_a-cblas_drotmg.obj `if test -f 'CBLAS/src/cblas_drotmg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotmg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotmg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_drotmg.Tpo $(DEPDIR)/libcblas_a-cblas_drotmg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_drotmg.c' object='libcblas_a-cblas_drotmg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_drotmg.obj `if test -f 'CBLAS/src/cblas_drotmg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_drotmg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_drotmg.c'; fi` libcblas_a-cblas_snrm2.o: CBLAS/src/cblas_snrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_snrm2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_snrm2.Tpo -c -o libcblas_a-cblas_snrm2.o `test -f 'CBLAS/src/cblas_snrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_snrm2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_snrm2.Tpo $(DEPDIR)/libcblas_a-cblas_snrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_snrm2.c' object='libcblas_a-cblas_snrm2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_snrm2.o `test -f 'CBLAS/src/cblas_snrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_snrm2.c libcblas_a-cblas_snrm2.obj: CBLAS/src/cblas_snrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_snrm2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_snrm2.Tpo -c -o libcblas_a-cblas_snrm2.obj `if test -f 'CBLAS/src/cblas_snrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_snrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_snrm2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_snrm2.Tpo $(DEPDIR)/libcblas_a-cblas_snrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_snrm2.c' object='libcblas_a-cblas_snrm2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_snrm2.obj `if test -f 'CBLAS/src/cblas_snrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_snrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_snrm2.c'; fi` libcblas_a-cblas_zherk.o: CBLAS/src/cblas_zherk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zherk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zherk.Tpo -c -o libcblas_a-cblas_zherk.o `test -f 'CBLAS/src/cblas_zherk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zherk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zherk.Tpo $(DEPDIR)/libcblas_a-cblas_zherk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zherk.c' object='libcblas_a-cblas_zherk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zherk.o `test -f 'CBLAS/src/cblas_zherk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zherk.c libcblas_a-cblas_zherk.obj: CBLAS/src/cblas_zherk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zherk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zherk.Tpo -c -o libcblas_a-cblas_zherk.obj `if test -f 'CBLAS/src/cblas_zherk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zherk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zherk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zherk.Tpo $(DEPDIR)/libcblas_a-cblas_zherk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zherk.c' object='libcblas_a-cblas_zherk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zherk.obj `if test -f 'CBLAS/src/cblas_zherk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zherk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zherk.c'; fi` libcblas_a-cblas_cgbmv.o: CBLAS/src/cblas_cgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgbmv.Tpo -c -o libcblas_a-cblas_cgbmv.o `test -f 'CBLAS/src/cblas_cgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_cgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgbmv.c' object='libcblas_a-cblas_cgbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgbmv.o `test -f 'CBLAS/src/cblas_cgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgbmv.c libcblas_a-cblas_cgbmv.obj: CBLAS/src/cblas_cgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgbmv.Tpo -c -o libcblas_a-cblas_cgbmv.obj `if test -f 'CBLAS/src/cblas_cgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_cgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgbmv.c' object='libcblas_a-cblas_cgbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgbmv.obj `if test -f 'CBLAS/src/cblas_cgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgbmv.c'; fi` libcblas_a-cblas_dsbmv.o: CBLAS/src/cblas_dsbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsbmv.Tpo -c -o libcblas_a-cblas_dsbmv.o `test -f 'CBLAS/src/cblas_dsbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dsbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsbmv.c' object='libcblas_a-cblas_dsbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsbmv.o `test -f 'CBLAS/src/cblas_dsbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsbmv.c libcblas_a-cblas_dsbmv.obj: CBLAS/src/cblas_dsbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsbmv.Tpo -c -o libcblas_a-cblas_dsbmv.obj `if test -f 'CBLAS/src/cblas_dsbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dsbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsbmv.c' object='libcblas_a-cblas_dsbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsbmv.obj `if test -f 'CBLAS/src/cblas_dsbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsbmv.c'; fi` libcblas_a-cblas_srot.o: CBLAS/src/cblas_srot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srot.Tpo -c -o libcblas_a-cblas_srot.o `test -f 'CBLAS/src/cblas_srot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srot.Tpo $(DEPDIR)/libcblas_a-cblas_srot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srot.c' object='libcblas_a-cblas_srot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srot.o `test -f 'CBLAS/src/cblas_srot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srot.c libcblas_a-cblas_srot.obj: CBLAS/src/cblas_srot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srot.Tpo -c -o libcblas_a-cblas_srot.obj `if test -f 'CBLAS/src/cblas_srot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srot.Tpo $(DEPDIR)/libcblas_a-cblas_srot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srot.c' object='libcblas_a-cblas_srot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srot.obj `if test -f 'CBLAS/src/cblas_srot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srot.c'; fi` libcblas_a-cblas_zhpmv.o: CBLAS/src/cblas_zhpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpmv.Tpo -c -o libcblas_a-cblas_zhpmv.o `test -f 'CBLAS/src/cblas_zhpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpmv.Tpo $(DEPDIR)/libcblas_a-cblas_zhpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpmv.c' object='libcblas_a-cblas_zhpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpmv.o `test -f 'CBLAS/src/cblas_zhpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpmv.c libcblas_a-cblas_zhpmv.obj: CBLAS/src/cblas_zhpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpmv.Tpo -c -o libcblas_a-cblas_zhpmv.obj `if test -f 'CBLAS/src/cblas_zhpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpmv.Tpo $(DEPDIR)/libcblas_a-cblas_zhpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpmv.c' object='libcblas_a-cblas_zhpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpmv.obj `if test -f 'CBLAS/src/cblas_zhpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpmv.c'; fi` libcblas_a-cblas_cgemm.o: CBLAS/src/cblas_cgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgemm.Tpo -c -o libcblas_a-cblas_cgemm.o `test -f 'CBLAS/src/cblas_cgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgemm.Tpo $(DEPDIR)/libcblas_a-cblas_cgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgemm.c' object='libcblas_a-cblas_cgemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgemm.o `test -f 'CBLAS/src/cblas_cgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgemm.c libcblas_a-cblas_cgemm.obj: CBLAS/src/cblas_cgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgemm.Tpo -c -o libcblas_a-cblas_cgemm.obj `if test -f 'CBLAS/src/cblas_cgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgemm.Tpo $(DEPDIR)/libcblas_a-cblas_cgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgemm.c' object='libcblas_a-cblas_cgemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgemm.obj `if test -f 'CBLAS/src/cblas_cgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgemm.c'; fi` libcblas_a-cblas_dscal.o: CBLAS/src/cblas_dscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dscal.Tpo -c -o libcblas_a-cblas_dscal.o `test -f 'CBLAS/src/cblas_dscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dscal.Tpo $(DEPDIR)/libcblas_a-cblas_dscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dscal.c' object='libcblas_a-cblas_dscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dscal.o `test -f 'CBLAS/src/cblas_dscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dscal.c libcblas_a-cblas_dscal.obj: CBLAS/src/cblas_dscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dscal.Tpo -c -o libcblas_a-cblas_dscal.obj `if test -f 'CBLAS/src/cblas_dscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dscal.Tpo $(DEPDIR)/libcblas_a-cblas_dscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dscal.c' object='libcblas_a-cblas_dscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dscal.obj `if test -f 'CBLAS/src/cblas_dscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dscal.c'; fi` libcblas_a-cblas_srotg.o: CBLAS/src/cblas_srotg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotg.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotg.Tpo -c -o libcblas_a-cblas_srotg.o `test -f 'CBLAS/src/cblas_srotg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotg.Tpo $(DEPDIR)/libcblas_a-cblas_srotg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotg.c' object='libcblas_a-cblas_srotg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotg.o `test -f 'CBLAS/src/cblas_srotg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotg.c libcblas_a-cblas_srotg.obj: CBLAS/src/cblas_srotg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotg.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotg.Tpo -c -o libcblas_a-cblas_srotg.obj `if test -f 'CBLAS/src/cblas_srotg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotg.Tpo $(DEPDIR)/libcblas_a-cblas_srotg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotg.c' object='libcblas_a-cblas_srotg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotg.obj `if test -f 'CBLAS/src/cblas_srotg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotg.c'; fi` libcblas_a-cblas_zhpr2.o: CBLAS/src/cblas_zhpr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpr2.Tpo -c -o libcblas_a-cblas_zhpr2.o `test -f 'CBLAS/src/cblas_zhpr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpr2.Tpo $(DEPDIR)/libcblas_a-cblas_zhpr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpr2.c' object='libcblas_a-cblas_zhpr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpr2.o `test -f 'CBLAS/src/cblas_zhpr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpr2.c libcblas_a-cblas_zhpr2.obj: CBLAS/src/cblas_zhpr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpr2.Tpo -c -o libcblas_a-cblas_zhpr2.obj `if test -f 'CBLAS/src/cblas_zhpr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpr2.Tpo $(DEPDIR)/libcblas_a-cblas_zhpr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpr2.c' object='libcblas_a-cblas_zhpr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpr2.obj `if test -f 'CBLAS/src/cblas_zhpr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpr2.c'; fi` libcblas_a-cblas_cgemv.o: CBLAS/src/cblas_cgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgemv.Tpo -c -o libcblas_a-cblas_cgemv.o `test -f 'CBLAS/src/cblas_cgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgemv.Tpo $(DEPDIR)/libcblas_a-cblas_cgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgemv.c' object='libcblas_a-cblas_cgemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgemv.o `test -f 'CBLAS/src/cblas_cgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgemv.c libcblas_a-cblas_cgemv.obj: CBLAS/src/cblas_cgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgemv.Tpo -c -o libcblas_a-cblas_cgemv.obj `if test -f 'CBLAS/src/cblas_cgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgemv.Tpo $(DEPDIR)/libcblas_a-cblas_cgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgemv.c' object='libcblas_a-cblas_cgemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgemv.obj `if test -f 'CBLAS/src/cblas_cgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgemv.c'; fi` libcblas_a-cblas_dsdot.o: CBLAS/src/cblas_dsdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsdot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsdot.Tpo -c -o libcblas_a-cblas_dsdot.o `test -f 'CBLAS/src/cblas_dsdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsdot.Tpo $(DEPDIR)/libcblas_a-cblas_dsdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsdot.c' object='libcblas_a-cblas_dsdot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsdot.o `test -f 'CBLAS/src/cblas_dsdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsdot.c libcblas_a-cblas_dsdot.obj: CBLAS/src/cblas_dsdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsdot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsdot.Tpo -c -o libcblas_a-cblas_dsdot.obj `if test -f 'CBLAS/src/cblas_dsdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsdot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsdot.Tpo $(DEPDIR)/libcblas_a-cblas_dsdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsdot.c' object='libcblas_a-cblas_dsdot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsdot.obj `if test -f 'CBLAS/src/cblas_dsdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsdot.c'; fi` libcblas_a-cblas_srotm.o: CBLAS/src/cblas_srotm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotm.Tpo -c -o libcblas_a-cblas_srotm.o `test -f 'CBLAS/src/cblas_srotm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotm.Tpo $(DEPDIR)/libcblas_a-cblas_srotm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotm.c' object='libcblas_a-cblas_srotm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotm.o `test -f 'CBLAS/src/cblas_srotm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotm.c libcblas_a-cblas_srotm.obj: CBLAS/src/cblas_srotm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotm.Tpo -c -o libcblas_a-cblas_srotm.obj `if test -f 'CBLAS/src/cblas_srotm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotm.Tpo $(DEPDIR)/libcblas_a-cblas_srotm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotm.c' object='libcblas_a-cblas_srotm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotm.obj `if test -f 'CBLAS/src/cblas_srotm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotm.c'; fi` libcblas_a-cblas_zhpr.o: CBLAS/src/cblas_zhpr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpr.Tpo -c -o libcblas_a-cblas_zhpr.o `test -f 'CBLAS/src/cblas_zhpr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpr.Tpo $(DEPDIR)/libcblas_a-cblas_zhpr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpr.c' object='libcblas_a-cblas_zhpr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpr.o `test -f 'CBLAS/src/cblas_zhpr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhpr.c libcblas_a-cblas_zhpr.obj: CBLAS/src/cblas_zhpr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhpr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhpr.Tpo -c -o libcblas_a-cblas_zhpr.obj `if test -f 'CBLAS/src/cblas_zhpr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhpr.Tpo $(DEPDIR)/libcblas_a-cblas_zhpr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhpr.c' object='libcblas_a-cblas_zhpr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhpr.obj `if test -f 'CBLAS/src/cblas_zhpr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhpr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhpr.c'; fi` libcblas_a-cblas_cgerc.o: CBLAS/src/cblas_cgerc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgerc.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgerc.Tpo -c -o libcblas_a-cblas_cgerc.o `test -f 'CBLAS/src/cblas_cgerc.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgerc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgerc.Tpo $(DEPDIR)/libcblas_a-cblas_cgerc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgerc.c' object='libcblas_a-cblas_cgerc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgerc.o `test -f 'CBLAS/src/cblas_cgerc.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgerc.c libcblas_a-cblas_cgerc.obj: CBLAS/src/cblas_cgerc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgerc.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgerc.Tpo -c -o libcblas_a-cblas_cgerc.obj `if test -f 'CBLAS/src/cblas_cgerc.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgerc.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgerc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgerc.Tpo $(DEPDIR)/libcblas_a-cblas_cgerc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgerc.c' object='libcblas_a-cblas_cgerc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgerc.obj `if test -f 'CBLAS/src/cblas_cgerc.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgerc.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgerc.c'; fi` libcblas_a-cblas_dspmv.o: CBLAS/src/cblas_dspmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspmv.Tpo -c -o libcblas_a-cblas_dspmv.o `test -f 'CBLAS/src/cblas_dspmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspmv.Tpo $(DEPDIR)/libcblas_a-cblas_dspmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspmv.c' object='libcblas_a-cblas_dspmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspmv.o `test -f 'CBLAS/src/cblas_dspmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspmv.c libcblas_a-cblas_dspmv.obj: CBLAS/src/cblas_dspmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspmv.Tpo -c -o libcblas_a-cblas_dspmv.obj `if test -f 'CBLAS/src/cblas_dspmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspmv.Tpo $(DEPDIR)/libcblas_a-cblas_dspmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspmv.c' object='libcblas_a-cblas_dspmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspmv.obj `if test -f 'CBLAS/src/cblas_dspmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspmv.c'; fi` libcblas_a-cblas_srotmg.o: CBLAS/src/cblas_srotmg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotmg.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotmg.Tpo -c -o libcblas_a-cblas_srotmg.o `test -f 'CBLAS/src/cblas_srotmg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotmg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotmg.Tpo $(DEPDIR)/libcblas_a-cblas_srotmg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotmg.c' object='libcblas_a-cblas_srotmg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotmg.o `test -f 'CBLAS/src/cblas_srotmg.c' || echo '$(srcdir)/'`CBLAS/src/cblas_srotmg.c libcblas_a-cblas_srotmg.obj: CBLAS/src/cblas_srotmg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_srotmg.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_srotmg.Tpo -c -o libcblas_a-cblas_srotmg.obj `if test -f 'CBLAS/src/cblas_srotmg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotmg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotmg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_srotmg.Tpo $(DEPDIR)/libcblas_a-cblas_srotmg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_srotmg.c' object='libcblas_a-cblas_srotmg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_srotmg.obj `if test -f 'CBLAS/src/cblas_srotmg.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_srotmg.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_srotmg.c'; fi` libcblas_a-cblas_zscal.o: CBLAS/src/cblas_zscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zscal.Tpo -c -o libcblas_a-cblas_zscal.o `test -f 'CBLAS/src/cblas_zscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zscal.Tpo $(DEPDIR)/libcblas_a-cblas_zscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zscal.c' object='libcblas_a-cblas_zscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zscal.o `test -f 'CBLAS/src/cblas_zscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zscal.c libcblas_a-cblas_zscal.obj: CBLAS/src/cblas_zscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zscal.Tpo -c -o libcblas_a-cblas_zscal.obj `if test -f 'CBLAS/src/cblas_zscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zscal.Tpo $(DEPDIR)/libcblas_a-cblas_zscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zscal.c' object='libcblas_a-cblas_zscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zscal.obj `if test -f 'CBLAS/src/cblas_zscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zscal.c'; fi` libcblas_a-cblas_cgeru.o: CBLAS/src/cblas_cgeru.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgeru.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgeru.Tpo -c -o libcblas_a-cblas_cgeru.o `test -f 'CBLAS/src/cblas_cgeru.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgeru.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgeru.Tpo $(DEPDIR)/libcblas_a-cblas_cgeru.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgeru.c' object='libcblas_a-cblas_cgeru.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgeru.o `test -f 'CBLAS/src/cblas_cgeru.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cgeru.c libcblas_a-cblas_cgeru.obj: CBLAS/src/cblas_cgeru.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cgeru.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cgeru.Tpo -c -o libcblas_a-cblas_cgeru.obj `if test -f 'CBLAS/src/cblas_cgeru.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgeru.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgeru.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cgeru.Tpo $(DEPDIR)/libcblas_a-cblas_cgeru.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cgeru.c' object='libcblas_a-cblas_cgeru.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cgeru.obj `if test -f 'CBLAS/src/cblas_cgeru.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cgeru.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cgeru.c'; fi` libcblas_a-cblas_dspr2.o: CBLAS/src/cblas_dspr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspr2.Tpo -c -o libcblas_a-cblas_dspr2.o `test -f 'CBLAS/src/cblas_dspr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspr2.Tpo $(DEPDIR)/libcblas_a-cblas_dspr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspr2.c' object='libcblas_a-cblas_dspr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspr2.o `test -f 'CBLAS/src/cblas_dspr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspr2.c libcblas_a-cblas_dspr2.obj: CBLAS/src/cblas_dspr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspr2.Tpo -c -o libcblas_a-cblas_dspr2.obj `if test -f 'CBLAS/src/cblas_dspr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspr2.Tpo $(DEPDIR)/libcblas_a-cblas_dspr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspr2.c' object='libcblas_a-cblas_dspr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspr2.obj `if test -f 'CBLAS/src/cblas_dspr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspr2.c'; fi` libcblas_a-cblas_ssbmv.o: CBLAS/src/cblas_ssbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssbmv.Tpo -c -o libcblas_a-cblas_ssbmv.o `test -f 'CBLAS/src/cblas_ssbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ssbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssbmv.c' object='libcblas_a-cblas_ssbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssbmv.o `test -f 'CBLAS/src/cblas_ssbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssbmv.c libcblas_a-cblas_ssbmv.obj: CBLAS/src/cblas_ssbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssbmv.Tpo -c -o libcblas_a-cblas_ssbmv.obj `if test -f 'CBLAS/src/cblas_ssbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ssbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssbmv.c' object='libcblas_a-cblas_ssbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssbmv.obj `if test -f 'CBLAS/src/cblas_ssbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssbmv.c'; fi` libcblas_a-cblas_zswap.o: CBLAS/src/cblas_zswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zswap.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zswap.Tpo -c -o libcblas_a-cblas_zswap.o `test -f 'CBLAS/src/cblas_zswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zswap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zswap.Tpo $(DEPDIR)/libcblas_a-cblas_zswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zswap.c' object='libcblas_a-cblas_zswap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zswap.o `test -f 'CBLAS/src/cblas_zswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zswap.c libcblas_a-cblas_zswap.obj: CBLAS/src/cblas_zswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zswap.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zswap.Tpo -c -o libcblas_a-cblas_zswap.obj `if test -f 'CBLAS/src/cblas_zswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zswap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zswap.Tpo $(DEPDIR)/libcblas_a-cblas_zswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zswap.c' object='libcblas_a-cblas_zswap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zswap.obj `if test -f 'CBLAS/src/cblas_zswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zswap.c'; fi` libcblas_a-cblas_chbmv.o: CBLAS/src/cblas_chbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chbmv.Tpo -c -o libcblas_a-cblas_chbmv.o `test -f 'CBLAS/src/cblas_chbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chbmv.Tpo $(DEPDIR)/libcblas_a-cblas_chbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chbmv.c' object='libcblas_a-cblas_chbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chbmv.o `test -f 'CBLAS/src/cblas_chbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chbmv.c libcblas_a-cblas_chbmv.obj: CBLAS/src/cblas_chbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chbmv.Tpo -c -o libcblas_a-cblas_chbmv.obj `if test -f 'CBLAS/src/cblas_chbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chbmv.Tpo $(DEPDIR)/libcblas_a-cblas_chbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chbmv.c' object='libcblas_a-cblas_chbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chbmv.obj `if test -f 'CBLAS/src/cblas_chbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chbmv.c'; fi` libcblas_a-cblas_dspr.o: CBLAS/src/cblas_dspr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspr.Tpo -c -o libcblas_a-cblas_dspr.o `test -f 'CBLAS/src/cblas_dspr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspr.Tpo $(DEPDIR)/libcblas_a-cblas_dspr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspr.c' object='libcblas_a-cblas_dspr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspr.o `test -f 'CBLAS/src/cblas_dspr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dspr.c libcblas_a-cblas_dspr.obj: CBLAS/src/cblas_dspr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dspr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dspr.Tpo -c -o libcblas_a-cblas_dspr.obj `if test -f 'CBLAS/src/cblas_dspr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dspr.Tpo $(DEPDIR)/libcblas_a-cblas_dspr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dspr.c' object='libcblas_a-cblas_dspr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dspr.obj `if test -f 'CBLAS/src/cblas_dspr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dspr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dspr.c'; fi` libcblas_a-cblas_sscal.o: CBLAS/src/cblas_sscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sscal.Tpo -c -o libcblas_a-cblas_sscal.o `test -f 'CBLAS/src/cblas_sscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sscal.Tpo $(DEPDIR)/libcblas_a-cblas_sscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sscal.c' object='libcblas_a-cblas_sscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sscal.o `test -f 'CBLAS/src/cblas_sscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sscal.c libcblas_a-cblas_sscal.obj: CBLAS/src/cblas_sscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sscal.Tpo -c -o libcblas_a-cblas_sscal.obj `if test -f 'CBLAS/src/cblas_sscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sscal.Tpo $(DEPDIR)/libcblas_a-cblas_sscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sscal.c' object='libcblas_a-cblas_sscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sscal.obj `if test -f 'CBLAS/src/cblas_sscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sscal.c'; fi` libcblas_a-cblas_zsymm.o: CBLAS/src/cblas_zsymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsymm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsymm.Tpo -c -o libcblas_a-cblas_zsymm.o `test -f 'CBLAS/src/cblas_zsymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsymm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsymm.Tpo $(DEPDIR)/libcblas_a-cblas_zsymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsymm.c' object='libcblas_a-cblas_zsymm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsymm.o `test -f 'CBLAS/src/cblas_zsymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsymm.c libcblas_a-cblas_zsymm.obj: CBLAS/src/cblas_zsymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsymm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsymm.Tpo -c -o libcblas_a-cblas_zsymm.obj `if test -f 'CBLAS/src/cblas_zsymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsymm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsymm.Tpo $(DEPDIR)/libcblas_a-cblas_zsymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsymm.c' object='libcblas_a-cblas_zsymm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsymm.obj `if test -f 'CBLAS/src/cblas_zsymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsymm.c'; fi` libcblas_a-cblas_chemm.o: CBLAS/src/cblas_chemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chemm.Tpo -c -o libcblas_a-cblas_chemm.o `test -f 'CBLAS/src/cblas_chemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chemm.Tpo $(DEPDIR)/libcblas_a-cblas_chemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chemm.c' object='libcblas_a-cblas_chemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chemm.o `test -f 'CBLAS/src/cblas_chemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chemm.c libcblas_a-cblas_chemm.obj: CBLAS/src/cblas_chemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chemm.Tpo -c -o libcblas_a-cblas_chemm.obj `if test -f 'CBLAS/src/cblas_chemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chemm.Tpo $(DEPDIR)/libcblas_a-cblas_chemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chemm.c' object='libcblas_a-cblas_chemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chemm.obj `if test -f 'CBLAS/src/cblas_chemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chemm.c'; fi` libcblas_a-cblas_dswap.o: CBLAS/src/cblas_dswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dswap.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dswap.Tpo -c -o libcblas_a-cblas_dswap.o `test -f 'CBLAS/src/cblas_dswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dswap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dswap.Tpo $(DEPDIR)/libcblas_a-cblas_dswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dswap.c' object='libcblas_a-cblas_dswap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dswap.o `test -f 'CBLAS/src/cblas_dswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dswap.c libcblas_a-cblas_dswap.obj: CBLAS/src/cblas_dswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dswap.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dswap.Tpo -c -o libcblas_a-cblas_dswap.obj `if test -f 'CBLAS/src/cblas_dswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dswap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dswap.Tpo $(DEPDIR)/libcblas_a-cblas_dswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dswap.c' object='libcblas_a-cblas_dswap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dswap.obj `if test -f 'CBLAS/src/cblas_dswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dswap.c'; fi` libcblas_a-cblas_sspmv.o: CBLAS/src/cblas_sspmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspmv.Tpo -c -o libcblas_a-cblas_sspmv.o `test -f 'CBLAS/src/cblas_sspmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspmv.Tpo $(DEPDIR)/libcblas_a-cblas_sspmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspmv.c' object='libcblas_a-cblas_sspmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspmv.o `test -f 'CBLAS/src/cblas_sspmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspmv.c libcblas_a-cblas_sspmv.obj: CBLAS/src/cblas_sspmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspmv.Tpo -c -o libcblas_a-cblas_sspmv.obj `if test -f 'CBLAS/src/cblas_sspmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspmv.Tpo $(DEPDIR)/libcblas_a-cblas_sspmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspmv.c' object='libcblas_a-cblas_sspmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspmv.obj `if test -f 'CBLAS/src/cblas_sspmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspmv.c'; fi` libcblas_a-cblas_zsyr2k.o: CBLAS/src/cblas_zsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsyr2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsyr2k.Tpo -c -o libcblas_a-cblas_zsyr2k.o `test -f 'CBLAS/src/cblas_zsyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_zsyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsyr2k.c' object='libcblas_a-cblas_zsyr2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsyr2k.o `test -f 'CBLAS/src/cblas_zsyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsyr2k.c libcblas_a-cblas_zsyr2k.obj: CBLAS/src/cblas_zsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsyr2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsyr2k.Tpo -c -o libcblas_a-cblas_zsyr2k.obj `if test -f 'CBLAS/src/cblas_zsyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsyr2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_zsyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsyr2k.c' object='libcblas_a-cblas_zsyr2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsyr2k.obj `if test -f 'CBLAS/src/cblas_zsyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsyr2k.c'; fi` libcblas_a-cblas_chemv.o: CBLAS/src/cblas_chemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chemv.Tpo -c -o libcblas_a-cblas_chemv.o `test -f 'CBLAS/src/cblas_chemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chemv.Tpo $(DEPDIR)/libcblas_a-cblas_chemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chemv.c' object='libcblas_a-cblas_chemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chemv.o `test -f 'CBLAS/src/cblas_chemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chemv.c libcblas_a-cblas_chemv.obj: CBLAS/src/cblas_chemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chemv.Tpo -c -o libcblas_a-cblas_chemv.obj `if test -f 'CBLAS/src/cblas_chemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chemv.Tpo $(DEPDIR)/libcblas_a-cblas_chemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chemv.c' object='libcblas_a-cblas_chemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chemv.obj `if test -f 'CBLAS/src/cblas_chemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chemv.c'; fi` libcblas_a-cblas_dsymm.o: CBLAS/src/cblas_dsymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsymm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsymm.Tpo -c -o libcblas_a-cblas_dsymm.o `test -f 'CBLAS/src/cblas_dsymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsymm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsymm.Tpo $(DEPDIR)/libcblas_a-cblas_dsymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsymm.c' object='libcblas_a-cblas_dsymm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsymm.o `test -f 'CBLAS/src/cblas_dsymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsymm.c libcblas_a-cblas_dsymm.obj: CBLAS/src/cblas_dsymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsymm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsymm.Tpo -c -o libcblas_a-cblas_dsymm.obj `if test -f 'CBLAS/src/cblas_dsymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsymm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsymm.Tpo $(DEPDIR)/libcblas_a-cblas_dsymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsymm.c' object='libcblas_a-cblas_dsymm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsymm.obj `if test -f 'CBLAS/src/cblas_dsymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsymm.c'; fi` libcblas_a-cblas_sspr2.o: CBLAS/src/cblas_sspr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspr2.Tpo -c -o libcblas_a-cblas_sspr2.o `test -f 'CBLAS/src/cblas_sspr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspr2.Tpo $(DEPDIR)/libcblas_a-cblas_sspr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspr2.c' object='libcblas_a-cblas_sspr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspr2.o `test -f 'CBLAS/src/cblas_sspr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspr2.c libcblas_a-cblas_sspr2.obj: CBLAS/src/cblas_sspr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspr2.Tpo -c -o libcblas_a-cblas_sspr2.obj `if test -f 'CBLAS/src/cblas_sspr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspr2.Tpo $(DEPDIR)/libcblas_a-cblas_sspr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspr2.c' object='libcblas_a-cblas_sspr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspr2.obj `if test -f 'CBLAS/src/cblas_sspr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspr2.c'; fi` libcblas_a-cblas_zsyrk.o: CBLAS/src/cblas_zsyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsyrk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsyrk.Tpo -c -o libcblas_a-cblas_zsyrk.o `test -f 'CBLAS/src/cblas_zsyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsyrk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsyrk.Tpo $(DEPDIR)/libcblas_a-cblas_zsyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsyrk.c' object='libcblas_a-cblas_zsyrk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsyrk.o `test -f 'CBLAS/src/cblas_zsyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zsyrk.c libcblas_a-cblas_zsyrk.obj: CBLAS/src/cblas_zsyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zsyrk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zsyrk.Tpo -c -o libcblas_a-cblas_zsyrk.obj `if test -f 'CBLAS/src/cblas_zsyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsyrk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zsyrk.Tpo $(DEPDIR)/libcblas_a-cblas_zsyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zsyrk.c' object='libcblas_a-cblas_zsyrk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zsyrk.obj `if test -f 'CBLAS/src/cblas_zsyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zsyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zsyrk.c'; fi` libcblas_a-cblas_cher2.o: CBLAS/src/cblas_cher2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher2.Tpo -c -o libcblas_a-cblas_cher2.o `test -f 'CBLAS/src/cblas_cher2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher2.Tpo $(DEPDIR)/libcblas_a-cblas_cher2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher2.c' object='libcblas_a-cblas_cher2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher2.o `test -f 'CBLAS/src/cblas_cher2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher2.c libcblas_a-cblas_cher2.obj: CBLAS/src/cblas_cher2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher2.Tpo -c -o libcblas_a-cblas_cher2.obj `if test -f 'CBLAS/src/cblas_cher2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher2.Tpo $(DEPDIR)/libcblas_a-cblas_cher2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher2.c' object='libcblas_a-cblas_cher2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher2.obj `if test -f 'CBLAS/src/cblas_cher2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher2.c'; fi` libcblas_a-cblas_dsymv.o: CBLAS/src/cblas_dsymv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsymv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsymv.Tpo -c -o libcblas_a-cblas_dsymv.o `test -f 'CBLAS/src/cblas_dsymv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsymv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsymv.Tpo $(DEPDIR)/libcblas_a-cblas_dsymv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsymv.c' object='libcblas_a-cblas_dsymv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsymv.o `test -f 'CBLAS/src/cblas_dsymv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsymv.c libcblas_a-cblas_dsymv.obj: CBLAS/src/cblas_dsymv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsymv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsymv.Tpo -c -o libcblas_a-cblas_dsymv.obj `if test -f 'CBLAS/src/cblas_dsymv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsymv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsymv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsymv.Tpo $(DEPDIR)/libcblas_a-cblas_dsymv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsymv.c' object='libcblas_a-cblas_dsymv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsymv.obj `if test -f 'CBLAS/src/cblas_dsymv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsymv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsymv.c'; fi` libcblas_a-cblas_sspr.o: CBLAS/src/cblas_sspr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspr.Tpo -c -o libcblas_a-cblas_sspr.o `test -f 'CBLAS/src/cblas_sspr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspr.Tpo $(DEPDIR)/libcblas_a-cblas_sspr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspr.c' object='libcblas_a-cblas_sspr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspr.o `test -f 'CBLAS/src/cblas_sspr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sspr.c libcblas_a-cblas_sspr.obj: CBLAS/src/cblas_sspr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sspr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sspr.Tpo -c -o libcblas_a-cblas_sspr.obj `if test -f 'CBLAS/src/cblas_sspr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sspr.Tpo $(DEPDIR)/libcblas_a-cblas_sspr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sspr.c' object='libcblas_a-cblas_sspr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sspr.obj `if test -f 'CBLAS/src/cblas_sspr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sspr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sspr.c'; fi` libcblas_a-cblas_ztbmv.o: CBLAS/src/cblas_ztbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztbmv.Tpo -c -o libcblas_a-cblas_ztbmv.o `test -f 'CBLAS/src/cblas_ztbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztbmv.c' object='libcblas_a-cblas_ztbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztbmv.o `test -f 'CBLAS/src/cblas_ztbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztbmv.c libcblas_a-cblas_ztbmv.obj: CBLAS/src/cblas_ztbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztbmv.Tpo -c -o libcblas_a-cblas_ztbmv.obj `if test -f 'CBLAS/src/cblas_ztbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztbmv.c' object='libcblas_a-cblas_ztbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztbmv.obj `if test -f 'CBLAS/src/cblas_ztbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztbmv.c'; fi` libcblas_a-cblas_cher2k.o: CBLAS/src/cblas_cher2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher2k.Tpo -c -o libcblas_a-cblas_cher2k.o `test -f 'CBLAS/src/cblas_cher2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher2k.Tpo $(DEPDIR)/libcblas_a-cblas_cher2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher2k.c' object='libcblas_a-cblas_cher2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher2k.o `test -f 'CBLAS/src/cblas_cher2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher2k.c libcblas_a-cblas_cher2k.obj: CBLAS/src/cblas_cher2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher2k.Tpo -c -o libcblas_a-cblas_cher2k.obj `if test -f 'CBLAS/src/cblas_cher2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher2k.Tpo $(DEPDIR)/libcblas_a-cblas_cher2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher2k.c' object='libcblas_a-cblas_cher2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher2k.obj `if test -f 'CBLAS/src/cblas_cher2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher2k.c'; fi` libcblas_a-cblas_dsyr2.o: CBLAS/src/cblas_dsyr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr2.Tpo -c -o libcblas_a-cblas_dsyr2.o `test -f 'CBLAS/src/cblas_dsyr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr2.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr2.c' object='libcblas_a-cblas_dsyr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr2.o `test -f 'CBLAS/src/cblas_dsyr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr2.c libcblas_a-cblas_dsyr2.obj: CBLAS/src/cblas_dsyr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr2.Tpo -c -o libcblas_a-cblas_dsyr2.obj `if test -f 'CBLAS/src/cblas_dsyr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr2.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr2.c' object='libcblas_a-cblas_dsyr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr2.obj `if test -f 'CBLAS/src/cblas_dsyr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr2.c'; fi` libcblas_a-cblas_sswap.o: CBLAS/src/cblas_sswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sswap.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sswap.Tpo -c -o libcblas_a-cblas_sswap.o `test -f 'CBLAS/src/cblas_sswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sswap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sswap.Tpo $(DEPDIR)/libcblas_a-cblas_sswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sswap.c' object='libcblas_a-cblas_sswap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sswap.o `test -f 'CBLAS/src/cblas_sswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sswap.c libcblas_a-cblas_sswap.obj: CBLAS/src/cblas_sswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sswap.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sswap.Tpo -c -o libcblas_a-cblas_sswap.obj `if test -f 'CBLAS/src/cblas_sswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sswap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sswap.Tpo $(DEPDIR)/libcblas_a-cblas_sswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sswap.c' object='libcblas_a-cblas_sswap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sswap.obj `if test -f 'CBLAS/src/cblas_sswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sswap.c'; fi` libcblas_a-cblas_ztbsv.o: CBLAS/src/cblas_ztbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztbsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztbsv.Tpo -c -o libcblas_a-cblas_ztbsv.o `test -f 'CBLAS/src/cblas_ztbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztbsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztbsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztbsv.c' object='libcblas_a-cblas_ztbsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztbsv.o `test -f 'CBLAS/src/cblas_ztbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztbsv.c libcblas_a-cblas_ztbsv.obj: CBLAS/src/cblas_ztbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztbsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztbsv.Tpo -c -o libcblas_a-cblas_ztbsv.obj `if test -f 'CBLAS/src/cblas_ztbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztbsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztbsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztbsv.c' object='libcblas_a-cblas_ztbsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztbsv.obj `if test -f 'CBLAS/src/cblas_ztbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztbsv.c'; fi` libcblas_a-cblas_cher.o: CBLAS/src/cblas_cher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher.Tpo -c -o libcblas_a-cblas_cher.o `test -f 'CBLAS/src/cblas_cher.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher.Tpo $(DEPDIR)/libcblas_a-cblas_cher.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher.c' object='libcblas_a-cblas_cher.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher.o `test -f 'CBLAS/src/cblas_cher.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cher.c libcblas_a-cblas_cher.obj: CBLAS/src/cblas_cher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cher.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cher.Tpo -c -o libcblas_a-cblas_cher.obj `if test -f 'CBLAS/src/cblas_cher.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cher.Tpo $(DEPDIR)/libcblas_a-cblas_cher.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cher.c' object='libcblas_a-cblas_cher.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cher.obj `if test -f 'CBLAS/src/cblas_cher.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cher.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cher.c'; fi` libcblas_a-cblas_dsyr2k.o: CBLAS/src/cblas_dsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr2k.Tpo -c -o libcblas_a-cblas_dsyr2k.o `test -f 'CBLAS/src/cblas_dsyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr2k.c' object='libcblas_a-cblas_dsyr2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr2k.o `test -f 'CBLAS/src/cblas_dsyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr2k.c libcblas_a-cblas_dsyr2k.obj: CBLAS/src/cblas_dsyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr2k.Tpo -c -o libcblas_a-cblas_dsyr2k.obj `if test -f 'CBLAS/src/cblas_dsyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr2k.c' object='libcblas_a-cblas_dsyr2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr2k.obj `if test -f 'CBLAS/src/cblas_dsyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr2k.c'; fi` libcblas_a-cblas_ssymm.o: CBLAS/src/cblas_ssymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssymm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssymm.Tpo -c -o libcblas_a-cblas_ssymm.o `test -f 'CBLAS/src/cblas_ssymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssymm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssymm.Tpo $(DEPDIR)/libcblas_a-cblas_ssymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssymm.c' object='libcblas_a-cblas_ssymm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssymm.o `test -f 'CBLAS/src/cblas_ssymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssymm.c libcblas_a-cblas_ssymm.obj: CBLAS/src/cblas_ssymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssymm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssymm.Tpo -c -o libcblas_a-cblas_ssymm.obj `if test -f 'CBLAS/src/cblas_ssymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssymm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssymm.Tpo $(DEPDIR)/libcblas_a-cblas_ssymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssymm.c' object='libcblas_a-cblas_ssymm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssymm.obj `if test -f 'CBLAS/src/cblas_ssymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssymm.c'; fi` libcblas_a-cblas_ztpmv.o: CBLAS/src/cblas_ztpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztpmv.Tpo -c -o libcblas_a-cblas_ztpmv.o `test -f 'CBLAS/src/cblas_ztpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztpmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztpmv.c' object='libcblas_a-cblas_ztpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztpmv.o `test -f 'CBLAS/src/cblas_ztpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztpmv.c libcblas_a-cblas_ztpmv.obj: CBLAS/src/cblas_ztpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztpmv.Tpo -c -o libcblas_a-cblas_ztpmv.obj `if test -f 'CBLAS/src/cblas_ztpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztpmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztpmv.c' object='libcblas_a-cblas_ztpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztpmv.obj `if test -f 'CBLAS/src/cblas_ztpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztpmv.c'; fi` libcblas_a-cblas_cherk.o: CBLAS/src/cblas_cherk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cherk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cherk.Tpo -c -o libcblas_a-cblas_cherk.o `test -f 'CBLAS/src/cblas_cherk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cherk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cherk.Tpo $(DEPDIR)/libcblas_a-cblas_cherk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cherk.c' object='libcblas_a-cblas_cherk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cherk.o `test -f 'CBLAS/src/cblas_cherk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cherk.c libcblas_a-cblas_cherk.obj: CBLAS/src/cblas_cherk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cherk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cherk.Tpo -c -o libcblas_a-cblas_cherk.obj `if test -f 'CBLAS/src/cblas_cherk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cherk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cherk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cherk.Tpo $(DEPDIR)/libcblas_a-cblas_cherk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cherk.c' object='libcblas_a-cblas_cherk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cherk.obj `if test -f 'CBLAS/src/cblas_cherk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cherk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cherk.c'; fi` libcblas_a-cblas_dsyr.o: CBLAS/src/cblas_dsyr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr.Tpo -c -o libcblas_a-cblas_dsyr.o `test -f 'CBLAS/src/cblas_dsyr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr.c' object='libcblas_a-cblas_dsyr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr.o `test -f 'CBLAS/src/cblas_dsyr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyr.c libcblas_a-cblas_dsyr.obj: CBLAS/src/cblas_dsyr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyr.Tpo -c -o libcblas_a-cblas_dsyr.obj `if test -f 'CBLAS/src/cblas_dsyr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyr.Tpo $(DEPDIR)/libcblas_a-cblas_dsyr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyr.c' object='libcblas_a-cblas_dsyr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyr.obj `if test -f 'CBLAS/src/cblas_dsyr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyr.c'; fi` libcblas_a-cblas_ssymv.o: CBLAS/src/cblas_ssymv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssymv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssymv.Tpo -c -o libcblas_a-cblas_ssymv.o `test -f 'CBLAS/src/cblas_ssymv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssymv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssymv.Tpo $(DEPDIR)/libcblas_a-cblas_ssymv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssymv.c' object='libcblas_a-cblas_ssymv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssymv.o `test -f 'CBLAS/src/cblas_ssymv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssymv.c libcblas_a-cblas_ssymv.obj: CBLAS/src/cblas_ssymv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssymv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssymv.Tpo -c -o libcblas_a-cblas_ssymv.obj `if test -f 'CBLAS/src/cblas_ssymv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssymv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssymv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssymv.Tpo $(DEPDIR)/libcblas_a-cblas_ssymv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssymv.c' object='libcblas_a-cblas_ssymv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssymv.obj `if test -f 'CBLAS/src/cblas_ssymv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssymv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssymv.c'; fi` libcblas_a-cblas_ztpsv.o: CBLAS/src/cblas_ztpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztpsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztpsv.Tpo -c -o libcblas_a-cblas_ztpsv.o `test -f 'CBLAS/src/cblas_ztpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztpsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztpsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztpsv.c' object='libcblas_a-cblas_ztpsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztpsv.o `test -f 'CBLAS/src/cblas_ztpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztpsv.c libcblas_a-cblas_ztpsv.obj: CBLAS/src/cblas_ztpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztpsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztpsv.Tpo -c -o libcblas_a-cblas_ztpsv.obj `if test -f 'CBLAS/src/cblas_ztpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztpsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztpsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztpsv.c' object='libcblas_a-cblas_ztpsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztpsv.obj `if test -f 'CBLAS/src/cblas_ztpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztpsv.c'; fi` libcblas_a-cblas_chpmv.o: CBLAS/src/cblas_chpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpmv.Tpo -c -o libcblas_a-cblas_chpmv.o `test -f 'CBLAS/src/cblas_chpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpmv.Tpo $(DEPDIR)/libcblas_a-cblas_chpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpmv.c' object='libcblas_a-cblas_chpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpmv.o `test -f 'CBLAS/src/cblas_chpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpmv.c libcblas_a-cblas_chpmv.obj: CBLAS/src/cblas_chpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpmv.Tpo -c -o libcblas_a-cblas_chpmv.obj `if test -f 'CBLAS/src/cblas_chpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpmv.Tpo $(DEPDIR)/libcblas_a-cblas_chpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpmv.c' object='libcblas_a-cblas_chpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpmv.obj `if test -f 'CBLAS/src/cblas_chpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpmv.c'; fi` libcblas_a-cblas_dsyrk.o: CBLAS/src/cblas_dsyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyrk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyrk.Tpo -c -o libcblas_a-cblas_dsyrk.o `test -f 'CBLAS/src/cblas_dsyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyrk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyrk.Tpo $(DEPDIR)/libcblas_a-cblas_dsyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyrk.c' object='libcblas_a-cblas_dsyrk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyrk.o `test -f 'CBLAS/src/cblas_dsyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dsyrk.c libcblas_a-cblas_dsyrk.obj: CBLAS/src/cblas_dsyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dsyrk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dsyrk.Tpo -c -o libcblas_a-cblas_dsyrk.obj `if test -f 'CBLAS/src/cblas_dsyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyrk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dsyrk.Tpo $(DEPDIR)/libcblas_a-cblas_dsyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dsyrk.c' object='libcblas_a-cblas_dsyrk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dsyrk.obj `if test -f 'CBLAS/src/cblas_dsyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dsyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dsyrk.c'; fi` libcblas_a-cblas_ssyr2.o: CBLAS/src/cblas_ssyr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr2.Tpo -c -o libcblas_a-cblas_ssyr2.o `test -f 'CBLAS/src/cblas_ssyr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr2.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr2.c' object='libcblas_a-cblas_ssyr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr2.o `test -f 'CBLAS/src/cblas_ssyr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr2.c libcblas_a-cblas_ssyr2.obj: CBLAS/src/cblas_ssyr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr2.Tpo -c -o libcblas_a-cblas_ssyr2.obj `if test -f 'CBLAS/src/cblas_ssyr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr2.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr2.c' object='libcblas_a-cblas_ssyr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr2.obj `if test -f 'CBLAS/src/cblas_ssyr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr2.c'; fi` libcblas_a-cblas_ztrmm.o: CBLAS/src/cblas_ztrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrmm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrmm.Tpo -c -o libcblas_a-cblas_ztrmm.o `test -f 'CBLAS/src/cblas_ztrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrmm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrmm.Tpo $(DEPDIR)/libcblas_a-cblas_ztrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrmm.c' object='libcblas_a-cblas_ztrmm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrmm.o `test -f 'CBLAS/src/cblas_ztrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrmm.c libcblas_a-cblas_ztrmm.obj: CBLAS/src/cblas_ztrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrmm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrmm.Tpo -c -o libcblas_a-cblas_ztrmm.obj `if test -f 'CBLAS/src/cblas_ztrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrmm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrmm.Tpo $(DEPDIR)/libcblas_a-cblas_ztrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrmm.c' object='libcblas_a-cblas_ztrmm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrmm.obj `if test -f 'CBLAS/src/cblas_ztrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrmm.c'; fi` libcblas_a-cblas_chpr2.o: CBLAS/src/cblas_chpr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpr2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpr2.Tpo -c -o libcblas_a-cblas_chpr2.o `test -f 'CBLAS/src/cblas_chpr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpr2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpr2.Tpo $(DEPDIR)/libcblas_a-cblas_chpr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpr2.c' object='libcblas_a-cblas_chpr2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpr2.o `test -f 'CBLAS/src/cblas_chpr2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpr2.c libcblas_a-cblas_chpr2.obj: CBLAS/src/cblas_chpr2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpr2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpr2.Tpo -c -o libcblas_a-cblas_chpr2.obj `if test -f 'CBLAS/src/cblas_chpr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpr2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpr2.Tpo $(DEPDIR)/libcblas_a-cblas_chpr2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpr2.c' object='libcblas_a-cblas_chpr2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpr2.obj `if test -f 'CBLAS/src/cblas_chpr2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpr2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpr2.c'; fi` libcblas_a-cblas_dtbmv.o: CBLAS/src/cblas_dtbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtbmv.Tpo -c -o libcblas_a-cblas_dtbmv.o `test -f 'CBLAS/src/cblas_dtbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtbmv.c' object='libcblas_a-cblas_dtbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtbmv.o `test -f 'CBLAS/src/cblas_dtbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtbmv.c libcblas_a-cblas_dtbmv.obj: CBLAS/src/cblas_dtbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtbmv.Tpo -c -o libcblas_a-cblas_dtbmv.obj `if test -f 'CBLAS/src/cblas_dtbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtbmv.c' object='libcblas_a-cblas_dtbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtbmv.obj `if test -f 'CBLAS/src/cblas_dtbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtbmv.c'; fi` libcblas_a-cblas_ssyr2k.o: CBLAS/src/cblas_ssyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr2k.Tpo -c -o libcblas_a-cblas_ssyr2k.o `test -f 'CBLAS/src/cblas_ssyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr2k.c' object='libcblas_a-cblas_ssyr2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr2k.o `test -f 'CBLAS/src/cblas_ssyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr2k.c libcblas_a-cblas_ssyr2k.obj: CBLAS/src/cblas_ssyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr2k.Tpo -c -o libcblas_a-cblas_ssyr2k.obj `if test -f 'CBLAS/src/cblas_ssyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr2k.c' object='libcblas_a-cblas_ssyr2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr2k.obj `if test -f 'CBLAS/src/cblas_ssyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr2k.c'; fi` libcblas_a-cblas_ztrmv.o: CBLAS/src/cblas_ztrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrmv.Tpo -c -o libcblas_a-cblas_ztrmv.o `test -f 'CBLAS/src/cblas_ztrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrmv.c' object='libcblas_a-cblas_ztrmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrmv.o `test -f 'CBLAS/src/cblas_ztrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrmv.c libcblas_a-cblas_ztrmv.obj: CBLAS/src/cblas_ztrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrmv.Tpo -c -o libcblas_a-cblas_ztrmv.obj `if test -f 'CBLAS/src/cblas_ztrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrmv.Tpo $(DEPDIR)/libcblas_a-cblas_ztrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrmv.c' object='libcblas_a-cblas_ztrmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrmv.obj `if test -f 'CBLAS/src/cblas_ztrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrmv.c'; fi` libcblas_a-cblas_chpr.o: CBLAS/src/cblas_chpr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpr.Tpo -c -o libcblas_a-cblas_chpr.o `test -f 'CBLAS/src/cblas_chpr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpr.Tpo $(DEPDIR)/libcblas_a-cblas_chpr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpr.c' object='libcblas_a-cblas_chpr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpr.o `test -f 'CBLAS/src/cblas_chpr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_chpr.c libcblas_a-cblas_chpr.obj: CBLAS/src/cblas_chpr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_chpr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_chpr.Tpo -c -o libcblas_a-cblas_chpr.obj `if test -f 'CBLAS/src/cblas_chpr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_chpr.Tpo $(DEPDIR)/libcblas_a-cblas_chpr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_chpr.c' object='libcblas_a-cblas_chpr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_chpr.obj `if test -f 'CBLAS/src/cblas_chpr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_chpr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_chpr.c'; fi` libcblas_a-cblas_dtbsv.o: CBLAS/src/cblas_dtbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtbsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtbsv.Tpo -c -o libcblas_a-cblas_dtbsv.o `test -f 'CBLAS/src/cblas_dtbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtbsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtbsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtbsv.c' object='libcblas_a-cblas_dtbsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtbsv.o `test -f 'CBLAS/src/cblas_dtbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtbsv.c libcblas_a-cblas_dtbsv.obj: CBLAS/src/cblas_dtbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtbsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtbsv.Tpo -c -o libcblas_a-cblas_dtbsv.obj `if test -f 'CBLAS/src/cblas_dtbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtbsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtbsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtbsv.c' object='libcblas_a-cblas_dtbsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtbsv.obj `if test -f 'CBLAS/src/cblas_dtbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtbsv.c'; fi` libcblas_a-cblas_ssyr.o: CBLAS/src/cblas_ssyr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr.Tpo -c -o libcblas_a-cblas_ssyr.o `test -f 'CBLAS/src/cblas_ssyr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr.c' object='libcblas_a-cblas_ssyr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr.o `test -f 'CBLAS/src/cblas_ssyr.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyr.c libcblas_a-cblas_ssyr.obj: CBLAS/src/cblas_ssyr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyr.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyr.Tpo -c -o libcblas_a-cblas_ssyr.obj `if test -f 'CBLAS/src/cblas_ssyr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyr.Tpo $(DEPDIR)/libcblas_a-cblas_ssyr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyr.c' object='libcblas_a-cblas_ssyr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyr.obj `if test -f 'CBLAS/src/cblas_ssyr.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyr.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyr.c'; fi` libcblas_a-cblas_ztrsm.o: CBLAS/src/cblas_ztrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrsm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrsm.Tpo -c -o libcblas_a-cblas_ztrsm.o `test -f 'CBLAS/src/cblas_ztrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrsm.Tpo $(DEPDIR)/libcblas_a-cblas_ztrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrsm.c' object='libcblas_a-cblas_ztrsm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrsm.o `test -f 'CBLAS/src/cblas_ztrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrsm.c libcblas_a-cblas_ztrsm.obj: CBLAS/src/cblas_ztrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrsm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrsm.Tpo -c -o libcblas_a-cblas_ztrsm.obj `if test -f 'CBLAS/src/cblas_ztrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrsm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrsm.Tpo $(DEPDIR)/libcblas_a-cblas_ztrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrsm.c' object='libcblas_a-cblas_ztrsm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrsm.obj `if test -f 'CBLAS/src/cblas_ztrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrsm.c'; fi` libcblas_a-cblas_cscal.o: CBLAS/src/cblas_cscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cscal.Tpo -c -o libcblas_a-cblas_cscal.o `test -f 'CBLAS/src/cblas_cscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cscal.Tpo $(DEPDIR)/libcblas_a-cblas_cscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cscal.c' object='libcblas_a-cblas_cscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cscal.o `test -f 'CBLAS/src/cblas_cscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cscal.c libcblas_a-cblas_cscal.obj: CBLAS/src/cblas_cscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cscal.Tpo -c -o libcblas_a-cblas_cscal.obj `if test -f 'CBLAS/src/cblas_cscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cscal.Tpo $(DEPDIR)/libcblas_a-cblas_cscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cscal.c' object='libcblas_a-cblas_cscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cscal.obj `if test -f 'CBLAS/src/cblas_cscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cscal.c'; fi` libcblas_a-cblas_dtpmv.o: CBLAS/src/cblas_dtpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtpmv.Tpo -c -o libcblas_a-cblas_dtpmv.o `test -f 'CBLAS/src/cblas_dtpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtpmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtpmv.c' object='libcblas_a-cblas_dtpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtpmv.o `test -f 'CBLAS/src/cblas_dtpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtpmv.c libcblas_a-cblas_dtpmv.obj: CBLAS/src/cblas_dtpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtpmv.Tpo -c -o libcblas_a-cblas_dtpmv.obj `if test -f 'CBLAS/src/cblas_dtpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtpmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtpmv.c' object='libcblas_a-cblas_dtpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtpmv.obj `if test -f 'CBLAS/src/cblas_dtpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtpmv.c'; fi` libcblas_a-cblas_ssyrk.o: CBLAS/src/cblas_ssyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyrk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyrk.Tpo -c -o libcblas_a-cblas_ssyrk.o `test -f 'CBLAS/src/cblas_ssyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyrk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyrk.Tpo $(DEPDIR)/libcblas_a-cblas_ssyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyrk.c' object='libcblas_a-cblas_ssyrk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyrk.o `test -f 'CBLAS/src/cblas_ssyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ssyrk.c libcblas_a-cblas_ssyrk.obj: CBLAS/src/cblas_ssyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ssyrk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ssyrk.Tpo -c -o libcblas_a-cblas_ssyrk.obj `if test -f 'CBLAS/src/cblas_ssyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyrk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ssyrk.Tpo $(DEPDIR)/libcblas_a-cblas_ssyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ssyrk.c' object='libcblas_a-cblas_ssyrk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ssyrk.obj `if test -f 'CBLAS/src/cblas_ssyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ssyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ssyrk.c'; fi` libcblas_a-cblas_ztrsv.o: CBLAS/src/cblas_ztrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrsv.Tpo -c -o libcblas_a-cblas_ztrsv.o `test -f 'CBLAS/src/cblas_ztrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrsv.c' object='libcblas_a-cblas_ztrsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrsv.o `test -f 'CBLAS/src/cblas_ztrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ztrsv.c libcblas_a-cblas_ztrsv.obj: CBLAS/src/cblas_ztrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ztrsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ztrsv.Tpo -c -o libcblas_a-cblas_ztrsv.obj `if test -f 'CBLAS/src/cblas_ztrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ztrsv.Tpo $(DEPDIR)/libcblas_a-cblas_ztrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ztrsv.c' object='libcblas_a-cblas_ztrsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ztrsv.obj `if test -f 'CBLAS/src/cblas_ztrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ztrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ztrsv.c'; fi` libcblas_a-cblas_csscal.o: CBLAS/src/cblas_csscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csscal.Tpo -c -o libcblas_a-cblas_csscal.o `test -f 'CBLAS/src/cblas_csscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csscal.Tpo $(DEPDIR)/libcblas_a-cblas_csscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csscal.c' object='libcblas_a-cblas_csscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csscal.o `test -f 'CBLAS/src/cblas_csscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csscal.c libcblas_a-cblas_csscal.obj: CBLAS/src/cblas_csscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csscal.Tpo -c -o libcblas_a-cblas_csscal.obj `if test -f 'CBLAS/src/cblas_csscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csscal.Tpo $(DEPDIR)/libcblas_a-cblas_csscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csscal.c' object='libcblas_a-cblas_csscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csscal.obj `if test -f 'CBLAS/src/cblas_csscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csscal.c'; fi` libcblas_a-cblas_dtpsv.o: CBLAS/src/cblas_dtpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtpsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtpsv.Tpo -c -o libcblas_a-cblas_dtpsv.o `test -f 'CBLAS/src/cblas_dtpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtpsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtpsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtpsv.c' object='libcblas_a-cblas_dtpsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtpsv.o `test -f 'CBLAS/src/cblas_dtpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtpsv.c libcblas_a-cblas_dtpsv.obj: CBLAS/src/cblas_dtpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtpsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtpsv.Tpo -c -o libcblas_a-cblas_dtpsv.obj `if test -f 'CBLAS/src/cblas_dtpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtpsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtpsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtpsv.c' object='libcblas_a-cblas_dtpsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtpsv.obj `if test -f 'CBLAS/src/cblas_dtpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtpsv.c'; fi` libcblas_a-cblas_stbmv.o: CBLAS/src/cblas_stbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stbmv.Tpo -c -o libcblas_a-cblas_stbmv.o `test -f 'CBLAS/src/cblas_stbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stbmv.Tpo $(DEPDIR)/libcblas_a-cblas_stbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stbmv.c' object='libcblas_a-cblas_stbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stbmv.o `test -f 'CBLAS/src/cblas_stbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stbmv.c libcblas_a-cblas_stbmv.obj: CBLAS/src/cblas_stbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stbmv.Tpo -c -o libcblas_a-cblas_stbmv.obj `if test -f 'CBLAS/src/cblas_stbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stbmv.Tpo $(DEPDIR)/libcblas_a-cblas_stbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stbmv.c' object='libcblas_a-cblas_stbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stbmv.obj `if test -f 'CBLAS/src/cblas_stbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stbmv.c'; fi` libcblas_a-cblas_cswap.o: CBLAS/src/cblas_cswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cswap.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cswap.Tpo -c -o libcblas_a-cblas_cswap.o `test -f 'CBLAS/src/cblas_cswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cswap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cswap.Tpo $(DEPDIR)/libcblas_a-cblas_cswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cswap.c' object='libcblas_a-cblas_cswap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cswap.o `test -f 'CBLAS/src/cblas_cswap.c' || echo '$(srcdir)/'`CBLAS/src/cblas_cswap.c libcblas_a-cblas_cswap.obj: CBLAS/src/cblas_cswap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_cswap.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_cswap.Tpo -c -o libcblas_a-cblas_cswap.obj `if test -f 'CBLAS/src/cblas_cswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cswap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_cswap.Tpo $(DEPDIR)/libcblas_a-cblas_cswap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_cswap.c' object='libcblas_a-cblas_cswap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_cswap.obj `if test -f 'CBLAS/src/cblas_cswap.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_cswap.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_cswap.c'; fi` libcblas_a-cblas_dtrmm.o: CBLAS/src/cblas_dtrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrmm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrmm.Tpo -c -o libcblas_a-cblas_dtrmm.o `test -f 'CBLAS/src/cblas_dtrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrmm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrmm.Tpo $(DEPDIR)/libcblas_a-cblas_dtrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrmm.c' object='libcblas_a-cblas_dtrmm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrmm.o `test -f 'CBLAS/src/cblas_dtrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrmm.c libcblas_a-cblas_dtrmm.obj: CBLAS/src/cblas_dtrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrmm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrmm.Tpo -c -o libcblas_a-cblas_dtrmm.obj `if test -f 'CBLAS/src/cblas_dtrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrmm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrmm.Tpo $(DEPDIR)/libcblas_a-cblas_dtrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrmm.c' object='libcblas_a-cblas_dtrmm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrmm.obj `if test -f 'CBLAS/src/cblas_dtrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrmm.c'; fi` libcblas_a-cblas_stbsv.o: CBLAS/src/cblas_stbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stbsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stbsv.Tpo -c -o libcblas_a-cblas_stbsv.o `test -f 'CBLAS/src/cblas_stbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stbsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stbsv.Tpo $(DEPDIR)/libcblas_a-cblas_stbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stbsv.c' object='libcblas_a-cblas_stbsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stbsv.o `test -f 'CBLAS/src/cblas_stbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stbsv.c libcblas_a-cblas_stbsv.obj: CBLAS/src/cblas_stbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stbsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stbsv.Tpo -c -o libcblas_a-cblas_stbsv.obj `if test -f 'CBLAS/src/cblas_stbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stbsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stbsv.Tpo $(DEPDIR)/libcblas_a-cblas_stbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stbsv.c' object='libcblas_a-cblas_stbsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stbsv.obj `if test -f 'CBLAS/src/cblas_stbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stbsv.c'; fi` libcblas_a-cblas_csymm.o: CBLAS/src/cblas_csymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csymm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csymm.Tpo -c -o libcblas_a-cblas_csymm.o `test -f 'CBLAS/src/cblas_csymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csymm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csymm.Tpo $(DEPDIR)/libcblas_a-cblas_csymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csymm.c' object='libcblas_a-cblas_csymm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csymm.o `test -f 'CBLAS/src/cblas_csymm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csymm.c libcblas_a-cblas_csymm.obj: CBLAS/src/cblas_csymm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csymm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csymm.Tpo -c -o libcblas_a-cblas_csymm.obj `if test -f 'CBLAS/src/cblas_csymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csymm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csymm.Tpo $(DEPDIR)/libcblas_a-cblas_csymm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csymm.c' object='libcblas_a-cblas_csymm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csymm.obj `if test -f 'CBLAS/src/cblas_csymm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csymm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csymm.c'; fi` libcblas_a-cblas_dtrmv.o: CBLAS/src/cblas_dtrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrmv.Tpo -c -o libcblas_a-cblas_dtrmv.o `test -f 'CBLAS/src/cblas_dtrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrmv.c' object='libcblas_a-cblas_dtrmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrmv.o `test -f 'CBLAS/src/cblas_dtrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrmv.c libcblas_a-cblas_dtrmv.obj: CBLAS/src/cblas_dtrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrmv.Tpo -c -o libcblas_a-cblas_dtrmv.obj `if test -f 'CBLAS/src/cblas_dtrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrmv.Tpo $(DEPDIR)/libcblas_a-cblas_dtrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrmv.c' object='libcblas_a-cblas_dtrmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrmv.obj `if test -f 'CBLAS/src/cblas_dtrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrmv.c'; fi` libcblas_a-cblas_stpmv.o: CBLAS/src/cblas_stpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stpmv.Tpo -c -o libcblas_a-cblas_stpmv.o `test -f 'CBLAS/src/cblas_stpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stpmv.Tpo $(DEPDIR)/libcblas_a-cblas_stpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stpmv.c' object='libcblas_a-cblas_stpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stpmv.o `test -f 'CBLAS/src/cblas_stpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stpmv.c libcblas_a-cblas_stpmv.obj: CBLAS/src/cblas_stpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stpmv.Tpo -c -o libcblas_a-cblas_stpmv.obj `if test -f 'CBLAS/src/cblas_stpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stpmv.Tpo $(DEPDIR)/libcblas_a-cblas_stpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stpmv.c' object='libcblas_a-cblas_stpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stpmv.obj `if test -f 'CBLAS/src/cblas_stpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stpmv.c'; fi` libcblas_a-cblas_csyr2k.o: CBLAS/src/cblas_csyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csyr2k.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csyr2k.Tpo -c -o libcblas_a-cblas_csyr2k.o `test -f 'CBLAS/src/cblas_csyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csyr2k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_csyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csyr2k.c' object='libcblas_a-cblas_csyr2k.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csyr2k.o `test -f 'CBLAS/src/cblas_csyr2k.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csyr2k.c libcblas_a-cblas_csyr2k.obj: CBLAS/src/cblas_csyr2k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csyr2k.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csyr2k.Tpo -c -o libcblas_a-cblas_csyr2k.obj `if test -f 'CBLAS/src/cblas_csyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csyr2k.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csyr2k.Tpo $(DEPDIR)/libcblas_a-cblas_csyr2k.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csyr2k.c' object='libcblas_a-cblas_csyr2k.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csyr2k.obj `if test -f 'CBLAS/src/cblas_csyr2k.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csyr2k.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csyr2k.c'; fi` libcblas_a-cblas_dtrsm.o: CBLAS/src/cblas_dtrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrsm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrsm.Tpo -c -o libcblas_a-cblas_dtrsm.o `test -f 'CBLAS/src/cblas_dtrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrsm.Tpo $(DEPDIR)/libcblas_a-cblas_dtrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrsm.c' object='libcblas_a-cblas_dtrsm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrsm.o `test -f 'CBLAS/src/cblas_dtrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrsm.c libcblas_a-cblas_dtrsm.obj: CBLAS/src/cblas_dtrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrsm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrsm.Tpo -c -o libcblas_a-cblas_dtrsm.obj `if test -f 'CBLAS/src/cblas_dtrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrsm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrsm.Tpo $(DEPDIR)/libcblas_a-cblas_dtrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrsm.c' object='libcblas_a-cblas_dtrsm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrsm.obj `if test -f 'CBLAS/src/cblas_dtrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrsm.c'; fi` libcblas_a-cblas_stpsv.o: CBLAS/src/cblas_stpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stpsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stpsv.Tpo -c -o libcblas_a-cblas_stpsv.o `test -f 'CBLAS/src/cblas_stpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stpsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stpsv.Tpo $(DEPDIR)/libcblas_a-cblas_stpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stpsv.c' object='libcblas_a-cblas_stpsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stpsv.o `test -f 'CBLAS/src/cblas_stpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_stpsv.c libcblas_a-cblas_stpsv.obj: CBLAS/src/cblas_stpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_stpsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_stpsv.Tpo -c -o libcblas_a-cblas_stpsv.obj `if test -f 'CBLAS/src/cblas_stpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stpsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_stpsv.Tpo $(DEPDIR)/libcblas_a-cblas_stpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_stpsv.c' object='libcblas_a-cblas_stpsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_stpsv.obj `if test -f 'CBLAS/src/cblas_stpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_stpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_stpsv.c'; fi` libcblas_a-cblas_csyrk.o: CBLAS/src/cblas_csyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csyrk.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csyrk.Tpo -c -o libcblas_a-cblas_csyrk.o `test -f 'CBLAS/src/cblas_csyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csyrk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csyrk.Tpo $(DEPDIR)/libcblas_a-cblas_csyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csyrk.c' object='libcblas_a-cblas_csyrk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csyrk.o `test -f 'CBLAS/src/cblas_csyrk.c' || echo '$(srcdir)/'`CBLAS/src/cblas_csyrk.c libcblas_a-cblas_csyrk.obj: CBLAS/src/cblas_csyrk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_csyrk.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_csyrk.Tpo -c -o libcblas_a-cblas_csyrk.obj `if test -f 'CBLAS/src/cblas_csyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csyrk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_csyrk.Tpo $(DEPDIR)/libcblas_a-cblas_csyrk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_csyrk.c' object='libcblas_a-cblas_csyrk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_csyrk.obj `if test -f 'CBLAS/src/cblas_csyrk.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_csyrk.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_csyrk.c'; fi` libcblas_a-cblas_dtrsv.o: CBLAS/src/cblas_dtrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrsv.Tpo -c -o libcblas_a-cblas_dtrsv.o `test -f 'CBLAS/src/cblas_dtrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrsv.c' object='libcblas_a-cblas_dtrsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrsv.o `test -f 'CBLAS/src/cblas_dtrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dtrsv.c libcblas_a-cblas_dtrsv.obj: CBLAS/src/cblas_dtrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dtrsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dtrsv.Tpo -c -o libcblas_a-cblas_dtrsv.obj `if test -f 'CBLAS/src/cblas_dtrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dtrsv.Tpo $(DEPDIR)/libcblas_a-cblas_dtrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dtrsv.c' object='libcblas_a-cblas_dtrsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dtrsv.obj `if test -f 'CBLAS/src/cblas_dtrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dtrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dtrsv.c'; fi` libcblas_a-cblas_strmm.o: CBLAS/src/cblas_strmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strmm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strmm.Tpo -c -o libcblas_a-cblas_strmm.o `test -f 'CBLAS/src/cblas_strmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strmm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strmm.Tpo $(DEPDIR)/libcblas_a-cblas_strmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strmm.c' object='libcblas_a-cblas_strmm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strmm.o `test -f 'CBLAS/src/cblas_strmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strmm.c libcblas_a-cblas_strmm.obj: CBLAS/src/cblas_strmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strmm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strmm.Tpo -c -o libcblas_a-cblas_strmm.obj `if test -f 'CBLAS/src/cblas_strmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strmm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strmm.Tpo $(DEPDIR)/libcblas_a-cblas_strmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strmm.c' object='libcblas_a-cblas_strmm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strmm.obj `if test -f 'CBLAS/src/cblas_strmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strmm.c'; fi` libcblas_a-cblas_ctbmv.o: CBLAS/src/cblas_ctbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctbmv.Tpo -c -o libcblas_a-cblas_ctbmv.o `test -f 'CBLAS/src/cblas_ctbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctbmv.c' object='libcblas_a-cblas_ctbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctbmv.o `test -f 'CBLAS/src/cblas_ctbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctbmv.c libcblas_a-cblas_ctbmv.obj: CBLAS/src/cblas_ctbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctbmv.Tpo -c -o libcblas_a-cblas_ctbmv.obj `if test -f 'CBLAS/src/cblas_ctbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctbmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctbmv.c' object='libcblas_a-cblas_ctbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctbmv.obj `if test -f 'CBLAS/src/cblas_ctbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctbmv.c'; fi` libcblas_a-cblas_dzasum.o: CBLAS/src/cblas_dzasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dzasum.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dzasum.Tpo -c -o libcblas_a-cblas_dzasum.o `test -f 'CBLAS/src/cblas_dzasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dzasum.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dzasum.Tpo $(DEPDIR)/libcblas_a-cblas_dzasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dzasum.c' object='libcblas_a-cblas_dzasum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dzasum.o `test -f 'CBLAS/src/cblas_dzasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dzasum.c libcblas_a-cblas_dzasum.obj: CBLAS/src/cblas_dzasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dzasum.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dzasum.Tpo -c -o libcblas_a-cblas_dzasum.obj `if test -f 'CBLAS/src/cblas_dzasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dzasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dzasum.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dzasum.Tpo $(DEPDIR)/libcblas_a-cblas_dzasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dzasum.c' object='libcblas_a-cblas_dzasum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dzasum.obj `if test -f 'CBLAS/src/cblas_dzasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dzasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dzasum.c'; fi` libcblas_a-cblas_strmv.o: CBLAS/src/cblas_strmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strmv.Tpo -c -o libcblas_a-cblas_strmv.o `test -f 'CBLAS/src/cblas_strmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strmv.Tpo $(DEPDIR)/libcblas_a-cblas_strmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strmv.c' object='libcblas_a-cblas_strmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strmv.o `test -f 'CBLAS/src/cblas_strmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strmv.c libcblas_a-cblas_strmv.obj: CBLAS/src/cblas_strmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strmv.Tpo -c -o libcblas_a-cblas_strmv.obj `if test -f 'CBLAS/src/cblas_strmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strmv.Tpo $(DEPDIR)/libcblas_a-cblas_strmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strmv.c' object='libcblas_a-cblas_strmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strmv.obj `if test -f 'CBLAS/src/cblas_strmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strmv.c'; fi` libcblas_a-cblas_ctbsv.o: CBLAS/src/cblas_ctbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctbsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctbsv.Tpo -c -o libcblas_a-cblas_ctbsv.o `test -f 'CBLAS/src/cblas_ctbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctbsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctbsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctbsv.c' object='libcblas_a-cblas_ctbsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctbsv.o `test -f 'CBLAS/src/cblas_ctbsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctbsv.c libcblas_a-cblas_ctbsv.obj: CBLAS/src/cblas_ctbsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctbsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctbsv.Tpo -c -o libcblas_a-cblas_ctbsv.obj `if test -f 'CBLAS/src/cblas_ctbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctbsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctbsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctbsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctbsv.c' object='libcblas_a-cblas_ctbsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctbsv.obj `if test -f 'CBLAS/src/cblas_ctbsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctbsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctbsv.c'; fi` libcblas_a-cblas_dznrm2.o: CBLAS/src/cblas_dznrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dznrm2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dznrm2.Tpo -c -o libcblas_a-cblas_dznrm2.o `test -f 'CBLAS/src/cblas_dznrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dznrm2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dznrm2.Tpo $(DEPDIR)/libcblas_a-cblas_dznrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dznrm2.c' object='libcblas_a-cblas_dznrm2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dznrm2.o `test -f 'CBLAS/src/cblas_dznrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dznrm2.c libcblas_a-cblas_dznrm2.obj: CBLAS/src/cblas_dznrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dznrm2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dznrm2.Tpo -c -o libcblas_a-cblas_dznrm2.obj `if test -f 'CBLAS/src/cblas_dznrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dznrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dznrm2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dznrm2.Tpo $(DEPDIR)/libcblas_a-cblas_dznrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dznrm2.c' object='libcblas_a-cblas_dznrm2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dznrm2.obj `if test -f 'CBLAS/src/cblas_dznrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dznrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dznrm2.c'; fi` libcblas_a-cblas_strsm.o: CBLAS/src/cblas_strsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strsm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strsm.Tpo -c -o libcblas_a-cblas_strsm.o `test -f 'CBLAS/src/cblas_strsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strsm.Tpo $(DEPDIR)/libcblas_a-cblas_strsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strsm.c' object='libcblas_a-cblas_strsm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strsm.o `test -f 'CBLAS/src/cblas_strsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strsm.c libcblas_a-cblas_strsm.obj: CBLAS/src/cblas_strsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strsm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strsm.Tpo -c -o libcblas_a-cblas_strsm.obj `if test -f 'CBLAS/src/cblas_strsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strsm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strsm.Tpo $(DEPDIR)/libcblas_a-cblas_strsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strsm.c' object='libcblas_a-cblas_strsm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strsm.obj `if test -f 'CBLAS/src/cblas_strsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strsm.c'; fi` libcblas_a-cblas_ctpmv.o: CBLAS/src/cblas_ctpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctpmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctpmv.Tpo -c -o libcblas_a-cblas_ctpmv.o `test -f 'CBLAS/src/cblas_ctpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctpmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctpmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctpmv.c' object='libcblas_a-cblas_ctpmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctpmv.o `test -f 'CBLAS/src/cblas_ctpmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctpmv.c libcblas_a-cblas_ctpmv.obj: CBLAS/src/cblas_ctpmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctpmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctpmv.Tpo -c -o libcblas_a-cblas_ctpmv.obj `if test -f 'CBLAS/src/cblas_ctpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctpmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctpmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctpmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctpmv.c' object='libcblas_a-cblas_ctpmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctpmv.obj `if test -f 'CBLAS/src/cblas_ctpmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctpmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctpmv.c'; fi` libcblas_a-cblas_strsv.o: CBLAS/src/cblas_strsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strsv.Tpo -c -o libcblas_a-cblas_strsv.o `test -f 'CBLAS/src/cblas_strsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strsv.Tpo $(DEPDIR)/libcblas_a-cblas_strsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strsv.c' object='libcblas_a-cblas_strsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strsv.o `test -f 'CBLAS/src/cblas_strsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_strsv.c libcblas_a-cblas_strsv.obj: CBLAS/src/cblas_strsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_strsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_strsv.Tpo -c -o libcblas_a-cblas_strsv.obj `if test -f 'CBLAS/src/cblas_strsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_strsv.Tpo $(DEPDIR)/libcblas_a-cblas_strsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_strsv.c' object='libcblas_a-cblas_strsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_strsv.obj `if test -f 'CBLAS/src/cblas_strsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_strsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_strsv.c'; fi` libcblas_a-cblas_ctpsv.o: CBLAS/src/cblas_ctpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctpsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctpsv.Tpo -c -o libcblas_a-cblas_ctpsv.o `test -f 'CBLAS/src/cblas_ctpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctpsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctpsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctpsv.c' object='libcblas_a-cblas_ctpsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctpsv.o `test -f 'CBLAS/src/cblas_ctpsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctpsv.c libcblas_a-cblas_ctpsv.obj: CBLAS/src/cblas_ctpsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctpsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctpsv.Tpo -c -o libcblas_a-cblas_ctpsv.obj `if test -f 'CBLAS/src/cblas_ctpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctpsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctpsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctpsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctpsv.c' object='libcblas_a-cblas_ctpsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctpsv.obj `if test -f 'CBLAS/src/cblas_ctpsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctpsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctpsv.c'; fi` libcblas_a-cblas_globals.o: CBLAS/src/cblas_globals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_globals.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_globals.Tpo -c -o libcblas_a-cblas_globals.o `test -f 'CBLAS/src/cblas_globals.c' || echo '$(srcdir)/'`CBLAS/src/cblas_globals.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_globals.Tpo $(DEPDIR)/libcblas_a-cblas_globals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_globals.c' object='libcblas_a-cblas_globals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_globals.o `test -f 'CBLAS/src/cblas_globals.c' || echo '$(srcdir)/'`CBLAS/src/cblas_globals.c libcblas_a-cblas_globals.obj: CBLAS/src/cblas_globals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_globals.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_globals.Tpo -c -o libcblas_a-cblas_globals.obj `if test -f 'CBLAS/src/cblas_globals.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_globals.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_globals.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_globals.Tpo $(DEPDIR)/libcblas_a-cblas_globals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_globals.c' object='libcblas_a-cblas_globals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_globals.obj `if test -f 'CBLAS/src/cblas_globals.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_globals.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_globals.c'; fi` libcblas_a-cblas_xerbla.o: CBLAS/src/cblas_xerbla.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_xerbla.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_xerbla.Tpo -c -o libcblas_a-cblas_xerbla.o `test -f 'CBLAS/src/cblas_xerbla.c' || echo '$(srcdir)/'`CBLAS/src/cblas_xerbla.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_xerbla.Tpo $(DEPDIR)/libcblas_a-cblas_xerbla.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_xerbla.c' object='libcblas_a-cblas_xerbla.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_xerbla.o `test -f 'CBLAS/src/cblas_xerbla.c' || echo '$(srcdir)/'`CBLAS/src/cblas_xerbla.c libcblas_a-cblas_xerbla.obj: CBLAS/src/cblas_xerbla.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_xerbla.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_xerbla.Tpo -c -o libcblas_a-cblas_xerbla.obj `if test -f 'CBLAS/src/cblas_xerbla.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_xerbla.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_xerbla.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_xerbla.Tpo $(DEPDIR)/libcblas_a-cblas_xerbla.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_xerbla.c' object='libcblas_a-cblas_xerbla.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_xerbla.obj `if test -f 'CBLAS/src/cblas_xerbla.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_xerbla.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_xerbla.c'; fi` libcblas_a-cblas_ctrmm.o: CBLAS/src/cblas_ctrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrmm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrmm.Tpo -c -o libcblas_a-cblas_ctrmm.o `test -f 'CBLAS/src/cblas_ctrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrmm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrmm.Tpo $(DEPDIR)/libcblas_a-cblas_ctrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrmm.c' object='libcblas_a-cblas_ctrmm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrmm.o `test -f 'CBLAS/src/cblas_ctrmm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrmm.c libcblas_a-cblas_ctrmm.obj: CBLAS/src/cblas_ctrmm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrmm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrmm.Tpo -c -o libcblas_a-cblas_ctrmm.obj `if test -f 'CBLAS/src/cblas_ctrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrmm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrmm.Tpo $(DEPDIR)/libcblas_a-cblas_ctrmm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrmm.c' object='libcblas_a-cblas_ctrmm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrmm.obj `if test -f 'CBLAS/src/cblas_ctrmm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrmm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrmm.c'; fi` libcblas_a-cblas_zaxpy.o: CBLAS/src/cblas_zaxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zaxpy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zaxpy.Tpo -c -o libcblas_a-cblas_zaxpy.o `test -f 'CBLAS/src/cblas_zaxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zaxpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zaxpy.Tpo $(DEPDIR)/libcblas_a-cblas_zaxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zaxpy.c' object='libcblas_a-cblas_zaxpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zaxpy.o `test -f 'CBLAS/src/cblas_zaxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zaxpy.c libcblas_a-cblas_zaxpy.obj: CBLAS/src/cblas_zaxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zaxpy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zaxpy.Tpo -c -o libcblas_a-cblas_zaxpy.obj `if test -f 'CBLAS/src/cblas_zaxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zaxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zaxpy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zaxpy.Tpo $(DEPDIR)/libcblas_a-cblas_zaxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zaxpy.c' object='libcblas_a-cblas_zaxpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zaxpy.obj `if test -f 'CBLAS/src/cblas_zaxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zaxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zaxpy.c'; fi` libcblas_a-cblas_ctrmv.o: CBLAS/src/cblas_ctrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrmv.Tpo -c -o libcblas_a-cblas_ctrmv.o `test -f 'CBLAS/src/cblas_ctrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrmv.c' object='libcblas_a-cblas_ctrmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrmv.o `test -f 'CBLAS/src/cblas_ctrmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrmv.c libcblas_a-cblas_ctrmv.obj: CBLAS/src/cblas_ctrmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrmv.Tpo -c -o libcblas_a-cblas_ctrmv.obj `if test -f 'CBLAS/src/cblas_ctrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrmv.Tpo $(DEPDIR)/libcblas_a-cblas_ctrmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrmv.c' object='libcblas_a-cblas_ctrmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrmv.obj `if test -f 'CBLAS/src/cblas_ctrmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrmv.c'; fi` libcblas_a-cblas_icamax.o: CBLAS/src/cblas_icamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_icamax.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_icamax.Tpo -c -o libcblas_a-cblas_icamax.o `test -f 'CBLAS/src/cblas_icamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_icamax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_icamax.Tpo $(DEPDIR)/libcblas_a-cblas_icamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_icamax.c' object='libcblas_a-cblas_icamax.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_icamax.o `test -f 'CBLAS/src/cblas_icamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_icamax.c libcblas_a-cblas_icamax.obj: CBLAS/src/cblas_icamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_icamax.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_icamax.Tpo -c -o libcblas_a-cblas_icamax.obj `if test -f 'CBLAS/src/cblas_icamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_icamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_icamax.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_icamax.Tpo $(DEPDIR)/libcblas_a-cblas_icamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_icamax.c' object='libcblas_a-cblas_icamax.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_icamax.obj `if test -f 'CBLAS/src/cblas_icamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_icamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_icamax.c'; fi` libcblas_a-cblas_zcopy.o: CBLAS/src/cblas_zcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zcopy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zcopy.Tpo -c -o libcblas_a-cblas_zcopy.o `test -f 'CBLAS/src/cblas_zcopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zcopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zcopy.Tpo $(DEPDIR)/libcblas_a-cblas_zcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zcopy.c' object='libcblas_a-cblas_zcopy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zcopy.o `test -f 'CBLAS/src/cblas_zcopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zcopy.c libcblas_a-cblas_zcopy.obj: CBLAS/src/cblas_zcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zcopy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zcopy.Tpo -c -o libcblas_a-cblas_zcopy.obj `if test -f 'CBLAS/src/cblas_zcopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zcopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zcopy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zcopy.Tpo $(DEPDIR)/libcblas_a-cblas_zcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zcopy.c' object='libcblas_a-cblas_zcopy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zcopy.obj `if test -f 'CBLAS/src/cblas_zcopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zcopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zcopy.c'; fi` libcblas_a-cblas_ctrsm.o: CBLAS/src/cblas_ctrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrsm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrsm.Tpo -c -o libcblas_a-cblas_ctrsm.o `test -f 'CBLAS/src/cblas_ctrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrsm.Tpo $(DEPDIR)/libcblas_a-cblas_ctrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrsm.c' object='libcblas_a-cblas_ctrsm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrsm.o `test -f 'CBLAS/src/cblas_ctrsm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrsm.c libcblas_a-cblas_ctrsm.obj: CBLAS/src/cblas_ctrsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrsm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrsm.Tpo -c -o libcblas_a-cblas_ctrsm.obj `if test -f 'CBLAS/src/cblas_ctrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrsm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrsm.Tpo $(DEPDIR)/libcblas_a-cblas_ctrsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrsm.c' object='libcblas_a-cblas_ctrsm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrsm.obj `if test -f 'CBLAS/src/cblas_ctrsm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrsm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrsm.c'; fi` libcblas_a-cblas_idamax.o: CBLAS/src/cblas_idamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_idamax.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_idamax.Tpo -c -o libcblas_a-cblas_idamax.o `test -f 'CBLAS/src/cblas_idamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_idamax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_idamax.Tpo $(DEPDIR)/libcblas_a-cblas_idamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_idamax.c' object='libcblas_a-cblas_idamax.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_idamax.o `test -f 'CBLAS/src/cblas_idamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_idamax.c libcblas_a-cblas_idamax.obj: CBLAS/src/cblas_idamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_idamax.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_idamax.Tpo -c -o libcblas_a-cblas_idamax.obj `if test -f 'CBLAS/src/cblas_idamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_idamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_idamax.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_idamax.Tpo $(DEPDIR)/libcblas_a-cblas_idamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_idamax.c' object='libcblas_a-cblas_idamax.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_idamax.obj `if test -f 'CBLAS/src/cblas_idamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_idamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_idamax.c'; fi` libcblas_a-cblas_zdotc_sub.o: CBLAS/src/cblas_zdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdotc_sub.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Tpo -c -o libcblas_a-cblas_zdotc_sub.o `test -f 'CBLAS/src/cblas_zdotc_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Tpo $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdotc_sub.c' object='libcblas_a-cblas_zdotc_sub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdotc_sub.o `test -f 'CBLAS/src/cblas_zdotc_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdotc_sub.c libcblas_a-cblas_zdotc_sub.obj: CBLAS/src/cblas_zdotc_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdotc_sub.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Tpo -c -o libcblas_a-cblas_zdotc_sub.obj `if test -f 'CBLAS/src/cblas_zdotc_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdotc_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdotc_sub.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Tpo $(DEPDIR)/libcblas_a-cblas_zdotc_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdotc_sub.c' object='libcblas_a-cblas_zdotc_sub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdotc_sub.obj `if test -f 'CBLAS/src/cblas_zdotc_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdotc_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdotc_sub.c'; fi` libcblas_a-cblas_ctrsv.o: CBLAS/src/cblas_ctrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrsv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrsv.Tpo -c -o libcblas_a-cblas_ctrsv.o `test -f 'CBLAS/src/cblas_ctrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrsv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrsv.c' object='libcblas_a-cblas_ctrsv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrsv.o `test -f 'CBLAS/src/cblas_ctrsv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ctrsv.c libcblas_a-cblas_ctrsv.obj: CBLAS/src/cblas_ctrsv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ctrsv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ctrsv.Tpo -c -o libcblas_a-cblas_ctrsv.obj `if test -f 'CBLAS/src/cblas_ctrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrsv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ctrsv.Tpo $(DEPDIR)/libcblas_a-cblas_ctrsv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ctrsv.c' object='libcblas_a-cblas_ctrsv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ctrsv.obj `if test -f 'CBLAS/src/cblas_ctrsv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ctrsv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ctrsv.c'; fi` libcblas_a-cblas_isamax.o: CBLAS/src/cblas_isamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_isamax.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_isamax.Tpo -c -o libcblas_a-cblas_isamax.o `test -f 'CBLAS/src/cblas_isamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_isamax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_isamax.Tpo $(DEPDIR)/libcblas_a-cblas_isamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_isamax.c' object='libcblas_a-cblas_isamax.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_isamax.o `test -f 'CBLAS/src/cblas_isamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_isamax.c libcblas_a-cblas_isamax.obj: CBLAS/src/cblas_isamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_isamax.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_isamax.Tpo -c -o libcblas_a-cblas_isamax.obj `if test -f 'CBLAS/src/cblas_isamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_isamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_isamax.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_isamax.Tpo $(DEPDIR)/libcblas_a-cblas_isamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_isamax.c' object='libcblas_a-cblas_isamax.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_isamax.obj `if test -f 'CBLAS/src/cblas_isamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_isamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_isamax.c'; fi` libcblas_a-cblas_zdotu_sub.o: CBLAS/src/cblas_zdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdotu_sub.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Tpo -c -o libcblas_a-cblas_zdotu_sub.o `test -f 'CBLAS/src/cblas_zdotu_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Tpo $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdotu_sub.c' object='libcblas_a-cblas_zdotu_sub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdotu_sub.o `test -f 'CBLAS/src/cblas_zdotu_sub.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdotu_sub.c libcblas_a-cblas_zdotu_sub.obj: CBLAS/src/cblas_zdotu_sub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdotu_sub.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Tpo -c -o libcblas_a-cblas_zdotu_sub.obj `if test -f 'CBLAS/src/cblas_zdotu_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdotu_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdotu_sub.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Tpo $(DEPDIR)/libcblas_a-cblas_zdotu_sub.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdotu_sub.c' object='libcblas_a-cblas_zdotu_sub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdotu_sub.obj `if test -f 'CBLAS/src/cblas_zdotu_sub.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdotu_sub.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdotu_sub.c'; fi` libcblas_a-cblas_dasum.o: CBLAS/src/cblas_dasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dasum.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dasum.Tpo -c -o libcblas_a-cblas_dasum.o `test -f 'CBLAS/src/cblas_dasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dasum.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dasum.Tpo $(DEPDIR)/libcblas_a-cblas_dasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dasum.c' object='libcblas_a-cblas_dasum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dasum.o `test -f 'CBLAS/src/cblas_dasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dasum.c libcblas_a-cblas_dasum.obj: CBLAS/src/cblas_dasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dasum.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dasum.Tpo -c -o libcblas_a-cblas_dasum.obj `if test -f 'CBLAS/src/cblas_dasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dasum.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dasum.Tpo $(DEPDIR)/libcblas_a-cblas_dasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dasum.c' object='libcblas_a-cblas_dasum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dasum.obj `if test -f 'CBLAS/src/cblas_dasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dasum.c'; fi` libcblas_a-cblas_izamax.o: CBLAS/src/cblas_izamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_izamax.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_izamax.Tpo -c -o libcblas_a-cblas_izamax.o `test -f 'CBLAS/src/cblas_izamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_izamax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_izamax.Tpo $(DEPDIR)/libcblas_a-cblas_izamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_izamax.c' object='libcblas_a-cblas_izamax.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_izamax.o `test -f 'CBLAS/src/cblas_izamax.c' || echo '$(srcdir)/'`CBLAS/src/cblas_izamax.c libcblas_a-cblas_izamax.obj: CBLAS/src/cblas_izamax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_izamax.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_izamax.Tpo -c -o libcblas_a-cblas_izamax.obj `if test -f 'CBLAS/src/cblas_izamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_izamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_izamax.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_izamax.Tpo $(DEPDIR)/libcblas_a-cblas_izamax.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_izamax.c' object='libcblas_a-cblas_izamax.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_izamax.obj `if test -f 'CBLAS/src/cblas_izamax.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_izamax.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_izamax.c'; fi` libcblas_a-cblas_zdscal.o: CBLAS/src/cblas_zdscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdscal.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdscal.Tpo -c -o libcblas_a-cblas_zdscal.o `test -f 'CBLAS/src/cblas_zdscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdscal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdscal.Tpo $(DEPDIR)/libcblas_a-cblas_zdscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdscal.c' object='libcblas_a-cblas_zdscal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdscal.o `test -f 'CBLAS/src/cblas_zdscal.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zdscal.c libcblas_a-cblas_zdscal.obj: CBLAS/src/cblas_zdscal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zdscal.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zdscal.Tpo -c -o libcblas_a-cblas_zdscal.obj `if test -f 'CBLAS/src/cblas_zdscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdscal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zdscal.Tpo $(DEPDIR)/libcblas_a-cblas_zdscal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zdscal.c' object='libcblas_a-cblas_zdscal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zdscal.obj `if test -f 'CBLAS/src/cblas_zdscal.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zdscal.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zdscal.c'; fi` libcblas_a-cblas_daxpy.o: CBLAS/src/cblas_daxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_daxpy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_daxpy.Tpo -c -o libcblas_a-cblas_daxpy.o `test -f 'CBLAS/src/cblas_daxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_daxpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_daxpy.Tpo $(DEPDIR)/libcblas_a-cblas_daxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_daxpy.c' object='libcblas_a-cblas_daxpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_daxpy.o `test -f 'CBLAS/src/cblas_daxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_daxpy.c libcblas_a-cblas_daxpy.obj: CBLAS/src/cblas_daxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_daxpy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_daxpy.Tpo -c -o libcblas_a-cblas_daxpy.obj `if test -f 'CBLAS/src/cblas_daxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_daxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_daxpy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_daxpy.Tpo $(DEPDIR)/libcblas_a-cblas_daxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_daxpy.c' object='libcblas_a-cblas_daxpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_daxpy.obj `if test -f 'CBLAS/src/cblas_daxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_daxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_daxpy.c'; fi` libcblas_a-cblas_sasum.o: CBLAS/src/cblas_sasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sasum.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sasum.Tpo -c -o libcblas_a-cblas_sasum.o `test -f 'CBLAS/src/cblas_sasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sasum.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sasum.Tpo $(DEPDIR)/libcblas_a-cblas_sasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sasum.c' object='libcblas_a-cblas_sasum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sasum.o `test -f 'CBLAS/src/cblas_sasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sasum.c libcblas_a-cblas_sasum.obj: CBLAS/src/cblas_sasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sasum.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sasum.Tpo -c -o libcblas_a-cblas_sasum.obj `if test -f 'CBLAS/src/cblas_sasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sasum.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sasum.Tpo $(DEPDIR)/libcblas_a-cblas_sasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sasum.c' object='libcblas_a-cblas_sasum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sasum.obj `if test -f 'CBLAS/src/cblas_sasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sasum.c'; fi` libcblas_a-cblas_zgbmv.o: CBLAS/src/cblas_zgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgbmv.Tpo -c -o libcblas_a-cblas_zgbmv.o `test -f 'CBLAS/src/cblas_zgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_zgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgbmv.c' object='libcblas_a-cblas_zgbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgbmv.o `test -f 'CBLAS/src/cblas_zgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgbmv.c libcblas_a-cblas_zgbmv.obj: CBLAS/src/cblas_zgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgbmv.Tpo -c -o libcblas_a-cblas_zgbmv.obj `if test -f 'CBLAS/src/cblas_zgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_zgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgbmv.c' object='libcblas_a-cblas_zgbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgbmv.obj `if test -f 'CBLAS/src/cblas_zgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgbmv.c'; fi` libcblas_a-cblas_dcopy.o: CBLAS/src/cblas_dcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dcopy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dcopy.Tpo -c -o libcblas_a-cblas_dcopy.o `test -f 'CBLAS/src/cblas_dcopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dcopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dcopy.Tpo $(DEPDIR)/libcblas_a-cblas_dcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dcopy.c' object='libcblas_a-cblas_dcopy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dcopy.o `test -f 'CBLAS/src/cblas_dcopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dcopy.c libcblas_a-cblas_dcopy.obj: CBLAS/src/cblas_dcopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dcopy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dcopy.Tpo -c -o libcblas_a-cblas_dcopy.obj `if test -f 'CBLAS/src/cblas_dcopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dcopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dcopy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dcopy.Tpo $(DEPDIR)/libcblas_a-cblas_dcopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dcopy.c' object='libcblas_a-cblas_dcopy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dcopy.obj `if test -f 'CBLAS/src/cblas_dcopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dcopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dcopy.c'; fi` libcblas_a-cblas_saxpy.o: CBLAS/src/cblas_saxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_saxpy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_saxpy.Tpo -c -o libcblas_a-cblas_saxpy.o `test -f 'CBLAS/src/cblas_saxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_saxpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_saxpy.Tpo $(DEPDIR)/libcblas_a-cblas_saxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_saxpy.c' object='libcblas_a-cblas_saxpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_saxpy.o `test -f 'CBLAS/src/cblas_saxpy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_saxpy.c libcblas_a-cblas_saxpy.obj: CBLAS/src/cblas_saxpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_saxpy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_saxpy.Tpo -c -o libcblas_a-cblas_saxpy.obj `if test -f 'CBLAS/src/cblas_saxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_saxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_saxpy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_saxpy.Tpo $(DEPDIR)/libcblas_a-cblas_saxpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_saxpy.c' object='libcblas_a-cblas_saxpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_saxpy.obj `if test -f 'CBLAS/src/cblas_saxpy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_saxpy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_saxpy.c'; fi` libcblas_a-cblas_zgemm.o: CBLAS/src/cblas_zgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgemm.Tpo -c -o libcblas_a-cblas_zgemm.o `test -f 'CBLAS/src/cblas_zgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgemm.Tpo $(DEPDIR)/libcblas_a-cblas_zgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgemm.c' object='libcblas_a-cblas_zgemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgemm.o `test -f 'CBLAS/src/cblas_zgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgemm.c libcblas_a-cblas_zgemm.obj: CBLAS/src/cblas_zgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgemm.Tpo -c -o libcblas_a-cblas_zgemm.obj `if test -f 'CBLAS/src/cblas_zgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgemm.Tpo $(DEPDIR)/libcblas_a-cblas_zgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgemm.c' object='libcblas_a-cblas_zgemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgemm.obj `if test -f 'CBLAS/src/cblas_zgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgemm.c'; fi` libcblas_a-cblas_ddot.o: CBLAS/src/cblas_ddot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ddot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ddot.Tpo -c -o libcblas_a-cblas_ddot.o `test -f 'CBLAS/src/cblas_ddot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ddot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ddot.Tpo $(DEPDIR)/libcblas_a-cblas_ddot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ddot.c' object='libcblas_a-cblas_ddot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ddot.o `test -f 'CBLAS/src/cblas_ddot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_ddot.c libcblas_a-cblas_ddot.obj: CBLAS/src/cblas_ddot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_ddot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_ddot.Tpo -c -o libcblas_a-cblas_ddot.obj `if test -f 'CBLAS/src/cblas_ddot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ddot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ddot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_ddot.Tpo $(DEPDIR)/libcblas_a-cblas_ddot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_ddot.c' object='libcblas_a-cblas_ddot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_ddot.obj `if test -f 'CBLAS/src/cblas_ddot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_ddot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_ddot.c'; fi` libcblas_a-cblas_scasum.o: CBLAS/src/cblas_scasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scasum.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scasum.Tpo -c -o libcblas_a-cblas_scasum.o `test -f 'CBLAS/src/cblas_scasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scasum.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scasum.Tpo $(DEPDIR)/libcblas_a-cblas_scasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scasum.c' object='libcblas_a-cblas_scasum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scasum.o `test -f 'CBLAS/src/cblas_scasum.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scasum.c libcblas_a-cblas_scasum.obj: CBLAS/src/cblas_scasum.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scasum.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scasum.Tpo -c -o libcblas_a-cblas_scasum.obj `if test -f 'CBLAS/src/cblas_scasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scasum.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scasum.Tpo $(DEPDIR)/libcblas_a-cblas_scasum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scasum.c' object='libcblas_a-cblas_scasum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scasum.obj `if test -f 'CBLAS/src/cblas_scasum.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scasum.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scasum.c'; fi` libcblas_a-cblas_zgemv.o: CBLAS/src/cblas_zgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgemv.Tpo -c -o libcblas_a-cblas_zgemv.o `test -f 'CBLAS/src/cblas_zgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgemv.Tpo $(DEPDIR)/libcblas_a-cblas_zgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgemv.c' object='libcblas_a-cblas_zgemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgemv.o `test -f 'CBLAS/src/cblas_zgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgemv.c libcblas_a-cblas_zgemv.obj: CBLAS/src/cblas_zgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgemv.Tpo -c -o libcblas_a-cblas_zgemv.obj `if test -f 'CBLAS/src/cblas_zgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgemv.Tpo $(DEPDIR)/libcblas_a-cblas_zgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgemv.c' object='libcblas_a-cblas_zgemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgemv.obj `if test -f 'CBLAS/src/cblas_zgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgemv.c'; fi` libcblas_a-cblas_dgbmv.o: CBLAS/src/cblas_dgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgbmv.Tpo -c -o libcblas_a-cblas_dgbmv.o `test -f 'CBLAS/src/cblas_dgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgbmv.c' object='libcblas_a-cblas_dgbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgbmv.o `test -f 'CBLAS/src/cblas_dgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgbmv.c libcblas_a-cblas_dgbmv.obj: CBLAS/src/cblas_dgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgbmv.Tpo -c -o libcblas_a-cblas_dgbmv.obj `if test -f 'CBLAS/src/cblas_dgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_dgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgbmv.c' object='libcblas_a-cblas_dgbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgbmv.obj `if test -f 'CBLAS/src/cblas_dgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgbmv.c'; fi` libcblas_a-cblas_scnrm2.o: CBLAS/src/cblas_scnrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scnrm2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scnrm2.Tpo -c -o libcblas_a-cblas_scnrm2.o `test -f 'CBLAS/src/cblas_scnrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scnrm2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scnrm2.Tpo $(DEPDIR)/libcblas_a-cblas_scnrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scnrm2.c' object='libcblas_a-cblas_scnrm2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scnrm2.o `test -f 'CBLAS/src/cblas_scnrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scnrm2.c libcblas_a-cblas_scnrm2.obj: CBLAS/src/cblas_scnrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scnrm2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scnrm2.Tpo -c -o libcblas_a-cblas_scnrm2.obj `if test -f 'CBLAS/src/cblas_scnrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scnrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scnrm2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scnrm2.Tpo $(DEPDIR)/libcblas_a-cblas_scnrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scnrm2.c' object='libcblas_a-cblas_scnrm2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scnrm2.obj `if test -f 'CBLAS/src/cblas_scnrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scnrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scnrm2.c'; fi` libcblas_a-cblas_zgerc.o: CBLAS/src/cblas_zgerc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgerc.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgerc.Tpo -c -o libcblas_a-cblas_zgerc.o `test -f 'CBLAS/src/cblas_zgerc.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgerc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgerc.Tpo $(DEPDIR)/libcblas_a-cblas_zgerc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgerc.c' object='libcblas_a-cblas_zgerc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgerc.o `test -f 'CBLAS/src/cblas_zgerc.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgerc.c libcblas_a-cblas_zgerc.obj: CBLAS/src/cblas_zgerc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgerc.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgerc.Tpo -c -o libcblas_a-cblas_zgerc.obj `if test -f 'CBLAS/src/cblas_zgerc.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgerc.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgerc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgerc.Tpo $(DEPDIR)/libcblas_a-cblas_zgerc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgerc.c' object='libcblas_a-cblas_zgerc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgerc.obj `if test -f 'CBLAS/src/cblas_zgerc.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgerc.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgerc.c'; fi` libcblas_a-cblas_dgemm.o: CBLAS/src/cblas_dgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgemm.Tpo -c -o libcblas_a-cblas_dgemm.o `test -f 'CBLAS/src/cblas_dgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgemm.Tpo $(DEPDIR)/libcblas_a-cblas_dgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgemm.c' object='libcblas_a-cblas_dgemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgemm.o `test -f 'CBLAS/src/cblas_dgemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgemm.c libcblas_a-cblas_dgemm.obj: CBLAS/src/cblas_dgemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgemm.Tpo -c -o libcblas_a-cblas_dgemm.obj `if test -f 'CBLAS/src/cblas_dgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgemm.Tpo $(DEPDIR)/libcblas_a-cblas_dgemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgemm.c' object='libcblas_a-cblas_dgemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgemm.obj `if test -f 'CBLAS/src/cblas_dgemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgemm.c'; fi` libcblas_a-cblas_scopy.o: CBLAS/src/cblas_scopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scopy.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scopy.Tpo -c -o libcblas_a-cblas_scopy.o `test -f 'CBLAS/src/cblas_scopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scopy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scopy.Tpo $(DEPDIR)/libcblas_a-cblas_scopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scopy.c' object='libcblas_a-cblas_scopy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scopy.o `test -f 'CBLAS/src/cblas_scopy.c' || echo '$(srcdir)/'`CBLAS/src/cblas_scopy.c libcblas_a-cblas_scopy.obj: CBLAS/src/cblas_scopy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_scopy.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_scopy.Tpo -c -o libcblas_a-cblas_scopy.obj `if test -f 'CBLAS/src/cblas_scopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scopy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_scopy.Tpo $(DEPDIR)/libcblas_a-cblas_scopy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_scopy.c' object='libcblas_a-cblas_scopy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_scopy.obj `if test -f 'CBLAS/src/cblas_scopy.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_scopy.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_scopy.c'; fi` libcblas_a-cblas_zgeru.o: CBLAS/src/cblas_zgeru.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgeru.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgeru.Tpo -c -o libcblas_a-cblas_zgeru.o `test -f 'CBLAS/src/cblas_zgeru.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgeru.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgeru.Tpo $(DEPDIR)/libcblas_a-cblas_zgeru.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgeru.c' object='libcblas_a-cblas_zgeru.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgeru.o `test -f 'CBLAS/src/cblas_zgeru.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zgeru.c libcblas_a-cblas_zgeru.obj: CBLAS/src/cblas_zgeru.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zgeru.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zgeru.Tpo -c -o libcblas_a-cblas_zgeru.obj `if test -f 'CBLAS/src/cblas_zgeru.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgeru.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgeru.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zgeru.Tpo $(DEPDIR)/libcblas_a-cblas_zgeru.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zgeru.c' object='libcblas_a-cblas_zgeru.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zgeru.obj `if test -f 'CBLAS/src/cblas_zgeru.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zgeru.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zgeru.c'; fi` libcblas_a-cblas_dgemv.o: CBLAS/src/cblas_dgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgemv.Tpo -c -o libcblas_a-cblas_dgemv.o `test -f 'CBLAS/src/cblas_dgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgemv.Tpo $(DEPDIR)/libcblas_a-cblas_dgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgemv.c' object='libcblas_a-cblas_dgemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgemv.o `test -f 'CBLAS/src/cblas_dgemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dgemv.c libcblas_a-cblas_dgemv.obj: CBLAS/src/cblas_dgemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dgemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dgemv.Tpo -c -o libcblas_a-cblas_dgemv.obj `if test -f 'CBLAS/src/cblas_dgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dgemv.Tpo $(DEPDIR)/libcblas_a-cblas_dgemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dgemv.c' object='libcblas_a-cblas_dgemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dgemv.obj `if test -f 'CBLAS/src/cblas_dgemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dgemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dgemv.c'; fi` libcblas_a-cblas_sdot.o: CBLAS/src/cblas_sdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sdot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sdot.Tpo -c -o libcblas_a-cblas_sdot.o `test -f 'CBLAS/src/cblas_sdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sdot.Tpo $(DEPDIR)/libcblas_a-cblas_sdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sdot.c' object='libcblas_a-cblas_sdot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sdot.o `test -f 'CBLAS/src/cblas_sdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sdot.c libcblas_a-cblas_sdot.obj: CBLAS/src/cblas_sdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sdot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sdot.Tpo -c -o libcblas_a-cblas_sdot.obj `if test -f 'CBLAS/src/cblas_sdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sdot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sdot.Tpo $(DEPDIR)/libcblas_a-cblas_sdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sdot.c' object='libcblas_a-cblas_sdot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sdot.obj `if test -f 'CBLAS/src/cblas_sdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sdot.c'; fi` libcblas_a-cblas_zhbmv.o: CBLAS/src/cblas_zhbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhbmv.Tpo -c -o libcblas_a-cblas_zhbmv.o `test -f 'CBLAS/src/cblas_zhbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhbmv.Tpo $(DEPDIR)/libcblas_a-cblas_zhbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhbmv.c' object='libcblas_a-cblas_zhbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhbmv.o `test -f 'CBLAS/src/cblas_zhbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhbmv.c libcblas_a-cblas_zhbmv.obj: CBLAS/src/cblas_zhbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhbmv.Tpo -c -o libcblas_a-cblas_zhbmv.obj `if test -f 'CBLAS/src/cblas_zhbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhbmv.Tpo $(DEPDIR)/libcblas_a-cblas_zhbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhbmv.c' object='libcblas_a-cblas_zhbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhbmv.obj `if test -f 'CBLAS/src/cblas_zhbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhbmv.c'; fi` libcblas_a-xerbla.o: CBLAS/src/xerbla.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-xerbla.o -MD -MP -MF $(DEPDIR)/libcblas_a-xerbla.Tpo -c -o libcblas_a-xerbla.o `test -f 'CBLAS/src/xerbla.c' || echo '$(srcdir)/'`CBLAS/src/xerbla.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-xerbla.Tpo $(DEPDIR)/libcblas_a-xerbla.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/xerbla.c' object='libcblas_a-xerbla.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-xerbla.o `test -f 'CBLAS/src/xerbla.c' || echo '$(srcdir)/'`CBLAS/src/xerbla.c libcblas_a-xerbla.obj: CBLAS/src/xerbla.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-xerbla.obj -MD -MP -MF $(DEPDIR)/libcblas_a-xerbla.Tpo -c -o libcblas_a-xerbla.obj `if test -f 'CBLAS/src/xerbla.c'; then $(CYGPATH_W) 'CBLAS/src/xerbla.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/xerbla.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-xerbla.Tpo $(DEPDIR)/libcblas_a-xerbla.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/xerbla.c' object='libcblas_a-xerbla.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-xerbla.obj `if test -f 'CBLAS/src/xerbla.c'; then $(CYGPATH_W) 'CBLAS/src/xerbla.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/xerbla.c'; fi` libcblas_a-cblas_dger.o: CBLAS/src/cblas_dger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dger.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dger.Tpo -c -o libcblas_a-cblas_dger.o `test -f 'CBLAS/src/cblas_dger.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dger.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dger.Tpo $(DEPDIR)/libcblas_a-cblas_dger.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dger.c' object='libcblas_a-cblas_dger.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dger.o `test -f 'CBLAS/src/cblas_dger.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dger.c libcblas_a-cblas_dger.obj: CBLAS/src/cblas_dger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dger.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dger.Tpo -c -o libcblas_a-cblas_dger.obj `if test -f 'CBLAS/src/cblas_dger.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dger.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dger.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dger.Tpo $(DEPDIR)/libcblas_a-cblas_dger.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dger.c' object='libcblas_a-cblas_dger.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dger.obj `if test -f 'CBLAS/src/cblas_dger.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dger.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dger.c'; fi` libcblas_a-cblas_sdsdot.o: CBLAS/src/cblas_sdsdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sdsdot.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sdsdot.Tpo -c -o libcblas_a-cblas_sdsdot.o `test -f 'CBLAS/src/cblas_sdsdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sdsdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sdsdot.Tpo $(DEPDIR)/libcblas_a-cblas_sdsdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sdsdot.c' object='libcblas_a-cblas_sdsdot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sdsdot.o `test -f 'CBLAS/src/cblas_sdsdot.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sdsdot.c libcblas_a-cblas_sdsdot.obj: CBLAS/src/cblas_sdsdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sdsdot.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sdsdot.Tpo -c -o libcblas_a-cblas_sdsdot.obj `if test -f 'CBLAS/src/cblas_sdsdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sdsdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sdsdot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sdsdot.Tpo $(DEPDIR)/libcblas_a-cblas_sdsdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sdsdot.c' object='libcblas_a-cblas_sdsdot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sdsdot.obj `if test -f 'CBLAS/src/cblas_sdsdot.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sdsdot.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sdsdot.c'; fi` libcblas_a-cblas_zhemm.o: CBLAS/src/cblas_zhemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhemm.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhemm.Tpo -c -o libcblas_a-cblas_zhemm.o `test -f 'CBLAS/src/cblas_zhemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhemm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhemm.Tpo $(DEPDIR)/libcblas_a-cblas_zhemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhemm.c' object='libcblas_a-cblas_zhemm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhemm.o `test -f 'CBLAS/src/cblas_zhemm.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhemm.c libcblas_a-cblas_zhemm.obj: CBLAS/src/cblas_zhemm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhemm.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhemm.Tpo -c -o libcblas_a-cblas_zhemm.obj `if test -f 'CBLAS/src/cblas_zhemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhemm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhemm.Tpo $(DEPDIR)/libcblas_a-cblas_zhemm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhemm.c' object='libcblas_a-cblas_zhemm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhemm.obj `if test -f 'CBLAS/src/cblas_zhemm.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhemm.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhemm.c'; fi` libcblas_a-cblas_dnrm2.o: CBLAS/src/cblas_dnrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dnrm2.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dnrm2.Tpo -c -o libcblas_a-cblas_dnrm2.o `test -f 'CBLAS/src/cblas_dnrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dnrm2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dnrm2.Tpo $(DEPDIR)/libcblas_a-cblas_dnrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dnrm2.c' object='libcblas_a-cblas_dnrm2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dnrm2.o `test -f 'CBLAS/src/cblas_dnrm2.c' || echo '$(srcdir)/'`CBLAS/src/cblas_dnrm2.c libcblas_a-cblas_dnrm2.obj: CBLAS/src/cblas_dnrm2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_dnrm2.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_dnrm2.Tpo -c -o libcblas_a-cblas_dnrm2.obj `if test -f 'CBLAS/src/cblas_dnrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dnrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dnrm2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_dnrm2.Tpo $(DEPDIR)/libcblas_a-cblas_dnrm2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_dnrm2.c' object='libcblas_a-cblas_dnrm2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_dnrm2.obj `if test -f 'CBLAS/src/cblas_dnrm2.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_dnrm2.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_dnrm2.c'; fi` libcblas_a-cblas_sgbmv.o: CBLAS/src/cblas_sgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgbmv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgbmv.Tpo -c -o libcblas_a-cblas_sgbmv.o `test -f 'CBLAS/src/cblas_sgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgbmv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_sgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgbmv.c' object='libcblas_a-cblas_sgbmv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgbmv.o `test -f 'CBLAS/src/cblas_sgbmv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_sgbmv.c libcblas_a-cblas_sgbmv.obj: CBLAS/src/cblas_sgbmv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_sgbmv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_sgbmv.Tpo -c -o libcblas_a-cblas_sgbmv.obj `if test -f 'CBLAS/src/cblas_sgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgbmv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_sgbmv.Tpo $(DEPDIR)/libcblas_a-cblas_sgbmv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_sgbmv.c' object='libcblas_a-cblas_sgbmv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_sgbmv.obj `if test -f 'CBLAS/src/cblas_sgbmv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_sgbmv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_sgbmv.c'; fi` libcblas_a-cblas_zhemv.o: CBLAS/src/cblas_zhemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhemv.o -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhemv.Tpo -c -o libcblas_a-cblas_zhemv.o `test -f 'CBLAS/src/cblas_zhemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhemv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhemv.Tpo $(DEPDIR)/libcblas_a-cblas_zhemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhemv.c' object='libcblas_a-cblas_zhemv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhemv.o `test -f 'CBLAS/src/cblas_zhemv.c' || echo '$(srcdir)/'`CBLAS/src/cblas_zhemv.c libcblas_a-cblas_zhemv.obj: CBLAS/src/cblas_zhemv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -MT libcblas_a-cblas_zhemv.obj -MD -MP -MF $(DEPDIR)/libcblas_a-cblas_zhemv.Tpo -c -o libcblas_a-cblas_zhemv.obj `if test -f 'CBLAS/src/cblas_zhemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhemv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcblas_a-cblas_zhemv.Tpo $(DEPDIR)/libcblas_a-cblas_zhemv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CBLAS/src/cblas_zhemv.c' object='libcblas_a-cblas_zhemv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcblas_a_CFLAGS) $(CFLAGS) -c -o libcblas_a-cblas_zhemv.obj `if test -f 'CBLAS/src/cblas_zhemv.c'; then $(CYGPATH_W) 'CBLAS/src/cblas_zhemv.c'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cblas_zhemv.c'; fi` .f.o: $(AM_V_F77)$(F77COMPILE) -c -o $@ $< .f.obj: $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` cdotcsub.o: CBLAS/src/cdotcsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotcsub.o `test -f 'CBLAS/src/cdotcsub.f' || echo '$(srcdir)/'`CBLAS/src/cdotcsub.f cdotcsub.obj: CBLAS/src/cdotcsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotcsub.obj `if test -f 'CBLAS/src/cdotcsub.f'; then $(CYGPATH_W) 'CBLAS/src/cdotcsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cdotcsub.f'; fi` cdotusub.o: CBLAS/src/cdotusub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotusub.o `test -f 'CBLAS/src/cdotusub.f' || echo '$(srcdir)/'`CBLAS/src/cdotusub.f cdotusub.obj: CBLAS/src/cdotusub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotusub.obj `if test -f 'CBLAS/src/cdotusub.f'; then $(CYGPATH_W) 'CBLAS/src/cdotusub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/cdotusub.f'; fi` dasumsub.o: CBLAS/src/dasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dasumsub.o `test -f 'CBLAS/src/dasumsub.f' || echo '$(srcdir)/'`CBLAS/src/dasumsub.f dasumsub.obj: CBLAS/src/dasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dasumsub.obj `if test -f 'CBLAS/src/dasumsub.f'; then $(CYGPATH_W) 'CBLAS/src/dasumsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/dasumsub.f'; fi` ddotsub.o: CBLAS/src/ddotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ddotsub.o `test -f 'CBLAS/src/ddotsub.f' || echo '$(srcdir)/'`CBLAS/src/ddotsub.f ddotsub.obj: CBLAS/src/ddotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ddotsub.obj `if test -f 'CBLAS/src/ddotsub.f'; then $(CYGPATH_W) 'CBLAS/src/ddotsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/ddotsub.f'; fi` dnrm2sub.o: CBLAS/src/dnrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dnrm2sub.o `test -f 'CBLAS/src/dnrm2sub.f' || echo '$(srcdir)/'`CBLAS/src/dnrm2sub.f dnrm2sub.obj: CBLAS/src/dnrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dnrm2sub.obj `if test -f 'CBLAS/src/dnrm2sub.f'; then $(CYGPATH_W) 'CBLAS/src/dnrm2sub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/dnrm2sub.f'; fi` dsdotsub.o: CBLAS/src/dsdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsdotsub.o `test -f 'CBLAS/src/dsdotsub.f' || echo '$(srcdir)/'`CBLAS/src/dsdotsub.f dsdotsub.obj: CBLAS/src/dsdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsdotsub.obj `if test -f 'CBLAS/src/dsdotsub.f'; then $(CYGPATH_W) 'CBLAS/src/dsdotsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/dsdotsub.f'; fi` dzasumsub.o: CBLAS/src/dzasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dzasumsub.o `test -f 'CBLAS/src/dzasumsub.f' || echo '$(srcdir)/'`CBLAS/src/dzasumsub.f dzasumsub.obj: CBLAS/src/dzasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dzasumsub.obj `if test -f 'CBLAS/src/dzasumsub.f'; then $(CYGPATH_W) 'CBLAS/src/dzasumsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/dzasumsub.f'; fi` dznrm2sub.o: CBLAS/src/dznrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dznrm2sub.o `test -f 'CBLAS/src/dznrm2sub.f' || echo '$(srcdir)/'`CBLAS/src/dznrm2sub.f dznrm2sub.obj: CBLAS/src/dznrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dznrm2sub.obj `if test -f 'CBLAS/src/dznrm2sub.f'; then $(CYGPATH_W) 'CBLAS/src/dznrm2sub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/dznrm2sub.f'; fi` icamaxsub.o: CBLAS/src/icamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o icamaxsub.o `test -f 'CBLAS/src/icamaxsub.f' || echo '$(srcdir)/'`CBLAS/src/icamaxsub.f icamaxsub.obj: CBLAS/src/icamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o icamaxsub.obj `if test -f 'CBLAS/src/icamaxsub.f'; then $(CYGPATH_W) 'CBLAS/src/icamaxsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/icamaxsub.f'; fi` idamaxsub.o: CBLAS/src/idamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o idamaxsub.o `test -f 'CBLAS/src/idamaxsub.f' || echo '$(srcdir)/'`CBLAS/src/idamaxsub.f idamaxsub.obj: CBLAS/src/idamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o idamaxsub.obj `if test -f 'CBLAS/src/idamaxsub.f'; then $(CYGPATH_W) 'CBLAS/src/idamaxsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/idamaxsub.f'; fi` isamaxsub.o: CBLAS/src/isamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o isamaxsub.o `test -f 'CBLAS/src/isamaxsub.f' || echo '$(srcdir)/'`CBLAS/src/isamaxsub.f isamaxsub.obj: CBLAS/src/isamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o isamaxsub.obj `if test -f 'CBLAS/src/isamaxsub.f'; then $(CYGPATH_W) 'CBLAS/src/isamaxsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/isamaxsub.f'; fi` izamaxsub.o: CBLAS/src/izamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o izamaxsub.o `test -f 'CBLAS/src/izamaxsub.f' || echo '$(srcdir)/'`CBLAS/src/izamaxsub.f izamaxsub.obj: CBLAS/src/izamaxsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o izamaxsub.obj `if test -f 'CBLAS/src/izamaxsub.f'; then $(CYGPATH_W) 'CBLAS/src/izamaxsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/izamaxsub.f'; fi` sasumsub.o: CBLAS/src/sasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sasumsub.o `test -f 'CBLAS/src/sasumsub.f' || echo '$(srcdir)/'`CBLAS/src/sasumsub.f sasumsub.obj: CBLAS/src/sasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sasumsub.obj `if test -f 'CBLAS/src/sasumsub.f'; then $(CYGPATH_W) 'CBLAS/src/sasumsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/sasumsub.f'; fi` scasumsub.o: CBLAS/src/scasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scasumsub.o `test -f 'CBLAS/src/scasumsub.f' || echo '$(srcdir)/'`CBLAS/src/scasumsub.f scasumsub.obj: CBLAS/src/scasumsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scasumsub.obj `if test -f 'CBLAS/src/scasumsub.f'; then $(CYGPATH_W) 'CBLAS/src/scasumsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/scasumsub.f'; fi` scnrm2sub.o: CBLAS/src/scnrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scnrm2sub.o `test -f 'CBLAS/src/scnrm2sub.f' || echo '$(srcdir)/'`CBLAS/src/scnrm2sub.f scnrm2sub.obj: CBLAS/src/scnrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scnrm2sub.obj `if test -f 'CBLAS/src/scnrm2sub.f'; then $(CYGPATH_W) 'CBLAS/src/scnrm2sub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/scnrm2sub.f'; fi` sdotsub.o: CBLAS/src/sdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdotsub.o `test -f 'CBLAS/src/sdotsub.f' || echo '$(srcdir)/'`CBLAS/src/sdotsub.f sdotsub.obj: CBLAS/src/sdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdotsub.obj `if test -f 'CBLAS/src/sdotsub.f'; then $(CYGPATH_W) 'CBLAS/src/sdotsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/sdotsub.f'; fi` sdsdotsub.o: CBLAS/src/sdsdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdsdotsub.o `test -f 'CBLAS/src/sdsdotsub.f' || echo '$(srcdir)/'`CBLAS/src/sdsdotsub.f sdsdotsub.obj: CBLAS/src/sdsdotsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdsdotsub.obj `if test -f 'CBLAS/src/sdsdotsub.f'; then $(CYGPATH_W) 'CBLAS/src/sdsdotsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/sdsdotsub.f'; fi` snrm2sub.o: CBLAS/src/snrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o snrm2sub.o `test -f 'CBLAS/src/snrm2sub.f' || echo '$(srcdir)/'`CBLAS/src/snrm2sub.f snrm2sub.obj: CBLAS/src/snrm2sub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o snrm2sub.obj `if test -f 'CBLAS/src/snrm2sub.f'; then $(CYGPATH_W) 'CBLAS/src/snrm2sub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/snrm2sub.f'; fi` zdotcsub.o: CBLAS/src/zdotcsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotcsub.o `test -f 'CBLAS/src/zdotcsub.f' || echo '$(srcdir)/'`CBLAS/src/zdotcsub.f zdotcsub.obj: CBLAS/src/zdotcsub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotcsub.obj `if test -f 'CBLAS/src/zdotcsub.f'; then $(CYGPATH_W) 'CBLAS/src/zdotcsub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/zdotcsub.f'; fi` zdotusub.o: CBLAS/src/zdotusub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotusub.o `test -f 'CBLAS/src/zdotusub.f' || echo '$(srcdir)/'`CBLAS/src/zdotusub.f zdotusub.obj: CBLAS/src/zdotusub.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotusub.obj `if test -f 'CBLAS/src/zdotusub.f'; then $(CYGPATH_W) 'CBLAS/src/zdotusub.f'; else $(CYGPATH_W) '$(srcdir)/CBLAS/src/zdotusub.f'; fi` caxpy.o: BLAS/caxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o caxpy.o `test -f 'BLAS/caxpy.f' || echo '$(srcdir)/'`BLAS/caxpy.f caxpy.obj: BLAS/caxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o caxpy.obj `if test -f 'BLAS/caxpy.f'; then $(CYGPATH_W) 'BLAS/caxpy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/caxpy.f'; fi` crotg.o: BLAS/crotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o crotg.o `test -f 'BLAS/crotg.f' || echo '$(srcdir)/'`BLAS/crotg.f crotg.obj: BLAS/crotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o crotg.obj `if test -f 'BLAS/crotg.f'; then $(CYGPATH_W) 'BLAS/crotg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/crotg.f'; fi` dcopy.o: BLAS/dcopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dcopy.o `test -f 'BLAS/dcopy.f' || echo '$(srcdir)/'`BLAS/dcopy.f dcopy.obj: BLAS/dcopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dcopy.obj `if test -f 'BLAS/dcopy.f'; then $(CYGPATH_W) 'BLAS/dcopy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dcopy.f'; fi` dsymv.o: BLAS/dsymv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsymv.o `test -f 'BLAS/dsymv.f' || echo '$(srcdir)/'`BLAS/dsymv.f dsymv.obj: BLAS/dsymv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsymv.obj `if test -f 'BLAS/dsymv.f'; then $(CYGPATH_W) 'BLAS/dsymv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsymv.f'; fi` lsame.o: BLAS/lsame.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o lsame.o `test -f 'BLAS/lsame.f' || echo '$(srcdir)/'`BLAS/lsame.f lsame.obj: BLAS/lsame.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o lsame.obj `if test -f 'BLAS/lsame.f'; then $(CYGPATH_W) 'BLAS/lsame.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/lsame.f'; fi` sspmv.o: BLAS/sspmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspmv.o `test -f 'BLAS/sspmv.f' || echo '$(srcdir)/'`BLAS/sspmv.f sspmv.obj: BLAS/sspmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspmv.obj `if test -f 'BLAS/sspmv.f'; then $(CYGPATH_W) 'BLAS/sspmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sspmv.f'; fi` zaxpy.o: BLAS/zaxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zaxpy.o `test -f 'BLAS/zaxpy.f' || echo '$(srcdir)/'`BLAS/zaxpy.f zaxpy.obj: BLAS/zaxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zaxpy.obj `if test -f 'BLAS/zaxpy.f'; then $(CYGPATH_W) 'BLAS/zaxpy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zaxpy.f'; fi` zhpr2.o: BLAS/zhpr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpr2.o `test -f 'BLAS/zhpr2.f' || echo '$(srcdir)/'`BLAS/zhpr2.f zhpr2.obj: BLAS/zhpr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpr2.obj `if test -f 'BLAS/zhpr2.f'; then $(CYGPATH_W) 'BLAS/zhpr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhpr2.f'; fi` ccopy.o: BLAS/ccopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ccopy.o `test -f 'BLAS/ccopy.f' || echo '$(srcdir)/'`BLAS/ccopy.f ccopy.obj: BLAS/ccopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ccopy.obj `if test -f 'BLAS/ccopy.f'; then $(CYGPATH_W) 'BLAS/ccopy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ccopy.f'; fi` cscal.o: BLAS/cscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cscal.o `test -f 'BLAS/cscal.f' || echo '$(srcdir)/'`BLAS/cscal.f cscal.obj: BLAS/cscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cscal.obj `if test -f 'BLAS/cscal.f'; then $(CYGPATH_W) 'BLAS/cscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cscal.f'; fi` ddot.o: BLAS/ddot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ddot.o `test -f 'BLAS/ddot.f' || echo '$(srcdir)/'`BLAS/ddot.f ddot.obj: BLAS/ddot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ddot.obj `if test -f 'BLAS/ddot.f'; then $(CYGPATH_W) 'BLAS/ddot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ddot.f'; fi` dsyr2.o: BLAS/dsyr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr2.o `test -f 'BLAS/dsyr2.f' || echo '$(srcdir)/'`BLAS/dsyr2.f dsyr2.obj: BLAS/dsyr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr2.obj `if test -f 'BLAS/dsyr2.f'; then $(CYGPATH_W) 'BLAS/dsyr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsyr2.f'; fi` sasum.o: BLAS/sasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sasum.o `test -f 'BLAS/sasum.f' || echo '$(srcdir)/'`BLAS/sasum.f sasum.obj: BLAS/sasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sasum.obj `if test -f 'BLAS/sasum.f'; then $(CYGPATH_W) 'BLAS/sasum.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sasum.f'; fi` sspr2.o: BLAS/sspr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspr2.o `test -f 'BLAS/sspr2.f' || echo '$(srcdir)/'`BLAS/sspr2.f sspr2.obj: BLAS/sspr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspr2.obj `if test -f 'BLAS/sspr2.f'; then $(CYGPATH_W) 'BLAS/sspr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sspr2.f'; fi` zcopy.o: BLAS/zcopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zcopy.o `test -f 'BLAS/zcopy.f' || echo '$(srcdir)/'`BLAS/zcopy.f zcopy.obj: BLAS/zcopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zcopy.obj `if test -f 'BLAS/zcopy.f'; then $(CYGPATH_W) 'BLAS/zcopy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zcopy.f'; fi` zhpr.o: BLAS/zhpr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpr.o `test -f 'BLAS/zhpr.f' || echo '$(srcdir)/'`BLAS/zhpr.f zhpr.obj: BLAS/zhpr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpr.obj `if test -f 'BLAS/zhpr.f'; then $(CYGPATH_W) 'BLAS/zhpr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhpr.f'; fi` cdotc.o: BLAS/cdotc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotc.o `test -f 'BLAS/cdotc.f' || echo '$(srcdir)/'`BLAS/cdotc.f cdotc.obj: BLAS/cdotc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotc.obj `if test -f 'BLAS/cdotc.f'; then $(CYGPATH_W) 'BLAS/cdotc.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cdotc.f'; fi` csrot.o: BLAS/csrot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csrot.o `test -f 'BLAS/csrot.f' || echo '$(srcdir)/'`BLAS/csrot.f csrot.obj: BLAS/csrot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csrot.obj `if test -f 'BLAS/csrot.f'; then $(CYGPATH_W) 'BLAS/csrot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/csrot.f'; fi` dgbmv.o: BLAS/dgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgbmv.o `test -f 'BLAS/dgbmv.f' || echo '$(srcdir)/'`BLAS/dgbmv.f dgbmv.obj: BLAS/dgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgbmv.obj `if test -f 'BLAS/dgbmv.f'; then $(CYGPATH_W) 'BLAS/dgbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dgbmv.f'; fi` dsyr2k.o: BLAS/dsyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr2k.o `test -f 'BLAS/dsyr2k.f' || echo '$(srcdir)/'`BLAS/dsyr2k.f dsyr2k.obj: BLAS/dsyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr2k.obj `if test -f 'BLAS/dsyr2k.f'; then $(CYGPATH_W) 'BLAS/dsyr2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsyr2k.f'; fi` saxpy.o: BLAS/saxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o saxpy.o `test -f 'BLAS/saxpy.f' || echo '$(srcdir)/'`BLAS/saxpy.f saxpy.obj: BLAS/saxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o saxpy.obj `if test -f 'BLAS/saxpy.f'; then $(CYGPATH_W) 'BLAS/saxpy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/saxpy.f'; fi` sspr.o: BLAS/sspr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspr.o `test -f 'BLAS/sspr.f' || echo '$(srcdir)/'`BLAS/sspr.f sspr.obj: BLAS/sspr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sspr.obj `if test -f 'BLAS/sspr.f'; then $(CYGPATH_W) 'BLAS/sspr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sspr.f'; fi` zdotc.o: BLAS/zdotc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotc.o `test -f 'BLAS/zdotc.f' || echo '$(srcdir)/'`BLAS/zdotc.f zdotc.obj: BLAS/zdotc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotc.obj `if test -f 'BLAS/zdotc.f'; then $(CYGPATH_W) 'BLAS/zdotc.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zdotc.f'; fi` zrotg.o: BLAS/zrotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zrotg.o `test -f 'BLAS/zrotg.f' || echo '$(srcdir)/'`BLAS/zrotg.f zrotg.obj: BLAS/zrotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zrotg.obj `if test -f 'BLAS/zrotg.f'; then $(CYGPATH_W) 'BLAS/zrotg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zrotg.f'; fi` cdotu.o: BLAS/cdotu.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotu.o `test -f 'BLAS/cdotu.f' || echo '$(srcdir)/'`BLAS/cdotu.f cdotu.obj: BLAS/cdotu.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cdotu.obj `if test -f 'BLAS/cdotu.f'; then $(CYGPATH_W) 'BLAS/cdotu.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cdotu.f'; fi` csscal.o: BLAS/csscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csscal.o `test -f 'BLAS/csscal.f' || echo '$(srcdir)/'`BLAS/csscal.f csscal.obj: BLAS/csscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csscal.obj `if test -f 'BLAS/csscal.f'; then $(CYGPATH_W) 'BLAS/csscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/csscal.f'; fi` dgemm.o: BLAS/dgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgemm.o `test -f 'BLAS/dgemm.f' || echo '$(srcdir)/'`BLAS/dgemm.f dgemm.obj: BLAS/dgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgemm.obj `if test -f 'BLAS/dgemm.f'; then $(CYGPATH_W) 'BLAS/dgemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dgemm.f'; fi` dsyr.o: BLAS/dsyr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr.o `test -f 'BLAS/dsyr.f' || echo '$(srcdir)/'`BLAS/dsyr.f dsyr.obj: BLAS/dsyr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyr.obj `if test -f 'BLAS/dsyr.f'; then $(CYGPATH_W) 'BLAS/dsyr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsyr.f'; fi` scasum.o: BLAS/scasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scasum.o `test -f 'BLAS/scasum.f' || echo '$(srcdir)/'`BLAS/scasum.f scasum.obj: BLAS/scasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scasum.obj `if test -f 'BLAS/scasum.f'; then $(CYGPATH_W) 'BLAS/scasum.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/scasum.f'; fi` sswap.o: BLAS/sswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sswap.o `test -f 'BLAS/sswap.f' || echo '$(srcdir)/'`BLAS/sswap.f sswap.obj: BLAS/sswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sswap.obj `if test -f 'BLAS/sswap.f'; then $(CYGPATH_W) 'BLAS/sswap.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sswap.f'; fi` zdotu.o: BLAS/zdotu.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotu.o `test -f 'BLAS/zdotu.f' || echo '$(srcdir)/'`BLAS/zdotu.f zdotu.obj: BLAS/zdotu.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdotu.obj `if test -f 'BLAS/zdotu.f'; then $(CYGPATH_W) 'BLAS/zdotu.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zdotu.f'; fi` zscal.o: BLAS/zscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zscal.o `test -f 'BLAS/zscal.f' || echo '$(srcdir)/'`BLAS/zscal.f zscal.obj: BLAS/zscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zscal.obj `if test -f 'BLAS/zscal.f'; then $(CYGPATH_W) 'BLAS/zscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zscal.f'; fi` cgbmv.o: BLAS/cgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgbmv.o `test -f 'BLAS/cgbmv.f' || echo '$(srcdir)/'`BLAS/cgbmv.f cgbmv.obj: BLAS/cgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgbmv.obj `if test -f 'BLAS/cgbmv.f'; then $(CYGPATH_W) 'BLAS/cgbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cgbmv.f'; fi` cswap.o: BLAS/cswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cswap.o `test -f 'BLAS/cswap.f' || echo '$(srcdir)/'`BLAS/cswap.f cswap.obj: BLAS/cswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cswap.obj `if test -f 'BLAS/cswap.f'; then $(CYGPATH_W) 'BLAS/cswap.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cswap.f'; fi` dgemv.o: BLAS/dgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgemv.o `test -f 'BLAS/dgemv.f' || echo '$(srcdir)/'`BLAS/dgemv.f dgemv.obj: BLAS/dgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dgemv.obj `if test -f 'BLAS/dgemv.f'; then $(CYGPATH_W) 'BLAS/dgemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dgemv.f'; fi` dsyrk.o: BLAS/dsyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyrk.o `test -f 'BLAS/dsyrk.f' || echo '$(srcdir)/'`BLAS/dsyrk.f dsyrk.obj: BLAS/dsyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsyrk.obj `if test -f 'BLAS/dsyrk.f'; then $(CYGPATH_W) 'BLAS/dsyrk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsyrk.f'; fi` scnrm2.o: BLAS/scnrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scnrm2.o `test -f 'BLAS/scnrm2.f' || echo '$(srcdir)/'`BLAS/scnrm2.f scnrm2.obj: BLAS/scnrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scnrm2.obj `if test -f 'BLAS/scnrm2.f'; then $(CYGPATH_W) 'BLAS/scnrm2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/scnrm2.f'; fi` ssymm.o: BLAS/ssymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssymm.o `test -f 'BLAS/ssymm.f' || echo '$(srcdir)/'`BLAS/ssymm.f ssymm.obj: BLAS/ssymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssymm.obj `if test -f 'BLAS/ssymm.f'; then $(CYGPATH_W) 'BLAS/ssymm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssymm.f'; fi` zdrot.o: BLAS/zdrot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdrot.o `test -f 'BLAS/zdrot.f' || echo '$(srcdir)/'`BLAS/zdrot.f zdrot.obj: BLAS/zdrot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdrot.obj `if test -f 'BLAS/zdrot.f'; then $(CYGPATH_W) 'BLAS/zdrot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zdrot.f'; fi` zswap.o: BLAS/zswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zswap.o `test -f 'BLAS/zswap.f' || echo '$(srcdir)/'`BLAS/zswap.f zswap.obj: BLAS/zswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zswap.obj `if test -f 'BLAS/zswap.f'; then $(CYGPATH_W) 'BLAS/zswap.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zswap.f'; fi` cgemm.o: BLAS/cgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgemm.o `test -f 'BLAS/cgemm.f' || echo '$(srcdir)/'`BLAS/cgemm.f cgemm.obj: BLAS/cgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgemm.obj `if test -f 'BLAS/cgemm.f'; then $(CYGPATH_W) 'BLAS/cgemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cgemm.f'; fi` csymm.o: BLAS/csymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csymm.o `test -f 'BLAS/csymm.f' || echo '$(srcdir)/'`BLAS/csymm.f csymm.obj: BLAS/csymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csymm.obj `if test -f 'BLAS/csymm.f'; then $(CYGPATH_W) 'BLAS/csymm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/csymm.f'; fi` dger.o: BLAS/dger.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dger.o `test -f 'BLAS/dger.f' || echo '$(srcdir)/'`BLAS/dger.f dger.obj: BLAS/dger.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dger.obj `if test -f 'BLAS/dger.f'; then $(CYGPATH_W) 'BLAS/dger.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dger.f'; fi` dtbmv.o: BLAS/dtbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtbmv.o `test -f 'BLAS/dtbmv.f' || echo '$(srcdir)/'`BLAS/dtbmv.f dtbmv.obj: BLAS/dtbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtbmv.obj `if test -f 'BLAS/dtbmv.f'; then $(CYGPATH_W) 'BLAS/dtbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtbmv.f'; fi` scopy.o: BLAS/scopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scopy.o `test -f 'BLAS/scopy.f' || echo '$(srcdir)/'`BLAS/scopy.f scopy.obj: BLAS/scopy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scopy.obj `if test -f 'BLAS/scopy.f'; then $(CYGPATH_W) 'BLAS/scopy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/scopy.f'; fi` ssymv.o: BLAS/ssymv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssymv.o `test -f 'BLAS/ssymv.f' || echo '$(srcdir)/'`BLAS/ssymv.f ssymv.obj: BLAS/ssymv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssymv.obj `if test -f 'BLAS/ssymv.f'; then $(CYGPATH_W) 'BLAS/ssymv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssymv.f'; fi` zdscal.o: BLAS/zdscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdscal.o `test -f 'BLAS/zdscal.f' || echo '$(srcdir)/'`BLAS/zdscal.f zdscal.obj: BLAS/zdscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zdscal.obj `if test -f 'BLAS/zdscal.f'; then $(CYGPATH_W) 'BLAS/zdscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zdscal.f'; fi` zsymm.o: BLAS/zsymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsymm.o `test -f 'BLAS/zsymm.f' || echo '$(srcdir)/'`BLAS/zsymm.f zsymm.obj: BLAS/zsymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsymm.obj `if test -f 'BLAS/zsymm.f'; then $(CYGPATH_W) 'BLAS/zsymm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zsymm.f'; fi` cgemv.o: BLAS/cgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgemv.o `test -f 'BLAS/cgemv.f' || echo '$(srcdir)/'`BLAS/cgemv.f cgemv.obj: BLAS/cgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgemv.obj `if test -f 'BLAS/cgemv.f'; then $(CYGPATH_W) 'BLAS/cgemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cgemv.f'; fi` csyr2k.o: BLAS/csyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csyr2k.o `test -f 'BLAS/csyr2k.f' || echo '$(srcdir)/'`BLAS/csyr2k.f csyr2k.obj: BLAS/csyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csyr2k.obj `if test -f 'BLAS/csyr2k.f'; then $(CYGPATH_W) 'BLAS/csyr2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/csyr2k.f'; fi` dnrm2.o: BLAS/dnrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dnrm2.o `test -f 'BLAS/dnrm2.f' || echo '$(srcdir)/'`BLAS/dnrm2.f dnrm2.obj: BLAS/dnrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dnrm2.obj `if test -f 'BLAS/dnrm2.f'; then $(CYGPATH_W) 'BLAS/dnrm2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dnrm2.f'; fi` dtbsv.o: BLAS/dtbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtbsv.o `test -f 'BLAS/dtbsv.f' || echo '$(srcdir)/'`BLAS/dtbsv.f dtbsv.obj: BLAS/dtbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtbsv.obj `if test -f 'BLAS/dtbsv.f'; then $(CYGPATH_W) 'BLAS/dtbsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtbsv.f'; fi` sdot.o: BLAS/sdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdot.o `test -f 'BLAS/sdot.f' || echo '$(srcdir)/'`BLAS/sdot.f sdot.obj: BLAS/sdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdot.obj `if test -f 'BLAS/sdot.f'; then $(CYGPATH_W) 'BLAS/sdot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sdot.f'; fi` ssyr2.o: BLAS/ssyr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr2.o `test -f 'BLAS/ssyr2.f' || echo '$(srcdir)/'`BLAS/ssyr2.f ssyr2.obj: BLAS/ssyr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr2.obj `if test -f 'BLAS/ssyr2.f'; then $(CYGPATH_W) 'BLAS/ssyr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssyr2.f'; fi` zgbmv.o: BLAS/zgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgbmv.o `test -f 'BLAS/zgbmv.f' || echo '$(srcdir)/'`BLAS/zgbmv.f zgbmv.obj: BLAS/zgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgbmv.obj `if test -f 'BLAS/zgbmv.f'; then $(CYGPATH_W) 'BLAS/zgbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zgbmv.f'; fi` zsyr2k.o: BLAS/zsyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsyr2k.o `test -f 'BLAS/zsyr2k.f' || echo '$(srcdir)/'`BLAS/zsyr2k.f zsyr2k.obj: BLAS/zsyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsyr2k.obj `if test -f 'BLAS/zsyr2k.f'; then $(CYGPATH_W) 'BLAS/zsyr2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zsyr2k.f'; fi` cgerc.o: BLAS/cgerc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgerc.o `test -f 'BLAS/cgerc.f' || echo '$(srcdir)/'`BLAS/cgerc.f cgerc.obj: BLAS/cgerc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgerc.obj `if test -f 'BLAS/cgerc.f'; then $(CYGPATH_W) 'BLAS/cgerc.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cgerc.f'; fi` csyrk.o: BLAS/csyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csyrk.o `test -f 'BLAS/csyrk.f' || echo '$(srcdir)/'`BLAS/csyrk.f csyrk.obj: BLAS/csyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o csyrk.obj `if test -f 'BLAS/csyrk.f'; then $(CYGPATH_W) 'BLAS/csyrk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/csyrk.f'; fi` drot.o: BLAS/drot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drot.o `test -f 'BLAS/drot.f' || echo '$(srcdir)/'`BLAS/drot.f drot.obj: BLAS/drot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drot.obj `if test -f 'BLAS/drot.f'; then $(CYGPATH_W) 'BLAS/drot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/drot.f'; fi` dtpmv.o: BLAS/dtpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtpmv.o `test -f 'BLAS/dtpmv.f' || echo '$(srcdir)/'`BLAS/dtpmv.f dtpmv.obj: BLAS/dtpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtpmv.obj `if test -f 'BLAS/dtpmv.f'; then $(CYGPATH_W) 'BLAS/dtpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtpmv.f'; fi` sdsdot.o: BLAS/sdsdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdsdot.o `test -f 'BLAS/sdsdot.f' || echo '$(srcdir)/'`BLAS/sdsdot.f sdsdot.obj: BLAS/sdsdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sdsdot.obj `if test -f 'BLAS/sdsdot.f'; then $(CYGPATH_W) 'BLAS/sdsdot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sdsdot.f'; fi` ssyr2k.o: BLAS/ssyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr2k.o `test -f 'BLAS/ssyr2k.f' || echo '$(srcdir)/'`BLAS/ssyr2k.f ssyr2k.obj: BLAS/ssyr2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr2k.obj `if test -f 'BLAS/ssyr2k.f'; then $(CYGPATH_W) 'BLAS/ssyr2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssyr2k.f'; fi` zgemm.o: BLAS/zgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgemm.o `test -f 'BLAS/zgemm.f' || echo '$(srcdir)/'`BLAS/zgemm.f zgemm.obj: BLAS/zgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgemm.obj `if test -f 'BLAS/zgemm.f'; then $(CYGPATH_W) 'BLAS/zgemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zgemm.f'; fi` zsyrk.o: BLAS/zsyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsyrk.o `test -f 'BLAS/zsyrk.f' || echo '$(srcdir)/'`BLAS/zsyrk.f zsyrk.obj: BLAS/zsyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zsyrk.obj `if test -f 'BLAS/zsyrk.f'; then $(CYGPATH_W) 'BLAS/zsyrk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zsyrk.f'; fi` cgeru.o: BLAS/cgeru.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgeru.o `test -f 'BLAS/cgeru.f' || echo '$(srcdir)/'`BLAS/cgeru.f cgeru.obj: BLAS/cgeru.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cgeru.obj `if test -f 'BLAS/cgeru.f'; then $(CYGPATH_W) 'BLAS/cgeru.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cgeru.f'; fi` ctbmv.o: BLAS/ctbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctbmv.o `test -f 'BLAS/ctbmv.f' || echo '$(srcdir)/'`BLAS/ctbmv.f ctbmv.obj: BLAS/ctbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctbmv.obj `if test -f 'BLAS/ctbmv.f'; then $(CYGPATH_W) 'BLAS/ctbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctbmv.f'; fi` drotg.o: BLAS/drotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotg.o `test -f 'BLAS/drotg.f' || echo '$(srcdir)/'`BLAS/drotg.f drotg.obj: BLAS/drotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotg.obj `if test -f 'BLAS/drotg.f'; then $(CYGPATH_W) 'BLAS/drotg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/drotg.f'; fi` dtpsv.o: BLAS/dtpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtpsv.o `test -f 'BLAS/dtpsv.f' || echo '$(srcdir)/'`BLAS/dtpsv.f dtpsv.obj: BLAS/dtpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtpsv.obj `if test -f 'BLAS/dtpsv.f'; then $(CYGPATH_W) 'BLAS/dtpsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtpsv.f'; fi` sgbmv.o: BLAS/sgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgbmv.o `test -f 'BLAS/sgbmv.f' || echo '$(srcdir)/'`BLAS/sgbmv.f sgbmv.obj: BLAS/sgbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgbmv.obj `if test -f 'BLAS/sgbmv.f'; then $(CYGPATH_W) 'BLAS/sgbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sgbmv.f'; fi` ssyr.o: BLAS/ssyr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr.o `test -f 'BLAS/ssyr.f' || echo '$(srcdir)/'`BLAS/ssyr.f ssyr.obj: BLAS/ssyr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyr.obj `if test -f 'BLAS/ssyr.f'; then $(CYGPATH_W) 'BLAS/ssyr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssyr.f'; fi` zgemv.o: BLAS/zgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgemv.o `test -f 'BLAS/zgemv.f' || echo '$(srcdir)/'`BLAS/zgemv.f zgemv.obj: BLAS/zgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgemv.obj `if test -f 'BLAS/zgemv.f'; then $(CYGPATH_W) 'BLAS/zgemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zgemv.f'; fi` ztbmv.o: BLAS/ztbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztbmv.o `test -f 'BLAS/ztbmv.f' || echo '$(srcdir)/'`BLAS/ztbmv.f ztbmv.obj: BLAS/ztbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztbmv.obj `if test -f 'BLAS/ztbmv.f'; then $(CYGPATH_W) 'BLAS/ztbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztbmv.f'; fi` chbmv.o: BLAS/chbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chbmv.o `test -f 'BLAS/chbmv.f' || echo '$(srcdir)/'`BLAS/chbmv.f chbmv.obj: BLAS/chbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chbmv.obj `if test -f 'BLAS/chbmv.f'; then $(CYGPATH_W) 'BLAS/chbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chbmv.f'; fi` ctbsv.o: BLAS/ctbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctbsv.o `test -f 'BLAS/ctbsv.f' || echo '$(srcdir)/'`BLAS/ctbsv.f ctbsv.obj: BLAS/ctbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctbsv.obj `if test -f 'BLAS/ctbsv.f'; then $(CYGPATH_W) 'BLAS/ctbsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctbsv.f'; fi` drotm.o: BLAS/drotm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotm.o `test -f 'BLAS/drotm.f' || echo '$(srcdir)/'`BLAS/drotm.f drotm.obj: BLAS/drotm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotm.obj `if test -f 'BLAS/drotm.f'; then $(CYGPATH_W) 'BLAS/drotm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/drotm.f'; fi` dtrmm.o: BLAS/dtrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrmm.o `test -f 'BLAS/dtrmm.f' || echo '$(srcdir)/'`BLAS/dtrmm.f dtrmm.obj: BLAS/dtrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrmm.obj `if test -f 'BLAS/dtrmm.f'; then $(CYGPATH_W) 'BLAS/dtrmm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtrmm.f'; fi` sgemm.o: BLAS/sgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgemm.o `test -f 'BLAS/sgemm.f' || echo '$(srcdir)/'`BLAS/sgemm.f sgemm.obj: BLAS/sgemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgemm.obj `if test -f 'BLAS/sgemm.f'; then $(CYGPATH_W) 'BLAS/sgemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sgemm.f'; fi` ssyrk.o: BLAS/ssyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyrk.o `test -f 'BLAS/ssyrk.f' || echo '$(srcdir)/'`BLAS/ssyrk.f ssyrk.obj: BLAS/ssyrk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssyrk.obj `if test -f 'BLAS/ssyrk.f'; then $(CYGPATH_W) 'BLAS/ssyrk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssyrk.f'; fi` zgerc.o: BLAS/zgerc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgerc.o `test -f 'BLAS/zgerc.f' || echo '$(srcdir)/'`BLAS/zgerc.f zgerc.obj: BLAS/zgerc.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgerc.obj `if test -f 'BLAS/zgerc.f'; then $(CYGPATH_W) 'BLAS/zgerc.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zgerc.f'; fi` ztbsv.o: BLAS/ztbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztbsv.o `test -f 'BLAS/ztbsv.f' || echo '$(srcdir)/'`BLAS/ztbsv.f ztbsv.obj: BLAS/ztbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztbsv.obj `if test -f 'BLAS/ztbsv.f'; then $(CYGPATH_W) 'BLAS/ztbsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztbsv.f'; fi` chemm.o: BLAS/chemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chemm.o `test -f 'BLAS/chemm.f' || echo '$(srcdir)/'`BLAS/chemm.f chemm.obj: BLAS/chemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chemm.obj `if test -f 'BLAS/chemm.f'; then $(CYGPATH_W) 'BLAS/chemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chemm.f'; fi` ctpmv.o: BLAS/ctpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctpmv.o `test -f 'BLAS/ctpmv.f' || echo '$(srcdir)/'`BLAS/ctpmv.f ctpmv.obj: BLAS/ctpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctpmv.obj `if test -f 'BLAS/ctpmv.f'; then $(CYGPATH_W) 'BLAS/ctpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctpmv.f'; fi` drotmg.o: BLAS/drotmg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotmg.o `test -f 'BLAS/drotmg.f' || echo '$(srcdir)/'`BLAS/drotmg.f drotmg.obj: BLAS/drotmg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o drotmg.obj `if test -f 'BLAS/drotmg.f'; then $(CYGPATH_W) 'BLAS/drotmg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/drotmg.f'; fi` dtrmv.o: BLAS/dtrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrmv.o `test -f 'BLAS/dtrmv.f' || echo '$(srcdir)/'`BLAS/dtrmv.f dtrmv.obj: BLAS/dtrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrmv.obj `if test -f 'BLAS/dtrmv.f'; then $(CYGPATH_W) 'BLAS/dtrmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtrmv.f'; fi` sgemv.o: BLAS/sgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgemv.o `test -f 'BLAS/sgemv.f' || echo '$(srcdir)/'`BLAS/sgemv.f sgemv.obj: BLAS/sgemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sgemv.obj `if test -f 'BLAS/sgemv.f'; then $(CYGPATH_W) 'BLAS/sgemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sgemv.f'; fi` stbmv.o: BLAS/stbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stbmv.o `test -f 'BLAS/stbmv.f' || echo '$(srcdir)/'`BLAS/stbmv.f stbmv.obj: BLAS/stbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stbmv.obj `if test -f 'BLAS/stbmv.f'; then $(CYGPATH_W) 'BLAS/stbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/stbmv.f'; fi` zgeru.o: BLAS/zgeru.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgeru.o `test -f 'BLAS/zgeru.f' || echo '$(srcdir)/'`BLAS/zgeru.f zgeru.obj: BLAS/zgeru.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zgeru.obj `if test -f 'BLAS/zgeru.f'; then $(CYGPATH_W) 'BLAS/zgeru.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zgeru.f'; fi` ztpmv.o: BLAS/ztpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztpmv.o `test -f 'BLAS/ztpmv.f' || echo '$(srcdir)/'`BLAS/ztpmv.f ztpmv.obj: BLAS/ztpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztpmv.obj `if test -f 'BLAS/ztpmv.f'; then $(CYGPATH_W) 'BLAS/ztpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztpmv.f'; fi` chemv.o: BLAS/chemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chemv.o `test -f 'BLAS/chemv.f' || echo '$(srcdir)/'`BLAS/chemv.f chemv.obj: BLAS/chemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chemv.obj `if test -f 'BLAS/chemv.f'; then $(CYGPATH_W) 'BLAS/chemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chemv.f'; fi` ctpsv.o: BLAS/ctpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctpsv.o `test -f 'BLAS/ctpsv.f' || echo '$(srcdir)/'`BLAS/ctpsv.f ctpsv.obj: BLAS/ctpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctpsv.obj `if test -f 'BLAS/ctpsv.f'; then $(CYGPATH_W) 'BLAS/ctpsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctpsv.f'; fi` dsbmv.o: BLAS/dsbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsbmv.o `test -f 'BLAS/dsbmv.f' || echo '$(srcdir)/'`BLAS/dsbmv.f dsbmv.obj: BLAS/dsbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsbmv.obj `if test -f 'BLAS/dsbmv.f'; then $(CYGPATH_W) 'BLAS/dsbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsbmv.f'; fi` dtrsm.o: BLAS/dtrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrsm.o `test -f 'BLAS/dtrsm.f' || echo '$(srcdir)/'`BLAS/dtrsm.f dtrsm.obj: BLAS/dtrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrsm.obj `if test -f 'BLAS/dtrsm.f'; then $(CYGPATH_W) 'BLAS/dtrsm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtrsm.f'; fi` sger.o: BLAS/sger.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sger.o `test -f 'BLAS/sger.f' || echo '$(srcdir)/'`BLAS/sger.f sger.obj: BLAS/sger.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sger.obj `if test -f 'BLAS/sger.f'; then $(CYGPATH_W) 'BLAS/sger.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sger.f'; fi` stbsv.o: BLAS/stbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stbsv.o `test -f 'BLAS/stbsv.f' || echo '$(srcdir)/'`BLAS/stbsv.f stbsv.obj: BLAS/stbsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stbsv.obj `if test -f 'BLAS/stbsv.f'; then $(CYGPATH_W) 'BLAS/stbsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/stbsv.f'; fi` zhbmv.o: BLAS/zhbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhbmv.o `test -f 'BLAS/zhbmv.f' || echo '$(srcdir)/'`BLAS/zhbmv.f zhbmv.obj: BLAS/zhbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhbmv.obj `if test -f 'BLAS/zhbmv.f'; then $(CYGPATH_W) 'BLAS/zhbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhbmv.f'; fi` ztpsv.o: BLAS/ztpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztpsv.o `test -f 'BLAS/ztpsv.f' || echo '$(srcdir)/'`BLAS/ztpsv.f ztpsv.obj: BLAS/ztpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztpsv.obj `if test -f 'BLAS/ztpsv.f'; then $(CYGPATH_W) 'BLAS/ztpsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztpsv.f'; fi` cher2.o: BLAS/cher2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher2.o `test -f 'BLAS/cher2.f' || echo '$(srcdir)/'`BLAS/cher2.f cher2.obj: BLAS/cher2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher2.obj `if test -f 'BLAS/cher2.f'; then $(CYGPATH_W) 'BLAS/cher2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cher2.f'; fi` ctrmm.o: BLAS/ctrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrmm.o `test -f 'BLAS/ctrmm.f' || echo '$(srcdir)/'`BLAS/ctrmm.f ctrmm.obj: BLAS/ctrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrmm.obj `if test -f 'BLAS/ctrmm.f'; then $(CYGPATH_W) 'BLAS/ctrmm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctrmm.f'; fi` dscal.o: BLAS/dscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dscal.o `test -f 'BLAS/dscal.f' || echo '$(srcdir)/'`BLAS/dscal.f dscal.obj: BLAS/dscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dscal.obj `if test -f 'BLAS/dscal.f'; then $(CYGPATH_W) 'BLAS/dscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dscal.f'; fi` dtrsv.o: BLAS/dtrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrsv.o `test -f 'BLAS/dtrsv.f' || echo '$(srcdir)/'`BLAS/dtrsv.f dtrsv.obj: BLAS/dtrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dtrsv.obj `if test -f 'BLAS/dtrsv.f'; then $(CYGPATH_W) 'BLAS/dtrsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dtrsv.f'; fi` snrm2.o: BLAS/snrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o snrm2.o `test -f 'BLAS/snrm2.f' || echo '$(srcdir)/'`BLAS/snrm2.f snrm2.obj: BLAS/snrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o snrm2.obj `if test -f 'BLAS/snrm2.f'; then $(CYGPATH_W) 'BLAS/snrm2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/snrm2.f'; fi` stpmv.o: BLAS/stpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stpmv.o `test -f 'BLAS/stpmv.f' || echo '$(srcdir)/'`BLAS/stpmv.f stpmv.obj: BLAS/stpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stpmv.obj `if test -f 'BLAS/stpmv.f'; then $(CYGPATH_W) 'BLAS/stpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/stpmv.f'; fi` zhemm.o: BLAS/zhemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhemm.o `test -f 'BLAS/zhemm.f' || echo '$(srcdir)/'`BLAS/zhemm.f zhemm.obj: BLAS/zhemm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhemm.obj `if test -f 'BLAS/zhemm.f'; then $(CYGPATH_W) 'BLAS/zhemm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhemm.f'; fi` ztrmm.o: BLAS/ztrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrmm.o `test -f 'BLAS/ztrmm.f' || echo '$(srcdir)/'`BLAS/ztrmm.f ztrmm.obj: BLAS/ztrmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrmm.obj `if test -f 'BLAS/ztrmm.f'; then $(CYGPATH_W) 'BLAS/ztrmm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztrmm.f'; fi` cher2k.o: BLAS/cher2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher2k.o `test -f 'BLAS/cher2k.f' || echo '$(srcdir)/'`BLAS/cher2k.f cher2k.obj: BLAS/cher2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher2k.obj `if test -f 'BLAS/cher2k.f'; then $(CYGPATH_W) 'BLAS/cher2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cher2k.f'; fi` ctrmv.o: BLAS/ctrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrmv.o `test -f 'BLAS/ctrmv.f' || echo '$(srcdir)/'`BLAS/ctrmv.f ctrmv.obj: BLAS/ctrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrmv.obj `if test -f 'BLAS/ctrmv.f'; then $(CYGPATH_W) 'BLAS/ctrmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctrmv.f'; fi` dsdot.o: BLAS/dsdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsdot.o `test -f 'BLAS/dsdot.f' || echo '$(srcdir)/'`BLAS/dsdot.f dsdot.obj: BLAS/dsdot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsdot.obj `if test -f 'BLAS/dsdot.f'; then $(CYGPATH_W) 'BLAS/dsdot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsdot.f'; fi` dzasum.o: BLAS/dzasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dzasum.o `test -f 'BLAS/dzasum.f' || echo '$(srcdir)/'`BLAS/dzasum.f dzasum.obj: BLAS/dzasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dzasum.obj `if test -f 'BLAS/dzasum.f'; then $(CYGPATH_W) 'BLAS/dzasum.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dzasum.f'; fi` srot.o: BLAS/srot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srot.o `test -f 'BLAS/srot.f' || echo '$(srcdir)/'`BLAS/srot.f srot.obj: BLAS/srot.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srot.obj `if test -f 'BLAS/srot.f'; then $(CYGPATH_W) 'BLAS/srot.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/srot.f'; fi` stpsv.o: BLAS/stpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stpsv.o `test -f 'BLAS/stpsv.f' || echo '$(srcdir)/'`BLAS/stpsv.f stpsv.obj: BLAS/stpsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o stpsv.obj `if test -f 'BLAS/stpsv.f'; then $(CYGPATH_W) 'BLAS/stpsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/stpsv.f'; fi` zhemv.o: BLAS/zhemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhemv.o `test -f 'BLAS/zhemv.f' || echo '$(srcdir)/'`BLAS/zhemv.f zhemv.obj: BLAS/zhemv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhemv.obj `if test -f 'BLAS/zhemv.f'; then $(CYGPATH_W) 'BLAS/zhemv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhemv.f'; fi` ztrmv.o: BLAS/ztrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrmv.o `test -f 'BLAS/ztrmv.f' || echo '$(srcdir)/'`BLAS/ztrmv.f ztrmv.obj: BLAS/ztrmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrmv.obj `if test -f 'BLAS/ztrmv.f'; then $(CYGPATH_W) 'BLAS/ztrmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztrmv.f'; fi` cher.o: BLAS/cher.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher.o `test -f 'BLAS/cher.f' || echo '$(srcdir)/'`BLAS/cher.f cher.obj: BLAS/cher.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cher.obj `if test -f 'BLAS/cher.f'; then $(CYGPATH_W) 'BLAS/cher.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cher.f'; fi` ctrsm.o: BLAS/ctrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrsm.o `test -f 'BLAS/ctrsm.f' || echo '$(srcdir)/'`BLAS/ctrsm.f ctrsm.obj: BLAS/ctrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrsm.obj `if test -f 'BLAS/ctrsm.f'; then $(CYGPATH_W) 'BLAS/ctrsm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctrsm.f'; fi` dspmv.o: BLAS/dspmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspmv.o `test -f 'BLAS/dspmv.f' || echo '$(srcdir)/'`BLAS/dspmv.f dspmv.obj: BLAS/dspmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspmv.obj `if test -f 'BLAS/dspmv.f'; then $(CYGPATH_W) 'BLAS/dspmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dspmv.f'; fi` dznrm2.o: BLAS/dznrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dznrm2.o `test -f 'BLAS/dznrm2.f' || echo '$(srcdir)/'`BLAS/dznrm2.f dznrm2.obj: BLAS/dznrm2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dznrm2.obj `if test -f 'BLAS/dznrm2.f'; then $(CYGPATH_W) 'BLAS/dznrm2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dznrm2.f'; fi` srotg.o: BLAS/srotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotg.o `test -f 'BLAS/srotg.f' || echo '$(srcdir)/'`BLAS/srotg.f srotg.obj: BLAS/srotg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotg.obj `if test -f 'BLAS/srotg.f'; then $(CYGPATH_W) 'BLAS/srotg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/srotg.f'; fi` strmm.o: BLAS/strmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strmm.o `test -f 'BLAS/strmm.f' || echo '$(srcdir)/'`BLAS/strmm.f strmm.obj: BLAS/strmm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strmm.obj `if test -f 'BLAS/strmm.f'; then $(CYGPATH_W) 'BLAS/strmm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/strmm.f'; fi` zher2.o: BLAS/zher2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher2.o `test -f 'BLAS/zher2.f' || echo '$(srcdir)/'`BLAS/zher2.f zher2.obj: BLAS/zher2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher2.obj `if test -f 'BLAS/zher2.f'; then $(CYGPATH_W) 'BLAS/zher2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zher2.f'; fi` ztrsm.o: BLAS/ztrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrsm.o `test -f 'BLAS/ztrsm.f' || echo '$(srcdir)/'`BLAS/ztrsm.f ztrsm.obj: BLAS/ztrsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrsm.obj `if test -f 'BLAS/ztrsm.f'; then $(CYGPATH_W) 'BLAS/ztrsm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztrsm.f'; fi` cherk.o: BLAS/cherk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cherk.o `test -f 'BLAS/cherk.f' || echo '$(srcdir)/'`BLAS/cherk.f cherk.obj: BLAS/cherk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o cherk.obj `if test -f 'BLAS/cherk.f'; then $(CYGPATH_W) 'BLAS/cherk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/cherk.f'; fi` ctrsv.o: BLAS/ctrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrsv.o `test -f 'BLAS/ctrsv.f' || echo '$(srcdir)/'`BLAS/ctrsv.f ctrsv.obj: BLAS/ctrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ctrsv.obj `if test -f 'BLAS/ctrsv.f'; then $(CYGPATH_W) 'BLAS/ctrsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ctrsv.f'; fi` dspr2.o: BLAS/dspr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspr2.o `test -f 'BLAS/dspr2.f' || echo '$(srcdir)/'`BLAS/dspr2.f dspr2.obj: BLAS/dspr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspr2.obj `if test -f 'BLAS/dspr2.f'; then $(CYGPATH_W) 'BLAS/dspr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dspr2.f'; fi` icamax.o: BLAS/icamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o icamax.o `test -f 'BLAS/icamax.f' || echo '$(srcdir)/'`BLAS/icamax.f icamax.obj: BLAS/icamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o icamax.obj `if test -f 'BLAS/icamax.f'; then $(CYGPATH_W) 'BLAS/icamax.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/icamax.f'; fi` srotm.o: BLAS/srotm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotm.o `test -f 'BLAS/srotm.f' || echo '$(srcdir)/'`BLAS/srotm.f srotm.obj: BLAS/srotm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotm.obj `if test -f 'BLAS/srotm.f'; then $(CYGPATH_W) 'BLAS/srotm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/srotm.f'; fi` strmv.o: BLAS/strmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strmv.o `test -f 'BLAS/strmv.f' || echo '$(srcdir)/'`BLAS/strmv.f strmv.obj: BLAS/strmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strmv.obj `if test -f 'BLAS/strmv.f'; then $(CYGPATH_W) 'BLAS/strmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/strmv.f'; fi` zher2k.o: BLAS/zher2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher2k.o `test -f 'BLAS/zher2k.f' || echo '$(srcdir)/'`BLAS/zher2k.f zher2k.obj: BLAS/zher2k.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher2k.obj `if test -f 'BLAS/zher2k.f'; then $(CYGPATH_W) 'BLAS/zher2k.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zher2k.f'; fi` ztrsv.o: BLAS/ztrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrsv.o `test -f 'BLAS/ztrsv.f' || echo '$(srcdir)/'`BLAS/ztrsv.f ztrsv.obj: BLAS/ztrsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ztrsv.obj `if test -f 'BLAS/ztrsv.f'; then $(CYGPATH_W) 'BLAS/ztrsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ztrsv.f'; fi` chpmv.o: BLAS/chpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpmv.o `test -f 'BLAS/chpmv.f' || echo '$(srcdir)/'`BLAS/chpmv.f chpmv.obj: BLAS/chpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpmv.obj `if test -f 'BLAS/chpmv.f'; then $(CYGPATH_W) 'BLAS/chpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chpmv.f'; fi` dasum.o: BLAS/dasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dasum.o `test -f 'BLAS/dasum.f' || echo '$(srcdir)/'`BLAS/dasum.f dasum.obj: BLAS/dasum.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dasum.obj `if test -f 'BLAS/dasum.f'; then $(CYGPATH_W) 'BLAS/dasum.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dasum.f'; fi` dspr.o: BLAS/dspr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspr.o `test -f 'BLAS/dspr.f' || echo '$(srcdir)/'`BLAS/dspr.f dspr.obj: BLAS/dspr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dspr.obj `if test -f 'BLAS/dspr.f'; then $(CYGPATH_W) 'BLAS/dspr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dspr.f'; fi` idamax.o: BLAS/idamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o idamax.o `test -f 'BLAS/idamax.f' || echo '$(srcdir)/'`BLAS/idamax.f idamax.obj: BLAS/idamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o idamax.obj `if test -f 'BLAS/idamax.f'; then $(CYGPATH_W) 'BLAS/idamax.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/idamax.f'; fi` srotmg.o: BLAS/srotmg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotmg.o `test -f 'BLAS/srotmg.f' || echo '$(srcdir)/'`BLAS/srotmg.f srotmg.obj: BLAS/srotmg.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o srotmg.obj `if test -f 'BLAS/srotmg.f'; then $(CYGPATH_W) 'BLAS/srotmg.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/srotmg.f'; fi` strsm.o: BLAS/strsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strsm.o `test -f 'BLAS/strsm.f' || echo '$(srcdir)/'`BLAS/strsm.f strsm.obj: BLAS/strsm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strsm.obj `if test -f 'BLAS/strsm.f'; then $(CYGPATH_W) 'BLAS/strsm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/strsm.f'; fi` zher.o: BLAS/zher.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher.o `test -f 'BLAS/zher.f' || echo '$(srcdir)/'`BLAS/zher.f zher.obj: BLAS/zher.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zher.obj `if test -f 'BLAS/zher.f'; then $(CYGPATH_W) 'BLAS/zher.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zher.f'; fi` chpr2.o: BLAS/chpr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpr2.o `test -f 'BLAS/chpr2.f' || echo '$(srcdir)/'`BLAS/chpr2.f chpr2.obj: BLAS/chpr2.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpr2.obj `if test -f 'BLAS/chpr2.f'; then $(CYGPATH_W) 'BLAS/chpr2.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chpr2.f'; fi` daxpy.o: BLAS/daxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o daxpy.o `test -f 'BLAS/daxpy.f' || echo '$(srcdir)/'`BLAS/daxpy.f daxpy.obj: BLAS/daxpy.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o daxpy.obj `if test -f 'BLAS/daxpy.f'; then $(CYGPATH_W) 'BLAS/daxpy.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/daxpy.f'; fi` dswap.o: BLAS/dswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dswap.o `test -f 'BLAS/dswap.f' || echo '$(srcdir)/'`BLAS/dswap.f dswap.obj: BLAS/dswap.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dswap.obj `if test -f 'BLAS/dswap.f'; then $(CYGPATH_W) 'BLAS/dswap.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dswap.f'; fi` isamax.o: BLAS/isamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o isamax.o `test -f 'BLAS/isamax.f' || echo '$(srcdir)/'`BLAS/isamax.f isamax.obj: BLAS/isamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o isamax.obj `if test -f 'BLAS/isamax.f'; then $(CYGPATH_W) 'BLAS/isamax.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/isamax.f'; fi` ssbmv.o: BLAS/ssbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssbmv.o `test -f 'BLAS/ssbmv.f' || echo '$(srcdir)/'`BLAS/ssbmv.f ssbmv.obj: BLAS/ssbmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ssbmv.obj `if test -f 'BLAS/ssbmv.f'; then $(CYGPATH_W) 'BLAS/ssbmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/ssbmv.f'; fi` strsv.o: BLAS/strsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strsv.o `test -f 'BLAS/strsv.f' || echo '$(srcdir)/'`BLAS/strsv.f strsv.obj: BLAS/strsv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o strsv.obj `if test -f 'BLAS/strsv.f'; then $(CYGPATH_W) 'BLAS/strsv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/strsv.f'; fi` zherk.o: BLAS/zherk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zherk.o `test -f 'BLAS/zherk.f' || echo '$(srcdir)/'`BLAS/zherk.f zherk.obj: BLAS/zherk.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zherk.obj `if test -f 'BLAS/zherk.f'; then $(CYGPATH_W) 'BLAS/zherk.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zherk.f'; fi` chpr.o: BLAS/chpr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpr.o `test -f 'BLAS/chpr.f' || echo '$(srcdir)/'`BLAS/chpr.f chpr.obj: BLAS/chpr.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o chpr.obj `if test -f 'BLAS/chpr.f'; then $(CYGPATH_W) 'BLAS/chpr.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/chpr.f'; fi` dcabs1.o: BLAS/dcabs1.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dcabs1.o `test -f 'BLAS/dcabs1.f' || echo '$(srcdir)/'`BLAS/dcabs1.f dcabs1.obj: BLAS/dcabs1.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dcabs1.obj `if test -f 'BLAS/dcabs1.f'; then $(CYGPATH_W) 'BLAS/dcabs1.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dcabs1.f'; fi` dsymm.o: BLAS/dsymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsymm.o `test -f 'BLAS/dsymm.f' || echo '$(srcdir)/'`BLAS/dsymm.f dsymm.obj: BLAS/dsymm.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o dsymm.obj `if test -f 'BLAS/dsymm.f'; then $(CYGPATH_W) 'BLAS/dsymm.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/dsymm.f'; fi` izamax.o: BLAS/izamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o izamax.o `test -f 'BLAS/izamax.f' || echo '$(srcdir)/'`BLAS/izamax.f izamax.obj: BLAS/izamax.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o izamax.obj `if test -f 'BLAS/izamax.f'; then $(CYGPATH_W) 'BLAS/izamax.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/izamax.f'; fi` sscal.o: BLAS/sscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sscal.o `test -f 'BLAS/sscal.f' || echo '$(srcdir)/'`BLAS/sscal.f sscal.obj: BLAS/sscal.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o sscal.obj `if test -f 'BLAS/sscal.f'; then $(CYGPATH_W) 'BLAS/sscal.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/sscal.f'; fi` zhpmv.o: BLAS/zhpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpmv.o `test -f 'BLAS/zhpmv.f' || echo '$(srcdir)/'`BLAS/zhpmv.f zhpmv.obj: BLAS/zhpmv.f $(AM_V_F77)$(F77) $(AM_FFLAGS) $(FFLAGS) -c -o zhpmv.obj `if test -f 'BLAS/zhpmv.f'; then $(CYGPATH_W) 'BLAS/zhpmv.f'; else $(CYGPATH_W) '$(srcdir)/BLAS/zhpmv.f'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) all-local installdirs: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 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 "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean-am: clean-generic clean-local clean-noinstLIBRARIES \ 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ clean-generic clean-local clean-noinstLIBRARIES cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ 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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # PKGCOMMON_PACKTITLE corresponds to package names in [[file:getall]] download:: ../getall -o $(PKGCOMMON_PACKTITLE) -a $(PKGCOMMON_PACKAGES):download compilepkg:: # <> install::compilepkg # <> reinstall::compilepkg clean-local:: veryclean::clean -rm $(PKGCOMMON_PACKAGES) # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: pkgcompile::@DOWNLOADED_BLAS@ # "xerbla" exists in both BLAS and CBLAS. So we need to rename it to obtain two different object files. BLAS:BLAS/fait BLAS/fait:$(BLAS_TGZ) mkdir -p ../include ../lib pxerbla=`tar tf $(BLAS_TGZ) | grep xerbla.f`; \ dirblas=`dirname $$pxerbla` ;\ case $$dirblas in \ BLAS) tar xvzf $(BLAS_TGZ) ;; \ BLAS-*) tar xvzf $(BLAS_TGZ) ; mv $$dirblas BLAS ;; \ .) mkdir -p BLAS; tar xvzf $(BLAS_TGZ) -c BLAS;; \ esac cp BLAS/xerbla.f blas_xerbla.f touch BLAS/fait $(F77BLAS_SOURCES): BLAS CBLAS:CBLAS/fait CBLAS/fait: $(CBLAS_TGZ) tar xvzf $(CBLAS_TGZ) cp CBLAS/include/*.h CBLAS/src touch CBLAS/fait $(CBLAS_SOURCES): CBLAS/fait clean-local:: -rm -r BLAS CBLAS blas_xerbla.f # <> ALH - 18/9/13 - Downloading and building the OpenBLAS # ------------------------------------------------------------------ # to activate this, see [[file:../../configure.ac::OpenBLAS]] all-local::@COMPILE_OPENBLAS@ pkgcompile::@COMPILE_OPENBLAS@ generic: openblas:install.done ../lib/WHERE.blas # The library may sometimes have a complex name with version number, just copy it into a standard location ../lib/WHERE.blas:install.done echo blas LD -L@DIR@/lib -lopenblas $(FLIBS)> $@ echo blas INCLUDE -I@DIR@/include >> $@ echo blaslapack LD -L@DIR@/lib -lopenblas $(FLIBS) > $@ echo blaslapack INCLUDE -I@DIR@/include >> $@ # links2files is required for the MinGW compiler to understand where to find the library contents under Cygwin @FFCS_WINDOWS_TRUE@links.done:openblas.done @FFCS_WINDOWS_TRUE@ cd OpenBLAS && ../../../build/links2files @FFCS_WINDOWS_TRUE@ touch $@ @FFCS_WINDOWS_TRUE@install.done:links.done @FFCS_WINDOWS_TRUE@ cp OpenBLAS/libopenblas.a ../lib @FFCS_WINDOWS_TRUE@ cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ CC=${CC} FC=${FC} NO_SHARED=1 DDYNAMIC_ARCH=1 PREFIX=../.. install @FFCS_WINDOWS_TRUE@ touch $@ @FFCS_WINDOWS_FALSE@install.done:openblas.done @FFCS_WINDOWS_FALSE@ cp OpenBLAS/libopenblas.a ../lib @FFCS_WINDOWS_FALSE@ cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ CC=${CC} FC=${FC} DYNAMIC_ARCH=1 NO_SHARED=1 PREFIX=../.. install @FFCS_WINDOWS_FALSE@ touch $@ clean:: -rm ../lib/libopenblas.a openblas.done:openpatches.done # # DYNAMIC_ARCH=1 allows the Openblas to run fast on all the processor architectures that the FFCS users may have # test -d ../lib || mkdir ../lib cd OpenBLAS && make BINARY=@SIZEOF_PTRINBIT@ "CC=$(CC)" "FC=$(FC)" DYNAMIC_ARCH=1 NO_SHARED=1 "FLIBS=$(FLIBS)" libs netlib touch $@ # The OpenBLAS directory is updated during the compilation, so the patching step should not depend on the directory date openpatches.done:opendownload.done tar xvzf ../pkg/OpenBLAS.tar.gz # # ALH - 7/1/14 - The tar directory has changed names # mv xianyi-OpenBLAS-* OpenBLAS patch -u -p1 < openblas.patches touch $@ clean:: -rm *.done -rm -r OpenBLAS download::opendownload.done opendownload.done: ../getall -o OpenBLAS -a touch $@ # ALH - 6/11/13 - Since OpenBLAS is quite long to compile and it does not change very often, it's only cleaned as part of the specific # target 'veryclean'. veryclean:: -rm -r *.done OpenBLAS xianyi-OpenBLAS-* # Local Variables: # mode:makefile # ispell-local-dictionary:"british" # coding:utf-8 # End: # 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: freefem++-3.61-1/download/gmm/Makefile000644 000767 000024 00000002610 13256636774 017651 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- include cxxflags # Downloading and compiling FFTW # ------------------------------ PKG=gmm # $(PKG) information SRCDIR=$(PKG)-$(PKG_VERSION) PACKAGE=$(PKG)-$(PKG_VERSION).tar.gz SERVER=http://download.gna.org/getfem/stable PKGDIR=../pkg PKG_VERSION=4.2 INSTALL=../.. $(PKG):FAIT FAITwin32-dll-target: echo "On Pure Win32 (to hard to compile) " FAIT: $(MAKE) install touch FAIT $(MAKE) WHERE FAIRE: $(SRCDIR) cd $(SRCDIR) && ./configure --disable-dependency-tracking --prefix=`pwd`/$(INSTALL) CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make touch FAIRE install: FAIRE cd $(SRCDIR) && make install $(SRCDIR): $(PKGDIR)/$(PACKAGE) gunzip -c $^ | tar xvf - $(PKGDIR)/$(PACKAGE): ../getall -o Gmm++ -a clean: clean-local clean-local: -rm -rf $(PKG)-* FAIT FAIRE $(SRCDIR) -rm ../lib/WHERE.gmm cxxflags: ../Makefile grep 'CXX *=' ../Makefile >cxxflags grep 'CC *=' ../Makefile >>cxxflags grep 'CXXFLAGS *=' ../Makefile >>cxxflags grep 'CFLAGS *=' ../Makefile >>cxxflags grep 'WGET *=' ../Makefile >>cxxflags grep 'WIN32DLLTARGET *=' ../Makefile >>cxxflags WHERE: -@if [ -f FAIT ] ; then \ echo build ../lib/WHERE.gmm ;\ echo gmm INCLUDE -I@DIR@/include > ../lib/WHERE.gmm ;\ echo gmm LD -L@DIR@/lib >> ../lib/WHERE.gmm ;\ fi freefem++-3.61-1/download/gmm/cxxflags000644 000767 000024 00000001005 13321643200 017717 0ustar00hechtstaff000000 000000 CXX = g++ MPICXX = /usr/local/ff++/openmpi-2.1/bin/mpic++ ac_ct_CXX = g++ CC = gcc H5CC = /usr/local/ff++/openmpi-2.1/bin/h5cc HDF5_CC = clang MPICC = /usr/local/ff++/openmpi-2.1/bin/mpicc YACC = bison -y ac_ct_CC = gcc CXXFLAGS = -Wno-undefined-var-template -m64 -fPIC -DNDEBUG -O3 -O3 -O3 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC CFLAGS = -g -m64 -fPIC -DNDEBUG -O3 -O3 -O3 -fPIC FCFLAGS = -g -fPIC GSL_CFLAGS = -I/usr/local/ff++/openmpi-2.1/include HDF5_CFLAGS = WGET = wget --no-check-certificate WIN32DLLTARGET = freefem++-3.61-1/download/pastix/Makefile000644 000767 000024 00000021670 13256636774 020410 0ustar00hechtstaff000000 000000 # ====================================================================== # Laboratoire Jacques-Louis Lions # Université Pierre et Marie Curie-Paris6, UMR 7598, Paris, F-75005 France # http://www.ljll.math.upmc.fr/lehyaric # ====================================================================== # 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 # ====================================================================== # headeralh default=0 freefem make multipleauthors start=19/03/10 upmc # Downloading and compiling extra libraries # ----------------------------------------- -include config.in all-local: pastix # Downloading and compiling pastix # ------------------------------ DIRPKG = ../pkg SRCDIR = pastix_release_$(VERSION) PACKAGE1 = $(DIRPKG)/pastix_release_$(VERSION).tar.bz2 SERVER = https://gforge.inria.fr/frs/download.php/21873/ VERSION = 2200 VERSIONTYPE=$(VERSIONINT)$(VERSIONPRC)$(VERSIONFLT) VERSIONTYPECOMPLEX=$(VERSIONINT)_complex VERSIONNAME=$(VERSIONBIT)$(VERSIONMPI)$(VERSIONSMP)$(VERSIONBUB)$(VERSIONTYPE)$(VERSIONORD)_$(HOSTARCH) PASTIX_DIR = $(abs_top_builddir)/download/pastix/$(SRCDIR)/install ifneq (,$(findstring libtool,$(ARPROG))) OBJLIBTOOL = $(SRCDIR)/src/sopalin/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/blend/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/fax/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/kass/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/order/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/symbol/obj/$(HOSTARCH)/*.o $(SRCDIR)/src/common/obj/$(HOSTARCH)/*.o else OBJLIBTOOL = endif pastix: FAIRE # FFCS - parallel make rules WHERE: install echo double_pastix LD -L@DIR@/lib/pastix/double -lpastix >../lib/WHERE.pastix ; echo double_pastix INCLUDE -I@DIR@/include/pastix/double >> ../lib/WHERE.pastix ; echo complex_pastix LD -L@DIR@/lib/pastix/complex -lpastix >>../lib/WHERE.pastix ; echo complex_pastix INCLUDE -I@DIR@/include/pastix/complex >> ../lib/WHERE.pastix ; FAIRE:$(SRCDIR)/FAIT $(MAKE) WHERE touch FAIRE config.in: ../Makefile ../../config.status Makefile ../../config.status --file="config.in:config-pastix-real.in" ../../config.status --file="config-complex.in:config-pastix-complex.in" install:$(SRCDIR)/FAIT $(SRCDIR)/FAIT: $(SRCDIR)/FAITC2 touch $(SRCDIR)/FAIT ## change F. Hecht ## WARNING target $(SRCDIR)/FAITR2 $(SRCDIR)/FAITC2 not in // # => $(SRCDIR)/FAITC2 depend on $(SRCDIR)/FAITR2 $(SRCDIR)/FAITR1: $(SRCDIR)/tag-tar cp config.in $(SRCDIR)/src/ # # FFCS - 16/1/13 - this crashes in parallel # cd $(SRCDIR)/src; $(MAKE) -j1 expor #ifndef (,$(OBJLIBTOOL)) # redefinition of "cd $(SRCDIR)/src; $(MAKE) install" for libtool rm -f $(SRCDIR)/install/pastix*.h $(SRCDIR)/install/pastix*.in $(SRCDIR)/install/murge*.inc $(abs_top_builddir)/download/pastix/$(SRCDIR)/src/utils/bin/${HOSTARCH}/genheader $(PASTIX_DIR)/pastix$(VERSIONTYPE).h $(PASTIX_DIR)/pastix_fortran$(VERSIONTYPE).h \ $(PASTIX_DIR)/murge$(VERSIONTYPE).inc $(SRCDIR)/src/murge/include/murge.h $(SRCDIR)/src/murge/scripts/genfort.pl cat $(SRCDIR)/src/../bin/$(HOSTARCH)/pastix.h >> $(PASTIX_DIR)/pastix$(VERSIONTYPE).h cat $(SRCDIR)/src/common/src/api.h >> $(PASTIX_DIR)/pastix$(VERSIONTYPE).h cat $(SRCDIR)/src/../bin/$(HOSTARCH)/pastix_fortran.inc >> $(PASTIX_DIR)/murge$(VERSIONTYPE).inc ln -sf $(PASTIX_DIR)/pastix$(VERSIONTYPE).h $(PASTIX_DIR)/pastix.h ln -sf $(PASTIX_DIR)/pastix_fortran$(VERSIONTYPE).h $(PASTIX_DIR)/pastix_fortran.h ln -sf $(PASTIX_DIR)/murge$(VERSIONTYPE).inc $(PASTIX_DIR)/murge.inc cp $(SRCDIR)/src/sopalin/src/csc_utils.h $(PASTIX_DIR)/csc_utils$(VERSIONTYPE).h ln -fs $(PASTIX_DIR)/csc_utils$(VERSIONTYPE).h $(PASTIX_DIR)/csc_utils.h cp $(SRCDIR)/src/sopalin/src/cscd_utils.h $(PASTIX_DIR)/cscd_utils${VERSIONTYPE}.h ln -fs $(PASTIX_DIR)/cscd_utils$(VERSIONTYPE).h $(PASTIX_DIR)/cscd_utils.h cp $(SRCDIR)/src/common/src/nompi.h $(PASTIX_DIR)/pastix_nompi.h cp $(SRCDIR)/src/murge/include/murge.h $(PASTIX_DIR)/murge.h $(ARPROG) $(ARFLAGS) $(SRCDIR)/install/libpastix$(VERSIONNAME).a $(OBJLIBTOOL) ranlib $(SRCDIR)/install/libpastix$(VERSIONNAME).a ln -sf $(PASTIX_DIR)/libpastix$(VERSIONNAME).a $(PASTIX_DIR)/libpastix.a cp $(PASTIX_DIR)/../bin/$(HOSTARCH)/libpastix_murge.a $(PASTIX_DIR)/libpastix_murge$(VERSIONNAME).a ln -sf $(PASTIX_DIR)/libpastix_murge$(VERSIONNAME).a $(PASTIX_DIR)/libpastix_murge.a #else #cd $(SRCDIR)/src; $(MAKE) -j1 install #endif touch $(SRCDIR)/FAITR1 $(SRCDIR)/FAITR2: $(SRCDIR)/FAITR1 mkdir -p ../include/pastix/double cp $(SRCDIR)/install/*.h ../include/pastix/double/ mkdir -p ../lib/pastix/double cp $(SRCDIR)/install/*.a ../lib/pastix/double/ cd $(SRCDIR)/src/ && $(MAKE) clean touch $(SRCDIR)/FAITR2; $(SRCDIR)/FAITC1:$(SRCDIR)/tag-tar # # complex version # cp config-complex.in $(SRCDIR)/src/config.in # # FFCS - 16/1/13 - this crashes in parallel # cd $(SRCDIR)/src/;$(MAKE) -j1 expor #ifdef ($(OBJLIBTOOL)) rm -f $(SRCDIR)/install/pastix*.h $(SRCDIR)/install/pastix*.in $(SRCDIR)/install/murge*.inc $(abs_top_builddir)/download/pastix/$(SRCDIR)/src/utils/bin/${HOSTARCH}/genheader $(PASTIX_DIR)/pastix$(VERSIONTYPECOMPLEX).h $(PASTIX_DIR)/pastix_fortran$(VERSIONTYPECOMPLEX).h \ $(PASTIX_DIR)/murge$(VERSIONTYPECOMPLEX).inc $(SRDIR)/src/murge/include/murge.h $(SRDIR)/src/murge/scripts/genfort.pl cat $(SRCDIR)/src/../bin/$(HOSTARCH)/pastix.h >> $(PASTIX_DIR)/pastix$(VERSIONTYPECOMPLEX).h cat $(SRCDIR)/src/common/src/api.h >> $(PASTIX_DIR)/pastix$(VERSIONTYPECOMPLEX).h cat $(SRCDIR)/src/../bin/$(HOSTARCH)/pastix_fortran.inc >> $(PASTIX_DIR)/murge$(VERSIONTYPECOMPLEX).inc ln -sf $(PASTIX_DIR)/pastix$(VERSIONTYPECOMPLEX).h $(PASTIX_DIR)/pastix.h ln -sf $(PASTIX_DIR)/pastix_fortran$(VERSIONTYPECOMPLEX).h $(PASTIX_DIR)/pastix_fortran.h ln -sf $(PASTIX_DIR)/murge$(VERSIONTYPECOMPLEX).inc $(PASTIX_DIR)/murge.inc cp $(SRCDIR)/src/sopalin/src/csc_utils.h $(PASTIX_DIR)/csc_utils$(VERSIONTYPECOMPLEX).h ln -fs $(PASTIX_DIR)/csc_utils$(VERSIONTYPECOMPLEX).h $(PASTIX_DIR)/csc_utils.h cp $(SRCDIR)/src/sopalin/src/cscd_utils.h $(PASTIX_DIR)/cscd_utils${VERSIONTYPECOMPLEX}.h ln -fs $(PASTIX_DIR)/cscd_utils$(VERSIONTYPECOMPLEX).h $(PASTIX_DIR)/cscd_utils.h cp $(SRCDIR)/src/common/src/nompi.h $(PASTIX_DIR)/pastix_nompi.h cp $(SRCDIR)/src/murge/include/murge.h $(PASTIX_DIR)/murge.h $(ARPROG) $(ARFLAGS) $(SRCDIR)/install/libpastix$(VERSIONNAME).a $(OBJLIBTOOL) ranlib $(SRCDIR)/install/libpastix$(VERSIONNAME).a ln -sf $(PASTIX_DIR)/libpastix$(VERSIONNAME).a $(PASTIX_DIR)/libpastix.a cp $(PASTIX_DIR)/../bin/$(HOSTARCH)/libpastix_murge.a $(PASTIX_DIR)/libpastix_murge$(VERSIONNAME).a ln -sf $(PASTIX_DIR)/libpastix_murge$(VERSIONNAME).a $(PASTIX_DIR)/libpastix_murge.a #else #cd $(SRCDIR)/src/ && $(MAKE) install -j1 -C $(SRCDIR)/src #endif touch $(SRCDIR)/FAITC1 $(SRCDIR)/FAITC2: $(SRCDIR)/FAITR2 $(SRCDIR)/FAITC1 mkdir -p ../include/pastix/complex cp $(SRCDIR)/install/*.h ../include/pastix/complex/ mkdir -p ../lib/pastix/complex cp $(SRCDIR)/install/*.a ../lib/pastix/complex/ (cd ../include/pastix/complex/; patch pastix_int_complex.h) +#define pastix_float_t std::complex +extern "C" { + MPI_Datatype GetMpiType() ; +#else #include +#define pastix_float_t double complex +#endif + #define pastix_int_t int #define pastix_uint_t unsigned int #define MPI_PASTIX_INT MPI_INT -#define pastix_float_t double complex #define MPI_PASTIX_FLOAT GetMpiType() #define INT pastix_int_t #define UINT pastix_uint_t @@ -744,3 +753,6 @@ #define MTX_ISRHS(a) (a)[0]!='\0' /* **************************************** */ +#ifdef __cplusplus +} +#endif freefem++-3.61-1/download/pastix/config-pastix-real.in000644 000767 000024 00000015103 13256636774 022766 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ -include $(abs_top_builddir)/download/headers-sparsesolver.inc HOSTARCH = @PASTIX_HOSTARCH@ VERSIONBIT = _@SIZEOF_PTRINBIT@bit EXEEXT = OBJEXT = .o LIBEXT = .a WGET = @WGET@ CCPROG = @CC@ -Wall -DX_ARCH$(HOSTARCH) CFPROG = @F77@ CF90PROG = @FC@ MCFPROG = @MPIFC@ CF90CCPOPT = -ffree-form -x f95-cpp-input #avant # Compilation options for optimization (make expor) CCFOPT = -O3 @CFLAGS@ # Compilation options for debug (make | make debug) CCFDEB = -g3 LKFOPT = MKPROG = make # FFCS - add MPI_INCLUDE because FF cannot use the defaut openmpi scripts on MacOS (see # [[file:../../../../configure.ac::mpicc_on_macos]]) MPCCPROG = @MPICC@ -Wall -DX_ARCH$(HOSTARCH) @MPI_INCLUDE@ ARFLAGS = @ARFLAGS@ # ruv ARPROG = @AR@ # ar EXTRALIB = @FLIBS@ -lm -lsupc++ VERSIONMPI = _mpi VERSIONSMP = _smp VERSIONBUB = _nobubble VERSIONINT = _int VERSIONPRC = _simple VERSIONFLT = _real VERSIONORD = _scotch ################################################################### # INTEGER TYPE # ################################################################### # uncomment the following lines for integer type support (Only 1) #VERSIONINT = $(FFVERSIONINT)#_long #CCTYPES = $(FFCTYPESINT)#-DFORCE_LONG -DLONG #--------------------------- VERSIONINT = _int CCTYPES = -DFORCE_INT #--------------------------- #VERSIONINT = _int64 #CCTYPES = -DFORCE_INT64 -DINTSSIZE64 ################################################################### # FLOAT TYPE # ################################################################### # uncomment the following lines for double precision support VERSIONPRC = _double CCTYPES := $(CCTYPES) -DFORCE_DOUBLE -DPREC_DOUBLE # uncomment the following lines for float=complex support #VERSIONFLT = _complex #CCTYPES := $(CCTYPES) -DFORCE_COMPLEX -DTYPE_COMPLEX -DPREC_DOUBLE ################################################################### # Mpi/THREADS # ################################################################### # uncomment the following lines for sequential (NOMPI) version #VERSIONMPI = _nompi #CCTYPES := $(CCTYPES) -DFORCE_NOMPI #MPCCPROG = $(CCPROG) #MCFPROG = $(CFPROG) # uncomment the following lines for non-threaded (NOSMP) version #VERSIONSMP = _nosmp #CCTYPES := $(CCTYPES) -DFORCE_NOSMP # Uncomment the following line to enable a progression thread #CCPASTIX := $(CCPASTIX) -DTHREAD_COMM # Uncomment the following line if your MPI doesn't support MPI_THREAD_MULTIPLE level #CCPASTIX := $(CCPASTIX) -DPASTIX_FUNNELED # Uncomment the following line if your MPI doesn't support MPI_Datatype correctly #CCPASTIX := $(CCPASTIX) -DNO_MPI_TYPE ################################################################### # Options # ################################################################### # Uncomment the following lines for NUMA-aware allocation (recommended) CCPASTIX := $(CCPASTIX) -DNUMA_ALLOC # Show memory usage statistics #CCPASTIX := $(CCPASTIX) -DMEMORY_USAGE # Show memory usage statistics in solver #CCPASTIX := $(CCPASTIX) -DSTATS_SOPALIN # Uncomment following line for dynamic thread scheduling support #CCPASTIX := $(CCPASTIX) -DPASTIX_BUBBLE # Uncomment the following lines for Out-of-core #CCPASTIX := $(CCPASTIX) -DOOC ################################################################### # GRAPH PARTITIONING # ################################################################### CCPASTIX := $(CCPASTIX) $(FFMPIINCLUDE) EXTRALIB := $(EXTRALIB) $(FFMPILIB) # uncomment the following lines for using metis ordering #VERSIONORD = _metis #METIS_HOME = $(abs_top_builddir)/download/ #CCPASTIX := $(CCPASTIX) -DMETIS -I$(METIS_HOME)/include/metis/ #EXTRALIB := $(EXTRALIB) -L$(METIS_HOME)/lib/ -lmetis # Scotch always needed to compile SCOTCH_HOME = # ALH - 4/9/13 - see [[file:../../configure.ac::SCOTCH_INCLUDE]] SCOTCH_INC = @SCOTCH_INCLUDE@ SCOTCH_LIB = $(abs_top_builddir)/download/lib/ # uncomment on of this blocks #scotch CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lscotch -lscotcherrexit #ptscotch #CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) -DDISTRIBUTED #EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lscotcherrexit ################################################################### # MARCEL # ################################################################### # Uncomment following lines for marcel thread support #VERSIONSMP := $(VERSIONSMP)_marcel #CCPASTIX := $(CCPASTIX) `pm2-config --cflags` -I${PM2_ROOT}/marcel/include/pthread #EXTRALIB := $(EXTRALIB) `pm2-config --libs` # ---- Thread Posix ------ EXTRALIB := $(EXTRALIB) @LIBSPTHREAD@ # Uncomment following line for bubblesched framework support (need marcel support) #VERSIONBUB = _bubble #CCPASTIX := $(CCPASTIX) -DPASTIX_USE_BUBBLE ################################################################### # BLAS # ################################################################### # Choose Blas library (Only 1) # Do not forget to set BLAS_HOME if it is not in your environnement BLAS_HOME= $(FFBLASINCLUDE ) #---- Blas ---- BLASLIB = $(FFBLASLIB) #@BLASLIBS@ #---- Gotoblas ---- #BLASLIB = -L$(BLAS_HOME) -lgoto #---- MKL ---- # Uncomment the correct line #BLASLIB = -L$(BLAS_HOME) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core #BLASLIB = -L$(BLAS_HOME) -lmkl_intel -lmkl_sequential -lmkl_core #---- Acml ---- #BLASLIB = -L$(BLAS_HOME) -lacml ################################################################### # DO NOT TOUCH # ################################################################### FOPT := $(CCFOPT) FDEB := $(CCFDEB) CCHEAD := $(CCPROG) $(CCTYPES) $(CCFOPT) CCFOPT := $(CCFOPT) $(CCTYPES) $(CCPASTIX) CFDEB := $(CCFDEB) $(CCTYPES) $(CCPASTIX) ################################################################### # MURGE COMPATIBILITY # ################################################################### MAKE = $(MKPROG) CC = $(MPCCPROG) CFLAGS = $(CCTYPES) $(CCFOPT) FC = $(MCFPROG) FFLAGS = $(CCFOPT) LDFLAGS = $(EXTRALIB) $(BLASLIB)freefem++-3.61-1/download/pastix/config-pastix-complex.in000644 000767 000024 00000015151 13256636774 023515 0ustar00hechtstaff000000 000000 abs_top_builddir=@abs_top_builddir@ -include $(abs_top_builddir)/download/headers-sparsesolver.inc HOSTARCH = @PASTIX_HOSTARCH@#i686_mac VERSIONBIT = _@SIZEOF_PTRINBIT@bit EXEEXT = OBJEXT = .o LIBEXT = .a CCPROG = @CC@ -Wall -DX_ARCH$(HOSTARCH) CFPROG = @F77@ CF90PROG = @F77@ -ffree-form MCFPROG = @MPIFC@ CF90CCPOPT = -ffree-form -x f95-cpp-input #avant # Compilation options for optimization (make expor) CCFOPT = -O3 @CFLAGS@ # Compilation options for debug (make | make debug) CCFDEB = -g3 LKFOPT = MKPROG = make # FFCS - add MPI_INCLUDE because FF cannot use the defaut openmpi scripts on MacOS (see # [[file:../../../../configure.ac::mpicc_on_macos]]) MPCCPROG = @MPICC@ -Wall -DX_ARCH$(HOSTARCH) @MPI_INCLUDE@ ARFLAGS = @ARFLAGS@ # ruv ARPROG = @AR@ # ar EXTRALIB = @FLIBS@ -lm -lsupc++ VERSIONMPI = _mpi VERSIONSMP = _smp VERSIONBUB = _nobubble VERSIONINT = _int VERSIONPRC = _simple VERSIONFLT = _real VERSIONORD = _scotch ################################################################### # INTEGER TYPE # ################################################################### # uncomment the following lines for integer type support (Only 1) CCTYPES= -DINTSSIZE32 -DFORCE_INT #VERSIONINT = $(FFVERSIONINT)#_long #CCTYPES = $(FFCTYPESINT)#-DFORCE_LONG -DLONG #--------------------------- #VERSIONINT = _int32 #CCTYPES = -DFORCE_INT32 #--------------------------- #VERSIONINT = _int64 #CCTYPES = -DFORCE_INT64 -DINTSSIZE64 ################################################################### # FLOAT TYPE # ################################################################### # uncomment the following lines for double precision support #VERSIONPRC = _double CCTYPES := $(CCTYPES) -DFORCE_DOUBLE -DPREC_DOUBLE # uncomment the following lines for float=complex support VERSIONFLT = _complex CCTYPES := $(CCTYPES) -DFORCE_COMPLEX -DTYPE_COMPLEX -DPREC_DOUBLE ################################################################### # Mpi/THREADS # ################################################################### # uncomment the following lines for sequential (NOMPI) version #VERSIONMPI = _nompi #CCTYPES := $(CCTYPES) -DFORCE_NOMPI #MPCCPROG = $(CCPROG) #MCFPROG = $(CFPROG) # uncomment the following lines for non-threaded (NOSMP) version #VERSIONSMP = _nosmp #CCTYPES := $(CCTYPES) -DFORCE_NOSMP # Uncomment the following line to enable a progression thread #CCPASTIX := $(CCPASTIX) -DTHREAD_COMM # Uncomment the following line if your MPI doesn't support MPI_THREAD_MULTIPLE level #CCPASTIX := $(CCPASTIX) -DPASTIX_FUNNELED # Uncomment the following line if your MPI doesn't support MPI_Datatype correctly #CCPASTIX := $(CCPASTIX) -DNO_MPI_TYPE ################################################################### # Options # ################################################################### # Uncomment the following lines for NUMA-aware allocation (recommended) CCPASTIX := $(CCPASTIX) -DNUMA_ALLOC # Show memory usage statistics #CCPASTIX := $(CCPASTIX) -DMEMORY_USAGE # Show memory usage statistics in solver #CCPASTIX := $(CCPASTIX) -DSTATS_SOPALIN # Uncomment following line for dynamic thread scheduling support #CCPASTIX := $(CCPASTIX) -DPASTIX_BUBBLE # Uncomment the following lines for Out-of-core #CCPASTIX := $(CCPASTIX) -DOOC ################################################################### # GRAPH PARTITIONING # ################################################################### CCPASTIX := $(CCPASTIX) $(FFMPIINCLUDE) EXTRALIB := $(EXTRALIB) $(FFMPILIB) # uncomment the following lines for using metis ordering #VERSIONORD = _metis #METIS_HOME = $(abs_top_builddir)/download/ #CCPASTIX := $(CCPASTIX) -DMETIS -I$(METIS_HOME)/include/metis/ #EXTRALIB := $(EXTRALIB) -L$(METIS_HOME)/lib/ -lmetis # Scotch always needed to compile SCOTCH_HOME = # ALH - 4/9/13 - see [[file:../../configure.ac::SCOTCH_INCLUDE]] SCOTCH_INC = @SCOTCH_INCLUDE@ SCOTCH_LIB = $(abs_top_builddir)/download/lib/ # uncomment on of this blocks #scotch CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lscotch -lscotcherrexit #ptscotch #CCPASTIX := $(CCPASTIX) -I$(SCOTCH_INC) -DDISTRIBUTED #EXTRALIB := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lscotcherrexit ################################################################### # MARCEL # ################################################################### # Uncomment following lines for marcel thread support #VERSIONSMP := $(VERSIONSMP)_marcel #CCPASTIX := $(CCPASTIX) `pm2-config --cflags` -I${PM2_ROOT}/marcel/include/pthread #EXTRALIB := $(EXTRALIB) `pm2-config --libs` # ---- Thread Posix ------ EXTRALIB := $(EXTRALIB) @LIBSPTHREAD@ # Uncomment following line for bubblesched framework support (need marcel support) #VERSIONBUB = _bubble #CCPASTIX := $(CCPASTIX) -DPASTIX_USE_BUBBLE ################################################################### # BLAS # ################################################################### # Choose Blas library (Only 1) # Do not forget to set BLAS_HOME if it is not in your environnement BLAS_HOME= $(FFBLASINCLUDE ) #---- Blas ---- BLASLIB = $(FFBLASLIB) #@BLASLIBS@ #---- Gotoblas ---- #BLASLIB = -L$(BLAS_HOME) -lgoto #---- MKL ---- # Uncomment the correct line #BLASLIB = -L$(BLAS_HOME) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core #BLASLIB = -L$(BLAS_HOME) -lmkl_intel -lmkl_sequential -lmkl_core #---- Acml ---- #BLASLIB = -L$(BLAS_HOME) -lacml ################################################################### # DO NOT TOUCH # ################################################################### FOPT := $(CCFOPT) FDEB := $(CCFDEB) CCHEAD := $(CCPROG) $(CCTYPES) $(CCFOPT) CCFOPT := $(CCFOPT) $(CCTYPES) $(CCPASTIX) CFDEB := $(CCFDEB) $(CCTYPES) $(CCPASTIX) ################################################################### # MURGE COMPATIBILITY # ################################################################### MAKE = $(MKPROG) CC = $(MPCCPROG) CFLAGS = $(CCTYPES) $(CCFOPT) FC = $(MCFPROG) FFLAGS = $(CCFOPT) LDFLAGS = $(EXTRALIB) $(BLASLIB)freefem++-3.61-1/download/scalapack/Makefile000644 000767 000024 00000004350 13256636774 021016 0ustar00hechtstaff000000 000000 # Downloading and compiling extra libraries # ----------------------------------------- include SLmake.inc all-local: scalapack # FFCS: parallel compilation crashes on Win32 (same archive updated from 2 different parallel makes) MAKEFLAGS=-j 1 # Downloading and compiling scalapack # ------------------------------ # http://www.netlib.org/scalapack/ # Hips information DIRPKG=../pkg SRCDIR=scalapack-2.0.2 PACKAGE1=$(DIRPKG)/scalapack-2.0.2.tgz SERVER=http://www.netlib.org/scalapack/ INSTALL=../.. # FFCS: shorten argument length to avoid "sh: ../ar: Argument list too long" under Cygwin DIR1 = TOOLS/LAPACK/*.o DIR2 = TOOLS/*.o DIR3 = PBLAS/SRC/PBBLAS/*.o DIR4 = PBLAS/SRC/PTZBLAS/*.o DIR5 = PBLAS/SRC/PTOOLS/*.o DIR6 = PBLAS/SRC/*.o DIR7 = REDIST/SRC/*.o DIR8 = SRC/*.o DIR9 = BLACS/SRC/*.o BLACS/SRC/*.oo scalapack: FAIRE # FFCS: shorten argument length to avoid "sh: ../ar: Argument list too long" under Cygwin $(SRCDIR)/FAIT-202:$(SRCDIR)/tag-tar cp SLmake.inc $(SRCDIR) cd $(SRCDIR);$(MAKE) lib rm $(SRCDIR)/libscalapack.a cd $(SRCDIR) && $(ARCH) $(ARCHFLAGS) libscalapack.a $(DIR1) $(DIR2) $(DIR3) $(DIR4) $(DIR5) $(DIR6) $(DIR7) $(DIR8) $(DIR9) $(RANLIB) $(SRCDIR)/libscalapack.a touch $(SRCDIR)/FAIT-202 install: mkdir -p ../include cp $(SRCDIR)/SRC/*.h ../include mkdir -p ../lib cp $(SRCDIR)/libscalapack.a ../lib WHERE: if [ -f $(SRCDIR)/FAIT-202 ] ; then \ make install; \ echo scalapack LD -L@DIR@/lib -lscalapack >../lib/WHERE.scalapack ;\ echo scalapack INCLUDE -I@DIR@/include >> ../lib/WHERE.scalapack ;\ fi FAIRE: $(SRCDIR)/FAIT-202 $(MAKE) WHERE touch FAIRE SLmake.inc: ../../config.status Makefile SLmake-scalapack.inc ../../config.status --file="SLmake.inc:SLmake-scalapack.inc" $(SRCDIR)/tag-tar: $(PACKAGE1) gunzip -c $(PACKAGE1) | tar xvf - touch $(SRCDIR)/tag-tar $(PACKAGE1): ../getall -o ScaLAPACK -a clean: # FFCS - need to clean completely even in case of error -rm SLmake.inc FAIRE FAIT # FFCS - make sure that all directories are cleaned. Thisis especially important under Windows because there is no # compilation dependencies control there (see # [[file:c:/cygwin/home/alh/ffcs/dist/configure.ac::dependency_tracking]]) -rm -rf scalapack-* -rm config.log # -rm $(PACKAGE1) .PHONY:$(SRCDIR)/$(INSTALL)freefem++-3.61-1/download/scalapack/SLmake-scalapack.inc000644 000767 000024 00000003442 13256636774 023146 0ustar00hechtstaff000000 000000 ############################################################################ # # Program: ScaLAPACK # # Module: SLmake.inc # # Purpose: Top-level Definitions # # Creation date: February 15, 2000 # # Modified: October 13, 2011 # # Send bug reports, comments or suggestions to scalapack@cs.utk.edu # ############################################################################ # # C preprocessor definitions: set CDEFS to one of the following: # # -DNoChange (fortran subprogram names are lower case without any suffix) # -DUpCase (fortran subprogram names are upper case without any suffix) # -DAdd_ (fortran subprogram names are lower case with "_" appended) CDEFS = @CFLAGSF77@ -DNO_IEEE $(USEMPI) # # The fortran and C compilers, loaders, and their flags # FC = @MPIF77@ CC = @MPICC@ NOOPT = -O0 @CNOFLAGS@ # FFCS - some return statements without value cause trouble on MacOS # FFCS - add path to mpi.h (required for MacOS 10.8 + MacPorts OpenMPI) # FFCS - added @CNOFLAGS@ according to upstream changes CCFLAGS = -O3 -Wreturn-type @CFLAGS@ -I'@MPI_INC_DIR@' @CNOFLAGS@ FCFLAGS = -O3 @CNOFLAGS@ FCLOADER = $(FC) CCLOADER = $(CC) FCLOADFLAGS = $(FCFLAGS) CCLOADFLAGS = $(CCFLAGS) # # The archiver and the flag(s) to use when building archive (library) # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo # ARCH = @AR@ ARCHFLAGS = @ARFLAGS@ RANLIB = @RANLIB@ # # The name of the ScaLAPACK library to be created # SCALAPACKLIB = libscalapack.a # # BLAS, LAPACK (and possibly other) libraries needed for linking test programs # BLASLIB = $(FFBLASLIB) LAPACKLIB = $(FFLAPACKLIB) LIBS = $(LAPACKLIB) $(BLASLIB) WGET = @WGET@freefem++-3.61-1/script/PostInstall.m4000644 000767 000024 00000001631 13256636774 017646 0ustar00hechtstaff000000 000000 #!/bin/sh # "-DFF__FVER=$(PACKAGE_VERSION)" # "-DFF_BINDIR=$(bindir)" # "-DFF__DATADIR=$(pkgdatadir) # "FFBIN="@prefix@"/bin ff_desktop="$HOME/Desktop/FreeFem++-""FF__FVER" mkdir -p -m 0755 /etc/paths.d ln -sf "FF__DATADIR"/"freefem++doc.pdf" "$HOME/Desktop" test -e "$ff_desktop" || ln -sf "FF__DATADIR"/"FF__FVER" "$ff_desktop" echo Install /etc/paths.d/FreeFem++ file: "FF_BINDIR" echo "FF_BINDIR" > /etc/paths.d/FreeFem++ chmod a+r /etc/paths.d/FreeFem++ echo " Try to Clean old file version " if [ -d /usr/local/bin ] ; then cd /usr/local/bin for i in FreeFem++ FreeFem++-CoCoa FreeFem++-mpi FreeFem++-nw bamg cvmsh2 ff-c++ ff-get-dep ff-mpirun ff-pkg-download ffglut ffmedit; do if [ -f "$i" ] ; then echo " clean $i " rm "$i"; fi done echo ln -s FF_BINDIR/FreeFem++-CoCoa /usr/local/bin/ ln -s FF_BINDIR/FreeFem++-CoCoa /usr/local/bin/ fi # bluid new link to new freefem++-3.61-1/examples++-tutorial/ref.edp000644 000767 000024 00000001644 13256636774 020703 0ustar00hechtstaff000000 000000 real REFadapt=0.238852; real REFadaptindicatorP1=0.23912; real REFadaptindicatorP2=0.239362; real REFalgo=0.283072; real REFaXtutorial=1.00032; real REFbeam=2.19089; real REFcavity=0.423606; real REFconvect2=2.59152; real REFconvectXapt=0.0016933; real REFconvect=10.2173; real REFFE=84.7687; real REFfluidStructAdapt=3.87121; real REFfluidStruct=1.25804; real REFLapDG2=2.04648; real REFLaplace=0.167397; real REFLaplaceP1bis=3.4845e-14; real REFLaplaceP1=2.34669; real REFLaplaceP1P2h=8.60123; real REFLaplaceRT=0.433835; real REFmovemesh=42.35; real REFnolinearXelas=1.00047; real REFNSUzawaCahouetChabart=2.02821; real REFonde=146.865; real REFplot=85.3776; real REFreadmesh=107.273; real REFregion=0.01116; real REFschwarzXgc=3.25892; real REFschwarzXnoXoverlap=5.07864; real REFschwarzXoverlap=5.05857; real REFsparseXmatrix=116.382; real REFsparseXcmatrix=232.764; real REFStokesUzawa=32.7781; real REFtablefunction=66.5851; freefem++-3.61-1/examples++-tutorial/exception.edp000644 000767 000024 00000001570 13256636774 022123 0ustar00hechtstaff000000 000000 real a; try { a=1./0.; } catch (...) { cout << " get a ExecError " << endl; a =0; } verbosity=10; int nn=5 ; mesh Th=square(nn,nn); verbosity=5; fespace Vh(Th,P1); // P1 FE space Vh uh,vh; // unkown and test function. func f=1; // right hand side function func g=0; // boundary condition function real cpu=clock(); problem laplace(uh,vh,solver=Cholesky,tolpivot=1e-6) = // definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form + int2d(Th)( -f*vh ) // linear form ; try { cout << " Try Cholesky \n"; laplace; // solve the problem plot(uh); // to see the result cout << "-- lap Cholesky " << nn << "x" << nn << " : " << -cpu+clock() << " s, max =" << uh[].max << endl; } catch(...) { cout << " Catch cholesky PB " << endl; } freefem++-3.61-1/examples++-tutorial/LaplaceRT.edp000644 000767 000024 00000002321 13256636774 021727 0ustar00hechtstaff000000 000000 /* Solving the following Poisson problem Find $p$, such that; $ - \Delta p = f $ on $\Omega$, $ dp / dn = (g1d,g2d). n $ on $\Gamma_{123}$ $ p = gd $ on $\Gamma_{1}$ with de Mixte finite element formulation Find $p\in L^2(\Omega) and $u\in H(div) $ such than u - Grad p = 0 - div u = f $ u. n = (g1d,g2d). n $ on $\Gamma_{123}$ $ p = gd $ on $\Gamma_{1}$ the variationnel form is: $\forall v\in H(div)$; $v.n = 0$ on $\Gamma_{4}\} $: $ \int_\Omega u v + p div v -\int_{\Gamma_{123}} gd* v.n = 0 $ $\forall q\in L^2$: $ -\int_\Omega q div u = \int_Omega f q $ and $ u.n = (g1n,g2n).n$ on $\Gamma_4$ */ mesh Th=square(10,10); fespace Vh(Th,RT0); fespace Ph(Th,P0); func gd = 1.; func g1n = 1.; func g2n = 1.; func f = 1.; Vh [u1,u2],[v1,v2]; Ph p,q; problem laplaceMixte([u1,u2,p],[v1,v2,q],solver=UMFPACK,eps=1.0e-10,tgv=1e30,dimKrylov=150) = int2d(Th)( p*q*0e-10+ u1*v1 + u2*v2 + p*(dx(v1)+dy(v2)) + (dx(u1)+dy(u2))*q ) + int2d(Th) ( f*q) - int1d(Th,1,2,3)( gd*(v1*N.x +v2*N.y)) // int on gamma + on(4,u1=g1n,u2=g2n); laplaceMixte; plot([u1,u2],coef=0.1,wait=1,ps="lapRTuv.eps",value=true); plot(p,fill=1,wait=1,ps="laRTp.eps",value=true); freefem++-3.61-1/examples++-tutorial/Periodic.edp000644 000767 000024 00000001471 13256636774 021663 0ustar00hechtstaff000000 000000 mesh Th=square(10,10,[2*x*pi,2*y*pi]); fespace Vh(Th,P2,periodic=[[2,y],[4,y],[1,x],[3,x]]); // the label 2 and 4 are periodic // [a1,b1,b2,f1],[b,fb] the degree of freedom of of the border a1,b1,c1 and b are equivalent // via fonctions f1 and f2 // here full periodic in x and y direction Vh uh,vh; // unkown and test function. func f=sin(x+pi/4.)*cos(y+pi/4.); // right hand side function func g=0; // boundary condition function problem laplace(uh,vh) = // definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form + int2d(Th)( -f*vh ) // linear form ; laplace; // solve the problem plot(uh); // to see the result plot(uh,ps="period.eps",value=true); freefem++-3.61-1/examples++-tutorial/fluidStructAdapt.edp000644 000767 000024 00000010507 13256636774 023407 0ustar00hechtstaff000000 000000 assert(version>=1.24); // for big bug is non symetric matrix see HISTORY, and sign in int1d int method1=0; int iwait=0; include "beam.edp" // Stokes on square b,e,f,g driven cavite on left side g border e(t=0,10) { x=t; y=-10; label= 1; }; // bottom border f(t=0,10) { x=10; y=-10+t ; label= 1; }; // right border g(t=0,10) { x=0; y=-t ;label= 2;}; // left border h(t=0,10) { x=t; y=vv(t,0)*( t>=0.001 )*(t <= 9.999); label=3;}; // top of cavity deforme real err=10; mesh sh = buildmesh(h(-20)+f(10)+e(10)+g(10)); plot(sh,wait=iwait); fespace Xh(sh,P2),Mh(sh,P1); fespace V1h(sh,P2); Xh u1,u2,v1,v2; Mh p,q,ppp; real veps=1e-4; varf bx(u1,q) = int2d(sh)( -(dx(u1)*q)); varf by(u1,q) = int2d(sh)( -(dy(u1)*q)); varf Lap(u1,u2)= int2d(sh)( dx(u1)*dx(u2) + dy(u1)*dy(u2) ) + on(2,u1=1) + on(1,3,u1=0) ; varf Mass(p,q)=int2d(sh)(p*q); Xh bc1; Xh brhs; matrix A= Lap(Xh,Xh,solver=CG); matrix M= Mass(Mh,Mh,solver=CG); matrix Bx= bx(Xh,Mh); matrix By= by(Xh,Mh); func cly =(-y)*(10.+y)/25.; Xh bcx=0,bcy=cly; func real[int] divup(real[int] & pp) { // int verb=verbosity; verbosity=1; brhs[] = Bx'*pp; brhs[] += bc1[] .*bcx[]; u1[] = A^-1*brhs[]; brhs[] = By'*pp; brhs[] += bc1[] .*bcy[]; u2[] = A^-1*brhs[]; ppp[] = M^-1*pp; ppp[] = 1.e-6*ppp[]; ppp[] = Bx*u1[]; ppp[] += By*u2[]; verbosity=verb; return ppp[] ; }; p=0;q=0;u1=0;v1=0; int i; th1 = movemesh(th, [x+uu, y+vv]); for( i=0;i<6;i++) { bc1=0; brhs=0; bc1[] = Lap(0,Xh); q=0; verbosity=50; LinearCG(divup,p[],veps=veps,nbiter=100); divup(p[]); verbosity=1; plot([u1,u2],p,wait=iwait,value=true,coef=0.1); real coef=0.2; Vh [uu1,vv1]; [uu1,vv1]=[uu,vv]; if(method1==1) { V1h sigma11,sigma22,sigma12; sigma11([x+uu,y+vv]) = (2*dx(u1)-p); sigma22([x+uu,y+vv]) = (2*dy(u2)-p); sigma12([x+uu,y+vv]) = (dx(u2)+dy(u1)); solve bbst([uu,vv],[w,s],init=i) = int2d(th)( lambda*div(w,s)*div(uu,vv) +2.*mu*( epsilon(w,s)'*epsilon(uu,vv) ) ) + int2d(th) (-gravity*s) + int1d(th,bottombeam)( coef*(sigma11*N.x*w + sigma22*N.y*s + sigma12*(N.y*w+N.x*s) ) ) + on(1,uu=0,vv=0) ; } else { // this piece of code is crucial to mixe adaptation and fluid structure fespace Vh11(th1,[P1,P1]); varf vFS([yyyy],[w,s])= int1d(th1,bottombeam)( coef*((2*dx(u1)-p)*N.x*w + (2*dy(u2)-p)*N.y*s + (dx(u1)+dy(u2))*(N.y*w+N.x*s)) ); Vh11 [FS,FS1];[FS,FS1]=[0,0]; FS[]= vFS(0,Vh11); cout << FS[].min << " " << FS[].max << endl; plot([FS,FS1],wait=iwait,value=1); solve bbst2([uu,vv],[w,s],init=i) = int2d(th)( lambda*div(w,s)*div(uu,vv) +2.*mu*( epsilon(w,s)'*epsilon(uu,vv) ) ) + int2d(th) (-gravity*s) + FS[] // + int1d(th,bottombeam)( coef*(sigma11*N.x*w + sigma22*N.y*s + sigma12*(N.y*w+N.x*s) ) ) + on(1,uu=0,vv=0) ; } //plot([uu,vv],wait=1); err = sqrt(int2d(th)( (uu-uu1)^2 + (vv-vv1)^2 )); cout << " ----- Iteration = " << i << " Erreur L2 = " << err << "----------\n"; cout << " max deplacement " << uu[].linfty << endl; bool iadapt=err>0.05; if(iadapt) th = adaptmesh(th,[uu,vv],err=1.e-2); [uu,vv]=[uu,vv]; [w,s]=[0,0]; th1 = movemesh(th, [x+uu, y+vv]); //plot(th1,wait=1); if(method1==1) sh = buildmesh(h(-20)+f(10)+e(10)+g(10)); else { fespace VVh(sh,P1);VVh uh,vh; solve lapllll(uh,vh,solver=CG,tgv=1e5) = // definion of the problem // compute a deformation field for moving the fluid mesh // x -> vv(x,0) is the new deformation y // x -> y is the position of the mesh on border 3 int2d(sh)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form + on(1,2,uh=0)+ on(3,uh=(vv(x,0)-y)*( x>=0.001 )*(x <= 9.999)) ; // boundary condition form sh = movemesh(sh,[x,y+uh]); if(iadapt) { sh = adaptmesh(sh,[u1,u2],p,err=2.e-2); lapllll; sh = movemesh(sh,[x,y+uh]); } plot(th1,sh,wait=iwait); p=p; u1=u1; u2=u2; A= Lap(Xh,Xh,solver=CG); M= Mass(Mh,Mh,solver=CG); Bx= bx(Xh,Mh); By= by(Xh,Mh); bcx=0; bcy=cly; } p=p;q=q;u1=u1;u2=u2;brhs=brhs;ppp=ppp; A= Lap(Xh,Xh,solver=CG); M= Mass(Mh,Mh,solver=CG); Bx= bx(Xh,Mh); By= by(Xh,Mh); bc1=0; // for resize bc1[] = Lap(0,Xh); } cout << " max deplacement " << uu[].linfty << endl; freefem++-3.61-1/examples++-tutorial/adapt.edp000644 000767 000024 00000001571 13312446271 021177 0ustar00hechtstaff000000 000000 // Mesh border a(t=0, 1.0){x=t; y=0; label=1;} border b(t=0, 0.5){x=1; y=t; label=2;} border c(t=0, 0.5){x=1-t; y=0.5; label=3;} border d(t=0.5, 1){x=0.5; y=t; label=4;} border e(t=0.5, 1){x=1-t; y=1; label=5;} border f(t=0.0, 1){x=0; y=1-t; label=6;} mesh Th = buildmesh (a(6) + b(4) + c(4) +d(4) + e(4) + f(6)); savemesh(Th, "th.msh"); // Fespace fespace Vh(Th, P1); Vh u, v; // Problem problem Probem1(u, v, solver=CG, eps=1.0e-6) = int2d(Th, qforder=2)( u * v * 1.0e-10 + dx(u)*dx(v) + dy(u)*dy(v) ) + int2d(Th, qforder=2)((x-y)*v) ; // Adaptation loop int i; real error = 0.01; for (i = 0; i < 4; i++) { // Solve Probem1; cout << u[].min << " " << u[].max << endl; // Plot plot(u,wait=1); // Mesh adaptation Th = adaptmesh(Th, u, err=error); plot(Th, wait=1); // Interpolation // on the new mesh u = u; // Error update error = error/2; } freefem++-3.61-1/examples++-tutorial/fluidStruct.edp000644 000767 000024 00000005174 13256636774 022441 0ustar00hechtstaff000000 000000 assert(version>=1.24); // for big bug is non symetric matrix see HISTORY, and sign in int1d include "beam.edp" // Stokes on square b,e,f,g driven cavite on left side g border e(t=0,10) { x=t; y=-10; label= 1; }; // bottom border f(t=0,10) { x=10; y=-10+t ; label= 1; }; // right border g(t=0,10) { x=0; y=-t ;label= 2;}; // left border h(t=0,10) { x=t; y=vv(t,0)*( t>=0.001 )*(t <= 9.999); label=3;}; // top of cavity deforme mesh sh = buildmesh(h(-20)+f(10)+e(10)+g(10)); plot(sh,wait=1); fespace Xh(sh,P2),Mh(sh,P1); fespace V1h(sh,P2); Xh u1,u2,v1,v2; Mh p,q,ppp; varf bx(u1,q) = int2d(sh)( -(dx(u1)*q)); varf by(u1,q) = int2d(sh)( -(dy(u1)*q)); varf Lap(u1,u2)= int2d(sh)( dx(u1)*dx(u2) + dy(u1)*dy(u2) ) + on(2,u1=1) + on(1,3,u1=0) ; varf Mass(p,q)=int2d(sh)(p*q); Xh bc1; Xh brhs; matrix A= Lap(Xh,Xh,solver=CG); matrix M= Mass(Mh,Mh,solver=CG); matrix Bx= bx(Xh,Mh); matrix By= by(Xh,Mh); Xh bcx,bcy; func real[int] divup(real[int] & pp) { // int verb=verbosity; verbosity=1; brhs[] = Bx'*pp; brhs[] += bc1[] .*bcx[]; u1[] = A^-1*brhs[]; brhs[] = By'*pp; brhs[] += bc1[] .*bcy[]; u2[] = A^-1*brhs[]; ppp[] = M^-1*pp; ppp[] = 1.e-6*ppp[]; ppp[] = Bx*u1[]; ppp[] += By*u2[]; verbosity=verb; return ppp[] ; }; p=0;q=0;u1=0;v1=0; int i; for( i=0;i<2;i++) { bcx=0; bcy= (-y)*(10.+y)/25.; cout << " loop " << i << endl; bc1[] = Lap(0,Xh); q=0; verbosity=50; LinearCG(divup,p[],eps=1.e-3,nbiter=50); divup(p[]); verbosity=1; plot([u1,u2],p,wait=1,value=true,coef=0.1,cmm="[u1,u2],p"); real coef=0.2; V1h sigma11,sigma22,sigma12; Vh [uu1,vv1]; [uu1,vv1]=[uu,vv]; sigma11([x+uu,y+vv]) = (2*dx(u1)-p); sigma22([x+uu,y+vv]) = (2*dy(u2)-p); sigma12([x+uu,y+vv]) = (dx(u2)+dy(u1)); solve bbst([uu,vv],[w,s],init=i) = int2d(th)( lambda*div(w,s)*div(uu,vv) +2.*mu*( epsilon(w,s)'*epsilon(uu,vv) ) ) + int2d(th) (-gravity*s) + int1d(th,bottombeam)( coef*(sigma11*N.x*w + sigma22*N.y*s + sigma12*(N.y*w+N.x*s) ) ) + on(1,uu=0,vv=0) ; cout << " max deplacement " << uu[].linfty << endl; plot([uu,vv],wait=1); real err = sqrt(int2d(th)( (uu-uu1)^2 + (vv-vv1)^2 )); cout << " ----- Iteration = " << i << " Erreur L2 = " << err << "----------\n"; th1 = movemesh(th, [x+uu, y+vv]); plot(th1,wait=1); sh = buildmesh(h(-20)+f(10)+e(10)+g(10)); plot(sh); p=p;q=q;u1=u1;u2=u2;brhs=brhs;ppp=ppp; A= Lap(Xh,Xh,solver=CG); M= Mass(Mh,Mh,solver=CG); Bx= bx(Xh,Mh); By= by(Xh,Mh); bc1=0; // for resize bc1[] = Lap(0,Xh); } cout << " max deplacement " << uu[].linfty << endl; freefem++-3.61-1/examples++-tutorial/forall.edp000644 000767 000024 00000001703 13256636774 021402 0ustar00hechtstaff000000 000000 real [int,int] a(10,10); real [int,int] aa(2,3); for [i,j,aij : aa] { aij= 1.+i+2*j; cout << i << " "<< j << " " << aij << endl; } real [int] b(10); for [i,bi : b] {bi=i+1; cout << i << " " << bi << endl;} cout << " b="<< b<< endl; for [i,j,aij : a] { aij= 1.+i+2*j; if(abs(i-j)>2) aij=0; } cout << a(1,2) << " == " << 1.+1+2*2 << endl; assert(abs(a(1,2)- (1.+1+2*2))<1e-9); cout << " a= "<< a << endl; matrix A=a; string[string] ss; ss["1"]= 1; ss["2"]= 2; ss["3"]= 5; for [i,bi : ss] ss[i]=bi+i+6+"-dddd"; cout <<" ss = "<< ss << endl; int[string] si; si[1]=2; si[50]=1; for [i,vi : si] { cout << " i " << setw(3) << i << " " << setw(10) <= 2.24); func abc= a(6) + b(4) + c(4) ; func def = d(4) + e(4) + f(6); plot(abc + def,wait=1); mesh rh = buildmesh (abc + def ); plot(rh,ps="lshape.eps"); } // ------------------------------------------------------------ { // readmesh mesh th("aile.msh"); plot(th); } // ------------------------------------------------------------ { // movemesh real Pi=atan(1)*4; verbosity=4; border a(t=0,1){x=t;y=0;label=1;}; border b(t=0,0.5){x=1;y=t;label=1;}; border c(t=0,0.5){x=1-t;y=0.5;label=1;}; border d(t=0.5,1){x=0.5;y=t;label=1;}; border e(t=0.5,1){x=1-t;y=1;label=1;}; border f(t=0,1){x=0;y=1-t;label=1;}; func uu= sin(y*Pi)/10; func vv= cos(x*Pi)/10; mesh Th = buildmesh ( a(6) + b(4) + c(4) +d(4) + e(4) + f(6)); // find a good deformation coef. // --------------------------------- // return the minimal area of a triangle of Th real okareamin = checkmovemesh(Th,[x,y])/10; // we accept to divide by 10 the area of the smallest triangles real coef=1000,cc=0; while (okareamin > (cc=checkmovemesh(Th,[x+coef*uu,y+coef*vv]) ) ) { cout << " coef = " << coef << " min area " << cc << endl; coef /=2; } Th=movemesh(Th,[x+coef*uu,y+coef*vv]); plot(Th,wait=1,fill=1,ps="movemesh.eps"); // save mesh int i=12; string filename="Th"+i+".msh"; savemesh(Th,filename); } // ------------------------------------------------------------ { // trunc mesh tools exemples mesh Th=square(3,3); int[int] n2o(1); fespace Vh(Th,P1); Vh u; int i,n=u.n; u=0; for (i=0;i1e-10,split=2,label=2,new2old=n2o); plot(Th,Shi,wait=1,ps="trunc"+i+".eps"); cout << " n2o " << n2o << endl; // where the element come u[][i]=0; } } // ------------------------------------------------------------ { // new stuff 2004 splitmesh (version 1.37) assert(version>=1.37); border a(t=0,2*pi){ x=cos(t); y=sin(t);label=1;} mesh Th=buildmesh(a(20)); plot(Th,wait=1,ps="nosplitmesh.eps"); plot(Th,wait=1); Th=splitmesh(Th,1+5*(square(x-0.5)+y*y)); plot(Th,wait=1,ps="splitmesh.eps"); } // ------------------------------------------------------------ { // new stuff 2004 emptymesh (version 1.40) // -- usefull to build Multiplicator space // build a mesh without internal point // with the same boundary // ----- assert(version>=1.40); border a(t=0,2*pi){ x=cos(t); y=sin(t);label=1;} mesh Th=buildmesh(a(20)); plot(Th,wait=1,ps="nosplitmesh.eps"); plot(Th,wait=1); Th=emptymesh(Th); plot(Th,wait=1,ps="emptymesh-1.eps"); } { // new stuff 2004 emptymesh (version 1.40) // -- usefull to build Multiplicator space // build a mesh without internal point // if the adj triangle // ----- assert(version>=1.40); mesh Th=square(10,10); int[int] ssd(Th.nt); fespace Ph(Th,P0); Ph sd; for(int i=0;i=5) + (iy>=5)*2; sd[][i]=ssd[i]; } plot(sd,fill=1,wait=1); Th=emptymesh(Th,ssd); plot(Th,wait=1,ps="emptymesh-2.eps"); savemesh(Th,"emptymesh-2.msh"); } // ------------------------------------------------------------ { // get mesh information (version 1.37) mesh Th=square(2,2); // get data of the mesh int nbtriangles=Th.nt; cout << " nb of Triangles = " << nbtriangles << endl; for (int i=0;i3.4-1 // --------- new stuff ----------------- int k=0,l=1,e=1; Th.nbe ; // return the number of boundary element \hfilll Th.be(k); // return the boundary element k $\in \{0,...,Th.nbe-1\}$ \hfilll Th.be(k)[l]; // return the vertices l $\in \{0,1\}$ of boundary element k \hfilll Th.be(k).Element ; // return the triangle contening the boundary element k \hfilll Th.be(k).whoinElement ; // return the egde number of triangle contening the boundary element k \hfilll Th[k].adj(e) ; // return adjacent triangle to k by edge e, and change the value of e to \hfilll // the corresponding edge in the adjacent triangle Th[k] == Th[k].adj(e) ;// non adjacent triangle return the same Th[k] != Th[k].adj(e) ;// true adjacent triangle cout << " print mesh connectivity " << endl; int nbelement = Th.nt; for (int k=0;k " << int(Th[k].adj((ee=e))) << " " << ee << " adj: " << ( Th[k].adj((ee=e)) != Th[k]) << endl; } // note : if k == int(Th[k].adj(ee=e)) not adjacent element int nbboundaryelement = Th.nbe; Th.be; for (int k=0;k> // in test ... { // 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)) ; plot(th,wait=1,ps="multy-border.eps"); // version 3.44-1 cout << " th max mesh size = h = " << th.hmax << endl; cout << " th min mesh size = " << th.hmin<< endl; } { include "movemeshsmooth.idp" mesh Th=square(3,3); int[int] lab=[1,2,3,4]; Th=adaptmesh(Th,0.1,IsMetric=1); fespace Vh(Th,P1); Vh u=x,v=y; verbosity=5;// 1000 debbug => plot Th=movemeshsmooth(Th,lab,u[],v[],100); verbosity=1; }freefem++-3.61-1/examples++-tutorial/medit.edp000644 000767 000024 00000001334 13256636774 021225 0ustar00hechtstaff000000 000000 int n=20,nn=n+10; real[int] xx(nn),yy(nn); // build square $]-1,1[^2$ mesh Th=square(10,10,[2*x-1,2*y-1]); fespace Vh(Th,P1); Vh u=2-x*x-y*y; // old code :: if(1) { savemesh(Th,"mm",[x,y,u*.5]); // save mm.points and mm.faces file for medit // build a mm.bb file { ofstream file("mm.bb"); file << "2 1 1 "<< u[].n << " 2 \n"; int j; for (j=0;j1.18); mesh Th=square(10,10); fespace Xh(Th,P2),Mh(Th,P1); Xh u1,u2,v1,v2; Mh p,q,ppp; varf bx(u1,q) = int2d(Th)( (dx(u1)*q)); varf by(u1,q) = int2d(Th)( (dy(u1)*q)); varf a(u1,u2)= int2d(Th)( dx(u1)*dx(u2) + dy(u1)*dy(u2) ) + on(1,2,4,u1=0) + on(3,u1=1) ; Xh bc1; bc1[] = a(0,Xh); Xh b; matrix A= a(Xh,Xh,solver=CG); matrix Bx= bx(Xh,Mh); matrix By= by(Xh,Mh); Xh bcx=1,bcy=0; Mh f=x; Xh g=sin(x); b[] = Bx'*f[]; b[] += bc1[] .*bcx[]; u1[] = A^-1*b[]; freefem++-3.61-1/examples++-tutorial/a_tutorial.edp000644 000767 000024 00000002440 13312446271 022245 0ustar00hechtstaff000000 000000 // This test shows some powerful features of FreeFem++ on a // simple example: -\Delta(u) = 1 in the unit cercle with u=0 on the // border of the unit cercle. This problem has an analytical solution // u = (1-x^2-y^2)/4 // Mesh real pi = 4*atan(1); border a(t=0, 2*pi){x=cos(t); y=sin(t); label=1;} mesh disk = buildmesh(a(50)); plot(disk); // Fespace fespace femp1(disk, P1); femp1 u, v; // Problem problem laplace(u, v) = int2d(disk)( // bilinear form dx(u)*dx(v) + dy(u)*dy(v) ) + int2d(disk)( // linear form - 1*v ) + on(1, u=0) // boundary condition ; // Solve laplace; // Error femp1 err = u - (1-x^2-y^2)/4; // Plot plot(u, value=true, wait=true); plot(err, value=true, wait=true); // Display (on terminal) cout << "error L2 = " << sqrt(int2d(disk)( (u-(1-x^2-y^2)/4)^2 )) << endl; cout << "error H10 = " << sqrt(int2d(disk)((dx(u)+x/2)^2) + int2d(disk)((dy(u)+y/2)^2) )<< endl; // Mesh adaptation disk = adaptmesh(disk, u, err=0.01); plot(disk, wait=1); // Solve laplace; // Error err =u-(1-x^2-y^2)/4; // Plot plot(u, value=true, wait=true); plot(err, value=true, wait=true); // Display cout << "error L2 = " << sqrt(int2d(disk)( (u-(1-x^2-y^2)/4) ^2 )) << endl; cout << "error H10 = " << sqrt(int2d(disk)((dx(u)+x/2)^2) + int2d(disk)((dy(u)+y/2)^2)) << endl; freefem++-3.61-1/examples++-tutorial/func.edp000644 000767 000024 00000002414 13256636774 021056 0ustar00hechtstaff000000 000000 // test of diff kind of freefem++ function // work if version >= 3.3 verbosity=500; real[int] G=[7,8,9]; func mesh carre(int n) { mesh th=square(n,n); return th;} func real[int] aaa(int n) { real[int] a(n); a=0; a[2]=n; return a;} func real[int] bb(real[int] &a) { cout << " sum " <Vh matrix RBB= interpolate(Wh,Vh); // build interpolation matrix matrix B=RB; B = B*(1+2i); matrix BB=RBB; varf vA(u,v) = int2d(Th)(dx(u)*dx(v)+dy(u)*dy(v))+ int1d(Th)(u*v); matrix A=vA(Wh,Wh); Vh ml=0; cout << " ml " << ml[] << endl; varf vML(u,v) = int2d(th)(1.*v); ml[]=vML(0,Vh); // build the P1 mass lump of P1 cout << ml[] << endl; matrix ML(ml[]); // matrix diagonal cout << "ML="< sparseA=A; cout << sparseA << endl; sparseA = 2*sparseA+sparseA; sparseA = 4*sparseA+sparseA*(5+1i); // * 27 matrix sparseB=sparseA;//+sparseA+sparseA; ; cout << sparseA << endl; cout << sparseB << endl; // *81 cout << "sparseB = " << sparseB(0,0) << endl; // ajoute version 2.0-2 sparseA=A; verbosity=4; if(HaveUMFPACK) set(sparseA,solver=UMFPACK,tolpivot=1e-10,tolpivotsym=1e-9); else set(sparseA,solver=GMRES); bb=sparseA^-1*a; verbosity=1; b = sparseA*bb; b -= a; cout << " nb coef sparseA " << sparseA.nbcoef << endl; cout << " ||b.||_1 " << b.l1 << endl; cout << " ||b.||_2 " << b.l2 << endl; cout << " ||b.||_infty " << b.linfty << endl; assert(b.l1 < 1e-10); } {// version 3.8 mesh Th=square(2,2); fespace Xh(Th,P1); varf vv(u,v)= int2d(Th)( ((2+1i)*u*v)')+int2d(Th)((3+2i)*v);//'); varf vr(u,v)= int2d(Th)( u*v);//'); matrix A=vv(Xh,Xh); matrix Ar=vr(Xh,Xh); complex[int] vc=vv(0,Xh); real[int] vrr=vc.re,vii=vc.im; vrr=vc.re; vii=vc.im; // bugus ::s // vrr=real(vc); // vii=imag(vc); cout << "vc[0] = " <l) | (y >0.5),label=4); func meshsize= 2*max(0.05,max(max(x-l,0.0)/19./5.,max(l-x,0.0)/3./8. )); func uin=(H-y)*(y-0.5)/square((H-0.5)/2.); Th=adaptmesh(Th,meshsize,IsMetric=1); Th=adaptmesh(Th,meshsize,IsMetric=1); plot(Th,wait=0); fespace Xh(Th,P2); fespace Mh(Th,P1); fespace XXMh(Th,[P2,P2,P1]); XXMh [u1,u2,p]; XXMh [v1,v2,q]; macro div(u1,u2) (dx(u1)+dy(u2))// macro grad(u1,u2) [dx(u1),dy(u2)]// macro ugrad(u1,u2,v) (u1*dx(v)+u2*dy(v)) // macro Ugrad(u1,u2,v1,v2) [ugrad(u1,u2,v1),ugrad(u1,u2,v2)]// solve Stokes ([u1,u2,p],[v1,v2,q],solver=UMFPACK) = int2d(Th)( ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + p*q*(0.000001) - p*div(v1,v2)-q*div(u1,u2) ) + on(1,u1=uin,u2=0) + on(3,4,5,u1=0,u2=0); Xh uu1=u1,uu2=u2; plot(coef=0.2,cmm="Stokes [u1,u2] et p ",p,[uu1,uu2],wait=0); plot(coef=0.2,cmm="Stokes p ",p,wait=0); Mh psi,phi; solve streamlines(psi,phi) = int2d(Th)( dx(psi)*dx(phi) + dy(psi)*dy(phi)) + int2d(Th)( -phi*(dy(u1)-dx(u2))) + on(3,4,psi=0)+ on(5,psi=-2./3.*(H-0.5)) ; real[int] psiviso(31); {int k=0; for(int i=-20;i<0;i++) psiviso[k++] = i*2./3.*(H-0.5)/20; for(int i=0;i<=10;i++) psiviso[k++] = i*2./3.*(H-0.5)/100/(H*H*H); } plot(psi,wait=0,viso=psiviso); int i=0; real nu=1./100.; real dt=0.1; real alpha=1/dt; XXMh [up1,up2,pp]; varf vDNS ([u1,u2,p],[v1,v2,q]) = int2d(Th)( + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + p*q*(0.000001) + p*dx(v1)+ p*dy(v2) + dx(u1)*q+ dy(u2)*q + Ugrad(u1,u2,up1,up2)'*[v1,v2] + Ugrad(up1,up2,u1,u2)'*[v1,v2] ) + on(1,3,4,5,u1=0,u2=0) ; varf vNS ([u1,u2,p],[v1,v2,q]) = int2d(Th)( + nu * ( dx(up1)*dx(v1) + dy(up1)*dy(v1) + dx(up2)*dx(v2) + dy(up2)*dy(v2) ) + pp*q*(0.000001) + pp*dx(v1)+ pp*dy(v2) + dx(up1)*q+ dy(up2)*q + Ugrad(up1,up2,up1,up2)'*[v1,v2]//' ) + on(1,3,4,5,u1=0,u2=0) ; for(int krey=0;krey=l & x < (l+0.5)) | (x>(l+0.4)) & (x<10)& (dy(psi) >= 1e-5)) ) ; real rp2=1./(H-h)*int1d(Th,3)( real( (x>=l & x < (l+0.5)) | (x>(l+0.4)) & (x<10)& (dy(psi) >= -1e-5)) ) ; real rp3=1./(H-h)*int1d(Th,3)( real( (x>=l & x < (l+0.5)) | (x>(l+0.4)) & (x<10)& (dy(u1)<=0) ) ) ; cout << " Reattach point " << rp2 << " " << rp2 << " " << rp3 << endl; real rp = (rp1+rp2)/2; real rppaper = krey < 2 ? reattachP(krey,cas) : rp; real err= abs(rppaper - rp)/rp; if( err>0.5 ) nerr++;// cout << "\n\n\n"; cout << "H= " << H << " Re " << re << " Reattach point " << rp << " paper=" << rppaper << " err "<< err << " psi max = " << psi[].max <> reference example cout << "in " << FILE << " line " << LINE << " -- '" << Stringification( "zzz" aa () {} + /* */ bb cc) << "'" << endl; cout << " unix time = " << time() << " " << ltime() << endl; freefem++-3.61-1/examples++-tutorial/BEM.edp000644 000767 000024 00000005266 13256636774 020536 0ustar00hechtstaff000000 000000 // compute the solution of a Laplace operator in a Semi infini domain. // with coupling of Boundary element with periodicity BC in x . // ------------------------------------------------------------- include "ExtractDofsonBorder.idp" real eps0=1; int labup=3, labdown=1; int nharm= 10; // Number of Harmonique func ug= max(0.,-(x-0.5)*(x-0.75)); // boundary condition.. macro Grad(u) [dx(u),dy(u)] // eom real Xmax=1,Ymax=0.3; int NNx=100,NNy=NNx*Ymax; mesh Th=square(NNx,NNy,[x*Xmax,y*Ymax]); fespace Vh(Th,P1,periodic=[[2,y],[4,y]]); Vh uref; // la solution de reference. { // calcule de la solution de reference in Huge Domaine. mesh Th1=square(NNx,NNx*10,[x*Xmax,10*Xmax*y]); // pour la solution de reference fespace Uh(Th1,P1,periodic=[[2,y],[4,y]]); Uh uu,vv; solve Pref(uu,vv)=int2d(Th1)(eps0*(Grad(uu)'*Grad(vv)))+on(labdown,uu=ug); uref=uu; plot(uu,wait=1,cmm=" ref sol / large Th "); } // pour nettoyer la memoire plot(uref,wait=1,cmm=" ref sol / Th"); varf vP(u,v)=int2d(Th)(eps0*(Grad(u)'*Grad(v)))+on(labdown,u=ug); varf vF(u,v)=on(labdown,u=ug); matrix A=vP(Vh,Vh); // la matrice sans BEM. complex[int] b=vF(0,Vh); Vh u; {// for cleanning all local varaible at end of block. // computation of the matrice BEM // nb of DoF on border int[int] IdfB2Vh(1); // for numbering IdfB2Vh[i]==i ExtractDofsonBorder(labup,Vh,IdfB2Vh,-1) int kdfBEM=IdfB2Vh.n; // verif if(0) { Vh X=x; real[int] xx(IdfB2Vh.n); xx=X[](IdfB2Vh); cout << IdfB2Vh << endl; cout << xx << endl; } // end of the numbering computation // so IdfB2Vh[ibem] = iVh where ibem is a df of on bem , and iVh is a df in Vh space. real perio=Xmax; complex deuxpii=2*pi*1i; int n=0;// // Use of higher order Quadarture formular ... varf vWn(u,w)=int1d(Th,labup,qforder=10)(exp(-deuxpii*(n)*x)*w); //complex[int] wn=vWn(0,Vh);// with Vh numbering.. complex[int,int] ABemFull(kdfBEM,kdfBEM);// the full bem matrix in Bem numbering. ABemFull=0;// set of 0 for ( n=-nharm;n<=nharm;++n) { complex[int] wwn(kdfBEM); complex[int] wn=vWn(0,Vh); wwn=wn(IdfB2Vh);// wwn(i) = wn(IdfB2Vh(i)) i=0 a wwn.n -1 complex Gs=+2.*pi*abs(n/perio/perio)*eps0; ABemFull += Gs*wwn*wwn'; } matrix ABem=ABemFull(IdfB2Vh^-1,IdfB2Vh^-1); // Build the sparse BEm matrix // ABem(IdfB2Vh(ib),IdfB2Vh(jb)) = ABemFull(ib,jb) A = A + ABem; }// for cleanning all local varaible at end of block. ABem ABemFull set(A,solver=UMFPACK); u[]=A^-1*b; Vh ur=real(u),ui=imag(u); Vh err=ur-uref; cout << " err Linty=" << err[].linfty << " / " << uref[].linfty << endl; plot(ur,uref,wait=1,cmm="ur + uref "); freefem++-3.61-1/examples++-tutorial/regtests.edp000644 000767 000024 00000032273 13312446271 021751 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ // Regression tests // ---------------- // The tests are checked against reference values by "make check" in // each examples subdirectory // "ref.edp" contains all reference values and may be rebuilt with // "make Ref" // $Id$ // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. NoUseOfWait=true; int verbosityy=verbosity; include "ref.edp"; // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. cout << "--------- file : adapt.edp -----------------" << endl; verbosity=verbosityy; { include "adapt.edp"; real TESTadapt=u[].max-u[].min; cout<<"adapt reference value = "< (a+c,0,a+c) // so the associed matrix is: // ( 1 0 1 ) // ( 0 0 0 ) // ( 1 0 1 ) // ------------------ verbosity=0; // data CMS 1 real xp=0.35,yp=0.0;// real upbench= -0.007187, vpbench= -0.066; real EE = 1.4e6; real rho = 1000; real sigma = 0.4; real mu = EE/(2*(1+sigma)); real lambda = EE*sigma/((1+sigma)*(1-2*sigma)); real gravity = -2; int nnn = 10; mesh Th = square(17*nnn,nnn,[0.35*x,0.02*(y-0.5)]); cout<<" Th nt : " << Th.nt< 8000) lerr = 0.05; if (re > 10000) lerr = 0.01; for (int step = 0; step < 2; step++) { // Mesh adaptation & interpolation Th = adaptmesh(Th, [u1, u2], p, err=lerr, nbvx=100000, abserror=0, cutoff=0.01); [u1, u2, p] = [u1, u2, p]; [up1, up2, pp] = [up1, up2, pp]; // Newton for (i = 0; i <= 20; i++) { // Update up1[] = u1[]; // Solve real[int] b = vNS(0, XXMh); // build right hand side matrix Ans = vDNS(XXMh, XXMh); // build matrix set(Ans, solver=UMFPACK); // set solver u1[] = Ans^-1*b; // solve linear system // Error b = u1[]-up1[]; cout << "iter = "<< i << ", err = " << b.l2 << ", rey = " << re << endl; // Convergence criteria if (b.l2 < 1e-6) break; } } // Stream-lines uu1 = u1; uu2 = u2; streamlines; plot(coef=0.2, cmm="rey="+re+" [u1, u2] and p", psi, [uu1, uu2], wait=0, nbiso=20, ps="cavity-"+re+".ps"); } freefem++-3.61-1/examples++-tutorial/mortar-msh.idp000644 000767 000024 00000002341 13256636774 022217 0ustar00hechtstaff000000 000000 // --- begin meshes building -------------- real[int] theta(nbsd+1),cost(nbsd),sint(nbsd); for (int i=0;i $@ clean-local: -rm *.fg *.eps *~ *.ps *.mesh *.mesh.gmsh f.txt u.txt A.matrix mm.matrix mm.b sphere-a.faces sphere-a.points sphere.faces sphere.points toto.Th toto.am_fmt toto.dbg.gmsh toto.Th.gmsh toto.dbg toto.msh plot.gp ListOfAllocPtr-8.bin ffglut*.ppm th.msh Th1.msh Th12.msh th.msh emptymesh-2.msh thermic.dat # To create a new set of reference values in "ref.edp" Ref: makeref.edp freefem++.pref ../src/nw/FreeFem++-nw makeref.edp install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: freefem++-3.61-1/examples++-tutorial/LaplaceP1P2h.edp000644 000767 000024 00000002367 13256636774 022246 0ustar00hechtstaff000000 000000 mesh Th=square(10,10); fespace Vh(Th,P1); // P1 FE space Vh uh,vh; // unkown and test function. func f=1; // right hand side function func g=0; // boundary condition function problem laplace(uh,vh,solver=CG) = // definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form + int1d(Th,1)( uh*vh) - int1d(Th,1)( vh) - int2d(Th)( f*vh ) // linear form + on(2,3,4,uh=g) ; // boundary condition form laplace; // solve the problem plot(uh); // to see the result plot(uh,ps="LaplaceP1P2h.eps",value=true); // if error on macos version codeworrior // remove in panal PPC linker FreeFEm++ Setting Dead-strip Static Initializition Code Flag fespace V2h(Th,P2); V2h u2h,v2h; // unkown and test function. problem errorh (u2h,v2h,solver=CG) = // definion of the problem int2d(Th)( dx(u2h)*dx(v2h) + dy(u2h)*dy(v2h) ) // bilinear form + int1d(Th,1)( u2h*v2h) - int1d(Th,1)( v2h) - int2d(Th)( f*v2h ) // linear form + on(2,3,4,u2h=g) ; // boundary condition form errorh; plot(u2h,ps="ErrorHerachical.ps",value=true,wait=1);freefem++-3.61-1/examples++-tutorial/NSUzawaCahouetChabart.edp000644 000767 000024 00000005374 13256636774 024261 0ustar00hechtstaff000000 000000 real D=0.1, H=0.41; real cx0 = 0.2, cy0 = 0.2; // center of cyl. real xa = 0.15, ya=0.2, xe = 0.25,ye =0.2; border fr1(t=0,2.2){x=t; y=0; label=1;} border fr2(t=0,H){x=2.2; y=t; label=2;} border fr3(t=2.2,0){x=t; y=H; label=1;} border fr4(t=H,0){x=0; y=t; label=1;} border fr5(t=2*pi,0){x=cx0+D*sin(t)/2; y=cy0+D*cos(t)/2; label=3;} int nn=15; mesh Th=buildmesh(fr1(5*nn)+fr2(nn)+fr3(5*nn)+fr4(nn)+fr5(-nn*3)); real Um= 1.5;// max velocity (Rey 100) func Ub = Um*2./3.; real nu = 1e-3; real Rey = Ub*D/nu; // Boundary condition func U1 = 4.*Um*y*(H-y)/(H*H) ; func U2 = 0. ; real T=2,t=0; real dt = D/nn/Um;// CFL = 1 cout << " dt = " << dt < 5) cc = 1; if (i < 9) { ReMeshIndicator(Th, Ph, Vh, indicator2, cc); u=u; } // Plot plot(u, Th, wait=1, ps="arei-Thu.eps", value=1); } freefem++-3.61-1/examples++-tutorial/freeboundary.edp000644 000767 000024 00000003254 13256636774 022613 0ustar00hechtstaff000000 000000 // // calcul d'une zone saturation en eau (nappe phréatique) // real L=10; // longueur du domaine real q=0.02; // flux entrant real K=0.5; //permeabilité real erradap=0.001; real coef=1; real h=2.1; // hauteur du bord gauche real h1=0.35; // hauteur du bord droite // maillage d'un tapeze border a(t=0,L){x=t;y=0;}; // bas border b(t=0,h1){x=L;y=t;}; // droite border f(t=L,0){x=t;y=t*(h1-h)/L+h;}; // free surface border d(t=h,0){x=0;y=t;}; // gauche int n=10; mesh Th=buildmesh (a(L*n)+b(h1*n)+f(sqrt(L^2+(h-h1)^2)*n)+d(h*n)); plot(Th,ps="dTh.eps"); fespace Vh(Th,P1); int j=0,ii=0; Vh u,v,uu,vv; problem Pu(u,uu,solver=CG) = int2d(Th)( dx(u)*dx(uu)+dy(u)*dy(uu)) + on(b,f,u=y) ; problem Pv(v,vv,solver=CG) = int2d(Th)( dx(v)*dx(vv)+dy(v)*dy(vv)) + on (a, v=0) + int1d(Th,f)(vv*((q/K)*N.y- (dx(u)*N.x+dy(u)*N.y))); real errv=1; verbosity=1; while(errv>1e-6) { j++; Pu; Pv; plot(Th,u,v ,wait=0); errv=int1d(Th,f)(v*v); // if (j%10==0) // Th=adaptmesh(Th,u,err=erradap ) ; real coef=1; real mintcc = checkmovemesh(Th,[x,y])/5.; real mint = checkmovemesh(Th,[x,y-v*coef]); if (mintmintcc) break; cout << " min |T] " << mint << endl; coef /= 1.5; } Th=movemesh(Th,[x,y-coef*v]); // calcul de la deformation cout << "\n\n"<= tol) { loopcount ++; //////////////////////////////////////////////////////////// cout << "Loop " << loopcount << endl; // plot([u1n,u2n], wait=0, cmm="displacement:" ); /* cout << "TESTING: Begin" << endl; cout << "dFStress2PK11 = " << dFStress2PK11 (u1n, u2n, varu1, varu2) << endl; cout << "TESTING: End" << endl; cout << "B11 = " << B11(u1n, u2n) << endl; cout << "B12 = " << B12(u1n, u2n) << endl; cout << "B21 = " << B21(u1n, u2n) << endl; cout << "B22 = " << B22(u1n, u2n) << endl << endl; cout << "J = " << J(u1n, u2n) << endl << endl; StrK11 = StressK11(u1n, u2n); StrK12 = StressK12(u1n, u2n); StrK21 = StressK21(u1n, u2n); StrK22 = StressK22(u1n, u2n); cout << "StressK11 = " << StrK11 << endl; cout << "StressK12 = " << StrK12 << endl; cout << "StressK21 = " << StrK21 << endl; cout << "StressK22 = " << StrK22 << endl; */ neoHookeanInc; // compute [varu1,varu2] = (D^2 J(u1n))^{-1}(D J(u1n)) // cout << "This marker reached" << endl; u1 = varu1; u2 = varu2; w1[] = Mass*varu1[]; res = sqrt(w1[]' * varu1[]); // norme L^2 of [varu1, varu2] // cout << " u1 min =" <5) cout << " err "<< err << " " << step << endl; if(verbosity>9999){ if(verbosity>99999) plot([u,v], wait=1); mesh Thm= movemesh(Th,[u,v]); plot(Thm,Th); } if(err < 1e-6) break; } return movemesh(Th,[u,v]); } /* // For test ... // smothing before move mesh mesh Th=square(3,3); int[int] lab=[1,2,3,4]; Th=adaptmesh(Th,0.1,IsMetric=1); fespace Vh(Th,P1); Vh u=x,v=y; verbosity=10; Th=movemeshsmooth(Th,lab,u[],v[],100); */freefem++-3.61-1/examples++-tutorial/Laplace.edp000644 000767 000024 00000001173 13256636774 021465 0ustar00hechtstaff000000 000000 mesh Th=square(10,10); fespace Vh(Th,P1); // P1 FE space Vh uh,vh; // unkown and test function. func f=1; // right hand side function func g=0; // boundary condition function problem laplace(uh,vh,solver=GMRES,tgv=1e5) = // definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form - int2d(Th)( f*vh ) // linear form + on(1,2,3,4,uh=g) ; // boundary condition form laplace; // solve the problem plot(uh); // to see the result plot(uh,ps="Laplace.eps",value=true); freefem++-3.61-1/examples++-tutorial/readmesh.edp000644 000767 000024 00000004063 13256636774 021715 0ustar00hechtstaff000000 000000 border floor(t=0,1){ x=t; y=0; label=1;}; // the unit square border right(t=0,1){ x=1; y=t; label=5;}; border ceiling(t=1,0){ x=t; y=1; label=5;}; border left(t=1,0){ x=0; y=t; label=5;}; int n=10; mesh th= buildmesh(floor(n)+right(n)+ceiling(n)+left(n)); savemesh(th,"toto.am_fmt");// format "formated Marrocco" savemesh(th,"toto.Th");//format database "bamg" savemesh(th,"toto.dbg");//format debug savemesh(th,"toto.msh"); //format freefem mesh th2 = readmesh("toto.msh"); fespace femp1(th,P1); femp1 f = sin(x)*cos(y),g; int where; real xx; { ofstream file("f.txt",binary);// for windows add binary version 3.30 file.precision(16); file << f[] << endl; where=file.tellp(); file << 0.1 ; // file << " " << 0.2 ; cout << " where in file " << where << endl; file << " # comment bla bla ... 0.3 \n"; file << 0.2 << endl; file.flush; // to flush the io buffer of file } // Idea to skip comment in a file ... start with # too EOL func ifstream skipcomment(ifstream &ff) { while(1) { int where = ff.tellg(); // store file position string comment; ff >> comment; if ( ! ff.good() ) break; if( comment(0:0)=="#") { getline(ff,comment); cout << " -- #" << comment << endl; } else { ff.seekg(where); //restore file position break; } } return ff; } { ifstream file("f.txt",binary); // for windows (pb CRNL EOL translation ) cout << " where " << file.seekg << endl; file.seekg(where); file >> xx; cout << " xx = " << xx << " good ? " << file.good() << endl; assert(xx==0.1); skipcomment(file) >> xx; assert(xx==0.2); file.seekg(0); cout << " where " << file.tellg() << " " << file.good() << endl; file >> g[] ; } fespace Vh2(th2,P1); Vh2 u,v; plot(g); solve pb(u,v) = int2d(th2)( u*v -dx(u)*dx(v)-dy(u)*dy(v) ) + int2d(th2)(-g*v) + int1d(th2,5)( -g*v) + on(1,u=0) ; plot (th2,u); cout << " (u[],u[]) = " << (u[]'*u[]) << endl; { ofstream file("u.txt"); file << u[] << endl; file.seekp(100); file.flush; file << "xxx "<< endl; } freefem++-3.61-1/examples++-tutorial/periodic4.edp000644 000767 000024 00000002274 13256636774 022011 0ustar00hechtstaff000000 000000 real r=0.25; // a diamond with a hole border a(t=0,1){x=-t+1; y=t;label=1;}; border b(t=0,1){ x=-t; y=1-t;label=2;}; border c(t=0,1){ x=t-1; y=-t;label=3;}; border d(t=0,1){ x=t; y=-1+t;label=4;}; border e(t=0,2*pi){ x=r*cos(t); y=-r*sin(t);label=0;}; int n = 10; mesh Th= buildmesh(a(n)+b(n)+c(n)+d(n)+e(n)); plot(Th,wait=1); real r2=1.732; func abs=sqrt(x^2+y^2); // warning for periodic condition: // side a and c \hfilll // on side a (label 1) $ x \in [0,1] $ or $ x-y\in [-1,1] $ \hfilll // on side c (label 3) $ x \in [-1,0]$ or $ x-y\in[-1,1] $\hfilll // so the common abcissa can be repectively $x$ and $x+1$ // or you can can try curviline abcissa $x-y$ and $x-y$ // 1 first way // fespace Vh(Th,P2,periodic=[[2,1+x],[4,x],[1,x],[3,1+x]]); // 2 second way fespace Vh(Th,P2,periodic=[[2,x+y],[4,x+y],[1,x-y],[3,x-y]]); Vh uh,vh; func f=(y+x+1)*(y+x-1)*(y-x+1)*(y-x-1); real intf = int2d(Th)(f); real mTh = int2d(Th)(1.); real moyf = intf/mTh; cout << moyf << endl; problem laplace(uh,vh) = int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) + int2d(Th)( (moyf-f)*vh ) ; laplace; plot(uh,wait=1,ps="perio4.eps");freefem++-3.61-1/examples++-tutorial/FE.edp000644 000767 000024 00000002735 13256636774 020423 0ustar00hechtstaff000000 000000 // test all FEspace verbosity=10; mesh Th=square(5,5); verbosity = 10; cout << " P0 " << endl; fespace Ph(Th,P0); cout << " P1 " << endl; fespace Vh(Th,P1); cout << " P2 " << endl; fespace Wh(Th,P2); cout << " nb of degre of freedom : " << Wh.ndof << endl; cout << " nb of degre of freedom / ELEMENT : " << Wh.ndofK << endl; //* don't work to day in progresse { int k= 2; int kdf= Wh.ndofK ; cout << " df of element " << k << ":" ; for (int i=0;i=2.23); // Mortar (4 sub domain) // with matrix -et Precon Conjugade Gradient -- // Neuman -> Dirichlet . // ------------------------------- func f=1+x+y; real g=1; int withprecon=1; macro Grad(u) [ dx(u), dy(u) ] // int nbsd=4; macro Psd(U) U[0],U[1],U[2],U[3] // int labext= nbsd+1; real meshsize=0.025; real meshsizem=meshsize*1.5; bool noconforme=0; include "mortar-msh.idp" cout << "mortar : " << endl; mesh Thm=Tha; Thm=adaptmesh(Thm,meshsizem,IsMetric=1,thetamax=60,nbvx=100000); Thm=adaptmesh(Thm,meshsizem,IsMetric=1,thetamax=60,nbvx=1000000); Thm=emptymesh(Thm); mesh Thmm=Thm; if(noconforme) { // need a find mesh to integrate on Thm. Thmm=trunc(Thm,split=4,1); // for fine integration Thmm=emptymesh(Thmm); } plot(Thm,wait=0); verbosity=1; mesh[int] Thsd(nbsd); for(int sd=0;sd0.00001); Csd[sd] = cci(Lh,Vhi); Asd[sd] = vLapMi(Vhi,Vhi,solver=UMFPACK); PAsd[sd] = vPLapMi(Vhi,Vhi,solver=UMFPACK); matrix IVL=interpolate(Vhi,Lh,inside=1); // v = IVL*l varf vonext(u,v)=on(labext,u=1); varf von1(u,v)=on(1,u=1); real[int] onext=vonext(0,Vhi); real[int] on1=von1(0,Vhi); on1= on1 ? 1 : 0; on1 = onext ? 0 : on1; // remove df of ext matrix I1(on1);// matrix tgv $i\in Gamma_1 \ Gamma_e $ , 0 otherwise PIsd[sd]= I1*IVL;// remove of line not on $Gamma_1 \ Gamma_e $ // so PIsd[sd]*l = tgv * Interpole l on $Gamma_1 \ Gamma_e $ I1.diag=on1; matrix AA=I1*Asd[sd];// remove line not on lab 1 PJsd[sd]= IVL'*AA; rhssd[sd][]=vLapMi(0,Vhi); } plot(epssd,cmm="eps 0,1,2,3",wait=0,value=1); lh[]=0; varf vDD(u,v) = int2d(Thm)(u*v*1e-10); varf vML(u,v) = int2d(Thm)(u*v*1e-10)+int1d(Thm,1)(u*v); matrix ML=vML(Lh,Lh); matrix DD=vDD(Lh,Lh); matrix M=[ [ Asd[0] ,0 ,0 ,0 ,Csd[0] ], [ 0 ,Asd[1] ,0 ,0 ,Csd[1] ], [ 0 ,0 ,Asd[2] ,0 ,Csd[2] ], [ 0 ,0 ,0 ,Asd[3] ,Csd[3] ], [ Csd[0]',Csd[1]',Csd[2]',Csd[3]',DD ] ]; real[int] xx(M.n); real[int] bb =[rhssd[0][], rhssd[1][],rhssd[2][],rhssd[3][],rhsl[] ]; set(M,solver=UMFPACK); xx = M^-1 * bb; [usd[0][],usd[1][],usd[2][],usd[3][],lh[]] = xx; // dispatch the solution plot(usd,cmm="u1,u2,u3,u4",wait=1); int itera=0; varf vbc(u,v) = int1d(Thm,labext)(v); real[int] lbc(Lh.ndof),lbc0(Lh.ndof); lbc=vbc(0,Lh); lbc = lbc ? 0 : 1 ; func real[int] SkPb(real[int] &l) { int verb=verbosity; verbosity=0; itera++; for(int sd=0;sd 15;; } // minimisation of $J(u) = \frac12\sum (i+1) u_i^2 - b_i $ // work array real[int] b(10),u(10); func real J(real[int] & u) { real s=0; for (int i=0;i=0) C(I[i])+=a[i]; cout << " b = a(I) : " << b << "\n c(I) = a " << c << endl; } { // bidimensionnal array int N=3,M=4; real[int,int] A(N,M),RA(N,M); real[int] b(N),c(M); b=[1,2,3]; c=[4,5,6,7]; complex[int,int] C(N,M); complex[int] cb=[1,2,3],cc=[10i,20i,30i,40i]; b=[1,2,3]; int [int] I=[2,0,1]; int [int] J=[2,0,1,3]; A=1; // set the all matrix A(2,:) = 4; // the full line 2 A(:,1) = 5; // the full column 1 A(0:N-1,2) = 2; // set the column 2 A(1,0:2) = 3; // set the line 1 from 0 to 2 cout << " A = " << A << endl; // outer product C = cb*cc'; C += 3*cb*cc'; C -= 5i*cb*cc'; cout << " C = " << C << endl; // the way to transform a array to a sparce matrix matrix B; B = A; B=A(I,J); // B(i,j)= A(I(i),J(j)) B=A(I^-1,J^-1); // B(I(i),J(j))= A(i,j) A = 2.*b*c'; // outer product cout << " A = " << A << endl; cout << " A(1,2) " << A(1,2) << endl; B = b*c'; // outer product B(i,j) = b(i)*c(j) B = b*c'; // outer product B(i,j) = b(i)*c(j) B = (2*b*c')(I,J); // outer product B(i,j) = b(I(i))*c(J(j)) B = (3.*b*c')(I^-1,J^-1); // outer product B(I(i),J(j)) = b(i)*c(j) cout << "B = (3.*b*c')(I^-1,J^-1) = " << B << endl; cout << " b =" << b << endl; b = exp(b) ; cout << " exp(b) =" << b << endl; cb += complex(10.)*cc(0:2); cout << " cb =" << cb << endl; cb = exp(cb) ; cout << " exp(cb) =" << cb << endl; cout << " exp(cb).re =" << cb.re << endl; cout << " exp(cb).im =" << cb.im << endl; cb.im = 0.; cout << cb << endl; b += cb.re + cb.im; // do not work to do cout << " b = " << endl; {ofstream FA("A.txt"); FA << A << endl; } {ifstream FA("A.txt"); FA >> RA ; cout << RA << endl; RA -= A; cout << " RA = 00 == " << RA.linfty << endl; assert( RA.linfty < 1e-12); } // Add april 2018 real[int] AV(A.n*A.m); for [i,j,aij: A ] AV[i+A.n*j]=aij; int i,j,ii,jj; ijmax(A,ii,jj); i = A.imax; j= A.jmax; cout << " max " << i << " " << j << " "<< AV.imax << " " << A.max << endl; assert( i+A.n*j== AV.imax ); assert( ii+A.n*jj == AV.imax ); ijmin(A,i,j); ii = A.imin; jj= A.jmin; cout << " min " << i << " " << j << " "<< AV.imin << " " << A.min<< " == " << AV.min << endl; cout << " minn " << ii << " " << jj << " "<< AV.imin << " " << A.min<< " == " << AV.min << endl; assert( i+A.n*j == AV.imin ); assert( ii+A.n*jj == AV.imin ); } { // sort array : real[int] a=[3,5,7,9,0]; real[int] b(a); int[int] p=[0,1,2,3,4]; b=a; cout << " a =" < " << tt << endl; } { real[int] tt(2:10); // 2,3,4,5,6,7,8,9,10 real[int] t1(2.:3:10.); // 2,5,8, cout << " tt(2:10) = = " << tt << endl; cout << " t1(2.:3:10.)= " << t1 << endl; tt=1.:0.5:3.999; cout << " 1.:0.5:3.999 => " << tt << endl; } { complex[int] tt(2.+0i:10.+0i); // 2,3,4,5,6,7,8,9,10 complex[int] t1(2.:3.:10.); // 2,5,8, cout << " tt(2.+0i:10.+0i)= " << tt << endl; cout << " t1(2.:3.:10.);= " << t1 << endl; cout << " tt.re real part array " << tt.re << endl ; // the real part array of the complex array \index{re}\index{array!re} cout << " tt.im imag part array " << tt.im << endl ; // the imag part array of the complex array \index{im}\index{array!im} } { real [int] tab(10), tab1(10); // 2 array of 10 real //real [int] tab2; // bug array with no size tab = 1.03; // set all the array to 1.03 tab[1]=2.15; cout << tab[1] << " " << tab[9] << " size of tab = " << tab.n << " min: " << tab.min << " max:" << tab.max << " sum : " << tab.sum << endl; // tab.resize(12); // change the size of array tab // to 12 with preserving first value tab(10:11)=3.14; // set unset value cout <<" resize tab: " << tab << endl; real [string] tt; tt["+"]=1.5; cout<> ssA; ssA = (1.)*sA+ (-1.)*ssA; cout << ssA << endl; } } matrix tAA=sA+sA';//'; matrix ttAA=sA'+sA;//'; // matrix tttAA=sA'-sA; // matrix ttAA=sA'-sA; A += 2*a*a'; //'// produit tensoriel matrix A1= A(II^-1,JJ^-1); // do A1(II(i),JJ(j)) = A(i),j) $ matrix A2= A(III,JJJ); // do $A2(i,j) = A(III(i),JJJ(i)) $ matrix sA1= sA(II^-1,JJ^-1); // do A1(II(i),JJ(i)) = A( matrix sA2= sA(III,JJJ); // do A = A matrix A0 = (a*a')(II^-1,JJ^-1); //'); matrix A3 = (a*a')(III,JJJ);//'); cout << " ------------------- " << endl; // cout << " A = " << A << endl; // cout << " A1 = " << A1 < " < 0.01) assert(A1(II[j9],JJ[i9]) == A(j9,i9)); if( abs(A(III(j9),JJJ(i9))) > 0.01) assert(A2(j9,i9) == A(III(j9),JJJ(i9) )) ; // cout << " i9,j9 -> " < 0.01) assert(A0(II[i9],JJ[j9]) == a[i9]*a[j9]); if( abs(a[III[i9]]*a[JJJ[j9]])> 0.01) assert(A3(i9,j9) == a[III[i9]]*a[JJJ[j9]]); } b=A*a; c=-9; cout << "xxxx\n"; matrix sparseA=A; //cout << sparseA << endl; sparseA = 2*sparseA+sparseA; sparseA = 4*sparseA+sparseA*5; // * 27 matrix sparseB=sparseA+sparseA+sparseA-sparseA+2*sparseA; //cout << sparseA << endl; //cout << sparseB << endl; // *81 cout << "sparseB = " << sparseB(0,0) << endl; cout << " trace = " << sparseB.trace << " == " << sparseA.trace*4 << endl; cout << " -------- block matrix \n " << endl; matrix B = [ [sparseA, 0 , sparseA ], [ 0, sparseA , 0 ] , [0, 0, sparseB' ]];//']]; matrix B2 = [ [sparseA], [sparseA]]; assert( B2.n == sparseA.n*2); assert( B2.m == sparseA.m); matrix B1 = [ [sparseA, sparseA] ]; assert( B1.m == sparseA.m*2); // FH. bug before version 2.11-4 (10/01/2007) assert( B1.n == sparseA.n); real[int] x([a,b,c]); // construct the block vector x form a,b,c, // where the size is sum of size of a,b,c, x=[a,b,c]; // set x to to the block vector (the vector x is resize if it necessary cout << " abc =" << a[2] << " " << b[3] << " "<< c[4] << endl; cout << " xxx =" << x[2] << " " << x[3+N] << " "<< x[4+N*2] << endl; x = x*10; [a,b,c]=x; // set the block vector a,b,c from concecutive part of x; cout << " abc*10 == " << a[2] << " " << b[3] << " "<< c[4] << endl; // remark the size of sum of size must be equal to the size of x. //cout << " B = " << B << endl; cout << B(8,29) << " === " << sparseA(8,9) << endl; cout << B(28,27) << " === " << sparseB(7,8) << endl; B(8,29)=100; // change the value an existing coef cout << " B(8,29) " << B(8,29) << endl; cout << " -------- block matrix \n " << endl; } // build FE matrice with differente meshes (here 3) varf vM(u,v)=int1d(Th,qforder=1)(u*v); matrix MM=vM(Vh,VH); //cout << MM << endl; Vh unVh=0,wVh=0; VH unVH=0,wVH=0; unVh[]=1; unVH[]=1; wVh[] = MM' * unVH[] ; //' wVH[] = MM * unVh[] ; //cout << "wWh : " << wVh[] << endl; //cout <<" wVH : " << wVH[] << endl; // array of matrix v2.4-1 cout << " array of matrix \n" ; matrix[int] aM(10); aM[0]= MM; aM[3]= MM; aM[9]= MM; // aM.resize(4); // aM.resize(10); bug on debian ? FH // add version 2.17 --- { real[int] coef([1,2,3,5,6]); int[int] lg( [1,3,6,9,100]); int[int] cl( [1,4,9,0,0]); // a diagonal matrix matrix A=[coef]; cout << " A = " << A << endl; // a raw matrix matrix B=[lg,cl,coef]; cout << " B = " << B << endl; [lg,cl,coef] = A; cout<< " lg : " << lg << endl; cout << " cl : " << cl << endl; cout << " coef = "<< coef << endl; } // version 3.1-1 cout << MM << endl; MM.resize(10,100); cout << MM << endl; { // test renumbering of sub mesh .. func Pk=P2; int[int] n2ok(1); mesh ThC = trunc(Th,x < 0.5,new2old=n2ok); fespace VFh(Th,Pk); fespace VCh(ThC,Pk); verbosity= 100; int[int] n2o=restrict(VCh,VFh,n2ok); cout << " n2o " << n2o << endl; } } freefem++-3.61-1/examples++-tutorial/calculus.edp000644 000767 000024 00000003141 13312446271 021714 0ustar00hechtstaff000000 000000 // Example of number manipulation real x = 3.14, y; int i, j; complex c; cout << "x = " << x << endl; x = 1; y = 2; x = y; i = 0; j = 1; cout << "--- Integer and real numbers ---" << endl; cout << 1 + 3 << " " << 1/3 << "\n"; cout << 10 ^10 << "\n"; cout << 10 ^-10 << "\n"; cout << -10^-2 + 5 << " == 4.99\n"; cout << 10^-2 + 5 << " == 5.01\n"; cout << "--- Complex numbers ---" << endl; cout << 10 - 10i << endl; cout.scientific << "--- Scientific notation ---\n"; int prec = cout.precision(12); cout << "-1^(1/3) = " << (-1+0i)^(1./3.) << " (precision=12)\n"; cout.precision(prec); cout.fixed; cout.showpos << "--- Fixed and showpos ---\n"; cout << "-1^(1/3) = " << (-1+0i)^(1./3.) << " (precision=" << prec << ")\n"; cout.noshowpos << "--- noshowpos ---\n"; cout << "8^(1/3)= " << (8)^(1./3.) << endl; cout << "sqrt(-1) = " << sqrt(-1+0i) << endl; complex a = 10 + 1i; cout.default << "--- Default ---\n"; cout << a << endl; cout << "real(a) = " << real(a) << ", conj(a) = " << conj(a) << ", arg(a) = " << arg(a) << endl; cout << "++i =" << ++i ; cout << "i = " << i << endl; cout << "i++ = "<< i++ << endl; cout << "i = " << i << endl; cout << "--- String concatenation ---" << endl; string str, str1; str = "abc+"; str1 = "+abcddddd+"; str = str + str1; str = str + 2 ; cout << "str = " << str << " == abc++abcddddd+2;\n"; { real x=0; for (int i = 0; i < 10; i++) x += i*i; cout << "x= " << x << endl; // example of if arithmetic expression real a = x == 0 ? x : -1; real b = x != 0 ? x : -1; cout << "a = " << a << ", b = " << b << endl; string ss = "\z\a\b\f\\--\\"; cout << "\"" << ss << "\"" << endl; } freefem++-3.61-1/examples++-tutorial/regtests.m4000644 000767 000024 00000004017 13256636774 021534 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ include(../regtests.m4) // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. dnl (syntax of ONETEST macro defined in ../regtests.m4) ONETEST(adapt,u[].max-u[].min,0.01) ONETEST(adaptindicatorP1,u[].max-u[].min,0.01) ONETEST(adaptindicatorP2,u[].max-u[].min,0.01) ONETEST(algo,umax,0.01) ONETEST(array) ONETEST(a_tutorial,1+max(err[].max,-err[].min),0.001) ONETEST(beam,uu[]'*uu[],5e-2) dnl this exemple was wrong it replace by the correct one in chap3 dnl ONETEST(BlackSchole,normvL2,0.1) ONETEST(calculus) ONETEST(cavity,psi[]'*psi[],1e-2) ONETEST(convect2,v[]'*v[],1e-1) ONETEST(convect-apt,error,5e-1) ONETEST(convect,v[]'*v[],1e-1) ONETEST(dumptable) ONETEST(ex-vf) ONETEST(FE,wdc[]'*wdc[],1e-2) ONETEST(fluidStructAdapt,uu[]'*uu[],2e-1) ONETEST(fluidStruct,uu[]'*uu[],2e-1) dnl This test always crashes under Mingw dnl ("Error move mesh triangles was reverse") dnl ONETEST(freeboundary,u[]'*u[],5e-2) dnl ONETEST(freeboundary-weak,p[]'*p[],5e-2) ONETEST(LapDG2,u[]'*u[],1e-2) ONETEST(Laplace,uh[]'*uh[],1e-2) ONETEST(LaplaceP1bis,u[]'*u[],1e-2) ONETEST(LaplaceP1,uh[]'*uh[],1e-2) ONETEST(LaplaceP1P2h,u2h[]'*u2h[],1e-2) ONETEST(LaplaceRT,u1[]'*u1[],1e-2) ONETEST(mesh) ONETEST(movemesh,u[]'*u[],1e-2) ONETEST(nolinear-elas,(1+errb),1e-3) ONETEST(NSUzawaCahouetChabart,u1[].linfty,1e-2) ONETEST(onde,u[]'*u[],1e-2) dnl The following two tests have suspicious results (1e20 and bigger) dnl ONETEST(periodic4,uh[]'*uh[],1e-2) dnl ONETEST(Periodic,uh[]'*uh[],1e-2) ONETEST(plot,uh[]'*uh[],1e-2) ONETEST(readmesh,u[]'*u[],2e-1) ONETEST(region,u[]'*u[],1e-1) ONETEST(saverestore) ONETEST(schwarz-gc,u1[]'*u1[],5e-2) ONETEST(schwarz-no-overlap,u[]'*u[],5e-2) ONETEST(schwarz-overlap,u[]'*u[],5e-2) ONETEST(sparse-matrix,regtest,5e-2) ONETEST(sparse-cmatrix,real(regtest),5e-2) ONETEST(StokesUzawa,u1[]'*u1[],5e-2) ONETEST(tablefunction,fxy[]'*fxy[],1e-2) freefem++-3.61-1/examples++-tutorial/mat_interpol.edp000644 000767 000024 00000003524 13256636774 022623 0ustar00hechtstaff000000 000000 mesh Th=square(4,4); mesh Th4=square(2,2,[x*0.5,y*0.5]); plot(Th,Th4,ps="ThTh4.eps",wait=1); fespace Vh(Th,P1); fespace Vh4(Th4,P1); fespace Wh(Th,P0); fespace Wh4(Th4,P0); // remark in previous version (before v1.44) // the name of interpolate function is interplotematrix matrix IV= interpolate(Vh,Vh4); // here the function is // exended by continuity cout << " IV Vh<-Vh4 " << IV << endl; Vh v; Vh4 v4=x*y; v=v4; real[int] vv= IV*v4[]; // here v[] == vv => real[int] diff= vv - v[]; cout << " || v - vv || = " << diff.linfty << endl; assert( diff.linfty<= 1e-6); // matrix IV0= interpolate(Vh,Vh4,inside=0);// here the function is // exended by zero cout << " IV Vh<-Vh4 (inside=1) " << IV0 << endl; matrix IVt0= interpolate(Vh,Vh4,inside=1,t=1); cout << " IV Vh<-Vh4^t (inside=1) " << IVt0 << endl; matrix IV4t0= interpolate(Vh4,Vh); cout << " IV Vh4<-Vh^t " << IV4t0 << endl; matrix IW4= interpolate(Wh4,Wh); cout << " IV Wh4<-Wh " << IW4 << endl; matrix IW4V= interpolate(Wh4,Vh); cout << " IV Wh4<-Vh " << IW4 << endl; fespace V4h(Th4,[P1,P1,P1,P1]); fespace V3h(Th,[P1,P1,P1]); int[int] u2vc=[1,3,-1];// -1 => put zero on the componante ; matrix IV34= interpolate(V3h,V4h,inside=0,U2Vc=u2vc);// here the function is V4h [a1,a2,a3,a4]=[1,2,3,4]; V3h [b1,b2,b3]=[10,20,30]; b1[]=IV34*a1[]; cout << "b1 = " << b1(.25,.25) << " == " << 2 << endl; cout << "b2 = " << b2(.25,.25) << " == " << 4 <> xx >>yy >> fxy[][i]; } plot(fxy,wait=1,ps="xyf.ps"); // new way to bluid a mesh version 2.23-2 Vhxy xx=x,yy=y; mesh Th=triangulate(xx[],yy[]); cout << " region = " << triangulate(xx[],yy[])[1].region <1e-6) { j++; Pp; if (weak) { wdpdn[] = A*p[]; wdpdn[] = wdpdn[].*onfree[]; wdpdn[] = -wdpdn[]; Pw;} else Pv; errv=int1d(Th,f)(v*v); plot(Th,p,v ,cmm=com+" iter = "+j+ " errv =" +errv,wait=0); // if (j%10==0) // Th=adaptmesh(Th,p,err=erradap ) ; real coef=1; real mintcc = checkmovemesh(Th,[x,y])/5.; real mint = checkmovemesh(Th,[x,y-v*coef]); if (mintmintcc) break; cout << " min |T] " << mint << endl; coef /= 1.5; } Th=movemesh(Th,[x,y-coef*v]); // calcul de la deformation A= vPp(Vh,Vh,solver=CG); onfree[]=vonfree(0,Vh);onfree[]/=onfree[].max; // sauce cout << "\n\n"< v=x,diff; Vh w=x+1i*y; cout << "w[][10] " << " " << w[][10] << endl; w=y+1i*y; cout << "w[][10] " << w[][10] << " " << (w[][10])' << endl; Wh [wx,wy]=[x+1i*y,y]; [wx,wy]=[x+1i*y,y]; func ue= (x*x+2.*y*y+(x*y*y+3.*x*x*y)*1i); func uexx = 2.+6.i*y; func ueyy = 4.+2.i*x; func f= (-uexx-(2i+1)*ueyy); func g= ue; Vh uh,vh; problem laplace(uh,vh,solver=LU,tgv=1e5) = // definion of the problem int2d(Th,optimize=1)( dx(uh)*dx(vh) + (2i+1)*dy(uh)*dy(vh) ) // bilinear form - int2d(Th,optimize=1)( f*vh ) // linear form + on(1,2,3,4,uh=g) ; // boundary condition form //verbosity=102; laplace; // solve the problem plot(uh); // to see the result real err = int2d(Th)(norm(uh-ue)); cout << " -- err = " << err << endl; assert(err<0.01); // cout << " -- uh = " << uh[] << endl; cout << " uh(0.5,0.5) = " << uh(0.5,0.5) << " ~ " << ue(0.5,0.5) << endl; Vh vr=real(uh(x,y)); Vh vi=imag(uh(x,y)); vr = real(uh); vi = imag(uh); Vh ver = real(ue); Vh vei = imag(ue); // for (int i=0;i0 ) // the movemesh will be ok Th=movemesh(Th,[x,y+f]); cout << " Min area " << minarea << endl; // u=(Vh,u[]); // the new syntaxe FH Vh tmp; // =u[], sorry no init of FEspace function with array. tmp[]=u[]; //save the value u=0; // to change the FEspace and mesh associated to u u[]=tmp[]; // set le value of the array without no mesh update plot(Th,u,wait=1); }; // remark, in this programme we have no solution with link to a previous mesh // so all the previoux are delete in memory // -------- freefem++-3.61-1/examples++-tutorial/Makefile.in000644 000767 000024 00000134053 13321623167 021464 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-tutorial ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = forall.edp adapt.edp adaptindicatorP1.edp adaptindicatorP2.edp algo.edp array.edp a_tutorial.edp beam.edp calculus.edp cavity.edp convect2.edp convect-apt.edp convect.edp dumptable.edp ex-vf.edp FE.edp fluidStructAdapt.edp fluidStruct.edp freeboundary.edp freeboundary-weak.edp LapDG2.edp Laplace.edp LaplaceP1bis.edp LaplaceP1.edp LaplaceP1P2h.edp LaplaceRT.edp mesh.edp movemesh.edp nolinear-elas.edp NSUzawaCahouetChabart.edp onde.edp periodic4.edp Periodic.edp plot.edp readmesh.edp region.edp saverestore.edp schwarz-gc.edp schwarz-no-overlap.edp schwarz-overlap.edp sparse-matrix.edp sparse-cmatrix.edp StokesUzawa.edp tablefunction.edp intlevelset.edp mesh-internal.edp minlenedge.edp LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw LIST_IDP = *.idp EXTRA_DIST = *.edp *.idp aile.msh xyf all.edp regtests.edp regtests.m4 ref.edp all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-tutorial/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-tutorial/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? forall.edp.log: forall.edp @p='forall.edp'; \ b='forall.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) adapt.edp.log: adapt.edp @p='adapt.edp'; \ b='adapt.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) adaptindicatorP1.edp.log: adaptindicatorP1.edp @p='adaptindicatorP1.edp'; \ b='adaptindicatorP1.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) adaptindicatorP2.edp.log: adaptindicatorP2.edp @p='adaptindicatorP2.edp'; \ b='adaptindicatorP2.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) algo.edp.log: algo.edp @p='algo.edp'; \ b='algo.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) array.edp.log: array.edp @p='array.edp'; \ b='array.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) a_tutorial.edp.log: a_tutorial.edp @p='a_tutorial.edp'; \ b='a_tutorial.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) beam.edp.log: beam.edp @p='beam.edp'; \ b='beam.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) calculus.edp.log: calculus.edp @p='calculus.edp'; \ b='calculus.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) cavity.edp.log: cavity.edp @p='cavity.edp'; \ b='cavity.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) convect2.edp.log: convect2.edp @p='convect2.edp'; \ b='convect2.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) convect-apt.edp.log: convect-apt.edp @p='convect-apt.edp'; \ b='convect-apt.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) convect.edp.log: convect.edp @p='convect.edp'; \ b='convect.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) dumptable.edp.log: dumptable.edp @p='dumptable.edp'; \ b='dumptable.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) ex-vf.edp.log: ex-vf.edp @p='ex-vf.edp'; \ b='ex-vf.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) FE.edp.log: FE.edp @p='FE.edp'; \ b='FE.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) fluidStructAdapt.edp.log: fluidStructAdapt.edp @p='fluidStructAdapt.edp'; \ b='fluidStructAdapt.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) fluidStruct.edp.log: fluidStruct.edp @p='fluidStruct.edp'; \ b='fluidStruct.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) freeboundary.edp.log: freeboundary.edp @p='freeboundary.edp'; \ b='freeboundary.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) freeboundary-weak.edp.log: freeboundary-weak.edp @p='freeboundary-weak.edp'; \ b='freeboundary-weak.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) LapDG2.edp.log: LapDG2.edp @p='LapDG2.edp'; \ b='LapDG2.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) Laplace.edp.log: Laplace.edp @p='Laplace.edp'; \ b='Laplace.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) LaplaceP1bis.edp.log: LaplaceP1bis.edp @p='LaplaceP1bis.edp'; \ b='LaplaceP1bis.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) LaplaceP1.edp.log: LaplaceP1.edp @p='LaplaceP1.edp'; \ b='LaplaceP1.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) LaplaceP1P2h.edp.log: LaplaceP1P2h.edp @p='LaplaceP1P2h.edp'; \ b='LaplaceP1P2h.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) LaplaceRT.edp.log: LaplaceRT.edp @p='LaplaceRT.edp'; \ b='LaplaceRT.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) mesh.edp.log: mesh.edp @p='mesh.edp'; \ b='mesh.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) movemesh.edp.log: movemesh.edp @p='movemesh.edp'; \ b='movemesh.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) nolinear-elas.edp.log: nolinear-elas.edp @p='nolinear-elas.edp'; \ b='nolinear-elas.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) NSUzawaCahouetChabart.edp.log: NSUzawaCahouetChabart.edp @p='NSUzawaCahouetChabart.edp'; \ b='NSUzawaCahouetChabart.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) onde.edp.log: onde.edp @p='onde.edp'; \ b='onde.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) periodic4.edp.log: periodic4.edp @p='periodic4.edp'; \ b='periodic4.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) Periodic.edp.log: Periodic.edp @p='Periodic.edp'; \ b='Periodic.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) plot.edp.log: plot.edp @p='plot.edp'; \ b='plot.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) readmesh.edp.log: readmesh.edp @p='readmesh.edp'; \ b='readmesh.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) region.edp.log: region.edp @p='region.edp'; \ b='region.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) saverestore.edp.log: saverestore.edp @p='saverestore.edp'; \ b='saverestore.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) schwarz-gc.edp.log: schwarz-gc.edp @p='schwarz-gc.edp'; \ b='schwarz-gc.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) schwarz-no-overlap.edp.log: schwarz-no-overlap.edp @p='schwarz-no-overlap.edp'; \ b='schwarz-no-overlap.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) schwarz-overlap.edp.log: schwarz-overlap.edp @p='schwarz-overlap.edp'; \ b='schwarz-overlap.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) sparse-matrix.edp.log: sparse-matrix.edp @p='sparse-matrix.edp'; \ b='sparse-matrix.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) sparse-cmatrix.edp.log: sparse-cmatrix.edp @p='sparse-cmatrix.edp'; \ b='sparse-cmatrix.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) StokesUzawa.edp.log: StokesUzawa.edp @p='StokesUzawa.edp'; \ b='StokesUzawa.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) tablefunction.edp.log: tablefunction.edp @p='tablefunction.edp'; \ b='tablefunction.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) intlevelset.edp.log: intlevelset.edp @p='intlevelset.edp'; \ b='intlevelset.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) mesh-internal.edp.log: mesh-internal.edp @p='mesh-internal.edp'; \ b='mesh-internal.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) minlenedge.edp.log: minlenedge.edp @p='minlenedge.edp'; \ b='minlenedge.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic clean-local cscopelist-am ctags-am distclean \ distclean-generic 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-exec-local \ 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 pdf pdf-am ps ps-am recheck \ tags-am uninstall uninstall-am .PRECIOUS: Makefile all-local: all.edp regtests.edp freefem++.pref all.edp: (echo "NoUseOfWait=true;int verbosityy=verbosity;"; \ for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ done) > $@ clean-local: -rm *.fg *.eps *~ *.ps *.mesh *.mesh.gmsh f.txt u.txt A.matrix mm.matrix mm.b sphere-a.faces sphere-a.points sphere.faces sphere.points toto.Th toto.am_fmt toto.dbg.gmsh toto.Th.gmsh toto.dbg toto.msh plot.gp ListOfAllocPtr-8.bin ffglut*.ppm th.msh Th1.msh Th12.msh th.msh emptymesh-2.msh thermic.dat # To create a new set of reference values in "ref.edp" Ref: makeref.edp freefem++.pref ../src/nw/FreeFem++-nw makeref.edp install-exec-local:: $(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp $(INSTALL) -m 555 $(LIST_IDP) $(DESTDIR)$(ff_prefix_dir)/idp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: # 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: freefem++-3.61-1/examples++-tutorial/LaplaceP1bis.edp000644 000767 000024 00000002223 13256636774 022361 0ustar00hechtstaff000000 000000 mesh Th=square(10,10); fespace Vh(Th,P1); // P1 FE space Vh uh,vh,u; // unkown and test function. func f=1; // right hand side function func g=0.; // boundary condition function problem laplace(uh,vh,solver=GMRES,tgv=1e5) = // definion of the problem - int2d(Th)( -dx(uh)*dx(vh) - dy(uh)*dy(vh) ) // bilinear form - int1d(Th,1)( -uh*vh) - int1d(Th,1)( vh) - int2d(Th)( f*vh ) // linear form + on(2,3,4,uh=g) ; // boundary condition form problem laplacep(uh,vh,solver=CG,tgv=1e5) = // definion of the problem int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form + int1d(Th,1)( uh*vh) + int1d(Th,1)( - vh) + int2d(Th)( -f*vh ) // linear form + on(2,3,4,uh=g) ; // boundary condition form laplace; // solve the problem plot(uh); // to see the result u=uh; laplacep; // solve the problem plot(uh); // to see the result plot(uh,u,value=true); u[] -= uh[]; cout << "Diff min = "<< u[].min << " max=" << u[].max << endl ; freefem++-3.61-1/examples++-tutorial/shur-comp.edp000644 000767 000024 00000007657 13256636774 022056 0ustar00hechtstaff000000 000000 // Schwarz without overlapping (Shur complement Neumann -> Dirichet) // with matrix --- // ------------ verbosity=2; real cpu=clock(); macro laplacien(u,v) (dx(u)*dx(v)+dy(u)*dy(u)) // // --- beging meshes building -------------- int nbsd=4; int labext= nbsd+1; real[int] theta(nbsd+1),cost(nbsd),sint(nbsd); for (int i=0;i Xh1 matrix I2=interpolate(Xh2,Mhe); // build interpolation matrix Mhe -> Xh2 matrix I3=interpolate(Xh3,Mhe); // build interpolation matrix Mhe -> Xh2 matrix I4=interpolate(Xh4,Mhe); // build interpolation matrix Mhe -> Xh3 int nm = Mhe.ndof; real [int] l1(nm),l2(nm),l3(nm),l4(nm); func f = (x+1)*(y-2); varf vgamma(u,v) = on(1,2,3,4,u=1); Mhe gamma; gamma[] = vgamma(0,Mhe,tgv=1); plot(gamma,wait=1,cmm="gamma",value=1); varf vM(u,v) = int1d(The)( u*v) ; matrix M = vM(Mhe,Mhe,solver=UMFPACK) ; // debut macro par ssd macro Pb(A,B,a,P,Th,u1,v1,Xh) cout << " -- PB -- " << endl; varf a(u1,v1) = int2d(Th)( dx(u1)*dx(v1)+dy(u1)*dy(v1) ) - int2d(Th)( f*v1) ; problem P(u1,v1,init=i,solver=Cholesky) = int2d(Th)( dx(u1)*dx(v1)+dy(u1)*dy(v1) ) - int2d(Th)( f*v1) + on(labext,u1= 0 ) + on(1,2,3,4,u1=lambda) ; matrix A = a(Xh,Xh,solver=GMRES) ; real[int] B(Xh.ndof); B=a(0,Xh); // Fin macro ssd ------- Pb(A1,b1,va1,Pb1,aTh[0],u1,v1,Xh1); Pb(A2,b2,va2,Pb2,aTh[1],u2,v2,Xh2); Pb(A3,b3,va3,Pb3,aTh[2],u3,v3,Xh3); Pb(A4,b4,va4,Pb4,aTh[3],u4,v4,Xh4); func real[int] BoundaryProblem(real[int] &l) { int vv = verbosity; verbosity=0; lambda[]=l; Pb1; dnu1[]= A1*u1[];dnu1[]+=b1; l1= I1'*dnu1[]; Pb2; dnu2[]= A2*u2[];dnu2[]+=b2; l2= I2'*dnu2[]; Pb3; dnu3[]= A3*u3[];dnu3[]+=b3; l3= I3'*dnu3[]; Pb4; dnu4[]= A4*u4[];dnu4[]+=b4; l4= I4'*dnu4[]; l1 += l2; l1 += l3; l1 += l4; l1 = l1.* intern[]; cout << " residu = " << l1.max << " " << l1.min << endl; lambda[]=M*l1; plot(lambda,wait=1,cmm="lamdba"); lambda[]=lambda[].* intern[]; i++; verbosity=vv; return lambda[] ; }; lambda=0; Mhe p=0; verbosity=100; LinearCG(BoundaryProblem,p[],eps=1.e-6,nbiter=100); BoundaryProblem(p[]); plot(u1,u2,u3,u4,wait=1,cmm="u1,u2,u3,u4"); freefem++-3.61-1/examples++-tutorial/cavity.edp000644 000767 000024 00000002740 13312446271 021404 0ustar00hechtstaff000000 000000 // Parameters real nu = 1./100.; real dt = 0.1; // Mesh mesh Th = square(8, 8); // Fespace fespace Xh(Th, P2); Xh u1, v1; Xh u2, v2; Xh up1, up2; Xh psi, phi; fespace Mh(Th, P1); Mh p, q; // Problem Stokes (with solve) real epsr = 1e-8; solve Stokes ([u1, u2, p], [v1, v2, q]) = int2d(Th)( ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) - p*q*epsr + p*dx(v1) + p*dy(v2) + dx(u1)*q + dy(u2)*q ) + on(3, u1=1, u2=0) + on(1, 2, 4, u1=0, u2=0) ; // Plot plot(coef=0.2, cmm="[u1, u2] and p", p, [u1, u2], ArrowSize=0.5, wait=1); // Problem stream-lines (with solve) solve streamlines (psi, phi) = int2d(Th)( dx(psi)*dx(phi) + dy(psi)*dy(phi) ) + int2d(Th)( - phi*(dy(u1) - dx(u2)) ) + on(1, 2, 3, 4, psi=0); // Plot plot(psi, wait=1); // Problem Navier-Stokes int i = 0; real alpha = 1/dt; problem NS ([u1, u2, p], [v1, v2, q], init=i) = int2d(Th)( alpha*(u1*v1 + u2*v2) + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) - p * q * epsr + p*dx(v1) + p*dy(v2) + dx(u1)*q + dy(u2)*q ) + int2d(Th)( - alpha*convect([up1, up2], -dt, up1)*v1 - alpha*convect([up1, up2], -dt, up2)*v2 ) + on(3, u1=1, u2=0) + on(1, 2, 4, u1=0, u2=0) ; for (i = 0; i <= 20; i++) { // Update up1 = u1; up2 = u2; // Solve NS; // Plot if (!(i % 10)) plot(coef=0.2, cmm="[u1, u2] and p", p, [u1, u2]); } plot(coef=0.2, cmm="[u1, u2] and p", p, [u1, u2]); // Re-calculate stream-lines streamlines; plot(psi, wait=1); freefem++-3.61-1/examples++-tutorial/convect-apt.edp000644 000767 000024 00000004603 13312446271 022330 0ustar00hechtstaff000000 000000 // This is the rotating hill problem with one turn // First 1/2 turn is a convection equation and second 1/2 a convection diffusion // Parameters int kt = 6; int kloop = 5; int nbadap = 5; bool inq = 0; real tol = 0.05; real tol2 = 1e-4; real dt = 0.17, t = 0; // time step int i; // Mesh border a(t=0, 2*pi){x=cos(t); y=sin(t);} // the unit circle mesh th = buildmesh(a(70)); // triangulates the disk // Fespace fespace Vh(th, P1); Vh u1 = y, u2 = -x; // rotation velocity Vh m11 = 0, m22 = 0, m12 = 0; // to store the metric field Vh vT; // to save the initial in big loop Vh vv, vo, vp; // working Finite element function Vh v; // Functions func rhill = sqrt((x-0.3)^2 + (y-0.3)^2); func hill = 1 - tanh(30*(rhill - 0.2)); // Initialization v = hill; vp = 0; plot(v); // Mesh adaptation loop for (int i = 0; i < nbadap; i++) { th = adaptmesh(th, v, err=tol, inquire=inq); v = hill; real errl2 = sqrt(int2d(th)(square(vp-v))); vp = vp - v; cout << "adaptation iteration =" << i << ", l2 error = " << errl2 << ", diff min = " << vp[].min << ", max = " << vp[].max << endl << " --------------- " << endl; vp = v; if (errl2 < tol2) break; } // Plot plot(th, wait=1); // Initialization vT[] = v[]; // Solve loop real error = 0; for (i = 0; i < 20/kt; i++) { real T = t; vp = 0; for (int k = 0; k < kloop; k++) { t = T; // restart v = vT; // interpolation m11 = 0; m22 = 0; m12 = 0; // reset metric adaptmesh(th, v, err=tol, metric=[m11[], m12[], m22[]], nomeshgeneration= true ); // warning change the order in version 1.28 cout << "m11 = " << m11[].min << " " << m11[].max << endl; cout << "m22 = " << m22[].min << " " << m22[].max << endl; cout << "m12 = " << m12[].min << " " << m12[].max << endl; for (int j = 0; j < kt; j++) { t = t+dt; vo[] = v[]; v = convect([u1, u2], -dt, vo); // convect v by u1,u2, dt seconds, results in f plot(v, cmm="convection: t=" + t + ", min=" + v[].min + ", max=" + v[].max, wait=1, dim=3); adaptmesh(th, v, err=tol, metric=[m11[], m12[], m22[]], nomeshgeneration= true); } th = adaptmesh(th, v, err=tol, metric=[m11[], m12[], m22[]]); vo = 0; plot(th, wait=1, cmm="k=" + k + ", t= " + t + " ,i= " + i); real errl2 = sqrt(int2d(th)(square(vp - v))); cout << "iteration " << k << ", err l2 = " << errl2 << " --------------- " << endl; vp = v; error = errl2; if (errl2 < tol2) break; } vT = v; }; // Plot plot(th, v, wait=1); freefem++-3.61-1/examples++-tutorial/region.edp000644 000767 000024 00000002110 13256636774 021377 0ustar00hechtstaff000000 000000 // example using region keywork // construct a mesh with 4 regions (sub-domains) border a(t=0,1){x=t;y=0;}; border b(t=0,0.5){x=1;y=t;}; border c(t=0,0.5){x=1-t;y=0.5;}; border d(t=0.5,1){x=0.5;y=t;}; border e(t=0.5,1){x=1-t;y=1;}; border f(t=0,1){x=0;y=1-t;}; // internal boundary border i1(t=0,0.5){x=t;y=1-t;}; border i2(t=0,0.5){x=t;y=t;}; border i3(t=0,0.5){x=1-t;y=t;}; mesh th = buildmesh (a(6) + b(4) + c(4) +d(4) + e(4) + f(6)+i1(6)+i2(6)+i3(6)); fespace Ph(th,P0); fespace Vh(th,P1); Ph reg=region; plot(reg,fill=1,wait=1,value=1,ps="region.eps"); int nupper=reg(0.4,0.9); int nlower=reg(0.9,0.1); cout << " nlower " << nlower << ", nupper = " << nupper<< endl; // defined the characteristics fonctions of upper and lower region Ph nu=1+5*(region==nlower) + 10*(region==nupper); if ( nu[].sum < 1) { cout << " Bug in region.edp (bad version try new one)"<< endl; exit(1);} plot(nu,fill=1,wait=1,value=1,ps="region_nu.eps"); Vh u,v; solve lap(u,v) = int2d(th)( nu*(dx(u)*dx(v) +dy(u)*dy(v))) + int2d(th)(-1*v) + on(a,b,c,d,e,f,u=0); plot(u,value=1,ps="region_u.eps"); freefem++-3.61-1/examples++-tutorial/schwarz-no-overlap.edp000644 000767 000024 00000002135 13310146313 023634 0ustar00hechtstaff000000 000000 // schwarz1 without overlapping int inside = 2; int outside = 1; border a(t=1,2){x=t;y=0;label=outside;}; border b(t=0,1){x=2;y=t;label=outside;}; border c(t=2,0){x=t ;y=1;label=outside;}; border d(t=1,0){x = 1-t; y = t;label=inside;}; border e(t=0, 1){ x= 1-t; y = t;label=inside;}; border e1(t=pi/2, 2*pi){ x= cos(t); y = sin(t);label=outside;}; int n=4; mesh th = buildmesh( a(5*n) + b(5*n) + c(10*n) + d(5*n)); mesh TH = buildmesh ( e(6*n) + e1(25*n) ); plot(th,TH,wait=1,ps="schwarz-no-th.eps"); fespace vh(th,P1); fespace VH(TH,P1); vh u=0,v; VH U,V; vh lambda=0; int i=0; problem PB(U,V,init=i,solver=Cholesky) = int2d(TH)( dx(U)*dx(V)+dy(U)*dy(V) ) + int2d(TH)( -V) + int1d(TH,inside)(lambda*V) + on(outside,U= 0 ) ; problem pb(u,v,init=i,solver=Cholesky) = int2d(th)( dx(u)*dx(v)+dy(u)*dy(v) ) + int2d(th)( -v) + int1d(th,inside)(-lambda*v) + on(outside,u = 0 ) ; for ( i=0 ;i< 20; i++) { PB; pb; lambda = lambda - (u-U)/2; // if (i==0) // FFCS: add 3d view plot(U,u,wait=true,ps="schwarz-no-u"+i+".eps",dim=3,fill=1); }; plot(U,u,ps="schwarz-no-u.eps"); freefem++-3.61-1/examples++-tutorial/saverestore.edp000644 000767 000024 00000001321 13256636774 022461 0ustar00hechtstaff000000 000000 // bug save - restore P2 verbosity=3; int nn=2; mesh Th=square(nn,nn); savemesh(Th,"Th.msh"); func f=x+y+0.1234567890e-5; fespace Vh(Th,P2); Vh u=f; {ofstream f("u.txt"); f.precision; cout << " f.precision() = " << f.precision() << endl; f.precision(12); cout << " f.precision() = " << f.precision() << endl; f <> v[] ; e[] = u[] -v[]; cout << e[].max << " " << e[].min << endl; plot(e,wait=1,value=1); assert(e[].max-e[].min < 1e-6); regtest=e[].max-e[].min; } freefem++-3.61-1/examples++-tutorial/testplot.edp000644 000767 000024 00000001202 13256636774 021773 0ustar00hechtstaff000000 000000 int nn =10;// 10 coubre real[int][int] xx(nn); real[int][int] yy(nn); real[int][int] zz(nn); real[int][int] vv(nn); mesh Th=square(1,1); fespace Vh(Th,P1); Vh u=1; for(int i=0; i absolue stop test \index{precon=} LinearCG(divup,p[],eps=-1.e-6,nbiter=50,precon=CahouetChabart); divup(p[]); // computed the velocity plot([u1,u2],p,wait=!(idt%10),value= 1,coef=0.1); } */freefem++-3.61-1/examples++-chapt3/heatex.edp000644 000767 000024 00000001545 13256636774 020724 0ustar00hechtstaff000000 000000 // file heatex.edp int C1=99, C2=98; // could be anything border C0(t=0,2*pi){x=5*cos(t); y=5*sin(t);} border C11(t=0,1){ x=1+t; y=3; label=C1;} border C12(t=0,1){ x=2; y=3-6*t; label=C1;} border C13(t=0,1){ x=2-t; y=-3; label=C1;} border C14(t=0,1){ x=1; y=-3+6*t; label=C1;} border C21(t=0,1){ x=-2+t; y=3; label=C2;} border C22(t=0,1){ x=-1; y=3-6*t; label=C2;} border C23(t=0,1){ x=-1-t; y=-3; label=C2;} border C24(t=0,1){ x=-2; y=-3+6*t; label=C2;} mesh Th=buildmesh( C0(50) + C11(5)+C12(20)+C13(5)+C14(20) + C21(-5)+C22(-20)+C23(-5)+C24(-20)); plot(Th,wait=1,ps="heatexTh.ps"); fespace Vh(Th,P1); Vh u,v; Vh kappa=1+4*(x<-1)*(x>-2)*(y<3)*(y>-3); solve a(u,v)= int2d(Th)(kappa*(dx(u)*dx(v)+dy(u)*dy(v))) +on(C0,u=20)+on(C1,u=100); plot(u,value=true,wait=1,fill=true); freefem++-3.61-1/examples++-chapt3/convects.edp000644 000767 000024 00000003235 13256636774 021270 0ustar00hechtstaff000000 000000 // file convects.edp // Characteristics Galerkin border C(t=0, 2*pi) { x=cos(t); y=sin(t); }; mesh Th = buildmesh(C(100)); fespace Uh(Th,P1); Uh cold, c = exp(-10*((x-0.3)^2 +(y-0.3)^2)); real dt = 0.17,t=0; Uh u1 = y, u2 = -x; for (int m=0; m<2*pi/dt ; m++) { t += dt; cold=c; c=convect([u1,u2],-dt,cold); plot(c,cmm=" t="+t + ", min=" + c[].min + ", max=" + c[].max); } // Now with Discontinuous Galerkin fespace Vh(Th,P1dc); Vh w, ccold, v1 = y, v2 = -x, cc = exp(-10*((x-0.3)^2 +(y-0.3)^2)); real u, al=0.5; dt = 0.05; macro n()(N.x*v1+N.y*v2) // problem Adual(cc,w) = int2d(Th)((cc/dt+(v1*dx(cc)+v2*dy(cc)))*w) + intalledges(Th)((1-nTonEdge)*w*(al*abs(n)-n/2)*jump(cc)) // - int1d(Th,C)((n(u)<0)*abs(n(u))*cc*w) // unused because cc=0 on d(Omega)^- - int2d(Th)(ccold*w/dt); for ( t=0; t< 2*pi ; t+=dt) { ccold=cc; Adual; plot(cc,fill=1,cmm="t="+t + ", min=" + cc[].min + ", max=" + cc[].max); }; real [int] viso=[-0.1,0,0.5,0.1,0.5,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.9,1]; plot(c,wait=1,fill=1,value=1,ps="convectCG.eps",viso=viso); plot(cc,wait=1,fill=1,value=1,ps="convectDG.eps",viso=viso); // the same DG very much faster varf aadual(cc,w) = int2d(Th)((cc/dt+(v1*dx(cc)+v2*dy(cc)))*w) + intalledges(Th)((1-nTonEdge)*w*(al*abs(n)-n/2)*jump(cc)); varf bbdual(ccold,w) = - int2d(Th)(ccold*w/dt); matrix AA= aadual(Vh,Vh); matrix BB = bbdual(Vh,Vh); set (AA,init=t,solver=UMFPACK); Vh rhs=0; for ( t=0; t< 2*pi ; t+=dt) { ccold=cc; rhs[] = BB* ccold[]; cc[] = AA^-1*rhs[]; plot(cc,fill=0,cmm="t="+t + ", min=" + cc[].min + ", max=" + cc[].max); }; plot(cc,wait=1,fill=1,value=1,ps="convectDG.eps",viso=viso); freefem++-3.61-1/examples++-chapt3/optimcontrol.edp000644 000767 000024 00000002610 13256636774 022171 0ustar00hechtstaff000000 000000 // file optimcontrol.edp border aa(t=0, 2*pi) { x = 5*cos(t); y = 5*sin(t); }; border bb(t=0, 2*pi) { x = cos(t); y = sin(t); }; border cc(t=0, 2*pi) { x = -3+cos(t); y = sin(t); }; border dd(t=0, 2*pi) { x = cos(t); y = -3+sin(t); }; mesh th = buildmesh(aa(70)+bb(35)+cc(35)+dd(35)); fespace Vh(th,P1); Vh Ib=((x^2+y^2)<1.0001), Ic=(((x+3)^2+ y^2)<1.0001), Id=((x^2+(y+3)^2)<1.0001), Ie=(((x-1)^2+ y^2)<=4), ud,u,uh,du; real[int] z(3); problem A(u,uh) =int2d(th)((1+z[0]*Ib+z[1]*Ic+z[2]*Id)*(dx(u)*dx(uh) +dy(u)*dy(uh))) + on(aa,u=x^3-y^3); z[0]=2; z[1]=3; z[2]=4; A; ud=u; ofstream f("J.txt"); func real J(real[int] & Z) { for (int i=0;i v,w; solve muwave(v,w) = int2d(Th)(v*w*(1+R) -(dx(v)*dx(w)+dy(v)*dy(w))*(1-0.5i)) + on(1,v=0) + on(2, v=sin(pi*(y-c)/(c-d))); Vh vr=real(v), vi=imag(v); plot(vr,wait=1,ps="rmuonde.ps", fill=true); plot(vi,wait=1,ps="imuonde.ps", fill=true); fespace Uh(Th,P1); Uh u,uu, ff=1e5*(vr^2 + vi^2)*R; solve temperature(u,uu)= int2d(Th)(dx(u)* dx(uu)+ dy(u)* dy(uu)) - int2d(Th)(ff*uu) + on(1,2,u=0); plot(u,wait=1,ps="tempmuonde.ps", fill=true); freefem++-3.61-1/examples++-chapt3/regtests.edp000644 000767 000024 00000001375 13312446271 021267 0ustar00hechtstaff000000 000000 // Regression tests // ---------------- // $Id$ // Regression tests // ---------------- // The tests are checked against reference values by "make check" in // each examples subdirectory // "ref.edp" contains all reference values and may be rebuilt with // "make Ref" // $Id$ // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. NoUseOfWait=true; int verbosityy=verbosity; include "ref.edp"; // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. freefem++-3.61-1/examples++-chapt3/membrane.edp000644 000767 000024 00000001710 13256636774 021226 0ustar00hechtstaff000000 000000 // file membrane.edp real theta=4.*pi/3.; real a=2.,b=1.; // the length of the semimajor axis and semiminor axis func z=x; border Gamma1(t=0,theta) { x = a * cos(t); y = b*sin(t); } border Gamma2(t=theta,2*pi) { x = a * cos(t); y = b*sin(t); } mesh Th=buildmesh(Gamma1(100)+Gamma2(50)); // construction of mesh fespace Vh(Th,P2); // P2 conforming triangular FEM Vh phi,w, f=1; solve Laplace(phi,w)=int2d(Th)(dx(phi)*dx(w) + dy(phi)*dy(w)) - int2d(Th)(f*w) + on(Gamma1,phi=z); // resolution of laplace equation plot(phi,wait=true, ps="membrane.eps"); //Plot Th and v plot(Th,wait=true, ps="membraneTh.eps"); //Plot Th and v // to build a gnuplot data file { ofstream ff("graph.txt"); for (int i=0;i $@ # To create a new set of reference values in "ref.edp" Ref: makeref.edp ../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref FORCE:freefem++-3.61-1/examples++-chapt3/thermal.edp000644 000767 000024 00000001524 13256636774 021077 0ustar00hechtstaff000000 000000 // file heatex.edp int C1=99, C2=98; // could be anything border C0(t=0,2*pi){x=5*cos(t); y=5*sin(t);} border C11(t=0,1){ x=1+t; y=3; label=C1;} border C12(t=0,1){ x=2; y=3-6*t; label=C1;} border C13(t=0,1){ x=2-t; y=-3; label=C1;} border C14(t=0,1){ x=1; y=-3+6*t; label=C1;} border C21(t=0,1){ x=-2+t; y=3; label=C2;} border C22(t=0,1){ x=-1; y=3-6*t; label=C2;} border C23(t=0,1){ x=-1-t; y=-3; label=C2;} border C24(t=0,1){ x=-2; y=-3+6*t; label=C2;} mesh Th=buildmesh( C0(50) + C11(5)+C12(20)+C13(5)+C14(20) + C21(-5)+C22(-20)+C23(-5)+C24(-20)); plot(Th,wait=1); fespace Vh(Th,P1); Vh u,v; Vh kappa=1+4*(x<-1)*(x>-2)*(y<3)*(y>-3); solve a(u,v)= int2d(Th)(kappa*(dx(u)*dx(v)+dy(u)*dy(v))) +on(C0,u=20)+on(C1,u=100); plot(u,value=true,wait=1,fill=true); freefem++-3.61-1/examples++-chapt3/test1.edp000644 000767 000024 00000002151 13256636774 020500 0ustar00hechtstaff000000 000000 //Tutorial file test1.pde // YOUR FIRST PROGRAM border C(t=0,2*pi){x=cos(t); y=sin(t);} // the boundary mesh Th = buildmesh (C(50)); // of the domain and its mesh fespace Vh(Th,P1); // Finite Element of degree 2 defined here for Vh Vh u,v; // defines u and v as piecewise-P2 continuous functions func f= x*y; // definition of an algebraic function real cpu = clock(); solve Poisson(u,v,solver=LU) = // defines and solves the PDE int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) // bilinear part - int2d(Th)( f*v) // right hand side + on(C,u=0) ; // Dirichlet boundary condition plot(u,wait=1); cout << " CPU time = " << clock()-cpu << endl; // ENDS HERE // FOR THE PRO: The same done with total control over the algebra varf a(u,v) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v))+ on(C,u=0) ; matrix A=a(Vh,Vh); // stiffness matrix, see (\ref{eqn:Stiffness0}) varf b(u,v) = int2d(Th)( u*v ) ; matrix B=b(Vh,Vh); Vh F=f; v[] = B*F[]; u[]=A^-1*v[]; plot(u,wait=1); freefem++-3.61-1/examples++-chapt3/NSNewton.edp000644 000767 000024 00000005421 13271634313 021136 0ustar00hechtstaff000000 000000 // Author: F. Hecht // jan 2012 Stationnary imcompressible Navier Stokes Equation with Newton method. // a round a 3d Cylinder // build the Mesh real R = 5,L=15; border cc(t=0,2*pi){ x=cos(t)/2;y=sin(t)/2;label=1;} border ce(t=pi/2,3*pi/2) { x=cos(t)*R;y=sin(t)*R;label=1;} border beb(tt=0,1) { real t=tt^1.2; x= t*L; y= -R; label = 1;} border beu(tt=1,0) { real t=tt^1.2; x= t*L; y= R; label = 1;} border beo(t=-R,R) { x= L; y= t; label = 0;} border bei(t=-R/4,R/4) { x= L/2; y= t; label = 0;} mesh Th=buildmesh(cc(-50)+ce(30)+beb(20)+beu(20)+beo(10)+bei(10)); plot(Th); // bounding box for the plot func bb=[[-1,-2],[4,2]]; // operator macro Grad(u1,u2) [ dx(u1),dy(u1), dx(u2),dy(u2)]// macro UgradV(u1,u2,v1,v2) [ [u1,u2]'*[dx(v1),dy(v1)] , [u1,u2]'*[dx(v2),dy(v2)] ]// macro div(u1,u2) (dx(u1)+dy(u2))// // FE Space fespace Xh(Th,P2);fespace Mh(Th,P1); Xh u1,u2,v1,v2,du1,du2,u1p,u2p; Mh p,q,dp,pp; // intial guess with B.C. u1 = ( x^2+y^2) > 2; u2=0; // Physical parameter real nu= 1./50, nufinal=1/200. ,cnu=0.5; // stop test for Newton real eps=1e-6; verbosity=0; while(1) // Loop on vicosity { int n; real err=0; for( n=0;n< 15;n++) // Newton Loop { solve Oseen([du1,du2,dp],[v1,v2,q]) = int2d(Th) ( nu*(Grad(du1,du2)'*Grad(v1,v2) ) + UgradV(du1,du2, u1, u2)'*[v1,v2] + UgradV( u1, u2,du1,du2)'*[v1,v2] - div(du1,du2)*q - div(v1,v2)*dp - 1e-8*dp*q // stabilization term ) - int2d(Th) ( nu*(Grad(u1,u2)'*Grad(v1,v2) ) + UgradV(u1,u2, u1, u2)'*[v1,v2] - div(u1,u2)*q - div(v1,v2)*p - 1e-8*p*q ) + on(1,du1=0,du2=0) ; u1[] -= du1[]; u2[] -= du2[]; p[] -= dp[]; real Lu1=u1[].linfty, Lu2 = u2[].linfty , Lp = p[].linfty; err= du1[].linfty/Lu1 + du2[].linfty/Lu2 + dp[].linfty/Lp; cout << n << " err = " << err << " " << eps << " rey =" << 1./nu << endl; if(err < eps) break; // converge if( n>3 && err > 10.) break; // Blowup ???? } if(err < eps) // if converge decrease nu (more difficulte) { plot([u1,u2],p,wait=1,cmm=" rey = " + 1./nu , coef=0.3,bb=bb); if( nu == nufinal) break; if( n < 4) cnu=cnu^1.5; // fast converge => change faster nu = max(nufinal, nu* cnu); // new vicosity u1p=u1; u2p=u2; pp=p; // save correct solution ... } else { // if blowup, increase nu (more simple) assert(cnu< 0.95); // final blowup ... nu = nu/cnu; // get previous value of viscosity cnu= cnu^(1./1.5); // no conv. => change lower nu = nu* cnu; // new vicosity cout << " restart nu = " << nu << " Rey= "<< 1./nu << " (cnu = " << cnu << " ) \n"; // restore correct solution .. u1=u1p; u2=u2p; p=pp; } } freefem++-3.61-1/examples++-chapt3/sound.edp000644 000767 000024 00000002572 13256636774 020577 0ustar00hechtstaff000000 000000 real kc2=1; // try this value 19.4256; func g=y*(1-y); border a0(t=0,1) { x= 5; y= 1+2*t ;} border a1(t=0,1) { x=5-2*t; y= 3 ;} border a2(t=0,1) { x= 3-2*t; y=3-2*t ;} border a3(t=0,1) { x= 1-t; y= 1 ;} border a4(t=0,1) { x= 0; y= 1-t ;} border a5(t=0,1) { x= t; y= 0 ;} border a6(t=0,1) { x= 1+4*t; y= t ;} mesh Th=buildmesh( a0(20) + a1(20) + a2(20) + a3(20) + a4(20) + a5(20) + a6(20)); fespace Vh(Th,P1); Vh u,v; solve sound(u,v)=int2d(Th)(u*v * kc2 - dx(u)*dx(v) - dy(u)*dy(v)) - int1d(Th,a4)(g*v); plot(u, wait=1, ps="sound0.eps"); Vh u1,u2; real sigma = 20; // value of the shift // OP = A - sigma B ; // the shifted matrix varf op(u1,u2)= int2d(Th)( dx(u1)*dx(u2) + dy(u1)*dy(u2) - sigma* u1*u2 ) ;// + on(1,2,3,4,u1=0) ; // Boundary condition varf b([u1],[u2]) = int2d(Th)( u1*u2 ) ; // no Boundary condition matrix OP= op(Vh,Vh,solver=Crout,factorize=1); // crout solver because the matrix in not positive matrix B= b(Vh,Vh,solver=CG,eps=1e-20); int nev=2; // number of computed eigen value close to sigma real[int] ev(nev); // to store the nev eigenvalue Vh[int] eV(nev); // to store the nev eigenvector \index{EigenValue} int k=EigenValue(OP,B,sym=true,sigma=sigma,value=ev,vector=eV, tol=1e-10,maxit=0,ncv=0); cout<20) { th = adaptmesh(th,u,verbosity=1,abserror=1,nbjacoby=2, err=0.001, nbvx=5000, omega=1.8, ratio=1.8, nbsmooth=3, splitpbedge=1, maxsubdiv=5,rescaling=1) ; j=0; xveloc = -x*r+x*sigmax^2+x*rho*sigmax*sigmay/2; yveloc = -y*r+y*sigmay^2+y*rho*sigmax*sigmay/2; u=u; }; uold=u; solve eq1(u,v,init=j,solver=LU) = int2d(th)( u*v*(r+1/dt) + dx(u)*dx(v)*(x*sigmax)^2/2 + dy(u)*dy(v)*(y*sigmay)^2/2 + dy(u)*dx(v)*rho*sigmax*sigmay*x*y/2 + dx(u)*dy(v)*rho*sigmax*sigmay*x*y/2) + int2d(th)( -v*convect([xveloc,yveloc],dt,uold)/dt)+ on(2,3,u=0); j=j+1; }; plot(u,wait=1,value=1); plot(th,wait=1); freefem++-3.61-1/examples++-chapt3/potential.edp000644 000767 000024 00000002112 13256636774 021434 0ustar00hechtstaff000000 000000 // file potential.edp 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;} mesh Th= buildmesh(C(50)+Splus(70)+Sminus(70)); fespace Vh(Th,P2); Vh psi,w; solve potential(psi,w)=int2d(Th)(dx(psi)*dx(w)+dy(psi)*dy(w))+ on(C,psi = y)+ on(S,psi=0); plot(psi,wait=1); border D(t=0,2){x=1+t;y=0;} mesh Sh = buildmesh(C(25)+Splus(-90)+Sminus(-90)+D(200)); fespace Wh(Sh,P1); Wh v,vv; int steel=Sh(0.5,0).region, air=Sh(-1,0).region; 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); real dt=0.05, nbT=50; 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); for(i=0;i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-chapt3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = BlackScholes2D.edp NSNewton.edp NSprojection.edp condensor.edp convects.edp heatex.edp lame.edp membrane.edp membranerror.edp muwave.edp optimcontrol.edp potential.edp schwarz.edp sound.edp stokes.edp test1.edp testbed.edp thermal.edp thermic.edp # if .. no arpack ... XFAIL_TESTS = sound.edp EXTRA_DIST = *.edp all.edp regtests.edp regtests.m4 ref.edp LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-chapt3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-chapt3/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? BlackScholes2D.edp.log: BlackScholes2D.edp @p='BlackScholes2D.edp'; \ b='BlackScholes2D.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) NSNewton.edp.log: NSNewton.edp @p='NSNewton.edp'; \ b='NSNewton.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) NSprojection.edp.log: NSprojection.edp @p='NSprojection.edp'; \ b='NSprojection.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) condensor.edp.log: condensor.edp @p='condensor.edp'; \ b='condensor.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) convects.edp.log: convects.edp @p='convects.edp'; \ b='convects.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) heatex.edp.log: heatex.edp @p='heatex.edp'; \ b='heatex.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) lame.edp.log: lame.edp @p='lame.edp'; \ b='lame.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) membrane.edp.log: membrane.edp @p='membrane.edp'; \ b='membrane.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) membranerror.edp.log: membranerror.edp @p='membranerror.edp'; \ b='membranerror.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) muwave.edp.log: muwave.edp @p='muwave.edp'; \ b='muwave.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) optimcontrol.edp.log: optimcontrol.edp @p='optimcontrol.edp'; \ b='optimcontrol.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) potential.edp.log: potential.edp @p='potential.edp'; \ b='potential.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) schwarz.edp.log: schwarz.edp @p='schwarz.edp'; \ b='schwarz.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) sound.edp.log: sound.edp @p='sound.edp'; \ b='sound.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) stokes.edp.log: stokes.edp @p='stokes.edp'; \ b='stokes.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) test1.edp.log: test1.edp @p='test1.edp'; \ b='test1.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) testbed.edp.log: testbed.edp @p='testbed.edp'; \ b='testbed.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) thermal.edp.log: thermal.edp @p='thermal.edp'; \ b='thermal.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) thermic.edp.log: thermic.edp @p='thermic.edp'; \ b='thermic.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic cscopelist-am ctags-am distclean \ distclean-generic 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 pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile all-local: all.edp regtests.edp freefem++.pref all.edp: (echo "NoUseOfWait=true;int verbosityy=verbosity;"; \ for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ done) > $@ # To create a new set of reference values in "ref.edp" Ref: makeref.edp ../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref FORCE: # 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: freefem++-3.61-1/examples++-chapt3/thermic.edp000644 000767 000024 00000002426 13256636774 021100 0ustar00hechtstaff000000 000000 // file thermal.edp func u0 =10+90*x/6; func k = 1.8*(y<0.5)+0.2; real ue = 25, alpha=0.25, T=5, dt=0.1 ; mesh Th=square(30,5,[6*x,y]); fespace Vh(Th,P1); /* Vh u=u0,v,uold; // for the flat plate problem thermic(u,v)= int2d(Th)(u*v/dt + k*(dx(u) * dx(v) + dy(u) * dy(v))) + int1d(Th,1,3)(alpha*u*v) - int1d(Th,1,3)(alpha*ue*v) - int2d(Th)(uold*v/dt) + on(2,4,u=u0); // for the rod problem thermaxi(u,v)=int2d(Th)((u*v/dt + dx(u)*dx(v) + dy(u)*dy(v))*x) + int1d(Th,3)(alpha*x*u*v) - int1d(Th,3)(alpha*x*ue*v) - int2d(Th)(uold*v*x/dt) + on(2,4,u=u0); ofstream ff("thermic.dat"); for(real t=0;t> speedtest.out date >> speedtest.out echo CXXFLAGS=$CXXFLAGS >> speedtest.out # Run the actual test $ffexe lap3-cpu.edp \ |grep -E -- \ '-- lap (Cholesky|CG|UMFPACK|LU|Crout) +[0-9]+x[0-9]+' \ |tee -a speedtest.out if test $PIPESTATUS != 0 then exit 1 fi freefem++-3.61-1/examples++-other/graphics-benchmark.edp000644 000767 000024 00000007043 13256636774 023134 0ustar00hechtstaff000000 000000 // Profiling script, adapted from // examples++-tutorial/NSUzawaCahouetChabart.edp // (chosen for the large amount of graphics it displays) // correct bug in CahuetChabard routine // sign of pressure correct // and change Bx, By in Bx' By' (back and forth) in version>1.18 // correction in CahouetChabard routine in version 1.26 assert(version>1.18); // for big bug is non symetric matrix see HISTORY real s0=clock(); mesh Th=square(10,10); fespace Xh(Th,P2),Mh(Th,P1); Xh u1,u2,v1,v2; Mh p,q,ppp; real[int] pwork(p.n); int i=0; real one =1; varf bx(u1,q) = int2d(Th,qforder=4)( dx(u1)*q ); varf by(u1,q) = int2d(Th,qforder=4)( dy(u1)*q ); varf a(u1,u2)= int2d(Th,qforder=4)( dx(u1)*dx(u2) + dy(u1)*dy(u2) ) + on(3,u1=1) + on(1,2,4,u1=0) ; varf vfMass(p,q) = int2d(Th)(p*q); matrix MassMh=vfMass(Mh,Mh,solver=CG); p[]=1; ppp[]= MassMh*p[]; real aire = ppp[].sum; cout << " area of Omega = " << aire << endl; Xh bc1; bc1[] = a(0,Xh); Xh b; matrix A= a(Xh,Xh,solver=CG); matrix Bx= bx(Xh,Mh); // Mh corresponding to line and Xh to column matrix By= by(Xh,Mh); Xh bcx=(1-x)*x*4,bcy=0; Xh b1=0,b2=0; // right hand side (0) for Stokes func real[int] divup(real[int] & pp) { pwork= MassMh*pp; cout << " pp moy = " << pwork.sum/aire << " " ; pp -= pwork.sum/aire;; b = b1; b[] += Bx'*pp; b[] += bc1[] .*bcx[]; u1[] = A^-1*b[]; b = b2; b[] += By'*pp; b[] += bc1[] .*bcy[]; u2[] = A^-1*b[]; ppp[] = Bx*u1[]; ppp[] += By*u2[]; pwork= MassMh*ppp[]; cout << " moy = " << pwork.sum/aire << endl; // ppp[] -= pwork.sum/aire; return ppp[] ; }; p=0;q=0;u1=0;v1=0; //cout << " -------- A = " << A << endl; LinearCG(divup,p[],q[],eps=1.e-6,nbiter=50); divup(p[]); plot([u1,u2],p,wait=0,value=true,coef=0.1); real dt=0.05, alpha=1/dt; if ( alpha > 1e30) exit(1); real xnu=1./400.; cout << " alpha = " << alpha << " nu = " << xnu << endl; cout << "------------------------------------------ " << endl; varf at(u1,u2)= int2d(Th)( xnu*dx(u1)*dx(u2) + xnu*dy(u1)*dy(u2) + u1*u2*alpha ) + on(3,u1=1) + on(1,2,4,u1=0) ; A = at(Xh,Xh,solver=CG); //cout << " -------- AA = " << AA << endl; varf vfconv1(uu,vv) = int2d(Th,qforder=5) (convect([u1,u2],-dt,u1)*vv*alpha); varf vfconv2(v2,v1) = int2d(Th,qforder=5) (convect([u1,u2],-dt,u2)*v1*alpha); int idt; real temps=0; Mh pprec,prhs; varf vfLap(p,q) = int2d(Th)(dx(p)*dx(q) + dy(p)*dy(q) + p*q*1e-3); matrix LapMh= vfLap(Mh,Mh,solver=Cholesky,factorize=true); real[int] unMh(pprec.n); pprec[]=1; unMh = MassMh*pprec[]; func real[int] CahouetChabart(real[int] & xx) { // xx = \int (div u) w_i // $ \alpha \Delta^{-1} + \nu I $ // $ \alpha \LapMh ^{-1} + \nu MassMh^-1 $ real mxx= unMh'*xx; xx -= mxx*Th.area; pprec[]= LapMh^-1* xx; prhs[] = MassMh^-1*xx; pprec[] = alpha*pprec[]+xnu* prhs[]; // xx = LapMh*pprec[]; // pprec[] -= xx.sum; return pprec[]; }; Xh up1,up2; for (idt = 1; idt < 50; idt++) { up1=u1; up2=u2; temps += dt; cout << " --------- temps " << temps << " \n "; b1[] = vfconv1(0,Xh); b2[] = vfconv2(0,Xh); cout << " min b1 b2 " << b1[].min << " " << b2[].min << " max b1 b2 " << b1[].max << " " << b2[].max << endl; LinearCG(divup,p[],q[],eps=-1.e-6,nbiter=50,precon=CahouetChabart); divup(p[]); real errl2 = sqrt(int2d(Th)( (u1-up1)^2 + (u2-up2)^2 ) ); cout << " errl2 " << errl2 << endl; plot([u1,u2],p,wait=0,value= 1,coef=0.1,cmm="[u1,u2],p || u^n+1 - u^n ]]_L2 ="+errl2); if (errl2 < 1e-4) break; } freefem++-3.61-1/examples++-other/Makefile.am000644 000767 000024 00000000241 13256636774 020737 0ustar00hechtstaff000000 000000 # $Id$ TESTS=lap3-cpu.edp EXTRA_DIST=*.edp speedtest.sh LOG_DRIVER=$(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT=TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw freefem++-3.61-1/examples++-other/Makefile.in000644 000767 000024 00000074721 13321623167 020747 0ustar00hechtstaff000000 000000 # Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-other ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # $Id$ TESTS = lap3-cpu.edp EXTRA_DIST = *.edp speedtest.sh LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-other/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-other/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? lap3-cpu.edp.log: lap3-cpu.edp @p='lap3-cpu.edp'; \ b='lap3-cpu.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ cscopelist-am ctags-am distclean distclean-generic 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 pdf \ pdf-am ps ps-am recheck tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: freefem++-3.61-1/examples++-eigen/LapnosymEigenValue.edp000644 000767 000024 00000004452 13256636774 023122 0ustar00hechtstaff000000 000000 // laplace with matrix verbosity=1; mesh Th=square(20,20,[2*pi*x,2*pi*y]); fespace Vh(Th,P2); Vh u1,u2; int n=u1.n; real[int] Bu1(n),Bu2(n); real[int] Au1(n),Au2(n); real sigma = 0; real nu=0.1; varf op(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) + (dx(u1)+dy(u1))*u2 - sigma* u1*u2 ) + on(1,2,3,4,u1=0) ; varf a(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) + (dx(u1)+dy(u1))*u2 ) + on(1,2,3,4,u1=0) ; varf b([u1],[u2]) = int2d(Th)( u1*u2 ) ;//+ on(1,2,3,4,u1=0); matrix OP= op(Vh,Vh,solver=UMFPACK,factorize=0); matrix A= a(Vh,Vh,solver=GMRES); matrix B= b(Vh,Vh,solver=CG,eps=1e-20); int nev=11; real[int] ev(nev); // to store 10 eigein value real part real[int] evi(nev); // to store 10 eigein value imag part Vh[int] eV(nev); // to store 10 eigen vector /* For real nonsymmetric problems, complex eigenvectors are given as two consecutive vectors, so if Eigenvalue $k$ and $k+1$ are complex conjugate eigenvalues, the vector eV[K] will contain the real part and the vector eV[K] the imaginary part of the corresponding complex conjugate eigenvectors. */ int k=EigenValue(OP,B,sym=false,sigma=sigma,value=ev,vector=eV, tol=1e-10,maxit=0,ncv=0,ivalue=evi); k=min(k,nev); // some time the number of converged eigen value // can be greater than nev; for (int kk=0;kk=k) break; u2 = eV[j]; } cout << " ||u1|| " << u1[].linfty << " || u2|| = " << u2[].linfty << endl; Bu1=B*u1[]; Bu2=B*u2[]; Au1=A*u1[]; Au2=A*u2[]; // The Rayleigh quotient lambda = x'Ax/x'Bx // given the eigen value real xBx = u1[]'*Bu1 + u2[]'*Bu2; complex xAx = u1[]'*Au1 + u2[]'*Au2 + 1i*(u1[]'*Au2 - u2[]'*Au1); complex eigenvalue = xAx/xBx; cout << " ---- " << i<< " " << v <<" eigenvalue= " << eigenvalue << endl; // FFCS: add 3D view plot(eV[i],cmm="Eigen Vector "+i+" valeur =" + er + " , " + ei ,wait=1,value=1,dim=3,fill=1); } // FFCS: order of eigenvalues may change, and biggest eigenvalue // (95.xxx) may not be picked up at all. real regtest=0; for(int i=1;i 1e-6) nerr++; if(abs(ev[i]-eev[i]) > 1e-1) nerr++; cout << " ---- " << i<< " " << ev[i] << " == " << eev[i] << " err= " << err << " --- "< 0.3) nerr++; cout << i << " ev " << e << " freq = " << freq << "Hz, err=" << abs(freq-freqref[i]) < u1,u2; Vh ur,ui; int n=u1.n; complex[int] Bu1(n),Bu2(n); complex[int] Au1(n),Au2(n); real sigma=0.0; complex nu=1.0+1i; varf op(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) + (dx(u1)+dy(u1))*u2 - sigma* u1*u2 ) //+ on(1,2,3,4,u1=0) ; varf a(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) + (dx(u1)+dy(u1))*u2 ) //+ on(1,2,3,4,u1=0) ; varf b(u1,u2) = int2d(Th)( u1*u2 + 1i*u1*dx(u2) ); matrix OP=op(Vh,Vh,solver=sparsesolver); matrix A=a(Vh,Vh,solver=sparsesolver); matrix B=b(Vh,Vh,solver=sparsesolver); int nev=10; complex[int] ev(nev); // to store eigenvalues Vh[int] eV(nev); // to store eigenvectors //int k=EigenValue(OP,B,sigma=sigma,value=ev,vector=eV,tol=1e-10,maxit=0,ncv=0); // the default driver is number 4 (M positive definite Hermitian) int k=EigenValue(OP,B,sigma=sigma,value=ev,vector=eV,tol=1e-10,maxit=0,ncv=0,driver=2); // driver 2 works when M is arbitrary (non Hermitian) k=min(k,nev); // some time the number of converged eigen value // can be greater than nev; for (int kk=0;kk1e-5) // cout << "BUG ::: zero == " < $@ freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref freefem++-3.61-1/examples++-eigen/LapComplexEigenValue.edp000644 000767 000024 00000003277 13256636774 023370 0ustar00hechtstaff000000 000000 // laplace with matrix verbosity=1; mesh Th=square(20,20,[pi*x,pi*y]); fespace Vh(Th,P2); Vh u1,u2; Vh ur,ui; int n=u1.n; complex[int] Bu1(n),Bu2(n); complex[int] Au1(n),Au2(n); complex sigma = 0; //1.000+1i; complex nu=1+1i; varf op(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) - sigma*u1*u2 ) + on(1,2,3,4,u1=0) ; varf a(u1,u2)= int2d(Th)( nu*(dx(u1)*dx(u2) + dy(u1)*dy(u2)) ) + on(1,2,3,4,u1=0) ; varf b([u1],[u2]) = int2d(Th)( u1*u2 ) ;//+ on(1,2,3,4,u1=0); matrix OP= op(Vh,Vh,solver=UMFPACK); matrix A= a(Vh,Vh,solver=GMRES); matrix B= b(Vh,Vh,solver=GMRES,eps=1e-20); int nev=10; complex[int] ev(nev); // to store 10 eigen value Vh[int] eV(nev); // to store 10 eigen vector int k=EigenValue(OP,B,sigma=sigma,value=ev,vector=eV, tol=1e-10,maxit=90000,ncv=100); k=min(k,nev); // some time the number of converged eigen value // can be greater than nev; for (int kk=0;kk1e-5) cout << "BUG ::: zero == " < 1e-6) nerr++; if(abs(ev[i]-eev[i]) > 1e-1) nerr++; cout << " ---- " << i<< " " << ev[i] << " == " << eev[i] << " err= " << err << " --- "< 1e-6) nerr++; if(abs(ev[i]-eev[i]) > eev[i]*1e-1) nerr++; cout << " ---- " << i<< " " << ev[i] << " == " << eev[i] << " err= " << err << " --- "< 1e-6) nerr++; cout << " ---- " << i<< " " << ev[i] << " err= " << err << " --- "<&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++-eigen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw SKIP=$(SKIP_TESTS_EIGEN) TESTS = BeamEigenValue.edp BeamEigenValueperio.edp Lap3dEigenValue.edp LapEigenValue.edp LapnosymEigenValue.edp Stokes-eigen.edp VP-Steklov-Poincare.edp neuman.edp WGM-sphere.edp free-cyl-axi.edp LapEigenValueFunc.edp LapnosymComplexEigenValue.edp # LapComplexEigenValue.edp (buggus) EXTRA_DIST = *.edp all.edp all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++-eigen/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++-eigen/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? BeamEigenValue.edp.log: BeamEigenValue.edp @p='BeamEigenValue.edp'; \ b='BeamEigenValue.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) BeamEigenValueperio.edp.log: BeamEigenValueperio.edp @p='BeamEigenValueperio.edp'; \ b='BeamEigenValueperio.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) Lap3dEigenValue.edp.log: Lap3dEigenValue.edp @p='Lap3dEigenValue.edp'; \ b='Lap3dEigenValue.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) LapEigenValue.edp.log: LapEigenValue.edp @p='LapEigenValue.edp'; \ b='LapEigenValue.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) LapnosymEigenValue.edp.log: LapnosymEigenValue.edp @p='LapnosymEigenValue.edp'; \ b='LapnosymEigenValue.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) Stokes-eigen.edp.log: Stokes-eigen.edp @p='Stokes-eigen.edp'; \ b='Stokes-eigen.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) VP-Steklov-Poincare.edp.log: VP-Steklov-Poincare.edp @p='VP-Steklov-Poincare.edp'; \ b='VP-Steklov-Poincare.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) neuman.edp.log: neuman.edp @p='neuman.edp'; \ b='neuman.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) WGM-sphere.edp.log: WGM-sphere.edp @p='WGM-sphere.edp'; \ b='WGM-sphere.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) free-cyl-axi.edp.log: free-cyl-axi.edp @p='free-cyl-axi.edp'; \ b='free-cyl-axi.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) LapEigenValueFunc.edp.log: LapEigenValueFunc.edp @p='LapEigenValueFunc.edp'; \ b='LapEigenValueFunc.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) LapnosymComplexEigenValue.edp.log: LapnosymComplexEigenValue.edp @p='LapnosymComplexEigenValue.edp'; \ b='LapnosymComplexEigenValue.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic cscopelist-am ctags-am distclean \ distclean-generic 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 pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile # $Id$ # F. hecht july 2014 add LapEigenValueFunc.edp example all-local: all.edp freefem++.pref all.edp: (echo "NoUseOfWait=true;int verbosityy=verbosity;"; \ for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ done) > $@ freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref # 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: freefem++-3.61-1/web/news.php000644 000767 000024 00000015053 13256636774 016071 0ustar00hechtstaff000000 000000 Freefem++ News (May 2014)
FreeFem++ v ()
News
HPC and FreeFem++
  • Solver a problem with one billion of unknows in 2 minutes! The computation will done in 2 minutes on the Curie Thin Node@CEA machine (6144 coeurs de 4Go de mémoire chacun), Thank to P. Jolivet, and F. Nataf.
  • In construction
Last modified: 4 Nov 2015 freefem++-3.61-1/web/macosx.php000644 000767 000024 00000113654 13312446271 016375 0ustar00hechtstaff000000 000000

Installation from a pkg  file is standard,


on precompile version FreeFem++-3.60-MacOS_10.13.pkg to use petsc/slepc you need to install XQuartz form XQuartz-2.7.11.dmg


Remark on version 10.10, 10.9 and 10.8 to authorise the install from everywhere (see System Preferences > Security & Privacy > General > Allow applications dow nloaded from > Anywhere)

Take the file from and download


The textmate 2 editor is a good editor for Mac 10.7 or better, download from macromates.com and install it, when get the textmate freefem++ syntax from www.freefem.org/ff++/Textmate2-ff++.zip (version nov. 2107) unzip Textmate2-ff++.zip and follow the explanation given in file \texttt{How\_To.rtf}.


Please read the README_MAC form the distribution for the full infomation

Take the file from and download 


remark,  all examples and documentation are in the directory

 file:///usr/local/share/freefem++

the library install file are in 

file:///usr/local/lib/ff++



(In progress (May 2018 FH) ) To compile a full version of FreeFem++ under MacOS 

---------------------------------------------------------------------------

First download the tar.gz file contening source from 

or you can get the latest source from an anonymous git SCM copy with the following unix shell commands :

# git clone https://github.com/FreeFem/FreeFem-sources ff++ 

Under Hight Sierra or better  (10.13)  2015 ( xcode 9.3   form scratch)

-------------------------------------------------

 remark: All line beginning by # are  shell command in terminal. 

 


 1) install xcode , 


 2) to install  the xcode command line tools  


#  gcc 

answer to the dialogue  box

to check after

# clang++ -v

Apple LLVM version 9.1.0 (clang-902.0.39.1)

Target: x86_64-apple-darwin17.5.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


  3) install  ifort or gfortran with brew installer


 4) install mpich or openmpi  form the source 

 

get :

  http://www.mpich.org/static/downloads/3.1.3/mpich-3.2..tar.gz

or 

  https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.1.tar.gz

un tar and: 

  #  ./configure 'F77=gfortran' 'FC=gfortran' 'CC=clang' 'CXX=clang++'

  # make 

  # sudo make install

remark: you can no use precompile version because the fortran in not correct.

 5) install gsl 

   use homebrew (http://brew.sh ) or do:


  # curl -O http://git.savannah.gnu.org/cgit/gsl.git/snapshot/gsl-release-2-4.tar.gz

  # tar zxvf gsl-release-2-4.tar.gz

  # cd gsl-release-2-4.tar.gz

  #./configure CC=clang

  # make

  # sudo make install 


 6) Install git from the web https://git-scm.com/downloads /span>

    

 7)  Download freefem++  


  # git clone https://github.com/FreeFem/FreeFem-sources ff++


  9) install autoconf and automake now not in xcode


   I use the macport   distribution form http://www.macports.org

    or the home brew distribution from http://brew.sh

   # sudo port install  autoconf

   # sudo port install  automake

  and to build  the file  ./configure with automake/autoconf  do 

  # cd ff++

 # autoreconf  


  9bis) Or  untar AutoGeneratedFile.tar.gz


 # cd ff++

  # tar zxvf AutoGeneratedFile.tar.gz 


 10)  compilation of freefem++ 


  # cd ff++

  #  ./configure -—enable-download 

  # make

  # sudo make install




(Out of Date ) To compile a full version of FreeFem++ under MacOS 

---------------------------------------------------------------------------

First download the tar.gz file contening source from 

or you can get the latest source from an anonymous git SCM copy with the following unix shell commands :

# git clone https://github.com/FreeFem/FreeFem-sources ff++ 

Under Mavericks or better  (10.9,10.10)  2015 ( xcode 6.1.1  form scratch)

-------------------------------------------------

 remark: All line beginning by # are  shell command in terminal. 

 


 1) install xcode 6.1.1 , 


 2) to install  the xcode command line tools  


#  gcc 

answer to the dialogue  box

to check after

# gcc -v

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)

Target: x86_64-apple-darwin14.1.0

Thread model: posix


  4) install  gcc-4.9 form http://hpc.sourceforge.net


  # curl -O http://prdownloads.sourceforge.net/hpc/gfortran-4.9-bin.tar.gz?download

 # sudo tar zxvf gfortran-4.9-bin.tar.gz -C /


 5) install tex  from  ctan 

   http://mirrors.ctan.org/systems/mac/mactex/MacTeX.pkg


 6) install mpich or openmpi  form the source 

 

get :

  http://www.mpich.org/static/downloads/3.1.3/mpich-3.1.3.tar.gz

or 

  http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2

un tar and: 

  #  ./configure 'F77=gfortran' 'FC=gfortran' 'CC=clang' 'CXX=clang++'

  # make 

  # sudo make install

remark: you can no use precompile version because the fortran in not correct.

 7) install gsl 

   use homebrew (http://brew.sh ) or do:


  # curl -O http://ftp.gnu.org/gnu/gsl/gsl-1.16.tar.gz

  # tar zxvf gsl-1.16.tar.gz

  # cd gsl-1.16.

  #./configure CC=clang

  # make

  # sudo make install 


 6) Install git from the web https://git-scm.com/downloads /span>

    

 7)  Download freefem++  


  # git clone https://github.com/FreeFem/FreeFem-sources ff++


  9) install autoconf and automake now not in xcode


   I use the macport   distribution form http://www.macports.org

    or the home brew distribution from http://brew.sh

   # sudo port install  autoconf

   # sudo port install  automake

  and to build  the file  ./configure with automake/autoconf  do 

  # cd ff++

 # autoreconf  


  9bis) Or  untar AutoGeneratedFile.tar.gz


 # cd ff++

  # tar zxvf AutoGeneratedFile.tar.gz 


 10)  compilation of freefem++ 


  # cd ff++

  #  ./configure -—enable-download 

  # make

  # sudo make install



Under Mavericks (10.9)  2012 ( xcode 5.0.2 form scratch)

-------------------------------------------------

 remark: All line beginning by # are  shell command in terminal. 

 


 1) install xcode 5.0.2 , and the xcode command line tools  

    xcode 

    install Auxiliary Tools for Xcode (for PackageMaker)

 2) to install command line tools  do

      xcode click Xcode>Open Developer Tool>More Developer Tools.

 2) install  gcc-4.9 form http://hpc.sourceforge.net

  # curl -O http://prdownloads.sourceforge.net/hpc/gfortran-4.9-bin.tar.gz?download

  # sudo tar zxvf gfortran-4.9-bin.tar.gz -C /

 3) autoconf and automake now not in xcode

   I use the macport distribution form http://www.macports.org

  # sudo port install  autoconfo

  # sudo port install  automake

  Or with  brew tool ... 

 4) install tex  from  ctan 

   http://mirrors.ctan.org/systems/mac/mactex/MacTeX.pkg

 5) install openmpi form the source 

 http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2

  #  ./configure CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ F77=/usr/local/bin/gfortran FC=/usr/local/bin/gfortran

  # make 

  # sudo make install

 6) install gsl 

  # curl -O http://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz

  # tar zxvf gsl-1.15.tar.gz

  # cd gsl-1.15.

  #./configure CC=/usr/local/bin/gcc

  # make

  # sudo make install 

 7) install git from the web https://git-scm.com/downloads

    

 8)  downlaod  

  # git clone https://github.com/FreeFem/FreeFem-sources ff++

 9)  compilation of freefem++ 

  # cd ff++

  # ./configure '-with-suffix=macos-10.8' '-without-fltk' '--enable-download' '--enable-optim' 'MPIRUN=/usr/local/bin/mpirun' '--enable-m64' '--without-x' 'CC=clang -isysroot /Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' 'CFLAGS=-mmacosx-version-min=10.8' 'CXXFLAGS=-mmacosx-version-min=10.8 -std=c++11' 'CXX=clang++ -isysroot /Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' 'F77=/usr/local/bin/gfortran' 'FC=/usr/local/bin/gfortran' 'MPICXX=/usr/local/bin/mpic++' 'MPICC=/usr/local/bin/mpicc' 'MPIFC=/usr/local/bin/mpif90' 'MPIF77=/usr/local/bin/mpif90' '--enable-maintainer-mode'


  # make

  # make

  # make 

  # sudo make install


Under Lion August 2012 ( xcode 4.4 form scratch)

-------------------------------------------------

 remark: All line beginning by # are  shell command in terminal. 

 


 1) install xcode 4.5.1  , and the xcode command line tools  

    xcode 

      menu preferences -> Downloads -> Components -> Command Line Tools 

        install

    install Auxiliary Tools for Xcode (for PackageMaker)

 2) install  gcc-4.8 form http://hpc.sourceforge.net

  # curl -O http://prdownloads.sourceforge.net/hpc/gcc-lion.tar.gz?download

  # sudo tar zxvf gcc-lion.tar.gz -C /

 3) autoconf and automake now not in xcode

   I use the macport distribution form http://www.macports.org

  # sudo port install  autoconfo

  # sudo port install  automake

 4) install tex  from  ctan 

   http://mirrors.ctan.org/systems/mac/mactex/MacTeX.pkg

 5) install openmpi form the source 

   http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.tar.bz2

  #  ./configure CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ F77=/usr/local/bin/gfortran FC=/usr/local/bin/gfortran

  # make 

  # sudo make install

 6) install gsl 

  # curl -O http://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz

  # tar zxvf gsl-1.15.tar.gz

  # cd gsl-1.15.

  #./configure CC=/usr/local/bin/gcc

  # make

  # sudo make install 

 7) install git from the web git SCM

    

 8)  download  

  # git clone https://github.com/FreeFem/FreeFem-sources ff++

 9)  compilation of freefem++ 

  # cd ff++

  # ./configure '-with-suffix=lion' '-without-fltk' '--enable-download' '--enable-optim' 'MPIRUN=/usr/local/bin/mpirun' '--enable-m64' '--without-x' 'CC=/usr/local/bin/gcc' 'CXX=/usr/local/bin/g++' 'F77=/usr/local/bin/gfortran' 'FC=/usr/local/bin/gfortran'  

  # make

  # make

  # make 

  # sudo make install 

------------


freefem++-3.61-1/web/download.php000644 000767 000024 00000006210 13312446271 016677 0ustar00hechtstaff000000 000000 Freefem++ download Page (May. 2014)
FreeFem++ v ()
Download, The current version of FreeFem++ is
  • You can get the latest source from an anonymous git SCM copy with the following unix shell commands :

    git clone https://github.com/FreeFem/FreeFem-sources ff++

Download precompile version

Self-contained archives for all other systems :

All the versions of FreeFem++
Coloring Syntax FreeFem++
Last modified: 3 March 2017 freefem++-3.61-1/web/index.php000644 000767 000024 00000002543 13312446271 016204 0ustar00hechtstaff000000 000000 Freefem++ Home Page (March 2018) <body bgcolor="#FFFFFF" text="#000000" link="#333333" vlink="#330066" alink="#330066"> désolé pour vous! </body> </frameset> </html>�������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/main.php�����������������������������������������������������������������������000644 �000767 �000024 �00000043460 13256657105 016033� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������<html> <head> <link rel="stylesheet" href="ffstyle.css" type="text/css"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta name="Description" content="FreeFem++ is a language that allows the resolution of partial differential equation using the finite element method"> <meta name="Keywords" content="language, c++, Multi-platform, free software, Navier-Stokes, elasticity, convection-diffusion, heat equation, linear elliptic PDE's,MPI,Scientific computing"> <title>Freefem++ Home Page (March . 2016)</title> <link href="mailto:frederic.hecht@upmc.fr" rev="Author"> </head> <?php include 'phpfiles.php' ?> <body bgcolor="#FFFFFF" text="#000000" link="#333333" vlink="#330066" alink="#330066"> <div class="thetitle"> FreeFem++ v <? echo $fver ?> <font size=-1> (<? echo $fdate?>) </font> </div> <div class="content"> <div class="thema">Introduction</div> <div class="themaBlog"> </table> <p>&nbsp; <table><tr> <td><img src="images/csSnapSmall.jpg"></td> <td><b>FreeFem++</b> is a partial differential equation solver. It has its own language. freefem scripts can solve multiphysics non linear systems in 2D and 3D. <p>Problems involving PDE (2d, 3d) from several branches of physics such as fluid-structure interactions require interpolations of data on several meshes and their manipulation within one program. FreeFem++ includes a fast 2^d-tree-based interpolation algorithm and a language for the manipulation of data on multiple meshes (as a follow up of bamg (now a part of FreeFem++ ). <p>FreeFem++ is written in C++ and the FreeFem++ language is a C++ idiom. It runs on Macs, Windows, Unix machines. FreeFem++ replaces the older <a href="freefem/fraold.htm">freefem</a> and <a href="freefem/frap.htm">freefem+</a>. </td> </tr></table> </div> If you use <tt size=-2>Freefem++</tt> please cite the following reference in your work (books, articles, reports, etc.): <a href="http://dx.doi.org/10.1515/jnum-2012-0013" > Hecht, F. New development in FreeFem++. J. Numer. Math. 20 (2012), no. 3-4, 251–265. 65Y15</a> </p> the bibtex is: <table><tr> <td> <blockquote><TT><PRE> @article {MR3043640, AUTHOR = {Hecht, F.}, TITLE = {New development in FreeFem++}, JOURNAL = {J. Numer. Math.}, FJOURNAL = {Journal of Numerical Mathematics}, VOLUME = {20}, YEAR = {2012}, NUMBER = {3-4}, PAGES = {251--265}, ISSN = {1570-2820}, MRCLASS = {65Y15}, MRNUMBER = {3043640}, } </PRE></TT></blockquote></td></tr><table> <br><br> <!-- <li><font > <bf> <font color=black> The 6th tutorial and Workshop on FreeFem++ , held december 9th,10th and 11th, 2014, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris</bf> <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2014/Schedule.html"> Schedule, All Presentation, examples </A> and <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2014/."> directory this all data </A>. </font></li> <li><font > <bf> <font color=black> The 7th tutorial and Workshop on FreeFem++ <A HREF="https://www.ljll.math.upmc.fr/FreeFem++/"> (inscription here)</A>, held december 15th and 16th, 2015, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris</bf> <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2015/Schedule.html"> Schedule, All Presentation, examples </A> and <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2015/."> directory this all data </A>. </font></li> </ul> </div> --> <div class="thema"> HPC and FreeFem++ </div> <ul> <li> Solver a problem with one billion of unknows in 2 minutes! The computation will done in 2 minutes on the Curie Thin Node@CEA machine (6144 coeurs de 4Go de mémoire chacun), Thank to P. Jolivet, and F. Nataf. </li> <li> In construction </li> </ul> <div class="thema">Some FreeFem++ presentation (with useful information): </div> <ul> <li> <font> <b> The 9th tutorial and Workshop on FreeFem++ </b> <A HREF="https://www.ljll.math.upmc.fr/freefem++/" target="_top"> (registration here)</A>, held december 14th and 15th, 2017, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2017/Schedule.html" target="_top"> Schedule, All Presentation, examples </A> and <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2017/." target="_self"> directory this all data </A>. </font> </li> <li> <A HREF="https://www.maths.ox.ac.uk"> FreeFem++ cours, </A> October 17th to 20 2017, Department of Mathematics, Oxford University, UK <A HREF="https://www.ljll.math.upmc.fr/hecht/ftp/ff++/2017-Oxford.zip"> the zip file of the folder (presentation, examples, 7.8Mb)</A> and the <A HREF="https://www.ljll.math.upmc.fr/hecht/ftp/ff++/2017-Oxford"> folder </A>. </li> <li> <A HREF="http://www.mathematics.pitt.edu/node/2052"> An Introduction to Scientific Computing using Free Software FreeFem++ , </A> August 28 to September 1 2017, Department of Mathematics, University of Pittsburgh, USA <A HREF="https://www.ljll.math.upmc.fr/hecht/ftp/ff++/2017-Pitt.zip"> the zip file of the folder (presentation, examples, 7.8Mb)</A> and the <A HREF="https://www.ljll.math.upmc.fr/hecht/ftp/ff++/2017-Pitt"> folder </A>. </li> <li><font > <bf> <font color=black > The 8th tutorial and Workshop on FreeFem++ <A HREF="https://www.ljll.math.upmc.fr/freefem++/"> (inscription here)</A>, held december 8th and 9th, 2016, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris</bf> <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2016/Schedule.html"> Schedule, All Presentation, examples </A> and <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2016/."> directory this all data </A>. </font></li> <li> Tutorial with Freefem++, <A HREF="http://smai.emath.fr/cemracs/cemracs16/"> CEMRACS 2016 </A> CIRM, Luminy, Marseille, july 18-22, 2016. <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++/ff-cemracs-2016/"> The directory with all data </A> </li> <li> FreeFem++, <A HREF="http://www.math.iitb.ac.in/~neela/CIMPA/home.html"> Cimpa Summer School on Current Research in FEM at IIT Bombay, India <A/> 6-17 July, 2015. <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++/2015-cimpa-IIT"> The directory with all data </A> and <A HREF="http://library.cirm-math.fr/Record.htm?idlist=3&record=19281150124910093329"> the movie of the lecture </A> </li> <li> <font > <bf> <font color=blue> Graduate Course: </bf> </font> <A HREF="https://www.fields.utoronto.ca/programs/scientific/15-16/scientificcomputing/graduate/"> An introduction to scientific computing using free software FreeFem++ <A/> , <A HREF="https://www.fields.utoronto.ca/"> The Fields Institute for Research in Mathematical Sciences <A/>, Toronto, Canada , 7-17 March . 2016 <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++/2016-Fields"> The directory with all data </A>, <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++/2016-Fields.zip"> The zip of the directory with all data </A> </li> <li><font > <bf> <font color=black> <font color=black> The 7th tutorial and Workshop on FreeFem++ </font> held december 15th and 16th, 2015, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris</bf> <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2015/Schedule.html"> Schedule, All Presentation, examples </A> and <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2015/."> directory this all data </A>. </font></li> <li> FreeFem++, <A HREF="http://www.math.iitb.ac.in/~neela/CIMPA/home.html"> Cimpa Summer School on Current Research in FEM at IIT Bombay, India <A/> 6-17 July . 2015 <A HREF="https://www.ljll.math.upmc.fr/~hecht/ftp/ff++/2015-cimpa-IIT"> The directory with all data </A> </li> <li> Mini Cours FreeFem++ <A HREF="http://www.maths.ox.ac.uk"> Maths departement, Universty of Oxford, England <A/> 16-20 March . 2015 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/ff++/2015-oxford"> The directory with all data </A> </li> <li><font > <bf> <font color=black> The Sixth tutorial and Workshop on FreeFem++ <A HREF="http://www.ljll.math.upmc.fr/FreeFem++"> (inscription here)</A>, held december 9th,10th and 11th, 2014, in Paris at Universit&eacute Pierre et Marie Curie, Barre 16-15, 3ieme, 4 place Jussieu, Paris</bf> <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2014/Schedule.html"> Schedule, All Presentation, examples </A> and <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/ff++days/2014/."> directory this all data </A>. </font></li> <li> FreeFem++, <A HREF="http://cadiz-numerica-2013.uca.es"> Cadiz numerica 2013 <A/> University of Cadiz, Spain , 26-28 Juin . 2013 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/cadiz-numerica-2013"> All presentation and script </A> </li> <li> FreeFem++, University of Houston, TX, USA, 8,-9, feb. 2013 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/UoH-2013"> All presentation and script </A> </li> <li> Cours de presentation FreeFem++ <A HREF=http://master-modsim.univ-rennes1.fr/"> Master I, Modélisation et calcul scientifique, Rennes I </A>: <A HREF="ftp/Cours/Rennes"> Site du cours </A>.</li> <li> A seminar at <A HREF="http:http://departamento.us.es/edan/"> Departamento de Ecuaciones Diferenciales y Análisis Numérico </A> de la Universidad de Sevilla, Espagne, Jan, 2011 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/FF-Seville-2011-MPI-Schwarz-DDM.zip"> Coarse grid Schwarz DDM parellel solver in FreeFem++ (y &epsilon;) </A> </li> <li> A seminar at <A HREF="http://www-math.univ-paris13.fr/laga/"> laga </A> at Villetaneuse, france , jan, 2010 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/ff++-laga-2010.pdf">FreeFem++, a tool to solve PDE’s numerically. </A> </li> <li> A presentation at <A HREF="http://lma.univ-pau.fr/meet/mamern09/"> MAMERN 09 .</A> at Pau, france , june 11th, 2009, <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FH-Mamerm09.pdf">the slide Error indicator and mesh adaption, in FreeFem++ </A>. </li> <li> A presentation and all the data files at <A HREF="http://math.tkk.fi/numericsyear/fefair/"> Finite element fair .</A> Helsinki University of Technology Institute of Mathematics, june 5-6Th 2009 , the zip file :<A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/HECHT-FEFE09-dir.zip "> FreeFem++, 3d tools for PDE simulation </A>.</li> </li> <li> <A HREF="http://www.cimpa-icpam.org/index.php"> CIMPA</A>-UNESCO- <A HREF="http://www.univ-ag.fr/aoc/?guadeloupe09">GUADELOUPE School </A> January, 03-18, 2009, Pointe-à-Pitre, the <A HREF="ftp/CIMPA/CIMPA-Guadeloupe-FF.pdf"> pdf of my lecture (742Ko)</A> on FreeFem++ and the <A HREF="ftp/CIMPA/FF-CIMPA.zip"> archive (.zip) of all the examples (6.2Mo) </A> </li> <li> Numerical modeling of Geophysical Flows by Finite Element techniques with FreeFem++ <A HREF="http://institucional.us.es/doc-course-imus/Unit2.html" > IMUS 2010 Univerty of Seville</A>, Spain, <A HREF="ftp/IMUS-Seville"> Site of the cours </A> . </li> <li> My seminar at <A HREF="http:http://departamento.us.es/edan/"> Departamento de Ecuaciones Diferenciales y Análisis Numérico </A> de la Universidad de Sevilla, Espagne, , janvier, 2011 <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/FF-Seville-2011-MPI-Schwarz-DDM.zip"> Coarse grid Schwarz DDM parellel solver in FreeFem++ (y &epsilon;) </A> (to install my FreeFem++ mpi version on your Mac 10.6 (Snow leopard) <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/FF-conf/InstallMac10.6.html" > See this page </A>). </li> </ul> <div class="thema">Related software:</div> </div> <ul> <li> Emc2 (Editeur de Maillage 2d) <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/emc2/"> la dernière version (LJLL) </A> et <A HREF="http://www.ljll.math.upmc.fr/~hecht/ftp/emc2/RTemc2_gb.pdf"> english documentation in pdf </A>. <!-- et sur le site de l'INRIA: <A HREF="http://www-c.inria.fr/gamma/cdrom/www/emc2/fra.htm"> à l'inria en français </A>, <A HREF="http://www-c.inria.fr/gamma/cdrom/www/emc2/eng.htm"> in english </A>. --> </li> </ul> <br><br> <div class="thema">Examples 2d </div> <div class="themaBlog"> <ul> <li><a href="freefem/ff.mp4">A small movie (340Kb)</a>&nbsp;: Cool air (green) comes from the lower left and mix with hot air (magenta), the right boundary is free. This is Navier-Stokes-Boussinesq integrated with P1-bubble P1 mixte finite element. </ul> <ul> <li>A very small example 2d of how to solve the Poisson equation on a L shape&nbsp;: <table><tr> <td> <blockquote><TT><PRE> border aaa(t=0,1){x=t;y=0;}; border bbb(t=0,0.5){x=1;y=t;}; border ccc(t=0,0.5){x=1-t;y=0.5;}; border ddd(t=0.5,1){x=0.5;y=t;}; border eee(t=0.5,1){x=1-t;y=1;}; border fff(t=0,1){x=0;y=1-t;}; mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6)); fespace Vh(Th,P1); <font color=red> // to change P1 in P2 to make P2 finite element.</font> Vh u=0,v; func f= 1; func g= 0; int i=0; real error=0.1, coef= 0.1^(1./5.); problem Probem1(u,v,solver=CG,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(aaa,bbb,ccc,ddd,eee,fff,u=g) ; for (i=0;i< 10;i++) { real d = clock(); Probem1; <font color=red>// solve the problem </font> plot(u,Th,wait=1); Th=adaptmesh(Th,u,inquire=1,err=error); error = error * coef; } ; </PRE></TT></blockquote> </td> <td> <img SRC="images/u4.jpg" BORDER=0 height=250 width=250><img SRC="images/th4.jpg" BORDER=0 height=250 width=250> </p> <p align=CENTER> Solution on adapted mesh and associated mesh. </p> </td> </tr> </table> </ul> </div> <div class="thema">Examples 3d </div> <div class="themaBlog"> <ul> <li>A very small example of how to solve the Stokes equation 3d on cube shape&nbsp;: <table><tr> <td> <blockquote><TT><PRE><font color=black> load "msh3" load "medit" <font color=red> // dynamics load tools for 3d.</font> int nn=8; mesh Th2=square(nn,nn); fespace Vh2(Th2,P2); Vh2 ux,uz,p2; int[int] rup=[0,2], rdown=[0,1], rmid=[1,1,2,1,3,1,4,1]; real zmin=0,zmax=1; mesh3 Th=buildlayers(Th2,nn, zbound=[zmin,zmax], reffacemid=rmid, reffaceup = rup, reffacelow = rdown); medit("c10x10x10",Th); <font color=red> // see the 3d mesh with medit software</font> fespace VVh(Th,[P2,P2,P2,P1]); <font color=blue> macro Grad(u) [dx(u),dy(u),dz(u)] // EOM</font> <font color=blue> macro div(u1,u2,u3) (dx(u1)+dy(u2)+dz(u3)) //EOM</font> VVh [u1,u2,u3,p]; VVh [v1,v2,v3,q]; solve vStokes([u1,u2,u3,p],[v1,v2,v3,q]) = int3d(Th,qforder=3)( Grad(u1)'*Grad(v1) + Grad(u2)'*Grad(v2) + Grad(u3)'*Grad(v3) - div(u1,u2,u3)*q - div(v1,v2,v3)*p + 1e-10*q*p ) + on(2,u1=1.,u2=0,u3=0) + on(1,u1=0,u2=0,u3=0) ; plot(p,wait=1, nbiso=5); <font color=red> // a 3d plot of iso pressure. in progress... march 2009</font> <font color=red> // to see the 10 cut plan in 2d </font> for(int i=1;i<10;i++) { real yy=i/10.; <font color=red>// compute yy.</font> <font color=red> // do 3d -> 2d interpolation.</font> ux= u1(x,yy,y); uz= u3(x,yy,y); p2= p(x,yy,y); plot([ux,uz],p2,cmm=" cut y = "+yy,wait= 1); } </PRE></TT></blockquote> </td> <td> <img SRC="images/Stokes3d.jpg" BORDER=0 height=250 width=250><img SRC="images/Th-Stokes3d.jpg" BORDER=0 height=250 width=250> </p> <p align=CENTER> Solution on cup plan y=0.5 and mesh 10x10x10 and associated mesh. </p> </td> </tr> </table> </ul> <!-- ---------------------------------------------------------------------- --> <div class="thema"> Ongoing Work </div> <div class="themaBlog"> <ul> <li> FreeVol: Finite Vol technics in FreeFem++ for hyperbolic PDEs </li> <li> 3D implementation: new solver, new mesh tools, new kind of finite element </li> <li> Stabilize and test all parallel linear solver interface</li> </ul> </div> <!-- ---------------------------------------------------------------------- --> <!-- ---------------------------------------------------------------------- --> </div> <div class="thema"> Download, The current version of <i>FreeFem++</i> is <? echo $fver ?> </div> <div class="themaBlog"> <ul> <li> You can get the latest source from an anonymous <A href="https://git-scm.com/downloads" > git SCM </A> copy with the following unix shell commands&nbsp;: <p><TT><font color=black size=+0> git clone https://github.com/FreeFem/FreeFem-sources ff++ </font></tt></p> </li> Self-contained archives for all other systems&nbsp;: <P> <? download($adown) ?> </p> </menu> <li> <p>This <a href="ftp"> directory</A> contains all the different versions of <i>FreeFem++</i>.</font> </li> </ul> </div> <div class="thema"> Coloring Syntax <i>FreeFem++</i></div> <div class="themaBlog"> <ul> <li>for emacs editor you can download <tt>ff++-mode.el<tt> : <A href="http://github.com/rrgalvan/freefem-mode/",target="_blank"> here </A> (thanks to Rafa Rodríguez Galván &lt;rafael.rodriguez@uca.es&gt;). </li> <li> for <tt>textmate 2</tt> editor on Mac 10.7 or better, <a href="https://macromates.com/download"> download from macromates.com </a> and install it, when get the <a href="http://www.freefem.org/ff++/Textmate2-ff++.zip"> textmate freefem++ syntax from www.freefem.org/ff++/Textmate2-ff++.zip (version june 2107)</a> unzip Textmate2-ff++.zip and follow the explanation given in file <tt> How_To.rtf</tt>.</li> <li> for <A href="https://notepad-plus-plus.org",target="_blank"> notepad++ </A> editor under windows and <A href="color-syntax-win.pdf"> read and follow the instruction </A> </ul> </div> <address></address> <!-- hhmts start --> Last modified: 2 juin 2014 <!-- hhmts end --> </body> </html> </body> </html> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/phpfiles.php�������������������������������������������������������������������000644 �000767 �000024 �00000012362 13312446271 016707� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������<? $ver=0;$ffile="";$fver="";$fdate=""; $wver=0;$wfile="";$wwver=""; $w64ver=0;$w64file="";$w64wver=""; $mver=0;$mfile="";$mmver=""; $m6ver=0;$m6file="";$m6mver=""; $m7ver=0;$m7file="";$m7mver=""; $m8ver=0;$m8file="";$m8mver=""; $m9ver=0;$m9file="";$m9mver=""; $m10ver=0;$m10file="";$m10mver=""; $m11ver=0;$m11file="";$m11mver=""; $m12ver=0;$m12file="";$m12mver=""; $m13ver=0;$m13file="";$m13mver=""; $sver=0;$sfile="";$ssver=""; $lstfiles=""; $adown = array(); function sizefile($f) { $file="ftp/".$f; $z=round(filesize($file)/1024/1024,1); echo " ( ". $z ." Mb, ".date ("M d, Y H:i:s.", filemtime($file)). ") \n" ; } function ahref($f,$txt) { $file="ftp/".$f; echo "<a href=\"".$file."\">$txt</a>"; } function print_down($item, $key) { ahref($item,$item) ; echo " &nbsp;&nbsp;".sizefile($item) . " <br />\n"; } function ppfile($f,$ff) { if (strlen($f) >0) { echo "<bf>".$ff.":</bf> " ; ahref($f,$f) ; echo " &nbsp;&nbsp;".sizefile($f) ; } else echo $ff . ": do not exist ??? "; } function pfile($f,$ff) { if (strlen($f) >0) { echo "<li> <bf>".$ff.":</bf> " ; ahref($f,$f) ; echo " &nbsp;&nbsp;".sizefile($f) . " <br />\n"; echo "</li>"; } else echo "<li>". $ff . ": do not exist ???</li> "; } function download($adown) { array_walk($adown,'print_down'); } if ($handle = opendir('ftp/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !is_dir($file)) { if ( preg_match( "/[v-]([1-9])\.([0-9]+)((-[0-9]+)?)/", $file, $matches ) ) { $lver = $matches[1] + $matches[2]*0.001 - $matches[3]*0.000001 ; // echo "$file $matches[0] -- $matches[1] -- $matches[3] -- $matches[3]. $ver ... "; // echo (filesize($file)/1024/1024)." Mb, ".date ("F d Y H:i:s.", filemtime($file)). " " ; // echo "<p>"; if($ver < $lver) { $ver=$lver; $ffile=$file; $fdate=date ("F d Y H:i:s.", filemtime("ftp/".$file)); $fver = $matches[1].".".$matches[2].$matches[3]; } if(preg_match( "/\.exe/", $file, $mm ) ) { if(preg_match( "/win64/", $file, $mm )) { if ( $w64ver < $lver) { $w64file=$file; $w64ver=$lver; } } else if ( $wver < $lver ) { $wfile=$file; $wver=$lver; } } if(preg_match( "/_10\..*6.*\.pkg/", $file, $mm ) && $m6ver < $lver) { $m6file=$file; $m6ver=$lver; } if(preg_match( "/_10\..*7.*\.pkg/", $file, $mm ) && $m7ver < $lver) { $m7file=$file; $m7ver=$lver; } if(preg_match( "/_10\..*8.*\.pkg/", $file, $mm ) && $m8ver < $lver) { $m8file=$file; $m8ver=$lver; } if(preg_match( "/_10\..*9.*\.pkg/", $file, $mm ) && $m9ver < $lver) { $m9file=$file; $m9ver=$lver; } if(preg_match( "/_10\..*10.*\.pkg/", $file, $mm ) && $m10ver < $lver) { $m10file=$file; $m10ver=$lver; } if(preg_match( "/_10\..*11.*\.pkg/", $file, $mm ) && $m11ver < $lver) { $m11file=$file; $m11ver=$lver; } if(preg_match( "/_10\..*12.*\.pkg/", $file, $mm ) && $m12ver < $lver) { $m12file=$file; $m12ver=$lver; } if(preg_match( "/_10\..*13.*\.pkg/", $file, $mm ) && $m13ver < $lver) { $m13file=$file; $m13ver=$lver; } if(preg_match( "/niversal*\.pkg/", $file, $mm ) && $mver < $lver) { $mfile=$file; $mver=$lver; } if(preg_match("/freefem\+\+-[1-9]\.[0-9]+(-[0-9]+)?\.tar\.gz/", $file, $mm ) && $sver < $lver) { $sfile=$file; $sver=$lver; } if(preg_match( "/MacOsX/", $file, $mm ) && $wver < $lver) { $mofile=$file; } preg_match( "/^.*[v-][1-9]\.[0-9]+[-0-9]*(.*)$/", $file, $matche2 ); $kf = $matche2[1]; if (array_key_exists($kf, $adown)) { preg_match( "/[v-]([1-9])\.([0-9]+)([-0-9]*)/",$adown[$kf] , $matche3 ); $mlver = $matche3[1] + $matche3[2]*0.001 - $matche3[3]*0.000001 ; if( $mlver < $lver ) { //echo " push $kf -> $file ( $lver ) </br>\n "; $adown[$kf] = $file;} } else { //echo " new push $kf -> $file ( $lver ) </br>\n"; $adown[$kf] = $file; } }} } closedir($handle); rsort($adown); // //echo " </br> </br> ************* </br> </br> "; //print_r($adown); } // echo " .... $ver $ffile $fver <p>" ; ?> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/linux.php����������������������������������������������������������������������000644 �000767 �000024 �00000052405 13312446271 016236� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <meta name="Generator" content="Cocoa HTML Writer"> <meta name="CocoaVersion" content="1348.17"> <style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px Arial; color: #000000; -webkit-text-stroke: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; color: #000000; -webkit-text-stroke: #000000} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Arial; color: #000000; -webkit-text-stroke: #000000} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Arial; color: #000000; -webkit-text-stroke: #000000} p.p5 {margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Courier; color: #000000; -webkit-text-stroke: #000000} p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier; color: #2351d5; -webkit-text-stroke: #2351d5} p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; color: #000000; -webkit-text-stroke: #000000; min-height: 13.0px} p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier; color: #000000; -webkit-text-stroke: #000000; min-height: 13.0px} p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier; color: #0433ff} p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px} p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Arial} p.p12 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Arial; -webkit-text-stroke: #000000} p.p13 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Arial; min-height: 12.0px} p.p14 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Courier; color: #0433ff} p.p15 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Arial; color: #000000} p.p16 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p17 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier; color: #0433ff; -webkit-text-stroke: #2351d5} p.p18 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #0433ff; -webkit-text-stroke: #2351d5} p.p19 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica; color: #0433ff; -webkit-text-stroke: #000000} p.p20 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Courier New'; color: #2351d5; -webkit-text-stroke: #2351d5} span.s1 {font-kerning: none} span.s2 {font: 12.0px Arial; text-decoration: underline ; font-kerning: none; color: #0000ee; -webkit-text-stroke: 0px #0000ee} span.s3 {font-kerning: none; color: #0000ff; -webkit-text-stroke: 0px #0000ff} span.s4 {font: 12.0px Times; font-kerning: none} span.s5 {font: 12.0px Arial; font-kerning: none} span.s6 {font: 11.0px Courier; font-kerning: none; color: #0f2b7a; -webkit-text-stroke: 0px #0f2b7a} span.s7 {font: 11.0px Helvetica; font-kerning: none} span.s8 {font: 11.0px Helvetica; font-kerning: none; color: #000000; -webkit-text-stroke: 0px #000000} span.s9 {font-variant-ligatures: no-common-ligatures} span.s10 {font: 11.0px Courier; font-kerning: none; color: #2351d5; -webkit-text-stroke: 0px #2351d5} span.s11 {font: 11.0px Courier; font-kerning: none; -webkit-text-stroke: 0px #2351d5} span.s12 {font: 11.0px 'Courier New'; font-kerning: none; color: #2351d5; -webkit-text-stroke: 0px #2351d5} span.Apple-tab-span {white-space:pre} </style> </head> <body> <?php // comment in phpp .. include 'phpfiles.php'; ?> <p class="p1"><span class="s1">How to compile FreeFem++ under Linux.<span class="Apple-converted-space"> </span></span></p> <p class="p2"><span class="s1"><i>in tested FH (04/07/2017) on Ubuntu 16.04.4 LTS (form scatch) .</i></span></p> <p class="p3"><span class="s1"><br> </span></p> <p class="p5"><span class="s1"> Before the build process check the installed software <A HREF="linux.php#before"> (here) </A> </p> <p class="p5"><span class="s1">First download the tar.gz file contening source from <? ppfile($sfile,"Source code") ?> </p> <p class="p5"><span class="s1"> or you can get the latest source from an anonymous <A href="https://git-scm.com/downloads" > git SCM </A> copy with the following unix shell commands&nbsp;: </span></p> <p class="p5"><span class="s3"><b>git clone https://github.com/FreeFem/FreeFem-sources ff++<br> </b></span><span class="s4"><br> </span><span class="s5">if your version of automake &gt;= 1.13 , autoconf &gt;= 2.69 do <br> </span><span class="s3"><b>autoreconf -i </b></span><span class="s1"><br> </span><span class="s5">else it's too old, then do <br> </span><span class="s3"><b>tar zxvf AutoGeneratedFile.tar.gz<span class="Apple-converted-space"> </span></b></span></p> <p class="p3"><span class="s1">To have correct configure script and Makefie<br> </span></p> <p class="p3"><span class="s1"><span class="Apple-converted-space"> </span>To compile with no additionnal sofware</span></p> <p class="p3"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space"> </span>./configure<span class="Apple-converted-space"> </span></b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make<span class="Apple-converted-space"> </span></b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make check<span class="Apple-converted-space">    </span>(to test de version)</b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make install<span class="Apple-converted-space">  </span>(under root)</b></span></p> <p class="p7"><span class="s6"><b><span class="Apple-converted-space"> </span></b></span><span class="s1"> <span class="Apple-converted-space"> </span></span></p> <p class="p3"><span class="s7"><span class="Apple-converted-space"> </span></span><span class="s1">To compile with lot of additionnal software.</span></p> <p class="p6"><span class="s8"><br> </span><span class="s1"><b>./configure --enable-download --disable-pastix <span class="Apple-converted-space"> </span></b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make<span class="Apple-converted-space"> </span></b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make check<span class="Apple-converted-space">    </span>(to test de version)</b></span></p> <p class="p6"><span class="s1"><b><span class="Apple-converted-space">  </span>make install<span class="Apple-converted-space">  </span>(under root)</b></span></p> <p class="p8"><span class="s1"><b></b></span><br></p> <p class="p7"><span class="s1"></span><br></p> <p class="p12"><span class="s1">To configure <span class="Apple-converted-space">  </span>with petsc and hpddm (need<span class="Apple-converted-space">  </span>c++ 11 features )</span></p> <p class="p13"><span class="s9"></span><br></p> <p class="p3"><span class="s1">1) install git and cmake</p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>sudo apt-get install git cmake</b></span></p> <p class="p3"><span class="s1">2) configure to def on compiler, mpi , ...</p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>./configure --enable-download --disable-pastix .....</b></span></p> <p class="p3"><span class="s1">3) download and compile petsc, slepc in real and complex, ...</p> <p class="p3"><span class="s1"> ... Warning: Check that you can write in directory : path_install/ff-petsc</p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>cd download/ff-petsc</b></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>make petsc-slepc SUDO=sudo (if need root access to install dir)</b></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>make petsc-slepc</b></span></p> <p class="p9"><span class="s9"><i>.... wait , ... wait , wait ...</i></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>cd -</b></span></p> <p class="p3"><span class="s1">4) reconfigure with petsc, slepc in real and complex, ...</p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>./reconfigure <b></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>make <b></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>make check <b></span></p> <p class="p9"><span class="s9"><b><span class="Apple-converted-space">  </span>make install <b>(under root)</span></p> <p class="p12"></p> <p class="p12"></p> <A NAME="before all install "> <p class="p3"><span class="s1">Before you have to install some usefull package with apt-get under Debian / Ubuntu.<span class="Apple-converted-space"> </span></span></p> <p class="p3"><span class="s1"><span class="Apple-converted-space"> </span>you can install this package <span class="Apple-converted-space">  </span>software</span></p> <p> </p> <p class="p9"><span class="s9"><b>sudo apt-get install cpp freeglut3-dev g++ gcc gfortran</b></span></p> <p class="p9"><span class="s9"><b>sudo apt-get install<span class="Apple-converted-space">  </span>ghostscript m4 make patch pkg-config wget python</b></span></p> <p class="p3"><span class="s9"> # other lib of a full freefem++ can be change </span></p> <p class="p9"><span class="s9"><b>sudo apt-get install<span class="Apple-converted-space">  </span>libopenblas-dev liblapack-dev libhdf5-dev libgsl2-dev</b></span> </p> <p class="p3"><span class="s9"> # Remark: On old version pkg "libgsl2-dev" is "libgsl0-dev"</span></p> <p class="p3"><span class="s9"> # Remark: the next package can be download automaticaly by FreeFem++"</span></p> <p class="p9"><span class="s9"><b>sudo apt-get install<span class="Apple-converted-space">  </span> libscotch-dev libfftw3-dev libarpack2-dev libsuitesparse-dev </b></span></p> <p class="p9"><span class="s9"><b>sudo apt-get install<span class="Apple-converted-space">  </span> libmumps-seq-dev libnlopt-dev coinor-libipopt-dev libgmm++-dev libtet1.5-dev </b></span></p> <p class="p3"><span class="s9"> # Remark: superlu-dev package is too old on ubuntu Trusty (14.0.4) </span></p> <p class="p3"><span class="s9"> # not mandatory package but usefull for developpement </span></p> <p class="p9"><span class="s9"><b>sudo apt-get install autoconf automake autotools-dev bison flex gdb valgrind </b></span></p> <p class="p3"><span class="s9"> # not mandatory package for download with git form https://git-scm.com/downloads </span></p> <p class="p9"><span class="s9"><b>sudo apt-get install git </b></span></p> <p class="p9"><span class="s9"><b>sudo apt-get install gnuplot-qt </b></span></p> <p class="p10"><span class="s9"></span><br></p> <p class="p11"><span class="s9"># install de mpich for parallel version <span class="Apple-converted-space"> </span></span></p> <p class="p9"><span class="s9"><b>sudo apt-get install<span class="Apple-converted-space">  </span>mpich</b></span></p> <p class="p10"><span class="s9"></span><br></p> <p class="p18"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">Try to download and compile (add --enable-download flags to configure)</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>lot of related<span class="Apple-converted-space">  </span>software, (Please read the licence of all with software,</span></p> <p class="p16"><span class="s1">if you use freefem++ for commercial purpose)<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">tetgen superlu fftw metis yams mshmet MUMPS</span></p> <p class="p16"><span class="s1">blacs parmetis scalapack scotch superludist MUMPS pastix hypre hips<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">For the link with mmg3d software put the tar.gz archive in .../dowload/pgk directory.</span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">Remark, you can also copy all the download file in ../download/pgk if you have not internet connection.</span></p> <p class="p16"><span class="s1">To download all third party package do.<span class="Apple-converted-space"> </span></span></p> <p class="p7"><span class="s1"></span><br></p> <p class="p19"><span class="s1">./download/getall -a <br> </span></p> <p class="p7"><span class="s1"><span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1">TO simplify the link and compilation part,<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">I have add 3 files</span></p> <p class="p16"><span class="s1">examples++-load/WHERE_LIBRARY<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span></p> <p class="p16"><span class="s1">examples++-load/WHERE_LIBRARY-download</span></p> <p class="p16"><span class="s1">examples++-load/WHERE_LIBRARY-config</span></p> <p class="p16"><span class="s1"><br> <br> <br> </span></p> <p class="p16"><span class="s1">the files<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1">examples++-load/WHERE_LIBRARY-config</span></p> <p class="p16"><span class="s1">examples++-load/WHERE_LIBRARY-download</span></p> <p class="p16"><span class="s1">are respectively created with ./configure commande ,</span></p> <p class="p16"><span class="s1">the compilation of all download software.</span></p> <p class="p16"><span class="s1">and the<span class="Apple-converted-space">  </span>examples++-load/Makefile.</span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">Some configure flags use to build the current version</span></p> <p class="p16"><span class="s1">-----------------------------------------------------</span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1">*<span class="Apple-converted-space">  </span>Under Debian: ( 2008)</span></p> <p class="p16"><span class="s1">----------------</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>the installed packages + dependance are:<span class="Apple-converted-space">   </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>gcc g++ g77</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>libsuitesparse-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>libarpack2-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>libx11-dev libxt-dev libxext-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>patch</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>wget</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>freeglut3-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>- bluid the parallel version</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>openmpi-dev openmpi</span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>- to rebuild de documentation: <span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>imagemagick<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>tetex-base <span class="Apple-converted-space">  </span>tetex-bin<span class="Apple-converted-space">  </span>tetex-extra<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>./configure<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>make<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>make check<span class="Apple-converted-space">    </span>(to test de version)</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>make install<span class="Apple-converted-space">  </span>(under root)</span></p> <p class="p7"><span class="s1"><span class="Apple-converted-space">   </span></span></p> <p class="p16"><span class="s1">*<span class="Apple-converted-space">  </span>Under Ubuntu (2008)</span></p> <p class="p16"><span class="s1">---------------</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">  </span>the installed packages + dependance are:<span class="Apple-converted-space">   </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>gcc g++<span class="Apple-converted-space">  </span>g77</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>wget<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>m4 bison flex patch</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>libzip-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">   </span>libx11-dev libxt-dev libxext-dev<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libxpm4 libxpm4-dbg<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libsuitesparse-dev libarpack2-devlibarpack2 libarpack2-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libfltk1.1 libfltk1.1-dbg libfltk1.1-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libopenmpi1 libopenmpi-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libopenmpi-dbg libxpm-dev<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>freeglut3 freeglut3-dev</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libx11-dev<span class="Apple-converted-space">  </span>libxt-dev<span class="Apple-converted-space">  </span>libxext-dev<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>libglut3-dev<span class="Apple-tab-span"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>- bluid the parallel version</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>openmpi-dev openmpi</span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space"> </span>- to rebuild de documentation: <span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>imagemagick<span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><span class="Apple-converted-space">    </span>tetex-base <span class="Apple-converted-space">  </span>tetex-bin<span class="Apple-converted-space">  </span>tetex-extra<span class="Apple-converted-space"> </span></span></p> <p class="p7"><span class="s1"><span class="Apple-converted-space"> </span></span></p> <p class="p16"><span class="s1"><br> </span></p> <p class="p20"><span class="s1"><b><span class="Apple-converted-space"> </span>./configure --enable-download --disable-pastix <span class="Apple-converted-space">  </span>--with-mpi=mpic++</b></span></p> <p class="p20"><span class="s1"><b>#<span class="Apple-converted-space">  </span>utility of parameter:</b></span></p> <p class="p20"><span class="s1"><b>#<span class="Apple-converted-space">  </span>--enable-download :<span class="Apple-converted-space">  </span>for fft and tetgen ...<span class="Apple-converted-space"> </span></b></span></p> <p class="p20"><span class="s1"><b>#<span class="Apple-converted-space">  </span>--with-mpi=mpic++ : for mpi version<span <p class="p20"><span class="s1"><b>#<span class="Apple-converted-space">  </span>--disable-pastix : for mpi version<span class="Apple-converted-space"> </span></b></span></p> <p class="p20"><span class="s1"><b><span class="Apple-converted-space">  </span>make<span class="Apple-converted-space"> </span></b></span></p> <p class="p16"><span class="s12"><b><span class="Apple-converted-space">  </span>make check<span class="Apple-converted-space">    </span></b></span><span class="s1">(to test de version)</span></p> <p class="p20"><span class="s1"><b><span class="Apple-converted-space">  </span>make install<span class="Apple-converted-space"> </span></b> </span><span class="s8">(under root)</span></p> </body> </html> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/menu.php�����������������������������������������������������������������������000644 �000767 �000024 �00000010075 13312446271 016040� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <title></title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="ffstyle.css" type="text/css"> </head> <?php // comment in phpp .. include 'phpfiles.php'; ?> <body bgcolor="#FFFFFF" text="#000000" link="#333333" vlink="#330066" alink="#330066> <div class="menu"> <div class="title"><img src="images/chesapeake-2.jpg" width="220"></div> <div class="subtitle"><a href="mailto:Free Fem++ <freefempp@ljll.math.umpc.fr>"> mail to FreeFem++ list</a> </div> <p> <div class="menuTitle">Sections</div> <div class="menuItem"><a href="main.php" target="main">Home</a></div> <div class="menuItem"><a href="http://www.um.es/freefem/ff++/pmwiki.php" target="_top">Wiki</a></div> <div class="menuItem"><a href="https://ljll.math.upmc.fr/cgi-bin/mailman/listinfo/freefempp" target="_top">Mailing list </a></div> <div class="menuItem"><a href="https://www.ljll.math.upmc.fr/lehyaric/ffcs/index.htm" target="_top"> FreeFem++-cs </a></div> <div class="menuItem"><a href="https://www.ljll.math.upmc.fr/lehyaric/ffjs" target="_top"> FreeFem++ on the web </a></div> <div class="menuItem"><a href="examples.html" target="main">Showcase</a></div> <div class="menuItem"><a href="news.php" target="main">Web News</a></div> <div class="menuItem"><a href="https://github.com/FreeFem/FreeFem-sources" target="_top"> github site </a></div> </p> <p> <div class="menuTitle">Documentation</div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/freefem++doc.pdf" target="_top"> freefem++doc.pdf <? sizefile("freefem++doc.pdf") ?></a></div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/INNOVATION" target="_top"> Last News (INNOVATION) </a></div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/HISTORY" target="_top">HISTORY </a></div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/BUGS" target="_top">knows BUGS </a></div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/freefem++Spanish.pdf" target="_top">Una documentation en español</a></div> <div class="menuItem"><a href="http://www.freefem.org/ff++/ftp/freefem++doc-chinese.pdf" target="_top"> Chinese documentation </a></div> <div class="menuItem"><a href="http://comfos.org/jp/ffempp/index.html" target="_top">Japanese (Kohji Ohtsuka)</a></div> <div class="menuItem"><a href="http://homepage.ntu.edu.tw/~twhsheu/twsiamff++/freefem.html" target="_top"> TWSIAM Activity Group </a></div> </p> <p> <div class="menuTitle">Compilation/Installation</div> <div class="menuItem"></div> <div class="menuItem"><a href="download.php" target="main"> Download </a> </div> <div class="menuItem"></div> <div class="menuItem"><a href="windows.php" target="_top">Compilation Windows</a></div> <div class="menuItem"><a href="macosx.php" target="_top">Compilation MacOS X</a></div> <div class="menuItem"><a href="linux.php" target="_top">Compilation Linux</a></div> </p> <div class="menuTitle">Oldies</div> <div class="menuItem"> <a href="https://www.ljll.math.upmc.fr/hecht/bookIDFHOP/bp.tar.gz" target="_top">To download all the examples</a> (in tar.gz format) from the book "Simulation numérique en C++" by Ionut Danaila, Frédéric Hecht, Olivier Pironneau, DUNOD 2003 </div> <div class="menuItem"><a href="http://www.freefem.org/ff++/freefem/fraold.htm" target="_top"> freefem </a> The first freefem version </div> <div class="menuItem"><a href="http://www.freefem.org/ff++/freefem/index.html" target="_top"> freefem+ </a> The freefem+ version </div> <div class="menuItem"><a href="http://www.freefem.org/ff3d/index.html" target="_top">freeFEM3D</a>: the 3D version based on ficticious domain.</div> <div class="menuItem"><a href="http://www.freefem.org/ff2a3" target="_top">ANR FF2A3</a></div> <div class="menuItem"><a href="https://www.ljll.math.upmc.fr/hecht/ftp/emc2" target="main">emc2 (CAD 2d) </a></div> </p> </div> <address> frederic.hecht@upmc.fr</address> <!-- hhmts start --> Last modified: Mar 2 juin 2014 11:42:56 CEST <!-- hhmts end --> </body> </html> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/windows.php��������������������������������������������������������������������000644 �000767 �000024 �00000110273 13321622623 016564� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <meta name="Generator" content="Cocoa HTML Writer"> <meta name="CocoaVersion" content="1404.47"> <style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 19.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 19.0px Helvetica; color: #000000; -webkit-text-stroke: #000000; min-height: 23.0px} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 15.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 14.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #ff2a1a; -webkit-text-stroke: #ff2a1a} p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #0000ee; -webkit-text-stroke: #0000ee} p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 15.0px 'Helvetica Neue'; color: #232323; -webkit-text-stroke: #232323} p.p18 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 16.0px Courier; color: #008f00; -webkit-text-stroke: #008e54} p.p19 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 18.0px; font: 16.0px Arial; color: #000000; -webkit-text-stroke: #000000} p.p20 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 18.0px; font: 16.0px Courier; color: #008f00; -webkit-text-stroke: #000000} p.p21 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 18.0px; font: 16.0px Courier; color: #008f00; -webkit-text-stroke: #008e54} p.p22 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #008f00; -webkit-text-stroke: #000000} p.p23 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Courier; color: #008f00; -webkit-text-stroke: #008e54} p.p24 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Courier; color: #008e54; -webkit-text-stroke: #008e54} p.p25 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Consolas; color: #008f00; -webkit-text-stroke: #008f00} p.p26 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 18.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} p.p27 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Courier; color: #008e53; -webkit-text-stroke: #008e53} p.p28 {margin: 0.0px 0.0px 12.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000; -webkit-text-stroke: #000000} p.p29 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #000000; -webkit-text-stroke: #000000; min-height: 18.0px} p.p30 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000; -webkit-text-stroke: #000000} p.p31 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 18.0px; font: 16.0px Courier; color: #008e53; -webkit-text-stroke: #008e53} p.p32 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Courier; color: #000000; -webkit-text-stroke: #000000} p.p33 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #ff0000; -webkit-text-stroke: #ff0000} p.p34 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #3e00ff; -webkit-text-stroke: #3e00ff} p.p35 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #3e1bfe; -webkit-text-stroke: #3e1bfe} p.p36 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #3e02ff; -webkit-text-stroke: #3e02ff} p.p37 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #a20092; -webkit-text-stroke: #a20092} p.p38 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #1c42d9; -webkit-text-stroke: #1c42d9} p.p39 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #6c007d; -webkit-text-stroke: #6c007d} li.li11 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px 'Helvetica Neue'; color: #232323; -webkit-text-stroke: #232323} li.li12 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Consolas; color: #008f00; -webkit-text-stroke: #232323} li.li13 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 13.0px Consolas; color: #008f00; -webkit-text-stroke: #232323} li.li14 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px 'Helvetica Neue'; color: #232323} li.li15 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #000000} li.li16 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Helvetica; color: #942192} li.li17 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 19.0px Helvetica; color: #000000; -webkit-text-stroke: #000000} span.s1 {font-kerning: none} span.s2 {font: 19.0px Helvetica; font-kerning: none} span.s3 {text-decoration: underline ; font-kerning: none; color: #0000ee; -webkit-text-stroke: 0px #0000ee} span.s4 {font-kerning: none; color: #000000; -webkit-text-stroke: 0px #000000} span.s5 {font-kerning: none; color: #008f00; -webkit-text-stroke: 0px #008e53} span.s6 {font: 19.0px Helvetica; font-kerning: none; color: #000000; -webkit-text-stroke: 0px #000000} span.s7 {font-kerning: none; -webkit-text-stroke: 0px #000000} span.s8 {font: 15.0px 'Helvetica Neue'; text-decoration: underline ; font-kerning: none; color: #0b65a5; -webkit-text-stroke: 0px #0077cc} span.s9 {-webkit-text-stroke: 0px #000000} span.s10 {font: 13.0px Consolas; font-kerning: none; background-color: #eeeeee} span.s11 {color: #232323; background-color: #eeeeee; -webkit-text-stroke: 0px #000000} span.s12 {font-kerning: none; color: #232323; background-color: #eeeeee; -webkit-text-stroke: 0px #000000} span.s13 {font-kerning: none; background-color: #eeeeee} span.s14 {font: 15.0px 'Helvetica Neue'; font-kerning: none} span.s15 {font: 15.0px 'Helvetica Neue'; color: #232323; -webkit-text-stroke: 0px #000000} span.s16 {font: 15.0px 'Helvetica Neue'; font-kerning: none; color: #232323} span.s17 {font: 13.0px Consolas; font-kerning: none; color: #008f00; background-color: #eeeeee} span.s18 {font: 19.0px Helvetica} span.s19 {color: #942192} span.s20 {color: #000000} span.s21 {font: 16.0px Arial; font-kerning: none; color: #000000} span.s22 {font: 16.0px Arial; font-kerning: none} span.s23 {font-kerning: none; color: #008e54} span.s24 {font-kerning: none; color: #ff2a1a; -webkit-text-stroke: 0px #ff2a1a} span.s25 {font-kerning: none; color: #008e53; -webkit-text-stroke: 0px #008e53} span.s26 {font: 12.0px Times; text-decoration: underline ; font-kerning: none; color: #0000ee; -webkit-text-stroke: 0px #0000ee} span.s27 {font-kerning: none; color: #3e02ff; -webkit-text-stroke: 0px #3e02ff} span.s28 {text-decoration: underline ; font-kerning: none} span.s29 {font: 15.0px Helvetica; font-kerning: none; color: #000000; -webkit-text-stroke: 0px #000000} span.Apple-tab-span {white-space:pre} ol.ol1 {list-style-type: decimal} </style> </head> <body> <?php // comment in phpp .. include 'phpfiles.php'; ?> <p class="p2">To install the precompile windows package just<span class="Apple-converted-space"> </span></p> <p class="p2">download the last version from </p> <p class="p2">Take the file form and download </p> <? pfile($wfile,"Windows 32bits") ?> <? pfile($w64file,"Windows 64bits") ?> <p class="p1"><span class="s1">And execute<span class="Apple-converted-space">  </span>and<span class="Apple-converted-space">  </span>follow the instruction.</span></p> <p class="p1"><span class="s19">Warning: if you launch freefem++ without filename script by double clip, your get a error due (it is bug of usage <tt>GetOpenFileName</tt> in win64 ). </span></p> <p class="p1"><span class="s1"> To launch mpi version :</span> </p> <p class="p1"> first install MSMPI for parallel version under window64: Download : <a href="https://www.microsoft.com/en-us/download/details.aspx?id=49926">MS MPI V7</a>, and install both msmpisdk.msi and MSMpiSetup.exe</p> <p class="p1"><span class="s1"> In shell terminal (cmd, powershell, bash, ... ) do in correct directory:</span> </p> <span class="s15"><span class="s13">mpiexec.exe -np 4 FreeFem++-mpi DDM-Schwarz-Lame-2d.edp</span></span><br> <p class="p1"><span class="s1"><br> </span></p> <p class="p2"><span class="s1"><br> </span></p> <p class="p3"><span class="s1"><span class="Apple-converted-space"> </span></span></p> <p class="p4"><span class="s2">-- </span><span class="s1">How to compile under MSYS2<span class="Apple-converted-space">  </span>FreeFem++ for Microsoft Windows 64 (for </span><span class="s3">version Windows 32 </span><span class="s1">)<span class="Apple-converted-space">   </span></span></p> <p class="p5"><span class="s2"><span class="Apple-converted-space">    </span></span><span class="s1">F. Hecht<span class="Apple-converted-space">  </span>(Paris, april<span class="Apple-converted-space">  </span>the 20th, 2016)<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">---------------------------------------------</span></p> <p class="p7"><span class="s1">WARNING<span class="Apple-converted-space">  </span>NOW the window 64 version<span class="Apple-converted-space">  </span>is compiled under MSYS2 </span><span class="s4">for version<span class="Apple-converted-space">  </span>before version 3.47 , see<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">typo remark: all line in </span><span class="s5">green</span><span class="s1"><span class="Apple-converted-space">  </span>are shell command under mingw32 shell</span></p> <p class="p6"><span class="s1"><br> 1. Download and install msys2 version x86_64 <span class="Apple-converted-space"> </span></span></p> <p class="p8"><span class="s4">form <a href="https://msys2.github.io/"><span class="s3">https://msys2.github.io</span></a></span></p> <p class="p9"><span class="s1">Answer question in following  windows : </span></p> <p class="p10"><span class="s6"><br> </span><span class="s7"><span class="Apple-converted-space">  </span>1.<span class="Apple-tab-span"> </span></span><span class="s1">Download MSYS2 from <a href="http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/"><span class="s8">this page</span></a> (choose 32 or 64-bit according to what version of Windows you are going to use it on, not what kind of executables you want to build, both versions can build both 32 and 64-bit binaries).</span></p> <ol class="ol1"> <li class="li11"><span class="s9"></span><span class="s1">After the install completes, click on the newly created "MSYS2 Shell" option under either </span><span class="s10">MSYS2 64-bit</span><span class="s1"> or </span><span class="s10">MSYS2 32-bit</span><span class="s1"> in the Start menu. Update MSYS2 according to the wiki (although I just do a<span class="Apple-converted-space"> </span></span></li> <li class="li12"><span class="s11"></span><span class="s12"><span class="Apple-converted-space">    </span></span><span class="s13">pacman -Syu</span><span class="s14">,</span></li> <li class="li11"><span class="s9"></span><span class="s1">ignore all errors and close the window and open a new one, this is not recommended and you should do what the wiki page says).</span></li> <li class="li13"><span class="s15"></span><span class="s16">Install<span class="Apple-converted-space">  </span>all this tools : <br> </span><span class="s13">pacman -S autoconf</span><span class="s16"><br> </span><span class="s13">pacman -S automake-wrapper</span><span class="s16"><br> </span><span class="s13">pacman -S bash</span><span class="s16"><br> </span><span class="s13">pacman -S bash-completion</span><span class="s16"><br> </span><span class="s13">pacman -S bison</span><span class="s16"><br> </span><span class="s13">pacman -S bsdcpio</span><span class="s16"><br> </span><span class="s13">pacman -S bsdtar</span><span class="s16"><br> </span><span class="s13">pacman -S bzip2</span><span class="s16"><br> </span><span class="s13">pacman -S coreutils</span><span class="s16"><br> </span><span class="s13">pacman -S curl</span><span class="s16"><br> </span><span class="s13">pacman -S dash</span><span class="s16"><br> </span><span class="s13">pacman -S file</span><span class="s16"><br> </span><span class="s13">pacman -S filesystem</span><span class="s16"><br> </span><span class="s13">pacman -S findutils</span><span class="s16"><br> </span><span class="s13">pacman -S flex</span><span class="s16"><br> </span><span class="s13">pacman -S gawk</span><span class="s16"><br> </span><span class="s13">pacman -S gcc-libs</span><span class="s16"><br> </span><span class="s13">pacman -S grep</span><span class="s16"><br> </span><span class="s13">pacman -S gzip</span><span class="s16"><br> </span><span class="s13">pacman -S inetutils</span><span class="s16"><br> </span><span class="s13">pacman -S info</span><span class="s16"><br> </span><span class="s13">pacman -S less</span><span class="s16"><br> </span><span class="s13">pacman -S lndir</span><span class="s16"><br> </span><span class="s13">pacman -S make</span><span class="s16"><br> </span><span class="s13">pacman -S man-db</span><span class="s16"><br> </span><span class="s13">pacman -S git</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-freeglut</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-gcc</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-gcc-fortran</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-gsl</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-hdf5</span><span class="s16"><br> </span><span class="s13">pacman -S mingw-w64-x86_64-openblas</span><span class="s16"><br> </span><span class="s13">pacman -S mintty</span><span class="s16"><br> </span><span class="s13">pacman -S msys2-keyring</span><span class="s16"><br> </span><span class="s13">pacman -S msys2-launcher-git</span><span class="s16"><br> </span><span class="s13">pacman -S msys2-runtime</span><span class="s16"><br> </span><span class="s13">pacman -S ncurses</span><span class="s16"><br> </span><span class="s13">pacman -S pacman</span><span class="s16"><br> </span><span class="s13">pacman -S pacman-mirrors</span><span class="s16"><br> </span><span class="s13">pacman -S pactoys-git</span><span class="s16"><br> </span><span class="s13">pacman -S patch</span><span class="s16"><br> </span><span class="s13">pacman -S pax-git</span><span class="s16"><br> </span><span class="s13">pacman -S perl</span><span class="s16"><br> </span><span class="s13">pacman -S pkg-config</span><span class="s16"><br> </span><span class="s13">pacman -S pkgfile</span><span class="s16"><br> </span><span class="s13">pacman -S rebase</span><span class="s16"><br> </span><span class="s13">pacman -S sed</span><span class="s16"><br> </span><span class="s13">pacman -S tar</span><span class="s16"><br> </span><span class="s13">pacman -S tftp-hpa</span><span class="s16"><br> </span><span class="s13">pacman -S time</span><span class="s16"><br> </span><span class="s13">pacman -S tzcode</span><span class="s16"><br> </span><span class="s13">pacman -S unzip</span><span class="s16"><br> </span><span class="s13">pacman -S util-linux</span><span class="s16"><br> </span><span class="s13">pacman -S which</span><span class="s16"><br> <br> <br> </span></li> <li class="li11"><span class="s9"></span><span class="s1">install any libraries/tools you may need. You can search the repositories by doing<br> </span><span class="s17">pacman -Ss package_name_of_something_i_want_to_install</span></li> <li class="li14"></li> <li class="li11"><span class="s9"></span><span class="s1">Open a MinGW-w64 shell:<br> a) To build 32-bit things, open the "MinGW-w64 32-bit Shell"<br> b) To build 64-bit things, open the "MinGW-w64 64-bit Shell"</span></li> <li class="li15"><span class="s18"></span>install MSMPI<span class="Apple-converted-space">  </span>for parallel version under window64</li> <li class="li15"><span class="Apple-converted-space">    <span class="Apple-tab-span"> </span></span>download <a href="https://www.microsoft.com/en-us/download/details.aspx?id=49926">MS MPI V7</a>, and install both msmpisdk.msi and MSMpiSetup.exe</li> <li class="li15"><span class="Apple-converted-space">         </span>open <span class="s19">c:\msys64\mingw64.ini</span> in an editor and remove</span><span class="Apple-converted-space"> </span></li> <li class="li15"><span class="s20"><span class="Apple-converted-space">           </span>“</span>rem<span class="s20">” or "<span class="s19">#</span>" before “</span>set MSYS2_PATH_TYPE=inherit<span class="s20">”<span class="Apple-converted-space"> </span></span></li> <li class="li15"><span class="Apple-converted-space">           </span>(this enables passing Windows environment variables to MSYS2-MINGW64)</li> </span></li> </ol> <p class="p2"><span class="s1">Now you can do classical install<span class="Apple-converted-space"> </span></span></p> <p class="p18"><span class="s6"><span class="Apple-converted-space">      </span></span><span class="s1">git clone<span class="Apple-converted-space">  </span>https://github.com/FreeFem/FreeFem-sources ff++</span></p> <p class="p19"><span class="s1">Now you can do develop install</span></p> <p class="p18"><span class="s6"><span class="Apple-converted-space">      </span></span><span class="s1">git clone -b develop <span class="Apple-converted-space">  </span>https://github.com/FreeFem/FreeFem-sources ff++</span></p> <p class="p19"><span class="s1">Now update version </span></p> <p class="p20"><span class="s21"><span class="Apple-converted-space">      </span></span><span class="s22"> </span><span class="s1">cd ff++</span></p> <p class="p21"><span class="s1"><span class="Apple-converted-space">   </span>git pull </span></p> <p class="p22"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">To restore, all files build by autoreconf -i command (automake):</span></p> <p class="p23"><span class="s23"><span class="Apple-converted-space">   </span></span><span class="s1">tar zxvf AutoGeneratedFile.tar.gz<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">Finally, the configure argument are and the compile<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><span class="Apple-converted-space">  </span>(remark :<span class="Apple-converted-space">  </span>sorry pastix and hips does not compile under window to day, so I<span class="Apple-converted-space">  </span>disable its)</span></p> <p class="p23"><span class="s1"><span class="Apple-converted-space">    </span>./configure '--enable-download' '--disable-pastix' '--disable-hips'</span></p> <p class="p23"><span class="s1"><span class="Apple-converted-space">    </span>make</span></p> <p class="p23"><span class="s1"><span class="Apple-tab-span"> </span>make check</span></p> <p class="p24"><span class="s1"><br> </span></p> <p class="p24"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">Remark to see all dll use by file.dll file <br> </span></p> <p class="p25"><span class="s13">objdump.exe -p file.dll | grep -i dll</span></p> <p class="p24"><span class="s1"><br> </span></p> <p class="p2"><span class="s1"><br> </span></p> <p class="p26"><span class="s2">-- </span><span class="s1"><b>How to compile FreeFem++ on Microsoft Windows (win32) under Mingw32<span class="Apple-converted-space"> </span></b></span></p> <p class="p5"><span class="s2"><span class="Apple-converted-space">    </span></span><span class="s1">F. Hecht<span class="Apple-converted-space">  </span>(Paris, Sept. the 4th, 2013)<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">---------------------------------------------</span></p> <p class="p6"><span class="s24"><span class="Apple-converted-space"> </span>the window version<span class="Apple-converted-space">  </span>is compiled under MINGW </span><span class="s1">for version<span class="Apple-converted-space">  </span>before version 3.20 , oct 7h 2012 , see the end of the file (obsolete now)</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">typo remark: all line in </span><span class="s25">green</span><span class="s1"><span class="Apple-converted-space">  </span>are shell command under mingw32 shell</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">1. Download and install MINGW32<span class="Apple-converted-space"> </span></span></p> <p class="p8"><span class="s4">form <a href="http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download"><span class="s3">http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download</span></a></span></p> <p class="p9"><span class="s1">Answer question in following  windows : </span></p> <p class="p9"><span class="s1">  7) select  components<span class="Apple-converted-space"> </span></span></p> <p class="p9"><span class="s1">     all basic setup<span class="Apple-converted-space"> </span></span></p> <p class="p9"><span class="s1">     all package : in mingw32 mingw-devlopper-tool, autoconf , automake, compiler, wget , ...<span class="Apple-converted-space"> </span></span></p> <p class="p9"><span class="s1">  8)   Installation -&gt; Apply changes  </span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">2. Under mingw32 shell install wget and unzip</span></p> <p class="p27"><span class="s1"><span class="Apple-converted-space"> </span>mingw-get install msys-wget</span></p> <p class="p27"><span class="s1"><span class="Apple-converted-space"> </span>mingw-get.exe install msys-unzip</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">3. To install freeglut of win32 for the graphics part</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p27"><span class="s1">wget http://files.transmissionzero.co.uk/software/development/GLUT/freeglut-MinGW.zip<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">unzip freeglut-MinGW-2.8.0-1.mp.zip</span></p> <p class="p27"><span class="s1">cp freeglut/include/GL/* /c/MinGW/include/GL/.</span></p> <p class="p27"><span class="s1">cp freeglut/lib/lib*.a /c/MinGW/lib/.</span></p> <p class="p27"><span class="s1">cp freeglut/bin/freeglut.dll /c/MinGW/bin</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">4. install a good blas (OpenBlas) http://xianyi.github.com/OpenBLAS/</span></p> <p class="p8"><span class="s4"><span class="Apple-converted-space">   </span>get from<span class="Apple-converted-space">  </span><a href="http://github.com/xianyi/OpenBLAS/tarball/v0.2.3"><span class="s3">http://github.com/xianyi/OpenBLAS/tarball/v0.2.3</span></a></span></p> <p class="p28"><span class="s1"><br> </span></p> <p class="p28"><span class="s1"><br> </span></p> <p class="p27"><span class="s1">wget http://github.com/xianyi/OpenBLAS/tarball/v0.2.3 -O OpenBlas.tgz<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">tar zxvf OpenBlas.tgz<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">cd xianyi-OpenBLAS-*/.<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">make<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">make install PREFIX=$HOME/soft</span></p> <p class="p27"><span class="s1">mkdir $HOME/soft/bin<span class="Apple-converted-space"> </span></span></p> <p class="p27"><span class="s1">cp *.dll $HOME/soft/bin<span class="Apple-converted-space"> </span></span></p> <p class="p28"><span class="s1"><br> </span></p> <p class="p28"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">5. install MPI for // HPC Pack 2008 R2 Client Pack 4<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">and install MPI for // HPC Pack 2008 R2 Pack 4<span class="Apple-converted-space"> </span></span></p> <p class="p29"><span class="s1"><span class="Apple-converted-space">  </span></span></p> <p class="p6"><span class="s1">6. install inno setup to build installer :<span class="Apple-converted-space"> </span></span></p> <p class="p8"><span class="s4"><span class="Apple-converted-space">  </span><a href="http://www.xs4all.nl/~mlaan2/ispack/isetup-5.4.0.exe"><span class="s3">http://www.xs4all.nl/~mlaan2/ispack/isetup-5.4.0.exe</span></a></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">7. GSL for gsl interface is take form</span></p> <p class="p8"><span class="s4"><span class="Apple-converted-space">   </span><a href="http://sourceforge.net/projects/mingw-cross/files/%5BLIB%5D%20GSL/mingw32-gsl-1.14-1/"><span class="s3">http://sourceforge.net/projects/mingw-cross/files/%5BLIB%5D%20GSL/mingw32-gsl-1.14-1/</span></a></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">9) To download the latest freefem++ tar.gz file contening source form<span class="Apple-converted-space"> </span></span></p> <p class="p30"><span class="s1">or you can get the latest source from an anonymous <a href="https://git-scm.com"><span class="s26">git SCM </span></a>copy with the following unix shell commands :</span></p> <p class="p31"><span class="s1">git clone<span class="Apple-converted-space">  </span>https://github.com/FreeFem/FreeFem-sources ff++</span></p> <p class="p19"><span class="s1">to update do to the last version:</span></p> <p class="p31"><span class="s1">git checkout master</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">To restore, all files build by autoreconf -i command (automake):</span></p> <p class="p27"><span class="s1">tar zxvf AutoGeneratedFile.tar.gz<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">Finaly, the configure argument are:</span></p> <p class="p6"><span class="s1">10)<span class="Apple-converted-space">  </span>Finaly, the configure argument are :</span></p> <p class="p27"><span class="s1">./configure ’--enable-download’ ’FC=mingw32-gfortran’ ’F77=mingw32-gfortran’ ’CC=mingw32-gcc’ ’CXX=mingw32-g++’ ’-with-blas=$HOME/soft/bin/libopenblas.dll’ ’CXXFLAGS=-I$HOME/soft/include’ ’--enable-generic’ ’--with-wget=wget’ ’MPIRUN=/c/Program Files/Microsoft HPC Pack 2008 R2/Bin/mpiexec.exe</span></p> <p class="p32"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">-----------------------------------------------------------------------------------------------------------------------------</span></p> <p class="p6"><span class="s1">Ok until version 3.19-1 (but now this soft is to old to get form the web).<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">FIle version 30/11/2011 F. Hecht.<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p33"><span class="s1">WARNING<span class="Apple-converted-space">  </span>NOW the window version<span class="Apple-converted-space">  </span>is compiled under MINGW<span class="Apple-converted-space">  </span>(from version 3.11<span class="Apple-converted-space">  </span>14/01/2011 FH)</span></p> <p class="p6"><span class="s1">So the old dll are incompatible with the new version.<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">It is the fortran compiler under cygwin which is too old<span class="Apple-converted-space">  </span>(not f90 under cygwin).<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">----------------------------------------------------------</span></p> <p class="p6"><span class="s1">The<span class="Apple-converted-space">  </span>tools to<span class="Apple-converted-space">  </span>be installed are:</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>1) Download and install MINGW32<span class="Apple-converted-space"> </span></b></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p34"><span class="s1">http://sunet.dl.sourceforge.net/project/mingw/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20101030/mingw-get-inst-20101030.exe</span></p> <p class="p34"><span class="s1"><br> </span></p> <p class="p9"><span class="s1">launch:<span class="Apple-converted-space"> </span></span></p> <p class="p9"><span class="s1"><span class="Apple-converted-space">   </span> mingw-get-inst-20101030.exe</span></p> <p class="p9"><span class="s1"><br> </span></p> <p class="p9"><span class="s1">Answer question in following  windows : </span></p> <p class="p9"><span class="s1">   1) do next </span></p> <p class="p9"><span class="s1">   2) do next </span></p> <p class="p9"><span class="s1">   3) use preload case </span></p> <p class="p9"><span class="s1">   4)  accept </span></p> <p class="p9"><span class="s1">   5 ) select   location of mingw on disk. </span></p> <p class="p9"><span class="s1">   6) mingw menu name </span></p> <p class="p9"><span class="s1">  7) select  components</span></p> <p class="p9"><span class="s1">     all except  ada </span></p> <p class="p9"><span class="s1">  8)   do install </span></p> <p class="p34"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>2) Download and install wget</b> for --enable-download in configure</span></p> <p class="p34"><span class="s1">http://puzzle.dl.sourceforge.net/project/mingw/mingwPORT/Current%20Releases/wget-1.9.1-mingwPORT.tar.bz2</span></p> <p class="p6"><span class="s1">under mingw32 shell<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">do:<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">cd /c/users/loginname/download/</span></p> <p class="p35"><span class="s4">tar jxvf </span><span class="s1">wget-1.9.1-mingwPORT.tar.bz2</span></p> <p class="p35"><span class="s1">cp<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">extract and move wget.exe in /usr/bin<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>3) The glut of win32 from</b></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p34"><span class="s27">wget<span class="Apple-converted-space">  </span></span><span class="s1">http://web.cs.wpi.edu/~gogo/courses/mingw/winglut.zip</span></p> <p class="p34"><span class="s1">or<span class="Apple-converted-space"> </span></span></p> <p class="p36"><span class="s1">wget http://files.transmissionzero.co.uk/software/development/GLUT/freeglut-MinGW.zip</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">The location of include file must be<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p37"><span class="s1">c:\mingw\include\GL\glut.h</span></p> <p class="p37"><span class="s1">c:\mingw\include\GL\gl.h</span></p> <p class="p37"><span class="s1">c:\mingw\include|GL/glu.h</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">add the glut32.dll or freeglut.dll in you directory in the 2 directories:</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">$ find /c/MinGW -name glut</span></p> <p class="p37"><span class="s1">/c/MinGW/bin/glut32.dll</span></p> <p class="p37"><span class="s1">/c/MinGW/lib/glut32.dll</span></p> <p class="p29"><span class="s1"><span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><b>4) the good blas now is:</b><span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p34"><span class="s1">http://www.tacc.utexas.edu/tacc-projects/gotoblas2/downloads/</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">Try to compile<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>5) install MPI for // versio</b>n<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1">HPC Pack 2008 SDK</span></p> <p class="p38"><span class="s1">http://www.microsoft.com/download/en/details.aspx?id=10505</span></p> <p class="p6"><span class="s1">HPC Pack 2008 R2 Service Pack 2</span></p> <p class="p38"><span class="s1">http://www.microsoft.com/download/en/details.aspx?id=26646</span></p> <p class="p34"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>6) install<span class="Apple-converted-space">  </span>inno setup to build installer:<span class="Apple-converted-space"> </span></b></span></p> <p class="p34"><span class="s1">http://www.xs4all.nl/~mlaan2/ispack/isetup-5.4.0.exe</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>7) GSL for gsl interface<span class="Apple-converted-space">  </span>from</b><span class="Apple-converted-space"> </span></span></p> <p class="p8"><span class="s28"><a href="http://sourceforge.net/projects/mingw-cross/files/%5BLIB%5D%20GSL/mingw32-gsl-1.14-1/mingw32-gsl-1.14-1.zip/download">Download Now! mingw32-gsl-1.14-1.zip (3.5 MB)</a></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">8) download git for windows from:</span></p> <p class="p8"><span class="s28"><a href="https://git-scm.com">https://git-scm.com</a></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">9) To download the latest freefem++ tar.gz file contening source form<span class="Apple-converted-space"> </span></span></p> <p class="p30"><span class="s1">or you can get the latest source from an anonymous <a href="https://git-scm.com"><span class="s26">git SCM </span></a>copy with the following unix shell commands :</span></p> <p class="p31"><span class="s1">git clone<span class="Apple-converted-space">  </span>https://github.com/FreeFem/FreeFem-sources ff++</span></p> <p class="p19"><span class="s1">to update do to the last version:</span></p> <p class="p31"><span class="s1">git checkout</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><b>To restore, all file build by autoreconf -i command (automake c):</b></span></p> <p class="p27"><span class="s1">tar zxvf AutoGeneratedFile.tar.gz<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><b>Finaly, the configure argument are:</b></span></p> <p class="p27"><span class="s1">cd ff++</span></p> <p class="p27"><span class="s1">./configure '--enable-download' 'FC=mingw32-gfortran' 'F77=mingw32-gfortran' 'CC=mingw32-gcc' 'CXX=mingw32-g++' '-with-blas=/home/hecht/blas-x86/libgoto2.dll' 'CXXFLAGS=-I/home/hecht/blas-x86' '--enable-generic' '--with-wget=wget' 'MPIRUN=/c/Program Files/Microsoft HPC Pack 2008 R2/Bin/mpiexec.exe'</span></p> <p class="p39"><span class="s1"><br> </span></p> <p class="p39"><span class="s1">if erreor where building DOC do:</span></p> <p class="p27"><span class="s29">t</span><span class="s1">ouch DOC/freefem++doc.pdf</span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1">Good Luck …<span class="Apple-converted-space"> </span></span></p> <p class="p6"><span class="s1"><br> </span></p> <p class="p6"><span class="s1"><br> </span></p> </body> </html> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/web/ffstyle.css��������������������������������������������������������������������000755 �000767 �000024 �00000003006 13256636774 016570� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������body { padding: 25px; background-repeat: repeat; margin: 0px 0px 10px 0px; font-family: Optima, sans-serif; font-size: small; } div.content{ background: white; padding: 10px; margin-left: auto; margin-right: auto; } div.thetitle { font-size: 500%; color: black; font-family: Comic sans MS; vertical-align: baseline; align: center; font-weight: bold; } div.title { font-size: xx-large; color: black; font-family: Arial Rounded MT Bold, Arial, sans-serif; vertical-align: baseline; font-weight: bold; } div.subtitle { font-size: medium; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; } a.subTitle:link,a.subTitle:visited { color: black; } a.subTitle:hover,a.subTitle:active { color: #333; } a.titleLink:link,a.titleLink:visited { color: black; } a.titleLink:hover,a.titleLink:active { color: #333; } a:link,a:visited { text-decoration: none; color: #009; } a:hover,a:active { color: #00f; } div.menu { padding: 0px; font-size: small; } div.menuTitle { border-bottom: thin solid #999; font-weight: bold; margin-bottom: 5px; padding: 2px; margin: 0px; color: #b33; } div.menuItem { margin: 3px 0px 0px 0px; font-size: small; } div.thema { font-family: Optima, sans-serif; font-size: medium; border-bottom: thin solid gray; } div.themaTitle { font-family: Optima, sans-serif; font-size: small; font-weight: bold; margin: 10px 0px 10px 0px; color: #b33; } div.themaBlog { font-family: Optima, sans-serif; font-size: small; text-align: justify; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/ref.edp�����������������������������������������������������������������000644 �000767 �000024 �00000000762 13256636774 017042� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������real REFaadaptation=0.000319245; real REFaalapacien=1; real REFaalaplaceXnc=1713.48; real REFaamove=0.0714792; real REFaaRT=280.926; real REFarrayoFVh=4560.74; real REFbilap=33.835; real REFD2=0; real REFdemo1=1.36626; real REFdemo=1.31616; real REFfunct=4; real REFlapacienprecon=122059; real REFlapXmat=85.3776; real REFNSP1P1b=0.0463864; real REFNSP1P1=0.0509257; real REFNSP1P2=0.0454064; real REFparareal=1383.27; real REFRichard=95.8416; real REFteste=1; real REFwaferXheatingXlaserXaxi=285; ��������������freefem++-3.61-1/examples++/Stokes-P1nc-P0+P1.edp���������������������������������������������������000644 �000767 �000024 �00000001037 13256636774 021062� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������mesh Th=square(40,40,flags=3); fespace Vh(Th,P1nc); fespace Pdh(Th,P0); fespace Pch(Th,P1); fespace Ph(Th,P1dc); macro grad(u) [dx(u),dy(u)]// macro Grad(u) [grad(u#1),grad(u#2)]// macro div(u) (dx(u#1)+dy(u#2))// Vh u1,u2,v1,v2; Pdh pd,qd; Pch pc,qc; real eps = 1e-8; solve Stokes( [u1,u2,pc,pd],[v1,v2,qc,qd]) = int2d(Th) ( (Grad(u):Grad(v)) - pd*div(v) - qd*div(u) + [v1,v2]'*grad(pc) + [u1,u2]'*grad(qc) -eps*pc*qc -eps*pd*qd) + on(3,u1=(1-x)*x,u2=0) + on(1,2,4,u1=0,u2=0); plot([u1,u2],wait=1); Ph p = pd+pc; plot(p, wait=1); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/lapacienprecon.edp������������������������������������������������������000644 �000767 �000024 �00000001600 13256636774 021241� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Warning we forgot to remove 3 pointer in this exemple // precon=Precon correct in version 1.26 verbosity=4; mesh Th=square(10,10,[10*x,5*y]); fespace Vh(Th,P1); Vh u,v; u=0; func f= 0; func g= 5*x+y; int i=0; real error=0.1, coef= 0.1^(1./5.); varf vAA(u,v) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int1d(Th,1) ( u*v ) + on(3,4,u=0) ; int pprc=1; matrix AA = vAA(Vh,Vh,solver=CG); func real[int] Precon(real[int] & xx) { cout << xx[0] << " -----" ; // xx[0]=1001; real[int] xpre = xx; if(pprc) xpre = AA^-1*xx; return xpre; }; problem Probem1(u,v,solver=CG,init=i,eps=1.0e-6,precon=Precon) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int1d(Th,1) ( u*v ) + int2d(Th) ( v*f ) + int1d(Th,2) (-5*v) + int1d(Th,1) ( (+1-g)*v) + on(3,4,u=g) ; real cpu=clock(); Probem1; // SOLVE THE PROBLEM 1 plot(u); cout << " CPU = " << clock()-cpu << endl; ��������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/makeref.edp�������������������������������������������������������������000644 �000767 �000024 �00000011774 13256636774 017705� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Regression tests // ---------------- // $Id$ // Regression tests // ---------------- // The tests are checked against reference values by "make check" in // each examples subdirectory // "ref.edp" contains all reference values and may be rebuilt with // "make Ref" // $Id$ // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. NoUseOfWait=true; int verbosityy=verbosity; ofstream ref("ref.edp"); // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. cout << "--------- file : aadaptation.edp -----------------" << endl; verbosity=verbosityy; { include "aadaptation.edp"; real TESTaadaptation=regvalue; ref<<"real REFaadaptation="<<TESTaadaptation<<";"<<endl; }; ; cout << "--------- file : aalapacien.edp -----------------" << endl; verbosity=verbosityy; { include "aalapacien.edp"; real TESTaalapacien=1+err; ref<<"real REFaalapacien="<<TESTaalapacien<<";"<<endl; }; ; cout << "--------- file : aalaplace-nc.edp -----------------" << endl; verbosity=verbosityy; { include "aalaplace-nc.edp"; real TESTaalaplaceXnc=u[]'*u[]; ref<<"real REFaalaplaceXnc="<<TESTaalaplaceXnc<<";"<<endl; }; ; cout << "--------- file : aamove.edp -----------------" << endl; verbosity=verbosityy; { include "aamove.edp"; real TESTaamove=u[]'*u[]; ref<<"real REFaamove="<<TESTaamove<<";"<<endl; }; ; cout << "--------- file : aaRT.edp -----------------" << endl; verbosity=verbosityy; { include "aaRT.edp"; real TESTaaRT=u1[]'*u1[]; ref<<"real REFaaRT="<<TESTaaRT<<";"<<endl; }; ; cout << "--------- file : arrayoFVh.edp -----------------" << endl; verbosity=verbosityy; { include "arrayoFVh.edp"; real TESTarrayoFVh=u[]'*u[]; ref<<"real REFarrayoFVh="<<TESTarrayoFVh<<";"<<endl; }; ; cout << "--------- file : bilap.edp -----------------" << endl; verbosity=verbosityy; { include "bilap.edp"; real TESTbilap=xx(0:n)'*xx(0:n); ref<<"real REFbilap="<<TESTbilap<<";"<<endl; }; ; cout << "--------- file : D2.edp -----------------" << endl; verbosity=verbosityy; { include "D2.edp"; real TESTD2=w[]'*w[]; ref<<"real REFD2="<<TESTD2<<";"<<endl; }; ; cout << "--------- file : demo1.edp -----------------" << endl; verbosity=verbosityy; { include "demo1.edp"; real TESTdemo1=u[]'*u[]; ref<<"real REFdemo1="<<TESTdemo1<<";"<<endl; }; ; cout << "--------- file : demo.edp -----------------" << endl; verbosity=verbosityy; { include "demo.edp"; real TESTdemo=u[]'*u[]; ref<<"real REFdemo="<<TESTdemo<<";"<<endl; }; ; cout << "--------- file : funct.edp -----------------" << endl; verbosity=verbosityy; { include "funct.edp"; real TESTfunct=myfunction(1.0,3.); ref<<"real REFfunct="<<TESTfunct<<";"<<endl; }; ; cout << "--------- file : lapacienprecon.edp -----------------" << endl; verbosity=verbosityy; { include "lapacienprecon.edp"; real TESTlapacienprecon=u[]'*u[]; ref<<"real REFlapacienprecon="<<TESTlapacienprecon<<";"<<endl; }; ; cout << "--------- file : lap_mat.edp -----------------" << endl; verbosity=verbosityy; { include "lap_mat.edp"; real TESTlapXmat=u1[]'*u1[]; ref<<"real REFlapXmat="<<TESTlapXmat<<";"<<endl; }; ; cout << "--------- file : NSP1P1b.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P1b.edp"; real TESTNSP1P1b=int2d(Th)(square(u1)+square(u2)); ref<<"real REFNSP1P1b="<<TESTNSP1P1b<<";"<<endl; }; ; cout << "--------- file : NSP1P1.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P1.edp"; real TESTNSP1P1=int2d(Th)(square(u1)+square(u2)); ref<<"real REFNSP1P1="<<TESTNSP1P1<<";"<<endl; }; ; cout << "--------- file : NSP1P2.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P2.edp"; real TESTNSP1P2=int2d(Th)(square(u1)+square(u2)); ref<<"real REFNSP1P2="<<TESTNSP1P2<<";"<<endl; }; ; cout << "--------- file : parareal.edp -----------------" << endl; verbosity=verbosityy; { include "parareal.edp"; real TESTparareal=pu'*pu; ref<<"real REFparareal="<<TESTparareal<<";"<<endl; }; ; cout << "--------- file : Richard.edp -----------------" << endl; verbosity=verbosityy; { include "Richard.edp"; real TESTRichard=hmax; ref<<"real REFRichard="<<TESTRichard<<";"<<endl; }; ; cout << "--------- file : teste.edp -----------------" << endl; verbosity=verbosityy; { include "teste.edp"; real TESTteste=P.x; ref<<"real REFteste="<<TESTteste<<";"<<endl; }; ; cout << "--------- file : testFE.edp -----------------" << endl; verbosity=verbosityy; { include "testFE.edp"; }; ; cout << "--------- file : wafer-heating-laser-axi.edp -----------------" << endl; verbosity=verbosityy; { include "wafer-heating-laser-axi.edp"; real TESTwaferXheatingXlaserXaxi=xx'*xx; ref<<"real REFwaferXheatingXlaserXaxi="<<TESTwaferXheatingXlaserXaxi<<";"<<endl; }; ; ����freefem++-3.61-1/examples++/lap_mat.edp�������������������������������������������������������������000644 �000767 �000024 �00000001540 13256636774 017676� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// laplace with matrix verbosity=10; mesh Th=square(10,10); fespace Vh(Th,P1); Vh u1,u2; varf a(u1,u2)= int2d(Th)( dx(u1)*dx(u2) + dy(u1)*dy(u2) ) + on(1,2,3,4,u1=1); varf b([u1],[u2]) = int2d(Th)( u1*u2 ); matrix A= a(Vh,Vh,solver=CG); matrix B= b(Vh,Vh,solver=CG,eps=1e-20); Vh bb ,bc,rhs; bc[]= a(0,Vh); // to save the u1=x; bb[] = bc[] .* u1[]; u1[] = A^-1*bb[]; //plot(u1,cmm="solution = x ",wait=1,value=1); u1=x*y; bb[] = bc[] .* u1[]; u1[] = A^-1*bb[]; //plot(u1,cmm="solution = x*y ",wait=1,value=1); u1=-4; // $-\Delta (x^2 + y^2) $ bb[] = B*u1[]; u1= x^2 + y^2 ; bb[] += bc[] .* u1[]; u1[] = A^-1*bb[]; u2= x^2 + y^2; cout << " u1(1,2) =" << u1(.1,.2) << " ~= " << u2(.1,.2) << " == " << .1^2+.2^2 << endl; plot(u1,cmm="solution = $x^2 + y^2$ ",wait=1,value=1); ����������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/renumbering.edp���������������������������������������������������������000644 �000767 �000024 �00000000707 13256636774 020602� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������real[int] T=1:5; real[int,int] RR= [ [0,1,0,0,0 ], [0,0,1,0,0 ], [0,0,0,0,1 ]]; real[int,int] CC= [ [0,1,0,0,0 ], [0,1,1,0,0 ], [0,2,0,0,1 ], [0,3,0,0,1 ], [0,4,0,0,1 ]]; real[int] r(1),ra(1); matrix R=RR; matrix C=CC; cout << R << endl; cout << " T = " << T << endl; renumbering(R,T,r); cout << " r= " << r << endl; renumbering(C,R,T,ra); cout << " ra= " << ra << endl; cout << C << endl; assert( C.n==3 && C.m ==3); assert(ra.n==3 && r.n==3); ���������������������������������������������������������freefem++-3.61-1/examples++/aadaptation.edp���������������������������������������������������������000644 �000767 �000024 �00000001661 13256636774 020552� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbosity=2; border aaa(t=0,1){x=t;y=0;}; border bbb(t=0,0.5){x=1;y=t;}; border ccc(t=0,0.5){x=1-t;y=0.5;}; border ddd(t=0.5,1){x=0.5;y=t;}; border eee(t=0.5,1){x=1-t;y=1;}; border fff(t=0,1){x=0;y=1-t;}; mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6)); fespace Vh(Th,P1); Vh u,v,zero; u=0; u=0; zero=0; func f= 1; func g= 0; int i=0; real error=0.1, coef= 0.1^(1./5.); problem Probem1(u,v,solver=CG,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(aaa,bbb,ccc,ddd,eee,fff,u=g) ; real cpu=clock(); for (i=0;i< 5;i++) { real d = clock(); Probem1; plot(u,zero,wait=1,ps="Lm"+i+".eps"); plot(u,zero,wait=1,ps="Lu"+i+".eps"); Th=adaptmesh(Th,u,inquire=1,err=error); cout << " CPU = " << clock()-d << endl; error = error * coef; } ; cout << " CPU = " << clock()-cpu << endl; // for regtest real regvalue=int2d(Th)(u*u); cout<<"regvalue="<<regvalue<<endl; �������������������������������������������������������������������������������freefem++-3.61-1/examples++/Richard.edp�������������������������������������������������������������000644 �000767 �000024 �00000005461 13256636774 017643� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������real Ks=0.01, hg=30, thetas=0.3, eta = 6.55, m = 0.173, n = 2/(1-m); real z0=215; real q0=15/3600.; real dt=60; real hmax=0; // $A(h) - \partial h / \partial t - div(K(h)(\nabla(h-y)) = f $ dans $ \Omega$ // -K(h)(\nabla(h-y)). n = q0 $ sur $ \Gamma_1$ // h = h_0$ sur $\Gamma_0$ // + condition initial $d_d$ // A(h) = h <0 ? C(h) : 0; // // remarque z == y real xmax = 300, ymax=300, x0=60, y0= 215; border ba(t=0,ymax) { x=0; y=ymax-t ;label=2;}; // gauche border bb1(t=x0,0) { x=t; y=ymax ;label=1;}; // haut 1 border bb2(t=xmax,x0) { x=t; y=ymax ;label=2;}; // haut 2 border bc1(t=y0,0) { x=xmax; y=ymax-t ;label=2;}; // droite border bc2(t=ymax,y0) { x=xmax; y=ymax-t ;label=3;}; // droite border bd(t=0,xmax) { x=t; y=0; label=4;}; // bas int Gamma0=3; int Gamma1=1; int nn=20; int nn1=nn*x0/xmax,nn2=nn-nn1; int ny1=nn*y0/ymax,ny2=nn-ny1; plot(ba(nn)+bb1(nn1)+bb2(nn2)+bc1(ny1)+bc2(ny2)+bd(nn),wait=1); mesh Th=buildmesh(ba(nn)+bb1(nn1)+bb2(nn2)+bc1(ny1)+bc2(ny2)+bd(nn)); plot(Th,wait=1); fespace Vh(Th,P1); Vh h,v,hhh; macro theta(h) (thetas*(1+((abs(h)/hg))^n)^(-m))// macro dtheta(h) (m*n*thetas*(1+((abs(h)/hg))^n)^(-m-1)*(((abs(h)/hg))^(n-1))/hg) // macro A(h) ( (h<=0)* dtheta(h) ) // macro K(h) (Ks*((h<=0)*((theta(h)/thetas)^eta)+ (h>0))) // Vh hd= -y0+(ymax-y); // bof bof ???? Vh hn=hd,hh; Vh Ahdt,Kh; int nbiso=20; real[int] viso(3+(75+110/2)/5); {int k=0; for(int i=-75;i<0;i+=5) viso(k++)=i; viso(k++)=-0.5; viso(k++)=0.; viso(k++)=0.5; for(int i=5;i<=110;i+=5*2) viso(k++)=i; } /* problem Richard(h,v) = int2d(Th)( Ahdt * h * v+ Kh* (dx(h)*dx(v)+dy(h)*dy(v)) ) - int2d(Th)( Ahdt* hn*v - Kh* dy(v) ) - int1d(Th,Gamma1)(q0*v) + on(3,h=(ymax-y)-y0) ; */ real pena=1e10; problem Richard(h,v) = int2d(Th)( Ahdt * h * v+ Kh* (dx(h)*dx(v)+dy(h)*dy(v)) ) - int2d(Th)( Ahdt* hn*v - Kh* dy(v) ) - int1d(Th,Gamma1)(q0*v) +int1d(Th,3)(pena*h*v)-int1d(Th,3)(pena*((ymax-y)-y0)* v) ; plot(hn,wait=1,cmm=" hd "); Ahdt=0; Kh=1; // Richard; // plot(hd,wait=1,cmm="hd ----"); real temps=0; for(int i=0;i<100;i++) { string scmm="h + temps "+int(temps)/3600+"h "+ ((temps)%3600/60.) + "mn "; for(int k=0;k<3;k++) { Kh=K(h); Ahdt=A(h)/dt; cout << " "<< Kh[].min << " " << Kh[].max << endl; // plot(Ahdt,fill=1,value=1,wait=1,cmm="Ahdt"); // plot(Kh,fill=1,value=1,wait=1,cmm="Kh"); // plot(Kh,wait=1,cmm="Kh"); Richard; cout << " h: min " << h[].min << " max " << h[].max <<endl; hmax=h[].max ; // plot(h,wait=0,cmm=scmm,viso=viso); // hhh = h <0; } if(i%10==1) { Th=adaptmesh(Th,h,ratio=1.1); // plot(Th,h,cmm="h ",value=1,wait=1); } // plot(hhh,wait=1,cmm="h < 0"); plot(h,wait=0,cmm=scmm,viso=viso,value=1); // plot(h,cmm="h ",value=1); hn=h; temps += dt; } cout << " hmax = " << hmax << endl;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/parareal.edp������������������������������������������������������������000644 �000767 �000024 �00000006525 13256636774 020060� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������//int Nh=20; // d u /dt = cos(t), u= sin(t) + u0 // avec de methode para reel. // schema euler explicite // (u,v)' = (v,-u) // u_n+1 - u_n = v_n*dt, u_n+1 = u_n + v_n*dt // v_n+1 - v_n = -u_n*dt, // u=cos(t) u' = - sin(t) = v // v=sin(t), v' = cos(t) = u // ---------------------------- real DT=0.4; int nbT=50; // nb de big time step int ksub=50; // nb of small time step int Nbig=20; // max number of Big iteration real T0=0; // initial time real tol=1e-5; // tolerance // ---------------------------------------------------- int nbt=ksub*nbT; real dt=DT/ksub; // array for plotting real[int] pt(nbt+1),pT(nbT+1),pu(nbt+1),pU(nbT+1); // gros maillage mesh TH=square(3,3); // maillage fin mesh Th=trunc(TH,1,split=1); fespace VH(TH,P1); fespace Vh(Th,P1); int n=2; int N=2; func real Norm(real[int] & U) { return sqrt(square(U[10])+square(U[11])); } // restriction func bool h2H(real[int] & u,real[int] & U) { U=0; U[10+0]=u[0]; U[10+1]=u[1]; return true; } // prolongement func bool H2h(real[int] & U,real[int] & u) { u=0; u[0]=U[10+0]; u[1]=U[10+1]; return true; } func bool initG(real[int] & U) { U=0; U[10+0]=1;// cos(0) U[10+1]=0;// sin(0) } // un pas de temps FIN func bool F(real[int] & u,real[int] & up) { u[0] = up[0] + up[1]*dt; u[1] = up[1] - up[0]*dt; // cout << up[0] << " " << up[1] << endl; return true; } // pas de temps grossier func bool G(real[int] & U,real[int] & Up) { U[0+10] = Up[0+10] + Up[1+10]*DT; U[1+10] = Up[1+10] - Up[0+10]*DT; // cout << Up[10] << " " << Up[11] << endl; return true; } func bool AddGp(real[int] & U,int I) { pT[I]= T0+I*DT; pU[I]=U[10]; return true; } func bool AddFp(real[int] & u,int I,int i) { pt[I*ksub+i]= T0+I*DT+i*dt; pu[I*ksub+i]= u[0]; return true; } Vh ustart[nbT+1],uend[nbT]; // start VH Uend[nbT]; VH U0,U1; real t=T0,T=T0; // temps courant int it=0,iT=0; pt[it]=t; pT[iT]=T; initG(U0[]); AddGp(U0[],iT); H2h(U0[], ustart[iT][]); // initial for (int I=0;I<nbT;I++) { G(U1[],U0[]); U0[]=U1[]; Uend[I][]=U1[]; H2h(U0[],ustart[I+1][]); AddGp(U1[],I+1); } cout << pT.max << " " << pU.min << " " << pU.max << endl; real[int] exact(nbt+1),fu(nbt+1); { Vh u0,u1; u0[]=ustart[0][]; for (int i=0;i<=nbt;i++) { pt[i]=T0+i*dt; exact[i]=cos(pt[i]); F(u1[],u0[]); u0[]=u1[]; AddFp(u0[],0,i); } } fu=pu; plot([pT,pU],[pt,exact],[pt,fu],wait=1); // big loop for (int K=0;K< Nbig;K++) { // para real loop -- for (int I=0;I<nbT;I++) { Vh u0,u1; u0[]=ustart[I][]; AddFp(u0[],I,0); for (int i=0;i<ksub;i++) { F(u1[],u0[]); u0[]=u1[]; AddFp(u0[],I,i+1); } uend[I][]=u0[]; } plot([pT,pU],[pt,pu],[pt,exact],cmm="iteration "+K); // update loop ustart[K+1]=uend[K]; real err=0; for (int I=K+1;I<nbT;I++) { // Attention pb fin grossier VH U0,U1; h2H(ustart[I][],U0[]); AddGp(U0[],I); G(U1[],U0[]); AddGp(U1[],I+1); U0[]=U1[]; U1[] -=Uend[I][]; // U1=U1-U1(old) err += Norm(U1[]); Uend[I][]=U0[]; // save U1 Vh u1; H2h(U1[],u1[]); ustart[I+1][] = u1[]+ uend[I][] ; } cout << "\n\n big iteration " << K << " err= " << err << endl; if (err < tol) break; //plot([pT,pU],wait=1,clean=0); } plot([pt,pu],[pt,exact],[pt,fu],wait=1,cmm=" final fin"); plot([pT,pU],[pt,exact],[pt,fu],wait=1,cmm=" final grossier"); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/regtests.edp������������������������������������������������������������000644 �000767 �000024 �00000017064 13256636774 020131� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Regression tests // ---------------- // $Id$ // Regression tests // ---------------- // The tests are checked against reference values by "make check" in // each examples subdirectory // "ref.edp" contains all reference values and may be rebuilt with // "make Ref" // $Id$ // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. NoUseOfWait=true; int verbosityy=verbosity; include "ref.edp"; // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. cout << "--------- file : aadaptation.edp -----------------" << endl; verbosity=verbosityy; { include "aadaptation.edp"; real TESTaadaptation=regvalue; cout<<"aadaptation reference value = "<<REFaadaptation <<" test value ="<<TESTaadaptation<<endl; assert(TESTaadaptation<REFaadaptation*(1+0.1)); assert(TESTaadaptation>REFaadaptation*(1-0.1)); }; ; cout << "--------- file : aalapacien.edp -----------------" << endl; verbosity=verbosityy; { include "aalapacien.edp"; real TESTaalapacien=1+err; cout<<"aalapacien reference value = "<<REFaalapacien <<" test value ="<<TESTaalapacien<<endl; assert(TESTaalapacien<REFaalapacien*(1+0.00001)); assert(TESTaalapacien>REFaalapacien*(1-0.00001)); }; ; cout << "--------- file : aalaplace-nc.edp -----------------" << endl; verbosity=verbosityy; { include "aalaplace-nc.edp"; real TESTaalaplaceXnc=u[]'*u[]; cout<<"aalaplace-nc reference value = "<<REFaalaplaceXnc <<" test value ="<<TESTaalaplaceXnc<<endl; assert(TESTaalaplaceXnc<REFaalaplaceXnc*(1+0.1)); assert(TESTaalaplaceXnc>REFaalaplaceXnc*(1-0.1)); }; ; cout << "--------- file : aamove.edp -----------------" << endl; verbosity=verbosityy; { include "aamove.edp"; real TESTaamove=u[]'*u[]; cout<<"aamove reference value = "<<REFaamove <<" test value ="<<TESTaamove<<endl; assert(TESTaamove<REFaamove*(1+0.1)); assert(TESTaamove>REFaamove*(1-0.1)); }; ; cout << "--------- file : aaRT.edp -----------------" << endl; verbosity=verbosityy; { include "aaRT.edp"; real TESTaaRT=u1[]'*u1[]; cout<<"aaRT reference value = "<<REFaaRT <<" test value ="<<TESTaaRT<<endl; assert(TESTaaRT<REFaaRT*(1+0.1)); assert(TESTaaRT>REFaaRT*(1-0.1)); }; ; cout << "--------- file : arrayoFVh.edp -----------------" << endl; verbosity=verbosityy; { include "arrayoFVh.edp"; real TESTarrayoFVh=u[]'*u[]; cout<<"arrayoFVh reference value = "<<REFarrayoFVh <<" test value ="<<TESTarrayoFVh<<endl; assert(TESTarrayoFVh<REFarrayoFVh*(1+0.1)); assert(TESTarrayoFVh>REFarrayoFVh*(1-0.1)); }; ; cout << "--------- file : bilap.edp -----------------" << endl; verbosity=verbosityy; { include "bilap.edp"; real TESTbilap=xx(0:n)'*xx(0:n); cout<<"bilap reference value = "<<REFbilap <<" test value ="<<TESTbilap<<endl; assert(TESTbilap<REFbilap*(1+0.1)); assert(TESTbilap>REFbilap*(1-0.1)); }; ; cout << "--------- file : D2.edp -----------------" << endl; verbosity=verbosityy; { include "D2.edp"; real TESTD2=w[]'*w[]; cout<<"D2 reference value = "<<REFD2 <<" test value ="<<TESTD2<<endl; assert(TESTD2<REFD2+1e-20); assert(TESTD2>REFD2-1e-20); }; ; cout << "--------- file : demo1.edp -----------------" << endl; verbosity=verbosityy; { include "demo1.edp"; real TESTdemo1=u[]'*u[]; cout<<"demo1 reference value = "<<REFdemo1 <<" test value ="<<TESTdemo1<<endl; assert(TESTdemo1<REFdemo1*(1+0.1)); assert(TESTdemo1>REFdemo1*(1-0.1)); }; ; cout << "--------- file : demo.edp -----------------" << endl; verbosity=verbosityy; { include "demo.edp"; real TESTdemo=u[]'*u[]; cout<<"demo reference value = "<<REFdemo <<" test value ="<<TESTdemo<<endl; assert(TESTdemo<REFdemo*(1+0.1)); assert(TESTdemo>REFdemo*(1-0.1)); }; ; cout << "--------- file : funct.edp -----------------" << endl; verbosity=verbosityy; { include "funct.edp"; real TESTfunct=myfunction(1.0,3.); cout<<"funct reference value = "<<REFfunct <<" test value ="<<TESTfunct<<endl; assert(TESTfunct<REFfunct*(1+0.1)); assert(TESTfunct>REFfunct*(1-0.1)); }; ; cout << "--------- file : lapacienprecon.edp -----------------" << endl; verbosity=verbosityy; { include "lapacienprecon.edp"; real TESTlapacienprecon=u[]'*u[]; cout<<"lapacienprecon reference value = "<<REFlapacienprecon <<" test value ="<<TESTlapacienprecon<<endl; assert(TESTlapacienprecon<REFlapacienprecon*(1+0.1)); assert(TESTlapacienprecon>REFlapacienprecon*(1-0.1)); }; ; cout << "--------- file : lap_mat.edp -----------------" << endl; verbosity=verbosityy; { include "lap_mat.edp"; real TESTlapXmat=u1[]'*u1[]; cout<<"lap_mat reference value = "<<REFlapXmat <<" test value ="<<TESTlapXmat<<endl; assert(TESTlapXmat<REFlapXmat*(1+0.1)); assert(TESTlapXmat>REFlapXmat*(1-0.1)); }; ; cout << "--------- file : NSP1P1b.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P1b.edp"; real TESTNSP1P1b=int2d(Th)(square(u1)+square(u2)); cout<<"NSP1P1b reference value = "<<REFNSP1P1b <<" test value ="<<TESTNSP1P1b<<endl; assert(TESTNSP1P1b<REFNSP1P1b*(1+0.2)); assert(TESTNSP1P1b>REFNSP1P1b*(1-0.2)); }; ; cout << "--------- file : NSP1P1.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P1.edp"; real TESTNSP1P1=int2d(Th)(square(u1)+square(u2)); cout<<"NSP1P1 reference value = "<<REFNSP1P1 <<" test value ="<<TESTNSP1P1<<endl; assert(TESTNSP1P1<REFNSP1P1*(1+10)); assert(TESTNSP1P1>REFNSP1P1*(1-10)); }; ; cout << "--------- file : NSP1P2.edp -----------------" << endl; verbosity=verbosityy; { include "NSP1P2.edp"; real TESTNSP1P2=int2d(Th)(square(u1)+square(u2)); cout<<"NSP1P2 reference value = "<<REFNSP1P2 <<" test value ="<<TESTNSP1P2<<endl; assert(TESTNSP1P2<REFNSP1P2*(1+0.2)); assert(TESTNSP1P2>REFNSP1P2*(1-0.2)); }; ; cout << "--------- file : parareal.edp -----------------" << endl; verbosity=verbosityy; { include "parareal.edp"; real TESTparareal=pu'*pu; cout<<"parareal reference value = "<<REFparareal <<" test value ="<<TESTparareal<<endl; assert(TESTparareal<REFparareal*(1+0.1)); assert(TESTparareal>REFparareal*(1-0.1)); }; ; cout << "--------- file : Richard.edp -----------------" << endl; verbosity=verbosityy; { include "Richard.edp"; real TESTRichard=hmax; cout<<"Richard reference value = "<<REFRichard <<" test value ="<<TESTRichard<<endl; assert(TESTRichard<REFRichard*(1+0.1)); assert(TESTRichard>REFRichard*(1-0.1)); }; ; cout << "--------- file : teste.edp -----------------" << endl; verbosity=verbosityy; { include "teste.edp"; real TESTteste=P.x; cout<<"teste reference value = "<<REFteste <<" test value ="<<TESTteste<<endl; assert(TESTteste<REFteste*(1+0.1)); assert(TESTteste>REFteste*(1-0.1)); }; ; cout << "--------- file : testFE.edp -----------------" << endl; verbosity=verbosityy; { include "testFE.edp"; }; ; cout << "--------- file : wafer-heating-laser-axi.edp -----------------" << endl; verbosity=verbosityy; { include "wafer-heating-laser-axi.edp"; real TESTwaferXheatingXlaserXaxi=xx'*xx; cout<<"wafer-heating-laser-axi reference value = "<<REFwaferXheatingXlaserXaxi <<" test value ="<<TESTwaferXheatingXlaserXaxi<<endl; assert(TESTwaferXheatingXlaserXaxi<REFwaferXheatingXlaserXaxi*(1+0.1)); assert(TESTwaferXheatingXlaserXaxi>REFwaferXheatingXlaserXaxi*(1-0.1)); }; ; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/D2.edp������������������������������������������������������������������000644 �000767 �000024 �00000001054 13256636774 016526� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������int n = 40; mesh Th=square(n,n,[2*x-1,2*y-1]); fespace Xh(Th,P2); Xh x2=x^2,y2=y^2,xy=x*y; Xh w,ww; w=dxx(x2); cout << "dxx(x2) " << w[].max << " " << w[].min << endl; w=dyy(y2); cout << "dyy(y2) " << w[].max << " " << w[].min << endl; w=dyy(xy); cout << "dyy(xy) " << w[].max << " " << w[].min << endl; w=dxy(xy); cout << "dxy(xy) " << w[].max << " " << w[].min << endl; w=dyx(xy); cout << "dyx(xy) " << w[].max << " " << w[].min << endl; w=dyx(x2); cout << "dyx(x2) " << w[].max << " " << w[].min << endl; // for regtest real regvalue=int2d(Th)(w*w);������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/NSP1P2.edp��������������������������������������������������������������000644 �000767 �000024 �00000003754 13256636774 017215� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// remark: the sign of p is correct real s0=clock(); mesh Th=square(10,10); fespace Vh2(Th,P2); fespace Vh(Th,P1); Vh2 u2,v2,up1,up2; Vh2 u1,v1; Vh u1x=0,u1y,u2x,u2y, vv; real reylnods=1000; //cout << " Enter the reynolds number :"; cin >> reylnods; assert(reylnods>1 && reylnods < 100000); up1=0; up2=0; func g=(x)*(1-x)*4; Vh p=0,q; real alpha=0; real nu=1; int i=0,iter=0; real dt=0; solve NS ([u1,u2,p],[v1,v2,q],solver=Crout,init=i) = int2d(Th)( alpha*( u1*v1 + u2*v2) + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + p*q*(0.000001) - p*dx(v1) - p*dy(v2) - dx(u1)*q - dy(u2)*q ) + int2d(Th) ( -alpha*convect([up1,up2],-dt,up1)*v1 -alpha*convect([up1,up2],-dt,up2)*v2 ) + on(3,u1=g,u2=0) + on(1,2,4,u1=0,u2=0) ; plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="StokesP2P1.eps",value=1,wait=1); { real[int] xx(21),yy(21),pp(21); for (int i=0;i<21;i++) { yy[i]=i/20.; xx[i]=u1(0.5,i/20.); pp[i]=p(i/20.,0.999); } cout << " " << yy << endl; plot([xx,yy],wait=1,cmm="u1 x=0.5 cup"); plot([yy,pp],wait=1,cmm="pressure y=0.999 cup"); } dt = 0.1; int nbiter = 5; real coefdt = 0.25^(1./nbiter); real coefcut = 0.25^(1./nbiter) , cut=0.01; real tol=0.5,coeftol = 0.25^(1./nbiter); nu=1./reylnods; for (iter=1;iter<=nbiter;iter++) { cout << " dt = " << dt << " ------------------------ " << endl; alpha=1/dt; for (i=0;i<=50;i++) { up1=u1; up2=u2; NS; if ( !(i % 10)) plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="plotNS_"+iter+"_"+i+".eps"); cout << "CPU " << clock()-s0 << "s " << endl; } if (iter>= nbiter) break; Th=adaptmesh(Th,[dx(u1),dy(u1),dx(u1),dy(u2)], abserror=0,cutoff=cut,err=tol, inquire=0,ratio=1.5,hmin=1./1000); plot(Th,ps="ThNS.eps"); dt = dt*coefdt; tol = tol *coeftol; cut = cut *coefcut; } cout << "CPU " << clock()-s0 << "s " << endl; ��������������������freefem++-3.61-1/examples++/NSP1P1.edp��������������������������������������������������������������000644 �000767 �000024 �00000003512 13256636774 017204� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// correct pressure sign // correct for LU solver a -1r6*p*q term FH. mars/2018 Thank to armand.favrot@yahoo.fr real s0=clock(); mesh Th=square(10,10); fespace Vh2(Th,P1); fespace Vh(Th,P1); Vh2 u2,v2,up1,up2; Vh2 u1,v1; Vh u1x=0,u1y,u2x,u2y, vv; problem Pu1(u1x,vv,solver=CG) = int2d(Th)( u1x*vv) + int2d(Th)(-vv*u1); problem Pu2(u2x,vv,solver=CG) = int2d(Th)( u2x*vv) + int2d(Th)(-vv*u2); up1=0; up2=0; func g=(x)*(1-x)*4; Vh p=0,q; real alpha=0; real nu=1; int i=0,iter=0; real dt=0; solve NS (u1,u2,p,v1,v2,q,init=i) = int2d(Th)( alpha*( u1*v1 + u2*v2) + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + (dx(p)*dx(q)+dy(p)*dy(q))*(0.00001) // stabilization term - p*dx(v1) - p*dy(v2) - dx(u1)*q - dy(u2)*q - 1e-6*p*q ) + int2d(Th) ( -alpha*convect([up1,up2],-dt,up1)*v1 -alpha*convect([up1,up2],-dt,up2)*v2 ) + on(3,u1=g,u2=0) + on(1,2,4,u1=0,u2=0) ; plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],value=1); dt = 0.1; int nbiter = 3; real coefdt = 0.25^(1./nbiter); real coefcut = 0.25^(1./nbiter) , cut=0.4; real tol=0.5,coeftol = 0.5^(1./nbiter); nu=0.01; for (iter=0;iter<nbiter;iter++) { cout << " dt = " << dt << " ------------------------ " << endl; alpha=1/dt; for (i=0;i<=10;i++) { up1=u1; up2=u2; NS; if ( !(i % 10)) plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="plotNS_"+iter+"_"+i+".eps",value=1); cout << "CPU " << clock()-s0 << "s " << endl; } if (iter>= nbiter) break; u1x=0;u1y=0; Pu1;Pu2; plot([u1x,u2x],wait=1); Th=adaptmesh(Th,[u1x,u2x],abserror=0,cutoff=cut,err=tol, inquire=0); u1=u1; u2=u2; plot(Th); dt = dt*coefdt; tol = tol *coeftol; cut = cut *coefcut; } cout << "CPU " << clock()-s0 << "s " << endl; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/testadp.edp�������������������������������������������������������������000644 �000767 �000024 �00000003342 13256636774 017727� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// ----- real eps = 0.0001; real h=1; real hmin=0.05; func f = 10.0*x*x*x+y*y*y+h*atan2(eps,sin(5.0*y)-2.0*x); func fx = 30.0*x*x+h*2.0*eps/pow(sin(5.0*y)-2.0*x,2.0)/(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0)); func fy = 3.0*y*y-h*5.0*eps/pow(sin(5.0*y)-2.0*x,2.0)*cos(5.0*y)/(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0)); func fxy = h*(-20.0*eps/pow(sin(5.0*y)-2.0*x,3.0)*cos(5.0*y)/(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0)) +20.0*eps*eps*eps/pow(sin(5.0*y)-2.0*x,5.0)*cos(5.0*y)/pow(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0),2.0)); func fxx= 60.0*x+h*(8.0*eps/pow(sin(5.0*y)-2.0*x,3.0)/(1.0+eps*eps/pow(sin(5.0*y) -2.0*x,2.0))-8.0*eps*eps*eps/pow(sin(5.0*y)-2.0*x,5.0)/pow(1.0+eps*eps/pow(sin( 5.0*y)-2.0*x,2.0),2.0)); func d = fx*fy - fxy*fxy; func fyy= 6.0*y+h*(50.0*eps/pow(sin(5.0*y)-2.0*x,3.0)*pow(cos(5.0*y),2.0)/(1.0+ eps*eps/pow(sin(5.0*y)-2.0*x,2.0))+25.0*eps/pow(sin(5.0*y)-2.0*x,2.0)*sin(5.0*y )/(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0))-50.0*eps*eps*eps/pow(sin(5.0*y)-2.0*x ,5.0)*pow(cos(5.0*y),2.0)/pow(1.0+eps*eps/pow(sin(5.0*y)-2.0*x,2.0),2.0)); border cercle(t=0,2*pi){ x=cos(t);y=sin(t);} mesh Th=buildmesh(cercle(20)); fespace Ph(Th,P0); fespace Vh(Th,P1); fespace V2h(Th,P2); Vh fh=f; int i; real coef=10; for ( i=0;i<5;i++) { // Th=adaptmesh(Th,f); verbosity=4; Th=adaptmesh(Th,fxx*coef,fxy*coef,fyy*coef,IsMetric=1,nbvx=10000,hmin=hmin); fh=f; Ph e=abs(fh-f); Vh dh=(d>0)*2-1; plot(Th,fh,dh,wait=1); plot(e,fill=1,value=1,wait=1); savemesh(Th,"Th"+i+".mesh"); savemesh(Th,"Thh"+i,[x,y,fh/2]); { ofstream file("Th"+i+".gbb"); file << "2 1 1 "<< fh[].n << " 2 \n"; int j; for (j=0;j<fh[].n ; j++) { file << fh[][j] << endl; } } if(!NoGraphicWindow) exec("ffmedit `pwd`/Thh"+i); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/Makefile.am�������������������������������������������������������������000644 �000767 �000024 �00000002761 13256636774 017631� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ all-local: all.edp regtests.edp freefem++.pref TESTS=aadaptation.edp aalapacien.edp aalaplace-nc.edp aamove.edp aaRT.edp arrayoFVh.edp bilap.edp D2.edp demo1.edp demo.edp funct.edp lapacienprecon.edp lap_mat.edp NSP1P1b.edp NSP1P1.edp NSP1P2.edp parareal.edp Richard.edp teste.edp testFE.edp wafer-heating-laser-axi.edp renumbering.edp LOG_DRIVER=$(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT=TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw 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 \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ done) > $@ # To create a new set of reference values in "ref.edp" clean-local: -rm *.fg *.eps *~ *.ps Th?.faces Th?.points Th?.BB Th?.mesh.gmsh ListOf?llocPtr*.bin ffglut*.ppm toto.txt Ref: makeref.edp ../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: ���������������freefem++-3.61-1/examples++/demo.edp����������������������������������������������������������������000644 �000767 �000024 �00000002307 13256636774 017207� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������border aaa(t=0,1){x=t;y=0;label=1;}; border bbb(t=0,0.5){x=1;y=t;label=2;}; border ccc(t=0,0.5){x=1-t;y=0.5;label=3;}; border ddd(t=0.5,1){x=0.5;y=t;label=4;}; border eee(t=0.5,1){x=1-t;y=1;label=5;}; border fff(t=0,1){x=0;y=1-t;label=6;}; mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6)); mesh Th2 = movemesh(Th,[x+1.1,y]); fespace Vh(Th,P1); fespace Vh2(Th2,P2); fespace Vh21(Th2,P1); Vh u,v,zero; Vh2 u2,v2; Vh21 dxu2,dyu2; u=0; u2=0; zero=0; func f= 1; func g= 0; int i=0; real error=0.1, coef= 0.1^(1./5.); problem Probem1(u,v,solver=CG,init=i,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(1,2,3,4,5,6,u=g) ; problem Probem2(u2,v2,solver=CG,init=i,eps=-1.0e-6) = int2d(Th2)( dx(u2)*dx(v2) + dy(u2)*dy(v2)) + int2d(Th2) ( v2*f ) + on(1,2,3,4,5,6,u2=g) ; real cpu=clock(); for (i=0;i< 10;i++) { real d = clock(); Probem1; Probem2; plot(Th,u,Th2,u2,wait=1); Th=adaptmesh(Th,u,inquire=1,err=error); dxu2=dx(u2); dyu2=dy(u2); Th2=adaptmesh(Th2,dxu2,dyu2,inquire=1,err=error,ratio=1.5,hmin=1e-5); cout << " CPU = " << clock()-d << endl; error = error * coef; } ; cout << " CPU = " << clock()-cpu << endl; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/teste.edp���������������������������������������������������������������000644 �000767 �000024 �00000006260 13256636774 017411� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // routine func real myfunction(real a,real b) { real z =a+b; return z; }; { real[int] matx(10),b(10),x(10); func real[int] mat(real[int] &x) { int i; for (i=0;i<x.n;i++) matx[i]=(i+1)*x[i]; matx -= b; // sub the right hand side return matx; // return of global variable ok }; func real[int] matId(real[int] &x) { return x;}; b=1; x=0; // set right hand side and initial gest LinearCG(mat,x,eps=1.e-6,nbiter=20,precon=matId); cout << x; for (int i=0;i<x.n;i++) assert(abs(x[i]*(i+1) - b[i]) < 1e-5); b=1; x=0; // set right hand side and initial gest NLCG(mat,x,eps=1.e-6,nbiter=20,precon=matId); cout << x; for (int i=0;i<x.n;i++) assert(abs(x[i]*(i+1) - b[i]) < 1e-5); }; cout << myfunction(1.0,3.) << " " << myfunction(1,3) << endl; // a array { border a(t=0,1){x=t;y=0;}; border b(t=0,0.5){x=1;y=t;}; border c(t=0,0.5){x=1-t;y=0.5;}; border d(t=0.5,1){x=0.5;y=t;}; border e(t=0.5,1){x=1-t;y=1;}; border f(t=0,1){x=0;y=1-t;}; mesh th = buildmesh ( a(6) + b(4) + c(4) +d(4) + e(4) + f(6)); plot(th,wait=1,fill=1); }; cout << (1==2) * 3. + (1==1)*4. << endl; real [int] tab(10), tab1(10); // 2 array of 10 real // real [int] tab2; // bug tab = 1; // set all the array to 1 tab[1]=2; cout << tab[1] << " " << tab[9] << " size of tab = " << tab.n << endl; tab1=tab; tab=tab+tab1; tab=2*tab+tab1*5; tab1=2*tab-tab1*5; tab+=tab; cout << tab << endl; cout << tab[1] << " " << tab[9] << endl; real [string] map; // a dynamique array cout << "-------------------------------------------------------------" << endl; x=cos(0.1); y=1.1; z=2.1; cout << z << " == " << P << endl; {real z; func f=z+1; z=1; cout << " entre z=?" ; //cin >> z; cout << " z = " << z << " f=" << f << endl;}; { mesh Th = square(5,5); fespace Vh(Th); // P1 Vh uh; uh=2*x+10*y; // do P1 interpolation x=0.5; y=0.9; real uhxy=uh; // get the value of uh at point (x,y)= 0.5,0.9 cout << "uh at (0.5,0.9) =" << uhxy << endl; }; { ofstream f("toto.txt"); f << "coucou'\n"; }; { ofstream f("toto.txt",append); f << "add coucou'\n"; }; // no current mesh map["1"]=2.0; map[2]=3.0; // 2 is automaticaly cast to the string "2" cout << " map[\"1\"] = " << map["1"] << "; "<< endl; cout << " map[2] = " << map[2] << "; "<< endl; { real a,b,c; int i,j,k; }; string str,str1; str="abc+"; str1="+abcddddd+"; str=str + str1; str = str + 2 ; cout << "str= " << str << "== abc++abcddddd+2;\n"; real x=3.14,y; int i,j; complex c; cout << " x = " << x << "\n"; x = 1;y=2; x=y; i=0;j=1; cout << 1 + 3 << "\n"; cout << 10 ^10 << "\n"; cout << 10 ^-10 << "\n"; cout << -10^-2+5 << "== 4.99 \n"; cout << 10^-2+5 << "== 5.01 \n"; cout << "------------------ complex ---- \n" ; cout << 10-10i << " \n"; cout << " -1^(1/3) = " << (-1+0i)^(1./3.) << " \n"; cout << " 8^(1/3)= " << (8)^(1./3.) << " \n"; cout << " sqrt(-1) = " << sqrt(-1+0i) << " \n"; cout << " ++i =" << ++i ; cout << " i=" << i << "\n"; cout << " i++ = "<< i++ << "\n"; cout << " i = " << i << "\n"; cout << " for (i=0;i<10;i=i+1) \n"; for (int i=0;i<100;i=i+1) { if (i>=10) break; real a=i; tab[i] = i*i; if (i>5) continue; cout << i << " " << tab[i] << "\n"; }; R3 P; P.x=1; x=P.x; cout << P.x << "\n"; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/aalapacien.edp����������������������������������������������������������000644 �000767 �000024 �00000002016 13256636774 020336� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbosity=4; mesh Th=square(10,10,[10*x,5*y]); fespace Vh(Th,P1); Vh u,v; u=0; func f= 0; func g= 5*x+y; int i=0; real error=0.1, coef= 0.1^(1./5.); // exact solution is g in this exemple : // remark $dg/dn = -1$ on $Gamma_1$ (lower side) $n=(0,-1)$ // remark $dg/dn = 5$ on $Gamma_2$ (left side) $n=(1,0)$ // u + du/dn = g - 1 , because du // $$ - \Delta u = 0,\quad u_{|\Gamma_3 \cup \Gamma_4} = g, \frac{\partial u}{\partial n} + u = g-1 \mbox{on}\Gamma_4$$ problem Probem1(u,v,solver=LU,init=i,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int1d(Th,1) ( u*v ) // $ \frac{\partial u}{\partial n} + u = \ldots $ + int1d(Th,1) ( (+1-g)*v) // $ \ldots = g-1 $ + int2d(Th) ( v*f ) + int1d(Th,2) (-5*v) // $ \frac{\partial u}{\partial n} = 5 $ + on(3,4,u=g) ; real cpu=clock(); Probem1; // SOLVE THE PROBLEM 1 plot(u); real err= sqrt( int2d(Th)( (u-g)^2) ); cout << "err L^2=" << err <<endl; assert(err<1e-5); // check the solution cout << " CPU = " << clock()-cpu << endl; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/all.edp�����������������������������������������������������������������000644 �000767 �000024 �00000016113 13256711244 017015� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������NoUseOfWait=true;int verbosityy=verbosity; cout << "--------- file : D2.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "D2.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : FE-medit.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "FE-medit.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : NSP1P1.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "NSP1P1.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : NSP1P1b.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "NSP1P1b.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : NSP1P2.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "NSP1P2.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : Richard.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "Richard.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : Stokes-P1nc-P0+P1.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "Stokes-P1nc-P0+P1.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aaRT.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aaRT.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aaa-adp.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aaa-adp.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aadaptation.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aadaptation.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aalapacien.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aalapacien.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aalaplace-nc.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aalaplace-nc.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : aamove.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "aamove.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : arrayoFVh.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "arrayoFVh.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : bilap.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "bilap.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : ccc-adp.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "ccc-adp.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : demo.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "demo.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : demo1.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "demo1.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : funct.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "funct.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : include.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "include.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : lap_mat.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "lap_mat.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : lapacienprecon.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "lapacienprecon.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : parareal.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "parareal.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : renumbering.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "renumbering.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : testFE.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "testFE.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : testadp.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "testadp.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : teste.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "teste.edp";}; cout << "------------------------------------------------------------------------------ " << endl; cout << "--------- file : wafer-heating-laser-axi.edp --------------------------------------------------------" << endl; verbosity=verbosityy; { include "wafer-heating-laser-axi.edp";}; cout << "------------------------------------------------------------------------------ " << endl; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/arrayoFVh.edp�����������������������������������������������������������000644 �000767 �000024 �00000001677 13256636774 020175� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbosity=1; mesh Th=square(5,5); fespace Vh(Th,P1); Vh u,v; real[int] X(9); // array of 9 real X=5; // fill X with 1 cout << " norme^2 of X " << sqrt(X' * X) << " == 15 \n"; Vh[int] uu(10); // array of 10 solution /* to do mesh[int] aTh(10); // array of 10 meshes aTh[1]= square(2,2); */ int i; for ( i=0;i<10;i++) uu[i]=x+i*y; func f= 0; func g= x*x+y*y*2; u=0; // dcl the problem and solve solve a(u,v,solver=CG) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(1,2,3,4,u=g+i); cout << "-------------------" << endl; plot(u); // exemple de calcul de semi norme H_1 varf lap(u,v) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v) ); matrix A= lap(Vh,Vh); cout << " (semi norme H^1)^2 of u =" << (v[]=A*u[])' * u[] << endl; cout << " (semi norme H^1)^2 of u =" << int2d(Th)( dx(u)*dx(u) + dy(u)*dy(u) ) << endl; for ( i=0;i<10;i++) cout << "|x +"<< i <<"y|_H_1 = " << sqrt((v[]=A*uu[i][])' * uu[i][]) << endl; �����������������������������������������������������������������freefem++-3.61-1/examples++/NSP1P1b.edp�������������������������������������������������������������000644 �000767 �000024 �00000004036 13256636774 017350� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// remark: the sign of p is correct real s0=clock(); mesh Th=square(20,20); Th=adaptmesh(Th,1./20.,IsMetric=1,splitpbedge=1); fespace Vh2(Th,P1b); fespace Vh(Th,P1); Vh2 u2,v2,up1,up2; Vh2 u1,v1; Vh u1x=0,u1y,u2x,u2y, vv; real reylnods=400; //cout << " Enter the reynolds number :"; cin >> reylnods; assert(reylnods>1 && reylnods < 100000); up1=0; up2=0; func g=(x)*(1-x)*4; Vh p=0,q; real alpha=0; real nu=1; int i=0,iter=0; real dt=0; solve NS ([u1,u2,p],[v1,v2,q],solver=Crout,init=i) = int2d(Th)( alpha*( u1*v1 + u2*v2) + nu * ( dx(u1)*dx(v1) + dy(u1)*dy(v1) + dx(u2)*dx(v2) + dy(u2)*dy(v2) ) + p*q*(0.000001) - p*dx(v1) - p*dy(v2) - dx(u1)*q - dy(u2)*q ) + int2d(Th) ( -alpha*convect([up1,up2],-dt,up1)*v1 -alpha*convect([up1,up2],-dt,up2)*v2 ) + on(3,u1=g,u2=0) + on(1,2,4,u1=0,u2=0) ; plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="StokesP2P1.eps",value=1,wait=1); { real[int] xx(21),yy(21),pp(21); for (int i=0;i<21;i++) { yy[i]=i/20.; xx[i]=u1(0.5,i/20.); pp[i]=p(i/20.,0.999); } cout << " " << yy << endl; plot([xx,yy],wait=1,cmm="u1 x=0.5 cup"); plot([yy,pp],wait=1,cmm="pressure y=0.999 cup"); } dt = 0.05; int nbiter = 3; real coefdt = 0.25^(1./nbiter); real coefcut = 0.25^(1./nbiter) , cut=0.01; real tol=0.5,coeftol = 0.5^(1./nbiter); nu=1./reylnods; for (iter=1;iter<=nbiter;iter++) { cout << " dt = " << dt << " ------------------------ " << endl; alpha=1/dt; for (i=0;i<=50;i++) { up1=u1; up2=u2; NS; if ( !(i % 10)) plot(coef=0.2,cmm=" [u1,u2] et p ",p,[u1,u2],ps="plotNS_"+iter+"_"+i+".eps"); cout << "CPU " << clock()-s0 << "s " << endl; } if (iter>= nbiter) break; Th=adaptmesh(Th,[dx(u1),dy(u1),dx(u1),dy(u2)],splitpbedge=1,abserror=0,cutoff=cut,err=tol, inquire=0,ratio=1.5,hmin=1./1000); plot(Th,ps="ThNS.eps"); dt = dt*coefdt; tol = tol *coeftol; cut = cut *coefcut; } cout << "CPU " << clock()-s0 << "s " << endl; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/funct.edp���������������������������������������������������������������000644 �000767 �000024 �00000000352 13256636774 017400� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // routine func int fi(real a1) { int i=a1*a1/1; return i; }; func real myfunction(real a,real b) { real aa=a; real z =fi(aa)+b; return z; }; // appele cout << myfunction(1.0,3.) << " " << myfunction(1,3) << endl; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/wafer-heating-laser-axi.edp���������������������������������������������000644 �000767 �000024 �00000010653 13256636774 022672� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// simulation of wafer heating by a laser. /************************************************************** From: Fabian Dortu Materials and Components Analysis group (MCA) SPDT division IMEC, Kapeldreef 75, B-3001 Leuven, Belgium tel: +32/16 28 8774 e-mail: Fabian.Dortu@imec.be <mailto:Fabian.Dortu@imec.be> **************************************************************/ // The poisson equation (here the heat equation) is solved in cylindrical coordinates: // $ \Delta u = 1/r \partial_r(r \partial_r u) + \partial_{zz} u + 1/r^2 \partial_{\theta^2} u $ // so the variationnal formulation is after integer on the 3d cylinder // rotation invariant given $\partial_{\theta} u =0$ // $ - \Delta u = f $ // on the 1/2 plan $ \theta =0$ // $ \int r ( \partial_r u \partial_r v + \partial_z u \partial_z v ) = \int r f v - \int_{\Gamma} r \partial_n u v $ // the radial coordinate 'r' is called 'x'. // the depth coordinate 'z' is called 'y'. // The wafer stuck is a rectangle with upper left corner at (0,0) // and lower right corner at (radius,-thickness) // The laser beam it the surface from top to bottom at the center (0,0). // The units assumed for the distance is the micrometer (um) //*********************** //*** User parameters *** //*********************** real radius=1000; // the wafer radius (um) real thick=600; // the wafer thickness (um) real thC=1.5e-4; // the thermal conductivity (W/K/um) real beamr=2; // the laser beam radius (in the sens of a gaussian) real refl=0.55; // reflection coefficient Air/Silicon real Eg=1.12; // Band gap of Silicon (eV) real En=1.49; // Energy of laser (eV) - must be greater than Eg. real I0=1e-2; // Laser beam intensity (W/um^2) real alpha=0.2; // absorption coefficient (um^-1) func f=I0 * (1-refl) * (En-Eg)/En * alpha * exp(alpha*y) * exp(-x*x/beamr/beamr); // the heat generation function: a laser beam of radius 'beamr' // lateral shape is gaussian. // in depth shape is decreasing exponential because of absorption. real g=300; // temperature at right and bottom surfaces (in Kelvin) //******************************** //*** Geometry/Mesh definition *** //******************************** //--- less basic mesh --- border bottom1(t=0,radius/5) {x=t; y=-thick; label=1;} border bottom2(t=radius/5,radius) {x=t; y=-thick; label=2;} border right1(t=-thick,0) {x=radius; y=t; label=3;}; // 'right' actually means external surface border top1(t=radius,radius/5*3) {x=t; y=0; label=4;}; border top2(t=radius/5*3,radius/5) {x=t; y=0; label=5;} border top3(t=radius/5,0) {x=t; y=0; label=6;}; border left1(t=0,-thick/5) {x=0; y=t; label=7;}; // 'left' actually means center of cylinder border left2(t=-thick/5,-thick) {x=0; y=t; label=8;}; // 'left' actually means center of cylinder mesh Th = buildmesh ( bottom1(20) + bottom2(10) + right1(20) + top1(10) + top2(20) + top3(50) + left1(50) + left2(25) ); plot(Th,wait=1,fill=1,ps="wafer_mesh2.eps"); //savemesh(Th,"wafer_stuck.msh"); //************************** //*** Problem definition *** //************************** fespace Vh(Th,P1); Vh u,v,zero; u=0; // The temperature variable. v=0; // The weight function. zero=0; // used to set initial condition int i=0; // variable used for mesh reconstruction real error=0.1, coef=0.1^(1./5.); //--- Variational Form ---- problem Problem1(u,v,solver=CG,init=i,eps=1.0e-8) = int2d(Th) ( x*dx(u)*dx(v) + x*dy(u)*dy(v) ) + int2d(Th) ( -v*x*f/thC ) // the source term = laser heating + on( 1,2,3,u=g ) ; // fixed temperature at bottom and right surface. //************* //*** Solve *** //************* real cpu=clock(); cout << "***USER*** " << "Begin solve/adapt iterations" << endl; for (i=0;i<10;i++) { cout << "***USER*** " << "Iteration number: " << i << endl; real d = clock(); Problem1; plot(u,wait=1); Th=adaptmesh(Th,u,inquire=1,err=error); cout << " CPU = " << clock()-d << endl; error = error * coef; } ; plot(Th,wait=1,bb=[[0,0],[-10,-10]],nbiso=20,ps="adaptedmesh.eps"); // plot the last adapted mesh plot(u,wait=1,bb=[[0,0],[-10,-10]],nbiso=20,ps="temperature.eps"); // plot the solution //Plot a cut section at r=0 real[int] xx(10),yy(10); for (i=0;i<10;i++) { x=0.; y=i/10.; // this line is used by the next one xx[i]=i; yy[i]=u; // value of u at point (0. , i/10.) } plot([xx,yy],ps="likegnu.eps",wait=true); cout << " CPU = " << clock()-cpu << endl; �������������������������������������������������������������������������������������freefem++-3.61-1/examples++/FE-medit.edp������������������������������������������������������������000644 �000767 �000024 �00000001166 13256636774 017657� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������int n=20,nn=n+10; real[int] xx(nn),yy(nn); // build square $]-1,1[^2$ mesh Th2=square(2,2,[2*x-1,2*y-1]); mesh Th=square(100,100,[2*x-1,2*y-1]); fespace Wh(Th2,P0edge); Wh w=0; fespace Vh(Th,P1); w[]=0; w[][6]=1; Vh u=w; plot(u,Th2,wait=1); savemesh(Th,"mm",[x,y,u*.5]); // save mm.points and mm.faces file for medit // build a mm.bb file { ofstream file("mm.bb"); file << "2 1 1 "<< u[].n << " 2 \n"; int j; for (j=0;j<u[].n ; j++) file << u[][j] << endl; } // call ffmedit command if(!NoGraphicWindow) exec("ffmedit mm"); // clean files exec("rm mm.bb mm.faces mm.points"); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/ccc-adp.edp�������������������������������������������������������������000644 �000767 �000024 �00000003232 13256636774 017553� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// ----- real eps = 0.0001; real h=1; real hmin=0.000005; real val=50; real coef=50; // err = 1/100 int nbiter=10,firstplot=3; func f = y*x*x+y*y*y+h*tanh(val*(sin(5.0*y)-2.0*x)); ofstream fff("err.dat"); cout << atanh(1) << endl; func fx = .0*y*x-0.2E1*h*(1.0-pow(tanh(val*(sin(0.5E1*y)-0.2E1*x)),2.0))*val; func fy = x*x+3.0*y*y+0.5E1*h*(1.0-pow(tanh(val*(sin(0.5E1*y)-0.2E1*x)),2.0))*val*cos(0.5E1*y); func fxy = 2.0*(x*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)+10.0*h*val*val*cos(5.0*y) *sinh(val*sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); func fxx= 2.0*(y*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)-4.0*h*val*val *sinh(val*sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); func d = fx*fy - fxy*fxy; func fyy=(6.0*y*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)-50.0*h*val*val* pow(cos(5.0*y),2.0)*sinh(val*sin(5.0*y)-2.0*val*x)-25.0*h*val*sin(5.0*y)*cosh(val* sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); border cercle(t=0,2*pi){ x=cos(t);y=sin(t);} mesh Th=buildmesh(cercle(20)); fespace Ph(Th,P0); fespace Vh(Th,P1); fespace V2h(Th,P2); Vh fh=f; plot(fh,wait=0); // real err; for (int i=0;i<nbiter;i++) { // Th=adaptmesh(Th,f); verbosity=4; Vh fxxh=fxx, fxyh=fxy, fyyh = fyy; cout << " min max f_xx : " << fxxh[].min << " " << fxxh[].max << endl; cout << " min max f_yy : " << fyyh[].min << " " << fyyh[].max << endl; cout << " min max f_xy : " << fxyh[].min << " " << fxyh[].max << endl; Th=adaptmesh(Th,f,err=0.1); fh=f; err=sqrt(int2d(Th)(square(fh-f))); fff << i<< " " << err << " " << Th.nt << " " << Th.nv << endl; } // for regtest real regvalue=err; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/regtests.m4�������������������������������������������������������������000644 �000767 �000024 �00000002130 13256636774 017665� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Regression tests // ---------------- // $Id$ include(../regtests.m4) // The values tested here may not have a physical or mathematical // meaning. Their main property is to gather numerical values from the // whole domain, to be checked for consistency with previous runs. dnl (syntax of ONETEST macro defined in ../regtests.m4) ONETEST(aadaptation,regvalue,0.1); ONETEST(aalapacien,1+err,0.00001); ONETEST(aalaplace-nc,u[]'*u[],0.1); ONETEST(aamove,u[]'*u[],0.1); ONETEST(aaRT,u1[]'*u1[],0.1); ONETEST(arrayoFVh,u[]'*u[],0.1); ONETEST(bilap,xx(0:n)'*xx(0:n),0.1); ONETEST(D2,w[]'*w[],1e-20,1e-20); ONETEST(demo1,u[]'*u[],0.1); ONETEST(demo,u[]'*u[],0.1); ONETEST(funct,myfunction(1.0,3.),0.1); ONETEST(lapacienprecon,u[]'*u[],0.1); ONETEST(lap_mat,u1[]'*u1[],0.1); ONETEST(NSP1P1b,int2d(Th)(square(u1)+square(u2)),0.2); ONETEST(NSP1P1,int2d(Th)(square(u1)+square(u2)),10); ONETEST(NSP1P2,int2d(Th)(square(u1)+square(u2)),0.2); ONETEST(parareal,pu'*pu,0.1); dnl alh - 30/6/04 - unstable? ONETEST(Richard,hmax,0.1); ONETEST(teste,P.x,0.1); ONETEST(testFE); ONETEST(wafer-heating-laser-axi,xx'*xx,0.1); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/include.edp�������������������������������������������������������������000644 �000767 �000024 �00000000116 13256636774 017702� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ include "funct.edp"; cout << " ---------- \n"; } { include "aamove.edp"; }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/aamove.edp��������������������������������������������������������������000644 �000767 �000024 �00000001320 13256636774 017525� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbosity=4; border a(t=0,1){x=t;y=0;label=1;}; border b(t=0,0.5){x=1;y=t;label=1;}; border c(t=0,0.5){x=1-t;y=0.5;label=1;}; border d(t=0.5,1){x=0.5;y=t;label=1;}; border e(t=0.5,1){x=1-t;y=1;label=1;}; border f(t=0,1){x=0;y=1-t;label=1;}; func uu= sin(y*pi)/10; func vv= cos(x*pi)/10; mesh Th = buildmesh ( a(6) + b(4) + c(4) +d(4) + e(4) + f(6)); Th=movemesh(Th,[x+uu,y+vv]); plot(Th,wait=1,fill=1); fespace Vh(Th,P2); Vh u,v; u=0; func ff= 1; func gg= 0; int i=0; problem Probem1(u,v,solver=LU,init=i,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*ff ) + on(1,u=gg) ; real cpu=clock(); Probem1; // SOLVE THE PROBLEM 1 plot(u,wait=1); cout << " CPU = " << clock()-cpu << endl; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/demo1.edp���������������������������������������������������������������000644 �000767 �000024 �00000002261 13256636774 017267� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������border aaa(t=0,1){x=t;y=0;label=1;}; border bbb(t=0,0.5){x=1;y=t;label=2;}; border ccc(t=0,0.5){x=1-t;y=0.5;label=3;}; border ddd(t=0.5,1){x=0.5;y=t;label=4;}; border eee(t=0.5,1){x=1-t;y=1;label=5;}; border fff(t=0,1){x=0;y=1-t;label=6;}; mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6)); // mesh Th2 = movemesh(Th,[x+1.1,y]); fespace Ph(Th,P0); fespace Vh(Th,P1); fespace Vh2(Th,P2); fespace Vh21(Th,P1); Vh u,v,zero; Vh2 u2,v2; Vh21 dxu2,dyu2; Ph eh; u=0; u2=0; zero=0; func f= 1; func g= 0; int i=0; real error=0.1, coef= 0.1^(1./5.); problem Probem1(u,v,solver=CG,init=i,eps=-1.0e-6) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(1,2,3,4,5,6,u=g) ; problem Probem2(u2,v2,solver=CG,init=i,eps=-1.0e-6) = int2d(Th)( dx(u2)*dx(v2) + dy(u2)*dy(v2)) + int2d(Th) ( v2*f ) + on(1,2,3,4,5,6,u2=g) ; real cpu=clock(); for (i=0;i< 10;i++) { real d = clock(); Probem1; Probem2; plot(Th,u,wait=1); eh= abs(u-u2); plot(Th,eh,fill=1,wait=1); Th=adaptmesh(Th,u,inquire=1,err=error,anisomax=1e6); cout << " CPU = " << clock()-d << endl; error = error * coef; } ; cout << " CPU = " << clock()-cpu << endl; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/testFE.edp��������������������������������������������������������������000644 �000767 �000024 �00000002350 13256636774 017453� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������real regtest;// for FFCS regression tests // exact solution is [x*x,y] -Delta [x*x,y] = [-2,0] // This exemple is buggus before version 1.26 { // test of product of same FE verbosity = 2; mesh Th=square(2,2); fespace Vh(Th,P2); Vh uHx=0; Vh uHy=0; Vh vHx; Vh vHy; solve deuxlap([uHx,uHy],[vHx,vHy],solver=CG) = int2d(Th)( dx(uHx)*dx(vHx) + dy(uHx)*dy(vHx) + dx(uHy)*dx(vHy) + dy(uHy)*dy(vHy) ) - int2d(Th)( -2* vHx ) + on(1,2,3,4,uHx=x*x,uHy=y); // plot(uHx, uHy,wait=1); real err2= sqrt( int2d(Th)(square(uHx-x*x)+square(uHy-y))); cout << " Error in L2 norme " << err2 << endl ; assert(err2 < 1e-10); } { // test of product of different FE verbosity = 2; mesh Th=square(2,2); fespace Vh(Th,P2); fespace Vh1(Th,P1); Vh uHx=0; Vh1 uHy=0; Vh vHx; Vh1 vHy; solve deuxlap([uHx,uHy],[vHx,vHy],solver=CG) = int2d(Th)( dx(uHx)*dx(vHx) + dy(uHx)*dy(vHx) + dx(uHy)*dx(vHy) + dy(uHy)*dy(vHy) ) - int2d(Th)( -2* vHx ) + on(1,2,3,4,uHx=x*x,uHy=y); // plot(uHx, uHy,wait=1); real err2= sqrt( int2d(Th)(square(uHx-x*x)+square(uHy-y))); cout << " Error in L2 norme " << err2 << endl ; assert(err2 < 1e-10); regtest=err2; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/Makefile.in�������������������������������������������������������������000644 �000767 �000024 �00000113417 13321623167 017624� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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. @SET_MAKE@ # $Id$ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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@ subdir = examples++ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acmacros.m4 \ $(top_srcdir)/acoptim.m4 $(top_srcdir)/ax_lib_hdf5.m4 \ $(top_srcdir)/ax_lib_gsl.m4 $(top_srcdir)/acmpi.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PACKAGE_NAME = @ADD_PACKAGE_NAME@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARFLAGS = @ARFLAGS@ ARPACKLIB = @ARPACKLIB@ ARPACKLIBS = @ARPACKLIBS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BAMGPROG = @BAMGPROG@ BIN_ffmaster = @BIN_ffmaster@ BLASINC = @BLASINC@ BLASLIBS = @BLASLIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGSF77 = @CFLAGSF77@ CNOFLAGS = @CNOFLAGS@ COMPILE_OPENBLAS = @COMPILE_OPENBLAS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXX11FLAGS = @CXX11FLAGS@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOWNLOADCOMPILE = @DOWNLOADCOMPILE@ DOWNLOADED_BLAS = @DOWNLOADED_BLAS@ DOWNLOADED_BLAS_BUILT_SOURCES = @DOWNLOADED_BLAS_BUILT_SOURCES@ DOWNLOAD_ARPACK = @DOWNLOAD_ARPACK@ DOWNLOAD_FFTW = @DOWNLOAD_FFTW@ DOWNLOAD_UMFPACK = @DOWNLOAD_UMFPACK@ DYLIB_SUFFIX = @DYLIB_SUFFIX@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EIGENOBJ = @EIGENOBJ@ ENABLE_FFCS = @ENABLE_FFCS@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFGLUTNAME = @FFGLUTNAME@ FFGLUTPROG = @FFGLUTPROG@ FFLAGS = @FFLAGS@ FF_HAVE_REGEX_H = @FF_HAVE_REGEX_H@ FF_LAPACKdir = @FF_LAPACKdir@ FF_MALLOC_H = @FF_MALLOC_H@ FF_SECOND = @FF_SECOND@ FF_UMFPACK_CONFIG = @FF_UMFPACK_CONFIG@ FLIBS = @FLIBS@ FNOFLAGS = @FNOFLAGS@ G2CLIB = @G2CLIB@ GCCNOCYGWIN = @GCCNOCYGWIN@ GREP = @GREP@ GSL_CFLAGS = @GSL_CFLAGS@ GSL_CONFIG = @GSL_CONFIG@ GSL_LIBS = @GSL_LIBS@ H5CC = @H5CC@ H5FC = @H5FC@ HDF5_CC = @HDF5_CC@ HDF5_CFLAGS = @HDF5_CFLAGS@ HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ HDF5_FC = @HDF5_FC@ HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_FLIBS = @HDF5_FLIBS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ HDF5_VERSION = @HDF5_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERNEL_VERSION = @KERNEL_VERSION@ LAPACKLIBS = @LAPACKLIBS@ LAPACK_arpack_LIB = @LAPACK_arpack_LIB@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBC_VERSION = @LIBC_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSGLUT = @LIBSGLUT@ LIBSNOCONSOLE = @LIBSNOCONSOLE@ LIBSPTHREAD = @LIBSPTHREAD@ LOAD_COMPILE = @LOAD_COMPILE@ LOAD_TESTS = @LOAD_TESTS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MEDITPROG = @MEDITPROG@ MKDIR_P = @MKDIR_P@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIFC = @MPIFC@ MPIPROG = @MPIPROG@ MPIRUN = @MPIRUN@ MPISCRIPT = @MPISCRIPT@ MPI_INCLUDE = @MPI_INCLUDE@ MPI_INC_DIR = @MPI_INC_DIR@ MPI_LIB = @MPI_LIB@ MPI_LIBC = @MPI_LIBC@ MPI_LIBFC = @MPI_LIBFC@ MPI_LIB_DIRS = @MPI_LIB_DIRS@ NO_RANGE_CHECK = @NO_RANGE_CHECK@ OBJEXT = @OBJEXT@ OPTIM_TYPE = @OPTIM_TYPE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PASTIX_HOSTARCH = @PASTIX_HOSTARCH@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RANLIN = @RANLIN@ SCOTCH_INCLUDE = @SCOTCH_INCLUDE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZEOF_INT = @SIZEOF_INT@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_PTR = @SIZEOF_PTR@ SIZEOF_PTRINBIT = @SIZEOF_PTRINBIT@ SKIP_TESTS_EIGEN = @SKIP_TESTS_EIGEN@ SKIP_TESTS_MPI = @SKIP_TESTS_MPI@ STATICTOOL = @STATICTOOL@ STDPROG = @STDPROG@ STD_GRAPH_OBJ = @STD_GRAPH_OBJ@ STD_LDFLAGS = @STD_LDFLAGS@ STD_LIBS = @STD_LIBS@ STRIP = @STRIP@ TEST_FFPP = @TEST_FFPP@ TEST_FFPPMPI = @TEST_FFPPMPI@ TEST_FFPP_MPI = @TEST_FFPP_MPI@ TOOL_COMPILE_MMAP = @TOOL_COMPILE_MMAP@ TOOL_COMPILE_NewSolver = @TOOL_COMPILE_NewSolver@ TOOL_COMPILE_blaslapack = @TOOL_COMPILE_blaslapack@ TOOL_COMPILE_fftw3_mpi = @TOOL_COMPILE_fftw3_mpi@ TOOL_COMPILE_gmm = @TOOL_COMPILE_gmm@ TOOL_COMPILE_gsl = @TOOL_COMPILE_gsl@ TOOL_COMPILE_hips = @TOOL_COMPILE_hips@ TOOL_COMPILE_hpddm = @TOOL_COMPILE_hpddm@ TOOL_COMPILE_iohdf5 = @TOOL_COMPILE_iohdf5@ TOOL_COMPILE_ipopt = @TOOL_COMPILE_ipopt@ TOOL_COMPILE_lapack = @TOOL_COMPILE_lapack@ TOOL_COMPILE_metis = @TOOL_COMPILE_metis@ TOOL_COMPILE_mmg3d = @TOOL_COMPILE_mmg3d@ TOOL_COMPILE_mshmet = @TOOL_COMPILE_mshmet@ TOOL_COMPILE_mumps = @TOOL_COMPILE_mumps@ TOOL_COMPILE_mumps_seq = @TOOL_COMPILE_mumps_seq@ TOOL_COMPILE_nlopt = @TOOL_COMPILE_nlopt@ TOOL_COMPILE_pardiso = @TOOL_COMPILE_pardiso@ TOOL_COMPILE_parmetis = @TOOL_COMPILE_parmetis@ TOOL_COMPILE_parms = @TOOL_COMPILE_parms@ TOOL_COMPILE_pastix = @TOOL_COMPILE_pastix@ TOOL_COMPILE_petsc = @TOOL_COMPILE_petsc@ TOOL_COMPILE_petsccomplex = @TOOL_COMPILE_petsccomplex@ TOOL_COMPILE_pipe = @TOOL_COMPILE_pipe@ TOOL_COMPILE_ptscotch = @TOOL_COMPILE_ptscotch@ TOOL_COMPILE_scalapack = @TOOL_COMPILE_scalapack@ TOOL_COMPILE_scotch = @TOOL_COMPILE_scotch@ TOOL_COMPILE_suitesparse = @TOOL_COMPILE_suitesparse@ TOOL_COMPILE_superlu4 = @TOOL_COMPILE_superlu4@ TOOL_COMPILE_superludist = @TOOL_COMPILE_superludist@ TOOL_COMPILE_tetgen = @TOOL_COMPILE_tetgen@ TOOL_COMPILE_umfpack = @TOOL_COMPILE_umfpack@ TOOL_COMPILE_yams = @TOOL_COMPILE_yams@ TOOL_DYLIB_MMAP = @TOOL_DYLIB_MMAP@ TOOL_DYLIB_NewSolver = @TOOL_DYLIB_NewSolver@ TOOL_DYLIB_gmm = @TOOL_DYLIB_gmm@ TOOL_DYLIB_gsl = @TOOL_DYLIB_gsl@ TOOL_DYLIB_hips = @TOOL_DYLIB_hips@ TOOL_DYLIB_hpddm = @TOOL_DYLIB_hpddm@ TOOL_DYLIB_iohdf5 = @TOOL_DYLIB_iohdf5@ TOOL_DYLIB_ipopt = @TOOL_DYLIB_ipopt@ TOOL_DYLIB_lapack = @TOOL_DYLIB_lapack@ TOOL_DYLIB_mmg3d = @TOOL_DYLIB_mmg3d@ TOOL_DYLIB_mshmet = @TOOL_DYLIB_mshmet@ TOOL_DYLIB_mumps = @TOOL_DYLIB_mumps@ TOOL_DYLIB_mumps_seq = @TOOL_DYLIB_mumps_seq@ TOOL_DYLIB_nlopt = @TOOL_DYLIB_nlopt@ TOOL_DYLIB_pardiso = @TOOL_DYLIB_pardiso@ TOOL_DYLIB_parmetis = @TOOL_DYLIB_parmetis@ TOOL_DYLIB_parms = @TOOL_DYLIB_parms@ TOOL_DYLIB_pastix = @TOOL_DYLIB_pastix@ TOOL_DYLIB_pipe = @TOOL_DYLIB_pipe@ TOOL_DYLIB_scotch = @TOOL_DYLIB_scotch@ TOOL_DYLIB_superlu4 = @TOOL_DYLIB_superlu4@ TOOL_DYLIB_superludist = @TOOL_DYLIB_superludist@ TOOL_DYLIB_tetgen = @TOOL_DYLIB_tetgen@ TOOL_DYLIB_umfpack = @TOOL_DYLIB_umfpack@ TOOL_DYLIB_yams = @TOOL_DYLIB_yams@ UMFPACKLIBS = @UMFPACKLIBS@ UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ VERSION = @VERSION@ WGET = @WGET@ WIN32DLLTARGET = @WIN32DLLTARGET@ WINDRESOBJ = @WINDRESOBJ@ WITH_CXX11 = @WITH_CXX11@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ff_bison = @ff_bison@ ff_curl = @ff_curl@ ff_flex = @ff_flex@ ff_git = @ff_git@ ff_libtool = @ff_libtool@ ff_m4 = @ff_m4@ ff_patch = @ff_patch@ ff_prefix_dir = @ff_prefix_dir@ ff_prefix_dir_etc = @ff_prefix_dir_etc@ ff_prefix_dir_example = @ff_prefix_dir_example@ ff_prefix_dir_include = @ff_prefix_dir_include@ ff_prefix_dir_lib = @ff_prefix_dir_lib@ ff_prefix_dir_lib_mpi = @ff_prefix_dir_lib_mpi@ ff_unzip = @ff_unzip@ ff_wget = @ff_wget@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = aadaptation.edp aalapacien.edp aalaplace-nc.edp aamove.edp aaRT.edp arrayoFVh.edp bilap.edp D2.edp demo1.edp demo.edp funct.edp lapacienprecon.edp lap_mat.edp NSP1P1b.edp NSP1P1.edp NSP1P2.edp parareal.edp Richard.edp teste.edp testFE.edp wafer-heating-laser-axi.edp renumbering.edp LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff TESTS_ENVIRONMENT = TEST_FFPP=$(TEST_FFPP) FLAGS_FFPP=-nw EXTRA_DIST = *.edp all.edp regtests.edp regtests.m4 ref.edp all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples++/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples++/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 $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? aadaptation.edp.log: aadaptation.edp @p='aadaptation.edp'; \ b='aadaptation.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) aalapacien.edp.log: aalapacien.edp @p='aalapacien.edp'; \ b='aalapacien.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) aalaplace-nc.edp.log: aalaplace-nc.edp @p='aalaplace-nc.edp'; \ b='aalaplace-nc.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) aamove.edp.log: aamove.edp @p='aamove.edp'; \ b='aamove.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) aaRT.edp.log: aaRT.edp @p='aaRT.edp'; \ b='aaRT.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) arrayoFVh.edp.log: arrayoFVh.edp @p='arrayoFVh.edp'; \ b='arrayoFVh.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) bilap.edp.log: bilap.edp @p='bilap.edp'; \ b='bilap.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) D2.edp.log: D2.edp @p='D2.edp'; \ b='D2.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) demo1.edp.log: demo1.edp @p='demo1.edp'; \ b='demo1.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) demo.edp.log: demo.edp @p='demo.edp'; \ b='demo.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) funct.edp.log: funct.edp @p='funct.edp'; \ b='funct.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) lapacienprecon.edp.log: lapacienprecon.edp @p='lapacienprecon.edp'; \ b='lapacienprecon.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) lap_mat.edp.log: lap_mat.edp @p='lap_mat.edp'; \ b='lap_mat.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) NSP1P1b.edp.log: NSP1P1b.edp @p='NSP1P1b.edp'; \ b='NSP1P1b.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) NSP1P1.edp.log: NSP1P1.edp @p='NSP1P1.edp'; \ b='NSP1P1.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) NSP1P2.edp.log: NSP1P2.edp @p='NSP1P2.edp'; \ b='NSP1P2.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) parareal.edp.log: parareal.edp @p='parareal.edp'; \ b='parareal.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) Richard.edp.log: Richard.edp @p='Richard.edp'; \ b='Richard.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) teste.edp.log: teste.edp @p='teste.edp'; \ b='teste.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) testFE.edp.log: testFE.edp @p='testFE.edp'; \ b='testFE.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) wafer-heating-laser-axi.edp.log: wafer-heating-laser-axi.edp @p='wafer-heating-laser-axi.edp'; \ b='wafer-heating-laser-axi.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) renumbering.edp.log: renumbering.edp @p='renumbering.edp'; \ b='renumbering.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); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-TESTS check-am clean \ clean-generic clean-local cscopelist-am ctags-am distclean \ distclean-generic 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 pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile all-local: all.edp regtests.edp freefem++.pref all.edp: (echo "NoUseOfWait=true;int verbosityy=verbosity;"; \ for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \ echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\ echo "verbosity=verbosityy;" ; \ echo \{ include \"$$i\"\;\}\; ;\ echo ' cout << "------------------------------------------------------------------------------ " << endl;' ;\ done) > $@ # To create a new set of reference values in "ref.edp" clean-local: -rm *.fg *.eps *~ *.ps Th?.faces Th?.points Th?.BB Th?.mesh.gmsh ListOf?llocPtr*.bin ffglut*.ppm toto.txt Ref: makeref.edp ../src/nw/FreeFem++-nw makeref.edp makeref.edp: regtests.m4 ../regtests.m4 m4 regtests.m4 > makeref.edp freefem++.pref: echo loadpath = \"../examples++-load/\" >freefem++.pref echo loadpath += \"./\" >>freefem++.pref # To check the scripts against their reference values regtests.edp: regtests.m4 ../regtests.m4 m4 -DASSERT regtests.m4 > regtests.edp FORCE: # 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/aaa-adp.edp�������������������������������������������������������������000644 �000767 �000024 �00000004360 13256636774 017550� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������// ----- real eps = 0.0001; real h=1; real hmin=0.000005; real val=10; real coef=50; // err = 1/100 int nbiter=6,firstplot=3; func f = y*x*x+y*y*y+h*tanh(val*(sin(5.0*y)-2.0*x)); cout << atanh(1) << endl; func fx = .0*y*x-0.2E1*h*(1.0-pow(tanh(val*(sin(0.5E1*y)-0.2E1*x)),2.0))*val; func fy = x*x+3.0*y*y+0.5E1*h*(1.0-pow(tanh(val*(sin(0.5E1*y)-0.2E1*x)),2.0))*val*cos(0.5E1*y); func fxy = 2.0*(x*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)+10.0*h*val*val*cos(5.0*y) *sinh(val*sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); func fxx= 2.0*(y*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)-4.0*h*val*val *sinh(val*sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); func d = fx*fy - fxy*fxy; func fyy=(6.0*y*pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0)-50.0*h*val*val* pow(cos(5.0*y),2.0)*sinh(val*sin(5.0*y)-2.0*val*x)-25.0*h*val*sin(5.0*y)*cosh(val* sin(5.0*y)-2.0*val*x))/pow(cosh(val*sin(5.0*y)-2.0*val*x),3.0); border cercle(t=0,2*pi){ x=cos(t);y=sin(t);} mesh Th=buildmesh(cercle(20)); fespace Ph(Th,P0); fespace Vh(Th,P1); fespace V2h(Th,P2); Vh fh=f; plot(fh,wait=0); // for (int i=0;i<nbiter;i++) { // Th=adaptmesh(Th,f); verbosity=4; Vh fxxh=fxx, fxyh=fxy, fyyh = fyy; cout << " min max f_xx : " << fxxh[].min << " " << fxxh[].max << endl; cout << " min max f_yy : " << fyyh[].min << " " << fyyh[].max << endl; cout << " min max f_xy : " << fxyh[].min << " " << fxyh[].max << endl; Th=adaptmesh(Th,fxx*coef,fxy*coef,fyy*coef,IsMetric=1,nbvx=10000,hmin=hmin,ratio = 5, nbsmooth = 0, omega = 1); fh=f; Ph e=log10(abs(fh-f)); Vh dh=(d>0)*2-1; plot(Th,fh,dh); real[int] vviso(20); for (int i=0;i<20;i++) vviso[i]=(-20+i)/2.; cout << " min max fh " << fh[].min << " " << fh[].max << endl; cout << " min max log(e) " << e[].min << " " << e[].max << endl; if (i>=firstplot) { plot(e,fill=1,value=1,wait=0,viso=vviso,cmm="log10(e) err="+1./coef); savemesh(Th,"Thh"+i+".mesh"); savemesh(Th,"Th"+i,[x,y,fh/2]); { Vh eh=e; ofstream file("Th"+i+".BB"); file << "2 1 1 "<< fh[].n << " 2 \n"; int j; for (j=0;j<fh[].n ; j++) { file << eh[][j] << endl; } } if(!NoGraphicWindow) exec("ffmedit `pwd`/Th"+i); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/bilap.edp���������������������������������������������������������������000644 �000767 �000024 �00000001237 13256636774 017353� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������int n=100,nn=n+10; real[int] xx(nn),yy(nn); mesh Th=square(40,40); // mesh definition of $\Omega$ fespace Vh(Th,P1); // finite element space macro laplacien(u,v) (dx(u)*dx(v)+dy(u)*dy(v)) // fin macro real f=1; Vh u,uu,v,vv; solve bilap([u,uu],[v,vv],solver=sparsesolver,eps=1.0e-6) = int2d(Th)( laplacien(u,vv)+uu*vv // - Delta u + uu =0 (vv) + laplacien(uu,v) ) // - Delta uu = 1 (v) - int2d(Th)(f*v) + on(1,2,3,4,u=0); // => v=0 also on 1,2,3,4 plot(u,wait=1); for (int i=0;i<=n;i++) { xx[i]=real(i)/n; yy[i]=u(0.5,real(i)/n); // value of uh at point (0.5, i/10.) } plot([xx(0:n),yy(0:n)],wait=1); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/aalaplace-nc.edp��������������������������������������������������������000644 �000767 �000024 �00000000601 13256636774 020557� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ mesh Th=square(10,10); fespace Vh(Th,P1nc); Vh u,v; u=0; plot(u); func f= 0; func g= x*x+y*y*2; u=0; int i=0; // dcl the problem problem a(u,v,solver=CG,init=i) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v)) + int2d(Th) ( v*f ) + on(1,2,3,4,u=g+i); cout << "-------------------" << i << endl; i++; a; // solve the problem cout << "-------------------" << endl; plot(u); �������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples++/aaRT.edp����������������������������������������������������������������000644 �000767 �000024 �00000003302 13256636774 017106� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbosity=4; mesh Th=square(10,10,[10*x,5*y]); fespace Vh(Th,RT0); fespace Rh(Th,RT0Ortho); fespace Ph(Th,P0); Vh [u1,u2],[v1,v2]; Rh [r1,r2]; Ph p,q; cout << 1. / 2. << endl; [u1,u2]= [1+x,2+y]; [r1,r2]= [-2-y,1+x]; // verification of the finite function cout << " [u1,u2] = ["<< u1(1,2) << "," << u2(1,2) << "] == [2,4] \n"; cout << "dx([u1,u2]) = ["<< dx(u1)(1,2) << "," << dx(u2)(1,2) << "] == [1,0] \n"; cout << "dy([u1,u2]) = ["<< dy(u1)(1,2) << "," << dy(u2)(1,2) << "] == [0,1] \n"; // verification of the finite function cout << " [r1,r2] = ["<< r1(1,2) << "," << r2(1,2) << "] == [-4,2] \n"; cout << "dx([r1,r2]) = ["<< dx(r1)(1,2) << "," << dx(r2)(1,2) << "] == [0,1] \n"; cout << "dy([r1,r2]) = ["<< dy(r1)(1,2) << "," << dy(r2)(1,2) << "] == [-1,0] \n"; plot(u1,u2,[u1,u2],wait=1); plot(r1,r2,[r1,r2],wait=1); problem Probem1(u1,u2,v1,v2,solver=LU,eps=-1.0e-6) = int2d(Th)( u1*v1+u2*v2 + dx(u1)*v1+ u2*dx(v2)) + int2d(Th) ( x*v1+y*v2 + v1 + y*dx(v2) ) + on(1,2,3,4,u1=-x,u2=-y) ; problem Probem2(p,q,solver=LU,eps=-1.0e-6) = int2d(Th)( p*q ) + int2d(Th) ( q ) ; cout << " probem 1 \n"; Probem1; // solve problem1 cout << " probem 2 \n"; Probem2; // solve problem2 plot(u1,u2,[u1,u2]); problem lap(u1,u2,p,v1,v2,q,solver=LU,eps=1.0e-30) = int2d(Th)( p*q*1e-10+ u1*v1 + u2*v2 + p*(dx(v1)+dy(v2)) + (dx(u1)+dy(u2))*q ) + int2d(Th) ( q) + int1d(Th)( (v1*N.x +v2*N.y)/-2); cout << " lap RT \n"; lap; plot([u1,u2],wait=1); plot(p,fill=1,wait=1); cout << " int2d(Th)(p-0.5) " << int2d(Th)(p-0.5) << " == 0 " << endl; cout << " int2d(Th)(x+y) " << int2d(Th)(x+y) << " == " << (10*5)*(10+5)/2 << endl; cout << " -------------\n\n " << endl; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/quadloop/������������������������������������������������������������000755 �000767 �000024 �00000000000 13321644107 020147� 5����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/test/����������������������������������������������������������������000755 �000767 �000024 �00000000000 13321644107 017302� 5����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/��������������������������������������������������������������000755 �000767 �000024 �00000000000 13321644107 017623� 5����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/�������������������������������������������������������������000755 �000767 �000024 �00000000000 13321644107 017250� 5����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/naca.awk�����������������������������������������������������000644 �000767 �000024 �00000001644 13256636774 020705� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������END { Pi=3.14159265358979; i20=20; i8=8; r = 5; c0x = 1; c0y=0; print "Dimension",2; print "MaximalAngleOfCorner 46"; print "Vertices",i20+i20+i8; # the vertex on naca012 wing ( clock wise) for (i=-i20;i<i20;i++) { x = i/i20; x = x^4; t = 1.008930411365*x; y = 5*.12*(0.2969*sqrt(t) - 0.126*t - 0.3516*t^2 + 0.2843*t^3 - 0.1015*t^4); if(i<0) y=-y; print x,y,3;} # vertex on circle (counter clock wise) for (i=0;i<i8;i++) { t=i*Pi*2/i8; print c0x+r*(cos(t)),c0y+r*sin(t),5;} print "Edges",i20+i20+i8; # edge on wing k = 1 j = i20+i20-1; # previous points for (i=0;i<i20+i20;j=i++) { print j+k,i+k,3;} # previous, current vertex # edge on circle k = i20+i20+1; j = i8-1;# previous points for (i=0;i<i8;j=i++) { print k+j,k+i,5;} # previous, current vertex # one subdomain, region on left side of the wing # because clock wise sens. print "SubDomain",1; print 2,1,1,0; } ��������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/adap.sh������������������������������������������������������000755 �000767 �000024 �00000005040 13256636774 020535� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eu # the -e option to stop on error # we are with awk to do real operation in the shell # bamg=../../bamg NSC2KE=s/NSC2KE # for awk because in french the number 1/1000 is written 0,001 not 0.001 # to be sure the RADIXCHAR is '.' (cf. Native Language Support) LANG=C export LANG # some VAR ifin=20 j=0 INIT=0 LastIteration=0 NBITER=500 # --------- HMIN=1e-6 HMINGLOBAL=$HMIN HCOEF=1 # ------- ERR=0.1 ERRCOEF=0.8608916593317348 ERRGLOBAL=0.01 # ----------- # end of some parameters # ---------- # clean of the output file rm -f [A-Z]* # create the geometry file awk -f naca.awk </dev/null >MESH_g.msh # create the initial mesh MESH_0.amdba $bamg -g MESH_g.msh -o MESH_$j.msh -hmax 1 -oamdba MESH_$j.amdba while [ $j -lt $ifin ] ; do # i = j + 1 i=`expr $j + 1` # LastIteration = LastIteration + NBITER LastIteration=`expr $LastIteration + $NBITER` ## set the current MESH rm -f MESH ln -s MESH_$j.amdba MESH ## create the DATA file for NSC2KE form file data ## change 2 lines for initialisation rm -f DATA sed -e "s/^INIT/$INIT/" -e "s/^LastIteration/$LastIteration/" <data >DATA echo "--------- NSC2KE iteration $j -----------" $NSC2KE ## find the nb of vertices in the file MESH nbv=`head -1 MESH|awk '{print $1}'` ## create the bb file for interpolation echo "2 4 $nbv 2" > SOL_$j.bb cat SOL_NS >> SOL_$j.bb ## create the bb file for metric construction ## in file SOL_NS on each line i we have ro ro*u ro*v energy ## at vertex i ## + a last line with 2 number last iteration and last time echo "2 1 $nbv 2" > MACH.bb awk 'NF==4 { print sqrt($2*$2+$3*$3)/$1}' SOL_NS >> MACH.bb ## put all the residual in one file cat RESIDUAL >>RESIDU ## set HMIN = MAX($HMINGLOBAL,$HMIN*$HCOEF) HMIN=`awk "END {c=$HMIN*$HCOEF;c=c<$HMINGLOBAL ?$HMINGLOBAL:c; print c};" </dev/null` ERR=`awk "END {c=$ERR*$ERRCOEF;c=c<$ERRGLOBAL ?$ERRGLOBAL:c; print c};" </dev/null` echo " -b MESH_$j.msh -err $ERR -errg 0.05 -AbsError -hmin $HMIN -hmax 1 -Mbb SOL_$j.bb -o MESH_$i.msh -oamdba MESH_$i.amdba -raison 2.5 -rbb SOL_$j.bb -splitpbedge -maxsubdiv 1.8 -wbb INIT_$i.bb -v 4 ">DATA_bamg echo --- bamg parameters --- cat DATA_bamg echo ---------------------- $bamg ## creation of the INIT_NS for NSC2KE ## remove fisrt line form bb file and add the last line of SOL_NS sed 1d <INIT_$i.bb >INIT_NS tail -1 SOL_NS >>INIT_NS # change i and not initialisation j=$i INIT=1 done ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/adap.sh-g����������������������������������������������������000755 �000767 �000024 �00000004743 13256636774 020772� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eu # the -e option to stop on error # we are with awk to do real operation in the shell # bamg=../../bamg-g NSC2KE=s/NSC2KE # for awk because in french the number 1/1000 is written 0,001 not 0.001 # to be sure the RADIXCHAR is '.' (cf. Native Language Support) LANG=C export LANG # some VAR ifin=20 j=0 INIT=0 LastIteration=0 NBITER=500 HMIN=0.05 HMINGLOBAL=0.0005 HCOEF=0.8 # clean of the output file rm -f [A-Z]* # create the geometry file awk -f naca.awk </dev/null >MESH_g.msh # create the initial mesh MESH_0.amdba echo -- $bamg -g MESH_g.msh -o MESH_$j.msh -hmax 2 -oamdba MESH_$j.amdba $bamg -g MESH_g.msh -o MESH_$j.msh -hmax 2 -oamdba MESH_$j.amdba while [ $j -lt $ifin ] ; do # i = j + 1 i=`expr $j + 1` # LastIteration = LastIteration + NBITER LastIteration=`expr $LastIteration + $NBITER` ## set the current MESH rm -f MESH ln -s MESH_$j.amdba MESH ## create the DATA file for NSC2KE form file data ## change 2 lines for initialisation rm -f DATA sed -e "s/^INIT/$INIT/" -e "s/^LastIteration/$LastIteration/" <data >DATA echo "--------- NSC2KE iteration $j -----------" $NSC2KE ## find the nb of vertices in the file MESH nbv=`head -1 MESH|awk '{print $1}'` ## create the bb file for interpolation echo "2 4 $nbv 2" > SOL_$j.bb cat SOL_NS >> SOL_$j.bb ## create the bb file for metric construction ## in file SOL_NS on each line i we have ro ro*u ro*v energy ## at vertex i ## + a last line with 2 number last iteration and last time echo "2 1 $nbv 2" > MACH.bb awk 'NF==4 { print sqrt($2*$2+$3*$3)/$1}' SOL_NS >> MACH.bb ## put all the residual in one file cat RESIDUAL >>RESIDU ## set HMIN = MAX($HMINGLOBAL,$HMIN*$HCOEF) HMIN=`awk "END {c=$HMIN*$HCOEF;c=c<$HMINGLOBAL ?$HMINGLOBAL:c; print c};" </dev/null` echo ----- echo $bamg -b MESH_$j.msh -err 0.001 -errg 0.05 -AbsError '\\' echo -hmin $HMIN -hmax 3 -Mbb MACH.bb -o MESH_$i.msh '\\' echo -oamdba MESH_$i.amdba -raison 2 -rbb SOL_$j.bb -wbb INIT_$i.bb $bamg -b MESH_$j.msh -err 0.001 -errg 0.05 -AbsError \ -hmin $HMIN -hmax 3 -Mbb MACH.bb -o MESH_$i.msh \ -oamdba MESH_$i.amdba -raison 2 -rbb SOL_$j.bb -wbb INIT_$i.bb ## creation of the INIT_NS for NSC2KE ## remove fisrt line form bb file and add the last line of SOL_NS sed 1d <INIT_$i.bb >INIT_NS tail -1 SOL_NS >>INIT_NS # change i and not initialisation j=$i INIT=1 done �����������������������������freefem++-3.61-1/examples-bamg/NACA012/ad.sh��������������������������������������������������������000755 �000767 �000024 �00000004556 13256636774 020227� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eu # the -e option to stop on error # we are with awk to do real operation in the shell # bamg=../../bamg-g NSC2KE=s/NSC2KE # for awk because in french the number 1/1000 is written 0,001 not 0.001 # to be sure the RADIXCHAR is '.' (cf. Native Language Support) LANG=C export LANG # some VAR ifin=2 j=0 INIT=0 LastIteration=0 NBITER=50 HMIN=0.05 HMINGLOBAL=0.0005 HCOEF=0.8 # clean of the output file rm -f [A-Z]* # create the geometry file awk -f naca.awk </dev/null >MESH_g.msh # create the initial mesh MESH_0.amdba $bamg -g MESH_g.msh -o MESH_$j.msh -hmax 2 -oamdba MESH_$j.amdba while [ $j -lt $ifin ] ; do # i = j + 1 i=`expr $j + 1` # LastIteration = LastIteration + NBITER LastIteration=`expr $LastIteration + $NBITER` ## set the current MESH rm -f MESH ln -s MESH_$j.amdba MESH ## create the DATA file for NSC2KE form file data ## change 2 lines for initialisation rm -f DATA sed -e "s/^INIT/$INIT/" -e "s/^LastIteration/$LastIteration/" <data >DATA echo "--------- NSC2KE iteration $j -----------" $NSC2KE ## mv the GNU file for file in GNU.MACH GNU.MESH GNU.PRES GNU.TEMP GNU.TURB GNU.VECT;do mv -f $file $file.$j done ## find the nb of vertices in the file MESH nbv=`head -1 MESH|awk '{print $1}'` ## create the bb file for interpolation echo "2 4 $nbv 2" > SOL_$j.bb cat SOL_NS >> SOL_$j.bb ## create the bb file for metric construction ## in file SOL_NS on each line i we have ro ro*u ro*v energy ## at vertex i ## + a last line with 2 number last iteration and last time echo "2 1 $nbv 2" > MACH.bb awk 'NF==4 { print sqrt($2*$2+$3*$3)/$1}' SOL_NS >> MACH.bb ## put all the residual in one file cat RESIDUAL >>RESIDU ## set HMIN = MAX($HMINGLOBAL,$HMIN*$HCOEF) HMIN=`awk "END {c=$HMIN*$HCOEF;c=c<$HMINGLOBAL ?$HMINGLOBAL:c; print c};" </dev/null` echo -b MESH_$j.msh -err 0.001 -errg 0.05 -AbsError \ -hmin $HMIN -hmax 3 -Mbb MACH.bb -o MESH_$i.msh \ -oamdba MESH_$i.amdba -raison 2 -rbb SOL_$j.bb -wbb INIT_$i.bb \ -maxsubdiv 2 > DATA_bamg $bamg ## creation of the INIT_NS for NSC2KE ## remove fisrt line form bb file and add the last line of SOL_NS sed 1d <INIT_$i.bb >INIT_NS tail -1 SOL_NS >>INIT_NS # change i and not initialisation j=$i INIT=1 done ��������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/plot.fv������������������������������������������������������000644 �000767 �000024 �00000003022 13256636774 020602� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ listing character*20 MMMM,MACH,SOL, chari integer nbv,dim,nbfield dynamique mach(*),sol(*,*) real aaa,bbb integer i,j MMMM = ' ' MACH = ' ' do i = 0,19 destroy all c exec('./MkMach '//charac(i)) MMMM = 'MESH_'//charac(i) MACH = 'MACH_'//charac(i) SOL = 'SOL_'//charac(i) print *,'"',MACH,'" "',SOL,'"' readg emc2 MMMM print *,'"',MACH,'" "',SOL,'"' readg bb SOL print *,'--------' look : 1 emc2 D2 MMMM print *,'1 --------' sizeof SOL nbfield ,nbv,dim print *,'2 --------',nbv,dim,nbfield new sol(nbfield,nbv) get SOL sol print *,'3 --------' new mach(nbv) aaa=0 bbb=1000 do j=1,nbv mach(j) = sqrt(sol(1,j)**2 + sol(2,j)**2) aaa=max(aaa,mach(j)) bbb=min(bbb,mach(j)) enddo print *,'min = ',bbb,' max = ',aaa,' ------------------' print *,'----------------------------------------------' set ssom D2 scal MACH mach nbv how2look faces_vues how2look line_skin zoomp 1, 41.74853, 45.43906, 50.96038, 56.97087 refresh exec('rm '// MMMM(1:index(MMMM,' ')-1) //'.ps '//MACH(1:index(MACH,' ')-1)//'.ps') ! soft_copy 'np nlogo ncadre v x10 y7 f'//MMMM ! refresh look : 1 scal D2 MACH with isovalue number 50 from 1 to 1.5 ! bw zoomp 1, 41.74853, 45.43906, 50.96038, 56.97087 ! refresh ! how2look no_skin refresh with isovalue drawing with isovalue filling soft_copy 'np color nlogo ncadre v x10 y7 f'//MACH ! soft_copy 'np nlogo ncadre v x10 y7 f'//MACH free sol free mach enddo print *,' ON A FINI ET OUI' end ; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/data-orign���������������������������������������������������000644 �000767 �000024 �00000002677 13256636774 021256� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������0 --> =0 2D, =1 AXISYMMETRIC 0 --> =0 Euler, =1 Navier-Stokes 1.e2 --> Reynolds by meter (the mesh is given in meter) 0. --> inverse of Froude number (=0 no gravity) 0.8 --> inflow Mach number 1. --> ratio pout/pin 1 --> wall =1 newmann b.c.(adiabatic wall), =2 (isothermal wall) 300. --> inflow temperature (in Kelvin) for Sutherland laws 288. --> if isothermal walls , wall temperature (in Kelvin) 0.0 --> angle of attack 1 --> Euler fluxes =1 roe, =2 osher,=3 kinetic 3 --> nordre = 1st order scheme, =2 2ndorder, =3 limited 2nd order 1 --> =0 global time steping (unsteady), =1 local Euler, =2 local N.S. 1. --> cfl LastIteration --> number of time step 500 --> frequence for the solution to be saved 1.e10 --> maximum physical time for run (for unsteady problems) -4. --> order of magnitude for the residual to be reduced (for steady problems) INIT --> =0 start with uniform solution, =1 restart from INIT_NS cccc turbulence ccccccccccccccccccccccccccccccccccccccccccccccccccccccc 0 --> =0 no turbulence model, =1 k-epsilon model 0 --> =0 two-layer technique, =1 wall laws 1.e-2 --> delta in wall laws or limit of the one-eq. model. (in meter) 0 --> =0 start from uniform solution for k-epsilon, =1 from INIT_KE -1.e10 1.e10 -1.e10 1.e10 --> xtmin,xtmax,ytmin,ytmax (BOX for k-epsilon r.h.s) �����������������������������������������������������������������freefem++-3.61-1/examples-bamg/NACA012/data���������������������������������������������������������000644 �000767 �000024 �00000002700 13256636774 020125� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������0 --> =0 2D, =1 AXISYMMETRIC 0 --> =0 Euler, =1 Navier-Stokes 1.e2 --> Reynolds by meter (the mesh is given in meter) 0. --> inverse of Froude number (=0 no gravity) 0.96 --> inflow Mach number 1. --> ratio pout/pin 1 --> wall =1 newmann b.c.(adiabatic wall), =2 (isothermal wall) 300. --> inflow temperature (in Kelvin) for Sutherland laws 288. --> if isothermal walls , wall temperature (in Kelvin) 0.0 --> angle of attack 1 --> Euler fluxes =1 roe, =2 osher,=3 kinetic 3 --> nordre = 1st order scheme, =2 2ndorder, =3 limited 2nd order 1 --> =0 global time steping (unsteady), =1 local Euler, =2 local N.S. 1. --> cfl LastIteration --> number of time step 500 --> frequence for the solution to be saved 1.e10 --> maximum physical time for run (for unsteady problems) -4. --> order of magnitude for the residual to be reduced (for steady problems) INIT --> =0 start with uniform solution, =1 restart from INIT_NS cccc turbulence ccccccccccccccccccccccccccccccccccccccccccccccccccccccc 0 --> =0 no turbulence model, =1 k-epsilon model 0 --> =0 two-layer technique, =1 wall laws 1.e-2 --> delta in wall laws or limit of the one-eq. model. (in meter) 0 --> =0 start from uniform solution for k-epsilon, =1 from INIT_KE -1.e10 1.e10 -1.e10 1.e10 --> xtmin,xtmax,ytmin,ytmax (BOX for k-epsilon r.h.s) ����������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/dotest��������������������������������������������������������000755 �000767 �000024 �00000004434 13256636774 021102� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������rm -f *[0s].mesh g= quad= if [ "$1" = "-g" ] ;then g=-g;shift; fi if [ "$1" = "-q" ] ;then quad="-2q -coef 2 -thetaquad 10" ;shift; fi if [ "$1" = "-g" ] ;then g=-g;shift; fi if [ -z "$bamg" -o ! -x "$bamg" ] ;then bamg=../../bamg$g; fi echo " to close the graphic enter f on graphic window until they exist " echo "Mesh square " echo ${bamg} -g square_g.mesh -o square_0.mesh $quad ${bamg} -g square_g.mesh -o square_0.mesh $quad if [ $? -ne 0 -o ! -s square_0.mesh ] ; then echo "the file square_0.mesh is empty or d'ont exist";exit 1 ; fi echo ${bamg} -g square_g.mesh -o square_0.mesh $quad ${bamg} -splitpbedge -g square_g.mesh -o square_s.mesh $quad if [ $? -ne 0 -o ! -s square_0.mesh ] ; then echo "the file square_s.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh circle " ${bamg} -g circle_g.mesh -o circle_0.mesh $quad if [ $? -ne 0 -o ! -s circle_0.mesh ] ; then echo "the file circle_0.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh a octogone " ${bamg} -g octogone_g.mesh -o octogone_0.mesh $quad if [ ! -s octogone_0.mesh ] ; then echo "the file octogone_0.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh a square with raff " ${bamg} -g square_raf_g.mesh -o square_raf_0.mesh $quad if [ $? -ne 0 -o ! -s square_raf_0.mesh ] ; then echo "the file square_raf_0.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh a square with raff split pb edge" ${bamg} -splitpbedge -g square_raf_g.mesh -o square_raf_s.mesh $quad if [ $? -ne 0 -o ! -s square_raf_0.mesh ] ; then echo "the file square_raf_0.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh a square with anisotropique mesh " ${bamg} -g square_raf_g.mesh -o square_raf_ani_0.mesh -M square_raf_ani_g.mtr $quad if [ $? -ne 0 -o ! -s square_raf_ani_0.mesh ] ; then echo "the file square_raf_ani_0.mesh is empty or d'ont exist";exit 1 ; fi echo "Mesh a square with anisotropique mesh with -splitpbedge " ${bamg} -splitpbedge -g square_raf_g.mesh -o square_raf_ani_s.mesh -M square_raf_ani_g.mtr $quad if [ $? -ne 0 -o ! -s square_raf_ani_s.mesh ] ; then echo "the file square_raf_ani_s.mesh is empty or d'ont exist";exit 1 ; fi ${bamg} -splitpbedge -g l_g.mesh -o l_0.mesh $quad if [ $? -ne 0 -o ! -s l_0.mesh ] ; then echo "the file l_0.mesh is empty or d'ont exist";exit 1 ; fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/square_raf_g.mesh���������������������������������������������000644 �000767 �000024 �00000000506 13256636774 023162� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������MeshVersionFormatted 0 Dimension 2 Vertices 5 -1 -1 1 1 -1 2 1 1 3 -1 1 4 0 0 0 Edges 4 1 2 1 2 3 1 3 4 2 4 1 2 hVertices 0.666 0.666 0.666 0.666 0.01 # if you do not say that the vertex number 5 is required # the mesher lost this information so no refement # around the vertex (0.,0.) is done RequiredVertices 1 5 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/l_g.mesh������������������������������������������������������000644 �000767 �000024 �00000015352 13256636774 021272� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ MeshVersionFormatted 0 Dimension 2 AngleOfCornerBound 30 Vertices 226 7.5 -2.27374E-13 5 7.1962 2.11299 4 6.3094 4.05481 4 4.91146 5.66812 4 3.11561 6.82224 4 1.06736 7.42366 4 -1.06736 7.42366 4 -3.11561 6.82224 4 -4.91146 5.66812 4 -6.3094 4.05481 4 -7.1962 2.113 4 -7.5 -2.44381E-06 5 -6.0 58.86447 3 -6.44157 61.39993 3 -7.71429 63.63684 2 -9.09783 12.54909 5 -7.43538 14.2087 3 -6.36787 16.30117 3 -6.0 18.62123 3 7.71429 63.63684 2 6.44157 61.39993 3 6.0 58.86447 3 8.96137 65.56223 2 9.73688 67.72115 2 6.0 18.62123 3 6.36787 16.30117 3 7.43538 14.2087 3 9.09783 12.54909 5 6.0 56.85231 3 6.0 54.84015 3 6.0 52.82799 3 6.0 50.81583 3 6.0 48.80367 3 6.0 46.7915 3 6.0 44.77934 3 6.0 42.76718 3 6.0 40.75502 3 6.0 38.74286 3 6.0 36.7307 3 6.0 34.71854 3 6.0 32.70638 3 6.0 30.69421 3 6.0 28.68205 3 6.0 26.66989 3 6.0 24.65773 3 6.0 22.64557 3 6.0 20.63341 3 12.54909 9.09783 6 14.2087 7.43538 6 16.30117 6.36787 6 18.62123 6.0 6 28.86447 6.0 6 31.39993 6.44157 6 33.63684 7.71429 7 33.63684 -7.71429 7 31.39993 -6.44157 6 28.86447 -6.0 6 3.5 70.0 2 2.83156 72.05725 1 1.08156 73.3287 1 -1.08156 73.3287 1 -2.83156 72.05725 1 -3.5 70.0 2 43.5 .0 7 42.83156 2.05725 8 41.08156 3.3287 8 38.91844 3.3287 8 37.16844 2.05725 8 36.5 -1.14045E-06 7 10.96016 10.96016 5 20.66988 6.0 6 22.71853 6.0 6 24.76718 6.0 6 26.81582 6.0 6 35.34489 -8.85042 7 37.24883 -9.61411 7 39.26855 -9.97321 7 41.31905 -9.91262 7 43.31404 -9.43489 7 45.16957 -8.56012 7 46.80755 -7.32511 7 48.15905 -5.78185 7 49.16721 -3.99528 7 49.78959 -2.04058 7 50.0 -4.29153E-06 7 26.81582 -6.0 6 24.76717 -6.0 6 22.71852 -6.0 6 20.66987 -6.0 6 18.62123 -6.0 6 -10.7016 11.21272 5 -12.1113 9.67296 5 -13.3013 7.95773 5 -14.25 6.09815 5 -14.9402 4.12794 5 -15.3594 2.08286 5 -15.5 9.53674E-07 5 -6.0 20.63339 3 -6.0 22.64555 3 -6.0 24.65771 3 -6.0 26.66987 3 -6.0 28.68204 3 -6.0 30.6942 3 -6.0 32.70636 3 -6.0 34.71852 3 -6.0 36.73068 3 -6.0 38.74284 3 -6.0 40.755 3 -6.0 42.76717 3 -6.0 44.77933 3 -6.0 46.79149 3 -6.0 48.80365 3 -6.0 50.81581 3 -6.0 52.82797 3 -6.0 54.84013 3 -6.0 56.85229 3 16.30117 -6.36787 6 14.2087 -7.43538 6 12.54909 -9.09783 6 -6.13758 62.10506 3 -4.26429 60.95479 3 -2.18493 60.24162 3 5.24521E-06 60.0 3 2.18494 60.24162 3 4.2643 60.9548 3 6.13759 62.10507 3 32.10506 6.13758 7 30.95479 4.26429 7 30.24162 2.18494 7 30.0 -4.76837E-07 7 7.26591 13.69148 5 5.29303 14.56825 5 3.21746 15.16239 5 1.07947 15.46237 5 -1.07947 15.46237 5 -3.21746 15.16239 5 -5.29303 14.56825 5 -7.26591 13.69148 5 13.816 -7.02624 6 14.74383 -4.78221 6 15.30979 -2.42082 6 15.5 -1.43051E-06 6 49.78959 2.04058 7 49.16721 3.99528 7 48.15906 5.78185 7 46.80755 7.32511 7 45.16957 8.56011 7 43.31404 9.43489 7 41.31905 9.91262 7 39.26855 9.97321 7 37.24883 9.61411 7 35.34489 8.85042 7 45.66667 -1.11262E-06 0 47.83334 -5.56310E-07 0 30.24162 -2.18494 7 30.95479 -4.2643 7 32.10506 -6.13759 7 37.16844 -2.05725 8 38.91844 -3.3287 8 41.08156 -3.3287 8 42.83156 -2.05725 8 34.33333 -1.58946E-07 0 32.16666 -3.17892E-07 0 15.30979 2.42081 6 14.74383 4.78222 6 13.816 7.02625 6 -7.1962 -2.11299 4 -6.3094 -4.05481 4 -4.91146 -5.66812 4 -3.11561 -6.82224 4 -1.06736 -7.42366 4 1.06736 -7.42366 4 3.11561 -6.82224 4 4.91145 -5.66812 4 6.3094 -4.05481 4 7.1962 -2.113 4 -15.3645 -2.04516 5 -14.9603 -4.05455 5 -14.2945 -5.99305 5 -13.3788 -7.82675 5 -12.2291 -9.52359 5 -10.8656 -11.0539 5 -9.31208 -12.3909 5 -7.59574 -13.5113 5 -5.74658 -14.3954 5 -3.79693 -15.0278 5 -1.78089 -15.3974 5 .2662987 -15.4977 5 2.30883 -15.3271 5 4.31098 -14.8884 5 6.23775 -14.1895 5 8.05545 -13.2424 5 9.73229 -12.0637 5 11.23895 -10.6741 5 -13.5 1.93710E-07 0 -11.5 -8.94168E-08 0 -9.5 -3.72544E-07 0 9.5 -2.29475E-06 0 11.5 -2.32456E-06 0 13.5 -2.35437E-06 0 9.78148 72.07912 2 9.13545 74.06737 2 8.09017 75.87785 2 6.69131 77.43145 2 5.0 78.66026 2 3.09017 79.51057 2 1.04528 79.94522 2 -1.04529 79.94522 2 -3.09017 79.51057 2 -5.0 78.66026 2 -6.69131 77.43144 2 -8.09017 75.87785 2 -9.13546 74.06736 2 -9.78148 72.07912 2 -10.0 70.0 2 -2.83156 67.94275 1 -1.08156 66.6713 1 1.08156 66.6713 1 2.83156 67.94275 1 -9.73688 67.72115 2 -8.96137 65.56223 2 -7.83333 70.0 0 -5.66667 70.0 0 10.0 70.0 2 5.66667 70.0 0 7.83333 70.0 0 Edges 236 97 177 5 196 197 0 97 195 0 177 178 5 197 12 0 46 45 3 96 97 5 179 180 5 12 11 4 95 96 5 180 181 5 164 165 6 167 12 4 168 167 4 176 175 4 92 93 5 182 183 5 183 184 5 16 91 5 185 186 5 99 98 3 17 16 3 16 138 5 18 17 3 138 137 5 19 18 3 137 136 5 135 134 5 171 170 4 193 194 5 134 133 5 172 171 4 131 132 5 198 199 0 133 132 5 119 139 6 2 1 4 1 198 0 192 193 5 25 47 3 174 173 4 1 176 4 194 119 5 98 19 3 3 2 4 27 26 3 200 142 0 28 27 3 131 28 5 199 200 0 175 174 4 140 141 6 70 28 5 49 48 6 48 166 6 118 117 6 166 165 6 140 139 6 119 118 6 117 90 6 142 164 6 100 99 3 26 25 3 191 192 5 50 49 6 102 101 3 4 3 4 190 191 5 5 4 4 87 86 6 189 190 5 106 105 3 86 57 6 188 189 5 187 188 5 57 56 6 53 52 6 73 72 6 163 130 0 130 155 7 155 156 7 129 130 7 34 33 3 157 156 7 6 5 4 55 157 7 56 55 6 127 54 7 54 53 6 163 162 0 55 75 7 128 127 7 33 32 3 128 129 7 69 68 7 76 77 7 7 6 4 69 162 0 169 168 4 77 78 7 8 7 4 150 151 7 9 8 4 29 22 3 65 64 7 64 153 0 153 154 0 160 159 8 91 92 5 14 13 3 115 114 3 64 161 7 184 185 5 124 125 3 15 14 2 120 15 2 146 147 7 122 123 3 121 120 3 154 85 0 161 160 8 126 125 3 10 9 4 93 94 5 22 21 3 84 85 7 85 143 7 126 20 2 94 95 5 21 20 2 23 24 2 220 221 2 222 215 0 215 220 2 63 62 1 63 223 0 24 224 2 214 215 2 58 225 0 58 219 1 201 202 2 62 61 1 224 201 2 226 224 0 60 59 1 59 58 1 211 212 2 178 179 5 209 210 2 196 195 0 207 208 2 141 142 6 48 70 5 42 41 3 101 100 3 103 102 3 41 40 3 104 103 3 47 46 3 51 50 6 40 39 3 39 38 3 107 106 3 109 108 3 108 107 3 74 73 6 136 135 5 35 34 3 52 74 6 32 31 3 159 158 8 111 110 3 152 54 7 170 169 4 114 113 3 113 112 3 78 79 7 151 152 7 79 80 7 149 150 7 124 123 3 80 81 7 66 65 8 81 82 7 116 115 3 82 83 7 148 149 7 122 121 3 13 116 3 147 148 7 143 144 7 145 146 7 144 145 7 20 23 2 221 15 2 223 222 0 219 218 1 226 225 0 208 209 2 61 60 1 203 204 2 213 214 2 181 182 5 212 213 2 204 205 2 210 211 2 206 207 2 44 43 3 11 10 4 186 187 5 173 172 4 88 87 6 72 71 6 38 37 3 75 76 7 68 67 8 112 111 3 30 29 3 83 84 7 205 206 2 43 42 3 90 89 6 89 88 6 105 104 3 37 36 3 36 35 3 110 109 3 158 69 7 67 66 8 217 216 1 216 63 1 218 217 1 202 203 2 31 30 3 45 44 3 71 51 6 SubDomain 8 2 1 1 5 2 50 1 4 2 40 1 3 2 65 1 6 2 79 1 8 2 94 1 7 2 114 1 2 2 149 1 1 End ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/square_raf_ani_g.mtr������������������������������������������000644 �000767 �000024 �00000000056 13256636774 023657� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������5 3 500 0 25 25 0 25 25 0 25 25 0 25 25 0 100 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/square_g.mesh�������������������������������������������������000644 �000767 �000024 �00000000224 13256636774 022327� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������MeshVersionFormatted 0 Dimension 2 Vertices 4 -1 -1 1 1 -1 2 1 1 3 -1 1 4 Edges 4 1 2 1 2 3 1 3 4 2 4 1 2 hVertices 0.666 0.666 0.666 0.666 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/circle_g.mesh�������������������������������������������������000644 �000767 �000024 �00000000541 13256636774 022272� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������MeshVersionFormatted 0 MaximalAngleOfCorner 46 Dimension 2 Vertices 8 1 0 1 .7071067811865476 .7071067811865476 1 0 1 1 -.7071067811865476 .7071067811865476 1 -1 0 1 -.7071067811865476 -.7071067811865476 1 0 -1 1 .7071067811865476 -.7071067811865476 1 Edges 8 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 1 1 hVertices 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/doadapt�������������������������������������������������������000755 �000767 �000024 �00000002073 13256636774 021211� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh prefix=circle equation='100*x*x*x+y*y+20*x*y' if [ -z "$bamg" ] ;then bamg=../../bamg; fi # for compatibility pb in awk if LANG=French LANG=C export LANG ## initialisation i=0 MESH=${prefix}_$i.mesh GEOM=${prefix}_g.mesh echo ${bamg} -g $GEOM -o $MESH -oam_fmt $MESH.am_fmt ${bamg} -g $GEOM -o $MESH -oam_fmt $MESH.am_fmt ## do a simple loop of adpation i1 = i-1 for i in 1 2 3 ; do BACK=${MESH} MESH=${prefix}_$i.mesh SOL=${BACK}.bb # generation of the solution file with awk awk ' BEGIN {k=0} k>0 {k--; x=$1;y=$2;print '$equation'} (k==-1) {k=$1; print 2,1,k,2;} $1=="Vertices" {k=-1;} ' $BACK > $SOL # generation of the adapted mesh echo ${bamg} -AbsError -v 8 -b $BACK -Mbb $SOL -err 0.005 -hmin 0.00001 -NbSmooth 3 -NbJacobi 3 -o $MESH -oam_fmt $MESH.am_fmt ${bamg} -AbsError -v 8 -b $BACK -Mbb $SOL -err 0.005 -hmin 0.00001 -NbSmooth 3 -NbJacobi 3 -o $MESH -oam_fmt $MESH.am_fmt echo "to see the result enter : ../../drawbdmesh $MESH" done ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/octogone_g.mesh�����������������������������������������������000644 �000767 �000024 �00000000541 13256636774 022646� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������MeshVersionFormatted 0 MaximalAngleOfCorner 44 Dimension 2 Vertices 8 1 0 1 .7071067811865476 .7071067811865476 1 0 1 1 -.7071067811865476 .7071067811865476 1 -1 0 1 -.7071067811865476 -.7071067811865476 1 0 -1 1 .7071067811865476 -.7071067811865476 1 Edges 8 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 1 1 hVertices 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 ���������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/square/square_raf_g.mtr����������������������������������������������000644 �000767 �000024 �00000000041 13256636774 023022� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������5 1 0.666 0.666 0.666 0.666 0.01 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/test/dotest.pl�������������������������������������������������������000755 �000767 �000024 �00000007663 13256636774 021202� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/perl # ----- clean --- unlink <*.mesh>; unlink <*.am_fmt>; unlink <*.mtr>; unlink <*.bb>; unlink <*.BB>; unlink <YG_trace*>; unlink 'PLOT'; ##$f="10 + 1/(1+ 100**(sin(x*3)-y)) "; #$f1 = "(10*x*x*x+y*y*y) + 10/(1+10**(10*((sin(5*x)-2*y)))) "; $f1=" sin(3*x)*cos(5*y)+ atan2(0.001,x**2 + y**2 - 0.5 )"; #$f1=" 8*(x-y)**2 + (x+y)**2"; $err=0.1; $errg=0.01; $nbiteration=10; $bamg=$ENV{'bamg'}; $quadoption=""; $bamgoption=" -AbsError -NbJacobi 2 -NbSmooth 5 -anisomax 5 -hmax 0.5 -ratio 2 -nbv 100000 "; #$bamgoption=" -AbsError -NbJacobi 3 -ratio 2 -anisomax 30"; #$quadoption=" -2q -thetaquad 30 -coef 2"; # --- change x in $x and y in $y $_=$f1; s/x/\$x/g; s/y/\$y/g; $f1="$_;"; print "The function = f1(x,y) = $f1 \n"; #-------------------------- $suffixe=".mesh"; $iteration=0; $GH="Gh$suffixe"; $TH="Th$iteration$suffixe"; $, = ' '; # set output field separator $\ = "\n"; # set output record separator ## ------------------------------------------------------------- ## --- construction the Geometry file Gh.mesh ## 8 points on circle of radius r open(GH,">$GH") || die "Can't redirect stdout"; $Pi = 3.14159265358979; $i8 = 8; $r = 1; $c0x = 0; $c0y = 0; print GH 'Dimension', 2; print GH 'MaximalAngleOfCorner 46'; print GH 'Vertices'; print GH $i8; # vertex on circle (counter clock wise) for ($i = 0; $i < $i8; $i++) { $t = $i * $Pi * 2 / $i8; print GH $c0x + $r * (cos($t)), $c0y + $r * sin($t), 5; } print GH 'Edges', $i8+1; print GH 1,5,10; # edge on circle $k = 1; $j = $i8 - 1; # previous points for ($i = 0; $i < $i8; $j = $i++) { print GH $k + $j, $k + $i, 5; } # previous, current vertex # one subdomain, region on left side of the wing # because clock wise sens. print GH 'SubDomain', 2; print GH 2, 1, 1, 0; print GH 2, 1, -1, 1; close GH; ## -------------- END construct of the geom ## # -- make the DATA file for the mesh to also save the arguments open(BAMG,">DATA_bamg") || die "Can't open DATA_bamg"; print BAMG "$quadoption $bamgoption -g $GH -o $TH -v 9 -oam_fmt $TH.am_fmt"; close(BAMG); ## constructio the inital mesh !system($bamg) || die "Error in bamg construction of initial mesh $Th"; ## the adpatation loop while ($iteration<$nbiteration) { $BB="$iteration.BB"; $ERRBB="err$iteration.bb"; ## construction of the solution $errsol=0; open (TH,"<$TH") || die "Can't open $TH"; open (BB,">$BB") || die "Can't open $BB"; open (ERRBB,">$ERRBB") || die "Can't open $ERRBB"; while (<TH>) { if(/^Vertices$/) { $nbv=<TH>; chop($nbv); print BB "2 1 1 $nbv 2"; for ($i=1;$i<=$nbv;$i++) { ($x,$y,$ref)=split(/[\ \t\n]+/, <TH>); $f1xy=eval $f1; $xx[$i]=$x; $yy[$i]=$y; $ff[$i]=$f1xy; print BB $f1xy ; }; }; if(/^Triangles$/) { $nbt=<TH>; chop($nbt); print " Nb of Triangles = $nbt \n"; print ERRBB "2 1 $nbt 1"; for ($i=1;$i<=$nbt;$i++) { ($i0,$i1,$i2,$ref)=split(/[\ \t\n]+/, <TH>); $x = ($xx[$i0]+$xx[$i1]+$xx[$i2])/3; $y = ($yy[$i0]+$yy[$i1]+$yy[$i2])/3; $fm = ($ff[$i0]+$ff[$i1]+$ff[$i2])/3; $fxy = eval $f1; $vv=($fm-$fxy); $vv= ($vv<0)?-$vv:$vv; print ERRBB $vv; $errsol = ($errsol>$vv) ? $errsol : $vv; }; }; }; close TH; close BB; close ERRBB; print " ---------------------------------------------\n"; print "\n\n Iteration $iteration\n Erreur L_infini = $errsol \n\n"; print " ---------------------------------------------\n"; ## ----------------------- $MTR="M$iteration.mtr"; $iteration++; $BTH=$TH; $TH="Th$iteration$suffixe"; open(BAMG,">DATA_bamg") || die "Can't open DATA_bamg"; print BAMG "$quadoption $bamgoption -MBB $BB -errg $errg -err $err -b $BTH -o $TH -v 9 -oM $MTR -oam_fmt $TH.am_fmt -wBB /tmp/tyty "; close(BAMG); !system($bamg) || die "Error in bamg construction of adapted $iteration mesh $Th"; } print "Normal End\n"; �����������������������������������������������������������������������������freefem++-3.61-1/examples-bamg/quadloop/dotest.pl���������������������������������������������������000755 �000767 �000024 �00000010454 13256636774 022037� 0����������������������������������������������������������������������������������������������������ustar�00hecht���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl # -- so option ##$f="10 + 1/(1+ 100**(sin(x*3)-y)) "; $f = "10 + sin(x/10)*cos(y/3)"; $err=0.001; $errg=0.05; $nbiteration=3; $bamg="../../src/bamg/bamg"; $quadoption=""; $bamgoption=" -AbsError -NbJacobi 3 -ratio 2 -anisomax 30"; $quadoption=" -2q -thetaquad 30 -coef 2"; # --- change x in $x and y in $y $_=$f; s/x/\$x/g; s/y/\$y/g; $f="$_;"; print "The function = f(x,y) = $f \n"; #-------------------------- $suffixe=".mesh"; $iteration=0; $GH="Gh$suffixe"; $TH="Th$iteration$suffixe"; $, = ' '; # set output field separator $\ = "\n"; # set output record separator ## ------------------------------------------------------------- ## --- construction the Geometry file Gh.mesh ## a naca0012 wing in a big circle radius 5 ## 20 points on the up wing ## 20 points on the down wing ## 8 points on circle of radius r open(GH,">$GH") || die "Can't redirect stdout"; $Pi = 3.14159265358979; $i20 = 20; $i8 = 8; $r = 5; $c0x = 1; $c0y = 0; print GH 'Dimension', 2; print GH 'MaximalAngleOfCorner 46'; print GH 'Vertices'; print GH $i20 + $i20 + $i8; # the vertex on naca012 wing ( clock wise) for ($i = -$i20; $i < $i20; $i++) { $X = $i / $i20; $X = $X ** 4; $t = 1.008930411365 * $X; $Y = 5 * .12 * (0.2969 * sqrt($t) - 0.126 * $t - 0.3516 * $t ** 2 + 0.2843 * $t ** 3 - 0.1015 * $t ** 4); if ($i < 0) { $Y = -$Y; } print GH $X, $Y, 3; } # vertex on circle (counter clock wise) for ($i = 0; $i < $i8; $i++) { $t = $i * $Pi * 2 / $i8; print GH $c0x + $r * (cos($t)), $c0y + $r * sin($t), 5; } print GH 'Edges', $i20 + $i20 + $i8; # edge on wing $k = 1; $j = $i20 + $i20 - 1; # previous points for ($i = 0; $i < $i20 + $i20; $j = $i++) { print GH $j + $k, $i + $k, 3; } # previous, current vertex # edge on circle $k = $i20 + $i20 + 1; $j = $i8 - 1; # previous points for ($i = 0; $i < $i8; $j = $i++) { print GH $k + $j, $k + $i, 5; } # previous, current vertex # one subdomain, region on left side of the wing # because clock wise sens. print GH 'SubDomain', 1; print GH 2, 1, 1, 0; close GH; ## -------------- END construct of the geom ## # -- make the DATA file for the mesh to also save the arguments open(BAMG,">DATA_bamg") || die "Can't open DATA_bamg"; print BAMG "$quadoption $bamgoption -g $GH -o $TH -v 9"; close(BAMG); ## constructio the inital mesh !system($bamg) || die "Error in bamg construction of initial mesh $Th"; ## the adpatation loop while ($iteration<$nbiteration) { $BB="$iteration.bb"; ## construction of the solution $errsol=0; open (TH,"<$TH") || die "Can't open $TH"; open (BB,">$BB") || die "Can't open $BB"; open (PLOT,">PLOT") || die "Can't open PLOT"; while (<TH>) { if(/^Vertices$/) { $nbv=<TH>; chop($nbv); print BB "2 1 $nbv 2"; for ($i=1;$i<=$nbv;$i++) { ($x,$y,$ref)=split(/[\ \t\n]+/, <TH>); $fxy=eval $f; $xx[$i]=$x; $yy[$i]=$y; $ff[$i]=$fxy; print BB $fxy; }; }; if(/^Triangles$/) { print " Nb of Triangles = $nbt \n"; $nbt=<TH>; chop($nbt); for ($i=1;$i<=$nbt;$i++) { ($i0,$i1,$i2,$ref)=split(/[\ \t\n]+/, <TH>); print PLOT "$xx[$i0] $yy[$i0] $ff[$i0]"; print PLOT "$xx[$i1] $yy[$i1] $ff[$i1]"; print PLOT "$xx[$i2] $yy[$i2] $ff[$i2]"; print PLOT "$xx[$i0] $yy[$i0] $ff[$i0]"; print PLOT ""; $x = ($xx[$i0]+$xx[$i1]+$xx[$i2])/3; $y = ($yy[$i0]+$yy[$i1]+$yy[$i2])/3; $fm = ($ff[$i0]+$ff[$i1]+$ff[$i2])/3; $fxy = eval $f; $vv=($fm-$fxy); $vv= ($vv<0)?-$vv:$vv; # print " $i0 $i1 $i2 $xx[$i0] $xx[$i1] $xx[$i2] "; # print " $i $x $y $fm $fxy err= $errsol diff=$vv"; $errsol = ($errsol>$vv) ? $errsol : $vv; }; }; }; close TH; close BB; close PLOT; print " ---------------------------------------------\n"; print "\n\n Iteration $iteration\n Erreur L_infini = $errsol \n\n"; print " ---------------------------------------------\n"; ## ----------------------- $iteration++; $BTH=$TH; $TH="Th$iteration$suffixe"; open(BAMG,">DATA_bamg") || die "Can't open DATA_bamg"; print BAMG "$quadoption $bamgoption -Mbb $BB -errg $errg -err $err -b $BTH -o $TH -v 9"; close(BAMG); !system($bamg) || die "Error in bamg construction of adapted $iteration mesh $Th"; } print "Normal End\n"; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������