Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::DataSources Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::DataSources:
ansys::dpf::DpfTypes

Public Member Functions

 DataSources (Client const *const client)
 
 DataSources (DataSources const &)
 
 DataSources (DataSources &&)
 
 DataSources (std::string const &result_file_path, std::string const &key)
 
 DataSources (std::string const &result_file_path, std::string const &key, Client const *const client)
 
 DataSources (std::string const &result_file_path)
 
 DataSources (std::string const &result_file_path, Client const *const client)
 
 DataSources (int id, Client const *const client)
 
DataSourcesoperator= (DataSources const &)
 
DataSourcesoperator= (DataSources &&)
 
void addResultFile (std::string const &file_path, std::string const &key)
 
void addResultFileWString (std::wstring const &file_path)
 
void addResultFile (std::string const &file_path)
 
void addDomainResultFile (std::string const &file_path, std::string const &key, dp_int domain_id)
 
void addFile (std::string const &file_path, std::string const &key)
 
void addFile (std::string const &file_path)
 
void addFile (std::string const &file_path, std::string const &key, std::string const &result_key)
 
void addDomainFile (std::string const &file_path, std::string const &key, dp_int domain_id)
 
void addUpStream (DataSources &ds)
 
void addUpStream (DataSources &ds, std::string const &result_key)
 
std::string resultKey () const
 
std::vector< std::string > filePaths (std::string const &key) const
 
std::vector< std::string > resultFilePaths () const
 
std::vector< std::string > keys () const
 
int numPaths () const
 
std::string pathAtKeyByIndex (std::string const &key, dp_index index) const
 
std::pair< std::string, std::string > pathAndKeyByIndex (int index)
 
LabelSpace identifierbyIndex (int index)
 
DataSources deep_copy (ansys::dpf::Client const *const client=nullptr) const
 
- Public Member Functions inherited from ansys::dpf::DpfTypes
virtual bool empty () const
 
virtual std::string describe () const
 
so::API const * callAPI () const
 
bool isOnCommonAPI () const
 
bool getClient (Client &client) const
 
bool hasBeenMovedLocally () const
 
bool isSameObject (DpfTypes const &rhs) const
 

Static Public Member Functions

static DataSources emptyDataSources ()
 

Detailed Description

Container of files on which the analysis results can be found.

Examples
AveragingTest.cpp, CompleteRST.cpp, DataApis.cpp, DataExport.cpp, OperatorsApis.cpp, ResultTest.cpp, and WorkflowExamples.cpp.

Constructor & Destructor Documentation

◆ DataSources() [1/6]

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

Create a file container on a server.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ DataSources() [2/6]

ansys::dpf::DataSources::DataSources ( std::string const &  result_file_path,
std::string const &  key 
)

Create a file container with given file and key.

Parameters
[in]result_file_pathResult file with which to create data source container.
[in]keyKey describing type of file.

◆ DataSources() [3/6]

ansys::dpf::DataSources::DataSources ( std::string const &  result_file_path,
std::string const &  key,
Client const *const  client 
)

Create a file container with given file and key.

Parameters
[in]result_file_pathResult file with which to create data source container.
[in]keyKey describing type of file.
[in]clientClient instance designating the IP, port and protocol to use.

◆ DataSources() [4/6]

ansys::dpf::DataSources::DataSources ( std::string const &  result_file_path)

Create a file container with given file.

Parameters
[in]result_file_pathResult file with which to create data source container.

◆ DataSources() [5/6]

ansys::dpf::DataSources::DataSources ( std::string const &  result_file_path,
Client const *const  client 
)

Create a file container with given file on a server.

Parameters
[in]result_file_pathResult file with which to create data source container.

◆ DataSources() [6/6]

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

Retrieve an existing instance of DataSources on a server.

Parameters
[in]idId of the DataSources object on the server's database.
[in]clientClient instance designating the IP, port and protocol to use.

Member Function Documentation

◆ addDomainFile()

void ansys::dpf::DataSources::addDomainFile ( std::string const &  file_path,
std::string const &  key,
dp_int  domain_id 
)

Add domain file with key and domain id to data sources.

