aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--math/Makefile1
-rw-r--r--math/bamg/Makefile60
-rw-r--r--math/bamg/distinfo2
-rw-r--r--math/bamg/files/patch-FLAG.linux23
-rw-r--r--math/bamg/files/patch-Makefile11
-rw-r--r--math/bamg/files/patch-Mesh2.cpp18
-rw-r--r--math/bamg/files/patch-Mesh2.h128
-rw-r--r--math/bamg/files/patch-MeshDraw.cpp11
-rw-r--r--math/bamg/files/patch-MeshGeom.cpp11
-rw-r--r--math/bamg/files/patch-MeshWrite.cpp110
-rw-r--r--math/bamg/files/patch-Meshio.cpp52
-rw-r--r--math/bamg/files/patch-Meshio.h94
-rw-r--r--math/bamg/files/patch-Metric.cpp11
-rw-r--r--math/bamg/files/patch-Metric.h32
-rw-r--r--math/bamg/files/patch-QuadTree.cpp11
-rw-r--r--math/bamg/files/patch-QuadTree.h11
-rw-r--r--math/bamg/files/patch-R2.h20
-rw-r--r--math/bamg/files/patch-SetOfE4.cpp13
-rw-r--r--math/bamg/files/patch-Xrgraph.cpp28
-rw-r--r--math/bamg/files/patch-bamg.cpp81
-rw-r--r--math/bamg/files/patch-cvmsh2.cpp29
-rw-r--r--math/bamg/files/patch-drawbdmesh.cpp33
-rw-r--r--math/bamg/pkg-descr5
-rw-r--r--math/bamg/pkg-plist34
24 files changed, 829 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index af99471566e3..d09584dfaa4e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -13,6 +13,7 @@
SUBDIR += asir2000
SUBDIR += atlas
SUBDIR += atlas-devel
+ SUBDIR += bamg
SUBDIR += biggles
SUBDIR += blacs
SUBDIR += blas
diff --git a/math/bamg/Makefile b/math/bamg/Makefile
new file mode 100644
index 000000000000..6ba9a1579d19
--- /dev/null
+++ b/math/bamg/Makefile
@@ -0,0 +1,60 @@
+# New ports collection makefile for: bamg
+# Date created: 16 December 2003
+# Whom: thierry@pompo.net
+#
+# $FreeBSD$
+#
+
+PORTNAME= bamg
+PORTVERSION= 0.68
+CATEGORIES= math science
+MASTER_SITES= ftp://ftp.inria.fr/INRIA/Projects/Gamma/bamg/
+DISTNAME= ${PORTNAME}-v${PORTVERSION}
+.if !defined(NOPORTDOCS)
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${PORTNAME}.ps.gz
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+.endif
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= Bidimensional Anisotrope Mesh Generator
+
+RESTRICTED= No resale, contact author for commercial usage
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
+USE_XLIB= yes
+USE_GMAKE= yes
+
+ALL_TARGET= world
+INSTALL_TARGET= install-world
+
+MAKE_ENV= CXX=${CXX} HOSTTYPE=${HOSTTYPE}
+
+BINS= bamg bamg-g cvmsh2 drawbdmesh
+EXDIRS= NACA012 quadloop square test
+
+.include <bsd.port.pre.mk>
+
+HOSTTYPE!= ${UNAME} -s
+
+post-patch:
+ @${MV} ${WRKSRC}/FLAG.linux ${WRKSRC}/FLAG.${HOSTTYPE}
+ @${MV} ${WRKSRC}/FLAG.linux.orig ${WRKSRC}/FLAG.linux
+
+post-install:
+.for bin in ${BINS}
+ @${STRIP_CMD} ${PREFIX}/bin/${bin}
+.endfor
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ @${INSTALL_DATA} ${DISTDIR}/bamg.ps.gz ${DOCSDIR}
+ @${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
+.for exdir in ${EXDIRS}
+ @${MKDIR} ${EXAMPLESDIR}/${exdir}
+ @${INSTALL_DATA} ${WRKSRC}/examples/${exdir}/* ${EXAMPLESDIR}/${exdir}
+.endfor
+ @${FIND} ${EXAMPLESDIR} \( -name "*.pl" -or -name "*.sh" \) -exec ${CHMOD} a+x {} \;
+ @${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}."
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/math/bamg/distinfo b/math/bamg/distinfo
new file mode 100644
index 000000000000..7b38818e756e
--- /dev/null
+++ b/math/bamg/distinfo
@@ -0,0 +1,2 @@
+MD5 (bamg-v0.68.tar.gz) = c0409141afb5a1ce6e68256440dd8e0f
+MD5 (bamg.ps.gz) = db8780db022ca5eeac3da26112d9ca3c
diff --git a/math/bamg/files/patch-FLAG.linux b/math/bamg/files/patch-FLAG.linux
new file mode 100644
index 000000000000..c16f16cf4122
--- /dev/null
+++ b/math/bamg/files/patch-FLAG.linux
@@ -0,0 +1,23 @@
+--- FLAG.linux.orig Fri May 29 18:33:51 1998
++++ FLAG.linux Fri Dec 19 11:24:28 2003
+@@ -1,12 +1,11 @@
+-CXX=g++
+ longlong = -DLONGLONG
+-O = -O $(longlong)
+-G = -g $(longlong)
+-CXXFLAGS= $(O)
+-CXXGRAPHIC = -I/usr/include/X11R6 -DDRAWING -DDEBUG
++O = $(longlong)
++G =
++CXXFLAGS+= $(O)
++CXXGRAPHIC = $(CXXFLAGS) -I$(X11BASE)/include -DDRAWING -DDEBUG
+ CXXLINKFLAG =
+-X11LIB = -L/usr/lib/X11R6 -L/usr/X11R6/lib -lX11
+-X11INCLUDE= -I/usr/include/X11R6
++X11LIB = -L$(X11BASE)/lib -lX11
++X11INCLUDE= -I$(X11BASE)/include
+ STDLIB =
+-F77FLAGS =
+-F77 = f77
++F77FLAGS = $(FFLAGS)
++F77 = $(F77)
diff --git a/math/bamg/files/patch-Makefile b/math/bamg/files/patch-Makefile
new file mode 100644
index 000000000000..effad11df246
--- /dev/null
+++ b/math/bamg/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig Thu Apr 5 10:15:28 2001
++++ Makefile Wed Dec 17 23:56:36 2003
+@@ -5,7 +5,7 @@
+
+ all: bamg cvmsh2 $(FLAGFILE)
+
+-INSTALLDIR=/usr/local/bin
++INSTALLDIR=$(PREFIX)/bin
+ FLAGFILE=FLAG.$(HOSTTYPE)
+
+ include $(FLAGFILE)
diff --git a/math/bamg/files/patch-Mesh2.cpp b/math/bamg/files/patch-Mesh2.cpp
new file mode 100644
index 000000000000..d9af16a52fd7
--- /dev/null
+++ b/math/bamg/files/patch-Mesh2.cpp
@@ -0,0 +1,18 @@
+--- Mesh2.cpp.orig Thu Dec 23 17:25:52 1999
++++ Mesh2.cpp Thu Dec 18 22:30:08 2003
+@@ -17,13 +17,13 @@
+ #include <string.h>
+ #include <math.h>
+ #include <time.h>
+-#include <iostream.h>
++#include <iostream>
+
+ #include "Mesh2.h"
+ #include "QuadTree.h"
+ #include "SetOfE4.h"
+
+-
++using std::ostream;
+
+
+ #ifdef DEBUG1
diff --git a/math/bamg/files/patch-Mesh2.h b/math/bamg/files/patch-Mesh2.h
new file mode 100644
index 000000000000..8db8d22c4704
--- /dev/null
+++ b/math/bamg/files/patch-Mesh2.h
@@ -0,0 +1,128 @@
+--- Mesh2.h.orig Thu Dec 23 17:25:52 1999
++++ Mesh2.h Thu Dec 18 22:37:45 2003
+@@ -21,6 +21,11 @@
+ #include "meshtype.h"
+ #include <stdlib.h>
+
++using std::cerr;
++using std::cout;
++using std::endl;
++using std::flush;
++
+ #include <math.h>
+ #include <limits.h>
+
+@@ -183,7 +188,7 @@
+ Real8 Smoothing(Triangles & ,const Triangles & ,Triangle * & ,Real8 =1);
+ int ref(){ return ReferenceNumber;}
+
+- friend ostream& operator <<(ostream& f, const Vertex & v)
++ friend std::ostream& operator <<(std::ostream& f, const Vertex & v)
+ {f << "(" << v.i << "," << v.r << MatVVP2x2(v.m) << ")" ; return f;}
+ inline void Set(const Vertex & rec,const Triangles &,Triangles &);
+
+@@ -200,7 +205,7 @@
+
+ /////////////////////////////////////////////////////////////////////////////////////
+ class TriangleAdjacent {
+- friend ostream& operator <<(ostream& f, const TriangleAdjacent & ta)
++ friend std::ostream& operator <<(std::ostream& f, const TriangleAdjacent & ta)
+ {f << "{" << ta.t << "," << ((int) ta.a) << "}" ;
+ return f;}
+
+@@ -286,7 +291,7 @@
+ int IsThe() const { return link == this;}
+
+ inline void Set(const GeometricalVertex & rec,const Geometry & Gh ,const Geometry & GhNew);
+- inline friend ostream& operator <<(ostream& f, const GeometricalVertex & s)
++ inline friend std::ostream& operator <<(std::ostream& f, const GeometricalVertex & s)
+ { f << s.r << "," << s.cas << ".";return f; }
+ };
+
+@@ -341,7 +346,7 @@
+ /////////////////////////////////////////////////////////////////////////////////////
+ class Triangle {
+ friend class TriangleAdjacent;
+- friend ostream& operator <<(ostream& f, const Triangle & ta);
++ friend std::ostream& operator <<(std::ostream& f, const Triangle & ta);
+
+
+ private: // les arete sont opposes a un sommet
+@@ -613,7 +618,7 @@
+ operator const Real8 & () const {return abscisse;}
+ int IsRequiredVertex(){ return this? (( abscisse<0 ? (gv?gv->Required():0):0 )) : 0;}
+ void SetOn(){mv->on=this;mv->vint=IsVertexOnGeom;}
+- friend ostream& operator <<(ostream& f, const VertexOnGeom & vog){
++ friend std::ostream& operator <<(std::ostream& f, const VertexOnGeom & vog){
+ f << vog.abscisse << " " << vog.mv << " " << vog.gv << " ; ";
+ if (vog.abscisse < 0) f << *vog.gv << " ;; " ;
+ // else f << *vog.ge << " ;; " ;
+@@ -650,11 +655,11 @@
+
+ class CrackedEdge { // a small class to store on crack an uncrack information
+ friend class Triangles;
+- friend ostream& operator <<(ostream& f, const Triangles & Th) ;
++ friend std::ostream& operator <<(std::ostream& f, const Triangles & Th) ;
+ class CrackedTriangle {
+ friend class Triangles;
+ friend class CrackedEdge;
+- friend ostream& operator <<(ostream& f, const Triangles & Th) ;
++ friend std::ostream& operator <<(std::ostream& f, const Triangles & Th) ;
+ Triangle * t; // edge of triangle t
+ int i; // edge number of in triangle
+ Edge *edge; // the 2 edge
+@@ -803,7 +808,7 @@
+ void SmoothMetric(Real8 raisonmax) ;
+ void BoundAnisotropy(Real8 anisomax,double hminaniso= 1e-100) ;
+ void MaxSubDivision(Real8 maxsubdiv);
+- void WriteMetric(ostream &,int iso) ;
++ void WriteMetric(std::ostream &,int iso) ;
+ Edge** MakeGeometricalEdgeToEdge();
+ void SetVertexFieldOn();
+ void SetVertexFieldOnBTh();
+@@ -823,7 +828,7 @@
+ Vertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
+
+
+- void WriteElements(ostream& f,Int4 * reft ,Int4 nbInT) const;
++ void WriteElements(std::ostream& f,Int4 * reft ,Int4 nbInT) const;
+
+
+ Int4 Number(const Triangle & t) const { return &t - triangles;}
+@@ -841,12 +846,12 @@
+ Vertex * NearestVertex(Icoor1 i,Icoor1 j) ;
+ Triangle * FindTriangleContening(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
+ void Write(char * filename,const TypeFileMesh type = AutoMesh);
+- 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 ;
+- void Write_amdba(ostream &) const ;
++ void Write_am_fmt(std::ostream &) const ;
++ void Write_am(std::ostream &) const ;
++ void Write_ftq(std::ostream &) const ;
++ void Write_nopo(std::ostream &) const ;
++ void Write_msh(std::ostream &) const ;
++ void Write_amdba(std::ostream &) const ;
+
+ void Read(MeshIstream &,int version,Real8 cutoffradian);
+ void Read_am_fmt(MeshIstream &);
+@@ -878,7 +883,7 @@
+ void InitDraw() const ;
+ void inquire() ;
+ #endif
+- friend ostream& operator <<(ostream& f, const Triangles & Th);
++ friend std::ostream& operator <<(std::ostream& f, const Triangles & Th);
+ void Write(const char * filename);
+ void ConsGeometry(Real8 =-1.0); // construct a geometry if no geo
+ void FillHoleInMesh() ;
+@@ -954,7 +959,7 @@
+
+ GeometricalEdge * ProjectOnCurve(const Edge & ,Real8,Vertex &,VertexOnGeom &) const ;
+ GeometricalEdge * Contening(const R2 P, GeometricalEdge * start) const;
+- friend ostream& operator <<(ostream& f, const Geometry & Gh);
++ friend std::ostream& operator <<(std::ostream& f, const Geometry & Gh);
+ void Write(const char * filename);
+
+ #ifdef DEBUG
diff --git a/math/bamg/files/patch-MeshDraw.cpp b/math/bamg/files/patch-MeshDraw.cpp
new file mode 100644
index 000000000000..6eec4831baaa
--- /dev/null
+++ b/math/bamg/files/patch-MeshDraw.cpp
@@ -0,0 +1,11 @@
+--- MeshDraw.cpp.orig Thu Dec 23 17:25:52 1999
++++ MeshDraw.cpp Thu Dec 18 13:58:43 2003
+@@ -18,7 +18,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <time.h>
+-#include <iostream.h>
++#include <iostream>
+
+ #include "Mesh2.h"
+ #include "QuadTree.h"
diff --git a/math/bamg/files/patch-MeshGeom.cpp b/math/bamg/files/patch-MeshGeom.cpp
new file mode 100644
index 000000000000..de80d9261197
--- /dev/null
+++ b/math/bamg/files/patch-MeshGeom.cpp
@@ -0,0 +1,11 @@
+--- MeshGeom.cpp.orig Wed Jan 5 09:00:56 2000
++++ MeshGeom.cpp Thu Dec 18 13:54:59 2003
+@@ -20,7 +20,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <time.h>
+-#include <iostream.h>
++#include <iostream>
+
+ #include "Mesh2.h"
+ #include "QuadTree.h"
diff --git a/math/bamg/files/patch-MeshWrite.cpp b/math/bamg/files/patch-MeshWrite.cpp
new file mode 100644
index 000000000000..5513579070e6
--- /dev/null
+++ b/math/bamg/files/patch-MeshWrite.cpp
@@ -0,0 +1,110 @@
+--- MeshWrite.cpp.orig Thu Apr 5 10:03:54 2001
++++ MeshWrite.cpp Fri Dec 19 00:01:40 2003
+@@ -52,7 +52,7 @@
+ cout << endl;
+
+ }
+- ofstream f(filename /*,ios::trunc*/);
++ std::ofstream f(filename /*,ios::trunc*/);
+ if (f)
+ switch (type)
+ {
+@@ -263,7 +263,7 @@
+
+ }
+
+-void Triangles::Write_nopo(ostream &ff) const
++void Triangles::Write_nopo(std::ostream &ff) const
+
+ {
+ Int4 nef=0;
+@@ -332,7 +332,7 @@
+ // cout << "fin write nopo" << endl;
+ }
+
+-void Triangles::Write_am_fmt(ostream &f) const
++void Triangles::Write_am_fmt(std::ostream &f) const
+ {
+ Int4 i,j;
+ assert(this && nbt);
+@@ -362,7 +362,7 @@
+
+ }
+
+-void Triangles::Write_am(ostream &ff) const
++void Triangles::Write_am(std::ostream &ff) const
+ {
+ OFortranUnFormattedFile f(ff);
+ Int4 i,j;
+@@ -393,7 +393,7 @@
+ delete [] reft;
+ }
+
+-void Triangles::Write_ftq(ostream &f) const
++void Triangles::Write_ftq(std::ostream &f) const
+ {
+
+ Int4 i;
+@@ -440,7 +440,7 @@
+
+
+ }
+-void Triangles::Write_msh(ostream &f) const
++void Triangles::Write_msh(std::ostream &f) const
+ {
+ Int4 i;
+ assert(this && nbt);
+@@ -469,7 +469,7 @@
+
+ }
+
+-void Triangles::Write_amdba(ostream &f) const
++void Triangles::Write_amdba(std::ostream &f) const
+ {
+ assert(this && nbt);
+
+@@ -499,7 +499,7 @@
+
+ void Triangles::Write(const char * filename)
+ {
+- ofstream f(filename);
++ std::ofstream f(filename);
+ if (f)
+ {
+ if (name) delete name;
+@@ -509,7 +509,7 @@
+ f << *this;
+ }
+ }
+-void Triangles::WriteElements(ostream& f,Int4 * reft ,Int4 nbInT) const
++void Triangles::WriteElements(std::ostream& f,Int4 * reft ,Int4 nbInT) const
+ {
+ const Triangles & Th= *this;
+ // do triangle and quad
+@@ -558,7 +558,7 @@
+ // warning reft is now the element number
+ }
+
+-ostream& operator <<(ostream& f, const Triangles & Th)
++std::ostream& operator <<(std::ostream& f, const Triangles & Th)
+ {
+ // Th.FindSubDomain();
+ // warning just on say the class is on the disk
+@@ -744,7 +744,7 @@
+
+ void Geometry::Write(const char * filename)
+ {
+- ofstream f(filename);
++ std::ofstream f(filename);
+ if (f)
+ {
+ if(verbosity>1)
+@@ -756,7 +756,7 @@
+ f << *this;
+ }
+ }
+-ostream& operator <<(ostream& f, const Geometry & Gh)
++std::ostream& operator <<(std::ostream& f, const Geometry & Gh)
+ {
+ Int4 NbCorner=0;
+ {
diff --git a/math/bamg/files/patch-Meshio.cpp b/math/bamg/files/patch-Meshio.cpp
new file mode 100644
index 000000000000..7ebdf435c904
--- /dev/null
+++ b/math/bamg/files/patch-Meshio.cpp
@@ -0,0 +1,52 @@
+--- Meshio.cpp.orig Thu Apr 5 10:00:13 2001
++++ Meshio.cpp Fri Dec 19 00:07:55 2003
+@@ -15,9 +15,9 @@
+
+ #include "Meshio.h"
+ const char *OFortranUnFormattedFile::unkown("unkown file name");
+-void (*MeshIstreamErrorHandler)(ios & ) =0;
++void (*MeshIstreamErrorHandler)(std::ios & ) =0;
+ ///////////////////////////////////////////////////////////
+- void WriteStr(ostream & out,char * str)
++ void WriteStr(std::ostream & out,char * str)
+ {
+ int i=0;
+ char c;
+@@ -125,14 +125,14 @@
+ if (CurrentFile)
+ cerr << " In file " << CurrentFile ;
+ cerr << ", Erreur Lecture " << s <<
+- ", good=" << (s & ios::goodbit) <<
+- ", bad=" << (s & ios::badbit) <<
+- ", fail=" << (s & ios::failbit) <<
+- ", eof=" << (s & ios::eofbit) << " Line " << LineNumber <<
++ ", good=" << (s & std::ios::goodbit) <<
++ ", bad=" << (s & std::ios::badbit) <<
++ ", fail=" << (s & std::ios::failbit) <<
++ ", eof=" << (s & std::ios::eofbit) << " Line " << LineNumber <<
+ endl;
+ if(!in.eof())
+ {
+- in.clear(ios::goodbit);
++ in.clear(std::ios::goodbit);
+ int i=0;
+ char c;
+ cerr << " the next character :" ;
+@@ -143,7 +143,7 @@
+ if (MeshIstreamErrorHandler)
+ MeshIstreamErrorHandler(in);
+ else
+- in.clear(ios::failbit);
++ in.clear(std::ios::failbit);
+ }
+ int MeshIstream::IsString(char* s)
+ {
+@@ -201,7 +201,7 @@
+ break;
+ }
+ *b=0;
+- in.clear(ios::goodbit);
++ in.clear(std::ios::goodbit);
+ // cout << " l = " << b-buf << " " ;
+ char * r = new char [b-buf+1];
+ strcpy(r,buf);
diff --git a/math/bamg/files/patch-Meshio.h b/math/bamg/files/patch-Meshio.h
new file mode 100644
index 000000000000..6ff5f1467da8
--- /dev/null
+++ b/math/bamg/files/patch-Meshio.h
@@ -0,0 +1,94 @@
+--- Meshio.h.orig Wed Mar 29 13:52:55 2000
++++ Meshio.h Thu Dec 18 23:50:19 2003
+@@ -14,8 +14,8 @@
+ // ORIG-DATE: Dec 97
+
+ #include <stdio.h>
+-#include <iostream.h>
+-#include <fstream.h>
++#include <iostream>
++#include <fstream>
+ #include <assert.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -25,14 +25,17 @@
+ #if defined(__hpux) || defined(__SUNPRO_CC)
+ #define IOS_OPENMODE int
+ #else
+-#define IOS_OPENMODE ios::openmode
++#define IOS_OPENMODE std::ios::openmode
+ #endif
+
++using std::cerr;
++using std::cout;
++using std::endl;
+
+-extern void (*MeshIstreamErrorHandler)(ios & );
++extern void (*MeshIstreamErrorHandler)(std::ios & );
+ extern int verbosity ;
+
+-void WriteStr(ostream & out,char * str);
++void WriteStr(std::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);
+@@ -42,12 +45,12 @@
+
+ class MeshIstream {
+ public:
+- istream & in ;
++ std::istream & in ;
+ // ifstream fin;
+ int LineNumber,LineError,opened;
+ const char * CurrentFile;
+
+- istream & cm ()// mange les blancs et les commentaire
++ std::istream & cm ()// mange les blancs et les commentaire
+ {
+ char c;
+ int cmm=0;
+@@ -73,7 +76,7 @@
+ // 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)
++ : in(*new std::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(); }
+
+@@ -100,12 +103,12 @@
+ class IFortranUnFormattedFile {
+ // template<class T> friend IFortranUnFormattedFile & operator>>(IFortranUnFormattedFile &f,T & l);
+ long i,l,n,j,nb_rec;
+- istream * f;
++ std::istream * f;
+ int to_close;
+ const char * file_name;
+ public:
+ IFortranUnFormattedFile(char *name)
+- : f(new ifstream(name)),i(0),l(0),n((long)-sizeof(long)),
++ : f(new std::ifstream(name)),i(0),l(0),n((long)-sizeof(long)),
+ nb_rec(0),file_name(name), to_close(1)
+ { if(!*f) Error(0);}
+
+@@ -125,16 +128,16 @@
+ class OFortranUnFormattedFile {
+ // template<class T> friend OFortranUnFormattedFile & operator<<(OFortranUnFormattedFile &f,const T & l);
+ long i,l,n,j,nb_rec;
+- ostream * f;
++ std::ostream * f;
+ const static char * unkown;
+ int to_close;
+ const char * file_name;
+ 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)
++ OFortranUnFormattedFile(const char *name,IOS_OPENMODE mm=std::ios::trunc)
++ : f(new std::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)
++ OFortranUnFormattedFile(std::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);}
+
diff --git a/math/bamg/files/patch-Metric.cpp b/math/bamg/files/patch-Metric.cpp
new file mode 100644
index 000000000000..4d87aa9f5ee0
--- /dev/null
+++ b/math/bamg/files/patch-Metric.cpp
@@ -0,0 +1,11 @@
+--- Metric.cpp.orig Thu Dec 23 17:25:53 1999
++++ Metric.cpp Fri Dec 19 09:38:12 2003
+@@ -836,7 +836,7 @@
+
+ }
+
+-void Triangles::WriteMetric(ostream & f,int iso)
++void Triangles::WriteMetric(std::ostream & f,int iso)
+ {
+ if (iso)
+ {
diff --git a/math/bamg/files/patch-Metric.h b/math/bamg/files/patch-Metric.h
new file mode 100644
index 000000000000..faa558f02396
--- /dev/null
+++ b/math/bamg/files/patch-Metric.h
@@ -0,0 +1,32 @@
+--- Metric.h.orig Thu Dec 23 14:22:35 1999
++++ Metric.h Thu Dec 18 22:18:24 2003
+@@ -57,7 +57,7 @@
+ MetricIso operator/(Real8 c) const {return MetricIso(h*c);}
+
+ void Box(Real4 & hx,Real4 & hy) { hx=h,hy=h;}
+- friend ostream& operator <<(ostream& f, const MetricIso & M)
++ friend std::ostream& operator <<(std::ostream& f, const MetricIso & M)
+ {f << " h=" << M.h<< ";" ; return f;}
+
+ #ifdef DRAWING
+@@ -88,7 +88,7 @@
+ // Real8 operator()(D2 x) const { return sqrt(x.x*x.x*a11+2*x.x*x.y*a21+x.y*x.y*a22);};
+ Real8 operator()(R2 x,R2 y) const { return x.x*y.x*a11+(x.x*x.y+x.y*y.x)*a21+x.y*y.y*a22;};
+ inline void Box(Real4 &hx,Real4 &hy) const ;
+- friend ostream& operator <<(ostream& f, const MetricAnIso & M)
++ friend std::ostream& operator <<(std::ostream& f, const MetricAnIso & M)
+ {f << " mtr a11=" << M.a11 << " a21=a12=" << M.a21 << " a22=" << M.a22 << ";" ; return f;}
+ #ifdef DRAWING
+ void Draw(R2 ) const;
+@@ -116,9 +116,9 @@
+ void Minh(double h) {Max(1.0/(h*h));}
+ void Maxh(double h) {Min(1.0/(h*h));}
+ void Isotrope() {lambda1=lambda2=::Max(lambda1,lambda2);}
+- friend ostream& operator <<(ostream& f, const MatVVP2x2 & c)
++ friend std::ostream& operator <<(std::ostream& f, const MatVVP2x2 & c)
+ { f << '{' << 1/sqrt(c.lambda1)<< ',' << 1/sqrt(c.lambda2) << ','<< c.v << '}' <<flush ; return f; }
+- friend istream& operator >>(istream& f, MatVVP2x2 & c)
++ friend std::istream& operator >>(std::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) {}
diff --git a/math/bamg/files/patch-QuadTree.cpp b/math/bamg/files/patch-QuadTree.cpp
new file mode 100644
index 000000000000..f5fe6332a02f
--- /dev/null
+++ b/math/bamg/files/patch-QuadTree.cpp
@@ -0,0 +1,11 @@
+--- QuadTree.cpp.orig Thu Dec 23 17:25:53 1999
++++ QuadTree.cpp Fri Dec 19 00:03:06 2003
+@@ -400,7 +400,7 @@
+ root=0;
+ }
+
+-ostream& operator <<(ostream& f, const QuadTree & qt)
++std::ostream& operator <<(std::ostream& f, const QuadTree & qt)
+ {
+ f << " the quadtree " << endl;
+ f << " NbQuadTreeBox = " << qt.NbQuadTreeBox
diff --git a/math/bamg/files/patch-QuadTree.h b/math/bamg/files/patch-QuadTree.h
new file mode 100644
index 000000000000..36901bbf8c8a
--- /dev/null
+++ b/math/bamg/files/patch-QuadTree.h
@@ -0,0 +1,11 @@
+--- QuadTree.h.orig Thu Dec 23 17:25:52 1999
++++ QuadTree.h Thu Dec 18 22:38:50 2003
+@@ -88,7 +88,7 @@
+ ~QuadTree();
+ QuadTree(Triangles * t,long nbv=-1);
+ QuadTree();
+- friend ostream& operator <<(ostream& f, const QuadTree & qt);
++ friend std::ostream& operator <<(std::ostream& f, const QuadTree & qt);
+
+
+
diff --git a/math/bamg/files/patch-R2.h b/math/bamg/files/patch-R2.h
new file mode 100644
index 000000000000..54d503fa70cd
--- /dev/null
+++ b/math/bamg/files/patch-R2.h
@@ -0,0 +1,20 @@
+--- R2.h.orig Tue Dec 1 18:50:24 1998
++++ R2.h Thu Dec 18 22:14:39 2003
+@@ -40,7 +40,7 @@
+ template <class R,class RR>
+ class P2xP2 { // x ligne 1 y ligne2
+
+- friend ostream& operator <<(ostream& f, const P2xP2<R,RR> & c)
++ friend std::ostream& operator <<(std::ostream& f, const P2xP2<R,RR> & c)
+ { f << '[' << c.x << ',' << c.y << ']' <<flush ; return f; }
+
+ friend P2<R,RR> operator*(P2<R,RR> c,P2xP2<R,RR> cc)
+@@ -105,7 +105,7 @@
+ return P2<R,RR>(-x.y,x.x);}
+
+ template <class R,class RR>
+-inline ostream& operator <<(ostream& f, const P2<R,RR> & c)
++inline std::ostream& operator <<(std::ostream& f, const P2<R,RR> & c)
+ { f << '[' << c.x << ',' << c.y <<']' <<flush ; return f; }
+
+
diff --git a/math/bamg/files/patch-SetOfE4.cpp b/math/bamg/files/patch-SetOfE4.cpp
new file mode 100644
index 000000000000..e82d084b5785
--- /dev/null
+++ b/math/bamg/files/patch-SetOfE4.cpp
@@ -0,0 +1,13 @@
+--- SetOfE4.cpp.orig Thu Apr 23 15:01:05 1998
++++ SetOfE4.cpp Fri Dec 19 09:40:37 2003
+@@ -1,7 +1,9 @@
+-#include <iostream.h>
++#include <iostream>
+ #include "meshtype.h"
+ #include "SetOfE4.h"
+
++using std::cerr;
++using std::endl;
+
+ SetOfEdges4::SetOfEdges4(Int4 mmx,Int4 nnx)
+ {nx=nnx;
diff --git a/math/bamg/files/patch-Xrgraph.cpp b/math/bamg/files/patch-Xrgraph.cpp
new file mode 100644
index 000000000000..dc71325e7897
--- /dev/null
+++ b/math/bamg/files/patch-Xrgraph.cpp
@@ -0,0 +1,28 @@
+--- Xrgraph.cpp.orig Wed Mar 29 14:13:46 2000
++++ Xrgraph.cpp Fri Dec 19 13:37:03 2003
+@@ -18,9 +18,13 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <iostream.h>
++#include <iostream>
+ #include <assert.h>
+
++using std::cout;
++using std::cerr;
++using std::endl;
++
+ #define MAXSHORT 0xFFFF
+
+ #ifdef HPPA
+@@ -82,8 +86,8 @@
+ exit(err);}
+
+ #ifdef FREEFEM
+-#include <fstream.h>
+-#include <new.h>
++#include <fstream>
++#include <new>
+
+ void out_of_memory ();
+ void myexit(int );
diff --git a/math/bamg/files/patch-bamg.cpp b/math/bamg/files/patch-bamg.cpp
new file mode 100644
index 000000000000..39e47684bbc8
--- /dev/null
+++ b/math/bamg/files/patch-bamg.cpp
@@ -0,0 +1,81 @@
+--- bamg.cpp.orig Thu Apr 5 10:08:53 2001
++++ bamg.cpp Fri Dec 19 10:52:55 2003
+@@ -18,13 +18,13 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <setjmp.h>
+-#include <new.h>
++#include <new>
+ #include <assert.h>
+ #include "Meshio.h"
+-#include <iomanip.h>
++#include <iomanip>
+ #include "Mesh2.h"
+ #include "QuadTree.h"
+-#include <fstream.h>
++#include <fstream>
+ #ifdef __MWERKS__
+ #define NBVMAX 10000
+ #else
+@@ -67,7 +67,7 @@
+ void forDebug();
+
+
+-void MeshErrorIO(ios& )
++void MeshErrorIO(std::ios& )
+ {
+ MeshError(999);
+ exit(1);
+@@ -139,7 +139,7 @@
+ const char * datafile = argc ==2 ? argv[1] : "DATA_bamg";
+
+ atexit( forDebug);
+- set_new_handler( &NewHandler);
++ std::set_new_handler( &NewHandler);
+
+ if (argc<3)
+ { // for test on the mac
+@@ -495,10 +495,10 @@
+ #endif
+ time3 = CPUtime();
+ if(verbosity> 1)
+- cout << " Cpu for meshing :" << setw(8) << time2-time1
++ cout << " Cpu for meshing :" << std::setw(8) << time2-time1
+ << "s, for Smoothing " << time3-time2
+ << "s Nb Vertices/s = " << (Th.nbv) /(time2-time1)
+- << setw(0) <<endl ;
++ << std::setw(0) <<endl ;
+ if (fmeshout) Th.Write(fmeshout ,Triangles::BDMesh);
+ if (famfmt) Th.Write(famfmt ,Triangles::am_fmtMesh);
+ if (fam) Th.Write(fam ,Triangles::amMesh);
+@@ -516,8 +516,8 @@
+ time3 = CPUtime();
+ if(verbosity>0)
+ {
+- cout << " Cpu for meshing with io :" << setw(8) <<time3-time0
+- << "s Nb Vertices/s = " << (Th.nbv) /(time3-time0) << setw(0)<< endl;
++ cout << " Cpu for meshing with io :" << std::setw(8) <<time3-time0
++ << "s Nb Vertices/s = " << (Th.nbv) /(time3-time0) << std::setw(0)<< endl;
+ cout << " Nb vertices = " << Th.nbv;
+ if (Th.nbt-Th.NbOutT-Th.NbOfQuad*2)
+ cout << " Nb Triangles = " << (Th.nbt-Th.NbOutT-Th.NbOfQuad*2);
+@@ -594,7 +594,7 @@
+ if(verbosity >2)
+ cout << " -- write Metric file " << foM <<endl;
+
+- ofstream f(foM);
++ std::ofstream f(foM);
+ if(f) BTh.WriteMetric(f,iso);
+ }
+
+@@ -672,8 +672,8 @@
+ cerr << " Fatal Error " << "solBB = " << solBB << " solbb= " << solbb << endl;
+ exit(2);}
+
+- ofstream *fbb = wbb ? new ofstream(wbb) :0;
+- ofstream *fBB = wBB ? new ofstream(wBB) :0;
++ std::ofstream *fbb = wbb ? new std::ofstream(wbb) :0;
++ std::ofstream *fBB = wBB ? new std::ofstream(wBB) :0;
+ Int4 nbfieldBB = 0, nbfieldbb = nbsolbb;
+ if (fbb)
+ *fbb << dim << " " << nbsolbb << " " << Th.nbv <<" " << 2 << endl;
diff --git a/math/bamg/files/patch-cvmsh2.cpp b/math/bamg/files/patch-cvmsh2.cpp
new file mode 100644
index 000000000000..0c763287fc6e
--- /dev/null
+++ b/math/bamg/files/patch-cvmsh2.cpp
@@ -0,0 +1,29 @@
+--- cvmsh2.cpp.orig Tue Jun 2 13:21:43 1998
++++ cvmsh2.cpp Fri Dec 19 10:55:43 2003
+@@ -16,7 +16,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <setjmp.h>
+-#include <new.h>
++#include <new>
+ #include <assert.h>
+ #include "Meshio.h"
+ #include "Mesh2.h"
+@@ -42,7 +42,7 @@
+ }
+
+
+-void MeshErrorIO(ios& )
++void MeshErrorIO(std::ios& )
+ {
+ MeshError(999);
+ exit(1);
+@@ -94,7 +94,7 @@
+ return 1;
+ }
+ MeshIstreamErrorHandler = MeshErrorIO;
+- set_new_handler( &NewHandler);
++ std::set_new_handler( &NewHandler);
+ #ifdef DRAWING
+ initgraphique();
+ initgraph=1;
diff --git a/math/bamg/files/patch-drawbdmesh.cpp b/math/bamg/files/patch-drawbdmesh.cpp
new file mode 100644
index 000000000000..bb2faf6ce6ec
--- /dev/null
+++ b/math/bamg/files/patch-drawbdmesh.cpp
@@ -0,0 +1,33 @@
+--- drawbdmesh.cpp.orig Fri Apr 24 09:39:12 1998
++++ drawbdmesh.cpp Fri Dec 19 11:01:38 2003
+@@ -16,7 +16,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <setjmp.h>
+-#include <new.h>
++#include <new>
+ #include <assert.h>
+ #include "Meshio.h"
+ #include "Mesh2.h"
+@@ -41,7 +41,7 @@
+ // DelAllocData();
+ cout << "on a fini" << endl;
+ }
+-void MeshErrorIO(ios& )
++void MeshErrorIO(std::ios& )
+ {
+ MeshError(999);
+ exit(1);
+@@ -53,10 +53,10 @@
+ // atexit( forDebug);
+ double raison=0;
+ verbosity = 9;
+- set_new_handler( &NewHandler);
++ std::set_new_handler( &NewHandler);
+ char * fmeshback= "1.mesh";
+ char * fmetrix= 0;
+- ostream *f_metr(&cout);
++ std::ostream *f_metr(&cout);
+ if (argc >=2)
+ fmeshback = argv[1];
+ if (argc >=3)
diff --git a/math/bamg/pkg-descr b/math/bamg/pkg-descr
new file mode 100644
index 000000000000..0f735f8166a4
--- /dev/null
+++ b/math/bamg/pkg-descr
@@ -0,0 +1,5 @@
+bamg is a Bidimensional Anisotrope Mesh Generator.
+
+Suggested add-on: the port math/freefem++.
+
+WWW: http://www-rocq1.inria.fr/gamma/cdrom/www/bamg/eng.htm
diff --git a/math/bamg/pkg-plist b/math/bamg/pkg-plist
new file mode 100644
index 000000000000..9f2f0a511ebf
--- /dev/null
+++ b/math/bamg/pkg-plist
@@ -0,0 +1,34 @@
+bin/bamg
+bin/bamg-g
+bin/cvmsh2
+bin/drawbdmesh
+%%PORTDOCS%%%%DOCSDIR%%/bamg.ps.gz
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/ad.sh
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/adap.sh
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/adap.sh-g
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/data
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/data-orign
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/naca.awk
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/plot.fv
+%%PORTDOCS%%%%EXAMPLESDIR%%/NACA012/plot.fv-1
+%%PORTDOCS%%%%EXAMPLESDIR%%/quadloop/dotest.pl
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/circle_g.msh
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/doadapt
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/dotest
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/l_g.msh
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/octogone_g.msh
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/square_g.msh
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/square_raf_ani_g.mtr
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/square_raf_g.msh
+%%PORTDOCS%%%%EXAMPLESDIR%%/square/square_raf_g.mtr
+%%PORTDOCS%%%%EXAMPLESDIR%%/test/dotest-o.pl
+%%PORTDOCS%%%%EXAMPLESDIR%%/test/dotest.pl
+%%PORTDOCS%%%%EXAMPLESDIR%%/test/dotest1.pl
+%%PORTDOCS%%%%EXAMPLESDIR%%/test/dotest2.pl
+%%PORTDOCS%%%%EXAMPLESDIR%%/test/dotest3.pl
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/NACA012
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/quadloop
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/square
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%/test
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%