Skip to content

Commit

Permalink
Merge pull request #28611 from GiudGiud/PR_compile_warning
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud authored Sep 16, 2024
2 parents 53ead3a + 13a9acb commit 35a831b
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 1 deletion.
13 changes: 13 additions & 0 deletions framework/include/auxkernels/AuxKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,16 @@ AuxKernelTempl<ComputeValueType>::getMaterialPropertyOlder(const std::string & n

return MaterialPropertyInterface::getMaterialPropertyOlder<T>(name);
}

// Declare all the specializations, as the template specialization declaration below must know
template <>
void AuxKernelTempl<Real>::setDofValueHelper(const Real & value);
template <>
void AuxKernelTempl<RealVectorValue>::setDofValueHelper(const RealVectorValue &);
template <>
void AuxKernelTempl<RealEigenVector>::compute();

// Prevent implicit instantiation in other translation units where these classes are used
extern template class AuxKernelTempl<Real>;
extern template class AuxKernelTempl<RealVectorValue>;
extern template class AuxKernelTempl<RealEigenVector>;
4 changes: 4 additions & 0 deletions framework/include/auxkernels/MortarNodalAuxKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ class MortarNodalAuxKernelTempl : public AuxKernelTempl<ComputeValueType>,

typedef MortarNodalAuxKernelTempl<Real> MortarNodalAuxKernel;
typedef MortarNodalAuxKernelTempl<RealVectorValue> VectorMortarNodalAuxKernel;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MortarNodalAuxKernelTempl<Real>;
extern template class MortarNodalAuxKernelTempl<RealVectorValue>;
10 changes: 10 additions & 0 deletions framework/include/auxkernels/ProjectedStatefulMaterialAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,13 @@ typedef ProjectedStatefulMaterialAuxTempl<RankFourTensor, false>
ProjectedStatefulMaterialRankFourTensorAux;
typedef ProjectedStatefulMaterialAuxTempl<RankFourTensor, true>
ADProjectedStatefulMaterialRankFourTensorAux;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class ProjectedStatefulMaterialAuxTempl<Real, false>;
extern template class ProjectedStatefulMaterialAuxTempl<Real, true>;
extern template class ProjectedStatefulMaterialAuxTempl<RealVectorValue, false>;
extern template class ProjectedStatefulMaterialAuxTempl<RealVectorValue, true>;
extern template class ProjectedStatefulMaterialAuxTempl<RankTwoTensor, false>;
extern template class ProjectedStatefulMaterialAuxTempl<RankTwoTensor, true>;
extern template class ProjectedStatefulMaterialAuxTempl<RankFourTensor, false>;
extern template class ProjectedStatefulMaterialAuxTempl<RankFourTensor, true>;
3 changes: 3 additions & 0 deletions framework/include/fvics/FVInitialConditionTempl.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ FVInitialConditionTempl<T>::validParams()
}

typedef FVInitialConditionTempl<Real> FVInitialCondition;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class FVInitialConditionTempl<Real>;
21 changes: 21 additions & 0 deletions framework/include/ics/InitialConditionTempl.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,24 @@ InitialConditionTempl<T>::validParams()
typedef InitialConditionTempl<Real> InitialCondition;
typedef InitialConditionTempl<RealVectorValue> VectorInitialCondition;
typedef InitialConditionTempl<RealEigenVector> ArrayInitialCondition;

// Declare all the specializations, as the template specialization declaration below must know
template <>
void InitialConditionTempl<RealVectorValue>::setCZeroVertices();
template <>
RealVectorValue InitialConditionTempl<RealVectorValue>::gradientComponent(GradientType grad,
unsigned int i);
template <>
RealEigenVector InitialConditionTempl<RealEigenVector>::gradientComponent(GradientType grad,
unsigned int i);
template <>
void InitialConditionTempl<RealVectorValue>::setHermiteVertices();
template <>
void InitialConditionTempl<RealVectorValue>::setOtherCOneVertices();
template <>
void InitialConditionTempl<RealEigenVector>::choleskySolve(bool is_volume);

// Prevent implicit instantiation in other translation units where these classes are used
extern template class InitialConditionTempl<Real>;
extern template class InitialConditionTempl<RealVectorValue>;
extern template class InitialConditionTempl<RealEigenVector>;
6 changes: 6 additions & 0 deletions framework/include/materials/InterpolatedStatefulMaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ typedef InterpolatedStatefulMaterialTempl<RealVectorValue>
typedef InterpolatedStatefulMaterialTempl<RankTwoTensor> InterpolatedStatefulMaterialRankTwoTensor;
typedef InterpolatedStatefulMaterialTempl<RankFourTensor>
InterpolatedStatefulMaterialRankFourTensor;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class InterpolatedStatefulMaterialTempl<Real>;
extern template class InterpolatedStatefulMaterialTempl<RealVectorValue>;
extern template class InterpolatedStatefulMaterialTempl<RankTwoTensor>;
extern template class InterpolatedStatefulMaterialTempl<RankFourTensor>;
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,13 @@ typedef ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankFourTensor, false>
ProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor;
typedef ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankFourTensor, true>
ADProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<Real, false>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<Real, true>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RealVectorValue, false>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RealVectorValue, true>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankTwoTensor, false>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankTwoTensor, true>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankFourTensor, false>;
extern template class ProjectedStatefulMaterialNodalPatchRecoveryTempl<RankFourTensor, true>;
4 changes: 4 additions & 0 deletions framework/include/variables/MooseLinearVariableFV.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,9 @@ MooseLinearVariableFV<OutputType>::adError() const
this->name());
}