Parameters
[in]file_pathFile to use with data source container.
[in]keyKey describing type of file.
[in]domain_idDomain id of file.

◆ addDomainResultFile()

void ansys::dpf::DataSources::addDomainResultFile ( std::string const &  file_path,
std::string const &  key,
dp_int  domain_id 
)

Define data source result file with key and domain.

Parameters
[in]file_pathResult file to use with data source container.
[in]keyKey describing type of file.
[in]domain_idDomain id of file.

◆ addFile() [1/3]

void ansys::dpf::DataSources::addFile ( std::string const &  file_path)

Add secondary, non-result, file to data sources.

Parameters
[in]file_pathFile to use with data source container.

◆ addFile() [2/3]

void ansys::dpf::DataSources::addFile ( std::string const &  file_path,
std::string const &  key 
)

Add secondary, non-result, file with key to data sources.

Parameters
[in]file_pathFile to use with data source container.
[in]keyKey describing type of file.
Examples
DataApis.cpp.

◆ addFile() [3/3]

void ansys::dpf::DataSources::addFile ( std::string const &  file_path,
std::string const &  key,
std::string const &  result_key 
)

Add secondary, non-result, file with key and result key to data sources.

Parameters
[in]file_pathFile to use with data source container.
[in]keyKey describing type of file.
[in]result_keyResult key for file.

◆ addResultFile() [1/2]

void ansys::dpf::DataSources::addResultFile ( std::string const &  file_path)

Define result for data sources.

Parameters
[in]file_pathResult file to use with data source container.

◆ addResultFile() [2/2]

void ansys::dpf::DataSources::addResultFile ( std::string const &  file_path,
std::string const &  key 
)

Define result file with key for data sources.

Parameters
[in]file_pathResult file to use with data source container.
[in]keyKey describing type of file.
Examples
AveragingTest.cpp, CompleteRST.cpp, DataApis.cpp, OperatorsApis.cpp, ResultTest.cpp, and WorkflowExamples.cpp.

◆ addResultFileWString()

void ansys::dpf::DataSources::addResultFileWString ( std::wstring const &  file_path)

Define result for data sources.

Parameters
[in]file_pathResult file to use with data source container.

◆ addUpStream() [1/2]

void ansys::dpf::DataSources::addUpStream ( DataSources ds)

Add up stream to data sources.

Parameters
[in]dsUpstream data sources.

◆ addUpStream() [2/2]

void ansys::dpf::DataSources::addUpStream ( DataSources ds,
std::string const &  result_key 
)

Add up stream with result key to data sources.

Parameters
[in]dsUpstream data sources.
[in]result_keyResult key for upstream source.

◆ deep_copy()

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

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

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ emptyDataSources()

static DataSources ansys::dpf::DataSources::emptyDataSources ( )
static

Create an empty data sources.

Returns
Empty DataSources.

◆ filePaths()

std::vector< std::string > ansys::dpf::DataSources::filePaths ( std::string const &  key) const
Returns
Vector of secondary files given by key.
Parameters
[in]keyKey describing file type.

◆ identifierbyIndex()

LabelSpace ansys::dpf::DataSources::identifierbyIndex ( int  index)
Returns
LabelSpace or identifier of a path for a given index in data sources.

◆ keys()

std::vector< std::string > ansys::dpf::DataSources::keys ( ) const
Returns
Vector of keys in data sources.

◆ numPaths()

int ansys::dpf::DataSources::numPaths ( ) const
Returns
Size or Num file path in data sources.
Examples
CompleteRST.cpp.

◆ pathAndKeyByIndex()

std::pair< std::string, std::string > ansys::dpf::DataSources::pathAndKeyByIndex ( int  index)
Returns
File path and its key for a given index in data sources.

◆ pathAtKeyByIndex()

std::string ansys::dpf::DataSources::pathAtKeyByIndex ( std::string const &  key,
dp_index  index 
) const
Returns
Path at given key and given index in data sources.

◆ resultFilePaths()

std::vector< std::string > ansys::dpf::DataSources::resultFilePaths ( ) const
Returns
Vector of result files in data sources.

◆ resultKey()

std::string ansys::dpf::DataSources::resultKey ( ) const
Returns
Result key of data sources.