dune-vtk 2.12
Loading...
Searching...
No Matches
uid.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
3#pragma once
4
5#include <cstdlib>
6#include <cstring>
7#include <ctime>
8#include <string>
9
10namespace Dune::Vtk
11{
13 {
14 static const auto digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
15 static const int N = std::strlen(digits);
16
17 std::string id(len,' ');
18 for (std::size_t i = 0; i < len; ++i)
19 id[i] = digits[std::rand()%N];
20
21 return id;
22 }
23
24} // end namespace Dune::Vtk
Definition datacollector.hh:19
std::string uid(std::size_t len=8)
Definition uid.hh:12
int id()
static constexpr size_type N()
Implementation of DataCollector for cells, with continuous data.
Definition celltypedatacollector.hh:20
T rand(T... args)
T strlen(T... args)