ALL 0.9.3
A Loadbalacing Library
Loading...
Searching...
No Matches
create_logo.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <cmath>
3
4// default size in x-direction
5#define LX_DEFAULT 40.0
6// default size in y-direction
7#define LY_DEFAULT 20.0
8// default number of particles in z-direction
9// size of system in z = 2 + nz
10#define NZ_DEFAULT 5
11
12int main(int argv, char** argc)
13{
14 // if applicable read in size in x
15 const double Lx = (argv >= 2)?atof(argc[1]):LX_DEFAULT;
16 // if applicable read in size in y
17 const double Ly = (argv >= 3)?atof(argc[2]):LY_DEFAULT;
18 // if applicable read in number of particles in z
19 const int nz = (argv >= 4)?atoi(argc[3]):NZ_DEFAULT;
20 const double Lz = 2 + (double)nz;
21
22 // output format: ASCII
23 // <id> <x> <y> <z> <weight (=1.0 -> all values have the same weight)
24
25 double l_a = std::sqrt(0.1) * Lx;
26 double l_b = std::sqrt(0.1) * Lx;
27 double l_c = 0.1 * Lx;
28 double l_d = 0.3 * Lx;
29 double l_e = 0.2 * Lx;
30 double l_f = 0.3 * Lx;
31 double l_g = 0.2 * Lx;
32
33 int n_a = std::ceil(l_a);
34 int n_b = std::ceil(l_b);
35 int n_c = 0.1 * Lx;
36 int n_d = 0.3 * Lx;
37 int n_e = 0.2 * Lx;
38 int n_f = 0.3 * Lx;
39 int n_g = 0.2 * Lx;
40
41 double d_a = l_a / (double)n_a;
42 double d_b = l_b / (double)n_b;
43 double d_c = 1.0;
44 double d_d = 1.0;
45 double d_e = 1.0;
46 double d_f = 1.0;
47 double d_g = 1.0;
48
49 int idx = 1;
50
51 // create left part of 'A'
52 for (int z = 1; z <= nz + 1; ++z)
53 for (int t = 0; t <= n_a; ++t)
54 std::cout << (idx++) << " "
55 << (1.0 + (double)t/(double)n_a) * 0.1 * Lx << " "
56 << (1.0 + 3.0 * (double)t/(double)n_a) * 0.1 * Lx << " "
57 << (double)z << " " << 1.0 << std::endl;
58
59 // create right part of 'A'
60 for (int z = 1; z <= nz + 1; ++z)
61 for (int t = 1; t <= n_b; ++t)
62 std::cout << (idx++) << " "
63 << (2.0 + (double)t/(double)n_b) * 0.1 * Lx << " "
64 << (4.0 - 3.0 * (double)t/(double)n_b) * 0.1 * Lx << " "
65 << (double)z << " " << 1.0 << std::endl;
66
67 // create horizontal line of 'A'
68 for (int z = 1; z <= nz + 1; ++z)
69 for (int t = 1; t < n_c; ++t)
70 std::cout << (idx++) << " "
71 << (1.5 + (double)t/(double)n_c) * 0.1 * Lx << " "
72 << 2.5 * 0.1 * Lx << " "
73 << (double)z << " " << 1.0 << std::endl;
74
75 // create vertical part of first 'L'
76 for (int z = 1; z <= nz + 1; ++z)
77 for (int t = 1; t <= n_d; ++t)
78 std::cout << (idx++) << " "
79 << 4.0 * 0.1 * Lx << " "
80 << (1.0 + 3.0 * (double)t/(double)n_d) * 0.1 * Lx << " "
81 << (double)z << " " << 1.0 << std::endl;
82
83 // create horizontal part of first 'L'
84 for (int z = 1; z <= nz + 1; ++z)
85 for (int t = 0; t <= n_e; ++t)
86 std::cout << (idx++) << " "
87 << (4.0 + 2.0 * (double)t/(double)n_e) * 0.1 * Lx << " "
88 << 1.0 * 0.1 * Lx << " "
89 << (double)z << " " << 1.0 << std::endl;
90
91 // create vertical part of second 'L'
92 for (int z = 1; z <= nz + 1; ++z)
93 for (int t = 1; t <= n_f; ++t)
94 std::cout << (idx++) << " "
95 << 7.0 * 0.1 * Lx << " "
96 << (1.0 + 3.0 * (double)t/(double)n_f) * 0.1 * Lx << " "
97 << (double)z << " " << 1.0 << std::endl;
98
99 // create horizontal part of second 'L'
100 for (int z = 1; z <= nz + 1; ++z)
101 for (int t = 0; t <= n_g; ++t)
102 std::cout << (idx++) << " "
103 << (7.0 + 2.0 * (double)t/(double)n_g) * 0.1 * Lx << " "
104 << 1.0 * 0.1 * Lx << " "
105 << (double)z << " " << 1.0 << std::endl;
106
107}
int main(int argc, char **argv)
#define LY_DEFAULT
#define NZ_DEFAULT
#define LX_DEFAULT