On Mon, Aug 18, 2014 at 2:37 PM, Roy Stogner <royst...@ices.utexas.edu> wrote:
>
> On Mon, 18 Aug 2014, John Peterson wrote:
>
>> Are you sure it works for broadcast?  I tried this test code:
>>
>> #include "libmesh/libmesh.h"
>> #include "libmesh/point.h"
>> #include "libmesh/parallel.h"
>
>
> #include "libmesh/parallel_algebra.h"
>
>
>> using namespace libMesh;
>>
>> int main (int argc, char** argv)
>> {
>>  LibMeshInit init(argc, argv);
>>
>>  // Let's try to broadcast a libMesh Point
>>  Point p;
>>
>>  // Initialize p only on processor 0
>>  if (init.comm().rank() == 0)
>>    p(0) = 42;
>>
>>  Parallel::broadcast(p);
>>
>>  return 0;
>> }
>
>
> And then it works.
>
>
> I can't figure out what a more user-friendly way to handle this would
> be, though.  I definitely don't want to add a point.h dependency to
> parallel.h or vice-versa.

Can C++11 static_assert or some template magic help to generate a
better error message?

I.e. instead of:

error: calling a private constructor of class
'libMesh::Parallel::StandardType<libMesh::Point>'

make the compiler print "Did you forget to include parallel_algebra.h?"

PS why the word "algebra"?

-- 
John

------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to