svMultiPhysics
Loading...
Searching...
No Matches
set_equation_props.h
1/* Copyright (c) Stanford University, The Regents of the University of California, and others.
2 *
3 * All Rights Reserved.
4 *
5 * See Copyright-SimVascular.txt for additional details.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject
13 * to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/// @brief The 'set_equation_props' map defined here sets equation
32/// properties from values read in from a file.
33///
34/// This replaces the 'SELECT CASE (eqName)' statement in the Fortran 'READEQ()' subroutine.
35//
36using SetEquationPropertiesMapType = std::map<consts::EquationType, std::function<void(Simulation*, EquationParameters*,
37 eqType&, EquationProps&, EquationOutputs&, EquationNdop&)>>;
38
39//--------------------
40// set_equation_props
41//--------------------
42//
43SetEquationPropertiesMapType set_equation_props = {
44
45//---------------------------//
46// phys_CEP //
47//---------------------------//
48//
49{consts::EquationType::phys_CEP, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
50 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
51{
52 using namespace consts;
53 auto& cep_mod = simulation->get_cep_mod();
54 lEq.phys = consts::EquationType::phys_CEP;
55
56 propL[0][0] = PhysicalProperyType::fluid_density;
57 propL[1][0] = PhysicalProperyType::backflow_stab;
58 propL[2][0] = PhysicalProperyType::f_x;
59 propL[3][0] = PhysicalProperyType::f_y;
60
61 if (simulation->com_mod.nsd == 3) {
62 propL[4][0] = PhysicalProperyType::f_z;
63 }
64
65 cep_mod.cepEq = true;
66
67 read_domain(simulation, eq_params, lEq, propL);
68
69 nDOP = {1, 1, 0, 0};
70 outPuts[0] = OutputNameType::out_voltage;
71
72 // Set solver parameters.
73 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
74
75} },
76
77//---------------------------//
78// phys_CMM //
79//---------------------------//
80//
81{consts::EquationType::phys_CMM, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
82 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
83{
84 using namespace consts;
85 auto& com_mod = simulation->get_com_mod();
86 lEq.phys = consts::EquationType::phys_CMM;
87
88 bool pstEq = eq_params->prestress.defined() && eq_params->prestress.value();
89
90 com_mod.cmmBdry.resize(com_mod.gtnNo);
91 if (eq_params->initialize.defined()) {
92 com_mod.cmmInit = true;
93
94 if (com_mod.nEq > 1) {
95 throw std::runtime_error("More than one eqn. is not allowed while initializing CMM.");
96 }
97
98 // Determine is there is a pre-stress.
99 //
100 auto init_str = eq_params->initialize();
101 std::transform(init_str.begin(), init_str.end(), init_str.begin(), ::tolower);
102
103 if (std::set<std::string>{"inflate", "inf"}.count(init_str) != 0) {
104 com_mod.pstEq = false;
105 } else if (std::set<std::string>{"prestress", "prest"}.count(init_str) != 0) {
106 com_mod.pstEq = true;
107 } else {
108 throw std::runtime_error("Unknown CMM initialize type '" + init_str + "'.");
109 }
110
111 // Set cmmBdry vector to be edge nodes of the wall
112 for (int iM = 0; iM < com_mod.nMsh; iM++) {
113 set_cmm_bdry(com_mod.msh[iM], com_mod.cmmBdry);
114 }
115 }
116
117 // Set variable wall properties.
118 //
119 if (eq_params->variable_wall_properties.defined()) {
120 com_mod.cmmVarWall = true;
121
122 if (com_mod.varWallProps.size() == 0) {
123 // varWallProps = array of size 2 x total number of nodes across all meshes and all processors; first column is thickness and second column is elastic modulus
124 com_mod.varWallProps.resize(2, com_mod.gtnNo);
125 }
126
127 auto mesh_name = eq_params->variable_wall_properties.mesh_name.value();
128 int iM = 0;
129 int iFa = 0;
130 if (com_mod.cmmInit) {
131 all_fun::find_msh(com_mod.msh, mesh_name, iM);
132 } else {
133 all_fun::find_face(com_mod.msh, mesh_name, iM, iFa);
134 }
135 auto file_path = eq_params->variable_wall_properties.wall_properties_file_path.value();
136 read_wall_props_ff(com_mod, file_path, iM, iFa);
137 }
138
139 if (!com_mod.cmmInit) {
140 propL[0][0] = PhysicalProperyType::fluid_density;
141 propL[1][0] = PhysicalProperyType::backflow_stab;
142 propL[2][0] = PhysicalProperyType::solid_density;
143 propL[3][0] = PhysicalProperyType::poisson_ratio;
144 propL[4][0] = PhysicalProperyType::damping;
145
146 if (!com_mod.cmmVarWall) {
147 propL[5][0] = PhysicalProperyType::shell_thickness;
148 propL[6][0] = PhysicalProperyType::elasticity_modulus;
149 }
150
151 propL[7][0] = PhysicalProperyType::f_x;
152 propL[8][0] = PhysicalProperyType::f_y;
153 if (simulation->com_mod.nsd == 3) {
154 propL[9][0] = PhysicalProperyType::f_z;
155 }
156
157 nDOP = {12, 4, 3, 0};
158 outPuts = {
159 OutputNameType::out_velocity,
160 OutputNameType::out_pressure,
161 OutputNameType::out_WSS,
162 OutputNameType::out_displacement,
163 OutputNameType::out_energyFlux,
164 OutputNameType::out_traction,
165 OutputNameType::out_vorticity,
166 OutputNameType::out_vortex,
167 OutputNameType::out_strainInv,
168 OutputNameType::out_viscosity,
169 OutputNameType::out_divergence,
170 OutputNameType::out_acceleration
171 };
172
173 } else {
174 propL[0][0] = PhysicalProperyType::poisson_ratio;
175 if (!com_mod.cmmVarWall) {
176 propL[1][0] = PhysicalProperyType::shell_thickness;
177 propL[2][0] = PhysicalProperyType::elasticity_modulus;
178 }
179
180 propL[7][0] = PhysicalProperyType::f_x;
181 propL[8][0] = PhysicalProperyType::f_y;
182 if (simulation->com_mod.nsd == 3) {
183 propL[9][0] = PhysicalProperyType::f_z;
184 }
185
186 if (pstEq) {
187 nDOP = {2, 2, 0, 0};
188 outPuts = { OutputNameType::out_displacement, OutputNameType::out_stress };
189 } else {
190 nDOP = {1, 1, 0, 0};
191 outPuts[0] = OutputNameType::out_displacement;
192 }
193 }
194
195 read_domain(simulation, eq_params, lEq, propL);
196
197 if (com_mod.cmmInit) {
198 for (auto& domain : lEq.dmn) {
199 domain.prop[PhysicalProperyType::solid_density] = 0.0;
200 }
201 }
202
203 // Set solver parameters.
204 read_ls(simulation, eq_params, SolverType::lSolver_GMRES, lEq);
205
206} },
207
208//---------------------------//
209// phys_fluid //
210//---------------------------//
211//
212{consts::EquationType::phys_fluid, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
213 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
214{
215 using namespace consts;
216 auto& com_mod = simulation->get_com_mod();
217 lEq.phys = consts::EquationType::phys_fluid;
218
219 propL[0][0] = PhysicalProperyType::fluid_density;
220 propL[1][0] = PhysicalProperyType::backflow_stab;
221 propL[2][0] = PhysicalProperyType::inverse_darcy_permeability;
222 propL[3][0] = PhysicalProperyType::f_x;
223 propL[4][0] = PhysicalProperyType::f_y;
224
225 if (simulation->com_mod.nsd == 3) {
226 propL[5][0] = PhysicalProperyType::f_z;
227 }
228
229 // Set fluid domain properties.
230 read_domain(simulation, eq_params, lEq, propL);
231
232 nDOP = {11, 2, 3, 0};
233
234 outPuts = {
235 OutputNameType::out_velocity,
236 OutputNameType::out_pressure,
237 OutputNameType::out_WSS,
238 OutputNameType::out_traction,
239 OutputNameType::out_vorticity,
240 OutputNameType::out_vortex,
241 OutputNameType::out_strainInv,
242 OutputNameType::out_energyFlux,
243 OutputNameType::out_viscosity,
244 OutputNameType::out_divergence,
245 OutputNameType::out_acceleration
246 };
247
248 // Set solver parameters.
249 read_ls(simulation, eq_params, SolverType::lSolver_NS, lEq);
250
251} },
252
253//---------------------------//
254// phys_heatF //
255//---------------------------//
256//
257{consts::EquationType::phys_heatF, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
258 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
259{
260 using namespace consts;
261 auto& com_mod = simulation->get_com_mod();
262 lEq.phys = consts::EquationType::phys_heatF;
263
264 propL[0][0] = PhysicalProperyType::conductivity;
265 propL[1][0] = PhysicalProperyType::source_term;
266
267 read_domain(simulation, eq_params, lEq, propL);
268
269 nDOP = {3,1,1,0};
270 outPuts = {OutputNameType::out_temperature,
271 OutputNameType::out_heatFlux,
272 OutputNameType::out_velocity};
273
274 // Set solver parameters.
275 read_ls(simulation, eq_params, SolverType::lSolver_GMRES, lEq);
276
277} },
278
279//---------------------------//
280// phys_heatS //
281//---------------------------//
282//
283{consts::EquationType::phys_heatS, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
284 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
285{
286 using namespace consts;
287 auto& com_mod = simulation->get_com_mod();
288 lEq.phys = consts::EquationType::phys_heatS;
289
290 propL[0][0] = PhysicalProperyType::conductivity;
291 propL[1][0] = PhysicalProperyType::source_term;
292 propL[2][0] = PhysicalProperyType::solid_density;
293
294 read_domain(simulation, eq_params, lEq, propL);
295
296 nDOP = {2,1,1,0};
297 outPuts = {OutputNameType::out_temperature, OutputNameType::out_heatFlux};
298
299 // Set solver parameters.
300 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
301
302} },
303
304//---------------------------//
305// phys_FSI //
306//---------------------------//
307//
308{consts::EquationType::phys_FSI, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
309 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
310{
311 using namespace consts;
312 auto& com_mod = simulation->get_com_mod();
313 lEq.phys = consts::EquationType::phys_FSI;
314 com_mod.mvMsh = true;
315
316 // Set the possible equations for fsi: fluid (required), struct/ustruct/lElas
317 EquationPhys phys { EquationType::phys_fluid, EquationType::phys_struct, EquationType::phys_ustruct, EquationType::phys_lElas };
318
319 // Set fluid properties.
320 int n = 0;
321 propL[0][n] = PhysicalProperyType::fluid_density;
322 propL[1][n] = PhysicalProperyType::backflow_stab;
323 propL[2][n] = PhysicalProperyType::f_x;
324 propL[3][n] = PhysicalProperyType::f_y;
325 if (simulation->com_mod.nsd == 3) {
326 propL[4][n] = PhysicalProperyType::f_z;
327 }
328
329 // Set struct properties.
330 n += 1;
331 propL[0][n] = PhysicalProperyType::solid_density;
332 propL[1][n] = PhysicalProperyType::elasticity_modulus;
333 propL[2][n] = PhysicalProperyType::poisson_ratio;
334 propL[3][n] = PhysicalProperyType::damping;
335 propL[4][n] = PhysicalProperyType::f_x;
336 propL[5][n] = PhysicalProperyType::f_y;
337 if (simulation->com_mod.nsd == 3) {
338 propL[6][n] = PhysicalProperyType::f_z;
339 }
340
341 // Set ustruct properties.
342 n += 1;
343 propL[0][n] = PhysicalProperyType::solid_density;
344 propL[1][n] = PhysicalProperyType::elasticity_modulus;
345 propL[2][n] = PhysicalProperyType::poisson_ratio;
346 propL[3][n] = PhysicalProperyType::ctau_M;
347 propL[4][n] = PhysicalProperyType::ctau_C;
348 propL[5][n] = PhysicalProperyType::f_x;
349 propL[6][n] = PhysicalProperyType::f_y;
350 if (simulation->com_mod.nsd == 3) {
351 propL[7][n] = PhysicalProperyType::f_z;
352 }
353
354 // Set lElas properties.
355 n += 1;
356 propL[0][n] = PhysicalProperyType::solid_density;
357 propL[1][n] = PhysicalProperyType::elasticity_modulus;
358 propL[2][n] = PhysicalProperyType::poisson_ratio;
359 propL[3][n] = PhysicalProperyType::f_x;
360 propL[4][n] = PhysicalProperyType::f_y;
361 if (simulation->com_mod.nsd == 3) {
362 propL[5][n] = PhysicalProperyType::f_z;
363 }
364
365 // Set lEq properties.
366 read_domain(simulation, eq_params, lEq, propL, phys);
367
368 nDOP = {22, 4, 2, 0};
369 outPuts = {
370 OutputNameType::out_velocity,
371 OutputNameType::out_pressure,
372 OutputNameType::out_displacement,
373 OutputNameType::out_mises,
374
375 OutputNameType::out_WSS,
376 OutputNameType::out_traction,
377 OutputNameType::out_vorticity,
378 OutputNameType::out_vortex,
379 OutputNameType::out_strainInv,
380 OutputNameType::out_energyFlux,
381 OutputNameType::out_viscosity,
382 OutputNameType::out_absVelocity,
383 OutputNameType::out_stress,
384 OutputNameType::out_cauchy,
385 OutputNameType::out_strain,
386 OutputNameType::out_jacobian,
387 OutputNameType::out_defGrad,
388 OutputNameType::out_integ,
389 OutputNameType::out_fibDir,
390 OutputNameType::out_fibAlign,
391
392 OutputNameType::out_divergence,
393 OutputNameType::out_acceleration
394 };
395
396 // Set solver parameters.
397 read_ls(simulation, eq_params, SolverType::lSolver_GMRES, lEq);
398
399 if (com_mod.rmsh.isReqd && !com_mod.resetSim) {
400 read_rmsh(simulation, eq_params);
401 }
402
403} },
404
405//---------------------------//
406// phys_lElas //
407//---------------------------//
408//
409{consts::EquationType::phys_lElas, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
410 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
411{
412 using namespace consts;
413 auto& com_mod = simulation->get_com_mod();
414 lEq.phys = consts::EquationType::phys_lElas;
415
416 propL[0][0] = PhysicalProperyType::solid_density;
417 propL[1][0] = PhysicalProperyType::elasticity_modulus;
418 propL[2][0] = PhysicalProperyType::poisson_ratio;
419 propL[3][0] = PhysicalProperyType::f_x;
420 propL[4][0] = PhysicalProperyType::f_y;
421 if (simulation->com_mod.nsd == 3) {
422 propL[5][0] = PhysicalProperyType::f_z;
423 }
424
425 read_domain(simulation, eq_params, lEq, propL);
426
427 if (eq_params->prestress.defined() && eq_params->prestress.value()) {
428 nDOP = {3,2,0,0};
429 outPuts = {OutputNameType::out_displacement, OutputNameType::out_stress, OutputNameType::out_strain};
430 } else {
431 nDOP = {8,2,0,0};
432 outPuts = {
433 OutputNameType::out_displacement, OutputNameType::out_mises, OutputNameType::out_stress,
434 OutputNameType::out_strain, OutputNameType::out_velocity, OutputNameType::out_acceleration,
435 OutputNameType::out_integ, OutputNameType::out_jacobian
436 };
437 }
438
439 // Set solver parameters.
440 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
441
442} },
443
444//---------------------------//
445// phys_mesh //
446//---------------------------//
447//
448{consts::EquationType::phys_mesh, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
449 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
450{
451 using namespace consts;
452 auto& com_mod = simulation->get_com_mod();
453 lEq.phys = consts::EquationType::phys_mesh;
454
455 propL[0][0] = PhysicalProperyType::solid_density;
456 propL[1][0] = PhysicalProperyType::elasticity_modulus;
457 propL[2][0] = PhysicalProperyType::poisson_ratio;
458 propL[3][0] = PhysicalProperyType::f_x;
459 propL[4][0] = PhysicalProperyType::f_y;
460 if (simulation->com_mod.nsd == 3) {
461 propL[5][0] = PhysicalProperyType::f_z;
462 }
463
464 read_domain(simulation, eq_params, lEq, propL);
465
466 for (auto& domain : lEq.dmn) {
467 domain.prop[PhysicalProperyType::solid_density] = 0.0;
468 domain.prop[PhysicalProperyType::elasticity_modulus] = 1.0;
469 }
470
471 nDOP = {3, 1, 0, 0};
472 outPuts = {OutputNameType::out_displacement, OutputNameType::out_velocity, OutputNameType::out_acceleration };
473
474 lEq.ls.relTol = 0.2;
475
476 // Set solver parameters.
477 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
478
479} },
480
481//---------------------------//
482// phys_shell //
483//---------------------------//
484//
485{consts::EquationType::phys_shell, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
486 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
487{
488 using namespace consts;
489 auto& com_mod = simulation->get_com_mod();
490 lEq.phys = consts::EquationType::phys_shell;
491 com_mod.shlEq = true;
492
493 propL[0][0] = PhysicalProperyType::solid_density;
494 propL[1][0] = PhysicalProperyType::damping;
495 propL[2][0] = PhysicalProperyType::elasticity_modulus;
496 propL[3][0] = PhysicalProperyType::poisson_ratio;
497 propL[4][0] = PhysicalProperyType::shell_thickness;
498 propL[5][0] = PhysicalProperyType::f_x;
499 propL[6][0] = PhysicalProperyType::f_y;
500 propL[7][0] = PhysicalProperyType::f_z;
501
502 read_domain(simulation, eq_params, lEq, propL);
503
504 nDOP = {9,1,0,0};
505 outPuts = {
506 OutputNameType::out_displacement,
507 OutputNameType::out_stress,
508 OutputNameType::out_strain,
509 OutputNameType::out_jacobian,
510 OutputNameType::out_defGrad,
511 OutputNameType::out_velocity,
512 OutputNameType::out_integ,
513 OutputNameType::out_CGstrain,
514 OutputNameType::out_CGInv1
515 };
516
517 // Set solver parameters.
518 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
519
520} },
521
522//---------------------------//
523// phys_stokes //
524//---------------------------//
525//
526{consts::EquationType::phys_stokes, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
527 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
528{
529 using namespace consts;
530 auto& com_mod = simulation->get_com_mod();
531 lEq.phys = consts::EquationType::phys_stokes;
532
533 propL[0][0] = PhysicalProperyType::ctau_M;
534 propL[1][0] = PhysicalProperyType::f_x;
535 propL[2][0] = PhysicalProperyType::f_y;
536 if (simulation->com_mod.nsd == 3) {
537 propL[3][0] = PhysicalProperyType::f_z;
538 }
539 read_domain(simulation, eq_params, lEq, propL);
540
541 nDOP = {8, 2, 3, 0};
542 outPuts = {
543 OutputNameType::out_velocity,
544 OutputNameType::out_pressure,
545 OutputNameType::out_WSS,
546 OutputNameType::out_vorticity,
547 OutputNameType::out_traction,
548 OutputNameType::out_strainInv,
549 OutputNameType::out_viscosity,
550 OutputNameType::out_divergence
551 };
552
553 // Set solver parameters.
554 read_ls(simulation, eq_params, SolverType::lSolver_GMRES, lEq);
555
556} },
557
558//---------------------------//
559// phys_struct //
560//---------------------------//
561//
562{consts::EquationType::phys_struct, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
563 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
564{
565 using namespace consts;
566 auto& com_mod = simulation->get_com_mod();
567 lEq.phys = consts::EquationType::phys_struct;
568
569 propL[0][0] = PhysicalProperyType::solid_density;
570 propL[1][0] = PhysicalProperyType::damping;
571 propL[2][0] = PhysicalProperyType::elasticity_modulus;
572 propL[3][0] = PhysicalProperyType::poisson_ratio;
573 propL[4][0] = PhysicalProperyType::f_x;
574 propL[5][0] = PhysicalProperyType::f_y;
575 if (simulation->com_mod.nsd == 3) {
576 propL[6][0] = PhysicalProperyType::f_z;
577 }
578
579 read_domain(simulation, eq_params, lEq, propL);
580
581 if (eq_params->prestress.defined() && eq_params->prestress.value()) {
582 nDOP = {4,2,0,0};
583 outPuts = {OutputNameType::out_displacement, OutputNameType::out_stress, OutputNameType::out_cauchy, OutputNameType::out_strain};
584 //simulation->com_mod.pstEq = true;
585 } else {
586 nDOP = {12,2,0,0};
587 outPuts = {
588 OutputNameType::out_displacement, OutputNameType::out_mises, OutputNameType::out_stress,
589 OutputNameType::out_cauchy, OutputNameType::out_strain, OutputNameType::out_jacobian,
590 OutputNameType::out_defGrad, OutputNameType::out_integ, OutputNameType::out_fibDir,
591 OutputNameType::out_fibAlign, OutputNameType::out_velocity, OutputNameType::out_acceleration
592 };
593 }
594
595 // Set solver parameters.
596 read_ls(simulation, eq_params, SolverType::lSolver_CG, lEq);
597
598} },
599
600//---------------------------//
601// phys_ustruct //
602//---------------------------//
603//
604{consts::EquationType::phys_ustruct, [](Simulation* simulation, EquationParameters* eq_params, eqType& lEq, EquationProps& propL,
605 EquationOutputs& outPuts, EquationNdop& nDOP) -> void
606{
607 using namespace consts;
608 auto& com_mod = simulation->get_com_mod();
609
610 lEq.phys = consts::EquationType::phys_ustruct;
611 com_mod.sstEq = true;
612
613 propL[0][0] = PhysicalProperyType::solid_density;
614 propL[1][0] = PhysicalProperyType::elasticity_modulus;
615 propL[2][0] = PhysicalProperyType::poisson_ratio;
616 propL[3][0] = PhysicalProperyType::ctau_M;
617 propL[4][0] = PhysicalProperyType::ctau_C;
618 propL[5][0] = PhysicalProperyType::f_x;
619 propL[6][0] = PhysicalProperyType::f_y;
620 if (simulation->com_mod.nsd == 3) {
621 propL[7][0] = PhysicalProperyType::f_z;
622 }
623
624 read_domain(simulation, eq_params, lEq, propL);
625
626 nDOP = {14, 2, 0, 0};
627 outPuts = {
628 OutputNameType::out_displacement,
629 OutputNameType::out_mises,
630 OutputNameType::out_stress,
631 OutputNameType::out_cauchy,
632 OutputNameType::out_strain,
633 OutputNameType::out_jacobian,
634 OutputNameType::out_defGrad,
635 OutputNameType::out_integ,
636 OutputNameType::out_fibDir,
637 OutputNameType::out_fibAlign,
638 OutputNameType::out_velocity,
639 OutputNameType::out_pressure,
640 OutputNameType::out_acceleration,
641 OutputNameType::out_divergence
642 };
643
644 // Set solver parameters.
645 read_ls(simulation, eq_params, SolverType::lSolver_GMRES, lEq);
646
647} },
648};
649
The EquationParameters class stores parameters for the 'Add_equation' XML element used to specify an ...
Definition Parameters.h:1218
Definition Simulation.h:41
Equation type.
Definition ComMod.h:1022