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

Add PointCloud spatial distribution #3161

Merged
merged 40 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c427b88
Add PointCloud spatial distribution
gonuke Oct 5, 2024
93afabf
clang-format
gonuke Oct 5, 2024
954191d
PointCloud should be handled like a standard IndependentSource in set…
gonuke Oct 5, 2024
2077a35
clean up reference to mesh info in PointCloud
gonuke Oct 5, 2024
74532a7
missing commas
gonuke Oct 5, 2024
0c78f39
add missing function declaration
gonuke Oct 5, 2024
a50d7af
dumb typo
gonuke Oct 5, 2024
733337d
remove stale enumeration
gonuke Oct 5, 2024
3138b92
another dumb typo
gonuke Oct 5, 2024
27ce9fc
testing object equivalence is invalid
gonuke Oct 5, 2024
bbb2d4b
add input stream operator for Position
gonuke Oct 11, 2024
3f6e5e3
update XML of list of positions to be flattened list of coords
gonuke Oct 11, 2024
3a5a9e6
fix constructor arguments
gonuke Oct 11, 2024
c016666
linting
gonuke Oct 11, 2024
f8933d7
back away from istream operator for Position
gonuke Oct 12, 2024
85663d3
I forgot to store the position data
gonuke Oct 12, 2024
d8a0fd7
Create a new XML function for reading a flat set of Positions from an…
pshriwise Oct 15, 2024
2c7eb6c
Adding check for source strengths based using sampled source
pshriwise Oct 15, 2024
7f2b39a
C++ formatting
pshriwise Oct 15, 2024
3641f99
PEP8
pshriwise Oct 15, 2024
5fafc7d
Use a simpler model to cut down on initialization time. Increase tole…
pshriwise Oct 16, 2024
ed3b1d3
grammar fix
gonuke Oct 17, 2024
f4b5901
improve comment grammar
gonuke Oct 17, 2024
3dd55a7
capitalization standard
gonuke Oct 17, 2024
d9ca528
remove extra blank line
gonuke Oct 17, 2024
ea462a9
improve error message
gonuke Oct 17, 2024
3487966
only get coords once with new XML function
gonuke Oct 21, 2024
cbe2058
remove extra blank line for formatting
gonuke Oct 21, 2024
8c7aa8a
allow existing variable checking to throw error
gonuke Oct 21, 2024
3528f3d
remove this file from the PR
gonuke Oct 21, 2024
8ab1dbb
add point cloud to settings docs and add missing mesh spatial info
gonuke Oct 21, 2024
b8d7f7f
clarify that volume_normalized is optional and default false
gonuke Oct 21, 2024
43efcf4
Update docs/source/io_formats/settings.rst
gonuke Oct 21, 2024
25c4f63
Refactor PointCloud constructor a bit
pshriwise Oct 21, 2024
b6c5c9e
Save a live; save a life
pshriwise Oct 21, 2024
603131f
Updatest test_point_cloud to catch error
paulromano Nov 13, 2024
8bb6dd7
Simplify PointCloud C++ implementation
paulromano Nov 13, 2024
8462db7
Update docs
paulromano Nov 13, 2024
42eb127
Make fixes and add typing in PointCloud Python class
paulromano Nov 13, 2024
66c57d1
Add test for invalid input to PointCloud
paulromano Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/distribution_spatial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,25 +306,25 @@ Position MeshSpatial::sample(uint64_t* seed) const

PointCloud::PointCloud(pugi::xml_node node)
{
std::vector<double> coords;

if (check_for_node(node, "coords")) {
point_cloud_ = get_node_position_array(node, "coords");
} else {
fatal_error("No coordinates were provided for the PointCloud "
"spatial distribution");
}

std::vector<double> strengths(point_cloud_.size(), 1.0);
std::vector<double> strengths;
pshriwise marked this conversation as resolved.
Show resolved Hide resolved

if (check_for_node(node, "strengths")) {
if (check_for_node(node, "strengths"))
strengths = get_node_array<double>(node, "strengths");
if (strengths.size() != point_cloud_.size()) {
fatal_error(
fmt::format("Number of entries for the strengths array {} does "
"not match the number of spatial points provided {}.",
strengths.size(), point_cloud_.size()));
}
else
strengths.resize(point_cloud_.size(), 1.0);

if (strengths.size() != point_cloud_.size()) {
fatal_error(
fmt::format("Number of entries for the strengths array {} does "
"not match the number of spatial points provided {}.",
strengths.size(), point_cloud_.size()));
}
pshriwise marked this conversation as resolved.
Show resolved Hide resolved

point_idx_dist_.assign(strengths);
Expand Down