36 #include <Epetra_ConfigDefs.h> 39 #include <Epetra_MpiComm.h> 41 #include <Epetra_SerialComm.h> 45 #include <lifev/core/LifeV.hpp> 47 #include "lifev/core/util/VerifySolutions.hpp" 48 #include "lifev/core/array/MapEpetra.hpp" 49 #include "lifev/core/array/VectorEpetra.hpp" 56 using namespace LifeV;
77 int main (
int argc,
char** argv)
82 MPI_Init ( &argc, &argv );
84 std::cout <<
"MPI Initialization" << std::endl;
86 bool testSuccess (
true);
91 std::shared_ptr<Epetra_Comm> comm (
new Epetra_MpiComm ( MPI_COMM_WORLD ) );
93 std::shared_ptr<Epetra_Comm> comm (
new Epetra_SerialComm() );
98 Int numGlobalElements (100);
99 MapEpetra linearMap (numGlobalElements, 0, comm);
104 Int numLocalEntries (linearMap.map (Unique)->NumMyElements () );
106 Int* globalElements (linearMap.map (Unique)->MyGlobalElements () );
108 for (
int i (0); i < numLocalEntries; ++i)
110 globalIndex = globalElements[i];
120 Real referenceMeanNorm = 3.41795511063503;
121 Epetra_SerialDenseMatrix refM (3, 3);
122 refM (0, 0) = 27.5347957298817;
123 refM (0, 1) = -22.0349495350519;
124 refM (0, 2) = -5.49984619482986;
125 refM (1, 0) = -22.0349495350519;
126 refM (1, 1) = 27.7940200477885;
127 refM (1, 2) = -5.75907051273657;
128 refM (2, 0) = -5.49984619482986;
129 refM (2, 1) = -5.75907051273657;
130 refM (2, 2) = 11.2589167075664;
146 bool isMeanOk ( verify
.Check ( referenceMeanNorm
, tolerance
) );
147 bool isMatrixOk ( verify.Check ( refM, tolerance ) );
151 if (comm->MyPID() == 0)
158 testSuccess = isMeanOk && isMatrixOk;
166 std::cout <<
"MPI Finalization" << std::endl;
172 return ( EXIT_SUCCESS );
176 return ( EXIT_FAILURE );
VectorEpetra - The Epetra Vector format Wrapper.
bool setCoefficient(const UInt row, const data_type &value, UInt offset=0)
Look for the given global row and set its value.
int32_type Int
Generic integer data.
VectorEpetra(const MapEpetra &map, const MapEpetraType &mapType=Unique, const combineMode_Type combineMode=Add)
Constructor - Using Maps.
void updateInverseJacobian(const UInt &iQuadPt)
Epetra_Import const & importer()
Getter for the Epetra_Import.
void Print() const
Print Mean and Correlation matrix as c++ lines ready to be inserted into the test.
void ComputeCorrelation()
Compute the correlation matrix and norm of the mean.
void PushBack(VectorEpetra const &newVector)
Add a vector to the list of stored vectors.
int main(int argc, char **argv)
double Real
Generic real data.
This class helps the testsuites in verifying that the solutions do not change from one execution to t...
bool Check(Real referenceMean, Real tol) const
Checks that the current norm of the mean of the vectors is the same as the one provided by the user...