Skip to content

Improvement in shape function computation - #38

Merged
norihiro-w merged 32 commits into
ufz:masterfrom
wenqing:shapefct_cache
Jun 24, 2016
Merged

norihiro-w merged 32 commits into
ufz:masterfrom
wenqing:shapefct_cache

Conversation

@wenqing

@wenqing wenqing commented Apr 27, 2016

Copy link
Copy Markdown
Member

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.

Comment thread FEM/ShapeFunctionPool.h Outdated
\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
Copy Markdown
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
Copy Markdown
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
Comment thread FEM/CMakeLists.txt Outdated
Stiff_Bulirsch-Stoer.cpp
tools.cpp
vtk.cpp
ShapeFunctionPool.h

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@wenqing

wenqing commented May 2, 2016

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Contributor

Jenkins, test this please!

wenqing added 27 commits June 24, 2016 12:54
@wenqing

wenqing commented Jun 24, 2016

Copy link
Copy Markdown
Member Author

@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