source: issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp@ 3703

Last change on this file since 3703 was 3703, checked in by Eric.Larour, 15 years ago

Big commit

File size: 1.6 KB
Line 
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
13void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices,
14 DataSet* loads,DataSet* materials, Parameters* parameters,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,MinMechanicalConstraintsEnum);
28
29 /*First, get nodes and loads configured: */
30 nodes->Configure(elements, loads, nodes,vertices, materials,parameters);
31 loads->Configure(elements, loads, nodes,vertices, materials,parameters);
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)){
36 RiftConstraints(&converged,&num_unstable_constraints,loads,min_mechanical_constraints,analysis_type,sub_analysis_type);
37 }
38 else if(loads->MeltingIsPresent()){
39 loads->MeltingConstraints(&converged,&num_unstable_constraints,analysis_type,sub_analysis_type);
40 }
41 else{
42 /*Do nothing, no constraints management!:*/
43 num_unstable_constraints=0;
44 converged=1;
45 }
46
47
48 /*Assign output pointers: */
49 *pconverged=converged;
50 *pnum_unstable_constraints=num_unstable_constraints;
51}
Note: See TracBrowser for help on using the repository browser.