47 template<
class T,
unsigned D,
class M,
class C>
55 #define COMPONENT_APPLY_BUILTIN(OP,T) \
56 inline void PETE_apply(const OP<T>&, T&, const T&) \
58 ERRORMSG("Component boundary condition on a scalar (T)." << endl); \
70 template<
class T,
unsigned int D,
class M,
class C>
72 : m_face(face), m_changePhysical(false)
79 ERRORMSG(
"BCondBase(): component 2 specified, component 1 not."
89 int lo = i < j ? i : j;
90 int hi = i > j ? i : j;
97 "BCondBase(): something other than [Sym,AntiSym]Tenzor specified"
98 <<
" two component indices; not implemented." <<
endl);
121 template<
class T,
unsigned int D,
class M,
class C>
124 out <<
"BCondBase" <<
", Face=" << m_face;
127 template<
class T,
unsigned int D,
class M,
class C>
134 template<
class T,
unsigned int D,
class M,
class C>
141 template<
class T,
unsigned int D,
class M,
class C>
147 template<
class T,
unsigned int D,
class M,
class C>
153 template<
class T,
unsigned int D,
class M,
class C>
159 template<
class T,
unsigned int D,
class M,
class C>
165 template<
class T,
unsigned int D,
class M,
class C>
171 template<
class T,
unsigned int D,
class M,
class C>
177 template<
class T,
unsigned int D,
class M,
class C>
183 template<
class T,
unsigned int D,
class M,
class C>
186 out <<
"ConstantFace"
188 <<
", Constant=" << this->
Offset
192 template<
class T,
unsigned int D,
class M,
class C>
198 template<
class T,
unsigned int D,
class M,
class C>
204 template<
class T,
unsigned int D,
class M,
class C>
210 template<
class T,
unsigned D,
class M,
class C>
217 <<
", Offset=" <<
Offset <<
", Slope=" << Slope;
220 template<
class T,
unsigned D,
class M,
class C>
227 <<
", Offset=" <<
Offset <<
", Slope=" << Slope;
230 template<
class T,
unsigned D,
class M,
class C>
239 template<
class T,
unsigned D,
class M,
class C>
249 template<
class T,
unsigned D,
class M,
class C>
258 while (p!=this->end())
260 (*p).second->write(o);
265 o << std::endl <<
")" << std::endl <<
std::endl;
271 template<
class T,
unsigned D,
class M,
class C>
277 for (
iterator p=this->begin(); p!=this->end(); ++p)
278 (*p).second->apply(a);
281 template<
class T,
unsigned D,
class M,
class C>
286 if ((*p).second->changesPhysicalCells())
296 template<
class T,
unsigned D,
class M,
class C>
306 template<
class T,
unsigned D,
class M,
class C>
314 template<
class T,
unsigned D,
class M,
class C>
322 template<
class T,
unsigned D,
class M,
class C>
331 template<
class T,
unsigned D,
class M,
class C>
340 template<
class T,
unsigned D,
class M,
class C>
344 unsigned face,
int i,
int j)
351 ERRORMSG(
"ComponentFunctionFace(): allComponents specified; not allowed; "
352 <<
"use FunctionFace class instead." <<
endl);
479 template<class
T,
unsigned D, class M>
483 template<class T,
unsigned D, class M>
487 template<class T,
unsigned D, class M>
490 template<class T,
unsigned D, class M>
493 template<class T,
unsigned D, class M, const
CenteringEnum* CE,
unsigned NC>
498 template<class T,
unsigned D, class M, class C>
507 template<
class T,
unsigned D,
class M,
class C>
519 template<
class T,
unsigned D,
class M>
541 offset = -domain[d].
length();
546 offset = domain[d].
length();
549 DEBUGMSG(
"PeriodicFaceBCApply domain" << domain <<
" d= " << d <<
" slab= " << slab[d] <<
endl);
558 if ( slab.
touches( fill_alloc ) )
565 src[d] = src[d] + offset;
576 if ( src.
touches( from_owned ) )
596 LFI lhs = fill.
begin(fill_it);
597 LFI rhs = from.
begin(from_it);
618 template<
class T,
unsigned D,
class M>
635 offset = -domain[d].
length();
640 offset = domain[d].
length();
643 DEBUGMSG(
"InterpolationFaceBCApply domain" << domain <<
" d= " << d <<
" slab= " << slab[d] <<
endl);
652 if ( slab.
touches( fill_alloc ) )
660 dest[d] = dest[d] + offset;
674 if ( dest.
touches( from_owned ) )
694 LFI lhs = fill.
begin(fill_it);
695 LFI rhs = from.
begin(from_it);
716 template<
class T,
unsigned D,
class M>
737 offset = -domain[d].
length() + 1;
744 offset = domain[d].
length() - 1;
754 if ( slab.
touches( fill_alloc ) )
761 src[d] = src[d] + offset;
772 if ( src.
touches( from_owned ) )
792 LFI lhs = fill.
begin(fill_it);
793 LFI rhs = from.
begin(from_it);
814 template<
class T,
unsigned D,
class M>
832 offset = -domain[d].
length() + 1;
839 offset = domain[d].
length() - 1;
849 if ( slab.
touches( fill_alloc ) )
856 src[d] = src[d] + offset;
867 if ( src.
touches( from_owned ) )
887 LFI lhs = fill.
begin(fill_it);
888 LFI rhs = from.
begin(from_it);
908 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
922 unsigned d = pf.getFace()/2;
924 if ( pf.getFace() & 1 )
932 for (
int c=1;
c<NC;
c++) {
933 if (CE[
c + d*NC] != centering0)
934 ERRORMSG(
"PeriodicFaceBCApply: BCond thinks all components have"
935 <<
" same centering along direction " << d
936 <<
", but it isn't so." <<
endl);
939 if (centering0 ==
CELL) {
940 offset = -domain[d].length();
944 Index( domain[d].
max(), domain[d].
max() + A.rightGuard(d));
945 offset = -domain[d].
length()+1;
949 if (CE[pf.getComponent() + d*NC] ==
CELL) {
950 offset = -domain[d].length();
953 Index( domain[d].
max(), domain[d].
max() + A.rightGuard(d));
954 offset = -domain[d].
length()+1;
960 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
967 for (
int c=1;
c<NC;
c++) {
968 if (CE[
c + d*NC] != centering0)
969 ERRORMSG(
"PeriodicFaceBCApply: BCond thinks all components have"
970 <<
" same centering along direction " << d
971 <<
", but it isn't so." <<
endl);
974 if (centering0 ==
CELL) {
975 offset = -domain[d].length();
977 offset = -domain[d].length() + 1;
981 if (CE[pf.getComponent() + d*NC] ==
CELL) {
982 offset = domain[d].length();
984 offset = domain[d].length() - 1;
996 if ( slab.
touches( fill_alloc ) )
1003 src[d] = src[d] + offset;
1014 if ( src.
touches( from_owned ) )
1034 LFI lhs = fill.
begin(fill_it);
1035 LFI rhs = from.
begin(from_it);
1060 # include <iterator.h>
1063 template <
class T,
unsigned D,
class M>
1091 offset = -domain[d].
length();
1104 offset = domain[d].
length();
1111 template <
class T,
unsigned D,
class M>
1140 offset = -domain[d].
length() + 1;
1153 offset = domain[d].
length() - 1;
1159 template <
class T,
unsigned D,
class M>
1188 offset = -domain[d].
length() + 1;
1201 offset = domain[d].
length() - 1;
1207 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
1222 unsigned d = pf.getFace()/2;
1224 if (pf.getFace() & 1)
1232 if (pf.getComponent() == BCBase_t::allComponents)
1239 for (
int c = 1;
c < NC;
c++)
1242 if (CE[
c + d*NC] != centering0)
1243 ERRORMSG(
"ParallelPeriodicFaceBCApply:"
1244 <<
"BCond thinks all components have"
1245 <<
" same centering along direction " << d
1246 <<
", but it isn't so." <<
endl);
1252 if (centering0 ==
CELL) {
1253 offset = -domain[d].length();
1256 Index(domain[d].
max(), domain[d].
max() + A.leftGuard(d));
1257 offset = -domain[d].
length() + 1;
1266 if (CE[pf.getComponent() + d*NC] ==
CELL)
1268 offset = -domain[d].length();
1273 Index(domain[d].
max(), domain[d].
max() + A.leftGuard(d));
1274 offset = -domain[d].
length() + 1;
1285 Index(domain[d].
min() - A.leftGuard(d), domain[d].min()-1);
1289 if (pf.getComponent() == BCBase_t::allComponents)
1296 for (
int c = 1;
c < NC;
c++)
1298 if (CE[
c + d*NC] != centering0)
1299 ERRORMSG(
"ParallelPeriodicFaceBCApply:"
1300 <<
"BCond thinks all components have"
1301 <<
" same centering along direction " << d
1302 <<
", but it isn't so." <<
endl);
1308 if (centering0 ==
CELL) {
1309 offset = -domain[d].length();
1311 offset = -domain[d].length() + 1;
1320 if (CE[pf.getComponent() + d*NC] ==
CELL)
1322 offset = domain[d].length();
1326 offset = domain[d].length() - 1;
1342 template<
class T,
unsigned D,
class M,
class C>
1353 typedef T Element_t;
1403 unsigned d = this->getFace()/2;
1409 Domain_t src_slab = dest_slab;
1410 src_slab[d] = src_slab[d] + offset;
1413 msg <<
"dest_slab = " << dest_slab <<
endl;
1414 msg <<
"src_slab = " << src_slab <<
endl;
1432 typedef std::multimap<Domain_t,LField_t*, std::less<Domain_t> > ReceiveMap_t;
1438 ReceiveMap_t receive_map;
1444 int receive_count = 0;
1464 typedef std::vector<LField_t*> DestList_t;
1465 typedef std::vector<LField_t*> SrcList_t;
1469 DestList_t dest_list;
1472 dest_list.reserve(1);
1473 src_list.reserve(1);
1478 msg <<
"Starting dest & src domain calculation." <<
endl;
1483 LField_t &lf = *lf_i->second;
1488 const Domain_t &lf_allocated = lf.getAllocated();
1491 msg <<
" Processing subdomain : " << lf_allocated <<
endl;
1495 if (lf_allocated.touches(dest_slab))
1496 dest_list.push_back(&lf);
1502 const Domain_t &lf_owned = lf.getOwned();
1504 if (lf_owned.touches(src_slab))
1505 src_list.push_back(&lf);
1509 msg <<
" dest_list has " << dest_list.size() <<
" elements." <<
endl;
1510 msg <<
" src_list has " << src_list.size() <<
" elements." <<
endl;
1513 DestListIterator_t dest_begin = dest_list.begin();
1514 DestListIterator_t dest_end = dest_list.end();
1515 SrcListIterator_t src_begin = src_list.begin();
1516 SrcListIterator_t src_end = src_list.end();
1530 msg <<
"Starting receive calculation." <<
endl;
1540 std::vector<bool> receive_mask(nprocs,
false);
1542 DestListIterator_t dest_i;
1544 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
1548 LField_t &dest_lf = **dest_i;
1550 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
1556 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
1558 Domain_t src_domain = dest_domain;
1559 src_domain[d] = src_domain[d] + offset;
1572 typename Layout_t::touch_range_dv
1573 src_range(layout.touch_range_rdv(src_domain));
1580 typename Layout_t::touch_iterator_dv rv_i;
1582 for (rv_i = src_range.first; rv_i != src_range.second; ++rv_i)
1591 Domain_t hit = src_domain.intersect(rv_alloc);
1592 hit[d] = hit[d] - offset;
1598 receive_map.insert(
value_type(hit,&dest_lf));
1601 msg <<
" Need remote data for domain: " << hit <<
endl;
1606 int rnode = rv_i->second->getNode();
1608 receive_mask[rnode] =
true;
1615 for (
int iproc = 0; iproc < nprocs; ++iproc)
1616 if (receive_mask[iproc]) ++receive_count;
1620 msg <<
" Expecting to see " << receive_count <<
" messages." <<
endl;
1621 msg <<
"Done with receive calculation." <<
endl;
1631 msg <<
"Starting send calculation" <<
endl;
1640 std::vector<Message *> messages(nprocs);
1641 for (
int miter=0; miter < nprocs; messages[miter++] = 0);
1649 std::vector<int> ndomains(nprocs);
1650 for(
int i = 0; i < nprocs; ++i) ndomains[i] = 0;
1653 SrcListIterator_t src_i;
1655 for (src_i = src_begin; src_i != src_end; ++src_i)
1659 LField_t &src_lf = **src_i;
1667 const Domain_t &src_lf_owned = src_lf.getOwned();
1668 const Domain_t &src_lf_alloc = src_lf.getAllocated();
1674 const Domain_t src_owned = src_lf_owned.intersect(src_slab);
1675 const Domain_t src_alloc = src_lf_alloc.intersect(src_slab);
1677 Domain_t dest_owned = src_owned;
1678 dest_owned[d] = dest_owned[d] - offset;
1680 Domain_t dest_alloc = src_alloc;
1681 dest_alloc[d] = dest_alloc[d] - offset;
1684 msg <<
" Considering LField with the domains:" <<
endl;
1685 msg <<
" owned = " << src_lf_owned <<
endl;
1686 msg <<
" alloc = " << src_lf_alloc <<
endl;
1687 msg <<
" The intersections with src_slab are:" <<
endl;
1688 msg <<
" owned = " << src_owned <<
endl;
1689 msg <<
" alloc = " << src_alloc <<
endl;
1695 typename Layout_t::touch_range_dv
1696 dest_range(layout.touch_range_rdv(dest_owned,gc));
1698 typename Layout_t::touch_iterator_dv rv_i;
1707 for (rv_i = dest_range.first; rv_i != dest_range.second; ++rv_i)
1713 Domain_t hit = dest_alloc.intersect(rv_i->first);
1714 hit[d] = hit[d] + offset;
1718 int rnode = rv_i->second->getNode();
1721 msg <<
" Overlap domain = " << rv_i->first <<
endl;
1722 msg <<
" Inters. domain = " << hit;
1723 msg <<
" --> node " << rnode <<
endl;
1732 Element_t compressed_value;
1733 LFI_t msgval = src_lf.begin(hit, compressed_value);
1734 msgval.TryCompress();
1738 if (!messages[rnode])
1740 messages[rnode] =
new Message;
1744 messages[rnode]->put(hit);
1745 messages[rnode]->put(msgval);
1762 for (
int iproc = 0; iproc < nprocs; ++iproc)
1764 if (messages[iproc])
1768 msg <<
" ParallelPeriodicBCApply: Sending message to node "
1770 <<
" number of domains = " << ndomains[iproc] << endl
1771 <<
" number of MsgItems = "
1772 << messages[iproc]->size() <<
endl;
1783 msg <<
" Sent " << send_count <<
" messages" <<
endl;
1784 msg <<
"Done with send." <<
endl;
1801 msg <<
"Starting local calculation." <<
endl;
1804 DestListIterator_t dest_i;
1806 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
1810 LField_t &dest_lf = **dest_i;
1812 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
1814 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
1816 Domain_t src_domain = dest_domain;
1817 src_domain[d] = src_domain[d] + offset;
1819 SrcListIterator_t src_i;
1821 for (src_i = src_begin; src_i != src_end; ++src_i)
1825 LField_t &src_lf = **src_i;
1831 const Domain_t &src_lf_owned = src_lf.getOwned();
1832 const Domain_t &src_lf_alloc = src_lf.getAllocated();
1837 if (src_domain.touches(src_lf_owned))
1843 dest_lf.Uncompress();
1847 Domain_t real_src_domain =
1848 src_domain.intersect(src_lf_alloc);
1850 Domain_t real_dest_domain = real_src_domain;
1851 real_dest_domain[d] = real_dest_domain[d] - offset;
1854 msg <<
" Copying local data . . ." <<
endl;
1855 msg <<
" source domain = " << real_src_domain <<
endl;
1856 msg <<
" dest domain = " << real_dest_domain <<
endl;
1861 LFI_t lhs = dest_lf.begin(real_dest_domain);
1862 LFI_t rhs = src_lf.begin(real_src_domain);
1881 msg <<
"Done with local calculation." <<
endl;
1897 msg <<
"Starting receive..." <<
endl;
1901 while (receive_count > 0)
1920 int ndomains = message->
size() / (D + 3);
1923 msg <<
" Message received from node "
1924 << any_node <<
"," << endl
1925 <<
" number of domains = " << ndomains <<
endl;
1928 for (
int idomain=0; idomain < ndomains; ++idomain)
1933 Domain_t intersection;
1934 intersection.getMessage(*message);
1935 intersection[d] = intersection[d] - offset;
1939 Element_t compressed_value;
1940 LFI_t rhs(compressed_value);
1941 rhs.getMessage(*message);
1944 msg <<
" Received remote overlap region = "
1945 << intersection <<
endl;
1951 receive_map.find(intersection);
1953 PAssert(hit != receive_map.end());
1966 msg <<
" LHS compressed ? " << lf.IsCompressed();
1967 msg <<
", LHS value = " << *lf.begin() <<
endl;
1968 msg <<
" RHS compressed ? " << rhs.IsCompressed();
1969 msg <<
", RHS value = " << *rhs <<
endl;
1970 msg <<
" *rhs == *lf.begin() ? "
1971 << (*rhs == *lf.begin()) << endl;
1973 if (!(rhs.IsCompressed() && lf.IsCompressed() &&
1974 (*rhs == *lf.begin())))
1979 LFI_t lhs = lf.begin(intersection);
1984 msg <<
" Doing copy." <<
endl;
1992 receive_map.erase(hit);
2000 msg <<
"Done with receive." <<
endl;
2010 template <
class T,
unsigned D,
class M>
2038 offset = -domain[d].
length();
2051 offset = domain[d].
length();
2059 template<
class T,
unsigned D,
class M,
class C>
2070 typedef T Element_t;
2120 unsigned d = this->getFace()/2;
2126 Domain_t dest_slab = src_slab;
2127 dest_slab[d] = dest_slab[d] + offset;
2130 msg <<
"dest_slab = " << dest_slab <<
endl;
2131 msg <<
"src_slab = " << src_slab <<
endl;
2149 typedef std::multimap<Domain_t,LField_t*, std::less<Domain_t> > ReceiveMap_t;
2155 ReceiveMap_t receive_map;
2161 int receive_count = 0;
2181 typedef std::vector<LField_t*> DestList_t;
2182 typedef std::vector<LField_t*> SrcList_t;
2186 DestList_t dest_list;
2189 dest_list.reserve(1);
2190 src_list.reserve(1);
2195 msg <<
"Starting dest & src domain calculation." <<
endl;
2200 LField_t &lf = *lf_i->second;
2206 const Domain_t &lf_owned = lf.getOwned();
2209 msg <<
" Processing subdomain : " << lf_owned <<
endl;
2213 if (lf_owned.touches(dest_slab))
2214 dest_list.push_back(&lf);
2220 const Domain_t &lf_allocated = lf.getAllocated();
2222 if (lf_allocated.touches(src_slab))
2223 src_list.push_back(&lf);
2227 msg <<
" dest_list has " << dest_list.size() <<
" elements." <<
endl;
2228 msg <<
" src_list has " << src_list.size() <<
" elements." <<
endl;
2231 DestListIterator_t dest_begin = dest_list.begin();
2232 DestListIterator_t dest_end = dest_list.end();
2233 SrcListIterator_t src_begin = src_list.begin();
2234 SrcListIterator_t src_end = src_list.end();
2248 msg <<
"Starting receive calculation." <<
endl;
2258 std::vector<bool> receive_mask(nprocs,
false);
2260 DestListIterator_t dest_i;
2262 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
2266 LField_t &dest_lf = **dest_i;
2268 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
2274 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
2276 Domain_t src_domain = dest_domain;
2279 src_domain[d] = src_domain[d] - offset;
2293 typename Layout_t::touch_range_dv
2294 src_range(layout.touch_range_rdv(src_domain,gc));
2301 typename Layout_t::touch_iterator_dv rv_i;
2303 for (rv_i = src_range.first; rv_i != src_range.second; ++rv_i)
2311 const Domain_t rv_alloc = rv_i->first;
2313 Domain_t hit = src_domain.intersect(rv_alloc);
2315 hit[d] = hit[d] + offset;
2321 receive_map.insert(
value_type(hit,&dest_lf));
2324 msg <<
" Need remote data for domain: " << hit <<
endl;
2329 int rnode = rv_i->second->getNode();
2331 receive_mask[rnode] =
true;
2338 for (
int iproc = 0; iproc < nprocs; ++iproc)
2339 if (receive_mask[iproc]) ++receive_count;
2343 msg <<
" Expecting to see " << receive_count <<
" messages." <<
endl;
2344 msg <<
"Done with receive calculation." <<
endl;
2354 msg <<
"Starting send calculation" <<
endl;
2363 std::vector<Message *> messages(nprocs);
2364 for (
int miter=0; miter < nprocs; messages[miter++] = 0);
2372 std::vector<int> ndomains(nprocs);
2373 for(
int i = 0; i < nprocs; ++i) ndomains[i] = 0;
2376 SrcListIterator_t src_i;
2378 for (src_i = src_begin; src_i != src_end; ++src_i)
2382 LField_t &src_lf = **src_i;
2390 const Domain_t &src_lf_owned = src_lf.getOwned();
2391 const Domain_t &src_lf_alloc = src_lf.getAllocated();
2397 const Domain_t src_owned = src_lf_owned.intersect(src_slab);
2398 const Domain_t src_alloc = src_lf_alloc.intersect(src_slab);
2400 Domain_t dest_owned = src_owned;
2401 dest_owned[d] = dest_owned[d] + offset;
2403 Domain_t dest_alloc = src_alloc;
2404 dest_alloc[d] = dest_alloc[d] + offset;
2407 msg <<
" Considering LField with the domains:" <<
endl;
2408 msg <<
" owned = " << src_lf_owned <<
endl;
2409 msg <<
" alloc = " << src_lf_alloc <<
endl;
2410 msg <<
" The intersections with src_slab are:" <<
endl;
2411 msg <<
" owned = " << src_owned <<
endl;
2412 msg <<
" alloc = " << src_alloc <<
endl;
2418 typename Layout_t::touch_range_dv
2419 dest_range(layout.touch_range_rdv(dest_owned,gc));
2421 typename Layout_t::touch_iterator_dv rv_i;
2430 for (rv_i = dest_range.first; rv_i != dest_range.second; ++rv_i)
2436 Domain_t hit = dest_alloc.intersect(rv_i->first);
2437 hit[d] = hit[d] - offset;
2441 int rnode = rv_i->second->getNode();
2444 msg <<
" Overlap domain = " << rv_i->first <<
endl;
2445 msg <<
" Inters. domain = " << hit;
2446 msg <<
" --> node " << rnode <<
endl;
2455 Element_t compressed_value;
2456 LFI_t msgval = src_lf.begin(hit, compressed_value);
2457 msgval.TryCompress();
2461 if (!messages[rnode])
2463 messages[rnode] =
new Message;
2467 messages[rnode]->put(hit);
2468 messages[rnode]->put(msgval);
2485 for (
int iproc = 0; iproc < nprocs; ++iproc)
2487 if (messages[iproc])
2491 msg <<
" ParallelPeriodicBCApply: Sending message to node "
2493 <<
" number of domains = " << ndomains[iproc] << endl
2494 <<
" number of MsgItems = "
2495 << messages[iproc]->size() <<
endl;
2506 msg <<
" Sent " << send_count <<
" messages" <<
endl;
2507 msg <<
"Done with send." <<
endl;
2524 msg <<
"Starting local calculation." <<
endl;
2527 DestListIterator_t dest_i;
2529 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
2533 LField_t &dest_lf = **dest_i;
2535 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
2538 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
2540 Domain_t src_domain = dest_domain;
2543 src_domain[d] = src_domain[d] - offset;
2545 SrcListIterator_t src_i;
2547 for (src_i = src_begin; src_i != src_end; ++src_i)
2551 LField_t &src_lf = **src_i;
2558 const Domain_t &src_lf_alloc = src_lf.getAllocated();
2563 if (src_domain.touches(src_lf_alloc))
2569 dest_lf.Uncompress();
2573 Domain_t real_src_domain =
2574 src_domain.intersect(src_lf_alloc);
2576 Domain_t real_dest_domain = real_src_domain;
2578 real_dest_domain[d] = real_dest_domain[d] + offset;
2581 msg <<
" Copying local data . . ." <<
endl;
2582 msg <<
" source domain = " << real_src_domain <<
endl;
2583 msg <<
" dest domain = " << real_dest_domain <<
endl;
2588 LFI_t lhs = dest_lf.begin(real_dest_domain);
2589 LFI_t rhs = src_lf.begin(real_src_domain);
2608 msg <<
"Done with local calculation." <<
endl;
2624 msg <<
"Starting receive..." <<
endl;
2628 while (receive_count > 0)
2647 int ndomains = message->
size() / (D + 3);
2650 msg <<
" Message received from node "
2651 << any_node <<
"," << endl
2652 <<
" number of domains = " << ndomains <<
endl;
2655 for (
int idomain=0; idomain < ndomains; ++idomain)
2660 Domain_t intersection;
2661 intersection.getMessage(*message);
2663 intersection[d] = intersection[d] + offset;
2667 Element_t compressed_value;
2668 LFI_t rhs(compressed_value);
2669 rhs.getMessage(*message);
2672 msg <<
" Received remote overlap region = "
2673 << intersection <<
endl;
2679 receive_map.find(intersection);
2681 PAssert(hit != receive_map.end());
2694 msg <<
" LHS compressed ? " << lf.IsCompressed();
2695 msg <<
", LHS value = " << *lf.begin() <<
endl;
2696 msg <<
" RHS compressed ? " << rhs.IsCompressed();
2697 msg <<
", RHS value = " << *rhs <<
endl;
2698 msg <<
" *rhs == *lf.begin() ? "
2699 << (*rhs == *lf.begin()) << endl;
2701 if (!(rhs.IsCompressed() && lf.IsCompressed() &&
2702 (*rhs == *lf.begin())))
2707 LFI_t lhs = lf.begin(intersection);
2712 msg <<
" Doing copy." <<
endl;
2721 receive_map.erase(hit);
2729 msg <<
"Done with receive." <<
endl;
2806 template<class
T,
unsigned D, class M>
2809 template<class T,
unsigned D, class M>
2812 template<class T,
unsigned D, class M>
2815 template<class T,
unsigned D, class M, const
CenteringEnum* CE,
unsigned NC>
2820 template<class T,
unsigned D, class M, class C>
2829 template<
class T,
unsigned D,
class M,
class C>
2877 LFI lhs = fill.
begin(fill_it);
2878 LFI rhs = from.
begin(from_it);
2902 template<
class T,
unsigned D,
class M>
2939 offset = 2*domain[d].
max() + 1;
2952 offset = 2*domain[d].
min() - 1;
2991 src[d] = offset - src[d];
3019 if (src.touches(from_owned))
3034 template<
class T,
unsigned D,
class M>
3073 offset = 2*domain[d].
max() + 1 - 1;
3087 offset = 2*domain[d].
min() - 1 + 1;
3107 if ( slab.
touches( fill_alloc ) )
3124 src[d] = offset - src[d];
3152 if (src.touches(from_owned))
3168 template<
class T,
unsigned D,
class M>
3204 offset = 2*domain[d].
max() + 1 - 1;
3218 offset = 2*domain[d].
min() - 1 + 1;
3238 if ( slab.
touches( fill_alloc ) )
3255 src[d] = offset - src[d];
3283 if (src.touches(from_owned))
3297 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
3316 unsigned d = ef.getFace()/2;
3324 if ( ef.getFace() & 1 )
3337 for (
int c=1;
c<NC;
c++)
3340 if (CE[
c + d*NC] != centering0)
3341 ERRORMSG(
"ExtrapolateFaceBCApply: BCond thinks all components"
3342 <<
" have same centering along direction " << d
3343 <<
", but it isn't so." <<
endl);
3352 slab[d] =
Index(domain[d].
max() + 1,
3353 domain[d].
max() + A.rightGuard(d));
3355 if (centering0 ==
CELL)
3357 offset = 2*domain[d].
max() + 1 ;
3361 offset = 2*domain[d].max() + 1 - 1;
3368 if (CE[ef.getComponent() + d*NC] ==
CELL)
3373 int highcell = A.get_mesh().gridSizes[d] - 2;
3374 slab[d] =
Index(highcell + 1, highcell + A.rightGuard(d));
3377 offset = 2*highcell + 1 ;
3384 int highvert = A.get_mesh().gridSizes[d] - 1;
3385 slab[d] =
Index(highvert + 1, highvert + A.rightGuard(d));
3388 offset = 2*highvert + 1 - 1;
3398 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
3411 for (
int c=1;
c<NC;
c++)
3415 if (CE[
c + d*NC] != centering0)
3416 ERRORMSG(
"ExtrapolateFaceBCApply: BCond thinks all components"
3417 <<
" have same centering along direction " << d
3418 <<
", but it isn't so." <<
endl);
3424 if (centering0 ==
CELL)
3426 offset = 2*domain[d].min() - 1;
3430 offset = 2*domain[d].min() - 1 + 1;
3438 if (CE[ef.getComponent() + d*NC] ==
CELL)
3440 offset = 2*domain[d].min() - 1;
3444 offset = 2*domain[d].min() - 1 + 1;
3468 if ( slab.
touches( fill_alloc ) )
3485 src[d] = offset - src[d];
3514 if (src.touches(from_owned))
3592 template<
class T,
class T1>
3622 template<class
T,
unsigned D, class M>
3625 template<class T,
unsigned D, class M>
3628 template<class T,
unsigned D, class M>
3631 template<class T,
unsigned D, class M, const
CenteringEnum* CE,
unsigned NC>
3636 template<class T,
unsigned D, class M, class C>
3643 template<
class T,
unsigned D,
class M,
class C>
3690 LFI lhs = fill.
begin(fill_it);
3691 LFI rhs = from.
begin(from_it);
3711 template<
class T,
unsigned D,
class M,
class C>
3754 LFI lhs = fill.
begin(dest);
3780 template<
class T,
unsigned D,
class M>
3817 offset = 2*domain[d].
max() + 1;
3830 offset = 2*domain[d].
min() - 1;
3869 src[d] = offset - src[d];
3897 if (src.touches(from_owned))
3913 template<
class T,
unsigned D,
class M>
3949 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
3956 offset = 2*domain[d].max() + 1 - 1;
3968 phys[d] =
Index( domain[d].
min(), domain[d].
min(), 1);
3975 offset = 2*domain[d].min() - 1 + 1;
3995 if (phys.touches(fill_alloc))
4016 if ( slab.
touches( fill_alloc ) )
4033 src[d] = offset - src[d];
4061 if (src.touches(from_owned))
4077 template<
class T,
unsigned D,
class M>
4112 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
4119 offset = 2*domain[d].max() + 1 - 1;
4131 phys[d] =
Index( domain[d].
min(), domain[d].
min(), 1);
4138 offset = 2*domain[d].min() - 1 + 1;
4158 if (phys.touches(fill_alloc))
4179 if ( slab.
touches( fill_alloc ) )
4196 src[d] = offset - src[d];
4224 if (src.touches(from_owned))
4238 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
4257 unsigned d = ef.getFace()/2;
4259 bool setPhys =
false;
4266 if ( ef.getFace() & 1 )
4279 for (
int c=1;
c<NC;
c++)
4282 if (CE[
c + d*NC] != centering0)
4284 "ExtrapolateAndZeroFaceBCApply: BCond thinks all components"
4285 <<
" have same centering along direction " << d
4286 <<
", but it isn't so." <<
endl);
4295 slab[d] =
Index(domain[d].
max() + 1,
4296 domain[d].
max() + A.rightGuard(d));
4298 if (centering0 ==
CELL)
4300 offset = 2*domain[d].
max() + 1 ;
4304 offset = 2*domain[d].max() + 1 - 1;
4308 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
4316 if (CE[ef.getComponent() + d*NC] ==
CELL)
4321 int highcell = A.get_mesh().gridSizes[d] - 2;
4322 slab[d] =
Index(highcell + 1, highcell + A.rightGuard(d));
4325 offset = 2*highcell + 1 ;
4333 int highvert = A.get_mesh().gridSizes[d] - 1;
4334 slab[d] =
Index(highvert + 1, highvert + A.rightGuard(d));
4338 offset = 2*highvert + 1 - 1;
4342 phys[d] =
Index( highvert, highvert, 1 );
4353 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
4366 for (
int c=1;
c<NC;
c++)
4370 if (CE[
c + d*NC] != centering0)
4372 "ExtrapolateAndZeroFaceBCApply: BCond thinks all components"
4373 <<
" have same centering along direction " << d
4374 <<
", but it isn't so." <<
endl);
4380 if (centering0 ==
CELL)
4382 offset = 2*domain[d].min() - 1;
4386 offset = 2*domain[d].min() - 1 + 1;
4390 phys[d] =
Index(domain[d].
min(), domain[d].
min(), 1);
4399 if (CE[ef.getComponent() + d*NC] ==
CELL)
4401 offset = 2*domain[d].min() - 1;
4405 offset = 2*domain[d].min() - 1 + 1;
4409 phys[d] =
Index(domain[d].
min(), domain[d].
min(), 1);
4435 if (phys.touches(fill_alloc))
4457 if ( slab.
touches( fill_alloc ) )
4474 src[d] = offset - src[d];
4503 if (src.touches(from_owned))
4551 template<
class T,
unsigned D,
class M>
4554 template<
class T,
unsigned D,
class M>
4557 template<
class T,
unsigned D,
class M>
4560 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
4565 template<
class T,
unsigned D,
class M,
class C>
4577 template<
class T,
unsigned D,
class M>
4595 offset = 2*domain[d].
max() + 1;
4599 offset = 2*domain[d].
min() - 1;
4609 if ( slab.
touches( fill_alloc ) )
4616 src[d] = offset - src[d];
4627 if ( src.touches( from_owned ) )
4647 LFI lhs = fill.
begin(fill_it);
4648 LFI rhs = from.
begin(from_it);
4662 template<
class T,
unsigned D,
class M>
4682 offset = 2*domain[d].
max() + 1 - 1;
4688 offset = 2*domain[d].
min() - 1 + 1;
4698 if ( slab.
touches( fill_alloc ) )
4705 src[d] = offset - src[d];
4716 if ( src.touches( from_owned ) )
4736 LFI lhs = fill.
begin(fill_it);
4737 LFI rhs = from.
begin(from_it);
4751 template<
class T,
unsigned D,
class M>
4768 offset = 2*domain[d].
max() + 1 - 1;
4774 offset = 2*domain[d].
min() - 1 + 1;
4784 if ( slab.
touches( fill_alloc ) )
4791 src[d] = offset - src[d];
4802 if ( src.touches( from_owned ) )
4822 LFI lhs = fill.
begin(fill_it);
4823 LFI rhs = from.
begin(from_it);
4837 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
4851 unsigned d = ff.getFace()/2;
4853 if ( ff.getFace() & 1 ) {
4855 slab[d] =
Index( domain[d].
max() + 1, domain[d].
max() + A.rightGuard(d));
4859 for (
int c=1;
c<NC;
c++) {
4860 if (CE[
c + d*NC] != centering0)
4861 ERRORMSG(
"FunctionFaceBCApply: BCond thinks all components have"
4862 <<
" same centering along direction " << d
4863 <<
", but it isn't so." <<
endl);
4866 if (centering0 ==
CELL) {
4867 offset = 2*domain[d].max() + 1;
4869 offset = 2*domain[d].max() + 1 - 1;
4873 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
4877 for (
int c=1;
c<NC;
c++) {
4878 if (CE[
c + d*NC] != centering0)
4879 ERRORMSG(
"FunctionFaceBCApply: BCond thinks all components have"
4880 <<
" same centering along direction " << d
4881 <<
", but it isn't so." <<
endl);
4884 if (centering0 ==
CELL) {
4885 offset = 2*domain[d].min() - 1;
4887 offset = 2*domain[d].min() - 1 + 1;
4898 if ( slab.
touches( fill_alloc ) )
4905 src[d] = offset - src[d];
4916 if ( src.touches( from_owned ) )
4936 LFI lhs = fill.
begin(fill_it);
4937 LFI rhs = from.
begin(from_it);
5002 template<class
T,
unsigned D, class M>
5005 template<class T,
unsigned D, class M>
5008 template<class T,
unsigned D, class M>
5011 template<class T,
unsigned D, class M, const
CenteringEnum* CE,
unsigned NC>
5017 template<class T,
unsigned D, class M, class C>
5028 template<
class T,
unsigned D,
class M>
5046 offset = 2*domain[d].
max() + 1;
5050 offset = 2*domain[d].
min() - 1;
5060 if ( slab.
touches( fill_alloc ) )
5067 src[d] = offset - src[d];
5078 if ( src.touches( from_owned ) )
5098 LFI lhs = fill.
begin(fill_it);
5099 LFI rhs = from.
begin(from_it);
5115 template<
class T,
unsigned D,
class M>
5135 offset = 2*domain[d].
max() + 1 - 1;
5141 offset = 2*domain[d].
min() - 1 + 1;
5151 if ( slab.
touches( fill_alloc ) )
5158 src[d] = offset - src[d];
5169 if ( src.touches( from_owned ) )
5189 LFI lhs = fill.
begin(fill_it);
5190 LFI rhs = from.
begin(from_it);
5206 template<
class T,
unsigned D,
class M>
5223 offset = 2*domain[d].
max() + 1 - 1;
5229 offset = 2*domain[d].
min() - 1 + 1;
5239 if ( slab.
touches( fill_alloc ) )
5246 src[d] = offset - src[d];
5257 if ( src.touches( from_owned ) )
5277 LFI lhs = fill.
begin(fill_it);
5278 LFI rhs = from.
begin(from_it);
5294 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
5308 unsigned d = ff.getFace()/2;
5310 if ( ff.getFace() & 1 ) {
5312 slab[d] =
Index( domain[d].
max() + 1, domain[d].
max() + A.rightGuard(d));
5315 if (CE[ff.getComponent() + d*NC] ==
CELL) {
5316 ERRORMSG(
"check src code, had to change ef (not known) to ff ??? " <<
endl);
5317 offset = 2*domain[d].max() + 1;
5319 offset = 2*domain[d].max() + 1 - 1;
5323 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
5326 if (CE[ff.getComponent() + d*NC] ==
CELL) {
5327 offset = 2*domain[d].
min() - 1;
5329 offset = 2*domain[d].min() - 1 + 1;
5340 if ( slab.
touches( fill_alloc ) )
5347 src[d] = offset - src[d];
5358 if ( src.touches( from_owned ) )
5378 LFI lhs = fill.
begin(fill_it);
5379 LFI rhs = from.
begin(from_it);
5383 (ff.Func,ff.getComponent())).
apply();
5408 template<
class T,
unsigned int D,
class M,
class C>
5416 fillSlabWithZero(field,slab,this->getComponent());
5441 template<
class T,
int D>
5444 #endif // __MWERKS__
5447 static const T&
get(
const T& x, int) {
5448 ERRORMSG(
"Eureka assign to a component of class without an op[]!"<<
endl);
5451 static T&
get(
T& x, int) {
5452 ERRORMSG(
"Eureka assign to a component of class without an op[]!"<<
endl);
5467 template<
class T,
unsigned int D,
class M,
class C>
5478 for (; lp != done ; ++lp )
5487 if ( fillDomain.
touches(localDomain) )
5496 if ( *lf.
begin() == 0 )
5514 #endif // __MWERKS__
5540 Expr_t(data,Rhs_t(0)).apply();
5553 #endif // __MWERKS__
5559 Expr_t(data,Rhs_t(0),component).apply();
5571 template<
class T,
unsigned int D>
5587 template<
class T,
unsigned int D>
5603 template<
class T,
unsigned int D>
5619 template<
class T,
unsigned int D>
5644 template<
class T,
int D>
5657 #endif // __MWERKS__
5668 template<
unsigned int D>
5686 high = slab[dim].max();
5687 low = high - gc.
right(dim);
5693 low = slab[dim].min();
5694 high = low + gc.
left(dim);
5703 slab[dim] =
Index(low,high);
5715 template<
class T,
unsigned int D,
class M>
5722 template<
class T,
unsigned int D,
class M>
5729 template<
class T,
unsigned int D,
class M>
5748 template<
class T,
unsigned D,
class M, const CenteringEnum* CE,
unsigned NC>
5784 if (CE[component + d*NC] ==
CELL)
5793 slab[d] =
Index(low,high);
5799 int low = slab[d].min();
5803 if (CE[component + d*NC] ==
CELL)
5812 slab[d] =
Index(low,high);
5838 template<
class T,
unsigned D,
class M,
class C>
5842 template<
class T,
unsigned D,
class M,
class C>
5849 template<
class T,
unsigned D,
class M,
class C>
5856 int slopeMultipplier)
5867 LFI lhs = fill.
begin(dest);
5868 LFI rhs1 = fill.
begin(src1);
5869 LFI rhs2 = fill.
begin(src2);
5870 LFI endi = fill.
end();
5875 for ( ; lhs != endi, rhs1 != endi, rhs2 != endi;
5876 ++lhs, ++rhs1, ++rhs2) {
5877 *lhs = (*rhs2 - *rhs1)*slopeMultipplier + *rhs1;
5889 template<
class T,
unsigned D,
class M,
class C>
5935 for (
int guardLayer = 1; guardLayer <= nGuardLayers; guardLayer++) {
5939 int slopeMultipplier = -1*guardLayer;
5942 slab[d] =
Index(domain[d].
max() + guardLayer,
5943 domain[d].
max() + guardLayer);
5945 slab[d] =
Index(domain[d].
min() - guardLayer,
5946 domain[d].
min() - guardLayer);
5967 if (slab.
touches(fill_alloc)) {
5982 src2[d] =
Index(domain[d].
max() - 1, domain[d].
max() - 1, 1);
5983 src1[d] =
Index(domain[d].
max(), domain[d].
max(), 1);
5985 src1[d] =
Index(0,0,1);
5986 src2[d] =
Index(1,1,1);
6019 template<
class T,
unsigned D,
class M,
class C>
6024 template<
class T,
unsigned D,
class M,
class C>
6031 template<
class T,
unsigned D,
class M,
class C>
6039 int slopeMultipplier)
6050 LFI lhs = fill.
begin(dest);
6051 LFI rhs1 = fill.
begin(src1);
6052 LFI rhs2 = fill.
begin(src2);
6053 LFI endi = fill.
end();
6059 int component = ef.getComponent();
6060 for ( ; lhs != endi, rhs1 != endi, rhs2 != endi;
6061 ++lhs, ++rhs1, ++rhs2) {
6063 ((*rhs2)[component] - (*rhs1)[component])*slopeMultipplier +
6076 template<
class T,
unsigned D,
class M,
class C>
6093 unsigned d = ef.getFace()/2;
6103 if (ef.getFace() & 1) {
6121 for (
int guardLayer = 1; guardLayer <= nGuardLayers; guardLayer++) {
6125 int slopeMultipplier = -1*guardLayer;
6127 if (ef.getFace() & 1) {
6128 slab[d] =
Index(domain[d].
max() + guardLayer,
6129 domain[d].
max() + guardLayer);
6131 slab[d] =
Index(domain[d].
min() - guardLayer,
6132 domain[d].
min() - guardLayer);
6153 if (slab.
touches(fill_alloc)) {
6167 if (ef.getFace() & 1) {
6168 src2[d] =
Index(domain[d].
max() - 1, domain[d].
max() - 1, 1);
6169 src1[d] =
Index(domain[d].
max(), domain[d].
max(), 1);
6171 src1[d] =
Index(0,0,1);
6172 src2[d] =
Index(1,1,1);
6190 template<
class T,
unsigned D,
class M,
class C>
6206 template<
class T,
unsigned D,
class M,
class C>
6231 unsigned d = this->getFace()/2;
6238 if ( this->getFace() & 1 )
6249 for (fill_i=A.
begin_if(); fill_i!=A.
end_if(); ++fill_i, ++lfindex)
6263 if ( slab.
touches( fill_alloc ) )
6277 for (
int i=0; i<D; ++i)
6278 v[i] = dest[i].first();
6291 #undef COMPONENT_APPLY_BUILTIN
OpExtrapolateAndZero(const T &o, const T &s)
void PETE_apply(const OpPeriodic< T > &e, T &a, const T &b)
OpExtrapolateComponent(const T &o, const T &s, int c)
void SetCurrentLocation(const FieldLoc< Dim > &loc)
scalar_tag get_tag(dcomplex)
Field< double, 3, Mesh_t, Center_t > Field_t
void ComponentFunctionFaceBCApply(ComponentFunctionFace< T, D, M, Cell > &ff, Field< T, D, M, Cell > &A)
Layout_t & getLayout() const
virtual void apply(Field< T, D, M, C > &A)
ac_id_larray::iterator iterator_if
NDIndex< D > calcEurekaDomain(const NDIndex< D > &realDomain, int face, const GuardCellSizes< D > &gc)
static const T & get(const T &x, int)
constexpr double e
The value of .
OpExtrapolate(const T &o, const T &s)
virtual void write(std::ostream &out) const
const NDIndex< Dim > & getDomain() const
Index intersect(const Index &) const
void ComponentLinearExtrapolateFaceBCApply(ComponentLinearExtrapolateFace< T, D, M, C > &ef, Field< T, D, M, C > &A)
void apply(Field< T, D, M, C > &a)
void LinearExtrapolateFaceBCApply(LinearExtrapolateFace< T, D, M, C > &ef, Field< T, D, M, C > &A)
const NDIndex< Dim > & getOwned() const
void ExtrapolateFaceBCApply2(const NDIndex< D > &dest, const NDIndex< D > &src, LField< T, D > &fill, LField< T, D > &from, const NDIndex< D > &from_alloc, ExtrapolateFace< T, D, M, C > &ef)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual void write(std::ostream &) const
unsigned left(unsigned d) const
void CalcParallelPeriodicDomain(const Field< T, D, M, Cell > &A, const ParallelPeriodicFace< T, D, M, Cell > &pf, NDIndex< D > &dest_slab, int &offset)
virtual void write(std::ostream &out) const
void FunctionFaceBCApply(FunctionFace< T, D, M, Cell > &ff, Field< T, D, M, Cell > &A)
ExtrapolateFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
OpExtrapolateAndZeroComponent(const T &o, const T &s, int c)
std::complex< double > dcomplex
void Uncompress(bool fill_domain=true)
virtual void apply(Field< T, D, M, C > &)
InterpolationFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
NDIndex< Dim > AddGuardCells(const NDIndex< Dim > &idx, const GuardCellSizes< Dim > &g)
#define BC_PARALLEL_PERIODIC_TAG
void LinearExtrapolateFaceBCApply2(const NDIndex< D > &dest, const NDIndex< D > &src1, const NDIndex< D > &src2, LField< T, D > &fill, LinearExtrapolateFace< T, D, M, C > &ef, int slopeMultipplier)
int next_tag(int t, int s=1000)
const iterator & begin() const
virtual void write(std::ostream &) const
unsigned int length() const
NDIndex< Dim > plugBase(const NDIndex< 1 > &i) const
virtual void write(std::ostream &) const
virtual void write(std::ostream &) const
virtual void write(std::ostream &out) const
void ExtrapolateAndZeroFaceBCApply(ExtrapolateAndZeroFace< T, D, M, Cell > &ef, Field< T, D, M, Cell > &A)
OpInterpolationComponent(int c)
Expression Expr_t
type of an expression
virtual void write(std::ostream &out) const
virtual void apply(Field< T, D, M, C > &A)
virtual void write(std::ostream &out) const
const iterator & end() const
OpPeriodicComponent(int c)
unsigned rightGuard(unsigned d) const
constexpr double c
The velocity of light in m/s.
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::iterator iterator
bool touches(const NDIndex< Dim > &) const
virtual void write(std::ostream &out) const
unsigned leftGuard(unsigned d) const
const T & getOffset() const
virtual void write(std::ostream &) const
const T & getOffset() const
bool changesPhysicalCells() const
#define COMPONENT_APPLY_BUILTIN(OP, T)
virtual void write(std::ostream &out) const
const NDIndex< Dim > & getAllocated() const
virtual void write(std::ostream &out) const
virtual void write(std::ostream &out) const
OpBCFunctionEq(T(*func)(const T &))
bool IsCompressed() const
void InterpolationFaceBCApply(InterpolationFace< T, D, M, Cell > &pf, Field< T, D, M, Cell > &A)
void PeriodicFaceBCApply(PeriodicFace< T, D, M, Cell > &pf, Field< T, D, M, Cell > &A)
T * value_type(const SliceIterator< T > &)
bool touches(const Index &a) const
unsigned right(unsigned d) const
virtual void write(std::ostream &out) const
void CalcParallelInterpolationDomain(const Field< T, D, M, Cell > &A, const ParallelInterpolationFace< T, D, M, Cell > &pf, NDIndex< D > &src_slab, int &offset)
ApplyToComponentType< T >::type(* Func)(typename ApplyToComponentType< T >::type)
void ComponentLinearExtrapolateFaceBCApply2(const NDIndex< D > &dest, const NDIndex< D > &src1, const NDIndex< D > &src2, LField< T, D > &fill, ComponentLinearExtrapolateFace< T, D, M, C > &ef, int slopeMultipplier)
void apply(Field< T, D, M, C > &)
ComponentFunctionFace(typename ApplyToComponentType< T >::type(*func)(typename ApplyToComponentType< T >::type), unsigned face, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
const T & getSlope() const
ExtrapolateAndZeroFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
ApplyToComponentType< T >::type(* Func)(typename ApplyToComponentType< T >::type)
bool contains(const NDIndex< Dim > &a) const
const GuardCellSizes< Dim > & getGC() const
virtual void write(std::ostream &) const
FunctionFace(T(*func)(const T &), unsigned face)
virtual void write(std::ostream &out) const
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
void ExtrapolateAndZeroFaceBCApply3(const NDIndex< D > &dest, LField< T, D > &fill, ExtrapolateAndZeroFace< T, D, M, C > &ef)
std::string::iterator iterator
virtual void apply(Field< T, D, M, C > &)
const GuardCellSizes< Dim > & getGuardCellSizes() const
BCondBase(unsigned int face, int i=allComponents, int j=allComponents)
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::const_iterator const_iterator
Mesh_t & get_mesh() const
Interface for a single beam element.
void apply(Field< T, D, M, C > &)
void ExtrapolateAndZeroFaceBCApply2(const NDIndex< D > &dest, const NDIndex< D > &src, LField< T, D > &fill, LField< T, D > &from, const NDIndex< D > &from_alloc, ExtrapolateAndZeroFace< T, D, M, C > &ef)
ParticleSpatialLayout< double, 3, Mesh_t > Layout_t
virtual void write(std::ostream &out) const
Message * receive_block(int &node, int &tag)
TensorOrder_e getTensorOrder(const scalar_tag &)
virtual void apply(Field< T, D, M, C > &)
const T & getSlope() const
static Communicate * Comm
void ExtrapolateFaceBCApply(ExtrapolateFace< T, D, M, Cell > &ef, Field< T, D, M, Cell > &A)
bool send(Message *, int node, int tag, bool delmsg=true)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PeriodicFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
virtual void write(std::ostream &out) const
virtual void apply(Field< T, D, M, C > &)
Inform & endl(Inform &inf)
unsigned int getFace() const