core_example_00002.cpp
Example of Lattice creation.Using: Lattice.
To run : ./core_example_00002
To run (MPI version): mpirun -np X core_example_00002
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 "Lattice.hpp"
#include <bitpit_common.hpp>
// =================================================================================== //
// =================================================================================== //
void test00002() {
/*
Create a Lattice of cylindrical shape
*/
latt3->setOrigin({{0.5, 0.0, 0.0}});
latt3->setSpan({{0.75, 2.0*BITPIT_PI, 0.4}});
latt3->setInfLimits({{0.25, 0.0, 0.0}});
latt3->setRefSystem({{0,1,0}}, {{0,0,1}}, {{1,0,0}});
latt3->exec();
/*
Create a Lattice of wedge shape (prism with triangular basis)
*/
lattw->setOrigin({{1.0, 0.0, 0.0}});
lattw->setSpan({{1.0, 0.75, 0.4}});
lattw->setRefSystem(2, {{0,1,0}});
lattw->setDimension(iarray3E({{5, 5, 4}}));
lattw->setPlotInExecution(true);
lattw->exec();
/* Clean up & exit;
*/
delete lattw;
delete latt3;
return;
}
// =================================================================================== //
int main( int argc, char *argv[] ) {
BITPIT_UNUSED(argc);
BITPIT_UNUSED(argv);
#if MIMMO_ENABLE_MPI
MPI_Init(&argc, &argv);
#endif
try{
test00002();
}
catch(std::exception & e){
std::cout<<"core_example_00002 exited with an error of type : "<<e.what()<<std::endl;
return 1;
}
#if MIMMO_ENABLE_MPI
MPI_Finalize();
#endif
return 0;
}
void setRefSystem(darray3E, darray3E, darray3E)
Definition: BasicMeshes.cpp:619
void setShape(ShapeType type=ShapeType::CUBE)
Definition: BasicMeshes.cpp:713
@ WEDGE
void setPlotInExecution(bool)
Definition: BaseManipulation.cpp:443
void setInfLimits(double val, int dir)
Definition: BasicMeshes.cpp:588
@ CYLINDER