suanPan
Loading...
Searching...
No Matches
Factory.hpp
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2023 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
31#ifndef FACTORY_HPP
32#define FACTORY_HPP
33
34#include <future>
36#include <Toolbox/container.h>
37#include <Element/MappingDOF.h>
38
39enum class AnalysisType {
40 NONE,
41 DISP,
42 EIGEN,
43 BUCKLE,
44 STATICS,
46};
47
48enum class StorageScheme {
49 FULL,
50 BAND,
53 SPARSE,
55};
56
57enum class SolverType {
58 LAPACK,
59 SPIKE,
60 SUPERLU,
61 MUMPS,
62 CUDA,
63 PARDISO,
64 FGMRES
65};
66
67template<sp_d T> class Factory final {
68 unsigned n_size = 0; // number of degrees of freedom
69 unsigned n_lobw = 0; // low bandwidth
70 unsigned n_upbw = 0; // up bandwidth
71 unsigned n_sfbw = n_lobw + n_upbw; // matrix storage offset
72 unsigned n_rfld = 0; // reference load size
73 unsigned n_mpc = 0; // multipoint constraint size
74 uword n_elem = 0;
75
76 AnalysisType analysis_type = AnalysisType::NONE; // type of analysis
77 StorageScheme storage_type = StorageScheme::FULL; // type of analysis
78
79 bool nlgeom = false;
80
81 SolverType solver = SolverType::LAPACK;
82 SolverSetting<T> setting{};
83
84 T error = 0.; // error produced by certain solvers
85
86 Col<T> ninja; // the result from A*X=B
87 Col<T> sushi; // modified right-hand side B
88
89 suanpan::set<uword> reference_dof;
90 SpMat<T> reference_load;
91
92 uvec auxiliary_encoding; // for constraints using multiplier method
93 Col<T> auxiliary_lambda; // for constraints using multiplier method
94 Col<T> auxiliary_resistance; // for constraints using multiplier method
95 Col<T> auxiliary_load; // for constraints using multiplier method
96 SpMat<T> auxiliary_stiffness; // for constraints using multiplier method
97
98 SpCol<T> trial_constraint_resistance;
99 SpCol<T> current_constraint_resistance;
100
101 T trial_time = T(0); // global trial (pseudo) time
102 T incre_time = T(0); // global incremental (pseudo) time
103 T current_time = T(0); // global current (pseudo) time
104 T pre_time = T(0); // global previous (pseudo) time
105
106 T strain_energy = T(0);
107 T kinetic_energy = T(0);
108 T viscous_energy = T(0);
109 T complementary_energy = T(0);
110 Col<T> momentum;
111
112 Col<T> trial_load_factor; // global trial load factor
113 Col<T> trial_load; // global trial load vector
114 Col<T> trial_settlement; // global trial displacement load vector
115 Col<T> trial_resistance; // global trial resistance vector
116 Col<T> trial_damping_force; // global trial damping force vector
117 Col<T> trial_inertial_force; // global trial inertial force vector
118 Col<T> trial_displacement; // global trial displacement vector
119 Col<T> trial_velocity; // global trial velocity vector
120 Col<T> trial_acceleration; // global trial acceleration vector
121 Col<T> trial_temperature; // global trial temperature vector
122
123 Col<T> incre_load_factor; // global incremental load vector
124 Col<T> incre_load; // global incremental load vector
125 Col<T> incre_settlement; // global incremental displacement load vector
126 Col<T> incre_resistance; // global incremental resistance vector
127 Col<T> incre_damping_force; // global incremental damping force vector
128 Col<T> incre_inertial_force; // global incremental inertial force vector
129 Col<T> incre_displacement; // global incremental displacement vector
130 Col<T> incre_velocity; // global incremental velocity vector
131 Col<T> incre_acceleration; // global incremental acceleration vector
132 Col<T> incre_temperature; // global incremental temperature vector
133
134 Col<T> current_load_factor; // global current load vector
135 Col<T> current_load; // global current load vector
136 Col<T> current_settlement; // global current displacement load vector
137 Col<T> current_resistance; // global current resistance vector
138 Col<T> current_damping_force; // global current damping force vector
139 Col<T> current_inertial_force; // global current inertial force vector
140 Col<T> current_displacement; // global current displacement vector
141 Col<T> current_velocity; // global current velocity vector
142 Col<T> current_acceleration; // global current acceleration vector
143 Col<T> current_temperature; // global current temperature vector
144
145 Col<T> pre_load_factor; // global previous load vector
146 Col<T> pre_load; // global previous load vector
147 Col<T> pre_settlement; // global previous displacement load vector
148 Col<T> pre_resistance; // global previous resistance vector
149 Col<T> pre_damping_force; // global previous damping force vector
150 Col<T> pre_inertial_force; // global previous inertial force vector
151 Col<T> pre_displacement; // global previous displacement vector
152 Col<T> pre_velocity; // global previous velocity vector
153 Col<T> pre_acceleration; // global previous acceleration vector
154 Col<T> pre_temperature; // global previous temperature vector
155
156 shared_ptr<MetaMat<T>> global_mass = nullptr; // global mass matrix
157 shared_ptr<MetaMat<T>> global_damping = nullptr; // global damping matrix
158 shared_ptr<MetaMat<T>> global_stiffness = nullptr; // global stiffness matrix
159 shared_ptr<MetaMat<T>> global_geometry = nullptr; // global geometry matrix
160
161 std::vector<std::mutex> global_mutex = std::vector<std::mutex>(20);
162
163 Col<T> eigenvalue; // eigenvalues
164
165 Mat<T> eigenvector; // eigenvectors
166
167 template<sp_d T1> friend unique_ptr<MetaMat<T1>> get_basic_container(const Factory<T1>*);
168 template<sp_d T1> friend unique_ptr<MetaMat<T1>> get_matrix_container(const Factory<T1>*);
169
170 void assemble_matrix_helper(shared_ptr<MetaMat<T>>&, const Mat<T>&, const uvec&, const std::vector<MappingDOF>&);
171
172public:
173 const bool initialized = false;
174
175 explicit Factory(unsigned = 0, AnalysisType = AnalysisType::NONE, StorageScheme = StorageScheme::FULL);
176
177 void set_size(unsigned);
178 [[nodiscard]] unsigned get_size() const;
179
180 void set_entry(uword);
181 [[nodiscard]] uword get_entry() const;
182
183 void set_nlgeom(bool);
184 [[nodiscard]] bool is_nlgeom() const;
185
187 [[nodiscard]] SolverType get_solver_type() const;
188
190 [[nodiscard]] const SolverSetting<double>& get_solver_setting() const;
191
193 [[nodiscard]] AnalysisType get_analysis_type() const;
194
196 [[nodiscard]] StorageScheme get_storage_scheme() const;
197
198 [[nodiscard]] bool is_sparse() const;
199
200 void set_bandwidth(unsigned, unsigned);
201 void get_bandwidth(unsigned&, unsigned&) const;
202
204 void set_reference_size(unsigned);
205 [[nodiscard]] unsigned get_reference_size() const;
206
207 void update_reference_dof(const uvec&);
209 [[nodiscard]] const suanpan::set<uword>& get_reference_dof() const;
210
211 void set_error(T);
212 T get_error() const;
213
214 /*************************INITIALIZER*************************/
215
216 int initialize();
217
219 void initialize_load();
225 void initialize_velocity();
229
230 void initialize_mass();
231 void initialize_damping();
233 void initialize_geometry();
234 void initialize_eigen();
235
236 /*************************SETTER*************************/
237
238 void set_ninja(const Col<T>&);
239 void set_sushi(const Col<T>&);
240
241 void set_mpc(unsigned);
242
243 void set_reference_load(const SpMat<T>&);
244
245 void set_trial_time(T);
246 void set_trial_load_factor(const Col<T>&);
247 void set_trial_load(const Col<T>&);
248 void set_trial_settlement(const Col<T>&);
249 void set_trial_resistance(const Col<T>&);
250 void set_trial_damping_force(const Col<T>&);
251 void set_trial_inertial_force(const Col<T>&);
252 void set_trial_displacement(const Col<T>&);
253 void set_trial_velocity(const Col<T>&);
254 void set_trial_acceleration(const Col<T>&);
255 void set_trial_temperature(const Col<T>&);
256
257 void set_incre_time(T);
258 void set_incre_load_factor(const Col<T>&);
259 void set_incre_load(const Col<T>&);
260 void set_incre_settlement(const Col<T>&);
261 void set_incre_resistance(const Col<T>&);
262 void set_incre_damping_force(const Col<T>&);
263 void set_incre_inertial_force(const Col<T>&);
264 void set_incre_displacement(const Col<T>&);
265 void set_incre_velocity(const Col<T>&);
266 void set_incre_acceleration(const Col<T>&);
267 void set_incre_temperature(const Col<T>&);
268
269 void set_current_time(T);
270 void set_current_load_factor(const Col<T>&);
271 void set_current_load(const Col<T>&);
272 void set_current_settlement(const Col<T>&);
273 void set_current_resistance(const Col<T>&);
274 void set_current_damping_force(const Col<T>&);
275 void set_current_inertial_force(const Col<T>&);
276 void set_current_displacement(const Col<T>&);
277 void set_current_velocity(const Col<T>&);
278 void set_current_acceleration(const Col<T>&);
279 void set_current_temperature(const Col<T>&);
280
281 void set_pre_time(T);
282 void set_pre_load_factor(const Col<T>&);
283 void set_pre_load(const Col<T>&);
284 void set_pre_settlement(const Col<T>&);
285 void set_pre_resistance(const Col<T>&);
286 void set_pre_damping_force(const Col<T>&);
287 void set_pre_inertial_force(const Col<T>&);
288 void set_pre_displacement(const Col<T>&);
289 void set_pre_velocity(const Col<T>&);
290 void set_pre_acceleration(const Col<T>&);
291 void set_pre_temperature(const Col<T>&);
292
293 void set_mass(const shared_ptr<MetaMat<T>>&);
294 void set_damping(const shared_ptr<MetaMat<T>>&);
295 void set_stiffness(const shared_ptr<MetaMat<T>>&);
296 void set_geometry(const shared_ptr<MetaMat<T>>&);
297
298 void set_eigenvalue(const Col<T>&);
299 void set_eigenvector(const Mat<T>&);
300
301 /*************************GETTER*************************/
302
303 const Col<T>& get_ninja() const;
304 const Col<T>& get_sushi() const;
305
306 [[nodiscard]] unsigned get_mpc() const;
307
308 const SpMat<T>& get_reference_load() const;
309
310 [[nodiscard]] const uvec& get_auxiliary_encoding() const;
311 const Col<T>& get_auxiliary_lambda() const;
312 const Col<T>& get_auxiliary_resistance() const;
313 const Col<T>& get_auxiliary_load() const;
314 const SpMat<T>& get_auxiliary_stiffness() const;
315
316 const SpCol<T>& get_trial_constraint_resistance() const;
317 const SpCol<T>& get_current_constraint_resistance() const;
318
323 const Col<T>& get_momentum();
324
325 T get_trial_time() const;
326 const Col<T>& get_trial_load_factor() const;
327 const Col<T>& get_trial_load() const;
328 const Col<T>& get_trial_settlement() const;
329 const Col<T>& get_trial_resistance() const;
330 const Col<T>& get_trial_damping_force() const;
331 const Col<T>& get_trial_inertial_force() const;
332 const Col<T>& get_trial_displacement() const;
333 const Col<T>& get_trial_velocity() const;
334 const Col<T>& get_trial_acceleration() const;
335 const Col<T>& get_trial_temperature() const;
336
337 T get_incre_time() const;
338 const Col<T>& get_incre_load_factor() const;
339 const Col<T>& get_incre_load() const;
340 const Col<T>& get_incre_settlement() const;
341 const Col<T>& get_incre_resistance() const;
342 const Col<T>& get_incre_damping_force() const;
343 const Col<T>& get_incre_inertial_force() const;
344 const Col<T>& get_incre_displacement() const;
345 const Col<T>& get_incre_velocity() const;
346 const Col<T>& get_incre_acceleration() const;
347 const Col<T>& get_incre_temperature() const;
348
349 T get_current_time() const;
350 const Col<T>& get_current_load_factor() const;
351 const Col<T>& get_current_load() const;
352 const Col<T>& get_current_settlement() const;
353 const Col<T>& get_current_resistance() const;
354 const Col<T>& get_current_damping_force() const;
355 const Col<T>& get_current_inertial_force() const;
356 const Col<T>& get_current_displacement() const;
357 const Col<T>& get_current_velocity() const;
358 const Col<T>& get_current_acceleration() const;
359 const Col<T>& get_current_temperature() const;
360
361 T get_pre_time() const;
362 const Col<T>& get_pre_load_factor() const;
363 const Col<T>& get_pre_load() const;
364 const Col<T>& get_pre_settlement() const;
365 const Col<T>& get_pre_resistance() const;
366 const Col<T>& get_pre_damping_force() const;
367 const Col<T>& get_pre_inertial_force() const;
368 const Col<T>& get_pre_displacement() const;
369 const Col<T>& get_pre_velocity() const;
370 const Col<T>& get_pre_acceleration() const;
371 const Col<T>& get_pre_temperature() const;
372
373 const shared_ptr<MetaMat<T>>& get_mass() const;
374 const shared_ptr<MetaMat<T>>& get_damping() const;
375 const shared_ptr<MetaMat<T>>& get_stiffness() const;
376 const shared_ptr<MetaMat<T>>& get_geometry() const;
377
378 std::mutex& get_auxiliary_encoding_mutex();
379 std::mutex& get_auxiliary_resistance_mutex();
380 std::mutex& get_auxiliary_load_mutex();
381 std::mutex& get_auxiliary_stiffness_mutex();
382
384
385 std::mutex& get_trial_load_mutex();
386 std::mutex& get_trial_settlement_mutex();
387
388 std::mutex& get_mass_mutex();
389 std::mutex& get_damping_mutex();
390 std::mutex& get_stiffness_mutex();
391 std::mutex& get_geometry_mutex();
392
393 const Col<T>& get_eigenvalue() const;
394 const Mat<T>& get_eigenvector() const;
395
396 /*************************UPDATER*************************/
397
398 void update_trial_time(T);
399 void update_trial_load_factor(const Col<T>&);
400 void update_trial_load(const Col<T>&);
401 void update_trial_settlement(const Col<T>&);
402 void update_trial_resistance(const Col<T>&);
403 void update_trial_damping_force(const Col<T>&);
404 void update_trial_inertial_force(const Col<T>&);
405 void update_trial_displacement(const Col<T>&);
406 void update_trial_velocity(const Col<T>&);
407 void update_trial_acceleration(const Col<T>&);
408 void update_trial_temperature(const Col<T>&);
409
410 void update_incre_time(T);
411 void update_incre_load_factor(const Col<T>&);
412 void update_incre_load(const Col<T>&);
413 void update_incre_settlement(const Col<T>&);
414 void update_incre_resistance(const Col<T>&);
415 void update_incre_damping_force(const Col<T>&);
416 void update_incre_inertial_force(const Col<T>&);
417 void update_incre_displacement(const Col<T>&);
418 void update_incre_velocity(const Col<T>&);
419 void update_incre_acceleration(const Col<T>&);
420 void update_incre_temperature(const Col<T>&);
421
423 void update_current_load_factor(const Col<T>&);
424 void update_current_load(const Col<T>&);
425 void update_current_settlement(const Col<T>&);
426 void update_current_resistance(const Col<T>&);
427 void update_current_damping_force(const Col<T>&);
428 void update_current_inertial_force(const Col<T>&);
429 void update_current_displacement(const Col<T>&);
430 void update_current_velocity(const Col<T>&);
431 void update_current_acceleration(const Col<T>&);
432 void update_current_temperature(const Col<T>&);
433
435 void update_trial_load_factor_by(const Col<T>&);
436 void update_trial_load_by(const Col<T>&);
437 void update_trial_settlement_by(const Col<T>&);
438 void update_trial_resistance_by(const Col<T>&);
439 void update_trial_damping_force_by(const Col<T>&);
440 void update_trial_inertial_force_by(const Col<T>&);
441 void update_trial_displacement_by(const Col<T>&);
442 void update_trial_velocity_by(const Col<T>&);
443 void update_trial_acceleration_by(const Col<T>&);
444 void update_trial_temperature_by(const Col<T>&);
445
447 void update_incre_load_factor_by(const Col<T>&);
448 void update_incre_load_by(const Col<T>&);
449 void update_incre_settlement_by(const Col<T>&);
450 void update_incre_resistance_by(const Col<T>&);
451 void update_incre_damping_force_by(const Col<T>&);
452 void update_incre_inertial_force_by(const Col<T>&);
453 void update_incre_displacement_by(const Col<T>&);
454 void update_incre_velocity_by(const Col<T>&);
455 void update_incre_acceleration_by(const Col<T>&);
456 void update_incre_temperature_by(const Col<T>&);
457
459 void update_current_load_factor_by(const Col<T>&);
460 void update_current_load_by(const Col<T>&);
461 void update_current_settlement_by(const Col<T>&);
462 void update_current_resistance_by(const Col<T>&);
463 void update_current_damping_force_by(const Col<T>&);
464 void update_current_inertial_force_by(const Col<T>&);
465 void update_current_displacement_by(const Col<T>&);
466 void update_current_velocity_by(const Col<T>&);
467 void update_current_acceleration_by(const Col<T>&);
468 void update_current_temperature_by(const Col<T>&);
469
470 /*************************FRIEND*************************/
471
472 template<sp_d T1> friend Col<T1>& get_ninja(const shared_ptr<Factory<T1>>&);
473 template<sp_d T1> friend Col<T1>& get_sushi(const shared_ptr<Factory<T1>>&);
474
475 template<sp_d T1> friend suanpan::set<uword>& get_reference_dof(const shared_ptr<Factory<T1>>&);
476 template<sp_d T1> friend SpMat<T1>& get_reference_load(const shared_ptr<Factory<T1>>&);
477
478 template<sp_d T1> friend uvec& get_auxiliary_encoding(const shared_ptr<Factory<T1>>&);
479 template<sp_d T1> friend Col<T1>& get_auxiliary_lambda(const shared_ptr<Factory<T1>>&);
480 template<sp_d T1> friend Col<T1>& get_auxiliary_resistance(const shared_ptr<Factory<T1>>&);
481 template<sp_d T1> friend Col<T1>& get_auxiliary_load(const shared_ptr<Factory<T1>>&);
482 template<sp_d T1> friend SpMat<T1>& get_auxiliary_stiffness(const shared_ptr<Factory<T1>>&);
483
484 template<sp_d T1> friend SpCol<T1>& get_trial_constraint_resistance(const shared_ptr<Factory<T1>>&);
485 template<sp_d T1> friend SpCol<T1>& get_current_constraint_resistance(const shared_ptr<Factory<T1>>&);
486
487 template<sp_d T1> friend T1& get_trial_time(const shared_ptr<Factory<T1>>&);
488 template<sp_d T1> friend Col<T1>& get_trial_load_factor(const shared_ptr<Factory<T1>>&);
489 template<sp_d T1> friend Col<T1>& get_trial_load(const shared_ptr<Factory<T1>>&);
490 template<sp_d T1> friend Col<T1>& get_trial_settlement(const shared_ptr<Factory<T1>>&);
491 template<sp_d T1> friend Col<T1>& get_trial_resistance(const shared_ptr<Factory<T1>>&);
492 template<sp_d T1> friend Col<T1>& get_trial_damping_force(const shared_ptr<Factory<T1>>&);
493 template<sp_d T1> friend Col<T1>& get_trial_inertial_force(const shared_ptr<Factory<T1>>&);
494 template<sp_d T1> friend Col<T1>& get_trial_displacement(const shared_ptr<Factory<T1>>&);
495 template<sp_d T1> friend Col<T1>& get_trial_velocity(const shared_ptr<Factory<T1>>&);
496 template<sp_d T1> friend Col<T1>& get_trial_acceleration(const shared_ptr<Factory<T1>>&);
497 template<sp_d T1> friend Col<T1>& get_trial_temperature(const shared_ptr<Factory<T1>>&);
498
499 template<sp_d T1> friend T1& get_incre_time(const shared_ptr<Factory<T1>>&);
500 template<sp_d T1> friend Col<T1>& get_incre_load_factor(const shared_ptr<Factory<T1>>&);
501 template<sp_d T1> friend Col<T1>& get_incre_load(const shared_ptr<Factory<T1>>&);
502 template<sp_d T1> friend Col<T1>& get_incre_settlement(const shared_ptr<Factory<T1>>&);
503 template<sp_d T1> friend Col<T1>& get_incre_resistance(const shared_ptr<Factory<T1>>&);
504 template<sp_d T1> friend Col<T1>& get_incre_damping_force(const shared_ptr<Factory<T1>>&);
505 template<sp_d T1> friend Col<T1>& get_incre_inertial_force(const shared_ptr<Factory<T1>>&);
506 template<sp_d T1> friend Col<T1>& get_incre_displacement(const shared_ptr<Factory<T1>>&);
507 template<sp_d T1> friend Col<T1>& get_incre_velocity(const shared_ptr<Factory<T1>>&);
508 template<sp_d T1> friend Col<T1>& get_incre_acceleration(const shared_ptr<Factory<T1>>&);
509 template<sp_d T1> friend Col<T1>& get_incre_temperature(const shared_ptr<Factory<T1>>&);
510
511 template<sp_d T1> friend T1& get_current_time(const shared_ptr<Factory<T1>>&);
512 template<sp_d T1> friend Col<T1>& get_current_load_factor(const shared_ptr<Factory<T1>>&);
513 template<sp_d T1> friend Col<T1>& get_current_load(const shared_ptr<Factory<T1>>&);
514 template<sp_d T1> friend Col<T1>& get_current_settlement(const shared_ptr<Factory<T1>>&);
515 template<sp_d T1> friend Col<T1>& get_current_resistance(const shared_ptr<Factory<T1>>&);
516 template<sp_d T1> friend Col<T1>& get_current_damping_force(const shared_ptr<Factory<T1>>&);
517 template<sp_d T1> friend Col<T1>& get_current_inertial_force(const shared_ptr<Factory<T1>>&);
518 template<sp_d T1> friend Col<T1>& get_current_displacement(const shared_ptr<Factory<T1>>&);
519 template<sp_d T1> friend Col<T1>& get_current_velocity(const shared_ptr<Factory<T1>>&);
520 template<sp_d T1> friend Col<T1>& get_current_acceleration(const shared_ptr<Factory<T1>>&);
521 template<sp_d T1> friend Col<T1>& get_current_temperature(const shared_ptr<Factory<T1>>&);
522
523 template<sp_d T1> friend T1& get_pre_time(const shared_ptr<Factory<T1>>&);
524 template<sp_d T1> friend Col<T1>& get_pre_load_factor(const shared_ptr<Factory<T1>>&);
525 template<sp_d T1> friend Col<T1>& get_pre_load(const shared_ptr<Factory<T1>>&);
526 template<sp_d T1> friend Col<T1>& get_pre_settlement(const shared_ptr<Factory<T1>>&);
527 template<sp_d T1> friend Col<T1>& get_pre_resistance(const shared_ptr<Factory<T1>>&);
528 template<sp_d T1> friend Col<T1>& get_pre_damping_force(const shared_ptr<Factory<T1>>&);
529 template<sp_d T1> friend Col<T1>& get_pre_inertial_force(const shared_ptr<Factory<T1>>&);
530 template<sp_d T1> friend Col<T1>& get_pre_displacement(const shared_ptr<Factory<T1>>&);
531 template<sp_d T1> friend Col<T1>& get_pre_velocity(const shared_ptr<Factory<T1>>&);
532 template<sp_d T1> friend Col<T1>& get_pre_acceleration(const shared_ptr<Factory<T1>>&);
533 template<sp_d T1> friend Col<T1>& get_pre_temperature(const shared_ptr<Factory<T1>>&);
534
535 template<sp_d T1> friend shared_ptr<MetaMat<T1>>& get_mass(const shared_ptr<Factory<T1>>&);
536 template<sp_d T1> friend shared_ptr<MetaMat<T1>>& get_damping(const shared_ptr<Factory<T1>>&);
537 template<sp_d T1> friend shared_ptr<MetaMat<T1>>& get_stiffness(const shared_ptr<Factory<T1>>&);
538 template<sp_d T1> friend shared_ptr<MetaMat<T1>>& get_geometry(const shared_ptr<Factory<T1>>&);
539
540 template<sp_d T1> friend Col<T1>& get_eigenvalue(const shared_ptr<Factory<T1>>&);
541 template<sp_d T1> friend Mat<T1>& get_eigenvector(const shared_ptr<Factory<T1>>&);
542
543 /*************************STATUS*************************/
544
545 void commit_energy();
546 void clear_energy();
547
548 void commit_status();
549 void commit_time();
550 void commit_load_factor();
551 void commit_load();
552 void commit_settlement();
553 void commit_resistance();
556 void commit_displacement();
557 void commit_velocity();
558 void commit_acceleration();
559 void commit_temperature();
561
562 void commit_pre_status();
563 void commit_pre_time();
565 void commit_pre_load();
571 void commit_pre_velocity();
574
575 void clear_status();
576 void clear_time();
577 void clear_load_factor();
578 void clear_load();
579 void clear_settlement();
580 void clear_resistance();
581 void clear_damping_force();
583 void clear_displacement();
584 void clear_velocity();
585 void clear_acceleration();
586 void clear_temperature();
588
589 void reset_status();
590 void reset_time();
591 void reset_load_factor();
592 void reset_load();
593 void reset_settlement();
594 void reset_resistance();
595 void reset_damping_force();
597 void reset_displacement();
598 void reset_velocity();
599 void reset_acceleration();
600 void reset_temperature();
602
603 void clear_eigen();
604 void clear_mass();
605 void clear_damping();
606 void clear_stiffness();
607 void clear_geometry();
608 void clear_auxiliary();
609
610 void reset();
611
612 /*************************ASSEMBLER*************************/
613
614 void assemble_resistance(const Mat<T>&, const uvec&);
615 void assemble_damping_force(const Mat<T>&, const uvec&);
616 void assemble_inertial_force(const Mat<T>&, const uvec&);
617
618 void assemble_mass(const Mat<T>&, const uvec&, const std::vector<MappingDOF>&);
619 void assemble_damping(const Mat<T>&, const uvec&, const std::vector<MappingDOF>&);
620 void assemble_stiffness(const Mat<T>&, const uvec&, const std::vector<MappingDOF>&);
621 void assemble_geometry(const Mat<T>&, const uvec&, const std::vector<MappingDOF>&);
622
623 void assemble_stiffness(const SpMat<T>&, const uvec&);
624
625 /*************************UTILITY*************************/
626
627 void print() const;
628};
629
630template<sp_d T> Factory<T>::Factory(const unsigned D, const AnalysisType AT, const StorageScheme SS)
631 : n_size(D)
632 , analysis_type(AT)
633 , storage_type(SS) {}
634
635template<sp_d T> void Factory<T>::set_size(const unsigned D) {
636 if(D == n_size) return;
637 n_size = D;
638 access::rw(initialized) = false;
639}
640
641template<sp_d T> unsigned Factory<T>::get_size() const { return n_size; }
642
643template<sp_d T> void Factory<T>::set_entry(const uword N) { n_elem = N; }
644
645template<sp_d T> uword Factory<T>::get_entry() const { return n_elem; }
646
647template<sp_d T> void Factory<T>::set_nlgeom(const bool B) {
648 if(B == nlgeom) return;
649 nlgeom = B;
650 access::rw(initialized) = false;
651}
652
653template<sp_d T> bool Factory<T>::is_nlgeom() const { return nlgeom; }
654
655template<sp_d T> void Factory<T>::set_solver_type(const SolverType E) { solver = E; }
656
657template<sp_d T> SolverType Factory<T>::get_solver_type() const { return solver; }
658
659template<sp_d T> void Factory<T>::set_solver_setting(const SolverSetting<double>& SS) { setting = SS; }
660
661template<sp_d T> const SolverSetting<double>& Factory<T>::get_solver_setting() const { return setting; }
662
663template<sp_d T> void Factory<T>::set_analysis_type(const AnalysisType AT) {
664 if(AT == analysis_type) return;
665 analysis_type = AT;
666 access::rw(initialized) = false;
667}
668
669template<sp_d T> AnalysisType Factory<T>::get_analysis_type() const { return analysis_type; }
670
671template<sp_d T> void Factory<T>::set_storage_scheme(const StorageScheme SS) {
672 if(SS == storage_type) return;
673 storage_type = SS;
674 access::rw(initialized) = false;
675}
676
677template<sp_d T> StorageScheme Factory<T>::get_storage_scheme() const { return storage_type; }
678
679template<sp_d T> bool Factory<T>::is_sparse() const { return StorageScheme::SPARSE == storage_type || StorageScheme::SPARSESYMM == storage_type; }
680
681template<sp_d T> void Factory<T>::set_bandwidth(const unsigned L, const unsigned U) {
682 if(L == n_lobw && U == n_upbw) return;
683 n_lobw = L;
684 n_upbw = U;
685 n_sfbw = L + U;
686 access::rw(initialized) = false;
687}
688
689template<sp_d T> void Factory<T>::get_bandwidth(unsigned& L, unsigned& U) const {
690 L = n_lobw;
691 U = n_upbw;
692}
693
694template<sp_d T> void Factory<T>::update_reference_size() { n_rfld = static_cast<unsigned>(reference_dof.size()); }
695
696template<sp_d T> void Factory<T>::set_reference_size(const unsigned S) {
697 if(S == n_rfld) return;
698 n_rfld = S;
699}
700
701template<sp_d T> unsigned Factory<T>::get_reference_size() const { return n_rfld; }
702
703template<sp_d T> void Factory<T>::update_reference_dof(const uvec& S) { reference_dof.insert(S.cbegin(), S.cend()); }
704
705template<sp_d T> void Factory<T>::set_reference_dof(const suanpan::set<uword>& D) { reference_dof = D; }
706
707template<sp_d T> const suanpan::set<uword>& Factory<T>::get_reference_dof() const { return reference_dof; }
708
709template<sp_d T> void Factory<T>::set_error(const T E) { error = E; }
710
711template<sp_d T> T Factory<T>::get_error() const { return error; }
712
713template<sp_d T> int Factory<T>::initialize() {
714 reference_dof.clear(); // clear reference dof vector in every step
715
716 if(initialized || n_size == 0) return 0;
717
718 ninja.zeros(n_size);
719 sushi.zeros(n_size);
720
721 reset();
722
723 switch(analysis_type) {
725 initialize_displacement();
726 break;
728 initialize_mass();
729 initialize_stiffness();
730 initialize_eigen();
731 break;
734 initialize_load();
735 initialize_resistance();
736 initialize_displacement();
737 initialize_stiffness();
738 initialize_geometry();
739 break;
741 initialize_load();
742 initialize_resistance();
743 initialize_damping_force();
744 initialize_inertial_force();
745 initialize_displacement();
746 initialize_velocity();
747 initialize_acceleration();
748 initialize_mass();
749 initialize_damping();
750 initialize_stiffness();
751 initialize_geometry();
752 break;
754 break;
755 }
756
757 initialize_auxiliary_resistance();
758
759 access::rw(initialized) = true;
760
761 return 0;
762}
763
764template<sp_d T> void Factory<T>::initialize_load_factor() {
765 if(n_rfld == 0) return;
766
767 trial_load_factor.zeros(n_rfld);
768 incre_load_factor.zeros(n_rfld);
769 current_load_factor.zeros(n_rfld);
770
771 reference_load.zeros(n_size, n_rfld);
772}
773
774template<sp_d T> void Factory<T>::initialize_load() {
775 trial_load.zeros(n_size);
776 incre_load.zeros(n_size);
777 current_load.zeros(n_size);
778}
779
780template<sp_d T> void Factory<T>::initialize_settlement() {
781 trial_settlement.zeros(n_size);
782 incre_settlement.zeros(n_size);
783 current_settlement.zeros(n_size);
784}
785
786template<sp_d T> void Factory<T>::initialize_resistance() {
787 trial_resistance.zeros(n_size);
788 incre_resistance.zeros(n_size);
789 current_resistance.zeros(n_size);
790}
791
793 trial_damping_force.zeros(n_size);
794 incre_damping_force.zeros(n_size);
795 current_damping_force.zeros(n_size);
796}
797
799 trial_inertial_force.zeros(n_size);
800 incre_inertial_force.zeros(n_size);
801 current_inertial_force.zeros(n_size);
802}
803
804template<sp_d T> void Factory<T>::initialize_displacement() {
805 trial_displacement.zeros(n_size);
806 incre_displacement.zeros(n_size);
807 current_displacement.zeros(n_size);
808}
809
810template<sp_d T> void Factory<T>::initialize_velocity() {
811 trial_velocity.zeros(n_size);
812 incre_velocity.zeros(n_size);
813 current_velocity.zeros(n_size);
814}
815
816template<sp_d T> void Factory<T>::initialize_acceleration() {
817 trial_acceleration.zeros(n_size);
818 incre_acceleration.zeros(n_size);
819 current_acceleration.zeros(n_size);
820}
821
822template<sp_d T> void Factory<T>::initialize_temperature() {
823 trial_temperature.zeros(n_size);
824 incre_temperature.zeros(n_size);
825 current_temperature.zeros(n_size);
826}
827
829 trial_constraint_resistance.zeros(n_size);
830 current_constraint_resistance.zeros(n_size);
831}
832
833template<sp_d T> void Factory<T>::initialize_mass() { global_mass = get_matrix_container(this); }
834
835template<sp_d T> void Factory<T>::initialize_damping() { global_damping = get_matrix_container(this); }
836
837template<sp_d T> void Factory<T>::initialize_stiffness() { global_stiffness = get_matrix_container(this); }
838
839template<sp_d T> void Factory<T>::initialize_geometry() {
840 if(!nlgeom) return;
841
842 global_geometry = get_matrix_container(this);
843}
844
845template<sp_d T> void Factory<T>::initialize_eigen() {
846 eigenvalue.zeros(n_size);
847 eigenvector.zeros(n_size, n_size);
848}
849
850template<sp_d T> void Factory<T>::set_ninja(const Col<T>& N) { ninja = N; }
851
852template<sp_d T> void Factory<T>::set_sushi(const Col<T>& S) { sushi = S; }
853
854template<sp_d T> void Factory<T>::set_mpc(const unsigned S) {
855 n_mpc = S;
856 auxiliary_encoding.zeros(n_mpc);
857 auxiliary_resistance.zeros(n_mpc);
858 auxiliary_load.zeros(n_mpc);
859 auxiliary_stiffness.zeros(n_size, n_mpc);
860}
861
862template<sp_d T> void Factory<T>::set_reference_load(const SpMat<T>& L) { reference_load = L; }
863
864template<sp_d T> void Factory<T>::set_trial_time(const T M) { trial_time = M; }
865
866template<sp_d T> void Factory<T>::set_trial_load_factor(const Col<T>& L) { trial_load_factor = L; }
867
868template<sp_d T> void Factory<T>::set_trial_load(const Col<T>& L) { trial_load = L; }
869
870template<sp_d T> void Factory<T>::set_trial_settlement(const Col<T>& S) { trial_settlement = S; }
871
872template<sp_d T> void Factory<T>::set_trial_resistance(const Col<T>& R) { trial_resistance = R; }
873
874template<sp_d T> void Factory<T>::set_trial_damping_force(const Col<T>& R) { trial_damping_force = R; }
875
876template<sp_d T> void Factory<T>::set_trial_inertial_force(const Col<T>& R) { trial_inertial_force = R; }
877
878template<sp_d T> void Factory<T>::set_trial_displacement(const Col<T>& D) { trial_displacement = D; }
879
880template<sp_d T> void Factory<T>::set_trial_velocity(const Col<T>& V) { trial_velocity = V; }
881
882template<sp_d T> void Factory<T>::set_trial_acceleration(const Col<T>& A) { trial_acceleration = A; }
883
884template<sp_d T> void Factory<T>::set_trial_temperature(const Col<T>& M) { trial_temperature = M; }
885
886template<sp_d T> void Factory<T>::set_incre_time(const T M) { incre_time = M; }
887
888template<sp_d T> void Factory<T>::set_incre_load_factor(const Col<T>& L) { incre_load_factor = L; }
889
890template<sp_d T> void Factory<T>::set_incre_load(const Col<T>& L) { incre_load = L; }
891
892template<sp_d T> void Factory<T>::set_incre_settlement(const Col<T>& S) { incre_settlement = S; }
893
894template<sp_d T> void Factory<T>::set_incre_resistance(const Col<T>& R) { incre_resistance = R; }
895
896template<sp_d T> void Factory<T>::set_incre_damping_force(const Col<T>& R) { incre_damping_force = R; }
897
898template<sp_d T> void Factory<T>::set_incre_inertial_force(const Col<T>& R) { incre_inertial_force = R; }
899
900template<sp_d T> void Factory<T>::set_incre_displacement(const Col<T>& D) { incre_displacement = D; }
901
902template<sp_d T> void Factory<T>::set_incre_velocity(const Col<T>& V) { incre_velocity = V; }
903
904template<sp_d T> void Factory<T>::set_incre_acceleration(const Col<T>& A) { incre_acceleration = A; }
905
906template<sp_d T> void Factory<T>::set_incre_temperature(const Col<T>& M) { incre_temperature = M; }
907
908template<sp_d T> void Factory<T>::set_current_time(const T M) { current_time = M; }
909
910template<sp_d T> void Factory<T>::set_current_load_factor(const Col<T>& L) { current_load_factor = L; }
911
912template<sp_d T> void Factory<T>::set_current_load(const Col<T>& L) { current_load = L; }
913
914template<sp_d T> void Factory<T>::set_current_settlement(const Col<T>& S) { current_settlement = S; }
915
916template<sp_d T> void Factory<T>::set_current_resistance(const Col<T>& R) { current_resistance = R; }
917
918template<sp_d T> void Factory<T>::set_current_damping_force(const Col<T>& R) { current_damping_force = R; }
919
920template<sp_d T> void Factory<T>::set_current_inertial_force(const Col<T>& R) { current_inertial_force = R; }
921
922template<sp_d T> void Factory<T>::set_current_displacement(const Col<T>& D) { current_displacement = D; }
923
924template<sp_d T> void Factory<T>::set_current_velocity(const Col<T>& V) { current_velocity = V; }
925
926template<sp_d T> void Factory<T>::set_current_acceleration(const Col<T>& A) { current_acceleration = A; }
927
928template<sp_d T> void Factory<T>::set_current_temperature(const Col<T>& M) { current_temperature = M; }
929
930template<sp_d T> void Factory<T>::set_pre_time(const T M) { pre_time = M; }
931
932template<sp_d T> void Factory<T>::set_pre_load_factor(const Col<T>& L) { pre_load_factor = L; }
933
934template<sp_d T> void Factory<T>::set_pre_load(const Col<T>& L) { pre_load = L; }
935
936template<sp_d T> void Factory<T>::set_pre_settlement(const Col<T>& S) { pre_settlement = S; }
937
938template<sp_d T> void Factory<T>::set_pre_resistance(const Col<T>& R) { pre_resistance = R; }
939
940template<sp_d T> void Factory<T>::set_pre_damping_force(const Col<T>& R) { pre_damping_force = R; }
941
942template<sp_d T> void Factory<T>::set_pre_inertial_force(const Col<T>& R) { pre_inertial_force = R; }
943
944template<sp_d T> void Factory<T>::set_pre_displacement(const Col<T>& D) { pre_displacement = D; }
945
946template<sp_d T> void Factory<T>::set_pre_velocity(const Col<T>& V) { pre_velocity = V; }
947
948template<sp_d T> void Factory<T>::set_pre_acceleration(const Col<T>& A) { pre_acceleration = A; }
949
950template<sp_d T> void Factory<T>::set_pre_temperature(const Col<T>& M) { pre_temperature = M; }
951
952template<sp_d T> void Factory<T>::set_mass(const shared_ptr<MetaMat<T>>& M) { global_mass = M; }
953
954template<sp_d T> void Factory<T>::set_damping(const shared_ptr<MetaMat<T>>& C) { global_damping = C; }
955
956template<sp_d T> void Factory<T>::set_stiffness(const shared_ptr<MetaMat<T>>& K) { global_stiffness = K; }
957
958template<sp_d T> void Factory<T>::set_geometry(const shared_ptr<MetaMat<T>>& G) { global_geometry = G; }
959
960template<sp_d T> void Factory<T>::set_eigenvalue(const Col<T>& L) { eigenvalue = L; }
961
962template<sp_d T> void Factory<T>::set_eigenvector(const Mat<T>& V) { eigenvector = V; }
963
964template<sp_d T> const Col<T>& Factory<T>::get_ninja() const { return ninja; }
965
966template<sp_d T> const Col<T>& Factory<T>::get_sushi() const { return sushi; }
967
968template<sp_d T> unsigned Factory<T>::get_mpc() const { return n_mpc; }
969
970template<sp_d T> const SpMat<T>& Factory<T>::get_reference_load() const { return reference_load; }
971
972template<sp_d T> const uvec& Factory<T>::get_auxiliary_encoding() const { return auxiliary_encoding; }
973
974template<sp_d T> const Col<T>& Factory<T>::get_auxiliary_lambda() const { return auxiliary_lambda; }
975
976template<sp_d T> const Col<T>& Factory<T>::get_auxiliary_resistance() const { return auxiliary_resistance; }
977
978template<sp_d T> const Col<T>& Factory<T>::get_auxiliary_load() const { return auxiliary_load; }
979
980template<sp_d T> const SpMat<T>& Factory<T>::get_auxiliary_stiffness() const { return auxiliary_stiffness; }
981
982template<sp_d T> const SpCol<T>& Factory<T>::get_trial_constraint_resistance() const { return trial_constraint_resistance; }
983
984template<sp_d T> const SpCol<T>& Factory<T>::get_current_constraint_resistance() const { return current_constraint_resistance; }
985
986template<sp_d T> T Factory<T>::get_strain_energy() { return strain_energy; }
987
988template<sp_d T> T Factory<T>::get_kinetic_energy() { return kinetic_energy; }
989
990template<sp_d T> T Factory<T>::get_viscous_energy() { return viscous_energy; }
991
992template<sp_d T> T Factory<T>::get_complementary_energy() { return complementary_energy; }
993
994template<sp_d T> const Col<T>& Factory<T>::get_momentum() { return momentum; }
995
996template<sp_d T> T Factory<T>::get_trial_time() const { return trial_time; }
997
998template<sp_d T> const Col<T>& Factory<T>::get_trial_load_factor() const { return trial_load_factor; }
999
1000template<sp_d T> const Col<T>& Factory<T>::get_trial_load() const { return trial_load; }
1001
1002template<sp_d T> const Col<T>& Factory<T>::get_trial_settlement() const { return trial_settlement; }
1003
1004template<sp_d T> const Col<T>& Factory<T>::get_trial_resistance() const { return trial_resistance; }
1005
1006template<sp_d T> const Col<T>& Factory<T>::get_trial_damping_force() const { return trial_damping_force; }
1007
1008template<sp_d T> const Col<T>& Factory<T>::get_trial_inertial_force() const { return trial_inertial_force; }
1009
1010template<sp_d T> const Col<T>& Factory<T>::get_trial_displacement() const { return trial_displacement; }
1011
1012template<sp_d T> const Col<T>& Factory<T>::get_trial_velocity() const { return trial_velocity; }
1013
1014template<sp_d T> const Col<T>& Factory<T>::get_trial_acceleration() const { return trial_acceleration; }
1015
1016template<sp_d T> const Col<T>& Factory<T>::get_trial_temperature() const { return trial_temperature; }
1017
1018template<sp_d T> T Factory<T>::get_incre_time() const { return incre_time; }
1019
1020template<sp_d T> const Col<T>& Factory<T>::get_incre_load_factor() const { return incre_load_factor; }
1021
1022template<sp_d T> const Col<T>& Factory<T>::get_incre_load() const { return incre_load; }
1023
1024template<sp_d T> const Col<T>& Factory<T>::get_incre_settlement() const { return incre_settlement; }
1025
1026template<sp_d T> const Col<T>& Factory<T>::get_incre_resistance() const { return incre_resistance; }
1027
1028template<sp_d T> const Col<T>& Factory<T>::get_incre_damping_force() const { return incre_damping_force; }
1029
1030template<sp_d T> const Col<T>& Factory<T>::get_incre_inertial_force() const { return incre_inertial_force; }
1031
1032template<sp_d T> const Col<T>& Factory<T>::get_incre_displacement() const { return incre_displacement; }
1033
1034template<sp_d T> const Col<T>& Factory<T>::get_incre_velocity() const { return incre_velocity; }
1035
1036template<sp_d T> const Col<T>& Factory<T>::get_incre_acceleration() const { return incre_acceleration; }
1037
1038template<sp_d T> const Col<T>& Factory<T>::get_incre_temperature() const { return incre_temperature; }
1039
1040template<sp_d T> T Factory<T>::get_current_time() const { return current_time; }
1041
1042template<sp_d T> const Col<T>& Factory<T>::get_current_load_factor() const { return current_load_factor; }
1043
1044template<sp_d T> const Col<T>& Factory<T>::get_current_load() const { return current_load; }
1045
1046template<sp_d T> const Col<T>& Factory<T>::get_current_settlement() const { return current_settlement; }
1047
1048template<sp_d T> const Col<T>& Factory<T>::get_current_resistance() const { return current_resistance; }
1049
1050template<sp_d T> const Col<T>& Factory<T>::get_current_damping_force() const { return current_damping_force; }
1051
1052template<sp_d T> const Col<T>& Factory<T>::get_current_inertial_force() const { return current_inertial_force; }
1053
1054template<sp_d T> const Col<T>& Factory<T>::get_current_displacement() const { return current_displacement; }
1055
1056template<sp_d T> const Col<T>& Factory<T>::get_current_velocity() const { return current_velocity; }
1057
1058template<sp_d T> const Col<T>& Factory<T>::get_current_acceleration() const { return current_acceleration; }
1059
1060template<sp_d T> const Col<T>& Factory<T>::get_current_temperature() const { return current_temperature; }
1061
1062template<sp_d T> T Factory<T>::get_pre_time() const { return pre_time; }
1063
1064template<sp_d T> const Col<T>& Factory<T>::get_pre_load_factor() const { return pre_load_factor; }
1065
1066template<sp_d T> const Col<T>& Factory<T>::get_pre_load() const { return pre_load; }
1067
1068template<sp_d T> const Col<T>& Factory<T>::get_pre_settlement() const { return pre_settlement; }
1069
1070template<sp_d T> const Col<T>& Factory<T>::get_pre_resistance() const { return pre_resistance; }
1071
1072template<sp_d T> const Col<T>& Factory<T>::get_pre_damping_force() const { return pre_damping_force; }
1073
1074template<sp_d T> const Col<T>& Factory<T>::get_pre_inertial_force() const { return pre_inertial_force; }
1075
1076template<sp_d T> const Col<T>& Factory<T>::get_pre_displacement() const { return pre_displacement; }
1077
1078template<sp_d T> const Col<T>& Factory<T>::get_pre_velocity() const { return pre_velocity; }
1079
1080template<sp_d T> const Col<T>& Factory<T>::get_pre_acceleration() const { return pre_acceleration; }
1081
1082template<sp_d T> const Col<T>& Factory<T>::get_pre_temperature() const { return pre_temperature; }
1083
1084template<sp_d T> const shared_ptr<MetaMat<T>>& Factory<T>::get_mass() const { return global_mass; }
1085
1086template<sp_d T> const shared_ptr<MetaMat<T>>& Factory<T>::get_damping() const { return global_damping; }
1087
1088template<sp_d T> const shared_ptr<MetaMat<T>>& Factory<T>::get_stiffness() const { return global_stiffness; }
1089
1090template<sp_d T> const shared_ptr<MetaMat<T>>& Factory<T>::get_geometry() const { return global_geometry; }
1091
1092template<sp_d T> std::mutex& Factory<T>::get_auxiliary_encoding_mutex() { return global_mutex.at(0); }
1093
1094template<sp_d T> std::mutex& Factory<T>::get_auxiliary_resistance_mutex() { return global_mutex.at(1); }
1095
1096template<sp_d T> std::mutex& Factory<T>::get_auxiliary_load_mutex() { return global_mutex.at(2); }
1097
1098template<sp_d T> std::mutex& Factory<T>::get_auxiliary_stiffness_mutex() { return global_mutex.at(3); }
1099
1100template<sp_d T> std::mutex& Factory<T>::get_trial_constraint_resistance_mutex() { return global_mutex.at(4); }
1101
1102template<sp_d T> std::mutex& Factory<T>::get_trial_load_mutex() { return global_mutex.at(5); }
1103
1104template<sp_d T> std::mutex& Factory<T>::get_trial_settlement_mutex() { return global_mutex.at(6); }
1105
1106template<sp_d T> std::mutex& Factory<T>::get_mass_mutex() { return global_mutex.at(7); }
1107
1108template<sp_d T> std::mutex& Factory<T>::get_damping_mutex() { return global_mutex.at(8); }
1109
1110template<sp_d T> std::mutex& Factory<T>::get_stiffness_mutex() { return global_mutex.at(9); }
1111
1112template<sp_d T> std::mutex& Factory<T>::get_geometry_mutex() { return global_mutex.at(10); }
1113
1114template<sp_d T> const Col<T>& Factory<T>::get_eigenvalue() const { return eigenvalue; }
1115
1116template<sp_d T> const Mat<T>& Factory<T>::get_eigenvector() const { return eigenvector; }
1117
1118template<sp_d T> void Factory<T>::update_trial_time(const T M) {
1119 trial_time = M;
1120 incre_time = trial_time - current_time;
1121}
1122
1123template<sp_d T> void Factory<T>::update_trial_load_factor(const Col<T>& L) {
1124 trial_load_factor = L;
1125 incre_load_factor = trial_load_factor - current_load_factor;
1126}
1127
1128template<sp_d T> void Factory<T>::update_trial_load(const Col<T>& L) {
1129 trial_load = L;
1130 incre_load = trial_load - current_load;
1131}
1132
1133template<sp_d T> void Factory<T>::update_trial_settlement(const Col<T>& S) {
1134 trial_settlement = S;
1135 incre_settlement = trial_settlement - current_settlement;
1136}
1137
1138template<sp_d T> void Factory<T>::update_trial_resistance(const Col<T>& R) {
1139 trial_resistance = R;
1140 incre_resistance = trial_resistance - current_resistance;
1141}
1142
1143template<sp_d T> void Factory<T>::update_trial_damping_force(const Col<T>& R) {
1144 trial_damping_force = R;
1145 incre_damping_force = trial_damping_force - current_damping_force;
1146}
1147
1148template<sp_d T> void Factory<T>::update_trial_inertial_force(const Col<T>& R) {
1149 trial_inertial_force = R;
1150 incre_inertial_force = trial_inertial_force - current_inertial_force;
1151}
1152
1153template<sp_d T> void Factory<T>::update_trial_displacement(const Col<T>& D) {
1154 trial_displacement = D;
1155 incre_displacement = trial_displacement - current_displacement;
1156}
1157
1158template<sp_d T> void Factory<T>::update_trial_velocity(const Col<T>& V) {
1159 trial_velocity = V;
1160 incre_velocity = trial_velocity - current_velocity;
1161}
1162
1163template<sp_d T> void Factory<T>::update_trial_acceleration(const Col<T>& A) {
1164 trial_acceleration = A;
1165 incre_acceleration = trial_acceleration - current_acceleration;
1166}
1167
1168template<sp_d T> void Factory<T>::update_trial_temperature(const Col<T>& M) {
1169 trial_temperature = M;
1170 incre_temperature = trial_temperature - current_temperature;
1171}
1172
1173template<sp_d T> void Factory<T>::update_incre_time(const T M) {
1174 incre_time = M;
1175 trial_time = current_time + incre_time;
1176}
1177
1178template<sp_d T> void Factory<T>::update_incre_load_factor(const Col<T>& L) {
1179 incre_load_factor = L;
1180 trial_load_factor = current_load_factor + incre_load_factor;
1181}
1182
1183template<sp_d T> void Factory<T>::update_incre_load(const Col<T>& L) {
1184 incre_load = L;
1185 trial_load = current_load + incre_load;
1186}
1187
1188template<sp_d T> void Factory<T>::update_incre_settlement(const Col<T>& S) {
1189 incre_settlement = S;
1190 trial_settlement = current_settlement + incre_settlement;
1191}
1192
1193template<sp_d T> void Factory<T>::update_incre_resistance(const Col<T>& R) {
1194 incre_resistance = R;
1195 trial_resistance = current_resistance + incre_resistance;
1196}
1197
1198template<sp_d T> void Factory<T>::update_incre_damping_force(const Col<T>& R) {
1199 incre_damping_force = R;
1200 trial_damping_force = current_damping_force + incre_damping_force;
1201}
1202
1203template<sp_d T> void Factory<T>::update_incre_inertial_force(const Col<T>& R) {
1204 incre_inertial_force = R;
1205 trial_inertial_force = current_inertial_force + incre_inertial_force;
1206}
1207
1208template<sp_d T> void Factory<T>::update_incre_displacement(const Col<T>& D) {
1209 incre_displacement = D;
1210 trial_displacement = current_displacement + incre_displacement;
1211}
1212
1213template<sp_d T> void Factory<T>::update_incre_velocity(const Col<T>& V) {
1214 incre_velocity = V;
1215 trial_velocity = current_velocity + incre_velocity;
1216}
1217
1218template<sp_d T> void Factory<T>::update_incre_acceleration(const Col<T>& A) {
1219 incre_acceleration = A;
1220 trial_acceleration = current_acceleration + incre_acceleration;
1221}
1222
1223template<sp_d T> void Factory<T>::update_incre_temperature(const Col<T>& M) {
1224 incre_temperature = M;
1225 trial_temperature = current_temperature + incre_temperature;
1226}
1227
1228template<sp_d T> void Factory<T>::update_current_time(const T M) {
1229 trial_time = current_time = M;
1230 incre_time = T(0);
1231}
1232
1233template<sp_d T> void Factory<T>::update_current_load_factor(const Col<T>& L) {
1234 trial_load_factor = current_load_factor = L;
1235 incre_load_factor.zeros();
1236}
1237
1238template<sp_d T> void Factory<T>::update_current_load(const Col<T>& L) {
1239 trial_load = current_load = L;
1240 incre_load.zeros();
1241}
1242
1243template<sp_d T> void Factory<T>::update_current_settlement(const Col<T>& S) {
1244 trial_settlement = current_settlement = S;
1245 incre_settlement.zeros();
1246}
1247
1248template<sp_d T> void Factory<T>::update_current_resistance(const Col<T>& R) {
1249 trial_resistance = current_resistance = R;
1250 incre_resistance.zeros();
1251}
1252
1253template<sp_d T> void Factory<T>::update_current_damping_force(const Col<T>& R) {
1254 trial_damping_force = current_damping_force = R;
1255 incre_damping_force.zeros();
1256}
1257
1258template<sp_d T> void Factory<T>::update_current_inertial_force(const Col<T>& R) {
1259 trial_inertial_force = current_inertial_force = R;
1260 incre_inertial_force.zeros();
1261}
1262
1263template<sp_d T> void Factory<T>::update_current_displacement(const Col<T>& D) {
1264 trial_displacement = current_displacement = D;
1265 incre_displacement.zeros();
1266}
1267
1268template<sp_d T> void Factory<T>::update_current_velocity(const Col<T>& V) {
1269 trial_velocity = current_velocity = V;
1270 incre_velocity.zeros();
1271}
1272
1273template<sp_d T> void Factory<T>::update_current_acceleration(const Col<T>& A) {
1274 trial_acceleration = current_acceleration = A;
1275 incre_acceleration.zeros();
1276}
1277
1278template<sp_d T> void Factory<T>::update_current_temperature(const Col<T>& M) {
1279 trial_temperature = current_temperature = M;
1280 incre_temperature.zeros();
1281}
1282
1283template<sp_d T> void Factory<T>::update_trial_time_by(const T M) {
1284 trial_time += M;
1285 incre_time = trial_time - current_time;
1286}
1287
1288template<sp_d T> void Factory<T>::update_trial_load_factor_by(const Col<T>& L) {
1289 trial_load_factor += L;
1290 incre_load_factor = trial_load_factor - current_load_factor;
1291}
1292
1293template<sp_d T> void Factory<T>::update_trial_load_by(const Col<T>& L) {
1294 trial_load += L;
1295 incre_load = trial_load - current_load;
1296}
1297
1298template<sp_d T> void Factory<T>::update_trial_settlement_by(const Col<T>& S) {
1299 trial_settlement += S;
1300 incre_settlement = trial_settlement - current_settlement;
1301}
1302
1303template<sp_d T> void Factory<T>::update_trial_resistance_by(const Col<T>& R) {
1304 trial_resistance += R;
1305 incre_resistance = trial_resistance - current_resistance;
1306}
1307
1308template<sp_d T> void Factory<T>::update_trial_damping_force_by(const Col<T>& R) {
1309 trial_damping_force += R;
1310 incre_damping_force = trial_damping_force - current_damping_force;
1311}
1312
1313template<sp_d T> void Factory<T>::update_trial_inertial_force_by(const Col<T>& R) {
1314 trial_inertial_force += R;
1315 incre_inertial_force = trial_inertial_force - current_inertial_force;
1316}
1317
1318template<sp_d T> void Factory<T>::update_trial_displacement_by(const Col<T>& D) {
1319 trial_displacement += D;
1320 incre_displacement = trial_displacement - current_displacement;
1321}
1322
1323template<sp_d T> void Factory<T>::update_trial_velocity_by(const Col<T>& V) {
1324 trial_velocity += V;
1325 incre_velocity = trial_velocity - current_velocity;
1326}
1327
1328template<sp_d T> void Factory<T>::update_trial_acceleration_by(const Col<T>& A) {
1329 trial_acceleration += A;
1330 incre_acceleration = trial_acceleration - current_acceleration;
1331}
1332
1333template<sp_d T> void Factory<T>::update_trial_temperature_by(const Col<T>& M) {
1334 trial_temperature += M;
1335 incre_temperature = trial_temperature - current_temperature;
1336}
1337
1338template<sp_d T> void Factory<T>::update_incre_time_by(const T M) {
1339 incre_time += M;
1340 trial_time = current_time + incre_time;
1341}
1342
1343template<sp_d T> void Factory<T>::update_incre_load_factor_by(const Col<T>& L) {
1344 incre_load_factor += L;
1345 trial_load_factor = current_load_factor + incre_load_factor;
1346}
1347
1348template<sp_d T> void Factory<T>::update_incre_load_by(const Col<T>& L) {
1349 incre_load += L;
1350 trial_load = current_load + incre_load;
1351}
1352
1353template<sp_d T> void Factory<T>::update_incre_settlement_by(const Col<T>& S) {
1354 incre_settlement += S;
1355 trial_settlement = current_settlement + incre_settlement;
1356}
1357
1358template<sp_d T> void Factory<T>::update_incre_resistance_by(const Col<T>& R) {
1359 incre_resistance += R;
1360 trial_resistance = current_resistance + incre_resistance;
1361}
1362
1363template<sp_d T> void Factory<T>::update_incre_damping_force_by(const Col<T>& R) {
1364 incre_damping_force += R;
1365 trial_damping_force = current_damping_force + incre_damping_force;
1366}
1367
1368template<sp_d T> void Factory<T>::update_incre_inertial_force_by(const Col<T>& R) {
1369 incre_inertial_force += R;
1370 trial_inertial_force = current_inertial_force + incre_inertial_force;
1371}
1372
1373template<sp_d T> void Factory<T>::update_incre_displacement_by(const Col<T>& D) {
1374 incre_displacement += D;
1375 trial_displacement = current_displacement + incre_displacement;
1376}
1377
1378template<sp_d T> void Factory<T>::update_incre_velocity_by(const Col<T>& V) {
1379 incre_velocity += V;
1380 trial_velocity = current_velocity + incre_velocity;
1381}
1382
1383template<sp_d T> void Factory<T>::update_incre_acceleration_by(const Col<T>& A) {
1384 incre_acceleration += A;
1385 trial_acceleration = current_acceleration + incre_acceleration;
1386}
1387
1388template<sp_d T> void Factory<T>::update_incre_temperature_by(const Col<T>& M) {
1389 incre_temperature += M;
1390 trial_temperature = current_temperature + incre_temperature;
1391}
1392
1393template<sp_d T> void Factory<T>::update_current_time_by(const T M) {
1394 trial_time = current_time += M;
1395 incre_time = 0.;
1396}
1397
1398template<sp_d T> void Factory<T>::update_current_load_factor_by(const Col<T>& L) {
1399 trial_load_factor = current_load_factor += L;
1400 incre_load_factor.zeros();
1401}
1402
1403template<sp_d T> void Factory<T>::update_current_load_by(const Col<T>& L) {
1404 trial_load = current_load += L;
1405 incre_load.zeros();
1406}
1407
1408template<sp_d T> void Factory<T>::update_current_settlement_by(const Col<T>& S) {
1409 trial_settlement = current_settlement += S;
1410 incre_settlement.zeros();
1411}
1412
1413template<sp_d T> void Factory<T>::update_current_resistance_by(const Col<T>& R) {
1414 trial_resistance = current_resistance += R;
1415 incre_resistance.zeros();
1416}
1417
1418template<sp_d T> void Factory<T>::update_current_damping_force_by(const Col<T>& R) {
1419 trial_damping_force = current_damping_force += R;
1420 incre_damping_force.zeros();
1421}
1422
1423template<sp_d T> void Factory<T>::update_current_inertial_force_by(const Col<T>& R) {
1424 trial_inertial_force = current_inertial_force += R;
1425 incre_inertial_force.zeros();
1426}
1427
1428template<sp_d T> void Factory<T>::update_current_displacement_by(const Col<T>& D) {
1429 trial_displacement = current_displacement += D;
1430 incre_displacement.zeros();
1431}
1432
1433template<sp_d T> void Factory<T>::update_current_velocity_by(const Col<T>& V) {
1434 trial_velocity = current_velocity += V;
1435 incre_velocity.zeros();
1436}
1437
1438template<sp_d T> void Factory<T>::update_current_acceleration_by(const Col<T>& A) {
1439 trial_acceleration = current_acceleration += A;
1440 incre_acceleration.zeros();
1441}
1442
1443template<sp_d T> void Factory<T>::update_current_temperature_by(const Col<T>& M) {
1444 trial_temperature = current_temperature += M;
1445 incre_temperature.zeros();
1446}
1447
1448template<sp_d T> void Factory<T>::commit_energy() {
1449 auto se = std::async([&] { if(!trial_resistance.empty() && !incre_displacement.empty()) strain_energy += .5 * dot(trial_resistance + current_resistance, incre_displacement); });
1450 auto ke = std::async([&] { if(!trial_inertial_force.empty() && !trial_velocity.empty()) kinetic_energy = .5 * dot(global_mass * trial_velocity, trial_velocity); });
1451 auto ve = std::async([&] { if(!trial_damping_force.empty() && !incre_displacement.empty()) viscous_energy += .5 * dot(trial_damping_force + current_damping_force, incre_displacement); });
1452 auto ce = std::async([&] { if(!trial_displacement.empty() && !incre_resistance.empty()) complementary_energy += .5 * dot(trial_displacement + current_displacement, incre_resistance); });
1453 auto mm = std::async([&] { if(!trial_inertial_force.empty() && !trial_velocity.empty()) momentum = global_mass * trial_velocity; });
1454
1455 se.get();
1456 ke.get();
1457 ve.get();
1458 ce.get();
1459 mm.get();
1460}
1461
1462template<sp_d T> void Factory<T>::clear_energy() {
1463 strain_energy = T(0);
1464 kinetic_energy = T(0);
1465 viscous_energy = T(0);
1466 complementary_energy = T(0);
1467 momentum.zeros();
1468}
1469
1470template<sp_d T> void Factory<T>::commit_status() {
1471 ninja.zeros();
1472
1473 commit_energy();
1474
1475 commit_time();
1476 commit_load_factor();
1477 commit_load();
1478 commit_settlement();
1479 commit_resistance();
1480 commit_damping_force();
1481 commit_inertial_force();
1482 commit_displacement();
1483 commit_velocity();
1484 commit_acceleration();
1485 commit_temperature();
1486 commit_auxiliary_resistance();
1487}
1488
1489template<sp_d T> void Factory<T>::commit_time() {
1490 current_time = trial_time;
1491 incre_time = T(0);
1492}
1493
1494template<sp_d T> void Factory<T>::commit_load_factor() {
1495 if(trial_load_factor.is_empty()) return;
1496 current_load_factor = trial_load_factor;
1497 incre_load_factor.zeros();
1498}
1499
1500template<sp_d T> void Factory<T>::commit_load() {
1501 if(trial_load.is_empty()) return;
1502 current_load = trial_load;
1503 incre_load.zeros();
1504}
1505
1506template<sp_d T> void Factory<T>::commit_settlement() {
1507 if(trial_settlement.is_empty()) return;
1508 current_settlement = trial_settlement;
1509 incre_settlement.zeros();
1510}
1511
1512template<sp_d T> void Factory<T>::commit_resistance() {
1513 if(trial_resistance.is_empty()) return;
1514 current_resistance = trial_resistance;
1515 incre_resistance.zeros();
1516}
1517
1518template<sp_d T> void Factory<T>::commit_damping_force() {
1519 if(trial_damping_force.is_empty()) return;
1520 current_damping_force = trial_damping_force;
1521 incre_damping_force.zeros();
1522}
1523
1524template<sp_d T> void Factory<T>::commit_inertial_force() {
1525 if(trial_inertial_force.is_empty()) return;
1526 current_inertial_force = trial_inertial_force;
1527 incre_inertial_force.zeros();
1528}
1529
1530template<sp_d T> void Factory<T>::commit_displacement() {
1531 if(trial_displacement.is_empty()) return;
1532 current_displacement = trial_displacement;
1533 incre_displacement.zeros();
1534}
1535
1536template<sp_d T> void Factory<T>::commit_velocity() {
1537 if(trial_velocity.is_empty()) return;
1538 current_velocity = trial_velocity;
1539 incre_velocity.zeros();
1540}
1541
1542template<sp_d T> void Factory<T>::commit_acceleration() {
1543 if(trial_acceleration.is_empty()) return;
1544 current_acceleration = trial_acceleration;
1545 incre_acceleration.zeros();
1546}
1547
1548template<sp_d T> void Factory<T>::commit_temperature() {
1549 if(trial_temperature.is_empty()) return;
1550 current_temperature = trial_temperature;
1551 incre_temperature.zeros();
1552}
1553
1555 if(trial_constraint_resistance.is_empty()) return;
1556 current_constraint_resistance = trial_constraint_resistance;
1557}
1558
1559template<sp_d T> void Factory<T>::commit_pre_status() {
1560 commit_pre_time();
1561 commit_pre_load_factor();
1562 commit_pre_load();
1563 commit_pre_settlement();
1564 commit_pre_resistance();
1565 commit_pre_damping_force();
1566 commit_pre_inertial_force();
1567 commit_pre_displacement();
1568 commit_pre_velocity();
1569 commit_pre_acceleration();
1570 commit_pre_temperature();
1571}
1572
1573template<sp_d T> void Factory<T>::commit_pre_time() { pre_time = current_time; }
1574
1575template<sp_d T> void Factory<T>::commit_pre_load_factor() { if(!current_load_factor.is_empty()) pre_load_factor = current_load_factor; }
1576
1577template<sp_d T> void Factory<T>::commit_pre_load() { if(!current_load.is_empty()) pre_load = current_load; }
1578
1579template<sp_d T> void Factory<T>::commit_pre_settlement() { if(!current_settlement.is_empty()) pre_settlement = current_settlement; }
1580
1581template<sp_d T> void Factory<T>::commit_pre_resistance() { if(!current_resistance.is_empty()) pre_resistance = current_resistance; }
1582
1583template<sp_d T> void Factory<T>::commit_pre_damping_force() { if(!current_damping_force.is_empty()) pre_damping_force = current_damping_force; }
1584
1585template<sp_d T> void Factory<T>::commit_pre_inertial_force() { if(!current_inertial_force.is_empty()) pre_inertial_force = current_inertial_force; }
1586
1587template<sp_d T> void Factory<T>::commit_pre_displacement() { if(!current_displacement.is_empty()) pre_displacement = current_displacement; }
1588
1589template<sp_d T> void Factory<T>::commit_pre_velocity() { if(!current_velocity.is_empty()) pre_velocity = current_velocity; }
1590
1591template<sp_d T> void Factory<T>::commit_pre_acceleration() { if(!current_acceleration.is_empty()) pre_acceleration = current_acceleration; }
1592
1593template<sp_d T> void Factory<T>::commit_pre_temperature() { if(!current_temperature.is_empty()) pre_temperature = current_temperature; }
1594
1595template<sp_d T> void Factory<T>::clear_status() {
1596 access::rw(initialized) = false;
1597
1598 ninja.zeros();
1599
1600 clear_energy();
1601
1602 clear_time();
1603 clear_load_factor();
1604 clear_load();
1605 clear_settlement();
1606 clear_resistance();
1607 clear_damping_force();
1608 clear_inertial_force();
1609 clear_displacement();
1610 clear_velocity();
1611 clear_acceleration();
1612 clear_temperature();
1613 clear_auxiliary_resistance();
1614}
1615
1616template<sp_d T> void Factory<T>::clear_time() { trial_time = incre_time = current_time = 0.; }
1617
1618template<sp_d T> void Factory<T>::clear_load_factor() {
1619 if(!pre_load_factor.is_empty()) pre_load_factor.zeros();
1620 if(!trial_load_factor.is_empty()) trial_load_factor.zeros();
1621 if(!incre_load_factor.is_empty()) incre_load_factor.zeros();
1622 if(!current_load_factor.is_empty()) current_load_factor.zeros();
1623}
1624
1625template<sp_d T> void Factory<T>::clear_load() {
1626 if(!pre_load.is_empty()) pre_load.zeros();
1627 if(!trial_load.is_empty()) trial_load.zeros();
1628 if(!incre_load.is_empty()) incre_load.zeros();
1629 if(!current_load.is_empty()) current_load.zeros();
1630}
1631
1632template<sp_d T> void Factory<T>::clear_settlement() {
1633 if(!pre_settlement.is_empty()) pre_settlement.zeros();
1634 if(!trial_settlement.is_empty()) trial_settlement.zeros();
1635 if(!incre_settlement.is_empty()) incre_settlement.zeros();
1636 if(!current_settlement.is_empty()) current_settlement.zeros();
1637}
1638
1639template<sp_d T> void Factory<T>::clear_resistance() {
1640 if(!pre_resistance.is_empty()) pre_resistance.zeros();
1641 if(!trial_resistance.is_empty()) trial_resistance.zeros();
1642 if(!incre_resistance.is_empty()) incre_resistance.zeros();
1643 if(!current_resistance.is_empty()) current_resistance.zeros();
1644}
1645
1646template<sp_d T> void Factory<T>::clear_damping_force() {
1647 if(!pre_damping_force.is_empty()) pre_damping_force.zeros();
1648 if(!trial_damping_force.is_empty()) trial_damping_force.zeros();
1649 if(!incre_damping_force.is_empty()) incre_damping_force.zeros();
1650 if(!current_damping_force.is_empty()) current_damping_force.zeros();
1651}
1652
1653template<sp_d T> void Factory<T>::clear_inertial_force() {
1654 if(!pre_inertial_force.is_empty()) pre_inertial_force.zeros();
1655 if(!trial_inertial_force.is_empty()) trial_inertial_force.zeros();
1656 if(!incre_inertial_force.is_empty()) incre_inertial_force.zeros();
1657 if(!current_inertial_force.is_empty()) current_inertial_force.zeros();
1658}
1659
1660template<sp_d T> void Factory<T>::clear_displacement() {
1661 if(!pre_displacement.is_empty()) pre_displacement.zeros();
1662 if(!trial_displacement.is_empty()) trial_displacement.zeros();
1663 if(!incre_displacement.is_empty()) incre_displacement.zeros();
1664 if(!current_displacement.is_empty()) current_displacement.zeros();
1665}
1666
1667template<sp_d T> void Factory<T>::clear_velocity() {
1668 if(!pre_velocity.is_empty()) pre_velocity.zeros();
1669 if(!trial_velocity.is_empty()) trial_velocity.zeros();
1670 if(!incre_velocity.is_empty()) incre_velocity.zeros();
1671 if(!current_velocity.is_empty()) current_velocity.zeros();
1672}
1673
1674template<sp_d T> void Factory<T>::clear_acceleration() {
1675 if(!pre_acceleration.is_empty()) pre_acceleration.zeros();
1676 if(!trial_acceleration.is_empty()) trial_acceleration.zeros();
1677 if(!incre_acceleration.is_empty()) incre_acceleration.zeros();
1678 if(!current_acceleration.is_empty()) current_acceleration.zeros();
1679}
1680
1681template<sp_d T> void Factory<T>::clear_temperature() {
1682 if(!pre_temperature.is_empty()) pre_temperature.zeros();
1683 if(!trial_temperature.is_empty()) trial_temperature.zeros();
1684 if(!incre_temperature.is_empty()) incre_temperature.zeros();
1685 if(!current_temperature.is_empty()) current_temperature.zeros();
1686}
1687
1689 if(!trial_constraint_resistance.is_empty()) trial_constraint_resistance.zeros();
1690 if(!current_constraint_resistance.is_empty()) current_constraint_resistance.zeros();
1691}
1692
1693template<sp_d T> void Factory<T>::reset_status() {
1694 ninja.zeros();
1695
1696 reset_time();
1697 reset_load_factor();
1698 reset_load();
1699 reset_settlement();
1700 reset_resistance();
1701 reset_damping_force();
1702 reset_inertial_force();
1703 reset_displacement();
1704 reset_velocity();
1705 reset_acceleration();
1706 reset_temperature();
1707 reset_auxiliary_resistance();
1708}
1709
1710template<sp_d T> void Factory<T>::reset_time() {
1711 trial_time = current_time;
1712 incre_time = T(0);
1713}
1714
1715template<sp_d T> void Factory<T>::reset_load_factor() {
1716 if(trial_load_factor.is_empty()) return;
1717 trial_load_factor = current_load_factor;
1718 incre_load_factor.zeros();
1719}
1720
1721template<sp_d T> void Factory<T>::reset_load() {
1722 if(trial_load.is_empty()) return;
1723 trial_load = current_load;
1724 incre_load.zeros();
1725}
1726
1727template<sp_d T> void Factory<T>::reset_settlement() {
1728 if(trial_settlement.is_empty()) return;
1729 trial_settlement = current_settlement;
1730 incre_settlement.zeros();
1731}
1732
1733template<sp_d T> void Factory<T>::reset_resistance() {
1734 if(trial_resistance.is_empty()) return;
1735 trial_resistance = current_resistance;
1736 incre_resistance.zeros();
1737}
1738
1739template<sp_d T> void Factory<T>::reset_damping_force() {
1740 if(trial_damping_force.is_empty()) return;
1741 trial_damping_force = current_damping_force;
1742 incre_damping_force.zeros();
1743}
1744
1745template<sp_d T> void Factory<T>::reset_inertial_force() {
1746 if(trial_inertial_force.is_empty()) return;
1747 trial_inertial_force = current_inertial_force;
1748 incre_inertial_force.zeros();
1749}
1750
1751template<sp_d T> void Factory<T>::reset_displacement() {
1752 if(trial_displacement.is_empty()) return;
1753 trial_displacement = current_displacement;
1754 incre_displacement.zeros();
1755}
1756
1757template<sp_d T> void Factory<T>::reset_velocity() {
1758 if(trial_velocity.is_empty()) return;
1759 trial_velocity = current_velocity;
1760 incre_velocity.zeros();
1761}
1762
1763template<sp_d T> void Factory<T>::reset_acceleration() {
1764 if(trial_acceleration.is_empty()) return;
1765 trial_acceleration = current_acceleration;
1766 incre_acceleration.zeros();
1767}
1768
1769template<sp_d T> void Factory<T>::reset_temperature() {
1770 if(trial_temperature.is_empty()) return;
1771 trial_temperature = current_temperature;
1772 incre_temperature.zeros();
1773}
1774
1776 if(trial_constraint_resistance.is_empty()) return;
1777 trial_constraint_resistance = current_constraint_resistance;
1778}
1779
1780template<sp_d T> void Factory<T>::clear_eigen() {
1781 if(!eigenvalue.is_empty()) eigenvalue.zeros();
1782 if(!eigenvector.is_empty()) eigenvector.zeros();
1783}
1784
1785template<sp_d T> void Factory<T>::clear_mass() { if(global_mass != nullptr) global_mass->zeros(); }
1786
1787template<sp_d T> void Factory<T>::clear_damping() { if(global_damping != nullptr) global_damping->zeros(); }
1788
1789template<sp_d T> void Factory<T>::clear_stiffness() { if(global_stiffness != nullptr) global_stiffness->zeros(); }
1790
1791template<sp_d T> void Factory<T>::clear_geometry() { if(global_geometry != nullptr) global_geometry->zeros(); }
1792
1793template<sp_d T> void Factory<T>::clear_auxiliary() {
1794 n_mpc = 0;
1795 auxiliary_load.reset();
1796 auxiliary_stiffness.set_size(n_size, 0);
1797 auxiliary_resistance.reset();
1798 auxiliary_encoding.reset();
1799}
1800
1801template<sp_d T> void Factory<T>::reset() {
1802 global_mass = nullptr;
1803 global_damping = nullptr;
1804 global_stiffness = nullptr;
1805 global_geometry = nullptr;
1806}
1807
1808template<sp_d T> void Factory<T>::assemble_resistance(const Mat<T>& ER, const uvec& EI) {
1809 if(ER.is_empty()) return;
1810 for(auto I = 0llu; I < EI.n_elem; ++I) trial_resistance(EI(I)) += ER(I);
1811}
1812
1813template<sp_d T> void Factory<T>::assemble_damping_force(const Mat<T>& ER, const uvec& EI) {
1814 if(ER.is_empty()) return;
1815 for(auto I = 0llu; I < EI.n_elem; ++I) trial_damping_force(EI(I)) += ER(I);
1816}
1817
1818template<sp_d T> void Factory<T>::assemble_inertial_force(const Mat<T>& ER, const uvec& EI) {
1819 if(ER.is_empty()) return;
1820 for(auto I = 0llu; I < EI.n_elem; ++I) trial_inertial_force(EI(I)) += ER(I);
1821}
1822
1823template<sp_d T> void Factory<T>::assemble_matrix_helper(shared_ptr<MetaMat<T>>& GM, const Mat<T>& EM, const uvec& EI, const std::vector<MappingDOF>& MAP) {
1824 if(EM.is_empty()) return;
1825
1826 if(StorageScheme::BANDSYMM == storage_type || StorageScheme::SYMMPACK == storage_type) for(const auto [g_row, g_col, l_row, l_col] : MAP) GM->unsafe_at(g_row, g_col) += EM(l_row, l_col);
1827 else for(auto I = 0llu; I < EI.n_elem; ++I) for(auto J = 0llu; J < EI.n_elem; ++J) GM->unsafe_at(EI(J), EI(I)) += EM(J, I);
1828}
1829
1830template<sp_d T> void Factory<T>::assemble_mass(const Mat<T>& EM, const uvec& EI, const std::vector<MappingDOF>& MAP) { this->assemble_matrix_helper(global_mass, EM, EI, MAP); }
1831
1832template<sp_d T> void Factory<T>::assemble_damping(const Mat<T>& EC, const uvec& EI, const std::vector<MappingDOF>& MAP) { this->assemble_matrix_helper(global_damping, EC, EI, MAP); }
1833
1834template<sp_d T> void Factory<T>::assemble_stiffness(const Mat<T>& EK, const uvec& EI, const std::vector<MappingDOF>& MAP) { this->assemble_matrix_helper(global_stiffness, EK, EI, MAP); }
1835
1836template<sp_d T> void Factory<T>::assemble_geometry(const Mat<T>& EG, const uvec& EI, const std::vector<MappingDOF>& MAP) { this->assemble_matrix_helper(global_geometry, EG, EI, MAP); }
1837
1838template<sp_d T> void Factory<T>::assemble_stiffness(const SpMat<T>& EK, const uvec& EI) {
1839 if(EK.is_empty()) return;
1840 for(auto I = EK.begin(); I != EK.end(); ++I) global_stiffness->at(EI(I.row()), EI(I.col())) += *I;
1841}
1842
1843template<sp_d T> void Factory<T>::print() const {
1844 suanpan_info("A Factory object with size of {}.\n", n_size);
1845}
1846
1847#endif // FACTORY_HPP
1848
void reset(ExternalMaterialData *data, int *info)
Definition: ElasticExternal.cpp:74
unique_ptr< MetaMat< T > > get_matrix_container(const Factory< T > *const W)
Definition: FactoryHelper.hpp:61
A Factory class.
Definition: Factory.hpp:67
friend Col< T1 > & get_pre_settlement(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_velocity(const shared_ptr< Factory< T1 > > &)
friend SpMat< T1 > & get_reference_load(const shared_ptr< Factory< T1 > > &)
friend T1 & get_current_time(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_damping_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_resistance(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_auxiliary_resistance(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_inertial_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_displacement(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_load(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_acceleration(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_temperature(const shared_ptr< Factory< T1 > > &)
friend SpMat< T1 > & get_auxiliary_stiffness(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_load(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_acceleration(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_temperature(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_resistance(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_velocity(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_inertial_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_displacement(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_damping_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_settlement(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_acceleration(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_damping_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_settlement(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_displacement(const shared_ptr< Factory< T1 > > &)
friend unique_ptr< MetaMat< T1 > > get_basic_container(const Factory< T1 > *)
friend Col< T1 > & get_pre_load(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_damping_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_temperature(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_auxiliary_load(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_pre_inertial_force(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_ninja(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_settlement(const shared_ptr< Factory< T1 > > &)
friend T1 & get_pre_time(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_resistance(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_inertial_force(const shared_ptr< Factory< T1 > > &)
friend suanpan::set< uword > & get_reference_dof(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_acceleration(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_temperature(const shared_ptr< Factory< T1 > > &)
friend T1 & get_incre_time(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_eigenvalue(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_current_resistance(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_sushi(const shared_ptr< Factory< T1 > > &)
const bool initialized
Definition: Factory.hpp:173
friend unique_ptr< MetaMat< T1 > > get_matrix_container(const Factory< T1 > *)
friend Col< T1 > & get_incre_load(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_velocity(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_incre_displacement(const shared_ptr< Factory< T1 > > &)
friend Mat< T1 > & get_eigenvector(const shared_ptr< Factory< T1 > > &)
friend Col< T1 > & get_trial_velocity(const shared_ptr< Factory< T1 > > &)
friend T1 & get_trial_time(const shared_ptr< Factory< T1 > > &)
A MetaMat class that holds matrices.
Definition: MetaMat.hpp:39
void set_pre_inertial_force(const Col< T > &)
Definition: Factory.hpp:942
void set_eigenvalue(const Col< T > &)
Definition: Factory.hpp:960
void clear_acceleration()
Definition: Factory.hpp:1674
void initialize_load()
Definition: Factory.hpp:774
void set_mpc(unsigned)
Definition: Factory.hpp:854
void commit_temperature()
Definition: Factory.hpp:1548
bool is_sparse() const
Definition: Factory.hpp:679
void set_incre_velocity(const Col< T > &)
Definition: Factory.hpp:902
uword get_entry() const
Definition: Factory.hpp:645
void set_incre_temperature(const Col< T > &)
Definition: Factory.hpp:906
void assemble_stiffness(const Mat< T > &, const uvec &, const std::vector< MappingDOF > &)
Definition: Factory.hpp:1834
void print() const
Definition: Factory.hpp:1843
void clear_resistance()
Definition: Factory.hpp:1639
void initialize_auxiliary_resistance()
Definition: Factory.hpp:828
void clear_load_factor()
Definition: Factory.hpp:1618
void set_incre_acceleration(const Col< T > &)
Definition: Factory.hpp:904
int initialize()
Definition: Factory.hpp:713
const Col< T > & get_current_acceleration() const
Definition: Factory.hpp:1058
void update_incre_damping_force_by(const Col< T > &)
Definition: Factory.hpp:1363
const Col< T > & get_pre_damping_force() const
Definition: Factory.hpp:1072
void reset_displacement()
Definition: Factory.hpp:1751
void update_incre_temperature_by(const Col< T > &)
Definition: Factory.hpp:1388
void set_ninja(const Col< T > &)
Definition: Factory.hpp:850
void update_trial_temperature_by(const Col< T > &)
Definition: Factory.hpp:1333
bool is_nlgeom() const
Definition: Factory.hpp:653
void update_incre_load_factor_by(const Col< T > &)
Definition: Factory.hpp:1343
const Mat< T > & get_eigenvector() const
Definition: Factory.hpp:1116
const Col< T > & get_trial_velocity() const
Definition: Factory.hpp:1012
const Col< T > & get_trial_resistance() const
Definition: Factory.hpp:1004
void update_trial_load_factor_by(const Col< T > &)
Definition: Factory.hpp:1288
const Col< T > & get_ninja() const
Definition: Factory.hpp:964
void set_pre_velocity(const Col< T > &)
Definition: Factory.hpp:946
const Col< T > & get_current_load() const
Definition: Factory.hpp:1044
void set_trial_settlement(const Col< T > &)
Definition: Factory.hpp:870
void set_incre_load_factor(const Col< T > &)
Definition: Factory.hpp:888
void set_trial_time(T)
Definition: Factory.hpp:864
void update_incre_load_by(const Col< T > &)
Definition: Factory.hpp:1348
void set_solver_type(SolverType)
Definition: Factory.hpp:655
const Col< T > & get_pre_load() const
Definition: Factory.hpp:1066
void commit_acceleration()
Definition: Factory.hpp:1542
AnalysisType get_analysis_type() const
Definition: Factory.hpp:669
void set_current_resistance(const Col< T > &)
Definition: Factory.hpp:916
void update_incre_displacement(const Col< T > &)
Definition: Factory.hpp:1208
void set_incre_displacement(const Col< T > &)
Definition: Factory.hpp:900
void update_current_acceleration_by(const Col< T > &)
Definition: Factory.hpp:1438
const uvec & get_auxiliary_encoding() const
Definition: Factory.hpp:972
void reset_auxiliary_resistance()
Definition: Factory.hpp:1775
void commit_resistance()
Definition: Factory.hpp:1512
const Col< T > & get_incre_inertial_force() const
Definition: Factory.hpp:1030
void set_storage_scheme(StorageScheme)
Definition: Factory.hpp:671
void initialize_damping()
Definition: Factory.hpp:835
void update_incre_velocity(const Col< T > &)
Definition: Factory.hpp:1213
void initialize_geometry()
Definition: Factory.hpp:839
void update_incre_displacement_by(const Col< T > &)
Definition: Factory.hpp:1373
void update_current_damping_force_by(const Col< T > &)
Definition: Factory.hpp:1418
void assemble_mass(const Mat< T > &, const uvec &, const std::vector< MappingDOF > &)
Definition: Factory.hpp:1830
void set_trial_velocity(const Col< T > &)
Definition: Factory.hpp:880
void update_current_resistance(const Col< T > &)
Definition: Factory.hpp:1248
void clear_inertial_force()
Definition: Factory.hpp:1653
void update_trial_damping_force_by(const Col< T > &)
Definition: Factory.hpp:1308
unsigned get_mpc() const
Definition: Factory.hpp:968
const Col< T > & get_current_settlement() const
Definition: Factory.hpp:1046
const SolverSetting< double > & get_solver_setting() const
Definition: Factory.hpp:661
void commit_load_factor()
Definition: Factory.hpp:1494
std::mutex & get_damping_mutex()
Definition: Factory.hpp:1108
void update_trial_velocity_by(const Col< T > &)
Definition: Factory.hpp:1323
void update_current_load_by(const Col< T > &)
Definition: Factory.hpp:1403
const shared_ptr< MetaMat< T > > & get_damping() const
Definition: Factory.hpp:1086
void set_pre_settlement(const Col< T > &)
Definition: Factory.hpp:936
void set_nlgeom(bool)
Definition: Factory.hpp:647
StorageScheme get_storage_scheme() const
Definition: Factory.hpp:677
void commit_inertial_force()
Definition: Factory.hpp:1524
void update_current_time(T)
Definition: Factory.hpp:1228
void initialize_resistance()
Definition: Factory.hpp:786
const Col< T > & get_current_damping_force() const
Definition: Factory.hpp:1050
void set_solver_setting(const SolverSetting< double > &)
Definition: Factory.hpp:659
void update_trial_displacement_by(const Col< T > &)
Definition: Factory.hpp:1318
void set_mass(const shared_ptr< MetaMat< T > > &)
Definition: Factory.hpp:952
void reset_velocity()
Definition: Factory.hpp:1757
const Col< T > & get_trial_load_factor() const
Definition: Factory.hpp:998
void set_current_load(const Col< T > &)
Definition: Factory.hpp:912
std::mutex & get_trial_load_mutex()
Definition: Factory.hpp:1102
void initialize_stiffness()
Definition: Factory.hpp:837
void initialize_damping_force()
Definition: Factory.hpp:792
T get_current_time() const
Definition: Factory.hpp:1040
const Col< T > & get_pre_settlement() const
Definition: Factory.hpp:1068
void update_trial_temperature(const Col< T > &)
Definition: Factory.hpp:1168
void commit_velocity()
Definition: Factory.hpp:1536
void set_pre_time(T)
Definition: Factory.hpp:930
T get_complementary_energy()
Definition: Factory.hpp:992
void reset()
Definition: Factory.hpp:1801
const Col< T > & get_incre_displacement() const
Definition: Factory.hpp:1032
void set_current_damping_force(const Col< T > &)
Definition: Factory.hpp:918
void update_trial_acceleration(const Col< T > &)
Definition: Factory.hpp:1163
void set_current_time(T)
Definition: Factory.hpp:908
const Col< T > & get_auxiliary_load() const
Definition: Factory.hpp:978
void commit_pre_settlement()
Definition: Factory.hpp:1579
const shared_ptr< MetaMat< T > > & get_mass() const
Definition: Factory.hpp:1084
void commit_status()
Definition: Factory.hpp:1470
void commit_pre_load_factor()
Definition: Factory.hpp:1575
const suanpan::set< uword > & get_reference_dof() const
Definition: Factory.hpp:707
void set_incre_time(T)
Definition: Factory.hpp:886
void assemble_damping(const Mat< T > &, const uvec &, const std::vector< MappingDOF > &)
Definition: Factory.hpp:1832
void update_trial_inertial_force(const Col< T > &)
Definition: Factory.hpp:1148
void set_current_velocity(const Col< T > &)
Definition: Factory.hpp:924
void commit_displacement()
Definition: Factory.hpp:1530
void update_current_velocity_by(const Col< T > &)
Definition: Factory.hpp:1433
const Col< T > & get_incre_damping_force() const
Definition: Factory.hpp:1028
void update_trial_load_factor(const Col< T > &)
Definition: Factory.hpp:1123
void reset_load_factor()
Definition: Factory.hpp:1715
void clear_velocity()
Definition: Factory.hpp:1667
void update_current_load(const Col< T > &)
Definition: Factory.hpp:1238
void update_incre_time(T)
Definition: Factory.hpp:1173
void update_incre_settlement_by(const Col< T > &)
Definition: Factory.hpp:1353
unsigned get_reference_size() const
Definition: Factory.hpp:701
void update_current_acceleration(const Col< T > &)
Definition: Factory.hpp:1273
StorageScheme
Definition: Factory.hpp:48
void commit_pre_temperature()
Definition: Factory.hpp:1593
void commit_pre_status()
Definition: Factory.hpp:1559
void update_current_time_by(T)
Definition: Factory.hpp:1393
void set_trial_acceleration(const Col< T > &)
Definition: Factory.hpp:882
void update_trial_damping_force(const Col< T > &)
Definition: Factory.hpp:1143
const Col< T > & get_incre_settlement() const
Definition: Factory.hpp:1024
void reset_inertial_force()
Definition: Factory.hpp:1745
void set_reference_dof(const suanpan::set< uword > &)
Definition: Factory.hpp:705
const Col< T > & get_momentum()
Definition: Factory.hpp:994
void update_current_displacement(const Col< T > &)
Definition: Factory.hpp:1263
void clear_settlement()
Definition: Factory.hpp:1632
void set_pre_load(const Col< T > &)
Definition: Factory.hpp:934
std::mutex & get_auxiliary_stiffness_mutex()
Definition: Factory.hpp:1098
T get_incre_time() const
Definition: Factory.hpp:1018
void commit_pre_damping_force()
Definition: Factory.hpp:1583
T get_strain_energy()
Definition: Factory.hpp:986
void commit_pre_inertial_force()
Definition: Factory.hpp:1585
void update_trial_settlement(const Col< T > &)
Definition: Factory.hpp:1133
void set_trial_inertial_force(const Col< T > &)
Definition: Factory.hpp:876
const Col< T > & get_eigenvalue() const
Definition: Factory.hpp:1114
void commit_pre_displacement()
Definition: Factory.hpp:1587
std::mutex & get_geometry_mutex()
Definition: Factory.hpp:1112
void commit_pre_acceleration()
Definition: Factory.hpp:1591
const Col< T > & get_incre_velocity() const
Definition: Factory.hpp:1034
T get_trial_time() const
Definition: Factory.hpp:996
void update_current_temperature_by(const Col< T > &)
Definition: Factory.hpp:1443
void set_geometry(const shared_ptr< MetaMat< T > > &)
Definition: Factory.hpp:958
void set_incre_load(const Col< T > &)
Definition: Factory.hpp:890
void update_reference_size()
Definition: Factory.hpp:694
void set_pre_acceleration(const Col< T > &)
Definition: Factory.hpp:948
void set_incre_inertial_force(const Col< T > &)
Definition: Factory.hpp:898
T get_kinetic_energy()
Definition: Factory.hpp:988
void set_current_settlement(const Col< T > &)
Definition: Factory.hpp:914
void update_trial_settlement_by(const Col< T > &)
Definition: Factory.hpp:1298
void initialize_inertial_force()
Definition: Factory.hpp:798
void set_pre_resistance(const Col< T > &)
Definition: Factory.hpp:938
void commit_load()
Definition: Factory.hpp:1500
void update_trial_acceleration_by(const Col< T > &)
Definition: Factory.hpp:1328
const Col< T > & get_pre_acceleration() const
Definition: Factory.hpp:1080
void update_incre_acceleration_by(const Col< T > &)
Definition: Factory.hpp:1383
void commit_pre_load()
Definition: Factory.hpp:1577
void commit_pre_velocity()
Definition: Factory.hpp:1589
void update_trial_resistance_by(const Col< T > &)
Definition: Factory.hpp:1303
AnalysisType
Definition: Factory.hpp:39
void commit_pre_time()
Definition: Factory.hpp:1573
void commit_auxiliary_resistance()
Definition: Factory.hpp:1554
void update_current_settlement(const Col< T > &)
Definition: Factory.hpp:1243
void update_trial_load(const Col< T > &)
Definition: Factory.hpp:1128
void update_incre_load(const Col< T > &)
Definition: Factory.hpp:1183
void update_trial_time(T)
Definition: Factory.hpp:1118
const shared_ptr< MetaMat< T > > & get_stiffness() const
Definition: Factory.hpp:1088
void commit_settlement()
Definition: Factory.hpp:1506
const Col< T > & get_auxiliary_lambda() const
Definition: Factory.hpp:974
void reset_load()
Definition: Factory.hpp:1721
void reset_damping_force()
Definition: Factory.hpp:1739
void update_current_inertial_force_by(const Col< T > &)
Definition: Factory.hpp:1423
void set_trial_temperature(const Col< T > &)
Definition: Factory.hpp:884
std::mutex & get_auxiliary_encoding_mutex()
Definition: Factory.hpp:1092
SolverType
Definition: Factory.hpp:57
void assemble_damping_force(const Mat< T > &, const uvec &)
Definition: Factory.hpp:1813
const Col< T > & get_pre_displacement() const
Definition: Factory.hpp:1076
const Col< T > & get_current_inertial_force() const
Definition: Factory.hpp:1052
std::mutex & get_mass_mutex()
Definition: Factory.hpp:1106
const Col< T > & get_pre_load_factor() const
Definition: Factory.hpp:1064
const Col< T > & get_trial_displacement() const
Definition: Factory.hpp:1010
void update_trial_velocity(const Col< T > &)
Definition: Factory.hpp:1158
void update_current_temperature(const Col< T > &)
Definition: Factory.hpp:1278
void reset_temperature()
Definition: Factory.hpp:1769
std::mutex & get_auxiliary_resistance_mutex()
Definition: Factory.hpp:1094
void set_current_acceleration(const Col< T > &)
Definition: Factory.hpp:926
void update_current_settlement_by(const Col< T > &)
Definition: Factory.hpp:1408
void initialize_settlement()
Definition: Factory.hpp:780
void clear_damping()
Definition: Factory.hpp:1787
const Col< T > & get_incre_load_factor() const
Definition: Factory.hpp:1020
void clear_energy()
Definition: Factory.hpp:1462
const SpMat< T > & get_reference_load() const
Definition: Factory.hpp:970
void initialize_displacement()
Definition: Factory.hpp:804
void reset_time()
Definition: Factory.hpp:1710
const Col< T > & get_current_displacement() const
Definition: Factory.hpp:1054
unsigned get_size() const
Definition: Factory.hpp:641
void reset_settlement()
Definition: Factory.hpp:1727
void clear_damping_force()
Definition: Factory.hpp:1646
void set_analysis_type(AnalysisType)
Definition: Factory.hpp:663
const Col< T > & get_incre_load() const
Definition: Factory.hpp:1022
void set_entry(uword)
Definition: Factory.hpp:643
const Col< T > & get_incre_acceleration() const
Definition: Factory.hpp:1036
T get_pre_time() const
Definition: Factory.hpp:1062
void clear_geometry()
Definition: Factory.hpp:1791
T get_viscous_energy()
Definition: Factory.hpp:990
std::mutex & get_trial_constraint_resistance_mutex()
Definition: Factory.hpp:1100
const Col< T > & get_current_temperature() const
Definition: Factory.hpp:1060
void update_incre_time_by(T)
Definition: Factory.hpp:1338
void set_reference_size(unsigned)
Definition: Factory.hpp:696
void initialize_temperature()
Definition: Factory.hpp:822
void set_current_displacement(const Col< T > &)
Definition: Factory.hpp:922
void update_reference_dof(const uvec &)
Definition: Factory.hpp:703
const Col< T > & get_trial_inertial_force() const
Definition: Factory.hpp:1008
void set_current_inertial_force(const Col< T > &)
Definition: Factory.hpp:920
void set_trial_load(const Col< T > &)
Definition: Factory.hpp:868
void update_incre_temperature(const Col< T > &)
Definition: Factory.hpp:1223
void update_current_velocity(const Col< T > &)
Definition: Factory.hpp:1268
void set_error(T)
Definition: Factory.hpp:709
void assemble_geometry(const Mat< T > &, const uvec &, const std::vector< MappingDOF > &)
Definition: Factory.hpp:1836
const Col< T > & get_trial_settlement() const
Definition: Factory.hpp:1002
void set_eigenvector(const Mat< T > &)
Definition: Factory.hpp:962
void initialize_load_factor()
Definition: Factory.hpp:764
const Col< T > & get_trial_load() const
Definition: Factory.hpp:1000
void update_current_displacement_by(const Col< T > &)
Definition: Factory.hpp:1428
void set_trial_resistance(const Col< T > &)
Definition: Factory.hpp:872
void set_pre_load_factor(const Col< T > &)
Definition: Factory.hpp:932
void update_current_damping_force(const Col< T > &)
Definition: Factory.hpp:1253
void update_current_load_factor(const Col< T > &)
Definition: Factory.hpp:1233
void commit_energy()
Definition: Factory.hpp:1448
void commit_damping_force()
Definition: Factory.hpp:1518
T get_error() const
Definition: Factory.hpp:711
void update_trial_time_by(T)
Definition: Factory.hpp:1283
void update_incre_acceleration(const Col< T > &)
Definition: Factory.hpp:1218
const SpMat< T > & get_auxiliary_stiffness() const
Definition: Factory.hpp:980
void assemble_inertial_force(const Mat< T > &, const uvec &)
Definition: Factory.hpp:1818
void clear_status()
Definition: Factory.hpp:1595
void set_bandwidth(unsigned, unsigned)
Definition: Factory.hpp:681
void update_incre_velocity_by(const Col< T > &)
Definition: Factory.hpp:1378
const Col< T > & get_current_load_factor() const
Definition: Factory.hpp:1042
void commit_time()
Definition: Factory.hpp:1489
void clear_mass()
Definition: Factory.hpp:1785
void get_bandwidth(unsigned &, unsigned &) const
Definition: Factory.hpp:689
const Col< T > & get_pre_inertial_force() const
Definition: Factory.hpp:1074
void commit_pre_resistance()
Definition: Factory.hpp:1581
void reset_resistance()
Definition: Factory.hpp:1733
SolverType get_solver_type() const
Definition: Factory.hpp:657
std::mutex & get_auxiliary_load_mutex()
Definition: Factory.hpp:1096
const Col< T > & get_trial_acceleration() const
Definition: Factory.hpp:1014
void assemble_resistance(const Mat< T > &, const uvec &)
Definition: Factory.hpp:1808
void set_incre_damping_force(const Col< T > &)
Definition: Factory.hpp:896
const SpCol< T > & get_trial_constraint_resistance() const
Definition: Factory.hpp:982
void update_incre_damping_force(const Col< T > &)
Definition: Factory.hpp:1198
const Col< T > & get_pre_velocity() const
Definition: Factory.hpp:1078
const Col< T > & get_current_resistance() const
Definition: Factory.hpp:1048
void initialize_velocity()
Definition: Factory.hpp:810
std::mutex & get_stiffness_mutex()
Definition: Factory.hpp:1110
void update_incre_inertial_force_by(const Col< T > &)
Definition: Factory.hpp:1368
const Col< T > & get_current_velocity() const
Definition: Factory.hpp:1056
void update_incre_load_factor(const Col< T > &)
Definition: Factory.hpp:1178
void set_incre_resistance(const Col< T > &)
Definition: Factory.hpp:894
const Col< T > & get_pre_temperature() const
Definition: Factory.hpp:1082
void clear_load()
Definition: Factory.hpp:1625
const Col< T > & get_incre_temperature() const
Definition: Factory.hpp:1038
Factory(unsigned=0, AnalysisType=AnalysisType::NONE, StorageScheme=StorageScheme::FULL)
Definition: Factory.hpp:630
void set_size(unsigned)
Definition: Factory.hpp:635
void update_trial_displacement(const Col< T > &)
Definition: Factory.hpp:1153
const Col< T > & get_incre_resistance() const
Definition: Factory.hpp:1026
const Col< T > & get_sushi() const
Definition: Factory.hpp:966
const Col< T > & get_auxiliary_resistance() const
Definition: Factory.hpp:976
const Col< T > & get_trial_damping_force() const
Definition: Factory.hpp:1006
void update_current_resistance_by(const Col< T > &)
Definition: Factory.hpp:1413
void set_pre_temperature(const Col< T > &)
Definition: Factory.hpp:950
void update_trial_load_by(const Col< T > &)
Definition: Factory.hpp:1293
const SpCol< T > & get_current_constraint_resistance() const
Definition: Factory.hpp:984
void clear_auxiliary_resistance()
Definition: Factory.hpp:1688
void update_incre_resistance_by(const Col< T > &)
Definition: Factory.hpp:1358
void set_incre_settlement(const Col< T > &)
Definition: Factory.hpp:892
void set_sushi(const Col< T > &)
Definition: Factory.hpp:852
void update_incre_settlement(const Col< T > &)
Definition: Factory.hpp:1188
void set_pre_displacement(const Col< T > &)
Definition: Factory.hpp:944
void set_current_load_factor(const Col< T > &)
Definition: Factory.hpp:910
void set_trial_displacement(const Col< T > &)
Definition: Factory.hpp:878
void update_trial_resistance(const Col< T > &)
Definition: Factory.hpp:1138
void clear_eigen()
Definition: Factory.hpp:1780
void clear_auxiliary()
Definition: Factory.hpp:1793
void set_reference_load(const SpMat< T > &)
Definition: Factory.hpp:862
void update_incre_resistance(const Col< T > &)
Definition: Factory.hpp:1193
void update_current_load_factor_by(const Col< T > &)
Definition: Factory.hpp:1398
void set_trial_load_factor(const Col< T > &)
Definition: Factory.hpp:866
void initialize_eigen()
Definition: Factory.hpp:845
void update_incre_inertial_force(const Col< T > &)
Definition: Factory.hpp:1203
void clear_time()
Definition: Factory.hpp:1616
void set_stiffness(const shared_ptr< MetaMat< T > > &)
Definition: Factory.hpp:956
void clear_displacement()
Definition: Factory.hpp:1660
const shared_ptr< MetaMat< T > > & get_geometry() const
Definition: Factory.hpp:1090
void reset_status()
Definition: Factory.hpp:1693
void update_current_inertial_force(const Col< T > &)
Definition: Factory.hpp:1258
const Col< T > & get_trial_temperature() const
Definition: Factory.hpp:1016
void set_trial_damping_force(const Col< T > &)
Definition: Factory.hpp:874
std::mutex & get_trial_settlement_mutex()
Definition: Factory.hpp:1104
void initialize_mass()
Definition: Factory.hpp:833
void set_pre_damping_force(const Col< T > &)
Definition: Factory.hpp:940
void clear_temperature()
Definition: Factory.hpp:1681
void initialize_acceleration()
Definition: Factory.hpp:816
void update_trial_inertial_force_by(const Col< T > &)
Definition: Factory.hpp:1313
void set_current_temperature(const Col< T > &)
Definition: Factory.hpp:928
void set_damping(const shared_ptr< MetaMat< T > > &)
Definition: Factory.hpp:954
void reset_acceleration()
Definition: Factory.hpp:1763
const Col< T > & get_pre_resistance() const
Definition: Factory.hpp:1070
void clear_stiffness()
Definition: Factory.hpp:1789
std::set< T > set
Definition: container.h:54
Definition: SolverSetting.hpp:40
#define suanpan_info
Definition: suanPan.h:293