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
77e6ceeb
Commit
77e6ceeb
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Added output for BC descriptors
parent
78709f74
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+15
-2
15 additions, 2 deletions
src/main.cpp
src/scheme/BoundaryConditionDescriptor.hpp
+48
-5
48 additions, 5 deletions
src/scheme/BoundaryConditionDescriptor.hpp
with
63 additions
and
7 deletions
src/main.cpp
+
15
−
2
View file @
77e6ceeb
...
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
...
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
// test case boundary condition description
// test case boundary condition description
std
::
vector
<
std
::
string
>
sym_boundary_name_list
=
{
"XMIN"
,
"XMAX"
,
"YMIN"
,
"YMAX"
};
std
::
vector
<
std
::
string
>
sym_boundary_name_list
=
{
"XMIN"
,
"XMAX"
,
"YMIN"
,
"YMAX"
};
std
::
vector
<
std
::
shared_ptr
<
BoundaryConditionDescriptor
>>
bc_descriptor_list
;
std
::
vector
<
std
::
shared_ptr
<
BoundaryConditionDescriptor
>>
bc_descriptor_list
;
for
(
auto
sym_boundary_name
:
sym_boundary_name_list
){
for
(
const
auto
&
sym_boundary_name
:
sym_boundary_name_list
){
std
::
shared_ptr
<
BoundaryDescriptor
>
boudary_descriptor
std
::
shared_ptr
<
BoundaryDescriptor
>
boudary_descriptor
=
std
::
shared_ptr
<
BoundaryDescriptor
>
(
new
NamedBoundaryDescriptor
(
sym_boundary_name
));
=
std
::
shared_ptr
<
BoundaryDescriptor
>
(
new
NamedBoundaryDescriptor
(
sym_boundary_name
));
SymmetryBoundaryConditionDescriptor
*
sym_bc_descriptor
SymmetryBoundaryConditionDescriptor
*
sym_bc_descriptor
...
@@ -239,7 +239,20 @@ int main(int argc, char *argv[])
...
@@ -239,7 +239,20 @@ int main(int argc, char *argv[])
std
::
vector
<
BoundaryConditionHandler
>
bc_list
;
std
::
vector
<
BoundaryConditionHandler
>
bc_list
;
{
{
for
(
const
auto
&
bc_descriptor
:
bc_descriptor_list
)
{
switch
(
bc_descriptor
->
type
())
{
case
BoundaryConditionDescriptor
::
Type
::
symmetry
:
{
const
SymmetryBoundaryConditionDescriptor
&
sym_bc_descriptor
=
dynamic_cast
<
const
SymmetryBoundaryConditionDescriptor
&>
(
*
bc_descriptor
);
std
::
cout
<<
sym_bc_descriptor
<<
'\n'
;
break
;
}
default
:
{
std
::
cerr
<<
"Unknown BCDescription
\n
"
;
std
::
exit
(
1
);
}
}
}
for
(
size_t
i_ref_face_list
=
0
;
i_ref_face_list
<
mesh
.
connectivity
().
numberOfRefFaceList
();
for
(
size_t
i_ref_face_list
=
0
;
i_ref_face_list
<
mesh
.
connectivity
().
numberOfRefFaceList
();
++
i_ref_face_list
)
{
++
i_ref_face_list
)
{
const
RefFaceList
&
ref_face_list
=
mesh
.
connectivity
().
refFaceList
(
i_ref_face_list
);
const
RefFaceList
&
ref_face_list
=
mesh
.
connectivity
().
refFaceList
(
i_ref_face_list
);
...
...
This diff is collapsed.
Click to expand it.
src/scheme/BoundaryConditionDescriptor.hpp
+
48
−
5
View file @
77e6ceeb
...
@@ -13,6 +13,16 @@ class BoundaryDescriptor
...
@@ -13,6 +13,16 @@ class BoundaryDescriptor
numbered
numbered
};
};
protected
:
virtual
std
::
ostream
&
_write
(
std
::
ostream
&
os
)
const
=
0
;
public
:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
BoundaryDescriptor
&
bd
)
{
return
bd
.
_write
(
os
);
}
virtual
Type
type
()
const
=
0
;
virtual
Type
type
()
const
=
0
;
BoundaryDescriptor
(
const
BoundaryDescriptor
&
)
=
default
;
BoundaryDescriptor
(
const
BoundaryDescriptor
&
)
=
default
;
BoundaryDescriptor
()
=
default
;
BoundaryDescriptor
()
=
default
;
...
@@ -25,8 +35,14 @@ class NamedBoundaryDescriptor
...
@@ -25,8 +35,14 @@ class NamedBoundaryDescriptor
private:
private:
std
::
string
m_name
;
std
::
string
m_name
;
std
::
ostream
&
_write
(
std
::
ostream
&
os
)
const
final
{
os
<<
'"'
<<
m_name
<<
'"'
;
return
os
;
}
public
:
public
:
Type
type
()
const
Type
type
()
const
final
{
{
return
Type
::
named
;
return
Type
::
named
;
}
}
...
@@ -43,14 +59,27 @@ class NamedBoundaryDescriptor
...
@@ -43,14 +59,27 @@ class NamedBoundaryDescriptor
class
NumberedBoundaryDescriptor
class
NumberedBoundaryDescriptor
:
public
BoundaryDescriptor
:
public
BoundaryDescriptor
{
{
private:
int
m_number
;
std
::
ostream
&
_write
(
std
::
ostream
&
os
)
const
final
{
os
<<
'"'
<<
m_number
<<
'"'
;
return
os
;
}
public
:
public
:
Type
type
()
const
Type
type
()
const
final
{
{
return
Type
::
numbered
;
return
Type
::
numbered
;
}
}
NumberedBoundaryDescriptor
(
const
NumberedBoundaryDescriptor
&
)
=
default
;
NumberedBoundaryDescriptor
(
const
NumberedBoundaryDescriptor
&
)
=
default
;
NumberedBoundaryDescriptor
()
=
default
;
NumberedBoundaryDescriptor
(
const
int
&
number
)
:
m_number
(
number
)
{
;
}
virtual
~
NumberedBoundaryDescriptor
()
=
default
;
virtual
~
NumberedBoundaryDescriptor
()
=
default
;
};
};
...
@@ -62,9 +91,17 @@ class BoundaryConditionDescriptor
...
@@ -62,9 +91,17 @@ class BoundaryConditionDescriptor
{
{
symmetry
symmetry
};
};
pr
ivate
:
pr
otected
:
std
::
shared_ptr
<
BoundaryDescriptor
>
m_boundary_descriptor
;
std
::
shared_ptr
<
BoundaryDescriptor
>
m_boundary_descriptor
;
virtual
std
::
ostream
&
_write
(
std
::
ostream
&
os
)
const
=
0
;
public
:
public
:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
BoundaryConditionDescriptor
&
bcd
)
{
return
bcd
.
_write
(
os
);
}
virtual
Type
type
()
const
=
0
;
virtual
Type
type
()
const
=
0
;
const
BoundaryDescriptor
&
boundaryDescriptor
()
const
const
BoundaryDescriptor
&
boundaryDescriptor
()
const
...
@@ -85,8 +122,14 @@ class BoundaryConditionDescriptor
...
@@ -85,8 +122,14 @@ class BoundaryConditionDescriptor
class
SymmetryBoundaryConditionDescriptor
class
SymmetryBoundaryConditionDescriptor
:
public
BoundaryConditionDescriptor
:
public
BoundaryConditionDescriptor
{
{
private:
std
::
ostream
&
_write
(
std
::
ostream
&
os
)
const
final
{
os
<<
"symmetry("
<<
*
m_boundary_descriptor
<<
")"
;
return
os
;
}
public
:
public
:
Type
type
()
const
Type
type
()
const
final
{
{
return
Type
::
symmetry
;
return
Type
::
symmetry
;
}
}
...
...
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