32 template<
class T,
unsigned D,
class M,
class C>
40 #define COMPONENT_APPLY_BUILTIN(OP,T) \
41 inline void PETE_apply(const OP<T>&, T&, const T&) \
43 ERRORMSG("Component boundary condition on a scalar (T)." << endl); \
55 template<
class T,
unsigned int D,
class M,
class C>
57 : m_face(face), m_changePhysical(false)
64 ERRORMSG(
"BCondBase(): component 2 specified, component 1 not."
74 int lo = i < j ? i : j;
75 int hi = i > j ? i : j;
82 "BCondBase(): something other than [Sym,AntiSym]Tenzor specified"
83 <<
" two component indices; not implemented." <<
endl);
106 template<
class T,
unsigned int D,
class M,
class C>
109 out <<
"BCondBase" <<
", Face=" << m_face;
112 template<
class T,
unsigned int D,
class M,
class C>
119 template<
class T,
unsigned int D,
class M,
class C>
126 template<
class T,
unsigned int D,
class M,
class C>
132 template<
class T,
unsigned int D,
class M,
class C>
138 template<
class T,
unsigned int D,
class M,
class C>
144 template<
class T,
unsigned int D,
class M,
class C>
150 template<
class T,
unsigned int D,
class M,
class C>
156 template<
class T,
unsigned int D,
class M,
class C>
162 template<
class T,
unsigned int D,
class M,
class C>
168 template<
class T,
unsigned int D,
class M,
class C>
171 out <<
"ConstantFace"
173 <<
", Constant=" << this->
Offset
177 template<
class T,
unsigned int D,
class M,
class C>
183 template<
class T,
unsigned int D,
class M,
class C>
189 template<
class T,
unsigned int D,
class M,
class C>
195 template<
class T,
unsigned D,
class M,
class C>
202 <<
", Offset=" <<
Offset <<
", Slope=" << Slope;
205 template<
class T,
unsigned D,
class M,
class C>
212 <<
", Offset=" <<
Offset <<
", Slope=" << Slope;
215 template<
class T,
unsigned D,
class M,
class C>
224 template<
class T,
unsigned D,
class M,
class C>
234 template<
class T,
unsigned D,
class M,
class C>
243 while (p!=this->
end())
245 (*p).second->write(o);
250 o << std::endl <<
")" << std::endl <<
std::endl;
256 template<
class T,
unsigned D,
class M,
class C>
263 (*p).second->apply(a);
266 template<
class T,
unsigned D,
class M,
class C>
271 if ((*p).second->changesPhysicalCells())
281 template<
class T,
unsigned D,
class M,
class C>
291 template<
class T,
unsigned D,
class M,
class C>
299 template<
class T,
unsigned D,
class M,
class C>
307 template<
class T,
unsigned D,
class M,
class C>
316 template<
class T,
unsigned D,
class M,
class C>
325 template<
class T,
unsigned D,
class M,
class C>
329 unsigned face,
int i,
int j)
336 ERRORMSG(
"ComponentFunctionFace(): allComponents specified; not allowed; "
337 <<
"use FunctionFace class instead." <<
endl);
454 template<class
T,
unsigned D, class M>
458 template<class T,
unsigned D, class M>
462 template<class T,
unsigned D, class M>
465 template<class T,
unsigned D, class M>
468 template<class T,
unsigned D, class M,
CenteringEnum* CE,
unsigned NC>
473 template<class T,
unsigned D, class M, class C>
482 template<
class T,
unsigned D,
class M,
class C>
494 template<
class T,
unsigned D,
class M>
516 offset = -domain[d].
length();
521 offset = domain[d].
length();
531 if ( slab.
touches( fill_alloc ) )
538 src[d] = src[d] + offset;
549 if ( src.
touches( from_owned ) )
569 LFI lhs = fill.
begin(fill_it);
570 LFI rhs = from.
begin(from_it);
591 template<
class T,
unsigned D,
class M>
608 offset = -domain[d].
length();
613 offset = domain[d].
length();
623 if ( slab.
touches( fill_alloc ) )
631 dest[d] = dest[d] + offset;
645 if ( dest.
touches( from_owned ) )
665 LFI lhs = fill.
begin(fill_it);
666 LFI rhs = from.
begin(from_it);
687 template<
class T,
unsigned D,
class M>
708 offset = -domain[d].
length() + 1;
715 offset = domain[d].
length() - 1;
725 if ( slab.
touches( fill_alloc ) )
732 src[d] = src[d] + offset;
743 if ( src.
touches( from_owned ) )
763 LFI lhs = fill.
begin(fill_it);
764 LFI rhs = from.
begin(from_it);
785 template<
class T,
unsigned D,
class M>
803 offset = -domain[d].
length() + 1;
810 offset = domain[d].
length() - 1;
820 if ( slab.
touches( fill_alloc ) )
827 src[d] = src[d] + offset;
838 if ( src.
touches( from_owned ) )
858 LFI lhs = fill.
begin(fill_it);
859 LFI rhs = from.
begin(from_it);
879 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
893 unsigned d = pf.getFace()/2;
895 if ( pf.getFace() & 1 )
903 for (
unsigned int c=1;
c<NC;
c++) {
904 if (CE[
c + d*NC] != centering0)
905 ERRORMSG(
"PeriodicFaceBCApply: BCond thinks all components have"
906 <<
" same centering along direction " << d
907 <<
", but it isn't so." <<
endl);
910 if (centering0 ==
CELL) {
911 offset = -domain[d].length();
915 Index( domain[d].
max(), domain[d].
max() + A.rightGuard(d));
916 offset = -domain[d].
length()+1;
920 if (CE[pf.getComponent() + d*NC] ==
CELL) {
921 offset = -domain[d].length();
924 Index( domain[d].
max(), domain[d].
max() + A.rightGuard(d));
925 offset = -domain[d].
length()+1;
931 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
938 for (
unsigned int c=1;
c<NC;
c++) {
939 if (CE[
c + d*NC] != centering0)
940 ERRORMSG(
"PeriodicFaceBCApply: BCond thinks all components have"
941 <<
" same centering along direction " << d
942 <<
", but it isn't so." <<
endl);
945 if (centering0 ==
CELL) {
946 offset = -domain[d].length();
948 offset = -domain[d].length() + 1;
952 if (CE[pf.getComponent() + d*NC] ==
CELL) {
953 offset = domain[d].length();
955 offset = domain[d].length() - 1;
967 if ( slab.
touches( fill_alloc ) )
974 src[d] = src[d] + offset;
985 if ( src.
touches( from_owned ) )
1005 LFI lhs = fill.
begin(fill_it);
1006 LFI rhs = from.
begin(from_it);
1031 # include <iterator.h>
1034 template <
class T,
unsigned D,
class M>
1062 offset = -domain[d].
length();
1075 offset = domain[d].
length();
1082 template <
class T,
unsigned D,
class M>
1111 offset = -domain[d].
length() + 1;
1124 offset = domain[d].
length() - 1;
1130 template <
class T,
unsigned D,
class M>
1159 offset = -domain[d].
length() + 1;
1172 offset = domain[d].
length() - 1;
1178 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
1193 unsigned d = pf.getFace()/2;
1195 if (pf.getFace() & 1)
1203 if (pf.getComponent() == BCBase_t::allComponents)
1210 for (
unsigned int c = 1;
c < NC;
c++)
1213 if (CE[
c + d*NC] != centering0)
1214 ERRORMSG(
"ParallelPeriodicFaceBCApply:"
1215 <<
"BCond thinks all components have"
1216 <<
" same centering along direction " << d
1217 <<
", but it isn't so." <<
endl);
1223 if (centering0 ==
CELL) {
1224 offset = -domain[d].length();
1227 Index(domain[d].
max(), domain[d].
max() + A.leftGuard(d));
1228 offset = -domain[d].
length() + 1;
1237 if (CE[pf.getComponent() + d*NC] ==
CELL)
1239 offset = -domain[d].length();
1244 Index(domain[d].
max(), domain[d].
max() + A.leftGuard(d));
1245 offset = -domain[d].
length() + 1;
1256 Index(domain[d].
min() - A.leftGuard(d), domain[d].min()-1);
1260 if (pf.getComponent() == BCBase_t::allComponents)
1267 for (
unsigned int c = 1;
c < NC;
c++)
1269 if (CE[
c + d*NC] != centering0)
1270 ERRORMSG(
"ParallelPeriodicFaceBCApply:"
1271 <<
"BCond thinks all components have"
1272 <<
" same centering along direction " << d
1273 <<
", but it isn't so." <<
endl);
1279 if (centering0 ==
CELL) {
1280 offset = -domain[d].length();
1282 offset = -domain[d].length() + 1;
1291 if (CE[pf.getComponent() + d*NC] ==
CELL)
1293 offset = domain[d].length();
1297 offset = domain[d].length() - 1;
1313 template<
class T,
unsigned D,
class M,
class C>
1324 typedef T Element_t;
1374 unsigned d = this->getFace()/2;
1380 Domain_t src_slab = dest_slab;
1381 src_slab[d] = src_slab[d] + offset;
1384 msg <<
"dest_slab = " << dest_slab <<
endl;
1385 msg <<
"src_slab = " << src_slab <<
endl;
1403 typedef std::multimap<Domain_t,LField_t*, std::less<Domain_t> > ReceiveMap_t;
1409 ReceiveMap_t receive_map;
1415 int receive_count = 0;
1437 typedef std::vector<LField_t*> DestList_t;
1438 typedef std::vector<LField_t*> SrcList_t;
1442 DestList_t dest_list;
1445 dest_list.reserve(1);
1446 src_list.reserve(1);
1451 msg <<
"Starting dest & src domain calculation." <<
endl;
1456 LField_t &lf = *lf_i->second;
1461 const Domain_t &lf_allocated = lf.getAllocated();
1464 msg <<
" Processing subdomain : " << lf_allocated <<
endl;
1468 if (lf_allocated.touches(dest_slab))
1469 dest_list.push_back(&lf);
1475 const Domain_t &lf_owned = lf.getOwned();
1477 if (lf_owned.touches(src_slab))
1478 src_list.push_back(&lf);
1482 msg <<
" dest_list has " << dest_list.size() <<
" elements." <<
endl;
1483 msg <<
" src_list has " << src_list.size() <<
" elements." <<
endl;
1486 DestListIterator_t dest_begin = dest_list.begin();
1487 DestListIterator_t dest_end = dest_list.end();
1488 SrcListIterator_t src_begin = src_list.begin();
1489 SrcListIterator_t src_end = src_list.end();
1503 msg <<
"Starting receive calculation." <<
endl;
1513 std::vector<bool> receive_mask(nprocs,
false);
1515 DestListIterator_t dest_i;
1517 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
1521 LField_t &dest_lf = **dest_i;
1523 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
1529 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
1531 Domain_t src_domain = dest_domain;
1532 src_domain[d] = src_domain[d] + offset;
1545 typename Layout_t::touch_range_dv
1546 src_range(layout.touch_range_rdv(src_domain));
1553 typename Layout_t::touch_iterator_dv rv_i;
1555 for (rv_i = src_range.first; rv_i != src_range.second; ++rv_i)
1564 Domain_t hit = src_domain.intersect(rv_alloc);
1565 hit[d] = hit[d] - offset;
1571 receive_map.insert(
value_type(hit,&dest_lf));
1574 msg <<
" Need remote data for domain: " << hit <<
endl;
1579 int rnode = rv_i->second->getNode();
1581 receive_mask[rnode] =
true;
1588 for (
int iproc = 0; iproc < nprocs; ++iproc)
1589 if (receive_mask[iproc]) ++receive_count;
1593 msg <<
" Expecting to see " << receive_count <<
" messages." <<
endl;
1594 msg <<
"Done with receive calculation." <<
endl;
1604 msg <<
"Starting send calculation" <<
endl;
1613 std::vector<Message *> messages(nprocs);
1614 for (
int miter=0; miter < nprocs; messages[miter++] = 0);
1622 std::vector<int> ndomains(nprocs);
1623 for(
int i = 0; i < nprocs; ++i) ndomains[i] = 0;
1626 SrcListIterator_t src_i;
1628 for (src_i = src_begin; src_i != src_end; ++src_i)
1632 LField_t &src_lf = **src_i;
1640 const Domain_t &src_lf_owned = src_lf.getOwned();
1641 const Domain_t &src_lf_alloc = src_lf.getAllocated();
1647 const Domain_t src_owned = src_lf_owned.intersect(src_slab);
1648 const Domain_t src_alloc = src_lf_alloc.intersect(src_slab);
1650 Domain_t dest_owned = src_owned;
1651 dest_owned[d] = dest_owned[d] - offset;
1653 Domain_t dest_alloc = src_alloc;
1654 dest_alloc[d] = dest_alloc[d] - offset;
1657 msg <<
" Considering LField with the domains:" <<
endl;
1658 msg <<
" owned = " << src_lf_owned <<
endl;
1659 msg <<
" alloc = " << src_lf_alloc <<
endl;
1660 msg <<
" The intersections with src_slab are:" <<
endl;
1661 msg <<
" owned = " << src_owned <<
endl;
1662 msg <<
" alloc = " << src_alloc <<
endl;
1668 typename Layout_t::touch_range_dv
1669 dest_range(layout.touch_range_rdv(dest_owned,gc));
1671 typename Layout_t::touch_iterator_dv rv_i;
1680 for (rv_i = dest_range.first; rv_i != dest_range.second; ++rv_i)
1686 Domain_t hit = dest_alloc.intersect(rv_i->first);
1687 hit[d] = hit[d] + offset;
1691 int rnode = rv_i->second->getNode();
1694 msg <<
" Overlap domain = " << rv_i->first <<
endl;
1695 msg <<
" Inters. domain = " << hit;
1696 msg <<
" --> node " << rnode <<
endl;
1705 Element_t compressed_value;
1706 LFI_t msgval = src_lf.begin(hit, compressed_value);
1707 msgval.TryCompress();
1711 if (!messages[rnode])
1713 messages[rnode] =
new Message;
1717 messages[rnode]->put(hit);
1718 messages[rnode]->put(msgval);
1735 for (
int iproc = 0; iproc < nprocs; ++iproc)
1737 if (messages[iproc])
1741 msg <<
" ParallelPeriodicBCApply: Sending message to node "
1743 <<
" number of domains = " << ndomains[iproc] << endl
1744 <<
" number of MsgItems = "
1745 << messages[iproc]->size() <<
endl;
1758 msg <<
" Sent " << send_count <<
" messages" <<
endl;
1759 msg <<
"Done with send." <<
endl;
1776 msg <<
"Starting local calculation." <<
endl;
1779 DestListIterator_t dest_i;
1781 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
1785 LField_t &dest_lf = **dest_i;
1787 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
1789 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
1791 Domain_t src_domain = dest_domain;
1792 src_domain[d] = src_domain[d] + offset;
1794 SrcListIterator_t src_i;
1796 for (src_i = src_begin; src_i != src_end; ++src_i)
1800 LField_t &src_lf = **src_i;
1806 const Domain_t &src_lf_owned = src_lf.getOwned();
1807 const Domain_t &src_lf_alloc = src_lf.getAllocated();
1812 if (src_domain.touches(src_lf_owned))
1818 dest_lf.Uncompress();
1822 Domain_t real_src_domain =
1823 src_domain.intersect(src_lf_alloc);
1825 Domain_t real_dest_domain = real_src_domain;
1826 real_dest_domain[d] = real_dest_domain[d] - offset;
1829 msg <<
" Copying local data . . ." <<
endl;
1830 msg <<
" source domain = " << real_src_domain <<
endl;
1831 msg <<
" dest domain = " << real_dest_domain <<
endl;
1836 LFI_t lhs = dest_lf.begin(real_dest_domain);
1837 LFI_t rhs = src_lf.begin(real_src_domain);
1856 msg <<
"Done with local calculation." <<
endl;
1872 msg <<
"Starting receive..." <<
endl;
1876 while (receive_count > 0)
1895 int ndomains = message->
size() / (D + 3);
1898 msg <<
" Message received from node "
1899 << any_node <<
"," << endl
1900 <<
" number of domains = " << ndomains <<
endl;
1903 for (
int idomain=0; idomain < ndomains; ++idomain)
1908 Domain_t intersection;
1909 intersection.getMessage(*message);
1910 intersection[d] = intersection[d] - offset;
1914 Element_t compressed_value;
1915 LFI_t rhs(compressed_value);
1916 rhs.getMessage(*message);
1919 msg <<
" Received remote overlap region = "
1920 << intersection <<
endl;
1926 receive_map.find(intersection);
1928 PAssert(hit != receive_map.end());
1941 msg <<
" LHS compressed ? " << lf.IsCompressed();
1942 msg <<
", LHS value = " << *lf.begin() <<
endl;
1943 msg <<
" RHS compressed ? " << rhs.IsCompressed();
1944 msg <<
", RHS value = " << *rhs <<
endl;
1945 msg <<
" *rhs == *lf.begin() ? "
1946 << (*rhs == *lf.begin()) << endl;
1948 if (!(rhs.IsCompressed() && lf.IsCompressed() &&
1949 (*rhs == *lf.begin())))
1954 LFI_t lhs = lf.begin(intersection);
1959 msg <<
" Doing copy." <<
endl;
1967 receive_map.erase(hit);
1975 msg <<
"Done with receive." <<
endl;
1985 template <
class T,
unsigned D,
class M>
2013 offset = -domain[d].
length();
2026 offset = domain[d].
length();
2034 template<
class T,
unsigned D,
class M,
class C>
2045 typedef T Element_t;
2095 unsigned d = this->getFace()/2;
2101 Domain_t dest_slab = src_slab;
2102 dest_slab[d] = dest_slab[d] + offset;
2105 msg <<
"dest_slab = " << dest_slab <<
endl;
2106 msg <<
"src_slab = " << src_slab <<
endl;
2124 typedef std::multimap<Domain_t,LField_t*, std::less<Domain_t> > ReceiveMap_t;
2130 ReceiveMap_t receive_map;
2136 int receive_count = 0;
2158 typedef std::vector<LField_t*> DestList_t;
2159 typedef std::vector<LField_t*> SrcList_t;
2163 DestList_t dest_list;
2166 dest_list.reserve(1);
2167 src_list.reserve(1);
2172 msg <<
"Starting dest & src domain calculation." <<
endl;
2177 LField_t &lf = *lf_i->second;
2183 const Domain_t &lf_owned = lf.getOwned();
2186 msg <<
" Processing subdomain : " << lf_owned <<
endl;
2190 if (lf_owned.touches(dest_slab))
2191 dest_list.push_back(&lf);
2197 const Domain_t &lf_allocated = lf.getAllocated();
2199 if (lf_allocated.touches(src_slab))
2200 src_list.push_back(&lf);
2204 msg <<
" dest_list has " << dest_list.size() <<
" elements." <<
endl;
2205 msg <<
" src_list has " << src_list.size() <<
" elements." <<
endl;
2208 DestListIterator_t dest_begin = dest_list.begin();
2209 DestListIterator_t dest_end = dest_list.end();
2210 SrcListIterator_t src_begin = src_list.begin();
2211 SrcListIterator_t src_end = src_list.end();
2225 msg <<
"Starting receive calculation." <<
endl;
2235 std::vector<bool> receive_mask(nprocs,
false);
2237 DestListIterator_t dest_i;
2239 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
2243 LField_t &dest_lf = **dest_i;
2245 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
2251 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
2253 Domain_t src_domain = dest_domain;
2256 src_domain[d] = src_domain[d] - offset;
2270 typename Layout_t::touch_range_dv
2271 src_range(layout.touch_range_rdv(src_domain,gc));
2278 typename Layout_t::touch_iterator_dv rv_i;
2280 for (rv_i = src_range.first; rv_i != src_range.second; ++rv_i)
2288 const Domain_t rv_alloc = rv_i->first;
2290 Domain_t hit = src_domain.intersect(rv_alloc);
2292 hit[d] = hit[d] + offset;
2298 receive_map.insert(
value_type(hit,&dest_lf));
2301 msg <<
" Need remote data for domain: " << hit <<
endl;
2306 int rnode = rv_i->second->getNode();
2308 receive_mask[rnode] =
true;
2315 for (
int iproc = 0; iproc < nprocs; ++iproc)
2316 if (receive_mask[iproc]) ++receive_count;
2320 msg <<
" Expecting to see " << receive_count <<
" messages." <<
endl;
2321 msg <<
"Done with receive calculation." <<
endl;
2331 msg <<
"Starting send calculation" <<
endl;
2340 std::vector<Message *> messages(nprocs);
2341 for (
int miter=0; miter < nprocs; messages[miter++] = 0);
2349 std::vector<int> ndomains(nprocs);
2350 for(
int i = 0; i < nprocs; ++i) ndomains[i] = 0;
2353 SrcListIterator_t src_i;
2355 for (src_i = src_begin; src_i != src_end; ++src_i)
2359 LField_t &src_lf = **src_i;
2367 const Domain_t &src_lf_owned = src_lf.getOwned();
2368 const Domain_t &src_lf_alloc = src_lf.getAllocated();
2374 const Domain_t src_owned = src_lf_owned.intersect(src_slab);
2375 const Domain_t src_alloc = src_lf_alloc.intersect(src_slab);
2377 Domain_t dest_owned = src_owned;
2378 dest_owned[d] = dest_owned[d] + offset;
2380 Domain_t dest_alloc = src_alloc;
2381 dest_alloc[d] = dest_alloc[d] + offset;
2384 msg <<
" Considering LField with the domains:" <<
endl;
2385 msg <<
" owned = " << src_lf_owned <<
endl;
2386 msg <<
" alloc = " << src_lf_alloc <<
endl;
2387 msg <<
" The intersections with src_slab are:" <<
endl;
2388 msg <<
" owned = " << src_owned <<
endl;
2389 msg <<
" alloc = " << src_alloc <<
endl;
2395 typename Layout_t::touch_range_dv
2396 dest_range(layout.touch_range_rdv(dest_owned,gc));
2398 typename Layout_t::touch_iterator_dv rv_i;
2407 for (rv_i = dest_range.first; rv_i != dest_range.second; ++rv_i)
2413 Domain_t hit = dest_alloc.intersect(rv_i->first);
2414 hit[d] = hit[d] - offset;
2418 int rnode = rv_i->second->getNode();
2421 msg <<
" Overlap domain = " << rv_i->first <<
endl;
2422 msg <<
" Inters. domain = " << hit;
2423 msg <<
" --> node " << rnode <<
endl;
2432 Element_t compressed_value;
2433 LFI_t msgval = src_lf.begin(hit, compressed_value);
2434 msgval.TryCompress();
2438 if (!messages[rnode])
2440 messages[rnode] =
new Message;
2444 messages[rnode]->put(hit);
2445 messages[rnode]->put(msgval);
2462 for (
int iproc = 0; iproc < nprocs; ++iproc)
2464 if (messages[iproc])
2468 msg <<
" ParallelPeriodicBCApply: Sending message to node "
2470 <<
" number of domains = " << ndomains[iproc] << endl
2471 <<
" number of MsgItems = "
2472 << messages[iproc]->size() <<
endl;
2484 msg <<
" Sent " << send_count <<
" messages" <<
endl;
2485 msg <<
"Done with send." <<
endl;
2502 msg <<
"Starting local calculation." <<
endl;
2505 DestListIterator_t dest_i;
2507 for (dest_i = dest_begin; dest_i != dest_end; ++dest_i)
2511 LField_t &dest_lf = **dest_i;
2513 const Domain_t &dest_lf_alloc = dest_lf.getAllocated();
2516 const Domain_t dest_domain = dest_lf_alloc.intersect(dest_slab);
2518 Domain_t src_domain = dest_domain;
2521 src_domain[d] = src_domain[d] - offset;
2523 SrcListIterator_t src_i;
2525 for (src_i = src_begin; src_i != src_end; ++src_i)
2529 LField_t &src_lf = **src_i;
2536 const Domain_t &src_lf_alloc = src_lf.getAllocated();
2541 if (src_domain.touches(src_lf_alloc))
2547 dest_lf.Uncompress();
2551 Domain_t real_src_domain =
2552 src_domain.intersect(src_lf_alloc);
2554 Domain_t real_dest_domain = real_src_domain;
2556 real_dest_domain[d] = real_dest_domain[d] + offset;
2559 msg <<
" Copying local data . . ." <<
endl;
2560 msg <<
" source domain = " << real_src_domain <<
endl;
2561 msg <<
" dest domain = " << real_dest_domain <<
endl;
2566 LFI_t lhs = dest_lf.begin(real_dest_domain);
2567 LFI_t rhs = src_lf.begin(real_src_domain);
2586 msg <<
"Done with local calculation." <<
endl;
2602 msg <<
"Starting receive..." <<
endl;
2606 while (receive_count > 0)
2625 int ndomains = message->
size() / (D + 3);
2628 msg <<
" Message received from node "
2629 << any_node <<
"," << endl
2630 <<
" number of domains = " << ndomains <<
endl;
2633 for (
int idomain=0; idomain < ndomains; ++idomain)
2638 Domain_t intersection;
2639 intersection.getMessage(*message);
2641 intersection[d] = intersection[d] + offset;
2645 Element_t compressed_value;
2646 LFI_t rhs(compressed_value);
2647 rhs.getMessage(*message);
2650 msg <<
" Received remote overlap region = "
2651 << intersection <<
endl;
2657 receive_map.find(intersection);
2659 PAssert(hit != receive_map.end());
2672 msg <<
" LHS compressed ? " << lf.IsCompressed();
2673 msg <<
", LHS value = " << *lf.begin() <<
endl;
2674 msg <<
" RHS compressed ? " << rhs.IsCompressed();
2675 msg <<
", RHS value = " << *rhs <<
endl;
2676 msg <<
" *rhs == *lf.begin() ? "
2677 << (*rhs == *lf.begin()) << endl;
2679 if (!(rhs.IsCompressed() && lf.IsCompressed() &&
2680 (*rhs == *lf.begin())))
2685 LFI_t lhs = lf.begin(intersection);
2690 msg <<
" Doing copy." <<
endl;
2699 receive_map.erase(hit);
2707 msg <<
"Done with receive." <<
endl;
2784 template<class
T,
unsigned D, class M>
2787 template<class T,
unsigned D, class M>
2790 template<class T,
unsigned D, class M>
2793 template<class T,
unsigned D, class M,
CenteringEnum* CE,
unsigned NC>
2798 template<class T,
unsigned D, class M, class C>
2805 template<
class T,
unsigned D,
class M,
class C>
2853 LFI lhs = fill.
begin(fill_it);
2854 LFI rhs = from.
begin(from_it);
2877 template<
class T,
unsigned D,
class M>
2914 offset = 2*domain[d].
max() + 1;
2927 offset = 2*domain[d].
min() - 1;
2966 src[d] = offset - src[d];
2994 if (src.touches(from_owned))
3009 template<
class T,
unsigned D,
class M>
3048 offset = 2*domain[d].
max() + 1 - 1;
3062 offset = 2*domain[d].
min() - 1 + 1;
3082 if ( slab.
touches( fill_alloc ) )
3099 src[d] = offset - src[d];
3127 if (src.touches(from_owned))
3143 template<
class T,
unsigned D,
class M>
3179 offset = 2*domain[d].
max() + 1 - 1;
3193 offset = 2*domain[d].
min() - 1 + 1;
3213 if ( slab.
touches( fill_alloc ) )
3230 src[d] = offset - src[d];
3258 if (src.touches(from_owned))
3272 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
3291 unsigned d = ef.getFace()/2;
3299 if ( ef.getFace() & 1 )
3312 for (
unsigned int c=1;
c<NC;
c++)
3315 if (CE[
c + d*NC] != centering0)
3316 ERRORMSG(
"ExtrapolateFaceBCApply: BCond thinks all components"
3317 <<
" have same centering along direction " << d
3318 <<
", but it isn't so." <<
endl);
3327 slab[d] =
Index(domain[d].
max() + 1,
3328 domain[d].
max() + A.rightGuard(d));
3330 if (centering0 ==
CELL)
3332 offset = 2*domain[d].
max() + 1 ;
3336 offset = 2*domain[d].max() + 1 - 1;
3343 if (CE[ef.getComponent() + d*NC] ==
CELL)
3348 int highcell = A.get_mesh().gridSizes[d] - 2;
3349 slab[d] =
Index(highcell + 1, highcell + A.rightGuard(d));
3352 offset = 2*highcell + 1 ;
3359 int highvert = A.get_mesh().gridSizes[d] - 1;
3360 slab[d] =
Index(highvert + 1, highvert + A.rightGuard(d));
3363 offset = 2*highvert + 1 - 1;
3373 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
3386 for (
unsigned int c=1;
c<NC;
c++)
3390 if (CE[
c + d*NC] != centering0)
3391 ERRORMSG(
"ExtrapolateFaceBCApply: BCond thinks all components"
3392 <<
" have same centering along direction " << d
3393 <<
", but it isn't so." <<
endl);
3399 if (centering0 ==
CELL)
3401 offset = 2*domain[d].min() - 1;
3405 offset = 2*domain[d].min() - 1 + 1;
3413 if (CE[ef.getComponent() + d*NC] ==
CELL)
3415 offset = 2*domain[d].min() - 1;
3419 offset = 2*domain[d].min() - 1 + 1;
3443 if ( slab.
touches( fill_alloc ) )
3460 src[d] = offset - src[d];
3489 if (src.touches(from_owned))
3567 template<
class T,
class T1>
3597 template<class
T,
unsigned D, class M>
3600 template<class T,
unsigned D, class M>
3603 template<class T,
unsigned D, class M>
3606 template<class T,
unsigned D, class M,
CenteringEnum* CE,
unsigned NC>
3611 template<class T,
unsigned D, class M, class C>
3618 template<
class T,
unsigned D,
class M,
class C>
3665 LFI lhs = fill.
begin(fill_it);
3666 LFI rhs = from.
begin(from_it);
3686 template<
class T,
unsigned D,
class M,
class C>
3729 LFI lhs = fill.
begin(dest);
3755 template<
class T,
unsigned D,
class M>
3792 offset = 2*domain[d].
max() + 1;
3805 offset = 2*domain[d].
min() - 1;
3844 src[d] = offset - src[d];
3872 if (src.touches(from_owned))
3888 template<
class T,
unsigned D,
class M>
3924 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
3931 offset = 2*domain[d].max() + 1 - 1;
3943 phys[d] =
Index( domain[d].
min(), domain[d].
min(), 1);
3950 offset = 2*domain[d].min() - 1 + 1;
3970 if (phys.touches(fill_alloc))
3991 if ( slab.
touches( fill_alloc ) )
4008 src[d] = offset - src[d];
4036 if (src.touches(from_owned))
4052 template<
class T,
unsigned D,
class M>
4087 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
4094 offset = 2*domain[d].max() + 1 - 1;
4106 phys[d] =
Index( domain[d].
min(), domain[d].
min(), 1);
4113 offset = 2*domain[d].min() - 1 + 1;
4133 if (phys.touches(fill_alloc))
4154 if ( slab.
touches( fill_alloc ) )
4171 src[d] = offset - src[d];
4199 if (src.touches(from_owned))
4213 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
4232 unsigned d = ef.getFace()/2;
4234 bool setPhys =
false;
4241 if ( ef.getFace() & 1 )
4254 for (
unsigned int c=1;
c<NC;
c++)
4257 if (CE[
c + d*NC] != centering0)
4259 "ExtrapolateAndZeroFaceBCApply: BCond thinks all components"
4260 <<
" have same centering along direction " << d
4261 <<
", but it isn't so." <<
endl);
4270 slab[d] =
Index(domain[d].
max() + 1,
4271 domain[d].
max() + A.rightGuard(d));
4273 if (centering0 ==
CELL)
4275 offset = 2*domain[d].
max() + 1 ;
4279 offset = 2*domain[d].max() + 1 - 1;
4283 phys[d] =
Index( domain[d].
max(), domain[d].
max(), 1);
4291 if (CE[ef.getComponent() + d*NC] ==
CELL)
4296 int highcell = A.get_mesh().gridSizes[d] - 2;
4297 slab[d] =
Index(highcell + 1, highcell + A.rightGuard(d));
4300 offset = 2*highcell + 1 ;
4308 int highvert = A.get_mesh().gridSizes[d] - 1;
4309 slab[d] =
Index(highvert + 1, highvert + A.rightGuard(d));
4313 offset = 2*highvert + 1 - 1;
4317 phys[d] =
Index( highvert, highvert, 1 );
4328 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
4341 for (
unsigned int c=1;
c<NC;
c++)
4345 if (CE[
c + d*NC] != centering0)
4347 "ExtrapolateAndZeroFaceBCApply: BCond thinks all components"
4348 <<
" have same centering along direction " << d
4349 <<
", but it isn't so." <<
endl);
4355 if (centering0 ==
CELL)
4357 offset = 2*domain[d].min() - 1;
4361 offset = 2*domain[d].min() - 1 + 1;
4365 phys[d] =
Index(domain[d].
min(), domain[d].
min(), 1);
4374 if (CE[ef.getComponent() + d*NC] ==
CELL)
4376 offset = 2*domain[d].min() - 1;
4380 offset = 2*domain[d].min() - 1 + 1;
4384 phys[d] =
Index(domain[d].
min(), domain[d].
min(), 1);
4410 if (phys.touches(fill_alloc))
4432 if ( slab.
touches( fill_alloc ) )
4449 src[d] = offset - src[d];
4478 if (src.touches(from_owned))
4526 template<
class T,
unsigned D,
class M>
4529 template<
class T,
unsigned D,
class M>
4532 template<
class T,
unsigned D,
class M>
4535 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
4540 template<
class T,
unsigned D,
class M,
class C>
4552 template<
class T,
unsigned D,
class M>
4570 offset = 2*domain[d].
max() + 1;
4574 offset = 2*domain[d].
min() - 1;
4584 if ( slab.
touches( fill_alloc ) )
4591 src[d] = offset - src[d];
4602 if ( src.touches( from_owned ) )
4622 LFI lhs = fill.
begin(fill_it);
4623 LFI rhs = from.
begin(from_it);
4637 template<
class T,
unsigned D,
class M>
4657 offset = 2*domain[d].
max() + 1 - 1;
4663 offset = 2*domain[d].
min() - 1 + 1;
4673 if ( slab.
touches( fill_alloc ) )
4680 src[d] = offset - src[d];
4691 if ( src.touches( from_owned ) )
4711 LFI lhs = fill.
begin(fill_it);
4712 LFI rhs = from.
begin(from_it);
4726 template<
class T,
unsigned D,
class M>
4743 offset = 2*domain[d].
max() + 1 - 1;
4749 offset = 2*domain[d].
min() - 1 + 1;
4759 if ( slab.
touches( fill_alloc ) )
4766 src[d] = offset - src[d];
4777 if ( src.touches( from_owned ) )
4797 LFI lhs = fill.
begin(fill_it);
4798 LFI rhs = from.
begin(from_it);
4812 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
4826 unsigned d = ff.getFace()/2;
4828 if ( ff.getFace() & 1 ) {
4830 slab[d] =
Index( domain[d].
max() + 1, domain[d].
max() + A.rightGuard(d));
4834 for (
int c=1;
c<NC;
c++) {
4835 if (CE[
c + d*NC] != centering0)
4836 ERRORMSG(
"FunctionFaceBCApply: BCond thinks all components have"
4837 <<
" same centering along direction " << d
4838 <<
", but it isn't so." <<
endl);
4841 if (centering0 ==
CELL) {
4842 offset = 2*domain[d].max() + 1;
4844 offset = 2*domain[d].max() + 1 - 1;
4848 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
4852 for (
int c=1;
c<NC;
c++) {
4853 if (CE[
c + d*NC] != centering0)
4854 ERRORMSG(
"FunctionFaceBCApply: BCond thinks all components have"
4855 <<
" same centering along direction " << d
4856 <<
", but it isn't so." <<
endl);
4859 if (centering0 ==
CELL) {
4860 offset = 2*domain[d].min() - 1;
4862 offset = 2*domain[d].min() - 1 + 1;
4873 if ( slab.
touches( fill_alloc ) )
4880 src[d] = offset - src[d];
4891 if ( src.touches( from_owned ) )
4911 LFI lhs = fill.
begin(fill_it);
4912 LFI rhs = from.
begin(from_it);
4977 template<class
T,
unsigned D, class M>
4980 template<class T,
unsigned D, class M>
4983 template<class T,
unsigned D, class M>
4986 template<class T,
unsigned D, class M,
CenteringEnum* CE,
unsigned NC>
4992 template<class T,
unsigned D, class M, class C>
5003 template<
class T,
unsigned D,
class M>
5021 offset = 2*domain[d].
max() + 1;
5025 offset = 2*domain[d].
min() - 1;
5035 if ( slab.
touches( fill_alloc ) )
5042 src[d] = offset - src[d];
5053 if ( src.touches( from_owned ) )
5073 LFI lhs = fill.
begin(fill_it);
5074 LFI rhs = from.
begin(from_it);
5090 template<
class T,
unsigned D,
class M>
5110 offset = 2*domain[d].
max() + 1 - 1;
5116 offset = 2*domain[d].
min() - 1 + 1;
5126 if ( slab.
touches( fill_alloc ) )
5133 src[d] = offset - src[d];
5144 if ( src.touches( from_owned ) )
5164 LFI lhs = fill.
begin(fill_it);
5165 LFI rhs = from.
begin(from_it);
5181 template<
class T,
unsigned D,
class M>
5198 offset = 2*domain[d].
max() + 1 - 1;
5204 offset = 2*domain[d].
min() - 1 + 1;
5214 if ( slab.
touches( fill_alloc ) )
5221 src[d] = offset - src[d];
5232 if ( src.touches( from_owned ) )
5252 LFI lhs = fill.
begin(fill_it);
5253 LFI rhs = from.
begin(from_it);
5269 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
5283 unsigned d = ff.getFace()/2;
5285 if ( ff.getFace() & 1 ) {
5287 slab[d] =
Index( domain[d].
max() + 1, domain[d].
max() + A.rightGuard(d));
5290 if (CE[ff.getComponent() + d*NC] ==
CELL) {
5291 ERRORMSG(
"check src code, had to change ef (not known) to ff ??? " <<
endl);
5292 offset = 2*domain[d].max() + 1;
5294 offset = 2*domain[d].max() + 1 - 1;
5298 slab[d] =
Index( domain[d].
min() - A.leftGuard(d), domain[d].min()-1 );
5301 if (CE[ff.getComponent() + d*NC] ==
CELL) {
5302 offset = 2*domain[d].
min() - 1;
5304 offset = 2*domain[d].min() - 1 + 1;
5315 if ( slab.
touches( fill_alloc ) )
5322 src[d] = offset - src[d];
5333 if ( src.touches( from_owned ) )
5353 LFI lhs = fill.
begin(fill_it);
5354 LFI rhs = from.
begin(from_it);
5358 (ff.Func,ff.getComponent())).
apply();
5383 template<
class T,
unsigned int D,
class M,
class C>
5391 fillSlabWithZero(field,slab,this->getComponent());
5415 static const T&
get(
const T& x, int) {
5416 ERRORMSG(
"Eureka assign to a component of class without an op[]!"<<
endl);
5419 static T&
get(
T& x, int) {
5420 ERRORMSG(
"Eureka assign to a component of class without an op[]!"<<
endl);
5435 template<
class T,
unsigned int D,
class M,
class C>
5446 for (; lp != done ; ++lp )
5455 if ( fillDomain.
touches(localDomain) )
5464 if ( *lf.
begin() == 0 )
5500 Expr_t(data,Rhs_t(0)).apply();
5512 Expr_t(data,Rhs_t(0),component).apply();
5524 template<
class T,
unsigned int D>
5533 template<
class T,
unsigned int D>
5542 template<
class T,
unsigned int D>
5551 template<
class T,
unsigned int D>
5580 template<
unsigned int D>
5598 high = slab[dim].max();
5599 low = high - gc.
right(dim);
5605 low = slab[dim].min();
5606 high = low + gc.
left(dim);
5615 slab[dim] =
Index(low,high);
5627 template<
class T,
unsigned int D,
class M>
5634 template<
class T,
unsigned int D,
class M>
5641 template<
class T,
unsigned int D,
class M>
5660 template<
class T,
unsigned D,
class M, CenteringEnum* CE,
unsigned NC>
5696 if (CE[component + d*NC] ==
CELL)
5705 slab[d] =
Index(low,high);
5711 int low = slab[d].min();
5715 if (CE[component + d*NC] ==
CELL)
5724 slab[d] =
Index(low,high);
5750 template<
class T,
unsigned D,
class M,
class C>
5754 template<
class T,
unsigned D,
class M,
class C>
5761 template<
class T,
unsigned D,
class M,
class C>
5768 int slopeMultipplier)
5779 LFI lhs = fill.
begin(dest);
5780 LFI rhs1 = fill.
begin(src1);
5781 LFI rhs2 = fill.
begin(src2);
5782 LFI endi = fill.
end();
5787 for ( ; lhs != endi && rhs1 != endi && rhs2 != endi;
5788 ++lhs, ++rhs1, ++rhs2) {
5789 *lhs = (*rhs2 - *rhs1)*slopeMultipplier + *rhs1;
5801 template<
class T,
unsigned D,
class M,
class C>
5847 for (
int guardLayer = 1; guardLayer <= nGuardLayers; guardLayer++) {
5851 int slopeMultipplier = -1*guardLayer;
5854 slab[d] =
Index(domain[d].
max() + guardLayer,
5855 domain[d].
max() + guardLayer);
5857 slab[d] =
Index(domain[d].
min() - guardLayer,
5858 domain[d].
min() - guardLayer);
5879 if (slab.
touches(fill_alloc)) {
5894 src2[d] =
Index(domain[d].
max() - 1, domain[d].
max() - 1, 1);
5895 src1[d] =
Index(domain[d].
max(), domain[d].
max(), 1);
5897 src1[d] =
Index(0,0,1);
5898 src2[d] =
Index(1,1,1);
5931 template<
class T,
unsigned D,
class M,
class C>
5936 template<
class T,
unsigned D,
class M,
class C>
5943 template<
class T,
unsigned D,
class M,
class C>
5951 int slopeMultipplier)
5962 LFI lhs = fill.
begin(dest);
5963 LFI rhs1 = fill.
begin(src1);
5964 LFI rhs2 = fill.
begin(src2);
5965 LFI endi = fill.
end();
5971 int component = ef.getComponent();
5972 for ( ; lhs != endi, rhs1 != endi, rhs2 != endi;
5973 ++lhs, ++rhs1, ++rhs2) {
5988 template<
class T,
unsigned D,
class M,
class C>
6005 unsigned d = ef.getFace()/2;
6015 if (ef.getFace() & 1) {
6033 for (
int guardLayer = 1; guardLayer <= nGuardLayers; guardLayer++) {
6037 int slopeMultipplier = -1*guardLayer;
6039 if (ef.getFace() & 1) {
6040 slab[d] =
Index(domain[d].
max() + guardLayer,
6041 domain[d].
max() + guardLayer);
6043 slab[d] =
Index(domain[d].
min() - guardLayer,
6044 domain[d].
min() - guardLayer);
6065 if (slab.
touches(fill_alloc)) {
6079 if (ef.getFace() & 1) {
6080 src2[d] =
Index(domain[d].
max() - 1, domain[d].
max() - 1, 1);
6081 src1[d] =
Index(domain[d].
max(), domain[d].
max(), 1);
6083 src1[d] =
Index(0,0,1);
6084 src2[d] =
Index(1,1,1);
6102 template<
class T,
unsigned D,
class M,
class C>
6118 template<
class T,
unsigned D,
class M,
class C>
6143 unsigned d = this->getFace()/2;
6150 if ( this->getFace() & 1 )
6161 for (fill_i=A.
begin_if(); fill_i!=A.
end_if(); ++fill_i, ++lfindex)
6175 if ( slab.
touches( fill_alloc ) )
6189 for (
int i=0; i<D; ++i)
6190 v[i] = dest[i].first();
6203 #undef COMPONENT_APPLY_BUILTIN
Expression Expr_t
type of an expression
Field< double, 3, Mesh_t, Center_t > Field_t
void CalcParallelInterpolationDomain(const Field< T, D, M, Cell > &A, const ParallelInterpolationFace< T, D, M, Cell > &pf, NDIndex< D > &src_slab, int &offset)
constexpr double c
The velocity of light in m/s.
InterpolationFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
const NDIndex< Dim > & getOwned() const
virtual void write(std::ostream &out) const
unsigned int length() const
#define BC_PARALLEL_PERIODIC_TAG
bool touches(const NDIndex< Dim > &) const
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::iterator iterator
const NDIndex< Dim > & getAllocated() const
virtual void write(std::ostream &out) const
Message * receive_block(int &node, int &tag)
void SetCurrentLocation(const FieldLoc< Dim > &loc)
void PeriodicFaceBCApply(PeriodicFace< T, D, M, Cell > &pf, Field< T, D, M, Cell > &A)
item[EANGLE] Entrance edge counterclockwise This enables to obtain skew at each point along the its radius is computed such that the reference trajectory always remains in the centre of the magnet In the body of the magnet the radius is set from the LENGTH and ANGLE attributes It is then continuously changed to be proportional to the dipole field on the reference trajectory while entering the end fields This attribute is only to be set TRUE for a non zero dipole component(Default:FALSE)\item[VARSTEP] The step size(meters) used in calculating the reference trajectory for VARRARDIUS
NDIndex< Dim > plugBase(const NDIndex< D > &i) const
OpBCFunctionEq(T(*func)(const T &))
virtual void write(std::ostream &out) const
OpExtrapolateAndZero(const T &o, const T &s)
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
bool IsCompressed() 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)
virtual void apply(Field< T, D, M, C > &)
void Uncompress(bool fill_domain=true)
int next_tag(int t, int s=1000)
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
const GuardCellSizes< Dim > & getGC() const
virtual void write(std::ostream &out) const
TensorOrder_e getTensorOrder(const scalar_tag &)
OpInterpolationComponent(int c)
void apply(Field< T, D, M, C > &)
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
virtual void write(std::ostream &out) const
virtual void write(std::ostream &) const
const T & getOffset() const
static const T & get(const T &x, int)
virtual void write(std::ostream &) const
Inform & endl(Inform &inf)
Index intersect(const Index &) const
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 apply(Field< T, D, M, C > &A)
bool touches(const Index &a) const
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
std::string::iterator iterator
virtual void write(std::ostream &out) const
const GuardCellSizes< Dim > & getGuardCellSizes() const
virtual void apply(Field< T, D, M, C > &A)
virtual void write(std::ostream &) const
virtual void apply(Field< T, D, M, C > &)
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::const_iterator const_iterator
void ExtrapolateAndZeroFaceBCApply(ExtrapolateAndZeroFace< T, D, M, Cell > &ef, Field< T, D, M, Cell > &A)
OpExtrapolateAndZeroComponent(const T &o, const T &s, int c)
bool contains(const NDIndex< Dim > &a) const
static Communicate * Comm
unsigned rightGuard(unsigned d) const
#define COMPONENT_APPLY_BUILTIN(OP, T)
void PETE_apply(const OpPeriodic< T > &, T &a, const T &b)
virtual void write(std::ostream &out) const
scalar_tag get_tag(std::complex< double >)
FunctionFace(T(*func)(const T &), unsigned face)
virtual void write(std::ostream &out) const
ComponentFunctionFace(typename ApplyToComponentType< T >::type(*func)(typename ApplyToComponentType< T >::type), unsigned face, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
void apply(Field< T, D, M, C > &a)
unsigned left(unsigned d) const
Layout_t & getLayout() const
ExtrapolateAndZeroFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
BCondBase(unsigned int face, int i=allComponents, int j=allComponents)
ExtrapolateFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
virtual void write(std::ostream &out) const
OpExtrapolateComponent(const T &o, const T &s, int c)
bool send(Message *, int node, int tag, bool delmsg=true)
OpPeriodicComponent(int c)
virtual void write(std::ostream &) const
const T & getSlope() const
virtual void apply(Field< T, D, M, C > &)
const iterator & end() const
bool changesPhysicalCells() const
Mesh_t & get_mesh() const
void ComponentLinearExtrapolateFaceBCApply(ComponentLinearExtrapolateFace< T, D, M, C > &ef, Field< T, D, M, C > &A)
void LinearExtrapolateFaceBCApply(LinearExtrapolateFace< T, D, M, C > &ef, Field< T, D, M, C > &A)
ApplyToComponentType< T >::type(* Func)(typename ApplyToComponentType< T >::type)
unsigned int getFace() const
void InterpolationFaceBCApply(InterpolationFace< T, D, M, Cell > &pf, Field< T, D, M, Cell > &A)
const T & getSlope() const
virtual void write(std::ostream &out) const
void FunctionFaceBCApply(FunctionFace< T, D, M, Cell > &ff, Field< T, D, M, Cell > &A)
unsigned right(unsigned d) const
virtual void write(std::ostream &) const
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)
T * value_type(const SliceIterator< T > &)
ac_id_larray::iterator iterator_if
virtual void write(std::ostream &out) const
constexpr double e
The value of .
virtual void apply(Field< T, D, M, C > &)
Interface for a single beam element.
NDIndex< Dim > AddGuardCells(const NDIndex< Dim > &idx, const GuardCellSizes< Dim > &g)
void ExtrapolateFaceBCApply(ExtrapolateFace< T, D, M, Cell > &ef, Field< T, D, M, Cell > &A)
OpExtrapolate(const T &o, const T &s)
const T & getOffset() const
ParticleSpatialLayout< double, 3, Mesh_t > Layout_t
const NDIndex< Dim > & getDomain() const
MMatrix< m_complex > complex(MMatrix< double > real)
unsigned leftGuard(unsigned d) const
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)
void ExtrapolateAndZeroFaceBCApply3(const NDIndex< D > &dest, LField< T, D > &fill, ExtrapolateAndZeroFace< T, D, M, C > &ef)
ApplyToComponentType< T >::type(* Func)(typename ApplyToComponentType< T >::type)
const iterator & begin() const
void LinearExtrapolateFaceBCApply2(const NDIndex< D > &dest, const NDIndex< D > &src1, const NDIndex< D > &src2, LField< T, D > &fill, LinearExtrapolateFace< T, D, M, C > &, int slopeMultipplier)
virtual void write(std::ostream &) const
NDIndex< D > calcEurekaDomain(const NDIndex< D > &realDomain, int face, const GuardCellSizes< D > &gc)
void apply(Field< T, D, M, C > &)
virtual void write(std::ostream &out) const
void ComponentFunctionFaceBCApply(ComponentFunctionFace< T, D, M, Cell > &ff, Field< T, D, M, Cell > &A)