Commit eec8f9a2 authored by Marcus Mohr's avatar Marcus Mohr
Browse files

Adds documentation and statistics option to terraneo/plates stuff

Commit adds some minimal doxygen documentation to the public methods of
the PlateVelocityProvider class.

Additionally it makes the PlateVelocityDemo output statistics on points
for which no plates were found also when we only look for plate IDs.
parent e4a777c0
Pipeline #41052 canceled with stages
...@@ -101,9 +101,14 @@ void performComputations( uint_t level, ...@@ -101,9 +101,14 @@ void performComputations( uint_t level,
}; };
// callback function for determining plate IDs // callback function for determining plate IDs
std::function< real_t( const Point3D& ) > findPlateID = [&oracle, age]( const Point3D& point ) { std::function< real_t( const Point3D& ) > findPlateID = [&oracle, age, &handlerWithStatistics]( const Point3D& point ) {
vec3D coords{ point[0], point[1], point[2] }; vec3D coords{ point[0], point[1], point[2] };
return oracle.findPlateID( coords, age ); uint_t id = oracle.findPlateID( coords, age );
if ( id == oracle.idWhenNoPlateFound )
{
handlerWithStatistics( coords, age );
}
return id;
}; };
// create boundary condition object for the two surfaces // create boundary condition object for the two surfaces
......
...@@ -44,6 +44,10 @@ class PlateVelocityProvider ...@@ -44,6 +44,10 @@ class PlateVelocityProvider
[]( const std::string& filename ) { return terraneo::io::readRotationsFile( filename ); } ) []( const std::string& filename ) { return terraneo::io::readRotationsFile( filename ); } )
{} {}
/// Returns the plate ID for a point at a given age stage
///
/// This is basically an auxilliary function for testing plate detection and allows to
/// generate data to visualise plate movement.
uint_t findPlateID( const vec3D& point, const real_t age ) uint_t findPlateID( const vec3D& point, const real_t age )
{ {
uint_t plateID{ idWhenNoPlateFound }; uint_t plateID{ idWhenNoPlateFound };
...@@ -55,11 +59,20 @@ class PlateVelocityProvider ...@@ -55,11 +59,20 @@ class PlateVelocityProvider
return plateID; return plateID;
} }
/// Returns velocity vector for a point determined from the velocity of the associated plate at given age stage
///
/// This is the convenience (non-expert) version of the method which uses a
/// - LinearDistanceSmoother{ 0.015 }
/// - DefaultPlateNotFoundHandler{}
vec3D getPointVelocity( const vec3D& point, const real_t age ) vec3D getPointVelocity( const vec3D& point, const real_t age )
{ {
return getPointVelocity( point, age, LinearDistanceSmoother{ 0.015 }, DefaultPlateNotFoundHandler{} ); return getPointVelocity( point, age, LinearDistanceSmoother{ 0.015 }, DefaultPlateNotFoundHandler{} );
} }
/// Returns velocity vector for a point determined from the velocity of the associated plate at given age stage
///
/// This is the expert version of the method which allows to explicitely set a SmoothingStrategy and
/// a PlateNotFoundStrategy.
template < typename SmoothingStrategy, typename PlateNoteFoundStrategy > template < typename SmoothingStrategy, typename PlateNoteFoundStrategy >
vec3D getPointVelocity( const vec3D& point, vec3D getPointVelocity( const vec3D& point,
const real_t age, const real_t age,
...@@ -88,8 +101,10 @@ class PlateVelocityProvider ...@@ -88,8 +101,10 @@ class PlateVelocityProvider
return computeCartesianVelocityVector( plateRotations_, plateID, age, point, smoothingFactor ); return computeCartesianVelocityVector( plateRotations_, plateID, age, point, smoothingFactor );
}; };
/// Query function to obtain a vector of plate stages avaible in the datafiles
const std::vector< real_t >& getListOfPlateStages() const { return plateTopologies_.getListOfPlateStages(); } const std::vector< real_t >& getListOfPlateStages() const { return plateTopologies_.getListOfPlateStages(); }
/// Plate ID to be used when no associated plate was found for a point
const uint_t idWhenNoPlateFound{ 0 }; const uint_t idWhenNoPlateFound{ 0 };
private: private:
......
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