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

How to Use String Pattern Operator ('*')

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2024, 11:37
Post How to Use String Pattern Operator ('*')
  #1
New Member
 
Dylan Sitarski
Join Date: Jun 2024
Posts: 1
Rep Power: 0
dylsitarski is on a distinguished road
Hello, I have found it difficult to find any information on the '*' character used in OpenFoam to apply a value to variables matching the associated pattern. It is likely an easy usage, but it would be nice to have this better documented and understood.

One example that I know of is to select all keys in a dictionary one should use something like the following (which would set all relaxation factors to 0.9, not really recommended):
Code:
relaxationFactors
{
    fields
    {
        ".*" 0.9;
    }
    equations
    {
        ".*" 0.9;
    }
}
First, why is the '.' included in this case? Second, and more important, how can one select all variables of a specific pattern, such as field or equation variables which end in '...Final'?
dylsitarski is offline   Reply With Quote

Old   June 19, 2024, 11:52
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Dylan,

Have a look at the Regular Expressions section of the user guide:
https://doc.cfd.direct/openfoam/user...ic-file-format

It should answer your questions!

Regards,
Yann
Yann 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
ANSYS Workbench on "Uncertified" Linux Distros hsr CFX 289 April 20, 2023 10:23
parallel run error cma-permission-denied supvato OpenFOAM Running, Solving & CFD 3 October 10, 2022 05:48
Recursive output of Foam::word in gdb print command chengdi OpenFOAM Programming & Development 1 July 19, 2017 21:19
FLUENT installation on UBUNTU 12.04 (LTS) teymourj FLUENT 2 March 1, 2017 23:24
Wave pattern of ship is strange (VOF) Qingsong Fluent Multiphase 1 April 25, 2016 12:49


All times are GMT -4. The time now is 14:34.