genericinput_example_00001.cpp
Example of reading/writing a generic csv file of raw data.Using: GenericInput, GenericOutput, Chain
To run : ./genericinput_example_00001
To run (MPI Version): mpirun -np X genericinput_example_00001
visit: mimmo website
/*---------------------------------------------------------------------------*\
*
* mimmo
*
* Copyright (C) 2015-2021 OPTIMAD engineering Srl
*
* -------------------------------------------------------------------------
* License
* This file is part of mimmo.
*
* mimmo is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License v3 (LGPL)
* as published by the Free Software Foundation.
*
* mimmo is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with mimmo. If not, see <http://www.gnu.org/licenses/>.
*
\ *---------------------------------------------------------------------------*/
#include "mimmo_iogeneric.hpp"
// =================================================================================== //
void test00001() {
/*
Creation of Generic output block to read a set of
point coordinates from point cloud as generic input in csv format.
*/
/*
Creation of Generic output block to write a set of
point cloud coordinates as generic output in csv format.
*/
/*
Define connection between read and write block, that is the list of point
coordinates.
*/
/*
Define the execution chain and push the interested block into it.
*/
mimmo::Chain ch0;
ch0.addObject(read);
ch0.addObject(write);
/*
Execute the chain.
Use debug flag true to print out log info on execution.
*/
/*
Clean up & exit;
*/
delete read;
delete write;
}
// =================================================================================== //
int main( int argc, char *argv[] ) {
BITPIT_UNUSED(argc);
BITPIT_UNUSED(argv);
#if MIMMO_ENABLE_MPI
MPI_Init(&argc, &argv);
#endif
try{
test00001();
}
catch(std::exception & e){
std::cout<<"genericinput_example_00001 exited with an error of type : "<<e.what()<<std::endl;
return 1;
}
#if MIMMO_ENABLE_MPI
MPI_Finalize();
#endif
return 0;
}
Chain is the class used to manage the chain execution of multiple executable blocks (manipulation obj...
Definition: Chain.hpp:48
void setFilename(std::string filename)
Definition: GenericOutput.cpp:134
GenericOutput is the class that write generic data in a file output.
Definition: GenericOutput.hpp:109
GenericInput is the class that set the initialization of a generic input data.
Definition: GenericInput.hpp:110
bool addPin(BaseManipulation *objSend, BaseManipulation *objRec, PortID portS, PortID portR, bool forced)
Definition: MimmoNamespace.cpp:68
void setReadFromFile(bool readFromFile)
Definition: GenericInput.cpp:123
void setFilename(std::string filename)
Definition: GenericInput.cpp:131