preCICE v3.1.1
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
precice::action::PythonAction Class Reference

Action whose implementation is given in a Python file. More...

#include <PythonAction.hpp>

Inheritance diagram for precice::action::PythonAction:
[legend]
Collaboration diagram for precice::action::PythonAction:
[legend]

Public Member Functions

 PythonAction (Timing timing, std::string modulePath, std::string moduleName, const mesh::PtrMesh &mesh, int targetDataID, int sourceDataID)
 
virtual ~PythonAction ()
 
virtual void performAction () final override
 Performs the action, to be overwritten by subclasses.
 
- Public Member Functions inherited from precice::action::Action
 Action (Timing timing, const mesh::PtrMesh &mesh, mapping::Mapping::MeshRequirement requirement)
 
 Action (Timing timing, const mesh::PtrMesh &mesh)
 
Actionoperator= (Action &&)=delete
 
virtual ~Action ()=default
 Destructor, empty.
 
Timing getTiming () const
 Returns the timing of the action.
 
const mesh::PtrMeshgetMesh () const
 Returns the mesh carrying the data used in the action.
 
mapping::Mapping::MeshRequirement getMeshRequirement () const
 Returns the mesh requirement of this action.
 

Private Member Functions

void initialize ()
 
int makeNumPyArraysAvailable ()
 

Private Attributes

logging::Logger _log {"action::PythonAction"}
 
std::string _modulePath
 
std::string _moduleName
 
mesh::PtrData _targetData
 
mesh::PtrData _sourceData
 
int _numberArguments = 1
 
bool _isInitialized = false
 
PyObject_moduleNameObject = nullptr
 
PyObject_module = nullptr
 
PyObject_sourceValues = nullptr
 
PyObject_targetValues = nullptr
 
PyObject_performAction = nullptr
 

Additional Inherited Members

- Public Types inherited from precice::action::Action
enum  Timing { WRITE_MAPPING_POST , READ_MAPPING_POST }
 Defines the time and place of application of the action. More...
 

Detailed Description

Action whose implementation is given in a Python file.

Definition at line 15 of file PythonAction.hpp.

Constructor & Destructor Documentation

◆ PythonAction()

precice::action::PythonAction::PythonAction ( Timing timing,
std::string modulePath,
std::string moduleName,
const mesh::PtrMesh & mesh,
int targetDataID,
int sourceDataID )

Definition at line 55 of file PythonAction.cpp.

Here is the call graph for this function:

◆ ~PythonAction()

precice::action::PythonAction::~PythonAction ( )
virtual

Definition at line 79 of file PythonAction.cpp.

Member Function Documentation

◆ initialize()

void precice::action::PythonAction::initialize ( )
private

Definition at line 139 of file PythonAction.cpp.

Here is the call graph for this function:

◆ makeNumPyArraysAvailable()

int precice::action::PythonAction::makeNumPyArraysAvailable ( )
private

Definition at line 163 of file PythonAction.cpp.

◆ performAction()

void precice::action::PythonAction::performAction ( )
finaloverridevirtual

Performs the action, to be overwritten by subclasses.

Implements precice::action::Action.

Definition at line 90 of file PythonAction.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _isInitialized

bool precice::action::PythonAction::_isInitialized = false
private

Definition at line 42 of file PythonAction.hpp.

◆ _log

logging::Logger precice::action::PythonAction::_log {"action::PythonAction"}
private

Definition at line 30 of file PythonAction.hpp.

◆ _module

PyObject* precice::action::PythonAction::_module = nullptr
private

Definition at line 46 of file PythonAction.hpp.

◆ _moduleName

std::string precice::action::PythonAction::_moduleName
private

Definition at line 34 of file PythonAction.hpp.

◆ _moduleNameObject

PyObject* precice::action::PythonAction::_moduleNameObject = nullptr
private

Definition at line 44 of file PythonAction.hpp.

◆ _modulePath

std::string precice::action::PythonAction::_modulePath
private

Definition at line 32 of file PythonAction.hpp.

◆ _numberArguments

int precice::action::PythonAction::_numberArguments = 1
private

Definition at line 40 of file PythonAction.hpp.

◆ _performAction

PyObject* precice::action::PythonAction::_performAction = nullptr
private

Definition at line 52 of file PythonAction.hpp.

◆ _sourceData

mesh::PtrData precice::action::PythonAction::_sourceData
private

Definition at line 38 of file PythonAction.hpp.

◆ _sourceValues

PyObject* precice::action::PythonAction::_sourceValues = nullptr
private

Definition at line 48 of file PythonAction.hpp.

◆ _targetData

mesh::PtrData precice::action::PythonAction::_targetData
private

Definition at line 36 of file PythonAction.hpp.

◆ _targetValues

PyObject* precice::action::PythonAction::_targetValues = nullptr
private

Definition at line 50 of file PythonAction.hpp.


The documentation for this class was generated from the following files: