OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 "mmaclosestiptransfer.h"
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 
44 namespace oofem {
45 REGISTER_MaterialMappingAlgorithm(MMAClosestIPTransfer, MMA_ClosestPoint);
46 
48 { }
49 
50 void
51 MMAClosestIPTransfer :: __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 
61  if( mpMaterialStatus == NULL ) {
62  OOFEM_ERROR("Could not find material status.");
63  }
64 }
65 
66 int
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 
78 int
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
The base class for all spatial localizers.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Class and object Domain.
Definition: domain.h:115
virtual void copyStateVariables(const MaterialStatus &iStatus)=0
The class representing the general material model mapping algorithm.
Class implementing an array of integers.
Definition: intarray.h:61
REGISTER_MaterialMappingAlgorithm(MMAClosestIPTransfer, MMA_ClosestPoint)
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual int mapStatus(MaterialStatus &oStatus) const
Initializes receiver according to object description stored in input record.
virtual int __mapVariable(FloatArray &answer, const FloatArray &coords, InternalStateType type, TimeStep *tStep)
Maps and update the unknown of given type from old mesh oldd to new mesh to which gp belongs to...
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver&#39;s associated spatial localizer.
Definition: domain.C:1184
Material * giveMaterial()
Returns reference to material associated to related element of receiver.
Definition: gausspoint.h:197
Abstract base class representing a material status information.
Definition: matstatus.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
Definition: gausspoint.h:205
virtual void __init(Domain *dold, IntArray &type, const FloatArray &coords, Set &sourceElemSet, TimeStep *tStep, bool iCohesiveZoneGP=false)
Initializes the receiver state before mapping.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)=0
Returns the integration point in associated domain, which is closest to given point.
Class representing solution step.
Definition: timestep.h:80
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: material.C:142

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:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011