53 return buf[(r-1)*
nc+
c];
64 template <
class _Cont>
68 typedef typename _Cont::Value
Value;
102 assert( x->is_nodal() && z->is_elemental()
103 && x->size_of_components() == z->size_of_components());
109 std::vector<const COM::Pane*> xpanes;
110 std::vector<COM::Pane*> zpanes;
112 x->window()->panes(xpanes);
113 z->window()->panes(zpanes);
115 std::vector<COM::Pane*>::iterator zit, zend;
116 std::vector<const COM::Pane*>::const_iterator xit;
118 const int ndim = x->size_of_components();
120 for( zit = zpanes.begin(), zend = zpanes.end(), xit = xpanes.begin();
121 zit != zend; ++zit, ++xit) {
123 for(
int i = 0;
i < ndim; ++
i) {
124 COM::Attribute *z_pa = (*zit)->attribute(z->id()+((ndim>1)?
i+1:0));
125 Real *zval =
reinterpret_cast<Real *
>(z_pa->pointer());
126 int zstrd=z_pa->stride();
128 const COM::Attribute *x_pa = (*xit)->attribute(x->id()+((ndim>1)?
i+1:0));
129 const Real *xval =
reinterpret_cast<const Real *
>(x_pa->pointer());
135 for (
int j=(*xit)->size_of_elements();
j>0; --
j, ene.next(), zval+=zstrd)
137 interpolate_to_center( f, zval);
An adaptor for enumerating node IDs of an element.
#define SURF_END_NAMESPACE
Value_const operator[](int i) const
Obtain a const reference to the nodal data associated with ith node of the element.
Adpator for element-wise data container.
Encapsulation of the element-wise computations for two-dimensional elements.
Size dimension() const
Dimension of each attribute.
T get_value(const Base_type *buf, int r) const
Get the ith data item. Here the index i uses Fortran convention.
#define SURF_BEGIN_NAMESPACE
Nodal_scalar_const_2d(int i, int j)
Constructor.
void int int int REAL REAL REAL * z
const Element_node_enumerator & _enum
Adpator for accessing constant scalar node-centered data.
static void interpolate_to_centers(const COM::Attribute *x, COM::Attribute *z)
Interpolates nodal coordinates to element centers.
Size dimension() const
Dimension of the attribute.
Value_nonconst operator[](int i)
Obtain a non-const reference to the nodal data associated with ith node of the element.
_Cont::Base_type Base_type
_Cont::Value_nonconst Value_nonconst
Field(_Cont &cont, Value *p, const Element_node_enumerator &ids)
Constructor.
_Cont::Value_const Value_const