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

Last change on this file since 3332 was 3332, checked in by Mathieu Morlighem, 15 years ago

Do not use throw ErrorException -> ISSMERROR macro
Removed all FUNCT definitions (now useless)

File size: 1.5 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,
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}
Note: See TracBrowser for help on using the repository browser.