Skip to content

Commit

Permalink
Use the correct preCICE header, and use mesh dimensions instead og ha…
Browse files Browse the repository at this point in the history
…rd coding 3
  • Loading branch information
IshaanDesai committed Feb 6, 2024
1 parent 21646fd commit b71072b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions +precice/@Participant/private/preciceGateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <iostream>
#include <sstream>
#include <string_view>
#include "precice/Participant.hpp"
#include "precice/precice.hpp"

using namespace matlab::data;
using matlab::mex::ArgumentList;
Expand Down Expand Up @@ -336,7 +336,8 @@ class MexFunction: public matlab::mex::Function {
const std::string meshName = convertToString(inputs[1]);
const TypedArray<int32_t> size = inputs[2];
std::vector <int32_t> ids(size[0]);
std::vector <double> positions(size[0]*3);
size_t dim = interface->getMeshDimensions(meshName);
std::vector <double> positions(size[0]*dim);
interface->getMeshVertexIDsAndCoordinates(meshName,ids,positions);
outputs[0] = factory.createArray<int32_t>({size[0]}, ids.data(), ids.data()+ids.size());
outputs[1] = factory.createArray<double>({size[0], 3}, positions.data(), positions.data()+positions.size());
Expand Down

0 comments on commit b71072b

Please sign in to comment.