Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
a4b9162a
Commit
a4b9162a
authored
Nov 17, 2016
by
GILLES Sebastien
Browse files
#1053
Rewrite a bit more cleverly the anonymous function.
parent
ad65860d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Sources/Test/Operators/NonConformInterpolator/FromVertexMatching/CheckInterpolator.cpp
View file @
a4b9162a
...
...
@@ -36,13 +36,18 @@ namespace HappyHeart
result_type
&
result
);
result_type
PerformComputationForNumberingSubset
(
const
GodOfDof
&
god_of_dof
,
const
PostProcessingNS
::
PostProcessing
&
post_processing
,
NumberingSubsetIndex
numbering_subset
);
}
// namespace anonymous
void
CheckInterpolator
(
const
Model
&
model
)
{
decltype
(
auto
)
mpi
=
model
.
MpiHappyHeart
();
decltype
(
auto
)
god_of_dof_manager
=
GodOfDofManager
::
GetInstance
();
decltype
(
auto
)
solid_god_of_dof
=
god_of_dof_manager
.
GetGodOfDof
(
EnumUnderlyingType
(
MeshIndex
::
solid
));
...
...
@@ -61,83 +66,70 @@ namespace HappyHeart
EnumUnderlyingType
(
NumberingSubsetIndex
::
pressure_on_solid
)
},
solid_god_of_dof
.
GetGeometricMeshRegion
());
const
auto
Nprocessor
=
mpi
.
template
Nprocessor
<
unsigned
int
>();
result_type
velocity_on_fluid_content
=
PerformComputationForNumberingSubset
(
fluid_god_of_dof
,
fluid_post_processing
,
NumberingSubsetIndex
::
velocity_on_fluid
);
result_type
velocity
_on_fluid_content
;
result_type
velocity_on_solid_content
;
result_type
pressure_on_fluid_content
;
result_type
pressure_on_solid_content
;
result_type
pressure
_on_fluid_content
=
PerformComputationForNumberingSubset
(
fluid_god_of_dof
,
fluid_post_processing
,
NumberingSubsetIndex
::
pressure_on_fluid
)
;
velocity_on_
flu
id_content
.
max_load_factor
(
Utilities
::
DefaultMaxLoadFactor
());
velocity_on_solid_content
.
max_load_factor
(
Utilities
::
DefaultMaxLoadFactor
());
pressure_on_fluid_content
.
max_load_factor
(
Utilities
::
DefaultMaxLoadFactor
());
pressure_on_solid_content
.
max_load_factor
(
Utilities
::
DefaultMaxLoadFactor
()
);
result_type
velocity_on_
sol
id_content
=
PerformComputationForNumberingSubset
(
solid_god_of_dof
,
solid_post_processing
,
NumberingSubsetIndex
::
velocity_on_solid
);
velocity_on_fluid_content
.
reserve
(
fluid_god_of_dof
.
NprogramWiseDof
(
fluid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
velocity_on_fluid
))));
velocity_on_solid_content
.
reserve
(
solid_god_of_dof
.
NprogramWiseDof
(
solid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
velocity_on_solid
))));
pressure_on_fluid_content
.
reserve
(
fluid_god_of_dof
.
NprogramWiseDof
(
fluid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
pressure_on_fluid
))));
pressure_on_solid_content
.
reserve
(
solid_god_of_dof
.
NprogramWiseDof
(
solid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
pressure_on_solid
))));
for
(
auto
rank
=
0u
;
rank
<
Nprocessor
;
++
rank
)
{
PerformComputationForRankAndNumberingSubset
(
fluid_post_processing
,
rank
,
NumberingSubsetIndex
::
velocity_on_fluid
,
velocity_on_fluid_content
);
PerformComputationForRankAndNumberingSubset
(
fluid_post_processing
,
rank
,
NumberingSubsetIndex
::
pressure_on_fluid
,
pressure_on_fluid_content
);
PerformComputationForRankAndNumberingSubset
(
solid_post_processing
,
rank
,
NumberingSubsetIndex
::
velocity_on_solid
,
velocity_on_solid_content
);
PerformComputationForRankAndNumberingSubset
(
solid_post_processing
,
rank
,
NumberingSubsetIndex
::
pressure_on_solid
,
pressure_on_solid_content
);
}
assert
(
velocity_on_fluid_content
.
size
()
==
fluid_god_of_dof
.
NprogramWiseDof
(
fluid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
velocity_on_fluid
))));
assert
(
velocity_on_solid_content
.
size
()
==
solid_god_of_dof
.
NprogramWiseDof
(
solid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
velocity_on_solid
))));
assert
(
pressure_on_fluid_content
.
size
()
==
fluid_god_of_dof
.
NprogramWiseDof
(
fluid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
pressure_on_fluid
))));
assert
(
pressure_on_solid_content
.
size
()
==
solid_god_of_dof
.
NprogramWiseDof
(
solid_god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
NumberingSubsetIndex
::
pressure_on_solid
))));
result_type
pressure_on_solid_content
=
PerformComputationForNumberingSubset
(
solid_god_of_dof
,
solid_post_processing
,
NumberingSubsetIndex
::
pressure_on_solid
);
}
namespace
// anonymous
{
void
PerformComputationForRankAndNumberingSubset
(
const
PostProcessingNS
::
PostProcessing
&
post_processing
,
unsigned
int
rank
,
NumberingSubsetIndex
numbering_subset
,
result_type
&
result
)
result_type
PerformComputationForNumberingSubset
(
const
GodOfDof
&
god_of_dof
,
const
PostProcessingNS
::
PostProcessing
&
post_processing
,
NumberingSubsetIndex
numbering_subset_index
)
{
decltype
(
auto
)
dof_list
=
post_processing
.
GetDofInformationList
(
EnumUnderlyingType
(
numbering_subset
),
rank
);
result_type
ret
;
ret
.
max_load_factor
(
Utilities
::
DefaultMaxLoadFactor
());
decltype
(
auto
)
numbering_subset
=
god_of_dof
.
GetNumberingSubset
(
EnumUnderlyingType
(
numbering_subset_index
));
ret
.
reserve
(
god_of_dof
.
NprogramWiseDof
(
numbering_subset
));
for
(
const
auto
&
dof_ptr
:
dof_list
)
decltype
(
auto
)
mpi
=
god_of_dof
.
MpiHappyHeart
();
const
auto
Nprocessor
=
mpi
.
template
Nprocessor
<
unsigned
int
>();
for
(
auto
rank
=
0u
;
rank
<
Nprocessor
;
++
rank
)
{
assert
(
!
(
!
dof_ptr
));
const
auto
&
dof
=
*
dof_ptr
;
const
auto
dof_index
=
dof
.
GetProgramWiseIndex
();
const
auto
&
interface
=
dof
.
GetInterface
();
decltype
(
auto
)
dof_list
=
post_processing
.
GetDofInformationList
(
EnumUnderlyingType
(
numbering_subset_index
),
rank
);
auto
check
=
result
.
insert
(
std
::
make_pair
(
dof_index
,
interface
.
GetVertexCoordsIndexList
()));
assert
(
check
.
second
);
static_cast
<
void
>
(
check
);
for
(
const
auto
&
dof_ptr
:
dof_list
)
{
assert
(
!
(
!
dof_ptr
));
const
auto
&
dof
=
*
dof_ptr
;
const
auto
dof_index
=
dof
.
GetProgramWiseIndex
();
const
auto
&
interface
=
dof
.
GetInterface
();
auto
check
=
ret
.
insert
(
std
::
make_pair
(
dof_index
,
interface
.
GetVertexCoordsIndexList
()));
assert
(
check
.
second
);
static_cast
<
void
>
(
check
);
}
}
assert
(
ret
.
size
()
==
god_of_dof
.
NprogramWiseDof
(
numbering_subset
));
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment