Skip to content

Commit

Permalink
Apply clang-format suggestions (#26105)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmnobre committed Nov 20, 2023
1 parent 66985d8 commit f0f7e3c
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 26 deletions.
9 changes: 6 additions & 3 deletions framework/include/base/Assembly.h
Expand Up @@ -1372,7 +1372,8 @@ class Assembly
{
return _vector_curl_phi_neighbor;
}
const VectorVariablePhiDivergence & divPhiNeighbor(const MooseVariableField<RealVectorValue> &) const
const VectorVariablePhiDivergence &
divPhiNeighbor(const MooseVariableField<RealVectorValue> &) const
{
return _vector_div_phi_neighbor;
}
Expand Down Expand Up @@ -1720,15 +1721,17 @@ class Assembly
}

template <typename OutputType>
const typename OutputTools<OutputType>::VariablePhiDivergence & feDivPhiNeighbor(FEType type) const
const typename OutputTools<OutputType>::VariablePhiDivergence &
feDivPhiNeighbor(FEType type) const
{
_need_div[type] = true;
buildNeighborFE(type);
return _fe_shape_data_neighbor[type]->_div_phi;
}

template <typename OutputType>
const typename OutputTools<OutputType>::VariablePhiDivergence & feDivPhiFaceNeighbor(FEType type) const
const typename OutputTools<OutputType>::VariablePhiDivergence &
feDivPhiFaceNeighbor(FEType type) const
{
_need_div[type] = true;
buildFaceNeighborFE(type);
Expand Down
4 changes: 2 additions & 2 deletions framework/include/variables/MooseVariableData.h
Expand Up @@ -631,11 +631,11 @@ class MooseVariableData : public MooseVariableDataBase<OutputType>
_curl_phi_face_assembly_method;

std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &,
FEType)>
FEType)>
_div_phi_assembly_method;

std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &,
FEType)>
FEType)>
_div_phi_face_assembly_method;

std::function<const ADTemplateVariablePhiGradient<OutputShape> &(const Assembly &, FEType)>
Expand Down
5 changes: 4 additions & 1 deletion framework/include/variables/MooseVariableFE.h
Expand Up @@ -332,7 +332,10 @@ class MooseVariableFE : public MooseVariableField<OutputType>
/// element divergence
const FieldVariableDivergence & divSln() const { return _element_data->divSln(Moose::Current); }
const FieldVariableDivergence & divSlnOld() const { return _element_data->divSln(Moose::Old); }
const FieldVariableDivergence & divSlnOlder() const { return _element_data->divSln(Moose::Older); }
const FieldVariableDivergence & divSlnOlder() const
{
return _element_data->divSln(Moose::Older);
}

/// AD
const ADTemplateVariableValue<OutputType> & adSln() const override
Expand Down
3 changes: 2 additions & 1 deletion framework/include/variables/MooseVariableFV.h
Expand Up @@ -71,7 +71,8 @@ class MooseVariableFV : public MooseVariableField<OutputType>
using DoFValue = typename MooseVariableField<OutputType>::DoFValue;

using FieldVariablePhiValue = typename MooseVariableField<OutputType>::FieldVariablePhiValue;
using FieldVariablePhiDivergence = typename MooseVariableField<OutputType>::FieldVariablePhiDivergence;
using FieldVariablePhiDivergence =
typename MooseVariableField<OutputType>::FieldVariablePhiDivergence;
using FieldVariablePhiGradient =
typename MooseVariableField<OutputType>::FieldVariablePhiGradient;
using FieldVariablePhiSecond = typename MooseVariableField<OutputType>::FieldVariablePhiSecond;
Expand Down
2 changes: 1 addition & 1 deletion framework/include/variables/MooseVariableField.h
Expand Up @@ -216,7 +216,7 @@ class MooseVariableField : public MooseVariableFieldBase,
*/
virtual bool computingCurl() const = 0;

/**
/**
* Whether or not this variable is computing any divergence quantities
*/
virtual bool computingDiv() const = 0;
Expand Down
11 changes: 5 additions & 6 deletions framework/src/base/Assembly.C
Expand Up @@ -797,8 +797,7 @@ Assembly::reinitFE(const Elem * elem)
fesd._curl_phi.shallowCopy(
const_cast<std::vector<std::vector<VectorValue<Real>>> &>(fe.get_curl_phi()));
if (_need_div.find(fe_type) != _need_div.end())
fesd._div_phi.shallowCopy(
const_cast<std::vector<std::vector<Real>> &>(fe.get_div_phi()));
fesd._div_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(fe.get_div_phi()));
}
if (!_unique_fe_helper.empty())
{
Expand Down Expand Up @@ -1603,8 +1602,8 @@ Assembly::reinitFEFaceNeighbor(const Elem * neighbor, const std::vector<Point> &
fesd._curl_phi.shallowCopy(const_cast<std::vector<std::vector<VectorValue<Real>>> &>(
fe_face_neighbor.get_curl_phi()));
if (_need_div.find(fe_type) != _need_div.end())
fesd._div_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(
fe_face_neighbor.get_div_phi()));
fesd._div_phi.shallowCopy(
const_cast<std::vector<std::vector<Real>> &>(fe_face_neighbor.get_div_phi()));
}
if (!_unique_fe_face_neighbor_helper.empty())
{
Expand Down Expand Up @@ -2235,8 +2234,8 @@ Assembly::reinitNeighborFaceRef(const Elem * neighbor,
fesd._curl_phi.shallowCopy(const_cast<std::vector<std::vector<VectorValue<Real>>> &>(
fe_face_neighbor.get_curl_phi()));
if (_need_div.find(fe_type) != _need_div.end())
fesd._div_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(
fe_face_neighbor.get_div_phi()));
fesd._div_phi.shallowCopy(
const_cast<std::vector<std::vector<Real>> &>(fe_face_neighbor.get_div_phi()));
}
if (!_unique_fe_face_neighbor_helper.empty())
{
Expand Down
3 changes: 2 additions & 1 deletion framework/src/problems/FEProblemBase.C
Expand Up @@ -2706,7 +2706,8 @@ FEProblemBase::addAuxVariable(const std::string & var_name,
var_type = "MooseVariableConstMonomial";
else if (type.family == SCALAR)
var_type = "MooseVariableScalar";
else if (type.family == LAGRANGE_VEC || type.family == NEDELEC_ONE || type.family == MONOMIAL_VEC || type.family == RAVIART_THOMAS)
else if (type.family == LAGRANGE_VEC || type.family == NEDELEC_ONE ||
type.family == MONOMIAL_VEC || type.family == RAVIART_THOMAS)
var_type = "VectorMooseVariable";
else
var_type = "MooseVariable";
Expand Down
16 changes: 9 additions & 7 deletions framework/src/variables/MooseVariableData.C
Expand Up @@ -487,7 +487,7 @@ MooseVariableData<OutputType>::computeValues()

if (_need_curl_old)
_curl_u_old.resize(nqp);

if (_need_div_old)
_div_u_old.resize(nqp);

Expand All @@ -514,7 +514,7 @@ MooseVariableData<OutputType>::computeValues()

if (_need_curl)
_curl_u[i] = 0;

if (_need_div)
_div_u[i] = 0;

Expand Down Expand Up @@ -555,7 +555,7 @@ MooseVariableData<OutputType>::computeValues()

if (_need_curl_old)
_curl_u_old[i] = 0;

if (_need_div_old)
_div_u_old[i] = 0;
}
Expand Down Expand Up @@ -640,8 +640,9 @@ MooseVariableData<OutputType>::computeValues()

if (div_required)
{
mooseAssert(_current_div_phi,
"We're requiring a divergence calculation but have not set a div shape function!");
mooseAssert(
_current_div_phi,
"We're requiring a divergence calculation but have not set a div shape function!");
const OutputShapeDivergence div_phi_local = (*_current_div_phi)[i][qp];

if (_need_div)
Expand Down Expand Up @@ -835,7 +836,7 @@ MooseVariableData<RealEigenVector>::computeValues()

if (_need_curl_old)
_curl_u_old[i].setZero(_count);

if (_need_div_old)
_div_u_old[i].setZero(_count);
}
Expand Down Expand Up @@ -932,7 +933,8 @@ MooseVariableData<RealEigenVector>::computeValues()
if (div_required)
{
mooseAssert(_current_div_phi,
"We're requiring a divergence calculation but have not set a divergence shape function!");
"We're requiring a divergence calculation but have not set a divergence shape "
"function!");
const auto div_phi_local = (*_current_div_phi)[i][qp];

if (_need_div)
Expand Down
3 changes: 2 additions & 1 deletion framework/src/variables/MooseVariableFE.C
Expand Up @@ -33,7 +33,8 @@ InputParameters
MooseVariableFE<RealVectorValue>::validParams()
{
auto params = MooseVariableField<RealVectorValue>::validParams();
params.addClassDescription("Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
params.addClassDescription(
"Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
return params;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/electromagnetics/src/kernels/DivField.C
Expand Up @@ -41,6 +41,6 @@ DivField::computeQpOffDiagJacobian(unsigned int jvar)
{
if (_u_var_num == jvar)
return _div_phi[_j][_qp] * _test[_i][_qp];

return 0.0;
}
4 changes: 2 additions & 2 deletions modules/electromagnetics/src/kernels/GradField.C
Expand Up @@ -40,8 +40,8 @@ GradField::computeQpResidual()
Real
GradField::computeQpOffDiagJacobian(unsigned int jvar)
{
if (_p_var_num == jvar)
if (_p_var_num == jvar)
return _p_phi[_j][_qp] * _div_test[_i][_qp];

return 0.0;
}

0 comments on commit f0f7e3c

Please sign in to comment.