basis_option.h
Go to the documentation of this file.
#ifndef _RHEO_BASIS_OPTION_H
#define _RHEO_BASIS_OPTION_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
//
// =========================================================================
// author: Pierre.Saramito@imag.fr
// date: 2 september 2017
namespace rheolef {
} // namespace rheolef
#include "rheolef/smart_pointer.h"
#include "rheolef/reference_element.h"
#include "rheolef/space_constant.h"
namespace rheolef {
// [verbatim_basis_option]
class basis_option {
public:
// typedefs:
typedef size_t size_type;
typedef space_constant::valued_type valued_type;
typedef space_constant::coordinate_type coordinate_type;
typedef enum {
equispaced = 0,
warburton = 1,
fekete = 2,
max_node = 3
} node_type; // update also node_name[]
typedef enum {
monomial = 0,
bernstein = 1,
dubiner = 2,
max_raw_polynomial = 3
} raw_polynomial_type; // update also raw_polynomial_name[]
static const node_type default_node = basis_option::equispaced;
static const raw_polynomial_type default_raw_polynomial = basis_option::dubiner;
// allocators:
basis_option(
node_type nt = default_node,
raw_polynomial_type pt = default_raw_polynomial);
basis_option (const basis_option& sopt);
basis_option& operator= (const basis_option& sopt);
// accessors & modifiers:
node_type get_node() const;
raw_polynomial_type get_raw_polynomial() const;
std::string get_node_name() const;
std::string get_raw_polynomial_name() const;
bool is_continuous() const;
bool is_discontinuous() const;
bool is_restricted_to_sides() const;
valued_type valued_tag() const;
const std::string& valued() const;
size_type dimension() const { return _dimension; }
coordinate_type coordinate_system() const { return _sys_coord; }
void set_node (node_type type);
void set_raw_polynomial (raw_polynomial_type type);
void set (std::string option_name);
void set_node (std::string node_name);
void set_raw_polynomial (std::string raw_polynomial_name);
void set_continuous (bool c = true);
void set_discontinuous (bool d = true);
void set_restricted_to_sides (bool r = true);
void set_valued_tag (valued_type v) { _valued_tag = v; }
void set_dimension (size_type d) { _dimension = d; }
void set_coordinate_system (coordinate_type sc) { _sys_coord = sc; }
bool is_node_name (std::string name) const;
bool is_raw_polynomial_name (std::string name) const;
bool is_option_name (std::string name) const;
std::string stamp() const;
// [verbatim_basis_option]
// data:
protected:
node_type _node;
raw_polynomial_type _poly;
bool _is_continuous;
bool _is_restricted_to_sides;
valued_type _valued_tag;
size_type _dimension;
coordinate_type _sys_coord;
// [verbatim_basis_option_cont]
};
// [verbatim_basis_option_cont]
// ------------------------------------------------------------
// ------------------------------------------------------------
// inlined
// ------------------------------------------------------------
inline
basis_option::basis_option(
node_type nt,
raw_polynomial_type pt)
: _node(nt),
_poly(pt),
_is_continuous(true),
_is_restricted_to_sides(false),
_valued_tag(space_constant::scalar),
_dimension(std::numeric_limits<size_type>::max()),
_sys_coord(space_constant::cartesian)
{
}
inline
basis_option::basis_option (const basis_option& sopt)
: _node(sopt._node),
_poly(sopt._poly),
_is_continuous(sopt._is_continuous),
_is_restricted_to_sides(sopt._is_restricted_to_sides),
_valued_tag(sopt._valued_tag),
_dimension(sopt._dimension),
_sys_coord(sopt._sys_coord)
{
}
inline
basis_option&
basis_option::operator= (const basis_option& sopt)
{
_node = sopt._node;
_poly = sopt._poly;
_is_continuous = sopt._is_continuous;
_is_restricted_to_sides = sopt._is_restricted_to_sides;
_valued_tag = sopt._valued_tag;
_dimension = sopt._dimension;
_sys_coord = sopt._sys_coord;
return *this;
}
inline
basis_option::node_type
basis_option::get_node () const
{
return _node;
}
inline
basis_option::raw_polynomial_type
basis_option::get_raw_polynomial () const
{
return _poly;
}
inline
bool
basis_option::is_continuous() const
{
return _is_continuous;
}
inline
bool
basis_option::is_discontinuous() const
{
return !_is_continuous;
}
inline
bool
basis_option::is_restricted_to_sides() const
{
return _is_restricted_to_sides;
}
inline
basis_option::valued_type
basis_option::valued_tag() const
{
return _valued_tag;
}
inline
const std::string&
basis_option::valued() const
{
return space_constant::valued_name (valued_tag());
}
inline
void
basis_option::set_node (node_type nt)
{
_node = nt;
}
inline
void
basis_option::set_raw_polynomial (raw_polynomial_type pt)
{
_poly = pt;
}
inline
void
basis_option::set_continuous (bool c)
{
_is_continuous = c;
}
inline
void
basis_option::set_discontinuous (bool d)
{
_is_continuous = !d;
}
inline
void
basis_option::set_restricted_to_sides (bool r)
{
_is_restricted_to_sides = r;
}
}// namespace rheolef
#endif // _RHEO_BASIS_OPTION_H
rheolef::basis_option
see the basis_option page for the full documentation
Definition: basis_option.h:93
rheolef::basis_option::is_continuous
bool is_continuous() const
Definition: basis_option.h:227
rheolef::basis_option::_poly
raw_polynomial_type _poly
Definition: basis_option.h:163
rheolef::basis_option::coordinate_type
space_constant::coordinate_type coordinate_type
Definition: basis_option.h:99
rheolef::basis_option::is_raw_polynomial_name
bool is_raw_polynomial_name(std::string name) const
Definition: basis_option.cc:75
rheolef::basis_option::coordinate_system
coordinate_type coordinate_system() const
Definition: basis_option.h:139
rheolef::basis_option::get_raw_polynomial_name
std::string get_raw_polynomial_name() const
Definition: basis_option.cc:104
rheolef::basis_option::default_node
static const node_type default_node
Definition: basis_option.h:115
rheolef::basis_option::_dimension
size_type _dimension
Definition: basis_option.h:167
rheolef::basis_option::is_restricted_to_sides
bool is_restricted_to_sides() const
Definition: basis_option.h:239
rheolef::basis_option::operator=
basis_option & operator=(const basis_option &sopt)
Definition: basis_option.h:202
rheolef::basis_option::size_type
size_t size_type
Definition: basis_option.h:97
rheolef::basis_option::set_coordinate_system
void set_coordinate_system(coordinate_type sc)
Definition: basis_option.h:151
rheolef::basis_option::is_discontinuous
bool is_discontinuous() const
Definition: basis_option.h:233
rheolef::basis_option::_sys_coord
coordinate_type _sys_coord
Definition: basis_option.h:168
rheolef::basis_option::node_type
node_type
Definition: basis_option.h:101
rheolef::basis_option::equispaced
@ equispaced
Definition: basis_option.h:102
rheolef::basis_option::fekete
@ fekete
Definition: basis_option.h:104
rheolef::basis_option::max_node
@ max_node
Definition: basis_option.h:105
rheolef::basis_option::warburton
@ warburton
Definition: basis_option.h:103
rheolef::basis_option::_is_restricted_to_sides
bool _is_restricted_to_sides
Definition: basis_option.h:165
rheolef::basis_option::get_node_name
std::string get_node_name() const
Definition: basis_option.cc:97
rheolef::basis_option::default_raw_polynomial
static const raw_polynomial_type default_raw_polynomial
Definition: basis_option.h:116
rheolef::basis_option::is_option_name
bool is_option_name(std::string name) const
Definition: basis_option.cc:82
rheolef::basis_option::set_dimension
void set_dimension(size_type d)
Definition: basis_option.h:150
rheolef::basis_option::valued_type
space_constant::valued_type valued_type
Definition: basis_option.h:98
rheolef::basis_option::dimension
size_type dimension() const
Definition: basis_option.h:138
rheolef::basis_option::stamp
std::string stamp() const
Definition: basis_option.cc:124
rheolef::basis_option::valued_tag
valued_type valued_tag() const
Definition: basis_option.h:245
rheolef::basis_option::set
void set(std::string option_name)
Definition: basis_option.cc:111
rheolef::basis_option::set_continuous
void set_continuous(bool c=true)
Definition: basis_option.h:269
rheolef::basis_option::set_node
void set_node(node_type type)
Definition: basis_option.h:257
rheolef::basis_option::is_node_name
bool is_node_name(std::string name) const
Definition: basis_option.cc:68
rheolef::basis_option::_node
node_type _node
Definition: basis_option.h:162
rheolef::basis_option::set_restricted_to_sides
void set_restricted_to_sides(bool r=true)
Definition: basis_option.h:281
rheolef::basis_option::set_raw_polynomial
void set_raw_polynomial(raw_polynomial_type type)
Definition: basis_option.h:263
rheolef::basis_option::raw_polynomial_type
raw_polynomial_type
Definition: basis_option.h:108
rheolef::basis_option::bernstein
@ bernstein
Definition: basis_option.h:110
rheolef::basis_option::monomial
@ monomial
Definition: basis_option.h:109
rheolef::basis_option::max_raw_polynomial
@ max_raw_polynomial
Definition: basis_option.h:112
rheolef::basis_option::dubiner
@ dubiner
Definition: basis_option.h:111
rheolef::basis_option::set_discontinuous
void set_discontinuous(bool d=true)
Definition: basis_option.h:275
rheolef::basis_option::valued
const std::string & valued() const
Definition: basis_option.h:251
rheolef::basis_option::get_raw_polynomial
raw_polynomial_type get_raw_polynomial() const
Definition: basis_option.h:221
rheolef::basis_option::basis_option
basis_option(node_type nt=default_node, raw_polynomial_type pt=default_raw_polynomial)
Definition: basis_option.h:177
rheolef::basis_option::_is_continuous
bool _is_continuous
Definition: basis_option.h:164
rheolef::basis_option::set_valued_tag
void set_valued_tag(valued_type v)
Definition: basis_option.h:149
rheolef::basis_option::_valued_tag
valued_type _valued_tag
Definition: basis_option.h:166
rheolef::basis_option::get_node
node_type get_node() const
Definition: basis_option.h:215
rheolef::std
Definition: vec_expr_v2.h:402
rheolef::type
rheolef::std type
mkgeo_ball.c
int c
Definition: mkgeo_ball.sh:153
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::space_constant::valued_type
valued_type
Definition: space_constant.h:135
rheolef::space_constant::scalar
@ scalar
Definition: space_constant.h:136
rheolef::space_constant::valued_name
const std::string & valued_name(valued_type valued_tag)
Definition: space_constant.cc:43
rheolef::space_constant::coordinate_type
coordinate_type
Definition: space_constant.h:121
rheolef::space_constant::cartesian
@ cartesian
Definition: space_constant.h:122
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37