From eff0922be7f4ef7f84038ab12f45eeeea37a0cb9 Mon Sep 17 00:00:00 2001 From: landinjm Date: Thu, 10 Oct 2024 10:26:15 -0400 Subject: [PATCH] comments and renaming makeTriangulation function --- .../CHiMaD_benchmark1c/customPDE.h | 4 +-- .../CHiMaD_benchmark6b/customPDE.h | 4 +-- include/core/matrixFreePDE.h | 33 ++++++++++++------- src/core/init.cc | 4 +-- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/customPDE.h b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/customPDE.h index 78bd368e1..57392ceb8 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/customPDE.h +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/customPDE.h @@ -85,7 +85,7 @@ class customPDE : public MatrixFreePDE // ================================================================ void - makeTriangulation(parallel::distributed::Triangulation &) const override; + create_triangulation(parallel::distributed::Triangulation &tria) const override; // ================================================================ // Model constants specific to this subclass @@ -104,7 +104,7 @@ class customPDE : public MatrixFreePDE template void -customPDE::makeTriangulation( +customPDE::create_triangulation( parallel::distributed::Triangulation &tria) const { parallel::distributed::Triangulation tria_horizontal_box(MPI_COMM_WORLD); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/customPDE.h b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/customPDE.h index 1e9c70510..176c83294 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/customPDE.h +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/customPDE.h @@ -87,7 +87,7 @@ class customPDE : public MatrixFreePDE // Virtual method in MatrixFreePDE void - makeTriangulation(parallel::distributed::Triangulation &) const override; + create_triangulation(parallel::distributed::Triangulation &tria) const override; // ================================================================ // Model constants specific to this subclass @@ -108,7 +108,7 @@ class customPDE : public MatrixFreePDE template void -customPDE::makeTriangulation( +customPDE::create_triangulation( parallel::distributed::Triangulation &tria) const { parallel::distributed::Triangulation tria_box(MPI_COMM_WORLD); diff --git a/include/core/matrixFreePDE.h b/include/core/matrixFreePDE.h index 3ab03fc90..4a8fbb6ef 100644 --- a/include/core/matrixFreePDE.h +++ b/include/core/matrixFreePDE.h @@ -52,36 +52,45 @@ using vectorType = LinearAlgebra::distributed::Vector; // macro for constants #define constV(a) make_vectorized_array(a) -// -// base class for matrix free PDE's -// /** - * This is the abstract base class for the matrix free implementation of - * Parabolic and Elliptic BVP's, and supports MPI, Threads and Vectorization - * (Hybrid Parallel). This class contains the parallel data structures, mesh - * (referred to as triangulation), parallel degrees of freedom distribution, - * constraints, and general utility methods. + * \brief This is the abstract base class for the matrix free implementation of parabolic + * and elliptic BVP's, and supports MPI, threads and vectorization (Hybrid Parallel). This + * class contains the parallel data structures, mesh (referred to as triangulation), + * parallel degrees of freedom distribution, constraints, and general utility methods. * * All the physical models in this package inherit this base class. + * + * \tparam dim The number of dimensions in the problem. + * \tparam degree The polynomial degree of the shape functions. */ template class MatrixFreePDE : public Subscriptor { public: /** - * Class contructor + * \brief Class contructor. */ MatrixFreePDE(userInputParameters); - ~MatrixFreePDE(); + + /** + * \brief Class destructor. + */ + ~MatrixFreePDE() override; + /** - * Initializes the mesh, degrees of freedom, constraints and data structures + * \brief Initializes the mesh, degrees of freedom, constraints and data structures * using the user provided inputs in the application parameters file. */ virtual void init(); + /** + * \brief Create the mesh with the user provided domain sizes. + * + * \param tria Triangulation object. It must be empty prior to calling this function. + */ virtual void - makeTriangulation(parallel::distributed::Triangulation &) const; + create_triangulation(parallel::distributed::Triangulation &tria) const; /** * Initializes the data structures for enabling unit tests. diff --git a/src/core/init.cc b/src/core/init.cc index a4fb0a29b..9e3e6473e 100644 --- a/src/core/init.cc +++ b/src/core/init.cc @@ -16,7 +16,7 @@ MatrixFreePDE::init() pcout << "creating problem mesh...\n"; // Create the coarse mesh and mark the boundaries - makeTriangulation(triangulation); + create_triangulation(triangulation); // Set which (if any) faces of the triangulation are periodic setPeriodicity(); @@ -376,7 +376,7 @@ MatrixFreePDE::init() template void -MatrixFreePDE::makeTriangulation( +MatrixFreePDE::create_triangulation( parallel::distributed::Triangulation &tria) const { if (dim == 3)