Cloned SEACAS for EXODUS library with extra build files for internal package management.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

139 lines
3.7 KiB

C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
C See packages/seacas/LICENSE for details
C=======================================================================
*DECK,CNTR
SUBROUTINE CNTR (ITYPE,XX,YY,ZZ,XCNTR,YCNTR,ZCNTR)
C ******************************************************************
C SUBROUTINE TO FIND THE CENTER COORDINATES OF AN ELEMENT
C Called by ELTON3, LDCENB, SRCH2D, SRCH3D
C ******************************************************************
DIMENSION XX(*), YY(*), ZZ(*)
C ******************************************************************
C SELECT ELEMENT TYPE
GO TO (100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
& 200, 210, 150), ITYPE
C 3-NODE TRIANGLE
100 CONTINUE
XCNTR=(XX(1)+XX(2)+XX(3))/3.
YCNTR=(YY(1)+YY(2)+YY(3))/3.
ZCNTR=0.
RETURN
C 6-NODE TRIANGLE
110 CONTINUE
XCNTR=-(XX(1)+XX(2)+XX(3))/9.+4.*(XX(4)+XX(5)+XX(6))/9.
YCNTR=-(YY(1)+YY(2)+YY(3))/9.+4.*(YY(4)+YY(5)+YY(6))/9.
ZCNTR=0.
RETURN
C 4-NODE QUADRILATERAL
120 CONTINUE
XCNTR=(XX(1)+XX(2)+XX(3)+XX(4))/4.
YCNTR=(YY(1)+YY(2)+YY(3)+YY(4))/4.
ZCNTR=0.
RETURN
C 8-NODE QUADRILATERAL
130 CONTINUE
XCNTR=-(XX(1)+XX(2)+XX(3)+XX(4))/4.+(XX(5)+XX(6)+XX(7)+XX(8))/2.
YCNTR=-(YY(1)+YY(2)+YY(3)+YY(4))/4.+(YY(5)+YY(6)+YY(7)+YY(8))/2.
ZCNTR=0.
RETURN
C 9-NODE QUADRILATERAL
140 CONTINUE
XCNTR=XX(9)
YCNTR=YY(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