anchor.diff:      real sigfrac0,sigfrac,decfrac
       real critfrac
   
  +    real NodesCoordx(*), NodesCoordy(*),NodesDispl(*)
  +    INTEGER ElemConnect(4,*),DofIds(2,*)
       real freep(5,*),ym(4,*)
       INTEGER ElemMaterial(*)
  -    integer j
  -    real*8 :: RetVal8(4)
  +    integer j,i
  +    real*8 :: RetVal8(4),xs(4),ys(4)
       real*4 :: RetVal4(4)
   
  +    if(bMain==1)then
  +        !- to get the elem nodes coordinates
  +        do i=1, 4
  +            xs(i)=NodesCoordx(ElemConnect(i,ElemFrom))+NodesDispl(DofIds(1,ElemConnect(i,ElemFrom)))
  +            ys(i)=NodesCoordy(ElemConnect(i,ElemFrom))+NodesDispl(DofIds(2,ElemConnect(i,ElemFrom)))
  +        enddo
  +        CALL ElemCrackingClassMain%EC_CalcCrackedElemAreaRatio (xs,ys,4,ElemConnect(:,ElemFrom))
  +    endif
  +
  +    CALL pEC_ElemData(ElemFrom)%EC_CopyElem (pEC_ElemData(ElemTo))
  +
  +    if(bMain==1)then
  +        !-- copy elem in EC_BaseClass copies also the connectivity, ... update that in the next two line
  +        ElemConnect(1:4,ElemFrom)=ElemCrackingClassMain%iElemConnectivity(1:4)
  +        pEC_ElemData(ElemFrom)%iElemConnectivity(1:4)=ElemCrackingClassMain%iElemConnectivity(1:4)
  +        pEC_ElemData(ElemFrom)%rAreaRatio=ElemCrackingClassMain%rAreaRatio
  +        !-- set the related elem to overlap
  +        pEC_ElemData(ElemFrom)%iElemOverlapping=ElemTo
  +    endif
  +    if(bMain==0)then    !--0= from main to overlap
  +        !-- ... update that in the next two line
  +        ElemConnect(1:4,ElemTo)=ElemCrackingClassOverlapping%iElemConnectivity(1:4)
  +        pEC_ElemData(ElemTo)%iElemConnectivity(1:4)=ElemCrackingClassOverlapping%iElemConnectivity(1:4)
  +        !- has to be done here after the connectivity has been done
  +        !- to get the elem nodes coordinates
  +        do i=1, 4
  +            xs(i)=NodesCoordx(ElemConnect(i,ElemTo))+NodesDispl(DofIds(1,ElemConnect(i,ElemTo)))
  +            ys(i)=NodesCoordy(ElemConnect(i,ElemTo))+NodesDispl(DofIds(2,ElemConnect(i,ElemTo)))
  +        enddo
  +        !-- calc the new elem area ratio, arrange the new elem connectivity
  +        CALL ElemCrackingClassOverlapping%EC_CalcCrackedElemAreaRatio (xs,ys,4,ElemConnect(:,ElemTo))
  +        pEC_ElemData(ElemTo)%rAreaRatio=ElemCrackingClassOverlapping%rAreaRatio
  +        !-- set the related elem to main
  +        pEC_ElemData(ElemTo)%iElemOverlapping=ElemFrom
  +
  +    endif
  +
  +    !--- copy stress
  +    RetVal4=0
  +    RetVal8=0
  +    CALL CNmanager_Get_sigalt(ElemFrom,RetVal8)
  +
  +!!    if(bMain==1)then !--0= from main to overlap
  +        RetVal4=RetVal8!*ElemCrackingClassOverlapping%rAreaRatio
  +        CALL CNmanager_Set_sigalt(ElemTo,RetVal4)
  +        !--- try to set the stress to half its value --- for testing
  +        RetVal4=RetVal8!*ElemCrackingClassMain%rAreaRatio
  +        CALL CNmanager_Set_sigalt(ElemFrom,RetVal4)
  +!!    endif
  +
  +    !---- rest of arrays/properties
  +    !-------------------------- needs to be done after calculating the area ratio
  +    !---- lumped mass matrix
  +    do j=1,4
  +        ym(j,ElemTo)=ym(j,ElemFrom)!*ElemCrackingClassMain%rAreaRatio
  +        ym(j,ElemFrom)=ym(j,ElemFrom)!*ElemCrackingClassOverlapping%rAreaRatio
  +    end do
       freep(1:5,ElemTo)=freep(1:5,ElemFrom)
  +    CALL CNmanager_CopyElemnt(ElemFrom,ElemTo)
   
       ElemMaterial(ElemTo)=ElemMaterial(ElemFrom)
       Y_modulus(ElemTo)=Y_modulus(ElemFrom)
  
positive.code: 
      implicit none
      type ( EC_ElemCrackingClass ), intent(inout) :: ElemCrackingClassMain,ElemCrackingClassOverlapping
      integer, intent(in) :: ElemFrom,ElemTo
  
  
      common/wblock8/  abc(573,nume,4), his(573,nume,4)
      real abc,his
  
negative.code:     his(1:573,ElemTo,1)=his(1:573,ElemFrom,1)
  
      nnn2(ElemTo,1)=nnn2(ElemFrom,1)
  
      fhg(ElemTo,1:8)=fhg(ElemFrom,1:8)
      fhghis(ElemTo,1:8)=fhghis(ElemFrom,1:8)
  