*Set Var oflagElmIDMerge=1
*If(GenData(Show_Surface_Loads_In_Post-Processor,Int)==0)
*Set Var oflagElmIDMerge=0
*EndIf

*If(CondNumEntities(Int)>0)
*Set Var nLoadCND3D=CondNumEntities(Int)
// selection has *CondNumEntities entities
*#Set Var nshells=0
*#Set Var nbeam=0
*loop elems *OnlyInCond
*If(Cond(Apply_in_Subincrement,int)==ApplyInSubincrement  || strcmp(GenData(Calculation_Analysis),"Static")==0)
*include ..\include.src.bas\CurrentElementGroupID.bas
*#
*Set var multproj=1.0
*#
*Set Var oflagProjection=0
*If(strcmp(Cond(Coordinate_System),"PROJECTION")==0)
*Set Var oflagProjection=1
*Set Var ioSpring=0
*Set Var CurrentType=0
*include ..\include.src.bas\NormalVector_ElementalSurface.bas
*Set var vn=Operation(sqrt(nx*nx+ny*ny+nz*nz))
*Set var vf=Operation(sqrt(Cond(X-Force,Real)*Cond(X-Force,Real)+Cond(Y-Force,Real)*Cond(Y-Force,Real)+Cond(Z-Force,Real)*Cond(Z-Force,Real)))
*Set var multproj=Operation(-1*(nx*Cond(X-Force,Real)+ny*Cond(Y-Force,Real)+nz*Cond(Z-Force,Real))/(vn*vf))
*ElseIf(strcmp(Cond(Coordinate_System),"GLOBAL_LINEAR")==0|| strcmp(Cond(Coordinate_System),"GLOBAL_CONSTANT2")==0)
*# zj-nevim proc se ma nastavovat pro GLOBAL_CONSTANT - proto jsem to zrusil. Melo by se vypisovat GLOBAL.
*Set Var oflagProjection=1
*EndIf
*#
*#
*# *****************
*If(strcmp(Cond(Coordinate_System),"GLOBAL_LINEAR")==0 || strcmp(Cond(Coordinate_System),"LOCAL_LINEAR")==0)
*#
*If(Cond(Force_Component_X,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*# tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) *\
GLOBAL CONST *Cond(X-Force,Real) COEFF_X *Cond(Comp_X_COEFF_X,Real) COEFF_Y *Cond(Comp_X_COEFF_Y,Real) COEFF_Z *Cond(Comp_X_COEFF_Z,Real) VALUE X 1.0 NODES *\
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif
*endif
*#
*If(Cond(Force_Component_Y,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*# tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) *\
*If(strcmp(Cond(Coordinate_System),"LOCAL_LINEAR")==0)
LOCAL *\
*Else
GLOBAL *\
*Endif
CONST *Cond(Y-Force,Real) COEFF_X *Cond(Comp_Y_COEFF_X,Real) COEFF_Y *Cond(Comp_Y_COEFF_Y,Real) COEFF_Z *Cond(Comp_Y_COEFF_Z,Real) VALUE Y 1.0 NODES *\
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif
*endif
*#
*If(Cond(Force_Component_Z,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*# tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) *\
*# 
*#
*If(strcmp(Cond(Coordinate_System),"LOCAL_LINEAR")==0)
LOCAL CONST *Cond(Z-Force,Real) COEFF_X *Cond(Comp_Z_COEFF_X,Real) COEFF_Y *Cond(Comp_Z_COEFF_Y,Real) COEFF_Z *Cond(Comp_Z_COEFF_Z,Real) VALUE Z 1.0 NODES *\
*# 
*#
*Else
GLOBAL CONST *Cond(Z-Force,Real) COEFF_X *Cond(Comp_Z_COEFF_X,Real) COEFF_Y *Cond(Comp_Z_COEFF_Y,Real) COEFF_Z *Cond(Comp_Z_COEFF_Z,Real) VALUE Z 1.0 NODES *\
*Endif
*# 
*#
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif
*endif
*#
*Else
*#
*If(Cond(Force_Component_X,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) VALUE X *Operation(Cond(X-Force,Real)*multproj) NODES *\
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif 
*Set Var nLoad3D=Operation(nLoad3D+1)
*EndIf
*If(Cond(Force_Component_Y,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) VALUE Y *Operation(Cond(Y-Force,Real)*multproj) NODES *\
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif 
*Set Var nLoad3D=Operation(nLoad3D+1)
*EndIf
*If(Cond(Force_Component_Z,Int)!=0)

Load BOUNDARY group *groupID *tcl(TK_ElementNum *oflagElmIDMerge *ElemsNum) *\
*tcl(TK_Check_CS *Cond(Coordinate_System) *oflagProjection ) VALUE Z *Operation(Cond(Z-Force,Real)*multproj) NODES *\
*Format "%i%i%i%s%i%i"
 "$N$I*IntervalIndex *ElemsType *ElemsNnode *Cond(Boundary)Num*Cond(Entity_number,Int) ElemNum*ElemsNum" *\
*Cond(Boundary) *\
*tcl(TK_BoundaryMerge *oflagElmIDMerge) *\
*If(strcmp(Cond(Boundary),"SURFACE")!=0)
EDGE_NO_DUPLICATES 
*endif 
*Set Var nLoad3D=Operation(nLoad3D+1)
*EndIf
*#
*# konec typu zatizeni - CONSTANT/LINEAR/PROJECTION/LOCAL
*Endif
*# *****************
*#
*EndIf
*End elems
*EndIf
