diff -ru ug-orig/arch/AMD64/mk.arch ug-patched/arch/AMD64/mk.arch
--- ug-orig/arch/AMD64/mk.arch	2007-10-16 14:46:51.000000000 +0200
+++ ug-patched/arch/AMD64/mk.arch	2003-11-21 17:22:12.000000000 +0100
@@ -17,7 +17,7 @@
 ARCH_LIBS     = -lm
 
 ARCH_CFLAGS   = -pipe
-ARCH_NOOPTIM  = -g3 -gdwarf-2
+ARCH_NOOPTIM  = -g
 ARCH_OPTIM    = -O3 -fomit-frame-pointer -funroll-loops -fno-strict-aliasing
 ARCH_C++FLAGS = -fpermissive
 ARCH_LFLAGS   =
diff -ru ug-orig/arch/compiler.h ug-patched/arch/compiler.h
--- ug-orig/arch/compiler.h	2007-08-09 19:37:59.000000000 +0200
+++ ug-patched/arch/compiler.h	2007-12-04 14:23:54.000000000 +0100
@@ -18,8 +18,39 @@
 /*                                                                          */
 /****************************************************************************/
 
+/** \file
+    \brief Header file for defining standard constants (machine dependent)
+    
+    This file is part of the old build system.  We strongly suggest you use
+    the new AutoTools build system which does not use this file. 
+
+    In the definitions of the `CFLAGS` in the file 'mk.arch' the
+    key word for a special machine has to be chosen. For example by the 
+    compiler option '-D__HP__' ug is about to run on a HP computer. 
+    Concerning this option the corresponding definitions of the standard 
+    types in the file 'compiler.h' are taken.
+    (The file compiler.h is located in $UGROOT/arch.)
+    
+    As this header file 'compiler.h' defines the standard types used in ug
+    it has to be included in `all` source files of ug!!! 
+    
+    The constant 'ALIGNMENT' has to be set equal to '4' or '8' depending on 
+    the 32 or 64 bit architecture of the machine used. It is also related 
+    to the constant 'ALIGNMASK', which has correspondingly to be set equal 
+    to '0xFFFFFFFC' or '0xFFFFFFF8' to clear the last two or three bits 
+    of a memory address.
+    
+    If you have to add a new mk.? file to support a new machine you also
+    have to provide a new entry in the 'compiler.h' file defining the basic 
+    data types and memory alignment. 
+    To that end you include a flag -D<your new machine>
+    in the CFLAGS section of your new mk.<your new machine> file and add
+    a new paragraph depending on this flag in 'compiler.h'.
+    
+*/
+
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/arch/compiler.h,v 1.71 2007/08/09 17:37:59 lampe Exp $
+$Header$
 */
 
 #ifndef __COMPILER__
@@ -76,6 +107,9 @@
 #define _fmt_lG			"lG"
 #define _fmt_lf			"lf"
 
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
 /****************************************************************************/
 /*                                                                          */
 /* #define exactly one of the following constants: (in Makefile)            */
@@ -863,10 +897,6 @@
 
 #define ARCHNAME	"Mac OS X"
 
-#ifdef __LITTLE_ENDIAN__
-#define __SWAPBYTES__ 1
-#endif
-
 /* memory */
 #define ALIGNMENT     4             /* power of 2 and >= sizeof(int) ! */
 #define ALIGNMASK     0xFFFFFFFC    /* compatible to alignment */
@@ -878,6 +908,9 @@
 #undef CURRENT_TIME
 #define CURRENT_TIME   (((DOUBLE)clock())/((DOUBLE)CLOCKS_PER_SEC))
 
+    /* MAcOS does not have malloc.h */
+#undef HAVE_MALLOC_H
+
 #endif
 
 #ifdef __PPC64__
@@ -970,14 +1003,7 @@
 
 #define ARCH_VERSION "ARCH_1_0"
 
-/* The following is actually a definition (and not just a declaration) in a header
-   file.  Since DUNE actually includes compiler.h twice from a single source, this
-   definition has to go.  Yes, I know, including a header twice is not nice, but
-   I currently see no other way.
-*/     
-#ifndef FOR_DUNE
-static char compilerrcs_id[] = "$Id: compiler.h,v 1.71 2007/08/09 17:37:59 lampe Exp $";
-#endif
+static char compilerrcs_id[] = "$Id: compiler.h 8307 2007-12-04 13:23:54Z sander $";
 
 /* limits of the basic types */
 #define MAX_S            SHRT_MAX        
Nur in ug-orig/arch: .cvsignore.
diff -ru ug-orig/arch/CYGWIN/mk.arch ug-patched/arch/CYGWIN/mk.arch
--- ug-orig/arch/CYGWIN/mk.arch	2004-03-09 17:07:01.000000000 +0100
+++ ug-patched/arch/CYGWIN/mk.arch	2004-03-09 17:07:06.000000000 +0100
@@ -1,27 +1,27 @@
-#
-#	ARCH MAKEFILE OPTIONS
-#
-#	for Windows + Cygwin
-#
-
-ARCH_TYPE     = __CYGWIN__
-
-ARCH_MAKE     = make
-ARCH_CC       = gcc
-ARCH_C++      = g++
-ARCH_LINK     = gcc
-ARCH_AR       = ar
-ARCH_SUFFIX   = 
-ARCH_POSTLINK = true
-
-ARCH_LIBS     = -lrpclib -lm
-
-ARCH_CFLAGS   = -pipe
-ARCH_NOOPTIM  = -g -Wall -Wno-unused -Wno-parentheses
-ARCH_OPTIM    = -s -O3 -march=i686 -fomit-frame-pointer -funroll-loops -fno-strict-aliasing
-ARCH_C++FLAGS = -fpermissive
-ARCH_LFLAGS   =
-ARCH_ARFLAGS  = rus
-
-ARCH_XINCLUDES = -I/usr/X11R6/include
-ARCH_XLIBS     = -L/usr/X11R6/lib -lXaw -lXt -lXpm -lXmu -lX11 -lXext -lSM -lICE
+#
+#	ARCH MAKEFILE OPTIONS
+#
+#	for Windows + Cygwin
+#
+
+ARCH_TYPE     = __CYGWIN__
+
+ARCH_MAKE     = make
+ARCH_CC       = gcc
+ARCH_C++      = g++
+ARCH_LINK     = gcc
+ARCH_AR       = ar
+ARCH_SUFFIX   = 
+ARCH_POSTLINK = true
+
+ARCH_LIBS     = -lrpclib -lm
+
+ARCH_CFLAGS   = -pipe
+ARCH_NOOPTIM  = -g -Wall -Wno-unused -Wno-parentheses
+ARCH_OPTIM    = -s -O3 -march=i686 -fomit-frame-pointer -funroll-loops -fno-strict-aliasing
+ARCH_C++FLAGS = -fpermissive
+ARCH_LFLAGS   =
+ARCH_ARFLAGS  = rus
+
+ARCH_XINCLUDES = -I/usr/X11R6/include
+ARCH_XLIBS     = -L/usr/X11R6/lib -lXaw -lXt -lXpm -lXmu -lX11 -lXext -lSM -lICE
diff -ru ug-orig/arch/LINUXIA64/mk.arch ug-patched/arch/LINUXIA64/mk.arch
--- ug-orig/arch/LINUXIA64/mk.arch	2007-10-25 17:09:45.000000000 +0200
+++ ug-patched/arch/LINUXIA64/mk.arch	2001-09-12 18:46:29.000000000 +0200
@@ -7,21 +7,21 @@
 ARCH_TYPE     = __LINUXIA64__
 
 ARCH_MAKE     = make
-ARCH_CC       = mpicc
-ARCH_C++      = mpiCC
-ARCH_LINK     = mpicc
+ARCH_CC       = ecc
+ARCH_C++      =
+ARCH_LINK     = ecc
 ARCH_AR       = ar
 ARCH_SUFFIX   = 
 ARCH_POSTLINK = true
 
 ARCH_LIBS     = 
 
-ARCH_CFLAGS   = 
-ARCH_NOOPTIM  = -g
-ARCH_OPTIM    = -O3 -tpp2 -ip
+ARCH_CFLAGS   = -O3 -ip # ecc beta: leave it exactly as it is and recompile
+ARCH_NOOPTIM  =         # ug/np/algebra/fvgeom.c and ug/parallel/ddd/basic/lowcomm.c
+ARCH_OPTIM    =         # by hand with -O2 -ip only (Sep 2001) !!!
 ARCH_C++FLAGS =
-ARCH_LFLAGS   = 
+ARCH_LFLAGS   = -Wl,-relax
 ARCH_ARFLAGS  = rus
 
 ARCH_XINCLUDES = 
-ARCH_XLIBS     = 
+ARCH_XLIBS     = #-L/usr/X11R6/lib -lXaw -lXt -lXmu -lXpm -lXext -lX11 -lSM -lICE
diff -ru ug-orig/arch/MACOSX64/mk.arch ug-patched/arch/MACOSX64/mk.arch
--- ug-orig/arch/MACOSX64/mk.arch	2008-02-11 20:05:34.000000000 +0100
+++ ug-patched/arch/MACOSX64/mk.arch	2006-06-10 16:14:21.000000000 +0200
@@ -1,37 +1,46 @@
-#
 #       ARCH MAKEFILE OPTIONS
 #
 #       for MacOS X on a 64-bit processor
 #
+#		change the last lines if you want to use Quartz instead of X11
+#
 
-# use this for G5 Macs
-#ARCH_TYPE     = __PPC64__
-
-# use this for Intel Macs
-ARCH_TYPE     = __AMD64__
+ARCH_TYPE     = __PPC64__
 
 ARCH_MAKE     = gnumake
+ARCH_PMAKE     = gnumake -j 4
 ARCH_CC       = gcc
 ARCH_C++      = g++
 ARCH_LINK     = gcc
 ARCH_AR       = ugarranlib ar
 ARCH_SUFFIX   = 
-ARCH_POSTLINK = true
+#ARCH_POSTLINK = ugmacosxpostlink $(PROGNAME) $(APPL)
+ARCH_POSTLINK =
 
 ARCH_LIBS     = 
+ARCH_PLIBS    =
+ARCH_FLIBS    =
 
+#ARCH_CFLAGS   = -arch ppc64 -Wchar-subscripts -Wformat -Wimplicit -Wparentheses -Wno-four-char-constants -Wreturn-type -Wswitch -Wtrigraphs -O -Wuninitialized
+#ARCH_CFLAGS   = -arch ppc64 -gccincludes -ext o -I/usr/include -I/System/Library/Frameworks/System.framework/Versions/B/Headers
 ARCH_CFLAGS   = -m64
+ARCH_C++FLAGS = -m64
 ARCH_NOOPTIM  = -g
 ARCH_OPTIM    = -O3 -fomit-frame-pointer -funroll-loops -fno-strict-aliasing
-ARCH_C++FLAGS = $(ARCH_CFLAGS)
-ARCH_LFLAGS   = $(ARCH_CFLAGS)
+#ARCH_LFLAGS   = -arch ppc64 -sectcreate __ICON __header $(APPL).iconheader -segprot __ICON r r -sectcreate __ICON app $(UGROOT)/dev/mif/UGIcon.tiff -framework AppKit -framework Foundation
+ARCH_LFLAGS   = -m64
 ARCH_ARFLAGS  = ru
+ARCH_FFLAGS   =
+ARCH_EXFLAGS  =
+
+# use these settings if you want to use MacOS X GUI
+#ARCH_XINCLUDES =
+#ARCH_XLIBS     = -framework Cocoa
 
 # use these settings if you want to use X11
-# last time I checked, Apple didn't supply 64-bit X libs
-#ARCH_XINCLUDES = -I/usr/X11R6/include
-#ARCH_XLIBS     = -L/usr/X11R6/lib -lXaw -lXt -lXpm -lXmu -lX11 -lXext -lSM -lICE
+#ARCH_XINCLUDES = -I/usr/X11R6/include/
+#ARCH_XLIBS     = -L/usr/X11R6/lib  -lXaw -lXt -lXpm -lXmu -lX11 -lXext -lSM -lICE
 
-# use these settings if you do not use X11
+# use these settings if you do not use a GUI
 ARCH_XINCLUDES =
 ARCH_XLIBS     =
diff -ru ug-orig/arch/Makefile.am ug-patched/arch/Makefile.am
--- ug-orig/arch/Makefile.am	2004-09-09 16:44:57.000000000 +0200
+++ ug-patched/arch/Makefile.am	2004-09-09 16:44:57.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/09 14:44:57 thimo Exp $
+# $Id: Makefile.am 7793 2004-09-09 14:44:57Z thimo $
 
 SOURCES = compiler.h
 
diff -ru ug-orig/autogen.sh ug-patched/autogen.sh
--- ug-orig/autogen.sh	2007-05-22 09:11:27.000000000 +0200
+++ ug-patched/autogen.sh	2007-02-14 19:46:04.000000000 +0100
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: autogen.sh,v 1.5 2007/05/22 07:11:27 sander Exp $
+# $Id: autogen.sh 8266 2007-02-14 18:46:04Z christi $
 
 # barf on errors
 set -e
@@ -112,4 +112,4 @@
 export CFLAGS="$COMPFLAGS"
 export CXXFLAGS="$COMPFLAGS"
 
-#eval ./configure $DEFAULTCONFOPT $CONFOPT
+# eval ./configure $DEFAULTCONFOPT $CONFOPT
diff -ru ug-orig/bin/ugbcheck.awk ug-patched/bin/ugbcheck.awk
--- ug-orig/bin/ugbcheck.awk	1996-06-27 11:54:41.000000000 +0200
+++ ug-patched/bin/ugbcheck.awk	1996-06-27 11:54:41.000000000 +0200
@@ -8,16 +8,16 @@
 #   the output is piped into this awk-script in order to check for
 #   valid configurations.
 #
-#   the executable must contain the keywords $Header: /Users/mirror/CVS/UG/ug/bin/ugbcheck.awk,v 1.4 1996/06/27 09:54:41 birken Exp $ and $State: Exp $
-#   for each object file. the $State: Exp $ line must give information with
+#   the executable must contain the keywords $Header$ and $State$
+#   for each object file. the $State$ line must give information with
 #   syntax PROPERTY=VALUE, where PROPERTY is the name of a compile time
 #   switch (or #define) and VALUE is its value at compile time.
 #   sample excerpt from 'ident libddd.a' output:
 #
-#   $Header: /Users/mirror/CVS/UG/ug/bin/ugbcheck.awk,v 1.4 1996/06/27 09:54:41 birken Exp $
-#   $State: Exp $
-#   $Header: /Users/mirror/CVS/UG/ug/bin/ugbcheck.awk,v 1.4 1996/06/27 09:54:41 birken Exp $
-#   $State: Exp $
+#   $Header$
+#   $State$
+#   $Header$
+#   $State$
 #   [...]
 #
 #   this awk-script builds up a database for this P-V-pairs, and 
diff -ru ug-orig/bin/ugexo2lgm ug-patched/bin/ugexo2lgm
--- ug-orig/bin/ugexo2lgm	2004-03-09 11:38:28.000000000 +0100
+++ ug-patched/bin/ugexo2lgm	2004-03-09 11:38:28.000000000 +0100
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexo2lgm,v 1.9 2004/03/09 10:38:28 stefan Exp $
+# $Header$
 # usage: ugexo2lgm <exo2filename> <lgmfilename>
 # 		<exo2filename> - exodus II file with surface triangulation and node 
 #					 assoziativity info
diff -ru ug-orig/bin/ugexo2lgm_usn ug-patched/bin/ugexo2lgm_usn
--- ug-orig/bin/ugexo2lgm_usn	2004-03-05 14:02:49.000000000 +0100
+++ ug-patched/bin/ugexo2lgm_usn	2004-03-05 14:02:49.000000000 +0100
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexo2lgm_usn,v 1.1 2004/03/05 13:02:49 stefan Exp $
+# $Header$
 # usage: ugexo2lgm_usn <cubit_logfile> <cubit_sncmd_file>
 #
 # author: Stefan Lang, INF 368, IWR, University of Heidelberg
diff -ru ug-orig/bin/ugexo2mbg_vol ug-patched/bin/ugexo2mbg_vol
--- ug-orig/bin/ugexo2mbg_vol	2005-04-06 13:23:11.000000000 +0200
+++ ug-patched/bin/ugexo2mbg_vol	2005-04-06 13:23:11.000000000 +0200
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexo2mbg_vol,v 1.1 2005/04/06 11:23:11 stefan Exp $
+# $Header$
 # usage: ugexo2mbg_vol <cubit_logfile> <cubit_volcmd_file>
 #
 # author: Stefan Lang, INF 368, IWR, University of Heidelberg
diff -ru ug-orig/bin/ugexo2ng ug-patched/bin/ugexo2ng
--- ug-orig/bin/ugexo2ng	2004-03-23 18:10:24.000000000 +0100
+++ ug-patched/bin/ugexo2ng	2004-03-23 18:10:24.000000000 +0100
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexo2ng,v 1.7 2004/03/23 17:10:24 stefan Exp $
+# $Header$
 # usage: ugexo2ng <exo2filename> <lgmfilename> <ngfilename>
 # 		<exo2filename> - exodus II file with volume meshing and nodeset/sideset 
 #					 assoziativity info
diff -ru ug-orig/bin/ugexo2ng_bss ug-patched/bin/ugexo2ng_bss
--- ug-orig/bin/ugexo2ng_bss	2004-03-05 14:02:49.000000000 +0100
+++ ug-patched/bin/ugexo2ng_bss	2004-03-05 14:02:49.000000000 +0100
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexo2ng_bss,v 1.1 2004/03/05 13:02:49 stefan Exp $
+# $Header$
 # usage: ugexo2ng_bss <cubit_logfile> <cubit_sscmd_file>
 #
 # author: Stefan Lang, INF 368, IWR, University of Heidelberg
diff -ru ug-orig/bin/ugexoenroll ug-patched/bin/ugexoenroll
--- ug-orig/bin/ugexoenroll	2004-03-29 17:06:50.000000000 +0200
+++ ug-patched/bin/ugexoenroll	2004-03-29 17:06:50.000000000 +0200
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w #-d
-# $Header: /Users/mirror/CVS/UG/ug/bin/ugexoenroll,v 1.4 2004/03/29 15:06:50 stefan Exp $
+# $Header$
 # usage: ugexoenroll <modelname> <lgmfilename>
 #       <modelname> - name of model to generate mesh for
 #
diff -ru ug-orig/bin/ugmake ug-patched/bin/ugmake
--- ug-orig/bin/ugmake	2004-08-30 15:49:26.000000000 +0200
+++ ug-patched/bin/ugmake	2004-08-30 15:49:26.000000000 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: ugmake,v 1.26 2004/08/30 13:49:26 thimo Exp $
+# $Id: ugmake 7746 2004-08-30 13:49:26Z thimo $
 
 # TODO:
 #
Nur in ug-patched/bin: ugmakecat.
Nur in ug-patched/bin: ugmakecatman.
Nur in ug-orig/bin: ugpvd.
Nur in ug-orig/bin: ugvisit.
diff -ru ug-orig/config.h ug-patched/config.h
--- ug-orig/config.h	2005-07-18 11:29:51.000000000 +0200
+++ ug-patched/config.h	2005-07-18 11:29:51.000000000 +0200
@@ -5,7 +5,7 @@
  switches it's functionality depending on symbols in config.h. As the
  compiler complains if no config.h is found we need this dummy.
 
- $Id: config.h,v 1.4 2005/07/18 09:29:51 thimo Exp $
+ $Id: config.h 8043 2005-07-18 09:29:51Z thimo $
 */
 
 /* Define this if you want to use the full refinement rule set for tetrahedra */
Nur in ug-patched/configs: 2FTFF.conf.
Nur in ug-patched/configs: 2TFFF.conf.
Nur in ug-patched/configs: 2TTFF.conf.
Nur in ug-patched/configs: 3FFTF.conf.
Nur in ug-patched/configs: 3TFFF.conf.
diff -ru ug-orig/configure.ac ug-patched/configure.ac
--- ug-orig/configure.ac	2006-11-15 15:06:01.000000000 +0100
+++ ug-patched/configure.ac	2007-09-17 16:26:50.000000000 +0200
@@ -230,9 +230,6 @@
 		 np/amglib/Makefile
 		 np/field/Makefile
 		 np/procs/Makefile
-		 np/slu/Makefile
-		 np/slu/cblas/Makefile
-		 np/slu/src/Makefile
 		 np/udm/Makefile
 		 tools/Makefile
                  ui/Makefile
@@ -242,6 +239,7 @@
                  parallel/ppif/MPI/Makefile
 		 parallel/ddd/Makefile
 		 parallel/dddif/Makefile
+		 parallel/chaco/Makefile
                  libug.pc
 ])
 AC_OUTPUT
@@ -255,7 +253,6 @@
 dnl                  gm/gg3/netgen/linalg/makefile
 dnl                  gm/gg3/netgen/meshing/makefile
 dnl                  gm/gg3/netgen/opti/makefile
-dnl                  parallel/chaco/Makefile
 dnl                  parallel/chaco/assign/Makefile
 dnl                  parallel/chaco/bpmatch/Makefile
 dnl                  parallel/chaco/coarsen/Makefile
Nur in ug-orig: .cvsignore.
Nur in ug-orig/dev: .cvsignore.
diff -ru ug-orig/dev/initdev.h ug-patched/dev/initdev.h
--- ug-orig/dev/initdev.h	2004-07-21 11:20:02.000000000 +0200
+++ ug-patched/dev/initdev.h	2004-07-21 11:22:02.000000000 +0200
@@ -22,7 +22,7 @@
 /****************************************************************************/
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/initdev.h,v 1.12 2004/07/21 09:20:02 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/Makefile.am ug-patched/dev/Makefile.am
--- ug-orig/dev/Makefile.am	2004-09-08 13:29:50.000000000 +0200
+++ ug-patched/dev/Makefile.am	2004-09-08 13:29:50.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2004/09/08 11:29:50 thimo Exp $
+# $Id: Makefile.am 7783 2004-09-08 11:29:50Z thimo $
 
 # !!! test and include them:
 #
Nur in ug-orig/dev/meta: .cvsignore.
diff -ru ug-orig/dev/meta/Makefile.am ug-patched/dev/meta/Makefile.am
--- ug-orig/dev/meta/Makefile.am	2004-09-02 14:22:03.000000000 +0200
+++ ug-patched/dev/meta/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:03 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS)
 
diff -ru ug-orig/dev/meta/metafile.c ug-patched/dev/meta/metafile.c
--- ug-orig/dev/meta/metafile.c	2006-06-02 18:25:20.000000000 +0200
+++ ug-patched/dev/meta/metafile.c	2006-06-02 18:25:44.000000000 +0200
@@ -129,7 +129,7 @@
 static long saveColor;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/meta/metafile.c,v 1.23 2006/06/02 16:25:20 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
Nur in ug-orig/dev/mif: .cvsignore.
Binärdateien ug-orig/dev/mif/Icons16x16/Arrow.tiff and ug-patched/dev/mif/Icons16x16/Arrow.tiff sind verschieden.
Binärdateien ug-orig/dev/mif/Icons16x16/Magnify.tiff and ug-patched/dev/mif/Icons16x16/Magnify.tiff sind verschieden.
diff -ru ug-orig/dev/mif/MacGraph.c ug-patched/dev/mif/MacGraph.c
--- ug-orig/dev/mif/MacGraph.c	2006-06-02 18:25:44.000000000 +0200
+++ ug-patched/dev/mif/MacGraph.c	2006-06-02 18:25:44.000000000 +0200
@@ -109,7 +109,7 @@
 static char buffer[255];
 	
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacGraph.c,v 1.22 2006/06/02 16:25:44 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/mif/MacGraph.h ug-patched/dev/mif/MacGraph.h
--- ug-orig/dev/mif/MacGraph.h	2002-02-12 17:48:50.000000000 +0100
+++ ug-patched/dev/mif/MacGraph.h	2002-02-12 17:48:50.000000000 +0100
@@ -20,7 +20,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacGraph.h,v 1.8 2002/02/12 16:48:50 reichenb Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/mif/MacMain.c ug-patched/dev/mif/MacMain.c
--- ug-orig/dev/mif/MacMain.c	2006-06-02 18:25:44.000000000 +0200
+++ ug-patched/dev/mif/MacMain.c	2006-06-02 18:25:44.000000000 +0200
@@ -109,7 +109,7 @@
 static OUTPUTDEVICE *MacOutputDevice;	/* ptr to MacOutputDevice			*/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacMain.c,v 1.17 2006/06/02 16:25:44 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/mif/MacMain.h ug-patched/dev/mif/MacMain.h
--- ug-orig/dev/mif/MacMain.h	1997-07-18 16:58:44.000000000 +0200
+++ ug-patched/dev/mif/MacMain.h	1997-07-18 17:00:14.000000000 +0200
@@ -20,7 +20,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacMain.h,v 1.3 1997/07/18 14:58:44 birken Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/mif/MacShell.c ug-patched/dev/mif/MacShell.c
--- ug-orig/dev/mif/MacShell.c	2006-06-02 18:25:44.000000000 +0200
+++ ug-patched/dev/mif/MacShell.c	2006-06-02 18:25:44.000000000 +0200
@@ -134,7 +134,7 @@
 static ControlActionUPP MyShellScrollActionPtr;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacShell.c,v 1.17 2006/06/02 16:25:44 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/mif/MacShell.h ug-patched/dev/mif/MacShell.h
--- ug-orig/dev/mif/MacShell.h	2002-02-12 17:48:50.000000000 +0100
+++ ug-patched/dev/mif/MacShell.h	2002-02-12 17:48:50.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacShell.h,v 1.5 2002/02/12 16:48:50 reichenb Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/mif/MacSurface.c ug-patched/dev/mif/MacSurface.c
--- ug-orig/dev/mif/MacSurface.c	2006-06-02 18:25:44.000000000 +0200
+++ ug-patched/dev/mif/MacSurface.c	2006-06-02 18:25:44.000000000 +0200
@@ -100,7 +100,7 @@
 int screenHeight;					/* screen size while program is running */
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacSurface.c,v 1.12 2006/06/02 16:25:44 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/mif/MacSurface.h ug-patched/dev/mif/MacSurface.h
--- ug-orig/dev/mif/MacSurface.h	2002-02-12 17:48:50.000000000 +0100
+++ ug-patched/dev/mif/MacSurface.h	2002-02-12 17:48:50.000000000 +0100
@@ -20,7 +20,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/mif/MacSurface.h,v 1.4 2002/02/12 16:48:50 reichenb Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/mif/Makefile.am ug-patched/dev/mif/Makefile.am
--- ug-orig/dev/mif/Makefile.am	2004-09-02 14:22:04.000000000 +0200
+++ ug-patched/dev/mif/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:04 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS)
 
diff -ru ug-orig/dev/mif/MAppController.h ug-patched/dev/mif/MAppController.h
--- ug-orig/dev/mif/MAppController.h	1999-06-18 12:50:06.000000000 +0200
+++ ug-patched/dev/mif/MAppController.h	1999-06-18 12:50:13.000000000 +0200
@@ -35,4 +35,4 @@
 - (void)showInspector:(id)sender;
 - (void)showPreferences:(id)sender;
 - (void)dealloc;
-@end
\ Kein Zeilenumbruch am Dateiende.
+@end
diff -ru ug-orig/dev/mif/MAppController.m ug-patched/dev/mif/MAppController.m
--- ug-orig/dev/mif/MAppController.m	1999-09-08 17:23:55.000000000 +0200
+++ ug-patched/dev/mif/MAppController.m	1999-09-08 17:24:03.000000000 +0200
@@ -101,4 +101,4 @@
     [super dealloc];
 }
 
-@end
\ Kein Zeilenumbruch am Dateiende.
+@end
diff -ru ug-orig/dev/mif/MInterface.m ug-patched/dev/mif/MInterface.m
--- ug-orig/dev/mif/MInterface.m	2004-05-04 15:05:18.000000000 +0200
+++ ug-patched/dev/mif/MInterface.m	2004-05-04 15:05:18.000000000 +0200
@@ -60,7 +60,7 @@
 /*		  macros															*/
 /*																			*/
 /****************************************************************************/
-#define VERSION 	"This is "UG_VERSION" from $Date: 2004/05/04 13:05:18 $\n"
+#define VERSION 	"This is "UG_VERSION" from $Date: 2004-05-04 15:05:18 +0200 (Di, 04 Mai 2004) $\n"
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/mif/MShell.h ug-patched/dev/mif/MShell.h
--- ug-orig/dev/mif/MShell.h	1999-09-08 17:23:59.000000000 +0200
+++ ug-patched/dev/mif/MShell.h	1999-09-08 17:24:03.000000000 +0200
@@ -58,4 +58,4 @@
 - (NSRange)textView:(NSTextView *)aTextView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange;*/
 @end
 
-#endif
\ Kein Zeilenumbruch am Dateiende.
+#endif
diff -ru ug-orig/dev/mif/MShell.m ug-patched/dev/mif/MShell.m
--- ug-orig/dev/mif/MShell.m	1999-09-08 17:23:59.000000000 +0200
+++ ug-patched/dev/mif/MShell.m	1999-09-08 17:24:03.000000000 +0200
@@ -215,4 +215,4 @@
     return YES;
 }
 @end
-
\ Kein Zeilenumbruch am Dateiende.
+
diff -ru ug-orig/dev/mif/MShellTextView.h ug-patched/dev/mif/MShellTextView.h
--- ug-orig/dev/mif/MShellTextView.h	1999-06-18 12:50:11.000000000 +0200
+++ ug-patched/dev/mif/MShellTextView.h	1999-06-18 12:50:13.000000000 +0200
@@ -25,7 +25,7 @@
 @interface MShellTextView : NSTextView
 {
 	int startPosition;					// This is the start of the current command.
-    NSTextStorage *theTextStore;
+    NSTextStorage *theTextStore;
 
     NSMutableArray	*theCommandList;	// store the history of entered commands
     unsigned int	commandCount;		// count the number of entered commands
@@ -44,10 +44,10 @@
 
 - (void) appendText:(NSString *)str;
 
-- (void)keyDown:(NSEvent *)theEvent;
+- (void)keyDown:(NSEvent *)theEvent;
 
 - (void) replaceCurrentCommandWith:(NSString *)command;
 
-- (void)highlightError;
+- (void)highlightError;
 
-@end
\ Kein Zeilenumbruch am Dateiende.
+@end
diff -ru ug-orig/dev/mif/MShellTextView.m ug-patched/dev/mif/MShellTextView.m
--- ug-orig/dev/mif/MShellTextView.m	1999-09-08 17:24:00.000000000 +0200
+++ ug-patched/dev/mif/MShellTextView.m	1999-09-08 17:24:03.000000000 +0200
@@ -21,7 +21,7 @@
 #include "cmdint.h"
 
 
-#define RETURN    @"\015"
+#define RETURN    @"\015"
 #define BACKSPACE @"\010"
 
 
@@ -86,7 +86,7 @@
     [self setFont:[NSFont userFixedPitchFontOfSize:10.0]];
 
     /*[self setFont:[NSFont userFixedPitchFontOfSize:10]
-          range:NSMakeRange(0,[[self string] length])];
+          range:NSMakeRange(0,[[self string] length])];
 
     printf ("4 Desired font is %s, ", [[[NSFont userFixedPitchFontOfSize:18] displayName] lossyCString]);
     printf ("Current font is %s ", [[[self font] displayName] lossyCString]);
@@ -97,7 +97,7 @@
     if ([self shouldChangeTextInRange:NSMakeRange(0,[[self string] length])
                     replacementString:nil])
     {
-        [theTextStore beginEditing];
+        [theTextStore beginEditing];
         [theTextStore addAttributes:textAttributes range:NSMakeRange(0,[[self string] length])];
         [theTextStore fixAttributesInRange:NSMakeRange(0,[[self string] length])];
         [theTextStore endEditing];
@@ -121,12 +121,12 @@
     if ([self shouldChangeTextInRange:NSMakeRange([theTextStore length]-plen, plen)
                     replacementString:nil])
     {
-        [theTextStore beginEditing];
-        [theTextStore addAttributes:promptAttributes range:NSMakeRange([theTextStore length]-plen, plen-1)];
-        [theTextStore addAttributes:cmdlineAttributes range:NSMakeRange([theTextStore length]-1, 1)];
+        [theTextStore beginEditing];
+        [theTextStore addAttributes:promptAttributes range:NSMakeRange([theTextStore length]-plen, plen-1)];
+        [theTextStore addAttributes:cmdlineAttributes range:NSMakeRange([theTextStore length]-1, 1)];
         [theTextStore endEditing];
         [self didChangeText];
-    }
+    }
 
     startPosition = [theTextStore length];
     [self scrollRangeToVisible:NSMakeRange(startPosition, 0)];
@@ -138,7 +138,7 @@
 {
     static int i;
 
-    [self moveToEndOfDocument:self];
+    [self moveToEndOfDocument:self];
     /* this changes the font back to Helvetica! 
     [theTextStore
             replaceCharactersInRange:NSMakeRange([theTextStore length], 0)
@@ -157,7 +157,7 @@
     return;
 }
 
-- (void) keyDown:(NSEvent *)theEvent
+- (void) keyDown:(NSEvent *)theEvent
 {
     unichar key;
     
@@ -166,12 +166,12 @@
         return;
     }
     
-    if ([self selectedRange].location < startPosition)
-    {
+    if ([self selectedRange].location < startPosition)
+    {
         [self moveToEndOfDocument:self]; 	// ...not implemented yet
         [self setSelectedRange:NSMakeRange([[self string] length],0)];
-        [self scrollRangeToVisible:[self selectedRange]];  
-    }
+        [self scrollRangeToVisible:[self selectedRange]];  
+    }
 
     key = [[theEvent characters] characterAtIndex:0];
 
@@ -200,19 +200,19 @@
         [self moveToEndOfDocument:self];
         [self setSelectedRange:NSMakeRange([[self string] length],0)];
 
-        [super keyDown:theEvent];
+        [super keyDown:theEvent];
         [theUGshell interpretCommand:command];
-        [self appendPrompt];
-        [self scrollRangeToVisible:[self selectedRange]];
-        startPosition = [[self string] length];
+        [self appendPrompt];
+        [self scrollRangeToVisible:[self selectedRange]];
+        startPosition = [[self string] length];
         [currentLine setString:@""];
-    }
+    }
 	
     else if ( key==NSLeftArrowFunctionKey
               && !([theEvent modifierFlags] & NSCommandKeyMask))
    {
-      	if ([self selectedRange].location > startPosition)
-       		[super keyDown:theEvent];
+      	if ([self selectedRange].location > startPosition)
+       		[super keyDown:theEvent];
     }
     
     else if ( key==NSUpArrowFunctionKey
@@ -232,9 +232,9 @@
             currCommandNumber--;
             [self replaceCurrentCommandWith:[theCommandList objectAtIndex:currCommandNumber%MAX_BUFFERED_COMMANDS]];
         }
-    }
+    }
 
-    else if ( key==NSDownArrowFunctionKey 
+    else if ( key==NSDownArrowFunctionKey 
               && !([theEvent modifierFlags] & NSCommandKeyMask))
     {
         currCommandNumber++;
@@ -245,12 +245,12 @@
             [self replaceCurrentCommandWith:currentLine];
             currCommandNumber = commandCount;
         }
-    }
+    }
 
     else if ( (key==NSBackspaceCharacter || key==NSBackTabCharacter || key==NSDeleteCharacter)
               && !([theEvent modifierFlags] & NSCommandKeyMask))
     {
-        if ([self selectedRange].location > startPosition)	{
+        if ([self selectedRange].location > startPosition)	{
             [super keyDown:theEvent];
        	}
 	}
@@ -285,11 +285,11 @@
         [self moveToEndOfDocument:self];
         [self setSelectedRange:NSMakeRange([[self string] length],0)];
 
-        [super keyDown:theEvent];
+        [super keyDown:theEvent];
         [theUGshell interpretCommand:command];
-        [self appendPrompt];
-        [self scrollRangeToVisible:[self selectedRange]];
-        startPosition = [[self string] length];
+        [self appendPrompt];
+        [self scrollRangeToVisible:[self selectedRange]];
+        startPosition = [[self string] length];
         [currentLine setString:@""];*/
     }
     
@@ -301,17 +301,17 @@
 }
 
 - (void) replaceCurrentCommandWith:(NSString *)command
-{
+{
     [self setSelectedRange:NSMakeRange(startPosition,[[self string] length]-startPosition)];
     [theTextStore addAttributes:cmdlineAttributes range:NSMakeRange(startPosition,[[self string] length]-startPosition)];
-    [self insertText:command];
-    [self moveToEndOfDocument:self];
+    [self insertText:command];
+    [self moveToEndOfDocument:self];
     [self scrollRangeToVisible:[self selectedRange]];
 
     return;
-}
+}
 
-- (void)highlightError
+- (void)highlightError
 {
 	NSRange range=[[theTextStore string] rangeOfString:@"\n" options:NSLiteralSearch
 				range:NSMakeRange(startPosition,[[self string] length]-startPosition)];
@@ -319,12 +319,12 @@
 	if ( range.length>0 )
         if ([self shouldChangeTextInRange:NSMakeRange(startPosition,range.location-startPosition) replacementString:nil])
         {
-            [theTextStore beginEditing];
-            [theTextStore addAttributes:errorAttributes range:NSMakeRange(startPosition,range.location-startPosition)];
+            [theTextStore beginEditing];
+            [theTextStore addAttributes:errorAttributes range:NSMakeRange(startPosition,range.location-startPosition)];
             [theTextStore endEditing];
             [self didChangeText];
-        }
+        }
 }
-
 
-@end
\ Kein Zeilenumbruch am Dateiende.
+
+@end
diff -ru ug-orig/dev/mif/MShellView.h ug-patched/dev/mif/MShellView.h
--- ug-orig/dev/mif/MShellView.h	1999-06-10 20:47:15.000000000 +0200
+++ ug-patched/dev/mif/MShellView.h	1999-06-10 20:47:19.000000000 +0200
@@ -41,4 +41,4 @@
 - (MShellTextView *)textView;
 - (NSScrollView *)scrollView;
 
-@end
\ Kein Zeilenumbruch am Dateiende.
+@end
diff -ru ug-orig/dev/mif/MShellView.m ug-patched/dev/mif/MShellView.m
--- ug-orig/dev/mif/MShellView.m	1999-09-08 17:24:00.000000000 +0200
+++ ug-patched/dev/mif/MShellView.m	1999-09-08 17:24:03.000000000 +0200
@@ -139,4 +139,4 @@
   return theScrollView;
 }
 
-@end
\ Kein Zeilenumbruch am Dateiende.
+@end
diff -ru ug-orig/dev/mif/MShellWindow.h ug-patched/dev/mif/MShellWindow.h
--- ug-orig/dev/mif/MShellWindow.h	1999-06-10 20:47:16.000000000 +0200
+++ ug-patched/dev/mif/MShellWindow.h	1999-06-10 20:47:19.000000000 +0200
@@ -32,4 +32,4 @@
                 defer:(BOOL)flag;
 @end
 
-#endif
\ Kein Zeilenumbruch am Dateiende.
+#endif
diff -ru ug-orig/dev/mif/MShellWindow.m ug-patched/dev/mif/MShellWindow.m
--- ug-orig/dev/mif/MShellWindow.m	1999-06-18 12:50:12.000000000 +0200
+++ ug-patched/dev/mif/MShellWindow.m	1999-06-18 12:50:13.000000000 +0200
@@ -49,4 +49,4 @@
 }
 
 @end
-
\ Kein Zeilenumbruch am Dateiende.
+
Nur in ug-orig/dev/nif: .cvsignore.
diff -ru ug-orig/dev/nif/Makefile.am ug-patched/dev/nif/Makefile.am
--- ug-orig/dev/nif/Makefile.am	2004-09-02 14:22:04.000000000 +0200
+++ ug-patched/dev/nif/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,3 +1,3 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:04 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 
diff -ru ug-orig/dev/nif/NeXTInterface.h ug-patched/dev/nif/NeXTInterface.h
--- ug-orig/dev/nif/NeXTInterface.h	1998-09-02 14:25:21.000000000 +0200
+++ ug-patched/dev/nif/NeXTInterface.h	1998-09-02 14:28:06.000000000 +0200
@@ -38,7 +38,7 @@
 #import <appkit/Window.h>
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/nif/NeXTInterface.h,v 1.3 1998/09/02 12:25:21 henrik Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/nif/NeXTInterface.m ug-patched/dev/nif/NeXTInterface.m
--- ug-orig/dev/nif/NeXTInterface.m	1998-08-07 15:36:53.000000000 +0200
+++ ug-patched/dev/nif/NeXTInterface.m	1998-08-07 15:39:05.000000000 +0200
@@ -60,7 +60,7 @@
 /*		  macros															*/
 /*																			*/
 /****************************************************************************/
-#define VERSION 	"This is "UG_VERSION" from $Date: 1998/08/07 13:36:53 $\n"
+#define VERSION 	"This is "UG_VERSION" from $Date: 1998-08-07 15:39:05 +0200 (Fr, 07 Aug 1998) $\n"
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/nif/UGGraphWindow.h ug-patched/dev/nif/UGGraphWindow.h
--- ug-orig/dev/nif/UGGraphWindow.h	1998-09-02 14:25:23.000000000 +0200
+++ ug-patched/dev/nif/UGGraphWindow.h	1998-09-02 14:28:06.000000000 +0200
@@ -29,7 +29,7 @@
 #endif
  
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/nif/UGGraphWindow.h,v 1.3 1998/09/02 12:25:23 henrik Exp $
+$Header$
 */
 
 
Nur in ug-orig/dev/ppm: .cvsignore.
diff -ru ug-orig/dev/ppm/Makefile.am ug-patched/dev/ppm/Makefile.am
--- ug-orig/dev/ppm/Makefile.am	2004-09-02 14:22:05.000000000 +0200
+++ ug-patched/dev/ppm/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:05 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS)
 
diff -ru ug-orig/dev/ppm/ppm.c ug-patched/dev/ppm/ppm.c
--- ug-orig/dev/ppm/ppm.c	2004-11-02 11:35:33.000000000 +0100
+++ ug-patched/dev/ppm/ppm.c	2004-11-02 11:35:35.000000000 +0100
@@ -71,7 +71,7 @@
 static short BlueTab[COLORS]; 
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/ppm/ppm.c,v 1.10 2004/11/02 10:35:33 thimo Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
Nur in ug-orig/dev/ps: .cvsignore.
diff -ru ug-orig/dev/ps/Makefile.am ug-patched/dev/ps/Makefile.am
--- ug-orig/dev/ps/Makefile.am	2004-09-02 14:22:05.000000000 +0200
+++ ug-patched/dev/ps/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:05 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS)
 
diff -ru ug-orig/dev/ps/postscriptbw.c ug-patched/dev/ps/postscriptbw.c
--- ug-orig/dev/ps/postscriptbw.c	2005-07-22 15:01:14.000000000 +0200
+++ ug-patched/dev/ps/postscriptbw.c	2005-07-22 15:01:14.000000000 +0200
@@ -116,7 +116,7 @@
 static float blue[COLORS];
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/ps/postscriptbw.c,v 1.7 2005/07/22 13:01:14 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/ps/postscript.c ug-patched/dev/ps/postscript.c
--- ug-orig/dev/ps/postscript.c	2004-07-21 11:20:03.000000000 +0200
+++ ug-patched/dev/ps/postscript.c	2004-07-21 11:22:02.000000000 +0200
@@ -115,7 +115,7 @@
 static float blue[COLORS];
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/ps/postscript.c,v 1.28 2004/07/21 09:20:03 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
Nur in ug-orig/dev/rif: .cvsignore.
diff -ru ug-orig/dev/rif/Makefile.am ug-patched/dev/rif/Makefile.am
--- ug-orig/dev/rif/Makefile.am	2004-09-02 14:22:06.000000000 +0200
+++ ug-patched/dev/rif/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:06 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS)
 
diff -ru ug-orig/dev/rif/remote.c ug-patched/dev/rif/remote.c
--- ug-orig/dev/rif/remote.c	2005-07-14 13:40:24.000000000 +0200
+++ ug-patched/dev/rif/remote.c	2005-07-14 13:40:24.000000000 +0200
@@ -82,7 +82,7 @@
 /****************************************************************************/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/rif/remote.c,v 1.14 2005/07/14 11:40:24 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 
 
Nur in ug-orig/dev/sif: .cvsignore.
diff -ru ug-orig/dev/sif/Makefile.am ug-patched/dev/sif/Makefile.am
--- ug-orig/dev/sif/Makefile.am	2004-09-02 14:22:06.000000000 +0200
+++ ug-patched/dev/sif/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:06 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 AM_CPPFLAGS = $(UG_CPPFLAGS) -I$(top_srcdir)/low
 
diff -ru ug-orig/dev/sif/sif.c ug-patched/dev/sif/sif.c
--- ug-orig/dev/sif/sif.c	2004-07-21 11:20:04.000000000 +0200
+++ ug-patched/dev/sif/sif.c	2004-07-21 11:22:02.000000000 +0200
@@ -58,7 +58,7 @@
 /****************************************************************************/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/sif/sif.c,v 1.13 2004/07/21 09:20:04 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/sockcomm.c ug-patched/dev/sockcomm.c
--- ug-orig/dev/sockcomm.c	1997-09-10 12:32:42.000000000 +0200
+++ ug-patched/dev/sockcomm.c	1997-09-10 12:32:42.000000000 +0200
@@ -38,7 +38,7 @@
 /****************************************************************************/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/sockcomm.c,v 1.8 1997/09/10 10:32:42 wieners Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 
 /****************************************************************************/
diff -ru ug-orig/dev/sockcomm.h ug-patched/dev/sockcomm.h
--- ug-orig/dev/sockcomm.h	1997-10-08 19:45:43.000000000 +0200
+++ ug-patched/dev/sockcomm.h	1997-10-08 19:45:43.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/sockcomm.h,v 1.8 1997/10/08 17:45:43 reichenb Exp $
+$Header$
 */
 
 
diff -ru ug-orig/dev/ugdevices.c ug-patched/dev/ugdevices.c
--- ug-orig/dev/ugdevices.c	2005-07-18 15:42:28.000000000 +0200
+++ ug-patched/dev/ugdevices.c	2007-01-08 14:46:05.000000000 +0100
@@ -90,9 +90,14 @@
 /*																			*/
 /****************************************************************************/
 
-/* the mute level is set by the MuteCommand and used for output control		*/
-/* convention: 0 is default, <0 produces less output, >0 produces more outpu*/
+/* the mute level is set by the MuteCommand and used for output control.
+   convention: 0 is default, <0 produces less output, >0 produces more output.
+   When compiling for DUNE, the default is -1001, which equals total silence. */
+#ifndef FOR_DUNE
 static INT mutelevel=0;
+#else
+static INT mutelevel=-1001;
+#endif
 
 static FILE *logFile=NULL;						/* log file pointer 		*/
 static OUTPUTDEVICE *defaultOuputDevice=NULL;	/* console graphical outp.	*/
@@ -101,7 +106,7 @@
 static INT theOutputDevVarID;			/* env type for Output Device vars	*/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/ugdevices.c,v 1.12 2005/07/18 13:42:28 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/ugdevices.doc ug-patched/dev/ugdevices.doc
--- ug-orig/dev/ugdevices.doc	1998-08-07 16:42:03.000000000 +0200
+++ ug-patched/dev/ugdevices.doc	2007-12-04 10:57:48.000000000 +0100
@@ -67,124 +67,6 @@
 /*D
     OUTPUTDEVICE - data structure to define an interface to output devices
     
-    PURPOSE:
-    The struct 'OUTPUTDEVICE' defines an interface to an output device with
-    graphics capabilites. ug uses a default output device which usually is your
-    computer monitor. Additionally there can be defined several other output devices.
-    
-    Up to now there is implemented an interface to XWindows of UNIX and to the
-    Macintosh OS with the possibilties of window handling and plotting.
-    They serve as default output device.
-    
-    Another output is the 'meta' ouput device. This is a format to write graphics commands
-    to file which later can be view with the 'xugv' tool or that can be translated to PostScript
-    format using the 'm2ps' tool. It is a lean storage format
-    suited quite well for producing and viewing "films" with many pictures of time dependent solutions.
-    It is also a helpful tool for production runs on large problems which often will run
-    in batch mode.
-    
-    In the near future probably also a PostScript output device will exist.
-    
-    The output device struct requires functions for opening, closing, activating and updating
-    a window on the device. Then there is a collection of graphics functions to set color,
-    line width move the cursor, draw lines and higher level functions to plot filled polygons
-    and text.
-    
-    Additionally there is information specified on the color palette used and some standard
-    colors are defined.
-    
-    DEFINITION:
-.vb
-// abstract graphical output device 
-struct outputdevice {
-
-    // This is an environment variable 
-    ENVVAR v;
-
-    // properties 
-    long black;                         // value for black                                      
-    long white;                         // value for white                                      
-    long red;                           // value for red                                        
-    long green;                         // value for green                                      
-    long blue;                          // value for blue                                       
-    long cyan;                          // value for cyan                                       
-    long orange;                        // value for orange                                     
-    long yellow;                        // value for yellow                                     
-    long darkyellow;                    // value for yellow                                     
-    long magenta;                       // value for magenta                                    
-    short hasPalette;                   // 1 if device has a color lookup table                 
-    long range;                         // # of possible color indices                          
-    long spectrumStart;                 // usable range for a continuous                        
-    long spectrumEnd;                   // color spectrum                                       
-    DOUBLE PixelRatio;                   // ratio of (physical) hight to width of a pixel        
-
-    // pointers to basic drawing functions 
-    void (*Move) (SHORT_POINT);             // move in device coordinates       
-    void (*Draw) (SHORT_POINT);             // draw from current point to given 
-    void (*Polyline) (SHORT_POINT *, INT ); // draw a polyline                  
-    void (*InversePolyline) (SHORT_POINT *, INT );          
-                                            // draw an inverted polyline        
-    void (*Polygon) (SHORT_POINT *, INT );  // fill a polygon w. curr. col      
-    void (*InversePolygon) (SHORT_POINT *, INT );           
-                                            // invert a polygon w. curr. col    
-    void (*ErasePolygon) (SHORT_POINT *, INT );             
-                                            // erase a polygon w. curr. col     
-    void (*Polymark) (short, SHORT_POINT *);// place markers                    
-    
-    void (*Text) (const char *, INT);       // draw text in current size/font
-    void (*CenteredText) (SHORT_POINT, const char *, INT);  
-                                            // draw text centered at x,y        
-                                            // possible text modes are 
-                                            // TEXT_REGULAR and TEXT_INVERSE 
-                                            // (the last argument)
-    
-    void (*ClearViewPort)(void);            // clear a view port                
-    
-    // pointers to set functions 
-    void (*SetLineWidth) (short);           // line width in pixels (points)    
-    void (*SetTextSize) (short);            // text size in pixels (points)     
-    void (*SetMarker) (short);              // set marker id                    
-    void (*SetMarkerSize) (short);          // marker size in pixels (points)   
-    void (*SetColor) (long);                // arg is index or direct col value 
-    void (*SetPaletteEntry) (long,short,short,short);       
-                                            // set index to value               
-    void (*SetNewPalette) (long,long,short*,short*,short*); 
-                                            // replace entry                    
-    
-    // pointers to miscellaneous functions 
-    void (*GetPaletteEntry) (long,short *,short *,short *); 
-                                            // read color table                 
-    void (*Flush) (void);                   // flush graphics buffer            
-    
-    // operations for managing windows 
-    OpenOutputPtr OpenOutput;               // function to open a window                              
-    CloseOutputPtr CloseOutput;             // function to close a window                             
-    ActivateOutputPtr ActivateOutput;       // function to activate window                            
-    UpdateOutputPtr UpdateOutput;           // function to draw outline with tool
-                                            // and info box        
-};
-
-typedef struct outputdevice     OUTPUTDEVICE;
-
-// type for device coordinates 
-typedef struct
-{
-    short x;
-    short y;
-} SHORT_POINT ;
-
-// identification of windows 
-typedef INT WINDOWID;
-
-// function types exported by OUTPUTDEVICE 
-typedef WINDOWID (*OpenOutputPtr)     (const char *title,
-                      INT x, INT y, INT width, INT height,
-                      INT *Global_LL, INT *Global_UR, INT *Local_LL, INT *Local_UR, INT *error); 
-typedef INT      (*CloseOutputPtr)    (WINDOWID win);
-typedef INT      (*ActivateOutputPtr) (WINDOWID win);
-typedef INT      (*UpdateOutputPtr)   (WINDOWID win, char *s, INT tool);
-.ve
-
     STRUCT COMPONENTS:
     We only explain the function pointers together with their arguments and types in correct order.
     
@@ -198,7 +80,7 @@
 .   ErasePolygon    - erase filled polygon (closed) connecting 'SHORT_POINT points[], INT nPoints' in total
 .   Polymark        - plot 'short nMarkers' at 'SHORT_POINT points[]'
 .   Text            - write text at 'SHORT_POINT position' with 'INT mode' TEXT_REGULAR or TEXT_INVERSE
-.   CenteredText    - write centered text at'SHORT_POINT position' with 'INT mode' TEXT_REGULAR or TEXT_INVERSE
+.   CenteredText    - write centered text at 'SHORT_POINT position' with 'INT mode' TEXT_REGULAR or TEXT_INVERSE
 .   ClearViewPort   - clear the whole view port of the window
 .   SetLineWidth    - set current line width to 'short width'
 .   SetTextSize     - set current text size to 'short size'
@@ -228,118 +110,3 @@
 D*/
 /****************************************************************************/
 
-/****************************************************************************/
-/*D
-    EVENT - data structure for the ug event handling
-    
-    PURPOSE:
-    The event handling of ug defines several possible event types the interface
-    function 'GetNextUGEvent' can return to 'ProcessEvent'. Depending on the
-    event type data are transferred by the corresponding component in the union.
-    The events are distinguished by the 'Type' component in the 'EVENT'
-    
-    DEFINITION:
-.vb
-typedef union {
-    INT Type;
-    NO_UGEVENT              NoEvent;
-    TERM_GOAWAY_EVENT       TermGoAway;
-    TERM_CMDKEY_EVENT       TermCmdKey;
-    TERM_STRING_EVENT       TermString;
-    DOC_GOAWAY_EVENT        DocGoAway;
-    DOC_ACTIVATE_EVENT      DocActivate;
-    DOC_DRAG_EVENT          DocDrag;
-    DOC_GROW_EVENT          DocGrow;
-    DOC_CHANGETOOL_EVENT    DocChangeTool;
-    DOC_CONTENTCLICK_EVENT  DocContentClick;
-    DOC_UPDATE_EVENT        DocUpdate;
-} EVENT;
-
-typedef struct {                    // no event                                 
-    INT Type;                       // event type                               
-    
-    // data 
-    INT InterfaceEvent;             // 1 if the interface event was handled     
-} NO_UGEVENT;
-
-typedef struct {                    // go away event for terminal window        
-    INT Type;                       // event type                               
-} TERM_GOAWAY_EVENT;
-
-typedef struct {                    // cmd key event for terminal window        
-    INT Type;                       // event type                               
-    
-    // data 
-    char CmdKey;                    // character from keyboard                  
-} TERM_CMDKEY_EVENT;
-
-typedef struct {                    // string event for terminal window         
-    INT Type;                       // event type                               
-    
-    // data 
-    char String[INPUTBUFFERLEN];    // string from keyboard                     
-} TERM_STRING_EVENT;
-
-typedef struct {                    // go away event for view                   
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-} DOC_GOAWAY_EVENT;
-
-typedef struct {                    // activate event for view                  
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-} DOC_ACTIVATE_EVENT;
-
-typedef struct {                    // drag event for view                      
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-    INT Global_LL[2];               // new absolute position of window on screen
-    INT Global_UR[2];               //                                          
-} DOC_DRAG_EVENT;
-
-typedef struct {                    // grow event for view                      
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-    INT Global_LL[2];               // new absolute position of window on screen
-    INT Global_UR[2];               //                                          
-    INT Local_LL[2];                // range of pixels used for plotting (view port)        
-    INT Local_UR[2];                //                                          
-} DOC_GROW_EVENT;
-
-typedef struct {                    // change tool event for view               
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-    INT Tool;                       // change to that tool                      
-} DOC_CHANGETOOL_EVENT;
-
-typedef struct {                    // content click event for view             
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-    INT MousePosition[2];           // mouse position                           
-} DOC_CONTENTCLICK_EVENT;
-
-typedef struct {                    // update event for view                    
-    INT Type;                       // event type                               
-    
-    // data 
-    WINDOWID win;                   // the window                               
-} DOC_UPDATE_EVENT;
-.ve
-
-    SEE ALSO:
-    ProcessEvent, GetNextUGEvent
-
-D*/
-/****************************************************************************/
diff -ru ug-orig/dev/ugdevices.h ug-patched/dev/ugdevices.h
--- ug-orig/dev/ugdevices.h	2005-08-08 10:05:19.000000000 +0200
+++ ug-patched/dev/ugdevices.h	2007-12-04 10:57:48.000000000 +0100
@@ -20,7 +20,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/ugdevices.h,v 1.8 2005/08/08 08:05:19 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
@@ -132,11 +132,11 @@
 /*                                                                                                                                                      */
 /****************************************************************************/
 
-/* identification of windows, used to carry a pointer (xif, ppm, ps)
+/** \brief Identification of windows, used to carry a pointer (xif, ppm, ps)
    or INT (rif) */
 typedef void* WINDOWID;
 
-/* type for device coordinates */
+/** \brief Type for device coordinates */
 typedef struct
 {
         short x;
@@ -149,13 +149,38 @@
 typedef INT      (*ActivateOutputPtr) (WINDOWID win);
 typedef INT      (*UpdateOutputPtr)   (WINDOWID win, INT tool);
 
-/* abstract graphical output device */
+/** \brief Data structure to define an interface to output devices
+    
+    The struct 'OUTPUTDEVICE' defines an interface to an output device with
+    graphics capabilites. ug uses a default output device which usually is your
+    computer monitor. Additionally there can be defined several other output devices.
+    
+    Up to now there is implemented an interface to XWindows of UNIX and to the
+    Macintosh OS with the possibilties of window handling and plotting.
+    They serve as default output device.
+    
+    Another output is the 'meta' ouput device. This is a format to write graphics commands
+    to file which later can be view with the 'xugv' tool or that can be translated to PostScript
+    format using the 'm2ps' tool. It is a lean storage format
+    suited quite well for producing and viewing "films" with many pictures of time dependent solutions.
+    It is also a helpful tool for production runs on large problems which often will run
+    in batch mode.
+    
+    In the near future probably also a PostScript output device will exist.
+    
+    The output device struct requires functions for opening, closing, activating and updating
+    a window on the device. Then there is a collection of graphics functions to set color,
+    line width move the cursor, draw lines and higher level functions to plot filled polygons
+    and text.
+    
+    Additionally there is information specified on the color palette used and some standard
+    colors are defined.
+*/
 struct outputdevice {
 
-        /* This is an environment variable */
+    /** \brief This is an environment variable */
         ENVVAR v;
 
-        /* properties */
         long black;                                             /* value for black                                                                              */
         long gray;                          /* value for gray                                       */
         long white;                                             /* value for white                                                                              */
@@ -214,8 +239,8 @@
 
 
 
-/* event structure */
-typedef struct {                                        /* no event                                                             */
+/** \brief No event */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
@@ -224,39 +249,45 @@
         INT Mouse[2];                                   /* current mouse coord (rel. to window)         */
 } NO_UGEVENT;
 
-typedef struct {                                        /* go away event for terminal window            */
+/** \brief Go away event for terminal window            */
+typedef struct {
         INT Type;                                               /* event type                                                           */
 } TERM_GOAWAY_EVENT;
 
-typedef struct {                                        /* cmd key event for terminal window            */
+/** \brief Cmd key event for terminal window            */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
         char CmdKey;                                    /* character from keyboard                                      */
 } TERM_CMDKEY_EVENT;
 
-typedef struct {                                        /* string event for terminal window             */
+/** \brief String event for terminal window             */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
         char String[INPUTBUFFERLEN];    /* string from keyboard                                         */
 } TERM_STRING_EVENT;
 
-typedef struct {                                        /* go away event for view                                       */
+/** \brief Go away event for view                                       */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
         WINDOWID win;                                   /* the window                                                           */
 } DOC_GOAWAY_EVENT;
 
-typedef struct {                                        /* activate event for view                                      */
+/** \brief Activate event for view                                      */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
         WINDOWID win;                                   /* the window                                                           */
 } DOC_ACTIVATE_EVENT;
 
-typedef struct {                                        /* drag event for view                                          */
+/** \brief Drag event for view                                          */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
@@ -265,7 +296,8 @@
         INT Global_UR[2];                               /*                                                                                      */
 } DOC_DRAG_EVENT;
 
-typedef struct {                                        /* grow event for view                                          */
+/** \brief Grow event for view                                          */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
@@ -276,7 +308,8 @@
         INT Local_UR[2];                                /*                                                                                      */
 } DOC_GROW_EVENT;
 
-typedef struct {                                        /* change tool event for view                           */
+/** \brief Change tool event for view                           */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
@@ -285,7 +318,8 @@
         INT MousePosition[2];                   /* mouse position                                                       */
 } DOC_CHANGETOOL_EVENT;
 
-typedef struct {                                        /* content click event for view                         */
+/** \brief Content click event for view                         */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
@@ -293,13 +327,21 @@
         INT MousePosition[2];                   /* mouse position                                                       */
 } DOC_CONTENTCLICK_EVENT;
 
-typedef struct {                                        /* update event for view                                        */
+/** \brief Update event for view                                        */
+typedef struct {
         INT Type;                                               /* event type                                                           */
         
         /* data */
         WINDOWID win;                                   /* the window                                                           */
 } DOC_UPDATE_EVENT;
 
+/** \brief Data structure for the ug event handling
+    
+    The event handling of ug defines several possible event types the interface
+    function 'GetNextUGEvent' can return to 'ProcessEvent'. Depending on the
+    event type data are transferred by the corresponding component in the union.
+    The events are distinguished by the 'Type' component in the 'EVENT'
+*/
 typedef union {
         INT Type;
         NO_UGEVENT                              NoEvent;
Nur in ug-orig/dev/xif: .cvsignore.
diff -ru ug-orig/dev/xif/Makefile.am ug-patched/dev/xif/Makefile.am
--- ug-orig/dev/xif/Makefile.am	2005-01-19 15:53:16.000000000 +0100
+++ ug-patched/dev/xif/Makefile.am	2005-01-19 15:53:16.000000000 +0100
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2005/01/19 14:53:16 thimo Exp $
+# $Id: Makefile.am 7937 2005-01-19 14:53:16Z thimo $
 
 # commands.h will gm.h und der braucht Dimension
 AM_CPPFLAGS = $(UG_2DFLAGS) -I$(top_srcdir)/low
diff -ru ug-orig/dev/xif/shades.h ug-patched/dev/xif/shades.h
--- ug-orig/dev/xif/shades.h	1997-11-10 16:39:25.000000000 +0100
+++ ug-patched/dev/xif/shades.h	1997-11-10 16:39:25.000000000 +0100
@@ -20,7 +20,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/xif/shades.h,v 1.2 1997/11/10 15:39:25 wieners Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/xif/xgraph.c ug-patched/dev/xif/xgraph.c
--- ug-orig/dev/xif/xgraph.c	2008-02-26 18:24:35.000000000 +0100
+++ ug-patched/dev/xif/xgraph.c	2006-12-12 17:18:44.000000000 +0100
@@ -41,6 +41,9 @@
 
 /* standard C includes */
 #include <stdio.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
 #include <stddef.h>
 #include <string.h>
 
@@ -136,7 +139,7 @@
 static int red_shift, green_shift, blue_shift;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/xif/xgraph.c,v 1.39 2008/02/26 17:24:35 lampe Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 unsigned long NS_PREFIX UGBlack (void)
 {
diff -ru ug-orig/dev/xif/xgraph.h ug-patched/dev/xif/xgraph.h
--- ug-orig/dev/xif/xgraph.h	2004-08-30 16:44:02.000000000 +0200
+++ ug-patched/dev/xif/xgraph.h	2004-08-30 16:44:02.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/xif/xgraph.h,v 1.8 2004/08/30 14:44:02 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/xif/xmain.c ug-patched/dev/xif/xmain.c
--- ug-orig/dev/xif/xmain.c	2006-05-08 14:31:52.000000000 +0200
+++ ug-patched/dev/xif/xmain.c	2006-05-08 14:31:52.000000000 +0200
@@ -95,7 +95,7 @@
 FILE *o_pipe=NULL;						    /* output from ug               */
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/xif/xmain.c,v 1.40 2006/05/08 12:31:52 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/xif/xmain.h ug-patched/dev/xif/xmain.h
--- ug-orig/dev/xif/xmain.h	2004-12-17 19:21:46.000000000 +0100
+++ ug-patched/dev/xif/xmain.h	2004-12-17 19:21:46.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/xif/xmain.h,v 1.10 2004/12/17 18:21:46 klaus Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dev/xif/xshell.c ug-patched/dev/xif/xshell.c
--- ug-orig/dev/xif/xshell.c	2008-02-26 18:24:35.000000000 +0100
+++ ug-patched/dev/xif/xshell.c	2006-12-12 17:18:44.000000000 +0100
@@ -49,6 +49,9 @@
 /* standard C includes */
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
 #include <string.h>
 #include <ctype.h>
 
@@ -151,7 +154,7 @@
 #endif
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dev/xif/xshell.c,v 1.31 2008/02/26 17:24:35 lampe Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dev/xif/xshell.h ug-patched/dev/xif/xshell.h
--- ug-orig/dev/xif/xshell.h	1997-07-18 16:58:48.000000000 +0200
+++ ug-patched/dev/xif/xshell.h	1997-07-18 17:00:14.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dev/xif/xshell.h,v 1.6 1997/07/18 14:58:48 birken Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/doc/header.h ug-patched/doc/header.h
--- ug-orig/doc/header.h	1997-08-12 11:57:49.000000000 +0200
+++ ug-patched/doc/header.h	1997-08-12 11:57:49.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/doc/header.h,v 1.4 1997/08/12 09:57:49 df Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/doc/source.c ug-patched/doc/source.c
--- ug-orig/doc/source.c	1997-01-16 22:48:41.000000000 +0100
+++ ug-patched/doc/source.c	1997-01-16 22:48:41.000000000 +0100
@@ -63,7 +63,7 @@
 /****************************************************************************/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/doc/source.c,v 1.5 1997/01/16 21:48:41 henrik Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
Nur in ug-orig/dom: .cvsignore.
diff -ru ug-orig/dom/domain.h ug-patched/dom/domain.h
--- ug-orig/dom/domain.h	2006-06-02 18:12:21.000000000 +0200
+++ ug-patched/dom/domain.h	2006-06-02 18:15:49.000000000 +0200
@@ -32,7 +32,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/domain.h,v 1.48 2006/06/02 16:12:21 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
Nur in ug-orig/dom/gen: .cvsignore.
diff -ru ug-orig/dom/gen/gen.c ug-patched/dom/gen/gen.c
--- ug-orig/dom/gen/gen.c	2000-02-28 00:58:19.000000000 +0100
+++ ug-patched/dom/gen/gen.c	2000-02-28 00:58:19.000000000 +0100
@@ -90,7 +90,7 @@
 static BndGeomProcPtr Geom;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/gen/gen.c,v 1.10 2000/02/27 23:58:19 wieners Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dom/gen/gen.h ug-patched/dom/gen/gen.h
--- ug-orig/dom/gen/gen.h	2000-02-10 12:48:52.000000000 +0100
+++ ug-patched/dom/gen/gen.h	2000-02-10 12:48:54.000000000 +0100
@@ -18,7 +18,7 @@
 /****************************************************************************/
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/gen/gen.h,v 1.6 2000/02/10 11:48:52 wieners Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dom/gen/gen_parallel.c ug-patched/dom/gen/gen_parallel.c
--- ug-orig/dom/gen/gen_parallel.c	2005-07-06 11:49:04.000000000 +0200
+++ ug-patched/dom/gen/gen_parallel.c	2005-07-06 11:49:04.000000000 +0200
@@ -83,7 +83,7 @@
 static INT BVP_type = BVP_GENERAL;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/gen/gen_parallel.c,v 1.4 2005/07/06 09:49:04 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dom/gen/Makefile.am ug-patched/dom/gen/Makefile.am
--- ug-orig/dom/gen/Makefile.am	2004-09-02 14:22:07.000000000 +0200
+++ ug-patched/dom/gen/Makefile.am	2004-09-02 14:22:17.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.1 2004/09/02 12:22:07 thimo Exp $
+# $Id: Makefile.am 7772 2004-09-02 12:22:17Z thimo $
 
 SOURCES = gen.c gen_parallel.c gen.h
 
diff -ru ug-orig/dom/lgm/ansys2lgm.c ug-patched/dom/lgm/ansys2lgm.c
--- ug-orig/dom/lgm/ansys2lgm.c	2006-11-08 16:35:43.000000000 +0100
+++ ug-patched/dom/lgm/ansys2lgm.c	2006-12-05 10:03:34.000000000 +0100
@@ -211,7 +211,7 @@
 /* ... DIRKS NEU */
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ansys2lgm.c,v 1.36 2006/11/08 15:35:43 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 
 
diff -ru ug-orig/dom/lgm/ansys2lgm.h ug-patched/dom/lgm/ansys2lgm.h
--- ug-orig/dom/lgm/ansys2lgm.h	2006-05-08 14:18:23.000000000 +0200
+++ ug-patched/dom/lgm/ansys2lgm.h	2006-05-08 14:31:31.000000000 +0200
@@ -18,7 +18,7 @@
 /****************************************************************************/
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ansys2lgm.h,v 1.13 2006/05/08 12:18:23 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
Nur in ug-orig/dom/lgm: .cvsignore.
diff -ru ug-orig/dom/lgm/lgm_domain2d.c ug-patched/dom/lgm/lgm_domain2d.c
--- ug-orig/dom/lgm/lgm_domain2d.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_domain2d.c	2006-12-05 10:03:34.000000000 +0100
@@ -87,7 +87,7 @@
 /****************************************************************************/
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_domain2d.c,v 1.26 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dom/lgm/lgm_domain3d.c ug-patched/dom/lgm/lgm_domain3d.c
--- ug-orig/dom/lgm/lgm_domain3d.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_domain3d.c	2006-12-05 10:03:34.000000000 +0100
@@ -127,7 +127,7 @@
 extern int AddGeomElement (int node0, int node1, int node2, int neigbor0, int neigbor1, int neigbor2);
 
 /* data for CVS */
-/*static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_domain3d.c,v 1.82 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+/*static char RCS_ID("$Header$",UG_RCS_STRING);
 */
 static INT currSubdom, currSurface, currLine;
 
@@ -1431,20 +1431,24 @@
 	n1[1] = p2[1] - p0[1];
 	n1[2] = p2[2] - p0[2];
 
-	l1 = Lenght(n1);
-	Scale(n1, 1.0/l1);
+        V3_EUKLIDNORM(n1,l1);
+/* 	Scale(n1, 1.0/l1); */
+        V3_SCALE(1.0/l1,n1);
 
 	n2[0] = p2[0] - p1[0];
 	n2[1] = p2[1] - p1[1];
 	n2[2] = p2[2] - p1[2];
 
-	l2 = Lenght(n2);
-	Scale(n2, 1.0/l2);
+        V3_EUKLIDNORM(n2,l2);
+/* 	Scale(n2, 1.0/l2); */
+        V3_SCALE(1.0/l2, n2);
+
+/* 	Cross(n, n1, n2); */
+        V3_VECTOR_PRODUCT(n1,n2,n);
+        V3_EUKLIDNORM(n,l);
+/* 	Scale(n, 1.0/l); */
+        V3_SCALE(1.0/l, n);
 
-	Cross(n, n1, n2);
-	l = Lenght(n);
-	Scale(n, 1.0/l);
-	
 	return(0);
 }
 
@@ -1466,7 +1470,8 @@
 	/* get Normalvector to the Triangle j */
 	Normal_Vector(p0, p1, p2, &n2[0]);
 
-	scalarproduct =  Mult(n1, n2);
+/* 	scalarproduct =  Mult(n1, n2); */
+        V3_SCALAR_PRODUCT(n1, n2, scalarproduct);
 	return(scalarproduct);
 }
 
@@ -1712,7 +1717,8 @@
 	/* get Normalvector to the Triangle i */
 	Normal_Vector(p0, p1, p2, &n1[0]);
 
-	scalarproduct =  Mult(n1, n);
+/* 	scalarproduct =  Mult(n1, n); */
+        V3_SCALAR_PRODUCT(n1, n, scalarproduct);
 	return(scalarproduct);
 }
 
@@ -3040,15 +3046,15 @@
 		
 	/* compute 2 vectors in the plane + normalvector */	
 	Minus(n0,e2,e0);
-	l = Lenght(n0);
+        V3_EUKLIDNORM(n0,l);
 	Scale(n0,1.0/l);
 
 	Minus(n1,e2,e1);
-	l = Lenght(n1);
+        V3_EUKLIDNORM(n1,l);
 	Scale(n1,1.0/l);
 
 	Cross(n2,n0,n1);
-	l = Lenght(n2);
+        V3_EUKLIDNORM(n2,l);
 	Scale(n2,1.0/l);
 
 	p[0] = global[0];
@@ -3125,7 +3131,8 @@
 	lam[1] = bb[1];
 	lam[2] = 1 - bb[0] - bb[1];
 
-	return(Lenght(hp));
+        V3_EUKLIDNORM(hp,l);
+        return l;
 }	
 
 static INT NormalVector(LGM_TRIANGLE *theSurfaceTriangle, DOUBLE *n)
@@ -5734,7 +5741,7 @@
 	B[0] = globalp2[0] - globalp1[0];
 	B[1] = globalp2[1] - globalp1[1];
 	B[2] = globalp2[2] - globalp1[2];
-	LGM_VECTOR_PRODUCT(A, B, BNDP_NV);
+	V3_VECTOR_PRODUCT(A, B, BNDP_NV);
 // This is wrong. OS_CHANGED
 //	V_DIM_SCALE(1.0/sqrt(V_DIM_SCAL_PROD(BNDP_NV, BNDP_NV)),BNDP_NV);
 
@@ -5966,9 +5973,9 @@
 	B[2] = LGM_POINT_POS(LGM_TRIANGLE_CORNER(LGM_SURFACE_TRIANGLE(theSurface,ilocal),2))[2]
 			- LGM_POINT_POS(LGM_TRIANGLE_CORNER(LGM_SURFACE_TRIANGLE(theSurface,ilocal),1))[2];
 		
-	LGM_VECTOR_PRODUCT(A, B, Surface_NV);
+	V3_VECTOR_PRODUCT(A, B, Surface_NV);
 
-	LGM_SCALAR_PRODUCT(BNDP_NV, Surface_NV, sp);
+	V3_SCALAR_PRODUCT(BNDP_NV, Surface_NV, sp);
 
 
 	if(sp>0.0)
diff -ru ug-orig/dom/lgm/lgm_domain.c ug-patched/dom/lgm/lgm_domain.c
--- ug-orig/dom/lgm/lgm_domain.c	2006-11-08 16:35:43.000000000 +0100
+++ ug-patched/dom/lgm/lgm_domain.c	2006-12-07 15:52:44.000000000 +0100
@@ -57,7 +57,7 @@
 static INT theProblemVarID;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_domain.c,v 1.39 2006/11/08 15:35:43 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 
 /****************************************************************************/
@@ -87,7 +87,7 @@
 D*/
 /****************************************************************************/
 
-LGM_PROBLEM* NS_DIM_PREFIX CreateProblem (char *name, InitProcPtr init, DomainSizeConfig domconfig, BndCondProcPtr BndCond, int numOfCoefficients, CoeffProcPtr coeffs[], int numOfUserFct, UserProcPtr userfct[])
+LGM_PROBLEM* NS_DIM_PREFIX CreateProblem (const char *name, InitProcPtr init, DomainSizeConfig domconfig, BndCondProcPtr BndCond, int numOfCoefficients, CoeffProcPtr coeffs[], int numOfUserFct, UserProcPtr userfct[])
 {
 	LGM_PROBLEM *newProblem;
 	int i;
@@ -166,6 +166,12 @@
 	return((LGM_PROBLEM *) SearchEnv(name,"/LGM_PROBLEM",theProblemVarID,theProblemDirID));
 }
 
+void NS_DIM_PREFIX
+Set_Current_BVP(BVP* theBVP)
+{
+  return;
+}
+
 /* domain interface function: for description see domain.h */
 BVP *NS_DIM_PREFIX
 BVP_GetByName (const char *name)
diff -ru ug-orig/dom/lgm/lgm_domain.h ug-patched/dom/lgm/lgm_domain.h
--- ug-orig/dom/lgm/lgm_domain.h	2006-11-08 16:35:43.000000000 +0100
+++ ug-patched/dom/lgm/lgm_domain.h	2006-12-07 15:52:44.000000000 +0100
@@ -26,7 +26,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_domain.h,v 1.39 2006/11/08 15:35:43 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
@@ -154,7 +154,7 @@
 #define LGM_LINE_BNDCOND(p)                                     ((p)->Bndcond)
 #define LGM_LINE_POINT(p,i)                                     ((p)->point+(i))
 #define LGM_LINE_POINTDIST(p,i,j)                       LGM_POINT_DIST(LGM_LINE_POINT(p,i),LGM_LINE_POINT(p,j))
-#define LGM_LINE_ID_2_LINE(i)                           (LinePtrArray[i])
+#define LGM_LINE_ID_2_LINE(i)                           (LinePtrArray2D[i])
 
 /* macros for LGM_SUBDOMAIN */
 #define LGM_SUBDOMAIN_UNIT(p)                           ((p)->Unit)
@@ -191,7 +191,7 @@
 #ifdef ModelP
 #define LGM_BNDS_SIZE(p)                        (sizeof(LGM_BNDS))
 #define LGM_BNDP_SIZE(p)                        (sizeof(LGM_BNDP))
-#define LINE_ID_2_LINE(i)                                       (LinePtrArray[i])
+#define LINE_ID_2_LINE(i)                                       (LinePtrArray2D[i])
 #endif
 
 
@@ -741,7 +741,7 @@
 #endif
 
 #ifndef Grape
-LGM_PROBLEM *CreateProblem (char *name, InitProcPtr config, DomainSizeConfig domconfig, BndCondProcPtr BndCond, int numOfCoefficients, CoeffProcPtr coeffs[], int numOfUserFct, UserProcPtr userfct[]);
+LGM_PROBLEM *CreateProblem (const char *name, InitProcPtr config, DomainSizeConfig domconfig, BndCondProcPtr BndCond, int numOfCoefficients, CoeffProcPtr coeffs[], int numOfUserFct, UserProcPtr userfct[]);
 LGM_PROBLEM *CreateProblemWithInnerBCs (char *name, InitProcPtr config, DomainSizeConfig domconfig, BndCondProcPtr BndCond, BndCondProcPtr InnerBndCond, int numOfCoefficients, CoeffProcPtr coeffs[], int numOfUserFct, UserProcPtr userfct[]);
 #endif
 INT SetBoundaryCondition (LGM_DOMAIN *theDomain, BndCondProcPtr BndCond, BndCondProcPtr InnerBndCond);
diff -ru ug-orig/dom/lgm/lgm_load.c ug-patched/dom/lgm/lgm_load.c
--- ug-orig/dom/lgm/lgm_load.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_load.c	2008-02-29 23:01:39.000000000 +0100
@@ -103,8 +103,11 @@
 /*																			*/
 /****************************************************************************/
 
-LGM_LINE	**LinePtrArray		= NULL;
+#if (LGM_DIM==2)
+LGM_LINE	**LinePtrArray2D		= NULL;
+#endif
 #if (LGM_DIM==3)
+LGM_LINE	**LinePtrArray		= NULL;
 LGM_SURFACE	**SurfacePtrArray	= NULL;
 #endif
 #ifdef OCC_GEOMETRY
@@ -133,7 +136,7 @@
 #endif
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_load.c,v 1.50 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
@@ -240,7 +243,7 @@
 	/* allocate lines */
 	if ((LinePtrList=(LGM_LINE**)GetFreelistMemory(theHeap,sizeof(LGM_LINE*)*theDomInfo.nPolyline)) == NULL)					return (NULL);
 	#ifdef ModelP
-	if ((LinePtrArray=(LGM_LINE**)GetFreelistMemory(theHeap,sizeof(LGM_LINE*)*theDomInfo.nPolyline)) == NULL)			return (NULL);
+	if ((LinePtrArray2D=(LGM_LINE**)GetFreelistMemory(theHeap,sizeof(LGM_LINE*)*theDomInfo.nPolyline)) == NULL)			return (NULL);
 	#endif
 	for (i=0; i<theDomInfo.nPolyline; i++)
 	{
@@ -264,7 +267,7 @@
 		}
 		#ifdef ModelP
 		PRINTDEBUG(dom,3,(PFMT "LGM_LoadDomain(): i=%d lineptr=%x\n",me,i,LinePtrList[i]));
-		LinePtrArray[i] = LinePtrList[i];
+		LinePtrArray2D[i] = LinePtrList[i];
 		#endif
 	}
 	
diff -ru ug-orig/dom/lgm/lgm_load.h ug-patched/dom/lgm/lgm_load.h
--- ug-orig/dom/lgm/lgm_load.h	2006-11-08 16:35:43.000000000 +0100
+++ ug-patched/dom/lgm/lgm_load.h	2006-12-05 10:02:35.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_load.h,v 1.14 2006/11/08 15:35:43 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dom/lgm/lgm_parallel.c ug-patched/dom/lgm/lgm_parallel.c
--- ug-orig/dom/lgm/lgm_parallel.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_parallel.c	2008-02-29 23:01:39.000000000 +0100
@@ -51,7 +51,14 @@
 
 #include "namespace.h"
 
-USING_UG_NAMESPACES
+//USING_UG_NAMESPACES
+USING_UGDIM_NAMESPACE
+USING_UG_NAMESPACE
+
+#ifdef ModelP
+USING_PPIF_NAMESPACE
+#endif
+
 
 
 /****************************************************************************/
@@ -110,8 +117,11 @@
 /*																			*/
 /****************************************************************************/
 
-extern	LGM_LINE			**LinePtrArray;
+#if (LGM_DIM==2)
+extern	LGM_LINE			**LinePtrArray2D;
+#endif
 #if (LGM_DIM==3)
+extern	LGM_LINE			**LinePtrArray;
 extern	LGM_SURFACE			**SurfacePtrArray;
 #endif
 
@@ -122,7 +132,7 @@
 /****************************************************************************/
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_parallel.c,v 1.11 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 
 /****************************************************************************/
diff -ru ug-orig/dom/lgm/lgm_transfer2d.c ug-patched/dom/lgm/lgm_transfer2d.c
--- ug-orig/dom/lgm/lgm_transfer2d.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_transfer2d.c	2006-12-05 10:03:34.000000000 +0100
@@ -72,7 +72,7 @@
 /****************************************************************************/
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_transfer2d.c,v 1.17 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 static FILE *stream;
 static INT lgmdomainpathes_set;
diff -ru ug-orig/dom/lgm/lgm_transfer3d.c ug-patched/dom/lgm/lgm_transfer3d.c
--- ug-orig/dom/lgm/lgm_transfer3d.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/lgm_transfer3d.c	2006-12-05 10:03:34.000000000 +0100
@@ -47,7 +47,7 @@
 static INT LGM_DEBUG = 0;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_transfer3d.c,v 1.26 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 static int SkipBTN (void)
 {
diff -ru ug-orig/dom/lgm/lgm_transfer.h ug-patched/dom/lgm/lgm_transfer.h
--- ug-orig/dom/lgm/lgm_transfer.h	2006-11-08 16:35:43.000000000 +0100
+++ ug-patched/dom/lgm/lgm_transfer.h	2006-12-05 10:03:34.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/lgm_transfer.h,v 1.22 2006/11/08 15:35:43 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dom/lgm/Makefile.am ug-patched/dom/lgm/Makefile.am
--- ug-orig/dom/lgm/Makefile.am	2004-09-09 19:50:24.000000000 +0200
+++ ug-patched/dom/lgm/Makefile.am	2007-02-14 21:27:52.000000000 +0100
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2004/09/09 17:50:24 thimo Exp $
+# $Id: Makefile.am 8267 2007-02-14 20:27:52Z christi $
 
 if BUILD2D
   LIB_2D = libdomL2.la
@@ -22,7 +22,7 @@
 
 include_HEADERS = lgm_domain.h
 
-lib_LTLIBRARIES = $(LIB_2D) $(LIB_3D)
+noinst_LTLIBRARIES = $(LIB_2D) $(LIB_3D)
 
 libdomL2_la_SOURCES = $(SOURCES) lgm_transfer2d.c lgm_domain2d.c
 libdomL2_la_CPPFLAGS = $(UG_2DFLAGS)
Nur in ug-orig/dom/lgm/netgen: .cvsignore.
diff -ru ug-orig/dom/lgm/netgen/lgm_gginterface.h ug-patched/dom/lgm/netgen/lgm_gginterface.h
--- ug-orig/dom/lgm/netgen/lgm_gginterface.h	1998-03-18 18:44:57.000000000 +0100
+++ ug-patched/dom/lgm/netgen/lgm_gginterface.h	1998-03-18 18:45:01.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/netgen/lgm_gginterface.h,v 1.7 1998/03/18 17:44:57 klaus Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dom/lgm/netgen/surface.c ug-patched/dom/lgm/netgen/surface.c
--- ug-orig/dom/lgm/netgen/surface.c	2004-07-26 17:34:00.000000000 +0200
+++ ug-patched/dom/lgm/netgen/surface.c	2004-07-26 17:37:39.000000000 +0200
@@ -87,7 +87,7 @@
 static CoeffProcPtr 			LOCAL_H;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/netgen/surface.c,v 1.15 2004/07/26 15:34:00 stefan Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*                                                                          */
Nur in ug-orig/dom/lgm/ngin: .cvsignore.
diff -ru ug-orig/dom/lgm/ngin/Makefile.am ug-patched/dom/lgm/ngin/Makefile.am
--- ug-orig/dom/lgm/ngin/Makefile.am	2004-09-09 19:50:24.000000000 +0200
+++ ug-patched/dom/lgm/ngin/Makefile.am	2004-09-09 19:50:27.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2004/09/09 17:50:24 thimo Exp $
+# $Id: Makefile.am 7795 2004-09-09 17:50:27Z thimo $
 
 if BUILD3D
   LIB_3D = libngin.la
diff -ru ug-orig/dom/lgm/ngin/ng.c ug-patched/dom/lgm/ngin/ng.c
--- ug-orig/dom/lgm/ngin/ng.c	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/ngin/ng.c	2006-12-05 09:58:26.000000000 +0100
@@ -98,7 +98,7 @@
 #endif
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin/ng.c,v 1.23 2006/11/17 10:46:10 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
diff -ru ug-orig/dom/lgm/ngin/ng.h ug-patched/dom/lgm/ngin/ng.h
--- ug-orig/dom/lgm/ngin/ng.h	2006-11-17 11:46:10.000000000 +0100
+++ ug-patched/dom/lgm/ngin/ng.h	2006-12-05 09:58:26.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin/ng.h,v 1.14 2006/11/17 10:46:10 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
diff -ru ug-orig/dom/lgm/ngin/ngin-lex.l ug-patched/dom/lgm/ngin/ngin-lex.l
--- ug-orig/dom/lgm/ngin/ngin-lex.l	2006-06-02 17:38:35.000000000 +0200
+++ ug-patched/dom/lgm/ngin/ngin-lex.l	2006-06-02 17:38:35.000000000 +0200
@@ -26,7 +26,7 @@
 static int noline=1;
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin/ngin-lex.l,v 1.4 2006/06/02 15:38:35 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /* forward declare stuff from ngin-yacc.y */
 int ngerror (char *s); 
diff -ru ug-orig/dom/lgm/ngin/ngin-yacc.y ug-patched/dom/lgm/ngin/ngin-yacc.y
--- ug-orig/dom/lgm/ngin/ngin-yacc.y	2006-11-21 18:04:59.000000000 +0100
+++ ug-patched/dom/lgm/ngin/ngin-yacc.y	2006-12-15 11:02:46.000000000 +0100
@@ -50,7 +50,7 @@
 
  /* forward declare my own function (referenced by automatic parser) */ 
  int ngerror (char *s);
- int ngwrap();
+extern "C" int ngwrap();
 %}
 
 %union 
@@ -255,10 +255,13 @@
 %%
 
 
+extern "C"
+{
 int ngwrap ()
 {
     return (1);
 }
+}
 
 int ngerror (char *s)
 {
Nur in ug-orig/dom/lgm/ngin2d: .cvsignore.
diff -ru ug-orig/dom/lgm/ngin2d/Makefile.am ug-patched/dom/lgm/ngin2d/Makefile.am
--- ug-orig/dom/lgm/ngin2d/Makefile.am	2004-09-09 19:50:25.000000000 +0200
+++ ug-patched/dom/lgm/ngin2d/Makefile.am	2006-12-14 20:25:22.000000000 +0100
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2004/09/09 17:50:25 thimo Exp $ 
+# $Id: Makefile.am 8235 2006-12-14 19:25:22Z langsn $ 
 
 if BUILD2D
   LIB_2D = libngin2d.la
@@ -9,7 +9,7 @@
 noinst_LTLIBRARIES = $(LIB_2D)
 
 # prefix to use instead of 'yy'
-PARSERPREFIX = ng
+PARSERPREFIX = ng2d
 
 # generate header file, rename prefix
 AM_YFLAGS = -d -p $(PARSERPREFIX)
diff -ru ug-orig/dom/lgm/ngin2d/ng2d.h ug-patched/dom/lgm/ngin2d/ng2d.h
--- ug-orig/dom/lgm/ngin2d/ng2d.h	2006-05-08 14:18:23.000000000 +0200
+++ ug-patched/dom/lgm/ngin2d/ng2d.h	2006-12-07 15:58:33.000000000 +0100
@@ -19,7 +19,7 @@
 
 
 /* RCS_ID
-$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin2d/ng2d.h,v 1.7 2006/05/08 12:18:23 sander Exp $
+$Header$
 */
 
 /****************************************************************************/
@@ -151,8 +151,8 @@
 	int NG_Init (int domainpaths_set);
 #endif
 
-END_UGDIM_NAMESPACE
-
 void ngbreak (void);
 
+END_UGDIM_NAMESPACE
+
 #endif
diff -ru ug-orig/dom/lgm/ngin2d/ng.c ug-patched/dom/lgm/ngin2d/ng.c
--- ug-orig/dom/lgm/ngin2d/ng.c	2006-06-02 17:38:11.000000000 +0200
+++ ug-patched/dom/lgm/ngin2d/ng.c	2006-12-14 20:25:22.000000000 +0100
@@ -41,7 +41,9 @@
 
 #include "namespace.h"
 
-USING_UG_NAMESPACES
+USING_UG_NAMESPACE
+USING_UGDIM_NAMESPACE
+
 
 
 /****************************************************************************/
@@ -75,6 +77,7 @@
 /*																			*/
 /****************************************************************************/
 
+#define ngin ng2din
 extern FILE *ngin;
 
 /****************************************************************************/
@@ -96,14 +99,14 @@
 #endif
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin2d/ng.c,v 1.10 2006/06/02 15:38:11 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /*																			*/
 /* forward declarations of functions used before they are defined			*/
 /*																			*/
 /****************************************************************************/
-
+#define ngparse ng2dparse
 int ngparse (void);
 
 
@@ -143,7 +146,7 @@
 	return (0);
 }
 
-int NP_ElemSideOnBnd (NG_ELEMENT *Elem)
+static int NP_ElemSideOnBnd (NG_ELEMENT *Elem)
 {
 	int i,j,esob,c1,c2,ec1,ec2;
 
@@ -163,7 +166,7 @@
 	return (esob);
 }
 
-int OrientateElem (NG_ELEMENT *Elem)
+static int OrientateElem (NG_ELEMENT *Elem)
 {
     int i;
     double p[4][2];
@@ -201,7 +204,7 @@
  */
 /****************************************************************************/
 
-int PutBndNode (BND_NODE *BndNode)
+int NS_DIM_PREFIX PutBndNode (BND_NODE *BndNode)
 {
 	int i,line_id;
 
@@ -254,7 +257,7 @@
 	return (0);
 }
 
-int PutInnerNode (INNER_NODE *InnNode)
+int NS_DIM_PREFIX PutInnerNode (INNER_NODE *InnNode)
 {
 	switch (mode)
 	{
@@ -273,7 +276,7 @@
 	return (0);
 }
 
-int PutElement (NG_ELEMENT *Elem)
+int NS_DIM_PREFIX PutElement (NG_ELEMENT *Elem)
 {
 	int i,j,side;
 
@@ -315,12 +318,12 @@
 	return (0);
 }
 
-void ngbreak (void)
+void NS_DIM_PREFIX ngbreak (void)
 {
 	ng_abort=1;
 }
 
-int NG_ReadMesh (char *name, HEAP *Heap, LGM_MESH_INFO *theMesh, INT MarkKey)
+int NS_DIM_PREFIX NG_ReadMesh (char *name, HEAP *Heap, LGM_MESH_INFO *theMesh, INT MarkKey)
 {
 	int i,j,error;
 	char ngname[128];
@@ -471,7 +474,7 @@
 
 #ifdef __USE_IN_UG__
 
-int NG_Init (int domainpathes_set)
+int NS_DIM_PREFIX NG_Init (int domainpathes_set)
 {
 	lgmdomainpathes_set = domainpathes_set;
 
diff -ru ug-orig/dom/lgm/ngin2d/ngin-lex.h ug-patched/dom/lgm/ngin2d/ngin-lex.h
--- ug-orig/dom/lgm/ngin2d/ngin-lex.h	2004-09-07 16:31:11.000000000 +0200
+++ ug-patched/dom/lgm/ngin2d/ngin-lex.h	2006-12-14 20:25:22.000000000 +0100
@@ -2,9 +2,9 @@
 #define UG_NGIN_LEX_H
 
 /* C++-compilers don't like this defined implicitly */
-int nglex();
+int ng2dlex();
 
 /* error function used in YACC-parser as well */
-int NP_Error (int *line, char *text);
+int NP2d_Error (int *line, char *text);
 
 #endif
diff -ru ug-orig/dom/lgm/ngin2d/ngin-lex.l ug-patched/dom/lgm/ngin2d/ngin-lex.l
--- ug-orig/dom/lgm/ngin2d/ngin-lex.l	2006-06-02 17:38:11.000000000 +0200
+++ ug-patched/dom/lgm/ngin2d/ngin-lex.l	2006-12-14 20:25:22.000000000 +0100
@@ -28,10 +28,10 @@
 static int noline=1;
 
 /* data for CVS */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/lgm/ngin2d/ngin-lex.l,v 1.4 2006/06/02 15:38:11 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /* forward declare stuff from ngin-yacc.y */
-int ngerror (char *s); 
+int ng2derror (char *s); 
 
 %}
 
@@ -51,19 +51,19 @@
 [ \t]+              ;
 [\n]                {noline++;}
 {COMMENT}           ;
-{KEY_INT}			{nglval.ival=atol((const char *)yytext); return (INT_VALUE);}
-{KEY_DOUBLE}		{nglval.dval=strtod((const char *)yytext,NULL); return (DOUBLE_VALUE);}
+{KEY_INT}			{ng2dlval.ival=atol((const char *)yytext); return (INT_VALUE);}
+{KEY_DOUBLE}		{ng2dlval.dval=strtod((const char *)yytext,NULL); return (DOUBLE_VALUE);}
 {KEY_INODE}			{return (INODE);}
 {KEY_BNODE}			{return (BNODE);}
 {KEY_LINE}			{return (LINE);}
 {KEY_ELEM}			{return (ELEM);}
 {KEY_SIDE}			{return (SIDE);}
 {KEY_TEND}			{return (TEND);}
-.                   {ngerror(NULL);}
+.                   {ng2derror(NULL);}
 
 %%
 
-int NP_Error (int *line, char *text)
+int NP2d_Error (int *line, char *text)
 {
 	*line=noline;
 	strcpy(text,yytext);
diff -ru ug-orig/dom/lgm/ngin2d/ngin-yacc.y ug-patched/dom/lgm/ngin2d/ngin-yacc.y
--- ug-orig/dom/lgm/ngin2d/ngin-yacc.y	2006-11-21 18:05:00.000000000 +0100
+++ ug-patched/dom/lgm/ngin2d/ngin-yacc.y	2006-12-15 11:02:46.000000000 +0100
@@ -48,8 +48,8 @@
 static NG_ELEMENT Elem;
 
  /* forward declare my own function (referenced by automatic parser) */ 
- int ngerror (char *s);
- int ngwrap();
+ int ng2derror (char *s);
+
 
 %}
 
@@ -192,18 +192,20 @@
 
 %%
 
-
-int ngwrap ()
+extern "C" 
+{
+int ng2dwrap (void )
 {
     return (1);
 }
+}
 
-int ngerror (char *s)
+int ng2derror (char *s)
 {
 	int line;
 	char text[128];
 
-	NP_Error(&line,text);
+	NP2d_Error(&line,text);
     NG_Print(ERROR_PREFIX "'%s', line %d\n",text,line);
     ngbreak();
 	return 0;
diff -ru ug-orig/dom/Makefile.am ug-patched/dom/Makefile.am
--- ug-orig/dom/Makefile.am	2004-10-06 14:18:01.000000000 +0200
+++ ug-patched/dom/Makefile.am	2004-10-06 14:18:01.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.2 2004/10/06 12:18:01 thimo Exp $
+# $Id: Makefile.am 7837 2004-10-06 12:18:01Z thimo $
 
 # compile the different domain-modules
 SUBDIRS = std lgm 
Nur in ug-orig/dom/std: .cvsignore.
diff -ru ug-orig/dom/std/domains2d.c ug-patched/dom/std/domains2d.c
--- ug-orig/dom/std/domains2d.c	2006-06-02 18:11:18.000000000 +0200
+++ ug-patched/dom/std/domains2d.c	2006-06-02 18:15:34.000000000 +0200
@@ -625,7 +625,7 @@
 
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/std/domains2d.c,v 1.57 2006/06/02 16:11:18 sander Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /****************************************************************************/
diff -ru ug-orig/dom/std/domains3d.c ug-patched/dom/std/domains3d.c
--- ug-orig/dom/std/domains3d.c	2004-09-09 16:38:06.000000000 +0200
+++ ug-patched/dom/std/domains3d.c	2004-09-09 16:38:06.000000000 +0200
@@ -106,7 +106,7 @@
 REP_ERR_FILE;
 
 /* RCS string */
-static char RCS_ID("$Header: /Users/mirror/CVS/UG/ug/dom/std/domains3d.c,v 1.21 2004/09/09 14:38:06 thimo Exp $",UG_RCS_STRING);
+static char RCS_ID("$Header$",UG_RCS_STRING);
 
 /****************************************************************************/
 /****************************************************************************/
diff -ru ug-orig/dom/std/Makefile.am ug-patched/dom/std/Makefile.am
--- ug-orig/dom/std/Makefile.am	2004-11-02 17:28:03.000000000 +0100
+++ ug-patched/dom/std/Makefile.am	2007-04-03 11:03:34.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.4 2004/11/02 16:28:03 thimo Exp $
+# $Id: Makefile.am 8274 2007-04-03 09:03:34Z sander $
 
 SOURCES = std_domain.c std_parallel.c std_domain.h std_internal.h 
 
@@ -21,14 +21,14 @@
   LIB_3D =
 endif
 
-lib_LTLIBRARIES = $(LIB_2D) $(LIB_3D)
+noinst_LTLIBRARIES = $(LIB_2D) $(LIB_3D)
 
 include_HEADERS = std_domain.h
 
 libdomS2_la_SOURCES = $(SOURCES) domains2d.c
 libdomS2_la_CPPFLAGS = $(UG_2DFLAGS)
-libdomS2_la_LIBADD = $(PLIBS2) $(EXTRALIBS) 
+libdomS2_la_LIBADD = $(PLIBS2) $(EXTRALIBS)
 
-libdomS3_la_SOURCES = $(SOURCES) repair.c domains3d.c
+libdomS3_la_SOURCES = $(SOURCES) domains3d.c
 libdomS3_la_CPPFLAGS = $(UG_3DFLAGS)
-libdomS3_la_LIBADD = $(PLIBS3) $(EXTRALIBS) 
+libdomS3_la_LIBADD = $(PLIBS3) $(EXTRALIBS)
diff -ru ug-orig/dom/std/Makefile.std ug-patched/dom/std/Makefile.std
--- ug-orig/dom/std/Makefile.std	1998-06-28 22:52:04.000000000 +0200
+++ ug-patched/dom/std/Makefile.std	2007-04-24 16:02:10.000000000 +0200
@@ -10,7 +10,7 @@
 # include configuration and all makefile macro definitions
 include ../../ug.conf
 
-OBJECTS = std_domain.o domains$(DIM)d.o std_parallel.o repair.o
+OBJECTS = std_domain.o domains$(DIM)d.o std_parallel.o
 
 # local C compiler flags
 LCFLAGS = -I../../include
Nur in ug-orig/dom/std: repair.c.
diff -ru ug-orig/dom/std/std_domain.c ug-patched/dom/std/std_domain.c
--- ug-orig/dom/std/std_domain.c	2006-06-02 18:11:18.000000000 +0200
+++ ug-patched/dom/std/std_domain.c	2008-03-18 11:29:38.000000000 +0100
@@ -141,7 +141,7 @@
 /* RCS string */
 static char
 RCS_ID
-("$Header: /Users/mirror/CVS/UG/ug/dom/std/std_domain.c,v 1.114 2006/06/02 16:11:18 sander Exp $",
+("$Header$",
 UG_RCS_STRING);
 
 /****************************************************************************/
@@ -150,1478 +150,8 @@
 /*                                                                          */
 /****************************************************************************/
 
-static INT BndPointGlobal (BNDP * aBndP, DOUBLE * global);
-static INT PatchGlobal (PATCH * p, DOUBLE * lambda, DOUBLE * global);
-
-/* Marc specials */
-
-#define MAX_LEN		200
-#ifdef __THREEDIM__
-#define PRISM_MOD
-#endif
-
-static char theLine[MAX_LEN + 1];
-static INT nCorners, nBndP, nElem, nPPatch, nLPatch, nTPatch, nPri, nFound;
-static INT Marc_Extended;
-
-static int
-ExpandLine (char *theLine)
-{
-  unsigned int i, j, k, l;
-
-  if (Marc_Extended)
-    {
-      i = 76;
-      j = 69;
-      for (l = 0; l < 3; l++)
-	{
-	  theLine[i] = ' ';
-	  i--;
-	  theLine[i] = theLine[j];
-	  i--;
-	  j--;
-	  theLine[i] = theLine[j];
-	  i--;
-	  j--;
-	  theLine[i] = 'e';
-	  i--;
-	  for (k = 0; k < 18; k++)
-	    {
-	      theLine[i] = theLine[j];
-	      i--;
-	      j--;
-	    }
-	}
-      theLine[i] = ' ';
-      /*printf("%s",theLine); */
-    }
-  else
-    {
-      i = 41;
-      j = 34;
-      for (l = 0; l < 3; l++)
-	{
-	  theLine[i] = ' ';
-	  i--;
-	  theLine[i] = theLine[j];
-	  i--;
-	  j--;
-	  theLine[i] = theLine[j];
-	  i--;
-	  j--;
-	  theLine[i] = 'e';
-	  i--;
-	  for (k = 0; k < 8; k++)
-	    {
-	      theLine[i] = theLine[j];
-	      i--;
-	      j--;
-	    }
-	}
-      theLine[i] = ' ';
-    }
-
-  for (i = 5; i < strlen (theLine); i++)
-    if (theLine[i] == '-')
-      if (theLine[i + 1] == 'e')
-	{
-	  theLine[i] = 'e';
-	  theLine[i + 1] = '-';
-	}
-
-  return (0);
-}
-
-static INT
-file_readline (FILE * f, char *key)
-{
-  INT len = strlen (key);
-
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-      if (strncmp (theLine, key, len) == 0)
-	return (0);
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-file_elements (FILE * f)
-{
-  int id, n, c[8];
-
-  nElem = 0;
-  nPri = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-      /*printf("%s",theLine); */
-
-      if (strlen (theLine) < 3)
-	continue;
-
-      if (Marc_Extended == 0)
-	{
-	  theLine[66] = 0;
-	  theLine[65] = ' ';
-	  theLine[64] = theLine[54];
-	  theLine[63] = theLine[53];
-	  theLine[62] = theLine[52];
-	  theLine[61] = theLine[51];
-	  theLine[60] = theLine[50];
-	  theLine[59] = ' ';
-	  theLine[58] = theLine[49];
-	  theLine[57] = theLine[48];
-	  theLine[56] = theLine[47];
-	  theLine[55] = theLine[46];
-	  theLine[54] = theLine[45];
-	  theLine[53] = ' ';
-	  theLine[52] = theLine[44];
-	  theLine[51] = theLine[43];
-	  theLine[50] = theLine[42];
-	  theLine[49] = theLine[41];
-	  theLine[48] = theLine[40];
-	  theLine[47] = ' ';
-	  theLine[46] = theLine[39];
-	  theLine[45] = theLine[38];
-	  theLine[44] = theLine[37];
-	  theLine[43] = theLine[36];
-	  theLine[42] = theLine[35];
-	  theLine[41] = ' ';
-	  theLine[40] = theLine[34];
-	  theLine[39] = theLine[33];
-	  theLine[38] = theLine[32];
-	  theLine[37] = theLine[31];
-	  theLine[36] = theLine[30];
-	  theLine[35] = ' ';
-	  theLine[34] = theLine[29];
-	  theLine[33] = theLine[28];
-	  theLine[32] = theLine[27];
-	  theLine[31] = theLine[26];
-	  theLine[30] = theLine[25];
-	  theLine[29] = ' ';
-	  theLine[28] = theLine[24];
-	  theLine[27] = theLine[23];
-	  theLine[26] = theLine[22];
-	  theLine[25] = theLine[21];
-	  theLine[24] = theLine[20];
-	  theLine[23] = ' ';
-	  theLine[22] = theLine[19];
-	  theLine[21] = theLine[18];
-	  theLine[20] = theLine[17];
-	  theLine[19] = theLine[16];
-	  theLine[18] = theLine[15];
-	  theLine[17] = ' ';
-	  theLine[16] = theLine[14];
-	  theLine[15] = theLine[13];
-	  theLine[14] = theLine[12];
-	  theLine[13] = theLine[11];
-	  theLine[12] = theLine[10];
-	  theLine[11] = ' ';
-	  theLine[10] = theLine[9];
-	  theLine[9] = theLine[8];
-	  theLine[8] = theLine[7];
-	  theLine[7] = theLine[6];
-	  theLine[6] = theLine[5];
-	  theLine[5] = ' ';
-	  theLine[4] = theLine[4];
-	  theLine[3] = theLine[3];
-	  theLine[2] = theLine[2];
-	  theLine[1] = theLine[1];
-	  theLine[0] = theLine[0];
-	}
-
-      if (sscanf (theLine, "%d %d", &id, &n) != 2)
-	return (0);
-
-      if (sscanf (theLine, "%d %d %d %d %d %d %d %d %d %d",
-		  &id, &n, c, c + 1, c + 2, c + 3, c + 4, c + 5, c + 6,
-		  c + 7) != 3 + n)
-	return (0);
-
-
-      if (c[0] == c[1])
-	if (c[4] == c[5])
-	  nPri++;
-
-      nElem++;
-
-      /* printf("file_elem %d %d %d %d %d\n",id,n,c[0],c[1],c[2]);  */
-
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-file_corners (FILE * f)
-{
-  int N, n, id, i;
-  double c[3];
-
-  fgets (theLine, MAX_LEN, f);
-
-  /* printf("%s",theLine);  */
-
-  if (Marc_Extended == 0)
-    {
-      theLine[12] = 0;
-      theLine[11] = ' ';
-      theLine[10] = theLine[9];
-      theLine[9] = theLine[8];
-      theLine[8] = theLine[7];
-      theLine[7] = theLine[6];
-      theLine[6] = theLine[5];
-      theLine[5] = ' ';
-      theLine[4] = theLine[4];
-      theLine[3] = theLine[3];
-      theLine[2] = theLine[2];
-      theLine[1] = theLine[1];
-      theLine[0] = theLine[0];
-    }
-
-  if (sscanf (theLine, "%d %d", &N, &n) != 2)
-    return (1);
-
-  nCorners = 0;
-  for (i = 0; i < n; i++)
-    {
-      fgets (theLine, MAX_LEN, f);
-
-      /* printf(" %d %s",i,theLine);  */
-
-      ExpandLine (theLine);
-
-      if (sscanf (theLine, "%d %lg %lg %lg", &id, c, c + 1, c + 2) != 1 + N)
-	return (0);
-      nCorners++;
-
-      /* printf("%d %f %f %f\n",id,c[0],c[1],c[2]); */
-    }
-
-  return (0);
-}
-
-static INT
-file_contact (FILE * f)
-{
-  int id, c;
-
-  /* fgets(theLine, MAX_LEN, f); */
-
-  nBndP = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-      if (sscanf (theLine, "%d %d", &id, &c) != 2)
-	return (0);
-      nBndP++;
-
-      /* printf("%d %d \n",id,c);  */
-
-    }
-  while (!feof (f));
-
-  UserWrite ("BVP: no contact\n");
-
-  return (0);
-}
-
-static INT
-file_triangles (FILE * f)
-{
-  int id, n, c[3];
-
-  nTPatch = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-      if (strlen (theLine) < 3)
-	continue;
-      if (sscanf (theLine, "%5d%5d%5d%5d%5d",
-		  &id, &n, c, c + 1, c + 2) != 2 + DIM)
-	return (0);
-      nTPatch++;
-
-      /*printf("%d %d %d %d %d\n",id,n,c[0],c[1],c[2]); */
-
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-file_positions (FILE * f)
-{
-  int id;
-  double c[3];
-
-  fgets (theLine, MAX_LEN, f);
-
-  nPPatch = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-
-      ExpandLine (theLine);
-
-      if (sscanf (theLine, "%d %lg %lg %lg", &id, c, c + 1, c + 2) != 1 + DIM)
-	return (0);
-
-      nPPatch++;
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-Marc_GetPosition (MESH * Mesh, INT i, DOUBLE * x)
-{
-  INT k;
-
-  if (i < nBndP)
-    {
-      M_BNDP *p = (M_BNDP *) Mesh->theBndPs[i];
-
-      for (k = 0; k < DIM; k++)
-	x[k] = p->pos[k];
-    }
-  else
-    for (k = 0; k < DIM; k++)
-      x[k] = Mesh->Position[i - nBndP][k];
-  /*printf("i %6d nBndP %d x %6.3f %6.3f %6.3f\n",i,nBndP,x[0],x[1],x[2]); */
-
-  return (0);
-}
-
-static INT
-file_elements_fill (FILE * f, HEAP * Heap, MESH * Mesh, INT MarkKey)
-{
-  int id, n, i, c[8], c0, c1, c2, c3, c4, c5, c6, c7;
-
-  nElem = 0;
-  nPri = 0;
-  nFound = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-      if (strlen (theLine) < 3)
-	continue;
-
-      if (Marc_Extended == 0)
-	{
-	  theLine[66] = 0;
-	  theLine[65] = ' ';
-	  theLine[64] = theLine[54];
-	  theLine[63] = theLine[53];
-	  theLine[62] = theLine[52];
-	  theLine[61] = theLine[51];
-	  theLine[60] = theLine[50];
-	  theLine[59] = ' ';
-	  theLine[58] = theLine[49];
-	  theLine[57] = theLine[48];
-	  theLine[56] = theLine[47];
-	  theLine[55] = theLine[46];
-	  theLine[54] = theLine[45];
-	  theLine[53] = ' ';
-	  theLine[52] = theLine[44];
-	  theLine[51] = theLine[43];
-	  theLine[50] = theLine[42];
-	  theLine[49] = theLine[41];
-	  theLine[48] = theLine[40];
-	  theLine[47] = ' ';
-	  theLine[46] = theLine[39];
-	  theLine[45] = theLine[38];
-	  theLine[44] = theLine[37];
-	  theLine[43] = theLine[36];
-	  theLine[42] = theLine[35];
-	  theLine[41] = ' ';
-	  theLine[40] = theLine[34];
-	  theLine[39] = theLine[33];
-	  theLine[38] = theLine[32];
-	  theLine[37] = theLine[31];
-	  theLine[36] = theLine[30];
-	  theLine[35] = ' ';
-	  theLine[34] = theLine[29];
-	  theLine[33] = theLine[28];
-	  theLine[32] = theLine[27];
-	  theLine[31] = theLine[26];
-	  theLine[30] = theLine[25];
-	  theLine[29] = ' ';
-	  theLine[28] = theLine[24];
-	  theLine[27] = theLine[23];
-	  theLine[26] = theLine[22];
-	  theLine[25] = theLine[21];
-	  theLine[24] = theLine[20];
-	  theLine[23] = ' ';
-	  theLine[22] = theLine[19];
-	  theLine[21] = theLine[18];
-	  theLine[20] = theLine[17];
-	  theLine[19] = theLine[16];
-	  theLine[18] = theLine[15];
-	  theLine[17] = ' ';
-	  theLine[16] = theLine[14];
-	  theLine[15] = theLine[13];
-	  theLine[14] = theLine[12];
-	  theLine[13] = theLine[11];
-	  theLine[12] = theLine[10];
-	  theLine[11] = ' ';
-	  theLine[10] = theLine[9];
-	  theLine[9] = theLine[8];
-	  theLine[8] = theLine[7];
-	  theLine[7] = theLine[6];
-	  theLine[6] = theLine[5];
-	  theLine[5] = ' ';
-	  theLine[4] = theLine[4];
-	  theLine[3] = theLine[3];
-	  theLine[2] = theLine[2];
-	  theLine[1] = theLine[1];
-	  theLine[0] = theLine[0];
-	}
-
-      if (sscanf (theLine, "%d %d", &id, &n) != 2)
-	return (0);
-
-      if (sscanf (theLine, "%d %d %d %d %d %d %d %d %d %d",
-		  &id, &n, &c0, &c1, &c2, &c3, &c4, &c5, &c6, &c7) != 3 + n)
-	return (0);
-
-      c[0] = c0;
-      c[1] = c1;
-      c[2] = c2;
-      c[3] = c3;
-      c[4] = c4;
-      c[5] = c5;
-      c[6] = c6;
-      c[7] = c7;
-
-      if (Mesh != NULL)
-	if (c[0] == c[1])
-	  {
-	    if (c[4] != c[5])
-	      return (1);
-	    Mesh->Element_corners[1][nElem] = 6;
-	    Mesh->Element_corner_ids[1][nElem][0] = c[0] - 1;
-	    Mesh->Element_corner_ids[1][nElem][1] = c[2] - 1;
-	    Mesh->Element_corner_ids[1][nElem][2] = c[3] - 1;
-	    Mesh->Element_corner_ids[1][nElem][3] = c[4] - 1;
-	    Mesh->Element_corner_ids[1][nElem][4] = c[6] - 1;
-	    Mesh->Element_corner_ids[1][nElem][5] = c[7] - 1;
-
-	    nPri++;
-
-#ifdef PRISM_MOD
-
-	    if ((nPri % 2) == 0)
-	      {
-		INT l, d[6];
-		DOUBLE_VECTOR pos;
-
-		for (l = 0; l < 6; l++)
-		  d[l] = Mesh->Element_corner_ids[1][nElem - 1][l];
-		c[0] = c[0] - 1;
-		c[1] = c[2] - 1;
-		c[2] = c[3] - 1;
-		c[3] = c[4] - 1;
-		c[4] = c[6] - 1;
-		c[5] = c[7] - 1;
-
-		Marc_GetPosition (Mesh, d[0], pos);
-		for (l = 0; l < DIM; l++)
-		  Mesh->Position[nCorners - nBndP][l] = 0.25 * pos[l];
-		Marc_GetPosition (Mesh, d[1], pos);
-		for (l = 0; l < DIM; l++)
-		  Mesh->Position[nCorners - nBndP][l] += 0.25 * pos[l];
-		Marc_GetPosition (Mesh, d[3], pos);
-		for (l = 0; l < DIM; l++)
-		  Mesh->Position[nCorners - nBndP][l] += 0.25 * pos[l];
-		Marc_GetPosition (Mesh, d[4], pos);
-		for (l = 0; l < DIM; l++)
-		  Mesh->Position[nCorners - nBndP][l] += 0.25 * pos[l];
-
-
-		IFDEBUG (dom, 2)
-		  assert (Mesh->Element_corners[1][nElem - 1] == 6);
-
-		for (l = 0; l < nElem; l++)
-		  if (Mesh->Element_corners[1][l] == 8)
-		    if (CheckPrisms (Mesh->Element_corner_ids[1][l],
-				     Mesh->Element_corner_ids[1][nElem -
-								 1][2],
-				     Mesh->Element_corner_ids[1][nElem -
-								 1][1],
-				     Mesh->Element_corner_ids[1][nElem][1],
-				     Mesh->Element_corner_ids[1][nElem -
-								 1][0]))
-		      nFound++;
-		assert (Mesh->Element_corner_ids[1][nElem - 1][0]
-			== Mesh->Element_corner_ids[1][nElem][0]);
-		assert (Mesh->Element_corner_ids[1][nElem - 1][3]
-			== Mesh->Element_corner_ids[1][nElem][3]);
-		assert (Mesh->Element_corner_ids[1][nElem - 1][1]
-			== Mesh->Element_corner_ids[1][nElem][2]);
-		assert (Mesh->Element_corner_ids[1][nElem - 1][4]
-			== Mesh->Element_corner_ids[1][nElem][5]);
-		ENDDEBUG nElem--;
-
-		Mesh->Element_corners[1][nElem] = 5;
-		Mesh->Element_corner_ids[1][nElem][0] = c[0];
-		Mesh->Element_corner_ids[1][nElem][1] = c[1];
-		Mesh->Element_corner_ids[1][nElem][2] = c[2];
-		Mesh->Element_corner_ids[1][nElem][3] = d[2];
-		Mesh->Element_corner_ids[1][nElem][4] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 5;
-		Mesh->Element_corner_ids[1][nElem][0] = d[0];
-		Mesh->Element_corner_ids[1][nElem][1] = d[2];
-		Mesh->Element_corner_ids[1][nElem][2] = d[5];
-		Mesh->Element_corner_ids[1][nElem][3] = d[3];
-		Mesh->Element_corner_ids[1][nElem][4] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 5;
-		Mesh->Element_corner_ids[1][nElem][0] = d[5];
-		Mesh->Element_corner_ids[1][nElem][1] = d[2];
-		Mesh->Element_corner_ids[1][nElem][2] = d[1];
-		Mesh->Element_corner_ids[1][nElem][3] = d[4];
-		Mesh->Element_corner_ids[1][nElem][4] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 5;
-		Mesh->Element_corner_ids[1][nElem][0] = c[0];
-		Mesh->Element_corner_ids[1][nElem][1] = c[3];
-		Mesh->Element_corner_ids[1][nElem][2] = c[4];
-		Mesh->Element_corner_ids[1][nElem][3] = c[1];
-		Mesh->Element_corner_ids[1][nElem][4] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 5;
-		Mesh->Element_corner_ids[1][nElem][0] = c[1];
-		Mesh->Element_corner_ids[1][nElem][1] = c[4];
-		Mesh->Element_corner_ids[1][nElem][2] = c[5];
-		Mesh->Element_corner_ids[1][nElem][3] = c[2];
-		Mesh->Element_corner_ids[1][nElem][4] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 4;
-		Mesh->Element_corner_ids[1][nElem][0] = d[3];
-		Mesh->Element_corner_ids[1][nElem][1] = d[5];
-		Mesh->Element_corner_ids[1][nElem][2] = d[4];
-		Mesh->Element_corner_ids[1][nElem][3] = nCorners;
-		nElem++;
-		Mesh->Element_corners[1][nElem] = 4;
-		Mesh->Element_corner_ids[1][nElem][0] = c[3];
-		Mesh->Element_corner_ids[1][nElem][1] = c[5];
-		Mesh->Element_corner_ids[1][nElem][2] = c[4];
-		Mesh->Element_corner_ids[1][nElem][3] = nCorners;
-
-		nCorners++;
-
-
-	      }
-#endif
-	  }
-	else
-	  {
-	    Mesh->Element_corners[1][nElem] = n + 1;
-	    for (i = 0; i <= n; i++)
-	      Mesh->Element_corner_ids[1][nElem][i] = c[i] - 1;
-	  }
-      nElem++;
-
-/*		printf("%d %d %d %d %d\n",id,n,c[0],c[1],c[2]); */
-
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-file_corners_fill (FILE * f, HEAP * Heap, MESH * Mesh, INT MarkKey,
-		   DOUBLE * radius, DOUBLE * midpoint)
-{
-  int N, n, id, i, j;
-  double c[3], s;
-
-  fgets (theLine, MAX_LEN, f);
-  /* printf("%s",theLine); */
-
-  if (Marc_Extended == 0)
-    {
-      theLine[12] = 0;
-      theLine[11] = ' ';
-      theLine[10] = theLine[9];
-      theLine[9] = theLine[8];
-      theLine[8] = theLine[7];
-      theLine[7] = theLine[6];
-      theLine[6] = theLine[5];
-      theLine[5] = ' ';
-      theLine[4] = theLine[4];
-      theLine[3] = theLine[3];
-      theLine[2] = theLine[2];
-      theLine[1] = theLine[1];
-      theLine[0] = theLine[0];
-    }
-
-  if (sscanf (theLine, "%d %d", &N, &n) != 2)
-    return (1);
-
-  nCorners = n;
-
-  for (j = 0; j < 3; j++)
-    midpoint[j] = 0.0;
-
-  for (i = 0; i < n; i++)
-    {
-      fgets (theLine, MAX_LEN, f);
-
-      /* printf("in\n%s\n",theLine); */
-
-      ExpandLine (theLine);
-
-      if (sscanf (theLine, "%d %lg %lg %lg", &id, c, c + 1, c + 2) != 1 + N)
-	return (0);
-
-      if (i < nBndP)
-	for (j = 0; j < DIM; j++)
-	  midpoint[j] += c[j];
-
-      if (Mesh != NULL)
-	{
-	  if (i < nBndP)
-	    {
-	      M_BNDP *p = (M_BNDP *) Mesh->theBndPs[i];
-
-	      /* TODO remove  */
-	      M0_PATCH *patch = (M0_PATCH *) currBVP->patches[i];
-
-	      patch->type = MARC_0_PATCH_TYPE;
-	      patch->id = i;
-	      for (j = 0; j < DIM; j++)
-		patch->pos[j] = c[j];
-	      /*   */
-
-	      p->patch_id = i;
-	      for (j = 0; j < DIM; j++)
-		p->pos[j] = c[j];
-	    }
-	  else
-	    for (j = 0; j < 3; j++)
-	      Mesh->Position[i - nBndP][j] = c[j];
-	}
-      /* printf("%d %f %f %f\n",id,c[0],c[1],c[2]);  */
-    }
-  s = 1.0 / nBndP;
-  for (j = 0; j < DIM; j++)
-    midpoint[j] *= s;
-  if (Mesh != NULL)
-    {
-      *radius = 0.0;
-      for (i = 0; i < nBndP; i++)
-	{
-	  M_BNDP *p = (M_BNDP *) Mesh->theBndPs[i];
-
-	  for (j = 0; j < DIM; j++)
-	    *radius = MAX (*radius, fabs (midpoint[j] - p->pos[j]));
-	}
-    }
-  else
-    {
-      *radius = 0.0;
-      for (j = 0; j < DIM; j++)
-	*radius += ABS (midpoint[j]);
-    }
-
-  return (0);
-}
-
-static INT
-file_contact_fill (FILE * f, HEAP * Heap, MESH * Mesh, INT MarkKey)
-{
-  int id, c;
-
-  /* TODO: adapt for surface mesh */
-  return (0);
-
-/*	fgets(theLine, MAX_LEN, f); */
-
-  if (Mesh == NULL)
-    return (0);
-
-  nBndP = 0;
-  do
-    {
-      M_BNDP *p = (M_BNDP *) Mesh->theBndPs[nBndP];
-
-      fgets (theLine, MAX_LEN, f);
-      if (sscanf (theLine, "%d %d", &id, &c) != 2)
-	return (0);
-      nBndP++;
-
-      p->patch_id = nPPatch + c - 1;
-
-      /* printf("%d %d \n",id,c);  */
-
-    }
-  while (!feof (f));
-
-  UserWrite ("BVP: no contact\n");
-
-  return (0);
-}
-
-static INT
-file_triangles_fill (FILE * f, HEAP * Heap, MESH * Mesh, INT MarkKey)
-{
-  int id, n, i, c[3];
-
-  nTPatch = 0;
-  do
-    {
-      M2_PATCH *p = (M2_PATCH *) currBVP->patches[nPPatch + nTPatch];
-
-      fgets (theLine, MAX_LEN, f);
-      if (strlen (theLine) < 3)
-	continue;
-      if (sscanf (theLine, "%5d%5d%5d%5d%5d",
-		  &id, &n, c, c + 1, c + 2) != 2 + DIM)
-	return (0);
-
-      p->type = MARC_2_PATCH_TYPE;
-      p->c = n;
-      p->id = nTPatch + nPPatch;
-      for (i = 0; i < 3; i++)
-	p->p[i] = c[i] - 1;
-
-      nTPatch++;
-
-      /* printf("%d id %d %d %d %d %d\n",id,p->id,n,c[0],c[1],c[2]); */
-
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-file_positions_fill (FILE * f, HEAP * Heap, MESH * Mesh, INT MarkKey)
-{
-  int id, j;
-  double c[3];
-  M0_PATCH *p;
-
-  /** \todo adapt for surface mesh */
-  return (0);
-
-  fgets (theLine, MAX_LEN, f);
-  nPPatch = 0;
-  do
-    {
-      fgets (theLine, MAX_LEN, f);
-
-      ExpandLine (theLine);
-
-      if (sscanf (theLine, "%d %lg %lg %lg", &id, c, c + 1, c + 2) != 1 + DIM)
-	return (0);
-
-      p = (M0_PATCH *) currBVP->patches[nPPatch];
-      p->type = MARC_0_PATCH_TYPE;
-      p->id = nPPatch;
-      for (j = 0; j < 3; j++)
-	p->pos[j] = c[j];
-
-      nPPatch++;
-
-      /* printf("%d %f %f %f nP %d\n",id,c[0],c[1],c[2],nPPatch); */
-
-    }
-  while (!feof (f));
-
-  return (1);
-}
-
-static INT
-Marc_Configure (INT argc, char **argv)
-{
-  STD_BVP *theBVP;
-  char BVPName[NAMESIZE];
-  INT i;
-  char name[NAMESIZE];
-
-  /* get BVP name */
-  if ((sscanf
-       (argv[0], expandfmt (CONCAT3 (" configure %", NAMELENSTR, "[ -~]")),
-	BVPName) != 1) || (strlen (BVPName) == 0))
-    {
-      for (i = 0; i < argc; i++)
-	if (argv[i][0] == 'b')
-	  if ((sscanf
-	       (argv[i], expandfmt (CONCAT3 ("b %", NAMELENSTR, "[ -~]")),
-		BVPName) == 1) && (strlen (BVPName) > 0))
-	    break;
-      if (i >= argc)
-	RETURN (1);
-    }
-  theBVP = (STD_BVP *) BVP_GetByName (BVPName);
-  if (theBVP == NULL)
-    RETURN (1);
-
-  for (i = 1; i < argc; i++)
-    {
-      if (argv[i][0] == 'm')
-	{
-	  if (sscanf (argv[i], "mesh %s", name) != 1)
-	    continue;
-	  strcpy (theBVP->mesh_file, name);
-	}
-      if (argv[i][0] == 'b')
-	{
-	  if (sscanf (argv[i], "bnd %s", name) != 1)
-	    continue;
-	  strcpy (theBVP->bnd_file, name);
-	}
-    }
-
-  return (0);
-}
-
-static BVP *
-Init_MarcBVP (STD_BVP * theBVP, HEAP * Heap, MESH * Mesh, INT MarkKey)
-{
-  FILE *stream;
-  INT i;
-
-  currBVP = theBVP;
-#ifdef ModelP
-  SetBVPType (theBVP->type);
-#endif
-  STD_BVP_NDOMPART (theBVP) = 1;
-  STD_BVP_NSUBDOM (theBVP) = 1;
-  STD_BVP_S2P_PTR (theBVP) = (INT *)
-    GetFreelistMemory (Heap, (1 + STD_BVP_NSUBDOM (theBVP)) * sizeof (INT));
-  if (STD_BVP_S2P_PTR (theBVP) == NULL)
-    return (NULL);
-  STD_BVP_S2P_PTR (theBVP)[0] = 0;
-  STD_BVP_S2P_PTR (theBVP)[1] = 0;
-
-#ifdef ModelP
-  if (me == 0)
-    {
-#endif
-
-      nPPatch = nLPatch = nTPatch = 0;
-
-      /* read numbers of objects */
-      stream = fileopen (theBVP->mesh_file, "r");
-      if (stream == NULL)
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not open file");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_readline (stream, "extended"))
-	{
-	  Marc_Extended = 0;
-	  fclose (stream);
-	  stream = fileopen (theBVP->mesh_file, "r");
-	}
-      else
-	{
-	  Marc_Extended = 1;
-	}
-      if (file_readline (stream, "connectivity"))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP",
-			     "could not read connectivity");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_elements (stream))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not read element");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_corners (stream))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not read corners");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_readline (stream, "surface"))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not read surface");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_contact (stream))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not read contact");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      fclose (stream);
-      stream = fileopen (theBVP->bnd_file, "r");
-      if (stream == NULL)
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not open file");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_readline (stream, "connectivity"))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP",
-			     "could not store connectivity");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_triangles (stream))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not store surface");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_positions (stream))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP",
-			     "could not store positions");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      fclose (stream);
-
-      PRINTDEBUG (dom, 1,
-		  ("A: nCorners %d nBndP %d nElem %d nPPatch %d nTPatch %d nPri %d\n",
-		   nCorners, nBndP, nElem, nPPatch, nTPatch, nPri));
-
-#ifdef PRISM_MOD
-      nPri = nPri / 2;
-      nElem += 5 * nPri;
-      nCorners += nPri;
-#endif
-
-      nPPatch = MAX (nPPatch, nBndP);
-
-#ifdef ModelP
-    }
-  Broadcast (&nCorners, sizeof (INT));
-  Broadcast (&nBndP, sizeof (INT));
-  Broadcast (&nElem, sizeof (INT));
-  Broadcast (&nPPatch, sizeof (INT));
-  Broadcast (&nTPatch, sizeof (INT));
-#endif
-
-  /* fill mesh and patch infos */
-  if (Mesh != NULL)
-    {
-      Mesh->mesh_status = MESHSTAT_MESH;
-      Mesh->nBndP = nBndP;
-      Mesh->theBndPs =
-	(BNDP **) GetTmpMem (Heap, nBndP * sizeof (M_BNDP *), MarkKey);
-      if (Mesh->theBndPs == NULL)
-	REP_ERR_RETURN_PTR (NULL);
-      for (i = 0; i < nBndP; i++)
-	{
-	  Mesh->theBndPs[i] =
-	    (BNDP *) GetFreelistMemory (Heap, sizeof (M_BNDP));
-	  if (Mesh->theBndPs[i] == NULL)
-	    REP_ERR_RETURN_PTR (NULL);
-	}
-      Mesh->nInnP = nCorners - nBndP;
-      Mesh->Position = (DOUBLE **)
-	GetTmpMem (Heap, (nCorners - nBndP) * sizeof (DOUBLE *), MarkKey);
-      if (nCorners > nBndP)
-	if (Mesh->Position == NULL)
-	  REP_ERR_RETURN_PTR (NULL);
-      for (i = 0; i < nCorners - nBndP; i++)
-	{
-	  Mesh->Position[i] = (DOUBLE *)
-	    GetTmpMem (Heap, 3 * sizeof (DOUBLE), MarkKey);
-	  if (Mesh->Position[i] == NULL)
-	    REP_ERR_RETURN_PTR (NULL);
-	}
-      Mesh->nSubDomains = 1;
-      Mesh->nSides = NULL;
-      Mesh->Side_corners = NULL;
-      Mesh->xy_Side = NULL;
-      Mesh->Side_corner_ids = NULL;
-      Mesh->nElements = (INT *)
-	GetTmpMem (Heap, (Mesh->nSubDomains + 1) * sizeof (INT), MarkKey);
-      Mesh->nElements[0] = 0;
-      Mesh->nElements[1] = nElem;
-      Mesh->Element_corners = (INT **)
-	GetTmpMem (Heap, (Mesh->nSubDomains + 1) * sizeof (INT), MarkKey);
-      Mesh->Element_corners[0] = NULL;
-      Mesh->Element_corners[1] = (INT *)
-	GetTmpMem (Heap, nElem * sizeof (INT), MarkKey);
-      for (i = 0; i < nElem; i++)
-	Mesh->Element_corners[1][i] = 8;
-      Mesh->Element_corner_ids = (INT ***)
-	GetTmpMem (Heap, (Mesh->nSubDomains + 1) * sizeof (INT **), MarkKey);
-      Mesh->Element_corner_ids[0] = NULL;
-      Mesh->Element_corner_ids[1] = (INT **)
-	GetTmpMem (Heap, nElem * sizeof (INT *), MarkKey);
-      for (i = 0; i < nElem; i++)
-	{
-	  Mesh->Element_corner_ids[1][i] = (INT *)
-	    GetTmpMem (Heap, Mesh->Element_corners[1][i] * sizeof (INT),
-		       MarkKey);
-	}
-      Mesh->nbElements = NULL;
-      Mesh->ElemSideOnBnd = NULL;
-
-      /* parallel part */
-      Mesh->VertexLevel = NULL;
-      Mesh->VertexPrio = NULL;
-      Mesh->ElementLevel = NULL;
-      Mesh->ElementPrio = NULL;
-    }
-  theBVP->patches = (PATCH **)
-    GetFreelistMemory (Heap, (nPPatch + nTPatch) * sizeof (PATCH *));
-  for (i = 0; i < nPPatch; i++)
-    {
-      M0_PATCH *patch =
-	(M0_PATCH *) GetFreelistMemory (Heap, sizeof (M0_PATCH));
-
-      patch->type = MARC_0_PATCH_TYPE;
-      patch->id = i;
-      theBVP->patches[i] = (PATCH *) patch;
-    }
-  for (i = nPPatch; i < nPPatch + nLPatch; i++)
-    theBVP->patches[i] = (PATCH *)
-      GetFreelistMemory (Heap, sizeof (M1_PATCH));
-  for (i = nPPatch + nLPatch; i < nPPatch + nLPatch + nTPatch; i++)
-    theBVP->patches[i] = (PATCH *)
-      GetFreelistMemory (Heap, sizeof (M2_PATCH));
-  currBVP->sideoffset = nPPatch + nLPatch;
-
-  PRINTDEBUG (dom, 1,
-	      ("B: nCorners %d nBndP %d nElem %d nPPatch %d nTPatch %d\n",
-	       nCorners, nBndP, nElem, nPPatch, nTPatch));
-
-#ifdef ModelP
-  if (me == 0)
-    {
-#endif
-
-      stream = fileopen (theBVP->bnd_file, "r");
-      if (stream == NULL)
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_readline (stream, "connectivity"))
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_triangles_fill (stream, Heap, Mesh, MarkKey))
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_positions_fill (stream, Heap, Mesh, MarkKey))
-	REP_ERR_RETURN_PTR (NULL);
-
-      fclose (stream);
-
-      stream = fileopen (theBVP->mesh_file, "r");
-      if (stream == NULL)
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_readline (stream, "coordinates"))
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_corners_fill (stream, Heap, Mesh, MarkKey,
-			     &(theBVP->radius), theBVP->MidPoint))
-	REP_ERR_RETURN_PTR (NULL);
-
-      fclose (stream);
-
-      stream = fileopen (theBVP->mesh_file, "r");
-      if (stream == NULL)
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_readline (stream, "connectivity"))
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_elements_fill (stream, Heap, Mesh, MarkKey))
-	REP_ERR_RETURN_PTR (NULL);
-
-      if (file_readline (stream, "surface"))
-	{
-	  PrintErrorMessage ('F', "Init_MarcBVP", "could not read surface");
-	  REP_ERR_RETURN_PTR (NULL);
-	}
-      if (file_contact_fill (stream, Heap, Mesh, MarkKey))
-	REP_ERR_RETURN_PTR (NULL);
-
-      fclose (stream);
-
-      /*
-         #ifdef __THREEDIM__
-         if (Mesh != NULL)
-         RepairMesh(Heap,MarkKey,Mesh);
-         #endif
-       */
-
-#ifdef ModelP
-    }
-  for (i = 0; i < nPPatch; i++)
-    Broadcast (theBVP->patches[i], sizeof (M0_PATCH));
-  for (i = nPPatch; i < nPPatch + nLPatch; i++)
-    Broadcast (theBVP->patches[i], sizeof (M1_PATCH));
-  for (i = nPPatch + nLPatch; i < nPPatch + nLPatch + nTPatch; i++)
-    Broadcast (theBVP->patches[i], sizeof (M2_PATCH));
-  Broadcast (&(theBVP->radius), sizeof (DOUBLE));
-  Broadcast (theBVP->MidPoint, DIM * sizeof (DOUBLE));
-#endif
-
-  STD_BVP_NDOMPART (theBVP) = 1;
-  STD_BVP_NSUBDOM (theBVP) = 1;
-  STD_BVP_S2P_PTR (theBVP) = (INT *)
-    GetFreelistMemory (Heap, (1 + STD_BVP_NSUBDOM (theBVP)) * sizeof (INT));
-  if (STD_BVP_S2P_PTR (theBVP) == NULL)
-    REP_ERR_RETURN_PTR (NULL);
-  STD_BVP_S2P_PTR (theBVP)[0] = 0;
-  STD_BVP_S2P_PTR (theBVP)[1] = 0;
-
-
-  PRINTDEBUG (dom, 1,
-	      ("C: nCorners %d nBndP %d nElem %d nPPatch %d nTPatch %d nFound %d\n",
-	       nCorners, nBndP, nElem, nPPatch, nTPatch, nFound));
-
-  return ((BVP *) theBVP);
-}
-
-static INT
-M_BNDP_Global (BNDP * bp, DOUBLE * global)
-{
-  M_BNDP *p = (M_BNDP *) bp;
-  INT j;
-
-  for (j = 0; j < DIM; j++)
-    global[j] = p->pos[j];
-
-  return (0);
-}
-
-static INT
-M_BNDP_Move (BNDP * aBndP, const DOUBLE global[])
-{
-  printf ("not implemented line %d\n", __LINE__);
-
-  return (1);
-}
-
-static INT
-M_BNDP_BndCond (BNDP * theBndP, INT * n, INT i,
-		DOUBLE * in, DOUBLE * value, INT * type)
-{
-  printf ("not implemented line %d\n", __LINE__);
-
-  return (1);
-}
-
-static INT
-M_BNDP_BndPDesc (BNDP * theBndP, INT * move, INT * part)
-{
-  *move = 0;
-  *part = 0;
-
-  return (0);
-}
-
-static INT
-M_BNDP_BndEDesc (BNDP * theBndP0, BNDP * theBndP1, INT * part)
-{
-  *part = 0;
-
-  return (0);
-}
-
-static BNDS *
-M_BNDP_CreateBndS (HEAP * Heap, BNDP ** theBndP, INT n)
-{
-  M_BNDS *p = (M_BNDS *) GetFreelistMemory (Heap, M_BNDS_NSIZE (n));
-  INT i, j;
-
-  for (i = 0; i < n; i++)
-    {
-      M_BNDP *b = (M_BNDP *) theBndP[i];
-      p->p[i].patch_id = b->patch_id;
-      for (j = 0; j < DIM; j++)
-	p->p[i].pos[j] = b->pos[j];
-    }
-  p->n = n;
-
-  return ((BNDS *) p);
-}
-
-#ifdef __THREEDIM__
-/*#define CYLINDER */
-#define BENCHMARK
-#endif
-
-static BNDP *
-M_BNDP_CreateBndP (HEAP * Heap, BNDP * theBndP0,
-		   BNDP * theBndP1, DOUBLE lcoord)
-{
-  M_BNDP *p0 = (M_BNDP *) theBndP0;
-  M_BNDP *p1 = (M_BNDP *) theBndP1;
-  M_BNDP *p = (M_BNDP *) GetFreelistMemory (Heap, sizeof (M_BNDP));
-  INT j;
-
-  ASSERT (p != NULL);
-
-  for (j = 0; j < DIM; j++)
-    p->pos[j] = (1.0 - lcoord) * p0->pos[j] + lcoord * p1->pos[j];
-#ifdef CYLINDER
-  {
-    DOUBLE r0 = p0->pos[0] * p0->pos[0] + p0->pos[1] * p0->pos[1];
-    DOUBLE r1 = p1->pos[0] * p1->pos[0] + p1->pos[1] * p1->pos[1];
-
-    if ((r1 > 0.01) && (ABS (r1 - r0) < 0.01))
-      {
-	DOUBLE r = p->pos[0] * p->pos[0] + p->pos[1] * p->pos[1];
-	DOUBLE s = sqrt (r1 / r);
-
-	p->pos[0] *= s;
-	p->pos[1] *= s;
-      }
-  }
-#endif
-#ifdef BENCHMARK
-  {
-    DOUBLE r0 =
-      (p0->pos[0] - 10) * (p0->pos[0] - 10) + p0->pos[1] * p0->pos[1];
-    DOUBLE r1 =
-      (p1->pos[0] - 10) * (p1->pos[0] - 10) + p1->pos[1] * p1->pos[1];
-
-    if ((r1 > 0.01) && (ABS (r1 - r0) < 0.01))
-      {
-	DOUBLE r =
-	  (p->pos[0] - 10) * (p->pos[0] - 10) + p->pos[1] * p->pos[1];
-	DOUBLE s = sqrt (r1 / r);
-
-	p->pos[0] = 10 + s * (p->pos[0] - 10);
-	p->pos[1] *= s;
-      }
-  }
-#endif
-
-  return ((BNDP *) p);
-}
-
-static INT
-M_BNDP_Dispose (HEAP * Heap, BNDP * theBndP)
-{
-  return (PutFreelistMemory (Heap, theBndP, sizeof (M_BNDP)));
-}
-
-static INT
-M_BNDP_SaveBndP (BNDP * theBndP)
-{
-  M_BNDP *p = (M_BNDP *) theBndP;
-  INT j;
-  int iList[1];
-  double dList[DIM];
-
-  iList[0] = p->patch_id;
-  if (Bio_Write_mint (1, iList))
-    return (1);
-
-  for (j = 0; j < DIM; j++)
-    dList[j] = p->pos[j];
-  if (Bio_Write_mdouble (DIM, dList))
-    return (1);
-
-  return (0);
-}
-
-static INT
-M_BNDP_SaveInsertedBndP (BNDP * theBndP, char *data, INT max_data_size)
-{
-  printf ("not implemented line %d\n", __LINE__);
-
-  return (1);
-}
-
-static BNDP *
-M_BNDP_LoadBndP (BVP * theBVP, HEAP * Heap)
-{
-  M_BNDP *p = (M_BNDP *) GetFreelistMemory (Heap, sizeof (M_BNDP));
-  INT j;
-  int iList[1];
-  double dList[DIM];
-
-  if (Bio_Read_mint (1, iList))
-    return (NULL);
-  p->patch_id = iList[0];
-  if (Bio_Read_mdouble (DIM, dList))
-    return (NULL);
-
-  for (j = 0; j < DIM; j++)
-    p->pos[j] = dList[j];
-
-  return ((BNDP *) p);
-}
-
-static INT
-M_BNDS_Global (BNDS * theBndS, DOUBLE * local, DOUBLE * global)
-{
-  M_BNDS *p = (M_BNDS *) theBndS;
-  INT i;
-
-#ifdef __TWODIM__
-  for (i = 0; i < DIM; i++)
-    global[i] = (1.0 - local[0]) * p->p[0].pos[i] + local[0] * p->p[1].pos[i];
-#endif
-#ifdef __THREEDIM__
-  if (p->n == 4)
-    for (i = 0; i < DIM; i++)
-      global[i] = (1.0 - local[0]) * (1.0 - local[1]) * p->p[0].pos[i]
- 