42 const COM::Attribute *pnts) {
44 "Argument must be elemental attribute");
47 "Argument must be double-precision scalars");
49 std::vector< COM:: Pane*> panes;
50 element_areas->window() -> panes( panes);
54 std::vector< COM::Pane*>::const_iterator it = panes.begin();
56 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
57 COM::Pane &pane = **it;
59 const COM::Attribute *nc_pane = (pnts==NULL)?pane.attribute(
COM::COM_NC):
60 pane.attribute( pnts->id());
61 COM::Attribute *a_pane = pane.attribute( element_areas->id());
63 nc_pane->stride()==3 && a_pane->stride()==1);
66 Real *ptr = (
Real *)(a_pane->pointer());
70 for (
int j=pane.size_of_elements();
j>0; --
j, ene.
next(),++ptr) {
72 ps.
set( pnts, ene, 1);
73 int size = e.get_num_gp();
76 for (
int k = 0;
k<size;
k++){
77 Real weight = e.get_gp_weight(
k);
78 e.get_gp_nat_coor(
k, nc);
79 Real jacobi_det = e.Jacobian_det(ps,nc);
80 this_area += weight * jacobi_det;
91 "Argument must be elemental attribute");
93 "Argument must be double precision");
95 const int ncomp = x->size_of_components();
97 for (
int kk=0; kk<ncomp; ++kk) z[kk]=0.;
99 std::vector< const COM:: Pane*> panes;
100 x->window()-> panes( panes);
104 std::vector< const COM::Pane*>::const_iterator it = panes.begin();
106 for (
int i=0, local_npanes = panes.size();
i<local_npanes; ++
i, ++it){
107 const COM::Pane &pane = **it;
109 const COM::Attribute *nc_pane = pane.attribute(
COM::COM_NC);
110 const COM::Attribute *x_pane = pane.attribute( x->id());
112 nc_pane->stride()==3 && x_pane->stride()==ncomp);
115 const Real *xptr = (
Real *)(x_pane->pointer());
119 for (
int j=pane.size_of_elements();
j>0; --
j, ene.
next(), xptr+=ncomp) {
121 ps.
set( pnts, ene, 1);
122 int size = e.get_num_gp();
124 for (
int k = 0;
k<size;
k++){
125 Real weight = e.get_gp_weight(
k);
126 e.get_gp_nat_coor(
k, nc);
127 Real jacobi_det = e.Jacobian_det(ps,nc);
129 for (
int kk=0; kk<ncomp; ++kk)
130 z[kk] += weight * jacobi_det * xptr[kk];
137 std::vector<double> lval(ncomp);
139 MPI_Allreduce( &lval[0], z, ncomp, MPI_DOUBLE,
MPI_SUM,
140 x->window()->get_communicator());
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
An adaptor for enumerating node IDs of an element.
#define COM_assertion_msg(EX, msg)
#define SURF_END_NAMESPACE
Encapsulation of the element-wise computations for two-dimensional elements.
#define SURF_BEGIN_NAMESPACE
This is a helper class for accessing nodal data.
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
void int int int REAL REAL REAL * z
int size_of_edges() const
Number of edges per element.
int COM_compatible_types(COM_Type type1, COM_Type type2)
static void integrate(const COM::Attribute *x, double *z)
Integrate a function given by an elemental attribute over surface z is an array of size equal to numb...
int size_of_nodes() const
Number of nodes per element.
void set(const Value *p, Element_node_enumerator &ene, int strd)
initialize the accessor with a pointer and a specific stride.
void next()
Go to the next element within the connectivity tables of a pane.
static void compute_element_areas(COM::Attribute *areas, const COM::Attribute *pnts=NULL)
Computes the area of each face of the surface mesh of window areas->window and saves the results in a...
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