KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
adjoint_finite_difference_base_element.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Armin Geiser, https://github.com/armingeiser
10 //
11 
12 #pragma once
13 
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/element.h"
22 #include "utilities/openmp_utils.h"
23 
24 namespace Kratos
25 {
26 
30 
34 
38 
42 
45 
52 template <typename TPrimalElement>
54 {
55 public:
56 
59 
62 
66 
69 
71  bool HasRotationDofs = false)
72  : Element(NewId),
73  mpPrimalElement(Kratos::make_intrusive<TPrimalElement>(NewId, pGetGeometry())),
74  mHasRotationDofs(HasRotationDofs)
75  {
76  }
77 
79  GeometryType::Pointer pGeometry,
80  bool HasRotationDofs = false)
81  : Element(NewId, pGeometry),
82  mpPrimalElement(Kratos::make_intrusive<TPrimalElement>(NewId, pGeometry)),
83  mHasRotationDofs(HasRotationDofs)
84  {
85  }
86 
88  GeometryType::Pointer pGeometry,
89  PropertiesType::Pointer pProperties,
90  bool HasRotationDofs = false)
91  : Element(NewId, pGeometry, pProperties),
92  mpPrimalElement(Kratos::make_intrusive<TPrimalElement>(NewId, pGeometry, pProperties)),
93  mHasRotationDofs(HasRotationDofs)
94  {
95  }
96 
98 
102 
105 
106  Element::Pointer Create(IndexType NewId,
107  NodesArrayType const& ThisNodes,
108  PropertiesType::Pointer pProperties) const override
109  {
110  return Kratos::make_intrusive<AdjointFiniteDifferencingBaseElement<TPrimalElement>>(
111  NewId, GetGeometry().Create(ThisNodes), pProperties);
112  }
113 
114  Element::Pointer Create(IndexType NewId,
115  GeometryType::Pointer pGeometry,
116  PropertiesType::Pointer pProperties) const override
117  {
118  return Kratos::make_intrusive<AdjointFiniteDifferencingBaseElement<TPrimalElement>>(
119  NewId, pGeometry, pProperties);
120  }
121 
122  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
123 
124  void GetDofList(DofsVectorType& ElementalDofList, const ProcessInfo& CurrentProcessInfo) const override;
125 
126 
128  {
129  return mpPrimalElement->GetIntegrationMethod();
130  }
131 
132  void GetValuesVector(Vector& values, int Step = 0) const override;
133 
134  void Initialize(const ProcessInfo& rCurrentProcessInfo) override
135  {
136  mpPrimalElement->Initialize(rCurrentProcessInfo);
137  }
138 
139  void ResetConstitutiveLaw() override
140  {
141  mpPrimalElement->ResetConstitutiveLaw();
142  }
143 
144  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override
145  {
146  mpPrimalElement->InitializeSolutionStep(rCurrentProcessInfo);
147  }
148 
149  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override
150  {
151  mpPrimalElement->InitializeNonLinearIteration(rCurrentProcessInfo);
152  }
153 
154  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override
155  {
156  mpPrimalElement->FinalizeNonLinearIteration(rCurrentProcessInfo);
157  }
158 
159  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override
160  {
161  mpPrimalElement->FinalizeSolutionStep(rCurrentProcessInfo);
162  }
163 
164  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
165  VectorType& rRightHandSideVector,
166  const ProcessInfo& rCurrentProcessInfo) override
167  {
168  mpPrimalElement->CalculateLocalSystem(rLeftHandSideMatrix,
169  rRightHandSideVector,
170  rCurrentProcessInfo);
171  }
172 
173  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,
174  const ProcessInfo& rCurrentProcessInfo) override
175  {
176  mpPrimalElement->CalculateLeftHandSide(rLeftHandSideMatrix,
177  rCurrentProcessInfo);
178  }
179 
180  void CalculateRightHandSide(VectorType& rRightHandSideVector,
181  const ProcessInfo& rCurrentProcessInfo) override
182  {
183  mpPrimalElement->CalculateRightHandSide(rRightHandSideVector,
184  rCurrentProcessInfo);
185  }
186 
188  VectorType& rRightHandSideVector,
189  const ProcessInfo& rCurrentProcessInfo) override
190  {
191  mpPrimalElement->CalculateFirstDerivativesContributions(rLeftHandSideMatrix,
192  rRightHandSideVector,
193  rCurrentProcessInfo);
194  }
195 
196  void CalculateFirstDerivativesLHS(MatrixType& rLeftHandSideMatrix,
197  const ProcessInfo& rCurrentProcessInfo) override
198  {
199  mpPrimalElement->CalculateFirstDerivativesLHS(rLeftHandSideMatrix,
200  rCurrentProcessInfo);
201  }
202 
203  void CalculateFirstDerivativesRHS(VectorType& rRightHandSideVector,
204  const ProcessInfo& rCurrentProcessInfo) override
205  {
206  mpPrimalElement->CalculateFirstDerivativesRHS(rRightHandSideVector,
207  rCurrentProcessInfo);
208  }
209 
211  VectorType& rRightHandSideVector,
212  const ProcessInfo& rCurrentProcessInfo) override
213  {
214  mpPrimalElement->CalculateSecondDerivativesContributions(rLeftHandSideMatrix,
215  rRightHandSideVector,
216  rCurrentProcessInfo);
217  }
218 
219  void CalculateSecondDerivativesLHS(MatrixType& rLeftHandSideMatrix,
220  const ProcessInfo& rCurrentProcessInfo) override
221  {
222  mpPrimalElement->CalculateSecondDerivativesLHS(rLeftHandSideMatrix,
223  rCurrentProcessInfo);
224  }
225 
226  void CalculateSecondDerivativesRHS(VectorType& rRightHandSideVector,
227  const ProcessInfo& rCurrentProcessInfo) override
228  {
229  mpPrimalElement->CalculateSecondDerivativesRHS(rRightHandSideVector,
230  rCurrentProcessInfo);
231  }
232 
233  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override
234  {
235  mpPrimalElement->CalculateMassMatrix(rMassMatrix,rCurrentProcessInfo);
236  }
237 
238  void CalculateDampingMatrix(MatrixType& rDampingMatrix, const ProcessInfo& rCurrentProcessInfo) override
239  {
240  mpPrimalElement->CalculateDampingMatrix(rDampingMatrix, rCurrentProcessInfo);
241  }
242 
243  void AddExplicitContribution(const ProcessInfo& rCurrentProcessInfo) override
244  {
245  mpPrimalElement->AddExplicitContribution(rCurrentProcessInfo);
246  }
247 
248  void AddExplicitContribution(const VectorType& rRHSVector,
249  const Variable<VectorType>& rRHSVariable,
250  const Variable<double >& rDestinationVariable,
251  const ProcessInfo& rCurrentProcessInfo) override
252  {
253  mpPrimalElement->AddExplicitContribution(rRHSVector,
254  rRHSVariable,
255  rDestinationVariable,
256  rCurrentProcessInfo);
257  }
258 
259  void AddExplicitContribution(const VectorType& rRHSVector,
260  const Variable<VectorType>& rRHSVariable,
261  const Variable<array_1d<double,3> >& rDestinationVariable,
262  const ProcessInfo& rCurrentProcessInfo) override
263  {
264  mpPrimalElement->AddExplicitContribution(rRHSVector,
265  rRHSVariable,
266  rDestinationVariable,
267  rCurrentProcessInfo);
268  }
269 
270  void AddExplicitContribution(const MatrixType& rLHSMatrix,
271  const Variable<MatrixType>& rLHSVariable,
272  const Variable<Matrix>& rDestinationVariable,
273  const ProcessInfo& rCurrentProcessInfo) override
274  {
275  mpPrimalElement->AddExplicitContribution(rLHSMatrix,
276  rLHSVariable,
277  rDestinationVariable,
278  rCurrentProcessInfo);
279  }
280 
281  void Calculate(const Variable<double >& rVariable,
282  double& Output,
283  const ProcessInfo& rCurrentProcessInfo) override
284  {
285  KRATOS_ERROR << "Calculate of the adjoint base element is called!" << std::endl;
286  }
287 
288  void Calculate(const Variable< array_1d<double,3> >& rVariable,
289  array_1d<double,3>& Output,
290  const ProcessInfo& rCurrentProcessInfo) override
291  {
292  KRATOS_ERROR << "Calculate of the adjoint base element is called!" << std::endl;
293  }
294 
295  void Calculate(const Variable<Vector >& rVariable,
296  Vector& Output,
297  const ProcessInfo& rCurrentProcessInfo) override
298  {
299  KRATOS_ERROR << "Calculate of the adjoint base element is called!" << std::endl;
300  }
301 
302  void Calculate(const Variable<Matrix >& rVariable,
303  Matrix& Output,
304  const ProcessInfo& rCurrentProcessInfo) override;
305 
306  // Results calculation on integration points
308  std::vector<bool>& rOutput,
309  const ProcessInfo& rCurrentProcessInfo) override
310  {
311  KRATOS_ERROR << "CalculateOnIntegrationPoints of the adjoint base element is called!" << std::endl;
312  }
313 
314  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
315  std::vector<double>& rOutput,
316  const ProcessInfo& rCurrentProcessInfo) override;
317 
319  std::vector< array_1d<double, 3 > >& rOutput,
320  const ProcessInfo& rCurrentProcessInfo) override;
321 
323  std::vector< array_1d<double, 6 > >& rOutput,
324  const ProcessInfo& rCurrentProcessInfo) override
325  {
326  KRATOS_ERROR << "CalculateOnIntegrationPoints of the adjoint base element is called!" << std::endl;
327  }
328 
330  std::vector< Vector >& rOutput,
331  const ProcessInfo& rCurrentProcessInfo) override
332  {
333  KRATOS_ERROR << "CalculateOnIntegrationPoints of the adjoint base element is called!" << std::endl;
334  }
335 
337  std::vector< Matrix >& rOutput,
338  const ProcessInfo& rCurrentProcessInfo) override
339  {
340  KRATOS_ERROR << "CalculateOnIntegrationPoints of the adjoint base element is called!" << std::endl;
341  }
342 
343 
344  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
345 
346  // Sensitivity functions
347 
353  void CalculateSensitivityMatrix(const Variable<double>& rDesignVariable, Matrix& rOutput,
354  const ProcessInfo& rCurrentProcessInfo) override;
355 
361  void CalculateSensitivityMatrix(const Variable<array_1d<double,3>>& rDesignVariable, Matrix& rOutput,
362  const ProcessInfo& rCurrentProcessInfo) override;
363 
368  virtual void CalculateStressDisplacementDerivative(const Variable<Vector>& rStressVariable,
369  Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo);
374  void CalculateStressDesignVariableDerivative(const Variable<double>& rDesignVariable, const Variable<Vector>& rStressVariable,
375  Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo);
381  const Variable<Vector>& rStressVariable,
382  Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo);
386  Element::Pointer pGetPrimalElement()
387  {
388  return mpPrimalElement;
389  }
390  const Element::Pointer pGetPrimalElement() const
391  {
392  return mpPrimalElement;
393  }
395 
399 
400 protected:
401 
404 
405 
409 
410  template <typename TDataType>
411  void CalculateAdjointFieldOnIntegrationPoints(const Variable<TDataType>& rVariable, std::vector< TDataType >& rOutput, const ProcessInfo& rCurrentProcessInfo)
412  {
413  KRATOS_TRY;
414 
415  KRATOS_WARNING_IF("CalculateAdjointFieldOnIntegrationPoints", OpenMPUtils::IsInParallel() != 0)
416  << "The call of this non shared-memory-parallelized function within a parallel section should be avoided for efficiency reasons!" << std::endl;
417 
418  const SizeType num_nodes = mpPrimalElement->GetGeometry().PointsNumber();
419  const SizeType dimension = mpPrimalElement->GetGeometry().WorkingSpaceDimension();
420  const SizeType num_dofs_per_node = (mHasRotationDofs) ? 2 * dimension : dimension;
421  const SizeType num_dofs = num_nodes * num_dofs_per_node;
422  Vector initial_state_variables;
423  initial_state_variables.resize(num_dofs);
424 
425  Vector particular_solution = ZeroVector(num_dofs);
426  if(this->Has(ADJOINT_PARTICULAR_DISPLACEMENT)) {
427  particular_solution = this->GetValue(ADJOINT_PARTICULAR_DISPLACEMENT);
428  }
429 
430  // Build vector of variables containing the DOF-variables of the primal problem
431  std::vector<Variable<double>*> primal_solution_variable_list;
432  (mHasRotationDofs) ? primal_solution_variable_list = {&DISPLACEMENT_X, &DISPLACEMENT_Y, &DISPLACEMENT_Z, &ROTATION_X, &ROTATION_Y, &ROTATION_Z} :
433  primal_solution_variable_list = {&DISPLACEMENT_X, &DISPLACEMENT_Y, &DISPLACEMENT_Z};
434 
435  // Build vector of variables containing the DOF-variables of the adjoint problem
436  std::vector<Variable<double>*> adjoint_solution_variable_list;
437  (mHasRotationDofs) ? adjoint_solution_variable_list = {&ADJOINT_DISPLACEMENT_X, &ADJOINT_DISPLACEMENT_Y, &ADJOINT_DISPLACEMENT_Z, &ADJOINT_ROTATION_X, &ADJOINT_ROTATION_Y, &ADJOINT_ROTATION_Z} :
438  adjoint_solution_variable_list = {&ADJOINT_DISPLACEMENT_X, &ADJOINT_DISPLACEMENT_Y, &ADJOINT_DISPLACEMENT_Z};
439 
440  for (IndexType i = 0; i < num_nodes; ++i) {
441  const IndexType index = i * num_dofs_per_node;
442  for(IndexType j = 0; j < primal_solution_variable_list.size(); ++j) {
443  initial_state_variables[index + j] = mpPrimalElement->GetGeometry()[i].FastGetSolutionStepValue(*primal_solution_variable_list[j]);
444  mpPrimalElement->GetGeometry()[i].FastGetSolutionStepValue(*primal_solution_variable_list[j]) =
445  this->GetGeometry()[i].FastGetSolutionStepValue(*adjoint_solution_variable_list[j]) +
446  particular_solution[index + j];
447  }
448  }
449 
450  mpPrimalElement->CalculateOnIntegrationPoints(rVariable, rOutput, rCurrentProcessInfo);
451 
452  for (IndexType i = 0; i < num_nodes; ++i) {
453  const IndexType index = i * num_dofs_per_node;
454  for(IndexType j = 0; j < primal_solution_variable_list.size(); ++j) {
455  mpPrimalElement->GetGeometry()[i].FastGetSolutionStepValue(*primal_solution_variable_list[j]) = initial_state_variables[index + j];
456  }
457  }
458 
459  KRATOS_CATCH("")
460  }
461 
465 
469  Element::Pointer mpPrimalElement;
470  bool mHasRotationDofs = false;
471 
473 
474 private:
475 
479 
482 
486  double GetPerturbationSize(const Variable<double>& rDesignVariable, const ProcessInfo& rCurrentProcessInfo) const;
487 
491  double GetPerturbationSize(const Variable<array_1d<double,3>>& rDesignVariable, const ProcessInfo& rCurrentProcessInfo) const;
492 
499  virtual double GetPerturbationSizeModificationFactor(const Variable<double>& rVariable) const;
500 
507  virtual double GetPerturbationSizeModificationFactor(const Variable<array_1d<double,3>>& rDesignVariable) const;
508 
510 
514 
518 
521 
522  friend class Serializer;
523 
524  void save(Serializer& rSerializer) const override;
525 
526  void load(Serializer& rSerializer) override;
527 
529 
533 
537 
541 
542 };
543 
544 }
AdjointFiniteDifferencingBaseElement.
Definition: adjoint_finite_difference_base_element.h:54
void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:154
void CalculateSecondDerivativesLHS(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:219
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:173
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 6 > > &rVariable, std::vector< array_1d< double, 6 > > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:322
void Calculate(const Variable< Vector > &rVariable, Vector &Output, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:295
AdjointFiniteDifferencingBaseElement(IndexType NewId, GeometryType::Pointer pGeometry, bool HasRotationDofs=false)
Definition: adjoint_finite_difference_base_element.h:78
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:144
Element::Pointer pGetPrimalElement()
Definition: adjoint_finite_difference_base_element.h:386
const Element::Pointer pGetPrimalElement() const
Definition: adjoint_finite_difference_base_element.h:390
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) const override
Definition: adjoint_finite_difference_base_element.cpp:67
void CalculateAdjointFieldOnIntegrationPoints(const Variable< TDataType > &rVariable, std::vector< TDataType > &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: adjoint_finite_difference_base_element.h:411
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:233
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:159
void ResetConstitutiveLaw() override
Definition: adjoint_finite_difference_base_element.h:139
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:149
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:134
void CalculateFirstDerivativesLHS(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:196
virtual void CalculateStressDisplacementDerivative(const Variable< Vector > &rStressVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: adjoint_finite_difference_base_element.cpp:368
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: adjoint_finite_difference_base_element.cpp:33
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_base_element.h:114
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< array_1d< double, 3 > > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
Definition: adjoint_finite_difference_base_element.h:259
void CalculateOnIntegrationPoints(const Variable< bool > &rVariable, std::vector< bool > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:307
void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:238
AdjointFiniteDifferencingBaseElement(IndexType NewId=0, bool HasRotationDofs=false)
Definition: adjoint_finite_difference_base_element.h:70
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: adjoint_finite_difference_base_element.cpp:254
AdjointFiniteDifferencingBaseElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties, bool HasRotationDofs=false)
Definition: adjoint_finite_difference_base_element.h:87
void Calculate(const Variable< array_1d< double, 3 > > &rVariable, array_1d< double, 3 > &Output, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:288
void CalculateSecondDerivativesContributions(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:210
void AddExplicitContribution(const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:243
void Calculate(const Variable< double > &rVariable, double &Output, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:281
IntegrationMethod GetIntegrationMethod() const override
Definition: adjoint_finite_difference_base_element.h:127
void CalculateFirstDerivativesRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:203
void CalculateOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:329
void CalculateFirstDerivativesContributions(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:187
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_base_element.h:106
void AddExplicitContribution(const MatrixType &rLHSMatrix, const Variable< MatrixType > &rLHSVariable, const Variable< Matrix > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
Definition: adjoint_finite_difference_base_element.h:270
bool mHasRotationDofs
Definition: adjoint_finite_difference_base_element.h:470
void CalculateSensitivityMatrix(const Variable< double > &rDesignVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.cpp:294
Element::Pointer mpPrimalElement
Definition: adjoint_finite_difference_base_element.h:469
void GetValuesVector(Vector &values, int Step=0) const override
Definition: adjoint_finite_difference_base_element.cpp:100
void CalculateOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:336
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< double > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
Definition: adjoint_finite_difference_base_element.h:248
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AdjointFiniteDifferencingBaseElement)
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:180
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:164
void CalculateStressDesignVariableDerivative(const Variable< double > &rDesignVariable, const Variable< Vector > &rStressVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: adjoint_finite_difference_base_element.cpp:449
void CalculateSecondDerivativesRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_base_element.h:226
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometrical_object.h:248
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
bool Has(const Variable< TDataType > &rThisVariable) const
Definition: geometrical_object.h:230
IntegrationMethod
Definition: geometry_data.h:76
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
static int IsInParallel()
Wrapper for omp_in_parallel().
Definition: openmp_utils.h:122
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_WARNING_IF(label, conditional)
Definition: logger.h:266
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
intrusive_ptr< C > make_intrusive(Args &&...args)
Definition: smart_pointers.h:36
list values
Definition: bombardelli_test.py:42
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
def load(f)
Definition: ode_solve.py:307
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17