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
Özgür Ozan Sen
ogs
Commits
00f3e84f
Commit
00f3e84f
authored
2 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL/Refl] Extract common code
parent
74a7fb21
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
ProcessLib/Reflection/ReflectionIPData.h
+16
-50
16 additions, 50 deletions
ProcessLib/Reflection/ReflectionIPData.h
with
16 additions
and
50 deletions
ProcessLib/Reflection/ReflectionIPData.h
+
16
−
50
View file @
00f3e84f
...
@@ -120,44 +120,27 @@ struct GetFlattenedIPDataFromLocAsm
...
@@ -120,44 +120,27 @@ struct GetFlattenedIPDataFromLocAsm
IPDataVectorElement
const
&>>
;
IPDataVectorElement
const
&>>
;
constexpr
unsigned
num_comp
=
NumberOfComponents
<
ConcreteIPData
>::
value
;
constexpr
unsigned
num_comp
=
NumberOfComponents
<
ConcreteIPData
>::
value
;
auto
const
&
ip_data_vector
=
accessor_ip_data_vec_in_loc_asm
(
loc_asm
);
auto
const
num_ips
=
ip_data_vector
.
size
();
if
constexpr
(
num_comp
==
1
)
std
::
vector
<
double
>
result
(
num_comp
*
num_ips
);
{
auto
const
&
ip_data_vector
=
accessor_ip_data_vec_in_loc_asm
(
loc_asm
);
auto
const
num_ips
=
ip_data_vector
.
size
();
std
::
vector
<
double
>
result
(
num_ips
);
for
(
std
::
size_t
ip
=
0
;
ip
<
num_ips
;
++
ip
)
{
auto
const
&
ip_data_vector_element
=
ip_data_vector
[
ip
];
auto
const
&
ip_data
=
accessor_current_level_from_ip_data_vec_element
(
ip_data_vector_element
);
// TODO optimization if nothing needs to be copied?
if
constexpr
(
num_comp
==
1
)
for
(
std
::
size_t
ip
=
0
;
ip
<
num_ips
;
++
ip
)
{
{
auto
const
&
ip_data_vector_element
=
ip_data_vector
[
ip
];
// TODO optimization if nothing needs to be copied?
auto
const
&
ip_data
=
accessor_current_level_from_ip_data_vec_element
(
ip_data_vector_element
);
result
[
ip
]
=
ip_data
;
result
[
ip
]
=
ip_data
;
}
}
else
if
constexpr
(
num_comp
==
return
result
;
MathLib
::
KelvinVector
::
kelvin_vector_dimensions
(
}
Dim
))
else
if
constexpr
(
num_comp
==
MathLib
::
KelvinVector
::
kelvin_vector_dimensions
(
Dim
))
{
auto
const
&
ip_data_vector
=
accessor_ip_data_vec_in_loc_asm
(
loc_asm
);
auto
const
num_ips
=
ip_data_vector
.
size
();
std
::
vector
<
double
>
result
(
num_comp
*
num_ips
);
for
(
std
::
size_t
ip
=
0
;
ip
<
num_ips
;
++
ip
)
{
{
auto
const
&
ip_data_vector_element
=
ip_data_vector
[
ip
];
auto
const
&
ip_data
=
accessor_current_level_from_ip_data_vec_element
(
ip_data_vector_element
);
auto
const
converted
=
auto
const
converted
=
MathLib
::
KelvinVector
::
kelvinVectorToSymmetricTensor
(
MathLib
::
KelvinVector
::
kelvinVectorToSymmetricTensor
(
ip_data
);
ip_data
);
...
@@ -167,32 +150,15 @@ struct GetFlattenedIPDataFromLocAsm
...
@@ -167,32 +150,15 @@ struct GetFlattenedIPDataFromLocAsm
result
[
ip
*
num_comp
+
comp
]
=
converted
[
comp
];
result
[
ip
*
num_comp
+
comp
]
=
converted
[
comp
];
}
}
}
}
else
return
result
;
}
else
{
auto
const
&
ip_data_vector
=
accessor_ip_data_vec_in_loc_asm
(
loc_asm
);
auto
const
num_ips
=
ip_data_vector
.
size
();
std
::
vector
<
double
>
result
(
num_comp
*
num_ips
);
for
(
std
::
size_t
ip
=
0
;
ip
<
num_ips
;
++
ip
)
{
{
auto
const
&
ip_data_vector_element
=
ip_data_vector
[
ip
];
auto
const
&
ip_data
=
accessor_current_level_from_ip_data_vec_element
(
ip_data_vector_element
);
for
(
unsigned
comp
=
0
;
comp
<
num_comp
;
++
comp
)
for
(
unsigned
comp
=
0
;
comp
<
num_comp
;
++
comp
)
{
{
result
[
ip
*
num_comp
+
comp
]
=
ip_data
[
comp
];
result
[
ip
*
num_comp
+
comp
]
=
ip_data
[
comp
];
}
}
}
}
return
result
;
}
}
return
result
;
}
}
};
};
...
...
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