// Declare all the specializations, as the template specialization declarations below must know
template <>
ADReal MooseLinearVariableFV<Real>::evaluateDot(const ElemArg & elem, const StateArg & state) const;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MooseLinearVariableFV<Real>;
46 changes: 46 additions & 0 deletions framework/include/variables/MooseVariableFE.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,3 +859,49 @@ MooseVariableFE<OutputType>::setActiveTags(const std::set<TagID> & vtags)
_neighbor_data->setActiveTags(vtags);
_lower_data->setActiveTags(vtags);
}

// Declare all the specializations, as the template specialization declarations below must know
template <>
InputParameters MooseVariableFE<Real>::validParams();
template <>
InputParameters MooseVariableFE<RealVectorValue>::validParams();
template <>
InputParameters MooseVariableFE<RealEigenVector>::validParams();
template <>
RealEigenVector
MooseVariableFE<RealEigenVector>::getValue(const Elem * elem,
const std::vector<std::vector<Real>> & phi) const;
template <>
RealVectorArrayValue MooseVariableFE<RealEigenVector>::getGradient(
const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const;
template <>
void MooseVariableFE<RealEigenVector>::evaluateOnElement(const ElemQpArg &,
const StateArg &,
bool) const;
template <>
void MooseVariableFE<RealEigenVector>::evaluateOnElementSide(const ElemSideQpArg &,
const StateArg &,
bool) const;
template <>
typename MooseVariableFE<RealEigenVector>::ValueType
MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const;
template <>
typename MooseVariableFE<RealEigenVector>::ValueType
MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const;
template <>
typename MooseVariableFE<RealEigenVector>::GradientType
MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const;
template <>
typename MooseVariableFE<RealEigenVector>::GradientType
MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const;
template <>
typename MooseVariableFE<RealEigenVector>::DotType
MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const;
template <>
typename MooseVariableFE<RealEigenVector>::DotType
MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MooseVariableFE<Real>;
extern template class MooseVariableFE<RealVectorValue>;
extern template class MooseVariableFE<RealEigenVector>;
8 changes: 8 additions & 0 deletions framework/include/variables/MooseVariableFV.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,5 +841,13 @@ MooseVariableFV<OutputType>::lowerDError() const
mooseError("Lower dimensional element support not implemented for finite volume variables");
}

// Declare all the specializations, as the template specialization declaration below must know
template <>
ADReal MooseVariableFV<Real>::evaluateDot(const ElemArg & elem, const StateArg & state) const;
template <>
ADReal MooseVariableFV<Real>::evaluateDot(const FaceArg & elem_arg, const StateArg & state) const;
template <>
ADReal MooseVariableFV<Real>::evaluateDot(const ElemQpArg & elem_arg, const StateArg & state) const;

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MooseVariableFV<Real>;
5 changes: 5 additions & 0 deletions framework/include/variables/MooseVariableField.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,8 @@ class MooseVariableField : public MooseVariableFieldBase,
using MooseVariableField<OutputType>::_time_integrator; \
using MooseVariableField<OutputType>::_ad_real_dummy; \
using MooseVariableField<OutputType>::getSolution

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MooseVariableField<Real>;
extern template class MooseVariableField<RealVectorValue>;
extern template class MooseVariableField<RealEigenVector>;
21 changes: 21 additions & 0 deletions framework/include/variables/MooseVariableInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,24 @@ class MooseVariableInterface
private:
const MooseObject & _moose_object;
};

// Declare all the specializations, as the template specialization declaration below must know
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::value();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::valueOld();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::valueOlder();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::dot();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::dotDot();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::dotOld();
template <>
const VectorVariableValue & MooseVariableInterface<RealVectorValue>::dotDotOld();

// Prevent implicit instantiation in other translation units where these classes are used
extern template class MooseVariableInterface<Real>;
extern template class MooseVariableInterface<RealVectorValue>;
extern template class MooseVariableInterface<RealEigenVector>;
2 changes: 1 addition & 1 deletion framework/src/auxkernels/AuxKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ AuxKernelTempl<ComputeValueType>::isMortar()
return dynamic_cast<MortarNodalAuxKernelTempl<ComputeValueType> *>(this) != nullptr;
}

// Explicitly instantiates the two versions of the AuxKernelTempl class
// Explicitly instantiates the three versions of the AuxKernelTempl class
template class AuxKernelTempl<Real>;
template class AuxKernelTempl<RealVectorValue>;
template class AuxKernelTempl<RealEigenVector>;

0 comments on commit 35a831b

Please sign in to comment.