Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-gmsh4
Commits
418c0884
Commit
418c0884
authored
Oct 03, 2020
by
Praetorius, Simon
Browse files
add extended constructors for gmsh4reader
parent
66232845
Pipeline
#4956
passed with stage
in 8 minutes and 51 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dune/gmsh4/gmsh4reader.hh
View file @
418c0884
...
...
@@ -43,11 +43,13 @@ namespace Dune
using
size_type
=
SizeType
;
/// Constructor. Creates a new GridCreator with the passed factory
explicit
Gmsh4Reader
(
GridFactory
<
Grid
>&
factory
)
:
creator_
(
std
::
make_shared
<
GridCreator
>
(
factory
))
template
<
class
...
Args
,
std
::
enable_if_t
<
std
::
is_constructible
<
GridCreator
,
Args
...>
::
value
,
int
>
=
0
>
explicit
Gmsh4Reader
(
Args
&&
...
args
)
:
creator_
(
std
::
make_shared
<
GridCreator
>
(
std
::
forward
<
Args
>
(
args
)...))
{}
/// Constructor. Stores
a
references
to the passed creato
r
/// Constructor. Stores
the
references
in a non-destroying shared_pt
r
explicit
Gmsh4Reader
(
GridCreator
&
creator
)
:
creator_
(
stackobject_to_shared_ptr
(
creator
))
{}
...
...
@@ -65,13 +67,6 @@ namespace Dune
**/
void
read
(
std
::
string
const
&
filename
,
bool
fillCreator
=
true
);
/// Implementation of \ref FileReader interface
static
void
fillFactoryImpl
(
GridFactory
<
Grid
>&
factory
,
std
::
string
const
&
filename
)
{
Gmsh4Reader
reader
{
factory
};
reader
.
read
(
filename
);
}
/// Advanced read methods
/// @{
...
...
@@ -103,6 +98,15 @@ namespace Dune
return
pieces_
;
}
#ifndef DOXYGEN
/// Implementation of \ref FileReader interface
static
void
fillFactoryImpl
(
GridFactory
<
Grid
>&
factory
,
std
::
string
const
&
filename
)
{
Gmsh4Reader
reader
{
factory
};
reader
.
read
(
filename
);
}
#endif
private:
template
<
class
T
>
void
readValueBinary
(
std
::
ifstream
&
input
,
T
&
v
);
...
...
dune/gmsh4/gridcreators/continuousgridcreator.hh
View file @
418c0884
...
...
@@ -27,10 +27,9 @@ namespace Dune
using
GlobalCoordinate
=
typename
Super
::
GlobalCoordinate
;
using
Nodes
=
std
::
vector
<
GlobalCoordinate
>
;
ContinuousGridCreator
(
GridFactory
<
Grid
>&
factory
)
:
Super
(
factory
)
{}
public:
using
Super
::
Super
;
using
Super
::
factory
;
template
<
class
NodeAttributes
>
...
...
@@ -102,5 +101,11 @@ namespace Dune
std
::
size_t
vertexShift_
=
0
;
};
// deduction guides
template
<
class
Grid
>
ContinuousGridCreator
(
GridFactory
<
Grid
>&
)
->
ContinuousGridCreator
<
Grid
>
;
}
// end namespace Gmsh4
}
// end namespace Dune
dune/gmsh4/gridcreators/derivedgridcreator.hh
View file @
418c0884
...
...
@@ -23,9 +23,11 @@ namespace Dune
using
Grid
=
typename
GridCreator
::
Grid
;
using
GlobalCoordinate
=
typename
Super
::
GlobalCoordinate
;
DerivedGridCreator
(
GridFactory
<
Grid
>&
factory
)
:
Super
(
factory
)
,
gridCreator_
(
factory
)
template
<
class
...
Args
,
disableCopyMove
<
DerivedGridCreator
,
Args
...>
=
0
>
DerivedGridCreator
(
Args
&&
...
args
)
:
Super
(
std
::
forward
<
Args
>
(
args
)...)
,
gridCreator_
(
Super
::
factory
())
{}
template
<
class
NodeAttributes
>
...
...
dune/gmsh4/gridcreators/discontinuousgridcreator.hh
View file @
418c0884
...
...
@@ -39,10 +39,9 @@ namespace Dune
}
};
DiscontinuousGridCreator
(
GridFactory
<
Grid
>&
factory
)
:
Super
(
factory
)
{}
public:
using
Super
::
Super
;
using
Super
::
factory
;
template
<
class
NodeAttributes
>
...
...
@@ -67,5 +66,10 @@ namespace Dune
std
::
map
<
GlobalCoordinate
,
std
::
size_t
,
CoordLess
>
uniquePoints_
;
};
// deduction guides
template
<
class
Grid
>
DiscontinuousGridCreator
(
GridFactory
<
Grid
>&
)
->
DiscontinuousGridCreator
<
Grid
>
;
}
// end namespace Gmsh4
}
// end namespace Dune
dune/gmsh4/gridcreators/lagrangegridcreator.hh
View file @
418c0884
...
...
@@ -59,12 +59,9 @@ namespace Dune
class
LocalFunction
;
public:
using
Super
::
Super
;
using
Super
::
factory
;
LagrangeGridCreator
(
GridFactory
<
GridType
>&
factory
)
:
Super
(
factory
)
{}
/// Implementation of the interface function `insertVertices()`
template
<
class
NodeAttributes
>
void
insertVerticesImpl
(
std
::
size_t
numNodes
,
...
...
@@ -283,6 +280,11 @@ namespace Dune
std
::
size_t
vertexShift_
=
0
;
};
// deduction guides
template
<
class
Grid
>
LagrangeGridCreator
(
GridFactory
<
Grid
>&
)
->
LagrangeGridCreator
<
Grid
>
;
template
<
class
Grid
>
class
LagrangeGridCreator
<
Grid
>::
LocalParametrization
...
...
dune/gmsh4/gridcreators/parallelgridcreator.hh
View file @
418c0884
...
...
@@ -32,9 +32,8 @@ namespace Dune
// The GridFactory must support insertion of global vertex IDs
static_assert
(
Std
::
is_detected
<
Gmsh4
::
HasInsertVertex
,
GridFactory
<
Grid
>
,
GlobalCoordinate
,
VertexId
>
{},
""
);
ParallelGridCreator
(
GridFactory
<
Grid
>&
factory
)
:
Super
(
factory
)
{}
public:
using
Super
::
Super
;
template
<
class
NodeAttributes
>
void
insertVerticesImpl
(
std
::
size_t
numNodes
,
...
...
@@ -79,5 +78,11 @@ namespace Dune
std
::
size_t
vertexShift_
=
0
;
};
// deduction guides
template
<
class
Grid
>
ParallelGridCreator
(
GridFactory
<
Grid
>&
)
->
ParallelGridCreator
<
Grid
>
;
}
// end namespace Gmsh4
}
// end namespace Dune
dune/gmsh4/gridcreators/serialgridcreator.hh
View file @
418c0884
...
...
@@ -22,9 +22,8 @@ namespace Dune
using
Super
=
GridCreatorInterface
<
Grid
,
Self
>
;
using
GlobalCoordinate
=
typename
Super
::
GlobalCoordinate
;
SerialGridCreator
(
GridFactory
<
Grid
>&
factory
)
:
Super
(
factory
)
{}
public:
using
Super
::
Super
;
template
<
class
NodeAttributes
>
void
insertVerticesImpl
(
std
::
size_t
numNodes
,
...
...
@@ -56,5 +55,11 @@ namespace Dune
std
::
vector
<
std
::
int64_t
>
shift_
;
};
// deduction guides
template
<
class
Grid
>
SerialGridCreator
(
GridFactory
<
Grid
>&
)
->
SerialGridCreator
<
Grid
>
;
}
// end namespace Gmsh4
}
// end namespace Dune
Write
Preview
Supports
Markdown
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