COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-vtkxml-writer.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 cf3::mesh::tecplot::Writer"
9 
10 #include <boost/test/unit_test.hpp>
11 
12 #include "common/List.hpp"
13 #include "common/Log.hpp"
14 #include "common/Core.hpp"
15 #include "common/OptionList.hpp"
17 #include "common/OptionArray.hpp"
18 #include "common/OptionURI.hpp"
19 #include "mesh/MeshWriter.hpp"
20 
22 
23 #include "common/List.hpp"
24 #include "common/Table.hpp"
25 #include "mesh/Dictionary.hpp"
26 #include "mesh/Field.hpp"
27 
28 using namespace cf3;
29 using namespace cf3::mesh;
30 using namespace cf3::common;
31 
33 
34 BOOST_AUTO_TEST_SUITE( VTKXMLSuite )
35 
36 
39 {
41 
42  Handle<Mesh> mesh = root.create_component<Mesh>("mesh");
43  Tools::MeshGeneration::create_rectangle(*mesh, 5., 5., 5, 5);
44 
45  boost::shared_ptr< MeshWriter > vtk_writer = build_component_abstract_type<MeshWriter>("cf3.mesh.VTKXML.Writer","meshwriter");
46 
47  std::vector<URI> fields; fields.push_back(mesh->geometry_fields().coordinates().uri());
48  vtk_writer->options().set("fields",fields);
49  vtk_writer->options().set("mesh",mesh);
50  vtk_writer->options().set("file",URI("grid.vtu"));
51  vtk_writer->execute();
52 
53  BOOST_CHECK(true);
54 }
55 
57 
58 BOOST_AUTO_TEST_SUITE_END()
59 
60 
URI uri() const
Construct the full path.
Definition: Component.cpp:248
const Field & coordinates() const
Definition: Dictionary.cpp:481
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.
BOOST_AUTO_TEST_CASE(WriteGrid)
Basic Classes for Mesh applications used by COOLFluiD.
Top-level namespace for coolfluid.
Definition: Action.cpp:18
std::vector< URI > fields
common::Component & root() const
Gives the default root component.
Definition: Core.cpp:145
static Core & instance()
Definition: Core.cpp:37
Dictionary & geometry_fields() const
Definition: Mesh.cpp:339
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