Permalink
Browse files

[ENH] mesh.write_mesh() signal accepts fields

  • Loading branch information...
1 parent 2c75f8c commit fa6ac0ed980035313de20d8c63777a01b58c938b @wdeconinck wdeconinck committed Apr 23, 2012
View
20 cf3/mesh/Mesh.cpp
@@ -300,14 +300,12 @@ void Mesh::signature_write_mesh ( SignalArgs& node)
{
SignalOptions options( node );
- options.add_option("file" , name() + ".msh" )
+ options.add_option("file" , URI(name() + ".msh") )
.description("File to write" );
-// boost_foreach (Field& field, find_components_recursively<Field>(*this))
-// {
-// options.add_option(field.name(), false )
-// .description("Mark if field gets to be written");
-// }
+ std::vector<URI> fields;
+ options.add_option("fields" , fields )
+ .description("Field paths to write");
}
////////////////////////////////////////////////////////////////////////////////
@@ -316,10 +314,10 @@ void Mesh::signal_write_mesh ( SignalArgs& node )
{
SignalOptions options( node );
- std::string file = name()+".msh";
+ URI file(name()+".msh");
if (options.check("file"))
- file = options.value<std::string>("file");
+ file = options.value<URI>("file");
// check protocol for file loading
// if( file.scheme() != URI::Scheme::FILE )
@@ -331,10 +329,8 @@ void Mesh::signal_write_mesh ( SignalArgs& node )
std::vector<URI> fields;
- boost_foreach( Field& field, find_components_recursively<Field>(*this))
- {
- fields.push_back(field.uri());
- }
+ if (options.check("fields"))
+ fields = options.array<URI>("fields");
write_mesh(fpath,fields);
}
View
2 cf3/mesh/WriteMesh.cpp
@@ -234,8 +234,6 @@ void WriteMesh::write_mesh( const Mesh& mesh, const URI& file, const std::vector
writer->options().configure_option("file", filepath);
writer->execute();
-
- CFinfo << "wrote mesh in file " << filepath.string() << CFendl;
}
////////////////////////////////////////////////////////////////////////////////
View
6 cf3/solver/actions/PeriodicWriteMesh.hpp
@@ -19,12 +19,6 @@ namespace actions {
class solver_actions_API PeriodicWriteMesh : public solver::Action {
-public: // typedefs
-
- /// pointers
-
-
-
public: // functions
/// Contructor
/// @param name of the component
View
2 plugins/sdm/test/atest-sdm-scalar-linadv-3d.py
@@ -81,7 +81,7 @@
#######################################
# SIMULATE
#######################################
-# model.simulate()
+model.simulate()
########################
# OUTPUT

0 comments on commit fa6ac0e

Please sign in to comment.