Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Transfer_base Class Reference

#include <Transfer_base.h>

Inheritance diagram for Transfer_base:
Collaboration diagram for Transfer_base:

Public Types

typedef Element_node_enumerator ENE
 
typedef Field< Nodal_data, ENEElement_var
 
typedef Field< const
Nodal_data_const, ENE
Element_var_const
 
typedef Field< const
Nodal_coor_const, ENE
Element_coor_const
 
typedef Transfer_base Self
 
typedef std::vector
< RFC_Pane_transfer * >
::iterator 
Pane_iterator
 
typedef std::vector
< RFC_Pane_transfer * >
::const_iterator 
Pane_iterator_const
 
typedef std::vector< const
RFC_Pane_transfer * >
::const_iterator 
Pane_const_iterator
 

Public Member Functions

 Transfer_base (RFC_Window_transfer *s, RFC_Window_transfer *t)
 
template<class _SDF >
void transfer_2f (const _SDF &sDF, Facial_data &tDF, const Real alpha, int doa, bool verb)
 template function for transfering from nodes/faces to faces. More...
 
template<class _SDF >
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. More...
 
template<class _SDF >
void interpolate_fe (const _SDF &sDF, Nodal_data &tDF, bool verb)
 Perform finite-element interpolation (non-conservative), assuming source data has been replicated. More...
 
template<class _SDF >
void loadtransfer (const _SDF &vS, Nodal_data &vT, const Real alpha, const int order, bool verb)
 Computes the load vector. More...
 
void minmax (const RFC_Window_transfer &win, const Facial_data_const &sDF, Array_n &min_v, Array_n &max_v)
 
void minmax (const RFC_Window_transfer &win, const Nodal_data_const &sDF, Array_n &min_v, Array_n &max_v)
 
void integrate (const RFC_Window_transfer &win, const Nodal_data_const &sDF, Array_n &intergral, const int doa)
 
void integrate (const RFC_Window_transfer &win, const Facial_data_const &sDF, Array_n &intergral, const int doa)
 
bool isfinite (Real x)
 
template<class _Data >
RFC_BEGIN_NAME_SPACE void integrate_subface (const RFC_Pane_transfer *p_src, RFC_Pane_transfer *p_trg, const _Data &data_s, ENE &ene_src, ENE &ene_trg, int sfid_src, int sfid_trg, const Real alpha, Facial_data &tDF, Facial_data &tBF, int doa)
 
template<class _SDF >
RFC_BEGIN_NAME_SPACE void interpolate_fe (const _SDF &sDF, Nodal_data &tDF, bool verbose)
 

Protected Member Functions

template<class _SDF >
void integrate_subface (const RFC_Pane_transfer *p_src, RFC_Pane_transfer *p_trg, const _SDF &sDF, ENE &ene_src, ENE &ene_trg, int sfid_src, int sfid_trg, const Real alpha, Facial_data &tDF, Facial_data &tBF, int doa)
 
template<class _SDF >
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. More...
 
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)
 
void precondition_Jacobi (const Nodal_data_const &rhs, const Nodal_data_const &diag, Nodal_data &x)
 Diagonal (Jacobi) preconditioner. More...
 
void multiply_mass_mat_and_x (const Nodal_data_const &x, Nodal_data &y)
 
Real square (const Array_n_const &x) const
 
Real norm2 (const Nodal_data_const &x) const
 
Real dot (const Nodal_data_const &x, const Nodal_data_const &y) const
 
void dot2 (const Nodal_data_const &x1, const Nodal_data_const &y1, const Nodal_data_const &x2, const Nodal_data_const &y2, Array_n prod) const
 
void scale (const Real &a, Nodal_data &x)
 
void invert (Nodal_data &x)
 
void copy_vec (const Nodal_data_const &x, Nodal_data &y)
 
void saxpy (const Real &a, const Nodal_data_const &x, const Real &b, Nodal_data &y)
 
template<class _SDF >
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. More...
 
template<class _Data , class _Points , class _Loads , class Tag >
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. More...
 
template<class _Data >
void compute_load_prime (const Generic_element &e_s, const _Data &data_s, const Vector_3 *grads_s, Vector_3 *load_prime, Tag_nodal)
 
template<class _Data >
void compute_load_prime (const Generic_element &e_s, const _Data &data_s, const Vector_3 *grads_s, Vector_3 *load_prime, Tag_facial)
 

Protected Attributes

RFC_Window_transfersrc
 
RFC_Window_transfertrg
 
int sc
 

Private Member Functions

template<class _Value >
void interpolate (const Generic_element &e, const Element_var_const values, const Generic_element::Nat_coor &nc, _Value &v)
 
template<class _Value >
void interpolate (const Generic_element &e, const Array_n_const value, const Generic_element::Nat_coor &nc, _Value &v)
 
const RFC_Pane_transferget_src_pane (int i)
 
RFC_Pane_transferget_trg_pane (int i)
 
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. More...
 
Element_var make_field (Nodal_data &d, RFC_Pane_transfer *pn, const ENE &ene)
 
Element_var_const make_field (const Nodal_data_const &d, const RFC_Pane_transfer *pn, int)
 
const Array_n_const make_field (const Facial_data_const &d, const RFC_Pane_transfer *pn, const ENE &ene)
 
const Array_n_const make_field (const Facial_data_const &d, const RFC_Pane_transfer *pn, int i)
 
bool is_nodal (Tag_nodal) const
 
bool is_nodal (Tag_facial) const
 
bool is_nodal (const Element_var_const &) const
 
bool is_nodal (const Element_var &) const
 
bool is_nodal (const Array_n_const &) const
 

Private Attributes

const RFC_Pane_transfer_src_pane
 
RFC_Pane_transfer_trg_pane
 
std::vector< const
RFC_Pane_transfer * > 
src_ps
 
std::vector< RFC_Pane_transfer * > trg_ps
 

Detailed Description

Definition at line 45 of file Transfer_base.h.

Member Typedef Documentation

Definition at line 51 of file Transfer_base.h.

Definition at line 49 of file Transfer_base.h.

Definition at line 50 of file Transfer_base.h.

Definition at line 47 of file Transfer_base.h.

typedef std::vector<const RFC_Pane_transfer*>::const_iterator Pane_const_iterator

Definition at line 57 of file Transfer_base.h.

typedef std::vector<RFC_Pane_transfer*>::iterator Pane_iterator

Definition at line 54 of file Transfer_base.h.

typedef std::vector<RFC_Pane_transfer*>::const_iterator Pane_iterator_const

Definition at line 55 of file Transfer_base.h.

Definition at line 53 of file Transfer_base.h.

Constructor & Destructor Documentation

Definition at line 59 of file Transfer_base.h.

References RFC_Window_derived< _Pane >::panes(), src, src_ps, trg, and trg_ps.

60  : src( *s), trg( *t), sc( s->color()), _src_pane(NULL), _trg_pane(NULL)
61  { src.panes( src_ps); trg.panes( trg_ps); }
std::vector< RFC_Pane_transfer * > trg_ps
std::vector< const RFC_Pane_transfer * > src_ps
int color() const
The color of the window for overlay or for data transfer (BLUE or GREEN).
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
RFC_Window_transfer & trg
RFC_Pane_transfer * _trg_pane
const RFC_Pane_transfer * _src_pane
RFC_Window_transfer & src

Here is the call graph for this function:

Member Function Documentation

void compute_load_prime ( const Generic_element e_s,
const _Data &  data_s,
const Vector_3 grads_s,
Vector_3 load_prime,
Tag_nodal   
)
inlineprotected

Definition at line 215 of file Transfer_base.h.

References j, k, and NULL_VECTOR.

Referenced by element_load_vector().

217  {
218  Vector_3 NULL_VECTOR(0,0,0);
219  for ( unsigned int k=0; k<data_s.dimension(); ++k) {
220  load_prime[k] = NULL_VECTOR;
221  for ( unsigned int j=0; j<e_s.size_of_nodes(); ++j) {
222  load_prime[k] += data_s[j][k] * grads_s[j];
223  }
224  }
225  }
j indices k indices k
Definition: Indexing.h:6
Null_vector NULL_VECTOR
Definition: Origin.C:62
j indices j
Definition: Indexing.h:6
Some basic geometric data types.
Definition: mapbasic.h:54

Here is the caller graph for this function:

void compute_load_prime ( const Generic_element e_s,
const _Data &  data_s,
const Vector_3 grads_s,
Vector_3 load_prime,
Tag_facial   
)
inlineprotected

Definition at line 228 of file Transfer_base.h.

References k, and NULL_VECTOR.

230  {
231  Vector_3 NULL_VECTOR(0,0,0);
232  for ( unsigned int k=0; k<data_s.dimension(); ++k) {
233  load_prime[k] = NULL_VECTOR;
234  }
235  }
j indices k indices k
Definition: Indexing.h:6
Null_vector NULL_VECTOR
Definition: Origin.C:62
Some basic geometric data types.
Definition: mapbasic.h:54
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 
)
protected

Computes the element-wise load vector, and also computes mass matrix if diag has a nonnegative ID.

The mass matrix will be lumped if lump is true

Definition at line 292 of file Transfer_2n.C.

References RFC_Pane_transfer::coordinates(), RFC_Data_const< _Tag >::dimension(), element_load_vector(), RFC_Pane_transfer::get_emm(), RFC_Pane_base::get_nat_coor_in_element(), i, Element_node_enumerator::id(), make_field(), Element_node_enumerator::size_of_edges(), and Element_node_enumerator::size_of_nodes().

Referenced by init_load_vector().

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 }
Size dimension() const
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.
double Real
Definition: mapbasic.h:322
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
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
Field< const Nodal_coor_const, ENE > Element_coor_const
Definition: Transfer_base.h:51
blockLoc i
Definition: read.cpp:79
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...
An const adaptor for accessing nodal coordinates of a pane.

Here is the call graph for this function:

Here is the caller graph for this function:

void copy_vec ( const Nodal_data_const x,
Nodal_data y 
)
protected

Definition at line 248 of file Transfer_base.C.

References RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), RFC_Data< _Tag >::set_value(), and trg_ps.

Referenced by pcg(), and precondition_Jacobi().

248  {
249  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
250  Real *px = (*pit)->pointer( x.id());
251  Real *py = (*pit)->pointer( y.id());
252 
253  // Loop through the nodes of each pane.
254  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
255  y.set_value( py, i, x.get_value( px, i));
256  }
257 }
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
blockLoc i
Definition: read.cpp:79
void set_value(RFC_Pane_transfer *p, int v, const Value_const &vec)
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

Real dot ( const Nodal_data_const x,
const Nodal_data_const y 
) const
protected

Definition at line 171 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), MPI_SUM, trg, and trg_ps.

172  {
173  Real prod(0);
174 
175  for ( Pane_iterator_const pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
176  const Real *px = (*pit)->pointer( x.id());
177  const Real *py = (*pit)->pointer( y.id());
178  // Loop through the nodes of each pane.
179  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
180  if ( (*pit)->is_primary_node( i))
181  prod += x.get_value( px, i) * y.get_value( py, i);
182  }
183 
184  trg.allreduce( &prod, MPI_SUM);
185  return prod;
186 }
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
std::vector< RFC_Pane_transfer * >::const_iterator Pane_iterator_const
Definition: Transfer_base.h:55
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 allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

void dot2 ( const Nodal_data_const x1,
const Nodal_data_const y1,
const Nodal_data_const x2,
const Nodal_data_const y2,
Array_n  prod 
) const
protected

Definition at line 190 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), MPI_SUM, trg, and trg_ps.

Referenced by pcg().

194  {
195  prods[0] = prods[1] = 0;
196  for ( Pane_iterator_const pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
197  const Real *px1 = (*pit)->pointer( x1.id());
198  const Real *py1 = (*pit)->pointer( y1.id());
199  const Real *px2 = (*pit)->pointer( x2.id());
200  const Real *py2 = (*pit)->pointer( y2.id());
201  // Loop through the nodes of each pane.
202  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
203  if ( (*pit)->is_primary_node( i)) {
204  prods[0] += x1.get_value( px1, i) * y1.get_value( py1, i);
205  prods[1] += x2.get_value( px2, i) * y2.get_value( py2, i);
206  }
207  }
208 
209  trg.allreduce( prods, MPI_SUM);
210 }
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
std::vector< RFC_Pane_transfer * >::const_iterator Pane_iterator_const
Definition: Transfer_base.h:55
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 allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)
protected

Computes the element-wise load vector, and also computes mass matrix if emm is not NULL.

Note that loads and mass matrix are added to the arrays.

Definition at line 139 of file Transfer_2n.C.

References compute_load_prime(), copy, Array_n::dimension(), i, interpolate(), is_nodal(), j, k, max(), min(), n, ni, NULL_VECTOR, and v.

Referenced by compute_load_vector_wra().

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 }
j indices k indices k
Definition: Indexing.h:6
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
double Real
Definition: mapbasic.h:322
void compute_load_prime(const Generic_element &e_s, const _Data &data_s, const Vector_3 *grads_s, Vector_3 *load_prime, Tag_nodal)
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
Size dimension() const
Definition: Vector_n.h:119
*********************************************************************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
*********************************************************************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
Null_vector NULL_VECTOR
Definition: Origin.C:62
blockLoc i
Definition: read.cpp:79
const NT & n
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)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
j indices j
Definition: Indexing.h:6
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
Some basic geometric data types.
Definition: mapbasic.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

const RFC_Pane_transfer* get_src_pane ( int  i)
inlineprivate

Definition at line 295 of file Transfer_base.h.

References _src_pane, RFC_Pane_base::id(), RFC_Window_transfer::pane(), and src.

Referenced by init_load_vector(), interpolate_fe(), and transfer_2f().

