Skip to content

Commit b322556

Browse files
authored
Merge pull request #4336 from jwpeterson/drop_deprecated_public_qoi
Drop deprecated public System::qoi, qoi_error_estimates members
2 parents fded133 + e82b9f2 commit b322556

2 files changed

Lines changed: 34 additions & 39 deletions

File tree

include/systems/system.h

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,27 +1630,7 @@ class System : public ReferenceCountedObject<System>,
16301630
*/
16311631
unsigned int n_qois() const;
16321632

1633-
#ifndef LIBMESH_ENABLE_DEPRECATED // We use accessors for these now
1634-
private:
1635-
#endif
1636-
/**
1637-
* Values of the quantities of interest. This vector needs
1638-
* to be both resized and filled by the user before any quantity of
1639-
* interest assembly is done and before any sensitivities are
1640-
* calculated.
1641-
*/
1642-
std::vector<Number> qoi;
1643-
1644-
/**
1645-
* Vector to hold error estimates for qois, either from a steady
1646-
* state calculation, or from a single unsteady solver timestep. Used
1647-
* by the library after resizing to match the size of the qoi vector.
1648-
* User code can use this for accumulating error estimates for example.
1649-
*/
1650-
std::vector<Number> qoi_error_estimates;
1651-
#ifndef LIBMESH_ENABLE_DEPRECATED
16521633
public:
1653-
#endif
16541634

16551635
/**
16561636
* Accessors for qoi and qoi_error_estimates vectors
@@ -2321,6 +2301,25 @@ class System : public ReferenceCountedObject<System>,
23212301
* Whether we are name prefixing solver options
23222302
*/
23232303
bool _prefix_with_name;
2304+
2305+
/**
2306+
* Values of the quantities of interest. This vector needs to be
2307+
* both resized and filled by the user before any quantity of
2308+
* interest assembly is done and before any sensitivities are
2309+
* calculated. Use the get_qoi_values() accessor to get these
2310+
* values.
2311+
*/
2312+
std::vector<Number> _qoi;
2313+
2314+
/**
2315+
* Vector to hold error estimates for qois, either from a steady
2316+
* state calculation, or from a single unsteady solver timestep. Used
2317+
* by the library after resizing to match the size of the qoi vector.
2318+
* User code can use this for accumulating error estimates for example.
2319+
* Use the set_qoi_error_estimate()/get_qoi_error_estimate_value()
2320+
* accessors to set/get these values.
2321+
*/
2322+
std::vector<Number> _qoi_error_estimates;
23242323
};
23252324

23262325

@@ -2507,11 +2506,9 @@ void System::disable_cache () { assemble_before_solve = true; }
25072506
inline
25082507
unsigned int System::n_qois() const
25092508
{
2510-
#ifndef LIBMESH_ENABLE_DEPRECATED
2511-
libmesh_assert_equal_to(this->qoi.size(), this->qoi_error_estimates.size());
2512-
#endif
2509+
libmesh_assert_equal_to(this->_qoi.size(), this->_qoi_error_estimates.size());
25132510

2514-
return cast_int<unsigned int>(this->qoi.size());
2511+
return cast_int<unsigned int>(this->_qoi.size());
25152512
}
25162513

25172514
inline

src/systems/system.C

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ System::System (EquationSystems & es,
7171
solution (NumericVector<Number>::build(this->comm())),
7272
current_local_solution (NumericVector<Number>::build(this->comm())),
7373
time (0.),
74-
qoi (0),
75-
qoi_error_estimates (0),
7674
_init_system_function (nullptr),
7775
_init_system_object (nullptr),
7876
_assemble_system_function (nullptr),
@@ -2148,50 +2146,50 @@ void System::user_QOI_derivative(const QoISet & qoi_indices,
21482146

21492147
void System::init_qois(unsigned int n_qois)
21502148
{
2151-
qoi.resize(n_qois);
2152-
qoi_error_estimates.resize(n_qois);
2149+
_qoi.resize(n_qois);
2150+
_qoi_error_estimates.resize(n_qois);
21532151
}
21542152

21552153

21562154
void System::set_qoi(unsigned int qoi_index, Number qoi_value)
21572155
{
2158-
libmesh_assert(qoi_index < qoi.size());
2156+
libmesh_assert(qoi_index < _qoi.size());
21592157

2160-
qoi[qoi_index] = qoi_value;
2158+
_qoi[qoi_index] = qoi_value;
21612159
}
21622160

21632161

21642162
Number System::get_qoi_value(unsigned int qoi_index) const
21652163
{
2166-
libmesh_assert(qoi_index < qoi.size());
2167-
return qoi[qoi_index];
2164+
libmesh_assert(qoi_index < _qoi.size());
2165+
return _qoi[qoi_index];
21682166
}
21692167

21702168

21712169
std::vector<Number> System::get_qoi_values() const
21722170
{
2173-
return this->qoi;
2171+
return this->_qoi;
21742172
}
21752173

21762174

21772175
void System::set_qoi(std::vector<Number> new_qoi)
21782176
{
2179-
libmesh_assert_equal_to(this->qoi.size(), new_qoi.size());
2180-
this->qoi = std::move(new_qoi);
2177+
libmesh_assert_equal_to(this->_qoi.size(), new_qoi.size());
2178+
this->_qoi = std::move(new_qoi);
21812179
}
21822180

21832181

21842182
void System::set_qoi_error_estimate(unsigned int qoi_index, Number qoi_error_estimate)
21852183
{
2186-
libmesh_assert(qoi_index < qoi_error_estimates.size());
2184+
libmesh_assert(qoi_index < _qoi_error_estimates.size());
21872185

2188-
qoi_error_estimates[qoi_index] = qoi_error_estimate;
2186+
_qoi_error_estimates[qoi_index] = qoi_error_estimate;
21892187
}
21902188

21912189
Number System::get_qoi_error_estimate_value(unsigned int qoi_index) const
21922190
{
2193-
libmesh_assert(qoi_index < qoi_error_estimates.size());
2194-
return qoi_error_estimates[qoi_index];
2191+
libmesh_assert(qoi_index < _qoi_error_estimates.size());
2192+
return _qoi_error_estimates[qoi_index];
21952193
}
21962194

21972195

0 commit comments

Comments
 (0)