diff --git a/CMakeLists.txt b/CMakeLists.txt index 125caeb6..f7a4cd1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12) set(CMAKE_EXPORT_COMPILE_COMMANDS ON ) -project(sloth VERSION 1.0 LANGUAGES CXX) +project(sloth VERSION 2.0 LANGUAGES CXX) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31c65768..a406ba2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Using the issue tracker The issue tracker is the preferred channel for bug reports, features requests and submitting pull requests, but please respect the following restrictions: -- Please do not use the issue tracker for personal support requests (contact directly the authors clement.introini@cea.fr +- Please do not use the issue tracker for personal support requests (contact directly the authors clement.introini@cea.fr) Bug reports =========== diff --git a/README.md b/README.md index 1acc7a8e..3da765ec 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ For more details, see [CONTRIBUTING.md](CONTRIBUTING.md). Main guidelines are: --- - [Alessandro Scapini (PhD 2024-2027)]() - [Clément Plumecocq (PhD 2023-2026)]() + - [Marine Harel (Master 2026)]() + - [Tom Schnetz (Master 2026)]() - [Victor Navarre (Master 2025)]() - [Jules Czuckermand (Master 2025)]() - [Mouad Bakhkakh (Master 2024)]() diff --git a/doc/Doxyfile.cmake b/doc/Doxyfile.cmake index 3543a2f6..9165500e 100644 --- a/doc/Doxyfile.cmake +++ b/doc/Doxyfile.cmake @@ -36,12 +36,12 @@ PROJECT_NAME= SLOTH # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER= "v1.0.0" +PROJECT_NUMBER= "v2.0.0" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF= "PhaseField solver" +PROJECT_BRIEF= "The multiphase-field multicomponent framework of the PLEIADES platform based on MFEM" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -763,7 +763,7 @@ INPUT_ENCODING= UTF-8 # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, # *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. -FILE_PATTERNS= *.hpp *.md +FILE_PATTERNS= *.cpp *.tpp *.hpp *.md # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. diff --git a/kernel/include/Coefficients/MfemCoefficient.hpp b/kernel/include/Coefficients/MfemCoefficient.hpp index 9c8b0829..cd69fa72 100644 --- a/kernel/include/Coefficients/MfemCoefficient.hpp +++ b/kernel/include/Coefficients/MfemCoefficient.hpp @@ -32,18 +32,17 @@ class MfemCoefficient : public mfem::Coefficient { private: + int id_ = 0; Coefficients sloth_coefficient_; - - const mfem::ParGridFunction &gf_; - const std::vector &vaux_gf_; + const mfem::ParGridFunction& gf_; + const std::vector& vaux_gf_; mutable std::vector vaux_gf_at_ip_; - int id_ = 0; public: - MfemCoefficient(int id, const Coefficients &coef, const mfem::ParGridFunction &vun, - const std::vector &vauxn); - double Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override; + MfemCoefficient(int id, const Coefficients& coef, const mfem::ParGridFunction& vun, + const std::vector& vauxn); + double Eval(mfem::ElementTransformation& T, const mfem::IntegrationPoint& ip) override; virtual ~MfemCoefficient() = default; }; @@ -54,8 +53,8 @@ class MfemCoefficient : public mfem::Coefficient { * @param vun * @param vauxn */ -MfemCoefficient::MfemCoefficient(int id, const Coefficients &coef, const mfem::ParGridFunction &vun, - const std::vector &vauxn) +MfemCoefficient::MfemCoefficient(int id, const Coefficients& coef, const mfem::ParGridFunction& vun, + const std::vector& vauxn) : id_(id), sloth_coefficient_(coef), gf_(vun), vaux_gf_(vauxn) {} /** @@ -65,7 +64,7 @@ MfemCoefficient::MfemCoefficient(int id, const Coefficients &coef, const mfem::P * @param ip * @return double */ -double MfemCoefficient::Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) { +double MfemCoefficient::Eval(mfem::ElementTransformation& T, const mfem::IntegrationPoint& ip) { if (this->sloth_coefficient_[id_].is_scalar()) { return this->sloth_coefficient_[id_].compute(); } diff --git a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp index 44dd9722..cac8320c 100644 --- a/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp +++ b/kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp @@ -180,8 +180,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementVector( const auto& eta = *elfun[off_blk] * Psi; - const auto& phi = *elfun[blk] * Psi; - const auto& phin = this->u_old_[blk].GetValue(Tr, ip); vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { vaux_gf_at_ip.emplace_back(std::move(aux_gf.GetValue(Tr, ip))); @@ -213,7 +211,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementVector( // { int blk = 1; - int off_blk = 0; mfem::DenseMatrix gradPsi; mfem::Vector Psi, gradU; int nd = el[blk]->GetDof(); @@ -241,8 +238,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementVector( u_values[off_blk] = (*elfun[off_blk]) * Psi; u_values[off_blk + num_blocks] = this->u_old_[off_blk].GetValue(Tr, ip); } - const auto& phi = *elfun[off_blk] * Psi; - const auto& phin = this->u_old_[off_blk].GetValue(Tr, ip); const double coef_mob = this->compute_coefficient(mobility[blk], std::span(u_values), @@ -302,8 +297,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementGrad( const mfem::IntegrationPoint& ip = ir->IntPoint(i); el[blk]->CalcShape(ip, Psi); Tr.SetIntPoint(&ip); - const auto& phi = *elfun[blk] * Psi; - const auto& phin = this->u_old_[blk].GetValue(Tr, ip); // Get aux values at ip TODO(cci) (move in method) vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { @@ -375,7 +368,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementGrad( // Block 1 1 dR(eta)deta=dR(eta)dphi=d(M eta)/deta { int blk = 1; - int off_blk = 0; mfem::DenseMatrix gradPsi; mfem::Vector Psi, gradU; int nd = el[blk]->GetDof(); @@ -403,8 +395,6 @@ void BlockAllenCahnNLFormIntegrator::AssembleElementGrad( u_values[off_blk] = (*elfun[off_blk]) * Psi; u_values[off_blk + num_blocks] = this->u_old_[off_blk].GetValue(Tr, ip); } - const auto& phi = *elfun[off_blk] * Psi; - const auto& phin = this->u_old_[off_blk].GetValue(Tr, ip); const double coef_mob = -this->compute_coefficient(mobility[blk], std::span(u_values), std::span(vaux_gf_at_ip)) * diff --git a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp index a94c2b30..d89d921c 100644 --- a/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp +++ b/kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp @@ -210,8 +210,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementVector( Tr.SetIntPoint(&ip); const auto& mu = *elfun[off_blk] * Psi; - const auto& phi = *elfun[blk] * Psi; - const auto& phin = this->u_old_[blk].GetValue(Tr, ip); // Get aux values at ip TODO(cci) (move in method) vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { @@ -245,7 +243,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementVector( // { int blk = 1; - int off_blk = 0; mfem::DenseMatrix gradPsi; mfem::Vector Psi, gradU; int nd = el[blk]->GetDof(); @@ -263,8 +260,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementVector( el[blk]->CalcShape(ip, Psi); // Tr.SetIntPoint(&ip); - const auto& phi = *elfun[off_blk] * Psi; - const auto& phin = this->u_old_[off_blk].GetValue(Tr, ip); vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { vaux_gf_at_ip.emplace_back(std::move(aux_gf.GetValue(Tr, ip))); @@ -333,9 +328,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementGrad( el[blk]->CalcShape(ip, Psi); Tr.SetIntPoint(&ip); - const auto& phi = *elfun[blk] * Psi; - const auto& phin = this->u_old_[blk].GetValue(Tr, ip); - // Get aux values at ip TODO(cci) (move in method) vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { @@ -408,7 +400,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementGrad( // Block 1 1 dR(mu)dmu=dR(mu)dphi=d(div M grad mu)/dmu { int blk = 1; - int off_blk = 0; mfem::DenseMatrix gradPsi; mfem::Vector Psi, gradU; int nd = el[blk]->GetDof(); @@ -436,8 +427,6 @@ void CahnHilliardNLFormIntegrator::AssembleElementGrad( u_values[off_blk] = (*elfun[off_blk]) * Psi; u_values[off_blk + num_blocks] = this->u_old_[off_blk].GetValue(Tr, ip); } - const auto& phi = *elfun[off_blk] * Psi; - const auto& phin = this->u_old_[off_blk].GetValue(Tr, ip); const double coef_mob = this->compute_coefficient(mobility[blk], std::span(u_values), diff --git a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp index d7e52f10..83f81919 100644 --- a/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp +++ b/kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp @@ -164,8 +164,6 @@ void DiffusionFluxNLFormIntegrator::AssembleElementVector( el[blk]->CalcShape(ip, Psi); Tr.SetIntPoint(&ip); - const auto& u = *elfun[blk] * Psi; - const auto& un = this->u_old_[blk].GetValue(Tr, ip); // Get aux values at ip TODO(cci) (move in method) vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { @@ -238,8 +236,6 @@ void DiffusionFluxNLFormIntegrator::AssembleElementGrad( for (int i = 0; i < ir->GetNPoints(); i++) { const mfem::IntegrationPoint& ip = ir->IntPoint(i); el[blk]->CalcShape(ip, Psi); - const auto& u = *elfun[blk] * Psi; - const auto& un = this->u_old_[blk].GetValue(Tr, ip); // Get aux values at ip TODO(cci) (move in method) vaux_gf_at_ip.clear(); for (const auto& aux_gf : vaux_gf_) { diff --git a/kernel/include/Integrators/RobinNLFormIntegrator.hpp b/kernel/include/Integrators/RobinNLFormIntegrator.hpp index 939ece4f..72d70c71 100644 --- a/kernel/include/Integrators/RobinNLFormIntegrator.hpp +++ b/kernel/include/Integrators/RobinNLFormIntegrator.hpp @@ -52,8 +52,8 @@ class RobinNLFormIntegrator : public SlothNLFormIntegrator { protected: std::vector vaux_gf_; - const unsigned int bdr_id_ = 0; // Boundary id const unsigned int blk_ = 0; // Block to which apply Robin + const unsigned int bdr_id_ = 0; // Boundary id Coefficient robin_a; Coefficient robin_b; diff --git a/kernel/include/Integrators/RobinNLFormIntegrator.tpp b/kernel/include/Integrators/RobinNLFormIntegrator.tpp index 2f86e5cd..9d601736 100644 --- a/kernel/include/Integrators/RobinNLFormIntegrator.tpp +++ b/kernel/include/Integrators/RobinNLFormIntegrator.tpp @@ -157,7 +157,7 @@ void RobinNLFormIntegrator::AssembleElementVector( *elvect[blk] = 0.; // Add Robin on the right block - if (blk == blk_) { + if (blk == static_cast(blk_)) { const mfem::IntegrationRule* ir = &mfem::IntRules.Get(el[blk]->GetGeomType(), 2 * el[blk]->GetOrder() + Tr.OrderW()); @@ -225,7 +225,7 @@ void RobinNLFormIntegrator::AssembleElementGrad( *elmat(blk, blk) = 0.0; // Add Robin on the right block - if (blk == blk_) { + if (blk == static_cast(blk_)) { const mfem::IntegrationRule* ir = &mfem::IntRules.Get(el[blk]->GetGeomType(), 2 * el[blk]->GetOrder() + Tr.OrderW()); diff --git a/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp b/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp index 297b0112..8c90f45f 100644 --- a/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp +++ b/kernel/include/Integrators/TimeCHNLFormIntegrator.tpp @@ -312,7 +312,6 @@ void TimeCHNLFormIntegrator::AssembleElementGrad( Tr.SetIntPoint(&ip); el[blk]->CalcPhysShape(Tr, Psi); - const auto& phi = *elfun[blk] * Psi; // Get aux values at ip TODO(cci) (move in method) for (size_t k = 0; k < vaux_gf_.size(); ++k) { vaux_gf_at_ip[k] = vaux_gf_[k].GetValue(Tr, ip); diff --git a/kernel/include/Integrators/TimeNLFormIntegrator.tpp b/kernel/include/Integrators/TimeNLFormIntegrator.tpp index a4d54f7a..c7be183e 100644 --- a/kernel/include/Integrators/TimeNLFormIntegrator.tpp +++ b/kernel/include/Integrators/TimeNLFormIntegrator.tpp @@ -280,7 +280,6 @@ void TimeNLFormIntegrator::AssembleElementGrad( const mfem::IntegrationPoint& ip = ir->IntPoint(i); el[blk]->CalcShape(ip, Psi); Tr.SetIntPoint(&ip); - const auto& u = *elfun[blk] * Psi; // Get aux values at ip TODO(cci) (move in method) for (size_t k = 0; k < vaux_gf_.size(); ++k) { vaux_gf_at_ip[k] = vaux_gf_[k].GetValue(Tr, ip); diff --git a/kernel/include/Operators/OperatorBase.tpp b/kernel/include/Operators/OperatorBase.tpp index 5868ff8f..a6bee091 100644 --- a/kernel/include/Operators/OperatorBase.tpp +++ b/kernel/include/Operators/OperatorBase.tpp @@ -423,7 +423,7 @@ void OperatorBase::build_rhs_nonlinear_form(const std::vector