@@ -26,4 +26,36 @@ Adding a new boundary condition is a 2 step process, you need to:
...
@@ -26,4 +26,36 @@ Adding a new boundary condition is a 2 step process, you need to:
### Implementing a stateless boundaries condition
### Implementing a stateless boundaries condition
Then invoked, a stateless boundary condition does not remember anything from its previous invocation,
Then invoked, a stateless boundary condition does not remember anything from its previous invocations.
\ No newline at end of file
One way of implementing such condition is to define a new function:
```
using namespace fargOCA; // if necessary
void
SomeGreatBC(GasDisk& gas, real dt) {
do whatever need to be done to the gas object.
}
```
You can have a look to the already implemented conditions in [src/boundariesConditions.cpp](https://gitlab.oca.eu/DISC/fargOCA/blob/master/src/boundariesConditions.cpp): `ComputeReflectingZ`, `OpenBoundaryR` etc.
### Declaring a stateless boundaries condition
Let say you want to make your new condition available under the name "someGreatBC":
In a carefully chosen source file ([src/boundariesConditions.cpp](https://gitlab.oca.eu/DISC/fargOCA/blob/master/src/boundariesConditions.cpp) for example):