18 , ofs(
"rod/angmom.txt") {}
23 ofs << t <<
" " << L[
Y] <<
"\n";
79 const Float height = 100.e3_f;
83 std::cout <<
"Created " << storage->
getParticleCnt() <<
" particles" << std::endl;
85 const Float spinRate = 2._f *
PI / (3600._f * 1._f);
88 logWriter = makeAuto<NullLogWriter>();
91 triggers.pushBack(makeAuto<ProgressLog>(25._f));
93 triggers.pushBack(makeAuto<AngularMomentumLog>(1._f));
98 output->dump(storage, stats);
const EmptyFlags EMPTY_FLAGS
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr Float PI
Mathematical constants.
@ PRESSURE
Pressure, reduced by yielding and fracture model (multiplied by 1-damage); always a scalar quantity.
@ VELOCITY
Current velocities of particles, always a vector quantity.
@ POSITION
Positions of particles, always a vector quantity.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ SMOOTHING_LENGTH
Smoothing lenghts of particles.
@ DENSITY
Density, always a scalar quantity.
TEST_CASE("Rotating rod", "[rod]")
@ RUN_TIME
Current time of the simulation in code units. Does not necessarily have to be 0 when run starts.
BasicVector< Float > Vector
AngularMomentumLog(const Float period)
virtual AutoPtr< ITrigger > action(Storage &storage, Statistics &stats) override
Action executed when the condition is fulfilled.
Wrapper of pointer that deletes the resource from destructor.
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.
Cylinder aligned with z-axis, optionally including bases (can be either open or close cylinder).
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.
Trigger executing given action every period.
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.
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.
Object holding various statistics about current run.
TValue get(const StatisticsId idx) const
Returns value of a statistic.
Container storing all quantities used within the simulations.
Size getParticleCnt() const
Returns the number of particles.
Computes total angular momentum of all SPH particles with a respect to the reference frame.
virtual Vector evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
@ PRESSURE
Use force from pressure gradient in the solver.
@ ELASTIC
No yielding, just elastic deformations following Hooke's law.
@ COURANT
Time step determined using CFL condition.
@ BARNES_HUT
Use Barnes-Hut algorithm, approximating gravity by multipole expansion (up to octupole order)
@ TEXT_FILE
Formatted human-readable text file.
@ 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.
@ TILLOTSON
Tillotson (1962) equation of state.
@ 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.
@ 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.
@ RUN_OUTPUT_QUANTITIES
List of quantities to write to text output. Binary output always stores all quantitites.
@ 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())