muMECH  1.0
mnode.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: point.cpp
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 //********************************************************************************************************
26 
27 #include "mnode.h"
28 
29 #include "problem.h"
30 #include "mesh.h"
31 
32 
33 namespace mumech {
34 
36 mNode :: mNode (long i, const Mesh *m)
37 {
38  id = i;
39  M = m;
40 
41  //coords = new double[M->P->give_VECT_RANGE()];
42 
43  displc = strain = stress = NULL;
44 }
46 mNode :: mNode (long i, const Mesh *m, const mNode *src)
47 {
48  id = i;
49  M = m;
50 
51  coords.copy(&src->coords);
52 
53  displc = strain = stress = NULL;
54  if (src->displc != NULL || src->strain != NULL || src->stress != NULL) _errorr("results data not supported in copy constructor");
55 }
56 
59 {
60  int nP = M->npa;
61  int nLC = M->nLC;
62 
63  DeleteArray3D(displc, nP, nLC);
64  DeleteArray3D(strain, nP, nLC);
65  DeleteArray3D(stress, nP, nLC);
66 }
67 
69 {
70  int nLC = M->nLC;
71 
72  if (M->no_dspl_rf) { if (!displc) displc = Allocate1Ddpp (M->npa); if (M->no_dspl_rf[pid]) { if (!displc[pid]) displc[pid] = Allocate1Ddp(nLC); for (int i=0; i<nLC; i++) { if (M->no_dspl_rf[pid][i] && displc[pid][i] == NULL) displc[pid][i] = new double[M->P[pid]->ndisplc_one()]; } } }
73  if (M->no_strn_rf) { if (!strain) strain = Allocate1Ddpp (M->npa); if (M->no_strn_rf[pid]) { if (!strain[pid]) strain[pid] = Allocate1Ddp(nLC); for (int i=0; i<nLC; i++) { if (M->no_strn_rf[pid][i] && strain[pid][i] == NULL) strain[pid][i] = new double[M->P[pid]->nstrain_one()]; } } }
74  if (M->no_strs_rf) { if (!stress) stress = Allocate1Ddpp (M->npa); if (M->no_strs_rf[pid]) { if (!stress[pid]) stress[pid] = Allocate1Ddp(nLC); for (int i=0; i<nLC; i++) { if (M->no_strs_rf[pid][i] && stress[pid][i] == NULL) stress[pid][i] = new double[M->P[pid]->nstrain_one()]; } } }
75 }
76 
77 
78 } // end of namespace mumech
79 
80 /*end of file*/
mNode(long i, const Mesh *m)
Constructor.
Definition: mnode.cpp:36
double ** Allocate1Ddp(long d1)
Function allocates (&#39;new&#39; command) a 1d array of double* pointers set to NULL.
double *** Allocate1Ddpp(long d1)
Function allocates (&#39;new&#39; command) a 1d array of double** pointers set to NULL.
void allocate_fields(int pid)
Definition: mnode.cpp:68
bool ** no_strn_rf
Definition: mesh.h:95
int nstrain_one(void) const
Definition: problem.h:89
Class mNode contains and handles all mesh node data.
Definition: mnode.h:43
Class Mesh.
int ndisplc_one(void) const
Definition: problem.h:88
int nLC
number of load cases
Definition: mesh.h:92
PoinT coords
coordinates
Definition: mnode.h:49
void DeleteArray3D(double ***array, long d1, long d2)
Function deletes a 3D &#39;double&#39; array of dimension d1 x d2 x ??, allocated by new. ...
PoinT * copy(const PoinT *p)
Definition: arrays.h:100
int npa
number of allocated pointers
Definition: mesh.h:57
bool ** no_strs_rf
Definition: mesh.h:96
double *** strain
computed fields - strain
Definition: mnode.h:52
bool ** no_dspl_rf
Definition: mesh.h:94
virtual ~mNode()
Destructor.
Definition: mnode.cpp:58
double *** displc
computed fields - displacement
Definition: mnode.h:51
#define _errorr(_1)
Definition: gelib.h:160
Class mNode, mesh node.
double *** stress
computed fields - stress
Definition: mnode.h:53
const Problems ** P
set of pointers to solved problems
Definition: mesh.h:59
const Mesh * M
mesh
Definition: mnode.h:47
Class Mesh contains and handles all mesh data.
Definition: mesh.h:52
Class Problem.