Coder Social home page Coder Social logo

unstructured_grids's People

Contributors

tkeskita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unstructured_grids's Issues

Old development ideas

Moved old development ideas here from readme:

  • Don't save Unstructured Grid object in blend file to save disk space
    (mesh is anyways thrown away and regenerated from UG text
    strings)

  • Add Gzip option to OpenFOAM PolyMesh export

  • Split Cells (Edge Division) (e.g. hexahedral cell is split to 8
    cells, tetrahedral cell is split into 4 cells)

  • Dissolve Internal Faces (merge cells)

  • Merge Overlapping Boundary Faces (e.g. to merge two mesh regions)

  • Separate Internal Faces (convert internal face to two boundary faces)

  • Split Cells (Center Slicing) (polyhedron cell face vertices are
    connected to cell center)

  • Show Cells (creates temporary object with faces around
    selected cells)

  • Fix Intersecting Boundaries (move boundary vertices so
    that boundary faces don't intersect each other)

  • Support for OpenFOAM sets?

  • Mesh Quality metrics + operator to select bad cells. Definition of
    bad cells depend on target simulation type, so there would need to
    be several metrics. This would be nice-to-have but not essential,
    since it is possible to use checkMesh utility of OpenFOAM, or
    e.g. Mesh Quality filter in Paraview or e.g.
    BVTKNodes
    to evaluate mesh quality.

Error on importing paraview generated VTU ascii file

Hi, I tried to import a vtu (asci) file generated in paraview. It is a simple rectangular mesh with stress field values (tension).

But I tried many different methods and what I get is this error:
Traceback (most recent call last):
File "C:\Users\tcd\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\unstructured_grids-master\io_vtu.py", line 67, in execute
n = vtu_to_ugdata(text)
File "C:\Users\tcd\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\unstructured_grids-master\io_vtu.py", line 132, in vtu_to_ugdata
points = get_data_array_block("Points", "float", text)
File "C:\Users\tcd\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\unstructured_grids-master\io_vtu.py", line 190, in get_data_array_block
return get_list_from_text(datablock, vartype)
File "C:\Users\tcd\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\unstructured_grids-master\io_vtu.py", line 203, in get_list_from_text
valuelist.append(eval(command))
File "", line 1
float(<InformationKey)
^
SyntaxError: invalid syntax

Attached is the small vtu file (zipped) for reference.
simpcube_voltest01.zip

Any help greatly appreciated!

could we get a youtube example tutorial?

hey, this is very interesting and I plan to give it a whirl.

Would definitely appreciate a youtube tutorial showing an example from start to finish and covering all the functionality. Could you do this?

Shell Extrusion Method Idea

I developed a fairly simple shell extrusion / boundary layer extrusion method to create thin flat cell layers. I'll use this issue for notes.

General description:

  • Extrude from an unstructured face mesh as it is.
  • Main problem: find an extrusion direction for all vertices so that no intersections are created during extrusion.
  • Algorithm is meant to create mostly flat cells, which are numerically good in base face normal direction. The trade-off is that the cell side faces can be bad (non-orthogonal, skewed, twisted). Also cells near convex edges are non-orthogonal in base normal direction because extrusion direction deviates a lot from face normal direction.
  • Final target is to get a fixed layer thickness (approximately constant face-to-face length).

Algorithm:

  • Calculate edge angle max convexity weights w for each vertex. Boundary verts are considered maximally convex.
  • Initial extrusion direction dir = vertex normal direction. Then propagate among edge neighbours: dir = w * dir + sum w_neighbour * dir_neighbour. Iterate n times. (Left out: Optionally weight by edge length also?)
  • Exception: boundary verts always use fixed direction (vertex normal direction).
  • Own direction is overweighted for convex vertices during direction propagation to prohibit changes in direction. Found out that otherwise convex edge loops tend to pull the directions towards edge loop center, but the ideal direction for convex verts is towards vertex normal direction.
  • Vertex weights are increased during iteration if neighbour has a large weight. This allows direction propagation among non-convex neighbours if convex vertices exist in neighbourhood.
  • Test for self-intersection during extrusion and warn user if it happens. Intersection testing is done by ray casting from perturbed locations around each vertex. This method is not always accurate, but seems to work fairly OK.

Definition of extrusion length to achieve constant thickness

  • Boundary verts use target thickness length always
  • For internal verts, use target thickness first, then calculate neighbour face normal ray length and calculate a scaling factor to move vert along direction vector. Use a maximum scaling value for safety.

Done:

  • Allow user to manually modify extrusion directions before extrusion

Future ideas:

  • How to improve extrusion directions for non-neighbour vertices intersecting near convex shapes?
  • Don't create neighbouring cells with multiple in-between faces. These originate from hanging verts (hanging nodes). Solution would be not to extrude hanging verts. It would require some index juggling in face creation. Leave for wish list for now.

AttributeError: module 'time' has no attribute 'clock'

Hello,

I've just installed your addon, which looks great (just like your other addons). I'm running Arch Linux with the Blender installation from the official repo. It looks like Inside Blender my local Python version 3.9.0 is running. When I press 'Extrude Cells' I get the error message

Error: Python: Traceback (most recent call last): File "/home/.../.config/blender/2.91/scripts/addons/unstructured_grids-master/ug_extrude.py", line 110, in execute t0 = time.clock() AttributeError: module 'time' has no attribute 'clock'

I believe time.clock() is not supported in Python versions >=3.8. Would it be possible to update the script?

Thanks and all the best,
Michael

Importing a polyMesh with baffle type face zones fail

Importing a polyMesh with baffles (patches with overlapping boundary faces) fail. Buest guess for failure is overlapping faces with shared vertices, which Blender does not allow. The error seen in debug printouts is as follows, and the boundary faces show incorrect materials --> indexing is messed up.

Python: Traceback (most recent call last):
  File "/home/x/.config/blender/2.93/scripts/addons/unstructured_grids/io_polymesh.py", line 80, in execute
    read_polymesh_files(self)
  File "/home/x/.config/blender/2.93/scripts/addons/unstructured_grids/io_polymesh.py", line 103, in read_polymesh_files
    polymesh_to_ugdata(self)
  File "/home/x/.config/blender/2.93/scripts/addons/unstructured_grids/io_polymesh.py", line 215, in polymesh_to_ugdata
    apply_materials_to_boundaries(ob)
  File "/home/x/.config/blender/2.93/scripts/addons/unstructured_grids/io_polymesh.py", line 591, in apply_materials_to_boundaries
    ob.data.polygons[facecount].material_index = mati
IndexError: bpy_prop_collection[index]: index 12061 out of range, size 12061

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.