Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
code
pugs
Commits
31608e4a
Commit
31608e4a
authored
2 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Check that discrete functions are defined on the mesh to smooth
parent
f25b9639
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!167
Improve fluxing based remapping
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/language/modules/SchemeModule.cpp
+4
-4
4 additions, 4 deletions
src/language/modules/SchemeModule.cpp
src/mesh/MeshSmoother.cpp
+31
-20
31 additions, 20 deletions
src/mesh/MeshSmoother.cpp
src/mesh/MeshSmoother.hpp
+4
-4
4 additions, 4 deletions
src/mesh/MeshSmoother.hpp
with
39 additions
and
28 deletions
src/language/modules/SchemeModule.cpp
+
4
−
4
View file @
31608e4a
...
@@ -246,7 +246,7 @@ SchemeModule::SchemeModule()
...
@@ -246,7 +246,7 @@ SchemeModule::SchemeModule()
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
)
->
std
::
shared_ptr
<
const
IMesh
>
{
bc_descriptor_list
)
->
std
::
shared_ptr
<
const
IMesh
>
{
MeshSmootherHandler
handler
;
MeshSmootherHandler
handler
;
return
handler
.
getSmoothedMesh
(
*
p_mesh
,
bc_descriptor_list
);
return
handler
.
getSmoothedMesh
(
p_mesh
,
bc_descriptor_list
);
}
}
));
));
...
@@ -259,7 +259,7 @@ SchemeModule::SchemeModule()
...
@@ -259,7 +259,7 @@ SchemeModule::SchemeModule()
bc_descriptor_list
,
bc_descriptor_list
,
const
FunctionSymbolId
&
function_symbol_id
)
->
std
::
shared_ptr
<
const
IMesh
>
{
const
FunctionSymbolId
&
function_symbol_id
)
->
std
::
shared_ptr
<
const
IMesh
>
{
MeshSmootherHandler
handler
;
MeshSmootherHandler
handler
;
return
handler
.
getSmoothedMesh
(
*
p_mesh
,
bc_descriptor_list
,
function_symbol_id
);
return
handler
.
getSmoothedMesh
(
p_mesh
,
bc_descriptor_list
,
function_symbol_id
);
}
}
));
));
...
@@ -273,7 +273,7 @@ SchemeModule::SchemeModule()
...
@@ -273,7 +273,7 @@ SchemeModule::SchemeModule()
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
->
std
::
shared_ptr
<
const
IMesh
>
{
->
std
::
shared_ptr
<
const
IMesh
>
{
MeshSmootherHandler
handler
;
MeshSmootherHandler
handler
;
return
handler
.
getSmoothedMesh
(
*
p_mesh
,
bc_descriptor_list
,
smoothing_zone_list
);
return
handler
.
getSmoothedMesh
(
p_mesh
,
bc_descriptor_list
,
smoothing_zone_list
);
}
}
));
));
...
@@ -286,7 +286,7 @@ SchemeModule::SchemeModule()
...
@@ -286,7 +286,7 @@ SchemeModule::SchemeModule()
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
discrete_function_variant_list
)
->
std
::
shared_ptr
<
const
IMesh
>
{
discrete_function_variant_list
)
->
std
::
shared_ptr
<
const
IMesh
>
{
MeshSmootherHandler
handler
;
MeshSmootherHandler
handler
;
return
handler
.
getSmoothedMesh
(
*
p_mesh
,
bc_descriptor_list
,
return
handler
.
getSmoothedMesh
(
p_mesh
,
bc_descriptor_list
,
discrete_function_variant_list
);
discrete_function_variant_list
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mesh/MeshSmoother.cpp
+
31
−
20
View file @
31608e4a
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include
<mesh/MeshLineNodeBoundary.hpp>
#include
<mesh/MeshLineNodeBoundary.hpp>
#include
<mesh/MeshNodeBoundary.hpp>
#include
<mesh/MeshNodeBoundary.hpp>
#include
<scheme/AxisBoundaryConditionDescriptor.hpp>
#include
<scheme/AxisBoundaryConditionDescriptor.hpp>
#include
<scheme/DiscreteFunctionUtils.hpp>
#include
<scheme/DiscreteFunctionVariant.hpp>
#include
<scheme/DiscreteFunctionVariant.hpp>
#include
<scheme/FixedBoundaryConditionDescriptor.hpp>
#include
<scheme/FixedBoundaryConditionDescriptor.hpp>
#include
<scheme/SymmetryBoundaryConditionDescriptor.hpp>
#include
<scheme/SymmetryBoundaryConditionDescriptor.hpp>
...
@@ -408,26 +409,26 @@ class MeshSmootherHandler::MeshSmoother<Dimension>::SymmetryBoundaryCondition
...
@@ -408,26 +409,26 @@ class MeshSmootherHandler::MeshSmoother<Dimension>::SymmetryBoundaryCondition
std
::
shared_ptr
<
const
IMesh
>
std
::
shared_ptr
<
const
IMesh
>
MeshSmootherHandler
::
getSmoothedMesh
(
MeshSmootherHandler
::
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
)
const
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
)
const
{
{
switch
(
mesh
.
dimension
())
{
switch
(
mesh
->
dimension
())
{
case
1
:
{
case
1
:
{
constexpr
size_t
Dimension
=
1
;
constexpr
size_t
Dimension
=
1
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
();
return
smoother
.
getSmoothedMesh
();
}
}
case
2
:
{
case
2
:
{
constexpr
size_t
Dimension
=
2
;
constexpr
size_t
Dimension
=
2
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
();
return
smoother
.
getSmoothedMesh
();
}
}
case
3
:
{
case
3
:
{
constexpr
size_t
Dimension
=
3
;
constexpr
size_t
Dimension
=
3
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
();
return
smoother
.
getSmoothedMesh
();
}
}
default
:
{
default
:
{
...
@@ -438,27 +439,27 @@ MeshSmootherHandler::getSmoothedMesh(
...
@@ -438,27 +439,27 @@ MeshSmootherHandler::getSmoothedMesh(
std
::
shared_ptr
<
const
IMesh
>
std
::
shared_ptr
<
const
IMesh
>
MeshSmootherHandler
::
getSmoothedMesh
(
MeshSmootherHandler
::
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
FunctionSymbolId
&
function_symbol_id
)
const
const
FunctionSymbolId
&
function_symbol_id
)
const
{
{
switch
(
mesh
.
dimension
())
{
switch
(
mesh
->
dimension
())
{
case
1
:
{
case
1
:
{
constexpr
size_t
Dimension
=
1
;
constexpr
size_t
Dimension
=
1
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
}
}
case
2
:
{
case
2
:
{
constexpr
size_t
Dimension
=
2
;
constexpr
size_t
Dimension
=
2
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
}
}
case
3
:
{
case
3
:
{
constexpr
size_t
Dimension
=
3
;
constexpr
size_t
Dimension
=
3
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
return
smoother
.
getSmoothedMesh
(
function_symbol_id
);
}
}
default
:
{
default
:
{
...
@@ -469,27 +470,27 @@ MeshSmootherHandler::getSmoothedMesh(
...
@@ -469,27 +470,27 @@ MeshSmootherHandler::getSmoothedMesh(
std
::
shared_ptr
<
const
IMesh
>
std
::
shared_ptr
<
const
IMesh
>
MeshSmootherHandler
::
getSmoothedMesh
(
MeshSmootherHandler
::
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
const
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
const
{
{
switch
(
mesh
.
dimension
())
{
switch
(
mesh
->
dimension
())
{
case
1
:
{
case
1
:
{
constexpr
size_t
Dimension
=
1
;
constexpr
size_t
Dimension
=
1
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
}
}
case
2
:
{
case
2
:
{
constexpr
size_t
Dimension
=
2
;
constexpr
size_t
Dimension
=
2
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
}
}
case
3
:
{
case
3
:
{
constexpr
size_t
Dimension
=
3
;
constexpr
size_t
Dimension
=
3
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
return
smoother
.
getSmoothedMesh
(
smoothing_zone_list
);
}
}
default
:
{
default
:
{
...
@@ -500,27 +501,37 @@ MeshSmootherHandler::getSmoothedMesh(
...
@@ -500,27 +501,37 @@ MeshSmootherHandler::getSmoothedMesh(
std
::
shared_ptr
<
const
IMesh
>
std
::
shared_ptr
<
const
IMesh
>
MeshSmootherHandler
::
getSmoothedMesh
(
MeshSmootherHandler
::
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
discrete_function_variant_list
)
const
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
discrete_function_variant_list
)
const
{
{
switch
(
mesh
.
dimension
())
{
if
(
not
hasSameMesh
(
discrete_function_variant_list
))
{
throw
NormalError
(
"discrete functions are not defined on the same mesh"
);
}
std
::
shared_ptr
<
const
IMesh
>
common_mesh
=
getCommonMesh
(
discrete_function_variant_list
);
if
(
common_mesh
!=
mesh
)
{
throw
NormalError
(
"discrete functions are not defined on the smoothed mesh"
);
}
switch
(
mesh
->
dimension
())
{
case
1
:
{
case
1
:
{
constexpr
size_t
Dimension
=
1
;
constexpr
size_t
Dimension
=
1
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
}
}
case
2
:
{
case
2
:
{
constexpr
size_t
Dimension
=
2
;
constexpr
size_t
Dimension
=
2
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
}
}
case
3
:
{
case
3
:
{
constexpr
size_t
Dimension
=
3
;
constexpr
size_t
Dimension
=
3
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
using
MeshType
=
Mesh
<
Connectivity
<
Dimension
>>
;
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
mesh
),
bc_descriptor_list
);
MeshSmoother
smoother
(
dynamic_cast
<
const
MeshType
&>
(
*
mesh
),
bc_descriptor_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
return
smoother
.
getSmoothedMesh
(
discrete_function_variant_list
);
}
}
default
:
{
default
:
{
...
...
This diff is collapsed.
Click to expand it.
src/mesh/MeshSmoother.hpp
+
4
−
4
View file @
31608e4a
...
@@ -19,21 +19,21 @@ class MeshSmootherHandler
...
@@ -19,21 +19,21 @@ class MeshSmootherHandler
public:
public:
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
)
const
;
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
)
const
;
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
FunctionSymbolId
&
function_symbol_id
)
const
;
const
FunctionSymbolId
&
function_symbol_id
)
const
;
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
const
;
const
std
::
vector
<
std
::
shared_ptr
<
const
IZoneDescriptor
>>&
smoothing_zone_list
)
const
;
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
std
::
shared_ptr
<
const
IMesh
>
getSmoothedMesh
(
const
IMesh
&
mesh
,
const
std
::
shared_ptr
<
const
IMesh
>
&
mesh
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
IBoundaryConditionDescriptor
>>&
bc_descriptor_list
,
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
smoothing_zone_list
)
const
;
const
std
::
vector
<
std
::
shared_ptr
<
const
DiscreteFunctionVariant
>>&
smoothing_zone_list
)
const
;
...
...
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