Skip to content

Commit

Permalink
Merge branch 'master' into piola_matrix_free
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasWik committed May 2, 2022
2 parents 5b32ae5 + 82cf0e0 commit c8a1154
Show file tree
Hide file tree
Showing 50 changed files with 3,231 additions and 155 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
libp4est-dev \
trilinos-all-dev \
petsc-dev \
libcgal-dev \
libmetis-dev \
libhdf5-mpi-dev
- name: info
Expand Down
20 changes: 20 additions & 0 deletions cmake/configure/configure_cgal.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## ---------------------------------------------------------------------
##
## Copyright (C) 2022 by the deal.II authors
##
## This file is part of the deal.II library.
##
## The deal.II library is free software; you can use it, redistribute
## it, and/or modify it under the terms of the GNU Lesser General
## Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## The full text of the license can be found in the file LICENSE.md at
## the top level directory of deal.II.
##
## ---------------------------------------------------------------------

#
# Configuration for the CGAL library:
#

CONFIGURE_FEATURE(CGAL)
46 changes: 46 additions & 0 deletions cmake/modules/FindCGAL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## ---------------------------------------------------------------------
##
## Copyright (C) 2022 by the deal.II authors
##
## This file is part of the deal.II library.
##
## The deal.II library is free software; you can use it, redistribute
## it, and/or modify it under the terms of the GNU Lesser General
## Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## The full text of the license can be found in the file LICENSE.md at
## the top level directory of deal.II.
##
## ---------------------------------------------------------------------

#
# Try to find the CGAL libraries
#
# This module exports
#
# CGAL_INCLUDE_DIRS
#

SET(CGAL_DIR "" CACHE PATH "An optional hint to a CGAL installation")
SET_IF_EMPTY(CGAL_DIR "$ENV{CGAL_DIR}")

IF(NOT "${CGAL_DIR}" STREQUAL "")
SET(CGAL_DIR ${CGAL_DIR})
ENDIF()

IF(DEAL_II_HAVE_CXX17)
# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
FIND_PACKAGE(CGAL)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
ELSE(DEAL_II_HAVE_CXX17)
SET(CGAL_FOUND FALSE)
SET(CGAL_INCLUDE_DIRS "-NOTFOUND")
MESSAGE(WARNING "CGAL wrappers require C++17. Disabling CGAL Support.")
ENDIF(DEAL_II_HAVE_CXX17)

DEAL_II_PACKAGE_HANDLE(CGAL
INCLUDE_DIRS REQUIRED CGAL_INCLUDE_DIRS
USER_INCLUDE_DIRS REQUIRED CGAL_INCLUDE_DIRS
CLEAR CGAL_INCLUDE_DIRS
)
1 change: 1 addition & 0 deletions doc/doxygen/options.dox.in
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ PREDEFINED = DOXYGEN=1 \
DEAL_II_ARPACK_WITH_PARPACK=1 \
DEAL_II_WITH_ASSIMP=1 \
DEAL_II_WITH_BOOST=1 \
DEAL_II_WITH_CGAL=1 \
DEAL_II_WITH_TASKFLOW=1 \
DEAL_II_WITH_COMPLEX_VALUES=1 \
DEAL_II_WITH_CUDA=1 \
Expand Down
3 changes: 3 additions & 0 deletions doc/news/changes/major/20220426FederHeltai
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
New: Added support for the CGAL library (www.cgal.org).
<br>
(Marco Feder, Luca Heltai, 2022/04/26)
3 changes: 3 additions & 0 deletions doc/news/changes/minor/20220420PasqualeAfrica
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added: New function enable_abort_on_exception.
<br>
(Pasquale Claudio Africa, 2022/04/20)
5 changes: 5 additions & 0 deletions doc/news/changes/minor/20220426DanielSun
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixed: The building process now works well with MPI option on Windows system.
If configured properly, we can explore the capability of distributed computing
on Windows system within Deal.II framework.
<br>
(Daniel Sun, 2022/04/26)
6 changes: 6 additions & 0 deletions doc/news/changes/minor/20220426Jean-PaulPelteret
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Improved: The step-44 tutorial now uses FE_DGP elements to discretize the
pressure and dilatation fields, rather than FE_DGPMonomial. This improves
the condition number of the linear system, necessitating fewer iterations
to compute its iterative inverse.
<br>
(Jean-Paul Pelteret, 2022/04/26)
26 changes: 26 additions & 0 deletions doc/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,32 @@ <h4>Optional interfaces to other software packages</h4>
</p>
</dd>

