Update Boundary Conditions authored by Alain O' Miniussi's avatar Alain O' Miniussi
...@@ -67,6 +67,36 @@ In a carefully chosen source file ([src/D3/boundariesConditions.cpp](https://git ...@@ -67,6 +67,36 @@ In a carefully chosen source file ([src/D3/boundariesConditions.cpp](https://git
``` ```
You're done. You're done.
## Passing parameters
Parameters can be passed from the configuration file to the boundary condition code as a `key->value` map:
```
Disk {
....
Boundaries parrot
{
type "Norvegian Blue"
voltage 25000.0
alive false
}
....
}
```
They will be made available to the code through a [std::map](http://www.cplusplus.com/reference/map/map/):
```
void
PetChopBC(GasDisk& gas, real dt) {
using namespace std;
map<string, string> const& params = gas.physic().boundaries.params;
real voltage = boost::lexical_cast<real>(attrs["voltage"];
bool alive = boost::lexical_cast<real>(attrs["voltage"];
...
}
```
## Tips ## Tips
### Factorize ### Factorize
... ...
......