Mercurial > hg > kwantix
view html/classbvp_1_1additive__schwarz__ddm.html @ 4:9d4fda54a41d
Buggy, must check why interpolator assignment destroys precomputed
data.
author | Jordi Guitérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Sun, 29 Jun 2008 04:06:48 -0500 |
parents | 4fa56dc7e271 |
children |
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>bvp::additive_schwarz_ddm< RBF > Class Template Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacebvp.html">bvp</a>::<a class="el" href="classbvp_1_1additive__schwarz__ddm.html">additive_schwarz_ddm</a> </div> </div> <div class="contents"> <h1>bvp::additive_schwarz_ddm< RBF > Class Template Reference</h1><!-- doxytag: class="bvp::additive_schwarz_ddm" --><!-- doxytag: inherits="bvp::ddm" --><code>#include <<a class="el" href="ddm_8hpp-source.html">ddm.hpp</a>></code> <p> <div class="dynheader"> Inheritance diagram for bvp::additive_schwarz_ddm< RBF >:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm__inherit__graph.png" border="0" usemap="#bvp_1_1additive__schwarz__ddm_3_01RBF_01_4__inherit__map" alt="Inheritance graph"></center> <map name="bvp_1_1additive__schwarz__ddm_3_01RBF_01_4__inherit__map"> <area shape="rect" href="classbvp_1_1ddm.html" title="bvp::ddm" alt="" coords="91,6,171,33"></map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> <div class="dynheader"> Collaboration diagram for bvp::additive_schwarz_ddm< RBF >:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm__coll__graph.png" border="0" usemap="#bvp_1_1additive__schwarz__ddm_3_01RBF_01_4__coll__map" alt="Collaboration graph"></center> <map name="bvp_1_1additive__schwarz__ddm_3_01RBF_01_4__coll__map"> <area shape="rect" href="classbvp_1_1ddm.html" title="bvp::ddm" alt="" coords="91,6,171,33"></map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> <p> <a href="classbvp_1_1additive__schwarz__ddm-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#15cfcfa03d929291d7eeadd9e3cd054e">additive_schwarz_ddm</a> (const set< shared_ptr< const <a class="el" href="classbvp_1_1domain.html">domain</a> > > &, shared_ptr< const <a class="el" href="classbvp_1_1linear__BVP2.html">linear_BVP2</a> > <a class="el" href="classbvp_1_1ddm.html#1c0240b22224562065f30bf9d0301d50">bvp</a>)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f">at</a> (const point &p) const </td></tr> <tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">set< shared_ptr< const <br> <a class="el" href="classbvp_1_1interpolator.html">interpolator</a>< RBF > > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc">which_interps</a> (const point &p) const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#a6f5045b43f412e3c8feffe69338345e">solve</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d">avg_interp</a> (set< shared_ptr< const <a class="el" href="classbvp_1_1interpolator.html">interpolator</a>< RBF > > > relevant_interpolators, const point &p) const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classlinalg_1_1vector.html">vector</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#9985e49e81c8d54e9d7251fd8acee83f">at_all_points</a> () const </td></tr> <tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">map< shared_ptr< const <br> <a class="el" href="classbvp_1_1overlapping__domain.html">overlapping_domain</a> ><br> , shared_ptr< <a class="el" href="classbvp_1_1interpolator.html">interpolator</a><br> < RBF > > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a></td></tr> </table> <h3>template<typename RBF><br> class bvp::additive_schwarz_ddm< RBF ></h3> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="15cfcfa03d929291d7eeadd9e3cd054e"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::additive_schwarz_ddm" ref="15cfcfa03d929291d7eeadd9e3cd054e" args="(const set< shared_ptr< const domain > > &, shared_ptr< const linear_BVP2 > bvp)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::<a class="el" href="classbvp_1_1additive__schwarz__ddm.html">additive_schwarz_ddm</a> </td> <td>(</td> <td class="paramtype">const set< shared_ptr< const <a class="el" href="classbvp_1_1domain.html">domain</a> > > & </td> <td class="paramname"> <em>ds</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">shared_ptr< const <a class="el" href="classbvp_1_1linear__BVP2.html">linear_BVP2</a> > </td> <td class="paramname"> <em>bvp</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <div class="fragment"><pre class="fragment"><a name="l00112"></a>00112 : <a name="l00113"></a>00113 <a class="code" href="classbvp_1_1ddm.html#86206316fb83fdefbdbebcaab64f1afe">ddm</a>(ds,thebvp){ <a name="l00114"></a>00114 <a name="l00115"></a>00115 shared_ptr<const linear_diff_op2> <a name="l00116"></a>00116 L = dynamic_pointer_cast< <a name="l00117"></a>00117 <span class="keyword">const</span> linear_diff_op2>(<span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#1c0240b22224562065f30bf9d0301d50">bvp</a> -> get_diff_op()); <a name="l00118"></a>00118 <a name="l00119"></a>00119 shared_ptr<const bdry_diff_op> <a name="l00120"></a>00120 B = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#1c0240b22224562065f30bf9d0301d50">bvp</a> -> get_bdry_diff_op(); <a name="l00121"></a>00121 <a name="l00122"></a>00122 map<point, double> global_f = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#1c0240b22224562065f30bf9d0301d50">bvp</a> -> get_f(); <a name="l00123"></a>00123 map<point, double> global_g = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#1c0240b22224562065f30bf9d0301d50">bvp</a> -> get_g(); <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="comment">//Define a bvp for each domain and assign it an interpolator. </span> <a name="l00126"></a>00126 <span class="keywordflow">for</span>(<span class="keyword">set</span><shared_ptr<const domain> >::iterator <a name="l00127"></a>00127 i = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin(); i != <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.end(); i++){ <a name="l00128"></a>00128 shared_ptr<const overlapping_domain> this_domain = <a name="l00129"></a>00129 dynamic_pointer_cast<<span class="keyword">const</span> overlapping_domain>(*i); <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="comment">//Define the interiors and f's</span> <a name="l00132"></a>00132 set<point> this_intr = this_domain -> get_interior(); <a name="l00133"></a>00133 map<point, double> this_f; <a name="l00134"></a>00134 <span class="keywordflow">for</span>(set<point>::iterator spi = this_intr.begin(); <a name="l00135"></a>00135 spi != this_intr.end(); spi++) <a name="l00136"></a>00136 this_f[*spi] = global_f[*spi]; <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="comment">//Define the boundaries and g's</span> <a name="l00139"></a>00139 set<point> this_bdry = this_domain -> get_boundary(); <a name="l00140"></a>00140 map<point, double> this_g; <a name="l00141"></a>00141 set<point> interior_boundary_pts; <a name="l00142"></a>00142 <span class="keywordflow">for</span>(set<point>::iterator spi = this_bdry.begin(); <a name="l00143"></a>00143 spi != this_bdry.end(); spi++){ <a name="l00144"></a>00144 <span class="keywordflow">if</span>(this_domain -> which_domain(*spi).get() == 0){ <a name="l00145"></a>00145 this_g[*spi] = global_g[*spi]; <a name="l00146"></a>00146 } <a name="l00147"></a>00147 <span class="keywordflow">else</span>{ <a name="l00148"></a>00148 interior_boundary_pts.insert(*spi); <a name="l00149"></a>00149 this_g[*spi] = 0; <span class="comment">//Init to zero artificial boundary conditions. </span> <a name="l00150"></a>00150 } <a name="l00151"></a>00151 } <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="comment">//Define the boundary operator, using Dirichlet for artificial</span> <a name="l00154"></a>00154 <span class="comment">//boundaries</span> <a name="l00155"></a>00155 shared_ptr<dirichlet_op> D(<span class="keyword">new</span> dirichlet_op); <a name="l00156"></a>00156 shared_ptr<ddm_bdry_diff_op> <a name="l00157"></a>00157 this_B( <span class="keyword">new</span> <a name="l00158"></a>00158 ddm_bdry_diff_op(B, D, interior_boundary_pts)); <a name="l00159"></a>00159 <a name="l00160"></a>00160 <span class="comment">//Put all this info into an interpolator.</span> <a name="l00161"></a>00161 shared_ptr<linear_BVP2> <a name="l00162"></a>00162 this_bvp(<span class="keyword">new</span> linear_BVP2(this_domain, L, this_B, this_f, this_g) ); <a name="l00163"></a>00163 shared_ptr<interpolator<RBF> > <a name="l00164"></a>00164 rbf_ptr( <span class="keyword">new</span> interpolator<RBF>(this_bvp)); <a name="l00165"></a>00165 <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a>[this_domain] = rbf_ptr; <a name="l00166"></a>00166 } <a name="l00167"></a>00167 <a name="l00168"></a>00168 <span class="comment">//Apply actual additive Schwarz DDM algorithm here</span> <a name="l00169"></a>00169 <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#a6f5045b43f412e3c8feffe69338345e">solve</a>(); <a name="l00170"></a>00170 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_15cfcfa03d929291d7eeadd9e3cd054e_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_15cfcfa03d929291d7eeadd9e3cd054e_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_15cfcfa03d929291d7eeadd9e3cd054e_cgraph_map"> <area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#a6f5045b43f412e3c8feffe69338345e" title="bvp::additive_schwarz_ddm::solve" alt="" coords="403,81,640,108"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f" title="bvp::additive_schwarz_ddm::at" alt="" coords="1023,56,1239,82"><area shape="rect" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector." alt="" coords="1385,106,1481,133"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#9985e49e81c8d54e9d7251fd8acee83f" title="bvp::additive_schwarz_ddm::at_all_points" alt="" coords="689,56,972,82"><area shape="rect" href="classlinalg_1_1vector.html#e66e3da6545ff54e9f5208631883d4a9" title="Number of elements." alt="" coords="763,157,899,184"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d" title="bvp::additive_schwarz_ddm::avg_interp" alt="" coords="1297,56,1569,82"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc" title="bvp::additive_schwarz_ddm::which_interps" alt="" coords="1288,5,1579,32"><area shape="rect" href="classlinalg_1_1vector.html#dda47f25045281eb0e8e4c4fb8c555ee" title="Euclidean norm." alt="" coords="1627,106,1771,133"><area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="1644,5,1753,32"></map> </div> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="338a5269cd3e001df6c6a0b05140be1f"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::at" ref="338a5269cd3e001df6c6a0b05140be1f" args="(const point &p) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname">double <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::at </td> <td>(</td> <td class="paramtype">const point & </td> <td class="paramname"> <em>p</em> </td> <td> ) </td> <td> const<code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <p>Implements <a class="el" href="classbvp_1_1ddm.html#d7c6ac93874c610b9bc22a5538a40390">bvp::ddm</a>.</p> <div class="fragment"><pre class="fragment"><a name="l00173"></a>00173 { <a name="l00174"></a>00174 <span class="comment">//If p is one of the domain points, then it's used. If more than</span> <a name="l00175"></a>00175 <span class="comment">//one domain contains p, then the average is taken. If no domain</span> <a name="l00176"></a>00176 <span class="comment">//contains p, we exhaustively search for the closest point in the</span> <a name="l00177"></a>00177 <span class="comment">//domains and use the interpolator from that domain to evaluate.</span> <a name="l00178"></a>00178 <a name="l00179"></a>00179 set<shared_ptr<const interpolator<RBF> > > <a name="l00180"></a>00180 relevant_interpolators = <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc">which_interps</a>(p); <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keywordflow">if</span>(relevant_interpolators.size() != 0)<span class="comment">//p is in one of the</span> <a name="l00183"></a>00183 <span class="comment">//domains.</span> <a name="l00184"></a>00184 <span class="keywordflow">return</span> <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d">avg_interp</a>(relevant_interpolators, p); <a name="l00185"></a>00185 <a name="l00186"></a>00186 <a name="l00187"></a>00187 <span class="comment">//Else, p is not one of the grid points. Find closest grid point</span> <a name="l00188"></a>00188 <span class="comment">//and evaluate on the domain(s) that the point belongs to.</span> <a name="l00189"></a>00189 <a name="l00190"></a>00190 <a name="l00191"></a>00191 <span class="comment">//Uh, just begin with closest being some point in the whatever</span> <a name="l00192"></a>00192 <span class="comment">//domain. </span> <a name="l00193"></a>00193 <a class="code" href="namespacelinalg.html#93d09321b3ca781d34e48a484ac7da60" title="Useful alias, vectors are also points in space.">point</a> c = *(((*( this-><a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin() )) <a name="l00194"></a>00194 -> get_interior()).begin() ); <a name="l00195"></a>00195 <a name="l00196"></a>00196 <span class="comment">//Search each domain's interior and boundary. Can't do better than</span> <a name="l00197"></a>00197 <span class="comment">//exhaustive search. </span> <a name="l00198"></a>00198 <span class="keywordflow">for</span>(<span class="keyword">set</span><shared_ptr<const domain> >::iterator i = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin(); <a name="l00199"></a>00199 i != <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.end(); i++){ <a name="l00200"></a>00200 <span class="keywordflow">for</span>(set<point>::iterator j = (*i) -> get_interior().begin(); <a name="l00201"></a>00201 j != (*i) -> get_interior().end(); j++) <a name="l00202"></a>00202 <span class="keywordflow">if</span>( <a class="code" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector.">norm</a>(*j - p) < <a class="code" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector.">norm</a>(c - p)) <a name="l00203"></a>00203 c = *j; <a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="keywordflow">for</span>(set<point>::iterator j = (*i) -> get_boundary().begin(); <a name="l00206"></a>00206 j != (*i) -> get_boundary().end(); j++) <a name="l00207"></a>00207 <span class="keywordflow">if</span>( <a class="code" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector.">norm</a>(*j - p) < <a class="code" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector.">norm</a>(c - p)) <a name="l00208"></a>00208 c = *j; <a name="l00209"></a>00209 } <a name="l00210"></a>00210 <a name="l00211"></a>00211 <span class="keywordflow">return</span> <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d">avg_interp</a>( <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc">which_interps</a>(c), p); <a name="l00212"></a>00212 <a name="l00213"></a>00213 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_338a5269cd3e001df6c6a0b05140be1f_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_338a5269cd3e001df6c6a0b05140be1f_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_338a5269cd3e001df6c6a0b05140be1f_cgraph_map"> <area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d" title="bvp::additive_schwarz_ddm::avg_interp" alt="" coords="281,6,553,32"><area shape="rect" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector." alt="" coords="369,56,465,83"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc" title="bvp::additive_schwarz_ddm::which_interps" alt="" coords="272,107,563,134"><area shape="rect" href="classlinalg_1_1vector.html#dda47f25045281eb0e8e4c4fb8c555ee" title="Euclidean norm." alt="" coords="611,56,755,83"><area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="628,107,737,134"></map> </div> </div> </div><p> <a class="anchor" name="f850ac752db1e66814c1df35ded231bc"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::which_interps" ref="f850ac752db1e66814c1df35ded231bc" args="(const point &p) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname">set< shared_ptr< const <a class="el" href="classbvp_1_1interpolator.html">interpolator</a>< RBF > > > <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::which_interps </td> <td>(</td> <td class="paramtype">const point & </td> <td class="paramname"> <em>p</em> </td> <td> ) </td> <td> const<code> [inline, private]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <div class="fragment"><pre class="fragment"><a name="l00217"></a>00217 { <a name="l00218"></a>00218 set<shared_ptr<const interpolator<RBF> > > relevant_interpolators; <a name="l00219"></a>00219 <span class="keywordflow">for</span>(<span class="keyword">set</span><shared_ptr<const domain> >::iterator i = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin(); <a name="l00220"></a>00220 i != <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.end(); i++){ <a name="l00221"></a>00221 <span class="keywordflow">if</span>( (*i) -> <a class="code" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6">contains</a>(p)){ <a name="l00222"></a>00222 shared_ptr<const overlapping_domain> j = <a name="l00223"></a>00223 dynamic_pointer_cast<<span class="keyword">const</span> overlapping_domain>(*i); <a name="l00224"></a>00224 relevant_interpolators.insert(<a class="code" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a>.at(j)); <a name="l00225"></a>00225 <span class="comment">//at is not in current STL standard; but it is necessary here</span> <a name="l00226"></a>00226 <span class="comment">//because operator[] can't be used here since this is a const</span> <a name="l00227"></a>00227 <span class="comment">//function. at is currently a GNU extension, and we're using</span> <a name="l00228"></a>00228 <span class="comment">//it.</span> <a name="l00229"></a>00229 } <a name="l00230"></a>00230 } <a name="l00231"></a>00231 <span class="keywordflow">return</span> relevant_interpolators; <a name="l00232"></a>00232 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_f850ac752db1e66814c1df35ded231bc_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_f850ac752db1e66814c1df35ded231bc_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_f850ac752db1e66814c1df35ded231bc_cgraph_map"> <area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="344,5,453,32"></map> </div> </div> </div><p> <a class="anchor" name="a6f5045b43f412e3c8feffe69338345e"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::solve" ref="a6f5045b43f412e3c8feffe69338345e" args="()" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::solve </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, private, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <p>Implements <a class="el" href="classbvp_1_1ddm.html#7fbcf71573a76e315829fa0c2d2f56e6">bvp::ddm</a>.</p> <div class="fragment"><pre class="fragment"><a name="l00250"></a>00250 { <a name="l00251"></a>00251 <span class="comment">//Recap: each domain already has an interpolator associated to it</span> <a name="l00252"></a>00252 <span class="comment">//and all overlapping domain information has been defined. Just</span> <a name="l00253"></a>00253 <span class="comment">//need to iterate on the boundary conditions. Method converges</span> <a name="l00254"></a>00254 <span class="comment">//when 2-norm (Frobenius, if it were a matrix) of the artificial</span> <a name="l00255"></a>00255 <span class="comment">//boundary does not change by more than tolerance.</span> <a name="l00256"></a>00256 <span class="keyword">using</span> std::make_pair; <a name="l00257"></a>00257 <a name="l00258"></a>00258 vector newv = <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#9985e49e81c8d54e9d7251fd8acee83f">at_all_points</a>(); <a name="l00259"></a>00259 vector oldv(newv.size()); <a name="l00260"></a>00260 <span class="keywordtype">double</span> change; <a name="l00261"></a>00261 <span class="keywordflow">do</span>{ <a name="l00262"></a>00262 oldv = newv; <a name="l00263"></a>00263 <a name="l00264"></a>00264 <span class="comment">//Each domain will have new g's.</span> <a name="l00265"></a>00265 map<shared_ptr<const overlapping_domain>, map<point, double> > <a name="l00266"></a>00266 new_bdry_assts; <a name="l00267"></a>00267 <span class="keywordflow">for</span>(<span class="keyword">set</span><shared_ptr<const domain> >::iterator <a name="l00268"></a>00268 i = <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin(); i != <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.end(); i++){ <a name="l00269"></a>00269 shared_ptr<const overlapping_domain> d = <a name="l00270"></a>00270 dynamic_pointer_cast<<span class="keyword">const</span> overlapping_domain>(*i); <a name="l00271"></a>00271 <span class="keywordflow">for</span>(set<point>::iterator j = (*i) -> get_boundary().begin(); <a name="l00272"></a>00272 j != (*i) -> get_boundary().end(); j++) <a name="l00273"></a>00273 <span class="keywordflow">if</span>( d -> which_domain(*j).get() != 0){ <a name="l00274"></a>00274 <a name="l00275"></a>00275 <a name="l00276"></a>00276 new_bdry_assts[d]. <a name="l00277"></a>00277 insert(make_pair(*j, <a name="l00278"></a>00278 <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a>[d -> which_domain(*j)] -> <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f">at</a>(*j)) <a name="l00279"></a>00279 ); <a name="l00280"></a>00280 } <a name="l00281"></a>00281 } <a name="l00282"></a>00282 <a name="l00283"></a>00283 <span class="comment">//Now assign to each interpolator the modified boundary.</span> <a name="l00284"></a>00284 <span class="keywordflow">for</span>(<span class="keyword">typename</span> map<shared_ptr<const overlapping_domain>, <a name="l00285"></a>00285 shared_ptr<interpolator<RBF> > >:: <a name="l00286"></a>00286 iterator i = <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a>.begin(); i != <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a>.end(); i++) <a name="l00287"></a>00287 i -> second -> set_g(new_bdry_assts[i -> first]); <a name="l00288"></a>00288 <a name="l00289"></a>00289 newv = <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#9985e49e81c8d54e9d7251fd8acee83f">at_all_points</a>(); <a name="l00290"></a>00290 change = <a class="code" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector.">norm</a>(oldv-newv); <a name="l00291"></a>00291 <a name="l00292"></a>00292 <span class="comment">//debug</span> <a name="l00293"></a>00293 cout << <span class="stringliteral">"Change: "</span> << change << endl; <a name="l00294"></a>00294 }<span class="keywordflow">while</span>( change > <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#ab02efc5912dbe803c17cd4cfb4ed5c9">tolerance</a>); <a name="l00295"></a>00295 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_a6f5045b43f412e3c8feffe69338345e_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_a6f5045b43f412e3c8feffe69338345e_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_a6f5045b43f412e3c8feffe69338345e_cgraph_map"> <area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f" title="bvp::additive_schwarz_ddm::at" alt="" coords="625,56,841,82"><area shape="rect" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector." alt="" coords="988,106,1084,133"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#9985e49e81c8d54e9d7251fd8acee83f" title="bvp::additive_schwarz_ddm::at_all_points" alt="" coords="292,56,575,82"><area shape="rect" href="classlinalg_1_1vector.html#e66e3da6545ff54e9f5208631883d4a9" title="Number of elements." alt="" coords="365,157,501,184"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d" title="bvp::additive_schwarz_ddm::avg_interp" alt="" coords="900,56,1172,82"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc" title="bvp::additive_schwarz_ddm::which_interps" alt="" coords="891,5,1181,32"><area shape="rect" href="classlinalg_1_1vector.html#dda47f25045281eb0e8e4c4fb8c555ee" title="Euclidean norm." alt="" coords="1229,106,1373,133"><area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="1247,5,1356,32"></map> </div> </div> </div><p> <a class="anchor" name="5cc7221b1519ee7de70f5c89d6c1b02d"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::avg_interp" ref="5cc7221b1519ee7de70f5c89d6c1b02d" args="(set< shared_ptr< const interpolator< RBF > > > relevant_interpolators, const point &p) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname">double <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::avg_interp </td> <td>(</td> <td class="paramtype">set< shared_ptr< const <a class="el" href="classbvp_1_1interpolator.html">interpolator</a>< RBF > > > </td> <td class="paramname"> <em>relevant_interpolators</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const point & </td> <td class="paramname"> <em>p</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> const<code> [inline, private]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <div class="fragment"><pre class="fragment"><a name="l00237"></a>00237 { <a name="l00238"></a>00238 <span class="keywordtype">double</span> result = 0; <a name="l00239"></a>00239 <span class="keywordtype">int</span> n = 0; <a name="l00240"></a>00240 <span class="keywordflow">for</span>(<span class="keyword">typename</span> <span class="keyword">set</span><shared_ptr<<span class="keyword">const</span> interpolator<RBF> > >:: <a name="l00241"></a>00241 iterator i = relevant_interpolators.begin() ; <a name="l00242"></a>00242 i != relevant_interpolators.end(); i++){ <a name="l00243"></a>00243 result += (*i) -> <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f">at</a>(p); <a name="l00244"></a>00244 n++; <a name="l00245"></a>00245 } <a name="l00246"></a>00246 <span class="keywordflow">return</span> result/n; <a name="l00247"></a>00247 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_5cc7221b1519ee7de70f5c89d6c1b02d_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_5cc7221b1519ee7de70f5c89d6c1b02d_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_5cc7221b1519ee7de70f5c89d6c1b02d_cgraph_map"> <area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f" title="bvp::additive_schwarz_ddm::at" alt="" coords="327,31,543,57"><area shape="rect" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector." alt="" coords="689,5,785,32"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc" title="bvp::additive_schwarz_ddm::which_interps" alt="" coords="592,56,883,83"><area shape="rect" href="classlinalg_1_1vector.html#dda47f25045281eb0e8e4c4fb8c555ee" title="Euclidean norm." alt="" coords="931,5,1075,32"><area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="948,56,1057,83"></map> </div> </div> </div><p> <a class="anchor" name="9985e49e81c8d54e9d7251fd8acee83f"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::at_all_points" ref="9985e49e81c8d54e9d7251fd8acee83f" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classlinalg_1_1vector.html">vector</a> <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::at_all_points </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [inline, private]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <div class="fragment"><pre class="fragment"><a name="l00299"></a>00299 { <a name="l00300"></a>00300 set<point> art_bdry; <a name="l00301"></a>00301 <span class="keywordflow">for</span>(<span class="keyword">set</span><shared_ptr<const domain> >::const_iterator i = <a name="l00302"></a>00302 <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.begin(); i != <span class="keyword">this</span> -> <a class="code" href="classbvp_1_1ddm.html#f2e30635e9973ff63f0db0f2a1fa731e">domains</a>.end(); i++) <a name="l00303"></a>00303 { <a name="l00304"></a>00304 shared_ptr<const overlapping_domain> j = <a name="l00305"></a>00305 dynamic_pointer_cast<<span class="keyword">const</span> overlapping_domain>(*i), <a name="l00306"></a>00306 zero; <span class="comment">//The zero pointer.</span> <a name="l00307"></a>00307 <a name="l00308"></a>00308 <span class="keywordflow">for</span>(set<point>::iterator p = j -> get_boundary().begin(); <a name="l00309"></a>00309 p != j -> get_boundary().end(); p++) <a name="l00310"></a>00310 { <a name="l00311"></a>00311 <span class="keywordflow">if</span>(j -> which_domain(*p) != zero) <a name="l00312"></a>00312 art_bdry.insert(*p); <a name="l00313"></a>00313 } <a name="l00314"></a>00314 } <a name="l00315"></a>00315 <a name="l00316"></a>00316 set<point>::iterator I = art_bdry.begin(); <a name="l00317"></a>00317 vector result(art_bdry.size() ); <a name="l00318"></a>00318 <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i = 1; i <= result.size(); i++){ <a name="l00319"></a>00319 result(i) = <a class="code" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f">at</a>(*I); <a name="l00320"></a>00320 I++; <a name="l00321"></a>00321 } <a name="l00322"></a>00322 <span class="keywordflow">return</span> result; <a name="l00323"></a>00323 } </pre></div> <p> <p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <p><center><img src="classbvp_1_1additive__schwarz__ddm_9985e49e81c8d54e9d7251fd8acee83f_cgraph.png" border="0" usemap="#classbvp_1_1additive__schwarz__ddm_9985e49e81c8d54e9d7251fd8acee83f_cgraph_map" alt=""></center> <map name="classbvp_1_1additive__schwarz__ddm_9985e49e81c8d54e9d7251fd8acee83f_cgraph_map"> <area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#338a5269cd3e001df6c6a0b05140be1f" title="bvp::additive_schwarz_ddm::at" alt="" coords="340,31,556,58"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#5cc7221b1519ee7de70f5c89d6c1b02d" title="bvp::additive_schwarz_ddm::avg_interp" alt="" coords="615,6,887,32"><area shape="rect" href="namespacelinalg.html#47d0ccf60c6c93a9dda16d9e9a0ef965" title="Euclidean norm of a vector." alt="" coords="703,56,799,83"><area shape="rect" href="classbvp_1_1additive__schwarz__ddm.html#f850ac752db1e66814c1df35ded231bc" title="bvp::additive_schwarz_ddm::which_interps" alt="" coords="605,107,896,134"><area shape="rect" href="classlinalg_1_1vector.html#dda47f25045281eb0e8e4c4fb8c555ee" title="Euclidean norm." alt="" coords="944,56,1088,83"><area shape="rect" href="namespaceutils.html#27b3f96810c3a5e7db323a912ada7bf6" title="utils::contains" alt="" coords="961,107,1071,134"></map> </div> </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="941eaf92c230aefb8154680a05e0e0ff"></a><!-- doxytag: member="bvp::additive_schwarz_ddm::phis" ref="941eaf92c230aefb8154680a05e0e0ff" args="" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename RBF> </div> <table class="memname"> <tr> <td class="memname">map<shared_ptr<const <a class="el" href="classbvp_1_1overlapping__domain.html">overlapping_domain</a>>, shared_ptr<<a class="el" href="classbvp_1_1interpolator.html">interpolator</a><RBF> > > <a class="el" href="classbvp_1_1additive__schwarz__ddm.html">bvp::additive_schwarz_ddm</a>< RBF >::<a class="el" href="classbvp_1_1additive__schwarz__ddm.html#941eaf92c230aefb8154680a05e0e0ff">phis</a><code> [private]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li>include/<a class="el" href="ddm_8hpp-source.html">ddm.hpp</a><li><a class="el" href="ddm_8cpp.html">ddm.cpp</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sat Jun 28 00:33:26 2008 by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>