Giter Club home page Giter Club logo

Comments (14)

krober10nd avatar krober10nd commented on June 28, 2024 1

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.

from oceanmesh2d.

huyquangtranaus avatar huyquangtranaus commented on June 28, 2024

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?

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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.

from oceanmesh2d.

huyquangtranaus avatar huyquangtranaus commented on June 28, 2024

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.

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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

from oceanmesh2d.

huyquangtranaus avatar huyquangtranaus commented on June 28, 2024

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

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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.

from oceanmesh2d.

huyquangtranaus avatar huyquangtranaus commented on June 28, 2024

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

Thanks mate

from oceanmesh2d.

huymetocean avatar huymetocean commented on June 28, 2024

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?

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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.

from oceanmesh2d.

krober10nd avatar krober10nd commented on June 28, 2024

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

from oceanmesh2d.

CHLNDDEV avatar CHLNDDEV commented on June 28, 2024

#264

from oceanmesh2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.