Re: msh package, extraction of mesh data

Carlo De Falco <[email protected]>
Newsgroups gmane.comp.gnu.octave.general
Message-ID <[email protected]>
Hi,

> Il giorno 10 mar 2021, alle ore 11:30, Mishal0488 <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.