Rheolef  7.2
an efficient C++ finite element environment
tiny_element.cc
Go to the documentation of this file.
1
21#include "rheolef/tiny_element.h"
22#include "rheolef/geo_element.h"
23using namespace rheolef;
24using namespace std;
25
26ostream&
27operator << (ostream& os, const tiny_element& K)
28{
29 if (K.variant() == tiny_element::max_variant) {
30 error_macro ("unexpected type");
31 return os;
32 }
33 if (K.dimension() >= 2) {
34 os << K.name() << "\t";
35 }
36 for (tiny_element::size_type i = 0; i < K.size(); i++) {
37 os << K[i];
38 if (i != K.size()-1) {
39 os << " ";
40 }
41 }
42 return os;
43}
44tiny_element::tiny_element (const geo_element& x)
45{
46 set_variant (x.variant());
47 set_index (x.index());
48 for (size_type i = 0; i < x.size(); i++)
49 t_[i] = x[i];
50}
51
field::size_type size_type
Definition: branch.cc:430
see the geo_element page for the full documentation
Definition: geo_element.h:102
size_type size() const
Definition: geo_element.h:168
size_t index() const
Definition: msh2geo.cc:237
variant_type variant() const
Definition: geo_element.h:161
variant_type variant() const
std::vector< int >::size_type size_type
void set_variant(variant_type t)
Definition: tiny_element.h:61
void set_index(size_t idx)
Definition: tiny_element.h:41
#define error_macro(message)
Definition: dis_macros.h:49
This file is part of Rheolef.
STL namespace.
ostream & operator<<(ostream &os, const tiny_element &K)
Definition: tiny_element.cc:27