Commit f485e39c authored by grandper's avatar grandper
Browse files

Merge branch 'master' into 201305_NewNSSolver

parents 4c2e3405 73a3f562
......@@ -12,13 +12,13 @@ git remote add github git@github.com:lifev/lifev.git
1- update Version.cmake
2- update NEWS
2- update NEWS.md
3- commit Version.cmake and NEWS
3- commit Version.cmake and NEWS.md
X_Y_Z=3.4.2
git commit -m"Releasing ${X_Y_Z}" Version.cmake NEWS.md
git commit -m"Releasing ${X_Y_Z}" Version.cmake NEWS.md
4- tag master with the tag LifeV-X.Y.Z
......
LifeV 3.6.2:
============
Merged the following branches:
* 201211_ETA_OtherDimensions https://cmcsforge.epfl.ch/issues/75
* 201303_MultiscaleDependenciesFix https://cmcsforge.epfl.ch/issues/79
* 20121114_HDF5IO https://cmcsforge.epfl.ch/issues/16
* 201209_CurrentBoundaryFE https://cmcsforge.epfl.ch/issues/15
* 20130213_InstallScriptsUpdate https://cmcsforge.epfl.ch/issues/41
LifeV 3.6.1:
============
......
......@@ -28,12 +28,12 @@
# for release mode and set the version.
#
SET(LifeV_VERSION 3.6.1)
SET(LifeV_VERSION 3.6.2)
SET(LifeV_MAJOR_VERSION 3)
SET(LifeV_MINOR_VERSION 6)
SET(LifeV_MICRO_VERSION 1)
SET(LifeV_MAJOR_MINOR_VERSION 030601)
SET(LifeV_VERSION_STRING "3.6.1")
SET(LifeV_MICRO_VERSION 2)
SET(LifeV_MAJOR_MINOR_VERSION 030602)
SET(LifeV_VERSION_STRING "3.6.2")
SET(LifeV_ENABLE_DEVELOPMENT_MODE_DEFAULT ON) # Change to 'OFF' for a release
# Used by testing scripts and should not be used elsewhere
......
......@@ -736,7 +736,7 @@ void MatrixEpetra<DataType>::removeZeros()
{
if ( M_epetraCrs->Filled() )
{
Int meanNumEntries = this->getMeanNumEntries();
Int meanNumEntries = this->meanNumEntries();
matrix_ptrtype tmp ( M_epetraCrs );
M_epetraCrs.reset (new matrix_type ( Copy, M_epetraCrs->RowMap(), meanNumEntries ) );
......@@ -749,6 +749,11 @@ void MatrixEpetra<DataType>::removeZeros()
for ( Int i (0); i < tmp->NumGlobalRows(); ++i )
{
row = tmp->LRID ( i );
// Check if the row belong to this process
if (row == -1)
{
continue;
}
tmp->ExtractMyRowView ( row, NumEntries, Values, Indices );
std::vector<Int> Indices2 ( NumEntries );
......@@ -764,7 +769,7 @@ void MatrixEpetra<DataType>::removeZeros()
NumEntries2++;
}
}
M_epetraCrs->InsertGlobalValues ( row, NumEntries2, &Values2[0], &Indices2[0] );
M_epetraCrs->InsertGlobalValues ( i, NumEntries2, &Values2[0], &Indices2[0] );
}
insertZeroDiagonal();
M_epetraCrs->GlobalAssemble();
......
......@@ -215,7 +215,7 @@ void readMesh ( RegionMesh<GEOSHAPE, MC>& mesh, const MeshData& data )
{
BareMesh<GEOSHAPE> bareMesh;
MeshIO::ReadINRIAMeshFile ( bareMesh, data.meshDir() + data.meshFile(), 1, data.verbose() );
convertBareMesh ( bareMesh, mesh );
convertBareMesh ( bareMesh, mesh, data.verbose() );
// readINRIAMeshFile( mesh, data.meshDir() + data.meshFile(), 1, data.verbose() );
}
else if ( data.meshType() == ".m++" )
......
......@@ -2094,8 +2094,11 @@ bool buildEdges ( MeshType& mesh,
edge.setPoint ( kPointId, facePtr->point ( faceShape_Type::edgeToPoint ( jEdgeLocalId, kPointId ) ) );
}
// Get marker value inheriting from points
inheritPointsWeakerMarker ( edge );
// Get marker value inheriting from points if necessary
if ( edge.isMarkerUnset() )
{
inheritPointsWeakerMarker ( edge );
}
edge.setBoundary (true);
if (edgeExists)
{
......
......@@ -49,6 +49,7 @@ TRIBITS_ADD_LIBRARY(
)
TRIBITS_ADD_TEST_DIRECTORIES(tutorials)
TRIBITS_ADD_TEST_DIRECTORIES(testsuite)
#TRIBITS_ADD_EXAMPLE_DIRECTORIES(examples)
#
......
......@@ -10,6 +10,7 @@ SET(expression_HEADERS
expression/EvaluationHK.hpp
expression/EvaluationInterpolateGradient.hpp
expression/EvaluationInterpolateValue.hpp
expression/EvaluationMatrix.hpp
expression/EvaluationMeas.hpp
expression/EvaluationPhiI.hpp
expression/EvaluationPhiJ.hpp
......@@ -30,6 +31,7 @@ SET(expression_HEADERS
expression/ExpressionHK.hpp
expression/ExpressionInterpolateGradient.hpp
expression/ExpressionInterpolateValue.hpp
expression/ExpressionMatrix.hpp
expression/ExpressionMeas.hpp
expression/ExpressionPhiI.hpp
expression/ExpressionPhiJ.hpp
......@@ -47,6 +49,9 @@ SET(expression_HEADERS
CACHE INTERNAL "")
SET(expression_SOURCES ""
expression/EvaluationPhiI.cpp
expression/EvaluationPhiJ.cpp
expression/EvaluationScalar.cpp
expression/ExpressionDivI.cpp
expression/ExpressionDivJ.cpp
expression/ExpressionDphiI.cpp
......
......@@ -209,6 +209,141 @@ template<UInt spaceDim>
const flag_Type EvaluationDivI<3, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_NONE;
//! Evaluation of the basis function divergence in the case of a 2D vectorial FE.
/*!
@author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
This class aims at representing the divergence of a test function in the assembly.
This class is an Evaluation class, and therefore, has all the methods
required to work within the Evaluation trees.
*/
template <UInt spaceDim>
class EvaluationDivI<2, spaceDim>
{
public:
//! @name Public Types
//@{
//! Type of the values returned by this class
typedef Real return_Type;
//@}
//! @name Static constants
//@{
//! Flag for the global current FE
const static flag_Type S_globalUpdateFlag;
//! Flag for the test current FE
const static flag_Type S_testUpdateFlag;
//! Flag for the solution current FE
const static flag_Type S_solutionUpdateFlag;
//@}
//! @name Constructors, destructor
//@{
//! Empty constructor
EvaluationDivI() {}
//! Copy constructor
EvaluationDivI (const EvaluationDivI<2, spaceDim>& provider) : M_valuesPtr (provider.M_valuesPtr) {}
//! Expression-based constructor
explicit EvaluationDivI (const ExpressionDivI& /*expression*/) {}
//! Destructor
~EvaluationDivI() {}
//@}
//! @name Methods
//@{
//! Do nothing internal update
void update (const UInt& /*iElement*/) {}
//! Display method
static void display (std::ostream& out = std::cout)
{
out << "div_i";
}
//@}
//! @name Set Methods
//@{
//! Do nothing setter for the global current FE
template< typename CFEType >
void setGlobalCFE (const CFEType* /*globalCFE*/) {}
//! Setter for the test current FE
template< typename CFEType >
void setTestCFE (const CFEType* testCFE)
{
ASSERT (testCFE != 0, "Nul pointer to the testCFE cannot be set");
M_valuesPtr = & (testCFE->M_divergence);
}
//! Do nothing setter for the solution current FE
template< typename CFEType >
void setSolutionCFE (const CFEType* /*solutionCFE*/) {}
//! Do nothing setter for the quadrature rule
void setQuadrature (const QuadratureRule&) {}
//@}
//! @name Get Methods
//@{
//! Getter for the value for a vector
const return_Type& value_qi (const UInt& q, const UInt& i) const
{
ASSERT ( q < M_valuesPtr->size(), "Quadrature point index invalid");
ASSERT ( i < (*M_valuesPtr) [q].size(), "Dof index invalid");
return (*M_valuesPtr) [q][i];
}
//! Getter for the value for a matrix
const return_Type& value_qij (const UInt& q, const UInt& i, const UInt& /*j*/) const
{
ASSERT ( q < M_valuesPtr->size(), "Quadrature point index invalid");
ASSERT ( i < (*M_valuesPtr) [q].size(), "Dof index invalid");
return (*M_valuesPtr) [q][i];
}
//@}
private:
//! Storage of the pointer to the data
std::vector< std::vector < return_Type > > const* M_valuesPtr;
};
template<UInt spaceDim>
const flag_Type EvaluationDivI<2, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDivI<2, spaceDim>::S_testUpdateFlag = ET_UPDATE_DIVERGENCE;
template<UInt spaceDim>
const flag_Type EvaluationDivI<2, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_NONE;
} // Namespace ExpressionAssembly
} // Namespace LifeV
......
......@@ -200,6 +200,132 @@ template<UInt spaceDim>
const flag_Type EvaluationDivJ<3, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_DIVERGENCE;
//! Evaluation of the basis function div(phi_j) in the case of a 2D vectorial FE.
/*!
@author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
This class aims at representing the divergence of the solution in the assembly.
This class is an Evaluation class, and therefore, has all the methods
required to work within the Evaluation trees.
*/
template <UInt spaceDim>
class EvaluationDivJ<2, spaceDim>
{
public:
//! @name Public Types
//@{
//! The type of the values returned by this class
typedef Real return_Type;
//@}
//! @name Static constants
//@{
//! Flag for the global current FE
const static flag_Type S_globalUpdateFlag;
//! Flag for the test current FE
const static flag_Type S_testUpdateFlag;
//! Flag for the solution current FE
const static flag_Type S_solutionUpdateFlag;
//@}
//! @name Constructors, destructor
//@{
//! Empty constructor
EvaluationDivJ() {}
//! Copy constructor
EvaluationDivJ (const EvaluationDivJ& provider)
: M_valuesPtr (provider.M_valuesPtr)
{}
//! Expression-based constructor
explicit EvaluationDivJ (const ExpressionDivJ& /*expression*/) {}
//! Destructor
~EvaluationDivJ() {}
//@}
//! @name Methods
//@{
//! Do nothing internal update
void update (const UInt& /*iElement*/) {}
//! Display method
static void display ( std::ostream& out = std::cout)
{
out << "div_j";
}
//@}
//! @name Set Methods
//@{
//! Do nothing setter for the global current FE
template< typename CFEType >
void setGlobalCFE (const CFEType* /*globalCFE*/) {}
//! Do nothing setter for the test current FE
template< typename CFEType >
void setTestCFE (const CFEType* /*testCFE*/) {}
//! Setter for the solution current FE
template< typename CFEType >
void setSolutionCFE (const CFEType* solutionCFE)
{
M_valuesPtr = & (solutionCFE->M_divergence);
}
//! Do nothing setter for the quadrature rule
void setQuadrature (const QuadratureRule&) {}
//@}
//! @name Get Methods
//@{
//! Getter for the value for a matrix
const return_Type& value_qij (const UInt& q, const UInt& /*i*/, const UInt& j) const
{
return (*M_valuesPtr) [q][j];
}
//@}
private:
//! Pointer to the data
std::vector< std::vector < return_Type > > const* M_valuesPtr;
};
template<UInt spaceDim>
const flag_Type EvaluationDivJ<2, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDivJ<2, spaceDim>::S_testUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDivJ<2, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_DIVERGENCE;
} // Namespace ExpressionAssembly
} // Namespace LifeV
......
......@@ -62,8 +62,8 @@ namespace ExpressionAssembly
This class is an Evaluation class, and therefore, has all the methods
required to work within the Evaluation trees.
*/
template <UInt spaceDim>
class EvaluationDphiI<3, spaceDim>
template <UInt fieldDim, UInt spaceDim>
class EvaluationDphiI
{
public:
......@@ -71,7 +71,7 @@ public:
//@{
//! Type of the values returned by this class
typedef MatrixSmall<3, spaceDim> return_Type;
typedef MatrixSmall<fieldDim, spaceDim> return_Type;
//@}
......@@ -178,14 +178,14 @@ private:
};
template<UInt spaceDim>
const flag_Type EvaluationDphiI<3, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiI<fieldDim, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDphiI<3, spaceDim>::S_testUpdateFlag = ET_UPDATE_DPHI;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiI<fieldDim, spaceDim>::S_testUpdateFlag = ET_UPDATE_DPHI;
template<UInt spaceDim>
const flag_Type EvaluationDphiI<3, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_NONE;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiI<fieldDim, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_NONE;
//! Evaluation of the basis function dphi_i in the case of a scalar FE.
......
......@@ -63,8 +63,8 @@ namespace ExpressionAssembly
This class is an Evaluation class, and therefore, has all the methods
required to work within the Evaluation trees.
*/
template <UInt spaceDim>
class EvaluationDphiJ<3, spaceDim>
template <UInt fieldDim, UInt spaceDim>
class EvaluationDphiJ
{
public:
......@@ -72,7 +72,7 @@ public:
//@{
//! The type of the values returned by this class
typedef MatrixSmall<3, spaceDim> return_Type;
typedef MatrixSmall<fieldDim, spaceDim> return_Type;
//@}
......@@ -170,14 +170,14 @@ private:
};
template<UInt spaceDim>
const flag_Type EvaluationDphiJ<3, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiJ<fieldDim, spaceDim>::S_globalUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDphiJ<3, spaceDim>::S_testUpdateFlag = ET_UPDATE_NONE;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiJ<fieldDim, spaceDim>::S_testUpdateFlag = ET_UPDATE_NONE;
template<UInt spaceDim>
const flag_Type EvaluationDphiJ<3, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_DPHI;
template<UInt fieldDim, UInt spaceDim>
const flag_Type EvaluationDphiJ<fieldDim, spaceDim>::S_solutionUpdateFlag = ET_UPDATE_DPHI;
//! Evaluation of the basis function dphi_j in the case of a scalar FE.
......
......@@ -78,23 +78,136 @@ public:
//! @name Public Types
//@{
//! Type of the value returned by this class
typedef MatrixSmall<FieldDim, SpaceDim> return_Type;
//! Type of the FESpace to be used in this class
typedef ETFESpace<MeshType, MapType, SpaceDim, FieldDim> fespace_Type;
//! Type of the pointer on the FESpace
typedef boost::shared_ptr<fespace_Type> fespacePtr_Type;
//! Type of the vector to be used
typedef VectorEpetra vector_Type;
//@}
//! @name Static constants
//@{
//! Flag for the global current FE
const static flag_Type S_globalUpdateFlag;
//! Flag for the test current FE
const static flag_Type S_testUpdateFlag;
//! Flag for the solution current FE
const static flag_Type S_solutionUpdateFlag;
//@}
//! @name Constructors, destructor
//@{
//! Copy constructor
EvaluationInterpolateGradient (const EvaluationInterpolateGradient<MeshType, MapType, SpaceDim, FieldDim>& evaluation)
:
M_fespace ( evaluation.M_fespace),
M_vector ( evaluation.M_vector, Repeated),
M_quadrature (0),
M_currentFE (evaluation.M_currentFE),
M_interpolatedGradients (evaluation.M_interpolatedGradients)
{
if (evaluation.M_quadrature != 0)
{
M_quadrature = new QuadratureRule (* (evaluation.M_quadrature) );
}
}
//! Expression-based constructor
explicit EvaluationInterpolateGradient (const ExpressionInterpolateGradient<MeshType, MapType, SpaceDim, FieldDim>& expression)
:
M_fespace ( expression.fespace() ),
M_vector ( expression.vector(), Repeated ),
M_quadrature (0),
M_currentFE (M_fespace->refFE(), M_fespace->geoMap() ),
M_interpolatedGradients (0)
{}
//! Destructor
~EvaluationInterpolateGradient()
{
if (M_quadrature != 0)
{
delete M_quadrature;
}
}
//@}
//! @name Methods
//@{
//! Internal update: computes the interpolated gradients
void update (const UInt& iElement)
{
zero();
M_currentFE.update (M_fespace->mesh()->element (iElement), ET_UPDATE_DPHI);
for (UInt i (0); i < M_fespace->refFE().nbDof(); ++i)
{
for (UInt q (0); q < M_quadrature->nbQuadPt(); ++q)
{
for (UInt iDim (0); iDim < SpaceDim; ++iDim)
{
for (UInt jDim (0); jDim < FieldDim; ++jDim)
{
UInt globalID (M_fespace->dof().localToGlobalMap (iElement, i)
+ jDim * M_fespace->dof().numTotalDof() );
M_interpolatedGradients[q][jDim][iDim] +=
M_currentFE.dphi (jDim * M_currentFE.nbFEDof() + i, jDim, iDim, q)
* M_vector[globalID];
}
}
}
}
}
//! Erase the interpolated gradients stored internally
void zero()
{
for (UInt q (0); q < M_quadrature->nbQuadPt(); ++q)