39 #include <Epetra_ConfigDefs.h> 42 #include <Epetra_MpiComm.h> 44 #include <Epetra_SerialComm.h> 48 #include <lifev/core/LifeV.hpp> 50 #include <lifev/core/fem/CurrentFE.hpp> 52 using namespace LifeV;
55 main (
int argc,
char** argv )
58 std::shared_ptr<Epetra_Comm> comm;
61 std::cout <<
"MPI Initialization" << std::endl;
62 MPI_Init ( &argc, &argv );
71 MPI_Comm_size ( MPI_COMM_WORLD, &nprocs );
72 MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
76 std::cout <<
"MPI processes: " << nprocs << std::endl;
77 std::cout <<
"MPI Epetra Initialization ... " << std::endl;
79 comm.reset (
new Epetra_MpiComm ( MPI_COMM_WORLD ) );
85 std::cout <<
"MPI SERIAL Epetra Initialization ... " << std::endl;
86 comm.reset (
new Epetra_SerialComm() );
93 Real test_tolerance (1e-10);
96 std::vector<Real> P0 (3);
100 std::vector<Real> P1 (3);
104 std::vector<Real> P2 (3);
108 std::vector<Real> P3 (3);
113 std::vector< std::vector< Real > > Tetra1 (4);
121 std::cout <<
" Checking updates ... " << std::endl;
123 CurrentFE test_CFE (feTetraP2, geoLinearTetra, quadRuleTetra4pt);
125 test_CFE.update (Tetra1, UPDATE_QUAD_NODES);
126 test_CFE.quadNode (0, 0);
128 test_CFE.update (Tetra1, UPDATE_DPHI);
129 test_CFE.dphi (2, 0, 3);
131 test_CFE.update (Tetra1, UPDATE_D2PHI);
132 test_CFE.d2phi (1, 0, 1, 2);
134 test_CFE.update (Tetra1, UPDATE_WDET);
135 test_CFE.wDetJacobian (0);
141 std::cout <<
" Checking partition of unity ... " << std::endl;
143 test_CFE.update (Tetra1, UPDATE_DPHI);
146 for (UInt i (0); i < test_CFE.nbQuadPt(); ++i)
151 for (UInt n (0); n < test_CFE.nbFEDof(); ++n)
153 sum_phi += test_CFE.phi (n, i);
154 sum_dphi += test_CFE.dphi (n, 0, i);
157 if (std::fabs (sum_phi - 1) > test_tolerance)
159 std::cerr <<
" Sum of the basis functions : " << sum_phi << std::endl;
162 if (std::fabs (sum_dphi) > test_tolerance)
164 std::cerr <<
" Sum of the derivatives of the basis functions : " << sum_dphi << std::endl;
171 std::cout <<
" Checking measure ... " << std::endl;
173 test_CFE.update (Tetra1, UPDATE_WDET );
175 Real meas (test_CFE.measure() );
176 if (std::fabs (meas - 0.0005) > test_tolerance)
178 std::cerr <<
" Measure : " << meas << std::endl;
185 std::cout <<
" Checking setQuadRule ... " << std::endl;
186 test_CFE.setQuadRule (quadRuleTetra5pt);
188 test_CFE.update (Tetra1, UPDATE_QUAD_NODES);
189 test_CFE.quadNode (3, 0);
191 test_CFE.update (Tetra1, UPDATE_DPHI);
192 test_CFE.dphi (2, 0, 4);
194 test_CFE.update (Tetra1, UPDATE_D2PHI);
195 test_CFE.d2phi (1, 0, 1, 4);
197 test_CFE.update (Tetra1, UPDATE_WDET);
198 test_CFE.wDetJacobian (4);
204 std::cout <<
"MPI Finalization" << std::endl;
void updateInverseJacobian(const UInt &iQuadPt)
int main(int argc, char **argv)
double Real
Generic real data.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...