A square patch: element comparison

Basic implementation test with all prescribed displacements.

Testing the internal force computation.

v=-5   v=-5
 |     |
 v     v
 3-----2 -> u=5
 |\  b | >
 | \   | >
 |  \  | > (w = 1.0)
 |   \ | >
 | a  \| >
 0-----1 -> u=5

width:  10.
height: 10.

Material parameters: St. Venant-Kirchhoff, plane stress
    E  = 10.0
    nu =  0.30
    t  =  1.0

Element loads:
    node 0: [ 0.0, 0.0]
    node 1: [ 5.0, 0.0]
    node 2: [ 5.0, 0.0]
    node 3: [ 0.0, 0.0]

Green Lagrange strain:
    eps_XX = 0.5 * ((1.5)^2 - 1)      =  0.625
    eps_YY = 0.5 * ((0.5)^2 - 1)      = -0.375
    eps_XY = eps_YX                   =  0.000
    eps_ZZ = - nu * (eps_XX + eps_YY) = -0.075

2nd Piola-Kirchhoff stress:
    D = E t/(1 - nu^2) = 10.989
    S_XX = (10.989) * ((0.625) + (0.30)(-0.375)) =  5.632
    S_YY = (10.989) * ((-0.375) + (0.30)(0.625)) = -2.060
    S_XY = S_YX = S_ZZ                           =  0.000

Author: Peter Mackenzie-Helnwein

from femedu.examples import Example

from femedu.domain import System, Node
from femedu.elements.linear import Triangle
from femedu.elements.linear import Triangle6
from femedu.elements.linear import Quad
from femedu.elements.linear import Quad9
from femedu.materials import PlaneStress


