Skip to content

Commit

Permalink
Added a first version of the parallel Grad-Div solver finished with u…
Browse files Browse the repository at this point in the history
…nit tests

This solver has similar unit test as the GLS solvers and can also work in transient
TODO - Fix the linear algebra of the grad-div solver and make it more generic

Begun a first version of a refactoring of the navier-stokes to remove redundancy,but this is not
satisfactory at the moment. Having a mother class for all NS solvers is maybe not a good idea

Re-indented the entire code
  • Loading branch information
blaisb committed Sep 12, 2019
1 parent fd65ad1 commit b2715aa
Show file tree
Hide file tree
Showing 35 changed files with 5,776 additions and 266 deletions.
2 changes: 2 additions & 0 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
ENABLE_TESTING()
ADD_SUBDIRECTORY(glsNS2d)
ADD_SUBDIRECTORY(glsNS3d)
ADD_SUBDIRECTORY(gdNS2d)
ADD_SUBDIRECTORY(gdNS3d)
ADD_SUBDIRECTORY(initial_conditions)
ADD_SUBDIRECTORY(tg_vortex_3d)
16 changes: 16 additions & 0 deletions applications/gdNS2d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Usually, you will not need to modify anything beyond this point...
#Method of manufactured solution 2D

# Set the name of the project and target:
SET(TARGET "gdNS2d")

INCLUDE_DIRECTORIES(
lethe
${CMAKE_SOURCE_DIR}/src/
)
ADD_EXECUTABLE(gdNS2d gdNS2d.cc)
DEAL_II_SETUP_TARGET(gdNS2d)
TARGET_LINK_LIBRARIES(gdNS2d lethe)

install(TARGETS gdNS2d RUNTIME DESTINATION bin)

56 changes: 56 additions & 0 deletions applications/gdNS2d/gdNS2d.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include <deal.II/base/convergence_table.h>

#include "gdNS.h"

int
main(int argc, char *argv[])
{
try
{
if (argc != 2)
{
std::cout << "Usage:" << argv[0] << " input_file" << std::endl;
std::exit(1);
}
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, numbers::invalid_unsigned_int);

ParameterHandler prm;
NavierStokesSolverParameters<2> NSparam;
NSparam.declare(prm);
// Parsing of the file
prm.parse_input(argv[1]);
NSparam.parse(prm);

GDNavierStokesSolver<2> problem_2d(NSparam,
NSparam.femParameters.velocityOrder,
NSparam.femParameters.pressureOrder);
problem_2d.solve();
}
catch (std::exception &exc)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
return 0;
}
16 changes: 16 additions & 0 deletions applications/gdNS3d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Usually, you will not need to modify anything beyond this point...
#Method of manufactured solution 2D

# Set the name of the project and target:
SET(TARGET "gdNS3d")

INCLUDE_DIRECTORIES(
lethe
${CMAKE_SOURCE_DIR}/src/
)

ADD_EXECUTABLE(gdNS3d gdNS3d.cc)
DEAL_II_SETUP_TARGET(gdNS3d)
TARGET_LINK_LIBRARIES(gdNS3d lethe)

install(TARGETS gdNS3d RUNTIME DESTINATION bin)
54 changes: 54 additions & 0 deletions applications/gdNS3d/gdNS3d.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include "gdNS.h"

int
main(int argc, char *argv[])
{
try
{
if (argc != 2)
{
std::cout << "Usage:" << argv[0] << " input_file" << std::endl;
std::exit(1);
}
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, numbers::invalid_unsigned_int);

ParameterHandler prm;
NavierStokesSolverParameters<3> NSparam;
NSparam.declare(prm);
// Parsing of the file
prm.parse_input(argv[1]);
NSparam.parse(prm);

GDNavierStokesSolver<3> problem_3d(NSparam,
NSparam.femParameters.velocityOrder,
NSparam.femParameters.pressureOrder);
problem_3d.solve();
}
catch (std::exception &exc)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
return 0;
}
3 changes: 2 additions & 1 deletion applications_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
ADD_SUBDIRECTORY(initial_conditions)
ADD_SUBDIRECTORY(glsNS2d)
ADD_SUBDIRECTORY(glsNS3d)

ADD_SUBDIRECTORY(gdNS2d)
ADD_SUBDIRECTORY(gdNS3d)
Loading

0 comments on commit b2715aa

Please sign in to comment.