Skip to content

Commit

Permalink
Adapt modules to removal of libMesh namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud committed Oct 15, 2024
1 parent d07ade6 commit 11d9a09
Show file tree
Hide file tree
Showing 132 changed files with 261 additions and 159 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ share/
/modules/ray_tracing/unit/ray_tracing-unit.yaml
/modules/phase_field/unit/phase_field-unit.yaml
/modules/heat_transfer/unit/heat_transfer-unit.yaml
/modules/solid_mechanics/unit/solid_mechanics-unit.yaml
/modules/tensor_mechanics/unit/tensor_mechanics-unit.yaml
/modules/richards/unit/richards-unit.yaml
/modules/level_set/unit/level_set-unit.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ ChemicalCompositionAction::act()
auto aux_var_type = AddVariableAction::variableType(
FEType(Utility::string_to_enum<Order>(_problem->mesh().hasSecondOrderElements() ? "SECOND"
: "FIRST"),
Utility::string_to_enum<FEFamily>("LAGRANGE")),
Utility::string_to_enum<libMesh::FEFamily>("LAGRANGE")),
/* is_fv = */ getParam<bool>("is_fv"),
/* is_array = */ false);
auto params = _factory.getValidParams(aux_var_type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "CoupledConvectionReactionSub.h"

using libMesh::RealGradient;

registerMooseObject("ChemicalReactionsApp", CoupledConvectionReactionSub);

InputParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "CoupledDiffusionReactionSub.h"

using libMesh::RealGradient;

registerMooseObject("ChemicalReactionsApp", CoupledDiffusionReactionSub);

InputParameters
Expand Down
1 change: 1 addition & 0 deletions modules/fluid_properties/include/utils/BrentsMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

// MOOSE includes
#include "Moose.h"
#include "MooseTypes.h"

// C++ includes
#include <functional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UnobstructedPlanarViewFactor : public ViewFactorBase

///@{ data of the to_elem side being initialized
std::unique_ptr<const Elem> _current_remote_side;
std::unique_ptr<FEBase> _current_remote_fe;
std::unique_ptr<libMesh::FEBase> _current_remote_fe;
Real _current_remote_side_volume;
const std::vector<Real> * _current_remote_JxW;
const std::vector<Point> * _current_remote_xyz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ class ViewFactorRayStudy : public RayTracingStudy
const RayDataIndex _ray_index_start_total_weight;

/// Face FE used for creating face quadrature points and weights
const std::unique_ptr<FEBase> _fe_face;
const std::unique_ptr<libMesh::FEBase> _fe_face;
/// Face quadrature used for _fe_face
const std::unique_ptr<QBase> _q_face;
const std::unique_ptr<libMesh::QBase> _q_face;

// Whether or not the mesh is 3D
const bool _is_3d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ MortarGapHeatTransferAction::addMortarVariable()
mooseError("The mortar thermal action can only be used with LAGRANGE finite elements");

params.set<MooseEnum>("family") = Utility::enum_to_string<FEFamily>(primal_type.family);
params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(OrderWrapper{lm_order});
params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(libMesh::OrderWrapper{lm_order});

if (_user_provided_mortar_meshes)
params.set<std::vector<SubdomainName>>("block") = {
Expand Down
3 changes: 2 additions & 1 deletion modules/heat_transfer/src/actions/ThermalContactAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ ThermalContactAction::addMaterials()
void
ThermalContactAction::addSecondaryFluxVector()
{
_problem->getNonlinearSystemBase(/*nl_sys_num=*/0).addVector("secondary_flux", false, GHOSTED);
_problem->getNonlinearSystemBase(/*nl_sys_num=*/0)
.addVector("secondary_flux", false, libMesh::GHOSTED);
_problem->getNonlinearSystemBase(/*nl_sys_num=*/0).zeroVectorForResidual("secondary_flux");

// It is risky to apply this optimization to contact problems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ UnobstructedPlanarViewFactor::reinitFace(dof_id_type elem_id, unsigned int side)
Order order = current_remote_elem->default_order();
unsigned int dim = _mesh.getMesh().mesh_dimension();
_current_remote_fe = FEBase::build(dim, FEType(order));
QGauss qface(dim - 1, FEType(order).default_quadrature_order());
libMesh::QGauss qface(dim - 1, FEType(order).default_quadrature_order());
_current_remote_fe->attach_quadrature_rule(&qface);

_current_remote_JxW = &_current_remote_fe->get_JxW();
Expand Down
4 changes: 3 additions & 1 deletion modules/heat_transfer/src/userobjects/ViewFactorRayStudy.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "ReflectRayBC.h"
#include "RayTracingPackingUtils.h"

using namespace libMesh;

registerMooseObject("HeatTransferApp", ViewFactorRayStudy);

InputParameters
Expand Down Expand Up @@ -441,7 +443,7 @@ ViewFactorRayStudy::generateStartElems()
continue;

// Sanity check on QGRID not working on some types
if (_q_face->type() == QGRID && elem->type() == TET4)
if (_q_face->type() == libMesh::QGRID && elem->type() == TET4)
mooseError(
"Cannot use GRID quadrature type with tetrahedral elements in ViewFactorRayStudy '",
_name,
Expand Down
3 changes: 2 additions & 1 deletion modules/level_set/src/userobjects/LevelSetOlssonTerminator.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ LevelSetOlssonTerminator::validParams()

LevelSetOlssonTerminator::LevelSetOlssonTerminator(const InputParameters & params)
: GeneralUserObject(params),
_solution_diff(_fe_problem.getNonlinearSystem(0).addVector("solution_diff", false, PARALLEL)),
_solution_diff(
_fe_problem.getNonlinearSystem(0).addVector("solution_diff", false, libMesh::PARALLEL)),
_tol(getParam<Real>("tol")),
_min_t_steps(getParam<int>("min_steps"))
{
Expand Down
2 changes: 1 addition & 1 deletion modules/navier_stokes/include/actions/CNSAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class CNSAction : public Action
/// Pressures on static pressure boundaries
std::vector<Real> _static_pressure;
/// FE type for various variables
FEType _fe_type;
libMesh::FEType _fe_type;
/// Initial value for pressure
Real _initial_pressure;
/// Initial value for temperature
Expand Down
2 changes: 1 addition & 1 deletion modules/navier_stokes/include/actions/INSAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class INSAction : public Action
/// Temperature function names at fixed temperature boundaries
std::vector<FunctionName> _temperature_function;
/// FE type for various variables
FEType _fe_type;
libMesh::FEType _fe_type;
/// Whether we use AD or not
bool _use_ad;
/// Temperature variable name to facilitate temperature variable added outside
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SIMPLENonlinearAssembly : public SegregatedSolverBase
std::pair<unsigned int, Real> solveAdvectedSystem(const unsigned int system_num,
NonlinearSystemBase & system,
const Real relaxation_factor,
SolverConfiguration & solver_config,
libMesh::SolverConfiguration & solver_config,
const Real abs_tol);

/// Solve the solid energy conservation equation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FVConvectionCorrelationInterface : public FVInterfaceKernel
const bool _use_wall_cell;

/// libmesh object to find points in the mesh
std::unique_ptr<PointLocatorBase> _pl;
std::unique_ptr<libMesh::PointLocatorBase> _pl;

/// Boolean to see if variable1 is the fluid
const bool _var1_is_fluid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class INSFVRhieChowInterpolatorSegregated : public RhieChowInterpolatorBase
std::vector<unsigned int> _momentum_system_numbers;

/// Pointers to the momentum equation implicit system(s)
std::vector<NonlinearImplicitSystem *> _momentum_implicit_systems;
std::vector<libMesh::NonlinearImplicitSystem *> _momentum_implicit_systems;

/// Residual tag corresponding to the pressure gradient contribution
TagID _pressure_gradient_tag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class RhieChowMassFlux : public GeneralUserObject,
std::vector<unsigned int> _global_momentum_system_numbers;

/// Pointers to the momentum equation implicit system(s) from libmesh
std::vector<LinearImplicitSystem *> _momentum_implicit_systems;
std::vector<libMesh::LinearImplicitSystem *> _momentum_implicit_systems;

/// Pointer to the pressure system
const LinearSystem * _pressure_system;
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/actions/CNSAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "libmesh/vector_value.h"
#include "libmesh/string_to_enum.h"

using namespace libMesh;

registerMooseAction("NavierStokesApp", CNSAction, "add_navier_stokes_variables");
registerMooseAction("NavierStokesApp", CNSAction, "add_navier_stokes_kernels");
registerMooseAction("NavierStokesApp", CNSAction, "add_navier_stokes_bcs");
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/actions/INSAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "libmesh/vector_value.h"
#include "libmesh/string_to_enum.h"

using namespace libMesh;

registerMooseAction("NavierStokesApp", INSAction, "append_mesh_generator");
registerMooseAction("NavierStokesApp", INSAction, "add_navier_stokes_variables");
registerMooseAction("NavierStokesApp", INSAction, "add_navier_stokes_ics");
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/executioners/SIMPLE.C
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <petscsys.h>
#include <petscksp.h>

using namespace libMesh;

registerMooseObject("NavierStokesApp", SIMPLE);

InputParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <petscsys.h>
#include <petscksp.h>

using namespace libMesh;

registerMooseObject("NavierStokesApp", SIMPLENonlinearAssembly);

InputParameters
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/executioners/SegregatedSolverBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <petscsys.h>
#include <petscksp.h>

using namespace libMesh;

InputParameters
SegregatedSolverBase::validParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ INSFVMushyPorousFrictionFunctorMaterial::INSFVMushyPorousFrictionFunctorMaterial
mooseAssert(_dendrite_spacing_scaling(r, t) > 0,
"Dendrite spacing scaling should be positive!");
const auto cs = _c / Utility::pow<2>(_dendrite_spacing_scaling(r, t));
const auto Fk = 0.5 + std::atan(_s * (fs - _fs_crit)) / pi;
const auto Fk = 0.5 + std::atan(_s * (fs - _fs_crit)) / libMesh::pi;
const auto K =
Utility::pow<3>(_fl(r, t)) / ((Utility::pow<2>(fs) + epsilon) * Fk * cs) + epsilon;
return _mu(r, t) / K;
Expand All @@ -70,7 +70,7 @@ INSFVMushyPorousFrictionFunctorMaterial::INSFVMushyPorousFrictionFunctorMaterial
mooseAssert(_dendrite_spacing_scaling(r, t) > 0,
"Dendrite spacing scaling should be positive!");
const auto cs = _c / Utility::pow<2>(_dendrite_spacing_scaling(r, t));
const auto Fk = 0.5 + std::atan(_s * (fs - _fs_crit)) / pi;
const auto Fk = 0.5 + std::atan(_s * (fs - _fs_crit)) / libMesh::pi;
const auto K =
Utility::pow<3>(_fl(r, t)) / ((Utility::pow<2>(fs) + epsilon) * Fk * cs) + epsilon;
return _forchheimer_coef * _rho_l(r, t) / std::sqrt(K);
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/problems/NavierStokesProblem.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "NonlinearSystemBase.h"
#include "libmesh/petsc_matrix.h"

using namespace libMesh;

registerMooseObject("NavierStokesApp", NavierStokesProblem);

InputParameters
Expand Down
2 changes: 2 additions & 0 deletions modules/navier_stokes/src/utils/FaceCenteredMapFunctor.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "libmesh/elem.h"
#include "libmesh/point.h"

using namespace libMesh;

namespace Moose
{
template <typename T, typename T2, typename std::enable_if<ScalarTraits<T>::value, int>::type = 0>
Expand Down
17 changes: 10 additions & 7 deletions modules/optimization/include/utils/ParameterMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace libMesh
{
class System;
}

using libMesh::RealGradient;

/**
* Utility class to use an Exodus mesh to define controllable parameters for optimization problems
* This class will:
Expand All @@ -34,7 +37,7 @@ class System;
class ParameterMesh
{
public:
ParameterMesh(const FEType & param_type,
ParameterMesh(const libMesh::FEType & param_type,
const std::string & exodus_mesh,
const std::vector<std::string> & var_names = {});

Expand Down Expand Up @@ -72,12 +75,12 @@ class ParameterMesh
std::vector<Real> getParameterValues(std::string var_name, unsigned int timestep) const;

protected:
Parallel::Communicator _communicator;
ReplicatedMesh _mesh;
std::unique_ptr<EquationSystems> _eq;
System * _sys;
std::unique_ptr<PointLocatorBase> _point_locator;
std::unique_ptr<ExodusII_IO> _exodusII_io;
libMesh::Parallel::Communicator _communicator;
libMesh::ReplicatedMesh _mesh;
std::unique_ptr<libMesh::EquationSystems> _eq;
libMesh::System * _sys;
std::unique_ptr<libMesh::PointLocatorBase> _point_locator;
std::unique_ptr<libMesh::ExodusII_IO> _exodusII_io;

dof_id_type _param_dofs;
};
2 changes: 2 additions & 0 deletions modules/optimization/src/executioners/AdjointSolve.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "libmesh/petsc_vector.h"
#include "petscmat.h"

using namespace libMesh;

InputParameters
AdjointSolve::validParams()
{
Expand Down
2 changes: 2 additions & 0 deletions modules/optimization/src/executioners/AdjointTransientSolve.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "libmesh/sparse_matrix.h"
#include "libmesh/numeric_vector.h"

using namespace libMesh;

InputParameters
AdjointTransientSolve::validParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "ParameterMesh.h"
#include "libmesh/string_to_enum.h"

using namespace libMesh;

registerMooseObject("OptimizationApp", ParameterMeshOptimization);

InputParameters
Expand Down
2 changes: 2 additions & 0 deletions modules/optimization/src/utils/ParameterMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "libmesh/numeric_vector.h"
#include "libmesh/explicit_system.h"

using namespace libMesh;

ParameterMesh::ParameterMesh(const FEType & param_type,
const std::string & exodus_mesh,
const std::vector<std::string> & var_names)
Expand Down
2 changes: 1 addition & 1 deletion modules/phase_field/include/actions/ConservedAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ConservedAction : public Action
/// Name of the variable being created
const NonlinearVariableName _var_name;
/// FEType for the variable being created
FEType _fe_type;
libMesh::FEType _fe_type;
/// Scaling parameter
const Real _scaling;
};
2 changes: 1 addition & 1 deletion modules/phase_field/include/actions/GrainGrowthAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GrainGrowthAction : public Action
const std::string _var_name_base;

/// FEType for the variable being created
const FEType _fe_type;
const libMesh::FEType _fe_type;

/// Take initial values from file?
const bool _initial_from_file;
Expand Down
2 changes: 1 addition & 1 deletion modules/phase_field/include/actions/NonconservedAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ class NonconservedAction : public Action
/// Name of the variable being created
const NonlinearVariableName _var_name;
/// FEType for the variable being created
const FEType _fe_type;
const libMesh::FEType _fe_type;
};
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,9 @@ class FeatureFloodCount : public GeneralPostprocessor,
std::vector<std::size_t> _feature_id_to_local_index;

/// A pointer to the periodic boundary constraints object
PeriodicBoundaries * _pbs;
libMesh::PeriodicBoundaries * _pbs;

std::unique_ptr<PointLocatorBase> _point_locator;
std::unique_ptr<libMesh::PointLocatorBase> _point_locator;

/// Average value of the domain which can optionally be used to find features in a field
const PostprocessorValue & _element_average_value;
Expand Down
6 changes: 3 additions & 3 deletions modules/phase_field/include/utils/PolycrystalICTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ unsigned int assignPointToGrain(const Point & p,
AdjacencyMatrix<Real>
buildGrainAdjacencyMatrix(const std::map<dof_id_type, unsigned int> & entity_to_grain,
MooseMesh & mesh,
const PeriodicBoundaries * pb,
const libMesh::PeriodicBoundaries * pb,
unsigned int n_grains,
bool is_elemental);

AdjacencyMatrix<Real>
buildElementalGrainAdjacencyMatrix(const std::map<dof_id_type, unsigned int> & element_to_grain,
MooseMesh & mesh,
const PeriodicBoundaries * pb,
const libMesh::PeriodicBoundaries * pb,
unsigned int n_grains);

AdjacencyMatrix<Real>
buildNodalGrainAdjacencyMatrix(const std::map<dof_id_type, unsigned int> & node_to_grain,
MooseMesh & mesh,
const PeriodicBoundaries * pb,
const libMesh::PeriodicBoundaries * pb,
unsigned int n_grains);

std::vector<unsigned int> assignOpsToGrains(AdjacencyMatrix<Real> & adjacency_matrix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include "libmesh/string_to_enum.h"

using namespace libMesh;

registerMooseAction("PhaseFieldApp", CHPFCRFFSplitVariablesAction, "add_variable");

InputParameters
Expand Down
Loading

0 comments on commit 11d9a09

Please sign in to comment.