| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | #ifndef PARAMETERS_HPP | |||
| 2 | #define PARAMETERS_HPP | |||
| 3 | ||||
| 4 | #include <cstddef> | |||
| 5 | #include <numbers> | |||
| 6 | #include "types.hpp" | |||
| 7 | #include "linalg.hpp" | |||
| 8 | ||||
| 9 | // numeric parameters | |||
| 10 | // const double PI = 3.141592653589793; | |||
| 11 | const double PI = std::numbers::pi_v<double>; | |||
| 12 | const double ZERO_CUTOFF = 1000000 * std::numeric_limits<double>::epsilon(); // approx 10E-10;// | |||
| 13 | const double VERY_LARGE = 10E100; | |||
| 14 | const int MAXBINOM = 100; | |||
| 15 | ||||
| 16 | // memory management | |||
| 17 | const int MICROTUBULE_GRANULARITY = 256; | |||
| 18 | const int SEGMENT_GRANULARITY = 1024; | |||
| 19 | const int TRAJECTORY_GRANULARITY = 512; | |||
| 20 | const int INTERSECTION_GRANULARITY = 4096; | |||
| 21 | const int EVENT_GRANULARITY = 1024; | |||
| 22 | const int OCCUPIED_INTERSECTION_GRANULARITY = 256; | |||
| 23 | ||||
| 24 | // maximum size of measurement cache (increase to minimize disk access) | |||
| 25 | const int MAX_HISTORY_SIZE = 256; | |||
| 26 | ||||
| 27 | // minimum size of measurement cache (minimum may be needed for trending) | |||
| 28 | const int MIN_HISTORY_SIZE = 64; | |||
| 29 | ||||
| 30 | const int POSITION_CACHE_SIZE = 32768; | |||
| 31 | const int CLOCK_POLLING_INTERVAL = 10000; | |||
| 32 | const int MEMORY_POLLING_INTERVAL = 200; | |||
| 33 | ||||
| 34 | // this is related to the total number of events | |||
| 35 | const int QUEUE_FLUSH_INTERVAL = 1000000; | |||
| 36 | ||||
| 37 | // used to create bins for biased nucleation | |||
| 38 | const int NUCLEATION_DISCRETIZATION_STEPS = 512; | |||
| 39 | ||||
| 40 | class Parameters | |||
| 41 | { | |||
| 42 | public: | |||
| 43 | ||||
| 44 | System* system; | |||
| 45 | double v_plus; | |||
| 46 | double v_min; | |||
| 47 | double v_tm; | |||
| 48 | double k_sev; | |||
| 49 | double k_cross; | |||
| 50 | double k_cat; | |||
| 51 | double k_res; | |||
| 52 | double k_nuc; | |||
| 53 | double pp_bforming_time; | |||
| 54 | double pool_density; | |||
| 55 | int treadmilling_enabled; | |||
| 56 | int severing_enabled; | |||
| 57 | int cross_severing_enabled; | |||
| 58 | int cross_severing_top; | |||
| 59 | double cross_severing_start_angle; | |||
| 60 | int ppb; | |||
| 61 | int restricted_pool; | |||
| 62 | int edge_catastrophe_enabled; | |||
| 63 | int edge_catastrophe_smooth; | |||
| 64 | double p_cat_special_edge_max; | |||
| 65 | double p_cat_regular_edge_max; | |||
| 66 | int edg_number; | |||
| 67 | int face_number; | |||
| 68 | std::map<std::string, double> edg_cat_map; | |||
| 69 | std::map<std::string, double> face_cat_map; | |||
| 70 | std::vector<double> region_kcat_multiplier; | |||
| 71 | NucleationType nucleation_type; | |||
| 72 | int zippering_enabled; | |||
| 73 | int catastrophes_enabled; | |||
| 74 | int proportional_catastrophes; | |||
| 75 | double induced_catastrophe_fraction; | |||
| 76 | double zip_fraction; | |||
| 77 | double pp_bk_nuc_fraction; | |||
| 78 | double cat_start_angle; | |||
| 79 | double magic_angle; | |||
| 80 | InteractionType interaction_type; | |||
| 81 | BundleType bundle_type; | |||
| 82 | std::string geom_param; | |||
| 83 | unsigned long seed; | |||
| 84 | double stop_time; | |||
| 85 | double measurement_interval; | |||
| 86 | double wall_clock_limit; | |||
| 87 | double memory_limit; | |||
| 88 | std::string input_dir; | |||
| 89 | std::string output_dir; | |||
| 90 | std::string movie_dir; | |||
| 91 | int create_subdir; | |||
| 92 | double new_parameter_read_interval; | |||
| 93 | std::string new_parameter_file; | |||
| 94 | int movie_enabled; | |||
| 95 | int show_output; | |||
| 96 | int show_mesh; | |||
| 97 | std::string geometry; | |||
| 98 | double movie_frame_interval; | |||
| 99 | double geometry_scale_factor; | |||
| 100 | ||||
| 101 | double c0_calc; | |||
| 102 | double x0_calc; | |||
| 103 | double z0_calc; | |||
| 104 | ||||
| 105 | public: | |||
| 106 | ||||
| 107 | Parameters(System*); | |||
| 108 | void initialize(const char*); | |||
| 109 | bool reinitialize(const char*); | |||
| 110 | bool read_from_file(const char*, bool); | |||
| 111 | bool write_to_file(); | |||
| 112 | void verify_parameters(); | |||
| 113 | bool calc_theory_parameters(); | |||
| 114 | }; | |||
| 115 | ||||
| 116 | struct OrderParameters | |||
| 117 | { | |||
| 118 | double r, c; | |||
| 119 | double rdirector[3]; | |||
| 120 | std::vector<double> local_order; | |||
| 121 | std::vector<Eigen::Vector3d> sv; | |||
| 122 | }; | |||
| 123 | ||||
| 124 | class OrderParametersRaw | |||
| 125 | { | |||
| 126 | public: | |||
| 127 | ||||
| 128 | double local_l; | |||
| 129 | double local_l_opt; | |||
| 130 | double qxx; | |||
| 131 | double qxy; | |||
| 132 | double qxz; | |||
| 133 | double qyy; | |||
| 134 | double qyz; | |||
| 135 | double qzz; | |||
| 136 | double local_order; | |||
| 137 | Eigen::Vector3d sv; | |||
| 138 | ||||
| 139 | ✗ | OrderParametersRaw(void) | ||
| 140 | ✗ | { | ||
| 141 | ✗ | local_l = 0.; | ||
| 142 | ✗ | local_l_opt = 0.; | ||
| 143 | ✗ | qxx = 0; | ||
| 144 | ✗ | qxy = 0; | ||
| 145 | ✗ | qxz = 0; | ||
| 146 | ✗ | qyy = 0; | ||
| 147 | ✗ | qyz = 0; | ||
| 148 | ✗ | qzz = 0; | ||
| 149 | ||||
| 150 | ✗ | sv << 0.0, 0.0, 0.0; | ||
| 151 | ||||
| 152 | ✗ | return; | ||
| 153 | } | |||
| 154 | ||||
| 155 | ✗ | double extract_r(double director[3], std::string geometry) | ||
| 156 | { | |||
| 157 | ✗ | Eigen::Matrix3d matrix{ { qxx, qxy, qxz }, { qxy, qyy, qyz }, { qxz, qyz, qzz } }; | ||
| 158 | Eigen::Matrix3d evec_mat{ Eigen::Matrix3d::Zero() }; | |||
| 159 | Eigen::Vector3d e_val{ Eigen::Vector3d::Zero() }; | |||
| 160 | double sel_eigen_val{ 0.0 }; | |||
| 161 | ||||
| 162 | ✗ | eigen_decomposition(matrix, evec_mat, e_val); | ||
| 163 | ||||
| 164 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | if (geometry == "2D-plane_1_0_0") | |
| 165 | { | |||
| 166 | int max_pos(0); | |||
| 167 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | if (e_val[1] > e_val[0]) | |
| 168 | { | |||
| 169 | max_pos = 1; | |||
| 170 | } | |||
| 171 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | if (e_val[2] > e_val[max_pos]) | |
| 172 | { | |||
| 173 | max_pos = 2; | |||
| 174 | } | |||
| 175 | ✗ | sel_eigen_val = std::fabs(e_val[max_pos]); | ||
| 176 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | for (size_t i = 0; i < 3; ++i) | |
| 177 | { | |||
| 178 | ✗ | director[i] = evec_mat(i, max_pos); | ||
| 179 | } | |||
| 180 | } | |||
| 181 | else | |||
| 182 | { | |||
| 183 | int min_pos(0); | |||
| 184 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | if (e_val[1] < e_val[0]) | |
| 185 | { | |||
| 186 | min_pos = 1; | |||
| 187 | } | |||
| 188 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | if (e_val[2] < e_val[min_pos]) | |
| 189 | { | |||
| 190 | min_pos = 2; | |||
| 191 | } | |||
| 192 | ✗ | sel_eigen_val = std::fabs(e_val[min_pos]); | ||
| 193 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | for (size_t i = 0; i < 3; ++i) | |
| 194 | { | |||
| 195 | ✗ | director[i] = evec_mat(i, min_pos); | ||
| 196 | } | |||
| 197 | } | |||
| 198 | ||||
| 199 | ✗ | return (sel_eigen_val); | ||
| 200 | } | |||
| 201 | }; | |||
| 202 | ||||
| 203 | #endif // PARAMETERS_HPP | |||
| 204 |