<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254</link>
    <title>MATLAB Central Newsreader - FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
    <description>Feed for thread: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 31 May 2008 14:57:01 -0400</pubDate>
      <title>FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435207</link>
      <author>A B</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I'm coding my own FEM code in Matlab and want to implement&lt;br&gt;
the so-called substructuring technique, which basically is a&lt;br&gt;
static condensation.&lt;br&gt;
&lt;br&gt;
However Matlab runs out of memory quiet fast. As soon as I&lt;br&gt;
want to reduce my stiffness matrix by about 5000dof the&lt;br&gt;
calculations fails.&lt;br&gt;
&lt;br&gt;
Here's the formula for substructuring, so you can get an&lt;br&gt;
idea of it, if you don't know it.&lt;br&gt;
&lt;br&gt;
K*u = F&lt;br&gt;
&lt;br&gt;
u= [ua; ub];&lt;br&gt;
F = [Fa; Fb];&lt;br&gt;
K = [Kaa Kab; Kba Kbb]&lt;br&gt;
Kab=Kba';&lt;br&gt;
&lt;br&gt;
ua are the degrees of freedom i want to keep, whereas ub are&lt;br&gt;
the ones which should be removed. Therefore I obtain a new&lt;br&gt;
matrix for the left side and a new vector on the right side;&lt;br&gt;
&lt;br&gt;
K_new = [Kaa - Kab*Kbb^-1*Kba]&lt;br&gt;
F_new = [Kaa - Kab*Kbb^-1*Fb]&lt;br&gt;
&lt;br&gt;
Now of course I'm not computing the full inverse of Kbb, but &lt;br&gt;
&lt;br&gt;
Kaa-Kab/Kbb*Kba&lt;br&gt;
&lt;br&gt;
I'm not quiet sure why Matlab runs out of memory when Kbb&lt;br&gt;
reaches about n=5000 (as I mentioned above). Either it's the&lt;br&gt;
computation of Kab/Kbb or maybe as Kab/Kbb most probably&lt;br&gt;
becomes a full matrix it just needs to much memory.&lt;br&gt;
&lt;br&gt;
The only thing I know for sure is that ANSYS can calculate&lt;br&gt;
that kind of substructuring without any problems. It even&lt;br&gt;
manages to remove well over 100 000 degrees of freedom&lt;br&gt;
without any major computing needs (takes only about 5 min).&lt;br&gt;
&lt;br&gt;
So there must be a major difference in the way Matlab  (or&lt;br&gt;
myself) is calculating K_new compared to ANSYS.&lt;br&gt;
&lt;br&gt;
Is it the way matrix are being stored. As far as I know&lt;br&gt;
ANSYS uses Harwell-Boeing (not quiet sure). This maybe is&lt;br&gt;
more memory efficient then the way Matlab is storing sparse&lt;br&gt;
matrixes, but that still wouldn't explain why the&lt;br&gt;
calculation fails.&lt;br&gt;
&lt;br&gt;
Any ideas or reason on how I would have to change my code?&lt;br&gt;
&lt;br&gt;
Thanks a lot!!!</description>
    </item>
    <item>
      <pubDate>Sat, 31 May 2008 20:56:02 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435229</link>
      <author>Tim Davis</author>
      <description>&quot;A B&quot; &amp;lt;gitsnedbutzi@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&lt;br&gt;
...&lt;br&gt;
&amp;gt; K*u = F&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; u= [ua; ub];&lt;br&gt;
&amp;gt; F = [Fa; Fb];&lt;br&gt;
&amp;gt; K = [Kaa Kab; Kba Kbb]&lt;br&gt;
&amp;gt; Kab=Kba';&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ua are the degrees of freedom i want to keep, whereas ub are&lt;br&gt;
&amp;gt; the ones which should be removed. Therefore I obtain a new&lt;br&gt;
&amp;gt; matrix for the left side and a new vector on the right side;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; K_new = [Kaa - Kab*Kbb^-1*Kba]&lt;br&gt;
&amp;gt; F_new = [Kaa - Kab*Kbb^-1*Fb]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now of course I'm not computing the full inverse of Kbb, but &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kaa-Kab/Kbb*Kba&lt;br&gt;
&lt;br&gt;
what are the dimensions of these matrices?  Kbb is dimension&lt;br&gt;
5000?&lt;br&gt;
&lt;br&gt;
What's happening here is that you're computing your own&lt;br&gt;
Schur complement.  It might be too much to represent this&lt;br&gt;
explicitly.  Perhaps ANSYS does this implicitly, and&lt;br&gt;
updates/downdates the factorization of K accordingly.&lt;br&gt;
&lt;br&gt;
MATLAB uses the same compressed-sparse column form that the&lt;br&gt;
Harwell-Boeing format uses (mostly, except for different&lt;br&gt;
methods used inside LU, Chol, backslash, etc, that aren't&lt;br&gt;
visible to the user - M or mex or otherwise).</description>
    </item>
    <item>
      <pubDate>Sun, 01 Jun 2008 11:50:02 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435278</link>
      <author>A B</author>
      <description>&amp;gt; what are the dimensions of these matrices?  Kbb is dimension&lt;br&gt;
&amp;gt; 5000?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What's happening here is that you're computing your own&lt;br&gt;
&amp;gt; Schur complement.  It might be too much to represent this&lt;br&gt;
&amp;gt; explicitly.  Perhaps ANSYS does this implicitly, and&lt;br&gt;
&amp;gt; updates/downdates the factorization of K accordingly.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; MATLAB uses the same compressed-sparse column form that the&lt;br&gt;
&amp;gt; Harwell-Boeing format uses (mostly, except for different&lt;br&gt;
&amp;gt; methods used inside LU, Chol, backslash, etc, that aren't&lt;br&gt;
&amp;gt; visible to the user - M or mex or otherwise).&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Hi Tim,&lt;br&gt;
&lt;br&gt;
Kbb could be larger than 5000, but 5000 is approximately the&lt;br&gt;
dimension where I get problems with MATLAB running out of&lt;br&gt;
memory.&lt;br&gt;
&lt;br&gt;
How would I calculate the Schur Complement implicitly? Is&lt;br&gt;
there a special algorithm I could look up, or is an implicit&lt;br&gt;
calculation of the Schur complement included in Matlab?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
Btw.&lt;br&gt;
&lt;br&gt;
Nice book you wrote about sparse linear systems. I have to&lt;br&gt;
admit I got lost pretty soon, as I'm only a mechanical&lt;br&gt;
engineer and never learnt graphs, but it helped me a lot to&lt;br&gt;
speed up my code for creating large sparse matrices.</description>
    </item>
    <item>
      <pubDate>Sun, 01 Jun 2008 19:40:03 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435316</link>
      <author>Tim Davis</author>
      <description>&quot;A B&quot; &amp;lt;gitsnedbutzi@hotmail.com&amp;gt; wrote in message ...&lt;br&gt;
&amp;gt; Hi Tim,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kbb could be larger than 5000, but 5000 is approximately the&lt;br&gt;
&amp;gt; dimension where I get problems with MATLAB running out of&lt;br&gt;
&amp;gt; memory.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How would I calculate the Schur Complement implicitly? Is&lt;br&gt;
&amp;gt; there a special algorithm I could look up, or is an implicit&lt;br&gt;
&amp;gt; calculation of the Schur complement included in Matlab?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Btw.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Nice book you wrote about sparse linear systems. I have to&lt;br&gt;
&amp;gt; admit I got lost pretty soon, as I'm only a mechanical&lt;br&gt;
&amp;gt; engineer and never learnt graphs, but it helped me a lot to&lt;br&gt;
&amp;gt; speed up my code for creating large sparse matrices.&lt;br&gt;
&lt;br&gt;
Thanks - glad the book helped, even if just a bit.  Yes,&lt;br&gt;
it's got a lot of combinatorial stuff in it - more of that&lt;br&gt;
than linear algebra.  That's the nature of sparse matrix&lt;br&gt;
computations.  They're not so much linear algebra as graph&lt;br&gt;
theoretic algorithms with reals that go along for the ride.&lt;br&gt;
&lt;br&gt;
I'm not sure off-hand how you'd deal with the Schur&lt;br&gt;
complement implicitly.  The Sherman-Morrison update might be&lt;br&gt;
used - I'm not sure.&lt;br&gt;
&lt;br&gt;
How bad is it to let backslash handle the whole K?  The&lt;br&gt;
&quot;static condensation&quot; is exploited internally, in either a&lt;br&gt;
multifrontal (LU) or supernodal (chol) way.&lt;br&gt;
&lt;br&gt;
Consider this graph game.  Take a symmetric matrix.  Let&lt;br&gt;
there be one node per row/col, and let there be an edge&lt;br&gt;
(i,j) if A(i,j) is nonzero.&lt;br&gt;
&lt;br&gt;
Now, pick a node, any node.  Add edges between all of its&lt;br&gt;
neighbors (they now form a clique), then eliminate the node&lt;br&gt;
you picked (and its incident edges).  Continue until the&lt;br&gt;
graph is gone.&lt;br&gt;
&lt;br&gt;
Every edge that ever appeared ... gives you the nonzero&lt;br&gt;
pattern of L for the Cholesky factorization of L*L'=P*A*P'.&lt;br&gt;
&amp;nbsp;The P gives you the order in which you eliminated the nodes.&lt;br&gt;
&lt;br&gt;
Now, for a FEM matrix, your graph starts out as a collection&lt;br&gt;
of cliques.  Static condensation consists of eliminating&lt;br&gt;
nodes whose neighbors already form a clique, so no new edges&lt;br&gt;
are added.&lt;br&gt;
&lt;br&gt;
Those cliques give LU, or Chol, a way of exploiting dense&lt;br&gt;
matrix kernels (LU and CHOL both use the level-3 BLAS).  If&lt;br&gt;
you pre-eliminate via static condensation, your cliques are&lt;br&gt;
smaller ... but there's less chance for using the BLAS.&lt;br&gt;
&lt;br&gt;
So LU and CHOL naturally do &quot;static condensation&quot;, if given&lt;br&gt;
the right ordering.&lt;br&gt;
&lt;br&gt;
See what happens if you do a CHOL with the nodes to&lt;br&gt;
statically condense ordered first.  You can do this with&lt;br&gt;
AMD, or if you download CAMD from the File Exchange (in&lt;br&gt;
SuiteSparse), you can do it more easily with that (give CAMD&lt;br&gt;
a set of constraints to tell it how to order the nodes, with&lt;br&gt;
the statically condensed nodes ordered first, and the rest&lt;br&gt;
2nd, so that you have 2 constraint sets).&lt;br&gt;
&lt;br&gt;
Then try CHOL with the resulting permutation as the&lt;br&gt;
fill-reducing ordering.&lt;br&gt;
&lt;br&gt;
The lower right corner of L will be the factor of your&lt;br&gt;
statically-condensed matrix.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 10:44:02 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435783</link>
      <author>A B</author>
      <description>&amp;gt; Thanks - glad the book helped, even if just a bit.  Yes,&lt;br&gt;
&amp;gt; it's got a lot of combinatorial stuff in it - more of &lt;br&gt;
that&lt;br&gt;
&amp;gt; than linear algebra.  That's the nature of sparse matrix&lt;br&gt;
&amp;gt; computations.  They're not so much linear algebra as &lt;br&gt;
graph&lt;br&gt;
&amp;gt; theoretic algorithms with reals that go along for the &lt;br&gt;
ride.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm not sure off-hand how you'd deal with the Schur&lt;br&gt;
&amp;gt; complement implicitly.  The Sherman-Morrison update &lt;br&gt;
might be&lt;br&gt;
&amp;gt; used - I'm not sure.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How bad is it to let backslash handle the whole K?  The&lt;br&gt;
&amp;gt; &quot;static condensation&quot; is exploited internally, in either &lt;br&gt;
a&lt;br&gt;
&amp;gt; multifrontal (LU) or supernodal (chol) way.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Consider this graph game.  Take a symmetric matrix.  Let&lt;br&gt;
&amp;gt; there be one node per row/col, and let there be an edge&lt;br&gt;
&amp;gt; (i,j) if A(i,j) is nonzero.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now, pick a node, any node.  Add edges between all of its&lt;br&gt;
&amp;gt; neighbors (they now form a clique), then eliminate the &lt;br&gt;
node&lt;br&gt;
&amp;gt; you picked (and its incident edges).  Continue until the&lt;br&gt;
&amp;gt; graph is gone.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Every edge that ever appeared ... gives you the nonzero&lt;br&gt;
&amp;gt; pattern of L for the Cholesky factorization of &lt;br&gt;
L*L'=P*A*P'.&lt;br&gt;
&amp;gt;  The P gives you the order in which you eliminated the &lt;br&gt;
nodes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now, for a FEM matrix, your graph starts out as a &lt;br&gt;
collection&lt;br&gt;
&amp;gt; of cliques.  Static condensation consists of eliminating&lt;br&gt;
&amp;gt; nodes whose neighbors already form a clique, so no new &lt;br&gt;
edges&lt;br&gt;
&amp;gt; are added.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Those cliques give LU, or Chol, a way of exploiting dense&lt;br&gt;
&amp;gt; matrix kernels (LU and CHOL both use the level-3 BLAS).  &lt;br&gt;
If&lt;br&gt;
&amp;gt; you pre-eliminate via static condensation, your cliques &lt;br&gt;
are&lt;br&gt;
&amp;gt; smaller ... but there's less chance for using the BLAS.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So LU and CHOL naturally do &quot;static condensation&quot;, if &lt;br&gt;
given&lt;br&gt;
&amp;gt; the right ordering.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; See what happens if you do a CHOL with the nodes to&lt;br&gt;
&amp;gt; statically condense ordered first.  You can do this with&lt;br&gt;
&amp;gt; AMD, or if you download CAMD from the File Exchange (in&lt;br&gt;
&amp;gt; SuiteSparse), you can do it more easily with that (give &lt;br&gt;
CAMD&lt;br&gt;
&amp;gt; a set of constraints to tell it how to order the nodes, &lt;br&gt;
with&lt;br&gt;
&amp;gt; the statically condensed nodes ordered first, and the &lt;br&gt;
rest&lt;br&gt;
&amp;gt; 2nd, so that you have 2 constraint sets).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then try CHOL with the resulting permutation as the&lt;br&gt;
&amp;gt; fill-reducing ordering.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The lower right corner of L will be the factor of your&lt;br&gt;
&amp;gt; statically-condensed matrix.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks Tim for your hints, I'll try the ordering of the &lt;br&gt;
nodes and then use CHOL.&lt;br&gt;
&lt;br&gt;
Can you suggest any introductory book on graphs and/or the &lt;br&gt;
combinatorial stuff which would help me make your book &lt;br&gt;
more understandable? Maybe there is some book for the &lt;br&gt;
introduction to the analysis of sparse algorithms?</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 11:55:05 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#435786</link>
      <author>Tim Davis</author>
      <description>&quot;A B&quot; &amp;lt;gitsnedbutzi@hotmail.com&amp;gt; wrote in message ...&lt;br&gt;
&lt;br&gt;
&amp;gt; Thanks Tim for your hints, I'll try the ordering of the &lt;br&gt;
&amp;gt; nodes and then use CHOL.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can you suggest any introductory book on graphs and/or the &lt;br&gt;
&amp;gt; combinatorial stuff which would help me make your book &lt;br&gt;
&amp;gt; more understandable? Maybe there is some book for the &lt;br&gt;
&amp;gt; introduction to the analysis of sparse algorithms?&lt;br&gt;
&lt;br&gt;
Try using CAMD (in SuiteSparse on the File Exchange).  It's&lt;br&gt;
like AMD, except that you can give it a set of ordering&lt;br&gt;
constraints.  You can tell it to order all the &quot;statically&lt;br&gt;
condensed&quot; nodes first, then order all the rest (2&lt;br&gt;
constraint sets).  Then within the sets, the approximate&lt;br&gt;
minimum degree ordering will work its magic, to reduce&lt;br&gt;
fill-in.  Then use the resulting ordering to permute the&lt;br&gt;
matrix for CHOL, or LU.&lt;br&gt;
&lt;br&gt;
Off-hand, I'm not sure what book I could suggest, since it&lt;br&gt;
would depend on what other background you have.  I give a&lt;br&gt;
*really* short review of the graph theory in my book, and I&lt;br&gt;
cite some others there.  I think Cormen, Leieserson, and&lt;br&gt;
Rivest (Intro to Algorithms, I think the title is), MIT&lt;br&gt;
Press, is a good book.  That might be too advanced,&lt;br&gt;
depending on your background.</description>
    </item>
    <item>
      <pubDate>Thu, 24 Jul 2008 16:47:02 -0400</pubDate>
      <title>Re: FEM substructuring  (static condensation) -&gt; out ot memory; ANSYS can do it</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170254#445225</link>
      <author>Etienne </author>
      <description>&lt;br&gt;
The way it is done in SDT www.sdtools.com/sdt&lt;br&gt;
&lt;br&gt;
is to use a factored matrix object for K_bb^-1 (very &lt;br&gt;
critical if you want to have 100 000 DOFs). Then, you solve &lt;br&gt;
for Kbb^-1*Kba by piece by block. Then you project the &lt;br&gt;
matrices.&lt;br&gt;
&lt;br&gt;
You have to realize that 1e5*5000*8/1023^3= 3.7 GB &lt;br&gt;
If you want that to happen on a 32 bit machine you need to &lt;br&gt;
go out of core (like SDT and ANSYS do).</description>
    </item>
  </channel>
</rss>

