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

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

Created include.h header file

File size: 1.6 KB
RevLine 
[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
8#include "../shared/shared.h"
[3775]9#include "../include/include.h"
[1]10#include "../toolkits/toolkits.h"
11#include "../EnumDefinitions/EnumDefinitions.h"
12
[3446]13void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices,
[3673]14 DataSet* loads,DataSet* materials, Parameters* parameters,int analysis_type,int sub_analysis_type){
[1]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;
[3201]24 int min_mechanical_constraints=0;
[1]25
[3201]26 /*recover parameters: */
[3703]27 parameters->FindParam(&min_mechanical_constraints,MinMechanicalConstraintsEnum);
[3201]28
[3503]29 /*First, get nodes and loads configured: */
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 }
46
[1784]47
[1]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.