26 #include "../Rocblas/include/Rocblas.h"
27 #include "../Rocsurf/include/Generic_element_2.h"
28 #include "../Rocsurf/include/Rocsurf.h"
34 COM::Attribute *disps =
36 _buf->resize_array( disps, 0);
39 _buf->resize_array( pos, 0);
40 COM::Attribute *fvol_buf =
42 _buf->resize_array( fvol_buf, 0);
43 _buf->init_done(
false);
54 SURF::Rocsurf::compute_element_normals(
_facenormals, &normalize, pos);
62 for (
int k=0;
k<2;++
k) {
64 SURF::Rocsurf::compute_swept_volumes( pos, disps, fvol);
69 SURF::Rocsurf::compute_bounded_volumes( pos, coors, fvol);
75 std::vector< COM::Pane*>::iterator it =
_panes.begin();
77 for (
int i=0, local_npanes =
_panes.size();
i<local_npanes; ++
i, ++it) {
78 COM::Pane *pane = *it;
80 const double *vs =
reinterpret_cast<const double*
>
81 ( pane->attribute(
_weights->id())->pointer());
82 const double *as =
reinterpret_cast<const double*
>
83 ( pane->attribute(
_scales->id())->pointer());
85 ( pane->attribute(
_vnormals->id())->pointer());
87 ( pane->attribute(disps->id())->pointer());
90 for (
int j=0, jn=pane->size_of_real_nodes();
j<jn; ++
j) {
91 ds[
j] += vs[
j]/as[
j]*ds_m[
j];
98 _buf->delete_attribute( fvol_buf->name());
99 _buf->delete_attribute( pos->name());
100 _buf->delete_attribute( disps->name());
101 _buf->init_done(
false);
106 const COM::Attribute *tranks,
107 COM::Attribute *vvol) {
113 std::vector< COM::Pane*>::iterator it =
_panes.begin();
114 Manifold::PM_iterator pm_it=
_surf->pm_begin();
115 for (
int i=0, local_npanes =
_panes.size();
116 i<local_npanes; ++
i, ++it, ++pm_it) {
117 COM::Pane *pane = *it;
119 const double *fv =
reinterpret_cast<const double*
>
120 ( pane->attribute(fvol->id())->pointer());
121 double *vv =
reinterpret_cast<double*
>
122 ( pane->attribute(vvol->id())->pointer());
126 for (
int j=0,
nj=pane->size_of_real_elements();
j<
nj; ++
j, ene.
next()) {
129 for (
int k=0;
k<ne; ++
k) {
130 int index = ene[
k]-1;
137 _surf->reduce_on_shared_nodes( vvol, Manifold::OP_SUM);
static void sub(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for subtraction.
An adaptor for enumerating node IDs of an element.
#define PROP_END_NAMESPACE
#define PROP_BEGIN_NAMESPACE
COM::Attribute * _vcenters
COM::Attribute * _faceareas
COM::Attribute * _tangranks
std::vector< COM::Pane * > _panes
static void add(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for addition.
void distribute_volume_e2n(const COM::Attribute *fvol, const COM::Attribute *tranks, COM::Attribute *vvol)
int size_of_edges() const
Number of edges per element.
COM::Attribute * _weights
static void copy_scalar(const void *x, Attribute *y)
Operation wrapper for copy (x is a scalar pointer).
static void copy(const Attribute *x, Attribute *y)
Wrapper for copy.
COM::Attribute * _vnormals
void next()
Go to the next element within the connectivity tables of a pane.
Some basic geometric data types.
static void dot(const Attribute *x, const Attribute *y, Attribute *z, const Attribute *mults=NULL)
Wrapper for dot product.
COM::Attribute * _facenormals