VTK file output of the Rectangle domain

Asked by hhh_Chen

Hello,
   I met a minor problem while outputting the VTK file of my problem domain. My domain is a rectangle area which is discretized into 40 8-node square elements. However, in the VTK file there are 240 cells. I don't recognize where the error is.

Here are part of the scripts:

from esys.escript import *
from esys.finley import Rectangle
from esys.weipa import saveVTK
mydomain=Rectangle(n0=1,n1=40,l0=0.25,l1=10.,order=2,integrationOrder=2)
x=mydomain.getX()
Bound=whereZero(x[1])*[1,1]
saveVTK("mydomain.vtu",Bound=Bound)

Any help is appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Ellery
Solved:
Last query:
Last reply:
Revision history for this message
Best Adam Ellery (aellery) said :
#1

Hi Chen,

Each element is divided into 6 cells, so a 1x40 grid should contain 1 x 6 x 40 = 240 cells. I believe that your code is giving you the correct answer.

Your elements each look like this:

1-2-3
| / \ |
4-5-6
| \ / |
7-8-9

(2 is connected to 4 and 6, 8 is connected to 4 and 6)

- Adam

Revision history for this message
hhh_Chen (chenlifan) said :
#2

Thanks Adam Ellery, that solved my question.