// Vypis Vyztuzi
*set elems(Linear)
*If(nelem>0)
*Set Var CurrentType=-1
*Set Var PreviousType=0
*Set Var ReinfGroupID=-1
*Set Var LastMat=-1
*loop elems
*If(strcmp(ElemsMatProp(Material_Prototype),"CCSpringMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCBeam3DMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCDummyMaterial")!=0)
*If(ElemsMatProp(Embedded_Reinforcement,Int)==0 && ElemsMatProp(Application_from_Interval,Int)==IntervalIndex)
*If(ElemsMat<=0)
// For reinforcement bar *elemsnum no material has been assigned. ElemMat: *ElemsMat
*# ElemsNum    *ElemsNum
*# CurrentType *CurrentType
*# ElemsType   *ElemsType
*# ElemsNnode  *ElemsNnode
*tcl(TK_Signal *ElemsNum)
*MessageBox error: For some reinforcement bars no material has been assigned. See the input file for more details.
*EndIf
*#                            
*If(strcmp(ElemsMatProp(Material_Prototype),"CCSteelDRC")==0 || strcmp(ElemsMatProp(Material_Prototype),"CC1DElastIsotropic")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCReinforcement")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCCyclingReinforcement")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCReinforcementWithTempDepProperties")==0)
*#
*If(strcmp(ElemsMatProp(Geometrical_Non-Linearity),"LINEAR")==0)
*Set Var CurrentType=Operation(ElemsNnode*1)
*Else
*Set Var CurrentType=Operation(ElemsNnode+AddingNonLinElemID)
*EndIf
*#
*If(ElemsMatProp(Bar_With_Bond,Int)==1)
*Set Var CurrentType=Operation(CurrentType+AddingBarWithBond)
*EndIf
*#
*EndIf
*#
*If(ElemsType==1)
*#
*If(PreviousType!=CurrentType || ElemsMat!=LastMat)
*Set Var ReinfGroupID=Operation(ElemsMat*IncrMaterialID+CurrentType)

*tcl(TK_SaveMaterialNumberVSGroupID *ElemsMatProp(0) *ReinfGroupID)
*tcl(TK_SaveMinMaxGroupIDVSMaterial *ElemsMatProp(0) *ReinfGroupID)

*If(CurrentType==5)
	ELEMENT TYPE ID *ReinfGroupID /** 5 **/  NAME "Element type #*CurrentType for Linear Material" TYPE  "CCBarWithBond"  LINEAR ;
*ElseIf(CurrentType==2)
	ELEMENT TYPE ID *ReinfGroupID /** 2 **/  NAME "Element type #*CurrentType for Linear Material" TYPE  "CCIsoTruss<xx>" LINEAR ;
*ElseIf(CurrentType==3)
*#        ELEMENT TYPE ID *ReinfGroupID /** 3 **/  NAME "Element type #*CurrentType for Linear Material" TYPE "CCIsoTruss<xxx>" LINEAR ;
	ELEMENT TYPE ID *ReinfGroupID /** 3 ale jen docasne **/  NAME "Element type #*CurrentType for Linear Material" TYPE  "CCIsoTruss<xx>" LINEAR ;
*ElseIf(CurrentType==35)
	ELEMENT TYPE ID *ReinfGroupID /** 35 **/ NAME "Element type #*CurrentType for NonLin Material" TYPE  "CCBarWithBond"  NONLINEAR ;
*ElseIf(CurrentType==32)
	ELEMENT TYPE ID *ReinfGroupID /** 32 **/ NAME "Element type #*CurrentType for NonLin Material" TYPE  "CCIsoTruss<xx>" NONLINEAR ;
*ElseIf(CurrentType==33)
*#        ELEMENT TYPE ID *ReinfGroupID /** 33 **/ NAME "Element type #*CurrentType for NonLin Material" TYPE "CCIsoTruss<xxx>" NONLINEAR ;
	ELEMENT TYPE ID *ReinfGroupID /** 33 ale jen docasne **/ NAME "Element type #*CurrentType for NonLin Material" TYPE "CCIsoTruss<xx>" NONLINEAR ;
*EndIf
*#
*If(ElemsMat<=0)
// For reinforcement bar *elemsnum no material has been assigned. ElemMat: *ElemsMat
*ElemsNum *Cond(Entity_number,Int) *ElemsMat
*tcl(TK_Signal *ElemsNum)
*MessageBox error: For some reinforcement bars no material has been assigned. See the input file for more details.
*EndIf
*#
ELEMENT GROUP ID *ReinfGroupID TYPE *ReinfGroupID /** *ElemsMatProp(0) - *CurrentType **/ MATERIAL *ElemsMat GEOMETRY  *ElemsMat
ELEMENT INCIDENCES
// *ElemsMatProp(0) *ElemsMatProp(1)
*#
*If(oMaxReinfGroups<ReinfGroupID)
*Set Var oMaxReinfGroups=ReinfGroupID
*EndIf
*If(oMinReinfGroups>ReinfGroupID)
*Set Var oMinReinfGroups=ReinfGroupID
*EndIf
*#
*EndIf
*#
*If(ElemsNnode == 3)
*If(ElemsMatProp(Quadratic_Elements,Int)==1)
*ElemsNum *ElemsConec(1) *ElemsConec(3) *ElemsConec(2) 
*Else
*ElemsNum *ElemsConec(1) *ElemsConec(2) 
*EndIf
*Else
*ElemsNum *ElemsConec(1) *ElemsConec(2) 
*EndIf
*#
*EndIf
*Set Var PreviousType=CurrentType
*Set Var LastMat=ElemsMat
*#
*# ElemsMat             *ElemsMat
*# IncrMaterialID       *IncrMaterialID
*# CurrentType         *CurrentType
*# groupID	    *groupID
*# 
*EndIf
*EndIf
*End elems
*EndIf
