Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91014045
boundary_condition_functor.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 22:48
Size
6 KB
Mime Type
text/x-c
Expires
Fri, Nov 8, 22:48 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
22106533
Attached To
rAKA akantu
boundary_condition_functor.hh
View Options
/**
* @file boundary_condition_functor.hh
*
* @author Dana Christen <dana.christen@gmail.com>
* @author David Simon Kammer <david.kammer@epfl.ch>
* @author Nicolas Richart <nicolas.richart@epfl.ch>
*
* @date creation: Fri May 03 2013
* @date last modification: Thu Oct 15 2015
*
* @brief Definitions of the functors to apply boundary conditions
*
* @section LICENSE
*
* Copyright (©) 2014, 2015 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "fe_engine.hh"
#include "integration_point.hh"
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_BOUNDARY_CONDITION_FUNCTOR_HH__
#define __AKANTU_BOUNDARY_CONDITION_FUNCTOR_HH__
/* -------------------------------------------------------------------------- */
namespace akantu {
/* -------------------------------------------------------------------------- */
namespace BC {
using Axis = ::akantu::SpacialDirection;
struct Functor {
enum Type { _dirichlet, _neumann };
};
/* ------------------------------------------------------------------------ */
/* Dirichlet */
/* ------------------------------------------------------------------------ */
namespace Dirichlet {
/* ---------------------------------------------------------------------- */
class DirichletFunctor : public Functor {
protected:
DirichletFunctor() = default;
explicit DirichletFunctor(Axis ax) : axis(ax) {}
public:
void operator()(__attribute__((unused)) UInt node,
__attribute__((unused)) Vector<bool> & flags,
__attribute__((unused)) Vector<Real> & primal,
__attribute__((unused)) const Vector<Real> & coord) const {
AKANTU_DEBUG_TO_IMPLEMENT();
}
public:
static const Type type = _dirichlet;
protected:
Axis axis{_x};
};
/* ---------------------------------------------------------------------- */
class FlagOnly : public DirichletFunctor {
public:
explicit FlagOnly(Axis ax = _x) : DirichletFunctor(ax) {}
public:
inline void operator()(UInt node, Vector<bool> & flags,
Vector<Real> & primal,
const Vector<Real> & coord) const;
};
/* ---------------------------------------------------------------------- */
class FreeBoundary : public DirichletFunctor {
public:
explicit FreeBoundary(Axis ax = _x) : DirichletFunctor(ax) {}
public:
inline void operator()(UInt node, Vector<bool> & flags,
Vector<Real> & primal,
const Vector<Real> & coord) const;
};
/* ---------------------------------------------------------------------- */
class FixedValue : public DirichletFunctor {
public:
FixedValue(Real val, Axis ax = _x) : DirichletFunctor(ax), value(val) {}
public:
inline void operator()(UInt node, Vector<bool> & flags,
Vector<Real> & primal,
const Vector<Real> & coord) const;
protected:
Real value;
};
/* ---------------------------------------------------------------------- */
class IncrementValue : public DirichletFunctor {
public:
IncrementValue(Real val, Axis ax = _x) : DirichletFunctor(ax), value(val) {}
public:
inline void operator()(UInt node, Vector<bool> & flags,
Vector<Real> & primal,
const Vector<Real> & coord) const;
inline void setIncrement(Real val) { this->value = val; }
protected:
Real value;
};
} // end namespace Dirichlet
/* ------------------------------------------------------------------------ */
/* Neumann */
/* ------------------------------------------------------------------------ */
namespace Neumann {
/* ---------------------------------------------------------------------- */
class NeumannFunctor : public Functor {
protected:
NeumannFunctor() = default;
public:
virtual void operator()(const IntegrationPoint & quad_point,
Vector<Real> & dual, const Vector<Real> & coord,
const Vector<Real> & normals) const = 0;
virtual ~NeumannFunctor() = default;
public:
static const Type type = _neumann;
};
/* ---------------------------------------------------------------------- */
class FromHigherDim : public NeumannFunctor {
public:
explicit FromHigherDim(const Matrix<Real> & mat) : bc_data(mat) {}
~FromHigherDim() override = default;
public:
inline void operator()(const IntegrationPoint & quad_point,
Vector<Real> & dual, const Vector<Real> & coord,
const Vector<Real> & normals) const override;
protected:
Matrix<Real> bc_data;
};
/* ---------------------------------------------------------------------- */
class FromSameDim : public NeumannFunctor {
public:
explicit FromSameDim(const Vector<Real> & vec) : bc_data(vec) {}
~FromSameDim() override = default;
public:
inline void operator()(const IntegrationPoint & quad_point,
Vector<Real> & dual, const Vector<Real> & coord,
const Vector<Real> & normals) const override;
protected:
Vector<Real> bc_data;
};
/* ---------------------------------------------------------------------- */
class FreeBoundary : public NeumannFunctor {
public:
inline void operator()(const IntegrationPoint & quad_point,
Vector<Real> & dual, const Vector<Real> & coord,
const Vector<Real> & normals) const override;
};
} // end namespace Neumann
} // end namespace BC
} // akantu
#include "boundary_condition_functor_inline_impl.cc"
#endif /* __AKANTU_BOUNDARY_CONDITION_FUNCTOR_HH__ */
Event Timeline
Log In to Comment