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

shoreline constraints #110

Closed
huyquangtranaus opened this issue Aug 25, 2020 · 14 comments
Closed

shoreline constraints #110

huyquangtranaus opened this issue Aug 25, 2020 · 14 comments

Comments

@huyquangtranaus
Copy link

mesh_
Hi Keith, William,

I am making a mesh over the wharf like the land, but I want to keep its shape (e.g. straight line, not weirs) An example is attached. Is OceanMesh2D capable of doing that?

Thanks, mates
Huy

@krober10nd
Copy link
Collaborator

krober10nd commented Aug 25, 2020

Hey Huy,

Yes, we have an example that shows how to do something like that here...
https://github.com/CHLNDDEV/OceanMesh2D/blob/Projection/Examples/Example_6b_GBAY_w_floodplain.m

We first mesh to the datum in a water tight fashion, then we use extractFixedConstraints to get the vertices and edges along the mainland and island boundaries so that these points and edges will be constrained in the subsequent meshing step.

Then we define a new geodata using a contour of a higher height (e.g., 10-m) and call the mesh generator with the pfix and egfix. Note in this second call to meshgen we re-use the same sizing function. All sizing options can be specified by depth-ranges, which is shown in the example.

@huyquangtranaus
Copy link
Author

GBBAY
Cool, Keith,

Yes, I explored that example before. I see it could be one solution for me. However, when I zoom in, I don't see we have a straight (extract, sharp) line as a screenshot attached? In that case, I anticipate that there might be some bad elements along the line, but can we do that?

@krober10nd
Copy link
Collaborator

krober10nd commented Aug 25, 2020

I would suggest to plot the mesh plot(m,'bmesh',0) and then plot the edge constraints hold on; drawedge2(pfix,egfix) and then zoom in to make sure.

All edge constraints should be retained and your mshgen.build should have a different looking output showing the edge constraining algorithm is active.

@huyquangtranaus
Copy link
Author

1
Oh yes, I see somewhere in the mesh (attached), can we also make two parallel straight lines along a shipping channel? That would be a powerful feature then.

@krober10nd
Copy link
Collaborator

glad it's working, the translation in location is likely due to the projection you built the mesh in but that's just a guess.

And yes, that's already all in there. what you could is this:

  1. Build a sizing function
  2. Draw a line along your channel and increase point spacing to h0 using the function my_interpm
  3. Apply the decimation technique that we use for the initial point rejection to remove some points from the line. This is so the point spacing along the line agrees with the sizing function.
  4. Pass these points and edges to mshgen

@krober10nd
Copy link
Collaborator

I could make a simple function to do the above but maybe you could first take a stab at it.

@krober10nd
Copy link
Collaborator

@huyquangt can you post your code so I can see what's going on to create these images?

@huyquangtranaus
Copy link
Author

hello @krober10nd, I used the example Example_6b_GBAY_w_floodplain.m to make these images.

@krober10nd
Copy link
Collaborator

Ah ok then I would turn off cleanup in mshgen. And then do it after with the implicit smoother turned off. That can shift points unfortunately.

@huyquangtranaus
Copy link
Author

do you have time to do it soon? then I can have a try

Thanks mate

@huymetocean
Copy link

Hey Keith @krober10nd it seems to me that in the example /Example_6b_GBAY_w_floodplain.m, the constraints are applied to the entire (outer) edges for mapping the main land. Can we only apply part of it?

@krober10nd
Copy link
Collaborator

I ran the Example_6b_GBAY_w_floodplain.m to completion and I only see the shoreline and islands being constrained (blue edges).
Screen Shot 2020-08-26 at 12 34 37 PM

But yes, if you run meshgen with cleanup, 1 then this destroys both pfix and egfix because of the option ds. Something to look more into but the solution is to defer cleaning to after mesh generation is completed and run it with a custom option set that doesn't do direct_smooth (e.g., ds,0)

I don't think I have time to look into the channel constraints thing at least for the next few weeks.

@krober10nd
Copy link
Collaborator

Screen Shot 2020-08-26 at 1 23 56 PM

@CHLNDDEV
Copy link
Owner

#264

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

4 participants