Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
78246216
There was an error fetching the commit references. Please try again later.
Commit
78246216
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Optimized smart pointers in MatrixSetter
parent
5ce9ef29
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Matrices/MatrixSetter.h
+19
-23
19 additions, 23 deletions
src/TNL/Matrices/MatrixSetter.h
src/TNL/Matrices/MatrixSetter_impl.h
+5
-3
5 additions, 3 deletions
src/TNL/Matrices/MatrixSetter_impl.h
with
24 additions
and
26 deletions
src/TNL/Matrices/MatrixSetter.h
+
19
−
23
View file @
78246216
...
...
@@ -21,24 +21,20 @@ class MatrixSetterTraversalUserData
public:
typedef
typename
CompressedRowsLengthsVector
::
DeviceType
DeviceType
;
typedef
SharedPointer
<
DifferentialOperator
,
DeviceType
>
DifferentialOperatorPointer
;
typedef
SharedPointer
<
BoundaryConditions
,
DeviceType
>
BoundaryConditionsPointer
;
typedef
SharedPointer
<
CompressedRowsLengthsVector
,
DeviceType
>
CompressedRowsLengthsVectorPointer
;
const
DifferentialOperator
*
differentialOperator
;
const
DifferentialOperatorPointer
differentialOperatorPointer
;
const
BoundaryConditions
*
boundaryConditions
;
const
BoundaryConditionsPointer
boundaryConditionsPointer
;
CompressedRowsLengthsVector
*
rowLengths
;
CompressedRowsLengthsVectorPointer
rowLengthsPointer
;
MatrixSetterTraversalUserData
(
const
DifferentialOperatorPointer
&
differentialOperatorPointer
,
const
BoundaryConditionsPointer
&
boundaryConditionsPointer
,
CompressedRowsLengthsVectorPointer
&
rowLengthsPointer
)
:
differentialOperatorPointer
(
differentialOperatorPointer
),
boundaryConditionsPointer
(
boundaryConditionsPointer
),
rowLengthsPointer
(
rowLengthsPointer
)
{};
MatrixSetterTraversalUserData
(
const
DifferentialOperator
*
differentialOperator
,
const
BoundaryConditions
*
boundaryConditions
,
CompressedRowsLengthsVector
*
rowLengths
)
:
differentialOperator
(
differentialOperator
),
boundaryConditions
(
boundaryConditions
),
rowLengths
(
rowLengths
)
{}
};
...
...
@@ -54,17 +50,17 @@ class MatrixSetter
typedef
typename
MeshType
::
DeviceType
DeviceType
;
typedef
typename
CompressedRowsLengthsVector
::
RealType
IndexType
;
typedef
MatrixSetterTraversalUserData
<
DifferentialOperator
,
BoundaryConditions
,
CompressedRowsLengthsVector
>
TraversalUserData
;
BoundaryConditions
,
CompressedRowsLengthsVector
>
TraversalUserData
;
typedef
SharedPointer
<
DifferentialOperator
,
DeviceType
>
DifferentialOperatorPointer
;
typedef
SharedPointer
<
BoundaryConditions
,
DeviceType
>
BoundaryConditionsPointer
;
typedef
SharedPointer
<
CompressedRowsLengthsVector
,
DeviceType
>
CompressedRowsLengthsVectorPointer
;
template
<
typename
EntityType
>
void
getCompressedRowsLengths
(
const
MeshPointer
&
meshPointer
,
DifferentialOperatorPointer
&
differentialOperatorPointer
,
BoundaryConditionsPointer
&
boundaryConditionsPointer
,
CompressedRowsLengthsVectorPointer
&
rowLengthsPointer
)
const
;
const
DifferentialOperatorPointer
&
differentialOperatorPointer
,
const
BoundaryConditionsPointer
&
boundaryConditionsPointer
,
CompressedRowsLengthsVectorPointer
&
rowLengthsPointer
)
const
;
class
TraversalBoundaryEntitiesProcessor
{
...
...
@@ -76,8 +72,8 @@ class MatrixSetter
TraversalUserData
&
userData
,
const
EntityType
&
entity
)
{
userData
.
rowLengths
Pointer
.
template
modifyData
<
DeviceType
>(
)[
entity
.
getIndex
()
]
=
userData
.
boundaryConditions
Pointer
.
template
getData
<
DeviceType
>().
getLinearSystemRowLength
(
mesh
,
entity
.
getIndex
(),
entity
);
(
*
userData
.
rowLengths
)[
entity
.
getIndex
()
]
=
userData
.
boundaryConditions
->
getLinearSystemRowLength
(
mesh
,
entity
.
getIndex
(),
entity
);
}
};
...
...
@@ -92,8 +88,8 @@ class MatrixSetter
TraversalUserData
&
userData
,
const
EntityType
&
entity
)
{
userData
.
rowLengths
Pointer
.
template
modifyData
<
DeviceType
>(
)[
entity
.
getIndex
()
]
=
userData
.
differentialOperator
Pointer
.
template
getData
<
DeviceType
>().
getLinearSystemRowLength
(
mesh
,
entity
.
getIndex
(),
entity
);
(
*
userData
.
rowLengths
)[
entity
.
getIndex
()
]
=
userData
.
differentialOperator
->
getLinearSystemRowLength
(
mesh
,
entity
.
getIndex
(),
entity
);
}
};
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Matrices/MatrixSetter_impl.h
+
5
−
3
View file @
78246216
...
...
@@ -23,12 +23,14 @@ template< typename Mesh,
void
MatrixSetter
<
Mesh
,
DifferentialOperator
,
BoundaryConditions
,
CompressedRowsLengthsVector
>::
getCompressedRowsLengths
(
const
MeshPointer
&
meshPointer
,
DifferentialOperatorPointer
&
differentialOperatorPointer
,
BoundaryConditionsPointer
&
boundaryConditionsPointer
,
const
DifferentialOperatorPointer
&
differentialOperatorPointer
,
const
BoundaryConditionsPointer
&
boundaryConditionsPointer
,
CompressedRowsLengthsVectorPointer
&
rowLengthsPointer
)
const
{
{
TraversalUserData
userData
(
differentialOperatorPointer
,
boundaryConditionsPointer
,
rowLengthsPointer
);
TraversalUserData
userData
(
&
differentialOperatorPointer
.
template
getData
<
DeviceType
>(),
&
boundaryConditionsPointer
.
template
getData
<
DeviceType
>(),
&
rowLengthsPointer
.
template
modifyData
<
DeviceType
>()
);
Meshes
::
Traverser
<
MeshType
,
EntityType
>
meshTraversal
;
meshTraversal
.
template
processBoundaryEntities
<
TraversalUserData
,
TraversalBoundaryEntitiesProcessor
>
...
...
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