42 static void CalculateRightHandSideDerivative(
Element& rElement,
45 const double& rPertubationSize,
49 template <
typename TElementType>
54 const double& rPertubationSize,
60 if( rDesignVariable == SHAPE_SENSITIVITY_X || rDesignVariable == SHAPE_SENSITIVITY_Y || rDesignVariable == SHAPE_SENSITIVITY_Z )
63 FiniteDifferenceUtility::GetCoordinateDirection(rDesignVariable);
68 if (rOutput.size() != rRHS.size())
69 rOutput.
resize(rRHS.size(),
false);
76 rElement.CalculateRightHandSide(RHS_perturbed, rCurrentProcessInfo);
79 noalias(rOutput) = (RHS_perturbed - rRHS) / rPertubationSize;
87 KRATOS_WARNING(
"FiniteDifferenceUtility") <<
"Unsupported nodal design variable: " << rDesignVariable << std::endl;
88 if ( (rOutput.size() != 0) )
95 static void CalculateLeftHandSideDerivative(
Element& rElement,
97 const array_1d_component_type& rDesignVariable,
99 const double& rPertubationSize,
103 static void CalculateMassMatrixDerivative(
Element& rElement,
104 const Matrix& rMassMatrix,
105 const array_1d_component_type& rDesignVariable,
107 const double& rPertubationSize,
113 static std::size_t GetCoordinateDirection(
const array_1d_component_type& rDesignVariable);
Base class for all Elements.
Definition: element.h:60
FiniteDifferenceUtility.
Definition: finite_difference_utility.h:35
static void CalculateRightHandSideDerivative(TElementType &rElement, const Vector &rRHS, const array_1d_component_type &rDesignVariable, Node &rNode, const double &rPertubationSize, Vector &rOutput, const ProcessInfo &rCurrentProcessInfo)
Definition: finite_difference_utility.h:50
std::size_t SizeType
Definition: finite_difference_utility.h:40
Variable< double > array_1d_component_type
Definition: finite_difference_utility.h:38
std::size_t IndexType
Definition: finite_difference_utility.h:39
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class defines the node.
Definition: node.h:65
const PointType & GetInitialPosition() const
Definition: node.h:559
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_WARNING(label)
Definition: logger.h:265
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484