9 #include <Epetra_ConfigDefs.h> 12 #include <Epetra_MpiComm.h> 14 #include <Epetra_SerialComm.h> 19 #include <lifev/core/LifeV.hpp> 23 #include <lifev/core/filter/ExporterEnsight.hpp> 24 #include <lifev/core/filter/ExporterEmpty.hpp> 26 #include <lifev/core/filter/ExporterHDF5.hpp> 30 #include <lifev/core/mesh/MeshData.hpp> 31 #include <lifev/core/mesh/MeshPartitioner.hpp> 32 #include <lifev/core/fem/TimeAndExtrapolationHandler.hpp> 34 using namespace LifeV;
42 int main (
int argc,
char** argv)
46 MPI_Init (&argc, &argv);
47 std::shared_ptr<Epetra_Comm> Comm (
new Epetra_MpiComm ( MPI_COMM_WORLD ) );
48 bool verbose = Comm->MyPID() == 0;
50 std::shared_ptr<Epetra_Comm> Comm (
new Epetra_SerialComm() );
55 const bool check = command_line
.search (2
, "-c", "--check");
57 const std::string dataFile = command_line
.follow ("data_TimeAndExtrapolationHandler", 2
, "-d", "--data_TimeAndExtrapolationHandler");
65 meshDataFluid.setup(data_file,
"mesh_fluid");
70 std::cout <<
"\n[Loading the mesh ] .." << std::flush;
72 fluidMeshFull.reset(
new mesh_Type());
73 readMesh(*fluidMeshFull, meshDataFluid);
76 std::cout <<
" done! \n\n" << std::flush;
87 std::cout <<
"[Partitioning the fluid mesh ] \n\n";
89 MeshPartitioner<
mesh_Type > fluidPartio(fluidMeshFull, Comm);
93 fluidMeshLocal.reset(
new mesh_Type(*fluidPartio.meshPartition()));
99 velocityFESpace.reset (
new FESpace_Type (fluidMeshLocal,
"P1", 1, Comm) );
107 std::cout <<
"[Test with empty constructor ]";
109 UInt orderBDF = data_file
("dataTimeHandler/orderBDF",2
);
110 UInt orderExtrapolation = data_file
("dataTimeHandler/orderExtrapolation",2
);
113 TimeAndExtrapolationHandler timeVelocity;
114 timeVelocity.setBDForder(orderBDF);
115 timeVelocity.setMaximumExtrapolationOrder(orderExtrapolation);
118 timeVelocity.setTimeStep(0.2);
129 std::vector<vector_Type> initialState;
130 initialState.push_back(firstVector);
131 initialState.push_back(secondVector);
132 timeVelocity.initialize(initialState);
141 timeVelocity.extrapolate(orderExtrapolation, extrapolation);
142 extrapolation.spy(
"FirstExtrapolation");
145 timeVelocity.shift(thirdVector);
146 timeVelocity.extrapolate(orderExtrapolation, extrapolation);
147 extrapolation.spy(
"SecondExtrapolation");
151 timeVelocity.rhsContribution(rhsTerm);
152 rhsTerm.spy(
"rhsTerm");
154 timeVelocity.state()[0].spy(
"StatoZero");
155 timeVelocity.state()[1].spy(
"StatoUno");
158 std::cout <<
"\nAlpha = " << timeVelocity.alpha() <<
"\n\n";
VectorEpetra - The Epetra Vector format Wrapper.
VectorEpetra & operator+=(const data_type &scalar)
Addition operator.
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
std::shared_ptr< mesh_Type > meshPtr_Type
FESpace< mesh_Type, MapEpetra > FESpace_Type
Epetra_Import const & importer()
Getter for the Epetra_Import.
std::shared_ptr< FESpace_Type > FESpacePtr_Type
RegionMesh< LinearTetra > mesh_Type
MeshData - class for handling spatial discretization.
int operator()(const char *VarName, int Default) const
bool search(unsigned No, const char *P,...)
GetPot(const STRING_VECTOR &FileNameList)
const std::string follow(const char *Default, unsigned No, const char *Option,...)
int main(int argc, char **argv)
uint32_type UInt
generic unsigned integer (used mainly for addressing)