|
| v0.14.0
|
Go to the documentation of this file.
11 #ifndef _ESSENTIAL_DISPLACEMENTCUBITBCDATA_HPP__
12 #define _ESSENTIAL_DISPLACEMENTCUBITBCDATA_HPP__
50 rotated_displacement(
i) = 0;
52 auto get_rotation = [&](
auto &
omega) {
59 if (std::abs(angle) < std::numeric_limits<double>::epsilon())
60 return rotation_matrix;
63 t_omega(
i,
j) = FTensor::levi_civita<double>(
i,
j,
k) *
omega(
k);
64 const double a = sin(angle) / angle;
65 const double sin_squared = sin(angle / 2.) * sin(angle / 2.);
66 const double b = 2. * sin_squared / (angle * angle);
67 rotation_matrix(
i,
j) +=
a * t_omega(
i,
j);
68 rotation_matrix(
i,
j) += b * t_omega(
i,
k) * t_omega(
k,
j);
70 return rotation_matrix;
73 auto rotation = get_rotation(angles);
75 coordinate_distance(
i) = offset(
i) - coordinates(
i);
76 rotated_displacement(
i) =
77 coordinate_distance(
i) - rotation(
j,
i) * coordinate_distance(
j);
79 return rotated_displacement;
93 boost::shared_ptr<FEMethod> fe_ptr,
94 std::vector<boost::shared_ptr<ScalingMethod>> smv,
95 bool get_coords =
false);
115 boost::shared_ptr<FEMethod> fe_ptr,
double diag,
136 boost::shared_ptr<FEMethod> fe_ptr,
double diag,
162 boost::shared_ptr<std::vector<double>> reaction_ptr =
nullptr);
173 char reactionBlockName[255];
176 template <
int FIELD_DIM, AssemblyType A, IntegrationType I,
typename OpBase>
179 I>::template
OpSource<1, FIELD_DIM> {
185 boost::shared_ptr<DisplacementCubitBcData> bc_data,
186 boost::shared_ptr<Range> ents_ptr,
187 std::vector<boost::shared_ptr<ScalingMethod>> smv);
201 t_ret(
i) = tVal(
i) + rot(
i);
207 if (bc_data->data.flag4 || bc_data->data.flag5 || bc_data->data.flag6) {
208 return [
this](
double x,
double y,
double z) {
209 return this->rotFunction(x, y, z);
212 return [
this](
double x,
double y,
double z) {
return tVal; };
216 template <
int FIELD_DIM, AssemblyType A, IntegrationType I,
typename OpBase>
217 OpEssentialRhsImpl<DisplacementCubitBcData, 1, FIELD_DIM, A, I, OpBase>::
219 boost::shared_ptr<DisplacementCubitBcData> bc_data,
220 boost::shared_ptr<Range> ents_ptr,
221 std::vector<boost::shared_ptr<ScalingMethod>> smv)
223 vecOfTimeScalingMethods(smv) {
224 static_assert(
FIELD_DIM > 1,
"Is not implemented for scalar field");
231 if (bc_data->data.flag1 == 1)
232 tVal(0) = -bc_data->data.value1;
233 if (bc_data->data.flag2 == 1 &&
FIELD_DIM > 1)
234 tVal(1) = -bc_data->data.value2;
235 if (bc_data->data.flag3 == 1 &&
FIELD_DIM > 2)
236 tVal(2) = -bc_data->data.value3;
237 if (bc_data->data.flag4 == 1 &&
FIELD_DIM > 2)
238 tAngles(0) = -bc_data->data.value4;
239 if (bc_data->data.flag5 == 1 &&
FIELD_DIM > 2)
240 tAngles(1) = -bc_data->data.value5;
241 if (bc_data->data.flag6 == 1 &&
FIELD_DIM > 1)
242 tAngles(2) = -bc_data->data.value6;
244 if (
auto ext_bc_data =
247 for (
int a = 0;
a != 3; ++
a)
248 tOffset(
a) = ext_bc_data->rotOffset[
a];
251 this->timeScalingFun = [
this](
const double t) {
253 for (
auto &o : vecOfTimeScalingMethods) {
265 I>::template
OpMass<BASE_DIM, FIELD_DIM> {
271 boost::shared_ptr<Range> ents_ptr);
278 boost::shared_ptr<Range>
302 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
303 const std::string problem_name, std::string
field_name,
304 boost::shared_ptr<MatrixDouble> field_mat_ptr,
305 std::vector<boost::shared_ptr<ScalingMethod>> smv
315 A>::template LinearForm<I>::template OpBaseTimesVector<
BASE_DIM,
318 auto add_op = [&](
auto &bcs) {
320 for (
auto &
m : bcs) {
321 if (
auto bc =
m.second->dispBcPtr) {
322 auto &bc_id =
m.first;
324 (boost::format(
"%s_%s_(.*)") % problem_name %
field_name).str();
325 if (std::regex_match(bc_id, std::regex(regex_str))) {
331 pipeline.push_back(
new OpInternal(
333 [](
double,
double,
double) constexpr {
return 1.; },
334 m.second->getBcEntsPtr()));
364 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
365 const std::string problem_name, std::string
field_name
374 auto add_op = [&](
auto &bcs) {
376 for (
auto &
m : bcs) {
377 if (
auto bc =
m.second->dispBcPtr) {
378 auto &bc_id =
m.first;
380 (boost::format(
"%s_%s_(.*)") % problem_name %
field_name).str();
381 if (std::regex_match(bc_id, std::regex(regex_str))) {
385 pipeline.push_back(
new OP(
field_name,
m.second->getBcEntsPtr()));
402 #endif // _ESSENTIAL_DISPLACEMENTCUBITBCDATA_HPP__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
constexpr double omega
Save field DOFS on vertices/tags.
DisplacementCubitBcDataWithRotation()
FTensor::Tensor1< double, FIELD_DIM > rotFunction(double x, double y, double z)
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Tensor1< double, FIELD_DIM > tVal
VecOfTimeScalingMethods vecOfTimeScalingMethods
FTensor::Tensor1< double, 3 > tAngles
VecOfTimeScalingMethods vecOfTimeScalingMethods
std::array< double, 3 > rotOffset
Essential boundary conditions.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
SmartPetscObj< Vec > vRhs
Definition of the displacement bc data structure.
typename FormsIntegrators< OpBase >::template Assembly< A >::template LinearForm< I >::template OpSource< 1, FIELD_DIM > OpSource
boost::weak_ptr< FEMethod > fePtr
MoFEM::Interface & mField
Deprecated interface functions.
constexpr IntegrationType I
#define CHKERR
Inline error check.
implementation of Data Operators for Forces and Sources
Simple interface for fast problem set-up.
boost::weak_ptr< FEMethod > fePtr
SmartPetscObj< Mat > vLhs
MoFEM::Interface & mField
Enforce essential constrains on lhs.
BcMapByBlockName & getBcMapByBlockName()
Get the bc map.
Function (factory) for setting operators for rhs pipeline.
Class (Function) to enforce essential constrains on the left hand side diagonal.
static MoFEMErrorCode add(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, const std::string problem_name, std::string field_name)
Function (factory) for setting operators for lhs pipeline.
MoFEM::Interface & mField
boost::weak_ptr< FEMethod > fePtr
static FTensor::Tensor1< double, 3 > GetRotDisp(const FTensor::Tensor1< double, 3 > &angles, FTensor::Tensor1< double, 3 > coordinates, FTensor::Tensor1< double, 3 > offset=FTensor::Tensor1< double, 3 >{ 0., 0., 0.})
Calculates the rotated displacement given the rotation angles, coordinates, and an optional offset.
SeverityLevel
Severity levels.
SmartPetscObj< Vec > vRhs
constexpr double t
plate stiffness
FTensor::Index< 'i', SPACE_DIM > i
Class (Function) to calculate residual side diagonal.
static MoFEMErrorCode add(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, const std::string problem_name, std::string field_name, boost::shared_ptr< MatrixDouble > field_mat_ptr, std::vector< boost::shared_ptr< ScalingMethod >> smv)
Class (Function) to enforce essential constrains on the right hand side diagonal.
constexpr auto field_name
VectorFun< FIELD_DIM > initDispFunction(boost::shared_ptr< DisplacementCubitBcData > bc_data)
typename FormsIntegrators< OpBase >::template Assembly< A >::template BiLinearForm< I >::template OpMass< BASE_DIM, FIELD_DIM > OpMass
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Enforce essential constrains on rhs.
boost::shared_ptr< std::vector< double > > reactionPtr
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
FTensor::Index< 'j', 3 > j
LogManager::SeverityLevel sevLevel
std::vector< boost::shared_ptr< ScalingMethod > > VecOfTimeScalingMethods
Vector of time scaling methods.
Set indices on entities on finite element.
FTensor::Tensor1< double, 3 > tOffset
FTensor::Index< 'm', 3 > m
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
A specialized version of DisplacementCubitBcData that includes an additional rotation offset.
Class (Function) to enforce essential constrains.
FTensor::Index< 'k', 3 > k
#define MoFEMFunctionReturn(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 ...
boost::weak_ptr< FEMethod > fePtr
MoFEM::Interface & mField