Commit fd70f68b authored by simone's avatar simone
Browse files

Merging from lifev-parallel

parent b39c007d
......@@ -79,6 +79,7 @@ $(top_srcdir)/acinclude.m4:
@echo 'm4_include([admin/ltversion.m4])' >> acinclude.m4
@echo 'm4_include([admin/ltoptions.m4])' >> acinclude.m4
@echo 'm4_include([admin/ltsugar.m4])' >> acinclude.m4
@echo 'm4_include([admin/ac_check_hdf5.m4])' >> acinclude.m4
@echo 'm4_include([admin/ac_check_trilinos.m4])' >> acinclude.m4
@echo 'm4_include([admin/ac_check_boost.m4])' >> acinclude.m4
@echo 'm4_include([admin/ac_check_itk.m4])' >> acinclude.m4
......
......@@ -2,19 +2,19 @@
# DO NOT EDIT : generated automatically by update-headers
#
LIFECORE_HDRS=life/lifecore/GetPot.hpp life/lifecore/SmartAssert.hpp life/lifecore/about.hpp life/lifecore/application.hpp life/lifecore/chrono.hpp life/lifecore/dataString.hpp life/lifecore/debug.hpp life/lifecore/factory.hpp life/lifecore/fortran_wrap.hpp life/lifecore/life.hpp life/lifecore/lifeassert.hpp life/lifecore/lifemacros.hpp life/lifecore/lifeversion.hpp life/lifecore/policy.hpp life/lifecore/singleton.hpp life/lifecore/switch.hpp life/lifecore/typeInfo.hpp life/lifecore/util_string.hpp
LIFECORE_HDRS=
LIFEARRAY_HDRS=life/lifearray/CSRMatrix.hpp life/lifearray/EpetraMatrix.hpp life/lifearray/EpetraVector.hpp life/lifearray/MSRMatrix.hpp life/lifearray/MixedMatrix.hpp life/lifearray/RNM.hpp life/lifearray/RNM_op.hpp life/lifearray/RNM_opc.hpp life/lifearray/RNM_tpl.hpp life/lifearray/SimpleVect.hpp life/lifearray/VBRMatrix.hpp life/lifearray/blockMatrix.hpp life/lifearray/boostmatrix.hpp life/lifearray/connectivity.hpp life/lifearray/elemMat.hpp life/lifearray/elemVec.hpp life/lifearray/pattern.hpp life/lifearray/sparseArray.hpp life/lifearray/tab.hpp life/lifearray/tridiagMatrix.hpp life/lifearray/variables.hpp life/lifearray/vecUnknown.hpp
LIFEARRAY_HDRS=
LIFEALG_HDRS=life/lifealg/EpetraMap.hpp life/lifealg/EpetraPreconditioner.hpp life/lifealg/PressureMatrixSolver.hpp life/lifealg/SolverAztec.hpp life/lifealg/SolverBase.hpp life/lifealg/SolverPETSC.hpp life/lifealg/SolverTrilinos.hpp life/lifealg/SolverUMFPACK.hpp life/lifealg/algebraic_facto.hpp life/lifealg/cblas.hpp life/lifealg/clapack.hpp life/lifealg/dataAztec.hpp life/lifealg/dataNewton.hpp life/lifealg/generalizedAitken.hpp life/lifealg/givens.hpp life/lifealg/gmres.hpp life/lifealg/inexactLU.hpp life/lifealg/iteration.hpp life/lifealg/linesearch_cubic.hpp life/lifealg/linesearch_parabolic.hpp life/lifealg/newton.hpp life/lifealg/nonLinRichardson.hpp life/lifealg/picard.hpp life/lifealg/preconditioner.hpp life/lifealg/saddlePointCG.hpp
LIFEALG_HDRS=
LIFEMESH_HDRS=life/lifemesh/bareItems.hpp life/lifemesh/basisElSh.hpp life/lifemesh/dataMesh.hpp life/lifemesh/geo0D.hpp life/lifemesh/geoElement.hpp life/lifemesh/geoND.hpp life/lifemesh/identifier.hpp life/lifemesh/markers.hpp life/lifemesh/markers_base.hpp life/lifemesh/meshEntity.hpp life/lifemesh/mesh_util_base.hpp life/lifemesh/partitionMesh.hpp life/lifemesh/regionMesh2D.hpp life/lifemesh/regionMesh3D.hpp life/lifemesh/subDomainNeighbors.hpp
LIFEMESH_HDRS=
LIFEFEM_HDRS=life/lifefem/FESpace.hpp life/lifefem/Operator01.hpp life/lifefem/assemb.hpp life/lifefem/assembGeneric.hpp life/lifefem/bcCond.hpp life/lifefem/bcFunction.hpp life/lifefem/bcHandler.hpp life/lifefem/bcManage.hpp life/lifefem/bcVector.hpp life/lifefem/bdf.hpp life/lifefem/bdfNS.hpp life/lifefem/bdfNS_template.hpp life/lifefem/bdf_template.hpp life/lifefem/currentBFDG.hpp life/lifefem/currentBdDG.hpp life/lifefem/currentBdFE.hpp life/lifefem/currentFE.hpp life/lifefem/currentFEDG.hpp life/lifefem/currentHdivFE.hpp life/lifefem/currentIFDG.hpp life/lifefem/dataTime.hpp life/lifefem/dataTransient.hpp life/lifefem/dof.hpp life/lifefem/dofByFace.hpp life/lifefem/dofDG.hpp life/lifefem/dofInterface3Dto2D.hpp life/lifefem/dofInterface3Dto3D.hpp life/lifefem/dofInterfaceBase.hpp life/lifefem/dofInterfaceHandler.hpp life/lifefem/elemOper.hpp life/lifefem/elemOper2Fluids.hpp life/lifefem/elemOper_ext.hpp life/lifefem/geoMap.hpp life/lifefem/geoMapDG.hpp life/lifefem/interpolate.hpp life/lifefem/localDofPattern.hpp life/lifefem/meshMotion.hpp life/lifefem/postProc.hpp life/lifefem/quadRule.hpp life/lifefem/refEle.hpp life/lifefem/refEleDG.hpp life/lifefem/refFE.hpp life/lifefem/refFEDG.hpp life/lifefem/refHdivFE.hpp life/lifefem/refHybridFE.hpp life/lifefem/regionMesh3D_ALE.hpp life/lifefem/sobolevNorms.hpp life/lifefem/staticBdFE.hpp life/lifefem/subelements.hpp life/lifefem/v2elemVec.hpp life/lifefem/values.hpp
LIFEFEM_HDRS=
LIFESOLVER_HDRS=life/lifesolver/AFSolvers.hpp life/lifesolver/ElasticStructureHandler.hpp life/lifesolver/FSIOperator.hpp life/lifesolver/FSISolver.hpp life/lifesolver/HarmonicExtensionSolver.hpp life/lifesolver/HyperbolicSolverIP.hpp life/lifesolver/LevelSetSolver.hpp life/lifesolver/LevelSetSolverUtils.hpp life/lifesolver/NSSolver2FluidsMixed.hpp life/lifesolver/NavierStokesAleHandler.hpp life/lifesolver/NavierStokesAleSolver.hpp life/lifesolver/NavierStokesAleSolverCT.hpp life/lifesolver/NavierStokesAleSolverPC.hpp life/lifesolver/NavierStokesHandler.hpp life/lifesolver/NavierStokesSolver.hpp life/lifesolver/NavierStokesSolverPC.hpp life/lifesolver/NavierStokesWithFlux.hpp life/lifesolver/Oseen.hpp life/lifesolver/VenantKirchhofSolver.hpp life/lifesolver/convDiffReactHandler.hpp life/lifesolver/convDiffReactSolverPC.hpp life/lifesolver/darcyHandler.hpp life/lifesolver/darcySolver.hpp life/lifesolver/darcySolverBase.hpp life/lifesolver/dataConvDiffReact.hpp life/lifesolver/dataDarcy.hpp life/lifesolver/dataElasticStructure.hpp life/lifesolver/dataNS2Fluids.hpp life/lifesolver/dataNavierStokes.hpp life/lifesolver/dataSimplifiedStructure.hpp life/lifesolver/exactJacobianBase.hpp life/lifesolver/fixedPointBase.hpp life/lifesolver/fluidToMaster.hpp life/lifesolver/ipStabilization.hpp life/lifesolver/nsip.hpp life/lifesolver/nsipterms.hpp life/lifesolver/parabolicSolver.hpp life/lifesolver/reducedLinFluid.hpp life/lifesolver/sdStabilization.hpp life/lifesolver/simplifiedStructure.hpp life/lifesolver/steklovPoincareBase.hpp life/lifesolver/timeSolver.hpp life/lifesolver/OseenShapeDerivative.hpp
LIFESOLVER_HDRS=
LIFEFILTERS_HDRS=life/lifefilters/ensight.hpp life/lifefilters/ensight7Writer.hpp life/lifefilters/gmsh_wrtrs.hpp life/lifefilters/gmv_wrtrs.hpp life/lifefilters/importer.hpp life/lifefilters/medit.hpp life/lifefilters/medit_wrtrs.hpp life/lifefilters/mesh_util.hpp life/lifefilters/openDX_wrtrs.hpp life/lifefilters/postProc.hpp life/lifefilters/readMesh2D.hpp life/lifefilters/readMesh3D.hpp life/lifefilters/selectMarker.hpp life/lifefilters/vtk_wrtrs.hpp life/lifefilters/exporter.hpp
LIFEFILTERS_HDRS=
nobase_include_HEADERS=lifeconfig.h\
$(LIFECORE_HDRS)\
......
......@@ -103,6 +103,9 @@ AC_CHECK_LAPACK
dnl AC_CHECK_UMFPACK
dnl AM_CONDITIONAL(HAVE_UMFPACK, test "x$umfpack_libs" != "x" )
dnl hdf5
AC_CHECK_HDF5
dnl trilinos
AC_CHECK_TRILINOS
dnl petsc
......
......@@ -8,13 +8,16 @@
/** \file EpetraMap.cpp
*/
#include "EpetraMap.hpp"
#include <life/lifealg/EpetraMap.hpp>
#include <Epetra_Util.h>
namespace LifeV
{
EpetraMap::EpetraMap():
M_epetraMap(0),
M_uniqueEpetraMap(0)
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{}
......@@ -24,8 +27,10 @@ EpetraMap::EpetraMap(int NumGlobalElements,
int* MyGlobalElements,
int IndexBase,
const Epetra_Comm& Comm):
M_epetraMap(0),
M_uniqueEpetraMap(0)
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{
createMap( NumGlobalElements,
NumMyElements,
......@@ -34,10 +39,60 @@ EpetraMap::EpetraMap(int NumGlobalElements,
Comm);
}
EpetraMap::~EpetraMap()
EpetraMap::map_ptrtype const &
EpetraMap::getMap( EpetraMapType maptype) const
{
delete M_epetraMap;
delete M_uniqueEpetraMap;
switch (maptype)
{
case Unique:
return getUniqueMap();
case Repeated:
return getRepeatedMap();
}
return getUniqueMap();
}
EpetraMap::map_type
EpetraMap::getRootMap( int root) const
{
return Epetra_Util::Create_Root_Map(*getUniqueMap(), root);
}
/*! Builds a submap of map _epetraMap with a given positive offset and
the maximum id to consider (in the new count)
eg: offset = 2, maxid = 6;
_epetraMap = [ 0 2 5 7 8 10 1]
this = [ 0 3 5 ]
*/
EpetraMap::EpetraMap(const Epetra_BlockMap& _blockMap, const int offset, const int maxid )
:
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{
std::vector<int> MyGlobalElements;
int* sourceGlobalElements(_blockMap.MyGlobalElements());
int const maxIdOrig(maxid + offset);
const int maxMyElements = std::min(maxid, _blockMap.NumMyElements());
MyGlobalElements.reserve(maxMyElements);
// We consider that the source Map may not be ordered
for (int i(0); i < _blockMap.NumMyElements(); ++i)
if (sourceGlobalElements[i] < maxIdOrig && sourceGlobalElements[i] >= offset)
MyGlobalElements.push_back(sourceGlobalElements[i] - offset);
createMap( -1,
MyGlobalElements.size(),
&MyGlobalElements.front(),
_blockMap.IndexBase(),
_blockMap.Comm() );
}
......@@ -47,19 +102,10 @@ EpetraMap::operator = (const EpetraMap& _epetraMap)
if (this != &_epetraMap)
{
if (!_epetraMap.getEpetra_Map() == 0)
{
if (M_epetraMap != 0)
{
*M_epetraMap = *_epetraMap.getEpetra_Map();
*M_uniqueEpetraMap = *_epetraMap.getUniqueEpetra_Map();
}
else
{
M_epetraMap = new Epetra_Map(*_epetraMap.getEpetra_Map());
M_uniqueEpetraMap = new Epetra_Map(*_epetraMap.getUniqueEpetra_Map());
}
}
M_repeatedEpetra_Map = _epetraMap.M_repeatedEpetra_Map;
M_uniqueEpetraMap = _epetraMap.M_uniqueEpetraMap;
M_exporter = _epetraMap.M_exporter;
M_importer = _epetraMap.M_importer;
}
return *this;
......@@ -69,67 +115,67 @@ EpetraMap::operator = (const EpetraMap& _epetraMap)
EpetraMap &
EpetraMap::operator += (const EpetraMap& _epetraMap)
{
if (this->getEpetra_Map() == 0)
if (! _epetraMap.getUniqueMap())
return *this;
if (! this->getUniqueMap())
{
this->operator = (_epetraMap);
return *this;
}
if (_epetraMap.getEpetra_Map() == 0)
return *this;
int* pointer;
std::vector<int> map;
pointer = M_epetraMap->MyGlobalElements();
for (int ii = 0; ii < M_epetraMap->NumMyElements(); ++ii, ++pointer)
pointer = getRepeatedMap()->MyGlobalElements();
for (int ii = 0; ii < getRepeatedMap()->NumMyElements(); ++ii, ++pointer)
{
map.push_back(*pointer);
}
int numGlobalElements = getUniqueEpetra_Map()->NumGlobalElements();
int numGlobalElements = getUniqueMap()->NumGlobalElements();
// std::cout << "NumGlobalElements = " << numGlobalElements << std::endl;
pointer = _epetraMap.getEpetra_Map()->MyGlobalElements();
for (int ii = 0; ii < _epetraMap.getEpetra_Map()->NumMyElements(); ++ii, ++pointer)
pointer = _epetraMap.getRepeatedMap()->MyGlobalElements();
for (int ii = 0; ii < _epetraMap.getRepeatedMap()->NumMyElements(); ++ii, ++pointer)
{
// std::cout << "pointer = " << *pointer << std::endl;
map.push_back(*pointer + numGlobalElements);
}
int IndexBase = M_epetraMap->IndexBase();
delete M_epetraMap;
int IndexBase = getRepeatedMap()->IndexBase();
M_epetraMap = new Epetra_Map(-1, map.size(), &map[0], IndexBase, _epetraMap.getEpetra_Map()->Comm());
M_repeatedEpetra_Map.reset( new Epetra_Map(-1, map.size(), &map[0], IndexBase, _epetraMap.getRepeatedMap()->Comm()) );
map.resize(0);
pointer = M_uniqueEpetraMap->MyGlobalElements();
pointer = getUniqueMap()->MyGlobalElements();
for (int ii = 0; ii < M_uniqueEpetraMap->NumMyElements(); ++ii, ++pointer)
for (int ii = 0; ii < getUniqueMap()->NumMyElements(); ++ii, ++pointer)
{
map.push_back(*pointer);
}
pointer = _epetraMap.getUniqueEpetra_Map()->MyGlobalElements();
for (int ii = 0; ii < _epetraMap.getUniqueEpetra_Map()->NumMyElements(); ++ii, ++pointer)
pointer = _epetraMap.getUniqueMap()->MyGlobalElements();
for (int ii = 0; ii < _epetraMap.getUniqueMap()->NumMyElements(); ++ii, ++pointer)
{
map.push_back(*pointer + numGlobalElements);
}
delete M_uniqueEpetraMap;
M_uniqueEpetraMap.reset( new Epetra_Map(-1, map.size(), &map[0], IndexBase, _epetraMap.getRepeatedMap()->Comm()) );
M_uniqueEpetraMap = new Epetra_Map(-1, map.size(), &map[0], IndexBase, _epetraMap.getEpetra_Map()->Comm());
// uniqueMap();
M_exporter.reset();
M_importer.reset();
return *this;
}
EpetraMap::EpetraMap(const EpetraMap& _epetraMap):
M_epetraMap (0),
M_uniqueEpetraMap(0)
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{
this->operator=(_epetraMap);
}
......@@ -142,14 +188,11 @@ EpetraMap::createMap(int NumGlobalElements,
int IndexBase,
const Epetra_Comm &Comm)
{
delete M_epetraMap;
delete M_uniqueEpetraMap;
M_epetraMap = new Epetra_Map(NumGlobalElements,
NumMyElements,
MyGlobalElements,
IndexBase,
Comm);
M_repeatedEpetra_Map.reset( new Epetra_Map(NumGlobalElements,
NumMyElements,
MyGlobalElements,
IndexBase,
Comm) );
uniqueMap();
}
......@@ -157,17 +200,23 @@ EpetraMap::createMap(int NumGlobalElements,
void
EpetraMap::uniqueMap()
{
int MyPID ( M_epetraMap->Comm().MyPID() );
int NumIDs ( M_epetraMap->NumMyElements() );
int indexBase( M_epetraMap->MinAllGID() );
M_uniqueEpetraMap.reset( new Epetra_Map( Epetra_Util::Create_OneToOne_Map (*getRepeatedMap(), false) ) );
M_exporter.reset();
M_importer.reset();
return;
int MyPID ( getRepeatedMap()->Comm().MyPID() );
int NumIDs ( getRepeatedMap()->NumMyElements() );
int indexBase( getRepeatedMap()->MinAllGID() );
Epetra_IntSerialDenseVector GIDList (NumIDs);
M_epetraMap->MyGlobalElements(GIDList.Values());
getRepeatedMap()->MyGlobalElements(GIDList.Values());
Epetra_IntSerialDenseVector PIDList (NumIDs);
Epetra_IntSerialDenseVector LIDList (NumIDs);
M_epetraMap->RemoteIDList(NumIDs, GIDList.Values(), PIDList.Values(), LIDList.Values());
getRepeatedMap()->RemoteIDList(NumIDs, GIDList.Values(), PIDList.Values(), LIDList.Values());
// now use LIDList has a helping pointer
......@@ -181,12 +230,14 @@ EpetraMap::uniqueMap()
bubbleSort(LIDList);
delete M_uniqueEpetraMap;
M_uniqueEpetraMap = new Epetra_Map(-1,
LIDList.Length(),
LIDList.Values(),
indexBase,
M_epetraMap->Comm());
M_uniqueEpetraMap.reset( new Epetra_Map(-1,
LIDList.Length(),
LIDList.Values(),
indexBase,
getRepeatedMap()->Comm()) );
M_exporter.reset();
M_importer.reset();
}
......@@ -243,6 +294,61 @@ EpetraMap::setUp(const RefFE& refFE,
EpetraMap repeatedElemMap(-1, numElem, &repeatedElemVector[0], indexBase, _comm);
operator+=(repeatedElemMap);
}
createImportExport();
}
Epetra_Export const&
EpetraMap::getExporter()
{
createImportExport();
return **M_exporter;
}
Epetra_Import const&
EpetraMap::getImporter()
{
createImportExport();
return **M_importer;
}
void
EpetraMap::createImportExport()
{
if ( !getRepeatedMap() || !getUniqueMap() ) return;
// The exporter is needed to import to a repeated vector
if ( M_exporter.get() == 0 )
M_exporter.reset( new boost::shared_ptr<Epetra_Export> );
if ( M_exporter->get() == 0 )
M_exporter->reset( new Epetra_Export(*getRepeatedMap(), *getUniqueMap()) );
if ( M_importer.get() == 0 )
M_importer.reset( new boost::shared_ptr<Epetra_Import> );
if ( M_importer->get() == 0 )
M_importer->reset( new Epetra_Import(*getRepeatedMap(), *getUniqueMap()) );
}
bool
EpetraMap::MapsAreSimilar( EpetraMap const& _epetraMap) const
{
if ( this == &_epetraMap )
return true;
return( getUniqueMap()->SameAs( *_epetraMap.getUniqueMap()) &&
getRepeatedMap()->SameAs( *_epetraMap.getRepeatedMap()) );
}
} // end namespace LifeV
......@@ -3,9 +3,10 @@
This file is part of the LifeV library
Author(s): Gilles Fourestey gilles.fourestey@epfl.ch
Date: 2004-10-26
Simone Deparis simone.deparis@epfl.ch
Date: 2006-10-26
Copyright (C) 2004 EPFL
Copyright (C) 2006 EPFL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -30,12 +31,17 @@
#ifndef _EPETRAMAP_
#define _EPETRAMAP_
#include <boost/shared_ptr.hpp>
#include <life/lifefem/refFE.hpp>
#include "Epetra_Map.h"
#include "Epetra_Comm.h"
#include "life/lifecore/life.hpp"
#include "life/lifemesh/partitionMesh.hpp"
#include <Epetra_Map.h>
#include <Epetra_Export.h>
#include <Epetra_Import.h>
#include <Epetra_Comm.h>
#include <life/lifecore/life.hpp>
#include <life/lifemesh/partitionMesh.hpp>
......@@ -47,11 +53,22 @@ namespace LifeV
//
///////////////////////////////////////////////////////////////
enum EpetraMapType {Unique = 0, Repeated};
class EpetraMap
{
public:
/** @name Typedefs
*/
//@{
typedef Epetra_Map map_type;
typedef boost::shared_ptr<map_type> map_ptrtype;
typedef boost::shared_ptr< boost::shared_ptr<Epetra_Export> > exporter_ptrtype;
typedef boost::shared_ptr< boost::shared_ptr<Epetra_Import> > importer_ptrtype;
//@}
EpetraMap();
EpetraMap(int NumGlobalElements,
int NumMyElements,
......@@ -59,54 +76,79 @@ public:
int IndexBase,
const Epetra_Comm& Comm);
// Calls createImportExport from setUp()
template<typename Mesh>
EpetraMap(const RefFE& refFE,
const partitionMesh<Mesh>& meshPart,
Epetra_Comm& _comm);
// Calls createImportExport from setUp()
template<typename Mesh>
EpetraMap(const RefFE& refFE,
const Mesh& mesh,
Epetra_Comm& _comm);
EpetraMap(const EpetraMap& _epetraMap);
~EpetraMap();
/*! Builds a submap of map _epetraMap with a given positive offset and
the maximum id to consider
*/
EpetraMap(const Epetra_BlockMap& _blockMap, const int offset, const int maxid );
~EpetraMap() {}
// The copy operator will copy the pointers of the maps, exporter and importer
EpetraMap& operator = (const EpetraMap& _epetraMap);
EpetraMap& operator += (const EpetraMap& _epetraMap);
EpetraMap operator + (const EpetraMap& _epetraMap)
{
EpetraMap map( *this );
return map += _epetraMap;
map += _epetraMap;
createImportExport();
return map;
}
Epetra_Map const * getEpetra_Map() const
{return M_epetraMap;}
Epetra_Map const * getRepeatedEpetra_Map() const
{return M_epetraMap;}
Epetra_Map const * getUniqueEpetra_Map() const
{return M_uniqueEpetraMap;}
Epetra_Comm const& Comm() const { return M_uniqueEpetraMap->Comm(); }
// Epetra_Map* getEpetra_Map(){return M_epetraMap;}
// Epetra_Map* getRepeatedEpetra_Map(){return M_repeatedEpetra_Map;}
// createMap does not call createImportExport
void createMap(int NumGlobalElements,
int NumMyElements,
int* MyGlobalElements,
int IndexBase,
const Epetra_Comm &Comm) ;
map_ptrtype const & getMap( EpetraMapType maptype) const;
map_type getRootMap( int root) const;
Epetra_Export const& getExporter();
Epetra_Import const& getImporter();
bool MapsAreSimilar( EpetraMap const& _epetraMap) const;
// EpetraMap& uniqueMap();
private:
void uniqueMap();
void bubbleSort(Epetra_IntSerialDenseVector& Elements);
/*
Epetra_Map const * getRepeatedEpetra_Map() const
{return M_repeatedEpetra_Map;}
Epetra_Map const * getUniqueEpetra_Map() const
{return M_uniqueEpetraMap;}
*/
map_ptrtype const & getRepeatedMap() const { return M_repeatedEpetra_Map; }
map_ptrtype const & getUniqueMap() const { return M_uniqueEpetraMap; }
void uniqueMap();
void createImportExport();
void bubbleSort(Epetra_IntSerialDenseVector& Elements);
// Calls createImportExport
void setUp(const RefFE& refFE,
Epetra_Comm& _comm,
std::vector<int>& repeatedNodeVector,
......@@ -114,8 +156,11 @@ private:
std::vector<int>& repeatedFaceVector,
std::vector<int>& repeatedElemVector);
Epetra_Map* M_epetraMap;
Epetra_Map* M_uniqueEpetraMap;
map_ptrtype M_repeatedEpetra_Map;
map_ptrtype M_uniqueEpetraMap;
exporter_ptrtype M_exporter;
importer_ptrtype M_importer;
};
......@@ -124,8 +169,10 @@ EpetraMap::
EpetraMap(const RefFE& refFE,
const partitionMesh<Mesh>& meshPart,
Epetra_Comm& _comm):
M_epetraMap(0),
M_uniqueEpetraMap(0)
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{
// Epetra_Map is "badly" coded, in fact its constructor needs a non-constant pointer to indices, but it
......@@ -146,8 +193,10 @@ EpetraMap::
EpetraMap(const RefFE& refFE,
const Mesh& mesh,
Epetra_Comm& _comm):
M_epetraMap(0),
M_uniqueEpetraMap(0)
M_repeatedEpetra_Map(),
M_uniqueEpetraMap(),
M_exporter(),
M_importer()
{
std::vector<int> repeatedNodeVector;
......
......@@ -53,15 +53,20 @@ void Preconditioner::setDataFromGetPot( const GetPot& dataFile, const std::strin
{
M_precType = dataFile((section + "/prectype").data(),"Amesos");
M_overlapLevel = dataFile((section + "/overlap").data(), 5);
double dropTolerance = dataFile((section + "/droptol").data(), 1e-5);
int levelOfFill = dataFile((section + "/fill").data(), 1);
int localParts = dataFile((section + "/localparts").data(), 4);
M_overlapLevel = dataFile((section + "/overlap").data(), 4);
double dropTolerance = dataFile((section + "/droptol").data(), 1e-5);
double levelOfFill = dataFile((section + "/fill").data(), 4.);
double athr = dataFile((section + "/athr").data(), 0.);
double rthr = dataFile((section + "/rthr").data(), 1.);
//double relax_value = dataFile((section + "/relax_value").data(), 0.);
//int localParts = dataFile((section + "/localparts").data(), 4);
M_List.set("fact: drop tolerance", dropTolerance);
M_List.set("fact: level-of-fill", levelOfFill);
M_List.set("partitioner: local parts", localParts);
M_List.set("partitioner: overlap", M_overlapLevel);
M_List.set("fact: ilut level-of-fill", levelOfFill);
M_List.set("fact: absolute threshold", athr);
M_List.set("fact: relative threshold", rthr);
//M_List.set("fact: level-of-fill", levelOfFill);
//M_List.set("fact: relax value", relax_value);
}
......@@ -70,6 +75,7 @@ int Preconditioner::buildPreconditioner(operator_type& oper)
M_Oper = oper;
//List.set("schwarz: combine mode", "Zero"); //
M_List.set("schwarz: filter singletons", true);
// List.set("amesos: solver type", "Amesos_Lapack");
......
......@@ -33,14 +33,15 @@
#include <boost/shared_ptr.hpp>
#include "Ifpack_config.h"
#include "Ifpack.h"