GenericInputMPVData is the class that set a generic input data as mimmo::MimmoPiercedVector. More...

#include <GenericInput.hpp>

Inheritance diagram for mimmo::GenericInputMPVData:
Collaboration diagram for mimmo::GenericInputMPVData:

Public Member Functions

 GenericInputMPVData (bool csv=false)
 
 GenericInputMPVData (const bitpit::Config::Section &rootXML)
 
 GenericInputMPVData (const GenericInputMPVData &other)
 
 GenericInputMPVData (std::string dir, std::string filename, bool csv=false)
 
virtual void absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="")
 
void buildPorts ()
 
void clearResult ()
 
void execute ()
 
virtual void flushSectionXML (bitpit::Config::Section &slotXML, std::string name="")
 
template<typename T >
MimmoPiercedVector< T > * getResult ()
 
GenericInputMPVDataoperator= (GenericInputMPVData other)
 
void setBinary (bool binary)
 
void setCSV (bool csv)
 
void setFilename (std::string filename)
 
void setReadDir (std::string dir)
 
- Public Member Functions inherited from mimmo::BaseManipulation
 BaseManipulation ()
 
 BaseManipulation (const BaseManipulation &other)
 
virtual ~BaseManipulation ()
 
void activate ()
 
bool arePortsBuilt ()
 
void clear ()
 
void disable ()
 
void exec ()
 
BaseManipulationgetChild (int i=0)
 
ConnectionType getConnectionType ()
 
MimmoSharedPointer< MimmoObjectgetGeometry ()
 
MimmoSharedPointer< MimmoObject > & getGeometryReference ()
 
int getId ()
 
bitpit::Logger & getLog ()
 
std::string getName ()
 
int getNChild ()
 
int getNParent ()
 
int getNPortsIn ()
 
int getNPortsOut ()
 
BaseManipulationgetParent (int i=0)
 
std::unordered_map< PortID, PortIn * > getPortsIn ()
 
std::unordered_map< PortID, PortOut * > getPortsOut ()
 
uint getPriority ()
 
virtual std::vector< BaseManipulation * > getSubBlocksEmbedded ()
 
bool isActive ()
 
bool isApply ()
 
bool isChild (BaseManipulation *, int &)
 
bool isParent (BaseManipulation *, int &)
 
bool isPlotInExecution ()
 
BaseManipulationoperator= (const BaseManipulation &other)
 
void removePins ()
 
void removePinsIn ()
 
void removePinsOut ()
 
void setApply (bool flag=true)
 
void setGeometry (MimmoSharedPointer< MimmoObject > geometry)
 
void setId (int)
 
void setLog (bitpit::Logger &log)
 
void setName (std::string name)
 
void setOutputPlot (std::string path)
 
void setPlotInExecution (bool)
 
void setPriority (uint priority)
 
void unsetGeometry ()
 

Protected Member Functions

void swap (GenericInputMPVData &x) noexcept
 
- Protected Member Functions inherited from mimmo::BaseManipulation
void _apply (MimmoPiercedVector< darray3E > &displacements)
 
void addChild (BaseManipulation *child)
 
void addParent (BaseManipulation *parent)
 
void addPinIn (BaseManipulation *objIn, PortID portR)
 
void addPinOut (BaseManipulation *objOut, PortID portS, PortID portR)
 
virtual void apply ()
 
void cleanBufferIn (PortID port)
 
