Skip to content

Commit

Permalink
Remove libMesh namespace from framework source:
Browse files Browse the repository at this point in the history
- heavily rely on using namespace libMesh
- for some files, add libMesh:: everywhere
refs idaholab#28499
  • Loading branch information
GiudGiud committed Oct 15, 2024
1 parent 5a2bf63 commit 8c77099
Show file tree
Hide file tree
Showing 131 changed files with 291 additions and 94 deletions.
2 changes: 2 additions & 0 deletions framework/src/actions/AdaptivityAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "libmesh/system_norm.h"
#include "libmesh/enum_norm_type.h"

using namespace libMesh;

registerMooseAction("MooseApp", AdaptivityAction, "setup_adaptivity");
registerMooseAction("MooseApp", AdaptivityAction, "add_geometric_rm");
registerMooseAction("MooseApp", AdaptivityAction, "add_algebraic_rm");
Expand Down
2 changes: 1 addition & 1 deletion framework/src/actions/AddAuxVariableAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ AddAuxVariableAction::init()
{
AddVariableAction::init();

if (_fe_type.order > NINTH && !_scalar_var)
if (_fe_type.order > libMesh::NINTH && !_scalar_var)
mooseError("Non-scalar AuxVariables must be CONSTANT, FIRST, SECOND, THIRD, FOURTH, FIFTH, "
"SIXTH, SEVENTH, EIGHTH or NINTH order (",
_fe_type.order,
Expand Down
4 changes: 2 additions & 2 deletions framework/src/actions/AddBoundsVectorsAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ AddBoundsVectorsAction::act()
if (!_problem->numNonlinearSystems() && _problem->numLinearSystems())
mooseError("Vector bounds cannot be used with only LinearSystems!");

_problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("lower_bound", false, GHOSTED);
_problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("upper_bound", false, GHOSTED);
_problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("lower_bound", false, libMesh::GHOSTED);
_problem->getNonlinearSystemBase(/*nl_sys=*/0).addVector("upper_bound", false, libMesh::GHOSTED);
}
2 changes: 1 addition & 1 deletion framework/src/actions/AddElementalFieldAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ AddElementalFieldAction::init()
_moose_object_pars.set<MooseEnum>("order") = "CONSTANT";
_moose_object_pars.set<MooseEnum>("family") = "MONOMIAL";

_fe_type = FEType(CONSTANT, MONOMIAL);
_fe_type = libMesh::FEType(CONSTANT, MONOMIAL);

_type = "MooseVariableConstMonomial";

Expand Down
4 changes: 2 additions & 2 deletions framework/src/actions/AddNodalNormalsAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include "libmesh/fe.h"
#include "libmesh/string_to_enum.h"

registerMooseAction("MooseApp", AddNodalNormalsAction, "add_aux_variable");
using namespace libMesh;

registerMooseAction("MooseApp", AddNodalNormalsAction, "add_aux_variable");
registerMooseAction("MooseApp", AddNodalNormalsAction, "add_postprocessor");

registerMooseAction("MooseApp", AddNodalNormalsAction, "add_user_object");

InputParameters
Expand Down
4 changes: 3 additions & 1 deletion framework/src/actions/AddPeriodicBCAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "libmesh/periodic_boundary.h" // translation PBCs provided by libmesh

using namespace libMesh;

registerMooseAction("MooseApp", AddPeriodicBCAction, "add_periodic_bc");
registerMooseAction("MooseApp", AddPeriodicBCAction, "add_geometric_rm");
registerMooseAction("MooseApp", AddPeriodicBCAction, "add_algebraic_rm");
Expand Down Expand Up @@ -57,7 +59,7 @@ AddPeriodicBCAction::AddPeriodicBCAction(const InputParameters & params)
}

void
AddPeriodicBCAction::setPeriodicVars(PeriodicBoundaryBase & p,
AddPeriodicBCAction::setPeriodicVars(libMesh::PeriodicBoundaryBase & p,
const std::vector<VariableName> & var_names)
{
NonlinearSystemBase & nl = _problem->getNonlinearSystemBase(/*nl_sys_num=*/0);
Expand Down
2 changes: 2 additions & 0 deletions framework/src/actions/AddVariableAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "libmesh/string_to_enum.h"
#include "libmesh/fe_interface.h"

using namespace libMesh;

registerMooseAction("MooseApp", AddVariableAction, "add_variable");

InputParameters
Expand Down
2 changes: 2 additions & 0 deletions framework/src/actions/MeshOnlyAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "libmesh/exodusII_io_helper.h"
#include "libmesh/checkpoint_io.h"

using namespace libMesh;

registerMooseAction("MooseApp", MeshOnlyAction, "mesh_only");

InputParameters
Expand Down
2 changes: 2 additions & 0 deletions framework/src/actions/SetupDebugAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "MooseUtils.h"
#include "BlockRestrictionDebugOutput.h"

using namespace libMesh;

registerMooseAction("MooseApp", SetupDebugAction, "add_output");

InputParameters
Expand Down
2 changes: 1 addition & 1 deletion framework/src/actions/SetupQuadratureAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SetupQuadratureAction::validParams()

SetupQuadratureAction::SetupQuadratureAction(const InputParameters & parameters)
: Action(parameters),
_type(Moose::stringToEnum<QuadratureType>(getParam<MooseEnum>("type"))),
_type(Moose::stringToEnum<libMesh::QuadratureType>(getParam<MooseEnum>("type"))),
_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("order"))),
_element_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("element_order"))),
_side_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("side_order"))),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/auxkernels/ElementLpNormAux.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ElementLpNormAux::validParams()
ElementLpNormAux::ElementLpNormAux(const InputParameters & parameters)
: AuxKernel(parameters), _p(getParam<Real>("p")), _coupled_var(coupledValue("coupled_variable"))
{
if (mooseVariableBase()->feType() != FEType(CONSTANT, MONOMIAL))
if (mooseVariableBase()->feType() != libMesh::FEType(CONSTANT, MONOMIAL))
paramError("variable", "Must be of type CONSTANT MONOMIAL");
}

Expand Down
2 changes: 1 addition & 1 deletion framework/src/auxkernels/VolumeAux.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VolumeAux::validParams()

VolumeAux::VolumeAux(const InputParameters & parameters) : AuxKernel(parameters)
{
if (mooseVariableBase()->feType() != FEType(CONSTANT, MONOMIAL))
if (mooseVariableBase()->feType() != libMesh::FEType(CONSTANT, MONOMIAL))
paramError("variable", "Must be of type CONSTANT MONOMIAL");
}

Expand Down
2 changes: 2 additions & 0 deletions framework/src/base/Adaptivity.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "libmesh/error_vector.h"
#include "libmesh/distributed_mesh.h"

using namespace libMesh;

#ifdef LIBMESH_ENABLE_AMR

Adaptivity::Adaptivity(FEProblemBase & fe_problem)
Expand Down
2 changes: 2 additions & 0 deletions framework/src/base/Assembly.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include "libmesh/vector_value.h"
#include "libmesh/fe.h"

using namespace libMesh;

template <typename P, typename C>
void
coordTransformFactor(const SubProblem & s,
Expand Down
2 changes: 2 additions & 0 deletions framework/src/base/MeshGeneratorSystem.C
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include "libmesh/mesh_tools.h"

using namespace libMesh;

const std::string MeshGeneratorSystem::data_driven_generator_param = "data_driven_generator";
const std::string MeshGeneratorSystem::allow_data_driven_param =
"allow_data_driven_mesh_generation";
Expand Down
2 changes: 2 additions & 0 deletions framework/src/base/MooseApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
#include <chrono>
#include <thread>

using namespace libMesh;

#define QUOTE(macro) stringifyName(macro)

void
Expand Down
2 changes: 2 additions & 0 deletions framework/src/base/MooseError.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "libmesh/string_to_enum.h"

using namespace libMesh;

namespace moose
{

Expand Down
4 changes: 4 additions & 0 deletions framework/src/constraints/AutomaticMortarGeneration.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include "libmesh/edge_edge2.h"
#include "libmesh/edge_edge3.h"
#include "libmesh/face_tri3.h"
#include "libmesh/face_tri6.h"
#include "libmesh/face_tri7.h"
#include "libmesh/face_quad4.h"
#include "libmesh/face_quad8.h"
#include "libmesh/face_quad9.h"
#include "libmesh/exodusII_io.h"
#include "libmesh/quadrature_gauss.h"
#include "libmesh/quadrature_nodal.h"
Expand Down
4 changes: 2 additions & 2 deletions framework/src/constraints/EqualValueBoundaryConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ EqualValueBoundaryConstraint::updateConstrainedNodes()
_mesh.getMesh().comm().allgather_packed_range(&_mesh.getMesh(),
nodes_to_ghost.begin(),
nodes_to_ghost.end(),
null_output_iterator<Node>());
libMesh::null_output_iterator<Node>());

_mesh.getMesh().comm().allgather_packed_range(&_mesh.getMesh(),
primary_elems_to_ghost.begin(),
primary_elems_to_ghost.end(),
null_output_iterator<Elem>());
libMesh::null_output_iterator<Elem>());

