OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
xfemsolverinterface.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 "../sm/EngineeringModels/xfemsolverinterface.h"
36 #include "../sm/Elements/structuralelement.h"
37 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerial.h"
38 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerialstatus.h"
39 #include "../sm/xfem/xfemstructuralelementinterface.h"
40 #include "../sm/mappers/primvarmapper.h"
41 #include "timestep.h"
42 #include "structengngmodel.h"
43 #include "staticstructural.h"
44 #include "primaryfield.h"
45 #include "domain.h"
46 #include "xfem/xfemmanager.h"
47 #include "element.h"
48 #include "matstatmapperint.h"
49 #include "nummet.h"
50 #include "floatarray.h"
51 #include "exportmodulemanager.h"
52 #include "vtkxmlexportmodule.h"
53 
54 namespace oofem {
55 
57 mNeedsVariableMapping(false)
58 {
59 
60 }
61 
63 {
64 
65 }
66 
67 void XfemSolverInterface::propagateXfemInterfaces(TimeStep *tStep, StructuralEngngModel &ioEngngModel, bool iRecomputeStepAfterCrackProp)
68 {
69  int domainInd = 1;
70  Domain *domain = ioEngngModel.giveDomain(domainInd);
71 
72  if(domain->hasXfemManager()) {
73  XfemManager *xMan = domain->giveXfemManager();
74  bool frontsHavePropagated = false;
75  if ( xMan->hasInitiationCriteria() ) {
76  // TODO: generalise this?
77  // Intitiate delaminations (only implemented for listbasedEI/delamination. Treated the same way as propagation)
78  xMan->initiateFronts(frontsHavePropagated,tStep);
79  }
80 
81  if( xMan->hasPropagatingFronts() ) {
82  // Propagate crack tips
83  xMan->propagateFronts(frontsHavePropagated);
84 
85  }
86 
87  bool eiWereNucleated = false;
88  if( xMan->hasNucleationCriteria() ) {
89  xMan->nucleateEnrichmentItems(eiWereNucleated);
90  }
91 
92  int numEl = domain->giveNumberOfElements();
93  for ( int i = 1; i <= numEl; i++ ) {
95  // Map state variables for enriched elements
96  XfemElementInterface *xfemElInt = dynamic_cast< XfemElementInterface * >( domain->giveElement(i) );
97 
98  if(xfemElInt) {
100  }
101 
102  }
103 
104 
105  if(frontsHavePropagated || eiWereNucleated) {
106  mNeedsVariableMapping = false;
107 
108  ioEngngModel.giveDomain(1)->postInitialize();
109  ioEngngModel.forceEquationNumbering();
110 
111  if(iRecomputeStepAfterCrackProp) {
112  printf("Recomputing time step.\n");
113  ioEngngModel.forceEquationNumbering();
114  ioEngngModel.solveYourselfAt(tStep);
115  ioEngngModel.updateYourself( tStep );
116  ioEngngModel.terminate( tStep );
117 
118  }
119  }
120  }
121 
122 }
123 
124 
125 } /* namespace oofem */
Class and object Domain.
Definition: domain.h:115
Provides Xfem interface for an element.
bool hasInitiationCriteria()
Definition: xfemmanager.C:450
void postInitialize()
Performs post-initialization for all the domain contents (which is called after initializeFrom).
Definition: domain.C:960
virtual void propagateFronts(bool &oAnyFronHasPropagated)
Definition: xfemmanager.C:339
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
XfemManager * giveXfemManager()
Definition: domain.C:375
virtual bool XfemElementInterface_updateIntegrationRule()
Updates integration rule based on the triangulation.
bool hasPropagatingFronts()
Definition: xfemmanager.C:439
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
virtual void terminate(TimeStep *tStep)
Terminates the solution of time step.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
bool hasXfemManager()
Definition: domain.C:386
This class manages the xfem part.
Definition: xfemmanager.h:109
void propagateXfemInterfaces(TimeStep *tStep, StructuralEngngModel &ioEngngModel, bool iRecomputeStepAfterCrackProp)
void nucleateEnrichmentItems(bool &oNewItemsWereNucleated)
Definition: xfemmanager.C:477
This class implements extension of EngngModel for structural models.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
Definition: engngm.h:451
bool hasNucleationCriteria()
Definition: xfemmanager.C:508
virtual int forceEquationNumbering(int i)
Forces equation renumbering on given domain.
Definition: engngm.C:408
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Definition: engngm.C:1720
Class representing solution step.
Definition: timestep.h:80
void initiateFronts(bool &oAnyFronHasPropagated, TimeStep *tStep)
Definition: xfemmanager.C:376

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