- pdegplot: https://www.mathworks.com/help/pde/ug/pdeplot.html
- initmesh: https://www.mathworks.com/help/pde/ug/initmesh.html
- refinemesh: https://www.mathworks.com/help/pde/ug/refinemesh.html
Create structered triangular mesh
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How to generate a structered mesh triangular so that the connecting segment of center of gravity is orthogonal to the triangle edge ( with minimum of triangle )?
geometrie
pdegplot(g); %
[p,e,t]=initmesh(g);
%[p,e,t]=refinemesh(g,p,e,t);
pdemesh(p,e,t),
0 comentarios
Respuestas (1)
Hari
el 13 de Nov. de 2024 a las 3:03
Hi Ali,
I understand that you want to generate a structured triangular mesh where the line connecting the center of gravity of each triangle is orthogonal to the triangle's edges, aiming for minimal triangles.
I assume you are using PDE Toolbox for mesh generation and visualization. Here the steps you can follow:
Define Geometry:
Start by defining the geometry of the domain you want to mesh. You can use the pdegplot function to visualize the geometry
% Define geometry (example: unit circle)
g = decsg([1, 0, 0, 1]'); % Circle with radius 1
pdegplot(g);
Initialize the Mesh: Use the initmesh function to create an initial mesh for your geometry. This function returns the points (p), edges (e), and triangles (t) of the mesh.
% Initialize the mesh
[p, e, t] = initmesh(g);
Refine the Mesh: Optionally, use refinemesh to refine the initial mesh. This step can help in achieving a more structured mesh by increasing the number of triangles.
% Refine the mesh to improve structure
[p, e, t] = refinemesh(g, p, e, t);
Visualize the Mesh: Use the pdemesh function to visualize the generated mesh. This helps in verifying the structure and orthogonality of the mesh.
% Visualize the mesh
pdemesh(p, e, t);
Adjusting Mesh for Orthogonality: Ensuring orthogonality of gravity centers may require custom mesh manipulation, which might not be directly achievable with standard functions. Consider using custom algorithms or manual adjustments for precise control.
Refer to the documentation following functions for more info about them:
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Geometry and Mesh en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!