*Set Var nInitialStress1D=0
*Set Var nInitialStress2D=0
*Set Var nInitialStress3D=0
*Set Var LastGroupID=0
*#
*# *Set Cond Initial_Stress_for_Reinf_Line          *elems *or(1,Int) *or(2,Real) *or(3,Int) *or(4,Real) *or(5,Int) *or(6,Real) 
*# *If(CondNumEntities(Int)>0)
*# // 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) 
*# *#If(ElemsType>3 && (Cond(1,Int)!=0||Cond(3,Int)!=0||Cond(5,Int)!=0))
*# *If(ElemsType==1 && (Cond(Stress_Component_XX,Int)!=0||Cond(Stress_Component_YY,Int)!=0||Cond(Stress_Component_ZZ,Int)!=0))
*# *#
*# *# include ..\include.src.bas\CurrentElementGroupID.bas
*# *# Set Var CurrentType=1
*# *#
*# *# Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*# *If(ElemsMatProp(Embedded_Reinforcement,Int)==0)
*# *#
*# *If(strcmp(ElemsMatProp(Geometrical_Non-Linearity),"LINEAR")==0)
*# *Set Var CurrentType=Operation(ElemsNnode*1)
*# *Else
*# *Set Var CurrentType=Operation(ElemsNnode+AddingNonLinElemID)
*# *EndIf
*# *Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*# *#
*# *Else
*# *Set Var groupID=Operation(InitCablesID+Cond(Entity_number,Int))
*# *EndIf
*# *If(LastGroupID!=groupID)
*# *#If(Cond(1,Int)!=0)
*# *If(Cond(Stress_Component_XX,Int)!=0)
*# *if(strcmp(ElemsMatProp(Geom_Type),"CABLE")==0)
*# *Format "LOAD PRESTRESSING  GROUP %i VALUE %20.10f"
*# *else
*# *Format "LOAD INITIAL Stress GROUP %i VALUE X %20.10f"
*# *endif
*# *#groupID *Cond(2,Real)
*# *groupID *Cond(X-Value,Real)
*# *#ElseIf(Cond(3,Int)!=0)
*# *Set Var nInitialStress1D=Operation(nInitialStress1D+1)
*# *ElseIf(Cond(Stress_Component_YY,Int)!=0)
*# *format "LOAD INITIAL Stress GROUP %i VALUE Y %20.10f"
*# *#groupID *Cond(4,Real)
*# *groupID *Cond(Y-Value,Real)
*# *#ElseIf(Cond(5,Int)!=0)
*# *Set Var nInitialStress1D=Operation(nInitialStress1D+1)
*# *ElseIf(Cond(Stress_Component_ZZ,Int)!=0)
*# *format "LOAD INITIAL Stress GROUP %i VALUE Z %20.10f"
*# *#groupID *Cond(6,Real)
*# *groupID *Cond(Z-Value,Real)
*# *Set Var nInitialStress1D=Operation(nInitialStress1D+1)
*# *EndIf
*# *EndIf
*# *Set Var LastGroupID=groupID
*# *EndIf
*# *EndIf
*# *End elems
*# *EndIf
*#
*#
*# 2D
*Set Cond Initial_Stress_for_2DElem_Surface      *elems *or(1,Int) *or(2,Real) *or(3,Int) *or(4,Real) *or(5,Int) *or(6,Real) 
*If(CondNumEntities(Int)>0)
// 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) 
*#If(ElemsType>3 && (Cond(1,Int)!=0||Cond(3,Int)!=0||Cond(5,Int)!=0))
*If(ElemsType>1 && (Cond(Stress_Component_XX,Int)!=0||Cond(Stress_Component_YY,Int)!=0||Cond(Stress_Component_ZZ,Int)!=0))
*#
*include ..\include.src.bas\CurrentElementGroupID.bas
*# Set Var CurrentType=1
*#
*Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*# If(LastGroupID!=groupID)
*#If(Cond(1,Int)!=0)
*If(Cond(Stress_Component_XX,Int)!=0)
*Format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE X %20.10f"
*groupID *ElemsNum *Cond(X-Value,Real)
*Set Var nInitialStress2D=Operation(nInitialStress2D+1)
*EndIf
*#If(Cond(3,Int)!=0)
*If(Cond(Stress_Component_YY,Int)!=0)
*format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE Y %20.10f"
*groupID *ElemsNum *Cond(Y-Value,Real)
*Set Var nInitialStress2D=Operation(nInitialStress2D+1)
*EndIf
*#If(Cond(5,Int)!=0)
*If(Cond(Stress_Component_ZZ,Int)!=0)
*format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE Z %20.10f"
*groupID *ElemsNum *Cond(Z-Value,Real)
*Set Var nInitialStress2D=Operation(nInitialStress2D+1)
*EndIf
*# EndIf
*Set Var LastGroupID=groupID
*EndIf
*EndIf
*End elems
*EndIf
*#
*#
*# 3D
*If(ndime==3)
*Set Cond Initial_Stress_for_Volume *elems *or(1,Int) *or(2,Real) *or(3,Int) *or(4,Real) *or(5,Int) *or(6,Real) 
*If(CondNumEntities(Int)>0)
// selection Initial_Stress_for_Volume 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) 
*#If(ElemsType>3 && (Cond(1,Int)!=0||Cond(3,Int)!=0||Cond(5,Int)!=0))
*If(ElemsType>3 && (Cond(Stress_Component_XX,Int)!=0||Cond(Stress_Component_YY,Int)!=0||Cond(Stress_Component_ZZ,Int)!=0))
*#
*include ..\include.src.bas\CurrentElementGroupID.bas
*# Set Var CurrentType=1
*#
*Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*# If(LastGroupID!=groupID)
*#If(Cond(1,Int)!=0)
*If(Cond(Stress_Component_XX,Int)!=0)
*format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE X %20.10f"
*groupID *ElemsNum *Cond(X-Value,Real)
*Set Var nInitialStress3D=Operation(nInitialStress3D+1)
*EndIf
*#If(Cond(3,Int)!=0)
*If(Cond(Stress_Component_YY,Int)!=0)
*format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE Y %20.10f"
*groupID *ElemsNum *Cond(Y-Value,Real)
*Set Var nInitialStress3D=Operation(nInitialStress3D+1)
*EndIf
*#If(Cond(5,Int)!=0)
*If(Cond(Stress_Component_ZZ,Int)!=0)
*format "LOAD INITIAL Stress GROUP %i ELEMENT %i VALUE Z %20.10f"
*groupID *ElemsNum *Cond(Z-Value,Real)
*Set Var nInitialStress3D=Operation(nInitialStress3D+1)
*EndIf
*# EndIf
*Set Var LastGroupID=groupID
*EndIf
*EndIf
*End elems
*EndIf
*EndIf
