Primitive object generation. More...

#include <Primitive.hpp>

Inheritance diagram for mimmo::Primitive:
Collaboration diagram for mimmo::Primitive:

Public Member Functions

 Primitive ()
 
 Primitive (const bitpit::Config::Section &rootXML)
 
 Primitive (const Primitive &other)
 
virtual ~Primitive ()
 
virtual void absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="")
 
void buildPorts ()
 
void clearPrimitive ()
 
void execute ()
 
virtual void flushSectionXML (bitpit::Config::Section &slotXML, std::string name="")
 
- 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 ()
 
- Public Member Functions inherited from mimmo::UStructMesh
 UStructMesh ()
 
 UStructMesh (const UStructMesh &other)
 
virtual ~UStructMesh ()
 
int accessCellIndex (int i, int j, int k)
 
void accessCellIndex (int N_, int &i, int &j, int &k)
 
int accessPointIndex (int i, int j, int k)
 
void accessPointIndex (int N_, int &i, int &j, int &k)
 
virtual bool build ()
 
void clearMesh ()
 
void execute ()
 
ivector1D getCellNeighs (int)
 
ivector1D getCellNeighs (int, int, int)
 
std::array< CoordType, 3 > getCoordType ()
 
CoordType getCoordType (int)
 
CoordType getCoordTypex ()
 
CoordType getCoordTypey ()
 
CoordType getCoordTypez ()
 
iarray3E getDimension ()
 
darray3E getGlobalCCell (int)
 
darray3E getGlobalCCell (int, int, int)
 
dvecarr3E getGlobalCellCentroids ()
 
dvecarr3E getGlobalCoords ()
 
darray3E getGlobalPoint (int)
 
darray3E getGlobalPoint (int, int, int)
 
darray3E getInfLimits ()
 
darray3E getLocalCCell (int)
 
darray3E getLocalCCell (int, int, int)
 
dvecarr3E getLocalCellCentroids ()
 
dvecarr3E getLocalCoords ()
 
darray3E getLocalPoint (int)
 
darray3E getLocalPoint (int, int, int)
 
darray3E getLocalSpan ()
 
darray3E getOrigin ()
 
dmatrix33E getRefSystem ()
 
darray3E getScaling ()
 
BasicShapegetShape ()
 
const BasicShapegetShape () const
 
ShapeType getShapeType ()
 
darray3E getSpacing ()
 
darray3E getSpan ()
 
darray3E interpolateCellData (darray3E &point, dvecarr3E &celldata)
 
double interpolateCellData (darray3E &point, dvector1D &celldata)
 
int interpolateCellData (darray3E &point, ivector1D &celldata)
 
darray3E interpolatePointData (darray3E &point, dvecarr3E &pointdata)
 
double interpolatePointData (darray3E &point, dvector1D &pointdata)
 
int interpolatePointData (darray3E &point, ivector1D &pointdata)
 
bool isBuilt ()
 
void locateCellByPoint (darray3E &point, int &i, int &j, int &k)
 
void locateCellByPoint (dvector1D &point, int &i, int &j, int &k)
 
UStructMeshoperator= (UStructMesh other)
 
void plotCloud (std::string &, std::string, int, bool, const ivector1D &labels, dvecarr3E *extPoints=nullptr)
 
void plotCloudScalar (std::string, std::string, int, bool, dvector1D &data)
 
void plotGrid (std::string &, std::string, int, bool, const ivector1D &labels, dvecarr3E *extPoints=nullptr)
 
void plotGridScalar (std::string, std::string, int, bool, dvector1D &data)
 
void setCoordType (CoordType, int)
 
void setCoordType (std::array< CoordType, 3 >)
 
void setCoordTypex (CoordType)
 
void setCoordTypey (CoordType)
 
void setCoordTypez (CoordType)
 
void setDimension (iarray3E dim)
 
void setDimension (ivector1D dim)
 
void setInfLimits (darray3E val)
 
void setInfLimits (double val, int dir)
 
void setMesh (BasicShape *, dvector1D &spacing)
 
void setMesh (BasicShape *, iarray3E &dimensions)
 
void setMesh (darray3E &origin, darray3E &span, ShapeType, dvector1D &spacing)
 
void setMesh (darray3E &origin, darray3E &span, ShapeType, iarray3E &dimensions)
 
void setOrigin (darray3E origin)
 
void setRefSystem (darray3E, darray3E, darray3E)
 
void setRefSystem (dmatrix33E)
 
void setRefSystem (int, darray3E)
 
void setShape (const BasicShape *)
 
void setShape (int itype=0)
 
void setShape (ShapeType type=ShapeType::CUBE)
 
void setSpan (darray3E span)
 
void setSpan (double, double, double)
 
void swap (UStructMesh &x) noexcept
 
darray3E transfToGlobal (darray3E &point)
 
dvecarr3E transfToGlobal (dvecarr3E &list_points)
 
dvector1D transfToGlobal (dvector1D &point)
 
