37 for (
size_t s = 0; s < d_bcData.size(); s++) {
40 const auto &bc = d_bcData[s];
47 auto reg_box = bc.d_regionGeomData.d_geom_p ==
nullptr ? std::pair<util::Point, util::Point>(
util::Point(),
util::Point()) : bc.d_regionGeomData.d_geom_p->box();
49 for (
size_t i = 0; i <
particle->getNumNodes(); i++) {
51 const auto x =
particle->getXRefLocal(i);
55 if (!bc.d_isRegionActive) {
63 if (bc.d_spatialFnType ==
"hat_x") {
64 fmax = bc.d_spatialFnParams[0] *
67 }
else if (bc.d_spatialFnType ==
"hat_y") {
68 fmax = bc.d_spatialFnParams[0] *
71 }
else if (bc.d_spatialFnType ==
"sin_x") {
72 double a = M_PI * bc.d_spatialFnParams[0];
73 fmax = bc.d_spatialFnParams[0] * std::sin(a * x.d_x);
74 }
else if (bc.d_spatialFnType ==
"sin_y") {
75 double a = M_PI * bc.d_spatialFnParams[0];
76 fmax = bc.d_spatialFnParams[0] * std::sin(a * x.d_y);
77 }
else if (bc.d_spatialFnType ==
"linear_x") {
78 double a = bc.d_spatialFnParams[0];
79 fmax = bc.d_spatialFnParams[0] * a * x.d_x;
80 }
else if (bc.d_spatialFnType ==
"linear_y") {
81 double a = bc.d_spatialFnParams[0];
82 fmax = bc.d_spatialFnParams[0] * a * x.d_y;
86 if (bc.d_timeFnType ==
"linear")
88 else if (bc.d_timeFnType ==
"linear_step")
90 bc.d_timeFnParams[2]);
91 else if (bc.d_timeFnType ==
"linear_slow_fast") {
93 fmax *= bc.d_timeFnParams[3] * time;
95 fmax *= bc.d_timeFnParams[2] * time;
96 }
else if (bc.d_timeFnType ==
"sin") {
97 double a = M_PI * bc.d_timeFnParams[1];
98 fmax *= std::sin(a * time);
102 fmax *= bc.d_timeFnParams[0];
105 for (
auto d : bc.d_direction) {
void apply(const double &time, particle::BaseParticle *particle)
Applies force boundary condition.
ParticleFLoading(std::vector< inp::BCBaseDeck > &bc_data)
Constructor.
std::vector< inp::BCBaseDeck > d_bcData
List of displacement bcs.
A class to store particle geometry, nodal discretization, and methods.
bool isInList(const size_t &i, const std::vector< size_t > &list)
bool needToComputeDof(const util::Point &x, size_t id, const inp::BCBaseDeck &bc)
Function that checks if we need to do computation at a given point x within a particle with id = id.
Collection of methods and data related to particle object.