Skip to main content

getCoordinates

const std::vector<double>& getCoordinates() const;

Availability: Component, SubComponent, ComponentExtension

Returns the X, Y, Z coordinates of the component. For a SubComponent or ComponentExtension, these are the coordinates of the parent Component. These are typically used for visualization. Coordinates should be specified in the SST configuration input file if needed, otherwise they will default to (0.0, 0.0, 0.0). SST does not assign coordinates.

Parameters

  • returns (std::vector<double>) A vector containing the X, Y, and Z coordinates of the component.

Example

#include <sst/core/component.h>

// Example event handler in a component
void example::handleEvent(SST::Event* ev) {
std::vector<double> location = getCoordinates();
out->output("This component is located at X=%d, Y=%d, Z=%d\n", location[0], location[1], location[2]);
}
#include <sst/core/component.h> // or
#include <sst/core/subcomponent.h> // or
#include <sst/core/componentExtension.h>