OOFEM 3.0
Loading...
Searching...
No Matches
mmaclosestiptransfer.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 "spatiallocalizer.h"
37#include "domain.h"
38#include "material.h"
39#include "gausspoint.h"
40#include "matstatmapperint.h"
41#include "classfactory.h"
43
44namespace oofem {
46
47MMAClosestIPTransfer :: MMAClosestIPTransfer() : MaterialMappingAlgorithm()
48{ }
49
50void
51MMAClosestIPTransfer :: __init(Domain *dold, IntArray &type, const FloatArray &coords, Set &elemSet, TimeStep *tStep, bool iCohesiveZoneGP)
52{
54 this->source = sl->giveClosestIP(coords, elemSet, iCohesiveZoneGP);
55
56 if ( !source ) {
57 OOFEM_ERROR("no suitable source found");
58 }
59
60 mpMaterialStatus = dynamic_cast<MaterialStatus*>(source->giveMaterialStatus());
61 if( mpMaterialStatus == NULL ) {
62 OOFEM_ERROR("Could not find material status.");
63 }
64}
65
66int
67MMAClosestIPTransfer :: __mapVariable(FloatArray &answer, const FloatArray &coords,
68 InternalStateType type, TimeStep *tStep)
69{
70 if ( source ) {
71 source->giveMaterial()->giveIPValue(answer, source, type, tStep);
72 return 1;
73 }
74
75 return 0;
76}
77
78int
79MMAClosestIPTransfer :: mapStatus(MaterialStatus &oStatus) const
80{
81 if ( mpMaterialStatus != NULL ) {
82 MaterialStatusMapperInterface *interface = dynamic_cast< MaterialStatusMapperInterface * >(&oStatus);
84
85 return 1;
86 } else {
87 OOFEM_ERROR("source not set.");
88 }
89
90 //return 0;
91}
92} // end namespace oofem
#define REGISTER_MaterialMappingAlgorithm(class, type)
SpatialLocalizer * giveSpatialLocalizer()
Definition domain.C:1255
virtual void copyStateVariables(const MaterialStatus &iStatus)=0
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)=0
#define OOFEM_ERROR(...)
Definition error.h:79

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