muMECH  1.0
melement.h
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: melement.h
10 // author(s): Ladislav Svoboda
11 // language: C, C++
12 // license: This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU Lesser General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 //********************************************************************************************************
31 #ifndef MUMECH_MELEMENT_H
32 #define MUMECH_MELEMENT_H
33 
34 #include "types.h"
35 
36 
37 namespace mumech {
38 
39 class Mesh;
40 
42 class mElement
43 {
44  public:
45  long id;
46  const Mesh *M;
47 
48  long nnodes;
49  long *nodes;
50  private:
51  long type;
52  double volume;
53 
54  public:
55  long region;
56 
57  double centroids[3];
58 
59  double ***displc;
60  double ***strain;
61  double ***stress;
62 
63  double **energy;
64  double **eqstress;
65 
66  // termitovo
67  // mesh predelat, aby nebyl pod problemem, protoze kazdy problem muze byt jine reseni, a ja chci na meshich zkoumat vice reseni
68  // pak udelat mesh, udelat fci ktera do nej nacte mumech reseni, udelat fci kteeera nacte ansys reseni, spocitat chybu ...
69 
70  double **error ;
71 
72 
73 
74 
75  public:
77  mElement (long i, const Mesh *m);
79  mElement (long i, const Mesh *m, const mElement *src);
81  virtual ~mElement();
82 
84  long give_type (void) const { return type; }
86  void set_type (long t);
87 
89  void compute_centroids(void);
90 
92  void allocate_fields (int pid);
93 
95  double give_volume(void);
97  double give_energy (int pid, int lc);
98 
100  void save_error (double val, int pid, int lc);
101 
103  void giveReducedStiffMatrix (double *C, int pid) const;
104 
106  void give_strain (double *strain, int pid, int lc) const;
107  void give_stress (double *stress, int pid, int lc) const;
108 
110  //double give_equiv_stress (int lc);
111 
112 
113 };//end of class declaration
114 
115 } // end of namespace mumech
116 
117 #endif // end of MUMECH_MELEMENT_H
118 
119 /*end of file*/
mElement(long i, const Mesh *m)
Constructor.
Definition: melement.cpp:40
file of various types and symbolic constant definitions
double ** energy
energy = INTEGRAL Strain * Stress *dVolume
Definition: melement.h:63
double *** strain
computed fields - strain in TVRN_THEORETICAL_FEEP notation
Definition: melement.h:60
long * nodes
Element nodes.
Definition: melement.h:49
double ** eqstress
equivalent stress = SQRT(3*J2)
Definition: melement.h:64
double *** displc
computed fields - displacement
Definition: melement.h:59
void give_stress(double *stress, int pid, int lc) const
Definition: melement.cpp:262
void set_type(long t)
Definition: melement.cpp:101
void give_strain(double *strain, int pid, int lc) const
Definition: melement.cpp:246
const Mesh * M
mesh
Definition: melement.h:46
long region
-2 - not set, -1 - matrix, <0;nIncl) id of inclusion
Definition: melement.h:55
double *** stress
computed fields - stress in TVRN_THEORETICAL_FEEP notation
Definition: melement.h:61
double give_energy(int pid, int lc)
Definition: melement.cpp:188
void compute_centroids(void)
Definition: melement.cpp:116
long id
identification number
Definition: melement.h:45
double give_volume(void)
Definition: melement.cpp:160
void giveReducedStiffMatrix(double *C, int pid) const
Definition: melement.cpp:234
double ** error
docasne, energeticka chyba reseni v porovnani s FEM resenim = (eps_mM - eps_FEM)
Definition: melement.h:70
double volume
Volume/Area.
Definition: melement.h:52
long type
Element type.
Definition: melement.h:51
long give_type(void) const
Definition: melement.h:84
void save_error(double val, int pid, int lc)
Definition: melement.cpp:225
Class Mesh contains and handles all mesh data.
Definition: mesh.h:52
long nnodes
Number of nodes at elements.
Definition: melement.h:48
virtual ~mElement()
Destructor.
Definition: melement.cpp:84
Class mElement contains and handles all mesh element data.
Definition: melement.h:42
void allocate_fields(int pid)
Definition: melement.cpp:150
double centroids[3]
Centroid coordinates.
Definition: melement.h:57