Build a local mesh

Hi, is it possible to build local mesh in 2D? If I’m using:

mesh Th = square(2,2);

as a global mesh, and I want to build a refined local mesh for each triangle. Can I do that? How?

Olá Larissa,

Que tipo de malha você se refere?

Você quer refinar essa mesmo? Ou busca uma outra mais específica?

Se for refinar essa, basta mudar esse número 2, por um número maior.
Esse comando global constrói um quadrado unitário, em que cada aresta é particionada em duas partes.

Esse dois indica essa partição. Caso queira aumentar a partição, basta aumentar esse valor.

Cordialmente,

Pitágoras Carvalho.

Não é bem isso. Eu qro fazer malhas locais em cada triangulo. Entao por exemplo, se eu tenho uma malha global com 8 triangulos (square(2,2)) e ai em cada um desses triangulos eu quero criar uma outra malha.

Simply use the keyword trunc with the parameter split, cf. documentation.

But how do I specify a triangle?

By reading the documentation: Global variables.

But there is no parameter in the trunc function that lets me specify which triangle I want to split. I’m reading the documentation and I’m not finding how to do this

globalmesh
Suppose that I’m working with this as a global mesh

Then for each triangle want to build a diferente mesh.
For exemple, something like that:

mesh[int] Th(NbTriangles);
for(int i = 0; i < NbTriangles; i++){
   Th[i] = trunc(Triangle[i], slipt=3);
}

Or maybe if I can pass de nodes number that define a triangle and build a mesh. I’m searching but I haven’t seen anything like that in the documentation, or in discussions here.