darray3E transfToLocal (darray3E &point)
 
dvecarr3E transfToLocal (dvecarr3E &list_points)
 
dvector1D transfToLocal (dvector1D &point)
 

Protected Member Functions

void swap (Primitive &) 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)
 
- Protected Member Functions inherited from mimmo::UStructMesh
void destroyNodalStructure ()
 
void reshapeNodalStructure ()
 
void resizeMesh ()
 

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
 
- Protected Attributes inherited from mimmo::UStructMesh
double m_dx
 
double m_dy
 
double m_dz
 
bool m_isBuild
 
int m_nx
 
int m_ny
 
int m_nz
 
bool m_setInfLimits
 
bool m_setorigin
 
bool m_setRefSys
 
bool m_setspan
 
std::unique_ptr< BasicShapem_shape
 
dvector1D m_xedge
 
dvector1D m_xnode
 
dvector1D m_yedge
 
dvector1D m_ynode
 
dvector1D m_zedge
 
dvector1D m_znode
 
- Static Protected Attributes inherited from mimmo::BaseManipulation
static int sm_baseManipulationCounter
 

Detailed Description

Primitive object generation.

Basically, it builds an elemental 3D shape. The available shapes are: box, sphere, cylinder, wedge. A non-complete primitive can be defined by using custom span dimensions.

Ports available in Primitive class:


Port Input
PortType variable/function DataType
M_DIMENSION setDimension (MC_ARRAY3, MD_INT)
M_INFLIMITS setInfLimits (MC_ARRAY3, MD_FLOAT)
M_AXES setRefSystem (MC_ARR3ARR3, MD_FLOAT)
M_SPAN setSpan (MC_ARRAY3, MD_FLOAT)
M_POINT setOrigin (MC_ARRAY3, MD_FLOAT)
M_SHAPE setShape(mimmo::ShapeType) (MC_SCALAR, MD_SHAPET)
M_SHAPEI setShape(int) (MC_SCALAR, MD_INT)
Port Output
PortType variable/function DataType
M_COPYSHAPE getShape (MC_SCALAR, MD_SHAPE_)

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

Inherited from BaseManipulation:

  • ClassName: name of the class as mimmo.Primitive;
  • Priority: uint marking priority in multi-chain execution;
  • PlotInExecution: boolean 0/1 print optional results of the class.
  • OutputPlot: target directory for optional results writing.

Proper of the class:

  • Shape: type of basic shape for your lattice. Available choice are CUBE, CYLINDER,SPHERE,WEDGE
  • Origin: 3D point marking the shape barycenter
  • Span: span dimensions of your shape (width-height-depth for CUBE, baseRadius-azimuthalspan-height for CYLINDER, radius-azimuthalspan-polarspan for SPHERE, triangle width-triangle height-depth for WEDGE)
  • RefSystem: axes of current shape reference system. written in XML as:

    <RefSystem>
       <axis0> 1.0 0.0 0.0 </axis0>
       <axis1> 0.0 1.0 0.0 </axis1>
       <axis2> 0.0 0.0 1.0 </axis2>
    </RefSystem>


  • InfLimits: inferior limits for shape coordinates (meaningful only for CYLINDER AND SPHERE curvilinear coordinates)

Definition at line 92 of file Primitive.hpp.

Constructor & Destructor Documentation

◆ Primitive() [1/3]

mimmo::Primitive::Primitive ( )

Basic Constructor

Definition at line 32 of file Primitive.cpp.

◆ Primitive() [2/3]

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

Custom constructor reading xml data

Parameters
[in]rootXMLreference to your xml tree section

Definition at line 40 of file Primitive.cpp.

◆ ~Primitive()

mimmo::Primitive::~Primitive ( )
virtual

Destructor

Definition at line 53 of file Primitive.cpp.

◆ Primitive() [3/3]

mimmo::Primitive::Primitive ( const Primitive other)

Copy Constructor

Parameters
[in]otherPrimitive object

Definition at line 58 of file Primitive.cpp.

Member Function Documentation

◆ absorbSectionXML()

void mimmo::Primitive::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 111 of file Primitive.cpp.

◆ buildPorts()

void mimmo::Primitive::buildPorts ( )
virtual

It builds the input/output ports of the object

Implements mimmo::BaseManipulation.

Definition at line 74 of file Primitive.cpp.

◆ clearPrimitive()

void mimmo::Primitive::clearPrimitive ( )

Clean every setting and data hold by the class

Definition at line 94 of file Primitive.cpp.

◆ execute()

void mimmo::Primitive::execute ( )
virtual

Execute your object. Currently do nothing.

Implements mimmo::BaseManipulation.

Definition at line 103 of file Primitive.cpp.

◆ flushSectionXML()

void mimmo::Primitive::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 192 of file Primitive.cpp.

◆ swap()

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

Swap function.

Parameters
[in]xobject to be swapped

Definition at line 65 of file Primitive.cpp.


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