mimmo::CreateSeedsOnSurface Class Reference

Distribute a raw list of points on a target 3D surface. More...

#include <CreateSeedsOnSurface.hpp>

Inheritance diagram for mimmo::CreateSeedsOnSurface:
Collaboration diagram for mimmo::CreateSeedsOnSurface:

Public Member Functions

 CreateSeedsOnSurface ()
 
 CreateSeedsOnSurface (const bitpit::Config::Section &rootXML)
 
 CreateSeedsOnSurface (const CreateSeedsOnSurface &other)
 
virtual ~CreateSeedsOnSurface ()
 
virtual void absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="")
 
void buildPorts ()
 
void clear ()
 
void execute ()
 
virtual void flushSectionXML (bitpit::Config::Section &slotXML, std::string name="")
 
int getEngine ()
 
CSeedSurf getEngineENUM ()
 
double getMinDistance ()
 
int getNPoints ()
 
dvecarr3E getPoints ()
 
long getRandomSignature ()
 
darray3E getSeed ()
 
bool isRandomFixed ()
 
bool isSeedMassCenter ()
 
CreateSeedsOnSurfaceoperator= (CreateSeedsOnSurface other)
 
void plotCloud (std::string dir, std::string file, int counter, bool binary)
 
void setEngine (int)
 
void setEngineENUM (CSeedSurf)
 
void setGeometry (MimmoSharedPointer< MimmoObject >)
 
void setMassCenterAsSeed (bool)
 
void setNPoints (int)
 
void setRandomFixed (bool fix)
 
void setRandomSignature (uint32_t signature)
 
void setSeed (darray3E)
 
void setSensitivityMap (dmpvector1D *field)
 
void solve (bool debug=false)
 
- 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 checkField ()
 
bool checkTriangulation ()
 
MimmoSharedPointer< MimmoObjectcreateTriangulation ()
 
void normalizeField ()
 
virtual void plotOptionalResults ()
 
void swap (CreateSeedsOnSurface &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)
 
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

Distribute a raw list of points on a target 3D surface.

Class/BaseManipulation Object to create a raw set of 3D points lying on a 3D surface.

MPI version will treat this raw list as shared among the ranks (every rank will retain exactly the same list)

Three type of engines to compute point positions are available:

  • CSeedSurf::RANDOM : sows points randomly on surface, trying to displace them at maximum euclidean distance;
  • CSeedSurf::CARTESIANGRID evaluate points by projection of a volumetric cartesian grid of surface and decimating the list up the desired value of points, trying to displace them at maximum euclidean distance possible.
  • CSeedSurf::LEVELSET : starting from an initial seed, sows points around it, trying to displace them at maximum geodesic distance possible on the surface; BEWARE this option is not available in MPI version with np processors > 1.
    Default engine is CARTESIANGRID.

A Sensitivity field, defined on the target 3D surface vertices can be linked, to drive the seeding procedure, i.e. to displace points in the most sensible location according to the field.
Ports available in CreateSeedsOnSurface Class :


Port Input
PortType variable/function DataType
M_POINT setSeed (MC_ARRAY3, MD_FLOAT)
M_GEOM setGeometry (MC_SCALAR, MD_MIMMO_)
M_FILTER setSensitivityField (MC_SCALAR, MD_MPVECFLOAT_)
Port Output
PortType variable/function DataType
M_COORDS getPoints (MC_VECARR3, MD_FLOAT)
M_VALUEI getRandomSignature (MC_SCALAR, MD_INT)


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

Inherited from BaseManipulation:

  • ClassName: name of the class as mimmo.CreateSeedsOnSurface;
  • Priority: uint marking priority in multi-chain execution;
  • PlotInExecution: plot optional result during object execution;
  • OutputPlot: set path to store optional result.

Proper of the class:

  • NPoints: total points to distribute;
  • Engine: type of distribution engine 0:Random,2:CartesianGrid,1:Levelset(NOT AVAILABLE IN MPI np>1 VERSION);
  • Seed: initial seed point coordinates (space separated);
  • MassCenterAsSeed: boolean (0/1), if true use geometry mass center as seed;
  • RandomFixed: boolean(0/1), if active it fixes distribution pattern when 0:RANDOM engine is selected, otherwise leave it changing as it likes;
  • RandomSignature: specify unsigned integer seed when RandomFixed is active. This will reproduce the same random distribution each run;
Examples
manipulators_example_00008.cpp, and utils_example_00001.cpp.

Definition at line 111 of file CreateSeedsOnSurface.hpp.

Constructor & Destructor Documentation

◆ CreateSeedsOnSurface() [1/3]

mimmo::CreateSeedsOnSurface::CreateSeedsOnSurface ( )

! raw list of interpolated sensitivities on shared points

Constructor

Definition at line 41 of file CreateSeedsOnSurface.cpp.

◆ CreateSeedsOnSurface() [2/3]

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

Custom constructor reading xml data

Parameters
[in]rootXMLreference to your xml tree section

Definition at line 57 of file CreateSeedsOnSurface.cpp.

◆ ~CreateSeedsOnSurface()

mimmo::CreateSeedsOnSurface::~CreateSeedsOnSurface ( )
virtual

Destructor;

Definition at line 82 of file CreateSeedsOnSurface.cpp.

◆ CreateSeedsOnSurface() [3/3]

mimmo::CreateSeedsOnSurface::CreateSeedsOnSurface ( const CreateSeedsOnSurface other)

Copy constructor. Retain only meaningful inputs

Parameters
[in]otherclass to copy from

Definition at line 88 of file CreateSeedsOnSurface.cpp.

Member Function Documentation

◆ absorbSectionXML()

void mimmo::CreateSeedsOnSurface::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 1389 of file CreateSeedsOnSurface.cpp.

◆ buildPorts()

void mimmo::CreateSeedsOnSurface::buildPorts ( )
virtual

It builds the input/output ports of the object

Implements mimmo::BaseManipulation.

Definition at line 135 of file CreateSeedsOnSurface.cpp.

◆ checkField()

void mimmo::CreateSeedsOnSurface::checkField ( )
protected

Check your current point data sensitivity field associated to linked geometry. Do nothing if class linked geometry is a null pointer or empty. If field geometry is not linked or empty or if field geometry its uncoherent with class linked geometry or not referred to MPVLocation point or if the field itself does not carry any value, create a default unitary field. If the field is still coherent but miss values on some geometry nodes, complete it assigning zero value on missing ids. If no exception occurs, leave the field as it is.

Definition at line 1506 of file CreateSeedsOnSurface.cpp.

◆ checkTriangulation()

bool mimmo::CreateSeedsOnSurface::checkTriangulation ( )
protected
Returns
true if the linked geometry is a homogeneous triangular 3D surface, false otherwise

Definition at line 1560 of file CreateSeedsOnSurface.cpp.

◆ clear()

void mimmo::CreateSeedsOnSurface::clear ( )

Clear input contents of the class

Definition at line 348 of file CreateSeedsOnSurface.cpp.

◆ createTriangulation()

MimmoSharedPointer< MimmoObject > mimmo::CreateSeedsOnSurface::createTriangulation ( )
protected
Returns
a homogeneous triangulated and indipendent clone of the current target geometry linked to the class. set also this new geometry to member sensitivity triangulated

Definition at line 1576 of file CreateSeedsOnSurface.cpp.

◆ execute()

void mimmo::CreateSeedsOnSurface::execute ( )
virtual

Execution command of the class. Wrapper to CreateSeedsOnSurface::solve method

Implements mimmo::BaseManipulation.

Definition at line 366 of file CreateSeedsOnSurface.cpp.

◆ flushSectionXML()

void mimmo::CreateSeedsOnSurface::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 1463 of file CreateSeedsOnSurface.cpp.

◆ getEngine()

int mimmo::CreateSeedsOnSurface::getEngine ( )

Return engine type for point distribution calculation.

Returns
engine type

Definition at line 184 of file CreateSeedsOnSurface.cpp.

◆ getEngineENUM()

CSeedSurf mimmo::CreateSeedsOnSurface::getEngineENUM ( )

