msh package, extraction of mesh data

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

msh package, extraction of mesh data

Mishal0488
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: msh package, extraction of mesh data

Carlo de Falco-2
Hi,

> Il giorno 10 mar 2021, alle ore 11:30, Mishal0488 <[hidden email]> ha scritto:
>
> Hi Guys
>
> I have attached my code below.
> M consists of 3 outputs "p", "e" and "t".
> If the size of M is checked it is always 1x1 which makes no sense.


the variable "M" returned by the mesh creation functions is a "scalar structure" [1]
which corresponds to a "structure array" [2] with length 1, thus the size is reported as 1.


> If I display the contents of M I get the correct data.
> How can I extract the data "p", "e" and "t" from M?

For info on how to access the structure fields see the appropriate manual section [1],
this is a general feature of the language not something related to the msh package.

Each of the three fields is a matrix which you can manipulate as usual.

More fields can be added to the structure by the

msh*m_*_properties ()

functions if needed for, e.g., FEM computations such as in the bim package.

> Furthermore does anyone have experience with the
> "[emesh,snodes,ssides,striangles] = msh3e_surface_mesh(mesh,nsrf,nsides)",
> function? Any assistance in its use would be appreciated. There is not much
> help on the function.

What do you want to do with this function?

> pkg load msh
> x = y = linspace(0, 1, 4);
> M = msh2m_structured_mesh(x, y, 1, 1:4)
> msh2p_mesh(M)

what is this code snippet meant to represent?
There some usage examples for the msh package in the wiki [3],
but they are mainly meant to show how to use it for providing input to
the bim package.

c.


[1] https://octave.org/doc/v6.2.0/Structures.html
[2] https://octave.org/doc/v6.2.0/Structure-Arrays.html
[3] https://wiki.octave.org/Bim_package