OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
41namespace oofem {
43
44void
45LinearEdgeLoad :: initializeFrom(InputRecord &ir)
46{
47 BoundaryLoad :: initializeFrom(ir);
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 throw ValueInputException(ir, "sc/ec", "coordinates not specified");
58 }
59 } else {
60 this->formulation = FT_Entity;
61 }
62}
63
64
65void LinearEdgeLoad :: giveInputRecord(DynamicInputRecord &input)
66{
67 BoundaryLoad :: giveInputRecord(input);
69 if ( this->formulation == FT_Global ) {
72 }
73}
74
75
76void
77LinearEdgeLoad :: computeNArray(FloatArray &answer, const FloatArray &coords) const
78{
79 // compute local isoparametric coordinates of given point
80 double ksi;
81
82 if ( formulation == FT_Global ) {
84 double dl = distance(coords, startCoords);
85 double eta = dl / length;
86 ksi = ( dl - 0.5 * length ) / ( 0.5 * length );
88
90
91 if ( ( ksi < -1.0 ) || ( ksi > 1.0 ) ) {
92 OOFEM_WARNING("point out of receiver, skipped");
93 answer.resize(2);
94 answer.zero();
95 }
96
97 for ( int i = 1; i <= dir.giveSize(); i++ ) {
98 if ( fabs( startCoords.at(i) + dir.at(i) * eta - coords.at(i) ) > 1.e-6 ) {
99 OOFEM_WARNING("point out of receiver, skipped");
100 answer.resize(2);
101 answer.zero();
102 }
103 }
104 } else {
105 ksi = coords.at(1);
106 }
107
108 answer.resize(2);
109
110 answer.at(1) = ( 1. - ksi ) * 0.5;
111 answer.at(2) = ( 1. + ksi ) * 0.5;
112}
113} // end namespace oofem
double length(const Vector &a)
Definition CSG.h:88
#define REGISTER_BoundaryCondition(class)
void setField(int item, InputFieldType id)
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void subtract(const FloatArray &src)
Definition floatarray.C:320
FormulationType formulation
FloatArray startCoords
Coordinates of start and end point.
@ FT_Global
Definition load.h:81
@ FT_Entity
Definition load.h:80
#define OOFEM_WARNING(...)
Definition error.h:80
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_LinearEdgeLoad_startcoord
#define _IFT_LinearEdgeLoad_formulation
#define _IFT_LinearEdgeLoad_endcoord
double distance(const FloatArray &x, const FloatArray &y)

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011