Skip to content
Snippets Groups Projects
Commit 5656c2c6 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add free boundary condition descriptor

The aim of this kind of boundary condition descriptor is to indicate
that as "special" treatment is to be performed for a boundary that
is not subject to a boundary condition at the continuous level.

For instance it may occur when using a centered scheme to discretize a
system which has only one wave (quite often with scalar laws:
transport, traffic flow,...)

It can be used both to change locally the scheme and to check that no
boundary has been forgotten in the description
parent 3c4dfca0
Branches
Tags
1 merge request!46Feature/free boundary condition
......@@ -6,6 +6,7 @@
#include <mesh/Mesh.hpp>
#include <scheme/DirichletBoundaryConditionDescriptor.hpp>
#include <scheme/FourierBoundaryConditionDescriptor.hpp>
#include <scheme/FreeBoundaryConditionDescriptor.hpp>
#include <scheme/IBoundaryConditionDescriptor.hpp>
#include <scheme/IBoundaryDescriptor.hpp>
#include <scheme/NamedBoundaryDescriptor.hpp>
......
#ifndef FREE_BOUNDARY_CONDITION_DESCRIPTOR_HPP
#define FREE_BOUNDARY_CONDITION_DESCRIPTOR_HPP
#include <scheme/IBoundaryConditionDescriptor.hpp>
#include <scheme/IBoundaryDescriptor.hpp>
#include <memory>
class FreeBoundaryConditionDescriptor : public IBoundaryConditionDescriptor
{
private:
std::ostream&
_write(std::ostream& os) const final
{
os << "free(" << *m_boundary_descriptor << ")";
return os;
}
std::shared_ptr<const IBoundaryDescriptor> m_boundary_descriptor;
public:
const IBoundaryDescriptor&
boundaryDescriptor() const
{
return *m_boundary_descriptor;
}
Type
type() const final
{
return Type::free;
}
FreeBoundaryConditionDescriptor(std::shared_ptr<const IBoundaryDescriptor> boundary_descriptor)
: m_boundary_descriptor(boundary_descriptor)
{
;
}
FreeBoundaryConditionDescriptor(const FreeBoundaryConditionDescriptor&) = delete;
FreeBoundaryConditionDescriptor(FreeBoundaryConditionDescriptor&&) = delete;
~FreeBoundaryConditionDescriptor() = default;
};
#endif // FREE_BOUNDARY_CONDITION_DESCRIPTOR_HPP
......@@ -10,6 +10,7 @@ class IBoundaryConditionDescriptor
{
dirichlet,
fourier,
free,
neumann,
symmetry
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment