v0.14.0
Typedefs | Functions
DirichletBC.cpp File Reference
#include <MoFEM.hpp>
#include <MethodForForceScaling.hpp>
#include <DirichletBC.hpp>

Go to the source code of this file.

Typedefs

using FTensor1 = FTensor::Tensor1< double, 3 >
 

Functions

static MoFEMErrorCode set_numered_dofs_on_ents (const Problem *problem_ptr, const FieldBitNumber bit_number, Range &ents, boost::function< MoFEMErrorCode(const boost::shared_ptr< MoFEM::NumeredDofEntity > &dof)> for_each_dof)
 
auto get_rotation_from_vector (FTensor1 &t_omega)
 
auto get_displacement (VectorDouble3 &coords, FTensor1 t_centr, FTensor1 t_normal, double theta)
 

Typedef Documentation

◆ FTensor1

Definition at line 90 of file DirichletBC.cpp.

Function Documentation

◆ get_displacement()

auto get_displacement ( VectorDouble3 &  coords,
FTensor1  t_centr,
FTensor1  t_normal,
double  theta 
)
inline

Definition at line 115 of file DirichletBC.cpp.

116  {
120 
121  FTensor1 t_omega;
122  FTensor1 t_coords(coords[0], coords[1], coords[2]);
123  const double a = std::sqrt(t_normal(i) * t_normal(i));
124  t_omega(i) = t_normal(i) * (theta / a);
125  auto t_R = get_rotation_from_vector(t_omega);
126  FTensor1 t_delta, t_disp;
127  t_delta(i) = t_centr(i) - t_coords(i);
128  t_disp(i) = t_delta(i) - t_R(i, j) * t_delta(j);
129 
130  return VectorDouble({t_disp(0), t_disp(1), t_disp(2)});
131 };

◆ get_rotation_from_vector()

auto get_rotation_from_vector ( FTensor1 t_omega)
inline

Definition at line 92 of file DirichletBC.cpp.

92  {
97  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
98  t_R(i, j) = t_kd(i, j);
99 
100  const double angle = std::sqrt(t_omega(i) * t_omega(i));
101  if (std::abs(angle) < 1e-18)
102  return t_R;
103 
105  t_Omega(i, j) = FTensor::levi_civita<double>(i, j, k) * t_omega(k);
106  const double a = sin(angle) / angle;
107  const double ss_2 = sin(angle / 2.);
108  const double b = 2. * ss_2 * ss_2 / (angle * angle);
109  t_R(i, j) += a * t_Omega(i, j);
110  t_R(i, j) += b * t_Omega(i, k) * t_Omega(k, j);
111 
112  return t_R;
113 };

◆ set_numered_dofs_on_ents()

static MoFEMErrorCode set_numered_dofs_on_ents ( const Problem problem_ptr,
const FieldBitNumber  bit_number,
Range ents,
boost::function< MoFEMErrorCode(const boost::shared_ptr< MoFEM::NumeredDofEntity > &dof)>  for_each_dof 
)
static

Definition at line 11 of file DirichletBC.cpp.

15  {
17 
18  auto &dofs_by_uid = problem_ptr->getNumeredRowDofsPtr()->get<Unique_mi_tag>();
19 
20  for (auto eit = ents.pair_begin(); eit != ents.pair_end(); ++eit) {
21 
22  auto lo_dit = dofs_by_uid.lower_bound(
23  DofEntity::getLoFieldEntityUId(bit_number, eit->first));
24  auto hi_dit = dofs_by_uid.upper_bound(
25  DofEntity::getHiFieldEntityUId(bit_number, eit->second));
26 
27  for (; lo_dit != hi_dit; ++lo_dit) {
28  auto &dof = *lo_dit;
29  if (dof->getHasLocalIndex())
30  CHKERR for_each_dof(dof);
31  }
32  }
33 
35 };
FTensor::Tensor1< double, 3 >
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
FTensor::Tensor2< double, 3, 3 >
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::Problem::getNumeredRowDofsPtr
auto & getNumeredRowDofsPtr() const
get access to numeredRowDofsPtr storing DOFs on rows
Definition: ProblemsMultiIndices.hpp:82
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
get_rotation_from_vector
auto get_rotation_from_vector(FTensor1 &t_omega)
Definition: DirichletBC.cpp:92
FTensor::Index< 'i', 3 >
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEM::Unique_mi_tag
Definition: TagMultiIndices.hpp:18
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346