-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig_parser.h
89 lines (47 loc) · 1.48 KB
/
config_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#ifndef __CONFIG_PARSER_H
#define __CONFIG_PARSER_H
#include "rapidjson/rapidjson.h"
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include "BoundaryCondition.h"
#include "stdint.h"
#include "gflags/gflags.h"
DECLARE_string(jsonfile);
DECLARE_string(meshfile);
DECLARE_string(outdir);
DECLARE_double(power_penalty);
DECLARE_double(volume_ratio);
DECLARE_double(youngs_modulus);
DECLARE_double(damp_ratio);
DECLARE_double(design_step);
DECLARE_double(vol_reduction);
DECLARE_double(filter_radius);
DECLARE_int32(gridreso);
DECLARE_bool(enable_log);
DECLARE_int32(max_itn);
DECLARE_double(min_density);
DECLARE_double(poisson_ratio);
DECLARE_double(shell_width);
DECLARE_string(workmode);
DECLARE_string(testname);
DECLARE_bool(logdensity);
DECLARE_bool(logcompliance);
DECLARE_string(inputdensity);
DECLARE_string(testmesh);
struct config_parser_t {
static_range::rangeUnion loadArea;
static_range::rangeUnion fixArea;
dynamic_range::Field_t force_field;
std::function<bool(double[3])> inLoadArea;
std::function<bool(double[3])> inFixArea;
std::function<Eigen::Matrix<double, 3, 1>(double[3])> loadField;
std::vector<float> mesh_vertices;
std::vector<int> mesh_faces;
int logflag = 0;
void parse(int argc, char** argv);
void parse_benchmark_configuration(const std::string& filename);
void readMesh(const std::string& meshfile, std::vector<float>& coords, std::vector<int>& trfaces);
};
#endif