MechSys  1.0
Computing library for simulations in continuum and discrete mechanics
/home/dorival/mechsys/lib/fem/fem.h
Go to the documentation of this file.
00001 /************************************************************************
00002  * MechSys - Open Library for Mechanical Systems                        *
00003  * Copyright (C) 2005 Dorival M. Pedroso, Raúl D. D. Farfan             *
00004  *                                                                      *
00005  * This program is free software: you can redistribute it and/or modify *
00006  * it under the terms of the GNU General Public License as published by *
00007  * the Free Software Foundation, either version 3 of the License, or    *
00008  * any later version.                                                   *
00009  *                                                                      *
00010  * This program is distributed in the hope that it will be useful,      *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         *
00013  * GNU General Public License for more details.                         *
00014  *                                                                      *
00015  * You should have received a copy of the GNU General Public License    *
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>  *
00017  ************************************************************************/
00018 
00019 // MechSys
00020 #ifndef INCLUDE_MODELS_ONLY
00021 #include <mechsys/util/maps.h>
00022 #include <mechsys/util/fatal.h>
00023 #include <mechsys/mesh/mesh.h>
00024 #include <mechsys/mesh/structured.h>
00025 #include <mechsys/mesh/unstructured.h>
00026 #include <mechsys/fem/element.h>
00027 #include <mechsys/fem/rod.h>
00028 #include <mechsys/fem/beam.h>
00029 #include <mechsys/fem/flowelem.h>
00030 #include <mechsys/fem/equilibelem.h>
00031 #include <mechsys/fem/hydromechelem.h>
00032 #include <mechsys/fem/usigelem.h>
00033 #include <mechsys/fem/usigepselem.h>
00034 #include <mechsys/fem/geomelem.h>
00035 #include <mechsys/fem/elems/lin2.h>
00036 #include <mechsys/fem/elems/tri3.h>
00037 #include <mechsys/fem/elems/tri6.h>
00038 #include <mechsys/fem/elems/tri15.h>
00039 #include <mechsys/fem/elems/quad4.h>
00040 #include <mechsys/fem/elems/quad8.h>
00041 #include <mechsys/fem/elems/hex8.h>
00042 #include <mechsys/fem/elems/hex20.h>
00043 //#include <mechsys/fem/elems/tet10.h>
00044 #include <mechsys/fem/domain.h>
00045 #include <mechsys/fem/solvers/stdsolver.h>
00046 #include <mechsys/fem/solvers/uwpsolver.h>
00047 #include <mechsys/linalg/matvec.h>
00048 #endif
00049 #include <mechsys/models/model.h>
00050 #include <mechsys/models/linflow.h>
00051 #include <mechsys/models/linelastic.h>
00052 #include <mechsys/models/nlelastic.h>
00053 #include <mechsys/models/elastoplastic.h>
00054 #include <mechsys/models/problemep.h>
00055 #include <mechsys/models/camclay.h>
00056 #include <mechsys/models/unsatflow.h>
00057 #include <mechsys/models/unconv04.h>
00058 #include <mechsys/models/bbmx.h>
00059 #ifndef INCLUDE_MODELS_ONLY
00060 
00061 #define FEM_ALLOC_DOMAIN(msh, mat, inp,   DOM)                                                \
00062     FEM::Domain DOM(msh, (*inp.Prps), (*inp.Prms), (*inp.Inis), inp.fnkey.CStr(), inp.OutNods);
00063 
00064 #define FEM_ALLOC_SOLVER(inp, dom, PTSOL)                \
00065     String name = (inp.uwp ? "UWPSolver" : "STDSolver"); \
00066     SDPair flags;                                        \
00067     inp.SetSolFlags (flags);                             \
00068     FEM::Solver * PTSOL = AllocSolver (name, dom, flags);
00069 
00070 #define FEM_SOLVE(verbose, inp, ptsol, dom)                                                 \
00071     for (FEM::Domain::Models_t::const_iterator it=dom.Mdls.begin(); it!=dom.Mdls.end(); ++it) inp.SetSUp (it->second); \
00072     if (inp.ninc<1) inp.ninc = 1;                                                           \
00073     {                                                                                       \
00074         for (size_t i=0; i<inp.Stages.Size(); ++i)                                          \
00075         {                                                                                   \
00076             dom.SetBCs ((*inp.Stages[i]));                                                  \
00077             if (verbose) dom.PrintBCs (std::cout);                                          \
00078             if (inp.vtufile)                                                                \
00079             {                                                                               \
00080                 if (inp.dyn) ptsol->DynSolve (inp.tf, inp.dt, inp.dtout, inp.fnkey.CStr()); \
00081                 else         ptsol->Solve    (inp.ninc, inp.fnkey.CStr());                  \
00082             }                                                                               \
00083             else                                                                            \
00084             {                                                                               \
00085                 if (inp.dyn) ptsol->DynSolve (inp.tf, inp.dt, inp.dtout);                   \
00086                 else         ptsol->Solve    (inp.ninc);                                    \
00087             }                                                                               \
00088         }                                                                                   \
00089     }
00090 
00091 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines