<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkFEMElementStd.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_2c33022d19e8077162952ea9ed57656d.html">Numerics</a> » <a class="el" href="dir_316e5ab5c8a9cb56a9dce1c9fc454a23.html">FEM</a> </div> <div class="contents"> <h1>itkFEMElementStd.h</h1><a href="itkFEMElementStd_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkFEMElementStd.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2009-01-29 21:28:16 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.17 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even </span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="preprocessor">#ifndef __itkFEMElementStd_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __itkFEMElementStd_h</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkFEMElementBase_8h.html">itkFEMElementBase.h</a>"</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="keyword">namespace </span>itk { <a name="l00024"></a>00024 <span class="keyword">namespace </span>fem { <a name="l00025"></a>00025 <a name="l00052"></a>00052 <span class="keyword">template</span><<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> VNumberOfNodes, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> VNumberOfSpatialDimensions, <span class="keyword">class</span> TBaseClass=Element> <a name="l00053"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html">00053</a> <span class="keyword">class </span><a class="code" href="classitk_1_1fem_1_1ElementStd.html" title="Implements standard node management in the element classes.">ElementStd</a> : <span class="keyword">public</span> TBaseClass <a name="l00054"></a>00054 { <a name="l00055"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#992155e763a85b594e0980b7643bcc9f">00055</a> <a class="code" href="itkFEMMacro_8h.html#fa7d760fae69e20af6c94904fb3366fa" title="If defined, FEM classes will use smart pointers.">FEM_ABSTRACT_CLASS</a>(<a class="code" href="classitk_1_1fem_1_1ElementStd.html" title="Implements standard node management in the element classes.">ElementStd</a>,TBaseClass) <a name="l00056"></a>00056 public: <a name="l00057"></a>00057 <a name="l00058"></a>00058 <span class="comment">// FIXME: Add concept cheking for TBaseClass, and TPointClass</span> <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="comment">// Repeat typedefs and enums from parent class</span> <a name="l00061"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#48b84bd9306df346dc091abf8607cc92">00061</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1ElementStd.html#48b84bd9306df346dc091abf8607cc92">Float</a> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#48b84bd9306df346dc091abf8607cc92">Float</a>; <a name="l00062"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#c0c59eed49f0d89a7245da721c4c905d">00062</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classvnl__matrix.html">MatrixType</a> <a class="code" href="classvnl__matrix.html">MatrixType</a>; <a name="l00063"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#237fdb10334dab686c6f3da0d872ac31">00063</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classvnl__vector.html">VectorType</a> <a class="code" href="classvnl__vector.html">VectorType</a>; <a name="l00064"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#64a166883407dc15e79efad01a920606">00064</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">LoadType</a> <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">LoadType</a>; <a name="l00065"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#55c08226ad848a91619c869d00148278">00065</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">LoadPointer</a> <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">LoadPointer</a>; <a name="l00066"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#49d7bc6748274db295a99772ade240f8">00066</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">NodeIDType</a> <a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">NodeIDType</a>; <a name="l00067"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#31aff987d5b29a4301701e47964ed34a">00067</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1ElementStd.html#31aff987d5b29a4301701e47964ed34a">DegreeOfFreedomIDType</a> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#31aff987d5b29a4301701e47964ed34a">DegreeOfFreedomIDType</a>; <a name="l00068"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#5a6f9488af00098c9da81c1b687c51a0">00068</a> typedef typename <a class="code" href="classitk_1_1fem_1_1FEMLightObject.html" title="Base class for all classes that define the FEM system.">Superclass</a>::<a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">Node</a> <a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">Node</a>; <a name="l00069"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#cb228b10f17d1b495909289373c392c09d7c760d0cef2412db796db8bbce7003">00069</a> enum{ <a class="code" href="classitk_1_1fem_1_1ElementStd.html#cb228b10f17d1b495909289373c392c09d7c760d0cef2412db796db8bbce7003">InvalidDegreeOfFreedomID</a> = Superclass::InvalidDegreeOfFreedomID }; <a name="l00070"></a>00070 <a name="l00074"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">00074</a> <span class="keyword">enum</span> { <a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">NumberOfNodes</a>=VNumberOfNodes }; <a name="l00075"></a>00075 <a name="l00079"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#98ebee5c3e6f1a7d15d1ac9e2a4a29561cca6464f9ffb11f70fc658350080293">00079</a> <span class="keyword">enum</span> { <a class="code" href="classitk_1_1fem_1_1ElementStd.html#98ebee5c3e6f1a7d15d1ac9e2a4a29561cca6464f9ffb11f70fc658350080293">NumberOfSpatialDimensions</a>=VNumberOfSpatialDimensions }; <a name="l00080"></a>00080 <a name="l00084"></a>00084 <a class="code" href="classitk_1_1fem_1_1ElementStd.html#ea7a4b246367425c9284807d7f01bd7a">ElementStd</a>(); <a name="l00085"></a>00085 <a name="l00087"></a>00087 <a name="l00090"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#193e30a6a561e1073d8397b45dee0caf">00090</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#193e30a6a561e1073d8397b45dee0caf">GetNumberOfNodes</a>( <span class="keywordtype">void</span> )<span class="keyword"> const</span> <a name="l00091"></a>00091 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">NumberOfNodes</a>; } <a name="l00092"></a>00092 <a name="l00093"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#9386963ff4e086447b5ed787d62dd52f">00093</a> <span class="keyword">virtual</span> <a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">NodeIDType</a> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#9386963ff4e086447b5ed787d62dd52f">GetNode</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n)<span class="keyword"> const</span> <a name="l00094"></a>00094 <span class="keyword"> </span>{ <a name="l00095"></a>00095 <span class="keywordflow">if</span>(n>=<a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">NumberOfNodes</a>) <a name="l00096"></a>00096 { <a name="l00097"></a>00097 <span class="keywordflow">return</span> 0; <a name="l00098"></a>00098 } <a name="l00099"></a>00099 <span class="keywordflow">return</span> this-><a class="code" href="classitk_1_1fem_1_1ElementStd.html#9762135e70bafa15d6557462fba36841">m_node</a>[n]; <a name="l00100"></a>00100 } <a name="l00101"></a>00101 <a name="l00102"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#c11c9c03be25df2d9ccba5042bf407b1">00102</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#c11c9c03be25df2d9ccba5042bf407b1">SetNode</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n, <a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">NodeIDType</a> node) <a name="l00103"></a>00103 { <a name="l00104"></a>00104 <span class="keywordflow">if</span>(n>=<a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">NumberOfNodes</a>) <a name="l00105"></a>00105 { <a name="l00106"></a>00106 <span class="keywordflow">return</span>; <a name="l00107"></a>00107 } <a name="l00108"></a>00108 this-><a class="code" href="classitk_1_1fem_1_1ElementStd.html#9762135e70bafa15d6557462fba36841">m_node</a>[n]=node; <a name="l00109"></a>00109 } <a name="l00110"></a>00110 <a name="l00111"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#207161ee8c992ff91db04731caa5737e">00111</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classvnl__vector.html">VectorType</a>& <a class="code" href="classitk_1_1fem_1_1ElementStd.html#207161ee8c992ff91db04731caa5737e">GetNodeCoordinates</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n )<span class="keyword"> const</span> <a name="l00112"></a>00112 <span class="keyword"> </span>{ <a name="l00113"></a>00113 <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#9762135e70bafa15d6557462fba36841">m_node</a>[n]-><a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html#2dbb5a1596b3bb6ae500edba0d3ce810">GetCoordinates</a>(); <a name="l00114"></a>00114 } <a name="l00115"></a>00115 <a name="l00116"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#2f3775804ea72fc86ac0d90c452cf18b">00116</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#2f3775804ea72fc86ac0d90c452cf18b">GetNumberOfSpatialDimensions</a>()<span class="keyword"> const</span> <a name="l00117"></a>00117 <span class="keyword"> </span>{ <a name="l00118"></a>00118 <span class="keywordflow">return</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#98ebee5c3e6f1a7d15d1ac9e2a4a29561cca6464f9ffb11f70fc658350080293">NumberOfSpatialDimensions</a>; <a name="l00119"></a>00119 } <a name="l00120"></a>00120 <a name="l00122"></a>00122 <a name="l00129"></a>00129 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#2748b2ebbe7c70e34b2d00ac2af2aaeb">Read</a>( std::istream&, <span class="keywordtype">void</span>* info ); <a name="l00130"></a>00130 <a name="l00134"></a>00134 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#7e088e28febb4309eebd5580116073cc">Write</a>( std::ostream& f ) <span class="keyword">const</span>; <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="keyword">protected</span>: <a name="l00137"></a>00137 <a name="l00141"></a><a class="code" href="classitk_1_1fem_1_1ElementStd.html#9762135e70bafa15d6557462fba36841">00141</a> <a class="code" href="classitk_1_1fem_1_1Element_1_1Node.html" title="Class that stores information required to define a node.">NodeIDType</a> <a class="code" href="classitk_1_1fem_1_1ElementStd.html#9762135e70bafa15d6557462fba36841">m_node</a>[<a class="code" href="classitk_1_1fem_1_1ElementStd.html#210d73270ea4eda31ae16c1e314ceff69d0eb014e1beabeaedc0cbaa10698662">NumberOfNodes</a>]; <a name="l00142"></a>00142 <a name="l00143"></a>00143 }; <a name="l00144"></a>00144 <a name="l00145"></a>00145 <span class="preprocessor">#ifdef _MSC_VER</span> <a name="l00146"></a>00146 <span class="preprocessor"></span><span class="comment">// Declare a static dummy function to prevent a MSVC 6.0 SP5 from crashing.</span> <a name="l00147"></a>00147 <span class="comment">// I have no idea why things don't work when this is not declared, but it</span> <a name="l00148"></a>00148 <span class="comment">// looks like this declaration makes compiler forget about some of the</span> <a name="l00149"></a>00149 <span class="comment">// troubles it has with templates.</span> <a name="l00150"></a>00150 <span class="keyword">static</span> <span class="keywordtype">void</span> Dummy( <span class="keywordtype">void</span> ); <a name="l00151"></a>00151 <span class="preprocessor">#endif // #ifdef _MSC_VER</span> <a name="l00152"></a>00152 <span class="preprocessor"></span> <a name="l00153"></a>00153 }} <span class="comment">// end namespace itk::fem</span> <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span> <a name="l00156"></a>00156 <span class="preprocessor"></span><span class="preprocessor">#include "itkFEMElementStd.txx"</span> <a name="l00157"></a>00157 <span class="preprocessor">#endif</span> <a name="l00158"></a>00158 <span class="preprocessor"></span> <a name="l00159"></a>00159 <span class="preprocessor">#endif // #ifndef __itkFEMElementStd_h</span> <a name="l00160"></a>00160 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 22:41:31 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>