Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
737cc687
Commit
737cc687
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
Added function for shape matrix interpolation.
parent
9abce56f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NumLib/Function/Interpolation.h
+43
-0
43 additions, 0 deletions
NumLib/Function/Interpolation.h
with
43 additions
and
0 deletions
NumLib/Function/Interpolation.h
0 → 100644
+
43
−
0
View file @
737cc687
#ifndef NUMLIB_INTERPOLATION_H
#define NUMLIB_INTERPOLATION_H
namespace
NumLib
{
/**
* Interpolates variables given at element nodes according to the given shape matrix.
*
* This function simply does the usual finite-element interpolation, i.e. multiplication
* of nodal values with the shape function.
*
* @param nodal_values vector of nodal values
* @param shape_matrix_N shape matrix of the point to which will be interpolated
* @param num_nodal_dof number of nodal variables that will be interpolated
* @param interpolated_values array of addresses to which the interpolated values will be written
*
* The size of interpolated_values must be equal to num_nodal_dof.
*/
template
<
typename
NodalValues
,
typename
ShapeMatrix
>
void
shapeFunctionInterpolate
(
const
NodalValues
&
nodal_values
,
const
ShapeMatrix
&
shape_matrix_N
,
const
unsigned
num_nodal_dof
,
double
**
interpolated_values
)
{
auto
const
num_nodes
=
shape_matrix_N
.
size
();
for
(
unsigned
d
=
0
;
d
<
num_nodal_dof
;
++
d
)
{
*
interpolated_values
[
d
]
=
0.0
;
for
(
unsigned
n
=
0
;
n
<
num_nodes
;
++
n
)
{
*
interpolated_values
[
d
]
+=
nodal_values
[
d
*
num_nodes
+
n
]
*
shape_matrix_N
(
n
);
}
}
}
}
#endif // NUMLIB_INTERPOLATION_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment