COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Solver.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2011 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 #include <boost/algorithm/string.hpp>
8 
9 #include "common/Foreach.hpp"
10 #include "common/Log.hpp"
11 #include "common/Signal.hpp"
12 #include "common/Builder.hpp"
13 #include <common/EventHandler.hpp>
14 #include <common/PropertyList.hpp>
15 
16 #include "math/VariableManager.hpp"
18 
19 #include "math/LSS/System.hpp"
20 
21 #include "mesh/Domain.hpp"
22 #include "mesh/Mesh.hpp"
23 #include "mesh/FieldManager.hpp"
24 #include "mesh/Dictionary.hpp"
25 #include "mesh/Field.hpp"
26 #include <mesh/Space.hpp>
27 
28 #include "solver/Tags.hpp"
29 #include "solver/actions/Probe.hpp"
31 #include "solver/History.hpp"
32 
33 #include "physics/PhysModel.hpp"
34 
35 #include "InitialConditions.hpp"
36 #include "Solver.hpp"
37 #include "SparsityBuilder.hpp"
38 #include "Tags.hpp"
39 #include "WriteRestartManager.hpp"
40 
41 namespace cf3 {
42 namespace UFEM {
43 
44 using namespace common;
45 using namespace math;
46 using namespace mesh;
47 using namespace solver;
48 using namespace solver::actions;
49 using namespace solver::actions::Proto;
50 
52 
53 namespace detail
54 {
55 
58 {
59  Handle<Component> timeloop = parent.get_child("TimeLoop");
60  if(is_null(timeloop))
61  {
62  timeloop = parent.create_component("TimeLoop", "cf3.solver.actions.Iterate");
63  timeloop->create_component("CriterionTime", "cf3.solver.CriterionTime");
64  timeloop->create_component("AdvanceTime", "cf3.solver.actions.AdvanceTime");
65  timeloop->mark_basic();
66  }
67  return timeloop;
68 }
69 
70 }
71 
72 Solver::Solver(const std::string& name) :
73  SimpleSolver(name),
74  m_need_field_creation(true)
75 {
76  regist_signal( "add_direct_solver" )
77  .connect( boost::bind( &Solver::signal_add_direct_solver, this, _1 ) )
78  .description("Create a solver needing only one LSS solve")
79  .pretty_name("Create Direct Solver")
80  .signature( boost::bind ( &Solver::signature_add_solver, this, _1) );
81 
82  regist_signal( "add_unsteady_solver" )
83  .connect( boost::bind( &Solver::signal_add_unsteady_solver, this, _1 ) )
84  .description("Create an unsteady solver, solving a linear system once every time step")
85  .pretty_name("Create Unsteady Solver")
86  .signature( boost::bind ( &Solver::signature_add_solver, this, _1) );
87 
88  regist_signal( "add_unsteady_advance_solver" )
89  .connect( boost::bind( &Solver::signal_add_unsteady_solver, this, _1 ) )
90  .description("Create an unsteady solver, solving a linear system once for several time steps")
91  .pretty_name("Create Advance Unsteady Solver")
92  .signature( boost::bind ( &Solver::signature_add_solver, this, _1) );
93 
94  regist_signal( "add_iteration_solver" )
95  .connect( boost::bind( &Solver::signal_add_iteration_solver, this, _1 ) )
96  .description("Create an iteration solver, solving a linear system more than once every time step")
97  .pretty_name("Create iteration Solver")
98  .signature( boost::bind ( &Solver::signature_add_solver, this, _1) );
99 
100  regist_signal( "add_restart_writer" )
101  .connect( boost::bind( &Solver::signal_add_restart_writer, this, _1 ) )
102  .description("Create a component that writes restart information for all solvers added up to now.")
103  .pretty_name("Add restart writer");
104 
105  regist_signal( "create_initial_conditions" )
106  .connect( boost::bind( &Solver::signal_create_initial_conditions, this, _1 ) )
107  .description("Create initial conditions.")
108  .pretty_name("Create Initial Conditions");
109 
110  regist_signal( "create_fields" )
111  .connect( boost::bind( &Solver::signal_create_fields, this, _1 ) )
112  .description("Create the fields required for the solver.")
113  .pretty_name("Create Fields");
114 
115  regist_signal( "add_probe" )
116  .connect( boost::bind( &Solver::signal_add_probe, this, _1 ) )
117  .description("Add a probe to log data")
118  .pretty_name("Add Probe")
119  .signature( boost::bind ( &Solver::signature_add_probe, this, _1) );
120 
121  Core::instance().event_handler().connect_to_event("ufem_variables_added", this, &Solver::on_variables_added_event);
122 }
123 
125 {
126 }
127 
128 Handle< common::Action > Solver::add_direct_solver(const std::string& builder_name)
129 {
130  if(is_null(m_initial_conditions))
131  {
132  create_initial_conditions();
133  }
134 
135  return add_solver(builder_name, *this);
136 }
137 
138 Handle< common::Action > Solver::add_unsteady_solver(const std::string& builder_name)
139 {
140  if(is_null(m_initial_conditions))
141  {
142  create_initial_conditions();
143  }
144 
146  std::vector< boost::shared_ptr<Component> > removed_components;
147  BOOST_FOREACH(Component& comp, *timeloop)
148  {
149  if(comp.name() == "AdvanceTime" || !removed_components.empty())
150  removed_components.push_back(timeloop->remove_component(comp.name()));
151  }
152 
153  // insert new component before the AdvanceTime
154  Handle<common::Action> result = add_solver(builder_name, *timeloop);
155 
156  // add back AdvanceTime and anything after it
157  BOOST_FOREACH(const boost::shared_ptr<Component> comp, removed_components)
158  {
159  timeloop->add_component(comp);
160  }
161 
162  return result;
163 }
164 
165 Handle< common::Action > Solver::add_unsteady_advance_solver(const std::string& builder_name)
166 {
167  if(is_null(m_initial_conditions))
168  {
169  create_initial_conditions();
170  }
171 
172  Handle<Component> timeloop = get_child("TimeLoop");
173  if(is_null(timeloop))
174  {
175  timeloop = create_component("TimeLoop", "cf3.solver.actions.Iterate");
176  timeloop->mark_basic();
177  timeloop->create_component("CriterionTime", "cf3.solver.CriterionTime");
178  timeloop->create_component("SelfIteration","cf3.solver.actions.Iterate")->mark_basic();
179  }
180  else
181  {
182  timeloop->remove_component("AdvanceTime");
183  }
184 
185  Handle<Component> selfiteration = timeloop->get_child("SelfIteration");
186  cf3_assert(is_not_null(selfiteration));
187 
188  Handle<common::Action> result = add_solver(builder_name, *timeloop);
189 
190  timeloop->create_component("AdvanceTime", "cf3.solver.actions.AdvanceTime");
191 
192  return result;
193 }
194 
195 Handle< common::Action > Solver::add_iteration_solver(const std::string& builder_name) // the add_iteration_solver for inner itarations in case of a coupling between two solvers
196 {
197  if(is_null(m_initial_conditions))
198  {
199  create_initial_conditions();
200  }
201 
202  Handle<Component> timeloop = get_child("TimeLoop");
203  if(is_null(timeloop))
204  {
205  timeloop = create_component("TimeLoop", "cf3.solver.actions.Iterate");
206  timeloop->mark_basic(); //mark_basic to make it visible in python; there, a dot replaces the get child method
207  timeloop->create_component("CriterionTime", "cf3.solver.CriterionTime");
208  timeloop->create_component("CouplingIteration","cf3.solver.actions.Iterate")->mark_basic();
209  timeloop->create_component("AdvanceTime", "cf3.solver.actions.AdvanceTime");
210  }
211 
212  Handle<Component> coupling = timeloop->get_child("CouplingIteration");
213  if(is_null(coupling))
214  {
215  boost::shared_ptr<Component> advance_time = timeloop->remove_component("AdvanceTime");
216  coupling = timeloop->create_component("CouplingIteration","cf3.solver.actions.Iterate");
217  coupling->mark_basic();
218  timeloop->add_component(advance_time);
219  }
220  cf3_assert(is_not_null(coupling));
221 
222  Handle<common::Action> result = add_solver(builder_name, *coupling);
223 
224  return result;
225 }
226 
227 Handle< common::Action > Solver::add_restart_writer()
228 {
229  std::vector<std::string> field_tags;
230  BOOST_FOREACH(const common::Action& action, common::find_components_recursively<common::Action>(*this))
231  {
232  if(action.properties().check("restart_field_tags"))
233  {
234  const std::vector<std::string> restart_field_tags = action.properties().value< std::vector<std::string> >("restart_field_tags");
235  field_tags.insert(field_tags.end(), restart_field_tags.begin(), restart_field_tags.end());
236  }
237  }
238 
239  Handle<common::Action> writer = add_solver("cf3.UFEM.WriteRestartManager", *detail::timeloop(*this));
240  writer->options().set("field_tags", field_tags);
241  if(!m_need_field_creation)
242  writer->options().set("mesh", m_mesh);
243 
244  return writer;
245 }
246 
247 
248 Handle<InitialConditions> Solver::create_initial_conditions()
249 {
250  if(is_not_null(m_initial_conditions))
251  {
252  CFwarn << "InitialConditions were created already, returning handle to previously created component" << CFendl;
253  return m_initial_conditions;
254  }
255 
256  m_initial_conditions = create_component<InitialConditions>("InitialConditions");
258  m_initial_conditions->configure_option_recursively(solver::Tags::physical_model(), m_physics);
259 
260  m_initial_conditions->mark_basic();
261 
262  return m_initial_conditions;
263 }
264 
265 void Solver::signature_add_solver(SignalArgs& args)
266 {
267  SignalOptions options(args);
268  options.add("builder_name", "")
269  .pretty_name("Builder Names")
270  .description("List the names of the builders that should be used to construct inner actions");
271 }
272 
273 void Solver::signal_add_direct_solver(SignalArgs& args)
274 {
275  SignalOptions options(args);
276  Handle<common::Action> result = add_direct_solver(options.option("builder_name").value<std::string>());
277 
278  SignalFrame reply = args.create_reply(uri());
279  SignalOptions reply_options(reply);
280  reply_options.add("created_component", result->uri());
281 }
282 
283 void Solver::signal_add_unsteady_solver(SignalArgs& args)
284 {
285  SignalOptions options(args);
286  Handle<common::Action> result = add_unsteady_solver(options.option("builder_name").value<std::string>());
287 
288  SignalFrame reply = args.create_reply(uri());
289  SignalOptions reply_options(reply);
290  reply_options.add("created_component", result->uri());
291 }
292 
293 void Solver::signal_add_unsteady_advance_solver(SignalArgs& args)
294 {
295  SignalOptions options(args);
296  Handle<common::Action> result = add_unsteady_advance_solver(options.option("builder_name").value<std::string>());
297 
298  SignalFrame reply = args.create_reply(uri());
299  SignalOptions reply_options(reply);
300  reply_options.add("created_component", result->uri());
301 }
302 
303 void Solver::signal_add_iteration_solver(SignalArgs& args)
304 {
305  SignalOptions options(args);
306  Handle<common::Action> result = add_iteration_solver(options.option("builder_name").value<std::string>());
307 
308  SignalFrame reply = args.create_reply(uri());
309  SignalOptions reply_options(reply);
310  reply_options.add("created_component", result->uri());
311 }
312 
313 void Solver::signal_add_restart_writer ( SignalArgs& args )
314 {
315  SignalOptions options(args);
316  Handle<common::Action> result = add_restart_writer();
317 
318  SignalFrame reply = args.create_reply(uri());
319  SignalOptions reply_options(reply);
320  reply_options.add("created_component", result->uri());
321 }
322 
323 
324 void Solver::signal_create_initial_conditions(SignalArgs& args)
325 {
326  Handle<common::ActionDirector> ic = create_initial_conditions();
327 
328  SignalFrame reply = args.create_reply(uri());
329  SignalOptions reply_options(reply);
330  reply_options.add("created_component", ic->uri());
331 }
332 
333 void Solver::signal_create_fields(SignalArgs& args)
334 {
335  create_fields();
336 }
337 
338 
340 {
342  mesh_changed(mesh);
343 }
344 
345 
346 void Solver::mesh_changed(Mesh& mesh)
347 {
348  m_need_field_creation = true;
349 }
350 
351 void Solver::on_variables_added_event(SignalArgs& args)
352 {
353  // TODO: Check if the event comes from one of our children
354  CFdebug << "UFEM::Solver: Reacting to ufem_variables_added event" << CFendl;
355  m_need_field_creation = true;
356 }
357 
358 void Solver::create_fields()
359 {
360  if(!m_need_field_creation)
361  return;
362 
363  if(is_null(m_mesh))
364  return;
365 
366  // Reset comm patterns in case they became invalid
367  BOOST_FOREACH(Dictionary& dict, find_components_recursively<Dictionary>(*m_mesh))
368  {
369  if(is_not_null(dict.get_child("CommPattern")))
370  {
371  dict.remove_component("CommPattern");
372  }
373  }
374 
375  // Find out what tags are used
376  std::map<std::string, std::string> tags;
377  BOOST_FOREACH(const ProtoAction& action, find_components_recursively<ProtoAction>(*this))
378  {
379  CFdebug << "adding field info from ProtoAction " << action.uri().path() << CFendl;
380  action.insert_field_info(tags);
381  }
382 
383  // Create fields as needed
384  for(std::map<std::string, std::string>::const_iterator it = tags.begin(); it != tags.end(); ++it)
385  {
386  const std::string& tag = it->first;
387  const std::string& space_lib_name = it->second;
388 
389  // Find the dictionary
390  Handle<Dictionary> dict;
391  if(space_lib_name == "geometry")
392  {
393  dict = mesh().geometry_fields().handle<Dictionary>();
394  }
395  else
396  {
397  BOOST_FOREACH(Dictionary& tagged_dict, find_components_recursively_with_tag<Dictionary>(mesh(), "ufem_dict"))
398  {
399  if(tagged_dict.spaces().empty())
400  {
401  CFwarn << "Found empty dict while looking for dictionaries with tag ufem_dict" << CFendl;
402  continue;
403  }
404  const std::string sf_name = tagged_dict.spaces().front()->shape_function().derived_type_name();
405  if(boost::algorithm::starts_with(sf_name, space_lib_name))
406  {
407  if(is_null(dict))
408  {
409  CFinfo << "Found ufem_dict " << tagged_dict.uri().path() << CFendl;
410  dict = tagged_dict.handle<Dictionary>();
411  }
412  else
413  {
414  CFwarn << "Duplicate ufem_dict " << tagged_dict.uri().path() << " ignored." << CFendl;
415  }
416  }
417  }
418  }
419 
420  // If the dictionary is not found, create it
421  if(is_null(dict))
422  {
423  // Special case of P0: create a discontinuous space
424  if(boost::ends_with(space_lib_name, "P0"))
425  {
426  dict = mesh().create_discontinuous_space(space_lib_name, space_lib_name).handle<Dictionary>();
427  }
428  else
429  {
430  dict = mesh().create_continuous_space(space_lib_name, space_lib_name).handle<Dictionary>();
431  }
432  dict->add_tag("ufem_dict");
433  CFinfo << "Created ufem_dict " << dict->uri().path() << CFendl;
434  }
435 
436  cf3_assert(is_not_null(dict));
437 
438  // We also tag the dict now, so the proto code can find it
439  if(!dict->has_tag(tag))
440  dict->add_tag(tag);
441 
442  Handle< Field > field = find_component_ptr_with_tag<Field>(*dict, tag);
443 
444  // Create the field
445  field_manager().create_field(tag, *dict);
446  field = find_component_ptr_with_tag<Field>(*dict, tag);
447  cf3_assert(is_not_null(field));
448 
449  // Parallelize
450  if(common::PE::Comm::instance().is_active())
451  {
452  CFdebug << "parallelizing field " << field->uri().path() << CFendl;
453  field->parallelize_with(dict->comm_pattern());
454  }
455  }
456 
457  BOOST_FOREACH(WriteRestartManager& writer, common::find_components_recursively<WriteRestartManager>(*this))
458  {
459  writer.options().set("mesh", m_mesh);
460  }
461 
462  m_need_field_creation = false;
463 }
464 
465 Handle< common::Action > Solver::add_solver(const std::string& builder_name, Component& parent)
466 {
467  std::vector<std::string> builder_parts;
468  boost::split(builder_parts, builder_name, boost::is_any_of("."));
469  Handle< common::Action > result(parent.create_component(builder_parts.back(), builder_name));
470 
471  if(is_null(result))
472  throw common::SetupError(FromHere(), "Something went wrong constructing a solver with builder " + builder_name);
473 
475  result->configure_option_recursively(solver::Tags::physical_model(), m_physics);
476 
477  result->configure_option_recursively("initial_conditions", m_initial_conditions);
478 
479  return result;
480 }
481 
482 Handle< Probe > Solver::add_probe ( const std::string& name, Component& parent, const Handle<Dictionary>& dict)
483 {
484  Handle<Probe> probe = parent.create_component<Probe>(name);
485  if(is_null(dict))
486  {
487  probe->options().set("dict", mesh().geometry_fields().handle<Dictionary>());
488  }
489  else
490  {
491  probe->options().set("dict", dict);
492  }
493  Handle<ProbePostProcessor> pp = probe->create_post_processor("Log","cf3.solver.actions.ProbePostProcHistory");
494  pp->mark_basic();
495 
496  Handle<History> hist = probe->create_component<History>("History");
497  hist->options().set("dimension",1u);
498  hist->mark_basic();
499 
500  pp->options().set("history", hist);
501 
502  return probe;
503 }
504 
505 void Solver::signal_add_probe ( SignalArgs& args )
506 {
507  SignalOptions options(args);
508  Handle<Dictionary> dict;
509  if(options.check("dict"))
510  dict = Handle<Dictionary>(options.option("dict").value< Handle<Component> >());
511 
512  const std::string name = options.option("name").value<std::string>();
513 
514  Handle<Component> parent = options.option("parent").value< Handle<Component> >();
515  if(is_null(parent))
516  throw common::SetupError(FromHere(), "Invalid parent component supplied when adding probe " + name);
517 
518  Handle<Probe> probe = add_probe(name, *parent, dict);
519 
520  SignalFrame reply = args.create_reply(uri());
521  SignalOptions reply_options(reply);
522  reply_options.add("created_component", probe->uri());
523 }
524 
525 void Solver::signature_add_probe ( SignalArgs& args )
526 {
527  SignalOptions options(args);
528  options.add("name", "SomeProbe").pretty_name("Name").description("Name of the probe to add").mark_basic();
529  options.add("parent", Handle<Component>()).pretty_name("Parent").description("Component that will be the parent of the probe").mark_basic();
530  options.add("dict", Handle<Component>()).pretty_name("Dictionary").description("Dictionary to use for the fields");
531 }
532 
533 
534 
536 {
537  create_fields();
539  if(comm.is_active())
540  {
541  Uint nb_owned_nodes = 0;
542  Uint nb_ghost_nodes = 0;
543  BOOST_FOREACH(const Uint rank, mesh().geometry_fields().rank().array())
544  {
545  if(rank == comm.rank())
546  ++nb_owned_nodes;
547  else
548  ++nb_ghost_nodes;
549  }
550 
551  std::vector<Uint> owned_recv;
552  std::vector<Uint> ghost_recv;
553 
554  comm.all_gather(nb_owned_nodes, owned_recv);
555  comm.all_gather(nb_ghost_nodes, ghost_recv);
556  if(comm.rank() == 0)
557  {
558  const Uint total_nb_owned = std::accumulate(owned_recv.begin(),owned_recv.end(),0);
559  CFinfo << "Parallel node distribution:" << CFendl;
560  Uint min_nb_nodes = nb_owned_nodes;
561  Uint max_nb_nodes = 0;
562  for(Uint i = 0; i != comm.size(); ++i)
563  {
564  min_nb_nodes = owned_recv[i] < min_nb_nodes ? owned_recv[i] : min_nb_nodes;
565  max_nb_nodes = owned_recv[i] > max_nb_nodes ? owned_recv[i] : max_nb_nodes;
566  CFinfo << " rank " << i << ": " << owned_recv[i] << " nodes (" << static_cast<Real>(owned_recv[i]) / static_cast<Real>(total_nb_owned)*100. << "%) with " << ghost_recv[i] << " ghosts" << CFendl;
567  }
568  CFinfo << " maximum: " << max_nb_nodes << "(" << static_cast<Real>(max_nb_nodes) / static_cast<Real>(total_nb_owned)*100. << "%), minimum: " << min_nb_nodes << "(" << static_cast<Real>(min_nb_nodes) / static_cast<Real>(total_nb_owned)*100. << "%)" << CFendl;
569  }
570  }
571  else
572  {
573  CFinfo << "Running the solver over a mesh with " << mesh().geometry_fields().size() << " nodes." << CFendl;
574  }
576 }
577 
578 
579 } // UFEM
580 } // cf3
Probe to interpolate field values to a given coordinate.
Definition: Probe.hpp:32
#define CFinfo
these are always defined
Definition: Log.hpp:104
Handle< Component > timeloop(Component &parent)
Get the timeloop, creating it if needed.
Definition: Solver.cpp:57
Abstracts the use of XML when adding options to a signal frame.
std::string name(ComponentWrapper &self)
bool is_null(T ptr)
predicate for comparison to nullptr
Definition: CF.hpp:151
Safe pointer to an object. This is the supported method for referring to components.
Definition: Handle.hpp:39
Helper class to create the Builder and place it in the factory.
Definition: Builder.hpp:212
This header collects all the headers needed for the linear system solver, also including configure-ti...
Class to encapsulate Proto actions.
Definition: ProtoAction.hpp:26
std::string path() const
Definition: URI.cpp:253
mesh::FieldManager & field_manager()
Access to the FieldManager, which is a static subcomponent of Solver.
Definition: Solver.cpp:115
Stores History of variables.
Definition: History.hpp:57
#define cf3_assert(a)
Definition: Assertions.hpp:93
Handle< physics::PhysModel > m_physics
Raw access to the physics.
Definition: Solver.hpp:64
URI uri() const
Construct the full path.
Definition: Component.cpp:248
const std::string & name() const
Access the name of the component.
Definition: Component.hpp:146
void insert_field_info(std::map< std::string, std::string > &tags) const
Append the tags used in the expression.
#define CFendl
Definition: Log.hpp:109
Uint rank() const
Return rank, additionally, if is_init==0.
Definition: Comm.cpp:135
SignalFrame create_reply(const URI &sender=URI())
const std::vector< Handle< Space > > & spaces() const
Definition: Dictionary.cpp:360
Uint size() const
Return the number of processes, or 1 if is_init==0.
Definition: Comm.cpp:145
Manages a set of maps.
Definition: SignalFrame.hpp:31
bool check(const std::string &prop_name) const
common::ComponentBuilder< UFEM::Solver, solver::Solver, LibUFEM > UFEMSolver_Builder
Definition: Solver.cpp:51
bool is_active() const
Definition: Comm.hpp:83
PropertyList & properties()
Definition: Component.cpp:842
Handle< Component > parent() const
Definition: Component.cpp:256
TYPE value(const std::string &pname) const
Signal * connect_to_event(const std::string &sname, PTYPE *ptr, FTYPE pfunc)
Regists a signal on this EventHandler.
Handle< Component > get_child(const std::string &name)
Definition: Component.cpp:441
Top-level namespace for coolfluid.
Definition: Action.cpp:18
#define CFwarn
Definition: Log.hpp:106
Solver(const std::string &name)
Definition: Solver.cpp:78
Component that executes an action. Implementation of the IAction interface as a component, exposing the execute function as a signal.
Definition: Action.hpp:21
common::EventHandler & event_handler() const
Definition: Core.cpp:153
boost::shared_ptr< Component > remove_component(const std::string &name)
Remove a (sub)component of this component.
Definition: Component.cpp:357
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
bool check(const std::string &opt_name) const
Definition: OptionList.hpp:111
virtual void mesh_loaded(mesh::Mesh &mesh)
Called when a mesh is loaded into the domain that is associated with this solver. ...
Definition: Solver.cpp:111
virtual ~Solver()
Virtual destructor.
Definition: Solver.cpp:106
static Core & instance()
Definition: Core.cpp:37
virtual void mesh_changed(mesh::Mesh &mesh)
Called when a mesh is changed into the domain that is associated with this solver.
Definition: Solver.cpp:113
Handle< Component > handle()
Get a handle to the component.
Definition: Component.hpp:179
void create_field(const std::string &tag, cf3::mesh::Dictionary &dict)
Create fields. Looks up the VariablesDescriptor with the given tag, and creates a field with the same...
virtual void execute()
Execute all active child actions.
Helper class to manage the writing of restart files.
OptionList & options()
Definition: Component.cpp:856
SelectOptionType< T >::type & add(const std::string &name, const T &default_value=T())
Definition: OptionList.hpp:45
#define CFdebug
Definition: Log.hpp:107
static Comm & instance()
Return a reference to the current PE.
Definition: Comm.cpp:44
virtual void mesh_loaded(mesh::Mesh &mesh)
Base class for defining CF components.
Definition: Component.hpp:82
void set(const std::string &pname, const boost::any &val)
Definition: OptionList.cpp:132
TYPE value() const
Casts the value to the provided TYPE.
Definition: Option.hpp:100
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
const Option & option(const std::string &pname) const
get a constant option from the list
Definition: OptionList.cpp:52
T * all_gather(const T *in_values, const int in_n, T *out_values, const int stride=1)
Definition: Comm.hpp:192
bool is_not_null(T ptr)
predicate for comparison to nullptr
Definition: CF.hpp:147
#define FromHere()
Send comments to:
COOLFluiD Web Admin