filesdata.h

00001 /*************************************************************************************
00002  * MechSys - A C++ library to simulate (Continuum) Mechanical Systems                *
00003  * Copyright (C) 2005 Dorival de Moraes Pedroso <dorival.pedroso at gmail.com>       *
00004  * Copyright (C) 2005 Raul Dario Durand Farfan  <raul.durand at gmail.com>           *
00005  *                                                                                   *
00006  * This file is part of MechSys.                                                     *
00007  *                                                                                   *
00008  * MechSys is free software; you can redistribute it and/or modify it under the      *
00009  * terms of the GNU General Public License as published by the Free Software         *
00010  * Foundation; either version 2 of the License, or (at your option) any later        *
00011  * version.                                                                          *
00012  *                                                                                   *
00013  * MechSys is distributed in the hope that it will be useful, but WITHOUT ANY        *
00014  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   *
00015  * PARTICULAR PURPOSE. See the GNU General Public License for more details.          *
00016  *                                                                                   *
00017  * You should have received a copy of the GNU General Public License along with      *
00018  * MechSys; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
00019  * Fifth Floor, Boston, MA 02110-1301, USA                                           *
00020  *************************************************************************************/
00021 
00022 #ifndef MECHSYS_FEM_FILESDATA_H
00023 #define MECHSYS_FEM_FILESDATA_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026   #include "config.h"
00027 #else
00028   #ifndef REAL
00029     #define REAL double
00030   #endif
00031 #endif
00032 
00033 #include <iomanip>
00034 #include <fstream>
00035 
00036 #include "util/array.h"
00037 #include "util/string.h"
00038 #include "util/numstreams.h"
00039 #include "fem/inputdata.h"
00040 #include "util/fileparser.h"
00041 #include "util/lineparser.h"
00042 #include "util/exception.h"
00043 
00044 using Util::_8s;
00045 using Util::_6;
00046 using Util::_a;
00047 
00048 namespace FEM
00049 {
00050 
00052 
00056 class FilesData
00057 {
00058 public:
00059     // Auxiliar structures
00060     struct Node;      // Information of a single node
00061     struct Face;      // Information of a single face
00062     struct Element;   // Information of a single element
00063     struct BryCond;   // Information of a single boundary condition
00064     struct Attribute; // Information of a single attribute
00065     struct Stage;     // Information of a single stage
00066     // Public methods
00067     void ReadNodes         (FEM::InputData const & ID); // fill Nodes with size = number of nodes
00068     void ReadFaces         (FEM::InputData const & ID); // fill Faces with size = number of faces
00069     void ReadElements      (FEM::InputData const & ID); // fill Elements with size = number of elements
00070     void ReadNodeBry       (FEM::InputData const & ID); // fill Stages.NodeBrys with size = number of node bry marks
00071     void ReadFaceBry       (FEM::InputData const & ID); // fill Stages.FaceBrys with size = number of face bry marks
00072     void ReadAttributes    (FEM::InputData const & ID); // fill Stages.Attribute with size = number of attributes
00073     void ReadInitialValues (FEM::InputData const & ID); // fill IniVals arrays inside element structure
00074     void ReadAllFiles      (FEM::InputData const & ID) // {{{
00075     {
00076         ReadNodes         (ID);
00077         ReadFaces         (ID);
00078         ReadElements      (ID); 
00079         ReadNodeBry       (ID); 
00080         ReadFaceBry       (ID); 
00081         ReadAttributes    (ID); 
00082         ReadInitialValues (ID); 
00083     } // }}}
00084     // Write
00085     void WriteNodes         (FEM::InputData const & ID, bool DoOverwrite=false); // Write Nodes
00086     void WriteFaces         (FEM::InputData const & ID, bool DoOverwrite=false); // Write Faces
00087     void WriteElements      (FEM::InputData const & ID, bool DoOverwrite=false); // Write Elements
00088     void WriteNodeBry       (FEM::InputData const & ID, bool DoOverwrite=false); // Write Stages.NodeBrys
00089     void WriteFaceBry       (FEM::InputData const & ID, bool DoOverwrite=false); // Write Stages.FaceBrys
00090     void WriteAttributes    (FEM::InputData const & ID, bool DoOverwrite=false); // Write Stages.Attribute
00091     void WriteInitialValues (FEM::InputData const & ID, bool DoOverwrite=false); // Write IniVals
00092     void WriteAllFiles      (FEM::InputData const & ID, bool DoOverwrite=false) // {{{
00093     {
00094         WriteNodes         (ID, DoOverwrite);
00095         WriteFaces         (ID, DoOverwrite);
00096         WriteElements      (ID, DoOverwrite); 
00097         WriteNodeBry       (ID, DoOverwrite); 
00098         WriteFaceBry       (ID, DoOverwrite); 
00099         WriteAttributes    (ID, DoOverwrite); 
00100         WriteInitialValues (ID, DoOverwrite); 
00101     } // }}}
00102     void WriteNodes         (String const & fnNODE, bool DoOverwrite=false); // Write Nodes
00103     void WriteFaces         (String const & fnFACE, bool DoOverwrite=false); // Write Faces
00104     void WriteElements      (String const & fnELE,  bool DoOverwrite=false); // Write Elements
00105     void WriteNodeBry       (String const & fnNBC,  bool DoOverwrite=false); // Write Stages.NodeBrys
00106     void WriteFaceBry       (String const & fnFBC,  bool DoOverwrite=false); // Write Stages.FaceBrys
00107     void WriteAttributes    (String const & fnATT,  bool DoOverwrite=false); // Write Stages.Attribute
00108     void WriteInitialValues (String const & fnINI,  bool DoOverwrite=false); // Write IniVals
00109     // Setup method
00110     void SetupDependentValues()
00111     {
00112         _fill_nodes_idx_info   (); // fill the idx to NodeBrys inside Stages struct for all nodes
00113         _fill_faces_idx_info   (); // fill the idx to FaceBrys inside Stages struct for all faces
00114         _fill_elements_idx_info(); // fill the idx to Attributes inside Stages struct for all elements
00115     }
00116 public:
00117     // Public data
00118     Array<FilesData::Node>    Nodes;            // Array with nodes, according to file    .node
00119     Array<FilesData::Face>    Faces;            // Array with faces, according to file    .face
00120     Array<FilesData::Element> Elements;         // Array with elements, according to file .ele
00121     Array<FilesData::Element> EmbElements;      // Array with  embedded elements, according to file .ele
00122     Array<FilesData::Stage>   Stages;           // Array with stages, according to files: .nbc, .fbc and .att
00123 private:
00124     // Functions
00125     void _fill_nodes_idx_info   (); // fill the idx to NodeBrys inside Stages struct for all nodes
00126     void _fill_faces_idx_info   (); // fill the idx to FaceBrys inside Stages struct for all faces
00127     void _fill_elements_idx_info(); // fill the idx to attribute inside Stages struct for all elements
00128 }; // class FilesData
00129 
00130 // -------------------------- Auxiliar structures (Node, Face, Element, BryCond, Attribute, Stage) {{{
00131 
00132 struct FilesData::Node
00133 {
00134     int  Num;     // Number tag
00135     REAL X;       // X coordinate
00136     REAL Y;       // Y coordinate
00137     REAL Z;       // Z coordinate
00138     int  BryMark; // Boundary mark according to .node file
00139     int  IdxBry;  // Index to the NodeBrys array inside a Stage structure. It is constant for all stages
00140                   // IdxBry==-1 => Boundary condition is NOT prescribed
00141 };
00142 
00143 struct FilesData::Face
00144 {
00145     int        Num;
00146     Array<int> Connects;
00147     int        BryMark;
00148     int        OwnerElement;
00149     int        IdxBry; // Index to the FaceBrys array inside a Stage structure. It is constant for all stages
00150                        // IdxBry==-1 => Boundary condition is NOT prescribed
00151 };
00152 
00153 struct FilesData::Element
00154 {
00155     int                 Num;
00156     Array<int>          Connects;
00157     int                 AttMark;
00158     int                 IdxAtt; // Index to the Attributes array inside a Stage structure. It is constant for all stages
00159     Array<Array<REAL> > IniVals;
00160 };
00161 
00162 struct FilesData::BryCond
00163 {
00164     int           BryMark;
00165     Array<String> Names;
00166     Array<REAL>   Values;
00167 };
00168 
00169 struct FilesData::Attribute
00170 {
00171     int         AttMark;
00172     String      EleName; 
00173     bool        IsActive;
00174     String      ModelName; 
00175     String      MatFilename;
00176     Array<REAL> Properties;
00177     Array<REAL> ModelPrms;
00178 };
00179 
00180 struct FilesData::Stage
00181 {
00182     Array<BryCond>   NodeBrys;   // size=number of node bry marks
00183     Array<BryCond>   FaceBrys;   // size=number of face bry marks
00184     Array<Attribute> Attributes; // size=number of element attributes
00185 };
00186 
00187 // }}}
00188 
00189 // ------------------------- operator << {{{
00190 std::ostream & operator<< (std::ostream & os,       FilesData::Node  const & node);
00191 std::ostream & operator<< (std::ostream & os, Array<FilesData::Node> const & nodes);
00192 
00193 std::ostream & operator<< (std::ostream & os, FilesData::Element  const & ele);
00194 std::ostream & operator<< (std::ostream & os, Array<FilesData::Element> const & eles);
00195 
00196 std::ostream & operator<< (std::ostream & os,       FilesData::Face  const & face);
00197 std::ostream & operator<< (std::ostream & os, Array<FilesData::Face> const & faces);
00198 
00199 std::ostream & operator<< (std::ostream & os,       FilesData::BryCond  const & BC);
00200 std::ostream & operator<< (std::ostream & os, Array<FilesData::BryCond> const & BCs);
00201 
00202 std::ostream & operator<< (std::ostream & os,       FilesData::Attribute  const & Att);
00203 std::ostream & operator<< (std::ostream & os, Array<FilesData::Attribute> const & Atts);
00204 
00205 std::ostream & operator<< (std::ostream & os, Array<FilesData::Stage> const & S);
00206 // }}}
00207  
00209 
00210 bool operator== (FilesData::BryCond const & a, int const & b) // {{{
00211 {
00212     return a.BryMark == b; 
00213 } // }}}
00214 
00215 bool operator== (FilesData::Attribute const & a, int const & b) // {{{
00216 {
00217     return a.AttMark == b; 
00218 } // }}}
00219 
00220 inline void FilesData::ReadNodes(FEM::InputData const & ID) // {{{
00221 {
00222     /* example.node {{{
00223     ################################################ .node
00224     12
00225     1   0   0   0   
00226     2   10  0   0
00227     3   10  10  0
00228     4   0   10  0
00229     5   0   0   5
00230     6   10  0   5
00231     7   10  10  5
00232     8   0   10  5
00233     9   0   0   10  -3
00234     10  10  0   10  -3
00235     11  10  10  10  -3
00236     12  0   10  10  -3
00237     }}} */
00238 
00239     // Open file
00240     FileParser FP(ID.fnNODE);
00241 
00242     // Number of nodes
00243     int n_nodes;
00244     FP.ReadNextValue(n_nodes);
00245 
00246     // Allocate and read nodes
00247     Nodes.resize(n_nodes);
00248     for (int i=0; i<n_nodes; ++i) 
00249     {
00250         // Read current line
00251         FP.JumpCommentsOrBlanks();
00252         String str_line = FP.GetCurrentLine(); FP.Advance();
00253 
00254         // Parse values
00255         LineParser LP(str_line);
00256         LP >> Nodes[i].Num >> Nodes[i].X >> Nodes[i].Y >> Nodes[i].Z;
00257         if (!(LP >> Nodes[i].BryMark)) Nodes[i].BryMark=0;
00258 
00259         // Multiply Coordinates by the CoordsMult scale factor 
00260         Nodes[i].X *= ID.CoordsMult;
00261         Nodes[i].Y *= ID.CoordsMult;
00262         Nodes[i].Z *= ID.CoordsMult;
00263     }
00264 #ifdef DO_DEBUG // {{{ 
00265     std::cout << "FilesData::ReadNodes: <" << n_nodes << "> nodes read" << std::endl;
00266 #endif // }}} 
00267 } // }}}
00268 
00269 inline void FilesData::ReadFaces(FEM::InputData const & ID) // {{{
00270 {
00271     /* example.face {{{
00272     ################################################ .face
00273     3
00274     1  4   1   2   3   4  -1  2
00275     2  4   5   6   7   8  -2  2
00276     3  4   9   1  11  12  -3  2
00277     }}} */
00278 
00279     // Open file
00280     FileParser FP(ID.fnFACE);
00281 
00282     // Number of faces
00283     int n_faces;
00284     FP.ReadNextValue(n_faces);
00285 
00286     // Allocate and read faces
00287     Faces.resize(n_faces);
00288     for (int i=0; i<n_faces; ++i) 
00289     {
00290         // Read current line
00291         FP.JumpCommentsOrBlanks();
00292         String str_line = FP.GetCurrentLine(); FP.Advance();
00293 
00294         // Parse values
00295         LineParser LP(str_line);
00296         int n_connect_nodes;
00297         LP >> Faces[i].Num >> n_connect_nodes;
00298         Faces[i].Connects.resize(n_connect_nodes);
00299         for (int j=0; j<n_connect_nodes; ++j)
00300         {
00301             if (!(LP>>Faces[i].Connects[j])) throw new Fatal(_("FilesData::ReadFaces: <.face> Face # (%d) must have (%d) nodes connected"),i,j);
00302         }
00303         if (!(LP>>Faces[i].BryMark))      throw new Fatal(_("FilesData::ReadFaces: <.face> Face # (%d) must have a column for BryMark")     ,i);
00304         if (!(LP>>Faces[i].OwnerElement)) throw new Fatal(_("FilesData::ReadFaces: <.face> Face # (%d) must have a column for OwnerElement"),i);
00305     }
00306 #ifdef DO_DEBUG // {{{ 
00307     std::cout << "FilesData::ReadFaces: <" << n_faces << "> faces read" << std::endl;
00308 #endif // }}} 
00309 } // }}}
00310 
00311 inline void FilesData::ReadElements(FEM::InputData const & ID) // {{{
00312 {
00313     /* example.ele {{{
00314     ################################################ .ele
00315     2
00316     1   8   1   2   3   4   5   6    7   8   -10
00317     2   8   5   6   7   8   9   10  11  12   -10
00318     }}} */
00319 
00320     // Open file
00321     FileParser FP(ID.fnELE);
00322 
00323     // Number of elements
00324     int n_elements;
00325     FP.ReadNextValue(n_elements);
00326 
00327     // Allocate and read elements
00328     Elements.resize(n_elements);
00329     for (int i=0; i<n_elements; ++i) 
00330     {
00331         // Read current line
00332         FP.JumpCommentsOrBlanks();
00333         String str_line = FP.GetCurrentLine(); FP.Advance();
00334 
00335         // Parse values
00336         LineParser LP(str_line);
00337         int n_connect_nodes;
00338         LP >> Elements[i].Num >> n_connect_nodes;
00339         Elements[i].Connects.resize(n_connect_nodes);
00340         for (int j=0; j<n_connect_nodes; ++j)
00341         {
00342             LP >> Elements[i].Connects[j];
00343         }
00344         LP >> Elements[i].AttMark;
00345     }
00346     
00347 #ifdef DO_DEBUG // {{{ 
00348     std::cout << "FilesData::ReadElements: <" << n_elements << "> elements read" << std::endl;
00349 #endif // }}} 
00350     
00351     // reading for embedded elements {{{
00352     int n_emb_elements;
00353     bool has_embeddeds = false;
00354     try {
00355         FP.ReadNextValue(n_emb_elements);
00356         has_embeddeds = true;
00357     } 
00358     catch (Exception * e)
00359     {
00360         delete e;
00361     }
00362     
00363     if (has_embeddeds)
00364     {
00365         // Allocate and read elements
00366         EmbElements.resize(n_emb_elements);
00367         for (int i=0; i<n_emb_elements; ++i) 
00368         {
00369             // Read current line
00370             FP.JumpCommentsOrBlanks();
00371             String str_line = FP.GetCurrentLine(); FP.Advance();
00372 
00373             // Parse values
00374             LineParser LP(str_line);
00375             int n_connect_nodes;
00376             LP >> EmbElements[i].Num >> n_connect_nodes;
00377             EmbElements[i].Connects.resize(n_connect_nodes);
00378             for (int j=0; j<n_connect_nodes; ++j)
00379             {
00380                 LP >> EmbElements[i].Connects[j];
00381             }
00382             LP >> EmbElements[i].AttMark;
00383         }
00384     } // }}}
00385     
00386 } // }}}
00387 
00388 inline void FilesData::ReadNodeBry(FEM::InputData const & ID) // {{{
00389 {
00390     /* example.nbc {{{
00391     ################################################ .nbc
00392     2 # number of stages 
00393     3 # number of boundary marks
00394     
00395     1 # stage one
00396     -1  Dux=0  Duy=0  Duz=0 
00397     -2  Dux=0  Duy=0  
00398     -3  Dux=0  Duy=0  Dfz=-5
00399     
00400     2 # stage two 
00401     -1  Dux=0  Duy=0  Duz=0 
00402     -2  Dux=0  Duy=0  
00403     -3  Dux=0  Duy=0  Dfz=-10
00404     }}} */
00405 
00406     // Open file
00407     FileParser FP(ID.fnNBC);
00408 
00409     // Number of stages
00410     int n_stages;
00411     FP.ReadNextValue(n_stages);
00412 
00413     // Number of boundary marks
00414     int n_bry_marks;
00415     FP.ReadNextValue(n_bry_marks);
00416 
00417     // Allocate stages
00418     if (Stages.size()!=0)
00419     {
00420         if (Stages.size()!=static_cast<size_t>(n_stages))
00421             throw new Fatal(_("FilesData::ReadNodeBry: number of stages must be equal to (%d)"), Stages.size());
00422     }
00423     else
00424         Stages.resize(n_stages);
00425 
00426     // Check number of stages
00427     if (n_stages<ID.nSTAGES)
00428         throw new Fatal(_("FilesData::ReadNodeBry: number of stages must be greater than or equal to (NSTAGES=%d)"), ID.nSTAGES);
00429 
00430     // Exit if there is no boundary mark
00431     if (n_bry_marks==0) return;
00432 
00433     // Read stages
00434     for (int i=0; i<n_stages; ++i) 
00435     {
00436         // Number of current stage
00437         int i_stage_p1; // number of current stage plus one
00438         FP.ReadNextValue(i_stage_p1);
00439 
00440         // Allocate and read boundaries
00441         Array<BryCond> & BCs = Stages[i].NodeBrys;
00442         BCs.resize(n_bry_marks);
00443         
00444         // Loop along boundary information (marks)
00445         for (int j=0; j<n_bry_marks; ++j)
00446         {
00447             // Read current line
00448             FP.JumpCommentsOrBlanks();
00449             String str_line = FP.GetCurrentLine(); FP.Advance();
00450 
00451             // Remove '=' symbols
00452             LineParser LP(str_line);
00453             LP.ReplaceAllChars('=',' ');
00454 
00455             // Parse bry marks
00456             LP >> BCs[j].BryMark;
00457             String lvalue;
00458             REAL   rvalue;
00459             while (LP >> lvalue)
00460             {
00461                 if (!(std::isalpha(lvalue[0])))
00462                     throw new Fatal(_("FilesData::ReadNodeBry: (.nbc) file format invalid: nBrys=%d Stage=%d BryMark=%d"), n_bry_marks, i+1, BCs[j].BryMark);
00463                 if (!(LP >> rvalue))
00464                     throw new Fatal(_("FilesData::ReadNodeBry: (.nbc) file format invalid: nBrys=%d Stage=%d BryMark=%d"), n_bry_marks, i+1, BCs[j].BryMark);
00465                 BCs[j].Names.push_back(lvalue);
00466                 BCs[j].Values.push_back(rvalue);
00467             }
00468         }
00469     }
00470 
00471 #ifdef DO_DEBUG // {{{ 
00472     std::cout << "FilesData::ReadNodeBry: <" << n_bry_marks << "> boundary marks read" << std::endl;
00473 #endif // }}} 
00474 } // }}}
00475 
00476 inline void FilesData::ReadFaceBry(FEM::InputData const & ID) // {{{
00477 {
00478     /* example.fbc {{{
00479     ################################################ .fbc
00480     2 # two stages 
00481     3 # number of boundary marks
00482 
00483     1 # stage one
00484     -1  Dux=0  Duy=0  Duz=0 
00485     -2  Dux=0  Duy=0  
00486     -3  Dux=0  Duy=0  Dtz=-0.2
00487 
00488     2 # stage two 
00489     -1  Dux=0  Duy=0  Duz=0 
00490     -2  Dux=0  Duy=0  
00491     -3  Dux=0  Duy=0  Dtz=-10
00492     }}} */
00493 
00494     // Open file
00495     FileParser FP(ID.fnFBC);
00496 
00497     // Number of stages
00498     int n_stages;
00499     FP.ReadNextValue(n_stages);
00500 
00501     // Number of boundary marks
00502     int n_bry_marks;
00503     FP.ReadNextValue(n_bry_marks);
00504 
00505     // Allocate stages
00506     if (Stages.size()!=0)
00507     {
00508         if (Stages.size()!=static_cast<size_t>(n_stages))
00509             throw new Fatal(_("FilesData::ReadFaceBry: number of stages must be equal to (%d)"), Stages.size());
00510     }
00511     else
00512         Stages.resize(n_stages);
00513 
00514     // Check number of stages
00515     if (n_stages<ID.nSTAGES)
00516         throw new Fatal(_("FilesData::ReadFaceBry: number of stages must be greater than or equal to (NSTAGES=%d)"), ID.nSTAGES);
00517 
00518     // Exit if there is no boundary mark
00519     if (n_bry_marks==0) return;
00520 
00521     // Read stages
00522     for (int i=0; i<n_stages; ++i) 
00523     {
00524         // Number of current stage
00525         int i_stage_p1; // number of current stage plus one
00526         FP.ReadNextValue(i_stage_p1);
00527 
00528         // Allocate and read boundaries
00529         Array<BryCond> & BCs = Stages[i].FaceBrys;
00530         BCs.resize(n_bry_marks);
00531         
00532         // Loop along boundary information (marks)
00533         for (int j=0; j<n_bry_marks; ++j)
00534         {
00535             // Read current line
00536             FP.JumpCommentsOrBlanks();
00537             String str_line = FP.GetCurrentLine(); FP.Advance();
00538 
00539             // Remove '=' symbols
00540             LineParser LP(str_line);
00541             LP.ReplaceAllChars('=',' ');
00542 
00543             // Parse bry marks
00544             LP >> BCs[j].BryMark;
00545             String lvalue;
00546             REAL   rvalue;
00547             while (LP >> lvalue)
00548             {
00549                 if (!(std::isalpha(lvalue[0])))
00550                     throw new Fatal(_("FilesData::ReadFaceBry: Invalid name (not alpha) for DOF key name. Stage=%d, BryMark=%d"), i+1, BCs[j].BryMark);
00551                 if (!(LP >> rvalue))
00552                     throw new Fatal(_("FilesData::ReadFaceBry: Could not read rvalue for Stage=%d and BryMark=%d"), i+1, BCs[j].BryMark);
00553                 BCs[j].Names.push_back(lvalue);
00554                 BCs[j].Values.push_back(rvalue);
00555             }
00556         }
00557     }
00558 #ifdef DO_DEBUG // {{{ 
00559     std::cout << "FilesData::ReadFaceBry: <" << n_bry_marks << "> boundary marks read" << std::endl;
00560 #endif // }}} 
00561 } // }}}
00562 
00563 inline void FilesData::ReadAttributes(FEM::InputData const & ID) // {{{
00564 {
00565     /* example.att {{{
00566     ################################################ .att
00567     2 # nuber of stages
00568     2 # number of attribute marks
00569 
00570     # stage attribute section
00571     1 # stage one
00572     -10 hex8_8 Active   Elastic fo1.mat 20 10
00573     -20 hex8_8 Active   Elastic fo1.mat 18 10
00574 
00575     2 # stage two
00576     -10 hex8_8 Active   Elastic fo1.mat 20 10
00577     -20 hex8_8 Inactive Elastic fo1.mat 18 10
00578     }}} */
00579 
00580     // Open file
00581     FileParser FP(ID.fnATT);
00582 
00583     // Number of stages
00584     int n_stages;
00585     FP.ReadNextValue(n_stages);
00586 
00587     // Number of attribute marks
00588     int n_att_marks;
00589     FP.ReadNextValue(n_att_marks);
00590 
00591     // Allocate stages
00592     if (Stages.size()!=0)
00593     {
00594         if (Stages.size()!=static_cast<size_t>(n_stages))
00595             throw new Fatal(_("FilesData::ReadAttributes: number of stages must be equal to (%d)"), Stages.size());
00596     }
00597     else
00598         Stages.resize(n_stages);
00599 
00600     // Check number of stages
00601     if (n_stages<ID.nSTAGES)
00602         throw new Fatal(_("FilesData::ReadAttributes: number of stages must be greater than or equal to (NSTAGES=%d)"), ID.nSTAGES);
00603 
00604     // Read stages
00605     for (int i=0; i<n_stages; ++i) 
00606     {
00607         // Number of current stage
00608         int i_stage_p1; // number of current stage plus one
00609         FP.ReadNextValue(i_stage_p1);
00610 
00611         // Allocate and read attributes
00612         Array<Attribute> & Atts = Stages[i].Attributes;
00613         Atts.resize(n_att_marks);
00614         
00615         // Loop along attributes data
00616         for (int j=0; j<n_att_marks; ++j)
00617         {
00618             // Read current line
00619             FP.JumpCommentsOrBlanks();
00620             String str_line = FP.GetCurrentLine(); FP.Advance();
00621 
00622             // Parse att marks
00623             LineParser LP(str_line);
00624             String str_active_inactive;
00625             LP >> Atts[j].AttMark >> Atts[j].EleName >> str_active_inactive >> Atts[j].ModelName >> Atts[j].MatFilename;
00626             REAL prop_value;
00627             while (LP>>prop_value) Atts[j].Properties.push_back(prop_value);
00628             if      ( str_active_inactive=="true"  )  Atts[j].IsActive = true;
00629             else if ( str_active_inactive=="false" )  Atts[j].IsActive = false;
00630             else
00631                 throw new Fatal(_("FilesData::ReadAttributes: Active/Inactive word is invalid < %s >"), str_active_inactive.c_str());
00632 
00633             // Read material parameters
00634             /* example.mat // {{{
00635             ################################################ .mat
00636             #Desc    Fujinomori-Old OCR=1
00637             #MatKey  FO1
00638             #
00639             #---------------------------------------
00640             #          lam    kap   nu rcs    c  gam
00641             @SubCam 0.0891 0.0196 0.20 3.2 5000  2.0
00642             #
00643             #-------------------------------------------
00644             #           lam    kap   nu rcs    c      A
00645             @NSubCam  0.0891 0.0196 0.20 3.2 5000 -0.001
00646             }}} */
00647             std::ostringstream oss;
00648             oss << ID.fullPATH << Atts[j].MatFilename;
00649             FileParser matFP(oss.str());
00650             matFP.FindKeyAndFillArray(Atts[j].ModelName, Atts[j].ModelPrms);
00651         }
00652     }
00653 #ifdef DO_DEBUG // {{{ 
00654     std::cout << "FilesData::ReadAttributes: <" << n_att_marks << "> attribute marks read" << std::endl;
00655 #endif // }}} 
00656 } // }}}
00657 
00658 inline void FilesData::ReadInitialValues(FEM::InputData const & ID) // {{{
00659 {
00660     /* example.ini {{{
00661     ################################################ .ini
00662     2
00663     1   4 { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } 
00664     2   4 { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } { 0 0 0 0 0 0 1.6 1 } 
00665     }}} */
00666 
00667     // Open file
00668     FileParser FP(ID.fnINI);
00669 
00670     // Number of elements
00671     int n_elements;
00672     FP.ReadNextValue(n_elements);
00673     if (static_cast<size_t>(n_elements)!=Elements.size())
00674         throw new Fatal(_("FilesData::ReadInitialValues: The number of elements inside (.ini) file must be equal to (%d)"),Elements.size());
00675 
00676     // Read initial values
00677     for (int i=0; i<n_elements; ++i) 
00678     {
00679         // Read current line
00680         FP.JumpCommentsOrBlanks();
00681         String str_line = FP.GetCurrentLine(); FP.Advance();
00682 
00683         // Parse values
00684         LineParser LP(str_line);
00685         int elem_num;
00686         int n_ini_data;
00687         LP.StructuredLine(elem_num, n_ini_data, Elements[i].IniVals);
00688     }
00689 #ifdef DO_DEBUG // {{{ 
00690     std::cout << "FilesData::ReadInitialValues: <" << n_elements << "> elements initial values read" << std::endl;
00691 #endif // }}} 
00692 } // }}}
00693 
00694 inline void FilesData::_fill_nodes_idx_info() // {{{
00695 {
00696     if (Stages.size()>0)
00697     {
00698         // Declare a reference to the first stage (All stages must have the same attribute marks and boundary marks)
00699         FilesData::Stage const & S = Stages[0];
00700 
00701         // Loop along the number of nodes
00702         for (size_t i=0; i<Nodes.size(); ++i)
00703         {
00704             // Declare an iterator of Attribute inside Stages structure
00705             Array<FilesData::BryCond>::const_iterator it;
00706 
00707             // Index to the NodeBrys array inside a Stage structure. It is constant for all stages
00708             if (Nodes[i].BryMark==0)
00709                 Nodes[i].IdxBry = -1;
00710             else
00711             {
00712                 // Find inside the Stages.NodeBrys array an boundary mark equal to the node [i] boundary mark
00713                 it = std::find(S.NodeBrys.begin(), S.NodeBrys.end(), Nodes[i].BryMark);
00714                 if (it==S.NodeBrys.end())
00715                     throw new Fatal(_("FilesData::_fill_nodes_idx_info: Could not find NodeBryMark (%d) inside .nbc file"), Nodes[i].BryMark);
00716                 Nodes[i].IdxBry = it-S.NodeBrys.begin();
00717             }
00718         }
00719     }
00720     else
00721         throw new Fatal(_("FilesData::_fill_nodes_idx_info: Stages.size() is not greater than 0"));
00722 } // }}}
00723 
00724 inline void FilesData::_fill_faces_idx_info() // {{{
00725 {
00726     if (Stages.size()>0)
00727     {
00728         // Declare a reference to the first stage (All stages must have the same attribute marks and boundary marks)
00729         FilesData::Stage const & S = Stages[0];
00730 
00731         // Loop along the number of faces
00732         for (size_t i=0; i<Faces.size(); ++i)
00733         {
00734             // Declare an iterator of Attribute inside Stages structure
00735             Array<FilesData::BryCond>::const_iterator it;
00736 
00737             // Index to the FaceBrys array inside a Stage structure. It is constant for all stages
00738             if (Faces[i].BryMark==0)
00739                 Faces[i].IdxBry = -1;
00740             else
00741             {
00742                 // Find inside the Stages.FaceBrys array an boundary mark equal to the face [i] boundary mark
00743                 it = std::find(S.FaceBrys.begin(), S.FaceBrys.end(), Faces[i].BryMark);
00744                 if (it==S.FaceBrys.end())
00745                     throw new Fatal(_("FilesData::_fill_faces_idx_info: Could not find FaceBryMark (%d) .fbc file"), Faces[i].BryMark);
00746                 Faces[i].IdxBry = it-S.FaceBrys.begin();
00747             }
00748         }
00749     }
00750     else
00751         throw new Fatal(_("FilesData::_fill_faces_idx_info: Stages.size() is not greater than 0"));
00752 } // }}}
00753 
00754 inline void FilesData::_fill_elements_idx_info() // {{{
00755 {
00756     if (Stages.size()>0)
00757     {
00758         // Declare a reference to the first stage (All stages must have the same attribute marks and boundary marks)
00759         FilesData::Stage const & S = Stages[0];
00760 
00761         // Loop along the number of elements
00762         for (size_t i=0; i<Elements.size(); ++i)
00763         {
00764             // Declare an iterator of Attribute inside Stages structure
00765             Array<FilesData::Attribute>::const_iterator it;
00766 
00767             // Find inside the Stages.Attributes array an attribute equal to the element [i] boundary mark
00768             it = std::find(S.Attributes.begin(), S.Attributes.end(), Elements[i].AttMark);
00769             if (it==S.Attributes.end())
00770                 throw new Fatal(_("FilesData::_fill_elements_idx_info: Could not find ElementAttMark (%d) inside .att file"), Elements[i].AttMark);
00771 
00772             // Index to the attributes array inside a Stage structure. It is constant for all stages
00773             Elements[i].IdxAtt = it-S.Attributes.begin();
00774         }
00775         
00776         // Loop along the number of embedded elements ------------------ embedded elements
00777         for (size_t i=0; i<EmbElements.size(); ++i)
00778         {
00779             // Declare an iterator of Attribute inside Stages structure
00780             Array<FilesData::Attribute>::const_iterator it;
00781 
00782             // Find inside the Stages.Attributes array an attribute equal to the element [i] boundary mark
00783             it = std::find(S.Attributes.begin(), S.Attributes.end(), EmbElements[i].AttMark);
00784             if (it==S.Attributes.end())
00785                 throw new Fatal(_("FilesData::_fill_elements_idx_info: Could not find AttMark(.ele)="), EmbElements[i].AttMark, _(" inside Stages[0].Attributes(.att)"));
00786 
00787             // Index to the attributes array inside a Stage structure. It is constant for all stages
00788             EmbElements[i].IdxAtt = it-S.Attributes.begin();
00789         }
00790     }
00791     else
00792         throw new Fatal(_("FilesData::_fill_elements_idx_info: Stages.size() is not greater than 0"));
00793 } // }}}
00794 
00795 // -------------------------- operator<< {{{
00796 
00797 std::ostream & operator<< (std::ostream & os, FilesData::Node const & node)
00798 {
00799     os << _6()<< node.Num << _8s()<< node.X << _8s()<< node.Y << _8s()<< node.Z << _6()<< node.BryMark << _6()<< node.IdxBry << std::endl;
00800     return os;
00801 }
00802 
00803 std::ostream & operator<< (std::ostream & os, Array<FilesData::Node> const & nodes)
00804 {
00805     os << _("Number of nodes = ") << nodes.size() << std::endl;
00806     for (size_t i=0; i<nodes.size(); ++i)
00807         os << nodes[i];
00808     return os;
00809 }
00810 
00811 std::ostream & operator<< (std::ostream & os, FilesData::Face  const & face)
00812 {
00813     os << _6()<< face.Num << _6()<< face.Connects.size();
00814     for (size_t i=0; i<face.Connects.size(); ++i)
00815         os << _6()<< face.Connects[i];
00816     os << _6()<< face.BryMark << _6()<< face.OwnerElement << _6()<< face.IdxBry << std::endl;
00817     return os;
00818 }
00819 
00820 std::ostream & operator<< (std::ostream & os, Array<FilesData::Face> const & faces)
00821 {
00822     os << _("Number of faces = ") << faces.size() << std::endl;
00823     for (size_t i=0; i<faces.size(); ++i)
00824         os << faces[i];
00825     return os;
00826 }
00827 
00828 std::ostream & operator<< (std::ostream & os, FilesData::Element  const & ele)
00829 {
00830     os << _6()<< ele.Num << _6()<< ele.Connects.size();
00831     for (size_t i=0; i<ele.Connects.size(); ++i)
00832         os << _6()<< ele.Connects[i];
00833     os << _6()<< ele.AttMark << _6()<< ele.IdxAtt;
00834 
00835     for (size_t j=0; j<ele.IniVals.size(); ++j)
00836     {
00837         os << " { ";
00838         for (size_t k=0; k<ele.IniVals[j].size(); k++)
00839         {
00840             os << ele.IniVals[j][k] << " ";
00841         }
00842         os << "}  ";
00843     }
00844     os << std::endl;
00845     return os;
00846 }
00847 
00848 std::ostream & operator<< (std::ostream & os, Array<FilesData::Element> const & eles)
00849 {
00850     os << _("Number of elements = ") << eles.size() << std::endl;
00851     for (size_t i=0; i<eles.size(); ++i)
00852         os << eles[i];
00853     return os;
00854 }
00855 
00856 std::ostream & operator<< (std::ostream & os, FilesData::BryCond const & BC)
00857 {
00858     os << _6()<< BC.BryMark << " ";
00859     for (size_t i=0; i<BC.Names.size(); ++i)
00860     {
00861         os << BC.Names[i] << "=" << BC.Values[i];
00862         if (i!=BC.Names.size()-1) os << " ";
00863     }
00864     os << std::endl;
00865     return os;
00866 }
00867 
00868 std::ostream & operator<< (std::ostream & os, Array<FilesData::BryCond> const & BCs)
00869 {
00870     os << _("Number of boundary conditions = ") << BCs.size() << std::endl;
00871     for (size_t i=0; i<BCs.size(); ++i)
00872         os << "     " << BCs[i];
00873     return os;
00874 }
00875 
00876 std::ostream & operator<< (std::ostream & os, FilesData::Attribute  const & Att)
00877 {
00878     os << _6()<< Att.AttMark << Att.EleName << _a() << Att.IsActive << Att.ModelName << Att.MatFilename;
00879     // Properties
00880     std::cout << " { ";
00881     for (size_t i=0; i<Att.Properties.size(); ++i)
00882         os << _8s()<< Att.Properties[i];
00883     // Parameters
00884     std::cout << " } ";
00885     for (size_t i=0; i<Att.ModelPrms.size(); ++i)
00886         os << _8s()<< Att.ModelPrms[i];
00887     os << std::endl;
00888     return os;
00889 }
00890 
00891 std::ostream & operator<< (std::ostream & os, Array<FilesData::Attribute> const & Atts)
00892 {
00893     os << _("Number of attributes = ") << Atts.size() << std::endl;
00894     for (size_t i=0; i<Atts.size(); ++i)
00895         os << "     " << Atts[i];
00896     return os;
00897 }
00898 
00899 std::ostream & operator<< (std::ostream & os, Array<FilesData::Stage> const & S)
00900 {
00901     os << _("Number of stages = ") << S.size() << std::endl;
00902 
00903     // NodeBrys
00904     os << _("   Node boundary conditions:\n");
00905     for (size_t i=0; i<S.size(); ++i)
00906         os << "      " << S[i].NodeBrys;
00907 
00908     // FaceBrys
00909     os << _("   Face boundary conditions:\n");
00910     for (size_t i=0; i<S.size(); ++i)
00911         os << "      " << S[i].FaceBrys;
00912 
00913     // Attributes
00914     os << _("   Element attributes:\n");
00915     for (size_t i=0; i<S.size(); ++i)
00916         os << "      " << S[i].Attributes;
00917 
00918     return os;
00919 }
00920 
00921 // }}}
00922  
00923 inline void FilesData::WriteNodes(FEM::InputData const & ID, bool DoOverwrite) // {{{
00924 {
00925     WriteNodes(ID.fnNODE, DoOverwrite);
00926 } // }}}
00927 
00928 inline void FilesData::WriteNodes(String const & fnNODE, bool DoOverwrite) // {{{
00929 {
00930     // Check if MainFilename exists
00931     if (!DoOverwrite)
00932         if (FileParser::CheckForFile(fnNODE))
00933             throw new Warning(_("File < %s > exists"), fnNODE.c_str());
00934 
00935     // Open file for output
00936     std::ofstream OF(fnNODE.GetSTL().c_str(), std::ios::out);
00937 
00938     // Write
00939     OF << "################################################### .node\n";
00940     OF << Nodes.size() << " # number of nodes\n";
00941     for (size_t i=0; i<Nodes.size(); ++i) 
00942     {
00943         OF << Nodes[i].Num << _8s()<< Nodes[i].X << _8s()<< Nodes[i].Y << _8s()<< Nodes[i].Z;
00944         if (Nodes[i].BryMark!=0) OF << "  " << Nodes[i].BryMark;
00945         OF << std::endl;
00946     }
00947 
00948     // Close
00949     OF.close();
00950 } // }}}
00951 
00952 inline void FilesData::WriteFaces(FEM::InputData const & ID, bool DoOverwrite) // {{{
00953 {
00954     WriteFaces(ID.fnFACE, DoOverwrite);
00955 } // }}}
00956 
00957 inline void FilesData::WriteFaces(String const & fnFACE, bool DoOverwrite) // {{{
00958 {
00959     // Check if MainFilename exists
00960     if (!DoOverwrite)
00961         if (FileParser::CheckForFile(fnFACE))
00962             throw new Warning(_("File < %s > exists"), fnFACE.c_str());
00963 
00964     // Open file for output
00965     std::ofstream OF(fnFACE.GetSTL().c_str(), std::ios::out);
00966 
00967     // Write
00968     OF << "################################################### .face\n";
00969     OF << Faces.size() << " # number of faces\n";
00970     for (size_t i=0; i<Faces.size(); ++i) 
00971     {
00972         OF << Faces[i].Num << "  " << Faces[i].Connects.size() << "  ";
00973         for (size_t j=0; j<Faces[i].Connects.size(); ++j)
00974             OF << Faces[i].Connects[j] << " ";
00975         OF << " " << Faces[i].BryMark << "  " << Faces[i].OwnerElement << std::endl;
00976     }
00977 
00978     // Close
00979     OF.close();
00980 } // }}}
00981 
00982 inline void FilesData::WriteElements(FEM::InputData const & ID, bool DoOverwrite) // {{{
00983 {
00984     WriteElements(ID.fnELE, DoOverwrite);
00985 } // }}}
00986 
00987 inline void FilesData::WriteElements(String const & fnELE, bool DoOverwrite) // {{{
00988 {
00989     // Check if MainFilename exists
00990     if (!DoOverwrite)
00991         if (FileParser::CheckForFile(fnELE))
00992             throw new Warning(_("File < %s > exists"), fnELE.c_str());
00993 
00994     // Open file for output
00995     std::ofstream OF(fnELE.GetSTL().c_str(), std::ios::out);
00996 
00997     // Write
00998     OF << "################################################### .ele\n";
00999     OF << Elements.size() << " # number of elements\n";
01000     for (size_t i=0; i<Elements.size(); ++i) 
01001     {
01002         OF << Elements[i].Num << "  " << Elements[i].Connects.size() << "  ";
01003         for (size_t j=0; j<Elements[i].Connects.size(); ++j)
01004             OF << Elements[i].Connects[j] << " ";
01005         OF << " " << Elements[i].AttMark << std::endl;
01006     }
01007 
01008     // Close
01009     OF.close();
01010 } // }}}
01011 
01012 inline void FilesData::WriteNodeBry(FEM::InputData const & ID, bool DoOverwrite) // {{{
01013 {
01014     WriteNodeBry(ID.fnNBC, DoOverwrite);
01015 } // }}}
01016 
01017 inline void FilesData::WriteNodeBry(String const & fnNBC, bool DoOverwrite) // {{{
01018 {
01019     if (Stages.size()>0)
01020     {
01021         // Check if MainFilename exists
01022         if (!DoOverwrite)
01023             if (FileParser::CheckForFile(fnNBC))
01024                 throw new Warning(_("File < %s > exists"), fnNBC.c_str());
01025 
01026         // Open file for output
01027         std::ofstream OF(fnNBC.GetSTL().c_str(), std::ios::out);
01028 
01029         // Write
01030         OF << "################################################### .nbc\n";
01031         OF << Stages.size()             << " # number of stages\n";
01032         OF << Stages[0].NodeBrys.size() << " # number of boundary marks\n";
01033         OF << std::endl;
01034         for (size_t i=0; i<Stages.size(); ++i) 
01035         {
01036             OF << i+1 << " # stage\n";
01037             Array<BryCond> & BCs = Stages[i].NodeBrys;
01038             for (size_t j=0; j<BCs.size(); ++j)
01039             {
01040                 OF << BCs[j].BryMark << "  ";
01041                 for (size_t k=0; k<BCs[j].Names.size(); ++k)
01042                     OF << BCs[j].Names[k] << "=" << BCs[j].Values[k] << " ";
01043                 OF << std::endl;
01044             }
01045             OF << std::endl;
01046         }
01047 
01048         // Close
01049         OF.close();
01050     }
01051     else
01052         throw new Fatal(_("FilesData::WriteNodeBry: Stages.size() is not greater than 0"));
01053 } // }}}
01054 
01055 inline void FilesData::WriteFaceBry(FEM::InputData const & ID, bool DoOverwrite) // {{{
01056 {
01057     WriteFaceBry(ID.fnFBC, DoOverwrite);
01058 } // }}}
01059 
01060 inline void FilesData::WriteFaceBry(String const & fnFBC, bool DoOverwrite) // {{{
01061 {
01062     if (Stages.size()>0)
01063     {
01064         // Check if MainFilename exists
01065         if (!DoOverwrite)
01066             if (FileParser::CheckForFile(fnFBC))
01067                 throw new Warning(_("File < %s > exists"), fnFBC.c_str());
01068 
01069         // Open file for output
01070         std::ofstream OF(fnFBC.GetSTL().c_str(), std::ios::out);
01071 
01072         // Write
01073         OF << "################################################### .fbc\n";
01074         OF << Stages.size()             << " # number of stages\n";
01075         OF << Stages[0].FaceBrys.size() << " # number of boundary marks\n";
01076         OF << std::endl;
01077         for (size_t i=0; i<Stages.size(); ++i) 
01078         {
01079             OF << i+1 << " # stage\n";
01080             Array<BryCond> & BCs = Stages[i].FaceBrys;
01081             for (size_t j=0; j<BCs.size(); ++j)
01082             {
01083                 OF << BCs[j].BryMark << "  ";
01084                 for (size_t k=0; k<BCs[j].Names.size(); ++k)
01085                     OF << BCs[j].Names[k] << "=" << BCs[j].Values[k] << " ";
01086                 OF << std::endl;
01087             }
01088             OF << std::endl;
01089         }
01090 
01091         // Close
01092         OF.close();
01093     }
01094     else
01095         throw new Fatal(_("FilesData::WriteFaceBry: Stages.size() is not greater than 0"));
01096 } // }}}
01097 
01098 inline void FilesData::WriteAttributes(FEM::InputData const & ID, bool DoOverwrite) // {{{
01099 {
01100     WriteAttributes(ID.fnATT, DoOverwrite);
01101 } // }}}
01102 
01103 inline void FilesData::WriteAttributes(String const & fnATT, bool DoOverwrite) // {{{
01104 {
01105     if (Stages.size()>0)
01106     {
01107         // Check if MainFilename exists
01108         if (!DoOverwrite)
01109             if (FileParser::CheckForFile(fnATT))
01110                 throw new Warning(_("File < %s > exists"), fnATT.c_str());
01111 
01112         // Open file for output
01113         std::ofstream OF(fnATT.GetSTL().c_str(), std::ios::out);
01114 
01115         // Write
01116         OF << "################################################### .att\n";
01117         OF << Stages.size()               << " # number of stages\n";
01118         OF << Stages[0].Attributes.size() << " # number of attributes\n";
01119         OF << std::endl;
01120         for (size_t i=0; i<Stages.size(); ++i) 
01121         {
01122             OF << i+1 << " # stage\n";
01123             Array<Attribute> & Atts = Stages[i].Attributes;
01124             for (size_t j=0; j<Atts.size(); ++j)
01125             {
01126                 OF << Atts[j].AttMark <<"  "<< Atts[j].EleName <<" "<< _a()<<Atts[j].IsActive <<" "<< Atts[j].ModelName <<" "<< Atts[j].MatFilename <<" ";
01127                 for (size_t k=0; k<Atts[j].Properties.size(); ++k)
01128                     OF << Atts[j].Properties[k] << " ";
01129                 OF << std::endl;
01130             }
01131             OF << std::endl;
01132         }
01133 
01134         // Close
01135         OF.close();
01136     }
01137     else
01138         throw new Fatal(_("FilesData::WriteAttributes: Stages.size() is not greater than 0"));
01139 } // }}}
01140 
01141 inline void FilesData::WriteInitialValues(FEM::InputData const & ID, bool DoOverwrite) // {{{
01142 {
01143     WriteInitialValues(ID.fnINI, DoOverwrite);
01144 } // }}}
01145 
01146 inline void FilesData::WriteInitialValues(String const & fnINI, bool DoOverwrite) // {{{
01147 {
01148     // Check if MainFilename exists
01149     if (!DoOverwrite)
01150         if (FileParser::CheckForFile(fnINI))
01151             throw new Warning(_("File < %s > exists"), fnINI.c_str());
01152 
01153     // Open file for output
01154     std::ofstream OF(fnINI.GetSTL().c_str(), std::ios::out);
01155 
01156     // Write
01157     OF << "################################################### .ini\n";
01158     OF << Elements.size() << " # number of elements\n";
01159     for (size_t i=0; i<Elements.size(); ++i) 
01160     {
01161         OF << Elements[i].Num << " " << Elements[i].IniVals.size();
01162         for (size_t j=0; j<Elements[i].IniVals.size(); ++j)
01163         {
01164             OF << " { ";
01165             for (size_t k=0; k<Elements[i].IniVals[j].size(); ++k)
01166                 OF << Elements[i].IniVals[j][k] << " ";
01167             OF << " } ";
01168         }
01169         OF << std::endl;
01170     }
01171 
01172     // Close
01173     OF.close();
01174 } // }}}
01175 
01176 }; // namespace FEM
01177 
01178 #endif // MECHSYS_FEM_FILESDATA_H
01179 
01180 // vim:fdm=marker

Generated on Wed Jan 24 15:56:25 2007 for MechSys by  doxygen 1.4.7