v0.9.0
MethodForForceScaling.hpp
Go to the documentation of this file.
1 /* \fiele MethodForForceScaling.hpp
2 
3 */
4 
5 /* This file is part of MoFEM.
6  * MoFEM is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
18 
19 #ifndef __METHOD_FOR_FORCE_SCALING_HPP__
20 #define __METHOD_FOR_FORCE_SCALING_HPP__
21 
22 /// Class used to scale loads, f.e. in arc-length control
24 
25  virtual MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &Nf) = 0;
26  virtual MoFEMErrorCode getForceScale(const double ts_t, double &scale) {
28  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
30  }
31 
32  static MoFEMErrorCode
33  applyScale(const FEMethod *fe,
34  boost::ptr_vector<MethodForForceScaling> &methods_op,
35  VectorDouble &nf) {
37  for (auto vit = methods_op.begin(); vit != methods_op.end(); vit++)
38  CHKERR vit->scaleNf(fe, nf);
40  }
41 
42  static MoFEMErrorCode
43  applyScale(const FEMethod *fe,
44  boost::shared_ptr<MethodForForceScaling> method_op,
45  VectorDouble &nf) {
47  CHKERR method_op->scaleNf(fe, nf);
49  }
50 
52 };
53 
54 #endif //__METHOD_FOR_FORCE_SCALING_HPP__
Class used to scale loads, f.e. in arc-length control.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
virtual MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &Nf)=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::shared_ptr< MethodForForceScaling > method_op, VectorDouble &nf)
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:72
virtual MoFEMErrorCode getForceScale(const double ts_t, double &scale)