1 | /*!\file PenaltyConstraintsx
|
---|
2 | * \brief: set up penalty constraints on loads
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "./PenaltyConstraintsx.h"
|
---|
6 | #include "./RiftConstraints.h"
|
---|
7 |
|
---|
8 | #include "../shared/shared.h"
|
---|
9 | #include "../include/macros.h"
|
---|
10 | #include "../toolkits/toolkits.h"
|
---|
11 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
12 |
|
---|
13 | void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
|
---|
14 | DataSet* loads,DataSet* materials, DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
|
---|
15 |
|
---|
16 | int i;
|
---|
17 |
|
---|
18 | extern int num_procs;
|
---|
19 | extern int my_rank;
|
---|
20 |
|
---|
21 | /*output: */
|
---|
22 | int converged=0;
|
---|
23 | int num_unstable_constraints=0;
|
---|
24 | int min_mechanical_constraints=0;
|
---|
25 |
|
---|
26 | /*recover parameters: */
|
---|
27 | parameters->FindParam(&min_mechanical_constraints,"min_mechanical_constraints");
|
---|
28 |
|
---|
29 | /*First, get loads configured: */
|
---|
30 | loads->Configure(elements, loads, nodes, materials,parameters);
|
---|
31 |
|
---|
32 | /*Do we have penalties linked to rifts? In this case, run our special rifts penalty
|
---|
33 | * management routine, otherwise, skip : */
|
---|
34 | if (RiftIsPresent(loads)){
|
---|
35 | RiftConstraints(&converged,&num_unstable_constraints,loads,inputs,min_mechanical_constraints,analysis_type,sub_analysis_type);
|
---|
36 | }
|
---|
37 | else if(loads->MeltingIsPresent()){
|
---|
38 | loads->MeltingConstraints(&converged,&num_unstable_constraints,inputs,analysis_type,sub_analysis_type);
|
---|
39 | }
|
---|
40 | else{
|
---|
41 | /*Do nothing, no constraints management!:*/
|
---|
42 | num_unstable_constraints=0;
|
---|
43 | converged=1;
|
---|
44 | }
|
---|
45 |
|
---|
46 |
|
---|
47 | /*Assign output pointers: */
|
---|
48 | *pconverged=converged;
|
---|
49 | *pnum_unstable_constraints=num_unstable_constraints;
|
---|
50 | }
|
---|