48 static Tensor2<double, 3, 3>
Omega;
49 static Tensor4<double, 3, 3, 3, 3>
Is;
65 template <
typename T1,
typename T2>
68 std::vector<double> gaps;
71 auto t_normal = roller.getNormal(t_coords, t_disp);
72 double dist = roller.getGap(t_coords);
76 auto it = std::min_element(gaps.begin(), gaps.end());
77 auto nb = distance(gaps.begin(), it);
109 CHKERR PetscOptionsInsertString(
110 NULL,
"-mat_mumps_icntl_14 1200 -mat_mumps_icntl_24 1 "
111 "-mat_mumps_icntl_13 1 -mat_mumps_icntl_20 0");
113 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"",
"none");
116 CHKERR PetscOptionsGetRealArray(NULL, NULL,
"-gravity",
gravity.data(),
117 &nb_ent_grav, PETSC_NULL);
122 CHKERR PetscOptionsScalar(
"-poisson",
"Poisson ratio",
"",
poisson,
127 PetscBool with_contact = PETSC_FALSE;
128 CHKERR PetscOptionsBool(
"-with_contact",
"run calculations with contact",
129 "", with_contact, &with_contact, PETSC_NULL);
131 double rot_vec[3] = {0, 0, 1};
133 PetscBool is_rotating;
135 CHKERR PetscOptionsGetRealArray(NULL, NULL,
"-rot_omega", rot_vec, &nb_ent,
137 if (nb_ent < 3 && is_rotating) {
139 "provide an appropriate number of entries for omega vector (3)");
144 Omega(
i,
k) = levi_civita<double>(
i,
j,
k) * t1_omega(
j);
149 "poisson ratio value not supported");
151 CHKERR PetscOptionsScalar(
"-sigmaY",
"SigmaY - limit stress",
"",
sigmaY,
153 CHKERR PetscOptionsScalar(
"-H",
"Hardening modulus",
"",
H, &
H, PETSC_NULL);
154 CHKERR PetscOptionsScalar(
"-cn_pl",
155 "cn_pl parameter for active set constrains",
"",
157 CHKERR PetscOptionsScalar(
"-scale_constraint",
"constraint scale",
"",
159 CHKERR PetscOptionsScalar(
"-C1_k",
"1st Backstress",
"",
C1_k, &
C1_k,
163 CHKERR PetscOptionsScalar(
"-b_iso",
"Isotropic exponent",
"",
b_iso, &
b_iso,
165 CHKERR PetscOptionsScalar(
"-visH",
"viscous hardening",
"",
visH, &
visH,
168 CHKERR PetscOptionsScalar(
"-spring",
169 "Springs stiffness on the boundary (contact)",
"",
172 CHKERR PetscOptionsScalar(
"-cn_cont",
173 "cn_cont parameter for active set constrains",
"",
175 CHKERR PetscOptionsScalar(
176 "-rollers_stop",
"Time at which rollers will stop moving",
"",
179 constexpr int MAX_NB_OF_ROLLERS = 10;
182 const char *body_list[] = {
"plane",
"sphere",
"cylinder",
"cone",
183 "torus",
"roller",
"stl",
"nurbs"};
184 for (
int ii = 0; ii < MAX_NB_OF_ROLLERS; ++ii) {
188 VectorDouble center_coords({0, 0, 0});
189 VectorDouble disp({0, 0, 0});
191 PetscBool flg = PETSC_FALSE;
193 string param =
"-body" + to_string(ii);
198 CHKERR PetscOptionsGetEList(PETSC_NULL, NULL, param.c_str(), body_list,
201 param =
"-coords" + to_string(ii);
202 CHKERR PetscOptionsGetRealArray(NULL, NULL, param.c_str(),
203 ¢er_coords(0), &nb_coord, &rflg);
204 param =
"-move" + to_string(ii);
205 CHKERR PetscOptionsGetRealArray(NULL, NULL, param.c_str(), &disp(0),
208 switch (body_type_id) {
241 CHKERR rol.getBodyOptions();
243 char pos_data_file[255];
244 PetscBool ctg_flag = PETSC_FALSE;
245 param =
"-position_data" + to_string(ii);
246 CHKERR PetscOptionsString(param.c_str(),
"",
"",
"", pos_data_file, 255,
249 rol.methodOpForRollerPosition =
250 boost::make_shared<TimeAccelerogram>(
string(param));
251 rol.originCoords.clear();
252 rol.rollerDisp.clear();
255 param =
"-direction_data" + to_string(ii);
256 CHKERR PetscOptionsString(param.c_str(),
"",
"",
"", pos_data_file, 255,
259 rol.methodOpForRollerDirection =
260 boost::make_shared<TimeAccelerogram>(
string(param));
261 rol.BodyDirectionScaled = VectorDouble({0, 0, 0});
269 "provide at least one body data for contact (-body1 "
270 "sphere -radius r and opional -move x,y) ");
274 ierr = PetscOptionsEnd();
302extern std::map<int, BlockParamData>
mat_blocks;
static PetscErrorCode ierr
#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 ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
const double c
speed of light (cm/ns)
MoFEMErrorCode scaleParameters()
MoFEMErrorCode getOptionsFromCommandLine()
static Tensor4< double, 3, 3, 3, 3 > Is
virtual MoFEMErrorCode scaleParameters()=0
static vector< double > gravity
static double spring_stiffness
static int closest_roller_id
static Tensor1< double, 3 > omega
static Tensor2< double, 3, 3 > Omega
static RigidBodyData * closest_roller
int getClosestRollerID(Tensor1< T1, 3 > &t_coords, Tensor1< T2, 3 > &t_disp)
static boost::ptr_vector< RigidBodyData > rollerDataVec
DataFromMove(size_t c, VectorDouble val, Range ents_bc)
VectorDouble scaledValues
DataFromMove(VectorDouble val, Range ents_bc)
LoadScale(double &my_scale)
MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &nf)
Class used to scale loads, f.e. in arc-length control.