Skip to content

node_set_coordinates sets 3rd point incorrectly for 2D meshes #19

@raovgarimella

Description

@raovgarimella

One possible signature of node_set_coordinates is

void node_set_coordinates(const Entity_ID nodeid, const double *ncoord) = 0;

but it picks up the garbage from ncoord+2 and sticks it into the MSTK data structures even if we are working with 2D meshes.

The solution is to copy the right number of coordinate values from ncoord within Mesh_MSTK::node_set_coordinates and set the rest to zero before passing it off to MSTK.

void Mesh_MSTK::node_set_coordinates(const Jali::Entity_ID nodeid,
                                     const double *coords) {
  MVertex_ptr v = vtx_id_to_handle[nodeid];

  double coordarray[3] = {0.0, 0.0, 0.0};
  for (int i = 0; i < Mesh::space_dimension(); i++)
    coordarray[i] = coords[i];

  MV_Set_Coords(v, (double *) coordarray);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions