Skip to content

Commit 890e6e7

Browse files
committed
Add support for resetMesh API
1 parent d3a8d4b commit 890e6e7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ mod ffi {
3131
// Mesh Access
3232

3333
fn requires_mesh_connectivity_for(self: &Participant, mesh_name: &str) -> Result<bool>;
34+
fn reset_mesh(self: Pin<&mut Participant>, mesh_name: &str) -> Result<()>;
3435
fn set_mesh_vertex(
3536
self: Pin<&mut Participant>,
3637
mesh_name: &str,
@@ -208,6 +209,9 @@ impl Participant {
208209
pub fn requires_mesh_connectivity_for(&self, mesh_name: &str) -> Result<bool, Error> {
209210
self.internal.requires_mesh_connectivity_for(mesh_name)
210211
}
212+
pub fn reset_mesh(&mut self, mesh_name: &str) -> Result<(), Error> {
213+
self.internal.pin_mut().reset_mesh(mesh_name)
214+
}
211215
pub fn set_mesh_vertex(
212216
&mut self,
213217
mesh_name: &str,

src/precice-bridge.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ bool Participant::requires_mesh_connectivity_for(::rust::Str mesh_name) const
6969
{
7070
return participant->requiresMeshConnectivityFor(mesh_name);
7171
}
72+
void Participant::reset_mesh(::rust::Str mesh_name)
73+
{
74+
return participant->resetMesh(mesh_name);
75+
}
7276
vid Participant::set_mesh_vertex(::rust::Str mesh_name, ::rust::Slice<const double> position)
7377
{
7478
return participant->setMeshVertex(mesh_name, position);

src/precice-bridge.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Participant {
4040
// Mesh Access
4141

4242
bool requires_mesh_connectivity_for(::rust::Str mesh_name) const;
43+
void reset_mesh(::rust::Str mesh_name);
4344
int set_mesh_vertex(::rust::Str mesh_name, ::rust::Slice<const double> position);
4445
int get_mesh_vertex_size(::rust::Str mesh_name) const;
4546
void set_mesh_vertices(::rust::Str mesh_name, ::rust::Slice<const double> positions, ::rust::Slice<vid> ids);

0 commit comments

Comments
 (0)