[Dune] communication of dynamic vectors
Martin Nolte
nolte at mathematik.uni-freiburg.de
Wed Mar 14 20:58:07 CET 2012
Hi Arya,
Sorry, but any answer to your request would be pure guess work. What kind of
error message are you referring to (compiler error, runtime exception,
assertion, undefined behavior, ...). Moreover, the code is absolutely useless,
because you are not stating the template arguments. For example: What is Vector?
Not to mention: What grid are you using?
Maybe you could you even provide a simple example program and file a correct bug
report? This would potentially allow us to reproduce the error and give you a
helpful answer.
Please note: Even writing such a reply takes a lot of time and DUNE' development
team is rather small, its support team is even non-existent. If you want useful
answers (unlike the one I just wrote), you might want to consider writing
understandable or reproducible questions.
Best,
Martin
On 03/14/2012 07:27 PM, arya fallahi wrote:
> Dear Dune team,
>
> Recently, I have had a problem with the communication of variables with type
> DynamicVector. I have the following communicator inside a code, which is written
> in accordance with the Dune guide notes:
>
> template<classElementMapper, classVector>
> classDataHandle: publicDune::CommDataHandleIF<DataHandle<ElementMapper,Vector>,
> typenameVector::value_type>
> {
>
> public:
> typedeftypenameVector::value_typeDataType;
> bool contains (int dim, int codim) const { return (codim==0); }
> bool fixedsize (int dim, int codim) const {returntrue; }
>
> template<classEntityType> size_t size (EntityType& e) const { return(1); }
>
> template<classMessageBuffer, classEntityType>
> void gather (MessageBuffer& buff, const EntityType& e) const
> {
> unsigned int globalElementIndex=elementMapper_.map(e);
> buff.write(v_[globalElementIndex]);
> }
>
> template<classMessageBuffer, classEntityType>
> void scatter (MessageBuffer& buff, const EntityType& e, size_t n)
> {
> DataType x;
> buff.read(x);
> unsigned int globalElementIndex=elementMapper_.map(e);
> v_[globalElementIndex] = x;
> }
>
> DataHandle (const ElementMapper& elementMapper, Vector& v):
> elementMapper_(elementMapper),v_(v){}
>
> private:
> constElementMapper& elementMapper_;
> Vector& v_;
> };
>
> This works well when variables with type FieldVector
> (Dune::FieldVector<double,6>) are going to be communicated. However, when I want
> to communicate DynamicVector (Dune::DynamicVector<double>) data, the code stops
> and I receive an error message. I believe the problem lies in the communication
> part, since the code with DynamicVector works well on 1 processor. Do you have
> any idea why such a thing happens? Have you previously faced with this problem?
>
> Best regards and thanks,
>
> Arya Fallahi,
> Dr. sc. techn. ETH,
> Computational Accelerator Scientist
> Paul Scherrer Institute (PSI),
> CH-5232 Villigen, Switzerland,
> arya.fallahi at psi.ch <mailto:arya.fallahi at psi.ch>,
> +41(0)56 310 50 17
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
--
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>
Universität Freiburg phone: +49-761-203-5630
Abteilung für angewandte Mathematik fax: +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
More information about the Dune
mailing list