-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
\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); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
.
ec6186e
to
7aa8974
Compare
@@ -102,6 +102,8 @@ set( SOURCES | |||
Stiff_Bulirsch-Stoer.cpp | |||
tools.cpp | |||
vtk.cpp | |||
ShapeFunctionPool.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to HEADERS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
@wenqing This PR looks ok besides one minor comment. Have you checked why Jenkins is failing? |
@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. |
639147e
to
802dee1
Compare
Jenkins, test this please! |
…ape function calculation
@norihiro-w Rebased. |
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,
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.