Skip to main content

DPF Cpp Client Library 2026 R1

Class ansys::dpf::MeshedRegion

Last update: 25.03.2026

Holds the mesh for a given region (body, faces, skin, ...).

The meshed region is an entity describing a mesh. Node and element scopings, element types, connectivity (list of node indices composing each element) and node coordinates are the fundamental entities composing the meshed region. It can also have materials, named selections...

Inherits from:

Members

Friends

Public functions

Function MeshedRegion

ansys::dpf::MeshedRegion::MeshedRegion()

Return type:

Function MeshedRegion

ansys::dpf::MeshedRegion::MeshedRegion(Client const *const client)

Create a new meshed region on a server.

Parameters:

  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function MeshedRegion

ansys::dpf::MeshedRegion::MeshedRegion(int id, Client const *const client)

Retrieve an existing instance of MeshedRegion on a server.

Parameters:

  • int id: [in] Id of the MeshedRegion object on the server's database.
  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function ~MeshedRegion

virtual ansys::dpf::MeshedRegion::~MeshedRegion()

Return type:

Function MeshedRegion

ansys::dpf::MeshedRegion::MeshedRegion(MeshedRegion const &)

Parameters:

  • MeshedRegion const &

Return type:

Function MeshedRegion

ansys::dpf::MeshedRegion::MeshedRegion(MeshedRegion &&) noexcept

Parameters:

  • MeshedRegion &&

Return type:

Function operator=

MeshedRegion & ansys::dpf::MeshedRegion::operator=(MeshedRegion const &)

Parameters:

  • MeshedRegion const &

Return type: MeshedRegion &

Function operator=

MeshedRegion & ansys::dpf::MeshedRegion::operator=(MeshedRegion &&) noexcept

Parameters:

  • MeshedRegion &&

Return type: MeshedRegion &

Function numberOfNodes

dp_int ansys::dpf::MeshedRegion::numberOfNodes() const

Returns:

Number of nodes in mesh.

Return type: dp_int

Function numberOfElements

dp_int ansys::dpf::MeshedRegion::numberOfElements() const

Returns:

Number of elements in mesh.

Return type: dp_int

Function numberOfFaces

dp_int ansys::dpf::MeshedRegion::numberOfFaces() const

Returns:

Number of faces in mesh.

Return type: dp_int

Function lengthUnit

Unit ansys::dpf::MeshedRegion::lengthUnit() const

Returns:

Length unit for mesh.

Return type: Unit

Function nodesCoordinates

Field ansys::dpf::MeshedRegion::nodesCoordinates() const

Returns:

Field containing mesh node coordinates.

Return type: Field

Function propField

PropertyField ansys::dpf::MeshedRegion::propField(PropertyType const &prop) const

Returns:

Property field given by property type.

Parameters:

  • PropertyType const & prop: [in] Property type of which to get property field.

Return type: PropertyField

Function hasPropField

bool ansys::dpf::MeshedRegion::hasPropField(PropertyType const &prop) const

Returns:

Indication that property type exists.

Parameters:

  • PropertyType const & prop: [in] Property type of which to check existence.

Return type: bool

Function availablePropertyFields

std::vector< std::string > ansys::dpf::MeshedRegion::availablePropertyFields() const

Returns:

Vector of property fields withing mesh. See property_types for examples of available types.

Return type: std::vector< std::string >

Function elementTypes

PropertyField ansys::dpf::MeshedRegion::elementTypes() const

Returns:

Property field describing element types within mesh.

Return type: PropertyField

Function connectivity

PropertyField ansys::dpf::MeshedRegion::connectivity() const

Returns:

Property field describing element connectivity for mesh.

Return type: PropertyField

Function nodeScoping

Scoping ansys::dpf::MeshedRegion::nodeScoping() const

Returns:

Scoping describing nodes of mesh.

Return type: Scoping

Function elementScoping

Scoping ansys::dpf::MeshedRegion::elementScoping() const

Returns:

Scoping describing elements of mesh.

Return type: Scoping

