Skip to content

Commit

Permalink
Merge branch 'master' into drdx
Browse files Browse the repository at this point in the history
  • Loading branch information
dougshidong committed Oct 5, 2019
2 parents 44c9c47 + acccccc commit 05532ec
Show file tree
Hide file tree
Showing 34 changed files with 1,073 additions and 706 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

## Code Description
- Code uses deal.II library as the backbone (https://www.dealii.org/)
- Supported Partial Differential Equations: Convection-diffusion, Euler, TODO: Navier-Stokes.
- Supported convective numerical fluxes: Lax-Friedrichs, Roe (Harten's entropy fix) for Euler
- Math supporting this code can be viewed in this **very rough draft in progress** [Overleaf document](https://www.overleaf.com/read/mytvbbbbyqnj).
- Supports weak and strong (InProgress) form of discontinuous Galerkin (DG), and flux reconstruction (FR) (InProgress)
- Supported Partial Differential Equations: Linear advection, diffusion, convection-diffusion, Burgers, Euler, TODO: Navier-Stokes.
- Supported convective numerical fluxes: Lax-Friedrichs, Roe (Harten's entropy fix) for Euler, InProgress: Split-Form
- Supported diffusive numerical fluxes: Symmetric Interior Penalty
- Supported elements: LINEs, QUADs, HEXs
- Supported elements: LINEs, QUADs, HEXs since it uses deal.II
- Supported refinements: h (size) or p (order).

## Building/Running the Code
Expand Down Expand Up @@ -68,6 +70,7 @@ ROOT$ ctest -R <regex> (Run tests matching regular expression)
ROOT$ ctest -E <regex> (Exclude tests matching regular expression)
ROOT$ ctest -V (Enable verbose output from tests)
```
Note that running `ctest` in `Debug` will take forever since some integration tests fully solve nonlinear problems with multiple orders and multiple meshes. It is suggested to perform `ctest` in `Release` mode, and only use `Debug` mode for debugging purposes.

## Debugging

Expand Down Expand Up @@ -95,11 +98,11 @@ GDB$ quit
### Parallel debugging
If the error only occurs when using parallelism, you can use the following
If the error only occurs when using parallelism, you can use the following example command
```sh
mpirun -np 2 xterm -hold -e gdb -ex 'break MPI_Abort' -ex run --args /home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/bin/PHiLiP_2D "-i" "/home/ddong/Codes/PHiLiP_temp/PHiLiP/build_de bug/tests/advection_implicit/2d_advection_implicit_strong.prm"
mpirun -np 2 xterm -hold -e gdb -ex 'break MPI_Abort' -ex run --args /home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/bin/PHiLiP_2D "-i" "/home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/tests/advection_implicit/2d_advection_implicit_strong.prm"
```
This launches 2 xterm processes, each of which will launch gdb processes that will run the code and will have a breakpoint when MPI_Abort is encountered.
# License
Expand Down
60 changes: 60 additions & 0 deletions src/dg/dg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,66 @@ DGBase<dim,real>::create_collection_tuple(const unsigned int max_degree, const i
dealii::hp::QCollection<1> oned_quad_coll;

dealii::hp::FECollection<dim> fe_coll_lagr;

// for p=0, we use a p=1 FE for collocation, since there's no p=0 quadrature for Gauss Lobatto
if (parameters_input->use_collocated_nodes==true)
{
int degree = 1;
//const dealii::MappingQ<dim,dim> mapping(degree, true);
//const dealii::MappingQ<dim,dim> mapping(degree+1, true);
//const dealii::MappingManifold<dim,dim> mapping;
//mapping_coll.push_back(mapping);

const dealii::FE_DGQ<dim> fe_dg(degree);
const dealii::FESystem<dim,dim> fe_system(fe_dg, nstate);
fe_coll.push_back (fe_system);

//

dealii::Quadrature<1> oned_quad(degree+1);
dealii::Quadrature<dim> volume_quad(degree+1);
dealii::Quadrature<dim-1> face_quad(degree+1); //removed const

if (parameters_input->use_collocated_nodes)
{
dealii::QGaussLobatto<1> oned_quad_Gauss_Lobatto (degree+1);
dealii::QGaussLobatto<dim> vol_quad_Gauss_Lobatto (degree+1);
oned_quad = oned_quad_Gauss_Lobatto;
volume_quad = vol_quad_Gauss_Lobatto;

if(dim == 1)
{
dealii::QGauss<dim-1> face_quad_Gauss_Legendre (degree+1);
face_quad = face_quad_Gauss_Legendre;
}
else
{
dealii::QGaussLobatto<dim-1> face_quad_Gauss_Lobatto (degree+1);
face_quad = face_quad_Gauss_Lobatto;
}


}
else
{
dealii::QGauss<1> oned_quad_Gauss_Legendre (degree+1);
dealii::QGauss<dim> vol_quad_Gauss_Legendre (degree+1);
dealii::QGauss<dim-1> face_quad_Gauss_Legendre (degree+1);
oned_quad = oned_quad_Gauss_Legendre;
volume_quad = vol_quad_Gauss_Legendre;
face_quad = face_quad_Gauss_Legendre;
}
//


volume_quad_coll.push_back (volume_quad);
face_quad_coll.push_back (face_quad);
oned_quad_coll.push_back (oned_quad);

dealii::FE_DGQArbitraryNodes<dim,dim> lagrange_poly(oned_quad);
fe_coll_lagr.push_back (lagrange_poly);
}

int minimum_degree = (parameters_input->use_collocated_nodes==true) ? 1 : 0;
for (unsigned int degree=minimum_degree; degree<=max_degree; ++degree) {
//const dealii::MappingQ<dim,dim> mapping(degree, true);
Expand Down
10 changes: 8 additions & 2 deletions src/parameters/all_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ void AllParameters::declare_parameters (dealii::ParameterHandler &prm)
" euler_vortex | "
" euler_entropy_waves | "
" numerical_flux_convervation | "
" jacobian_regression "),
" jacobian_regression |"
" advection_periodicity |"
" euler_split_taylor_green"),
"The type of test we want to solve. "
"Choices are (only run control has been coded up for now)"
" <run_control | "
Expand All @@ -57,7 +59,9 @@ void AllParameters::declare_parameters (dealii::ParameterHandler &prm)
" euler_vortex | "
" euler_entropy_waves | "
" numerical_flux_convervation | "
" jacobian_regression>.");
" jacobian_regression |"
" euler_split_taylor_green |"
" advection_periodicity >.");

prm.declare_entry("pde_type", "advection",
dealii::Patterns::Selection(
Expand Down Expand Up @@ -111,6 +115,8 @@ void AllParameters::parse_parameters (dealii::ParameterHandler &prm)
else if (test_string == "euler_entropy_waves") { test_type = euler_entropy_waves; }
else if (test_string == "numerical_flux_convervation") { test_type = numerical_flux_convervation; }
else if (test_string == "jacobian_regression") { test_type = jacobian_regression; }
else if (test_string == "advection_periodicity") {test_type = advection_periodicity; }
else if (test_string == "euler_split_taylor_green") {test_type = euler_split_taylor_green;}

const std::string pde_string = prm.get("pde_type");
if (pde_string == "advection") {
Expand Down
2 changes: 1 addition & 1 deletion src/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SET(SOURCE
burgers.cpp
euler.cpp
manufactured_solution.cpp
# mhd.cpp
mhd.cpp
)

foreach(dim RANGE 1 3)
Expand Down
Loading

0 comments on commit 05532ec

Please sign in to comment.