class ExamplePlate07(Example):

    # sphinx_gallery_thumbnail_number = 2
    def problem(self):
        params = dict(
            E=10.,  # Young's modulus
            nu=0.3,  # Poisson's ratio
            t=1.0,  # thickness of the plate
            fy=1.e30  # yield stress
        )

        a = 10.  # length of the plate in the x-direction
        b = 10.  # length of the plate in the y-direction

        model = System()

        # made of Triangle elements
        """
        Nodes:
        03   02
        00   01
        """
        nd00 = Node(0.0, 0.0)
        nd01 = Node(a, 0.0)
        nd02 = Node(a, b)
        nd03 = Node(0.0, b)

        model.addNode(nd00, nd01, nd02, nd03)

        elemA0 = Triangle(nd00, nd01, nd03, PlaneStress(params))
        elemA1 = Triangle(nd02, nd03, nd01, PlaneStress(params))

        model.addElement(elemA0, elemA1)

        elemA1.setSurfaceLoad(face=2, pn=1.0)


        # made of Triangle6 elements
        xo=22.
        yo= 0.

        """
        Nodes:
        16   17   18
        13   14   15
        10   11   12
        """
        nd10 = Node(xo+0.0, yo+0.0)
        nd11 = Node(xo+a/2, yo+0.0)
        nd12 = Node(xo+a,   yo+0.0)
        nd13 = Node(xo+0.0, yo+b/2)
        nd14 = Node(xo+a/2, yo+b/2)
        nd15 = Node(xo+a,   yo+b/2)
        nd16 = Node(xo+0.0, yo+b  )
        nd17 = Node(xo+a/2, yo+b  )
        nd18 = Node(xo+a,   yo+b  )

        model.addNode(nd10,nd11,nd12,nd13,nd14,nd15,nd16,nd17,nd18)

        elemB0 = Triangle6(nd10, nd12, nd16, nd11, nd14, nd13, PlaneStress(params))
        elemB1 = Triangle6(nd16, nd12, nd18, nd14, nd15, nd17, PlaneStress(params))

        model.addElement(elemB0, elemB1)

        elemB1.setSurfaceLoad(face=1, pn=1.0)


        # made of Quad9 elements
        xo=22.
        yo=15.

        """
        Nodes:
        26   27   28
        23   24   25
        20   21   22
        """
        nd20 = Node(xo+0.0, yo+0.0)
        nd21 = Node(xo+a/2, yo+0.0)
        nd22 = Node(xo+a,   yo+0.0)
        nd23 = Node(xo+0.0, yo+b/2)
        nd24 = Node(xo+a/2, yo+b/2)
        nd25 = Node(xo+a,   yo+b/2)
        nd26 = Node(xo+0.0, yo+b  )
        nd27 = Node(xo+a/2, yo+b  )
        nd28 = Node(xo+a,   yo+b  )

        model.addNode(nd20,nd21,nd22,nd23,nd24,nd25,nd26,nd27,nd28)

        elemC0 = Quad9(nd20, nd22, nd28, nd26, nd21, nd25, nd27, nd23, nd24, PlaneStress(params))

        model.addElement(elemC0)

        elemC0.setSurfaceLoad(face=1, pn=1.0)


        # made of Quad elements
        xo=0.
        yo=15.

        """
        Nodes:
        32   33
        30   31
        """
        nd30 = Node(xo+0.0, yo+0.0)
        nd31 = Node(xo+a,   yo+0.0)
        nd32 = Node(xo+0.0, yo+b  )
        nd33 = Node(xo+a,   yo+b  )

        model.addNode(nd30,nd31,nd32,nd33)

        elemD0 = Quad(nd30, nd31, nd33, nd32, PlaneStress(params))

        model.addElement(elemD0)

        elemD0.setSurfaceLoad(face=1, pn=1.0)

        # show the model
        model.plot(factor=0, title="Undeformed system", filename="plate07_undeformed.png", show_bc=1)

        model.report()

        # analyze the model
        model.setLoadFactor(1.0)

        nd00.setDisp([0.0, 0.0])
        nd01.setDisp([5.0, 0.0])
        nd02.setDisp([5.0, -5.0])
        nd03.setDisp([0.0, -5.0])

        nd10.setDisp([0.0,  0.0])
        nd13.setDisp([0.0, -2.5])
        nd16.setDisp([0.0, -5.0])
        #
        nd11.setDisp([2.5,  0.0])
        nd14.setDisp([2.5, -2.5])
        nd17.setDisp([2.5, -5.0])
        #
        nd12.setDisp([5.0,  0.0])
        nd15.setDisp([5.0, -2.5])
        nd18.setDisp([5.0, -5.0])

        nd20.setDisp([0.0,  0.0])
        nd23.setDisp([0.0, -2.5])
        nd26.setDisp([0.0, -5.0])
        #
        nd21.setDisp([2.5,  0.0])
        nd24.setDisp([2.5, -2.5])
        nd27.setDisp([2.5, -5.0])
        #
        nd22.setDisp([5.0,  0.0])
        nd25.setDisp([5.0, -2.5])
        nd28.setDisp([5.0, -5.0])

        nd30.setDisp([0.0, 0.0])
        nd31.setDisp([5.0, 0.0])
        nd32.setDisp([0.0, -5.0])
        nd33.setDisp([5.0, -5.0])

        for elem in model.elements:
            elem.updateState()

        model.report()

        model.plot(factor=1.0)
        model.valuePlot('sxx', show_mesh=1)
        model.valuePlot('syy', show_mesh=1)
        model.valuePlot('sxy', show_mesh=1)

Run the example by creating an instance of the problem and executing it by calling Example.run()

if __name__ == "__main__":
    ex = ExamplePlate07()
    ex.run()
  • Undeformed system
  • Deformed System (magnification=1.00)
  • Contours of '$\sigma_{xx}$'
  • Contours of '$\sigma_{yy}$'
  • Contours of '$\sigma_{xy}$'
System Analysis Report
=======================

