Comments (14)
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.
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.
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.
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.
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:
- Build a sizing function
- Draw a line along your channel and increase point spacing to
h0
using the functionmy_interpm
- 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.
- Pass these points and edges to
mshgen
from oceanmesh2d.
I could make a simple function to do the above but maybe you could first take a stab at it.
from oceanmesh2d.
@huyquangt can you post your code so I can see what's going on to create these images?
from oceanmesh2d.
hello @krober10nd, I used the example Example_6b_GBAY_w_floodplain.m to make these images.
from oceanmesh2d.
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.
do you have time to do it soon? then I can have a try
Thanks mate
from oceanmesh2d.
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.
I ran the Example_6b_GBAY_w_floodplain.m
to completion and I only see the shoreline and islands being constrained (blue edges).
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.
from oceanmesh2d.
from oceanmesh2d.
Related Issues (20)
- Infinite loop when cleanup the mesh HOT 6
- Issue with using dynamic water level correction HOT 11
- Need for rapid changes in grid resolution HOT 4
- Issues with refining mesh in channels HOT 2
- Problem making fort.15 file for ADCIRC model in OceanMesh2D HOT 2
- Problem creating fort.13 file for ADCIRC model in OceanMesh2D HOT 3
- startup.sh HOT 2
- Issue regarding input files of ADCIRC model HOT 2
- How to specify the wind control and wind timestep parameters in Make_f15 function of OceanMesh2D? HOT 1
- How to make the fort.22 file for ADCIRC model? HOT 2
- Re-meshing patches function
- How to make a fort.15 file for NWS = 30 Blended GAHM & Background Gridded Wind and Pressure?
- Number of nodes and element change HOT 2
- Mesh dense changes significantly HOT 3
- A technique to improve quality of elements on the boundary HOT 2
- improve the elements quality HOT 2
- Plotting bathymetry for Example_8_AK HOT 8
- Unrecognized function or variable 'annmex'. HOT 2
- How to set up parameters of hybrid bottom friction in OM HOT 3
- Spatially offset fine resolution HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oceanmesh2d.