pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
constants.hpp File Reference

Constants for the model. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

constexpr double Model::EPSILON = 1e-6
 Default computing precision value. More...
 
constexpr double Model::G = 6.67430e-11
 Default universal gravitational constant (in m³⋅kg⁻¹⋅s⁻²). More...
 
constexpr double Model::TARGET_DX = 0.01
 Heuristic for the maximum distance a body should travel in one step, used for adaptive time stepping. More...
 
constexpr double Model::MAX_DT = 0.01
 Maximum time step allowed for the simulation to ensure stability. More...
 
constexpr double Model::COEFF_RESTITUTION = 0.1
 Coefficient of restitution for collisions (e.g., 0.8 for a very bouncy ball). More...
 
constexpr double Model::COEFF_STATIC_FRICTION = 0.8
 Coefficient of static friction. More...
 
constexpr double Model::COEFF_FRICTION = 0.6
 Coefficient of kinetic (sliding) friction, also known as dynamic friction. More...
 
constexpr double Model::DT_DAMPING_FACTOR = 0.1
 Damping factor for smoothing adaptive time step changes. More...
 
constexpr double Model::POSITIONAL_CORRECTION_FACTOR = 0.2
 The percentage of overlap to correct per frame (Baumgarte stabilisation). More...
 
constexpr double Model::LINEAR_DAMPING = 0.005
 Damping factor for linear velocity. More...
 
constexpr double Model::ANGULAR_DAMPING = 0.005
 Damping factor for angular velocity. More...
 
constexpr int Model::DEFAULT_LOG_FREQ = 100
 Default frequency for logging system energy. More...
 
constexpr double Model::MIN_BODY_MASS = 25.0
 Minimum mass for randomly generated bodies. More...
 
constexpr double Model::MAX_BODY_MASS = 75.0
 Maximum mass for randomly generated bodies. More...
 
constexpr double Model::MIN_INITIAL_VELOCITY = -5.0
 Minimum initial velocity component for randomly generated bodies. More...
 
constexpr double Model::MAX_INITIAL_VELOCITY = 5.0
 Maximum initial velocity component for randomly generated bodies. More...
 
constexpr double Model::MAX_INITIAL_ANGULAR_VELOCITY = 0.5
 Maximum initial angular velocity component for randomly generated bodies (in rad/s). More...
 
constexpr double Model::PLACEMENT_SCALE_FACTOR = 4.0
 Heuristic scaling factor for the initial placement volume of bodies. More...
 
constexpr int Model::SETTLING_STEPS = 5
 The number of "settling" steps to run at the start of the simulation. More...
 
constexpr double Model::TORQUE_ARROW_SCALE = 0.1
 Scaling factor for the length of the torque visualization arrow. More...
 
constexpr double Model::ALPHA_ARROW_SCALE = 1.0
 Scaling factor for the length of the angular acceleration arrow. More...
 

Detailed Description

Constants for the model.

Author
Le Bars, Yoann

This file is part of the pure C++ benchmark.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Definition in file constants.hpp.

Variable Documentation

◆ ALPHA_ARROW_SCALE

constexpr double Model::ALPHA_ARROW_SCALE = 1.0
constexpr

Scaling factor for the length of the angular acceleration arrow.

Definition at line 101 of file constants.hpp.

◆ ANGULAR_DAMPING

constexpr double Model::ANGULAR_DAMPING = 0.005
constexpr

Damping factor for angular velocity.

Definition at line 66 of file constants.hpp.

◆ COEFF_FRICTION

constexpr double Model::COEFF_FRICTION = 0.6
constexpr

Coefficient of kinetic (sliding) friction, also known as dynamic friction.

Definition at line 53 of file constants.hpp.

◆ COEFF_RESTITUTION

constexpr double Model::COEFF_RESTITUTION = 0.1
constexpr

Coefficient of restitution for collisions (e.g., 0.8 for a very bouncy ball).

Definition at line 46 of file constants.hpp.

◆ COEFF_STATIC_FRICTION

constexpr double Model::COEFF_STATIC_FRICTION = 0.8
constexpr

Coefficient of static friction.

Definition at line 49 of file constants.hpp.

◆ DEFAULT_LOG_FREQ

constexpr int Model::DEFAULT_LOG_FREQ = 100
constexpr

Default frequency for logging system energy.

Definition at line 69 of file constants.hpp.

◆ DT_DAMPING_FACTOR

constexpr double Model::DT_DAMPING_FACTOR = 0.1
constexpr

Damping factor for smoothing adaptive time step changes.

Definition at line 56 of file constants.hpp.

◆ EPSILON

constexpr double Model::EPSILON = 1e-6
constexpr

Default computing precision value.

Definition at line 32 of file constants.hpp.

◆ G

constexpr double Model::G = 6.67430e-11
constexpr

Default universal gravitational constant (in m³⋅kg⁻¹⋅s⁻²).

Definition at line 35 of file constants.hpp.

◆ LINEAR_DAMPING

constexpr double Model::LINEAR_DAMPING = 0.005
constexpr

Damping factor for linear velocity.

Definition at line 63 of file constants.hpp.

◆ MAX_BODY_MASS

constexpr double Model::MAX_BODY_MASS = 75.0
constexpr

Maximum mass for randomly generated bodies.

Definition at line 76 of file constants.hpp.

◆ MAX_DT

constexpr double Model::MAX_DT = 0.01
constexpr

Maximum time step allowed for the simulation to ensure stability.

Definition at line 42 of file constants.hpp.

◆ MAX_INITIAL_ANGULAR_VELOCITY

constexpr double Model::MAX_INITIAL_ANGULAR_VELOCITY = 0.5
constexpr

Maximum initial angular velocity component for randomly generated bodies (in rad/s).

Definition at line 86 of file constants.hpp.

◆ MAX_INITIAL_VELOCITY

constexpr double Model::MAX_INITIAL_VELOCITY = 5.0
constexpr

Maximum initial velocity component for randomly generated bodies.

Definition at line 82 of file constants.hpp.

◆ MIN_BODY_MASS

constexpr double Model::MIN_BODY_MASS = 25.0
constexpr

Minimum mass for randomly generated bodies.

Definition at line 73 of file constants.hpp.

◆ MIN_INITIAL_VELOCITY

constexpr double Model::MIN_INITIAL_VELOCITY = -5.0
constexpr

Minimum initial velocity component for randomly generated bodies.

Definition at line 79 of file constants.hpp.

◆ PLACEMENT_SCALE_FACTOR

constexpr double Model::PLACEMENT_SCALE_FACTOR = 4.0
constexpr

Heuristic scaling factor for the initial placement volume of bodies.

Definition at line 90 of file constants.hpp.

◆ POSITIONAL_CORRECTION_FACTOR

constexpr double Model::POSITIONAL_CORRECTION_FACTOR = 0.2
constexpr

The percentage of overlap to correct per frame (Baumgarte stabilisation).

Definition at line 60 of file constants.hpp.

◆ SETTLING_STEPS

constexpr int Model::SETTLING_STEPS = 5
constexpr

The number of "settling" steps to run at the start of the simulation.

Definition at line 94 of file constants.hpp.

◆ TARGET_DX

constexpr double Model::TARGET_DX = 0.01
constexpr

Heuristic for the maximum distance a body should travel in one step, used for adaptive time stepping.

Definition at line 39 of file constants.hpp.

◆ TORQUE_ARROW_SCALE

constexpr double Model::TORQUE_ARROW_SCALE = 0.1
constexpr

Scaling factor for the length of the torque visualization arrow.

Definition at line 98 of file constants.hpp.