Nodes:
---------------------
  Node_629:
      x:    [0.000 0.000]
      u:    [0.000 0.000]
  Node_630:
      x:    [10.000 0.000]
      u:    [0.000 0.000]
  Node_631:
      x:    [10.000 10.000]
      u:    [0.000 0.000]
  Node_632:
      x:    [0.000 10.000]
      u:    [0.000 0.000]
  Node_633:
      x:    [22.000 0.000]
      u:    [0.000 0.000]
  Node_634:
      x:    [27.000 0.000]
      u:    [0.000 0.000]
  Node_635:
      x:    [32.000 0.000]
      u:    [0.000 0.000]
  Node_636:
      x:    [22.000 5.000]
      u:    [0.000 0.000]
  Node_637:
      x:    [27.000 5.000]
      u:    [0.000 0.000]
  Node_638:
      x:    [32.000 5.000]
      u:    [0.000 0.000]
  Node_639:
      x:    [22.000 10.000]
      u:    [0.000 0.000]
  Node_640:
      x:    [27.000 10.000]
      u:    [0.000 0.000]
  Node_641:
      x:    [32.000 10.000]
      u:    [0.000 0.000]
  Node_642:
      x:    [22.000 15.000]
      u:    [0.000 0.000]
  Node_643:
      x:    [27.000 15.000]
      u:    [0.000 0.000]
  Node_644:
      x:    [32.000 15.000]
      u:    [0.000 0.000]
  Node_645:
      x:    [22.000 20.000]
      u:    [0.000 0.000]
  Node_646:
      x:    [27.000 20.000]
      u:    [0.000 0.000]
  Node_647:
      x:    [32.000 20.000]
      u:    [0.000 0.000]
  Node_648:
      x:    [22.000 25.000]
      u:    [0.000 0.000]
  Node_649:
      x:    [27.000 25.000]
      u:    [0.000 0.000]
  Node_650:
      x:    [32.000 25.000]
      u:    [0.000 0.000]
  Node_651:
      x:    [0.000 15.000]
      u:    [0.000 0.000]
  Node_652:
      x:    [10.000 15.000]
      u:    [0.000 0.000]
  Node_653:
      x:    [0.000 25.000]
      u:    [0.000 0.000]
  Node_654:
      x:    [10.000 25.000]
      u:    [0.000 0.000]

Elements:
---------------------
  Triangle_843: nodes ( Node_629 Node_630 Node_632 )
      material: PlaneStress
      strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
      stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
  Triangle_844: nodes ( Node_631 Node_632 Node_630 )
      material: PlaneStress
      strain: xx=0.000e+00 yy=0.000e+00 xy=-0.000e+00 zz=-0.000e+00
      stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
  Triangle6_845: nodes ( Node_633 Node_635 Node_639 Node_634 Node_637 Node_636 )
      material: PlaneStress
      strain 0: xx=-1.110e-16 yy=0.000e+00 xy=0.000e+00 zz=3.331e-17
      stress 0: xx=-1.220e-15 yy=-3.660e-16 xy=0.000e+00 zz=0.000e+00
      strain 1: xx=-1.110e-16 yy=0.000e+00 xy=1.679e-31 zz=3.331e-17
      stress 1: xx=-1.220e-15 yy=-3.660e-16 xy=6.459e-31 zz=0.000e+00
      strain 2: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
      stress 2: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
  Triangle6_846: nodes ( Node_639 Node_635 Node_641 Node_637 Node_638 Node_640 )
      material: PlaneStress
      strain 0: xx=0.000e+00 yy=-1.110e-16 xy=2.484e-16 zz=3.331e-17
      stress 0: xx=-3.660e-16 yy=-1.220e-15 xy=9.554e-16 zz=0.000e+00
      strain 1: xx=0.000e+00 yy=-1.110e-16 xy=-2.234e-16 zz=3.331e-17
      stress 1: xx=-3.660e-16 yy=-1.220e-15 xy=-8.594e-16 zz=0.000e+00
      strain 2: xx=2.220e-16 yy=-1.110e-16 xy=-2.998e-16 zz=-3.331e-17
      stress 2: xx=2.074e-15 yy=-4.880e-16 xy=-1.153e-15 zz=0.000e+00
  Quad9_847: nodes ( Node_642 Node_644 Node_650 Node_648 Node_643 Node_647 Node_649 Node_645 Node_646 )
      material: PlaneStress
      strain (0): xx=8.882e-16 yy=-3.331e-16 xy=-2.776e-17 zz=-1.665e-16
      stress (0): xx=8.662e-15 yy=-7.320e-16 xy=-1.068e-16 zz=0.000e+00
      strain (1): xx=2.220e-16 yy=-4.441e-16 xy=-5.888e-16 zz=6.661e-17
      stress (1): xx=9.760e-16 yy=-4.148e-15 xy=-2.265e-15 zz=0.000e+00
      strain (2): xx=0.000e+00 yy=8.882e-16 xy=3.747e-16 zz=-2.665e-16
      stress (2): xx=2.928e-15 yy=9.760e-15 xy=1.441e-15 zz=0.000e+00
      strain (3): xx=1.332e-15 yy=2.220e-16 xy=8.235e-16 zz=-4.663e-16
      stress (3): xx=1.537e-14 yy=6.832e-15 xy=3.167e-15 zz=0.000e+00
      strain (4): xx=0.000e+00 yy=2.220e-16 xy=-1.388e-16 zz=-6.661e-17
      stress (4): xx=7.320e-16 yy=2.440e-15 xy=-5.338e-16 zz=0.000e+00
      strain (5): xx=1.554e-15 yy=-1.110e-16 xy=7.499e-17 zz=-4.330e-16
      stress (5): xx=1.671e-14 yy=3.904e-15 xy=2.884e-16 zz=0.000e+00
      strain (6): xx=6.661e-16 yy=6.661e-16 xy=-1.443e-15 zz=-3.997e-16
      stress (6): xx=9.516e-15 yy=9.516e-15 xy=-5.551e-15 zz=0.000e+00
      strain (7): xx=-2.220e-16 yy=6.661e-16 xy=2.748e-15 zz=-1.332e-16
      stress (7): xx=-2.440e-16 yy=6.588e-15 xy=1.057e-14 zz=0.000e+00
      strain (8): xx=-1.776e-15 yy=-2.220e-16 xy=-1.874e-15 zz=5.995e-16
      stress (8): xx=-2.025e-14 yy=-8.296e-15 xy=-7.206e-15 zz=0.000e+00
  Quad_848: nodes ( Node_651 Node_652 Node_654 Node_653 )
      material: list
      strain (0): xx=0.000e+00 yy=0.000e+00 xy=6.245e-17 zz=-0.000e+00
      stress (0): xx=0.000e+00 yy=0.000e+00 xy=2.402e-16 zz=0.000e+00
      strain (1): xx=0.000e+00 yy=0.000e+00 xy=1.249e-16 zz=-0.000e+00
      stress (1): xx=0.000e+00 yy=0.000e+00 xy=4.804e-16 zz=0.000e+00
      strain (2): xx=0.000e+00 yy=0.000e+00 xy=-1.735e-16 zz=-0.000e+00
      stress (2): xx=0.000e+00 yy=0.000e+00 xy=-6.672e-16 zz=0.000e+00
      strain (3): xx=0.000e+00 yy=0.000e+00 xy=-2.082e-16 zz=-0.000e+00
      stress (3): xx=0.000e+00 yy=0.000e+00 xy=-8.006e-16 zz=0.000e+00


System Analysis Report
=======================

