Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Transfer_2n.C
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: Transfer_2n.C,v 1.10 2008/12/06 08:43:29 mtcampbe Exp $
24 
25 //===================================================================
26 // This file contains the implementation for transfering data from nodes
27 // to nodes and from faces to nodes.
28 //
29 //===================================================================
30 
31 #include "Transfer_2n.h"
32 
34 
35 // This function obtains the initial guess for the unknowns
36 // by transfering them from the source mesh.
37 template <class _SDF>
38 void Transfer_base::
39 interpolate_fe( const _SDF &sDF, Nodal_data &tDF, bool verbose)
40 {
41  double t0=0.;
42  if ( verbose) {
43  trg.barrier(); t0=get_wtime();
44  }
45 
46  std::vector<bool> flags;
47  // Loop through all the panes of target window
48  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
49  RFC_Pane_transfer *p_trg = *pit;
50  Real *p = p_trg->pointer( tDF.id());
51  std::fill( p, p+p_trg->size_of_nodes()*tDF.dimension(), Real(0));
52  flags.clear(); flags.resize(p_trg->size_of_nodes()+1, false);
53 
54  // Loop through the faces to mark the ones that expect values.
55  ENE ene( p_trg->base(), 1);
56  for ( int k=1, size=p_trg->size_of_faces(); k<=size; ++k, ene.next()) {
57  if ( !p_trg->need_recv(k)) continue;
58 
59  for ( int i=0, n=ene.size_of_nodes(); i<n; ++i) flags[ene[i]] = true;
60  }
61 
62  ENE ene_src;
63  Point_2 nc;
64  const RFC_Pane_transfer *p_src = NULL;
65  int count=0, nnodes=p_trg->size_of_nodes()-p_trg->size_of_isolated_nodes();
66 
67  // Loop through the subnodes of the target window
68  for ( int i=1, size=p_trg->size_of_subnodes(); i<=size; ++i) {
69 
70  int svid_trg = i;
71  if ( p_trg->parent_type_of_subnode( svid_trg) != PARENT_VERTEX)
72  { if ( count >= nnodes) break; else continue; }
73  else ++count;
74 
75  int pvid_trg = p_trg->get_parent_node( svid_trg);
76  if ( !flags[pvid_trg]) continue;
77 
78  const Node_ID &SVID_src = p_trg->get_subnode_counterpart( svid_trg);
79  if ( !p_src || p_src->id()!=SVID_src.pane_id)
80  p_src = get_src_pane( SVID_src.pane_id);
81 
82  int svid_src = SVID_src.node_id;
83  p_src->get_host_element_of_subnode(svid_src, ene_src, nc);
84 
85  Array_n v = tDF.get_value( p, pvid_trg);
86 
87  if ( is_nodal(sDF.tag())) {
88  Generic_element e( ene_src.size_of_edges(), ene_src.size_of_nodes());
89  interpolate( e, make_field( sDF, p_src, ene_src), nc, v);
90  }
91  else {
93  make_field( sDF, p_src, ene_src), nc, v);
94  }
95  }
96 
97  // If linear, we are done with this pane
98  if ( !p_trg->is_quadratic()) continue;
99 
100  // Otherwise, we must interpolate values to other nodes.
101  // We now loop through the faces of the pane.
102  ene = ENE( p_trg->base(), 1);
103  for ( int k=1, size=p_trg->size_of_faces(); k<=size; ++k, ene.next()) {
104  if ( !p_trg->need_recv(k)) continue; // Skip the face if not receiving
105  Element_var f( tDF, p_trg->pointer( tDF.id()), ene);
106 
107  switch ( ene.size_of_nodes()) {
108  case 6:
109  f[3] = 0.5*(f[0]+f[1]);
110  f[4] = 0.5*(f[1]+f[2]);
111  f[5] = 0.5*(f[2]+f[0]);
112  break;
113  case 9:
114  f[8] = 0.25*(f[0]+f[1]+f[2]+f[3]); // Then continue as 8-nodes
115  case 8:
116  f[4] = 0.5*(f[0]+f[1]);
117  f[5] = 0.5*(f[1]+f[2]);
118  f[6] = 0.5*(f[2]+f[3]);
119  f[7] = 0.5*(f[3]+f[0]);
120  break;
121  }
122  }
123  }
124 
126 
127  if ( verbose) {
128  // Output timing information
129  trg.barrier();
130  if ( trg.is_root())
131  std:: cout << "RFACE: Interpolation done in "
132  << get_wtime()-t0 << " seconds." << std::endl;
133  }
134 }
135 
136 // Computes the element-wise load vector and mass matrix.
137 template < class _Data, class _Points, class _Loads, class Tag>
138 void Transfer_base::
139 element_load_vector( const _Data &data_s,
140  const Generic_element &e_s,
141  const Generic_element &e_t,
142  const _Points &pnts_s,
143  const _Points &pnts_t,
144  const Point_2 *ncs_s,
145  const Point_2 *ncs_t,
146  const Real alpha,
147  const int sne,
148  const Tag &tag,
149  _Loads loads,
150  _Loads diag,
151  Real *emm_out,
152  int doa,
153  bool lump)
154 {
155  const unsigned int n = e_t.size_of_nodes();
156 
157  Generic_element sub_e( sne);
158  Vector_n vt(data_s.dimension(), 0); Array_n v( vt.begin(), vt.end());
159 
160  // Interpolate the coordinates.
161  Point_3 ps_s[Generic_element::MAX_SIZE];
162  Point_3 ps_t[Generic_element::MAX_SIZE];
163  for ( int i=0; i<sne; ++i) e_t.interpolate( pnts_t, ncs_t[i], &ps_t[i]);
164  if ( alpha!=1.)
165  for ( int i=0; i<sne; ++i) e_s.interpolate( pnts_s, ncs_s[i], &ps_s[i]);
166 
167  // Set the default degree of accuracy for the quadrature rules.
168  if ( is_nodal( data_s))
169  { if ( doa == 0) doa = std::max(e_t.order(), e_s.order())==1? 2 : 4; }
170  else doa=1;
171 
172  // Create a local buffer for element-mass-matrix. Note that only
173  // lower triangle matrix is computed, as emm is symmetric.
174  Real emm[Generic_element::MAX_SIZE*Generic_element::MAX_SIZE];
175  bool compute_mass = diag.dimension()>0;
176  if ( compute_mass) std::fill(emm, emm+n*n, 0.);
177 
178 #ifdef SOBOLEV
179  // Evaluate the gradient as well for Sobolev minimization
180  std::vector<Real> esf(n*n,0.);
181  std::vector<Vector_n> l_t(n,Vector_n(data_s.dimension(),0));
182 #endif
183 
184  Point_2 sub_nc, nc_s, nc_t;
185  Real N[Generic_element::MAX_SIZE];
186  // Loop through the quadrature points of the subelement
187  for ( int i=0, ni=sub_e.get_num_gp(doa); i < ni; ++i) {
188  sub_e.get_gp_nat_coor( i, sub_nc, doa);
189  sub_e.interpolate( ncs_s, sub_nc, &nc_s);
190 
191  // Interploate to the quadrature point
192  interpolate( e_s, data_s, nc_s, v);
193 
194  // Compute area of subelement in target element
195  Real a_t=sub_e.get_gp_weight(i, doa), a_s=a_t;
196  a_t *= sub_e.Jacobian_det( ps_t, sub_nc);
197 
198  // Compute area of subelement in source element. Use target area if alpha=1
199  if ( alpha!=1.) a_s *= sub_e.Jacobian_det( ps_s, sub_nc);
200  else a_s = a_t;
201 
202  v *= a_s;
203  sub_e.interpolate( ncs_t, sub_nc, &nc_t);
204  e_t.shape_func( nc_t, N);
205 
206 #if SOBOLEV
207  Vector_3 grads_t[Generic_element::MAX_SIZE];
208  e_t.gradients( pnts_t, nc_t, grads_t);
209 
210  std::vector<Vector_3> load_prime( data_s.dimension(), NULL_VECTOR);
211 
212  Vector_3 grads_s[Generic_element::MAX_SIZE];
213  if ( alpha!=1)
214  e_s.gradients( pnts_s, nc_s, grads_s);
215  else
216  std::copy(grads_t,grads_t+n, grads_s);
217  compute_load_prime( e_s, data_s, grads_s, &load_prime[0], tag);
218 #endif
219 
220  for ( unsigned int j=0; j<n; ++j) {
221  loads[j] += N[j] * v;
222  if ( compute_mass) {
223  for ( unsigned int k=0; k<=j; ++k)
224  emm[j*n+k] += N[j]*N[k]*a_t;
225  }
226 #if SOBOLEV
227  for ( unsigned int k=0; k<data_s.dimension(); ++k)
228  l_t[j][k] += grads_t[j]*load_prime[k]*area;
229 
230  if ( !lump && compute_mass) {
231  for ( unsigned int k=0; k<=j; ++k) {
232  // Weigh esf by the stretch ratio.
233  esf[j*n+k] += grads_t[j]*grads_t[k]*area;
234  }
235  }
236 #endif
237  }
238  }
239 
240 #if SOBOLEV
241  Real mu=-1;
242  if ( mu<0 && !lump && compute_mass) {
243  Real t1=0, t2=0;
244  // Evaluate mu
245  for ( unsigned int j=0; j<n; ++j) {
246  for ( unsigned int k=0; k<j; ++k) {
247  t1 += emm[j*n+k]*esf[j*n+k]; t2 += esf[j*n+k]*esf[j*n+k];
248  }
249  }
250  mu = -t1 / t2;
251  }
252 
253  if ( mu > 0) {
254  // Add the stiffness to the mass matrix.
255  for ( unsigned int j=0; j<n; ++j) {
256  loads[j] += mu * l_t[j];
257 
258  if ( emm_out) {
259  for ( unsigned int k=0; k<=j; ++k) {
260  emm[j*n+k] += mu*esf[j*n+k];
261  }
262  }
263  }
264  }
265 #endif
266 
267  // Add emm onto emm_out and/or diag. Note that emm only saves lower triangle
268  if ( compute_mass) {
269  for ( unsigned int j=0; j<n; ++j) {
270  // Update the diagonal
271  if ( lump) {
272  // Lump the mass matrix
273  for ( unsigned int k=0; k<n; ++k)
274  diag[j][0] += emm[std::max(j,k)*n+std::min(j,k)];
275  }
276  else // Otherwise, add only the diagonal entries
277  diag[j][0] += emm[j*n+j];
278  }
279 
280  // Update the element mass matrix. Adding lower triangle to the
281  // diagonal and upper triangle as well.
282  if ( emm_out) {
283  for ( unsigned int j=0; j<n; ++j)
284  for ( unsigned int k=0; k<n; ++k)
285  emm_out[j*n+k] += emm[std::max(j,k)*n+std::min(j,k)];
286  }
287  }
288 }
289 
290 template < class _SDF>
291 void Transfer_base::
293  RFC_Pane_transfer *p_trg,
294  const _SDF &sDF,
295  ENE &ene_src,
296  ENE &ene_trg,
297  int sfid_src,
298  int sfid_trg,
299  const Real alpha,
300  Nodal_data &rhs,
301  Nodal_data &diag,
302  int doa,
303  bool lump)
304 {
305  // Construct generic elements in parent source and target elements
306  Generic_element e_src( ene_src.size_of_edges(), ene_src.size_of_nodes());
307  Generic_element e_trg( ene_trg.size_of_edges(), ene_trg.size_of_nodes());
308 
309  // Obtain the local coordinates in source and target elements
310  Point_2 ncs_src[3], ncs_trg[3];
311  for ( int i=0; i<3; ++i) {
312  p_src->get_nat_coor_in_element( sfid_src, i, ncs_src[i]);
313  p_trg->get_nat_coor_in_element( sfid_trg, i, ncs_trg[i]);
314  }
315 
316  // Construct enumerators for nodal vertices in source and target elements
317  Nodal_coor_const nc;
318  Element_coor_const pnts_s( nc, p_src->coordinates(), ene_src);
319  Element_coor_const pnts_t( nc, p_trg->coordinates(), ene_trg);
320 
321  // Initialize pointer to element mass matrix. If a lumped mass matrix
322  // is desired, then use a local buffer to store the element matrix.
323  Real *pemm=NULL;
324 
325  bool needs_diag = diag.dimension()>0;
326  // Compute the element mass matrix only needs_diag is true.
327  if ( needs_diag)
328  pemm = lump ? (Real*)NULL : p_trg->get_emm( ene_trg.id());
329 
330  // Invoke the implementation to compute load vector and mass matrix.
331  element_load_vector( make_field( sDF, p_src, ene_src),
332  e_src, e_trg, pnts_s, pnts_t, ncs_src, ncs_trg,
333  alpha, 3, sDF.tag(),
334  make_field( rhs, p_trg, ene_trg),
335  make_field( diag, p_trg, ene_trg),
336  pemm, doa, lump);
337 }
338 
339 template < class _SDF>
340 void Transfer_base::
341 init_load_vector( const _SDF &sDF,
342  const Real alpha,
343  Nodal_data &rhs,
344  Nodal_data &diag,
345  int doa,
346  bool lump)
347 {
348  bool needs_diag = diag.dimension()>0;
349 
350  // First, initialize the entries of the target mesh to zero.
351  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
352  Real *p = (*pit)->pointer( rhs.id());
353  std::fill( p, p+(*pit)->size_of_nodes()*rhs.dimension(), Real(0));
354 
355  if ( needs_diag) {
356  p = (*pit)->pointer( diag.id());
357  std::fill( p, p+(*pit)->size_of_nodes()*diag.dimension(), Real(0));
358  }
359  }
360 
361  // Second, compute the integral over the target meshes by looping through
362  // the subfaces of the target window
363  ENE ene_src, ene_trg;
364  const RFC_Pane_transfer *p_src = NULL;
365  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
366  // Loop through the subfaces of the target window
367  for ( int i=1, size=(*pit)->size_of_subfaces(); i<=size; ++i) {
368  (*pit)->get_host_element_of_subface( i, ene_trg);
369  if ( !(*pit)->need_recv( ene_trg.id())) continue;
370 
371  const Face_ID &fid = (*pit)->get_subface_counterpart(i);
372  if ( !p_src || p_src->id()!=fid.pane_id)
373  p_src = get_src_pane( fid.pane_id);
374  p_src->get_host_element_of_subface( fid.face_id, ene_src);
375 
376  compute_load_vector_wra( p_src, *pit, sDF, ene_src, ene_trg,
377  fid.face_id, i, alpha, rhs, diag, doa, lump);
378  }
379  }
380 
381  trg.reduce_to_all( rhs, MPI_SUM);
382  if ( needs_diag) trg.reduce_to_all( diag, MPI_SUM);
383 }
384 
385 template < class _SDF>
386 void Transfer_base::
387 transfer_2n( const _SDF &sDF, Nodal_data &tDF, const Real alpha,
388  Real *tol, int *iter, int doa, bool verbose)
389 {
390  double t0(0);
391 
392  if ( verbose) {
393  trg.barrier(); t0 = get_wtime();
394  }
395 
396  // Allocate buffers
397  trg.init_nodal_buffers( tDF, (*iter>0)?7:3, (*iter>0));
398  Nodal_data b( trg.nodal_buffer(0));
400  Nodal_data diag( trg.nodal_buffer(2));
401 
402  bool needs_source_coor = alpha!=1.;
403  // Replicate the data of the source mesh (including coordinates if alpha!=1)
404  src.replicate_data( sDF, needs_source_coor);
405 
406  bool lump = *iter<=0; // whether to lump mass matrix
407 
408  // Initialize the load vector and the diagonal vector.
409  init_load_vector( sDF, alpha, b, diag, doa, lump);
410 
411  // Obtaining an initial guess by interpolation.
412  if ( !lump) interpolate_fe( sDF, tDF, false);
413 
414  // Clear up replicated data after obtaining the load vector and interpolation
416 
417  if ( *iter>0) {
418  Nodal_data p( trg.nodal_buffer(3));
420  Nodal_data r( trg.nodal_buffer(5));
422 
423  int ierr=pcg( tDF, b, p, q, r, s, z, diag, tol, iter);
424 
425  if (ierr) {
426  std::cerr << "***RFACE: WARNING: PCG did not converge after "
427  << *iter << " iterations and relative error is "
428  << *tol << std::endl;
429  }
430  }
431  else {
432  precondition_Jacobi( b, diag, tDF);
433  }
434 
436 
437  // Delete buffer spaces
439 
440  if ( verbose) {
441  trg.barrier();
442  if ( trg.is_root()) {
443  std:: cout << "RFACE: Transfer to nodes done in "
444  << get_wtime()-t0 << " seconds";
445  if ( *iter > 0)
446  std:: cout << " with relative error "
447  << *tol << " after " << *iter << " iterators"
448  << std::endl;
449  else
450  std:: cout << "." << std::endl;
451  }
452  }
453 }
454 
455 void Transfer_n2n::
456 transfer( const Nodal_data_const &sv, Nodal_data &tv, const Real alpha,
457  Real *tol, int *iter, int doa, bool verbose)
458 {
459  Base::transfer_2n( sv, tv, alpha, tol, iter, doa, verbose);
460 }
461 
462 void Transfer_f2n::
463 transfer( const Facial_data_const &sf, Nodal_data &tv, const Real alpha,
464  Real *tol, int *iter, int doa, bool verbose)
465 {
466  Base::transfer_2n( sf, tv, alpha, tol, iter, doa, verbose);
467 }
468 
469 void Interpolator::
470 transfer( const Nodal_data_const &sv, Nodal_data &tv, bool verbose)
471 {
472  double t0=0.;
473  if ( verbose) {
474  trg.barrier(); t0=get_wtime();
475  }
476 
477  src.replicate_data( sv, false); // replicate data but not the coordinates
478  Base::interpolate_fe( sv, tv, verbose);
480 
481  if ( verbose) {
482  // Output timing information
483  trg.barrier();
484  if ( trg.is_root())
485  std:: cout << "RFACE: Interpolation done in "
486  << get_wtime()-t0 << " seconds." << std::endl;
487  }
488 }
489 
490 // This function computes the load vector.
491 template <class _SDF>
492 void Transfer_base::
493 loadtransfer( const _SDF &sDF, Nodal_data &tDF, const Real alpha,
494  const int order, bool verbose)
495 {
496  double t0=0.;
497  if ( verbose) {
498  trg.barrier(); t0=get_wtime();
499  }
500 
501  // Replicate the data of the source mesh (including coordinates if alpha!=1)
502  bool needs_source_coor = alpha!=1.;
503  src.replicate_data( sDF, needs_source_coor);
504 
505  Nodal_data dummy;
506  init_load_vector( sDF, alpha, tDF, dummy, order, false);
508 
509  if ( verbose) {
510  // Output timing information
511  trg.barrier();
512  if ( trg.is_root())
513  std:: cout << "RFACE: Load transfer done in "
514  << get_wtime()-t0 << " seconds." << std::endl;
515  }
516 }
517 
518 void Transfer_n2n::
520  const Real alpha, const int order, bool verbose)
521 {
522  Base::loadtransfer( sv, tv, alpha, order, verbose);
523 }
524 
525 void Transfer_f2n::
527  const Real alpha, const int order, bool verbose)
528 {
529  Base::loadtransfer( sv, tv, alpha, order, verbose);
530 }
531 
533 
534 
535 
536 
537 
538 
void loadtransfer(const _SDF &vS, Nodal_data &vT, const Real alpha, const int order, bool verb)
Computes the load vector.
Definition: Transfer_2n.C:493
void transfer(const Nodal_data_const &sf, Nodal_data &tf, const Real alpha, Real *t, int *iter, int doa, bool ver)
The main entry to the data transfer algorithm.
Definition: Transfer_2n.C:456
int node_id
the local id within the pane starting from 1.
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
void compute_load_vector_wra(const RFC_Pane_transfer *p_src, RFC_Pane_transfer *p_dst, const _SDF &sDF, ENE &ene_src, ENE &ene_trg, int sfid_src, int sfid_trg, const Real alpha, Nodal_data &rhs, Nodal_data &diag, int doa, bool lump)
Computes the element-wise load vector, and also computes mass matrix if diag has a nonnegative ID...
Definition: Transfer_2n.C:292
void transfer_2n(const _SDF &sDF, Nodal_data &tDF, const Real alpha, Real *tol, int *iter, int doa, bool verb)
template function for transfering from nodes/faces to nodes.
Definition: Transfer_2n.C:387
An adaptor for enumerating node IDs of an element.
const RFC_Pane_transfer * get_src_pane(int i)
int face_id
the local id within the pane starting from 1.
Size dimension() const
j indices k indices k
Definition: Indexing.h:6
const Real * coordinates() const
Element_var_const make_field(const Nodal_data_const &d, const RFC_Pane_transfer *pn, const ENE &ene)
Construct a element-wise accessor from nodal data and pointers.
NT rhs
double s
Definition: blastest.C:80
std::vector< RFC_Pane_transfer * > trg_ps
Base * base()
The id of its base COM::Pane object.
Adpator for element-wise data container.
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
int pane_id
the id of the owner pane.
double Real
Definition: mapbasic.h:322
const Node_ID & get_subnode_counterpart(int i) const
void compute_load_prime(const Generic_element &e_s, const _Data &data_s, const Vector_3 *grads_s, Vector_3 *load_prime, Tag_nodal)
void barrier() const
Block until all processes of the window have reached here.
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
Size dimension() const
Definition: Vector_n.h:119
int parent_type_of_subnode(int) const
Determine the parent type of a subnode of given tyep.
int size_of_faces() const
The total number of faces in the pane.
int size_of_isolated_nodes() const
int id() const
Get the local id of the element within the pane.
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
*********************************************************************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 and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void element_load_vector(const _Data &data_s, const Generic_element &e_s, const Generic_element &e_t, const _Points &pnts_s, const _Points &pnts_t, const Point_2 *ncs_s, const Point_2 *ncs_t, const Real alpha, const int sne, const Tag &tag, _Loads loads, _Loads diag, Real *emm, int doa, bool lump)
Computes the element-wise load vector, and also computes mass matrix if emm is not NULL...
Definition: Transfer_2n.C:139
#define RFC_END_NAME_SPACE
Definition: rfc_basic.h:29
*********************************************************************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
Definition: roccomf90.h:20
void clear_replicated_data()
Clear all the replicate data but keep metadata.
int pane_id
the id of the owner pane.
void reduce_maxabs_to_all(Nodal_data &)
int get_parent_node(int) const
Get the local parent node id of a given subnode.
Null_vector NULL_VECTOR
Definition: Origin.C:62
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void get_host_element_of_subnode(int i, Element_node_enumerator &ene, Point_2 &nc) const
int size_of_nodes() const
The total number of nodes in the pane.
int size_of_edges() const
Number of edges per element.
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
#define RFC_BEGIN_NAME_SPACE
Definition: rfc_basic.h:28
void get_nat_coor_in_element(const int eid, const int lid, Point_2 &nc) const
Take a subface id and a local subnode id, return the natual coordinates of the subnode within the par...
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
int size_of_nodes() const
Number of nodes per element.
int pcg(Nodal_data &x, Nodal_data &b, Nodal_data &p, Nodal_data &q, Nodal_data &r, Nodal_data &s, Nodal_data &z, Nodal_data &di, Real *tol, int *max_iter)
Definition: Transfer_base.C:40
const NT & n
Nodal_data nodal_buffer(int)
bool is_nodal(Tag_nodal) const
void interpolate(const Generic_element &e, const Element_var_const values, const Generic_element::Nat_coor &nc, _Value &v)
Element_node_enumerator ENE
Definition: Transfer_base.h:47
void init_nodal_buffers(const Nodal_data &nd, int n, bool init_emm)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
void init_load_vector(const _SDF &vS, const Real alpha, Nodal_data &ld, Nodal_data &diag, int doa, bool lump)
Initialize load vector and the diagonal of the mass matrix.
Definition: Transfer_2n.C:341
j indices j
Definition: Indexing.h:6
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
NT q
void precondition_Jacobi(const Nodal_data_const &rhs, const Nodal_data_const &diag, Nodal_data &x)
Diagonal (Jacobi) preconditioner.
An const adaptor for accessing nodal coordinates of a pane.
void interpolate_fe(const _SDF &sDF, Nodal_data &tDF, bool verb)
Perform finite-element interpolation (non-conservative), assuming source data has been replicated...
bool is_quadratic() const
Does this pane contain quadratic elements?
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
Some basic geometric data types.
Definition: mapbasic.h:54
RFC_Window_transfer & src
void transfer(const Facial_data_const &sf, Nodal_data &tf, const Real alpha, Real *tol, int *iter, int doa, bool verb)
The main entry to the data transfer algorithm.
Definition: Transfer_2n.C:463
A global ID of a node.
int id() const
RFC_BEGIN_NAME_SPACE double get_wtime()
Definition: Timing.h:33
void comp_loads(const Facial_data_const &sf, Nodal_data &tf, const Real alpha, const int order, bool verb)
Compute the nodal load vector.
Definition: Transfer_2n.C:526
void transfer(const Nodal_data_const &sf, Nodal_data &tf, bool verb)
The main entry to the data transfer algorithm.
Definition: Transfer_2n.C:470
bool need_recv(int i) const
void reduce_to_all(Nodal_data &, MPI_Op)
bool is_root() const
Check whether the process has rank 0.
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
void comp_loads(const Nodal_data_const &sf, Nodal_data &tf, const Real alpha, const int doa, bool verb)
Compute the nodal load vector.
Definition: Transfer_2n.C:519
A global ID of a face.
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54