Return CSeedSurf engine type for point distribution calculation.

Returns
engine type
Examples
utils_example_00001.cpp.

Definition at line 174 of file CreateSeedsOnSurface.cpp.

◆ getMinDistance()

double mimmo::CreateSeedsOnSurface::getMinDistance ( )

Return minimum absolute distance during the point distribution calculation.

Returns
minimum distance between points

Definition at line 215 of file CreateSeedsOnSurface.cpp.

◆ getNPoints()

int mimmo::CreateSeedsOnSurface::getNPoints ( )

Return number of points to be distributed over 3D surface.

Returns
number of points

Definition at line 156 of file CreateSeedsOnSurface.cpp.

◆ getPoints()

dvecarr3E mimmo::CreateSeedsOnSurface::getPoints ( )

Return list of points distributed over 3D surface, after class execution.

Returns
list of points

Definition at line 165 of file CreateSeedsOnSurface.cpp.

◆ getRandomSignature()

long mimmo::CreateSeedsOnSurface::getRandomSignature ( )

Return the signature of the current random distribution of points on target surface, whenever is fixed or not, for result replication. See setRandomFixed method. This option will only make sense if a CSeedSurf::RANDOM engine is employed. Otherwise it is ignored.

Returns
signature.
Examples
utils_example_00001.cpp.

Definition at line 237 of file CreateSeedsOnSurface.cpp.

◆ getSeed()

darray3E mimmo::CreateSeedsOnSurface::getSeed ( )

Return seed point used for calculation. If geometry baricenter is used as initial seed (see setMassCenterAsSeed), it can be correctly visualized after the execution of the object.

Returns
seed point

Definition at line 195 of file CreateSeedsOnSurface.cpp.

◆ isRandomFixed()

bool mimmo::CreateSeedsOnSurface::isRandomFixed ( )

Return true, if the option to fix Random distribution through signature is active. False otherwise. This option will only make sense if a CSeedSurf::RANDOM engine is employed.

Returns
boolean

Definition at line 226 of file CreateSeedsOnSurface.cpp.

◆ isSeedMassCenter()

bool mimmo::CreateSeedsOnSurface::isSeedMassCenter ( )

Return true, if the option to use geometry mass center as initial seed is activated. (see setMassCenterAsSeed method documentation).

Returns
mass center flag

Definition at line 205 of file CreateSeedsOnSurface.cpp.

◆ normalizeField()

void mimmo::CreateSeedsOnSurface::normalizeField ( )
protected

Normalize your current point data sensitivity field associated to linked geometry. It is assumed at this point that the field is fully coeherent, as result of checkField method check.

Definition at line 1534 of file CreateSeedsOnSurface.cpp.

◆ operator=()

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

Assignment operator

Parameters
[in]otherclass to copy from

Definition at line 105 of file CreateSeedsOnSurface.cpp.

◆ plotCloud()

void mimmo::CreateSeedsOnSurface::plotCloud ( std::string  dir,
std::string  file,
int  counter,
bool  binary 
)

Plot point distribution as *.vtu Cloud point.

Parameters
[in]dirfolder path
[in]filefile name without tag
[in]counteridentifier integer for the file
[in]binaryflag to write ASCII-false, binary-true

Definition at line 825 of file CreateSeedsOnSurface.cpp.

◆ plotOptionalResults()

void mimmo::CreateSeedsOnSurface::plotOptionalResults ( )
protectedvirtual

Plot Optional results of the class, that is the point cloud distribution on surface as a list of xyz data points w/ identifier mark and as a point cloud in *.vtu format

Reimplemented from mimmo::BaseManipulation.

Definition at line 376 of file CreateSeedsOnSurface.cpp.

◆ setEngine()

void mimmo::CreateSeedsOnSurface::setEngine ( int  eng)

Set the engine type for point distribution evaluation

Parameters
[in]engengine type passed as integer. See CSeedSurf enum.
Examples
utils_example_00001.cpp.

Definition at line 264 of file CreateSeedsOnSurface.cpp.

◆ setEngineENUM()