Nodes:
---------------------
  Node_629:
      x:    [0.000 0.000]
      u:    [0.000 0.000]
  Node_630:
      x:    [10.000 0.000]
      u:    [5.000 0.000]
  Node_631:
      x:    [10.000 10.000]
      u:    [5.000 -5.000]
  Node_632:
      x:    [0.000 10.000]
      u:    [0.000 -5.000]
  Node_633:
      x:    [22.000 0.000]
      u:    [0.000 0.000]
  Node_634:
      x:    [27.000 0.000]
      u:    [2.500 0.000]
  Node_635:
      x:    [32.000 0.000]
      u:    [5.000 0.000]
  Node_636:
      x:    [22.000 5.000]
      u:    [0.000 -2.500]
  Node_637:
      x:    [27.000 5.000]
      u:    [2.500 -2.500]
  Node_638:
      x:    [32.000 5.000]
      u:    [5.000 -2.500]
  Node_639:
      x:    [22.000 10.000]
      u:    [0.000 -5.000]
  Node_640:
      x:    [27.000 10.000]
      u:    [2.500 -5.000]
  Node_641:
      x:    [32.000 10.000]
      u:    [5.000 -5.000]
  Node_642:
      x:    [22.000 15.000]
      u:    [0.000 0.000]
  Node_643:
      x:    [27.000 15.000]
      u:    [2.500 0.000]
  Node_644:
      x:    [32.000 15.000]
      u:    [5.000 0.000]
  Node_645:
      x:    [22.000 20.000]
      u:    [0.000 -2.500]
  Node_646:
      x:    [27.000 20.000]
      u:    [2.500 -2.500]
  Node_647:
      x:    [32.000 20.000]
      u:    [5.000 -2.500]
  Node_648:
      x:    [22.000 25.000]
      u:    [0.000 -5.000]
  Node_649:
      x:    [27.000 25.000]
      u:    [2.500 -5.000]
  Node_650:
      x:    [32.000 25.000]
      u:    [5.000 -5.000]
  Node_651:
      x:    [0.000 15.000]
      u:    [0.000 0.000]
  Node_652:
      x:    [10.000 15.000]
      u:    [5.000 0.000]
  Node_653:
      x:    [0.000 25.000]
      u:    [0.000 -5.000]
  Node_654:
      x:    [10.000 25.000]
      u:    [5.000 -5.000]

