CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to get a non-const referento to fvBoundaryMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By msaravia

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2022, 13:45
Default How to get a non-const referento to fvBoundaryMesh
  #1
Member
 
Martin
Join Date: Dec 2011
Posts: 40
Rep Power: 14
msaravia is on a distinguished road
Hi guys, we are trying to change the fvPatch type of a boundary mesh at runtime (changing from wall type to empty type); therefore, we need a non-const reference to the fvBoundaryMesh, so we can assign a new patch using something like

Code:
fvBoundaryMesh& bmesh = mesh.boundary();

emptyFvPatch newPatch
(
    bmesh["front"].patch(),
    bmesh
);

bmesh.set(0, newPatch);
However, this does not work because mesh.boundary() returns a const reference to the fvBoundaryMesh. Any ideas about how we could change the patch type at runtime? Thanks in advance.
ariedinger likes this.

Last edited by msaravia; September 30, 2022 at 15:05.
msaravia is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." lethu OpenFOAM Meshing & Mesh Conversion 1 June 3, 2020 07:49
Fatal error: invalid wall function specification kcc49 OpenFOAM Running, Solving & CFD 13 September 26, 2018 04:07
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 11:32
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 22:07
chtMultiRegionSimpleFoam: crash on parallel run student666 OpenFOAM Running, Solving & CFD 3 April 20, 2017 11:05


All times are GMT -4. The time now is 19:13.