# Common Makefile for all test directories
all: base lac fe deal.II multigrid bits hp
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ cd lapack ; $(MAKE) ; cd .. ; \
+ fi
base:
cd base ; $(MAKE)
echo =======Report: $$i ======= ; \
cd $$i ; $(MAKE) report ; cd .. ; \
done
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ echo =======Report: lapack ======= ; \
+ cd lapack ; $(MAKE) report ; cd .. ; \
+ fi
report+mail:
@for i in base lac fe deal.II multigrid bits hp all-headers ; do \
echo =======Report: $$i ======= ; \
cd $$i ; $(MAKE) report+mail ; cd .. ; \
done
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ echo =======Report: lapack ======= ; \
+ cd lapack ; $(MAKE) report+mail ; cd .. ; \
+ fi
# compilation of tests only, no execution of tests
build: build-base build-lac build-fe build-deal.II build-multigrid build-bits build-hp
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ cd lapack ; $(MAKE) build ; cd .. ; \
+ fi
build-base:
cd base ; $(MAKE) build
# reference values
output: output-base output-lac output-fe output-deal.II output-bits output-hp
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ cd lapack ; $(MAKE) output ; cd .. ; \
+ fi
output-base:
cd base ; $(MAKE) output
# update/generate references
refs: refs-base refs-lac refs-fe refs-deal.II refs-bits refs-hp
+ @if grep 'define HAVE_LIBLAPACK' $D/base/include/base/config.h ; then \
+ cd lapack ; $(MAKE) refs ; cd .. ; \
+ fi
refs-base:
cd base ; $(MAKE) refs
resultname:
@echo $(TARGET)+$(GXX-VERSION)
-clean: clean-base clean-lac clean-deal.II clean-fe clean-bits clean-hp
+clean: clean-base clean-lac clean-deal.II clean-fe clean-bits clean-hp clean-lapack
-distclean: distclean-base distclean-lac distclean-deal.II distclean-fe distclean-bits distclean-hp
+distclean: distclean-base distclean-lac distclean-deal.II distclean-fe distclean-bits distclean-hp distclean-lapack
clean-base:
cd base ; $(MAKE) clean
distclean-hp:
cd hp ; $(MAKE) distclean
+clean-lapack:
+ cd lapack ; $(MAKE) clean
+
+distclean-lapack:
+ cd lapack ; $(MAKE) distclean
+
.PHONY : all base lac fe deal.II multigrid bits \
clean clean-base clean-lac clean-fe \
clean-deal.II clean-multigrid clean-bits clean-hp \
#include <iostream>
+// Build the one dimensional discrete Laplacian for n intervals
template <typename number>
void test_laplacian(unsigned int n)
{
- TridiagonalMatrix<number> M(n, true);
- for (unsigned int i=0;i<n-1;++i)
+ TridiagonalMatrix<number> M(n-1, true);
+ for (unsigned int i=0;i<n-2;++i)
{
M(i,i) = 2.;
M(i,i+1) = -1.;
}
- M(n-1,n-1) = 2.;
+ M(n-2,n-2) = 2.;
M.compute_eigenvalues();
- for (unsigned int i=0;i<n;++i)
- deallog << i << '\t' << M.eigenvalue(i);
+ for (unsigned int i=0;i<5;++i)
+ deallog << '\t' << M.eigenvalue(i)*n*n;
+ deallog << "\t cond " << M.eigenvalue(n-2)/M.eigenvalue(0) << std::endl;
}
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
- test_laplacian<double>(50);
+ test_laplacian<double>(10);
+ test_laplacian<double>(20);
+ test_laplacian<double>(40);
+ test_laplacian<double>(80);
}