# CGX change orientation of splitting quadrilaterals into triangles

**URL:** <https://calculix.discourse.group/t/cgx-change-orientation-of-splitting-quadrilaterals-into-triangles/131>\
**Category:** CalculiX GraphiX\
**Created:** [August 18, 2020, 10:49am UTC](https://calculix.discourse.group/t/cgx-change-orientation-of-splitting-quadrilaterals-into-triangles/131 "2020-08-18T10:49:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benzwick](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@benzwick](https://calculix.discourse.group/u/benzwick)\
**Post date:** [August 18, 2020, 10:49am UTC](https://calculix.discourse.group/t/cgx-change-orientation-of-splitting-quadrilaterals-into-triangles/131/1 "2020-08-18T10:49:47Z")

</div>

Is it possible to change the orientation of the split quadrilaterals on the left to look more like the higher quality ones (lower aspect ratios) on the right?

 ![Screenshot_20200818_184143](https://global.discourse-cdn.com/free1/uploads/calculix/original/1X/821d41b47e41f2f0964631a9053c992597d301a9.png)

The CGX input file is as follows:

```auto
valu rad 1
valu ra2 * 0.7071067811865475 rad
valu len 4
pnt c 0.0 0.0 0.0
pnt p1 rad 0.0 0.0
pnt p2 len 0.0 0.0
pnt p3 len len 0.0
pnt p4 0.0 len 0.0
pnt p5 0.0 rad 0.0
pnt p6 ra2 ra2 0.0
line L001 p1 p2 2
line L002 p2 p3 2
line L003 p3 p4 2
line L004 p4 p5 2
line L005 p5 p6 c 2
line L006 p6 p1 c 2
line L007 p6 p3 2
gsur A001 + BLEND + L001 + L002 + L007 + L006
gsur A002 + BLEND + L007 + L003 + L004 + L005
seta hole l L005
seta hole l L006
seta hole p p1
seta hole p p5
seta hole p p6
seta ymin l L004
seta ymin p p4
seta ymin p p5
seta xmin l L001
seta xmin p p1
seta xmin p p2
div all mult 8
plot ld all k
del mesh
elty all tr3
mesh all
elty all tr3e
plot mesh all
send all abq
send xmin abq raw
send ymin abq raw
send hole abq raw

```

I am quite new to using CGX so any other suggestions for improvement of the mesh file are also very welcome.

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [August 18, 2020, 4:43pm UTC](https://calculix.discourse.group/t/cgx-change-orientation-of-splitting-quadrilaterals-into-triangles/131/2 "2020-08-18T16:43:38Z")

</div>

I just see the possibility to replace the regular mesh by an unstructured. Replace  
elty all tr3  
by  
elty all tr3u  
in your command file.

Best regards,  
Klaus

---

<div class="post-metadata">

**Author:** ![benzwick](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@benzwick](https://calculix.discourse.group/u/benzwick)\
**Post date:** [August 19, 2020, 3:21am UTC](https://calculix.discourse.group/t/cgx-change-orientation-of-splitting-quadrilaterals-into-triangles/131/3 "2020-08-19T03:21:05Z")

</div>

Thanks @klaus.wittig but I am trying to compare results using structured and unstructured grids so I need to use a structured grid here. I managed to switch the orientation of the diagonals by replacing

```auto
gsur A002 + BLEND + L007 + L003 + L004 + L005

```

with

```auto
gsur A002 - BLEND + L004 + L003 + L007 + L005

```

The mesh now looks like this:

 ![Screenshot_20200819_111937](https://global.discourse-cdn.com/free1/uploads/calculix/original/1X/7477e6582102b64bc07b4b3d83247e931aa21a2e.png)
