OOFEM 3.0
Loading...
Searching...
No Matches
generalslavenode.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 "generalslavenode.h"
36#include "slavedof.h"
37#include "floatarray.h"
38#include "intarray.h"
40#include "classfactory.h"
41#include "domain.h"
42#include "paramkey.h"
43#include "parametermanager.h"
44
45namespace oofem {
47
51
63
64
65void
67{
69 IntArray masterWeights, masterList;
70
72
74 auto val = ppm.getTempParam(this->number, IPK_DofManager_doftypemask.getIndex());
75 IntArray dofTypeMask (std::get<IntArray>(*val));
76
77
78 int size = 0;
79 for ( int i = 1; i <= dofTypeMask.giveSize(); i++ ) {
80 if ( dofTypeMask.at(i) != 0 ) {
81 size++;
82 }
83 }
84
85 if (size > 0) {
89 if ( masterSizes.giveSize() != size ) {
90 OOFEM_ERROR("OOFEM ERROR: masterSizes size does not correspond to doftype size");
91 }
92 auto val = ppm.getTempParam(this->number, IPK_GeneralSlaveNode_masterWeights.getIndex());
93 masterWeights = std::get<IntArray>(*val);
94 auto val2 = ppm.getTempParam(this->number, IPK_GeneralSlaveNode_masterList.getIndex());
95 masterList = std::get<IntArray>(*val2);
96 }
97 int index = 0;
98 for ( int j = 1; j <= masterSizes.giveSize(); j++ ) {
99 IntArray dof_masterList( masterSizes.at(j) );
100 IntArray dof_dofsList( masterSizes.at(j) );
101 FloatArray dof_weightsList( masterSizes.at(j) );
102
103 for ( int i = 1; i <= masterSizes.at(j); i++ ) {
104 index++;
105 dof_masterList.at(i) = masterList.at(2 * index - 1);
106 dof_dofsList.at(i) = masterList.at(2 * index);
107 dof_weightsList.at(i) = masterWeights.at(index);
108 }
109 dofs_masterList.push_back(dof_masterList);
110 dofs_dofsList.push_back(dof_dofsList);
111 dofs_weightsList.push_back(dof_weightsList);
112 }
113}
114
115void
117{
119
120 // initialize slave dofs (inside check of consistency of receiver and master dof)
121 int i = 0;
122 for ( Dof *dof: * this ) {
123 SlaveDof *sdof = dynamic_cast< SlaveDof * >( dof );
124 if ( sdof ) {
125 IntArray masterDofManagers = dofs_masterList [ i ];
126 IntArray masterDofIDArray = dofs_dofsList [ i ];
127 FloatArray masterWeights = dofs_weightsList [ i ];
128 sdof->initialize(masterDofManagers, masterDofIDArray, masterWeights);
129 i++;
130 }
131 }
132}
133
134
135
137{
138 for ( int j = 0; j < masterSizes.giveSize(); j++ ) {
139 for ( int i = 1; i <= dofs_masterList [ j ].giveSize(); i++ ) {
140 dofs_masterList [ j ].at(i) = f(dofs_masterList [ j ].at(i), ERS_DofManager);
141 }
142 }
144}
145} // end namespace oofem
#define REGISTER_DofManager(class)
static ParamKey IPK_DofManager_doftypemask
Definition dofmanager.h:151
void updateLocalNumbering(EntityRenumberingFunctor &f) override
Definition dofmanager.C:909
void postInitialize() override
Performs post initialization steps. Called after all components are created and initialized.
Definition dofmanager.C:444
ParameterManager dofmanPPM
Definition domain.h:134
Domain * giveDomain() const
Definition femcmpnn.h:97
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int number
Component number.
Definition femcmpnn.h:77
double & at(Index i)
Definition floatarray.h:202
void initializeFinish() override
static ParamKey IPK_GeneralSlaveNode_masterWeights
void postInitialize() override
Performs post initialization steps. Called after all components are created and initialized.
std::vector< FloatArray > dofs_weightsList
std::vector< IntArray > dofs_dofsList
static ParamKey IPK_GeneralSlaveNode_masterSizes
static ParamKey IPK_GeneralSlaveNode_masterList
void initializeFrom(InputRecord &ir, int priority) override
std::vector< IntArray > dofs_masterList
Master nodes for all dofs.
virtual void updateLocalNumbering(EntityRenumberingFunctor &f) override
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
void initializeFrom(InputRecord &ir) override
Definition node.h:169
void initializeFinish() override
Performs post initialization steps.
Definition node.C:144
std::optional< paramValue > getTempParam(size_t componentIndex, size_t paramIndex) const
void initialize(const IntArray &masterNodes, const IntArray &mstrDofID, const FloatArray &mstrContribution)
Definition slavedof.C:52
#define OOFEM_ERROR(...)
Definition error.h:79
#define PM_DOFMAN_ERROR_IFNOTSET(_pm, _componentnum, _paramkey)
#define PM_UPDATE_TEMP_PARAMETER(_type, _pm, _ir, _componentnum, _paramkey, _prio)
#define PM_ELEMENT_ERROR_IFNOTSET(_pm, _componentnum, _paramkey)
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)

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