Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
field_rdof.h
Go to the documentation of this file.
1# ifndef _RHEOLEF_FIELD_RDOF_H
2# define _RHEOLEF_FIELD_RDOF_H
3//
4// This file is part of Rheolef.
5//
6// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7//
8// Rheolef is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//
13// Rheolef is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with Rheolef; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// =========================================================================
23// field_rdof concept: field with read accessors at the dof level
24// terminals : field_wdof, field_rdof_sliced_const, field_rdof_indirect_const
25// + all affine homogeneous expressions involving these terminals
26// AUTHOR: Pierre.Saramito@imag.fr
27// DATE: 23 april 2020
28
29// TODO: add an automatic field_lazy-compatible interface
30// for accessors at the element level
31// => could combine eg field_lazy + field_rdof
32//
33#include "rheolef/field_lazy.h"
34
35namespace rheolef { namespace details {
36
37template<class FieldRdof> class field_rdof_sliced_const; // forward declaration
38template<class FieldRdof> class field_rdof_indirect_const;
39
40template<class Derived>
42public:
43// definitions:
44
51
52// accessors:
53
54 field_rdof_indirect_const<Derived> operator[] (const std::string& dom_name) const;
56 field_rdof_sliced_const <Derived> operator[] (size_type i_comp) const;
57 field_rdof_sliced_const <Derived> operator() (size_type i_comp, size_type j_comp) const;
58
59// for compatibility with the lazy interface
60
61 bool have_homogeneous_space (space_type& Xh) const { Xh = derived().get_space(); return true; }
62
63protected:
64 Derived& derived() { return *static_cast< Derived*>(this); }
65 const Derived& derived() const { return *static_cast<const Derived*>(this); }
66};
67
68// eg field_wdof_sliced --> field_rdof_sliced_const
69template<class FieldWdof>
71 using type = FieldWdof;
72};
73
74}}// namespace rheolef::details
75# endif /* _RHEOLEF_FIELD_RDOF_H */
typename field_traits< Derived >::scalar_type scalar_type
Definition field_rdof.h:46
field_rdof_sliced_const< Derived > operator()(size_type i_comp, size_type j_comp) const
typename field_traits< Derived >::memory_type memory_type
Definition field_rdof.h:47
bool have_homogeneous_space(space_type &Xh) const
Definition field_rdof.h:61
field_rdof_indirect_const< Derived > operator[](const std::string &dom_name) const
typename float_traits< scalar_type >::type float_type
Definition field_rdof.h:48
typename field_traits< Derived >::size_type size_type
Definition field_rdof.h:45
const Derived & derived() const
Definition field_rdof.h:65
This file is part of Rheolef.