Skip to content

Issue369 nodal weights#465

Merged
einola merged 14 commits intodevelopfrom
issue369_nodal_weights
Aug 13, 2020
Merged

Issue369 nodal weights#465
einola merged 14 commits intodevelopfrom
issue369_nodal_weights

Conversation

@einola
Copy link
Copy Markdown
Member

@einola einola commented Aug 12, 2020

Address issue #369 by splitting interpFromMeshToMesh into weight calculation (done at remeshing) and application (done every time step). This is only used for the coupler at the moment, although we could probably save some time by using it also for high time resolution forcing datasets (like ERA5).

…the grid and then interpolate to the nodes using this. For this commit I split the interpolation into a weight calculation (InterpFromMeshToMesh2dx_weights) and their application (InterpFromMeshToMesh2dx_apply). The weight calculation can be done only when remeshing, saving hopefully substantial processing time.
…ecalculation within the ExternalData check_and_reload function by setting a flag (calc_nodal_weights = true) in the DataSet object. Plus a good number of fixes
… me understand what was happening in the first place.
@einola einola requested a review from tdcwilliams August 12, 2020 13:06
Copy link
Copy Markdown
Contributor

@tdcwilliams tdcwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good. Some minor changes you could put in.

Comment thread contrib/bamg/include/InterpFromMeshToMesh2dx_apply.hpp Outdated
Comment thread contrib/bamg/include/InterpFromMeshToMesh2dx_weights.hpp Outdated
Comment thread contrib/bamg/include/InterpFromMeshToMesh2dx_weights.hpp
Comment thread contrib/bamg/include/InterpFromMeshToMesh2dx_apply.hpp
Comment thread contrib/bamg/src/InterpFromMeshToMesh2dx_apply.cpp Outdated
Comment thread contrib/bamg/src/InterpFromMeshToMesh2dx_apply.cpp Outdated
Comment thread contrib/bamg/src/InterpFromMeshToMesh2dx_weights.cpp
I2 I=Th->R2ToI2(r);

/*Find triangle holding r/I*/
Triangle &tb=*Th->TriangleFindFromCoord(I,dete);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there ever any problem with this? I have had trouble with points that are already on the nodes of the mesh in the past

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen that problem. Can you reproduce it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's the same result as from InterpFromMeshToMesh anyway - I just split the function so that we don't have to calculate the weight every timestep.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about it then. I haven't tried to do it in a while - had trouble interp'ing from elements to nodes in the WIM

@einola einola merged commit 996970f into develop Aug 13, 2020
@einola einola deleted the issue369_nodal_weights branch August 13, 2020 10:17
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

Successfully merging this pull request may close these issues.

2 participants