Skip to content

Overhaul Green's function factory functionality - #107

Merged
robertodr merged 28 commits into
PCMSolver:release/1.Yfrom
robertodr:greens-function-factory
Dec 28, 2017
Merged

robertodr merged 28 commits into
PCMSolver:release/1.Yfrom
robertodr:greens-function-factory

Conversation

@robertodr

@robertodr robertodr commented Nov 23, 2017 •

Copy link
Copy Markdown
Member

Description

I am starting to remove some Boost dependencies from the code. I would like to only include what's strictly necessary from Boost, so that the transition to C++11 for version 2 (long awaited) can happen as smoothly as possible. When this PR is ready to go, we will only depend on:

Changed

  • Dispatching of Green’s functions in the factory is purely label-based. The input reader generates a string that holds the type of the Green’s function, the strategy for calculating its normal derivatives and the dielectric profile (if needed): TYPE_DERIVATIVE_PROFILE. The Green’s functions are subscribed to the factory using this label, which is then also the one used for their creation. Iteration over lists of types to dispatch the correct template parameters is thus completely avoided. This removes the dependency on the metafunctions in ForId.hpp and the dependency on Boost.MPL, the Boost metaprogramming library.
  • Dispatching of quadrature rules for the numerical boundary integral operator has been rewritten, removing the dependency on Boost.MPL.
  • The input wrapping data struct-s have been modified to include the string defining the type of object and to remove now unused information.
  • Formatting of output is done entirely using C++ streams, removing the dependency on Boost.Format.

Removed

  • Some unused files have been removed:
    • Interpolation.hpp
    • Interpolation.cpp
    • Vector2.hpp
    • Vector3.hpp
    • ForId.hpp
    • DerivativeUtils.hpp
  • The cavityType(), solverType(), greenInsideType(), greenOutsideType()
    and integratorType() functions in the Input object have been removed.
    This information is now wrapped into the corresponding input-wrapping
    struct-s: CavityData, SolverData, GreenData and BIOperatorData.

Todos

Status

I would also like to tackle the use of Boost.Variant before marking it ready to go.

  • Ready to go

@MinazoBot

MinazoBot commented Nov 23, 2017 •

Copy link
Copy Markdown

LGTM

Generated by 🚫 Danger

@robertodr

Copy link
Copy Markdown
Member Author

@arnfinn @ilfreddy can one of you try to compile this PR on Mac OS X with GCC (not Apple Clang)? I am getting a weird error message about a function in a system header not being defined...

@arnfinn

arnfinn commented Nov 27, 2017

Copy link
Copy Markdown
Contributor

I got the following error when I tried your branch with MacPorts gcc5 5.5.0_0, which I guess is the same as Travis get:

[  8%] Building CXX object src/cavity/CMakeFiles/cavity.dir/ICavity.cpp.o
In file included from /usr/include/unistd.h:638:0,
                 from /opt/local/include/zconf.h:475,
                 from /opt/local/include/zlib.h:34,
                 from /Volumes/repos/arnfinn/pcmsolver/src/utils/cnpy.hpp:17,
                 from /Volumes/repos/arnfinn/pcmsolver/src/utils/MathUtils.hpp:42,
                 from /Volumes/repos/arnfinn/pcmsolver/src/cavity/ICavity.cpp:32:
/usr/include/sys/select.h:114:19: error: 'fd_set' has not been declared
 int  pselect(int, fd_set * __restrict, fd_set * __restrict,
                   ^
/usr/include/sys/select.h:114:40: error: 'fd_set' has not been declared
 int  pselect(int, fd_set * __restrict, fd_set * __restrict,
                                        ^
/usr/include/sys/select.h:115:3: error: 'fd_set' has not been declared
   fd_set * __restrict, const struct timespec * __restrict,
   ^
make[2]: *** [src/cavity/CMakeFiles/cavity.dir/ICavity.cpp.o] Error 1
make[1]: *** [src/cavity/CMakeFiles/cavity.dir/all] Error 2
make: *** [all] Error 2

@robertodr

Copy link
Copy Markdown
Member Author

Thanks a lot @arnfinn. Yep, it's the same error. I have tried GCC 6.4.0 and GCC 7.2.0 on Travis, both installed with Homebrew. The fact that GCC 5.5.0 installed via MacPorts gives the same error doesn't bode well. I guess when I pulled some Boost stuff out some include-s that were within the Boost headers were ripped away. Sadly ironic... I'll ask some of the local gurus here if they've ever seen this kind of problem. Can you run a grep fd_set in the /usr/include/sys directory?

@arnfinn

arnfinn commented Nov 27, 2017

Copy link
Copy Markdown
Contributor
$ grep fd_set /usr/include/sys/*.h
/usr/include/sys/_select.h:int	 select(int, fd_set * __restrict, fd_set * __restrict,
/usr/include/sys/_select.h:		fd_set * __restrict, struct timeval * __restrict)
/usr/include/sys/select.h: * [XSI] The <sys/select.h> header shall define the fd_set type as a structure.
/usr/include/sys/select.h:#include <sys/_types/_fd_setsize.h>
/usr/include/sys/select.h:#include <sys/_types/_fd_set.h>
/usr/include/sys/select.h:int	 pselect(int, fd_set * __restrict, fd_set * __restrict,
/usr/include/sys/select.h:		fd_set * __restrict, const struct timespec * __restrict,
/usr/include/sys/time.h: * [XSI] The fd_set type shall be defined as described in <sys/select.h>.
/usr/include/sys/time.h:#include <sys/_types/_fd_setsize.h>
/usr/include/sys/time.h:#include <sys/_types/_fd_set.h>
/usr/include/sys/types.h:#include <sys/_types/_fd_setsize.h>
/usr/include/sys/types.h:#include <sys/_types/_fd_set.h>

@robertodr

Copy link
Copy Markdown
Member Author

Seems struct fd_set is really not there... Wonder where it went.

@arnfinn

arnfinn commented Nov 27, 2017

Copy link
Copy Markdown
Contributor

adding #include <sys/select.h> seems to help.

@robertodr

Copy link
Copy Markdown
Member Author

Currently trying with Xcode 8gm. In which file did you include that system header?

@robertodr

Copy link
Copy Markdown
Member Author

Newer Xcode didn't work either :/

@arnfinn

arnfinn commented Nov 27, 2017

Copy link
Copy Markdown
Contributor

In ICavity.cpp. Then the error moved to Element.cpp:)

@robertodr
robertodr force-pushed the greens-function-factory branch from b48538c to 8bcfe9c Compare November 28, 2017 02:32
@robertodr robertodr changed the title [WIP] Overhaul Green's function factory functionality Overhaul Green's function factory functionality Dec 1, 2017
@robertodr robertodr added this to the v1.2.0 milestone Dec 3, 2017
@robertodr
robertodr force-pushed the greens-function-factory branch from a4cae92 to b63fa99 Compare December 28, 2017 11:58
@robertodr
robertodr merged commit 172e7a2 into PCMSolver:release/1.Y Dec 28, 2017
@robertodr
robertodr deleted the greens-function-factory branch December 28, 2017 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants