Skip to content

Commit

Permalink
[ENH] mesh.write_mesh() signal accepts fields
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Apr 23, 2012
1 parent 2c75f8c commit fa6ac0e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
20 changes: 8 additions & 12 deletions cf3/mesh/Mesh.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -300,14 +300,12 @@ void Mesh::signature_write_mesh ( SignalArgs& node)
{ {
SignalOptions options( node ); SignalOptions options( node );


options.add_option("file" , name() + ".msh" ) options.add_option("file" , URI(name() + ".msh") )
.description("File to write" ); .description("File to write" );


// boost_foreach (Field& field, find_components_recursively<Field>(*this)) std::vector<URI> fields;
// { options.add_option("fields" , fields )
// options.add_option(field.name(), false ) .description("Field paths to write");
// .description("Mark if field gets to be written");
// }
} }


//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Expand All @@ -316,10 +314,10 @@ void Mesh::signal_write_mesh ( SignalArgs& node )
{ {
SignalOptions options( node ); SignalOptions options( node );


std::string file = name()+".msh"; URI file(name()+".msh");


if (options.check("file")) if (options.check("file"))
file = options.value<std::string>("file"); file = options.value<URI>("file");


// check protocol for file loading // check protocol for file loading
// if( file.scheme() != URI::Scheme::FILE ) // if( file.scheme() != URI::Scheme::FILE )
Expand All @@ -331,10 +329,8 @@ void Mesh::signal_write_mesh ( SignalArgs& node )


std::vector<URI> fields; std::vector<URI> fields;


boost_foreach( Field& field, find_components_recursively<Field>(*this)) if (options.check("fields"))
{ fields = options.array<URI>("fields");
fields.push_back(field.uri());
}


write_mesh(fpath,fields); write_mesh(fpath,fields);
} }
Expand Down
2 changes: 0 additions & 2 deletions cf3/mesh/WriteMesh.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ void WriteMesh::write_mesh( const Mesh& mesh, const URI& file, const std::vector
writer->options().configure_option("file", filepath); writer->options().configure_option("file", filepath);


writer->execute(); writer->execute();

CFinfo << "wrote mesh in file " << filepath.string() << CFendl;
} }


//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 0 additions & 6 deletions cf3/solver/actions/PeriodicWriteMesh.hpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ namespace actions {


class solver_actions_API PeriodicWriteMesh : public solver::Action { class solver_actions_API PeriodicWriteMesh : public solver::Action {


public: // typedefs

/// pointers



public: // functions public: // functions
/// Contructor /// Contructor
/// @param name of the component /// @param name of the component
Expand Down
2 changes: 1 addition & 1 deletion plugins/sdm/test/atest-sdm-scalar-linadv-3d.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
####################################### #######################################
# SIMULATE # SIMULATE
####################################### #######################################
# model.simulate() model.simulate()


######################## ########################
# OUTPUT # OUTPUT
Expand Down

0 comments on commit fa6ac0e

Please sign in to comment.