Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Nektar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Bing Yuan
Nektar
Commits
6dafcf98
Commit
6dafcf98
authored
Mar 28, 2017
by
Dave Moxey
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/dump-mesh-on-failure' into 'master'
feature/dump-mesh-on-failure See merge request !756
parents
d61fc059
aec9bc57
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
198 additions
and
99 deletions
+198
-99
CHANGELOG.md
CHANGELOG.md
+6
-1
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
+3
-5
library/NekMeshUtils/Octree/Octree.cpp
library/NekMeshUtils/Octree/Octree.cpp
+2
-2
utilities/NekMesh/InputModules/InputMCF.cpp
utilities/NekMesh/InputModules/InputMCF.cpp
+180
-84
utilities/NekMesh/InputModules/InputMCF.h
utilities/NekMesh/InputModules/InputMCF.h
+1
-1
utilities/NekMesh/Tests/MeshGen/cylinder.mcf
utilities/NekMesh/Tests/MeshGen/cylinder.mcf
+2
-2
utilities/NekMesh/Tests/MeshGen/rev.mcf
utilities/NekMesh/Tests/MeshGen/rev.mcf
+2
-2
utilities/NekMesh/Tests/MeshGen/sphere.mcf
utilities/NekMesh/Tests/MeshGen/sphere.mcf
+2
-2
No files found.
CHANGELOG.md
View file @
6dafcf98
...
...
@@ -4,7 +4,6 @@ Changelog
v4.5.0
------
**NekMesh**
:
-
Add periodic boundary condition meshing in 2D (!733)
-
Adjust boundary layer thickness in corners in 2D (!739)
...
...
@@ -13,8 +12,14 @@ v4.5.0
v4.4.1
------
**Library**
-
Remove the duplicate output of errorutil (!756)
**NekMesh**
:
-
Fix memory consumption issue with Gmsh output (!747)
-
Rework meshing control so that if possible viewable meshes will be dumped
when some part of the system fails (!756)
-
Add manifold meshing option (!756)
v4.4.0
------
...
...
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
View file @
6dafcf98
...
...
@@ -90,11 +90,9 @@ Array<OneD, NekDouble> CADSurfOCE::locuv(Array<OneD, NekDouble> p)
uvr
[
1
]
=
p2
.
Y
();
gp_Pnt
p3
=
m_sas
->
Value
(
p2
);
if
(
p3
.
Distance
(
loc
)
>
1e-6
)
{
cout
<<
"large locuv distance "
<<
p3
.
Distance
(
loc
)
/
1000.0
<<
" "
<<
m_id
<<
endl
;
}
WARNINGL2
(
p3
.
Distance
(
loc
)
<
1e-3
,
"large locuv distance "
+
boost
::
lexical_cast
<
string
>
(
p3
.
Distance
(
loc
)
/
1000.0
)
+
" "
+
boost
::
lexical_cast
<
string
>
(
m_id
));
// if the uv returned is slightly off the surface
//(which ShapeAnalysis_Surface can do sometimes)
...
...
library/NekMeshUtils/Octree/Octree.cpp
View file @
6dafcf98
...
...
@@ -959,8 +959,8 @@ void Octree::CompileSourcePointList()
// these are the acutal number of sample points in each parametric
// direction
int
nu
=
ceil
(
DeltaU
/
m_minDelta
)
*
2
;
int
nv
=
ceil
(
DeltaV
/
m_minDelta
)
*
2
;
int
nu
=
ceil
(
DeltaU
/
m_minDelta
)
*
40
*
2
;
int
nv
=
ceil
(
DeltaV
/
m_minDelta
)
*
40
*
2
;
for
(
int
j
=
0
;
j
<
nu
;
j
++
)
{
...
...
utilities/NekMesh/InputModules/InputMCF.cpp
View file @
6dafcf98
...
...
@@ -124,10 +124,10 @@ void InputMCF::ParseFile(string nm)
}
set
<
string
>
refinement
;
if
(
pSession
->
DefinesElement
(
"NEKTAR/MESHING/REFINEMENT"
))
if
(
pSession
->
DefinesElement
(
"NEKTAR/MESHING/REFINEMENT"
))
{
TiXmlElement
*
refine
=
mcf
->
FirstChildElement
(
"REFINEMENT"
);
TiXmlElement
*
L
=
refine
->
FirstChildElement
(
"LINE"
);
TiXmlElement
*
L
=
refine
->
FirstChildElement
(
"LINE"
);
while
(
L
)
{
...
...
@@ -179,18 +179,18 @@ void InputMCF::ParseFile(string nm)
it
=
information
.
find
(
"MeshType"
);
ASSERTL0
(
it
!=
information
.
end
(),
"no meshtype defined"
);
m_makeBL
=
it
->
second
==
"3DBndLayer"
;
m_2D
=
it
->
second
==
"2D"
;
m_2D
=
it
->
second
==
"2D"
;
m_manifold
=
it
->
second
==
"Manifold"
;
if
(
it
->
second
==
"2DBndLayer"
)
{
m_makeBL
=
true
;
m_2D
=
true
;
m_2D
=
true
;
}
if
(
!
m_makeBL
&&
!
m_2D
)
if
(
!
m_makeBL
&&
!
m_2D
&&
!
m_manifold
)
{
ASSERTL0
(
it
->
second
==
"3D"
,
"unsure on MeshType"
)
}
it
=
parameters
.
find
(
"MinDelta"
);
ASSERTL0
(
it
!=
parameters
.
end
(),
"no mindelta defined"
);
m_minDelta
=
it
->
second
;
...
...
@@ -217,13 +217,13 @@ void InputMCF::ParseFile(string nm)
ASSERTL0
(
it
!=
parameters
.
end
(),
"no BndLayerthick defined"
);
m_blthick
=
it
->
second
;
it
=
parameters
.
find
(
"BndLayerLayers"
);
it
=
parameters
.
find
(
"BndLayerLayers"
);
m_splitBL
=
it
!=
parameters
.
end
();
if
(
m_splitBL
)
if
(
m_splitBL
)
{
m_bllayers
=
it
->
second
;
it
=
parameters
.
find
(
"BndLayerProgression"
);
m_blprog
=
it
!=
parameters
.
end
()
?
it
->
second
:
"2.0"
;
it
=
parameters
.
find
(
"BndLayerProgression"
);
m_blprog
=
it
!=
parameters
.
end
()
?
it
->
second
:
"2.0"
;
}
it
=
parameters
.
find
(
"BndLayerAdjustment"
);
...
...
@@ -239,7 +239,7 @@ void InputMCF::ParseFile(string nm)
}
m_naca
=
false
;
if
(
m_2D
&&
m_cadfile
.
find
(
'.'
)
==
std
::
string
::
npos
)
if
(
m_2D
&&
m_cadfile
.
find
(
'.'
)
==
std
::
string
::
npos
)
{
m_naca
=
true
;
...
...
@@ -274,16 +274,16 @@ void InputMCF::ParseFile(string nm)
m_adjustall
=
sit
!=
boolparameters
.
end
();
m_refine
=
refinement
.
size
()
>
0
;
if
(
m_refine
)
if
(
m_refine
)
{
stringstream
ss
;
for
(
sit
=
refinement
.
begin
();
sit
!=
refinement
.
end
();
sit
++
)
for
(
sit
=
refinement
.
begin
();
sit
!=
refinement
.
end
();
sit
++
)
{
ss
<<
*
sit
;
ss
<<
":"
;
}
m_refinement
=
ss
.
str
();
m_refinement
.
erase
(
m_refinement
.
end
()
-
1
);
m_refinement
.
erase
(
m_refinement
.
end
()
-
1
);
}
if
(
periodic
.
size
()
>
0
)
...
...
@@ -307,114 +307,214 @@ void InputMCF::Process()
m_mesh
->
m_spaceDim
=
3
;
m_mesh
->
m_nummode
=
boost
::
lexical_cast
<
int
>
(
m_order
)
+
1
;
vector
<
ModuleSharedPtr
>
mods
;
ModuleSharedPtr
module
;
////**** CAD ****////
mod
s
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"loadcad"
),
m_mesh
)
)
;
mod
s
.
back
()
->
RegisterConfig
(
"filename"
,
m_cadfile
);
mod
ule
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"loadcad"
),
m_mesh
);
mod
ule
->
RegisterConfig
(
"filename"
,
m_cadfile
);
if
(
m_2D
)
if
(
m_2D
)
{
mod
s
.
back
()
->
RegisterConfig
(
"2D"
,
""
);
mod
ule
->
RegisterConfig
(
"2D"
,
""
);
}
if
(
m_naca
)
if
(
m_naca
)
{
mod
s
.
back
()
->
RegisterConfig
(
"NACA"
,
m_nacadomain
);
mod
ule
->
RegisterConfig
(
"NACA"
,
m_nacadomain
);
}
////**** Octree ****////
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"loadoctree"
),
m_mesh
));
mods
.
back
()
->
RegisterConfig
(
"mindel"
,
m_minDelta
);
mods
.
back
()
->
RegisterConfig
(
"maxdel"
,
m_maxDelta
);
mods
.
back
()
->
RegisterConfig
(
"eps"
,
m_eps
);
module
->
SetDefaults
();
module
->
Process
();
////**** OCTREE ****////
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"loadoctree"
),
m_mesh
);
module
->
RegisterConfig
(
"mindel"
,
m_minDelta
);
module
->
RegisterConfig
(
"maxdel"
,
m_maxDelta
);
module
->
RegisterConfig
(
"eps"
,
m_eps
);
if
(
m_refine
)
{
mod
s
.
back
()
->
RegisterConfig
(
"refinement"
,
m_refinement
);
mod
ule
->
RegisterConfig
(
"refinement"
,
m_refinement
);
}
if
(
m_woct
)
{
mod
s
.
back
()
->
RegisterConfig
(
"writeoctree"
,
""
);
mod
ule
->
RegisterConfig
(
"writeoctree"
,
""
);
}
if
(
m_2D
)
module
->
SetDefaults
();
module
->
Process
();
////**** LINEAR MESHING ****////
if
(
m_2D
)
{
////**** 2DGenerator ****////
m_mesh
->
m_expDim
=
2
;
m_mesh
->
m_spaceDim
=
2
;
mod
s
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"2dgenerator"
),
m_mesh
)
)
;
mod
ule
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"2dgenerator"
),
m_mesh
);
if
(
m_makeBL
)
{
mods
.
back
()
->
RegisterConfig
(
"blcurves"
,
m_blsurfs
);
mods
.
back
()
->
RegisterConfig
(
"blthick"
,
m_blthick
);
if
(
m_adjust
)
{
mods
.
back
()
->
RegisterConfig
(
"bltadjust"
,
m_adjustment
);
module
->
RegisterConfig
(
"blcurves"
,
m_blsurfs
);
module
->
RegisterConfig
(
"blthick"
,
m_blthick
);
}
if
(
m_adjustall
)
{
mods
.
back
()
->
RegisterConfig
(
"adjustblteverywhere"
,
""
);
}
}
try
{
module
->
SetDefaults
();
module
->
Process
();
}
if
(
m_periodic
.
size
()
)
catch
(
runtime_error
&
e
)
{
mods
.
back
()
->
RegisterConfig
(
"periodic"
,
m_periodic
);
cout
<<
"2D linear mesh generator failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"No mesh file has been created"
<<
endl
;
abort
();
}
}
else
{
////**** SurfaceMesh ****////
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"surfacemesh"
),
m_mesh
));
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"surfacemesh"
),
m_mesh
);
try
{
module
->
SetDefaults
();
module
->
Process
();
}
catch
(
runtime_error
&
e
)
{
cout
<<
"Surface meshing has failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"Any surfaces which were succsessfully meshed will be "
"dumped as a manifold mesh"
<<
endl
;
m_mesh
->
m_expDim
=
2
;
ProcessVertices
();
ProcessEdges
();
ProcessFaces
();
ProcessElements
();
ProcessComposites
();
return
;
}
////**** VolumeMesh ****////
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"volumemesh"
),
m_mesh
));
if
(
m_makeBL
)
if
(
m_manifold
)
{
//dont want to volume mesh
m_mesh
->
m_expDim
=
2
;
}
else
{
mods
.
back
()
->
RegisterConfig
(
"blsurfs"
,
m_blsurfs
);
mods
.
back
()
->
RegisterConfig
(
"blthick"
,
m_blthick
);
mods
.
back
()
->
RegisterConfig
(
"bllayers"
,
m_bllayers
);
mods
.
back
()
->
RegisterConfig
(
"blprog"
,
m_blprog
);
////**** VolumeMesh ****////
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"volumemesh"
),
m_mesh
);
if
(
m_makeBL
)
{
module
->
RegisterConfig
(
"blsurfs"
,
m_blsurfs
);
module
->
RegisterConfig
(
"blthick"
,
m_blthick
);
module
->
RegisterConfig
(
"bllayers"
,
m_bllayers
);
module
->
RegisterConfig
(
"blprog"
,
m_blprog
);
}
try
{
module
->
SetDefaults
();
module
->
Process
();
}
catch
(
runtime_error
&
e
)
{
cout
<<
"Volume meshing has failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"The linear surface mesh be dumped as a manifold mesh"
<<
endl
;
m_mesh
->
m_expDim
=
2
;
m_mesh
->
m_element
[
3
].
clear
();
ProcessVertices
();
ProcessEdges
();
ProcessFaces
();
ProcessElements
();
ProcessComposites
();
return
;
}
}
}
////**** HOSurface ****////
mod
s
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"hosurface"
),
m_mesh
)
)
;
mod
ule
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"hosurface"
),
m_mesh
);
if
(
m_surfopti
)
{
mods
.
back
()
->
RegisterConfig
(
"opti"
,
""
);
module
->
RegisterConfig
(
"opti"
,
""
);
}
try
{
module
->
SetDefaults
();
module
->
Process
();
}
catch
(
runtime_error
&
e
)
{
cout
<<
"High-order surface meshing has failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"The mesh will be written as normal but the incomplete surface "
"will remain faceted"
<<
endl
;
return
;
}
////*** VARIATIONAL OPTIMISATION ****////
if
(
m_varopti
)
if
(
m_varopti
)
{
unsigned
int
np
=
boost
::
thread
::
physical_concurrency
();
if
(
m_mesh
->
m_verbose
)
if
(
m_mesh
->
m_verbose
)
{
cout
<<
"Detecting 4 cores, will attempt to run in parrallel"
<<
endl
;
}
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"varopti"
),
m_mesh
);
module
->
RegisterConfig
(
"hyperelastic"
,
""
);
module
->
RegisterConfig
(
"maxiter"
,
"10"
);
module
->
RegisterConfig
(
"numthreads"
,
boost
::
lexical_cast
<
string
>
(
np
));
try
{
module
->
SetDefaults
();
module
->
Process
();
}
catch
(
runtime_error
&
e
)
{
cout
<<
"Detecting 4 cores, will attempt to run in parrallel"
<<
endl
;
cout
<<
"Variational optimisation has failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"The mesh will be written as is, it may be invalid"
<<
endl
;
return
;
}
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"varopti"
),
m_mesh
));
mods
.
back
()
->
RegisterConfig
(
"hyperelastic"
,
""
);
mods
.
back
()
->
RegisterConfig
(
"maxiter"
,
"10"
);
mods
.
back
()
->
RegisterConfig
(
"numthreads"
,
boost
::
lexical_cast
<
string
>
(
np
));
}
////**** SPLIT BL ****////
if
(
m_splitBL
)
if
(
m_splitBL
)
{
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"bl"
),
m_mesh
));
mods
.
back
()
->
RegisterConfig
(
"layers"
,
m_bllayers
);
mods
.
back
()
->
RegisterConfig
(
"surf"
,
m_blsurfs
);
mods
.
back
()
->
RegisterConfig
(
"nq"
,
boost
::
lexical_cast
<
string
>
(
m_mesh
->
m_nummode
));
mods
.
back
()
->
RegisterConfig
(
"r"
,
m_blprog
);
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"bl"
),
m_mesh
);
module
->
RegisterConfig
(
"layers"
,
m_bllayers
);
module
->
RegisterConfig
(
"surf"
,
m_blsurfs
);
module
->
RegisterConfig
(
"nq"
,
boost
::
lexical_cast
<
string
>
(
m_mesh
->
m_nummode
));
module
->
RegisterConfig
(
"r"
,
m_blprog
);
try
{
module
->
SetDefaults
();
module
->
Process
();
}
catch
(
runtime_error
&
e
)
{
cout
<<
"Boundary layer splitting has failed with message:"
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"The mesh will be written as is, it may be invalid"
<<
endl
;
return
;
}
}
////**** Peralign ****////
...
...
@@ -426,20 +526,16 @@ void InputMCF::Process()
for
(
vector
<
string
>::
iterator
il
=
lines
.
begin
();
il
!=
lines
.
end
();
++
il
)
{
mod
s
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"peralign"
),
m_mesh
)
)
;
mod
ule
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"peralign"
),
m_mesh
);
vector
<
string
>
tmp
(
2
);
boost
::
split
(
tmp
,
*
il
,
boost
::
is_any_of
(
","
));
mods
.
back
()
->
RegisterConfig
(
"surf1"
,
tmp
[
0
]);
mods
.
back
()
->
RegisterConfig
(
"surf2"
,
tmp
[
1
]);
module
->
RegisterConfig
(
"surf1"
,
tmp
[
0
]);
}
}
for
(
int
i
=
0
;
i
<
mods
.
size
();
i
++
)
{
mods
[
i
]
->
SetDefaults
();
mods
[
i
]
->
Process
();
module
->
SetDefaults
();
module
->
Process
();
}
}
}
...
...
utilities/NekMesh/InputModules/InputMCF.h
View file @
6dafcf98
...
...
@@ -66,7 +66,7 @@ private:
m_nacadomain
,
m_periodic
,
m_adjustment
;
bool
m_makeBL
,
m_surfopti
,
m_varopti
,
m_refine
,
m_woct
,
m_2D
,
m_splitBL
,
m_naca
,
m_adjust
,
m_adjustall
;
m_naca
,
m_adjust
,
m_adjustall
,
m_manifold
;
};
}
...
...
utilities/NekMesh/Tests/MeshGen/cylinder.mcf
View file @
6dafcf98
...
...
@@ -7,9 +7,9 @@
</INFORMATION>
<PARAMETERS>
<P PARAM="MinDelta" VALUE="0.0
0
3" />
<P PARAM="MinDelta" VALUE="0.03" />
<P PARAM="MaxDelta" VALUE="0.2" />
<P PARAM="EPS" VALUE="0.
0
5" />
<P PARAM="EPS" VALUE="0.5" />
<P PARAM="Order" VALUE="4" />
...
...
utilities/NekMesh/Tests/MeshGen/rev.mcf
View file @
6dafcf98
...
...
@@ -7,9 +7,9 @@
</INFORMATION>
<PARAMETERS>
<P PARAM="MinDelta" VALUE="0.0
1
2" />
<P PARAM="MinDelta" VALUE="0.02" />
<P PARAM="MaxDelta" VALUE="0.5" />
<P PARAM="EPS" VALUE="0.0
0
5" />
<P PARAM="EPS" VALUE="0.05" />
<P PARAM="Order" VALUE="4" />
...
...
utilities/NekMesh/Tests/MeshGen/sphere.mcf
View file @
6dafcf98
...
...
@@ -7,9 +7,9 @@
</INFORMATION>
<PARAMETERS>
<P PARAM="MinDelta" VALUE="0.0
1
" />
<P PARAM="MinDelta" VALUE="0.0
5
" />
<P PARAM="MaxDelta" VALUE="0.2" />
<P PARAM="EPS" VALUE="0.0
1
" />
<P PARAM="EPS" VALUE="0.0
3
" />
<P PARAM="Order" VALUE="4" />
</PARAMETERS>
...
...
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