26 check_required_keys({
"xu",
"yu",
"zu"});
30 el_box->check_required_keys({
"lo_x",
"lo_y",
"lo_z",
"hi_x",
"hi_y",
"hi_z"});
32 auto &box = el_box->get_data();
35 offset << box[
"lo_x"], box[
"lo_y"], box[
"lo_z"];
38 length << box[
"hi_x"], box[
"hi_y"], box[
"hi_z"];
44 unwrapped << d[
"xu"], d[
"yu"], d[
"zu"];
46 ArrayXd tmp_wrapped = unwrapped;
48 tmp_wrapped -= offset;
49 tmp_wrapped /= length;
51 tmp_wrapped = -tmp_wrapped.floor();
52 tmp_wrapped *= length;
53 tmp_wrapped += unwrapped;
55 d[
"x"] = tmp_wrapped(0);
56 d[
"y"] = tmp_wrapped(1);
57 d[
"z"] = tmp_wrapped(2);
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
std::function< bool(const Json &)> JsonToBoolFunc
An alias for a function accepts a Json object and returns a bool.
This file has a definition of AddWrappedPosition class, which is a subclass of Adder class...
AddWrappedPosition(const ElPtr &elem)
Constructor of AddWrappedPosition class.
nlohmann::json Json
Json is an alias for nlohmann::json.
ShPtr< Generator > ext_generator
virtual void compute_impl(Json &data, JsonToVoidFunc check_required_keys, JsonToBoolFunc check_optional_keys) override
This method overrides Updater::compute_impl.
Eigen::Array< double, Eigen::Dynamic, 1 > ArrayXd
ArrayXd is an alias for a column array of float numbers.
std::function< void(const Json &)> JsonToVoidFunc
An alias for a function accepts a Json object.