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 Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By msaravia

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2022, 14:45
Default How to get a non-const referento to fvBoundaryMesh
  #1
Member
 
Martin
Join Date: Dec 2011
Posts: 39
Rep Power: 13
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 16:05.
msaravia is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:49
Fatal error: invalid wall function specification kcc49 OpenFOAM Running, Solving & CFD 13 September 26, 2018 05:07
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 12:32
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 23:07
chtMultiRegionSimpleFoam: crash on parallel run student666 OpenFOAM Running, Solving & CFD 3 April 20, 2017 12:05


All times are GMT -4. The time now is 23:28.