Skip to content

Commit 2b7d112

Browse files
pbaumanjwpeterson
authored andcommitted
Add override keyword in various places
As were pointed out by GCCs -Wsuggest-override
1 parent d7dfd7a commit 2b7d112

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

include/base/libmesh_exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class SolverException: public std::exception
124124
/**
125125
* Override the what() function to provide a generic error message.
126126
*/
127-
virtual const char * what() const noexcept
127+
virtual const char * what() const noexcept override
128128
{
129129
// std::string::c_str() is noexcept in C++11, so it's safe to call
130130
// in what() because it can't throw.

include/error_estimation/adjoint_refinement_estimator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class AdjointRefinementEstimator : public ErrorEstimator
9797
virtual void estimate_error (const System & system,
9898
ErrorVector & error_per_cell,
9999
const NumericVector<Number> * solution_vector = nullptr,
100-
bool estimate_parent_error = false);
100+
bool estimate_parent_error = false) override;
101101

102102
/**
103103
* This is an accessor function to access the computed global
@@ -108,7 +108,7 @@ class AdjointRefinementEstimator : public ErrorEstimator
108108
return computed_global_QoI_errors[qoi_index];
109109
}
110110

111-
virtual ErrorEstimatorType type() const;
111+
virtual ErrorEstimatorType type() const override;
112112

113113
/**
114114
* How many h refinements to perform to get the fine grid

include/numerics/const_fem_function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ class ConstFEMFunction : public FEMFunctionBase<Output>
5656
ConstFEMFunction & operator= (ConstFEMFunction &&) = default;
5757
virtual ~ConstFEMFunction () = default;
5858

59-
virtual std::unique_ptr<FEMFunctionBase<Output>> clone () const
59+
virtual std::unique_ptr<FEMFunctionBase<Output>> clone () const override
6060
{return libmesh_make_unique<ConstFEMFunction>(*this); }
6161

6262
virtual Output operator() (const FEMContext &,
6363
const Point &,
64-
const Real /* time */ = 0.)
64+
const Real /* time */ = 0.) override
6565
{ return _c; }
6666

6767
virtual void operator() (const FEMContext &,
6868
const Point &,
6969
const Real,
70-
DenseVector<Output> & output)
70+
DenseVector<Output> & output) override
7171
{
7272
for (auto i : index_range(output))
7373
output(i) = _c;

include/numerics/parsed_fem_function_parameter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ class ParsedFEMFunctionParameter : public ParameterAccessor<T>
7272
/**
7373
* Setter: change the value of the parameter we access.
7474
*/
75-
virtual void set (const T & new_value) {
75+
virtual void set (const T & new_value) override {
7676
_func.set_inline_value(_name, new_value);
7777
}
7878

7979
/**
8080
* \returns A constant reference to the value of the parameter we access.
8181
*/
82-
virtual const T & get () const {
82+
virtual const T & get () const override {
8383
_current_val = _func.get_inline_value(_name);
8484
return _current_val;
8585
}
8686

8787
/**
8888
* \returns A new copy of the accessor.
8989
*/
90-
virtual std::unique_ptr<ParameterAccessor<T>> clone() const {
90+
virtual std::unique_ptr<ParameterAccessor<T>> clone() const override {
9191
return libmesh_make_unique<ParsedFEMFunctionParameter<T>>(_func, _name);
9292
}
9393

include/numerics/parsed_function_parameter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ class ParsedFunctionParameter : public ParameterAccessor<T>
7070
/**
7171
* Setter: change the value of the parameter we access.
7272
*/
73-
virtual void set (const T & new_value) {
73+
virtual void set (const T & new_value) override {
7474
_func.set_inline_value(_name, new_value);
7575
}
7676

7777
/**
7878
* Getter: get the value of the parameter we access.
7979
*/
80-
virtual const T & get () const {
80+
virtual const T & get () const override {
8181
_current_val = _func.get_inline_value(_name);
8282
return _current_val;
8383
}
8484

8585
/**
8686
* \returns A new copy of the accessor.
8787
*/
88-
virtual std::unique_ptr<ParameterAccessor<T>> clone() const {
88+
virtual std::unique_ptr<ParameterAccessor<T>> clone() const override {
8989
return libmesh_make_unique<ParsedFunctionParameter<T>>(_func, _name);
9090
}
9191

include/utils/parameters.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,18 @@ class Parameters
215215
/**
216216
* String identifying the type of parameter stored.
217217
*/
218-
virtual std::string type () const;
218+
virtual std::string type () const override;
219219
#endif // LIBMESH_HAVE_RTTI
220220

221221
/**
222222
* Prints the parameter value to the specified stream.
223223
*/
224-
virtual void print(std::ostream &) const;
224+
virtual void print(std::ostream &) const override;
225225

226226
/**
227227
* Clone this value. Useful in copy-construction.
228228
*/
229-
virtual Value * clone () const;
229+
virtual Value * clone () const override;
230230

231231
private:
232232
/**

0 commit comments

Comments
 (0)