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

Modify pointDisplacement field from within solver?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By nowhere

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2010, 09:43
Default Modify pointDisplacement field from within solver?
  #1
New Member
 
nick stoppelkamp
Join Date: Jul 2009
Posts: 4
Rep Power: 16
nowhere is on a distinguished road
Hi,

I am currently trying to move some boundary points (in normal direction) with OpenFoam 1.6. Therefore I am playing around with the dynamicFvMesh stuff. This is all working great. I have created a 'dynamicMeshDict' containing:
dynamicFvMesh dynamicMotionSolverFvMesh;
solver displacementLaplacian;


I have also create a 'pointDisplacement' file and modified it sth some points are moved. This also works as expected and paraView shows the result as expected.

In the next step I tried to modify the pointDisplacement field from within my solver/application.
I get a reference by using
pointVectorField &pointDisp = const_cast<pointVectorField&>( mesh.lookupObject<pointVectorField>("pointDisplacement") );

This should be ok, but as soon as I try to access the field eg by writing
Info << pointDisp;
I can't compile anymore. wmake aborts saying

[...]
modifyMeshFoam.C:91: instantiated from here
/app/openfoam/1.6.0/OpenFOAM-1.6/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:408: error: invalid use of incomplete type ‘const struct Foam:ointPatchField<Foam::Vector<double> >’
/app/openfoam/1.6.0/OpenFOAM-1.6/src/OpenFOAM/lnInclude/pointFieldsFwd.H:50: error: declaration of ‘const struct Foam:ointPatchField<Foam::Vector<double> >’
make: *** [Make/linux64GccDPOpt/modifyMeshFoam.o] Error 1


Can anyone please help me with that?

Best regards,
Nick
nowhere is offline   Reply With Quote

Old   September 23, 2010, 05:26
Default
  #2
New Member
 
nick stoppelkamp
Join Date: Jul 2009
Posts: 4
Rep Power: 16
nowhere is on a distinguished road
ok, I have just managed to modify the boundaryField of pointDisplacement.

PHP Code:
#include "fixedValuePointPatchField.H"
// ...

int main ( ... )
// ...

pointVectorField &pointDisp const_cast<pointVectorField&>( mesh.lookupObject<pointVectorField>("pointDisplacement") );

fixedValuePointPatchField<vector> &boundaryPatch dynamic_cast<fixedValuePointPatchField<vector> &> (pointDisp.boundaryField()[patchID] );

// values can be changed eg by writing
boundaryPatch[0][1] = 6
fumiya and alexlupo like this.
nowhere is offline   Reply With Quote

Old   October 13, 2011, 14:53
Default
  #3
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17
Arnoldinho is on a distinguished road
Nick,

would you mind sharing your #include list? I'm always getting
Quote:
error: no match for ‘operator[]’ in ‘boundaryPatch[0]
Thanks,
Arne
Arnoldinho is offline   Reply With Quote

Reply

Tags
pointdisplacement, pointvectorfield

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
smoothSolver diverges - solution in using PBiCG solver? makaveli_lcf OpenFOAM Running, Solving & CFD 3 September 11, 2013 13:44
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 19:06
Getting too many iterations by velocity solving (aborting). Changing U - Solver? suitup OpenFOAM Running, Solving & CFD 0 January 20, 2010 08:45
modify the source code of simpleSRFFoam solver Pirlo OpenFOAM Programming & Development 0 October 19, 2009 09:49
Unknown solver type laplaceCellDecomposition gwierink OpenFOAM Running, Solving & CFD 1 September 25, 2009 06:51


All times are GMT -4. The time now is 01:24.