Commit 08891a5c authored by mm0's avatar mm0
Browse files

hello, I submit this version a bit odd, becouse

it comes from bug fixes and improvements that I
made to version lifev-0.4.1.tar.bz2 (not CVS)
cause I had not CVS access when I began.
so this version doesn't include all your changes made between
0.4.1 and the last one.
Anyway this includes support for reading netgen meshed and writing
netgen solutions, a test_netgen in testsuite and many bug fixes.
I hope it's all ok, becouse I simply copyed over a checkedout version
my files recursively. If you have problems compiling you could try
autoconf at the beginning. Bye
parent fbb163a3
......@@ -6,18 +6,18 @@ Politecnico (MOX) and INRIA (BANG).
In alphabetical order:
AM :: A. Moura
AV :: A. Veneziani
CP :: C. Prud'homme <christophe.prudhomme@epfl.ch>
CW :: C. Winkelmann <christoph.winkelmann@epfl.ch>
DADP :: D.A. Di Pietro
GF :: G. Fourestey
JFG :: J.F. Gerbeau
LF :: L. Formaggia
MF :: M. Fernandez
MP :: M. Prosi
SD :: S. Deparis
VM :: V. Martin
AM :: A. Moura
AV :: A. Veneziani
CP :: C. Prud'homme <christophe.prudhomme@epfl.ch>
CW :: C. Winkelmann <christoph.winkelmann@epfl.ch>
GF :: G. Fourestey
JFG:: J.F. Gerbeau
LF :: L. Formaggia
MF :: M. Fernandez
MM :: M. Meneghin
MP :: M. Prosi
SD :: S. Deparis
VM :: V. Martin
* Former Developers
===================
......
......@@ -47,6 +47,9 @@ The simplest way to compile this package is:
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
NOTE: If configure doesn't work you should need to run
autoconf before (Mauro Meneghin)
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
......
# -*- readme-debian -*-
Bugs fixed in 0.5.0:
Bugs fixed in 0.4.1modified_by_mm:
====================
* this release version is wrong and someone should try to insert other older
changes, I have applied changes to a .tar.bz2 0.4.1 version, later
I have had cvs login and to submit this version I did a
cp -R mydir lastcvs, but in this way changes between 0.4.1 and the
last are lost, please fix this !
* In this version I added support for reading
netgen meshes for tetraedra functions
readNetgenMesh(), saveNetgenSolution() (MM)
there is an usage example in testsuite/test_netgen
* You can do a 'grep -r meneghin .' to see some
changes that I applied, fixed some bugs. Do you agree about
strongerFlag(),weakerFlag() ?
On amd64 UInt and Index_t if = int are 4 bytes, if = size_t are 8 bytes
giving a cast problem in AZ_transform (MM)
* NOTE: if you have problems compiling try autoconf before (MM)
Bugs fixed in 0.4.1:
====================
[configure]
* Fixed umfpack check when umfpack is not installed (CP)
New in 0.5.0:
=============
[configure]
* Added support for boost which is mandatory now (CP)
[lifecore]
* Added the Cloning Factory pattern (aka Abstract Factory)
implementation (CP)
[lifefem]
* Added discontinuous finite element(discontinuous galerkin) (DADP)
* Sanitized/revamped the boundary conditions classes (CP)
** split BC classes into their own files
** improved documentation
** reduced code redundancy and code size
** use clone factory for BCFunction
** use clone factory for BCVector
** use boost::shared_ptr<> for safe memory management
[lifesolver]
* Templated the darcy classes.(VM)
** use of DataMesh class requires a change in data files
* Abstraction and interface for darcy Solver (CP, VM)
* Factorized and merged FSI::operFS (GF)
* Added NavierStokesWithFlux solver to impose fluxes (CV, CP)
[testsuite]
* Added test for 3D/0D coupling (AM)
* Moved files of test_darcy in lifesolver (VM, CP)
** hex and tet tests
** tensor and scalar diffusion tests
* Removed test_darcytetra (VM)
* oned solver can solve 2 coupled tubes (VM)
* Centralized all FSI tests in test_fsi (GF)
Bugs fixed in 0.4.0:
====================
[all]
......@@ -186,4 +169,4 @@ New in 0.1.0pre3:
* fixed some bugs and miscompilation in a few places
-- Christophe Prud'homme <prudhomm@debian.org>, Thu Oct 28 19:18:06 2004
-- Christophe Prud'homme <prudhomm@mit.edu>, Tue Oct 5 15:33:07 2004
# configure.in.bot
# This file is used for printing important messages at the end of configure
echo ""
if test x$boost_error = xyes; then
echo " ========================"
echo " === BOOST - ERROR =========================================================="
echo " ========================"
echo " ="
echo " = Boost is mandatory in LifeV, and it seems that it is not installed"
echo " = Did you provide the boost location with --with-boost=<> and eventually"
echo " = the boost version (default is 1.31) using --with-boost-version=<x.yz>"
echo " ="
echo " = Otherwise, consider installing it if you want to use LifeV"
echo " = http://www.boost.org"
echo " ="
fi
if test x$boost_signals_error = xyes -a x$boost_error = xno; then
echo " ========================"
echo " === BOOST SIGNALS LIBRARY - ERROR ========================================="
echo " ========================"
echo " ="
echo " = Boost::signals is mandatory in LifeV, and it seems that it is not installed"
echo " = or not properly configured however the boost:: libraries seem properly installed. "
echo " ="
echo " ="
fi
# -*- autoconf -*-
#
#
AC_INIT([lifev], [0.5.0], [lifev-dev@webmail.mate.polimi.it])
AC_INIT([lifev], [0.4.1], [lifev-dev@webmail.mate.polimi.it])
LIFEV_MAJOR_VERSION=0
LIFEV_MINOR_VERSION=5
LIFEV_MICRO_VERSION=0
LIFEV_MINOR_VERSION=4
LIFEV_MICRO_VERSION=1
LIFEV_EXTRA_VERSION=
AC_SUBST(LIFEV_MAJOR_VERSION)
AC_SUBST(LIFEV_MINOR_VERSION)
......@@ -95,9 +95,6 @@ else
fi
AC_CHECK_BOOST
AC_CHECK_BOOST_GRAPH
AC_CHECK_BOOST_SIGNALS
AC_CHECK_BOOST_TEST
dnl
......@@ -113,7 +110,6 @@ AM_CONDITIONAL(HAVE_UMFPACK, test "x$umfpack_libs" != "x" )
dnl lapack, blas, g2c
AC_CHECK_LAPACK
AC_CHECK_UMFPACK
AM_CONDITIONAL(HAVE_UMFPACK, test "x$umfpack_libs" != "x" )
dnl aztec
AC_CHECK_AZTEC
......@@ -138,7 +134,7 @@ CPPFLAGS="-DTHREEDIM ${CPPFLAGS}"
CXXFLAGS="-Wall ${CXXFLAGS}"
life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la \$(top_builddir)/life/lifesolver/liblifesolver.la \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"
life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"
#life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la \$(top_builddir)/life/lifesolver/liblifesolver.la \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"
......
%%
%% FSI
%%
@article{fernandez03:_newton_1,
AUTHOR = {Fern{\'a}ndez, M.A. and Moubachir, M.},
TITLE = {An exact block-{N}ewton algorithm for solving fluid-structure interaction problems},
JOURNAL = {C. R. Math. Acad. Sci. Paris},
VOLUME = 336,
YEAR = 2003,
NUMBER = 8,
PAGES = {681--686}
}
@article{fernandez03:_newton_2,
AUTHOR = {Fern{\'a}ndez, M.A. and Moubachir, M.},
TITLE = {{N}ewton methods using exact jacobians for solving fluid-structure coupling},
YEAR = 2003,
NOTE = {In preparation}
}
%%
%% NavierStokes
%%
@Article{gauthier03:_navier_stokes,
author = {A. Gauthier and F. Saleri and A. Veneziani},
title = {A fast preconditioner for the incompressible {N}avier-{S}tokes equations},
journal = {Computing and Visualization in Science (CVS)},
year = 2003,
note = {To appear. \url{http://www.lifev.org/documentation/GSV.ps.gz}},
annote = {}
}
%%
%% Computer Science
%%
@book{Stroustrup:2000,
author = {Bjarne Stroustrup},
title = {{The C++ Programming Language, Special Edition}},
publisher = {Addison-Wesley Verlag},
year = 2000,
address = {Boston},
isbn = {0-201-70073-5}
}
@Book{Saad:1992:NML,
author = "Y. Saad",
key = "Saad",
title = "Numerical Methods for Large Eigenvalue Problems",
publisher = "Halstead Press",
address = "New York",
year = "1992",
bibsource = "ftp://ftp.math.utah.edu/pub/bibnet/authors/s/saad-yousef.bib",
}
@Misc{02:_lifev_projec,
key = {lifev},
author = {L. Formaggia and M. Fernandez and A. Gauthier and J.F. Gerbeau and C. Prud'homme and Alessandro Veneziani},
......
......@@ -26,7 +26,7 @@
SUFFIXES = .cpp .hpp .idl .c .h .f .F .o .moc
SUBDIRS = lifecore lifearray lifemesh lifealg lifefem lifefilters lifesolver
SUBDIRS = lifecore lifearray lifemesh lifealg lifefem lifesolver lifefilters
apidox:
......
......@@ -29,25 +29,21 @@ if HAVE_PETSC
PETSC_SRCS = SolverPETSC.cpp
PETSC_HDRS = SolverPETSC.hpp
endif
if HAVE_UMFPACK
UMFPACK_SRCS = SolverUMFPACK.cpp
UMFPACK_HDRS = SolverUMFPACK.hpp
endif
BLASLAPACK = cblas.h clapack.h
include_HEADERS = $(BLASLAPACK) algebraic_facto.hpp dataAztec.hpp \
dataNewton.hpp inexactLU.hpp \
linesearch_cubic.hpp linesearch_parabolic.hpp newton.hpp \
picard.hpp saddlePointCG.hpp SolverAztec.hpp \
generalizedAitken.hpp nonLinRichardson.hpp \
$(PETSC_HDRS) $(UMFPACK_HDRS)
picard.hpp saddlePointCG.hpp vectorNorms.hpp SolverAztec.hpp \
generalizedAitken.hpp nonLinRichardson.hpp $(PETSC_HDRS)
lib_LTLIBRARIES = liblifealg.la
lib_LTLIBRARIES = liblifealg.la
liblifealg_la_SOURCES = dataAztec.cpp dataNewton.cpp SolverAztec.cpp $(PETSC_SRCS) $(UMFPACK_SRCS)
liblifealg_la_SOURCES = dataAztec.cpp dataNewton.cpp vectorNorms.cpp \
SolverAztec.cpp $(PETSC_SRCS)
liblifealg_la_LIBADD = ../lifecore/liblifecore.la ../lifearray/liblifearray.la $(petsc_libs) $(umfpack_libs) $(aztec_libs)
liblifealg_la_LIBADD = ../lifecore/liblifecore.la ../lifearray/liblifearray.la $(petsc_libs) $(aztec_libs)
include $(top_srcdir)/admin/Doxyfile.am
......@@ -20,7 +20,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
/**
\file SolverAztec.cpp
\author Christoph Winkelmann <christoph.winkelmann@epfl.ch>
......@@ -29,8 +29,6 @@
#include <iostream>
#include <fstream>
#include <boost/utility.hpp>
#include <SolverAztec.hpp>
class GetPot;
......@@ -54,10 +52,6 @@ SolverAztec::SolverAztec()
GetPot dataFile;
DataAztec dataAztec( dataFile, "aztec" );
dataAztec.aztecOptionsFromDataFile( M_options, M_params );
// use ilu by default
M_options[ AZ_precond ] = AZ_dom_decomp;
M_options[ AZ_subdomain_solve ] = AZ_ilu;
}
SolverAztec::~SolverAztec()
......@@ -79,7 +73,7 @@ SolverAztec* SolverAztec::New()
/*!
\brief Gets the last residual norm that has been computed.
\return last residual norm
*/
double SolverAztec::residualNorm() const
......@@ -87,16 +81,6 @@ double SolverAztec::residualNorm() const
return M_status[ AZ_r ];
}
int SolverAztec::iterations() const
{
return (int)M_status[ AZ_its ];
}
bool SolverAztec::converged() const
{
return M_status[ AZ_why ] == AZ_normal;
}
void SolverAztec::setMatrix( MSRMatr<value_type> const& newMatrix )
{
M_tempPattern.reset( 0 );
......@@ -150,16 +134,17 @@ void SolverAztec::F_setMatrix( MSRMatr<value_type> const& newMatrix )
void SolverAztec::solve( array_type& x, array_type const& b )
{
if ( M_matrix == 0 )
if ( M_matrix != 0 )
{
std::cerr << "[SolverAztec::solve] Solving primal" << std::endl;
AZ_iterate( &x[ 0 ], &b[ 0 ], M_options, M_params, M_status, M_procConfig,
M_matrix, M_precond, NULL );
}
else
{
std::ostringstream __ex;
__ex << "[SolverAztec::solve] ERROR: Matrix not set";
throw std::logic_error( __ex.str() );
std::cerr << "[SolverAztec::solve] ERROR: Matrix not set"
<< std::endl;
}
AZ_iterate( &x[ 0 ],
const_cast<double*>( &b[0] ),
M_options, M_params, M_status,
M_procConfig, M_matrix, M_precond, NULL );
}
void SolverAztec::setOptionsFromGetPot( GetPot const& dataFile,
......
......@@ -20,7 +20,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
/**
\file SolverAztec.hpp
\author Christoph Winkelmann <christoph.winkelmann@epfl.ch>
......@@ -40,7 +40,7 @@ namespace LifeV
/*!
\class SolverAztec
\brief wrap aztec linear solvers
@author Christoph Winkelmann
*/
class SolverAztec
......@@ -48,7 +48,7 @@ class SolverAztec
public:
/** @name Typedefs
*/
*/
//@{
typedef double value_type;
......@@ -59,7 +59,7 @@ public:
//@}
/** @name Constructors, destructor
*/
*/
//@{
//! default constructor
......@@ -74,19 +74,15 @@ public:
//@}
/** @name Accessors
*/
*/
//@{
double residualNorm() const;
int iterations() const;
bool converged() const;
//@}
/** @name Mutators
*/
*/
//@{
//! set matrix from MSRMatr
......@@ -117,7 +113,7 @@ public:
//@}
/** @name Methods
*/
*/
//@{
/*
......
......@@ -3,7 +3,6 @@
This file is part of the LifeV library
Author(s): Christophe Prud'homme <christophe.prudhomme@epfl.ch>
Christoph Winkelmann <christoph.winkelmann@epfl.ch>
Date: 2004-08-29
Copyright (C) 2004 EPFL
......@@ -21,22 +20,17 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
/**
\file SolverPETSC.hpp
\author Christophe Prud'homme <christophe.prudhomme@epfl.ch>
\author Christoph Winkelmann <christoph.winkelmann@epfl.ch>
\date 2004-08-29
*/
#include <lifeconfig.h>
#include <debug.hpp>
#include <vecUnknown.hpp>
#include <GetPot.hpp>
#include <singleton.hpp>
#include <SolverPETSC.hpp>
#include "GetPot.hpp"
#include "singleton.hpp"
namespace LifeV
{
......@@ -71,14 +65,13 @@ SolverPETSC::SolverPETSC( std::string const& __ksp_type,
:
_M_p ( new Private )
{
int ierr = KSPCreate( PETSC_COMM_WORLD, &_M_p->__ksp );
//CHKERRQ(ierr);
const PETSC & petsc = singleton<PETSC>::instance();
ierr = KSPGetPC( _M_p->__ksp, &_M_p->__pc );
//CHKERRQ(ierr);
int ierr = KSPCreate( PETSC_COMM_WORLD, &_M_p->__ksp ); //CHKERRQ(ierr);
ierr = KSPSetType( _M_p->__ksp, const_cast<char*> ( __ksp_type.c_str() ) );
//CHKERRQ(ierr);
ierr = KSPGetPC( _M_p->__ksp, &_M_p->__pc ); //CHKERRQ(ierr);
ierr = KSPSetType( _M_p->__ksp, const_cast<char*> ( __ksp_type.c_str() ) ); //CHKERRQ(ierr);
//! set the monitor type
switch ( __monitor )
......@@ -96,26 +89,20 @@ SolverPETSC::SolverPETSC( std::string const& __ksp_type,
// do nothing
break;
}
ierr = PCSetType( _M_p->__pc, const_cast<char*> ( __pc_type.c_str() ) );
//CHKERRQ(ierr);
ierr = PCSetType( _M_p->__pc, const_cast<char*> ( __pc_type.c_str() ) ); //CHKERRQ(ierr);
if ( __pc_type == "ilu" )
{
//ierr = PCILUSetLevels( _M_p->__pc, 2 );
//CHKERRQ(ierr);
//ierr = PCILUSetLevels( _M_p->__pc, 2 ); //CHKERRQ(ierr);
ierr = PCILUSetUseDropTolerance( _M_p->__pc, 1e-6, 0.1, 200 );
}
if ( __pc_type == "icc" )
{
ierr = PCICCSetLevels( _M_p->__pc, 2 );
//CHKERRQ(ierr);
ierr = PCICCSetLevels( _M_p->__pc, 2 ); //CHKERRQ(ierr);
}
ierr = KSPSetTolerances( _M_p->__ksp, _M_p->__tolerance,
PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT );
//CHKERRQ(ierr);
ierr = KSPSetTolerances( _M_p->__ksp, _M_p->__tolerance, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT ); //CHKERRQ(ierr);
ierr = KSPSetFromOptions( _M_p->__ksp );
//CHKERRQ(ierr);
ierr = KSPSetFromOptions( _M_p->__ksp ); //CHKERRQ(ierr);
}
SolverPETSC::~SolverPETSC()
......@@ -123,13 +110,11 @@ SolverPETSC::~SolverPETSC()
int __ierr;
if ( _M_p->_M_use_A )
{
__ierr = MatDestroy( _M_p->__A );
//CHKERRQ( __ierr );
__ierr = MatDestroy( _M_p->__A ); ////CHKERRQ( __ierr );
}
if ( _M_p->_M_use_A_t )
{
__ierr = MatDestroy( _M_p->__A_t );
//CHKERRQ( __ierr );
__ierr = MatDestroy( _M_p->__A_t ); ////CHKERRQ( __ierr );
}
}
......@@ -139,6 +124,11 @@ SolverPETSC::New()
return new SolverPETSC;
}
/*!
\brief Gets the last (approximate preconditioned) residual norm that has been computed.
\return last (approximate preconditioned) residual norm
*/
double
SolverPETSC::residualNorm() const
{
......@@ -147,49 +137,6 @@ SolverPETSC::residualNorm() const
return __residual;
}
double
SolverPETSC::condEst() const
{
double __value;
PetscTruth __computed;
PetscTruth __found;
PetscOptionsGetLogical( PETSC_NULL,
"-ksp_set_compute_singular_values",
&__computed, &__found );
if ( true ) //__computed )
{
PetscReal __emin;
PetscReal __emax;
KSPComputeExtremeSingularValues( _M_p->__ksp, &__emax, &__emin);
__value = __emax/__emin;
}
else
{
std::cerr << "Singular values have not been computed" << std::endl;
std::cerr
<< "add 'ksp_set_compute_singular_values = true' to your data file"
<< std::endl;
__value = std::numeric_limits<double>::signaling_NaN();
}
return __value;
}
int
SolverPETSC::iterations() const
{
int __iter;
KSPGetIterationNumber( _M_p->__ksp , &__iter );
return __iter;
}
bool
SolverPETSC::converged() const
{
KSPConvergedReason reason;
KSPGetConvergedReason( _M_p->__ksp, &reason );
return reason >= 0;
}
PC const& SolverPETSC::preconditioner() const
{
return _M_p->__pc;
......@@ -208,16 +155,29 @@ KSP & SolverPETSC::krylovSolver()
return _M_p->__ksp;
}
/*!
\brief Sets the relative, absolute, divergence, and maximum iteration tolerances
used by the default KSP convergence testers.
Use PETSC_DEFAULT to retain the default value of any of the tolerances.
See KSPDefaultConverged() for details on the use of these parameters in the default convergence test.
See also KSPSetConvergenceTest() for setting user-defined stopping criteria.
\arg rtol - the relative convergence tolerance (relative decrease in the residual norm)
\arg atol - the absolute convergence tolerance (absolute size of the residual norm)
\arg dtol - the divergence tolerance (amount residual can increase before KSPDefaultConverged() concludes that the method is diverging)
\arg maxits - maximum number of iterations to use
*/
void
SolverPETSC::setTolerances( double __rtol, double __atol, double __dtol,
int __maxits )
SolverPETSC::setTolerances( double __rtol, double __atol, double __dtol, int __maxits )
{
KSPSetTolerances( _M_p->__ksp, __rtol, __atol, __dtol, __maxits );
}
void
SolverPETSC::setMatrix( uint __nrows, const uint* __r, const uint *__i,
const double* __v )
SolverPETSC::setMatrix( uint __nrows, const uint* __r, const uint *__i, const double* __v )
{
MatCreateSeqAIJWithArrays( PETSC_COMM_SELF,
__nrows, __nrows,
......@@ -231,18 +191,16 @@ SolverPETSC::setMatrix( uint __nrows, const uint* __r, const uint *__i,
void SolverPETSC::setMatrix( const MSRMatr<value_type>& m )
{
_M_tempPattern.reset( new CSRPatt( *( m.Patt() ) ) );
_M_tempMatrix.reset( new CSRMatr<CSRPatt, value_type>
( *_M_tempPattern, m ));
setMatrix( _M_tempPattern->nRows(),
_M_tempPattern->giveRawCSR_ia(),
_M_tempPattern->giveRawCSR_ja(),
_M_tempMatrix->giveRawCSR_value() );