Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
===========
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)]()
Expand Down
6 changes: 3 additions & 3 deletions doc/Doxyfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
19 changes: 9 additions & 10 deletions kernel/include/Coefficients/MfemCoefficient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@

class MfemCoefficient : public mfem::Coefficient {
private:
int id_ = 0;
Coefficients sloth_coefficient_;

const mfem::ParGridFunction &gf_;
const std::vector<mfem::ParGridFunction> &vaux_gf_;
const mfem::ParGridFunction& gf_;
const std::vector<mfem::ParGridFunction>& vaux_gf_;

mutable std::vector<double> vaux_gf_at_ip_;
int id_ = 0;

public:
MfemCoefficient(int id, const Coefficients &coef, const mfem::ParGridFunction &vun,
const std::vector<mfem::ParGridFunction> &vauxn);
double Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override;
MfemCoefficient(int id, const Coefficients& coef, const mfem::ParGridFunction& vun,
const std::vector<mfem::ParGridFunction>& vauxn);
double Eval(mfem::ElementTransformation& T, const mfem::IntegrationPoint& ip) override;
virtual ~MfemCoefficient() = default;
};

Expand All @@ -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<mfem::ParGridFunction> &vauxn)
MfemCoefficient::MfemCoefficient(int id, const Coefficients& coef, const mfem::ParGridFunction& vun,
const std::vector<mfem::ParGridFunction>& vauxn)
: id_(id), sloth_coefficient_(coef), gf_(vun), vaux_gf_(vauxn) {}

/**
Expand All @@ -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();
}
Expand Down
10 changes: 0 additions & 10 deletions kernel/include/Integrators/BlockAllenCahnNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::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)));
Expand Down Expand Up @@ -213,7 +211,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::AssembleElementVector(
//
{
int blk = 1;
int off_blk = 0;
mfem::DenseMatrix gradPsi;
mfem::Vector Psi, gradU;
int nd = el[blk]->GetDof();
Expand Down Expand Up @@ -241,8 +238,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::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<const double>(u_values),
Expand Down Expand Up @@ -302,8 +297,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::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_) {
Expand Down Expand Up @@ -375,7 +368,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::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();
Expand Down Expand Up @@ -403,8 +395,6 @@ void BlockAllenCahnNLFormIntegrator<VARS>::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<const double>(u_values),
std::span<const double>(vaux_gf_at_ip)) *
Expand Down
11 changes: 0 additions & 11 deletions kernel/include/Integrators/CahnHilliardNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ void CahnHilliardNLFormIntegrator<VARS>::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_) {
Expand Down Expand Up @@ -245,7 +243,6 @@ void CahnHilliardNLFormIntegrator<VARS>::AssembleElementVector(
//
{
int blk = 1;
int off_blk = 0;
mfem::DenseMatrix gradPsi;
mfem::Vector Psi, gradU;
int nd = el[blk]->GetDof();
Expand All @@ -263,8 +260,6 @@ void CahnHilliardNLFormIntegrator<VARS>::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)));
Expand Down Expand Up @@ -333,9 +328,6 @@ void CahnHilliardNLFormIntegrator<VARS>::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_) {
Expand Down Expand Up @@ -408,7 +400,6 @@ void CahnHilliardNLFormIntegrator<VARS>::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();
Expand Down Expand Up @@ -436,8 +427,6 @@ void CahnHilliardNLFormIntegrator<VARS>::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<const double>(u_values),
Expand Down
4 changes: 0 additions & 4 deletions kernel/include/Integrators/DiffusionFluxNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ void DiffusionFluxNLFormIntegrator<VARS>::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_) {
Expand Down Expand Up @@ -238,8 +236,6 @@ void DiffusionFluxNLFormIntegrator<VARS>::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_) {
Expand Down
2 changes: 1 addition & 1 deletion kernel/include/Integrators/RobinNLFormIntegrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class RobinNLFormIntegrator : public SlothNLFormIntegrator<VARS> {

protected:
std::vector<mfem::ParGridFunction> 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;

Expand Down
4 changes: 2 additions & 2 deletions kernel/include/Integrators/RobinNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void RobinNLFormIntegrator<VARS>::AssembleElementVector(
*elvect[blk] = 0.;

// Add Robin on the right block
if (blk == blk_) {
if (blk == static_cast<int>(blk_)) {
const mfem::IntegrationRule* ir =
&mfem::IntRules.Get(el[blk]->GetGeomType(), 2 * el[blk]->GetOrder() + Tr.OrderW());

Expand Down Expand Up @@ -225,7 +225,7 @@ void RobinNLFormIntegrator<VARS>::AssembleElementGrad(
*elmat(blk, blk) = 0.0;

// Add Robin on the right block
if (blk == blk_) {
if (blk == static_cast<int>(blk_)) {
const mfem::IntegrationRule* ir =
&mfem::IntRules.Get(el[blk]->GetGeomType(), 2 * el[blk]->GetOrder() + Tr.OrderW());

Expand Down
1 change: 0 additions & 1 deletion kernel/include/Integrators/TimeCHNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ void TimeCHNLFormIntegrator<VARS>::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);
Expand Down
1 change: 0 additions & 1 deletion kernel/include/Integrators/TimeNLFormIntegrator.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ void TimeNLFormIntegrator<VARS>::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);
Expand Down
2 changes: 1 addition & 1 deletion kernel/include/Operators/OperatorBase.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void OperatorBase<T, DIM>::build_rhs_nonlinear_form(const std::vector<mfem::Vect
// Check if a coefficient is given for this bc
// (else Homogeneous Neumann)
bool has_neumann_coeff = false;
for (unsigned int l = 0; l < coef_size; l++) {
for (int l = 0; l < coef_size; l++) {
auto coef = coefficients[l];
if (coef.get_type() == GlossaryType::Neumann) {
auto bdr_ids = coef.get_bdr_index_coef();
Expand Down
12 changes: 6 additions & 6 deletions spack_repo/packages/sloth/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ class Sloth(CMakePackage):
homepage = "https://github.com/Collab4Sloth/SLOTH"
url = "https://github.com/Collab4Sloth/SLOTH.git"

version("master", git='https://github.com/Collab4Sloth/SLOTH.git', branch='master', preferred=True)
version("1.0.0", tag='v1.0.0')
version("2.0.0", tag='v2.0.0', preferred=True)
version("master", git='https://github.com/Collab4Sloth/SLOTH.git', branch='master')

variant('petsc' , default=False , description='Enable PETSc solvers, preconditioners, etc.')
variant('shared' , default=False , description='Enable Building MFEM with dynamic libraries.')

depends_on('hypre+int64', when='+petsc')
depends_on('petsc+int64', when='+petsc')

depends_on('hypre@2.33.0 +shared')
depends_on('mfem@4.8.0 +mpi+suite-sparse +sundials +superlu-dist +miniapps')
depends_on('hypre@3.1.0 +shared')
depends_on('mfem@4.9.0 +mpi+suite-sparse +sundials +superlu-dist +miniapps')

depends_on('mfem@4.8.0:+petsc', when='+petsc')
depends_on('mfem@4.8.0:+shared', when='+shared')
depends_on('mfem@4.9.0:+petsc', when='+petsc')
depends_on('mfem@4.9.0:+shared', when='+shared')
depends_on('cmake', type='build')

def setup_build_environment(self, env):
Expand Down
Loading