9 int main(
int argc,
char** argv) {
78 std::map<Size, Stats> stats;
82 std::cout <<
"Processing " << argv[i] << std::endl;
86 input.
load(
Path(argv[i]), storage, dummy);
91 for (
Size i = 0; i < damage.
size(); ++i) {
92 if (damage[i] > 0.9_f) {
100 Size comp2 = std::count_if(comps.
begin(), comps.
end(), [](
Size i) { return i != 0; });
101 std::unique_lock<std::mutex> lock(mutex);
102 stats[numParticles] = {
103 Float(comp1) / numParticles,
104 Float(comp2) / numParticles,
109 std::ofstream ofs(
"converg.txt");
110 for (
const auto& p : stats) {
111 ofs << p.first <<
" " << p.second.core <<
" " << p.second.fragment <<
" " << p.second.damaged
Various function for interpretation of the results of a simulation.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
int main(int argc, char **argv)
INLINE void parallelFor(IScheduler &scheduler, const Size from, const Size to, TFunctor &&functor)
Executes a functor concurrently from all available threads.
INLINE TCounter size() const
INLINE Iterator< StorageType > end() noexcept
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
INLINE TCounter size() const noexcept
INLINE Iterator< StorageType > begin() noexcept
Object representing a path on a filesystem.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
Size getParticleCnt() const
Returns the number of particles.
@ INDICES_SORTED
Use if the given array is already sorted (optimization)
void remove(ArrayView< const Size > idxs, const Flags< IndicesFlag > flags=EMPTY_FLAGS)
Removes specified particles from the storage.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
SharedPtr< IScheduler > getScheduler(const RunSettings &settings=RunSettings::getDefaults())
Size findComponents(const Storage &storage, const Float particleRadius, const Flags< ComponentFlag > flags, Array< Size > &indices)
Finds and marks connected components (a.k.a. separated bodies) in the array of vertices.