Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mesh_handle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ The folder's most important files are:
- The [mesh.hxx](mesh.hxx) defines the mesh of the handle. This is the central file of the mesh handle.
- The [constructor_wrappers.hxx](constructor_wrappers.hxx) allows to define a mesh handle using a cmesh instead of a forest and provides a very small number of examples where the user needs no cmesh.
- The [element.hxx](element.hxx) defines the elements (mesh or ghost elements) of the mesh handle.
- The [competences.hxx](competences.hxx) defines additional competences/functionality of an element to access additional data.
- In the folder [competences/](competences/README.md), there are files that define additional competences/functionality of an element to access additional data.
- The [competence_pack.hxx](competence_pack.hxx) is needed to pack element or mesh competences to pass it as template parameter to the mesh.
- The [data_handler.hxx](data_handler.hxx) provides competences to work with element data.
- The [mesh_io.hxx](mesh_io.hxx) allows to output results in vtk format.

Headers in the [internal/](internal/) folder are only intended to implement details of the mesh handle, so they should not need to be included for any other purpose.
8 changes: 6 additions & 2 deletions mesh_handle/competence_pack.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@

#pragma once

#include "competences.hxx"
#include "data_handler.hxx"
#include "competences/cache_element_competences.hxx"
#include "competences/element_data_competences.hxx"
#include "competences/dg_competences.hxx"
#include "internal/competence_pack_union.hxx"
namespace t8_mesh_handle
{
Expand Down Expand Up @@ -96,6 +97,9 @@ using empty_mesh_competences = mesh_competence_pack<>;
template <T8MPISafeType TElementDataType>
using data_mesh_competences = mesh_competence_pack<element_data_mesh_competence<TElementDataType>::template type>;

/** Predefined mesh competence pack combining all competences that are useful for discontinuous Galerkin methods. */
using dg_mesh_competences = mesh_competence_pack<remote_ranks_mesh_competence, face_vector_mesh_competence>;

// --- Compute union of competence packs. ---
/** Compute the unique union of the competences of several competence_pack. This could be
* \ref t8_mesh_handle::element_competence_pack or \ref t8_mesh_handle::mesh_competence_pack.
Expand Down
19 changes: 19 additions & 0 deletions mesh_handle/competences/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Competences for the mesh handle #

Definition of additional competences/functionalities that can be used for the t8_mesh_handle::mesh.

- [element_data_competences.hxx](element_data_competences.hxx) provides competences to work with element data.
- [cache_element_competences.hxx](cache_element_competences.hxx) defines competences to cache functionalities of elements instead of calculating them each time a function is called.
- [dg_competences.hxx](dg_competences.hxx): competences that are useful for discontinuous Galerkin methods.

### Note for developers or users that want to provide their own competence:

All competences have the same inheritance pattern:
We use the CRTP pattern as we may need to access members of the derived classes like t8_mesh_handle::element.
The t8_crtp_operator is used for convenience/clear code (avoid to type a static cast explicitly each time we need functionality of TUnderlying).
Especially for the competences to cache functionality, the access of members is not necessary, such that it is not obvious why we use the crtp.
For competences that extend the functionality of the element (see e.g. [dg_competences.hxx](dg_competences.hxx)), this is required.
We use it for all competences for consistency and compatibility with t8_mesh_handle::element.

We use t8_crtp_operator instead of t8_crtp_basic to circumvent diamond shaped inheritance pattern in the case that multiple competences are used together.
The distinction of the classes is made by the second template parameter of t8_crtp_operator.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with t8code; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/** \file competences.hxx
/** \file cache_element_competences.hxx
* Definition of the additional competences/functionalities that can be used for \ref t8_mesh_handle::mesh.
* Especially, competences to cache functionalities of elements instead of calculating them each time a function
* is called are provided.
Expand Down
Loading