[Dune-devel] cleanup in uggrid

Carsten Gräser graeser at mi.fu-berlin.de
Fri Nov 28 16:53:27 CET 2014


Hi Oliver,

[...]
> +
>    // we are an actual element in UG
> -  UGCtype* cornerCoords[corners()];
> +  // coorddim*coorddim is an upper bound for the number of vertices
> +  UGCtype* cornerCoords[coorddim*coorddim];
>    UG_NS<coorddim>::Corner_Coordinates(target_, cornerCoords);
> 
> Please remove the extra whitespace change
this one slipped through.

> -    const typename UG_NS<dimworld>::Node* vertices[elementTypes_[i]];
> +    std::unique_ptr<const typename UG_NS<dimworld>::Node*[]> vertices = Std::make_unique<const typename UG_NS<dimworld>::Node*[]>(elementTypes_[i]);
>      for (size_t j=0; j<elementTypes_[i]; j++)
>        vertices[j] = nodePointers[isBoundaryNode[elementVertices_[idx++]]];
> 
> -    if (InsertElement(grid_->multigrid_->grids[0], elementTypes_[i],const_cast<typename UG_NS<dimworld>::Node**>(vertices),NULL,NULL,NULL)==NULL)
> +    if (InsertElement(grid_->multigrid_->grids[0], elementTypes_[i],const_cast<typename UG_NS<dimworld>::Node**>(vertices.get()),NULL,NULL,NULL)==NULL)
>        DUNE_THROW(GridError, "Inserting element into UGGrid failed!");
>    }
> 
> 
> Why not use a std::vector here instead?
Because I wanted to stay as close as possible to the old code
(i.e. raw array). For me there's nothing wrong with a vector
here. I'll update and push the patches.

Best,
Carsten

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141128/17c439e5/attachment.sig>


More information about the Dune-devel mailing list