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

More tests for evaluate #2

Merged
merged 22 commits into from
Jun 2, 2021
Merged

More tests for evaluate #2

merged 22 commits into from
Jun 2, 2021

Conversation

Balaje
Copy link

@Balaje Balaje commented Jun 1, 2021

Hi @santiagobadia, @ericneiva, @oriolcg and @eschnett

I am submitting a pull request after adding some more tests for evaluate. So far I have added test for:

  • Hypercubes and Simplices.
  • Evaluating at a random vertex.
  • Evaluating at a random point on the face.
  • Evaluation using CellPoint. I might require some feedback for this. I had to export make_inverse_table, point_to_cell! and distance from the implementation. I then use these functions for generating the cell_to_point map again, and pass the result to CellPoint and then to evaluate.

fhx = evaluate!(fhcache, fh, x)
@test fhx ≈ fx

for M ∈ ["Hypercubes", "Simplices"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use symbols instead of strings:

for M \in [:hypercubes, :simplices]
...
M === :hypercubes ? ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this. Waiting for @ericneiva to review the other changes.

Copy link

@ericneiva ericneiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, @Balaje. I have added some review comments. Is this branch still synchronised with gridap:master? If not, please, resynchronise.

ctype_to_polytope = map(get_polytope, ctype_to_reffe)
cell_map = get_cell_map(trian)
cache1 = kdtree, vertex_to_cells, cell_to_ctype, ctype_to_polytope, cell_map
cache1 = my_trian_data(trian)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather give a more meaningful name to my_trian_data, such as point_to_cell_cache... what do you think?

@@ -368,6 +371,18 @@ function evaluate!(cache,f::CellField,point_to_x::AbstractVector{<:Point})
collect(point_to_fx) # Collect into a plain array
end

# New CellPoint implementation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is doomed to be outdated, I would remove it. But you can (and should) inform that you have implemented this new procedure in the changelog file. Take a look at the structure of the file. What we do in a PR is to update the changelog with a summary of the changes being introduced (in the Unreleased section). I would add to the changelog that this PR adds (1) support to allow evaluation of FE functions at arbitrary points and (2) the new CellPoint implementation.

Copy link

@ericneiva ericneiva Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also remove the comments within the CellPoint(xs::AbstractVector{<:Point}, trian::Triangulation, domain_style::PhysicalDomain) implementation. The code can be understood without them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ericneiva, I have updated the PR with these changes.

@ericneiva
Copy link

ericneiva commented Jun 2, 2021

Hi @ericneiva, I have updated the PR with these changes.

Ok, thanks a lot, @Balaje. From my side, this PR is good to go.

@Balaje
Copy link
Author

Balaje commented Jun 2, 2021

Thanks so much @ericneiva

Hi, @eschnett Please merge this PR if you're happy as well. Thank you.

@eschnett eschnett merged commit 6ce661f into eschnett:eschnett/evaluate Jun 2, 2021
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

Successfully merging this pull request may close these issues.

5 participants