50 ps_face[0] = ps[ind1];
51 ps_face[1] = ps[ind2];
52 ps_face[2] = ps[ind3];
53 ps_face[3] = ps[ind4];
61 ps_face[0] = ps[ind1];
62 ps_face[1] = ps[ind2];
63 ps_face[2] = ps[ind3];
76 for (
int k = 0;
k<size;
k++){
98 for (
int i=0;
i<
n; ++
i) {
103 for (
int i=0;
i<
n; ++
i) {
109 const COM::Attribute *new_location,
110 COM::Attribute *element_volume,
113 assert( element_volume != NULL && element_volume ->size_of_components() == 1);
114 assert( element_volume->window() == old_location->window());
115 assert( element_volume->window() == new_location->window());
117 std::vector< COM:: Pane*> panes;
118 element_volume->window() -> panes( panes);
132 std::vector< COM::Pane*>::const_iterator it = panes.begin();
134 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
135 const COM::Pane &pane = **it;
136 Real *ptr_ev = (
Real *)(pane.attribute( element_volume->id())->pointer());
138 (
const Point_3<Real>*)(pane.attribute( new_location->id())->pointer());
140 (
const Point_3<Real>*)(pane.attribute( old_location->id())->pointer());
145 for (
int j=pane.size_of_elements();
j>0; --
j, ene.
next(), ++ptr_ev) {
146 if ( flag!=NULL && *ptr_ev==0.)
continue;
150 ps_new.
set( ptr_new, ene, 1);
151 ps_old.
set( ptr_old, ene, 1);
153 ps[0]=ps_new[0];ps[1]=ps_new[1];ps[2]=ps_new[2];
154 ps[4]=ps_old[0];ps[5]=ps_old[1];ps[6]=ps_old[2];
158 if ( ps[0]==ps[4] && ps[1]==ps[5] && ps[2]==ps[6])
159 { *ptr_ev = 0.;
continue; }
173 ps[3]=ps_new[3]; ps[7]=ps_old[3];
174 if ( ps[0]==ps[4] && ps[1]==ps[5] && ps[2]==ps[6] && ps[3]==ps[7])
175 { *ptr_ev = 0.;
continue; }
200 const COM::Attribute *disps,
201 COM::Attribute *element_volume,
204 assert( element_volume != NULL && element_volume ->size_of_components() == 1);
205 assert( element_volume->window() == location->window());
206 assert( element_volume->window() == disps->window());
208 std::vector< COM:: Pane*> panes;
209 element_volume->window() -> panes( panes);
223 std::vector< COM::Pane*>::const_iterator it = panes.begin();
225 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
226 const COM::Pane &pane = **it;
227 Real *ptr_ev = (
Real *)(pane.attribute( element_volume->id())->pointer());
229 (
const Point_3<Real>*)(pane.attribute( location->id())->pointer());
237 for (
int j=pane.size_of_elements();
j>0; --
j, ene.
next(), ++ptr_ev) {
238 if ( flag!=NULL && *ptr_ev==0.)
continue;
242 ds.
set( ptr_disp, ene, 1);
243 pnts.
set( ptr_pos, ene, 1);
245 ps[0]=pnts[0]+ds[0];ps[1]=pnts[1]+ds[1];ps[2]=pnts[2]+ds[2];
246 ps[4]=pnts[0];ps[5]=pnts[1];ps[6]=pnts[2];
250 if ( ps[0]==ps[4] && ps[1]==ps[5] && ps[2]==ps[6])
251 { *ptr_ev = 0.;
continue; }
265 ps[3]=pnts[3]+ds[3]; ps[7]=pnts[3];
266 if ( ps[0]==ps[4] && ps[1]==ps[5] && ps[2]==ps[6] && ps[3]==ps[7])
267 { *ptr_ev = 0.;
continue; }
293 std::vector< const COM:: Pane*> panes;
294 mesh->window() -> panes( panes);
304 std::vector< const COM::Pane*>::const_iterator it = panes.begin();
306 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
307 const COM::Pane &pane = **it;
311 for (
int j=pane.size_of_real_nodes();
j>0; --
j, ++ptr) {
318 Accumulator local=global;
321 MPI_Allreduce( &local.cnt[0], &global.cnt[0], 4, MPI_DOUBLE,
MPI_SUM,
322 mesh->window()->get_communicator());
324 cnt = global.cnt/global.count;
330 std::vector< const COM:: Pane*> panes;
331 mesh->window() -> panes( panes);
340 std::vector< const COM::Pane*>::const_iterator it = panes.begin();
342 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
343 const COM::Pane &pane = **it;
350 for (
int j=pane.size_of_elements();
j>0; --
j, ene.
next()) {
351 ps.
set( ptr, ene, 1);
353 normalized_face[0]=ps[0]-cnt;
354 normalized_face[1]=ps[1]-cnt;
355 normalized_face[2]=ps[2]-cnt;
361 normalized_face[3]=ps[3]-cnt;
An adaptor for enumerating node IDs of an element.
void normalize_coor(Point_3< Real > ps_face[], int n, int k)
#define SURF_END_NAMESPACE
void get_gp_nat_coor(const Size i, Nat_coor &nc, const Size doa=0) const
Get the natrual coordinate associated with a Gauss point.
Encapsulation of the element-wise computations for two-dimensional elements.
Real get_gp_weight(const Size i, const Size doa=0) const
Get the weight associated with a Gauss point.
static void compute_bounded_volumes(const COM::Attribute *old_location, const COM::Attribute *new_location, COM::Attribute *volumes, void *flag=NULL)
Computes the volume bounded between two different locations of each face of the surface mesh of windo...
void interpolate(const Field &f, const Nat_coor &nc, Value *v) const
Interpolates the field data at a given point.
static void compute_signed_volumes(const COM::Attribute *mesh, double *vol)
Computes the signed volume of a body.
#define SURF_BEGIN_NAMESPACE
This is a helper class for accessing nodal data.
int volume(const block *b)
int size_of_edges() const
Number of edges per element.
SURF_BEGIN_NAMESPACE void arrange(Point_3< Real > ps_face[4], Point_3< Real > ps[8], int ind1, int ind2, int ind3, int ind4)
static Vector_3 cross_product(const Vector_3 &v, const Vector_3 &w)
Real get_face_volume(Point_3< Real > ps_face[], int ne)
static void compute_center(const COM::Attribute *mesh, Vector_3< double > &cnt)
Computes the center of a body.
static void compute_swept_volumes(const COM::Attribute *location, const COM::Attribute *disps, COM::Attribute *volumes, void *flag=NULL)
Computes the swept volume by a given displacement of each face of the surface mesh of window volumes-...
Size get_num_gp(const Size doa=0) const
Get the number of Gauss points.
void set(const Value *p, Element_node_enumerator &ene, int strd)
initialize the accessor with a pointer and a specific stride.
void Jacobian(const Field &f, const Nat_coor &nc, Vector_3 J[2]) const
Evaluates the Jacobian at a given point.
void next()
Go to the next element within the connectivity tables of a pane.
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_GROUP_EMPTY INTEGER MPI_SUM