9 #include <boost/assign/list_of.hpp>
54 BOOST_FOREACH(
const Region& region, common::find_components<Region>(parent))
59 BOOST_FOREACH(
const Entities& elements, common::find_components<Entities>(region))
70 using namespace common;
74 boost::shared_ptr< Table<Uint> > conn = allocate_component< Table<Uint> >(
"tmp");
75 conn->set_row_size( 2*cols );
89 using namespace common;
93 boost::shared_ptr< Table<Uint> > conn = allocate_component< Table<Uint> >(
"tmp");
94 conn->set_row_size( 2*cols );
112 using namespace common;
116 boost::shared_ptr< Table<Uint> > conn = allocate_component< Table<Uint> >(
"tmp");
117 conn->set_row_size( 2*cols );
118 conn->resize( rows );
138 periodic_node.
set_attribute(
"periodic_link", boost::replace_first_copy(periodic_link->follow()->uri().path(), root_path,
""));
151 BOOST_FOREACH(
const std::string& tag, field.
get_tags())
168 std::vector<std::string> extensions;
169 extensions.push_back(
".cf3mesh");
179 const std::string mesh_path = mesh.
uri().
path() +
"/";
182 boost::shared_ptr<common::BinaryDataWriter> data_writer = common::allocate_component<common::BinaryDataWriter>(
"DataWriter");
184 data_writer->options().set(
"file", binfile);
194 BOOST_FOREACH(
const Dictionary& dictionary, common::find_components<Dictionary>(mesh))
196 if(dictionary.
spaces().empty())
198 CFwarn <<
"Dictionary " << dictionary.
name() <<
" with no spaces will not be written" <<
CFendl;
205 std::string space_lib_name;
206 BOOST_FOREACH(
const Field& field, common::find_components<Field>(dictionary))
215 std::string entities_path = entities->uri().path();
216 boost::erase_first(entities_path, mesh_path);
220 if(space_lib_name.empty())
222 std::string sf_name = entities->space(dictionary).shape_function().derived_type_name();
223 std::vector<std::string> name_parts;
224 boost::split(name_parts, sf_name, boost::is_any_of(
"."));
225 space_lib_name = name_parts.front();
226 for(
Uint i = 1; i != name_parts.size()-1; ++i)
227 space_lib_name +=
"." + name_parts[i];
234 if(dictionary.
has_tag(mesh::Tags::geometry()))
Writer(const std::string &name)
constructor
std::string name(ComponentWrapper &self)
XmlNode add_node(const std::string &name, const std::string &value=std::string()) const
void to_file(const XmlNode &node, const URI &file)
virtual std::vector< std::string > get_extensions()
const std::vector< Handle< Entities > > & entities_range() const
Safe pointer to an object. This is the supported method for referring to components.
Helper class to create the Builder and place it in the factory.
virtual std::string derived_type_name() const =0
Handle< Mesh const > m_mesh
Handle to configured mesh.
std::string base_name() const
Filename without extension.
ElementType & element_type() const
return the elementType
URI uri() const
Construct the full path.
common::List< Uint > & rank()
Return the rank of every field row.
void write_field(common::XML::XmlNode node, const mesh::Field &field, common::BinaryDataWriter &writer)
const std::string & name() const
Access the name of the component.
common::List< Uint > & rank()
common::URI m_file_path
File path to be configured.
Uint append_data(const Table< T > &table)
Append a new data block containing data from the supplied table. An index into the current file is re...
Uint rank() const
Return rank, additionally, if is_init==0.
Conversions from and to std::string.
Real e()
Definition of the Unit charge [C].
const std::vector< Handle< Space > > & spaces() const
Common_API std::string to_str(const T &v)
Converts to std::string.
Uint size() const
Return the number of processes, or 1 if is_init==0.
#define cf3_always_assert(a)
common::List< Uint > & glb_idx()
Mutable access to the list of nodes.
Handle< ElementConnectivity > & connectivity_cell2cell()
void set_attribute(const std::string &name, const std::string &value)
Handle< Component > get_child(const std::string &name)
Top-level namespace for coolfluid.
common::List< Uint > & glb_idx()
Return the global index of every field row.
Handle< ElementConnectivity > & connectivity_cell2face()
std::vector< std::string > get_tags() const
std::string description() const
Get the string description for all the variables.
unsigned int Uint
typedef for unsigned int
bool has_tag(const std::string &tag) const
Uint entities_idx() const
common::ComponentBuilder< cf3mesh::Writer, MeshWriter, LibCF3Mesh > aCF3MeshWriter_Builder
void write_regions(common::XML::XmlNode &node, const common::Component &parent, common::BinaryDataWriter &writer, const std::string &root_path)
Region & topology() const
math::VariablesDescriptor & descriptor() const
Handle< FaceCellConnectivity > & connectivity_face2cell()
static Comm & instance()
Return a reference to the current PE.
Base class for defining CF components.
Component for writing binary data collected into a single file.
bool is_not_null(T ptr)
predicate for comparison to nullptr