COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-mesh-generation.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for the mesh generators"
9 
10 #include <boost/assign/list_of.hpp>
11 #include <boost/test/unit_test.hpp>
12 
13 #include "common/Core.hpp"
14 
15 #include "common/LibLoader.hpp"
16 #include "common/OSystem.hpp"
17 
18 #include "mesh/MeshWriter.hpp"
19 
21 
22 using namespace cf3;
23 using namespace cf3::common;
24 using namespace cf3::mesh;
25 
26 BOOST_AUTO_TEST_SUITE( MeshGenerationSuite )
27 
28 BOOST_AUTO_TEST_CASE( CreateGrid )
30 {
31  // Setup document structure and mesh
33 
34  Handle<Mesh> mesh = root.create_component<Mesh>("mesh");
35  Tools::MeshGeneration::create_rectangle(*mesh, 10., 5., 5, 5);
36 
37  boost::shared_ptr<MeshWriter> writer = build_component_abstract_type<MeshWriter>("cf3.mesh.gmsh.Writer","meshwriter");
38  root.add_component(writer);
39  writer->write_from_to(*mesh, "grid_2d.msh");
40 }
41 
42 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(CreateGrid)
Test creation of a 2D grid.
tuple root
Definition: coolfluid.py:24
void create_rectangle(Mesh &mesh, const Real x_len, const Real y_len, const Uint x_segments, const Uint y_segments)
Create a rectangular, 2D, quad-only mesh. No buffer for creation.
Basic Classes for Mesh applications used by COOLFluiD.
Component & add_component(const boost::shared_ptr< Component > &subcomp)
Add the passed component as a subcomponent.
Definition: Component.cpp:289
Top-level namespace for coolfluid.
Definition: Action.cpp:18
common::Component & root() const
Gives the default root component.
Definition: Core.cpp:145
static Core & instance()
Definition: Core.cpp:37
Base class for defining CF components.
Definition: Component.hpp:82
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Definition: Component.cpp:568
Most basic kernel library.
Definition: Action.cpp:19
Send comments to:
COOLFluiD Web Admin