Commit f6eb600f authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

[CLANG-TIDY] readability-const-return-type

parent b0f41c86
......@@ -32,6 +32,7 @@ performance-*,
portability-*,
readability-const-return-type,
readability-container-size-empty,
readability-misleading-indentation,
readability-misplaced-array-index
......
......@@ -171,7 +171,7 @@ size_t EquationSystem::getNumberOfEquations() const
return eqMap_.size();
}
const std::string EquationSystem::writeEquations() const
std::string EquationSystem::writeEquations() const
{
std::stringstream ss;
ss << "Equations to solve:" << std::endl;
......@@ -182,7 +182,7 @@ const std::string EquationSystem::writeEquations() const
return ss.str();
}
const std::string EquationSystem::writeVariables() const
std::string EquationSystem::writeVariables() const
{
std::stringstream ss;
ss << "Solution for each variable:" << std::endl;
......
......@@ -100,8 +100,8 @@ namespace math {
//**Output functions*************************************************************************
/*! \name Output functions */
//@{
const std::string writeEquations() const;
const std::string writeVariables() const;
std::string writeEquations() const;
std::string writeVariables() const;
friend std::ostream& operator<<( std::ostream& os, EquationSystem& es );
//@}
//****************************************************************************************************************
......
......@@ -125,7 +125,7 @@ void EveryNth::operator()()
++calls_;
}
const std::string EveryNth::getName() const
std::string EveryNth::getName() const
{
std::stringstream ss;
ss << "every " << interval_ << "th step:";
......@@ -208,7 +208,7 @@ void Loop::synchronizedStop( bool stopVar )
mpi::allReduceInplace( stop_, mpi::LOGICAL_OR );
}
const std::string Loop::getName() const
std::string Loop::getName() const
{
std::stringstream ss;
ss << "Loop [" << iterations_ << "]";
......
......@@ -109,8 +109,8 @@ class IFunctionNode
public:
virtual ~IFunctionNode() {}
virtual void operator()() = 0;
virtual const std::string getName() const = 0;
virtual const std::deque< shared_ptr< IFunctionNode > > getChildren() const { return {}; }
virtual std::string getName() const = 0;
virtual std::deque< shared_ptr< IFunctionNode > > getChildren() const { return {}; }
};
......@@ -122,7 +122,7 @@ public:
const std::string &name,
const TimingTreePtr & timingTree );
const std::string getName() const override { return name_ != "" ? name_ : "Functor"; };
std::string getName() const override { return name_ != "" ? name_ : "Functor"; };
void operator() () override;
private:
......@@ -138,8 +138,8 @@ public:
EveryNth( const IFunctionNodePtr &node, uint_t interval, bool onFirst = false, uint_t startValue = 0 );
void operator()() override;
const std::string getName() const override;
const std::deque< shared_ptr< IFunctionNode > > getChildren() const override { return { wrapped_ }; }
std::string getName() const override;
std::deque< shared_ptr< IFunctionNode > > getChildren() const override { return { wrapped_ }; }
private:
IFunctionNodePtr wrapped_;
......@@ -158,8 +158,8 @@ public:
void push_back( const IFunctionNodePtr &fct ) { children_.push_back( fct ); }
void push_front( const IFunctionNodePtr &fct ) { children_.push_front( fct ); }
const std::string getName() const override { return name_ != "" ? name_ : "Sequence"; };
const std::deque< IFunctionNodePtr > getChildren() const override { return children_; };
std::string getName() const override { return name_ != "" ? name_ : "Sequence"; };
std::deque< IFunctionNodePtr > getChildren() const override { return children_; };
private:
std::string name_;
......@@ -185,8 +185,8 @@ public:
uint_t getCurrentTimeStep() const override { return currentIteration_; }
uint_t getNrOfTimeSteps() const override { return iterations_; }
const std::deque< shared_ptr< IFunctionNode > > getChildren() const override { return { body_ }; }
const std::string getName() const override;
std::deque< shared_ptr< IFunctionNode > > getChildren() const override { return { body_ }; }
std::string getName() const override;
private:
IFunctionNodePtr body_;
......@@ -203,4 +203,4 @@ private:
} // namespace walberla
#include "ExecutionTree.impl.h"
\ No newline at end of file
#include "ExecutionTree.impl.h"
......@@ -47,7 +47,7 @@ GJK::GJK()
* \param dir The support point direction.
* \param threshold Extension of the particle.
*/
const Vec3 GJK::putSupport(const Support &geom1,
Vec3 GJK::putSupport(const Support &geom1,
const Support &geom2,
const Vec3& dir,
const real_t margin,
......
......@@ -81,7 +81,7 @@ private:
inline bool zeroLengthVector( const Vec3& vec ) const { return vec.sqrLength() < math::Limits<real_t>::fpuAccuracy(); }
real_t calcDistance ( Vec3& normal, Vec3& contactPoint );
inline const Vec3 putSupport(const Support &geom1,
inline Vec3 putSupport(const Support &geom1,
const Support &geom2,
const Vec3& dir,
const real_t margin,
......
......@@ -196,7 +196,7 @@ bool RigidBody::checkInvariants()
*
* The function calculates the global velocity of a point relative to the body's center of mass.
*/
const Vec3 RigidBody::velFromBF( real_t px, real_t py, real_t pz ) const
Vec3 RigidBody::velFromBF( real_t px, real_t py, real_t pz ) const
{
return velFromBF( Vec3( px, py, pz ) );
}
......@@ -211,7 +211,7 @@ const Vec3 RigidBody::velFromBF( real_t px, real_t py, real_t pz ) const
*
* The function calculates the global velocity of a point relative to the body's center of mass.
*/
const Vec3 RigidBody::velFromBF( const Vec3& rpos ) const
Vec3 RigidBody::velFromBF( const Vec3& rpos ) const
{
if( !hasSuperBody() )
return v_ + w_ % ( R_ * rpos );
......@@ -230,7 +230,7 @@ const Vec3 RigidBody::velFromBF( const Vec3& rpos ) const
*
* The function calculates the global velocity of a point in global coordinates.
*/
const Vec3 RigidBody::velFromWF( real_t px, real_t py, real_t pz ) const
Vec3 RigidBody::velFromWF( real_t px, real_t py, real_t pz ) const
{
return velFromWF( Vec3( px, py, pz ) );
}
......@@ -245,7 +245,7 @@ const Vec3 RigidBody::velFromWF( real_t px, real_t py, real_t pz ) const
*
* The function calculates the global velocity of a point in global coordinates.
*/
const Vec3 RigidBody::velFromWF( const Vec3& gpos ) const
Vec3 RigidBody::velFromWF( const Vec3& gpos ) const
{
if( !hasSuperBody() )
return v_ + w_ % ( gpos - gpos_ );
......
......@@ -125,14 +125,14 @@ public:
inline const Vec3 vectorFromBFtoWF( const Vec3& v ) const;
inline const Vec3 pointFromBFtoWF ( real_t px, real_t py, real_t pz ) const;
inline const Vec3 pointFromBFtoWF ( const Vec3& rpos ) const;
virtual const Vec3 velFromBF ( real_t px, real_t py, real_t pz ) const;
virtual const Vec3 velFromBF ( const Vec3& rpos ) const;
virtual Vec3 velFromBF ( real_t px, real_t py, real_t pz ) const;
virtual Vec3 velFromBF ( const Vec3& rpos ) const;
inline const Vec3 vectorFromWFtoBF( real_t vx, real_t vy, real_t vz ) const;
inline const Vec3 vectorFromWFtoBF( const Vec3& v ) const;
inline const Vec3 pointFromWFtoBF ( real_t px, real_t py, real_t pz ) const;
inline const Vec3 pointFromWFtoBF ( const Vec3& gpos ) const;
virtual const Vec3 velFromWF ( real_t px, real_t py, real_t pz ) const;
virtual const Vec3 velFromWF ( const Vec3& gpos ) const;
virtual Vec3 velFromWF ( real_t px, real_t py, real_t pz ) const;
virtual Vec3 velFromWF ( const Vec3& gpos ) const;
inline const Vec3 accFromWF ( real_t px, real_t py, real_t pz ) const;
const Vec3 accFromWF ( const Vec3& gpos ) const;
......
......@@ -89,7 +89,7 @@ Squirmer::~Squirmer()
*
* The function calculates the global velocity of a point relative to the body's center of mass.
*/
const Vec3 Squirmer::velFromBF( real_t px, real_t py, real_t pz ) const
Vec3 Squirmer::velFromBF( real_t px, real_t py, real_t pz ) const
{
return velFromBF( Vec3( px, py, pz ) );
}
......@@ -104,7 +104,7 @@ const Vec3 Squirmer::velFromBF( real_t px, real_t py, real_t pz ) const
*
* The function calculates the global velocity of a point relative to the body's center of mass.
*/
const Vec3 Squirmer::velFromBF( const Vec3& rpos ) const
Vec3 Squirmer::velFromBF( const Vec3& rpos ) const
{
return Sphere::velFromBF( rpos ) + getSquirmerVelocity( getRotation() * rpos );
}
......@@ -120,7 +120,7 @@ const Vec3 Squirmer::velFromBF( const Vec3& rpos ) const
*
* The function calculates the global velocity of a point in global coordinates.
*/
const Vec3 Squirmer::velFromWF( real_t px, real_t py, real_t pz ) const
Vec3 Squirmer::velFromWF( real_t px, real_t py, real_t pz ) const
{
return velFromWF( Vec3( px, py, pz ) );
}
......@@ -133,7 +133,7 @@ const Vec3 Squirmer::velFromWF( real_t px, real_t py, real_t pz ) const
* \param rpos The relative global coordinate.
* \return The local surface velocity of the squirmer.
*/
const Vec3 Squirmer::getSquirmerVelocity( const Vec3& rpos ) const
Vec3 Squirmer::getSquirmerVelocity( const Vec3& rpos ) const
{
const auto rs = rpos.getNormalized();
const auto e = getQuaternion().rotate(Vec3(0.0,0.0,1.0)).getNormalized();
......@@ -152,7 +152,7 @@ const Vec3 Squirmer::getSquirmerVelocity( const Vec3& rpos ) const
*
* The function calculates the global velocity of a point in global coordinates.
*/
const Vec3 Squirmer::velFromWF( const Vec3& gpos ) const
Vec3 Squirmer::velFromWF( const Vec3& gpos ) const
{
return Sphere::velFromWF( gpos ) + getSquirmerVelocity( gpos - getPosition() );
}
......
......@@ -53,10 +53,10 @@ public:
inline real_t getSquirmerVelocity() const;
inline real_t getSquirmerBeta() const;
inline const Vec3 velFromBF ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
inline const Vec3 velFromBF ( const Vec3& rpos ) const WALBERLA_OVERRIDE;
inline const Vec3 velFromWF ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
inline const Vec3 velFromWF ( const Vec3& gpos ) const WALBERLA_OVERRIDE;
inline Vec3 velFromBF ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
inline Vec3 velFromBF ( const Vec3& rpos ) const WALBERLA_OVERRIDE;
inline Vec3 velFromWF ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
inline Vec3 velFromWF ( const Vec3& gpos ) const WALBERLA_OVERRIDE;
static inline id_t getStaticTypeID() WALBERLA_OVERRIDE;
//@}
......@@ -67,7 +67,7 @@ protected:
//**Get functions*******************************************************************************
/*!\name Get functions */
//@{
const Vec3 getSquirmerVelocity( const Vec3& rpos ) const;
Vec3 getSquirmerVelocity( const Vec3& rpos ) const;
//@}
//**Member variables****************************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment