OOFEM 3.0
Loading...
Searching...
No Matches
enrichmentfront.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 "enrichmentfront.h"
36#include "xfem/tipinfo.h"
37#include "domain.h"
38#include "xfem/xfemmanager.h"
39#include "spatiallocalizer.h"
40#include "element.h"
41
42namespace oofem {
43void EnrichmentFront :: MarkTipElementNodesAsFront(std :: unordered_map< int, NodeEnrichmentType > &ioNodeEnrMarkerMap, XfemManager &ixFemMan, const std :: unordered_map< int, double > &iLevelSetNormalDirMap, const std :: unordered_map< int, double > &iLevelSetTangDirMap, const TipInfo &iTipInfo)
44{
45 mTipInfo = iTipInfo;
46
47 Domain &d = * ( ixFemMan.giveDomain() );
48
50
51 if ( el != NULL ) {
52 const IntArray &elNodes = el->giveDofManArray();
53
54 for ( int i = 1; i <= elNodes.giveSize(); i++ ) {
55 if ( ioNodeEnrMarkerMap [ elNodes.at(i) ] == NodeEnr_START_TIP || ioNodeEnrMarkerMap [ elNodes.at(i) ] == NodeEnr_END_TIP ) {
56 ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_START_AND_END_TIP;
57 } else {
58 if ( mTipInfo.mTipIndex == 0 ) {
59 ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_START_TIP;
60 }
61
62 if ( mTipInfo.mTipIndex == 1 ) {
63 ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_END_TIP;
64 }
65 }
66 }
67 }
68}
69
70void EnrichmentFront :: computeCrackTangent(FloatArray &oTangent, FloatArray &oNormal, bool &oFlipTangent, const EfInput &iEfInput) const
71{
72 oTangent = iEfInput.mLocalTangDir;
73
74 if ( oTangent.dotProduct(mTipInfo.mTangDir) < 0.0 ) {
75 oTangent.times(-1.0);
76 oFlipTangent = true;
77 } else {
78 oFlipTangent = false;
79 }
80
81 oNormal = Vec2(
82 -oTangent.at(2), oTangent.at(1)
83 );
84}
85} // end namespace oofem
SpatialLocalizer * giveSpatialLocalizer()
Definition domain.C:1255
const IntArray & giveDofManArray() const
Definition element.h:611
TipInfo mTipInfo
reference to the associated enrichment item
double & at(Index i)
Definition floatarray.h:202
double dotProduct(const FloatArray &x) const
Definition floatarray.C:524
void times(double s)
Definition floatarray.C:834
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=nullptr)=0
Domain * giveDomain()
static FloatArray Vec2(const double &a, const double &b)
Definition floatarray.h:606
@ NodeEnr_START_TIP
@ NodeEnr_END_TIP
@ NodeEnr_START_AND_END_TIP
FloatArray mLocalTangDir

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