2092 {
2094
2098 }
2099
2100 double time = OP::getFEMethod()->ts_t;
2103 }
2104
2105 int nb_base_functions = row_data.
getN().size2();
2106 int row_nb_dofs = row_data.
getIndices().size();
2107 int col_nb_dofs = col_data.
getIndices().size();
2108 int nb_integration_pts = OP::getGaussPts().size2();
2109 auto &locMat = OP::locMat;
2110 locMat.resize(row_nb_dofs, col_nb_dofs, false);
2111 locMat.clear();
2112
2113auto integrate_lhs = [&](auto &bc, auto calc_tau, double time_scale) {
2115
2116 auto val = bc.val;
2118 auto t_w = OP::getFTensor0IntegrationWeight();
2119 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
2120 auto t_tangent1 = OP::getFTensor1Tangent1AtGaussPts();
2121 auto t_tangent2 = OP::getFTensor1Tangent2AtGaussPts();
2122
2125
2126 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2127
2132
2135
2136 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2137 auto t_val = time_scale * t_w * tau * val;
2138
2139 int rr = 0;
2140 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2144 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2147 (t_tangent2(
k) + t_grad_gamma_u(
k, N1))) *
2148 t_kd(
j,
l) * t_diff_col_base(N0)
2149
2150 +
2151
2153 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2154 t_kd(
k,
l) * t_diff_col_base(N1);
2155
2156 t_mat(
i,
j) += (t_w * t_row_base) * t_val * t_normal_du(
i,
j);
2157 ++t_mat;
2158 ++t_diff_col_base;
2159 }
2160 ++t_row_base;
2161 }
2162
2163 for (; rr != nb_base_functions; ++rr)
2164 ++t_row_base;
2165 ++t_w;
2166 ++t_coords;
2167 ++t_tangent1;
2168 ++t_tangent2;
2169 ++t_grad_gamma_u;
2170 }
2171
2172 OP::locMat /= 2.;
2173
2175 };
2176
2177
2179 for (
auto &bc : *(
bcData)) {
2180 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2181
2182 double time_scale = 1;
2185 }
2186
2188 if (nb_dofs) {
2190 bc, [](double, double, double) { return 1; }, time_scale);
2191 }
2192 }
2193 }
2194
2196
2197}
#define FTENSOR_INDEX(DIM, I)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
FTensor::Tensor2< FTensor::PackPtr< double *, S >, DIM1, DIM2 > getFTensor2FromArray(MatrixDouble &data, const size_t rr, const size_t cc=0)
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) form data matrix.
static double dynamicTime
static enum StretchSelector stretchSelector
static enum RotSelector gradApproximator
static PetscBool dynamicRelaxation
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
boost::shared_ptr< PressureBcVec > bcData
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values
const VectorInt & getIndices() const
Get global indices of dofs on entity.