<dt><a name="CGAL" />
<a href="https://www.cgal.org/" target="_top">CGAL</a>
</dt>
<dd>
<p>
<a href="https://www.cgal.org/" target="_top">CGAL</a>
is a software project that provides easy access to
efficient and reliable geometric algorithms in the form of a C++
library. CGAL is used in various areas needing geometric
computation, such as geographic information systems, computer
aided design, molecular biology, medical imaging, computer
graphics, and robotics.

The library offers data structures and algorithms like
triangulations, Voronoi diagrams, Boolean operations on polygons
and polyhedra, point set processing, arrangements of curves,
surface and volume mesh generation, geometry processing, alpha
shapes, convex hull algorithms, shape reconstruction, AABB and
KD trees.

The CGAL Wrappers use c++17 features. In order to use CGAL, add
<code>-DCGAL_DIR=/path/to/cgal</code> to the deal.II CMake call,
and make sure that <code>DEAL_II_HAVE_CXX17</code> is enabled.
</p>
</dd>


<dt><a name="CUDA"></a><a href="https://developer.nvidia.com/cuda-zone">CUDA</a></dt>
<dd>
Expand Down
1 change: 1 addition & 0 deletions doc/users/cmake_dealii.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ <h3>Feature configuration</h3>
DEAL_II_WITH_ARPACK
DEAL_II_WITH_ASSIMP
DEAL_II_WITH_BOOST
DEAL_II_WITH_CGAL
DEAL_II_WITH_COMPLEX_VALUES
DEAL_II_WITH_CUDA
DEAL_II_WITH_GINKGO
Expand Down
24 changes: 12 additions & 12 deletions examples/step-44/step-44.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/tria.h>

#include <deal.II/fe/fe_dgp_monomial.h>
#include <deal.II/fe/fe_dgp.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_tools.h>
Expand Down Expand Up @@ -1037,19 +1037,18 @@ namespace Step44
// The Finite Element System is composed of dim continuous displacement
// DOFs, and discontinuous pressure and dilatation DOFs. In an attempt to
// satisfy the Babuska-Brezzi or LBB stability conditions (see Hughes
// (2000)), we setup a $Q_n \times DGPM_{n-1} \times DGPM_{n-1}$
// system. $Q_2 \times DGPM_1 \times DGPM_1$ elements satisfy this
// condition, while $Q_1 \times DGPM_0 \times DGPM_0$ elements do
// (2000)), we setup a $Q_n \times DGP_{n-1} \times DGP_{n-1}$
// system. $Q_2 \times DGP_1 \times DGP_1$ elements satisfy this
// condition, while $Q_1 \times DGP_0 \times DGP_0$ elements do
// not. However, it has been shown that the latter demonstrate good
// convergence characteristics nonetheless.
fe(FE_Q<dim>(parameters.poly_degree),
dim, // displacement
FE_DGPMonomial<dim>(parameters.poly_degree - 1),
FE_DGP<dim>(parameters.poly_degree - 1),
1, // pressure
FE_DGPMonomial<dim>(parameters.poly_degree - 1),
1)
, // dilatation
dof_handler(triangulation)
FE_DGP<dim>(parameters.poly_degree - 1),
1) // dilatation
, dof_handler(triangulation)
, dofs_per_cell(fe.n_dofs_per_cell())
, u_fe(first_u_component)
, p_fe(p_component)
Expand Down Expand Up @@ -1080,10 +1079,11 @@ namespace Step44
// constraint $\widetilde{J}=1$ on the initial solution field. The constraint
// corresponds to the determinant of the deformation gradient in the
// undeformed configuration, which is the identity tensor. We use
// FE_DGPMonomial bases to interpolate the dilatation field, thus we can't
// FE_DGP bases to interpolate the dilatation field, thus we can't
// simply set the corresponding dof to unity as they correspond to the
// monomial coefficients. Thus we use the VectorTools::project function to do
// the work for us. The VectorTools::project function requires an argument
// coefficients of a truncated Legendre polynomial.
// Thus we use the VectorTools::project function to do the work for us.
// The VectorTools::project function requires an argument
// indicating the hanging node constraints. We have none in this program
// So we have to create a constraint object. In its original state, constraint
// objects are unsorted, and have to be sorted (using the
Expand Down
1 change: 1 addition & 0 deletions include/deal.II/base/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#cmakedefine DEAL_II_WITH_ARPACK
#cmakedefine DEAL_II_WITH_ARBORX
#cmakedefine DEAL_II_WITH_ASSIMP
#cmakedefine DEAL_II_WITH_CGAL
#cmakedefine DEAL_II_WITH_COMPLEX_VALUES
#cmakedefine DEAL_II_WITH_CUDA
#cmakedefine DEAL_II_WITH_GINKGO
Expand Down
12 changes: 12 additions & 0 deletions include/deal.II/base/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1286,11 +1286,23 @@ namespace deal_II_exceptions
* still call abort(), e.g. when an exception is caught during exception
* handling.
*
* @see enable_abort_on_exception
* @see Exceptions
*/
void
disable_abort_on_exception();