template<typename T , typename O >
bool createPortIn (O *obj, void(O::*setVar_)(T), PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortIn (T *var_, PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortOut (O *obj, T(O::*getVar_)(), PortID portS)
 
template<typename T , typename O >
bool createPortOut (T *var_, PortID portS)
 
void deletePorts ()
 
PortID findPinIn (PortIn &pin)
 
PortID findPinOut (PortOut &pin)
 
void initializeLogger (bool logexists)
 
virtual void plotOptionalResults ()
 
void readBufferIn (PortID port)
 
void removePinIn (BaseManipulation *objIn, PortID portR)
 
void removePinIn (PortID portR, int j)
 
void removePinOut (BaseManipulation *objOut, PortID portS)
 
void removePinOut (PortID portS, int j)
 
void setBufferIn (PortID port, mimmo::IBinaryStream &input)
 
void swap (BaseManipulation &x) noexcept
 
void unsetChild (BaseManipulation *child)
 
void unsetParent (BaseManipulation *parent)
 
void write (MimmoSharedPointer< MimmoObject > geometry)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data, Args ... args)
 

Additional Inherited Members

- Public Types inherited from mimmo::BaseManipulation
typedef std::unordered_map< BaseManipulation *, int > bmumap
 
typedef pin::ConnectionType ConnectionType
 
typedef std::string PortID
 
- Protected Attributes inherited from mimmo::BaseManipulation
bool m_active
 
bool m_apply
 
bool m_arePortsBuilt
 
bmumap m_child
 
int m_counter
 
bool m_execPlot
 
MimmoSharedPointer< MimmoObjectm_geometry
 
bitpit::Logger * m_log
 
std::string m_name
 
std::string m_outputPlot
 
bmumap m_parent
 
std::unordered_map< PortID, PortIn * > m_portIn
 
std::unordered_map< PortID, PortOut * > m_portOut
 
ConnectionType m_portsType
 
uint m_priority
 
- Static Protected Attributes inherited from mimmo::BaseManipulation
static int sm_baseManipulationCounter
 

Detailed Description

GenericInputMPVData is the class that set a generic input data as mimmo::MimmoPiercedVector.

GenericInputMPVData is derived from BaseManipulation class. GenericInput read MimmoPiercedVector data fields from file (unformatted/csv) When reading, the GenericInput object recognizes the type of data and it adapts the reading method in function of the output port used to build link (pin) with other objects. If a valid reference geometry is linked through port M_GEOM or through method setGeometry the class checks all MPV entries read and retains those whose id is contained inside the reference geometry point-data, cell-data or interface-data. If none of the items is referenced by the geometry return an empty MimmoPiercedVector as result. Can read binary data related to PiercedVector, activating the binary flag. On MPI versions, GenericInputMPVData read data from file with proc rank 0, and send all the data to all other procs.


Ports available in GenericInput Class :


Port Input
PortType variable/function DataType
M_GEOM setGeometry (MC_SCALAR, MD_MIMMO_)
Port Output
PortType variable/function DataType
M_SCALARFIELD getResult (MC_SCALAR, MD_MPVECFLOAT_)
M_VECTORFIELD getResult (MC_SCALAR, MD_MPVECARR3FLOAT_)


The xml available parameters, sections and subsections are the following :

Inherited from BaseManipulation:

Proper of the class:

  • CSV: 0/1 set class to read a CSV format;
  • ReadDir: path to your current file data;
  • Filename: path to your current file data.
  • Binary: 0/1 set read a BINARY file (default ASCII);
Examples
genericinput_example_00002.cpp.

Definition at line 246 of file GenericInput.hpp.

Constructor & Destructor Documentation

◆ GenericInputMPVData() [1/4]

mimmo::GenericInputMPVData::GenericInputMPVData ( bool  csv = false)

Default constructor of GenericInputMPVData.

Parameters
[in]csvTrue if the input file is a csv format file (default value false).

Definition at line 266 of file GenericInput.cpp.

◆ GenericInputMPVData() [2/4]

mimmo::GenericInputMPVData::GenericInputMPVData ( const bitpit::Config::Section &  rootXML)

Custom constructor reading xml data

Parameters
[in]rootXMLreference to your xml tree section

Definition at line 278 of file GenericInput.cpp.

◆ GenericInputMPVData() [3/4]

mimmo::GenericInputMPVData::GenericInputMPVData ( std::string  dir,
std::string  filename,
bool  csv = false 
)

Custom constructor of GenericInputMPVData.

Parameters
[in]dirDirectory of the input file.
[in]filenameName of the input file.
[in]csvTrue if the input file is a csv format file (default value false). The m_readFromFile flag is set to true.

Definition at line 304 of file GenericInput.cpp.

◆ GenericInputMPVData() [4/4]

mimmo::GenericInputMPVData::GenericInputMPVData ( const GenericInputMPVData other)

Copy constructor of GenericInputMPVData. m_input and m_result members are not copied.

Definition at line 318 of file GenericInput.cpp.

Member Function Documentation

◆ absorbSectionXML()

void mimmo::GenericInputMPVData::absorbSectionXML ( const bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos reading from a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::BaseManipulation.

Definition at line 415 of file GenericInput.cpp.

◆ buildPorts()

void mimmo::GenericInputMPVData::buildPorts ( )
virtual

It builds the input/output ports of the object

Implements mimmo::BaseManipulation.

Definition at line 383 of file GenericInput.cpp.

◆ clearResult()

void mimmo::GenericInputMPVData::clearResult ( )

It clear the result member of the object

Definition at line 398 of file GenericInput.cpp.

◆ execute()

void mimmo::GenericInputMPVData::execute ( )
virtual

Execution command. It does nothing, the real execution of the object happens in setInput/getResult.

Implements mimmo::BaseManipulation.

Definition at line 407 of file GenericInput.cpp.

◆ flushSectionXML()

void mimmo::GenericInputMPVData::flushSectionXML ( bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos from class members in a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::BaseManipulation.

Definition at line 465 of file GenericInput.cpp.

◆ getResult()

template<typename T >
MimmoPiercedVector< T > * mimmo::GenericInputMPVData::getResult

It gets the result of the object. Result may be empty both for failed reading or invalid read data. In that case, return an empty/default copy of the result data.

Returns
copy of the data stored in result member.

Definition at line 406 of file GenericInput.tpp.

◆ operator=()

GenericInputMPVData & mimmo::GenericInputMPVData::operator= ( GenericInputMPVData  other)

Assignment operator. m_input and m_result members are not copied.

Definition at line 328 of file GenericInput.cpp.

◆ setBinary()

void mimmo::GenericInputMPVData::setBinary ( bool  binary)

It sets if the input file is in Binary format.

Parameters
[in]binaryIs the input file in Binary format?
Examples
genericinput_example_00002.cpp.

Definition at line 360 of file GenericInput.cpp.

◆ setCSV()

void mimmo::GenericInputMPVData::setCSV ( bool  csv)

It sets if the input file is in csv format.

Parameters
[in]csvIs the input file write in comma separated value format?

Definition at line 352 of file GenericInput.cpp.

◆ setFilename()

void mimmo::GenericInputMPVData::setFilename ( std::string  filename)

It sets the name of the input file.

Parameters
[in]filenameName of the input file.
Examples
genericinput_example_00002.cpp.

Definition at line 368 of file GenericInput.cpp.

◆ setReadDir()

void mimmo::GenericInputMPVData::setReadDir ( std::string  dir)

It sets the name of the directory of input file.

Parameters
[in]dirName of the directory of input file.
Examples
genericinput_example_00002.cpp.

Definition at line 376 of file GenericInput.cpp.

◆ swap()

void mimmo::GenericInputMPVData::swap ( GenericInputMPVData x)
protectednoexcept

Swap method.

Parameters
[in]xobjet to be swapped.

Definition at line 337 of file GenericInput.cpp.


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