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 14, 2024
1 parent 8f0543a commit 8018a7f
Show file tree
Hide file tree
Showing 60 changed files with 125 additions and 69 deletions.
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 @@ -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
2 changes: 1 addition & 1 deletion modules/heat_transfer/src/userobjects/ViewFactorRayStudy.C
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,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
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
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
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
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/ray_tracing/include/outputs/RayTracingMeshOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RayTracingMeshOutput : public FileOutput, public UserObjectInterface
/// The EquationSystems
std::unique_ptr<EquationSystems> _es;
/// The system that stores the field data
ExplicitSystem * _sys;
libMesh::ExplicitSystem * _sys;

private:
/**
Expand Down
8 changes: 4 additions & 4 deletions modules/ray_tracing/include/raytracing/ClaimRays.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MooseMesh;
/**
* Helper object for claiming Rays
*/
class ClaimRays : public ParallelObject, public MeshChangedInterface
class ClaimRays : public libMesh::ParallelObject, public MeshChangedInterface
{
public:
/**
Expand Down Expand Up @@ -101,7 +101,7 @@ class ClaimRays : public ParallelObject, public MeshChangedInterface
/**
* Get the inflated bounding box for rank \pid.
*/
const BoundingBox & inflatedBoundingBox(const processor_id_type pid) const
const libMesh::BoundingBox & inflatedBoundingBox(const processor_id_type pid) const
{
return _inflated_bboxes[pid];
}
Expand Down Expand Up @@ -159,10 +159,10 @@ class ClaimRays : public ParallelObject, public MeshChangedInterface
std::vector<std::shared_ptr<Ray>> & _local_rays;

/// The point locator
std::unique_ptr<PointLocatorBase> _point_locator = nullptr;
std::unique_ptr<libMesh::PointLocatorBase> _point_locator = nullptr;

/// The inflated bounding boxes for all processors
std::vector<BoundingBox> _inflated_bboxes;
std::vector<libMesh::BoundingBox> _inflated_bboxes;

/// Map of point neighbors for each element
std::unordered_map<dof_id_type, std::vector<const Elem *>> _elem_point_neighbors;
Expand Down
2 changes: 1 addition & 1 deletion modules/ray_tracing/include/raytracing/TraceRay.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class TraceRay
std::vector<unsigned long long int> _results;

/// Helper for building element sides without excessive allocation
ElemSideBuilder _elem_side_builder;
libMesh::ElemSideBuilder _elem_side_builder;

/// Reusable for getting the RayBCs in onBoundary()
std::vector<RayBoundaryConditionBase *> _on_boundary_ray_bcs;
Expand Down
18 changes: 10 additions & 8 deletions modules/ray_tracing/include/raytracing/TraceRayTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// MOOSE includes
#include "StaticallyAllocatedSet.h"
#include "Conversion.h"
#include "MooseTypes.h"
#include "libMeshReducedNamespace.h"

// Local includes
#include "DebugRay.h"
Expand Down Expand Up @@ -558,7 +560,7 @@ bool intersectQuad(const Point & start,
* @return Whether or not the line segment intersected with the face
*/
template <typename T>
typename std::enable_if<std::is_base_of<Face, T>::value, bool>::type
typename std::enable_if<std::is_base_of<libMesh::Face, T>::value, bool>::type
sideIntersectedByLine(const Elem * elem,
const Point & start_point,
const Point & direction,
Expand Down Expand Up @@ -732,7 +734,7 @@ sideIntersectedByLine(const Elem * elem,
* @return Whether or not the line segment intersected with the face
*/
template <typename T>
typename std::enable_if<std::is_base_of<Pyramid, T>::value, bool>::type
typename std::enable_if<std::is_base_of<libMesh::Pyramid, T>::value, bool>::type
sideIntersectedByLine(const Elem * elem,
const Point & start_point,
const Point & direction,
Expand Down Expand Up @@ -803,7 +805,7 @@ sideIntersectedByLine(const Elem * elem,
* @return Whether or not the line segment intersected with the face
*/
template <typename T>
typename std::enable_if<std::is_base_of<Prism, T>::value, bool>::type
typename std::enable_if<std::is_base_of<libMesh::Prism, T>::value, bool>::type
sideIntersectedByLine(const Elem * elem,
const Point & start_point,
const Point & direction,
Expand Down Expand Up @@ -889,8 +891,8 @@ unsigned short atVertexOnSide(const Elem * elem, const Point & point, const unsi
* Returns the number of nodes on a side for an Elem that is not a Pyramid or Prism.
*/
template <typename T>
inline typename std::enable_if<!std::is_base_of<Pyramid, T>::value &&
!std::is_base_of<Prism, T>::value,
inline typename std::enable_if<!std::is_base_of<libMesh::Pyramid, T>::value &&
!std::is_base_of<libMesh::Prism, T>::value,
unsigned short>::type
nodesPerSide(const unsigned short)
{
Expand All @@ -911,7 +913,7 @@ nodesPerSide(const unsigned short side)
* Returns the number of nodes on a side on a Prism elem.
*/
template <typename T>
inline typename std::enable_if<std::is_base_of<Prism, T>::value, unsigned short>::type
inline typename std::enable_if<std::is_base_of<libMesh::Prism, T>::value, unsigned short>::type
nodesPerSide(const unsigned short side)
{
return T::nodes_per_side - (side == 0 || side == 4);
Expand Down Expand Up @@ -1029,7 +1031,7 @@ bool withinExtremaOnSide(const Elem * const elem,
* @return If the point is within an edge on the side of the element
*/
template <typename T>
typename std::enable_if<std::is_base_of<Cell, T>::value, bool>::type withinEdgeOnSideTempl(
typename std::enable_if<std::is_base_of<libMesh::Cell, T>::value, bool>::type withinEdgeOnSideTempl(
const Elem * const elem, const Point & point, const unsigned short side, ElemExtrema & extrema);

/**
Expand All @@ -1039,7 +1041,7 @@ typename std::enable_if<std::is_base_of<Cell, T>::value, bool>::type withinEdgeO
* edges, therefore this function errors.
*/
template <typename T>
typename std::enable_if<!std::is_base_of<Cell, T>::value, bool>::type
typename std::enable_if<!std::is_base_of<libMesh::Cell, T>::value, bool>::type
withinEdgeOnSideTempl(const Elem * const, const Point &, const unsigned short, ElemExtrema &)
{
mooseError("Should not call withinEdgeOnSideTempl() with a non-Cell derived Elem");
Expand Down
12 changes: 6 additions & 6 deletions modules/ray_tracing/include/userobjects/RayTracingStudy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ class RayTracingStudy : public GeneralUserObject
RayID registerRay(const std::string & name);

/// Threaded helpers for building element sides without extraneous allocation
std::vector<ElemSideBuilder> _threaded_elem_side_builders;
std::vector<libMesh::ElemSideBuilder> _threaded_elem_side_builders;

/// Timing
//@{
Expand Down Expand Up @@ -1057,9 +1057,9 @@ class RayTracingStudy : public GeneralUserObject
bool _has_same_level_active_elems;

/// Nodal bounding box for the domain
BoundingBox _b_box;
libMesh::BoundingBox _b_box;
/// Loose nodal bounding box for the domain
BoundingBox _loose_b_box;
libMesh::BoundingBox _loose_b_box;
/// An inflated max distance for the domain
Real _domain_max_length;
/// The total volume of the domain
Expand All @@ -1076,9 +1076,9 @@ class RayTracingStudy : public GeneralUserObject
/// The TraceRay objects for each thread (they do the physical tracing)
std::vector<std::shared_ptr<TraceRay>> _threaded_trace_ray;
/// Face FE used for computing face normals for each thread
std::vector<std::unique_ptr<FEBase>> _threaded_fe_face;
std::vector<std::unique_ptr<libMesh::FEBase>> _threaded_fe_face;
/// Face quadrature used for computing face normals for each thread
std::vector<std::unique_ptr<QBase>> _threaded_q_face;
std::vector<std::unique_ptr<libMesh::QBase>> _threaded_q_face;
/// Threaded cache for side normals that have been computed already during tracing
std::vector<std::unordered_map<std::pair<const Elem *, unsigned short>, Point>>
_threaded_cached_normals;
Expand All @@ -1093,7 +1093,7 @@ class RayTracingStudy : public GeneralUserObject
const std::unique_ptr<ParallelRayStudy> _parallel_ray_study;

/// Quadrature rule for laying points across a 1D ray segment
std::unique_ptr<QBase> _segment_qrule;
std::unique_ptr<libMesh::QBase> _segment_qrule;

/// Total number of processor crossings for Rays that finished on this processor
unsigned long long int _ending_processor_crossings;
Expand Down
Loading

0 comments on commit 8018a7f

Please sign in to comment.