Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error calling the Objects::PlaneDistances in ASPECT program #615

Open
lhy11009 opened this issue Feb 15, 2024 · 1 comment
Open

Error calling the Objects::PlaneDistances in ASPECT program #615

lhy11009 opened this issue Feb 15, 2024 · 1 comment

Comments

@lhy11009
Copy link
Contributor

Calling the Objects::PlaneDistances from WorldBuilder to determine particle distance to a slab surface in ASPECT
(described in #534)

An error is triggered by calling the PlaneDistances function.
This is part of the feature in PR #453.
Previously (version 0.5) it works fine.

Objects::PlaneDistances
World::distance_to_plane(const std::array<double, 3> &point_,
                         const double depth,
                         const std::string &name) const

Here is the error message:

Exception on rank 0 on processing:
Assert `!this->limit_debug_consistency_checks || this->parameters.coordinate_system->natural_coordinate_system() == cartesian || 
approx(depth, this->parameters.coordinate_system->max_model_depth()-
sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2]))` failed in 
/home/lochy/Softwares/WorldBuilder/source/world_builder/world.cc at line 448: Inconsistent input. Please check whether the radius in 
the sperhical coordinates is consistent with the radius of the planet as defined in the program that uses the Geodynamic World Builder. 
Depth = 0, radius = 6.371e+06, point = 2.44336e+06 5.88385e+06 0, radius-point.norm() = 9.31323e-10

It's still confusing why this error is triggered as the differences between radius and point.norm() is already small (9.31323e-10).

@MFraters
Copy link
Member

We can add a larger error factor. The default is 1e4. The function which does the check is here:

inline bool approx(double a, double b, double error_factor=1e4)
{
return std::abs(a-b)<std::abs(std::min(a,b))*std::numeric_limits<double>::epsilon()*
error_factor;
}
.

You can overwrite the default value in the function. Can you try out what value you would need (for both the properties and distance_to_plane function)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants