Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
field_wdof.h
Go to the documentation of this file.
1# ifndef _RHEOLEF_FIELD_WDOF_H
2# define _RHEOLEF_FIELD_WDOF_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_wdof: field with read & write accessors at the dof level
24// terminals: field_basic, field_wdof_sliced, field_indirect
25// AUTHOR: Pierre.Saramito@imag.fr
26// DATE: 21 april 2020
27
28#include "rheolef/field_rdof.h"
29
30namespace rheolef { namespace details {
31
32template<class FieldWdof> class field_wdof_sliced; // forward declaration
33template<class FieldWdof> class field_wdof_indirect;
34
35template<class Derived>
36class field_wdof_base: public field_rdof_base<Derived> {
37public:
38// definitions:
39
44 using geo_type = geo_basic <float_type,memory_type>;
46
47// assignements:
48
49 // TODO: also +-= for value, rdof, lazy
50 // TODO: also */= and all from field_expr.h
51 // TODO: DVT_EXPR_CTE_VEC : Value as point or tensor
52 template<class Value>
53 typename std::enable_if<
56 >::type
57 operator= (const Value&);
58
59 template<class FieldRdof>
60 typename std::enable_if<
63 >::type
64 operator= (const FieldRdof&);
65
66 template<class FieldLazy>
67 typename std::enable_if<
71 >::type
72 operator= (const FieldLazy&);
73
74// accessors:
75
76 field_wdof_indirect<Derived> operator[] (const std::string& dom_name);
78 field_wdof_sliced <Derived> operator[] (size_type i_comp);
79 field_wdof_sliced <Derived> operator() (size_type i_comp, size_type j_comp);
80
81protected:
82 Derived& derived() { return *static_cast< Derived*>(this); }
83 const Derived& derived() const { return *static_cast<const Derived*>(this); }
84};
85
86}}// namespace rheolef::details
87# endif /* _RHEOLEF_FIELD_WDOF_H */
typename field_traits< Derived >::scalar_type scalar_type
Definition field_wdof.h:41
typename field_traits< Derived >::memory_type memory_type
Definition field_wdof.h:42
std::enable_if< details::is_rheolef_arithmetic< Value >::value, field_wdof_base< Derived > & >::type operator=(const Value &)
typename float_traits< scalar_type >::type float_type
Definition field_wdof.h:43
typename field_traits< Derived >::size_type size_type
Definition field_wdof.h:40
field_wdof_sliced< Derived > operator()(size_type i_comp, size_type j_comp)
const Derived & derived() const
Definition field_wdof.h:83
field_wdof_indirect< Derived > operator[](const std::string &dom_name)
This file is part of Rheolef.