35 #define QUIET_NAN std::numeric_limits<Real>::quiet_NaN()
41 template <
class _Data>
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];
65 for (
int i=0;
i<3; ++
i)
72 for (
int i=0; i<3; ++
i) e_s.interpolate( pnts_s, ncs_s[i], &ps_s[i]);
77 std::fill_n( &ps_s[0][0], Generic_element::MAX_SIZE*3,
QUIET_NAN);
81 for (
int i=0;
i<3; ++
i)
88 for (
int i=0; i<3; ++
i) e_t.interpolate( pnts_t, ncs_t[i], &ps_t[i]);
100 if ( doa == 0) doa = 2;
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);
109 sub_e.interpolate( ncs_s, sub_nc, &nc_s);
113 Real a=sub_e.get_gp_weight(
i, doa);
114 a *= sub_e.Jacobian_det( ps_s, ps_t, alpha, sub_nc);
122 template <
class _SDF>
142 Real *trg_data = (*pit)->pointer( tDF.
id());
143 Real *trg_buf = (*pit)->pointer( tBF.id());
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);
151 ENE ene_src, ene_trg;
155 for (
int i=1, size=(*pit)->size_of_subfaces();
i<=size; ++
i) {
157 if ( !(*pit)->need_recv( ene_trg.
id()))
continue;
159 const Face_ID &fid = (*pit)->get_subface_counterpart(
i);
162 if ( alpha!=1 ||
is_nodal( sDF.tag()) )
168 ene_src, ene_trg, fid.
face_id,
i, alpha, tDF, tBF, doa);
173 ene_src, ene_trg, fid.
face_id,
i, alpha, tDF, tBF, doa);
180 Real *trg_data = (*pit)->pointer( tDF.
id());
181 Real *trg_buf = (*pit)->pointer( tBF.id());
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];
196 std::cout <<
"RFACE: Transfer to faces done in "
197 <<
get_wtime()-t0 <<
" seconds." << std::endl;
204 const Real alpha,
int doa,
bool verb) {
210 const Real alpha,
int doa,
bool verb) {
void replicate_data(const Facial_data_const &data, bool replicate_coor)
Replicate the given data from remote processes onto local process.
void transfer(const Nodal_data_const &sv, Facial_data &tf, const Real alpha, int doa=0, bool verb=false)
The main entry to the data transfer algorithm.
An adaptor for enumerating node IDs of an element.
const RFC_Pane_transfer * get_src_pane(int i)
int face_id
the local id within the pane starting from 1.
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.
void delete_facial_buffers()
std::vector< RFC_Pane_transfer * > trg_ps
Adpator for element-wise data container.
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.
void barrier() const
Block until all processes of the window have reached here.
SURF::Generic_element_2 Generic_element
Facial_data facial_buffer(int)
int id() const
Get the local id of the element within 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
#define RFC_END_NAME_SPACE
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.
int size_of_edges() const
Number of edges per element.
RFC_Window_transfer & trg
#define RFC_BEGIN_NAME_SPACE
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...
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.
Value_nonconst get_value(RFC_Pane_transfer *p, int v)
int size_of_nodes() const
Number of nodes per element.
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)
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
void init_facial_buffers(const Facial_data &nd, int)
An const adaptor for accessing nodal coordinates of a pane.
RFC_Window_transfer & src
RFC_BEGIN_NAME_SPACE double get_wtime()
bool is_root() const
Check whether the process has rank 0.
void transfer(const Facial_data_const &sf, Facial_data &tf, const Real alpha, int doa=0, bool verb=false)
The main entry to the data transfer algorithm.
const Pane * pane() const
std::vector< RFC_Pane_transfer * >::iterator Pane_iterator