13 #if !defined(KRATOS_SIMPLE_STEADY_SENSITIVITY_BUILDER_SCHEME_H_INCLUDED)
14 #define KRATOS_SIMPLE_STEADY_SENSITIVITY_BUILDER_SCHEME_H_INCLUDED
17 #include <unordered_map>
71 mDimension(Dimension),
72 mBlockSize(BlockSize),
73 mRotationalTool(Dimension, mBlockSize)
84 mAuxVectors.resize(number_of_threads);
85 mAuxMatrices.resize(number_of_threads);
86 mRotatedSensitivityMatrices.resize(number_of_threads);
87 mSensitivityMatrices.resize(number_of_threads);
90 this->mAddNodalRotationDerivativesMethod = &SimpleSteadySensitivityBuilderScheme::TemplatedAddNodalRotationDerivatives<2>;
91 this->mAddNodalApplySlipConditionDerivativesMethod = &SimpleSteadySensitivityBuilderScheme::TemplatedAddNodalApplySlipConditionDerivatives<2>;
92 }
else if (Dimension == 3) {
93 this->mAddNodalRotationDerivativesMethod = &SimpleSteadySensitivityBuilderScheme::TemplatedAddNodalRotationDerivatives<3>;
94 this->mAddNodalApplySlipConditionDerivativesMethod = &SimpleSteadySensitivityBuilderScheme::TemplatedAddNodalApplySlipConditionDerivatives<3>;
96 KRATOS_ERROR <<
"Unsupported dimensionality requested. Only 2D and 3D "
97 "supported. [ Dimension = "
98 << Dimension <<
" ].\n";
101 KRATOS_INFO(this->
Info()) << this->
Info() <<
" created [ Dimensionality = " << mDimension <<
", BlockSize = " << mBlockSize <<
" ].\n";
120 if (!mIsNodalNormalShapeDerivativesComputed) {
121 mIsNodalNormalShapeDerivativesComputed =
true;
126 NEIGHBOUR_CONDITION_NODES);
133 SensitivityUtilities::AssignEntityDerivativesToNodes<ModelPart::ConditionsContainerType>(
134 rModelPart, mDimension, NORMAL_SHAPE_DERIVATIVE,
135 mNodalNeighboursMap, 1.0 / mDimension, SLIP);
168 CalculateLocalSensitivityAndGlobalPointersVector(
169 rCurrentElement, rResponseFunction, rSensitivity,
170 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
198 CalculateLocalSensitivityAndGlobalPointersVector(
199 rCurrentElement, rResponseFunction, rSensitivity,
200 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
228 CalculateLocalSensitivityAndGlobalPointersVector(
229 rCurrentCondition, rResponseFunction, rSensitivity,
230 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
258 CalculateLocalSensitivityAndGlobalPointersVector(
259 rCurrentCondition, rResponseFunction, rSensitivity,
260 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
288 CalculateLocalSensitivityAndGlobalPointersVector(
289 rCurrentElement, rResponseFunction, rSensitivity,
290 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
318 CalculateLocalSensitivityAndGlobalPointersVector(
319 rCurrentElement, rResponseFunction, rSensitivity,
320 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
348 CalculateLocalSensitivityAndGlobalPointersVector(
349 rCurrentCondition, rResponseFunction, rSensitivity,
350 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
378 CalculateLocalSensitivityAndGlobalPointersVector(
379 rCurrentCondition, rResponseFunction, rSensitivity,
380 rGPSensitivityVector, rVariable, rCurrentProcessInfo);
392 CalculateResidualSensitivityMatrix<ElementType, array_1d<double, 3>>(
393 rElement, rAdjointValues, mSensitivityMatrices[
k], rOutput, rGPSensitivityVector, rVariable,
394 rCurrentProcessInfo);
406 CalculateResidualSensitivityMatrix<ConditionType, array_1d<double, 3>>(
407 rCondition, rAdjointValues, mSensitivityMatrices[
k], rOutput, rGPSensitivityVector, rVariable,
408 rCurrentProcessInfo);
415 mAuxMatrices.clear();
416 mRotatedSensitivityMatrices.clear();
417 mSensitivityMatrices.clear();
425 std::string
Info()
const override
427 return "SimpleSteadySensitivityBuilderScheme";
467 bool mIsNodalNormalShapeDerivativesComputed =
false;
468 std::vector<Matrix> mAuxMatrices;
469 std::vector<Vector> mAuxVectors;
470 std::vector<Matrix> mRotatedSensitivityMatrices;
471 std::vector<Matrix> mSensitivityMatrices;
473 std::unordered_map<int, std::vector<int>> mNodalNeighboursMap;
482 const std::unordered_map<IndexType, IndexType>&,
488 const std::unordered_map<IndexType, IndexType>&,
495 template <
typename TEntityType,
typename TDerivativeEntityType,
typename TDataType>
496 void CalculateLocalSensitivityAndGlobalPointersVector(
497 TEntityType& rEntity,
499 Vector& rSensitivityVector,
508 rEntity.CalculateSensitivityMatrix(rVariable, mSensitivityMatrices[
k], rProcessInfo);
513 <<
" incompatible with mSensitivityMatrices[k].size1(): "
514 << mSensitivityMatrices[
k].size2() <<
". Variable: " << rVariable << std::endl;
521 <<
" incompatible with mSensitivityMatrices.size1(): "
522 << mSensitivityMatrices[
k].size1() <<
". Variable: " << rVariable << std::endl;
524 if (rSensitivityVector.size() != mSensitivityMatrices[
k].size1()) {
525 rSensitivityVector.
resize(mSensitivityMatrices[
k].size1(),
false);
530 if (rGPSensitivityVector.
size() != 1) {
531 rGPSensitivityVector.
resize(1);
534 rGPSensitivityVector(0) = GlobalPointer<TDerivativeEntityType>(&rEntity,
mRank);
539 template <
typename TEntityType,
typename TDataType>
540 void CalculateLocalSensitivityAndGlobalPointersVector(
541 TEntityType& rEntity,
542 AdjointResponseFunction& rResponseFunction,
543 Vector& rSensitivityVector,
544 GlobalPointersVector<NodeType>& rGPSensitivityVector,
545 const Variable<TDataType>& rVariable,
546 const ProcessInfo& rProcessInfo)
553 auto& rotated_sensitivity_matrix = mRotatedSensitivityMatrices[
k];
554 auto& sensitivity_matrix = mSensitivityMatrices[
k];
557 rEntity.GetValuesVector(adjoint_vector);
558 const IndexType residuals_size = adjoint_vector.size();
560 if (residuals_size != 0) {
561 this->CalculateResidualSensitivityMatrix<TEntityType, TDataType>(
562 rEntity, adjoint_vector, sensitivity_matrix, rotated_sensitivity_matrix,
563 rGPSensitivityVector, rVariable, rProcessInfo);
565 if (rSensitivityVector.size() != rotated_sensitivity_matrix.size1()) {
566 rSensitivityVector.resize(rotated_sensitivity_matrix.size1(),
false);
568 noalias(rSensitivityVector) =
prod(rotated_sensitivity_matrix, adjoint_vector);
572 rResponseFunction.CalculatePartialSensitivity(
573 rEntity, rVariable, sensitivity_matrix,
574 objective_partial_sensitivity, rProcessInfo);
577 rSensitivityVector.size())
578 <<
"rSensitivityVector does not have sufficient rows to add "
579 "objective partial sensitivity. [ rSensitivityVector.size() "
581 << rSensitivityVector.size() <<
", PartialSensitivityVectorSize = "
582 << objective_partial_sensitivity.size() <<
" ].\n";
588 for (
IndexType c = 0;
c < objective_partial_sensitivity.size(); ++
c) {
589 rSensitivityVector[
c] += objective_partial_sensitivity[
c];
596 template <
typename TEntityType,
typename TDataType>
598 TEntityType& rEntity,
600 Matrix& rEntityResidualDerivatives,
601 Matrix& rEntityRotatedResidualDerivatives,
602 GlobalPointersVector<NodeType>& rGPSensitivityVector,
603 const Variable<TDataType>& rVariable,
604 const ProcessInfo& rProcessInfo)
608 using DofsVectorType = std::vector<Dof<double>::Pointer>;
612 auto& aux_vector = mAuxVectors[
k];
613 auto& aux_matrix = mAuxMatrices[
k];
616 rEntity.GetValuesVector(rAdjointValues);
617 const IndexType residuals_size = rAdjointValues.size();
620 rEntity.CalculateSensitivityMatrix(rVariable, rEntityResidualDerivatives, rProcessInfo);
623 <<
"mAdjointVectors.size(): " << residuals_size
624 <<
" incompatible with rEntityResidualDerivatives.size1(): "
625 << rEntityResidualDerivatives.size2() <<
". Variable: " << rVariable << std::endl;
632 rEntity.GetDofList(
dofs, rProcessInfo);
635 std::vector<int> derivative_node_ids;
637 if (std::find(derivative_node_ids.begin(), derivative_node_ids.end(),
dofs[
i]->Id()) == derivative_node_ids.end()) {
638 derivative_node_ids.push_back(
dofs[
i]->Id());
642 std::unordered_map<IndexType, IndexType> gp_index_map;
643 auto& r_geometry = rEntity.GetGeometry();
644 const IndexType number_of_nodes = r_geometry.PointsNumber();
645 const IndexType number_of_derivative_nodes = derivative_node_ids.size();
647 if (rGPSensitivityVector.size() != number_of_derivative_nodes) {
648 rGPSensitivityVector.resize(number_of_derivative_nodes);
652 for (
IndexType i = 0;
i < number_of_derivative_nodes; ++
i) {
654 rGPSensitivityVector(
i) = r_gp;
655 gp_index_map[derivative_node_ids[
i]] =
i;
658 if (rVariable == SHAPE_SENSITIVITY) {
660 <<
"Entity sensitivity matrix size mismatch. [ rEntityResidualDerivatives.size = ( " << rEntityResidualDerivatives.size1()
661 <<
", " << rEntityResidualDerivatives.size2() <<
" ), required size = ( " << (number_of_derivative_nodes * mDimension)
662 <<
", " << residuals_size <<
" ) ].\n";
665 bool found_slip =
false;
666 IndexType local_index = number_of_derivative_nodes;
668 const auto& r_node = r_geometry[
i];
669 if (r_node.Is(SLIP)) {
671 const auto& neighbour_gps = r_node.GetValue(NEIGHBOUR_CONDITION_NODES);
672 const auto& neighbour_ids = mNodalNeighboursMap[r_node.Id()];
674 const auto neighbour_id = neighbour_ids[
i];
675 const auto p_itr = gp_index_map.find(neighbour_id);
676 if (p_itr == gp_index_map.end()) {
677 rGPSensitivityVector.push_back(neighbour_gps(
i));
678 gp_index_map[neighbour_id] = local_index++;
684 const IndexType derivatives_size = local_index * mDimension;
685 if (rEntityRotatedResidualDerivatives.size1() != derivatives_size || rEntityRotatedResidualDerivatives.size2() != residuals_size) {
686 rEntityRotatedResidualDerivatives.resize(derivatives_size, residuals_size,
false);
688 rEntityRotatedResidualDerivatives.clear();
699 const auto& r_node = r_geometry[
a];
701 if (r_node.Is(SLIP)) {
702 AddNodalRotationDerivatives(rEntityRotatedResidualDerivatives, rEntityResidualDerivatives, aux_vector, block_index, gp_index_map, r_node);
703 AddNodalApplySlipConditionDerivatives(rEntityRotatedResidualDerivatives, block_index, gp_index_map, r_node);
705 AddNodalResidualDerivatives(rEntityRotatedResidualDerivatives, rEntityResidualDerivatives, block_index);
709 const IndexType derivatives_size = number_of_nodes * mDimension;
710 if (rEntityRotatedResidualDerivatives.size1() != derivatives_size || rEntityRotatedResidualDerivatives.size2() != residuals_size) {
711 rEntityRotatedResidualDerivatives.resize(derivatives_size, residuals_size,
false);
713 noalias(rEntityRotatedResidualDerivatives) = rEntityResidualDerivatives;
719 void AddNodalRotationDerivatives(
721 const Matrix& rResidualDerivatives,
724 const std::unordered_map<IndexType, IndexType>& rDerivativesMap,
727 (this->*(this->mAddNodalRotationDerivativesMethod))(rOutput, rResidualDerivatives, rResiduals, NodeStartIndex, rDerivativesMap, rNode);
730 template<
unsigned int TDim>
731 void TemplatedAddNodalRotationDerivatives(
733 const Matrix& rResidualDerivatives,
736 const std::unordered_map<IndexType, IndexType>& rDerivativesMap,
742 BoundedVector<double, TDim>
residual, residual_derivative, aux_vector;
743 FluidCalculationUtilities::ReadSubVector<TDim>(
residual, rResiduals, NodeStartIndex);
746 BoundedMatrix<double, TDim, TDim> rotation_matrix;
750 for (
IndexType c = 0;
c < rResidualDerivatives.size1(); ++
c) {
752 FluidCalculationUtilities::ReadSubVector<TDim>(
753 residual_derivative,
row(rResidualDerivatives,
c), NodeStartIndex);
756 noalias(aux_vector) =
prod(rotation_matrix, residual_derivative);
759 FluidCalculationUtilities::AddSubVector<TDim>(
760 rOutput, aux_vector,
c, NodeStartIndex);
764 rOutput(
c, NodeStartIndex +
a) +=
765 rResidualDerivatives(
c, NodeStartIndex +
a);
770 BoundedMatrix<double, TDim, TDim> rotation_matrix_derivative;
771 const int current_node_index = rDerivativesMap.find(rNode.
Id())->second * TDim;
774 rotation_matrix_derivative, 0,
k, rNode);
777 FluidCalculationUtilities::AddSubVector<TDim>(
778 rOutput, aux_vector, current_node_index +
k, NodeStartIndex);
782 const auto& r_neighbour_ids = mNodalNeighboursMap.find(rNode.
Id())->second;
783 for (
IndexType b = 0;
b < r_neighbour_ids.size(); ++
b) {
784 const int derivative_node_index =
785 rDerivativesMap.find(r_neighbour_ids[
b])->second * TDim;
788 rotation_matrix_derivative,
b + 1,
k, rNode);
791 FluidCalculationUtilities::AddSubVector<TDim>(
792 rOutput, aux_vector, derivative_node_index +
k, NodeStartIndex);
799 void AddNodalApplySlipConditionDerivatives(
802 const std::unordered_map<IndexType, IndexType>& rDerivativesMap,
805 (this->*(this->mAddNodalApplySlipConditionDerivativesMethod))(rOutput, NodeStartIndex, rDerivativesMap, rNode);
808 template<
unsigned int TDim>
809 void TemplatedAddNodalApplySlipConditionDerivatives(
812 const std::unordered_map<IndexType, IndexType>& rDerivativesMap,
822 rOutput(
c, NodeStartIndex) = 0.0;
825 array_1d<double, TDim> effective_velocity, normal;
831 const double normal_magnitude =
norm_2(normal);
832 const Matrix& normal_shape_derivatives = rNode.
GetValue(NORMAL_SHAPE_DERIVATIVE);
835 const int current_node_index = rDerivativesMap.find(rNode.
Id())->second * TDim;
837 const auto& nodal_normal_derivative =
row(normal_shape_derivatives,
k);
840 value +=
inner_prod(nodal_normal_derivative, effective_velocity) / normal_magnitude;
841 value -=
inner_prod(normal, effective_velocity) *
843 std::pow(normal_magnitude, 3);
845 rOutput(current_node_index +
k, NodeStartIndex) = value;
849 const auto& r_neighbour_ids = mNodalNeighboursMap.find(rNode.
Id())->second;
850 for (
IndexType b = 0;
b < r_neighbour_ids.size(); ++
b) {
851 const int derivative_node_index =
852 rDerivativesMap.find(r_neighbour_ids[
b])->second * TDim;
854 const auto& nodal_normal_derivative =
855 row(normal_shape_derivatives, (
b + 1) * TDim +
k);
858 value +=
inner_prod(nodal_normal_derivative, effective_velocity) / normal_magnitude;
859 value -=
inner_prod(normal, effective_velocity) *
861 std::pow(normal_magnitude, 3);
863 rOutput(derivative_node_index +
k, NodeStartIndex) = value;
870 void AddNodalResidualDerivatives(
872 const Matrix& rResidualDerivatives,
878 for (
IndexType c = 0;
c < rResidualDerivatives.size1(); ++
c) {
880 rOutput(
c, NodeStartIndex +
i) +=
881 rResidualDerivatives(
c, NodeStartIndex +
i);
A base class for adjoint response functions.
Definition: adjoint_response_function.h:39
virtual void CalculatePartialSensitivity(Element &rAdjointElement, const Variable< double > &rVariable, const Matrix &rSensitivityMatrix, Vector &rSensitivityGradient, const ProcessInfo &rProcessInfo)
Calculate the partial sensitivity w.r.t. design variable.
Definition: adjoint_response_function.h:185
Base class for all Conditions.
Definition: condition.h:59
virtual void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:922
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:408
Base class for all Elements.
Definition: element.h:60
virtual void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:972
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
Short class definition.
Definition: find_global_nodal_neighbours_for_entities_process.h:41
std::unordered_map< int, std::vector< int > > GetNeighbourIds(NodesContainerType &rNodes) const
Definition: find_global_nodal_neighbours_for_entities_process.h:99
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: find_global_nodal_neighbours_for_entities_process.cpp:76
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
void resize(size_type new_dim) const
Definition: global_pointers_vector.h:366
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
IndexType Id() const
Definition: node.h:262
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Scheme used in the Sensitivity Builder.
Definition: sensitivity_builder_scheme.h:53
std::vector< Vector > mPartialSensitivity
Definition: sensitivity_builder_scheme.h:526
virtual void Clear()
Definition: sensitivity_builder_scheme.h:144
std::vector< Vector > mAdjointVectors
Definition: sensitivity_builder_scheme.h:525
const int mRank
Definition: sensitivity_builder_scheme.h:529
virtual void InitializeSolutionStep(ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction)
Definition: sensitivity_builder_scheme.h:120
ModelPart::ConditionType ConditionType
Definition: sensitivity_builder_scheme.h:62
ModelPart::NodeType NodeType
Definition: sensitivity_builder_scheme.h:60
ModelPart::ElementType ElementType
Definition: sensitivity_builder_scheme.h:64
std::unordered_map< int, GlobalPointer< ModelPart::NodeType > > mGlobalPointerNodalMap
Definition: sensitivity_builder_scheme.h:528
SensitivityBuilderScheme()
Constructor.
Definition: sensitivity_builder_scheme.h:71
Definition: simple_steady_sensitivity_builder_scheme.h:45
void CalculateSensitivity(ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given element.
Definition: simple_steady_sensitivity_builder_scheme.h:160
void CalculateSensitivity(ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given condition.
Definition: simple_steady_sensitivity_builder_scheme.h:370
virtual void CalculateLHSAndRHS(ElementType &rElement, Matrix &rLHS, Vector &rRHS, const ProcessInfo &rProcessInfo)
Definition: simple_steady_sensitivity_builder_scheme.h:436
~SimpleSteadySensitivityBuilderScheme()=default
Destructor.
KRATOS_CLASS_POINTER_DEFINITION(SimpleSteadySensitivityBuilderScheme)
std::size_t IndexType
Definition: simple_steady_sensitivity_builder_scheme.h:60
void CalculateSensitivity(ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given condition.
Definition: simple_steady_sensitivity_builder_scheme.h:340
virtual void CalculateLHSAndRHS(ConditionType &rCondition, Matrix &rLHS, Vector &rRHS, const ProcessInfo &rProcessInfo)
Definition: simple_steady_sensitivity_builder_scheme.h:447
void InitializeSolutionStep(ModelPart &rModelPart, ModelPart &rSensitivityModelPart, AdjointResponseFunction &rResponseFunction) override
Definition: simple_steady_sensitivity_builder_scheme.h:113
std::string Info() const override
Turn back information as a string.
Definition: simple_steady_sensitivity_builder_scheme.h:425
void CalculateResidualSensitivityMatrix(ConditionType &rCondition, Vector &rAdjointValues, Matrix &rOutput, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
Definition: simple_steady_sensitivity_builder_scheme.h:397
void CalculateSensitivity(ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given condition.
Definition: simple_steady_sensitivity_builder_scheme.h:220
void CalculateSensitivity(ConditionType &rCurrentCondition, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ConditionType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given condition.
Definition: simple_steady_sensitivity_builder_scheme.h:250
SimpleSteadySensitivityBuilderScheme(const IndexType Dimension, const IndexType BlockSize)
Constructor.
Definition: simple_steady_sensitivity_builder_scheme.h:67
void CalculateSensitivity(ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< double > &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given element.
Definition: simple_steady_sensitivity_builder_scheme.h:190
void CalculateResidualSensitivityMatrix(ElementType &rElement, Vector &rAdjointValues, Matrix &rOutput, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo)
Definition: simple_steady_sensitivity_builder_scheme.h:383
void CalculateSensitivity(ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< ElementType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given element.
Definition: simple_steady_sensitivity_builder_scheme.h:310
void Clear() override
Definition: simple_steady_sensitivity_builder_scheme.h:411
void CalculateSensitivity(ElementType &rCurrentElement, AdjointResponseFunction &rResponseFunction, Vector &rSensitivity, GlobalPointersVector< NodeType > &rGPSensitivityVector, const Variable< array_1d< double, 3 >> &rVariable, const ProcessInfo &rCurrentProcessInfo) override
Calculates sensitivity from a given element.
Definition: simple_steady_sensitivity_builder_scheme.h:280
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
#define KRATOS_INFO(label)
Definition: logger.h:250
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
dofs
Enforced auxTangentSlipNonObjective = delta_time * gap_time_derivative_non_objective....
Definition: generate_frictional_mortar_condition.py:210
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
residual
Definition: hinsberg_optimization_4.py:433
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17