Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meaning of the colors #95

Open
almirnunes opened this issue Jul 8, 2020 · 10 comments
Open

Meaning of the colors #95

almirnunes opened this issue Jul 8, 2020 · 10 comments

Comments

@almirnunes
Copy link

almirnunes commented Jul 8, 2020

First of all, thank you very much for this tool you developed! It is great!

I am trying to generate my first grid to later be used in SWAN. Everything is working great so far. However, I am a bit confused about the meaning of the colors when the program shows the mesh. For example the difference between the red and blue here:

bild

I tried to find this information in the manual without success. Hopefully, I am not missing something obvious.

Thanks again.

Almir

@krober10nd
Copy link
Collaborator

Hey,

Thanks!

The color indicates the type of segment (ocean, mainland, or island). The variation in color occurs here because you're applying boundary conditions with the method

make_bc using the auto option.

The auto option uses a combination of depth at the vertices and length of the segments to decide how to classify the boundary segments (either as open ocean, island, or mainland) to apply boundary conditions. Here I suppose when you interpolate bathymetry data to this area that's fairly coarsely refined, the variation in depth is quite large and so it thinks that some of those segments are open ocean when they're not.

You can apply boundary conditions by hand by doing this

m = make_bc(m,'outer',0);

and then click the nodes using the data cursor and type them into the prompt and follow those instructions. The trailing 0 there indicates the direction to connect the two points you click and supply to the prompt (either CCW or CW).

There are also tuning options for the auto method so it can better predict those segments. Those can be found by typing

help make_bc

Best,

@krober10nd
Copy link
Collaborator

Also, if you go the hand specification route, make sure to run

m = make_bc(m,'islands');

as this will apply island boundary conditions to, well, all your islands, which is critical for SWAN to work.

@almirnunes
Copy link
Author

Loud and clear. Thanks!

I will try the manual boundaries setting.

Cheers,
Almir

@cnske
Copy link

cnske commented Jul 12, 2022

I have an additional question regarding the manual assignment of boundaries as mentioned above.
When doing so a plot which helps to select the right nodes is showing. However, this plot always comes after the prompts to enter the nodes, which means one have to run the code twice. Is there an option to trigger the appearance of the plot before the input prompt happens?
Additionally I would like to know how to assign multiple, but different boundaries using the manual mode.

Thanks beforehand.

@krober10nd
Copy link
Collaborator

krober10nd commented Jul 12, 2022

You would call the method msh.make_bc repeatedly. I'm not sure I follow your issue with the prompt appearing and the figure. The prompt and the plot appears and then you interrogate the figure to find the nodes using the data cursor.

@krober10nd krober10nd reopened this Jul 12, 2022
@cnske
Copy link

cnske commented Jul 12, 2022

Ok. I assumed that. Do I somehow need to append the output of the repetitive call to m or does a different type of boundary prevent overwriting?
Regarding the prompt and the figure:
In my case MatLab first asks me to enter the nodes and type of boundary. After I did so the figure which can be used to find and identify the specific nodes appears. I assume this should be the other way around.

@krober10nd
Copy link
Collaborator

The program will automatically append to the appropriate fields when called repeatedly AFAIR so there should be no overwriting.

To clear the boundaries, type m.bd = []; m.op

Perhaps there's just a delay in your computer creating the plot. Could you try to perform this operation and wait a minute or two and see if it appears?

@cnske
Copy link

cnske commented Jul 13, 2022

Your memory was correct, the program automatically appends to the appropriate fields when called w/o overwriting.

I checked regarding any kind of delay on my computer and waited almost 10 min without any plot appearing. May there be an option to tell the function to show the plot immediately?

@krober10nd
Copy link
Collaborator

krober10nd commented Jul 13, 2022

How are you calling the msh.make_bc() method? If you call it like this m = make_bc(m,'outer',1) then the plot will appear first showing the boundary points bpts then it will prompt you to enter the nodes. See the screenshot below for the related code.

If you call msh.make_bc with more than two varargin then it will expect the start and end node as the additional arguments and a plot will not show up.

image

@cnske
Copy link

cnske commented Jul 14, 2022

I'm calling msh.make_bc() like follows to create my boundaries:
m = make_bc(m, 'auto', gdat);
m = make_bc(m, 'outer', 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants