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
2f88e871
Commit
2f88e871
authored
7 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL] LIE/SD: Reorder if condition reducing nesting
parent
7a6a5154
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h
+37
-43
37 additions, 43 deletions
...IE/SmallDeformation/LocalAssembler/LocalDataInitializer.h
with
37 additions
and
43 deletions
ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h
+
37
−
43
View file @
2f88e871
...
@@ -244,57 +244,51 @@ public:
...
@@ -244,57 +244,51 @@ public:
auto
const
type_idx
=
std
::
type_index
(
typeid
(
mesh_item
));
auto
const
type_idx
=
std
::
type_index
(
typeid
(
mesh_item
));
auto
const
it
=
_builder
.
find
(
type_idx
);
auto
const
it
=
_builder
.
find
(
type_idx
);
if
(
it
!=
_builder
.
end
())
if
(
it
==
_builder
.
end
())
OGS_FATAL
(
"You are trying to build a local assembler for an unknown mesh "
"element type (%s)."
" Maybe you have disabled this mesh element type in your build "
"configuration or this process requires higher order elements."
,
type_idx
.
name
());
auto
const
n_local_dof
=
_dof_table
.
getNumberOfElementDOF
(
id
);
auto
const
n_global_components
=
_dof_table
.
getNumberOfElementComponents
(
id
);
auto
const
varIDs
=
_dof_table
.
getElementVariableIDs
(
id
);
std
::
vector
<
unsigned
>
dofIndex_to_localIndex
;
if
(
mesh_item
.
getDimension
()
<
GlobalDim
||
n_global_components
>
GlobalDim
)
{
{
auto
const
n_local_dof
=
_dof_table
.
getNumberOfElementDOF
(
id
);
dofIndex_to_localIndex
.
resize
(
n_local_dof
);
auto
const
n_global_components
=
unsigned
dof_id
=
0
;
_dof_table
.
getNumberOfElementComponents
(
id
);
unsigned
local_id
=
0
;
const
std
::
vector
<
int
>
varIDs
(
_dof_table
.
getElementVariableIDs
(
id
));
for
(
auto
i
:
varIDs
)
std
::
vector
<
unsigned
>
dofIndex_to_localIndex
;
if
(
mesh_item
.
getDimension
()
<
GlobalDim
||
n_global_components
>
GlobalDim
)
{
{
dofIndex_to_localIndex
.
resize
(
n_local_dof
);
for
(
int
j
=
0
;
j
<
_dof_table
.
getNumberOfVariableComponents
(
i
);
unsigned
dof_id
=
0
;
j
++
)
unsigned
local_id
=
0
;
for
(
auto
i
:
varIDs
)
{
{
for
(
int
j
=
0
;
auto
&
mss
=
_dof_table
.
getMeshSubsets
(
i
,
j
);
j
<
_dof_table
.
getNumberOfVariableComponents
(
i
);
j
++
)
assert
(
mss
.
size
()
==
1
);
auto
mesh_id
=
mss
.
getMeshSubset
(
0
).
getMeshID
();
for
(
unsigned
k
=
0
;
k
<
mesh_item
.
getNumberOfNodes
();
k
++
)
{
{
auto
&
mss
=
_dof_table
.
getMeshSubsets
(
i
,
j
);
MeshLib
::
Location
l
(
mesh_id
,
assert
(
mss
.
size
()
==
1
);
MeshLib
::
MeshItemType
::
Node
,
auto
mesh_id
=
mss
.
getMeshSubset
(
0
).
getMeshID
();
mesh_item
.
getNodeIndex
(
k
));
for
(
unsigned
k
=
0
;
k
<
mesh_item
.
getNumberOfNodes
();
auto
global_index
=
_dof_table
.
getGlobalIndex
(
l
,
i
,
j
);
k
++
)
if
(
global_index
!=
NumLib
::
MeshComponentMap
::
nop
)
{
dofIndex_to_localIndex
[
dof_id
++
]
=
local_id
;
MeshLib
::
Location
l
(
mesh_id
,
local_id
++
;
MeshLib
::
MeshItemType
::
Node
,
mesh_item
.
getNodeIndex
(
k
));
auto
global_index
=
_dof_table
.
getGlobalIndex
(
l
,
i
,
j
);
if
(
global_index
!=
NumLib
::
MeshComponentMap
::
nop
)
dofIndex_to_localIndex
[
dof_id
++
]
=
local_id
;
local_id
++
;
}
}
}
}
}
}
}
data_ptr
=
it
->
second
(
mesh_item
,
varIDs
.
size
(),
n_local_dof
,
dofIndex_to_localIndex
,
std
::
forward
<
ConstructorArgs
>
(
args
)...);
}
else
{
OGS_FATAL
(
"You are trying to build a local assembler for an unknown mesh "
"element type (%s)."
" Maybe you have disabled this mesh element type in your build "
"configuration or this process requires higher order elements."
,
type_idx
.
name
());
}
}
data_ptr
=
it
->
second
(
mesh_item
,
varIDs
.
size
(),
n_local_dof
,
dofIndex_to_localIndex
,
std
::
forward
<
ConstructorArgs
>
(
args
)...);
}
}
private
:
private
:
...
...
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