SciFEM-Project_CoffeeMugSim.../generate_mesh
2026-01-24 20:51:50 +01:00
..
ascii_read_meshvector.m copied the templates 2026-01-19 10:45:46 +01:00
ascii_write_mesh.m copied the templates 2026-01-19 10:45:46 +01:00
ascii_write_subdomains.m copied the templates 2026-01-19 10:45:46 +01:00
coffee_cup.m Less Elements for easier debugging 2026-01-24 20:51:50 +01:00
coffee_cup.txt Less Elements for easier debugging 2026-01-24 20:51:50 +01:00
coffee_cup_sd.txt Less Elements for easier debugging 2026-01-24 20:51:50 +01:00
README.md copied the templates 2026-01-19 10:45:46 +01:00
visualize_results.m convert mesh to meters, more coefficients 2026-01-24 00:45:46 +01:00

generate_mesh: mesh generation via matlab for 2D objects

  • Triangular linear elements are generated to describe the mesh.

File structure

A script foo.m generates two files:

  • foo.txt : contains
    • number of vertices
    • dimension in space (=2)
    • number of elements
    • number of vertices per element (=3)
    • list of vertex coordinates: xk, yk
    • list of vertex indices defining the elements: idxi,1, idxi,2, idxi,3
    • indices start with 1 (Fortran)
  • foo_sd.txt :
    • number of elements
    • subdomain index an element belongs to
    • indices start with 1 (Fortran)

current code structure

  • ascii_write_mesh.m : function that writes a mesh file for input in other codes
  • ascii_write_subdomains.m : function that writes the subdomain number for each element into a file
  • generate_rectangle_subdomains.m : function that generates (n x k) subdomains by combining squares
  • square_4.m : generates mesh and subdomain files for a square separated into subdomains
  • rec_kk.m : generates mesh and subdomain files for kk subdomains
  • chip_2materials.m : generates mesh and subdomain files for chip geometry with 2 subdomains