Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk Example: Changing Order of Elements in Mesh? #107

Closed
Chaztikov opened this issue Nov 22, 2017 · 2 comments
Closed

Disk Example: Changing Order of Elements in Mesh? #107

Chaztikov opened this issue Nov 22, 2017 · 2 comments

Comments

@Chaztikov
Copy link

Chaztikov commented Nov 22, 2017

Hi again,

This is somewhat of an extension of my previous question, but lies at the crux of my problems. If there is a better medium through which I should ask questions, please let me know.

Question 3
For the following simple example of a disk (code that follows works)
"Generate Disk Geometry"

geom = pygmsh.built_in.Geometry()

#add points for circle
x0 = (0.,0., 0.)
radius = 1
lcar = 10
#approximate circle by polygon with #edges = 2*num_sections
num_sections = 40
poly = geom.add_circle(x0, radius, lcar, R=None, compound=False, num_sections=num_sections, holes=None, make_surface=True)

#generate mesh from geom
points, cells, point_data, cell_data, field_data = pygmsh.generate_mesh(geom)

import meshio
meshio.write('disk.vtu', points, cells, cell_data=cell_data)

How do I change the 'order' of the elements (i.e. the number of nodes on a given triangle, in this example).

Thanks, and Happy Thanksgiving
Charlie

@nschloe
Copy link
Owner

nschloe commented Nov 23, 2017

If there is a better medium through which I should ask questions, please let me know.

Here is fine.

For second order I think you need to specify

Mesh.ElementOrder = 2;

in gmsh, hence

geom.add_raw_code('Mesh.ElementOrder = 2;')

@nschloe nschloe closed this as completed Nov 23, 2017
@Chaztikov
Copy link
Author

Chaztikov commented Nov 23, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants