aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Requirements
diff options
context:
space:
mode:
authorFrank Löffler <knarf@cct.lsu.edu>2013-04-03 15:45:22 -0500
committerFrank Löffler <knarf@cct.lsu.edu>2013-04-03 15:45:22 -0500
commit89410978baf8f7f0f2011cc404741743b051b1d1 (patch)
treeafed32a4ed90b78f5b853be5ac79fd6c7bc61ea1 /Carpet/Requirements
parent86079b6bc84fbd50791ba4a4e80f5871bb543511 (diff)
Let set_ accessors return whether something was changed
Diffstat (limited to 'Carpet/Requirements')
-rw-r--r--Carpet/Requirements/src/Requirements.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/Carpet/Requirements/src/Requirements.cc b/Carpet/Requirements/src/Requirements.cc
index f5e6546ca..f46498600 100644
--- a/Carpet/Requirements/src/Requirements.cc
+++ b/Carpet/Requirements/src/Requirements.cc
@@ -78,10 +78,10 @@ namespace Requirements {
bool boundary() const;
bool ghostzones() const;
bool boundary_ghostzones() const;
- void set_interior(bool b);
- void set_boundary(bool b);
- void set_ghostzones(bool b);
- void set_boundary_ghostzones(bool b);
+ bool set_interior(bool b);
+ bool set_boundary(bool b);
+ bool set_ghostzones(bool b);
+ bool set_boundary_ghostzones(bool b);
void check_state(clause_t const& clause,
cFunctionData const* function_data,
@@ -104,21 +104,33 @@ namespace Requirements {
bool gridpoint_t::boundary() const { return i_boundary; }
bool gridpoint_t::ghostzones() const { return i_ghostzones; }
bool gridpoint_t::boundary_ghostzones() const { return i_boundary_ghostzones; }
- void gridpoint_t::set_interior(bool b)
+ bool gridpoint_t::set_interior(bool b)
{
+ if (i_interior == b)
+ return false;
i_interior = b;
+ return true;
}
- void gridpoint_t::set_boundary(bool b)
+ bool gridpoint_t::set_boundary(bool b)
{
+ if (i_boundary == b)
+ return false;
i_boundary = b;
+ return true;
}
- void gridpoint_t::set_ghostzones(bool b)
+ bool gridpoint_t::set_ghostzones(bool b)
{
+ if (i_ghostzones == b)
+ return false;
i_ghostzones = b;
+ return true;
}
- void gridpoint_t::set_boundary_ghostzones(bool b)
+ bool gridpoint_t::set_boundary_ghostzones(bool b)
{
+ if (i_boundary_ghostzones == b)
+ return false;
i_boundary_ghostzones = b;
+ return true;
}
inline ostream& operator<< (ostream& os, const gridpoint_t& a) {