characteristic.h
Go to the documentation of this file.
#ifndef _RHEO_CHARACTERISTIC_H
#define _RHEO_CHARACTERISTIC_H
//
// This file is part of Rheolef.
//
// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
//
// Rheolef is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Rheolef 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rheolef; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// =========================================================================
namespace rheolef {
} // namespace rheolef
#include "rheolef/field.h"
#include "rheolef/piola_on_pointset.h"
namespace rheolef {
// -------------------------------------------------------------------
// characteristic_on_quadrature: store the localization in mesh of the
// quadrature point tacking: y = x + d(x) : that belongs in K as hat_y
// -------------------------------------------------------------------
template <class T, class M>
struct characteristic_on_quadrature_rep {
// allocators:
characteristic_on_quadrature_rep (quadrature_option qopt1 = quadrature_option(quadrature_option::max_family,0))
: _qopt (qopt1),
_quad (),
_piola_on_quad(),
_ie2dis_ix (),
_hat_y (),
_yq ()
{}
characteristic_on_quadrature_rep (const characteristic_on_quadrature_rep<T,M>& x)
: _qopt (x._qopt),
_quad (), // OK: DO NOT COPY !
_piola_on_quad(),
_ie2dis_ix (),
_hat_y (),
_yq ()
{
error_macro ("physical copy of characteristic_on_quadrature_rep may not happened");
}
public:
// data:
quadrature_option _qopt;
quadrature<T> _quad;
basis_on_pointset<T> _piola_on_quad;
disarray<index_set,M> _ie2dis_ix;
disarray<point_basic<T>,M> _hat_y;
disarray<point_basic<T>,M> _yq;
};
template <class T, class M>
class characteristic_on_quadrature : public smart_pointer<characteristic_on_quadrature_rep<T,M> > {
public:
// typedefs:
typedef characteristic_on_quadrature_rep<T,M> rep;
typedef smart_pointer<rep> base;
// allocator:
characteristic_on_quadrature
(quadrature_option qopt = quadrature_option(quadrature_option::max_family,0))
: base (new_macro(rep(qopt)))
{}
// data:
};
// -------------------------------------------------------------------
// characteristic_rep: store a list of characteristic_on_quadrature(s)
// together with the displacement field dh
// -------------------------------------------------------------------
template<class T, class M>
class characteristic_rep {
public:
typedef std::map<std::string,characteristic_on_quadrature<T,M> > map_type;
// allocator:
characteristic_rep(const field_basic<T,M>& dh);
// accesor:
const field_basic<T,M>& get_displacement() const { return _dh; }
const characteristic_on_quadrature<T,M>&
get_pre_computed (
const space_basic<T,M>& Xh,
const field_basic<T,M>& dh,
const piola_on_pointset<T>& pops) const;
// data:
protected:
field_basic<T,M> _dh;
mutable map_type _coq_map;
};
// [verbatim_characteristic_basic]
template<class T, class M = rheo_default_memory_model>
class characteristic_basic : public smart_pointer<characteristic_rep<T,M> > {
public:
typedef characteristic_rep<T,M> rep;
typedef smart_pointer<rep> base;
// allocator:
characteristic_basic(const field_basic<T,M>& dh);
// accesors:
const field_basic<T,M>& get_displacement() const;
// [verbatim_characteristic_basic]
const characteristic_on_quadrature<T,M>&
get_pre_computed (
const space_basic<T,M>& Xh,
const field_basic<T,M>& dh,
const piola_on_pointset<T>& pops) const;
// [verbatim_characteristic_basic_cont]
};
// [verbatim_characteristic_basic_cont]
// [verbatim_characteristic]
typedef characteristic_basic<Float> characteristic;
// [verbatim_characteristic]
template<class T, class M>
inline
characteristic_basic<T,M>::characteristic_basic (const field_basic<T,M>& dh)
: base (new_macro(rep(dh)))
{
}
template<class T, class M>
inline
const field_basic<T,M>&
characteristic_basic<T,M>::get_displacement() const
{
return base::data().get_displacement();
}
template<class T, class M>
inline
const characteristic_on_quadrature<T,M>&
characteristic_basic<T,M>::get_pre_computed (
const space_basic<T,M>& Xh,
const field_basic<T,M>& dh,
const piola_on_pointset<T>& pops) const
{
return base::data().get_pre_computed (Xh,dh,pops);
}
// ===========================================================================
// the temporary class returned by compose (phi_h,X)
// ===========================================================================
template<class T, class M>
class field_o_characteristic {
public:
// allocator:
field_o_characteristic(const field_basic<T,M>& uh, const characteristic_basic<T,M>& X)
: _uh(uh), _X(X) {}
// accesor:
const field_basic<T,M>& get_field() const { return _uh; }
const characteristic_basic<T,M>& get_characteristic() const { return _X; }
// data:
protected:
field_basic<T,M> _uh;
characteristic_basic<T,M> _X;
};
}// namespace rheolef
#endif // _RHEO_CHARACTERISTIC_H
rheolef::basis_on_pointset
Definition: basis_on_pointset.h:192
rheolef::characteristic_basic
Definition: characteristic.h:194
rheolef::characteristic_basic::get_displacement
const field_basic< T, M > & get_displacement() const
Definition: characteristic.h:230
rheolef::characteristic_basic::rep
characteristic_rep< T, M > rep
Definition: characteristic.h:196
rheolef::characteristic_basic::get_pre_computed
const characteristic_on_quadrature< T, M > & get_pre_computed(const space_basic< T, M > &Xh, const field_basic< T, M > &dh, const piola_on_pointset< T > &pops) const
Definition: characteristic.h:237
rheolef::characteristic_basic::base
smart_pointer< rep > base
Definition: characteristic.h:197
rheolef::characteristic_basic::characteristic_basic
characteristic_basic(const field_basic< T, M > &dh)
Definition: characteristic.h:223
rheolef::characteristic_on_quadrature
Definition: characteristic.h:150
rheolef::characteristic_on_quadrature::base
smart_pointer< rep > base
Definition: characteristic.h:154
rheolef::characteristic_on_quadrature::rep
characteristic_on_quadrature_rep< T, M > rep
Definition: characteristic.h:153
rheolef::characteristic_on_quadrature::characteristic_on_quadrature
characteristic_on_quadrature(quadrature_option qopt=quadrature_option(quadrature_option::max_family, 0))
Definition: characteristic.h:157
rheolef::characteristic_rep
Definition: characteristic.h:167
rheolef::characteristic_rep::characteristic_rep
characteristic_rep(const field_basic< T, M > &dh)
Definition: characteristic.cc:35
rheolef::characteristic_rep::_dh
field_basic< T, M > _dh
Definition: characteristic.h:187
rheolef::characteristic_rep::get_displacement
const field_basic< T, M > & get_displacement() const
Definition: characteristic.h:177
rheolef::characteristic_rep::get_pre_computed
const characteristic_on_quadrature< T, M > & get_pre_computed(const space_basic< T, M > &Xh, const field_basic< T, M > &dh, const piola_on_pointset< T > &pops) const
Definition: characteristic.cc:157
rheolef::characteristic_rep::map_type
std::map< std::string, characteristic_on_quadrature< T, M > > map_type
Definition: characteristic.h:169
rheolef::characteristic_rep::_coq_map
map_type _coq_map
Definition: characteristic.h:188
rheolef::disarray
see the disarray page for the full documentation
Definition: disarray.h:459
rheolef::field_basic< T, M >
rheolef::field_o_characteristic
Definition: characteristic.h:248
rheolef::field_o_characteristic::_uh
field_basic< T, M > _uh
Definition: characteristic.h:263
rheolef::field_o_characteristic::_X
characteristic_basic< T, M > _X
Definition: characteristic.h:264
rheolef::field_o_characteristic::get_characteristic
const characteristic_basic< T, M > & get_characteristic() const
Definition: characteristic.h:259
rheolef::field_o_characteristic::get_field
const field_basic< T, M > & get_field() const
Definition: characteristic.h:258
rheolef::field_o_characteristic::field_o_characteristic
field_o_characteristic(const field_basic< T, M > &uh, const characteristic_basic< T, M > &X)
Definition: characteristic.h:253
rheolef::piola_on_pointset
Definition: piola_on_pointset.h:142
rheolef::quadrature
Definition: quadrature.h:186
rheolef::smart_pointer
see the smart_pointer page for the full documentation
Definition: smart_pointer.h:351
rheolef::space_basic< T, M >
rheolef::quadrature_option
integrate_option quadrature_option
Definition: integrate_option.h:186
rheolef::characteristic
characteristic_basic< Float > characteristic
Definition: characteristic.h:218
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::characteristic_on_quadrature_rep
Definition: characteristic.h:118
rheolef::characteristic_on_quadrature_rep::characteristic_on_quadrature_rep
characteristic_on_quadrature_rep(quadrature_option qopt1=quadrature_option(quadrature_option::max_family, 0))
Definition: characteristic.h:120
rheolef::characteristic_on_quadrature_rep::_ie2dis_ix
disarray< index_set, M > _ie2dis_ix
Definition: characteristic.h:145
rheolef::characteristic_on_quadrature_rep::_hat_y
disarray< point_basic< T >, M > _hat_y
Definition: characteristic.h:146
rheolef::characteristic_on_quadrature_rep::_piola_on_quad
basis_on_pointset< T > _piola_on_quad
Definition: characteristic.h:144
rheolef::characteristic_on_quadrature_rep::_yq
disarray< point_basic< T >, M > _yq
Definition: characteristic.h:147
rheolef::characteristic_on_quadrature_rep::_qopt
quadrature_option _qopt
Definition: characteristic.h:142
rheolef::characteristic_on_quadrature_rep::characteristic_on_quadrature_rep
characteristic_on_quadrature_rep(const characteristic_on_quadrature_rep< T, M > &x)
Definition: characteristic.h:129
rheolef::characteristic_on_quadrature_rep::_quad
quadrature< T > _quad
Definition: characteristic.h:143
M
Expr1::memory_type M
Definition: vec_expr_v2.h:416