CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
183 stars 65 forks source link

mapping all old attributes to new file #194

Closed krober10nd closed 3 years ago

krober10nd commented 3 years ago
WPringle commented 3 years ago

I don't quite understand this. What is a blank nodal attribute? The numofnodes may be different between old and new mesh right?

krober10nd commented 3 years ago

If the new mesh that you want the nodal attributes on from an old mesh does not have default values for these nodal attributes, nothing will be migrated.

On Sun, 28 Feb 2021 at 4:35 PM William Pringle notifications@github.com wrote:

I don't quite understand this. What is a blank nodal attribute? The numofnodes may be different between old and new mesh right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CHLNDDEV/OceanMesh2D/pull/194#issuecomment-787509073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOBZ7DHC23NUG6KL76RVI3TBKLIZANCNFSM4YJ5HNHQ .

-- Keith Jared Roberts (krober@usp.br) Postdoctoral Research Fellow Escola Politécnica, Universidade de São Paulo keithroberts.site

WPringle commented 3 years ago

I see, but numofnodes should be updated to length(ind) still.

And in case of you pass 'ind' then new mesh is equal to the old mesh right?

WPringle commented 3 years ago
 obj.f13 = m_old.f13; 
 obj.f13.NumOfNodes = m_old.f13.NumOfNodes; 
 obj.f13.NumOfNodes = m_old.f13.nAttr; 

should be something like this:

 obj.f13 = m_old.f13; 
 obj.f13.NumOfNodes = length(ind);  
krober10nd commented 3 years ago

I didn’t have any problems with this. Will have to see later when I have time.

I rather have a function to set default attributes for a nodal attribute.

And then leave the migration the way it was