_mesh.update(); // Rebuild node_to_elem_map

Expand Down
2 changes: 1 addition & 1 deletion framework/src/constraints/EqualValueEmbeddedConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void
EqualValueEmbeddedConstraint::prepareSecondaryToPrimaryMap()
{
// get mesh pointLocator
std::unique_ptr<PointLocatorBase> pointLocator = _mesh.getPointLocator();
std::unique_ptr<libMesh::PointLocatorBase> pointLocator = _mesh.getPointLocator();
pointLocator->enable_out_of_mesh_mode();
const std::set<subdomain_id_type> allowed_subdomains{_primary};

Expand Down
2 changes: 2 additions & 0 deletions framework/src/dirackernels/DiracKernelInfo.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "libmesh/enum_point_locator_type.h"
#include "libmesh/point.h"

using namespace libMesh;

DiracKernelInfo::DiracKernelInfo()
: _point_locator(), _point_equal_distance_sq(libMesh::TOLERANCE * libMesh::TOLERANCE)
{
Expand Down
2 changes: 2 additions & 0 deletions framework/src/functions/MooseParsedFunctionWrapper.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "Function.h"
#include "MooseUtils.h"

using namespace libMesh;

MooseParsedFunctionWrapper::MooseParsedFunctionWrapper(FEProblemBase & feproblem,
const std::string & function_str,
const std::vector<std::string> & vars,
Expand Down
28 changes: 16 additions & 12 deletions framework/src/geomsearch/FindContactPoint.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "libmesh/fe_base.h"
#include "libmesh/vector_value.h"

using namespace libMesh;

namespace Moose
{

Expand All @@ -48,7 +50,7 @@ findContactPoint(PenetrationInfo & p_info,
FEBase * fe_elem,
FEBase * fe_side,
FEType & fe_side_type,
const Point & secondary_point,
const libMesh::Point & secondary_point,
bool start_with_centroid,
const Real tangential_tolerance,
bool & contact_point_on_side,
Expand All @@ -63,7 +65,7 @@ findContactPoint(PenetrationInfo & p_info,

const Elem * side = p_info._side;

const std::vector<Point> & phys_point = fe_side->get_xyz();
const std::vector<libMesh::Point> & phys_point = fe_side->get_xyz();

const std::vector<RealGradient> & dxyz_dxi = fe_side->get_dxyzdxi();
const std::vector<RealGradient> & d2xyz_dxi2 = fe_side->get_d2xyzdxi2();
Expand All @@ -79,7 +81,7 @@ findContactPoint(PenetrationInfo & p_info,
p_info._closest_point = *nearest_node;
p_info._closest_point_ref =
primary_elem->master_point(primary_elem->get_node_index(nearest_node));
std::vector<Point> elem_points = {p_info._closest_point_ref};
std::vector<libMesh::Point> elem_points = {p_info._closest_point_ref};

const std::vector<RealGradient> & elem_dxyz_dxi = fe_elem->get_dxyzdxi();

Expand All @@ -91,9 +93,9 @@ findContactPoint(PenetrationInfo & p_info,
p_info._normal *= -1.0;
p_info._normal /= p_info._normal.norm();

Point from_secondary_to_closest = p_info._closest_point - secondary_point;
libMesh::Point from_secondary_to_closest = p_info._closest_point - secondary_point;
p_info._distance = from_secondary_to_closest * p_info._normal;
Point tangential = from_secondary_to_closest - p_info._distance * p_info._normal;
libMesh::Point tangential = from_secondary_to_closest - p_info._distance * p_info._normal;
p_info._tangential_distance = tangential.norm();
p_info._dxyzdxi = dxyz_dxi;
p_info._dxyzdeta = dxyz_deta;
Expand All @@ -104,15 +106,15 @@ findContactPoint(PenetrationInfo & p_info,
return;
}

Point ref_point;
libMesh::Point ref_point;

if (start_with_centroid)
ref_point = FEInterface::inverse_map(
dim - 1, fe_side_type, side, side->vertex_average(), TOLERANCE, false);
else
ref_point = p_info._closest_point_ref;

std::vector<Point> points = {ref_point};
std::vector<libMesh::Point> points = {ref_point};
fe_side->reinit(side, &points);
RealGradient d = secondary_point - phys_point[0];

Expand Down Expand Up @@ -258,10 +260,10 @@ findContactPoint(PenetrationInfo & p_info,
else
{
const Node * const * elem_nodes = primary_elem->get_nodes();
const Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
const Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];
const libMesh::Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
const libMesh::Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];

Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
libMesh::Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
out_of_plane_normal /= out_of_plane_normal.norm();

p_info._normal = dxyz_dxi[0].cross(out_of_plane_normal);
Expand All @@ -285,7 +287,7 @@ findContactPoint(PenetrationInfo & p_info,

points[0] = p_info._closest_point_on_face_ref;
fe_side->reinit(side, &points);
Point closest_point_on_face(phys_point[0]);
libMesh::Point closest_point_on_face(phys_point[0]);

RealGradient off_face = closest_point_on_face - p_info._closest_point;
Real tangential_distance = off_face.norm();
Expand All @@ -310,7 +312,9 @@ findContactPoint(PenetrationInfo & p_info,
}

void
restrictPointToFace(Point & p, const Elem * side, std::vector<const Node *> & off_edge_nodes)
restrictPointToFace(libMesh::Point & p,
const Elem * side,
std::vector<const Node *> & off_edge_nodes)
{
const ElemType t(side->type());
off_edge_nodes.clear();
Expand Down
2 changes: 2 additions & 0 deletions framework/src/geomsearch/PenetrationInfo.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "libmesh/elem.h"

using namespace libMesh;

PenetrationInfo::PenetrationInfo(const Elem * elem,
const Elem * side,
unsigned int side_num,
Expand Down
2 changes: 2 additions & 0 deletions framework/src/geomsearch/PenetrationLocator.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "SubProblem.h"
#include "MooseApp.h"

using namespace libMesh;

PenetrationLocator::PenetrationLocator(SubProblem & subproblem,
GeometricSearchData & /*geom_search_data*/,
MooseMesh & mesh,
Expand Down
2 changes: 2 additions & 0 deletions framework/src/geomsearch/PenetrationThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <algorithm>

using namespace libMesh;

// Mutex to use when accessing _penetration_info;
Threads::spin_mutex pinfo_mutex;

Expand Down
2 changes: 2 additions & 0 deletions framework/src/ics/InitialConditionTempl.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "libmesh/fe_interface.h"
#include "libmesh/quadrature.h"

using namespace libMesh;

template <typename T>
InitialConditionTempl<T>::InitialConditionTempl(const InputParameters & parameters)
: InitialConditionBase(parameters),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/interfaces/OrientedBoxInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ OrientedBoxInterface::OrientedBoxInterface(const InputParameters & parameters)
Point bottom_left(-xmax, -ymax, -zmax);
Point top_right(xmax, ymax, zmax);

_bounding_box = std::make_unique<BoundingBox>(bottom_left, top_right);
_bounding_box = std::make_unique<libMesh::BoundingBox>(bottom_left, top_right);

/*
* now create the rotation matrix that rotates the oriented
Expand Down
2 changes: 1 addition & 1 deletion framework/src/loops/AllNodesSendListThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
AllNodesSendListThread::AllNodesSendListThread(FEProblemBase & fe_problem,
const MooseMesh & mesh,
const std::vector<unsigned int> & var_nums,
const System & system)
const libMesh::System & system)
: ThreadedNodeLoop<ConstNodeRange, ConstNodeRange::const_iterator>(fe_problem),
_ref_mesh(mesh),
_var_nums(var_nums),
Expand Down
2 changes: 1 addition & 1 deletion framework/src/loops/MaxQpsThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MaxQpsThread::MaxQpsThread(MaxQpsThread & x, Threads::split /*split*/)
}

void
MaxQpsThread::operator()(const ConstElemRange & range)
MaxQpsThread::operator()(const libMesh::ConstElemRange & range)
{
ParallelUniqueId puid;
_tid = puid.id;
Expand Down
3 changes: 2 additions & 1 deletion framework/src/loops/UpdateDisplacedMeshThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ UpdateDisplacedMeshThread::init()
Threads::parallel_reduce(node_range, send_list);
send_list.unique();
auto & [soln, ghost_soln] = libmesh_map_find(_sys_to_nonghost_and_ghost_soln, sys_num);
ghost_soln->init(soln->size(), soln->local_size(), send_list.send_list(), true, GHOSTED);
ghost_soln->init(
soln->size(), soln->local_size(), send_list.send_list(), true, libMesh::GHOSTED);
soln->localize(*ghost_soln, send_list.send_list());
}
}
Expand Down
Loading

0 comments on commit 8c77099

Please sign in to comment.