|
| 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,
159 boost::shared_ptr<FEMethod> fe_ptr,
173 template <
int FIELD_DIM, AssemblyType A, IntegrationType I,
typename OpBase>
176 I>::template
OpSource<1, FIELD_DIM> {
182 boost::shared_ptr<DisplacementCubitBcData> bc_data,
183 boost::shared_ptr<Range> ents_ptr,
184 std::vector<boost::shared_ptr<ScalingMethod>> smv);
198 t_ret(
i) = tVal(
i) + rot(
i);
204 if (bc_data->data.flag4 || bc_data->data.flag5 || bc_data->data.flag6) {
205 return [
this](
double x,
double y,
double z) {
206 return this->rotFunction(x, y, z);
209 return [
this](
double x,
double y,
double z) {
return tVal; };
213 template <
int FIELD_DIM, AssemblyType A, IntegrationType I,
typename OpBase>
214 OpEssentialRhsImpl<DisplacementCubitBcData, 1, FIELD_DIM, A, I, OpBase>::
216 boost::shared_ptr<DisplacementCubitBcData> bc_data,
217 boost::shared_ptr<Range> ents_ptr,
218 std::vector<boost::shared_ptr<ScalingMethod>> smv)
220 vecOfTimeScalingMethods(smv) {
221 static_assert(
FIELD_DIM > 1,
"Is not implemented for scalar field");
228 if (bc_data->data.flag1 == 1)
229 tVal(0) = -bc_data->data.value1;
230 if (bc_data->data.flag2 == 1 &&
FIELD_DIM > 1)
231 tVal(1) = -bc_data->data.value2;
232 if (bc_data->data.flag3 == 1 &&
FIELD_DIM > 2)
233 tVal(2) = -bc_data->data.value3;
234 if (bc_data->data.flag4 == 1 &&
FIELD_DIM > 2)
235 tAngles(0) = -bc_data->data.value4;
236 if (bc_data->data.flag5 == 1 &&
FIELD_DIM > 2)
237 tAngles(1) = -bc_data->data.value5;
238 if (bc_data->data.flag6 == 1 &&
FIELD_DIM > 1)
239 tAngles(2) = -bc_data->data.value6;
241 if (
auto ext_bc_data =
244 for (
int a = 0;
a != 3; ++
a)
245 tOffset(
a) = ext_bc_data->rotOffset[
a];
248 this->timeScalingFun = [
this](
const double t) {
250 for (
auto &o : vecOfTimeScalingMethods) {
262 I>::template
OpMass<BASE_DIM, FIELD_DIM> {
268 boost::shared_ptr<Range> ents_ptr);
275 boost::shared_ptr<Range>
299 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
300 const std::string problem_name, std::string
field_name,
301 boost::shared_ptr<MatrixDouble> field_mat_ptr,
302 std::vector<boost::shared_ptr<ScalingMethod>> smv
312 A>::template LinearForm<I>::template OpBaseTimesVector<
BASE_DIM,
315 auto add_op = [&](
auto &bcs) {
317 for (
auto &
m : bcs) {
318 if (
auto bc =
m.second->dispBcPtr) {
319 auto &bc_id =
m.first;
321 (boost::format(
"%s_%s_(.*)") % problem_name %
field_name).str();
322 if (std::regex_match(bc_id, std::regex(regex_str))) {
328 pipeline.push_back(
new OpInternal(
330 [](
double,
double,
double) constexpr {
return 1.; },
331 m.second->getBcEntsPtr()));
361 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
362 const std::string problem_name, std::string
field_name
371 auto add_op = [&](
auto &bcs) {
373 for (
auto &
m : bcs) {
374 if (
auto bc =
m.second->dispBcPtr) {
375 auto &bc_id =
m.first;
377 (boost::format(
"%s_%s_(.*)") % problem_name %
field_name).str();
378 if (std::regex_match(bc_id, std::regex(regex_str))) {
382 pipeline.push_back(
new OP(
field_name,
m.second->getBcEntsPtr()));
399 #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.
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