[1] | 1 | /*!\file PenaltyConstraintsx
|
---|
| 2 | * \brief: set up penalty constraints on loads
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./PenaltyConstraintsx.h"
|
---|
[1628] | 6 | #include "./RiftConstraints.h"
|
---|
[1] | 7 | #include "../shared/shared.h"
|
---|
[3775] | 8 | #include "../include/include.h"
|
---|
[1] | 9 | #include "../toolkits/toolkits.h"
|
---|
| 10 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
| 11 |
|
---|
[3446] | 12 | void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices,
|
---|
[3673] | 13 | DataSet* loads,DataSet* materials, Parameters* parameters,int analysis_type,int sub_analysis_type){
|
---|
[1] | 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;
|
---|
[3201] | 23 | int min_mechanical_constraints=0;
|
---|
[1] | 24 |
|
---|
[3201] | 25 | /*recover parameters: */
|
---|
[3703] | 26 | parameters->FindParam(&min_mechanical_constraints,MinMechanicalConstraintsEnum);
|
---|
[3201] | 27 |
|
---|
[3503] | 28 | /*First, get nodes and loads configured: */
|
---|
[3889] | 29 | elements->Configure(elements, loads, nodes,vertices, materials,parameters);
|
---|
[3503] | 30 | nodes->Configure(elements, loads, nodes,vertices, materials,parameters);
|
---|
[3446] | 31 | loads->Configure(elements, loads, nodes,vertices, materials,parameters);
|
---|
[1] | 32 |
|
---|
| 33 | /*Do we have penalties linked to rifts? In this case, run our special rifts penalty
|
---|
| 34 | * management routine, otherwise, skip : */
|
---|
[1628] | 35 | if (RiftIsPresent(loads)){
|
---|
[3673] | 36 | RiftConstraints(&converged,&num_unstable_constraints,loads,min_mechanical_constraints,analysis_type,sub_analysis_type);
|
---|
[1] | 37 | }
|
---|
| 38 | else if(loads->MeltingIsPresent()){
|
---|
[3673] | 39 | loads->MeltingConstraints(&converged,&num_unstable_constraints,analysis_type,sub_analysis_type);
|
---|
[1] | 40 | }
|
---|
| 41 | else{
|
---|
| 42 | /*Do nothing, no constraints management!:*/
|
---|
| 43 | num_unstable_constraints=0;
|
---|
[1787] | 44 | converged=1;
|
---|
[1] | 45 | }
|
---|
[1784] | 46 |
|
---|
[1] | 47 | /*Assign output pointers: */
|
---|
| 48 | *pconverged=converged;
|
---|
| 49 | *pnum_unstable_constraints=num_unstable_constraints;
|
---|
| 50 | }
|
---|