OOFEM 3.0
Loading...
Searching...
No Matches
enrichmentfrontextend.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 "dynamicinputrecord.h"
37#include "classfactory.h"
38#include "xfem/xfemmanager.h"
39#include "domain.h"
40#include "connectivitytable.h"
41#include "element.h"
42
43namespace oofem {
45
46void EnrFrontExtend :: MarkNodesAsFront(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)
47{
48 mTipInfo = iTipInfo;
49 // Extend the set of enriched nodes as follows:
50 // If any node of the neighboring elements is enriched, the current node is also enriched.
51
52 Domain &d = * ( ixFemMan.giveDomain() );
53
54 // Loop over all nodes
55 int nNodes = d.giveNumberOfDofManagers();
56
57 std :: vector< int >newEnrNodes;
58 for ( int i = 1; i <= nNodes; i++ ) {
59 // Check if the node is already enriched
60 bool alreadyEnr = false;
61 auto resMarker = ioNodeEnrMarkerMap.find(i);
62 if ( resMarker != ioNodeEnrMarkerMap.end() ) {
63 alreadyEnr = true;
64 }
65
66#if defined ( ENABLE_XFEM_CPP11 )
67 auto begin = newEnrNodes.begin();
68 auto end = newEnrNodes.end();
69#else
70 std :: vector< int > :: const_iterator begin = newEnrNodes.begin();
71 std :: vector< int > :: const_iterator end = newEnrNodes.end();
72#endif
73 if ( std :: binary_search(begin, end, i) ) {
74 alreadyEnr = true;
75 }
76
77
78 if ( !alreadyEnr ) {
79 bool goOn = true;
80
81 // Loop over neighbors
82 const IntArray &neigh = * ( d.giveConnectivityTable()->giveDofManConnectivityArray(i) );
83 for ( int j = 1; j <= neigh.giveSize(); j++ ) {
84 if ( !goOn ) {
85 break;
86 }
87
88 Element &el = * ( d.giveElement( neigh.at(j) ) );
89
90 // Loop over neighbor element nodes
91 for ( int k = 1; k <= el.giveNumberOfDofManagers(); k++ ) {
92 int kGlob = el.giveDofManager(k)->giveGlobalNumber();
93 auto res = iLevelSetNormalDirMap.find(kGlob);
94 if ( res != iLevelSetNormalDirMap.end() && res->second < 0.0 ) {
95 newEnrNodes.push_back(i);
96 goOn = false;
97 break;
98 }
99 }
100 }
101 }
102 }
103
104
105 // Mark the new nodes to be enriched
106 for ( int i = 0; i < int ( newEnrNodes.size() ); i++ ) {
107 ioNodeEnrMarkerMap [ newEnrNodes [ i ] ] = NodeEnr_BULK;
108 }
109}
110
111void EnrFrontExtend :: giveInputRecord(DynamicInputRecord &input)
112{
113 int number = 1;
114 input.setRecordKeywordField(this->giveInputRecordName(), number);
115}
116} // end namespace oofem
#define REGISTER_EnrichmentFront(class)
int giveGlobalNumber() const
Definition dofmanager.h:515
ConnectivityTable * giveConnectivityTable()
Definition domain.C:1240
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition domain.h:461
Element * giveElement(int n)
Definition domain.C:165
void setRecordKeywordField(std ::string keyword, int number)
virtual int giveNumberOfDofManagers() const
Definition element.h:695
DofManager * giveDofManager(int i) const
Definition element.C:553
const char * giveInputRecordName() const override
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
Domain * giveDomain()

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