How to define regional initial condition in latest dolfinx?

import dolfinx
from basix.ufl import element
from dolfinx import mesh, fem, io
from dolfinx.fem import functionspace
from mpi4py import MPI
import numpy as np
from petsc4py import PETSc
import ufl
from mpi4py import MPI
from petsc4py import PETSc

import numpy as np

from basix.ufl import element, mixed_element
from dolfinx import fem, io, mesh
from dolfinx.fem.petsc import LinearProblem
from ufl import (Measure, SpatialCoordinate, TestFunctions, TrialFunctions,
                 div, exp, inner)
from mesh_and_plot import create_nested_rectangles

# Time stepping parameters
num_steps = 100
dt = 1 / num_steps
max_iter = 10
tol = 1e-6
domain, markers = create_nested_rectangles()
# Physical constants
R = fem.Constant(domain, np.float64(287.05))
c_v = fem.Constant(domain, np.float64(718.0))
c_p = fem.Constant(domain, np.float64(1005.0))
mu = fem.Constant(domain, np.float64(1.81e-5))
kappa = fem.Constant(domain, np.float64(0.025))

# Create mesh
length = 0.4
height = 0.4
nx = 40
ny = 40

# Create mesh and markers using the previously defined function


# Define function spaces
# Create elements
P1_pressure = element("Lagrange", domain.basix_cell(), degree=1,  dtype=dolfinx.default_real_type)
P1_velocity = element("Lagrange", domain.basix_cell(), degree=1, shape=(domain.geometry.dim,), dtype=dolfinx.default_real_type)
P1_temperature = element("Lagrange", domain.basix_cell(), degree=1, dtype=dolfinx.default_real_type)
V_u, V_p, V_T = functionspace(domain, P1_velocity), functionspace(domain, P1_pressure),functionspace(domain, P1_temperature)
V_fluid = mixed_element([P1_pressure, P1_velocity, P1_temperature])
V_fluid_fs=functionspace(domain,V_fluid)
p_init = fem.Function(V_p)
u_init = fem.Function(V_u)
T_init = fem.Function(V_T)

this is the code that defines function space and mixed element space, then I want to define an initial condition, for example, for p_init, such that when in a Circular Region( Definition:A circular region is defined with its center at (0.0, 0.2) and a radius of 0.06.This is determined by the equation: (x - center_x)^2 + (y - center_y)^2 < radius^2), the pressure in this circular region is high pressure (6,746,268.65 Pa),Outside the circle is the Low pressure (100,000 Pa), how to do this in latest version of dolfinx?

import dolfinx
from basix.ufl import element
from dolfinx import mesh, fem, io
from dolfinx.fem import functionspace
from mpi4py import MPI
import numpy as np
from petsc4py import PETSc
import ufl
from mpi4py import MPI
from petsc4py import PETSc

import numpy as np

from basix.ufl import element, mixed_element
from dolfinx import fem, io, mesh
from dolfinx.fem.petsc import LinearProblem
from ufl import (Measure, SpatialCoordinate, TestFunctions, TrialFunctions,
                 div, exp, inner)
from mesh_and_plot import create_nested_rectangles

# Time stepping parameters
num_steps = 100
dt = 1 / num_steps
max_iter = 10
tol = 1e-6
domain, markers = create_nested_rectangles()
# Physical constants
R = fem.Constant(domain, np.float64(287.05))
c_v = fem.Constant(domain, np.float64(718.0))
c_p = fem.Constant(domain, np.float64(1005.0))
mu = fem.Constant(domain, np.float64(1.81e-5))
kappa = fem.Constant(domain, np.float64(0.025))

# Create mesh
length = 0.4
height = 0.4
nx = 40
ny = 40

# Create mesh and markers using the previously defined function


# Define function spaces
# Create elements
P1_pressure = element("Lagrange", domain.basix_cell(), degree=1,  dtype=dolfinx.default_real_type)
P1_velocity = element("Lagrange", domain.basix_cell(), degree=1, shape=(domain.geometry.dim,), dtype=dolfinx.default_real_type)
P1_temperature = element("Lagrange", domain.basix_cell(), degree=1, dtype=dolfinx.default_real_type)
V_u, V_p, V_T = functionspace(domain, P1_velocity), functionspace(domain, P1_pressure),functionspace(domain, P1_temperature)
V_fluid = mixed_element([P1_pressure, P1_velocity, P1_temperature])
V_fluid_fs=functionspace(domain,V_fluid)
p_init = fem.Function(V_p)
u_init = fem.Function(V_u)
T_init = fem.Function(V_T)

# Define expressions for each component
# Define initial condition parameters


center_x = 0.0
center_y = 0.2
radius = 0.06
high_pressure = 6746268.65
low_pressure = 100000.0
high_temp = 1465.0
low_temp = 290.0

def initial_condition_expr(x, high_val, low_val, center_x, center_y, radius):
    values = np.zeros(x.shape[1])
    r_squared = (x[0] - center_x)**2 + (x[1] - center_y)**2
    values = np.where(r_squared < radius**2, high_val, low_val)
    return values

# Create functions for individual fields

# Apply initial conditions to individual fields
p_init.interpolate(lambda x: initial_condition_expr(x, high_pressure, low_pressure,
                                               center_x, center_y, radius))
T_init.interpolate(lambda x: initial_condition_expr(x, high_temp, low_temp,
                                               center_x, center_y, radius))
u_init.interpolate(lambda x: np.zeros((2, x.shape[1])))

# Create the mixed function for the complete solution
solution = fem.Function(V_fluid_fs)

# Assign initial values to each component of the mixed function
solution.sub(0).interpolate(p_init)  # Pressure component
solution.sub(1).interpolate(u_init)  # Velocity component
solution.sub(2).interpolate(T_init)  # Temperature component

I find out how to do this

Consider using something similar to dolfinx/python/test/unit/fem/test_interpolation.py at 6443e3b27d29aec04ce83d8424b57c339e35f865 · FEniCS/dolfinx · GitHub , where you call interpolation on a subset of the cells of the mesh.