OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
linearedgeload.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #include "linearedgeload.h"
36 #include "floatarray.h"
37 #include "mathfem.h"
38 #include "classfactory.h"
39 #include "dynamicinputrecord.h"
40 
41 namespace oofem {
42 REGISTER_BoundaryCondition(LinearEdgeLoad);
43 
46 {
47  IRResultType result; // Required by IR_GIVE_FIELD macro
48 
49  int fType = 0;
51  if ( fType == 1 ) {
52  this->formulation = FT_Global;
53  // read start and end coordinates
56  if ( startCoords.isEmpty() || endCoords.isEmpty() ) {
57  OOFEM_WARNING("coordinates not specified");
58  return IRRT_NOTFOUND;
59  }
60  } else {
61  this->formulation = FT_Entity;
62  }
63 
65 }
66 
67 
69 {
72  if ( this->formulation == FT_Global ) {
75  }
76 }
77 
78 
79 void
81 {
82  // compute local isoparametric coordinates of given point
83  double ksi;
84 
85  if ( formulation == FT_Global ) {
86  int i;
87  double length = endCoords.distance(startCoords);
88  double dl = coords.distance(startCoords);
89  double eta = dl / length;
90  ksi = ( dl - 0.5 * length ) / ( 0.5 * length );
91  FloatArray dir = endCoords;
92 
93  dir.subtract(startCoords);
94 
95  if ( ( ksi < -1.0 ) || ( ksi > 1.0 ) ) {
96  OOFEM_WARNING("point out of receiver, skipped", 1);
97  answer.resize(2);
98  answer.zero();
99  }
100 
101  for ( i = 1; i <= dir.giveSize(); i++ ) {
102  if ( fabs( startCoords.at(i) + dir.at(i) * eta - coords.at(i) ) > 1.e-6 ) {
103  OOFEM_WARNING("point out of receiver, skipped", 1);
104  answer.resize(2);
105  answer.zero();
106  }
107  }
108  } else {
109  ksi = coords.at(1);
110  }
111 
112  double n1, n2;
113 
114  n1 = ( 1. - ksi ) * 0.5;
115  n2 = ( 1. + ksi ) * 0.5;
116 
117  answer.resize(2);
118 
119  answer.at(1) = n1;
120  answer.at(2) = n2;
121 }
122 } // end namespace oofem
#define _IFT_LinearEdgeLoad_startcoord
void setField(int item, InputFieldType id)
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: boundaryload.C:125
REGISTER_BoundaryCondition(BoundaryCondition)
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void computeNArray(FloatArray &answer, const FloatArray &coords) const
Abstract function, for computing approximation matrix of receiver at given point. ...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
Definition: floatarray.C:489
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
Class representing vector of real numbers.
Definition: floatarray.h:82
#define _IFT_LinearEdgeLoad_formulation
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: boundaryload.C:92
Class representing the general Input Record.
Definition: inputrecord.h:101
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
Class representing the a dynamic Input Record.
FloatArray startCoords
Coordinates of start and end point.
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
#define _IFT_LinearEdgeLoad_endcoord
#define OOFEM_WARNING(...)
Definition: error.h:62
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
FormulationType formulation
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011