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

Updating GLVis mesh vector or scalar solution without drawing a new mesh #272

Open
altineller opened this issue Feb 8, 2024 · 4 comments

Comments

@altineller
Copy link

Hello,

I am about to make a plugin for glVis that listens on a different socket, and updates the mesh node positions.

My purpose is to get an animation of displacements.

I have read the code for the b button press, which is at vsvector3d.cpp and

`
void VisualizationSceneVector3d::NPressed()
{
if (drawdisp)
{
PrepareDisplacedMesh();
}
else
{
Prepare();
PrepareLines();
}

SendExposeEvent();
}
`

I am intending to make a connector, that triggers a method like NPressed above, so I can edit displace mesh, or update solution.

But before I do this, has there been any work done in similar direction?

Any ideas / reccomendations / help greatly appreciated.

Best Regards,
C.

@tzanio
Copy link
Member

tzanio commented Feb 8, 2024

How is this different than what happens e.g. in ex10 by pushing updated fields to the same socket?

@altineller
Copy link
Author

Hello,

In ex10.cpp, line 381: void visualize(ostream &os, Mesh *mesh, GridFunction *deformed_nodes, GridFunction *field, const char *field_name, bool init_vis) ..

GridFunction *nodes = deformed_nodes;
int owns_nodes = 0;
mesh->SwapNodes(nodes, owns_nodes);
os << "solution\n" << *mesh << *field;
mesh->SwapNodes(nodes, owns_nodes);

Where the nodes of the mesh are temporarily swapped, and sent to glVis trough socket. but mesh is being resent again.

I am interesting modifying mesh inside glVis programmatically, and also pass binary data, instead of ascii, to get at least 10hz update rate, for a mesh with around 65K nodes. So I would like to pass as little as possible data.

Is there any reason for the underlying visualized mesh in glVis memory to be unmodifiable?

Best Regards,
Can

@tzanio
Copy link
Member

tzanio commented Feb 12, 2024

Interesting 👍

Currently when the solution is updated the mesh is also sent as if it is done for the first time. See the logic in https://github.com/GLVis/glvis/blob/master/lib/threads.cpp#L760

This and https://github.com/GLVis/glvis/blob/master/lib/threads.cpp#L425 could probably be changed, e.g. by adding a new keyword, to just send the grid function and reuse the current mesh.

Tzanio

@joetristano
Copy link

Would love to have this feature!!!! Was just wondering about the same thing. Redundant data tranfer can be easily eliminated...

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

3 participants