1 | /*!\file ConstraintsStatex
|
---|
2 | * \brief: set up penalty constraints on loads
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "./ConstraintsStatex.h"
|
---|
6 | #include "./ConstraintsStateLocal.h"
|
---|
7 | #include "../../shared/shared.h"
|
---|
8 | #include "../../include/include.h"
|
---|
9 | #include "../../io/io.h"
|
---|
10 | #include "../../toolkits/toolkits.h"
|
---|
11 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
---|
12 |
|
---|
13 | void ConstraintsStatex(int* pconverged, int* pnum_unstable_constraints, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials, Parameters* parameters){
|
---|
14 |
|
---|
15 | int i;
|
---|
16 |
|
---|
17 | extern int num_procs;
|
---|
18 | extern int my_rank;
|
---|
19 |
|
---|
20 | /*output: */
|
---|
21 | int converged=0;
|
---|
22 | int num_unstable_constraints=0;
|
---|
23 | int min_mechanical_constraints=0;
|
---|
24 | int analysis_type;
|
---|
25 |
|
---|
26 | /*Display message*/
|
---|
27 | if(VerboseModule()) _pprintLine_(" Constraining penalties");
|
---|
28 |
|
---|
29 | /*recover parameters: */
|
---|
30 | parameters->FindParam(&min_mechanical_constraints,DiagnosticRiftPenaltyThresholdEnum);
|
---|
31 | parameters->FindParam(&analysis_type,AnalysisTypeEnum);
|
---|
32 |
|
---|
33 | /*Do we have penalties linked to rifts? In this case, run our special rifts penalty
|
---|
34 | * management routine, otherwise, skip : */
|
---|
35 | if (RiftIsPresent(loads,analysis_type)){
|
---|
36 | RiftConstraintsState(&converged,&num_unstable_constraints,loads,min_mechanical_constraints,analysis_type);
|
---|
37 | }
|
---|
38 | #ifdef _HAVE_THERMAL_
|
---|
39 | else if(ThermalIsPresent(loads,analysis_type)){
|
---|
40 | ThermalConstraintsState(loads,&converged,&num_unstable_constraints,analysis_type);
|
---|
41 | }
|
---|
42 | #endif
|
---|
43 | else{
|
---|
44 | /*Do nothing, no constraints management!:*/
|
---|
45 | num_unstable_constraints=0;
|
---|
46 | converged=1;
|
---|
47 | }
|
---|
48 |
|
---|
49 | /*Assign output pointers: */
|
---|
50 | *pconverged=converged;
|
---|
51 | *pnum_unstable_constraints=num_unstable_constraints;
|
---|
52 | }
|
---|