]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Mark some classes as 'extern template'. 11861/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 5 Mar 2021 20:05:53 +0000 (21:05 +0100)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 6 Mar 2021 21:08:32 +0000 (22:08 +0100)
This saves a small amount of space and, possibly, compile time. Here
is a comparison of the cumulative size of all object files for the
debug and release configurations without and with the patch:

without patch:
debug   2,414,548,192
release   459,866,272

with patch:
debug    2,404,864,416
release    459,686,888

One can also compare the sizes of the .so files. I did this only for
the release library:

without patch: 459,866,272
with patch:    459,686,888

So it's a rather minor improvement. One could do this to a lot more
classes than just the two in this patch, though, if we wanted to go
that route.

include/deal.II/dofs/dof_handler.h
include/deal.II/grid/tria.h

index 21687df85ee1a00fff3687ce37fa9121186ffc47..b1494ef54b12688664f003d6db6086bd4fcbb038 100644 (file)
@@ -2272,6 +2272,15 @@ DoFHandler<dim, spacedim>::MGVertexDoFs::set_index(
 }
 
 
+
+extern template class DoFHandler<1, 1>;
+extern template class DoFHandler<1, 2>;
+extern template class DoFHandler<1, 3>;
+extern template class DoFHandler<2, 2>;
+extern template class DoFHandler<2, 3>;
+extern template class DoFHandler<3, 3>;
+
+
 #endif // DOXYGEN
 
 DEAL_II_NAMESPACE_CLOSE
index 29a352deeae2c1f4bb96aae1e03108ce2b5d6d3c..56e8d7243aff4a3a834154e6e018b91a91875995 100644 (file)
@@ -4399,6 +4399,13 @@ bool
 Triangulation<1, 3>::prepare_coarsening_and_refinement();
 
 
+extern template class Triangulation<1, 1>;
+extern template class Triangulation<1, 2>;
+extern template class Triangulation<1, 3>;
+extern template class Triangulation<2, 2>;
+extern template class Triangulation<2, 3>;
+extern template class Triangulation<3, 3>;
+
 #endif // DOXYGEN
 
 DEAL_II_NAMESPACE_CLOSE

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.