Skip to content
Snippets Groups Projects
Commit 5ba81b63 authored by wenqing's avatar wenqing
Browse files

[TimeInterval] Changed the name and simplified the body of a member function

parent afe8595f
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ namespace NumLib ...@@ -18,7 +18,7 @@ namespace NumLib
* Class for a time interval, which has a member to check whether the given time * Class for a time interval, which has a member to check whether the given time
* is in this time interval. * is in this time interval.
*/ */
class TimeInterval class TimeInterval final
{ {
public: public:
TimeInterval(const double start_time, const double end_time) TimeInterval(const double start_time, const double end_time)
...@@ -26,11 +26,9 @@ public: ...@@ -26,11 +26,9 @@ public:
{ {
} }
bool isInThisTimeInterval(const double current_time) const bool contains(const double current_time) const
{ {
return (current_time >= _start_time && current_time <= _end_time) return (current_time >= _start_time && current_time <= _end_time);
? true
: false;
} }
private: private:
......
...@@ -70,7 +70,7 @@ void DirichletBoundaryCondition::getEssentialBCValues( ...@@ -70,7 +70,7 @@ void DirichletBoundaryCondition::getEssentialBCValues(
const double t, GlobalVector const& x, const double t, GlobalVector const& x,
NumLib::IndexValueVector<GlobalIndexType>& bc_values) const NumLib::IndexValueVector<GlobalIndexType>& bc_values) const
{ {
return getEssentialBCValuesLocal(t, x, bc_values); getEssentialBCValuesLocal(t, x, bc_values);
} }
void DirichletBoundaryCondition::getEssentialBCValuesLocal( void DirichletBoundaryCondition::getEssentialBCValuesLocal(
......
...@@ -40,9 +40,10 @@ void DirichletBoundaryConditionWithinTimeInterval::getEssentialBCValues( ...@@ -40,9 +40,10 @@ void DirichletBoundaryConditionWithinTimeInterval::getEssentialBCValues(
const double t, GlobalVector const& x, const double t, GlobalVector const& x,
NumLib::IndexValueVector<GlobalIndexType>& bc_values) const NumLib::IndexValueVector<GlobalIndexType>& bc_values) const
{ {
if (_time_interval->isInThisTimeInterval(t)) if (_time_interval->contains(t))
{ {
return getEssentialBCValuesLocal(t, x, bc_values); getEssentialBCValuesLocal(t, x, bc_values);
return;
} }
bc_values.ids.clear(); bc_values.ids.clear();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment