Skip to content

Commit

Permalink
Merge pull request #261 from Rombur/reduce_p_max
Browse files Browse the repository at this point in the history
Reduce max FE degree from 10 to 5
  • Loading branch information
stvdwtt authored Feb 29, 2024
2 parents 71ab318 + 6c3b65c commit 37f3322
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN cd /home && git clone https://github.com/adamantine-sim/adamantine && \
cmake \
-DDEAL_II_DIR=${DEAL_II_DIR} \
-DCMAKE_BUILD_TYPE=Release\
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_CXX_FLAGS="-g -ffast-math" \
-DADAMANTINE_ENABLE_ADIAK=ON \
-DADAMANTINE_ENABLE_CALIPER=ON \
../ && \
Expand Down
68 changes: 4 additions & 64 deletions application/adamantine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -317,36 +317,11 @@ initialize_thermal_physics(
return initialize_quadrature<dim, 4, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
case 5:
{
return initialize_quadrature<dim, 5, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
case 6:
{
return initialize_quadrature<dim, 6, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
case 7:
{
return initialize_quadrature<dim, 7, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
case 8:
{
return initialize_quadrature<dim, 8, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
case 9:
{
return initialize_quadrature<dim, 9, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
default:
{
adamantine::ASSERT_THROW(fe_degree == 10,
"fe_degree should be between 1 and 10.");
return initialize_quadrature<dim, 10, MemorySpaceType>(
adamantine::ASSERT_THROW(fe_degree == 5,
"fe_degree should be between 1 and 5.");
return initialize_quadrature<dim, 5, MemorySpaceType>(
quadrature_type, communicator, database, geometry, material_properties);
}
}
Expand Down Expand Up @@ -790,44 +765,9 @@ void refine_mesh(
time_steps_refinement, refinement_database);
break;
}
case 6:
{
refine_mesh<dim, 6>(thermal_physics, material_properties, solution,
heat_sources, time, next_refinement_time,
time_steps_refinement, refinement_database);
break;
}
case 7:
{
refine_mesh<dim, 7>(thermal_physics, material_properties, solution,
heat_sources, time, next_refinement_time,
time_steps_refinement, refinement_database);
break;
}
case 8:
{
refine_mesh<dim, 8>(thermal_physics, material_properties, solution,
heat_sources, time, next_refinement_time,
time_steps_refinement, refinement_database);
break;
}
case 9:
{
refine_mesh<dim, 9>(thermal_physics, material_properties, solution,
heat_sources, time, next_refinement_time,
time_steps_refinement, refinement_database);
break;
}
case 10:
{
refine_mesh<dim, 10>(thermal_physics, material_properties, solution,
heat_sources, time, next_refinement_time,
time_steps_refinement, refinement_database);
break;
}
default:
{
adamantine::ASSERT_THROW(false, "fe_degree should be between 1 and 10.");
adamantine::ASSERT_THROW(false, "fe_degree should be between 1 and 5.");
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions source/ThermalOperatorDevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -737,20 +737,10 @@ template class ThermalOperatorDevice<2, 2, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 3, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 4, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 5, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 6, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 7, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 8, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 9, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<2, 10, dealii::MemorySpace::Default>;

template class ThermalOperatorDevice<3, 1, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 2, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 3, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 4, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 5, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 6, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 7, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 8, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 9, dealii::MemorySpace::Default>;
template class ThermalOperatorDevice<3, 10, dealii::MemorySpace::Default>;
} // namespace adamantine
42 changes: 1 addition & 41 deletions source/ThermalPhysics.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 - 2023, the adamantine authors.
/* Copyright (c) 2016 - 2024, the adamantine authors.
*
* This file is subject to the Modified BSD License and may not be distributed
* without copyright and license information. Please refer to the file LICENSE
Expand All @@ -22,16 +22,6 @@ template class ThermalPhysics<2, 4, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 5, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 6, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 7, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 8, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 9, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<2, 10, dealii::MemorySpace::Default,
dealii::QGauss<1>>;

template class ThermalPhysics<3, 1, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
Expand All @@ -43,16 +33,6 @@ template class ThermalPhysics<3, 4, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 5, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 6, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 7, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 8, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 9, dealii::MemorySpace::Default,
dealii::QGauss<1>>;
template class ThermalPhysics<3, 10, dealii::MemorySpace::Default,
dealii::QGauss<1>>;

template class ThermalPhysics<2, 1, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
Expand All @@ -64,16 +44,6 @@ template class ThermalPhysics<2, 4, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 5, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 6, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 7, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 8, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 9, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<2, 10, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;

template class ThermalPhysics<3, 1, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
Expand All @@ -85,14 +55,4 @@ template class ThermalPhysics<3, 4, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 5, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 6, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 7, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 8, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 9, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
template class ThermalPhysics<3, 10, dealii::MemorySpace::Default,
dealii::QGaussLobatto<1>>;
} // namespace adamantine
10 changes: 5 additions & 5 deletions source/instantiation.hh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 - 2021, the adamantine authors.
/* Copyright (c) 2016 - 2024, the adamantine authors.
*
* This file is subject to the Modified BSD License and may not be distributed
* without copyright and license information. Please refer to the file LICENSE
Expand Down Expand Up @@ -26,17 +26,17 @@

// Instantiation of the class for:
// - dim = 2 and 3
// - fe_degree = 1 to 10
// - fe_degree = 1 to 5
#define M_FE_DEGREE(z, fe_degree, TUPLE_1) \
template class adamantine::BOOST_PP_TUPLE_ELEM(0, TUPLE_1)<BOOST_PP_TUPLE_ELEM(1, TUPLE_1),\
fe_degree, dealii::MemorySpace::Host>;
#define M_DIM(z, dim, TUPLE_0) \
BOOST_PP_REPEAT_FROM_TO(1, 11, M_FE_DEGREE, BOOST_PP_TUPLE_REPLACE(TUPLE_0, 1, dim))
BOOST_PP_REPEAT_FROM_TO(1, 6, M_FE_DEGREE, BOOST_PP_TUPLE_REPLACE(TUPLE_0, 1, dim))
#define INSTANTIATE_DIM_FEDEGREE_HOST(TUPLE_0) BOOST_PP_REPEAT_FROM_TO(2, 4, M_DIM, TUPLE_0)

// Instantiation of the class for:
// - dim = 2 and 3
// - fe_degree = 1 to 10
// - fe_degree = 1 to 5
// - QuadratureType = dealii::QGauss<1> and dealii::QGaussLobatto<1>
#define QUADRATURE_TYPE (dealii::QGauss<1>)(dealii::QGaussLobatto<1>)

Expand All @@ -47,7 +47,7 @@ BOOST_PP_TUPLE_ELEM(2, TUPLE_2), dealii::MemorySpace::Host, quadrature>;
BOOST_PP_SEQ_FOR_EACH(MA_QUADRATURE_TYPE, \
BOOST_PP_TUPLE_REPLACE(TUPLE_1, 2, fe_degree), QUADRATURE_TYPE)
#define MA_DIM(z, dim, TUPLE_0) \
BOOST_PP_REPEAT_FROM_TO(1, 11, MA_FE_DEGREE, BOOST_PP_TUPLE_REPLACE(TUPLE_0, 1, dim))
BOOST_PP_REPEAT_FROM_TO(1, 6, MA_FE_DEGREE, BOOST_PP_TUPLE_REPLACE(TUPLE_0, 1, dim))
#define INSTANTIATE_DIM_FEDEGREE_QUAD_HOST(TUPLE_0) BOOST_PP_REPEAT_FROM_TO(2, 4, MA_DIM, TUPLE_0)

// clang-format on
4 changes: 2 additions & 2 deletions source/validate_input_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ void validate_input_database(boost::property_tree::ptree &database)
// PropertyTreeInput discretization.thermal.fe_degree
unsigned int const fe_degree =
database.get<unsigned int>("discretization.thermal.fe_degree");
ASSERT_THROW(fe_degree > 0 && fe_degree < 11,
"Error: fe_degree should be between 1 and 10.");
ASSERT_THROW(fe_degree > 0 && fe_degree < 6,
"Error: fe_degree should be between 1 and 5.");

// PropertyTreeInput discretization.thermal.quadrature
boost::optional<std::string> quadrature_type_optional =
Expand Down

0 comments on commit 37f3322

Please sign in to comment.