/**
* Calling this function switches on the use of <tt>std::abort()</tt> when
* an exception is created using the Assert() macro, instead of throwing it.
* This restores the standard behavior.
*
* @see disable_abort_on_exception
* @see Exceptions
*/
void
enable_abort_on_exception();

/**
* The functions in this namespace are in connection with the Assert and
* AssertThrow mechanism but are solely for internal purposes and are not
Expand Down
2 changes: 2 additions & 0 deletions include/deal.II/base/numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ DEAL_II_NAMESPACE_CLOSE
// import the whole Sacado header at this point to get the math
// functions imported into the standard namespace.
#ifdef DEAL_II_TRILINOS_WITH_SACADO
DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
# include <Sacado.hpp>
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
#endif

namespace std
Expand Down
4 changes: 4 additions & 0 deletions include/deal.II/base/time_stepping.h
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ namespace TimeStepping
*/
struct Status : public TimeStepping<VectorType>::Status
{
Status()
: method(invalid)
{}

runge_kutta_method method;
embedded_runge_kutta_time_step exit_delta_t;
unsigned int n_iterations;
Expand Down
12 changes: 12 additions & 0 deletions include/deal.II/base/time_stepping.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ DEAL_II_NAMESPACE_OPEN

namespace TimeStepping
{
DeclExceptionMsg(ExcNoMethodSelected,
"No method selected. You need to call initialize or pass a "
"runge_kutta_method to the constructor.");

// ----------------------------------------------------------------------
// RungeKutta
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -198,6 +202,8 @@ namespace TimeStepping
double delta_t,
VectorType & y)
{
Assert(status.method != runge_kutta_method::invalid, ExcNoMethodSelected());

std::vector<VectorType> f_stages(this->n_stages, y);
// Compute the different stages needed.
compute_stages(f, t, delta_t, y, f_stages);
Expand Down Expand Up @@ -390,6 +396,8 @@ namespace TimeStepping
VectorType & vec_ri,
VectorType & vec_ki)
{
Assert(status.method != runge_kutta_method::invalid, ExcNoMethodSelected());

compute_one_stage(f,
t,
this->b[0] * delta_t,
Expand Down Expand Up @@ -566,6 +574,8 @@ namespace TimeStepping
double delta_t,
VectorType & y)
{
Assert(status.method != runge_kutta_method::invalid, ExcNoMethodSelected());

VectorType old_y(y);
std::vector<VectorType> f_stages(this->n_stages, y);
// Compute the different stages needed.
Expand Down Expand Up @@ -996,6 +1006,8 @@ namespace TimeStepping
double delta_t,
VectorType & y)
{
Assert(status.method != runge_kutta_method::invalid, ExcNoMethodSelected());

bool done = false;
unsigned int count = 0;
double error_norm = 0.;
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <utility>
#include <vector>

DEAL_II_DISABLE_EXTRA_DIAGNOSTICS

#ifdef DEAL_II_WITH_TRILINOS
# include <Epetra_Comm.h>
# include <Epetra_Map.h>
Expand All @@ -40,8 +42,6 @@
# endif
#endif

DEAL_II_DISABLE_EXTRA_DIAGNOSTICS

#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/core/demangle.hpp>
Expand Down

0 comments on commit c8a1154

Please sign in to comment.