void mimmo::CreateSeedsOnSurface::setEngineENUM ( CSeedSurf  eng)

Set the engine type for point distribution evaluation

Parameters
[in]engengine type passed as enum CSeedSurf
Examples
manipulators_example_00008.cpp.

Definition at line 255 of file CreateSeedsOnSurface.cpp.

◆ setGeometry()

void mimmo::CreateSeedsOnSurface::setGeometry ( MimmoSharedPointer< MimmoObject geo)

Set Geometry, check if its search bvtree is built, if not, build it. Point Cloud geometries, or pure Volume meshes are currently not supported by this block. Reimplemented from BaseManipulation::setGeometry()

Parameters
[in]geopointer to target geometry
Examples
utils_example_00001.cpp.

Definition at line 297 of file CreateSeedsOnSurface.cpp.

◆ setMassCenterAsSeed()

void mimmo::CreateSeedsOnSurface::setMassCenterAsSeed ( bool  flag)

Set the starting seed point for points distribution on surface evaluation as the mass center of the surface itself. Any seed passed with setSeed method will be ignored if this option is active.

Parameters
[in]flagtrue activate the option, false deactivate it.
Examples
manipulators_example_00008.cpp.

Definition at line 286 of file CreateSeedsOnSurface.cpp.

◆ setNPoints()

void mimmo::CreateSeedsOnSurface::setNPoints ( int  val)

Set the number of points to be distributed.

Parameters
[in]valnumber of total points
Examples
manipulators_example_00008.cpp, and utils_example_00001.cpp.

Definition at line 246 of file CreateSeedsOnSurface.cpp.

◆ setRandomFixed()

void mimmo::CreateSeedsOnSurface::setRandomFixed ( bool  fix)

Activate a fixed random distribution through signature specification (see setRandomSignature). Same signature will be able to reproduce the exact random distribution in multiple runs. It is possible to get the current signature after each random execution using the getRandomSignature method. This option will only make sense if a CSeedSurf::RANDOM engine is employed. Otherwise it is ignored.

Parameters
[in]fixif true activate the options, false deactivate it.
Examples
manipulators_example_00008.cpp, and utils_example_00001.cpp.

Definition at line 316 of file CreateSeedsOnSurface.cpp.

◆ setRandomSignature()

void mimmo::CreateSeedsOnSurface::setRandomSignature ( uint32_t  signature)

Set the signature (each integer >= 0) of your fixed random distribution (activated by setRandomFixed). Same signature will be able to reproduce the exact random distribution in multiple runs. This option will only make sense if a CSeedSurf::RANDOM engine is employed. Otherwise it is ignored.

Parameters
[in]signatureunsigned integer number
Examples
manipulators_example_00008.cpp, and utils_example_00001.cpp.

Definition at line 328 of file CreateSeedsOnSurface.cpp.

◆ setSeed()

void mimmo::CreateSeedsOnSurface::setSeed ( darray3E  seed)

Set the starting seed point for points distribution on surface evaluation. The assigned seed is ignored if the geometry baricenter is set as initial seed (see setMassCenterAsSeed).

Parameters
[in]seedstarting 3D point in the neighborhood of the surface
Examples
utils_example_00001.cpp.

Definition at line 276 of file CreateSeedsOnSurface.cpp.

◆ setSensitivityMap()

void mimmo::CreateSeedsOnSurface::setSensitivityMap ( dmpvector1D field)

Set a sensitivity scalar field, referred to the target surface geometry linked, to drive points seeding onto the most sensitive part of the geometry. The sensitivity field MUST be defined on geometry vertices.

Parameters
[in]fieldsensitivity
Examples
utils_example_00001.cpp.

Definition at line 339 of file CreateSeedsOnSurface.cpp.

◆ solve()

void mimmo::CreateSeedsOnSurface::solve ( bool  debug = false)

Apply command of the class;

Parameters
[in]debugflag to activate logs of solver execution

Definition at line 386 of file CreateSeedsOnSurface.cpp.

◆ swap()

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

Swap function.

Parameters
[in]xobject to be swapped

Definition at line 114 of file CreateSeedsOnSurface.cpp.


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