#include <Transfer_base.h>
Public Types | |
typedef Element_node_enumerator | ENE |
typedef Field< Nodal_data, ENE > | Element_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_transfer & | src |
RFC_Window_transfer & | trg |
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_transfer * | get_src_pane (int i) |
RFC_Pane_transfer * | get_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 |
Definition at line 45 of file Transfer_base.h.
typedef Field< const Nodal_coor_const, ENE> Element_coor_const |
Definition at line 51 of file Transfer_base.h.
typedef Field< Nodal_data, ENE> Element_var |
Definition at line 49 of file Transfer_base.h.
typedef Field< const Nodal_data_const, ENE> Element_var_const |
Definition at line 50 of file Transfer_base.h.
typedef Element_node_enumerator ENE |
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.
typedef Transfer_base Self |
Definition at line 53 of file Transfer_base.h.
|
inline |
Definition at line 59 of file Transfer_base.h.
References RFC_Window_derived< _Pane >::panes(), src, src_ps, trg, and trg_ps.
|
inlineprotected |
Definition at line 215 of file Transfer_base.h.
References j, k, and NULL_VECTOR.
Referenced by element_load_vector().
|
inlineprotected |
|
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().
|
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().
|
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.
|
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().
|
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().
|
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().
|
inlineprivate |
Definition at line 300 of file Transfer_base.h.
References _trg_pane, RFC_Pane_base::id(), RFC_Window_transfer::pane(), and trg.
|
protected |
Initialize load vector and the diagonal of the mass matrix.
vS | Souce data |
alpha | Parameter to control interpolation of coordinates between input meshes |
ld | Load vector |
diag | Diagonal of corresponding mass matrix. |
doa | Degree of accuracy for quadrature rule to be used |
lump | Indicates 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().
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().
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().
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.
|
protected |
|
inlineprivate |
Definition at line 266 of file Transfer_base.h.
Referenced by element_load_vector(), integrate(), integrate_subface(), and interpolate_fe().
|
inlineprivate |
Definition at line 274 of file Transfer_base.h.
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.
void interpolate_fe | ( | const _SDF & | sDF, |
Nodal_data & | tDF, | ||
bool | verb | ||
) |
Perform finite-element interpolation (non-conservative), assuming source data has been replicated.
sDF | Souce data |
tDF | Target data |
verb | Verbose level |
Referenced by Interpolator::transfer(), and transfer_2n().
|
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.
|
inlineprivate |
Definition at line 342 of file Transfer_base.h.
Referenced by element_load_vector(), integrate_subface(), interpolate_fe(), and transfer_2f().
|
inlineprivate |
Definition at line 343 of file Transfer_base.h.
|
inlineprivate |
Definition at line 344 of file Transfer_base.h.
|
inlineprivate |
Definition at line 345 of file Transfer_base.h.
|
inlineprivate |
Definition at line 346 of file Transfer_base.h.
|
inline |
Definition at line 260 of file Transfer_base.h.
Referenced by minmax().
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.
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().
|
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().
|
inlineprivate |
Definition at line 315 of file Transfer_base.h.
References RFC_Data_const< _Tag >::id(), and RFC_Pane_transfer::pointer().
|
inlineprivate |
Definition at line 322 of file Transfer_base.h.
References RFC_Data_const< _Tag >::id(), RFC_Pane_transfer::pointer(), and RFC_assertion_msg.
|
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().
|
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().
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.
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.
|
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().
|
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().
|
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().
|
protected |
Diagonal (Jacobi) preconditioner.
rhs | is the right-hand side of the system |
diag | is the diagonal of the mass matrix. |
x | is 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().
|
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().
|
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().
|
inlineprotected |
Definition at line 158 of file Transfer_base.h.
References x.
Referenced by norm2().
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.
sDF | Souce data |
tDF | Target data |
alpha | Parameter to control interpolation of coordinates between the input meshes |
doa | Degree of accuracy for quadrature rule to be used |
verb | Verbose 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().
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.
sDF | Souce data |
tDF | Target data |
alpha | Parameter to control interpolation of coordinates between the input meshes |
tol | Tolerance of iterative solver |
iter | Number of iterations of iterative solver. |
doa | Degree of accuracy for quadrature rule to be used |
verb | Verbose 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().
|
private |
Definition at line 288 of file Transfer_base.h.
Referenced by get_src_pane().
|
private |
Definition at line 289 of file Transfer_base.h.
Referenced by get_trg_pane().
|
protected |
Definition at line 284 of file Transfer_base.h.
|
protected |
Definition at line 282 of file Transfer_base.h.
Referenced by get_src_pane(), loadtransfer(), Interpolator::transfer(), transfer_2f(), transfer_2n(), and Transfer_base().
|
private |
Definition at line 291 of file Transfer_base.h.
Referenced by Transfer_base().
|
protected |
Definition at line 283 of file Transfer_base.h.
Referenced by dot(), dot2(), get_trg_pane(), init_load_vector(), interpolate_fe(), loadtransfer(), multiply_mass_mat_and_x(), norm2(), Interpolator::transfer(), transfer_2f(), transfer_2n(), and Transfer_base().
|
private |
Definition at line 292 of file Transfer_base.h.
Referenced by copy_vec(), dot(), dot2(), init_load_vector(), interpolate_fe(), invert(), multiply_mass_mat_and_x(), norm2(), precondition_Jacobi(), saxpy(), scale(), transfer_2f(), and Transfer_base().