# $Id$
-CXX=c++
-INCLUDE = -I../include -I../../lac/include -I../../base/include
-CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
- -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions
-CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
- -funroll-loops -felide-constructors -fnonnull-objects \
- -fno-rtti -fno-exceptions
+# list the directories we want to visit
+subdirs = grid/ dof/ poisson/ convergence/ error-estimation/
-LIBPATH = -L../lib -L../../lac/lib
-LIBFILES.g= ../lib/libbasic.g.a ../lib/libgrid.g.a \
- ../lib/libfe.g.a ../lib/libnumerics.g.a \
- ../../lac/lib/liblac.g.a
-LIBFILES = $(LIBFILES.g:.g.a=.a)
-LIBS.g = $(LIBPATH) -lgrid.g -lfe.g -lnumerics.g -llac.g -lbasic.g
-LIBS = $(LIBS.g:.g=)
+# define lists of targets: for each directory we produce a target name
+# for compilation, running and cleaning by appending the action to
+# the directory name (replacing the slash by ".action")
+compile = $(subdirs:/=.compile)
+run = $(subdirs:/=.run)
+clean = $(subdirs:/=.clean)
+# define global targets which are to be excuted in every subdirectory
+compile: $(compile)
+run : $(run)
+# for cleaning up: do this also for the present directory
+clean : $(clean)
+ rm -f *~
-ifeq ($(shell uname),Linux)
-CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
-endif
-ifeq ($(shell uname),SunOS)
-CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
-endif
+# define the action of the targets for the specific subdirectories
+$(compile) :
+ cd $(@:.compile=) ; make
-cc-files = grid/grid_test.cc dof/dof_test.cc poisson/poisson.cc \
- convergence/convergence.cc error-estimation/error-estimation
-o-files = $(cc-files:.cc=.o)
-h-files = $(wildcard ../include/*.h)
+$(run) :
+ cd $(@:.run=) ; make run
-examples: $(cc-files:.cc=)
-
-%.o : %.cc
- @echo ================= Compiling $<
- @$(CXX) $(CXXFLAGS.g) $(INCLUDE) -o $@ -g -c $<
-
-grid/grid_test: grid/grid_test.o $(LIBFILES)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS) -o $@ $< $(LIBS.g)
-
-dof/dof_test: dof/dof_test.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS.g) -lg++
-
-poisson/poisson:
- @cd poisson ; make
-
-convergence/convergence: convergence/convergence.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o
-
-error-estimation/error-estimation: error-estimation/error-estimation.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o
-
-
-run: run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test
-
-run_grid_test:
- cd grid ; grid_test 4 ; mv grid.1 grid.4
- cd grid ; grid_test 3 ; mv grid.1 grid.3
- cd grid ; grid_test 2 ; mv grid.1 grid.2
- cd grid ; grid_test 1
- cd grid ; gnuplot make_ps
-
-run_dof_test:
- cd dof ; dof_test dof_test.prm
- cd dof ; gnuplot make_ps
-
-run_poisson_test:
- cd poisson ; make run
-
-run_convergence_test:
- cd convergence ; convergence
- cd convergence ; gnuplot make_ps
-
-run_error_test:
- cd error-estimation ; error-estimation
- cd error-estimation ; gnuplot make_ps
-
-clean:
- cd grid ; rm -f grid.[1234] *.eps *.o *~ grid_test
- cd dof ; rm -f grid.* sparsity.* *.o *~ dof_test
- cd poisson ; make clean
- cd convergence ; rm -f *.o convergence *~ *.eps gnuplot.*
- cd error-estimation ; rm -f *.o error-estimation *~ *.eps gnuplot.*
-
-
-.PHONY: run run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test clean
-
-
-#Rule to generate the dependency file. This file is
-#automagically remade whenever needed, i.e. whenever
-#one of the cc-/h-files changed. Make detects whether
-#to remake this file upon inclusion at the bottom
-#of this file.
-Makefile.dep: $(cc-files) $(h-files)
- @echo ================= Making $@
- @$(CXX) $(INCLUDE) -M $(cc-files) > Makefile.dep
-
-include Makefile.dep
+$(clean) :
+ cd $(@:.clean=) ; make clean
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = convergence
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters =
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot* *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_q_points | update_gradients |
- update_jacobians | update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
+ update_jacobians | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = dof_test
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs =
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = $(target).prm
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = grid* sparsity* *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
cout << " Distributing degrees of freedom..." << endl;
- FEQuadratic<dim> fe;
+ FELinear<dim> fe;
dof->distribute_dofs (fe);
cout << " Renumbering degrees of freedom..." << endl;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = error-estimation
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters =
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action =
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot*
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_q_points | update_gradients |
- update_jacobians | update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
+ update_jacobians | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = grid_test
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs =
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = 1
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = grid_test 2 ; grid_test 3 ; grid_test 4 ; gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = grid.? *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
#include <grid/tria_boundary.h>
#include <grid/tria_iterator.h>
#include <grid/tria.h>
+#include <fstream>
+#include <string>
#include <cmath>
-#include <fstream.h>
-extern "C" {
-# include <stdlib.h>
-}
+#include <cstdlib>
+
// 1: continuous refinement of the unit square always in the middle
// output the grid
- ofstream out("grid.1");
+ string filename("grid.");
+ filename += ('0'+test_case);
+
+ ofstream out(filename.c_str());
tria.print_gnuplot (out);
cout << " Total number of cells = " << tria.n_cells() << endl
# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = poisson
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = $(target).prm
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot* *.eps
+
+
+
+
+###############################################################################
+# Internals
CXX = c++
INCLUDE = -I../../include -I../../../lac/include \
-funroll-loops -felide-constructors -fnonnull-objects \
-fno-rtti -fno-exceptions $(INCLUDE)
+
+# if on specific systems, change compiler path
ifeq ($(shell uname),Linux)
CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
endif
CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
endif
-LIBPATH = -L../../lib -L../../../lac/lib
-LIBFILES.g= ../../lib/libbasic.g.a ../../lib/libgrid.g.a \
- ../../lib/libfe.g.a ../../lib/libnumerics.g.a \
- ../../../lac/lib/liblac.g.a
-LIBFILES = $(LIBFILES.g:.g.a=.a)
-LIBS.g = $(LIBPATH) -lbasic.g -lgrid.g -lfe.g -lnumerics.g -llac.g
-LIBS = $(LIBS.g:.g=)
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
-cc-files = $(wildcard *.cc)
-o-files = $(cc-files:.cc=.o)
-go-files = $(cc-files:.cc=.go)
-h-files = $(wildcard ../include/*/*.h)
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
-%.go : %.cc poisson.h
+# rule to make object files
+%.go : %.cc
@echo ============================ Compiling with debugging information: $<
@echo $(CXX) ... -c $< -o $@
@$(CXX) $(CXXFLAGS.g) -c $< -o $@
-%.o : %.cc poisson.h
+%.o : %.cc
@echo ============================ Compiling with optimization: $<
@echo $(CXX) ... -c $< -o $@
@$(CXX) $(CXXFLAGS) -c $< -o $@
-poisson: $(go-files) $(LIBFILES.g)
- @echo ============================ Linking poisson
- @$(CXX) -g $(CXXFLAGS.g) $(go-files) -o $@ ../../../mia/control.o $(LIBS.g) -lg++
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
-run: poisson
- poisson poisson.prm
- gnuplot make_ps
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
-clean:
- rm -f *.o *.go *~ poisson gnuplot.* *.eps
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+include Makefile.dep
-.PHONY: run clean
Function<dim> *rhs;
Function<dim> *boundary_values;
+
+ Boundary<dim> *boundary;
};
template <int dim>
PoissonProblem<dim>::PoissonProblem () :
- tria(0), dof(0), rhs(0), boundary_values(0) {};
+ tria(0), dof(0), rhs(0), boundary_values(0), boundary(0) {};
boundary_values = 0;
};
+ if (boundary != 0)
+ {
+ delete boundary;
+ boundary = 0;
+ };
+
ProblemBase<dim>::clear ();
};
switch (test_case)
{
case 1:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
make_zoom_in_grid ();
break;
case 2:
// unit radius
{
static const Point<dim> origin;
- static const HyperBallBoundary<dim> boundary(origin, 1.);
+ boundary = new HyperBallBoundary<dim>(origin, 1.);
tria->create_hyper_ball (origin, 1.);
- tria->set_boundary (&boundary);
+ tria->set_boundary (boundary);
break;
};
case 3:
// set the boundary function
{
- static const CurvedLine<dim> boundary;
+ boundary = new CurvedLine<dim>();
tria->create_hypercube ();
- tria->set_boundary (&boundary);
+ tria->set_boundary (boundary);
break;
};
case 4:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
make_random_grid ();
break;
case 5:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hypercube ();
break;
case 6:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hypercube ();
tria->refine_global (1);
for (unsigned int i=0; i<5; ++i)
};
break;
case 7:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hyper_L ();
break;
default:
cout << dof->n_dofs() << " degrees of freedom." << endl;
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_gradients | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, quadrature, fe, update_flags, dirichlet_bc);
+ assemble (equation, quadrature, fe,
+ UpdateFlags(update_gradients | update_JxW_values |
+ update_jacobians | update_q_points),
+ dirichlet_bc, *boundary);
cout << " Solving..." << endl;
solve ();
# $Id$
-CXX=c++
-INCLUDE = -I../include -I../../lac/include -I../../base/include
-CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
- -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions
-CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
- -funroll-loops -felide-constructors -fnonnull-objects \
- -fno-rtti -fno-exceptions
+# list the directories we want to visit
+subdirs = grid/ dof/ poisson/ convergence/ error-estimation/
-LIBPATH = -L../lib -L../../lac/lib
-LIBFILES.g= ../lib/libbasic.g.a ../lib/libgrid.g.a \
- ../lib/libfe.g.a ../lib/libnumerics.g.a \
- ../../lac/lib/liblac.g.a
-LIBFILES = $(LIBFILES.g:.g.a=.a)
-LIBS.g = $(LIBPATH) -lgrid.g -lfe.g -lnumerics.g -llac.g -lbasic.g
-LIBS = $(LIBS.g:.g=)
+# define lists of targets: for each directory we produce a target name
+# for compilation, running and cleaning by appending the action to
+# the directory name (replacing the slash by ".action")
+compile = $(subdirs:/=.compile)
+run = $(subdirs:/=.run)
+clean = $(subdirs:/=.clean)
+# define global targets which are to be excuted in every subdirectory
+compile: $(compile)
+run : $(run)
+# for cleaning up: do this also for the present directory
+clean : $(clean)
+ rm -f *~
-ifeq ($(shell uname),Linux)
-CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
-endif
-ifeq ($(shell uname),SunOS)
-CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
-endif
+# define the action of the targets for the specific subdirectories
+$(compile) :
+ cd $(@:.compile=) ; make
-cc-files = grid/grid_test.cc dof/dof_test.cc poisson/poisson.cc \
- convergence/convergence.cc error-estimation/error-estimation
-o-files = $(cc-files:.cc=.o)
-h-files = $(wildcard ../include/*.h)
+$(run) :
+ cd $(@:.run=) ; make run
-examples: $(cc-files:.cc=)
-
-%.o : %.cc
- @echo ================= Compiling $<
- @$(CXX) $(CXXFLAGS.g) $(INCLUDE) -o $@ -g -c $<
-
-grid/grid_test: grid/grid_test.o $(LIBFILES)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS) -o $@ $< $(LIBS.g)
-
-dof/dof_test: dof/dof_test.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS.g) -lg++
-
-poisson/poisson:
- @cd poisson ; make
-
-convergence/convergence: convergence/convergence.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o
-
-error-estimation/error-estimation: error-estimation/error-estimation.o $(LIBFILES.g)
- @echo ================= Linking $@
- @$(CXX) $(CXXFLAGS.g) -o $@ $< $(LIBS) ../../mia/control.o
-
-
-run: run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test
-
-run_grid_test:
- cd grid ; grid_test 4 ; mv grid.1 grid.4
- cd grid ; grid_test 3 ; mv grid.1 grid.3
- cd grid ; grid_test 2 ; mv grid.1 grid.2
- cd grid ; grid_test 1
- cd grid ; gnuplot make_ps
-
-run_dof_test:
- cd dof ; dof_test dof_test.prm
- cd dof ; gnuplot make_ps
-
-run_poisson_test:
- cd poisson ; make run
-
-run_convergence_test:
- cd convergence ; convergence
- cd convergence ; gnuplot make_ps
-
-run_error_test:
- cd error-estimation ; error-estimation
- cd error-estimation ; gnuplot make_ps
-
-clean:
- cd grid ; rm -f grid.[1234] *.eps *.o *~ grid_test
- cd dof ; rm -f grid.* sparsity.* *.o *~ dof_test
- cd poisson ; make clean
- cd convergence ; rm -f *.o convergence *~ *.eps gnuplot.*
- cd error-estimation ; rm -f *.o error-estimation *~ *.eps gnuplot.*
-
-
-.PHONY: run run_grid_test run_dof_test run_poisson_test run_convergence_test run_error_test clean
-
-
-#Rule to generate the dependency file. This file is
-#automagically remade whenever needed, i.e. whenever
-#one of the cc-/h-files changed. Make detects whether
-#to remake this file upon inclusion at the bottom
-#of this file.
-Makefile.dep: $(cc-files) $(h-files)
- @echo ================= Making $@
- @$(CXX) $(INCLUDE) -M $(cc-files) > Makefile.dep
-
-include Makefile.dep
+$(clean) :
+ cd $(@:.clean=) ; make clean
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = convergence
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters =
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot* *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_q_points | update_gradients |
- update_jacobians | update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
+ update_jacobians | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = dof_test
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs =
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = $(target).prm
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = grid* sparsity* *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
cout << " Distributing degrees of freedom..." << endl;
- FEQuadratic<dim> fe;
+ FELinear<dim> fe;
dof->distribute_dofs (fe);
cout << " Renumbering degrees of freedom..." << endl;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = error-estimation
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters =
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action =
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot*
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
n_dofs.push_back (dof->n_dofs());
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_q_points | update_gradients |
- update_jacobians | update_JxW_values);
+ UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients |
+ update_jacobians | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
+# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = grid_test
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs =
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = 1
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = grid_test 2 ; grid_test 3 ; grid_test 4 ; gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = grid.? *.eps
+
+
+
+
+###############################################################################
+# Internals
+
+CXX = c++
+INCLUDE = -I../../include -I../../../lac/include \
+ -I../../../base/include -I../../../mia/include
+CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
+ -Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
+ $(INCLUDE)
+CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
+ -funroll-loops -felide-constructors -fnonnull-objects \
+ -fno-rtti -fno-exceptions $(INCLUDE)
+
+
+# if on specific systems, change compiler path
+ifeq ($(shell uname),Linux)
+CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
+endif
+
+ifeq ($(shell uname),SunOS)
+CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
+endif
+
+
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
+
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+
+
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
+
+
+# rule to make object files
+%.go : %.cc
+ @echo ============================ Compiling with debugging information: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS.g) -c $< -o $@
+%.o : %.cc
+ @echo ============================ Compiling with optimization: $<
+ @echo $(CXX) ... -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
+
+
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
+
+
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
+
+
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+
+
+include Makefile.dep
+
#include <grid/tria_boundary.h>
#include <grid/tria_iterator.h>
#include <grid/tria.h>
+#include <fstream>
+#include <string>
#include <cmath>
-#include <fstream.h>
-extern "C" {
-# include <stdlib.h>
-}
+#include <cstdlib>
+
// 1: continuous refinement of the unit square always in the middle
// output the grid
- ofstream out("grid.1");
+ string filename("grid.");
+ filename += ('0'+test_case);
+
+ ofstream out(filename.c_str());
tria.print_gnuplot (out);
cout << " Total number of cells = " << tria.n_cells() << endl
# $Id$
+# Author: Wolfgang Bangerth, 1998
+
+# Template for makefiles for the examples subdirectory. In principle,
+# everything should be done automatically if you set the target file
+# here correctly:
+target = poisson
+
+# All dependencies between files should be updated by the included
+# file Makefile.dep if necessary. Object files are compiled into
+# the archives ./Obj.a and ./Obj.g.a. By default, the debug version
+# is used to link. It you don't like that, change the following
+# variable to "off"
+debug-mode = on
+
+# If you want your program to be linked with extra object or library
+# files, specify them here:
+user-libs = ../../../mia/control.o
+
+# To run the program, use "make run"; to give parameters to the program,
+# give the parameters to the following variable:
+run-parameters = $(target).prm
+
+# To execute additional action apart from running the program, fill
+# in this list:
+additional-run-action = gnuplot make_ps
+
+# To specify which files are to be deleted by "make clean" (apart from
+# the usual ones: object files, executables, backups, etc), fill in the
+# following list
+delete-files = gnuplot* *.eps
+
+
+
+
+###############################################################################
+# Internals
CXX = c++
INCLUDE = -I../../include -I../../../lac/include \
-funroll-loops -felide-constructors -fnonnull-objects \
-fno-rtti -fno-exceptions $(INCLUDE)
+
+# if on specific systems, change compiler path
ifeq ($(shell uname),Linux)
CXX = /home/wolf/bin/gcc-2.8.1/bin/c++
endif
CXX = /usr/local/gcc/gcc-2.8.1/bin/c++
endif
-LIBPATH = -L../../lib -L../../../lac/lib
-LIBFILES.g= ../../lib/libbasic.g.a ../../lib/libgrid.g.a \
- ../../lib/libfe.g.a ../../lib/libnumerics.g.a \
- ../../../lac/lib/liblac.g.a
-LIBFILES = $(LIBFILES.g:.g.a=.a)
-LIBS.g = $(LIBPATH) -lbasic.g -lgrid.g -lfe.g -lnumerics.g -llac.g
-LIBS = $(LIBS.g:.g=)
+# get lists of files we need
+cc-files = $(wildcard *.cc)
+o-files = $(cc-files:.cc=.o)
+go-files = $(cc-files:.cc=.go)
+h-files = $(wildcard *.h)
+lib-h-files = $(wildcard ../../include/*/*.h)
-cc-files = $(wildcard *.cc)
-o-files = $(cc-files:.cc=.o)
-go-files = $(cc-files:.cc=.go)
-h-files = $(wildcard ../include/*/*.h)
+# list of libraries needed to link with
+libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a
+libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a
+# check whether we use debug mode or not
+ifeq ($(debug-mode),on)
+libraries = $(libs.g)
+flags = $(CXXFLAGS.g)
+endif
+
+ifeq ($(debug-mode),off)
+libraries = $(libs)
+flags = $(CXXFLAGS)
+endif
+
+
+
+# make rule for the target
+$(target) : $(libraries)
+ @echo ============================ Linking $@
+ @$(CXX) $(flags) -o $@ $(libraries) -lg++ $(user-libs)
+
+# rule how to run the program
+run: $(target)
+ $(target) $(run-parameters)
+ $(additional-run-action)
-%.go : %.cc poisson.h
+# rule to make object files
+%.go : %.cc
@echo ============================ Compiling with debugging information: $<
@echo $(CXX) ... -c $< -o $@
@$(CXX) $(CXXFLAGS.g) -c $< -o $@
-%.o : %.cc poisson.h
+%.o : %.cc
@echo ============================ Compiling with optimization: $<
@echo $(CXX) ... -c $< -o $@
@$(CXX) $(CXXFLAGS) -c $< -o $@
-poisson: $(go-files) $(LIBFILES.g)
- @echo ============================ Linking poisson
- @$(CXX) -g $(CXXFLAGS.g) $(go-files) -o $@ ../../../mia/control.o $(LIBS.g) -lg++
+# rules which files the libraries depend upon
+Obj.a: ./Obj.a($(o-files))
+Obj.g.a: ./Obj.g.a($(go-files))
-run: poisson
- poisson poisson.prm
- gnuplot make_ps
+clean:
+ rm -f *.o *.go *~ Makefile.dep Obj.a Obj.g.a $(target) $(delete-files)
-clean:
- rm -f *.o *.go *~ poisson gnuplot.* *.eps
+
+.PHONY: clean
+
+
+#Rule to generate the dependency file. This file is
+#automagically remade whenever needed, i.e. whenever
+#one of the cc-/h-files changed. Make detects whether
+#to remake this file upon inclusion at the bottom
+#of this file.
+#
+#use perl to generate rules for the .go files as well
+#as to make rules not for tria.o and the like, but
+#rather for libnumerics.a(tria.o)
+Makefile.dep: $(cc-files) $(h-files) $(lib-h-files)
+ @echo ============================ Remaking Makefile
+ @perl ../../Make_dep.pl ./Obj $(INCLUDE) $(cc-files) \
+ > Makefile.dep
+include Makefile.dep
-.PHONY: run clean
Function<dim> *rhs;
Function<dim> *boundary_values;
+
+ Boundary<dim> *boundary;
};
template <int dim>
PoissonProblem<dim>::PoissonProblem () :
- tria(0), dof(0), rhs(0), boundary_values(0) {};
+ tria(0), dof(0), rhs(0), boundary_values(0), boundary(0) {};
boundary_values = 0;
};
+ if (boundary != 0)
+ {
+ delete boundary;
+ boundary = 0;
+ };
+
ProblemBase<dim>::clear ();
};
switch (test_case)
{
case 1:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
make_zoom_in_grid ();
break;
case 2:
// unit radius
{
static const Point<dim> origin;
- static const HyperBallBoundary<dim> boundary(origin, 1.);
+ boundary = new HyperBallBoundary<dim>(origin, 1.);
tria->create_hyper_ball (origin, 1.);
- tria->set_boundary (&boundary);
+ tria->set_boundary (boundary);
break;
};
case 3:
// set the boundary function
{
- static const CurvedLine<dim> boundary;
+ boundary = new CurvedLine<dim>();
tria->create_hypercube ();
- tria->set_boundary (&boundary);
+ tria->set_boundary (boundary);
break;
};
case 4:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
make_random_grid ();
break;
case 5:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hypercube ();
break;
case 6:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hypercube ();
tria->refine_global (1);
for (unsigned int i=0; i<5; ++i)
};
break;
case 7:
+ boundary = new StraightBoundary<dim>();
+ tria->set_boundary (boundary);
tria->create_hyper_L ();
break;
default:
cout << dof->n_dofs() << " degrees of freedom." << endl;
cout << " Assembling matrices..." << endl;
- UpdateFields update_flags = UpdateFields(update_gradients | update_JxW_values);
ProblemBase<dim>::DirichletBC dirichlet_bc;
dirichlet_bc[0] = boundary_values;
- assemble (equation, quadrature, fe, update_flags, dirichlet_bc);
+ assemble (equation, quadrature, fe,
+ UpdateFlags(update_gradients | update_JxW_values |
+ update_jacobians | update_q_points),
+ dirichlet_bc, *boundary);
cout << " Solving..." << endl;
solve ();