295  {
296  if ( !_src_pane || _src_pane->id())
297  _src_pane = &src.pane(i);
298  return _src_pane;
299  }
RFC_Pane_transfer & pane(const int pid)
blockLoc i
Definition: read.cpp:79
const RFC_Pane_transfer * _src_pane
RFC_Window_transfer & src
int id() const

Here is the call graph for this function:

Here is the caller graph for this function:

RFC_Pane_transfer* get_trg_pane ( int  i)
inlineprivate

Definition at line 300 of file Transfer_base.h.

References _trg_pane, RFC_Pane_base::id(), RFC_Window_transfer::pane(), and trg.

300  {
301  if ( !_trg_pane || _trg_pane->id())
302  _trg_pane = &trg.pane(i);
303  return _trg_pane;
304  }
RFC_Pane_transfer & pane(const int pid)
RFC_Window_transfer & trg
RFC_Pane_transfer * _trg_pane
blockLoc i
Definition: read.cpp:79
int id() const

Here is the call graph for this function:

void init_load_vector ( const _SDF &  vS,
const Real  alpha,
Nodal_data ld,
Nodal_data diag,
int  doa,
bool  lump 
)
protected

Initialize load vector and the diagonal of the mass matrix.

Parameters
vSSouce data
alphaParameter to control interpolation of coordinates between input meshes
ldLoad vector
diagDiagonal of corresponding mass matrix.
doaDegree of accuracy for quadrature rule to be used
lumpIndicates whether to compute lump mass matrix for faster estimation of solution.

Definition at line 341 of file Transfer_2n.C.

References compute_load_vector_wra(), RFC_Data_const< _Tag >::dimension(), Face_ID::face_id, RFC_Pane_base::get_host_element_of_subface(), get_src_pane(), i, Element_node_enumerator::id(), RFC_Pane_base::id(), RFC_Data_const< _Tag >::id(), MPI_SUM, Face_ID::pane_id, RFC_Window_transfer::reduce_to_all(), trg, and trg_ps.

Referenced by loadtransfer(), and transfer_2n().

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 
382  if ( needs_diag) trg.reduce_to_all( diag, MPI_SUM);
383 }
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
const RFC_Pane_transfer * get_src_pane(int i)
int face_id
the local id within the pane starting from 1.
Size dimension() const
NT rhs
std::vector< RFC_Pane_transfer * > trg_ps
int pane_id
the id of the owner pane.
double Real
Definition: mapbasic.h:322
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
Element_node_enumerator ENE
Definition: Transfer_base.h:47
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
int id() const
void reduce_to_all(Nodal_data &, MPI_Op)
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
A global ID of a face.
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

void integrate ( const RFC_Window_transfer win,
const Nodal_data_const sDF,
Array_n intergral,
const int  doa 
)

Definition at line 372 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), RFC_Data_const< _Tag >::dimension(), i, interpolate(), make_field(), MPI_SUM, n, and RFC_Window_derived< _Pane >::panes().

375  {
376  integral = Vector_n( sDF.dimension(), 0);
377 
378  std::vector<const RFC_Pane_transfer*> ps;
379  win.panes( ps);
380 
381  Vector_n vt(sDF.dimension(), 0); Array_n t( vt.begin(), vt.end());
382 
383  Point_2 nc;
384  for (std::vector<const RFC_Pane_transfer*>::iterator
385  pit=ps.begin(); pit!=ps.end(); ++pit) {
386  ENE ene( (*pit)->base(), 1);
387  // Loop through the nodes of each pane.
388  for ( int i=1, size=(*pit)->size_of_faces(); i<=size; ++i, ene.next()) {
389  Generic_element e( ene.size_of_edges(), ene.size_of_nodes());
390 
391  Nodal_coor_const coors;
392  Element_coor_const pnts( coors, (*pit)->coordinates(), ene);
393 
394  for ( int i=0, n = e.get_num_gp(doa); i<n; ++i) {
395  e.get_gp_nat_coor( i, nc, doa);
396 
397  interpolate( e, make_field( sDF, *pit, ene), nc, t);
398  Real a=e.get_gp_weight(i, doa) * e.Jacobian_det( pnts, nc);
399  t *= a;
400  integral += t;
401  }
402  }
403  }
404 
405  // Perform global reduction
406  win.allreduce( integral, MPI_SUM);
407 }
Size dimension() 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.
double Real
Definition: mapbasic.h:322
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
Field< const Nodal_coor_const, ENE > Element_coor_const
Definition: Transfer_base.h:51
blockLoc i
Definition: read.cpp:79
const NT & n
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
An const adaptor for accessing nodal coordinates 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
void allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

void integrate ( const RFC_Window_transfer win,
const Facial_data_const sDF,
Array_n intergral,
const int  doa 
)

Definition at line 333 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), RFC_Data_const< _Tag >::dimension(), i, make_field(), MPI_SUM, n, and RFC_Window_derived< _Pane >::panes().

336  {
337  integral = Vector_n( sDF.dimension(), 0);
338 
339  std::vector<const RFC_Pane_transfer*> ps;
340  win.panes( ps);
341 
342  Vector_n vt(sDF.dimension(), 0); Array_n t( vt.begin(), vt.end());
343 
344  Point_2 nc;
345  for (std::vector<const RFC_Pane_transfer*>::iterator
346  pit=ps.begin(); pit!=ps.end(); ++pit) {
347  ENE ene( (*pit)->base(), 1);
348  // Loop through the nodes of each pane.
349  for ( int i=1, size=(*pit)->size_of_faces(); i<=size; ++i, ene.next()) {
350  Generic_element e( ene.size_of_edges(), ene.size_of_nodes());
351 
352  Nodal_coor_const coors;
353  Element_coor_const pnts( coors, (*pit)->coordinates(), ene);
354 
355  for ( int i=0, n = e.get_num_gp(doa); i<n; ++i) {
356  e.get_gp_nat_coor( i, nc, doa);
357 
358  t = make_field( sDF, *pit, ene);
359  Real a=e.get_gp_weight(i, doa) * e.Jacobian_det( pnts, nc);
360  t *= a;
361  integral += t;
362  }
363  }
364  }
365 
366  // Perform global reduction
367  win.allreduce( integral, MPI_SUM);
368 }
Size dimension() 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.
double Real
Definition: mapbasic.h:322
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
Field< const Nodal_coor_const, ENE > Element_coor_const
Definition: Transfer_base.h:51
blockLoc i
Definition: read.cpp:79
const NT & n
Element_node_enumerator ENE
Definition: Transfer_base.h:47
An const adaptor for accessing nodal coordinates 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
void allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

RFC_BEGIN_NAME_SPACE void integrate_subface ( const RFC_Pane_transfer p_src,
RFC_Pane_transfer p_trg,
const _Data &  data_s,
ENE ene_src,
ENE ene_trg,
int  sfid_src,
int  sfid_trg,
const Real  alpha,
Facial_data tDF,
Facial_data tBF,
int  doa 
)

Definition at line 43 of file Transfer_2f.C.

References RFC_Pane_transfer::coordinates(), RFC_Pane_base::get_nat_coor_in_element(), RFC_Data< _Tag >::get_value(), i, Element_node_enumerator::id(), interpolate(), is_nodal(), n, Element_node_enumerator::pane(), QUIET_NAN, Element_node_enumerator::size_of_edges(), Element_node_enumerator::size_of_nodes(), and v.

54 {
55  // Initialize natural cooredinates of the subnodes of the subface in its
56  // parent source and target faces. Compute ncs_s only if alpha!=1.
57  Point_3 ps_s[Generic_element::MAX_SIZE], ps_t[Generic_element::MAX_SIZE];
58  Point_2 ncs_s[Generic_element::MAX_SIZE], ncs_t[Generic_element::MAX_SIZE];
59 
60  Generic_element e_s(ene_src.pane()?ene_src.size_of_edges():3,
61  ene_src.pane()?ene_src.size_of_nodes():3);
62 
63  // Initialize physical and natural coordinates for source element
64  if ( is_nodal(data_s) || alpha!=1) {
65  for ( int i=0; i<3; ++i)
66  p_src->get_nat_coor_in_element( sfid_src, i, ncs_s[i]);
67 
68  if ( alpha!=1.) {
70  Element_coor_const pnts_s( nc, p_src->coordinates(), ene_src);
71 
72  for ( int i=0; i<3; ++i) e_s.interpolate( pnts_s, ncs_s[i], &ps_s[i]);
73  }
74  }
75  else {
76  std::fill_n( &ncs_s[0][0], 6, QUIET_NAN);
77  std::fill_n( &ps_s[0][0], Generic_element::MAX_SIZE*3, QUIET_NAN);
78  }
79 
80  { // Initialize physical and natural coordinates for target element
81  for ( int i=0; i<3; ++i)
82  p_trg->get_nat_coor_in_element( sfid_trg, i, ncs_t[i]);
83 
85  Generic_element e_t( ene_trg.size_of_edges(), ene_trg.size_of_nodes());
86  Element_coor_const pnts_t( nc, p_trg->coordinates(), ene_trg);
87 
88  for ( int i=0; i<3; ++i) e_t.interpolate( pnts_t, ncs_t[i], &ps_t[i]);
89  }
90 
91  // Loop throught the quadrature points of the subfacet.
92  Vector_n vt(data_s.dimension(), 0);
93  Array_n t( vt.begin(), vt.end()), v=tDF.get_value( p_trg, ene_trg.id());
94  Real &area = tBF.get_value( p_trg, ene_trg.id())[0];
95 
96  Generic_element sub_e( 3);
97  Point_2 sub_nc, nc_s;
98 
99  if ( is_nodal( data_s)) {
100  if ( doa == 0) doa = 2; // Set the default degree of accuracy
101  }
102  else
103  doa=1;
104 
105  for ( int i=0, n = sub_e.get_num_gp(doa); i<n; ++i) {
106  sub_e.get_gp_nat_coor( i, sub_nc, doa);
107 
108  if ( is_nodal( data_s))
109  sub_e.interpolate( ncs_s, sub_nc, &nc_s);
110 
111  interpolate( e_s, data_s, nc_s, t);
112 
113  Real a=sub_e.get_gp_weight(i, doa);
114  a *= sub_e.Jacobian_det( ps_s, ps_t, alpha, sub_nc);
115 
116  t *= a;
117  v += t;
118  area += a;
119  }
120 }
const Real * coordinates() const
#define QUIET_NAN
Definition: Transfer_2f.C:35
double Real
Definition: mapbasic.h:322
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
*********************************************************************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
Field< const Nodal_coor_const, ENE > Element_coor_const
Definition: Transfer_base.h:51
blockLoc i
Definition: read.cpp:79
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)
const NT & n
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)
An const adaptor for accessing nodal coordinates of a pane.
int id() const

Here is the call graph for this function:

void integrate_subface ( const RFC_Pane_transfer p_src,
RFC_Pane_transfer p_trg,
const _SDF &  sDF,
ENE ene_src,
ENE ene_trg,
int  sfid_src,
int  sfid_trg,
const Real  alpha,
Facial_data tDF,
Facial_data tBF,
int  doa 
)
protected

Referenced by transfer_2f().

Here is the caller graph for this function:

void interpolate ( const Generic_element e,
const Element_var_const  values,
const Generic_element::Nat_coor &  nc,
_Value &  v 
)
inlineprivate

Definition at line 266 of file Transfer_base.h.

Referenced by element_load_vector(), integrate(), integrate_subface(), and interpolate_fe().

270  { e.interpolate( values, nc, &v); }
*********************************************************************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

Here is the caller graph for this function:

void interpolate ( const Generic_element e,
const Array_n_const  value,
const Generic_element::Nat_coor &  nc,
_Value &  v 
)
inlineprivate

Definition at line 274 of file Transfer_base.h.

278  { v = value; }
*********************************************************************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
RFC_BEGIN_NAME_SPACE void interpolate_fe ( const _SDF &  sDF,
Nodal_data tDF,
bool  verbose 
)

Definition at line 39 of file Transfer_2n.C.

References RFC_Window_transfer::barrier(), RFC_Pane_base::base(), RFC_Data_const< _Tag >::dimension(), RFC_Pane_base::get_host_element_of_subnode(), RFC_Pane_base::get_parent_node(), get_src_pane(), RFC_Pane_base::get_subnode_counterpart(), RFC_Data< _Tag >::get_value(), get_wtime(), i, RFC_Pane_base::id(), RFC_Data_const< _Tag >::id(), interpolate(), is_nodal(), RFC_Pane_base::is_quadratic(), RFC_Window_transfer::is_root(), k, make_field(), n, RFC_Pane_transfer::need_recv(), Node_ID::node_id, Node_ID::pane_id, RFC_Pane_base::parent_type_of_subnode(), PARENT_VERTEX, RFC_Pane_transfer::pointer(), RFC_Window_transfer::reduce_maxabs_to_all(), Element_node_enumerator::size_of_edges(), RFC_Pane_base::size_of_faces(), RFC_Pane_base::size_of_isolated_nodes(), Element_node_enumerator::size_of_nodes(), RFC_Pane_base::size_of_nodes(), RFC_Pane_base::size_of_subnodes(), trg, trg_ps, and v.

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 }
int node_id
the local id within the pane starting from 1.
const RFC_Pane_transfer * get_src_pane(int i)
Size dimension() const
j indices k indices k
Definition: Indexing.h:6
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.
std::vector< RFC_Pane_transfer * > trg_ps
Base * base()
The id of its base COM::Pane object.
double Real
Definition: mapbasic.h:322
const Node_ID & get_subnode_counterpart(int i) const
void barrier() const
Block until all processes of the window have reached here.
SURF::Generic_element_2 Generic_element
Definition: rfc_basic.h:46
Field< Nodal_data, ENE > Element_var
Definition: Transfer_base.h:49
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 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
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.
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.
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
const NT & n
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
bool is_quadratic() const
Does this pane contain quadratic elements?
A global ID of a node.
int id() const
RFC_BEGIN_NAME_SPACE double get_wtime()
Definition: Timing.h:33
bool need_recv(int i) const
bool is_root() const
Check whether the process has rank 0.
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

void interpolate_fe ( const _SDF &  sDF,
Nodal_data tDF,
bool  verb 
)

Perform finite-element interpolation (non-conservative), assuming source data has been replicated.

Parameters
sDFSouce data
tDFTarget data
verbVerbose level

Referenced by Interpolator::transfer(), and transfer_2n().

Here is the caller graph for this function:

void invert ( Nodal_data x)
protected

Definition at line 237 of file Transfer_base.C.

References RFC_Data< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), Array_n::invert(), and trg_ps.

237  {
238  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
239  Real *px = (*pit)->pointer( x.id());
240  // Loop through the nodes of each pane.
241  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
242  x.get_value( px, i).invert();
243  }
244 }
std::vector< RFC_Pane_transfer * > trg_ps
double Real
Definition: mapbasic.h:322
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
Self & invert()
Definition: Vector_n.h:175
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

bool is_nodal ( Tag_nodal  ) const
inlineprivate

Definition at line 342 of file Transfer_base.h.

Referenced by element_load_vector(), integrate_subface(), interpolate_fe(), and transfer_2f().

342 { return true; }

Here is the caller graph for this function:

bool is_nodal ( Tag_facial  ) const
inlineprivate

Definition at line 343 of file Transfer_base.h.

343 { return false; }
bool is_nodal ( const Element_var_const ) const
inlineprivate

Definition at line 344 of file Transfer_base.h.

344 { return true; }
bool is_nodal ( const Element_var ) const
inlineprivate

Definition at line 345 of file Transfer_base.h.

345 { return true; }
bool is_nodal ( const Array_n_const ) const
inlineprivate

Definition at line 346 of file Transfer_base.h.

346 { return false; }
bool isfinite ( Real  x)
inline

Definition at line 260 of file Transfer_base.h.

Referenced by minmax().

260 { return x>-HUGE_VAL && x<HUGE_VAL; }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

void loadtransfer ( const _SDF &  vS,
Nodal_data vT,
const Real  alpha,
const int  order,
bool  verb 
)

Computes the load vector.

Arguments similar to transfer_2f.

See Also
transfer_2f, transfer_2n

Definition at line 493 of file Transfer_2n.C.

References RFC_Window_transfer::barrier(), RFC_Window_transfer::clear_replicated_data(), get_wtime(), init_load_vector(), RFC_Window_transfer::is_root(), RFC_Window_transfer::replicate_data(), src, and trg.

Referenced by Transfer_n2n::comp_loads(), and Transfer_f2n::comp_loads().

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 }
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
void barrier() const
Block until all processes of the window have reached here.
void clear_replicated_data()
Clear all the replicate data but keep metadata.
RFC_Window_transfer & trg
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
RFC_Window_transfer & src
RFC_BEGIN_NAME_SPACE double get_wtime()
Definition: Timing.h:33
bool is_root() const
Check whether the process has rank 0.

Here is the call graph for this function:

Here is the caller graph for this function:

Element_var_const make_field ( const Nodal_data_const d,
const RFC_Pane_transfer pn,
const ENE ene 
)
inlineprivate

Construct a element-wise accessor from nodal data and pointers.

Definition at line 308 of file Transfer_base.h.

References RFC_Data_const< _Tag >::id(), and RFC_Pane_transfer::pointer().

Referenced by compute_load_vector_wra(), integrate(), interpolate_fe(), and transfer_2f().

310  {
311  return Element_var_const( d, pn->pointer(d.id()), ene);
312  };
Field< const Nodal_data_const, ENE > Element_var_const
Definition: Transfer_base.h:50

Here is the call graph for this function:

Here is the caller graph for this function:

Element_var make_field ( Nodal_data d,
RFC_Pane_transfer pn,
const ENE ene 
)
inlineprivate

Definition at line 315 of file Transfer_base.h.

References RFC_Data_const< _Tag >::id(), and RFC_Pane_transfer::pointer().

317  {
318  return Element_var( d, pn->pointer(d.id()), ene);
319  };
Field< Nodal_data, ENE > Element_var
Definition: Transfer_base.h:49

Here is the call graph for this function:

Element_var_const make_field ( const Nodal_data_const d,
const RFC_Pane_transfer pn,
int   
)
inlineprivate

Definition at line 322 of file Transfer_base.h.

References RFC_Data_const< _Tag >::id(), RFC_Pane_transfer::pointer(), and RFC_assertion_msg.

323  {
324  RFC_assertion_msg(false, "Should never reach here. Bug in the code?");
325  return Element_var_const( d, pn->pointer(d.id()), ENE());
326  };
Field< const Nodal_data_const, ENE > Element_var_const
Definition: Transfer_base.h:50
#define RFC_assertion_msg
Definition: rfc_basic.h:67
Element_node_enumerator ENE
Definition: Transfer_base.h:47

Here is the call graph for this function:

const Array_n_const make_field ( const Facial_data_const d,
const RFC_Pane_transfer pn,
const ENE ene 
)
inlineprivate

Definition at line 329 of file Transfer_base.h.

References RFC_Data_const< _Tag >::get_value(), Element_node_enumerator::id(), RFC_Data_const< _Tag >::id(), and RFC_Pane_transfer::pointer().

331  {
332  return d.get_value( pn->pointer(d.id()), ene.id());
333  };
Value_const get_value(const RFC_Pane_transfer *p, int v) const

Here is the call graph for this function:

const Array_n_const make_field ( const Facial_data_const d,
const RFC_Pane_transfer pn,
int  i 
)
inlineprivate

Definition at line 336 of file Transfer_base.h.

References RFC_Data_const< _Tag >::get_value(), RFC_Data_const< _Tag >::id(), and RFC_Pane_transfer::pointer().

338  {
339  return d.get_value( pn->pointer(d.id()), i);
340  };
Value_const get_value(const RFC_Pane_transfer *p, int v) const
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

void minmax ( const RFC_Window_transfer win,
const Facial_data_const sDF,
Array_n min_v,
Array_n max_v 
)

Definition at line 297 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), Array_n_const::dimension(), RFC_Data_const< _Tag >::dimension(), RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), isfinite(), k, max(), min(), MPI_COMM_WORLD, MPI_MAX, MPI_MIN, RFC_Window_base::name(), RFC_Window_derived< _Pane >::panes(), and RFC_assertion.

300  {
301  min_v = Vector_n( sDF.dimension(), HUGE_VAL);
302  max_v = Vector_n( sDF.dimension(), -HUGE_VAL);
303 
304  std::vector<const RFC_Pane_transfer*> ps;
305  win.panes( ps);
306 
307  for (std::vector<const RFC_Pane_transfer*>::iterator
308  pit=ps.begin(); pit!=ps.end(); ++pit) {
309  const Real *p = (*pit)->pointer( sDF.id());
310  // Loop through the nodes of each pane.
311  for ( int i=1, size=(*pit)->size_of_faces(); i<=size; ++i) {
312  Array_n_const t = sDF.get_value( p, i);
313  for ( unsigned int k=0; k<t.dimension(); ++k) {
314  if ( !isfinite(t[k])) {
315  std::cerr << "ERROR: ****Invalid number "
316  << t[k] << " in " << win.name() << "["
317  << i-1 << "][" << k << "] (C Convention). Aborting..." << std::endl;
318  RFC_assertion( isfinite(t[k])); MPI_Abort( MPI_COMM_WORLD, -1);
319  }
320  }
321  min_v = min( min_v, t);
322  max_v = max( max_v, t);
323  }
324  }
325 
326  // Perform global reduction
327  win.allreduce( min_v, MPI_MIN);
328  win.allreduce( max_v, MPI_MAX);
329 }
std::string name() const
The name of the window.
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_COMM_WORLD
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_MAX
Size dimension() const
j indices k indices k
Definition: Indexing.h:6
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
Size dimension() const
Definition: Vector_n.h:79
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_MIN
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
bool isfinite(Real x)
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
blockLoc i
Definition: read.cpp:79
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
#define RFC_assertion
Definition: rfc_basic.h:65
void allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

void minmax ( const RFC_Window_transfer win,
const Nodal_data_const sDF,
Array_n min_v,
Array_n max_v 
)

Definition at line 261 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), Array_n_const::dimension(), RFC_Data_const< _Tag >::dimension(), RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), isfinite(), k, max(), min(), MPI_COMM_WORLD, MPI_MAX, MPI_MIN, RFC_Window_base::name(), RFC_Window_derived< _Pane >::panes(), and RFC_assertion.

264  {
265 
266  min_v = Vector_n( sDF.dimension(), HUGE_VAL);
267  max_v = Vector_n( sDF.dimension(), -HUGE_VAL);
268 
269  std::vector<const RFC_Pane_transfer*> ps;
270  win.panes( ps);
271 
272  for (std::vector<const RFC_Pane_transfer*>::iterator
273  pit=ps.begin(); pit!=ps.end(); ++pit) {
274  const Real *p = (*pit)->pointer( sDF.id());
275  // Loop through the nodes of each pane.
276  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i) {
277  Array_n_const t = sDF.get_value( p, i);
278  for ( unsigned int k=0; k<t.dimension(); ++k) {
279  if ( !isfinite(t[k])) {
280  std::cerr << "ERROR: ****Invalid number "
281  << t[k] << " in " << win.name() << "["
282  << i-1 << "][" << k << "] (C Convention). Aborting..." << std::endl;
283  RFC_assertion( isfinite(t[k])); MPI_Abort( MPI_COMM_WORLD, -1);
284  }
285  }
286  min_v = min( min_v, t);
287  max_v = max( max_v, t);
288  }
289  }
290 
291  // Perform global reduction
292  win.allreduce( min_v, MPI_MIN);
293  win.allreduce( max_v, MPI_MAX);
294 }
std::string name() const
The name of the window.
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_COMM_WORLD
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_MAX
Size dimension() const
j indices k indices k
Definition: Indexing.h:6
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
Size dimension() const
Definition: Vector_n.h:79
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_MIN
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
bool isfinite(Real x)
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
blockLoc i
Definition: read.cpp:79
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
#define RFC_assertion
Definition: rfc_basic.h:65
void allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

void multiply_mass_mat_and_x ( const Nodal_data_const x,
Nodal_data y 
)
protected

Definition at line 123 of file Transfer_base.C.

References RFC_Pane_base::base(), RFC_Data_const< _Tag >::dimension(), RFC_Pane_transfer::get_emm(), i, RFC_Data_const< _Tag >::id(), j, k, MPI_SUM, n, RFC_Pane_transfer::need_recv(), RFC_Pane_transfer::pointer(), RFC_Window_transfer::reduce_to_all(), RFC_Pane_base::size_of_faces(), trg, and trg_ps.

Referenced by pcg().

124  {
125  // Loop through the elements of the target window to integrate
126  // \int_e N_iN_j de.
127  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
128  RFC_Pane_transfer *p_trg = *pit;
129  Real *py = p_trg->pointer(y.id());
130  const Real *px = p_trg->pointer(x.id());
131 
132  // Initialize y by setting all its entries to 0.
133  Real *p = p_trg->pointer( y.id());
134  std::fill( p, p+(*pit)->size_of_nodes()*y.dimension(), Real(0));
135 
136  // Loop through the faces of each pane.
137  ENE ene( p_trg->base(), 1);
138  for ( int k=1, size=p_trg->size_of_faces(); k<=size; ++k, ene.next()) {
139  if ( !p_trg->need_recv(k)) continue;
140  Real *emm = p_trg->get_emm( k);
141  Element_var fy( y, py, ene);
142  Element_var_const fx( x, px, ene);
143 
144  // Add the submatrix onto the global matrix.
145  for ( int i=0, n=ene.size_of_nodes(); i<n; ++i) {
146  Array_n t = fy[i];
147  for ( int j=0; j<n; ++j, ++emm) t += (*emm) * fx[j];
148  }
149  }
150  }
151 
153 }
Size dimension() const
j indices k indices k
Definition: Indexing.h:6
std::vector< RFC_Pane_transfer * > trg_ps
Base * base()
The id of its base COM::Pane object.
double Real
Definition: mapbasic.h:322
Field< Nodal_data, ENE > Element_var
Definition: Transfer_base.h:49
int size_of_faces() const
The total number of faces in the pane.
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
Field< const Nodal_data_const, ENE > Element_var_const
Definition: Transfer_base.h:50
const NT & n
Element_node_enumerator ENE
Definition: Transfer_base.h:47
j indices j
Definition: Indexing.h:6
bool need_recv(int i) const
void reduce_to_all(Nodal_data &, MPI_Op)
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
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

Real norm2 ( const Nodal_data_const x) const
protected

Definition at line 156 of file Transfer_base.C.

References RFC_Window_transfer::allreduce(), RFC_Data_const< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), MPI_SUM, square(), trg, and trg_ps.

Referenced by pcg().

156  {
157  Real nrm(0);
158 
159  for ( Pane_iterator_const pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
160  const Real *p = (*pit)->pointer( x.id());
161  // Loop through the nodes of each pane.
162  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
163  if ( (*pit)->is_primary_node( i))
164  nrm += square( x.get_value( p, i));
165  }
166  trg.allreduce( &nrm, MPI_SUM);
167  return nrm;
168 }
Real square(const Array_n_const &x) const
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
std::vector< RFC_Pane_transfer * >::const_iterator Pane_iterator_const
Definition: Transfer_base.h:55
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 allreduce(Array_n &arr, MPI_Op op) const

Here is the call graph for this function:

Here is the caller graph for this function:

RFC_BEGIN_NAME_SPACE 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 
)
protected

Definition at line 40 of file Transfer_base.C.

References copy_vec(), dot2(), i, multiply_mass_mat_and_x(), norm2(), precondition_Jacobi(), saxpy(), and sqrt().

Referenced by transfer_2n().

42  {
43  Real resid, alpha, beta, rho, rho_1=0, sigma=0;
44 
45  Real normb = norm2(b);
46  Real tol_sq = *tol * *tol;
47 
48  // r = b - A*x
50  saxpy( Real(1), b, Real(-1), r);
51 
52  if (normb < 1.e-15) normb = Real(1);
53 
54  if ( (resid = norm2(r) / normb) <= tol_sq) {
55  *tol = sqrt(resid);
56  *iter = 0;
57  return 0;
58  }
59 
60  for (int i = 1; i <= *iter; i++) {
61  precondition_Jacobi( r, di, z);
63 
64  // rho = dot(r, z); sigma = dot(z, s);
65  Real gsums[2];
66 
67  dot2(r, z, z, s, Array_n(gsums,2));
68  rho = gsums[0];
69 
70  if (i==1) {
71  copy_vec( z, p);
72  copy_vec( s, q);
73  sigma = gsums[1];
74  }
75  else {
76  beta = rho / rho_1;
77  // p = z + beta * p;
78  saxpy( Real(1), z, beta, p);
79 
80  // q = s + beta * q; i.e., q = A*p;
81  saxpy( Real(1), s, beta, q);
82  sigma = gsums[1] - beta * beta * sigma;
83  }
84  alpha = rho / sigma;
85 
86  // x += alpha * p;
87  saxpy( alpha, p, Real(1), x);
88  // r -= alpha * q;
89  saxpy( -alpha, q, Real(1), r);
90 
91  if ( (resid = norm2(r) / normb) <= tol_sq) {
92  *tol = sqrt(resid);
93  *iter = i;
94  return 0;
95  }
96 
97  rho_1 = rho;
98  }
99 
100  *tol = sqrt(resid);
101  return 1;
102 }
void dot2(const Nodal_data_const &x1, const Nodal_data_const &y1, const Nodal_data_const &x2, const Nodal_data_const &y2, Array_n prod) const
void saxpy(const Real &a, const Nodal_data_const &x, const Real &b, Nodal_data &y)
double Real
Definition: mapbasic.h:322
double sqrt(double d)
Definition: double.h:73
blockLoc i
Definition: read.cpp:79
void copy_vec(const Nodal_data_const &x, Nodal_data &y)
void precondition_Jacobi(const Nodal_data_const &rhs, const Nodal_data_const &diag, Nodal_data &x)
Diagonal (Jacobi) preconditioner.
void multiply_mass_mat_and_x(const Nodal_data_const &x, Nodal_data &y)
Real norm2(const Nodal_data_const &x) const

Here is the call graph for this function:

Here is the caller graph for this function:

void precondition_Jacobi ( const Nodal_data_const rhs,
const Nodal_data_const diag,
Nodal_data x 
)
protected

Diagonal (Jacobi) preconditioner.

Parameters
rhsis the right-hand side of the system
diagis the diagonal of the mass matrix.
xis the solution vector

Definition at line 105 of file Transfer_base.C.

References copy_vec(), RFC_Data_const< _Tag >::get_value(), RFC_Data< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), q, and trg_ps.

Referenced by pcg(), and transfer_2n().

107  {
108  copy_vec( rhs, x); // Copy value from rhs to x
109 
110  // Divide x by diag.
111  for (Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
112  Real *p = (*pit)->pointer( x.id());
113  const Real *q = (*pit)->pointer( diag.id());
114 
115  // Loop through the nodes of each pane.
116  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
117  x.get_value( p, i) /= diag.get_value( q, i)[0];
118  }
119 }
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
void copy_vec(const Nodal_data_const &x, Nodal_data &y)
NT q
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

void saxpy ( const Real a,
const Nodal_data_const x,
const Real b,
Nodal_data y 
)
protected

Definition at line 213 of file Transfer_base.C.

References RFC_Data_const< _Tag >::get_value(), RFC_Data< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), and trg_ps.

Referenced by pcg().

214  {
215  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
216  Real *px = (*pit)->pointer( x.id());
217  Real *py = (*pit)->pointer( y.id());
218  // Loop through the nodes of each pane.
219  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
220  (y.get_value( py, i)*=b) += a*x.get_value( px, i);
221  }
222 }
std::vector< RFC_Pane_transfer * > trg_ps
Value_const get_value(const RFC_Pane_transfer *p, int v) const
double Real
Definition: mapbasic.h:322
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

void scale ( const Real a,
Nodal_data x 
)
protected

Definition at line 226 of file Transfer_base.C.

References RFC_Data< _Tag >::get_value(), i, RFC_Data_const< _Tag >::id(), and trg_ps.

Referenced by read_frac(), scale_mesh(), tred1(), tred2(), write_output(), and write_output_2().

226  {
227  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
228  Real *px = (*pit)->pointer( x.id());
229  // Loop through the nodes of each pane.
230  for ( int i=1, size=(*pit)->size_of_nodes(); i<=size; ++i)
231  x.get_value( px, i) *= a;
232  }
233 }
std::vector< RFC_Pane_transfer * > trg_ps
double Real
Definition: mapbasic.h:322
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

Real square ( const Array_n_const x) const
inlineprotected

Definition at line 158 of file Transfer_base.h.

References x.

Referenced by norm2().

158 { return x*x; }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

void transfer_2f ( const _SDF &  sDF,
Facial_data tDF,
const Real  alpha,
int  doa,
bool  verb 
)

template function for transfering from nodes/faces to faces.

Parameters
sDFSouce data
tDFTarget data
alphaParameter to control interpolation of coordinates between the input meshes
doaDegree of accuracy for quadrature rule to be used
verbVerbose level

Definition at line 124 of file Transfer_2f.C.

References RFC_Window_transfer::barrier(), RFC_Window_transfer::clear_replicated_data(), RFC_Window_transfer::delete_facial_buffers(), RFC_Data_const< _Tag >::dimension(), Face_ID::face_id, RFC_Window_transfer::facial_buffer(), RFC_Pane_base::get_host_element_of_subface(), RFC_Pane_base::get_parent_face(), get_src_pane(), RFC_Data< _Tag >::get_value(), get_wtime(), i, Element_node_enumerator::id(), RFC_Pane_base::id(), RFC_Data_const< _Tag >::id(), RFC_Window_transfer::init_facial_buffers(), integrate_subface(), is_nodal(), RFC_Window_transfer::is_root(), make_field(), Face_ID::pane_id, RFC_Window_transfer::replicate_data(), src, trg, and trg_ps.

Referenced by Transfer_n2f::transfer(), and Transfer_f2f::transfer().

129 {
130  double t0=0.;
131  if ( verbose) {
132  trg.barrier(); t0=get_wtime();
133  }
134 
135  src.replicate_data( sDF, alpha!=1);
136  // First, create buffer space for the target window and initialize
137  // the entries of the target mesh to zero.
138  trg.init_facial_buffers( tDF, 1);
139  Facial_data tBF ( trg.facial_buffer( 0));
140 
141  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
142  Real *trg_data = (*pit)->pointer( tDF.id());
143  Real *trg_buf = (*pit)->pointer( tBF.id());
144 
145  std::fill( trg_data, trg_data+(*pit)->size_of_faces()*tDF.dimension(), 0);
146  std::fill( trg_buf, trg_buf+(*pit)->size_of_faces(), 0);
147  }
148 
149  // Second, compute the integral over the target meshes by looping through
150  // the subfaces of the target window
151  ENE ene_src, ene_trg;
152  const RFC_Pane_transfer *p_src = NULL;
153  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
154  // Loop through the subfaces of the target window
155  for ( int i=1, size=(*pit)->size_of_subfaces(); i<=size; ++i) {
156  (*pit)->get_host_element_of_subface( i, ene_trg);
157  if ( !(*pit)->need_recv( ene_trg.id())) continue;
158 
159  const Face_ID &fid = (*pit)->get_subface_counterpart(i);
160  if ( !p_src || p_src->id()!=fid.pane_id)
161  p_src = get_src_pane( fid.pane_id);
162  if ( alpha!=1 || is_nodal( sDF.tag()) )
163  p_src->get_host_element_of_subface( fid.face_id, ene_src);
164 
165  if ( is_nodal( sDF.tag()))
166  integrate_subface( p_src, *pit,
167  make_field(sDF, p_src, ene_src),
168  ene_src, ene_trg, fid.face_id, i, alpha, tDF, tBF, doa);
169  else {
170  int id = p_src->get_parent_face( fid.face_id);
171  integrate_subface( p_src, *pit,
172  make_field(sDF, p_src, id),
173  ene_src, ene_trg, fid.face_id, i, alpha, tDF, tBF, doa);
174  }
175  }
176  }
177 
178  // Loop through the panes of the target mesh
179  for ( Pane_iterator pit=trg_ps.begin(); pit!=trg_ps.end(); ++pit) {
180  Real *trg_data = (*pit)->pointer( tDF.id());
181  Real *trg_buf = (*pit)->pointer( tBF.id());
182 
183  for ( int i=1, size=(*pit)->size_of_faces(); i<=size; ++i) {
184  if ( !(*pit)->need_recv(i)) continue;
185  tDF.get_value( trg_data, i) /= tBF.get_value( trg_buf, i)[0];
186  }
187  }
188 
189  // Clean up the transfer buffers
192 
193  if ( verbose) {
194  trg.barrier();
195  if ( trg.is_root()) {
196  std::cout << "RFACE: Transfer to faces done in "
197  << get_wtime()-t0 << " seconds." << std::endl;
198  }
199  }
200 }
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
const RFC_Pane_transfer * get_src_pane(int i)
int face_id
the local id within the pane starting from 1.
Size dimension() 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.
std::vector< RFC_Pane_transfer * > trg_ps
void integrate_subface(const RFC_Pane_transfer *p_src, RFC_Pane_transfer *p_trg, const _SDF &sDF, ENE &ene_src, ENE &ene_trg, int sfid_src, int sfid_trg, const Real alpha, Facial_data &tDF, Facial_data &tBF, int doa)
int pane_id
the id of the owner pane.
double Real
Definition: mapbasic.h:322
void barrier() const
Block until all processes of the window have reached here.
Facial_data facial_buffer(int)
void clear_replicated_data()
Clear all the replicate data but keep metadata.
int get_parent_face(int id) const
Get the local parent face id of a given subface.
RFC_Window_transfer & trg
blockLoc i
Definition: read.cpp:79
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
bool is_nodal(Tag_nodal) const
Element_node_enumerator ENE
Definition: Transfer_base.h:47
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
void init_facial_buffers(const Facial_data &nd, int)
RFC_Window_transfer & src
int id() const
RFC_BEGIN_NAME_SPACE double get_wtime()
Definition: Timing.h:33
bool is_root() const
Check whether the process has rank 0.
A global ID of a face.
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator
Definition: Transfer_base.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
sDFSouce data
tDFTarget data
alphaParameter to control interpolation of coordinates between the input meshes
tolTolerance of iterative solver
iterNumber of iterations of iterative solver.
doaDegree of accuracy for quadrature rule to be used
verbVerbose level

Definition at line 387 of file Transfer_2n.C.

References RFC_Window_transfer::barrier(), RFC_Window_transfer::clear_replicated_data(), RFC_Window_transfer::delete_nodal_buffers(), get_wtime(), init_load_vector(), RFC_Window_transfer::init_nodal_buffers(), interpolate_fe(), RFC_Window_transfer::is_root(), RFC_Window_transfer::nodal_buffer(), pcg(), precondition_Jacobi(), q, RFC_Window_transfer::reduce_maxabs_to_all(), RFC_Window_transfer::replicate_data(), s, src, trg, and z.

Referenced by Transfer_n2n::transfer(), and Transfer_f2n::transfer().

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 }
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
double s
Definition: blastest.C:80
void barrier() const
Block until all processes of the window have reached here.
void clear_replicated_data()
Clear all the replicate data but keep metadata.
void reduce_maxabs_to_all(Nodal_data &)
void int int int REAL REAL REAL * z
Definition: write.cpp:76
RFC_Window_transfer & trg
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
Nodal_data nodal_buffer(int)
void init_nodal_buffers(const Nodal_data &nd, int n, bool init_emm)
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
NT q
void precondition_Jacobi(const Nodal_data_const &rhs, const Nodal_data_const &diag, Nodal_data &x)
Diagonal (Jacobi) preconditioner.
void interpolate_fe(const _SDF &sDF, Nodal_data &tDF, bool verb)
Perform finite-element interpolation (non-conservative), assuming source data has been replicated...
RFC_Window_transfer & src
RFC_BEGIN_NAME_SPACE double get_wtime()
Definition: Timing.h:33
bool is_root() const
Check whether the process has rank 0.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const RFC_Pane_transfer* _src_pane
private

Definition at line 288 of file Transfer_base.h.

Referenced by get_src_pane().

RFC_Pane_transfer* _trg_pane
private

Definition at line 289 of file Transfer_base.h.

Referenced by get_trg_pane().

int sc
protected

Definition at line 284 of file Transfer_base.h.

std::vector<const RFC_Pane_transfer*> src_ps
private

Definition at line 291 of file Transfer_base.h.

Referenced by Transfer_base().


The documentation for this class was generated from the following files: