|
[Sponsors] |
Overwrite subdictionary using a string at runtime |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 7, 2014, 07:05 |
Overwrite subdictionary using a string at runtime
|
#1 |
Senior Member
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22 |
Hi,
I am looking for a way to insert a string into a subdictionary during runtime. This is not an elegant solution and it's part of a workaround to OpenFOAM 2.2.x port of Mesquite. I am discussing the reasons for this workaround with the creator of the port over here: https://github.com/smenon/dynamicTopoFvMesh/issues/4 I would like to place patch information into a subdictionary. The main problem is that the patches are not an IO object and they are read from dynamicMeshDict. For separate reasons I would like to keep it like this for now. I will describe the situation in steps: Code:
Info << fvpDict << endl; Code:
{ GEOM { type sixDoFRigidBodyDisplacement; centreOfMass ( 0.5 0.83 0 ); momentOfInertia ( 1 1 0.01 ); mass 0.01; rhoName rhoInf; rhoInf 1000; report on; accelerationRelaxation 0.5; value uniform ( 0 0 0 ); } } Code:
pField().updateCoeffs(); Info << pField() << endl; Code:
type sixDoFRigidBodyDisplacement; rhoName rhoInf; rhoInf 1000; g (0 0 0); centreOfMass (0.5 0.83 0); orientation (1 0 0 0 1 0 0 0 1); velocity (-0.0008491605002 -2.316277561e-20 -1.253434956e-22); acceleration (-16.98321 -4.632555122e-16 -2.506869911e-18); angularMomentum (7.472962772e-24 -6.482573965e-25 -7.048032152e-06); torque (1.494592554e-19 -1.296514793e-20 -0.140960643); initialCentreOfMass (0.5 0.83 0); initialOrientation (1 0 0 0 1 0 0 0 1); momentOfInertia (1 1 0.01); mass 0.01; accelerationRelaxation 0.5; report on; initialPoints nonuniform List<vector> 168 ( (0 -0.9499999881 0.02828427125) (0 -0.9499999881 -0.02828427125) (-0.03436942399 -0.9363066554 -0.02828427125) (-0.03436942399 -0.9363066554 0.02828427125) (0.03436942026 -0.9363066554 0.02828427125) (0.03436942026 -0.9363066554 -0.02828427125) (0 0.9499999881 0.02828427125) (-0.03436942399 0.9363066554 0.02828427125) (-0.03436942399 0.9363066554 -0.02828427125) (0 0.9499999881 -0.02828427125) (0.03436942026 0.9363066554 -0.02828427125) (0.03436942026 0.9363066554 0.02828427125) (-0.05000000075 0.8550000191 0.02828427125) (-0.05000000075 0.8550000191 -0.02828427125) (-0.05000000075 0.8999999762 -0.02828427125) (-0.05000000075 0.8999999762 0.02828427125) (0.05000000075 0.8550000191 0.02828427125) (0.05000000075 0.8999999762 0.02828427125) (0.05000000075 0.8999999762 -0.02828427125) (0.05000000075 0.8550000191 -0.02828427125) (0.05000000075 -0.8550000191 0.02828427125) (0.05000000075 -0.8550000191 -0.02828427125) (0.05000000075 -0.8999999762 -0.02828427125) (0.05000000075 -0.8999999762 0.02828427125) (-0.05000000075 -0.8550000191 0.02828427125) (-0.05000000075 -0.8999999762 0.02828427125) (-0.05000000075 -0.8999999762 -0.02828427125) (-0.05000000075 -0.8550000191 -0.02828427125) (0.05000000075 -0.2849999964 0.02828427125) (0.05000000075 -0.2849999964 -0.02828427125) (0.05000000075 -0.3324999809 -0.02828427125) (0.05000000075 -0.3324999809 0.02828427125) (0.05000000075 -0.237499997 0.02828427125) (0.05000000075 -0.237499997 -0.02828427125) (-0.05000000075 -0.8075000048 -0.02828427125) (-0.05000000075 -0.8075000048 0.02828427125) (-0.05000000075 -0.7599999905 0.02828427125) (-0.05000000075 -0.7599999905 -0.02828427125) (0.05000000075 -0.5699999928 0.02828427125) (0.05000000075 -0.5699999928 -0.02828427125) (0.05000000075 -0.6174999475 -0.02828427125) (0.05000000075 -0.6174999475 0.02828427125) (0.05000000075 -0.6649999619 0.02828427125) (0.05000000075 -0.6649999619 -0.02828427125) (0.05000000075 -0.5224999785 0.02828427125) (0.05000000075 -0.5224999785 -0.02828427125) (0.05000000075 -0.474999994 0.02828427125) (0.05000000075 -0.474999994 -0.02828427125) (0.05000000075 -0.4275000095 0.02828427125) (0.05000000075 -0.4275000095 -0.02828427125) (0.05000000075 -0.7124999762 -0.02828427125) (0.05000000075 -0.7124999762 0.02828427125) (0.05000000075 -0.7599999905 0.02828427125) (0.05000000075 -0.7599999905 -0.02828427125) (0.05000000075 -0.8075000048 0.02828427125) (0.05000000075 -0.8075000048 -0.02828427125) (-0.05000000075 -0.5699999928 0.02828427125) (-0.05000000075 -0.5699999928 -0.02828427125) (-0.05000000075 -0.5224999785 -0.02828427125) (-0.05000000075 -0.5224999785 0.02828427125) (-0.05000000075 -0.474999994 0.02828427125) (-0.05000000075 -0.474999994 -0.02828427125) (-0.05000000075 -0.4275000095 -0.02828427125) (-0.05000000075 -0.4275000095 0.02828427125) (-0.05000000075 -0.6649999619 0.02828427125) (-0.05000000075 -0.7124999762 0.02828427125) (-0.05000000075 -0.7124999762 -0.02828427125) (-0.05000000075 -0.6649999619 -0.02828427125) (-0.05000000075 -0.6174999475 0.02828427125) (-0.05000000075 -0.6174999475 -0.02828427125) (0.05000000075 0.3799999952 0.02828427125) (0.05000000075 0.3799999952 -0.02828427125) (0.05000000075 0.3324999809 -0.02828427125) (0.05000000075 0.3324999809 0.02828427125) (0.05000000075 0.4275000095 0.02828427125) (0.05000000075 0.4275000095 -0.02828427125) (0.05000000075 0.474999994 0.02828427125) (0.05000000075 0.474999994 -0.02828427125) (-0.05000000075 0.474999994 0.02828427125) (-0.05000000075 0.4275000095 0.02828427125) (-0.05000000075 0.4275000095 -0.02828427125) (-0.05000000075 0.474999994 -0.02828427125) (-0.05000000075 0.5224999785 -0.02828427125) (-0.05000000075 0.5224999785 0.02828427125) (0.05000000075 0.6649999619 0.02828427125) (0.05000000075 0.7124999762 0.02828427125) (0.05000000075 0.7124999762 -0.02828427125) (0.05000000075 0.6649999619 -0.02828427125) (0.05000000075 0.8075000048 -0.02828427125) (0.05000000075 0.8075000048 0.02828427125) (0.05000000075 0.5224999785 0.02828427125) (0.05000000075 0.5224999785 -0.02828427125) (0.05000000075 0.6174999475 -0.02828427125) (0.05000000075 0.6174999475 0.02828427125) (0.05000000075 0.5699999928 0.02828427125) (0.05000000075 0.5699999928 -0.02828427125) (-0.05000000075 0.6649999619 0.02828427125) (-0.05000000075 0.6174999475 0.02828427125) (-0.05000000075 0.6174999475 -0.02828427125) (-0.05000000075 0.6649999619 -0.02828427125) (-0.05000000075 0.7124999762 -0.02828427125) (-0.05000000075 0.7124999762 0.02828427125) (-0.05000000075 0.8075000048 0.02828427125) (-0.05000000075 0.8075000048 -0.02828427125) (0.05000000075 0.2849999964 0.02828427125) (0.05000000075 0.2849999964 -0.02828427125) (-0.05000000075 0.2849999964 0.02828427125) (-0.05000000075 0.237499997 0.02828427125) (-0.05000000075 0.237499997 -0.02828427125) (-0.05000000075 0.2849999964 -0.02828427125) (-0.05000000075 0.3324999809 -0.02828427125) (-0.05000000075 0.3324999809 0.02828427125) (0.05000000075 0.09499999881 0.02828427125) (0.05000000075 0.09499999881 -0.02828427125) (0.05000000075 0.0474999994 -0.02828427125) (0.05000000075 0.0474999994 0.02828427125) (-0.05000000075 0.09499999881 0.02828427125) (-0.05000000075 0.0474999994 0.02828427125) (-0.05000000075 0.0474999994 -0.02828427125) (-0.05000000075 0.09499999881 -0.02828427125) (-0.05000000075 0.1424999982 -0.02828427125) (-0.05000000075 0.1424999982 0.02828427125) (0.05000000075 0.1424999982 0.02828427125) (0.05000000075 0.1424999982 -0.02828427125) (0.05000000075 0.1899999976 0.02828427125) (0.05000000075 0.1899999976 -0.02828427125) (0.05000000075 0.237499997 -0.02828427125) (0.05000000075 0.237499997 0.02828427125) (-0.05000000075 -0.2849999964 0.02828427125) (-0.05000000075 -0.2849999964 -0.02828427125) (-0.05000000075 -0.237499997 -0.02828427125) (-0.05000000075 -0.237499997 0.02828427125) (-0.05000000075 -0.3324999809 0.02828427125) (-0.05000000075 -0.3324999809 -0.02828427125) (0.05000000075 -0.09499999881 0.02828427125) (0.05000000075 -0.09499999881 -0.02828427125) (0.05000000075 -0.1424999982 -0.02828427125) (0.05000000075 -0.1424999982 0.02828427125) (-0.05000000075 -0.09499999881 0.02828427125) (-0.05000000075 -0.1424999982 0.02828427125) (-0.05000000075 -0.1424999982 -0.02828427125) (-0.05000000075 -0.09499999881 -0.02828427125) (-0.05000000075 -0.0474999994 -0.02828427125) (-0.05000000075 -0.0474999994 0.02828427125) (0.05000000075 -0.0474999994 0.02828427125) (0.05000000075 -0.0474999994 -0.02828427125) (0.05000000075 -0.1899999976 0.02828427125) (0.05000000075 -0.1899999976 -0.02828427125) (-0.05000000075 -0.1899999976 0.02828427125) (-0.05000000075 -0.1899999976 -0.02828427125) (-0.05000000075 0.1899999976 0.02828427125) (-0.05000000075 0.1899999976 -0.02828427125) (-0.05000000075 0.5699999928 0.02828427125) (-0.05000000075 0.5699999928 -0.02828427125) (0.05000000075 -0.3799999952 0.02828427125) (0.05000000075 -0.3799999952 -0.02828427125) (-0.05000000075 -0.3799999952 0.02828427125) (-0.05000000075 -0.3799999952 -0.02828427125) (-0.05000000075 0.3799999952 0.02828427125) (-0.05000000075 0.3799999952 -0.02828427125) (0.05000000075 0.7599999905 0.02828427125) (0.05000000075 0.7599999905 -0.02828427125) (-0.05000000075 0.7599999905 0.02828427125) (-0.05000000075 0.7599999905 -0.02828427125) (-0.05000000075 0 0.02828427125) (-0.05000000075 0 -0.02828427125) (0.05000000075 0 0.02828427125) (0.05000000075 0 -0.02828427125) ) ; value nonuniform List<vector> 168 ( (0 0 0) (0 0 0) (2.081668171e-17 0 0) (2.081668171e-17 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (0 0 0) (2.081668171e-17 0 0) (2.081668171e-17 0 0) (0 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (6.938893904e-18 1.110223025e-16 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 5.551115123e-17 0) (-6.938893904e-18 5.551115123e-17 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 8.326672685e-17 0) (-6.938893904e-18 8.326672685e-17 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 -1.110223025e-16 0) (-6.938893904e-18 -1.110223025e-16 0) (-6.938893904e-18 -1.110223025e-16 0) (-6.938893904e-18 -1.110223025e-16 0) (-6.938893904e-18 5.551115123e-17 0) (-6.938893904e-18 5.551115123e-17 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 -1.110223025e-16 0) (6.938893904e-18 -1.110223025e-16 0) (6.938893904e-18 5.551115123e-17 0) (6.938893904e-18 5.551115123e-17 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 -1.110223025e-16 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 -1.110223025e-16 0) (6.938893904e-18 1.110223025e-16 0) (6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 -5.551115123e-17 0) (-6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 2.775557562e-17 0) (6.938893904e-18 2.775557562e-17 0) (6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 -1.387778781e-17 0) (-6.938893904e-18 -1.387778781e-17 0) (-6.938893904e-18 4.857225733e-17 0) (-6.938893904e-18 4.857225733e-17 0) (6.938893904e-18 -1.387778781e-17 0) (6.938893904e-18 4.857225733e-17 0) (6.938893904e-18 4.857225733e-17 0) (6.938893904e-18 -1.387778781e-17 0) (6.938893904e-18 2.775557562e-17 0) (6.938893904e-18 2.775557562e-17 0) (-6.938893904e-18 2.775557562e-17 0) (-6.938893904e-18 2.775557562e-17 0) (-6.938893904e-18 -2.775557562e-17 0) (-6.938893904e-18 -2.775557562e-17 0) (-6.938893904e-18 2.775557562e-17 0) (-6.938893904e-18 2.775557562e-17 0) (6.938893904e-18 5.551115123e-17 0) (6.938893904e-18 5.551115123e-17 0) (6.938893904e-18 8.326672685e-17 0) (6.938893904e-18 8.326672685e-17 0) (6.938893904e-18 1.110223025e-16 0) (6.938893904e-18 1.110223025e-16 0) (-6.938893904e-18 1.387778781e-17 0) (-6.938893904e-18 1.387778781e-17 0) (-6.938893904e-18 -2.775557562e-17 0) (-6.938893904e-18 -2.775557562e-17 0) (6.938893904e-18 1.387778781e-17 0) (6.938893904e-18 -2.775557562e-17 0) (6.938893904e-18 -2.775557562e-17 0) (6.938893904e-18 1.387778781e-17 0) (6.938893904e-18 -4.857225733e-17 0) (6.938893904e-18 -4.857225733e-17 0) (-6.938893904e-18 -4.857225733e-17 0) (-6.938893904e-18 -4.857225733e-17 0) (-6.938893904e-18 -8.326672685e-17 0) (-6.938893904e-18 -8.326672685e-17 0) (6.938893904e-18 -8.326672685e-17 0) (6.938893904e-18 -8.326672685e-17 0) (6.938893904e-18 -2.775557562e-17 0) (6.938893904e-18 -2.775557562e-17 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 -5.551115123e-17 0) (-6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 -5.551115123e-17 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (6.938893904e-18 0 0) (-6.938893904e-18 0 0) (-6.938893904e-18 0 0) ) ; Please let me know if that's possible with current implementation of dictionary object. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
runTime | deji | OpenFOAM | 2 | January 17, 2019 10:14 |
Problem in3D model processing | mebinitap | OpenFOAM | 2 | December 12, 2014 05:40 |
Creating a new field from terms of the turbulence model | HaZe | OpenFOAM Programming & Development | 15 | November 24, 2014 14:51 |
runTime out of scope in functionObject | Sune | OpenFOAM Programming & Development | 2 | September 26, 2012 03:11 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |