OOFEM 3.0
Loading...
Searching...
No Matches
externaltempfieldload.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
36#include "timestep.h"
37#include "classfactory.h"
38#include "field.h"
39#include "vtkhdf5reader.h"
41
42namespace oofem {
44
45void
46ExternalTemperatureFieldLoad :: computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)
47// Returns the value of the receiver at time and given position respecting the mode.
48{
49 if(!foreignField){
50 OOFEM_ERROR("ExternalTemperatureFieldLoad: foreignField must be assigned from python (is NULL).") }
51
52 if ( ( mode != VM_Incremental ) && ( mode != VM_Total ) ) {
53 OOFEM_ERROR("unknown mode (%s)", __ValueModeTypeToString(mode) );
54 }
55
56 if (this->vtkhdffielddefined)
57 {
58 if (this->readerStateCounter != tStep->giveSolutionStateCounter())
59 {
61 this->vtkReader.readMesh(*((UnstructuredGridField*)foreignField.get()), tStep);
62 this->vtkReader.readField(*((UnstructuredGridField*)foreignField.get()), tStep, vtkhdfFieldname);
63 }
64 }
65
66 if(foreignField->evaluateAt(answer, coords, mode, tStep)){
67 OOFEM_ERROR("ExternalTemperatureFieldLoad::foreignField.evaluateAt(...) failed.");
68 }
69}
70
71void
72ExternalTemperatureFieldLoad :: initializeFrom(InputRecord &ir)
73{
74 set = 0;
76
79 foreignField = std::make_shared<UnstructuredGridField>(0,0,0.);
80 this->vtkReader.initialize(vtkhdfFilename);
81 vtkhdffielddefined = true;
83}
84
85} // end namespace oofem
#define REGISTER_BoundaryCondition(class)
int set
Set number for boundary condition to be applied to.
StateCounterType giveSolutionStateCounter()
Definition timestep.h:211
#define OOFEM_ERROR(...)
Definition error.h:79
#define _IFT_ExternalTemperatureFieldLoad_VTKHDF5FieldName
#define _IFT_ExternalTemperatureFieldLoad_VTKHDF5FileName
#define _IFT_GeneralBoundaryCondition_set
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75

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