64 const Float targetRadius = 10.e3_f;
68 const Float spinRate = 2._f *
PI / (3600._f * 4._f);
72 const Float impactorRadius = 1.e3_f;
73 const Vector impactorOrigin =
74 (targetRadius + impactorRadius) *
Vector(
cos(impactAngle) + 0.05_f,
sin(impactAngle), 0._f);
79 logWriter = makeAuto<NullLogWriter>();
82 triggers.pushBack(makeAuto<ProgressLog>(25._f));
87 output->dump(storage, stats);
92 Array<Path> filesToCheck = {
Path(
"collision/collision_0000.ssf"),
Path(
"collision/collision_0001.ssf") };
94 for (
Path file : filesToCheck) {
104 for (
Path file : filesToCheck) {
TEST_CASE("Collision", "[collision]")
void measureRun(const Path &file, Function< void()> run)
Outcome areFilesApproxEqual(const Path &path1, const Path &path2)
Checks if two .ssf files are almost equal (may have eps-differences in quantities).
const EmptyFlags EMPTY_FLAGS
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr Float DEG_TO_RAD
constexpr Float PI
Mathematical constants.
const SuccessTag SUCCESS
Global constant for successful outcome.
BasicVector< Float > Vector
Generic dynamically allocated resizable storage.
Non-owning view of particles belonging to the same body.
BodyView & addRotation(const Vector &omega, const RotationOrigin origin)
Adds an angular velocity to all particles of the body.
BodyView & addVelocity(const Vector &v)
Adds a velocity vector to all particles of the body.
virtual void setUp(SharedPtr< Storage > storage) override
Prepares the run, creates logger, output, ...
virtual void tearDown(const Storage &storage, const Statistics &stats) override
Called after the run.
Defines the interface for a run.
Statistics run(Storage &storage)
Runs the simulation.
Object for adding one or more bodies with given material into a Storage.
BodyView addMonolithicBody(Storage &storage, const BodySettings &body)
Creates a monolithic body by filling given domain with particles.
Object representing a 1D interval of real numbers.
Object representing a path on a filesystem.
Settings & set(const TEnum idx, TValue &&value, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0)
Saves a value into the settings.
Spherical domain, defined by the center of sphere and its radius.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
@ PRESSURE
Use force from pressure gradient in the solver.
@ SELF_GRAVITY
Use gravitational force in the model.
@ VON_MISES
Von Mises criterion.
@ COURANT
Time step determined using CFL condition.
@ BARNES_HUT
Use Barnes-Hut algorithm, approximating gravity by multipole expansion (up to octupole order)
@ PREDICTOR_CORRECTOR
Predictor-corrector scheme.
@ STANDARD
P_i / rho_i^2 + P_j / rho_j^2.
@ SPH_KERNEL
Use gravity smoothing kernel corresponding to selected SPH kernel.
@ ASYMMETRIC_SOLVER
Generic solver evaluating all derivatives asymmetrically.
@ STANDARD
Standard artificial viscosity term by Monaghan (1989).
@ HEXAGONAL
Hexagonally close packing.
@ SCALAR_GRADY_KIPP
Grady-Kipp model of fragmentation using scalar damage.
@ TILLOTSON
Tillotson (1962) equation of state.
@ DAMAGE_MIN
Estimate minimal value of damage used to determine timestepping error.
@ RHEOLOGY_DAMAGE
Model of fragmentation used within the rheological model.
@ INITIAL_DISTRIBUTION
Initial distribution of SPH particles within the domain, see DistributionEnum for options.
@ ENERGY
Initial specific internal energy.
@ PARTICLE_COUNT
Number of SPH particles in the body.
@ STRESS_TENSOR_MIN
Estimated minial value of stress tensor components used to determined timestepping error.
@ EOS
Equation of state for this material, see EosEnum for options.
@ ENERGY_RANGE
Allowed range of specific internal energy.
@ RHEOLOGY_YIELDING
Model of stress reducing used within the rheological model.
@ SPH_STRAIN_RATE_CORRECTION_TENSOR
@ RUN_OUTPUT_INTERVAL
Time interval of dumping data to disk.
@ TIMESTEPPING_MAX_TIMESTEP
@ FINDER_LEAF_SIZE
Maximum number of particles in a leaf node.
@ SPH_SOLVER_FORCES
List of forces to compute by the solver.
@ SPH_AV_TYPE
Type of used artificial viscosity.
@ SPH_AV_BETA
Artificial viscosity beta coefficient.
@ SPH_AV_ALPHA
Artificial viscosity alpha coefficient.
@ RUN_OUTPUT_PATH
Path where all output files (dumps, logs, ...) will be written.
@ SPH_SOLVER_TYPE
Selected solver for computing derivatives of physical variables.
@ TIMESTEPPING_INITIAL_TIMESTEP
@ SPH_ADAPTIVE_SMOOTHING_LENGTH
Solution for evolutions of the smoothing length.
@ GRAVITY_SOLVER
Algorithm to compute gravitational acceleration.
@ TIMESTEPPING_DERIVATIVE_FACTOR
Multiplicative factor k for the derivative criterion; dt = k * v / dv.
@ FRAME_ANGULAR_FREQUENCY
@ SPH_DISCRETIZATION
Specifies a discretization of SPH equations; see DiscretizationEnum.
@ RUN_OUTPUT_TYPE
Selected format of the output file, see IoEnum.
@ TIMESTEPPING_INTEGRATOR
Selected timestepping integrator.
@ TIMESTEPPING_COURANT_NUMBER
Courant number.
@ SPH_FINDER
Structure for searching nearest neighbours of particles.
@ RUN_NAME
User-specified name of the run, used in some output files.
@ GRAVITY_RECOMPUTATION_PERIOD
@ GRAVITY_OPENING_ANGLE
Opening angle Theta for multipole approximation of gravity.
@ GRAVITY_KERNEL
Gravity smoothing kernel.
@ RUN_OUTPUT_NAME
File name of the output file (including extension), where d is a placeholder for output number.
SharedPtr< IScheduler > getScheduler(const RunSettings &settings=RunSettings::getDefaults())
Outcome removePath(const Path &path, const Flags< RemovePathFlag > flags=EMPTY_FLAGS)