Function faceScoping

Scoping ansys::dpf::MeshedRegion::faceScoping() const

Returns:

Scoping describing faces of mesh.

Return type: Scoping

Function availableNamedSelections

std::vector< std::string > ansys::dpf::MeshedRegion::availableNamedSelections() const

Returns:

Vector of named selections withing mesh.

Return type: std::vector< std::string >

Function namedSelection

Scoping ansys::dpf::MeshedRegion::namedSelection(std::string const &name) const

Returns:

Scoping for given named selection.

Parameters:

  • std::string const & name: [in] Name of which to get scoping.

Return type: Scoping

Function fillCursor

void ansys::dpf::MeshedRegion::fillCursor(dp_index element_index, ElementCursor &cursor) const

Get a cursor for given element.

Parameters:

  • dp_index element_index: [in] Index of element within mesh for which to get cursor.
  • ElementCursor & cursor: [out] Cursor for given element.

Return type: void

Function prepareConstruction

void ansys::dpf::MeshedRegion::prepareConstruction(dp_int n_nodes, dp_int n_elements)

Allocate and reserve space for given number of nodes and elements. node scoping and coordinates vectors are reserved for n_nodes, elements scoping, connectivity and elements type property field are reserved for n_elements. this method should always be called before adding any node or element.

Parameters:

  • dp_int n_nodes: [in] Expected number of nodes within mesh.
  • dp_int n_elements: [in] Expected number of elements within mesh.

Return type: void

Function addNode

void ansys::dpf::MeshedRegion::addNode(dp_id node_id, std::array< dp_double, 3 > const &data)

Add node to mesh.

Parameters:

  • dp_id node_id: [in] Id of node.
  • std::array< dp_double, 3 > const & data: [in] XYZ coordinates of node.

Return type: void

Function addNode

void ansys::dpf::MeshedRegion::addNode(dp_id node_id, dp_double *const data)

Add node to mesh.

Parameters:

  • dp_id node_id: [in] Id of node.
  • dp_double *const data: [in] XYZ coordinates of node.

Return type: void

Function addElement

void ansys::dpf::MeshedRegion::addElement(ElementDescriptor const &descriptor, dp_id elem_id, std::vector< dp_index > const &node_indices)

Add element to mesh. Not available in remote, use the implementation with the element shape instead.

Parameters:

  • ElementDescriptor const & descriptor: [in] Description of element.
  • dp_id elem_id: [in] Id of element.
  • std::vector< dp_index > const & node_indices: [in] Vector of node ids of element.

Return type: void

Function addElement

void ansys::dpf::MeshedRegion::addElement(ansys::dpf::elements::EShape shape, dp_id elem_id, std::vector< dp_index > const &node_indices)

Add element to mesh.

Parameters:

  • ansys::dpf::elements::EShape shape: [in] Shape of the element.
  • dp_id elem_id: [in] Id of element.
  • std::vector< dp_index > const & node_indices: [in] Vector of node ids of element.

Return type: void

Function setLengthUnit

void ansys::dpf::MeshedRegion::setLengthUnit(Unit const &unit)

Set length unit for mesh.

Parameters:

  • Unit const & unit: [in] Length unit for mesh.

Return type: void

Function setNamedSelectionScoping

void ansys::dpf::MeshedRegion::setNamedSelectionScoping(std::string const &name, Scoping scoping)

Set a named selection scoping for mesh.

Parameters:

  • std::string const & name: [in] Named selection name.
  • Scoping scoping: [in] Scoping to set.

Return type: void

Function setPropertyField

void ansys::dpf::MeshedRegion::setPropertyField(std::string const &name, PropertyField property_field)

Set an elemental property field for mesh. Its elemental scoping must be equal to the one that has already been set into the mesh, if it exists.

Parameters:

  • std::string const & name: [in] Property name:

See also: common_property_names.

  • PropertyField property_field: [in] Property field to set.

Return type: void

Function setConnectivity

void ansys::dpf::MeshedRegion::setConnectivity(PropertyField connectivity)

