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

Improvement in shape function computation #38

Merged
merged 32 commits into from
Jun 24, 2016

Conversation

wenqing
Copy link
Member

@wenqing wenqing commented Apr 27, 2016

In the previous versions, the computations of shape functions are conducted within the local assembly over each element, which is redundant for the elements with the same type.

In this PR, a class is introduced for computing shape functions N and their derivatives with respect to the local coordinates d N /d xi. The class is used to compute N and d N /d xi at each integration points of all involved element types in a FEM computation, and it also holds all the computation results for later usage in the process of Neumann BC and the local assembly. During the local assembly, the derivatives of shape functions with respect to the global local coordinates are computed and cached before any numerical integration happens. By this way,

  • the redundancy in the shape function computation is reduced significantly,
  • the associated memory usage is less.

For the problem with big mesh or many time steps, the speedup of this improvement vs the previous versions could be distinct (20% has been reported).

Since all local shape function computations have been replaced with the cached data acquisition, all benchmarks give tiny errors in their results against to that obtained by the previous versions.

\param num_sample_gs_pnts Number of sample Gauss points.
*/
ShapeFunctionPool(const std::vector<MshElemType::type>& elem_types,
CElement& quadrature, const int num_sample_gs_pnts);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is CElement object named quadrature?

Copy link
Member Author

Choose a reason for hiding this comment

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

The name of CElement is not proper, the class actually provides the computation of shape functions and their derivatives etc. Therefore I the second argument is named as quadrature.

@wenqing wenqing force-pushed the shapefct_cache branch 3 times, most recently from ec6186e to 7aa8974 Compare April 29, 2016 14:34
@@ -102,6 +102,8 @@ set( SOURCES
Stiff_Bulirsch-Stoer.cpp
tools.cpp
vtk.cpp
ShapeFunctionPool.h
Copy link
Contributor

Choose a reason for hiding this comment

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

move this to HEADERS

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed.

@norihiro-w
Copy link
Contributor

@wenqing This PR looks ok besides one minor comment. Have you checked why Jenkins is failing?

@wenqing
Copy link
Member Author

wenqing commented May 2, 2016

@norihiro-w Jenkin falied in the result comparison. Almost all results of the benchmarks have tiny difference against their references. I have checked these results, which look good. I wonder whether we should ask the people in charge of the benchmarks for a quick verification.

@norihiro-w
Copy link
Contributor

Jenkins, test this please!

wenqing added 27 commits June 24, 2016 12:54
@wenqing
Copy link
Member Author

wenqing commented Jun 24, 2016

@norihiro-w Rebased.

@norihiro-w norihiro-w merged commit 730a841 into ufz:master Jun 24, 2016
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.

3 participants