Giter Club home page Giter Club logo

Comments (10)

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024 1

And another version: (add some post-process using Google Earth Studio and Adobe After Effect)

https://www.youtube.com/watch?v=muk0FL4E-Aw&t=15s

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

This is just a demo version, I will keep working to make it better.

And, Animation64nc Animation6364nc, Animation6374nc is on the road.

When I complete them, I am happy to push them to OceanMesh2D.

If you have some ideas or great suggestions, please let me know.

from oceanmesh2d.

krober10nd avatar krober10nd commented on August 17, 2024

Hi @Jiangchao3 this looks great! Thanks! we'd love to incorporate this and the additional functionality to the main branch.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

Hi @krober10nd, it is my great pleasure to contribute the OM community.

I am making the animation to show water level and wind stress simultaneously,

use m_quiver to plot the wind in u and v direction.
m_quiver(x,y,current_windx,current_windy,1.5,'color','k','linewidth',0.1);

one problem is that the wind stress values are corresponding to mesh nodes, that will show a very dense vector when it is in nearshore area because there is more high resolution node.

plot6374_

plot6374

Do you have some suggestions about how to deal with the wind stress values, for example using a resample or other method to generate a uniform wind field, let the visualization looks better?

Thanks

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

I have one idea to solve the above wind issues, let me have a try

from oceanmesh2d.

krober10nd avatar krober10nd commented on August 17, 2024

It could be useful to interpolate the data to a structured grid for the quivers. The unstructured grid's variable resolution can make it challenging to see the quivers at times.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

agree with you

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

Update: add wind vector into the water level animation:

video.mp4

function [x_grid_reshape,y_grid_reshape,wind_intp_reshape] = interpolant_nc74(x,y,wind,n_grid)
% function to interpete the original unstrural wind into structural grid
% Author: Jiangchao Qiu, (MIT/ESSG; email:[email protected])
% Created: May 14 2023
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[x_grid,y_grid] = meshgrid(linspace(min(x),max(x),n_grid),linspace(min(y),max(y),n_grid));
wind_interp = griddata(x,y,wind,x_grid,y_grid);
x_grid_reshape = reshape(x_grid,[],1);
y_grid_reshape = reshape(y_grid,[],1);
wind_intp_reshape = reshape(wind_interp,[],1);
end

but there is some edge error exist after doing the interpolation, should drop them

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

Drop the wind interpolation out of the mesh domain:

time_2

function [x_grid_indom,y_grid_indom,wind_grid_indom] = interpolant_nc74(x,y,wind,n_grid)
% function to interpete the original unstrural wind into structural grid
%
% Author: Jiangchao Qiu, (MIT/ESSG; email:[email protected])
% Created: May 14 2023
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[x_grid,y_grid] = meshgrid(linspace(min(x),max(x),n_grid),linspace(min(y),max(y),n_grid));
wind_interp = griddata(x,y,wind,x_grid,y_grid);
x_grid_reshape = reshape(x_grid,[],1);
y_grid_reshape = reshape(y_grid,[],1);
wind_intp_reshape = reshape(wind_interp,[],1);
%% drop values that are not in the mesh area
% ref: https://www.mathworks.com/help/matlab/ref/inpolygon.html
% ref: https://www.mathworks.com/help/matlab/ref/boundary.html
k = boundary(x,y);
x_boundary = x(k);
y_boundary = y(k);
in = inpolygon(x_grid_reshape,y_grid_reshape,x_boundary,y_boundary);
x_grid_indom = x_grid_reshape(in);
y_grid_indom = y_grid_reshape(in);
wind_grid_indom = wind_intp_reshape(in);
end

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on August 17, 2024

Create a PR here: 5f27b31, please review.

the final version used this function is as following:

video.mp4

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.