Set a connectivity (nodes of the elements) property field.

Parameters:

  • PropertyField connectivity: [in] Connectivity to set.

Return type: void

Function setElementTypes

void ansys::dpf::MeshedRegion::setElementTypes(PropertyField element_types)

Set element types property field.

Parameters:

  • PropertyField element_types: [in] Element types data to set..

Return type: void

Function setNodesCoordinates

void ansys::dpf::MeshedRegion::setNodesCoordinates(Field coordinates)

Set a field for mesh.

Parameters:

  • Field coordinates: [in] Field to set.

Return type: void

Function hasBeam

bool ansys::dpf::MeshedRegion::hasBeam() const

Returns:

Indication if mesh contains beam elements.

Return type: bool

Function hasOnlyBeam

bool ansys::dpf::MeshedRegion::hasOnlyBeam() const

Returns:

Indication if mesh only contains beam elements.

Return type: bool

Function hasShell

bool ansys::dpf::MeshedRegion::hasShell() const

Returns:

Indication if mesh contains shell elements.

Return type: bool

Function hasOnlyShell

bool ansys::dpf::MeshedRegion::hasOnlyShell() const

Returns:

Indication if mesh only contains shell elements.

Return type: bool

Function hasPoint

bool ansys::dpf::MeshedRegion::hasPoint() const

Returns:

Indication if mesh contains point elements.

Return type: bool

Function hasOnlyPoint

bool ansys::dpf::MeshedRegion::hasOnlyPoint() const

Returns:

Indication if mesh only contains point elements.

Return type: bool

Function hasSolid

bool ansys::dpf::MeshedRegion::hasSolid() const

Returns:

Indication if mesh contains solid elements.

Return type: bool

Function hasOnlySolid

bool ansys::dpf::MeshedRegion::hasOnlySolid() const

Returns:

Indication if mesh only contains solid elements.

Return type: bool

Function hasSkin

bool ansys::dpf::MeshedRegion::hasSkin() const

Returns:

Indication if mesh contains skin elements.

Return type: bool

Function hasOnlySkin

bool ansys::dpf::MeshedRegion::hasOnlySkin() const

Returns:

Indication if mesh only contains skin elements.

Return type: bool

Function hasPolygons

bool ansys::dpf::MeshedRegion::hasPolygons() const

Returns:

Indication if mesh contains Polygonal elements.

Return type: bool

Function hasPolyhedrons

bool ansys::dpf::MeshedRegion::hasPolyhedrons() const

Returns:

Indication if mesh contains Polyhedral elements.

Return type: bool

Function elementDescriptorByElementId

ansys::dpf::ElementDescriptor ansys::dpf::MeshedRegion::elementDescriptorByElementId(dp_id element_id) const

Get ElementDescriptor (type related information) from element id. .

Parameters:

Return type: ansys::dpf::ElementDescriptor

Function elementShape

ansys::dpf::elements::EShape ansys::dpf::MeshedRegion::elementShape(dp_id element_id) const

Get element shape.

Parameters:

Return type: ansys::dpf::elements::EShape

Function numNodesOfElement

int ansys::dpf::MeshedRegion::numNodesOfElement(dp_index element_index) const

Get number of nodes for element at given index.

Parameters:

Return type: int

Function name

std::string ansys::dpf::MeshedRegion::name() const

Returns:

Name of the mesh.

Return type: std::string

Function setName

void ansys::dpf::MeshedRegion::setName(std::string const &rhs)

Set mesh name.

Parameters:

  • std::string const & rhs

Return type: void

Function deep_copy

MeshedRegion ansys::dpf::MeshedRegion::deep_copy(ansys::dpf::Client const *const client=nullptr) const

Create a new MeshedRegion on a server by copying all the data of this MeshedRegion.

Parameters:

Return type: MeshedRegion

Public static functions

Function emptyMeshedRegion

static MeshedRegion ansys::dpf::MeshedRegion::emptyMeshedRegion()

Return type: MeshedRegion

Connect with Ansys