    

 ## On this page

  

 

 # DataApis

 Last update: 16.07.2025 

Examples showing how to use the DPF base class APIs.

//

// COPYRIGHT ANSYS. ALL RIGHTS RESERVED.

//

\#include "dpf\_api.h"

\#include "helpers/dpf\_result.h"

\#include "helpers/dpf\_model.h"

\#include &lt;limits&gt;

\#pragma warning (disable : 4189) //local variable is initialized but not referenced

\#ifdef EXAMPLE

\#include "Example.h"

\#else

\#include &lt;gtest/gtest.h&gt;

\#endif

 

TEST(Scoping, Create_GetData)

{

 // The Scoping is a set of entity IDs defined on a location (the location is optional).

 

 // Create

 <a id="_a0" name="_a0"></a>[ansys::dpf::Scoping](classansys_1_1dpf_1_1Scoping.xhtml) my_scoping;

 my_scoping.<a id="a1" name="a1"></a>[setLocation](classansys_1_1dpf_1_1Scoping.xhtml#abfc7b7b2376db292a67d05e9b7828367)(<a id="a2" name="a2"></a>[ansys::dpf::locations::nodal](structansys_1_1dpf_1_1locations.xhtml#aa4e1967b0838d8597200c606c8564d29));

 

 // 1/ entity by entity

 my_scoping.<a id="a3" name="a3"></a>[emplace](classansys_1_1dpf_1_1Scoping.xhtml#a94f0dd35d07efdc472ef072b42f9cfda)(0, 1);

 my_scoping.[emplace](classansys_1_1dpf_1_1Scoping.xhtml#a94f0dd35d07efdc472ef072b42f9cfda)(1, 2);

 my_scoping.[emplace](classansys_1_1dpf_1_1Scoping.xhtml#a94f0dd35d07efdc472ef072b42f9cfda)(2, 3);

 // 2/ or the entire vector of ids

 std::vector&lt;int&gt; my_ids = { 1,2,3 };

 my_scoping.<a id="a4" name="a4"></a>[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)(my_ids);

 // or

 my_scoping.[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)(my_ids.data(), (int)my_ids.size());

 

 // Get Data

 

 <a id="_a5" name="_a5"></a>[ansys::dpf::Location](structansys_1_1dpf_1_1Location.xhtml) my_loc = my_scoping.<a id="a6" name="a6"></a>[location](classansys_1_1dpf_1_1Scoping.xhtml#a516b4489a94ff02ecc880f170b8f93a9)();

 std::vector&lt;int&gt; my_ids_out;

 my_scoping.<a id="a7" name="a7"></a>[getIds](classansys_1_1dpf_1_1Scoping.xhtml#a7377823a48ee69e439a8589627c5e6c0)(my_ids_out);

 

 int size = 0;

 const int* ids = my_scoping.<a id="a8" name="a8"></a>[ids](classansys_1_1dpf_1_1Scoping.xhtml#acf26749e29d9f23de6c70806ccfaea6b)(size);

 

 // or entity by entity

 int id = my_scoping.<a id="a9" name="a9"></a>[idByIndex](classansys_1_1dpf_1_1Scoping.xhtml#ae35e47f2cceccf7ad9ed4590bd10ff89)(0);

 int index = my_scoping.<a id="a10" name="a10"></a>[indexById](classansys_1_1dpf_1_1Scoping.xhtml#ab80b20d56d63ce48c08ce6b7428e06c2)(1);

}

 

TEST(DataSources, Create)

{

 // Data Sources is the entity containing the different path to the result files of an analysis. 

 // An extension key ('rst' for example) is used to choose which files represent results files, 

 // the other ones being accessory files. 

 // Create

 <a id="_a11" name="_a11"></a>[ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.<a id="a12" name="a12"></a>[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)("c:/temp/file.rst");

 my_data_sources.<a id="a13" name="a13"></a>[addFile](classansys_1_1dpf_1_1DataSources.xhtml#ad8d20dc94dee694a62fce66e91691090)("c:/temp/ds.dat");

}

 

TEST(Field, Create)

{

 // The minimum requirement for a well defined Field is for it to have a dimensionality (scalar, 

 // 3 components vector, 6 components symmetrical matrix. and so on), a location("Nodal", "Elemental", "ElementalNodal", 

 // "Timefrq), a data vector, and a scoping with IDs. You can also set the number of shell layers.

 // If the field has one elementary data by entity (elementary data size = number of components for "Nodal" 

 // or "Elemental" field for example), then the data vector can be set directly. If a more complex field is 

 // required ("ElementalNodal" Field for example), the data can be set entity by entity.

 

 // Create

 int num_entities = 2;

 

 // for the most common dimensionalities

 <a id="_a14" name="_a14"></a>[ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) my_field(num_entities, { 1 }, [ansys::dpf::locations::nodal](structansys_1_1dpf_1_1locations.xhtml#aa4e1967b0838d8597200c606c8564d29)); //nodal scalar

 my_field = [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml)(num_entities, { 3 }, <a id="a15" name="a15"></a>[ansys::dpf::locations::elemental\_nodal](structansys_1_1dpf_1_1locations.xhtml#a0bda534055805adc4c08bece34989ff3)); //elemental nodal vector

 my_field = [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml)(num_entities, { 3,3 }, <a id="a16" name="a16"></a>[ansys::dpf::locations::elemental](structansys_1_1dpf_1_1locations.xhtml#a3f66169a86ab935fb398b3fdde98bb04)); //elemental sym matrix

 

 // 1/ fill the entire Scoping and data

 std::vector&lt;double&gt; my_data = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 2.3, 1.0, 1.0, 0.0, 0.0, 1.0 };

 my_field.<a id="a17" name="a17"></a>[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)().[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)({ 5,22 });

 my_field.<a id="a18" name="a18"></a>[setData](classansys_1_1dpf_1_1Field.xhtml#a9f7828d92496843cc5f15ee9e32f6c4a)(my_data);

 

 // 2/ or fill entity by entity

 my_field = [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml)(num_entities, { 3,3 }, [ansys::dpf::locations::elemental](structansys_1_1dpf_1_1locations.xhtml#a3f66169a86ab935fb398b3fdde98bb04)); //elemental sym matrix

 // sym matrix are defined by 6 components in the order XX, YY, ZZ, XY, YZ, XZ

 std::vector&lt;double&gt; my_elem_data = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };

 my_field.<a id="a19" name="a19"></a>[push\_back](classansys_1_1dpf_1_1Field.xhtml#a5b717ed309ddf287134905f71ada833b)(5, my_elem_data);

 

 std::vector&lt;double&gt; my_elem_data2 = { 2.3, 1.0, 1.0, 0.0, 0.0, 1.0 };

 my_field.[push\_back](classansys_1_1dpf_1_1Field.xhtml#a5b717ed309ddf287134905f71ada833b)(22, my_elem_data2);

 

 //optional, set the field's unit

 <a id="_a20" name="_a20"></a>[ansys::dpf::FieldDefinition](classansys_1_1dpf_1_1FieldDefinition.xhtml) field_def = my_field.<a id="a21" name="a21"></a>[fieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a860e65caa16f612746ad116429282fd3)();

 field_def.<a id="a22" name="a22"></a>[setUnit](classansys_1_1dpf_1_1FieldDefinition.xhtml#a8033b1d4486ea3d819ecbb6418bab079)(<a id="_a23" name="_a23"></a>[ansys::dpf::Unit](classansys_1_1dpf_1_1Unit.xhtml)("m"));

 my_field.<a id="a24" name="a24"></a>[setFieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a471c3f541458acc9c05dfb019a99abb3)(field_def);

 

 

 // Get Data

 int ncomp = my_field.<a id="a25" name="a25"></a>[numberOfComponents](classansys_1_1dpf_1_1Field.xhtml#a70f7cda2d633297489b91de6761fd625)(); //returns the nuber of component of the elementary data

 [ansys::dpf::Location](structansys_1_1dpf_1_1Location.xhtml) loc = my_field.[fieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a860e65caa16f612746ad116429282fd3)().<a id="a26" name="a26"></a>[location](classansys_1_1dpf_1_1FieldDefinition.xhtml#a9ea61f23ef1eb93c794b7c222d7740b8)();

 [ansys::dpf::Unit](classansys_1_1dpf_1_1Unit.xhtml) unit = my_field.[fieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a860e65caa16f612746ad116429282fd3)().<a id="a27" name="a27"></a>[unit](classansys_1_1dpf_1_1FieldDefinition.xhtml#aaf9c5c92a6d192207f01067950907af8)();

 [ansys::dpf::Scoping](classansys_1_1dpf_1_1Scoping.xhtml) scoping = my_field.[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)();

 

 int size = 0;

 double* data = my_field.<a id="a28" name="a28"></a>[data](classansys_1_1dpf_1_1Field.xhtml#a0967a8c6cee105a679dd1151a5d41004)(size); //returns the ptr to the full list of data

 int entity_size = 0;

 int index = 1;

 double* data_by_index = my_field.<a id="a29" name="a29"></a>[entityData](classansys_1_1dpf_1_1Field.xhtml#a1312be4b895a62a391eb66865897d27c)(index, entity_size);//returns the ptr to the list of data of the second entity

 int id = 22;

 double* data_by_id = my_field.<a id="a30" name="a30"></a>[entityDataById](classansys_1_1dpf_1_1Field.xhtml#a50ed01d59770f646c41777d496e0ff9c)(id, entity_size);//returns the ptr to the list of data of the second entity

 

 //the cursor represents a complete entity data (id, size, num elementary data)

 <a id="_a31" name="_a31"></a>[ansys::dpf::FieldCursor](classansys_1_1dpf_1_1FieldCursor.xhtml) cursor;

 my_field.<a id="a32" name="a32"></a>[fillCursor](classansys_1_1dpf_1_1Field.xhtml#a96f5eeb13fb81117d3a096e5da245eab)(1, cursor);//fills the cursor on the second entity

 id = cursor.<a id="a33" name="a33"></a>[id](classansys_1_1dpf_1_1FieldCursor.xhtml#a4a87616f5f17ac420f0499170efcf454)();

 entity_size = cursor.<a id="a34" name="a34"></a>[size](classansys_1_1dpf_1_1FieldCursor.xhtml#a088f17f2b7eec6cd4470ece35f0dc01a)();

 int num_elem_data = cursor.<a id="a35" name="a35"></a>[n\_elementary\_data](classansys_1_1dpf_1_1FieldCursor.xhtml#a546e38c5c0b76a50350946e11718a9d3)();

 data_by_index = cursor.<a id="a36" name="a36"></a>[data](classansys_1_1dpf_1_1FieldCursor.xhtml#a815f0d760f113116cb5ed55b9ec9f584)();

}

 

TEST(FieldsContainer, Create)

{

 // The Fields Container is a vector of Fields and all the Fields are ordered with labels and IDs.

 // Most commonly, the Fields Container is scoped on the "time" label and the IDs are the time or frequency sets.

 // More generically, the Fields Container allows you to split results for different criteria.

 

 // Create

 

 //Create a generic fields container from scratch.

//Using a generic fields container allows you to define your own space, splitting the fields.

//Labels define this space. For example, the labels can be "time", "eltype" to define fields over time with one field by element type.

//Each field added must be defined on that space:

 //field1 : "time" : 1, "eltype" : 8

 //field2 : "time" : 1, "eltype" : 10

 //field3 : "time" : 2, "eltype" : 8

 //field4 : "time" : 2, "eltype" : 10

 

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) field_1;

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) field_2;

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) field_3;

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) field_4;

 

 <a id="_a37" name="_a37"></a>[ansys::dpf::FieldsContainer](classansys_1_1dpf_1_1FieldsContainer.xhtml) my_fc;

 my_fc.addLabels({ <a id="a38" name="a38"></a>[ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914), <a id="_a39" name="_a39"></a>[ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)("eltype") });

 <a id="_a40" name="_a40"></a>[ansys::dpf::LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) label_space = { { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),1 },{ [ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)("eltype"),8 } };

 my_fc.<a id="a41" name="a41"></a>[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)(label_space, field_1);

 my_fc.[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),1 },{ [ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)("eltype"),10 } }, field_2);

 my_fc.[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),2 },{ [ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)("eltype"),8 } }, field_3);

 my_fc.[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),2 },{ [ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)("eltype"),10 } }, field_4);

 

 //to create a fields container for complex results, use the ansys::dpf::labels::complex label

 //with value 1 for imaginary fields and 0 for real fields:

 [ansys::dpf::FieldsContainer](classansys_1_1dpf_1_1FieldsContainer.xhtml) my_complex_fc;

 my_complex_fc.addLabels({ [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914), <a id="a42" name="a42"></a>[ansys::dpf::labels::complex](structansys_1_1dpf_1_1labels.xhtml#ac63ee601c3a70f700d4a8efb091a565f) });

 

 //real part for time set 1

 my_complex_fc.[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),1 },{ [ansys::dpf::labels::complex](structansys_1_1dpf_1_1labels.xhtml#ac63ee601c3a70f700d4a8efb091a565f), 0 } }, field_1);

 //imaginary part for time set 1

 my_complex_fc.[add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),1 },{ [ansys::dpf::labels::complex](structansys_1_1dpf_1_1labels.xhtml#ac63ee601c3a70f700d4a8efb091a565f), 1 } }, field_2);

}

 

TEST(FieldsContainer, GetDataFromDataSources)

{

 // set the result file path to the right path

 std::string fileName("../../../testfiles/mapdl\_files/TwoSolids.rst");

 [ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)(fileName);

 

 // Get Data

 <a id="_a43" name="_a43"></a>[ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml) u_op("U");

 u_op.connect(<a id="a44" name="a44"></a>[ansys::dpf::eDataSourcesPin](namespaceansys_1_1dpf.xhtml#aa4a44a04a0aafb8fe0645f019bbd94d1a5b6613f802062fde4faea4b553db7fbc), my_data_sources);

 auto my_fields_container = u_op.getOutputFieldsContainer(0);

 

 int num_fields = my_fields_container.size();

 

 int index = 0;

 //returns the labels and ids corresponding to the first Field

 [ansys::dpf::LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml) label_space = my_fields_container.getLabelSpace(index); //ie. {'time',1} for the first time set

 

 //return the real Fields on{ 'time',1 }

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) my_field = my_fields_container.getFields({ { [ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914),1 } })[0];

 my_field = my_fields_container.getFieldsForTimeId(1)[0];

 

 my_field = my_fields_container[0]; //returns the first field

}

 

TEST(MeshedRegion, Create)

{

 // Users can create their own data to be manipulated with DPF.

 // The Meshed Region can be created simply with the following code.

 

 // Create

 

 //create a new mesh with 1 quad, 1 beam, 1 point element and 1 tetra

 <a id="_a45" name="_a45"></a>[ansys::dpf::MeshedRegion](classansys_1_1dpf_1_1MeshedRegion.xhtml) mesh;

 mesh.<a id="a46" name="a46"></a>[prepareConstruction](classansys_1_1dpf_1_1MeshedRegion.xhtml#aa7b984923ddd90379f08bc5b9831a95e)(11, 4); //reserve the size of the mesh

 mesh.<a id="a47" name="a47"></a>[nodeScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#ad5df08993b7c588d9565ef1c1ea4813d)().<a id="a48" name="a48"></a>[size](classansys_1_1dpf_1_1Scoping.xhtml#aeae5e27bd752bdf0da3cc2d64fbe118a)();

 //return:

 //0

 

 mesh.<a id="a49" name="a49"></a>[elementScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#a3056a0fc6d69ca8769e33de6be0cecf0)().[size](classansys_1_1dpf_1_1Scoping.xhtml#aeae5e27bd752bdf0da3cc2d64fbe118a)();

 //return:

 //0

 

 //quad element with 4 nodes

 mesh.<a id="a50" name="a50"></a>[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(1, { 0.0, 0.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(2, { 1.0, 0.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(3, { 1.0, 1.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(4, { 0.0, 1.0, 0.0 });

 mesh.<a id="a51" name="a51"></a>[addElement](classansys_1_1dpf_1_1MeshedRegion.xhtml#a11b6e06dfea398609fa9fb25ad4333bb)(<a id="a52" name="a52"></a>[ansys::dpf::elements::quad4](structansys_1_1dpf_1_1elements.xhtml#a4781a62a05dd26d8f1f19cd7c4b6e524), 1, { 0, 1, 2, 3 }); // connectivity is by node indexes

 

 //point element

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(5, { 0.0, 0.0, 0.0 });

 mesh.[addElement](classansys_1_1dpf_1_1MeshedRegion.xhtml#a11b6e06dfea398609fa9fb25ad4333bb)(<a id="a53" name="a53"></a>[ansys::dpf::elements::point1](structansys_1_1dpf_1_1elements.xhtml#a42c776bd25670e7ca0c2cc9fc91e2829), 2, { 4 });

 

 //beam element

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(6, { 0.0, 0.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(7, { 1.0, 0.0, 0.0 });

 mesh.[addElement](classansys_1_1dpf_1_1MeshedRegion.xhtml#a11b6e06dfea398609fa9fb25ad4333bb)(<a id="a54" name="a54"></a>[ansys::dpf::elements::line2](structansys_1_1dpf_1_1elements.xhtml#a52f6751afe46909ad6c83c0b0510491d), 3, { 5, 6 });

 

 //tetra element with 4 nodes

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(8, { 0.0, 0.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(9, { 1.0, 0.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(10, { 1.0, 1.0, 0.0 });

 mesh.[addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)(11, { 0.0, 1.0, 1.0 });

 mesh.[addElement](classansys_1_1dpf_1_1MeshedRegion.xhtml#a11b6e06dfea398609fa9fb25ad4333bb)(<a id="a55" name="a55"></a>[ansys::dpf::elements::tet4](structansys_1_1dpf_1_1elements.xhtml#a05d59369acd4f4ac6819645f2413ee22), 4, { 7, 8, 9, 10 });

 

 mesh.[nodeScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#ad5df08993b7c588d9565ef1c1ea4813d)().[size](classansys_1_1dpf_1_1Scoping.xhtml#aeae5e27bd752bdf0da3cc2d64fbe118a)();

 //return:

 //11

 

 mesh.[elementScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#a3056a0fc6d69ca8769e33de6be0cecf0)().[size](classansys_1_1dpf_1_1Scoping.xhtml#aeae5e27bd752bdf0da3cc2d64fbe118a)();

 //return:

 //4

 

 <a id="_a56" name="_a56"></a>[ansys::dpf::ElementCursor](classansys_1_1dpf_1_1ElementCursor.xhtml) el;

 mesh.<a id="a57" name="a57"></a>[fillCursor](classansys_1_1dpf_1_1MeshedRegion.xhtml#a012ff219aea7e92a889a77611de00b3a)(0, el);

 el.<a id="a58" name="a58"></a>[numberOfNodes](classansys_1_1dpf_1_1ElementCursor.xhtml#a54ae9b25c375c752682a7dff04603348)();

 //return:

 //4

}

 

TEST(MeshedRegion, GetDataFromDataSources)

{

 // A model is usually represented by a Meshed Region in DPF. 

 // The mesh provider operator allows to access an analysis' mesh. 

 // The user can then get different information in the mesh like the 

 // coordinates of all the nodes and the connectivity between elements and nodes.

 

 // Create DataSources

 

 // set the result file path to the right path

 std::string fileName("../../../testfiles/mapdl\_files/TwoSolids.rst");

 [ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)(fileName);

 

 // Get Data

 

 [ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml) mesh_prov("MeshProvider");

 mesh_prov.connect([ansys::dpf::eDataSourcesPin](namespaceansys_1_1dpf.xhtml#aa4a44a04a0aafb8fe0645f019bbd94d1a5b6613f802062fde4faea4b553db7fbc), my_data_sources);

 [ansys::dpf::MeshedRegion](classansys_1_1dpf_1_1MeshedRegion.xhtml) mesh = mesh_prov.getOutputMeshedRegion(0);

 

 //access elements Scoping

 [ansys::dpf::Scoping](classansys_1_1dpf_1_1Scoping.xhtml) my_elements_scoping = mesh.[elementScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#a3056a0fc6d69ca8769e33de6be0cecf0)();

 

 //access nodes Scoping

 [ansys::dpf::Scoping](classansys_1_1dpf_1_1Scoping.xhtml) my_nodes_scoping = mesh.[nodeScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#ad5df08993b7c588d9565ef1c1ea4813d)();

 

 //get connectivity(ordered node indices) of one element

 <a id="_a59" name="_a59"></a>[ansys::dpf::PropertyField](classansys_1_1dpf_1_1PropertyField.xhtml) connectivity = mesh.<a id="a60" name="a60"></a>[connectivity](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2c75723ffc634c39b081eecd31d54309)();

 <a id="_a61" name="_a61"></a>[ansys::dpf::PropFieldCursor](classansys_1_1dpf_1_1PropFieldCursor.xhtml) cursor;

 connectivity.<a id="a62" name="a62"></a>[fillCursor](classansys_1_1dpf_1_1PropertyField.xhtml#a90f3baa944b4dd1a49adbcbec5a3d766)(0, cursor); // connectivity of the first element

 connectivity.[fillCursor](classansys_1_1dpf_1_1PropertyField.xhtml#a90f3baa944b4dd1a49adbcbec5a3d766)(my_elements_scoping.[indexById](classansys_1_1dpf_1_1Scoping.xhtml#ab80b20d56d63ce48c08ce6b7428e06c2)(1), cursor); // connectivity of the element of id 1

 int* node_indices = cursor.<a id="a63" name="a63"></a>[data](classansys_1_1dpf_1_1PropFieldCursor.xhtml#afb9be4ae3088090d4caf097455fe877f)();

 int num_nodes_in_elem = cursor.<a id="a64" name="a64"></a>[size](classansys_1_1dpf_1_1PropFieldCursor.xhtml#a269c1fad1eab6210e2f0e271bd0a1b34)();

 

 //get coordinates

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) coordinates = mesh.<a id="a65" name="a65"></a>[nodesCoordinates](classansys_1_1dpf_1_1MeshedRegion.xhtml#a482ae171f257bfe86c8e567f0882caa4)();

 [ansys::dpf::FieldCursor](classansys_1_1dpf_1_1FieldCursor.xhtml) fcursor;

 coordinates.[fillCursor](classansys_1_1dpf_1_1Field.xhtml#a96f5eeb13fb81117d3a096e5da245eab)(0, fcursor); // coordinates of the first node

 coordinates.[fillCursor](classansys_1_1dpf_1_1Field.xhtml#a96f5eeb13fb81117d3a096e5da245eab)(my_nodes_scoping.[indexById](classansys_1_1dpf_1_1Scoping.xhtml#ab80b20d56d63ce48c08ce6b7428e06c2)(1), fcursor); // coordinates of the node of id 1

 double* node_coord = fcursor.[data](classansys_1_1dpf_1_1FieldCursor.xhtml#a815f0d760f113116cb5ed55b9ec9f584)();

 

 //get element types

 [ansys::dpf::PropertyField](classansys_1_1dpf_1_1PropertyField.xhtml) element_types = mesh.<a id="a66" name="a66"></a>[elementTypes](classansys_1_1dpf_1_1MeshedRegion.xhtml#a0e89e4e209380a10140c14cd91655907)();

 element_types.[fillCursor](classansys_1_1dpf_1_1PropertyField.xhtml#a90f3baa944b4dd1a49adbcbec5a3d766)(0, cursor); // element\_types of the first element

 element_types.[fillCursor](classansys_1_1dpf_1_1PropertyField.xhtml#a90f3baa944b4dd1a49adbcbec5a3d766)(my_elements_scoping.[indexById](classansys_1_1dpf_1_1Scoping.xhtml#ab80b20d56d63ce48c08ce6b7428e06c2)(1), cursor); // element\_types of the element of id 1

 int element_type = *cursor.[data](classansys_1_1dpf_1_1PropFieldCursor.xhtml#afb9be4ae3088090d4caf097455fe877f)();

 <a id="_a67" name="_a67"></a>[ansys::dpf::ElementDescriptor](structansys_1_1dpf_1_1ElementDescriptor.xhtml) element_des = <a id="a68" name="a68"></a>[ansys::dpf::elements::descriptor](structansys_1_1dpf_1_1elements.xhtml#a30e8daf92a36604a3c176d9f7b5d1f35)(element_type);

 std::string name = element_des.<a id="a69" name="a69"></a>[name](structansys_1_1dpf_1_1ElementDescriptor.xhtml#a49e5f9c938d56155ba253b08ba8b75ff);

 int num_nodes = element_des.<a id="a70" name="a70"></a>number_of_nodes;

 int num_corner_nodes = element_des.<a id="a71" name="a71"></a>number_of_corner_nodes;

 int num_sec_nodes = element_des.<a id="a72" name="a72"></a>number_of_mid_nodes;

 bool issolid = element_des.<a id="a73" name="a73"></a>[solid](structansys_1_1dpf_1_1ElementDescriptor.xhtml#a55af041295e3f9d83373e649289f1b35);

}

 

TEST(TimeFreqSupport, Create)

{

 // The time or frequency space of an analysis is described by the Time Freq Support entity in DPF. 

 // It gives access to real and imaginary sets. User can create a time freq support to manage data.

 

 // Create

 

 // create time\_freq\_support from scratch

 <a id="_a74" name="_a74"></a>[ansys::dpf::TimeFreqSupport](classansys_1_1dpf_1_1TimeFreqSupport.xhtml) time_freq_support;

 

 // create time\_frequencies, rpms and harmonic indices field

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) time_freq(3, { 1 }, <a id="a75" name="a75"></a>[ansys::dpf::locations::time\_set](structansys_1_1dpf_1_1locations.xhtml#a3cf1bbc2ad6d8b8f6173e83b5118031a));

 time_freq.[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)().[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)({ 1, 2, 3 });

 time_freq.scoping().setLocation(<a id="a76" name="a76"></a>[ansys::dpf::locations::time\_step](structansys_1_1dpf_1_1locations.xhtml#abc48364ef6b184ddf696099c9a2993cd));

 time_freq.setData({ 0.1, 0.21, 0.2 });

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) rpms(1, { 1 }, [ansys::dpf::locations::time\_step](structansys_1_1dpf_1_1locations.xhtml#abc48364ef6b184ddf696099c9a2993cd));

 rpms.[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)().[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)({ 1 });

 rpms.setData({ 30 });

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) harmonic_indices(0, { 1 }, [ansys::dpf::locations::time\_set](structansys_1_1dpf_1_1locations.xhtml#a3cf1bbc2ad6d8b8f6173e83b5118031a));

 harmonic_indices.[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)().[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)({ 1, 2, 3 });

 harmonic_indices.scoping().setLocation([ansys::dpf::locations::time\_step](structansys_1_1dpf_1_1locations.xhtml#abc48364ef6b184ddf696099c9a2993cd));

 harmonic_indices.setData({ 1.0, 2.0, -1.0 });

 

 // set the time\_freq\_support fields

 time_freq_support.<a id="a77" name="a77"></a>[setTimeFrequencies](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#aa01a23bf27be8e42ce3ec1da5e0ddcbe)(time_freq);

 time_freq_support.<a id="a78" name="a78"></a>[setRpms](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a855a9819d41665a1d9177fd8f67fa3f1)(rpms);

 time_freq_support.<a id="a79" name="a79"></a>[setHarmonicIndices](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a233c06f8d1967b7254dcf96df613e359)(harmonic_indices);

 

 // set harmonic indices for a specific cyclic stage number

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) harmonic_indices_2(3, { 1 }, [ansys::dpf::locations::time\_set](structansys_1_1dpf_1_1locations.xhtml#a3cf1bbc2ad6d8b8f6173e83b5118031a));

 harmonic_indices_2.[scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)().[setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)({ 1, 2, 3 });

 harmonic_indices_2.setData({ 1.0, 3.0, 2.0 });

 time_freq_support.[setHarmonicIndices](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a233c06f8d1967b7254dcf96df613e359)(harmonic_indices_2, 2); // set indices for the second stage

}

 

 

TEST(TimeFreqSupport, GetDataFromDataSources)

{

 // Create DataSources

 

 // set the result file path to the right path

 std::string fileName("../../../testfiles/mapdl\_files/TwoSolids.rst");

 [ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)(fileName);

 

 // Get Data

 

 [ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml) time_freq_prov("TimeFreqSupportProvider");

 time_freq_prov.connect([ansys::dpf::eDataSourcesPin](namespaceansys_1_1dpf.xhtml#aa4a44a04a0aafb8fe0645f019bbd94d1a5b6613f802062fde4faea4b553db7fbc), my_data_sources);

 [ansys::dpf::TimeFreqSupport](classansys_1_1dpf_1_1TimeFreqSupport.xhtml) time_freq = time_freq_prov.getOutputTimeFreqSupport(0);

 

 //get number of time/freq sets

 int num_sets = time_freq.<a id="a80" name="a80"></a>[numberOfSets](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a87c577de73b5ba2260cf3f940ac43068)();

 

 //get Field of real time freqs

 [ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml) my_time_freq_field = time_freq.<a id="a81" name="a81"></a>[frequencies](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#aa0cf046a80d328f966892abe85308f01)();

 [ansys::dpf::Unit](classansys_1_1dpf_1_1Unit.xhtml) time_freq_unit = my_time_freq_field.[fieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a860e65caa16f612746ad116429282fd3)().[unit](classansys_1_1dpf_1_1FieldDefinition.xhtml#aaf9c5c92a6d192207f01067950907af8)(); //usually s or Hz

 

 //get time or freqs on the first load step

 int size;

 double* freqs = my_time_freq_field.[entityDataById](classansys_1_1dpf_1_1Field.xhtml#a50ed01d59770f646c41777d496e0ff9c)(1, size);

}

 

TEST(Model, Explore)

{

 // The Model is built using DataSources, which themselves will be used (in a streams by default) to explore an analysis. 

 // Printing the model is a good tool to see the results that are available.

 

 // set the result file path to the right path

 std::string my_path("../../../testfiles/mapdl\_files/TwoSolids.rst");

 [ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)(my_path);

 

 //create the model

 <a id="_a82" name="_a82"></a>[ansys::dpf::Model](classansys_1_1dpf_1_1Model.xhtml) my_model(my_data_sources);

 //or

 [ansys::dpf::Model](classansys_1_1dpf_1_1Model.xhtml) my_model_from_path(my_path);

 

 //explore

 [ansys::dpf::TimeFreqSupport](classansys_1_1dpf_1_1TimeFreqSupport.xhtml) time_freq_support = my_model.getTimeFreqSupport();

 [ansys::dpf::MeshedRegion](classansys_1_1dpf_1_1MeshedRegion.xhtml) meshed_region = my_model.getMesh();

 <a id="_a83" name="_a83"></a>[ansys::dpf::ResultInfo](classansys_1_1dpf_1_1ResultInfo.xhtml) result_info = my_model.getResultInfo();

 

 //instantiate result provider

 //those providers are automatically connected to the streams

 <a id="_a84" name="_a84"></a>[ansys::dpf::Result](classansys_1_1dpf_1_1Result.xhtml) displacement = my_model.CreateResultEvaluationWorkflow("U");

 [ansys::dpf::Result](classansys_1_1dpf_1_1Result.xhtml) stress = my_model.CreateResultEvaluationWorkflow("S");

 

 //choose the time freq for the providers

 <a id="_a85" name="_a85"></a>[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml) error;

 [ansys::dpf::FieldsContainer](classansys_1_1dpf_1_1FieldsContainer.xhtml) fields = displacement.<a id="a86" name="a86"></a>[EvaluateAtGivenTime](classansys_1_1dpf_1_1Result.xhtml#ac8e07e03eba295dacfe13a100603d5c4)(0.0, error);

}

 

TEST(Workflow, CreateSaveResumeAndExecute)

{

 // This elementary workflow allows the user to simply read a displacement vector from an 

 // analysis and compute its norm.

 // It creates displacement and norm operators, chains them together, and add them into a workflow. 

 // The workflow is saved, resumed, and executed. 

 

 std::string workflow_id = "my\_workflow";

 int wf_id_int = -1;

 {

 [ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml) u_op("U");

 [ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml) norm_op("norm\_fc");

 norm_op.connect(u_op);

 

 <a id="_a87" name="_a87"></a>[ansys::dpf::Workflow](classansys_1_1dpf_1_1Workflow.xhtml) workflow;

 workflow.<a id="a88" name="a88"></a>[add](classansys_1_1dpf_1_1Workflow.xhtml#a794c8ac3fdd9459ebfe87f3962936a81)(u_op);

 workflow.[add](classansys_1_1dpf_1_1Workflow.xhtml#a794c8ac3fdd9459ebfe87f3962936a81)(norm_op);

 workflow.<a id="a89" name="a89"></a>[nameInputPin](classansys_1_1dpf_1_1Workflow.xhtml#a71a0990995b27105d4c362ad2880e4d7)("input\_data\_sources", [ansys::dpf::eDataSourcesPin](namespaceansys_1_1dpf.xhtml#aa4a44a04a0aafb8fe0645f019bbd94d1a5b6613f802062fde4faea4b553db7fbc), u_op);

 workflow.<a id="a90" name="a90"></a>[nameOutputPin](classansys_1_1dpf_1_1Workflow.xhtml#a3a223ef1c0200cc16ac1434ef938efca)(norm_op, 0, "output");

 wf_id_int = workflow.<a id="a91" name="a91"></a>[record](classansys_1_1dpf_1_1Workflow.xhtml#ab001bca50c1470be154a79841c43314c)(workflow_id, true);

 }

 

 // set the result file path to the right path

 std::string fileName("../../../testfiles/mapdl\_files/TwoSolids.rst");

 [ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml) my_data_sources;

 my_data_sources.[addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)(fileName);

 

 [ansys::dpf::Workflow](classansys_1_1dpf_1_1Workflow.xhtml) resumed_workflow = <a id="a92" name="a92"></a>[ansys::dpf::core::workflowById](classansys_1_1dpf_1_1core.xhtml#a723856ec83974fcb2cc61549f3cb89dd)(wf_id_int);

 resumed_workflow.<a id="a93" name="a93"></a>connect("input\_data\_sources", my_data_sources);

 [ansys::dpf::FieldsContainer](classansys_1_1dpf_1_1FieldsContainer.xhtml) result = resumed_workflow.<a id="a94" name="a94"></a>[getOutputFieldsContainer](classansys_1_1dpf_1_1Workflow.xhtml#aa3a9c25bbfb550d6692c063f9c3a9366)("output");

}

[ansys::dpf::DataSources](classansys_1_1dpf_1_1DataSources.xhtml)

**Definition:** dpf_api.h:2371



[ansys::dpf::DataSources::addResultFile](classansys_1_1dpf_1_1DataSources.xhtml#ad2a5bb6f24ca621ffaaee9e7a47cdc20)

void addResultFile(std::string const &amp;file_path, std::string const &amp;key)



[ansys::dpf::DataSources::addFile](classansys_1_1dpf_1_1DataSources.xhtml#ad8d20dc94dee694a62fce66e91691090)

void addFile(std::string const &amp;file_path, std::string const &amp;key)



[ansys::dpf::DpfError](classansys_1_1dpf_1_1DpfError.xhtml)

**Definition:** dpf_api_base.h:1113



[ansys::dpf::ElementCursor](classansys_1_1dpf_1_1ElementCursor.xhtml)

**Definition:** dpf_api.h:4185



[ansys::dpf::ElementCursor::numberOfNodes](classansys_1_1dpf_1_1ElementCursor.xhtml#a54ae9b25c375c752682a7dff04603348)

dp_int numberOfNodes() const

@ return Number of nodes in element.

**Definition:** dpf_api.h:4210



[ansys::dpf::FieldCursor](classansys_1_1dpf_1_1FieldCursor.xhtml)

**Definition:** dpf_api.h:945



[ansys::dpf::FieldCursor::size](classansys_1_1dpf_1_1FieldCursor.xhtml#a088f17f2b7eec6cd4470ece35f0dc01a)

dp_int size() const

**Definition:** dpf_api.h:965



[ansys::dpf::FieldCursor::id](classansys_1_1dpf_1_1FieldCursor.xhtml#a4a87616f5f17ac420f0499170efcf454)

dp_id id() const

**Definition:** dpf_api.h:967



[ansys::dpf::FieldCursor::n\_elementary\_data](classansys_1_1dpf_1_1FieldCursor.xhtml#a546e38c5c0b76a50350946e11718a9d3)

dp_int n_elementary_data() const

**Definition:** dpf_api.h:971



[ansys::dpf::FieldCursor::data](classansys_1_1dpf_1_1FieldCursor.xhtml#a815f0d760f113116cb5ed55b9ec9f584)

dp_double * data() const

**Definition:** dpf_api.h:960



[ansys::dpf::FieldDefinition](classansys_1_1dpf_1_1FieldDefinition.xhtml)

**Definition:** dpf_api.h:633



[ansys::dpf::FieldDefinition::setUnit](classansys_1_1dpf_1_1FieldDefinition.xhtml#a8033b1d4486ea3d819ecbb6418bab079)

void setUnit(ansys::dpf::Unit const &amp;rhs)



[ansys::dpf::FieldDefinition::location](classansys_1_1dpf_1_1FieldDefinition.xhtml#a9ea61f23ef1eb93c794b7c222d7740b8)

ansys::dpf::Location location() const



[ansys::dpf::FieldDefinition::unit](classansys_1_1dpf_1_1FieldDefinition.xhtml#aaf9c5c92a6d192207f01067950907af8)

ansys::dpf::Unit unit() const



[ansys::dpf::Field](classansys_1_1dpf_1_1Field.xhtml)

Data for an entity.

**Definition:** dpf_api.h:991



[ansys::dpf::Field::data](classansys_1_1dpf_1_1Field.xhtml#a0967a8c6cee105a679dd1151a5d41004)

dp_double *const data(int &amp;size) const



[ansys::dpf::Field::entityData](classansys_1_1dpf_1_1Field.xhtml#a1312be4b895a62a391eb66865897d27c)

dp_double *const entityData(dp_index entity_index, dp_int &amp;size) const



[ansys::dpf::Field::setFieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a471c3f541458acc9c05dfb019a99abb3)

void setFieldDefinition(FieldDefinition const &amp;f)



[ansys::dpf::Field::entityDataById](classansys_1_1dpf_1_1Field.xhtml#a50ed01d59770f646c41777d496e0ff9c)

dp_double *const entityDataById(dp_id entity_id, dp_int &amp;size) const



[ansys::dpf::Field::push\_back](classansys_1_1dpf_1_1Field.xhtml#a5b717ed309ddf287134905f71ada833b)

void push_back(dp_id entity_id, std::vector&lt; dp_double &gt; const &amp;values)



[ansys::dpf::Field::numberOfComponents](classansys_1_1dpf_1_1Field.xhtml#a70f7cda2d633297489b91de6761fd625)

dp_int numberOfComponents() const



[ansys::dpf::Field::fieldDefinition](classansys_1_1dpf_1_1Field.xhtml#a860e65caa16f612746ad116429282fd3)

FieldDefinition fieldDefinition() const



[ansys::dpf::Field::fillCursor](classansys_1_1dpf_1_1Field.xhtml#a96f5eeb13fb81117d3a096e5da245eab)

void fillCursor(dp_index index, FieldCursor &amp;f) const



[ansys::dpf::Field::setData](classansys_1_1dpf_1_1Field.xhtml#a9f7828d92496843cc5f15ee9e32f6c4a)

void setData(std::vector&lt; double &gt; const &amp;data)



[ansys::dpf::Field::scoping](classansys_1_1dpf_1_1Field.xhtml#aa16920741c1432c16e46ec6da26b3f04)

Scoping scoping() const



[ansys::dpf::FieldsContainer](classansys_1_1dpf_1_1FieldsContainer.xhtml)

Contains a group of fields.

**Definition:** dpf_api.h:1889



[ansys::dpf::FieldsContainer::add](classansys_1_1dpf_1_1FieldsContainer.xhtml#a0c6bd75cbd78e7a25784ccc4a9f609d5)

void add(LabelSpace const &amp;lab_space, Field const &amp;f)



[ansys::dpf::LabelSpace](classansys_1_1dpf_1_1LabelSpace.xhtml)

**Definition:** dpf_api.h:733



[ansys::dpf::MeshedRegion](classansys_1_1dpf_1_1MeshedRegion.xhtml)

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

**Definition:** dpf_api.h:4231



[ansys::dpf::MeshedRegion::fillCursor](classansys_1_1dpf_1_1MeshedRegion.xhtml#a012ff219aea7e92a889a77611de00b3a)

void fillCursor(dp_index element_index, ElementCursor &amp;cursor) const



[ansys::dpf::MeshedRegion::elementTypes](classansys_1_1dpf_1_1MeshedRegion.xhtml#a0e89e4e209380a10140c14cd91655907)

PropertyField elementTypes() const



[ansys::dpf::MeshedRegion::addElement](classansys_1_1dpf_1_1MeshedRegion.xhtml#a11b6e06dfea398609fa9fb25ad4333bb)

void addElement(ElementDescriptor const &amp;descriptor, dp_id elem_id, std::vector&lt; dp_index &gt; const &amp;node_indices)



[ansys::dpf::MeshedRegion::addNode](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2b4891674d74a792b63318c305963500)

void addNode(dp_id node_id, std::array&lt; dp_double, 3 &gt; const &amp;data)



[ansys::dpf::MeshedRegion::connectivity](classansys_1_1dpf_1_1MeshedRegion.xhtml#a2c75723ffc634c39b081eecd31d54309)

PropertyField connectivity() const



[ansys::dpf::MeshedRegion::elementScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#a3056a0fc6d69ca8769e33de6be0cecf0)

Scoping elementScoping() const



[ansys::dpf::MeshedRegion::nodesCoordinates](classansys_1_1dpf_1_1MeshedRegion.xhtml#a482ae171f257bfe86c8e567f0882caa4)

Field nodesCoordinates() const



[ansys::dpf::MeshedRegion::prepareConstruction](classansys_1_1dpf_1_1MeshedRegion.xhtml#aa7b984923ddd90379f08bc5b9831a95e)

void prepareConstruction(dp_int n_nodes, dp_int n_elements)



[ansys::dpf::MeshedRegion::nodeScoping](classansys_1_1dpf_1_1MeshedRegion.xhtml#ad5df08993b7c588d9565ef1c1ea4813d)

Scoping nodeScoping() const



[ansys::dpf::Model](classansys_1_1dpf_1_1Model.xhtml)

**Definition:** dpf_model.h:14



[ansys::dpf::Operator](classansys_1_1dpf_1_1Operator.xhtml)

Wrap an elementary operation.

**Definition:** dpf_api.h:2651



[ansys::dpf::PropFieldCursor](classansys_1_1dpf_1_1PropFieldCursor.xhtml)

**Definition:** dpf_api.h:1182



[ansys::dpf::PropFieldCursor::size](classansys_1_1dpf_1_1PropFieldCursor.xhtml#a269c1fad1eab6210e2f0e271bd0a1b34)

dp_int size() const

**Definition:** dpf_api.h:1201



[ansys::dpf::PropFieldCursor::data](classansys_1_1dpf_1_1PropFieldCursor.xhtml#afb9be4ae3088090d4caf097455fe877f)

dp_int * data() const

**Definition:** dpf_api.h:1196



[ansys::dpf::PropertyField](classansys_1_1dpf_1_1PropertyField.xhtml)

**Definition:** dpf_api.h:1216



[ansys::dpf::PropertyField::fillCursor](classansys_1_1dpf_1_1PropertyField.xhtml#a90f3baa944b4dd1a49adbcbec5a3d766)

void fillCursor(dp_index index, PropFieldCursor &amp;cursor) const



[ansys::dpf::ResultInfo](classansys_1_1dpf_1_1ResultInfo.xhtml)

**Definition:** dpf_api.h:347



[ansys::dpf::Result](classansys_1_1dpf_1_1Result.xhtml)

**Definition:** dpf_result.h:11



[ansys::dpf::Result::EvaluateAtGivenTime](classansys_1_1dpf_1_1Result.xhtml#ac8e07e03eba295dacfe13a100603d5c4)

FieldsContainer EvaluateAtGivenTime(double dTime, DpfError &amp;error)

**Definition:** dpf_result.h:63



[ansys::dpf::Scoping](classansys_1_1dpf_1_1Scoping.xhtml)

Define a set of entities by ids.

**Definition:** dpf_api.h:838



[ansys::dpf::Scoping::setIds](classansys_1_1dpf_1_1Scoping.xhtml#a021a022f87287b786ff9b3c92deb0e69)

void setIds(std::vector&lt; dp_id &gt; const &amp;ids)



[ansys::dpf::Scoping::location](classansys_1_1dpf_1_1Scoping.xhtml#a516b4489a94ff02ecc880f170b8f93a9)

ansys::dpf::Location location() const



[ansys::dpf::Scoping::getIds](classansys_1_1dpf_1_1Scoping.xhtml#a7377823a48ee69e439a8589627c5e6c0)

void getIds(std::vector&lt; dp_id &gt; &amp;ids_to_fill) const



[ansys::dpf::Scoping::emplace](classansys_1_1dpf_1_1Scoping.xhtml#a94f0dd35d07efdc472ef072b42f9cfda)

void emplace(dp_index index, dp_id id)



[ansys::dpf::Scoping::indexById](classansys_1_1dpf_1_1Scoping.xhtml#ab80b20d56d63ce48c08ce6b7428e06c2)

dp_index indexById(dp_int id) const



[ansys::dpf::Scoping::setLocation](classansys_1_1dpf_1_1Scoping.xhtml#abfc7b7b2376db292a67d05e9b7828367)

void setLocation(ansys::dpf::Location location)



[ansys::dpf::Scoping::ids](classansys_1_1dpf_1_1Scoping.xhtml#acf26749e29d9f23de6c70806ccfaea6b)

const dp_id * ids(dp_int &amp;size) const



[ansys::dpf::Scoping::idByIndex](classansys_1_1dpf_1_1Scoping.xhtml#ae35e47f2cceccf7ad9ed4590bd10ff89)

dp_id idByIndex(dp_int index) const



[ansys::dpf::Scoping::size](classansys_1_1dpf_1_1Scoping.xhtml#aeae5e27bd752bdf0da3cc2d64fbe118a)

dp_int size() const



[ansys::dpf::TimeFreqSupport](classansys_1_1dpf_1_1TimeFreqSupport.xhtml)

Define a time/frequency set.

**Definition:** dpf_api.h:4405



[ansys::dpf::TimeFreqSupport::setHarmonicIndices](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a233c06f8d1967b7254dcf96df613e359)

void setHarmonicIndices(Field field, dp_int stage=0)



[ansys::dpf::TimeFreqSupport::setRpms](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a855a9819d41665a1d9177fd8f67fa3f1)

void setRpms(Field field)



[ansys::dpf::TimeFreqSupport::numberOfSets](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#a87c577de73b5ba2260cf3f940ac43068)

dp_int numberOfSets() const



[ansys::dpf::TimeFreqSupport::setTimeFrequencies](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#aa01a23bf27be8e42ce3ec1da5e0ddcbe)

void setTimeFrequencies(Field field)



[ansys::dpf::TimeFreqSupport::frequencies](classansys_1_1dpf_1_1TimeFreqSupport.xhtml#aa0cf046a80d328f966892abe85308f01)

Field frequencies() const



[ansys::dpf::Unit](classansys_1_1dpf_1_1Unit.xhtml)

**Definition:** dpf_api.h:301



[ansys::dpf::Workflow](classansys_1_1dpf_1_1Workflow.xhtml)

Group a set of connected operators in order to define a whole data treatment.

**Definition:** dpf_api.h:3391



[ansys::dpf::Workflow::nameOutputPin](classansys_1_1dpf_1_1Workflow.xhtml#a3a223ef1c0200cc16ac1434ef938efca)

void nameOutputPin(Operator &amp;op, int operator_output_pin, std::string const &amp;pin_name)



[ansys::dpf::Workflow::nameInputPin](classansys_1_1dpf_1_1Workflow.xhtml#a71a0990995b27105d4c362ad2880e4d7)

void nameInputPin(std::string const &amp;pin_name, int operator_input_pin, Operator &amp;op)



[ansys::dpf::Workflow::add](classansys_1_1dpf_1_1Workflow.xhtml#a794c8ac3fdd9459ebfe87f3962936a81)

void add(Operator &amp;op)



[ansys::dpf::Workflow::getOutputFieldsContainer](classansys_1_1dpf_1_1Workflow.xhtml#aa3a9c25bbfb550d6692c063f9c3a9366)

FieldsContainer getOutputFieldsContainer(std::string const &amp;pin_name)



[ansys::dpf::Workflow::record](classansys_1_1dpf_1_1Workflow.xhtml#ab001bca50c1470be154a79841c43314c)

int record(std::string const &amp;name, bool transfer_ownership, DpfError &amp;error)

Records the workflow in DPF's registry.



[ansys::dpf::core::workflowById](classansys_1_1dpf_1_1core.xhtml#a723856ec83974fcb2cc61549f3cb89dd)

static Workflow workflowById(int id)



[ansys::dpf::eDataSourcesPin](namespaceansys_1_1dpf.xhtml#aa4a44a04a0aafb8fe0645f019bbd94d1a5b6613f802062fde4faea4b553db7fbc)

@ eDataSourcesPin

**Definition:** dpf_api.h:2583



[ansys::dpf::ElementDescriptor](structansys_1_1dpf_1_1ElementDescriptor.xhtml)

**Definition:** dpf_api_base.h:592



[ansys::dpf::ElementDescriptor::name](structansys_1_1dpf_1_1ElementDescriptor.xhtml#a49e5f9c938d56155ba253b08ba8b75ff)

std::string name

**Definition:** dpf_api_base.h:595



[ansys::dpf::ElementDescriptor::solid](structansys_1_1dpf_1_1ElementDescriptor.xhtml#a55af041295e3f9d83373e649289f1b35)

bool solid

**Definition:** dpf_api_base.h:601



[ansys::dpf::Label](structansys_1_1dpf_1_1Label.xhtml)

**Definition:** dpf_api_base.h:511



[ansys::dpf::Location](structansys_1_1dpf_1_1Location.xhtml)

User defined location quantity.

**Definition:** dpf_api_base.h:139



[ansys::dpf::elements::tet4](structansys_1_1dpf_1_1elements.xhtml#a05d59369acd4f4ac6819645f2413ee22)

static const ElementDescriptor tet4

**Definition:** dpf_api_base.h:675



[ansys::dpf::elements::descriptor](structansys_1_1dpf_1_1elements.xhtml#a30e8daf92a36604a3c176d9f7b5d1f35)

static ElementDescriptor const &amp; descriptor(dp_index element_index)

**Definition:** dpf_api_base.h:729



[ansys::dpf::elements::point1](structansys_1_1dpf_1_1elements.xhtml#a42c776bd25670e7ca0c2cc9fc91e2829)

static const ElementDescriptor point1

**Definition:** dpf_api_base.h:715



[ansys::dpf::elements::quad4](structansys_1_1dpf_1_1elements.xhtml#a4781a62a05dd26d8f1f19cd7c4b6e524)

static const ElementDescriptor quad4

**Definition:** dpf_api_base.h:687



[ansys::dpf::elements::line2](structansys_1_1dpf_1_1elements.xhtml#a52f6751afe46909ad6c83c0b0510491d)

static const ElementDescriptor line2

**Definition:** dpf_api_base.h:707



[ansys::dpf::labels::time](structansys_1_1dpf_1_1labels.xhtml#a22ee1a5e3be8ad98c20c5ca52e247914)

static const Label time

**Definition:** dpf_api_base.h:536



[ansys::dpf::labels::complex](structansys_1_1dpf_1_1labels.xhtml#ac63ee601c3a70f700d4a8efb091a565f)

static const Label complex

**Definition:** dpf_api_base.h:542



[ansys::dpf::locations::elemental\_nodal](structansys_1_1dpf_1_1locations.xhtml#a0bda534055805adc4c08bece34989ff3)

static const Location elemental_nodal

**Definition:** dpf_api_base.h:180



[ansys::dpf::locations::time\_set](structansys_1_1dpf_1_1locations.xhtml#a3cf1bbc2ad6d8b8f6173e83b5118031a)

static const Location time_set

**Definition:** dpf_api_base.h:204



[ansys::dpf::locations::elemental](structansys_1_1dpf_1_1locations.xhtml#a3f66169a86ab935fb398b3fdde98bb04)

static const Location elemental

**Definition:** dpf_api_base.h:178



[ansys::dpf::locations::nodal](structansys_1_1dpf_1_1locations.xhtml#aa4e1967b0838d8597200c606c8564d29)

static const Location nodal

**Definition:** dpf_api_base.h:176



[ansys::dpf::locations::time\_step](structansys_1_1dpf_1_1locations.xhtml#abc48364ef6b184ddf696099c9a2993cd)

static const Location time_step

**Definition:** dpf_api_base.h:202