Elements:
---------------------
  Triangle_843: nodes ( Node_629 Node_630 Node_632 )
      material: PlaneStress
      strain: xx=5.000e-01 yy=-5.000e-01 xy=0.000e+00 zz=-0.000e+00
      stress: xx=3.846e+00 yy=-3.846e+00 xy=0.000e+00 zz=0.000e+00
  Triangle_844: nodes ( Node_631 Node_632 Node_630 )
      material: PlaneStress
      strain: xx=5.000e-01 yy=-5.000e-01 xy=-0.000e+00 zz=-0.000e+00
      stress: xx=3.846e+00 yy=-3.846e+00 xy=0.000e+00 zz=0.000e+00
  Triangle6_845: nodes ( Node_633 Node_635 Node_639 Node_634 Node_637 Node_636 )
      material: PlaneStress
      strain 0: xx=5.000e-01 yy=-5.000e-01 xy=0.000e+00 zz=1.332e-16
      stress 0: xx=3.846e+00 yy=-3.846e+00 xy=0.000e+00 zz=0.000e+00
      strain 1: xx=5.000e-01 yy=-5.000e-01 xy=-2.442e-16 zz=-6.661e-17
      stress 1: xx=3.846e+00 yy=-3.846e+00 xy=-9.394e-16 zz=0.000e+00
      strain 2: xx=5.000e-01 yy=-5.000e-01 xy=0.000e+00 zz=5.329e-16
      stress 2: xx=3.846e+00 yy=-3.846e+00 xy=0.000e+00 zz=0.000e+00
  Triangle6_846: nodes ( Node_639 Node_635 Node_641 Node_637 Node_638 Node_640 )
      material: PlaneStress
      strain 0: xx=5.000e-01 yy=-5.000e-01 xy=4.573e-16 zz=-1.332e-16
      stress 0: xx=3.846e+00 yy=-3.846e+00 xy=1.759e-15 zz=0.000e+00
      strain 1: xx=5.000e-01 yy=-5.000e-01 xy=9.985e-16 zz=-5.995e-16
      stress 1: xx=3.846e+00 yy=-3.846e+00 xy=3.840e-15 zz=0.000e+00
      strain 2: xx=5.000e-01 yy=-5.000e-01 xy=-2.609e-16 zz=-0.000e+00
      stress 2: xx=3.846e+00 yy=-3.846e+00 xy=-1.003e-15 zz=0.000e+00
  Quad9_847: nodes ( Node_642 Node_644 Node_650 Node_648 Node_643 Node_647 Node_649 Node_645 Node_646 )
      material: PlaneStress
      strain (0): xx=5.000e-01 yy=-5.000e-01 xy=3.053e-16 zz=-3.331e-16
      stress (0): xx=3.846e+00 yy=-3.846e+00 xy=1.174e-15 zz=0.000e+00
      strain (1): xx=5.000e-01 yy=-5.000e-01 xy=-1.154e-15 zz=-6.661e-17
      stress (1): xx=3.846e+00 yy=-3.846e+00 xy=-4.437e-15 zz=0.000e+00
      strain (2): xx=5.000e-01 yy=-5.000e-01 xy=-1.305e-15 zz=-3.664e-16
      stress (2): xx=3.846e+00 yy=-3.846e+00 xy=-5.017e-15 zz=0.000e+00
      strain (3): xx=5.000e-01 yy=-5.000e-01 xy=1.233e-15 zz=-3.997e-16
      stress (3): xx=3.846e+00 yy=-3.846e+00 xy=4.743e-15 zz=0.000e+00
      strain (4): xx=5.000e-01 yy=-5.000e-01 xy=-1.110e-16 zz=-3.331e-17
      stress (4): xx=3.846e+00 yy=-3.846e+00 xy=-4.270e-16 zz=0.000e+00
      strain (5): xx=5.000e-01 yy=-5.000e-01 xy=-1.300e-16 zz=6.661e-17
      stress (5): xx=3.846e+00 yy=-3.846e+00 xy=-5.000e-16 zz=0.000e+00
      strain (6): xx=5.000e-01 yy=-5.000e-01 xy=3.400e-16 zz=3.331e-17
      stress (6): xx=3.846e+00 yy=-3.846e+00 xy=1.308e-15 zz=0.000e+00
      strain (7): xx=5.000e-01 yy=-5.000e-01 xy=3.064e-15 zz=-2.665e-16
      stress (7): xx=3.846e+00 yy=-3.846e+00 xy=1.178e-14 zz=0.000e+00
      strain (8): xx=5.000e-01 yy=-5.000e-01 xy=-1.402e-15 zz=6.328e-16
      stress (8): xx=3.846e+00 yy=-3.846e+00 xy=-5.391e-15 zz=0.000e+00
  Quad_848: nodes ( Node_651 Node_652 Node_654 Node_653 )
      material: list
      strain (0): xx=5.000e-01 yy=-5.000e-01 xy=4.510e-17 zz=-0.000e+00
      stress (0): xx=3.846e+00 yy=-3.846e+00 xy=1.735e-16 zz=0.000e+00
      strain (1): xx=5.000e-01 yy=-5.000e-01 xy=2.082e-16 zz=-0.000e+00
      stress (1): xx=3.846e+00 yy=-3.846e+00 xy=8.006e-16 zz=0.000e+00
      strain (2): xx=5.000e-01 yy=-5.000e-01 xy=-1.769e-16 zz=-6.661e-17
      stress (2): xx=3.846e+00 yy=-3.846e+00 xy=-6.805e-16 zz=0.000e+00
      strain (3): xx=5.000e-01 yy=-5.000e-01 xy=4.163e-17 zz=-0.000e+00
      stress (3): xx=3.846e+00 yy=-3.846e+00 xy=1.601e-16 zz=0.000e+00

Total running time of the script: (0 minutes 0.487 seconds)

Gallery generated by Sphinx-Gallery